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

update:动态控制

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