feat : 文件预览,项目详情文件表格展示

This commit is contained in:
2024-07-24 18:17:55 +08:00
parent 9506d3e0f6
commit 6cc409d744
23 changed files with 722 additions and 786 deletions

View File

@@ -198,6 +198,7 @@ const tableConfig = reactive({
prop: 'originalFileName',
label: '文件名',
align: 'center',
// currentRender: ({row, index}) => (<div style="color: #2a99ff;cursor: pointer;" onClick={()=>clickToPreview(row)}>{row.originalFileName}</div>)
},
{
prop: 'tag',
@@ -300,44 +301,8 @@ const selectRows = ref([])
const projectId = ref(route.query.projectId)
const sessionParams = ref({})
if (localStorage.getItem('preProcess')) {
let param = JSON.parse(localStorage.getItem('preProcess'))
localFormData.value.preProcess = param
sessionParams.value.preProcess = param
localStorage.setItem('preProcess', JSON.stringify(param))
}
if (localStorage.getItem('singleFile')) {
let param = JSON.parse(localStorage.getItem('singleFile'))
localFormData.value.singleFile = param
singleList.value = [param]
localStorage.setItem('singleFile', JSON.stringify(param))
showSingleTable.value = false
nextTick(() => {
showSingleTable.value = true
})
}
if (localStorage.getItem('otherFileList')) {
let param = JSON.parse(localStorage.getItem('otherFileList'))
localFormData.value.otherFileList = param
otherFileList.value = param
localStorage.setItem('otherFileList', JSON.stringify(param))
showTable.value = false
nextTick(() => {
showTable.value = true
})
}
if (localStorage.getItem('projectChargePersonUserList')) {
let param = JSON.parse(localStorage.getItem('projectChargePersonUserList'))
projectChargePersonUserList.value = param
localStorage.setItem('projectChargePersonUserList', JSON.stringify(param))
}
if (localStorage.getItem('projectPersonUserList')) {
let param = JSON.parse(localStorage.getItem('projectPersonUserList'))
projectPersonUserList.value = param
localProjectPerson.value = param
localStorage.setItem('projectPersonUserList', JSON.stringify(param))
}
const getProjectPerson = (list) => {
if (!list || list && list.length === 0) {
if (localStorage.getItem('projectPersonUserList')) {
@@ -531,7 +496,7 @@ const compositeParam = (item) => {
}
}
const getAttachment = (val) => {
// console.log('上传文件getAttachment', val)
console.log('上传文件getAttachment', val)
showSingleTable.value = false
localFormData.value.singleFile = compositeParam(val)
singleList.value.push(compositeParam(val))
@@ -738,16 +703,46 @@ watchEffect(() => {
if (props.formData.projectChargePerson != null) {
localFormData.value.projectChargePerson = props.formData.projectChargePerson.id
}
// if(props.formData.fileList&&props.formData.fileList.length>0){
// otherFileList.value=props.formData.fileList
// }
// localFormData.value.projectPersonIds = []
// if (projectPersonUserList.value){
// projectPersonUserList.value.forEach(item => {
// localFormData.value.projectPersonIds.push(item.id)
// })
// }
// console.log('projectPersonUserList.value',projectPersonUserList.value)
if (localStorage.getItem('preProcess')) {
let param = JSON.parse(localStorage.getItem('preProcess'))
localFormData.value.preProcess = param
sessionParams.value.preProcess = param
localStorage.setItem('preProcess', JSON.stringify(param))
}
if (localStorage.getItem('singleFile')) {
let param = JSON.parse(localStorage.getItem('singleFile'))
localFormData.value.singleFile = param
singleList.value = [param]
localStorage.setItem('singleFile', JSON.stringify(param))
showSingleTable.value = false
nextTick(() => {
showSingleTable.value = true
})
}
if (localStorage.getItem('otherFileList')) {
let param = JSON.parse(localStorage.getItem('otherFileList'))
localFormData.value.otherFileList = param
otherFileList.value = param
localStorage.setItem('otherFileList', JSON.stringify(param))
showTable.value = false
nextTick(() => {
showTable.value = true
})
}
if (localStorage.getItem('projectChargePersonUserList')) {
let param = JSON.parse(localStorage.getItem('projectChargePersonUserList'))
projectChargePersonUserList.value = param
localStorage.setItem('projectChargePersonUserList', JSON.stringify(param))
}
if (localStorage.getItem('projectPersonUserList')) {
let param = JSON.parse(localStorage.getItem('projectPersonUserList'))
projectPersonUserList.value = param
localProjectPerson.value = param
localStorage.setItem('projectPersonUserList', JSON.stringify(param))
}
return flag
})
onActivated(() => {