| | |
| | | <el-main> |
| | | <basic-container> |
| | | 模板列表:<avue-select v-model="templateForm" placeholder="请选择模板" type="tree" :dic="templateData" @change="changeTemp"></avue-select> |
| | | <h3>查询属性</h3> |
| | | <avue-crud ref="queryCrud" |
| | | :data="attrData" :option="attrOption" :table-loading="tableLoading" style="margin-top: 10px"> |
| | | <template slot="menuLeft" slot-scope="scope"> |
| | |
| | | menu:false, |
| | | height: "auto", |
| | | calcHeight: -40, |
| | | title:'查询属性', |
| | | tip:false, |
| | | column: [{ |
| | | label: '字段编码', |
| | |
| | | if (newval ==0) { |
| | | getBizTypes().then(res => { |
| | | const data = res.data.data.map(item => { |
| | | item.label=item.attributes.id; |
| | | return item; |
| | | this.processChildren(item); // 处理每个节点 |
| | | item.attributes.label = item.attributes.id; |
| | | return item.attributes; |
| | | }); |
| | | this.treeData = data; |
| | | loading.close(); |
| | |
| | | const loading = this.$loading({}); |
| | | getBizTypes().then(res => { |
| | | const data = res.data.data.map(item => { |
| | | item.label=item.attributes.id; |
| | | return item; |
| | | this.processChildren(item); // 处理每个节点 |
| | | item.attributes.label = item.attributes.id; |
| | | return item.attributes; |
| | | }); |
| | | this.treeData = data; |
| | | loading.close(); |
| | | }).catch(error=>{ |
| | | loading.close(); |
| | | }) |
| | | }, |
| | | |
| | | // 处理业务类型树形结构 |
| | | processChildren(item) { |
| | | if (item.children && item.children.length > 0) { |
| | | item.attributes.children = item.children.map(child => { |
| | | child.attributes.label = child.attributes.id; |
| | | this.processChildren(child); // 递归处理每个子节点 |
| | | return child.attributes; // 只返回子节点的 attributes |
| | | }); |
| | | } |
| | | }, |
| | | // 树点击 |
| | | nodeClick(row) { |
| | | this.nodeRow = row; |
| | |
| | | this.tableLoading = false; |
| | | }) |
| | | }, |
| | | selectHandler(selection, row){debugger; |
| | | selectHandler(selection, row){ |
| | | this.dialogSelectionRow=selection |
| | | }, |
| | | changeTemp(data) { |
| | |
| | | cancelButtonText: '取消', |
| | | type: 'warning' |
| | | }).then(() => { |
| | | deleteTemplate({name:this.templateForm,btmName: this.nodeRow.label, linkFlag: this.radioForm == 1}).then(res => { |
| | | deleteTemplate({name:this.templateForm}).then(res => { |
| | | if (res.data.code === 200) { |
| | | this.$message.success(res.data.obj); |
| | | this.getTemp(); |