zhanghua
2022-10-28 d4ab8daa939334d634c5ccfe2ccac7d61d17a467
权限菜单加载--未完
6个文件已修改
564 ■■■■■ 已修改文件
src/views/layout/components/Menu/index.vue 220 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/operate/fivepack/shop/components/main/index.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/operate/fivepack/threepack/components/main/index.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/systemSetting/baseSetting/department/index.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/systemSetting/baseSetting/role/updateUser/index.vue 336 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/systemSetting/baseSetting/user/components/main/index.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/layout/components/Menu/index.vue
@@ -5,7 +5,58 @@
      <h2 class="siderbar-title">遂昌执法平台</h2>
      <el-scrollbar>
        <!-- 路由 -->
        <el-menu router class="el-menu-vertical" :default-active="$route.path" >
        <el-menu router class="el-menu-vertical" :default-active="$route.path">
          <!-- <el-submenu
            :index="menu.url ? menu.url : menu.id.toString()"
            v-for="menu in menuList"
            :key="menu.id"
            class="firstMenu"
          >
            <template slot="title">
              <span slot="prefix" class="icon-padding fisrtSpan">
                <svg-icon :icon-class="menu.icon"></svg-icon>
              </span>
              <span class="fisrtSpan">{{ menu.title }}</span>
            </template>
            <template v-if="menu.children.length > 0">
              <el-submenu
                v-for="secondMenu in menu.children"
                :key="secondMenu.id"
                :index="
                  secondMenu.url ? secondMenu.url : secondMenu.id.toString()
                "
                class="secondMenu"
              >
                <template v-if="secondMenu.children.length > 0">
                  <template slot="title">
                    <span class="secondSpan">{{ secondMenu.title }}</span>
                  </template>
                  <el-menu-item
                    v-for="thirdMenu in secondMenu.children"
                    :key="thirdMenu.id"
                    :index="`${thirdMenu.id}`"
                    :route="{ name: thirdMenu.url }"
                    >{{ thirdMenu.title }}</el-menu-item
                  >
                </template>
                <el-menu-item
                  v-else
                  :key="secondMenu.id"
                  :index="`${secondMenu.id}`"
                  :route="{ name: secondMenu.url }"
                  >{{ secondMenu.title }}</el-menu-item
                >
              </el-submenu>
            </template>
            <el-menu-item
              v-else
              :key="menu.id"
              :index="`${menu.id}`"
              :route="{ name: menu.url }"
              >{{ menu.title }}</el-menu-item
            >
          </el-submenu> -->
          <!-- 系统设置模块 -->
          <el-submenu index="/home/system" class="firstMenu">
            <template slot="title">
@@ -21,29 +72,47 @@
                <span class="secondSpan">基本设置</span>
              </template>
              <!-- 用户管理 -->
              <el-menu-item index="/home/system/userSetting/user">用户管理</el-menu-item>
              <el-menu-item index="/home/system/userSetting/user"
                >用户管理</el-menu-item
              >
              <!-- 角色管理 -->
              <el-menu-item index="/home/system/userSetting/role">角色管理</el-menu-item>
              <el-menu-item index="/home/system/userSetting/role"
                >角色管理</el-menu-item
              >
              <!-- 部门管理 -->
              <el-menu-item index="/home/system/userSetting/department">部门管理</el-menu-item>
              <el-menu-item index="/home/system/userSetting/department"
                >部门管理</el-menu-item
              >
            </el-submenu>
            <!-- 平台设置 -->
            <el-submenu index="/home/system/platform" class="secondMenu">
              <template slot="title">
                <span class="secondSpan">门户管理</span>
              </template>
              <el-menu-item index="/home/system/platform/mySetting">自定义菜单</el-menu-item>
              <el-menu-item index="/home/system/platform/portalSetting">logo管理</el-menu-item>
              <el-menu-item index="/home/system/platform/otherInterface">第三方接口管理</el-menu-item>
              <el-menu-item index="/home/system/platform/mySetting"
                >自定义菜单</el-menu-item
              >
              <el-menu-item index="/home/system/platform/portalSetting"
                >logo管理</el-menu-item
              >
              <el-menu-item index="/home/system/platform/otherInterface"
                >第三方接口管理</el-menu-item
              >
            </el-submenu>
            <!-- 设备管理 -->
            <el-submenu index="/home/system/device" class="secondMenu">
              <template slot="title">
                <span class="secondSpan">设备管理</span>
              </template>
              <el-menu-item index="/home/system/device/bayonet">卡口设备管理</el-menu-item>
              <el-menu-item index="/home/system/device/point">点位管理</el-menu-item>
              <el-menu-item index="/home/system/device/grid">网格管理</el-menu-item>
              <el-menu-item index="/home/system/device/bayonet"
                >卡口设备管理</el-menu-item
              >
              <el-menu-item index="/home/system/device/point"
                >点位管理</el-menu-item
              >
              <el-menu-item index="/home/system/device/grid"
                >网格管理</el-menu-item
              >
            </el-submenu>
          </el-submenu>
          <!-- 运营管理模块 -->
