“dzb”
2022-10-09 2bb0e066fdc522beb51dd13f6a72cd67bd5d6a58
src/views/systemSetting/baseSetting/user/components/main/index.vue
@@ -18,6 +18,9 @@
                <el-table-column prop="mobile" label="联系方式" min-width="7">
                </el-table-column>
                <el-table-column prop="note" label="所属角色" min-width="8">
                    <template slot-scope="scope">
                        <span>{{filterRole(scope.row.roles)}}</span>
                    </template>
                </el-table-column>
                <el-table-column prop="departName" label="所属部门" min-width="8">
                </el-table-column>
@@ -230,11 +233,8 @@
        },
        selectAll() {
            this.$refs.multipleTable.toggleAllSelection();
        },
        disSame(list) {
            // console.log(this.$refs.multipleTable);
            // const row = this.$refs.table.data
            list.forEach(row => {
                this.$refs.multipleTable.toggleRowSelection(row)
            })
@@ -260,12 +260,17 @@
            this.getUserList();
        },
        handleClose(done) {
            if (this.updateFlag) {
            this.$confirm('确认关闭?')
                .then(_ => {
                    this.dialogUpdate = false
                        this.dialogUpdate = false;
                        this.updateFlag = false;
                    done();
                })
                .catch(_ => { });
            }else{
                done();
            }
        },
        // 当前页改变触发事件
        changeCurrentPage(page) {
@@ -311,10 +316,9 @@
            this.$axios.get(`sccg/admin/list?keyword=${search}&current=${currentPage}&pageSize=${pageSize}`).then(res => {
                if (res.code === 200) {
                    res.data.records.forEach(item => {
                        // item.createTime = helper(item.createTime);
                        item.status == 1 ? item.status = true : item.status = false;
                    })
                    that.totalNum = res.data.pages * pageSize;
                    that.totalNum = res.data.total;
                    that.tableData = res.data.records;
                    this.renderFlag = true;
                }
@@ -339,6 +343,23 @@
            }
            return '';
        },
        // 处理用户所属角色
        filterRole(arr){
            let str = '';
            if(arr.length === 0){
                return;
            }
            arr.forEach((item,index)=>{
                if(item!==null){
                    if(index<arr.length-1){
                        str+=item.name +',';
                    }else{
                        str+=item.name;
                    }
                }
            })
            return str;
        }
    },
    props: ['refresh', 'keyword', 'resetFresh'],
    watch: {