mirror of
https://github.com/crmeb/CRMEB.git
synced 2025-12-14 20:42:49 +00:00
1 line
15 KiB
JavaScript
1 line
15 KiB
JavaScript
(window.webpackJsonp=window.webpackJsonp||[]).push([["chunk-66e759d0"],{"3a13":function(t,e,r){},"7b6c":function(t,e,r){"use strict";var i=r("3a13");r.n(i).a},f164:function(t,e,r){"use strict";r.r(e),r("a4d3"),r("e01a"),r("d3b7"),r("d28b"),r("3ca3"),r("ddb0"),r("b636"),r("944a"),r("0c47"),r("23dc"),r("3410"),r("159b"),r("b0c0"),r("131a"),r("fb6a");var i=r("0122"),a=r("c964"),n=r("f3f3"),o=(r("d9e2"),r("2f62")),s=r("b0e7"),l=r("a069"),c=r("1336");function u(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */u=function(){return t};var t={},e=Object.prototype,r=e.hasOwnProperty,a=Object.defineProperty||function(t,e,r){t[e]=r.value},n="function"==typeof Symbol?Symbol:{},o=n.iterator||"@@iterator",s=n.asyncIterator||"@@asyncIterator",l=n.toStringTag||"@@toStringTag";function c(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(e){c=function(t,e,r){return t[e]=r}}function d(t,e,r,i){var n,o,s,l;e=e&&e.prototype instanceof p?e:p,e=Object.create(e.prototype),i=new C(i||[]);return a(e,"_invoke",{value:(n=t,o=r,s=i,l="suspendedStart",function(t,e){if("executing"===l)throw new Error("Generator is already running");if("completed"===l){if("throw"===t)throw e;return E()}for(s.method=t,s.arg=e;;){var r=s.delegate;if(r&&(r=function t(e,r){var i=r.method,a=e.iterator[i];return void 0===a?(r.delegate=null,"throw"===i&&e.iterator.return&&(r.method="return",r.arg=void 0,t(e,r),"throw"===r.method)||"return"!==i&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+i+"' method")),h):(i=f(a,e.iterator,r.arg),"throw"===i.type?(r.method="throw",r.arg=i.arg,r.delegate=null,h):(a=i.arg,a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=void 0),r.delegate=null,h):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,h)))}(r,s),r)){if(r===h)continue;return r}if("next"===s.method)s.sent=s._sent=s.arg;else if("throw"===s.method){if("suspendedStart"===l)throw l="completed",s.arg;s.dispatchException(s.arg)}else"return"===s.method&&s.abrupt("return",s.arg);if(l="executing",r=f(n,o,s),"normal"===r.type){if(l=s.done?"completed":"suspendedYield",r.arg===h)continue;return{value:r.arg,done:s.done}}"throw"===r.type&&(l="completed",s.method="throw",s.arg=r.arg)}})}),e}function f(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=d;var h={};function p(){}function m(){}function g(){}n={};var v=(c(n,o,(function(){return this})),Object.getPrototypeOf),b=(v=v&&v(v(V([]))),v&&v!==e&&r.call(v,o)&&(n=v),g.prototype=p.prototype=Object.create(n));function y(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function w(t,e){var n;a(this,"_invoke",{value:function(a,o){function s(){return new e((function(n,s){!function a(n,o,s,l){var c;n=f(t[n],t,o);if("throw"!==n.type)return(o=(c=n.arg).value)&&"object"==Object(i.a)(o)&&r.call(o,"__await")?e.resolve(o.__await).then((function(t){a("next",t,s,l)}),(function(t){a("throw",t,s,l)})):e.resolve(o).then((function(t){c.value=t,s(c)}),(function(t){return a("throw",t,s,l)}));l(n.arg)}(a,o,n,s)}))}return n=n?n.then(s,s):s()}})}function _(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 x(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function C(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(_,this),this.reset(!0)}function V(t){if(t){var e,i=t[o];if(i)return i.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length))return e=-1,(i=function i(){for(;++e<t.length;)if(r.call(t,e))return i.value=t[e],i.done=!1,i;return i.value=void 0,i.done=!0,i}).next=i}return{next:E}}function E(){return{value:void 0,done:!0}}return a(b,"constructor",{value:m.prototype=g,configurable:!0}),a(g,"constructor",{value:m,configurable:!0}),m.displayName=c(g,l,"GeneratorFunction"),t.isGeneratorFunction=function(t){return t="function"==typeof t&&t.constructor,!!t&&(t===m||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,g):(t.__proto__=g,c(t,l,"GeneratorFunction")),t.prototype=Object.create(b),t},t.awrap=function(t){return{__await:t}},y(w.prototype),c(w.prototype,s,(function(){return this})),t.AsyncIterator=w,t.async=function(e,r,i,a,n){void 0===n&&(n=Promise);var o=new w(d(e,r,i,a),n);return t.isGeneratorFunction(r)?o:o.next().then((function(t){return t.done?t.value:o.next()}))},y(b),c(b,l,"Generator"),c(b,o,(function(){return this})),c(b,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e,r=Object(t),i=[];for(e in r)i.push(e);return i.reverse(),function t(){for(;i.length;){var e=i.pop();if(e in r)return t.value=e,t.done=!1,t}return t.done=!0,t}},t.values=V,C.prototype={constructor:C,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(x),!t)for(var e in this)"t"===e.charAt(0)&&r.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function i(r,i){return o.type="throw",o.arg=t,e.next=r,i&&(e.method="next",e.arg=void 0),!!i}for(var a=this.tryEntries.length-1;0<=a;--a){var n=this.tryEntries[a],o=n.completion;if("root"===n.tryLoc)return i("end");if(n.tryLoc<=this.prev){var s=r.call(n,"catchLoc"),l=r.call(n,"finallyLoc");if(s&&l){if(this.prev<n.catchLoc)return i(n.catchLoc,!0);if(this.prev<n.finallyLoc)return i(n.finallyLoc)}else if(s){if(this.prev<n.catchLoc)return i(n.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<n.finallyLoc)return i(n.finallyLoc)}}}},abrupt:function(t,e){for(var i=this.tryEntries.length-1;0<=i;--i){var a=this.tryEntries[i];if(a.tryLoc<=this.prev&&r.call(a,"finallyLoc")&&this.prev<a.finallyLoc){var n=a;break}}var o=(n=n&&("break"===t||"continue"===t)&&n.tryLoc<=e&&e<=n.finallyLoc?null:n)?n.completion:{};return o.type=t,o.arg=e,n?(this.method="next",this.next=n.finallyLoc,h):this.complete(o)},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),h},finish:function(t){for(var e=this.tryEntries.length-1;0<=e;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),x(r),h}},catch:function(t){for(var e=this.tryEntries.length-1;0<=e;--e){var r,i,a=this.tryEntries[e];if(a.tryLoc===t)return"throw"===(r=a.completion).type&&(i=r.arg,x(a)),i}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:V(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),h}},t}s={name:"addArticle",components:{uploadPictures:s.a,WangEditor:l.a},data:function(){var t=this;return{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,i){t.formValidate.cid?i():i(new Error("请选择文章分类"))},trigger:"change",type:"number"}],image_input:[{required:!0,validator:function(e,r,i){t.formValidate.image_input?i():i(new Error("请上传图文封面"))},trigger:"change"}],content:[{required:!0,message:"请输入文章内容",trigger:"change"}]},value:"",modalPic:!1,template:!1,treeData:[],formValidate2:{type:1},myConfig:{autoHeightEnabled:!1,initialFrameHeight:500,initialFrameWidth:"100%",UEDITOR_HOME_URL:"/UEditor/",serverUrl:""}}},computed:Object(n.a)(Object(n.a)({},Object(o.d)("media",["isMobile"])),{},{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}}},methods:{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(c.d)().then(function(){var e=Object(a.a)(u().mark((function e(r){return u().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(c.e)(e.formValidate).then(function(){var t=Object(a.a)(u().mark((function t(r){return u().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:e.$Message.success(r.msg),setTimeout((function(){e.$router.push({path:e.$routeProStr+"/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(c.g)(this.$route.params.id||0).then(function(){var e=Object(a.a)(u().mark((function e(r){var i;return u().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:i=r.data,i=i.info,t.formValidate={id:i.id,title:i.title,author:i.author,image_input:i.image_input,content:i.content,synopsis:i.synopsis,url:i.url,is_hot:i.is_hot,is_banner:i.is_banner,cid:i.cid,visit:i.visit};case 3: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)}))}},mounted:function(){this.$route.params.id&&this.getDetails()},created:function(){this.getClass()}},r("7b6c"),l=r("2877"),n=Object(l.a)(s,(function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("div",{staticClass:"article-manager"},[r("div",{staticClass:"i-layout-page-header header-title"},[r("div",{staticClass:"fl_header"},[r("span",[r("Button",{attrs:{icon:"ios-arrow-back",size:"small",type:"text"},on:{click:function(e){return t.$router.go(-1)}}},[t._v("返回")])],1),r("Divider",{attrs:{type:"vertical"}}),r("span",{staticClass:"ivu-page-header-title"},[t._v(t._s(t.$route.params.id?"编辑文章":"添加文章"))])],1)]),r("Card",{staticClass:"ivu-mt",attrs:{bordered:!1,"dis-hover":""}},[r("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()}}},[r("div",{staticClass:"goodsTitle acea-row"},[r("div",{staticClass:"title"},[t._v("文章信息")])]),r("Row",{attrs:{gutter:24,type:"flex"}},[r("Col",t._b({staticClass:"mr50"},"Col",t.grid,!1),[r("FormItem",{attrs:{label:"标题:",prop:"title","label-for":"title"}},[r("Input",{staticStyle:{width:"90%"},attrs:{placeholder:"请输入","element-id":"title"},model:{value:t.formValidate.title,callback:function(e){t.$set(t.formValidate,"title",e)},expression:"formValidate.title"}})],1)],1),r("Col",t._b({staticClass:"mr50"},"Col",t.grid,!1),[r("FormItem",{attrs:{label:"作者:",prop:"author","label-for":"author"}},[r("Input",{staticStyle:{width:"90%"},attrs:{placeholder:"请输入","element-id":"author"},model:{value:t.formValidate.author,callback:function(e){t.$set(t.formValidate,"author",e)},expression:"formValidate.author"}})],1)],1),r("Col",t._b({staticClass:"mr50"},"Col",t.grid,!1),[r("FormItem",{attrs:{label:"文章分类:","label-for":"cid",prop:"cid"}},[r("div",{staticClass:"perW90"},[r("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 r("Option",{key:e.id,attrs:{value:e.id,disabled:e.disabled}},[t._v(t._s(e.html+e.title))])})),1)],1)])],1),r("Col",t._b({staticClass:"mr50"},"Col",t.grid,!1),[r("FormItem",{attrs:{label:"文章简介:",prop:"synopsis","label-for":"synopsis"}},[r("Input",{staticStyle:{width:"90%"},attrs:{type:"textarea",placeholder:"请输入"},model:{value:t.formValidate.synopsis,callback:function(e){t.$set(t.formValidate,"synopsis",e)},expression:"formValidate.synopsis"}})],1)],1),r("Col",t._b({staticClass:"mr50"},"Col",t.grid,!1),[r("FormItem",{attrs:{label:"图文封面:",prop:"image_input"}},[r("div",{staticClass:"picBox",on:{click:function(e){return t.modalPicTap("单选")}}},[t.formValidate.image_input?r("div",{staticClass:"pictrue"},[r("img",{attrs:{src:t.formValidate.image_input}})]):r("div",{staticClass:"upLoad acea-row row-center-wrapper"},[r("Icon",{attrs:{type:"ios-camera-outline",size:"24"}})],1)]),r("div",{staticClass:"tip"},[t._v("建议尺寸:500 x 312 px")])])],1)],1),r("div",{staticClass:"goodsTitle acea-row"},[r("div",{staticClass:"title"},[t._v("文章内容")])]),r("FormItem",{attrs:{label:"文章内容:",prop:"content"}},[r("WangEditor",{staticStyle:{width:"90%"},attrs:{content:t.formValidate.content},on:{editorContent:t.getEditorContent}})],1),r("div",{staticClass:"goodsTitle acea-row"},[r("div",{staticClass:"title"},[t._v("其他设置")])]),r("Row",{attrs:{gutter:24,type:"flex"}},[r("Col",{attrs:{span:"24"}},[r("FormItem",{attrs:{label:"banner显示:","label-for":"is_banner"}},[r("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"}},[r("Radio",{staticClass:"radio",attrs:{label:1}},[t._v("显示")]),r("Radio",{attrs:{label:0}},[t._v("不显示")])],1)],1)],1),r("Col",{attrs:{span:"24"}},[r("FormItem",{attrs:{label:"热门文章:","label-for":"is_hot"}},[r("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"}},[r("Radio",{staticClass:"radio",attrs:{label:1}},[t._v("显示")]),r("Radio",{attrs:{label:0}},[t._v("不显示")])],1)],1)],1)],1),r("Button",{staticClass:"submission",attrs:{type:"primary"},on:{click:function(e){return t.onsubmit("formValidate")}}},[t._v("提交")])],1),r("Modal",{attrs:{width:"950px",scrollable:"","footer-hide":"",closable:"",title:"上传商品图","mask-closable":!1,"z-index":888},model:{value:t.modalPic,callback:function(e){t.modalPic=e},expression:"modalPic"}},[t.modalPic?r("uploadPictures",{attrs:{isChoice:t.isChoice,gridBtn:t.gridBtn,gridPic:t.gridPic},on:{getPic:t.getPic}}):t._e()],1)],1)],1)}),[],!1,null,"fd98db60",null),e.default=n.exports}}]); |