可用字符集,前后缀,应用,可以用字符集接口下拉和正则接口提交
已修改14个文件
654 ■■■■■ 文件已修改
Source/UBCS-WEB/src/api/code/codeCharcter.js 16 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/UBCS-WEB/src/components/Theme/ClassifyAuthDialog.vue 289 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/UBCS-WEB/src/components/Theme/DataAuthDialog.vue 53 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/UBCS-WEB/src/views/code/code.vue 174 ●●●●● 补丁 | 查看 | 原始文档 | 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/vue.config.js 4 ●●●● 补丁 | 查看 | 原始文档 | 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 23 ●●●●● 补丁 | 查看 | 原始文档 | 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/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-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/components/Theme/ClassifyAuthDialog.vue
@@ -6,7 +6,9 @@
    append-to-body
    class="avue-dialog avue-dialog--top"
    title="分类授权"
    top="-45px" @close="closeDialog">
    top="-45px"
    @close="closeDialog"
  >
    <el-table
      :key="itemKey"
      ref="dataTable"
@@ -20,10 +22,7 @@
      @select-all="handleSelectionAll"
      @selection-change="handleSelectionChange"
    >
      <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"
@@ -39,7 +38,7 @@
            v-if="item.type === 'select'"
            slot="prepend"
            v-model="row[item.prop]"
            @change="selectChange(row.roleData,row)"
            @change="selectChange(row.roleData, row)"
          >
            <el-option
              v-for="optionItem in roleList"
@@ -59,26 +58,43 @@
          <el-checkbox
            v-if="item.type === 'checkbox'"
            v-model="row[item.prop]"
            :disabled="row.allDisabled ? true :row[item.code]">
            :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
        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>
      <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';
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",
@@ -98,7 +114,7 @@
      // 对话框显示控制
      isShowDialog: this.visible,
      isLoading: false,
      tableHeight: 'calc(100vh - 550px)',
      tableHeight: "calc(100vh - 550px)",
      classifyAuthData: [],
      //列头
      classifyAuthHeader: [],
@@ -108,62 +124,65 @@
      roleList: [],
      //当前选中的表格行
      selectList: [],
      itemKey: '',
      itemKey: "",
      addIndex: Number,
      currentRow: {}
      currentRow: {},
    };
  },
  computed: {},
  mounted() {
  },
  created() {
  },
  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,
                code: item.code,
                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, authType: "classify_auth"}).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) {
@@ -172,18 +191,19 @@
                  oid: authData.oid,
                  roleData: authData.roleId,
                  classifyItem: this.classifyData.label,
                  authButton:{},
                  index: index,
                  uuid: uuidv4(),//生成唯一的id
                }
                  uuid: uuidv4(), //生成唯一的id
                };
                //将按钮设置进去
                authData.buttonIdList.forEach(data => {
                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)
                this.roleHandlerMethods(authData.roleId, "create", index);
                // console.log('index', index)
              })
              });
            }
          });
        });
