@lambo-design/workflow-approve 1.0.0-beta.96 → 1.0.0-beta.97
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 +3 -3
- package/src/components/assignee-box.vue +51 -36
- package/src/components/history.vue +2 -1
- package/src/components/horizontal/attachment.vue +224 -224
- package/src/components/horizontal/history.vue +464 -464
- package/src/components/horizontal/opinion.vue +263 -263
- package/src/components/title.vue +24 -24
- package/src/horizontal.vue +1002 -1002
- package/src/portrait.vue +166 -109
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lambo-design/workflow-approve",
|
|
3
|
-
"version": "1.0.0-beta.
|
|
3
|
+
"version": "1.0.0-beta.97",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"author": "lambo",
|
|
@@ -12,8 +12,8 @@
|
|
|
12
12
|
"devDependencies": {
|
|
13
13
|
"axios": "^0.24.0",
|
|
14
14
|
"axios-cache-plugin": "^0.1.0",
|
|
15
|
-
"@lambo-design/core": "^4.7.1-beta.
|
|
16
|
-
"@lambo-design/shared": "^1.0.0-beta.
|
|
15
|
+
"@lambo-design/core": "^4.7.1-beta.170",
|
|
16
|
+
"@lambo-design/shared": "^1.0.0-beta.299"
|
|
17
17
|
},
|
|
18
18
|
"dependencies": {
|
|
19
19
|
"bpmn-js": "^7.3.1",
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
</div>
|
|
12
12
|
</div>
|
|
13
13
|
<div class="org-detil">
|
|
14
|
-
<LamboPagingTable ref="selection" highlight-row :data="tableData" :dataUrl="dataUrl" :columns="tableColumn" :searchParams="tableSearchParams"
|
|
14
|
+
<LamboPagingTable :key="useTransferRangeUsers" ref="selection" highlight-row :data="tableData" :dataUrl="dataUrl" :columns="tableColumn" :searchParams="tableSearchParams" :height="tableHeight"
|
|
15
15
|
@on-selection-change="onSelectionChange" @on-current-change="onCurrentChange" :page-disable="useTransferRangeUsers" :showTableOption="!useTransferRangeUsers">
|
|
16
16
|
<div slot="search" v-if="!useTransferRangeUsers">
|
|
17
17
|
<Form :label-width="60">
|
|
@@ -135,7 +135,9 @@ export default {
|
|
|
135
135
|
this.getSystemConfig()
|
|
136
136
|
},
|
|
137
137
|
computed: {
|
|
138
|
-
|
|
138
|
+
tableHeight(){
|
|
139
|
+
return this.useTransferRangeUsers ? 600 : 0
|
|
140
|
+
},
|
|
139
141
|
tableColumn () {
|
|
140
142
|
let columns = []
|
|
141
143
|
let self = this
|
|
@@ -162,7 +164,7 @@ export default {
|
|
|
162
164
|
sortable: 'custom'
|
|
163
165
|
})
|
|
164
166
|
|
|
165
|
-
if (self.useTransferRangeUsers){
|
|
167
|
+
if (self.useTransferRangeUsers && self.ucAdapterType == 'x1'){
|
|
166
168
|
columns.push({
|
|
167
169
|
title: '联系电话',
|
|
168
170
|
key: 'tel',
|
|
@@ -176,30 +178,33 @@ export default {
|
|
|
176
178
|
sortField: 'organ_name',
|
|
177
179
|
sortable: 'custom'
|
|
178
180
|
})
|
|
179
|
-
if (self.useTransferRangeUsers){
|
|
181
|
+
if (self.useTransferRangeUsers && self.ucAdapterType == 'x1'){
|
|
180
182
|
columns.push({
|
|
181
183
|
title: '公司名称',
|
|
182
184
|
key: 'comName',
|
|
183
185
|
sortField: 'com_name',
|
|
184
186
|
sortable: 'custom'
|
|
185
187
|
})
|
|
186
|
-
}
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
state =
|
|
197
|
-
|
|
198
|
-
|
|
188
|
+
}
|
|
189
|
+
if (!self.useTransferRangeUsers){
|
|
190
|
+
{
|
|
191
|
+
columns.push({
|
|
192
|
+
title: '状态',
|
|
193
|
+
key: 'status',
|
|
194
|
+
sortable: 'custom',
|
|
195
|
+
align: 'center',
|
|
196
|
+
width: 100,
|
|
197
|
+
render: function (h, param) {
|
|
198
|
+
let state = param.row.status
|
|
199
|
+
if (state === '00') {
|
|
200
|
+
state = '正常'
|
|
201
|
+
} else {
|
|
202
|
+
state = '锁定'
|
|
203
|
+
}
|
|
204
|
+
return h('span', state)
|
|
199
205
|
}
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
})
|
|
206
|
+
})
|
|
207
|
+
}
|
|
203
208
|
}
|
|
204
209
|
|
|
205
210
|
return columns
|
|
@@ -309,23 +314,33 @@ export default {
|
|
|
309
314
|
code: self.data.auditResult,
|
|
310
315
|
name: self.data.auditResultName,
|
|
311
316
|
}
|
|
312
|
-
self.
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
317
|
+
self.$Modal.confirm({
|
|
318
|
+
title: '提示',
|
|
319
|
+
content: '确定要' + auditResult.name + '吗?',
|
|
320
|
+
onOk: () => {
|
|
321
|
+
self.data.selectedUserId=idSelectedArr[0];
|
|
322
|
+
let url = this.smartFlowServerContext + '/manage/processTodo/audit'
|
|
323
|
+
ajax.post(url, self.data).then(function (resp) {
|
|
324
|
+
let result = resp.data
|
|
325
|
+
if (result.code == '200') {
|
|
326
|
+
self.loading = false
|
|
327
|
+
self.$Message.success(result.message);
|
|
328
|
+
if (self.executionCompleted) {
|
|
329
|
+
self.executionCompleted(true, self.data.instanceId, self.data.taskId, auditResult, self.data.taskId);
|
|
330
|
+
}
|
|
331
|
+
self.toBeDoneListDoSearch();
|
|
332
|
+
} else {
|
|
333
|
+
self.loading = false
|
|
334
|
+
self.$Message.error(result.message)
|
|
335
|
+
if (self.executionCompleted) {
|
|
336
|
+
self.executionCompleted(false, null, null, auditResult, self.data.taskId);
|
|
337
|
+
}
|
|
338
|
+
}
|
|
339
|
+
})
|
|
340
|
+
},
|
|
341
|
+
onCancel: () => {
|
|
324
342
|
self.loading = false
|
|
325
|
-
self
|
|
326
|
-
if (self.executionCompleted) {
|
|
327
|
-
self.executionCompleted(false, null, null, auditResult, self.data.taskId);
|
|
328
|
-
}
|
|
343
|
+
self.disable = false
|
|
329
344
|
}
|
|
330
345
|
})
|
|
331
346
|
} else if (self.helpBoxType === 'delegateTask'){
|
|
@@ -381,7 +381,7 @@ export default {
|
|
|
381
381
|
allGroupKeys: [],
|
|
382
382
|
displayedList: [],
|
|
383
383
|
arrowShow: true, // 控制加载更多按钮的显示
|
|
384
|
-
activeName: '
|
|
384
|
+
activeName: '',
|
|
385
385
|
modalDocx: false,
|
|
386
386
|
setModals: {
|
|
387
387
|
modals: []
|
|
@@ -513,6 +513,7 @@ export default {
|
|
|
513
513
|
|
|
514
514
|
return groupedRecords;
|
|
515
515
|
} else {
|
|
516
|
+
this.activeName = ''
|
|
516
517
|
// 按节点分组:保持原有的节点分组结构
|
|
517
518
|
return this.itemList;
|
|
518
519
|
}
|
|
@@ -1,224 +1,224 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div>
|
|
3
|
-
<Row>
|
|
4
|
-
<Row>
|
|
5
|
-
<span v-for="(item, index) in attachmentdata" :key="index" style="font-size: 14px">
|
|
6
|
-
<span v-if="index>0">、</span>
|
|
7
|
-
<span style="color:#2D8cF0 "> {{ item.fileName }}</span>
|
|
8
|
-
<a @click="forRemoveAttachment(index)" style="font-size: 13px;">.删除</a>
|
|
9
|
-
</span>
|
|
10
|
-
<div>
|
|
11
|
-
<div slot="buttons">
|
|
12
|
-
<Upload :action="actionUrl" :on-error="handleError" :before-upload="handleUpload" :show-upload-list="false"
|
|
13
|
-
multiple
|
|
14
|
-
:on-success="handleSuccess" :on-progress="handleProgress"
|
|
15
|
-
:on-format-error="handleFormatError"
|
|
16
|
-
:format="['xlsx', 'xls','txt','rar','zip','doc','docx','jpg','pdf','gif','png']">
|
|
17
|
-
<Button :loading="loading" icon="ios-arrow-round-up" type="primary"
|
|
18
|
-
style="color: #808080;border-color:#e0e0e0;" ghost>添加附件
|
|
19
|
-
</Button>
|
|
20
|
-
</Upload>
|
|
21
|
-
</div>
|
|
22
|
-
</div>
|
|
23
|
-
</Row>
|
|
24
|
-
<Row style="margin-top: 10px">
|
|
25
|
-
<span style="color: red;font-size: 14px">* 支持扩展名: .rar .zip .doc .docx .pdf .jpg...</span>
|
|
26
|
-
</Row>
|
|
27
|
-
</Row>
|
|
28
|
-
</div>
|
|
29
|
-
</template>
|
|
30
|
-
|
|
31
|
-
<script>
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
export default {
|
|
35
|
-
name: "attachment",
|
|
36
|
-
components: {},
|
|
37
|
-
props: {
|
|
38
|
-
actionUrl: {
|
|
39
|
-
default: "/api/oss-server/file/put",
|
|
40
|
-
},
|
|
41
|
-
attachmentdata: {
|
|
42
|
-
type: Array,
|
|
43
|
-
default: function () {
|
|
44
|
-
return []
|
|
45
|
-
}
|
|
46
|
-
},
|
|
47
|
-
attachmentColumn: {
|
|
48
|
-
default: function () {
|
|
49
|
-
let column = [
|
|
50
|
-
{title: "序号", type: 'index', width: 80, align: "center"},
|
|
51
|
-
{
|
|
52
|
-
title: "相关附件", key: "fileName", minWidth: 200, align: 'left', tooltip: true,
|
|
53
|
-
render: (h, {row}) => {
|
|
54
|
-
return h("a", {
|
|
55
|
-
on: {
|
|
56
|
-
'click': () => {
|
|
57
|
-
let reg = /\.(gif|jpg|jpeg|bmp|png)$/
|
|
58
|
-
let regs = /\.pdf$/
|
|
59
|
-
if (reg.test(row.fileName)) {
|
|
60
|
-
let imgs = [];
|
|
61
|
-
let url = this.ossServerContext + "/file/get/" + row.fileId;
|
|
62
|
-
this.imgPreview(url);
|
|
63
|
-
} else if (regs.test(row.fileName)) {
|
|
64
|
-
window.open(this.ossServerContext + "/file/getFileStream?fileId=" + row.fileId, "_blank");
|
|
65
|
-
} else {
|
|
66
|
-
window.open(this.ossServerContext + "/file/get/" + row.fileId, "_blank");
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
}, row.fileName);
|
|
71
|
-
}
|
|
72
|
-
},
|
|
73
|
-
{
|
|
74
|
-
title: "操作", width: 80, align: "center",
|
|
75
|
-
render: (h, {index}) => {
|
|
76
|
-
return h('div', [
|
|
77
|
-
h('Button', {
|
|
78
|
-
props: {
|
|
79
|
-
type: 'warning',
|
|
80
|
-
size: 'small',
|
|
81
|
-
ghost: true
|
|
82
|
-
},
|
|
83
|
-
on: {
|
|
84
|
-
click: () => {
|
|
85
|
-
this.forRemoveAttachment(index)
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
}, '删除')
|
|
89
|
-
]);
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
];
|
|
93
|
-
return column
|
|
94
|
-
}
|
|
95
|
-
},
|
|
96
|
-
},
|
|
97
|
-
data() {
|
|
98
|
-
return {
|
|
99
|
-
loading: false,
|
|
100
|
-
modalImg: false,
|
|
101
|
-
image: "",
|
|
102
|
-
tempFileArr: [],
|
|
103
|
-
percentage: null,
|
|
104
|
-
file_name: '',
|
|
105
|
-
fileList: [],
|
|
106
|
-
}
|
|
107
|
-
},
|
|
108
|
-
methods: {
|
|
109
|
-
openAttachment(item) {
|
|
110
|
-
let reg = /\.(gif|jpg|jpeg|bmp|png)$/;
|
|
111
|
-
let regs = /\.pdf$/;
|
|
112
|
-
|
|
113
|
-
if (reg.test(item.fileName)) {
|
|
114
|
-
let imgs = [];
|
|
115
|
-
let url = this.ossServerContext + "/file/get/" + item.fileId;
|
|
116
|
-
this.imgPreview(url);
|
|
117
|
-
} else if (regs.test(item.fileName)) {
|
|
118
|
-
window.open(this.ossServerContext + "/file/getFileStream?fileId=" + item.fileId, "_blank");
|
|
119
|
-
} else {
|
|
120
|
-
window.open(this.ossServerContext + "/file/get/" + item.fileId, "_blank");
|
|
121
|
-
}
|
|
122
|
-
},
|
|
123
|
-
handleSuccess: function (response, file, fileList) {
|
|
124
|
-
let self = this;
|
|
125
|
-
let tempArr = JSON.parse(JSON.stringify(this.tempFileArr))
|
|
126
|
-
|
|
127
|
-
tempArr.forEach(function (value, index, array) {
|
|
128
|
-
if (value == file.name) {
|
|
129
|
-
self.tempFileArr.splice(index, 1)
|
|
130
|
-
}
|
|
131
|
-
});
|
|
132
|
-
|
|
133
|
-
if (response.code == 1 && self.tempFileArr && self.tempFileArr.length < 1) {
|
|
134
|
-
self.loading = false;
|
|
135
|
-
self.$Message.success("上传成功");
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
if (response.code == 1) {
|
|
139
|
-
if (response.data != undefined && response.data != null && response.data.length > 0) {
|
|
140
|
-
let tempData = [].concat(response.data);
|
|
141
|
-
this.attachmentdata.push({
|
|
142
|
-
fileName: tempData[0].originalName,
|
|
143
|
-
fileId: tempData[0].fileName,
|
|
144
|
-
});
|
|
145
|
-
}
|
|
146
|
-
|
|
147
|
-
this.fileList = fileList
|
|
148
|
-
|
|
149
|
-
} else {
|
|
150
|
-
self.loading = false;
|
|
151
|
-
this.$Message.error({
|
|
152
|
-
content: file.name + '上传失败!',
|
|
153
|
-
});
|
|
154
|
-
//this.$Message.error("上传失败!");
|
|
155
|
-
|
|
156
|
-
let j = 0;
|
|
157
|
-
for (let i = 0; i < fileList.length; i++) {
|
|
158
|
-
if (fileList[i].canceled) {
|
|
159
|
-
continue;
|
|
160
|
-
}
|
|
161
|
-
if (fileList[i].name === file.name && fileList[i].timestamp === file.timestamp) {
|
|
162
|
-
j = i;
|
|
163
|
-
}
|
|
164
|
-
}
|
|
165
|
-
|
|
166
|
-
//console.log(fileList)
|
|
167
|
-
fileList.splice(j, 1);
|
|
168
|
-
|
|
169
|
-
}
|
|
170
|
-
|
|
171
|
-
},
|
|
172
|
-
handleError: function (error, file, fileList) {
|
|
173
|
-
this.loading = false
|
|
174
|
-
this.$Message.error({
|
|
175
|
-
content: fileList.name + ' 上传失败!',
|
|
176
|
-
});
|
|
177
|
-
},
|
|
178
|
-
handleUpload: function (file) {
|
|
179
|
-
if (!file.canceled) {
|
|
180
|
-
this.tempFileArr.push(file.name)
|
|
181
|
-
}
|
|
182
|
-
},
|
|
183
|
-
forRemoveAttachment: function (index) {
|
|
184
|
-
this.attachmentdata.splice(index, 1);
|
|
185
|
-
this.$refs.attachmentTable.tableRefresh()
|
|
186
|
-
},
|
|
187
|
-
//查看附件
|
|
188
|
-
imgPreview: function (img) {
|
|
189
|
-
this.modalImg = true
|
|
190
|
-
this.image = img;
|
|
191
|
-
},
|
|
192
|
-
//查看附件
|
|
193
|
-
cancelUpload: function (item, fileList) {
|
|
194
|
-
item.showProgress = false;
|
|
195
|
-
item.canceled = true;
|
|
196
|
-
},
|
|
197
|
-
handleProgress(event, file, fileList) {
|
|
198
|
-
this.loading = true
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
},
|
|
202
|
-
handleFormatError(file) {
|
|
203
|
-
this.loading = false
|
|
204
|
-
this.$Notice.warning({
|
|
205
|
-
title: "文件格式不正确",
|
|
206
|
-
desc: "文件 " + file.name + " 格式不支持,请上传其他格式的文件。",
|
|
207
|
-
});
|
|
208
|
-
},
|
|
209
|
-
|
|
210
|
-
}
|
|
211
|
-
}
|
|
212
|
-
</script>
|
|
213
|
-
|
|
214
|
-
<style scoped>
|
|
215
|
-
.demo-spin-icon-load {
|
|
216
|
-
animation: ani-demo-spin 1s linear infinite;
|
|
217
|
-
}
|
|
218
|
-
|
|
219
|
-
/deep/ .ivu-icon {
|
|
220
|
-
zoom: 130%;
|
|
221
|
-
color: #808080;
|
|
222
|
-
margin-right: -1px;
|
|
223
|
-
}
|
|
224
|
-
</style>
|
|
1
|
+
<template>
|
|
2
|
+
<div>
|
|
3
|
+
<Row>
|
|
4
|
+
<Row>
|
|
5
|
+
<span v-for="(item, index) in attachmentdata" :key="index" style="font-size: 14px">
|
|
6
|
+
<span v-if="index>0">、</span>
|
|
7
|
+
<span style="color:#2D8cF0 "> {{ item.fileName }}</span>
|
|
8
|
+
<a @click="forRemoveAttachment(index)" style="font-size: 13px;">.删除</a>
|
|
9
|
+
</span>
|
|
10
|
+
<div>
|
|
11
|
+
<div slot="buttons">
|
|
12
|
+
<Upload :action="actionUrl" :on-error="handleError" :before-upload="handleUpload" :show-upload-list="false"
|
|
13
|
+
multiple
|
|
14
|
+
:on-success="handleSuccess" :on-progress="handleProgress"
|
|
15
|
+
:on-format-error="handleFormatError"
|
|
16
|
+
:format="['xlsx', 'xls','txt','rar','zip','doc','docx','jpg','pdf','gif','png']">
|
|
17
|
+
<Button :loading="loading" icon="ios-arrow-round-up" type="primary"
|
|
18
|
+
style="color: #808080;border-color:#e0e0e0;" ghost>添加附件
|
|
19
|
+
</Button>
|
|
20
|
+
</Upload>
|
|
21
|
+
</div>
|
|
22
|
+
</div>
|
|
23
|
+
</Row>
|
|
24
|
+
<Row style="margin-top: 10px">
|
|
25
|
+
<span style="color: red;font-size: 14px">* 支持扩展名: .rar .zip .doc .docx .pdf .jpg...</span>
|
|
26
|
+
</Row>
|
|
27
|
+
</Row>
|
|
28
|
+
</div>
|
|
29
|
+
</template>
|
|
30
|
+
|
|
31
|
+
<script>
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
export default {
|
|
35
|
+
name: "attachment",
|
|
36
|
+
components: {},
|
|
37
|
+
props: {
|
|
38
|
+
actionUrl: {
|
|
39
|
+
default: "/api/oss-server/file/put",
|
|
40
|
+
},
|
|
41
|
+
attachmentdata: {
|
|
42
|
+
type: Array,
|
|
43
|
+
default: function () {
|
|
44
|
+
return []
|
|
45
|
+
}
|
|
46
|
+
},
|
|
47
|
+
attachmentColumn: {
|
|
48
|
+
default: function () {
|
|
49
|
+
let column = [
|
|
50
|
+
{title: "序号", type: 'index', width: 80, align: "center"},
|
|
51
|
+
{
|
|
52
|
+
title: "相关附件", key: "fileName", minWidth: 200, align: 'left', tooltip: true,
|
|
53
|
+
render: (h, {row}) => {
|
|
54
|
+
return h("a", {
|
|
55
|
+
on: {
|
|
56
|
+
'click': () => {
|
|
57
|
+
let reg = /\.(gif|jpg|jpeg|bmp|png)$/
|
|
58
|
+
let regs = /\.pdf$/
|
|
59
|
+
if (reg.test(row.fileName)) {
|
|
60
|
+
let imgs = [];
|
|
61
|
+
let url = this.ossServerContext + "/file/get/" + row.fileId;
|
|
62
|
+
this.imgPreview(url);
|
|
63
|
+
} else if (regs.test(row.fileName)) {
|
|
64
|
+
window.open(this.ossServerContext + "/file/getFileStream?fileId=" + row.fileId, "_blank");
|
|
65
|
+
} else {
|
|
66
|
+
window.open(this.ossServerContext + "/file/get/" + row.fileId, "_blank");
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
}, row.fileName);
|
|
71
|
+
}
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
title: "操作", width: 80, align: "center",
|
|
75
|
+
render: (h, {index}) => {
|
|
76
|
+
return h('div', [
|
|
77
|
+
h('Button', {
|
|
78
|
+
props: {
|
|
79
|
+
type: 'warning',
|
|
80
|
+
size: 'small',
|
|
81
|
+
ghost: true
|
|
82
|
+
},
|
|
83
|
+
on: {
|
|
84
|
+
click: () => {
|
|
85
|
+
this.forRemoveAttachment(index)
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
}, '删除')
|
|
89
|
+
]);
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
];
|
|
93
|
+
return column
|
|
94
|
+
}
|
|
95
|
+
},
|
|
96
|
+
},
|
|
97
|
+
data() {
|
|
98
|
+
return {
|
|
99
|
+
loading: false,
|
|
100
|
+
modalImg: false,
|
|
101
|
+
image: "",
|
|
102
|
+
tempFileArr: [],
|
|
103
|
+
percentage: null,
|
|
104
|
+
file_name: '',
|
|
105
|
+
fileList: [],
|
|
106
|
+
}
|
|
107
|
+
},
|
|
108
|
+
methods: {
|
|
109
|
+
openAttachment(item) {
|
|
110
|
+
let reg = /\.(gif|jpg|jpeg|bmp|png)$/;
|
|
111
|
+
let regs = /\.pdf$/;
|
|
112
|
+
|
|
113
|
+
if (reg.test(item.fileName)) {
|
|
114
|
+
let imgs = [];
|
|
115
|
+
let url = this.ossServerContext + "/file/get/" + item.fileId;
|
|
116
|
+
this.imgPreview(url);
|
|
117
|
+
} else if (regs.test(item.fileName)) {
|
|
118
|
+
window.open(this.ossServerContext + "/file/getFileStream?fileId=" + item.fileId, "_blank");
|
|
119
|
+
} else {
|
|
120
|
+
window.open(this.ossServerContext + "/file/get/" + item.fileId, "_blank");
|
|
121
|
+
}
|
|
122
|
+
},
|
|
123
|
+
handleSuccess: function (response, file, fileList) {
|
|
124
|
+
let self = this;
|
|
125
|
+
let tempArr = JSON.parse(JSON.stringify(this.tempFileArr))
|
|
126
|
+
|
|
127
|
+
tempArr.forEach(function (value, index, array) {
|
|
128
|
+
if (value == file.name) {
|
|
129
|
+
self.tempFileArr.splice(index, 1)
|
|
130
|
+
}
|
|
131
|
+
});
|
|
132
|
+
|
|
133
|
+
if (response.code == 1 && self.tempFileArr && self.tempFileArr.length < 1) {
|
|
134
|
+
self.loading = false;
|
|
135
|
+
self.$Message.success("上传成功");
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
if (response.code == 1) {
|
|
139
|
+
if (response.data != undefined && response.data != null && response.data.length > 0) {
|
|
140
|
+
let tempData = [].concat(response.data);
|
|
141
|
+
this.attachmentdata.push({
|
|
142
|
+
fileName: tempData[0].originalName,
|
|
143
|
+
fileId: tempData[0].fileName,
|
|
144
|
+
});
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
this.fileList = fileList
|
|
148
|
+
|
|
149
|
+
} else {
|
|
150
|
+
self.loading = false;
|
|
151
|
+
this.$Message.error({
|
|
152
|
+
content: file.name + '上传失败!',
|
|
153
|
+
});
|
|
154
|
+
//this.$Message.error("上传失败!");
|
|
155
|
+
|
|
156
|
+
let j = 0;
|
|
157
|
+
for (let i = 0; i < fileList.length; i++) {
|
|
158
|
+
if (fileList[i].canceled) {
|
|
159
|
+
continue;
|
|
160
|
+
}
|
|
161
|
+
if (fileList[i].name === file.name && fileList[i].timestamp === file.timestamp) {
|
|
162
|
+
j = i;
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
//console.log(fileList)
|
|
167
|
+
fileList.splice(j, 1);
|
|
168
|
+
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
},
|
|
172
|
+
handleError: function (error, file, fileList) {
|
|
173
|
+
this.loading = false
|
|
174
|
+
this.$Message.error({
|
|
175
|
+
content: fileList.name + ' 上传失败!',
|
|
176
|
+
});
|
|
177
|
+
},
|
|
178
|
+
handleUpload: function (file) {
|
|
179
|
+
if (!file.canceled) {
|
|
180
|
+
this.tempFileArr.push(file.name)
|
|
181
|
+
}
|
|
182
|
+
},
|
|
183
|
+
forRemoveAttachment: function (index) {
|
|
184
|
+
this.attachmentdata.splice(index, 1);
|
|
185
|
+
this.$refs.attachmentTable.tableRefresh()
|
|
186
|
+
},
|
|
187
|
+
//查看附件
|
|
188
|
+
imgPreview: function (img) {
|
|
189
|
+
this.modalImg = true
|
|
190
|
+
this.image = img;
|
|
191
|
+
},
|
|
192
|
+
//查看附件
|
|
193
|
+
cancelUpload: function (item, fileList) {
|
|
194
|
+
item.showProgress = false;
|
|
195
|
+
item.canceled = true;
|
|
196
|
+
},
|
|
197
|
+
handleProgress(event, file, fileList) {
|
|
198
|
+
this.loading = true
|
|
199
|
+
|
|
200
|
+
|
|
201
|
+
},
|
|
202
|
+
handleFormatError(file) {
|
|
203
|
+
this.loading = false
|
|
204
|
+
this.$Notice.warning({
|
|
205
|
+
title: "文件格式不正确",
|
|
206
|
+
desc: "文件 " + file.name + " 格式不支持,请上传其他格式的文件。",
|
|
207
|
+
});
|
|
208
|
+
},
|
|
209
|
+
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
</script>
|
|
213
|
+
|
|
214
|
+
<style scoped>
|
|
215
|
+
.demo-spin-icon-load {
|
|
216
|
+
animation: ani-demo-spin 1s linear infinite;
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
/deep/ .ivu-icon {
|
|
220
|
+
zoom: 130%;
|
|
221
|
+
color: #808080;
|
|
222
|
+
margin-right: -1px;
|
|
223
|
+
}
|
|
224
|
+
</style>
|