| | |
| | | <!-- 选择枚举时的弹窗 --> |
| | | <el-dialog title="枚举列表" :visible.sync="enumRefer.show" append-to-body @close="closeEnumDialog" width="70%" |
| | | style="height: 115vh;"> |
| | | <avue-crud ref="eunmTable" :option="enumRefer.option" :data="enumRefer.data" class="enumTable" |
| | | <div> |
| | | <el-form :inline="true" :model="form" class="demo-form-inline" size="small"> |
| | | <el-form-item label="枚举代号"> |
| | | <el-input v-model="form.name" placeholder="枚举代号"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="枚举名称"> |
| | | <el-input v-model="form.label" placeholder="枚举名称"></el-input> |
| | | </el-form-item> |
| | | <el-form-item> |
| | | <el-button type="primary" @click="onSubmit">查询</el-button> |
| | | </el-form-item> |
| | | </el-form> |
| | | </div> |
| | | <avue-crud ref="eunmTable" :option="enumRefer.option" @on-load="enumOnLoad" :data="enumRefer.data" class="enumTable" |
| | | @row-click="enumReferClick" :page.sync="enumRefer.enumPage"> |
| | | <template slot="radio" slot-scope="{row}"> |
| | | <el-radio v-model="enumRefer.selectRow" :label="row.$index"> |
| | |
| | | }, |
| | | data() { |
| | | return { |
| | | form:{ |
| | | name:'', |
| | | label:'' |
| | | }, |
| | | showSubmitDialog: false, |
| | | // 默认的页签 |
| | | activeName: 'referTab', |
| | |
| | | border: true, |
| | | reserveSelection: true, |
| | | searchMenuSpan: 32, |
| | | searchShowBtn: false, |
| | | // searchShowBtn: false, |
| | | // search:true, |
| | | highlightCurrentRow: true, |
| | | column: [{ |
| | | label: '', |
| | |
| | | prop: 'name', |
| | | align: 'center', |
| | | searchSpan: 8, |
| | | search: true, |
| | | // search: true, |
| | | }, { |
| | | label: '枚举名称', |
| | | prop: 'label', |
| | | align: 'center', |
| | | searchSpan: 8, |
| | | search: true, |
| | | // search: true, |
| | | }] |
| | | }, |
| | | // 枚举参照表格数据 |
| | |
| | | this.initAttributeReferTypeList(); |
| | | }, |
| | | methods: { |
| | | onSubmit() { |
| | | if (this.form.name || this.form.label) { |
| | | const params = {}; |
| | | if (this.form.name) { |
| | | params.name = this.form.name; |
| | | } |
| | | if (this.form.label) { |
| | | params.label = this.form.label; |
| | | } |
| | | getParentList(this.enumRefer.enumPage.currentPage, this.enumRefer.enumPage.pageSize, params) |
| | | .then((res) => { |
| | | this.enumRefer.enumPage.total = res.data.data.total; |
| | | this.enumRefer.data = res.data.data.records; |
| | | }); |
| | | } |
| | | }, |
| | | enumOnLoad(){ |
| | | getParentList(this.enumRefer.enumPage.currentPage, this.enumRefer.enumPage.pageSize).then(res => { |
| | | this.enumRefer.enumPage.total = res.data.data.total; |
| | | this.enumRefer.data = res.data.data.records; |
| | | }) |
| | | }, |
| | | closeSubmitDialog() { |
| | | this.resetAttributeForm(); |
| | | this.showSubmitDialog = false; |