提交 9aef90da 编写于 作者: Mosher's avatar Mosher

update:更新

上级 6065e79b
{
name: '{{logic.name}}',
logicType: '{{logic.logicType}}',
logicCat: '{{logic.logicCat}}',
{{#eq logic.logicType 'GROUP'}}
notMode: {{logic.notMode}},
groupOP: '{{logic.groupOP}}',
relatedDetailNames: [{{#each logic.relatedDetailNames as | name |}}"{{name}}"{{#unless @last}},{{/unless}}{{/each}}],
{{#if logic.psDEFDLogics}}
childLogics: [
{{#each logic.psDEFDLogics as | childLogic |}}
{{> @macro/front-end/common/delogic.hbs logic=childLogic}}
{{/each}}
]
{{/if}}
{{/eq}}
{{#eq logic.logicType 'SINGLE'}}
condOP: "{{logic.condOP}}",
dEFDName: "{{lowerCase logic.dEFDName}}",
value: "{{logic.value}}"
{{/eq}}
},
{{#each item.psDEFormDetails as | tempDetail |}} {{#each item.psDEFormDetails as | detail |}}
{{#if (and (eq tempDetail.detailType "BUTTON") tempDetail.psUIAction)}} {{#if (and (eq detail.detailType "BUTTON") detail.psUIAction)}}
{{#tempDetail.psUIAction}} {{#detail.psUIAction}}
'{{uIActionTag}}': { disabled: false, visible: true, noPrivDisplayMode: "{{noPrivDisplayMode}}", dataAccessAction: '{{dataAccessAction}}', actionTarget: '{{actionTarget}}' }, '{{uIActionTag}}': { disabled: false, visible: true, noPrivDisplayMode: "{{noPrivDisplayMode}}", dataAccessAction: '{{dataAccessAction}}', actionTarget: '{{actionTarget}}' },
{{/tempDetail.psUIAction}} {{/detail.psUIAction}}
{{/if}} {{/if}}
{{#if (and (eq tempDetail.detailType "GROUPPANEL") tempDetail.psSUIActionGroup tempDetail.psSUIActionGroup.psUIActionGroupDetails)}} {{#if (and (eq detail.detailType "GROUPPANEL") detail.psUIActionGroup detail.psUIActionGroup.psUIActionGroupDetails)}}
{{#each tempDetail.psSUIActionGroup.psUIActionGroupDetails as | detail | }} {{#each detail.psUIActionGroup.psUIActionGroupDetails as | detail | }}
{{#detail.psUIAction}} {{#detail.psUIAction}}
'{{uIActionTag}}': { disabled: false, visible: true, noPrivDisplayMode: "{{noPrivDisplayMode}}", dataAccessAction: '{{dataAccessAction}}', actionTarget: '{{actionTarget}}' }, '{{uIActionTag}}': { disabled: false, visible: true, noPrivDisplayMode: "{{noPrivDisplayMode}}", dataAccessAction: '{{dataAccessAction}}', actionTarget: '{{actionTarget}}' },
{{/detail.psUIAction}} {{/detail.psUIAction}}
{{/each}} {{/each}}
{{/if}} {{/if}}
{{#if tempDetail.psDEFormDetails}} {{#if detail.psDEFormDetails}}
{{> @macro/front-end/widgets/form-detail/form-action-model.hbs item=tempDetail}} {{> @macro/front-end/widgets/form-detail/form-action-model.hbs item=detail}}
{{/if}} {{/if}}
{{/each}} {{/each}}
...@@ -21,4 +21,6 @@ ...@@ -21,4 +21,6 @@
{{#if item.caption}} {{#if item.caption}}
caption="{{item.caption}}" caption="{{item.caption}}"
{{/if}} {{/if}}
/> :uIAction="state.detailsModel.{{item.codeName}}.uIAction"
\ No newline at end of file @action="onComponentEvent"
/>
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
scriptCode: `{{item.psDEFormItemUpdate.scriptCode}}`, scriptCode: `{{item.psDEFormItemUpdate.scriptCode}}`,
{{else}} {{else}}
showBusyIndicator: "{{item.psDEFormItemUpdate.showBusyIndicator}}", showBusyIndicator: "{{item.psDEFormItemUpdate.showBusyIndicator}}",
{{!-- appDEMethod: "{{item.psDEFormItemUpdate.psAppDEMethod.codeName}}", --}} appDEMethod: "{{item.psDEFormItemUpdate.psAppDEMethod.codeName}}",
updateDetails: [ updateDetails: [
{{#each item.psDEFormItemUpdate.psDEFIUpdateDetails as | updateDetails | }} {{#each item.psDEFormItemUpdate.psDEFIUpdateDetails as | updateDetails | }}
"{{updateDetails.name}}", "{{updateDetails.name}}",
...@@ -33,14 +33,6 @@ ...@@ -33,14 +33,6 @@
{{/if}} {{/if}}
}, },
{{/if}} {{/if}}
{{#if item.createDVT}}
createDVT: "{{item.createDVT}}",
createDV: "{{item.createDV}}",
{{/if}}
{{#if item.updateDVT}}
updateDVT: "{{item.updateDVT}}",
updateDV: "{{item.updateDV}}",
{{/if}}
{{#if item.resetItemName}} {{#if item.resetItemName}}
resetItemName: '{{item.resetItemName}}', resetItemName: '{{item.resetItemName}}',
{{/if}} {{/if}}
...@@ -49,7 +41,8 @@ ...@@ -49,7 +41,8 @@
{{/if}} {{/if}}
{{/if}} {{/if}}
{{#if (and (eq item.detailType "BUTTON") item.psUIAction)}} {{#if (and (eq item.detailType "BUTTON") item.psUIAction)}}
uIActionTag: '{{item.psUIAction.uIActionTag}}', {{!-- TODO 补充显示图标和文字模式 --}}
uIAction: { caption: '{{item.psUIAction.caption}}', uIActionMode: "{{item.psUIAction.uIActionMode}}", disabled: false, visible: true, uIActionTag: '{{detail.psUIAction.uIActionTag}}', showCaption: {{item.showCaption}}, {{#if item.psUIAction.psSysImage}}{{#if item.psUIAction.psSysImage.imagePath}} imgPath: "{{item.psUIAction.psSysImage.imagePath}}",{{/if}}{{#if item.psUIAction.psSysImage.cssClass}} iconClass: "{{item.psUIAction.psSysImage.cssClass}}",{{/if}}{{/if}} },
{{/if}} {{/if}}
{{#if (and (eq item.detailType "GROUPPANEL") item.psUIActionGroup)}} {{#if (and (eq item.detailType "GROUPPANEL") item.psUIActionGroup)}}
uIActionGroup: { uIActionGroup: {
...@@ -57,7 +50,7 @@ ...@@ -57,7 +50,7 @@
caption: '{{item.psUIActionGroup.name}}', caption: '{{item.psUIActionGroup.name}}',
details: [ details: [
{{#each item.psUIActionGroup.psUIActionGroupDetails as | detail | }} {{#each item.psUIActionGroup.psUIActionGroupDetails as | detail | }}
{ caption: '{{detail.psUIAction.caption}}', disabled: false, visible: true, uIActionTag: '{{detail.psUIAction.uIActionTag}}', showCaption: {{detail.showCaption}}, showIcon: {{detail.showIcon}}, {{#if detail.psUIAction.psSysImage}}{{#if detail.psUIAction.psSysImage.imagePath}} imgPath: "{{detail.psUIAction.psSysImage.imagePath}}",{{/if}}{{#if detail.psUIAction.psSysImage.cssClass}} iconClass: "{{detail.psUIAction.psSysImage.cssClass}}",{{/if}}{{/if}} }, { caption: '{{detail.psUIAction.caption}}', uIActionMode: "{{detail.psUIAction.uIActionMode}}", disabled: false, visible: true, uIActionTag: '{{detail.psUIAction.uIActionTag}}', showCaption: {{detail.showCaption}}, showIcon: {{detail.showIcon}}, {{#if detail.psUIAction.psSysImage}}{{#if detail.psUIAction.psSysImage.imagePath}} imgPath: "{{detail.psUIAction.psSysImage.imagePath}}",{{/if}}{{#if detail.psUIAction.psSysImage.cssClass}} iconClass: "{{detail.psUIAction.psSysImage.cssClass}}",{{/if}}{{/if}} },
{{/each}} {{/each}}
], ],
}, },
...@@ -65,19 +58,7 @@ ...@@ -65,19 +58,7 @@
{{#if item.psDEFDGroupLogics}} {{#if item.psDEFDGroupLogics}}
groupLogics: [ groupLogics: [
{{#each item.psDEFDGroupLogics as | groupLogic |}} {{#each item.psDEFDGroupLogics as | groupLogic |}}
{ {{> @macro/front-end/common/delogic.hbs logic=groupLogic}}
name: '{{groupLogic.name}}',
groupOP: '{{groupLogic.groupOP}}',
relatedDetailNames: '{{groupLogic.relatedDetailNames}}',
logicCat: '{{groupLogic.logicCat}}',
logicType: '{{groupLogic.logicType}}',
notMode: {{groupLogic.notMode}},
logics: [
{{#each groupLogic.psDEFDLogics as | logic |}}
{condOP: '{{logic.condOP}}',dEFDName: '{{logic.dEFDName}}',logicType: '{{logic.logicType}}',name: '{{logic.name}}',value:'{{logic.value}}'},
{{/each}}
],
},
{{/each}} {{/each}}
], ],
{{/if}} {{/if}}
......
<AppFormGroup <AppFormGroup
name="{{item.codeName}}" name="{{item.codeName}}"
{{#if item.captionItemName}}
:title="state.data.{{lowerCase item.captionItemName}}"
{{else}}
title="{{item.caption}}" title="{{item.caption}}"
{{/if}}
:visible="state.detailsModel.{{item.codeName}}.visible" :visible="state.detailsModel.{{item.codeName}}.visible"
:layoutOpts="{{> @macro/front-end/common/layoutPos.hbs layout=item.psLayout layoutPos=item.psLayoutPos}}" :layoutOpts="{{> @macro/front-end/common/layoutPos.hbs layout=item.psLayout layoutPos=item.psLayoutPos}}"
{{#if item.psSysCss}} {{#if item.psSysCss}}
......
{{#neq item.psEditor.editorType "HIDDEN"}} {{#neq item.psEditor.editorType "HIDDEN"}}
<AppFormItem <AppFormItem
name="{{item.codeName}}" name="{{item.codeName}}"
{{#if item.captionItemName}}
:label="state.data.{{lowerCase item.captionItemName}}"
{{else}}
label="{{item.caption}}" label="{{item.caption}}"
{{/if}}
{{#if item.labelPos}}
labelPos="{{item.labelPos}}"
{{/if}}
:labelWidth="{{item.labelWidth}}" :labelWidth="{{item.labelWidth}}"
:showLabel="{{item.showCaption}}"
:rules="state.rules.{{item.codeName}}" :rules="state.rules.{{item.codeName}}"
:required="state.detailsModel.{{item.codeName}}.required" :required="state.detailsModel.{{item.codeName}}.required"
:visible="state.detailsModel.{{item.codeName}}.visible" :visible="state.detailsModel.{{item.codeName}}.visible"
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
name="{{item.codeName}}" name="{{item.codeName}}"
:visible="state.detailsModel.{{item.codeName}}.visible" :visible="state.detailsModel.{{item.codeName}}.visible"
:layoutOpts="{{> @macro/front-end/common/layoutPos.hbs layout=item.psLayout layoutPos=item.psLayoutPos}}" :layoutOpts="{{> @macro/front-end/common/layoutPos.hbs layout=item.psLayout layoutPos=item.psLayoutPos}}"
name={{item.name}}> >
{{#each item.psDEFormPages as | formPage | }} {{#each item.psDEFormPages as | formPage | }}
{{> @macro/front-end/widgets/form-detail/include-form.hbs type=formPage.detailType item=formPage}} {{> @macro/front-end/widgets/form-detail/include-form.hbs type=formPage.detailType item=formPage}}
{{/each}} {{/each}}
......
<script setup lang="ts"> <script setup lang="ts">
import { IActionParam, ILayoutOpts, IParam } from "@core"; import { IActionParam, ILayoutOpts, deepCopy } from "@core";
interface FormButtonProps{ interface FormButtonProps{
name: string; name: string;
...@@ -9,22 +9,36 @@ interface FormButtonProps{ ...@@ -9,22 +9,36 @@ interface FormButtonProps{
imgPath?: string; imgPath?: string;
showCaption?: boolean; showCaption?: boolean;
labelCssName?: string; labelCssName?: string;
caption: string caption: string,
uIAction: any;
} }
const props = withDefaults(defineProps<FormButtonProps>(), { const props = withDefaults(defineProps<FormButtonProps>(), {
visible: true, visible: true,
showCaption: true, showCaption: true,
}); });
interface FormButtonEmits {
(name: 'action', event: IActionParam): void
}
const emit = defineEmits<FormButtonEmits>();
// 点击
const click = (event: MouseEvent) => {
const data = deepCopy(props.uIAction);
Object.assign(data, { event: event });
emit('action', { tag: name, action: 'formButtonAction', data: data });
}
</script> </script>
<template> <template>
<AppCol :visible="visible" noRoot :layoutOpts="layoutOpts" class="app-formButton"> <AppCol :visible="visible" noRoot :layoutOpts="layoutOpts" class="app-form-button">
<template #default="{slotStyle, slotClass}"> <template #default="{slotStyle, slotClass}">
<a-button <a-button
:class="slotClass" :class="slotClass"
:style="slotStyle" :style="slotStyle"
type="primary"> type="primary"
@click="click">
<AppIconText :class="labelCssName" :iconClass="iconClass" :imgPath="imagePath" :text="showCaption ? caption : '' "/> <AppIconText :class="labelCssName" :iconClass="iconClass" :imgPath="imagePath" :text="showCaption ? caption : '' "/>
</a-button> </a-button>
</template> </template>
......
<script setup lang="ts"> <script setup lang="ts">
import { Ref, ref } from 'vue';
import { IActionParam, ILayoutOpts } from '@core'; import { IActionParam, ILayoutOpts } from '@core';
interface FormGroupProps { interface FormGroupProps {
...@@ -9,6 +10,7 @@ interface FormGroupProps { ...@@ -9,6 +10,7 @@ interface FormGroupProps {
required?: boolean; required?: boolean;
visible?: boolean; visible?: boolean;
labelWidth?: number; labelWidth?: number;
labelPos?: string | 'LEFT' | 'TOP' | 'RIGHT' | 'BOTTOM' | 'NONE';
rules?: any; rules?: any;
error?: string; error?: string;
labelClass?: string; labelClass?: string;
...@@ -19,21 +21,29 @@ interface FormGroupEmit { ...@@ -19,21 +21,29 @@ interface FormGroupEmit {
const props = withDefaults(defineProps<FormGroupProps>(), { const props = withDefaults(defineProps<FormGroupProps>(), {
required: false, required: false,
visible: true, visible: true,
showLabel: true showLabel: true,
labelPos: 'LEFT'
}); });
const emit = defineEmits<FormGroupEmit>(); const emit = defineEmits<FormGroupEmit>();
onBeforeMount(() => { onBeforeMount(() => {
watch(
() => props.required,
(newVal: boolean, oldVal: boolean) => {
initRules();
}
)
initRules(); initRules();
}); });
let itemRules: any = []; const itemRules: Ref<any[]> = ref([]);
const initRules = () => { const initRules = () => {
itemRules.value.splice(0, itemRules.value.length);
if (props.rules) { if (props.rules) {
itemRules.push(...props.rules); itemRules.value.push(...props.rules);
} }
if (props.required) { if (props.required) {
itemRules.push({ itemRules.value.push({
trigger: ['change', 'blur'], trigger: ['change', 'blur'],
required: props.required, required: props.required,
message: props.label + '必须填写', message: props.label + '必须填写',
...@@ -56,7 +66,7 @@ const initRules = () => { ...@@ -56,7 +66,7 @@ const initRules = () => {
:labelCol="{ style: { width: `${labelWidth}px` } }" :labelCol="{ style: { width: `${labelWidth}px` } }"
:validateStatus="error ? 'error' : 'validating'" :validateStatus="error ? 'error' : 'validating'"
> >
<template #label v-if="showLabel"> <template #label v-if="showLabel && labelPos !== 'NONE'">
<label :class="labelClass"> <label :class="labelClass">
<div class="label-title">{{ label }}</div> <div class="label-title">{{ label }}</div>
</label> </label>
......
...@@ -97,7 +97,8 @@ const { handleEditorNavParams, loadCodeListData } = new EditorBase(); ...@@ -97,7 +97,8 @@ const { handleEditorNavParams, loadCodeListData } = new EditorBase();
const { navContext, navViewParam } = handleEditorNavParams(props); const { navContext, navViewParam } = handleEditorNavParams(props);
let text: Ref<string> = ref(""); let text: Ref<string> = ref("");
let textFormat: Ref<string> = ref(""); let textFormat: Ref<string> = ref("");
onBeforeMount(() => { // 初始化值
const initText = () => {
if (props.codeListTag) { if (props.codeListTag) {
loadCodeListData( loadCodeListData(
props.codeListTag as string, props.codeListTag as string,
...@@ -110,11 +111,11 @@ onBeforeMount(() => { ...@@ -110,11 +111,11 @@ onBeforeMount(() => {
if (item) { if (item) {
text.value = item.label; text.value = item.label;
} else { } else {
text.value = props.value; text.value = props.value as string;
} }
}); });
} else { } else {
text.value = props.value; text.value = props.value as string;
} }
if (props.valueFormat) { if (props.valueFormat) {
textFormat.value = props.valueFormat; textFormat.value = props.valueFormat;
...@@ -128,6 +129,12 @@ onBeforeMount(() => { ...@@ -128,6 +129,12 @@ onBeforeMount(() => {
} else if (Object.is(props.dataType, "NUMBER")) { } else if (Object.is(props.dataType, "NUMBER")) {
textFormat.value = `#${props.unitName}`; textFormat.value = `#${props.unitName}`;
} }
}
onBeforeMount(() => {
// 监听值变化
watch(() => props.value, (newVal: any, oldVal: any) => { if (newVal !== oldVal) initText(); });
initText();
}); });
</script> </script>
......
import { IParam, MainControlState } from '@core'; import { ControlVOBase, IParam, MainControlState } from '@core';
/** /**
* @description 表单部件状态 * @description 表单部件状态
...@@ -9,25 +9,25 @@ import { IParam, MainControlState } from '@core'; ...@@ -9,25 +9,25 @@ import { IParam, MainControlState } from '@core';
export interface FormControlState extends MainControlState { export interface FormControlState extends MainControlState {
/** /**
* @description 表单数据对象 * @description 新建默认值集合
* @type {IParam} * @type {IParam[]}
* @memberof FormControlState * @memberof FormControlState
*/ */
data: IParam; createDefaultItems: IParam[];
/** /**
* @description 表单成员模型 * @description 表单数据对象
* @type {IParam} * @type {IParam}
* @memberof FormControlState * @memberof FormControlState
*/ */
detailsModel: IParam; data: ControlVOBase;
/** /**
* @description 表单界面行为模型 * @description 表单成员模型
* @type {IParam} * @type {IParam}
* @memberof FormControlState * @memberof FormControlState
*/ */
actionModel: IParam; detailsModel: IParam;
/** /**
* @description 值规则 * @description 值规则
...@@ -42,4 +42,11 @@ export interface FormControlState extends MainControlState { ...@@ -42,4 +42,11 @@ export interface FormControlState extends MainControlState {
* @memberof FormControlState * @memberof FormControlState
*/ */
enableAutoSave: boolean; enableAutoSave: boolean;
/**
* @description 更新默认值集合
* @type {IParam[]}
* @memberof FormControlState
*/
updateDefaultItems: IParam[];
} }
...@@ -509,7 +509,7 @@ export class GridControl extends MDControl { ...@@ -509,7 +509,7 @@ export class GridControl extends MDControl {
const { groupField } = gridGroup; const { groupField } = gridGroup;
let autoGroup: string[] = []; let autoGroup: string[] = [];
items.value.forEach((item: IParam) => { items.value.forEach((item: IParam) => {
if (item.hasOwnProperty(groupField)) { if (item.hasKey(groupField)) {
autoGroup.push(item[groupField]); autoGroup.push(item[groupField]);
} }
}) })
...@@ -652,13 +652,13 @@ export class GridControl extends MDControl { ...@@ -652,13 +652,13 @@ export class GridControl extends MDControl {
* @memberof GridControl * @memberof GridControl
*/ */
protected setCreateDefault(row: IParam = {}): void { protected setCreateDefault(row: IParam = {}): void {
const { createDefaultItems, viewParams, context, items } = this.state; const { createDefaultItems, viewParams, context } = this.state;
if (createDefaultItems.length === 0) { if (createDefaultItems.length === 0) {
return; return;
} }
createDefaultItems.forEach((item: IParam) => { createDefaultItems.forEach((item: IParam) => {
const { createDVT, createDV, property, valueFormat, fieldType } = item; const { createDVT, createDV, property, valueFormat, dataType } = item;
if (createDVT && (row.hasOwnProperty(property) || property in row)) { if (createDVT && row.hasKey(property)) {
switch (createDVT) { switch (createDVT) {
case "CONTEXT": case "CONTEXT":
if (createDV) { if (createDV) {
...@@ -686,8 +686,8 @@ export class GridControl extends MDControl { ...@@ -686,8 +686,8 @@ export class GridControl extends MDControl {
} }
break; break;
} }
} else if (createDV && (row.hasOwnProperty(property) || property in row)) { } else if (createDV && row.hasKey(property)) {
row[property] = fieldType && DataTypes.isNumber(fieldType) ? Number(createDV) : createDV; row[property] = dataType && DataTypes.isNumber(dataType) ? Number(createDV) : createDV;
} }
}); });
} }
...@@ -700,14 +700,14 @@ export class GridControl extends MDControl { ...@@ -700,14 +700,14 @@ export class GridControl extends MDControl {
* @memberof GridControl * @memberof GridControl
*/ */
protected setUpdateDefault(): void { protected setUpdateDefault(): void {
const { updateDefaultItems, viewParams, context, items, controlService } = this.state; const { updateDefaultItems, viewParams, context, items } = this.state;
if (updateDefaultItems.length === 0 || items.length === 0) { if (updateDefaultItems.length === 0 || items.length === 0) {
return; return;
} }
const setDefault = (row: IParam = {}) => { const setDefault = (row: IParam = {}) => {
updateDefaultItems.forEach((item: IParam) => { updateDefaultItems.forEach((item: IParam) => {
const { updateDV, updateDVT, property, valueFormat, fieldType } = item; const { updateDV, updateDVT, property, valueFormat, dataType } = item;
if (updateDVT && (row.hasOwnProperty(property) || property in row)) { if (updateDVT && row.hasKey(property)) {
switch (updateDVT) { switch (updateDVT) {
case "CONTEXT": case "CONTEXT":
if (updateDV) { if (updateDV) {
...@@ -735,8 +735,8 @@ export class GridControl extends MDControl { ...@@ -735,8 +735,8 @@ export class GridControl extends MDControl {
} }
break; break;
} }
} else if (updateDV && row.hasOwnProperty(property)) { } else if (updateDV && row.hasKey(property)) {
row[property] = fieldType && DataTypes.isNumber(fieldType) ? Number(updateDV) : updateDV; row[property] = dataType && DataTypes.isNumber(dataType) ? Number(updateDV) : updateDV;
} }
}); });
} }
......
import { IParam, MainControlState } from '@core'; import { ControlVOBase, IParam, MainControlState } from '@core';
/** /**
* @description 多数据部件状态 * @description 多数据部件状态
...@@ -20,7 +20,7 @@ export interface MDControlState extends MainControlState { ...@@ -20,7 +20,7 @@ export interface MDControlState extends MainControlState {
* @type {IParam[]} * @type {IParam[]}
* @memberof MDControlState * @memberof MDControlState
*/ */
items: IParam[]; items: ControlVOBase[];
/** /**
* @description 是否多选 * @description 是否多选
......
import { deepCopy } from '@core'; import { deepCopy, IParam } from '@core';
export class ControlVOBase { export class ControlVOBase {
/** /**
* 后台数据对象 * @description 后台数据对象
* @protected * @protected
* @type {*}
* @memberof ControlVOBase
*/ */
protected $DO: any = {}; protected $DO: any = {};
/** /**
* 自有属性名称集合 * @description 自有属性名称集合
* @type {string[]}
* @memberof ControlVOBase
*/ */
public $ownKeys: string[] = []; public $ownKeys: string[] = [];
...@@ -91,6 +95,19 @@ export class ControlVOBase { ...@@ -91,6 +95,19 @@ export class ControlVOBase {
return {}; return {};
} }
/**
* @description 是否含有属性
* @param {string} key 属性名
* @return {*} {boolean}
* @memberof ControlVOBase
*/
public hasKey(key: string): boolean {
if (this.hasOwnProperty(key) || key in this) {
return true;
}
return false;
}
/** /**
* 用后台数据重置数据对象 * 用后台数据重置数据对象
* @param data 后台数据 * @param data 后台数据
......
...@@ -51,15 +51,56 @@ export const ctrlState = { ...@@ -51,15 +51,56 @@ export const ctrlState = {
controlName: '{{ctrl.name}}', controlName: '{{ctrl.name}}',
controlService: new EditFormService<ControlVO>(ControlVO, new {{pascalCase ctrl.psAppDataEntity.codeName}}Service() ), controlService: new EditFormService<ControlVO>(ControlVO, new {{pascalCase ctrl.psAppDataEntity.codeName}}Service() ),
data: new ControlVO({}), data: new ControlVO({}),
{{#each ctrl.psAppDataEntity.allPSAppDEFields as | appDEField | }} appEntityCodeName: '{{ctrl.appEntity.codeName}}',
{{#if appDEField.keyField}} appDeCodeName:'{{ctrl.appEntity.codeName}}',
appDeKeyFieldName: '{{appDEField.codeName}}', appDeLogicName: '{{ctrl.appEntity.logicName}}',
{{/if}} appDeKeyFieldName: '{{#if ctrl.appEntity.keyPSAppDEField}}{{ctrl.appEntity.keyPSAppDEField.codeName}}{{/if}}',
{{#if appDEField.majorField}} appDeMajorFieldName: '{{#if ctrl.appEntity.majorPSAppDEField}}{{ctrl.appEntity.majorPSAppDEField.codeName}}{{/if}}',
appDeMajorFieldName: '{{appDEField.codeName}}',
{{/if}}
{{/each}}
enableAutoSave: {{ctrl.enableAutoSave}}, enableAutoSave: {{ctrl.enableAutoSave}},
// 新建默认值
createDefaultItems: [
{{#each ctrl.psDEFormItems as | formItem |}}
{{#formItem}}
{{#if (or createDV createDVT)}}
{
createDV: "{{createDV}}",
createDVT: "{{createDVT}}",
property: "{{lowerCase id}}",
{{#if (and psEditor psEditor.dateTimeFormat)}}
valueFormat: "{{editItem.psEditor.dateTimeFormat}}",
{{else if psAppDEField}}
valueFormat: "{{psAppDEField.valueFormat}}",
{{/if}}
{{#if psAppDEField}}
dataType: "{{psAppDEField.stdDataType}}"
{{/if}}
}{{#unless @last}},{{/unless}}
{{/if}}
{{/formItem}}
{{/each}}
],
// 更新默认值
updateDefaultItems: [
{{#each ctrl.psDEFormItems as | formItem |}}
{{#formItem}}
{{#if (or updateDV updateDVT)}}
{
updateDV: "{{updateDV}}",
updateDVT: "{{updateDVT}}",
property: "{{lowerCase id}}",
{{#if (and psEditor psEditor.dateTimeFormat)}}
valueFormat: "{{editItem.psEditor.dateTimeFormat}}",
{{else if psAppDEField}}
valueFormat: "{{psAppDEField.valueFormat}}",
{{/if}}
{{#if psAppDEField}}
dataType: "{{psAppDEField.stdDataType}}"
{{/if}}
}{{#unless @last}},{{/unless}}
{{/if}}
{{/formItem}}
{{/each}}
],
detailsModel: { detailsModel: {
{{#if ctrl.psDEFormPages}} {{#if ctrl.psDEFormPages}}
{{#each ctrl.psDEFormPages as | FormPage | }} {{#each ctrl.psDEFormPages as | FormPage | }}
...@@ -73,17 +114,17 @@ export const ctrlState = { ...@@ -73,17 +114,17 @@ export const ctrlState = {
{{/each}} {{/each}}
}, },
rules: { rules: {
{{#each ctrl.psDEFormItemVRs as | ruleItem |}} {{#each ctrl.psDEFormItemVRs as | ruleItem |}}
{{#if (eq ruleItem.valueRuleType 'SYSVALUERULE')}} {{#if (eq ruleItem.valueRuleType 'SYSVALUERULE')}}
{{ruleItem.psDEFormItemName}}: [ {{ruleItem.psDEFormItemName}}: [
{ {
trigger: ['change', 'blur'], trigger: ['change', 'blur'],
{{#eq ruleItem.psSysValueRule.ruleType 'REG'}} {{#eq ruleItem.psSysValueRule.ruleType 'REG'}}
pattern: /{{ruleItem.psSysValueRule.regExCode}}/, pattern: /{{ruleItem.psSysValueRule.regExCode}}/,
{{/eq}} {{/eq}}
message:'{{ruleItem.psSysValueRule.ruleInfo}}' message:'{{ruleItem.psSysValueRule.ruleInfo}}'
}], }],
{{/if}} {{/if}}
{{/each}} {{/each}}
}, },
}; };
\ No newline at end of file
...@@ -48,7 +48,7 @@ export const ctrlState = { ...@@ -48,7 +48,7 @@ export const ctrlState = {
valueFormat: "{{editItem.psAppDEField.valueFormat}}", valueFormat: "{{editItem.psAppDEField.valueFormat}}",
{{/if}} {{/if}}
{{#if editItem.psAppDEField}} {{#if editItem.psAppDEField}}
fieldType: "{{editItem.psAppDEField.stdDataType}}" dataType: "{{editItem.psAppDEField.stdDataType}}"
{{/if}} {{/if}}
}{{#unless @last}},{{/unless}} }{{#unless @last}},{{/unless}}
{{/if}} {{/if}}
...@@ -180,7 +180,7 @@ export const ctrlState = { ...@@ -180,7 +180,7 @@ export const ctrlState = {
valueFormat: "{{editItem.psAppDEField.valueFormat}}", valueFormat: "{{editItem.psAppDEField.valueFormat}}",
{{/if}} {{/if}}
{{#if editItem.psAppDEField}} {{#if editItem.psAppDEField}}
fieldType: "{{editItem.psAppDEField.stdDataType}}" dataType: "{{editItem.psAppDEField.stdDataType}}"
{{/if}} {{/if}}
}{{#unless @last}},{{/unless}} }{{#unless @last}},{{/unless}}
{{/if}} {{/if}}
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册