linwe
2024-08-09 5e2aafeede13d337380f736567caf74f49713be7
src/views/system/dept.vue
@@ -6,15 +6,21 @@
            @selection-change="selectionChange" @current-change="currentChange" @size-change="sizeChange"
            @refresh-change="refreshChange" @on-load="onLoad" @tree-load="treeLoad">
            <template slot="menuLeft">
                <el-button type="danger" size="small" icon="el-icon-delete" v-if="permission.dept_delete" plain
                <el-button type="danger" size="small" icon="el-icon-delete" v-if="permission.dept_delete_all" plain
                    @click="handleDelete">删 除
                </el-button>
            </template>
            <template slot-scope="scope" slot="menu">
                <el-button type="text" icon="el-icon-circle-plus-outline" size="small"
                    @click.stop="handleAdd(scope.row, scope.index)" v-if="permission.add_children">新增子项
            <template slot-scope="{row, size, index}" slot="menu">
                <el-button type="text" icon="el-icon-delete" :size="size" @click.stop="$refs.crud.rowDel(row, index)"
                    v-if="permission.dept_delete && showCurRowDelete(row)">删除
                </el-button>
                <el-button type="text" icon="el-icon-circle-plus-outline" :size="size" @click.stop="handleAdd(row, index)"
                    v-if="permission.add_children">新增子项
                </el-button>
            </template>
            <template slot-scope="{row}" slot="deptCategory">
                <el-tag>{{ row.deptCategoryName }}</el-tag>
            </template>
@@ -65,6 +71,7 @@
                        label: "机构名称",
                        prop: "deptName",
                        search: true,
                        searchLabelWidth: 76,
                        rules: [{
                            required: true,
                            message: "请输入机构名称",
@@ -96,6 +103,7 @@
                        label: "机构全称",
                        prop: "fullName",
                        search: true,
                        searchLabelWidth: 100,
                        rules: [{
                            required: true,
                            message: "请输入机构全称",
@@ -138,14 +146,34 @@
                        }]
                    },
                    {
                        label: "机构性质",
                        type: "select",
                        dicUrl: "/api/blade-system/dict/dictionary?code=org_nature",
                        props: {
                            label: "dictValue",
                            value: "dictKey"
                        },
                        hide:true,
                        dataType: "number",
                        prop: "deptNature",
                        cascader: ["regionCode"],
                        slot: true,
                        rules: [{
                            required: true,
                            message: "请输入机构性质",
                            trigger: "blur"
                        }]
                    },
                    {
                        label: "管辖区域",
                        prop: "regionCode",
                        type: "tree",
                        dicUrl: "/api/blade-system/region/tree?cityCode=361100",
                        dicUrl: "/api/blade-system/region/tree?deptNature={{deptNature}}",
                        props: {
                            label: "name",
                            value: "id",
                        },
                        hide:true,
                        defaultExpandedKeys: ["361102003"],
                        rules: [{
                            required: false,
@@ -187,7 +215,7 @@
            return {
                addBtn: this.vaildData(this.permission.dept_add, false),
                viewBtn: this.vaildData(this.permission.dept_view, false),
                delBtn: this.vaildData(this.permission.dept_delete, false),
                delBtn: this.vaildData(false, true),
                editBtn: this.vaildData(this.permission.dept_edit, false)
            }
        },
@@ -197,6 +225,12 @@
                ids.push(ele.id)
            })
            return ids.join(",")
        },
        showCurRowDelete () {
            return (row) => {
                return !(row.id == this.userInfo.dept_id)
            }
        }
    },
    methods: {