@lambo-design/workflow-approve 1.0.0-beta.76 → 1.0.0-beta.77

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.76",
3
+ "version": "1.0.0-beta.77",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "author": "lambo",
@@ -1,120 +1,305 @@
1
1
  <template>
2
2
  <div>
3
+ <!-- 添加排序和分组切换按钮 -->
4
+ <div class="history-controls" style="margin-bottom: 16px;">
5
+ <ButtonGroup>
6
+ <Button
7
+ :type="sortBy === 'time' ? 'primary' : 'default'"
8
+ size="small"
9
+ @click="toggleSortBy('time')">
10
+ <Icon type="md-time" />
11
+ 按时间排序
12
+ </Button>
13
+ <Button
14
+ :type="sortBy === 'node' ? 'primary' : 'default'"
15
+ size="small"
16
+ @click="toggleSortBy('node')">
17
+ <Icon type="md-git-network" />
18
+ 按节点分组
19
+ </Button>
20
+ </ButtonGroup>
21
+ </div>
3
22
 
4
23
  <Timeline class="portrait-timeline">
5
- <TimelineItem v-for="(items,index) in itemList" :key="index" class="portrait-timeline-item">
24
+ <TimelineItem v-for="(items,index) in processedItemList" :key="index" class="portrait-timeline-item">
6
25
  <template #dot>
7
- <div v-if="auditPassStatus.includes(items[0].auditResult)" class="cicle" style="background-color: #005aff"></div>
8
- <div v-else-if="items[0].auditResult === '40' || items[0].auditResult === '50'" class="cicle" style="background-color: #ffcc66"></div>
9
- <div v-else-if="items[0].auditResult === '60' || items[0].auditResult === '62' || items[0].auditResult === '83'" class="cicle" style="background-color: #ed4014"></div>
10
- <div v-else class="cicle" style="background-color: #ff9900"></div>
26
+ <div class="cicle" :style="{backgroundColor: getTimelineDotColor(items[0].auditResult)}"></div>
11
27
  </template>
