| | |
| | | top="0" |
| | | class="avue-dialog avue-dialog--top" |
| | | :width="options.width|| '80%'" |
| | | :height="options.height|| 'auto'"> |
| | | :height="options.height|| 'auto'" |
| | | @close="dialogClose" > |
| | | <avue-crud :option="option" |
| | | :table-loading="loading" |
| | | :data="data" |
| | |
| | | </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="escHandler">取 消</el-button> |
| | | <el-button @click="setValue" type="primary">确 定</el-button> |
| | | </div> |
| | | </el-dialog> |
| | | |
| | | <avue-input v-model="text" :disabled="disabled" :placeholder="title" @click="!disabled && (visible=true)"></avue-input> |
| | | <!--<avue-input-table ref="referTable" :props="props" :column="column" :on-load="onLoad" v-model="value" :placeholder="title" ></avue-input-table> |
| | | --> |
| | | <avue-input v-model="text" :disabled="disabled" :readonly="true" :placeholder="title" @click="!disabled && (visible=true)" ></avue-input> |
| | | </div> |
| | | </template> |
| | | |
| | |
| | | import {getList,getLazyList,getTableDefinedUrl} from "@/api/refer/table"; |
| | | export default { |
| | | name: "vciWebReferDefalut", |
| | | 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 |
| | |
| | | selectionList: [], |
| | | option: { |
| | | addBtn: false, |
| | | columnBtn:false, |
| | | //height: this.referConfig.options.height ? this.referConfig.options.height : 475, |
| | | calcHeight: 30, |
| | | tip: false, |
| | |
| | | this.getParams(); |
| | | }, |
| | | mounted() { |
| | | if(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 |
| | | 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 (this.referConfig.options.tableConfig && !validatenull(this.referConfig.options.tableConfig.limit)) { |
| | | this.page.pageSize = this.referConfig.options.tableConfig.limit; |
| | | } |
| | | }, |
| | | computed:{ |
| | |
| | | } |
| | | }, |
| | | 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) { |
| | |
| | | queryParams['referBo'] = this.options['referBo'] || this.options['referType']; |
| | | } |
| | | queryParams['referType'] = queryParams['referBo'] |
| | | if (this.options.remoteSort && this.options.initSort) { |
| | | if (this.options.initSort) { |
| | | queryParams['order'] = this.options.initSort.type;//方法 |
| | | queryParams['sort'] = this.options.initSort.field;//字段 |
| | | } |
| | |
| | | } |
| | | }) |
| | | |
| | | let mapFields =Object.assign(this.referConfig.fieldMap,JSON.parse(this.options.mapFields)) ; |
| | | let mapFields =this.referConfig.fieldMap || {}; |
| | | try { |
| | | if(!validatenull(this.options.mapFields)){ |
| | | mapFields =Object.assign(this.referConfig.fieldMap,JSON.parse(this.options.mapFields)) ; |
| | | } |
| | | }catch (e) { |
| | | |
| | | } |
| | | 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}); |