|
@@ -302,11 +302,14 @@
|
|
|
</el-select>
|
|
|
</template>
|
|
|
<template #action="{row,index}">
|
|
|
- <HcFileUpload1 v-if="tableUploadType== 'edit'" @change="newUploadsChange($event, row)" style="display:inline-block"
|
|
|
+ <!-- <HcFileUpload1 v-if="tableUploadType== 'edit'" @change="newUploadsChange($event, row)" style="display:inline-block"
|
|
|
@progress="newUploadsProgress($event, row)">
|
|
|
<el-button :loading="row['newBtnLoading']" plain size="small" type="primary">替换</el-button>
|
|
|
- </HcFileUpload1>
|
|
|
- <el-button type="danger" plain size="small" :loading="row['delBtnLoading']" @click="delUploadData(row,index)">删除</el-button>
|
|
|
+ </HcFileUpload1> -->
|
|
|
+ <HcUploadFile ref="HcUploadFileRef" :options="UploadFileOptions" @progress="HcUploadFileProgress" @success="newHcUploadFileSuccess($event,row)" v-if="tableUploadType== 'edit'" style="display:inline-block">
|
|
|
+ <el-button :loading="row['newBtnLoading']" plain size="small" type="primary">替换</el-button>
|
|
|
+ </HcUploadFile>
|
|
|
+ <el-button type="danger" plain size="small" :loading="row['delBtnLoading']" @click="delUploadData(row,index)" class="ml-2">删除</el-button>
|
|
|
</template>
|
|
|
</HcTable>
|
|
|
<template #footer>
|
|
@@ -440,19 +443,33 @@ const uploadFileClick = () => {
|
|
|
|
|
|
// 文件上传进度
|
|
|
const HcUploadFileProgress = ({file, status}) => {
|
|
|
- uploadsLoading.value = true
|
|
|
+ //uploadsLoading.value = true
|
|
|
}
|
|
|
// 文件上传成功的回调
|
|
|
const HcUploadFileSuccess = (res) => {
|
|
|
console.log('文件上传成功', res)
|
|
|
- uploadsLoading.value = false
|
|
|
+ //uploadsLoading.value = false
|
|
|
uploadsChange(res.resData)
|
|
|
}
|
|
|
+//替换文件
|
|
|
+const newHcUploadFileSuccess = (res,row) => {
|
|
|
+ let item= res.resData
|
|
|
+ //更新数据
|
|
|
+ row.fileName = item?.originalName;
|
|
|
+ row.ossFileName = item?.name || ''
|
|
|
+ row.fileUrl = item?.link || ''
|
|
|
+ row.pdfFileUrl = item?.pdfUrl || ''
|
|
|
+ row.filePage = item?.page || ''
|
|
|
+ row.isUpdateUrl=1
|
|
|
+
|
|
|
+ //uploadsLoading.value = false
|
|
|
+ // uploadsChange(res.resData)
|
|
|
+}
|
|
|
|
|
|
// 文件全部上传成功
|
|
|
const HcUploadFileChange = () => {
|
|
|
console.log('文件全部上传成功')
|
|
|
- uploadsLoading.value = false
|
|
|
+ //uploadsLoading.value = false
|
|
|
}
|
|
|
|
|
|
|
|
@@ -1357,25 +1374,25 @@ const batchUploadCancel = () => {
|
|
|
|
|
|
}
|
|
|
//上传新文件
|
|
|
-const newUploadsChange = ({fileList}, row) => {
|
|
|
- if (fileList.length > 0) {
|
|
|
- tableUploadType.value = 'edit'
|
|
|
- const item = fileList[0]
|
|
|
- const name = item['originalName'] || ''
|
|
|
- const fileName = name.substring(0, name.lastIndexOf("."))
|
|
|
- //更新数据
|
|
|
- row.fileName = fileName;
|
|
|
- row.ossFileName = item?.name || ''
|
|
|
- row.fileUrl = item?.link || ''
|
|
|
- row.pdfFileUrl = item?.pdfUrl || ''
|
|
|
- row.filePage = item?.page || ''
|
|
|
- row.isUpdateUrl=1
|
|
|
- }
|
|
|
-}
|
|
|
+// const newUploadsChange = ({fileList}, row) => {
|
|
|
+// if (fileList.length > 0) {
|
|
|
+// tableUploadType.value = 'edit'
|
|
|
+// const item = fileList[0]
|
|
|
+// const name = item['originalName'] || ''
|
|
|
+// const fileName = name.substring(0, name.lastIndexOf("."))
|
|
|
+// //更新数据
|
|
|
+// row.fileName = fileName;
|
|
|
+// row.ossFileName = item?.name || ''
|
|
|
+// row.fileUrl = item?.link || ''
|
|
|
+// row.pdfFileUrl = item?.pdfUrl || ''
|
|
|
+// row.filePage = item?.page || ''
|
|
|
+// row.isUpdateUrl=1
|
|
|
+// }
|
|
|
+// }
|
|
|
|
|
|
-const newUploadsProgress = (val, row) => {
|
|
|
- row.newBtnLoading = val
|
|
|
-}
|
|
|
+// const newUploadsProgress = (val, row) => {
|
|
|
+// row.newBtnLoading = val
|
|
|
+// }
|
|
|
//批量编辑
|
|
|
const batchEditClick = () => {
|
|
|
const rows = deepClone(tableCheckedKeys.value)
|