12
- <Collapse v-model="activeName" simple style="margin: -10px 0 0 -2px;border: none">
13
- <Panel :name="'panel' + index" hide-arrow>
14
- <span class="history-title"> {{ items[0].taskName }}</span>
15
- <template #content>
16
- <div v-for="(item, index) in items" :key="index">
17
- <div v-for="(itemListItem, itemListIndex) in item.auditName" :key="itemListIndex">
18
- <Card dis-hover
19
- class="portrait-card"
20
- :bordered="false">
21
- <List item-layout="vertical">
22
- <ListItem>
23
- <Row style="display: flex; align-items: center;">
24
- <!-- 左边:Avatar -->
25
- <Col>
26
- <avatar
27
- :class="portraitWidth >= 600 ? 'portrait-avatar-large' : 'portrait-avatar-small'"
28
- size="small">
29
- {{ getFirstName(itemListItem) }}</avatar>
30
- </Col>
31
- <!-- 右边:审批信息 -->
32
- <Col span="17">
33
- <Row>
34
- <tooltip>
35
- <span class="audit-name-style"> {{ itemListItem }}</span>
36
- <div slot="content" style="white-space: normal"> {{ itemListItem }}</div>
37
- </tooltip>
38
- <Divider style="background-color:#808695;height: 1em;margin: 4px 9px 0 6px;"
39
- type="vertical"/>
40
- <tooltip v-if="item.auditOrganName">
41
- <span class="audit-name-style"> {{ item.auditOrganName[itemListIndex] }}</span>
42
- <div slot="content" style="white-space: normal"> {{ item.auditOrganName[itemListIndex] }}</div>
43
- </tooltip>
44
- <span v-if="portraitWidth === 0 || portraitWidth >= 600" class="audit-date-style">
45
- {{showDate(item)}}
46
- </span>
47
- </Row>
48
- <Row v-if="item.auditComment">
49
- <tooltip max-width="200px" placement="bottom-start">
50
- <span class="audit-comment-style">{{ item.auditComment }}</span>
51
- <div slot="content" style="white-space: normal"> {{ item.auditComment }}</div>
52
- </tooltip>
53
- </Row>
54
- <Row v-if="portraitWidth < 600" class="portrait-audit-date-style">{{showDate(item)}}</Row>
55
- <Row style="margin-top: 10px">
56
- <Col span="12">
57
- <span style="color: #005aff;; font-size: 13px;"
58
- v-if="item.auditResult === '00'">流程发起</span>
59
- <span style="color: #005aff;; font-size: 13px;"
60
- v-else-if="item.auditResult === '10'">自动跳过</span>
61
- <span style="color: #005aff;; font-size: 13px;"
62
- v-else-if="item.auditResult === '11'">与上一环节办理人相同自动跳过</span>
63
- <span style="color: #005aff;; font-size: 13px;"
64
- v-else-if="item.auditResult === '12'">与发起人相同自动跳过</span>
65
- <span style="color: #005aff;; font-size: 13px;"
66
- v-else-if="item.auditResult === '13'">办理人为空自动跳过</span>
67
- <span style="color: #005aff;; font-size: 13px;"
68
- v-else-if="item.auditResult === '14'">符合流程变量条件自动跳过</span>
69
- <span style="color: #005aff;; font-size: 13px;"
70
- v-else-if="item.auditResult === '30'">通过</span>
71
- <span style="color: #ed4014; font-size: 13px;"
72
- v-else-if="item.auditResult === '40'">{{item.rejectName ? item.rejectName : '驳回'}}上一节点</span>
73
- <span style="color: #ed4014; font-size: 13px;"
74
- v-else-if="item.auditResult === '50'">{{item.rejectName ? item.rejectName : '驳回'}}到原点</span>
75
- <span style="color: #ed4014; font-size: 13px;"
76
- v-else-if="item.auditResult === '51'">流程终止</span>
77
- <span style="color: #ed4014; font-size: 13px;"
78
- v-else-if="item.auditResult === '60'">撤回</span>
79
- <span style="color: #005aff; font-size: 13px;"
80
- v-else-if="item.auditResult === '61'">交回委派任务</span>
81
- <span style="color: #ed4014; font-size: 13px;"
82
- v-else-if="item.auditResult === '62'">委派任务被撤回</span>
83
- <span style="color: #19be6b; font-size: 13px;"
84
- v-else-if="item.auditResult === '80'">跳转指定节点</span>
85
- <span style="color: #005aff; font-size: 13px;"
86
- v-else-if="item.auditResult === '82'">指定他人处理</span>
87
- <span style="color: #ed4014; font-size: 13px;"
88
- v-else-if="item.auditResult === '83'">会签减签</span>
89
- <span style="color: #19be6b; font-size: 13px;"
90
- v-else-if="item.auditResult === '90'">{{item.rejectName ? item.rejectName : '驳回'}}指定节点</span>
91
- <span style="color: #ff9900; font-size: 13px;" v-else>{{ '待' + handleName }}</span>
28
+ <!-- 按时间排序时:不显示标题,自动展开 -->
29
+ <template v-if="sortBy === 'time'">
30
+ <!-- 检查是否有待审批记录 -->
31
+ <template v-if="items.some(item => isPendingAudit(item))">
32
+ <!-- 待审批的记录:使用折叠面板 -->
33
+ <Collapse v-model="pendingActiveName" simple style="margin: -10px 0 0 20px;border: none">
34
+ <Panel :name="'pending-panel' + index" hide-arrow>
35
+ <span class="pending-audit-title">
36
+ <Icon type="md-time" style="color: #ff9900; margin-right: 5px;" />
37
+ 待{{ handleName }}
38
+ </span>
39
+ <template #content>
40
+ <!-- 遍历所有待审批的记录 -->
41
+ <div v-for="(item, itemIndex) in items.filter(item => isPendingAudit(item))" :key="itemIndex">
42
+ <div v-for="(itemListItem, itemListIndex) in item.auditName" :key="itemListIndex">
43
+ <Card dis-hover
44
+ class="portrait-card portrait-card-time"
45
+ :bordered="false">
46
+ <List item-layout="vertical">
47
+ <ListItem>
48
+ <Row style="display: flex; align-items: center;">
49
+ <!-- 左边:Avatar -->
50
+ <Col>
51
+ <avatar
52
+ :class="portraitWidth >= 600 ? 'portrait-avatar-large' : 'portrait-avatar-small'"
53
+ size="small">
54
+ {{ getFirstName(itemListItem) }}</avatar>
92
55
  </Col>
