cloud-web-corejs 1.0.67 → 1.0.69

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.
Files changed (32) hide show
  1. package/package.json +1 -1
  2. package/src/components/xform/form-designer/form-widget/field-widget/baseAttachment-widget.vue +3 -2
  3. package/src/components/xform/form-designer/form-widget/field-widget/date-range-widget.vue +1 -0
  4. package/src/components/xform/form-designer/form-widget/field-widget/echart-bar-widget.vue +1 -1
  5. package/src/components/xform/form-designer/form-widget/field-widget/echart-category-widget.vue +1 -1
  6. package/src/components/xform/form-designer/form-widget/field-widget/echart-pie-widget.vue +1 -1
  7. package/src/components/xform/form-designer/form-widget/field-widget/fieldMixin.js +1 -1
  8. package/src/components/xform/form-designer/form-widget/field-widget/mixins/echart-bar-mixin.js +49 -8
  9. package/src/components/xform/form-designer/form-widget/field-widget/mixins/echart-category-mixin.js +61 -88
  10. package/src/components/xform/form-designer/form-widget/field-widget/mixins/echart-pie-mixin.js +13 -0
  11. package/src/components/xform/form-designer/form-widget/field-widget/table-export-button-widget.vue +5 -1
  12. package/src/components/xform/form-designer/form-widget/field-widget/vabUpload-widget.vue +77 -0
  13. package/src/components/xform/form-designer/indexMixin.js +1 -1
  14. package/src/components/xform/form-designer/setting-panel/form-setting.vue +40 -3
  15. package/src/components/xform/form-designer/setting-panel/property-editor/event-handler/onAfterConfirmFile-editor.vue +30 -0
  16. package/src/components/xform/form-designer/setting-panel/property-editor/event-handler/onClick-editor.vue +2 -2
  17. package/src/components/xform/form-designer/setting-panel/property-editor/field-date-range/date-range-defaultTime-editor.vue +27 -0
  18. package/src/components/xform/form-designer/setting-panel/property-editor/field-echart/echart-bar-editor.vue +185 -69
  19. package/src/components/xform/form-designer/setting-panel/property-editor/field-echart/echart-category-editor.vue +188 -86
  20. package/src/components/xform/form-designer/setting-panel/property-editor/field-echart/echart-pie-editor.vue +84 -39
  21. package/src/components/xform/form-designer/setting-panel/property-editor/placeholder-editor.vue +1 -1
  22. package/src/components/xform/form-designer/setting-panel/property-editor/showRuleFlag-editor.vue +223 -0
  23. package/src/components/xform/form-designer/setting-panel/property-editor/textFlag-editor.vue +62 -0
  24. package/src/components/xform/form-designer/setting-panel/propertyRegister.js +4 -0
  25. package/src/components/xform/form-designer/setting-panel/wfObjConfigDialog.vue +189 -0
  26. package/src/components/xform/form-designer/widget-panel/widgetsConfig.js +330 -37
  27. package/src/store/modules/permission.js +1 -1
  28. package/src/views/bd/setting/form_template/batchWfObjConfigDialog.vue +105 -0
  29. package/src/views/bd/setting/form_template/mixins/batchWfObjConfigDialog.js +4 -0
  30. package/src/views/bd/setting/form_template/mixins/wf_list.js +12 -0
  31. package/src/views/bd/setting/form_template/wfObjConfigDialog.vue +254 -0
  32. package/src/views/bd/setting/form_template/wf_list.vue +127 -0
@@ -3,7 +3,7 @@ import i18n from '../../../../../../components/xform/utils/i18n';
3
3
  import fieldMixin from '../../../../../../components/xform/form-designer/form-widget/field-widget/fieldMixin';
4
4
 
5
5
  import {deepClone} from '../../../../../../components/xform/utils/util';
6
-
6
+ import {extendDeeply} from "@base/utils/index.js";
7
7
  import {use} from 'echarts/core';
8
8
  import {CanvasRenderer} from 'echarts/renderers';
9
9
  import {BarChart} from 'echarts/charts';
