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

更新:多数据容器

上级 2016a4e8
...@@ -9,11 +9,11 @@ ${ctrl.render.code} ...@@ -9,11 +9,11 @@ ${ctrl.render.code}
<#else> <#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'}"> <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 ctrl.getRootPSPanelItems()??>
<template v-if="!isLayoutLoadding"> <div v-show="!isLayoutLoadding" :style="{height: '100%', width: '100%'}">
<#list ctrl.getRootPSPanelItems() as panelDetail> <#list ctrl.getRootPSPanelItems() as panelDetail>
<@renderByDetailType panelDetail ctrl false/> <@renderByDetailType panelDetail ctrl false/>
</#list> </#list>
</template> </div>
</#if> </#if>
</div> </div>
</#if> </#if>
......
...@@ -231,12 +231,13 @@ import UIService from '@/uiservice/ui-service'; ...@@ -231,12 +231,13 @@ import UIService from '@/uiservice/ui-service';
* @memberof ${srfclassname('${ctrl.name}')}Base * @memberof ${srfclassname('${ctrl.name}')}Base
*/ */
public handleValueChange(args: { name: string, value: any }, index?: number) { public handleValueChange(args: { name: string, value: any }, index?: number) {
if (!args || !args.name || Object.is(args.name, '') || !this.layoutData.hasOwnProperty(args.name)) { const { name, value } = args;
<#noparse>let fullName = (index || index === 0) ? `${name}_${index}` : name;</#noparse>
if (!fullName || !this.layoutData.hasOwnProperty(fullName)) {
return; return;
} }
const { name, value } = args; this.layoutData[fullName] = value;
this.layoutData[name] = value; this.layoutModelDetails[fullName].setData(value);
this.layoutModelDetails[name].setData(value);
this.panelLogic(name, index); this.panelLogic(name, index);
this.computeButtonAuthState(); this.computeButtonAuthState();
this.panelEditItemChange(name, value); this.panelEditItemChange(name, value);
......
...@@ -39,9 +39,6 @@ this.$verify.testCond(_${item.getDstModelField()?lower_case}, "${item.getCondOp( ...@@ -39,9 +39,6 @@ this.$verify.testCond(_${item.getDstModelField()?lower_case}, "${item.getCondOp(
* @memberof ${srfclassname('${item.codeName}')}Base * @memberof ${srfclassname('${item.codeName}')}Base
*/ */
public panelLogic(name: string, index?: number): void { public panelLogic(name: string, index?: number): void {
if (name && (index || index === 0)) {
<#noparse>name = name.replace(`_${index}`,"");</#noparse>
}
<#list panelItems as panelItem> <#list panelItems as panelItem>
<#if panelItem.getPSPanelItemGroupLogic('ITEMBLANK')??> <#if panelItem.getPSPanelItemGroupLogic('ITEMBLANK')??>
<#assign ITEMBLANK = panelItem.getPSPanelItemGroupLogic('ITEMBLANK')/> <#assign ITEMBLANK = panelItem.getPSPanelItemGroupLogic('ITEMBLANK')/>
...@@ -49,11 +46,9 @@ this.$verify.testCond(_${item.getDstModelField()?lower_case}, "${item.getCondOp( ...@@ -49,11 +46,9 @@ this.$verify.testCond(_${item.getDstModelField()?lower_case}, "${item.getCondOp(
let ret = true; let ret = true;
<#if ITEMBLANK.getRelatedItemNames()??> <#if ITEMBLANK.getRelatedItemNames()??>
<#list ITEMBLANK.getRelatedItemNames() as detailName> <#list ITEMBLANK.getRelatedItemNames() as detailName>
let _${detailName} = ''; let _${detailName} = this.layoutData['${detailName}'];
if (index || index === 0) { if (index || index === 0) {
_${detailName} = this.layoutData[`${detailName}<#noparse>_${index}</#noparse>`]; _${detailName} = this.layoutData[`${detailName}<#noparse>_${index}</#noparse>`];
} else {
_${detailName} = this.layoutData['${detailName}'];
} }
</#list> </#list>
</#if> </#if>
...@@ -73,11 +68,9 @@ this.$verify.testCond(_${item.getDstModelField()?lower_case}, "${item.getCondOp( ...@@ -73,11 +68,9 @@ this.$verify.testCond(_${item.getDstModelField()?lower_case}, "${item.getCondOp(
let ret = false; let ret = false;
<#if ITEMENABLE.getRelatedItemNames()??> <#if ITEMENABLE.getRelatedItemNames()??>
<#list ITEMENABLE.getRelatedItemNames() as detailName> <#list ITEMENABLE.getRelatedItemNames() as detailName>
let _${detailName} = ''; let _${detailName} = this.layoutData['${detailName}'];
if (index || index === 0) { if (index || index === 0) {
_${detailName} = this.layoutData[`${detailName}<#noparse>_${index}</#noparse>`]; _${detailName} = this.layoutData[`${detailName}<#noparse>_${index}</#noparse>`];
} else {
_${detailName} = this.layoutData['${detailName}'];
} }
</#list> </#list>
</#if> </#if>
...@@ -97,11 +90,9 @@ this.$verify.testCond(_${item.getDstModelField()?lower_case}, "${item.getCondOp( ...@@ -97,11 +90,9 @@ this.$verify.testCond(_${item.getDstModelField()?lower_case}, "${item.getCondOp(
let ret = false; let ret = false;
<#if PANELVISIBLE.getRelatedItemNames()??> <#if PANELVISIBLE.getRelatedItemNames()??>
<#list PANELVISIBLE.getRelatedItemNames() as detailName> <#list PANELVISIBLE.getRelatedItemNames() as detailName>
let _${detailName} = ''; let _${detailName} = this.layoutData['${detailName}'];
if (index || index === 0) { if (index || index === 0) {
_${detailName} = this.layoutData[`${detailName}<#noparse>_${index}</#noparse>`]; _${detailName} = this.layoutData[`${detailName}<#noparse>_${index}</#noparse>`];
} else {
_${detailName} = this.layoutData['${detailName}'];
} }
</#list> </#list>
</#if> </#if>
...@@ -327,7 +318,7 @@ this.$verify.testCond(_${item.getDstModelField()?lower_case}, "${item.getCondOp( ...@@ -327,7 +318,7 @@ this.$verify.testCond(_${item.getDstModelField()?lower_case}, "${item.getCondOp(
* @public * @public
* @memberof ${srfclassname('${item.name}')}Base * @memberof ${srfclassname('${item.name}')}Base
*/ */
public isLayoutLoadding: boolean = false; public isLayoutLoadding: boolean = true;
/** /**
* 布局面板数据 * 布局面板数据
...@@ -371,10 +362,10 @@ this.$verify.testCond(_${item.getDstModelField()?lower_case}, "${item.getCondOp( ...@@ -371,10 +362,10 @@ this.$verify.testCond(_${item.getDstModelField()?lower_case}, "${item.getCondOp(
* @public * @public
* @memberof ${srfclassname('${item.name}')}Base * @memberof ${srfclassname('${item.name}')}Base
*/ */
public async initLayoutItem(layoutModelItem: any, index: number = 0) { public async initLayoutItem(layoutModelItem: any, index?: number) {
const { name } = layoutModelItem; const { name } = layoutModelItem;
const layoutModelDetail = Util.getLayoutItemInstance(layoutModelItem); const layoutModelDetail = Util.getLayoutItemInstance(layoutModelItem);
if (!index) { if (!(index || index === 0)) {
await layoutModelDetail.load(this.context, this.viewparams); await layoutModelDetail.load(this.context, this.viewparams);
this.$set(this.layoutModelDetails, name, layoutModelDetail); this.$set(this.layoutModelDetails, name, layoutModelDetail);
this.$set(this.layoutData, name, layoutModelDetail.getData()); this.$set(this.layoutData, name, layoutModelDetail.getData());
...@@ -401,7 +392,7 @@ this.$verify.testCond(_${item.getDstModelField()?lower_case}, "${item.getCondOp( ...@@ -401,7 +392,7 @@ this.$verify.testCond(_${item.getDstModelField()?lower_case}, "${item.getCondOp(
for (let i = 0; i < layoutModelDetail.details.length; i++) { for (let i = 0; i < layoutModelDetail.details.length; i++) {
const key = layoutModelDetail.details[i]; const key = layoutModelDetail.details[i];
if (this.layoutItems[key]) { if (this.layoutItems[key]) {
await this.initLayoutItem(this.layoutItems[key],index); await this.initLayoutItem(this.layoutItems[key], index);
} }
} }
} }
......
...@@ -331,12 +331,13 @@ ${P.getCtrlCode('toolbar', 'CONTROL.vue').code} ...@@ -331,12 +331,13 @@ ${P.getCtrlCode('toolbar', 'CONTROL.vue').code}
* @memberof ${srfclassname('${view.name}')}Base * @memberof ${srfclassname('${view.name}')}Base
*/ */
public handleValueChange(args: { name: string, value: any }, index?: number) { public handleValueChange(args: { name: string, value: any }, index?: number) {
if (!args || !args.name || Object.is(args.name, '') || !this.layoutData.hasOwnProperty(args.name)) { const { name, value } = args;
<#noparse>let fullName = (index || index === 0) ? `${name}_${index}` : name;</#noparse>
if (!fullName || !this.layoutData.hasOwnProperty(fullName)) {
return; return;
} }
const {name,value} = args; this.layoutData[fullName] = value;
this.layoutData[name] = value; this.layoutModelDetails[fullName].setData(value);
this.layoutModelDetails[name].setData(value);
this.panelLogic(name, index); this.panelLogic(name, index);
this.computeButtonAuthState(); this.computeButtonAuthState();
} }
......
...@@ -187,7 +187,7 @@ ...@@ -187,7 +187,7 @@
codelistType="${codelist.getCodeListType()}" codelistType="${codelist.getCodeListType()}"
</#if> </#if>
placeholder=<#if panelDetail.getPlaceHolder()??>'${panelDetail.getPlaceHolder()}'<#else>'请选择...'</#if> placeholder=<#if panelDetail.getPlaceHolder()??>'${panelDetail.getPlaceHolder()}'<#else>'请选择...'</#if>
@change="(value) => handleValueChange({ name: <#if isMultiData == true >`${panelDetail.getName()}_<#noparse>${slotProps.data.index}</#noparse>`<#else>'${panelDetail.name}'</#if>, value}<#if isMultiData == true >, `<#noparse>${slotProps.data.index}</#noparse>`</#if>)"> @change="(value) => handleValueChange({ name: '${panelDetail.name}', value }<#if isMultiData == true >, `<#noparse>${slotProps.data.index}</#noparse>`</#if>)">
</dropdown-list> </dropdown-list>
<#elseif panelDetail.getPSEditor().getEditorType() == 'NUMBER'> <#elseif panelDetail.getPSEditor().getEditorType() == 'NUMBER'>
<input-box <input-box
...@@ -197,7 +197,7 @@ ...@@ -197,7 +197,7 @@
:disabled=<#if isMultiData == true >"layoutModelDetails[`${panelDetail.getName()}_<#noparse>${slotProps.data.index}</#noparse>`] ? layoutModelDetails[`${panelDetail.getName()}_<#noparse>${slotProps.data.index}</#noparse>`].disabled : false"<#else>"layoutModelDetails.${panelDetail.getName()} ? layoutModelDetails.${panelDetail.getName()}.disabled : false"</#if> :disabled=<#if isMultiData == true >"layoutModelDetails[`${panelDetail.getName()}_<#noparse>${slotProps.data.index}</#noparse>`] ? layoutModelDetails[`${panelDetail.getName()}_<#noparse>${slotProps.data.index}</#noparse>`].disabled : false"<#else>"layoutModelDetails.${panelDetail.getName()} ? layoutModelDetails.${panelDetail.getName()}.disabled : false"</#if>
<#if panelDetail.getUnitName?? && panelDetail.getUnitName()??>unit="${panelDetail.getUnitName()}"</#if> <#if panelDetail.getUnitName?? && panelDetail.getUnitName()??>unit="${panelDetail.getUnitName()}"</#if>
<#if panelDetail.getPlaceHolder()??>placeholder="${panelDetail.getPlaceHolder()}"</#if> <#if panelDetail.getPlaceHolder()??>placeholder="${panelDetail.getPlaceHolder()}"</#if>
@change="(value) => handleValueChange({ name: <#if isMultiData == true >`${panelDetail.getName()}_<#noparse>${slotProps.data.index}</#noparse>`<#else>'${panelDetail.name}'</#if>, value}<#if isMultiData == true >, `<#noparse>${slotProps.data.index}</#noparse>`</#if>)"> @change="(value) => handleValueChange({ name: '${panelDetail.name}', value }<#if isMultiData == true >, `<#noparse>${slotProps.data.index}</#noparse>`</#if>)">
</input-box> </input-box>
<#elseif panelDetail.getPSEditor().getEditorType() == 'PASSWORD'> <#elseif panelDetail.getPSEditor().getEditorType() == 'PASSWORD'>
<input-box <input-box
...@@ -206,7 +206,7 @@ ...@@ -206,7 +206,7 @@
:itemValue=<#if isMultiData == true >"layoutData[`${panelDetail.getName()}_<#noparse>${slotProps.data.index}</#noparse>`]"<#else>"layoutData.${panelDetail.getName()}"</#if> :itemValue=<#if isMultiData == true >"layoutData[`${panelDetail.getName()}_<#noparse>${slotProps.data.index}</#noparse>`]"<#else>"layoutData.${panelDetail.getName()}"</#if>
:disabled=<#if isMultiData == true >"layoutModelDetails[`${panelDetail.getName()}_<#noparse>${slotProps.data.index}</#noparse>`] ? layoutModelDetails[`${panelDetail.getName()}_<#noparse>${slotProps.data.index}</#noparse>`].disabled : false"<#else>"layoutModelDetails.${panelDetail.getName()} ? layoutModelDetails.${panelDetail.getName()}.disabled : false"</#if> :disabled=<#if isMultiData == true >"layoutModelDetails[`${panelDetail.getName()}_<#noparse>${slotProps.data.index}</#noparse>`] ? layoutModelDetails[`${panelDetail.getName()}_<#noparse>${slotProps.data.index}</#noparse>`].disabled : false"<#else>"layoutModelDetails.${panelDetail.getName()} ? layoutModelDetails.${panelDetail.getName()}.disabled : false"</#if>
<#if panelDetail.getPlaceHolder()??>placeholder="${panelDetail.getPlaceHolder()}"</#if> <#if panelDetail.getPlaceHolder()??>placeholder="${panelDetail.getPlaceHolder()}"</#if>
@change="(value) => handleValueChange({ name: <#if isMultiData == true >`${panelDetail.getName()}_<#noparse>${slotProps.data.index}</#noparse>`<#else>'${panelDetail.name}'</#if>, value}<#if isMultiData == true >, `<#noparse>${slotProps.data.index}</#noparse>`</#if>)"> @change="(value) => handleValueChange({ name: '${panelDetail.name}', value }<#if isMultiData == true >, `<#noparse>${slotProps.data.index}</#noparse>`</#if>)">
</input-box> </input-box>
<#elseif panelDetail.getPSEditor().getEditorType() == 'TEXTBOX'> <#elseif panelDetail.getPSEditor().getEditorType() == 'TEXTBOX'>
<input-box <input-box
...@@ -215,7 +215,7 @@ ...@@ -215,7 +215,7 @@
:itemValue=<#if isMultiData == true >"layoutData[`${panelDetail.getName()}_<#noparse>${slotProps.data.index}</#noparse>`]"<#else>"layoutData.${panelDetail.getName()}"</#if> :itemValue=<#if isMultiData == true >"layoutData[`${panelDetail.getName()}_<#noparse>${slotProps.data.index}</#noparse>`]"<#else>"layoutData.${panelDetail.getName()}"</#if>
:disabled=<#if isMultiData == true >"layoutModelDetails[`${panelDetail.getName()}_<#noparse>${slotProps.data.index}</#noparse>`] ? layoutModelDetails[`${panelDetail.getName()}_<#noparse>${slotProps.data.index}</#noparse>`].disabled : false"<#else>"layoutModelDetails.${panelDetail.getName()} ? layoutModelDetails.${panelDetail.getName()}.disabled : false"</#if> :disabled=<#if isMultiData == true >"layoutModelDetails[`${panelDetail.getName()}_<#noparse>${slotProps.data.index}</#noparse>`] ? layoutModelDetails[`${panelDetail.getName()}_<#noparse>${slotProps.data.index}</#noparse>`].disabled : false"<#else>"layoutModelDetails.${panelDetail.getName()} ? layoutModelDetails.${panelDetail.getName()}.disabled : false"</#if>
<#if panelDetail.getPlaceHolder()??>placeholder="${panelDetail.getPlaceHolder()}"</#if> <#if panelDetail.getPlaceHolder()??>placeholder="${panelDetail.getPlaceHolder()}"</#if>
@change="(value) => handleValueChange({ name: <#if isMultiData == true >`${panelDetail.getName()}_<#noparse>${slotProps.data.index}</#noparse>`<#else>'${panelDetail.name}'</#if>, value}<#if isMultiData == true >, `<#noparse>${slotProps.data.index}</#noparse>`</#if>)"> @change="(value) => handleValueChange({ name: '${panelDetail.name}', value }<#if isMultiData == true >, `<#noparse>${slotProps.data.index}</#noparse>`</#if>)">
</input-box> </input-box>
<#else> <#else>
<app-span <app-span
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册