@lambo-design/workflow-approve 1.0.0-beta.141 → 1.0.0-beta.143

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": "@lambo-design/workflow-approve",
3
- "version": "1.0.0-beta.141",
3
+ "version": "1.0.0-beta.143",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "author": "lambo",
@@ -30,7 +30,7 @@
30
30
  <!-- 检查是否有待审批记录 -->
31
31
  <template v-if="items.some(item => isPendingAudit(item))">
32
32
  <!-- 待审批的记录:使用折叠面板 -->
33
- <Collapse v-model="pendingActiveName" simple style="margin: -10px 0 0 20px;border: none">
33
+ <Collapse :key="'pending-collapse-' + index + '-' + sortBy" v-model="pendingActiveName" simple style="margin: -10px 0 0;border: none">
34
34
  <Panel :name="'pending-panel' + index" hide-arrow>
35
35
  <span class="pending-audit-title">
36
36
  <Icon type="md-time" style="color: orange; margin-right: 5px;" />
@@ -526,7 +526,7 @@ export default {
526
526
  }
527
527
  ],
528
528
  sortBy: this.historySortBy,
529
- pendingActiveName: [], // 控制待审批折叠面板的展开状态
529
+ pendingActiveName: '', // 控制待审批折叠面板的展开状态
530
530
  }
531
531
  },
