@ebiz/designer-components 0.1.57 → 0.1.59

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,6 +1,6 @@
1
1
  {
2
2
  "name": "@ebiz/designer-components",
3
- "version": "0.1.57",
3
+ "version": "0.1.59",
4
4
  "private": false,
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -218,7 +218,10 @@ const handleApproverSelect = (data: []) => {
218
218
 
219
219
  // 处理抄送人选择
220
220
  const handleCCSelect = (data: []) => {
221
- selectedCC.value = data;
221
+ // 合并之前的数据,并且去重
222
+ selectedCC.value = [...selectedCC.value, ...data].filter((item, index, self) =>
223
+ self.findIndex(t => t == item) === index
224
+ );
222
225
  }
223
226
 
224
227
  // 移除人员
@@ -244,7 +247,7 @@ const handleAddCC = () => {
244
247
 
245
248
 
246
249
  // 监听查询条件变化
247
- watch([() => props.type, () => props.value, () => props.showRootOrg, () => props.childDeptEnable,()=>props.workFlowKey], () => {
250
+ watch([() => props.type, () => props.value, () => props.showRootOrg, () => props.childDeptEnable, () => props.workFlowKey], () => {
248
251
  fetchEmployeeList()
249
252
  }, { immediate: true })
250
253
  </script>
@@ -35,84 +35,92 @@
35
35
  <div class="simple-approval-steps">
36
36
  <!-- 节点步骤 -->
37
37
  <div v-for="(node, index) in state.nodes" :key="'node-' + index" class="simple-step-item">
38
- <div class="step-header">
39
- <div class="step-icon" :class="getSimpleStepIconClass(node)">
40
- <t-icon name="user" size="12px" color="white" />
41
- </div>
42
- <div class="step-info">
43
- <div class="step-title-row">
44
- <span class="step-title">{{ node.nodeName }}</span>
45
- <t-tag :theme="getNodeStatusTheme(node)" size="small">
46
- {{ getNodeStatusText(node) }}
47
- </t-tag>
38
+
39
+ <div
40
+ v-if="node.nodeStatus == 'PENDING' && getPendingApprovers(node).length === 0 && state.processInfo.processStatus != 'ACTIVE'">
41
+ </div>
42
+ <div v-else>
43
+ <div class="step-header">
44
+ <div class="step-icon" :class="getSimpleStepIconClass(node)">
45
+ <t-icon name="user" size="12px" color="white" />
46
+ </div>
47
+ <div class="step-info">
48
+ <div class="step-title-row">
49
+ <span class="step-title">{{ node.nodeName }}</span>
50
+ <t-tag :theme="getNodeStatusTheme(node)" size="small">
51
+ {{ getNodeStatusText(node) }}
52
+ </t-tag>
53
+ </div>
48
54
  </div>
49
55
  </div>
50
- </div>
51
56
 
52
- <!-- 简化的审批人信息 -->
53
- <div class="step-content">
54
- <!-- 已完成节点 -->
55
- <div v-for="approver in getCompletedApprovers(node)"
56
- :key="approver.nodeUser?.userId || approver.userId" class="simple-approver-wrapper">
57
- <div class="simple-approver">
58
- <!-- 操作用户信息 -->
59
- <div class="approver-user-info">
60
- <user-info :userId="approver.nodeUser?.userId || approver.userId"
61
- :userInfo="getUserInfo(approver)" avatar-size="small" name-size="small"
62
- :show-department="false" />
63
- </div>
57
+ <!-- 简化的审批人信息 -->
58
+ <div class="step-content">
59
+ <!-- 已完成节点 -->
60
+ <div v-for="approver in getCompletedApprovers(node)"
61
+ :key="approver.nodeUser?.userId || approver.userId" class="simple-approver-wrapper">
62
+ <div class="simple-approver">
63
+ <!-- 操作用户信息 -->
64
+ <div class="approver-user-info">
65
+ <user-info :userId="approver.nodeUser?.userId || approver.userId"
66
+ :userInfo="getUserInfo(approver)" avatar-size="small" name-size="small"
67
+ :show-department="false" />
68
+ </div>
64
69
 
65
- <!-- 操作类型和时间 -->
66
- <div class="approver-action-info">
67
- <div class="action-type">{{ getOperationTypeText(approver) }}</div>
68
- <div class="approver-time">{{ formatTime(approver.operation?.operationTime ||
69
- approver.completedTime || approver.endTime) }}</div>
70
+ <!-- 操作类型和时间 -->
71
+ <div class="approver-action-info">
72
+ <div class="action-type">{{ getOperationTypeText(approver) }}</div>
73
+ <div class="approver-time">{{ formatTime(approver.operation?.operationTime
74
+ ||
75
+ approver.completedTime || approver.endTime) }}</div>
76
+ </div>
70
77
  </div>
71
- </div>
72
78
 
73
- <!-- 目标用户信息(转审、加签等操作) -->
74
- <div v-if="approver.targetUsers && needShowTargetUser(approver)"
75
- class="target-user-info">
76
- <div class="target-label">{{ getTargetUserLabel(approver) }}</div>
77
- <div style="display: flex; flex-direction: column; gap: 4px;">
78
- <div v-for="targetUser in approver.targetUsers" :key="targetUser.userId">
79
- <user-info :userId="targetUser.userId"
80
- :userInfo="getTargetUserInfo(targetUser)" avatar-size="small"
81
- name-size="small" :show-department="false" />
79
+ <!-- 目标用户信息(转审、加签等操作) -->
80
+ <div v-if="approver.targetUsers && needShowTargetUser(approver)"
81
+ class="target-user-info">
82
+ <div class="target-label">{{ getTargetUserLabel(approver) }}</div>
83
+ <div style="display: flex; flex-direction: column; gap: 4px;">
84
+ <div v-for="targetUser in approver.targetUsers" :key="targetUser.userId">
85
+ <user-info :userId="targetUser.userId"
86
+ :userInfo="getTargetUserInfo(targetUser)" avatar-size="small"
87
+ name-size="small" :show-department="false" />
88
+ </div>
82
89
  </div>
83
90
  </div>
84
- </div>
85
91
 
86
92
 
87
- <!-- 评论信息 -->
88
- <div class="approver-comment">
89
- <div v-if="approver.comment">{{ approver.comment }}</div>
90
- <div
91
- v-if="approver.operation.attachmentsList && approver.operation.attachmentsList.length > 0">
92
- <ebiz-file-list size="mini" :files="approver.operation.attachmentsList" />
93
+ <!-- 评论信息 -->
94
+ <div v-if="approver.comment || (approver.operation.attachmentsList && approver.operation.attachmentsList.length > 0)"
95
+ class="approver-comment">
96
+ <div v-if="approver.comment">{{ approver.comment }}</div>
97
+ <div
98
+ v-if="approver.operation.attachmentsList && approver.operation.attachmentsList.length > 0">
99
+ <ebiz-file-list size="mini" :files="approver.operation.attachmentsList" />
100
+ </div>
93
101
  </div>
102
+ <!-- <div v-if="approver.comment" class="approver-comment">{{ approver.comment }}</div> -->
94
103
  </div>
95
- <!-- <div v-if="approver.comment" class="approver-comment">{{ approver.comment }}</div> -->
96
- </div>
97
104
 
98
- <!-- 进行中节点 -->
99
- <!-- 当前处理人 -->
100
- <div v-if="getCurrentApprover(node)" class="simple-approver">
101
- <user-info
102
- :userId="getCurrentApprover(node).nodeUser?.userId || getCurrentApprover(node).userId"
103
- :userInfo="getUserInfo(getCurrentApprover(node))" avatar-size="small"
104
- name-size="small" :show-department="false" />
105
- <div class="approver-time">处理中</div>
106
- </div>
105
+ <!-- 进行中节点 -->
106
+ <!-- 当前处理人 -->
107
+ <div v-if="getCurrentApprover(node)" class="simple-approver">
108
+ <user-info
109
+ :userId="getCurrentApprover(node).nodeUser?.userId || getCurrentApprover(node).userId"
110
+ :userInfo="getUserInfo(getCurrentApprover(node))" avatar-size="small"
111
+ name-size="small" :show-department="false" />
112
+ <div class="approver-time">处理中</div>
113
+ </div>
107
114
 
108
- <!-- 待处理人 -->
109
- <div v-for="approver in getPendingApprovers(node)"
110
- :key="'pending-' + (approver.nodeUser?.userId || approver.userId)"
111
- class="simple-approver">
112
- <user-info :userId="approver.nodeUser?.userId || approver.userId"
113
- :userInfo="getUserInfo(approver)" avatar-size="small" name-size="small"
114
- :show-department="false" />
115
- <!-- <div class="approver-time">待处理</div> -->
115
+ <!-- 待处理人 -->
116
+ <div v-for="approver in getPendingApprovers(node)"
117
+ :key="'pending-' + (approver.nodeUser?.userId || approver.userId)"
118
+ class="simple-approver">
119
+ <user-info :userId="approver.nodeUser?.userId || approver.userId"
120
+ :userInfo="getUserInfo(approver)" avatar-size="small" name-size="small"
121
+ :show-department="false" />
122
+ <!-- <div class="approver-time">待处理</div> -->
123
+ </div>
116
124
  </div>
117
125
  </div>
118
126
  </div>
@@ -172,8 +180,8 @@
172
180
  name-size="small" :show-job-number="true" :show-department="false" />
173
181
  <div class="remark-actions">
174
182
  <div class="remark-time">{{ remark.createdTimeStr }}</div>
175
- <t-button v-if="canDeleteRemark(remark)" variant="text" theme="danger" size="small" class="delete-btn"
176
- @click="confirmDeleteRemark(remark)">
183
+ <t-button v-if="canDeleteRemark(remark)" variant="text" theme="danger" size="small"
184
+ class="delete-btn" @click="confirmDeleteRemark(remark)">
177
185
  <t-icon name="delete" />
178
186
  </t-button>
179
187
  </div>
@@ -441,7 +449,7 @@ const getOperationTypeText = (approver) => {
441
449
  return "向前加签";
442
450
  }
443
451
  return '已同意并加签'
444
- // return '加签'
452
+ // return '加签'
445
453
  case 'REJECT':
446
454
  return '驳回'
447
455
  case 'RETURN':
@@ -61,7 +61,10 @@
61
61
  <template #module="{ row }">
62
62
  <div class="cell-with-checkbox">
63
63
  <t-checkbox v-model="row.moduleChecked" @change="(checked) => handleModuleCheck(row, checked)"></t-checkbox>
64
- <span class="cell-text">{{ row.module }}</span>
64
+ <div class="cell-content">
65
+ <div class="cell-text">{{ row.module }}</div>
66
+ <div class="cell-id" v-if="row.moduleKey">{{ row.moduleKey }}</div>
67
+ </div>
65
68
  </div>
66
69
  </template>
67
70
 
@@ -70,7 +73,10 @@
70
73
  <div class="cell-with-checkbox">
71
74
  <t-checkbox v-model="row.subModule1Checked"
72
75
  @change="(checked) => handleSubModule1Check(row, checked)"></t-checkbox>
73
- <span class="cell-text">{{ row.subModule1 || row.module }}</span>
76
+ <div class="cell-content">
77
+ <div class="cell-text">{{ row.subModule1 || row.module }}</div>
78
+ <div class="cell-id" v-if="row.subModule1Key">{{ row.subModule1Key }}</div>
79
+ </div>
74
80
  </div>
75
81
  </template>
76
82
 
@@ -79,7 +85,10 @@
79
85
  <div class="cell-with-checkbox" v-if="row.subModule2">
80
86
  <t-checkbox v-model="row.subModule2Checked"
81
87
  @change="(checked) => handleSubModule2Check(row, checked)"></t-checkbox>
82
- <span class="cell-text">{{ row.subModule2 }}</span>
88
+ <div class="cell-content">
89
+ <div class="cell-text">{{ row.subModule2 }}</div>
90
+ <div class="cell-id" v-if="row.subModule2Key">{{ row.subModule2Key }}</div>
91
+ </div>
83
92
  </div>
84
93
  <div v-else class="cell-with-checkbox">
85
94
  <span class="cell-text empty-cell">-</span>
@@ -92,7 +101,10 @@
92
101
  <div v-for="(func, idx) in row.functions" :key="func.id || idx" class="function-item">
93
102
  <t-checkbox v-model="func.checked"
94
103
  @change="(checked) => handleFunctionCheck(row, func, checked)"></t-checkbox>
95
- <span class="cell-text">{{ func.name }}</span>
104
+ <div class="cell-content">
105
+ <div class="cell-text">{{ func.name }}</div>
106
+ <div class="cell-id" v-if="func.funcKey">{{ func.funcKey }}</div>
107
+ </div>
96
108
  </div>
97
109
  </div>
98
110
  </template>
@@ -413,10 +425,13 @@ const processTreeData = (treeData) => {
413
425
  id: `${moduleItem.id}_all`,
414
426
  module: moduleItem.name,
415
427
  moduleId: moduleItem.id,
428
+ moduleKey: moduleItem.funcKey,
416
429
  subModule1: null,
417
430
  subModule1Id: null,
431
+ subModule1Key: null,
418
432
  subModule2: null,
419
433
  subModule2Id: null,
434
+ subModule2Key: null,
420
435
  functions: [{ id: null, name: '全部', checked: false }]
421
436
  })
422
437
  return
@@ -428,10 +443,13 @@ const processTreeData = (treeData) => {
428
443
  id: `${moduleItem.id}_${subModule1Item.id}_all`,
429
444
  module: moduleItem.name,
430
445
  moduleId: moduleItem.id,
446
+ moduleKey: moduleItem.funcKey,
431
447
  subModule1: subModule1Item.name,
432
448
  subModule1Id: subModule1Item.id,
449
+ subModule1Key: subModule1Item.funcKey,
433
450
  subModule2: null,
434
451
  subModule2Id: null,
452
+ subModule2Key: null,
435
453
  functions: [{ id: null, name: '全部', checked: false }]
436
454
  })
437
455
  } else {
@@ -444,6 +462,7 @@ const processTreeData = (treeData) => {
444
462
  const func = {
445
463
  id: functionItem.id,
446
464
  name: functionItem.name,
465
+ funcKey: functionItem.funcKey,
447
466
  checked: false
448
467
  }
449
468
  functions.push(func)
@@ -453,6 +472,7 @@ const processTreeData = (treeData) => {
453
472
  functions.push({
454
473
  id: childFunc.id,
455
474
  name: childFunc.name,
475
+ funcKey: childFunc.funcKey,
456
476
  checked: false
457
477
  })
458
478
  })
@@ -465,10 +485,13 @@ const processTreeData = (treeData) => {
465
485
  id: `${moduleItem.id}_${subModule1Item.id}_${subModule2Item.id}`,
466
486
  module: moduleItem.name,
467
487
  moduleId: moduleItem.id,
488
+ moduleKey: moduleItem.funcKey,
468
489
  subModule1: subModule1Item.name,
469
490
  subModule1Id: subModule1Item.id,
491
+ subModule1Key: subModule1Item.funcKey,
470
492
  subModule2: subModule2Item.name,
471
493
  subModule2Id: subModule2Item.id,
494
+ subModule2Key: subModule2Item.funcKey,
472
495
  functions
473
496
  })
474
497
  })
