| | |
| | | <template> |
| | | <div> |
| | | <el-dialog :title="title" |
| | | v-dialogDrag append-to-body="true" |
| | | <el-dialog v-dialogDrag |
| | | :height="options.height|| 'auto'" :title="title" |
| | | :visible.sync="visible" |
| | | top="0" |
| | | class="avue-dialog avue-dialog--top" |
| | | :width="options.width|| '80%'" |
| | | :height="options.height|| 'auto'"> |
| | | <avue-crud :option="option" |
| | | :table-loading="loading" |
| | | :data="data" |
| | | :page.sync="page" |
| | | append-to-body="true" |
| | | class="avue-dialog avue-dialog--top" |
| | | top="0" |
| | | @close="dialogClose"> |
| | | <avue-crud ref="referCrud" |
| | | v-model="value" |
| | | ref="referCrud" |
| | | :data="data" |
| | | :option="option" |
| | | :page.sync="page" |
| | | :table-loading="loading" |
| | | @search-change="searchChange" |
| | | @search-reset="searchReset" |
| | | @selection-change="selectionChange" |
| | |
| | | </avue-crud> |
| | | <div class="avue-dialog__footer"> |
| | | <div class="avue-dialog__footer--left valueInfo">{{ valueInfo }} </div> |
| | | <el-button @click="visible=false">取 消</el-button> |
| | | <el-button @click="setValue" type="primary">确 定</el-button> |
| | | <el-button @click="escHandler">取 消</el-button> |
| | | <el-button type="primary" @click="setValue">确 定</el-button> |
| | | </div> |
| | | </el-dialog> |
| | | |
| | | <avue-input v-model="text" :disabled="disabled" :readonly="true" :placeholder="title" @click="!disabled && (visible=true)"></avue-input> |
| | | <avue-input v-model="text" :disabled="disabled" :placeholder="title" :readonly="true" |
| | | @click="!disabled && (visible=true)"></avue-input> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import { validatenull } from "@/util/validate"; |
| | | import {getList,getLazyList,getTableDefinedUrl} from "@/api/refer/table"; |
| | | |
| | | export default { |
| | | name: "vciWebReferTable", |
| | | props:["referConfig","value","text","title","disabled"], |
| | | props: ["referConfig", "value", "text", "title", "disabled", "referType"], |
| | | data() { |
| | | return { |
| | | visible: false, |
| | |
| | | query: {}, |
| | | loading: false, |
| | | page: { |
| | | layout: this.referType === "master" ? "total,pager,prev, next,jumper" : "total,pager,prev, next,jumper,sizes", |
| | | pageSize: 10, |
| | | currentPage: 1, |
| | | total: this.referConfig.options.data?this.referConfig.options.data.length :0 |
| | |
| | | this.getParams(); |
| | | }, |
| | | mounted() { |
| | | if(this.referConfig.options.page){ |
| | | if (this.referConfig.options.tableConfig && this.referConfig.options.tableConfig.page) { |
| | | this.page.pageSize=this.referConfig.options.tableConfig.page.limit || this.referConfig.options.tableConfig.page.pageSize; |
| | | this.page.currentPage=this.referConfig.options.tableConfig.page.page || this.referConfig.options.tableConfig.page.currentPage; |
| | | }else if(!validatenull(this.referConfig.options.limit)){ |
| | | this.page.pageSize=this.referConfig.options.limit |
| | | }else if(!validatenull(this.referConfig.options.tableConfig.limit)){ |
| | | this.page.pageSize=this.referConfig.options.tableConfig.limit |
| | | this.page.pageSize = this.referConfig.options.limit; |
| | | } else if (this.referConfig.options.tableConfig && !validatenull(this.referConfig.options.tableConfig.limit)) { |
| | | this.page.pageSize = this.referConfig.options.tableConfig.limit; |
| | | } |
| | | this.$nextTick(() => { |
| | | this.$refs.referCrud.doLayout() |
| | |
| | | } |
| | | }, |
| | | methods: { |
| | | escHandler() { |
| | | this.visible = false; |
| | | this.$refs.referDefalutCrud.refreshTable() |
| | | }, |
| | | dialogClose() { |
| | | this.visible = false; |
| | | this.$refs.referDefalutCrud.refreshTable() |
| | | }, |
| | | getParams:function (){ |
| | | var queryParams = {}; |
| | | if(this.options.extraParams){ |
| | |
| | | |
| | | if(this.options.displayTable){ |
| | | //说明是使用平台的表格 |
| | | getTableDefinedUrl({btmType:(this.options.referBo||this.options.referType),code:this.options.displayTable,isMuti:this.isMuti},this.tableDefinedUrl).then(result => { |
| | | getTableDefinedUrl({ |
| | | btmType: (this.options.referBo || this.options.referType), |
| | | code: this.options.displayTable, |
| | | isMuti: this.isMuti |
| | | }, this.tableDefinedUrl).then(result => { |
| | | console.log('result',result) |
| | | if(result.success){ |
| | | var queryScheme = result.querySchema; |
| | |
| | | } |
| | | this.value=value.join(','); |
| | | this.text=text.join(',') |
| | | this.$emit("setValue", {field:this.referConfig.field,showField:this.referConfig.showField,value:this.value,text:this.text,rawData:this.selectionList,fieldMap:mapFields}); |
| | | this.$emit("setValue", { |
| | | field: this.referConfig.field, |
| | | showField: this.referConfig.showField, |
| | | value: this.value, |
| | | text: this.text, |
| | | rawData: this.selectionList, |
| | | fieldMap: mapFields |
| | | }); |
| | | this.visible=false; |
| | | }, |
| | | searchReset() { |