ludc
2025-01-16 986aa62ed00bee39363bab41b4eeb8259d446efd
Source/plt-web/plt-web-ui/src/views/modelingMenu/modeling/businessType/index.vue
@@ -3,16 +3,15 @@
    <el-aside>
      <basic-container>
        <div ref="TreeBox" style="height: calc(100vh - 154px);!important;">
          <!-- 左侧树 -->
          <div style="height:  calc(100vh - 190px);">
            <avue-tree ref="tree" v-loading="treeLoading" :data="treeData" :option="treeOption" @node-click="nodeClick">
          <span slot-scope="{ node, data }" class="el-tree-node__label">
           <span style="font-size: 15px">
              <i class="el-icon-s-promotion"></i>
                {{ (node || {}).label }}
            </span>
          </span>
              <span slot-scope="{ node, data }" class="el-tree-node__label">
               <span>
                  <icon-show :name="data.icon"></icon-show>
                    {{ (node || {}).label }}
                </span>
              </span>
            </avue-tree>
          </div>
        </div>
@@ -21,23 +20,68 @@
    <el-main>
      <basic-container>
        <div>
          <el-button icon="el-icon-plus" plain size="small" type="primary" @click="addClickHandler">创建</el-button>
          <el-button icon="el-icon-edit" plain size="small" type="primary" @click="editClickHandler">修改</el-button>
          <el-button icon="el-icon-delete" plain size="small" type="danger" @click="deleteClickHandler">删除</el-button>
          <el-button icon="el-icon-download" plain size="small" type="primary" @click="exportClickHandler">导出</el-button>
          <el-button icon="el-icon-upload2" plain size="small" type="primary" @click="upLoadClickHandler">导入</el-button>
          <el-button icon="el-icon-circle-plus-outline" plain size="small" type="primary" @click="createViewClickHandler">创建视图</el-button>
          <el-button icon="el-icon-circle-plus-outline" plain size="small" type="primary" @click="indexClickHandler">创建索引</el-button>
          <el-button icon="el-icon-menu" plain size="small" type="primary" @click="checkClickHandler">一致性检查</el-button>
          <el-button icon="el-icon-delete" plain size="small" type="danger" @click="checkClickHandler">删除数据</el-button>
          <el-button icon="el-icon-delete" plain size="small" type="danger" @click="checkClickHandler">删除全部类型</el-button>
          <el-button icon="el-icon-view" plain size="small" type="primary" @click="checkViewClickHandler">查看使用范围</el-button>
          <el-button v-if="permissionList.addBtn" class="button-custom-icon" plain size="small" type="primary"
                     @click="addClickHandler">
            <icon-show :name="permissionList.addBtn.source"></icon-show>
            创建
          </el-button>
          <el-button v-if="permissionList.editBtn" class="button-custom-icon" plain size="small" type="primary"
                     @click="editClickHandler">
            <icon-show :name="permissionList.editBtn.source"></icon-show>
            修改
          </el-button>
          <el-button v-if="permissionList.delBtn" class="button-custom-icon" plain size="small" type="danger"
                     @click="deleteClickHandler">
            <icon-show :name="permissionList.delBtn.source"></icon-show>
            删除
          </el-button>
          <el-button v-if="permissionList.importBtn" class="button-custom-icon" plain size="small" type="primary"
                     @click="upLoadClickHandler">
            <icon-show :name="permissionList.importBtn.source"></icon-show>
            导入
          </el-button>
          <el-button v-if="permissionList.exportBtn" class="button-custom-icon" plain size="small" type="primary"
                     @click="exportClickHandler">
            <icon-show :name="permissionList.exportBtn.source"></icon-show>
            导出
          </el-button>
          <el-button v-if="permissionList.createViewBtn" class="button-custom-icon" plain size="small"
                     type="primary" @click="createViewClickHandler">
            <icon-show :name="permissionList.createViewBtn.source"></icon-show>
            创建视图
          </el-button>
          <el-button v-if="permissionList.createIndexBtn" class="button-custom-icon" plain size="small"
                     type="primary" @click="indexClickHandler">
            <icon-show :name="permissionList.createIndexBtn.source"></icon-show>
            创建索引
          </el-button>
          <el-button v-if="permissionList.consistencyCheckBtn" class="button-custom-icon" plain size="small" type="primary"
                     @click="checkClickHandler">
            <icon-show :name="permissionList.consistencyCheckBtn.source"></icon-show>
            一致性检查
          </el-button>
          <el-button v-if="permissionList.deleteDataBtn" class="button-custom-icon" plain size="small" type="danger"
                     @click="checkClickHandler">
            <icon-show :name="permissionList.deleteDataBtn.source"></icon-show>
            删除数据
          </el-button>
          <el-button v-if="permissionList.deleteEveryTypeBtn" class="button-custom-icon" plain size="small" type="danger"
                     @click="checkClickHandler">
            <icon-show :name="permissionList.deleteEveryTypeBtn.source"></icon-show>
            删除全部类型
          </el-button>
          <el-button v-if="permissionList.viewTheScopeBtn" class="button-custom-icon" plain size="small" type="primary"
                     @click="checkViewClickHandler">
            <icon-show :name="permissionList.viewTheScopeBtn.source"></icon-show>
            查看使用范围
          </el-button>
        </div>
        <div style="display: flex;justify-content:left;margin-top: 15px;">
          <div class="descBox" style="width: 40%">
            <el-descriptions :column="1" border class="margin-top" size="medium" title="属性信息">
            <el-descriptions :column="2" border class="margin-top" size="medium" title="属性信息">
              <el-descriptions-item :contentStyle="descriptionOption.contentStyle"
                                    :labelStyle="descriptionOption.labelStyle">
                                    :labelStyle="descriptionOption.labelStyle"
                                    :span="12">
                <template slot="label">
                  名称
                </template>
