From 2c95f86963f1dea624fd362111e3892e95b871cf Mon Sep 17 00:00:00 2001 From: 疯狂的狮子Li <15040126243@163.com> Date: 星期五, 22 十二月 2023 13:20:44 +0800 Subject: [PATCH] 🧨发布 vue 版本 5.1.2 与 cloud 版本 2.1.2 --- src/views/system/dept/index.vue | 23 +++++++++++++++++++---- 1 files changed, 19 insertions(+), 4 deletions(-) diff --git a/src/views/system/dept/index.vue b/src/views/system/dept/index.vue index 12f7564..9797125 100644 --- a/src/views/system/dept/index.vue +++ b/src/views/system/dept/index.vue @@ -5,7 +5,7 @@ <el-card shadow="hover"> <el-form ref="queryFormRef" :model="queryParams" :inline="true" label-width="68px"> <el-form-item label="閮ㄩ棬鍚嶇О" prop="deptName"> - <el-input v-model="queryParams.deptName" placeholder="璇疯緭鍏ラ儴闂ㄥ悕绉�" clearable @keyup.enter="handleQuery" /> + <el-input v-model="queryParams.deptName" placeholder="璇疯緭鍏ラ儴闂ㄥ悕绉�" clearable style="width: 240px" @keyup.enter="handleQuery" /> </el-form-item> <el-form-item label="鐘舵��" prop="status"> <el-select v-model="queryParams.status" placeholder="閮ㄩ棬鐘舵��" clearable> @@ -70,7 +70,7 @@ </el-table> </el-card> - <el-dialog :title="dialog.title" v-model="dialog.visible" destroy-on-close append-to-bod width="600px"> + <el-dialog :title="dialog.title" v-model="dialog.visible" destroy-on-close append-to-body width="600px"> <el-form ref="deptFormRef" :model="form" :rules="rules" label-width="80px"> <el-row> <el-col :span="24" v-if="form.parentId !== 0"> @@ -97,7 +97,9 @@ </el-col> <el-col :span="12"> <el-form-item label="璐熻矗浜�" prop="leader"> - <el-input v-model="form.leader" placeholder="璇疯緭鍏ヨ礋璐d汉" maxlength="20" /> + <el-select v-model="form.leader" placeholder="璇烽�夋嫨璐熻矗浜�"> + <el-option v-for="item in deptUserList" :key="item.userId" :label="item.userName" :value="item.userId" /> + </el-select> </el-form-item> </el-col> <el-col :span="12"> @@ -133,6 +135,8 @@ <script setup name="Dept" lang="ts"> import { listDept, getDept, delDept, addDept, updateDept, listDeptExcludeChild } from "@/api/system/dept" import { DeptForm, DeptQuery, DeptVO } from "@/api/system/dept/types"; +import {UserVO} from "@/api/system/user/types"; +import {listUserByDeptId} from "@/api/system/user"; interface DeptOptionsType { deptId: number | string; @@ -149,7 +153,7 @@ const showSearch = ref(true) const deptOptions = ref<DeptOptionsType[]>([]) const isExpandAll = ref(true) - +const deptUserList = ref<UserVO[]>([]); const dialog = reactive<DialogOption>({ visible: false, @@ -199,6 +203,15 @@ } loading.value = false } + +/** 鏌ヨ褰撳墠閮ㄩ棬鐨勬墍鏈夌敤鎴� */ +async function getDeptAllUser(deptId: any) { + if (deptId !== null && deptId !== "" && deptId !== undefined) { + const res = await listUserByDeptId(deptId); + deptUserList.value = res.data; + } +} + /** 鍙栨秷鎸夐挳 */ const cancel = () => { reset() @@ -251,6 +264,8 @@ /** 淇敼鎸夐挳鎿嶄綔 */ const handleUpdate = async (row: DeptVO) => { reset(); + //鏌ヨ褰撳墠閮ㄩ棬鎵�鏈夌敤鎴� + getDeptAllUser(row.deptId); const res = await getDept(row.deptId); form.value = res.data const response = await listDeptExcludeChild(row.deptId); -- Gitblit v1.9.3