cloud-module-bpm 6.13.2 → 6.13.3

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 (30) hide show
  1. package/dist/cloud-module-bpm.common.js +3965 -1347
  2. package/dist/cloud-module-bpm.common.js.map +1 -1
  3. package/dist/cloud-module-bpm.css +1 -1
  4. package/dist/cloud-module-bpm.umd.js +3965 -1347
  5. package/dist/cloud-module-bpm.umd.js.map +1 -1
  6. package/dist/cloud-module-bpm.umd.min.js +6 -6
  7. package/dist/cloud-module-bpm.umd.min.js.map +1 -1
  8. package/package.json +5 -2
  9. package/packages/bpm-back-anylink-dialog/Tree.vue +222 -0
  10. package/packages/bpm-back-anylink-dialog/bpm-back-anylink-dialog.vue +466 -213
  11. package/packages/bpm-form-tools/bpm-form-tools.vue +33 -10
  12. package/packages/bpm-jump-dialog/Tree.vue +222 -0
  13. package/packages/bpm-jump-dialog/bpm-jump-dialog.vue +425 -161
  14. package/packages/bpm-jump-latest-dialog/Tree.vue +180 -41
  15. package/packages/bpm-jump-latest-dialog/bpm-jump-latest-dialog.vue +200 -30
  16. package/packages/bpm-opinion-dialog/bpm-opinion.vue +105 -44
  17. package/packages/bpm-send-read-dialog/SelectedGrid.vue +1 -1
  18. package/packages/bpm-send-read-dialog/SourceGrid.vue +90 -102
  19. package/packages/bpm-send-read-dialog/Tree.vue +145 -24
  20. package/packages/bpm-send-read-dialog/bpm-next-node.vue +3 -3
  21. package/packages/bpm-send-read-opinion-dialog/bpm-send-read-opinion.vue +35 -34
  22. package/packages/bpm-sign-dialog/SelectedGrid.vue +2 -2
  23. package/packages/bpm-sign-dialog/SourceGrid.vue +96 -113
  24. package/packages/bpm-sign-dialog/Tree.vue +125 -87
  25. package/packages/bpm-sign-dialog/bpm-next-node.vue +11 -8
  26. package/packages/bpm-user-select-dialog/SourceGrid.vue +127 -51
  27. package/packages/bpm-user-select-dialog/Tree.vue +151 -61
  28. package/packages/bpm-user-select-dialog/bpm-next-node.vue +17 -5
  29. package/packages/i18n/langs/zh_CN.js +6 -6
  30. package/packages/utils/merit-bpm.js +121 -8
@@ -1,91 +1,230 @@
1
1
  <template>