@@ -50,8 +94,18 @@
                </template>
                <el-tag v-if="nodeRow.name">{{ nodeRow.name }}</el-tag>
              </el-descriptions-item>
              <el-descriptions-item :contentStyle="descriptionOption.contentStyle"
              <el-descriptions-item :contentStyle="descriptionOption.contentStyle+';min-width: 100px;'"
                                    :labelStyle="descriptionOption.labelStyle">
                <template slot="label">
                  图标
                </template>
                <span class="avue-icon">
                  <icon-show :name="nodeRow.imageName"></icon-show>
                </span>
              </el-descriptions-item>
              <el-descriptions-item :contentStyle="descriptionOption.contentStyle"
                                    :labelStyle="descriptionOption.labelStyle"
                                    :span="12">
                <template slot="label">
                  实现类
                </template>
@@ -61,7 +115,8 @@
                </el-tooltip>
              </el-descriptions-item>
              <el-descriptions-item :contentStyle="descriptionOption.contentStyle"
                                    :labelStyle="descriptionOption.labelStyle">
                                    :labelStyle="descriptionOption.labelStyle"
                                    :span="12">
                <template slot="label">
                  描述
                </template>
@@ -69,7 +124,7 @@
              </el-descriptions-item>
            </el-descriptions>
          </div>
          <div class="descBox" style="width: 25%;">
          <div class="descBox" style="width: 24%;">
            <el-descriptions :column="1" border class="margin-top" size="medium" title="版本规则">
              <el-descriptions-item :contentStyle="descriptionOption.contentStyle"
                                    :labelStyle="descriptionOption.labelStyle">
@@ -121,7 +176,7 @@
            </el-descriptions>
          </div>
          <div class="descBox" style="width: calc(35% - 40px);margin-right: 0">
          <div class="descBox" style="width: calc(36% - 40px);margin-right: 0">
            <el-descriptions :column="1" border class="margin-top" size="medium" title="生命周期">
              <el-descriptions-item :contentStyle="descriptionOption.contentStyle"
                                    :labelStyle="descriptionOption.labelStyle">
@@ -129,6 +184,16 @@
                  生命周期
                </template>
                <el-tag v-if="nodeRow.lifeCycleId">{{ nodeRow.lifeCycleId }}</el-tag>
              </el-descriptions-item>
              <el-descriptions-item :contentStyle="descriptionOption.contentStyle"
                                    :labelStyle="descriptionOption.labelStyle">
                <template slot="label">
                  备选生命周期
                </template>
                <div v-if="nodeRow.lifeCycleIds">
                  <el-tag v-for="item in nodeRow.lifeCycleIds.split(',')" style="margin-right: 5px;">{{ item }}</el-tag>
                </div>
              </el-descriptions-item>
            </el-descriptions>
          </div>
