“dzb”
2022-10-09 2bb0e066fdc522beb51dd13f6a72cd67bd5d6a58
src/views/systemSetting/baseSetting/role/index.vue
@@ -12,7 +12,7 @@
                <div class="addUser">
                    <el-button class="addBtn" type="primary" @click="dialogCreate = true">新建角色</el-button>
                    <el-dialog :visible.sync="dialogCreate" title="新增角色" width="45%" v-if="dialogCreate"
                        :before-close="handleClose">
                        :before-close="handleClose2">
                        <createUser :refresh="context==='' ? getUserList : search" />
                    </el-dialog>
                </div>
@@ -62,16 +62,21 @@
                        </template>
                    </el-table-column>
                </el-table>
                <!-- 查看修改页面 -->
                <!-- 修改页面 -->
                <el-dialog :visible.sync="dialogUpdate" width="45%" :title="updateFlag ? '权限设置' :'查看角色信息'"
                    v-if="dialogUpdate" :before-close="handleClose">
                    <updateUser :updateFlag="updateFlag" :userInfo=userInfo
                        :getUserList=" context ? getUserList : getUserList" @changeDialog="changeDialog" />
                </el-dialog>
                <!-- 查看页面 -->
                <el-dialog :visible.sync="dialogView" width="45%" title="查看角色信息"
                    v-if="dialogView" :before-close="handleClose">
                    <MyView :userInfo=userInfo @changeDialog="changeDialog" />
                </el-dialog>
                <!-- tools -->
                <div class="tools">
                    <div class="funs">
                        <div class="funsItem">
                        <!-- <div class="funsItem">
                            <el-checkbox v-model="all" @change="selectAll()">全选</el-checkbox>
                        </div>
                        <div class="funsItem">
@@ -83,7 +88,7 @@
                                    :value="item.value" :disabled="item.disabled">
                                </el-option>
                            </el-select>
                        </div>
                        </div> -->
                    </div>
                    <div class="pagination">
                        <el-pagination background :current-page="currentPage" layout="prev, pager, next"
@@ -100,9 +105,10 @@
import createUser from "./createUser"
import updateUser from "./updateUser"
import helper from "@/utils/mydate.js"
import MyView from './viewRole'
export default {
    components: {
        createUser, updateUser
        createUser, updateUser,MyView
    },
    data() {
        return {
@@ -110,6 +116,7 @@
            context: "",
            dialogCreate: false,
            dialogUpdate: false,
            dialogView:false,
            updateFlag: false,
            userInfo: '',
            totalNum: null,
@@ -312,8 +319,7 @@
        },
        // 查看用户信息(不可修改)
        handleFind(rowData) {
            this.dialogUpdate = true;
            this.updateFlag = false;
            this.dialogView = true;
            this.userInfo = rowData;
        },
        // 修改用户部门信息
@@ -337,17 +343,30 @@
            this.currentPage = page;
            this.search();
        },
        changeDialog(val) {
            this.dialogUpdate = val.dialogUpdate;
        changeDialog({flag}) {
            this.dialogUpdate = flag;
            this.dialogCreate = flag;
            this.dialogView = flag;
        },
        handleClose(done) {
            this.$confirm('确认关闭?')
            if(this.updateFlag){
                this.$confirm('确认关闭?')
                .then(_ => {
                    this.dialogUpdate = false;
                    this.dialogCreate = false;
                    done();
                })
                .catch(_ => { });
            }else{
                done();
            }
        },
        handleClose2(done){
            this.$confirm('确认关闭?')
                .then(_ => {
                    done();
                })
                .catch(_ => { });
        }
    }
}