tianheng-ui 0.1.67 → 0.1.68

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "tianheng-ui",
3
3
  "description": "A Vue.js project",
4
- "version": "0.1.67",
4
+ "version": "0.1.68",
5
5
  "author": "shu lang <403732931@qq.com>",
6
6
  "license": "MIT",
7
7
  "private": false,
@@ -259,6 +259,7 @@ export default {
259
259
  const params = {};
260
260
  for (let e of api.inParams) {
261
261
  const value =
262
+ e.defaultValue ||
262
263
  getProperty(this.models, e.pAlias) ||
263
264
  getProperty(this.query, e.pAlias) ||
264
265
  null;
@@ -296,7 +297,8 @@ export default {
296
297
  if (item.children) {
297
298
  initParams(item.children);
298
299
  } else {
299
- const value = getProperty(this.models, item.pAlias) || null;
300
+ const value =
301
+ item.defaultValue || getProperty(this.models, item.pAlias) || null;
300
302
  setProperty(params, item.pAlias, value);
301
303
  }
302
304
  });
@@ -102,6 +102,7 @@
102
102
  :config="config"
103
103
  :apiOptions="apiOptions"
104
104
  :is="compsData[data.type].content"
105
+ @remote-params="handleFieldsApiChange"
105
106
  ></component>
106
107
 
107
108
  <el-collapse-item
@@ -480,8 +480,10 @@ export default {
480
480
  });
481
481
  } else if (item.type === "table" || item.type === "tableH5") {
482
482
  initList(item.options.columns);
483
- } else if (item.options.remote?.open || item.options.remote?.api) {
484
- fieldsApi[item.model] = item.options.remote.api;
483
+ } else if (item.type === "workflow") {
484
+ initList(item.options.buttons);
485
+ } else if (item.options.remote?.open || item.options.remote?.api) {
486
+ fieldsApi[item.model || item.name] = item.options.remote.api;
485
487
  }
486
488
  }
487
489
  };
@@ -998,43 +998,44 @@ export const businessComponents = [
998
998
  timestamp: "2023-05-05 14:30"
999
999
  }
1000
1000
  ],
1001
- processInstButtons: [
1002
- {
1003
- name: "通过",
1004
- options: {
1005
- remote: {
1006
- api: ""
1007
- },
1008
- type: "primary",
1009
- icon: "",
1010
- size: "small",
1011
- plain: false,
1012
- round: false,
1013
- circle: false,
1014
- disabled: false,
1015
- loading: false,
1016
- customStyle: ""
1017
- }
1018
- },
1019
- {
1020
- name: "驳回",
1021
- options: {
1022
- remote: {
1023
- api: ""
1024
- },
1025
- type: "primary",
1026
- icon: "",
1027
- size: "small",
1028
- plain: false,
1029
- round: false,
1030
- circle: false,
1031
- disabled: false,
1032
- loading: false,
1033
- customStyle: ""
1034
- }
1035
- }
1036
- ]
1001
+ processInstButtons: null
1037
1002
  },
1003
+ buttons: [
1004
+ {
1005
+ name: "通过",
1006
+ options: {
1007
+ remote: {
1008
+ api: ""
1009
+ },
1010
+ type: "primary",
1011
+ icon: "",
1012
+ size: "small",
1013
+ plain: false,
1014
+ round: false,
1015
+ circle: false,
1016
+ disabled: false,
1017
+ loading: false,
1018
+ customStyle: ""
1019
+ }
1020
+ },
1021
+ {
1022
+ name: "驳回",
1023
+ options: {
1024
+ remote: {
1025
+ api: ""
1026
+ },
1027
+ type: "primary",
1028
+ icon: "",
1029
+ size: "small",
1030
+ plain: false,
1031
+ round: false,
1032
+ circle: false,
1033
+ disabled: false,
1034
+ loading: false,
1035
+ customStyle: ""
1036
+ }
1037
+ }
1038
+ ],
1038
1039
  hideLabel: true
1039
1040
  },
1040
1041
  events: {},
@@ -52,7 +52,7 @@
52
52
  </el-option>
53
53
  </el-select>
54
54
  </el-form-item>
55
- <el-form-item v-if="!widget.options.remote.open" label-width="0">
55
+ <el-form-item v-else label-width="0">
56
56
  <draggable
57
57
  :list="widget.options.defaultValue.processInstTaskRsps"
58
58
  v-bind="{
@@ -101,9 +101,20 @@
101
101
  >
102
102
  </div>
103
103
  </el-form-item>
104
- <el-form-item v-if="!widget.options.remote.open" label-width="0">
104
+
105
+ <el-form-item>
106
+ <el-tooltip
107
+ slot="label"
108
+ effect="light"
109
+ content="流程节点的默认操作,可被远端节点数据的 processInstButtons 配置属性覆盖"
110
+ placement="top"
111
+ >
112
+ <span style="color: #409EFF;">操作按钮</span>
113
+ </el-tooltip>
114
+ </el-form-item>
115
+ <el-form-item label-width="0">
105
116
  <draggable
