| | |
| | | <el-aside> |
| | | <basic-container> |
| | | <div ref="TreeBox" style="height: calc(100vh - 154px);!important;"> |
| | | <div class="headerCon"> |
| | | <div class="headerCon" style="display: flex;justify-content: center"> |
| | | <avue-radio v-model="radioForm" :dic="radioDic" style="margin: 10px 0 5px"></avue-radio> |
| | | </div> |
| | | <!-- 左侧树 --> |
| | | <div style="height: calc(100vh - 230px);"> |
| | | <avue-tree :data="treeData" :option="treeOption" @node-click="nodeClick"> |
| | | <span slot-scope="{ node, data }" class="el-tree-node__label"> |
| | | <span style="font-size: 15px"> |
| | | <span> |
| | | <i class="el-icon-s-promotion"></i> |
| | | {{ (node || {}).label }} |
| | | </span> |
| | |
| | | |
| | | <el-main> |
| | | <basic-container> |
| | | 模板列表:<avue-select v-model="templateForm" placeholder="请选择模板" type="tree" :dic="templateData" @change="changeTemp"></avue-select> |
| | | 模板列表:<avue-select v-model="templateForm" placeholder="请选择模板" type="tree" :dic="templateData" @change="changeTemp" style="width:300px;"></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"> |
| | | <el-button icon="el-icon-plus" size="small" type="primary" @click="addHandler">创建</el-button> |
| | | <el-button icon="el-icon-edit" plain size="small" type="primary" @click="editHandler">修改</el-button> |
| | | <el-button icon="el-icon-delete" plain size="small" type="danger" @click="delHandler">删除</el-button> |
| | | <el-button v-if="permissionList.addBtn" class="button-custom-icon" size="small" type="primary" @click="addHandler"> |
| | | <icon-show :name="permissionList.addBtn.source"></icon-show> |
| | | 创建 |
| | | </el-button> |
| | | <el-button v-if="permissionList.editBtn" class="button-custom-icon" plain size="small" type="primary" @click="editHandler"> |
| | | <icon-show :name="permissionList.editBtn.source"></icon-show> |
| | | 修改 |
| | | </el-button> |
| | | <el-button v-if="permissionList.delBtn" class="button-custom-icon" plain size="small" type="danger" @click="delHandler"> |
| | | <icon-show :name="permissionList.delBtn.source"></icon-show> |
| | | 删除 |
| | | </el-button> |
| | | </template> |
| | | </avue-crud> |
| | | </basic-container> |
| | |
| | | @select="selectHandler"> |
| | | </avue-crud> |
| | | <span slot="footer" class="dialog-footer"> |
| | | <el-button @click="addDialogClose">取 消</el-button> |
| | | <el-button type="primary" @click="addDialogSavaHandler">确 定</el-button> |
| | | <el-button size="small" type="primary" @click="addDialogSavaHandler">确 定</el-button> |
| | | <el-button size="small" @click="addDialogClose">取 消</el-button> |
| | | </span> |
| | | </el-dialog> |
| | | </el-container> |
| | |
| | | import {gridTemplate,saveTemplate,updateTemplate,deleteTemplate} from "@/api/queryTemplate/queryDefine"; |
| | | import basicOption from "@/util/basic-option"; |
| | | import func from "@/util/func"; |
| | | import {mapGetters} from "vuex"; |
| | | |
| | | export default { |
| | | name: "index", |
| | |
| | | dialogSelectionRow:[] |
| | | } |
| | | }, |
| | | computed:{ |
| | | ...mapGetters(["permission"]), |
| | | permissionList() { |
| | | return { |
| | | addBtn: this.vaildData(this.permission[this.$route.query.id].ADD, false), |
| | | delBtn: this.vaildData(this.permission[this.$route.query.id].DELETE, false), |
| | | editBtn: this.vaildData(this.permission[this.$route.query.id].EDIT, false), |
| | | }; |
| | | }, |
| | | }, |
| | | created() { |
| | | this.getTreeList(); |
| | | }, |
| | |
| | | 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) { |