@@ -58,26 +127,44 @@
              <template slot="title">
                <span class="secondSpan">基础设置</span>
              </template>
              <el-menu-item index="/home/operate/baseSetting/violation">违规事项设置</el-menu-item>
              <el-menu-item index="/home/operate/baseSetting/illegalBuild">违建事项设置</el-menu-item>
              <el-menu-item index="/home/operate/baseSetting/violation"
                >违规事项设置</el-menu-item
              >
              <el-menu-item index="/home/operate/baseSetting/illegalBuild"
                >违建事项设置</el-menu-item
              >
              <!-- <el-menu-item index="/home/operate/baseSetting/threepack">门前三包设置</el-menu-item> -->
            </el-submenu>
            <el-submenu index="/home/operate/disposal" class="secondMenu">
              <template slot="title">
                <span class="secondSpan">事项处理管理</span>
              </template>
              <el-menu-item index="/home/operate/casepool/pool">案件池</el-menu-item>
              <el-menu-item index="/home/operate/casepool/escalation">上报管理</el-menu-item>
              <el-menu-item index="/home/operate/casepool/dispatch">调度管理</el-menu-item>
              <el-menu-item index="/home/operate/casepool/learn">再学习管理</el-menu-item>
              <el-menu-item index="/home/operate/casepool/notDeal">暂不处理</el-menu-item>
              <el-menu-item index="/home/operate/casepool/pool"
                >案件池</el-menu-item
              >
              <el-menu-item index="/home/operate/casepool/escalation"
                >上报管理</el-menu-item
              >
              <el-menu-item index="/home/operate/casepool/dispatch"
                >调度管理</el-menu-item
              >
              <el-menu-item index="/home/operate/casepool/learn"
                >再学习管理</el-menu-item
              >
              <el-menu-item index="/home/operate/casepool/notDeal"
                >暂不处理</el-menu-item
              >
            </el-submenu>
            <el-submenu index="/home/operate/management" class="secondMenu">
              <template slot="title">
                <span class="secondSpan">审核管理</span>
              </template>
              <el-menu-item index="/home/operate/management">审核管理</el-menu-item>
              <el-menu-item index="/home/operate/management/managementMessage">短信审核管理</el-menu-item>
              <el-menu-item index="/home/operate/management"
                >审核管理</el-menu-item
              >
              <el-menu-item index="/home/operate/management/managementMessage"
                >短信审核管理</el-menu-item
              >
              <!-- <el-menu-item index="/home/operate/baseSetting/threepack">门前三包设置</el-menu-item> -->
            </el-submenu>
            <el-menu-item index="/home/operate/myWait">我的待办</el-menu-item>
