import{FieldFieldFilter,FieldWidthManager}from"@ModStartAsset/svue/lib/fields-config";import{FieldFields}from"@ModStartAsset/svue/lib/fields";import FieldEnableSelector from"@ModStartAsset/svue/components/FieldEnableSelector";import FieldFilterSelector from"@ModStartAsset/svue/components/FieldFilterSelector";import{ViewUtil}from"@ModStartAsset/svue/lib/view";import $ from"jquery";const ListerMixin={tableMinHeight:200,tableHeightGap:110,components:{...FieldFields,FieldEnableSelector:FieldEnableSelector,FieldFilterSelector:FieldFilterSelector},filters:{FieldFieldFilter:FieldFieldFilter},data(){return{listLoading:!1,order:{field:null,type:"asc"},list:{page:1,pageSize:10,records:[],total:0},fieldEnables:[],selectIds:[],filter:[],search:{},tableHeight:200}},mounted(){ViewUtil.setHeightResponsively(this,"tableHeight",this.$options.tableMinHeight,()=>$(window).height()-$("#TopBox").height()-$("#BottomBox").height()-this.$options.tableHeightGap)},methods:{onSortChange(e,t,i){null===i?(this.order.field=null,this.order.type=null):(this.order.field=e.prop,this.order.type="ascending"===i?"asc":"desc"),this.doList(1)},tableFieldWidth(e,t,i){return FieldWidthManager.buildCalculator(this.$options.name)(e,t,i)},onTableHeaderDragEnd(e,t,i,l){FieldWidthManager.buildModifier(this.$options.name)(i.property,e)},doFilterSubmit(e){this.filter=e,this.$refs.fieldFilterSelector.view(e),this.doList(1)},doList(e){console.error("should implements doList")},onTableSelectChange(e){this.selectIds=e.map(e=>e.id)}}};export{ListerMixin};