田源
2024-12-16 d186b4d37394e4816e0f271fcced4d06b3069454
路由query添加当前页面id&&人员组织管理模块下所有页面按钮权限控制
已修改8个文件
302 ■■■■ 文件已修改
Source/plt-web/plt-web-ui/src/api/user.js 9 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/plt-web/plt-web-ui/src/page/index/sidebar/sidebarItem.vue 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/plt-web/plt-web-ui/src/store/modules/user.js 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/plt-web/plt-web-ui/src/views/modelingMenu/modeling/enumType/index.vue 33 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/plt-web/plt-web-ui/src/views/system/department/index.vue 52 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/plt-web/plt-web-ui/src/views/system/password/index.vue 59 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/plt-web/plt-web-ui/src/views/system/role/index.vue 66 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/plt-web/plt-web-ui/src/views/system/user/index.vue 70 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/plt-web/plt-web-ui/src/api/user.js
@@ -45,4 +45,11 @@
    params
  });
}
// 按钮权限接口
export function getButtons(params) {
  return request({
    url: "/api/smFunctionController/getAllButtons",
    method: "get",
    params
  });
}
Source/plt-web/plt-web-ui/src/page/index/sidebar/sidebarItem.vue
@@ -125,6 +125,10 @@
      }
    },
    open(item) {
      const query = {
        ...item.query,
        id:item.id
      }
      if (this.screen <= 1) this.$store.commit("SET_COLLAPSE");
      if (this.validIsOpen(item)) {
        window.open(item[this.pathKey]);
@@ -136,7 +140,7 @@
            name: item[this.labelKey],
            src: item[this.pathKey]
          }, item.meta),
          query: item.query
          query: query
        });
      }
    }
Source/plt-web/plt-web-ui/src/store/modules/user.js
@@ -17,7 +17,7 @@
    label: propsConfig.label || 'name',
    path: propsConfig.path || 'path',
    icon: propsConfig.icon || 'icon',
    children: propsConfig.children || 'children'
    children: propsConfig.children || 'children',
  }
  const icon = ele[propsDefault.icon];
  ele[propsDefault.icon] = validatenull(icon) ? menu.iconDefault : icon;
@@ -232,7 +232,7 @@
          commit('SET_MENU_ALL', menu)
          commit('SET_MENU', menu)
          //dispatch('GetButtons');s
          dispatch('GetButtons');
          resolve(menu)
        })
      })
@@ -244,6 +244,7 @@
      return new Promise((resolve) => {
        getButtons().then(res => {
          const data = res.data.data;
          console.log('getButton',data)
          commit('SET_PERMISSION', data);
          resolve();
        })
@@ -305,7 +306,7 @@
            Vue.set(children, child.code, true);
          });
        }
        Vue.set(permission_new, item.code, children);
        Vue.set(permission_new, item.id, children);
      });
      state.permission = permission_new;
      setStore({name: "permission", content: permission_new});
Source/plt-web/plt-web-ui/src/views/modelingMenu/modeling/enumType/index.vue
@@ -44,7 +44,7 @@
          width="1000px"
          @close="dialogClose"
        >
          <el-form ref="form" :model="form" :rules="rules" size="small" label-width="100px">
          <el-form ref="form" :model="form" :rules="rules" label-width="100px" size="small">
            <el-row>
              <el-col :span="12">
                <el-form-item label="枚举名称:" prop="id">
@@ -66,7 +66,8 @@
              </el-col>
              <el-col :span="12">
                <el-form-item label="长度:">
                  <el-input-number v-model="form.length" :max="999" :min="1" label="描述文字" style="width: 376px;"></el-input-number>
                  <el-input-number v-model="form.length" :max="999" :min="1" label="描述文字"
                                   style="width: 376px;"></el-input-number>
                </el-form-item>
              </el-col>
              <el-col :span="24">
@@ -105,7 +106,6 @@
            @search-change="checkHandleSearch"
            @search-reset="checkHandleReset"
          >
          </avue-crud>
        </el-dialog>
