chunk-695bf22f.95e1b087.js 15 KB

1
  1. (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-695bf22f"],{"0334":function(e,t,a){"use strict";var n=a("c02e"),i=a.n(n);i.a},"093a":function(e,t,a){"use strict";a.d(t,"c",(function(){return i})),a.d(t,"d",(function(){return o})),a.d(t,"a",(function(){return r})),a.d(t,"e",(function(){return l})),a.d(t,"b",(function(){return s}));var n=a("b775");function i(e){return Object(n["a"])({url:"/video/index",method:"get",params:e})}function o(e){return Object(n["a"])({url:"/video/read",method:"get",params:{id:e}})}function r(e){return Object(n["a"])({url:"/video/save",method:"post",data:e})}function l(e){return Object(n["a"])({url:"/video/update?id="+e.id,method:"post",data:e})}function s(e){return Object(n["a"])({url:"/video/delete?id="+e,method:"get"})}},"1aba":function(e,t,a){"use strict";var n=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"material-input__component",class:e.computedClasses},[a("div",{class:{iconClass:e.icon}},[e.icon?a("i",{staticClass:"el-input__icon material-input__icon",class:["el-icon-"+e.icon]}):e._e(),"email"===e.type?a("input",{directives:[{name:"model",rawName:"v-model",value:e.currentValue,expression:"currentValue"}],staticClass:"material-input",attrs:{name:e.name,placeholder:e.fillPlaceHolder,readonly:e.readonly,disabled:e.disabled,autocomplete:e.autoComplete,required:e.required,type:"email"},domProps:{value:e.currentValue},on:{focus:e.handleMdFocus,blur:e.handleMdBlur,input:[function(t){t.target.composing||(e.currentValue=t.target.value)},e.handleModelInput]}}):e._e(),"url"===e.type?a("input",{directives:[{name:"model",rawName:"v-model",value:e.currentValue,expression:"currentValue"}],staticClass:"material-input",attrs:{name:e.name,placeholder:e.fillPlaceHolder,readonly:e.readonly,disabled:e.disabled,autocomplete:e.autoComplete,required:e.required,type:"url"},domProps:{value:e.currentValue},on:{focus:e.handleMdFocus,blur:e.handleMdBlur,input:[function(t){t.target.composing||(e.currentValue=t.target.value)},e.handleModelInput]}}):e._e(),"number"===e.type?a("input",{directives:[{name:"model",rawName:"v-model",value:e.currentValue,expression:"currentValue"}],staticClass:"material-input",attrs:{name:e.name,placeholder:e.fillPlaceHolder,step:e.step,readonly:e.readonly,disabled:e.disabled,autocomplete:e.autoComplete,max:e.max,min:e.min,minlength:e.minlength,maxlength:e.maxlength,required:e.required,type:"number"},domProps:{value:e.currentValue},on:{focus:e.handleMdFocus,blur:e.handleMdBlur,input:[function(t){t.target.composing||(e.currentValue=t.target.value)},e.handleModelInput]}}):e._e(),"password"===e.type?a("input",{directives:[{name:"model",rawName:"v-model",value:e.currentValue,expression:"currentValue"}],staticClass:"material-input",attrs:{name:e.name,placeholder:e.fillPlaceHolder,readonly:e.readonly,disabled:e.disabled,autocomplete:e.autoComplete,max:e.max,min:e.min,required:e.required,type:"password"},domProps:{value:e.currentValue},on:{focus:e.handleMdFocus,blur:e.handleMdBlur,input:[function(t){t.target.composing||(e.currentValue=t.target.value)},e.handleModelInput]}}):e._e(),"tel"===e.type?a("input",{directives:[{name:"model",rawName:"v-model",value:e.currentValue,expression:"currentValue"}],staticClass:"material-input",attrs:{name:e.name,placeholder:e.fillPlaceHolder,readonly:e.readonly,disabled:e.disabled,autocomplete:e.autoComplete,required:e.required,type:"tel"},domProps:{value:e.currentValue},on:{focus:e.handleMdFocus,blur:e.handleMdBlur,input:[function(t){t.target.composing||(e.currentValue=t.target.value)},e.handleModelInput]}}):e._e(),"text"===e.type?a("input",{directives:[{name:"model",rawName:"v-model",value:e.currentValue,expression:"currentValue"}],staticClass:"material-input",attrs:{name:e.name,placeholder:e.fillPlaceHolder,readonly:e.readonly,disabled:e.disabled,autocomplete:e.autoComplete,minlength:e.minlength,maxlength:e.maxlength,required:e.required,type:"text"},domProps:{value:e.currentValue},on:{focus:e.handleMdFocus,blur:e.handleMdBlur,input:[function(t){t.target.composing||(e.currentValue=t.target.value)},e.handleModelInput]}}):e._e(),a("span",{staticClass:"material-input-bar"}),a("label",{staticClass:"material-label"},[e._t("default")],2)])])},i=[],o=(a("a9e3"),{name:"MdInput",props:{icon:String,name:String,type:{type:String,default:"text"},value:[String,Number],placeholder:String,readonly:Boolean,disabled:Boolean,min:String,max:String,step:String,minlength:Number,maxlength:Number,required:{type:Boolean,default:!0},autoComplete:{type:String,default:"off"},validateEvent:{type:Boolean,default:!0}},data:function(){return{currentValue:this.value,focus:!1,fillPlaceHolder:null}},computed:{computedClasses:function(){return{"material--active":this.focus,"material--disabled":this.disabled,"material--raised":Boolean(this.focus||this.currentValue)}}},watch:{value:function(e){this.currentValue=e}},methods:{handleModelInput:function(e){var t=e.target.value;this.$emit("input",t),"ElFormItem"===this.$parent.$options.componentName&&this.validateEvent&&this.$parent.$emit("el.form.change",[t]),this.$emit("change",t)},handleMdFocus:function(e){this.focus=!0,this.$emit("focus",e),this.placeholder&&""!==this.placeholder&&(this.fillPlaceHolder=this.placeholder)},handleMdBlur:function(e){this.focus=!1,this.$emit("blur",e),this.fillPlaceHolder=null,"ElFormItem"===this.$parent.$options.componentName&&this.validateEvent&&this.$parent.$emit("el.form.blur",[this.currentValue])}}}),r=o,l=(a("49b7"),a("2877")),s=Object(l["a"])(r,n,i,!1,null,"9d7baaf6",null);t["a"]=s.exports},3123:function(e,t,a){"use strict";a.d(t,"a",(function(){return i})),a.d(t,"b",(function(){return o}));var n=a("b775");function i(e){return Object(n["a"])({url:"/upload/upload",method:"post",data:e})}function o(e){return Object(n["a"])({url:"/upload/uploadVideo",method:"post",data:e})}},"49b7":function(e,t,a){"use strict";var n=a("6312"),i=a.n(n);i.a},"52b4":function(e,t,a){},6312:function(e,t,a){},"70a2":function(e,t,a){"use strict";var n=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"upload-container"},[a("el-upload",{staticClass:"image-uploader",attrs:{data:e.dataObj,multiple:!1,"show-file-list":!1,"on-success":e.handleImageSuccess,drag:"",action:"#","http-request":e.uploadImage}},[a("i",{staticClass:"el-icon-upload"}),a("div",{staticClass:"el-upload__text"},[e._v(" 将文件拖到此处,或"),a("em",[e._v("点击上传")])])]),a("div",{staticClass:"image-preview"},[a("div",{directives:[{name:"show",rawName:"v-show",value:e.coverImg.length>1,expression:"coverImg.length>1"}],staticClass:"image-preview-wrapper"},[a("img",{attrs:{src:e.coverImg}}),a("div",{staticClass:"image-preview-action"},[a("i",{staticClass:"el-icon-delete",on:{click:e.rmImage}})])])])],1)},i=[],o=a("3123"),r={name:"SingleImageUpload3",props:{value:{type:String,default:""}},data:function(){return{tempUrl:"",dataObj:{token:"",key:""},imgUrl:this.value}},computed:{coverImg:function(){return this.value}},methods:{rmImage:function(){this.emitInput("")},emitInput:function(e){this.$emit("input",e)},handleImageSuccess:function(e){this.emitInput(this.imgUrl)},beforeUpload:function(e){var t="image/jpeg"===e.type||"image/jpg",a=e.size/1024/1024<5;return t||this.$message.error("上传文件只能是图片格式!"),a||this.$message.error("上传文件大小不能超过 5MB!"),t&&a},uploadImage:function(e){var t=this,a=new FormData;a.append("image",e.file),Object(o["a"])(a).then((function(a){console.log("上传图片成功"),t.imgUrl=a.data.url,e.onSuccess()})).catch((function(t){console.log("图片上传失败"),e.onError()}))}}},l=r,s=(a("c9b1"),a("2877")),u=Object(s["a"])(l,n,i,!1,null,"2ed9e5e2",null);t["a"]=u.exports},"828d":function(e,t,a){"use strict";a.d(t,"a",(function(){return i}));var n=a("b775");function i(e){return Object(n["a"])({url:"/vue-element-admin/search/user",method:"get",params:{name:e}})}},a9e3:function(e,t,a){"use strict";var n=a("83ab"),i=a("da84"),o=a("94ca"),r=a("6eeb"),l=a("5135"),s=a("c6b6"),u=a("7156"),c=a("c04e"),d=a("d039"),m=a("7c73"),p=a("241c").f,f=a("06cf").f,h=a("9bf2").f,g=a("58a8").trim,v="Number",b=i[v],_=b.prototype,y=s(m(_))==v,F=function(e){var t,a,n,i,o,r,l,s,u=c(e,!1);if("string"==typeof u&&u.length>2)if(u=g(u),t=u.charCodeAt(0),43===t||45===t){if(a=u.charCodeAt(2),88===a||120===a)return NaN}else if(48===t){switch(u.charCodeAt(1)){case 66:case 98:n=2,i=49;break;case 79:case 111:n=8,i=55;break;default:return+u}for(o=u.slice(2),r=o.length,l=0;l<r;l++)if(s=o.charCodeAt(l),s<48||s>i)return NaN;return parseInt(o,n)}return+u};if(o(v,!b(" 0o1")||!b("0b1")||b("+0x1"))){for(var I,w=function(e){var t=arguments.length<1?0:e,a=this;return a instanceof w&&(y?d((function(){_.valueOf.call(a)})):s(a)!=v)?u(new b(F(t)),a,w):F(t)},x=n?p(b):"MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,EPSILON,isFinite,isInteger,isNaN,isSafeInteger,MAX_SAFE_INTEGER,MIN_SAFE_INTEGER,parseFloat,parseInt,isInteger".split(","),C=0;x.length>C;C++)l(b,I=x[C])&&!l(w,I)&&h(w,I,f(b,I));w.prototype=_,_.constructor=w,r(i,v,w)}},be67:function(e,t,a){"use strict";var n=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"createPost-container"},[a("el-form",{ref:"postForm",staticClass:"form-container",attrs:{model:e.postForm,rules:e.rules}},[a("div",{staticClass:"createPost-main-container"},[a("el-row",[a("el-col",{attrs:{span:24}},[a("el-form-item",{staticStyle:{"margin-bottom":"40px"},attrs:{prop:"title"}},[a("MDinput",{attrs:{maxlength:50,name:"name",required:""},model:{value:e.postForm.title,callback:function(t){e.$set(e.postForm,"title",t)},expression:"postForm.title"}},[e._v(" 短视频标题 ")])],1)],1)],1),a("el-row",[a("div",{staticStyle:{"margin-bottom":"10px"}},[e._v("短视频描述")]),a("el-form-item",{attrs:{label:"",prop:"desc"}},[a("el-input",{attrs:{type:"textarea"},model:{value:e.postForm.desc,callback:function(t){e.$set(e.postForm,"desc",t)},expression:"postForm.desc"}})],1)],1),a("el-row",[a("div",{staticStyle:{"margin-bottom":"10px"}},[e._v("封面图")]),a("el-form-item",{staticStyle:{"margin-bottom":"30px"},attrs:{prop:"cover_img"}},[a("Upload",{model:{value:e.postForm.cover_img,callback:function(t){e.$set(e.postForm,"cover_img",t)},expression:"postForm.cover_img"}})],1)],1),a("el-row",[a("div",{staticStyle:{"margin-bottom":"10px"}},[e._v("短视频")]),a("el-form-item",{attrs:{prop:"video_url"}},[a("VideoUpload",{model:{value:e.postForm.video_url,callback:function(t){e.$set(e.postForm,"video_url",t)},expression:"postForm.video_url"}})],1)],1),a("el-row",[e.isEdit?e._e():a("el-button",{directives:[{name:"loading",rawName:"v-loading",value:e.loading,expression:"loading"}],attrs:{type:"success"},on:{click:e.submitForm}},[e._v(" 提交 ")]),e.isEdit?a("el-button",{directives:[{name:"loading",rawName:"v-loading",value:e.loading,expression:"loading"}],attrs:{type:"success"},on:{click:e.updateArticle}},[e._v(" 修改 ")]):e._e()],1)],1)])],1)},i=[],o=(a("d81d"),a("b0c0"),a("70a2")),r=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"upload-container"},[a("el-upload",{staticClass:"image-uploader",attrs:{data:e.dataObj,multiple:!1,"show-file-list":!1,"on-success":e.handleImageSuccess,drag:"",action:"#","http-request":e.uploadVideoHandle}},[a("i",{staticClass:"el-icon-upload"}),a("div",{staticClass:"el-upload__text"},[e._v(" 将文件拖到此处,或"),a("em",[e._v("点击上传")])])]),a("div",{staticClass:"image-preview"},[a("div",{directives:[{name:"show",rawName:"v-show",value:e.imageUrl.length>1,expression:"imageUrl.length>1"}],staticClass:"image-preview-wrapper",staticStyle:{"line-height":"0"}},[a("video",{staticStyle:{width:"375px"},attrs:{src:e.imageUrl,controls:""}})])]),a("i",{staticClass:"el-icon-delete",staticStyle:{"font-size":"36px",margin:"0 10px"},on:{click:e.rmImage}})],1)},l=[],s=a("3123"),u={name:"SingleVideoUpload",props:{value:{type:String,default:""}},data:function(){return{tempUrl:"",dataObj:{token:"",key:""}}},computed:{imageUrl:function(){return this.value}},methods:{rmImage:function(){this.emitInput("")},emitInput:function(e){this.$emit("input",e)},handleImageSuccess:function(){this.emitInput(this.imgUrl)},beforeUpload:function(){},uploadVideoHandle:function(e){var t=this,a=new FormData;a.append("file",e.file),Object(s["b"])(a).then((function(a){console.log("上传视频成功"),t.imgUrl=a.data.url,e.onSuccess()})).catch((function(t){console.log("视频上传失败"),e.onError()}))}}},c=u,d=(a("0334"),a("2877")),m=Object(d["a"])(c,r,l,!1,null,"bf393afe",null),p=m.exports,f=a("1aba"),h=a("093a"),g=a("828d"),v={status:"draft",title:"",content:"",desc:"",video_url:"",cover_img:"",display_time:void 0,id:void 0,platforms:["a-platform"],comment_disabled:!1,importance:0},b={name:"ArticleDetail",components:{MDinput:f["a"],Upload:o["a"],VideoUpload:p},props:{isEdit:{type:Boolean,default:!1}},data:function(){var e=function(e,t,a){console.log(e),""===t?a(new Error(e.field+"为必传项")):a()};return{postForm:Object.assign({},v),loading:!1,userListOptions:[],rules:{cover_img:[{message:"封面图不为空",validator:e}],title:[{message:"标题不为空",validator:e}],desc:[{message:"描述不为空",validator:e}],video_url:[{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(e){this.postForm.display_time=new Date(e)}}},created:function(){if(this.isEdit){var e=this.$route.params&&this.$route.params.id;this.fetchData(e)}this.tempRoute=Object.assign({},this.$route)},methods:{fetchData:function(e){var t=this;Object(h["d"])(e).then((function(e){t.postForm=e.data.info})).catch((function(e){console.log(e)}))},setPageTitle:function(){var e="Edit Article";document.title="".concat(e," - ").concat(this.postForm.id)},submitForm:function(){var e=this;this.$refs.postForm.validate((function(t){if(!t)return console.log("error submit!!"),!1;e.loading=!0,console.log(e.postForm),Object(h["a"])(e.postForm).then((function(t){e.$notify({title:"成功",message:"发布短视频成功",type:"success",duration:2e3}),e.postForm.status="published",e.loading=!1,e.listLoading=!1,e.$router.push("/video/list")}))}))},updateArticle:function(){var e=this;console.log(this.postForm),Object(h["e"])(this.postForm).then((function(t){e.$notify({title:"修改",message:"修改短视频成功",type:"success",duration:2e3}),e.postForm.status="published",e.loading=!1,e.listLoading=!1,e.$router.push("/video/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(e){var t=this;Object(g["a"])(e).then((function(e){e.data.items&&(t.userListOptions=e.data.items.map((function(e){return e.name})))}))}}},_=b,y=(a("cb81"),Object(d["a"])(_,n,i,!1,null,"1fce8187",null));t["a"]=y.exports},c02e:function(e,t,a){},c9b1:function(e,t,a){"use strict";var n=a("52b4"),i=a.n(n);i.a},cb81:function(e,t,a){"use strict";var n=a("daa0"),i=a.n(n);i.a},daa0:function(e,t,a){}}]);