提交 42e76af7 编写于 作者: Shine-zwj's avatar Shine-zwj

update:更新

上级 8e0f8f66
<#ibizinclude>
../../@VIEW/@MACRO/VIEW_LAYOUTPANEL/VIEW_LAYOUTPANEL_RENDER.ftl
</#ibizinclude>
<template>
<#if ctrl.render??> <#if ctrl.render??>
${ctrl.render.code} ${ctrl.render.code}
<#else> <#else>
<#if ctrl.getLayoutMode()?? && ctrl.getLayoutMode() == "FLEX"> <#if ctrl.getLayoutMode()=='FLEX'>
<div class="app-layoutpanel ${ctrl.getCodeName()}<#if ctrl.getPSSysCss?? && ctrl.getPSSysCss()??> ${ctrl.getPSSysCss().getCssName()}</#if>" v-loading="isLayoutLoadding" :style="{width: <#if ctrl.getWidth()?? && ctrl.getWidth() gt 0>'${ctrl.getWidth()?c}px'<#else>'100%'</#if>, height: <#if ctrl.getHeight() gt 0>'${ctrl.getHeight()?c}px'<#else>'100%'</#if>, 'display': 'flex', 'flex-direction': 'column'}"> <row class="app-layoutpanel <#if ctrl.getPSSysCss?? && ctrl.getPSSysCss()??><#assign singleCss = ctrl.getPSSysCss()> ${singleCss.getCssName()}</#if>" style="width:<#if ctrl.getWidth()?? && ctrl.getWidth() gt 0>${ctrl.getWidth()?c}px<#else>100%</#if>;height:<#if ctrl.getHeight() gt 0>${ctrl.getHeight()?c}px;<#else>100%;</#if>display: flex;">
<#else> <@ibizindent blank=8>
<div class="app-layoutpanel ${ctrl.getCodeName()}<#if ctrl.getPSSysCss?? && ctrl.getPSSysCss()??> ${ctrl.getPSSysCss().getCssName()}</#if>" v-loading="isLayoutLoadding" :style="{width: <#if ctrl.getWidth()?? && ctrl.getWidth() gt 0>'${ctrl.getWidth()?c}px'<#else>'100%'</#if>, height: <#if ctrl.getHeight() gt 0>'${ctrl.getHeight()?c}px'<#else>'100%'</#if>, overflow: 'auto'}"> <#if ctrl.getRootPSPanelItems()??>
</#if> <#list ctrl.getRootPSPanelItems() as item>
<#if ctrl.getRootPSPanelItems()??> ${P.getPartCode(item).code}
<template v-show="!isLayoutLoadding"> </#list>
<#list ctrl.getRootPSPanelItems() as panelDetail> </#if>
<@renderByDetailType panelDetail ctrl false/> </@ibizindent>
</#list> </row>
</template> <#else>
</#if> <row class="app-layoutpanel <#if ctrl.getPSSysCss?? && ctrl.getPSSysCss()??><#assign singleCss = ctrl.getPSSysCss()> ${singleCss.getCssName()}</#if>" style="width:<#if ctrl.getWidth()?? && ctrl.getWidth() gt 0>${ctrl.getWidth()?c}px<#else>100%</#if>;height:<#if ctrl.getHeight() gt 0>${ctrl.getHeight()?c}px<#else>100%</#if>;">
</div> <@ibizindent blank=8>
<#if ctrl.getRootPSPanelItems()??>
<#list ctrl.getRootPSPanelItems() as item>
${P.getPartCode(item).code}
</#list>
</#if>
</@ibizindent>
</row>
</#if>
</#if> </#if>
\ No newline at end of file
</template>
\ No newline at end of file
${P.getPartCode(item,'PANEL').code} <template>
${P.getPartCode(item,'PANEL').code}
</template>
<#assign import_block> <#assign import_block>
import { PanelDetailModel,PanelRawitemModel,PanelTabPanelModel,PanelTabPageModel,PanelFieldModel,PanelContainerModel,PanelControlModel,PanelUserControlModel,PanelButtonModel } from '@/model/panel-detail'; import { PanelDetailModel,PanelRawitemModel,PanelTabPanelModel,PanelTabPageModel,PanelFieldModel,PanelContainerModel,PanelControlModel,PanelUserControlModel,PanelButtonModel } from '@/model/panel-detail';
import ${srfclassname('${ctrl.codeName}')}Model from './${srffilepath2(ctrl.codeName)}-${ctrl.getControlType()?lower_case}-model'; import ${srfclassname('${ctrl.codeName}')}Model from './${srffilepath2(ctrl.codeName)}-${ctrl.getControlType()?lower_case}-model';
...@@ -7,9 +9,6 @@ import UIService from '@/uiservice/ui-service'; ...@@ -7,9 +9,6 @@ import UIService from '@/uiservice/ui-service';
</#assign> </#assign>
<#ibizinclude> <#ibizinclude>
../@MACRO/CONTROL/CONTROL_HEADER-BASE.vue.ftl ../@MACRO/CONTROL/CONTROL_HEADER-BASE.vue.ftl
</#ibizinclude>
<#ibizinclude>
../../@MACRO/PANEL.ftl
</#ibizinclude> </#ibizinclude>
/** /**
...@@ -19,10 +18,10 @@ import UIService from '@/uiservice/ui-service'; ...@@ -19,10 +18,10 @@ import UIService from '@/uiservice/ui-service';
* @memberof ${srfclassname('${ctrl.codeName}')}Base * @memberof ${srfclassname('${ctrl.codeName}')}Base
*/ */
getDatas(): any[] { getDatas(): any[] {
if (!this.layoutData) { if (!this.panelData) {
return []; return [];
} }
return [this.layoutData]; return [this.panelData];
} }
/** /**
...@@ -32,7 +31,7 @@ import UIService from '@/uiservice/ui-service'; ...@@ -32,7 +31,7 @@ import UIService from '@/uiservice/ui-service';
* @memberof ${srfclassname('${ctrl.codeName}')}Base * @memberof ${srfclassname('${ctrl.codeName}')}Base
*/ */
getData() { getData() {
return this.layoutData; return this.panelData;
} }
/** /**
...@@ -67,6 +66,22 @@ import UIService from '@/uiservice/ui-service'; ...@@ -67,6 +66,22 @@ import UIService from '@/uiservice/ui-service';
*/ */
public data:any = {}; public data:any = {};
/**
* 面板数据对象
*
* @type {*}
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public panelData:any = null;
/**
* 视图布局数据
*
* @type {*}
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public layoutData:any = {};
/** /**
* 数据模型对象 * 数据模型对象
* *
...@@ -102,28 +117,14 @@ import UIService from '@/uiservice/ui-service'; ...@@ -102,28 +117,14 @@ import UIService from '@/uiservice/ui-service';
</#if> </#if>
/** /**
* 布局面板顶级成员名称 * 详情模型集合
* *
* @type {*} * @type {*}
* @memberof ${srfclassname('${ctrl.codeName}')}Base * @memberof ${srfclassname('${ctrl.codeName}')}Base
*/ */
public rootLayoutDetailNames: string[] = <@compress single_line=true>[ public detailsModel: any = {
<#if ctrlgetRootPSPanelItems?? && ctrl.getRootPSPanelItems()??>
<#list ctrl.getRootPSPanelItems() as panelItem>
'${panelItem.name}'<#if panelItem_has_next>,</#if>
</#list>
</#if>
];</@compress>
/**
* 布局面板项模型对象
*
* @type {*}
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public layoutItems:any = {
<#list ctrl.getAllPSPanelItems() as panelItem> <#list ctrl.getAllPSPanelItems() as panelItem>
<#-- <@getPanelItemModel panelItem 'ITEMLAYOUT'/> --> ${panelItem.name}: ${P.getPartCode(panelItem, 'ITEM_MODEL').code},
</#list> </#list>
}; };
...@@ -155,7 +156,7 @@ import UIService from '@/uiservice/ui-service'; ...@@ -155,7 +156,7 @@ import UIService from '@/uiservice/ui-service';
public onInputDataChange(newVal: any, oldVal: any){ public onInputDataChange(newVal: any, oldVal: any){
if(newVal){ if(newVal){
this.computedUIData(newVal); this.computedUIData(newVal);
this.layoutData = Util.deepCopy(newVal); this.panelData = Util.deepCopy(newVal);
this.computeButtonState(newVal); this.computeButtonState(newVal);
this.panelLogic({ name: '', newVal: null, oldVal: null }); this.panelLogic({ name: '', newVal: null, oldVal: null });
this.$forceUpdate(); this.$forceUpdate();
...@@ -186,21 +187,21 @@ import UIService from '@/uiservice/ui-service'; ...@@ -186,21 +187,21 @@ import UIService from '@/uiservice/ui-service';
// 若为项布局面板,存在parentRef // 若为项布局面板,存在parentRef
if(this.parentRef){ if(this.parentRef){
let targetData:any = this.parentRef.transformData(data); let targetData:any = this.parentRef.transformData(data);
if(this.layoutModelDetails && Object.keys(this.layoutModelDetails).length >0){ if(this.detailsModel && Object.keys(this.detailsModel).length >0){
Object.keys(this.layoutModelDetails).forEach((name:any) =>{ Object.keys(this.detailsModel).forEach((name:any) =>{
if(this.layoutModelDetails[name] && this.layoutModelDetails[name].uiAction && this.layoutModelDetails[name].uiAction.dataAccaction && Object.is(this.layoutModelDetails[name].itemType,"BUTTON")){ if(this.detailsModel[name] && this.detailsModel[name].uiaction && this.detailsModel[name].uiaction.dataaccaction && Object.is(this.detailsModel[name].itemType,"BUTTON")){
let tempUIAction:any = JSON.parse(JSON.stringify(this.layoutModelDetails[name].uiAction)); this.detailsModel[name].isPower = true;
let result: any[] = ViewTool.calcActionItemAuthState(targetData, [tempUIAction], this.appUIService ? this.appUIService : null); let tempUIAction:any = JSON.parse(JSON.stringify(this.detailsModel[name].uiaction));
this.layoutModelDetails[name].visible = tempUIAction.visabled; let result: any[] = ViewTool.calcActionItemAuthState(targetData,[tempUIAction],this.appUIService?this.appUIService:null);
this.layoutModelDetails[name].disabled = tempUIAction.disabled; this.detailsModel[name].visible = tempUIAction.visabled;
this.detailsModel[name].disabled = tempUIAction.disabled;
this.detailsModel[name].isPower = result[0] === 1 ? true : false;
} }
}) })
} }
} }
} }
<@panelBase ctrl>
/** /**
* 界面行为 * 界面行为
* *
...@@ -272,21 +273,22 @@ import UIService from '@/uiservice/ui-service'; ...@@ -272,21 +273,22 @@ import UIService from '@/uiservice/ui-service';
} }
/** /**
* 处理值改变 * 设置变更面板编辑项的值
* *
* @public * @param data 面板数据
* @memberof ${srfclassname('${view.name}')}Base * @param {{ name: string, value: any }} $event
* @returns {void}
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/ */
public handleValueChange(args: { name: string, value: any }): void { public onPanelItemValueChange(data: any,$event: { name: string, value: any }): void {
if (!args || !args.name || Object.is(args.name, '') || !this.layoutData.hasOwnProperty(args.name)) { if (!$event) {
return;
}
if (!$event.name || Object.is($event.name, '') || !data.hasOwnProperty($event.name)) {
return; return;
} }
const { name, value } = args; data[$event.name] = $event.value;
this.data[name] = value; this.panelEditItemChange(data, $event.name, $event.value);
this.layoutData[name] = value;
this.layoutModelDetails[name].setData(value);
this.panelLogic(name);
this.panelEditItemChange(this.data, name, value);
} }
/** /**
...@@ -312,17 +314,26 @@ import UIService from '@/uiservice/ui-service'; ...@@ -312,17 +314,26 @@ import UIService from '@/uiservice/ui-service';
} }
/**
* 分页切换事件
*
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public handleTabPanelClick(name:string,$event:any){
this.detailsModel[name].clickPage($event.name);
}
/** /**
* 面板逻辑 * 面板逻辑
* *
* @public * @public
* @param name * @param {{ name: string, newVal: any, oldVal: any }} { name, newVal, oldVal }
* @memberof ${srfclassname('${ctrl.codeName}')}Base * @memberof ${srfclassname('${ctrl.codeName}')}Base
*/ */
public panelLogic(name: string): void { public panelLogic({ name, newVal, oldVal }: { name: string, newVal: any, oldVal: any }): void {
<#list ctrl.getAllPSPanelItems() as panelItem> <#if P.getPartCode(item,'PANEL_LOGIC').code?length gt 0>
<#-- <@panelItemLogic panelItem> --> ${P.getPartCode(item,'PANEL_LOGIC').code}
</#list> </#if>
} }
<#ibizinclude> <#ibizinclude>
......
此差异已折叠。
<#macro panelLogic item>
<@compress single_line=true>
<#if item.getLogicType() == 'GROUP'>
<#if item.isNotMode()>
!(
</#if>
<#if item.getPSPanelItemLogics()??>
<#list item.getPSPanelItemLogics() as subLogic>
<#if subLogic_index gt 0>
<#if item.getGroupOP() == 'AND'>
&&
</#if>
<#if item.getGroupOP() == 'OR'>
||
</#if>
</#if>
<@panelLogic subLogic/>
</#list>
</#if>
<#if item.isNotMode()>
)
</#if>
<#elseif item.getLogicType() == 'SINGLE'>
this.$verify.testCond(_${item.getDstModelField()?lower_case}, "${item.getCondOp()}", "${item.getValue()}")
</#if>
</@compress>
</#macro>
\ No newline at end of file
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册