| | |
| | | <template> |
| | | <div class="app" style="display: flex;"> |
| | | <div class="app" style="position: relative;"> |
| | | <avue-tree ref="tree" v-model="CloneTreeAvueform" v-loading="loading" :data="Treedata" :defaultExpandAll="false" |
| | | :option="Treeoption" style="width: fit-content;" @node-click="nodeClick"> |
| | | <template slot-scope="{ node }"> |
| | | <span v-html="node.label"></span> |
| | | </template> |
| | | </avue-tree> |
| | | <div style="display: inline-block;"><el-link icon="el-icon-refresh" class="refresh-icon" @click="getTreeLists"></el-link></div> |
| | | <div style="position: absolute; right: 0px; top: -1px;"> |
| | | <el-link class="refresh-icon" icon="el-icon-refresh" @click="getTreeLists"></el-link> |
| | | </div> |
| | | </div> |
| | | </template> |
| | | |
| | |
| | | return { |
| | | TreeValue: '', |
| | | idData: '', |
| | | referTreeId:'', |
| | | referTreeId: '', |
| | | masterVrBtnList: [], |
| | | tableHeadFindData: [], |
| | | tableHeadDataFateher: [], |
| | |
| | | CloneTreeAvueform: {}, |
| | | loading: false, |
| | | Treedata: [], |
| | | isLoading: false, |
| | | nodeClickList: "", |
| | | Treeoption: { |
| | | addBtn: false, |
| | |
| | | // console.log(node) |
| | | // console.log(resolve) |
| | | // } |
| | | treeLoad: (node, resolve) =>{ |
| | | treeLoad: (node, resolve) => { |
| | | if (node.data != false) { |
| | | const parentId = (node.level === 0) ? 0 : node.data.oid; |
| | | const parentBtmName = node.data.attributes.btmname; |
| | | getTreeList({parentOid: parentId, parentBtmName: parentBtmName,'conditionMap[btmTypeId]': this.referTreeId }).then(res => { |
| | | getTreeList({ |
| | | parentOid: parentId, |
| | | parentBtmName: parentBtmName, |
| | | 'conditionMap[btmTypeId]': this.referTreeId |
| | | }).then(res => { |
| | | resolve(res.data.map(item => { |
| | | return { |
| | | ...item, |
| | |
| | | |
| | | const [firstProperty] = res.data; |
| | | this.ModifyProperties(this.Treedata, 'text', 'label'); |
| | | this.referTreeId=firstProperty.attributes.btmTypeId; |
| | | this.referTreeId = firstProperty.attributes.btmTypeId; |
| | | // console.log(this.referTreeId) |
| | | this.codeClassifyOid = firstProperty.oid; |
| | | this.coderuleoid = firstProperty.attributes.coderuleoid; |
| | |
| | | }, |
| | | //表格刷新 |
| | | TableRend() { |
| | | this.isLoading = true; |
| | | TableData({ |
| | | templateOid: this.templateOids, |
| | | codeClassifyOid: this.nodeClickList.oid, |
| | | page: this.currentPage, |
| | | limit: this.pageSize, |
| | | }).then(res => { |
| | | this.isLoading = false; |
| | | this.tableDataArray = res.data.data; |
| | | this.$emit('tableDataArray', this.tableDataArray) |
| | | this.$emit('total', res.data.total) |
| | |
| | | this.tableHeadFindData = [] |
| | | await this.TableHeadRend(); // 先执行 TableHeadRend() |
| | | this.TableRend(); // TableHeadRend() 方法完成后再执行 TableRend() |
| | | this.$emit('nodeClick', this.templateOids) |
| | | this.$emit('nodeClickTemplateOids', this.templateOids) |
| | | this.$emit("codeClassifyOid", this.nodeClickList.oid) |
| | | this.$emit("nodeClickList", this.nodeClickList) |
| | | } catch (error) { |
| | | // 处理错误 |
| | | this.$message.error(error) |