|
@@ -64,6 +64,7 @@
|
|
</el-button>
|
|
</el-button>
|
|
</HcTooltip>
|
|
</HcTooltip>
|
|
<HcTooltip keys="file_collection_btn_del">
|
|
<HcTooltip keys="file_collection_btn_del">
|
|
|
|
+
|
|
<el-button hc-btn :disabled="tableCheckedKeys.length <= 0" @click="delModalClick">
|
|
<el-button hc-btn :disabled="tableCheckedKeys.length <= 0" @click="delModalClick">
|
|
<HcIcon name="delete-bin"/>
|
|
<HcIcon name="delete-bin"/>
|
|
<span>删除</span>
|
|
<span>删除</span>
|
|
@@ -301,14 +302,17 @@
|
|
</el-select>
|
|
</el-select>
|
|
</template>
|
|
</template>
|
|
<template #action="{row,index}">
|
|
<template #action="{row,index}">
|
|
|
|
+ <HcFileUpload1 v-if="row.id" @change="newUploadsChange($event, row)"
|
|
|
|
+ @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>
|
|
<el-button type="danger" plain size="small" :loading="row['delBtnLoading']" @click="delUploadData(row,index)">删除</el-button>
|
|
- <el-button type="danger" plain size="small" :loading="row['delBtnLoading']" @click="replaceUploadData(row,index)">替换</el-button>
|
|
|
|
</template>
|
|
</template>
|
|
</HcTable>
|
|
</HcTable>
|
|
<template #footer>
|
|
<template #footer>
|
|
<div class="lr-dialog-footer">
|
|
<div class="lr-dialog-footer">
|
|
<div class="left flex items-center">
|
|
<div class="left flex items-center">
|
|
- <el-button type="primary" hc-btn @click="uploadFileClick" v-if="tableUploadType==='add'">
|
|
|
|
|
|
+ <el-button type="primary" hc-btn @click="uploadFileClick">
|
|
<HcIcon name="add-circle"/>
|
|
<HcIcon name="add-circle"/>
|
|
<span>新增上传</span>
|
|
<span>新增上传</span>
|
|
</el-button>
|
|
</el-button>
|
|
@@ -373,6 +377,7 @@ import {useAppStore} from "~src/store";
|
|
import {getStoreValue, setStoreValue} from '~src/utils/storage'
|
|
import {getStoreValue, setStoreValue} from '~src/utils/storage'
|
|
import {ref, watch, onMounted, nextTick } from "vue";
|
|
import {ref, watch, onMounted, nextTick } from "vue";
|
|
import HcTree from "~src/components/tree/hc-tree.vue"
|
|
import HcTree from "~src/components/tree/hc-tree.vue"
|
|
|
|
+import HcFileUpload1 from "./components/HcFileUpload1.vue"
|
|
import notableform from '~src/assets/view/notableform.svg';
|
|
import notableform from '~src/assets/view/notableform.svg';
|
|
import {delMessage, rowsToId, rowsToIdNumArr} from "~uti/tools";
|
|
import {delMessage, rowsToId, rowsToIdNumArr} from "~uti/tools";
|
|
import archiveFileApi from "~api/archiveFile/archiveFile";
|
|
import archiveFileApi from "~api/archiveFile/archiveFile";
|
|
@@ -381,6 +386,7 @@ import tasksApi from '~api/tasks/data';
|
|
import ossApi from "~api/oss";
|
|
import ossApi from "~api/oss";
|
|
|
|
|
|
|
|
|
|
|
|
+
|
|
//变量
|
|
//变量
|
|
const useAppState = useAppStore()
|
|
const useAppState = useAppStore()
|
|
const projectId = ref(useAppState.getProjectId);
|
|
const projectId = ref(useAppState.getProjectId);
|
|
@@ -434,21 +440,9 @@ const uploadFileClick = () => {
|
|
const HcUploadFileProgress = (res) => {
|
|
const HcUploadFileProgress = (res) => {
|
|
uploadsLoading.value = res
|
|
uploadsLoading.value = res
|
|
}
|
|
}
|
|
-
|
|
|
|
// 文件上传成功的回调
|
|
// 文件上传成功的回调
|
|
const HcUploadFileSuccess = (res) => {
|
|
const HcUploadFileSuccess = (res) => {
|
|
console.log('文件上传成功', res)
|
|
console.log('文件上传成功', res)
|
|
- console.log(isReplace.value,'isReplace.valu');
|
|
|
|
- if(isReplace.value){
|
|
|
|
- console.log(1111);
|
|
|
|
- res.fileNumber=replacerow.value?.fileNumber
|
|
|
|
- res.fileTime=replacerow.value?.fileTime
|
|
|
|
- res.isApproval=replacerow.value?.isApproval
|
|
|
|
- res.isNeedCertification=replacerow.value?.isNeedCertification
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- console.log(res,'res');
|
|
|
|
-
|
|
|
|
uploadsChange(res)
|
|
uploadsChange(res)
|
|
}
|
|
}
|
|
|
|
|
|
@@ -1197,7 +1191,7 @@ const tableUploadColumn = ref([
|
|
{key:'isNeedCertification', name: '是否需要认证'},
|
|
{key:'isNeedCertification', name: '是否需要认证'},
|
|
{key:'dutyUser', name: '责任者'},
|
|
{key:'dutyUser', name: '责任者'},
|
|
{key:'isElement', name: '是否四要素'},
|
|
{key:'isElement', name: '是否四要素'},
|
|
- {key:'action', name: '操作'}
|
|
|
|
|
|
+ {key:'action', name: '操作', width: 180}
|
|
])
|
|
])
|
|
const setTableUploadColumn = () => {
|
|
const setTableUploadColumn = () => {
|
|
if (isBuiltDrawing.value === 2) {
|
|
if (isBuiltDrawing.value === 2) {
|
|
@@ -1213,7 +1207,7 @@ const setTableUploadColumn = () => {
|
|
{key:'isNeedCertification', name: '是否需要认证'},
|
|
{key:'isNeedCertification', name: '是否需要认证'},
|
|
{key:'dutyUser', name: '责任者'},
|
|
{key:'dutyUser', name: '责任者'},
|
|
{key:'isElement', name: '是否四要素'},
|
|
{key:'isElement', name: '是否四要素'},
|
|
- {key:'action', name: '操作'}
|
|
|
|
|
|
+ {key:'action', name: '操作', width: 180}
|
|
]
|
|
]
|
|
sheetTypeStatus()
|
|
sheetTypeStatus()
|
|
sheetSourceStatus()
|
|
sheetSourceStatus()
|
|
@@ -1226,7 +1220,7 @@ const setTableUploadColumn = () => {
|
|
{key:'isNeedCertification', name: '是否需要认证'},
|
|
{key:'isNeedCertification', name: '是否需要认证'},
|
|
{key:'dutyUser', name: '责任者'},
|
|
{key:'dutyUser', name: '责任者'},
|
|
{key:'isElement', name: '是否四要素'},
|
|
{key:'isElement', name: '是否四要素'},
|
|
- {key:'action', name: '操作',}
|
|
|
|
|
|
+ {key:'action', name: '操作', width: 180}
|
|
]
|
|
]
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -1234,7 +1228,6 @@ const tableUploadData = ref([])
|
|
|
|
|
|
//上传的文件结果
|
|
//上传的文件结果
|
|
const uploadsChange = (item) => {
|
|
const uploadsChange = (item) => {
|
|
- console.log(item,'item');
|
|
|
|
if (getObjVal(item)) {
|
|
if (getObjVal(item)) {
|
|
let newArr = tableUploadData.value
|
|
let newArr = tableUploadData.value
|
|
const sheet = sheetType.value, source = sheetSourceType.value
|
|
const sheet = sheetType.value, source = sheetSourceType.value
|
|
@@ -1244,26 +1237,22 @@ const uploadsChange = (item) => {
|
|
projectId: projectId.value,
|
|
projectId: projectId.value,
|
|
contractId: contractId.value,
|
|
contractId: contractId.value,
|
|
nodeId: nodeIds.value,
|
|
nodeId: nodeIds.value,
|
|
- fileNumber:item?.fileNumber || '',
|
|
|
|
|
|
+ fileNumber: '',
|
|
fileName: fileName,
|
|
fileName: fileName,
|
|
ossFileName: item?.name || '',
|
|
ossFileName: item?.name || '',
|
|
- // fileTime: null,
|
|
|
|
- fileTime: item?.fileTime || null,
|
|
|
|
|
|
+ fileTime: null,
|
|
fileUrl: item?.link || '',
|
|
fileUrl: item?.link || '',
|
|
sheetType: sheet.length > 0 ? sheet[0]['dictKey'] || '': '',
|
|
sheetType: sheet.length > 0 ? sheet[0]['dictKey'] || '': '',
|
|
sheetSource: source.length > 0 ? source[0]['dictKey'] || '': '',
|
|
sheetSource: source.length > 0 ? source[0]['dictKey'] || '': '',
|
|
drawingNo: '',
|
|
drawingNo: '',
|
|
citeChangeNumber: '',
|
|
citeChangeNumber: '',
|
|
- isApproval:item?.isApproval?.length>0?item?.isApproval:1 || 1,
|
|
|
|
- isNeedCertification: item?.isNeedCertification?.length>0?item.isNeedCertification:1 || 1,
|
|
|
|
|
|
+ isApproval: 1,
|
|
|
|
+ isNeedCertification: 1,
|
|
dutyUser: dutyUser.value,
|
|
dutyUser: dutyUser.value,
|
|
pdfFileUrl: item?.pdfUrl || '',
|
|
pdfFileUrl: item?.pdfUrl || '',
|
|
filePage: item?.page || '',
|
|
filePage: item?.page || '',
|
|
isElement: 0
|
|
isElement: 0
|
|
})
|
|
})
|
|
- console.log(newArr,'newArr');
|
|
|
|
- newArr[0].isApproval=item?.isApproval
|
|
|
|
- newArr[0].isNeedCertification=item?.isNeedCertification
|
|
|
|
tableUploadData.value = newArr
|
|
tableUploadData.value = newArr
|
|
} else {
|
|
} else {
|
|
console.log(item)
|
|
console.log(item)
|
|
@@ -1292,21 +1281,7 @@ const delUploadData = async (row,index) => {
|
|
tableUploadData.value.splice(index,1);
|
|
tableUploadData.value.splice(index,1);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
-const isReplace=ref(false)
|
|
|
|
-const replacerow=ref({})
|
|
|
|
-const replaceIndex=ref()
|
|
|
|
-//替换replaceUploadData
|
|
|
|
-const replaceUploadData = async (row,index) => {
|
|
|
|
- console.log(row,index);
|
|
|
|
- replacerow.value=row
|
|
|
|
- replaceIndex.value=index
|
|
|
|
-
|
|
|
|
- setdutyUser()
|
|
|
|
- HcUploadFileRef?.value.btnUpload()
|
|
|
|
-
|
|
|
|
- isReplace.value=true
|
|
|
|
- tableUploadData.value.splice(replaceIndex.value,1);
|
|
|
|
-}
|
|
|
|
|
|
+
|
|
//批量上传保存
|
|
//批量上传保存
|
|
const uploadSaveLoading = ref(false)
|
|
const uploadSaveLoading = ref(false)
|
|
const batchUploadSave = async () => {
|
|
const batchUploadSave = async () => {
|
|
@@ -1376,7 +1351,24 @@ const batchUploadCancel = () => {
|
|
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
|
+//上传新文件
|
|
|
|
+const newUploadsChange = ({fileList}, row) => {
|
|
|
|
+ if (fileList.length > 0) {
|
|
|
|
+ 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 || ''
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
|
|
|
|
+const newUploadsProgress = (val, row) => {
|
|
|
|
+ row.newBtnLoading = val
|
|
|
|
+}
|
|
//批量编辑
|
|
//批量编辑
|
|
const batchEditClick = () => {
|
|
const batchEditClick = () => {
|
|
const rows = deepClone(tableCheckedKeys.value)
|
|
const rows = deepClone(tableCheckedKeys.value)
|