@@ -53,7 +53,6 @@ modules = {
53
53
  serieClone: {},
54
54
  showChart: true,
55
55
  colors: [
56
-
57
56
  {
58
57
  type: 'linear',
59
58
  x: 0.5,
@@ -206,6 +205,9 @@ modules = {
206
205
  delete chartOptions.yAxis.data;
207
206
  }
208
207
  }
208
+ },
209
+ chartOption() {
210
+ return this.field.options.echarBarOption
209
211
  }
210
212
  },
211
213
  beforeCreate() {
@@ -220,6 +222,7 @@ modules = {
220
222
  this.initEventHandler();
221
223
 
222
224
  this.handleOnCreated();
225
+ this.initOption();
223
226
  this.serieClone = deepClone(this.field.options.echarBarOption.series[0]);
224
227
  },
225
228
 
@@ -232,6 +235,37 @@ modules = {
232
235
  },
233
236
 
234
237
  methods: {
238
+ reflush(){
239
+ this.showChart = false;
240
+ this.$nextTick(()=>{
241
+ this.showChart = true
242
+ })
243
+ },
244
+ getColors(){
245
+ let chartColors = this.field.options.echarBarOption.colors || [];
246
+ let colors = [...chartColors, ...this.colors];
247
+ return colors
248
+ },
249
+ adjustColor() {
250
+ let colors = this.getColors();
251
+ let colorsSize = colors.length;
252
+ this.field.options.echarBarOption.series.forEach((serie, index) => {
253
+ if (colorsSize > index) {
254
+ if (serie.itemStyle) {
255
+ serie.itemStyle.color = colors[index]
256
+ } else {
257
+ serie.itemStyle = {
258
+ color: colors[index]
259
+ }
260
+ }
261
+ }
262
+ })
263
+ },
264
+ initOption() {
265
+ let echartConfig = this.handleCustomEvent(this.field.options.echartConfig) || {};
266
+ this.field.options.echarBarOption = extendDeeply(this.field.options.echarBarOption, echartConfig);
267
+ this.adjustColor();
268
+ },
235
269
  /*async loadData() {
236
270
  if (this.designState) {
237
271
  this.showChart = true;
@@ -364,7 +398,7 @@ modules = {
364
398
  });
365
399
  },
366
400
  setValue(rows) {
367
- this.showChart = false;
401
+ this.showChart = false;
368
402
  let serieClone = this.serieClone;
369
403
  let resDatas = rows || [];
370
404
  let axisDatas = [];
@@ -383,14 +417,18 @@ modules = {
383
417
  nameDatas.push(resData.name);
384
418
  }
385
419
  });
386
- let colors = this.colors;
420
+ let colors = this.getColors();
387
421
  let colorsSize = colors.length;
388
422
  nameDatas.forEach((nameItem, index) => {
389
423
  let serie = deepClone(serieClone);
390
424
  serie.name = nameItem;
391
- if (serie.itemStyle) {
392
- if (colorsSize > index) {
425
+ if (colorsSize > index) {
426
+ if (serie.itemStyle) {
393
427
  serie.itemStyle.color = colors[index]
428
+ } else {
429
+ serie.itemStyle = {
430
+ color: colors[index]
431
+ }
394
432
  }
395
433
  }
396
434
  let serieDatas = [];
@@ -409,9 +447,12 @@ modules = {
409
447
  let chartOptions = this.field.options.echarBarOption;
410
448
  chartOptions[this.alignField].data = axisDatas;
411
449
  chartOptions.series = newSeries;
412
- this.$nextTick(()=>{
413
- this.showChart = true;
450
+ this.$nextTick(() => {
451
+ this.showChart = true;
414
452
  })
453
+ },
454
+ getChart() {
455
+ return this.$refs.chart;
415
456
  }
416
457
  }
417
458
  };
@@ -9,6 +9,7 @@ import {CanvasRenderer} from 'echarts/renderers';
9
9
  import {LineChart} from 'echarts/charts';
10
10
  import {TitleComponent, TooltipComponent, LegendComponent} from 'echarts/components';
11
11
  import {THEME_KEY} from 'vue-echarts';
12
+ import {extendDeeply} from "@base/utils/index.js";
12
13
 
13
14
  use([CanvasRenderer, LineChart, TitleComponent, TooltipComponent, LegendComponent]);
14
15
  let modules = {};
@@ -52,87 +53,8 @@ modules = {
52
53
  requestAccesses: [],
53
54
  requestAccess: null,
54
55
  serieClone: {},
55
- showChart:true,
56
- colors: [
57
-
58
- {
59
- type: 'linear',
60
- x: 0.5,
61
- y: 0.9,
62
- r: 0.2,
63
- colorStops: [{
64
- offset: 1, color: '#08C084' // 0% 处的颜色
65
- }, {
66
- offset: 0, color: '#97EACE' // 100% 处的颜色
67
- }],
68
- },
69
- {
70
- type: 'linear',
71
- x: 0.5,
72
- y: 0.9,
73
- r: 0.2,
74
- colorStops: [{
75
- offset: 1, color: '#29ABE3' // 0% 处的颜色
76
- }, {
77
- offset: 0, color: '#AADEF4' // 100% 处的颜色
78
- }],
79
- },
80
- {
81
- type: 'linear',
82
- x: 0.5,
83
- y: 0.9,
84
- r: 0.2,
85
- colorStops: [{
86
- offset: 1, color: '#0044FE' // 0% 处的颜色
87
- }, {
88
- offset: 0, color: '#97B3FF' // 100% 处的颜色
89
- }],
90
- },
91
- {
92
- type: 'linear',
93
- x: 0.5,
94
- y: 0.9,
95
- r: 0.2,
96
- colorStops: [{
97
- offset: 1, color: '#75018A' // 0% 处的颜色
98
- }, {
99
- offset: 0, color: '#C492CD' // 100% 处的颜色
100
- }],
101
- },
102
- {
103
- type: 'linear',
104
- x: 0.5,
105
- y: 0.9,
106
- r: 0.2,
107
- colorStops: [{
108
- offset: 1, color: '#BF0104' // 0% 处的颜色
109
- }, {
110
- offset: 0, color: '#E59697' // 100% 处的颜色
111
- }],
112
- },
113
- {
114
- type: 'linear',
115
- x: 0.5,
116
- y: 0.9,
117
- r: 0.2,
118
- colorStops: [{
119
- offset: 1, color: '#FF8B01' // 0% 处的颜色
120
- }, {
121
- offset: 0, color: '#FFCF95' // 100% 处的颜色
122
- }],
123
- },
124
- {
125
- type: 'linear',
126
- x: 0.5,
127
- y: 0.9,
128
- r: 0.2,
129
- colorStops: [{
130
- offset: 1, color: '#FAFE09' // 0% 处的颜色
131
- }, {
132
- offset: 0, color: '#FCFFAF' // 100% 处的颜色
133
- }],
134
- }
135
- ]
56
+ showChart: true,
57
+ colors: []
136
58
  };
137
59
  },
138
60
  computed: {
@@ -157,6 +79,9 @@ modules = {
157
79
  return height;
158
80
  }
159
81
  return '';
82
+ },
83
+ chartOption() {
84
+ return this.field.options.echarCategoryOption
160
85
  }
161
86
  },
162
87
  beforeCreate() {
@@ -171,6 +96,7 @@ modules = {
171
96
  this.initEventHandler();
172
97
 
173
98
  this.handleOnCreated();
99
+ this.initOption();
174
100
  this.serieClone = deepClone(this.field.options.echarCategoryOption.series[0]);
175
101
  // this.loadData();
176
102
  },
@@ -184,6 +110,38 @@ modules = {
184
110
  },
185
111
 
186
112
  methods: {
113
+ getColors() {
114
+ let chartColors = this.field.options.echarCategoryOption.colors || [];
115
+ let colors = [...chartColors, ...this.colors];
116
+ return colors
117
+ },
118
+ adjustColor() {
119
+ let colors = this.getColors();
120
+ let colorsSize = colors.length;
121
+ this.field.options.echarCategoryOption.series.forEach((serie, index) => {
122
+ if (colorsSize > index) {
123
+ if (serie.lineStyle) {
124
+ serie.lineStyle.color = colors[index]
125
+ } else {
126
+ serie.lineStyle = {
127
+ color: colors[index]
128
+ }
129
+ }
130
+ if (serie.itemStyle) {
131
+ serie.itemStyle.color = colors[index]
132
+ } else {
133
+ serie.itemStyle = {
134
+ color: colors[index]
135
+ }
136
+ }
137
+ }
138
+ })
139
+ },
140
+ initOption() {
141
+ let echartConfig = this.handleCustomEvent(this.field.options.echartConfig) || {};
142
+ this.field.options.echarCategoryOption = extendDeeply(this.field.options.echarCategoryOption, echartConfig);
143
+ this.adjustColor();
144
+ },
187
145
  /*async loadData() {
188
146
  if (this.designState) {
189
147
  return;
@@ -312,7 +270,7 @@ modules = {
312
270
  });
313
271
  },
314
272
  setValue(rows) {
315
- this.showChart = false;
273
+ this.showChart = false;
316
274
  let serieClone = this.serieClone;
317
275
  let resDatas = rows || [];
318
276
  let axisDatas = [];
@@ -331,16 +289,28 @@ modules = {
331
289
  nameDatas.push(resData.name);
332
290
  }
333
291
  });
334
- let colors = this.colors;
292
+ let colors = this.getColors();
335
293
  let colorsSize = colors.length;
336
294
  nameDatas.forEach((nameItem, index) => {
337
295
  let serie = deepClone(serieClone);
338
296
  serie.name = nameItem;
339
- /*if (serie.lineStyle) {
340
- if (colorsSize > index) {
297
+ if (colorsSize > index) {
298
+ if (serie.lineStyle) {
341
299
  serie.lineStyle.color = colors[index]
300
+ } else {
301
+ serie.lineStyle = {
302
+ color: colors[index]
303
+ }
304
+ }
305
+ if (serie.itemStyle) {
306
+ serie.itemStyle.color = colors[index]
307
+ } else {
308
+ serie.itemStyle = {
309
+ color: colors[index]
310
+ }
342
311
  }
343
- }*/
312
+ }
313
+
344
314
  delete serie.lineStyle
345
315
 
346
316
  let serieDatas = [];
@@ -360,9 +330,12 @@ modules = {
360
330
  chartOptions.xAxis.data = axisDatas;
361
331
  chartOptions.series = newSeries;
362
332
 
363
- this.$nextTick(()=>{
364
- this.showChart = true;
333
+ this.$nextTick(() => {
334
+ this.showChart = true;
365
335
  })
336
+ },
337
+ getChart() {
338
+ return this.$refs.chart;
366
339
  }
367
340
  }
368
341
  };
@@ -9,6 +9,7 @@ import {CanvasRenderer} from 'echarts/renderers';
9
9
  import {PieChart} from 'echarts/charts';
10
10
  import {TitleComponent, TooltipComponent, LegendComponent} from 'echarts/components';
11
11
  import {THEME_KEY} from 'vue-echarts';
12
+ import {extendDeeply} from "@base/utils/index.js";
12
13
 
13
14
  use([CanvasRenderer, PieChart, TitleComponent, TooltipComponent, LegendComponent]);
14
15
 
@@ -53,6 +54,7 @@ modules = {
53
54
  requestAccess: null,
54
55
  serieClone: {},
55
56
  showChart: true,
57
+ colors:[]
56
58
  };
57
59
  },
