cloud-web-corejs 1.0.54-dev.745 → 1.0.54-dev.746
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 +192 -192
- package/src/App.vue +73 -71
- package/src/components/baseArea/index.vue +1628 -1628
- package/src/components/fileLibrary/categoryMoveDialog.vue +109 -109
- package/src/components/fileLibrary/fileObjAuthDialog.vue +297 -297
- package/src/components/fileLibrary/index.vue +1109 -1109
- package/src/components/fileLibrary/propertiesDialog.vue +190 -190
- package/src/components/fileLibrary/recycleBinDialog.vue +237 -237
- package/src/components/wf/mixins/setCandidateDialog.js +217 -217
- package/src/components/wf/mixins/setCandidateDialog2.js +252 -252
- package/src/components/xform/docs//345/257/271/346/257/224/345/212/237/350/203/275/350/220/275/345/234/260/346/226/271/346/241/210.md +986 -986
- package/src/components/xform/form-designer/form-widget/field-widget/area-select-widget.vue +272 -272
- package/src/components/xform/form-designer/form-widget/field-widget/baseAttachment-widget.vue +216 -216
- package/src/components/xform/form-designer/form-widget/field-widget/form-item-wrapper.vue +928 -928
- package/src/components/xform/form-designer/index.vue +195 -195
- package/src/components/xform/form-designer/indexMixin.js +848 -848
- package/src/components/xform/form-designer/setting-panel/index.vue +313 -313
- package/src/components/xform/form-designer/setting-panel/property-editor/container-data-table/columnRenderDialog.vue +124 -124
- package/src/components/xform/form-designer/setting-panel/propertyRegister.js +369 -369
- package/src/components/xform/form-designer/widget-panel/index.vue +389 -389
- package/src/components/xform/form-designer/widget-panel/indexMixin.js +343 -343
- package/src/components/xform/form-designer/widget-panel/widgetsConfig.js +4531 -4531
- package/src/components/xform/form-render/container-item/data-table-mixin.js +4748 -4576
- package/src/components/xform/form-render/container-item/tab-item.vue +125 -125
- package/src/components/xform/form-render/indexMixin.js +5061 -5078
- package/src/components/xform/lang/en-US.js +457 -457
- package/src/components/xform/lang/zh-CN.js +628 -628
- package/src/components/xform/utils/util.js +1585 -1554
- package/src/index.js +344 -230
- package/src/layout/components/AppMain.vue +122 -125
- package/src/layout/components/extractedCode/viewDialog.vue +207 -207
- package/src/layout/components/langTool.vue +128 -123
- package/src/layout/defaultLayout.vue +164 -158
- package/src/permission.js +185 -135
- package/src/store/config/index.js +667 -669
- package/src/store/modules/micro.js +46 -0
- package/src/store/modules/permission.js +461 -373
- package/src/store/modules/user.js +419 -415
- package/src/utils/auth.js +27 -1
- package/src/utils/index.js +579 -6
- package/src/utils/keepAlive.js +4 -0
- package/src/utils/menuAdapter.js +183 -0
- package/src/utils/request.js +417 -28
- package/src/views/bd/setting/formVersion/ftHistoryDialog.vue +483 -483
- package/src/views/bd/setting/form_script/form_list.vue +174 -174
- package/src/views/bd/setting/form_script/mixins/form_list.js +330 -330
- package/src/views/bd/setting/form_template/formDesignerDialog.vue +171 -171
- package/src/views/bd/setting/form_template/wfObjConfigDialog.vue +253 -253
- package/src/views/user/menuFallback/index.vue +123 -0
- package/src/views/user/wf/wfReport/index.vue +625 -625
|
@@ -1,272 +1,272 @@
|
|
|
1
|
-
<template>
|
|
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-input
|
|
15
|
-
v-if="designState"
|
|
16
|
-
class="full-width-input design-area-preview"
|
|
17
|
-
:style="widgetStyle"
|
|
18
|
-
readonly
|
|
19
|
-
disabled
|
|
20
|
-
:size="field.options.size || 'small'"
|
|
21
|
-
:placeholder="getI18nLabel(field.options.placeholder || '请选择地区')"
|
|
22
|
-
/>
|
|
23
|
-
<baseArea
|
|
24
|
-
v-else
|
|
25
|
-
ref="baseAreaRef"
|
|
26
|
-
v-show="!isReadMode"
|
|
27
|
-
class="full-width-input"
|
|
28
|
-
:style="widgetStyle"
|
|
29
|
-
:value="fieldModel"
|
|
30
|
-
:label-value="areaNameLabel"
|
|
31
|
-
@update:labelValue="handleAreaLabelUpdate"
|
|
32
|
-
:max-level="maxLevel"
|
|
33
|
-
:min-level="minLevel"
|
|
34
|
-
:locale="field.options.locale"
|
|
35
|
-
:disabled="field.options.disabled"
|
|
36
|
-
:readonly="field.options.readonly"
|
|
37
|
-
:clearable="field.options.clearable"
|
|
38
|
-
:placeholder="getI18nLabel(field.options.placeholder || '请选择地区')"
|
|
39
|
-
:size="field.options.size || 'small'"
|
|
40
|
-
@input="handleAreaInput"
|
|
41
|
-
@change="handleAreaChange"
|
|
42
|
-
@popover-open="handleAreaPopoverOpen"
|
|
43
|
-
/>
|
|
44
|
-
<template v-if="isReadMode">
|
|
45
|
-
<span class="readonly-mode-field">{{ readModeText }}</span>
|
|
46
|
-
</template>
|
|
47
|
-
</form-item-wrapper>
|
|
48
|
-
</template>
|
|
49
|
-
|
|
50
|
-
<script>
|
|
51
|
-
import FormItemWrapper from "./form-item-wrapper";
|
|
52
|
-
import emitter from "../../../../../components/xform/utils/emitter";
|
|
53
|
-
import i18n from "../../../../../components/xform/utils/i18n";
|
|
54
|
-
import fieldMixin from "../../../../../components/xform/form-designer/form-widget/field-widget/fieldMixin";
|
|
55
|
-
import baseArea from "@base/components/baseArea/index.vue";
|
|
56
|
-
import { deepClone } from "../../../../../components/xform/utils/util";
|
|
57
|
-
|
|
58
|
-
export default {
|
|
59
|
-
name: "area-select-widget",
|
|
60
|
-
componentName: "FieldWidget",
|
|
61
|
-
mixins: [emitter, fieldMixin, i18n],
|
|
62
|
-
components: {
|
|
63
|
-
FormItemWrapper,
|
|
64
|
-
baseArea,
|
|
65
|
-
},
|
|
66
|
-
props: {
|
|
67
|
-
field: Object,
|
|
68
|
-
parentWidget: Object,
|
|
69
|
-
parentList: Array,
|
|
70
|
-
indexOfParentList: Number,
|
|
71
|
-
designer: Object,
|
|
72
|
-
designState: {
|
|
73
|
-
type: Boolean,
|
|
74
|
-
default: false,
|
|
75
|
-
},
|
|
76
|
-
subFormRowIndex: {
|
|
77
|
-
type: Number,
|
|
78
|
-
default: -1,
|
|
79
|
-
},
|
|
80
|
-
subFormColIndex: {
|
|
81
|
-
type: Number,
|
|
82
|
-
default: -1,
|
|
83
|
-
},
|
|
84
|
-
subFormRowId: {
|
|
85
|
-
type: String,
|
|
86
|
-
default: "",
|
|
87
|
-
},
|
|
88
|
-
},
|
|
89
|
-
inject: ["refList", "globalOptionData", "globalModel"],
|
|
90
|
-
data() {
|
|
91
|
-
return {
|
|
92
|
-
oldFieldValue: null,
|
|
93
|
-
fieldModel: null,
|
|
94
|
-
areaLabel: null,
|
|
95
|
-
rules: [],
|
|
96
|
-
};
|
|
97
|
-
},
|
|
98
|
-
computed: {
|
|
99
|
-
currentData() {
|
|
100
|
-
let tableParam = this.tableParam;
|
|
101
|
-
return tableParam && tableParam.row ? tableParam.row : this.formModel;
|
|
102
|
-
},
|
|
103
|
-
areaNameField() {
|
|
104
|
-
return this.field.options.areaName || null;
|
|
105
|
-
},
|
|
106
|
-
maxLevel() {
|
|
107
|
-
const areaDataType = this.field.options.areaDataType;
|
|
108
|
-
const type =
|
|
109
|
-
areaDataType == null || areaDataType === "" ? 3 : areaDataType * 1;
|
|
110
|
-
if (type >= 0 && type <= 3) {
|
|
111
|
-
return type + 1;
|
|
112
|
-
}
|
|
113
|
-
return 4;
|
|
114
|
-
},
|
|
115
|
-
minLevel() {
|
|
116
|
-
const areaMinLevel = this.field.options.areaMinLevel;
|
|
117
|
-
if (areaMinLevel == null || areaMinLevel === "") {
|
|
118
|
-
return 1;
|
|
119
|
-
}
|
|
120
|
-
const type = areaMinLevel * 1;
|
|
121
|
-
if (type >= 0 && type <= 3) {
|
|
122
|
-
return type + 1;
|
|
123
|
-
}
|
|
124
|
-
return 1;
|
|
125
|
-
},
|
|
126
|
-
readModeText() {
|
|
127
|
-
return this.areaNameLabel || "--";
|
|
128
|
-
},
|
|
129
|
-
widgetStyle() {
|
|
130
|
-
const widgetWidth = this.field.options.widgetWidth;
|
|
131
|
-
if (widgetWidth != null && widgetWidth !== "") {
|
|
132
|
-
return { width: widgetWidth };
|
|
133
|
-
}
|
|
134
|
-
return { width: "100%" };
|
|
135
|
-
},
|
|
136
|
-
currentAreaNameValue() {
|
|
137
|
-
if (!this.areaNameField) {
|
|
138
|
-
return null;
|
|
139
|
-
}
|
|
140
|
-
return this.currentData[this.areaNameField] ?? null;
|
|
141
|
-
},
|
|
142
|
-
areaNameLabel() {
|
|
143
|
-
const formLabel = this.currentAreaNameValue;
|
|
144
|
-
if (formLabel != null && formLabel !== "") {
|
|
145
|
-
return formLabel;
|
|
146
|
-
}
|
|
147
|
-
return this.areaLabel;
|
|
148
|
-
},
|
|
149
|
-
},
|
|
150
|
-
created() {
|
|
151
|
-
this.initFieldModel();
|
|
152
|
-
this.registerToRefList();
|
|
153
|
-
this.initEventHandler();
|
|
154
|
-
this.buildFieldRules();
|
|
155
|
-
this.handleOnCreated();
|
|
156
|
-
},
|
|
157
|
-
mounted() {
|
|
158
|
-
this.handleOnMounted();
|
|
159
|
-
},
|
|
160
|
-
beforeDestroy() {
|
|
161
|
-
this.unregisterFromRefList();
|
|
162
|
-
},
|
|
163
|
-
methods: {
|
|
164
|
-
handleAreaLabelUpdate(label) {
|
|
165
|
-
if (this.designState) {
|
|
166
|
-
return;
|
|
167
|
-
}
|
|
168
|
-
this.areaLabel = label;
|
|
169
|
-
this.syncAreaName(label);
|
|
170
|
-
},
|
|
171
|
-
syncAreaName(label) {
|
|
172
|
-
if (this.areaNameField) {
|
|
173
|
-
this.$set(this.currentData, this.areaNameField, label);
|
|
174
|
-
}
|
|
175
|
-
},
|
|
176
|
-
syncAreaLabelFromForm() {
|
|
177
|
-
if (this.areaNameField) {
|
|
178
|
-
this.areaLabel = this.currentData[this.areaNameField] ?? null;
|
|
179
|
-
}
|
|
180
|
-
},
|
|
181
|
-
commitAreaValue(value, label) {
|
|
182
|
-
this.fieldModel = value;
|
|
183
|
-
this.$set(this.currentData, this.fieldKeyName, value);
|
|
184
|
-
this.syncUpdateFormModel(value);
|
|
185
|
-
if (label !== undefined) {
|
|
186
|
-
this.areaLabel = label;
|
|
187
|
-
this.syncAreaName(label);
|
|
188
|
-
}
|
|
189
|
-
},
|
|
190
|
-
handleAreaInput(val) {
|
|
191
|
-
if (this.designState) {
|
|
192
|
-
return;
|
|
193
|
-
}
|
|
194
|
-
this.commitAreaValue(val);
|
|
195
|
-
},
|
|
196
|
-
handleAreaPopoverOpen() {
|
|
197
|
-
if (this.designState) {
|
|
198
|
-
return;
|
|
199
|
-
}
|
|
200
|
-
this.oldFieldValue = deepClone(this.fieldModel);
|
|
201
|
-
},
|
|
202
|
-
handleAreaChange(payload) {
|
|
203
|
-
if (this.designState) {
|
|
204
|
-
return;
|
|
205
|
-
}
|
|
206
|
-
const value =
|
|
207
|
-
payload && Object.prototype.hasOwnProperty.call(payload, "value")
|
|
208
|
-
? payload.value
|
|
209
|
-
: this.fieldModel;
|
|
210
|
-
this.handleChangeEvent(value);
|
|
211
|
-
},
|
|
212
|
-
createEmptyAreaPathResult(value) {
|
|
213
|
-
return {
|
|
214
|
-
value: value != null && value !== "" ? value : null,
|
|
215
|
-
label: null,
|
|
216
|
-
path: [],
|
|
217
|
-
province: null,
|
|
218
|
-
city: null,
|
|
219
|
-
district: null,
|
|
220
|
-
town: null,
|
|
221
|
-
};
|
|
222
|
-
},
|
|
223
|
-
async getAreaPath(value) {
|
|
224
|
-
if (this.designState) {
|
|
225
|
-
return this.createEmptyAreaPathResult(value);
|
|
226
|
-
}
|
|
227
|
-
const areaRef = this.$refs.baseAreaRef;
|
|
228
|
-
if (areaRef && areaRef.getAreaPath) {
|
|
229
|
-
const targetValue =
|
|
230
|
-
value !== undefined && value !== null ? value : this.getValue();
|
|
231
|
-
return areaRef.getAreaPath(targetValue);
|
|
232
|
-
}
|
|
233
|
-
return this.createEmptyAreaPathResult(value);
|
|
234
|
-
},
|
|
235
|
-
getValue() {
|
|
236
|
-
const fieldKey = this.fieldKeyName;
|
|
237
|
-
if (this.fieldModel != null && this.fieldModel !== "") {
|
|
238
|
-
return this.fieldModel;
|
|
239
|
-
}
|
|
240
|
-
const formVal = this.currentData[fieldKey];
|
|
241
|
-
if (formVal != null && formVal !== "") {
|
|
242
|
-
return formVal;
|
|
243
|
-
}
|
|
244
|
-
return this.fieldModel;
|
|
245
|
-
},
|
|
246
|
-
setValue(val) {
|
|
247
|
-
if (!this.field.formItemFlag) {
|
|
248
|
-
return;
|
|
249
|
-
}
|
|
250
|
-
const oldVal = deepClone(this.fieldModel);
|
|
251
|
-
const value = val ?? null;
|
|
252
|
-
this.commitAreaValue(value);
|
|
253
|
-
this.syncAreaLabelFromForm();
|
|
254
|
-
this.emitFieldDataChange(value, oldVal);
|
|
255
|
-
},
|
|
256
|
-
fieldModelLabel() {
|
|
257
|
-
return this.areaNameLabel || this.getValue() || "";
|
|
258
|
-
},
|
|
259
|
-
},
|
|
260
|
-
};
|
|
261
|
-
|
|
262
|
-
</script>
|
|
263
|
-
|
|
264
|
-
<style lang="scss" scoped>
|
|
265
|
-
@import "~@/styles/global.scss";
|
|
266
|
-
|
|
267
|
-
.full-width-input {
|
|
268
|
-
width: 100% !important;
|
|
269
|
-
display: block !important;
|
|
270
|
-
box-sizing: border-box;
|
|
271
|
-
}
|
|
272
|
-
</style>
|
|
1
|
+
<template>
|
|
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-input
|
|
15
|
+
v-if="designState"
|
|
16
|
+
class="full-width-input design-area-preview"
|
|
17
|
+
:style="widgetStyle"
|
|
18
|
+
readonly
|
|
19
|
+
disabled
|
|
20
|
+
:size="field.options.size || 'small'"
|
|
21
|
+
:placeholder="getI18nLabel(field.options.placeholder || '请选择地区')"
|
|
22
|
+
/>
|
|
23
|
+
<baseArea
|
|
24
|
+
v-else
|
|
25
|
+
ref="baseAreaRef"
|
|
26
|
+
v-show="!isReadMode"
|
|
27
|
+
class="full-width-input"
|
|
28
|
+
:style="widgetStyle"
|
|
29
|
+
:value="fieldModel"
|
|
30
|
+
:label-value="areaNameLabel"
|
|
31
|
+
@update:labelValue="handleAreaLabelUpdate"
|
|
32
|
+
:max-level="maxLevel"
|
|
33
|
+
:min-level="minLevel"
|
|
34
|
+
:locale="field.options.locale"
|
|
35
|
+
:disabled="field.options.disabled"
|
|
36
|
+
:readonly="field.options.readonly"
|
|
37
|
+
:clearable="field.options.clearable"
|
|
38
|
+
:placeholder="getI18nLabel(field.options.placeholder || '请选择地区')"
|
|
39
|
+
:size="field.options.size || 'small'"
|
|
40
|
+
@input="handleAreaInput"
|
|
41
|
+
@change="handleAreaChange"
|
|
42
|
+
@popover-open="handleAreaPopoverOpen"
|
|
43
|
+
/>
|
|
44
|
+
<template v-if="isReadMode">
|
|
45
|
+
<span class="readonly-mode-field">{{ readModeText }}</span>
|
|
46
|
+
</template>
|
|
47
|
+
</form-item-wrapper>
|
|
48
|
+
</template>
|
|
49
|
+
|
|
50
|
+
<script>
|
|
51
|
+
import FormItemWrapper from "./form-item-wrapper";
|
|
52
|
+
import emitter from "../../../../../components/xform/utils/emitter";
|
|
53
|
+
import i18n from "../../../../../components/xform/utils/i18n";
|
|
54
|
+
import fieldMixin from "../../../../../components/xform/form-designer/form-widget/field-widget/fieldMixin";
|
|
55
|
+
import baseArea from "@base/components/baseArea/index.vue";
|
|
56
|
+
import { deepClone } from "../../../../../components/xform/utils/util";
|
|
57
|
+
|
|
58
|
+
export default {
|
|
59
|
+
name: "area-select-widget",
|
|
60
|
+
componentName: "FieldWidget",
|
|
61
|
+
mixins: [emitter, fieldMixin, i18n],
|
|
62
|
+
components: {
|
|
63
|
+
FormItemWrapper,
|
|
64
|
+
baseArea,
|
|
65
|
+
},
|
|
66
|
+
props: {
|
|
67
|
+
field: Object,
|
|
68
|
+
parentWidget: Object,
|
|
69
|
+
parentList: Array,
|
|
70
|
+
indexOfParentList: Number,
|
|
71
|
+
designer: Object,
|
|
72
|
+
designState: {
|
|
73
|
+
type: Boolean,
|
|
74
|
+
default: false,
|
|
75
|
+
},
|
|
76
|
+
subFormRowIndex: {
|
|
77
|
+
type: Number,
|
|
78
|
+
default: -1,
|
|
79
|
+
},
|
|
80
|
+
subFormColIndex: {
|
|
81
|
+
type: Number,
|
|
82
|
+
default: -1,
|
|
83
|
+
},
|
|
84
|
+
subFormRowId: {
|
|
85
|
+
type: String,
|
|
86
|
+
default: "",
|
|
87
|
+
},
|
|
88
|
+
},
|
|
89
|
+
inject: ["refList", "globalOptionData", "globalModel"],
|
|
90
|
+
data() {
|
|
91
|
+
return {
|
|
92
|
+
oldFieldValue: null,
|
|
93
|
+
fieldModel: null,
|
|
94
|
+
areaLabel: null,
|
|
95
|
+
rules: [],
|
|
96
|
+
};
|
|
97
|
+
},
|
|
98
|
+
computed: {
|
|
99
|
+
currentData() {
|
|
100
|
+
let tableParam = this.tableParam;
|
|
101
|
+
return tableParam && tableParam.row ? tableParam.row : this.formModel;
|
|
102
|
+
},
|
|
103
|
+
areaNameField() {
|
|
104
|
+
return this.field.options.areaName || null;
|
|
105
|
+
},
|
|
106
|
+
maxLevel() {
|
|
107
|
+
const areaDataType = this.field.options.areaDataType;
|
|
108
|
+
const type =
|
|
109
|
+
areaDataType == null || areaDataType === "" ? 3 : areaDataType * 1;
|
|
110
|
+
if (type >= 0 && type <= 3) {
|
|
111
|
+
return type + 1;
|
|
112
|
+
}
|
|
113
|
+
return 4;
|
|
114
|
+
},
|
|
115
|
+
minLevel() {
|
|
116
|
+
const areaMinLevel = this.field.options.areaMinLevel;
|
|
117
|
+
if (areaMinLevel == null || areaMinLevel === "") {
|
|
118
|
+
return 1;
|
|
119
|
+
}
|
|
120
|
+
const type = areaMinLevel * 1;
|
|
121
|
+
if (type >= 0 && type <= 3) {
|
|
122
|
+
return type + 1;
|
|
123
|
+
}
|
|
124
|
+
return 1;
|
|
125
|
+
},
|
|
126
|
+
readModeText() {
|
|
127
|
+
return this.areaNameLabel || "--";
|
|
128
|
+
},
|
|
129
|
+
widgetStyle() {
|
|
130
|
+
const widgetWidth = this.field.options.widgetWidth;
|
|
131
|
+
if (widgetWidth != null && widgetWidth !== "") {
|
|
132
|
+
return { width: widgetWidth };
|
|
133
|
+
}
|
|
134
|
+
return { width: "100%" };
|
|
135
|
+
},
|
|
136
|
+
currentAreaNameValue() {
|
|
137
|
+
if (!this.areaNameField) {
|
|
138
|
+
return null;
|
|
139
|
+
}
|
|
140
|
+
return this.currentData[this.areaNameField] ?? null;
|
|
141
|
+
},
|
|
142
|
+
areaNameLabel() {
|
|
143
|
+
const formLabel = this.currentAreaNameValue;
|
|
144
|
+
if (formLabel != null && formLabel !== "") {
|
|
145
|
+
return formLabel;
|
|
146
|
+
}
|
|
147
|
+
return this.areaLabel;
|
|
148
|
+
},
|
|
149
|
+
},
|
|
150
|
+
created() {
|
|
151
|
+
this.initFieldModel();
|
|
152
|
+
this.registerToRefList();
|
|
153
|
+
this.initEventHandler();
|
|
154
|
+
this.buildFieldRules();
|
|
155
|
+
this.handleOnCreated();
|
|
156
|
+
},
|
|
157
|
+
mounted() {
|
|
158
|
+
this.handleOnMounted();
|
|
159
|
+
},
|
|
160
|
+
beforeDestroy() {
|
|
161
|
+
this.unregisterFromRefList();
|
|
162
|
+
},
|
|
163
|
+
methods: {
|
|
164
|
+
handleAreaLabelUpdate(label) {
|
|
165
|
+
if (this.designState) {
|
|
166
|
+
return;
|
|
167
|
+
}
|
|
168
|
+
this.areaLabel = label;
|
|
169
|
+
this.syncAreaName(label);
|
|
170
|
+
},
|
|
171
|
+
syncAreaName(label) {
|
|
172
|
+
if (this.areaNameField) {
|
|
173
|
+
this.$set(this.currentData, this.areaNameField, label);
|
|
174
|
+
}
|
|
175
|
+
},
|
|
176
|
+
syncAreaLabelFromForm() {
|
|
177
|
+
if (this.areaNameField) {
|
|
178
|
+
this.areaLabel = this.currentData[this.areaNameField] ?? null;
|
|
179
|
+
}
|
|
180
|
+
},
|
|
181
|
+
commitAreaValue(value, label) {
|
|
182
|
+
this.fieldModel = value;
|
|
183
|
+
this.$set(this.currentData, this.fieldKeyName, value);
|
|
184
|
+
this.syncUpdateFormModel(value);
|
|
185
|
+
if (label !== undefined) {
|
|
186
|
+
this.areaLabel = label;
|
|
187
|
+
this.syncAreaName(label);
|
|
188
|
+
}
|
|
189
|
+
},
|
|
190
|
+
handleAreaInput(val) {
|
|
191
|
+
if (this.designState) {
|
|
192
|
+
return;
|
|
193
|
+
}
|
|
194
|
+
this.commitAreaValue(val);
|
|
195
|
+
},
|
|
196
|
+
handleAreaPopoverOpen() {
|
|
197
|
+
if (this.designState) {
|
|
198
|
+
return;
|
|
199
|
+
}
|
|
200
|
+
this.oldFieldValue = deepClone(this.fieldModel);
|
|
201
|
+
},
|
|
202
|
+
handleAreaChange(payload) {
|
|
203
|
+
if (this.designState) {
|
|
204
|
+
return;
|
|
205
|
+
}
|
|
206
|
+
const value =
|
|
207
|
+
payload && Object.prototype.hasOwnProperty.call(payload, "value")
|
|
208
|
+
? payload.value
|
|
209
|
+
: this.fieldModel;
|
|
210
|
+
this.handleChangeEvent(value);
|
|
211
|
+
},
|
|
212
|
+
createEmptyAreaPathResult(value) {
|
|
213
|
+
return {
|
|
214
|
+
value: value != null && value !== "" ? value : null,
|
|
215
|
+
label: null,
|
|
216
|
+
path: [],
|
|
217
|
+
province: null,
|
|
218
|
+
city: null,
|
|
219
|
+
district: null,
|
|
220
|
+
town: null,
|
|
221
|
+
};
|
|
222
|
+
},
|
|
223
|
+
async getAreaPath(value) {
|
|
224
|
+
if (this.designState) {
|
|
225
|
+
return this.createEmptyAreaPathResult(value);
|
|
226
|
+
}
|
|
227
|
+
const areaRef = this.$refs.baseAreaRef;
|
|
228
|
+
if (areaRef && areaRef.getAreaPath) {
|
|
229
|
+
const targetValue =
|
|
230
|
+
value !== undefined && value !== null ? value : this.getValue();
|
|
231
|
+
return areaRef.getAreaPath(targetValue);
|
|
232
|
+
}
|
|
233
|
+
return this.createEmptyAreaPathResult(value);
|
|
234
|
+
},
|
|
235
|
+
getValue() {
|
|
236
|
+
const fieldKey = this.fieldKeyName;
|
|
237
|
+
if (this.fieldModel != null && this.fieldModel !== "") {
|
|
238
|
+
return this.fieldModel;
|
|
239
|
+
}
|
|
240
|
+
const formVal = this.currentData[fieldKey];
|
|
241
|
+
if (formVal != null && formVal !== "") {
|
|
242
|
+
return formVal;
|
|
243
|
+
}
|
|
244
|
+
return this.fieldModel;
|
|
245
|
+
},
|
|
246
|
+
setValue(val) {
|
|
247
|
+
if (!this.field.formItemFlag) {
|
|
248
|
+
return;
|
|
249
|
+
}
|
|
250
|
+
const oldVal = deepClone(this.fieldModel);
|
|
251
|
+
const value = val ?? null;
|
|
252
|
+
this.commitAreaValue(value);
|
|
253
|
+
this.syncAreaLabelFromForm();
|
|
254
|
+
this.emitFieldDataChange(value, oldVal);
|
|
255
|
+
},
|
|
256
|
+
fieldModelLabel() {
|
|
257
|
+
return this.areaNameLabel || this.getValue() || "";
|
|
258
|
+
},
|
|
259
|
+
},
|
|
260
|
+
};
|
|
261
|
+
|
|
262
|
+
</script>
|
|
263
|
+
|
|
264
|
+
<style lang="scss" scoped>
|
|
265
|
+
@import "~@/styles/global.scss";
|
|
266
|
+
|
|
267
|
+
.full-width-input {
|
|
268
|
+
width: 100% !important;
|
|
269
|
+
display: block !important;
|
|
270
|
+
box-sizing: border-box;
|
|
271
|
+
}
|
|
272
|
+
</style>
|