diff --git a/src/components/apass-list.vue b/src/components/apass-list.vue
index 3ba5ed6c77bf6baac25c5b27cc390a478382d933..25b0a4947a938102fe3bd3a4c38df5a9b275daa5 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 613f6befff2c6a42e11667562c17964b7deb9d67..39ac2688b6eae7b8ca14e71d05c0058ea2c34518 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 9668cc3f27f2337a9c9fa947a6dfba0de554e523..ef8b1cabc02a2c0187715273377c875948be809b 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 e98d86fbb76cf774302d9b9d984cd3410449a73f..2919968cf293f59400b97f6857566c7e27efaa02 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 8c27b8c02a5695656a7c125f7029d29417700041..671ad3953c97525c6e05fedff6ea2981c6f55eb9 100644
--- a/src/pages/authority/organization.vue
+++ b/src/pages/authority/organization.vue
@@ -1,7 +1,7 @@
@@ -20,7 +20,7 @@
当前组织总数:
- 8
+
@@ -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 3fdeff2eae9b080907c1ee65be483af81d29de18..21eef0592e2c1ed79ea914812adde8792d8d3d07 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 fb82c133acc99aa355498c52d3d8033cfdfaff25..95b4cdc1af32fee5c3bc32276a20347f9a305eee 100644
--- a/src/pages/authority/roles.vue
+++ b/src/pages/authority/roles.vue
@@ -1,7 +1,7 @@
{
+ this.listTotal = data.total;
+ this.listData = data.data;
+ })
+ .catch((error) => {
+ console.log(error);
+ });
},
showDialog() {
this.$refs.dialog.show();
},
editItem(item) {
- this.$router.push(`/authority/roles/edit/${item.id}`);
+ this.$router.push(`/authority/roles/edit/${item.role_id}`);
},
allotItem(item) {
- this.$router.push(`/authority/roles/allot/${item.id}`);
+ this.$router.push(`/authority/roles/allot/${item.role_id}`);
},
deleteItem(item) {
this.dialogInfo.title = "";
@@ -62,7 +79,21 @@ export default {
this.dialogInfo.cancelText = "";
this.dialogInfo.sunbmitText = "";
this.dialogInfo.submit = () => {
- console.log("deleteItem - " + item.name);
+ this.$http
+ .delete(`/apaas/backmgt/role/id/${item.role_id}`)
+ .then(({ data }) => {
+ this.$message({
+ message: `已删除${item.role_name}.`,
+ type: "success",
+ });
+ this.initDatas(this.tempFilter);
+ })
+ .catch((error) => {
+ this.$message({
+ message: `删除${this.deleteItem.role_name}失败`,
+ type: "warning",
+ });
+ });
};
this.showDialog();
},
@@ -71,20 +102,18 @@ export default {
this.listHeader = [
{
label: "角色类型",
- prop: "name",
+ prop: "role_name",
type: "button",
callback: this.editItem,
},
{
label: "创建人",
- prop: "creator",
- type: "",
+ prop: "create_user",
align: "center",
},
{
label: "创建日期",
prop: "create_date",
- type: "",
align: "center",
},
{
@@ -99,43 +128,12 @@ export default {
},
{
label: "删除",
+ class: "warn",
callback: this.deleteItem,
},
],
},
];
- this.listData = [
- {
- id: 0,
- name: "普通用户",
- creator: "谢飞",
- create_date: "2020-04-27 13:24:19",
- },
- {
- id: 1,
- name: "组织管理员",
- creator: "谢飞",
- create_date: "2020-04-27 13:24:19",
- },
- {
- id: 2,
- name: "超级管理员",
- creator: "谢飞",
- create_date: "2020-04-27 13:24:19",
- },
- {
- id: 3,
- name: "普通用户-开发者",
- creator: "谢飞",
- create_date: "2020-04-27 13:24:19",
- },
- {
- id: 4,
- name: "测试用户",
- creator: "谢飞",
- create_date: "2020-04-27 13:24:19",
- },
- ];
},
};
diff --git a/src/pages/authority/userRoles.vue b/src/pages/authority/userRoles.vue
new file mode 100644
index 0000000000000000000000000000000000000000..1176ec914b7d3837cd6efd727e28c42c3b5a8cea
--- /dev/null
+++ b/src/pages/authority/userRoles.vue
@@ -0,0 +1,158 @@
+
+
+
+
+ 权限管理
+ 用户管理
+ 分配角色
+
+
+
+ 保存
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/pages/authority/users.vue b/src/pages/authority/users.vue
index 204ca7f8e7a1d46fcc3e527c1f768e1563db9f3d..8e8e2142c9a6c62e58f9bee3ed33f0d78bf88e5b 100644
--- a/src/pages/authority/users.vue
+++ b/src/pages/authority/users.vue
@@ -22,22 +22,28 @@
-
+
-
+
-
+
-
+
@@ -47,7 +53,7 @@
-
+
@@ -56,13 +62,18 @@
详情
|
-
+
分配角色
|
@@ -79,33 +90,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -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 0c9a1fac74040c2aa8bf41107e5362c7807bb718..a80787ce7bfdce24a98df8a3a73d4037f2fbc8b2 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 69d87649619cce81fa92875287d60ba9e8e83823..9badeafd30a5678d9dcdaffacf9a40e98a5888ef 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",