93
- <Col span="12" style="text-align: right">
94
- <Button v-if="item.fileList && item.fileList.length > 0" size="small" type="primary" ghost class="urging" @click="openModal(item)">查看附件</Button>
95
- <Button v-if="displayPushButton && !auditPassStatus.includes(item.auditResult) && item.auditResult !== '40'&&item.auditResult !== '50'&&item.auditResult !== '60'&&item.auditResult !== '62'&&item.auditResult!=='83'&&item.auditResult!=='90'"
96
- size="small" type="primary" ghost class="urging"
97
- @click="pushHim(item,itemListItem,itemListIndex)">催一下
98
- </Button>
56
+ <!-- 右边:审批信息 -->
57
+ <Col span="17">
58
+ <Row>
59
+ <tooltip>
60
+ <span class="audit-name-style"> {{ itemListItem }}</span>
61
+ <div slot="content" style="white-space: normal"> {{ itemListItem }}</div>
62
+ </tooltip>
63
+ <Divider style="background-color:#808695;height: 1em;margin: 4px 9px 0 6px;"
64
+ type="vertical"/>
65
+ <tooltip v-if="item.auditOrganName">
66
+ <span class="audit-name-style"> {{ item.auditOrganName[itemListIndex] }}</span>
67
+ <div slot="content" style="white-space: normal"> {{ item.auditOrganName[itemListIndex] }}</div>
68
+ </tooltip>
69
+ <span v-if="portraitWidth === 0 || portraitWidth >= 600" class="audit-date-style">
70
+ {{showDate(item)}}
71
+ </span>
72
+ </Row>
73
+ <Row v-if="item.auditComment">
74
+ <tooltip max-width="200px" placement="bottom-start">
75
+ <span class="audit-comment-style">{{ item.auditComment }}</span>
76
+ <div slot="content" style="white-space: normal"> {{ item.auditComment }}</div>
77
+ </tooltip>
78
+ </Row>
79
+ <Row v-if="portraitWidth < 600" class="portrait-audit-date-style">{{showDate(item)}}</Row>
80
+ <Row style="margin-top: 10px">
81
+ <Col span="12">
82
+ <span style="color: #ff9900; font-size: 13px;">{{ '待' + handleName }}</span>
83
+ </Col>
84
+ <Col span="12" style="text-align: right">
85
+ <Button v-if="item.fileList && item.fileList.length > 0" size="small" type="primary" ghost class="urging" @click="openModal(item)">查看附件</Button>
86
+ <Button v-if="displayPushButton"
87
+ size="small" type="primary" ghost class="urging"
88
+ @click="pushHim(item,itemListItem,itemListIndex)">催一下
89
+ </Button>
90
+ </Col>
91
+ </Row>
99
92
  </Col>
100
93
  </Row>