58
60
  computed: {
@@ -77,6 +79,9 @@ modules = {
77
79
  return height;
78
80
  }
79
81
  return '';
82
+ },
83
+ chartOption() {
84
+ return this.field.options.echarPieOption
80
85
  }
81
86
  },
82
87
  beforeCreate() {
@@ -91,6 +96,7 @@ modules = {
91
96
  this.initEventHandler();
92
97
 
93
98
  this.handleOnCreated();
99
+ this.initOption();
94
100
  this.serieClone = deepClone(this.field.options.echarPieOption.series[0]);
95
101
  // this.loadData();
96
102
  },
@@ -104,6 +110,10 @@ modules = {
104
110
  },
105
111
 
106
112
  methods: {
113
+ initOption() {
114
+ let echartConfig = this.handleCustomEvent(this.field.options.echartConfig) || {};
115
+ this.field.options.echarPieOption = extendDeeply(this.field.options.echarPieOption, echartConfig);
116
+ },
107
117
  /*async loadData() {
108
118
  if (this.designState) {
109
119
  return;
@@ -188,6 +198,9 @@ modules = {
188
198
  this.$nextTick(() => {
189
199
  this.showChart = true;
190
200
  })
201
+ },
202
+ getChart() {
203
+ return this.$refs.chart;
191
204
  }
192
205
  }
193
206
  };
@@ -76,7 +76,11 @@ export default {
76
76
  if (this.designState) {
77
77
  return
78
78
  }
79
- let opt = {title: this.field.options.exportFileName || null, targetRef: this.field.options.tableRef || null};
79
+ let opt = {
80
+ title: this.field.options.exportFileName || null,
81
+ targetRef: this.field.options.tableRef || null,
82
+ pageSize: (this.field.options.exportPageSize || null)
83
+ };
80
84
  let tableExportParam = this.handleCustomEvent(this.field.options.tableExportParam);
81
85
  let options = {...opt, ...tableExportParam, type: type};
82
86
  let tableRef = options?.targetRef;
@@ -16,6 +16,7 @@
16
16
  :limit.sync="limit"
17
17
  resultType="Array"
18
18
  :edit="!field.options.disabled"
19
+ @callback="submitFile"
19
20
  v-else></baseUpload>
20
21
  </form-item-wrapper>
21
22
  </template>
@@ -144,6 +145,82 @@ export default {
144
145
  });
145
146
  }
146
147
  },
148
+ submitFile(rows, fileInfos) {
149
+ this.handlLineCode(fileInfos);
150
+ this.field.options.onAfterConfirmFile && this.field.options.onAfterConfirmFile(rows, fileInfos);
151
+ },
152
+ handlLineCode(fileInfos) {
153
+ let allPromise = [];
154
+ fileInfos.forEach(async fileInfo => {
155
+ await this.processFile(fileInfo.file, (lineCode) => {
156
+ fileInfo.lineCode = lineCode;
157
+ })
158
+ })
159
+
160
+ },
161
+ processFile(file, callback) {
162
+ return new Promise((resolve, reject) => {
163
+ const reader = new FileReader();
164
+ reader.onload = (e) => this.processImage(e.target.result, (lineCode) => {
165
+ resolve(lineCode)
166
+ callback(lineCode)
167
+ });
168
+ reader.onerror = () => {
169
+ resolve(null)
170
+ callback(null)
171
+ this.setError('文件读取失败')
172
+ };
173
+ reader.readAsDataURL(file);
174
+ })
175
+ },
176
+ async processImage(base64, callback) {
177
+ try {
178
+ // 使用 ZXing 3.x 的 API
179
+ const result = await decode(base64,(result, err) => {
180
+ if (err) {
181
+ this.handleError(`条码识别失败: ${err}`);
182
+ callback && callback(null)
183
+ return;
184
+ }
185
+ this.scannedText = result.text;
186
+ this.loading = false;
187
+ callback && callback(result.text)
188
+ });
189
+ } catch (err) {
190
+ console.error(err);
191
+ callback && callback(null)
192
+ this.handleError(`条码识别失败: ${err.message}`);
193
+ }
194
+ },
195
+ handleLineCode(fileInfos) {
196
+ fileInfos.forEach(fileInfo => {
197
+ let file = fileInfo.file;
198
+ })
199
+ },
200
+ handleImage(base64, fileName, callback) {
201
+ // 创建 ZXing Scanner
202
+
203
+
204
+ // 将 Base64 转换为 ImageLuminanceSource
205
+ // const imageData = Uint8Array.from(atob(base64), c => c.charCodeAt(0));
206
+ // const source = new ZXing.ImageLuminanceSource(imageData, base64.length);
207
+
208
+ decode(base64, (result, err) => {
209
+ if (err) {
210
+ this.handleError(`条码识别失败: ${err}`);
211
+ callback && callback(null)
212
+ return;
213
+ }
214
+ this.scannedText = result.text;
215
+ this.loading = false;
216
+ callback && callback(result.text)
217
+ });
218
+ },
219
+
220
+ handleError(errorMessage) {
221
+ this.error = errorMessage;
222
+ this.loading = false;
223
+ },
147
224
  }
148
225
  }
149
226
  </script>