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

update:更新

上级 7a22041f
......@@ -483,9 +483,11 @@ import UIService from '@/uiservice/ui-service';
* 处理值改变
*
* @public
* @params args 改变数据
* @params index 多数据容器下标
* @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)) {
return;
}
......@@ -523,10 +525,11 @@ import UIService from '@/uiservice/ui-service';
* 面板逻辑
*
* @public
* @param {{ name: string, newVal: any, oldVal: any }} { name, newVal, oldVal }
* @params name 改变项名称
* @params index 多数据容器下标
* @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>
${P.getPartCode(item,'PANEL_LOGIC').code}
</#if>
......
......@@ -560,25 +560,32 @@ ${P.getCtrlCode('toolbar', 'CONTROL.vue').code}
* 处理值改变
*
* @public
* @params args 改变数据
* @params index 多数据容器下标
* @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)) {
return;
}
const {name,value} = args;
this.layoutData[name] = value;
this.layoutModelDetails[name].setData(value);
this.panelLogic(name);
this.panelLogic(name, index);
}
/**
* 面板逻辑
*
* @public
* @params name 改变项名称
* @params index 多数据容器下标
* @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>
<#if panelItem.getPSPanelItemGroupLogic('ITEMBLANK')??>
<#assign ITEMBLANK = panelItem.getPSPanelItemGroupLogic('ITEMBLANK')/>
......@@ -586,14 +593,23 @@ ${P.getCtrlCode('toolbar', 'CONTROL.vue').code}
let ret = true;
<#if ITEMBLANK.getRelatedItemNames()??>
<#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>
</#if>
if (<@panelLogic ITEMBLANK/>) {
ret = false;
}
if (index || index === 0) {
this.layoutModelDetails[`${panelItem.name}<#noparse>_${index}</#noparse>`].required = ret;
} else {
this.layoutModelDetails['${panelItem.name}'].required = ret;
}
}
</#if>
<#if panelItem.getPSPanelItemGroupLogic('ITEMENABLE')??>
<#assign ITEMENABLE = panelItem.getPSPanelItemGroupLogic('ITEMENABLE')/>
......@@ -601,14 +617,23 @@ ${P.getCtrlCode('toolbar', 'CONTROL.vue').code}
let ret = false;
<#if ITEMENABLE.getRelatedItemNames()??>
<#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>
</#if>
if (<@panelLogic ITEMENABLE/>) {
ret = true;
}
if (index || index === 0) {
this.layoutModelDetails[`${panelItem.name}<#noparse>_${index}</#noparse>`].disabled = !ret;
} else {
this.layoutModelDetails['${panelItem.name}'].disabled = !ret;
}
}
</#if>
<#if panelItem.getPSPanelItemGroupLogic('PANELVISIBLE')??>
<#assign PANELVISIBLE = panelItem.getPSPanelItemGroupLogic('PANELVISIBLE')/>
......@@ -616,14 +641,23 @@ ${P.getCtrlCode('toolbar', 'CONTROL.vue').code}
let ret = false;
<#if PANELVISIBLE.getRelatedItemNames()??>
<#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>
</#if>
if (<@panelLogic PANELVISIBLE/>) {
ret = true;
}
if (index || index === 0) {
this.layoutModelDetails[`${panelItem.name}<#noparse>_${index}</#noparse>`].visible = ret;
} else {
this.layoutModelDetails['${panelItem.name}'].visible = ret;
}
}
</#if>
</#list>
}
......
......@@ -187,7 +187,7 @@
codelistType="${codelist.getCodeListType()}"
</#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>
<#elseif panelDetail.getPSEditor().getEditorType() == 'NUMBER'>
<input-box
......@@ -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>
<#if panelDetail.getUnitName?? && panelDetail.getUnitName()??>unit="${panelDetail.getUnitName()}"</#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>
<#elseif panelDetail.getPSEditor().getEditorType() == 'PASSWORD'>
<input-box
......@@ -206,7 +206,7 @@
: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>
<#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>
<#elseif panelDetail.getPSEditor().getEditorType() == 'TEXTBOX'>
<input-box
......@@ -215,7 +215,7 @@
: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>
<#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>
<#else>
<app-span
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册