feat : 需求上报fileLie 权限控制

This commit is contained in:
clay
2024-06-02 17:37:53 +08:00
parent e9592920e7
commit 3ed5068dee
16 changed files with 206 additions and 62 deletions

View File

@@ -124,8 +124,9 @@
</el-button>
</el-form-item>
</el-col>
<el-col :span="24">
<el-col :span="24" v-if="fileListShow === 'READ' || fileListShow === 'EDIT'">
<el-form-item label="需求上报附件">
<file-upload @getFile="getOtherFile" v-if="fileListShow === 'EDIT'"/>
<fvTable style="width: 100%;max-height: 400px;" v-if="processViewer" :tableConfig="tableConfig"
:data="localFormData.fileList" :isSettingCol="false" :pagination="false">
<template #empty>
@@ -148,7 +149,7 @@
<!-- </div>-->
<!-- </el-col>-->
</el-row>
<div class="approval-record">
<div class="approval-record" >
<baseTitle title="审批记录"></baseTitle>
<div class="process">
<operation-render v-if="processViewer" :operation-list="data.operationList"
@@ -187,7 +188,12 @@ const props = defineProps({
processViewer: {
type: Boolean,
default: false
}, loading: {
},
fileListShow:{
type: String,
default: 'READ'
},
loading: {
type: Boolean,
default: false
}
@@ -222,9 +228,26 @@ const tableConfig = reactive({
prop: 'oper',
label: '操作',
align: 'center',
showOverflowTooltip: false,
currentRender: ({row, index}) => {
let btn = []
btn.push({label: '下载', func: () => handleDownload(row), type: 'primary'})
if (row.newFile){
btn.push({label: '删除', func: () => handleDelete(row), type: 'primary'})
}
return (
<el-button type="primary" link onClick={() => handleDownload(row)}>下载</el-button>
<div style={{width: '100%'}}>
{
btn.map(item => (
<el-button
type={item.type}
onClick={() => item.func()}
link>
{item.label}
</el-button>
))
}
</div>
)
}
}
@@ -273,10 +296,33 @@ const handleDownload = (row) => {
a.click()
})
}
const getOtherFile = (val) => {
props.processViewer = false
let fileObj = compositeParam(val)
localFormData.value.fileList.push(fileObj)
nextTick(() => {
props.processViewer = true
})
}
const compositeParam = (item, type) => {
return {
fileId: item.id,
size: item.size,
originalFileName: item.originalFilename,
fileType: item.fileType,
url: item.url,
newFile: true,
tag: '需求上报'
}
}
watch(() => props.processViewer, (newVal) => {
props.processViewer = newVal
}, {deep: true})
watch(() => props.loading, (newVal) => {
props.loading = newVal
}, {deep: true})
@@ -284,6 +330,7 @@ watch(() => props.loading, (newVal) => {
watchEffect(() => {
return Object.keys(props.formData).length && (localFormData.value = props.formData)
})
getFundOptions()
</script>