fix : 修复页面细节功能及附件上传组件

This commit is contained in:
2024-05-20 00:29:31 +08:00
parent 1f4389eb5e
commit 9661cdbb2b
10 changed files with 268 additions and 157 deletions

View File

@@ -3,15 +3,20 @@
<el-row>
<el-col :span="24">
<el-form-item :label="label" prop="attachment">
<file-upload @getFile="getAttachment" :showFileList="showFileList" @delete="deleteAttachment"/>
<template v-if="preview">
<el-button type="primary" link @click="handleDownload(singleFile)" style="font-size: 18px">{{ singleFile?.originalFileName }}</el-button>
</template>
<template v-else>
<file-upload @getFile="getAttachment" :showFileList="showFileList" :maxSize="0" @delete="deleteAttachment"/>
</template>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="其他文件">
<el-card style="width: 100%">
<file-upload @getFile="getOtherFile" :showFileList="false"/>
<file-upload @getFile="getOtherFile"/>
<fvTable style="width: 100%;max-height: 250px;height: 250px" v-if="showTable" :tableConfig="tableConfig"
:data="otherFileList" :isSettingCol="false" :pagination="false">
:data="allFileList" :isSettingCol="false" :pagination="false">
<template #empty>
<el-empty :image-size="90" description="暂无数据" style="padding: 0"/>
</template>
@@ -75,6 +80,8 @@ const rules = reactive({
attachment: [{required: true, message: '请上传附件', trigger: ['blur','change']}],
})
const applyForm=ref()
const singleFile=ref()
const allFileList=ref([])
const props = defineProps({
showFileList: {
type: Boolean,
@@ -85,16 +92,32 @@ const props = defineProps({
}, showTable: {
type: Boolean,
default: true
}, preview: {
type: Boolean,
default: false
},otherFileList: {
type: Array,
default: []
},formData: {
type: Array,
default: []
}
})
watch(() => props.showTable, (newVal) => {
props.showTable = newVal
}, {deep: true})
watch(() => props.otherFileList, (newVal) => {
props.otherFileList = newVal
newVal.forEach(item=>{
allFileList.value.push(item)
})
}, {deep: true})
watch(() => props.formData.fileList, (newVal) => {
newVal.forEach(item=>{
allFileList.value.push(item)
})
}, {deep: true})
watch(() => props.formData.singleFile, (newVal) => {
singleFile.value = newVal
}, {deep: true})
const getAttachment = (val) => {
emit('getAttachment', val)
@@ -140,7 +163,9 @@ defineExpose({
},
clearValidate(){
return applyForm.value.clearValidate()
}
},
allFileList,
singleFile
})
</script>

View File

@@ -4,13 +4,13 @@
<baseTitle title="各流程信息"></baseTitle>
<div class="steps-box">
<el-steps :active="localActive" finish-status="success">
<el-step
v-for="(item, index) in localSteps"
:key="item.key"
:title="item.title"
<el-step
v-for="(item, index) in localSteps"
:key="item.key"
:title="item.title"
:class="stepClass(index)"
@click="handleStep(item.key, index)"
@click="handleStep(item.key, index)"
/>
</el-steps>
</div>
@@ -91,7 +91,7 @@ const schema = computed(()=>{
colProps: {
span: 12
}
// component:
// component:
},
{
label: '征集类型',
@@ -99,7 +99,7 @@ const schema = computed(()=>{
colProps: {
span: 12
}
// component:
// component:
},
{
label: '截止时间',
@@ -107,7 +107,7 @@ const schema = computed(()=>{
colProps: {
span: 12
}
// component:
// component:
},
{
label: '需求名称',
@@ -115,7 +115,7 @@ const schema = computed(()=>{
colProps: {
span: 12
}
// component:
// component:
},
]
})
@@ -236,6 +236,7 @@ getBaseInfo()
watchEffect(() => {
console.log(props.active, 'props.active');
localActive.value = props.active
getBaseInfo()
})
</script>
@@ -251,4 +252,4 @@ watchEffect(() => {
.step-error {
cursor: not-allowed;
}
</style>
</style>