1 |
- (window.webpackJsonp=window.webpackJsonp||[]).push([["chunk-1ef1d389"],{1336:function(t,e,r){"use strict";r.d(e,"e",(function(){return a})),r.d(e,"d",(function(){return i})),r.d(e,"f",(function(){return o})),r.d(e,"a",(function(){return s})),r.d(e,"c",(function(){return c})),r.d(e,"b",(function(){return u})),r.d(e,"h",(function(){return l})),r.d(e,"g",(function(){return d}));var n=r("b6bd");function a(t){return Object(n.a)({url:"cms/cms",method:"get",params:t})}function i(t){return Object(n.a)({url:"cms/cms",method:"post",data:t})}function o(t){return Object(n.a)({url:"cms/cms/".concat(t),method:"get"})}function s(){return Object(n.a)({url:"cms/category/create",method:"GET"})}function c(t){return Object(n.a)({url:"cms/category",method:"GET",params:t})}function u(t){return Object(n.a)({url:"cms/category/".concat(t,"/edit"),method:"GET"})}function l(t){return Object(n.a)({url:"cms/category/set_status/".concat(t.id,"/").concat(t.status),method:"put"})}function d(t,e){return Object(n.a)({url:"cms/cms/relation/".concat(e),method:"put",data:t})}},"34efb":function(t,e,r){"use strict";var n=r("e2c0");r.n(n).a},"9ace":function(t,e,r){"use strict";r.r(e);var n=r("a34a"),a=r.n(n),i=r("2f62"),o=r("1336"),s=r("d708");function c(t,e,r,n,a,i,o){try{var s=t[i](o),c=s.value}catch(t){return void r(t)}s.done?e(c):Promise.resolve(c).then(n,a)}function u(t){return function(){var e=this,r=arguments;return new Promise((function(n,a){var i=t.apply(e,r);function o(t){c(i,n,a,o,s,"next",t)}function s(t){c(i,n,a,o,s,"throw",t)}o(void 0)}))}}function l(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function d(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?l(r,!0).forEach((function(e){f(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):l(r).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function f(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var m={name:"articleCategory",data:function(){return{roterPre:s.a.roterPre,grid:{xl:7,lg:7,md:12,sm:24,xs:24},loading:!1,formValidate:{status:"",page:1,limit:20,type:0},total:0,columns1:[{title:"ID",key:"id",width:80},{title:"分类昵称",key:"title",minWidth:130},{title:"分类图片",slot:"images",minWidth:130},{title:"状态",slot:"statuss",minWidth:130},{title:"操作",slot:"action",fixed:"right",minWidth:120}],FromData:null,modalTitleSs:"",categoryId:0,categoryList:[]}},computed:d({},Object(i.e)("admin/layout",["isMobile"]),{labelWidth:function(){return this.isMobile?void 0:96},labelPosition:function(){return this.isMobile?"top":"right"}}),mounted:function(){this.getList()},methods:d({},Object(i.d)("admin/userLevel",["getCategoryId"]),{add:function(){var t=this;this.$modalForm(Object(o.a)()).then((function(){return t.getList()}))},edit:function(t){var e=this;this.$modalForm(Object(o.b)(t.id)).then((function(){return e.getList()}))},del:function(t,e){var r=this,n={title:e,num:0,url:"cms/category/".concat(t.id),method:"DELETE",ids:""};this.$modalSure(n).then((function(t){r.$Message.success(t.msg),r.getList()})).catch((function(t){r.$Message.error(t.msg)}))},getList:function(){var t=this;this.loading=!0,Object(o.c)(this.formValidate).then(function(){var e=u(a.a.mark((function e(r){var n;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=r.data,t.categoryList=n.list,t.total=n.count,t.loading=!1;case 4:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()).catch((function(e){t.loading=!1,t.$Message.error(e.msg)}))},pageChange:function(t){this.formValidate.page=t,this.getList()},userSearchs:function(){this.formValidate.page=1,this.getList()},onchangeIsShow:function(t){var e=this,r={id:t.id,status:t.status};Object(o.h)(r).then(function(){var t=u(a.a.mark((function t(r){return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:e.$Message.success(r.msg);case 1:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()).catch((function(t){e.$Message.error(t.msg)}))},lookUp:function(t){this.$router.push({path:"".concat(this.roterPre,"/cms/article/index"),query:{id:t.id}}),this.getCategoryId(t.id)}})},h=(r("34efb"),r("2877")),p=Object(h.a)(m,(function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("div",[r("Card",{staticClass:"ivu-mt",attrs:{bordered:!1,"dis-hover":"",padding:0}},[r("div",{staticClass:"new_card_pd"},[r("Form",{ref:"formValidate",attrs:{model:t.formValidate,inline:"","label-width":t.labelWidth,"label-position":t.labelPosition},nativeOn:{submit:function(t){t.preventDefault()}}},[r("FormItem",{attrs:{label:"是否显示:","label-for":"status"}},[r("Select",{staticClass:"input-add",attrs:{placeholder:"请选择","element-id":"status",clearable:""},on:{"on-change":t.userSearchs},model:{value:t.formValidate.status,callback:function(e){t.$set(t.formValidate,"status",e)},expression:"formValidate.status"}},[r("Option",{attrs:{value:"all"}},[t._v("全部")]),r("Option",{attrs:{value:"1"}},[t._v("显示")]),r("Option",{attrs:{value:"0"}},[t._v("不显示")])],1)],1),r("FormItem",{attrs:{label:"分类昵称:",prop:"title","label-for":"status2"}},[r("Input",{staticClass:"input-add mr14",attrs:{placeholder:"请输入分类昵称"},on:{"on-search":t.userSearchs},model:{value:t.formValidate.title,callback:function(e){t.$set(t.formValidate,"title",e)},expression:"formValidate.title"}}),r("Button",{staticClass:"mr10",attrs:{type:"primary"},on:{click:function(e){return t.userSearchs()}}},[t._v("查询")])],1)],1)],1)]),r("Card",{staticClass:"ivu-mt",attrs:{bordered:!1,"dis-hover":""}},[r("Button",{directives:[{name:"auth",rawName:"v-auth",value:["cms-category-create"],expression:"['cms-category-create']"}],attrs:{type:"primary"},on:{click:t.add}},[t._v("添加文章分类")]),r("vxe-table",{staticClass:"ivu-mt",attrs:{"highlight-hover-row":"",loading:t.loading,"header-row-class-name":"false","tree-config":{children:"children"},data:t.categoryList}},[r("vxe-table-column",{attrs:{field:"id",title:"ID",tooltip:"",width:"80"}}),r("vxe-table-column",{attrs:{field:"title",title:"分类昵称","min-width":"130"}}),r("vxe-table-column",{attrs:{field:"image",title:"分类图片","min-width":"130"},scopedSlots:t._u([{key:"default",fn:function(t){var e=t.row;return[r("viewer",[r("div",{staticClass:"tabBox_img"},[r("img",{directives:[{name:"lazy",rawName:"v-lazy",value:e.image,expression:"row.image"}]})])])]}}])}),r("vxe-table-column",{attrs:{field:"status",title:"状态","min-width":"120"},scopedSlots:t._u([{key:"default",fn:function(e){var n=e.row;return[r("i-switch",{attrs:{value:n.status,"true-value":1,"false-value":0,size:"large"},on:{"on-change":function(e){return t.onchangeIsShow(n)}},model:{value:n.status,callback:function(e){t.$set(n,"status",e)},expression:"row.status"}},[r("span",{attrs:{slot:"open"},slot:"open"},[t._v("显示")]),r("span",{attrs:{slot:"close"},slot:"close"},[t._v("隐藏")])])]}}])}),r("vxe-table-column",{attrs:{field:"date",title:"操作",align:"center",width:"250",fixed:"right"},scopedSlots:t._u([{key:"default",fn:function(e){var n=e.row;return[r("a",{on:{click:function(e){return t.edit(n)}}},[t._v("编辑")]),r("Divider",{attrs:{type:"vertical"}}),r("a",{on:{click:function(e){return t.del(n,"删除文章分类")}}},[t._v("删除")]),r("Divider",{attrs:{type:"vertical"}}),r("a",{on:{click:function(e){return t.lookUp(n)}}},[t._v("查看文章")])]}}])})],1)],1)],1)}),[],!1,null,"3c5a2e2c",null);e.default=p.exports},e2c0:function(t,e,r){}}]);
|