fix : 修复页面细节功能及附件上传组件

This commit is contained in:
2024-05-20 00:29:31 +08:00
parent 1f4389eb5e
commit 9661cdbb2b
10 changed files with 268 additions and 157 deletions

View File

@@ -26,10 +26,12 @@
<script setup lang="jsx">
import ProcessDiagramViewer from '@/views/workflow/common/ProcessDiagramViewer.vue';
import {getProjectCheckProcess, projectCheck} from "@/api/project-manage";
import { ElNotification} from "element-plus";
import {ElNotification} from "element-plus";
import {useProcessStore} from '@/stores/processStore.js';
import {useTagsView} from '@/stores/tagsview.js'
const tagsViewStore = useTagsView()
const formData = ref({})
const fileList = ref([])
const file = ref({})
const applyForm = ref()
const deploymentId = ref()
const showTable = ref(true)
@@ -56,13 +58,12 @@ const compositeParam = (item) => {
}
const getAttachment = (val) => {
console.log('上传文件getAttachment', val)
let fileObj = compositeParam(val, 1)
fileList.value.push(fileObj)
file.value=compositeParam(val)
}
const getOtherFile = (val) => {
console.log('上传文件getOtherFile', val)
showTable.value = false
let fileObj = compositeParam(val, 2)
let fileObj = compositeParam(val)
otherFileList.value.push(fileObj)
nextTick(() => {
showTable.value = true
@@ -79,16 +80,19 @@ const handleSubmit = (instance) => {
if (!instance) return
instance.validate(async (valid) => {
if (!valid) return
if(fileList.value.length===0){
applyForm.value.validate()
}else {
applyForm.value.clearValidate()
}
// if(JSON.stringify(file.value) == "{}"){
// applyForm.value.validate()
// }else {
// applyForm.value.clearValidate()
// }
if (!valid) return
let files = []
fileList.value.forEach(item => {
files.push(getFileParam(item))
})
let singleFile={}
if(file.value.fileId!==undefined){
singleFile = {
fileId: file.value.fileId
}
}
otherFileList.value.forEach(item => {
files.push(getFileParam(item))
})
@@ -96,6 +100,7 @@ const handleSubmit = (instance) => {
deploymentId: deploymentId.value,
requirementId: route.query.id,
files: files,
singleFile: singleFile,
projectId:route.query.projectId,
}
console.log('params',params)