xiejun
2024-01-23 f09e05514d9a9e2623cfa73c4de1ffa98bb30bf8
Merge remote-tracking branch 'origin/master'
已修改66个文件
已添加1个文件
8618 ■■■■■ 文件已修改
Source/UBCS-WEB/src/api/code/codeCharcter.js 16 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/UBCS-WEB/src/api/docking/data.js 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/UBCS-WEB/src/api/docking/task.js 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/UBCS-WEB/src/api/system/classifyAuth.js 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/UBCS-WEB/src/api/template/templateAttr.js 5 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/UBCS-WEB/src/components/FormTemplate/ThemeChildren.vue 20 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/UBCS-WEB/src/components/Master/MasterTree.vue 10 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/UBCS-WEB/src/components/MasterCrud/VciMasterCrud.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/UBCS-WEB/src/components/Theme/ClassifyAuthDialog.vue 299 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/UBCS-WEB/src/components/Theme/DataAuthDialog.vue 429 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/UBCS-WEB/src/components/Theme/ThemeAttrCrud.vue 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/UBCS-WEB/src/components/Theme/ThemeClassifyTrees.vue 41 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/UBCS-WEB/src/components/code-dialog-page/referConfigFormDialog.vue 160 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/UBCS-WEB/src/main.js 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/UBCS-WEB/src/option/system/dictbiz.js 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/UBCS-WEB/src/option/system/param.js 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/UBCS-WEB/src/views/authority/role.vue 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/UBCS-WEB/src/views/code/Match.vue 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/UBCS-WEB/src/views/code/code.vue 174 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/UBCS-WEB/src/views/desk/notice.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/UBCS-WEB/src/views/docking/data.vue 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/UBCS-WEB/src/views/flow/follow.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/UBCS-WEB/src/views/flow/manager.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/UBCS-WEB/src/views/flow/model.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/UBCS-WEB/src/views/modeling/Version.vue 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/UBCS-WEB/src/views/monitor/log/api.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/UBCS-WEB/src/views/monitor/log/error.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/UBCS-WEB/src/views/monitor/log/operateLog.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/UBCS-WEB/src/views/monitor/log/usual.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/UBCS-WEB/src/views/report/reportlist.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/UBCS-WEB/src/views/resource/attach.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/UBCS-WEB/src/views/resource/oss.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/UBCS-WEB/src/views/ruleBasic/delimiterConfig.vue 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/UBCS-WEB/src/views/ruleBasic/paddingCharacter.vue 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/UBCS-WEB/src/views/ruleBasic/prefixConfig.vue 10 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/UBCS-WEB/src/views/ruleBasic/usableCharacter.vue 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/UBCS-WEB/src/views/system/PasswordManagement/passwords.vue 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/UBCS-WEB/src/views/system/client.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/UBCS-WEB/src/views/system/dept.vue 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/UBCS-WEB/src/views/system/tenant.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/UBCS-WEB/src/views/system/user.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/UBCS-WEB/vue.config.js 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/UBCS/ubcs-service-api/ubcs-system-api/src/main/java/com/vci/ubcs/system/entity/ClassifyAuth.java 7 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/UBCS/ubcs-service-api/ubcs-system-api/src/main/java/com/vci/ubcs/system/feign/ISysClient.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/UBCS/ubcs-service-api/ubcs-system-api/src/main/java/com/vci/ubcs/system/feign/ISysClientFallback.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/controller/CodeFixedValueController.java 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/controller/CodeRuleCharacterController.java 26 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/ICodeClassifyService.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/ICodeRuleCharacterService.java 19 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/impl/CodeClassifyServiceImpl.java 48 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/impl/CodeFixedValueServiceImpl.java 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/impl/CodeRuleCharacterServiceImpl.java 46 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/impl/MdmEngineServiceImpl.java 6307 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/UBCS/ubcs-service/ubcs-system/src/main/java/com/vci/ubcs/system/controller/ClassifyAuthController.java 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/UBCS/ubcs-service/ubcs-system/src/main/java/com/vci/ubcs/system/controller/MenuController.java 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/UBCS/ubcs-service/ubcs-system/src/main/java/com/vci/ubcs/system/controller/RoleController.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/UBCS/ubcs-service/ubcs-system/src/main/java/com/vci/ubcs/system/feign/SysClient.java 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/UBCS/ubcs-service/ubcs-system/src/main/java/com/vci/ubcs/system/mapper/ClassifyAuthMapper.java 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/UBCS/ubcs-service/ubcs-system/src/main/java/com/vci/ubcs/system/mapper/MenuMapper.java 11 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/UBCS/ubcs-service/ubcs-system/src/main/java/com/vci/ubcs/system/service/IClassifyAuthService.java 17 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/UBCS/ubcs-service/ubcs-system/src/main/java/com/vci/ubcs/system/service/IMenuService.java 21 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/UBCS/ubcs-service/ubcs-system/src/main/java/com/vci/ubcs/system/service/IRoleService.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/UBCS/ubcs-service/ubcs-system/src/main/java/com/vci/ubcs/system/service/impl/ClassifyAuthServiceImpl.java 52 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/UBCS/ubcs-service/ubcs-system/src/main/java/com/vci/ubcs/system/service/impl/MenuServiceImpl.java 100 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/UBCS/ubcs-service/ubcs-system/src/main/java/com/vci/ubcs/system/service/impl/RoleServiceImpl.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/UBCS/ubcs-service/ubcs-system/src/main/resources/mapper/ClassifyAuthMapper.xml 16 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/UBCS/ubcs-service/ubcs-system/src/main/resources/mapper/MenuMapper.xml 641 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/UBCS-WEB/src/api/code/codeCharcter.js
@@ -10,13 +10,23 @@
  })
}
export const gridCodeRule = (params) => {
export const getRegexStr = (params) => {
  return request({
    url: '/api/ubcs-code/mdmRule/gridCodeRule',
    url: '/api/ubcs-code/codeRuleCharacterController/getRegexStr',
    method: 'get',
    params: {
      ...params,
    },
    }
  })
}
export const getSelectList = (params) => {
  return request({
    url: '/api/ubcs-code/codeRuleCharacterController/selectList',
    method: 'get',
    params: {
      ...params,
    }
  })
}
Source/UBCS-WEB/src/api/docking/data.js
@@ -1,6 +1,6 @@
import request from '@/router/axios';
export const getDataList = (page, limit, params) => {
export const getDataList = (page, limit,sort,order, params) => {
  return request({
    url: '/api/ubcs-code/dockingManagement/gridDockingData',
    method: 'get',
Source/UBCS-WEB/src/api/docking/task.js
@@ -1,6 +1,6 @@
import request from '@/router/axios';
export const getTaskList = (page, limit, params) => {
export const getTaskList = (page, limit,sort,order, params) => {
  return request({
    url: '/api/ubcs-code/dockingManagement/gridDockingTask',
    method: 'get',
Source/UBCS-WEB/src/api/system/classifyAuth.js
@@ -26,4 +26,14 @@
      ...params
    }
  })
}
}
//菜单角色按钮权限
export const getButtonsByRoleId = (params) => {
  return request({
    url: '/api/ubcs-system/menu/getButtonsByRoleId',
    method: 'get',
    params: {
      ...params
    }
  })
}
Source/UBCS-WEB/src/api/template/templateAttr.js
@@ -1,10 +1,13 @@
import request from "@/router/axios";
//获取树形组件数据
export const getAtrrList = () => {
export const getAtrrList = (params) => {
  return request({
    url: '/api/ubcs-code/codeClassify/treeCodeClassify',
    method: 'get',
    params: {
      ...params
    }
  })
}
//树节点添加
Source/UBCS-WEB/src/components/FormTemplate/ThemeChildren.vue
@@ -5,7 +5,7 @@
        <el-select v-model="SelectValue" placeholder="请选择" style="width: 135px">
          <el-option
            v-for="item in SelectOption"
            :key="item.value"
            :key="item.key"
            :label="item.label"
            :value="item.value"
            style="width: 150px">
@@ -16,7 +16,7 @@
        <el-button plain size="small" style="margin-left: 20px" type="primary" @click="SelectSearchHandler">查询
        </el-button>
      </template>
      <avue-crud :data="TableData" :option="this.codeType === 'btmCode' ? this.btmOption : this.option" @row-click="rowHandlerClick">
      <avue-crud :data="TableData" :option="this.codeType === 'btmCode' ? this.btmOption : this.option" @row-click="rowHandlerClick" :table-loading="loading">
        <template slot="radio" slot-scope="{row}">
          <el-radio v-model="radioValue" :label="row.$index" style="padding-left: 10px !important;">{{ '' }}
          </el-radio>
@@ -74,6 +74,7 @@
      crudName: '',
      crudOid: '',
      TableData: [],
      loading:false,
      option: {
        addBtn: false,
        index: true,
@@ -82,6 +83,7 @@
        border: true,
        menu: false,
        height: 380,
        rowKey: "oid",
        column: [
          {
            label: '',
@@ -111,6 +113,7 @@
        border: true,
        menu: false,
        height:380,
        rowKey: "oid",
        column:[
          {
            label: '',
@@ -135,6 +138,7 @@
    }
  },
  created() {
    this.loading = true;
  },
  mounted() {
  },
@@ -162,13 +166,13 @@
    },
    // æ¨¡ç³ŠæŸ¥è¯¢
    SelectSearchHandler() {
      if (!this.SelectOption) {
        return; // å¦‚æžœSelectOption数据不存在直接返回 é¿å…æŠ¥é”™
      this.loading = true;
      if (!this.SelectOption || this.SelectOption.length === 0) {
        this.loading = false;
        return;
      }
      const Parameter = {};
      Parameter[`conditionMap['${this.SelectValue}']`] = this.SelectSearchValue;
      if(this.codeType === "btmCode"){
        this.btmDefaultRend(Parameter)
      }else {
@@ -205,11 +209,13 @@
        ...Parameter
      }).then(res => {
        this.TableData = res.data.records;
        this.loading = false;
      })
    },
    btmDefaultRend(Parameter) {
      referDataGrid({valueField: 'id', isMuti: 'false', 'limit': '-1', ...Parameter}).then(res => {
        this.TableData = res.data.data.records
        this.TableData = res.data.data.records;
        this.loading = false;
      })
    },
  }
Source/UBCS-WEB/src/components/Master/MasterTree.vue
@@ -103,7 +103,13 @@
      const result = this.$route.query.id.substring(0, index);
      this.idData = result;
      this.removeList();
      getTreeList({'conditionMap[id]': this.idData}).then(res => {
      let conditionMaps = {};
      conditionMaps["conditionMap[id]"] = this.idData;
      conditionMaps["conditionMap[authType]"] = "data_auth";
      conditionMaps["conditionMap[buttonCode]"] = this.idData;
      // æ•°æ®æŽˆæƒä¸­æ˜¯å¦å…·å¤‡æŸ¥çœ‹æƒé™
      conditionMaps["conditionMap[menuCode]"] = "data_view";
      getTreeList(conditionMaps).then(res => {
        if (res) {
          if (res.data.length === 0) {
            this.$message.error("主数据分类查询为空!");
@@ -231,7 +237,7 @@
<style lang="scss" scoped>
.app {
  overflow: auto;
  height: calc(100vh - 150px);
  height: calc(100vh - 145px);
}
.app::-webkit-scrollbar {
Source/UBCS-WEB/src/components/MasterCrud/VciMasterCrud.vue
@@ -1208,7 +1208,7 @@
.main {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 150px);
  height: calc(100vh - 145px);
  min-height: 400px;
}
Source/UBCS-WEB/src/components/Theme/ClassifyAuthDialog.vue
@@ -6,8 +6,11 @@
    append-to-body
    class="avue-dialog avue-dialog--top"
    title="分类授权"
    top="-45px" @close="closeDialog">
    top="-45px"
    @close="closeDialog"
  >
    <el-table
      :key="itemKey"
      ref="dataTable"
      v-loading="isLoading"
      :data="classifyAuthData"
@@ -15,16 +18,11 @@
      :height="tableHeight"
      border
      class="cus-table"
      @select="handleSelection"
      @row-click="handleRowClick"
      @select-all="handleSelectionAll"
      @selection-change="handleSelectionChange"
      @sort-change="sortChange"
    >
      <el-table-column
        type="selection"
        width="55"
      ></el-table-column>
      <el-table-column type="selection" width="55"></el-table-column>
      <el-table-column
        v-for="(item, index) in classifyAuthHeader"
        v-if="classifyAuthHeader.length !== 0"
@@ -40,6 +38,7 @@
            v-if="item.type === 'select'"
            slot="prepend"
            v-model="row[item.prop]"
            @change="selectChange(row.roleData, row)"
          >
            <el-option
              v-for="optionItem in roleList"
@@ -58,26 +57,44 @@
          </el-input>
          <el-checkbox
            v-if="item.type === 'checkbox'"
            v-model="row[item.prop]">
            v-model="row[item.prop]"
            :disabled="row.authButton.allDisabled ? true : row.authButton[item.code]"
          >
          </el-checkbox>
        </template>
      </el-table-column>
    </el-table>
    <div slot="footer" class="dialog-footer">
      <el-button type="info" plain @click="selectAllButton">按钮全选</el-button>
      <el-button class="el-icon-plus" type="success" plain @click="addClassifyAuth"></el-button>
      <el-button class="el-icon-minus" type="warning" plain @click="subClassifyAuth"></el-button>
      <el-button type="primary" plain @click="submit">提 äº¤</el-button>
      <el-button type="danger" plain @click="isShowDialog = false">关 é—­</el-button>
      <el-button plain type="info" @click="selectAllButton">按钮全选</el-button>
      <el-button
        class="el-icon-plus"
        plain
        type="success"
        @click="addClassifyAuth"
      ></el-button>
      <el-button
        class="el-icon-minus"
        plain
        type="warning"
        @click="subClassifyAuth"
      ></el-button>
      <el-button plain type="primary" @click="submit">提 äº¤</el-button>
      <el-button plain type="danger" @click="isShowDialog = false"
        >关 é—­</el-button
      >
    </div>
  </el-dialog>
</template>
<script>
import {getButtonByParentCode} from "@/api/system/menu"
import {getPage} from "@/api/system/role"
import {saveOrUpdate, getClassifyAuthList} from "@/api/system/classifyAuth"
import {v4 as uuidv4} from 'uuid';
import { getButtonByParentCode } from "@/api/system/menu";
import { getPage } from "@/api/system/role";
import {
  saveOrUpdate,
  getClassifyAuthList,
  getButtonsByRoleId,
} from "@/api/system/classifyAuth";
import { v4 as uuidv4 } from "uuid";
export default {
  name: "classifyAuthDialog.vue",
@@ -97,7 +114,7 @@
      // å¯¹è¯æ¡†æ˜¾ç¤ºæŽ§åˆ¶
      isShowDialog: this.visible,
      isLoading: false,
      tableHeight: 'calc(100vh - 550px)',
      tableHeight: "calc(100vh - 550px)",
      classifyAuthData: [],
      //列头
      classifyAuthHeader: [],
@@ -107,110 +124,209 @@
      roleList: [],
      //当前选中的表格行
      selectList: [],
      itemKey: "",
      addIndex: Number,
      currentRow: {},
    };
  },
  computed: {},
  mounted() {},
  created() {},
  watch: {
    // ç›‘听父组件传的窗口显示隐藏的值
    visible() {
      if (this.visible) {
        this.isShowDialog = this.visible;
        return new Promise((resolve, reject) => {
          getButtonByParentCode({code: "classifyTree"}).then(res => {
            // è®°å½•按钮数据
            this.classifyAuthButton = res.data.data;
            const list = res.data.data;
            let tempData = [];
            // è§’色列
            tempData.push({
              label: "角色",
              prop: "roleData",
              type: "select",
              width: 150,
            });
            // ç¼–码项分类授权
            tempData.push({
              label: "编码项分类授权",
              prop: "classifyItem",
              type: "text",
              width: 180,
            });
            list.forEach(item => {
              let columnItem = {
                label: item.name,
                prop: item.id,
                type: "checkbox",
          getButtonByParentCode({ code: "classifyTree" })
            .then((res) => {
              // è®°å½•按钮数据
              this.classifyAuthButton = res.data.data;
              const list = res.data.data;
              let tempData = [];
              // è§’色列
              tempData.push({
                label: "角色",
                prop: "roleData",
                type: "select",
                width: 150,
              });
              // ç¼–码项分类授权
              tempData.push({
                label: "编码项分类授权",
                prop: "classifyItem",
                type: "text",
                width: 180,
              };
              tempData.push(columnItem);
              });
              list.forEach((item) => {
                let columnItem = {
                  label: item.name,
                  prop: item.id,
                  code: item.code,
                  type: "checkbox",
                  width: 180,
                };
                tempData.push(columnItem);
              });
              this.classifyAuthHeader = tempData;
              resolve();
            })
            this.classifyAuthHeader = tempData
            resolve();
          }).catch(err => {
            reject(err)
          });
            .catch((err) => {
              reject(err);
            });
          // èŽ·å–è§’è‰²åˆ—è¡¨
          getPage(1, -1, null).then(res => {
          getPage(1, -1, null).then((res) => {
            this.roleList = res.data.data.records;
          });
          // èŽ·å–è¯¥åˆ†ç±»ä¸‹å·²æŽˆæƒçš„åˆ†ç±»æŽˆæƒä¿¡æ¯
          getClassifyAuthList({classifyId: this.classifyData.oid}).then(res => {
          getClassifyAuthList({
            classifyId: this.classifyData.oid,
            authType: "classify_auth",
          }).then((res) => {
            //console.log(res.data.data);
            let authDatas = res.data.data;
            if (authDatas.length > 0) {
              authDatas.forEach(authData => {
              authDatas.forEach((authData, index) => {
                let item = {
                  oid: authData.oid,
                  roleData: authData.roleId,
                  classifyItem: this.classifyData.label,
                  uuid: uuidv4(),//生成唯一的id
                }
                  authButton:{},
                  index: index,
                  uuid: uuidv4(), //生成唯一的id
                };
                //将按钮设置进去
                authData.buttonIdList.forEach(data => {
                authData.buttonIdList.forEach((data) => {
                  Vue.set(item, data, true);
                });
                //console.log(item)
                this.classifyAuthData.push(item);
              })
                this.addIndex = this.classifyAuthData.length - 1; //添加行下标等于classifyAuthData的长度-1
                this.roleHandlerMethods(authData.roleId, "create", index);
                // console.log('index', index)
              });
            }
          });
        });
      }
    },
  },
  computed: {},
  mounted() {
  },
  created() {
  },
  methods: {
    roleHandlerMethods(id, type, index) {
      if (this.classifyAuthData.length < 0) {
        return;
      }
      getButtonsByRoleId({ roleId: id, code: "classifyTree" }).then((res) => {
        // æ‰¾åˆ°this.classifyAuthButton中没有对应的属性
        const filteredItems = this.classifyAuthButton.filter((item) => {
          return !res.data.data.find((x) => x.id === item.id);
        });
        this.classifyAuthHeader.forEach((item) => {
          const isMatched = filteredItems.some((x) => x.id === item.prop);
          this.$nextTick(() => {
            if (this.classifyAuthData[index]) {
              if (isMatched) {
                Object.keys(this.classifyAuthData[index]).forEach((key) => {
                  this.$set(this.classifyAuthData[index].authButton,item.code,true);
                });
              } else {
                Object.keys(this.classifyAuthData[index]).forEach((key) => {
                  this.$set(this.classifyAuthData[index].authButton,item.code,false);
                });
              }
            }
          });
        });
        //添加 â€œæŸ¥çœ‹å…¨éƒ¨ç¦ç”¨æ¡ä»¶â€
        if (this.classifyAuthData.authButton) {
          this.classifyAuthData.forEach((classkey, classIndex) => {
            if (classkey.authButton.classify_view) {
              this.$set(this.classifyAuthData[classIndex].authButton,"allDisabled",true);
            } else {
              this.classifyAuthData[classIndex].authButton.allDisabled = false;
            }
          });
        }
        //强制刷新表格
        this.itemKey = uuidv4();
      });
    },
    async selectChange(row, currentRow) {
      try {
        this.currentRow = currentRow;
        const res = await getButtonsByRoleId({
          roleId: row,
          code: "classifyTree",
        });
        const filteredItems = this.classifyAuthButton.filter((item) => {
          return !res.data.data.find((x) => x.id === item.id);
        });
        this.classifyAuthHeader.forEach((item) => {
          const isMatched = filteredItems.some((x) => x.id === item.prop);
          this.$nextTick(() => {
            if (currentRow) {
              if (isMatched) {
                Object.keys(currentRow).forEach((key) => {
                  currentRow.authButton[item.code] = true;
                  if (!currentRow.authButton.classify_view) {
                    currentRow.authButton.allDisabled = false;
                  }
                });
              } else {
                Object.keys(currentRow).forEach((key) => {
                  currentRow.authButton[item.code] = false;
                  if (!currentRow.authButton.classify_view) {
                    currentRow.authButton.allDisabled = false;
                  }
                });
              }
            }
            this.itemKey = uuidv4(); // å¼ºåˆ¶åˆ·æ–°è¡¨æ ¼
          });
        });
      } catch (error) {
        console.error(error);
      }
    },
    // å…³é—­å¯¹è¯æ¡†
    closeDialog() {
      this.$emit('update:visible', false);
      this.$emit("update:visible", false);
      this.classifyAuthData = [];
    },
    // å¢žåŠ è¡Œ
    addClassifyAuth() {
      if(this.roleList.length<=0){
      if (this.roleList.length <= 0) {
        this.$message.warning("当前租户不存在角色信息!");
        return;
      }
      // console.log('this.roleList', this.roleList)
      this.addIndex++; //自定义生成添加行下标
      let item = {
        roleData: this.roleList[0].id,
        classifyItem: this.classifyData.label,
        uuid: uuidv4(),//生成唯一的id
      }
        authButton:{},
        index: this.addIndex,
        uuid: uuidv4(), //生成唯一的id
      };
      //将按钮设置进去
      this.classifyAuthButton.forEach(data => {
      this.classifyAuthButton.forEach((data) => {
        Vue.set(item, data.id, false);
      })
      //console.log(item)
      this.classifyAuthData.push(item)
      // console.log(this.classifyAuthData);
      });
      this.classifyAuthData.push(item);
      this.roleHandlerMethods(this.roleList[0].id, "add", this.addIndex);
    },
    // åˆ é™¤è¡Œ
    subClassifyAuth() {
      for (let item of this.selectList) {
        let index = this.classifyAuthData.findIndex(data => data.index === item.index);
        let index = this.classifyAuthData.findIndex(
          (data) => data.index === item.index
        );
        if (index !== -1) {
          this.classifyAuthData.splice(index, 1);
        }
@@ -232,7 +348,7 @@
    // ä¿å­˜åˆ†ç±»æŽˆæƒä¿¡æ¯
    submit() {
      if (this.classifyAuthData.length <= 0) {
        this.$message.warning('授权列表为空!')
        this.$message.warning("授权列表为空!");
        return;
      }
      let isRepeat = false;
@@ -255,7 +371,7 @@
      }
      let form = [];
      let flag = false;
      this.classifyAuthData.forEach(item => {
      this.classifyAuthData.forEach((item) => {
        let itemButtonList = [];
        //筛选出按钮勾选为true的列
        for (let key in item) {
@@ -274,32 +390,36 @@
          roleId: item.roleData,
          classifyId: this.classifyData.oid,
          buttonIds: itemButtonList.join(","),
        }
          authType: "classify_auth",
        };
        form.push(data);
      });
      if (flag) {
        this.$message.warning('有未勾选操作的权限,不允许授权')
        this.$message.warning("有未勾选操作的权限,不允许授权");
        return;
      }
      // console.log(form)
      // è°ƒç”¨ä¿å­˜åˆ†ç±»æŽˆæƒçš„æŽ¥å£
      saveOrUpdate(form).then(res => {
        this.$message({
          type: "success",
          message: res.data.msg,
        });
        // this.isShowDialog = false
      }, (error) => {
        window.console.log(error);
      })
      saveOrUpdate(form).then(
        (res) => {
          this.$message({
            type: "success",
            message: res.data.msg,
          });
          // this.isShowDialog = false
        },
        (error) => {
          window.console.log(error);
        }
      );
    },
    // å…¨é€‰æŒ‰é’®
    selectAllButton(){
      if(this.selectList.length!==1){
    selectAllButton() {
      if (this.selectList.length !== 1) {
        this.$message.warning("请只选择一行需要全选的按钮的数据行!");
        return;
      }
      this.classifyAuthButton.forEach(item => {
      this.classifyAuthButton.forEach((item) => {
        //console.log("item",item);
        Vue.set(this.selectList[0], item.id, true);
      });
@@ -310,7 +430,6 @@
</script>
<style lang="scss" scoped>
// æ»šåŠ¨æ¡æ ·å¼ä¿®æ”¹
// æ»šåŠ¨æ¡çš„å®½åº¦
/deep/ .el-table__body-wrapper::-webkit-scrollbar {
@@ -318,7 +437,6 @@
  background: white;
  border: white;
  width: 10px;
}
// æ»šåŠ¨æ¡çš„æ»‘å—
@@ -331,5 +449,4 @@
/deep/ .el-table__body-wrapper {
  height: calc(100% - 50px) !important;
}
</style>
Source/UBCS-WEB/src/components/Theme/DataAuthDialog.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,429 @@
<template>
  <el-dialog
    v-dialogDrag
    :close-on-click-modal="false"
    :visible.sync="isShowDialog"
    append-to-body
    class="avue-dialog avue-dialog--top"
    title="数据授权"
    top="-45px" @close="closeDialog">
    <el-table
      ref="dataTable"
      v-loading="isLoading"
      :data="classifyAuthData"
      :header-cell-style="{ background: '#FAFAFA', color: '#505050' }"
      :height="tableHeight"
      border
      class="cus-table"
      @select="handleSelection"
      @row-click="handleRowClick"
      @select-all="handleSelectionAll"
      @selection-change="handleSelectionChange"
      @sort-change="sortChange"
    >
      <el-table-column
        type="selection"
        width="55"
      ></el-table-column>
      <el-table-column
        v-for="(item, index) in classifyAuthHeader"
        v-if="classifyAuthHeader.length !== 0"
        :key="index"
        :label="item.label"
        :prop="item.prop"
        :show-overflow-tooltip="true"
        :width="item.width"
        align="center"
      >
        <template slot-scope="{ row }">
          <el-select
            v-if="item.type === 'select'"
            slot="prepend"
            v-model="row[item.prop]"
            @change="roleChange(row.roleData,row)"
          >
            <el-option
              v-for="optionItem in roleList"
              :key="optionItem.id"
              :label="optionItem.roleName"
              :value="optionItem.id"
            >
            </el-option>
          </el-select>
          <el-input
            v-if="item.type === 'text'"
            v-model="row[item.prop]"
            readonly
            type="text"
          >
          </el-input>
          <el-checkbox
            v-if="item.type === 'checkbox'"
            v-model="row[item.prop]"
            :disabled="row.authButton.allDisabled ? true : row.authButton[item.code]">
          </el-checkbox>
        </template>
      </el-table-column>
    </el-table>
    <div slot="footer" class="dialog-footer">
      <el-button plain type="info" @click="selectAllButton">按钮全选</el-button>
      <el-button class="el-icon-plus" plain type="success" @click="addClassifyAuth"></el-button>
      <el-button class="el-icon-minus" plain type="warning" @click="subClassifyAuth"></el-button>
      <el-button plain type="primary" @click="submit">提 äº¤</el-button>
      <el-button plain type="danger" @click="isShowDialog = false">关 é—­</el-button>
    </div>
  </el-dialog>
</template>
<script>
import {getButtonByParentCode} from "@/api/system/menu"
import {getPage} from "@/api/system/role"
import {saveOrUpdate, getClassifyAuthList, getButtonsByRoleId} from "@/api/system/classifyAuth"
import {v4 as uuidv4} from 'uuid';
export default {
  name: "dataAuthDialog.vue",
  props: {
    classifyData: {
      type: "Object",
      default: "",
    },
    /**对话框显示隐藏控制*/
    visible: {
      type: "Boolean",
      default: false,
    },
    TreeNode:{
      type:Object
    }
  },
  data() {
    return {
      // å¯¹è¯æ¡†æ˜¾ç¤ºæŽ§åˆ¶
      isShowDialog: this.visible,
      isLoading: false,
      tableHeight: 'calc(100vh - 550px)',
      classifyAuthData: [],
      //列头
      classifyAuthHeader: [],
      //按钮数据
      classifyAuthButton: [],
      //角色列表
      roleList: [],
      //当前选中的表格行
      selectList: [],
      itemKey: '',
      addIndex: Number,
      currentRow: {}
    };
  },
  watch: {
    // ç›‘听父组件传的窗口显示隐藏的值
    visible() {
      if (this.visible) {
        this.isShowDialog = this.visible;
        return new Promise((resolve, reject) => {
          getButtonByParentCode({code: this.classifyData.attributes.id}).then(res => {
            // è®°å½•按钮数据
            this.classifyAuthButton = res.data.data;
            const list = res.data.data;
            let tempData = [];
            // è§’色列
            tempData.push({
              label: "角色",
              prop: "roleData",
              type: "select",
              width: 150,
            });
            // ç¼–码项分类授权
            tempData.push({
              label: "编码项数据授权",
              prop: "classifyItem",
              type: "text",
              width: 180,
            });
            list.forEach(item => {
              let columnItem = {
                label: item.name,
                prop: item.id,
                code: item.code,
                type: "checkbox",
                width: 180,
              };
              tempData.push(columnItem);
            })
            this.classifyAuthHeader = tempData
            resolve();
          }).catch(err => {
            reject(err)
          });
          // èŽ·å–è§’è‰²åˆ—è¡¨
          getPage(1, -1, null).then(res => {
            this.roleList = res.data.data.records;
          });
          // èŽ·å–è¯¥åˆ†ç±»ä¸‹å·²æŽˆæƒçš„åˆ†ç±»æŽˆæƒä¿¡æ¯
          getClassifyAuthList({classifyId: this.classifyData.oid, authType: "data_auth"}).then(res => {
            //console.log(res.data.data);
            let authDatas = res.data.data;
            if (authDatas.length > 0) {
              authDatas.forEach((authData, index) => {
                let item = {
                  oid: authData.oid,
                  roleData: authData.roleId,
                  classifyItem: this.classifyData.label,
                  index: index,
                  authButton:{},
                  uuid: uuidv4(),//生成唯一的id
                }
                //将按钮设置进去
                authData.buttonIdList.forEach(data => {
                  Vue.set(item, data, true);
                });
                this.classifyAuthData.push(item);
                this.addIndex = this.classifyAuthData.length - 1; //添加行下标等于classifyAuthData的长度-1
                this.roleHandlerMethods(authData.roleId, 'create', index)
              })
            }
          });
        });
      }
    },
  },
  computed: {},
  mounted() {
  },
  created() {
  },
  methods: {
    // å…³é—­å¯¹è¯æ¡†
    closeDialog() {
      this.$emit('update:visible', false);
      this.classifyAuthData = [];
    },
    roleHandlerMethods(id, type, index) {
      if (this.classifyAuthData.length === 0) {
        return;
      }
      //filteredItems æœªæŽˆæƒæ•°ç»„
      getButtonsByRoleId({roleId: id, code: this.TreeNode.id}).then(res => {
        const filteredItems = this.classifyAuthButton.filter(item =>
          !res.data.data.some(x => x.id === item.id)
        );
        //和表格列进行对比
        this.classifyAuthHeader.forEach((item) => {
          const isMatched = filteredItems.some((x) => x.id === item.prop);
          this.$nextTick(() => {
            if (this.classifyAuthData[index]) {
              if (isMatched) {
                Object.keys(this.classifyAuthData[index]).forEach((key) => {
                  this.$set(this.classifyAuthData[index].authButton,item.code,true);
                });
              } else {
                Object.keys(this.classifyAuthData[index]).forEach((key) => {
                  this.$set(this.classifyAuthData[index].authButton,item.code,false);
                });
              }
            }
          });
        });
        //添加‘查看’禁用
        if (this.classifyAuthData.authButton) {
          this.classifyAuthData.forEach((classkey, classIndex) => {
            if (classkey.authButton.classify_view) {
              this.$set(this.classifyAuthData[classIndex].authButton,"allDisabled",true);
            } else {
              this.classifyAuthData[classIndex].authButton.allDisabled = false;
            }
          });
        }
        //强制刷新表格
        this.itemKey = uuidv4();
      });
    },
    // è§’色改变时
    async roleChange(row, currentRow) {
      try {
        this.currentRow = currentRow;
        const res = await getButtonsByRoleId({roleId: row, code: this.TreeNode.id});
        const filteredItems = this.classifyAuthButton.filter(item => {
          return !res.data.data.find(x => x.id === item.id);
        });
        this.classifyAuthHeader.forEach(item => {
          const isMatched = filteredItems.some(x => x.id === item.prop);
          this.$nextTick(() => {
            if (currentRow) {
              if (isMatched) {
                Object.keys(currentRow).forEach((key) => {
                  currentRow.authButton[item.code] = true;
                  if (!currentRow.authButton.classify_view) {
                    currentRow.authButton.allDisabled = false;
                  }
                });
              } else {
                Object.keys(currentRow).forEach((key) => {
                  currentRow.authButton[item.code] = false;
                  if (!currentRow.authButton.classify_view) {
                    currentRow.authButton.allDisabled = false;
                  }
                });
              }
            }
            this.itemKey = uuidv4(); // å¼ºåˆ¶åˆ·æ–°è¡¨æ ¼
          });
        });
      } catch (error) {
        console.error(error);
      }
    },
    // å¢žåŠ è¡Œ
    addClassifyAuth() {
      if (this.roleList.length <= 0) {
        this.$message.warning("当前租户不存在角色信息!");
        return;
      }
      this.addIndex++; //自定义生成添加行下标
      let item = {
        roleData: this.roleList[0].id,
        classifyItem: this.classifyData.label,
        authButton:{},
        uuid: uuidv4(),//生成唯一的id,
        index: this.addIndex,
      }
      //将按钮设置进去
      this.classifyAuthButton.forEach(data => {
        Vue.set(item, data.id, false);
      })
      //console.log(item)
      this.classifyAuthData.push(item)
      this.roleHandlerMethods(this.roleList[0].id, 'add', this.addIndex)
    },
    // åˆ é™¤è¡Œ
    subClassifyAuth() {
      for (let item of this.selectList) {
        let index = this.classifyAuthData.findIndex(data => data.index === item.index);
        if (index !== -1) {
          this.classifyAuthData.splice(index, 1);
        }
      }
    },
    handleRowClick(row, column) {
      this.selectList.push(row);
      this.$refs.dataTable.toggleRowSelection(row);
    },
    // å¤šé€‰
    handleSelectionChange(list) {
      this.selectList = list;
      //console.log("多选");
    },
    // é€‰æ‹©å…¨éƒ¨
    handleSelectionAll(list) {
      this.selectList = list;
    },
    // ä¿å­˜åˆ†ç±»æŽˆæƒä¿¡æ¯
    submit() {
      if (this.classifyAuthData.length <= 0) {
        this.$message.warning('授权列表为空!')
        return;
      }
      let isRepeat = false;
      // éåŽ†æ•°ç»„ï¼Œæ¯”è¾ƒåŽé¢çš„å¯¹è±¡çš„roleData是否与前面的对象相等
      for (let i = 0; i < this.classifyAuthData.length - 1; i++) {
        let currentRoleId = this.classifyAuthData[i].roleData;
        for (let j = i + 1; j < this.classifyAuthData.length; j++) {
          if (currentRoleId === this.classifyAuthData[j].roleData) {
            isRepeat = true;
            break;
          }
        }
        if (isRepeat) {
          break;
        }
      }
      if (isRepeat) {
        this.$message.warning("角色和分类已经存在,请重新配置!");
        return;
      }
      let form = [];
      let flag = false;
      this.classifyAuthData.forEach(item => {
        let itemButtonList = [];
        //筛选出按钮勾选为true的列
        for (let key in item) {
          if (item[key] === true) {
            itemButtonList.push(key);
          }
        }
        /**如果itemButtonList为空证明是,
         æ·»åŠ äº†è§’è‰²ä½†æ˜¯æ²¡å‹¾é€‰ä»»ä½•çš„æŒ‰é’®*/
        if (itemButtonList.length <= 0) {
          flag = true;
          return;
        }
        let data = {
          oid: item.oid,
          roleId: item.roleData,
          classifyId: this.classifyData.oid,
          buttonIds: itemButtonList.join(","),
          authType: "data_auth",
        }
        form.push(data);
      });
      if (flag) {
        this.$message.warning('有未勾选操作的权限,不允许授权')
        return;
      }
      // console.log(form)
      // è°ƒç”¨ä¿å­˜åˆ†ç±»æŽˆæƒçš„æŽ¥å£
      saveOrUpdate(form).then(res => {
        this.$message({
          type: "success",
          message: res.data.msg,
        });
        // this.isShowDialog = false
      }, (error) => {
        window.console.log(error);
      })
    },
    // å…¨é€‰æŒ‰é’®
    selectAllButton() {
      if (this.selectList.length !== 1) {
        this.$message.warning("请只选择一行需要全选的按钮的数据行!");
        return;
      }
      this.classifyAuthButton.forEach(item => {
        //console.log("item",item);
        Vue.set(this.selectList[0], item.id, true);
      });
      //console.log("this.selectList",this.selectList);
    },
  },
};
</script>
<style lang="scss" scoped>
// æ»šåŠ¨æ¡æ ·å¼ä¿®æ”¹
// æ»šåŠ¨æ¡çš„å®½åº¦
/deep/ .el-table__body-wrapper::-webkit-scrollbar {
  height: 15px; // çºµå‘滚动条 å¿…写
  background: white;
  border: white;
  width: 10px;
}
// æ»šåŠ¨æ¡çš„æ»‘å—
/deep/ .el-table__body-wrapper::-webkit-scrollbar-thumb {
  background-color: #ececec;
  border-radius: 20px;
  border: #ececec;
}
/deep/ .el-table__body-wrapper {
  height: calc(100% - 50px) !important;
}
</style>
Source/UBCS-WEB/src/components/Theme/ThemeAttrCrud.vue
@@ -277,7 +277,7 @@
      <!--        å…¨å±ç¼–辑-->
      <el-dialog :before-close="escEdit" :visible.sync="attrEditVisible" append-to-body fullscreen="true">
        <attrCrud :ProData="this.ProData" :attrFlagChiledren="this.attrFlag" :crudArrayFlag="this.crudArrayFlag"
                  :editOpenFlag="editOpenFlag" :editStyleFlag="editStyleFlag"
                  :editOpenFlag="editOpenFlag" :editStyleFlag="editStyleFlag" :btnAuthList="btnAuthList"
                  @editCloseChildren="editClose"></attrCrud>
      </el-dialog>
      <!--      ç»„合规则-->
@@ -1563,7 +1563,7 @@
    ...mapGetters(["permission"]),
    permissionList() {
      return {
        busineStatus: this.vaildData(this.btnAuthList.attr_add, false),
        busineStatus: this.vaildData(this.btnAuthList.attr_add, false) ,
        fullscreenStatus: this.vaildData(this.btnAuthList.attr_view_edit, false),
        ruleStatus: this.vaildData(this.btnAuthList.attr_rule, false),
        attrStatus: this.vaildData(this.btnAuthList.attr_group, false),
Source/UBCS-WEB/src/components/Theme/ThemeClassifyTrees.vue
@@ -6,7 +6,7 @@
      <basic-container>
        <div style="height: calc(100vh - 142px);!important;">
          <div class="headerCon" style="display: flex; flex-wrap: wrap;margin-bottom: 5px">
            <el-button v-if="permissionList.TreeAddStatus" plain size="small" type="primary" @click="TreeAdd">添加
            <el-button plain size="small" type="primary" @click="TreeAdd">添加
            </el-button>
            <el-button v-if="permissionList.TreeEditStatus" plain size="small" type="primary" @click="TreeEdit">修改
            </el-button>
@@ -31,6 +31,10 @@
            <el-button v-if="permissionList.classifyAuth" plain size="small"
                       style="width: 56px;text-align: center;padding-left: 3px" type="primary"
                       @click="classifyAuthHandler">分类授权
            </el-button>
            <el-button v-if="permissionList.classifyAuth" plain size="small"
                       style="width: 56px;text-align: center;padding-left: 3px" type="primary"
                       @click="dataAuthHandler">数据授权
            </el-button>
          </div>
          <!-- å·¦ä¾§æ ‘-->
@@ -116,6 +120,12 @@
          :classifyData="classifyData"
          :visible.sync="classifyAuthVisible"
        ></classify-auth-dialog>
        <!-- æ•°æ®æŽˆæƒå¯¹è¯æ¡† -->
        <data-auth-dialog
          :classifyData="classifyData"
          :visible.sync="dataAuthVisible"
          :TreeNode="TreeEditObj"
        ></data-auth-dialog>
      </basic-container>
    </el-aside>
    <el-main>
@@ -386,13 +396,14 @@
      BtmdialogVisible: false,
      SelectOption: [
        {
          value: 'name',
          label: '中文名称'
          value: 'id',
          label: '英文名称',
        },
        {
          value: 'id',
          label: '英文名称'
          value: 'name',
          label: '中文名称'
        }
      ],
      btmSelectOption: [
        {
@@ -451,6 +462,8 @@
      TreeAddFormVisible: false,
      //分类授权对话框
      classifyAuthVisible: false,
      //数据授权对话框
      dataAuthVisible: false,
      //当前点击项
      nodeClickList: "",
      ClonenodeClickList: "",
@@ -759,6 +772,15 @@
      this.classifyData = this.nodeClickList;
      this.classifyAuthVisible = true;
    },
    // æ•°æ®æŽˆæƒå¯¹è¯æ¡†æ‰“å¼€
    dataAuthHandler() {
      if (this.nodeClickList.oid === '' || this.nodeClickList.oid === undefined) {
        this.$message.warning('请至少选择一条数据!')
        return;
      }
      this.classifyData = this.nodeClickList;
      this.dataAuthVisible = true;
    },
    flowingDependHandler() {
      if (this.nodeClickList.length <= 0) {
        this.$message.warning('请至少选择一条数据!')
@@ -855,7 +877,12 @@
    getAttr() {
      this.loading = true;
      return new Promise((resolve, reject) => {
        getAtrrList()
        let conditionMaps = {};
        conditionMaps["conditionMap[authType]"] = "classify_auth";
        conditionMaps["conditionMap[buttonCode]"] = "classifyTree";
        // åˆ†ç±»æŽˆæƒä¸­æ˜¯å¦å…·å¤‡æŸ¥çœ‹æƒé™
        conditionMaps["conditionMap[menuCode]"] = "classify_view";
        getAtrrList(conditionMaps)
          .then(res => {
            this.Treedata = res.data;
            this.CloneTreedata = res.data;
@@ -1115,7 +1142,7 @@
    },
    //树点击事件
    async nodeClick(data) {
      getAuthButtonList({classifyId: data.oid}).then(res => {
      getAuthButtonList({classifyId: data.oid,code: "classifyTree",authType: "classify_auth"}).then(res => {
        this.btnAuthList = res.data.data;
      }).catch(error => {
        console.log(error)
Source/UBCS-WEB/src/components/code-dialog-page/referConfigFormDialog.vue
@@ -189,45 +189,27 @@
            @echoSelectedAttr="echoSelectedAttr">
        </refer-select-btm-attr-dialog>
        <el-dialog title="选择显示字段"
        <el-dialog title="选取IN或NOTIN条件"
            append-to-body
            :visible.sync="isShowShowField"
            :visible.sync="isShowInOrNotInCondition"
            width="70%"
            destroy-on-close
            style="height: 110vh; margin-top: -12vh; overflow-y: hidden">
            <avue-crud :option="selectionShowFieldOption"
                :table-loading="selectShowFieldLoading"
                :data="selectShowFieldData"
                ref="selectShowFieldCrud"
                @row-click="showFieldRowClick"
                @selection-change="selectionShowFieldDataChange"
                @search-change="showFieldSearchChange"
                @search-reset="showFieldSearchReset">
            <avue-crud :option="selectInOrNotInCondOption"
                :page.sync="inOrNotInPage"
                @current-change="inOrNotInCurrentChange"
                @size-change="inOrNotInSizeChange"
                @selection-change="selectionInOrNotInChange"
                @row-click="rowInOrNotInClick"
                @search-change="selectInOrNotInSearchChange"
                @search-reset="searchInOrNotInReset"
                :data="selectInOrNotInCondData"
                ref="inOrNotInConditionCrud">
            </avue-crud>
            <div slot="footer" class="dialog-footer">
                <el-button type="primary" @click="selectedShowField">ç¡® å®š</el-button>
                <el-button @click="isShowShowField = false">取 æ¶ˆ</el-button>
            </div>
        </el-dialog>
        <el-dialog title="选择查询条件"
            append-to-body
            :visible.sync="isShowSearchCondition"
            width="70%"
            destroy-on-close
            style="height: 110vh; margin-top: -12vh; overflow-y: hidden">
            <avue-crud :option="selectionSearchConditionOption"
                :table-loading="selectSearchConditionLoading"
                :data="selectSearchConditionData"
                ref="selectSearchConditionCrud"
                @row-click="searchConditionRowClick"
                @selection-change="searchConditionDataChange"
                @search-change="searchConditionSearchChange"
                @search-reset="searchConditionSearchReset">
            </avue-crud>
            <div slot="footer" class="dialog-footer">
                <el-button type="primary" @click="selectedSearchCondition">ç¡® å®š</el-button>
                <el-button @click="isShowSearchCondition = false">取 æ¶ˆ</el-button>
              <!-- <div class="avue-dialog__footer--left valueInfo">{{ valueInfo }}</div> -->
              <el-button type="primary" @click="selectedInOrNotInCond">ç¡® å®š</el-button>
              <el-button @click="isShowInOrNotInCondition = false">取 æ¶ˆ</el-button>
            </div>
        </el-dialog>
@@ -236,6 +218,7 @@
<script>
    import func from "@/util/func";
    import {getList} from "@/api/refer/table";
    export default {
        name: "referConfigFormDialog",
        props: {
@@ -420,7 +403,7 @@
                            clearable: false,
                            dicData: [
                                {   
                                    value: '_in', label: '存在于'
                                  value: '_in', label: '存在于'
                                },{
                                    value: '_notin', label: '不存在于'
                                },{
@@ -473,6 +456,37 @@
                preClickAttrRow: '',
                preClickAddSearchConditionRow: '',
                //点击行弹出in或notin的值
                isShowInOrNotInCondition: false,
                selectInOrNotInCondData: [],
                selectInOrNotInCondOption: {
                  height:'220',
                  tip: false,
                  addBtn: false,
                  editBtn: false,
                  searchShow: true,
                  searchMenuSpan: 6,
                  border: false,
                  index: true,
                  viewBtn: false,
                  delBtn: false,
                  selection: true,
                  disablePage: false,
                  refreshBtn: false,
                  columnBtn: false,
                  menu: false,
                  dialogClickModal: false,
                  highlightCurrentRow: true,
                  column: []
                },
                inOrNotInPage: {
                  pageSize: 10,
                  currentPage: 1,
                  total: 0,
                },
                selectionInOrNotInList: [],
                inOrNotInParam: {},
            };
        },
        // è¡¨å•界面显示内容配置
@@ -981,9 +995,78 @@
                    //console.log(this.codeShowFieldConfigVOS[this.preClickAttrRow.$index]);
                    this.form.codeSrchCondConfigVOS[this.preClickAddSearchConditionRow.$index].$cellEdit = false;
                }
                if(row.filterType === '_in' || row.filterType === '_notin'){
                  //console.log(row);
                  this.selectInOrNotInCondOption.column = [{
                    prop: row.filterField,
                    label: row.filterTypeText,
                    search: true,
                    searchLabelWidth: 45,
                    searchSpan: 8,
                    sortable: true,
                  }]
                  this.initPageData.pageSize = 10;
                  this.initPageData.currentPage = 1;
                  this.loadInOrNotInConditionData(this.initPageData);
                  this.isShowInOrNotInCondition = true;
                }
                row.$cellEdit = true;
                this.preClickAddSearchConditionRow = row;
            },
            loadInOrNotInConditionData(page, params = {}){
              let mustParams = {
                referType: this.form.referType,
                referBo: this.form.referType,
              };
              getList(Object.assign(mustParams,params),page.currentPage,page.pageSize,'/api/ubcs-code/mdmEngineController/defaultReferDataGrid','GET').then(res=>{
                //console.log(res.data);
                this.selectInOrNotInCondData = res.data.records;
                this.inOrNotInPage.total = res.data.total;
              });
            },
            inOrNotInCurrentChange(currentPage) {
              this.inOrNotInPage.currentPage = currentPage;
            },
            inOrNotInSizeChange(pageSize) {
              this.inOrNotInPage.pageSize = pageSize;
            },
            rowInOrNotInClick(row){
              this.$refs.inOrNotInConditionCrud.toggleSelection();
              this.$refs.inOrNotInConditionCrud.toggleRowSelection(row); //选中当前行
            },
            selectionInOrNotInChange(list){
              if (this.isMuti && list.length > 1) {
                const nowVal = list.shift();
                this.$refs.inOrNotInConditionCrud.toggleRowSelection(nowVal, false);
              }
              this.selectionInOrNotInList = list
            },
            selectedInOrNotInCond(){
              if(this.selectionInOrNotInList && this.selectionInOrNotInList.length > 0){
                // console.log(this.selectionInOrNotInList)
                this.preClickAddSearchConditionRow.filterValue = this.selectionInOrNotInList.map(item => item[this.selectInOrNotInCondOption.column[0].prop]).join(',');
                this.isShowInOrNotInCondition = false;
              }
            },
            /** ç‚¹å‡»æœç´¢åŽè§¦å‘该事件 */
            selectInOrNotInSearchChange(params, done) {
              this.initPageData.currentPage = 1;
              let requestData = {};
              if(params) {
                Object.keys(params).forEach((key)=>{
                  requestData["conditionMap" + "["+ key +"_like]"] = params[key].trim();
                })
              }
              this.inOrNotInParam = requestData;
              this.loadInOrNotInConditionData(this.initPageData,this.inOrNotInParam);
              done();
            },
            /** é‡ç½®ä½å±žæ€§é€‰å–值表格的搜索框之后的回调 */
            searchInOrNotInReset() {
              this.inOrNotInParam = {};
              this.loadInOrNotInConditionData(this.initPageData);
            },
            //上一个页面已经选中参照应用的业务类型的情况,和上一次已经配置过参照配置的情况下进行页面初始化渲染
            initPageData(val){
                // console.log(val.referConfig);
@@ -1263,4 +1346,13 @@
        transition:opacity .0s !important;
    }
    /* .valueInfo {
      float: left;
      border: 1px solid #E9E7E7;
      display: inline-block;
      vertical-align: middle;
      padding: 9px 15px;
      line-height: 1;
    } */
</style>
Source/UBCS-WEB/src/main.js
@@ -38,6 +38,7 @@
import classifyTrees from "@/components/Theme/ThemeClassifyTrees"
import classifyTreeform from "@/components/Theme/ThemeClassifyTreeform"
import classifyAuthDialog from "@/components/Theme/ClassifyAuthDialog"
import dataAuthDialog from "@/components/Theme/DataAuthDialog"
import TemplatePro from "@/components/Theme/ThemeTemplatePro"
import attrCrud from "@/components/Theme/ThemeAttrCrud"
import formulaEditor from "@/components/code-dialog-page/formulaEditor"
@@ -100,6 +101,7 @@
Vue.component('originalLink',originalLink)
Vue.component('classifyTrees',classifyTrees)
Vue.component('classifyAuthDialog',classifyAuthDialog)
Vue.component('dataAuthDialog',dataAuthDialog)
Vue.component('classifyTreeform',classifyTreeform)
Vue.component('TemplatePro',TemplatePro)
Vue.component('formulaEditor',formulaEditor)
Source/UBCS-WEB/src/option/system/dictbiz.js
@@ -1,6 +1,6 @@
export const optionParent = {
  height: 'auto',
  calcHeight: 30,
  calcHeight: 20,
  columnBtn:false,
  tip: false,
  searchShow: true,
Source/UBCS-WEB/src/option/system/param.js
@@ -1,6 +1,6 @@
export default {
  height: 'auto',
  calcHeight: 30,
  calcHeight: 20,
  tip: false,
  searchShow: true,
  searchMenuSpan: 6,
Source/UBCS-WEB/src/views/authority/role.vue
@@ -29,7 +29,7 @@
          åˆ  é™¤
        </el-button>
        <!-- v-if="userInfo.role_name.includes('admin')" -->
        <el-button v-if="permissionList.authSettingBtn"
        <el-button v-if="permissionList.authSettingBtn"
          size="small"
          icon="el-icon-setting"
          @click="handleRole"
@@ -115,6 +115,7 @@
        option: {
          height: "auto",
          tip: false,
          calcHeight: 20,
          columnBtn:false,
          // simplePage: true,
          searchShow: true,
Source/UBCS-WEB/src/views/code/Match.vue
@@ -101,8 +101,8 @@
      findvisible: false,
      selectRow: [],
      option: {
        height: 700,
        calcHeight: 80,
        height: 'auto',
        calcHeight: 20,
        tip: false,
        searchShow: true,
        searchMenuSpan: 6,
Source/UBCS-WEB/src/views/code/code.vue
@@ -404,9 +404,7 @@
                margin-top: 20px;
                display: flex;
                align-items: center;
                justify-content: center;
              "
            >
                justify-content: center;">
              <el-button
                class="button"
                icon="el-icon-circle-plus"
@@ -642,19 +640,35 @@
            <el-form-item
              :label-width="leftFormLabelWidth"
              label="前缀:">
              <el-input
              <!-- <el-input
                v-model="form.prefixCode"
                :readonly="basicSecOnlyRead"
              ></el-input>
              ></el-input> -->
              <el-select v-model="form.prefixCode" :disabled="basicSecOnlyRead">
                <el-option
                  v-for="(option, index) in preFixOrSuffixChars"
                  :key="index"
                  :label="option.label"
                  :value="option.value">
                </el-option>
              </el-select>
            </el-form-item>
            <el-form-item
              :label-width="leftFormLabelWidth"
              label="后缀:">
              <el-input
              <!-- <el-input
                v-model="form.suffixCode"
                :readonly="basicSecOnlyRead">
              </el-input>
              </el-input> -->
              <el-select v-model="form.suffixCode" :disabled="basicSecOnlyRead">
                <el-option
                  v-for="(option, index) in preFixOrSuffixChars"
                  :key="index"
                  :label="option.label"
                  :value="option.value">
                </el-option>
              </el-select>
            </el-form-item>
            <el-form-item :label-width="leftFormLabelWidth" label="描述:">
@@ -838,13 +852,12 @@
                  :disabled="basicSecOnlyRead"
                  filterable
                  placeholder="请选择"
                  @blur="inputSelectBlur"
                >
                  <el-option
                    v-for="item in enumParam.codeFillSeparator"
                    :key="item.dictKey"
                    :label="item.dictValue"
                    :value="item.dictValue"
                    :key="item.lable"
                    :label="item.lable"
                    :value="item.value"
                  >
                  </el-option>
                </el-select>
@@ -1144,13 +1157,12 @@
                  :disabled="basicSecOnlyRead"
                  filterable
                  placeholder="请选择"
                  @blur="inputSelectBlur"
                >
                  <el-option
                    v-for="item in enumParam.codeFillSeparator"
                    :key="item.dictKey"
                    :label="item.dictValue"
                    :value="item.dictValue"
                    :key="item.lable"
                    :label="item.lable"
                    :value="item.value"
                  >
                  </el-option>
                </el-select>
@@ -1333,8 +1345,9 @@
  deleteCodeClassifyValue,
  saveCodeClassifyValueOrder,
} from "@/api/code/codeClassifyValue";
import { getSelectList, getRegexStr } from "@/api/code/codeCharcter"
import {getDictionary} from "@/api/omd/enum";
import {getDictionaryBiz} from "@/api/system/dictbiz";
// import {getDictionaryBiz} from "@/api/system/dictbiz";
import optionBasic from "@/const/code/codebasic";
import optionRule from "@/const/code/mdmrule";
import attrOption from "@/const/code/selectAttrOptionDialog";
@@ -1682,6 +1695,9 @@
      //引用码段中参照配置组件相关参数
      referConfigOption: {},
      referConfigVisble: false,
      preFixOrSuffixChars: [], //前后缀字符列表
    };
  },
  computed: {
@@ -2001,9 +2017,12 @@
      this.codeFixdForm.codeFixedSecOid = row.codefixedsecoid;
    },
    /** æ–°å¢žç å€¼*/
    addCodeSecValue(condition) {
    async addCodeSecValue(condition) {
      if (condition === "codefixedsec") {
        if (!this.tipsCodeSecValueMessage(this.codeFixdForm.id)) {
          return;
        }
        if(!await this.regexCharacter(this.codeFixdForm.id)){
          return;
        }
        this.codeFixdForm.codeFixedSecOid = this.codefixedsecOrCodeclassifysec.oid;
@@ -2028,6 +2047,9 @@
        if (!this.tipsCodeSecValueMessage(this.codeClassifyForm.id)) {
          return;
        }
        if(!await this.regexCharacter(this.codeClassifyForm.id)){
          return;
        }
        this.codeClassifyForm.codeClassifySecOid =
          this.codefixedsecOrCodeclassifysec.oid;
        addSaveCodeClassifyValue(this.codeClassifyForm).then(
@@ -2050,39 +2072,13 @@
        );
      }
    },
    /** æ¸…空码值表单 */
    clearFixedOrClassifyForm(condition) {
      //点击取消时清空表单与当前选中的码值,并禁用按钮
      this.selectedFixedOrCodeclassifyValue = "";
      if (condition === "close") {
        this.codeFixdForm = this.$options.data().codeFixdForm;
        this.codeClassifyForm = this.$options.data().codeClassifyForm;
      }
      if (condition === "codefixedsec") {
        this.codeFixdForm.description = "";
        this.codeFixdForm.codeFixedSecOid = "";
      } else {
        this.codeClassifyForm = this.$options.data().codeClassifyForm;
      }
    },
    /** æ·»åŠ æˆ–ä¿®æ”¹ç å€¼ä¹‹å‰å¯¹ç å€¼é•¿åº¦æ ¹æ®è§„åˆ™è¿›è¡Œæ ¡éªŒ */
    tipsCodeSecValueMessage(id) {
      if (id.trim() == "") {
        this.$message.warning("码值不能为空!");
        return false;
      }
      if (id.trim().length > this.codefixedsecOrCodeclassifysec.codeSecLength) {
        this.$message.warning(
          "码值长度不能大于" + this.codefixedsecOrCodeclassifysec.codeSecLength
        );
        return false;
      }
      return true;
    },
    /** ä¿®æ”¹ç å€¼ */
    editCodeSecValue(condition) {
    async editCodeSecValue(condition) {
      if (condition == "codefixedsec") {
        if (!this.tipsCodeSecValueMessage(this.codeFixdForm.id)) {
          return;
        }
        if(!await this.regexCharacter(this.codeFixdForm.id)){
          return;
        }
        //以前是直接把当前选中行的所有数据都进行提交,但其实只需要传输一些必要参数即可,这儿做了修改,需要传其他参数的请自行添加
@@ -2112,6 +2108,9 @@
        if (!this.tipsCodeSecValueMessage(this.codeClassifyForm.id)) {
          return;
        }
        if(!await this.regexCharacter(this.codeFixdForm.id)){
          return;
        }
        this.codeClassifyForm.oid =
          this.selectedFixedOrCodeclassifyValue.attributes.oid;
        // åˆ†ç±»ç æ®µï¼Œå­åˆ†ç±»å’Œçˆ¶åˆ†ç±»ä¹‹é—´ä¸èƒ½ç›¸äº’更改
@@ -2139,6 +2138,54 @@
          }
        );
      }
    },
    /**
     * å¯ç”¨å­—符集码值正则校验
     * @return true:满足限制,false:不满足限制
     */
    async regexCharacter(str){
      var regex = null;
      // èŽ·å–åˆ°é…ç½®å¥½çš„å¯ç”¨å­—ç¬¦æ­£åˆ™
      await getRegexStr({codeRuleId: this.selectionList[0].oid,chartType: "charset"}).then(res=>{
        // console.log(res.data.data);
        regex = new RegExp(res.data.data);
      });
      // console.log(regex);
      // console.log(regex.test(str));
      if(regex != "" && !regex.test(str)){
        this.$message.warning("添加的码值未在可用字符集中配置!");
        return false;
      }
      return true;
    },
    /** æ¸…空码值表单 */
    clearFixedOrClassifyForm(condition) {
      //点击取消时清空表单与当前选中的码值,并禁用按钮
      this.selectedFixedOrCodeclassifyValue = "";
      if (condition === "close") {
        this.codeFixdForm = this.$options.data().codeFixdForm;
        this.codeClassifyForm = this.$options.data().codeClassifyForm;
      }
      if (condition === "codefixedsec") {
        this.codeFixdForm.description = "";
        this.codeFixdForm.codeFixedSecOid = "";
      } else {
        this.codeClassifyForm = this.$options.data().codeClassifyForm;
      }
    },
    /** æ·»åŠ æˆ–ä¿®æ”¹ç å€¼ä¹‹å‰å¯¹ç å€¼é•¿åº¦æ ¹æ®è§„åˆ™è¿›è¡Œæ ¡éªŒ */
    tipsCodeSecValueMessage(id) {
      if (id.trim() == "") {
        this.$message.warning("码值不能为空!");
        return false;
      }
      if (id.trim().length > this.codefixedsecOrCodeclassifysec.codeSecLength) {
        this.$message.warning(
          "码值长度不能大于" + this.codefixedsecOrCodeclassifysec.codeSecLength
        );
        return false;
      }
      return true;
    },
    /** åˆ é™¤ç å€¼ */
    delCodeSecValue(condition) {
@@ -2335,7 +2382,6 @@
    },
    /** ä¸Šç§»ä¸‹ç§»ç­‰æ“ä½œçš„保存*/
    async saveCodeFixedOrClassifyValueOption(condition, editOrderNumdata) {
      //保存对固定码段码值的上移下移移出等操作
      if (condition == "fixedValue") {
        let data = {
@@ -2810,7 +2856,18 @@
      //console.log(this.form);
      //为form绑定值
      this.changeSectypeFormItems(condition == "add" ? null : row);
      // èŽ·å–å‰åŽç¼€å¯ç”¨å­—ç¬¦
      this.loadPreOrSuffixChars();
      // è¡¥ä½æ—¶å­—符
      // this.loadCodeFillSeparator();
      this.addBasicCodeSettingBox = true;
    },
    /** èŽ·å–å‰åŽç¼€å­—ç¬¦ */
    loadPreOrSuffixChars(){
      getSelectList({codeRuleId: this.selectionList[0].oid,chartType: "prefix"}).then(res=>{
        this.preFixOrSuffixChars = res.data.data;
        // console.log(this.preFixOrSuffixChars);
      })
    },
    /** æ–°å¢žåŸºç¡€ç æ®µ*/
    async saveOrEditBasicCode() {
@@ -3343,12 +3400,12 @@
        this.form.referConfig = "";
      }
    },
    /** è¡¥ä½æ—¶çš„字符,实现可输可选*/
    inputSelectBlur(e) {
    /** è¡¥ä½æ—¶çš„字符,实现可输可选 TODO:因为增加了可用字符集控制,所以这儿弃用了可用字符集的效果*/
    /*inputSelectBlur(e) {
      if (e.target.value) {
        this.form.codeFillSeparator = e.target.value;
      }
    },
    },*/
    /** ç æ®µç±»åž‹æ”¹å˜æ—¶ï¼Œå¢žåŠ å¯¹åº”çš„form表单中的属性*/
    changeSectypeFormItems(row) {
      //console.log(row)
@@ -3541,7 +3598,7 @@
      if (enumCach == null) {
        getDictionary({code: enumKey}).then((res) => {
          enumCach = res.data.data;
          localStorage.setItem(enumKey, JSON.stringify(res.data.data));
          localStorage.setItem(enumKey, JSON.stringify(enumCach));
        });
      }
      return enumCach;
@@ -3551,7 +3608,7 @@
      this.loadCodeSecType();
      this.loadCodeSecLength();
      this.loadCodeFillType();
      this.loadCodeFillSeparator();
      // this.loadCodeFillSeparator();
      this.loadCodeLevelType();
      this.loadCodeCutType();
      this.loadCodeGetValueType();
@@ -3570,15 +3627,14 @@
    loadCodeFillSeparator() {
      //let enumCach = JSON.parse(localStorage.getItem("codeFillSeparator"));
      //if (enumCach == null) {
      getDictionaryBiz({code: "codeFillSeparator"}).then((res) => {
      getSelectList({codeRuleId: this.selectionList[0].oid,chartType: "fillerChar"}).then((res) => {
        this.enumParam.codeFillSeparator = res.data.data;
        //console.log(this.enumParam.codeFillSeparator);
        localStorage.setItem(
          "codeFillSeparator",
          JSON.stringify(res.data.data)
        );
        // localStorage.setItem(
        //   "codeFillSeparator",
        //   JSON.stringify(res.data.data)
        // );
      });
      //}
    },
    loadCodeLevelType() {
      this.enumParam.codeLevelType = this.getLocalStorageEnum("codeLevelType") || [];
Source/UBCS-WEB/src/views/desk/notice.vue
@@ -53,7 +53,7 @@
        selectionList: [],
        option: {
          height: 'auto',
          calcHeight: 30,
          calcHeight: 20,
          dialogWidth: 950,
          columnBtn:false,
          tip: false,
Source/UBCS-WEB/src/views/docking/data.vue
@@ -87,7 +87,6 @@
    data:[],
    option: {
      height:'auto',
      calcHeight: 0,
      columnBtn:false,
      tip: false,
      searchShow: false,
Source/UBCS-WEB/src/views/flow/follow.vue
@@ -65,7 +65,7 @@
        deleteReason: '',
        option: {
          height: 'auto',
          calcHeight: 30,
          calcHeight: 20,
          columnBtn:false,
          tip: false,
          searchShow: true,
Source/UBCS-WEB/src/views/flow/manager.vue
@@ -121,7 +121,7 @@
        }],
        option: {
          height: 'auto',
          calcHeight: 30,
          calcHeight: 20,
          columnBtn:false,
          tip: false,
          searchShow: true,
Source/UBCS-WEB/src/views/flow/model.vue
@@ -202,7 +202,7 @@
      flowBox: false,
      option: {
        height: 'auto',
        calcHeight: 30,
        calcHeight: 20,
        columnBtn:false,
        tip: false,
        searchShow: true,
Source/UBCS-WEB/src/views/modeling/Version.vue
@@ -60,6 +60,7 @@
      form: {},
      option: {
        height: 'auto',
        calcHeight: 20,
        headerAlign: 'center',
        align: 'center',
        border: true,
Source/UBCS-WEB/src/views/monitor/log/api.vue
@@ -36,7 +36,7 @@
        },
        option: {
          height: 'auto',
          calcHeight: 30,
          calcHeight: 20,
          columnBtn:false,
          tip: false,
          searchShow: true,
Source/UBCS-WEB/src/views/monitor/log/error.vue
@@ -36,7 +36,7 @@
        },
        option: {
          height: 'auto',
          calcHeight: 30,
          calcHeight: 20,
          columnBtn:false,
          tip: false,
          searchShow: true,
Source/UBCS-WEB/src/views/monitor/log/operateLog.vue
@@ -45,7 +45,7 @@
        },
        option: {
          height: 'auto',
          calcHeight: 30,
          calcHeight: 20,
          columnBtn:false,
          tip: false,
          searchShow: true,
Source/UBCS-WEB/src/views/monitor/log/usual.vue
@@ -36,7 +36,7 @@
        },
        option: {
          height: 'auto',
          calcHeight: 30,
          calcHeight: 20,
          columnBtn:false,
          tip: false,
          searchShow: true,
Source/UBCS-WEB/src/views/report/reportlist.vue
@@ -68,7 +68,7 @@
      },
      option: {
        height: 'auto',
        calcHeight: 30,
        calcHeight: 20,
        columnBtn:false,
        tip: false,
        searchShow: true,
Source/UBCS-WEB/src/views/resource/attach.vue
@@ -75,7 +75,7 @@
        option: {
          columnBtn:false,
          height: 'auto',
          calcHeight: 30,
          calcHeight: 20,
          tip: false,
          searchShow: true,
          searchMenuSpan: 6,
Source/UBCS-WEB/src/views/resource/oss.vue
@@ -80,7 +80,7 @@
        option: {
          columnBtn:false,
          height: 'auto',
          calcHeight: 30,
          calcHeight: 20,
          tip: false,
          searchShow: true,
          searchMenuSpan: 6,
Source/UBCS-WEB/src/views/ruleBasic/delimiterConfig.vue
@@ -132,7 +132,7 @@
<script>
import {getList, addSave, editSave, deleteSave} from "@/api/code/codeCharcter"
import {gridCodeRule} from "@/api/code/codeCharcter"
import {gridCodeRule} from "@/api/code/mdmrule"
export default {
  name: "usableCharacter",
@@ -195,7 +195,7 @@
    async getCodeRule() {
      try {
        // ç¼–码规则已发布数据源
        const res = await gridCodeRule({["conditionMap" + "[lcStatus_like]"]: "Released"});
        const res = await gridCodeRule(1,-1);
        this.characterReleasedList = res.data.data.records;
        this.queryReleasedList = this.characterReleasedList;
        this.select = this.characterReleasedList[0].oid;
Source/UBCS-WEB/src/views/ruleBasic/paddingCharacter.vue
@@ -132,7 +132,7 @@
<script>
import {getList, addSave, editSave, deleteSave} from "@/api/code/codeCharcter"
import {gridCodeRule} from "@/api/code/codeCharcter"
import {gridCodeRule} from "@/api/code/mdmrule"
export default {
  name: "usableCharacter",
@@ -195,7 +195,7 @@
    async getCodeRule() {
      try {
        // ç¼–码规则已发布数据源
        const res = await gridCodeRule({["conditionMap" + "[lcStatus_like]"]: "Released"});
        const res = await gridCodeRule(1,-1);
        this.characterReleasedList = res.data.data.records;
        this.queryReleasedList = this.characterReleasedList;
        this.select = this.characterReleasedList[0].oid;
@@ -227,7 +227,7 @@
      // const targetObject = this.characterReleasedList.find(obj => obj.oid === this.selectValue);
      // const chartValue = targetObject.name;
      getList({codeRuleId: this.select, chartType: "fillerChar", chartValue: this.characterValue}).then(res => {
        console.log(res.data.data);
        // console.log(res.data.data);
        this.tableData = res.data.data;
        this.loading = false;
      });
Source/UBCS-WEB/src/views/ruleBasic/prefixConfig.vue
@@ -8,7 +8,7 @@
                   @change="selectHandler">
          <el-option v-for="(item,index) in queryReleasedList"
                     :key="item.oid"
                     :label="item.name"
                     :label="item.name + ' (' + item.id + ')'"
                     :value="item.oid"></el-option>
        </el-select>
      </div>
@@ -132,7 +132,7 @@
<script>
import {getList, addSave, editSave, deleteSave} from "@/api/code/codeCharcter"
import {gridCodeRule} from "@/api/code/codeCharcter"
import {gridCodeRule} from "@/api/code/mdmrule"
export default {
  name: "usableCharacter",
@@ -194,8 +194,8 @@
    },
    async getCodeRule() {
      try {
        // ç¼–码规则已发布数据源
        const res = await gridCodeRule({["conditionMap" + "[lcStatus_like]"]: "Released"});
        // ç¼–码规则已发布(TODO:2024/1/22改:按照需求应该是都查询)数据源
        const res = await gridCodeRule(1,-1);
        this.characterReleasedList = res.data.data.records;
        this.queryReleasedList = this.characterReleasedList;
        this.select = this.characterReleasedList[0].oid;
@@ -227,7 +227,7 @@
      // const targetObject = this.characterReleasedList.find(obj => obj.oid === this.selectValue);
      // const chartValue = targetObject.name;
      getList({codeRuleId: this.select, chartType: "prefix", chartValue: this.characterValue}).then(res => {
        console.log(res.data.data);
        // console.log(res.data.data);
        this.tableData = res.data.data;
        this.loading = false;
      });
Source/UBCS-WEB/src/views/ruleBasic/usableCharacter.vue
@@ -70,7 +70,7 @@
<script>
import {getList, addSave, editSave, deleteSave} from "@/api/code/codeCharcter"
import {gridCodeRule} from "@/api/code/codeCharcter"
import {gridCodeRule} from "@/api/code/mdmrule"
export default {
  name: "usableCharacter",
@@ -136,7 +136,7 @@
    async getCodeRule() {
      try {
        // ç¼–码规则已发布数据源
        const res = await gridCodeRule({["conditionMap" + "[lcStatus_like]"]: "Released"});
        const res = await gridCodeRule(1,-1);
        this.characterReleasedList = res.data.data.records;
        this.queryReleasedList = this.characterReleasedList;
        this.select = this.characterReleasedList[0].oid;
Source/UBCS-WEB/src/views/system/PasswordManagement/passwords.vue
@@ -93,6 +93,8 @@
    },
    option() {
      return {
        height: 'auto',
        calcHeight: 20,
        headerAlign: 'center',
        align: 'center',
        columnBtn: false,
@@ -101,7 +103,6 @@
        rowKey: 'id',
        addBtn: this.permissionList.addBtn,
        editBtn: false,
        height: 700,
        delBtn: false,
        refreshBtn: false,
        column: [
Source/UBCS-WEB/src/views/system/client.vue
@@ -51,7 +51,7 @@
        option: {
          height: 'auto',
          columnBtn:false,
          calcHeight: 30,
          calcHeight: 20,
          tip: false,
          searchShow: true,
          searchMenuSpan: 6,
Source/UBCS-WEB/src/views/system/dept.vue
@@ -77,6 +77,7 @@
          lazy: true,
          tip: false,
          height:'auto',
          calcHeight: 20,
          maxHeight:600,
          columnBtn:false,
          //simplePage: true,
@@ -196,7 +197,7 @@
      };
    },
    created() {
    },
    computed: {
      ...mapGetters(["userInfo", "permission"]),
Source/UBCS-WEB/src/views/system/tenant.vue
@@ -231,7 +231,7 @@
      return{
          height: 'auto',
          columnBtn:false,
          calcHeight: 30,
          calcHeight: 20,
          tip: false,
          searchShow: true,
          searchMenuSpan: 6,
Source/UBCS-WEB/src/views/system/user.vue
@@ -434,7 +434,7 @@
    option() {
      return{
          height:'auto',
          calcHeight: 80,
          calcHeight: 70,
          tip: false,
          searchShow: true,
          searchMenuSpan: 6,
Source/UBCS-WEB/vue.config.js
@@ -30,8 +30,9 @@
        // target: 'http://192.168.1.51:37000',
        // target: 'http://dev.vci-tech.com:37000',
        //yxc
        // target: 'http:// 192.168.0.100:37000',
        // target: 'http://192.168.0.105:37000',
        // target: 'http:// 192.168.43.131:37000',
        //ldc
        // target: 'http://192.168.0.100:37000',
        // target: 'http://192.168.0.103:37000',
        // target: 'http://192.168.1.63:37000',
        // target: 'http://192.168.3.7:37000',
Source/UBCS/ubcs-service-api/ubcs-system-api/src/main/java/com/vci/ubcs/system/entity/ClassifyAuth.java
@@ -9,7 +9,7 @@
import java.util.List;
/**
 * åˆ†ç±»æŽˆæƒå‚数对象
 * åˆ†ç±»æŽˆæƒï¼Œæ•°æ®æŽˆæƒå‚数对象
 * @author ludc
 * @date 2023/12/25 15:36
 */
@@ -40,4 +40,9 @@
     */
    private String buttonIds;
    /**
     * æŽˆæƒç±»åž‹
     */
    private String authType;
}
Source/UBCS/ubcs-service-api/ubcs-system-api/src/main/java/com/vci/ubcs/system/feign/ISysClient.java
@@ -112,7 +112,7 @@
     * @return List<Menu>
     */
    @GetMapping(MENU_BUTTON)
    R<List<Menu>> getMenuButtonByType(@RequestParam("btmType") String btmType);
    R<List<Menu>> getMenuButtonByType(@RequestParam("classifyId") String classifyId,@RequestParam("btmType") String btmType,@RequestParam("authType") String authType);
    /**
     * èŽ·å–éƒ¨é—¨
@@ -392,6 +392,6 @@
    R<List<String>> getRegexByList(@RequestBody List<String> combinationIds);
    @GetMapping(GETVIEWCLASSIFY)
    R<List<String>> getViewClassByRoleIds(@RequestParam("roleIds") List<String> roleIds);
    R<List<String>> getViewClassByRoleIds(@RequestParam("roleIds") List<String> roleIds,@RequestParam("authType") String authType,@RequestParam("buttonCode") String buttonCode,@RequestParam("menuCode") String menuCode);
}
Source/UBCS/ubcs-service-api/ubcs-system-api/src/main/java/com/vci/ubcs/system/feign/ISysClientFallback.java
@@ -48,7 +48,7 @@
    }
    @Override
    public R<List<Menu>> getMenuButtonByType(String btmType) {
    public R<List<Menu>> getMenuButtonByType(String classifyId, String btmType, String authType) {
        return R.fail("获取数据失败");
    }
@@ -200,9 +200,8 @@
    }
    @Override
    public R<List<String>> getViewClassByRoleIds(List<String> roleIds) {
    public R<List<String>> getViewClassByRoleIds(List<String> roleIds,String authType,String buttonCode,String menuCode) {
        return R.fail("获取数据失败");
    }
}
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/controller/CodeFixedValueController.java
@@ -14,6 +14,7 @@
import org.springblade.core.mp.support.Condition;
import org.springblade.core.mp.support.Query;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.Func;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.CollectionUtils;
import org.springframework.web.bind.annotation.*;
@@ -126,7 +127,7 @@
    @PostMapping("/saveOrder")
    public R batchSave4Order(@RequestBody Map<String,Object> param){
        JSONArray json = JSONArray.parseArray(String.valueOf(param.get("dtoList")));
        List<CodeFixedValueDTO> dtoList = new ArrayList<>();
        List<CodeFixedValueDTO> dtoList = new ArrayList<>();
        for (int i = 0; i < json.size(); i++) {
            CodeFixedValueDTO codeFixedValueDTO = JSONObject.toJavaObject(JSONObject.parseObject(JSONObject.toJSONString(json.get(i))), CodeFixedValueDTO.class);
            dtoList.add(codeFixedValueDTO);
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/controller/CodeRuleCharacterController.java
@@ -6,6 +6,7 @@
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.rmi.ServerException;
import java.util.List;
import java.util.Map;
@@ -17,8 +18,10 @@
@RestController
@RequestMapping("/codeRuleCharacterController")
public class CodeRuleCharacterController {
    @Resource
     private ICodeRuleCharacterService iCodeRuleCharacterService;
    /**
     * ä½¿ç”¨ç¼–码规则oid获取数据
     * @param codeRuleId è§„则oid
@@ -28,6 +31,27 @@
    public R<List<Map<String,String>>> getDataByOid(@RequestParam("codeRuleId")String codeRuleId,@RequestParam("chartType")String chartType){
        return R.data(iCodeRuleCharacterService.getDataByRuleId(codeRuleId,chartType));
    }
    /**
     * ä½¿ç”¨ç¼–码规则oid获取数据下拉数据源
     * @param codeRuleId è§„则oid
     * @return æ•°æ®å†…容
     */
    @GetMapping("/selectList")
    public R<List<Map<String, String>>> getSelectListByRuleId(@RequestParam("codeRuleId")String codeRuleId,@RequestParam("chartType")String chartType) throws ServerException {
        return R.data(iCodeRuleCharacterService.getSelectListByRuleId(codeRuleId,chartType));
    }
    /**
     * ä½¿ç”¨ç¼–码规则oid获取数据下拉数据源
     * @param codeRuleId è§„则oid
     * @return æ•°æ®å†…容
     */
    @GetMapping("/getRegexStr")
    public R<String> getRegexStrByCodeRuleId(@RequestParam("codeRuleId")String codeRuleId,@RequestParam("chartType")String chartType) throws ServerException {
        return R.data(iCodeRuleCharacterService.getRegexStrByCodeRuleId(codeRuleId,chartType));
    }
    /**
     * ä¿å­˜è§„则对象
     * @param codeRuleCharacterVO è§„则字符对象
@@ -37,6 +61,7 @@
    public R addSave(@RequestBody CodeRuleCharacterVO codeRuleCharacterVO){
        return iCodeRuleCharacterService.saveOrUpdate(codeRuleCharacterVO,1);
    }
    /**
     * ä¿®æ”¹è§„则对象
     * @param codeRuleCharacterVO è§„则字符对象
@@ -56,4 +81,5 @@
    public R delete(@RequestBody CodeRuleCharacterVO codeRuleCharacterVO){
        return iCodeRuleCharacterService.saveOrUpdate(codeRuleCharacterVO,3);
    }
}
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/ICodeClassifyService.java
@@ -134,14 +134,14 @@
     * @param treeQueryObject æ ‘形查询对象
     * @return ä¸»é¢˜åº“分类显示树
     */
    List<Tree> referTree(TreeQueryObject treeQueryObject);
    List<Tree> referTree(TreeQueryObject treeQueryObject) throws ServiceException;
    /**
     * æŸ¥è¯¢ä¸»é¢˜åº“分类 æ ‘
     * @param treeQueryObject æ ‘查询对象
     * @return ä¸»é¢˜åº“分类 æ˜¾ç¤ºæ ‘
     */
    List<Tree> treeCodeClassify(TreeQueryObject treeQueryObject);
    List<Tree> treeCodeClassify(TreeQueryObject treeQueryObject) throws ServiceException;
    /**
     * å¯¼å‡ºåˆ†ç±»
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/ICodeRuleCharacterService.java
@@ -10,6 +10,7 @@
import com.vci.ubcs.starter.exception.VciBaseException;
import org.springblade.core.tool.api.R;
import java.rmi.ServerException;
import java.util.List;
import java.util.Map;
@@ -29,6 +30,24 @@
     */
    List<Map<String,String>> getDataByRuleId(String codeRuleId,String chartType)throws VciBaseException;
    /**
     * ä¸‹æ‹‰æ•°æ®æº
     * @param codeRuleId
     * @param chartType
     * @return
     * @throws VciBaseException
     */
    List<Map<String, String>> getSelectListByRuleId(String codeRuleId,String chartType) throws ServerException;
    /**
     * å­—符集正则拼装
     * @param codeRuleId
     * @param chartType
     * @return
     * @throws VciBaseException
     */
    String getRegexStrByCodeRuleId(String codeRuleId,String chartType) throws ServerException;
    /***
     * ä¿å­˜ç¼–码规则字符集
     * @param codeRuleCharacterVO
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/impl/CodeClassifyServiceImpl.java
@@ -71,6 +71,7 @@
import java.awt.event.ItemEvent;
import java.io.File;
import java.util.*;
import java.util.concurrent.ForkJoinPool;
import java.util.stream.Collectors;
import java.util.stream.Stream;
@@ -116,6 +117,7 @@
    @Resource
    private CodeBasicSecMapper codeBasicSecMapper;
    /**
     * ä¸Šçº§èŠ‚ç‚¹çš„å±žæ€§åç§°
     */
@@ -510,7 +512,7 @@
     * @return ä¸»é¢˜åº“分类显示树
     */
    @Override
    public List<Tree> referTree(TreeQueryObject treeQueryObject) {
    public List<Tree> referTree(TreeQueryObject treeQueryObject) throws ServiceException{
        if(treeQueryObject == null){
            treeQueryObject = new TreeQueryObject();
        }
@@ -520,7 +522,7 @@
        if(treeQueryObject.getConditionMap().containsKey(LC_STATUS)) {
            treeQueryObject.getConditionMap().remove(LC_STATUS);
        }
        if(treeQueryObject.getExtandParamsMap() ==null || !treeQueryObject.getExtandParamsMap().containsKey(REFER_SHOW_DISABLED_QUERY_KEY)) {
        if(treeQueryObject.getExtandParamsMap() == null || !treeQueryObject.getExtandParamsMap().containsKey(REFER_SHOW_DISABLED_QUERY_KEY)) {
        }
        treeQueryObject.getConditionMap().put(LC_STATUS, FRAMEWORK_DATA_ENABLED);
        return treeCodeClassify(treeQueryObject);
@@ -550,7 +552,7 @@
     * @return ä¸»é¢˜åº“分类 æ˜¾ç¤ºæ ‘
     */
    @Override
    public List<Tree> treeCodeClassify(TreeQueryObject treeQueryObject) {
    public List<Tree> treeCodeClassify(TreeQueryObject treeQueryObject) throws ServiceException{
        List<CodeClassify> doList = null;
        String id = null;
        String lcStatus = null;
@@ -578,33 +580,35 @@
        List<CodeClassifyVO> voList = codeClassifyDO2VOs(doList);
        TreeWrapperOptions treeWrapperOptions = new TreeWrapperOptions(PARENT_FIELD_NAME);
        treeWrapperOptions.copyFromTreeQuery(treeQueryObject);
        List<Tree> tree= revisionModelUtil.doList2Trees(voList,treeWrapperOptions,(CodeClassifyVO s) ->{
        List<Tree> tree = revisionModelUtil.doList2Trees(voList,treeWrapperOptions,(CodeClassifyVO s) ->{
            //可以在这里处理树节点的显示
            return s.getId() + " " + s.getName() + (FrameworkDataLCStatus.DISABLED.getValue().equalsIgnoreCase(s
                .getLcStatus()) ? (" ã€åœç”¨ã€‘ ") : "");
        });
        //超管显示所有分类
        if(VciBaseUtil.checkAdminTenant()){
            Iterator var6 =  tree.listIterator();
            while(var6.hasNext()){
                Tree trees = (Tree) var6.next();
                boolean checkHasChild=codeClassifyMapper.checkHasChild(trees.getOid());
                if(checkHasChild){
                    trees.setLeaf(false);
                }else{
                    trees.setLeaf(true);
                }
            }
        }else {
        // éžè¶…管过滤未授权的分类
        if(!VciBaseUtil.checkAdminTenant()){
            // é‚£äº›åˆ†ç±»å…·å¤‡æŸ¥çœ‹æƒé™
            R<List<String>> viewClassByRoleIds = sysClient.getViewClassByRoleIds(Arrays.asList(AuthUtil.getUser().getRoleId().split(",")));
            R<List<String>> viewClassByRoleIds = sysClient.getViewClassByRoleIds(
                Arrays.asList(AuthUtil.getUser().getRoleId().split(",")),
                treeQueryObject.getConditionMap().getOrDefault("authType","classify_auth"),
                treeQueryObject.getConditionMap().getOrDefault("buttonCode","classify_view"),
                treeQueryObject.getConditionMap().getOrDefault("menuCode","classifyTree")
            );
            // è¯·æ±‚失败或者请求得到的具备查看权限的分类id集合为空
            if(!viewClassByRoleIds.isSuccess() && !viewClassByRoleIds.getData().isEmpty()){
                return new ArrayList<>();
            if(!viewClassByRoleIds.isSuccess() && viewClassByRoleIds.getData().isEmpty()){
                throw new ServiceException("主数据查看权限未配置,或配置有误!");
            }
            long startTime = System.currentTimeMillis();
            // è¿‡æ»¤
            filterTreeNodes(tree,viewClassByRoleIds.getData());
            long endTime = System.currentTimeMillis();
            System.out.println(("执行时间:"+(endTime-startTime)/1000)+"s");
        }
        // åŠ è½½åˆ†ç±»æ˜¯å¦å…·æœ‰å­åˆ†ç±»
        tree.parallelStream().forEach(item -> {
            boolean checkHasChild = checkHasChild(item.getOid());
            item.setLeaf(!checkHasChild);
        });
        return tree;
    }
@@ -617,8 +621,8 @@
        Iterator<Tree> iterator = trees.iterator();
        while (iterator.hasNext()) {
            Tree tree = iterator.next();
            Boolean checkHasChild = codeClassifyMapper.checkHasChild(tree.getOid());
            tree.setLeaf(!checkHasChild);
            /*Boolean checkHasChild = checkHasChild(tree.getOid());
            tree.setLeaf(!checkHasChild);*/
            if (classifyIds.contains(tree.getOid())) {
                // å¦‚果顶层节点存在于 classifyIds ä¸­ï¼Œç›´æŽ¥ä¿ç•™å…¶å­èŠ‚ç‚¹é›†åˆ
                continue;
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/impl/CodeFixedValueServiceImpl.java
@@ -343,6 +343,9 @@
        List<CodeFixedValue> doList = codeFixedValueMapper.selectList(Wrappers.<CodeFixedValue>query()
            .lambda().eq(CodeFixedValue::getCodeFixedSecOid,codefixedsecoid)
        );
        if(doList.isEmpty()){
            return false;
        }
        boolean resBoolean = codeFixedValueMapper.deleteBatchIds(doList.stream().map(CodeFixedValue::getOid).collect(Collectors.toList())) > 0;
        return resBoolean;
    }
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/impl/CodeRuleCharacterServiceImpl.java
@@ -1,6 +1,5 @@
package com.vci.ubcs.code.service.impl;
import com.alibaba.nacos.common.utils.CollectionUtils;
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
@@ -10,14 +9,15 @@
import com.vci.ubcs.code.service.ICodeRuleCharacterService;
import com.vci.ubcs.code.vo.pagemodel.CodeRuleCharacterVO;
import com.vci.ubcs.starter.exception.VciBaseException;
import com.vci.ubcs.starter.poi.bo.SheetRowData;
import com.vci.ubcs.starter.util.DefaultAttrAssimtUtil;
import com.vci.ubcs.starter.web.util.VciBaseUtil;
import lombok.AllArgsConstructor;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.Func;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.rmi.ServerException;
import java.util.*;
import java.util.stream.Collectors;
@@ -27,10 +27,11 @@
 * @date 2023-11-30
 */
@Service
@AllArgsConstructor
public class CodeRuleCharacterServiceImpl extends ServiceImpl<CodeRuleCharacterMapper, CodeRuleCharacter> implements ICodeRuleCharacterService {
    @Autowired
    private CodeRuleCharacterMapper codeRuleCharacterMapper;
    private final CodeRuleCharacterMapper codeRuleCharacterMapper;
    /***
     * ä½¿ç”¨ç¼–码规则oid获取数据
     * @param codeRuleId
@@ -57,9 +58,44 @@
                charValueList.add(chartMap);
            }
        }
        return charValueList;
    }
    /***
     * ä½¿ç”¨ç¼–码规则oid获取数据
     * @param codeRuleId
     * @param chartType
     * @return
     * @throws VciBaseException
     */
    @Override
    public List<Map<String, String>> getSelectListByRuleId(String codeRuleId,String chartType) throws ServerException {
        List<Map<String, String>> charValueMap = new ArrayList<>();
        CodeRuleCharacter codeRuleCharacter=codeRuleCharacterMapper.selectOne(Wrappers.<CodeRuleCharacter>query().lambda().eq(CodeRuleCharacter::getCodeRuleId,codeRuleId).eq(CodeRuleCharacter::getChartType,chartType));
        if(codeRuleCharacter!=null&&StringUtils.isNotBlank(codeRuleCharacter.getOid())){
            List<Character> characterList=codeRuleCharacter.getChartValue().chars().mapToObj(c -> (char) c).collect(Collectors.toList());
            characterList.stream().forEach(item->{
                Map<String, String> map = new HashMap<>();
                map.put("lable",item.toString());
                map.put("value",item.toString());
                charValueMap.add(map);
            });
        }
        return charValueMap;
    }
    @Override
    public String getRegexStrByCodeRuleId(String codeRuleId, String chartType) throws ServerException {
        StringBuilder regexStr = new StringBuilder();
        CodeRuleCharacter codeRuleCharacter=codeRuleCharacterMapper.selectOne(Wrappers.<CodeRuleCharacter>query().lambda().eq(CodeRuleCharacter::getCodeRuleId,codeRuleId).eq(CodeRuleCharacter::getChartType,chartType));
        if(codeRuleCharacter!=null&&StringUtils.isNotBlank(codeRuleCharacter.getOid())){
            regexStr.append("^[");
            regexStr.append(codeRuleCharacter.getChartValue());
            regexStr.append("]+$");
        }
        return regexStr.toString();
    }
    /***
     * å­—符集数据保存
     * @param codeRuleCharacterVO
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/impl/MdmEngineServiceImpl.java
ÎļþÌ«´ó
Source/UBCS/ubcs-service/ubcs-system/src/main/java/com/vci/ubcs/system/controller/ClassifyAuthController.java
@@ -1,7 +1,6 @@
package com.vci.ubcs.system.controller;
import com.vci.ubcs.system.entity.ClassifyAuth;
import com.vci.ubcs.system.entity.Menu;
import com.vci.ubcs.system.service.IClassifyAuthService;
import com.vci.ubcs.system.vo.ClassifyAuthVO;
import io.swagger.annotations.Api;
@@ -11,11 +10,12 @@
import org.springframework.web.bind.annotation.*;
import springfox.documentation.annotations.ApiIgnore;
import javax.validation.Valid;
import java.util.List;
import java.util.Map;
/**
 * åˆ†ç±»æŽˆæƒ
 * åˆ†ç±»æŽˆæƒ,数据授权
 * @author ludc
 * @date 2023/12/20 11:33
 */
@@ -52,11 +52,13 @@
    /**
     * æŸ¥è¯¢è¯¥åˆ†ç±»ä¸‹ï¼Œå½“前登录的角色有哪些按钮权限
     * @param classifyId
     * @param menuCode
     * @param authType
     * @return
     */
    @GetMapping("/getAuthButtonList")
    public R<Map<String,Boolean>> getAuthButtonList(@RequestParam("classifyId") String classifyId){
        return R.data(classifyAuthService.getAuthButtonList(classifyId));
    public R<Map<String,Boolean>> getAuthButtonList(@Valid @RequestParam("classifyId") String classifyId,@Valid @RequestParam("code") String menuCode,@Valid @RequestParam("authType") String authType){
        return R.data(classifyAuthService.getAuthButtonList(classifyId,menuCode,authType));
    }
}
Source/UBCS/ubcs-service/ubcs-system/src/main/java/com/vci/ubcs/system/controller/MenuController.java
@@ -317,4 +317,14 @@
        return menuService.cloneMenuButton(buttonCloneVO.getMenuId(), buttonCloneVO.getButtonIds());
    }
    /**
     * æ ¹æ®è§’色id获取已授权的按钮信息
     * @param roleId
     * @return
     */
    @GetMapping("/getButtonsByRoleId")
    public R<List<Menu>> getButtonsByRoleId(@Valid @RequestParam("roleId") String roleId,@Valid @RequestParam("code") String menuCode){
        return R.data(menuService.getButtonsByRoleId(roleId,menuCode));
    }
}
Source/UBCS/ubcs-service/ubcs-system/src/main/java/com/vci/ubcs/system/controller/RoleController.java
@@ -22,6 +22,7 @@
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.vci.ubcs.system.cache.NacosConfigCache;
import com.vci.ubcs.system.cache.SysCache;
import com.vci.ubcs.system.entity.Menu;
import com.vci.ubcs.system.entity.Role;
import com.vci.ubcs.system.service.IRoleService;
import com.vci.ubcs.system.user.cache.UserCache;
Source/UBCS/ubcs-service/ubcs-system/src/main/java/com/vci/ubcs/system/feign/SysClient.java
@@ -83,8 +83,8 @@
    @Override
    @GetMapping(MENU_BUTTON)
    public R<List<Menu>> getMenuButtonByType(String btmType) {
        return R.data(menuService.getMenuButtonByType(btmType, AuthUtil.getUserId()));
    public R<List<Menu>> getMenuButtonByType(String classifyId,String btmType,String authType) {
        return R.data(menuService.getMenuButtonByType(classifyId,btmType,authType));
    }
    @Override
@@ -264,8 +264,8 @@
        return R.data(mdmCountConfigService.getMdmCountConfig(userId));
    }
    public R<List<String>> getViewClassByRoleIds(List<String> roleIds){
        return R.data(classifyAuthService.getViewClassByRoleIds(roleIds));
    public R<List<String>> getViewClassByRoleIds(List<String> roleIds,String authType,String buttonCode,String menuCode){
        return R.data(classifyAuthService.getViewClassByRoleIds(roleIds,authType,buttonCode,menuCode));
    }
}
Source/UBCS/ubcs-service/ubcs-system/src/main/java/com/vci/ubcs/system/mapper/ClassifyAuthMapper.java
@@ -7,6 +7,7 @@
import java.util.List;
/**
 * åˆ†ç±»æŽˆæƒ,数据授权
 * @author ludc
 * @date 2023/12/25 15:50
 */
@@ -14,6 +15,6 @@
    List<ClassifyAuth> getClassifyAuthList(@Param("classifyId") String classifyId);
    List<String> getViewClassByRoleIds(@Param("roleIds") List<String> roleIds);
    List<String> getViewClassByRoleIds(@Param("roleIds") List<String> roleIds,@Param("authType") String authType,@Param("buttonCode") String buttonCode,@Param("menuCode") String menuCode);
}
Source/UBCS/ubcs-service/ubcs-system/src/main/java/com/vci/ubcs/system/mapper/MenuMapper.java
@@ -135,11 +135,18 @@
    List<Menu> selectMenuChildByBtnType(String btmType,List<String> roleIds);
    /**
     * æ ¹æ®çˆ¶èœå•code查询菜单的子按钮
     * æ ¹æ®çˆ¶èœå•code和角色id获取已授权的按钮信息
     *
     * @return
     */
    List<Menu> getButtonByParentCode(@Param("code") String code);
    List<Menu> getButtonsByRoleIdAndCode(@Param("roleId") String roleId, @Param("code") String code);
    /**
     * æ ¹æ®çˆ¶èœå•code和角色id获取已授权的按钮信息
     *
     * @return
     */
    List<Menu> getButtonByIdsOrByParentCode(@Param("roleIds") String roleIds, @Param("code") String code,@Param("ids") List<String> ids);
    /**
     * æƒé™é…ç½®èœå•
Source/UBCS/ubcs-service/ubcs-system/src/main/java/com/vci/ubcs/system/service/IClassifyAuthService.java
@@ -10,7 +10,7 @@
import java.util.Map;
/**
 * åˆ†ç±»æŽˆæƒ
 * åˆ†ç±»æŽˆæƒ,数据授权
 * @author ludc
 * @date 2023/12/25 15:34
 */
@@ -33,15 +33,26 @@
    /**
     * æŸ¥è¯¢è¯¥åˆ†ç±»ä¸‹ï¼Œå½“前登录的角色有哪些按钮权限
     * @param classifyId
     * @param menuCode
     * @param authType
     * @return
     */
    Map<String,Boolean> getAuthButtonList(String classifyId);
    Map<String,Boolean> getAuthButtonList(String classifyId,String menuCode,String authType);
    /**
     * æŸ¥è¯¢è¯¥ä¸»æ•°æ®ä¸‹ï¼Œå½“前登录的角色有哪些按钮权限
     * @param classifyId
     * @param menuCode
     * @param authType
     * @return
     */
    List<Menu> getAuthMenuButtonList(String classifyId,String menuCode,String authType);
    /**
     * æ ¹æ®è§’色id查看有哪些分类具备查看权限
     * @param roleIds
     * @return
     */
    List<String> getViewClassByRoleIds(List<String> roleIds);
    List<String> getViewClassByRoleIds(List<String> roleIds,String authType,String buttonCode,String menuCode);
}
Source/UBCS/ubcs-service/ubcs-system/src/main/java/com/vci/ubcs/system/service/IMenuService.java
@@ -175,10 +175,12 @@
    /**
     * èŽ·å–èœå•ä¸‹é¢çš„æŒ‰é’®
     * @param btmType ä¸šåŠ¡ç±»åž‹
     * @return List<Menu>
     * @param classifyId
     * @param btmType
     * @param authType
     * @return
     */
    List<Menu> getMenuButtonByType(String btmType,Long userId);
    List<Menu> getMenuButtonByType(String classifyId,String btmType, String authType);
    /**
     * æ ¹æ®code和用户id查询菜单信息
@@ -214,7 +216,18 @@
    /**
     * æ ¹æ®ä¸»é”®èŽ·å–èœå•ä¿¡æ¯
     * @param ids
     * @param menuCode
     * @param roleIds
     * @return
     */
    List<Menu> getMenuListById(List<String> ids,String parentId);
    List<Menu> getMenuListByCode(List<String> ids,String menuCode,String roleIds);
    /**
     * æ ¹æ®è§’色id获取已授权的按钮信息
     * @param roleId
     * @param menuCode
     * @return
     */
    List<Menu> getButtonsByRoleId(String roleId, String menuCode);
}
Source/UBCS/ubcs-service/ubcs-system/src/main/java/com/vci/ubcs/system/service/IRoleService.java
@@ -18,6 +18,7 @@
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;
import com.vci.ubcs.system.entity.Menu;
import com.vci.ubcs.system.entity.Role;
import com.vci.ubcs.system.vo.RoleVO;
import org.springblade.core.tool.api.R;
Source/UBCS/ubcs-service/ubcs-system/src/main/java/com/vci/ubcs/system/service/impl/ClassifyAuthServiceImpl.java
@@ -19,6 +19,8 @@
import org.springblade.core.secure.utils.AuthUtil;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.Func;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@@ -26,7 +28,7 @@
import java.util.stream.Collectors;
/**
 * åˆ†ç±»æŽˆæƒ
 * åˆ†ç±»æŽˆæƒ,数据授权
 * @author ludc
 * @date 2023/12/25 15:35
 */
@@ -87,7 +89,8 @@
            throw new ServiceException("缺少必传参数分类id");
        }
        LambdaQueryWrapper<ClassifyAuth> wrapper = Wrappers.<ClassifyAuth>query()
            .lambda().eq(ClassifyAuth::getClassifyId,classifyAuthVO.getClassifyId());
            .lambda().eq(ClassifyAuth::getClassifyId,classifyAuthVO.getClassifyId())
            .eq(ClassifyAuth::getAuthType,classifyAuthVO.getAuthType());
        List<ClassifyAuth> classifyAuths = this.classifyAuthMapper.selectList(wrapper);
        if(classifyAuths.isEmpty()){
            return new ArrayList<ClassifyAuthVO>();
@@ -98,9 +101,33 @@
    /**
     * æŸ¥è¯¢è¯¥åˆ†ç±»ä¸‹ï¼Œå½“前登录的角色有哪些按钮权限
     * @param classifyId
     * @param menuCode
     * @param authType
     * @return
     */
    public Map<String,Boolean> getAuthButtonList(String classifyId){
    public Map<String,Boolean> getAuthButtonList(String classifyId,String menuCode,String authType){
        List<Menu> menuList = this.getButtonList(classifyId, menuCode, authType);
        if(menuList.isEmpty()){
            return new HashMap<>();
        }
        Map<String, Boolean> buttonMaps = menuList.stream()
            .collect(Collectors.toMap(Menu::getCode, menu -> true));
        return buttonMaps;
    }
    /**
     * æŸ¥è¯¢è¯¥ä¸»æ•°æ®ä¸‹ï¼Œå½“前登录的角色有哪些按钮菜单权限
     * @param classifyId
     * @param menuCode
     * @param authType
     * @return
     */
    public List<Menu> getAuthMenuButtonList(String classifyId,String menuCode,String authType){
        List<Menu> buttonList = getButtonList(classifyId, menuCode, authType);
        return buttonList;
    }
    private List<Menu> getButtonList(String classifyId,String menuCode,String authType){
        if(Func.isBlank(classifyId)){
            throw new ServiceException("必传参数分类oid不能为空!");
        }
@@ -115,6 +142,7 @@
        // å…ˆæŸ¥è¯¢æŒ‰é’®id列表
        LambdaQueryWrapper<ClassifyAuth> wrapper = Wrappers.<ClassifyAuth>query()
            .lambda().eq(ClassifyAuth::getClassifyId, classifyId)
            .eq(ClassifyAuth::getAuthType,authType)
            .in(ClassifyAuth::getRoleId, roleIds);
        List<ClassifyAuth> classifyAuths = this.classifyAuthMapper.selectList(wrapper);
        //如果当前分类没有找到授权配置,就依次从当前节点往上层节点找授权配置,找到了就停止,没找到就一直找到最后
@@ -139,20 +167,14 @@
        Boolean isAdmin = VciBaseUtil.checkAdminTenant();
        // æœªé…ç½®æŒ‰é’®æƒé™
        if(!isAdmin && (classifyAuths.isEmpty() || Func.isBlank(classifyAuths.get(0).getButtonIds()))){
            return new HashMap<>();
            return new ArrayList<>();
        }
        List<String> condition1 = new ArrayList<>();
        List<String> ids = new ArrayList<>();
        // å¦‚果不是超管用户
        if(!isAdmin){
            condition1.addAll(Arrays.asList(classifyAuths.get(0).getButtonIds().split(",")));
            ids.addAll(Arrays.asList(classifyAuths.get(0).getButtonIds().split(",")));
        }
        List<Menu> menuList = menuService.getMenuListById(condition1,"1648879284590858241");
        if(menuList.isEmpty()){
            return new HashMap<>();
        }
        Map<String, Boolean> buttonMaps = menuList.stream()
            .collect(Collectors.toMap(Menu::getCode, menu -> true));
        return buttonMaps;
        return menuService.getMenuListByCode(ids,menuCode,roleIds);
    }
    /**
@@ -161,11 +183,11 @@
     * @return
     */
    @Override
    public List<String> getViewClassByRoleIds(List<String> roleIds) {
    public List<String> getViewClassByRoleIds(List<String> roleIds,String authType,String buttonCode,String menuCode) {
        if(roleIds.isEmpty()){
            return new ArrayList<>();
        }
        return this.classifyAuthMapper.getViewClassByRoleIds(roleIds);
        return this.classifyAuthMapper.getViewClassByRoleIds(roleIds, authType,buttonCode,menuCode);
    }
}
Source/UBCS/ubcs-service/ubcs-system/src/main/java/com/vci/ubcs/system/service/impl/MenuServiceImpl.java
@@ -21,18 +21,17 @@
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.vci.ubcs.code.feign.ICodeClassifyClient;
import com.vci.ubcs.starter.util.MybatisParameterUtil;
import com.vci.ubcs.starter.web.util.VciBaseUtil;
import com.vci.ubcs.system.cache.NacosConfigCache;
import com.vci.ubcs.system.cache.SysCache;
import com.vci.ubcs.system.dto.MenuDTO;
import com.vci.ubcs.system.entity.*;
import com.vci.ubcs.system.mapper.ClassifyAuthMapper;
import com.vci.ubcs.system.service.*;
import com.vci.ubcs.system.vo.MenuVO;
import com.vci.ubcs.system.mapper.MenuMapper;
import com.vci.ubcs.system.service.IMenuService;
import com.vci.ubcs.system.service.IRoleMenuService;
import com.vci.ubcs.system.service.IRoleScopeService;
import com.vci.ubcs.system.service.ITopMenuSettingService;
import com.vci.ubcs.system.wrapper.MenuWrapper;
import lombok.AllArgsConstructor;
import org.springblade.core.log.exception.ServiceException;
@@ -70,6 +69,8 @@
    private final IRoleScopeService roleScopeService;
    private final MenuMapper menuMapper;
    private final ITopMenuSettingService topMenuSettingService;
    private final ICodeClassifyClient codeClassifyClient;
    private final ClassifyAuthMapper classifyAuthMapper;
    private final static String PARENT_ID = "parentId";
    private final static Integer MENU_CATEGORY = 1;
@@ -98,7 +99,6 @@
        List<Menu> allMenus = baseMapper.allMenu();
        List<Menu> roleMenus;
        // è¶…级管理员并且不是顶部菜单请求则返回全部菜单
        // if (AuthUtil.isAdministrator() && Func.isEmpty(topMenuId)) {
        if (VciBaseUtil.checkAdminTenant() && Func.isEmpty(topMenuId)) {
            roleMenus = allMenus;
        }
@@ -228,6 +228,7 @@
     * ç§Ÿæˆ·èœå•权限自定义筛选
     */
    private List<Menu> tenantPackageMenu(List<Menu> menu) {
        // ç§Ÿæˆ·åŒ…配置查询
        TenantPackage tenantPackage = SysCache.getTenantPackage(AuthUtil.getTenantId());
        if (Func.isNotEmpty(tenantPackage) && tenantPackage.getId() > 0L) {
            List<Long> menuIds = Func.toLongList(tenantPackage.getMenuId());
@@ -324,18 +325,63 @@
    }
    /**
     * èŽ·å–èœå•ä¸‹é¢çš„æŒ‰é’®
     * èŽ·å–èœå•ä¸‹é¢çš„æŒ‰é’®ï¼Œåˆ«ä¹±è°ƒç”¨ï¼Œè¿™ä¸ªæ–¹æ³•æ˜¯é’ˆå¯¹ä¸»æ•°æ®ç®¡ç†æŒ‰é’®æŸ¥è¯¢çš„
     * @param classifyId
     * @param btmType ä¸šåŠ¡ç±»åž‹
     * @return List<Menu>
     * @param authType
     * @return
     */
    @Override
    //@Cacheable(cacheNames = MENU_CACHE, key = "'auth:menuButton:'+ #btmType +':'+ #userId ")
    public List<Menu> getMenuButtonByType(String btmType,Long userId) {
        List<String> roleIds = null;
        if(!VciBaseUtil.checkAdminTenant()){
            roleIds = Arrays.asList(AuthUtil.getUser().getRoleId().split(","));
    public List<Menu> getMenuButtonByType(String classifyId,String btmType,String authType) {
        // baseMapper.selectMenuChildByBtnType(btmType,roleIds);
        if(Func.isBlank(classifyId)){
            throw new ServiceException("必传参数分类oid不能为空!");
        }
        return baseMapper.selectMenuChildByBtnType(btmType,roleIds);
        //查询分类节点的所有父级节点
        R<List<String>> listR = codeClassifyClient.selectAllParentOid(classifyId);
        if (!listR.isSuccess() && !listR.getData().isEmpty()) {
            throw new ServiceException("获取分类信息失败!");
        }
        // è¿”回的分类oid是当前节点为第一个,后面依次是他的上层节点
        List<String> classifyOidList = listR.getData();
        final String roleIds = AuthUtil.getUser().getRoleId();
        // å…ˆæŸ¥è¯¢æŒ‰é’®id列表
        LambdaQueryWrapper<ClassifyAuth> wrapper = Wrappers.<ClassifyAuth>query()
            .lambda().eq(ClassifyAuth::getClassifyId, classifyId)
            .eq(ClassifyAuth::getAuthType,authType)
            .in(ClassifyAuth::getRoleId, roleIds);
        List<ClassifyAuth> classifyAuths = classifyAuthMapper.selectList(wrapper);
        //如果当前分类没有找到授权配置,就依次从当前节点往上层节点找授权配置,找到了就停止,没找到就一直找到最后
        if(classifyAuths.isEmpty()){
            // ä¸‹æ ‡ä»Ž1开始因为当前节点0已经查询过
            for (int i = 1; i < classifyOidList.size(); i++) {
                classifyAuths = classifyAuthMapper.selectList(
                    Wrappers.<ClassifyAuth>query()
                        .lambda().eq(ClassifyAuth::getClassifyId, classifyOidList.get(i))
                        .in(ClassifyAuth::getRoleId, roleIds)
                );
                if(!classifyAuths.isEmpty()){
                    break;
                }
            }
        }
        //出现了错误数据,同一个角色和同一个分类id存在多条授权记录
        if(classifyAuths.size()>1){
            throw new ServiceException("角色和分类配置存在多条记录,请联系管理人员清理错误配置!");
        }
        // æ˜¯å¦ä¸ºè¶…管
        Boolean isAdmin = VciBaseUtil.checkAdminTenant();
        // æœªé…ç½®æŒ‰é’®æƒé™
        if(!isAdmin && (classifyAuths.isEmpty() || Func.isBlank(classifyAuths.get(0).getButtonIds()))){
            return new ArrayList<>();
        }
        List<String> ids = new ArrayList<>();
        // å¦‚果不是超管用户
        if(!isAdmin){
            ids.addAll(Arrays.asList(classifyAuths.get(0).getButtonIds().split(",")));
        }
        return this.getMenuListByCode(ids,btmType,roleIds);
    }
    /**
@@ -381,8 +427,7 @@
     */
    @Override
    public List<Menu> getButtonByParentCode(String code) {
        List<Menu> buttonList = menuMapper.getButtonByParentCode(code);
        return buttonList;
        return menuMapper.getButtonsByRoleIdAndCode(null,code);
    }
    /**
@@ -444,20 +489,31 @@
    /**
     * æ ¹æ®ä¸»é”®èŽ·å–èœå•ä¿¡æ¯
     * @param ids
     * @param menuCode
     * @param roleIds
     * @return
     */
    @Override
    public List<Menu> getMenuListById(List<String> ids,String parentId) {
        LambdaQueryWrapper<Menu> wrapper = Wrappers.<Menu>query()
            .lambda().eq(Menu::getCategory, "2")
            .eq(Menu::getIsDeleted,BladeConstant.DB_NOT_DELETED);
    public List<Menu> getMenuListByCode(List<String> ids,String menuCode,String roleIds){
        List<Menu> menuButtonList = null;
        if(VciBaseUtil.checkAdminTenant()){
            wrapper.eq(Menu::getParentId,parentId);
            // æ­£å¸¸æƒ…况下来说这个不存在为空的情况
            // æŸ¥è¯¢è¯¥èœå•下的所有按钮
            menuButtonList = menuMapper.getButtonByIdsOrByParentCode(null, menuCode, null);
        }else {
            wrapper.in(Menu::getId, ids);
            menuButtonList = menuMapper.getButtonByIdsOrByParentCode(roleIds,null,ids);
        }
        List<Menu> menuList = this.list(wrapper);
        return menuList;
        return menuButtonList;
    }
    /**
     * æ ¹æ®è§’色id获取已授权的按钮信息
     * @param roleId
     * @return
     */
    @Override
    public List<Menu> getButtonsByRoleId(String roleId, String menuCode) {
        return menuMapper.getButtonsByRoleIdAndCode(roleId,menuCode);
    }
}
Source/UBCS/ubcs-service/ubcs-system/src/main/java/com/vci/ubcs/system/service/impl/RoleServiceImpl.java
@@ -21,6 +21,7 @@
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.vci.ubcs.system.entity.Menu;
import com.vci.ubcs.system.mapper.RoleMapper;
import com.vci.ubcs.system.service.IMenuService;
import com.vci.ubcs.system.service.IRoleMenuService;
Source/UBCS/ubcs-service/ubcs-system/src/main/resources/mapper/ClassifyAuthMapper.xml
@@ -25,10 +25,18 @@
                #{item}
            </foreach>
        </if>
          AND BUTTON_IDS LIKE CONCAT('%', CONCAT((SELECT ID
                                                  FROM PL_SYS_MENU
                                                  WHERE CODE = 'classify_view'), '%'))
          AND AUTH_TYPE = #{authType}
          AND BUTTON_IDS LIKE CONCAT('%', CONCAT((
            SELECT
                pm.ID
            FROM
                PL_SYS_MENU ps,
                PL_SYS_MENU pm
            WHERE
                ps.CODE = #{buttonCode}
                AND ps.ID = pm.PARENT_ID
                AND pm.CODE = #{menuCode}
        ), '%'))
    </select>
Source/UBCS/ubcs-service/ubcs-system/src/main/resources/mapper/MenuMapper.xml
@@ -44,19 +44,19 @@
        <result column="key" property="key"/>
    </resultMap>
    <select id="lazyList"  resultMap="menuVOResultMap">
    <select id="lazyList" resultMap="menuVOResultMap">
        SELECT
            menu.*,
            (
                SELECT
                    CASE WHEN count( 1 ) > 0 THEN 1 ELSE 0 END
            FROM
                pl_sys_menu
            WHERE
                parent_id = menu.id AND is_deleted = 0
        menu.*,
        (
        SELECT
        CASE WHEN count( 1 ) > 0 THEN 1 ELSE 0 END
        FROM
        pl_sys_menu
        WHERE
        parent_id = menu.id AND is_deleted = 0
        ) AS "has_children"
        FROM
            pl_sys_menu menu
        pl_sys_menu menu
        WHERE menu.is_deleted = 0
        <if test="param1!=null">
            and menu.parent_id = #{param1}
@@ -75,17 +75,17 @@
    <select id="lazyMenuPage" resultMap="menuVOResultMap">
        SELECT
            menu.*,
            (
                SELECT
                    CASE WHEN count( 1 ) > 0 THEN 1 ELSE 0 END
        menu.*,
        (
        SELECT
        CASE WHEN count( 1 ) > 0 THEN 1 ELSE 0 END
        FROM
                pl_sys_menu
        pl_sys_menu
        WHERE
        parent_id = menu.id AND is_deleted = 0  AND category = 1
        parent_id = menu.id AND is_deleted = 0 AND category = 1
        ) AS "has_children"
        FROM
            pl_sys_menu menu
        pl_sys_menu menu
        WHERE menu.is_deleted = 0 AND menu.category = 1
        <if test="param1!=null">
            and menu.parent_id = #{param1}
@@ -103,11 +103,17 @@
    </select>
    <select id="tree" resultMap="treeNodeResultMap">
        select id, parent_id, name as title, id as "value", id as "key" from pl_sys_menu where is_deleted = 0 and category = 1
        select id, parent_id, name as title, id as "value", id as "key"
        from pl_sys_menu
        where is_deleted = 0
          and category = 1
    </select>
    <select id="allMenu" resultMap="menuResultMap">
        select * from pl_sys_menu where is_deleted = 0 and category = 1
        select *
        from pl_sys_menu
        where is_deleted = 0
          and category = 1
    </select>
    <select id="roleMenu" resultMap="menuResultMap">
@@ -127,49 +133,56 @@
    <select id="roleMenuByRoleId" resultMap="menuResultMap">
        select * from pl_sys_menu where is_deleted = 0 and id IN
            ( SELECT menu_id FROM pl_org_role_menu WHERE role_id IN
                <foreach collection="list" index="index" item="item" open="(" separator="," close=")">
                    #{item}
                </foreach>
            )
        ( SELECT menu_id FROM pl_org_role_menu WHERE role_id IN
        <foreach collection="list" index="index" item="item" open="(" separator="," close=")">
            #{item}
        </foreach>
        )
    </select>
    <select id="roleMenuByTopMenuId" resultMap="menuResultMap">
        select * from pl_sys_menu where is_deleted = 0 and id IN
        select *
        from pl_sys_menu
        where is_deleted = 0
          and id IN
              (
                  SELECT menu_id FROM pl_sys_top_menu_setting WHERE top_menu_id = #{param1}
                  SELECT menu_id
                  FROM pl_sys_top_menu_setting
                  WHERE top_menu_id = #{param1}
              )
    </select>
    <select id="routes" resultMap="menuResultMap">
        SELECT
            *
        *
        FROM
            pl_sys_menu
        pl_sys_menu
        WHERE
            is_deleted = 0 and category = 1
            and id IN ( SELECT menu_id FROM pl_org_role_menu WHERE role_id IN
                        <foreach collection="list" index="index" item="item" open="(" separator="," close=")">
                            #{item}
                        </foreach> )
        is_deleted = 0 and category = 1
        and id IN ( SELECT menu_id FROM pl_org_role_menu WHERE role_id IN
        <foreach collection="list" index="index" item="item" open="(" separator="," close=")">
            #{item}
        </foreach>
        )
    </select>
    <select id="allButtons" resultMap="menuResultMap">
        SELECT
            id,
            parent_id,
            CODE,
            NAME,
            alias,
            path,
            source,
        SELECT id,
               parent_id,
               CODE,
               NAME,
               alias,
               path,
               source,
            action,
            sort
        FROM
            pl_sys_menu
        WHERE
            (
                category = 2 OR id IN ( SELECT parent_id FROM pl_sys_menu WHERE is_deleted = 0 AND category = 2 )
            category = 2
           OR id IN ( SELECT parent_id FROM pl_sys_menu WHERE is_deleted = 0
          AND category = 2 )
            )
          AND is_deleted = 0
        ORDER BY sort
@@ -177,82 +190,78 @@
    <select id="buttons" resultMap="menuResultMap">
        SELECT * FROM (
            SELECT
                id,
                parent_id,
                code,
                name,
                alias,
                path,
                source,
                action,
                sort
            FROM
                pl_sys_menu
            WHERE
                is_deleted = 0 and id IN (
                  SELECT parent_id FROM pl_sys_menu
                  WHERE ( category = 2 AND id IN ( SELECT menu_id FROM pl_org_role_menu WHERE role_id IN
                    <foreach collection="list" index="index" item="item" open="(" separator="," close=")">
                        #{item}
                    </foreach>
                  ) ) )
            UNION ALL
        SELECT
        id,
        parent_id,
        code,
        name,
        alias,
        path,
        source,
        action,
        sort
        FROM
        pl_sys_menu
        WHERE
        is_deleted = 0 and id IN (
        SELECT parent_id FROM pl_sys_menu
        WHERE ( category = 2 AND id IN ( SELECT menu_id FROM pl_org_role_menu WHERE role_id IN
        <foreach collection="list" index="index" item="item" open="(" separator="," close=")">
            #{item}
        </foreach>
        ) ) )
        UNION ALL
            SELECT
                id,
                parent_id,
                code,
                name,
                alias,
                path,
                source,
                action,
                sort
            FROM
                pl_sys_menu
            WHERE
                is_deleted = 0 and  category = 2 AND id IN ( SELECT menu_id FROM pl_org_role_menu WHERE role_id IN
                <foreach collection="list" index="index" item="item" open="(" separator="," close=")">
                    #{item}
                </foreach>)
        SELECT
        id,
        parent_id,
        code,
        name,
        alias,
        path,
        source,
        action,
        sort
        FROM
        pl_sys_menu
        WHERE
        is_deleted = 0 and category = 2 AND id IN ( SELECT menu_id FROM pl_org_role_menu WHERE role_id IN
        <foreach collection="list" index="index" item="item" open="(" separator="," close=")">
            #{item}
        </foreach>)
        ) menu ORDER BY sort
    </select>
    <select id="getButtonByParentCode" resultMap="menuResultMap">
        SELECT
            id,
            parent_id,
            code,
            name,
            alias,
            PATH,
            SOURCE,
            ACTION,
            sort
        FROM
            PL_SYS_MENU
    <select id="getButtonsByRoleIdAndCode" resultMap="menuResultMap">
        SELECT pm.*
        FROM PL_SYS_MENU ps,
        PL_SYS_MENU pm
        <if test="roleId != null and roleId != ''">
            ,PL_ORG_ROLE_MENU prom
        </if>
        WHERE
            "CATEGORY" = '2'
          AND IS_DELETED = 0
          AND PARENT_ID IN (
            SELECT
            ID
            FROM
            PL_SYS_MENU
            WHERE
            CODE = #{code})
        ORDER BY SORT
        ps."CATEGORY" = 1
        <if test="roleId != null and roleId != ''">
            AND pm.ID = prom.MENU_ID
            AND prom.ROLE_ID = #{roleId}
        </if>
        AND pm.IS_DELETED = 0
        <if test="code != null and code != ''">
            AND ps.ID = pm.PARENT_ID
            AND ps.CODE = #{code}
        </if>
        ORDER BY pm.SORT ASC
    </select>
    <select id="grantTree" resultMap="treeNodeResultMap">
        select
               id,
        select id,
               parent_id,
               name as title,
               id as "value",
               id as "key"
        from pl_sys_menu where is_deleted = 0 order by sort
               id   as "value",
               id   as "key"
        from pl_sys_menu
        where is_deleted = 0
        order by sort
    </select>
    <select id="grantTreeByRole" resultMap="treeNodeResultMap">
@@ -260,102 +269,95 @@
        and id in ( select menu_id from pl_org_role_menu where role_id in
        <foreach collection="list" index="index" item="item" open="(" separator="," close=")">
            #{item}
        </foreach> )
        or id in (
            select parent_id from pl_sys_menu where is_deleted = 0
            and id in ( select menu_id from pl_org_role_menu where role_id in
            <foreach collection="list" index="index" item="item" open="(" separator="," close=")">
                #{item}
            </foreach> )
          )
        order by sort
    </select>
    <select id="grantTopTree" resultMap="treeNodeResultMap">
        select id, parent_id, name as title, id as "value", id as "key" from pl_sys_menu where category = 1 and is_deleted = 0 order by sort
    </select>
    <select id="grantTopTreeByRole" resultMap="treeNodeResultMap">
        select id, parent_id, name as title, id as "value", id as "key" from pl_sys_menu where category = 1 and is_deleted = 0
        and id in ( select menu_id from pl_org_role_menu where role_id in
        <foreach collection="list" index="index" item="item" open="(" separator="," close=")">
            #{item}
        </foreach> )
        </foreach>
        )
        or id in (
        select parent_id from pl_sys_menu where is_deleted = 0
        and id in ( select menu_id from pl_org_role_menu where role_id in
        <foreach collection="list" index="index" item="item" open="(" separator="," close=")">
            #{item}
        </foreach> )
        </foreach>
        )
        )
        order by sort
    </select>
    <select id="grantTopTree" resultMap="treeNodeResultMap">
        select id, parent_id, name as title, id as "value", id as "key"
        from pl_sys_menu
        where category = 1
          and is_deleted = 0
        order by sort
    </select>
    <select id="grantTopTreeByRole" resultMap="treeNodeResultMap">
        select id, parent_id, name as title, id as "value", id as "key" from pl_sys_menu where category = 1 and
        is_deleted = 0
        and id in ( select menu_id from pl_org_role_menu where role_id in
        <foreach collection="list" index="index" item="item" open="(" separator="," close=")">
            #{item}
        </foreach>
        )
        or id in (
        select parent_id from pl_sys_menu where is_deleted = 0
        and id in ( select menu_id from pl_org_role_menu where role_id in
        <foreach collection="list" index="index" item="item" open="(" separator="," close=")">
            #{item}
        </foreach>
        )
        )
        order by sort
    </select>
    <select id="grantDataScopeTree" resultMap="treeNodeResultMap">
        SELECT
            *
        FROM
            (
                SELECT
                    id,
                    parent_id,
                    NAME AS title,
                    id AS "value",
                    id AS "key"
                FROM
                    pl_sys_menu
                WHERE
                    category = 1
                  AND is_deleted = 0
                  AND id IN ( SELECT menu_id FROM pl_auth_scope_data WHERE is_deleted = 0 AND menu_id IS NOT NULL )
            ) menu
        SELECT *
        FROM (
                 SELECT id,
                        parent_id,
                        NAME AS title,
                        id   AS "value",
                        id   AS "key"
                 FROM pl_sys_menu
                 WHERE category = 1
                   AND is_deleted = 0
                   AND id IN (SELECT menu_id FROM pl_auth_scope_data WHERE is_deleted = 0 AND menu_id IS NOT NULL)
             ) menu
        UNION ALL
        SELECT
            id,
            menu_id AS parent_id,
            scope_name AS title,
            id AS "value",
            id AS "key"
        FROM
            pl_auth_scope_data
        WHERE
            is_deleted = 0
        SELECT id,
               menu_id    AS parent_id,
               scope_name AS title,
               id         AS "value",
               id         AS "key"
        FROM pl_auth_scope_data
        WHERE is_deleted = 0
          AND menu_id IS NOT NULL
    </select>
    <select id="grantApiScopeTree" resultMap="treeNodeResultMap">
        SELECT
            *
        FROM
            (
                SELECT
                    id,
                    parent_id,
                    NAME AS title,
                    id AS "value",
                    id AS "key"
                FROM
                    pl_sys_menu
                WHERE
                    category = 1
                  AND is_deleted = 0
                  AND id IN ( SELECT menu_id FROM pl_auth_scope_api WHERE is_deleted = 0 AND menu_id IS NOT NULL )
            ) menu
        SELECT *
        FROM (
                 SELECT id,
                        parent_id,
                        NAME AS title,
                        id   AS "value",
                        id   AS "key"
                 FROM pl_sys_menu
                 WHERE category = 1
                   AND is_deleted = 0
                   AND id IN (SELECT menu_id FROM pl_auth_scope_api WHERE is_deleted = 0 AND menu_id IS NOT NULL)
             ) menu
        UNION ALL
        SELECT
            id,
            menu_id AS parent_id,
            scope_name AS title,
            id AS "value",
            id AS "key"
        FROM
            pl_auth_scope_api
        WHERE
            is_deleted = 0
        SELECT id,
               menu_id    AS parent_id,
               scope_name AS title,
               id         AS "value",
               id         AS "key"
        FROM pl_auth_scope_api
        WHERE is_deleted = 0
          AND menu_id IS NOT NULL
    </select>
@@ -364,61 +366,63 @@
        *
        FROM
        (
            SELECT
                id,
                parent_id,
                NAME AS title,
                id AS "value",
                id AS "key"
            FROM
                pl_sys_menu
            WHERE
                category = 1
            AND is_deleted = 0
            AND id IN ( SELECT menu_id FROM pl_auth_scope_data WHERE is_deleted = 0 AND menu_id IS NOT NULL )
            AND (
                id IN (
                    select menu_id from pl_org_role_menu where role_id in
                    <foreach collection="list" index="index" item="item" open="(" separator="," close=")">
                        #{item}
                    </foreach>
                )
                OR id IN (
                    select parent_id from pl_sys_menu where is_deleted = 0
                    and id in ( select menu_id from pl_org_role_menu where role_id in
                    <foreach collection="list" index="index" item="item" open="(" separator="," close=")">
                        #{item}
                    </foreach> )
                )
            )
        SELECT
        id,
        parent_id,
        NAME AS title,
        id AS "value",
        id AS "key"
        FROM
        pl_sys_menu
        WHERE
        category = 1
        AND is_deleted = 0
        AND id IN ( SELECT menu_id FROM pl_auth_scope_data WHERE is_deleted = 0 AND menu_id IS NOT NULL )
        AND (
        id IN (
        select menu_id from pl_org_role_menu where role_id in
        <foreach collection="list" index="index" item="item" open="(" separator="," close=")">
            #{item}
        </foreach>
        )
        OR id IN (
        select parent_id from pl_sys_menu where is_deleted = 0
        and id in ( select menu_id from pl_org_role_menu where role_id in
        <foreach collection="list" index="index" item="item" open="(" separator="," close=")">
            #{item}
        </foreach>
        )
        )
        )
        ) menu
        UNION ALL
        SELECT
            id,
            menu_id AS parent_id,
            scope_name AS title,
            id AS "value",
            id AS "key"
        id,
        menu_id AS parent_id,
        scope_name AS title,
        id AS "value",
        id AS "key"
        FROM
            pl_auth_scope_data
        pl_auth_scope_data
        WHERE
            is_deleted = 0
        is_deleted = 0
        AND (
            menu_id IN (
                select menu_id from pl_org_role_menu where role_id in
                <foreach collection="list" index="index" item="item" open="(" separator="," close=")">
                    #{item}
                </foreach>
            )
            OR menu_id IN (
                select parent_id from pl_sys_menu where is_deleted = 0
                and id in ( select menu_id from pl_org_role_menu where role_id in
                <foreach collection="list" index="index" item="item" open="(" separator="," close=")">
                    #{item}
                </foreach> )
            )
        menu_id IN (
        select menu_id from pl_org_role_menu where role_id in
        <foreach collection="list" index="index" item="item" open="(" separator="," close=")">
            #{item}
        </foreach>
        )
        OR menu_id IN (
        select parent_id from pl_sys_menu where is_deleted = 0
        and id in ( select menu_id from pl_org_role_menu where role_id in
        <foreach collection="list" index="index" item="item" open="(" separator="," close=")">
            #{item}
        </foreach>
        )
        )
        )
        AND menu_id IS NOT NULL
    </select>
@@ -428,100 +432,133 @@
        *
        FROM
        (
            SELECT
                id,
                parent_id,
                NAME AS title,
                id AS "value",
                id AS "key"
            FROM
                pl_sys_menu
            WHERE
                category = 1
            AND is_deleted = 0
            AND id IN ( SELECT menu_id FROM pl_auth_scope_api WHERE is_deleted = 0 AND menu_id IS NOT NULL )
            AND (
                id IN (
                    select menu_id from pl_org_role_menu where role_id in
                    <foreach collection="list" index="index" item="item" open="(" separator="," close=")">
                        #{item}
                    </foreach>
                )
                OR id IN (
                    select parent_id from pl_sys_menu where is_deleted = 0
                    and id in (
                        select menu_id from pl_org_role_menu where role_id in
                    <foreach collection="list" index="index" item="item" open="(" separator="," close=")">
                        #{item}
                    </foreach> )
                )
            )
        SELECT
        id,
        parent_id,
        NAME AS title,
        id AS "value",
        id AS "key"
        FROM
        pl_sys_menu
        WHERE
        category = 1
        AND is_deleted = 0
        AND id IN ( SELECT menu_id FROM pl_auth_scope_api WHERE is_deleted = 0 AND menu_id IS NOT NULL )
        AND (
        id IN (
        select menu_id from pl_org_role_menu where role_id in
        <foreach collection="list" index="index" item="item" open="(" separator="," close=")">
            #{item}
        </foreach>
        )
        OR id IN (
        select parent_id from pl_sys_menu where is_deleted = 0
        and id in (
        select menu_id from pl_org_role_menu where role_id in
        <foreach collection="list" index="index" item="item" open="(" separator="," close=")">
            #{item}
        </foreach>
        )
        )
        )
        ) menu
        UNION ALL
        SELECT
            id,
            menu_id AS parent_id,
            scope_name AS title,
            id AS "value",
            id AS "key"
        id,
        menu_id AS parent_id,
        scope_name AS title,
        id AS "value",
        id AS "key"
        FROM
            pl_auth_scope_api
        pl_auth_scope_api
        WHERE
            is_deleted = 0
        is_deleted = 0
        AND
            (
                menu_id IN (
                    select menu_id from pl_org_role_menu where role_id in
                    <foreach collection="list" index="index" item="item" open="(" separator="," close=")">
                        #{item}
                    </foreach>
                )
            OR menu_id IN (
                    select parent_id from pl_sys_menu where is_deleted = 0
                    and id in ( select menu_id from pl_org_role_menu where role_id in
                    <foreach collection="list" index="index" item="item" open="(" separator="," close=")">
                        #{item}
                    </foreach> )
                )
        (
        menu_id IN (
        select menu_id from pl_org_role_menu where role_id in
        <foreach collection="list" index="index" item="item" open="(" separator="," close=")">
            #{item}
        </foreach>
        )
        OR menu_id IN (
        select parent_id from pl_sys_menu where is_deleted = 0
        and id in ( select menu_id from pl_org_role_menu where role_id in
        <foreach collection="list" index="index" item="item" open="(" separator="," close=")">
            #{item}
        </foreach>
        )
        )
        )
        AND menu_id IS NOT NULL
    </select>
    <select id="authRoutes" resultType="com.vci.ubcs.system.dto.MenuDTO">
        SELECT
            GROUP_CONCAT(r.role_alias) as alias,
            m.path
        GROUP_CONCAT(r.role_alias) as alias,
        m.path
        FROM
            pl_org_role_menu rm
            LEFT JOIN pl_sys_menu m ON rm.menu_id = m.id
            LEFT JOIN pl_org_role r ON rm.role_id = r.id
        pl_org_role_menu rm
        LEFT JOIN pl_sys_menu m ON rm.menu_id = m.id
        LEFT JOIN pl_org_role r ON rm.role_id = r.id
        WHERE
            rm.role_id IN
            <foreach collection="list" index="index" item="item" open="(" separator="," close=")">
                #{item}
            </foreach>
            AND m.path IS NOT NULL and m.is_deleted = 0
        rm.role_id IN
        <foreach collection="list" index="index" item="item" open="(" separator="," close=")">
            #{item}
        </foreach>
        AND m.path IS NOT NULL and m.is_deleted = 0
        GROUP BY m.path
    </select>
    <select id="selectMenuChildByBtnType" resultMap="menuResultMap">
        select pm.*
            from pl_sys_menu ps, pl_sys_menu pm
        from pl_sys_menu ps, pl_sys_menu pm
        where pm.is_deleted = 0
          and ps.category = 1
          and ps.CODE = #{btmType}
          and ps.ID = pm.PARENT_ID
            <if test="roleIds != null and roleIds != ''">
                and ps.ID in (
                    SELECT menu_id FROM pl_org_role_menu WHERE role_id IN
                    <foreach collection="roleIds" index="index" item="item" open="(" separator="," close=")">
                        #{item}
                    </foreach>
                )
            </if>
        and ps.category = 1
        and ps.CODE = #{btmType}
        and ps.ID = pm.PARENT_ID
        <if test="roleIds != null and roleIds != ''">
            and ps.ID in
            SELECT menu_id FROM pl_org_role_menu WHERE role_id IN
            <foreach collection="roleIds" index="index" item="item" open="(" separator="," close=")">
                #{item}
            </foreach>
        </if>
        order by pm.sort asc
    </select>
    <select id="getButtonByIdsOrByParentCode" resultMap="menuResultMap">
        SELECT
            pm.*
        FROM
            PL_SYS_MENU pm
            <if test="code != null and code != ''">
                ,PL_SYS_MENU ps
            </if>
            <if test="roleIds != null and roleIds != ''">
                ,PL_ORG_ROLE_MENU prom
            </if>
        WHERE
            pm.IS_DELETED = 0
            AND pm."CATEGORY" = 2
            <if test="code != null and code != ''">
                AND ps."CATEGORY" = 1
                AND ps.ID = pm.PARENT_ID
                AND ps.CODE = #{code}
            </if>
            <if test="roleIds != null and roleIds != ''">
                AND pm.ID = prom.MENU_ID
                AND prom.ROLE_ID in (#{roleIds})
            </if>
            <if test="ids != null and ids != ''">
                AND pm.ID IN
                <foreach collection="ids" index="index" item="item" open="(" separator="," close=")">
                    #{item}
                </foreach>
            </if>
        ORDER BY SORT ASC
    </select>
</mapper>