1 |
- (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-561f3279","chunk-f6657b32","chunk-2d216aec","chunk-2d216ba7","chunk-2d0a4474"],{"0680":function(t,e,n){"use strict";n.r(e),n.d(e,"getDict",(function(){return i}));var r=n("1da1"),a=(n("96cf"),n("4360")),i=function(){var t=Object(r["a"])(regeneratorRuntime.mark((function t(e){return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,a["store"].dispatch("dictionary/getDictionary",e);case 2:return t.abrupt("return",a["store"].getters["dictionary/getDictionary"][e]);case 3:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()},"4c5e":function(t,e,n){"use strict";n.r(e);var r=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",[n("div",{staticClass:"button-box clearflex"},[n("el-button",{attrs:{type:"primary"},on:{click:function(e){t.dialogFormVisible=!0}}},[t._v("新增分类")])],1),n("div",{staticClass:"search-term"},[n("el-form",{staticClass:"demo-form-inline",attrs:{inline:!0,model:t.searchInfo}})],1),n("el-table",{attrs:{data:t.tableData,border:"",stripe:""}},[n("el-table-column",{attrs:{label:"序号","min-width":"60",prop:"id"}}),n("el-table-column",{attrs:{label:"标题",prop:"name"},scopedSlots:t._u([{key:"default",fn:function(e){var r=e.row;return[r.edit?n("el-input",{staticClass:"edit-input",attrs:{size:"small"},model:{value:r.name,callback:function(e){t.$set(r,"name",e)},expression:"row.name"}}):n("span",[t._v(t._s(r.name))])]}}])}),n("el-table-column",{attrs:{label:"排序",prop:"orderId"},scopedSlots:t._u([{key:"default",fn:function(e){var r=e.row;return[r.edit?n("el-input",{staticClass:"edit-input",attrs:{size:"small"},model:{value:r.orderId,callback:function(e){t.$set(r,"orderId",e)},expression:"row.orderId"}}):n("span",[t._v(t._s(r.orderId))])]}}])}),n("el-table-column",{attrs:{label:"图片",prop:"icon"},scopedSlots:t._u([{key:"default",fn:function(e){var r=e.row;return[r.edit?n("el-input",{staticClass:"edit-input",attrs:{size:"small"},model:{value:r.icon,callback:function(e){t.$set(r,"icon",e)},expression:"row.icon"}}):n("span",[t._v(t._s(r.icon))])]}}])}),n("el-table-column",{attrs:{label:"是否开放",prop:"icon"},scopedSlots:t._u([{key:"default",fn:function(e){var r=e.row;return[r.edit?n("el-select",{staticClass:"edit-input",attrs:{size:"small"},model:{value:r.isOpen,callback:function(e){t.$set(r,"isOpen",e)},expression:"row.isOpen"}},[n("el-option",{attrs:{label:"是",value:1}}),n("el-option",{attrs:{label:"否",value:0}})],1):n("span",[t._v(t._s(r.isOpen?"是":"否"))])]}}])}),n("el-table-column",{attrs:{label:"宽度",prop:"span"},scopedSlots:t._u([{key:"default",fn:function(e){var r=e.row;return[r.edit?n("el-input",{staticClass:"edit-input",attrs:{size:"small"},model:{value:r.span,callback:function(e){t.$set(r,"span",e)},expression:"row.span"}}):n("span",[t._v(t._s(r.span))])]}}])}),n("el-table-column",{attrs:{label:"描述",prop:"content"},scopedSlots:t._u([{key:"default",fn:function(e){var r=e.row;return[r.edit?n("el-input",{attrs:{type:"textarea",size:"small"},model:{value:r.content,callback:function(e){t.$set(r,"content",e)},expression:"row.content"}}):n("span",[t._v(t._s(r.content))])]}}])}),n("el-table-column",{attrs:{align:"center","min-width":"80px",label:"操作","class-name":"small-padding fixed-width"},scopedSlots:t._u([{key:"default",fn:function(e){var r=e.row,a=e.$index;return[r.edit?n("el-button",{attrs:{type:"success",size:"small",icon:"el-icon-circle-check"},on:{click:function(e){return t.confirmEdit(r,a)}}},[t._v("提交")]):t._e(),r.edit?n("el-button",{staticClass:"cancel-btn",attrs:{size:"small",icon:"el-icon-refresh",type:"warning"},on:{click:function(e){return t.cancelEdit(r,a)}}},[t._v("取消")]):t._e(),r.edit?t._e():n("el-button",{attrs:{type:"primary",size:"small",icon:"el-icon-edit"},on:{click:function(e){return t.initEdit(r,a)}}},[t._v("编辑")]),r.edit?t._e():n("el-button",{attrs:{type:"danger",size:"small",icon:"el-icon-delete"},on:{click:function(e){return t.deleteType(r,a)}}},[t._v("删除")])]}}])})],1),n("el-pagination",{style:{float:"right",padding:"20px"},attrs:{"current-page":t.page,"page-size":t.size,"page-sizes":[10,30,50,100],total:t.total,layout:"total, sizes, prev, pager, next, jumper"},on:{"current-change":t.handleCurrentChange,"size-change":t.handleSizeChange}}),n("el-dialog",{attrs:{title:"新增分类",center:"",visible:t.dialogFormVisible},on:{"update:visible":function(e){t.dialogFormVisible=e}}},[n("el-form",{ref:"elAdd",attrs:{model:t.form,rules:t.rules,"label-width":"120px"}},[n("el-form-item",{attrs:{label:"标题",prop:"name"}},[n("el-input",{attrs:{type:"text"},model:{value:t.form.name,callback:function(e){t.$set(t.form,"name",e)},expression:"form.name"}})],1),n("el-form-item",{attrs:{label:"描述",prop:"orderId"}},[n("el-input",{attrs:{type:"text"},model:{value:t.form.orderId,callback:function(e){t.$set(t.form,"orderId",e)},expression:"form.orderId"}})],1),n("el-form-item",{attrs:{label:"描述",prop:"content"}},[n("el-input",{attrs:{type:"text"},model:{value:t.form.content,callback:function(e){t.$set(t.form,"content",e)},expression:"form.content"}})],1),n("el-form-item",{attrs:{label:"图片",prop:"content"}},[n("el-input",{attrs:{type:"text"},model:{value:t.form.icon,callback:function(e){t.$set(t.form,"icon",e)},expression:"form.icon"}})],1),n("el-form-item",{attrs:{label:"宽度",prop:"content"}},[n("el-input",{attrs:{type:"text"},model:{value:t.form.span,callback:function(e){t.$set(t.form,"span",e)},expression:"form.span"}})],1)],1),n("div",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[n("el-button",{on:{click:function(e){t.dialogFormVisible=!1}}},[t._v("取 消")]),n("el-button",{attrs:{type:"primary"},on:{click:t.doAddCategory}},[t._v("确 定")])],1)],1)],1)},a=[],i=n("1da1"),o=(n("a434"),n("96cf"),n("c405")),s=n("c466"),l=n("a4a2"),c={name:"Api",data:function(){return{listApi:o["getTypeList"],dialogFormVisible:!1,mixins:[l["default"]],form:{id:0,name:"",span:6,icon:"i1",orderId:1,content:""},rules:{name:[{required:!0,message:"请输入名字",trigger:"blur"}],content:[{required:!0,message:"请输入描述",trigger:"blur"}]}}},mixins:[l["default"]],methods:{onSubmit:function(){this.page=1,this.pageSize=10,this.getTableData()},cancelEdit:function(t,e){t=Object.assign(t,t.temp),t.edit=!1,delete t["temp"]},initEdit:function(t,e){var n=Object.assign({},t);t.edit=!0,t.temp=n},doAddCategory:function(){var t=this;this.$refs.elAdd.validate(function(){var e=Object(i["a"])(regeneratorRuntime.mark((function e(n){var r;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(n){e.next=2;break}return e.abrupt("return");case 2:r=Object.assign({},t.form),r.end_time=Object(s["toDatetime"])(r.end_time),r.orderId=+r.orderId,Object(o["addType"])(r).then((function(e){t.$message.successMsg("新增成功",1),t.dialogFormVisible=!1,t.getTableData()}));case 6:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}())},deleteType:function(t,e){var n=this;this.$confirm("此操作将永久删除分类, 是否继续?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then((function(){Object(o["deleteType"])({id:t.id}).then((function(t){200==t.code&&(n.$message.successMsg("删除成功",1),n.tableData.splice(e,1))}))}))},confirmEdit:function(t){var e=this,n=Object.assign({},t);Object(o["addType"])(n).then((function(n){t.edit=!1,delete t["temp"],e.$message.successMsg("数据更新成功",1)}))}},created:function(){this.getTableData()}},u=c,d=(n("aaaa"),n("2877")),f=Object(d["a"])(u,r,a,!1,null,"4cdd5e7e",null);e["default"]=f.exports},a434:function(t,e,n){"use strict";var r=n("23e7"),a=n("da84"),i=n("23cb"),o=n("5926"),s=n("07fa"),l=n("7b0b"),c=n("65f0"),u=n("8418"),d=n("1dde"),f=d("splice"),p=a.TypeError,m=Math.max,h=Math.min,b=9007199254740991,g="Maximum allowed length exceeded";r({target:"Array",proto:!0,forced:!f},{splice:function(t,e){var n,r,a,d,f,v,y=l(this),w=s(y),x=i(t,w),k=arguments.length;if(0===k?n=r=0:1===k?(n=0,r=w-x):(n=k-2,r=h(m(o(e),0),w-x)),w+n-r>b)throw p(g);for(a=c(y,r),d=0;d<r;d++)f=x+d,f in y&&u(a,d,y[f]);if(a.length=r,n<r){for(d=x;d<w-r;d++)f=d+r,v=d+n,f in y?y[v]=y[f]:delete y[v];for(d=w;d>w-r+n;d--)delete y[d-1]}else if(n>r)for(d=w-r;d>x;d--)f=d+r-1,v=d+n-1,f in y?y[v]=y[f]:delete y[v];for(d=0;d<n;d++)y[d+x]=arguments[d+2];return y.length=w-r+n,a}})},a4a2:function(t,e,n){"use strict";n.r(e);var r=n("5530"),a=n("1da1"),i=(n("96cf"),n("4de4"),n("d3b7"),n("159b"),n("d81d"),n("0680"));n("c466"),n("ed08");e["default"]={data:function(){return{page:1,total:10,size:10,tableData:[],searchInfo:{isFinish:0}}},watch:{},methods:{filterDict:function(t,e){var n=this[e+"Options"]&&this[e+"Options"].filter((function(e){return e.value==t}));return n&&n[0]&&n[0].label},getDict:function(t){var e=this;return Object(a["a"])(regeneratorRuntime.mark((function n(){var r;return regeneratorRuntime.wrap((function(n){while(1)switch(n.prev=n.next){case 0:return n.next=2,Object(i["getDict"])(t);case 2:return r=n.sent,e[t+"Options"]=r,n.abrupt("return",r);case 5:case"end":return n.stop()}}),n)})))()},handleSizeChange:function(t){this.size=t,this.getTableData()},handleCurrentChange:function(t){this.page=t,this.getTableData()},handleSelectAll:function(t){console.log("handleSelectAll",t),this[t].forEach((function(t){t._selected=!0}))},handleSelectNull:function(t){console.log("handleSelectNull",t),this[t].forEach((function(t){t._selected=!1}))},handleChangeItem:function(t,e,n){this[t][e]=n(this[t][e])},getAllTableData:function(t){var e=Object(r["a"])({size:1e4,from:0},this.searchInfo);this.listApi(e).then((function(e){t(e)}))},getTableData:function(){var t=arguments,e=this;return Object(a["a"])(regeneratorRuntime.mark((function n(){var a,i,o,s,l;return regeneratorRuntime.wrap((function(n){while(1)switch(n.prev=n.next){case 0:return a=t.length>0&&void 0!==t[0]?t[0]:e.page,i=t.length>1&&void 0!==t[1]?t[1]:e.size,o=(a-1)*i,s=Object(r["a"])({size:i,from:o},e.searchInfo),n.next=6,e.listApi(s);case 6:l=n.sent,200==l.code&&(e.tableData=l.data.list.map((function(t){return t.edit=!1,t._selected=!1,t})),e.total=l.data.total);case 8:case"end":return n.stop()}}),n)})))()}}}},aaaa:function(t,e,n){"use strict";n("daff")},c405:function(t,e,n){"use strict";n.r(e),n.d(e,"getTypeList",(function(){return a})),n.d(e,"getGroupList",(function(){return i})),n.d(e,"addType",(function(){return o})),n.d(e,"addGroup",(function(){return s})),n.d(e,"deleteType",(function(){return l})),n.d(e,"deleteGroup",(function(){return c}));var r=n("b775"),a=function(t){return Object(r["default"])({url:"/admin/getTypeList",method:"post",data:t})},i=function(t){return Object(r["default"])({url:"/admin/getGroupList",method:"post",data:t})},o=function(t){return Object(r["default"])({url:"/admin/addType",method:"post",data:t})},s=function(t){return Object(r["default"])({url:"/admin/addGroup",method:"post",data:t})},l=function(t){return Object(r["default"])({url:"/admin/deleteType",method:"post",data:t})},c=function(t){return Object(r["default"])({url:"/admin/deleteGroup",method:"post",data:t})}},c466:function(t,e,n){"use strict";n.r(e),n.d(e,"curDate",(function(){return r})),n.d(e,"formatTimeToStr",(function(){return a})),n.d(e,"toDatetime",(function(){return i})),n.d(e,"toDate",(function(){return o})),n.d(e,"toDateShow",(function(){return s})),n.d(e,"getDate",(function(){return l}));n("ac1f"),n("00b4"),n("5319"),n("4d63"),n("c607"),n("2c3e"),n("25f0");function r(){var t=(new Date).Format("yyyy-MM-dd");return t.toLocaleString()}function a(t,e){var n=new Date(t).Format("yyyy-MM-dd hh:mm:ss");return e&&(n=new Date(t).Format(e)),n.toLocaleString()}function i(t){if(!t)return"2020-01-01 00:00:00";var e=new Date(t).Format("yyyy-MM-dd hh:mm:ss");return e.toLocaleString()}function o(t){if(!t)return"2020-01-01";var e=new Date(t).Format("yyyy-MM-dd");return e.toLocaleString()}function s(t){if(!t)return"---";var e=new Date(t).Format("yyyy-MM-dd");return e.toLocaleString()}function l(t){var e=new Date;return e.setDate(e.getDate()+t),o(e)}Date.prototype.Format=function(t){var e={"M+":this.getMonth()+1,"d+":this.getDate(),"h+":this.getHours(),"m+":this.getMinutes(),"s+":this.getSeconds(),"q+":Math.floor((this.getMonth()+3)/3),S:this.getMilliseconds()};for(var n in/(y+)/.test(t)&&(t=t.replace(RegExp.$1,(this.getFullYear()+"").substr(4-RegExp.$1.length))),e)new RegExp("("+n+")").test(t)&&(t=t.replace(RegExp.$1,1==RegExp.$1.length?e[n]:("00"+e[n]).substr((""+e[n]).length)));return t}},daff:function(t,e,n){}}]);
|