Merge pull request 'fix : 附件上传修复' (#590) from master into prod

Reviewed-on: http://git.feashow.cn/clay/mosr-web/pulls/590
This commit is contained in:
2024-07-18 07:22:17 +00:00

View File

@@ -2,7 +2,7 @@
<baseTitle title="基础信息"></baseTitle> <baseTitle title="基础信息"></baseTitle>
<fvForm :schema="schema" @getInstance="(e)=>baseForm = e"></fvForm> <fvForm :schema="schema" @getInstance="(e)=>baseForm = e"></fvForm>
<baseTitle title="项目实施-上传附件"></baseTitle> <baseTitle title="项目实施-上传附件"></baseTitle>
<el-form :model="formData" ref="tagForm" label-width="auto" > <el-form :model="formData" ref="tagForm" label-width="auto">
<el-form-item label="标签名称" prop="tagName"> <el-form-item label="标签名称" prop="tagName">
<el-input v-model="formData.tagName" placeholder="请输入标签名称" style="width: 300px" v-if="showInput" clearable/> <el-input v-model="formData.tagName" placeholder="请输入标签名称" style="width: 300px" v-if="showInput" clearable/>
<el-select v-model="formData.tagName" placeholder="请选择标签名称" clearable filterable style="width: 300px" v-else> <el-select v-model="formData.tagName" placeholder="请选择标签名称" clearable filterable style="width: 300px" v-else>
@@ -18,13 +18,14 @@
</el-form> </el-form>
<div style="display: flex; align-items: center"> <div style="display: flex; align-items: center">
<baseTitle title="其他文件" style="margin-right: 10px"></baseTitle> <baseTitle title="其他文件" style="margin-right: 10px"></baseTitle>
<file-upload @getFile="getFile" :disabled="!formData.tagName" :title="!formData.tagName?'请先选择/输入标签!':''"/></div> <file-upload @getFile="getFile" :disabled="!formData.tagName" :title="!formData.tagName?'请先选择/输入标签!':''"/>
<fvTable style="width: 100%;max-height: 162px;" v-if="showTable" height="162" :tableConfig="tableConfig" </div>
:data="fileList" :isSettingCol="false" :pagination="false"> <fvTable style="width: 100%;max-height: 300px;" v-if="showTable" height="300" :tableConfig="tableConfig"
<template #empty> :data="fileList" :isSettingCol="false" :pagination="false">
<el-empty :image-size="55" description="暂无数据" style="padding: 0"/> <template #empty>
</template> <el-empty :image-size="99" description="暂无数据" style="padding: 0"/>
</fvTable> </template>
</fvTable>
<div class="oper-page-btn"> <div class="oper-page-btn">
<el-button color="#DED0B2" @click="handleSubmit(tagForm)">提交</el-button> <el-button color="#DED0B2" @click="handleSubmit(tagForm)">提交</el-button>
</div> </div>
@@ -37,7 +38,7 @@ import {useTagsView} from '@/stores/tagsview.js'
import {uploadFileList} from "@/api/project-manage/attachment"; import {uploadFileList} from "@/api/project-manage/attachment";
import {computed, ref} from "vue"; import {computed, ref} from "vue";
import {getBaseInfoApi} from "@/components/steps/api"; import {getBaseInfoApi} from "@/components/steps/api";
import {downloadFile,deleteFile} from "@/api/project-demand"; import {downloadFile, deleteFile} from "@/api/project-demand";
const tagsViewStore = useTagsView() const tagsViewStore = useTagsView()
const route = useRoute() const route = useRoute()
@@ -130,14 +131,14 @@ const name = ref(router.currentRoute.value.name)
const rules = reactive({ const rules = reactive({
tagName: [{required: true, message: '请输入标签名称', trigger: ['blur', 'change']}], tagName: [{required: true, message: '请输入标签名称', trigger: ['blur', 'change']}],
}) })
onActivated(()=>{ onActivated(() => {
console.log('onActivated') console.log('onActivated')
formData.value.tagName = ''; formData.value.tagName = '';
showTable.value=false showTable.value = false
nextTick(()=>{ nextTick(() => {
showTable.value=true showTable.value = true
}) })
fileList.value=[] fileList.value = []
}) })
const handleDelete = (row) => { const handleDelete = (row) => {
deleteFile(row.fileId).then(res => { deleteFile(row.fileId).then(res => {
@@ -246,15 +247,24 @@ const handleSubmit = async (instance) => {
} }
}) })
} else { } else {
await router.push({ if (router.query.type !== '40') {
name: 'Implementation/detail', router.push({
query: { name: 'Implementation/attachment',
id: route.query.id, query: {
state: route.query.state, id: route.query.id
projectId: route.query.projectId, }
step: '40' })
} } else {
}) await router.push({
name: 'Implementation/detail',
query: {
id: route.query.id,
state: route.query.state,
projectId: route.query.projectId,
step: '40'
}
})
}
} }
} }
}) })