@@ -158,124 +223,104 @@
            <el-form-item label="类型名称:" prop="id">
              <el-input v-model="form.id" :readOnly="title === 'edit'"></el-input>
            </el-form-item>
            <el-form-item label="标签:">
              <el-input v-model="form.name"></el-input>
            <el-row :span="24">
              <el-col :span="12">
                <el-form-item label="标签:" prop="name">
                  <el-input v-model="form.name"></el-input>
                </el-form-item>
              </el-col>
              <el-col :span="12">
                <el-form-item label="图标:" prop="imageName">
                  <input-icon v-model="form.imageName" placeholder="请选择图标"></input-icon>
                </el-form-item>
              </el-col>
            </el-row>
            <el-form-item label="继承自:" prop="fName">
              <avue-input-tree v-model="form.fName"
                               :dic="inheritTreeData"
                               :disabled="title === 'add'"
                               :props="{label: 'id', value: 'id',children: 'children'}"
                               placeholder="请选择业务类型"></avue-input-tree>
            </el-form-item>
            <el-form-item label="继承自:">
              <div style="display: flex;gap: 5px;align-items: center">
                <el-input v-model="form.fName" :readOnly="true"></el-input>
                <el-button :disabled="title === 'add'" plain size="small" style="margin-left: 5px;height: 30px"
                           type="success"
                           @click="inheritClickHandler">选择
                </el-button>
              </div>
            </el-form-item>
            <el-form-item label="实现类:">
            <el-form-item label="实现类:" prop="implClass">
              <el-input v-model="form.implClass"></el-input>
            </el-form-item>
            <el-form-item label="描述">
            <el-form-item label="描述" prop="description">
              <el-input v-model="form.description" :rows="2" type="textarea"></el-input>
            </el-form-item>
          </div>
          <div class="centerForm" style="width: 24%">
            <el-form-item label="版本规则:" label-width="110px" prop="revLevel">
              <el-select v-model="form.revLevel" @change="revLevelChange">
                <el-option label="不可修订" value="0"></el-option>
                <el-option label="采用一级版本管理" value="1"></el-option>
                <el-option label="采用二级版本管理" value="2"></el-option>
              </el-select>
          <div class="centerForm" style="width: 26%">
            <el-form-item label="版本规则:" label-width="100px" prop="revLevel" style="margin-bottom: 10px;">
              <el-radio v-model="form.revLevel" label="0" @input="revLevelChange">不可修订</el-radio>
              <br>
              <el-radio v-model="form.revLevel" label="1" @input="revLevelChange">采用一级版本管理</el-radio>
              <br>
              <el-radio v-model="form.revLevel" label="2" @input="revLevelChange">采用二级版本管理</el-radio>
            </el-form-item>
            <el-form-item v-if="form.revLevel !== '0'" label="版本号规则:" label-width="110px" prop="revisionRuleId">
              <div style="display: flex;gap: 5px;align-items: center">
                <el-input v-model="form.revisionRuleId" :readOnly="true"></el-input>
                <el-button :disabled="form.inputRevisionFlag" plain size="small" style="margin-left: 5px;height: 30px"
                           type="success"
                           @click="versionAddHandler">添加
                </el-button>
                <el-switch
                  v-model="form.inputRevisionFlag"
                  active-text="手工输入"
                  style="width: 300px"
                  @change="form.revisionRuleId = ''">
                </el-switch>
              </div>
            <el-form-item v-if="form.revLevel !== '0'" label="版本号规则:" label-width="100px" prop="revisionRuleId"
                          style="margin-bottom: 5px;">
              <avue-select v-model="form.revisionRuleId"
                           :dic="versionData"
                           :disabled="form.inputRevisionFlag"
                           :filterable="true"
                           :props="{label: 'id', value: 'id'}"
                           placeholder="请选择版本号规则"></avue-select>
              <el-switch
                v-model="form.inputRevisionFlag"
                active-text="手工输入"
                style="width: 300px"
                @change="form.revisionRuleId = ''">
              </el-switch>
            </el-form-item>
            <el-form-item v-if="form.revLevel !== '0'" label="分隔符:" label-width="110px" prop="delimiter">
              <el-select v-model="form.delimiter" clearable>
                <el-option label="." value="."></el-option>
                <el-option label="-" value="-"></el-option>
              </el-select>
            <el-form-item v-if="form.revLevel !== '0'" label="分隔符:" label-width="100px" prop="delimiter"
                          style="margin-bottom: 5px;">
              <el-radio v-model="form.delimiter" label="">&nbsp;&nbsp;</el-radio>
              <el-radio v-model="form.delimiter" label=".">.</el-radio>
              <el-radio v-model="form.delimiter" label="-">-</el-radio>
            </el-form-item>
            <el-form-item v-if="form.revLevel !== '0' && form.revLevel !== '1'" label="版次号规则:" label-width="110px"
            <el-form-item v-if="form.revLevel !== '0' && form.revLevel !== '1'" label="版次号规则:" label-width="100px"
                          prop="versionRule">
              <el-select v-model="form.versionRule" clearable>
                <el-option label="1.2.3..." value="0"></el-option>
                <el-option label="a.b.c..." value="1"></el-option>
                <el-option label="0.1.2..." value="2"></el-option>
              </el-select>
              <el-radio v-model="form.versionRule" label="0">1.2.3...</el-radio>
              <el-radio v-model="form.versionRule" label="1">a.b.c...</el-radio>
              <el-radio v-model="form.versionRule" label="2">0.1.2...</el-radio>
            </el-form-item>
          </div>
          <div class="rightForm" style="width: 26%">
          <div class="rightForm" style="width: 25%">
            <el-form-item label="生命周期:" label-width="138px" prop="lifeCycleId">
              <div style="display: flex;gap: 5px;align-items: center">
                <el-input v-model="form.lifeCycleId" :readOnly="true"></el-input>
                <el-button plain size="small" style="margin-left: 5px;height: 30px" type="success"
                           @click="lifeAddHandler('input')">添加
                </el-button>
              </div>
              <avue-select v-model="form.lifeCycleId"
                           :dic="lifeData"
                           :filterable="true"
                           :props="{label: 'id', value: 'id'}"
                           placeholder="请选择生命周期"></avue-select>
            </el-form-item>
            <el-form-item label="备选生命周期列表:" label-width="138px">
              <div style="display: flex; align-items: center">
                <div style="height: 200px; width: 280px; border: 1px solid #bdbbbb;overflow-y: auto">
                  <!-- 内容 -->
                  <el-table
                    :data="dialogLifeTable"
                    :show-header="false"
                    style="width: 100%">
                    <el-table-column
                      align="center"
                      prop="id">
                    </el-table-column>
                    <el-table-column
                      fixed="right"
                      label="操作"
                      width="60">
                      <template slot-scope="scope">
                        <el-button
                          size="small"
                          style="color:#F56C6C;"
                          type="text"
                          @click.native.prevent="dialogDeleteLifeTable(scope.$index)">
                          移除
                        </el-button>
                      </template>
                    </el-table-column>
                  </el-table>
                </div>
                <el-button plain size="mini" style="margin-left: 5px" type="success"
                           @click="lifeAddHandler('table')">添加
                </el-button>
              </div>
            <el-form-item label="备选生命周期列表:" label-width="138px" prop="subLifeCycleIdList">
              <avue-select v-model="form.subLifeCycleIdList"
                           :dic="subLifeData"
                           :filterable="true"
                           :props="{label: 'id', value: 'id'}"
                           multiple
                           placeholder="请选择生命周期"
                           type="tree"
                           @change="subLifeChange"></avue-select>
            </el-form-item>
          </div>
        </div>
      </el-form>
      <div class="bottomForm">
        <h3 style="margin-bottom: 10px;">属性池列表</h3>
        <avue-crud
          :data="dialogAttrData"
          :option="dialogAttrOption"
          size="mini"
          @row-del="dialogBottomAttrDel">
          <template slot="menuLeft">
            <el-button icon="el-icon-plus" size="small" type="primary" @click="addDialogClickHandler">创建</el-button>
            <h3 style="display: inline-block;margin-right: 20px;margin-bottom: 10px;">属性池列表</h3>
            <el-button icon="el-icon-plus" size="mini" type="primary" @click="addDialogClickHandler">创建</el-button>
          </template>
        </avue-crud>
      </div>
      <span slot="footer" class="dialog-footer avue-dialog__footer">
         <el-button type="primary" @click="addDialogSavaHandler">确 定</el-button>
         <el-button @click="addDialogClose">取 消</el-button>
      <span slot="footer" class="dialog-footer">
         <el-button size="small" type="primary" @click="addDialogSavaHandler">确 定</el-button>
         <el-button size="small" @click="addDialogClose">取 消</el-button>
        </span>
    </el-dialog>
