无人机管理后台前端(已迁走)
罗广辉
2025-10-16 dafd30c91734918c6abb0b30e6f02a3a568a3503
feat: 菜单管理添加app字段
5 files modified
39 ■■■■■ changed files
src/api/system/menu.js 6 ●●●●● patch | view | raw | blame | history
src/api/system/role.js 3 ●●●● patch | view | raw | blame | history
src/store/modules/user.js 2 ●●● patch | view | raw | blame | history
src/views/authority/role.vue 23 ●●●● patch | view | raw | blame | history
src/views/system/menu.vue 5 ●●●●● patch | view | raw | blame | history
src/api/system/menu.js
@@ -98,11 +98,9 @@
    method: 'get',
  });
export const getRoutes = topMenuId =>
export const getRoutes = params =>
  request({
    url: '/blade-system/menu/routes',
    method: 'get',
    params: {
      topMenuId,
    },
    params
  });
src/api/system/role.js
@@ -20,10 +20,11 @@
  });
};
export const grantTree = () => {
export const grantTree = (params) => {
  return request({
    url: '/blade-system/menu/grant-tree',
    method: 'get',
    params
  });
};
src/store/modules/user.js
@@ -280,7 +280,7 @@
        })
      }
      return new Promise(resolve => {
        getRoutes(tenantId).then(res => {
        getRoutes({tenantId,sysType: 1}).then(res => {
          const data = res.data.data;
          let menu = deepClone(data);
          if (!res.data?.data?.length){
src/views/authority/role.vue
@@ -14,9 +14,14 @@
    </avue-crud>
    <el-dialog title="角色权限配置" append-to-body v-model="box" width="345px">
      <el-tabs type="border-card">
        <el-tab-pane label="菜单权限">
        <el-tab-pane label="后台管理">
          <el-tree :data="menuGrantList" show-checkbox node-key="id" ref="treeMenu" :default-checked-keys="menuTreeObj"
            :props="props">
          </el-tree>
        </el-tab-pane>
        <el-tab-pane label="移动app">
          <el-tree :data="menuGrantListApp" show-checkbox node-key="id" ref="treeMenuApp" :default-checked-keys="menuTreeObjApp"
                   :props="props">
          </el-tree>
        </el-tab-pane>
        <!-- <el-tab-pane label="数据权限">
@@ -76,10 +81,12 @@
        value: 'key',
      },
      menuGrantList: [],
      menuGrantListApp: [],
      dataScopeGrantList: [],
      apiScopeGrantList: [],
      apiGrantList: [],
      menuTreeObj: [],
      menuTreeObjApp: [],
      dataScopeTreeObj: [],
      apiScopeTreeObj: [],
      selectionList: [],
@@ -230,11 +237,12 @@
    },
    submit () {
      const menuList = this.$refs.treeMenu.getCheckedKeys()
      const menuListApp = this.$refs.treeMenuApp.getCheckedKeys()
      // const dataScopeList = this.$refs.treeDataScope.getCheckedKeys();
      const dataScopeList = []
      // const apiScopeList = this.$refs.treeApiScope.getCheckedKeys();
      const apiScopeList = []
      grant(this.idsArray, menuList, dataScopeList, apiScopeList).then(() => {
      grant(this.idsArray, [...menuList,...menuListApp], dataScopeList, apiScopeList).then(() => {
        this.box = false
        this.$message({
          type: 'success',
@@ -324,7 +332,7 @@
      this.menuTreeObj = []
      this.dataScopeTreeObj = []
      this.apiScopeTreeObj = []
      grantTree().then(res => {
      grantTree({sysType: 1}).then(res => {
        this.menuGrantList = res.data.data.menu
        this.dataScopeGrantList = res.data.data.dataScope
        this.apiScopeGrantList = res.data.data.apiScope
@@ -332,6 +340,13 @@
          this.menuTreeObj = res.data.data.menu
          this.dataScopeTreeObj = res.data.data.dataScope
          this.apiScopeTreeObj = res.data.data.apiScope
          this.box = true
        })
      })
      grantTree({sysType: 3}).then(res => {
        this.menuGrantListApp = res.data.data.menu
        getRole(this.ids).then(res => {
          this.menuTreeObjApp = res.data.data.menu
          this.box = true
        })
      })
@@ -378,4 +393,4 @@
  },
}
</script>
<style scoped lang="scss"></style>
<style scoped lang="scss"></style>
src/views/system/menu.vue
@@ -38,7 +38,8 @@
  data () {
    return {
      form: {},
      query: {},
      query: {
      },
      loading: true,
      selectionList: [],
      parentId: 0,
@@ -180,10 +181,8 @@
            prop: 'sysType',
            type: 'radio',
            value: 1,
            searchValue: 1,
            search: true,
            searchSpan: 4,
            searchClearable:false,
            dicData: [
              {
                label: '后台管理',