| | |
| | | }, |
| | | data(){ |
| | | return{ |
| | | masterVrBtnList:[], |
| | | tableHeadFindData:[], |
| | | tableHeadDataFateher:[], |
| | | templateOids:"", |
| | | tableDataArray:[], |
| | |
| | | } |
| | | }, |
| | | created() { |
| | | this.getTreeList() |
| | | this.getTreeLists() |
| | | |
| | | }, |
| | | computed:{ |
| | | }, |
| | | methods:{ |
| | | //获取数据 |
| | | getTreeList(){ |
| | | getTreeLists(){ |
| | | getTreeList({'conditionMap[id]': 'wupin'}).then(res=>{ |
| | | this.Treedata=res.data |
| | | this.ModifyProperties(this.Treedata, 'text', 'label'); |
| | | this.codeClassifyOid=res.data[0].oid; |
| | | this.coderuleoid=res.data[0].attributes.coderuleoid; |
| | | this.$emit("codeClassifyOid", this.codeClassifyOid ) |
| | | this.$emit("coderuleoid", this.coderuleoid ) |
| | | this.TableHeadRends() |
| | | }).catch(res=>{ |
| | | console.log(res) |
| | | }) |
| | |
| | | page: this.currentPage, |
| | | limit: this.pageSize, |
| | | }).then(res => { |
| | | // this.page.total = res.data.total; |
| | | // this.data = res.data.data; |
| | | this.tableDataArray=res.data.data; |
| | | this.$emit('tableDataArray',this.tableDataArray) |
| | | this.$emit('total',res.data.total) |
| | | console.log('table',this.tableDataArray) |
| | | }) |
| | | }, |
| | | //表格头部 |
| | | TableHeadRend(){ |
| | | MasterTable({ |
| | | codeClassifyOid:this.nodeClickList.oid, |
| | | functionId: 5, |
| | | }).then(res=>{ |
| | | this.tableHeadDataFateher=res.data; |
| | | this.templateOids=res.data.tableDefineVO.oid |
| | | this.$emit("tableHeadDataFateher",this.tableHeadDataFateher) |
| | | console.log("123",res) |
| | | }) |
| | | }, |
| | | TableHeadRends(){ |
| | | MasterTable({ |
| | | codeClassifyOid:this.codeClassifyOid, |
| | | functionId: 5, |
| | | }).then(res=>{ |
| | | this.tableHeadDataFateher=res.data; |
| | | this.templateOids=res.data.tableDefineVO.oid |
| | | this.$emit("tableHeadDataFateher",this.tableHeadDataFateher) |
| | | console.log("123",res) |
| | | TableHeadRend() { |
| | | return new Promise((resolve,reject)=>{ |
| | | MasterTable({ |
| | | codeClassifyOid: this.nodeClickList.oid, |
| | | functionId: 5, |
| | | }).then(res => { |
| | | console.log(res.data.buttons) |
| | | this.masterVrBtnList = res.data.buttons |
| | | this.tableHeadDataFateher = res.data; |
| | | this.templateOids = res.data.tableDefineVO.oid; |
| | | let List = res.data.tableDefineVO.cols[0]; |
| | | List.forEach(item => { |
| | | let columnItem = { |
| | | label: item.title, |
| | | prop: item.field, |
| | | // type: this.columnType[item.type], |
| | | sortable: item.sort, |
| | | width: item.minWidth |
| | | }; |
| | | this.tableHeadFindData.push(columnItem) |
| | | // console.log(' this.tableHeadFindData', this.tableHeadFindData) |
| | | }) |
| | | this.$emit('tableHeadDataFateher', this.tableHeadDataFateher); |
| | | this.$emit('tableHeadFindData', this.tableHeadFindData); |
| | | this.$emit('tableHeadBttoms', this.masterVrBtnList); |
| | | resolve(); |
| | | }).catch(err=>{ |
| | | reject(err) |
| | | }) |
| | | }) |
| | | }, |
| | | //树点击事件 |
| | | nodeClick(data){ |
| | | this.nodeClickList = data; |
| | | this.TableHeadRend() |
| | | this.TableRend() |
| | | console.log('code',this.nodeClickList.oid) |
| | | console.log('teoid',this.templateOids) |
| | | console.log() |
| | | async nodeClick(data) { |
| | | try { |
| | | this.nodeClickList = data; |
| | | this.tableHeadDataFateher=[] |
| | | this.tableHeadFindData=[] |
| | | await this.TableHeadRend(); // 先执行 TableHeadRend() |
| | | this.TableRend(); // TableHeadRend() 方法完成后再执行 TableRend() |
| | | this.$emit('nodeClick',this.templateOids) |
| | | this.$emit("codeClassifyOid", this.nodeClickList.oid ) |
| | | console.log('树',this.nodeClickList.oid) |
| | | } catch (error) { |
| | | // 处理错误 |
| | | this.$message.error(error) |
| | | } |
| | | } |
| | | } |
| | | } |