You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
1 lines
19 KiB
1 lines
19 KiB
(window.webpackJsonp=window.webpackJsonp||[]).push([["chunk-b23191cc"],{1336:function(t,e,r){"use strict";r.d(e,"e",(function(){return i})),r.d(e,"d",(function(){return o})),r.d(e,"f",(function(){return a})),r.d(e,"a",(function(){return s})),r.d(e,"c",(function(){return c})),r.d(e,"b",(function(){return l})),r.d(e,"h",(function(){return u})),r.d(e,"g",(function(){return d}));var n=r("b6bd");function i(t){return Object(n.a)({url:"cms/cms",method:"get",params:t})}function o(t){return Object(n.a)({url:"cms/cms",method:"post",data:t})}function a(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 l(t){return Object(n.a)({url:"cms/category/".concat(t,"/edit"),method:"GET"})}function u(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})}},"5cc3":function(t,e,r){},7137:function(t,e,r){"use strict";r("5cc3")},f164:function(t,e,r){"use strict";r.r(e);var n=r("2f62"),i=r("b0e7"),o=r("a069"),a=r("1336"),s=r("d708");function c(t){return(c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function l(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */l=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,i=Object.defineProperty||function(t,e,r){t[e]=r.value},o="function"==typeof Symbol?Symbol:{},a=o.iterator||"@@iterator",s=o.asyncIterator||"@@asyncIterator",u=o.toStringTag||"@@toStringTag";function d(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{d({},"")}catch(t){d=function(t,e,r){return t[e]=r}}function f(t,e,r,n){var o=e&&e.prototype instanceof y?e:y,a=Object.create(o.prototype),s=new T(n||[]);return i(a,"_invoke",{value:k(t,r,s)}),a}function h(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=f;var m="suspendedStart",p="suspendedYield",g="executing",v="completed",b={};function y(){}function w(){}function x(){}var _={};d(_,a,(function(){return this}));var C=Object.getPrototypeOf,O=C&&C(C(I([])));O&&O!==r&&n.call(O,a)&&(_=O);var P=x.prototype=y.prototype=Object.create(_);function j(t){["next","throw","return"].forEach((function(e){d(t,e,(function(t){return this._invoke(e,t)}))}))}function E(t,e){function r(i,o,a,s){var l=h(t[i],t,o);if("throw"!==l.type){var u=l.arg,d=u.value;return d&&"object"==c(d)&&n.call(d,"__await")?e.resolve(d.__await).then((function(t){r("next",t,a,s)}),(function(t){r("throw",t,a,s)})):e.resolve(d).then((function(t){u.value=t,a(u)}),(function(t){return r("throw",t,a,s)}))}s(l.arg)}var o;i(this,"_invoke",{value:function(t,n){function i(){return new e((function(e,i){r(t,n,e,i)}))}return o=o?o.then(i,i):i()}})}function k(e,r,n){var i=m;return function(o,a){if(i===g)throw Error("Generator is already running");if(i===v){if("throw"===o)throw a;return{value:t,done:!0}}for(n.method=o,n.arg=a;;){var s=n.delegate;if(s){var c=V(s,n);if(c){if(c===b)continue;return c}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(i===m)throw i=v,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);i=g;var l=h(e,r,n);if("normal"===l.type){if(i=n.done?v:p,l.arg===b)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(i=v,n.method="throw",n.arg=l.arg)}}}function V(e,r){var n=r.method,i=e.iterator[n];if(i===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,V(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),b;var o=h(i,e.iterator,r.arg);if("throw"===o.type)return r.method="throw",r.arg=o.arg,r.delegate=null,b;var a=o.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,b):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,b)}function L(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function S(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function T(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(L,this),this.reset(!0)}function I(e){if(e||""===e){var r=e[a];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var i=-1,o=function r(){for(;++i<e.length;)if(n.call(e,i))return r.value=e[i],r.done=!1,r;return r.value=t,r.done=!0,r};return o.next=o}}throw new TypeError(c(e)+" is not iterable")}return w.prototype=x,i(P,"constructor",{value:x,configurable:!0}),i(x,"constructor",{value:w,configurable:!0}),w.displayName=d(x,u,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===w||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,x):(t.__proto__=x,d(t,u,"GeneratorFunction")),t.prototype=Object.create(P),t},e.awrap=function(t){return{__await:t}},j(E.prototype),d(E.prototype,s,(function(){return this})),e.AsyncIterator=E,e.async=function(t,r,n,i,o){void 0===o&&(o=Promise);var a=new E(f(t,r,n,i),o);return e.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},j(P),d(P,u,"Generator"),d(P,a,(function(){return this})),d(P,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=I,T.prototype={constructor:T,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(S),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function i(n,i){return s.type="throw",s.arg=e,r.next=n,i&&(r.method="next",r.arg=t),!!i}for(var o=this.tryEntries.length-1;o>=0;--o){var a=this.tryEntries[o],s=a.completion;if("root"===a.tryLoc)return i("end");if(a.tryLoc<=this.prev){var c=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(c&&l){if(this.prev<a.catchLoc)return i(a.catchLoc,!0);if(this.prev<a.finallyLoc)return i(a.finallyLoc)}else if(c){if(this.prev<a.catchLoc)return i(a.catchLoc,!0)}else{if(!l)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return i(a.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var o=i;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=t,a.arg=e,o?(this.method="next",this.next=o.finallyLoc,b):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),b},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),S(r),b}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var i=n.arg;S(r)}return i}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:I(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),b}},e}function u(t,e,r,n,i,o,a){try{var s=t[o](a),c=s.value}catch(t){return void r(t)}s.done?e(c):Promise.resolve(c).then(n,i)}function d(t){return function(){var e=this,r=arguments;return new Promise((function(n,i){var o=t.apply(e,r);function a(t){u(o,n,i,a,s,"next",t)}function s(t){u(o,n,i,a,s,"throw",t)}a(void 0)}))}}function f(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 h(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?f(Object(r),!0).forEach((function(e){m(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):f(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function m(t,e,r){return(e=function(t){var e=function(t,e){if("object"!=c(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=c(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==c(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var p=m(m(m(m(m({name:"addArticle",components:{uploadPictures:i.a,WangEditor:o.a},computed:h({},Object(n.e)("admin/layout",["isMobile","menuCollapse"])),data:function(){var t=this;return{roterPre:s.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,r,n){t.formValidate.cid?n():n(new Error("请选择文章分类"))},trigger:"change",type:"number"}],image_input:[{required:!0,validator:function(e,r,n){t.formValidate.image_input?n():n(new Error("请上传图文封面"))},trigger:"change"}],content:[{required:!0,message:"请输入文章内容",trigger:"change"}]},value:"",modalPic:!1,template:!1,treeData:[],formValidate2:{type:1},current:0}}},"computed",h(h({},Object(n.e)("admin/layout",["isMobile","menuCollapse"])),{},{labelWidth:function(){return this.isMobile?void 0:120},labelPosition:function(){return this.isMobile?"top":"right"}})),"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="")}}),"methods",h(h({},Object(n.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(a.c)(this.formValidate2).then(function(){var e=d(l().mark((function e(r){return l().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t.treeData=r.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(a.d)(e.formValidate).then(function(){var t=d(l().mark((function t(r){return l().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:e.$Message.success(r.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(a.f)(this.$route.params.id?this.$route.params.id:0).then(function(){var e=d(l().mark((function e(r){var n,i,o;return l().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=r.data,i=n.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 r=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=r,new window.UE.ui.Button({name:"dialog-button",title:"上传图片",cssRules:"background-image: url(../../../assets/images/icons.png);background-position: -726px -77px;",onclick:function(){r.render(),r.open()}})}),37),window.UE.registerUI("video-dialog",(function(t,e){var r=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=r,new window.UE.ui.Button({name:"video-button",title:"上传视频",cssRules:"background-image: url(../../../assets/images/icons.png);background-position: -320px -20px;",onclick:function(){r.render(),r.open()}})}),38)}})),"mounted",(function(){this.$route.params.id&&this.getDetails()})),"created",(function(){this.getClass()})),g=(r("7137"),r("2877")),v=Object(g.a)(p,(function(){var t=this,e=t._self._c;return e("div",{staticClass:"article-manager form-submit"},[e("div",{staticClass:"i-layout-page-header"},[e("PageHeader",{staticClass:"product_tabs",attrs:{"hidden-breadcrumb":""}},[e("div",{attrs:{slot:"title"},slot:"title"},[e("router-link",{attrs:{to:{path:"".concat(t.roterPre,"/cms/article/index")}}},[e("div",{staticClass:"font-sm after-line"},[e("span",{staticClass:"iconfont iconfanhui"}),e("span",{staticClass:"pl10"},[t._v("返回")])])]),e("span",{staticClass:"mr20 ml16",domProps:{textContent:t._s(t.$route.params.id?"编辑文章":"添加文章")}})],1)])],1),e("Card",{staticClass:"ivu-mt",attrs:{bordered:!1,"dis-hover":""}},[e("div",{staticClass:"new_tab"},[e("Tabs",{on:{"on-click":t.changeTab},model:{value:t.current,callback:function(e){t.current=e},expression:"current"}},[e("TabPane",{attrs:{label:"文章信息",name:"0"}}),e("TabPane",{attrs:{label:"文章内容",name:"1"}}),e("TabPane",{attrs:{label:"其他设置",name:"2"}})],1)],1),e("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()}}},[e("Row",{directives:[{name:"show",rawName:"v-show",value:0==t.current,expression:"current == 0"}],attrs:{gutter:24,type:"flex"}},[e("Col",t._b({staticClass:"mr50"},"Col",t.grid,!1),[e("FormItem",{attrs:{label:"标题:",prop:"title","label-for":"title"}},[e("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),e("Col",t._b({staticClass:"mr50"},"Col",t.grid,!1),[e("FormItem",{attrs:{label:"作者:",prop:"author","label-for":"author"}},[e("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),e("Col",t._b({staticClass:"mr50"},"Col",t.grid,!1),[e("FormItem",{attrs:{label:"文章分类:","label-for":"cid",prop:"cid"}},[e("div",{directives:[{name:"width",rawName:"v-width",value:"90%",expression:"'90%'"}]},[e("Select",{model:{value:t.formValidate.cid,callback:function(e){t.$set(t.formValidate,"cid",e)},expression:"formValidate.cid"}},t._l(t.treeData,(function(r){return e("Option",{key:r.id,attrs:{value:r.id}},[t._v(t._s(r.title)+"\n ")])})),1)],1)])],1),e("Col",t._b({staticClass:"mr50"},"Col",t.grid,!1),[e("FormItem",{attrs:{label:"文章简介:",prop:"synopsis","label-for":"synopsis"}},[e("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),e("Col",t._b({staticClass:"mr50"},"Col",t.grid,!1),[e("FormItem",{attrs:{label:"图文封面:",prop:"image_input"}},[e("div",{staticClass:"picBox",on:{click:function(e){return t.modalPicTap("单选")}}},[t.formValidate.image_input?e("div",{staticClass:"pictrue"},[e("img",{attrs:{src:t.formValidate.image_input}})]):e("div",{staticClass:"upLoad acea-row row-center-wrapper"},[e("Icon",{attrs:{type:"ios-camera-outline",size:"26"}})],1)])])],1)],1),e("FormItem",{directives:[{name:"show",rawName:"v-show",value:1==t.current,expression:"current == 1"}],attrs:{label:"文章内容:",prop:"content"}},[e("WangEditor",{staticClass:"width-add",attrs:{content:t.formValidate.content},on:{editorContent:t.getEditorContent}})],1),e("Row",{directives:[{name:"show",rawName:"v-show",value:2==t.current,expression:"current == 2"}],attrs:{gutter:24,type:"flex"}},[e("Col",{attrs:{span:"24"}},[e("FormItem",{attrs:{label:"banner显示:","label-for":"is_banner"}},[e("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"}},[e("Radio",{staticClass:"radio",attrs:{label:1}},[t._v("显示")]),e("Radio",{attrs:{label:0}},[t._v("不显示")])],1)],1)],1),e("Col",{attrs:{span:"24"}},[e("FormItem",{attrs:{label:"热门文章:","label-for":"is_hot"}},[e("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"}},[e("Radio",{staticClass:"radio",attrs:{label:1}},[t._v("显示")]),e("Radio",{attrs:{label:0}},[t._v("不显示")])],1)],1)],1)],1)],1)],1),e("Card",{staticClass:"fixed-card",style:{left:"".concat(t.menuCollapse?t.isMobile?"0":"80px":"200px")},attrs:{bordered:!1,"dis-hover":""}},[e("div",{staticClass:"acea-row row-center"},[e("Button",{directives:[{name:"show",rawName:"v-show",value:t.current>0,expression:"current > 0"}],on:{click:function(e){return t.back()}}},[t._v("上一步")]),e("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("下一步")]),e("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)]),e("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?e("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}}]); |