@@ -305,89 +350,8 @@
      >
      </avue-crud>
      <span slot="footer" class="dialog-footer">
         <el-button @click="dialogAttrClose">取 消</el-button>
         <el-button type="primary" @click="dialogAttrAddClickHandler">确 定</el-button>
        </span>
    </el-dialog>
    <!-- 版本号规则选择 -->
    <el-dialog
      v-dialogDrag
      :visible.sync="dialogVersionVisible"
      append-to-body="true"
      class="avue-dialog"
      title="版本号规则"
      width="60%"
    >
      <avue-crud
        :key="dialogVersionKey"
        ref="dialogAttrCrud"
        :data="dialogVersionData"
        :option="dialogVersionOption"
        :table-loading="dialogVersionLoading"
        @row-click="dialogVersionRowClick"
        @search-change="versionHandleSearch"
        @search-reset="versionHandleReset"
      >
      </avue-crud>
      <span slot="footer" class="dialog-footer">
         <el-button @click="dialogVersionVisible = false">取 消</el-button>
         <el-button type="primary" @click="dialogVersionAddClickHandler">确 定</el-button>
        </span>
    </el-dialog>
    <!-- 生命周期 -->
    <el-dialog
      v-dialogDrag
      :visible.sync="dialogLfeVisible"
      append-to-body="true"
      class="avue-dialog"
      title="生命周期模板"
      width="60%"
    >
      <avue-crud
        :key="dialogLifeKey"
        ref="dialogAttrCrud"
        :data="dialogLifeData"
        :option="dialogLifeOption"
        :table-loading="dialogLifeLoading"
        @row-click="dialogLifeRowClick"
        @search-change="lifeHandleSearch"
        @search-reset="lifeHandleReset"
      >
      </avue-crud>
      <span slot="footer" class="dialog-footer">
         <el-button @click="dialogLfeVisible = false">取 消</el-button>
         <el-button type="primary" @click="dialogLifeAddClickHandler">确 定</el-button>
        </span>
    </el-dialog>
    <!-- 继承自 -->
    <el-dialog
      v-dialogDrag
      :visible.sync="dialogInheritVisible"
      append-to-body="true"
      class="avue-dialog"
      title="继承业务类型"
      width="30%"
      @close="inheritClose"
    >
      <avue-tree ref="inheritTree" v-model="treeForm" :data="inheritTreeData" :option="inheritTreeOption"
                 @node-click="inheritNodeClick">
         <span slot-scope="{ node, data }" class="el-tree-node__label">
           <span style="font-size: 15px">
              <i class="el-icon-s-promotion"></i>
                {{ (node || {}).label }}
            </span>
          </span>
      </avue-tree>
      <span slot="footer" class="dialog-footer">
         <el-button type="primary" @click="inheritSaveClickHandler">确 定</el-button>
         <el-button @click="inheritClose">取 消</el-button>
         <el-button size="small" type="primary" @click="dialogAttrAddClickHandler">确 定</el-button>
         <el-button size="small" @click="dialogAttrClose">取 消</el-button>
        </span>
    </el-dialog>
@@ -430,8 +394,8 @@
        :table-loading="conCheckLoading">
      </avue-crud>
      <span slot="footer" class="dialog-footer">
         <el-button type="primary" @click="repairClickHandler">修 复</el-button>
         <el-button @click="conCheckVisible = false">取 消</el-button>
         <el-button size="small" type="primary" @click="repairClickHandler">修 复</el-button>
         <el-button size="small" @click="conCheckVisible = false">取 消</el-button>
        </span>
    </el-dialog>
@@ -495,8 +459,8 @@
        </span>
      </el-dialog>
      <span slot="footer" class="dialog-footer">
         <el-button type="primary" @click="indexClickAddHandler">保 存</el-button>
         <el-button @click="indexDialogClose">取 消</el-button>
         <el-button size="small" type="primary" @click="indexClickAddHandler">保 存</el-button>
         <el-button size="small" @click="indexDialogClose">取 消</el-button>
        </span>
    </el-dialog>
