|
@@ -102,35 +102,62 @@
|
|
|
<el-row>
|
|
|
<el-col :span="24">
|
|
|
<el-form-item label="附件下载:">
|
|
|
- <div v-if="item.ImgUrlList[0]||item.fileListF[0]" style="display: flex;">
|
|
|
- <el-row type="flex" style="padding-right:10px; " :gutter="20">
|
|
|
+ <div v-if="ImgUrlList[0] || fileListF[0]" style="display: flex">
|
|
|
+ <el-row type="flex" style="padding-right: 10px" :gutter="20">
|
|
|
<el-image
|
|
|
- v-for="items in item.ImgUrlList"
|
|
|
- :key="items"
|
|
|
- :lazy="true"
|
|
|
- style="padding-left:10px;margin-right:5px; width: 100px ;"
|
|
|
- :src="items"
|
|
|
- :preview-src-list="item.ImgUrlList"
|
|
|
+ v-for="(item,index) in ImgUrlList"
|
|
|
+ :key="index"
|
|
|
+ style="padding-left:10px;margin-right:5px; width:100px"
|
|
|
+ :src="item"
|
|
|
+ :preview-src-list="ImgUrlList"
|
|
|
/>
|
|
|
</el-row>
|
|
|
|
|
|
- <el-row type="flex" style="padding-left:30px; margin: 0;margin-left:5px">
|
|
|
+ <el-row
|
|
|
+ type="flex"
|
|
|
+ style="padding-left: 30px; margin: 0; margin-left: 5px"
|
|
|
+ >
|
|
|
<el-upload
|
|
|
ref="upload"
|
|
|
disabled
|
|
|
class="upload-demo"
|
|
|
:limit="3"
|
|
|
action="https://jsonplaceholder.typicode.com/posts/"
|
|
|
- :file-list="item.fileListF"
|
|
|
+ :file-list="fileListF"
|
|
|
:on-preview="handleClick"
|
|
|
/>
|
|
|
</el-row>
|
|
|
</div>
|
|
|
<div v-else>
|
|
|
- <div class="colflexS">
|
|
|
- <img src="@/assets/icon/null.png" alt="" style="height:30px">
|
|
|
- <div>无上传文件</div>
|
|
|
- </div>
|
|
|
+ <!-- <div class="colflexS">
|
|
|
+ <img src="@/assets/icon/null.png" alt="" style="height:30px">
|
|
|
+ <div>无上传文件</div>
|
|
|
+ </div> -->
|
|
|
+ <el-table :data="tableData" border style="width: 100%">
|
|
|
+ <el-table-column
|
|
|
+ prop="name"
|
|
|
+ label="文件名"
|
|
|
+ align="center"
|
|
|
+ />
|
|
|
+ <el-table-column
|
|
|
+ prop="createTime"
|
|
|
+ label="上传时间"
|
|
|
+ align="center"
|
|
|
+ />
|
|
|
+ <el-table-column fixed="right" label="操作" width="100">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-button
|
|
|
+ type="text"
|
|
|
+ size="small"
|
|
|
+ @click="handleClick(scope.row)"
|
|
|
+ >下载</el-button>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <template slot="empty">
|
|
|
+ <img src="@/assets/icon/null.png" alt="">
|
|
|
+ <div class="empty-p">无上传文件</div>
|
|
|
+ </template>
|
|
|
+ </el-table>
|
|
|
</div>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
@@ -701,7 +728,8 @@ export default {
|
|
|
} else {
|
|
|
data.resultList[i].isFinishName = '未处理'
|
|
|
}
|
|
|
- this.fileMethod(data.resultList[i].jgczFileInfo, resultNum)
|
|
|
+ debugger
|
|
|
+ this.fileMethod(data.jgczFile, resultNum)
|
|
|
data.resultList[i].fileListImg = []
|
|
|
data.resultList[i].ImgUrlList = []
|
|
|
data.resultList[i].fileListF = []
|
|
@@ -1027,55 +1055,78 @@ export default {
|
|
|
})
|
|
|
},
|
|
|
fileMethod(data, num) {
|
|
|
+ const that = this
|
|
|
console.log(data, 'datadatadatatatatatatatatatat')
|
|
|
- const fileListImg = []
|
|
|
- let ImgUrlList = []
|
|
|
- let fileListF = []
|
|
|
- const srcListsrc = []
|
|
|
+ // const fileListImg = []
|
|
|
+ // const ImgUrlList = []
|
|
|
+ // const fileListF = []
|
|
|
+ // const srcListsrc = []
|
|
|
const arr = ['.png', '.jpg', '.jpeg', '.gif', '.webp', '.svg', '.tiff']
|
|
|
+ var token = that.$store.state.user.token
|
|
|
if (!this.arrayIsNull(data)) {
|
|
|
for (const i in data) {
|
|
|
- imageByName(data[i].filePath).then(res => {
|
|
|
- srcListsrc.push({
|
|
|
- url: res.config.url,
|
|
|
- name: data[i].fileName,
|
|
|
- urlName: data[i].filePath,
|
|
|
- id: data[i].id,
|
|
|
- fileFormat: data[i].fileFormat
|
|
|
+ var fileModel = data[i]
|
|
|
+ const esuffixt = fileModel.fileFormat
|
|
|
+ const es = fileModel.filePath
|
|
|
+ // if(esuffixt == '.amr'){
|
|
|
+ // const audioPath = `${IP}/base/file/loadAudio?remotePath=${es}&access_token=${token}`
|
|
|
+ // this.audioFileList.push(audioPath)
|
|
|
+ // }else
|
|
|
+
|
|
|
+ // esuffixt === '.jpeg' || esuffixt === '.png' || esuffixt === '.jpg'
|
|
|
+ if (arr.includes(esuffixt)) {
|
|
|
+ const imagePath = `${IP}base/file/loadImg?remotePath=${es}&access_token=${token}`
|
|
|
+ this.ImgUrlList.push(imagePath)
|
|
|
+ } else {
|
|
|
+ this.fileListF.push({
|
|
|
+ url: es,
|
|
|
+ name: fileModel.fileName,
|
|
|
+ // urlName: fileModel.filePath,
|
|
|
+ id: fileModel.id,
|
|
|
+ fileFormat: fileModel.fileFormat
|
|
|
})
|
|
|
- if (srcListsrc.length === data.length) {
|
|
|
- const filtpathArr = JSON.parse(JSON.stringify(srcListsrc))
|
|
|
- for (const i in srcListsrc) {
|
|
|
- for (const j in arr) {
|
|
|
- if (srcListsrc[i].fileFormat === arr[j]) {
|
|
|
- // 是图片类型
|
|
|
- fileListImg.push(srcListsrc[i])
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- ImgUrlList = []
|
|
|
- for (const i in fileListImg) {
|
|
|
- ImgUrlList.push(fileListImg[i].url)
|
|
|
- }
|
|
|
- for (const i in filtpathArr) {
|
|
|
- for (const j in fileListImg) {
|
|
|
- if (filtpathArr[i].id === fileListImg[j].id) {
|
|
|
- filtpathArr.splice(i, 1)
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- fileListF = filtpathArr
|
|
|
- }
|
|
|
- console.log(fileListImg, ImgUrlList, fileListF, 'fileListImg, ImgUrlList, fileListFfileListImg, ImgUrlList, fileListFfileListImg, ImgUrlList, fileListFfileListImg, ImgUrlList, fileListF')
|
|
|
- this.jgczArr[num].fileListImg = fileListImg
|
|
|
- this.jgczArr[num].ImgUrlList = ImgUrlList
|
|
|
- this.jgczArr[num].fileListF = fileListF
|
|
|
- if (!this.arrayIsNull(ImgUrlList) || !this.arrayIsNull(fileListF)) {
|
|
|
- this.jgczArr[num].isFile = true
|
|
|
- } else {
|
|
|
- this.jgczArr[num].isFile = false
|
|
|
- }
|
|
|
- })
|
|
|
+ }
|
|
|
+ // imageByName(data[i].filePath).then(res => {
|
|
|
+ // srcListsrc.push({
|
|
|
+ // url: res.config.url,
|
|
|
+ // name: data[i].fileName,
|
|
|
+ // urlName: data[i].filePath,
|
|
|
+ // id: data[i].id,
|
|
|
+ // fileFormat: data[i].fileFormat
|
|
|
+ // })
|
|
|
+ // if (srcListsrc.length === data.length) {
|
|
|
+ // const filtpathArr = JSON.parse(JSON.stringify(srcListsrc))
|
|
|
+ // for (const i in srcListsrc) {
|
|
|
+ // for (const j in arr) {
|
|
|
+ // if (srcListsrc[i].fileFormat === arr[j]) {
|
|
|
+ // // 是图片类型
|
|
|
+ // fileListImg.push(srcListsrc[i])
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // ImgUrlList = []
|
|
|
+ // for (const i in fileListImg) {
|
|
|
+ // ImgUrlList.push(fileListImg[i].url)
|
|
|
+ // }
|
|
|
+ // for (const i in filtpathArr) {
|
|
|
+ // for (const j in fileListImg) {
|
|
|
+ // if (filtpathArr[i].id === fileListImg[j].id) {
|
|
|
+ // filtpathArr.splice(i, 1)
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // fileListF = filtpathArr
|
|
|
+ // }
|
|
|
+ // console.log(fileListImg, ImgUrlList, fileListF, 'fileListImg, ImgUrlList, fileListFfileListImg, ImgUrlList, fileListFfileListImg, ImgUrlList, fileListFfileListImg, ImgUrlList, fileListF')
|
|
|
+ // this.jgczArr[num].fileListImg = fileListImg
|
|
|
+ // this.jgczArr[num].ImgUrlList = ImgUrlList
|
|
|
+ // this.jgczArr[num].fileListF = fileListF
|
|
|
+ // if (!this.arrayIsNull(ImgUrlList) || !this.arrayIsNull(fileListF)) {
|
|
|
+ // this.jgczArr[num].isFile = true
|
|
|
+ // } else {
|
|
|
+ // this.jgczArr[num].isFile = false
|
|
|
+ // }
|
|
|
+ // })
|
|
|
}
|
|
|
}
|
|
|
},
|
|
@@ -1087,7 +1138,7 @@ export default {
|
|
|
},
|
|
|
handleClick(row) {
|
|
|
window.open(
|
|
|
- `${IP}/base/file/downloadFile?fileName=${row.name}&remotePath=${row.urlName}&access_token=${this.$store.state.user.token}`
|
|
|
+ `${IP}base/file/downloadFile?fileName=${row.name}&remotePath=${row.url}&access_token=${this.$store.state.user.token}`
|
|
|
)
|
|
|
},
|
|
|
// 提交
|