cloud-web-corejs 1.0.54-dev.687 → 1.0.54-dev.689
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/components/fileLibrary/index.vue +113 -33
- package/src/components/table/CellSlot.vue +12 -10
- package/src/components/xform/docs//345/220/216/345/217/260/345/255/227/346/256/265/357/274/210/345/212/250/346/200/201/347/224/237/346/210/220/357/274/211JSON /350/257/264/346/230/216.md" +1261 -0
- package/src/components/xform/docs//346/225/260/346/215/256/350/241/250/346/240/274/345/212/250/346/200/201/345/210/227 JSON /350/257/264/346/230/216.md" +657 -0
- package/src/components/xform/form-designer/designer.js +1 -1
- package/src/components/xform/form-designer/form-widget/field-widget/cascader-widget.vue +157 -105
- package/src/components/xform/form-designer/form-widget/field-widget/fieldMixin.js +98 -18
- package/src/components/xform/form-designer/form-widget/field-widget/form-item-wrapper.vue +18 -13
- package/src/components/xform/form-designer/form-widget/field-widget/number-widget.vue +11 -8
- package/src/components/xform/form-designer/form-widget/field-widget/script-input-widget.vue +143 -0
- package/src/components/xform/form-designer/indexMixin.js +837 -13
- package/src/components/xform/form-designer/setting-panel/option-items-setting.vue +69 -21
- package/src/components/xform/form-designer/setting-panel/property-editor/container-data-table/data-table-editor.vue +87 -25
- package/src/components/xform/form-designer/setting-panel/property-editor/container-data-table/table-column-dialog.vue +5 -0
- package/src/components/xform/form-designer/setting-panel/property-editor/container-table/table-dynamicField-editor.vue +80 -34
- package/src/components/xform/form-designer/setting-panel/property-editor/field-cascader/checkStrictly-editor.vue +11 -13
- package/src/components/xform/form-designer/setting-panel/property-editor/field-cascader/showAllLevels-editor.vue +21 -0
- package/src/components/xform/form-designer/setting-panel/property-editor/field-script-input/script-input-editor.vue +54 -0
- package/src/components/xform/form-designer/setting-panel/property-editor/formScriptEnabled-editor.vue +15 -4
- package/src/components/xform/form-designer/setting-panel/propertyRegister.js +2 -0
- package/src/components/xform/form-designer/widget-panel/widgetsConfig.js +117 -2
- package/src/components/xform/form-render/container-item/data-table-mixin.js +296 -118
- package/src/components/xform/form-render/container-item/dynamicFieldMixin.js +50 -36
- package/src/components/xform/form-render/container-item/list-h5-item.vue +5 -1
- package/src/components/xform/form-render/indexMixin.js +197 -12
- package/src/components/xform/lang/en-US.js +1 -0
- package/src/components/xform/lang/zh-CN.js +86 -99
- package/src/components/xform/utils/dynamicSchemaUtil.js +312 -0
- package/src/components/xform/utils/tableCellValidateUtil.js +148 -0
- package/src/components/xform/utils/tableColumnHelper.js +21 -1
- package/src/components/xform/utils/util.js +126 -0
|
@@ -1,134 +1,186 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<form-item-wrapper
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
2
|
+
<form-item-wrapper
|
|
3
|
+
:designer="designer"
|
|
4
|
+
:field="field"
|
|
5
|
+
:rules="rules"
|
|
6
|
+
:design-state="designState"
|
|
7
|
+
:parent-widget="parentWidget"
|
|
8
|
+
:parent-list="parentList"
|
|
9
|
+
:index-of-parent-list="indexOfParentList"
|
|
10
|
+
:sub-form-row-index="subFormRowIndex"
|
|
11
|
+
:sub-form-col-index="subFormColIndex"
|
|
12
|
+
:sub-form-row-id="subFormRowId"
|
|
13
|
+
>
|
|
14
|
+
<el-cascader
|
|
15
|
+
ref="fieldEditor"
|
|
16
|
+
:options="field.options.optionItems"
|
|
17
|
+
v-model="fieldModel"
|
|
18
|
+
v-show="!isReadMode"
|
|
19
|
+
class="full-width-input"
|
|
20
|
+
:disabled="field.options.disabled || isReadMode"
|
|
21
|
+
:clearable="field.options.clearable"
|
|
22
|
+
:filterable="field.options.filterable"
|
|
23
|
+
:placeholder="
|
|
24
|
+
field.options.placeholder || i18nt('render.hint.selectPlaceholder')
|
|
25
|
+
"
|
|
26
|
+
:show-all-levels="showFullPath"
|
|
27
|
+
:props="{
|
|
28
|
+
checkStrictly: field.options.checkStrictly,
|
|
29
|
+
multiple: field.options.multiple,
|
|
30
|
+
expandTrigger: 'hover',
|
|
31
|
+
value: valueKey,
|
|
32
|
+
label: labelKey,
|
|
33
|
+
children: childrenKey,
|
|
34
|
+
}"
|
|
35
|
+
@visible-change="hideDropDownOnClick"
|
|
36
|
+
@expand-change="hideDropDownOnClick"
|
|
37
|
+
@focus="handleFocusCustomEvent"
|
|
38
|
+
@blur="handleBlurCustomEvent"
|
|
39
|
+
@clear="handleClearEvent"
|
|
40
|
+
@change="onFieldChangeEvent"
|
|
41
|
+
>
|
|
17
42
|
</el-cascader>
|
|
18
43
|
<template v-if="isReadMode">
|
|
19
|
-
<span class="readonly-mode-field">{{contentForReadMode}}</span>
|
|
44
|
+
<span class="readonly-mode-field">{{ contentForReadMode }}</span>
|
|
20
45
|
</template>
|
|
21
46
|
</form-item-wrapper>
|
|
22
47
|
</template>
|
|
23
48
|
|
|
24
49
|
<script>
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
export default {
|
|
31
|
-
name: "cascader-widget",
|
|
32
|
-
componentName: 'FieldWidget', //必须固定为FieldWidget,用于接收父级组件的broadcast事件
|
|
33
|
-
mixins: [emitter, fieldMixin, i18n],
|
|
34
|
-
props: {
|
|
35
|
-
field: Object,
|
|
36
|
-
parentWidget: Object,
|
|
37
|
-
parentList: Array,
|
|
38
|
-
indexOfParentList: Number,
|
|
39
|
-
designer: Object,
|
|
40
|
-
|
|
41
|
-
designState: {
|
|
42
|
-
type: Boolean,
|
|
43
|
-
default: false
|
|
44
|
-
},
|
|
45
|
-
|
|
46
|
-
subFormRowIndex: { /* 子表单组件行索引,从0开始计数 */
|
|
47
|
-
type: Number,
|
|
48
|
-
default: -1
|
|
49
|
-
},
|
|
50
|
-
subFormColIndex: { /* 子表单组件列索引,从0开始计数 */
|
|
51
|
-
type: Number,
|
|
52
|
-
default: -1
|
|
53
|
-
},
|
|
54
|
-
subFormRowId: { /* 子表单组件行Id,唯一id且不可变 */
|
|
55
|
-
type: String,
|
|
56
|
-
default: ''
|
|
57
|
-
},
|
|
50
|
+
import FormItemWrapper from "./form-item-wrapper";
|
|
51
|
+
import emitter from "../../../../../components/xform/utils/emitter";
|
|
52
|
+
import i18n from "../../../../../components/xform/utils/i18n";
|
|
53
|
+
import fieldMixin from "../../../../../components/xform/form-designer/form-widget/field-widget/fieldMixin";
|
|
58
54
|
|
|
55
|
+
export default {
|
|
56
|
+
name: "cascader-widget",
|
|
57
|
+
componentName: "FieldWidget", //必须固定为FieldWidget,用于接收父级组件的broadcast事件
|
|
58
|
+
mixins: [emitter, fieldMixin, i18n],
|
|
59
|
+
props: {
|
|
60
|
+
field: Object,
|
|
61
|
+
parentWidget: Object,
|
|
62
|
+
parentList: Array,
|
|
63
|
+
indexOfParentList: Number,
|
|
64
|
+
designer: Object,
|
|
65
|
+
|
|
66
|
+
designState: {
|
|
67
|
+
type: Boolean,
|
|
68
|
+
default: false,
|
|
59
69
|
},
|
|
60
|
-
|
|
61
|
-
|
|
70
|
+
|
|
71
|
+
subFormRowIndex: {
|
|
72
|
+
/* 子表单组件行索引,从0开始计数 */ type: Number,
|
|
73
|
+
default: -1,
|
|
62
74
|
},
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
oldFieldValue: null, //field组件change之前的值
|
|
67
|
-
fieldModel: null,
|
|
68
|
-
rules: [],
|
|
69
|
-
}
|
|
75
|
+
subFormColIndex: {
|
|
76
|
+
/* 子表单组件列索引,从0开始计数 */ type: Number,
|
|
77
|
+
default: -1,
|
|
70
78
|
},
|
|
71
|
-
|
|
72
|
-
|
|
79
|
+
subFormRowId: {
|
|
80
|
+
/* 子表单组件行Id,唯一id且不可变 */ type: String,
|
|
81
|
+
default: "",
|
|
73
82
|
},
|
|
74
|
-
|
|
75
|
-
|
|
83
|
+
},
|
|
84
|
+
components: {
|
|
85
|
+
FormItemWrapper,
|
|
86
|
+
},
|
|
87
|
+
inject: ["refList", "globalOptionData", "globalModel"],
|
|
88
|
+
data() {
|
|
89
|
+
return {
|
|
90
|
+
oldFieldValue: null, //field组件change之前的值
|
|
91
|
+
fieldModel: null,
|
|
92
|
+
rules: [],
|
|
93
|
+
};
|
|
94
|
+
},
|
|
95
|
+
computed: {
|
|
96
|
+
labelKey() {
|
|
97
|
+
return this.field.options.labelKey || "label";
|
|
76
98
|
},
|
|
77
99
|
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
需要在父组件created中初始化!! */
|
|
81
|
-
this.initOptionItems()
|
|
82
|
-
this.initFieldModel()
|
|
83
|
-
this.registerToRefList()
|
|
84
|
-
this.initEventHandler()
|
|
85
|
-
this.buildFieldRules()
|
|
86
|
-
|
|
87
|
-
this.handleOnCreated()
|
|
100
|
+
valueKey() {
|
|
101
|
+
return this.field.options.valueKey || "value";
|
|
88
102
|
},
|
|
89
103
|
|
|
90
|
-
|
|
91
|
-
this.
|
|
104
|
+
childrenKey() {
|
|
105
|
+
return this.field.options.childrenKey || "children";
|
|
92
106
|
},
|
|
93
107
|
|
|
94
|
-
|
|
95
|
-
|
|
108
|
+
showFullPath() {
|
|
109
|
+
return (
|
|
110
|
+
this.field.options.showAllLevels === undefined ||
|
|
111
|
+
!!this.field.options.showAllLevels
|
|
112
|
+
);
|
|
96
113
|
},
|
|
97
114
|
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
this.$refs.fieldEditor.dropDownVisible = false //单选框部分点击隐藏下拉框
|
|
105
|
-
}
|
|
106
|
-
})
|
|
107
|
-
}, 100)
|
|
108
|
-
},
|
|
109
|
-
contentForReadMode() {
|
|
110
|
-
if (!!this.field.options.multiple) {
|
|
111
|
-
//console.log('test======', this.$refs.fieldEditor.presentTags)
|
|
112
|
-
const curTags = this.$refs.fieldEditor.presentTags
|
|
113
|
-
if (!curTags || (curTags.length <= 0)) {
|
|
114
|
-
return '--'
|
|
115
|
-
} else {
|
|
116
|
-
return curTags.map(tagItem => tagItem.text).join(', ')
|
|
117
|
-
}
|
|
115
|
+
contentForReadMode() {
|
|
116
|
+
if (!!this.field.options.multiple) {
|
|
117
|
+
//console.log('test======', this.$refs.fieldEditor.presentTags)
|
|
118
|
+
const curTags = this.$refs.fieldEditor.presentTags;
|
|
119
|
+
if (!curTags || curTags.length <= 0) {
|
|
120
|
+
return "--";
|
|
118
121
|
} else {
|
|
119
|
-
return
|
|
122
|
+
return curTags.map((tagItem) => tagItem.text).join(", ");
|
|
120
123
|
}
|
|
121
|
-
}
|
|
124
|
+
} else {
|
|
125
|
+
return this.$refs.fieldEditor.presentText || "--";
|
|
126
|
+
}
|
|
127
|
+
},
|
|
128
|
+
},
|
|
129
|
+
beforeCreate() {
|
|
130
|
+
/* 这里不能访问方法和属性!! */
|
|
131
|
+
},
|
|
132
|
+
|
|
133
|
+
created() {
|
|
134
|
+
/* 注意:子组件mounted在父组件created之后、父组件mounted之前触发,故子组件mounted需要用到的prop
|
|
135
|
+
需要在父组件created中初始化!! */
|
|
136
|
+
this.registerToRefList();
|
|
137
|
+
this.initOptionItems();
|
|
138
|
+
this.initFieldModel();
|
|
139
|
+
this.initEventHandler();
|
|
140
|
+
this.buildFieldRules();
|
|
122
141
|
|
|
123
|
-
|
|
124
|
-
}
|
|
142
|
+
this.handleOnCreated();
|
|
143
|
+
},
|
|
144
|
+
|
|
145
|
+
mounted() {
|
|
146
|
+
this.handleOnMounted();
|
|
147
|
+
},
|
|
148
|
+
|
|
149
|
+
beforeDestroy() {
|
|
150
|
+
this.unregisterFromRefList();
|
|
151
|
+
},
|
|
152
|
+
|
|
153
|
+
methods: {
|
|
154
|
+
/* 开启任意级节点可选后,点击radio隐藏下拉框 */
|
|
155
|
+
hideDropDownOnClick() {
|
|
156
|
+
setTimeout(() => {
|
|
157
|
+
document
|
|
158
|
+
.querySelectorAll(".el-cascader-panel .el-radio")
|
|
159
|
+
.forEach((el) => {
|
|
160
|
+
el.onclick = () => {
|
|
161
|
+
this.$refs.fieldEditor.dropDownVisible = false; //单选框部分点击隐藏下拉框
|
|
162
|
+
};
|
|
163
|
+
});
|
|
164
|
+
}, 100);
|
|
165
|
+
},
|
|
166
|
+
|
|
167
|
+
handleClearEvent() {
|
|
168
|
+
if (!!this.designState) {
|
|
169
|
+
//设计状态不触发事件
|
|
170
|
+
return;
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
this.fieldModel = null;
|
|
174
|
+
this.onFieldChangeEvent(null);
|
|
175
|
+
},
|
|
176
|
+
},
|
|
177
|
+
};
|
|
125
178
|
</script>
|
|
126
179
|
|
|
127
180
|
<style lang="scss" scoped>
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
.full-width-input {
|
|
131
|
-
width: 100% !important;
|
|
132
|
-
}
|
|
181
|
+
@import "~@/styles/global.scss"; //* form-item-wrapper已引入,还需要重复引入吗? *//
|
|
133
182
|
|
|
183
|
+
.full-width-input {
|
|
184
|
+
width: 100% !important;
|
|
185
|
+
}
|
|
134
186
|
</style>
|
|
@@ -8,6 +8,9 @@ import {
|
|
|
8
8
|
getAccessUrl,
|
|
9
9
|
generateId,
|
|
10
10
|
trim,
|
|
11
|
+
isArrayValueWidgetType,
|
|
12
|
+
isAttachmentWidgetType,
|
|
13
|
+
isEmptyArrayFieldValue,
|
|
11
14
|
} from "../../../../../components/xform/utils/util";
|
|
12
15
|
import FormValidators, {
|
|
13
16
|
getRegExp,
|
|
@@ -71,6 +74,8 @@ modules = {
|
|
|
71
74
|
"getReportTemplate",
|
|
72
75
|
"getObjectFieldFlag",
|
|
73
76
|
"getObjectName",
|
|
77
|
+
"setCETriggerFlag",
|
|
78
|
+
"clearCETriggerFlag",
|
|
74
79
|
],
|
|
75
80
|
data: function () {
|
|
76
81
|
return {
|
|
@@ -177,8 +182,8 @@ modules = {
|
|
|
177
182
|
selectedItems == null
|
|
178
183
|
? []
|
|
179
184
|
: Array.isArray(selectedItems)
|
|
180
|
-
|
|
181
|
-
|
|
185
|
+
? selectedItems
|
|
186
|
+
: [selectedItems];
|
|
182
187
|
const labelField = this.getOptionItemLabelKey();
|
|
183
188
|
return items.map((item) => this.$t1(item[labelField])).join(",");
|
|
184
189
|
},
|
|
@@ -214,8 +219,8 @@ modules = {
|
|
|
214
219
|
return isMultiple
|
|
215
220
|
? resultList
|
|
216
221
|
: resultList.length > 0
|
|
217
|
-
|
|
218
|
-
|
|
222
|
+
? resultList[0]
|
|
223
|
+
: null;
|
|
219
224
|
},
|
|
220
225
|
initValueWatchEvent() {
|
|
221
226
|
if (!this.designer) {
|
|
@@ -324,7 +329,8 @@ modules = {
|
|
|
324
329
|
nullValue = undefined;
|
|
325
330
|
} else if (
|
|
326
331
|
widgetType === "checkbox" ||
|
|
327
|
-
(widgetType === "select" && this.field.options.multiple)
|
|
332
|
+
(widgetType === "select" && this.field.options.multiple) ||
|
|
333
|
+
isAttachmentWidgetType(widgetType)
|
|
328
334
|
) {
|
|
329
335
|
nullValue = [];
|
|
330
336
|
} else if (
|
|
@@ -337,11 +343,23 @@ modules = {
|
|
|
337
343
|
if (void 0 === currentData[this.fieldKeyName]) {
|
|
338
344
|
this.$set(currentData, this.fieldKeyName, nullValue);
|
|
339
345
|
}
|
|
346
|
+
if (
|
|
347
|
+
widgetType === "number" &&
|
|
348
|
+
currentData[this.fieldKeyName] === null
|
|
349
|
+
) {
|
|
350
|
+
this.$set(currentData, this.fieldKeyName, undefined);
|
|
351
|
+
}
|
|
340
352
|
if (flag) {
|
|
341
353
|
this.fieldModel = currentData[this.fieldKeyName];
|
|
342
|
-
} else if (
|
|
354
|
+
} else if (
|
|
355
|
+
currentData[this.fieldKeyName] !== null &&
|
|
356
|
+
currentData[this.fieldKeyName] !== undefined
|
|
357
|
+
) {
|
|
343
358
|
this.fieldModel = currentData[this.fieldKeyName];
|
|
344
359
|
} else {
|
|
360
|
+
if (widgetType === "number") {
|
|
361
|
+
this.fieldModel = undefined;
|
|
362
|
+
}
|
|
345
363
|
if (!dataId) {
|
|
346
364
|
//新增
|
|
347
365
|
if (
|
|
@@ -914,19 +932,40 @@ modules = {
|
|
|
914
932
|
result = this.$t1(value, { label });
|
|
915
933
|
return result;
|
|
916
934
|
},
|
|
935
|
+
resolveFieldValidateLabelCode() {
|
|
936
|
+
if (this.field.options.label) {
|
|
937
|
+
return this.field.options.label;
|
|
938
|
+
}
|
|
939
|
+
const columnConfig =
|
|
940
|
+
this.columnConfig || this.tableParam?.column?.params?.columnConfig;
|
|
941
|
+
if (columnConfig?.label) {
|
|
942
|
+
return columnConfig.label;
|
|
943
|
+
}
|
|
944
|
+
return (
|
|
945
|
+
(this.field.options.keyNameEnabled && this.field.options.keyName) ||
|
|
946
|
+
this.field.options.name ||
|
|
947
|
+
""
|
|
948
|
+
);
|
|
949
|
+
},
|
|
917
950
|
getValidationHintMsg() {
|
|
918
951
|
let vldName = this.field.options.validation;
|
|
919
952
|
if (this.field.options.validationHint) {
|
|
920
953
|
return this.$t1(this.field.options.validationHint);
|
|
921
954
|
} else {
|
|
922
|
-
return this.getValidateDefaultMsg(
|
|
955
|
+
return this.getValidateDefaultMsg(
|
|
956
|
+
this.resolveFieldValidateLabelCode(),
|
|
957
|
+
vldName
|
|
958
|
+
);
|
|
923
959
|
}
|
|
924
960
|
},
|
|
925
961
|
getRequiredHintMsg() {
|
|
926
962
|
if (this.field.options.requiredHint) {
|
|
927
963
|
return this.$t1(this.field.options.requiredHint);
|
|
928
964
|
} else {
|
|
929
|
-
return this.getValidateDefaultMsg(
|
|
965
|
+
return this.getValidateDefaultMsg(
|
|
966
|
+
this.resolveFieldValidateLabelCode(),
|
|
967
|
+
"required"
|
|
968
|
+
);
|
|
930
969
|
}
|
|
931
970
|
},
|
|
932
971
|
buildFieldRules() {
|
|
@@ -936,14 +975,37 @@ modules = {
|
|
|
936
975
|
|
|
937
976
|
this.rules.splice(0, this.rules.length); //清空已有
|
|
938
977
|
if (!!this.field.options.required) {
|
|
939
|
-
this.
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
978
|
+
if (isArrayValueWidgetType(this.field.type, this.field.options)) {
|
|
979
|
+
this.rules.push({
|
|
980
|
+
validator: (rule, value, callback) => {
|
|
981
|
+
const actualValue =
|
|
982
|
+
typeof this.getCurrentValue === "function"
|
|
983
|
+
? this.getCurrentValue()
|
|
984
|
+
: value;
|
|
985
|
+
if (
|
|
986
|
+
isEmptyArrayFieldValue(
|
|
987
|
+
actualValue,
|
|
988
|
+
this.field.type,
|
|
989
|
+
this.field.options
|
|
990
|
+
)
|
|
991
|
+
) {
|
|
992
|
+
callback(new Error(this.getRequiredHintMsg()));
|
|
993
|
+
} else {
|
|
994
|
+
callback();
|
|
995
|
+
}
|
|
996
|
+
},
|
|
997
|
+
trigger: ["change", "blur"],
|
|
998
|
+
});
|
|
999
|
+
} else {
|
|
1000
|
+
this.rules.push({
|
|
1001
|
+
required: true,
|
|
1002
|
+
//trigger: ['blur', 'change'],
|
|
1003
|
+
trigger: [
|
|
1004
|
+
"blur",
|
|
1005
|
+
] /* 去掉change事件触发校验,change事件触发时formModel数据尚未更新,导致radio/checkbox必填校验出错!! */,
|
|
1006
|
+
message: this.getRequiredHintMsg(),
|
|
1007
|
+
});
|
|
1008
|
+
}
|
|
947
1009
|
}
|
|
948
1010
|
|
|
949
1011
|
if (!!this.field.options.validation) {
|
|
@@ -1100,6 +1162,18 @@ modules = {
|
|
|
1100
1162
|
i[this.fieldKeyName] = e;
|
|
1101
1163
|
} else this.formModel[this.fieldKeyName] = e;
|
|
1102
1164
|
},
|
|
1165
|
+
onFieldChangeEvent(value) {
|
|
1166
|
+
if (!!this.designState) {
|
|
1167
|
+
//设计状态不触发事件
|
|
1168
|
+
return;
|
|
1169
|
+
}
|
|
1170
|
+
|
|
1171
|
+
this.setCETriggerFlag(); //设置用户触发事件标志
|
|
1172
|
+
this.handleChangeEvent(value);
|
|
1173
|
+
setTimeout(() => {
|
|
1174
|
+
this.clearCETriggerFlag(); //复位用户触发事件标志
|
|
1175
|
+
}, 200);
|
|
1176
|
+
},
|
|
1103
1177
|
handleChangeEvent: function (e) {
|
|
1104
1178
|
let widgetType = this.field.type;
|
|
1105
1179
|
if (widgetType === "select") {
|
|
@@ -1108,8 +1182,8 @@ modules = {
|
|
|
1108
1182
|
this.fieldModel = e;
|
|
1109
1183
|
}
|
|
1110
1184
|
} else if (widgetType === "number") {
|
|
1111
|
-
if (e === undefined) {
|
|
1112
|
-
e =
|
|
1185
|
+
if (e === undefined || e === null) {
|
|
1186
|
+
e = undefined;
|
|
1113
1187
|
this.fieldModel = e;
|
|
1114
1188
|
}
|
|
1115
1189
|
}
|
|
@@ -1578,9 +1652,15 @@ modules = {
|
|
|
1578
1652
|
: (this.fieldModel = ""));
|
|
1579
1653
|
},
|
|
1580
1654
|
getOptionItemValueKey() {
|
|
1655
|
+
if (this.field.options.commonAttributeEnabled) {
|
|
1656
|
+
return this.field.options.valueKey || "sn";
|
|
1657
|
+
}
|
|
1581
1658
|
return this.field.options.valueKey || "value";
|
|
1582
1659
|
},
|
|
1583
1660
|
getOptionItemLabelKey() {
|
|
1661
|
+
if (this.field.options.commonAttributeEnabled) {
|
|
1662
|
+
return this.field.options.labelKey || "value";
|
|
1663
|
+
}
|
|
1584
1664
|
return this.field.options.labelKey || "label";
|
|
1585
1665
|
},
|
|
1586
1666
|
loadRowGloatOptions: function (e) {
|
|
@@ -207,7 +207,10 @@
|
|
|
207
207
|
|
|
208
208
|
<script>
|
|
209
209
|
import i18n from "../../../../../components/xform/utils/i18n";
|
|
210
|
-
import {
|
|
210
|
+
import {
|
|
211
|
+
getSubFormNameByFieldId,
|
|
212
|
+
isVabsearchMultiWidget,
|
|
213
|
+
} from "../../../../../components/xform/utils/util";
|
|
211
214
|
|
|
212
215
|
export default {
|
|
213
216
|
name: "form-item-wrapper",
|
|
@@ -261,7 +264,7 @@ export default {
|
|
|
261
264
|
},
|
|
262
265
|
|
|
263
266
|
label() {
|
|
264
|
-
if (
|
|
267
|
+
if (this.shouldHideFieldLabel()) {
|
|
265
268
|
return "";
|
|
266
269
|
}
|
|
267
270
|
return this.getI18nLabel(this.field.options.label);
|
|
@@ -270,7 +273,7 @@ export default {
|
|
|
270
273
|
},
|
|
271
274
|
|
|
272
275
|
labelWidth() {
|
|
273
|
-
if (
|
|
276
|
+
if (this.shouldHideFieldLabel()) {
|
|
274
277
|
return (!!this.designState ? 5 : 0) + "px"; //设计期间标签最小宽度5像素,以便于鼠标点击可选中组件!!
|
|
275
278
|
}
|
|
276
279
|
|
|
@@ -322,6 +325,13 @@ export default {
|
|
|
322
325
|
this.initShowType();
|
|
323
326
|
},
|
|
324
327
|
methods: {
|
|
328
|
+
shouldHideFieldLabel() {
|
|
329
|
+
if (!!this.field.options.labelHidden) {
|
|
330
|
+
return true;
|
|
331
|
+
}
|
|
332
|
+
// 数据表格列内字段:表头已展示列名,隐藏 form-item 标签
|
|
333
|
+
return this.isSubFormItem();
|
|
334
|
+
},
|
|
325
335
|
isSubFormItem() {
|
|
326
336
|
return !!this.tableParam;
|
|
327
337
|
},
|
|
@@ -380,19 +390,11 @@ export default {
|
|
|
380
390
|
});
|
|
381
391
|
}
|
|
382
392
|
},
|
|
383
|
-
getIsFormItemUnabled() {
|
|
384
|
-
return (
|
|
385
|
-
this.field.type == "vabUpload" || this.field.type == "baseAttachment"
|
|
386
|
-
);
|
|
387
|
-
},
|
|
388
393
|
getRules() {
|
|
389
|
-
if (this.getIsFormItemUnabled()) {
|
|
390
|
-
return null;
|
|
391
|
-
}
|
|
392
394
|
return this.rules;
|
|
393
395
|
},
|
|
394
396
|
getPropName() {
|
|
395
|
-
if (this.formItemProp === "false"
|
|
397
|
+
if (this.formItemProp === "false") {
|
|
396
398
|
return null;
|
|
397
399
|
}
|
|
398
400
|
// if (this.formItemProp) {
|
|
@@ -439,7 +441,10 @@ export default {
|
|
|
439
441
|
let tableWidget = tableRef.widget;
|
|
440
442
|
let fieldKeyName = this.getFieldKeyName(tableWidget);
|
|
441
443
|
let property = this.getFieldKeyName(rowWidget);
|
|
442
|
-
if (
|
|
444
|
+
if (
|
|
445
|
+
this.isVabsearchFlagWidget(rowWidget) &&
|
|
446
|
+
!isVabsearchMultiWidget(rowWidget)
|
|
447
|
+
) {
|
|
443
448
|
property = rowWidget.options.vabSearchName || property;
|
|
444
449
|
}
|
|
445
450
|
let rowIndex = Math.max(obj.rowIndex, 0);
|
|
@@ -85,16 +85,19 @@ export default {
|
|
|
85
85
|
computed: {
|
|
86
86
|
numberValue: {
|
|
87
87
|
get() {
|
|
88
|
-
|
|
89
|
-
|
|
88
|
+
const fieldModel = this.fieldModel;
|
|
89
|
+
if (fieldModel === null || fieldModel === undefined) {
|
|
90
|
+
return undefined;
|
|
91
|
+
}
|
|
92
|
+
return fieldModel;
|
|
90
93
|
},
|
|
91
94
|
set(val) {
|
|
92
|
-
|
|
93
|
-
this.fieldModel = newValue
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
95
|
+
const newValue = val === undefined || val === null ? undefined : val;
|
|
96
|
+
this.fieldModel = newValue;
|
|
97
|
+
const currentData =
|
|
98
|
+
this.tableParam && this.tableParam.row
|
|
99
|
+
? this.tableParam.row
|
|
100
|
+
: this.formModel;
|
|
98
101
|
currentData[this.fieldKeyName] = newValue;
|
|
99
102
|
},
|
|
100
103
|
},
|