| | |
| | | <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> |
| | |
| | | @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> |
| | |
| | | <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> |
| | |
| | | </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"> |
| | |
| | | :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" |
| | |
| | | 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 { |
| | |
| | | context: "", |
| | | dialogCreate: false, |
| | | dialogUpdate: false, |
| | | dialogView:false, |
| | | dialogView: false, |
| | | updateFlag: false, |
| | | userInfo: '', |
| | | totalNum: null, |
| | |
| | | label: '批量删除', |
| | | } |
| | | ], |
| | | tempList: [] |
| | | tempList: [], |
| | | } |
| | | }, |
| | | created() { |
| | | this.getUserList(); |
| | | this.getRoleList(); |
| | | }, |
| | | methods: { |
| | | async selectChange(list) { |
| | |
| | | type: 'success', |
| | | message: '更改用户状态成功', |
| | | }) |
| | | this.getUserList(); |
| | | this.getRoleList(); |
| | | } else { |
| | | this.$message({ |
| | | type: 'error', |
| | |
| | | message: res.message |
| | | }) |
| | | |
| | | this.getUserList(); |
| | | this.getRoleList(); |
| | | }) |
| | | }) |
| | | .catch(_ => { }); |
| | |
| | | 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 => { |
| | |
| | | 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(); |
| | |
| | | justify-content: space-between; |
| | | align-items: center; |
| | | padding: 0 20px; |
| | | |
| | | .funs-sp{ |
| | | border: 1px solid #17324c; |
| | | } |
| | | .funs { |
| | | display: flex; |
| | | |
| | |
| | | line-height: 28px; |
| | | display: flex; |
| | | align-items: center; |
| | | border: 1px solid #17324c; |
| | | border-radius: 4px; |
| | | font-size: 12px; |
| | | margin-left: 10px; |
| | |
| | | .el-table { |
| | | color: #4b9bb7; |
| | | font-size: 10px; |
| | | |
| | | .operation { |
| | | display: flex; |
| | | |
| | |
| | | } |
| | | } |
| | | } |
| | | |
| | | // &::v-deep .switchStyle .el-switch__label { |
| | | // position: absolute; |
| | | // display: none; |