@lambo-design/workflow-approve 1.0.0-beta.46 → 1.0.0-beta.48

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.
@@ -1,400 +1,404 @@
1
- <template>
2
- <div>
3
-
4
- <Timeline class="portrait-timeline">
5
- <TimelineItem v-for="(items,index) in itemList" :key="index" class="portrait-timeline-item">
6
- <template #dot>
7
- <div v-if="items[0].auditResult === '00' || items[0].auditResult === '30' || items[0].auditResult === '80'" 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'" class="cicle" style="background-color: #ed4014"></div>
10
- <div v-else class="cicle" style="background-color: #ff9900"></div>
11
- </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-name-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 === '30'">通过</span>
61
- <span style="color: #ed4014; font-size: 13px;"
62
- v-else-if="item.auditResult === '40'">驳回上一节点</span>
63
- <span style="color: #ed4014; font-size: 13px;"
64
- v-else-if="item.auditResult === '50'">驳回到原点</span>
65
- <span style="color: #ed4014; font-size: 13px;"
66
- v-else-if="item.auditResult === '51'">流程终止</span>
67
- <span style="color: #ed4014; font-size: 13px;"
68
- v-else-if="item.auditResult === '60'">撤回</span>
69
- <span style="color: #19be6b; font-size: 13px;"
70
- v-else-if="item.auditResult === '80'">跳转指定节点</span>
71
- <span style="color: #19be6b; font-size: 13px;"
72
- v-else-if="item.auditResult === '90'">驳回指定节点</span>
73
- <span style="color: #ff9900; font-size: 13px;" v-else>{{ '待' + handleName }}</span>
74
- </Col>
75
- <Col span="12" style="text-align: right">
76
- <Button v-if="item.fileList && item.fileList.length > 0" size="small" type="primary" ghost class="urging" @click="openModal(item)">查看附件</Button>
77
- <Button v-if="displayPushButton && item.auditResult !== '00'&& item.auditResult !== '30'&&item.auditResult !== '40'&&item.auditResult !== '50'&&item.auditResult !== '60'&&item.auditResult!=='80'&&item.auditResult!=='90'"
78
- size="small" type="primary" ghost class="urging"
79
- @click="pushHim(item,itemListItem,itemListIndex)">催一下
80
- </Button>
81
- </Col>
82
- </Row>
83
- </Col>
84
- </Row>
85
-
86
- </ListItem>
87
- </List>
88
- </Card>
89
- </div>
90
- </div>
91
- </template>
92
- </Panel>
93
- </Collapse>
94
- </TimelineItem>
95
- </Timeline>
96
-
97
- <Modal
98
- v-model="showModal"
99
- title="查看附件"
100
- >
101
- <Table border
102
- :columns="attachmentColumn"
103
- :data="fileList"
104
- >
105
- </Table>
106
- </Modal>
107
- <div v-if="0 < allGroupKeys.length">
108
- <div v-show="arrowShow" class="arrow">
109
- <a @click="arrowClick">
110
- <Icon type="ios-arrow-down"/>
111
- 展开显示更多
112
- </a>
113
- </div>
114
- <div v-show="!arrowShow" class="arrow">
115
- <a @click="arrowClick">
116
- <Icon type="ios-arrow-up"/>
117
- 收缩
118
- </a>
119
- </div>
120
- </div>
121
- <Modal title="查看附件" v-model="modalImg" fullscreen scrollable :mask="false">
122
- <img :src="image" v-if="modalImg" alt="" style="width: 100%">
123
- <div slot="footer">
124
- <Button type="primary" @click="modalImg = false">关闭</Button>
125
- </div>
126
- </Modal>
127
- <Modal title="查看附件" v-model="modalDocx" fullscreen scrollable :mask="false">
128
- <div ref="file"></div>
129
- </Modal>
130
- </div>
131
- </template>
132
-
133
- <script>
134
- import ajax from "@lambo-design/shared/utils/ajax";
135
- import { operateHref } from '@lambo-design/shared/utils/assist'
136
- import axios from 'axios';
137
- // 引入docx-preview插件
138
- let docx = require('docx-preview');
139
- export default {
140
- components: {},
141
- props: {
142
- list: {
143
- type: Array,
144
- default: () => []
145
- },
146
- applyId: {
147
- type: String,
148
- default: ""
149
- },
150
- donePage: {
151
- type: Boolean,
152
- default: false
153
- },
154
- pushButton: {
155
- type: Boolean,
156
- default: true
157
- },
158
- handleName: {
159
- type: String,
160
- default: "审批"
161
- },
162
- //横竖版样式不同
163
- portraitWidth: {
164
- type: Number,
165
- default: 0
166
- },
167
- smartFlowServerContext: {
168
- type: String,
169
- default: '/api/smart-flow-server',
170
- },
171
- },
172
- data() {
173
- return {
174
- allGroupKeys: [],
175
- displayedList: [],
176
- arrowShow: true, // 控制加载更多按钮的显示
177
- activeName: 'panel0',
178
- modalDocx: false,
179
- setModals: {
180
- modals: []
181
- },
182
- showModal: false,
183
- fileList: [],
184
- modalImg: false,
185
- image: "",
186
- itemList: {},
187
- auditNameList: [],
188
- displayPushButton: false,
189
- }
190
- },
191
- computed: {
192
- attachmentColumn: function () {
193
- let column = [];
194
- column.push({title: '序号', type: 'index', width: 70, align: 'center', fixed: 'left'});
195
- column.push({
196
- title: '附件名称', key: 'fileName', minWidth: 150, align: 'center', fixed: 'left',
197
- render(h, {row}) {
198
- const index = row.fileName.lastIndexOf(".");
199
- const fileName = row.fileName.substr(0, index)
200
- return h("span", fileName)
201
-
202
- }
203
- });
204
- column.push({
205
- title: '附件类型', width: 100, align: 'center', fixed: 'left',
206
- render: (h, {row}) => {
207
- const index = row.fileName.lastIndexOf(".");
208
- const fileType = row.fileName.substr(index + 1)
209
- return h("span", fileType)
210
- }
211
- });
212
-
213
- column.push({
214
- title: "操作", width: 160, align: 'center', tooltip: true,
215
- render: (h, {row}) => {
216
- const index = row.fileName.lastIndexOf(".");
217
- const fileType = row.fileName.substr(index + 1).toLowerCase()
218
- const typeList=['jpg','gif','png','docx']
219
- if (typeList.indexOf(fileType) !== -1) {
220
- return h("div", [
221
- operateHref(this, h, row, "下载", () => {
222
- this.getAttach(row);
223
- }, "primary"),
224
- operateHref(this, h, row, "预览", () => {
225
- this.preViewAttach(row);
226
- }, "primary")
227
- ]);
228
- } else {
229
- return h("div", [
230
- operateHref(this, h, row, "下载", () => {
231
- this.getAttach(row);
232
- }, "primary")
233
- ]);
234
- }
235
-
236
- }
237
-
238
- });
239
- return column;
240
- }
241
- },
242
- methods: {
243
- pushHim(item, auditName, index) {
244
- if (this.isDebouncing) {
245
- return;
246
- }
247
-
248
- this.isDebouncing = true;
249
- // 设置一个延时,例如 1 秒,之后重置防抖状态
250
- setTimeout(() => {
251
- this.isDebouncing = false;
252
- }, 2000);
253
-
254
- let self = this;
255
- let applyUserName = item.applyUser.split(":")[1];
256
- let params = {
257
- applyUserName: applyUserName,
258
- auditName: auditName,
259
- auditId: item.auditId[index],
260
- procName: item.procName,
261
- effectTime: item.startDate,
262
- expireTime: item.warningDate,
263
- applyId: item.applyId,
264
- taskNode: item.taskNode
265
- };
266
- let url = self.smartFlowServerContext + "/manage/processTodo/sendMessage";
267
- ajax.post(url, params).then(function (resp) {
268
- console.log("message ", resp);
269
- if (resp.data.code == 200) {
270
- self.$Message.success("催办成功");
271
- } else {
272
- self.$Message.error("催办失败");
273
- }
274
- });
275
- },
276
- getAttach(row) {
277
- window.open(this.smartFlowServerContext + "/manage/oss/file/get/" + row.fileId, "_blank");
278
- },
279
- preViewAttach(row) {
280
- let reg = /\.(gif|jpg|jpeg|bmp|png|PNG)$/
281
- let regs = /\.(pdf)$/
282
- if (reg.test(row.fileName)) {
283
- let url = this.smartFlowServerContext + "/manage/oss/file/get/" + row.fileId;
284
- this.imgPreview(url);
285
- } else if (regs.test(row.fileName)) {
286
- window.open(this.smartFlowServerContext + "/manage/oss/file/getFileStream?fileId=" + row.fileId, "_blank");
287
- } else {
288
- this.modalDocx = true
289
- axios({
290
- method: 'get',
291
- responseType: 'blob', // 因为是流文件,所以要指定blob类型
292
- url: this.smartFlowServerContext + "/manage/oss/file/get/" + row.fileId// 一个word下载文件的接口
293
- }).then(({data}) => {
294
- docx.renderAsync(data, this.$refs.file, null, {
295
- className: "docx", //默认和文档样式类的类名/前缀
296
- inWrapper: true, //启用围绕文档内容呈现包装器
297
- ignoreWidth: false, //禁用页面的渲染宽度
298
- ignoreHeight: false, //禁用页面的渲染高度
299
- ignoreFonts: false, //禁用字体渲染
300
- breakPages: true, //在分页符上启用分页
301
- ignoreLastRenderedPageBreak: true, //在lastRenderedPageBreak元素上禁用分页
302
- experimental: false, //启用实验功能(制表符停止计算)
303
- trimXmlDeclaration: true, //如果为true,则在解析之前将从xml文档中删除xml声明
304
- useBase64URL: false, //如果为true,图像、字体等将转换为base 64 URL,否则使用URL.createObjectURL
305
- useMathMLPolyfill: false, //包括用于铬、边等的MathML多填充。
306
- showChanges: false, //启用文档更改的实验渲染(插入/删除)
307
- debug: false, //启用额外的日志记录
308
- })
309
- }
310
- )
311
- }
312
- },
313
- //查看附件
314
- imgPreview: function (img) {
315
- this.modalImg = true
316
- this.image = img;
317
- },
318
- arrowClick() {
319
- if (this.itemList.length > 0) {
320
- if (this.arrowShow) {
321
- // 显示全部
322
- this.displayedList = this.itemList;
323
- this.arrowShow = false;
324
- } else {
325
- // 只显示两个
326
- this.displayedList = this.itemList.slice(0, 2);
327
- this.arrowShow = true;
328
- }
329
- }
330
- },
331
- openModal(item) {
332
- this.fileList = item.fileList
333
- this.showModal = true
334
- },
335
- getFirstName(item) {
336
- return item ? item[0] : ''
337
- },
338
- showDate(item) {
339
- if (item.auditResult){
340
- if (item.auditResult === '00'){
341
- return `发起时间:${item.auditDate}`
342
- }
343
- return `处理时间:${item.auditDate}`
344
- }
345
- return `接收时间:${item.createTime}`
346
- }
347
- },
348
- mounted() {
349
- this.displayPushButton = this.donePage && this.pushButton;
350
- this.itemList = this.list;
351
- if (this.itemList.length > 0) {
352
- this.displayedList = this.itemList.slice(0, 2);
353
- // 初始化modals
354
- this.setModals.modals = this.itemList.map(() => ({value: false}));
355
- this.activeName = 'panel0';
356
- }
357
- },
358
- watch: {
359
- list: function (newValue) {
360
- this.$nextTick(() => {
361
- this.itemList = newValue;
362
- if (this.itemList.length > 0) {
363
- this.displayedList = this.itemList.slice(0, 2);
364
- this.setModals.modals = this.itemList.map(() => ({value: false}));
365
- }
366
-
367
- });
368
- }
369
- }
370
-
371
-
372
- }
373
- </script>
374
-
375
- <style scoped>
376
- @import "../styles/css/index.less";
377
- /deep/ .docx {
378
- width: 100% !important;
379
- }
380
-
381
- /deep/ .ivu-timeline-item-tail {
382
- border-style: solid;
383
- border-left: none;
384
- border-color: #005aff;
385
- border-width: thin;
386
- }
387
-
388
- /deep/ .ivu-list-item {
389
- padding-bottom: 0 !important;
390
- }
391
-
392
- /deep/ .ivu-collapse-content-box {
393
- padding: 0 !important;
394
- }
395
-
396
- /deep/ .ivu-card-body {
397
- padding: 5px !important;
398
- }
399
-
400
- </style>
1
+ <template>
2
+ <div>
3
+
4
+ <Timeline class="portrait-timeline">
5
+ <TimelineItem v-for="(items,index) in itemList" :key="index" class="portrait-timeline-item">
6
+ <template #dot>
7
+ <div v-if="items[0].auditResult === '00' || items[0].auditResult === '10' || items[0].auditResult === '30' || items[0].auditResult === '80'" 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 === '83'" class="cicle" style="background-color: #ed4014"></div>
10
+ <div v-else class="cicle" style="background-color: #ff9900"></div>
11
+ </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-name-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 === '30'">通过</span>
63
+ <span style="color: #ed4014; font-size: 13px;"
64
+ v-else-if="item.auditResult === '40'">驳回上一节点</span>
65
+ <span style="color: #ed4014; font-size: 13px;"
66
+ v-else-if="item.auditResult === '50'">驳回到原点</span>
67
+ <span style="color: #ed4014; font-size: 13px;"
68
+ v-else-if="item.auditResult === '51'">流程终止</span>
69
+ <span style="color: #ed4014; font-size: 13px;"
70
+ v-else-if="item.auditResult === '60'">撤回</span>
71
+ <span style="color: #19be6b; font-size: 13px;"
72
+ v-else-if="item.auditResult === '80'">跳转指定节点</span>
73
+ <span style="color: #ed4014; font-size: 13px;"
74
+ v-else-if="item.auditResult === '83'">会签减签</span>
75
+ <span style="color: #19be6b; font-size: 13px;"
76
+ v-else-if="item.auditResult === '90'">驳回指定节点</span>
77
+ <span style="color: #ff9900; font-size: 13px;" v-else>{{ '' + handleName }}</span>
78
+ </Col>
79
+ <Col span="12" style="text-align: right">
80
+ <Button v-if="item.fileList && item.fileList.length > 0" size="small" type="primary" ghost class="urging" @click="openModal(item)">查看附件</Button>
81
+ <Button v-if="displayPushButton && item.auditResult !== '00' && item.auditResult !== '10' && item.auditResult !== '30'&&item.auditResult !== '40'&&item.auditResult !== '50'&&item.auditResult !== '60'&&item.auditResult!=='80'&&item.auditResult!=='83'&&item.auditResult!=='90'"
82
+ size="small" type="primary" ghost class="urging"
83
+ @click="pushHim(item,itemListItem,itemListIndex)">催一下
84
+ </Button>
85
+ </Col>
86
+ </Row>
87
+ </Col>
88
+ </Row>
89
+
90
+ </ListItem>
91
+ </List>
92
+ </Card>
93
+ </div>
94
+ </div>
95
+ </template>
96
+ </Panel>
97
+ </Collapse>
98
+ </TimelineItem>
99
+ </Timeline>
100
+
101
+ <Modal
102
+ v-model="showModal"
103
+ title="查看附件"
104
+ >
105
+ <Table border
106
+ :columns="attachmentColumn"
107
+ :data="fileList"
108
+ >
109
+ </Table>
110
+ </Modal>
111
+ <div v-if="0 < allGroupKeys.length">
112
+ <div v-show="arrowShow" class="arrow">
113
+ <a @click="arrowClick">
114
+ <Icon type="ios-arrow-down"/>
115
+ 展开显示更多
116
+ </a>
117
+ </div>
118
+ <div v-show="!arrowShow" class="arrow">
119
+ <a @click="arrowClick">
120
+ <Icon type="ios-arrow-up"/>
121
+ 收缩
122
+ </a>
123
+ </div>
124
+ </div>
125
+ <Modal title="查看附件" v-model="modalImg" fullscreen scrollable :mask="false">
126
+ <img :src="image" v-if="modalImg" alt="" style="width: 100%">
127
+ <div slot="footer">
128
+ <Button type="primary" @click="modalImg = false">关闭</Button>
129
+ </div>
130
+ </Modal>
131
+ <Modal title="查看附件" v-model="modalDocx" fullscreen scrollable :mask="false">
132
+ <div ref="file"></div>
133
+ </Modal>
134
+ </div>
135
+ </template>
136
+
137
+ <script>
138
+ import ajax from "@lambo-design/shared/utils/ajax";
139
+ import { operateHref } from '@lambo-design/shared/utils/assist'
140
+ import axios from 'axios';
141
+ // 引入docx-preview插件
142
+ let docx = require('docx-preview');
143
+ export default {
144
+ components: {},
145
+ props: {
146
+ list: {
147
+ type: Array,
148
+ default: () => []
149
+ },
150
+ applyId: {
151
+ type: String,
152
+ default: ""
153
+ },
154
+ donePage: {
155
+ type: Boolean,
156
+ default: false
157
+ },
158
+ pushButton: {
159
+ type: Boolean,
160
+ default: true
161
+ },
162
+ handleName: {
163
+ type: String,
164
+ default: "审批"
165
+ },
166
+ //横竖版样式不同
167
+ portraitWidth: {
168
+ type: Number,
169
+ default: 0
170
+ },
171
+ smartFlowServerContext: {
172
+ type: String,
173
+ default: '/api/smart-flow-server',
174
+ },
175
+ },
176
+ data() {
177
+ return {
178
+ allGroupKeys: [],
179
+ displayedList: [],
180
+ arrowShow: true, // 控制加载更多按钮的显示
181
+ activeName: 'panel0',
182
+ modalDocx: false,
183
+ setModals: {
184
+ modals: []
185
+ },
186
+ showModal: false,
187
+ fileList: [],
188
+ modalImg: false,
189
+ image: "",
190
+ itemList: {},
191
+ auditNameList: [],
192
+ displayPushButton: false,
193
+ }
194
+ },
195
+ computed: {
196
+ attachmentColumn: function () {
197
+ let column = [];
198
+ column.push({title: '序号', type: 'index', width: 70, align: 'center', fixed: 'left'});
199
+ column.push({
200
+ title: '附件名称', key: 'fileName', minWidth: 150, align: 'center', fixed: 'left',
201
+ render(h, {row}) {
202
+ const index = row.fileName.lastIndexOf(".");
203
+ const fileName = row.fileName.substr(0, index)
204
+ return h("span", fileName)
205
+
206
+ }
207
+ });
208
+ column.push({
209
+ title: '附件类型', width: 100, align: 'center', fixed: 'left',
210
+ render: (h, {row}) => {
211
+ const index = row.fileName.lastIndexOf(".");
212
+ const fileType = row.fileName.substr(index + 1)
213
+ return h("span", fileType)
214
+ }
215
+ });
216
+
217
+ column.push({
218
+ title: "操作", width: 160, align: 'center', tooltip: true,
219
+ render: (h, {row}) => {
220
+ const index = row.fileName.lastIndexOf(".");
221
+ const fileType = row.fileName.substr(index + 1).toLowerCase()
222
+ const typeList=['jpg','gif','png','docx']
223
+ if (typeList.indexOf(fileType) !== -1) {
224
+ return h("div", [
225
+ operateHref(this, h, row, "下载", () => {
226
+ this.getAttach(row);
227
+ }, "primary"),
228
+ operateHref(this, h, row, "预览", () => {
229
+ this.preViewAttach(row);
230
+ }, "primary")
231
+ ]);
232
+ } else {
233
+ return h("div", [
234
+ operateHref(this, h, row, "下载", () => {
235
+ this.getAttach(row);
236
+ }, "primary")
237
+ ]);
238
+ }
239
+
240
+ }
241
+
242
+ });
243
+ return column;
244
+ }
245
+ },
246
+ methods: {
247
+ pushHim(item, auditName, index) {
248
+ if (this.isDebouncing) {
249
+ return;
250
+ }
251
+
252
+ this.isDebouncing = true;
253
+ // 设置一个延时,例如 1 秒,之后重置防抖状态
254
+ setTimeout(() => {
255
+ this.isDebouncing = false;
256
+ }, 2000);
257
+
258
+ let self = this;
259
+ let applyUserName = item.applyUser.split(":")[1];
260
+ let params = {
261
+ applyUserName: applyUserName,
262
+ auditName: auditName,
263
+ auditId: item.auditId[index],
264
+ procName: item.procName,
265
+ effectTime: item.startDate,
266
+ expireTime: item.warningDate,
267
+ applyId: item.applyId,
268
+ taskNode: item.taskNode
269
+ };
270
+ let url = self.smartFlowServerContext + "/manage/processTodo/sendMessage";
271
+ ajax.post(url, params).then(function (resp) {
272
+ console.log("message ", resp);
273
+ if (resp.data.code == 200) {
274
+ self.$Message.success("催办成功");
275
+ } else {
276
+ self.$Message.error("催办失败");
277
+ }
278
+ });
279
+ },
280
+ getAttach(row) {
281
+ window.open(this.smartFlowServerContext + "/manage/oss/file/get/" + row.fileId, "_blank");
282
+ },
283
+ preViewAttach(row) {
284
+ let reg = /\.(gif|jpg|jpeg|bmp|png|PNG)$/
285
+ let regs = /\.(pdf)$/
286
+ if (reg.test(row.fileName)) {
287
+ let url = this.smartFlowServerContext + "/manage/oss/file/get/" + row.fileId;
288
+ this.imgPreview(url);
289
+ } else if (regs.test(row.fileName)) {
290
+ window.open(this.smartFlowServerContext + "/manage/oss/file/getFileStream?fileId=" + row.fileId, "_blank");
291
+ } else {
292
+ this.modalDocx = true
293
+ axios({
294
+ method: 'get',
295
+ responseType: 'blob', // 因为是流文件,所以要指定blob类型
296
+ url: this.smartFlowServerContext + "/manage/oss/file/get/" + row.fileId// 一个word下载文件的接口
297
+ }).then(({data}) => {
298
+ docx.renderAsync(data, this.$refs.file, null, {
299
+ className: "docx", //默认和文档样式类的类名/前缀
300
+ inWrapper: true, //启用围绕文档内容呈现包装器
301
+ ignoreWidth: false, //禁用页面的渲染宽度
302
+ ignoreHeight: false, //禁用页面的渲染高度
303
+ ignoreFonts: false, //禁用字体渲染
304
+ breakPages: true, //在分页符上启用分页
305
+ ignoreLastRenderedPageBreak: true, //在lastRenderedPageBreak元素上禁用分页
306
+ experimental: false, //启用实验功能(制表符停止计算)
307
+ trimXmlDeclaration: true, //如果为true,则在解析之前将从xml文档中删除xml声明
308
+ useBase64URL: false, //如果为true,图像、字体等将转换为base 64 URL,否则使用URL.createObjectURL
309
+ useMathMLPolyfill: false, //包括用于铬、边等的MathML多填充。
310
+ showChanges: false, //启用文档更改的实验渲染(插入/删除)
311
+ debug: false, //启用额外的日志记录
312
+ })
313
+ }
314
+ )
315
+ }
316
+ },
317
+ //查看附件
318
+ imgPreview: function (img) {
319
+ this.modalImg = true
320
+ this.image = img;
321
+ },
322
+ arrowClick() {
323
+ if (this.itemList.length > 0) {
324
+ if (this.arrowShow) {
325
+ // 显示全部
326
+ this.displayedList = this.itemList;
327
+ this.arrowShow = false;
328
+ } else {
329
+ // 只显示两个
330
+ this.displayedList = this.itemList.slice(0, 2);
331
+ this.arrowShow = true;
332
+ }
333
+ }
334
+ },
335
+ openModal(item) {
336
+ this.fileList = item.fileList
337
+ this.showModal = true
338
+ },
339
+ getFirstName(item) {
340
+ return item ? item[0] : ''
341
+ },
342
+ showDate(item) {
343
+ if (item.auditResult){
344
+ if (item.auditResult === '00'){
345
+ return `发起时间:${item.auditDate}`
346
+ }
347
+ return `处理时间:${item.auditDate}`
348
+ }
349
+ return `接收时间:${item.createTime}`
350
+ }
351
+ },
352
+ mounted() {
353
+ this.displayPushButton = this.donePage && this.pushButton;
354
+ this.itemList = this.list;
355
+ if (this.itemList.length > 0) {
356
+ this.displayedList = this.itemList.slice(0, 2);
357
+ // 初始化modals
358
+ this.setModals.modals = this.itemList.map(() => ({value: false}));
359
+ this.activeName = 'panel0';
360
+ }
361
+ },
362
+ watch: {
363
+ list: function (newValue) {
364
+ this.$nextTick(() => {
365
+ this.itemList = newValue;
366
+ if (this.itemList.length > 0) {
367
+ this.displayedList = this.itemList.slice(0, 2);
368
+ this.setModals.modals = this.itemList.map(() => ({value: false}));
369
+ }
370
+
371
+ });
372
+ }
373
+ }
374
+
375
+
376
+ }
377
+ </script>
378
+
379
+ <style scoped>
380
+ @import "../styles/css/index.less";
381
+ /deep/ .docx {
382
+ width: 100% !important;
383
+ }
384
+
385
+ /deep/ .ivu-timeline-item-tail {
386
+ border-style: solid;
387
+ border-left: none;
388
+ border-color: #005aff;
389
+ border-width: thin;
390
+ }
391
+
392
+ /deep/ .ivu-list-item {
393
+ padding-bottom: 0 !important;
394
+ }
395
+
396
+ /deep/ .ivu-collapse-content-box {
397
+ padding: 0 !important;
398
+ }
399
+
400
+ /deep/ .ivu-card-body {
401
+ padding: 5px !important;
402
+ }
403
+
404
+ </style>