cloud-web-corejs 1.0.54-dev.687 → 1.0.54-dev.688

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.
@@ -1,7 +1,10 @@
1
1
  <template>
2
2
  <div class="option-items-pane">
3
3
  <el-form-item label="选项值类型">
4
- <el-radio-group v-model="optionModel.optionItemValueType" @change="changeValueType">
4
+ <el-radio-group
5
+ v-model="optionModel.optionItemValueType"
6
+ @change="changeValueType"
7
+ >
5
8
  <el-radio :label="0">文本</el-radio>
6
9
  <el-radio :label="1">数值</el-radio>
7
10
  <el-radio :label="2">布尔值</el-radio>
@@ -54,7 +57,9 @@
54
57
  type="text"
55
58
  v-model="optionModel.labelKey"
56
59
  placeholder="默认label"
57
- :disabled="optionModel.commonAttributeEnabled || !optionModel.formScriptEnabled"
60
+ :disabled="
61
+ optionModel.commonAttributeEnabled || !optionModel.formScriptEnabled
62
+ "
58
63
  ></el-input>
59
64
  </el-form-item>
60
65
  <el-form-item :label="i18nt('关联字段')">
@@ -62,11 +67,21 @@
62
67
  type="text"
63
68
  v-model="optionModel.valueKey"
64
69
  placeholder="默认value"
65
- :disabled="optionModel.commonAttributeEnabled || !optionModel.formScriptEnabled"
70
+ :disabled="
71
+ optionModel.commonAttributeEnabled || !optionModel.formScriptEnabled
72
+ "
66
73
  ></el-input>
67
74
  </el-form-item>
75
+ <el-form-item
76
+ v-if="hasConfig('childrenKey')"
77
+ :label="i18nt('designer.setting.childrenKeyName')"
78
+ >
79
+ <el-input v-model="optionModel.childrenKey"></el-input>
80
+ </el-form-item>
68
81
  <template
69
- v-if="!optionModel.commonAttributeEnabled && !optionModel.formScriptEnabled"
82
+ v-if="
83
+ !optionModel.commonAttributeEnabled && !optionModel.formScriptEnabled
84
+ "
70
85
  >
71
86
  <el-radio-group
72
87
  v-if="
@@ -80,7 +95,11 @@
80
95
  tag="ul"
81
96
  class="draggable-box"
82
97
  :list="optionModel.optionItems"
83
- v-bind="{ group: 'optionsGroup', ghostClass: 'ghost', handle: '.drag-option' }"
98
+ v-bind="{
99
+ group: 'optionsGroup',
100
+ ghostClass: 'ghost',
101
+ handle: '.drag-option',
102
+ }"
84
103
  >
85
104
  <li v-for="(option, idx) in optionModel.optionItems" :key="idx">
86
105
  <el-radio :label="option.value">
@@ -136,7 +155,11 @@
136
155
  tag="ul"
137
156
  class="draggable-box"
138
157
  :list="optionModel.optionItems"
139
- v-bind="{ group: 'optionsGroup', ghostClass: 'ghost', handle: '.drag-option' }"
158
+ v-bind="{
159
+ group: 'optionsGroup',
160
+ ghostClass: 'ghost',
161
+ handle: '.drag-option',
162
+ }"
140
163
  >
141
164
  <li v-for="(option, idx) in optionModel.optionItems" :key="idx">
142
165
  <el-checkbox :label="option.value">
@@ -185,7 +208,8 @@
185
208
  @change="emitDefaultValueChange"
186
209
  :placeholder="i18nt('render.hint.selectPlaceholder')"
187
210
  style="width: 100%"
188
- ></el-cascader>
211
+ >
212
+ </el-cascader>
189
213
  <div v-if="selectedWidget.type === 'cascader'">
