From b9b2d3d63335fa9c72078e64f1ac1b365cf2d8dd Mon Sep 17 00:00:00 2001 From: “dzb” <2632970487@qq.com> Date: 星期五, 21 十月 2022 00:10:27 +0800 Subject: [PATCH] 修改用户管理 --- src/views/systemSetting/baseSetting/role/index.vue | 72 ++++++++++++++++------------------- 1 files changed, 33 insertions(+), 39 deletions(-) diff --git a/src/views/systemSetting/baseSetting/role/index.vue b/src/views/systemSetting/baseSetting/role/index.vue index 04857a4..cad254b 100644 --- a/src/views/systemSetting/baseSetting/role/index.vue +++ b/src/views/systemSetting/baseSetting/role/index.vue @@ -13,7 +13,7 @@ <el-button class="addBtn" type="primary" @click="dialogCreate = true">鏂板缓瑙掕壊</el-button> <el-dialog :visible.sync="dialogCreate" title="鏂板瑙掕壊" width="45%" v-if="dialogCreate" :before-close="handleClose2"> - <createUser :refresh="context==='' ? getUserList : search" /> + <createUser :refresh="context==='' ? getRoleList : search" /> </el-dialog> </div> </div> @@ -27,20 +27,14 @@ @selection-change="tableChange"> <el-table-column type="selection" min-width="5"> </el-table-column> - <!-- <el-table-column label="鐢ㄦ埛ID" min-width="5"> - <template slot-scope="scope">{{ scope.row.id }}</template> - </el-table-column> --> <el-table-column prop="name" label="瑙掕壊鍚嶇О" min-width="10"> </el-table-column> <el-table-column prop="typeText" label="瑙掕壊绫诲瀷" min-width="10"> </el-table-column> - <!-- <el-table-column prop="adminCount" label="榛樿瑙掕壊" min-width="10"> - </el-table-column> --> <el-table-column prop="description" label="澶囨敞" min-width="10"> </el-table-column> <el-table-column prop="status" label="鍚敤" min-width="5"> <template slot-scope="scope"> - <!-- active-text="寮�" inactive-text="鍏�" --> <el-switch class="switchStyle" v-model="scope.row.status" active-color="#3fef9a" inactive-color="#000212" disabled> </el-switch> @@ -49,11 +43,8 @@ <el-table-column prop="operation" label="鎿嶄綔" min-width="15"> <template slot-scope="scope"> <div class="operation"> - <!-- <span @click="handleChangeRole(scope.row)">淇敼瑙掕壊</span> --> <span @click="handleFind(scope.row)">鏌ョ湅</span> <span class="line">|</span> - <!-- <span>淇敼瀵嗙爜</span> --> - <!-- <span>鍒犻櫎</span> --> <span @click="handleUpdate(scope.row)">鏉冮檺璁剧疆</span> <span class="line">|</span> <span @click="handleChangeStatus(scope.row)">{{scope.row.status === true ?'鍋滅敤':'鍚敤' }}</span> @@ -62,25 +53,25 @@ </div> </template> </el-table-column> - </el-table> + </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" /> + :getRoleList=" context ? getRoleList : getRoleList" @changeDialog="changeDialog" /> </el-dialog> <!-- 鏌ョ湅椤甸潰 --> - <el-dialog :visible.sync="dialogView" width="45%" title="鏌ョ湅瑙掕壊淇℃伅" - v-if="dialogView" :before-close="handleClose"> + <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 funs-sp"> <el-checkbox v-model="all" @change="selectAll()">鍏ㄩ��</el-checkbox> </div> - <div class="funsItem"> + <div class="funsItem funs-sp"> <el-checkbox v-model="unsame" @change="disSame(tableData)">鍙嶉��</el-checkbox> </div> <div class="funsItem"> @@ -89,7 +80,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" @@ -107,9 +98,10 @@ import updateUser from "./updateUser" import helper from "@/utils/mydate.js" import MyView from './viewRole' +import MyTable from '@/components/Table' export default { components: { - createUser, updateUser,MyView + createUser, updateUser, MyView, MyTable }, data() { return { @@ -117,7 +109,7 @@ context: "", dialogCreate: false, dialogUpdate: false, - dialogView:false, + dialogView: false, updateFlag: false, userInfo: '', totalNum: null, @@ -146,11 +138,11 @@ label: '鎵归噺鍒犻櫎', } ], - tempList: [] + tempList: [], } }, created() { - this.getUserList(); + this.getRoleList(); }, methods: { async selectChange(list) { @@ -186,7 +178,7 @@ type: 'success', message: '鏇存敼鐢ㄦ埛鐘舵�佹垚鍔�', }) - this.getUserList(); + this.getRoleList(); } else { this.$message({ type: 'error', @@ -239,7 +231,7 @@ message: res.message }) - this.getUserList(); + this.getRoleList(); }) }) .catch(_ => { }); @@ -255,14 +247,13 @@ let { id, status } = obj; status == true ? status = 0 : status = 1; this.$axios.post(`/sccg/role/updateStatus/` + id + '?status=' + status).then(res => { - if(res.code ===200){ + if (res.code === 200) { this.search(); } }) }, // 鑾峰彇鐢ㄦ埛鍒楄〃 - getUserList() { - const that = this; + getRoleList() { this.dialogCreate = false; // 鑾峰彇鎵�鏈夌敤鎴蜂俊鎭� this.$axios.get('sccg/role/listAll').then(res => { @@ -337,26 +328,26 @@ this.currentPage = page; this.search(); }, - changeDialog({flag}) { + changeDialog({ flag }) { this.dialogUpdate = flag; this.dialogCreate = flag; this.dialogView = flag; }, handleClose(done) { - if(this.updateFlag){ + if (this.updateFlag) { this.$confirm('纭鍏抽棴锛�') - .then(_ => { - this.dialogUpdate = false; - this.dialogCreate = false; - this.updateFlag = false; - done(); - }) - .catch(_ => { }); - }else{ + .then(_ => { + this.dialogUpdate = false; + this.dialogCreate = false; + this.updateFlag = false; + done(); + }) + .catch(_ => { }); + } else { done(); } }, - handleClose2(done){ + handleClose2(done) { this.$confirm('纭鍏抽棴锛�') .then(_ => { done(); @@ -440,7 +431,9 @@ justify-content: space-between; align-items: center; padding: 0 20px; - + .funs-sp{ + border: 1px solid #17324c; + } .funs { display: flex; @@ -448,7 +441,6 @@ line-height: 28px; display: flex; align-items: center; - border: 1px solid #17324c; border-radius: 4px; font-size: 12px; margin-left: 10px; @@ -504,6 +496,7 @@ .el-table { color: #4b9bb7; font-size: 10px; + .operation { display: flex; @@ -516,6 +509,7 @@ } } } + // &::v-deep .switchStyle .el-switch__label { // position: absolute; // display: none; -- Gitblit v1.8.0