(window.webpackJsonp=window.webpackJsonp||[]).push([["chunk-f43a"],{ON0l:function(e,t,n){"use strict";n.r(t);var i=n("QbLZ"),a=n.n(i),o=n("jtZb"),l=n("a/5N"),r={fieldList:null,request:null,params:null,placeholder:"",isPaging:!0,showHeader:!0,tableFormatter:null,rowKey:""},s={name:"CrmRelativeTable",components:{},props:{props:Object},data:function(){return{search:"",copySearch:"",tableHeight:document.documentElement.clientHeight-320,loading:!1,list:[],fieldList:[],currentPage:1,pageSize:15,total:0,selectionList:[]}},computed:{config:function(){return Object(o.a)(a()({},r),this.props||{})},reduceHeaderHeight:function(){return this.config.showHeader?0:32}},watch:{},created:function(){this.config.fieldList&&(this.fieldList=this.config.fieldList),this.getList()},mounted:function(){var e=this;this.updateTableHeight(),window.onresize=function(){e.updateTableHeight()}},beforeDestroy:function(){},methods:{searchInput:function(){this.copySearch=this.search,this.handleCurrentChange(1)},handleCurrentChange:function(e){this.currentPage=e,this.getList()},getList:function(){var e=this;this.config.request(this.config.params||{}).then(function(t){var n=t.data;Object(l.a)(n)?(e.total=n.length,e.list=n):(e.list=n.list,e.total=n.totalRow)}).catch(function(){})},updateTableHeight:function(){this.tableHeight=document.documentElement.clientHeight-320},getMainTable:function(){var e=null;return this.$children.forEach(function(t){t.$options&&"ElTable"===t.$options.name&&(e=t)}),e},handleSelectionChange:function(e){if(this.config.radio&&e.length>1){this.getMainTable().clearSelection();var t=e[e.length-1];this.getMainTable().toggleRowSelection(t),this.selectionList=[t]}else this.selectionList=e;this.$emit("selection-change",e)}}},c=(n("PEw9"),n("KHd+")),h=Object(c.a)(s,function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"crm-relative-table"},[e.config.showHeader?n("flexbox",{staticClass:"header",attrs:{justify:"center"}},[n("el-input",{attrs:{placeholder:e.config.placeholder},nativeOn:{keyup:function(t){return"button"in t||!e._k(t.keyCode,"enter",13,t.key,"Enter")?e.searchInput(t):null}},model:{value:e.search,callback:function(t){e.search=t},expression:"search"}},[n("el-button",{attrs:{slot:"append",type:"primary"},nativeOn:{click:function(t){return e.searchInput(t)}},slot:"append"},[e._v("搜索")])],1)],1):e._e(),e._v(" "),n("div",{staticClass:"body"},[n("el-table",{directives:[{name:"loading",rawName:"v-loading",value:e.loading,expression:"loading"}],staticClass:"n-table--border",staticStyle:{width:"100%"},attrs:{id:"crm-table","row-height":40,data:e.list,height:e.tableHeight+e.reduceHeaderHeight,"row-key":e.config.rowKey,"use-virtual":"",stripe:"",border:"","highlight-current-row":""},on:{"selection-change":e.handleSelectionChange}},[n("el-table-column",{attrs:{"show-overflow-tooltip":"","reserve-selection":"",type:"selection",align:"center",width:"55"}}),e._v(" "),e._l(e.fieldList,function(t,i){return n("el-table-column",{key:i,attrs:{fixed:0==i,prop:t.fieldName,label:t.name,formatter:e.config.tableFormatter,"show-overflow-tooltip":""}})})],2),e._v(" "),n("div",{staticClass:"p-contianer"},[n("el-pagination",{staticClass:"p-bar",attrs:{"current-page":e.currentPage,total:e.total,"page-size":e.pageSize,"pager-count":5,background:"",layout:"total, prev, pager, next"},on:{"current-change":e.handleCurrentChange}})],1)],1)],1)},[],!1,null,"d44ede54",null);h.options.__file="CrmRelativeTable.vue";t.default=h.exports},PEw9:function(e,t,n){"use strict";var i=n("eux6");n.n(i).a},eux6:function(e,t,n){}}]);