提交 707e748c 编写于 作者: WodahsOrez's avatar WodahsOrez

lxm--面板动态逻辑--fix2

上级 22b89943
<#if item.getLogicType() == 'GROUP'><#if item.isNotMode()>!(</#if><#if item.getPSDEFDLogics()??><#list item.getPSDEFDLogics() as subLogic><#if subLogic_index gt 0><#if item.getGroupOP() == 'AND'> && </#if><#if item.getGroupOP() == 'OR'> || </#if></#if>${P.getPartCode(subLogic, 'DETAIL_LOGIC').code}</#list></#if><#if item.isNotMode()>)</#if><#elseif item.getLogicType() == 'SINGLE'>this.$verify.testCond(_${item.getDEFDName()?lower_case}, '${item.getPSDBValueOPId()}', '${item.getValue()}')</#if>
\ No newline at end of file
<#list ctrl.getAllPSPanelItems() as panelitem>
<#if panelitem.getPSPanelItemGroupLogic('ITEMBLANK')??>
<#assign ITEMBLANK = panelitem.getPSPanelItemGroupLogic('ITEMBLANK')/>
if (Object.is(name, '')<#if ITEMBLANK.getRelatedItemNames()??><#list ITEMBLANK.getRelatedItemNames() as detailName> || Object.is(name, '${detailName}')</#list></#if>) {
let ret = true;
<#if ITEMBLANK.getRelatedItemNames()??>
<#list ITEMBLANK.getRelatedItemNames() as detailName>
const _${detailName} = this.data.${detailName};
</#list>
</#if>
if (${P.getPartCode(ITEMBLANK, 'DETAIL_LOGIC').code}) {
ret = false;
}
this.rules.${panelitem.name}.some((rule: any) => {
if (rule.hasOwnProperty('required')) {
rule.required = ret;
}
return false;
});
}
</#if>
<#if panelitem.getPSPanelItemGroupLogic('ITEMENABLE')??>
<#assign ITEMENABLE = panelitem.getPSPanelItemGroupLogic('ITEMENABLE')/>
if (Object.is(name, '')<#if ITEMENABLE.getRelatedItemNames()??><#list ITEMENABLE.getRelatedItemNames() as detailName> || Object.is(name, '${detailName}')</#list></#if>) {
let ret = false;
<#if ITEMENABLE.getRelatedItemNames()??>
<#list ITEMENABLE.getRelatedItemNames() as detailName>
const _${detailName} = this.data.${detailName};
</#list>
</#if>
if (${P.getPartCode(ITEMENABLE, 'DETAIL_LOGIC').code}) {
ret = true;
}
this.detailsModel.${panelitem.name}.setDisabled(!ret);
}
</#if>
<#if panelitem.getPSPanelItemGroupLogic('PANELVISIBLE')??>
<#assign PANELVISIBLE = panelitem.getPSPanelItemGroupLogic('PANELVISIBLE')/>
if (Object.is(name, '')<#if PANELVISIBLE.getRelatedItemNames()??><#list PANELVISIBLE.getRelatedItemNames() as detailName> || Object.is(name, '${detailName}')</#list></#if>) {
let ret = false;
<#if PANELVISIBLE.getRelatedItemNames()??>
<#list PANELVISIBLE.getRelatedItemNames() as detailName>
const _${detailName} = this.data.${detailName};
</#list>
</#if>
if (${P.getPartCode(PANELVISIBLE, 'DETAIL_LOGIC').code}) {
ret = true;
}
this.detailsModel.${panelitem.name}.setVisible(ret);
}
</#if>
</#list>
\ No newline at end of file
......@@ -69,58 +69,9 @@ import CodeListService from "@service/app/codelist-service";
* @memberof ${srfclassname('${ctrl.codeName}')}
*/
public panelLogic({ name, newVal, oldVal }: { name: string, newVal: any, oldVal: any }): void {
<#list ctrl.getAllPSPanelItems() as panelitem>
<#if panelitem.getPSPanelItemGroupLogic('ITEMBLANK')??>
<#assign ITEMBLANK = panelitem.getPSPanelItemGroupLogic('ITEMBLANK')/>
if (Object.is(name, '')<#if ITEMBLANK.getRelatedItemNames()??><#list ITEMBLANK.getRelatedItemNames() as detailName> || Object.is(name, '${detailName}')</#list></#if>) {
let ret = true;
<#if ITEMBLANK.getRelatedItemNames()??>
<#list ITEMBLANK.getRelatedItemNames() as detailName>
const _${detailName} = this.data.${detailName};
</#list>
<#if P.getPartCode(item,'FORM_LOGIC').code?length gt 0>
${P.getPartCode(item,'FORM_LOGIC').code}
</#if>
if (${P.getPartCode(ITEMBLANK, 'DETAIL_LOGIC').code}) {
ret = false;
}
this.rules.${panelitem.name}.some((rule: any) => {
if (rule.hasOwnProperty('required')) {
rule.required = ret;
}
return false;
});
}
</#if>
<#if panelitem.getPSPanelItemGroupLogic('ITEMENABLE')??>
<#assign ITEMENABLE = panelitem.getPSPanelItemGroupLogic('ITEMENABLE')/>
if (Object.is(name, '')<#if ITEMENABLE.getRelatedItemNames()??><#list ITEMENABLE.getRelatedItemNames() as detailName> || Object.is(name, '${detailName}')</#list></#if>) {
let ret = false;
<#if ITEMENABLE.getRelatedItemNames()??>
<#list ITEMENABLE.getRelatedItemNames() as detailName>
const _${detailName} = this.data.${detailName};
</#list>
</#if>
if (${P.getPartCode(ITEMENABLE, 'DETAIL_LOGIC').code}) {
ret = true;
}
this.detailsModel.${panelitem.name}.setDisabled(!ret);
}
</#if>
<#if panelitem.getPSPanelItemGroupLogic('PANELVISIBLE')??>
<#assign PANELVISIBLE = panelitem.getPSPanelItemGroupLogic('PANELVISIBLE')/>
if (Object.is(name, '')<#if PANELVISIBLE.getRelatedItemNames()??><#list PANELVISIBLE.getRelatedItemNames() as detailName> || Object.is(name, '${detailName}')</#list></#if>) {
let ret = false;
<#if PANELVISIBLE.getRelatedItemNames()??>
<#list PANELVISIBLE.getRelatedItemNames() as detailName>
const _${detailName} = this.data.${detailName};
</#list>
</#if>
if (${P.getPartCode(PANELVISIBLE, 'DETAIL_LOGIC').code}) {
ret = true;
}
this.detailsModel.${panelitem.name}.setVisible(ret);
}
</#if>
</#list>
}
/**
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册