Source/UBCS-WEB/src/views/code/code.vue
@@ -54,52 +54,77 @@
            @click="enableOrDeactivatse(scope.row.oid,'enable')">启 用
          </el-button>
        </template>
        <!-- 表格左上方按钮区域 -->
        <!-- 表格上方按钮区域 -->
        <template slot="menuLeft" slot-scope="scope">
          <el-button type="danger"
                    size="small"
                    icon="el-icon-delete"
                    plain
                    @click="handleDelete">删 除
            size="small"
            icon="el-icon-delete"
            plain
            @click="handleDelete">
            删 除
          </el-button>
          <el-button size="small"
                    icon="icon-kelong"
                    plain
                    @click="openCodeRuleDialog">克 隆
          <el-button type="primary"
            size="small"
            icon="el-icon-search"
            plain
            @click="openAdvancedQuery('codeRule')">
            高级查询
          </el-button>
          <el-button size="small"
                    icon="icon-lianjiekelong"
                    style="font-size: 12px;"
                    plain
                    @click="openOtherCodeRuleDialog">从其他规则中克隆码段
          <el-button
            size="small"
            icon="icon-kelong"
            plain
            @click="openCodeRuleDialog">
            克 隆
          </el-button>
          <el-button size="small"
                    icon="el-icon-s-help"
                    plain
                    @click="handleRange">使用范围
          <el-button
            size="small"
            icon="icon-lianjiekelong"
            style="font-size: 12px;"
            plain
            @click="openOtherCodeRuleDialog">
            从其他规则中克隆码段
          </el-button>
          <el-button size="small"
                    icon="icon-qingkong"
                    plain
                    @click="clearAllCodeSec">清空码值
          <el-button
            size="small"
            icon="el-icon-s-help"
            plain
            @click="handleRange">
            使用范围
          </el-button>
          <el-button
              size="small"
              icon="icon-qingkong"
              plain
              @click="clearAllCodeSec">
              清空码值
          </el-button>
        </template>
      </avue-crud>
    </basic-container>
    <!-- 高级查询对话框 -->
    <advanced-query
      :ref="advancedQueryParam.ref"
      :options="advancedQueryParam.options"
      :visible.sync="advancedQueryParam.advancedQuerySettingBox"
      @echoContion="echoSeniorContionMap">
    </advanced-query>
    <!-- 编码规则相关对话框 -->
    <el-dialog title="编码规则使用范围"
      append-to-body
      :visible.sync="codeRangeSettingBox"
      width="800px"
        style="height: 116vh; margin-top: -10vh;">
      style="height: 116vh; margin-top: -10vh;">
      <avue-crud
        :option="dialogeOption"
        :option="dialogeOption"
        :table-loading="dialogLoading"
        :data="useRangeData"
        @refresh-change="refreshUseRangeChange">
      </avue-crud>
    </el-dialog>
    <!-- 编码规则,克隆对话框 -->
    <el-dialog title="克隆编码规则"
      append-to-body
@@ -153,6 +178,7 @@
        <el-button @click="cloneSettingBox = false">取 消</el-button>
      </div>
    </el-dialog>
    <!-- 编码规则,从其他规则克隆对话框 -->
    <el-dialog title="克隆编码规则的基础信息"
      append-to-body
@@ -259,7 +285,7 @@
            size="small"
            icon="el-icon-plus"
            :disabled="selectionList.length <= 0"
            @click="addBasicCodeSec">
            @click="openAddBasicCodeSec">
            新 增
        </el-button>
        <el-button type="danger"
@@ -269,6 +295,14 @@
            plain
            @click="deleteBasicCode(scope.row)">
            删 除
        </el-button>
        <el-button type="primary"
            size="small"
            icon="el-icon-search"
            plain
            :disabled="selectionList.length <= 0"
            @click="openAdvancedQuery('codeBasicSec')">
            高级查询
        </el-button>
      </template>
@@ -292,8 +326,8 @@
                <basic-container>
                  <div class="abox" style="height:54vh">
                    <avue-tree
                      :data="classifyValueTreeData"
                      :option="classisyValueTreeOption"
                      :data="classifyValueTreeData"
                      :option="classisyValueTreeOption"
                      @node-click="classisyValueTreeOnodeClick"
                      style="overflow-y: auto; height: 54vh"/>
                  </div>
@@ -397,11 +431,11 @@
            <el-form-item label="码段名称:" :label-width="leftFormLabelWidth" required>
              <el-input ref="name"  v-model="form.name" :readonly="basicSecOnlyRead"></el-input>
            </el-form-item>
            <el-form-item label="码段类型" :label-width="leftFormLabelWidth" required>
              <el-select v-model="form.secType" placeholder="请选择" @change="changeSectypeFormItems(null)" :disabled="basicSecOnlyRead">
                <el-option
                  v-for="item in sectypeList"
                  v-for="item in enumParam.secTypeList"
                  :key="item.itemValue"
                  :label="item.itemName"
                  :value="item.itemValue">
@@ -429,7 +463,7 @@
              <el-form-item label="码段长度类型:" :label-width="rightFormLabelWidth" required>
                <el-select v-model="form.codeSecLengthType" placeholder="请选择" :disabled="basicSecOnlyRead">
                  <el-option
                  v-for="item in codeSecLengthType"
                  v-for="item in enumParam.codeSecLengthType"
                  :key="item.itemValue"
                  :label="item.itemName"
                  :value="item.itemValue">
@@ -455,7 +489,7 @@
                </el-input>
              </el-form-item>
              <el-form-item label="属性所在分类:" :label-width="rightFormLabelWidth">
                <el-input
                <el-input
                  v-model="form.referCodeClassifyOidName"
                  disabled>
              </el-input>
@@ -486,7 +520,7 @@
              <el-form-item label="编码补位方式:" :label-width="rightFormLabelWidth" required>
                <el-select v-model="form.codeFillType" placeholder="请选择" :disabled="basicSecOnlyRead">
                  <el-option label="左补位" value="codeattrsec"
                    v-for="item in codeFillType"
                    v-for="item in enumParam.codeFillType"
                    :key="item.itemValue"
                    :label="item.itemName"
                    :value="item.itemValue">
@@ -494,9 +528,9 @@
                </el-select>
              </el-form-item>
              <el-form-item label="补位时的字符:" :label-width="rightFormLabelWidth">
                <el-select v-model="form.codeFillSeparatorSelect" @blur="inputSelectBlur" filterable placeholder="请选择" :disabled="basicSecOnlyRead">
                <el-select v-model="form.codeFillSeparator" @blur="inputSelectBlur" filterable placeholder="请选择" :disabled="basicSecOnlyRead">
                  <el-option
                    v-for="item in codeFillSeparator"
                    v-for="item in enumParam.codeFillSeparator"
                    :key="item.itemValue"
                    :label="item.itemName"
                    :value="item.itemValue">
@@ -521,7 +555,7 @@
              <el-form-item label="层级类型:" :label-width="rightFormLabelWidth" required>
                <el-select v-model="form.codeLevelType" placeholder="请选择" :disabled="basicSecOnlyRead">
                  <el-option
                    v-for="item in codeLevelType"
                    v-for="item in enumParam.codeLevelType"
                    :key="item.itemValue"
                    :label="item.itemName"
                    :value="item.itemValue">
@@ -532,19 +566,22 @@
                <el-input v-model.number="form.codeLevelValue" ref="codeLevelValue"  :readonly="basicSecOnlyRead"></el-input>
              </el-form-item>
              <el-form-item label="字符截取类型:" :label-width="rightFormLabelWidth" required>
                <el-select v-model="form.valueCutType" placeholder="请选择" :disabled="basicSecOnlyRead">
                <el-select v-model="form.valueCutType" placeholder="请选择" :disabled="basicSecOnlyRead" @change="changeCutType($event)">
                  <el-option
                    v-for="item in codeCutType"
                    v-for="item in enumParam.codeCutType"
                    :key="item.itemValue"
                    :label="item.itemName"
                    :value="item.itemValue">
                  </el-option>
                </el-select>
              </el-form-item>
              <el-form-item id="ShowOrHide" v-mode="showCutLength" v-if="showCutLength==true" label="值截取长度:" :label-width="rightFormLabelWidth">
                <el-input v-model.number="form.valueCutLength" ref="valueCutLength"  :readonly="basicSecOnlyRead"></el-input>
              </el-form-item>
              <el-form-item label="取值类型:" :label-width="rightFormLabelWidth">
                <el-select v-model="form.codeGetValueType" placeholder="请选择" :disabled="basicSecOnlyRead">
                  <el-option
                    v-for="item in codeGetValueType"
                    v-for="item in enumParam.codeGetValueType"
                    :key="item.itemValue"
                    :label="item.itemName"
                    :value="item.itemValue">
