1 |
- (window.webpackJsonp=window.webpackJsonp||[]).push([["chunk-1a63c80a"],{"0d5a":function(t,e,a){"use strict";var r=a("43c4");a.n(r).a},1336:function(t,e,a){"use strict";a.d(e,"e",(function(){return i})),a.d(e,"d",(function(){return n})),a.d(e,"f",(function(){return o})),a.d(e,"a",(function(){return s})),a.d(e,"c",(function(){return c})),a.d(e,"b",(function(){return l})),a.d(e,"h",(function(){return u})),a.d(e,"g",(function(){return d}));var r=a("b6bd");function i(t){return Object(r.a)({url:"cms/cms",method:"get",params:t})}function n(t){return Object(r.a)({url:"cms/cms",method:"post",data:t})}function o(t){return Object(r.a)({url:"cms/cms/".concat(t),method:"get"})}function s(){return Object(r.a)({url:"cms/category/create",method:"GET"})}function c(t){return Object(r.a)({url:"cms/category",method:"GET",params:t})}function l(t){return Object(r.a)({url:"cms/category/".concat(t,"/edit"),method:"GET"})}function u(t){return Object(r.a)({url:"cms/category/set_status/".concat(t.id,"/").concat(t.status),method:"put"})}function d(t,e){return Object(r.a)({url:"cms/cms/relation/".concat(e),method:"put",data:t})}},"43c4":function(t,e,a){},f164:function(t,e,a){"use strict";a.r(e);var r,i=a("a34a"),n=a.n(i),o=a("2f62"),s=a("b0e7"),c=a("a069"),l=a("1336"),u=a("d708");function d(t,e,a,r,i,n,o){try{var s=t[n](o),c=s.value}catch(t){return void a(t)}s.done?e(c):Promise.resolve(c).then(r,i)}function m(t){return function(){var e=this,a=arguments;return new Promise((function(r,i){var n=t.apply(e,a);function o(t){d(n,r,i,o,s,"next",t)}function s(t){d(n,r,i,o,s,"throw",t)}o(void 0)}))}}function p(t,e){var a=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),a.push.apply(a,r)}return a}function f(t){for(var e=1;e<arguments.length;e++){var a=null!=arguments[e]?arguments[e]:{};e%2?p(a,!0).forEach((function(e){h(t,e,a[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(a)):p(a).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(a,e))}))}return t}function h(t,e,a){return e in t?Object.defineProperty(t,e,{value:a,enumerable:!0,configurable:!0,writable:!0}):t[e]=a,t}var b=(h(r={name:"addArticle",components:{uploadPictures:s.a,WangEditor:c.a},computed:f({},Object(o.e)("admin/layout",["isMobile","menuCollapse"])),data:function(){var t=this;return{roterPre:u.a.roterPre,dialog:{},isChoice:"单选",grid:{xl:8,lg:8,md:12,sm:24,xs:24},gridPic:{xl:6,lg:8,md:12,sm:12,xs:12},gridBtn:{xl:4,lg:8,md:8,sm:8,xs:8},loading:!1,formValidate:{id:0,title:"",author:"",image_input:"",content:"",synopsis:"",url:"",is_hot:0,is_banner:0,cid:"",visit:0},content:"",ruleValidate:{title:[{required:!0,message:"请输入标题",trigger:"blur"}],cid:[{required:!0,validator:function(e,a,r){t.formValidate.cid?r():r(new Error("请选择文章分类"))},trigger:"change",type:"number"}],image_input:[{required:!0,validator:function(e,a,r){t.formValidate.image_input?r():r(new Error("请上传图文封面"))},trigger:"change"}],content:[{required:!0,message:"请输入文章内容",trigger:"change"}]},value:"",modalPic:!1,template:!1,treeData:[],formValidate2:{type:1},current:0}}},"computed",f({},Object(o.e)("admin/layout",["isMobile","menuCollapse"]),{labelWidth:function(){return this.isMobile?void 0:120},labelPosition:function(){return this.isMobile?"top":"right"}})),h(r,"watch",{$route:function(t,e){this.$route.params.id?this.getDetails():(this.formValidate={id:0,title:"",author:"",image_input:"",content:"",synopsis:"",url:"",is_hot:0,is_banner:0},this.content="")}}),h(r,"methods",f({},Object(o.d)("admin/layout",["setCopyrightShow"]),{back:function(){this.current=(Number(this.current)-1).toString()},next:function(){this.current=(Number(this.current)+1).toString()},changeTab:function(t){this.current=t},getEditorContent:function(t){this.content=t},modalPicTap:function(){this.modalPic=!0},getPic:function(t){this.formValidate.image_input=t.att_dir,this.modalPic=!1},getClass:function(){var t=this;Object(l.c)(this.formValidate2).then(function(){var e=m(n.a.mark((function e(a){return n.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t.treeData=a.data;case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()).catch((function(e){t.$Message.error(e.msg)}))},onsubmit:function(t){var e=this;this.formValidate.content=this.content,this.$refs[t].validate((function(t){if(!t)return!1;Object(l.d)(e.formValidate).then(function(){var t=m(n.a.mark((function t(a){return n.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:e.$Message.success(a.msg),setTimeout((function(){e.$router.push({path:"".concat(e.roterPre,"/cms/article/index")})}),500);case 2:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()).catch((function(t){e.$Message.error(t.msg)}))}))},getDetails:function(){var t=this;Object(l.f)(this.$route.params.id?this.$route.params.id:0).then(function(){var e=m(n.a.mark((function e(a){var r,i,o;return n.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:r=a.data,i=r.info,o=i.content?i.content:" ",t.formValidate={id:i.id,title:i.title,author:i.author,image_input:i.image_input,content:o,synopsis:i.synopsis,url:i.url,is_hot:i.is_hot,is_banner:i.is_banner,cid:i.cid,visit:i.visit},t.content=o;case 5: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)}))},addCustomDialog:function(t){window.UE.registerUI("test-dialog",(function(t,e){var a=new window.UE.ui.Dialog({iframeUrl:"/admin/widget.images/index.html?fodder=dialog",editor:t,name:e,title:"上传图片",cssRules:"width:1200px;height:500px;padding:20px;"});return this.dialog=a,new window.UE.ui.Button({name:"dialog-button",title:"上传图片",cssRules:"background-image: url(../../../assets/images/icons.png);background-position: -726px -77px;",onclick:function(){a.render(),a.open()}})}),37),window.UE.registerUI("video-dialog",(function(t,e){var a=new window.UE.ui.Dialog({iframeUrl:"/admin/widget.video/index.html?fodder=video",editor:t,name:e,title:"上传视频",cssRules:"width:1000px;height:500px;padding:20px;"});return this.dialog=a,new window.UE.ui.Button({name:"video-button",title:"上传视频",cssRules:"background-image: url(../../../assets/images/icons.png);background-position: -320px -20px;",onclick:function(){a.render(),a.open()}})}),38)}})),h(r,"mounted",(function(){this.$route.params.id&&this.getDetails()})),h(r,"created",(function(){this.getClass()})),r),g=(a("0d5a"),a("2877")),v=Object(g.a)(b,(function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"article-manager form-submit"},[a("div",{staticClass:"i-layout-page-header"},[a("PageHeader",{staticClass:"product_tabs",attrs:{"hidden-breadcrumb":""}},[a("div",{attrs:{slot:"title"},slot:"title"},[a("router-link",{attrs:{to:{path:t.roterPre+"/cms/article/index"}}},[a("div",{staticClass:"font-sm after-line"},[a("span",{staticClass:"iconfont iconfanhui"}),a("span",{staticClass:"pl10"},[t._v("返回")])])]),a("span",{staticClass:"mr20 ml16",domProps:{textContent:t._s(t.$route.params.id?"编辑文章":"添加文章")}})],1)])],1),a("Card",{staticClass:"ivu-mt",attrs:{bordered:!1,"dis-hover":""}},[a("div",{staticClass:"new_tab"},[a("Tabs",{on:{"on-click":t.changeTab},model:{value:t.current,callback:function(e){t.current=e},expression:"current"}},[a("TabPane",{attrs:{label:"文章信息",name:"0"}}),a("TabPane",{attrs:{label:"文章内容",name:"1"}}),a("TabPane",{attrs:{label:"其他设置",name:"2"}})],1)],1),a("Form",{ref:"formValidate",staticClass:"form",attrs:{model:t.formValidate,rules:t.ruleValidate,"label-width":t.labelWidth,"label-position":t.labelPosition},nativeOn:{submit:function(t){t.preventDefault()}}},[a("Row",{directives:[{name:"show",rawName:"v-show",value:0==t.current,expression:"current == 0"}],attrs:{gutter:24,type:"flex"}},[a("Col",t._b({staticClass:"mr50"},"Col",t.grid,!1),[a("FormItem",{attrs:{label:"标题:",prop:"title","label-for":"title"}},[a("Input",{staticClass:"width-add",attrs:{placeholder:"请输入",maxlength:"20","element-id":"title"},model:{value:t.formValidate.title,callback:function(e){t.$set(t.formValidate,"title",e)},expression:"formValidate.title"}})],1)],1),a("Col",t._b({staticClass:"mr50"},"Col",t.grid,!1),[a("FormItem",{attrs:{label:"作者:",prop:"author","label-for":"author"}},[a("Input",{staticClass:"width-add",attrs:{placeholder:"请输入","element-id":"author"},model:{value:t.formValidate.author,callback:function(e){t.$set(t.formValidate,"author",e)},expression:"formValidate.author"}})],1)],1),a("Col",t._b({staticClass:"mr50"},"Col",t.grid,!1),[a("FormItem",{attrs:{label:"文章分类:","label-for":"cid",prop:"cid"}},[a("div",{directives:[{name:"width",rawName:"v-width",value:"90%",expression:"'90%'"}]},[a("Select",{model:{value:t.formValidate.cid,callback:function(e){t.$set(t.formValidate,"cid",e)},expression:"formValidate.cid"}},t._l(t.treeData,(function(e){return a("Option",{key:e.id,attrs:{value:e.id}},[t._v(t._s(e.title)+"\n ")])})),1)],1)])],1),a("Col",t._b({staticClass:"mr50"},"Col",t.grid,!1),[a("FormItem",{attrs:{label:"文章简介:",prop:"synopsis","label-for":"synopsis"}},[a("Input",{staticClass:"width-add",attrs:{type:"textarea",placeholder:"请输入"},model:{value:t.formValidate.synopsis,callback:function(e){t.$set(t.formValidate,"synopsis",e)},expression:"formValidate.synopsis"}})],1)],1),a("Col",t._b({staticClass:"mr50"},"Col",t.grid,!1),[a("FormItem",{attrs:{label:"图文封面:",prop:"image_input"}},[a("div",{staticClass:"picBox",on:{click:function(e){return t.modalPicTap("单选")}}},[t.formValidate.image_input?a("div",{staticClass:"pictrue"},[a("img",{attrs:{src:t.formValidate.image_input}})]):a("div",{staticClass:"upLoad acea-row row-center-wrapper"},[a("Icon",{attrs:{type:"ios-camera-outline",size:"26"}})],1)])])],1)],1),a("FormItem",{directives:[{name:"show",rawName:"v-show",value:1==t.current,expression:"current == 1"}],attrs:{label:"文章内容:",prop:"content"}},[a("WangEditor",{staticClass:"width-add",attrs:{content:t.formValidate.content},on:{editorContent:t.getEditorContent}})],1),a("Row",{directives:[{name:"show",rawName:"v-show",value:2==t.current,expression:"current == 2"}],attrs:{gutter:24,type:"flex"}},[a("Col",{attrs:{span:"24"}},[a("FormItem",{attrs:{label:"banner显示:","label-for":"is_banner"}},[a("RadioGroup",{attrs:{"element-id":"is_banner"},model:{value:t.formValidate.is_banner,callback:function(e){t.$set(t.formValidate,"is_banner",e)},expression:"formValidate.is_banner"}},[a("Radio",{staticClass:"radio",attrs:{label:1}},[t._v("显示")]),a("Radio",{attrs:{label:0}},[t._v("不显示")])],1)],1)],1),a("Col",{attrs:{span:"24"}},[a("FormItem",{attrs:{label:"热门文章:","label-for":"is_hot"}},[a("RadioGroup",{attrs:{"element-id":"is_hot"},model:{value:t.formValidate.is_hot,callback:function(e){t.$set(t.formValidate,"is_hot",e)},expression:"formValidate.is_hot"}},[a("Radio",{staticClass:"radio",attrs:{label:1}},[t._v("显示")]),a("Radio",{attrs:{label:0}},[t._v("不显示")])],1)],1)],1)],1)],1)],1),a("Card",{staticClass:"fixed-card",style:{left:t.menuCollapse?t.isMobile?"0":"80px":"200px"},attrs:{bordered:!1,"dis-hover":""}},[a("div",{staticClass:"acea-row row-center"},[a("Button",{directives:[{name:"show",rawName:"v-show",value:t.current>0,expression:"current > 0"}],on:{click:function(e){return t.back()}}},[t._v("上一步")]),a("Button",{directives:[{name:"show",rawName:"v-show",value:t.current<2,expression:"current < 2"}],staticClass:"step_btn",on:{click:function(e){return t.next("formItem")}}},[t._v("下一步")]),a("Button",{directives:[{name:"show",rawName:"v-show",value:2==t.current,expression:"current == 2"}],staticClass:"step_btn",attrs:{type:"primary"},on:{click:function(e){return t.onsubmit("formValidate")}}},[t._v("提交")])],1)]),a("Modal",{attrs:{width:"960px",scrollable:"","footer-hide":"",closable:"",title:"上传商品图","mask-closable":!1,"z-index":1},model:{value:t.modalPic,callback:function(e){t.modalPic=e},expression:"modalPic"}},[t.modalPic?a("uploadPictures",{attrs:{isChoice:t.isChoice,gridBtn:t.gridBtn,gridPic:t.gridPic},on:{getPic:t.getPic}}):t._e()],1)],1)}),[],!1,null,"04be12f9",null);e.default=v.exports}}]);
|