From 96103611f97b412453ecf0948792987956e4f29f Mon Sep 17 00:00:00 2001 From: shj <1790240199@qq.com> Date: 星期三, 03 八月 2022 09:19:07 +0800 Subject: [PATCH] Merge branch 'master' of https://sinanoaq.cn:8888/r/gtqtOut --- src/views/contingencyManagement/panManagement/component/openAdd.vue | 248 +++++++++++++++++++++++-------------------------- 1 files changed, 117 insertions(+), 131 deletions(-) diff --git a/src/views/contingencyManagement/panManagement/component/openAdd.vue b/src/views/contingencyManagement/panManagement/component/openAdd.vue index 7a6d302..550d6b5 100644 --- a/src/views/contingencyManagement/panManagement/component/openAdd.vue +++ b/src/views/contingencyManagement/panManagement/component/openAdd.vue @@ -3,7 +3,7 @@ <el-dialog :title="titles" v-model="isShowDialog" - width="769px" + width="40%" draggable :fullscreen="full" > @@ -25,10 +25,12 @@ <el-form-item label="适用部门" prop="responsibleDepartment"> <el-tree-select v-model="ruleForm.treeSelect" - :data="tree" + :data="data" multiple :render-after-expand="true" + :props="propse" show-checkbox + clearable /> <el-divider /> </el-form-item> @@ -36,27 +38,27 @@ <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20"> <el-form-item label="预案类型" prop="type"> <el-select v-model="ruleForm.type" class="w100" placeholder="请选择"> - <el-option label="综合应急预案" value="admin"></el-option> - <el-option label="现场处置方案" value="common"></el-option> - <el-option label="专项应急预案" value="common"></el-option> - <el-option label="其他预案" value="common"></el-option> + <el-option label="综合应急预案" value="综合应急预案"></el-option> + <el-option label="现场处置方案" value="现场处置方案"></el-option> + <el-option label="专项应急预案" value="专项应急预案"></el-option> + <el-option label="其他预案" value="其他预案"></el-option> </el-select> </el-form-item> </el-col> <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20"> <el-form-item label="危险源关联" prop="associatedDanger"> <el-select v-model="ruleForm.associatedDanger" class="w100" placeholder="请选择"> - <el-option label="是" value="0"></el-option> - <el-option label="否" value="1"></el-option> + <el-option :label="true">是</el-option> + <el-option :label="false">否</el-option> </el-select> </el-form-item> </el-col> <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20"> <el-form-item label="预案级别" prop="level"> <el-select v-model="ruleForm.level" class="w100" placeholder="请选择"> - <el-option label="公司级" value="admin"></el-option> - <el-option label="分厂级" value="common"></el-option> - <el-option label="车间级" value="common"></el-option> + <el-option label="公司级" value="公司级"></el-option> + <el-option label="分厂级" value="分厂级"></el-option> + <el-option label="车间级" value="车间级"></el-option> </el-select> </el-form-item> </el-col> @@ -77,8 +79,12 @@ <el-form-item label="编写部门" prop="authorDeptId"> <el-tree-select v-model="ruleForm.authorDeptId" + check-strictly :data="data" class="w100" + :props="propse" + clearable + :render-after-expand="false" placeholder="请选择"/> </el-form-item> </el-col> @@ -94,14 +100,14 @@ </el-form-item> </el-col> <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20"> - <el-form-item label="应急队伍" prop="emergencyTeam" @click="daiInpt" > + <el-form-item label="应急队伍" prop="emergencyTeam"> <el-input v-model="ruleForm.emergencyTeam" placeholder="请选择" class="input-with-select" > <template #append> - <el-button :icon="Search"/> + <el-button :icon="Search" @click="daiInpt" /> </template> </el-input> </el-form-item> @@ -155,7 +161,8 @@ <script lang="ts"> import { ref, - defineComponent + defineComponent, + onMounted, } from 'vue'; import type { @@ -171,6 +178,7 @@ import CheckTemplate from '/@/components/checkTemplate/index.vue' import RegionsDialog from '/@/components/regionsDialog/index.vue' import {emergencyPlanApi} from "/@/api/emergencyPlan"; +import {goalManagementApi} from "/@/api/goalManagement"; export default defineComponent({ name: 'openAdd', @@ -227,125 +235,101 @@ const releaseDate = ref('') // 上传附件 const fileList = ref<UploadUserFile[]>([]) - // 可选择树 + //部门树 + const department = () => { + goalManagementApi() + .getTreedepartment() + .then((res) => { + if (res.data.code == 200) { + data.value = res.data.data; + } else { + ElMessage.error(res.data.msg); + } + }); + }; const treeSelect = ref() - const tree = [ - { - value: '1', - label: 'Level one 1', - children: [ - { - value: '1-1', - label: 'Level two 1-1', - children: [ - { - value: '1-1-1', - label: 'Level three 1-1-1', - }, - ], - }, - ], - }, - { - value: '2', - label: 'Level one 2', - children: [ - { - value: '2-1', - label: 'Level two 2-1', - children: [ - { - value: '2-1-1', - label: 'Level three 2-1-1', - }, - ], - }, - { - value: '2-2', - label: 'Level two 2-2', - children: [ - { - value: '2-2-1', - label: 'Level three 2-2-1', - }, - ], - }, - ], - }, - { - value: '3', - label: 'Level one 3', - children: [ - { - value: '3-1', - label: 'Level two 3-1', - children: [ - { - value: '3-1-1', - label: 'Level three 3-1-1', - }, - ], - }, - { - value: '3-2', - label: 'Level two 3-2', - children: [ - { - value: '3-2-1', - label: 'Level three 3-2-1', - }, - ], - }, - ], - }, - ] + // const trees = ref(); + const propse = { + label: 'depName', + children: 'children', + value: 'depId', + }; + onMounted(() => { + department(); + }); + // const tree = [ + // { + // value: '1', + // label: 'Level one 1', + // children: [ + // { + // value: '11', + // label: 'Level two 1-1', + // children: [ + // { + // value: '111', + // label: 'Level three 1-1-1', + // }, + // ], + // }, + // ], + // }, + // { + // value: '2', + // label: 'Level one 2', + // children: [ + // { + // value: '21', + // label: 'Level two 2-1', + // children: [ + // { + // value: '211', + // label: 'Level three 2-1-1', + // }, + // ], + // }, + // { + // value: '22', + // label: 'Level two 2-2', + // children: [ + // { + // value: '221', + // label: 'Level three 2-2-1', + // }, + // ], + // }, + // ], + // }, + // { + // value: '3', + // label: 'Level one 3', + // children: [ + // { + // value: '31', + // label: 'Level two 3-1', + // children: [ + // { + // value: '311', + // label: 'Level three 3-1-1', + // }, + // ], + // }, + // { + // value: '32', + // label: 'Level two 3-2', + // children: [ + // { + // value: '321', + // label: 'Level three 3-2-1', + // }, + // ], + // }, + // ], + // }, + // ] //定义树形下拉框 const responsibleDepartment = ref() - const data = [ - { - value: '1', - label: '广汇能源综合物流发展有限责任公司', - children: [ - { - value: '1-1', - label: '经营班子', - children: [], - }, - ], - }, - { - value: '2', - label: '生产运行部', - children: [ - { - value: '2-1', - label: '灌装一班', - children: [] - }, - { - value: '2-2', - label: '工艺四班', - children: [], - }, - ], - }, - { - value: '3', - label: '设备部', - children: [ - { - value: '3-1', - label: '仪表班', - children: [], - }, - { - value: '3-2', - label: '机修班', - children: [], - }, - ], - }, - ] + const data = ref(); const submitForm = async (title: string, formEl: FormInstance | undefined) => { if (title == '新建应急预案管理') { @@ -419,7 +403,9 @@ Search, releaseDate, treeSelect, - tree, + // trees, + propse, + department, daiInpt, Shows, submitForm, -- Gitblit v1.9.2