田源
2024-03-19 b299fcd13492375b34e6fa3fd26a841d554c297a
Source/UBCS-WEB/src/components/Theme/ThemeClassifyTrees.vue
@@ -4,92 +4,144 @@
    <!--    左侧菜单-->
    <el-aside>
      <basic-container>
        <div>
          <div>
            <div style="display: flex; flex-direction: column;">
              <div style="display: flex;">
                <el-button plain size="small" type="primary" @click="TreeAdd" v-if="permissionList.TreeAddStatus">添加</el-button>
                <el-button plain size="small" type="primary" @click="TreeEdit" v-if="permissionList.TreeEditStatus">修改</el-button>
                <el-button plain size="small" type="primary" @click="TreeDel" v-if="permissionList.TreeDelStatus">删除</el-button>
                <el-button plain size="small" type="primary" @click="flushed" v-if="permissionList.flushedStatus">刷新</el-button>
              </div>
              <div style="display: flex; margin-top: 10px">
                <el-button plain size="small" type="primary" @click="Enable" v-if="permissionList.EnableStatus">启用</el-button>
                <el-button plain size="small" type="primary" @click="Deactivate" v-if="permissionList.DeactivateStatus">停用</el-button>
                <el-button plain size="small" type="primary" @click.native="ImportExcel" v-if="permissionList.ImportExcelStatus">导入</el-button>
                <el-button plain size="small" type="primary" @click="ExportExcel" v-if="permissionList.ExportExcelStatus">导出</el-button>
              </div>
            </div>
            <div style="display: flex;justify-content: space-around;margin-top: 5px;margin-bottom: 5px">
            </div>
        <div style="height: calc(100vh - 144px);!important;">
          <div class="headerCon" style="display: flex; flex-wrap: wrap;margin-bottom: 5px">
            <el-button v-if="permissionList.TreeAddStatus" plain size="small" type="primary" @click="TreeAdd">添加
            </el-button>
            <el-button v-if="permissionList.TreeEditStatus" v-show="allButtons" plain size="small" type="primary"
                       @click="TreeEdit">修改
            </el-button>
            <el-button v-if="permissionList.TreeDelStatus" v-show="allButtons" plain size="small" type="primary"
                       @click="TreeDel">删除
            </el-button>
            <el-button v-if="permissionList.flushedStatus" v-show="allButtons" plain size="small" type="primary"
                       @click="flushed">刷新
            </el-button>
            <el-button v-if="permissionList.EnableStatus" v-show="allButtons" plain size="small" type="primary"
                       @click="Enable">启用
            </el-button>
            <el-button v-if="permissionList.DeactivateStatus" v-show="allButtons" plain size="small" type="primary"
                       @click="Deactivate">停用
            </el-button>
            <el-button v-if="permissionList.ImportExcelStatus" v-show="allButtons" plain size="small" type="primary"
                       @click.native="ImportExcel">导入
            </el-button>
            <el-button v-if="permissionList.ExportExcelStatus" v-show="allButtons" plain size="small" type="primary"
                       @click="ExportExcel">
              导出
            </el-button>
            <el-button v-if="permissionList.flowingBtnStuatus" v-show="allButtons" plain
                       size="small" style="width: 56px;text-align: center;padding-left: 3px" type="primary"
                       @click="flowingDependHandler">流水处理
            </el-button>
            <el-button v-if="permissionList.classifyAuth" v-show="allButtons" plain size="small"
                       style="width: 56px;text-align: center;padding-left: 3px" type="primary"
                       @click="classifyAuthHandler">分类授权
            </el-button>
            <el-button v-if="permissionList.classifyAuth" v-show="allButtons" plain size="small"
                       style="width: 56px;text-align: center;padding-left: 3px" type="primary"
                       @click="dataAuthHandler">数据授权
            </el-button>
          </div>
