| | |
| | | import { pxToRem } from '@/utils/rem' |
| | | // 初始化表单数据 |
| | | const initForm = () => ({ |
| | | id:'', |
| | | title: '', |
| | | objectionType: '', |
| | | submitter: '', |
| | |
| | | |
| | | // 文件移除 |
| | | const handleFileRemove = (file, fileListVal) => { |
| | | if (file.response && file.response.attachId) { |
| | | uploadedFiles.value = uploadedFiles.value.filter(item => item.attachId !== file.response.attachId) |
| | | } |
| | | uploadedFiles.value = fileListVal |
| | | } |
| | | |
| | | // 上传前验证 |
| | |
| | | async function submitForm(objectionStatus) { |
| | | const isValid = await formRef.value?.validate().catch(() => false) |
| | | if (!isValid) return |
| | | if (uploadedFiles.value.length === 0) { |
| | | return ElMessage.warning('请上传附件') |
| | | } |
| | | submitting.value = true |
| | | |
| | | try { |
| | | // 构建符合接口要求的提交数据 |
| | | const submitData = { |
| | | // 编辑模式下传递id |
| | | ...(formData.value.id && { id: formData.value.id }), |
| | | title: formData.value.title, |
| | | objectionType: formData.value.objectionType, |
| | | submitter: formData.value.submitter, |
| | |
| | | .detail-container1 { |
| | | display: flex; |
| | | flex-direction: column; |
| | | height: 100% !important; |
| | | } |
| | | .upload-container { |
| | | width: 100%; |