@@ -196,87 +216,77 @@
        return;
      }
      getButtonsByRoleId({roleId: id, code: 'classifyTree'}).then(res => {
      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);
        const filteredItems = this.classifyAuthButton.filter((item) => {
          return !res.data.data.find((x) => x.id === item.id);
        });
        // console.log('禁用按钮',filteredItems)
        // console.log('不禁用按钮',res.data.data)
        //拿表格列头循环和没有对应的属性进行比较
        this.classifyAuthHeader.forEach((item) => {
          const isMatched = filteredItems.some(x => x.id === item.prop);
          if (isMatched) {
            this.$nextTick(() => {
              if (this.classifyAuthData[index]) {
          const isMatched = filteredItems.some((x) => x.id === item.prop);
          this.$nextTick(() => {
            if (this.classifyAuthData[index]) {
              if (isMatched) {
                Object.keys(this.classifyAuthData[index]).forEach((key) => {
                    if (this.classifyAuthData[index].classify_view) {
                      this.$set(this.classifyAuthData[index], item.code, true);
                    } else {
                      this.classifyAuthData[index][item.code] = false;
                    }
                    // console.log(item.code)
                    // this.$set(this.classifyAuthData[index], item.code, true);
                  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);
                });
              }
            })
          } else {
            this.$nextTick(() => {
              if (this.classifyAuthData[index]) {
                Object.keys(this.classifyAuthData[index]).forEach((key) => {
                  if (item.prop === key) {
                    this.$set(this.classifyAuthData[index], item.code, false);
                  }
                });
              }
            })
          }
            }
          });
        });
        //添加 “查看全部禁用条件”
        this.classifyAuthData.forEach((classkey, classIndex) => {
          if (classkey.classify_view) {
            this.$set(this.classifyAuthData[classIndex], 'allDisabled', true)
          } else {
            this.classifyAuthData[classIndex].allDisabled = false;
          }
        });
        // console.log('classifyAuthData',this.classifyAuthData)
        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);
        const res = await getButtonsByRoleId({
          roleId: row,
          code: "classifyTree",
        });
        this.classifyAuthHeader.forEach(item => {
          const isMatched = filteredItems.some(x => x.id === item.prop);
        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[item.code] = item.prop === key ? false : true;
                  if (!currentRow.classify_view) {
                    currentRow.allDisabled = false;
                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[item.code] = item.prop === key ? true : false;
                  if (!currentRow.classify_view) {
                    currentRow.allDisabled = false;
                Object.keys(currentRow).forEach((key) => {
                  currentRow.authButton[item.code] = false;
                  if (!currentRow.authButton.classify_view) {
                    currentRow.authButton.allDisabled = false;
                  }
                });
              }
            }
            this.itemKey = uuidv4(); // 强制刷新表格
          });
        });
@@ -286,7 +296,7 @@
    },
    // 关闭对话框
    closeDialog() {
      this.$emit('update:visible', false);
      this.$emit("update:visible", false);
      this.classifyAuthData = [];
    },
    // 增加行
@@ -300,20 +310,23 @@
      let item = {
        roleData: this.roleList[0].id,
        classifyItem: this.classifyData.label,
        authButton:{},
        index: this.addIndex,
        uuid: uuidv4(),//生成唯一的id
      }
        uuid: uuidv4(), //生成唯一的id
      };
      //将按钮设置进去
      this.classifyAuthButton.forEach(data => {
      this.classifyAuthButton.forEach((data) => {
        Vue.set(item, data.id, false);
      })
      });
      this.classifyAuthData.push(item);
      this.roleHandlerMethods(this.roleList[0].id, 'add', this.addIndex)
      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);
        }
