fix : 修复项目实施附件查询及上传功能

This commit is contained in:
2024-06-01 00:46:00 +08:00
parent f4ad871831
commit daf5ffe2c9
4 changed files with 68 additions and 40 deletions

View File

@@ -4,9 +4,9 @@
<el-select v-model="attachment.tag" placeholder="请选择标签" clearable filterable style="width: 200px">
<el-option
v-for="item in tagsOption"
:key="item.label"
:label="item.value"
:value="item.label"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
</el-form-item>
@@ -27,7 +27,7 @@
<script setup lang="jsx">
import {downloadFile} from "@/api/project-demand";
import {getImplementationAttachment,getTags} from "@/api/project-manage";
import {getTags,getImplementationAttachment} from "@/api/project-manage";
import {ElNotification} from "element-plus";
const route = useRoute()
@@ -80,7 +80,10 @@ const showTable = ref(true)
const otherFileList = ref([])
const getTagsOption = () => {
if (!route.query.id) return
getTags(route.query.id).then(res => {
let params={
projectId: route.query.id
}
getTags(params).then(res => {
ElNotification({
title: '提示',
message: res.msg,
@@ -94,13 +97,18 @@ const getTagsOption = () => {
const handleSearch = () => {
let params
if (attachment.tag) {
tagsOption.value.forEach(item => {
if (item.value === attachment.tag) {
attachment.tag = item.label
}
})
params = {
projectId: route.query.id,
targetId: route.query.id,
tag: attachment.tag
}
} else {
params = {
projectId: route.query.id
targetId: route.query.id
}
}
getImplementationAttachment(params).then(res => {
@@ -111,6 +119,7 @@ const handleSearch = () => {
})
showTable.value = false
if (res.code === 1000) {
// tagsOption.value = res.data
otherFileList.value = res.data
nextTick(() => {
showTable.value = true
@@ -136,7 +145,7 @@ const handleDownload = (row) => {
})
}
getTagsOption()
handleSearch()
// handleSearch()
</script>
<style scoped>