chunk-3313f3bd.292ba372.js 9.5 KB

1
  1. (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-3313f3bd"],{1148:function(t,e,n){"use strict";var r=n("a691"),o=n("1d80");t.exports="".repeat||function(t){var e=String(o(this)),n="",i=r(t);if(i<0||i==1/0)throw RangeError("Wrong number of repetitions");for(;i>0;(i>>>=1)&&(e+=e))1&i&&(n+=e);return n}},"2ac8":function(t,e,n){"use strict";n.d(e,"c",(function(){return o})),n.d(e,"d",(function(){return i})),n.d(e,"a",(function(){return a})),n.d(e,"e",(function(){return s})),n.d(e,"b",(function(){return c}));var r=n("b775");function o(t){return Object(r["a"])({url:"/questionAnswer/index",method:"get",params:t})}function i(t){return Object(r["a"])({url:"/questionAnswer/read",method:"get",params:{id:t}})}function a(t){return Object(r["a"])({url:"/questionAnswer/save",method:"post",data:t})}function s(t){return Object(r["a"])({url:"/questionAnswer/update?id="+t.id,method:"post",data:t})}function c(t){return Object(r["a"])({url:"/questionAnswer/delete?id="+t,method:"get"})}},3123:function(t,e,n){"use strict";n.d(e,"a",(function(){return o})),n.d(e,"b",(function(){return i}));var r=n("b775");function o(t){return Object(r["a"])({url:"/upload/upload",method:"post",data:t})}function i(t){return Object(r["a"])({url:"/upload/uploadVideo",method:"post",data:t})}},"408a":function(t,e,n){var r=n("c6b6");t.exports=function(t){if("number"!=typeof t&&"Number"!=r(t))throw TypeError("Incorrect invocation");return+t}},"6a64":function(t,e,n){},"7ea0":function(t,e,n){"use strict";var r=n("6a64"),o=n.n(r);o.a},"828d":function(t,e,n){"use strict";n.d(e,"a",(function(){return o}));var r=n("b775");function o(t){return Object(r["a"])({url:"/vue-element-admin/search/user",method:"get",params:{name:t}})}},9219:function(t,e,n){"use strict";n.r(e);var r=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("article-detail",{attrs:{"is-edit":!1}})},o=[],i=n("febc"),a={name:"CreateArticle",components:{ArticleDetail:i["a"]}},s=a,c=n("2877"),u=Object(c["a"])(s,r,o,!1,null,null,null);e["default"]=u.exports},a9e3:function(t,e,n){"use strict";var r=n("83ab"),o=n("da84"),i=n("94ca"),a=n("6eeb"),s=n("5135"),c=n("c6b6"),u=n("7156"),l=n("c04e"),f=n("d039"),d=n("7c73"),m=n("241c").f,p=n("06cf").f,h=n("9bf2").f,b=n("58a8").trim,g="Number",v=o[g],w=v.prototype,F=c(d(w))==g,y=function(t){var e,n,r,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(n=u.charCodeAt(2),88===n||120===n)return NaN}else if(48===e){switch(u.charCodeAt(1)){case 66:case 98:r=2,o=49;break;case 79:case 111:r=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,r)}return+u};if(i(g,!v(" 0o1")||!v("0b1")||v("+0x1"))){for(var A,N=function(t){var e=arguments.length<1?0:t,n=this;return n instanceof N&&(F?f((function(){w.valueOf.call(n)})):c(n)!=g)?u(new v(y(e)),n,N):y(e)},E=r?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,A=E[I])&&!s(N,A)&&h(N,A,p(v,A));N.prototype=w,w.constructor=N,a(o,g,N)}},b680:function(t,e,n){"use strict";var r=n("23e7"),o=n("a691"),i=n("408a"),a=n("1148"),s=n("d039"),c=1..toFixed,u=Math.floor,l=function(t,e,n){return 0===e?n:e%2===1?l(t,e-1,n*t):l(t*t,e/2,n)},f=function(t){var e=0,n=t;while(n>=4096)e+=12,n/=4096;while(n>=2)e+=1,n/=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({})}));r({target:"Number",proto:!0,forced:d},{toFixed:function(t){var e,n,r,s,c=i(this),d=o(t),m=[0,0,0,0,0,0],p="",h="0",b=function(t,e){var n=-1,r=e;while(++n<6)r+=t*m[n],m[n]=r%1e7,r=u(r/1e7)},g=function(t){var e=6,n=0;while(--e>=0)n+=m[e],m[e]=u(n/t),n=n%t*1e7},v=function(){var t=6,e="";while(--t>=0)if(""!==e||0===t||0!==m[t]){var n=String(m[t]);e=""===e?n:e+a.call("0",7-n.length)+n}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,n=e<0?c*l(2,-e,1):c/l(2,e,1),n*=4503599627370496,e=52-e,e>0){b(0,n),r=d;while(r>=7)b(1e7,0),r-=7;b(l(10,r,1),0),r=e-1;while(r>=23)g(1<<23),r-=23;g(1<<r),b(1,1),g(2),h=v()}else b(0,n),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,n){"use strict";n.d(e,"a",(function(){return i}));n("a4d3"),n("e01a"),n("d28b"),n("d3b7"),n("3ca3"),n("ddb0"),n("a630"),n("fb6a"),n("b0c0"),n("25f0");function r(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function o(t,e){if(t){if("string"===typeof t)return r(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?r(t,e):void 0}}function i(t,e){var n;if("undefined"===typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(n=o(t))||e&&t&&"number"===typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},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(){n=t[Symbol.iterator]()},n:function(){var t=n.next();return s=t.done,t},e:function(t){c=!0,a=t},f:function(){try{s||null==n["return"]||n["return"]()}finally{if(c)throw a}}}}},febc:function(t,e,n){"use strict";var r=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"createPost-container"},[n("el-form",{ref:"postForm",staticClass:"form-container",attrs:{"label-position":t.labelPosition,model:t.postForm,rules:t.rules}},[n("div",{staticClass:"createPost-main-container"},[n("el-form-item",{attrs:{prop:"question",label:"问题"}},[n("el-input",{staticStyle:{width:"300px"},attrs:{placeholder:""},model:{value:t.postForm.question,callback:function(e){t.$set(t.postForm,"question",e)},expression:"postForm.question"}})],1),n("el-form-item",{attrs:{prop:"content",label:"回答"}},[n("Tinymce",{ref:"editor",attrs:{height:400},model:{value:t.postForm.answer,callback:function(e){t.$set(t.postForm,"answer",e)},expression:"postForm.answer"}})],1),n("el-form-item",{attrs:{prop:"sort",label:"排序"}},[n("el-input",{staticStyle:{width:"100px"},attrs:{placeholder:""},model:{value:t.postForm.sort,callback:function(e){t.$set(t.postForm,"sort",e)},expression:"postForm.sort"}})],1),n("el-row",[t.isEdit?t._e():n("el-button",{directives:[{name:"loading",rawName:"v-loading",value:t.loading,expression:"loading"}],attrs:{type:"success"},on:{click:t.submitForm}},[t._v(" 提交 ")]),t.isEdit?n("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=(n("d81d"),n("b0c0"),n("8256")),a=n("2ac8"),s=n("828d"),c={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},u={name:"ArticleDetail",components:{Tinymce:i["a"]},props:{isEdit:{type:Boolean,default:!1}},data:function(){var t=this,e=function(e,n,r){""===n?(t.$message({message:e.field+"为必传项",type:"error"}),r(new Error(e.field+"为必传项"))):r()};return{postForm:Object.assign({},c),loading:!1,userListOptions:[],rules:{sort:[{message:"排序不为空",validator:e}],question:[{message:"问题不为空",validator:e}],answer:[{message:"回答不为空",validator:e}]},tempRoute:{},labelPosition:"top"}},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(a["d"])(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(a["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("/question/list")}))}))},updateArticle:function(){var t=this;console.log(this.postForm),Object(a["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("/question/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(s["a"])(t).then((function(t){t.data.items&&(e.userListOptions=t.data.items.map((function(t){return t.name})))}))}}},l=u,f=(n("7ea0"),n("2877")),d=Object(f["a"])(l,r,o,!1,null,"0521b84a",null);e["a"]=d.exports}}]);