@@ -335,7 +348,7 @@
    // 保存分类授权信息
    submit() {
      if (this.classifyAuthData.length <= 0) {
        this.$message.warning('授权列表为空!')
        this.$message.warning("授权列表为空!");
        return;
      }
      let isRepeat = false;
@@ -358,7 +371,7 @@
      }
      let form = [];
      let flag = false;
      this.classifyAuthData.forEach(item => {
      this.classifyAuthData.forEach((item) => {
        let itemButtonList = [];
        //筛选出按钮勾选为true的列
        for (let key in item) {
@@ -378,24 +391,27 @@
          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() {
@@ -403,7 +419,7 @@
        this.$message.warning("请只选择一行需要全选的按钮的数据行!");
        return;
      }
      this.classifyAuthButton.forEach(item => {
      this.classifyAuthButton.forEach((item) => {
        //console.log("item",item);
        Vue.set(this.selectList[0], item.id, true);
      });
@@ -414,7 +430,6 @@
</script>
<style lang="scss" scoped>
// 滚动条样式修改
// 滚动条的宽度
/deep/ .el-table__body-wrapper::-webkit-scrollbar {
@@ -422,7 +437,6 @@
  background: white;
  border: white;
  width: 10px;
}
// 滚动条的滑块
@@ -435,5 +449,4 @@
/deep/ .el-table__body-wrapper {
  height: calc(100% - 50px) !important;
}
</style>
Source/UBCS-WEB/src/components/Theme/DataAuthDialog.vue
@@ -60,7 +60,7 @@
          <el-checkbox
            v-if="item.type === 'checkbox'"
            v-model="row[item.prop]"
            :disabled="row.allDisabled ? true :row[item.code]">
            :disabled="row.authButton.allDisabled ? true : row.authButton[item.code]">
          </el-checkbox>
        </template>
      </el-table-column>
@@ -172,6 +172,7 @@
                  roleData: authData.roleId,
                  classifyItem: this.classifyData.label,
                  index: index,
                  authButton:{},
                  uuid: uuidv4(),//生成唯一的id
                }
                //将按钮设置进去
@@ -179,7 +180,7 @@
                  Vue.set(item, data, true);
                });
                this.classifyAuthData.push(item);
                this.addIndex = this.classifyAuthData.length - 1; //添加行下标等于classifyAuthData的长度-1
                this.addIndex = this.classifyAuthData.length - 1; //添加行下标等于classifyAuthData的长度-1
                this.roleHandlerMethods(authData.roleId, 'create', index)
              })
            }
@@ -209,26 +210,33 @@
          !res.data.data.some(x => x.id === item.id)
        );
        //和表格列进行对比
        this.classifyAuthHeader.forEach(item => {
          const isMatched = filteredItems.some(x => x.id === item.prop);
        this.classifyAuthHeader.forEach((item) => {
          const isMatched = filteredItems.some((x) => x.id === item.prop);
          this.$nextTick(() => {
            if (this.classifyAuthData[index] && item.prop in this.classifyAuthData[index]) {
            if (this.classifyAuthData[index]) {
              if (isMatched) {
                this.$set(this.classifyAuthData[index], item.code, this.classifyAuthData[index].classify_view);
                Object.keys(this.classifyAuthData[index]).forEach((key) => {
                  this.$set(this.classifyAuthData[index].authButton,item.code,true);
                });
              } else {
                this.$set(this.classifyAuthData[index], item.code, false);
                Object.keys(this.classifyAuthData[index]).forEach((key) => {
                  this.$set(this.classifyAuthData[index].authButton,item.code,false);
                });
              }
            }
          });
        });
        //添加‘查看’禁用
        this.classifyAuthData.forEach((classkey, classIndex) => {
          if (classkey.classify_view) {
            this.$set(this.classifyAuthData[classIndex], 'allDisabled', true);
          } else {
            this.$set(this.classifyAuthData[classIndex], 'allDisabled', 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();
      });
@@ -248,17 +256,17 @@
          this.$nextTick(() => {
            if (currentRow) {
              if (isMatched) {
                Object.keys(currentRow).forEach(key => {
                  currentRow[item.code] = item.prop === key ? false : true;
                  if (!currentRow.classify_view) {
                    currentRow.allDisabled = false;
                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[item.code] = item.prop === key ? true : false;
                  if (!currentRow.classify_view) {
                    currentRow.allDisabled = false;
                Object.keys(currentRow).forEach((key) => {
                  currentRow.authButton[item.code] = false;
                  if (!currentRow.authButton.classify_view) {
                    currentRow.authButton.allDisabled = false;
                  }
                });
              }
@@ -280,6 +288,7 @@
      let item = {
        roleData: this.roleList[0].id,
        classifyItem: this.classifyData.label,
        authButton:{},
        uuid: uuidv4(),//生成唯一的id,
        index: this.addIndex,
      }
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/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/vue.config.js
@@ -26,9 +26,9 @@
    proxy: {
      '/api': {
        //本地服务接口地址
        // target: 'http://127.0.0.1:37000',
        target: 'http://127.0.0.1:37000',
        // target: 'http://192.168.1.51:37000',
        target: 'http://dev.vci-tech.com:37000',
        // target: 'http://dev.vci-tech.com:37000',
        //yxc
        // target: 'http:// 192.168.43.131:37000',
        //ldc
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,6 +18,7 @@
@RestController
@RequestMapping("/codeRuleCharacterController")
public class CodeRuleCharacterController {
    @Resource
     private ICodeRuleCharacterService iCodeRuleCharacterService;
@@ -28,6 +30,26 @@
    @GetMapping("/list")
    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));
    }
    /**
@@ -59,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/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/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