2
- <!--
3
- load:加载子树数据方法 当lazy为true时可用
4
- lazy:默认为false
5
- data:数据展示
6
- node-key:树节点唯一标识
7
- @node-click:节点被点击时回调
8
- default-expanded-keys:默认展开节点的key的数组
9
- -->
10
- <el-tree
11
- class="flow-tree"
12
- :load="loadNode"
13
- :data="treeNode"
14
- lazy
15
- node-key="id"
16
- highlight-current
17
- ref="tree"
18
- :props="treeProps"
19
- @node-click="handelrNodeClick"
20
- :default-expanded-keys="defaultExpandedKeys"
21
- >
22
- <span class="custom-tree-node cell-hidden" slot-scope="{ node, data }">
23
- <!-- 通过部门层级选择标签 -->
24
- <div :title="node.label" class="cell-hidden">
25
- <span v-if="data.dLevel == 0" class="iconfont icon-jigou "></span>
26
- <span v-else class="iconfont icon-bumenkaoqin"></span>
27
- <span :title="node.label">{{ node.label }}</span>
28
- </div>
29
- </span>
30
- </el-tree>
2
+ <div style="height:100%;width:100%">
3
+ <el-row>
4
+ <el-col
5
+ :span="24"
6
+ style="padding: 4px;"
7
+ >
8
+ <el-input
9
+ placeholder="请输入名称或编码"
10
+ v-model="searchName"
11
+ clearable
12
+ @clear="restart"
13
+ @change="searchTree"
14
+ @keyup.enter.native="searchTree"
15
+ suffix-icon="el-icon-search"
16
+ ></el-input>
17
+ </el-col>
18
+ </el-row>
19
+ <el-row style="overflow-y: auto;height:91%">
20
+ <div>
21
+ <el-tree
22
+ class="flow-tree"
23
+ :data="treeNode"
24
+ v-show="isShow"
25
+ node-key="id"
26
+ highlight-current
27
+ ref="tree"
28
+ :props="treeProps"
29
+ @node-click="handelrNodeClick"
30
+ :default-expanded-keys="defaultExpandedKeys"
31
+ >
32
+ <span
33
+ class="custom-tree-node cell-hidden"
34
+ slot-scope="{ node, data }"
35
+ >
36
+ <!-- 通过部门层级选择标签 -->
37
+ <div
38
+ :title="node.label"
39
+ class="cell-hidden"
40
+ >
41
+ <span
42
+ v-if="data.dLevel == 0"
43
+ class="iconfont icon-jigou "
44
+ ></span>
45
+ <span
46
+ v-else
47
+ class="iconfont icon-bumenkaoqin"
48
+ ></span>
49
+ <span :title="node.label">{{ node.label }}</span>
50
+ </div>
51
+ </span>
52
+ </el-tree>
53
+ <el-tree
54
+ v-show="!isShow"
55
+ :data="treeNodeSearch"
56
+ ref="treeSearch"
57
+ node-key="id"
58
+ :props="treeProps"
59
+ @node-click="handelrNodeClick"
60
+ highlight-current
61
+ :default-expanded-keys="defaultExpandedKeys"
62
+ >
63
+ <span
64
+ class="custom-tree-node span-ellipsis"
65
+ slot-scope="{ node, data }"
66
+ >
67
+ <span
68
+ v-if="data.dLevel == 0"
69
+ class="iconfont icon-jigou"
70
+ ></span>
71
+ <span
72
+ v-else
73
+ class="iconfont icon-bumenkaoqin"
74
+ ></span>
75
+ <span :title="node.label">{{ node.label }}</span>
76
+ </span>
77
+ </el-tree>
78
+ </div>
79
+ </el-row>
80
+ </div>
31
81
  </template>
32
82
  <script>
33
83
  import { Tree, Container } from 'element-ui';
34
84
  import axios from "cloud-module-base/packages/httpConfig/http";
