From ada345f696a37d55597ee04ba3aea49c61632bdb Mon Sep 17 00:00:00 2001 From: xuyiming Date: Fri, 5 Jun 2020 17:39:57 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9D=83=E9=99=90=E7=AE=A1=E7=90=86=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3=E8=B0=83=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/apass-list.vue | 5 +- src/components/comments-pagination.vue | 2 +- .../organization-list/organization-card.vue | 10 +- .../organization-list/organization-list.vue | 1 + src/pages/authority/organization.vue | 165 +++++------------- src/pages/authority/permission.vue | 94 +++++----- src/pages/authority/roles.vue | 84 +++++---- src/pages/authority/userRoles.vue | 158 +++++++++++++++++ src/pages/authority/users.vue | 148 +++------------- src/pages/workbench/app_build.vue | 1 + src/router/index.js | 5 + 11 files changed, 339 insertions(+), 334 deletions(-) create mode 100644 src/pages/authority/userRoles.vue diff --git a/src/components/apass-list.vue b/src/components/apass-list.vue index 3ba5ed6..25b0a49 100644 --- a/src/components/apass-list.vue +++ b/src/components/apass-list.vue @@ -62,6 +62,7 @@ :current-page="currentPage" @size-change="changePageSize" @current-change="changeCurrentPage" + style="margin-top: 20px;" > @@ -111,10 +112,10 @@ export default { showListFilter: false, filter: {}, searchValue: "", - pageSize: 10, + pageSize: 15, currentPage: 1, timer: null, - pageSizes: [10, 50, 100], + pageSizes: [15, 50, 100], }), methods: { searchAction(value) { diff --git a/src/components/comments-pagination.vue b/src/components/comments-pagination.vue index 613f6be..39ac268 100644 --- a/src/components/comments-pagination.vue +++ b/src/components/comments-pagination.vue @@ -49,7 +49,7 @@ export default { data: () => ({}), computed: { totalPages() { - return Math.ceil(this.total / this.pageSize); + return Math.ceil(this.total / this.pageSize) || 1; }, preDisabled() { return this.currentPage === 1; diff --git a/src/components/organization-list/organization-card.vue b/src/components/organization-list/organization-card.vue index 9668cc3..ef8b1ca 100644 --- a/src/components/organization-list/organization-card.vue +++ b/src/components/organization-list/organization-card.vue @@ -4,12 +4,12 @@
- +

@@ -18,21 +18,21 @@ 业务系统数 - +

组织管理员 - +

创建时间 - +

diff --git a/src/components/organization-list/organization-list.vue b/src/components/organization-list/organization-list.vue index e98d86f..2919968 100644 --- a/src/components/organization-list/organization-list.vue +++ b/src/components/organization-list/organization-list.vue @@ -58,5 +58,6 @@ export default { flex-wrap: wrap; justify-content: flex-start; align-items: flex-start; + align-content: flex-start; } diff --git a/src/pages/authority/organization.vue b/src/pages/authority/organization.vue index 8c27b8c..671ad39 100644 --- a/src/pages/authority/organization.vue +++ b/src/pages/authority/organization.vue @@ -1,7 +1,7 @@ @@ -46,128 +46,57 @@ import apassDialog from "@/components/apass-dialog"; export default { components: { apassList, organizationList, apassDialog }, data: () => ({ - listTotal: 300, - listData: [ - { - id: 1000001, - img: - "https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg", - name: "贵阳市公安局", - system_count: 6, - organization_manager: 3, - time: "2019-04-11 12:50:30", - }, - { - id: 1000002, - img: - "https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg", - name: "语音识别", - system_count: 6, - organization_manager: 3, - time: "2019-04-11 12:50:30", - }, - { - id: 1000003, - img: - "https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg", - name: "轨迹绘制", - system_count: 6, - organization_manager: 3, - time: "2019-04-11 12:50:30", - }, - { - id: 1000004, - img: - "https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg", - name: "轨迹绘制", - system_count: 6, - organization_manager: 3, - time: "2019-04-11 12:50:30", - }, - { - id: 1000005, - img: - "https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg", - name: "轨迹绘制", - system_count: 6, - organization_manager: 3, - time: "2019-04-11 12:50:30", - }, - { - id: 1000006, - img: - "https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg", - name: "轨迹绘制", - system_count: 6, - organization_manager: 3, - time: "2019-04-11 12:50:30", - }, - { - id: 1000007, - img: - "https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg", - name: "轨迹绘制", - system_count: 6, - organization_manager: 3, - time: "2019-04-11 12:50:30", - }, - { - id: 100000, - img: - "https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg", - name: "轨迹绘制", - system_count: 6, - organization_manager: 3, - time: "2019-04-11 12:50:30", - }, - { - id: 1000009, - img: - "https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg", - name: "轨迹绘制", - system_count: 6, - organization_manager: 3, - time: "2019-04-11 12:50:30", - }, - { - id: 1000010, - img: - "https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg", - name: "轨迹绘制", - system_count: 6, - organization_manager: 3, - time: "2019-04-11 12:50:30", - }, - ], - roleData: [ - { - name: "超级管理员", - description: "拥有所有权限", - }, - { - name: "组织管理员", - description: "拥有对应组织的权限", - }, - { - name: "普通用户", - description: "普通权限用户", - }, - { - name: "普通用户-开发者", - description: "基于普通用户多一些开发的选项", - }, - ], - showDialog: false, + listTotal: 0, + listData: [], + deleteItem: null, + tempFilter: null, }), methods: { - listAction(value) { - console.log(value); + initDatas(filters) { + this.tempFilter = filters; + + this.$http + .get("/apaas/backmgt/department/list", { + params: { + page: filters.page, + limit: filters.size, + }, + }) + .then(({ data }) => { + // console.log(data); + this.listTotal = data.total; + this.listData = data.data; + }) + .catch((error) => { + console.log(error); + }); }, deleteAction(item) { + this.deleteItem = item; this.$refs.dialog.show(); }, dialogSubmit() { - console.log("dialog submit"); + this.$http + .delete("/apaas/backmgt/department", { + params: { + department_id: this.deleteItem.department_id, + }, + }) + .then(({ data }) => { + // console.log(data); + this.$message({ + message: `已删除${this.deleteItem.department_name}.`, + type: "success", + }); + this.deleteItem = null; + this.initDatas(this.tempFilter); + }) + .catch((error) => { + this.$message({ + message: `删除${this.deleteItem.department_name}失败`, + type: "warning", + }); + }); }, }, }; diff --git a/src/pages/authority/permission.vue b/src/pages/authority/permission.vue index 3fdeff2..21eef05 100644 --- a/src/pages/authority/permission.vue +++ b/src/pages/authority/permission.vue @@ -10,52 +10,54 @@ 用户管理 权限审批 - - - - - - - - - - - - - - - - - - - - - - - - +
+ + + + + + + + + + + + + + + + + + + + + + + + +
diff --git a/src/pages/authority/roles.vue b/src/pages/authority/roles.vue index fb82c13..95b4cdc 100644 --- a/src/pages/authority/roles.vue +++ b/src/pages/authority/roles.vue @@ -1,7 +1,7 @@ @@ -116,94 +100,27 @@ import apassDialog from "@/components/apass-dialog"; export default { components: { apassList, apassDialog }, data: () => ({ - listTotal: 300, - listData: [ - { - id: "012344", - account: "012344", - name: "贵阳机关事务大数据平台", - role: "普通用户", - organization: "贵阳市水利局", - state: 0, - update_time: "2020-04-27 13:24:19", - }, - { - id: "012345", - account: "012345", - name: "贵州省水利厅", - role: "普通用户", - organization: "贵阳市水利局", - state: 1, - update_time: "2020-04-27 13:24:19", - }, - { - id: "012346", - account: "012346", - name: "贵州省公安厅", - role: "普通用户", - organization: "贵阳市水利局", - state: 1, - update_time: "2020-04-27 13:24:19", - }, - { - id: "012347", - account: "012347", - name: "贵阳机关事务大数据平台", - role: "普通用户", - organization: "贵阳市水利局", - state: 1, - update_time: "2020-04-27 13:24:19", - }, - { - id: "012348", - account: "012348", - name: "长兴县应急指挥平台", - role: "普通用户", - organization: "贵阳市水利局", - state: 1, - update_time: "2020-04-27 13:24:19", - }, - ], - roleData: [ - { - name: "超级管理员", - description: "拥有所有权限", - }, - { - name: "组织管理员", - description: "拥有对应组织的权限", - }, - { - name: "普通用户", - description: "普通权限用户", - }, - { - name: "普通用户-开发者", - description: "基于普通用户多一些开发的选项", - }, - ], + listTotal: 0, + listData: [], showDialog: false, + tempFilter: null, }), methods: { - initDatas(filter) { - // console.log(filter); + initDatas(filters) { + this.tempFilter = filters; this.$http .get("/apaas/backmgt/user/list", { params: { - keyword: filter.keyword, - limit: filter.page, - page: filter.size, - user_id: "ym", - user_name: "", - department_id: "", - state: 1, + search: filters.keyword, + page: filters.page, + limit: filters.size, }, }) .then(({ data }) => { - console.log(data); - // this.listTotal = data.data.total; - // this.listData = data.data.data; + // console.log(data.data); + this.listTotal = data.total; + this.listData = data.data; }) .catch((error) => { console.log(error); @@ -211,17 +128,10 @@ export default { }, setRole(item) { console.log("setRole " + item.name); - this.$refs.dialog.show(); }, setState(item) { console.log("setState " + item.name); }, - dialogSelectionChange(values) { - console.log(values); - }, - dialogSubmit() { - console.log("dialog submit"); - }, }, }; diff --git a/src/pages/workbench/app_build.vue b/src/pages/workbench/app_build.vue index 0c9a1fa..a80787c 100644 --- a/src/pages/workbench/app_build.vue +++ b/src/pages/workbench/app_build.vue @@ -481,6 +481,7 @@ export default { actionList: [ { label: "删除", + class: "warn", callback: this.deleteItem, }, ], diff --git a/src/router/index.js b/src/router/index.js index 69d8764..9badeaf 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -269,6 +269,11 @@ export default new Router({ name: "users", component: () => import("@/pages/authority/users"), }, + { + path: "/authority/users/roles/:id", // 分配角色 + name: "userRoles", + component: () => import("@/pages/authority/userRoles"), + }, { path: "/authority/users/add", // 用户管理-新增 name: "usersadd", -- 2.26.0