fix : 修复项目归档中附件上传问题
This commit is contained in:
@@ -1,42 +1,46 @@
|
||||
<template>
|
||||
<el-form :model="attachment" inline>
|
||||
<el-form-item label="名称" prop="fileName">
|
||||
<el-input v-model="attachment.fileName" placeholder="请输入附件名称查询" clearable filterable style="width: 300px"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="标签" prop="tag" v-if="type==='40'">
|
||||
<el-select v-model="attachment.tag" placeholder="请选择标签" clearable filterable style="width: 300px">
|
||||
<el-option
|
||||
v-for="item in tagsOption"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button @click="handleSearch" color="#DED0B2">搜索</el-button>
|
||||
<el-button v-if="uploadState" color="#DED0B2" @click="handleUpload">上传附件</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<el-card style="width: 100%">
|
||||
<fvTable style="width: 100%;max-height: 250px" v-if="showTable" :tableConfig="tableConfig"
|
||||
:data="fileList" :isSettingCol="false" :pagination="false">
|
||||
<template #empty>
|
||||
<el-empty :image-size="90" description="暂无数据" style="padding: 0"/>
|
||||
</template>
|
||||
</fvTable>
|
||||
</el-card>
|
||||
<div v-loading="_value">
|
||||
<el-form :model="attachment" inline>
|
||||
<el-form-item label="名称" prop="fileName">
|
||||
<el-input v-model="attachment.fileName" placeholder="请输入附件名称查询" clearable filterable style="width: 300px"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="标签" prop="tag" v-if="type==='40'">
|
||||
<el-select v-model="attachment.tag" placeholder="请选择标签" clearable filterable style="width: 300px">
|
||||
<el-option
|
||||
v-for="item in tagsOption"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button @click="handleSearch" color="#DED0B2">搜索</el-button>
|
||||
<el-button @click="handleReset">重置</el-button>
|
||||
<el-button v-if="uploadState" color="#DED0B2" @click="handleUpload">上传附件</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<el-card style="width: 100%">
|
||||
<fvTable style="width: 100%;max-height: 250px" v-if="showTable" :tableConfig="tableConfig"
|
||||
:data="fileList" :isSettingCol="false" :pagination="false">
|
||||
<template #empty>
|
||||
<el-empty :image-size="90" description="暂无数据" style="padding: 0"/>
|
||||
</template>
|
||||
</fvTable>
|
||||
</el-card>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="jsx">
|
||||
import {downloadFile} from "@/api/project-demand";
|
||||
import {ElNotification} from "element-plus";
|
||||
import {getTags} from "@/api/project-manage";
|
||||
import {computed} from "vue";
|
||||
|
||||
const route = useRoute()
|
||||
const router = useRouter()
|
||||
const attachment = reactive({})
|
||||
const emit = defineEmits(['search'])
|
||||
const emit = defineEmits(['search','update:modelValue'])
|
||||
const props = defineProps({
|
||||
fileList: {
|
||||
type: Array,
|
||||
@@ -46,7 +50,11 @@ const props = defineProps({
|
||||
type: String,
|
||||
default: '00'
|
||||
},
|
||||
uploadState:{
|
||||
uploadState: {
|
||||
type: Boolean,
|
||||
default: true
|
||||
},
|
||||
loading: {
|
||||
type: Boolean,
|
||||
default: true
|
||||
}
|
||||
@@ -91,6 +99,14 @@ const tableConfig = reactive({
|
||||
]
|
||||
})
|
||||
const showTable = ref(true)
|
||||
const _value = computed({
|
||||
get() {
|
||||
return props.loading || ""
|
||||
},
|
||||
set(value) {
|
||||
emit('update:modelValue', value)
|
||||
}
|
||||
})
|
||||
const getTagsOption = () => {
|
||||
if (!route.query.id) return
|
||||
getTags(route.query.id).then(res => {
|
||||
@@ -108,6 +124,11 @@ const getTagsOption = () => {
|
||||
const handleSearch = () => {
|
||||
emit('search', attachment)
|
||||
}
|
||||
const handleReset=()=>{
|
||||
attachment.fileName=''
|
||||
attachment.tag=''
|
||||
emit('search', {})
|
||||
}
|
||||
const handleUpload = () => {
|
||||
emit('upload')
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user