<!--          左侧树-->
          <div style="height: calc(100vh - 230px);overflow: auto">
          <!-- 左侧树-->
          <div style="height:  calc(100vh - 242px);overflow: auto">
            <avue-tree ref="tree" v-model="CloneTreeAvueform" v-loading="loading" :data="CloneTreedata"
                       :defaultExpandAll="false"
                       :option="Treeoption"
                       class="classifyTree"
                       style="height: calc(100vh - 280px)"
                       @node-click="nodeClick"
            >
              <template slot-scope="{ node, data }" class="el-tree-node__label">
                <el-tooltip :content="$createElement('div', { domProps: { innerHTML: node.label } })" class="item"
                            effect="dark"
                            open-delay="500"
                            placement="right-start">
                <span style="font-size: 14px;">
                {{ (node || {}).label }}
              </span>
                </el-tooltip>
              </template>
            </avue-tree>
            <div style="height: 25px"></div>
          </div>
          <!--        树节点添加对话框-->
          <el-dialog v-loading="AddLoading" :before-close="TreeEscHandler"
                     :title="this.TreeFlag ? '添加分类' :'添加主题库'" :visible.sync="TreeAddFormVisible" append-to-body
                     style="width: 1700px;margin: auto">
            <el-form ref="myForm" :model="TreeAddform" :rules="rules">
              <el-form-item :label="this.TreeFlag ? '分类编号:' :'主题库编号:'" label-width="150px" prop="id"
                            style="display: inline-block">
                <el-input v-model="TreeAddform.id" autocomplete="off" style="width: 170px"></el-input>
              </el-form-item>
              <el-form-item :label="this.TreeFlag ? '分类名称:' :'主题库名称:'" label-width="110px" prop="name"
                            style="display: inline-block">
                <el-input v-model="TreeAddform.name" autocomplete="off" style="width: 170px"></el-input>
              </el-form-item>
              <el-form-item v-if="TreeFlagCode" label="存储的业务类型:" label-width="150px" prop="btmTypeName">
                <el-input v-model="TreeAddform.btmTypeName" autocomplete="off" style="width: 585px"
                          @focus="btmFoucus"></el-input>
              </el-form-item>
              <el-form-item label="描述:" label-width="150px">
                <el-input v-model="TreeAddform.description" autocomplete="off" style="width: 585px"></el-input>
              </el-form-item>
              <el-form-item label="编码规则:" label-width="150px">
                <el-input v-model="TreeAddform.codeRuleOidName" autocomplete="off" style="width: 585px"
                          @focus="CodeFoucus"></el-input>
              </el-form-item>
              <el-form-item label="关键属性查询规则:" label-width="150px">
                <el-input v-model="TreeAddform.codeKeyAttrRepeatOidName" autocomplete="off" style="width: 585px"
                          @focus="Keyfouce"></el-input>
              </el-form-item>
              <el-form-item label="相似查询规则:" label-width="150px">
                <el-input v-model="TreeAddform.codeResembleRuleOidName" autocomplete="off" style="width: 585px"
                          @focus="simFouce"></el-input>
              </el-form-item>
            </el-form>
            <div slot="footer" class="dialog-footer">
              <el-button @click="TreeEscHandler">取 消</el-button>
              <el-button type="primary" @click="TreeAddHandler">确 定</el-button>
            </div>
          </el-dialog>
          <!--        修改对话框-->
          <el-dialog :visible.sync="TreeEditFormVisible" append-to-body title="修改分类">
            <classifyTreeform ref="childForm" :Editclose=" ()=>{TreeEditFormVisible=false}" :TreeFlag="editTreeFLagCode"
                              :flag="'edit'"
                              :loneTreeNewForm="TreeList" :nodeClickList="nodeClickList"
                              :nodeList="nodeList" @MasterHandler="MasterHandler" @flushed="flushed"
                              @referTreeForm="referTreeForm"></classifyTreeform>
          </el-dialog>
        </div>
        <!-- 树节点添加对话框-->
        <el-dialog v-loading="AddLoading" :before-close="TreeEscHandler"
                   :title="this.TreeFlag ? '添加分类' :'添加主题库'" :visible.sync="TreeAddFormVisible" append-to-body
                   style="width: 1700px;margin: auto">
          <el-form ref="myForm" :model="TreeAddform" :rules="rules">
            <el-form-item :label="this.TreeFlag ? '分类编号:' :'主题库编号:'" label-width="150px" prop="id"
                          style="display: inline-block">
              <el-input v-model="TreeAddform.id" autocomplete="off" style="width: 170px"></el-input>
            </el-form-item>
            <el-form-item :label="this.TreeFlag ? '分类名称:' :'主题库名称:'" label-width="110px" prop="name"
                          style="display: inline-block">
              <el-input v-model="TreeAddform.name" autocomplete="off" style="width: 170px"></el-input>
            </el-form-item>
            <el-form-item v-if="TreeFlagCode" label="存储的业务类型:" label-width="150px" prop="btmTypeName">
              <el-input v-model="TreeAddform.btmTypeName" autocomplete="off" style="width: 585px"
                        @focus="btmFoucus"></el-input>
            </el-form-item>
            <el-form-item label="描述:" label-width="150px">
              <el-input v-model="TreeAddform.description" autocomplete="off" style="width: 585px"></el-input>
            </el-form-item>
            <el-form-item label="编码规则:" label-width="150px">
              <el-input v-model="TreeAddform.codeRuleOidName" autocomplete="off" style="width: 585px"
                        @focus="CodeFoucus"></el-input>
            </el-form-item>
            <el-form-item label="关键属性查询规则:" label-width="150px">
              <el-input v-model="TreeAddform.codeKeyAttrRepeatOidName" autocomplete="off" style="width: 585px"
                        @focus="Keyfouce"></el-input>
            </el-form-item>
            <el-form-item label="是否参与关键属性校验:" label-width="170px">
              <el-switch
                v-model="TreeAddform.codeKeyAttrValue"
                active-color="#13ce66"
                active-text="是"
                inactive-color="#ff4949"
                inactive-text="否"
                @change="switchChange">
              </el-switch>
            </el-form-item>
            <el-form-item label="相似查询规则:" label-width="150px">
              <el-input v-model="TreeAddform.codeResembleRuleOidName" autocomplete="off" style="width: 585px"
                        @focus="simFouce"></el-input>
            </el-form-item>
          </el-form>
          <div slot="footer" class="dialog-footer">
            <el-button @click="TreeEscHandler">取 消</el-button>
            <el-button type="primary" @click="TreeAddHandler">确 定</el-button>
          </div>
        </el-dialog>
        <!-- 修改对话框-->
        <el-dialog :visible.sync="TreeEditFormVisible" append-to-body title="修改分类">
          <classifyTreeform ref="childForm" :Editclose=" ()=>{TreeEditFormVisible=false}" :TreeFlag="editTreeFLagCode"
                            :flag="'edit'"
                            :loneTreeNewForm="TreeEditObj" :nodeClickList="nodeClickList"
                            :nodeList="nodeList" @MasterHandler="MasterHandler" @flushed="flushed"
                            @referTreeForm="referTreeForm"></classifyTreeform>
        </el-dialog>
        <!-- 分类授权对话框-->
        <classify-auth-dialog
          :TreeNode="TreeEditObj"
          :classifyData="classifyData"
          :visible.sync="classifyAuthVisible"
        ></classify-auth-dialog>
        <!-- 数据授权对话框 -->
        <data-auth-dialog
          :TreeNode="TreeEditObj"
          :classifyData="classifyData"
          :visible.sync="dataAuthVisible"
        ></data-auth-dialog>
      </basic-container>
    </el-aside>
    <el-main>
      <basic-container style="height: calc(100vh - 150px);">
      <basic-container>
        <!--        右侧表格-->
        <avue-tabs :option="tabOption" @change="handleChange"></avue-tabs>
        <span v-if="type.prop==='tab1'">
           <classifyTreeform ref="childForm" :flag="'renonly'" :loneTreeNewForm="TreeList"
           <classifyTreeform ref="childForm" :flag="'renonly'" :loneTreeNewForm="TreeEditObj"
                             :nodeList="nodeList"></classifyTreeform>
        </span>
        <span v-else-if="type.prop==='tab2'">
@@ -107,35 +159,25 @@
                  </template>
            <template slot="menuLeft">
              <el-button plain size="small" type="primary" @click="FindeHanler" v-if="permissionList.FindStatus">查询</el-button>
              <el-button plain size="small" type="primary" @click="TemRefresh" v-if="permissionList.TemRefreshStatus">刷新</el-button>
              <el-button plain size="small" type="primary" @click="CloneBtn" v-if="permissionList.CloneBtnStuatus">从其它模板克隆</el-button>
              <el-button v-if="permissionList.FindStatus" plain size="small" type="primary"
                         @click="FindeHanler">查询</el-button>
              <el-button v-if="permissionList.TemRefreshStatus" plain size="small" type="primary"
                         @click="TemRefresh">刷新</el-button>
              <el-button v-if="permissionList.CloneBtnStuatus" plain size="small" type="primary" @click="CloneBtn">从其它模板克隆</el-button>
              <!--              查询对话框-->
           <el-dialog :visible.sync="FindFormVisible" append-to-body title="高级查询">
              <div>
                <el-button size="small" type="primary" @click="AdvQueries">查询</el-button>
                <el-button size="small" type="primary">重置</el-button>
              </div>
             <div style="padding-left: 80px;margin-top: 15px;">
               <template v-for="(value, key) in FindSelect">
                <div style="display: flex; justify-content: space-around; width: 85%; margin-bottom: 15px">
                <el-select v-model="FindSelect[key]" placeholder="请选择" style="width: 28%"
                           @change="handleSelectChange(key)">
                  <el-option label="模板编号" value="0"></el-option>
                  <el-option label="模板名称" value="1"></el-option>
                  <el-option label="模板描述" value="2"></el-option>
                  <el-option label="版本号" value="3"></el-option>
                  <el-option label="状态" value="4"></el-option>
                 </el-select>
                <el-select v-model="condition[0]" placeholder="请选择" style="width: 15%">
                  <el-option label="包含" value="0"></el-option>
                  <el-option label="等于" value="1"></el-option>
                </el-select>
              <el-input v-model="QueryArray[key]" style="width: 49%"></el-input>
          <span> <i class="el-icon-delete" style="font-size: 22px;margin-top:8px;margin-left: 10px"/></span>
           <el-dialog :visible.sync="FindFormVisible" append-to-body title="高级查询" width="30%" @close="searchReset">
             <div style="text-align: center; margin-top: 5px;">
              <el-select v-model="searchSelect" style="width: 35%">
                <el-option v-for="item in crudFindTreeArray" :key="item.field" :label="item.title"
                           :value="item.queryField"></el-option>
              </el-select>
                <el-input v-model="SearchValue"
                          placeholder="请输入关键字进行查询" style="width: 45%; margin-left: 5px;"></el-input>
             </div>
          </template>
        </div>
                  <span slot="footer" class="dialog-footer">
                <el-button type="primary" @click="advQueries">查询</el-button>
                <el-button type="danger" @click="searchReset">重置</el-button>
                  </span>
           </el-dialog>
              <!--            模板克隆  -->
                <el-dialog :before-close="cloneClose" :visible.sync="CloneVisible" append-to-body title="克隆模板">
