| | |
| | | <el-container> |
| | | <!-- 左侧菜单--> |
| | | <el-aside > |
| | | <basic-container style="height: 85vh; max-height: 155vh; overflow-y: scroll;"@click.native="handleClickOutside" > |
| | | <div @click.native="handleClickOutside"> |
| | | <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-form-item label="编码规则:" label-width="150px"> |
| | | <el-input v-model="TreeAddform.codeRuleOidName" autocomplete="off" style="width: 585px" @focus="CodeFoucus"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="业务类型:" label-width="150px" v-if="TreeFlag==false"> |
| | | <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-dialog> |
| | | <!-- 修改对话框--> |
| | | <el-dialog :visible.sync="TreeEditFormVisible" append-to-body title="修改分类"> |
| | | <classifyTreeform ref="childForm" :loneTreeNewForm="TreeList" :nodeList="nodeList" :flag="'edit'" @MasterHandler="MasterHandler" :Editclose=" ()=>{TreeEditFormVisible=false}" :TreeFlag="TreeFlag" ::nodeClickList="nodeClickList"></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" |
| | | class="classifyTree" |
| | | > |
| | | </avue-tree> |
| | | </div> |
| | |
| | | data() { |
| | | return { |
| | | //树节点显示隐藏 |
| | | TreeFlag:false, |
| | | TreeFlagCode:false, |
| | | //编码规则 |
| | | MasterdialogVisible:false, |
| | | masterData:[], |
| | |
| | | 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(){ |
| | |
| | | } |
| | | }, |
| | | methods: { |
| | | //树节点失去焦点 |
| | | handleClickOutside(event) { |
| | | const treeElement = this.$refs.tree.$el; |
| | | const targetElement = event.target; |
| | | if (!treeElement.contains(targetElement)) { |
| | | // 在树组件外部点击,清空选择状态 |
| | | // this.nodeClickList=[]; |
| | | // this.CloneTreeAvueform={} |
| | | console.log(this.nodeClickList ) |
| | | console.log(this.CloneTreeAvueform) |
| | | } |
| | | }, |
| | | //编码规则失焦 |
| | | CodeFoucus(){ |
| | | this.MasterdialogVisible=true; |
| | |
| | | }, |
| | | //修改回填 |
| | | TreeEdit() { |
| | | if (this.nodeClickList == "") { |
| | | if ( Object.keys(this.nodeClickList).length<1) { |
| | | this.$message({ |
| | | type: 'warning', |
| | | message: '请先从树上选择一条数据!' |
| | |
| | | //树点击事件 |
| | | async nodeClick(data) { |
| | | //定义一个模板属性id,数据是模板管理表格里面的oid |
| | | console.log('树',data) |
| | | if(data.parentId == ""){ |
| | | this.TreeFlag=true; |
| | | this.TreeFlagCode=true; |
| | | } |
| | | this.nodeClickList = data |
| | | this.ProData=[] |
| | |
| | | this.$message.error(error) |
| | | } |
| | | }, |
| | | treeClick(e) { |
| | | console.log(e); |
| | | }, |
| | | //克隆模板树的点击切换数据 |
| | | async ClonenodeClick(data){ |
| | | this.ClonenodeClickList=data; |