35
85
  export default {
36
86
  //初始化数据
37
- data() {
87
+ data () {
38
88
  return {
39
89
  treeNode: [],
40
90
  treeData: [],
41
91
  defaultExpandedKeys: [],
92
+ treeNodeSearch: [],
93
+ searchName: '',
94
+ orgListUrl: "/api/identity/bpm-dept/tree-by-search", //组织机构列表筛选接口
95
+ orgUrl: '/api/identity/bpm-dept/tree-by-deptcodes', //组织机构树接口
42
96
  treeProps: {
43
97
  children: "children", //指定子树为节点对象的某个属性值
44
98
  label: "name", //指定节点标签为节点对象的某个属性值
45
99
  id: "id"
46
100
  },
101
+ isShow: true,
47
102
  id: "-1"
48
103
  };
49
104
  },
50
105
  components: {
51
- 'el-tree':Tree,
52
- 'el-container':Container
106
+ 'el-tree': Tree,
107
+ 'el-container': Container
108
+ },
109
+
110
+ props: {
111
+ opt: {
112
+ type: Object,
113
+ required: false
114
+ }
115
+ },
116
+ watch: {
117
+ opt: {
118
+ deep: true,
119
+ handler (opt) {
120
+ let _this = this;
121
+ let deptCodes = [];
122
+ opt.bpmUsers.forEach(bpmUser => {
123
+ if (bpmUser.deptCode && !deptCodes.includes(bpmUser.deptCode)) {
124
+ deptCodes.push(bpmUser.deptCode);
125
+ }
126
+ });
127
+ axios['bpm-engine']
128
+ .post(this.orgUrl, { deptCodes: deptCodes.join(',') })
129
+ .then(function (res) {
130
+
131
+ _this.treeNode = res.data;
132
+ console.log(_this.treeNode);
133
+ _this.defaultExpandedKeys.push(res.data[0].id);
134
+ _this.$emit('refreshGrid', res.data[0]);
135
+ })
136
+ .catch(function (err) {
137
+ console.log(err);
138
+ });
139
+ },
140
+ immediate: true
141
+ },
142
+ treeNode: {
143
+ deep: true,
144
+ handler (treeNode) {
145
+ console.log("333" + treeNode);
146
+ }
147
+ }
53
148
  },
54
149
  //方法
55
150
  methods: {
151
+ restart () {
152
+ let _this = this;
153
+ let param = {
154
+ page: this.currentPage,
155
+ rows: this.pageSize,
156
+ };
157
+ this.isShow = true;
158
+ _this.EventBus.$emit('refresh-source-grid', param);
159
+ },
56
160
  //请求方法
57
- loadNode(node, resolve) {
161
+ loadNode (node, resolve) {
58
162
  let _this = this;
59
163
  axios['system-manager']
60
164
  .post("/api/ou/org/tree", {
61
165
  id: node.data.id
62
166
  })
63
- .then(function(res) {
167
+ .then(function (res) {
64
168
  resolve(res.data);
65
169
  if (node.data.length == 0 && res.data.length > 0) {
66
- _this.defaultExpandedKeys.push(res.data[0].id);
170
+ _this.defaultExpandedKeys.push(res.data[0].id);
67
171
  // _this.$nextTick(() => {
68
172
  // _this.$refs.tree.setCurrentKey(res.data[0].id);
69
173
  // _this.EventBus.$emit("refreshGrid", res.data[0]); //EventBus事件总线,通过emit方法与父组件沟通。$emit触发当前实例上的所有事件
70
174
  // });
71
175
  }
72
176
  })
73
- .catch(function(err) {
177
+ .catch(function (err) {
74
178
  console.log(err);
75
179
  });
180
+
181
+
76
182
  },
77
183
 
78
184
  //节点点击事件
79
- handelrNodeClick(data) {
80
- this.EventBus.$emit("refreshGrid", data);
185
+ handelrNodeClick (treeNode) {
186
+
187
+ this.$emit('refreshGrid', treeNode);
188
+ },
189
+ searchTree () {
190
+ let _this = this;
191
+ if (_this.searchName == null || _this.searchName == '') {
192
+ _this.treeNodeSearch = [];
193
+ _this.isShow = true;
194
+ }
195
+
196
+ let deptCodes = [];
197
+ this.opt.bpmUsers.forEach(bpmUser => {
198
+ if (bpmUser.deptCode && !deptCodes.includes(bpmUser.deptCode)) {
199
+ deptCodes.push(bpmUser.deptCode);
200
+ }
201
+ });
202
+ _this.isShow = false;
203
+ axios['bpm-engine']
204
+ .post(this.orgListUrl, {
205
+ search: this.searchName,
206
+ deptCodes: deptCodes.join(',')
207
+ })
208
+ .then(function (res) {
209
+ _this.treeNodeSearch = res.data;
210
+ _this.$nextTick(() => {
211
+ _this.$refs.treeSearch.setCurrentKey(res.data[0].id);
212
+ });
213
+ _this.handelrNodeClick(res.data[0]);
214
+
215
+ })
216
+ .catch(function (err) {
217
+ console.log(err);
218
+ });
81
219
  }
82
220
  },
83
221
  //页面渲染之前调用方法 函数
84
- created() {},
222
+ created () { },
85
223
  //页面渲染完成调用方法 函数
86
- mounted() {}
224
+ mounted () {
225
+
226
+ }
87
227
  };
88
228
  </script>
89
229
  <style scoped>
90
-
91
230
  </style>
@@ -14,21 +14,32 @@
14
14
  <el-container>
15
15
  <el-aside style="height:456px;width:65%;margin-right: 0px;margin-left: 0px;background: #e8ecf3">
16
16
  <el-container>
17
- <el-aside style="height:456px;width: 35%;max-width: 400px;padding-top:5px;margin:0px;border-radius: 0px;">
18
- <v-tree />
17
+ <el-aside style="height:456px;width: 35%;max-width: 400px;margin:0px;border-radius: 0px;">
18
+ <v-tree
19
+ :opt="nextNode"
20
+ @refreshGrid="treeClickData"
21
+ />
19
22
  </el-aside>
20
23
  <!-- 待选择人员列表 -->
21
24
  <el-main style="height:456px; width: 45%; padding: 0px; margin-left: 2px;">
22
25
  <div class="selected-grid">
23
- <el-row>
26
+ <!-- <el-row>
24
27
  <el-col style="text-align: left;padding: 7px 7px 0 7px">
25
28
  {{ $t('bpm.jump.choice_activity') }}
26
29
  </el-col>
27
- </el-row>
30
+ </el-row> -->
28
31
  <el-row>
29
- <el-col align="center">{{ $t('bpm.jump.activity_name') }}
32
+ <el-col
33
+ :span="7"
34
+ style="float: left;padding-right: 40px;margin-top: 5px;padding-left: 7px;"
35
+ >{{ $t('bpm.jump.activity_name') }}</el-col>
36
+
37
+ <el-col
38
+ :span="17"
39
+ style="float:right;"
40
+ >
30
41
  <el-select
31
- style="width:200px"
42
+ style="width:225px"
32
43
  @change="handleChange"
33
44
  v-model="value"
34
45
  :placeholder="$t('bpm.jump.please_select')"
@@ -44,11 +55,35 @@
44
55
  </el-select>
45
56
  </el-col>
46
57
  </el-row>
47
- <el-row>
48
- <el-col style="text-align: left;padding: 7px 7px 0 7px">{{
49
- $t('bpm.jump.for_personnel')
50
- }}</el-col>
58
+ <el-row
59
+ justify="space-between"
60
+ style="padding: 5px;"
61
+ >
62
+ <el-col
63
+ :span="7"
64
+ style="float: left;padding-right: 40px;margin-top: 5px;padding-left: 2px;"
65
+ >{{ $t('base.list_alternatives') }}</el-col>
66
+ <el-col
67
+ :span="17"
68
+ style="float:right;"
69
+ >
70
+ <el-input
71
+ placeholder="请输入姓名或编码"
72
+ v-model="searchName"
73
+ clearable
74
+ @clear="restart"
75
+ @change="searchClickData"
76
+ >
77
+ <el-button
78
+ class="el-icon-search-button"
79
+ slot="append"
80
+ icon="el-icon-search"
81
+ @click="searchClickData"
82
+ ></el-button>
83
+ </el-input>
84
+ </el-col>
51
85
  </el-row>
86
+
52
87
  <el-table
53
88
  :data="initialTableData"
54
89
  :height="tableHeight"
@@ -241,6 +276,33 @@ export default {
241
276
  required: true
242
277
  }
243
278
  },
279
+ watch: {
280
+ ruleEngine: {
281
+ deep: true,
282
+ handler: function (newVal, old) {
283
+ if (newVal && newVal.runtime && newVal.runtime.nextNodes && newVal.runtime.nextNodes.length > 0) {
284
+
285
+
286
+ let nextNodeWatch = newVal.runtime.nextNodes[0];
287
+ this.total = nextNodeWatch.bpmUsers.length;
288
+ // this.sourceAllData = nextNodeWatch.bpmUsers || [];
289
+ // this.empTableData = this.sourceAllData.slice(
290
+ // this.pageSize * (this.currentPage - 1),
291
+ // this.pageSize * this.currentPage
292
+ // );
293
+ this.receiverIds = [];
294
+ nextNodeWatch.bpmUsers.forEach(bpmUser => {
295
+ var obj = {};
296
+ obj.name = bpmUser.name;
297
+ obj.code = bpmUser.code;
298
+ obj.deptName = bpmUser.deptName;
299
+ this.initialTableData.push(obj);
300
+ this.receiverIds.push(bpmUser.code);
301
+ });
302
+ }
303
+ }
304
+ }
305
+ },
244
306
  data () {
245
307
  return {
246
308
  currentRuleEngine: {},
@@ -250,6 +312,8 @@ export default {
250
312
  total: 10,
251
313
  tableHeight: 300,
252
314
  maxHeight: '483px',
315
+ searchName: '',
316
+ empUrl: '/api/identity/bpm-user/list-by-deptcode', //人员数据接口
253
317
  //默认参数
254
318
  opt: {
255
319
  title: this.$t('bpm.jump_latest.dialog_title')
@@ -260,6 +324,7 @@ export default {
260
324
  initialTableData: [],
261
325
  //选中的值
262
326
  selectTableData: [],
327
+ receiverIds: [],
263
328
  //下拉框
264
329
  options: [],
265
330
  value: '',
@@ -268,7 +333,8 @@ export default {
268
333
  //流程key
269
334
  toTaskDefKey: '',
270
335
  //批准类型
271
- approveType: ''
336
+ approveType: '',
337
+ nextNode: {}
272
338
  };
273
339
  },
274
340
  created () {
@@ -279,12 +345,12 @@ export default {
279
345
  //每页显示数据个数变化时调用
280
346
  handleSizeChange (val) {
281
347
  this.pageSize = val;
282
- this.treeClickData();
348
+ this.searchClickData();
283
349
  },
284
350
  //页码变化时调用
285
351
  handleCurrentChange (val) {
286
352
  this.currentPage = val;
287
- this.treeClickData();
353
+ this.searchClickData();
288
354
  },
289
355
 
290
356
  //============下拉框分页===========
@@ -447,15 +513,20 @@ export default {
447
513
  temRuleEngine
448
514
  )
449
515
  .then(function (res) {
516
+ _this.nextNode = res.data.runtime.nextNodes[0];
517
+ _this.receiverIds = [];
450
518
  if (res.data.runtime.nextNodes[0].bpmUsers.length > 0) {
519
+
520
+
451
521
  res.data.runtime.nextNodes[0].bpmUsers.forEach(element => {
452
522
  var obj = {};
453
523
  obj.name = element.name;
454
524
  obj.code = element.code;
455
525
  obj.deptName = element.deptName;
456
- _this.initialTableData.push(obj);
526
+ _this.receiverIds.push(element.code);
527
+ //_this.initialTableData.push(obj);
457
528
  });
458
- _this.total = _this.initialTableData.length;
529
+ //_this.total = _this.initialTableData.length;
459
530
  _this.approveType = res.data.approve.type;
460
531
  }
461
532
 
@@ -471,10 +542,13 @@ export default {
471
542
  _this.businessId = _this.ruleEngine.runtime.mainForm.businessId;
472
543
  _this.requestData();
473
544
  _this.selectTableData = [];
545
+
474
546
  },
475
547
  //关闭对话框
476
548
  handleClose () {
477
549
  this.options = [];
550
+ this.searchName = '';
551
+ this.treeNode = {};
478
552
  this.$emit('dialog-close', this.dialogVisible);
479
553
  },
480
554
  requestData () {
@@ -520,40 +594,136 @@ export default {
520
594
 
521
595
  _this.$emit('dialog-save', _this.ruleEngine);
522
596
  },
597
+ restart () {
523
598
 
524
- treeClickData () {
525
- var _this = this;
526
- axios['system-manager']
527
- .post('/api/ou/emp/listOrgUnselectedUserByOrg', {
528
- id: _this.treeNode.id,
529
- dLevelCode: _this.treeNode.dLevelCode,
530
- page: _this.currentPage,
531
- rows: _this.pageSize
599
+ handleChange(this.value);
600
+ },
601
+ treeClickData (treeNode) {
602
+ if (treeNode) {
603
+ this.treeNode = treeNode;
604
+ }
605
+
606
+ let _this = this;
607
+ let param = {
608
+ page: this.currentPage,
609
+ rows: this.pageSize,
610
+ deptCode: this.treeNode.code ? this.treeNode.code : this.treeNode.deptCode,
611
+ search: this.searchName,
612
+ userNames: this.receiverIds.join(',')
613
+ };
614
+ axios['bpm-engine']
615
+ .post(this.empUrl, param)
616
+ .then(function (res) {
617
+ if (res.success) {
618
+ _this.initialTableData = [];
619
+ res.data.rows.forEach(arr => {
620
+
621
+ var obj = {};
622
+ obj.name = arr.name;
623
+ obj.code = arr.code;
624
+ obj.deptName = arr.deptName;
625
+ _this.initialTableData.push(obj);
626
+ });
627
+ // _this.empTableData = res.data.rows;
628
+ _this.total = res.data.total;
629
+ _this.isShowPagination = true;
630
+ //必须等列表重新渲染完毕,才能执行此方法。
631
+
632
+ }
633
+ _this.loading = false;
532
634
  })
635
+ .catch(function (err) {
636
+ console.log(err);
637
+ });
638
+ // var _this = this;
639
+ // axios['system-manager']
640
+ // .post('/api/ou/emp/listOrgUnselectedUserByOrg', {
641
+ // id: _this.treeNode.id,
642
+ // dLevelCode: _this.treeNode.dLevelCode,
643
+ // page: _this.currentPage,
644
+ // rows: _this.pageSize,
645
+ // name: _this.searchName
646
+ // })
647
+ // .then(function (res) {
648
+ // if (res.status == '1') {
649
+ // _this.initialTableData = [];
650
+ // res.data.rows.forEach(arr => {
651
+
652
+ // var obj = {};
653
+ // obj.name = arr.name;
654
+ // obj.code = arr.code;
655
+ // obj.deptName = arr.deptName;
656
+ // _this.initialTableData.push(obj);
657
+ // });
658
+ // _this.total = res.data.total;
659
+ // _this.isShowPagination = true;
660
+ // }
661
+ // });
662
+ },
663
+ searchClickData () {
664
+ let _this = this;
665
+ let param = {
666
+ page: this.currentPage,
667
+ rows: this.pageSize,
668
+ deptCode: this.treeNode.code ? this.treeNode.code : this.treeNode.deptCode,
669
+ search: this.searchName,
670
+ userNames: this.receiverIds.join(',')
671
+ };
672
+ axios['bpm-engine']
673
+ .post(this.empUrl, param)
533
674
  .then(function (res) {
534
- if (res.status == '1') {
675
+ if (res.success) {
535
676
  _this.initialTableData = [];
536
677
  res.data.rows.forEach(arr => {
678
+
537
679
  var obj = {};
538
680
  obj.name = arr.name;
539
681
  obj.code = arr.code;
540
682
  obj.deptName = arr.deptName;
541
683
  _this.initialTableData.push(obj);
542
684
  });
685
+ // _this.empTableData = res.data.rows;
543
686
  _this.total = res.data.total;
544
687
  _this.isShowPagination = true;
688
+ //必须等列表重新渲染完毕,才能执行此方法。
689
+
545
690
  }
691
+ _this.loading = false;
692
+ })
693
+ .catch(function (err) {
694
+ console.log(err);
546
695
  });
696
+ // var _this = this;
697
+ // axios['system-manager']
698
+ // .post('/api/ou/emp/listOrgUnselectedUserByOrg', {
699
+ // id: _this.treeNode.id,
700
+ // dLevelCode: _this.treeNode.dLevelCode,
701
+ // page: _this.currentPage,
702
+ // rows: _this.pageSize,
703
+ // name: _this.searchName
704
+ // })
705
+ // .then(function (res) {
706
+ // if (res.status == '1') {
707
+ // _this.initialTableData = [];
708
+ // res.data.rows.forEach(arr => {
709
+
710
+ // var obj = {};
711
+ // obj.name = arr.name;
712
+ // obj.code = arr.code;
713
+ // obj.deptName = arr.deptName;
714
+ // _this.initialTableData.push(obj);
715
+ // });
716
+ // _this.total = res.data.total;
717
+ // _this.isShowPagination = true;
718
+ // }
719
+ // });
547
720
  }
548
721
  },
549
722
 
550
723
  mounted () {
551
- var _this = this;
552
- this.EventBus.$on('refreshGrid', treeNode => {
553
- _this.treeNode = treeNode;
554
- _this.currentPage = 1;
555
- _this.treeClickData();
556
- });
724
+
725
+
726
+
557
727
  }
558
728
  };
559
729
  </script>