190
214
  <el-button type="text" @click="importCascaderOptions">{{
191
215
  i18nt("designer.setting.importOptions")
@@ -248,22 +272,29 @@
248
272
  v-if="showImportCascaderDialogFlag"
249
273
  :show-close="true"
250
274
  class="small-padding-dialog"
275
+ append-to-body
251
276
  :close-on-click-modal="false"
252
277
  :close-on-press-escape="false"
253
278
  :destroy-on-close="true"
254
- :append-to-body="true"
255
- :modal-append-to-body="true"
256
279
  >
257
- <code-editor v-model="cascaderOptions" mode="json" :readonly="false"></code-editor>
280
+ <code-editor
281
+ v-model="cascaderOptions"
282
+ mode="json"
283
+ :readonly="false"
284
+ ></code-editor>
258
285
  <div slot="footer" class="dialog-footer">
259
286
  <el-button size="large" type="primary" @click="saveCascaderOptions">{{
260
287
  i18nt("designer.hint.confirm")
261
288
  }}</el-button>
262
- <el-button size="large" type="" @click="showImportCascaderDialogFlag = false">{{
263
- i18nt("designer.hint.cancel")
264
- }}</el-button>
289
+ <el-button
290
+ size="large"
291
+ type=""
292
+ @click="showImportCascaderDialogFlag = false"
293
+ >{{ i18nt("designer.hint.cancel") }}</el-button
294
+ >
265
295
  </div>
266
296
  </el-dialog>
297
+
267
298
  <el-dialog
268
299
  v-if="dataDialogVisible"
269
300
  custom-class="dialog-style list-dialog"
@@ -297,7 +328,11 @@
297
328
  </el-button>
298
329
  </div>
299
330
  </template>
300
- <code-editor mode="json" :readonly="!1" v-model="tableDataOptions"></code-editor>
331
+ <code-editor
332
+ mode="json"
333
+ :readonly="!1"
334
+ v-model="tableDataOptions"
335
+ ></code-editor>
301
336
  </el-dialog>
302
337
  </div>
303
338
  </template>
@@ -305,11 +340,12 @@
305
340
  <script>
306
341
  import Draggable from "vuedraggable";
307
342
  import i18n from "../../../../components/xform/utils/i18n";
343
+ import propertyMixin from "../../../../components/xform/form-designer/setting-panel/property-editor/propertyMixin";
308
344
 
309
345
  export default {
310
346
  name: "OptionItemsSetting",
311
347
  componentName: "PropertyEditor",
312
- mixins: [i18n],
348
+ mixins: [i18n, propertyMixin],
313
349
  components: {
314
350
  Draggable,
315
351
  },
@@ -406,13 +442,16 @@ export default {
406
442
  let lineArray = this.optionLines.split("\n");
407
443
  //console.log('test', lineArray)
408
444
  if (lineArray.length > 0) {
409
- let isNumericOptionItemValue = this.optionModel.optionItemValueType === 1;
445
+ let isNumericOptionItemValue =
446
+ this.optionModel.optionItemValueType === 1;
410
447
  this.optionModel.optionItems = [];
411
448
  lineArray.forEach((optLine) => {
412
449
  if (!!optLine && !!optLine.trim()) {
413
450
  if (optLine.indexOf(this.separator) !== -1) {
414
451
  let valueStr = optLine.split(this.separator)[0];
415
- let value = isNumericOptionItemValue ? Number(valueStr) : valueStr;
452
+ let value = isNumericOptionItemValue
453
+ ? Number(valueStr)
454
+ : valueStr;
416
455
  this.optionModel.optionItems.push({
417
456
  value: value,
418
457
  label: optLine.split(this.separator)[1],
@@ -436,7 +475,8 @@ export default {
436
475
  resetDefault() {
437
476
  if (
438
477
  this.selectedWidget.type === "checkbox" ||
439
- (this.selectedWidget.type === "select" && this.selectedWidget.options.multiple)
478
+ (this.selectedWidget.type === "select" &&
479
+ this.selectedWidget.options.multiple)
440
480
  ) {
441
481
  this.optionModel.defaultValue = [];
442
482
  } else {
@@ -447,7 +487,11 @@ export default {
447
487
  },
448
488
 
449
489
  importCascaderOptions() {
450
- this.cascaderOptions = JSON.stringify(this.optionModel.optionItems, null, " ");
490
+ this.cascaderOptions = JSON.stringify(
491
+ this.optionModel.optionItems,
492
+ null,
493
+ " "
494
+ );
451
495
  this.showImportCascaderDialogFlag = true;
452
496
  },
453
497
 
@@ -459,7 +503,9 @@ export default {
459
503
 
460
504
  this.showImportCascaderDialogFlag = false;
461
505
  } catch (ex) {
462
- this.$message.error(this.i18nt("designer.hint.invalidOptionsData") + ex.message);
506
+ this.$message.error(
507
+ this.i18nt("designer.hint.invalidOptionsData") + ex.message
508
+ );
463
509
  }
464
510
  },
465
511
  changeValueType(val) {
@@ -496,7 +542,9 @@ export default {
496
542
  (this.optionModel.defaultValue = JSON.parse(this.tableDataOptions)),
497
543
  (this.dataDialogVisible = !1);
498
544
  } catch (e) {
499
- this.$message.error(this.i18nt("designer.hint.invalidOptionsData") + e.message);
545
+ this.$message.error(
546
+ this.i18nt("designer.hint.invalidOptionsData") + e.message
547
+ );
500
548
  }
501
549
  },
502
550
  getDefaultValue() {
@@ -5,19 +5,17 @@
5
5
  </template>
6
6
 
7
7
  <script>
8
- import i18n from "../../../../../../components/xform/utils/i18n"
8
+ import i18n from "../../../../../../components/xform/utils/i18n";
9
9
 
10
- export default {
11
- name: "checkStrictly-editor",
12
- mixins: [i18n],
13
- props: {
14
- designer: Object,
15
- selectedWidget: Object,
16
- optionModel: Object,
17
- },
18
- }
10
+ export default {
11
+ name: "checkStrictly-editor",
12
+ mixins: [i18n],
13
+ props: {
14
+ designer: Object,
15
+ selectedWidget: Object,
16
+ optionModel: Object,
17
+ },
18
+ };
19
19
  </script>
20
20
 
21
- <style scoped>
22
-
23
- </style>
21
+ <style scoped></style>
@@ -0,0 +1,21 @@
1
+ <template>
2
+ <el-form-item :label="i18nt('designer.setting.showAllLevels')">
3
+ <el-switch v-model="optionModel.showAllLevels"></el-switch>
4
+ </el-form-item>
5
+ </template>
6
+
7
+ <script>
8
+ import i18n from "../../../../../../components/xform/utils/i18n";
9
+
10
+ export default {
11
+ name: "showAllLevels-editor",
12
+ mixins: [i18n],
13
+ props: {
14
+ designer: Object,
15
+ selectedWidget: Object,
16
+ optionModel: Object,
17
+ },
18
+ };
19
+ </script>
20
+
21
+ <style scoped></style>
@@ -21,7 +21,9 @@
21
21
  </el-form-item>
22
22
  <el-form-item
23
23
  label="查询参数"
24
- v-if="optionModel.formScriptEnabled || optionModel.commonAttributeEnabled"
24
+ v-if="
25
+ optionModel.formScriptEnabled || optionModel.commonAttributeEnabled
26
+ "
25
27
  >
26
28
  <a
27
29
  href="javascript:void(0);"
@@ -40,8 +42,14 @@
40
42
  @change="changeCommonAttributeEnabled"
41
43
  ></el-switch>
42
44
  </el-form-item>
43
- <el-form-item :label="i18nt('词汇编码')" v-if="optionModel.commonAttributeEnabled">
44
- <el-input type="text" v-model="optionModel.commonAttributeCode"></el-input>
45
+ <el-form-item
46
+ :label="i18nt('词汇编码')"
47
+ v-if="optionModel.commonAttributeEnabled"
48
+ >
49
+ <el-input
50
+ type="text"
51
+ v-model="optionModel.commonAttributeCode"
52
+ ></el-input>
45
53
  </el-form-item>
46
54
  <!-- <el-form-item :label="i18nt('显示字段')" v-if="optionModel.formScriptEnabled || optionModel.commonAttributeEnabled">
47
55
  <el-input type="text" v-model="optionModel.labelKey" :disabled="optionModel.commonAttributeEnabled"></el-input>
@@ -57,7 +65,9 @@
57
65
  <a
58
66
  href="javascript:void(0);"
59
67
  class="a-link link-oneLind"
60
- @click="editEventHandler('formScriptSuccess', ['dataId', 'formCode', 'res'])"
68
+ @click="
69
+ editEventHandler('formScriptSuccess', ['dataId', 'formCode', 'res'])
70
+ "
61
71
  >
62
72
  <span>{{ optionModel.formScriptSuccess }}</span>
63
73
  <i class="el-icon-edit"></i>
@@ -87,6 +97,7 @@ export default {
87
97
  "census",
88
98
  "status",
89
99
  "gantt",
100
+ "cascader",
90
101
  ],
91
102
  };
92
103
  },
@@ -51,6 +51,7 @@ const COMMON_PROPERTIES = {
51
51
  remote: "remote-editor",
52
52
  automaticDropdown: "automaticDropdown-editor",
53
53
  checkStrictly: "checkStrictly-editor",
54
+ showAllLevels: "showAllLevels-editor",
54
55
  multiple: "multiple-editor",
55
56
  multipleLimit: "multipleLimit-editor",
56
57
  contentPosition: "contentPosition-editor",
@@ -2981,7 +2981,7 @@ export const advancedFields = [
2981
2981
  formItemFlag: !1,
2982
2982
  options: {
2983
2983
  name: "",
2984
- label: "重置",
2984
+ label: "刷新",
2985
2985
  columnWidth: "200px",
2986
2986
  size: "",
2987
2987
  displayStyle: "block",
@@ -3611,6 +3611,66 @@ export const advancedFields = [
3611
3611
  showRules: [],
3612
3612
  },
3613
3613
  },
3614
+ {
3615
+ type: "cascader",
3616
+ icon: "cascader-field",
3617
+ commonFlag: !0,
3618
+ formItemFlag: true,
3619
+ options: {
3620
+ name: "",
3621
+ keyNameEnabled: false,
3622
+ keyName: "", //数据键值名称
3623
+ label: "",
3624
+ labelAlign: "",
3625
+ defaultValue: "",
3626
+ placeholder: "",
3627
+ size: "",
3628
+ labelWidth: null,
3629
+ labelHidden: false,
3630
+ columnWidth: "200px",
3631
+ disabled: false,
3632
+ hidden: false,
3633
+ clearable: true,
3634
+ filterable: false,
3635
+ multiple: false,
3636
+ checkStrictly: false, //可选择任意一级选项,默认不开启
3637
+ showAllLevels: true, //显示完整路径
3638
+ dsEnabled: false, // 是否使用数据源数据
3639
+ dsName: "", // 数据源名称
3640
+ dataSetName: "", //数据集名称
3641
+ labelKey: "label",
3642
+ valueKey: "value",
3643
+ childrenKey: "children",
3644
+ optionItems: [
3645
+ {
3646
+ label: "select 1",
3647
+ value: 1,
3648
+ children: [{ label: "child 1", value: 11 }],
3649
+ },
3650
+ { label: "select 2", value: 2 },
3651
+ { label: "select 3", value: 3 },
3652
+ ],
3653
+ required: false,
3654
+ requiredHint: "",
3655
+ customRule: "",
3656
+ customRuleHint: "",
3657
+ //-------------------
3658
+ customClass: "", //自定义css类名
3659
+ labelIconClass: null,
3660
+ labelIconPosition: "rear",
3661
+ labelTooltip: null,
3662
+
3663
+ ...httpConfig,
3664
+ ...defaultWfConfig,
3665
+ //-------------------
3666
+ onCreated: "",
3667
+ onMounted: "",
3668
+ onChange: "",
3669
+ onFocus: "",
3670
+ onBlur: "",
3671
+ onValidate: "",
3672
+ },
3673
+ },
3614
3674
  ];
3615
3675
 
3616
3676
  export const businessFields = [
@@ -180,6 +180,21 @@ const dynamicFieldMixin = {
180
180
  this.widget.rows.push(...rows);
181
181
  }
182
182
  this._generatedRowIds = rows.map((r) => r.id);
183
+ this.afterDynamicSchemaBuilt(widgets, formRef);
184
+ },
185
+
186
+ afterDynamicSchemaBuilt(widgets, formRef) {
187
+ if (!formRef || !widgets || !widgets.length) return;
188
+ widgets.forEach(({ widget }) => {
189
+ if (widget && widget.formItemFlag && formRef.buildDataFromWidget) {
190
+ formRef.buildDataFromWidget(widget);
191
+ }
192
+ });
193
+ this.$nextTick(() => {
194
+ if (formRef.hanldeCommonWidget2) {
195
+ formRef.hanldeCommonWidget2();
196
+ }
197
+ });
183
198
  },
184
199
 
185
200
  layoutByColumns(widgets, colCount) {
@@ -279,6 +294,17 @@ const dynamicFieldMixin = {
279
294
  widget.options[k] = def.options[k];
280
295
  });
281
296
  }
297
+ if (def.tableField !== undefined) {
298
+ widget.tableField = def.tableField;
299
+ } else if (
300
+ widget.hasOwnProperty("tableField") &&
301
+ !widget.tableField
302
+ ) {
303
+ widget.tableField = widget.id;
304
+ }
305
+ if (def.submitFlag !== undefined) {
306
+ widget.options.submitFlag = !!def.submitFlag;
307
+ }
282
308
  return widget;
283
309
  },
284
310
 
@@ -170,6 +170,12 @@ modules = {
170
170
  getObjectName: () => "",
171
171
  getHasWf: () => this.hasWf,
172
172
  hasConfig: this.hasConfig,
173
+ setCETriggerFlag: () => {
174
+ this.changeEventTriggerFlag = true;
175
+ },
176
+ clearCETriggerFlag: () => {
177
+ this.changeEventTriggerFlag = false;
178
+ },
173
179
  };
174
180
  },
175
181
  data() {
@@ -224,6 +230,7 @@ modules = {
224
230
  // 表格设计器-打开表格设计器弹窗
225
231
  univerDialogOption: null,
226
232
  showUniverDialog: false,
233
+ changeEventTriggerFlag: false, //记录onChange事件是否由用户操作触发
227
234
  };
228
235
  },
229
236
  computed: {
@@ -737,7 +744,11 @@ modules = {
737
744
  let result =
738
745
  freeWidgetTypesOfWf.includes(widgetType) ||
739
746
  (sourceType && freeWidgetTypesOfWf.includes(sourceType));
740
- return widget.options.label === "重置" || result;
747
+ return (
748
+ widget.options.label === "重置" ||
749
+ widget.options.label === "刷新" ||
750
+ result
751
+ );
741
752
  },
742
753
  getIsHiddenWidgetTypesOfWf(widget) {
743
754
  if (!widget) return false;
@@ -1574,11 +1585,7 @@ modules = {
1574
1585
  let areaName = e.options.areaName;
1575
1586
  if (areaName) {
1576
1587
  let val = currentFormData[areaName] ?? null;
1577
- this.$set(
1578
- this.formDataModel,
1579
- areaName,
1580
- baseRefUtil.deepClone(val)
1581
- );
1588
+ this.$set(this.formDataModel, areaName, baseRefUtil.deepClone(val));
1582
1589
  }
1583
1590
  } else if ("table2-item" === e.type) {
1584
1591
  this.$set(this.formDataModel, fieldKeyName, []);
@@ -2738,6 +2745,9 @@ modules = {
2738
2745
  newWidget.type = newWidget.targetType || newWidget.type;
2739
2746
  let tempId = generateId();
2740
2747
  newWidget.id = newWidget.type.replace(/-/g, "") + tempId;
2748
+ if (newWidget.hasOwnProperty("tableField")) {
2749
+ newWidget.tableField = newWidget.id;
2750
+ }
2741
2751
  return newWidget;
2742
2752
  },
2743
2753
  getColumnWidget(row, isEdit) {
@@ -3784,6 +3794,12 @@ modules = {
3784
3794
  openLuckysheetDialog(option) {
3785
3795
  openLuckysheetDialog(option);
3786
3796
  },
3797
+ /**
3798
+ * 获取onChange事件是否由用户操作触发标志
3799
+ */
3800
+ getCETriggerFlag() {
3801
+ return this.changeEventTriggerFlag;
3802
+ },
3787
3803
  },
3788
3804
  };
3789
3805