@@ -233,147 +275,58 @@
              </template>
          </avue-crud>
          </basic-container>
          <templatePro :Formlist="this.Formlist" :ProData="this.ProData" :codeClassifyOid="this.codeClassifyOid"
                       :crudArray="this.crudArray" :crudLCStatus="this.crudLCStatus" :crudOid="this.crudOid"
                       :rowIndex="this.selectRow"></templatePro>
          <templatePro :Formlist="this.Formlist" :ProData="this.ProData" :btnAuthList="btnAuthList"
                       :codeClassifyOid="this.codeClassifyOid" :crudArray="this.crudArray"
                       :crudLCStatus="this.crudLCStatus"
                       :crudOid="this.crudOid" :rowIndex="this.selectRow"></templatePro>
        </span>
        <!--     编码规则-->
        <el-dialog :before-close="masterEscHandler" :visible.sync="MasterdialogVisible" append-to-body
                   title="为【编码规则】选取值">
          <template>
            <el-select v-model="SelectValue" placeholder="请选择" style="width: 135px">
              <el-option
                v-for="item in SelectOption"
                :key="item.value"
                :label="item.label"
                :value="item.value"
                style="width: 150px">
              </el-option>
            </el-select>
            <el-input v-model="SelectFInd" placeholder="输入值后进行模糊查询" style="width: 260px;margin-left: 15px"></el-input>
            <el-button plain size="small" style="margin-left: 20px" type="primary" @click="SelectFindeHandler">查询
            </el-button>
          </template>
          <avue-crud :data="masterData" :option="Option" @row-click="masterSelect">
            <template slot="radio" slot-scope="{row}">
              <el-radio v-model="masterRow" :label="row.$index" style="padding-left: 10px !important;">{{ '' }}
              </el-radio>
            </template>
          </avue-crud>
          <div style="height: 30px">
            <div
              style="display: inline-block;float: left;border: 1px solid #eeeeee;padding: 5px;margin-top: 5px;font-size: 14px ">
              已设置的值为:[{{ this.TreeAddform.coderuleoidName == '' ? '未设置值' : this.TreeAddform.coderuleoidName }}]
            </div>
            <div style="padding-top: 10px;display: flex; justify-content: flex-end;float: right;overflow: hidden">
              <el-button size="small" type="primary" @click="MasterHandlerClick">确定</el-button>
              <el-button size="small" @click="masterEscHandler">取消</el-button>
            </div>
          </div>
        </el-dialog>
        <ThemeChildren
          ref="ThemeMasterChildren"
          :SelectOption="SelectOption"
          :TreeAddform="TreeAddform"
          :visible.sync="MasterdialogVisible"
          code-lcstatus="Released"
          codeName="codeRuleOidName"
          codeType="coderule"
          dialogTitle="编码规则"
          @defineHandler="handlerDefine"
        ></ThemeChildren>
        <!--      关键属性查询规则-->
        <el-dialog :before-close="KeyEscHandler" :visible.sync="KeydialogVisible" append-to-body title="为【关键属性查询规则】选取值">
          <template>
            <el-select v-model="SelectValue" placeholder="请选择" style="width: 135px">
              <el-option
                v-for="item in SelectOption"
                :key="item.value"
                :label="item.label"
                :value="item.value"
                style="width: 150px">
              </el-option>
            </el-select>
            <el-input v-model="SelectFInd" placeholder="输入值后进行模糊查询" style="width: 260px;margin-left: 15px"></el-input>
            <el-button plain size="small" style="margin-left: 20px" type="primary" @click="KeySelectFindeHandler">查询
            </el-button>
          </template>
          <avue-crud :data="KeyData" :option="Option" @row-click="KeySelect">
            <template slot="radio" slot-scope="{row}">
              <el-radio v-model="masterRow" :label="row.$index" style="padding-left: 10px !important;">{{ '' }}
              </el-radio>
            </template>
          </avue-crud>
          <div style="height: 30px">
            <div
              style="display: inline-block;float: left;border: 1px solid #eeeeee;padding: 5px;margin-top: 5px;font-size: 14px ">
              已设置的值为:[{{
                this.TreeAddform.codeKeyAttrRepeatOidName == '' ? '未设置值' : this.TreeAddform.codekeyattrrepeatoidName
              }}]
            </div>
            <div style="padding-top: 10px;display: flex; justify-content: flex-end;float: right;overflow: hidden">
              <el-button size="small" type="primary" @click="KeyHandlerClick">确定</el-button>
              <el-button size="small" @click="KeyEscHandler">取消</el-button>
            </div>
          </div>
        </el-dialog>
        <!--      相似项查询规则-->
        <el-dialog :before-close="simEscHandler" :visible.sync="SimidialogVisible" append-to-body title="为【相似项查询规则】选取值">
          <template>
            <el-select v-model="SelectValue" placeholder="请选择" style="width: 135px">
              <el-option
                v-for="item in SelectOption"
                :key="item.value"
                :label="item.label"
                :value="item.value"
                style="width: 150px">
              </el-option>
            </el-select>
            <el-input v-model="SelectFInd" placeholder="输入值后进行模糊查询" style="width: 260px;margin-left: 15px"></el-input>
            <el-button plain size="small" style="margin-left: 20px" type="primary" @click="SimSelectFindeHandler">查询
            </el-button>
          </template>
          <avue-crud :data="simData" :option="Option" @row-click="simSelect">
            <template slot="radio" slot-scope="{row}">
              <el-radio v-model="masterRow" :label="row.$index" style="padding-left: 10px !important;">{{ '' }}
              </el-radio>
            </template>
          </avue-crud>
          <div style="height: 30px">
            <div
              style="display: inline-block;float: left;border: 1px solid #eee;padding: 5px;margin-top: 5px;font-size: 14px ">
              已设置的值为:[{{
                this.TreeAddform.codeResembleRuleOidName == '' ? '未设置值' : this.TreeAddform.codeResembleRuleOidName
              }}]
            </div>
            <div style="padding-top: 10px;display: flex; justify-content: flex-end;float: right;overflow: hidden">
              <el-button size="small" type="primary" @click="simHandlerClick">确定</el-button>
              <el-button size="small" @click="simEscHandler">取消</el-button>
            </div>
          </div>
        </el-dialog>
        <!--        业务类型-->
        <el-dialog :before-close="BtmEscHandler" :visible.sync="BtmdialogVisible" append-to-body title="为【业务类型规则】选取值">
          <template>
            <el-select v-model="SelectValue" placeholder="请选择" style="width: 135px !important;">
              <el-option
                v-for="item in masterSelectOption"
                :key="item.value"
                :label="item.label"
                :value="item.value"
                style="width: 130px">
              </el-option>
            </el-select>
            <el-input v-model="SelectFInd" placeholder="输入值后进行模糊查询" style="width: 260px;margin-left: 15px"></el-input>
            <el-button plain size="small" style="margin-left: 20px" type="primary" @click="BtmSelectFindeHandler">查询
            </el-button>
          </template>
          <avue-crud :data="BtmData" :option="masterOption" @row-click="btmSelect">
            <template slot="radio" slot-scope="{row}">
              <el-radio v-model="masterRow" :label="row.$index" style="padding-left: 10px !important;">{{ '' }}
              </el-radio>
            </template>
          </avue-crud>
          <div style="height: 30px">
            <div
              style="display: inline-block;float: left;border: 1px solid #eee;padding: 5px;margin-top: 5px;font-size: 14px ">
              已设置的值为:[{{ this.TreeAddform.btmTypeName }}]
            </div>
            <div style="padding-top: 10px;display: flex; justify-content: flex-end;float: right;overflow: hidden">
              <el-button size="small" type="primary" @click="btmHandlerClick">确定</el-button>
              <el-button size="small" @click="BtmEscHandler">取消</el-button>
            </div>
          </div>
        </el-dialog>
        <ThemeChildren
          ref="ThemeKeyChildren"
          :SelectOption="SelectOption"
          :TreeAddform="TreeAddform"
          :visible.sync="KeydialogVisible"
          code-lcstatus="Enabled"
          codeName="codeKeyAttrRepeatOidName"
          codeType="codekeyattrrepeat"
          dialogTitle="关键属性查询规则"
          @defineHandler="handlerDefine"
        ></ThemeChildren>
        <!--      相似项查询规则 -->
        <ThemeChildren
          ref="ThemeSimChildren"
          :SelectOption="SelectOption"
          :TreeAddform="TreeAddform"
          :visible.sync="SimidialogVisible"
          code-lcstatus="Enabled"
          codeName="codeResembleRuleOidName"
          codeType="coderesemblerule"
          dialogTitle="相似项查询规则"
          @defineHandler="handlerDefine"
        ></ThemeChildren>
        <!--        业务类型 -->
        <ThemeChildren
          ref="ThemeBtmChildren"
          :SelectOption="btmSelectOption"
          :TreeAddform="TreeAddform"
          :visible.sync="BtmdialogVisible"
          codeName="btmTypeName"
          codeType="btmCode"
          dialogTitle="业务类型"
          @defineHandler="handlerDefine"
        ></ThemeChildren>
        <!--        导出-->
        <ThemeImport :codeClassifyOid="this.codeClassifyOid" :visible.sync="ThemeImportVisible"></ThemeImport>
      </basic-container>
