mirror of
https://github.com/iczer/vue-antd-admin
synced 2025-04-06 04:00:06 +08:00
1 line
13 KiB
JavaScript
1 line
13 KiB
JavaScript
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-51d73124"],{"13d5":function(e,t,a){"use strict";var _=a("23e7"),n=a("d58f").left,o=a("a640"),r=a("ae40"),s=o("reduce"),i=r("reduce",{1:0});_({target:"Array",proto:!0,forced:!s||!i},{reduce:function(e){return n(this,e,arguments.length,arguments.length>1?arguments[1]:void 0)}})},4556:function(e,t,a){},"499e":function(e,t,a){"use strict";a.r(t);var _=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("a-card",[a("div",{class:e.advanced?"search":null},[a("a-form",{attrs:{layout:"horizontal"}},[a("div",{class:e.advanced?null:"fold"},[a("a-row",[a("a-col",{attrs:{md:8,sm:24}},[a("a-form-item",{attrs:{label:"规则编号",labelCol:{span:5},wrapperCol:{span:18,offset:1}}},[a("a-input",{attrs:{placeholder:"请输入"}})],1)],1),a("a-col",{attrs:{md:8,sm:24}},[a("a-form-item",{attrs:{label:"使用状态",labelCol:{span:5},wrapperCol:{span:18,offset:1}}},[a("a-select",{attrs:{placeholder:"请选择"}},[a("a-select-option",{attrs:{value:"1"}},[e._v("关闭")]),a("a-select-option",{attrs:{value:"2"}},[e._v("运行中")])],1)],1)],1),a("a-col",{attrs:{md:8,sm:24}},[a("a-form-item",{attrs:{label:"调用次数",labelCol:{span:5},wrapperCol:{span:18,offset:1}}},[a("a-input-number",{staticStyle:{width:"100%"},attrs:{placeholder:"请输入"}})],1)],1)],1),e.advanced?a("a-row",[a("a-col",{attrs:{md:8,sm:24}},[a("a-form-item",{attrs:{label:"更新日期",labelCol:{span:5},wrapperCol:{span:18,offset:1}}},[a("a-date-picker",{staticStyle:{width:"100%"},attrs:{placeholder:"请输入更新日期"}})],1)],1),a("a-col",{attrs:{md:8,sm:24}},[a("a-form-item",{attrs:{label:"使用状态",labelCol:{span:5},wrapperCol:{span:18,offset:1}}},[a("a-select",{attrs:{placeholder:"请选择"}},[a("a-select-option",{attrs:{value:"1"}},[e._v("关闭")]),a("a-select-option",{attrs:{value:"2"}},[e._v("运行中")])],1)],1)],1),a("a-col",{attrs:{md:8,sm:24}},[a("a-form-item",{attrs:{label:"描述",labelCol:{span:5},wrapperCol:{span:18,offset:1}}},[a("a-input",{attrs:{placeholder:"请输入"}})],1)],1)],1):e._e()],1),a("span",{staticStyle:{float:"right","margin-top":"3px"}},[a("a-button",{attrs:{type:"primary"}},[e._v("查询")]),a("a-button",{staticStyle:{"margin-left":"8px"}},[e._v("重置")]),a("a",{staticStyle:{"margin-left":"8px"},on:{click:e.toggleAdvanced}},[e._v(" "+e._s(e.advanced?"收起":"展开")+" "),a("a-icon",{attrs:{type:e.advanced?"up":"down"}})],1)],1)])],1),a("div",[a("a-space",{staticClass:"operator"},[a("a-button",{attrs:{type:"primary"},on:{click:e.addNew}},[e._v("新建")]),a("a-button",[e._v("批量操作")]),a("a-dropdown",[a("a-menu",{attrs:{slot:"overlay"},on:{click:e.handleMenuClick},slot:"overlay"},[a("a-menu-item",{key:"delete"},[e._v("删除")]),a("a-menu-item",{key:"audit"},[e._v("审批")])],1),a("a-button",[e._v(" 更多操作 "),a("a-icon",{attrs:{type:"down"}})],1)],1)],1),a("standard-table",{attrs:{columns:e.columns,dataSource:e.dataSource,selectedRows:e.selectedRows,pagination:Object.assign({},e.pagination,{onChange:e.onPageChange})},on:{"update:selectedRows":function(t){e.selectedRows=t},"update:selected-rows":function(t){e.selectedRows=t},clear:e.onClear,change:e.onChange,selectedRowChange:e.onSelectChange},scopedSlots:e._u([{key:"description",fn:function(t){var _=t.text;return a("div",{},[e._v(" "+e._s(_)+" ")])}},{key:"action",fn:function(t){t.text;var _=t.record;return a("div",{},[a("a",{staticStyle:{"margin-right":"8px"}},[a("a-icon",{attrs:{type:"plus"}}),e._v("新增 ")],1),a("a",{staticStyle:{"margin-right":"8px"}},[a("a-icon",{attrs:{type:"edit"}}),e._v("编辑 ")],1),a("a",{on:{click:function(t){return e.deleteRecord(_.key)}}},[a("a-icon",{attrs:{type:"delete"}}),e._v("删除1 ")],1),a("a",{directives:[{name:"auth",rawName:"v-auth",value:"delete",expression:"`delete`"}],on:{click:function(t){return e.deleteRecord(_.key)}}},[a("a-icon",{attrs:{type:"delete"}}),e._v("删除2 ")],1),a("router-link",{attrs:{to:"/list/query/detail/"+_.key}},[e._v("详情")])],1)}}])},[a("template",{slot:"statusTitle"},[a("a-icon",{attrs:{type:"info-circle"},nativeOn:{click:function(t){return e.onStatusTitleClick(t)}}})],1)],2)],1)])},n=[],o=(a("4de4"),a("c740"),function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"standard-table"},[a("div",{staticClass:"alert"},[e.selectedRows?a("a-alert",{attrs:{type:"info","show-icon":!0}},[a("div",{staticClass:"message",attrs:{slot:"message"},slot:"message"},[e._v(" 已选择 "),a("a",[e._v(e._s(e.selectedRows.length))]),e._v(" 项 "),a("a",{staticClass:"clear",on:{click:e.onClear}},[e._v("清空")]),e._l(e.needTotalList,(function(t,_){return[t.needTotal?a("div",{key:_},[e._v(" "+e._s(t.title)+"总计 "),a("a",[e._v(e._s(t.customRender?t.customRender(t.total):t.total))])]):e._e()]}))],2)]):e._e()],1),a("a-table",{attrs:{bordered:e.bordered,loading:e.loading,columns:e.columns,dataSource:e.dataSource,rowKey:e.rowKey,pagination:e.pagination,expandedRowKeys:e.expandedRowKeys,expandedRowRender:e.expandedRowRender,rowSelection:e.selectedRows?{selectedRowKeys:e.selectedRowKeys,onSelect:e.onSelect,onSelectAll:e.onSelectAll}:void 0},on:{change:e.onChange},scopedSlots:e._u([e._l(Object.keys(e.$scopedSlots).filter((function(e){return"expandedRowRender"!==e})),(function(t){return{key:t,fn:function(a,_,n){return[e._t(t,null,null,{text:a,record:_,index:n})]}}})),{key:e.$scopedSlots.expandedRowRender?"expandedRowRender":"",fn:function(t,a,_,n){return[e._t(e.$scopedSlots.expandedRowRender?"expandedRowRender":"",null,null,{record:t,index:a,indent:_,expanded:n})]}}],null,!0)},[e._l(Object.keys(e.$slots),(function(t){return a("template",{slot:t},[e._t(t)],2)}))],2)],1)}),r=[],s=a("7644"),i=s["a"],c=(a("8298"),a("0c7c")),l=Object(c["a"])(i,o,r,!1,null,"6dc1dbc8",null),d=l.exports,u=a("b775"),p=[{title:"规则编号",dataIndex:"no"},{title:"描述",dataIndex:"description",scopedSlots:{customRender:"description"}},{title:"服务调用次数",dataIndex:"callNo",sorter:!0,needTotal:!0,customRender:function(e){return e+" 次"}},{dataIndex:"status",needTotal:!0,slots:{title:"statusTitle"}},{title:"更新时间",dataIndex:"updatedAt",sorter:!0},{title:"操作",scopedSlots:{customRender:"action"}}],f={name:"QueryList",components:{StandardTable:d},data:function(){return{advanced:!0,columns:p,dataSource:[],selectedRows:[],pagination:{current:1,pageSize:10,total:0}}},authorize:{deleteRecord:"delete"},mounted:function(){this.getData()},methods:{onPageChange:function(e,t){this.pagination.current=e,this.pagination.pageSize=t,this.getData()},getData:function(){var e=this;Object(u["f"])("http://api.iczer.com/list","get",{page:this.pagination.current,pageSize:this.pagination.pageSize}).then((function(t){var a,_,n=null!==(a=null===t||void 0===t||null===(_=t.data)||void 0===_?void 0:_.data)&&void 0!==a?a:{},o=n.list,r=n.page,s=n.pageSize,i=n.total;e.dataSource=o,e.pagination.current=r,e.pagination.pageSize=s,e.pagination.total=i}))},deleteRecord:function(e){this.dataSource=this.dataSource.filter((function(t){return t.key!==e})),this.selectedRows=this.selectedRows.filter((function(t){return t.key!==e}))},toggleAdvanced:function(){this.advanced=!this.advanced},remove:function(){var e=this;this.dataSource=this.dataSource.filter((function(t){return-1===e.selectedRows.findIndex((function(e){return e.key===t.key}))})),this.selectedRows=[]},onClear:function(){this.$message.info("您清空了勾选的所有行")},onStatusTitleClick:function(){this.$message.info("你点击了状态栏表头")},onChange:function(){this.$message.info("表格状态改变了")},onSelectChange:function(){this.$message.info("选中行改变了")},addNew:function(){this.dataSource.unshift({key:this.dataSource.length,no:"NO "+this.dataSource.length,description:"这是一段描述",callNo:Math.floor(1e3*Math.random()),status:Math.floor(10*Math.random())%4,updatedAt:"2018-07-26"})},handleMenuClick:function(e){"delete"===e.key&&this.remove()}}},m=f,h=(a("62ef"),Object(c["a"])(m,_,n,!1,null,"7b662217",null));t["default"]=h.exports},"62ef":function(e,t,a){"use strict";var _=a("fd3d"),n=a.n(_);n.a},7644:function(module,__webpack_exports__,__webpack_require__){"use strict";var core_js_modules_es_array_concat__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("99af"),core_js_modules_es_array_concat__WEBPACK_IMPORTED_MODULE_0___default=__webpack_require__.n(core_js_modules_es_array_concat__WEBPACK_IMPORTED_MODULE_0__),core_js_modules_es_array_filter__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("4de4"),core_js_modules_es_array_filter__WEBPACK_IMPORTED_MODULE_1___default=__webpack_require__.n(core_js_modules_es_array_filter__WEBPACK_IMPORTED_MODULE_1__),core_js_modules_es_array_for_each__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("4160"),core_js_modules_es_array_for_each__WEBPACK_IMPORTED_MODULE_2___default=__webpack_require__.n(core_js_modules_es_array_for_each__WEBPACK_IMPORTED_MODULE_2__),core_js_modules_es_array_map__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__("d81d"),core_js_modules_es_array_map__WEBPACK_IMPORTED_MODULE_3___default=__webpack_require__.n(core_js_modules_es_array_map__WEBPACK_IMPORTED_MODULE_3__),core_js_modules_es_array_reduce__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__("13d5"),core_js_modules_es_array_reduce__WEBPACK_IMPORTED_MODULE_4___default=__webpack_require__.n(core_js_modules_es_array_reduce__WEBPACK_IMPORTED_MODULE_4__),core_js_modules_es_object_values__WEBPACK_IMPORTED_MODULE_5__=__webpack_require__("07ac"),core_js_modules_es_object_values__WEBPACK_IMPORTED_MODULE_5___default=__webpack_require__.n(core_js_modules_es_object_values__WEBPACK_IMPORTED_MODULE_5__),core_js_modules_web_dom_collections_for_each__WEBPACK_IMPORTED_MODULE_6__=__webpack_require__("159b"),core_js_modules_web_dom_collections_for_each__WEBPACK_IMPORTED_MODULE_6___default=__webpack_require__.n(core_js_modules_web_dom_collections_for_each__WEBPACK_IMPORTED_MODULE_6__),_Users_chenghongxing_WebstormProjects_vue_antd_admin_node_modules_babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_7__=__webpack_require__("5530"),_Users_chenghongxing_WebstormProjects_vue_antd_admin_node_modules_babel_runtime_helpers_esm_toConsumableArray__WEBPACK_IMPORTED_MODULE_8__=__webpack_require__("2909");__webpack_exports__["a"]={name:"StandardTable",props:{bordered:Boolean,loading:[Boolean,Object],columns:Array,dataSource:Array,rowKey:{type:[String,Function],default:"key"},pagination:{type:[Object,Boolean],default:!0},selectedRows:Array,expandedRowKeys:Array,expandedRowRender:Function},data:function(){return{needTotalList:[]}},methods:{equals:function(e,t){if(e===t)return!0;var a=this.rowKey;return a&&"string"===typeof a?e[a]===t[a]:!(!a||"function"!==typeof a)&&a(e)===a(t)},contains:function(e,t){if(!e||0===e.length)return!1;for(var a=this.equals,_=0;_<e.length;_++)if(a(e[_],t))return!0;return!1},onSelectAll:function(e,t){var a=this,_=this.getKey,n=this.contains,o=this.dataSource.filter((function(e){return!n(t,e,a.rowKey)})),r=this.selectedRows.filter((function(e){return!n(o,e,a.rowKey)})),s={};r.forEach((function(e){return s[_(e)]=e})),t.forEach((function(e){return s[_(e)]=e}));var i=Object.values(s);this.$emit("update:selectedRows",i),this.$emit("selectedRowChange",i.map((function(e){return _(e)})),i)},getKey:function(e){var t=this.rowKey;if(t&&e)return"string"===typeof t?e[t]:t(e)},onSelect:function(e,t){var a=this.equals,_=this.selectedRows,n=this.getKey,o=t?[].concat(Object(_Users_chenghongxing_WebstormProjects_vue_antd_admin_node_modules_babel_runtime_helpers_esm_toConsumableArray__WEBPACK_IMPORTED_MODULE_8__["a"])(_),[e]):_.filter((function(t){return!a(t,e)}));this.$emit("update:selectedRows",o),this.$emit("selectedRowChange",o.map((function(e){return n(e)})),o)},initTotalList:function(e){return e.filter((function(e){return e.needTotal})).map((function(e){return Object(_Users_chenghongxing_WebstormProjects_vue_antd_admin_node_modules_babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_7__["a"])(Object(_Users_chenghongxing_WebstormProjects_vue_antd_admin_node_modules_babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_7__["a"])({},e),{},{total:0})}))},onClear:function(){this.$emit("update:selectedRows",[]),this.$emit("selectedRowChange",[],[]),this.$emit("clear")},onChange:function(e,t,a,_){var n=_.currentDataSource;this.$emit("change",e,t,a,{currentDataSource:n})}},created:function(){this.needTotalList=this.initTotalList(this.columns)},watch:{selectedRows:function selectedRows(_selectedRows2){this.needTotalList=this.needTotalList.map((function(item){return Object(_Users_chenghongxing_WebstormProjects_vue_antd_admin_node_modules_babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_7__["a"])(Object(_Users_chenghongxing_WebstormProjects_vue_antd_admin_node_modules_babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_7__["a"])({},item),{},{total:_selectedRows2.reduce((function(sum,val){var v;try{v=val[item.dataIndex]?val[item.dataIndex]:eval("val.".concat(item.dataIndex))}catch(_){v=val[item.dataIndex]}return v=isNaN(parseFloat(v))?0:parseFloat(v),sum+v}),0)})}))}},computed:{selectedRowKeys:function(){var e=this;return this.selectedRows.map((function(t){return e.getKey(t)}))}}}},8298:function(e,t,a){"use strict";var _=a("4556"),n=a.n(_);n.a},d58f:function(e,t,a){var _=a("1c0b"),n=a("7b0b"),o=a("44ad"),r=a("50c4"),s=function(e){return function(t,a,s,i){_(a);var c=n(t),l=o(c),d=r(c.length),u=e?d-1:0,p=e?-1:1;if(s<2)while(1){if(u in l){i=l[u],u+=p;break}if(u+=p,e?u<0:d<=u)throw TypeError("Reduce of empty array with no initial value")}for(;e?u>=0:d>u;u+=p)u in l&&(i=a(i,l[u],u,c));return i}};e.exports={left:s(!1),right:s(!0)}},fd3d:function(e,t,a){}}]); |