94
+ </ListItem>
95
+ </List>
96
+ </Card>
97
+ </div>
98
+ </div>
99
+ </template>
100
+ </Panel>
101
+ </Collapse>
102
+ </template>
103
+
104
+ <!-- 已审批的记录:直接显示 -->
105
+ <div v-for="(item, itemIndex) in items.filter(item => !isPendingAudit(item))" :key="'approved-' + itemIndex">
106
+ <div v-for="(itemListItem, itemListIndex) in item.auditName" :key="itemListIndex">
107
+ <Card dis-hover
108
+ class="portrait-card portrait-card-time"
109
+ :bordered="false">
110
+ <List item-layout="vertical">
111
+ <ListItem>
112
+ <Row style="display: flex; align-items: center;">
113
+ <!-- 左边:Avatar -->
114
+ <Col>
115
+ <avatar
116
+ :class="portraitWidth >= 600 ? 'portrait-avatar-large' : 'portrait-avatar-small'"
117
+ size="small">
118
+ {{ getFirstName(itemListItem) }}</avatar>
119
+ </Col>
120
+ <!-- 右边:审批信息 -->
121
+ <Col span="17">
122
+ <Row>
123
+ <tooltip>
124
+ <span class="audit-name-style"> {{ itemListItem }}</span>
125
+ <div slot="content" style="white-space: normal"> {{ itemListItem }}</div>
126
+ </tooltip>
127
+ <Divider style="background-color:#808695;height: 1em;margin: 4px 9px 0 6px;"
128
+ type="vertical"/>
129
+ <tooltip v-if="item.auditOrganName">
130
+ <span class="audit-name-style"> {{ item.auditOrganName[itemListIndex] }}</span>
131
+ <div slot="content" style="white-space: normal"> {{ item.auditOrganName[itemListIndex] }}</div>
132
+ </tooltip>
133
+ <span v-if="portraitWidth === 0 || portraitWidth >= 600" class="audit-date-style">
134
+ {{showDate(item)}}
135
+ </span>
136
+ </Row>
137
+ <Row v-if="item.auditComment">
138
+ <tooltip max-width="200px" placement="bottom-start">
139
+ <span class="audit-comment-style">{{ item.auditComment }}</span>
140
+ <div slot="content" style="white-space: normal"> {{ item.auditComment }}</div>
141
+ </tooltip>
142
+ </Row>
143
+ <Row v-if="portraitWidth < 600" class="portrait-audit-date-style">{{showDate(item)}}</Row>
144
+ <Row style="margin-top: 10px">
145
+ <Col span="12">
146
+ <span style="color: #005aff;; font-size: 13px;"
147
+ v-if="item.auditResult === '00'">流程发起</span>
148
+ <span style="color: #005aff;; font-size: 13px;"
149
+ v-else-if="item.auditResult === '10'">自动跳过</span>
150
+ <span style="color: #005aff;; font-size: 13px;"
151
+ v-else-if="item.auditResult === '11'">与上一环节办理人相同自动跳过</span>
152
+ <span style="color: #005aff;; font-size: 13px;"
153
+ v-else-if="item.auditResult === '12'">与发起人相同自动跳过</span>
154
+ <span style="color: #005aff;; font-size: 13px;"
155
+ v-else-if="item.auditResult === '13'">办理人为空自动跳过</span>
156
+ <span style="color: #005aff;; font-size: 13px;"
157
+ v-else-if="item.auditResult === '14'">符合流程变量条件自动跳过</span>
158
+ <span style="color: #005aff;; font-size: 13px;"
159
+ v-else-if="item.auditResult === '30'">通过</span>
160
+ <span style="color: #ed4014; font-size: 13px;"
161
+ v-else-if="item.auditResult === '40'">{{item.rejectName ? item.rejectName : '驳回'}}上一节点</span>
162
+ <span style="color: #ed4014; font-size: 13px;"
163
+ v-else-if="item.auditResult === '50'">{{item.rejectName ? item.rejectName : '驳回'}}到原点</span>
164
+ <span style="color: #ed4014; font-size: 13px;"
165
+ v-else-if="item.auditResult === '51'">流程终止</span>
166
+ <span style="color: #ed4014; font-size: 13px;"
167
+ v-else-if="item.auditResult === '60'">撤回</span>
168
+ <span style="color: #005aff; font-size: 13px;"
169
+ v-else-if="item.auditResult === '61'">交回委派任务</span>
170
+ <span style="color: #ed4014; font-size: 13px;"
171
+ v-else-if="item.auditResult === '62'">委派任务被撤回</span>
172
+ <span style="color: #19be6b; font-size: 13px;"
173
+ v-else-if="item.auditResult === '80'">跳转指定节点</span>
174
+ <span style="color: #005aff; font-size: 13px;"
175
+ v-else-if="item.auditResult === '82'">指定他人处理</span>
176
+ <span style="color: #ed4014; font-size: 13px;"
177
+ v-else-if="item.auditResult === '83'">会签减签</span>
178
+ <span style="color: #19be6b; font-size: 13px;"
179
+ v-else-if="item.auditResult === '90'">{{item.rejectName ? item.rejectName : '驳回'}}指定节点</span>
180
+ </Col>
181
+ <Col span="12" style="text-align: right">
182
+ <Button v-if="item.fileList && item.fileList.length > 0" size="small" type="primary" ghost class="urging" @click="openModal(item)">查看附件</Button>
101
183
  </Col>
102
184
  </Row>
