From 87edc55a377c3fca459ab48010a9716b0311c4a8 Mon Sep 17 00:00:00 2001 From: Your Name <123456> Date: 星期一, 15 八月 2022 09:21:54 +0800 Subject: [PATCH] lct --- src/views/contingencyManagement/emergencyDrill/drillImplementationEvaluation/component/approvalProgress.vue | 78 ++++++++++++++++++++++---------------- 1 files changed, 45 insertions(+), 33 deletions(-) diff --git a/src/views/contingencyManagement/emergencyDrill/drillImplementationEvaluation/component/approvalProgress.vue b/src/views/contingencyManagement/emergencyDrill/drillImplementationEvaluation/component/approvalProgress.vue index 81b4674..9697053 100644 --- a/src/views/contingencyManagement/emergencyDrill/drillImplementationEvaluation/component/approvalProgress.vue +++ b/src/views/contingencyManagement/emergencyDrill/drillImplementationEvaluation/component/approvalProgress.vue @@ -167,20 +167,7 @@ </el-col> <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20" style="margin-bottom: 0!important;"> <el-form-item label="预案附件"> - <el-upload - v-model:file-list="fileList" - class="upload-demo" - action="https://run.mocky.io/v3/9d059bf9-4660-45f2-925d-ce80ad6c4d15" - :on-change="handleChange" - > - <el-button type="primary" - >点击上传</el-button> - <template #tip> - <div class="el-upload__tip"> - 添加相关附件 - </div> - </template> - </el-upload> + <uploaderFile :fileList="ruleForm.planFileList" :disabled="true"></uploaderFile> </el-form-item> </el-col> <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20"> @@ -368,20 +355,8 @@ </el-col> <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20"> <el-form-item label="附件列表"> - <el-upload - v-model:file-list="ruleForm.userList" - class="upload-demo" - action="https://run.mocky.io/v3/9d059bf9-4660-45f2-925d-ce80ad6c4d15" - :on-change="handleChange" - > - <el-button type="primary" - >点击上传</el-button> - <template #tip> - <div class="el-upload__tip"> - 添加相关附件 - </div> - </template> - </el-upload> + <uploaderFile :fileList="fileList" :systemName="'EMERGENCY'" :disabled="disabled" + @successUploader="successUploader"></uploaderFile> </el-form-item> </el-col> </el-row> @@ -421,12 +396,14 @@ import DailogSearchUser from "/@/components/DailogSearchUser/index.vue" import {emergencyDrillEvaluationApi} from "/@/api/contingencyManagement/emergencyDrillEvaluation"; import {goalManagementApi} from "/@/api/goalManagement"; +import uploaderFile from '/@/components/uploaderFile/index.vue'; export default defineComponent({ name: 'approvalProgress', components: { UserSelections, RegionsDialog, - DailogSearchUser + DailogSearchUser, + uploaderFile }, setup(props, { emit }) { const isShowDialog = ref(false) @@ -512,6 +489,8 @@ ruleForm.value.evaluationUserListString += res.data.data.evaluationUserList[a].userName+';' } } + fileList.value = (res.data.data.evaluationFileList?res.data.data.evaluationFileList:[]) + initFileListData() }); } if(title=='演练实施评价'){ @@ -548,6 +527,8 @@ } } } + fileList.value = (res.data.data.evaluationFileList?res.data.data.evaluationFileList:[]) + initFileListData() }); } if(title=='演练实施查看评价'){ @@ -584,15 +565,41 @@ ruleForm.value.evaluationUserListString += res.data.data.evaluationUserList[a].userName+';' } } - + fileList.value = (res.data.data.evaluationFileList?res.data.data.evaluationFileList:[]) + initFileListData() } }); } + }; + const initFileListData = async () => { + for(var a = 0;a<ruleForm.value.planFileList.length;a++){ + ruleForm.value.planFileList[a].name = ruleForm.value.planFileList[a].fileName + } + // 事故分析会议纪要 + for(var a = 0;a<fileList.value.length;a++){ + fileList.value[a].name = fileList.value[a].fileName + } + } + // 上传成功组装数据 + const successUploader = (list) =>{ + fileList.value = list + const formFileList = [] + for(var a = 0;a<fileList.value.length;a++){ + formFileList.push( + { + fileName:fileList.value[a].fileName, + fileUrl:'' + } + ) + } + ruleForm.value.fileList = formFileList + } const resetForm = (formEl: FormInstance | undefined) => { isShowDialog.value = false; if (!formEl) return; formEl.resetFields(); + fileList.value = [] }; // 关闭弹窗 const closeDialog = () => { @@ -605,7 +612,7 @@ //日期选择器 const value1 = ref('') // 上传附件 - const fileList = ref<UploadUserFile[]>([]) + const fileList = ref([]) // 可选择树 const treeSelect = ref() const tree = [ @@ -663,6 +670,9 @@ // }) const submitForm = async (title: string, formEl: FormInstance | undefined) => { + if(!ruleForm.value.fileList){ + ruleForm.value.fileList = [] + } //演练负责人(评价) ruleForm.value.userList = ruleForm.value.evaluationUserList @@ -861,7 +871,9 @@ newTreeList, selectUser, submitForm, - realRuleForm + realRuleForm, + successUploader, + initFileListData }; }, }); @@ -910,4 +922,4 @@ font-weight: 500; font-size: 14px; } -</style> \ No newline at end of file +</style> -- Gitblit v1.9.2