fix : 修复项目实施附件查询及上传功能、代码文件优化
This commit is contained in:
@@ -11,7 +11,7 @@
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
<el-button type="primary" link @click="changeInput">{{showInput? '选择': '输入'}}</el-button>
|
||||
<el-button type="primary" link @click="changeInput">{{ showInput ? '选择' : '输入' }}</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<baseTitle title="其他文件"></baseTitle>
|
||||
@@ -30,9 +30,10 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="jsx">
|
||||
import {uploadAttachment,getTags} from "@/api/project-manage";
|
||||
import {getTags} from "@/api/project-manage";
|
||||
import {ElNotification} from "element-plus";
|
||||
import {useTagsView} from '@/stores/tagsview.js'
|
||||
import {uploadFileList} from "@/api/project-manage/attachment";
|
||||
|
||||
const tagsViewStore = useTagsView()
|
||||
const route = useRoute()
|
||||
@@ -41,7 +42,7 @@ const fileList = ref([])
|
||||
const showInput = ref(false)
|
||||
const tagsOption = ref([])
|
||||
const formData = ref({
|
||||
tagName:''
|
||||
tagName: ''
|
||||
})
|
||||
const tableConfig = reactive({
|
||||
columns: [
|
||||
@@ -87,16 +88,13 @@ const name = ref(router.currentRoute.value.name)
|
||||
const rules = reactive({
|
||||
tagName: [{required: true, message: '请输入标签名称', trigger: ['blur', 'change']}],
|
||||
})
|
||||
const changeInput=()=>{
|
||||
showInput.value=!showInput.value;
|
||||
formData.value.tagName='';
|
||||
const changeInput = () => {
|
||||
showInput.value = !showInput.value;
|
||||
formData.value.tagName = '';
|
||||
}
|
||||
const getTagsOption = () => {
|
||||
if (!route.query.id) return
|
||||
let params={
|
||||
projectId: route.query.id
|
||||
}
|
||||
getTags(params).then(res => {
|
||||
getTags(route.query.id).then(res => {
|
||||
ElNotification({
|
||||
title: '提示',
|
||||
message: res.msg,
|
||||
@@ -134,26 +132,17 @@ const getFile = (val) => {
|
||||
showTable.value = true
|
||||
})
|
||||
}
|
||||
const getFileParam = (item) => {
|
||||
return {
|
||||
fileId: item.fileId
|
||||
}
|
||||
}
|
||||
const handleSubmit = async (instance) => {
|
||||
if (!instance) return
|
||||
instance.validate(async (valid) => {
|
||||
if (!valid) return
|
||||
let files = []
|
||||
fileList.value.forEach(item => {
|
||||
files.push(getFileParam(item))
|
||||
})
|
||||
let params = {
|
||||
fileList: files,
|
||||
fileList: fileList.value,
|
||||
projectId: route.query.id,
|
||||
tag: formData.value.tagName
|
||||
tag: formData.value.tagName,
|
||||
targetState: "30"
|
||||
}
|
||||
console.log('params', params)
|
||||
let res = await uploadAttachment(params)
|
||||
let res = await uploadFileList(params)
|
||||
ElNotification({
|
||||
title: '提示',
|
||||
message: res.msg,
|
||||
@@ -161,17 +150,17 @@ const handleSubmit = async (instance) => {
|
||||
})
|
||||
if (res.code === 1000) {
|
||||
tagsViewStore.delVisitedViews(router.currentRoute.value.path)
|
||||
if(route.query.type==='40'){
|
||||
if (route.query.type === '40') {
|
||||
await router.push({
|
||||
name: 'Filing/attachment',
|
||||
query:{
|
||||
query: {
|
||||
id: route.query.id
|
||||
}
|
||||
})
|
||||
}else {
|
||||
} else {
|
||||
await router.push({
|
||||
name: 'Implementation/attachment',
|
||||
query:{
|
||||
query: {
|
||||
id: route.query.id
|
||||
}
|
||||
})
|
||||
@@ -183,7 +172,7 @@ getTagsOption()
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
:deep(.el-table--fit ){
|
||||
height: 300px!important;
|
||||
:deep(.el-table--fit ) {
|
||||
height: 300px !important;
|
||||
}
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user