532
532
  computed: {
@@ -993,6 +993,7 @@ export default {
993
993
  },
994
994
  toggleSortBy(by) {
995
995
  this.sortBy = by;
996
+ this.pendingActiveName = '';
996
997
  },
997
998
  isPendingAudit(item) {
998
999
  // 判断是否为待审批状态
@@ -1056,20 +1057,18 @@ export default {
1056
1057
  align-items: center;
1057
1058
  }
1058
1059
 
1059
- /* 按时间排序的卡片样式 - 更小,不遮挡时间轴圆点 */
1060
1060
  .portrait-card-time {
1061
- margin-left: 20px !important;
1062
- margin-right: 10px !important;
1063
- margin-bottom: 8px !important;
1064
- background-color: #fafafa !important;
1061
+ width: 100%;
1062
+ max-width: 100%;
1063
+ margin-left: 0 !important;
1064
+ margin-right: 0 !important;
1065
+ margin-bottom: 5px !important;
1066
+ box-sizing: border-box;
1067
+ overflow: hidden;
1065
1068
  }
1066
1069
 
1067
1070
  :deep(.portrait-card-time .ivu-card-body) {
1068
- padding: 8px 12px !important;
1069
- }
1070
-
1071
- :deep(.portrait-card-time .ivu-list-item) {
1072
- padding: 6px 0 !important;
1071
+ padding: 5px !important;
1073
1072
  }
1074
1073
 
1075
1074
  :deep(.docx) {
@@ -71,6 +71,7 @@ export default {
71
71
  key: 'selected',
72
72
  width: 56,
73
73
  align: 'center',
74
+ renderHeader: h => h('span'),
74
75
  render: (h, params) => {
75
76
  if (params.row.type === 'group') {
76
77
  return h('div', {
@@ -248,14 +249,21 @@ export default {
248
249
  formatRejectPathLabel(pathIds, nodeNameMap) {
249
250
  return pathIds.map(id => nodeNameMap.get(id) || id).join(' > ')
250
251
  },
251
- formatGatewayPathLabel(gatewayPath) {
252
- if (!Array.isArray(gatewayPath) || gatewayPath.length === 0) {
253
- return ''
254
- }
255
- return gatewayPath
256
- .map(item => item.groupName || item.groupId)
257
- .filter(Boolean)
258
- .join(' > ')
252
+ formatGatewayPathLabel(gatewayPath) {
253
+ if (!Array.isArray(gatewayPath) || gatewayPath.length === 0) {
254
+ return ''
255
+ }
256
+ return gatewayPath
257
+ .map(item => item.groupName || item.groupId)
258
+ .filter(Boolean)
259
+ .join(' > ')
260
+ },
261
+ getRejectNodePrimaryGatewayPath(node) {
262
+ const pathEntries = Array.isArray(node?.pathEntries) && node.pathEntries.length > 0
263
+ ? node.pathEntries
264
+ : this.normalizeRejectNode(node, 0, new Map()).pathEntries
265
+ const primaryEntry = pathEntries.find(item => Array.isArray(item?.gatewayPath) && item.gatewayPath.length > 0)
266
+ return Array.isArray(primaryEntry?.gatewayPath) ? primaryEntry.gatewayPath : []
259
267
  },
260
268
  getRejectNodeGatewaySortKey(gatewayPath) {
261
269
  if (!Array.isArray(gatewayPath) || gatewayPath.length === 0) {
@@ -282,21 +290,8 @@ export default {
282
290
  if (leftPathOrder !== rightPathOrder) {
283
291
  return leftPathOrder - rightPathOrder
284
292
  }
285
- return String(left?.pathKey || '').localeCompare(String(right?.pathKey || ''))
286
- },
287
- getRejectNodeSortKey(node) {
288
- const pathEntries = Array.isArray(node?.pathEntries) ? node.pathEntries : []
289
- if (pathEntries.length === 0) {
290
- const taskName = String(node?.taskName || node?.name || node?.title || node?.taskNode || '')
291
- return `z|z|${taskName}`
292
- }
293
- const firstEntry = pathEntries[0]
294
- const depth = Array.isArray(firstEntry?.gatewayPath) ? firstEntry.gatewayPath.length : 0
295
- const gatewayKey = this.getRejectNodeGatewaySortKey(firstEntry?.gatewayPath)
296
- const pathOrder = typeof firstEntry?.pathOrder === 'number' ? firstEntry.pathOrder : Number.MAX_SAFE_INTEGER
297
- const taskName = String(node?.taskName || node?.name || node?.title || node?.taskNode || '')
298
- return `${String(depth).padStart(4, '0')}|${gatewayKey}|${String(pathOrder).padStart(4, '0')}|${taskName}`
299
- },
293
+ return String(left?.pathKey || '').localeCompare(String(right?.pathKey || ''))
294
+ },
300
295
  getRejectNodePathKeys(node) {
301
296
  if (Array.isArray(node?.pathKeys) && node.pathKeys.length > 0) {
302
297
  return node.pathKeys
@@ -537,14 +532,46 @@ export default {
537
532
 
538
533
  return visibleRows
539
534
  },
540
- sortRejectNodesForTable(nodes) {
541
- const list = Array.isArray(nodes) ? nodes.slice() : []
542
- return list.sort((left, right) => {
543
- const leftSortKey = this.getRejectNodeSortKey(this.normalizeRejectNode(left, 0, new Map()))
544
- const rightSortKey = this.getRejectNodeSortKey(this.normalizeRejectNode(right, 0, new Map()))
545
- return leftSortKey.localeCompare(rightSortKey)
546
- })
547
- },
535
+ sortRejectNodesForTable(nodes) {
536
+ const list = Array.isArray(nodes) ? nodes.slice() : []
537
+ const bucketMap = new Map()
538
+ const bucketOrder = []
539
+
540
+ list.forEach((node, index) => {
541
+ const normalizedNode = this.normalizeRejectNode(node, index, new Map())
542
+ const primaryGatewayPath = this.getRejectNodePrimaryGatewayPath(normalizedNode)
543
+ const gatewayKey = primaryGatewayPath.length > 0
544
+ ? this.getRejectNodeGatewaySortKey(primaryGatewayPath)
545
+ : '__reject_node_no_gateway__'
546
+ let bucket = bucketMap.get(gatewayKey)
547
+ if (!bucket) {
548
+ bucket = {
549
+ gatewayKey,
550
+ hasGateway: primaryGatewayPath.length > 0,
551
+ firstIndex: index,
552
+ nodes: []
553
+ }
554
+ bucketMap.set(gatewayKey, bucket)
555
+ bucketOrder.push(bucket)
556
+ }
557
+ bucket.nodes.push(node)
558
+ })
559
+
560
+ bucketOrder.sort((left, right) => {
561
+ if (left.hasGateway !== right.hasGateway) {
562
+ return left.hasGateway ? 1 : -1
563
+ }
564
+ return left.firstIndex - right.firstIndex
565
+ })
566
+
567
+ const sortedNodes = []
568
+ bucketOrder.forEach(bucket => {
569
+ bucket.nodes.forEach(node => {
570
+ sortedNodes.push(node)
571
+ })
572
+ })
573
+ return sortedNodes
574
+ },
548
575
  mergeRejectNodesByTaskNode(nodes) {
549
576
  const groupedMap = new Map()
550
577
  const sourceNodes = Array.isArray(nodes) ? nodes : []