185
+ </Col>
186
+ </Row>
187
+ </ListItem>
188
+ </List>
189
+ </Card>
190
+ </div>
191
+ </div>
192
+ </template>
193
+
194
+ <!-- 按节点分组时:显示折叠面板 -->
195
+ <template v-else>
196
+ <Collapse v-model="activeName" simple style="margin: -10px 0 0 -2px;border: none">
197
+ <Panel :name="'panel' + index" hide-arrow>
198
+ <span class="history-title">{{ items[0].taskName }}</span>
199
+ <template #content>
200
+ <div v-for="(item, index) in items" :key="index">
201
+ <div v-for="(itemListItem, itemListIndex) in item.auditName" :key="itemListIndex">
202
+ <Card dis-hover
203
+ class="portrait-card"
204
+ :bordered="false">
205
+ <List item-layout="vertical">
206
+ <ListItem>
207
+ <Row style="display: flex; align-items: center;">
208
+ <!-- 左边:Avatar -->
209
+ <Col>
210
+ <avatar
211
+ :class="portraitWidth >= 600 ? 'portrait-avatar-large' : 'portrait-avatar-small'"
212
+ size="small">
213
+ {{ getFirstName(itemListItem) }}</avatar>
214
+ </Col>
215
+ <!-- 右边:审批信息 -->
216
+ <Col span="17">
217
+ <Row>
218
+ <tooltip>
219
+ <span class="audit-name-style"> {{ itemListItem }}</span>
220
+ <div slot="content" style="white-space: normal"> {{ itemListItem }}</div>
221
+ </tooltip>
222
+ <Divider style="background-color:#808695;height: 1em;margin: 4px 9px 0 6px;"
223
+ type="vertical"/>
224
+ <tooltip v-if="item.auditOrganName">
225
+ <span class="audit-name-style"> {{ item.auditOrganName[itemListIndex] }}</span>
226
+ <div slot="content" style="white-space: normal"> {{ item.auditOrganName[itemListIndex] }}</div>
227
+ </tooltip>
228
+ <span v-if="portraitWidth === 0 || portraitWidth >= 600" class="audit-date-style">
229
+ {{showDate(item)}}
230
+ </span>
231
+ </Row>
232
+ <Row v-if="item.auditComment">
233
+ <tooltip max-width="200px" placement="bottom-start">
234
+ <span class="audit-comment-style">{{ item.auditComment }}</span>
235
+ <div slot="content" style="white-space: normal"> {{ item.auditComment }}</div>
236
+ </tooltip>
237
+ </Row>
238
+ <Row v-if="portraitWidth < 600" class="portrait-audit-date-style">{{showDate(item)}}</Row>
239
+ <Row style="margin-top: 10px">
240
+ <Col span="12">
241
+ <span style="color: #005aff;; font-size: 13px;"
242
+ v-if="item.auditResult === '00'">流程发起</span>
243
+ <span style="color: #005aff;; font-size: 13px;"
244
+ v-else-if="item.auditResult === '10'">自动跳过</span>
245
+ <span style="color: #005aff;; font-size: 13px;"
246
+ v-else-if="item.auditResult === '11'">与上一环节办理人相同自动跳过</span>
247
+ <span style="color: #005aff;; font-size: 13px;"
248
+ v-else-if="item.auditResult === '12'">与发起人相同自动跳过</span>
249
+ <span style="color: #005aff;; font-size: 13px;"
250
+ v-else-if="item.auditResult === '13'">办理人为空自动跳过</span>
251
+ <span style="color: #005aff;; font-size: 13px;"
252
+ v-else-if="item.auditResult === '14'">符合流程变量条件自动跳过</span>
253
+ <span style="color: #005aff;; font-size: 13px;"
254
+ v-else-if="item.auditResult === '30'">通过</span>
255
+ <span style="color: #ed4014; font-size: 13px;"
256
+ v-else-if="item.auditResult === '40'">{{item.rejectName ? item.rejectName : '驳回'}}上一节点</span>
257
+ <span style="color: #ed4014; font-size: 13px;"
258
+ v-else-if="item.auditResult === '50'">{{item.rejectName ? item.rejectName : '驳回'}}到原点</span>
259
+ <span style="color: #ed4014; font-size: 13px;"
260
+ v-else-if="item.auditResult === '51'">流程终止</span>
261
+ <span style="color: #ed4014; font-size: 13px;"
262
+ v-else-if="item.auditResult === '60'">撤回</span>
263
+ <span style="color: #005aff; font-size: 13px;"
264
+ v-else-if="item.auditResult === '61'">交回委派任务</span>
265
+ <span style="color: #ed4014; font-size: 13px;"
266
+ v-else-if="item.auditResult === '62'">委派任务被撤回</span>
267
+ <span style="color: #19be6b; font-size: 13px;"
268
+ v-else-if="item.auditResult === '80'">跳转指定节点</span>
269
+ <span style="color: #005aff; font-size: 13px;"
270
+ v-else-if="item.auditResult === '82'">指定他人处理</span>
271
+ <span style="color: #ed4014; font-size: 13px;"
272
+ v-else-if="item.auditResult === '83'">会签减签</span>
273
+ <span style="color: #19be6b; font-size: 13px;"
274
+ v-else-if="item.auditResult === '90'">{{item.rejectName ? item.rejectName : '驳回'}}指定节点</span>
275
+ <span style="color: #ff9900; font-size: 13px;" v-else>{{ '待' + handleName }}</span>
276
+ </Col>
277
+ <Col span="12" style="text-align: right">
278
+ <Button v-if="item.fileList && item.fileList.length > 0" size="small" type="primary" ghost class="urging" @click="openModal(item)">查看附件</Button>
279
+ <Button v-if="displayPushButton && !auditPassStatus.includes(item.auditResult) && item.auditResult !== '40'&&item.auditResult !== '50'&&item.auditResult !== '60'&&item.auditResult !== '62'&&item.auditResult!=='83'&&item.auditResult!=='90'"
280
+ size="small" type="primary" ghost class="urging"
281
+ @click="pushHim(item,itemListItem,itemListIndex)">催一下
282
+ </Button>
283
+ </Col>
284
+ </Row>
285
+ </Col>
286
+ </Row>
103
287
 