@@ -620,9 +643,9 @@ const handleSubModule2Check = (row, checked) => {
620
643
  // 勾选功能时,自动判断父级
621
644
  const handleFunctionCheck = (row, func, checked) => {
622
645
  func.checked = checked
623
- // 判断本组所有功能是否全选
624
- const allChecked = row.functions.every((f) => f.checked)
625
- row.subModule2Checked = allChecked
646
+ // 判断本组是否有功能被选中
647
+ const hasChecked = row.functions.some((f) => f.checked)
648
+ row.subModule2Checked = hasChecked
626
649
  // 向上联动
627
650
  updateSubModule1Checked(row.moduleId, row.subModule1Id)
628
651
  }
@@ -631,9 +654,9 @@ const handleFunctionCheck = (row, func, checked) => {
631
654
  const updateSubModule1Checked = (moduleId, subModule1Id) => {
632
655
  // 找到所有同模块+同子模块1的行
633
656
  const group = data.value.filter((item) => item.moduleId === moduleId && item.subModule1Id === subModule1Id)
634
- const allChecked = group.every((item) => item.subModule2Checked)
657
+ const hasChecked = group.some((item) => item.subModule2Checked)
635
658
  group.forEach((item) => {
636
- item.subModule1Checked = allChecked
659
+ item.subModule1Checked = hasChecked
637
660
  })
638
661
  // 向上联动模块
639
662
  updateModuleChecked(moduleId)
@@ -642,9 +665,9 @@ const updateSubModule1Checked = (moduleId, subModule1Id) => {
642
665
  // 更新模块的勾选状态
643
666
  const updateModuleChecked = (moduleId) => {
644
667
  const group = data.value.filter((item) => item.moduleId === moduleId)
645
- const allChecked = group.every((item) => item.subModule1Checked)
668
+ const hasChecked = group.some((item) => item.subModule1Checked)
646
669
  group.forEach((item) => {
647
- item.moduleChecked = allChecked
670
+ item.moduleChecked = hasChecked
648
671
  })
649
672
  }
650
673
 
@@ -979,6 +1002,29 @@ const onOrgSearch = () => {
979
1002
  }
980
1003
  onOrgSearch()
981
1004
 
1005
+ // 获取所有父级权限ID的辅助函数
1006
+ const getParentPermissionIds = (functionIds, row) => {
1007
+ const parentIds = new Set()
1008
+
1009
+ // 添加模块ID(如果存在)
1010
+ if (row.moduleId) {
1011
+ parentIds.add(row.moduleId)
1012
+ }
1013
+
1014
+ // 添加子模块1 ID(如果存在)
1015
+ if (row.subModule1Id) {
1016
+ parentIds.add(row.subModule1Id)
1017
+ }
1018
+
1019
+ // 添加子模块2 ID(如果存在)
1020
+ if (row.subModule2Id) {
1021
+ parentIds.add(row.subModule2Id)
1022
+ }
1023
+
1024
+ // 将Set转换为数组并去重
1025
+ return Array.from(parentIds)
1026
+ }
1027
+
982
1028
  // 计算选中的数据权限结构
983
1029
  const computedSelectedData = computed(() => {
984
1030
  // 全局数据权限
@@ -993,8 +1039,14 @@ const computedSelectedData = computed(() => {
993
1039
  .map((f) => f.id)
994
1040
  .filter(Boolean)
995
1041
  if (checkedFunctionIds.length > 0) {
1042
+ // 获取父级权限ID
1043
+ const parentIds = getParentPermissionIds(checkedFunctionIds, row)
1044
+
1045
+ // 合并功能ID和父级权限ID,去重
1046
+ const allFunctionIds = [...new Set([...checkedFunctionIds, ...parentIds])]
1047
+
996
1048
  functionList.push({
997
- functionIds: checkedFunctionIds,
1049
+ functionIds: allFunctionIds,
998
1050
  dataScope: row.dataPermission || undefined,
999
1051
  deptIds:
1000
1052
  row.dataPermission === 6 && row.selectedOrgs && row.selectedOrgs.length > 0
@@ -1066,8 +1118,8 @@ const findOrgInTree = (tree, id) => {
1066
1118
 
1067
1119
  // 添加用于更新父级勾选状态的辅助函数
1068
1120
  const updateParentCheckStatus = (row) => {
1069
- // 判断当前行的功能是否全部勾选
1070
- const allFunctionsChecked = row.functions.every(func => func.checked);
1121
+ // 判断当前行的功能是否有被勾选
1122
+ const hasFunctionsChecked = row.functions.some(func => func.checked);
1071
1123
 
1072
1124
  // 更新子模块2的勾选状态
1073
1125
  if (row.subModule2) {
@@ -1078,14 +1130,14 @@ const updateParentCheckStatus = (row) => {
1078
1130
  item.subModule2Id === row.subModule2Id
1079
1131
  );
1080
1132
 
1081
- // 判断同组的所有行是否全部勾选了功能
1082
- const allRowsChecked = sameGroup.every(item =>
1083
- item.functions.every(func => func.checked)
1133
+ // 判断同组的所有行是否有功能被勾选
1134
+ const hasRowsChecked = sameGroup.some(item =>
1135
+ item.functions.some(func => func.checked)
1084
1136
  );
1085
1137
 
1086
1138
  // 更新子模块2的勾选状态
1087
1139
  sameGroup.forEach(item => {
1088
- item.subModule2Checked = allRowsChecked;
1140
+ item.subModule2Checked = hasRowsChecked;
1089
1141
  });
1090
1142
  }
1091
1143
 
@@ -1097,10 +1149,24 @@ const updateParentCheckStatus = (row) => {
1097
1149
  <style lang="less" scoped>
1098
1150
  .cell-with-checkbox {
1099
1151
  display: flex;
1100
- align-items: center;
1152
+ align-items: flex-start;
1101
1153
 
1102
- .cell-text {
1154
+ .cell-content {
1103
1155
  margin-left: 8px;
1156
+ display: flex;
1157
+ flex-direction: column;
1158
+ }
1159
+
1160
+ .cell-text {
1161
+ line-height: 1.4;
1162
+ }
1163
+
1164
+ .cell-id {
1165
+ margin-top: 2px;
1166
+ color: #999;
1167
+ font-size: 12px;
1168
+ font-family: monospace;
1169
+ line-height: 1.2;
1104
1170
  }
1105
1171
 
1106
1172
  .empty-cell {
@@ -1116,11 +1182,25 @@ const updateParentCheckStatus = (row) => {
1116
1182
 
1117
1183
  .function-item {
1118
1184
  display: flex;
1119
- align-items: center;
1185
+ align-items: flex-start;
1120
1186
  margin-right: 12px;
1121
1187
 
1122
- .cell-text {
1188
+ .cell-content {
1123
1189
  margin-left: 8px;
1190
+ display: flex;
1191
+ flex-direction: column;
1192
+ }
1193
+
1194
+ .cell-text {
1195
+ line-height: 1.4;
1196
+ }
1197
+
1198
+ .cell-id {
1199
+ margin-top: 2px;
1200
+ color: #999;
1201
+ font-size: 12px;
1202
+ font-family: monospace;
1203
+ line-height: 1.2;
1124
1204
  }
1125
1205
  }
1126
1206
  }
@@ -14,7 +14,6 @@
14
14
  <ebiz-s-form-item label="出生日期" name="birthday" type="date"></ebiz-s-form-item>
15
15
 
16
16
  <ebiz-s-form-item v-model="formData.richText" label="富文本" name="richText" type="rich-text"></ebiz-s-form-item>
17
-
18
17
 
19
18
  {{ formData.bio }}
20
19
  <ebiz-s-form-item v-model="formData.bio" label="简介" name="bio" type="table" :tableColumns="[