| | |
| | | <template> |
| | | <el-container> |
| | | <!-- 左侧菜单--> |
| | | <el-aside> |
| | | <el-aside > |
| | | <basic-container style="height: 85vh; max-height: 155vh; overflow-y: scroll;"> |
| | | <div> |
| | | <div> |
| | | <div style="display: flex;justify-content: space-around"> |
| | | <el-button plain size="small" type="primary" @click="TreeAdd">添加</el-button> |
| | |
| | | <!-- 树节点添加对话框--> |
| | | <el-dialog :title="this.TreeFlag ? '添加分类' :'添加主题库'" :visible.sync="TreeAddFormVisible" append-to-body |
| | | style="width: 1700px;margin: auto"> |
| | | <el-form :model="TreeAddform"> |
| | | <el-form-item :label="this.TreeFlag ? '分类编号:' :'主题库编号:'" label-width="150px" style="display: inline-block"> |
| | | <el-form :model="TreeAddform" :rules="rules"> |
| | | <el-form-item :label="this.TreeFlag ? '分类编号:' :'主题库编号:'" label-width="150px" style="display: inline-block" prop="id"> |
| | | <el-input v-model="TreeAddform.id" autocomplete="off" style="width: 170px"></el-input> |
| | | </el-form-item> |
| | | <el-form-item :label="this.TreeFlag ? '分类名称:' :'主题库名称:'" label-width="100px" style="display: inline-block"> |
| | | <el-form-item :label="this.TreeFlag ? '分类名称:' :'主题库名称:'" label-width="110px" style="display: inline-block" prop="name"> |
| | | <el-input v-model="TreeAddform.name" autocomplete="off" style="width: 170px"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="描述:" label-width="150px"> |
| | | <el-input v-model="TreeAddform.description" autocomplete="off" style="width: 585px"></el-input> |
| | | </el-form-item> |
| | | <el-form-item v-show="this.TreeFlag==false" label="存储的业务类型:" label-width="150px"> |
| | | <el-input v-model="TreeAddform.btmtypename" autocomplete="off" style="width: 585px"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="编码规则:" label-width="150px"> |
| | | <el-input v-model="TreeAddform.coderuleoidName" autocomplete="off" style="width: 585px"></el-input> |
| | | <el-input v-model="TreeAddform.codeRuleOidName" autocomplete="off" style="width: 585px" @focus="CodeFoucus"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="业务类型:" label-width="150px" v-if="TreeFlagCode==false"> |
| | | <el-input v-model="TreeAddform.btmTypeName" autocomplete="off" style="width: 585px" @focus="btmFoucus"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="关键属性查询规则:" label-width="150px"> |
| | | <el-input v-model="TreeAddform.codekeyattrrepeatoidName" autocomplete="off" |
| | | <el-input v-model="TreeAddform.codeKeyAttrRepeatOidName" autocomplete="off" @focus="Keyfouce" |
| | | style="width: 585px"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="相似查询规则:" label-width="150px"> |
| | | <el-input v-model="TreeAddform.codeResembleRuleOidName" autocomplete="off" |
| | | <el-input v-model="TreeAddform.codeResembleRuleOidName" autocomplete="off" @focus="simFouce" |
| | | style="width: 585px"></el-input> |
| | | </el-form-item> |
| | | </el-form> |
| | |
| | | </el-dialog> |
| | | <!-- 修改对话框--> |
| | | <el-dialog :visible.sync="TreeEditFormVisible" append-to-body title="修改分类"> |
| | | <classifyTreeform ref="childForm" :loneTreeNewForm="TreeList" :nodeList="nodeList" :flag="'edit'"></classifyTreeform> |
| | | <classifyTreeform ref="childForm" :loneTreeNewForm="TreeList" :nodeList="nodeList" :flag="'edit'" @MasterHandler="MasterHandler" :Editclose=" ()=>{TreeEditFormVisible=false}" :TreeFlag="TreeFlagCode" ::nodeClickList="nodeClickList"></classifyTreeform> |
| | | </el-dialog> |
| | | <avue-tree ref="tree" v-model="CloneTreeAvueform" v-loading="loading" :data="CloneTreedata" :defaultExpandAll="false" |
| | | :option="Treeoption" |
| | | style="height: 80.5vh;padding-top: 5px;padding-bottom: 30px" |
| | | @node-click=" nodeClick" |
| | | @check-change="checkChange" |
| | | @node-click="nodeClick" |
| | | class="classifyTree" |
| | | > |
| | | </avue-tree> |
| | | </div> |
| | | </basic-container> |
| | | </el-aside> |
| | | <el-main> |
| | |
| | | <!-- 右侧表格--> |
| | | <avue-tabs :option="tabOption" @change="handleChange"></avue-tabs> |
| | | <span v-if="type.prop==='tab1'"> |
| | | <classifyTreeform ref="childForm" :loneTreeNewForm="TreeList" :nodeList="nodeList" :flag="'renonly'"></classifyTreeform> |
| | | <classifyTreeform ref="childForm" :loneTreeNewForm="TreeList" :nodeList="nodeList" :flag="'renonly'" ></classifyTreeform> |
| | | </span> |
| | | <span v-else-if="type.prop==='tab2'"> |
| | | <basic-container> |
| | |
| | | <el-button plain size="small" type="primary" @click="Enable">启用</el-button> |
| | | <el-button plain size="small" type="primary" @click="Deactivate">停用</el-button> |
| | | <el-button plain size="small" type="primary" @click="CloneBtn">从其它模板克隆</el-button> |
| | | <!-- <div style="display: inline-block"> |
| | | <el-select v-model="searchTemplate.searchCondition" placeholder="请选择" class="search-condition"> |
| | | <el-option |
| | | v-for="item in searchTemplateOptions" |
| | | :key="item.value" |
| | | :label="item.label" |
| | | :value="item.value"> |
| | | </el-option> |
| | | </el-select> |
| | | <el-input v-model="searchTemplate.findText" placeholder="请输入关键字按回车查询" |
| | | size="small" |
| | | @keyup.enter.native="EnterFind"> |
| | | </el-input> |
| | | </div> --> |
| | | <!-- 查询对话框--> |
| | | <el-dialog :visible.sync="FindFormVisible" append-to-body title="高级查询"> |
| | | <div> |
| | |
| | | <el-aside width="300px"> |
| | | <div style="margin-bottom: 5px"><el-tag>主题库分类</el-tag></div> |
| | | <!-- 克隆模板的树 沿用首页树的loading和option,但是data和v-model绑定的数据创建一个新的变量,另外点击方法也是重新获取来操作克隆模板的数据--> |
| | | <avue-tree ref="tree" v-model="TreeAvueform" v-loading="loading" :data="Treedata" |
| | | <avue-tree v-model="TreeAvueform" v-loading="loading" :data="Treedata" |
| | | :defaultExpandAll="false" |
| | | :option="Treeoption" |
| | | style="height: 50.5vh;margin-right: 10px" |
| | |
| | | </el-dialog> |
| | | </el-dialog> |
| | | </template> |
| | | <template #menu="{ size, row }"> |
| | | <el-button |
| | | v-show="row.lcStatus === 'Released'" |
| | | @click="upAndStopAndStart(row, 'upVersion')" |
| | | :loading="row.upVersionLoad" |
| | | icon="el-icon-upload2" |
| | | type="text" |
| | | :size="size" |
| | | >升版</el-button |
| | | > |
| | | <el-button |
| | | v-show="row.lcStatus === 'Released'" |
| | | @click="upAndStopAndStart(row, 'stopLose')" |
| | | :loading="row.stopLoseLoad" |
| | | icon="el-icon-circle-close" |
| | | type="text" |
| | | :size="size" |
| | | >停用/失效</el-button |
| | | > |
| | | <el-button |
| | | v-show="['Disabled', 'Editing'].includes(row.lcStatus)" |
| | | @click="upAndStopAndStart(row, 'startRelease')" |
| | | :loading="row.startReleaseLoad" |
| | | icon="el-icon-circle-check" |
| | | type="text" |
| | | :size="size" |
| | | >启用/发布</el-button |
| | | > |
| | | </template> |
| | | </avue-crud> |
| | | |
| | | </basic-container> |
| | | <templatePro :ProData="this.ProData" :crudOid="this.crudOid" :crudArray="this.crudArray" :Formlist="this.Formlist" :codeClassifyOid="this.codeClassifyOid"></templatePro> |
| | | </span> |
| | | <!-- 编码规则--> |
| | | <el-dialog :visible.sync="MasterdialogVisible" title="为【编码规则】选取值" append-to-body> |
| | | <template> |
| | | <el-select v-model="SelectValue" placeholder="请选择" style="width: 135px"> |
| | | <el-option |
| | | v-for="item in SelectOption" |
| | | :key="item.value" |
| | | :label="item.label" |
| | | :value="item.value" |
| | | style="width: 150px"> |
| | | </el-option> |
| | | </el-select> |
| | | <el-input style="width: 260px;margin-left: 15px" placeholder="输入值后进行模糊查询" v-model="SelectFInd"></el-input> |
| | | <el-button size="small" type="primary" plain @click="SelectFindeHandler" style="margin-left: 20px">查询</el-button> |
| | | </template> |
| | | <avue-crud :data="masterData" :option="masterOption" @select="masterSelect"></avue-crud> |
| | | <div style="height: 30px"> |
| | | <div style="display: inline-block;float: left;border: 1px solid #eee;padding: 5px;margin-top: 5px;font-size: 14px " >已设置的值为:[{{this.TreeAddform.coderuleoidName ==''?'未设置值':this.TreeAddform.coderuleoidName}}]</div> |
| | | <div style="padding-top: 10px;display: flex; justify-content: flex-end;float: right;overflow: hidden" > |
| | | <el-button type="primary" size="small" @click="MasterHandlerClick">确定</el-button> |
| | | <el-button size="small" @click="MasterdialogVisible=false">取消</el-button> |
| | | </div> |
| | | </div> |
| | | </el-dialog> |
| | | <!-- 关键属性查询规则--> |
| | | <el-dialog :visible.sync="KeydialogVisible" title="为【关键属性查询规则】选取值" append-to-body> |
| | | <template> |
| | | <el-select v-model="SelectValue" placeholder="请选择" style="width: 135px"> |
| | | <el-option |
| | | v-for="item in SelectOption" |
| | | :key="item.value" |
| | | :label="item.label" |
| | | :value="item.value" |
| | | style="width: 150px"> |
| | | </el-option> |
| | | </el-select> |
| | | <el-input style="width: 260px;margin-left: 15px" placeholder="输入值后进行模糊查询" v-model="SelectFInd"></el-input> |
| | | <el-button size="small" type="primary" plain @click="KeySelectFindeHandler" style="margin-left: 20px">查询</el-button> |
| | | </template> |
| | | <avue-crud :data="KeyData" :option="masterOption" @select="KeySelect"></avue-crud> |
| | | <div style="height: 30px"> |
| | | <div style="display: inline-block;float: left;border: 1px solid #eeeeee;padding: 5px;margin-top: 5px;font-size: 14px " >已设置的值为:[{{this.TreeAddform.codeKeyAttrRepeatOidName ==''?'未设置值':this.TreeAddform.codekeyattrrepeatoidName}}]</div> |
| | | <div style="padding-top: 10px;display: flex; justify-content: flex-end;float: right;overflow: hidden" > |
| | | <el-button type="primary" size="small" @click="KeyHandlerClick">确定</el-button> |
| | | <el-button size="small" @click="KeydialogVisible=false">取消</el-button> |
| | | </div> |
| | | </div> |
| | | </el-dialog> |
| | | <!-- 相似项查询规则--> |
| | | <el-dialog :visible.sync="SimidialogVisible" title="为【相似项查询规则】选取值" append-to-body> |
| | | <template> |
| | | <el-select v-model="SelectValue" placeholder="请选择" style="width: 135px"> |
| | | <el-option |
| | | v-for="item in SelectOption" |
| | | :key="item.value" |
| | | :label="item.label" |
| | | :value="item.value" |
| | | style="width: 150px"> |
| | | </el-option> |
| | | </el-select> |
| | | <el-input style="width: 260px;margin-left: 15px" placeholder="输入值后进行模糊查询" v-model="SelectFInd"></el-input> |
| | | <el-button size="small" type="primary" plain @click="SimSelectFindeHandler" style="margin-left: 20px">查询</el-button> |
| | | </template> |
| | | <avue-crud :data="simData" :option="masterOption" @select="simSelect"></avue-crud> |
| | | <div style="height: 30px"> |
| | | <div style="display: inline-block;float: left;border: 1px solid #eee;padding: 5px;margin-top: 5px;font-size: 14px " >已设置的值为:[{{this.TreeAddform.codeResembleRuleOidName ==''?'未设置值':this.TreeAddform.codeResembleRuleOidName}}]</div> |
| | | <div style="padding-top: 10px;display: flex; justify-content: flex-end;float: right;overflow: hidden" > |
| | | <el-button type="primary" size="small" @click="simHandlerClick">确定</el-button> |
| | | <el-button size="small" @click="SimidialogVisible=false">取消</el-button> |
| | | </div> |
| | | </div> |
| | | </el-dialog> |
| | | <!-- 业务类型--> |
| | | <el-dialog :visible.sync="BtmdialogVisible" title="为【业务类型规则】选取值" append-to-body> |
| | | <template> |
| | | <el-select v-model="SelectValue" placeholder="请选择" style="width: 135px !important;"> |
| | | <el-option |
| | | v-for="item in SelectOption" |
| | | :key="item.value" |
| | | :label="item.label" |
| | | :value="item.value" |
| | | style="width: 130px"> |
| | | </el-option> |
| | | </el-select> |
| | | <el-input style="width: 260px;margin-left: 15px" placeholder="输入值后进行模糊查询" v-model="SelectFInd"></el-input> |
| | | <el-button size="small" type="primary" plain @click="BtmSelectFindeHandler" style="margin-left: 20px">查询</el-button> |
| | | </template> |
| | | <avue-crud :data="BtmData" :option="masterOption" @select="btmSelect"></avue-crud> |
| | | <div style="height: 30px"> |
| | | <div style="display: inline-block;float: left;border: 1px solid #eee;padding: 5px;margin-top: 5px;font-size: 14px " >已设置的值为:[{{this.TreeAddform.btmTypeName}}]</div> |
| | | <div style="padding-top: 10px;display: flex; justify-content: flex-end;float: right;overflow: hidden" > |
| | | <el-button type="primary" size="small" @click="btmHandlerClick">确定</el-button> |
| | | <el-button size="small" @click="BtmdialogVisible=false">取消</el-button> |
| | | </div> |
| | | </div> |
| | | </el-dialog> |
| | | </basic-container> |
| | | </el-main> |
| | | </el-container> |
| | | </template> |
| | | <script> |
| | | //这里声明一些菜单组件用法:首先布局分为左侧菜单右侧表格,可能会有右侧Tab栏加表单的情况。所以另外引入了一个右侧表单的组件"classifyTreeform"。 |
| | | //首先父组件调用子组件菜单,通过provide传递参数。有Treeoption左侧树新增表单项 Treedata左侧树节点配置项 crudTreeOption右侧表格配置项 crudTreeData右侧表格显示内容 |
| | | //其中表格的配置项直接父传子传递过来就行,直接:option=传递的参数名,里面数据显示的内容因为是和左侧联动的,所以重新一个Formlist,通过点击树节点下标来动态渲染右侧表格,下面方法都有具体注释 |
| | | //然后再说右侧的表单,专门定义了一个组件,通过父传子再把表单数据TreeList传递过去,传递前在10deCLi1ck方法里面便了处理也是一个联动的效果,表单的配置项在哪个子组件或者父组件写都可以。 |
| | | import { |
| | | getAtrrList, |
| | | TreeSave, |
| | |
| | | addSave, |
| | | deleteData, |
| | | editSave, |
| | | copy |
| | | copy, |
| | | upVersion, |
| | | stopLose, |
| | | startRelease |
| | | } from "@/api/template/templateAttr"; |
| | | |
| | | import {defaultReferDataGrid,referDataGrid} from '@/api/MasterData/master' |
| | | export default { |
| | | name: "classifyTrees.vue", |
| | | //使用inject接收参数 |
| | |
| | | inject: [, "crudTreeData"], |
| | | data() { |
| | | return { |
| | | // //表格option配置项 |
| | | // crudTreeOption: { |
| | | // index: true, |
| | | // border: true, |
| | | // height:180, |
| | | // selection:true, |
| | | // addBtn:this.addFlag, |
| | | // column: [ |
| | | // { |
| | | // label: "模板编号", |
| | | // prop: "id" |
| | | // }, |
| | | // { |
| | | // label:"模板名称", |
| | | // prop:"name" |
| | | // }, |
| | | // { |
| | | // label: "模板描述", |
| | | // prop:"description" |
| | | // }, |
| | | // { |
| | | // label:"版本号", |
| | | // prop:"revisionSeq" |
| | | // }, |
| | | // { |
| | | // label:"状态", |
| | | // prop:"lcStatusText" |
| | | // } |
| | | // ] |
| | | // }, |
| | | // searchTemplateOptions: [ |
| | | // { |
| | | // value: 'id', |
| | | // label: '模板编号' |
| | | // }, { |
| | | // value: 'name', |
| | | // label: '模板名称' |
| | | // } |
| | | // ], |
| | | //树节点显示隐藏 |
| | | TreeFlagCode:false, |
| | | //编码规则 |
| | | MasterdialogVisible:false, |
| | | masterData:[], |
| | | masterSelectList:[], |
| | | masterName:"", |
| | | masterOid:"", |
| | | //关键属性 |
| | | KeydialogVisible:false, |
| | | KeyName:"", |
| | | KeyOid:"", |
| | | KeyData:[], |
| | | KeySelectLIst:[], |
| | | //相似项 |
| | | simName:"", |
| | | simOid:"", |
| | | simData:[], |
| | | SimidialogVisible:false, |
| | | simSelectList:[], |
| | | //业务类型 |
| | | btmName:"", |
| | | btmOid:"", |
| | | BtmData:[], |
| | | BtmdialogVisible:false, |
| | | btmSelectList:[], |
| | | masterOption:{ |
| | | addBtn:false, |
| | | index:true, |
| | | border:true, |
| | | selection:true, |
| | | menu:false, |
| | | height:380, |
| | | column:[ |
| | | { |
| | | label:'英文名称', |
| | | prop:'id' |
| | | }, |
| | | { |
| | | label:'中文名称', |
| | | prop:'name' |
| | | }, |
| | | { |
| | | label:'描述', |
| | | prop:'description' |
| | | } |
| | | ] |
| | | }, |
| | | SelectOption:[ |
| | | { |
| | | value: 'name', |
| | | label: '中文名称' |
| | | }, |
| | | { |
| | | value: 'id', |
| | | label: '英文名称' |
| | | } |
| | | ], |
| | | SelectValue:"", |
| | | SelectFInd:"", |
| | | rules: { |
| | | id: [ |
| | | { required: true, message: '请输入名称', trigger: 'blur' }, |
| | | ], |
| | | name:[ |
| | | { required: true, message: '请输入编号', trigger: 'blur' }, |
| | | ] |
| | | }, |
| | | addFlag:false, |
| | | // 表格当前行id |
| | | crudOid:"", |
| | |
| | | searchCondition: 'id', |
| | | findText: "", |
| | | }, |
| | | |
| | | |
| | | //高级查询对话框 |
| | | FindFormVisible: false, |
| | | //克隆模板对话框 |
| | |
| | | //相似查询规则 |
| | | codeResembleRuleOidName: "", |
| | | //关键属性查询规则 |
| | | codekeyattrrepeatoidName: "", |
| | | codeKeyAttrRepeatOidName: "", |
| | | //编码规则 |
| | | coderuleoidName: "", |
| | | codeRuleOidName: "", |
| | | //存储的业务类型 |
| | | btmtypename: "" |
| | | btmTypeName: "" |
| | | }, |
| | | //avue-tree数据,暂时没有作用,里面功能用element写了,只用avue的一个树组件不用内置表单了。 |
| | | TreeAvueform: {}, |
| | |
| | | column: [ |
| | | { |
| | | label: "模板编号", |
| | | prop: "id" |
| | | prop: "id", |
| | | rules: [{ |
| | | required: true, |
| | | message: "模板编号", |
| | | trigger: "blur" |
| | | }] |
| | | }, |
| | | { |
| | | label: "模板名称", |
| | | prop: "name", |
| | | rules: [{ |
| | | required: true, |
| | | message: "模板名称", |
| | | trigger: "blur" |
| | | }] |
| | | }, |
| | | { |
| | | label: "模板描述", |
| | |
| | | ], |
| | | //传递给子组件动态渲染的数据 |
| | | TreeList: {}, |
| | | codeClassifyOid: "" |
| | | codeClassifyOid: "", |
| | | upAndStopAndStartData: { |
| | | upVersion: { |
| | | tip: "是否进行升版?", |
| | | typeText: "升版", |
| | | funAPi: upVersion, |
| | | load: 'upVersionLoad' |
| | | }, |
| | | stopLose: { |
| | | tip: "模板只有发布状态才能被使用,是否确定停用?", |
| | | typeText: "停用/失效", |
| | | funAPi: stopLose, |
| | | load: 'stopLoseLoad' |
| | | }, |
| | | startRelease: { |
| | | tip: "是否确定启用/发布这个模板,模板只有发布状态才能被使用,是否继续?", |
| | | typeText: "启用/发布", |
| | | funAPi: startRelease, |
| | | load: 'startReleaseLoad' |
| | | } |
| | | } |
| | | } |
| | | }, |
| | | //tab栏默认是表格 |
| | | mounted() { |
| | | this.type = this.tabOption.column[0]; |
| | | this.getAttr(); |
| | | const treeEle = this.$refs.tree.$el |
| | | treeEle.addEventListener('click', (e) => { |
| | | if (e.target.nodeName !== 'SPAN') { |
| | | this.$refs.tree.setCurrentKey(null) |
| | | this.nodeClickList = {} |
| | | this.TreeList=[] |
| | | this.TreeFlagCode=false |
| | | console.log('后TreeList',this.TreeList) |
| | | console.log('后nodeClickList',this.nodeClickList) |
| | | } |
| | | }, true) |
| | | }, |
| | | computed:{ |
| | | crudTreeOption(){ |
| | |
| | | column: [ |
| | | { |
| | | label: "模板编号", |
| | | prop: "id" |
| | | prop: "id", |
| | | rules: [{ |
| | | required: true, |
| | | message: "模板编号", |
| | | trigger: "blur" |
| | | }] |
| | | }, |
| | | { |
| | | label:"模板名称", |
| | | prop:"name" |
| | | label: "模板名称", |
| | | prop: "name", |
| | | rules: [{ |
| | | required: true, |
| | | message: "模板名称", |
| | | trigger: "blur" |
| | | }] |
| | | }, |
| | | { |
| | | label: "模板描述", |
| | |
| | | } |
| | | }, |
| | | methods: { |
| | | //编码规则失焦 |
| | | CodeFoucus(){ |
| | | this.MasterdialogVisible=true; |
| | | this.MasterdefaultRend() |
| | | }, |
| | | //编码多选 |
| | | masterSelect(row){ |
| | | if(row.length>0){ |
| | | this.masterSelectList=row; |
| | | this.masterName=row[0].name; |
| | | this.masterOid=row[0].oid; |
| | | } |
| | | }, |
| | | //编码规则查询 |
| | | SelectFindeHandler(){ |
| | | if(this.SelectValue == 'id'){ |
| | | const masterParameter={ |
| | | 'conditionMap[id]':this.SelectFInd |
| | | } |
| | | this.MasterdefaultRend(masterParameter); |
| | | this.SelectValue="" |
| | | this.SelectFInd="" |
| | | }else if(this.SelectValue == 'name'){ |
| | | const masterParameter={ |
| | | 'conditionMap[name]':this.SelectFInd |
| | | } |
| | | this.MasterdefaultRend(masterParameter) |
| | | this.SelectValue="" |
| | | this.SelectFInd="" |
| | | } |
| | | }, |
| | | //编码规则确定 |
| | | MasterHandlerClick(){ |
| | | if(this.masterSelectList.length>1){ |
| | | this.$message.warning('只能选择一条数据') |
| | | }else if(this.masterSelectList.length<=0){ |
| | | this.$message.warning('请选择一条数据') |
| | | }else { |
| | | this.MasterdialogVisible=false; |
| | | this.masterSelectList=[] |
| | | this.$set(this.TreeAddform,'codeRuleOidName',this.masterName) |
| | | this.$set(this.TreeAddform,'codeRuleOid',this.masterOid) |
| | | this.$emit('MasterHandler',this.loneTreeNewForm) |
| | | console.log(this.loneTreeNewForm) |
| | | } |
| | | }, |
| | | //编码接口 |
| | | MasterdefaultRend(){ |
| | | defaultReferDataGrid({ |
| | | referType:'coderule', |
| | | isMuti:'false', |
| | | 'conditionMap["lcstatus"]':'Released' |
| | | }).then(res=>{ |
| | | this.masterData=res.data.records; |
| | | }) |
| | | }, |
| | | Keyfouce(){ |
| | | this.KeydialogVisible=true; |
| | | this.KeydefaultRend() |
| | | }, |
| | | //关键属性确定 |
| | | KeyHandlerClick(){ |
| | | if(this.KeySelectLIst.length>1){ |
| | | this.$message.warning('只能选择一条数据') |
| | | }else if(this.KeySelectLIst.length<=0){ |
| | | this.$message.warning('请选择一条数据') |
| | | }else { |
| | | this.KeydialogVisible=false; |
| | | this.KeySelectLIst=[] |
| | | this.$set(this.TreeAddform,'codeKeyAttrRepeatOidName',this.KeyName) |
| | | this.$set(this.TreeAddform,'codeKeyAttrRepeatOid',this.KeyOid) |
| | | console.log(this.TreeAddform) |
| | | } |
| | | }, |
| | | //关键属性查询 |
| | | KeySelectFindeHandler(){ |
| | | if(this.SelectValue == 'id'){ |
| | | const masterParameter={ |
| | | 'conditionMap[id]':this.SelectFInd |
| | | } |
| | | this.KeydefaultRend(masterParameter); |
| | | this.SelectValue="" |
| | | this.SelectFInd="" |
| | | }else if(this.SelectValue == 'name'){ |
| | | const masterParameter={ |
| | | 'conditionMap[name]':this.SelectFInd |
| | | } |
| | | this.KeydefaultRend(masterParameter) |
| | | this.SelectValue="" |
| | | this.SelectFInd="" |
| | | } |
| | | }, |
| | | //关键属性接口 |
| | | KeydefaultRend(){ |
| | | defaultReferDataGrid({ |
| | | referType:'codekeyattrrepeat', |
| | | isMuti:'false', |
| | | 'conditionMap["lcstatus"]':'Enabled' |
| | | }).then(res=>{ |
| | | this.KeyData=res.data.records; |
| | | }) |
| | | }, |
| | | // 关键多选 |
| | | KeySelect(row){ |
| | | this.KeySelectLIst=row; |
| | | this.KeyName=row[0].name; |
| | | this.KeyOid=row[0].oid; |
| | | }, |
| | | //关键失焦 |
| | | simFouce(){ |
| | | this.SimidialogVisible=true; |
| | | this.simdefaultRend() |
| | | }, |
| | | //相似项确定 |
| | | simHandlerClick(){ |
| | | if(this.simSelectList.length>1){ |
| | | this.$message.warning('只能选择一条数据') |
| | | }else if(this.simSelectList.length<=0){ |
| | | this.$message.warning('请选择一条数据') |
| | | }else { |
| | | this.SimidialogVisible=false; |
| | | this.simSelectList=[] |
| | | this.$set(this.TreeAddform,'codeResembleRuleOidName',this.simName) |
| | | this.$set(this.TreeAddform,'codeResembleRuleOid',this.simOid) |
| | | this.$emit('MasterHandler',this.loneTreeNewForm) |
| | | } |
| | | }, |
| | | //相似项查询 |
| | | SimSelectFindeHandler(){ |
| | | if(this.SelectValue == 'id'){ |
| | | const masterParameter={ |
| | | 'conditionMap[id]':this.SelectFInd |
| | | } |
| | | this.simdefaultRend(masterParameter); |
| | | this.SelectValue="" |
| | | this.SelectFInd="" |
| | | }else if(this.SelectValue == 'name'){ |
| | | const masterParameter={ |
| | | 'conditionMap[name]':this.SelectFInd |
| | | } |
| | | this.simdefaultRend(masterParameter) |
| | | this.SelectValue="" |
| | | this.SelectFInd="" |
| | | } |
| | | }, |
| | | // 相似项多选 |
| | | simSelect(row){ |
| | | this.simSelectList=row; |
| | | this.simName=row[0].name; |
| | | this.simOid=row[0].oid; |
| | | console.log('oid',this.oid) |
| | | }, |
| | | //相似项项接口 |
| | | simdefaultRend(){ |
| | | defaultReferDataGrid({ |
| | | referType:'coderesemblerule', |
| | | isMuti:'false', |
| | | 'conditionMap["lcstatus"]':'Enabled' |
| | | }).then(res=>{ |
| | | this.simData=res.data.records; |
| | | }) |
| | | }, |
| | | //业务类型失焦 |
| | | btmFoucus(){ |
| | | this.BtmdialogVisible=true; |
| | | this.btmdefaultRend() |
| | | }, |
| | | //业务类型确定 |
| | | btmHandlerClick(){ |
| | | if(this.btmSelectList.length>1){ |
| | | this.$message.warning('只能选择一条数据') |
| | | }else if(this.btmSelectList.length<=0){ |
| | | this.$message.warning('请选择一条数据') |
| | | }else { |
| | | this.BtmdialogVisible=false; |
| | | this.btmSelectList=[] |
| | | this.$set(this.TreeAddform,'btmTypeName',this.btmName) |
| | | this.$set(this.TreeAddform,'btmTypeId',this.btmOid) |
| | | this.$emit('MasterHandler',this.loneTreeNewForm) |
| | | } |
| | | }, |
| | | //业务类型查询 |
| | | BtmSelectFindeHandler(){ |
| | | if(this.SelectValue == 'id'){ |
| | | const masterParameter={ |
| | | 'conditionMap[id]':this.SelectFInd |
| | | } |
| | | this.btmdefaultRend(masterParameter); |
| | | this.SelectValue="" |
| | | this.SelectFInd="" |
| | | }else if(this.SelectValue == 'name'){ |
| | | const masterParameter={ |
| | | 'conditionMap[name]':this.SelectFInd |
| | | } |
| | | this.btmdefaultRend(masterParameter) |
| | | this.SelectValue="" |
| | | this.SelectFInd="" |
| | | } |
| | | }, |
| | | //业务类型多选 |
| | | btmSelect(row){ |
| | | this.btmSelectList=row; |
| | | this.btmName=row[0].name; |
| | | this.btmOid=row[0].oid; |
| | | }, |
| | | //业务类型接口 |
| | | btmdefaultRend(masterParameter){ |
| | | referDataGrid({valueField:'id',isMuti:'false',...masterParameter}).then(res=>{ |
| | | // console.log(res) |
| | | this.BtmData=res.data.data.records |
| | | }) |
| | | }, |
| | | //子传父 |
| | | MasterHandler(val){ |
| | | this.TreeList=val |
| | | }, |
| | | //行单选事件 |
| | | selectHandle(selection,row){ |
| | | this.crudOid=row.oid; |
| | |
| | | }, |
| | | //树节点添加事件 |
| | | TreeAddHandler() { |
| | | const data = this.TreeAddform |
| | | this.$set(data, "parentCodeClassifyOid", this.nodeClickList.oid) |
| | | TreeSave(data).then(() => { |
| | | this.$message({ |
| | | type: 'success', |
| | | message: '添加成功!' |
| | | const data = this.TreeAddform; |
| | | // data.btmtypename= this.TreeList.btmtypename |
| | | this.$set(data, "parentCodeClassifyOid", this.nodeClickList.oid); |
| | | console.log("data", data); |
| | | TreeSave(data) |
| | | .then(() => { |
| | | this.$message({ |
| | | type: "success", |
| | | message: "添加成功!", |
| | | }); |
| | | Object.keys(this.TreeAddform).forEach(key => { |
| | | this.TreeAddform[key] = ""; |
| | | }); |
| | | this.getAttr(); |
| | | this.TreeAddFormVisible = false; |
| | | }) |
| | | .catch((res) => { |
| | | this.$message({ |
| | | type: "warning", |
| | | message: res, |
| | | }); |
| | | }); |
| | | this.getAttr(); |
| | | this.TreeAddFormVisible = false |
| | | this.TreeAddform = "" |
| | | }).catch(res => { |
| | | this.$message({ |
| | | type: 'warning', |
| | | message: res |
| | | }); |
| | | }) |
| | | }, |
| | | //树节点删除按钮 |
| | | TreeDel() { |
| | |
| | | }, |
| | | //修改回填 |
| | | TreeEdit() { |
| | | if (this.nodeClickList == "") { |
| | | if ( Object.keys(this.nodeClickList).length<1) { |
| | | this.$message({ |
| | | type: 'warning', |
| | | message: '请先从树上选择一条数据!' |
| | | }); |
| | | } else { |
| | | this.TreeEditFormVisible = true; |
| | | console.log(this.TreeList) |
| | | } |
| | | }, |
| | | //树刷新 |
| | |
| | | //树点击事件 |
| | | async nodeClick(data) { |
| | | //定义一个模板属性id,数据是模板管理表格里面的oid |
| | | if(data.parentId == ""){ |
| | | this.TreeFlagCode=true; |
| | | } |
| | | this.nodeClickList = data |
| | | this.ProData=[] |
| | | try { |
| | |
| | | this.$message.error(error) |
| | | } |
| | | }, |
| | | treeClick(e) { |
| | | console.log(e); |
| | | }, |
| | | //克隆模板树的点击切换数据 |
| | | async ClonenodeClick(data){ |
| | | this.ClonenodeClickList=data; |
| | |
| | | handleChange(column) { |
| | | this.type = column; |
| | | }, |
| | | // //高级查询按钮 |
| | | // handleSelectChange(key) { |
| | | // const selectedValue = this.FindSelect[key]; |
| | | // console.log(selectedValue) |
| | | // console.log(this.QueryArray[0]) |
| | | // switch (this.FindSelect[key]) { |
| | | // case '0': |
| | | // this.QueryArray[key] = ''; |
| | | // this.$set(this.QueryArray, key, ''); |
| | | // // 如果选中的是模板编号,相应的输入框双向绑定关系为 QueryArray.id |
| | | // this.$set(this.QueryArray, 'id', this.QueryArray[key]); |
| | | // break; |
| | | // case '1': |
| | | // this.QueryArray[key] = ''; |
| | | // this.$set(this.QueryArray, key, ''); |
| | | // // 如果选中的是模板名称,相应的输入框双向绑定关系为 QueryArray.name |
| | | // this.$set(this.QueryArray, 'name', this.QueryArray[key]); |
| | | // break; |
| | | // case '2': |
| | | // this.QueryArray[key] = ''; |
| | | // this.$set(this.QueryArray, key, ''); |
| | | // // 如果选中的是模板描述,相应的输入框双向绑定关系为 QueryArray.description |
| | | // this.$set(this.QueryArray, 'description', this.QueryArray[key]); |
| | | // break; |
| | | // case '3': |
| | | // this.QueryArray[key] = ''; |
| | | // this.$set(this.QueryArray, key, ''); |
| | | // // 如果选中的是版本号,相应的输入框双向绑定关系为 QueryArray.revisionValue |
| | | // this.$set(this.QueryArray, 'revisionValue', this.QueryArray[key]); |
| | | // break; |
| | | // case '4': |
| | | // this.QueryArray[key] = ''; |
| | | // this.$set(this.QueryArray, key, ''); |
| | | // // 如果选中的是状态,相应的输入框双向绑定关系为 QueryArray.lcStatus |
| | | // this.$set(this.QueryArray, 'lcStatus', this.QueryArray[key]); |
| | | // break; |
| | | // } |
| | | // }, |
| | | AdvQueries() { |
| | | this.FindFormVisible = false |
| | | //如果全部为空 allEmpty为true |
| | |
| | | }); |
| | | } else { |
| | | this.CloneinnerVisible=true; |
| | | |
| | | } |
| | | }, |
| | | //点击从其它模板克隆 |
| | |
| | | this.FormLoing = false |
| | | }, 600); |
| | | }, |
| | | upAndStopAndStart(row, type) { |
| | | this.$confirm(this.upAndStopAndStartData[type]["tip"], "提示", { |
| | | confirmButtonText: "确定", |
| | | cancelButtonText: "取消", |
| | | type: "warning", |
| | | }).then(() => { |
| | | this.$set(row, this.upAndStopAndStartData[type]["load"], true) |
| | | const { ts, oid } = row; |
| | | this.upAndStopAndStartData[type]['funAPi']({ ts, oid }).then((res) => { |
| | | if (res.data.code === 200) { |
| | | this.$set(row, this.upAndStopAndStartData[type]["load"], false) |
| | | this.TemRefresh(); |
| | | this.$message.success( |
| | | this.upAndStopAndStartData[type]["typeText"] + "成功!" |
| | | ); |
| | | } |
| | | }).catch(() => { |
| | | this.$set(row, this.upAndStopAndStartData[type]["load"], false) |
| | | }); |
| | | }); |
| | | }, |
| | | } |
| | | } |
| | | </script> |