@@ -85,27 +172,47 @@
              <template slot="title">
                <span class="secondSpan">专项整治</span>
              </template>
              <el-menu-item index="/home/operate/rectification/taskList">任务列表</el-menu-item>
              <el-menu-item index="/home/operate/rectification/surveyList">普查列表</el-menu-item>
              <el-menu-item index="/home/operate/rectification/renovationList">整治列表</el-menu-item>
              <el-menu-item index="/home/operate/rectification/taskList"
                >任务列表</el-menu-item
              >
              <el-menu-item index="/home/operate/rectification/surveyList"
                >普查列表</el-menu-item
              >
              <el-menu-item index="/home/operate/rectification/renovationList"
                >整治列表</el-menu-item
              >
            </el-submenu>
            <el-menu-item index="/home/operate/lawEnforcement">巡查执法</el-menu-item>
            <el-menu-item index="/home/operate/lawEnforcement"
              >巡查执法</el-menu-item
            >
            <el-menu-item index="/home/operate/dasds">案卷查询</el-menu-item>
            <el-submenu index="/home/operate/fivepack" class="secondMenu">
              <template slot="title">
                <span class="secondSpan">门前五包处置管理</span>
              </template>
              <el-menu-item index="/home/operate/fivepack/threepackage">门前三包</el-menu-item>
              <el-menu-item index="/home/operate/fivepack/shop">店铺管理</el-menu-item>
              <el-menu-item index="/home/operate/fivepack/threepackage"
                >门前三包</el-menu-item
              >
              <el-menu-item index="/home/operate/fivepack/shop"
                >店铺管理</el-menu-item
              >
            </el-submenu>
            <el-menu-item index="/home/operate/dasdas">算法模型管理</el-menu-item>
            <el-menu-item index="/home/operate/dasdas"
              >算法模型管理</el-menu-item
            >
            <el-submenu index="/home/operate/car" class="secondMenu">
              <template slot="title">
                <span class="secondSpan">车辆管理</span>
              </template>
              <el-menu-item index="/home/operate/car/carIndex">车辆管理</el-menu-item>
              <el-menu-item index="/home/operate/car/lawTrajectory">轨迹分析(执法车)</el-menu-item>
              <el-menu-item index="/home/operate/car/soilTrajectory">轨迹分析(渣土车)</el-menu-item>
              <el-menu-item index="/home/operate/car/carIndex"
                >车辆管理</el-menu-item
              >
              <el-menu-item index="/home/operate/car/lawTrajectory"
                >轨迹分析(执法车)</el-menu-item
              >
              <el-menu-item index="/home/operate/car/soilTrajectory"
                >轨迹分析(渣土车)</el-menu-item
              >
            </el-submenu>
            <el-menu-item index="/home/operate">图片管理</el-menu-item>
            <el-menu-item index="/home/operate">视频管理</el-menu-item>
@@ -113,8 +220,12 @@
              <template slot="title">
                <span class="secondSpan">消息管理</span>
              </template>
              <el-menu-item index="/home/operate/message/messageIndex">消息管理</el-menu-item>
              <el-menu-item index="/home/operate/message/mycontrol">栏目管理</el-menu-item>
              <el-menu-item index="/home/operate/message/messageIndex"
                >消息管理</el-menu-item
              >
              <el-menu-item index="/home/operate/message/mycontrol"
                >栏目管理</el-menu-item
              >
            </el-submenu>
            <el-menu-item index="/home/operate">短信管理</el-menu-item>
            <el-menu-item index="/home/operate/log">日志管理</el-menu-item>