@@ -556,11 +593,11 @@
            <div v-show="form.secType==='coderefersec' ? true:false">
              <el-form-item label="参照引用的业务类型:" label-width="152px" required>
                <el-input
                  ref="referBtmId"
                  ref="referBtmId"
                  placeholder="请选择"
                  prefix-icon="el-icon-search"
                  readonly="true"
                  v-model="form.referBtmId"
                  v-model="form.referBtmName"
                  @focus="openAttrSelectOrGetValue('referBtmId')"
                  :disabled="basicSecOnlyRead">
                  <i slot="suffix" class="el-icon-circle-close" @click="clearAttrDataByIcon('referBtmId')" style="margin-right: 5px;cursor: pointer;"></i>
@@ -568,7 +605,7 @@
              </el-form-item>
              <el-form-item label="参照配置:" label-width="152px" required>
                <el-input
                  ref="referConfig"
                  ref="referConfig"
                  placeholder="请选择"
                  prefix-icon="el-icon-search"
                  readonly="true"
@@ -590,7 +627,7 @@
              <el-form-item label="码段长度类型:" :label-width="rightFormLabelWidth" required>
                <el-select v-model="form.codeSecLengthType" placeholder="请选择" :disabled="basicSecOnlyRead">
                  <el-option
                    v-for="item in codeSecLengthType"
                    v-for="item in enumParam.codeSecLengthType"
                    :key="item.itemValue"
                    :label="item.itemName"
                    :value="item.itemValue">
@@ -623,7 +660,7 @@
              <el-form-item label="编码补位方式:" :label-width="rightFormLabelWidth" required>
                <el-select v-model="form.codeFillType" placeholder="请选择" :disabled="basicSecOnlyRead">
                  <el-option
                      v-for="item in codeFillType"
                      v-for="item in enumParam.codeFillType"
                      :key="item.itemValue"
                      :label="item.itemName"
                      :value="item.itemValue">
@@ -631,9 +668,9 @@
                </el-select>
              </el-form-item>
              <el-form-item label="补位时的字符:" :label-width="rightFormLabelWidth">
                <el-select v-model="form.codeFillSeparatorSelect" filterable @blur="inputSelectBlur" placeholder="请选择" :disabled="basicSecOnlyRead">
                <el-select v-model="form.codeFillSeparator" filterable @blur="inputSelectBlur" placeholder="请选择" :disabled="basicSecOnlyRead">
                  <el-option
                    v-for="item in codeFillSeparator"
                    v-for="item in enumParam.codeFillSeparator"
                    :key="item.itemValue"
                    :label="item.itemName"
                    :value="item.itemValue">
@@ -676,11 +713,11 @@
              <basic-container>
                <div class="bbox">
                <avue-crud
                  :data="selectattrData"
                  :option="attrOption"
                  :table-loading="selectAttrOptionLoading"
                  ref="selectionAttrCrud"
                  @search-change="selectAttrOptionSearchChange"
                  :data="selectAttrParams.selectAttrData"
                  :option="selectAttrParams.attrOption"
                  :table-loading="selectAttrParams.selectAttrOptionLoading"
                  :ref="selectAttrParams.ref"
                  @search-change="selectAttrSearchChange"
                  @search-reset="searchAttrReset"
                  @row-click="selectionAttrRowClick"
                  @selection-change="selectionChangeAttr">
@@ -697,25 +734,27 @@
      </el-dialog>
      <!-- 第二层对话框,属性码段,公式编辑框对话框组件 -->
      <formula-editor ref="formulaEditor"
        @updateFormulaContent="updateFormulaContent"
        :thisSceneTableData="thisSceneTableData"
        :systemVariableTableData="systemVariableTableData">
      <formula-editor
        ref="formulaEditor"
        @updateFormulaContent="updateFormulaContent"
        :thisSceneTableData="formulaEditorParams.thisSceneTableData"
        :visible.sync="formulaEditorParams.formulaEditorSettingBox"
        :systemVariableTableData="formulaEditorParams.systemVariableTableData">
      </formula-editor>
      <!-- 第二层对话框,为【父分类码段】选取值对话框 -->
      <el-dialog title="为【父分类码段】选取值"
        append-to-body
        :visible.sync="isShowParentClassifyOption"
        :visible.sync="parentClsfyParams.isShowParentClassifySettingBox"
        width="65%"
        style="height: 150vh; margin-top: -13vh;"
        destroy-on-close>
        <avue-crud
          :page.sync="parentClassifyDataPage"
          ref="crudParentClassify"
          :option="parentClassifyParentOption"
          :table-loading="classifyDialogLoading"
          :data="parentClassifyData"
          :page.sync="parentClsfyParams.parentClassifyDataPage"
          :ref="parentClsfyParams.ref"
          :option="parentClsfyParams.parentClassifyParentOption"
          :table-loading="parentClsfyParams.classifyDialogLoading"
          :data="parentClsfyParams.parentClassifyData"
          @refresh-change="refreshParentClassifyDataChange"
          @search-change="parentClassifySearchChange"
          @search-reset="parentClassifySearchReset"
@@ -727,44 +766,28 @@
        </avue-crud>
        <div slot="footer" class="dialog-footer">
          <el-button type="primary" @click="saveSelectedParentClassify">保 存</el-button>
          <el-button @click="isShowParentClassifyOption = false">取 消</el-button>
          <el-button @click="parentClsfyParams.isShowParentClassifySettingBox = false">取 消</el-button>
        </div>
      </el-dialog>
      <!-- 第二层对话框,为【参照引用的业务类型】选取值弹对话框 -->
      <el-dialog title="为【参照引用的业务类型】选取值"
        append-to-body
        :visible.sync="isShowSelectReferBtmOption"
        width="65%"
        style="height: 150vh; margin-top: -13vh;">
        <avue-crud
          :page.sync="referBtmDataPage"
          ref="crudReferBtm"
          :option="referBtmOption"
          :table-loading="referBtmDialogLoading"
          :data="referBtmData"
          @refresh-change="referBtmDataChange"
          @search-change="referBtmSearchChange"
          @search-reset="referBtmSearchReset"
          @selection-change="referBtmSelectionChange"
          @current-change="referBtmCurrentChange"
          @size-change="referBtmSizeChange"
          @row-click="referBtmRowClick">
        </avue-crud>
        <div slot="footer" class="dialog-footer">
          <el-button type="primary" @click="saveSelectedreferBtm">保 存</el-button>
          <el-button @click="isShowSelectReferBtmOption = false">取 消</el-button>
        </div>
      </el-dialog>
      <!-- 第二层对话框,为【参照引用的业务类型】选取值对话框 -->
      <refer-btm-type-crud-dialog
        :visible.sync="referBtmDialogParams.selectReferBtmSettingBox"
        :ref="referBtmDialogParams.ref"
        @echoReferBtmType="echoReferBtmType">
      </refer-btm-type-crud-dialog>
      <!-- 第二层对话框,自定义参照配置Form组件 -->
      <refer-config-form-dialog
        ref="referConfigFormDialog"
        @echoReferConfig="echoReferConfig" >
        @echoReferConfig="echoReferConfig">
      </refer-config-form-dialog>
      <!-- 第二层对话框,直接选择参照配置curd组件 -->
      <!-- 第二层对话框,直接选择参照配置crud组件 -->
      <refer-config-crud-dialog
        ref="referConfigCrudDialog">
        ref="referConfigCrudDialog"
        @openReconfigInterFace="openReconfigInterFace"
        @echoReferConfig="echoReferConfig">
      </refer-config-crud-dialog>
    </el-dialog>
