fix : 修复项目附件页面细节

This commit is contained in:
2024-05-30 16:46:51 +08:00
parent 94528cfa06
commit 0c1e566578
3 changed files with 63 additions and 11 deletions

View File

@@ -76,6 +76,16 @@ export const addLedger = (data) => {
data: data data: data
}); });
}; };
export const getTags = (projectId) => {
return request({
url: '/workflow/mosr/project/implementation/tags',
method: "get",
params:{
projectId:projectId
}
});
};
//项目归档 //项目归档
export const getConclusionDetail = (ProjectId) => { export const getConclusionDetail = (ProjectId) => {
return request({ return request({

View File

@@ -1,7 +1,14 @@
<template> <template>
<el-form :model="attachment" inline class="query-form"> <el-form :model="attachment" inline class="query-form">
<el-form-item label="标签" prop="tag"> <el-form-item label="标签" prop="tag">
<el-input v-model="attachment.tag" placeholder="请输入标签" clearable style="width: 200px"/> <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"
/>
</el-select>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button @click="handleSearch" color="#DED0B2">搜索</el-button> <el-button @click="handleSearch" color="#DED0B2">搜索</el-button>
@@ -20,7 +27,7 @@
<script setup lang="jsx"> <script setup lang="jsx">
import {downloadFile} from "@/api/project-demand"; import {downloadFile} from "@/api/project-demand";
import {getImplementationAttachment} from "@/api/project-manage"; import {getImplementationAttachment,getTags} from "@/api/project-manage";
import {ElNotification} from "element-plus"; import {ElNotification} from "element-plus";
const route = useRoute() const route = useRoute()
@@ -28,6 +35,7 @@ const router = useRouter()
const attachment = reactive({ const attachment = reactive({
tag: '' tag: ''
}) })
const tagsOption = ref([])
const tableConfig = reactive({ const tableConfig = reactive({
columns: [ columns: [
{ {
@@ -70,7 +78,19 @@ const tableConfig = reactive({
}) })
const showTable = ref(true) const showTable = ref(true)
const otherFileList = ref([]) const otherFileList = ref([])
const getTagsOption = () => {
if (!route.query.id) return
getTags(route.query.id).then(res => {
ElNotification({
title: '提示',
message: res.msg,
type: res.code === 1000 ? 'success' : 'error'
})
if (res.code === 1000) {
tagsOption.value = res.data
}
})
}
const handleSearch = () => { const handleSearch = () => {
let params let params
if (attachment.tag) { if (attachment.tag) {
@@ -115,6 +135,7 @@ const handleDownload = (row) => {
a.click() a.click()
}) })
} }
// getTagsOption()
handleSearch() handleSearch()
</script> </script>

View File

@@ -2,7 +2,15 @@
<baseTitle title="标签名称"></baseTitle> <baseTitle title="标签名称"></baseTitle>
<el-form :model="formData" ref="tagForm" label-width="auto" :rules="rules"> <el-form :model="formData" ref="tagForm" label-width="auto" :rules="rules">
<el-form-item label="标签名称" prop="tagName"> <el-form-item label="标签名称" prop="tagName">
<el-input v-model="formData.tagName" placeholder="请输入标签名称" style="width: 400px"/> <el-input v-model="formData.tagName" placeholder="请输入标签名称" style="width: 400px" v-if="showInput"/>
<el-select v-model="formData.tagName" placeholder="请选择标签" clearable filterable style="width: 200px" v-else>
<el-option
v-for="item in tagsOption"
:key="item.label"
:label="item.value"
:value="item.label"
/>
</el-select>
</el-form-item> </el-form-item>
</el-form> </el-form>
<baseTitle title="其他文件"></baseTitle> <baseTitle title="其他文件"></baseTitle>
@@ -29,6 +37,8 @@ const tagsViewStore = useTagsView()
const route = useRoute() const route = useRoute()
const router = useRouter() const router = useRouter()
const fileList = ref([]) const fileList = ref([])
const showInput = ref(false)
const tagsOption = ref([])
const formData = ref({ const formData = ref({
tagName:'' tagName:''
}) })
@@ -76,18 +86,29 @@ const name = ref(router.currentRoute.value.name)
const rules = reactive({ const rules = reactive({
tagName: [{required: true, message: '请输入标签名称', trigger: 'blur'}], tagName: [{required: true, message: '请输入标签名称', trigger: 'blur'}],
}) })
const getTagsOption = () => {
if (!route.query.id) return
getTags(route.query.id).then(res => {
ElNotification({
title: '提示',
message: res.msg,
type: res.code === 1000 ? 'success' : 'error'
})
if (res.code === 1000) {
showInput.value = res.data.length === 0;
tagsOption.value = res.data
}
})
}
const compositeParam = (item) => { const compositeParam = (item) => {
let tag = ''
if (name.value === 'Implementation/upload') {
tag = '项目实施'
}
return { return {
fileId: item.id, fileId: item.id,
size: item.size, size: item.size,
originalFileName: item.originalFilename, originalFileName: item.originalFilename,
fileType: item.fileType, fileType: item.fileType,
url: item.url, url: item.url,
tag: tag, tag: formData.value.tagName,
} }
} }
const getFile = (val) => { const getFile = (val) => {
@@ -101,8 +122,7 @@ const getFile = (val) => {
} }
const getFileParam = (item) => { const getFileParam = (item) => {
return { return {
fileId: item.fileId, fileId: item.fileId
tag: item.tag
} }
} }
const handleSubmit = async (instance) => { const handleSubmit = async (instance) => {
@@ -136,6 +156,7 @@ const handleSubmit = async (instance) => {
} }
}) })
} }
// getTagsOption()
</script> </script>
<style scoped> <style scoped>