@@ -193,27 +304,40 @@
<script>
export default {
  data(){
    return{
    }
  data() {
    return {
      menuList: [],
    };
  },
  created(){
  created() {
    // this.getMenuList();
    this.loadMenu();
  },
  methods:{
  methods: {
    loadMenu() {
      const info = JSON.parse(sessionStorage.getItem("user"));
      var timer;
      if (info && info.menus) {
        clearTimeout(timer);
        this.menuList = info.menus;
        console.log(info.menus);
      } else {
        timer = setInterval(() => {
          this.loadMenu();
        }, 1000);
      }
    },
    // 获取菜单列表
    getMenuList(){
    getMenuList() {
      let arr;
      this.$axios({
        method:'get',
        url:'sccg/system/portal/menu/search_myself'
      })
      .then(res=>{
        method: "get",
        url: "sccg/system/portal/menu/search_myself",
      }).then((res) => {
        console.log(res);
      })
    }
  }
      });
    },
  },
};
</script>
@@ -255,7 +379,7 @@
        background: #07162e;
        text-align: left;
        &:hover>.el-submenu__title {
        &:hover > .el-submenu__title {
          background-color: #092c4a;
        }
@@ -285,7 +409,7 @@
      }
      .secondMenu {
        &:hover>.el-submenu__title {
        &:hover > .el-submenu__title {
          background-color: #092c4a;
        }
@@ -295,7 +419,7 @@
      }
      .thirdMenu {
        &:hover>.el-submenu__title {
        &:hover > .el-submenu__title {
          background-color: #092c4a;
        }
src/views/operate/fivepack/shop/components/main/index.vue
@@ -56,7 +56,7 @@
            search: "",
            dialogUpdate: false,
            userInfo: '',
            totalNum: 200,
            totalNum: 0,
            pageSize: 10,
            currentPage: 1,
            renderFlag: false,
src/views/operate/fivepack/threepack/components/main/index.vue
@@ -60,7 +60,7 @@
            dialogUpdate: false,
            updateFlag: false,
            userInfo: '',
            totalNum: 200,
            totalNum: 0,
            pageSize: 10,
            currentPage: 1,
            renderFlag: false,
src/views/systemSetting/baseSetting/department/index.vue
@@ -159,7 +159,7 @@
      dialogUpdate: false,
      updateFlag: false,
      userInfo: "",
      totalNum: 200,
      totalNum: 0,
      pageSize: 10,
      currentPage: 1,
      context: "",
src/views/systemSetting/baseSetting/role/updateUser/index.vue
@@ -1,189 +1,199 @@
<template>
    <div class="updateUser">
        <main>
            <div class="mainContent">
                <div class="my-tree">
                    <div class="my-tree__wrap">
                        <el-tree ref="tree" :data="roleList" :props="defaultProps" show-checkbox @check="handleCheck"
                            :default-checked-keys="checkedIds" default-expand-all node-key="id">
                        </el-tree>
                    </div>
                    <!-- <div class="my-tree__bottom"></div> -->
                    <!-- <div class="my-tree__right"></div> -->
                </div>
                <div class="selection">
                    <el-button class="cancel" @click="resetRole">取消</el-button>
                    <el-button class="save" @click="saveRole">保存</el-button>
                </div>
            </div>
        </main>
    </div>
  <div class="updateUser">
    <main>
      <div class="mainContent">
        <div class="my-tree">
          <div class="my-tree__wrap">
            <el-tree
              ref="tree"
              :data="roleList"
              :props="defaultProps"
              show-checkbox
              :default-checked-keys="checkedIds"
              default-expand-all
              node-key="id"
            >
            </el-tree>
          </div>
          <!-- <div class="my-tree__bottom"></div> -->
          <!-- <div class="my-tree__right"></div> -->
        </div>
        <div class="selection">
          <el-button class="cancel" @click="resetRole">取消</el-button>
          <el-button class="save" @click="saveRole">保存</el-button>
        </div>
      </div>
    </main>
  </div>
</template>
<script>
export default {
    data() {
        return {
            role: {
                name: '',
                sort: '',
                description: '',
            },
            roleList: [],
            defaultProps: {
                children: 'children',
                label: 'title'
            },
            treeLabel: '',
            treeId: 23,
            checkedIds: [],
            resCheckedIds: [],
  data() {
    return {
      role: {
        name: "",
        sort: "",
        description: "",
      },
      roleList: [],
      defaultProps: {
        children: "children",
        label: "title",
      },
      treeLabel: "",
      treeId: 23,
      checkedIds: [],
      resCheckedIds: [],
    };
  },
  created() {
    const that = this;
    this.getRoleMenus(this.userInfo.id);
    this.getMenuList();
  },
  methods: {
    // 获取系统菜单
    getMenuList() {
      this.$axios({
        method: "get",
        url: "sccg/menu/treeList",
      }).then((res) => {
        this.roleList = res.data;
      });
    },
    // 树形控件复选框点击事件
    handleCheck(data, checked) {
    //   console.log(checked.checkedKeys);
    //   this.checkedIds = checked.checkedKeys;
    //   console.log(this.checkedIds);
    },
    // 保存role
    saveRole() {
      let nodes = this.$refs.tree.getCheckedNodes(false, true);
      const { userInfo } = this;
      this.checkedIds = nodes.map((n) => n.id);
      this.$axios({
        method: "post",
        url:
          "sccg/role/allocMenu?roleId=" +
          userInfo.id +
          "&menuIds=" +
          this.checkedIds,
      }).then((res) => {
        if (res.code === 200) {
          this.$message({
            type: "success",
            message: "修改角色权限成功",
          });
          this.getRoleMenus(userInfo.id);
          this.$emit("changeDialog", { flag: false });
        //   this.getUserList();
        } else {
          this.$message({
            type: "warning",
            message: res.message,
          });
        }
      });
      // this.$emit('changeDialog',{dialogUpdate:false});
    },
    created() {
        const that = this;
        this.getRoleMenus(this.userInfo.id);
        this.getMenuList();
    // 消除role
    resetRole() {
      this.resCheckedIds = [];
      this.$emit("changeDialog", { dialogUpdate: false });
    },
    methods: {
        // 获取系统菜单
        getMenuList() {
            this.$axios({
                method: 'get',
                url: 'sccg/menu/treeList',
            })
                .then(res => {
                    this.roleList = res.data;
                })
        },
        // 树形控件复选框点击事件
        handleCheck(data, checked) {
            console.log(checked.checkedKeys);
            this.checkedIds = checked.checkedKeys;
            console.log(this.checkedIds);
        },
        // 保存role
        saveRole() {
            this.resCheckedIds = [];
            const { userInfo } = this;
            this.resCheckedIds = this.checkedIds;
            this.$axios({
                method: 'post',
                url: 'sccg/role/allocMenu?roleId=' + userInfo.id + '&menuIds=' + this.checkedIds,
            })
                .then(res => {
                    if (res.code === 200) {
                        this.$message({
                            type: 'success',
                            message: '修改角色权限成功',
                        })
                        this.getRoleMenus(userInfo.id);
                        this.$emit('changeDialog', { flag: false });
                        this.getUserList();
                    } else {
                        this.$message({
                            type: 'warning',
                            message: res.message
                        })
                    }
                })
            // this.$emit('changeDialog',{dialogUpdate:false});
        },
        // 消除role
        resetRole() {
            this.resCheckedIds = [];
            this.$emit('changeDialog', { dialogUpdate: false });
        },
        // 获取角色菜单
        getRoleMenus(roleId) {
            this.$axios({
                method: 'get',
                url: `sccg/role/listMenu/${roleId}`
            })
                .then(res => {
                    this.checkedIds = [];
                    res.data.forEach(item => {
                        this.checkedIds.push(item.id);
                    })
                })
        }
    // 获取角色菜单
    getRoleMenus(roleId) {
      this.$axios({
        method: "get",
        url: `sccg/role/listMenu/${roleId}`,
      }).then((res) => {
        this.checkedIds = [];
        res.data.forEach((item) => {
          this.checkedIds.push(item.id);
        });
      });
    },
    props: ['userInfo', 'updateFlag', 'getUserList', 'changeDialog']
}
  },
  props: ["userInfo", "updateFlag", "getUserList", "changeDialog"],
};
</script>
<style lang="scss" scoped>
.updateUser {
    border-radius: 1px;
  border-radius: 1px;
  background-color: #09152f;
  main {
    text-align: left;
    padding: 50px 55px;
    background-color: #09152f;
    main {
        text-align: left;
        padding: 50px 55px;
        background-color: #09152f;
    .mainContent {
      .my-tree {
        height: 200px;
        overflow: hidden;
        background-color: #17324c;
        position: relative;
        border-radius: 4px;
        .mainContent {
            .my-tree {
                height: 200px;
                overflow: hidden;
                background-color: #17324c;
                position: relative;
                border-radius: 4px;
                .my-tree__wrap {
                    overflow-y: scroll;
                    height: 200px;
                }
                .my-tree__bottom {
                    position: absolute;
                    left: 0px;
                    bottom: 0px;
                    background-color: #09152f;
                    width: 100%;
                    height: 20px;
                    border-bottom-left-radius: 4px;
                }
                .my-tree__right {
                    position: absolute;
                    right: 0px;
                    top: 0px;
                    background-color: #09152f;
                    width: 20px;
                    height: 100%;
                }
            }
        .my-tree__wrap {
          overflow-y: scroll;
          height: 200px;
        }
    }
    &::v-deep .el-textarea__inner {
        background-color: #09152f;
        border: 1px solid #17324c;
    }
        .my-tree__bottom {
          position: absolute;
          left: 0px;
          bottom: 0px;
          background-color: #09152f;
          width: 100%;
          height: 20px;
          border-bottom-left-radius: 4px;
        }
    ::v-deep .el-input__inner {
        background-color: #09152f;
        border: 1px solid #17324c;
        .my-tree__right {
          position: absolute;
          right: 0px;
          top: 0px;
          background-color: #09152f;
          width: 20px;
          height: 100%;
        }
      }
    }
  }
  &::v-deep .el-textarea__inner {
    background-color: #09152f;
    border: 1px solid #17324c;
  }
  ::v-deep .el-input__inner {
    background-color: #09152f;
    border: 1px solid #17324c;
  }
}
.selection {
    margin-top: 10px;
    display: flex;
    justify-content: space-between;
  margin-top: 10px;
  display: flex;
  justify-content: space-between;
    .el-button {
        padding: 10px 20px;
        border-radius: 4px;
    }
  .el-button {
    padding: 10px 20px;
    border-radius: 4px;
  }
    .save {
        background-color: #409eff;
        color: #fff;
    }
  .save {
    background-color: #409eff;
    color: #fff;
  }
    .cancel {
        background-color: #09152f;
        color: #4b9bb7;
    }
  .cancel {
    background-color: #09152f;
    color: #4b9bb7;
  }
}
</style>
src/views/systemSetting/baseSetting/user/components/main/index.vue
@@ -112,7 +112,7 @@
            dialogView:false,
            updateFlag: false,
            userInfo: '',
            totalNum: 200,
            totalNum: 0,
            pageSize: 10,
            currentPage: 1,
            renderFlag: false,