106
- :list="widget.options.defaultValue.processInstButtons"
117
+ :list="widget.options.buttons"
107
118
  v-bind="{
108
119
  group: { name: 'options' },
109
120
  ghostClass: 'ghost',
@@ -112,8 +123,7 @@
112
123
  handle=".drag"
113
124
  >
114
125
  <div
115
- v-for="(item, index) in widget.options.defaultValue
116
- .processInstButtons"
126
+ v-for="(item, index) in widget.options.buttons"
117
127
  class="draggable-item"
118
128
  :key="index"
119
129
  >
@@ -242,8 +252,7 @@
242
252
  >
243
253
  </div>
244
254
  <div
245
- v-for="(item, index) in widget.options.defaultValue
246
- .processInstButtons"
255
+ v-for="(item, index) in widget.options.buttons"
247
256
  class="list-item th-is_hover"
248
257
  :class="{
249
258
  'th-is_active': dialog.data && dialog.data.name === item.name
@@ -328,17 +337,17 @@
328
337
  <el-select
329
338
  v-model="dialog.data.options.remote.api"
330
339
  style="width:100%"
331
- value-key="id"
332
340
  clearable
333
341
  placeholder=""
334
342
  filterable
335
343
  no-data-text="暂无接口,请前往【接口模块】创建"
344
+ @change="handleRemoteApiChange"
336
345
  >
337
346
  <el-option
338
347
  v-for="item in apiOptions"
339
348
  :key="item.id"
340
349
  :label="item.name"
341
- :value="item"
350
+ :value="item.id"
342
351
  >
343
352
  </el-option>
344
353
  </el-select>
@@ -400,9 +409,8 @@ export default {
400
409
  timestamp: "节点时间"
401
410
  });
402
411
  } else {
403
- this.widget.options.defaultValue.processInstButtons.push({
404
- name: `操作${this.widget.options.defaultValue.processInstButtons
405
- .length + 1}`,
412
+ this.widget.options.buttons.push({
413
+ name: `操作${this.widget.options.buttons.length + 1}`,
406
414
  options: {
407
415
  remote: {
408
416
  api: ""
@@ -423,7 +431,7 @@ export default {
423
431
  handleRemoveOption(index, type) {
424
432
  if (type === "processInstTaskRsps")
425
433
  this.widget.options.defaultValue.processInstTaskRsps.splice(index, 1);
426
- else this.widget.options.defaultValue.processInstButtons.splice(index, 1);
434
+ else this.widget.options.buttons.splice(index, 1);
427
435
  },
428
436
  handleRemoteChange(val) {
429
437
  if (val) return;
@@ -433,13 +441,16 @@ export default {
433
441
  const data =
434
442
  action === "processInstTaskRsps"
435
443
  ? this.widget.options.defaultValue.processInstTaskRsps[index]
436
- : this.widget.options.defaultValue.processInstButtons[index];
444
+ : this.widget.options.buttons[index];
437
445
  this.dialog = {
438
446
  show: true,
439
447
  action,
440
448
  data,
441
449
  index
442
450
  };
451
+ },
452
+ handleRemoteApiChange(val) {
453
+ this.$emit("remote-params", val);
443
454
  }
444
455
  }
445
456
  };
@@ -58,12 +58,14 @@
58
58
  </el-timeline-item>
59
59
  </el-timeline>
60
60
  <div
61
- v-if="dataModel.processInstButtons.length"
61
+ v-if="dataModel.processInstButtons || widget.options.buttons.length"
62
62
  class="footer"
63
63
  :class="{ sticky: widget.options.buttonsSticky }"
64
64
  >
65
65
  <el-button
66
- v-for="(item, index) in dataModel.processInstButtons"
66
+ v-for="(item, index) in dataModel.processInstButtons
67
+ ? dataModel.processInstButtons
68
+ : widget.options.buttons"
67
69
  :key="index"
68
70
  :style="item.options.customStyle"
69
71
  :type="item.options.type"
@@ -349,9 +349,9 @@ export default {
349
349
  } else if (item.type === "table" || item.type === "tableH5") {
350
350
  initList(item.options.columns);
351
351
  } else if (item.type === "workflow") {
352
- initList(item.options.defaultValue.processInstButtons);
352
+ initList(item.options.buttons);
353
353
  } else if (item.options.remote?.open || item.options.remote?.api) {
354
- fieldsApi[item.model] = item.options.remote.api;
354
+ fieldsApi[item.model || item.name] = item.options.remote.api;
355
355
  }
356
356
  }
357
357
  };