104
- </ListItem>
105
- </List>
106
- </Card>
288
+ </ListItem>
289
+ </List>
290
+ </Card>
291
+ </div>
107
292
  </div>
108
- </div>
109
- </template>
110
- </Panel>
111
- </Collapse>
293
+ </template>
294
+ </Panel>
295
+ </Collapse>
296
+ </template>
112
297
  </TimelineItem>
113
298
  </Timeline>
114
299
 
115
300
  <Modal
116
- v-model="showModal"
117
- title="查看附件"
301
+ v-model="showModal"
302
+ title="查看附件"
118
303
  >
119
304
  <Table border
120
305
  :columns="attachmentColumn"
@@ -197,17 +382,82 @@ export default {
197
382
  setModals: {
198
383
  modals: []
199
384
  },
200
- auditPassStatus:['00', '10', '11', '12', '13', '14', '30', '61', '80'],
385
+ auditPassStatus:['00', '10', '11', '12', '13', '14', '30', '40', '50', '51', '60', '61', '62', '80', '82', '83', '90'],
201
386
  showModal: false,
202
387
  fileList: [],
203
388
  modalImg: false,
204
389
  image: "",
205
- itemList: {},
390
+ itemList: [],
206
391
  auditNameList: [],
207
392
  displayPushButton: false,
393
+ sortBy: 'time',
394
+ pendingActiveName: [], // 控制待审批折叠面板的展开状态
208
395
  }
209
396
  },
