cloud-web-corejs 1.0.128 → 1.0.130
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/VabUpload/view.vue +138 -55
- package/src/components/baseInputExport/mixins.js +1 -1
- package/src/components/errorMsg/mixins.js +1 -2
- package/src/components/excelImport/mixins.js +2 -1
- package/src/components/jsonImport/mixins.js +2 -1
- package/src/components/langImport/mixins.js +17 -16
- package/src/components/wf/content.vue +772 -411
- package/src/components/wf/mixins/wfFlowEleScriptDialog.js +3 -0
- package/src/components/wf/wf.js +1 -1
- package/src/components/wf/wfFlowEleScriptDialog.vue +89 -0
- package/src/components/xform/form-designer/designer.js +3 -2
- package/src/components/xform/form-designer/form-widget/container-widget/containerMixin.js +3 -3
- package/src/components/xform/form-designer/form-widget/container-widget/data-table-mixin.js +9 -9
- package/src/components/xform/form-designer/form-widget/container-widget/data-table-widget.vue +4 -1
- package/src/components/xform/form-designer/form-widget/dialog/importDialogMixin.js +2 -1
- package/src/components/xform/form-designer/form-widget/field-widget/fieldMixin.js +3 -1
- package/src/components/xform/form-designer/form-widget/field-widget/form-item-wrapper.vue +17 -4
- package/src/components/xform/form-designer/form-widget/field-widget/import-button-widget.vue +4 -0
- package/src/components/xform/form-designer/form-widget/field-widget/oplog-widget.vue +185 -0
- package/src/components/xform/form-designer/form-widget/field-widget/print-button-widget.vue +1 -1
- package/src/components/xform/form-designer/form-widget/field-widget/print-detail-button-widget.vue +108 -0
- package/src/components/xform/form-designer/form-widget/field-widget/singleUpload-widget.vue +145 -0
- package/src/components/xform/form-designer/form-widget/field-widget/status-widget.vue +13 -4
- package/src/components/xform/form-designer/form-widget/field-widget/vabUpload2-widget.vue +725 -0
- package/src/components/xform/form-designer/indexMixin.js +3 -2
- package/src/components/xform/form-designer/setting-panel/form-setting.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/option-items-setting.vue +376 -366
- package/src/components/xform/form-designer/setting-panel/property-editor/container-data-table/columnRenderDialog.vue +0 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/container-data-table/data-table-editor.vue +372 -253
- package/src/components/xform/form-designer/setting-panel/property-editor/container-data-table/table-column-dialog.vue +9 -43
- package/src/components/xform/form-designer/setting-panel/property-editor/field-import-button/import-button-editor.vue +7 -0
- package/src/components/xform/form-designer/setting-panel/property-editor/field-print-button/print-button-editor.vue +8 -0
- package/src/components/xform/form-designer/setting-panel/property-editor/field-print-button/print-detail-button-editor.vue +91 -0
- package/src/components/xform/form-designer/setting-panel/property-editor/field-status/field-status-editor.vue +37 -30
- package/src/components/xform/form-designer/setting-panel/property-editor/field-vabUpload2/field-vabUpload2-editor.vue +62 -0
- package/src/components/xform/form-designer/setting-panel/property-editor/formScriptEnabled-editor.vue +19 -14
- package/src/components/xform/form-designer/setting-panel/property-editor/oplog-editor.vue +31 -0
- package/src/components/xform/form-designer/setting-panel/propertyRegister.js +5 -1
- package/src/components/xform/form-designer/widget-panel/indexMixin.js +19 -19
- package/src/components/xform/form-designer/widget-panel/widgetsConfig.js +132 -0
- package/src/components/xform/form-render/container-item/containerItemMixin.js +12 -11
- package/src/components/xform/form-render/container-item/data-table-item.vue +13 -10
- package/src/components/xform/form-render/container-item/data-table-mixin.js +5 -4
- package/src/components/xform/form-render/indexMixin.js +3 -2
- package/src/components/xform/lang/zh-CN.js +3 -0
- package/src/components/xform/utils/util.js +1 -1451
- package/src/utils/request.js +1 -1
- package/src/utils/vab.js +1 -1
- package/src/views/user/notify_message/dialog.vue +24 -19
- package/src/views/user/outLink/form_view.vue +211 -211
- package/src/views/user/wf/wfReport/index.vue +448 -0
- package/src/views/user/wf/wf_manage/list.vue +344 -251
- package/src/views/user/wf/wf_transfer_setting/edit.vue +229 -0
- package/src/views/user/wf/wf_transfer_setting/list.vue +308 -0
@@ -1,366 +1,376 @@
|
|
1
|
-
<template>
|
2
|
-
<div class="option-items-pane">
|
3
|
-
<el-form-item label="选项值类型">
|
4
|
-
<el-radio-group v-model="optionModel.optionItemValueType" @change="changeValueType">
|
5
|
-
<el-radio :label="0">文本</el-radio>
|
6
|
-
<el-radio :label="1">数值</el-radio>
|
7
|
-
<el-radio :label="2">布尔值</el-radio>
|
8
|
-
</el-radio-group>
|
9
|
-
</el-form-item>
|
10
|
-
|
11
|
-
<el-form-item label="默认值">
|
12
|
-
<template v-if="selectedWidget.type === 'checkbox' || (selectedWidget.type === 'select' && selectedWidget.options.multiple)">
|
13
|
-
<a href="javascript:void(0);" class="a-link link-oneLind"
|
14
|
-
@click="openTableDataEdit()">
|
15
|
-
<span>{{ getDefaultValue() }}</span>
|
16
|
-
<i class="el-icon-edit"></i>
|
17
|
-
</a>
|
18
|
-
</template>
|
19
|
-
<template v-else>
|
20
|
-
<el-input v-model="optionModel.defaultValue" size="mini" style="width: 100px" v-if="!optionModel.optionItemValueType"></el-input>
|
21
|
-
<base-input-number v-model="optionModel.defaultValue" size="mini" style="width:
|
22
|
-
<el-select v-model="optionModel.defaultValue" style="width:
|
23
|
-
<el-option :value="true" label="true"></el-option>
|
24
|
-
<el-option :value="false" label="false"></el-option>
|
25
|
-
</el-select>
|
26
|
-
</template>
|
27
|
-
|
28
|
-
</el-form-item>
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
:
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
:
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
</
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
|
228
|
-
|
229
|
-
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
-
|
234
|
-
|
235
|
-
|
236
|
-
|
237
|
-
|
238
|
-
|
239
|
-
this.
|
240
|
-
|
241
|
-
|
242
|
-
|
243
|
-
|
244
|
-
|
245
|
-
|
246
|
-
|
247
|
-
|
248
|
-
|
249
|
-
|
250
|
-
|
251
|
-
|
252
|
-
|
253
|
-
|
254
|
-
|
255
|
-
|
256
|
-
|
257
|
-
|
258
|
-
|
259
|
-
|
260
|
-
|
261
|
-
|
262
|
-
|
263
|
-
|
264
|
-
|
265
|
-
|
266
|
-
|
267
|
-
|
268
|
-
|
269
|
-
|
270
|
-
|
271
|
-
|
272
|
-
|
273
|
-
|
274
|
-
|
275
|
-
|
276
|
-
} else {
|
277
|
-
this.optionModel.
|
278
|
-
}
|
279
|
-
|
280
|
-
this.
|
281
|
-
},
|
282
|
-
|
283
|
-
|
284
|
-
this.
|
285
|
-
|
286
|
-
|
287
|
-
|
288
|
-
|
289
|
-
|
290
|
-
|
291
|
-
|
292
|
-
|
293
|
-
|
294
|
-
|
295
|
-
|
296
|
-
|
297
|
-
|
298
|
-
|
299
|
-
|
300
|
-
|
301
|
-
|
302
|
-
|
303
|
-
|
304
|
-
|
305
|
-
|
306
|
-
|
307
|
-
|
308
|
-
|
309
|
-
|
310
|
-
|
311
|
-
|
312
|
-
|
313
|
-
|
314
|
-
|
315
|
-
|
316
|
-
|
317
|
-
|
318
|
-
|
319
|
-
|
320
|
-
|
321
|
-
|
322
|
-
|
323
|
-
|
324
|
-
|
325
|
-
|
326
|
-
|
327
|
-
|
328
|
-
|
329
|
-
|
330
|
-
|
331
|
-
|
332
|
-
|
333
|
-
|
334
|
-
|
335
|
-
|
336
|
-
|
337
|
-
}
|
338
|
-
|
339
|
-
|
340
|
-
|
341
|
-
|
342
|
-
|
343
|
-
|
344
|
-
|
345
|
-
|
346
|
-
|
347
|
-
|
348
|
-
|
349
|
-
|
350
|
-
|
351
|
-
|
352
|
-
|
353
|
-
|
354
|
-
|
355
|
-
.
|
356
|
-
|
357
|
-
|
358
|
-
|
359
|
-
|
360
|
-
|
361
|
-
|
362
|
-
|
363
|
-
|
364
|
-
|
365
|
-
|
366
|
-
|
1
|
+
<template>
|
2
|
+
<div class="option-items-pane">
|
3
|
+
<el-form-item label="选项值类型">
|
4
|
+
<el-radio-group v-model="optionModel.optionItemValueType" @change="changeValueType">
|
5
|
+
<el-radio :label="0">文本</el-radio>
|
6
|
+
<el-radio :label="1">数值</el-radio>
|
7
|
+
<el-radio :label="2">布尔值</el-radio>
|
8
|
+
</el-radio-group>
|
9
|
+
</el-form-item>
|
10
|
+
|
11
|
+
<el-form-item label="默认值">
|
12
|
+
<template v-if="selectedWidget.type === 'checkbox' || (selectedWidget.type === 'select' && selectedWidget.options.multiple)">
|
13
|
+
<a href="javascript:void(0);" class="a-link link-oneLind"
|
14
|
+
@click="openTableDataEdit()">
|
15
|
+
<span>{{ getDefaultValue() }}</span>
|
16
|
+
<i class="el-icon-edit"></i>
|
17
|
+
</a>
|
18
|
+
</template>
|
19
|
+
<template v-else>
|
20
|
+
<el-input v-model="optionModel.defaultValue" size="mini" style="width: 100px" v-if="!optionModel.optionItemValueType"></el-input>
|
21
|
+
<base-input-number v-model="optionModel.defaultValue" size="mini" style="width: 100%" v-if="optionModel.optionItemValueType==1" />
|
22
|
+
<el-select v-model="optionModel.defaultValue" style="width: 100%" v-if="optionModel.optionItemValueType===2" clearable @clear="optionModel.defaultValue=null">
|
23
|
+
<el-option :value="true" label="true"></el-option>
|
24
|
+
<el-option :value="false" label="false"></el-option>
|
25
|
+
</el-select>
|
26
|
+
</template>
|
27
|
+
|
28
|
+
</el-form-item>
|
29
|
+
<el-form-item :label="i18nt('显示字段')">
|
30
|
+
<el-input type="text" v-model="optionModel.labelKey" placeholder="默认label" :disabled="optionModel.commonAttributeEnabled || !optionModel.formScriptEnabled"></el-input>
|
31
|
+
</el-form-item>
|
32
|
+
<el-form-item :label="i18nt('关联字段')">
|
33
|
+
<el-input type="text" v-model="optionModel.valueKey" placeholder="默认value" :disabled="optionModel.commonAttributeEnabled || !optionModel.formScriptEnabled"></el-input>
|
34
|
+
</el-form-item>
|
35
|
+
<template v-if="!optionModel.commonAttributeEnabled && !optionModel.formScriptEnabled">
|
36
|
+
<el-radio-group
|
37
|
+
v-if="selectedWidget.type === 'radio' || (selectedWidget.type === 'select' && !selectedWidget.options.multiple)"
|
38
|
+
v-model="optionModel.defaultValue"
|
39
|
+
@change="emitDefaultValueChange"
|
40
|
+
>
|
41
|
+
<draggable tag="ul" class="draggable-box" :list="optionModel.optionItems" v-bind="{ group: 'optionsGroup', ghostClass: 'ghost', handle: '.drag-option' }">
|
42
|
+
<li v-for="(option, idx) in optionModel.optionItems" :key="idx">
|
43
|
+
<el-radio :label="option.value">
|
44
|
+
<el-input v-model="option.value" size="mini" style="width: 100px" v-if="!optionModel.optionItemValueType"></el-input>
|
45
|
+
<base-input-number v-model="option.value" size="mini" style="width: 100px" v-if="optionModel.optionItemValueType==1" />
|
46
|
+
<!-- <el-input v-model="option.value" size="mini" style="width: 100px" v-if="optionModel.optionItemValueType===2" disabled></el-input>-->
|
47
|
+
<el-select v-model="option.value" style="width: 100px" v-if="optionModel.optionItemValueType===2">
|
48
|
+
<el-option :value="true" label="true"></el-option>
|
49
|
+
<el-option :value="false" label="false"></el-option>
|
50
|
+
</el-select>
|
51
|
+
<el-input v-model="option.label" size="mini" style="width: 100px"></el-input>
|
52
|
+
<i class="el-icon-s-operation drag-option"></i>
|
53
|
+
<el-button circle plain size="mini" type="danger" @click="deleteOption(option, idx)" icon="el-icon-minus" class="col-delete-button"></el-button>
|
54
|
+
</el-radio>
|
55
|
+
</li>
|
56
|
+
</draggable>
|
57
|
+
</el-radio-group>
|
58
|
+
<el-checkbox-group
|
59
|
+
v-else-if="selectedWidget.type === 'checkbox' || (selectedWidget.type === 'select' && selectedWidget.options.multiple)"
|
60
|
+
v-model="optionModel.defaultValue"
|
61
|
+
@change="emitDefaultValueChange"
|
62
|
+
>
|
63
|
+
<draggable tag="ul" class="draggable-box" :list="optionModel.optionItems" v-bind="{ group: 'optionsGroup', ghostClass: 'ghost', handle: '.drag-option' }">
|
64
|
+
<li v-for="(option, idx) in optionModel.optionItems" :key="idx">
|
65
|
+
<el-checkbox :label="option.value">
|
66
|
+
<el-input v-model="option.value" size="mini" style="width: 100px" v-if="!optionModel.optionItemValueType"></el-input>
|
67
|
+
<base-input-number v-model="option.value" size="mini" style="width: 100px" v-if="optionModel.optionItemValueType==1" />
|
68
|
+
<el-input v-model="option.value" size="mini" style="width: 100px" v-if="optionModel.optionItemValueType===2" disabled></el-input>
|
69
|
+
<el-input v-model="option.label" size="mini" style="width: 100px"></el-input>
|
70
|
+
<i class="el-icon-s-operation drag-option"></i>
|
71
|
+
<el-button circle plain size="mini" type="danger" @click="deleteOption(option, idx)" icon="el-icon-minus" class="col-delete-button"></el-button>
|
72
|
+
</el-checkbox>
|
73
|
+
</li>
|
74
|
+
</draggable>
|
75
|
+
</el-checkbox-group>
|
76
|
+
<el-cascader
|
77
|
+
v-else-if="selectedWidget.type === 'cascader'"
|
78
|
+
v-model="optionModel.defaultValue"
|
79
|
+
:options="optionModel.optionItems"
|
80
|
+
@change="emitDefaultValueChange"
|
81
|
+
:placeholder="i18nt('render.hint.selectPlaceholder')"
|
82
|
+
style="width: 100%"
|
83
|
+
></el-cascader>
|
84
|
+
<div v-if="selectedWidget.type === 'cascader'">
|
85
|
+
<el-button type="text" @click="importCascaderOptions">{{ i18nt('designer.setting.importOptions') }}</el-button>
|
86
|
+
<el-button type="text" @click="resetDefault">{{ i18nt('designer.setting.resetDefault') }}</el-button>
|
87
|
+
</div>
|
88
|
+
|
89
|
+
<div v-if="selectedWidget.type === 'radio' || selectedWidget.type === 'checkbox' || selectedWidget.type === 'select'">
|
90
|
+
<el-button type="text" @click="addOption">{{ i18nt('designer.setting.addOption') }}</el-button>
|
91
|
+
<el-button type="text" @click="importOptions" v-if="optionModel.optionItemValueType!==2">{{ i18nt('designer.setting.importOptions') }}</el-button>
|
92
|
+
<el-button type="text" @click="resetDefault">{{ i18nt('designer.setting.resetDefault') }}</el-button>
|
93
|
+
</div>
|
94
|
+
</template>
|
95
|
+
|
96
|
+
|
97
|
+
<el-dialog
|
98
|
+
:title="i18nt('designer.setting.importOptions')"
|
99
|
+
:visible.sync="showImportDialogFlag"
|
100
|
+
v-if="showImportDialogFlag"
|
101
|
+
:show-close="true"
|
102
|
+
class="small-padding-dialog"
|
103
|
+
:close-on-click-modal="false"
|
104
|
+
:close-on-press-escape="false"
|
105
|
+
:destroy-on-close="true"
|
106
|
+
:append-to-body="true"
|
107
|
+
:modal-append-to-body="true"
|
108
|
+
>
|
109
|
+
<el-form-item><el-input type="textarea" rows="10" v-model="optionLines"></el-input></el-form-item>
|
110
|
+
<div slot="footer" class="dialog-footer">
|
111
|
+
<el-button size="large" type="primary" @click="saveOptions">{{ i18nt('designer.hint.confirm') }}</el-button>
|
112
|
+
<el-button size="large" type="" @click="showImportDialogFlag = false">{{ i18nt('designer.hint.cancel') }}</el-button>
|
113
|
+
</div>
|
114
|
+
</el-dialog>
|
115
|
+
|
116
|
+
<el-dialog
|
117
|
+
:title="i18nt('designer.setting.importOptions')"
|
118
|
+
:visible.sync="showImportCascaderDialogFlag"
|
119
|
+
v-if="showImportCascaderDialogFlag"
|
120
|
+
:show-close="true"
|
121
|
+
class="small-padding-dialog"
|
122
|
+
:close-on-click-modal="false"
|
123
|
+
:close-on-press-escape="false"
|
124
|
+
:destroy-on-close="true"
|
125
|
+
:append-to-body="true"
|
126
|
+
:modal-append-to-body="true"
|
127
|
+
>
|
128
|
+
<code-editor v-model="cascaderOptions" mode="json" :readonly="false"></code-editor>
|
129
|
+
<div slot="footer" class="dialog-footer">
|
130
|
+
<el-button size="large" type="primary" @click="saveCascaderOptions">{{ i18nt('designer.hint.confirm') }}</el-button>
|
131
|
+
<el-button size="large" type="" @click="showImportCascaderDialogFlag = false">{{ i18nt('designer.hint.cancel') }}</el-button>
|
132
|
+
</div>
|
133
|
+
</el-dialog>
|
134
|
+
<el-dialog
|
135
|
+
v-if="dataDialogVisible"
|
136
|
+
custom-class="dialog-style list-dialog"
|
137
|
+
:title="i18nt('默认值编辑')"
|
138
|
+
:visible.sync="dataDialogVisible"
|
139
|
+
:show-close="!0"
|
140
|
+
append-to-body=""
|
141
|
+
:close-on-click-modal="!1"
|
142
|
+
:close-on-press-escape="!1"
|
143
|
+
:destroy-on-close="!0"
|
144
|
+
width="75%"
|
145
|
+
v-dialog-drag
|
146
|
+
>
|
147
|
+
<template slot="footer">
|
148
|
+
<div class="dialog-footer">
|
149
|
+
<el-button type="" @click="dataDialogVisible = !1" class="button-sty" icon="el-icon-close">
|
150
|
+
{{ i18nt('designer.hint.cancel') }}
|
151
|
+
</el-button>
|
152
|
+
<el-button type="primary" @click="saveTableData" class="button-sty" icon="el-icon-check">
|
153
|
+
{{ i18nt('designer.hint.confirm') }}
|
154
|
+
</el-button>
|
155
|
+
</div>
|
156
|
+
</template>
|
157
|
+
<code-editor mode="json" :readonly="!1" v-model="tableDataOptions"></code-editor>
|
158
|
+
</el-dialog>
|
159
|
+
</div>
|
160
|
+
</template>
|
161
|
+
|
162
|
+
<script>
|
163
|
+
import Draggable from 'vuedraggable';
|
164
|
+
import i18n from '../../../../components/xform/utils/i18n';
|
165
|
+
|
166
|
+
export default {
|
167
|
+
name: 'OptionItemsSetting',
|
168
|
+
componentName: 'PropertyEditor',
|
169
|
+
mixins: [i18n],
|
170
|
+
components: {
|
171
|
+
Draggable,
|
172
|
+
},
|
173
|
+
props: {
|
174
|
+
designer: Object,
|
175
|
+
selectedWidget: Object
|
176
|
+
},
|
177
|
+
data() {
|
178
|
+
return {
|
179
|
+
showImportDialogFlag: false,
|
180
|
+
optionLines: '',
|
181
|
+
|
182
|
+
cascaderOptions: '',
|
183
|
+
showImportCascaderDialogFlag: false,
|
184
|
+
|
185
|
+
//separator: '||',
|
186
|
+
separator: ',',
|
187
|
+
dataDialogVisible:false,
|
188
|
+
tableDataOptions:[],
|
189
|
+
};
|
190
|
+
},
|
191
|
+
computed: {
|
192
|
+
optionModel() {
|
193
|
+
return this.selectedWidget.options;
|
194
|
+
}
|
195
|
+
},
|
196
|
+
watch: {
|
197
|
+
'selectedWidget.options': {
|
198
|
+
deep: true,
|
199
|
+
handler(val) {
|
200
|
+
//console.log('888888', 'Options change!')
|
201
|
+
}
|
202
|
+
}
|
203
|
+
},
|
204
|
+
created() {
|
205
|
+
if(!this.optionModel.hasOwnProperty('optionItemValueType')){
|
206
|
+
this.optionModel.optionItemValueType = 0;
|
207
|
+
}
|
208
|
+
},
|
209
|
+
methods: {
|
210
|
+
emitDefaultValueChange() {
|
211
|
+
if (!!this.designer && !!this.designer.formWidget) {
|
212
|
+
let fieldWidget = this.designer.formWidget.getWidgetRef(this.selectedWidget.options.name);
|
213
|
+
if (!!fieldWidget && !!fieldWidget.refreshDefaultValue) {
|
214
|
+
fieldWidget.refreshDefaultValue();
|
215
|
+
}
|
216
|
+
}
|
217
|
+
},
|
218
|
+
|
219
|
+
deleteOption(option, index) {
|
220
|
+
this.optionModel.optionItems.splice(index, 1);
|
221
|
+
},
|
222
|
+
|
223
|
+
addOption() {
|
224
|
+
let optionItemValueType = this.optionModel.optionItemValueType;
|
225
|
+
let newValue = this.optionModel.optionItems.length + 1;
|
226
|
+
if(!optionItemValueType){
|
227
|
+
newValue = newValue+'';
|
228
|
+
}else if(optionItemValueType==2){
|
229
|
+
newValue = true;
|
230
|
+
}
|
231
|
+
this.optionModel.optionItems.push({
|
232
|
+
value: newValue,
|
233
|
+
label: 'new option'
|
234
|
+
});
|
235
|
+
},
|
236
|
+
|
237
|
+
importOptions() {
|
238
|
+
this.optionLines = '';
|
239
|
+
if (this.optionModel.optionItems.length > 0) {
|
240
|
+
this.optionModel.optionItems.forEach(opt => {
|
241
|
+
if (opt.value === opt.label) {
|
242
|
+
this.optionLines += opt.value + '\n';
|
243
|
+
} else {
|
244
|
+
this.optionLines += opt.value + this.separator + opt.label + '\n';
|
245
|
+
}
|
246
|
+
});
|
247
|
+
}
|
248
|
+
|
249
|
+
this.showImportDialogFlag = true;
|
250
|
+
},
|
251
|
+
|
252
|
+
saveOptions() {
|
253
|
+
let lineArray = this.optionLines.split('\n');
|
254
|
+
//console.log('test', lineArray)
|
255
|
+
if (lineArray.length > 0) {
|
256
|
+
let isNumericOptionItemValue = this.optionModel.optionItemValueType === 1;
|
257
|
+
this.optionModel.optionItems = [];
|
258
|
+
lineArray.forEach(optLine => {
|
259
|
+
if (!!optLine && !!optLine.trim()) {
|
260
|
+
if (optLine.indexOf(this.separator) !== -1) {
|
261
|
+
let valueStr = optLine.split(this.separator)[0];
|
262
|
+
let value = isNumericOptionItemValue?Number(valueStr):valueStr;
|
263
|
+
this.optionModel.optionItems.push({
|
264
|
+
value: value,
|
265
|
+
label: optLine.split(this.separator)[1]
|
266
|
+
});
|
267
|
+
} else {
|
268
|
+
let value = isNumericOptionItemValue?Number(optLine):optLine;
|
269
|
+
this.optionModel.optionItems.push({
|
270
|
+
value: value,
|
271
|
+
label: optLine
|
272
|
+
});
|
273
|
+
}
|
274
|
+
}
|
275
|
+
});
|
276
|
+
} else {
|
277
|
+
this.optionModel.optionItems = [];
|
278
|
+
}
|
279
|
+
|
280
|
+
this.showImportDialogFlag = false;
|
281
|
+
},
|
282
|
+
|
283
|
+
resetDefault() {
|
284
|
+
if (this.selectedWidget.type === 'checkbox' || (this.selectedWidget.type === 'select' && this.selectedWidget.options.multiple)) {
|
285
|
+
this.optionModel.defaultValue = [];
|
286
|
+
} else {
|
287
|
+
this.optionModel.defaultValue = undefined;
|
288
|
+
}
|
289
|
+
|
290
|
+
this.emitDefaultValueChange();
|
291
|
+
},
|
292
|
+
|
293
|
+
importCascaderOptions() {
|
294
|
+
this.cascaderOptions = JSON.stringify(this.optionModel.optionItems, null, ' ');
|
295
|
+
this.showImportCascaderDialogFlag = true;
|
296
|
+
},
|
297
|
+
|
298
|
+
saveCascaderOptions() {
|
299
|
+
try {
|
300
|
+
let newOptions = JSON.parse(this.cascaderOptions);
|
301
|
+
this.optionModel.optionItems = newOptions;
|
302
|
+
//TODO: 是否需要重置选项默认值??
|
303
|
+
|
304
|
+
this.showImportCascaderDialogFlag = false;
|
305
|
+
} catch (ex) {
|
306
|
+
this.$message.error(this.i18nt('designer.hint.invalidOptionsData') + ex.message);
|
307
|
+
}
|
308
|
+
},
|
309
|
+
changeValueType(val){
|
310
|
+
let optionItems = this.optionModel.optionItems;
|
311
|
+
// this.optionModel.defaultValue = undefined;
|
312
|
+
this.resetDefault();
|
313
|
+
this.optionModel.optionItems.length = 0;
|
314
|
+
if(val==2){
|
315
|
+
optionItems.push({
|
316
|
+
label:"是",
|
317
|
+
value:true,
|
318
|
+
});
|
319
|
+
optionItems.push({
|
320
|
+
label:"否",
|
321
|
+
value:false
|
322
|
+
});
|
323
|
+
}else{
|
324
|
+
this.addOption();
|
325
|
+
}
|
326
|
+
this.$forceUpdate()
|
327
|
+
this.emitDefaultValueChange();
|
328
|
+
},
|
329
|
+
|
330
|
+
|
331
|
+
openTableDataEdit: function () {
|
332
|
+
(this.dataDialogVisible = !0), (this.tableDataOptions = JSON.stringify(this.optionModel.defaultValue, null, ' '));
|
333
|
+
},
|
334
|
+
saveTableData: function () {
|
335
|
+
try {
|
336
|
+
(this.optionModel.defaultValue = JSON.parse(this.tableDataOptions)), (this.dataDialogVisible = !1);
|
337
|
+
} catch (e) {
|
338
|
+
this.$message.error(this.i18nt('designer.hint.invalidOptionsData') + e.message);
|
339
|
+
}
|
340
|
+
},
|
341
|
+
getDefaultValue(){
|
342
|
+
let result = this.optionModel.defaultValue;
|
343
|
+
if(result){
|
344
|
+
if(Array.isArray(result)){
|
345
|
+
result = result.join(",");
|
346
|
+
}
|
347
|
+
}
|
348
|
+
return result;
|
349
|
+
},
|
350
|
+
}
|
351
|
+
};
|
352
|
+
</script>
|
353
|
+
|
354
|
+
<style lang="scss" scoped>
|
355
|
+
.option-items-pane ul {
|
356
|
+
padding-inline-start: 6px;
|
357
|
+
padding-left: 6px; /* 重置IE11默认样式 */
|
358
|
+
}
|
359
|
+
|
360
|
+
li.ghost {
|
361
|
+
background: #fff;
|
362
|
+
border: 2px dotted $--color-primary;
|
363
|
+
}
|
364
|
+
|
365
|
+
.drag-option {
|
366
|
+
cursor: move;
|
367
|
+
}
|
368
|
+
|
369
|
+
.small-padding-dialog ::v-deep .el-dialog__body {
|
370
|
+
padding: 10px 15px;
|
371
|
+
}
|
372
|
+
|
373
|
+
.dialog-footer .el-button {
|
374
|
+
width: 100px;
|
375
|
+
}
|
376
|
+
</style>
|