修改已知问题
This commit is contained in:
@@ -14,7 +14,7 @@
|
||||
name="file"
|
||||
:file-list="myfileList"
|
||||
:multiple="true"
|
||||
:action="uploadAction+'?state='+state+'&cut='+cut"
|
||||
:action="uploadAction+'?cut='+cut"
|
||||
:headers="headers"
|
||||
@preview="preview"
|
||||
:before-upload="beforeUpload"
|
||||
@@ -33,7 +33,7 @@
|
||||
<script>
|
||||
import Vue from 'vue'
|
||||
import { ACCESS_TOKEN } from '@/store/mutation-types'
|
||||
import { getAction, postAction, downFile, downloadFile } from '@/api/manage'
|
||||
import { getAction, postAction, downFile, downloadFile, putAction } from '@/api/manage'
|
||||
import { Base64 } from 'js-base64'
|
||||
|
||||
export default {
|
||||
@@ -54,6 +54,9 @@
|
||||
cut: '',
|
||||
confirmLoading: false,
|
||||
uploadQuery: {},
|
||||
url: {
|
||||
editModel: '/project/projectLawsInventoryEO/edit'
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
@@ -75,14 +78,21 @@
|
||||
this.uploadQuery = item
|
||||
this.myfileList = []
|
||||
this.visible = true
|
||||
getAction('sys/common/getFileInfos', { id: item }).then((res) => {
|
||||
getAction('sys/common/getFileInfos', { id: item.fileId }).then((res) => {
|
||||
if (res.success) {
|
||||
let data = res.result
|
||||
if (data && data.length > 0) {
|
||||
this.myfileList.forEach((res) => {
|
||||
res.name = res.fileName
|
||||
res.uid = res.id
|
||||
this.myfileList = res.result
|
||||
if (this.myfileList && this.myfileList.length > 0) {
|
||||
this.myfileList.forEach((val) => {
|
||||
val.name = val.fileName
|
||||
val.uid = val.id
|
||||
if (val.response) {
|
||||
this.fileList.push(val.response.result)
|
||||
} else {
|
||||
this.fileList.push(val)
|
||||
}
|
||||
})
|
||||
} else {
|
||||
this.myfileList = []
|
||||
}
|
||||
}
|
||||
})
|
||||
@@ -91,7 +101,29 @@
|
||||
if (this.myfileList && this.myfileList.length == 0) {
|
||||
this.$message.warning(this.$t('pleaseUpload') + this.$t('resultReported'))
|
||||
} else {
|
||||
|
||||
let content = []
|
||||
this.fileList.forEach(res => {
|
||||
content.push(res.id || res.name)
|
||||
})
|
||||
let formInline = JSON.parse(JSON.stringify(this.uploadQuery))
|
||||
Object.keys(formInline).forEach(res => {
|
||||
if (formInline[res] && formInline[res] instanceof Array) {
|
||||
formInline[res] = formInline[res].join(',')
|
||||
}
|
||||
})
|
||||
formInline.fileId = content.join(',')
|
||||
this.confirmLoading = true
|
||||
putAction(this.url.editModel, formInline).then((res) => {
|
||||
if (res.success) {
|
||||
this.$message.success(this.$t('OperationSuccessful'))
|
||||
this.visible = false
|
||||
this.confirmLoading = false
|
||||
this.$emit('resultReportedUploadForm')
|
||||
} else {
|
||||
this.$message.warning(this.$t('operationFailed'))
|
||||
this.confirmLoading = false
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
handleCancel() {
|
||||
|
||||
Reference in New Issue
Block a user