|
|
@@ -303,8 +303,8 @@ import {
|
|
|
getGoodsNumType,
|
|
|
getGoodsType,
|
|
|
detailsById,
|
|
|
- getFileList
|
|
|
- // deleteAffix
|
|
|
+ getFileList,
|
|
|
+ deleteAffix
|
|
|
} from '@/apis/holding'
|
|
|
export default {
|
|
|
name: 'holding3_DiaEdit',
|
|
|
@@ -402,7 +402,13 @@ export default {
|
|
|
disabled: false,
|
|
|
// 表格数据
|
|
|
tableData: [],
|
|
|
- tempData: {}
|
|
|
+ tempData: {
|
|
|
+ img: [],
|
|
|
+ video: [],
|
|
|
+ audio: [],
|
|
|
+ model: [],
|
|
|
+ doc: []
|
|
|
+ }
|
|
|
}
|
|
|
},
|
|
|
// 监听属性 类似于data概念
|
|
|
@@ -410,7 +416,10 @@ export default {
|
|
|
// 监控data中的数据变化
|
|
|
watch: {
|
|
|
affixVal (val) {
|
|
|
- this.getFileList(this.fujianId, val)
|
|
|
+ this.tableData = this.tempData[val]
|
|
|
+ this.tableData.forEach(v => {
|
|
|
+ v.updateTime = v.updateTime.slice(0, 10)
|
|
|
+ })
|
|
|
}
|
|
|
},
|
|
|
// 方法集合
|
|
|
@@ -422,7 +431,7 @@ export default {
|
|
|
cancelButtonText: '取消',
|
|
|
type: 'warning'
|
|
|
}).then(() => {
|
|
|
- this.tableData = this.tableData.filter(v => v.name !== val.name)
|
|
|
+ this.tableData = this.tempData[this.affixVal] = this.tempData[this.affixVal].filter(v => v.id !== val.id)
|
|
|
if (this.temp.length !== 0) {
|
|
|
this.temp.forEach((v, i) => {
|
|
|
// eslint-disable-next-line
|
|
|
@@ -431,7 +440,7 @@ export default {
|
|
|
// console.log(999, this.temp.join(','))
|
|
|
this.ruleForm.fileIds = this.temp.join(',')
|
|
|
}
|
|
|
- // deleteAffix(val.id)
|
|
|
+ deleteAffix(val.id)
|
|
|
this.$message({
|
|
|
type: 'success',
|
|
|
message: '删除成功!'
|
|
|
@@ -452,17 +461,22 @@ export default {
|
|
|
},
|
|
|
// 通过id获取附件列表
|
|
|
async getFileList (myId, myType) {
|
|
|
- const res = await getFileList(myId, myType)
|
|
|
+ // 进页面获取所有附件数据
|
|
|
+ this.tempData.img = (await getFileList(myId, 'img')).data
|
|
|
+ this.tempData.video = (await getFileList(myId, 'video')).data
|
|
|
+ this.tempData.audio = (await getFileList(myId, 'audio')).data
|
|
|
+ this.tempData.model = (await getFileList(myId, 'model')).data
|
|
|
+ this.tempData.doc = (await getFileList(myId, 'doc')).data
|
|
|
// console.log(6666, res)
|
|
|
- this.tableData = res.data
|
|
|
+ this.tableData = this.tempData.video
|
|
|
this.tableData.forEach((v, i) => {
|
|
|
v.updateTime = v.updateTime.slice(0, 10)
|
|
|
})
|
|
|
- this.$nextTick(() => {
|
|
|
- setTimeout(() => {
|
|
|
- this.tableData = this.tableData.filter(v => this.ruleForm.fileIds.includes(v.id + ''))
|
|
|
- }, 100)
|
|
|
- })
|
|
|
+ // this.$nextTick(() => {
|
|
|
+ // setTimeout(() => {
|
|
|
+ // this.tableData = this.tableData.filter(v => this.ruleForm.fileIds.includes(v.id + ''))
|
|
|
+ // }, 100)
|
|
|
+ // })
|
|
|
// console.log(999999, this.tableData, this.ruleForm.fileIds)
|
|
|
// 删除没有发送接口,需要自己处理数据
|
|
|
// this.fileList = [{ name: this.tableData[0].name, url: this.tableData[0].filePath }]
|
|
|
@@ -482,7 +496,7 @@ export default {
|
|
|
// const b = myDate.getMonth()
|
|
|
// const c = myDate.getDate()
|
|
|
// console.log(999, a, b + 1, c)
|
|
|
- this.tableData.push({ name: file.data.fileName, updateTime: file.timestamp.slice(0, 10), filePath: file.data.filePath, type: this.affixVal })
|
|
|
+ this.tempData[this.affixVal].push({ name: file.data.fileName, updateTime: file.timestamp.slice(0, 10), filePath: file.data.filePath, id: file.data.fileId })
|
|
|
// await holdingAdd(this.ruleForm)
|
|
|
}
|
|
|
},
|