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

update:更新

上级 7a22041f
...@@ -483,9 +483,11 @@ import UIService from '@/uiservice/ui-service'; ...@@ -483,9 +483,11 @@ import UIService from '@/uiservice/ui-service';
* 处理值改变 * 处理值改变
* *
* @public * @public
* @params args 改变数据
* @params index 多数据容器下标
* @memberof ${srfclassname('${ctrl.name}')}Base * @memberof ${srfclassname('${ctrl.name}')}Base
*/ */
public handleValueChange(args: { name: string, value: any }) { public handleValueChange(args: { name: string, value: any }, index?: number) {
if (!args || !args.name || Object.is(args.name, '') || !this.layoutData.hasOwnProperty(args.name)) { if (!args || !args.name || Object.is(args.name, '') || !this.layoutData.hasOwnProperty(args.name)) {
return; return;
} }
...@@ -523,10 +525,11 @@ import UIService from '@/uiservice/ui-service'; ...@@ -523,10 +525,11 @@ import UIService from '@/uiservice/ui-service';
* 面板逻辑 * 面板逻辑
* *
* @public * @public
* @param {{ name: string, newVal: any, oldVal: any }} { name, newVal, oldVal } * @params name 改变项名称
* @params index 多数据容器下标
* @memberof ${srfclassname('${ctrl.codeName}')}Base * @memberof ${srfclassname('${ctrl.codeName}')}Base
*/ */
public panelLogic(name: string): void { public panelLogic(name: string, index?: number): void {
<#if P.getPartCode(item,'PANEL_LOGIC').code?length gt 0> <#if P.getPartCode(item,'PANEL_LOGIC').code?length gt 0>
${P.getPartCode(item,'PANEL_LOGIC').code} ${P.getPartCode(item,'PANEL_LOGIC').code}
</#if> </#if>
......
...@@ -560,25 +560,32 @@ ${P.getCtrlCode('toolbar', 'CONTROL.vue').code} ...@@ -560,25 +560,32 @@ ${P.getCtrlCode('toolbar', 'CONTROL.vue').code}
* 处理值改变 * 处理值改变
* *
* @public * @public
* @params args 改变数据
* @params index 多数据容器下标
* @memberof ${srfclassname('${view.name}')}Base * @memberof ${srfclassname('${view.name}')}Base
*/ */
public handleValueChange(args: { name: string, value: any }) { public handleValueChange(args: { name: string, value: any }, index?: number) {
if (!args || !args.name || Object.is(args.name, '') || !this.layoutData.hasOwnProperty(args.name)) { if (!args || !args.name || Object.is(args.name, '') || !this.layoutData.hasOwnProperty(args.name)) {
return; return;
} }
const {name,value} = args; const {name,value} = args;
this.layoutData[name] = value; this.layoutData[name] = value;
this.layoutModelDetails[name].setData(value); this.layoutModelDetails[name].setData(value);
this.panelLogic(name); this.panelLogic(name, index);
} }
/** /**
* 面板逻辑 * 面板逻辑
* *
* @public * @public
* @params name 改变项名称
* @params index 多数据容器下标
* @memberof ${srfclassname('${view.name}')}Base * @memberof ${srfclassname('${view.name}')}Base
*/ */
public panelLogic(name: string): void { public panelLogic(name: string, index?: number): void {
if (name && (index || index === 0)) {
name = name.replace(`_${index}`,"");
}
<#list view.getPSViewLayoutPanel().getAllPSPanelItems() as panelItem> <#list view.getPSViewLayoutPanel().getAllPSPanelItems() as panelItem>
<#if panelItem.getPSPanelItemGroupLogic('ITEMBLANK')??> <#if panelItem.getPSPanelItemGroupLogic('ITEMBLANK')??>
<#assign ITEMBLANK = panelItem.getPSPanelItemGroupLogic('ITEMBLANK')/> <#assign ITEMBLANK = panelItem.getPSPanelItemGroupLogic('ITEMBLANK')/>
...@@ -586,13 +593,22 @@ ${P.getCtrlCode('toolbar', 'CONTROL.vue').code} ...@@ -586,13 +593,22 @@ ${P.getCtrlCode('toolbar', 'CONTROL.vue').code}
let ret = true; let ret = true;
<#if ITEMBLANK.getRelatedItemNames()??> <#if ITEMBLANK.getRelatedItemNames()??>
<#list ITEMBLANK.getRelatedItemNames() as detailName> <#list ITEMBLANK.getRelatedItemNames() as detailName>
const _${detailName} = this.layoutData['${detailName}']; let _${detailName} = '';
if (index || index === 0) {
_${detailName} = this.layoutData[`${detailName}<#noparse>_${index}</#noparse>`];
} else {
_${detailName} = this.layoutData['${detailName}'];
}
</#list> </#list>
</#if> </#if>
if (<@panelLogic ITEMBLANK/>) { if (<@panelLogic ITEMBLANK/>) {
ret = false; ret = false;
} }
this.layoutModelDetails['${panelItem.name}'].required = ret; if (index || index === 0) {
this.layoutModelDetails[`${panelItem.name}<#noparse>_${index}</#noparse>`].required = ret;
} else {
this.layoutModelDetails['${panelItem.name}'].required = ret;
}
} }
</#if> </#if>
<#if panelItem.getPSPanelItemGroupLogic('ITEMENABLE')??> <#if panelItem.getPSPanelItemGroupLogic('ITEMENABLE')??>
...@@ -601,13 +617,22 @@ ${P.getCtrlCode('toolbar', 'CONTROL.vue').code} ...@@ -601,13 +617,22 @@ ${P.getCtrlCode('toolbar', 'CONTROL.vue').code}
let ret = false; let ret = false;
<#if ITEMENABLE.getRelatedItemNames()??> <#if ITEMENABLE.getRelatedItemNames()??>
<#list ITEMENABLE.getRelatedItemNames() as detailName> <#list ITEMENABLE.getRelatedItemNames() as detailName>
const _${detailName} = this.layoutData['${detailName}']; let _${detailName} = '';
if (index || index === 0) {
_${detailName} = this.layoutData[`${detailName}<#noparse>_${index}</#noparse>`];
} else {
_${detailName} = this.layoutData['${detailName}'];
}
</#list> </#list>
</#if> </#if>
if (<@panelLogic ITEMENABLE/>) { if (<@panelLogic ITEMENABLE/>) {
ret = true; ret = true;
} }
this.layoutModelDetails['${panelItem.name}'].disabled = !ret; if (index || index === 0) {
this.layoutModelDetails[`${panelItem.name}<#noparse>_${index}</#noparse>`].disabled = !ret;
} else {
this.layoutModelDetails['${panelItem.name}'].disabled = !ret;
}
} }
</#if> </#if>
<#if panelItem.getPSPanelItemGroupLogic('PANELVISIBLE')??> <#if panelItem.getPSPanelItemGroupLogic('PANELVISIBLE')??>
...@@ -616,13 +641,22 @@ ${P.getCtrlCode('toolbar', 'CONTROL.vue').code} ...@@ -616,13 +641,22 @@ ${P.getCtrlCode('toolbar', 'CONTROL.vue').code}
let ret = false; let ret = false;
<#if PANELVISIBLE.getRelatedItemNames()??> <#if PANELVISIBLE.getRelatedItemNames()??>
<#list PANELVISIBLE.getRelatedItemNames() as detailName> <#list PANELVISIBLE.getRelatedItemNames() as detailName>
const _${detailName} = this.layoutData['${detailName}']; let _${detailName} = '';
if (index || index === 0) {
_${detailName} = this.layoutData[`${detailName}<#noparse>_${index}</#noparse>`];
} else {
_${detailName} = this.layoutData['${detailName}'];
}
</#list> </#list>
</#if> </#if>
if (<@panelLogic PANELVISIBLE/>) { if (<@panelLogic PANELVISIBLE/>) {
ret = true; ret = true;
} }
this.layoutModelDetails['${panelItem.name}'].visible = ret; if (index || index === 0) {
this.layoutModelDetails[`${panelItem.name}<#noparse>_${index}</#noparse>`].visible = ret;
} else {
this.layoutModelDetails['${panelItem.name}'].visible = ret;
}
} }
</#if> </#if>
</#list> </#list>
......
...@@ -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})"> @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>)">
</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()} : 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()} : 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})"> @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>)">
</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 @@
:value=<#if isMultiData == true >"layoutData[`${panelDetail.getName()}_<#noparse>${slotProps.data.index}</#noparse>`]"<#else>"layoutData.${panelDetail.getName()}"</#if> :value=<#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()} : 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()} : 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})"> @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>)">
</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 @@
:value=<#if isMultiData == true >"layoutData[`${panelDetail.getName()}_<#noparse>${slotProps.data.index}</#noparse>`]"<#else>"layoutData.${panelDetail.getName()}"</#if> :value=<#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()} : 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()} : 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})"> @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>)">
</input-box> </input-box>
<#else> <#else>
<app-span <app-span
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册