wujingjing
2024-11-18 29dc01bf43ec0efdc1633583c33d4e92e4de0a2d
部门树结构数据
已修改1个文件
32 ■■■■■ 文件已修改
src/views/project/yw/systemManage/userMgr/optDlg/OptDlg.vue 32 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/project/yw/systemManage/userMgr/optDlg/OptDlg.vue
@@ -38,9 +38,23 @@
                </el-col>
                <el-col :span="12" class="mb20">
                    <el-form-item label="部门" prop="part_id" label-width="54">
                        <el-select v-model="dialogFormValue.part_id">
                            <el-option v-for="item in departmentList" :key="item.id" :value="item.id" :label="item?.name"></el-option>
                        </el-select>
                        <el-tree-select
                            filterable
                            class="w100"
                            v-model="dialogFormValue.part_id"
                            :props="{
                                id: 'id',
                                label: 'name',
                                children: 'children',
                            }"
                            :data="departmentTreeList"
                            node-key="id"
                            :clearable="true"
                            :accordion="false"
                            :expandNode="false"
                            :check-strictly="true"
                        >
                        </el-tree-select>
                    </el-form-item>
                </el-col>
                <el-col :span="12" class="mb20"
@@ -88,9 +102,21 @@
import { userSexMap } from '../types';
import * as userApi from '/@/api/auth/user';
import { formatDate } from '/@/utils/formatTime';
import { convertListToTree } from '/@/utils/util';
const props = defineProps(['item', 'roleList', 'departmentList']);
const emit = defineEmits(['update', 'insert']);
const departmentTreeList = computed(() => {
    const treeData = convertListToTree(props.departmentList, {
        ID: 'id',
        ParentID: 'parent_id',
        Children: 'children',
    });
    return treeData;
});
//#region ====================== 增加、修改记录操作, dialog init======================
const isEditDialog = ref(false);
const dialogTitle = computed(() => {