(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-4ee6e8de"],{"0c65":function(e,t,n){},"129f":function(e,t){e.exports=Object.is||function(e,t){return e===t?0!==e||1/e===1/t:e!=e&&t!=t}},"2fb2d":function(e,t,n){},"306a":function(e,t,n){"use strict";var a=n("0c65"),s=n.n(a);s.a},"4fa5":function(e,t,n){"use strict";var a=n("2fb2d"),s=n.n(a);s.a},"841c":function(e,t,n){"use strict";var a=n("d784"),s=n("825a"),i=n("1d80"),o=n("129f"),c=n("14c3");a("search",1,(function(e,t,n){return[function(t){var n=i(this),a=void 0==t?void 0:t[e];return void 0!==a?a.call(t,n):new RegExp(t)[e](String(n))},function(e){var a=n(t,e,this);if(a.done)return a.value;var i=s(e),r=String(this),l=i.lastIndex;o(l,0)||(i.lastIndex=0);var u=c(i,r);return o(i.lastIndex,l)||(i.lastIndex=l),null===u?-1:u.index}]}))},"8cea":function(e,t,n){},"94a1":function(e,t,n){},c7cd:function(e,t,n){"use strict";var a=n("23e7"),s=n("857a"),i=n("af03");a({target:"String",proto:!0,forced:i("fixed")},{fixed:function(){return s(this,"tt","","")}})},cbd8:function(e,t,n){"use strict";var a=n("94a1"),s=n.n(a);s.a},d166:function(e,t,n){"use strict";n.r(t);var a=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"table"},[n("advance-table",{attrs:{columns:e.columns,"data-source":e.dataSource,title:"高级表格-Beta",loading:e.loading,rowKey:"id","format-conditions":!0,pagination:{current:e.page,pageSize:e.pageSize,total:e.total,showSizeChanger:!0,showLessItems:!0,showQuickJumper:!0,showTotal:function(e,t){return"第 "+t[0]+"-"+t[1]+" 条,总计 "+e+" 条"},onChange:e.onPageChange,onShowSizeChange:e.onSizeChange}},on:{search:e.onSearch,refresh:e.onRefresh,reset:e.onReset},scopedSlots:e._u([{key:"send",fn:function(t){var n=t.text;return[e._v(" "+e._s(n?"是":"否")+" ")]}},{key:"status",fn:function(t){var n=t.text;return[e._v(" "+e._s(e._f("statusStr")(n))+" ")]}}])},[n("template",{slot:"statusTitle"},[e._v(" 状态"),n("a-icon",{staticStyle:{margin:"0 4px"},attrs:{type:"info-circle"}})],1)],2),n("api")],1)},s=[],i=n("5530"),o=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{ref:"table",staticClass:"advanced-table",attrs:{id:e.id}},[n("a-spin",{attrs:{spinning:e.loading}},[n("div",{class:["header-bar",e.size]},[n("div",{staticClass:"title"},[e.title?[e._v(e._s(e.title))]:e.$slots.title?e._t("title"):[e._v("高级表格")]],2),n("div",{staticClass:"search"},[n("search-area",{attrs:{"format-conditions":e.formatConditions,columns:e.columns},on:{change:e.onSearchChange}},[e._l(e.slots,(function(t){return n("template",{slot:t},[e._t(t)],2)}))],2)],1),n("div",{staticClass:"actions"},[n("a-tooltip",{attrs:{title:"刷新"}},[n("a-icon",{staticClass:"action",attrs:{type:e.loading?"loading":"reload"},on:{click:e.refresh}})],1),n("action-size",{staticClass:"action",model:{value:e.sSize,callback:function(t){e.sSize=t},expression:"sSize"}}),n("a-tooltip",{attrs:{title:"列配置"}},[n("action-columns",{staticClass:"action",attrs:{columns:e.columns},on:{reset:e.onColumnsReset}},[e._l(e.slots,(function(t){return n("template",{slot:t},[e._t(t)],2)}))],2)],1),n("a-tooltip",{attrs:{title:"全屏"}},[n("a-icon",{staticClass:"action",attrs:{type:e.fullScreen?"fullscreen-exit":"fullscreen"},on:{click:e.toggleScreen}})],1)],1)]),n("a-table",e._b({attrs:{size:e.sSize},on:{expandedRowsChange:e.onExpandedRowsChange,change:e.onChange,expand:e.onExpand},scopedSlots:e._u([e._l(e.scopedSlots,(function(t){return{key:t,fn:function(n,a,s){return[e._t(t,null,null,{text:n,record:a,index:s})]}}})),{key:e.$scopedSlots.expandedRowRender?"expandedRowRender":"",fn:function(t,n,a,s){return[e._t(e.$scopedSlots.expandedRowRender?"expandedRowRender":"",null,null,{record:t,index:n,indent:a,expanded:s})]}}],null,!0)},"a-table",Object.assign({},e.$props,{columns:e.visibleColumns,title:void 0,loading:!1}),!1),[e._l(e.slots,(function(t){return n("template",{slot:t},[e._t(t)],2)}))],2)],1)],1)},c=[],r=(n("99af"),n("4de4"),n("a9e3"),n("b64b"),function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{ref:"root",staticClass:"action-size"},[n("a-tooltip",{attrs:{title:"密度"}},[n("a-dropdown",{attrs:{placement:"bottomCenter",trigger:["click"],"get-popup-container":function(){return e.$refs.root}}},[n("a-icon",{staticClass:"action",attrs:{type:"column-height"}}),n("a-menu",{attrs:{slot:"overlay","selected-keys":[e.value]},on:{click:e.onClick},slot:"overlay"},[n("a-menu-item",{key:"default"},[e._v(" 默认 ")]),n("a-menu-item",{key:"middle"},[e._v(" 中等 ")]),n("a-menu-item",{key:"small"},[e._v(" 紧密 ")])],1)],1)],1)],1)}),l=[],u={name:"ActionSize",props:["value"],inject:["table"],data:function(){return{selectedKeys:["middle"]}},methods:{onClick:function(e){var t=e.key;this.$emit("input",t)}}},d=u,h=(n("dc71"),n("0c7c")),f=Object(h["a"])(d,r,l,!1,null,"14609956",null),p=f.exports,m=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{ref:"root",staticClass:"action-columns"},[n("a-popover",{attrs:{placement:"bottomRight",trigger:"click","get-popup-container":function(){return e.$refs.root}},model:{value:e.visible,callback:function(t){e.visible=t},expression:"visible"}},[n("div",{attrs:{slot:"title"},slot:"title"},[n("a-checkbox",{staticClass:"check-all",attrs:{indeterminate:e.indeterminate,checked:e.checkAll},on:{change:e.onCheckAllChange}}),e._v("列展示 "),n("a-button",{staticStyle:{float:"right"},attrs:{type:"link",size:"small"},on:{click:e.resetColumns}},[e._v("重置")])],1),e._l(e.columns,(function(t,a){return n("a-list",{key:a,staticStyle:{width:"100%"},attrs:{slot:"content",size:"small"},slot:"content"},[n("a-list-item",[n("a-checkbox",{on:{change:function(n){return e.onCheckChange(n,t)}},model:{value:t.visible,callback:function(n){e.$set(t,"visible",n)},expression:"col.visible"}}),t.title?[e._v(" "+e._s(t.title)+": ")]:t.slots&&t.slots.title?e._t(t.slots.title):e._e(),n("template",{slot:"actions"},[n("a-tooltip",{attrs:{title:"固定在列头",mouseEnterDelay:.5,"get-popup-container":function(){return e.$refs.root}}},[n("a-icon",{class:["left",{active:"left"===t.fixed}],attrs:{type:"vertical-align-top"},on:{click:function(n){return e.fixColumn("left",t)}}})],1),n("a-tooltip",{attrs:{title:"固定在列尾",mouseEnterDelay:.5,"get-popup-container":function(){return e.$refs.root}}},[n("a-icon",{class:["right",{active:"right"===t.fixed}],attrs:{type:"vertical-align-bottom"},on:{click:function(n){return e.fixColumn("right",t)}}})],1),n("a-tooltip",{attrs:{title:"添加搜索",mouseEnterDelay:.5,"get-popup-container":function(){return e.$refs.root}}},[n("a-icon",{class:{active:t.searchAble},attrs:{type:"search"},on:{click:function(n){return e.setSearch(t)}}})],1)],1)],2)],1)})),n("a-icon",{staticClass:"action",attrs:{type:"setting"}})],2)],1)},v=[],b=(n("4160"),n("ac1f"),n("841c"),n("c7cd"),n("159b"),n("b85c")),g=n("cd3f"),C=n.n(g),k={name:"ActionColumns",props:["columns","visibleColumns"],data:function(){return{visible:!1,indeterminate:!1,checkAll:!0,checkedCounts:this.columns.length,backColumns:C()(this.columns)}},watch:{checkedCounts:function(e){this.checkAll=e===this.columns.length,this.indeterminate=e>0&&e1&&void 0!==arguments[1]?arguments[1]:e.search.value,n=this.getConditions,a=this.getSearchOptions;e.search.backup=t,this.conditions=n(this.searchCols),this.searchOptions=a(this.searchCols),this.$emit("change",this.conditions,this.searchOptions)},getConditions:function(e){var t=this,n={};return e.filter((function(e){return void 0!==e.search.value&&""!==e.search.value&&null!==e.search.value})).forEach((function(e){var a=e.search,s=a.value,i=a.format;t.formatConditions&&i?"function"===typeof i?n[e.dataIndex]=i(e.search.value):"string"===typeof i&&"Moment"===s.constructor.name?n[e.dataIndex]=s.format(i):n[e.dataIndex]=s:n[e.dataIndex]=s})),n},getSearchOptions:function(e){return e.filter((function(e){return void 0!==e.search.value&&""!==e.search.value&&null!==e.search.value})).map((function(e){var t=e.dataIndex,n=e.search;return{field:t,value:n.value,format:n.format}}))},onVisibleChange:function(e,t){var n=this;if(e.search.visible){var a=document.getElementById("".concat(this.searchIdPrefix).concat(t));a?setTimeout((function(){a.focus()}),0):this.$nextTick((function(){a=document.getElementById("".concat(n.searchIdPrefix).concat(t)),a.focus()}))}else e.search.value=e.search.backup},momentEqual:function(e,t,n){return e===t||!(!e||!t||e.format(n)!==t.format(n))},formatColumns:function(e){var t=this;e.forEach((function(e){t.$set(e,"search",Object(i["a"])(Object(i["a"])({},e.search),{},{visible:!1,value:void 0,format:t.getFormat(e)}))}))}}},R=z,T=(n("cbd8"),Object(h["a"])(R,x,w,!1,null,"7ba4b68e",null)),L=T.exports,I={name:"AdvanceTable",components:{SearchArea:L,ActionColumns:_,ActionSize:p},props:{tableLayout:String,bordered:Boolean,childrenColumnName:{type:String,default:"children"},columns:Array,components:Object,dataSource:Array,defaultExpandAllRows:Array[String],expandedRowKeys:Array[String],expandedRowRender:Function,expandIcon:Function,expandRowByClick:Boolean,expandIconColumnIndex:Number,footer:Function,indentSize:Number,loading:Boolean,locale:Object,pagination:[Object,Boolean],rowClassName:Function,rowKey:[String,Function],rowSelection:Object,scroll:Object,showHeader:{type:Boolean,default:!0},size:String,title:String,customHeaderRow:Function,customRow:Function,getPopupContainer:Function,transformCellText:Function,formatConditions:Boolean},provide:function(){return{table:this}},data:function(){return{id:"".concat((new Date).getTime(),"-").concat(Math.floor(10*Math.random())),sSize:this.size||"default",fullScreen:!1,conditions:{}}},computed:{slots:function(){return Object.keys(this.$slots).filter((function(e){return"title"!==e}))},scopedSlots:function(){return Object.keys(this.$scopedSlots).filter((function(e){return"expandedRowRender"!==e&&"title"!==e}))},visibleColumns:function(){return this.columns.filter((function(e){return e.visible}))}},created:function(){this.addListener()},beforeDestroy:function(){this.removeListener()},methods:{refresh:function(){this.$emit("refresh",this.conditions)},onSearchChange:function(e,t){this.conditions=e,this.$emit("search",e,t)},toggleScreen:function(){this.fullScreen?this.outFullScreen():this.inFullScreen()},inFullScreen:function(){var e=this.$refs.table;return e.classList.add("beauty-scroll"),e.requestFullscreen?(e.requestFullscreen(),!0):e.webkitRequestFullScreen?(e.webkitRequestFullScreen(),!0):e.mozRequestFullScreen?(e.mozRequestFullScreen(),!0):e.msRequestFullscreen?(e.msRequestFullscreen(),!0):(this.$message.warn("对不起,您的浏览器不支持全屏模式"),e.classList.remove("beauty-scroll"),!1)},outFullScreen:function(){document.exitFullscreen?document.exitFullscreen():document.webkitCancelFullScreen?document.webkitCancelFullScreen():document.mozCancelFullScreen?document.mozCancelFullScreen():document.msExitFullscreen&&document.msExitFullscreen(),this.$refs.table.classList.remove("beauty-scroll")},onColumnsReset:function(e){this.$emit("reset",e)},onExpandedRowsChange:function(e){this.$emit("expandedRowsChange",e)},onChange:function(e,t,n,a){this.$emit("change",e,t,n,a)},onExpand:function(e,t){this.$emit("expand",e,t)},addListener:function(){document.addEventListener("fullscreenchange",this.fullScreenListener),document.addEventListener("webkitfullscreenchange",this.fullScreenListener),document.addEventListener("mozfullscreenchange",this.fullScreenListener),document.addEventListener("msfullscreenchange",this.fullScreenListener)},removeListener:function(){document.removeEventListener("fullscreenchange",this.fullScreenListener),document.removeEventListener("webkitfullscreenchange",this.fullScreenListener),document.removeEventListener("mozfullscreenchange",this.fullScreenListener),document.removeEventListener("msfullscreenchange",this.fullScreenListener)},fullScreenListener:function(e){e.target.id===this.id&&(this.fullScreen=!this.fullScreen)}}},F=I,j=(n("306a"),Object(h["a"])(F,o,c,!1,null,"010610ee",null)),D=j.exports,P=(n("93d6"),n("96cf"),n("1da1")),M=n("7424"),q=n("b775");function Y(e){return G.apply(this,arguments)}function G(){return G=Object(P["a"])(regeneratorRuntime.mark((function e(t){return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.abrupt("return",Object(q["f"])(M["GOODS"],q["a"].GET,t));case 1:case"end":return e.stop()}}),e)}))),G.apply(this,arguments)}function H(){return B.apply(this,arguments)}function B(){return B=Object(P["a"])(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.abrupt("return",Object(q["f"])(M["GOODS_COLUMNS"],q["a"].GET));case 1:case"end":return e.stop()}}),e)}))),B.apply(this,arguments)}var V={goodsList:Y,goodsColumns:H},N=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"api"},[e._m(0),n("api-table",{attrs:{"api-source":e.apiSource}}),n("api-table",{attrs:{type:"event",title:"事件","api-source":e.events}}),n("api-table",{attrs:{title:"Column","api-source":e.columnApi}}),n("api-table",{attrs:{title:"Search","api-source":e.searchApi}})],1)},K=[function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"introduce"},[n("h2",{staticClass:"title"},[e._v("说明")]),n("p",{staticClass:"content"},[e._v(" AdvanceTable 是基于 Ant Design Vue Table 组件封装,支持其所有 API。"),n("br"),e._v(" 主要添加了"),n("em",[e._v("列设置")]),e._v("及"),n("em",[e._v("搜索控件配置")]),e._v("的功能,可用于一些需要动态配置表格展示、动态配置搜索条件的场景。"),n("br"),e._v(" 使用方式 与 antd table 基本无异。添加了部分API,如下: ")])])}],J=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("a-table",{attrs:{"data-source":e.apiSource,pagination:!1}},[e.title?n("h2",{staticStyle:{margin:"0 16px 0"},attrs:{slot:"title"},slot:"title"},[e._v(e._s(e.title))]):e._e(),n("a-table-column",{attrs:{width:"20%","data-index":"param",title:"参数"},scopedSlots:e._u([{key:"default",fn:function(t){return n("div",{domProps:{innerHTML:e._s(t)}})}}])}),n("a-table-column",{attrs:{width:"50%","data-index":"desc",title:"说明"},scopedSlots:e._u([{key:"default",fn:function(t){return n("div",{domProps:{innerHTML:e._s(t)}})}}])}),e.isApi?n("a-table-column",{attrs:{width:"15%","data-index":"type",title:"类型"},scopedSlots:e._u([{key:"default",fn:function(t){return n("div",{domProps:{innerHTML:e._s(t)}})}}],null,!1,102549752)}):e._e(),e.isApi?n("a-table-column",{attrs:{width:"15%","data-index":"default",title:"默认值"},scopedSlots:e._u([{key:"default",fn:function(t){return n("div",{domProps:{innerHTML:e._s(t)}})}}],null,!1,102549752)}):e._e(),e.isApi?e._e():n("a-table-column",{attrs:{width:"30%","data-index":"callback",title:"回调函数"},scopedSlots:e._u([{key:"default",fn:function(t){return n("div",{domProps:{innerHTML:e._s(t)}})}}],null,!1,102549752)})],1)},Q=[],U=(n("caad"),{name:"ApiTable",props:{title:{type:String,default:"API"},type:{type:String,default:"api",validator:function(e){return["api","event"].includes(e)}},apiSource:Array},computed:{isApi:function(){return"api"===this.type}}}),W=U,X=Object(h["a"])(W,J,Q,!1,null,"029d00aa",null),Z=X.exports,ee={name:"Api",components:{ApiTable:Z},data:function(){return{apiSource:[{key:0,param:'Ant Design Vue Table API',desc:"支持 Ant Design Vue Table 组件 所有 api",type:"--",default:"--"},{key:1,param:"title",desc:"表格标题",type:"string | slot",default:"'高级表格'"},{key:2,param:"formatConditions",desc:"是否格式化搜索条件的值,格式化规则参考 Search 配置。\n
false:取搜索输入控件的原值
true:取搜索输入控件格式化后的值",type:"boolean",default:"false"},{key:3,param:"columns",desc:"表格列配置,参考 Column 配置",type:"array",default:"--"}],events:[{key:0,param:'Ant Design Vue Table Events API',desc:"支持 Ant Design Vue Table 所有事件",callback:"--"},{key:1,param:"search",desc:"搜索条件变化时触发",callback:"Function(conditions, searchOptions: [{field, value, format}])"},{key:2,param:"refresh",desc:"表头刷新图标点击时触发",callback:"Function(conditions, searchOptions: [{field, value, format}])"},{key:3,param:"reset",desc:"列配置重置按钮点击时触发",callback:"Function(conditions, searchOptions: [{field, value, format}])"}],columnApi:[{key:0,param:'Ant Design Vue Table Column API',desc:"支持 Ant Design Vue Table 组件 Column 配置所有 api",type:"--",default:"--"},{key:1,param:"searchAble",desc:"是否启用列搜索",type:"boolean",default:"false"},{key:2,param:"dataType",desc:"数据类型,该配置将决定列搜索输入控件的类型,与列搜索输入控件对应关系如下:
\n string: 输入框组件
\n boolean: 开关组件
\n select: 下拉输入框组件
\n date: 日期选择器
\n time: 时间选择器
\n datetime: 带时间选择器的日期选择器",type:"'string' | 'boolean' | 'select' | 'date' | 'time' | 'datetime'",default:"'string'"},{key:3,param:"search",desc:"列搜索配置,参考 Search 配置",type:"object",default:"--"}],searchApi:[{key:0,param:"format",desc:"列搜索输入控件值的格式化配置。
如果输入控件支持格式化,则可设置该值为字符串,如日期输入组件,可设为为 'YYYY-MM-DD'。\n
不支持格式化的输入控件,可设置为一个接收控件的输入值作为参数的函数,如 (value) => {return `prefix${value}`}。",type:"string | Function(value)",default:"取输入控件默认的格式化配置"},{key:1,param:"selectOptions",desc:'select 数据类型的下拉输入组件的选项配置,可参考 Ant Design Vue Select Option props Api',type:"array",default:"--"}]}}},te=ee,ne=(n("f817"),Object(h["a"])(te,N,K,!1,null,"6bba9377",null)),ae=ne.exports,se={name:"Table",components:{Api:ae,AdvanceTable:D},filters:{statusStr:function(e){switch(e){case 1:return"已下单";case 2:return"已付款";case 3:return"已审核";case 4:return"已发货"}}},data:function(){return{loading:!1,page:1,pageSize:10,total:0,columns:[{title:"商品名称",dataIndex:"name",searchAble:!0},{title:"订单号",dataIndex:"orderId"},{searchAble:!0,dataIndex:"status",dataType:"select",slots:{title:"statusTitle"},scopedSlots:{customRender:"status"},search:{selectOptions:[{title:"已下单",value:1},{title:"已付款",value:2},{title:"已审核",value:3},{title:"已发货",value:4}]}},{title:"发货",searchAble:!0,dataIndex:"send",dataType:"boolean",scopedSlots:{customRender:"send"},search:{switchOptions:{checkedText:"开",uncheckedText:"关"}}},{title:"审核时间",dataIndex:"auditTime",dataType:"time"}],dataSource:[],conditions:{}}},created:function(){this.getGoodList(),this.getColumns()},methods:{getGoodList:function(){var e=this;this.loading=!0;var t=this.page,n=this.pageSize,a=this.conditions;V.goodsList(Object(i["a"])({page:t,pageSize:n},a)).then((function(t){var n=t.data.data,a=n.list,s=n.page,i=n.pageSize,o=n.total;e.dataSource=a,e.page=s,e.total=o,e.pageSize=i,e.loading=!1}))},getColumns:function(){var e=this;V.goodsColumns().then((function(t){e.columns=t.data}))},onSearch:function(e,t){this.page=1,this.conditions=e,this.getGoodList()},onSizeChange:function(e,t){this.page=1,this.pageSize=t,this.getGoodList()},onRefresh:function(e){this.conditions=e,this.getGoodList()},onReset:function(e){this.conditions=e,this.getGoodList()},onPageChange:function(e,t){this.page=e,this.pageSize=t,this.getGoodList()}}},ie=se,oe=(n("f94f"),Object(h["a"])(ie,a,s,!1,null,"5c6a0979",null)),ce=oe.exports;t["default"]=ce},d9c4:function(e,t,n){},dc71:function(e,t,n){"use strict";var a=n("d9c4"),s=n.n(a);s.a},f4f1:function(e,t,n){},f817:function(e,t,n){"use strict";var a=n("8cea"),s=n.n(a);s.a},f94f:function(e,t,n){"use strict";var a=n("f4f1"),s=n.n(a);s.a}}]);