| | |
| | | <el-aside> |
| | | <basic-container> |
| | | <div ref="TreeBox" style="height: calc(100vh - 144px);!important;"> |
| | | <!-- 左侧æ --> |
| | | <div style="height: calc(100vh - 280px);"> |
| | | <!-- 左侧æ --> |
| | | <div style="height: calc(100vh - 220px);"> |
| | | <div style="margin-bottom: 10px;display: flex;justify-content: center"> |
| | | <el-radio v-model="treeRadio" label="0">ä¸å¡ç±»åæ </el-radio> |
| | | <el-radio v-model="treeRadio" label="1">龿¥ç±»åæ </el-radio> |
| | | <el-radio v-model="treeRadio" label="0" @input="TreeRadioChange">ä¸å¡ç±»åæ </el-radio> |
| | | <el-radio v-model="treeRadio" label="1" @input="TreeRadioChange">龿¥ç±»åæ </el-radio> |
| | | </div> |
| | | <avue-tree :data="treeData" :option="treeOption" @node-click="nodeClick"> |
| | | <avue-tree v-loading="treeLoading" :data="treeData" :option="treeOption" @node-click="nodeClick"> |
| | | <span slot-scope="{ node, data }" class="el-tree-node__label"> |
| | | <span style="font-size: 15px"> |
| | | <i class="el-icon-s-promotion"></i> |
| | |
| | | <el-main> |
| | | <basic-container> |
| | | <avue-crud |
| | | v-if="!tableStatus" |
| | | :data="data" |
| | | :option="option"> |
| | | :option="option" |
| | | :page.sync="page" |
| | | @size-change="sizeChange" |
| | | @current-change="currentChange"> |
| | | <template slot="menuLeft"> |
| | | <div style="display: flex; align-items: center;"> |
| | | <span style="display: inline-block; margin-right: 10px;"> |
| | | <el-radio v-model="tableRadio" label="0">表å</el-radio> |
| | | <el-radio v-model="tableRadio" label="1">è¡¨æ ¼<span style="color: red;">ï¼å
导å
¥è¡¨åï¼å导å
¥è¡¨æ ¼ï¼ï¼</span></el-radio> |
| | | <el-radio v-model="tableRadio" label="0" @input="tableRadioChange">表å</el-radio> |
| | | <el-radio v-model="tableRadio" label="1" @input="tableRadioChange">è¡¨æ ¼<span style="color: red;">ï¼å
导å
¥è¡¨åï¼å导å
¥è¡¨æ ¼ï¼ï¼</span></el-radio> |
| | | </span> |
| | | <span style="display: flex;align-items: center; margin-right: 10px;"> |
| | | <p style="display: flex; flex-shrink: 0;font-size: 14px">åç§°ï¼</p> |
| | |
| | | </el-button> |
| | | </template> |
| | | </avue-crud> |
| | | <div style="display: flex;justify-content: center;margin-top: 15px"> |
| | | <div v-if="!tableStatus" style="display: flex;justify-content: center;margin-top: 15px"> |
| | | <el-button icon="el-icon-plus" plain size="small" type="primary" @click="addClickHandler">å¢å </el-button> |
| | | <el-button icon="el-icon-delete" plain size="small" type="danger">å é¤</el-button> |
| | | <el-button icon="el-icon-document-add" plain size="small" type="primary">å
é</el-button> |
| | |
| | | import basicOption from "@/util/basic-option"; |
| | | import FormDialog from "@/views/modelingMenu/ui/formDefine/components/formDialog"; |
| | | import TableDialog from "@/views/modelingMenu/ui/formDefine/components/tableDialog" |
| | | import {gridPortalVIDatas} from "@/api/UI/formDefine/api" |
| | | import {getBizTypes} from "@/api/modeling/businessType/api"; |
| | | import {gridLink} from "@/api/modeling/linkType/api"; |
| | | import func from "@/util/func"; |
| | | |
| | | export default { |
| | | name: "index", |
| | | components: {FormDialog, TableDialog}, |
| | | data() { |
| | | return { |
| | | page: { |
| | | currentPage: 1, |
| | | pageSize: 10, |
| | | total: 0, |
| | | pageSizes: [10, 30, 50, 100], |
| | | }, |
| | | nodeRow: {}, |
| | | treeLoading: false, |
| | | option: { |
| | | ...basicOption, |
| | | addBtn: false, |
| | | editBtn: false, |
| | | delBtn: false |
| | | delBtn: false, |
| | | column: [ |
| | | { |
| | | label: 'ä¸å¡åç§°', |
| | | prop: 'typeName', |
| | | }, |
| | | { |
| | | label: 'åç§°', |
| | | prop: 'viName', |
| | | sortable: true, |
| | | }, |
| | | { |
| | | label: 'ç±»å', |
| | | prop: 'viTypeText', |
| | | }, |
| | | ] |
| | | }, |
| | | data: [], |
| | | tableRadio: "", |
| | |
| | | } |
| | | } |
| | | }, |
| | | created() { |
| | | this.getTreeList(); |
| | | }, |
| | | computed: { |
| | | tableStatus() { |
| | | return func.isEmptyObject(this.nodeRow) |
| | | } |
| | | }, |
| | | methods: { |
| | | // å³ä¾§æ°å¢ |
| | | addClickHandler() { |
| | | if (!this.tableRadio) { |
| | | this.$message.error('请å¨è¡¨æ ¼ä¸æ¹éæ©æ°å¢ç±»å'); |
| | |
| | | } |
| | | |
| | | this.tableRadio === "0" ? this.$refs.formDialog.visible = true : this.$refs.tableDialog.visible = true; |
| | | } |
| | | }, |
| | | |
| | | // åå§åæ è¯·æ± |
| | | getTreeList() { |
| | | this.treeLoading = true; |
| | | getBizTypes().then(res => { |
| | | const data = res.data.data.map(item => { |
| | | item.label = item.attributes.id; |
| | | return item; |
| | | }); |
| | | this.treeData = data; |
| | | this.treeLoading = false; |
| | | }) |
| | | }, |
| | | |
| | | // 左侧ä¸å¡ç±»å忢 |
| | | TreeRadioChange(val) { |
| | | this.treeLoading = true; |
| | | this.resetTable(); |
| | | if (val === "0") { |
| | | getBizTypes().then(res => { |
| | | const data = res.data.data.map(item => { |
| | | item.label = item.attributes.id; |
| | | return item; |
| | | }); |
| | | this.treeData = data; |
| | | this.treeLoading = false; |
| | | }) |
| | | } else { |
| | | gridLink().then(res => { |
| | | const data = res.data.data.map(item => { |
| | | item.label = item.name; |
| | | return item; |
| | | }); |
| | | this.treeData = data; |
| | | this.treeLoading = false; |
| | | }) |
| | | } |
| | | }, |
| | | |
| | | // 左侧æ ç¹å» |
| | | nodeClick(row) { |
| | | console.log(row); |
| | | this.tableRadio = null; |
| | | this.nodeRow = row; |
| | | this.getRightPortalVIDatas(row); |
| | | }, |
| | | |
| | | // éç½®è¡¨æ ¼å±ç¤ºä¿¡æ¯ å è¡¨æ ¼è¡¨åé项 |
| | | resetTable() { |
| | | this.data = []; |
| | | this.tableRadio = null; |
| | | }, |
| | | |
| | | // å³ä¾§ è¡¨æ ¼ 表å ä¿¡æ¯æ¥è¯¢ |
| | | getRightPortalVIDatas() { |
| | | const params = { |
| | | 'conditionMap[typeName]': this.treeRadio === '0' ? this.nodeRow.attributes.id : this.nodeRow.name, |
| | | 'conditionMap[viType]': this.tableRadio === '0' ? 'Form' : this.tableRadio === '1' ? 'Table' : '', |
| | | 'conditionMap[viTypeFlag]': this.treeRadio === '0' ? 'BtmType' : this.treeRadio === '1' ? 'LinkType' : '', |
| | | } |
| | | gridPortalVIDatas(this.page.currentPage, this.page.pageSize, params).then(res => { |
| | | console.log(res); |
| | | if (res.data.code === 200) { |
| | | const data = res.data.data; |
| | | this.data = data; |
| | | this.page.total = res.data.total; |
| | | } |
| | | }) |
| | | }, |
| | | |
| | | sizeChange(val) { |
| | | this.page.pageSize = val; |
| | | this.getRightPortalVIDatas(); |
| | | }, |
| | | |
| | | // 页ç |
| | | currentChange(val) { |
| | | this.page.currentPage = val; |
| | | this.getRightPortalVIDatas(); |
| | | }, |
| | | |
| | | // è¡¨æ ¼ 表å忢 |
| | | tableRadioChange() { |
| | | this.getRightPortalVIDatas(); |
| | | }, |
| | | |
| | | } |
| | | } |
| | | </script> |