(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-2d222cbd"],{cfae:function(t,e,o){"use strict";o.r(e);var a=function(){var t=this,e=t.$createElement,o=t._self._c||e;return o("div",{staticClass:"app-container"},[o("div",{staticClass:"app-form"},[o("el-form",{ref:"dataForm",attrs:{rules:t.rules,model:t.form,"label-position":"right","label-width":"200px"}},[o("div",{staticClass:"app-form-group"},[o("div",{staticClass:"app-form-ti"},[t._v("基本设置")]),o("div",{staticClass:"padding-top-lg"},[o("el-form-item",{attrs:{label:"视频标题",prop:"title"}},[o("el-input",{staticClass:"form-input",model:{value:t.form.title,callback:function(e){t.$set(t.form,"title",e)},expression:"form.title"}})],1),o("el-form-item",{attrs:{label:"视频分类",prop:"category_id"}},[o("el-select",{staticClass:"form-input",attrs:{placeholder:"选择分类"},model:{value:t.form.category_id,callback:function(e){t.$set(t.form,"category_id",e)},expression:"form.category_id"}},[o("el-option",{attrs:{value:0,label:"选择分类"}}),t._l(t.category,(function(t,e){return o("el-option",{key:e,attrs:{value:t.id,label:t.title}})}))],2)],1),o("el-form-item",{attrs:{label:"视频图片",prop:"thumb"}},[o("uploadImage",{attrs:{modal:!0},model:{value:t.form.thumb,callback:function(e){t.$set(t.form,"thumb",e)},expression:"form.thumb"}})],1),o("el-form-item",{attrs:{label:"浏览量",prop:"browse"}},[o("el-input",{staticClass:"form-input",model:{value:t.form.browse,callback:function(e){t.$set(t.form,"browse",t._n(e))},expression:"form.browse"}})],1),o("el-form-item",{attrs:{label:"类型",prop:"type"}},[o("el-radio-group",{model:{value:t.form.type,callback:function(e){t.$set(t.form,"type",e)},expression:"form.type"}},[o("el-radio",{attrs:{label:1}},[t._v("上传视频")]),o("el-radio",{attrs:{label:2}},[t._v("视频链接")])],1)],1),o("el-form-item",{attrs:{label:"状态",prop:"status"}},[o("el-radio-group",{model:{value:t.form.status,callback:function(e){t.$set(t.form,"status",e)},expression:"form.status"}},[o("el-radio",{attrs:{label:1}},[t._v("正常")]),o("el-radio",{attrs:{label:0}},[t._v("禁用")])],1)],1),2==t.form.type?o("el-form-item",{attrs:{label:"视频链接",prop:"link"}},[o("el-input",{staticClass:"form-input",model:{value:t.form.link,callback:function(e){t.$set(t.form,"link",t._n(e))},expression:"form.link"}})],1):t._e(),1==t.form.type?o("el-form-item",{attrs:{label:"视频内容",prop:"content"}},[o("uploadImage",{attrs:{modal:!0,type:2},model:{value:t.form.content,callback:function(e){t.$set(t.form,"content",e)},expression:"form.content"}})],1):t._e()],1)]),o("div",{staticClass:"padding-xl flex justify-center"},[o("el-button",{on:{click:t.onBack}},[t._v("返回")]),o("el-button",{attrs:{type:"primary"},on:{click:function(e){return t.submit()}}},[t._v("提交")])],1)])],1),o("copyright")],1)},r=[],l=o("7f70"),i=o("8327"),s=o("095c"),n=o("c7f0"),c={name:"VideoPost",components:{editor:s["a"],uploadImage:n["a"]},data:function(){return{rules:{title:[{required:!0,message:"请输入视频标题",trigger:"blur"}]},form:{},id:"",category:[]}},computed:Object(l["a"])({},Object(i["b"])(["config"])),created:function(){this.$route.query.id&&(this.id=this.$route.query.id),this.resetForm(),this.init()},methods:{init:function(){var t=this;this.api.get("news/video/detail",{id:this.id}).then((function(e){1==e.code&&(t.form=e.data)})),this.api.get("news/category/all",{type:2}).then((function(e){1==e.code&&(t.category=e.data.list)}))},onBack:function(){this.$router.go(-1)},submit:function(){var t=this;this.$refs["dataForm"].validate((function(e){e&&t.api.post("news/video/post",t.form).then((function(e){1==e.code?(t.$util.success(e.message),t.resetForm(),t.onBack()):t.$util.error(e.message)}))}))},resetForm:function(){this.form={title:"",status:1,type:1,thumb:"",content:"",link:"",browse:"",category_id:0}}}},m=c,u=o("3d7a"),f=Object(u["a"])(m,a,r,!1,null,null,null);e["default"]=f.exports}}]);