瀏覽代碼

超管权限修改

zhangjie 4 年之前
父節點
當前提交
7a828b0f9b

+ 11 - 5
card/mixins/exchange.js

@@ -236,7 +236,7 @@ export default {
             });
             listInfos[questionIndex] = {
               main_number: element.topicNo,
-              sub_number: questionItem.firstChild.textContent,
+              sub_number: questionItem.firstChild.textContent * 1,
               options
             };
           });
@@ -255,15 +255,21 @@ export default {
     },
     getFillLineInfo(element) {
       const dom = this.getPreviewElementById(element.id);
+      let sub_numbers = [];
+      for (
+        let i = element.startNumber,
+          len = element.startNumber + element.questionsCount;
+        i < len;
+        i++
+      ) {
+        sub_numbers.push(i);
+      }
 
       return {
         answer_area: [
           {
             main_number: element.topicNo,
-            sub_numbers: [
-              element.startNumber,
-              element.startNumber + element.questionsCount - 1
-            ],
+            sub_numbers,
             area: this.getOffsetInfo(dom)
           }
         ]

+ 47 - 192
src/assets/styles/adaptive.scss

@@ -1,127 +1,16 @@
-@media screen and (max-width: 1600px) {
-  .home-body {
-    top: 50px;
-  }
-  .home-main {
-    padding: 0 0 50px 205px;
-  }
-  .home-header {
-    height: 50px;
-    .head-logo {
-      width: 205px;
-      font-size: 17px;
-      padding: 10px 15px;
-    }
-    .menu-list {
-      li {
-        width: 138px;
-        padding: 10px 0;
-        font-size: 14px;
-        .icon {
-          width: 18px;
-          height: 18px;
-        }
-        span {
-          margin-left: 10px;
-        }
-        .menu-item-account {
-          span {
-            max-width: 108px;
-          }
-        }
-      }
-    }
-  }
-  .home-navs {
-    width: 205px;
-    top: 50px;
-    font-size: 14px;
-    .nav-head {
-      padding: 15px 20px;
-      font-size: 15px;
-      line-height: 30px;
-      .icon-exam-center-gray {
-        width: 20px;
-        height: 20px;
-      }
-    }
-    .nav-list {
-      padding: 0 20px;
-    }
-    .nav-item {
-      &-main {
-        line-height: 20px;
-      }
-      &-icon {
-        top: 15px;
-        right: 5px;
-      }
-      &-info {
-        top: 15px;
-        right: 30px;
-      }
-    }
-  }
-  .home-breadcrumb {
-    padding: 20px 25px;
-  }
-  .home-view {
-    padding: 0 25px;
-  }
-
-  .task-detail {
-    .task-title {
-      font-size: 14px;
-      padding: 10px 15px;
-      .el-checkbox__label {
-        font-size: 14px;
-      }
-    }
-    .task-body {
-      padding: 20px 15px;
-
-      .table th {
-        font-size: 14px;
-        padding: 10px;
-      }
-    }
-  }
-  .table {
-    th,
-    td {
-      padding: 10px;
-    }
-  }
-
-  // element
-  .el-table__header thead {
-    font-size: 14px;
-  }
-  .el-button {
-    padding: 9px 15px;
-  }
-  .el-input__inner {
-    height: 36px;
-    line-height: 36px;
-  }
-}
 @media screen and (max-width: 1100px) {
   .home-header {
     .head-logo {
       width: 180px;
+      padding: 5px 10px;
     }
     .menu-list {
       li {
-        width: 110px;
+        padding: 10px;
 
         span {
           margin-left: 6px;
         }
-        .menu-item-account {
-          span {
-            max-width: 84px;
-          }
-        }
       }
     }
   }
@@ -129,32 +18,49 @@
     width: 180px;
 
     .nav-head {
-      padding: 15px;
+      padding: 10px 8px;
+      > i {
+        margin-right: 0;
+      }
     }
 
     .nav-list {
-      padding: 0 15px;
+      padding: 0 10px 0 28px;
+    }
+    .nav-item {
+      &-main {
+        padding: 8px 0;
+      }
     }
   }
   .home-main {
     padding-left: 180px;
   }
   .home-breadcrumb {
-    padding: 20px;
+    padding: 10px 15px;
+    .el-breadcrumb {
+      line-height: 24px;
+    }
   }
   .home-view {
-    padding: 0 20px;
+    padding: 0 15px;
   }
   // part
   .part-box {
     margin-bottom: 15px;
-  }
-  .part-box-filter {
-    padding: 15px 15px 0;
-    .el-form-item {
-      margin-bottom: 16px;
+
+    &-filter {
+      padding: 10px 10px 0;
+      .el-form-item {
+        margin-bottom: 10px;
+      }
+    }
+
+    &-action {
+      padding-bottom: 10px;
     }
   }
+
   // rule-warning
   .rule-warning {
     .el-form {
@@ -178,6 +84,11 @@
     .head-menu-btn {
       display: block;
       padding: 7px 10px;
+      cursor: pointer;
+
+      &:hover {
+        opacity: 0.9;
+      }
     }
   }
   .home-navs {
@@ -189,24 +100,13 @@
     top: 0;
     width: 100%;
     background: transparent;
-    margin-bottom: 20px;
     font-size: 14px;
     &::before {
       display: none;
     }
 
-    .nav-head {
-      padding: 10px 0;
-    }
-
-    .nav-list {
-      padding: 0;
-    }
-    .nav-item-main {
-      padding: 10px 0;
-    }
-    .nav-item-icon {
-      top: 10px;
+    .nav-part {
+      margin-bottom: 15px;
     }
   }
   .home-main {
@@ -222,6 +122,12 @@
       margin: 0 !important;
     }
   }
+  // .part-box
+  .part-box {
+    &-flex {
+      display: block;
+    }
+  }
 }
 
 @media screen and (max-width: 576px) {
@@ -233,38 +139,18 @@
   }
   .login-body {
     width: auto;
-    margin: 0 15px;
+    margin: 0 10px;
     padding: 50px 20px;
   }
   .home-breadcrumb {
-    padding: 15px;
+    padding: 10px;
   }
   .home-view {
-    padding: 0 15px;
-  }
-  .home-header {
-    height: 50px;
-    .head-logo {
-      padding: 10px 15px;
-    }
-    .head-menu-btn {
-      padding: 7px 15px;
-    }
-  }
-  .home-body {
-    top: 50px;
+    padding: 0 10px;
   }
 
-  .part-box-filter {
-    padding: 15px;
-    .el-form {
-      .el-form-item {
-        margin-bottom: 10px;
-      }
-    }
-  }
   .part-box-pad {
-    padding: 15px;
+    padding: 10px;
   }
   // .rule-warning
   .rule-warning {
@@ -276,47 +162,16 @@
       padding: 10px 0;
     }
     .el-form {
-      padding: 15px;
-    }
-  }
-  .rule-card {
-    padding: 15px;
-    > .el-form {
-      padding: 0 !important;
-    }
-    .el-form-item {
-      margin-left: 0 !important;
+      padding: 10px;
     }
   }
-  .business-fields {
-    padding: 15px;
-  }
-  // .task-detail
-  .task-detail {
-    border: none;
-    .task-title {
-      font-size: 14px;
-      line-height: 24px;
-      padding: 10px 0;
-      border: none;
-      h2 span {
-        display: block;
-      }
-    }
 
-    .task-body {
-      padding: 0;
-      &::before {
-        display: none;
-      }
-    }
-  }
   // .table
   .table {
     th,
     td {
       font-size: 14px !important;
-      padding: 10px !important;
+      padding: 5px !important;
     }
   }
   // .upload-file-view

+ 3 - 2
src/assets/styles/home.scss

@@ -95,7 +95,8 @@
       position: absolute;
       width: 20px;
       height: 20px;
-      top: 10px;
+      top: 50%;
+      margin-top: -10px;
       text-align: center;
       line-height: 20px;
     }
@@ -231,7 +232,7 @@
     box-shadow: none;
 
     .el-dialog__body {
-      padding: 10px 20px;
+      padding: 10px;
       &::after {
         display: none;
       }

+ 0 - 42
src/assets/styles/pages.scss

@@ -187,48 +187,6 @@
   }
 }
 