@@ -774,33 +797,34 @@
<script>
  import { gridCodeRule, getDetail, add, update, remove, listUseRange, updateStatus,clone,clearAllCode } from "@/api/code/mdmrule";
  import {
    gridCodeBasicSec,
    downOrderNum,
    upOrderNum,
    deleteData,
    editSave,
  import {
    gridCodeBasicSec,
    downOrderNum,
    upOrderNum,
    deleteData,
    editSave,
    cloneCodeBasic,
    addSave,
    refDataGridClassifySec,
  } from "@/api/code/codebasic";
  import { treeTopCodeClassify, listClassifyLinkAttr } from "@/api/code/codeclassify";
  import { listClassifyLinkAttr } from "@/api/code/codeclassify";
  import { gridCodeFixedValue,addSaveCodeFixedValue,deleteCodeFixedValue,editCodeFixedValue,saveOrder } from "@/api/code/codeFixedValue";
  import { treeCodeClassifyValue,addSaveCodeClassifyValue,editCodeClassifyValue,deleteCodeClassifyValue,saveCodeClassifyValueOrder } from "@/api/code/codeClassifyValue";
  import { getDictionary } from "@/api/omd/enum";
  import optionBasic from "@/const/code/codebasic";
  import cloneOption from "@/const/code/cloneOption";
  import cloneBasicOption from "@/const/code/cloneBasicDialogOption";
  import cloneCodeRuleOption from "@/const/code/cloneCodeRuleDialogOption.js";
  import cloneCodeRuleOption from "@/const/code/cloneCodeRuleDialogOption";
  import optionRule from "@/const/code/mdmrule";
  import attrOption from "@/const/code/selectAttrOptionDialog";
  import treeOption from "@/const/code/classifyTreeOptionDialog";
  import classisyValueTreeOption from "@/const/code/classisyValueTreeDialog";
  import parentClassifyParentOption from "@/const/code/parentClassifyParentOptionDialog";
  import referBtmOption from "@/const/code/referBtmDialog";
  import fixedValueOption from "@/const/code/fixedValueMgrDialog";
  import {mapGetters} from "vuex";
  import func from "@/util/func";
  import {MasterTable} from "@/api/GetItem";
  export default {
      data() {
        return {
@@ -814,6 +838,7 @@
            total: 0
          },
          selectionList: [],
          showCutLength: false,
          /*编码规则表格配置*/
          optionRule: optionRule,
          data: [],
@@ -889,7 +914,7 @@
            codeFixedSecOid: "",
            description: "",
            id: "",
          },
          },
          isShowFixedForm: true, //true显示固定码段码值管理界面,false显示分类码段码值管理界面
          fixedValueData: [], //固定码段码值表格数据
          fixedValueOption: fixedValueOption, //表格配置
@@ -914,103 +939,107 @@
          treeOption: treeOption,
          currentSelectTreeData: '', //当前选中的树节点
          /* 为属性选值右侧表格相关数据 */
          attrOption: attrOption,
          selectattrData: [],
          selectAttrOptionLoading: false,
          selectionChangeAttrList: [],
          selectAttrParams: {
            ref: "selectionAttrCrud",
            attrOption: attrOption,
            selectAttrData: [],
            selectAttrOptionLoading: false,
            selectionChangeAttrList: [],
            selectAttrQeury: {},
          },
          // 属性码段,公式编辑框组件的本场景显示变量、与系统变量
          thisSceneTableData: [
            {
                formula: "${}",
                desc: "",
            }
          ],
          systemVariableTableData: [
            {
                formula: "#CURRENTUSER.OID#",
                desc: "当前用户的主键",
            },
            {
                formula: "#CURRENTUSER.ID#",
                desc: "当前用户的账户",
            },
            {
                formula: "#CURRENTTIME#",
                desc: "当前时间",
            },
            {
                formula: "#CURRENTDATE#",
                desc: "当前日期",
            },
            {
                formula: "#CURRENTDATETIME#",
                desc: "当前日期时间",
            },
            {
                formula: "#CURRENTUSER_NAME#",
                desc: "当前用户的姓名",
            },
            {
                formula: "#CURRENTUSER.SECRETGRADE#",
                desc: "当前用户密级",
            },
            {
                formula: "#CURRENTUSER.IPSECRET#",
                desc: "当前用户的IP密级",
            },
            {
                formula: "#CURRENTUSER.BUSINESSUNIT#",
                desc: "当前用户所属业务单元",
            },
            {
                formula: "#CURRENTUSER.BUSINESSUNITNAME#",
                desc: "当前用户所属业务单元名称",
            },
            {
                formula: "#CURRENTUSER.GROUPOID#",
                desc: "当前用户的部门主键",
            },
            {
                formula: "#CURRENTUSER.GROUPNAME#",
                desc: "当前用户所属部门名称",
            },
            {
                formula: "#CURRENTUSER.EMAIL#",
                desc: "当前用户邮件地址",
            },
            {
                formula: "#CURRENTUSER.ROLENAME#",
                desc: "当前用户所属角色名称",
            },
          ],
          formulaEditorParams: {
            thisSceneTableData: [
              {
                  formula: "${}",
                  desc: "",
              }
            ],
            systemVariableTableData: [
              {
                  formula: "#CURRENTUSER.OID#",
                  desc: "当前用户的主键",
              },
              {
                  formula: "#CURRENTUSER.ID#",
                  desc: "当前用户的账户",
              },
              {
                  formula: "#CURRENTTIME#",
                  desc: "当前时间",
              },
              {
                  formula: "#CURRENTDATE#",
                  desc: "当前日期",
              },
              {
                  formula: "#CURRENTDATETIME#",
                  desc: "当前日期时间",
              },
              {
                  formula: "#CURRENTUSER_NAME#",
                  desc: "当前用户的姓名",
              },
              {
                  formula: "#CURRENTUSER.SECRETGRADE#",
                  desc: "当前用户密级",
              },
              {
                  formula: "#CURRENTUSER.IPSECRET#",
                  desc: "当前用户的IP密级",
              },
              {
                  formula: "#CURRENTUSER.BUSINESSUNIT#",
                  desc: "当前用户所属业务单元",
              },
              {
                  formula: "#CURRENTUSER.BUSINESSUNITNAME#",
                  desc: "当前用户所属业务单元名称",
              },
              {
                  formula: "#CURRENTUSER.GROUPOID#",
                  desc: "当前用户的部门主键",
              },
              {
                  formula: "#CURRENTUSER.GROUPNAME#",
                  desc: "当前用户所属部门名称",
              },
              {
                  formula: "#CURRENTUSER.EMAIL#",
                  desc: "当前用户邮件地址",
              },
              {
                  formula: "#CURRENTUSER.ROLENAME#",
                  desc: "当前用户所属角色名称",
              },
            ],
            formulaEditorSettingBox: false,
          },
          /* 父分类码段对话框 */
          isShowParentClassifyOption: false, //父分类码段对话框显示控制
          classifyDialogLoading: true, //表格数据加载提示
          parentClassifyParentOption: parentClassifyParentOption,  //表格配置
          parentClassifyData: [], //表格数据
          //分页参数配置
          parentClassifyDataPage: {
            pageSize: 10,
            currentPage: 1,
            total: 0
          parentClsfyParams: {
            ref: 'crudParentClassify',
            isShowParentClassifySettingBox: false, //父分类码段对话框显示控制
            classifyDialogLoading: true, //表格数据加载提示
            parentClassifyParentOption: parentClassifyParentOption,  //表格配置
            parentClassifyData: [], //表格数据
            //分页参数配置
            parentClassifyDataPage: {
              pageSize: 10,
              currentPage: 1,
              total: 0
            },
            parentClassifyQuery: {}, //查询条件
            parentClassifySelectionList: [], //当前选中行
          },
          parentClassifyQuery: {}, //查询条件
          parentClassifySelectionList: [], //当前选中行
          /** 参照引用的业务类型对话框相关数据 */
          isShowSelectReferBtmOption: false,   //对话框显示控制
          referBtmDialogLoading: true,   //表格数据加载提示
          referBtmDataPage: {
            pageSize: 10,
            currentPage: 1,
            total: 0
          referBtmDialogParams: {
            ref: 'crudReferBtm',
            selectReferBtmSettingBox: false,
          },
          referBtmOption: referBtmOption, //表格配置
          referBtmData: [], //表格数据
          referBtmQuery: {}, //查询条件
          referBtmSelectionList: [], //当前选中行
          /** 基础码段新增表单 */
          form: {
@@ -1025,79 +1054,30 @@
            componentCodeFlag: false, //是否参与编码
            pkCodeRule: '', //所属编码规则
          },
          // formRules: {
          //   id: [
          //     { required: true, message: '请输入码段编号', trigger: 'blur' },
          //   ],
          //   name: [
          //     { required: true, message: '请输入码段名称', trigger: 'blur' },
          //   ],
          //   secType: [
          //     { required: true, message: '请选中码段类型', trigger: 'change' },
          //   ],
          //   codeSecLengthType: [
          //     { required: true, message: '请选择码段长度类型', trigger: 'change' },
          //   ],
          //   codeSecLength: [
          //     { required: true, message: '请输入码段的长度', trigger: ['blur', 'change']},
          //     { type: 'number', message: '码段的长度必须为数字值',trigger: ['blur', 'change']}
          //   ],
          //   referAttributeName: [
          //     { required: true, message: '请选择属性', trigger: 'change' },
          //   ],
          //   serialStart: [
          //     { type: 'number', message: '流水号的起始值必须为数字值',trigger: ['blur', 'change']}
          //   ],
          //   serialStep: [
          //     { type: 'number', message: '流水的步长必须为数字值',trigger: ['blur', 'change']}
          //   ],
          //   codeFillType: [
          //     { required: true, message: '请选择编码补位方式', trigger: ['blur', 'change']},
          //   ],
          //   // 设置补位时的字符,需要自定义来做判断
          //   codeFillSeparatorSelect: [
          //     { validator: validateCodeFill, trigger: ['blur', 'change'] },
          //   ],
          //   codeFillLength: [
          //     { required: true, message: '请输入填充长度', trigger: ['blur', 'change'] },
          //     { type: 'number', message: '填充长度必须为数字值',trigger: ['blur', 'change']}
          //   ],
          //   codeFillLimit: [
          //     { required: true, message: '请输入流水上限', trigger: ['blur', 'change'] },
          //     { type: 'number', message: '流水上限必须为数字值',trigger: ['blur', 'change']}
          //   ],
          //   codeLevelType: [
          //     { required: true, message: '请选择层级类型', trigger: 'change' },
          //   ],
          //   codeLevelValue: [
          //     { required: false, type: 'number', message: '层级的值必须为数字值', trigger: 'change'}
          //   ],
          //   valueCutType: [
          //     { required: true, message: '请选择字符截取类型', trigger: 'change' },
          //   ],
          //   referBtmId: [
          //     { required: true, message: '请选择参照应用的业务类型', trigger: 'change' },
          //   ],
          //   referConfig: [
          //     { required: true, message: '请选择参照配置', trigger: 'change' },
          //   ],
          //   codeDateFormatStr: [
          //     { required: true, message: '请输入日期格式', trigger: ['blur', 'change'] },
          //   ],
          // },
          //枚举和可输可选查询
          sectypeList:[],    //码段类型
          codeSecLengthType:[],  //码段长度类型
          codeFillType:[],   //编码补位方式
          codeFillSeparator:[], //补位时的字符,可输可选内容
          codeLevelType:[],     //层级类型
          codeCutType:[],       //字符截取类型
          codeGetValueType:[],  //取值类型
          enumParam: {
            secTypeList:[],    //码段类型
            codeSecLengthType:[],  //码段长度类型
            codeFillType:[],   //编码补位方式
            codeFillSeparator:[], //补位时的字符,可输可选内容
            codeLevelType:[],     //层级类型
            codeCutType:[],       //字符截取类型
            codeGetValueType:[],  //取值类型
          },
          //表单元素标签宽度
          leftFormLabelWidth: '110px',
          rightFormLabelWidth: '150px',
          // 高级查询对话框相关参数
          advancedQueryParam: {
            ref: 'advancedQuery',
            advancedQuerySettingBox: false,
            options: [],
            currentOpen: '', //当前打开高级查询的窗口是
            //conditionMapParams: {},
          },
        };
      },
@@ -1112,218 +1092,185 @@
          };
        },
      },
      watch:{
      },
      methods: {
        /** 高级查询对话框组件,组件返回的值是condtionMap[field]形式的查询条件,保留了和之前一样的方式 */
        echoSeniorContionMap(conditionMaps){
          //console.log(conditionMaps);
          if(JSON.stringify(conditionMaps)!='{}'){
            if(this.advancedQueryParam.currentOpen =='codeRule'){
              this.query = conditionMaps;
              this.onLoad(this.page);
            }else{
              this.sendGridCodeBasicSec(conditionMaps,true);
            }
            //console.log(conditionMaps);
          }
        },
        /* 公式编辑框内容改变,子组件编辑完公式之后内容回显时调用 */
        updateFormulaContent(content){
          this.form.getValueClass = content;
        },
        /* 引用码段参照配置,子组件填完参照配置之后内容回显时调用 */
        echoReferConfig(content){
          this.form.referBtmId = content.referType;
          this.form.referBtmName = content.referTypeName;
          // console.log(content.referTypeName);
          this.form.referBtmId = content.referType || '';
          this.form.referBtmName = content.referTypeName || content.referType;
          //转换成JSON字符串进行父组件回显
          let submitFormJson = JSON.stringify(content);
          this.form.referConfig = submitFormJson;
          this.form.referConfig = submitFormJson || '';
          this.form.referValueInfo = submitFormJson || '';
        },
        /** 为参照引用的业务类型选取值,第二层嵌套对话框,及其相关方法  */
        // 表格数据刷新按钮
        referBtmDataChange(){
          this.referBtmOnLoad(this.referBtmDataPage, this.referBtmQuery);
        },
        saveSelectedreferBtm(){
          if(this.referBtmSelectionList.length != 1){
            this.$message.warning("只能选择一条数据!");
            return false;
          }
          //调用子组件并传递当前选中的参数值,实现回显
          this.form.referBtmId = this.referBtmSelectionList[0].id;
          this.form.referBtmName = this.referBtmSelectionList[0].name;
          //清空当前选中的行
          this.referBtmSelectionClear();
          this.isShowSelectReferBtmOption = false;
        },
        referBtmSearchReset() {
          this.referBtmQuery = {};
          this.referBtmOnLoad(this.referBtmDataPage);
        },
        referBtmSearchChange(params, done) {
          this.referBtmQuery = params;
          this.referBtmDataPage.currentPage = 1;
          this.referBtmOnLoad(this.page, params);
          done();
        },
         // 单击选中表格行时触发
        referBtmRowClick(row){
          this.$refs.crudReferBtm.toggleSelection();
          this.referBtmSelectionList = row;
          this.$refs.crudReferBtm.setCurrentRow(row);
          this.$refs.crudReferBtm.toggleRowSelection(row); //选中当前行
        },
        referBtmSelectionChange(list) {
          this.referBtmSelectionList = list;
          this.$refs.crudReferBtm.setCurrentRow(this.referBtmSelectionList[list.length-1]);
        },
        referBtmSelectionClear() {
          this.referBtmSelectionList = [];
          this.$refs.crudReferBtm.toggleSelection();
        },
        referBtmCurrentChange(currentPage){
          this.referBtmDataPage.currentPage = currentPage;
        },
        referBtmSizeChange(pageSize){
          this.referBtmDataPage.pageSize = pageSize;
        },
        refreshReferBtmDataChange() {
          this.referBtmOnLoad(this.referBtmDataPage, this.referBtmQuery);
        },
        //加载中参照引用的业务类型的数据
        referBtmOnLoad(page, params = {}) {
          //表格行错位问题
          this.$nextTick(() => {
            this.$refs.crudReferBtm.doLayout();
          })
          this.referBtmDialogLoading = true;
          let oid = this.selectionList.length==0 ?  this.form.pkCodeRule:this.selectionList[0].oid;
          Object.assign(params,{pkCodeRule:oid})
          //接口还未提供,待更改
          refDataGridClassifySec(page.currentPage, page.pageSize, Object.assign(params, this.parentClassifyQuery)).then(res => {
            //console.log(res.data);
            const data = res.data.data;
            this.referBtmDataPage.total = data.total;
            this.referBtmData = data.records;
            this.referBtmDialogLoading = false;
            this.referBtmSelectionClear();
          });
        /** 引用码段为【参照引用的业务类型】选取值之后的内容回显时调用 */
        echoReferBtmType(content){
          // 实现回显
          this.form.referBtmId = content.id || '';
          this.form.referBtmName = content.name || content.id;
        },
        /** 父分类选择对话框,第二层嵌套对话框,及其相关方法 */
        /** 父分类选择对话框,第二层嵌套对话框,及其相关方法 */
        // 保存当前父分类码段的选中行,并进行回显
        saveSelectedParentClassify(){
          //console.log(this.parentClassifySelectionList.length);
          if(this.parentClassifySelectionList.length != 1){
          //console.log(this.parentClsfyParams.parentClassifySelectionList.length);
          if(this.parentClsfyParams.parentClassifySelectionList.length != 1){
            this.$message.warning("请选择一条数据!");
            return false;
          }
          //参数值,实现回显
          this.form.parentClassifySecOid = this.parentClassifySelectionList[0].oid;
          this.form.parentClassifySecText = this.parentClassifySelectionList[0].name;
          this.form.parentClassifySecOid = this.parentClsfyParams.parentClassifySelectionList[0].oid;
          this.form.parentClassifySecText = this.parentClsfyParams.parentClassifySelectionList[0].name;
          //清空当前选中的行
          this.parentClassifySelectionClear();
          this.isShowParentClassifyOption = false;
          this.parentClsfyParams.isShowParentClassifySettingBox = false;
        },
        parentClassifySearchReset() {
          this.parentClassifyQuery = {};
          this.parentClassifyOnLoad(this.parentClassifyDataPage);
          this.parentClsfyParams.parentClassifyQuery = {};
          this.parentClassifyOnLoad(this.parentClsfyParams.parentClassifyDataPage);
        },
        parentClassifySearchChange(params, done) {
          this.parentClassifyQuery = params;
          this.parentClassifyDataPage.currentPage = 1;
          this.parentClsfyParams.parentClassifyQuery = params;
          this.parentClsfyParams.parentClassifyDataPage.currentPage = 1;
          this.parentClassifyOnLoad(this.page, params);
          done();
        },
        parentClassifyRowClick(row){
          this.$refs.crudParentClassify.toggleSelection();
          this.parentClassifySelectionList = row;
          this.$refs.crudParentClassify.setCurrentRow(row);
          this.$refs.crudParentClassify.toggleRowSelection(row); //选中当前行
          this.$refs[this.parentClsfyParams.ref].toggleSelection();
          this.parentClsfyParams.parentClassifySelectionList = row;
          this.$refs[this.parentClsfyParams.ref].setCurrentRow(row);
          this.$refs[this.parentClsfyParams.ref].toggleRowSelection(row); //选中当前行
        },
        parentClassifySelectionChange(list) {
          this.parentClassifySelectionList = list;
          this.$refs.crudParentClassify.setCurrentRow(this.parentClassifySelectionList[list.length-1]);
          this.parentClsfyParams.parentClassifySelectionList = list;
          this.$refs[this.parentClsfyParams.ref].setCurrentRow(this.parentClsfyParams.parentClassifySelectionList[list.length-1]);
        },
        parentClassifySelectionClear() {
          this.parentClassifySelectionList = [];
          this.$refs.crudParentClassify.toggleSelection();
          this.parentClsfyParams.parentClassifySelectionList = [];
          this.$refs[this.parentClsfyParams.ref].toggleSelection();
        },
        parentClassifyCurrentChange(currentPage){
          this.parentClassifyDataPage.currentPage = currentPage;
          this.parentClsfyParams.parentClassifyDataPage.currentPage = currentPage;
        },
        parentClassifySizeChange(pageSize){
          this.parentClassifyDataPage.pageSize = pageSize;
          this.parentClsfyParams.parentClassifyDataPage.pageSize = pageSize;
        },
        refreshParentClassifyDataChange() {
          this.parentClassifyOnLoad(this.parentClassifyDataPage, this.parentClassifyQuery);
          this.parentClassifyOnLoad(this.parentClsfyParams.parentClassifyDataPage, this.parentClsfyParams.parentClassifyQuery);
        },
        parentClassifyOnLoad(page, params = {}) {
          this.classifyDialogLoading = true;
          let parentClsParam = this.parentClsfyParams;
          parentClsParam.classifyDialogLoading = true;
          let oid = this.selectionList.length==0 ? this.form.pkCodeRule:this.selectionList[0].oid;
          Object.assign(params,{pkCodeRule:oid})
          refDataGridClassifySec(page.currentPage, page.pageSize, Object.assign(params, this.parentClassifyQuery)).then(res => {
          let conditionMaps = {};
          conditionMaps['conditionMap[pkCodeRule]'] = oid;
          refDataGridClassifySec(
            page.currentPage,
            page.pageSize,
            conditionMaps
          ).then(res => {
            //console.log(res.data);
            const data = res.data.data;
            this.parentClassifyDataPage.total = data.total;
            this.parentClassifyData = data.records;
            this.classifyDialogLoading = false;
            parentClsParam.parentClassifyDataPage.total = data.total;
            parentClsParam.parentClassifyData = data.records;
            parentClsParam.classifyDialogLoading = false;
            this.parentClassifySelectionClear();
          });
        },
        /** 打开属性选取值,第二层嵌套对话框,及其相关方法 */
        /** 打开属性选取值,第二层嵌套对话框,及其相关方法 */
        // 获取当前被选中树节点的oid
        nodeClick(data) {
          this.currentSelectTreeData = data;
          this.loadlistClassifyLinkAttr()
        },
        // 加载分类连接属性表格数据
        loadlistClassifyLinkAttr(condition) {
          //这儿还需要完善
          this.selectAttrOptionLoading = true;
          listClassifyLinkAttr({"page": 1,"limit": -1,'conditionMap[codeClassifyOid]':this.currentSelectTreeData.oid}).then(res=>{
          //console.log(res.data.data);
          //造假数据
          let dataInfo =[
            {"id":"address","name":"会议室地址","oid":"058D840D-1010-A7DE-7C52-B39C03CE89C1","attrLength":"150","description":"","attributeDataTypeText":"字符串"},
            {"id":"businesslicensetype","name":"营业执照类型","oid":"BDAC6D3E-1827-35A0-F3CA-0E58A43F6A07","attrLength":"255","description":"营业执照类型","attributeDataTypeText":"字符串"},
            {"id":"certificatenumber","name":"保密证编号","oid":"E2BC8332-A721-3713-26C3-C9F6340C2C1D","attrLength":"255","description":"保密证编号","attributeDataTypeText":"字符串"},
          ]
          this.selectattrData = dataInfo;
          this.selectAttrOptionLoading = false;
        loadlistClassifyLinkAttr() {
          let attrParam = this.selectAttrParams;
          //console.log(this.currentSelectTreeData);
          this.selectAttrParams.selectAttrOptionLoading = true;
          let conditionMaps = {};
          if(attrParam.selectAttrQeury){
            Object.keys(attrParam.selectAttrQeury).forEach(key=>{
              conditionMaps['conditionMap['+key+']'] = attrParam.selectAttrQeury[key].trim();
            });
          }
          conditionMaps['conditionMap[codeClassifyOid]'] = this.currentSelectTreeData.oid;
          conditionMaps['conditionMap[btmTypeOid]'] = this.currentSelectTreeData.btmTypeOid;
          listClassifyLinkAttr(conditionMaps).then(res=>{
            const data = res.data;
            this.$nextTick(() => {
              this.$refs[attrParam.ref].doLayout()
            });
            //console.log(data.data);
            this.selectAttrParams.selectAttrData = data.data;
            this.selectAttrParams.selectAttrOptionLoading = false;
            // 将搜索框内容置空
            this.selectAttrParams.selectAttrQeury = {};
          })
        },
        // 点击搜索后触发该事件
        selectAttrOptionSearchChange(params, done) {
          this.query = params;
        selectAttrSearchChange(params, done) {
          this.selectAttrParams.selectAttrQeury = params;
          //console.log(params);  //这儿需要改
          this.loadlistClassifyLinkAttr(Object.assign(params,{'conditionMap[codeClassifyOid]':this.currentSelectTreeData.oid}));
          this.loadlistClassifyLinkAttr();
          done();
        },
        // 为属性选值界面,单击表格行时触发该事件
        selectionAttrRowClick(row){
          this.$refs.selectionAttrCrud.toggleSelection();
          this.selectionChangeAttrList = row;
          this.$refs.selectionAttrCrud.setCurrentRow(row);
          this.$refs.selectionAttrCrud.toggleRowSelection(row); //选中当前行
          this.$refs[this.selectAttrParams.ref].toggleSelection();
          this.selectAttrParams.selectionChangeAttrList = row;
          this.$refs[this.selectAttrParams.ref].setCurrentRow(row);
          this.$refs[this.selectAttrParams.ref].toggleRowSelection(row); //选中当前行
        },
        // 属性取值当前选中行发生变化时触发
        selectionChangeAttr(list){
          this.selectionChangeAttrList = list;
          this.$refs.selectionAttrCrud.setCurrentRow(this.selectionChangeAttrList[list.length-1]);
          this.selectAttrParams.selectionChangeAttrList = list;
          this.$refs[this.selectAttrParams.ref].setCurrentRow(this.selectAttrParams.selectionChangeAttrList[list.length-1]);
        },
        // 重置位属性选取值表格的搜索框之后的回调
        searchAttrReset() {
          this.selectAttrParams.selectAttrQeury = {};
          this.loadlistClassifyLinkAttr()
        },
        // 为属性选取值之后的回显
        selectedListClassifyLinkAttr(){
          if(this.selectionChangeAttrList.length != 1){
          if(this.selectAttrParams.selectionChangeAttrList.length != 1){
            this.$message.warning("请选择一条数据!");
            return false;
          }
          //调用子组件并传递当前选中的参数值,实现回显
          this.form = Object.assign({}, this.form, {
            referAttributeId:this.selectionChangeAttrList[0].id,
            referAttributeName:this.selectionChangeAttrList[0].name,
            referAttributeId:this.selectAttrParams.selectionChangeAttrList[0].id,
            referAttributeName:this.selectAttrParams.selectionChangeAttrList[0].name,
            referCodeClassifyOid: this.currentSelectTreeData.key,
            referCodeClassifyOidName: this.currentSelectTreeData.title,
          })
          this.isShowSelectAttrOption = false;
        },
        /** 基础码段表中的码值管理的相关方法 */
        // 码值管理弹窗控制
@@ -1380,8 +1327,16 @@
              window.console.log(error);
            });
          }else {
            if(this.codeClassifyForm.id.trim() == ''){
              this.$message.warning("码值不能为空!");
              return;
            }
            if(this.codeClassifyForm.id.trim().length > 4 ){
              this.$message.warning("码值长度不能大于4!");
              return;
            }
            this.codeClassifyForm.codeClassifySecOid = this.codefixedsecOrCodeclassifysecOid;
            console.log(this.codeClassifyForm);
            // console.log(this.codeClassifyForm);
            addSaveCodeClassifyValue(this.codeClassifyForm).then(() => {
              this.loadClassifyValueData({"oid":this.codefixedsecOrCodeclassifysecOid});
              this.clearFixedOrClassifyForm('codeclassifyvaluesec');
@@ -1445,10 +1400,10 @@
                window.console.log(error);
            });
          }
        },
        //删除码值
        delCodeSecValue(condition){
        delCodeSecValue(condition){
          //固定码段码值删除
          if(condition == 'codefixedsec'){
            //console.log(this.selectedFixedOrCodeclassifyValue.oid);
@@ -1490,8 +1445,8 @@
                message: "操作成功!"
              });
            });
          }
          }
        },
        //对固定码值表进行:上移、下移、移除操作
        codeFixedValueOpetion(condition,row){
@@ -1552,7 +1507,7 @@
              saveData[0].orderNum = parseInt(saveData[0].orderNum)+1;
              saveData[1].orderNum = parseInt(saveData[1].orderNum)-1;
              this.saveCodeFixedOrClassifyValueOption('classifyValue',saveData);
            }
            }
          }
          console.log(saveData);
          console.log(this.classifyValueTreeData);
