|
@@ -381,7 +381,7 @@ import HcFileUpload1 from "./components/HcFileUpload1.vue"
|
|
|
import notableform from '~src/assets/view/notableform.svg';
|
|
|
import {delMessage, rowsToId, rowsToIdNumArr} from "~uti/tools";
|
|
|
import archiveFileApi from "~api/archiveFile/archiveFile";
|
|
|
-import {getArrValue, deepClone, getObjVal, arrToId} from "js-fast-way"
|
|
|
+import {getArrValue, deepClone, getObjVal, arrToId, arrKeySort} from "js-fast-way"
|
|
|
import {getTokenHeader} from "~src/api/request/header";
|
|
|
import tasksApi from '~api/tasks/data';
|
|
|
import ossApi from "~api/oss";
|
|
@@ -443,13 +443,13 @@ const uploadFileClick = () => {
|
|
|
|
|
|
// 文件上传进度
|
|
|
const HcUploadFileProgress = ({file, status}) => {
|
|
|
- //uploadsLoading.value = true
|
|
|
+ uploadsLoading.value = true
|
|
|
}
|
|
|
// 文件上传成功的回调
|
|
|
const HcUploadFileSuccess = (res) => {
|
|
|
console.log('文件上传成功', res)
|
|
|
- //uploadsLoading.value = false
|
|
|
- uploadsChange(res.resData)
|
|
|
+ uploadsLoading.value = false
|
|
|
+ uploadsChange(res.id, res.resData)
|
|
|
}
|
|
|
//替换文件
|
|
|
const newHcUploadFileSuccess = (res,row) => {
|
|
@@ -461,7 +461,7 @@ const newHcUploadFileSuccess = (res,row) => {
|
|
|
row.pdfFileUrl = item?.pdfUrl || ''
|
|
|
row.filePage = item?.page || ''
|
|
|
row.isUpdateUrl=1
|
|
|
-
|
|
|
+
|
|
|
//uploadsLoading.value = false
|
|
|
// uploadsChange(res.resData)
|
|
|
}
|
|
@@ -1247,13 +1247,14 @@ const setTableUploadColumn = () => {
|
|
|
const tableUploadData = ref([])
|
|
|
|
|
|
//上传的文件结果
|
|
|
-const uploadsChange = (item) => {
|
|
|
+const uploadsChange = (fileId, item) => {
|
|
|
if (getObjVal(item)) {
|
|
|
let newArr = tableUploadData.value
|
|
|
const sheet = sheetType.value, source = sheetSourceType.value
|
|
|
let name = item['originalName'] || ''
|
|
|
let fileName = name.substring(0, name.lastIndexOf("."))
|
|
|
newArr.push({
|
|
|
+ fileUploadId: fileId,
|
|
|
projectId: projectId.value,
|
|
|
contractId: contractId.value,
|
|
|
nodeId: nodeIds.value,
|
|
@@ -1275,7 +1276,8 @@ const uploadsChange = (item) => {
|
|
|
isUpdateUrl:0,
|
|
|
fileSize:item?.fileSize
|
|
|
})
|
|
|
- tableUploadData.value = newArr
|
|
|
+ //tableUploadData.value = newArr
|
|
|
+ tableUploadData.value = arrKeySort(newArr, 'fileUploadId')
|
|
|
} else {
|
|
|
console.log(item)
|
|
|
}
|