提交 9da88fea 编写于 作者: zhangkang's avatar zhangkang

update:动态控制

上级 a927c00b
<appAutoComplete
name="{{item.codeName}}"
:data="state.data"
{{#eq ctrlType 'form'}}
:disabled="state.detailsModel.{{item.codeName}}.disabled"
{{/eq}}
{{#if item.valueItemName}}
valueItem="{{item.valueItemName}}"
{{/if}}
......
<appCheckboxList
name="{{item.codeName}}"
:data="state.data"
{{#if item.psEditor.disabled}}
:disabled="{{item.psEditor.disabled}}"
{{/if}}
{{#eq ctrlType 'form'}}
:disabled="state.detailsModel.{{item.codeName}}.disabled"
{{/eq}}
{{#if item.psEditor.isReadOnly}}
:readonly="{{item.psEditor.isReadOnly}}"
{{/if}}
......
<appCheckbox
name="{{item.codeName}}"
{{#if item.psEditor.disabled}}
:disabled="{{item.psEditor.disabled}}"
{{/if}}
{{#eq ctrlType 'form'}}
:disabled="state.detailsModel.{{item.codeName}}.disabled"
{{/eq}}
{{#if item.psEditor.isReadOnly}}
:readonly="{{item.psEditor.isReadOnly}}"
{{/if}}
......
<appCode
name="{{item.codeName}}"
{{#eq ctrlType 'form'}}
:disabled="state.detailsModel.{{item.codeName}}.disabled"
{{/eq}}
{{#if item.psEditor.isReadOnly}}
:readonly="{{item.psEditor.isReadOnly}}"
{{/if}}
......
......@@ -7,9 +7,9 @@
{{#if item.psEditor.placeHolder}}
placeholder="{{item.psEditor.placeHolder}}"
{{/if}}
{{#if item.psEditor.disabled}}
disabled="{{item.psEditor.disabled}}"
{{/if}}
{{#eq ctrlType 'form'}}
:disabled="state.detailsModel.{{item.codeName}}.disabled"
{{/eq}}
{{#if item.psEditor.psNavigateContexts}}
localContext="{{> @macro/front-end/common/navparam.hbs appNavParams=item.psEditor.psNavigateContexts}}"
{{/if}}
......
......@@ -7,9 +7,9 @@
{{#if item.psEditor.placeHolder}}
placeholder="{{item.psEditor.placeHolder}}"
{{/if}}
{{#if item.psEditor.disabled}}
disabled="{{item.psEditor.disabled}}"
{{/if}}
{{#eq ctrlType 'form'}}
:disabled="state.detailsModel.{{item.codeName}}.disabled"
{{/eq}}
{{#if item.psEditor.psNavigateContexts}}
localContext="{{> @macro/front-end/common/navparam.hbs appNavParams=item.psEditor.psNavigateContexts}}"
{{/if}}
......
......@@ -3,9 +3,9 @@
{{#if item.psEditor.placeHolder}}
placeholder="{{item.psEditor.placeHolder}}"
{{/if}}
{{#if item.psEditor.disabled}}
:disabled="{{item.psEditor.disabled}}"
{{/if}}
{{#eq ctrlType 'form'}}
:disabled="state.detailsModel.{{item.codeName}}.disabled"
{{/eq}}
{{#if item.psEditor.readOnly}}
:readonly="{{item.psEditor.readOnly}}"
{{/if}}
......
......@@ -8,9 +8,9 @@
{{#if item.psEditor.placeHolder}}
placeholder="{{item.psEditor.placeHolder}}"
{{/if}}
{{#if item.psEditor.disabled}}
disabled="{{item.psEditor.disabled}}"
{{/if}}
{{#eq ctrlType 'form'}}
:disabled="state.detailsModel.{{item.codeName}}.disabled"
{{/eq}}
{{#if item.psEditor.editorParams.multiple}}
:multiple="{{item.psEditor.editorParams.multiple}}"
{{/if}}
......
<appInputIp
name="{{item.codeName}}"
{{#if item.psEditor.disabled}}
:disabled="{{item.psEditor.disabled}}"
{{/if}}
{{#eq ctrlType 'form'}}
:disabled="state.detailsModel.{{item.codeName}}.disabled"
{{/eq}}
{{#if item.psEditor.readOnly}}
:readonly="{{item.psEditor.readOnly}}"
{{/if}}
......
<appInput
name="{{item.codeName}}"
{{#eq ctrlType 'form'}}
:disabled="state.detailsModel.{{item.codeName}}.disabled"
{{/eq}}
{{#if item.psEditor.placeHolder}}
placeholder="{{item.psEditor.placeHolder}}"
{{/if}}
......
......@@ -17,9 +17,9 @@
{{#if item.psEditor.editorParams.multiple}}
:multiple="{{item.psEditor.editorParams.multiple}}"
{{/if}}
{{#if item.psEditor.disabled}}
:disabled="{{item.psEditor.disabled}}"
{{/if}}
{{#eq ctrlType 'form'}}
:disabled="state.detailsModel.{{item.codeName}}.disabled"
{{/eq}}
{{#if item.psEditor.isReadOnly}}
:readonly="{{item.psEditor.isReadOnly}}"
{{/if}}
......
......@@ -6,9 +6,9 @@
codeListType="{{item.psEditor.codeList.codeListType}}"
valueSeparator="{{item.psEditor.codeList.valueSeparator}}"
{{/if}}
{{#if item.psEditor.disabled}}
disabled="{{item.psEditor.disabled}}"
{{/if}}
{{#eq ctrlType 'form'}}
:disabled="state.detailsModel.{{item.codeName}}.disabled"
{{/eq}}
{{#if item.psEditor.isReadOnly}}
:readonly="{{item.psEditor.isReadOnly}}"
{{/if}}
......
<appRating
name="{{item.codeName}}"
{{#if item.psEditor.disabled}}
:disabled="{{item.psEditor.disabled}}"
{{/if}}
{{#eq ctrlType 'form'}}
:disabled="state.detailsModel.{{item.codeName}}.disabled"
{{/eq}}
{{#if item.psEditor.readOnly}}
:readonly="{{item.psEditor.readOnly}}"
{{/if}}
......
<AppRaw
name="{{item.codeName}}"
:date="state.data"
{{#eq ctrlType 'form'}}
:disabled="state.detailsModel.{{item.codeName}}.disabled"
{{/eq}}
{{#if item.psEditor.editorParams.contentType}}
:contentType="{{item.psEditor.editorParams.contentType}}"
{{/if}}
......
<appRichText
name="{{item.codeName}}"
{{#if item.psEditor.disabled}}
:disabled="{{item.psEditor.disabled}}"
{{/if}}
{{#eq ctrlType 'form'}}
:disabled="state.detailsModel.{{item.codeName}}.disabled"
{{/eq}}
{{#if item.psEditor.readOnly}}
:readonly="{{item.psEditor.readOnly}}"
{{/if}}
......
<appSlider
name="{{item.codeName}}"
:date="state.data"
{{#if item.psEditor.disabled}}
:disabled="{{item.psEditor.disabled}}"
{{/if}}
{{#eq ctrlType 'form'}}
:disabled="state.detailsModel.{{item.codeName}}.disabled"
{{/eq}}
{{#if item.psEditor.readOnly}}
:readonly="{{item.psEditor.readOnly}}"
{{/if}}
......
<appSpan
name="{{item.codeName}}"
{{#eq ctrlType 'form'}}
:disabled="state.detailsModel.{{item.codeName}}.disabled"
{{/eq}}
{{#if item.psEditor.codeList}}
codeListTag="{{item.psEditor.codeList.codeListTag}}"
codeListType="{{item.psEditor.codeList.codeListType}}"
......
<appStepper
name="{{item.codeName}}"
{{#if item.psEditor.disabled}}
:disabled="{{item.psEditor.disabled}}"
{{/if}}
{{#eq ctrlType 'form'}}
:disabled="state.detailsModel.{{item.codeName}}.disabled"
{{/eq}}
{{#if item.psEditor.readOnly}}
:readonly="{{item.psEditor.readOnly}}"
{{/if}}
......
<appSwitch
name="{{item.codeName}}"
{{#if item.psEditor.disabled}}
:disabled="{{item.psEditor.disabled}}"
{{/if}}
{{#eq ctrlType 'form'}}
:disabled="state.detailsModel.{{item.codeName}}.disabled"
{{/eq}}
{{#if item.psEditor.isReadOnly}}
:readonly="{{item.psEditor.isReadOnly}}"
{{/if}}
......
......@@ -12,9 +12,9 @@
{{#if item.psEditor.editorParams.tooltip}}
tooltip="{{item.psEditor.editorParams.tooltip}}"
{{/if}}
{{#if item.psEditor.disabled}}
:disabled="{{item.psEditor.disabled}}"
{{/if}}
{{#eq ctrlType 'form'}}
:disabled="state.detailsModel.{{item.codeName}}.disabled"
{{/eq}}
{{#if item.psEditor.readOnly}}
:readonly="{{item.psEditor.readOnly}}"
{{/if}}
......
......@@ -71,9 +71,9 @@
logicCat: '{{groupLogic.logicCat}}',
logicType: '{{groupLogic.logicType}}',
notMode: '{{groupLogic.notMode}}',
Logics: [
logics: [
{{#each groupLogic.psDEFDLogics as | logic |}}
{condOP: '{{logic.condOP}}',dEFDName: '{{logic.dEFDName}}',logicType: '{{logic.logicType}}',name: '{{logic.name}}'},
{condOP: '{{logic.condOP}}',dEFDName: '{{logic.dEFDName}}',logicType: '{{logic.logicType}}',name: '{{logic.name}}',value:'{{logic.value}}'},
{{/each}}
],
},
......
......@@ -10,7 +10,7 @@
{{else}}
<a-col
{{> @macro/front-end/widgets/common/layout-pos.hbs item=item.psLayoutPos}} >
<AppFormItem v-show="state.detailsModel.{{item.codeName}}.visible" name="{{item.codeName}}" label="{{item.caption}}">
<AppFormItem v-show="state.detailsModel.{{item.codeName}}.visible" name="{{item.codeName}}" :required="state.detailsModel.{{item.codeName}}.required" label="{{item.caption}}">
{{#if item.psEditor}}
{{>(lookup . 'item.psEditor.editorType') item=item ctrlType="form"}}
{{/if}}
......
......@@ -5,6 +5,7 @@ interface FormGroupProps{
name: string;
error?: string;
label: string;
required:boolean;
}
interface FormGroupEmit{
(name: 'componentEvent', value: IActionParam): void
......@@ -15,7 +16,7 @@ const emit = defineEmits<FormGroupEmit>();
</script>
<template>
<a-form-item :name="name" :label="label" :help="error" :validateStatus="error ? 'error': 'validating'">
<a-form-item :name="name" :label="label" :help="error" :required="required" :validateStatus="error ? 'error': 'validating'">
<slot></slot>
</a-form-item>
</template>
......
......@@ -50,7 +50,7 @@ export class FormControl extends MainControl {
// 是否取反
return logic.notMode ? !result : result;
} else if (logic.logicType == 'SINGLE') {
return verifyValue(data[logic.name], logic.condOP, logic.value);
return verifyValue(data[logic.dEFDName], logic.condOP, logic.value);
}
return false;
}
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册