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

update:更新

上级 8e0f8f66
<#ibizinclude>
../../@VIEW/@MACRO/VIEW_LAYOUTPANEL/VIEW_LAYOUTPANEL_RENDER.ftl
</#ibizinclude>
<template>
<#if ctrl.render??>
${ctrl.render.code}
<#else>
<#if ctrl.getLayoutMode()?? && 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'}">
<#else>
<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>
<#if ctrl.getRootPSPanelItems()??>
<template v-show="!isLayoutLoadding">
<#list ctrl.getRootPSPanelItems() as panelDetail>
<@renderByDetailType panelDetail ctrl false/>
</#list>
</template>
</#if>
</div>
<#if ctrl.getLayoutMode()=='FLEX'>
<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;">
<@ibizindent blank=8>
<#if ctrl.getRootPSPanelItems()??>
<#list ctrl.getRootPSPanelItems() as item>
${P.getPartCode(item).code}
</#list>
</#if>
</template>
\ No newline at end of file
</@ibizindent>
</row>
<#else>
<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>;">
<@ibizindent blank=8>
<#if ctrl.getRootPSPanelItems()??>
<#list ctrl.getRootPSPanelItems() as item>
${P.getPartCode(item).code}
</#list>
</#if>
</@ibizindent>
</row>
</#if>
</#if>
\ No newline at end of file
${P.getPartCode(item,'PANEL').code}
<template>
${P.getPartCode(item,'PANEL').code}
</template>
<#assign import_block>
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';
......@@ -7,9 +9,6 @@ import UIService from '@/uiservice/ui-service';
</#assign>
<#ibizinclude>
../@MACRO/CONTROL/CONTROL_HEADER-BASE.vue.ftl
</#ibizinclude>
<#ibizinclude>
../../@MACRO/PANEL.ftl
</#ibizinclude>
/**
......@@ -19,10 +18,10 @@ import UIService from '@/uiservice/ui-service';
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
getDatas(): any[] {
if (!this.layoutData) {
if (!this.panelData) {
return [];
}
return [this.layoutData];
return [this.panelData];
}
/**
......@@ -32,7 +31,7 @@ import UIService from '@/uiservice/ui-service';
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
getData() {
return this.layoutData;
return this.panelData;
}
/**
......@@ -67,6 +66,22 @@ import UIService from '@/uiservice/ui-service';
*/
public data:any = {};
/**
* 面板数据对象
*
* @type {*}
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public panelData:any = null;
/**
* 视图布局数据
*
* @type {*}
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public layoutData:any = {};
/**
* 数据模型对象
*
......@@ -102,29 +117,15 @@ import UIService from '@/uiservice/ui-service';
</#if>
/**
* 布局面板顶级成员名称
* 详情模型集合
*
* @type {*}
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public rootLayoutDetailNames: string[] = <@compress single_line=true>[
<#if ctrlgetRootPSPanelItems?? && ctrl.getRootPSPanelItems()??>
<#list ctrl.getRootPSPanelItems() as panelItem>
'${panelItem.name}'<#if panelItem_has_next>,</#if>
public detailsModel: any = {
<#list ctrl.getAllPSPanelItems() as panelItem>
${panelItem.name}: ${P.getPartCode(panelItem, 'ITEM_MODEL').code},
</#list>
</#if>
];</@compress>
/**
* 布局面板项模型对象
*
* @type {*}
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public layoutItems:any = {
<#list ctrl.getAllPSPanelItems() as panelItem>
<#-- <@getPanelItemModel panelItem 'ITEMLAYOUT'/> -->
</#list>
};
/**
......@@ -155,7 +156,7 @@ import UIService from '@/uiservice/ui-service';
public onInputDataChange(newVal: any, oldVal: any){
if(newVal){
this.computedUIData(newVal);
this.layoutData = Util.deepCopy(newVal);
this.panelData = Util.deepCopy(newVal);
this.computeButtonState(newVal);
this.panelLogic({ name: '', newVal: null, oldVal: null });
this.$forceUpdate();
......@@ -186,21 +187,21 @@ import UIService from '@/uiservice/ui-service';
// 若为项布局面板,存在parentRef
if(this.parentRef){
let targetData:any = this.parentRef.transformData(data);
if(this.layoutModelDetails && Object.keys(this.layoutModelDetails).length >0){
Object.keys(this.layoutModelDetails).forEach((name:any) =>{
if(this.layoutModelDetails[name] && this.layoutModelDetails[name].uiAction && this.layoutModelDetails[name].uiAction.dataAccaction && Object.is(this.layoutModelDetails[name].itemType,"BUTTON")){
let tempUIAction:any = JSON.parse(JSON.stringify(this.layoutModelDetails[name].uiAction));
let result: any[] = ViewTool.calcActionItemAuthState(targetData, [tempUIAction], this.appUIService ? this.appUIService : null);
this.layoutModelDetails[name].visible = tempUIAction.visabled;
this.layoutModelDetails[name].disabled = tempUIAction.disabled;
if(this.detailsModel && Object.keys(this.detailsModel).length >0){
Object.keys(this.detailsModel).forEach((name:any) =>{
if(this.detailsModel[name] && this.detailsModel[name].uiaction && this.detailsModel[name].uiaction.dataaccaction && Object.is(this.detailsModel[name].itemType,"BUTTON")){
this.detailsModel[name].isPower = true;
let tempUIAction:any = JSON.parse(JSON.stringify(this.detailsModel[name].uiaction));
let result: any[] = ViewTool.calcActionItemAuthState(targetData,[tempUIAction],this.appUIService?this.appUIService:null);
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';
}
/**
* 处理值改变
*
* @public
* @memberof ${srfclassname('${view.name}')}Base
* 设置变更面板编辑项的值
*
* @param data 面板数据
* @param {{ name: string, value: any }} $event
* @returns {void}
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public handleValueChange(args: { name: string, value: any }): void {
if (!args || !args.name || Object.is(args.name, '') || !this.layoutData.hasOwnProperty(args.name)) {
public onPanelItemValueChange(data: any,$event: { name: string, value: any }): void {
if (!$event) {
return;
}
const { name, value } = args;
this.data[name] = value;
this.layoutData[name] = value;
this.layoutModelDetails[name].setData(value);
this.panelLogic(name);
this.panelEditItemChange(this.data, name, value);
if (!$event.name || Object.is($event.name, '') || !data.hasOwnProperty($event.name)) {
return;
}
data[$event.name] = $event.value;
this.panelEditItemChange(data, $event.name, $event.value);
}
/**
......@@ -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
* @param name
* @param {{ name: string, newVal: any, oldVal: any }} { name, newVal, oldVal }
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public panelLogic(name: string): void {
<#list ctrl.getAllPSPanelItems() as panelItem>
<#-- <@panelItemLogic panelItem> -->
</#list>
public panelLogic({ name, newVal, oldVal }: { name: string, newVal: any, oldVal: any }): void {
<#if P.getPartCode(item,'PANEL_LOGIC').code?length gt 0>
${P.getPartCode(item,'PANEL_LOGIC').code}
</#if>
}
<#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 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册