|
@@ -163,8 +163,10 @@ import {simple_required} from "@/utils/ruleDatas";
|
163
|
163
|
import upload from '@/components/upload/v2.vue'
|
164
|
164
|
import {basicUploadUrl, getFileList, minioUrl} from "@/api/base";
|
165
|
165
|
import {downloadBase} from "@/api/inventoryQualityTraceability";
|
|
166
|
+import legacyUpload from "@/page/mixin/legacyUpload";
|
166
|
167
|
|
167
|
168
|
export default {
|
|
169
|
+ mixins: [legacyUpload, ],
|
168
|
170
|
props: {
|
169
|
171
|
visible: {
|
170
|
172
|
type: Boolean,
|
|
@@ -220,9 +222,6 @@ export default {
|
220
|
222
|
uploadUrl_2,
|
221
|
223
|
show: this.visible,
|
222
|
224
|
form: { },
|
223
|
|
- fileList: [],
|
224
|
|
- fileIds: [],
|
225
|
|
- deleteFileIds: [],
|
226
|
225
|
rules: {
|
227
|
226
|
sbr: simple_required, fxxx: simple_required, hjbw: simple_required,
|
228
|
227
|
fxlx: simple_required, fxfj: simple_required, fxglcs: simple_required,
|
|
@@ -240,17 +239,7 @@ export default {
|
240
|
239
|
if(this.isAdd) {
|
241
|
240
|
}else {
|
242
|
241
|
console.log('查看 id', this.dataId)
|
243
|
|
- getFileList({bid: this.dataId, orgId: this.orgId}).then(resp => {
|
244
|
|
-
|
245
|
|
- this.fileList = resp.map(d => {
|
246
|
|
- return {
|
247
|
|
- id: d.id,
|
248
|
|
- name: d.originalFileName,
|
249
|
|
- url: `${basicUploadUrl}${d.filePath}`
|
250
|
|
- }
|
251
|
|
- })
|
252
|
|
- console.log('文件列表', resp, this.fileList)
|
253
|
|
- })
|
|
242
|
+ this.getFileListById(this.dataId)
|
254
|
243
|
StorageSafeManageControllerEdit(this.dataId).then(resp => {
|
255
|
244
|
this.form = resp.storageSafeManageWithBLOBs
|
256
|
245
|
// const fl = resp.fileList || []
|
|
@@ -331,37 +320,6 @@ export default {
|
331
|
320
|
}
|
332
|
321
|
})
|
333
|
322
|
},
|
334
|
|
- onUploadSuccess(resp, file, fileList) {
|
335
|
|
- console.log('上传文件 resp', resp, file, fileList)
|
336
|
|
- this.fileList = fileList.map(f => {
|
337
|
|
- let url
|
338
|
|
- let id
|
339
|
|
- if(f.response) {
|
340
|
|
- url = f.response.filePath
|
341
|
|
- id = f.response.id
|
342
|
|
- }else {
|
343
|
|
- url = f.url
|
344
|
|
- id = f.id
|
345
|
|
- }
|
346
|
|
- return {
|
347
|
|
- name: f.name,
|
348
|
|
- url: url,
|
349
|
|
- id: id,
|
350
|
|
- }
|
351
|
|
- })
|
352
|
|
- },
|
353
|
|
- onUploadRemove(fileList) {
|
354
|
|
- const removeFiles = []
|
355
|
|
- for(const f of this.fileList) {
|
356
|
|
- const file = fileList.find(temp => temp.id === f.id)
|
357
|
|
- if(! file) {
|
358
|
|
- removeFiles.push(f)
|
359
|
|
- }
|
360
|
|
- }
|
361
|
|
- this.fileList = fileList
|
362
|
|
- this.deleteFileIds.push(... removeFiles.map(f => f.id))
|
363
|
|
- console.log('删除文件 ', fileList, removeFiles)
|
364
|
|
- }
|
365
|
323
|
}
|
366
|
324
|
|
367
|
325
|
}
|