@@ -1565,10 +1520,10 @@
          */
          //说明是根节点,直接找再判断是否是边界值
          if(currentNodeTreeData.parentId.trim() == ''){
            return this.findTreeIndex(this.classifyValueTreeData,currentNodeTreeData.oid,true);
            return this.findTreeIndex(this.classifyValueTreeData,currentNodeTreeData.oid,true);
          }else{
            //说明不是根节点,先找到父节点再找到子节点,判断是否是边界值
            return this.findTreeIndex(this.classifyValueTreeData,currentNodeTreeData.parentId,false);
            return this.findTreeIndex(this.classifyValueTreeData,currentNodeTreeData.parentId,false);
          }
        },
        /**
@@ -1626,7 +1581,7 @@
            });
            this.loadClassifyValueData({"oid":this.codefixedsecOrCodeclassifysecOid});
          }
        },
        //分类码值树data加载
        loadClassifyValueData(row){
@@ -1663,7 +1618,7 @@
          // this.changeSectypeFormItems(null);
        },
        // 打开新增窗口
        addBasicCodeSec(){
        openAddBasicCodeSec(){
          if(!this.tipsMessage(this.selectionList)){
            return;
          }
@@ -1700,27 +1655,37 @@
          this.addBasicCodeSettingBox = true;
        },
        // 新增基础码段
        saveOrEditBasicCode(){
        async saveOrEditBasicCode(){
          if(this.selectionList[0].oid == null ||  this.selectionList[0].oid == ''){
            this.$message.warning('缺失必要参数,请重新选择编码规则后再试!');
            return;
          }
          }
          this.form.pkCodeRule = this.selectionList[0].oid;
          if(this.form.oid == '' || this.form.oid == null){
            if(this.checkForm()){
              addSave(this.form).then(() => {
              this.$message({
                type: "success",
                message: "操作成功!"
              });
              await addSave(this.form).then(() => {
                this.$message({
                  type: "success",
                  message: "操作成功!"
                });
              }, error => {
                window.console.log(error);
              });
              // 关闭对话框
              this.addBasicCodeSettingBox = false
            }
            // 点击新增基础码段,关闭窗口之后触发重新加载
            this.loadBasic(this.selectionList[0]);
          }else{
            // 可能参照引用的业务类型会发生改变所以这儿直接对referConfig的json进行改变
            let referConfig = JSON.parse(this.form.referConfig);
            referConfig.referType = this.form.referBtmId;
            referConfig.referTypeName = this.form.referBtmName;
            this.form.referConfig = JSON.stringify(referConfig);
            let referValueInfo = JSON.parse(this.form.referValueInfo);
            referValueInfo.referType = this.form.referBtmId;
            this.form.referValueInfo = JSON.stringify(referValueInfo);
            editSave(this.form).then(() => {
               // 关闭对话框
              this.addBasicCodeSettingBox = false
@@ -1731,9 +1696,8 @@
              }, error => {
                window.console.log(error);
            });
            this.loadBasic(this.selectionList[0]);
          }
          // 点击新增基础码段,关闭窗口之后触发重新加载
          this.loadBasic(this.selectionList[0]);
        },
        // 因为elementui的表单校验设置不上所以采用判断的方式来做表单检验方式
        checkForm(){
@@ -1781,7 +1745,7 @@
              return false;
            }
          }else if(this.form.secType==='codeserialsec'){
            console.log(form.codeFillType);
            //console.log(form.codeFillType);
            //流水码段
            if(form.codeSecLength == ''){
              this.$message.warning('(码段的长度)'+tipsMsg);
@@ -1807,7 +1771,7 @@
              this.$message.warning('(编码补位方式)'+tipsMsg);
              return false;
            }
            if(form.codeFillType != '不补位' && form.codeFillSeparatorSelect == ''){
            if(form.codeFillType != '不补位' && form.codeFillSeparator == ''){
              this.$message.warning('当补位方式为左补位或者右补位的时候,补位字符不能为空');
              return false;
            }
@@ -1831,11 +1795,10 @@
              this.$refs.codeFillLimit.$el.querySelector('input').focus();
              return false;
            }
            if(form.codeFillFlag == ''){
              this.$message.warning('(流水是否补码)'+tipsMsg);
              this.$refs.switch.$el.querySelector('input').focus();
              return false;
            }
            // if(form.codeFillFlag == '' || ){
            //   this.$message.warning('(流水是否补码)'+tipsMsg);
            //   return false;
            // }
          }else if(this.form.secType==='codelevelsec'){
            //层级码段
            if(form.codeLevelType == ''){
@@ -1903,7 +1866,8 @@
              this.$message.warning('(编码补位方式)'+tipsMsg);
              return false;
            }
            if(form.codeFillType != '不补位' && form.codeFillSeparatorSelect == ''){
            // console.log(form);
            if(form.codeFillType != 'code_fill_none' && form.codeFillSeparator == ''){
              this.$message.warning('当补位方式为左补位或者右补位的时候,补位字符不能为空');
              return false;
            }
@@ -1951,17 +1915,29 @@
          }
          // console.log(row.oid);
          //存储当前关联的编码规则相关信息
          this.currentCodeRuleOid = row.oid;
          this.currentRuleLcStatus = row.lcStatus;
          this.sendGridCodeBasicSec({"pkCodeRule":row.oid});
          if(row!='' || row!=null){
            this.currentCodeRuleOid = row.oid;
            this.currentRuleLcStatus = row.lcStatus;
            this.sendGridCodeBasicSec({"pkCodeRule":row.oid},false);
          }
        },
        // 发送加载基础码段的请求
        sendGridCodeBasicSec(condition){
        sendGridCodeBasicSec(condition,isAdancedQuery/** 是否高级查询 */){
          // 如果当前基础码段表中的搜索按钮被隐藏,就需要在此开启
          if(this.selectionList.length>=0 && !this.$refs.crudBasic.option.column[0].search){
            this.hideBasicTable(true);
          }
          gridCodeBasicSec(1, -1, condition).then(res => {
          let conditionMaps = {};
          if(condition && !isAdancedQuery){
            Object.keys(condition).forEach(key=>{
              conditionMaps['conditionMap['+key+']'] = condition[key].trim();
            });
          }
          if(isAdancedQuery){
            condition['conditionMap[pkCodeRule]'] = this.currentCodeRuleOid == null || this.currentCodeRuleOid == ''
            ? this.selectionList[0].oid:this.currentCodeRuleOid;
          }
          gridCodeBasicSec(1, -1,isAdancedQuery ? condition:conditionMaps).then(res => {
            const data = res.data.data;
            if(this.cloneSettingBox){
              this.cloneData = data.records;
@@ -1989,29 +1965,27 @@
        },
        basicSearchChange(params, done){
          //console.log(this.$refs.crudBasic);
          this.sendGridCodeBasicSec(Object.assign(params,{"pkCodeRule":this.selectionList[this.selectionList.length-1].oid}));
          this.sendGridCodeBasicSec(Object.assign(params,{"pkCodeRule":this.selectionList[this.selectionList.length-1].oid}),false);
          done();
        },
        basicSearchReset(){
          this.sendGridCodeBasicSec({"pkCodeRule":this.selectionList[this.selectionList.length-1].oid});
          this.sendGridCodeBasicSec({"pkCodeRule":this.selectionList[this.selectionList.length-1].oid},false);
        },
        // 上移下移基础码段
        upOrderNum(row){
          //console.log(row.oid);
          if(!this.tipsMessage(this.selectionList)){
            return;
          }
          let codeRuleOid = this.selectionList[0].oid;
          if (this.selectionList[0].lcStatus != 'Editing') {
            this.$message.warning("只有编码规则的状态是 [编辑中] 的时候,才能调整码段顺序!");
            return;
            return;
          }
          if(row.oid==null || row.oid==''){
            this.$message.warning("未获取到必填参数!");
            return;
            return;
          }
          upOrderNum(row.oid).then(() => {
            this.loadBasic({"oid":codeRuleOid});
            this.loadBasic(this.selectionList[0]);
            this.$message({
              type: "success",
              message: "操作成功!"
@@ -2027,11 +2001,11 @@
          //console.log(this.selectionList);
          if (this.selectionList[0].lcStatus != 'Editing') {
            this.$message.warning("只有编码规则的状态是 [编辑中] 的时候,才能调整码段顺序!");
            return;
            return;
          }
          if(row.oid==null || row.oid==''){
            this.$message.warning("未获取到必填参数!");
            return;
            return;
          }
          downOrderNum(row.oid).then(() => {
            this.loadBasic({"oid":codeRuleOid});
@@ -2043,7 +2017,7 @@
        },
        // 基础码段刷新时查询
        refreshChangeBasicSec(){
          this.loadBasic({"oid":this.currentCodeRuleOid == null || this.currentCodeRuleOid == '' ? this.selectionList[0].oid:this.currentCodeRuleOid});
          this.loadBasic(this.selectionList.at(-1));
        },
        // 操作基础码段中搜索清空等按钮的显示/隐藏
        hideBasicTable(hideBoolean){
@@ -2051,10 +2025,83 @@
          this.$refs.crudBasic.option.columnBtn = hideBoolean;
          this.$refs.crudBasic.option.column[0].search = hideBoolean;
          this.$refs.crudBasic.option.column[1].search = hideBoolean;
          if(!hideBoolean){
            this.selectionList = [];
            this.basicData = [];
          }
        },
        /** 编码规则相关方法 */
        // 打开高级查询窗口
        openAdvancedQuery(condition){
          if(condition=='codeRule'){
            this.advancedQueryParam.options = [
              {
                data: [],
                title: '编号',
                fieldType: 'text',
                queryField: 'id',
              },{
                data: [],
                title: '名称',
                fieldType: 'text',
                queryField: 'name',
              },{
                data: [],
                title: '描述',
                fieldType: 'text',
                queryField: 'description',
              },{
                data: [
                  // {
                  //   key: '编辑中',
                  //   value: 'Editing',
                  // },
                  // {
                  //   key: '已发布',
                  //   value: 'Released',
                  // },
                  // {
                  //   key: '停用',
                  //   value: 'Disabled',
                  // },
                ],
                title: '状态',
                fieldType: 'combox',
                queryField: 'lcStatus',
                comboxKey: 'codeSearchLCStatus',
              },
            ]
          }else {
            this.advancedQueryParam.options = [
              {
                data: [],
                title: '码段编号',
                fieldType: 'text',
                queryField: 'id',
              },{
                data: [],
                title: '码段名称',
                fieldType: 'text',
                queryField: 'name',
              },{
                data: [],
                title: '描述',
                fieldType: 'text',
                queryField: 'description',
              },{
                data: [],
                title: '码段类型',
                fieldType: 'combox',
                queryField: 'secType',
                comboxKey: 'codeSecType',
              }
            ]
          }
          this.advancedQueryParam.currentOpen = condition;
          this.advancedQueryParam.advancedQuerySettingBox = true;
        },
        // 查询使用范围
        handleRange(){
          if(!this.tipsMessage(this.selectionList)){
@@ -2064,7 +2111,7 @@
          this.getRangeCodeList()
        },
        // 加载使用范围列表
        getRangeCodeList(){
        getRangeCodeList(){
          this.dialogLoading = true;
          if(this.selectionList[0].oid==null){
            this.$message.error("未获取到参数!");
@@ -2079,17 +2126,6 @@
        // 刷新使用范围列表
        refreshUseRangeChange(){
          this.getRangeCodeList();
        },
        // 单击编码规则实现行选择
        codeRuleRowClick (row) {
          // 这儿应该可以不要,因为toggleRowSelection也会触发行选择时间
          this.selectionList = row;
          this.$refs.crud.toggleSelection();
          this.$refs.crud.setCurrentRow(row);
          this.$refs.crud.toggleRowSelection(row); //选中当前行
          if(row!=''){
            this.loadBasic(row);
          }
        },
        // 启用与停用
        enableOrDeactivatse(oId,update){
@@ -2143,7 +2179,7 @@
          }, error => {
            window.console.log(error);
          });
          //console.log(data);
          //console.log(data);
        },
        // 打开从其他编码规则中克隆码段对话框
        openOtherCodeRuleDialog(){
@@ -2152,7 +2188,7 @@
          }
          if(this.selectionList[0].lcStatus != 'Editing'){
            this.$message.warning("编码规则已被引用,不允许编辑或删除!");
            return;
            return;
          }
          this.cloneOtherCodeRuleSettingBox = true;
        },
@@ -2187,7 +2223,7 @@
          this.selectionOtherCloneCodeBasicList = list;
          this.$refs.crudCloneCodeBasicOther.setCurrentRow(this.selectionOtherCloneCodeBasicList[list.length-1]);
        },
         // 从其他编码规则中克隆码段信息
        // 从其他编码规则中克隆码段信息
        saveOtherCodeBasic(){
          let oid = this.selectionList[0].oid;
          let fromDialogPkCodebasic = this.selectionOtherCloneCodeBasicList;
@@ -2205,7 +2241,7 @@
          //console.log(res);
          let oidArr = [];
          fromDialogPkCodebasic.forEach(ele => {
            oidArr.push(ele.id);
            oidArr.push(ele.oid);
          });
          let data = {
            "pkCodeRule": oid,
@@ -2322,25 +2358,49 @@
          this.onLoad(this.page);
        },
        searchChange(params, done) {
          this.query = params;
          this.page.currentPage = 1;
          this.onLoad(this.page, params);
          // 多个conditionMap这样传参,快速查询默认采用模糊查询
          let requestData = {};
          if(params){
            Object.keys(params).forEach(key=>{
              requestData["conditionMap"+'['+key+'_like]'] = params[key].trim();
            });
          }
          this.query = requestData;
          this.onLoad(this.page);
          done();
        },
        },
        // 编码规则当前选中行变化的时候触发
        selectionChange(list) {
          this.selectionList = list;
          this.$refs.crud.setCurrentRow(this.selectionList[list.length-1]);
          //当前选中行为空的时候就将码段管理表格数据置空
          if(list == ''){
            this.basicData = [];
          //当前选中行为空的时候就将码段管理表格数据置空,并禁用相关功能
          if(this.selectionList.length <= 0){
            this.hideBasicTable(false);
          }
          if(this.selectionList.length > 0){
          if (this.selectionList.length > 0) {
            this.$refs.crud.setCurrentRow(this.selectionList[list.length-1]);
            this.currentCodeRuleOid = this.selectionList[list.length-1].oid;
            this.currentRuleLcStatus = this.selectionList[list.length-1].lcStatus;
            this.loadBasic(this.selectionList[list.length-1]);
          }
        },
        changeCutType(value){
          if (value != 'code_cut_none'){
            this.showCutLength = true;
            if(this.form.valueCutLength == ''){
              this.form.valueCutLength = 1;
            }
          }else{
            this.form.valueCutLength = '';
            this.showCutLength = false;
          }
        },
        // 单击编码规则实现行选择
        codeRuleRowClick (row) {
          // console.log(this.currentRuleLcStatus);
          this.$refs.crud.toggleSelection();
          this.$refs.crud.toggleRowSelection(row); //选中当前行
        },
        selectionClear() {
          this.selectionList = [];
@@ -2355,14 +2415,23 @@
        refreshChange() {
          this.onLoad(this.page, this.query);
        },
        onLoad(page, params = {}) {
        onLoad(page,params={}) {
          this.loading = true;
          gridCodeRule(page.currentPage, page.pageSize, Object.assign(params, this.query)).then(res => {
          gridCodeRule(
            page.currentPage,
            page.pageSize,
            this.query
          ).then(res => {
            //console.log(res.data);
            const data = res.data.data;
            this.page.total = data.total;
            this.data = data.records;
            this.loading = false;
            // 查询的值为空时,要将码段管理相关的内容禁用
            if(data.records.length <= 0) {
              this.hideBasicTable(false);
              return;
            }
            this.loadBasic(this.data[0])
            this.$nextTick(() => {
              this.$refs.crud.toggleRowSelection(this.data[0]);
@@ -2373,7 +2442,6 @@
          });
        },
        /** 第一层对话框相关方法 */
        // 打开二层对话框方法
        openAttrSelectOrGetValue(condition){
@@ -2381,28 +2449,35 @@
            this.isShowSelectAttrOption = true;
          }else if(condition === 'value'){
            //打开公式编辑框,第二层嵌套对话框
            this.$refs.formulaEditor.isShowformulaEdit = true;
            //this.$refs.formulaEditor.isShowformulaEdit = true;
            this.formulaEditorParams.formulaEditorSettingBox = true;
          }else if(condition === 'parentClassifySecOid'){
            this.isShowParentClassifyOption = true;
            this.parentClsfyParams.isShowParentClassifySettingBox = true;
          }else if(condition === 'referBtmId'){
            this.isShowSelectReferBtmOption = true;
            this.refreshReferBtmDataChange();
            this.referBtmDialogParams.selectReferBtmSettingBox = true;
            // 调用子组件刷新表格数据
            this.$refs[this.referBtmDialogParams.ref].referBtmOnLoad();
          }else if(condition === 'referConfig'){
            if(func.notEmpty(this.form.referConfig) || func.notEmpty(this.form.referBtmName)){
              this.$refs.referConfigFormDialog.isShowReferConfig = true;
              let value = {
                referTypeName: this.form.referBtmName,
                referType: this.form.referBtmId,
                referConfig: this.form.referConfig,
              }
              this.$refs.referConfigFormDialog.initPageData(value);
              this.openReconfigInterFace(this.form);
            }else{
              this.openTipsChooseOrCust();
            }
             //this.$refs.referConfigFormDialog.onloadAttrData();
          }
        },
        // 打开自定义参照配置或直接选择参照配置界面
        // 当前已存在编辑过的参照配置,所以直接打开参照配置界面
        openReconfigInterFace(preReferConfigForm){
          // console.log(preReferConfigForm);
          this.$refs.referConfigFormDialog.isShowReferConfigForm = true;
              let value = {
                referTypeName: preReferConfigForm.referBtmName,
                referType: preReferConfigForm.referBtmId,
                referConfig: preReferConfigForm.referConfig,
              }
              this.$refs.referConfigFormDialog.initPageData(value);
        },
        // 打开自定义参照配置或直接选择参照配置的提示框
        openTipsChooseOrCust(){
          this.$confirm('请选择参照配置的定义方式?','参照配置的方式', {
            distinguishCancelAndClose: true,
@@ -2441,6 +2516,7 @@
            this.form.parentClassifySecOid = '';
          }else if(condition === 'referBtmId'){
            this.form.referBtmId = '';
            this.form.referBtmName = '';
            this.form.referConfig = '';
          }else if(condition === 'referConfig'){
            this.form.referConfig = '';
@@ -2448,14 +2524,14 @@
        },
        // 补位时的字符,实现可输可选
        inputSelectBlur(e){
          if (e.target.value) {
            this.form.codeFillSeparatorSelect = e.target.value;
          if (e.target.value) {
            this.form.codeFillSeparator = e.target.value;
          }
        },
        // 码段类型改变时,增加对应的form表单中的属性
        changeSectypeFormItems(row){
          //console.log(row);
          if(this.sectypeList.length==0){
        changeSectypeFormItems(row){
          //console.log(row);
          if(this.enumParam.secTypeList.length==0){
            this.loadCodeSecType();
          }
          if(row != null){
@@ -2509,9 +2585,9 @@
              codeSecLength: row!=null&&row.codeSecLength != '' ? row.codeSecLength:'', //码段的长度
              serialStart: row!=null&&row.serialStart != '' ? row.serialStart:1,  //流水号起始值
              serialStep: row!=null&&row.serialStep != '' ? row.serialStep:1,   //流水的步长
              codeFillType: row!=null&&row.codeFillType != '' ? row.codeFillType:'code_fill_right', //编码补位方式
              codeFillSeparatorSelect: row!=null&&row.codeFillSeparatorSelect != '' ? row.codeFillSeparatorSelect:0,    //补位时的字符,选中的下拉框的下标
              codeFillSeparator: row!=null&&row.codeFillSeparator != '' ? row.codeFillSeparator:0,          //补位时的字符
              codeFillType: row!=null&&row.codeFillType != '' ? row.codeFillType:'code_fill_left', //编码补位方式
              // codeFillSeparatorSelect: row!=null&&row.codeFillSeparatorSelect != '' ? row.codeFillSeparatorSelect:0,    //补位时的字符,选中的下拉框的下标
              codeFillSeparator: row!=null&&row.codeFillSeparator != '' ? row.codeFillSeparator:'0',          //补位时的字符
              codeFillLength: row!=null&&row.codeFillLength != '' ? row.codeFillLength:'',              //填充长度
              codeFillLimit: row!=null&&row.codeFillLimit != '' ? row.codeFillLimit:'',               //流水上限
              codeFillFlag: row!=null&&row.codeFillFlag != '' ? row.codeFillFlag=='true' ?  true:false :false,      //流水是否补码
@@ -2528,6 +2604,12 @@
              valueCutLength: row!=null&&row.valueCutLength != '' ? row.valueCutLength:'',    //
              codeGetValueType: row!=null&&row.codeGetValueType != '' ? row.codeGetValueType:'code_get_value_all_up',  //取值类型 枚举查询
            });
            if(this.form.valueCutType === 'code_cut_none'){
              this.showCutLength = false;
            }else{
              this.showCutLength = true;
            }
            this.loadCodeLevelType();
            this.loadCodeCutType();
            this.loadCodeGetValueType();
@@ -2537,6 +2619,7 @@
              referBtmId: row!=null&&row.referBtmId != '' ? row.referBtmId:'',   //参照引用的业务类型,的id
              referBtmName: row!=null&&row.referBtmName != '' ? row.referBtmName:'', //参照引用的业务类型
              referConfig: row!=null&&row.referConfig != '' ? row.referConfig:'',  //参照配置
              referValueInfo: row!=null&&row.referValueInfo != '' ? row.referValueInfo:'',  //参照配置
            });
          }else if(this.form.secType==='codedatesec'){
            //日期码段
@@ -2558,53 +2641,56 @@
            //可变码段
            this.form = Object.assign({}, this.form,{
              codeSecLength: row!=null&&row.codeSecLength != '' ? row.codeSecLength:'',             //码段的长度
              codeFillType: row!=null&&row.codeFillType != '' ? row.codeFillType:'code_fill_right', //编码部位方式,枚举查询
              codeFillSeparatorSelect: row!=null&&row.codeFillSeparatorSelect != '' ? row.codeFillSeparatorSelect:0,  //选中的补位时的字符的下标
              codeFillSeparator: row!=null&&row.codeFillSeparator != '' ? row.codeFillSeparator:'', //补位时的字符,可输可选查询
              codeFillType: row!=null&&row.codeFillType != '' ? row.codeFillType:'code_fill_left', //编码部位方式,枚举查询
              // codeFillSeparatorSelect: row!=null&&row.codeFillSeparatorSelect != '' ? row.codeFillSeparatorSelect:0,  //选中的补位时的字符的下标
              codeFillSeparator: row!=null&&row.codeFillSeparator != '' ? row.codeFillSeparator:'0', //补位时的字符,可输可选查询
            });
            this.loadCodeFillType();
            this.loadCodeFillSeparator();
          }
          // console.log(this.form);
        },
        // 第一次请求的枚举数据放缓存
        getLocalStorageEnum(key){
          let enumCach = JSON.parse(localStorage.getItem(key));
          if(enumCach == null) {
            getDictionary({code: key}).then(res=>{
              enumCach = res.data.data;
              localStorage.setItem(key,JSON.stringify(res.data.data));
            })
          }
          return enumCach;
        },
        //枚举和可输可选内容查询
        loadCodeSecType(){
          getDictionary({code: "codeBasicSecType"}).then(res=>{
            this.sectypeList = res.data.data;
          })
          this.enumParam.secTypeList = this.getLocalStorageEnum("codeSecType");
          this.loadCodeSecLength();
        },
        loadCodeSecLength(){
          getDictionary({code: "codeSecLength"}).then(res=>{
            this.codeSecLengthType = res.data.data;
          })
          this.enumParam.codeSecLengthType = this.getLocalStorageEnum("codeSecLength");
        },
        loadCodeFillType(){
          getDictionary({code: "codeFillType"}).then(res=>{
            this.codeFillType = res.data.data;
          })
          this.enumParam.codeFillType = this.getLocalStorageEnum("codeFillType");
        },
        loadCodeFillSeparator(){
          getDictionary({code: "codeFillSeparator"}).then(res=>{
            this.codeFillSeparator = res.data.data;
          })
          let enumCach = JSON.parse(localStorage.getItem("codeFillSeparator"));
          if(enumCach == null) {
            getDictionary("codeFillSeparator").then(res=>{
              this.enumParam.codeFillSeparator = res.data.data;
              localStorage.setItem(key,JSON.stringify(res.data.data));
            })
          }
        },
        loadCodeLevelType(){
          getDictionary({code: "codeLevelType"}).then(res=>{
            this.codeLevelType = res.data.data;
          })
          this.enumParam.codeLevelType = this.getLocalStorageEnum("codeLevelType");
        },
        loadCodeCutType(){
          getDictionary({code: "codeCutType"}).then(res=>{
            this.codeCutType = res.data.data;
          })
          this.enumParam.codeCutType = this.getLocalStorageEnum("codeCutType");
        },
        loadCodeGetValueType(){
          getDictionary({code: "codeGetValueType"}).then(res=>{
            this.codeGetValueType = res.data.data;
          })
          this.enumParam.codeGetValueType =  this.getLocalStorageEnum("codeGetValueType");
        },
      }
  };
@@ -2619,7 +2705,7 @@
  .code-rule-crud > .avue-crud__pagination {
    padding: 14px 0 2px 20px;
  }
  .clone-input-textarea > .el-form-item__content {
    width: 495px;
  }
@@ -2639,7 +2725,7 @@
  .other-clone-coderule-crud > .el-card> .el-card__body > .avue-crud__menu {
    display: none!important;
  }
  .el-table--small .el-table__cell {
    padding: 3px 0;
  }
@@ -2664,11 +2750,11 @@
  }
  .el-card__body > .treeBox {
    height: 50vh;
    height: 56vh;
  }
  .el-col-5 > .box {
    height: 55vh;
    height: 56vh;
  }
  .operator_,filter, .layui-btn{
@@ -2681,8 +2767,8 @@
  .left > .el-form-item > .el-form-item__content > .el-input-number > .el-input > .el-input__inner {
    width:120px;
  }
  }
  .el-col>.el-card > .el-card__header {
    background: rgb(213 231 239);
    border-radius: inherit;
@@ -2691,6 +2777,7 @@
  /** 新增码段 */
  .add-basicsec-total {
    width: 100%;
    padding: 20px 0 0 0;
  }
  .add-basicsec-total .el-input__inner,.add-basicsec-total .el-textarea__inner {
@@ -2736,4 +2823,4 @@
    padding: 5px 10px 10px;
 }
</style>
</style>