| | |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="overSpread" v-show="isopen"></div> |
| | | <!-- 添加/编辑 --> |
| | | <AddUserLevel :isopen="isopen" @shutdown="shutdown" :editRow="editRow" /> |
| | | <AddUserLevel v-if="editConfig.visible" :edit-common-config="editConfig" /> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import pageMixin from "@/components/makepager/pager/mixin/pageMixin" |
| | | import AddUserLevel from "@/views/unifiedManage/userLevel/components/AddUserLevel" |
| | | import { getListRole, getUserList, roleChange, deleteRole } from "@/api/unifiedManage/userLevel" |
| | | import { getListRole, getUserList, roleChange, deleteRole, getTotal } from "@/api/unifiedManage/userLevel" |
| | | export default { |
| | | name: "UserLevel", |
| | | props: {}, |
| | | props: { |
| | | isDetail: { |
| | | type: Boolean, |
| | | default: false |
| | | }, |
| | | addConfig: { |
| | | type: Object, |
| | | default: () => { |
| | | return {} |
| | | } |
| | | } |
| | | }, |
| | | mixins: [pageMixin], |
| | | components: { AddUserLevel }, |
| | | computed: {}, |
| | |
| | | ], |
| | | showBottomCol: ["用户名", "姓名", "手机号", "岗位职务", "状态"], |
| | | isopen: false, |
| | | editRow: {}, |
| | | editConfig: { |
| | | visible: false, |
| | | title: "新建", |
| | |
| | | this.getData() |
| | | }, |
| | | methods: { |
| | | // 数量统计 |
| | | overview() { |
| | | getTotal({ |
| | | useType: 1 |
| | | }).then((reply) => { |
| | | console.log(reply) |
| | | if (reply.code == 200) { |
| | | this.totalObject.value = reply.data.total |
| | | this.otherOptions.map((item) => { |
| | | if (item.label === "启用") { |
| | | item.value = reply.data.use |
| | | } else if (item.label === "停用") { |
| | | item.value = reply.data.ban |
| | | } |
| | | }) |
| | | } |
| | | }) |
| | | }, |
| | | // 角色列表 |
| | | async getData(val) { |
| | | this.data.page = this.pagerOptions.currPage |
| | |
| | | this.getUserList(row.id) |
| | | } |
| | | if (val !== "search") { |
| | | // this.overview(); |
| | | this.overview() |
| | | } |
| | | }, |
| | | // 用户列表 |
| | |
| | | }, |
| | | // 新建 |
| | | addBtnClick() { |
| | | // this.editConfig.title = "新建" |
| | | // this.editConfig.visible = true |
| | | // this.editConfig.infomation = {} |
| | | this.isopen = true |
| | | this.editRow = {} |
| | | this.editConfig.title = "新建" |
| | | this.editConfig.visible = true |
| | | this.editConfig.infomation = {} |
| | | }, |
| | | // 搜索 |
| | | searchClick(val) { |
| | | this.data.keyword = val |
| | | this.pagerOptions.currPage = 1 |
| | | // this.getData(); |
| | | this.getData("search") |
| | | }, |
| | | // 停用 |
| | | changeStatusClick(row) { |
| | |
| | | // 编辑 |
| | | handleClick(val) { |
| | | console.log(val) |
| | | // this.editConfig.title = "编辑" |
| | | // this.editConfig.infomation = { ...val } |
| | | // this.editConfig.visible = true |
| | | this.editRow = val |
| | | this.isopen = true |
| | | this.editConfig.title = "编辑" |
| | | this.editConfig.infomation = { ...val } |
| | | this.editConfig.visible = true |
| | | }, |
| | | // 删除等级 |
| | | delClick(row) { |
| | |
| | | }) |
| | | .catch(() => {}) |
| | | }, |
| | | shutdown() { |
| | | this.isopen = false |
| | | setTimeout(() => { |
| | | this.getData() |
| | | }, 200) |
| | | }, |
| | | // 行点击 |
| | | tableRowClick(row) { |
| | | console.log(row) |
| | | this.selectRow = row |
| | | // this.getUserList(row.id); |
| | | this.getUserList(row.id) |
| | | }, |
| | | // 等级状态 |
| | | getRoleStatus(val) { |