| | |
| | | <template> |
| | | <el-container> |
| | | <el-container v-loading="createViewLoading"> |
| | | <el-aside> |
| | | <basic-container> |
| | | <div ref="TreeBox" style="height: calc(100vh - 144px);!important;"> |
| | | <div class="headerCon"> |
| | | <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 class="miniBtn" icon="el-icon-circle-plus-outline" plain size="small" |
| | | type="primary" @click="createViewClickHandler">创建视图 |
| | | </el-button> |
| | | <el-button class="miniBtn" icon="el-icon-circle-plus-outline" plain size="small" |
| | | type="primary" @click="checkClickHandler">创建索引 |
| | | </el-button> |
| | | <el-button icon="el-icon-menu" plain size="small" style="width: 82px;text-align: center;padding-left: 1px" |
| | | type="primary" @click="checkClickHandler">一致性检查 |
| | | </el-button> |
| | | <el-button class="miniBtn" icon="el-icon-delete" plain size="small" |
| | | type="danger" @click="checkClickHandler">删除数据 |
| | | </el-button> |
| | | <el-button class="smallBtn" plain size="small" |
| | | type="danger" @click="checkClickHandler">删除全部类型 |
| | | </el-button> |
| | | <el-button class="smallBtn" plain size="small" type="primary">查看使用范围 |
| | | </el-button> |
| | | </div> |
| | | <div ref="TreeBox" style="height: calc(100vh - 154px);!important;"> |
| | | |
| | | <!-- 左侧树 --> |
| | | <div style="height: calc(100vh - 330px);"> |
| | | <avue-tree :data="treeData" :option="treeOption" @node-click="nodeClick"> |
| | | <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> |
| | |
| | | </el-aside> |
| | | <el-main> |
| | | <basic-container> |
| | | <div style="display: flex;justify-content: center; height: 230px"> |
| | | <div class="descBox" style="max-height: 100px"> |
| | | <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> |
| | | </div> |
| | | <div style="display: flex;justify-content:left;margin-top: 15px;"> |
| | | <div class="descBox"> |
| | | <el-descriptions :column="1" border class="margin-top" size="medium" title="属性信息"> |
| | | <el-descriptions-item :contentStyle="descriptionOption.contentStyle" |
| | | :labelStyle="descriptionOption.labelStyle"> |
| | |
| | | </template> |
| | | <el-tooltip v-if="nodeRow.implClass" :content="nodeRow.implClass" class="item" effect="dark" |
| | | placement="top-start"> |
| | | <el-tag style="max-width: 250px;overflow: hidden">{{ nodeRow.implClass }} |
| | | </el-tag> |
| | | <el-tag style="max-width: 100%;overflow: hidden;display: block">{{ nodeRow.implClass }}</el-tag> |
| | | </el-tooltip> |
| | | </el-descriptions-item> |
| | | <el-descriptions-item :contentStyle="descriptionOption.contentStyle" |
| | |
| | | </el-descriptions> |
| | | </div> |
| | | </div> |
| | | <div style="margin-top: 30px"> |
| | | <h3>属性列表</h3> |
| | | <div style="margin-top: 25px;position: relative"> |
| | | <h3 style="margin: 0;position: absolute;top:0;z-index: 1000;">属性列表</h3> |
| | | <avue-crud |
| | | :data="attrData" |
| | | :option="attrOption"> |
| | |
| | | class="avue-dialog" |
| | | width="75%" |
| | | @close="addDialogClose"> |
| | | <el-form ref="form" :model="form" :rules="rules" label-width="90px"> |
| | | <el-form ref="form" :model="form" :rules="rules" label-width="95px" size="small"> |
| | | <div class="dialogForm"> |
| | | <div class="leftForm"> |
| | | <el-form-item label="类型名称:" prop="name"> |
| | | <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-form-item> |
| | | <el-form-item label="继承自:"> |
| | | <el-input v-model="form.fName" :readOnly="title === 'edit'"></el-input> |
| | | <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-input v-model="form.implClass"></el-input> |
| | |
| | | </el-form-item> |
| | | </div> |
| | | <div class="centerForm"> |
| | | <el-form-item label="版本规则:" label-width="100px" prop="revLevel"> |
| | | <el-select v-model="form.revLevel"> |
| | | <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> |
| | | </el-form-item> |
| | | <el-form-item v-if="form.revLevel !== '0'" label="版本号规则:" label-width="100px" prop="revisionRuleName"> |
| | | <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 plain size="small" style="margin-left: 5px;height: 30px" type="success" @click="versionAddHandler">添加</el-button> |
| | | <el-button :disabled="form.inputRevisionFlag" plain size="small" style="margin-left: 5px;height: 30px" |
| | | type="success" |
| | | @click="versionAddHandler">添加 |
| | | </el-button> |
| | | <el-switch |
| | | style="width: 300px" |
| | | v-model="form.inputRevisionFlag" |
| | | active-text="手工输入"> |
| | | active-text="手工输入" |
| | | style="width: 300px" |
| | | @change="form.revisionRuleId = ''"> |
| | | </el-switch> |
| | | </div> |
| | | </el-form-item> |
| | | <el-form-item v-if="form.revLevel !== '0'" label="分隔符:" label-width="100px" prop="delimiter"> |
| | | <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> |
| | | <el-form-item v-if="form.revLevel !== '0' && form.revLevel !== '1'" label="版次号规则:" label-width="100px" |
| | | prop="revLevel"> |
| | | <el-form-item v-if="form.revLevel !== '0' && form.revLevel !== '1'" label="版次号规则:" label-width="110px" |
| | | prop="versionRule"> |
| | | <el-select v-model="form.versionRule" clearable> |
| | | <el-option label="1.2.3..." value="1.2.3..."></el-option> |
| | | <el-option label="a.b.c..." value="a.b.c..."></el-option> |
| | | <el-option label="0.1.2..." value="0.1.2..."></el-option> |
| | | <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-form-item> |
| | | </div> |
| | | <div class="rightForm"> |
| | | <el-form-item label="生命周期:" label-width="138px" prop="revLevel"> |
| | | <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> |
| | | <el-button plain size="small" style="margin-left: 5px;height: 30px" type="success" |
| | | @click="lifeAddHandler('input')">添加 |
| | | </el-button> |
| | | </div> |
| | | </el-form-item> |
| | | |
| | |
| | | </div> |
| | | </el-form> |
| | | <div class="bottomForm"> |
| | | <h3>属性池列表</h3> |
| | | <h3 style="margin-bottom: 10px;">属性池列表</h3> |
| | | <avue-crud |
| | | :data="dialogAttrData" |
| | | :option="dialogAttrOption"> |
| | | :option="dialogAttrOption" |
| | | @row-del="dialogBottomAttrDel"> |
| | | <template slot="menuLeft"> |
| | | <el-button icon="el-icon-plus" size="small" type="primary" @click="addDialogClickHandler">创建</el-button> |
| | | </template> |
| | | </avue-crud> |
| | | </div> |
| | | <span slot="footer" class="dialog-footer"> |
| | | <el-button @click="addDialogClose">取 消</el-button> |
| | | <span slot="footer" class="dialog-footer avue-dialog__footer"> |
| | | <el-button type="primary" @click="addDialogSavaHandler">确 定</el-button> |
| | | <el-button @click="addDialogClose">取 消</el-button> |
| | | </span> |
| | | </el-dialog> |
| | | |
| | |
| | | </span> |
| | | </el-dialog> |
| | | |
| | | <!-- 版本号规则选择 --> |
| | | <el-dialog |
| | | v-dialogDrag |
| | | :visible.sync="dialogVersionVisible" |
| | |
| | | |
| | | </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> |
| | | </span> |
| | | </el-dialog> |
| | | |
| | | <!-- 导入 --> |
| | | <upload-file ref="upload" :fileType="upFileType" :fileUrl="fileUrl" :tipList="tipList" title="导入" |
| | | @updata="getTreeList"></upload-file> |
| | | |
| | | <!-- 查看使用范围 --> |
| | | <el-dialog |
| | | v-dialogDrag |
| | | :visible.sync="checkViewVisible" |
| | | append-to-body="true" |
| | | class="avue-dialog" |
| | | title="查看使用范围" |
| | | width="60%" |
| | | > |
| | | <avue-crud |
| | | ref="checkViewCrud" |
| | | :data="checkViewData" |
| | | :option="checkViewOption" |
| | | :table-loading="checkViewLoading" |
| | | @search-change="checkHandleSearch" |
| | | @search-reset="checkHandleReset" |
| | | > |
| | | </avue-crud> |
| | | </el-dialog> |
| | | |
| | | <!-- 一致性检查 --> |
| | | <el-dialog |
| | | v-dialogDrag |
| | | :visible.sync="conCheckVisible" |
| | | append-to-body="true" |
| | | class="avue-dialog" |
| | | title="一致性检查" |
| | | width="60%" |
| | | > |
| | | <avue-crud |
| | | :data="conCheckData" |
| | | :option="conCheckOption" |
| | | :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> |
| | | </span> |
| | | </el-dialog> |
| | | |
| | | <!-- 查看索引 --> |
| | | <el-dialog |
| | | v-dialogDrag |
| | | :visible.sync="indexVisible" |
| | | append-to-body="true" |
| | | class="avue-dialog" |
| | | title="索引信息" |
| | | width="60%" |
| | | @close="indexDialogClose" |
| | | > |
| | | <div v-loading="indexLoading" style="display: flex;height: 500px;width: 100%"> |
| | | <basic-container> |
| | | <div style="height: 390px"> |
| | | <el-button plain size="mini" style="margin-bottom: 5px" type="danger" |
| | | @click="deleteIndexLeftTreeClickHandler">删除索引 |
| | | </el-button> |
| | | <avue-tree |
| | | :data="indexLeftData" |
| | | :option="indexLeftOption" |
| | | @node-click="indexLeftNodeClick"></avue-tree> |
| | | </div> |
| | | </basic-container> |
| | | <div style="padding: 20px;width: 75%"> |
| | | <div> |
| | | <el-form ref="form" :model="indexForm" label-width="90px" size="mini"> |
| | | <el-form-item label="索引名称:"> |
| | | <el-input v-model="indexForm.name" :readOnly="indexFormRead"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="描述:"> |
| | | <el-input v-model="indexForm.desc"></el-input> |
| | | </el-form-item> |
| | | </el-form> |
| | | <div style="display: flex;justify-content: center"> |
| | | <el-button plain size="mini" type="success" @click="rightIndexAddClick">增加</el-button> |
| | | <el-button plain size="mini" type="danger">删除</el-button> |
| | | </div> |
| | | </div> |
| | | <avue-crud |
| | | :data="indexData" |
| | | :option="indexOption"></avue-crud> |
| | | </div> |
| | | </div> |
| | | <el-dialog |
| | | v-dialogDrag |
| | | :visible.sync="indexAttrVisible" |
| | | append-to-body="true" |
| | | class="avue-dialog" |
| | | title="属性信息" |
| | | width="60%" |
| | | > |
| | | <avue-crud |
| | | :data="indexAttrData" |
| | | :option="indexAttrOption" |
| | | @row-click="indexAttrRowClick"></avue-crud> |
| | | <span slot="footer" class="dialog-footer"> |
| | | <el-button type="primary" @click="indexAttrClickAddHandler">确 定</el-button> |
| | | <el-button @click="indexAttrVisible = false">取 消</el-button> |
| | | </span> |
| | | </el-dialog> |
| | | <span slot="footer" class="dialog-footer"> |
| | | <el-button type="primary" @click="indexClickAddHandler">保 存</el-button> |
| | | <el-button @click="indexDialogClose">取 消</el-button> |
| | | </span> |
| | | </el-dialog> |
| | | |
| | | </el-container> |
| | | </template> |
| | | |
| | | <script> |
| | | import basicOption from '@/util/basic-option' |
| | | import {getBizTypes} from "@/api/modeling/businessType/api" |
| | | import { |
| | | getBizTypes, |
| | | addLifeCycle, |
| | | updateLifeCycle, |
| | | deleteBtmType, |
| | | createView, |
| | | expData, |
| | | getUsedBtmLinkList, |
| | | checkBtmConsistency, |
| | | executeRepair, |
| | | getIndexByCondition, |
| | | delIndex, |
| | | getAllAttributesByBtmId, |
| | | addIndex |
| | | } from "@/api/modeling/businessType/api" |
| | | import {gridAttribute} from "@/api/modeling/attributePool/api"; |
| | | import func from "@/util/func"; |
| | | import {getVersionRuleAllList} from "@/api/modeling/version/api"; |
| | | import {getUsedVersionRuleList, getVersionRuleAllList} from "@/api/modeling/version/api"; |
| | | import {gridLifeCycle} from "@/api/modeling/lifeCycle/api"; |
| | | |
| | | export default { |
| | | name: "index", |
| | | data() { |
| | | return { |
| | | dialogLifeDefalutData:[], // 查询重置默认数据 |
| | | lifeType:'', |
| | | dialogLifeTable:[], |
| | | dialogLifeSaveRow:{}, |
| | | dialogLifeKey:Math.random(), |
| | | dialogLifeData:[], |
| | | dialogLifeOption:{ |
| | | indexLoading: false, |
| | | indexFormRead: false, |
| | | indexAttrRow: {}, |
| | | indexAttrOption: { |
| | | ...basicOption, |
| | | addBtn:false, |
| | | selection:false, |
| | | refreshBtn:false, |
| | | menu:false, |
| | | height:450, |
| | | searchMenuSpan: 8, |
| | | highlightCurrentRow:true, |
| | | column:[ |
| | | height: 380, |
| | | highlightCurrentRow: true, |
| | | addBtn: false, |
| | | refreshBtn: false, |
| | | editBtn: false, |
| | | delBtn: false, |
| | | selection: false, |
| | | menu: false, |
| | | column: [ |
| | | { |
| | | label:'生命周期模板名', |
| | | prop:'id', |
| | | searchLabelWidth:120, |
| | | search:true |
| | | label: '属性信息', |
| | | prop: 'id', |
| | | sortable: true, |
| | | }, |
| | | ] |
| | | }, |
| | | indexAttrData: [], |
| | | indexData: [], |
| | | indexAttrVisible: false, |
| | | indexLeftNodeRow: {}, |
| | | indexForm: { |
| | | name: '', |
| | | desc: '' |
| | | }, |
| | | indexLeftData: [], |
| | | indexLeftOption: { |
| | | height: 'auto', |
| | | menu: false, |
| | | addBtn: false, |
| | | props: { |
| | | label: 'name', |
| | | value: 'id', |
| | | children: 'children', |
| | | }, |
| | | }, |
| | | indexOption: { |
| | | ...basicOption, |
| | | height: 280, |
| | | addBtn: false, |
| | | refreshBtn: false, |
| | | editBtn: false, |
| | | delBtn: false, |
| | | selection: false, |
| | | menu: false, |
| | | column: [ |
| | | { |
| | | label: '业务类型名称', |
| | | prop: 'typeName', |
| | | sortable: true, |
| | | }, |
| | | { |
| | | label: '索引名称', |
| | | prop: 'indexName', |
| | | sortable: true, |
| | | }, |
| | | { |
| | | label: '属性名称', |
| | | prop: 'attrNames', |
| | | sortable: true, |
| | | }, |
| | | { |
| | | label: '描述', |
| | | prop: 'desc', |
| | | sortable: true, |
| | | }, |
| | | ] |
| | | }, |
| | | indexVisible: false, |
| | | conDefaultCheckData: [], // 保留上个接口返回的数据 |
| | | conCheckLoading: false, |
| | | conCheckOption: { |
| | | ...basicOption, |
| | | menu: false, |
| | | addBtn: false, |
| | | index: false, |
| | | selection: false, |
| | | refreshBtn: false, |
| | | column: [ |
| | | { |
| | | label: '类型名', |
| | | prop: 'id', |
| | | }, |
| | | { |
| | | label: '操作', |
| | | prop: 'methods', |
| | | }, |
| | | { |
| | | label: '状态', |
| | | prop: 'status', |
| | | } |
| | | ] |
| | | }, |
| | | dialogLifeLoading:false, |
| | | dialogLfeVisible:false, |
| | | dialogVersionDefalutData:[], // 查询重置默认数据 |
| | | dialogSwitchValue:false, |
| | | dialogVersionSaveRow:{}, |
| | | dialogVersionVisible:false, |
| | | dialogVersionKey:Math.random(), |
| | | dialogVersionData:[], |
| | | dialogVersionOption:{ |
| | | conCheckData: [], |
| | | conCheckVisible: false, |
| | | checkViewVisible: false, |
| | | checkViewData: [], |
| | | checkViewDataSearch: [], |
| | | checkViewLoading: false, |
| | | checkViewOption: { |
| | | ...basicOption, |
| | | addBtn:false, |
| | | selection:false, |
| | | refreshBtn:false, |
| | | menu:false, |
| | | height:450, |
| | | addBtn: false, |
| | | menu: false, |
| | | searchMenuSpan: 8, |
| | | highlightCurrentRow:true, |
| | | refreshBtn: false, |
| | | selection: false, |
| | | header:false, |
| | | column: [ |
| | | { |
| | | label: '名称', |
| | | prop: 'name', |
| | | sortable: true, |
| | | }, |
| | | { |
| | | label: '来源', |
| | | prop: 'source', |
| | | sortable: true, |
| | | search: true |
| | | }, |
| | | { |
| | | label: '说明', |
| | | prop: 'description', |
| | | } |
| | | ] |
| | | }, |
| | | tipList: [ |
| | | "导入业务名称不可为空且链接类型名称只能为英文字母", |
| | | "导入的文件包括属性、业务类型、生命周期等文件", |
| | | "上传的文件为压缩文件,且压缩格式仅能为zip格式" |
| | | ], |
| | | upFileType: ['zip'], |
| | | 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:[ |
| | | column: [ |
| | | { |
| | | label:'版本号规则', |
| | | prop:'id', |
| | | searchLabelWidth:110, |
| | | search:true |
| | | label: '版本号规则', |
| | | prop: 'id', |
| | | searchLabelWidth: 110, |
| | | search: true |
| | | } |
| | | ] |
| | | }, |
| | | dialogVersionLoading:false, |
| | | dialogVersionLoading: false, |
| | | dialogAttrSelectList: [], |
| | | searchAttrParams: {}, |
| | | dialogAttrLoading: false, |
| | |
| | | highlightCurrentRow: true, |
| | | height: 450, |
| | | searchMenuSpan: 8, |
| | | header: false, |
| | | column: [ |
| | | { |
| | | label: '属性名', |
| | |
| | | label: '属性类型', |
| | | prop: 'attributeDataType', |
| | | sortable: true, |
| | | width:150, |
| | | }, |
| | | { |
| | | label: '初始值', |
| | |
| | | }, |
| | | dialogAttrSaveData: [], |
| | | attrPollDialogVisible: false, |
| | | rules: [], |
| | | rules: { |
| | | id: [ |
| | | {required: true, message: '请输类型名称', trigger: 'blur'}, |
| | | {validator: this.validateEnglishOnly, trigger: 'blur'} |
| | | ], |
| | | revLevel: [ |
| | | {required: true, message: '请选择版本规则', trigger: 'blur'}, |
| | | ], |
| | | lifeCycleId: [ |
| | | {required: true, message: '请选择生命周期', trigger: 'blur'}, |
| | | ] |
| | | }, |
| | | dialogAttrData: [], |
| | | dialogAttrOption: { |
| | | ...basicOption, |
| | |
| | | selection: false, |
| | | height: 210, |
| | | addBtn: false, |
| | | menuWidth:100, |
| | | // index:false, |
| | | column: [ |
| | | { |
| | |
| | | sortable: true, |
| | | }, |
| | | { |
| | | |
| | | prop: 'btmTypeId', |
| | | label: '业务类型', |
| | | sortable: true |
| | | }, |
| | | { |
| | | label: '属性类型', |
| | | prop: 'attributeDataType', |
| | | sortable: true, |
| | | width:150, |
| | | }, |
| | | { |
| | | label: '初始值', |
| | | prop: 'defaultValue', |
| | | sortable: true, |
| | | width:150, |
| | | }, |
| | | { |
| | | label: '说明', |
| | |
| | | sortable: true |
| | | }, |
| | | { |
| | | prop: 'attrDataType', |
| | | prop: 'attributeDataType', |
| | | label: '属性类型', |
| | | sortable: true |
| | | }, |
| | |
| | | ] |
| | | }, |
| | | form: { |
| | | id:'', // 类型名称 |
| | | name:'', // 标签 |
| | | fName:'', // 继承自 |
| | | implClass:'', // 实现类 |
| | | description:'', // 描述 |
| | | revLevel:'', // 版本规则 |
| | | revisionRuleId:'',// 版本号规则 |
| | | inputRevisionFlag:'', // 手工输入 |
| | | versionRule:'', // 版次号规则 |
| | | lifeCycleId:'', // 生命周期 |
| | | subLifeCycleId:'', // 生命周期备选列表 |
| | | id: '', // 类型名称 |
| | | name: '', // 标签 |
| | | fName: '', // 继承自 |
| | | implClass: '', // 实现类 |
| | | description: '', // 描述 |
| | | revLevel: '', // 版本规则 |
| | | revisionRuleId: '',// 版本号规则 |
| | | inputRevisionFlag: false, // 手工输入, |
| | | delimiter: '', // 分隔符 |
| | | versionRule: '0', // 版次号规则 |
| | | lifeCycleId: '', // 生命周期 |
| | | subLifeCycleId: '', // 生命周期备选列表, |
| | | apNameArray: "", // 属性池列表’,‘分隔 |
| | | }, |
| | | nodeRow: {}, |
| | | treeOption: { |
| | | height: 'auto', |
| | | defaultExpandAll: false, |
| | | defaultExpandedKeys: ['topNode'], |
| | | menu: false, |
| | | addBtn: false, |
| | | props: { |
| | | label: 'id', |
| | | label: 'TreeName', |
| | | value: 'id', |
| | | children: 'children' |
| | | children: 'children', |
| | | name: 'name' |
| | | } |
| | | }, |
| | | treeData: [], |
| | | treeData: [ |
| | | { |
| | | TreeName: '业务类型树', |
| | | id: 'topNode', |
| | | children: [] |
| | | } |
| | | ], |
| | | descriptionOption: { |
| | | labelStyle: 'text-align:center;width:100px;', |
| | | contentStyle: 'max-width:200px;text-align:center;word-break;break-all;' |
| | |
| | | name: 'el-icon-tickets', |
| | | desc: 'el-icon-chat-line-square' |
| | | }, |
| | | treeLoading: false |
| | | } |
| | | }, |
| | | created() { |
| | | this.getTreeList(); |
| | | }, |
| | | mounted() { |
| | | }, |
| | | methods: { |
| | | //树表查询 |
| | | getTreeList() { |
| | | this.treeLoading = true; |
| | | getBizTypes().then(res => { |
| | | const data = res.data.data.map(item => { |
| | | return item.attributes; |
| | | this.processChildren(item); // 处理每个节点 |
| | | item.attributes.TreeName = item.attributes.id; |
| | | return item.attributes; // 返回处理后的 attributes |
| | | }); |
| | | this.treeData = data; |
| | | }) |
| | | this.treeData[0].children = data; |
| | | this.inheritTreeData = data; |
| | | this.treeLoading = false; |
| | | }); |
| | | }, |
| | | |
| | | // 处理树形结构 |
| | | processChildren(item) { |
| | | if (item.children && item.children.length > 0) { |
| | | item.attributes.children = item.children.map(child => { |
| | | child.attributes.TreeName = child.attributes.id; |
| | | this.processChildren(child); // 递归处理每个子节点 |
| | | return child.attributes; // 只返回子节点的 attributes |
| | | }); |
| | | } |
| | | }, |
| | | |
| | | // 树点击 |
| | | nodeClick(row) { |
| | | this.attrData = JSON.parse(row.attributes); |
| | | this.attrData = row.attributes ? JSON.parse(row.attributes) : []; |
| | | this.nodeRow = row; |
| | | }, |
| | | |
| | | // 创建按钮 |
| | | addClickHandler() { |
| | | if (func.isEmptyObject(this.nodeRow)) { |
| | | this.$message.error('请选择要添加的节点'); |
| | | return; |
| | | } |
| | | this.title = 'add'; |
| | | this.form.fName = this.nodeRow.id === 'topNode' ? "" : this.nodeRow.id; |
| | | console.log(this.nodeRow); |
| | | 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; |
| | | }, |
| | | |
| | | // 对话框 属性池列表增加按钮 |
| | |
| | | } |
| | | }, |
| | | |
| | | // 属性池删除 |
| | | dialogBottomAttrDel(form, index) { |
| | | this.dialogAttrData.splice(index, 1); |
| | | }, |
| | | |
| | | // 版本规则管理添加 |
| | | versionAddHandler(){ |
| | | 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 |
| | | id: item.id |
| | | } |
| | | }); |
| | | this.dialogVersionData = data; |
| | |
| | | }, |
| | | |
| | | // 版本规则行点击 |
| | | dialogVersionRowClick(row){ |
| | | dialogVersionRowClick(row) { |
| | | this.dialogVersionSaveRow = row; |
| | | }, |
| | | |
| | | // 版本规则搜索 |
| | | versionHandleSearch(params,done){ |
| | | versionHandleSearch(params, done) { |
| | | const {id} = params; |
| | | |
| | | if (!params.id) { |
| | |
| | | }, |
| | | |
| | | // 版本管理置空 |
| | | versionHandleReset(){ |
| | | versionHandleReset() { |
| | | this.dialogVersionData = this.dialogVersionDefalutData; |
| | | }, |
| | | |
| | | // 版本规则保存 |
| | | dialogVersionAddClickHandler(){ |
| | | if(func.isEmptyObject(this.dialogVersionSaveRow)){ |
| | | // 版本号规则保存 |
| | | dialogVersionAddClickHandler() { |
| | | if (func.isEmptyObject(this.dialogVersionSaveRow)) { |
| | | this.$message.error('请至少选择一条数据'); |
| | | return; |
| | | } |
| | | this.form.revRuleName = this.dialogVersionSaveRow.id; |
| | | this.form.revisionRuleId = this.dialogVersionSaveRow.id; |
| | | this.dialogVersionVisible = false; |
| | | }, |
| | | |
| | | // 生命周期新增 |
| | | lifeAddHandler(val){ |
| | | lifeAddHandler(val) { |
| | | this.dialogLfeVisible = true; |
| | | this.dialogLifeKey = Math.random(); // 打开时刷新表格避免表格错行 |
| | | this.dialogLifeLoading = true; |
| | |
| | | gridLifeCycle().then(res => { |
| | | const data = res.data.data.map(item => { |
| | | return { |
| | | id:item.id |
| | | id: item.id |
| | | } |
| | | }); |
| | | this.dialogLifeData = data; |
| | |
| | | }, |
| | | |
| | | // 生命周期行点击 |
| | | dialogLifeRowClick(row){ |
| | | dialogLifeRowClick(row) { |
| | | this.dialogLifeSaveRow = row; |
| | | }, |
| | | |
| | | // 生命周期保存 |
| | | dialogLifeAddClickHandler(){ |
| | | if(func.isEmptyObject(this.dialogLifeSaveRow)){ |
| | | dialogLifeAddClickHandler() { |
| | | if (func.isEmptyObject(this.dialogLifeSaveRow)) { |
| | | this.$message.error('请至少选择一条数据'); |
| | | return; |
| | | } |
| | | if(this.lifeType === 'input'){ |
| | | this.form.lifeCycle = this.dialogLifeSaveRow.id; |
| | | }else { |
| | | if (this.lifeType === 'input') { |
| | | this.form.lifeCycleId = this.dialogLifeSaveRow.id; |
| | | } else { |
| | | const flag = this.dialogLifeTable.some(item => item.id === this.dialogLifeSaveRow.id); |
| | | |
| | | if (flag) { |
| | |
| | | }, |
| | | |
| | | // 生命周期备选列表移除 |
| | | dialogDeleteLifeTable(index){ |
| | | this.dialogLifeTable.splice(index,1) |
| | | dialogDeleteLifeTable(index) { |
| | | this.dialogLifeTable.splice(index, 1) |
| | | }, |
| | | |
| | | // 生命周期搜索 |
| | | lifeHandleSearch(params,done){ |
| | | lifeHandleSearch(params, done) { |
| | | const {id} = params; |
| | | |
| | | if (!params.id) { |
| | |
| | | }, |
| | | |
| | | // 生命周期重置 |
| | | lifeHandleReset(){ |
| | | lifeHandleReset() { |
| | | this.dialogLifeData = this.dialogLifeDefalutData; |
| | | }, |
| | | |
| | | // 新增编辑保存 |
| | | addDialogSavaHandler(){ |
| | | console.log(this.form) |
| | | } |
| | | // 只能输入英文正则校验 |
| | | 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 === "")) { |
| | | this.$message.error('请检查版本号规则不能为空'); |
| | | return; |
| | | } |
| | | this.form.subLifeCycleId = this.dialogLifeTable ? this.dialogLifeTable.map(item => item.id).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; |
| | | if (valid) { |
| | | if (this.form.revLevel === 0) { |
| | | this.form.versionRule = ""; |
| | | } |
| | | saveFunction(this.form).then(res => { |
| | | if (res.data.code === 200) { |
| | | this.$message.success(res.data.obj); |
| | | this.getTreeList(); |
| | | this.resetForm(); |
| | | this.visible = false; |
| | | } |
| | | }) |
| | | } else { |
| | | return false; |
| | | } |
| | | }); |
| | | }, |
| | | |
| | | // 编辑按钮点击事件 |
| | | editClickHandler() { |
| | | /** |
| | | * id 名称 |
| | | * name 标签 |
| | | * implClass 实现类 |
| | | * fName 继承自 |
| | | * description 描述 |
| | | * revLevel 版本规则 |
| | | * revisionRuleId 版本号规则 |
| | | * inputRevisionFlag 手工输入 |
| | | * delimiter 分隔符 |
| | | * versionRule 版次号规则 |
| | | * lifeCycleId 生命周期 |
| | | * lifeCycleIds 生命周期列表 |
| | | * attributes 属性池列表 |
| | | */ |
| | | if (func.isEmptyObject(this.nodeRow)) { |
| | | this.$message.error('请至少选择一条数据'); |
| | | return; |
| | | } |
| | | if (this.nodeRow.id === 'topNode') { |
| | | this.$message.error('请选择子节点进行修改') |
| | | return; |
| | | } |
| | | 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.dialogAttrData = this.nodeRow.attributes ? JSON.parse(this.nodeRow.attributes) : []; |
| | | this.title = 'edit'; |
| | | this.visible = true; |
| | | console.log(this.form); |
| | | }, |
| | | |
| | | // 删除按钮 |
| | | deleteClickHandler() { |
| | | if (func.isEmptyObject(this.nodeRow)) { |
| | | this.$message.error('请至少选择一条数据'); |
| | | return; |
| | | } |
| | | ; |
| | | this.$confirm('您确定要删除所选择的数据吗?', '提示', { |
| | | confirmButtonText: '确定', |
| | | cancelButtonText: '取消', |
| | | type: 'warning' |
| | | }).then(() => { |
| | | const {id, oid, ts} = this.nodeRow; |
| | | const obj = {id, oid, ts}; |
| | | deleteBtmType(obj).then(res => { |
| | | if (res.data.code === 200) { |
| | | this.$message.success(res.data.obj); |
| | | this.getTreeList(); |
| | | } |
| | | }) |
| | | }).catch(() => { |
| | | this.$message({ |
| | | type: 'info', |
| | | message: '已取消删除' |
| | | }); |
| | | }); |
| | | }, |
| | | |
| | | // 创建视图 |
| | | createViewClickHandler() { |
| | | this.createViewLoading = true; |
| | | createView().then(res => { |
| | | if (res.data.code === 200) { |
| | | this.createViewLoading = false; |
| | | this.$message.success(res.data.obj); |
| | | } |
| | | }).catch(err => { |
| | | this.createViewLoading = false; |
| | | }) |
| | | }, |
| | | |
| | | // 导出 |
| | | exportClickHandler() { |
| | | if (func.isEmptyObject(this.nodeRow)) { |
| | | this.$message.error('请至少选择一条数据'); |
| | | return; |
| | | } |
| | | let name = this.nodeRow.id; |
| | | expData({name: name}).then(res => { |
| | | func.downloadFileByBlobHandler(res); |
| | | this.$message.success('导出成功'); |
| | | }).catch(err => { |
| | | this.$message.error(err); |
| | | }); |
| | | }, |
| | | |
| | | // 导入 |
| | | upLoadClickHandler() { |
| | | this.$refs.upload.visible = true; |
| | | }, |
| | | |
| | | // 查看使用范围按钮 |
| | | checkViewClickHandler() { |
| | | if (func.isEmptyObject(this.nodeRow)) { |
| | | this.$message.error('请至少选择一条数据!'); |
| | | return; |
| | | } |
| | | getUsedBtmLinkList({btmName: this.nodeRow.id}).then(res => { |
| | | if (res.data.code === 200) { |
| | | this.checkViewVisible = true; |
| | | const data = res.data.data.map(item => { |
| | | return { |
| | | name: this.nodeRow.id, |
| | | source: item |
| | | } |
| | | }); |
| | | this.checkViewData = data; |
| | | this.checkViewDataSearch = data; |
| | | } |
| | | }) |
| | | }, |
| | | |
| | | // 查看使用范围查询 |
| | | checkHandleSearch(params, done) { |
| | | const {source} = params; |
| | | |
| | | if (!params.source) { |
| | | this.checkViewData = this.checkViewDataSearch; |
| | | return done(); |
| | | } |
| | | ; |
| | | |
| | | this.checkViewData = this.checkViewDataSearch.filter(item => { |
| | | return item.source && item.source.includes(source); |
| | | }); |
| | | |
| | | done(); |
| | | |
| | | }, |
| | | |
| | | // 查看使用范围重置 |
| | | checkHandleReset() { |
| | | this.checkViewData = this.checkViewDataSearch; |
| | | }, |
| | | |
| | | // 一致性检查按钮点击 |
| | | checkClickHandler() { |
| | | this.createViewLoading = true; |
| | | checkBtmConsistency().then(res => { |
| | | this.createViewLoading = false; |
| | | if (res && res.data && res.data.data) { |
| | | this.conCheckVisible = true; |
| | | this.conCheckLoading = true; |
| | | if (res.data.code === 200) { |
| | | const data = res.data.data[0]; |
| | | this.conDefaultCheckData = data; // 保留一份原始数据 |
| | | this.conCheckLoading = false; |
| | | const outputData = []; |
| | | Object.entries(data).forEach(([id, methods]) => { |
| | | let action; |
| | | |
| | | switch (methods) { |
| | | case '_CREATE': |
| | | action = '创建表'; |
| | | break; |
| | | case '_ADD': |
| | | action = '增加列'; |
| | | break; |
| | | case '_DROP': |
| | | action = '移除列'; |
| | | break; |
| | | default: |
| | | action = '未知'; |
| | | } |
| | | outputData.push({ |
| | | id: id, |
| | | methods: action, |
| | | status: '未修复' |
| | | }) |
| | | }) |
| | | this.conCheckData = outputData; |
| | | } |
| | | } else { |
| | | this.$message.success(res.data.msg); |
| | | } |
| | | }) |
| | | }, |
| | | |
| | | // 修复一致性检查 |
| | | repairClickHandler() { |
| | | const params = this.conDefaultCheckData; |
| | | executeRepair(params).then(res => { |
| | | if (res.data.obj) { |
| | | this.$message.success('修复成功'); |
| | | this.conCheckData = []; |
| | | } else { |
| | | this.$message.error('修复失败,请重新尝试!'); |
| | | } |
| | | this.conCheckVisible = false; |
| | | }) |
| | | }, |
| | | |
| | | // 创建索引按钮点击 |
| | | indexClickHandler() { |
| | | if (func.isEmptyObject(this.nodeRow)) { |
| | | this.$message.error('请至少选择一条数据'); |
| | | return; |
| | | } |
| | | this.getLeftIndex(); |
| | | this.indexVisible = true; |
| | | }, |
| | | |
| | | // 左侧树更新 |
| | | getLeftIndex() { |
| | | const params = { |
| | | "conditionMap[typename]": this.nodeRow.id |
| | | } |
| | | getIndexByCondition(params).then(res => { |
| | | if (res.data.code === 200) { |
| | | const data = res.data.data.map(item => { |
| | | return { |
| | | indexName: item.indexName, |
| | | name: `${item.indexName} ${item.attrNames}`, |
| | | id: item.oid |
| | | } |
| | | }) |
| | | this.indexLeftData = data; |
| | | } |
| | | }) |
| | | }, |
| | | |
| | | // 索引左侧树点击 |
| | | indexLeftNodeClick(row) { |
| | | this.indexLeftNodeRow = row; |
| | | }, |
| | | |
| | | // 删除左侧树索引 |
| | | deleteIndexLeftTreeClickHandler() { |
| | | if (func.isEmptyObject(this.indexLeftNodeRow)) { |
| | | this.$message.error('请选择一条数据进行删除'); |
| | | return; |
| | | } |
| | | const params = { |
| | | btmName: this.nodeRow.id, |
| | | indexName: this.indexLeftNodeRow.indexName |
| | | }; |
| | | delIndex(params).then(res => { |
| | | if (res.data.code === 200) { |
| | | this.$message.success('删除索引成功'); |
| | | this.getLeftIndex(); |
| | | } |
| | | }) |
| | | }, |
| | | |
| | | //右侧表格添加属性 |
| | | indexAttrClickAddHandler() { |
| | | if (func.isEmptyObject(this.indexAttrRow)) { |
| | | this.$message.error('请至少选择一条数据'); |
| | | return; |
| | | } |
| | | this.indexData.push( |
| | | { |
| | | typeName: this.nodeRow.id, |
| | | attrNames: this.indexAttrRow.id, |
| | | indexName: this.indexForm.name, |
| | | desc: this.indexForm.desc |
| | | } |
| | | ) |
| | | this.indexFormRead = true; |
| | | this.indexAttrVisible = false; |
| | | }, |
| | | |
| | | // 右侧属性表格行点击 |
| | | indexAttrRowClick(row) { |
| | | this.indexAttrRow = row; |
| | | }, |
| | | |
| | | // 右侧表格增加 |
| | | rightIndexAddClick() { |
| | | if (!this.indexForm.name) { |
| | | this.$message.error('请输入索引名称'); |
| | | return; |
| | | } |
| | | |
| | | // 检查是否为英文字符 |
| | | const englishRegex = /^[A-Za-z]+$/; |
| | | if (!englishRegex.test(this.indexForm.name)) { |
| | | this.$message.error('索引名称只能包含英文字符'); |
| | | return; |
| | | } |
| | | this.indexLoading = true; |
| | | getAllAttributesByBtmId({btmId: this.nodeRow.id}).then(res => { |
| | | if (res.data.code === 200) { |
| | | const data = res.data.data.map(item => { |
| | | return { |
| | | id: item.id |
| | | } |
| | | }) |
| | | this.indexAttrData = data; |
| | | } |
| | | this.indexLoading = false; |
| | | this.indexAttrVisible = true; |
| | | }) |
| | | }, |
| | | |
| | | // 创建保存索引 |
| | | indexClickAddHandler() { |
| | | const params = { |
| | | typeName: this.nodeRow.id, |
| | | attrNames: this.indexData.map(item => item.attrNames).join(','), |
| | | indexName: this.indexForm.name, |
| | | } |
| | | addIndex([params]).then(res => { |
| | | console.log(res) |
| | | this.$message.success('创建成功'); |
| | | this.indexDialogClose(); |
| | | }).catch(err => { |
| | | this.indexDialogClose(); |
| | | }) |
| | | }, |
| | | |
| | | // 索引对话框取消 |
| | | indexDialogClose() { |
| | | this.indexFormRead = false; |
| | | this.indexForm = {}; |
| | | this.indexData = []; |
| | | this.indexVisible = false; |
| | | } |
| | | } |
| | | } |
| | | </script> |
| | | |
| | | <style lang="scss" scoped> |
| | | ::v-deep { |
| | | .avue-dialog .el-dialog__body{ |
| | | .avue-dialog .el-dialog__body { |
| | | padding: 20px 20px 0px 20px; // 上右下左 |
| | | margin-bottom: 10px !important; |
| | | } |
| | |
| | | width: 100%; |
| | | } |
| | | |
| | | .headerCon { |
| | | .el-button { |
| | | width: 82px; |
| | | } |
| | | .el-tag{ |
| | | line-height:22px; |
| | | height: 24px; |
| | | } |
| | | } |
| | | |
| | | .headerCon { |
| | | display: flex; |
| | | flex-wrap: wrap; |
| | | margin-bottom: 5px; |
| | | |
| | | .el-button + .el-button { |
| | | margin-left: 5px; |
| | | } |
| | | |
| | | .el-button { |
| | | margin-top: 5px; |
| | | } |
| | | } |
| | | |
| | | .headerCon > .el-button:nth-child(4) { |
| | | margin-left: 0; |
| | | } |
| | | |
| | | .headerCon > .el-button:nth-child(7) { |
| | | margin-left: 0; |
| | | } |
| | | |
| | | .headerCon > .el-button:nth-child(10) { |
| | | margin-left: 0; |
| | | } |
| | | |
| | | .miniBtn { |
| | | width: 82px; |
| | | text-align: center; |
| | | padding-left: 7px; |
| | | } |
| | | |
| | | .smallBtn { |
| | | width: 82px; |
| | | text-align: center; |
| | | padding-left: 4.5px; |
| | | } |
| | | |
| | | .descBox { |
| | | width: 32%; |
| | | margin-left: 20px; |
| | | margin-right: 20px; |
| | | } |
| | | |
| | | .dialogForm { |