From ea2b0825e761a55b17e7bfa044e8267de09c27a9 Mon Sep 17 00:00:00 2001
From: Admin <978517621@qq.com>
Date: 星期二, 13 九月 2022 14:44:13 +0800
Subject: [PATCH] Default Changelist
---
src/views/contingencyManagement/emergencyDrill/releaseOfDrillPlan/component/openAdd.vue | 53 ++++++++++++++++++++++++++++++++++-------------------
1 files changed, 34 insertions(+), 19 deletions(-)
diff --git a/src/views/contingencyManagement/emergencyDrill/releaseOfDrillPlan/component/openAdd.vue b/src/views/contingencyManagement/emergencyDrill/releaseOfDrillPlan/component/openAdd.vue
index 8325c4b..8f988a3 100644
--- a/src/views/contingencyManagement/emergencyDrill/releaseOfDrillPlan/component/openAdd.vue
+++ b/src/views/contingencyManagement/emergencyDrill/releaseOfDrillPlan/component/openAdd.vue
@@ -162,20 +162,8 @@
</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="fileList" :systemName="'EMERGENCY'" :disabled="disabled"
+ @successUploader="successUploader"></uploaderFile>
</el-form-item>
</el-col>
</el-row>
@@ -215,12 +203,13 @@
import {releaseDrillPlanApi} from "/@/api/contingencyManagement/emergencyDrillPlan";
import {goalManagementApi} from "/@/api/goalManagement";
import { Session } from '/@/utils/storage';
-
+import uploaderFile from '/@/components/uploaderFile/index.vue';
export default defineComponent({
name: 'openAdd',
components: {
RegionsDialog,
- DailogSearchUser
+ DailogSearchUser,
+ uploaderFile
},
setup(props, { emit }) {
const isShowDialog = ref(false)
@@ -281,14 +270,35 @@
for(var a = 0;a<res.data.data.chargeUserList.length;a++){
ruleForm.value.chargeUserListString += res.data.data.chargeUserList[a].userName+';'
}
+ fileList.value = (res.data.data.fileList?res.data.data.fileList:[])
+ initFileListData()
}
});
}
};
+ const initFileListData = async () => {
+ 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 value1 = ref('')
// 上传附件
- const fileList = ref<UploadUserFile[]>([])
+ const fileList = ref([])
// 可选择树
const treeSelect = ref()
const tree = [
@@ -318,6 +328,9 @@
});
// 表单提交验证必填项
const submitForm = async (title: string, formEl: FormInstance | undefined) => {
+ if(!ruleForm.value.fileList){
+ ruleForm.value.fileList = []
+ }
ruleForm.value.userList = ruleForm.value.userList.concat(ruleForm.value.chargeUserList)
delete ruleForm.value.planName
delete ruleForm.value.chargeUserListString
@@ -412,6 +425,7 @@
}
const resetForm = (formEl: FormInstance | undefined) => {
isShowDialog.value = false;
+ fileList.value=[]
if (!formEl) return;
ruleForm.value = {
makingPlanDate: '', // 计划制定日期
@@ -473,7 +487,6 @@
)
ruleForm.value.userListString+=e[a].realName+';'
}
-
};
const SearchFZUser = (e:any) => {
console.log('演练负责人员',e[0].userName)
@@ -532,7 +545,9 @@
onUser,
userFZRef,
SearchUser,
- SearchFZUser
+ SearchFZUser,
+ successUploader,
+ initFileListData
};
},
});
--
Gitblit v1.9.2