@lambo-design-mobile/workflow-approve 1.0.0-beta.1 → 1.0.0-beta.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.
package/CHANGELOG.md CHANGED
@@ -1,8 +1,12 @@
1
1
  # Changelog
2
- ## 1.0.0-beta.1 (2024-10-09)
2
+ ## [1.0.0-beta.3](http://git.inspur.com/ecbh/lambo-design/lambo-design/-/compare/@lambo-design-mobile/workflow-approve@1.0.0-beta.2...@lambo-design-mobile/workflow-approve@1.0.0-beta.3) (2024-11-04)
3
3
 
4
+ ## [1.0.0-beta.2](http://git.inspur.com/ecbh/lambo-design/lambo-design/-/compare/@lambo-design-mobile/workflow-approve@1.0.0-beta.1...@lambo-design-mobile/workflow-approve@1.0.0-beta.2) (2024-10-10)
4
5
 
5
- ### Features | 新功能
6
-
7
- * **@lambo-design-mobile/workflow-approve:** 新增流程中心移动端组件 ([bcdf45c](http://git.inspur.com/ecbh/lambo-design/lambo-design/-/commit/bcdf45cb682e1ea5f3205b473a2c04060a660460))
8
- * **@lambo-design-mobile/workflow-approve:** 新增流程中心移动端组件 ([14df440](http://git.inspur.com/ecbh/lambo-design/lambo-design/-/commit/14df44002a9b20f6cb979bebc8902b5cd78bb57f))
6
+ ## 1.0.0-beta.1 (2024-10-09)
7
+
8
+
9
+ ### Features | 新功能
10
+
11
+ * **@lambo-design-mobile/workflow-approve:** 新增流程中心移动端组件 ([bcdf45c](http://git.inspur.com/ecbh/lambo-design/lambo-design/-/commit/bcdf45cb682e1ea5f3205b473a2c04060a660460))
12
+ * **@lambo-design-mobile/workflow-approve:** 新增流程中心移动端组件 ([14df440](http://git.inspur.com/ecbh/lambo-design/lambo-design/-/commit/14df44002a9b20f6cb979bebc8902b5cd78bb57f))
package/README.md CHANGED
@@ -1,39 +1,3 @@
1
1
  # 工作流
2
-
3
- ### 介绍
4
-
5
-
6
-
7
- ### 引入
8
-
9
- ``` javascript
10
-
11
- ```
12
-
13
- ## 代码演示
14
-
15
- ### 基础用法
16
-
17
- ```html
18
- ```
19
-
20
- ```javascript
21
-
22
-
23
- ```
24
-
25
-
26
-
27
-
28
- ### Props
29
-
30
- | 参数 | 说明 | 类型 | 默认值 | 版本 |
31
- |------------------|-------------------|---------|------------------|----|
32
-
33
-
34
-
35
- ### Events
36
-
37
- | 事件名 | 说明 | 回调参数 |
38
- |------------------|------------|-------|
39
-
2
+ 【腾讯文档】移动端工作流组件库
3
+ https://docs.qq.com/aio/DRGlBZFd5UVRWQU9C
package/api.js CHANGED
@@ -243,6 +243,17 @@ export const batchApproval = (status, flowIds, auditOpinion) => {
243
243
  }));
244
244
  }
245
245
 
246
+ export const getProcessType = (proType) => {
247
+ const params = {
248
+ proType: proType,
249
+ };
250
+ return ajax.request({
251
+ url: config.smartFlowServerContext + "/manage/processType/lists",
252
+ method: 'get',
253
+ params: params
254
+ })
255
+ }
256
+
246
257
  export const getUserList = (offset, limit, searchForm = {}) => {
247
258
 
248
259
  // 处理 searchForm 的各个字段,确保即使未传值也有默认空字符串
@@ -250,7 +261,7 @@ export const getUserList = (offset, limit, searchForm = {}) => {
250
261
  offset: offset,
251
262
  limit: limit,
252
263
  orgTreeType: "00",
253
- permScopeList: "all",
264
+ permScopeList: searchForm.permScopeList || 'all',
254
265
  userId: searchForm.userId || '',
255
266
  userName: searchForm.userName || '',
256
267
  organId: searchForm.organId || '',
@@ -274,4 +285,45 @@ export const getOrgRootTree = () => {
274
285
  method: 'get',
275
286
  params: params,
276
287
  });
288
+ }
289
+
290
+ export const getOrgSubNodes = (organCode) => {
291
+ const params = {
292
+ treeTypeId: "00",
293
+ organCode: organCode,
294
+ };
295
+ return ajax.request({
296
+ url: config.upmsServerContext + "/manage/ucOrgan/getOrgSubNodes",
297
+ method: 'get',
298
+ params: params,
299
+ });
300
+ }
301
+
302
+ export const getPosition = (positionId) => {
303
+ const params = {
304
+ positionId: positionId,
305
+ };
306
+ return ajax.request({
307
+ url: config.smartFlowServerContext + "/manage/position/get",
308
+ method: 'get',
309
+ params: params
310
+ })
311
+ }
312
+
313
+ export const getRole = (roleId) => {
314
+ return ajax.request({
315
+ url: config.upmsServerContext + "/manage/role/get/" + roleId,
316
+ method: 'get',
317
+ })
318
+ }
319
+
320
+ export const getOrgan = (organId) => {
321
+ const data = {
322
+ orgTreeType: "00",
323
+ };
324
+ return ajax.request({
325
+ url: config.upmsServerContext + "/manage/org/get/" + organId,
326
+ method: 'post',
327
+ data
328
+ })
277
329
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lambo-design-mobile/workflow-approve",
3
- "version": "1.0.0-beta.1",
3
+ "version": "1.0.0-beta.3",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "author": "lambo",
@@ -14,8 +14,8 @@
14
14
  },
15
15
  "devDependencies": {
16
16
  "@lambo-design-mobile/lambo-scan-code": "^1.0.0-beta.1",
17
- "@lambo-design-mobile/upload-file": "^1.0.0-beta.9",
18
- "@lambo-design-mobile/shared": "^1.0.0-beta.8"
17
+ "@lambo-design-mobile/shared": "^1.0.0-beta.9",
18
+ "@lambo-design-mobile/upload-file": "^1.0.0-beta.9"
19
19
  },
20
20
  "scripts": {
21
21
  "release": "pnpm release-beta && git push --follow-tags && pnpm re-publish",
@@ -195,18 +195,18 @@
195
195
  :is-link="true" :arrow-direction="detailsVisible[index] ? 'down' : ''">
196
196
  </van-cell>
197
197
  <div v-if="detailsVisible[index] && item.personType === 'candidate'">
198
- <van-cell @click="clickCandidateGroup()" title-style="padding-left:10px" title="候选用户"
199
- :value="(item.candidateGroups?.users ?? []).map(user => user.name).join(',')">
200
- </van-cell>
201
- <van-cell @click="clickCandidateGroup()" title-style="padding-left:10px" title="候选岗位"
202
- :value="(item.candidateGroups?.positions ?? []).map(position => position.name).join(',')">
203
- </van-cell>
204
- <van-cell @click="clickCandidateGroup()" title-style="padding-left:10px" title="候选角色"
205
- :value="(item.candidateGroups?.roles ?? []).map(role => role.name).join(',')">
206
- </van-cell>
207
- <van-cell @click="clickCandidateGroup()" title-style="padding-left:10px" title="候选组织"
208
- :value="(item.candidateGroups?.organs ?? []).map(organ => organ.name).join(',')">
209
- </van-cell>
198
+ <van-field @click="handleSelectUserPopupShow(index)" label="候选用户" readonly placeholder="点击选择"
199
+ :value="(item.candidateGroups?.users ?? []).map(user => user.name).join(',')">
200
+ </van-field>
201
+ <van-field @click="handleSelectPositionPopupShow(index)" label="候选岗位" readonly placeholder="点击选择"
202
+ :value="(item.candidateGroups?.positions ?? []).map(position => position.name).join(',')">
203
+ </van-field>
204
+ <van-field @click="handleSelectRolePopupShow(index)" label="候选角色" readonly placeholder="点击选择"
205
+ :value="(item.candidateGroups?.roles ?? []).map(role => role.name).join(',')">
206
+ </van-field>
207
+ <van-field @click="handleSelectOrganizePopupShow(index)" label="候选组织" readonly placeholder="点击选择"
208
+ :value="(item.candidateGroups?.organs ?? []).map(organ => organ.name).join(',')">
209
+ </van-field>
210
210
  </div>
211
211
  <van-cell center title="停留时间">
212
212
  <template #default>
@@ -260,9 +260,25 @@
260
260
  <div class="bar-item approve" @click="handleSelect('select')">确认</div>
261
261
  </div>
262
262
  </van-popup>
263
- <van-popup v-model="selectHandlePopupShow" closeable round position="bottom"
263
+ <van-popup v-if="selectHandlePopupShow" v-model="selectHandlePopupShow" closeable round position="bottom"
264
264
  :style="{ height: '80%' }" style="background: #f7f8fa">
265
- <select-handle @selectHandle="handleSelectResult"></select-handle>
265
+ <select-handle title="指定办理人" :multi-select="false" :procType="procType" @selectHandle="handleSelectResult"></select-handle>
266
+ </van-popup>
267
+ <van-popup v-if="selectOrganizePopupShow" v-model="selectOrganizePopupShow" closeable round position="bottom"
268
+ :style="{ height: '80%' }">
269
+ <select-organize ref="selectOrganize" :all-organize="false" :organize-id-list="permissionsScope.O" @selectOrganizeHandle="selectOrganizeHandle" ></select-organize>
270
+ </van-popup>
271
+ <van-popup v-if="selectUserPopupShow" v-model="selectUserPopupShow" closeable round position="bottom"
272
+ :style="{ height: '80%' }">
273
+ <select-handle title="选择用户" :multi-select="true" :procType="procType" @selectHandle="selectUserHandle" ></select-handle>
274
+ </van-popup>
275
+ <van-popup v-if="selectPositionPopupShow" v-model="selectPositionPopupShow" closeable round position="bottom"
276
+ :style="{ height: '80%' }">
277
+ <select-normal-list title="选择岗位" :id-list="permissionsScope.P" @selectNormalListHandle="selectPositionHandle" :parse-function="parsePositionFunction"></select-normal-list>
278
+ </van-popup>
279
+ <van-popup v-if="selectRolePopupShow" v-model="selectRolePopupShow" closeable round position="bottom"
280
+ :style="{ height: '80%' }">
281
+ <select-normal-list title="选择角色" :id-list="permissionsScope.R" @selectNormalListHandle="selectRoleHandle" :parse-function="parseRoleFunction"></select-normal-list>
266
282
  </van-popup>
267
283
  <van-dialog v-model="nodeListDialogShow" @confirm="processJumpSpecifiedNode()" @close="nodeListDialogShowClose()"
268
284
  :title="getAuditButtonStatus(auditResult)" show-cancel-button>
@@ -297,18 +313,24 @@
297
313
 
298
314
  <script>
299
315
  import {
300
- audit, config,
316
+ audit,
317
+ config,
301
318
  getAllPreNodes,
302
319
  getAttachmentList,
303
320
  getNextNodes,
304
321
  getNodesBehind,
322
+ getPosition,
305
323
  getPreNode,
306
- getProcessHis
324
+ getProcessHis,
325
+ getProcessType, getRole
307
326
  } from "../api";
308
327
  import {Dialog, Toast} from "vant";
309
328
  import UploadFile from '@lambo-design-mobile/upload-file';
310
329
  import {flutterUtil} from "./utils/flutterUtil";
311
330
  import SelectHandle from "./SelectHandle.vue";
331
+ import Tree from "./tree/Tree.vue";
332
+ import SelectOrganize from "./SelectOrganize.vue";
333
+ import SelectNormalList from "./SelectNormalList.vue";
312
334
 
313
335
 
314
336
  export default {
@@ -317,7 +339,7 @@ export default {
317
339
  return config
318
340
  }
319
341
  },
320
- components: {SelectHandle, UploadFile},
342
+ components: {SelectNormalList, SelectOrganize, Tree, SelectHandle, UploadFile},
321
343
  props: {
322
344
  //业务表单保存方法
323
345
  businessFormSave: {
@@ -348,6 +370,7 @@ export default {
348
370
  //初始化路由数据
349
371
  taskNode: this.$route.query.taskNode,
350
372
  procId: this.$route.query.procId,
373
+ procType: this.$route.query.procType,
351
374
  instanceId: this.$route.query.instanceId,
352
375
  applyId: this.$route.query.applyId,
353
376
  formUrl: this.$route.query.formUrl,
@@ -404,7 +427,13 @@ export default {
404
427
  //给附件列表展示
405
428
  files: [],
406
429
  //文件上传列表
407
- fileList: []
430
+ fileList: [],
431
+
432
+ permissionsScope: {},
433
+ selectOrganizePopupShow: false,
434
+ selectUserPopupShow: false,
435
+ selectRolePopupShow: false,
436
+ selectPositionPopupShow: false,
408
437
  };
409
438
  },
410
439
  methods: {
@@ -412,6 +441,7 @@ export default {
412
441
  this.getProcessHistory();
413
442
  this.getNextNodes();
414
443
  this.getAttachmentList();
444
+ this.getProcessTypeList();
415
445
  //设置提示持续时间默认为500ms
416
446
  Toast.setDefaultOptions({duration: 500});
417
447
  },
@@ -434,6 +464,77 @@ export default {
434
464
  }
435
465
  })
436
466
  },
467
+ getProcessTypeList() {
468
+ getProcessType(this.procType).then(res => {
469
+ let permScope = res.data.data.rows[0].permScope;
470
+ this.permissionsScope = this.extractPermissions(permScope);
471
+ });
472
+ },
473
+ extractPermissions(permScope) {
474
+ const permissions = {};
475
+
476
+ // 使用正则分别匹配 O、U、P 和 R
477
+ const oMatch = permScope.match(/O:([^,]*)/);
478
+ const uMatch = permScope.match(/U:([^,]*)/);
479
+ const pMatch = permScope.match(/P:([^,]*)/);
480
+ const rMatch = permScope.match(/R:([^,]*)/);
481
+
482
+ // 分别解析 O、U、P 和 R 权限
483
+ permissions.O = oMatch && oMatch[1] ? oMatch[1].split(';') : [];
484
+ permissions.U = uMatch && uMatch[1] ? uMatch[1].split(';') : [];
485
+ permissions.P = pMatch && pMatch[1] ? pMatch[1].split(';') : [];
486
+ permissions.R = rMatch && rMatch[1] ? rMatch[1].split(';') : [];
487
+
488
+ return permissions;
489
+ },
490
+ async parsePositionFunction(idList) {
491
+ try {
492
+ // 并行调用 getPosition 方法
493
+ return await Promise.all(
494
+ idList.map(async (id) => {
495
+ const response = await getPosition(id);
496
+ const result = response.data; // 假设响应的主体包含在 data 中
497
+
498
+ // 返回 { id, name } 对象
499
+ return {
500
+ id: id,
501
+ name: result.data.positionName || `Unknown Name for ${id}`, // 使用返回数据中的 name,若无则提供默认值
502
+ };
503
+ })
504
+ ); // 返回解析结果数组
505
+ } catch (error) {
506
+ console.error('Error fetching positions:', error);
507
+ // 在错误情况下返回默认结构
508
+ return idList.map((id) => ({
509
+ id: id,
510
+ name: `Unknown Name for ${id}`,
511
+ }));
512
+ }
513
+ },
514
+ async parseRoleFunction(idList) {
515
+ try {
516
+ // 并行调用 getPosition 方法
517
+ return await Promise.all(
518
+ idList.map(async (id) => {
519
+ const response = await getRole(id);
520
+ const result = response.data; // 假设响应的主体包含在 data 中
521
+
522
+ // 返回 { id, name } 对象
523
+ return {
524
+ id: id,
525
+ name: result.data.name || `Unknown Name for ${id}`, // 使用返回数据中的 name,若无则提供默认值
526
+ };
527
+ })
528
+ ); // 返回解析结果数组
529
+ } catch (error) {
530
+ console.error('Error fetching positions:', error);
531
+ // 在错误情况下返回默认结构
532
+ return idList.map((id) => ({
533
+ id: id,
534
+ name: `Unknown Name for ${id}`,
535
+ }));
536
+ }
537
+ },
437
538
  processData(data) {
438
539
  return data.map(node => {
439
540
  node.personType = node.assignee ? "assignee" : "candidate";
@@ -527,6 +628,22 @@ export default {
527
628
  this.nextNodePopupShow = false;
528
629
  }
529
630
  },
631
+ handleSelectOrganizePopupShow(index) {
632
+ this.nextNodeHandleIndex = index;
633
+ this.selectOrganizePopupShow=true;
634
+ },
635
+ handleSelectUserPopupShow(index) {
636
+ this.nextNodeHandleIndex = index;
637
+ this.selectUserPopupShow=true;
638
+ },
639
+ handleSelectRolePopupShow(index) {
640
+ this.nextNodeHandleIndex = index;
641
+ this.selectRolePopupShow = true;
642
+ },
643
+ handleSelectPositionPopupShow(index) {
644
+ this.nextNodeHandleIndex = index;
645
+ this.selectPositionPopupShow = true;
646
+ },
530
647
  getAttachmentList() {
531
648
  getAttachmentList(this.procId, this.applyId).then(resp => {
532
649
  if (resp.data.code === '200') {
@@ -604,6 +721,8 @@ export default {
604
721
  query: {
605
722
  applyId: this.applyId,
606
723
  procId: this.procId,
724
+ instanceId: this.instanceId,
725
+ taskNode: this.taskNode,
607
726
  }
608
727
  })
609
728
  },
@@ -821,6 +940,44 @@ export default {
821
940
  }
822
941
  self.selectHandlePopupShow = false;
823
942
  },
943
+ selectOrganizeHandle(handle, checkedNodes) {
944
+ if (handle === 'select') {
945
+ this.nextNodeProcessedData[this.nextNodeHandleIndex].candidateGroups.organs =
946
+ checkedNodes.map(item => ({
947
+ name: item.node.title,
948
+ id: item.node.id,
949
+ }));
950
+ }
951
+ this.selectOrganizePopupShow = false
952
+ },
953
+ selectUserHandle(checkResult) {
954
+ this.nextNodeProcessedData[this.nextNodeHandleIndex].candidateGroups.users =
955
+ checkResult.map(item => ({
956
+ name: item.userName,
957
+ id: item.userId,
958
+ }));
959
+ this.selectUserPopupShow = false;
960
+ },
961
+ selectPositionHandle(handle, result) {
962
+ if (handle === 'select') {
963
+ this.nextNodeProcessedData[this.nextNodeHandleIndex].candidateGroups.positions =
964
+ result.map(item => ({
965
+ name: item.name,
966
+ id: item.id,
967
+ }));
968
+ }
969
+ this.selectPositionPopupShow = false
970
+ },
971
+ selectRoleHandle(handle, result) {
972
+ if (handle === 'select') {
973
+ this.nextNodeProcessedData[this.nextNodeHandleIndex].candidateGroups.roles =
974
+ result.map(item => ({
975
+ name: item.name,
976
+ id: item.id,
977
+ }));
978
+ }
979
+ this.selectRolePopupShow = false
980
+ },
824
981
  },
825
982
  activated() {
826
983
  this.updateActiveTab();
@@ -2,7 +2,7 @@
2
2
  <div>
3
3
  <div id="headTitle" class="headTitle">
4
4
  <div class="van-nav-bar__content">
5
- <div class="van-nav-bar__title">指定办理人</div>
5
+ <div class="van-nav-bar__title">{{title}}</div>
6
6
  </div>
7
7
  <van-search
8
8
  show-action
@@ -28,8 +28,8 @@
28
28
  :overlay-style="{ position:'absolute',marginTop: '104px'}" transition="none">
29
29
  <div style="padding: 12px">
30
30
  <van-form>
31
- <van-field clearable v-model="searchForm.organId" label="组织ID" readonly />
32
- <van-field clearable v-model="searchForm.organTitle" label="组织名称" readonly />
31
+ <van-field clearable @click="searchOrganShow = true" v-model="searchForm.organId" label="组织ID" readonly />
32
+ <van-field clearable @click="searchOrganShow = true" v-model="searchForm.organTitle" label="组织名称" readonly />
33
33
  <van-field clearable v-model="searchForm.userId" label="用户ID" placeholder="请输入用户ID"/>
34
34
  <van-field name="radio" label="是否管理员">
35
35
  <template #input>
@@ -47,12 +47,12 @@
47
47
  </van-form>
48
48
  </div>
49
49
  </van-popup>
50
- <div id="listContent">
50
+ <div id="listContent" style="background: #f7f8fa">
51
51
  <van-list v-model="loading" style="padding-top: 15px"
52
52
  :finished="finished"
53
53
  finished-text="没有更多了"
54
54
  @load="handleLoad()">
55
- <select-handle-card ref="selectHandleCard" :person-list="personList.rows"
55
+ <select-handle-card ref="selectHandleCard" :multi-select="multiSelect" :person-list="personList.rows"
56
56
  :result.sync="checkResult">
57
57
  </select-handle-card>
58
58
  </van-list>
@@ -61,23 +61,45 @@
61
61
  <div class="bar-item" @click="handleSelect('cancel')">取消</div>
62
62
  <div class="bar-item approve" @click="handleSelect('select')">选择</div>
63
63
  </div>
64
+
65
+ <van-popup v-model="searchOrganShow" closeable round position="bottom" :style="{ height: '80%' }">
66
+ <select-organize :all-organize="true" :show-check-box="false" @handleSelect="onSelect" ></select-organize>
67
+ </van-popup>
64
68
  </div>
65
69
  </template>
66
70
 
67
71
  <script>
68
72
  import SelectHandleCard from "./SelectHandleCard.vue";
69
- import {getOrgRootTree, getUserList} from "../api";
73
+ import {getOrgRootTree, getProcessType, getUserList} from "../api";
74
+ import Tree from "./tree/Tree.vue";
75
+ import SelectOrganize from "./SelectOrganize.vue";
70
76
 
71
77
  export default {
72
78
  name: "SelectHandle",
73
- components: {SelectHandleCard},
79
+ components: {SelectOrganize, Tree, SelectHandleCard},
80
+ props: {
81
+ title: {
82
+ type: String,
83
+ default: ''
84
+ },
85
+ procType: {
86
+ type: String,
87
+ required: true
88
+ },
89
+ multiSelect: { // 新增一个 prop 来控制是否开启多选模式
90
+ type: Boolean,
91
+ default: false
92
+ }
93
+ },
74
94
  data() {
75
95
  return {
96
+ searchOrganShow: false,
76
97
  searchFilterShow: false,
77
98
  searchFilterBadge: false,
78
99
  searchForm: {
79
100
  userId: '',
80
101
  userName: '',
102
+ permScopeList: '',
81
103
  organId: '',
82
104
  organTitle: '',
83
105
  directChild: '',
@@ -91,43 +113,64 @@ export default {
91
113
  rows: []
92
114
  },
93
115
  checkResult: [], // 需要传递到子组件的 checkResult
94
- }
116
+ };
117
+ },
118
+ mounted() {
119
+ this.initSearch();
95
120
  },
96
121
  methods: {
97
- handleLoad() {
98
- console.log("触发加载")
122
+ initSearch() {
99
123
  getOrgRootTree().then(res => {
100
124
  const result = res.data;
101
125
  if (result.code === 1) {
102
126
  this.searchForm.organId = result.data[0].organId;
103
127
  this.searchForm.organTitle = result.data[0].organName;
128
+ }
129
+ this.handleLoad()
130
+ })
131
+ },
132
+ handleLoad() {
133
+ console.log("触发加载")
134
+ const offset = this.personList.rows.length;
135
+ const limit = 10;
104
136
 
105
- const offset = this.personList.rows.length;
106
- const limit = 10;
107
-
108
- getUserList(offset, limit, this.searchForm).then(res => {
109
-
110
- const result = res.data;
111
- if (result.code === "1") {
137
+ getProcessType(this.procType).then(res => {
112
138
 
113
- //返回的数据添加到 personList
114
- this.personList.rows = this.personList.rows.concat(result.data.rows);
115
- this.personList.total = result.data.total;
139
+ const userArray = this.extractUsers(res.data.data.rows[0].permScope);
140
+ console.log(userArray)
141
+ if (userArray.length > 0) {
142
+ this.searchForm.permScopeList = userArray.join(',')
143
+ }
144
+ getUserList(offset, limit, this.searchForm).then(res => {
116
145
 
117
- } else {
118
- console.error('Failed to load data');
119
- }
146
+ const result = res.data;
147
+ if (result.code === "1") {
148
+ //返回的数据添加到 personList 中
149
+ this.personList.rows = this.personList.rows.concat(result.data.rows);
150
+ this.personList.total = result.data.total;
151
+ }
120
152
 
121
- this.loading = false;
122
- this.finished = this.personList.rows.length >= this.personList.total;
153
+ this.loading = false;
154
+ this.finished = this.personList.rows.length >= this.personList.total;
123
155
 
124
- }).catch(error => {
125
- console.error('Error fetching data:', error);
126
- this.loading = false;
127
- });
128
- }
156
+ }).catch(error => {
157
+ console.error('Error fetching data:', error);
158
+ this.loading = false;
159
+ });
160
+ }).catch(error => {
161
+ console.error(error)
129
162
  })
130
163
  },
164
+
165
+ extractUsers(permScope) {
166
+ const match = permScope.match(/U:([^,]+)/);
167
+ if (match && match[1]) {
168
+ return match[1].split(';');
169
+ } else {
170
+ return [];
171
+ }
172
+ },
173
+
131
174
  onSearch() {
132
175
  // 如果搜索弹框是打开的
133
176
  if (this.searchFilterShow) {
@@ -148,15 +191,7 @@ export default {
148
191
  }
149
192
  },
150
193
  resetSearch() {
151
- // 遍历 searchForm 对象的每个属性,将其值置为空
152
- for (let key in this.searchForm) {
153
- // eslint-disable-next-line no-prototype-builtins
154
- if (this.searchForm.hasOwnProperty(key)) {
155
- if (key !== "organId" && key !== "organTitle") {
156
- this.searchForm[key] = '';
157
- }
158
- }
159
- }
194
+ this.initSearch()
160
195
  },
161
196
  resetAndLoadPersonList() {
162
197
  this.personList.total = 0;
@@ -174,6 +209,12 @@ export default {
174
209
  checkSearchForm() {
175
210
  this.searchFilterBadge = Object.values(this.searchForm).some(value => value !== '');
176
211
  },
212
+
213
+ onSelect(v) {
214
+ this.searchForm.organId = v.id;
215
+ this.searchForm.organTitle = v.title;
216
+ this.searchOrganShow = false;
217
+ },
177
218
  },
178
219
  watch: {
179
220
  // 监听 searchForm 的每一个字段的变化
@@ -265,6 +306,7 @@ export default {
265
306
  color: #fff;
266
307
  background: linear-gradient(90deg, #0096FF, #1677FF);
267
308
  border-radius: 9px;
309
+ margin: 0 20px;
268
310
  }
269
311
 
270
312
  .approve:active {