@@ -386,7 +339,6 @@
  TreeSave,
  TreeDel,
  TreeCheckDel,
  TreeObjcet,
  TreeEnable,
  TreeDeactivate,
  gridCodeClassifyTemplate,
@@ -400,15 +352,58 @@
  upVersion,
  stopLose,
  startRelease,
  exportClassify
  exportClassify,
  flowingDependencyGen
} from "@/api/template/templateAttr";
import {defaultReferDataGrid, referDataGrid} from '@/api/MasterData/master'
import func from "@/util/func";
import {mapGetters} from "vuex";
import ClassifyAuth from './ClassifyAuthDialog.vue';
import {getAuthButtonList} from '@/api/system/classifyAuth'
import ThemeChildren from '@/components/FormTemplate/ThemeChildren'
export default {
  components: {ClassifyAuth, ThemeChildren},
  name: "classifyTrees.vue",
  data() {
    return {
      crudFindTreeArray: [
        {
          title: '模板编号',
          field: 'id',
          fieldType: 'text',
          queryField: 'id'
        },
        {
          title: '模板名称',
          field: 'name',
          fieldType: 'text',
          queryField: 'name'
        },
        {
          title: '模板描述',
          field: 'description',
          fieldType: 'text',
          queryField: 'description'
        },
        {
          title: '版本号',
          field: 'revisionSeq',
          fieldType: 'text',
          queryField: 'revisionSeq'
        },
        {
          title: '状态',
          field: 'lcStatusText',
          fieldType: 'text',
          queryField: 'lcStatusText'
        },
      ],
      searchSelect: 'id',
      SearchValue: '',
      allButtons: Boolean,
      btnAuthList: [],
      activeName: 'first',
      masterRow: null,
      AddLoading: false,
      // 定义一个变量来保存树请求的数量
@@ -423,94 +418,24 @@
      editTreeFLagCode: false,
      //编码规则
      MasterdialogVisible: false,
      masterData: [],
      masterSelectList: [],
      masterName: "",
      masterOid: "",
      //关键属性btmTypeId
      //关键属性
      KeydialogVisible: false,
      KeyName: "",
      KeyOid: "",
      KeyData: [],
      KeySelectLIst: [],
      //相似项
      simName: "",
      simOid: "",
      simData: [],
      SimidialogVisible: false,
      simSelectList: [],
      //业务类型
      btmName: "",
      btmOid: "",
      BtmData: [],
      BtmdialogVisible: false,
      btmSelectList: [],
      masterOption: {
        addBtn: false,
        index: true,
        border: true,
        menu: false,
        height: 380,
        column: [
          {
            label: '',
            prop: 'radio',
            width: 60,
            display: false
          },
          {
            label: '业务类型编号',
            prop: 'id'
          },
          {
            label: '业务类型名称',
            prop: 'name'
          },
          {
            label: '描述',
            prop: 'description'
          }
        ]
      },
      Option: {
        addBtn: false,
        index: true,
        columnBtn:false,
        border: true,
        menu: false,
        height: 380,
        column: [
          {
            label: '',
            prop: 'radio',
            width: 60,
            display: false
          },
          {
            label: '英文名称',
            prop: 'id'
          },
          {
            label: '中文名称',
            prop: 'name'
          },
          {
            label: '描述',
            prop: 'description'
          }
        ]
      },
      SelectOption: [
        {
          value: 'id',
          label: '英文名称',
        },
        {
          value: 'name',
          label: '中文名称'
        },
        {
          value: 'id',
          label: '英文名称'
        }
      ],
      masterSelectOption: [
      btmSelectOption: [
        {
          value: 'id',
          label: '业务类型编号'
@@ -520,8 +445,6 @@
          label: '业务类型名称'
        },
      ],
      SelectValue: "id",
      SelectFInd: "",
      addFlag: false,
      // 表格当前行id
      crudOid: "",
@@ -567,6 +490,10 @@
      TreeEditFormVisible: false,
      //添加对话框
      TreeAddFormVisible: false,
      //分类授权对话框
      classifyAuthVisible: false,
      //数据授权对话框
      dataAuthVisible: false,
      //当前点击项
      nodeClickList: "",
      ClonenodeClickList: "",
@@ -586,7 +513,9 @@
        //编码规则
        codeRuleOidName: "",
        //存储的业务类型
        btmTypeName: ""
        btmTypeName: "",
        codeKeyAttrValue: true,
        isParticipateCheck: 1
      },
      rules: {
        id: [
@@ -606,6 +535,7 @@
      Treedata: [],
      CloneTreedata: [],
      Treeoption: {
        height: 'auto',
        addBtn: false,
        editBtn: false,
        delBtn: false,
@@ -667,7 +597,7 @@
      CloneSelect: [],
      //克隆模板option
      ClonecrudTreeOption: {
        columnBtn:false,
        columnBtn: false,
        index: true,
        border: true,
        menu: false,
@@ -736,7 +666,7 @@
        }
      ],
      //传递给子组件动态渲染的数据
      TreeList: {},
      TreeEditObj: {},
      codeClassifyOid: "",
      upAndStopAndStartData: {
        upVersion: {
@@ -760,45 +690,51 @@
      },
      //模板管理编辑
      showEditBtn: false,
      //传递给分类授权子组件对话框的当前选中的分类节点信息
      classifyData: "",
    }
  },
  watch: {},
  mounted() {
    this.type = this.tabOption.column[0];
    this.type = this.tabOption.column[0] || {label: '基本信息', prop: 'tab1'};
    this.getAttr();
    const treeEle = this.$refs.tree.$el
    treeEle.addEventListener('click', (e) => {
      if (e.target.nodeName !== 'SPAN') {
        this.$refs.tree.setCurrentKey(null)
        this.nodeClickList = {}
        this.TreeList = []
        this.TreeFlagCode = true;
      }
    }, true)
    document.addEventListener('click', this.handleGlobalClick);
  },
  beforeDestroy() {
    document.removeEventListener('click', this.handleGlobalClick);
  },
  computed: {
    ...mapGetters(["permission"]),
    permissionList(){
      return{
        TreeAddStatus:this.vaildData(this.permission.classifyTree.tree_add,false),
        TreeEditStatus:this.vaildData(this.permission.classifyTree.tree_edit,false),
        TreeDelStatus:this.vaildData(this.permission.classifyTree.tree_delete,false),
        flushedStatus:this.vaildData(this.permission.classifyTree.tree_break,false),
        EnableStatus:this.vaildData(this.permission.classifyTree.tree_enable,false),
        DeactivateStatus:this.vaildData(this.permission.classifyTree.tree_stop,false),
        ImportExcelStatus:this.vaildData(this.permission.classifyTree.tree_import,false),
        ExportExcelStatus:this.vaildData(this.permission.classifyTree.tree_export,false),
        FindStatus:this.vaildData(this.permission.classifyTree.manage_search,false),
        TemRefreshStatus:this.vaildData(this.permission.classifyTree.manage_break,false),
        CloneBtnStuatus:this.vaildData(this.permission.classifyTree.manage_clone,false),
    permissionList() {
      return {
        TreeAddStatus: this.vaildData(this.permission.classifyTree.tree_add, false),
        TreeEditStatus: this.vaildData(this.btnAuthList.tree_edit, false),
        TreeDelStatus: this.vaildData(this.btnAuthList.tree_delete, false),
        flushedStatus: this.vaildData(this.btnAuthList.tree_break, false),
        EnableStatus: this.vaildData(this.btnAuthList.tree_enable, false),
        DeactivateStatus: this.vaildData(this.btnAuthList.tree_stop, false),
        ImportExcelStatus: this.vaildData(this.btnAuthList.tree_import, false),
        ExportExcelStatus: this.vaildData(this.btnAuthList.tree_export, false),
        FindStatus: this.vaildData(this.btnAuthList.manage_search, false),
        TemRefreshStatus: this.vaildData(this.btnAuthList.manage_break, false),
        CloneBtnStuatus: this.vaildData(this.btnAuthList.manage_clone, false),
        flowingBtnStuatus: this.vaildData(this.btnAuthList.tree_flowing, false),
        classifyAuth: this.vaildData(this.btnAuthList.classify_auth, false),
      }
    },
    treeStyle() {
      return {
        height: this.allButtons ? '610px' : '690px',
      };
    },
    crudTreeOption() {
      return {
        index: true,
        border: true,
        columnBtn:false,
        height: 180,
        columnBtn: false,
        height: 150,
        refreshBtn: false,
        addBtn: this.Formlist.length <= 0 && this.nodeClickList != "",
        editBtn: false,
        delBtn: false,
@@ -848,46 +784,73 @@
          codeClassifyOid: ''
        }
      }
    }
    },
  },
  created() {
  },
  methods: {
    //存储的业务类型关闭
    BtmEscHandler() {
      this.SelectFInd = '';
      this.SelectValue = 'id';
      this.masterRow = null;
      this.BtmdialogVisible = false;
    handleGlobalClick(event) {
      // 判断是否存在树节点引用以及引用的元素是否存在
      if (this.$refs.tree && this.$refs.tree.$el) {
        // 判断点击事件是否发生在树节点以外的区域
        const isOutsideTree = !this.$refs.tree.$el.contains(event.target);
        if (isOutsideTree) {
          this.clearNode();
        }
      }
    },
    //相似项关闭
    simEscHandler() {
      this.SelectFInd = '';
      this.SelectValue = 'id';
      this.masterRow = null;
      this.SimidialogVisible = false;
    clearNode(){
      // this.getAttr()
      this.$refs.tree.setCurrentKey(null);
      this.nodeClickList = {};
      this.TreeFlagCode = true;
      this.allButtons = false;
    },
    //关键属性关闭
    KeyEscHandler() {
      this.SelectFInd = '';
      this.SelectValue = 'id';
      this.masterRow = null;
      this.KeydialogVisible = false;
    // 分类授权对话框打开
    classifyAuthHandler(event) {
      event.stopPropagation();
      if (this.nodeClickList.oid === '' || this.nodeClickList.oid === undefined) {
        this.$message.warning('请至少选择一条数据!')
        return;
      }
      // this.classifyData = this.nodeClickList;
      this.classifyAuthVisible = true;
    },
    //编码规则关闭
    masterEscHandler() {
      this.SelectFInd = '';
      this.SelectValue = 'id';
      this.masterRow = null;
      this.MasterdialogVisible = false;
    // 数据授权对话框打开
    dataAuthHandler(event) {
      event.stopPropagation();
      if (this.nodeClickList.oid === '' || this.nodeClickList.oid === undefined) {
        this.$message.warning('请至少选择一条数据!')
        return;
      }
      // this.classifyData = this.nodeClickList;
      this.dataAuthVisible = true;
    },
    flowingDependHandler(event) {
      event.stopPropagation();
      if (this.nodeClickList.length <= 0) {
        this.$message.warning('请至少选择一条数据!')
        return;
      }
      flowingDependencyGen(this.nodeClickList.oid).then(res => {
        this.$message.success('操作成功')
      }).catch(res => {
        this.$message.error(res)
      })
    },
    // switch
    switchChange() {
      this.TreeAddform.isParticipateCheck = this.TreeAddform.codeKeyAttrValue === true ? 1 : 0;
    },
    // 关闭弹窗
    /** 导入 */
    ImportExcel() {
    ImportExcel(event) {
      event.stopPropagation();
      this.ThemeImportVisible = true;
    },
    /** 导出 */
    ExportExcel() {
    ExportExcel(event) {
      event.stopPropagation();
      if (this.nodeClickList) {
        exportClassify({oid: this.nodeClickList.oid}).then(res => {
          func.downloadFileByBlobHandler(res);
@@ -896,183 +859,60 @@
        this.$message.warning('请先选择要导出的主题库分类')
      }
    },
    //树新增参照子组件事件
    handlerDefine(val) {
      const codeTypeMap = {
        coderule: {
          nameKey: 'codeRuleOidName',
          oidKey: 'codeRuleOid'
        },
        codekeyattrrepeat: {
          nameKey: 'codeKeyAttrRepeatOidName',
          oidKey: 'codeKeyAttrRepeatOid'
        },
        coderesemblerule: {
          nameKey: 'codeResembleRuleOidName',
          oidKey: 'codeResembleRuleOid'
        },
        btmCode: {
          nameKey: 'btmTypeName',
          oidKey: 'btmTypeId',
          clearValidate: true
        }
      };
      const codeType = codeTypeMap[val.codeType];
      if (codeType) {
        if (codeType.clearValidate) {
          this.$refs.myForm.clearValidate();
        }
        this.$set(this.TreeAddform, codeType.nameKey, val.crudName);
        this.$set(this.TreeAddform, codeType.oidKey, val.crudOid);
      }
    },
    //编码规则失焦
    CodeFoucus() {
      this.MasterdialogVisible = true;
      this.MasterdefaultRend()
      this.$refs.ThemeMasterChildren.defaultSearchRend()
    },
    //编码多选
    masterSelect(row) {
      this.masterRow = row.$index;
      this.masterSelectList = row;
      this.masterName = row.name;
      this.masterOid = row.oid;
    },
    //编码规则查询
    SelectFindeHandler() {
      const masterParameter = {};
      masterParameter[`conditionMap['${this.SelectValue}']`] = this.SelectFInd;
      this.MasterdefaultRend(masterParameter)
    },
    //编码规则确定
    MasterHandlerClick() {
      if (this.masterSelectList.length > 1) {
        this.$message.warning('只能选择一条数据')
      } else if (this.masterSelectList.length <= 0) {
        this.$message.warning('请选择一条数据')
      } else {
        this.MasterdialogVisible = false;
        this.masterSelectList = []
        this.$set(this.TreeAddform, 'codeRuleOidName', this.masterName)
        this.$set(this.TreeAddform, 'codeRuleOid', this.masterOid)
        this.$emit('MasterHandler', this.loneTreeNewForm)
        this.masterRow=null;
      }
    },
    //编码接口
    MasterdefaultRend(masterParameter) {
      defaultReferDataGrid({
        referType: 'coderule',
        isMuti: 'false',
        'conditionMap["lcstatus"]': 'Released',
        'limit':'-1',
        ...masterParameter
      }).then(res => {
        this.masterData = res.data.records;
      })
    },
    //关键属性失焦
    Keyfouce() {
      this.KeydialogVisible = true;
      this.KeydefaultRend()
      this.$refs.ThemeKeyChildren.defaultSearchRend();
    },
    //关键属性确定
    KeyHandlerClick() {
      if (this.KeySelectLIst.length > 1) {
        this.$message.warning('只能选择一条数据')
      } else if (this.KeySelectLIst.length <= 0) {
        this.$message.warning('请选择一条数据')
      } else {
        this.KeydialogVisible = false;
        this.KeySelectLIst = []
        this.$set(this.TreeAddform, 'codeKeyAttrRepeatOidName', this.KeyName)
        this.$set(this.TreeAddform, 'codeKeyAttrRepeatOid', this.KeyOid)
        this.masterRow=null;
      }
    },
    //关键属性查询
    KeySelectFindeHandler() {
      const masterParameter = {};
      masterParameter[`conditionMap['${this.SelectValue}']`] = this.SelectFInd;
      this.KeydefaultRend(masterParameter)
    },
    //关键属性接口
    KeydefaultRend(masterParameter) {
      defaultReferDataGrid({
        referType: 'codekeyattrrepeat',
        isMuti: 'false',
        'conditionMap["lcstatus"]': 'Enabled',
        'limit':'-1',
        ...masterParameter
      }).then(res => {
        this.KeyData = res.data.records;
      })
    },
    // 关键多选
    KeySelect(row) {
      this.masterRow = row.$index;
      this.KeySelectLIst = row;
      this.KeyName = row.name;
      this.KeyOid = row.oid;
    },
    //关键失焦
    //相似项失焦
    simFouce() {
      this.SimidialogVisible = true;
      this.simdefaultRend()
    },
    //相似项确定
    simHandlerClick() {
      if (this.simSelectList.length > 1) {
        this.$message.warning('只能选择一条数据')
      } else if (this.simSelectList.length <= 0) {
        this.$message.warning('请选择一条数据')
      } else {
        this.SimidialogVisible = false;
        this.simSelectList = []
        this.$set(this.TreeAddform, 'codeResembleRuleOidName', this.simName)
        this.$set(this.TreeAddform, 'codeResembleRuleOid', this.simOid)
        this.$emit('MasterHandler', this.loneTreeNewForm)
        this.masterRow=null;
      }
    },
    //相似项查询
    SimSelectFindeHandler() {
      const masterParameter = {};
      masterParameter[`conditionMap['${this.SelectValue}']`] = this.SelectFInd;
      this.simdefaultRend(masterParameter)
    },
    //  相似项多选
    simSelect(row) {
      this.masterRow = row.$index;
      this.simSelectList = row;
      this.simName = row.name;
      this.simOid = row.oid;
    },
    //相似项项接口
    simdefaultRend(masterParameter) {
      defaultReferDataGrid({
        referType: 'coderesemblerule',
        isMuti: 'false',
        'conditionMap["lcstatus"]': 'Enabled',
        'limit':'-1',
        ...masterParameter
      }).then(res => {
        this.simData = res.data.records;
      })
      this.$refs.ThemeSimChildren.defaultSearchRend();
    },
    //业务类型失焦
    btmFoucus() {
      this.BtmdialogVisible = true;
      this.btmdefaultRend()
    },
    //业务类型确定
    btmHandlerClick() {
      if (this.btmSelectList.length > 1) {
        this.$message.warning('只能选择一条数据')
      } else if (this.btmSelectList.length <= 0) {
        this.$message.warning('请选择一条数据')
      } else {
        this.$refs.myForm.clearValidate();
        this.BtmdialogVisible = false;
        this.btmSelectList = []
        this.$set(this.TreeAddform, 'btmTypeName', this.btmName)
        this.$set(this.TreeAddform, 'btmTypeId', this.btmOid)
        this.$emit('MasterHandler', this.loneTreeNewForm)
        this.masterRow=null;
      }
    },
    //业务类型查询
    BtmSelectFindeHandler() {
      const masterParameter = {};
      masterParameter[`conditionMap['${this.SelectValue}']`] = this.SelectFInd;
      this.btmdefaultRend(masterParameter);
    },
    //业务类型多选
    btmSelect(row) {
      this.masterRow = row.$index;
      this.btmSelectList = row;
      this.btmName = row.name;
      this.btmOid = row.id;
    },
    //业务类型接口
    btmdefaultRend(masterParameter) {
      referDataGrid({valueField: 'id', isMuti: 'false','limit':'-1', ...masterParameter}).then(res => {
        this.BtmData = res.data.data.records
      })
      this.$refs.ThemeBtmChildren.btmDefaultRend();
    },
    //子传父
    MasterHandler(val) {
      this.TreeList = val;
      this.TreeEditObj = val;
    },
    rowHandle(row, column) {
      this.selectRow = row.$index;
@@ -1083,26 +923,38 @@
    },
    //分类树数据处理
    getAttr() {
      getAtrrList().then(res => {
        this.Treedata = res.data;
        this.CloneTreedata = res.data;
        this.Treedata.forEach(() => {
          for (let i = 0; i < this.Treedata.length; i++) {
            this.Treedata[i].value = i;
          }
        })
        //调用修改属性名方法
        this.ModifyProperties(this.CloneTreedata, 'name', 'label');
        this.CloneTreedata = this.CloneTreedata.map(item => {
          if (item.attributes.lcStatus === "Disabled") {
            item.label += '【停用】';
          }
          return item;
        });
      }).catch(res => {
        this.$message.error(res)
      })
      this.loading = true;
      return new Promise((resolve, reject) => {
        let conditionMaps = {};
        conditionMaps["conditionMap[authType]"] = "classify_auth";
        conditionMaps["conditionMap[buttonCode]"] = "classifyTree";
        // 分类授权中是否具备查看权限
        conditionMaps["conditionMap[menuCode]"] = "classify_view";
        getAtrrList(conditionMaps)
          .then(res => {
            this.Treedata = res.data;
            this.CloneTreedata = res.data;
            this.Treedata.forEach(() => {
              for (let i = 0; i < this.Treedata.length; i++) {
                this.Treedata[i].value = i;
              }
            })
            //调用修改属性名方法
            this.ModifyProperties(this.CloneTreedata, 'name', 'label');
            this.CloneTreedata = this.CloneTreedata.map(item => {
              if (item.attributes.lcStatus === "Disabled") {
                item.label += '【停用】';
              }
              return item;
            });
            this.loading = false;
            resolve(); // 完成请求,调用resolve方法
          })
          .catch(error => {
            this.$message.error(error)
            reject(error); // 请求出错,调用reject方法
          });
      });
    },
    //定义一个修改数据属性名的方法
    ModifyProperties(obj, oldName, newName) {
@@ -1117,7 +969,8 @@
      }
    },
    //树节点添加按钮
    async TreeAdd() {
    async TreeAdd(event) {
      event.stopPropagation();
      const loading = this.$loading({
        lock: true,
        text: 'Loading',
@@ -1137,43 +990,48 @@
    },
    //树节点取消事件
    TreeEscHandler() {
      this.TreeAddform = {};
      for (let key in this.TreeAddform) {
        if (key !== 'codeKeyAttrValue' && key !== 'isParticipateCheck') {
          this.TreeAddform[key] = "";
        }
      }
      this.TreeAddform.codeKeyAttrValue = true;
      this.TreeAddform.isParticipateCheck = 1;
      this.TreeAddFormVisible = false;
      // 关闭弹窗清空校验
      this.$refs.myForm.clearValidate();
    },
    //树节点添加事件
    TreeAddHandler() {
    async TreeAddHandler() {
      if ((!this.TreeAddform.id || !this.TreeAddform.name) || (this.TreeFlagCode && !this.TreeAddform.btmTypeName)) {
        this.$message.warning('请输入内容!');
      } else {
        return;
      }
      try {
        const data = this.TreeAddform;
        this.$set(data, "parentCodeClassifyOid", this.nodeClickList.oid);
        TreeSave(data)
          .then(() => {
            this.$message({
              type: "success",
              message: "添加成功!",
            });
            Object.keys(this.TreeAddform).forEach(key => {
              this.TreeAddform[key] = "";
            });
            this.getAttr();
            this.TreeAddFormVisible = false;
            //添加完成后右侧清空
            this.ProData = [];
            this.Formlist = [];
          })
          .catch((res) => {
            this.$message({
              type: "warning",
              message: res,
            });
          });
        await TreeSave(data)
        this.$message.success("添加成功!");
        Object.keys(this.TreeAddform).forEach(key => {
          this.TreeAddform[key] = "";
        });
        this.TreeAddform.codeKeyAttrValue = true;
        this.TreeAddform.isParticipateCheck = 1;
        this.getAttr();
        this.TreeAddFormVisible = false;
        //添加完成后右侧清空
        this.ProData = [];
        this.Formlist = [];
      } catch (res) {
        this.$message({
          type: "warning",
          message: res,
        });
      }
    },
    //树节点删除按钮
    TreeDel() {
    TreeDel(event) {
      event.stopPropagation();
      this.$confirm('是否删除当前选择的分类,将会把子分类一并删除,如果存在编码数据将不能被删除,是否继续?', '提示', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
@@ -1229,7 +1087,8 @@
      });
    },
    //修改回填
    TreeEdit() {
    TreeEdit(event) {
      event.stopPropagation();
      if (Object.keys(this.nodeClickList).length < 1) {
        this.$message({
          type: 'warning',
@@ -1240,83 +1099,112 @@
      }
    },
    //树刷新
    flushed() {
      this.loading = true
      this.getAttr()
      setTimeout(() => {
        this.loading = false;
        this.nodeClickList = ""
      }, 600);
    async flushed(event) {
      event.stopPropagation();
      await this.getAttr()
      this.$refs.tree.setCurrentKey(null);
      this.nodeClickList = {};
      this.TreeEditObj = {};
      this.TreeFlagCode = true;
    },
    //启用和停用都先判断状态
    //启用
    Enable() {
    async Enable(event) {
      event.stopPropagation();
      if (Object.keys(this.nodeClickList).length < 1) {
        this.$message.warning('请先从树上选择一条数据')
      } else {
        if (this.FlagObj.lcStatus == "Enabled") {
          this.$message({
            type: 'warning',
            message: '当前分类不是停用状态'
          });
        } else {
          this.$confirm('是否将子分类一并启用?', '提示', {
            confirmButtonText: '是',
            cancelButtonText: '取消',
            type: 'warning'
          }).then(() => {
            TreeEnable(this.nodeClickList).then(() => {
              this.$message({
                type: 'success',
                message: '启用成功!'
              });
              this.getAttr()
            })
          }).catch(() => {
        this.$message.warning('请先从树上选择一条数据');
        return;
      }
      if (this.FlagObj.lcStatus == "Enabled") {
        this.$message({
          type: 'warning',
          message: '当前分类不是停用状态'
        });
        return;
      }
      this.loading = true;
      try {
        const confirmResult = await this.$confirm('是否将子分类一并启用?', '提示', {
          confirmButtonText: '是',
          cancelButtonText: '取消',
          type: 'warning'
        });
        if (confirmResult) {
          await TreeEnable(this.nodeClickList).then(res => {
            this.$message({
              type: 'info',
              message: '已取消启用'
              type: 'success',
              message: '启用成功!'
            });
          })
          await this.getAttr();
        } else {
          this.$message({
            type: 'info',
            message: '已取消启用'
          });
        }
      } catch (error) {
        // console.error(error);
      } finally {
        this.loading = false;
      }
    },
    async Deactivate(event) {
      event.stopPropagation();
      if (Object.keys(this.nodeClickList).length < 1) {
        this.$message.warning('请先从树上选择一条数据');
        return;
      }
    },
    //停用
    Deactivate() {
      if (Object.keys(this.nodeClickList).length < 1) {
        this.$message.warning('请先从树上选择一条数据')
      } else {
        if (this.FlagObj.lcStatus === "Disabled") {
          this.$message({
            type: 'warning',
            message: '当前分类不是启用状态!'
          });
        } else {
          this.$confirm('是否停用当前分类,停用后,子分类也将不能被使用,是否继续?', '提示', {
            confirmButtonText: '确定',
            cancelButtonText: '取消',
            type: 'warning'
          }).then(() => {
            TreeDeactivate(this.nodeClickList).then(() => {
              this.$message({
                type: 'success',
                message: '停用成功!'
              });
              this.nodeClickList['flag'] = true;
              this.getAttr()
            })
          }).catch(() => {
      if (this.FlagObj.lcStatus === "Disabled") {
        this.$message({
          type: 'warning',
          message: '当前分类不是启用状态!'
        });
        return;
      }
      this.loading = true;
      try {
        const confirmResult = await this.$confirm('是否停用当前分类,停用后,子分类也将不能被使用,是否继续?', '提示', {
          confirmButtonText: '确定',
          cancelButtonText: '取消',
          type: 'warning'
        });
        if (confirmResult) {
          await TreeDeactivate(this.nodeClickList).then(res => {
            this.$message({
              type: 'info',
              message: '已取消停用'
              type: 'success',
              message: '停用成功!'
            });
          })
          this.nodeClickList['flag'] = true;
          await this.getAttr();
        } else {
          this.$message({
            type: 'info',
            message: '已取消停用'
          });
        }
      } catch (error) {
        // console.error(error);
      } finally {
        this.loading = false;
      }
    },
    //树点击事件
    async nodeClick(data) {
      const response = this.findTheTopLevelNode(data, this.Treedata)
      this.classifyData = response;
      // console.log(response)
      // console.log('response',response.attributes.id)
      this.allButtons = true;
      getAuthButtonList({classifyId: data.oid, code: "classifyTree", authType: "classify_auth"}).then(res => {
        this.btnAuthList = res.data.data;
      }).catch(error => {
        console.log(error)
      })
      //操作新增和修改的业务类型隐藏
      this.TreeFlagCode = !data;
      this.editTreeFLagCode = !data.parentId;
@@ -1325,10 +1213,9 @@
      this.crudArray = []
      try {
        this.requestCount += 1;
        const [res1, res2, res3] = await Promise.all([
          TreeObjcet(data.oid),
        const [res1, res2] = await Promise.all([
          getObjectByOid(data.oid),
          gridCodeClassifyTemplate({'conditionMap[codeclassifyoid]': data.oid}),
          getObjectByOid(data.oid)
        ]);
        this.FlagObj = res1.data.data;
        this.Formlist = res2.data.data.filter(item => {
@@ -1346,12 +1233,41 @@
          this.ProData = [];
          this.crudOid = ''
        }
        this.TreeList = res3.data.data;
        this.TreeEditObj = res1.data.data;
        if (this.TreeEditObj.isParticipateCheck === null || this.TreeEditObj.isParticipateCheck === undefined || this.TreeEditObj.isParticipateCheck === "") {
          this.$set(this.TreeEditObj, "isParticipateCheck", 1)
          return
        }
      } catch (error) {
        this.$message.error(error);
      }
    },
    // 递归查找顶层节点Id
    findTheTopLevelNode(data, TreeData) {
      if (data.parentId === "") {
        return data;
      }
      const parentNode = this.findParentNode(data.parentId, TreeData);
      if (parentNode) {
        return this.findTheTopLevelNode(parentNode, TreeData); // 继续查找父节点
      }
    },
    // 递归查找出来多层节点的父节点
    findParentNode(parentId, TreeData) {
      for (const node of TreeData) {
        if (node.oid === parentId) {
          return node;
        }
        // 如果当前节点还有子节点,继续去查子节点的父节点
        if (node.children) {
          const parentNode = this.findParentNode(parentId, node.children);
          if (parentNode) {
            return parentNode;
          }
        }
      }
      return null;
    },
    async gridCode() {
      try {
        const res = await gridCodeClassifyTemplateAttr({
@@ -1376,12 +1292,12 @@
      }
    },
    treeClick(e) {
      console.log(e);
      // console.log(e);
    },
    //基本信息表单刷新
    referTreeForm() {
      getObjectByOid(this.nodeClickList.oid).then(res => {
        this.TreeList = res.data.data;
        this.TreeEditObj = res.data.data;
      }).catch(res => {
        this.$message.error(res)
      })
@@ -1402,34 +1318,28 @@
    handleChange(column) {
      this.type = column;
    },
    AdvQueries() {
      this.FindFormVisible = false
      //如果全部为空 allEmpty为true
      const allEmpty = Object.values(this.QueryArray).every(value => !value);
      //如果全部为空,点击查询出现所有数据
      if (allEmpty) {
        gridCodeClassifyTemplate().then(res => {
          this.Formlist = res.data.data
        })
    advQueries() {
      if (this.SearchValue === "") {
        this.$message.warning('请输入要查询的内容!');
      } else {
        //默认是等于
        gridCodeClassifyFindTemplate({'conditionMap[id]': this.QueryArray.id},
          {'conditionMap[name]': this.QueryArray.name},
          {'conditionMap[description]': this.QueryArray.description},
          {'conditionMap[revisionValue]': this.QueryArray.revisionValue},
          {'conditionMap[lcStatus]': this.QueryArray.lcStatus}
        ).then(res => {
          this.Formlist = res.data.data
        })
        const condition = {
          'conditionMap[codeclassifyoid]': this.nodeClickList.oid,
          [`conditionMap[${this.searchSelect}]`]: this.SearchValue
        };
        gridCodeClassifyFindTemplate(condition).then(res => {
          if (res.data.data.length > 0) {
            this.Formlist = res.data.data;
          } else {
            this.$message.error('暂未查询到相关模板!')
          }
          this.FindFormVisible = false;
        });
      }
    },
    //模板管理渲染
    CrudRend() {
      gridCodeClassifyTemplate({'conditionMap[codeclassifyoid]': this.nodeClickList.oid}).then(res => {
        this.Formlist = res.data.data
      })
    searchReset() {
      this.SearchValue = "";
      this.searchSelect = 'id'
    },
    //模板管理表格添加
    CrudRowSave(row, done) {
      if (this.nodeClickList.length <= 0) {
@@ -1627,9 +1537,9 @@
</script>
<style lang="scss" scoped>
.el-container {
  height: 100%;
}
//.el-container {
//  height: 100%;
//}
.el-aside {
  //height: calc(100% - 30px);
@@ -1657,4 +1567,26 @@
  width: 500px;
}
.headerCon {
  .el-button + .el-button {
    margin-left: 5px;
  }
  .el-button {
    margin-top: 5px;
  }
}
.headerCon > .el-button:nth-child(5) {
  margin-left: 0;
}
.headerCon > .el-button:nth-child(9) {
  margin-left: 0;
}
///deep/.el-scrollbar__bar.is-vertical{
//  width: 8px;
//}
</style>