1 |
- (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-fcfefdd2"],{1148:function(t,e,r){"use strict";var n=r("a691"),o=r("1d80");t.exports="".repeat||function(t){var e=String(o(this)),r="",i=n(t);if(i<0||i==1/0)throw RangeError("Wrong number of repetitions");for(;i>0;(i>>>=1)&&(e+=e))1&i&&(r+=e);return r}},2423:function(t,e,r){"use strict";r.d(e,"d",(function(){return o})),r.d(e,"c",(function(){return i})),r.d(e,"a",(function(){return a})),r.d(e,"e",(function(){return s})),r.d(e,"b",(function(){return c}));var n=r("b775");function o(t){return Object(n["a"])({url:"/article/index",method:"get",params:t})}function i(t){return Object(n["a"])({url:"/article/read",method:"get",params:{id:t}})}function a(t){return Object(n["a"])({url:"/article/save",method:"post",data:t})}function s(t){return Object(n["a"])({url:"/article/update?id="+t.id,method:"post",data:t})}function c(t){return Object(n["a"])({url:"/article/delete?id="+t,method:"get"})}},3123:function(t,e,r){"use strict";r.d(e,"a",(function(){return o})),r.d(e,"b",(function(){return i}));var n=r("b775");function o(t){return Object(n["a"])({url:"/upload/upload",method:"post",data:t})}function i(t){return Object(n["a"])({url:"/upload/uploadVideo",method:"post",data:t})}},"408a":function(t,e,r){var n=r("c6b6");t.exports=function(t){if("number"!=typeof t&&"Number"!=n(t))throw TypeError("Incorrect invocation");return+t}},"828d":function(t,e,r){"use strict";r.d(e,"a",(function(){return o}));var n=r("b775");function o(t){return Object(n["a"])({url:"/vue-element-admin/search/user",method:"get",params:{name:t}})}},"94bb":function(t,e,r){"use strict";var n=function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("div",{staticClass:"createPost-container"},[r("el-form",{ref:"postForm",staticClass:"form-container",attrs:{model:t.postForm,rules:t.rules}},[r("div",{staticClass:"createPost-main-container"},[r("el-row",[r("Warning"),r("el-col",{attrs:{span:24}},[r("el-form-item",{staticStyle:{"margin-bottom":"40px"},attrs:{prop:"title"}},[r("MDinput",{attrs:{maxlength:50,name:"name",required:""},model:{value:t.postForm.title,callback:function(e){t.$set(t.postForm,"title",e)},expression:"postForm.title"}},[t._v(" 文章标题 ")])],1),r("div",{staticClass:"postInfo-container"},[r("div",{staticStyle:{"margin-bottom":"10px"}},[t._v("封面图")]),r("el-form-item",{staticStyle:{"margin-bottom":"30px"},attrs:{prop:"cover_img",label:""}},[r("Upload",{model:{value:t.postForm.cover_img,callback:function(e){t.$set(t.postForm,"cover_img",e)},expression:"postForm.cover_img"}})],1)],1)],1)],1),r("el-form-item",{staticStyle:{"margin-bottom":"30px"},attrs:{prop:"content"}},[r("Tinymce",{ref:"editor",attrs:{height:400},model:{value:t.postForm.content,callback:function(e){t.$set(t.postForm,"content",e)},expression:"postForm.content"}})],1),r("el-row",[t.isEdit?t._e():r("el-button",{directives:[{name:"loading",rawName:"v-loading",value:t.loading,expression:"loading"}],attrs:{type:"success"},on:{click:t.submitForm}},[t._v(" 提交 ")]),t.isEdit?r("el-button",{directives:[{name:"loading",rawName:"v-loading",value:t.loading,expression:"loading"}],attrs:{type:"success"},on:{click:t.updateArticle}},[t._v(" 修改 ")]):t._e()],1)],1)])],1)},o=[],i=(r("d81d"),r("b0c0"),r("8256")),a=r("70a2"),s=r("1aba"),c=r("2423"),u=r("828d"),l=function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("aside")},f=[],d=r("2877"),m={},p=Object(d["a"])(m,l,f,!1,null,null,null),h=p.exports,b={status:"draft",title:"",content:"",content_short:"",video_url:"",cover_img:"",display_time:void 0,id:void 0,platforms:["a-platform"],comment_disabled:!1,importance:0},g={name:"ArticleDetail",components:{Tinymce:i["a"],MDinput:s["a"],Warning:h,Upload:a["a"]},props:{isEdit:{type:Boolean,default:!1}},data:function(){var t=this,e=function(e,r,n){""===r?(t.$message({message:e.field+"为必传项",type:"error"}),n(new Error(e.field+"为必传项"))):n()};return{postForm:Object.assign({},b),loading:!1,userListOptions:[],rules:{cover_img:[{message:"封面图不为空",validator:e}],title:[{message:"标题不为空",validator:e}],content:[{message:"内容不为空",validator:e}]},tempRoute:{}}},computed:{contentShortLength:function(){return this.postForm.content_short.length},displayTime:{get:function(){return+new Date(this.postForm.display_time)},set:function(t){this.postForm.display_time=new Date(t)}}},created:function(){if(this.isEdit){var t=this.$route.params&&this.$route.params.id;this.fetchData(t)}this.tempRoute=Object.assign({},this.$route)},methods:{fetchData:function(t){var e=this;Object(c["c"])(t).then((function(t){e.postForm=t.data.info})).catch((function(t){console.log(t)}))},setPageTitle:function(){var t="Edit Article";document.title="".concat(t," - ").concat(this.postForm.id)},submitForm:function(){var t=this;this.$refs.postForm.validate((function(e){if(!e)return console.log("error submit!!"),!1;t.loading=!0,console.log(t.postForm),Object(c["a"])(t.postForm).then((function(e){t.$notify({title:"成功",message:"发布文章成功",type:"success",duration:2e3}),t.postForm.status="published",t.loading=!1,t.listLoading=!1,t.$router.push("/article/list")}))}))},updateArticle:function(){var t=this;console.log(this.postForm),Object(c["e"])(this.postForm).then((function(e){t.$notify({title:"修改",message:"修改文章成功",type:"success",duration:2e3}),t.postForm.status="published",t.loading=!1,t.listLoading=!1,t.$router.push("/article/list")}))},draftForm:function(){0!==this.postForm.content.length&&0!==this.postForm.title.length?(this.$message({message:"保存成功",type:"success",showClose:!0,duration:1e3}),this.postForm.status="draft"):this.$message({message:"请填写必要的标题和内容",type:"warning"})},getRemoteUserList:function(t){var e=this;Object(u["a"])(t).then((function(t){t.data.items&&(e.userListOptions=t.data.items.map((function(t){return t.name})))}))}}},v=g,y=(r("fdb1"),Object(d["a"])(v,n,o,!1,null,"0ee9b26b",null));e["a"]=y.exports},a952:function(t,e,r){"use strict";r.r(e);var n=function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("article-detail",{attrs:{"is-edit":!1}})},o=[],i=r("94bb"),a={name:"CreateArticle",components:{ArticleDetail:i["a"]}},s=a,c=r("2877"),u=Object(c["a"])(s,n,o,!1,null,null,null);e["default"]=u.exports},a9e3:function(t,e,r){"use strict";var n=r("83ab"),o=r("da84"),i=r("94ca"),a=r("6eeb"),s=r("5135"),c=r("c6b6"),u=r("7156"),l=r("c04e"),f=r("d039"),d=r("7c73"),m=r("241c").f,p=r("06cf").f,h=r("9bf2").f,b=r("58a8").trim,g="Number",v=o[g],y=v.prototype,F=c(d(y))==g,_=function(t){var e,r,n,o,i,a,s,c,u=l(t,!1);if("string"==typeof u&&u.length>2)if(u=b(u),e=u.charCodeAt(0),43===e||45===e){if(r=u.charCodeAt(2),88===r||120===r)return NaN}else if(48===e){switch(u.charCodeAt(1)){case 66:case 98:n=2,o=49;break;case 79:case 111:n=8,o=55;break;default:return+u}for(i=u.slice(2),a=i.length,s=0;s<a;s++)if(c=i.charCodeAt(s),c<48||c>o)return NaN;return parseInt(i,n)}return+u};if(i(g,!v(" 0o1")||!v("0b1")||v("+0x1"))){for(var w,x=function(t){var e=arguments.length<1?0:t,r=this;return r instanceof x&&(F?f((function(){y.valueOf.call(r)})):c(r)!=g)?u(new v(_(e)),r,x):_(e)},E=n?m(v):"MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,EPSILON,isFinite,isInteger,isNaN,isSafeInteger,MAX_SAFE_INTEGER,MIN_SAFE_INTEGER,parseFloat,parseInt,isInteger".split(","),I=0;E.length>I;I++)s(v,w=E[I])&&!s(x,w)&&h(x,w,p(v,w));x.prototype=y,y.constructor=x,a(o,g,x)}},b680:function(t,e,r){"use strict";var n=r("23e7"),o=r("a691"),i=r("408a"),a=r("1148"),s=r("d039"),c=1..toFixed,u=Math.floor,l=function(t,e,r){return 0===e?r:e%2===1?l(t,e-1,r*t):l(t*t,e/2,r)},f=function(t){var e=0,r=t;while(r>=4096)e+=12,r/=4096;while(r>=2)e+=1,r/=2;return e},d=c&&("0.000"!==8e-5.toFixed(3)||"1"!==.9.toFixed(0)||"1.25"!==1.255.toFixed(2)||"1000000000000000128"!==(0xde0b6b3a7640080).toFixed(0))||!s((function(){c.call({})}));n({target:"Number",proto:!0,forced:d},{toFixed:function(t){var e,r,n,s,c=i(this),d=o(t),m=[0,0,0,0,0,0],p="",h="0",b=function(t,e){var r=-1,n=e;while(++r<6)n+=t*m[r],m[r]=n%1e7,n=u(n/1e7)},g=function(t){var e=6,r=0;while(--e>=0)r+=m[e],m[e]=u(r/t),r=r%t*1e7},v=function(){var t=6,e="";while(--t>=0)if(""!==e||0===t||0!==m[t]){var r=String(m[t]);e=""===e?r:e+a.call("0",7-r.length)+r}return e};if(d<0||d>20)throw RangeError("Incorrect fraction digits");if(c!=c)return"NaN";if(c<=-1e21||c>=1e21)return String(c);if(c<0&&(p="-",c=-c),c>1e-21)if(e=f(c*l(2,69,1))-69,r=e<0?c*l(2,-e,1):c/l(2,e,1),r*=4503599627370496,e=52-e,e>0){b(0,r),n=d;while(n>=7)b(1e7,0),n-=7;b(l(10,n,1),0),n=e-1;while(n>=23)g(1<<23),n-=23;g(1<<n),b(1,1),g(2),h=v()}else b(0,r),b(1<<-e,0),h=v()+a.call("0",d);return d>0?(s=h.length,h=p+(s<=d?"0."+a.call("0",d-s)+h:h.slice(0,s-d)+"."+h.slice(s-d))):h=p+h,h}})},b85c:function(t,e,r){"use strict";r.d(e,"a",(function(){return i}));r("a4d3"),r("e01a"),r("d28b"),r("d3b7"),r("3ca3"),r("ddb0"),r("a630"),r("fb6a"),r("b0c0"),r("25f0");function n(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function o(t,e){if(t){if("string"===typeof t)return n(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?n(t,e):void 0}}function i(t,e){var r;if("undefined"===typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(r=o(t))||e&&t&&"number"===typeof t.length){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,s=!0,c=!1;return{s:function(){r=t[Symbol.iterator]()},n:function(){var t=r.next();return s=t.done,t},e:function(t){c=!0,a=t},f:function(){try{s||null==r["return"]||r["return"]()}finally{if(c)throw a}}}}},f836:function(t,e,r){},fdb1:function(t,e,r){"use strict";var n=r("f836"),o=r.n(n);o.a}}]);
|