1
lzhe
2024-04-10 3ca71791b839d7c9731643a8653c0b6fe1c6233a
1
已修改4个文件
141 ■■■■■ 文件已修改
src/views/console/system/component-classification.vue 21 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/master/person/main/personDepartment.vue 88 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/master/person/main/personPerson.vue 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/master/person/main/personPost.vue 18 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/console/system/component-classification.vue
@@ -1,7 +1,7 @@
<!--
 * @Date: 2024-04-09 22:18:47
 * @LastEditors: lzhe lzhe@example.com
 * @LastEditTime: 2024-04-10 10:26:42
 * @LastEditTime: 2024-04-10 17:07:52
 * @FilePath: /belleson-frontend/Users/mache/Documents/demo/cps-web/src/views/console/system/component-classification.vue
 * 分类维护
-->
@@ -12,7 +12,7 @@
            <el-button @click="del" plain type="danger" :disabled="selection.length == 0">删除</el-button>
        </el-header>
        <el-main>
            <el-table :data="tableData" style="width: 100%;margin-bottom: 20px;" row-key="id" border default-expand-all lazy :load="tableLoad">
            <el-table :data="tableData" style="width: 100%;margin-bottom: 20px;" row-key="id" border default-expand-all>
                <el-table-column type="selection" width="55" />
                <el-table-column prop="name" label="分类名称" />
                <el-table-column prop="icon" label="分类图标">