210
397
  computed: {
398
+ processedItemList() {
399
+ // 确保 itemList 存在且是数组
400
+ if (!this.itemList || !Array.isArray(this.itemList) || this.itemList.length === 0) {
401
+ return [];
402
+ }
403
+
404
+ if (this.sortBy === 'time') {
405
+ // 按时间排序:将所有审批记录平铺,按时间排序,然后重新分组
406
+ let allRecords = [];
407
+ let pendingGroups = []; // 待审批的分组
408
+
409
+ // 平铺所有审批记录
410
+ this.itemList.forEach(nodeGroup => {
411
+ // 确保 nodeGroup 是数组
412
+ if (Array.isArray(nodeGroup)) {
413
+ // 检查这个节点组是否包含待审批的记录
414
+ let hasPendingRecords = nodeGroup.some(record => this.isPendingAudit(record));
415
+
416
+ if (hasPendingRecords) {
417
+ // 如果包含待审批记录,整个节点组作为一个待审批组
418
+ if (nodeGroup.length > 0) {
419
+ // 使用第一个记录的时间作为排序时间,或使用当前时间
420
+ let sortTime = this.getRecordTime(nodeGroup[0]) || new Date().toISOString();
421
+ pendingGroups.push({
422
+ records: nodeGroup,
423
+ sortTime: sortTime,
424
+ isPending: true
425
+ });
426
+ }
427
+ } else {
428
+ // 如果是已审批记录,按个人分组
429
+ nodeGroup.forEach(record => {
430
+ if (record && typeof record === 'object') {
431
+ record.sortTime = this.getRecordTime(record);
432
+ allRecords.push({
433
+ records: [record],
434
+ sortTime: record.sortTime,
435
+ isPending: false
436
+ });
437
+ }
438
+ });
439
+ }
440
+ }
441
+ });
442
+
443
+ // 合并所有记录(已审批+待审批)
444
+ let allGroups = [...allRecords, ...pendingGroups];
445
+
446
+ // 按时间排序(倒序,最新在前)
447
+ allGroups.sort((a, b) => {
448
+ const timeA = new Date(a.sortTime).getTime();
449
+ const timeB = new Date(b.sortTime).getTime();
450
+ return timeB - timeA; // 倒序排列
451
+ });
452
+
453
+ // 返回记录数组
454
+ return allGroups.map(group => group.records);
455
+ } else {
456
+ // 按节点分组:保持原有的节点分组结构
457
+ return this.itemList;
458
+ }
459
+ },
460
+
211
461
  attachmentColumn: function () {
212
462
  let column = [];
213
463
  column.push({title: '序号', type: 'index', width: 70, align: 'center', fixed: 'left'});
@@ -310,22 +560,22 @@ export default {
310
560
  responseType: 'blob', // 因为是流文件,所以要指定blob类型
311
561
  url: this.smartFlowServerContext + "/manage/oss/file/get/" + row.fileId// 一个word下载文件的接口
312
562
  }).then(({data}) => {
313
- docx.renderAsync(data, this.$refs.file, null, {
314
- className: "docx", //默认和文档样式类的类名/前缀
315
- inWrapper: true, //启用围绕文档内容呈现包装器
316
- ignoreWidth: false, //禁用页面的渲染宽度
317
- ignoreHeight: false, //禁用页面的渲染高度
318
- ignoreFonts: false, //禁用字体渲染
319
- breakPages: true, //在分页符上启用分页
320
- ignoreLastRenderedPageBreak: true, //在lastRenderedPageBreak元素上禁用分页
321
- experimental: false, //启用实验功能(制表符停止计算)
322
- trimXmlDeclaration: true, //如果为true,则在解析之前将从xml文档中删除xml声明
323
- useBase64URL: false, //如果为true,图像、字体等将转换为base 64 URL,否则使用URL.createObjectURL
324
- useMathMLPolyfill: false, //包括用于铬、边等的MathML多填充。
325
- showChanges: false, //启用文档更改的实验渲染(插入/删除)
326
- debug: false, //启用额外的日志记录
327
- })
328
- }
563
+ docx.renderAsync(data, this.$refs.file, null, {
564
+ className: "docx", //默认和文档样式类的类名/前缀
565
+ inWrapper: true, //启用围绕文档内容呈现包装器
566
+ ignoreWidth: false, //禁用页面的渲染宽度
567
+ ignoreHeight: false, //禁用页面的渲染高度
568
+ ignoreFonts: false, //禁用字体渲染
569
+ breakPages: true, //在分页符上启用分页
570
+ ignoreLastRenderedPageBreak: true, //在lastRenderedPageBreak元素上禁用分页
571
+ experimental: false, //启用实验功能(制表符停止计算)
572
+ trimXmlDeclaration: true, //如果为true,则在解析之前将从xml文档中删除xml声明
573
+ useBase64URL: false, //如果为true,图像、字体等将转换为base 64 URL,否则使用URL.createObjectURL
574
+ useMathMLPolyfill: false, //包括用于铬、边等的MathML多填充。
575
+ showChanges: false, //启用文档更改的实验渲染(插入/删除)
576
+ debug: false, //启用额外的日志记录
577
+ })
578
+ }
329
579
  )
330
580
  }
331
581
  },
@@ -362,13 +612,38 @@ export default {
362
612
  return `处理时间:${item.auditDate}`
363
613
  }
364
614
  return `接收时间:${item.createTime}`