-// rule-warning
-.rule-warning {
-  color: $--color-text-regular;
-  font-weight: bold;
-  .rule-tips {
-    padding-left: 40px;
-    line-height: 50px;
-  }
-  .rule-spin {
-    margin-right: 10px;
-  }
-  .el-form {
-    width: 525px;
-    margin-left: 217px;
-    padding: 27px 27px 5px;
-    border: 1px solid $--color-border;
-    border-radius: $--border-radius;
-  }
-  .rule-btns {
-    margin-top: 26px;
-    margin-left: 217px;
-  }
-}
-.rule-form {
-  border-radius: $--border-radius;
-  border: 1px solid $--color-border;
-  padding: 26px;
-
-  .el-form-item__label {
-    color: $--color-text-regular;
-  }
-}
-// business-fields
-.business-fields {
-  padding: 10px 25px;
-  border-radius: $--border-radius;
-  border: 1px solid $--color-border;
-  .el-form-item {
-    margin-bottom: 5px;
-  }
-}
-
 // page-preview
 .preview-frame {
   position: absolute;

+ 23 - 0
src/constants/adminNavs.js

@@ -0,0 +1,23 @@
+const navs = [
+  {
+    title: "超管中心",
+    name: "admin",
+    icon: "el-icon-receiving",
+    children: [
+      {
+        title: "用户管理",
+        router: "AdminUserManage"
+      },
+      {
+        title: "系统角色管理",
+        router: "SystemRoleManage"
+      },
+      {
+        title: "权限管理",
+        router: "PrivilegeManage"
+      }
+    ]
+  }
+];
+
+export default navs;

+ 4 - 0
src/constants/app.js

@@ -8,6 +8,10 @@ if (process.env.VUE_APP_SELF_DEFINE_DOMAIN === "true") {
 if (!domain) domain = window.location.hostname.split(".")[0];
 export const ORG_CODE = domain;
 
+const ADMIN_CODE = "admin";
+
+export const IS_ADMIN_SYSTEM = ADMIN_CODE === ORG_CODE;
+
 export const PLATFORM = "WEB";
 
 if (!localStorage.getItem("deviceId")) {

+ 5 - 0
src/constants/enumerate.js

@@ -30,6 +30,11 @@ export const PRIVILEGE_TYPE = {
   MENU: "菜单",
   URL: "操作"
 };
+// 接口权限类型
+export const URL_PRIVILEGE_TYPE = {
+  MENU: "菜单",
+  URL: "操作"
+};
 
 // 基础 -------------->
 // 角色

+ 0 - 4
src/constants/navs.js

@@ -107,10 +107,6 @@ const navs = [
           {
             title: "角色管理",
             router: "RoleManage"
-          },
-          {
-            title: "权限管理",
-            router: "MenuManage"
           }
         ]
       },

+ 2 - 1
src/main.js

@@ -25,7 +25,8 @@ Vue.use(globalVuePlugins);
 
 Vue.prototype.GLOBAL = GLOBAL;
 Vue.config.productionTip = false;
-const IS_DEV = process.env.NODE_ENV === "development";
+const IS_DEV = true;
+// const IS_DEV = process.env.NODE_ENV === "development";
 
 // route interceptor
 router.beforeEach((to, from, next) => {

+ 29 - 0
src/modules/admin/api.js

@@ -0,0 +1,29 @@
+import { $postParam, $post } from "@/plugins/axios";
+
+// user-manage
+export const userListPage = datas => {
+  return $postParam("/api/admin/sys/user/list_customer", datas);
+};
+export const updateUser = datas => {
+  return $post("/api/admin/sys/user/save_customer", datas);
+};
+export const ableUser = ({ id, enable }) => {
+  return $post("/api/admin/sys/user/enable", { id, enable });
+};
+export const resetPwd = id => {
+  return $post("/api/admin/sys/user/reset_password", { id });
+};
+export const userRoleListPage = () => {
+  return $postParam("/api/admin/sys/role/list_to_user", {});
+};
+
+// menu-manage
+export const menuList = datas => {
+  return $postParam("/api/admin/sys/privilege/list", datas);
+};
+export const updateMenu = datas => {
+  return $post("/api/admin/sys/privilege/save", datas);
+};
+export const deleteMenu = id => {
+  return $post("/api/admin/sys/privilege/remove", { id });
+};

+ 2 - 2
src/modules/base/components/ModifyMenu.vue → src/modules/admin/components/ModifyPrivilege.vue

@@ -1,6 +1,6 @@
 <template>
   <el-dialog
-    class="modify-menu"
+    class="modify-privilege"
     :visible.sync="modalIsShow"
     :title="title"
     top="10vh"
@@ -87,7 +87,7 @@ const initModalForm = {
 };
 
 export default {
-  name: "modify-menu",
+  name: "modify-privilege",
   props: {
     instance: {
       type: Object,

+ 213 - 0
src/modules/admin/components/ModifySystemRole.vue

@@ -0,0 +1,213 @@
+<template>
+  <el-dialog
+    class="modify-role"
+    :visible.sync="modalIsShow"
+    :title="title"
+    top="10px"
+    width="700px"
+    :close-on-click-modal="false"
+    :close-on-press-escape="false"
+    append-to-body
+    @opened="visibleChange"
+  >
+    <div class="part-box part-box-pad part-box-border">
+      <el-form
+        ref="modalFormComp"
+        :model="modalForm"
+        :rules="rules"
+        label-width="100px"
+      >
+        <el-form-item prop="name" label="角色名称:">
+          <el-input
+            style="width:100%;"
+            v-model.trim="modalForm.name"
+            placeholder="请输入角色名称"
+            clearable
+          ></el-input>
+        </el-form-item>
+        <el-form-item prop="privilegeIds" label="角色权限:">
+          <div class="part-box part-box-pad part-box-border">
+            <el-tree
+              :data="menus"
+              show-checkbox
+              node-key="id"
+              ref="MenuTree"
+              highlight-current
+              check-on-click-node
+              :expand-on-click-node="false"
+              :default-expanded-keys="defaultExpandedKeys"
+              :props="defaultProps"
+              @check-change="checkChange"
+            >
+              <span class="custom-tree-node" slot-scope="{ node, data }">
+                <span
+                  ><i class="el-icon-link" v-if="data.type === 'URL'"></i>
+                  {{ node.label }}</span
+                >
+              </span>
+            </el-tree>
+          </div>
+        </el-form-item>
+      </el-form>
+    </div>
+    <div slot="footer">
+      <el-button type="primary" :disabled="isSubmit" @click="submit"
+        >确认</el-button
+      >
+      <el-button type="danger" @click="cancel" plain>取消</el-button>
+    </div>
+  </el-dialog>
+</template>
+
+<script>
+import { updateRole, menuAuthList, roleBoundPrivileges } from "../../base/api";
+
+const initModalForm = {
+  id: null,
+  name: "",
+  type: "CUSTOM",
+  privilegeIds: []
+};
+
+export default {
+  name: "modify-role",
+  props: {
+    instance: {
+      type: Object,
+      default() {
+        return {};
+      }
+    }
+  },
+  computed: {
+    isEdit() {
+      return !!this.instance.id;
+    },
+    title() {
+      return (this.isEdit ? "编辑" : "新增") + "角色";
+    }
+  },
+  data() {
+    return {
+      modalIsShow: false,
+      isSubmit: false,
+      menus: [],
+      defaultExpandedKeys: [],
+      modalForm: {},
+      defaultProps: {
+        label: "name"
+      },
+      rules: {
+        name: [
+          {
+            required: true,
+            pattern: /^[0-9a-zA-Z\u4E00-\u9FA5]{1,10}$/,
+            message: "角色名称只能输入汉字、字母和数字,长度不能超过10",
+            trigger: "change"
+          }
+        ],
+        type: [
+          {
+            required: true,
+            message: "请选择角色类型",
+            trigger: "change"
+          }
+        ],
+        privilegeIds: [
+          {
+            required: true,
+            validator: (rule, value, callback) => {
+              if (this.modalForm.type !== "CUSTOM" || value.length) {
+                callback();
+              } else {
+                callback(new Error("请选择扩展字段"));
+              }
+            },
+            trigger: "change"
+          }
+        ]
+      }
+    };
+  },
+  created() {
+    this.getMenus();
+  },
+  methods: {
+    async getMenus() {
+      const data = await menuAuthList();
+      if (data) this.menus = data.filter(item => item.url !== "common");
+      this.defaultExpandedKeys = [];
+      this.getDefaultExpandedKeys(this.menus);
+    },
+    async visibleChange() {
+      console.log(this.instance);
+      if (this.instance.id) {
+        this.modalForm = this.$objAssign(initModalForm, this.instance);
+        let privilegeIds = await roleBoundPrivileges(this.instance.id);
+        privilegeIds = privilegeIds || [];
+        let checkedIds = [];
+        const getCheckedIds = list => {
+          list.forEach(item => {
+            if (item["children"] && item["children"].length) {
+              getCheckedIds(item.children);
+            } else {
+              const isChecked = privilegeIds.includes(item.id);
+              if (isChecked) checkedIds.push(item.id);
+            }
+          });
+        };
+        getCheckedIds(this.menus);
+        this.$refs.MenuTree.setCheckedKeys(checkedIds);
+        this.modalForm.privilegeIds = checkedIds;
+      } else {
+        this.modalForm = { ...initModalForm };
+        this.$refs.MenuTree.setCheckedKeys([]);
+      }
+      this.$nextTick(() => {
+        this.$refs.modalFormComp.clearValidate();
+      });
+    },
+    cancel() {
+      this.modalIsShow = false;
+    },
+    open() {
+      this.modalIsShow = true;
+    },
+    getDefaultExpandedKeys(menus) {
+      menus.forEach(item => {
+        if (
+          item.children &&
+          item.children.length &&
+          !item.children.some(elem => elem.type === "URL")
+        ) {
+          this.defaultExpandedKeys.push(item.id);
+          this.getDefaultExpandedKeys(item.children);
+        }
+      });
+    },
+    checkChange(data, checked) {
+      this.modalForm.privilegeIds = this.$refs.MenuTree.getCheckedKeys();
+      this.$refs.modalFormComp.validateField("privilegeIds");
+    },
+    async submit() {
+      const valid = await this.$refs.modalFormComp.validate().catch(() => {});
+      if (!valid) return;
+
+      if (this.isSubmit) return;
+      this.isSubmit = true;
+      const datas = { ...this.modalForm };
+      const privilegeIds = [
+        ...this.$refs.MenuTree.getCheckedKeys(),
+        ...this.$refs.MenuTree.getHalfCheckedKeys()
+      ];
+      datas.privilegeIds = privilegeIds;
+      const data = await updateRole(datas).catch(() => {});
+      this.isSubmit = false;
+      if (!data) return;
+
+      this.$emit("modified", this.modalForm);
+      this.cancel();
+    }
+  }
+};
+</script>

+ 166 - 0
src/modules/admin/components/ModifyUser.vue

@@ -0,0 +1,166 @@
+<template>
+  <el-dialog
+    class="modify-user"
+    :visible.sync="modalIsShow"
+    :title="title"
+    top="10vh"
+    width="600px"
+    :close-on-click-modal="false"
+    :close-on-press-escape="false"
+    append-to-body
+    @open="visibleChange"
+  >
+    <div class="part-box part-box-pad part-box-border">
+      <el-form
+        ref="modalFormComp"
+        :model="modalForm"
+        :rules="rules"
+        label-width="100px"
+      >
+        <el-form-item prop="loginName" label="用户名:">
+          <el-input
+            style="width:100%;"
+            v-model.trim="modalForm.loginName"
+            placeholder="请输入用户名"
+            :disabled="isEdit"
+          ></el-input>
+        </el-form-item>
+        <el-form-item prop="realName" label="姓名:">
+          <el-input
+            style="width:100%;"
+            v-model.trim="modalForm.realName"
+            placeholder="请输入姓名"
+            clearable
+          ></el-input>
+        </el-form-item>
+        <el-form-item prop="mobileNumber" label="手机号:">
+          <el-input
+            style="width:100%;"
+            v-model.trim="modalForm.mobileNumber"
+            placeholder="请输入手机号"
+            clearable
+          ></el-input>
+        </el-form-item>
+        <el-form-item prop="roleIds" label="角色:">
+          <el-select
+            style="width:100%;"
+            v-model="modalForm.roleIds"
+            placeholder="请选择角色"
+            disabled
+            multiple
+          >
+            <el-option
+              v-for="item in roles"
+              :key="item.id"
+              :value="item.id"
+              :label="item.name"
+            >
+            </el-option>
+          </el-select>
+        </el-form-item>
+      </el-form>
+    </div>
+    <div slot="footer">
+      <el-button type="primary" :disabled="isSubmit" @click="submit"
+        >确认</el-button
+      >
+      <el-button type="danger" @click="cancel" plain>取消</el-button>
+    </div>
+  </el-dialog>
+</template>
+
+<script>
+import { updateUser } from "../api";
+import { phone } from "@/plugins/formRules";
+
+const initModalForm = {
+  id: "",
+  loginName: "",
+  realName: "",
+  mobileNumber: "",
+  roleIds: []
+};
+
+export default {
+  name: "modify-user",
+  props: {
+    instance: {
+      type: Object,
+      default() {
+        return {};
+      }
+    },
+    roles: {
+      type: Array,
+      default() {
+        return [];
+      }
+    }
+  },
+  computed: {
+    isEdit() {
+      return !!this.instance.id;
+    },
+    title() {
+      return (this.isEdit ? "编辑" : "新增") + "用户";
+    }
+  },
+  data() {
+    return {
+      modalIsShow: false,
+      isSubmit: false,
+      modalForm: {},
+      rules: {
+        mobileNumber: phone,
+        loginName: [
+          {
+            required: true,
+            message: "请输入用户名",
+            trigger: "change"
+          }
+        ],
+        realName: [
+          {
+            required: true,
+            message: "请输入姓名",
+            trigger: "change"
+          }
+        ]
+      },
+      user: {},
+      courses: [],
+      roleTypes: []
+    };
+  },
+  methods: {
+    initData(val) {
+      this.modalForm = this.$objAssign(initModalForm, val);
+      this.modalForm.roleIds = val.roles.map(item => item.id);
+    },
+    visibleChange() {
+      this.initData(this.instance);
+    },
+    cancel() {
+      this.modalIsShow = false;
+    },
+    open() {
+      this.modalIsShow = true;
+    },
+    async submit() {
+      const valid = await this.$refs.modalFormComp.validate().catch(() => {});
+      if (!valid) return;
+
+      if (this.isSubmit) return;
+      this.isSubmit = true;
+
+      const datas = { ...this.modalForm };
+      const data = await updateUser(datas).catch(() => {});
+      this.isSubmit = false;
+      if (!data) return;
+
+      this.$message.success("修改成功!");
+      this.cancel();
+    }
+  }
+};
+</script>

+ 27 - 0
src/modules/admin/router.js

@@ -0,0 +1,27 @@
+import AdminUserManage from "./views/AdminUserManage.vue";
+import PrivilegeManage from "./views/PrivilegeManage.vue";
+import SystemRoleManage from "./views/SystemRoleManage.vue";
+import Admin from "./views/Admin.vue";
+
+export default {
+  path: "/admin",
+  name: "Admin",
+  component: Admin,
+  children: [
+    {
+      path: "admin-user-manage",
+      name: "AdminUserManage",
+      component: AdminUserManage
+    },
+    {
+      path: "privilege-manage",
+      name: "PrivilegeManage",
+      component: PrivilegeManage
+    },
+    {
+      path: "system-role-manage",
+      name: "SystemRoleManage",
+      component: SystemRoleManage
+    }
+  ]
+};

+ 176 - 0
src/modules/admin/views/Admin.vue

@@ -0,0 +1,176 @@
+<template>
+  <div class="admin">
+    <div class="home-header">
+      <div class="head-logo">
+        <h1>分布式印刷</h1>
+      </div>
+      <div class="head-user menu-list">
+        <ul>
+          <li @click="toSelectSchool">
+            <i class="el-icon-s-home"></i>
+            <span>切换学校</span>
+          </li>
+          <li class="menu-item" @click="toLogout">
+            <i class="el-icon-switch-button"></i>
+            <span>退出登录</span>
+          </li>
+        </ul>
+      </div>
+    </div>
+
+    <div class="home-navs">
+      <div v-for="(menu, sindex) in menus" :key="sindex" class="nav-part">
+        <div class="nav-head">
+          <i :class="menu.icon"></i>
+          <span>{{ menu.title }}</span>
+        </div>
+        <ul class="nav-list">
+          <li
+            class="nav-item"
+            v-for="(nav, navNo) in menu.children"
+            :key="navNo"
+          >
+            <div
+              :class="[
+                'nav-item-main',
+                { 'nav-item-main-act': curActNav === nav.router }
+              ]"
+              @click="toNav(nav)"
+            >
+              <p class="nav-item-cont">{{ nav.title }}</p>
+              <span class="nav-item-icon nav-item-icon-right">
+                <i
+                  :class="[
+                    'icon',
+                    curActNav === nav.router
+                      ? 'icon-arrow-right-act'
+                      : 'icon-arrow-right'
+                  ]"
+                ></i>
+              </span>
+            </div>
+          </li>
+        </ul>
+      </div>
+    </div>
+
+    <div class="home-body">
+      <div class="home-main">
+        <div class="home-breadcrumb" v-if="breadcrumbs.length">
+          <el-breadcrumb separator=">">
+            <el-breadcrumb-item>
+              <i class="el-icon-s-home" style="margin-top: -2px;"></i>
+            </el-breadcrumb-item>
+            <el-breadcrumb-item
+              v-for="(bread, index) in breadcrumbs"
+              :key="index"
+              >{{ bread.title }}</el-breadcrumb-item
+            >
+          </el-breadcrumb>
+        </div>
+
+        <!-- home-view: page detail -->
+        <div class="home-view">
+          <router-view />
+        </div>
+      </div>
+    </div>
+  </div>
+</template>
+
+<script>
+import localNavs from "@/constants/adminNavs";
+import { logout } from "@/modules/login/api";
+
+export default {
+  name: "home",
+  data() {
+    return {
+      menus: localNavs,
+      curActNav: "",
+      breadcrumbs: [],
+      username: this.$ls.get("user", { realName: "" }).realName
+    };
+  },
+  watch: {
+    $route(val) {
+      if (val.name === "Admin") return;
+      this.actCurNav();
+    }
+  },
+  created() {
+    if (this.$route.name === "Admin") {
+      this.$router.replace({
+        name: "AdminUserManage"
+      });
+    }
+    this.actCurNav();
+  },
+  methods: {
+    toNav(nav) {
+      if (nav.router === this.$route.name) return;
+      this.curActNav = nav.router;
+      this.$router.push({ name: nav.router });
+    },
+    actCurNav() {
+      const routerName = this.$route.name;
+      let breadcrumbs = [];
+      const getRouterPath = (navs, pathList) => {
+        navs.forEach(nav => {
+          let navPathList = [...pathList];
+          if (breadcrumbs.length) return;
+          if (nav["router"] === routerName) {
+            breadcrumbs = [
+              ...navPathList,
+              { title: nav.title, router: nav.router, isRouter: true }
+            ];
+            return;
+          } else {
+            const routerOrName = nav["router"] || nav["name"];
+            navPathList = [
+              ...navPathList,
+              {
+                title: nav.title,
+                router: routerOrName,
+                isRouter: !!nav["router"]
+              }
+            ];
+            if (nav["children"]) {
+              getRouterPath(nav.children, navPathList);
+            }
+          }
+        });
+      };
+
+      getRouterPath(this.menus, []);
+
+      const curRouter = breadcrumbs.find(item => item.isRouter);
+      this.curActNav = curRouter.router;
+      this.curMenu = this.menus.find(
+        menu => menu.name === breadcrumbs[0].router
+      );
+
+      this.breadcrumbs = breadcrumbs;
+    },
+    toLogout() {
+      this.$confirm("确定要退出登录吗?", "提示", {
+        cancelButtonClass: "el-button--danger is-plain",
+        confirmButtonClass: "el-button--primary",
+        type: "warning"
+      })
+        .then(() => {
+          this.logoutAction();
+        })
+        .catch(() => {});
+    },
+    async logoutAction() {
+      await logout();
+      this.$ls.clear();
+      this.$router.push({ name: "Login" });
+    },
+    toSelectSchool() {
+      this.$router.push({ name: "SelectSchool" });
+    }
+  }
+};
+</script>

+ 246 - 0
src/modules/admin/views/AdminUserManage.vue

@@ -0,0 +1,246 @@
+<template>
+  <div class="user-manage">
+    <div class="part-box part-box-filter part-box-flex">
+      <el-form ref="FilterForm" label-position="left" label-width="85px" inline>
+        <el-form-item label="姓名:" label-width="75px">
+          <el-input
+            style="width: 142px;"
+            v-model.trim="filter.realName"
+            placeholder="请输入内容"
+            clearable
+          ></el-input>
+        </el-form-item>
+        <el-form-item label="启用/禁用:" label-width="90px">
+          <el-select
+            v-model="filter.enable"
+            style="width: 142px;"
+            placeholder="请选择"
+            clearable
+          >
+            <el-option
+              v-for="(val, key) in ABLE_TYPE"
+              :key="key"
+              :value="key * 1"
+              :label="val"
+            ></el-option>
+          </el-select>
+        </el-form-item>
+
+        <el-form-item label-width="0px">
+          <el-button type="primary" icon="icon icon-search" @click="toPage(1)"
+            >查询</el-button
+          >
+        </el-form-item>
+      </el-form>
+      <div class="part-box-action">
+        <el-button type="primary" @click="toAdd">新增用户</el-button>
+      </div>
+    </div>
+
+    <div class="part-box">
+      <el-table ref="TableList" :data="users" border stripe>
+        <el-table-column
+          type="index"
+          label="序号"
+          width="70"
+          align="center"
+          :index="indexMethod"
+        ></el-table-column>
+        <el-table-column prop="loginName" label="用户名"></el-table-column>
+        <el-table-column
+          prop="realName"
+          label="姓名"
+          width="120"
+        ></el-table-column>
+        <el-table-column prop="roles" label="角色">
+          <template slot-scope="scope">
+            {{ scope.row.roles | rolesFilter }}
+          </template>
+        </el-table-column>
+        <el-table-column
+          prop="mobileNumber"
+          label="手机号"
+          width="120"
+        ></el-table-column>
+        <el-table-column prop="enable" label="状态" width="100">
+          <template slot-scope="scope">
+            {{ scope.row.enable | enableFilter }}
+          </template>
+        </el-table-column>
+        <el-table-column
+          class-name="action-column"
+          label="操作"
+          align="center"
+          width="120px"
+        >
+          <template slot-scope="scope">
+            <el-button
+              class="btn-table-icon"
+              type="text"
+              :icon="
+                scope.row.enable
+                  ? 'icon icon-circle-stop'
+                  : 'icon icon-circle-caret-right'
+              "
+              @click="toEnable(scope.row)"
+              :title="scope.row.enable ? '禁用' : '启用'"
+            ></el-button>
+            <el-button
+              class="btn-table-icon"
+              type="text"
+              icon="icon icon-edit"
+              @click="toEdit(scope.row)"
+              title="编辑"
+            ></el-button>
+            <el-button
+              class="btn-table-icon"
+              type="text"
+              icon="icon icon-circle-lock"
+              @click="toResetPwd(scope.row)"
+              title="重置密码"
+            ></el-button>
+          </template>
+        </el-table-column>
+      </el-table>
+      <div class="part-page">
+        <el-pagination
+          background
+          layout="total,prev, pager, next"
+          :current-page="current"
+          :total="total"
+          :page-size="size"
+          @current-change="toPage"
+        >
+        </el-pagination>
+      </div>
+    </div>
+
+    <!-- ModifyUser -->
+    <modify-user
+      ref="ModifyUser"
+      :instance="curUser"
+      :roles="roles"
+      @modified="getList"
+    ></modify-user>
+  </div>
+</template>
+
+<script>
+import ModifyUser from "../components/ModifyUser";
+import { ABLE_TYPE } from "@/constants/enumerate";
+import { userListPage, ableUser, resetPwd, userRoleListPage } from "../api";
+import { logout } from "@/modules/login/api";
+
+export default {
+  name: "user-manage",
+  components: { ModifyUser },
+  data() {
+    return {
+      filter: {
+        realName: "",
+        enable: ""
+      },
+      current: 1,
+      size: this.GLOBAL.pageSize,
+      total: 0,
+      visible: false,
+      ABLE_TYPE,
+      roles: [],
+      users: [],
+      curUser: {},
+      downloadUrl: "/temps/用户导入模板.xlsx",
+      // import
+      uploadUrl: "/api/admin/sys/user/import",
+      uploadData: {
+        type: "FILE"
+      }
+    };
+  },
+  created() {
+    this.getRoleList();
+    this.getList();
+  },
+  methods: {
+    async getRoleList() {
+      const data = await userRoleListPage();
+      this.roles = data || [];
+      this.roles = this.roles
+        .filter(item => item.type === "CUSTOMER")
+        .map(item => {
+          return {
+            id: item.id,
+            name: item.name,
+            type: item.type
+          };
+        });
+      console.log(this.roles);
+    },
+    async getList() {
+      const datas = {
+        ...this.filter,
+        pageNumber: this.current,
+        pageSize: this.size
+      };
+      if (datas.enable !== null && datas.enable !== "")
+        datas.enable = !!datas.enable;
+      const data = await userListPage(datas);
+      this.users = data.records;
+      this.total = data.total;
+    },
+    toPage(page) {
+      this.current = page;
+      this.getList();
+    },
+    toEnable(row) {
+      // 自己不可以启用/禁用自己
+      const userId = this.$ls.get("user", { id: "" }).id;
+      if (row.id === userId) {
+        this.$message.error("不可以启用/禁用自己!");
+        return;
+      }
+
+      const action = row.enable ? "禁用" : "启用";
+      this.$confirm(`确定要${action}用户【${row.realName}】吗?`, "提示", {
+        cancelButtonClass: "el-button--danger is-plain",
+        confirmButtonClass: "el-button--primary",
+        type: "warning"
+      })
+        .then(async () => {
+          const enable = !row.enable;
+          await ableUser({
+            id: row.id,
+            enable
+          });
+          row.enable = enable;
+          this.$message.success("操作成功!");
+        })
+        .catch(() => {});
+    },
+    toEdit(row) {
+      this.curUser = row;
+      this.$refs.ModifyUser.open();
+    },
+    toAdd() {
+      this.curUser = {
+        roles: this.roles
+      };
+      this.$refs.ModifyUser.open();
+    },
+    async toResetPwd(row) {
+      await resetPwd(row.id);
+      this.$message.success("密码重置成功!");
+
+      // 修改自己时,会强制重新登录
+      const userId = this.$ls.get("user", { id: "" }).id;
+      if (row.id !== userId) return;
+      this.toLogout();
+    },
+    async toLogout() {
+      await logout();
+      this.$ls.clear();
+      this.$router.push({ name: "Login" });
+      this.$message.info("您的密码已经变更,请重新登录系统!");
+    }
+  }
+};
+</script>

+ 11 - 11
src/modules/base/views/MenuManage.vue → src/modules/admin/views/PrivilegeManage.vue

@@ -1,5 +1,5 @@
 <template>
-  <div class="menu-manage">
+  <div class="privilege-manage">
     <div class="part-box">
       <el-button type="primary" size="mini" icon="el-icon-edit" @click="toAdd"
         >新增</el-button
@@ -46,22 +46,22 @@
       </el-tree>
     </div>
 
-    <!-- ModifyMenu -->
-    <modify-menu
-      ref="ModifyMenu"
+    <!-- ModifyPrivilege -->
+    <modify-privilege
+      ref="ModifyPrivilege"
       :instance="curMenu"
       @confirm="menuModified"
-    ></modify-menu>
+    ></modify-privilege>
   </div>
 </template>
 
 <script>
 import { menuList, deleteMenu } from "../api";
-import ModifyMenu from "../components/ModifyMenu";
+import ModifyPrivilege from "../components/ModifyPrivilege";
 
 export default {
-  name: "menu-manage",
-  components: { ModifyMenu },
+  name: "privilege-manage",
+  components: { ModifyPrivilege },
   data() {
     return {
       menus: [],
@@ -84,7 +84,7 @@ export default {
       this.curMenu = {
         sequence: this.menus.length + 1
       };
-      this.$refs.ModifyMenu.open();
+      this.$refs.ModifyPrivilege.open();
     },
     edit(node, data) {
       this.curMenu = {
@@ -92,7 +92,7 @@ export default {
         parentName: data.parentId && node.parent.data.name
       };
       this.parentData = data;
-      this.$refs.ModifyMenu.open();
+      this.$refs.ModifyPrivilege.open();
     },
     remove(node, data) {
       const name = node.parent.label
@@ -129,7 +129,7 @@ export default {
         sequence: maxSequence + 1
       };
       this.parentData = data;
-      this.$refs.ModifyMenu.open();
+      this.$refs.ModifyPrivilege.open();
     },
     menuModified(curNode) {
       if (!this.curMenu.parentName) {

+ 77 - 0
src/modules/admin/views/SystemRoleManage.vue

@@ -0,0 +1,77 @@
+<template>
+  <div class="role-manage">
+    <div class="part-box">
+      <el-table ref="TableList" :data="roles" border stripe>
+        <el-table-column
+          type="index"
+          label="序号"
+          width="70"
+          align="center"
+          :index="indexMethod"
+        ></el-table-column>
+        <el-table-column prop="name" label="角色名称"></el-table-column>
+        <el-table-column
+          class-name="action-column"
+          label="操作"
+          align="center"
+          width="120px"
+        >
+          <template slot-scope="scope">
+            <el-button
+              class="btn-table-icon"
+              type="text"
+              icon="icon icon-edit"
+              @click="toEdit(scope.row)"
+              title="编辑"
+            ></el-button>
+          </template>
+        </el-table-column>
+      </el-table>
+    </div>
+    <!-- ModifySystemRole -->
+    <modify-system-role
+      ref="ModifySystemRole"
+      :instance="curRole"
+      @modified="getList"
+    ></modify-system-role>
+  </div>
+</template>
+
+<script>
+import { ABLE_TYPE } from "@/constants/enumerate";
+import { userRoleListPage } from "../api";
+import ModifySystemRole from "../components/ModifySystemRole";
+
+export default {
+  name: "role-manage",
+  components: {
+    ModifySystemRole
+  },
+  data() {
+    return {
+      roles: [],
+      curRole: {},
+      ABLE_TYPE,
+      ROLE_TYPE: {}
+    };
+  },
+  created() {
+    this.toPage(1);
+  },
+  methods: {
+    async getList() {
+      const data = await userRoleListPage();
+      this.roles = data || [];
+      this.roles = this.roles.filter(item => item.type !== "ADMIN");
+    },
+    toPage(page) {
+      this.current = page;
+      this.getList();
+    },
+    toEdit(row) {
+      this.curRole = row;
+      this.$refs.ModifySystemRole.open();
+    }
+  }
+};
+</script>

+ 5 - 8
src/modules/base/api.js

@@ -22,6 +22,9 @@ export const updatePwd = datas => {
 export const userBindRoles = ({ id, roleIds }) => {
   return $post("/api/admin/sys/user/bind_roles", { id, roleIds });
 };
+export const userRoleListPage = () => {
+  return $postParam("/api/admin/sys/role/list_to_user", {});
+};
 
 // role-manage
 export const roleListPage = datas => {
@@ -40,14 +43,8 @@ export const userBoundRoles = userId => {
   return $postParam("/api/admin/sys/role/get_user_roles", { userId });
 };
 // menu-manage
-export const menuList = datas => {
-  return $postParam("/api/admin/sys/privilege/list", datas);
-};
-export const updateMenu = datas => {
-  return $post("/api/admin/sys/privilege/save", datas);
-};
-export const deleteMenu = id => {
-  return $post("/api/admin/sys/privilege/remove", { id });
+export const menuAuthList = datas => {
+  return $postParam("/api/admin/sys/privilege/list_auth", datas);
 };
 export const roleBoundPrivileges = roleId => {
   return $postParam("/api/admin/sys/privilege/get_role_privileges", { roleId });

+ 10 - 29
src/modules/base/components/ModifyRole.vue

@@ -25,22 +25,8 @@
             clearable
           ></el-input>
         </el-form-item>
-        <el-form-item prop="type" label="角色类型:">
-          <el-select
-            v-model="modalForm.type"
-            style="width: 100%;"
-            placeholder="请选择"
-          >
-            <el-option
-              v-for="(val, key) in roleTypes"
-              :key="key"
-              :value="key"
-              :label="val"
-            ></el-option>
-          </el-select>
-        </el-form-item>
         <el-form-item
-          v-show="modalForm.type === 'CUSTOM' || IS_SUPER_ADMIN"
+          v-show="modalForm.type === 'CUSTOM'"
           prop="privilegeIds"
           label="角色权限:"
         >
@@ -59,7 +45,7 @@
             >
               <span class="custom-tree-node" slot-scope="{ node, data }">
                 <span
-                  ><i class="el-icon-s-check" v-if="data.type === 'LINK'"></i>
+                  ><i class="el-icon-link" v-if="data.type === 'URL'"></i>
                   {{ node.label }}</span
                 >
               </span>
@@ -78,13 +64,12 @@
 </template>
 
 <script>
-import { updateRole, menuList, roleBoundPrivileges } from "../api";
-import { SYS_ADMIN_NAME } from "@/constants/enumerate";
+import { updateRole, menuAuthList, roleBoundPrivileges } from "../api";
 
 const initModalForm = {
   id: null,
   name: "",
-  type: "",
+  type: "CUSTOM",
   privilegeIds: []
 };
 
@@ -96,12 +81,6 @@ export default {
       default() {
         return {};
       }
-    },
-    roleTypes: {
-      type: Object,
-      default() {
-        return {};
-      }
     }
   },
   computed: {
@@ -116,8 +95,6 @@ export default {
     return {
       modalIsShow: false,
       isSubmit: false,
-      IS_SUPER_ADMIN:
-        this.$ls.get("user", { loginName: "" }).loginName === SYS_ADMIN_NAME,
       menus: [],
       defaultExpandedKeys: [],
       modalForm: {},
@@ -161,14 +138,18 @@ export default {
   },
   methods: {
     async getMenus() {
-      this.menus = await menuList();
+      const data = await menuAuthList();
+      if (data)
+        this.menus = data.filter(
+          item => item.url !== "common" && item.url !== "customer"
+        );
       this.defaultExpandedKeys = [];
       this.getDefaultExpandedKeys(this.menus);
     },
     async visibleChange() {
       if (this.instance.id) {
         this.modalForm = this.$objAssign(initModalForm, this.instance);
-        if (this.instance.type === "CUSTOM" || this.IS_SUPER_ADMIN) {
+        if (this.instance.type === "CUSTOM") {
           let privilegeIds = await roleBoundPrivileges(this.instance.id);
           privilegeIds = privilegeIds || [];
           let checkedIds = [];

+ 1 - 22
src/modules/base/components/ModifyUser.vue

@@ -24,12 +24,6 @@
             placeholder="请输入用户名"
             :disabled="isEdit"
           ></el-input>
-          <!-- <el-input
-            style="width:100%;"
-            v-model.trim="modalForm.loginName"
-            placeholder="请输入用户名"
-            disabled
-          ></el-input> -->
         </el-form-item>
         <el-form-item prop="realName" label="姓名:">
           <el-input
@@ -85,7 +79,7 @@
             </el-option>
           </el-select>
         </el-form-item>
-        <el-form-item prop="orgId" label="所属学院:">
+        <el-form-item label="所属学院:">
           <select-orgs
             ref="SelectOrgs"
             v-model="modalForm.orgId"
@@ -162,14 +156,6 @@ export default {
         callback();
       }
     };
-    const orgIdValidator = (rule, value, callback) => {
-      if (!value || !value.length) {
-        callback(new Error("请选择所属学院"));
-      } else {
-        callback();
-      }
-    };
-
     return {
       modalIsShow: false,
       isSubmit: false,
@@ -203,13 +189,6 @@ export default {
             validator: courseIdsValidator,
             trigger: "change"
           }
-        ],
-        orgId: [
-          {
-            required: true,
-            validator: orgIdValidator,
-            trigger: "change"
-          }
         ]
       },
       user: {},

+ 0 - 6
src/modules/base/router.js

@@ -2,7 +2,6 @@
 import OrganizationManage from "./views/OrganizationManage.vue";
 import RoleManage from "./views/RoleManage.vue";
 import UserManage from "./views/UserManage.vue";
-import MenuManage from "./views/MenuManage.vue";
 // rule
 import CommonRule from "./views/CommonRule.vue";
 import CardRuleManage from "./views/CardRuleManage.vue";
@@ -27,11 +26,6 @@ export default [
     name: "UserManage",
     component: UserManage
   },
-  {
-    path: "/base/menu-manage",
-    name: "MenuManage",
-    component: MenuManage
-  },
   {
     path: "/base/common-rule",
     name: "CommonRule",

+ 2 - 24
src/modules/base/views/RoleManage.vue

@@ -47,11 +47,6 @@
           :index="indexMethod"
         ></el-table-column>
         <el-table-column prop="name" label="角色名称"></el-table-column>
-        <el-table-column prop="type" label="角色类型">
-          <template slot-scope="scope">
-            {{ ROLE_TYPE[scope.row.type] || "--" }}
-          </template>
-        </el-table-column>
         <el-table-column prop="enable" label="启用/禁用">
           <template slot-scope="scope">
             {{ scope.row.enable | enableFilter }}
@@ -113,16 +108,14 @@
     <modify-role
       ref="ModifyRole"
       :instance="curRole"
-      :role-types="ROLE_TYPE"
       @modified="getList"
     ></modify-role>
   </div>
 </template>
 
 <script>
-import { ABLE_TYPE, SYS_ADMIN_NAME } from "@/constants/enumerate";
+import { ABLE_TYPE } from "@/constants/enumerate";
 import { roleListPage, ableRole, deleteRole } from "../api";
-import { getEnums } from "../../login/api";
 import ModifyRole from "../components/ModifyRole";
 
 export default {
@@ -146,24 +139,9 @@ export default {
     };
   },
   created() {
-    this.init();
+    this.toPage(1);
   },
   methods: {
-    async init() {
-      await this.getRoleTypes();
-      await this.getList();
-    },
-    async getRoleTypes() {
-      const loginName = this.$ls.get("user", { loginName: "" }).loginName;
-      const data = await getEnums("ROLE_TYPE");
-      let ROLE_TYPE = {};
-      data.forEach(element => {
-        if (loginName !== SYS_ADMIN_NAME && element.name === "CUSTOMER") return;
-
-        ROLE_TYPE[element.name] = element.desc;
-      });
-      this.ROLE_TYPE = ROLE_TYPE;
-    },
     async getList() {
       const datas = {
         ...this.filter,

+ 3 - 3
src/modules/base/views/UserManage.vue

@@ -166,7 +166,7 @@
 import UploadButton from "@/components/UploadButton";
 import ModifyUser from "../components/ModifyUser";
 import { ABLE_TYPE } from "@/constants/enumerate";
-import { userListPage, ableUser, resetPwd, roleListPage } from "../api";
+import { userListPage, ableUser, resetPwd, userRoleListPage } from "../api";
 import { logout } from "@/modules/login/api";
 
 export default {
@@ -201,8 +201,8 @@ export default {
   },
   methods: {
     async getRoleList() {
-      const data = await roleListPage({ pageNumber: 1, pageSize: 100 });
-      this.roles = data.records;
+      const data = await userRoleListPage();
+      this.roles = data || [];
     },
     async getList() {
       const datas = {

+ 2 - 2
src/modules/customer/views/CustomerCard.vue

@@ -14,7 +14,7 @@
         <el-form-item label="学校名称:">
           <school-select v-model="filter.schoolId"></school-select>
         </el-form-item>
-        <el-form-item label="试卷编号:">
+        <!-- <el-form-item label="试卷编号:">
           <paper-number-select
             ref="PaperNumberSelect"
             v-model="filter.paperNumber"
@@ -29,7 +29,7 @@
             :school-id="filter.schoolId"
             placeholder="请选择"
           ></question-teacher-select>
-        </el-form-item>
+        </el-form-item> -->
         <el-form-item label="申请时间:">
           <el-date-picker
             v-model="createTime"

+ 8 - 0
src/modules/login/views/SelectSchool.vue

@@ -18,6 +18,11 @@
               >确定</el-button
             >
           </el-form-item>
+          <el-form-item>
+            <el-button style="width:100%;" type="warning" @click="toAdmin"
+              >进入超管中心<i class="el-icon-arrow-right"></i
+            ></el-button>
+          </el-form-item>
         </el-form>
       </div>
     </div>
@@ -41,6 +46,9 @@ export default {
     schoolChange(school) {
       this.curSchool = school;
     },
+    toAdmin() {
+      this.$router.push({ name: "Admin" });
+    },
     async confirm() {
       const valid = await this.$refs.modalFormComp.validate().catch(() => {});
       if (!valid) return;

+ 3 - 0
src/router.js

@@ -12,6 +12,8 @@ import print from "./modules/print/router";
 import customer from "./modules/customer/router";
 // card part
 import card from "./modules/card/router";
+// admin
+import admin from "./modules/admin/router";
 
 // ignore NavigationDuplicated. https://github.com/vuejs/vue-router/issues/2881
 const originalPush = Router.prototype.push;
@@ -42,6 +44,7 @@ export default new Router({
       children: [...base, ...exam, ...print, ...customer]
     },
     { ...login },
+    { ...admin },
     ...card,
     {
       path: "*",

+ 63 - 2
src/views/Home.vue

@@ -113,7 +113,68 @@
     </div>
 
     <!-- popover menu-->
-    <!-- TODO: -->
+    <el-dialog
+      class="menu-dialog"
+      :visible.sync="menuDailogIsShow"
+      title="导航菜单"
+      top="60px"
+      fullscreen
+      :close-on-click-modal="false"
+      :close-on-press-escape="false"
+      append-to-body
+    >
+      <div
+        class="home-navs home-navs-full"
+        v-for="(curMenu, mainNo) in menus"
+        :key="mainNo"
+      >
+        <div
+          v-for="(submenu, sindex) in curMenu.children"
+          :key="sindex"
+          class="nav-part"
+        >
+          <div class="nav-head">
+            <i :class="submenu.icon"></i>
+            <span>{{ curMenu.title }} - {{ submenu.title }}</span>
+          </div>
+          <ul class="nav-list">
+            <li
+              class="nav-item"
+              v-for="(nav, navNo) in submenu.children"
+              :key="navNo"
+            >
+              <div
+                :class="[
+                  'nav-item-main',
+                  { 'nav-item-main-act': curActNav === nav.router }
+                ]"
+                @click="toNav(nav)"
+              >
+                <p class="nav-item-cont">{{ nav.title }}</p>
+                <span class="nav-item-icon nav-item-icon-right">
+                  <i
+                    :class="[
+                      'icon',
+                      curActNav === nav.router
+                        ? 'icon-arrow-right-act'
+                        : 'icon-arrow-right'
+                    ]"
+                  ></i>
+                </span>
+                <span
+                  class="nav-item-info"
+                  v-if="nav.router === 'WaitTask' && waitTaskCount"
+                  >{{ waitTaskCount }}</span
+                >
+              </div>
+            </li>
+          </ul>
+        </div>
+      </div>
+      <div class="menu-logout" @click="toLogout">
+        <i class="el-icon-switch-button"></i>
+      </div>
+    </el-dialog>
 
     <!-- 修改密码 -->
     <reset-pwd @modified="logoutAction" ref="ResetPwd"></reset-pwd>
@@ -217,7 +278,6 @@ export default {
       };
 
       this.validRoutes = validRoutes;
-      // TODO:只有设置需要审核的情况才能显示入库审核页面
 
       return { menus: anchorNav(navTree), firstRouter };
     },
@@ -230,6 +290,7 @@ export default {
       if (nav.router === this.$route.name) return;
       this.curActNav = nav.router;
       this.$router.push({ name: nav.router });
+      this.menuDailogIsShow = false;
     },
     actCurNav() {
       const routerName = this.$route.name;

+ 1418 - 0
src/views/roles/menus.js

@@ -0,0 +1,1418 @@
+export default [
+  {
+    id: "1",
+    name: "基础配置",
+    url: "base",
+    type: "MENU",
+    parentId: null,
+    sequence: 1,
+    children: [
+      {
+        id: "2",
+        name: "用户管理",
+        url: "user",
+        type: "MENU",
+        parentId: 1,
+        sequence: 1,
+        children: [
+          {
+            id: "4",
+            name: "组织架构",
+            url: "OrganizationManage",
+            type: "MENU",
+            parentId: 2,
+            sequence: 1,
+            children: [
+              {
+                id: "92",
+                name: "组织机构-查询",
+                url: "/api/admin/sys/org/list",
+                type: "URL",
+                parentId: 4,
+                sequence: 1,
+                children: []
+              },
+              {
+                id: "93",
+                name: "组织机构-新增/修改",
+                url: "/api/admin/sys/org/save",
+                type: "URL",
+                parentId: 4,
+                sequence: 2,
+                children: []
+              },
+              {
+                id: "94",
+                name: "组织机构-删除",
+                url: "/api/admin/sys/org/remove",
+                type: "URL",
+                parentId: 4,
+                sequence: 3,
+                children: []
+              },
+              {
+                id: "95",
+                name: "组织机构-启用/禁用",
+                url: "/api/admin/sys/org/enable",
+                type: "URL",
+                parentId: 4,
+                sequence: 4,
+                children: []
+              }
+            ]
+          },
+          {
+            id: "5",
+            name: "用户管理",
+            url: "UserManage",
+            type: "MENU",
+            parentId: 2,
+            sequence: 2,
+            children: [
+              {
+                id: "77",
+                name: "用户管理-查询",
+                url: "/api/admin/sys/user/list",
+                type: "URL",
+                parentId: 5,
+                sequence: 1,
+                children: []
+              },
+              {
+                id: "78",
+                name: "用户管理-新增/修改",
+                url: "/api/admin/sys/user/save",
+                type: "URL",
+                parentId: 5,
+                sequence: 2,
+                children: []
+              },
+              {
+                id: "79",
+                name: "用户管理-启用/禁用",
+                url: "/api/admin/sys/user/enable",
+                type: "URL",
+                parentId: 5,
+                sequence: 3,
+                children: []
+              },
+              {
+                id: "80",
+                name: "用户管理-重置密码",
+                url: "/api/admin/sys/user/reset_password",
+                type: "URL",
+                parentId: 5,
+                sequence: 4,
+                children: []
+              },
+              {
+                id: "81",
+                name: "用户管理-导入",
+                url: "/api/admin/sys/user/import",
+                type: "URL",
+                parentId: 5,
+                sequence: 5,
+                children: []
+              },
+              {
+                id: "82",
+                name: "用户管理-绑定角色",
+                url: "/api/admin/sys/user/bind_roles",
+                type: "URL",
+                parentId: 5,
+                sequence: 6,
+                children: []
+              }
+            ]
+          },
+          {
+            id: "6",
+            name: "角色管理",
+            url: "RoleManage",
+            type: "MENU",
+            parentId: 2,
+            sequence: 3,
+            children: [
+              {
+                id: "83",
+                name: "角色管理-查询",
+                url: "/api/admin/sys/role/list",
+                type: "URL",
+                parentId: 6,
+                sequence: 1,
+                children: []
+              },
+              {
+                id: "84",
+                name: "角色管理-删除",
+                url: "/api/admin/sys/role/remove",
+                type: "URL",
+                parentId: 6,
+                sequence: 2,
+                children: []
+              },
+              {
+                id: "85",
+                name: "角色管理-新增/修改",
+                url: "/api/admin/sys/role/save",
+                type: "URL",
+                parentId: 6,
+                sequence: 3,
+                children: []
+              },
+              {
+                id: "86",
+                name: "角色管理-启用/禁用",
+                url: "/api/admin/sys/role/enable",
+                type: "URL",
+                parentId: 6,
+                sequence: 4,
+                children: []
+              },
+              {
+                id: "87",
+                name: "角色管理-用户已绑定角色列表",
+                url: "/api/admin/sys/role/get_user_roles",
+                type: "URL",
+                parentId: 6,
+                sequence: 5,
+                children: []
+              }
+            ]
+          },
+          {
+            id: "7",
+            name: "权限管理",
+            url: "MenuManage",
+            type: "MENU",
+            parentId: 2,
+            sequence: 4,
+            children: [
+              {
+                id: "88",
+                name: "权限管理-查询",
+                url: "/api/admin/sys/privilege/list",
+                type: "URL",
+                parentId: 7,
+                sequence: 1,
+                children: []
+              },
+              {
+                id: "89",
+                name: "权限管理-新增/修改",
+                url: "/api/admin/sys/privilege/save",
+                type: "URL",
+                parentId: 7,
+                sequence: 2,
+                children: []
+              },
+              {
+                id: "90",
+                name: "权限管理-删除",
+                url: "/api/admin/sys/privilege/remove",
+                type: "URL",
+                parentId: 7,
+                sequence: 3,
+                children: []
+              },
+              {
+                id: "91",
+                name: "权限管理-角色已绑定权限列表",
+                url: "/api/admin/sys/privilege/get_role_privileges",
+                type: "URL",
+                parentId: 7,
+                sequence: 4,
+                children: []
+              }
+            ]
+          }
+        ]
+      },
+      {
+        id: "3",
+        name: "配置管理",
+        url: "rule",
+        type: "MENU",
+        parentId: 1,
+        sequence: 2,
+        children: [
+          {
+            id: "8",
+            name: "通用规则",
+            url: "CommonRule",
+            type: "MENU",
+            parentId: 3,
+            sequence: 1,
+            children: [
+              {
+                id: "99",
+                name: "考务规则-查询",
+                url: "/api/admin/basic/exam_rule/list",
+                type: "URL",
+                parentId: 8,
+                sequence: 1,
+                children: []
+              },
+              {
+                id: "100",
+                name: "考务规则-新增/修改",
+                url: "/api/admin/basic/exam_rule/save",
+                type: "URL",
+                parentId: 8,
+                sequence: 2,
+                children: []
+              }
+            ]
+          },
+          {
+            id: "9",
+            name: "题卡规则管理",
+            url: "CardRuleManage",
+            type: "MENU",
+            parentId: 3,
+            sequence: 2,
+            children: [
+              {
+                id: "101",
+                name: "题卡规则-查询",
+                url: "/api/admin/basic/card_rule/list",
+                type: "URL",
+                parentId: 9,
+                sequence: 1,
+                children: []
+              },
+              {
+                id: "102",
+                name: "题卡规则-查询单个",
+                url: "/api/admin/basic/card_rule/get_one",
+                type: "URL",
+                parentId: 9,
+                sequence: 2,
+                children: []
+              },
+              {
+                id: "103",
+                name: "题卡规则-新增/修改",
+                url: "/api/admin/basic/card_rule/save",
+                type: "URL",
+                parentId: 9,
+                sequence: 3,
+                children: []
+              },
+              {
+                id: "104",
+                name: "题卡规则-启用/禁用",
+                url: "/api/admin/basic/card_rule/enable",
+                type: "URL",
+                parentId: 9,
+                sequence: 4,
+                children: []
+              }
+            ]
+          },
+          {
+            id: "10",
+            name: "通卡模板",
+            url: "CommonCardTemplate",
+            type: "MENU",
+            parentId: 3,
+            sequence: 3,
+            children: [
+              {
+                id: "105",
+                name: "通用模板-查询",
+                url: "/api/admin/basic/template/list",
+                type: "URL",
+                parentId: 10,
+                sequence: 1,
+                children: []
+              },
+              {
+                id: "106",
+                name: "通用模板-新增/修改",
+                url: "/api/admin/basic/template/save",
+                type: "URL",
+                parentId: 10,
+                sequence: 2,
+                children: []
+              },
+              {
+                id: "107",
+                name: "通用模板-启用/禁用",
+                url: "/api/admin/basic/template/enable",
+                type: "URL",
+                parentId: 10,
+                sequence: 3,
+                children: []
+              }
+            ]
+          },
+          {
+            id: "11",
+            name: "变量印品模板",
+            url: "ParamPrintTemplate",
+            type: "MENU",
+            parentId: 3,
+            sequence: 4,
+            children: [
+              {
+                id: "123",
+                name: "变量印品模板-查询",
+                url: "/api/admin/basic/template/list",
+                type: "URL",
+                parentId: 11,
+                sequence: 1,
+                children: []
+              },
+              {
+                id: "124",
+                name: "变量印品模板-新增/修改",
+                url: "/api/admin/basic/template/save",
+                type: "URL",
+                parentId: 11,
+                sequence: 2,
+                children: []
+              },
+              {
+                id: "125",
+                name: "变量印品模板-启用/禁用",
+                url: "/api/admin/basic/template/enable",
+                type: "URL",
+                parentId: 11,
+                sequence: 3,
+                children: []
+              }
+            ]
+          },
+          {
+            id: "12",
+            name: "普通印品模板",
+            url: "CommonPrintTemplate",
+            type: "MENU",
+            parentId: 3,
+            sequence: 5,
+            children: [
+              {
+                id: "126",
+                name: "普通印品模板-查询",
+                url: "/api/admin/basic/template/list",
+                type: "URL",
+                parentId: 12,
+                sequence: 1,
+                children: []
+              },
+              {
+                id: "127",
+                name: "普通印品模板-新增/修改",
+                url: "/api/admin/basic/template/save",
+                type: "URL",
+                parentId: 12,
+                sequence: 2,
+                children: []
+              },
+              {
+                id: "128",
+                name: "普通印品模板-启用/禁用",
+                url: "/api/admin/basic/template/enable",
+                type: "URL",
+                parentId: 12,
+                sequence: 3,
+                children: []
+              }
+            ]
+          },
+          {
+            id: "13",
+            name: "课程管理",
+            url: "CourseManage",
+            type: "MENU",
+            parentId: 3,
+            sequence: 6,
+            children: [
+              {
+                id: "96",
+                name: "课程管理-查询",
+                url: "/api/admin/basic/course/list",
+                type: "URL",
+                parentId: 13,
+                sequence: 1,
+                children: []
+              },
+              {
+                id: "97",
+                name: "课程管理-新增/修改",
+                url: "/api/admin/basic/course/save",
+                type: "URL",
+                parentId: 13,
+                sequence: 2,
+                children: []
+              },
+              {
+                id: "98",
+                name: "课程管理-删除",
+                url: "/api/admin/basic/course/remove",
+                type: "URL",
+                parentId: 13,
+                sequence: 3,
+                children: []
+              }
+            ]
+          }
+        ]
+      }
+    ]
+  },
+  {
+    id: "14",
+    name: "考试中心",
+    url: "exam",
+    type: "MENU",
+    parentId: null,
+    sequence: 2,
+    children: [
+      {
+        id: "15",
+        name: "我的工作台",
+        url: "work",
+        type: "MENU",
+        parentId: 14,
+        sequence: 1,
+        children: [
+          {
+            id: "16",
+            name: "待办任务",
+            url: "WaitTask",
+            type: "MENU",
+            parentId: 15,
+            sequence: 1,
+            children: [
+              {
+                id: "117",
+                name: "命题待办接口",
+                url: "/api/admin/work/exam/task/ready",
+                type: "URL",
+                parentId: 16,
+                sequence: 1,
+                children: []
+              },
+              {
+                id: "118",
+                name: "命题待办计数接口",
+                url: "/api/admin/work/exam/task/ready_count",
+                type: "URL",
+                parentId: 16,
+                sequence: 2,
+                children: []
+              },
+              {
+                id: "119",
+                name: "命题分配待办接口",
+                url: "/api/admin/work/exam/task/new",
+                type: "URL",
+                parentId: 16,
+                sequence: 3,
+                children: []
+              },
+              {
+                id: "120",
+                name: "命题分配待办计数接口",
+                url: "/api/admin/work/exam/task/new_count",
+                type: "URL",
+                parentId: 16,
+                sequence: 4,
+                children: []
+              },
+              {
+                id: "121",
+                name: "审核待办接口",
+                url: "/api/admin/work/exam/task/submit",
+                type: "URL",
+                parentId: 16,
+                sequence: 5,
+                children: []
+              },
+              {
+                id: "122",
+                name: "审核待办计数接口",
+                url: "/api/admin/work/exam/task/submit_count",
+                type: "URL",
+                parentId: 16,
+                sequence: 6,
+                children: []
+              }
+            ]
+          }
+        ]
+      },
+      {
+        id: "37",
+        name: "命题管理",
+        url: "paper",
+        type: "MENU",
+        parentId: 14,
+        sequence: 2,
+        children: [
+          {
+            id: "39",
+            name: "命题任务管理",
+            url: "ExamTaskManage",
+            type: "MENU",
+            parentId: 37,
+            sequence: 1,
+            children: [
+              {
+                id: "63",
+                name: "命题任务管理-查询",
+                url: "/api/admin/exam/task/list",
+                type: "URL",
+                parentId: 39,
+                sequence: 1,
+                children: []
+              },
+              {
+                id: "64",
+                name: "命题任务管理-更改/指派命题老师",
+                url: "/api/admin/exam/task/assign_user",
+                type: "URL",
+                parentId: 39,
+                sequence: 2,
+                children: []
+              },
+              {
+                id: "65",
+                name: "命题任务管理-启用/禁用",
+                url: "/api/admin/exam/task/enable",
+                type: "URL",
+                parentId: 39,
+                sequence: 3,
+                children: []
+              },
+              {
+                id: "66",
+                name: "命题任务管理-新建",
+                url: "/api/admin/exam/task/save",
+                type: "URL",
+                parentId: 39,
+                sequence: 4,
+                children: []
+              },
+              {
+                id: "67",
+                name: "命题任务管理-批量新建-文件导入",
+                url: "/api/admin/exam/task/import",
+                type: "URL",
+                parentId: 39,
+                sequence: 5,
+                children: []
+              },
+              {
+                id: "68",
+                name: "命题任务管理-批量新建",
+                url: "/api/admin/exam/task/save_batch",
+                type: "URL",
+                parentId: 39,
+                sequence: 6,
+                children: []
+              },
+              {
+                id: "69",
+                name: "命题任务管理-审核历史",
+                url: "/api/admin/exam/task/review_list",
+                type: "URL",
+                parentId: 39,
+                sequence: 7,
+                children: []
+              },
+              {
+                id: "169",
+                name: "命题任务管理-根据课程查询命题老师",
+                url: "/api/admin/sys/user/user_list",
+                type: "URL",
+                parentId: 39,
+                sequence: 7,
+                children: []
+              }
+            ]
+          },
+          {
+            id: "40",
+            name: "入库申请",
+            url: "TaskApplyManage",
+            type: "MENU",
+            parentId: 37,
+            sequence: 2,
+            children: [
+              {
+                id: "70",
+                name: "入库申请-查询",
+                url: "/api/admin/exam/task/apply_list",
+                type: "URL",
+                parentId: 40,
+                sequence: 1,
+                children: []
+              },
+              {
+                id: "71",
+                name: "入库申请-提交/暂存",
+                url: "/api/admin/exam/task/apply_save",
+                type: "URL",
+                parentId: 40,
+                sequence: 2,
+                children: []
+              },
+              {
+                id: "72",
+                name: "入库申请-撤回/重新申请",
+                url: "/api/admin/exam/task/apply_status",
+                type: "URL",
+                parentId: 40,
+                sequence: 3,
+                children: []
+              },
+              {
+                id: "167",
+                name: "入库申请-查询可选择题卡",
+                url: "/api/admin/exam/card/select_card_list",
+                type: "URL",
+                parentId: 40,
+                sequence: 4,
+                children: []
+              },
+              {
+                id: "168",
+                name: "入库申请-查询申请详情",
+                url: "/api/admin/exam/task/apply_get_one",
+                type: "URL",
+                parentId: 40,
+                sequence: 5,
+                children: []
+              },
+              {
+                id: "174",
+                name: "入库申请-申请客服制卡",
+                url: "/api/admin/exam/card/cust_save",
+                type: "URL",
+                parentId: 40,
+                sequence: 6,
+                children: []
+              }
+            ]
+          },
+          {
+            id: "41",
+            name: "入库审核",
+            url: "TaskReviewManage",
+            type: "MENU",
+            parentId: 37,
+            sequence: 3,
+            children: [
+              {
+                id: "73",
+                name: "入库审核-查询未审核",
+                url: "/api/admin/exam/task/review_list_unaudited",
+                type: "URL",
+                parentId: 41,
+                sequence: 1,
+                children: []
+              },
+              {
+                id: "74",
+                name: "入库审核-审核",
+                url: "/api/admin/exam/task/review_save",
+                type: "URL",
+                parentId: 41,
+                sequence: 2,
+                children: []
+              },
+              {
+                id: "75",
+                name: "入库审核-批量审核",
+                url: "/api/admin/exam/task/review_save_batch",
+                type: "URL",
+                parentId: 41,
+                sequence: 3,
+                children: []
+              },
+              {
+                id: "163",
+                name: "入库审核-导出审核样本",
+                url: "/api/admin/exam/task/review_export",
+                type: "URL",
+                parentId: 41,
+                sequence: 4,
+                children: []
+              },
+              {
+                id: "166",
+                name: "入库审核-查询已审核",
+                url: "/api/admin/exam/task/review_list_audited",
+                type: "URL",
+                parentId: 41,
+                sequence: 5,
+                children: []
+              }
+            ]
+          },
+          {
+            id: "42",
+            name: "卷库查询",
+            url: "TaskPaperManage",
+            type: "MENU",
+            parentId: 37,
+            sequence: 4,
+            children: [
+              {
+                id: "76",
+                name: "卷库查询-查询",
+                url: "/api/admin/exam/task/paper_list",
+                type: "URL",
+                parentId: 42,
+                sequence: 1,
+                children: []
+              },
+              {
+                id: "164",
+                name: "卷库查询-下载试卷",
+                url: "/api/admin/exam/task/paper_download",
+                type: "URL",
+                parentId: 42,
+                sequence: 2,
+                children: []
+              },
+              {
+                id: "165",
+                name: "卷库查询-试卷启用/禁用",
+                url: "/api/admin/exam/task/paper_enable",
+                type: "URL",
+                parentId: 42,
+                sequence: 3,
+                children: []
+              }
+            ]
+          }
+        ]
+      },
+      {
+        id: "38",
+        name: "印刷管理",
+        url: "print",
+        type: "MENU",
+        parentId: 14,
+        sequence: 3,
+        children: [
+          {
+            id: "43",
+            name: "印刷计划管理",
+            url: "PrintPlanManage",
+            type: "MENU",
+            parentId: 38,
+            sequence: 1,
+            children: [
+              {
+                id: "48",
+                name: "印刷计划管理-查询",
+                url: "/api/admin/exam/print/list",
+                type: "URL",
+                parentId: 43,
+                sequence: 1,
+                children: []
+              },
+              {
+                id: "49",
+                name: "印刷计划管理-按类型查询模板",
+                url: "/api/admin/exam/print/get_template",
+                type: "URL",
+                parentId: 43,
+                sequence: 2,
+                children: []
+              },
+              {
+                id: "50",
+                name: "印刷计划管理-新增/修改",
+                url: "/api/admin/exam/print/save",
+                type: "URL",
+                parentId: 43,
+                sequence: 3,
+                children: []
+              },
+              {
+                id: "51",
+                name: "印刷计划管理-删除",
+                url: "/api/admin/exam/print/remove",
+                type: "URL",
+                parentId: 43,
+                sequence: 4,
+                children: []
+              }
+            ]
+          },
+          {
+            id: "44",
+            name: "考务数据导入",
+            url: "BusinessDataExport",
+            type: "MENU",
+            parentId: 38,
+            sequence: 2,
+            children: [
+              {
+                id: "52",
+                name: "考务数据导入-查询",
+                url: "/api/admin/exam/print/data_list",
+                type: "URL",
+                parentId: 44,
+                sequence: 1,
+                children: []
+              },
+              {
+                id: "53",
+                name: "考务数据导入-汇总数据查询",
+                url: "/api/admin/exam/print/data_total",
+                type: "URL",
+                parentId: 44,
+                sequence: 2,
+                children: []
+              },
+              {
+                id: "54",
+                name: "考务数据导入-导入",
+                url: "/api/admin/exam/print/data_import",
+                type: "URL",
+                parentId: 44,
+                sequence: 3,
+                children: []
+              },
+              {
+                id: "55",
+                name: "考务数据导入-查看明细",
+                url: "/api/admin/exam/print/data_detail_list",
+                type: "URL",
+                parentId: 44,
+                sequence: 4,
+                children: []
+              },
+              {
+                id: "157",
+                name: "考务数据导入-模板下载",
+                url: "/api/admin/exam/print/template_download",
+                type: "URL",
+                parentId: 44,
+                sequence: 5,
+                children: []
+              },
+              {
+                id: "158",
+                name: "考务数据导入-结果导出",
+                url: "/api/admin/exam/print/data_export",
+                type: "URL",
+                parentId: 44,
+                sequence: 6,
+                children: []
+              }
+            ]
+          },
+          {
+            id: "45",
+            name: "考务明细查询",
+            url: "BusinessDataDetail",
+            type: "MENU",
+            parentId: 38,
+            sequence: 3,
+            children: [
+              {
+                id: "159",
+                name: "考务明细查询-查询",
+                url: "/api/admin/exam/print/data_detail",
+                type: "URL",
+                parentId: 45,
+                sequence: 1,
+                children: []
+              }
+            ]
+          },
+          {
+            id: "46",
+            name: "关联试卷管理",
+            url: "PlanLinkPaper",
+            type: "MENU",
+            parentId: 38,
+            sequence: 4,
+            children: [
+              {
+                id: "56",
+                name: "关联试卷管理-查询",
+                url: "/api/admin/exam/print/relate_list",
+                type: "URL",
+                parentId: 46,
+                sequence: 1,
+                children: []
+              },
+              {
+                id: "57",
+                name: "关联试卷管理-关联/更换试卷",
+                url: "/api/admin/exam/print/relate_update",
+                type: "URL",
+                parentId: 46,
+                sequence: 2,
+                children: []
+              },
+              {
+                id: "58",
+                name: "关联试卷管理-查询所有试卷编号/关联卷型",
+                url: "/api/admin/exam/print/relate_get_paper_numbers",
+                type: "URL",
+                parentId: 46,
+                sequence: 3,
+                children: []
+              }
+            ]
+          },
+          {
+            id: "47",
+            name: "印刷任务管理",
+            url: "PrintTaskManage",
+            type: "MENU",
+            parentId: 38,
+            sequence: 5,
+            children: [
+              {
+                id: "59",
+                name: "印刷任务管理-查询",
+                url: "/api/admin/exam/print/task_list",
+                type: "URL",
+                parentId: 47,
+                sequence: 1,
+                children: []
+              },
+              {
+                id: "60",
+                name: "印刷任务管理-提交印刷",
+                url: "/api/admin/exam/print/task_submit",
+                type: "URL",
+                parentId: 47,
+                sequence: 2,
+                children: []
+              },
+              {
+                id: "61",
+                name: "印刷任务管理-撤回提交",
+                url: "/api/admin/exam/print/task_cancel",
+                type: "URL",
+                parentId: 47,
+                sequence: 3,
+                children: []
+              },
+              {
+                id: "62",
+                name: "印刷任务管理-汇总数据查询",
+                url: "/api/admin/exam/print/task_total_data",
+                type: "URL",
+                parentId: 47,
+                sequence: 4,
+                children: []
+              },
+              {
+                id: "160",
+                name: "印刷任务管理-重新提交印刷",
+                url: "/api/admin/exam/print/task_resubmit",
+                type: "URL",
+                parentId: 47,
+                sequence: 5,
+                children: []
+              },
+              {
+                id: "161",
+                name: "印刷任务管理-查看PDF",
+                url: "/api/admin/exam/print/task_view_pdf",
+                type: "URL",
+                parentId: 47,
+                sequence: 6,
+                children: []
+              },
+              {
+                id: "162",
+                name: "印刷任务管理-批量下载PDF",
+                url: "/api/admin/exam/print/task_download_pdf",
+                type: "URL",
+                parentId: 47,
+                sequence: 7,
+                children: []
+              }
+            ]
+          }
+        ]
+      },
+      {
+        id: "112",
+        name: "数据管理",
+        url: "data",
+        type: "MENU",
+        parentId: 14,
+        sequence: 4,
+        children: [
+          {
+            id: "113",
+            name: "任务管理",
+            url: "DataTaskManage",
+            type: "MENU",
+            parentId: 112,
+            sequence: 1,
+            children: [
+              {
+                id: "114",
+                name: "任务管理-查询",
+                url: "/api/admin/data/task/query",
+                type: "URL",
+                parentId: 113,
+                sequence: 1,
+                children: []
+              }
+            ]
+          }
+        ]
+      }
+    ]
+  },
+  {
+    id: "170",
+    name: "客服制卡",
+    url: "customer",
+    type: "MENU",
+    parentId: null,
+    sequence: 4,
+    children: [
+      {
+        id: "171",
+        name: "客服制卡",
+        url: "customer",
+        type: "MENU",
+        parentId: 170,
+        sequence: 1,
+        children: [
+          {
+            id: "172",
+            name: "题卡审核",
+            url: "CustomerCard",
+            type: "MENU",
+            parentId: 171,
+            sequence: 1,
+            children: [
+              {
+                id: "173",
+                name: "客服制卡-查询",
+                url: "/api/admin/exam/card/cust_list",
+                type: "URL",
+                parentId: 172,
+                sequence: 1,
+                children: []
+              }
+            ]
+          }
+        ]
+      }
+    ]
+  },
+  {
+    id: "175",
+    name: "题卡管理",
+    url: "card",
+    type: "MENU",
+    parentId: null,
+    sequence: 5,
+    children: [
+      {
+        id: "176",
+        name: "题卡管理-查询题卡规则",
+        url: "/api/admin/basic/card_rule/get_one",
+        type: "URL",
+        parentId: 175,
+        sequence: 1,
+        children: []
+      },
+      {
+        id: "177",
+        name: "题卡管理-查询题卡详情",
+        url: "/api/admin/exam/card/get_one",
+        type: "URL",
+        parentId: 175,
+        sequence: 2,
+        children: []
+      },
+      {
+        id: "178",
+        name: "题卡管理-保存/提交",
+        url: "/api/admin/exam/card/save",
+        type: "URL",
+        parentId: 175,
+        sequence: 3,
+        children: []
+      }
+    ]
+  },
+  {
+    id: "129",
+    name: "公共接口",
+    url: "common",
+    type: "MENU",
+    parentId: null,
+    sequence: 31,
+    children: [
+      {
+        id: "130",
+        name: "用户登录相关",
+        url: "login",
+        type: "MENU",
+        parentId: 129,
+        sequence: 1,
+        children: [
+          {
+            id: "131",
+            name: "用户登录",
+            url: "/api/admin/common/login",
+            type: "URL",
+            parentId: 130,
+            sequence: 1,
+            children: []
+          },
+          {
+            id: "132",
+            name: "查询用户权限",
+            url: "/api/admin/common/get_menu",
+            type: "URL",
+            parentId: 130,
+            sequence: 2,
+            children: []
+          },
+          {
+            id: "133",
+            name: "发送验证码",
+            url: "/api/admin/common/get_verify_code",
+            type: "URL",
+            parentId: 130,
+            sequence: 3,
+            children: []
+          },
+          {
+            id: "134",
+            name: "修改密码",
+            url: "/api/admin/sys/user/update_password",
+            type: "URL",
+            parentId: 130,
+            sequence: 4,
+            children: []
+          },
+          {
+            id: "135",
+            name: "用户登出",
+            url: "/api/admin/common/logout",
+            type: "URL",
+            parentId: 130,
+            sequence: 5,
+            children: []
+          }
+        ]
+      },
+      {
+        id: "136",
+        name: "模糊查询",
+        url: "query",
+        type: "MENU",
+        parentId: 129,
+        sequence: 2,
+        children: [
+          {
+            id: "137",
+            name: "模糊查询-印刷计划",
+            url: "/api/admin/exam/print/query",
+            type: "URL",
+            parentId: 136,
+            sequence: 1,
+            children: []
+          },
+          {
+            id: "138",
+            name: "模糊查询-题卡规则",
+            url: "/api/admin/basic/card_rule/query",
+            type: "URL",
+            parentId: 136,
+            sequence: 2,
+            children: []
+          },
+          {
+            id: "139",
+            name: "模糊查询-课程",
+            url: "/api/admin/basic/course/query",
+            type: "URL",
+            parentId: 136,
+            sequence: 3,
+            children: []
+          },
+          {
+            id: "140",
+            name: "模糊查询-试卷编号",
+            url: "/api/admin/exam/task/paper_number_query",
+            type: "URL",
+            parentId: 136,
+            sequence: 4,
+            children: []
+          },
+          {
+            id: "141",
+            name: "模糊查询-命题老师",
+            url: "/api/admin/exam/task/user_query",
+            type: "URL",
+            parentId: 136,
+            sequence: 5,
+            children: []
+          },
+          {
+            id: "142",
+            name: "模糊查询-考点",
+            url: "/api/admin/exam/print/data_place_query",
+            type: "URL",
+            parentId: 136,
+            sequence: 6,
+            children: []
+          },
+          {
+            id: "143",
+            name: "模糊查询-考场",
+            url: "/api/admin/exam/print/data_room_query",
+            type: "URL",
+            parentId: 136,
+            sequence: 7,
+            children: []
+          }
+        ]
+      },
+      {
+        id: "144",
+        name: "文件相关",
+        url: "file",
+        type: "MENU",
+        parentId: 129,
+        sequence: 3,
+        children: [
+          {
+            id: "145",
+            name: "文件上传",
+            url: "/api/admin/common/file/upload",
+            type: "URL",
+            parentId: 144,
+            sequence: 1,
+            children: []
+          },
+          {
+            id: "146",
+            name: "文件查询",
+            url: "/api/admin/common/file/get_one",
+            type: "URL",
+            parentId: 144,
+            sequence: 2,
+            children: []
+          },
+          {
+            id: "147",
+            name: "文件下载",
+            url: "/api/admin/common/file/download",
+            type: "URL",
+            parentId: 144,
+            sequence: 3,
+            children: []
+          },
+          {
+            id: "148",
+            name: "文件预览",
+            url: "/api/admin/common/file/preview",
+            type: "URL",
+            parentId: 144,
+            sequence: 4,
+            children: []
+          }
+        ]
+      },
+      {
+        id: "149",
+        name: "系统相关",
+        url: "sys",
+        type: "MENU",
+        parentId: 129,
+        sequence: 4,
+        children: [
+          {
+            id: "150",
+            name: "查询枚举类型",
+            url: "/api/admin/common/get_enums",
+            type: "URL",
+            parentId: 149,
+            sequence: 1,
+            children: []
+          },
+          {
+            id: "151",
+            name: "查询学校列表",
+            url: "/api/admin/common/school/list",
+            type: "URL",
+            parentId: 149,
+            sequence: 2,
+            children: []
+          },
+          {
+            id: "152",
+            name: "查询系统参数",
+            url: "/api/admin/common/sys_config/get_one",
+            type: "URL",
+            parentId: 149,
+            sequence: 3,
+            children: []
+          },
+          {
+            id: "153",
+            name: "根据学校代码查询学校信息",
+            url: "/api/admin/common/school/query_by_school_code",
+            type: "URL",
+            parentId: 149,
+            sequence: 4,
+            children: []
+          },
+          {
+            id: "179",
+            name: "查询考务规则",
+            url: "/api/admin/basic/exam_rule/list",
+            type: "URL",
+            parentId: 149,
+            sequence: 5,
+            children: []
+          }
+        ]
+      },
+      {
+        id: "154",
+        name: "其他",
+        url: "other",
+        type: "MENU",
+        parentId: 129,
+        sequence: 5,
+        children: [
+          {
+            id: "155",
+            name: "用户导入(异步)",
+            url: "/api/admin/sys/user/async/import",
+            type: "URL",
+            parentId: 154,
+            sequence: 1,
+            children: []
+          },
+          {
+            id: "156",
+            name: "用户导出",
+            url: "/api/admin/sys/user/export",
+            type: "URL",
+            parentId: 154,
+            sequence: 2,
+            children: []
+          }
+        ]
+      }
+    ]
+  }
+];

+ 19 - 0
src/views/roles/roles.vue

@@ -0,0 +1,19 @@
+<template>
+  <div class="roles">
+    roles
+  </div>
+</template>
+
+<script>
+import menus from "./menus";
+
+export default {
+  name: "roles",
+  data() {
+    return {
+      menus
+    };
+  },
+  methods: {}
+};
+</script>