@@ -54,8 +54,18 @@
        this.queryList()
    },
    methods: {
        tableLoad(row,treeNode,resolve) {
                resolve(row.children);
        removeHasChildren(arr) {
            return arr.map(item => {
                // 创建一个不包含hasChildren的新对象
                const newItem = { ...item };
                delete newItem.hasChildren; // 删除hasChildren字段
                // 如果children字段存在且是数组,则递归处理children
                if (Array.isArray(newItem.children)) {
                newItem.children = this.removeHasChildren(newItem.children);
                }
                return newItem;
            });
        },
        add () {
            alert(2)
@@ -65,8 +75,7 @@
        },
        queryList () {
            this.$API.setting.getList.get().then(res => {
                this.tableData = res.data;
                console.log(this.tableData,222)
                this.tableData = this.removeHasChildren(res.data);
            })
            // this.$HTTP.get("/api/blade-system/menu/lazy-list",this.searchData).then(res=> {
            //         if(res.code == 200) {
src/views/master/person/main/personDepartment.vue
@@ -2,7 +2,7 @@
 * @Author: lzhe lzhe@example.com
 * @Date: 2024-03-26 10:28:33
 * @LastEditors: lzhe lzhe@example.com
 * @LastEditTime: 2024-04-09 21:00:31
 * @LastEditTime: 2024-04-10 17:05:04
 * @FilePath: /smart-web/src/views/master/person/main/index.vue
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
@@ -26,33 +26,15 @@
                </div>
            </div>
            <div class="right-table">
                <el-table
                    ref="multipleTableRef"
                    :data="departmentList"
                    border
                    style="width: 100%"
                    class="multipleTableRef"
                    @selection-change="handleSelectionChange"
                >
                <!-- lazy :load="tableLoad" -->
                <el-table :data="departmentList" style="width: 100%;margin-bottom: 20px;"  row-key="id" border default-expand-all ref="treeRef" @selection-change="handleSelectionChange">
                    <el-table-column type="selection" width="55" />
                    <el-table-column
                    prop="date"
                    label="岗位名称">
                    </el-table-column>
                    <el-table-column
                    prop="name"
                    label="部门人数">
                    </el-table-column>
                    <el-table-column
                    prop="name"
                    label="上级部门">
                    </el-table-column>
                    <el-table-column
                    fixed="right"
                    label="操作">
                    <el-table-column prop="name" label="岗位名称"></el-table-column>
                    <el-table-column prop="peopleNum" label="部门人数"></el-table-column>
                    <el-table-column prop="parentName" label="上级部门"></el-table-column>
                    <el-table-column fixed="right" label="操作">
                    <template #default="scope">
                        <el-button type="text" size="small" @click="table_edit(scope.row, scope.$index)">编辑</el-button>
                        <el-button text type="primary" size="small" @click="table_show(scope.row, scope.$index)">查看</el-button>
                    </template>
                    </el-table-column>
                </el-table>
@@ -77,6 +59,7 @@
        name: "bakalaka",
        data(){
            return {
                selection: [],
                total: 0,
                searchData: {
                    groupType: 'group_organization',
@@ -86,26 +69,9 @@
                },
                statusList: [],
                isSaveing: false,
                groups: [],
                departmentFrom: {
                    department: ""
                },
                departmentVisibleRules: {
                    department:[
                        {required: true, message: '请选择部门'}
                    ]
                },
                departmentVisible: false,
                dialog: {
                    save: false
                },
                leftActive: true,
                input: '',
                options: [{
                    value: '选项1',
                    label: '黄金糕'
                }],
                input3: '',
                departmentList: []
            }
        },
@@ -114,15 +80,29 @@
        },
        mounted(){
            this.getStatus();
            this.getOrganizationList();
        },
        components: {
            saveDialog
        },
        methods: {
            removeHasChildren(arr) {
                return arr.map(item => {
                    // 创建一个不包含hasChildren的新对象
                    const newItem = { ...item };
                    delete newItem.hasChildren; // 删除hasChildren字段
                    // 如果children字段存在且是数组,则递归处理children
                    if (Array.isArray(newItem.children)) {
                    newItem.children = this.removeHasChildren(newItem.children);
                    }
                    return newItem;
                });
            },
            getOrganizationList() {
                this.$HTTP.get(`/api/blade-cps/organization/tree?` + this.$TOOL.qsStringify(this.searchData)).then(res=> {
                    if(res.code == 200) {
                        this.departmentList = res.data;
                        this.departmentList = this.removeHasChildren(res.data);
                    }
                })
            },
@@ -132,9 +112,6 @@
                        this.statusList = res.data;
                    }
                })
            },
            departmentSubmit() {
                this.departmentVisible=false;  //部门调整
            },
            //添加
            addPerson(){
@@ -149,25 +126,10 @@
                    this.$refs.saveDialog.open('edit').setData(row)
                })
            },
            //查看
            table_show(row){
                this.dialog.save = true
                this.$nextTick(() => {
                    this.$refs.saveDialog.open('show').setData(row)
                })
            handleSelectionChange (selection) {
                this.selection = selection;
            },
            handleSelectionChange() {},
            delPerson() {},
            changeDepartment() {
                this.departmentVisible = true;
            },
            changeTab(name) {
                if(name == 1) {
                    this.leftActive = true;
                }else {
                    this.leftActive = false;
                }
            },
            handleSizeChange(val) {
                console.log(`每页 ${val} 条`);
            },
src/views/master/person/main/personPerson.vue
@@ -2,7 +2,7 @@
 * @Author: lzhe lzhe@example.com
 * @Date: 2024-03-26 10:28:33
 * @LastEditors: lzhe lzhe@example.com
 * @LastEditTime: 2024-04-09 20:48:16
 * @LastEditTime: 2024-04-10 15:37:41
 * @FilePath: /smart-web/src/views/master/person/main/index.vue
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
@@ -17,7 +17,10 @@
                <el-input v-model="input" placeholder="请输入内容" size="small"></el-input>
            </div>
            <div class="person-tree">
                <div v-for="(item,index) in titleList" :data-id="item.id" v-if="leftActive" :class="{treeActive: item.active}" @click="selectbtn(index)">{{item.name}}({{item.peopleNum}})</div>
                <!-- 部门 -->
                <!-- <div v-for="(item,index) in titleList" :data-id="item.id" v-if="leftActive" :class="{treeActive: item.active}" @click="selectbtn(index)">{{item.name}}({{item.peopleNum}})</div> -->
                <el-tree style="max-width: 600px" :data="titleList" :expand-on-click-node="false" default-expand-all :props="{label: 'name', children: 'children'}" class="treeActive" @node-click="titleListNode" />
                <!-- 岗位 -->
                <div v-for="(item,index) in titleList" :data-id="item.id" v-if="!leftActive" :class="{treeActive: item.active}" @click="selectbtn(index)">{{item.postName}}</div>
            </div>
        </div>
@@ -176,6 +179,10 @@
            saveDialog
        },
        methods: {
            titleListNode(data) {
                this.searchData.organizationCode = data.code;
                this.searchPerson();
            },
            selectbtn(index) {
                this.titleList.forEach(item=> {
                    item.active = false;
@@ -380,9 +387,6 @@
    .person-tree {
        font-size: 14px;
        font-weight: 400;
    }
    .treeActive {
        background-color: #d8e8e8;
    }
    .person-tree div {
        margin-bottom: 8px;
src/views/master/person/main/personPost.vue
@@ -2,7 +2,7 @@
 * @Author: lzhe lzhe@example.com
 * @Date: 2024-03-26 10:28:33
 * @LastEditors: lzhe lzhe@example.com
 * @LastEditTime: 2024-04-09 20:46:11
 * @LastEditTime: 2024-04-10 15:44:08
 * @FilePath: /smart-web/src/views/master/person/main/index.vue
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
@@ -80,16 +80,6 @@
                    keywords: ""
                },
                isSaveing: false,
                groups: [],
                departmentFrom: {
                    department: ""
                },
                departmentVisibleRules: {
                    department:[
                        {required: true, message: '请选择部门'}
                    ]
                },
                departmentVisible: false,
                dialog: {
                    save: false
                },
@@ -137,9 +127,6 @@
                    }
                })
            },
            departmentSubmit() {
                this.departmentVisible=false;  //部门调整
            },
            //添加
            addPerson(){
                this.dialog.save = true
@@ -177,9 +164,6 @@
                })
                this.selectId = selStr.replace(/,$/, '');
                this.delPersonModel = true;
            },
            changeDepartment() {
                this.departmentVisible = true;
            },
            handleSizeChange(val) {
                console.log(`每页 ${val} 条`);