615
+ },
616
+ getRecordTime(item) {
617
+ // 获取记录的时间用于排序
618
+ if (item.auditResult) {
619
+ return item.auditDate || item.createTime;
620
+ }
621
+ return item.createTime || item.auditDate;
622
+ },
623
+ getTimelineDotColor(auditResult) {
624
+ if (this.auditPassStatus.includes(auditResult)) {
625
+ return '#005aff'; // 蓝色:通过状态
626
+ } else if (auditResult === '40' || auditResult === '50') {
627
+ return '#ffcc66'; // 黄色:驳回状态
628
+ } else if (auditResult === '60' || auditResult === '62' || auditResult === '83') {
629
+ return '#ed4014'; // 红色:撤回/委派状态
630
+ } else {
631
+ return '#ff9900'; // 橙色:其他状态
632
+ }
633
+ },
634
+ toggleSortBy(by) {
635
+ this.sortBy = by;
636
+ },
637
+ isPendingAudit(item) {
638
+ // 判断是否为待审批状态
639
+ // auditResult为空、null、undefined或者不在已审批状态列表中时,认为是待审批
640
+ return !item.auditResult || !this.auditPassStatus.includes(item.auditResult);
365
641
  }
366
642
  },
367
643
  mounted() {
368
644
  this.displayPushButton = this.donePage && this.pushButton;
369
645
  this.itemList = this.list;
370
646
  if (this.itemList.length > 0) {
371
- this.displayedList = this.itemList.slice(0, 2);
372
647
  // 初始化modals
373
648
  this.setModals.modals = this.itemList.map(() => ({value: false}));
374
649
  this.activeName = 'panel0';
@@ -379,10 +654,8 @@ export default {
379
654
  this.$nextTick(() => {
380
655
  this.itemList = newValue;
381
656
  if (this.itemList.length > 0) {
382
- this.displayedList = this.itemList.slice(0, 2);
383
657
  this.setModals.modals = this.itemList.map(() => ({value: false}));
384
658
  }
385
-
386
659
  });
387
660
  }
388
661
  }
@@ -393,26 +666,72 @@ export default {
393
666
 
394
667
  <style scoped>
395
668
  @import "../styles/css/index.less";
396
- /deep/ .docx {
669
+
670
+ .history-controls {
671
+ padding: 12px;
672
+ background-color: #f8f9fa;
673
+ border-radius: 6px;
674
+ border: 1px solid #e8eaec;
675
+ text-align: center;
676
+ }
677
+
678
+ .history-controls .ivu-btn-group .ivu-btn {
679
+ margin-right: 0;
680
+ }
681
+
682
+ .history-controls .ivu-btn-group .ivu-btn + .ivu-btn {
683
+ margin-left: -1px;
684
+ }
685
+
686
+ .history-title {
687
+ font-weight: 600;
688
+ color: #2c3e50;
689
+ }
690
+
691
+ .pending-audit-title {
692
+ font-weight: 600;
693
+ color: #ff9900;
694
+ font-size: 14px;
695
+ display: flex;
696
+ align-items: center;
697
+ }
698
+
699
+ /* 按时间排序的卡片样式 - 更小,不遮挡时间轴圆点 */
700
+ .portrait-card-time {
701
+ margin-left: 20px !important;
702
+ margin-right: 10px !important;
703
+ margin-bottom: 8px !important;
704
+ background-color: #fafafa !important;
705
+ }
706
+
707
+ :deep(.portrait-card-time .ivu-card-body) {
708
+ padding: 8px 12px !important;
709
+ }
710
+
711
+ :deep(.portrait-card-time .ivu-list-item) {
712
+ padding: 6px 0 !important;
713
+ }
714
+
715
+ :deep(.docx) {
397
716
  width: 100% !important;
398
717
  }
399
718
 
400
- /deep/ .ivu-timeline-item-tail {
719
+ :deep(.ivu-timeline-item-tail) {
401
720
  border-style: solid;
402
721
  border-left: none;
403
722
  border-color: #005aff;
404
723
  border-width: thin;
405
724
  }
406
725
 
407
- /deep/ .ivu-list-item {
726
+ :deep(.ivu-list-item) {
408
727
  padding-bottom: 0 !important;
409
728
  }
410
729
 
411
- /deep/ .ivu-collapse-content-box {
730
+ :deep(.ivu-collapse-content-box) {
412
731
  padding: 0 !important;
413
732
  }
414
733
 
415
- /deep/ .ivu-card-body {
734
+ :deep(.ivu-card-body) {
416
735
  padding: 5px !important;
417
736
  }
418
737