@lambo-design/workflow-approve 1.0.0-beta.7 → 1.0.0-beta.71

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