@@ -117,7 +117,8 @@
    <el-aside width="35%">
      <basic-container>
        <el-descriptions :column="1" border size="medium" style="margin-bottom: 20px" title="枚举信息" :labelStyle="{width:'150px'}">
        <el-descriptions :column="1" :labelStyle="{width:'150px'}" border size="medium" style="margin-bottom: 20px"
                         title="枚举信息">
          <el-descriptions-item>
            <template slot="label">
              名称
@@ -168,6 +169,7 @@
  downloadEnumTemplate
} from "@/api/modeling/enumType/api";
import func from "@/util/func";
import {mapGetters} from "vuex";
import {deleteUser} from "@/api/system/user/api";
export default {
@@ -182,7 +184,7 @@
        refreshBtn: false,
        selection: false,
        index: false,
        header:false,
        header: false,
        calcHeight: -40,
        column: [
          {
@@ -247,13 +249,13 @@
        calcHeight: 50,
        refreshBtn: false,
        selection: false,
        dialogWidth:500,
        dialogWidth: 500,
        column: [
          {
            label: '枚举项名',
            prop: 'name',
            sortable: true,
            span:24,
            span: 24,
            rules: [
              {
                required: true,
@@ -266,7 +268,7 @@
            label: '枚举值',
            prop: 'value',
            sortable: true,
            span:24,
            span: 24,
            rules: [
              {
                required: true,
@@ -278,7 +280,7 @@
          {
            label: '描述',
            prop: 'description',
            span:24
            span: 24
          },
        ]
      },
@@ -304,7 +306,7 @@
        addBtn: false,
        editBtn: false,
        delBtn: false,
        menuWidth:160,
        menuWidth: 160,
        column: [
          {
            label: '枚举名称',
@@ -321,7 +323,7 @@
            label: '返回类型',
            prop: 'enumValueDataTypeText',
            sortable: true,
            width:130
            width: 130
          }
        ]
      },
@@ -331,7 +333,16 @@
      lastIndex: null
    }
  },
  created() {
    console.log(this.$route);
  },
  computed: {
    ...mapGetters(["permission"]),
    permissionList() {
      return {
        viewBtn: this.vaildData(this.permission[this.$route.query.id].VIEW, false),
      };
    },
    lastItem() {
      return this.selectList.length > 0 ? this.selectList[this.selectList.length - 1] : {};
    },
Source/plt-web/plt-web-ui/src/views/system/department/index.vue
@@ -15,21 +15,32 @@
      @current-row-change="handleCurrentRowChange"
    >
      <template slot="menu" slot-scope="{row,size,type}">
        <el-button icon="el-icon-circle-plus-outline" size="small" type="text" @click="handleAdd()">新增子级</el-button>
        <el-button v-if="row.ALLDept !== 'ALLDept'" icon="el-icon-edit" size="small" type="text"
        <el-button v-if="permissionList.departmentAddChildrenBtn" icon="el-icon-circle-plus-outline" size="small"
                   type="text" @click="handleAdd()">新增子级
        </el-button>
        <el-button v-if="row.ALLDept !== 'ALLDept' && permissionList.editBtn" icon="el-icon-edit" size="small"
                   type="text"
                   @click="editBtnClick(row)">编辑
        </el-button>
        <el-button v-if="row.ALLDept !== 'ALLDept'" icon="el-icon-delete" size="small" type="text"
        <el-button v-if="row.ALLDept !== 'ALLDept' && permissionList.delBtn" icon="el-icon-delete" size="small"
                   type="text"
                   @click="rowDeleteHandler(row)">删除
        </el-button>
      </template>
      <template slot="menuLeft" slot-scope="scope">
        <el-button icon="el-icon-school" plain size="small" type="primary" @click="assignMembersHandler">分配成员
        <el-button v-if="permissionList.assignMembersBtn" icon="el-icon-school" plain size="small" type="primary"
                   @click="assignMembersHandler">分配成员
        </el-button>
        <el-button icon="el-icon-user" plain size="small" type="primary" @click="statisticsHandler">统计</el-button>
        <el-button icon="el-icon-upload2" plain size="small" type="primary" @click="upLoadHandler">导入部门</el-button>
        <el-button icon="el-icon-download" plain size="small" type="primary" @click="downLoadHandler">下载导入模板</el-button>
        <el-button v-if="permissionList.statisticsBtn" icon="el-icon-user" plain size="small" type="primary"
                   @click="statisticsHandler">统计
        </el-button>
        <el-button v-if="permissionList.importDepartmentBtn" icon="el-icon-upload2" plain size="small" type="primary"
                   @click="upLoadHandler">导入部门
        </el-button>
        <el-button v-if="permissionList.downloadImportTemplateBtn" icon="el-icon-download" plain size="small"
                   type="primary" @click="downLoadHandler">下载导入模板
        </el-button>
      </template>
    </avue-crud>
@@ -85,6 +96,7 @@
import basicOption from '@/util/basic-option';
import {column} from './option'
import func from "@/util/func";
import {mapGetters} from "vuex";
export default {
  name: "departmentManage",
@@ -95,13 +107,13 @@
        ...basicOption,
        rowKey: 'oid',
        rowParentKey: 'parentId',
        expandRowKeys:[],
        expandRowKeys: [],
        selection: false,
        addBtn: false,
        editBtn: false,
        delBtn: false,
        gridBtn: false,
        menuWidth:280,
        menuWidth: 280,
        highlightCurrentRow: true,
        calcHeight: -50,
        column: column
@@ -117,9 +129,9 @@
        selection: false,
        refreshBtn: false,
        addBtn: false,
        header :false,
        header: false,
        menu: false,
        calcHeight:80,
        calcHeight: 80,
        column: [
          {
            label: '部门',
@@ -152,12 +164,26 @@
      fileUrl: 'api/departmentQueryController/importDept',
    }
  },
  computed: {
    ...mapGetters(["permission"]),
    permissionList() {
      return {
        delBtn: this.vaildData(this.permission[this.$route.query.id].DELETE, false),
        editBtn: this.vaildData(this.permission[this.$route.query.id].EDIT, false),
        assignMembersBtn: this.vaildData(this.permission[this.$route.query.id].assignMembers, false),
        departmentAddChildrenBtn: this.vaildData(this.permission[this.$route.query.id].departmentAddChildren, false),
        downloadImportTemplateBtn: this.vaildData(this.permission[this.$route.query.id].downloadImportTemplate, false),
        importDepartmentBtn: this.vaildData(this.permission[this.$route.query.id].importDepartment, false),
        statisticsBtn: this.vaildData(this.permission[this.$route.query.id].statistics, false),
      };
    },
  },
  methods: {
    // 表格初始化请求
    getTableList() {
      refTree({queryAllLevel: true, 'extandParamsMap[showAllDepartmentNode]': true}).then(res => {
        this.tableData = this.departDtaFormAtter(res.data.treeData);
        this.option.expandRowKeys=[res.data.treeData[0].oid];
        this.option.expandRowKeys = [res.data.treeData[0].oid];
      })
    },
@@ -166,7 +192,7 @@
      return items.map(item => {
        // 转换当前节点的属性
        const formList = {
          expanded:item.expanded,
          expanded: item.expanded,
          oid: item.oid,
          id: item.attributes.id,
          name: item.attributes.name,
Source/plt-web/plt-web-ui/src/views/system/password/index.vue
@@ -16,6 +16,7 @@
    >
      <template slot="menu" slot-scope="{ row, index }">
        <el-button
          v-if="permissionList.editBtn"
          icon="el-icon-edit"
          size="small"
          type="text"
@@ -24,6 +25,7 @@
          编辑
        </el-button>
        <el-button
          v-if="permissionList.delBtn"
          icon="el-icon-delete"
          size="small"
          type="text"
@@ -49,6 +51,7 @@
<script>
import {refDataGrid, deleteDep, addDept, updatePasswordStrateg} from "@/api/system/password/api"
import basicOption from "@/util/basic-option";
import {mapGetters} from "vuex";
export default {
  name: "index",
@@ -56,8 +59,37 @@
    return {
      form: {},
      tableData: [],
      option: {
      page: {
        currentPage: 1,
        pageSize: 10,
        total: 0,
        pageSizes: [10, 30, 50, 100],
      },
      tableLoading: false,
      checkboxlength: "", // 添加存放多选的变量,用于下拉菜单的禁用效果和必填种类是否大于组合方式然后提示用户重新选择
      selectlength: 0,    // 下拉菜单的数据变量
      checkboxlist: "",  // 用于防止change时间冒泡,出现两次弹窗定义的变量
      checkboxNumber: "", // 用于首次点击编辑,判断组合方式是否小于必填种类的变量
      selectNumber: "",   // 存放多选的变量,效果一样,只是用作在编辑模块
      checkboxedit: "",   // 用于判断是否是编辑
      editFlag: false,
      minValue: "",        // 最小长度value
      maxValue: ""         // 最大长度value
    }
  },
  computed: {
    ...mapGetters(["permission"]),
    permissionList() {
      return {
        addBtn: this.vaildData(this.permission[this.$route.query.id].ADD, false),
        editBtn: this.vaildData(this.permission[this.$route.query.id].EDIT, false),
        delBtn: this.vaildData(this.permission[this.$route.query.id].DELETE, false),
      };
    },
    option() {
      return {
        ...basicOption,
        addBtn: this.permissionList.addBtn,
        selection: false,
        menuWidth: 150,
        editBtn: false,
@@ -298,28 +330,13 @@
            }]
          },
        ]
      },
      page: {
        currentPage: 1,
        pageSize: 10,
        total: 0,
        pageSizes: [10, 30, 50, 100],
      },
      tableLoading: false,
      checkboxlength: "", // 添加存放多选的变量,用于下拉菜单的禁用效果和必填种类是否大于组合方式然后提示用户重新选择
      selectlength: 0,    // 下拉菜单的数据变量
      checkboxlist: "",  // 用于防止change时间冒泡,出现两次弹窗定义的变量
      checkboxNumber: "", // 用于首次点击编辑,判断组合方式是否小于必填种类的变量
      selectNumber: "",   // 存放多选的变量,效果一样,只是用作在编辑模块
      checkboxedit: "",   // 用于判断是否是编辑
      editFlag: false,
      minValue: "",        // 最小长度value
      maxValue: ""         // 最大长度value
      }
    }
  },
  methods: {
    // 表格初始化请求
    getTableList() {
      console.log(this.$route)
      this.tableLoading = true;
      refDataGrid(this.page.currentPage, this.page.pageSize).then(res => {
        this.tableData = res.data.data;
@@ -368,7 +385,7 @@
    },
    // 修改
    rowUpdateHandler(row, index, done,loading) {
    rowUpdateHandler(row, index, done, loading) {
      row.combinations = row.requireCharType;
      delete row.requireCharType;
      updatePasswordStrateg(row).then(res => {
@@ -433,8 +450,8 @@
            this.form.requireCharCount = "";
          }
        }
      }else {
        this.form.requireCharCount  = "";
      } else {
        this.form.requireCharCount = "";
      }
      // 处理 必填种类选项禁用
Source/plt-web/plt-web-ui/src/views/system/role/index.vue
@@ -17,12 +17,20 @@
      @row-del="rowDeleteHandler"
    >
      <template slot="menuLeft" slot-scope="scope">
        <el-button icon="el-icon-delete" plain size="small" type="danger" @click="allDelHandler">删除</el-button>
        <el-button icon="el-icon-school" plain size="small" type="primary" @click="assignMembersHandler">分配成员
        <el-button v-if="permissionList.delBtn" icon="el-icon-delete" plain size="small" type="danger"
                   @click="allDelHandler">删除
        </el-button>
        <el-button icon="el-icon-user" plain size="small" type="primary" @click="statisticsHandler">统计</el-button>
        <el-button icon="el-icon-upload2" plain size="small" type="primary" @click="upLoadRole">导入角色</el-button>
        <el-button icon="el-icon-download" plain size="small" type="primary">导出</el-button>
        <el-button v-if="permissionList.assignMembersBtn" icon="el-icon-school" plain size="small" type="primary"
                   @click="assignMembersHandler">分配成员
        </el-button>
        <el-button v-if="permissionList.statisticsBtn" icon="el-icon-user" plain size="small" type="primary"
                   @click="statisticsHandler">统计
        </el-button>
        <el-button v-if="permissionList.importRoleBtn" icon="el-icon-upload2" plain size="small" type="primary"
                   @click="upLoadRole">导入角色
        </el-button>
        <el-button v-if="permissionList.exportBtn" icon="el-icon-download" plain size="small" type="primary">导出
        </el-button>
      </template>
      <template slot="roleClassifyText" slot-scope="{row}">
@@ -79,19 +87,13 @@
import basicOption from "@/util/basic-option";
import {column} from "@/views/system/role/option";
import func from "@/util/func";
import {mapGetters} from "vuex";
export default {
  name: "index",
  data() {
    return {
      tableData: [],
      option: {
        ...basicOption,
        dialogTop: 0,
        dialogWidth: '30%',
        column: column,
        calcHeight: -60,
      },
      page: {
        currentPage: 1,
        pageSize: 10,
@@ -113,7 +115,7 @@
        refreshBtn: false,
        addBtn: false,
        menu: false,
        header:false,
        header: false,
        column: [
          {
            label: '部门',
@@ -141,6 +143,32 @@
      upFileType: ['xls', 'xlsx'],
      fileUrl: 'api/roleQueryController/importRole',
      tipList: ["角色导入只有 名称 和 描述 两列,且名称为必输项不能为空"]
    }
  },
  computed: {
    ...mapGetters(["permission"]),
    permissionList() {
      return {
        addBtn: this.vaildData(this.permission[this.$route.query.id].ADD, false),
        delBtn: this.vaildData(this.permission[this.$route.query.id].DELETE, false),
        editBtn: this.vaildData(this.permission[this.$route.query.id].EDIT, false),
        exportBtn: this.vaildData(this.permission[this.$route.query.id].EXPORT, false),
        assignMembersBtn: this.vaildData(this.permission[this.$route.query.id].assignMembers, false),
        importRoleBtn: this.vaildData(this.permission[this.$route.query.id].importRole, false),
        statisticsBtn: this.vaildData(this.permission[this.$route.query.id].statistics, false),
      };
    },
    option() {
      return {
        ...basicOption,
        addBtn: this.permissionList.addBtn,
        delBtn: this.permissionList.delBtn,
        editBtn: this.permissionList.editBtn,
        dialogTop: 0,
        dialogWidth: '30%',
        column: column,
        calcHeight: -60,
      }
    }
  },
  methods: {
@@ -181,8 +209,12 @@
        row,
        this.$refs.roleCrud,
        this.lastIndex,
        (newIndex) => { this.lastIndex = newIndex; },
        () => { this.selectList = [row]; }
        (newIndex) => {
          this.lastIndex = newIndex;
        },
        () => {
          this.selectList = [row];
        }
      );
    },
@@ -283,8 +315,8 @@
        listUserUnInRoleOid({pkRole: this.selectList[0].oid}),
        listUserByRoleOid({pkRole: this.selectList[0].oid})
      ]).then(([unInRoleRes, byRoleRes]) => {
        this.leftRoleData=[];
        this.rightRoleData=[];
        this.leftRoleData = [];
        this.rightRoleData = [];
        if (unInRoleRes.data.code === 200 && byRoleRes.data.code === 200) {
          const leftData = [...unInRoleRes.data.data, ...byRoleRes.data.data];
          // 组装好穿梭框可用数据
Source/plt-web/plt-web-ui/src/views/system/user/index.vue
@@ -28,21 +28,37 @@
      </template>
      <template #menu="{row,index,size}">
        <el-button icon="el-icon-edit" size="small" type="text" @click.stop="rowEditHandler(row,index)">编辑</el-button>
        <el-button icon="el-icon-delete" size="small" type="text" @click.stop="rowDeleteHandler(row)">删除</el-button>
        <el-button size="small" type="text" @click.stop="stopUserHandler(row)">
        <el-button v-if="permissionList.editBtn" icon="el-icon-edit" size="small" type="text"
                   @click.stop="rowEditHandler(row,index)">编辑
        </el-button>
        <el-button v-if="permissionList.delBtn" icon="el-icon-delete" size="small" type="text"
                   @click.stop="rowDeleteHandler(row)">删除
        </el-button>
        <el-button v-if="permissionList.stopActionBtn" size="small" type="text" @click.stop="stopUserHandler(row)">
          <span v-if="row.status === 0" style="color: #fa3434"><i class="el-icon-video-pause"></i> 停用</span>
          <span v-if="row.status === 1" style="color: #55b61d"><i class="el-icon-video-play"></i> 启用</span>
        </el-button>
      </template>
      <template slot="menuLeft" slot-scope="scope">
        <el-button icon="el-icon-delete" plain size="small" type="danger" @click="allDelHandler">删除</el-button>
        <el-button icon="el-icon-user" plain size="small" type="primary" @click="roleHandler">分配角色</el-button>
        <el-button icon="el-icon-school" plain size="small" type="primary" @click="departmentHandler">分配部门</el-button>
        <el-button icon="el-icon-key" plain size="small" type="success" @click="setPwsHandler">设置密码策略</el-button>
        <el-button icon="el-icon-upload2" plain size="small" type="primary" @click="uploadUser">导入人员</el-button>
        <el-button icon="el-icon-download" plain size="small" type="primary" @click="downloadHandler">下载导入模板</el-button>
        <el-button v-if="permissionList.editBtn" icon="el-icon-delete" plain size="small" type="danger"
                   @click="allDelHandler">删除
        </el-button>
        <el-button v-if="permissionList.assigningRolesBtn" icon="el-icon-user" plain size="small" type="primary"
                   @click="roleHandler">分配角色
        </el-button>
        <el-button v-if="permissionList.distributionDepartmentBtn" icon="el-icon-school" plain size="small"
                   type="primary" @click="departmentHandler">分配部门
        </el-button>
        <el-button v-if="permissionList.setPasswordPolicyBtn" icon="el-icon-key" plain size="small" type="success"
                   @click="setPwsHandler">设置密码策略
        </el-button>
        <el-button v-if="permissionList.importPersonnelBtn" icon="el-icon-upload2" plain size="small" type="primary"
                   @click="uploadUser">导入人员
        </el-button>
        <el-button v-if="permissionList.downloadImportTemplateBtn" icon="el-icon-download" plain size="small"
                   type="primary" @click="downloadHandler">下载导入模板
        </el-button>
      </template>
    </avue-crud>
@@ -124,6 +140,7 @@
} from '@/api/system/user/api'
import {column} from "./option"
import func from '@/util/func'
import {mapGetters} from "vuex";
export default {
  name: "userManage",
@@ -173,14 +190,6 @@
      pwdList: [],
      tableLoading: false,
      tableData: [],
      option: {
        ...basicOption,
        editBtn: false,
        delBtn: false,
        dialogWidth: '50%',
        calcHeight: -60,
        column: column
      },
      page: {
        currentPage: 1,
        pageSize: 10,
@@ -196,7 +205,32 @@
      lastIndex: null,
    }
  },
  created() {
  computed: {
    ...mapGetters(["permission"]),
    permissionList() {
      return {
        addBtn: this.vaildData(this.permission[this.$route.query.id].ADD, false),
        delBtn: this.vaildData(this.permission[this.$route.query.id].DELETE, false),
        editBtn: this.vaildData(this.permission[this.$route.query.id].EDIT, false),
        assigningRolesBtn: this.vaildData(this.permission[this.$route.query.id].assigningRoles, false),
        distributionDepartmentBtn: this.vaildData(this.permission[this.$route.query.id].distributionDepartment, false),
        downloadImportTemplateBtn: this.vaildData(this.permission[this.$route.query.id].downloadImportTemplate, false),
        importPersonnelBtn: this.vaildData(this.permission[this.$route.query.id].importPersonnel, false),
        setPasswordPolicyBtn: this.vaildData(this.permission[this.$route.query.id].setPasswordPolicy, false),
        stopActionBtn: this.vaildData(this.permission[this.$route.query.id].stopAction, false),
      };
    },
    option() {
      return {
        ...basicOption,
        addBtn: this.permissionList.addBtn,
        editBtn: false,
        delBtn: false,
        dialogWidth: '50%',
        calcHeight: -60,
        column: column
      }
    }
  },
  methods: {
    // 表格请求