@@ -524,6 +488,7 @@
import func from "@/util/func";
import {getUsedVersionRuleList, getVersionRuleAllList} from "@/api/modeling/version/api";
import {gridLifeCycle} from "@/api/modeling/lifeCycle/api";
import {mapGetters} from "vuex";
export default {
  name: "index",
@@ -611,10 +576,12 @@
        index: false,
        selection: false,
        refreshBtn: false,
        header: false,
        column: [
          {
            label: '类型名',
            prop: 'id',
            width: 250,
          },
          {
            label: '操作',
@@ -623,6 +590,7 @@
          {
            label: '状态',
            prop: 'status',
            width: 250,
          }
        ]
      },
@@ -639,7 +607,7 @@
        searchMenuSpan: 8,
        refreshBtn: false,
        selection: false,
        header:false,
        header: false,
        column: [
          {
            label: '名称',
@@ -667,73 +635,11 @@
      fileUrl: 'api/linkTypeController/impData',
      createViewLoading: false, // 创建视图
      versionAddFlag: false,
      treeForm: {},
      inheritNodeRow: {},
      inheritTreeOption: {
        height: 'auto',
        defaultExpandAll: false,
        menu: false,
        addBtn: false,
        props: {
          label: 'id',
          value: 'id',
          children: 'children'
        }
      },
      inheritTreeData: [],
      dialogInheritVisible: false,
      dialogLifeDefalutData: [], // 查询重置默认数据
      lifeType: '',
      dialogLifeTable: [],
      dialogLifeSaveRow: {},
      dialogLifeKey: Math.random(),
      dialogLifeData: [],
      dialogLifeOption: {
        ...basicOption,
        addBtn: false,
        selection: false,
        refreshBtn: false,
        menu: false,
        height: 450,
        searchMenuSpan: 8,
        highlightCurrentRow: true,
        column: [
          {
            label: '生命周期模板名',
            prop: 'id',
            searchLabelWidth: 120,
            search: true
          }
        ]
      },
      dialogLifeLoading: false,
      dialogLfeVisible: false,
      dialogVersionDefalutData: [], // 查询重置默认数据
      dialogSwitchValue: false,
      dialogVersionSaveRow: {},
      dialogVersionVisible: false,
      dialogVersionKey: Math.random(),
      dialogVersionData: [],
      dialogVersionOption: {
        ...basicOption,
        addBtn: false,
        selection: false,
        refreshBtn: false,
        menu: false,
        height: 450,
        searchMenuSpan: 8,
        highlightCurrentRow: true,
        // calcHeight: 100,
        column: [
          {
            label: '版本号规则',
            prop: 'id',
            searchLabelWidth: 110,
            search: true
          }
        ]
      },
      dialogVersionLoading: false,
      lifeData: [],//生命周期下拉数据
      subLifeData: [],//备选生命周期下拉数据
      allLifeData: [],
      versionData: [],//版本规则数据
      dialogAttrSelectList: [],
      searchAttrParams: {},
      dialogAttrLoading: false,
@@ -754,23 +660,28 @@
        height: 450,
        searchMenuSpan: 8,
        header: false,
        selectable: function (row) {
          return row.selectable;
        },
        column: [
          {
            label: '属性名',
            prop: 'id',
            sortable: true,
            search: true,
            width: 260
          },
          {
            label: '属性类型',
            prop: 'attributeDataType',
            sortable: true,
            width:150,
            width: 150,
          },
          {
            label: '初始值',
            prop: 'defaultValue',
            sortable: true,
            width: 200
          },
          {
            label: '说明',
@@ -787,6 +698,9 @@
          {required: true, message: '请输类型名称', trigger: 'blur'},
          {validator: this.validateEnglishOnly, trigger: 'blur'}
        ],
        imageName: [
          {required: true, message: '请选择图标', trigger: 'submit'},
        ],
        revLevel: [
          {required: true, message: '请选择版本规则', trigger: 'blur'},
        ],
@@ -800,33 +714,37 @@
        editBtn: false,
        refreshBtn: false,
        selection: false,
        height: 210,
        height: 220,
        addBtn: false,
        menuWidth:100,
        gridBtn: false,
        columnBtn: false,
        menuWidth: 100,
        // index:false,
        column: [
          {
            label: '属性名',
            prop: 'id',
            sortable: true,
            width: 260,
          },
          {
            prop: 'btmTypeId',
            label: '业务类型',
            sortable: true
            sortable: true,
            width: 200
          },
          {
            label: '属性类型',
            prop: 'attributeDataType',
            sortable: true,
            width:150,
            width: 150,
          },
          {
            label: '初始值',
            prop: 'defaultValue',
            sortable: true,
            width:150,
            width: 200,
          },
          {
            label: '说明',
@@ -850,22 +768,26 @@
          {
            prop: 'id',
            label: '属性名',
            sortable: true
            sortable: true,
            width: 260
          },
          {
            prop: 'btmTypeId',
            label: '业务类型',
            sortable: true
            sortable: true,
            width: 200
          },
          {
            prop: 'attributeDataType',
            label: '属性类型',
            sortable: true
            sortable: true,
            width: 150
          },
          {
            prop: 'defaultValue',
            label: '默认值',
            sortable: true
            sortable: true,
            width: 200
          },
          {
            prop: 'description',
@@ -880,13 +802,14 @@
        fName: '', // 继承自
        implClass: '', // 实现类
        description: '', // 描述
        revLevel: '', // 版本规则
        revLevel: '2', // 版本规则
        revisionRuleId: '',// 版本号规则
        inputRevisionFlag: false, // 手工输入,
        delimiter: '', // 分隔符
        versionRule: '0', // 版次号规则
        lifeCycleId: '', // 生命周期
        subLifeCycleId: '', // 生命周期备选列表,
        subLifeCycleIdList: [],
        apNameArray: "", // 属性池列表’,‘分隔
      },
      nodeRow: {},
@@ -910,8 +833,8 @@
        }
      ],
      descriptionOption: {
        labelStyle: 'text-align:center;width:100px;',
        contentStyle: 'max-width:200px;text-align:center;word-break;break-all;'
        labelStyle: 'text-align:center;width:110px;',
        contentStyle: 'min-width:200px;text-align:center;word-break:break-all;'
      },
      icons: {
        id: 'el-icon-finished',
@@ -923,8 +846,39 @@
  },
  created() {
    this.getTreeList();
    this.getVersionList();
    this.getLifeCycle();
  },
  mounted() {
  computed: {
    ...mapGetters(["permission"]),
    permissionList() {
      return {
        addBtn: this.vaildData(this.permission[this.$route.query.id].ADD, false),
        delBtn: this.vaildData(this.permission[this.$route.query.id].DELETE, false),
        editBtn: this.vaildData(this.permission[this.$route.query.id].EDIT, false),
        exportBtn: this.vaildData(this.permission[this.$route.query.id].EXPORT, false),
        importBtn: this.vaildData(this.permission[this.$route.query.id].IMPORT, false),
        consistencyCheckBtn: this.vaildData(this.permission[this.$route.query.id].USE, false),
        createViewBtn: this.vaildData(this.permission[this.$route.query.id].ADD2, false),
        createIndexBtn: this.vaildData(this.permission[this.$route.query.id].ADD3, false),
        deleteDataBtn: this.vaildData(this.permission[this.$route.query.id].DELETE2, false),
        deleteEveryTypeBtn: this.vaildData(this.permission[this.$route.query.id].DELETE3, false),
        viewTheScopeBtn: this.vaildData(this.permission[this.$route.query.id].SEARCH, false),
      };
    },
  },
  watch: {
    'form.lifeCycleId': {
      handler(newval) {
        if (this.form.lifeCycleId) {
          this.subLifeData = this.allLifeData.filter(item => {
            return item.id != this.form.lifeCycleId
          });
        } else {
          this.subLifeData = this.allLifeData
        }
      },
    }
  },
  methods: {
    //树表查询
@@ -934,6 +888,7 @@
        const data = res.data.data.map(item => {
          this.processChildren(item); // 处理每个节点
          item.attributes.TreeName = item.attributes.id;
          item.attributes.icon = item.attributes.imageName;
          return item.attributes; // 返回处理后的 attributes
        });
        this.treeData[0].children = data;
@@ -947,6 +902,7 @@
      if (item.children && item.children.length > 0) {
        item.attributes.children = item.children.map(child => {
          child.attributes.TreeName = child.attributes.id;
          child.attributes.icon = child.attributes.imageName;
          this.processChildren(child); // 递归处理每个子节点
          return child.attributes; // 只返回子节点的 attributes
        });
@@ -958,7 +914,18 @@
      this.attrData = row.attributes ? JSON.parse(row.attributes) : [];
      this.nodeRow = row;
    },
    //获取版本规则数据
    getVersionList() {
      getVersionRuleAllList().then(res => {
        this.versionData = res.data.data;
      });
    },
    //获取生命周期数据
    getLifeCycle() {
      gridLifeCycle().then(res => {
        this.allLifeData = res.data.data;
      });
    },
    // 创建按钮
    addClickHandler() {
      if (func.isEmptyObject(this.nodeRow)) {
@@ -967,336 +934,20 @@
      }
      this.title = 'add';
      this.form.fName = this.nodeRow.id === 'topNode' ? "" : this.nodeRow.id;
      console.log(this.nodeRow);
      this.lifeData = this.allLifeData;
      this.subLifeData = this.allLifeData;
      this.form.inputRevisionFlag = JSON.parse(this.form.inputRevisionFlag); // 字符串false转换为布尔值
      this.visible = true;
    },
    // 关闭继承对话框
    inheritClose() {
      this.dialogInheritVisible = false;
      this.$refs.inheritTree.setCurrentKey(null); // 取消当前选中的节点
    },
    // 继承按钮
    inheritClickHandler() {
      this.dialogInheritVisible = true;
    },
    // 继承树行点击
    inheritNodeClick(row) {
      this.inheritNodeRow = row;
    },
    // 继承树保存
    inheritSaveClickHandler() {
      this.form.fName = this.inheritNodeRow.id;
      this.dialogInheritVisible = false;
    },
    // 对话框 属性池列表增加按钮
    addDialogClickHandler() {
      this.dialogAttrLoading = true;
      this.attrPollDialogVisible = true;
      this.dialogAttrReload = Math.random(); // 强制刷新表格 解决表格错行
      this.getAttrDialogDta();
    },
    // 查询属性池列表数据
    getAttrDialogDta() {
      gridAttribute(this.attrPage.currentPage, this.attrPage.pageSize, this.searchAttrParams).then(res => {
        const data = res.data.data;
        this.dialogAttrSaveData = data;
        this.attrPage.total = res.data.total;
        this.dialogAttrLoading = false;
      }).catch(err => {
        this.$message.error(err);
      });
    },
    // 新增属性池列表关闭对话框
    dialogAttrClose() {
      this.attrPollDialogVisible = false;
      this.searchAttrParams = {};
    },
    // 添加属性池表格选择框
    dialogAttrSelectChange(row) {
      this.dialogAttrSelectList = row;
    },
    // 添加属性池 行点击
    dialogAttrRowClickHandler(row) {
      func.rowClickHandler(
        row,
        this.$refs.dialogAttrCrud,
        this.attrLastIndex,
        (newIndex) => {
          this.attrLastIndex = newIndex;
        },
        () => {
          this.selectList = [];
        }
      );
    },
    //添加属性池 条数
    attrSizeChange(val) {
      this.attrPage.pageSize = val;
      this.getAttrDialogDta()
    },
    //添加属性池 页码
    attrCurrentChange(val) {
      this.attrPage.currentPage = val;
      this.getAttrDialogDta();
    },
    //添加属性池 搜索
    attrHandleSearch(params, done) {
      if (func.isEmptyObject(params)) {
        this.searchAttrParams = {};
      } else {
        this.searchAttrParams = {
          "conditionMap[id]": "*" + params.id + "*"
        };
      }
      this.getAttrDialogDta();
      done();
    },
    //添加属性池 清空搜索
    attrHandleReset() {
      this.searchAttrParams = {};
      this.getAttrDialogDta();
    },
    // 添加属性池 保存
    dialogAttrAddClickHandler() {
      let hasDuplicate = false;
      // 先创建一个临时数组来存储不重复的项
      const newItems = [];
      this.dialogAttrSelectList.forEach(item => {
        const exists = this.dialogAttrData.some(existingItem => existingItem.id === item.id);
        if (exists) {
          hasDuplicate = true;
          return;
        }
        // 如果没有重复项,则将该项添加到临时数组中
        newItems.push({
          id: item.id,
          attributeDataType: item.attributeDataType,
          defaultValue: item.defaultValue,
          description: item.description
        });
      });
      if (hasDuplicate) {
        this.$message.error('请检查是否有添加重复项!');
      } else {
        // 如果没有重复项,将新项添加到 dialogAttrData
        this.dialogAttrData.push(...newItems);
        this.attrPollDialogVisible = false;
      }
    },
    // 属性池删除
    dialogBottomAttrDel(form, index) {
      this.dialogAttrData.splice(index, 1);
    },
    // 版本规则管理添加
    versionAddHandler() {
      this.dialogVersionVisible = true;
      this.dialogVersionKey = Math.random(); // 打开时刷新表格避免表格错行
      this.dialogVersionLoading = true;
      getVersionRuleAllList().then(res => {
        const data = res.data.data.map(item => {
          return {
            id: item.id
          }
        });
        this.dialogVersionData = data;
        this.dialogVersionDefalutData = data;
        this.dialogVersionLoading = false;
      }).catch(err => {
        this.$message.error(err)
      });
    },
    // 版本规则行点击
    dialogVersionRowClick(row) {
      this.dialogVersionSaveRow = row;
    },
    // 版本规则搜索
    versionHandleSearch(params, done) {
      const {id} = params;
      if (!params.id) {
        this.dialogVersionData = this.dialogVersionDefalutData;
        return done();
      }
      ;
      this.dialogVersionData = this.dialogVersionDefalutData.filter(item => {
        return item.id && item.id.includes(id);
      });
      done();
    },
    // 版本管理置空
    versionHandleReset() {
      this.dialogVersionData = this.dialogVersionDefalutData;
    },
    // 版本号规则保存
    dialogVersionAddClickHandler() {
      if (func.isEmptyObject(this.dialogVersionSaveRow)) {
        this.$message.error('请至少选择一条数据');
        return;
      }
      this.form.revisionRuleId = this.dialogVersionSaveRow.id;
      this.dialogVersionVisible = false;
    },
    // 生命周期新增
    lifeAddHandler(val) {
      this.dialogLfeVisible = true;
      this.dialogLifeKey = Math.random(); // 打开时刷新表格避免表格错行
      this.dialogLifeLoading = true;
      this.lifeType = val;
      gridLifeCycle().then(res => {
        const data = res.data.data.map(item => {
          return {
            id: item.id
          }
        });
        this.dialogLifeData = data;
        this.dialogLifeDefalutData = data;
        this.dialogLifeLoading = false
      }).catch(err => {
        this.$message.error(err)
      });
    },
    // 生命周期行点击
    dialogLifeRowClick(row) {
      this.dialogLifeSaveRow = row;
    },
    // 生命周期保存
    dialogLifeAddClickHandler() {
      if (func.isEmptyObject(this.dialogLifeSaveRow)) {
        this.$message.error('请至少选择一条数据');
        return;
      }
      if (this.lifeType === 'input') {
        this.form.lifeCycleId = this.dialogLifeSaveRow.id;
      } else {
        const flag = this.dialogLifeTable.some(item => item.id === this.dialogLifeSaveRow.id);
        if (flag) {
          this.$message.error('已存在相同的数据,请添加其他数据');
          return;
        }
        this.dialogLifeTable.push(this.dialogLifeSaveRow);
      }
      this.dialogLfeVisible = false;
    },
    // 生命周期备选列表移除
    dialogDeleteLifeTable(index) {
      this.dialogLifeTable.splice(index, 1)
    },
    // 生命周期搜索
    lifeHandleSearch(params, done) {
      const {id} = params;
      if (!params.id) {
        this.dialogLifeData = this.dialogLifeDefalutData;
        return done();
      }
      ;
      this.dialogLifeData = this.dialogLifeDefalutData.filter(item => {
        return item.id && item.id.includes(id);
      });
      done();
    },
    // 生命周期重置
    lifeHandleReset() {
      this.dialogLifeData = this.dialogLifeDefalutData;
    },
    // 只能输入英文正则校验
    validateEnglishOnly(rule, value, callback) {
      if (!value) {
        return callback(new Error('请输入类型名称'));
      }
      if (!/^[A-Za-z]+$/.test(value)) {
        return callback(new Error('只能输入英文字母'));
      }
      callback(); // 验证通过
    },
    // 清空表单
    resetForm() {
      const form = {
        id: '', // 类型名称
        name: '', // 标签
        fName: '', // 继承自
        implClass: '', // 实现类
        description: '', // 描述
        revLevel: '', // 版本规则
        revisionRuleId: '',// 版本号规则
        inputRevisionFlag: 'false', // 手工输入
        delimiter: '', // 分隔符
        versionRule: '0', // 版次号规则
        lifeCycleId: '', // 生命周期
        subLifeCycleId: '', // 生命周期备选列表,
        apNameArray: "", // 属性池列表’,‘分隔
      };
      this.dialogLifeTable = []; // 将生命周期表格置空
      this.dialogAttrData = []; // 将属性池表格置空
      this.form = {...form};
      this.$refs.form.clearValidate();
    },
    // 新增编辑对话框取消
    addDialogClose() {
      this.resetForm();
      this.visible = false;
    },
    // 版本规则切换 置空其他条件
    revLevelChange() {
      this.form.versionRule = "";
      this.form.inputRevisionFlag = false;
      this.form.delimiter = "";
      this.form.versionRule = "0";
      this.form.revisionRuleId = "";
    },
    // 新增编辑保存
    addDialogSavaHandler() {
      if (this.form.revLevel !== '0' &&!this.form.inputRevisionFlag && (!this.form.revisionRuleId || this.form.revisionRuleId === "")) {
      if (this.form.revLevel !== '0' && !this.form.inputRevisionFlag && (!this.form.revisionRuleId || this.form.revisionRuleId === "")) {
        this.$message.error('请检查版本号规则不能为空');
        return;
      }
      this.form.subLifeCycleId = this.dialogLifeTable ? this.dialogLifeTable.map(item => item.id).join(',') : "";
      this.form.lifeCycleIds = this.form.subLifeCycleIdList.join(',');
      this.form.subLifeCycleId = this.form.subLifeCycleIdList.join(',');
      this.form.apNameArray = this.dialogAttrData ? this.dialogAttrData.map(item => item.id).join(',') : "";
      this.$refs.form.validate((valid) => {
        const saveFunction = this.title === 'add' ? addLifeCycle : updateLifeCycle;
@@ -1346,13 +997,194 @@
      this.form = {...this.nodeRow};
      this.form.inputRevisionFlag = JSON.parse(this.form.inputRevisionFlag); // 字符串false转换为布尔值
      // this.form.fName = this.nodeRow.id === 'topNode' ? "" : this.nodeRow.id;
      this.dialogLifeTable = (this.nodeRow.lifeCycleIds && this.nodeRow.lifeCycleIds.trim())
        ? this.nodeRow.lifeCycleIds.split(',').map(item => ({id: item.trim()}))
        : [];
      this.form.subLifeCycleIdList = this.nodeRow.lifeCycleIds ? this.nodeRow.lifeCycleIds.split(',') : [];
      this.dialogAttrData = this.nodeRow.attributes ? JSON.parse(this.nodeRow.attributes) : [];
      function processChildren(item, fName) {
        if (item.children && item.children.length > 0) {
          item.children = item.children.map(child => {
            processChildren(child, fName); // 递归处理每个子节点
            if (fName == child.id) {
              child.disabled = true;
            } else {
              child.disabled = false;
            }
            return child;
          });
        }
      };
      const inheritTreeData = this.inheritTreeData.map(item => {
        processChildren(item, this.form.id); // 处理每个节点
        if (this.form.id == item.id) {
          item.disabled = true;
        } else {
          item.disabled = false;
        }
        return item;
      });
      this.inheritTreeData = inheritTreeData
      this.title = 'edit';
      this.visible = true;
      console.log(this.form);
    },
    subLifeChange(data) {
      if (data.value.length == 0) {
        this.lifeData = this.allLifeData
      } else {
        this.lifeData = this.allLifeData.filter(item => {
          return !data.value.includes(item.id)
        });
      }
    },
    // 对话框 属性池列表增加按钮
    addDialogClickHandler() {
      this.dialogAttrLoading = true;
      this.attrPollDialogVisible = true;
      this.dialogAttrReload = Math.random(); // 强制刷新表格 解决表格错行
      this.getAttrDialogDta();
    },
    // 查询属性池列表数据
    getAttrDialogDta() {
      gridAttribute(this.attrPage.currentPage, this.attrPage.pageSize, this.searchAttrParams).then(res => {
        const data = res.data.data.map(item => {
          item.selectable = !this.dialogAttrData.some(existingItem => existingItem.id === item.id);
          return item;
        });
        this.dialogAttrSaveData = data;
        this.attrPage.total = res.data.total;
        this.dialogAttrLoading = false;
      }).catch(err => {
        this.$message.error(err);
      });
    },
    // 新增属性池列表关闭对话框
    dialogAttrClose() {
      this.attrPollDialogVisible = false;
      this.searchAttrParams = {};
    },
    // 添加属性池表格选择框
    dialogAttrSelectChange(row) {
      this.dialogAttrSelectList = row;
    },
    // 添加属性池 行点击
    dialogAttrRowClickHandler(row) {
      if (!row.selectable) {
        return;
      }
      func.rowClickHandler(
        row,
        this.$refs.dialogAttrCrud,
        this.attrLastIndex,
        (newIndex) => {
          this.attrLastIndex = newIndex;
        },
        () => {
          this.dialogAttrSelectList = [row];
        }
      );
    },
    //添加属性池 条数
    attrSizeChange(val) {
      this.attrPage.pageSize = val;
      this.getAttrDialogDta()
    },
    //添加属性池 页码
    attrCurrentChange(val) {
      this.attrPage.currentPage = val;
      this.getAttrDialogDta();
    },
    //添加属性池 搜索
    attrHandleSearch(params, done) {
      if (func.isEmptyObject(params)) {
        this.searchAttrParams = {};
      } else {
        this.searchAttrParams = {
          "conditionMap[id]": "*" + params.id + "*"
        };
      }
      this.getAttrDialogDta();
      done();
    },
    //添加属性池 清空搜索
    attrHandleReset() {
      this.searchAttrParams = {};
      this.getAttrDialogDta();
    },
    // 添加属性池 保存
    dialogAttrAddClickHandler() {
      this.dialogAttrSelectList.forEach(item => {
        this.dialogAttrData.push({
          id: item.id,
          attributeDataType: item.attributeDataType,
          defaultValue: item.defaultValue,
          description: item.description
        });
      });
      this.attrPollDialogVisible = false;
    },
    // 属性池删除
    dialogBottomAttrDel(form, index) {
      this.dialogAttrData.splice(index, 1);
    },
    // 只能输入英文正则校验
    validateEnglishOnly(rule, value, callback) {
      if (!value) {
        return callback(new Error('请输入类型名称'));
      }
      if (!/^[A-Za-z]+$/.test(value)) {
        return callback(new Error('只能输入英文字母'));
      }
      callback(); // 验证通过
    },
    // 清空表单
    resetForm() {
      const form = {
        id: '', // 类型名称
        name: '', // 标签
        fName: '', // 继承自
        implClass: '', // 实现类
        description: '', // 描述
        revLevel: '2', // 版本规则
        revisionRuleId: '',// 版本号规则
        inputRevisionFlag: 'false', // 手工输入
        delimiter: '', // 分隔符
        versionRule: '0', // 版次号规则
        lifeCycleId: '', // 生命周期
        subLifeCycleId: '', // 生命周期备选列表,
        subLifeCycleIdList: [],
        lifeCycleIds: '',
        apNameArray: "", // 属性池列表’,‘分隔
      };
      this.dialogAttrData = []; // 将属性池表格置空
      this.form = {...form};
      this.$refs.form.clearValidate();
    },
    // 新增编辑对话框取消
    addDialogClose() {
      this.resetForm();
      this.visible = false;
    },
    // 版本规则切换 置空其他条件
    revLevelChange() {
      this.form.inputRevisionFlag = false;
      this.form.delimiter = "";
      this.form.versionRule = "0";
      this.form.revisionRuleId = "";
    },
    // 删除按钮
@@ -1361,7 +1193,7 @@
        this.$message.error('请至少选择一条数据');
        return;
      }
      ;
      this.$confirm('您确定要删除所选择的数据吗?', '提示', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
@@ -1445,7 +1277,6 @@
        this.checkViewData = this.checkViewDataSearch;
        return done();
      }
      ;
      this.checkViewData = this.checkViewDataSearch.filter(item => {
        return item.source && item.source.includes(source);
@@ -1476,18 +1307,14 @@
            Object.entries(data).forEach(([id, methods]) => {
              let action;
              switch (methods) {
                case '_CREATE':
                  action = '创建表';
                  break;
                case '_ADD':
                  action = '增加列';
                  break;
                case '_DROP':
                  action = '移除列';
                  break;
                default:
                  action = '未知';
              if (methods.includes('_CREATE')) {
                action = methods.replace('_CREATE', '创建表');
              } else if (methods.includes('_ADD')) {
                action = methods.replace('_ADD', '增加列');
              } else if (methods.includes('_DROP')) {
                action = methods.replace('_DROP', '移除列');
              } else {
                action = '未知';
              }
              outputData.push({
                id: id,
@@ -1628,7 +1455,6 @@
        indexName: this.indexForm.name,
      }
      addIndex([params]).then(res => {
        console.log(res)
        this.$message.success('创建成功');
        this.indexDialogClose();
      }).catch(err => {
@@ -1662,9 +1488,13 @@
    width: 100%;
  }
  .el-tag{
    line-height:22px;
  .el-tag {
    line-height: 22px;
    height: 24px;
  }
  .el-radio {
    margin-right: 20px;
  }
}
@@ -1680,7 +1510,7 @@
.dialogForm > div {
  border: 1px solid #EBEEF5;
  border-radius: 2px;
  padding: 25px 20px 5px 10px; /* 上 右 下 左 */
  padding: 15px 20px 0 10px; /* 上 右 下 左 */
  box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.1); /* 添加阴影效果 */
}