5.60b78efc9110b7c770f7.js 6.1 KB

12
  1. webpackJsonp([5],{"73Qs":function(e,t){},Tkas:function(e,t){},bjEj:function(e,t,s){"use strict";var r=s("woOf"),i=s.n(r),a=s("TZVV"),l=s("7+uW");s("i3rX");const n=Object.prototype.hasOwnProperty;const o=/(%|)\{([0-9a-zA-Z_]+)\}/g;l.default;var d={name:"ElPageHeader",props:{title:{type:String,default:function(){return"返回"}},content:String}},m={render:function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"el-page-header"},[s("div",{staticClass:"el-page-header__left",on:{click:function(t){e.$emit("back")}}},[s("i",{staticClass:"el-icon-back"}),e._v(" "),s("div",{staticClass:"el-page-header__title"},[e._t("title",[e._v(e._s(e.title))])],2)]),e._v(" "),s("div",{staticClass:"el-page-header__content"},[e._t("content",[e._v(e._s(e.content))])],2)])},staticRenderFns:[]};var u=s("VU/8")(d,m,!1,function(e){s("rD4Q")},"data-v-7d93d4ae",null).exports,c=s("Mdfv"),v=[{label:"PC首页轮播",value:0},{label:"APP首页轮播",value:1}],p={name:null,type:1,pic:null,startTime:null,endTime:null,status:0,url:null,note:null,sort:0},h={name:"HomeAdvertiseDetail",components:{SingleUpload:a.a,pageHeader:u},props:{isEdit:{type:Boolean,default:!1}},data:function(){return{homeAdvertise:null,rules:{name:[{required:!0,message:"请输入广告名称",trigger:"blur"},{min:2,max:140,message:"长度在 2 到 140 个字符",trigger:"blur"}],url:[{required:!0,message:"请输入广告链接",trigger:"blur"}],startTime:[{required:!0,message:"请选择开始时间",trigger:"blur"}],endTime:[{required:!0,message:"请选择到期时间",trigger:"blur"}],pic:[{required:!0,message:"请选择广告图片",trigger:"blur"}]},typeOptions:i()({},v)}},created:function(){var e=this;this.isEdit?Object(c.d)(this.$route.query.id).then(function(t){e.homeAdvertise=t.data}):this.homeAdvertise=i()({},p)},methods:{onSubmit:function(e){var t=this;this.$refs[e].validate(function(s){if(!s)return t.$message({message:"验证失败",type:"error",duration:1e3}),!1;t.$confirm("是否提交数据","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then(function(){t.isEdit?Object(c.e)(t.$route.query.id,t.homeAdvertise).then(function(s){t.$refs[e].resetFields(),t.$message({message:"修改成功",type:"success",duration:1e3}),t.$router.back()}):Object(c.a)(t.homeAdvertise).then(function(s){t.$refs[e].resetFields(),t.homeAdvertise=i()({},p),t.$message({message:"提交成功",type:"success",duration:1e3})})})})},resetForm:function(e){this.$refs[e].resetFields(),this.homeAdvertise=i()({},p)},goBack:function(){this.$router.push("/sms/advertise")}}},f={render:function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",[s("pageHeader",{attrs:{content:e.isEdit?e.homeAdvertise.name:"新增广告"},on:{back:e.goBack}}),e._v(" "),s("el-card",{staticClass:"form-container",attrs:{shadow:"never"}},[s("el-form",{ref:"homeAdvertiseFrom",attrs:{model:e.homeAdvertise,rules:e.rules,"label-width":"150px",size:"small"}},[s("el-form-item",{attrs:{label:"广告名称:",prop:"name"}},[s("el-input",{staticClass:"input-width",model:{value:e.homeAdvertise.name,callback:function(t){e.$set(e.homeAdvertise,"name",t)},expression:"homeAdvertise.name"}})],1),e._v(" "),s("el-form-item",{attrs:{label:"广告位置:"}},[s("el-select",{model:{value:e.homeAdvertise.type,callback:function(t){e.$set(e.homeAdvertise,"type",t)},expression:"homeAdvertise.type"}},e._l(e.typeOptions,function(e){return s("el-option",{key:e.value,attrs:{label:e.label,value:e.value}})}))],1),e._v(" "),s("el-form-item",{attrs:{label:"开始时间:",prop:"startTime"}},[s("el-date-picker",{attrs:{type:"datetime",placeholder:"选择日期"},model:{value:e.homeAdvertise.startTime,callback:function(t){e.$set(e.homeAdvertise,"startTime",t)},expression:"homeAdvertise.startTime"}})],1),e._v(" "),s("el-form-item",{attrs:{label:"到期时间:",prop:"endTime"}},[s("el-date-picker",{attrs:{type:"datetime",placeholder:"选择日期"},model:{value:e.homeAdvertise.endTime,callback:function(t){e.$set(e.homeAdvertise,"endTime",t)},expression:"homeAdvertise.endTime"}})],1),e._v(" "),s("el-form-item",{attrs:{label:"上线/下线:",prop:"status"}},[s("el-radio-group",{model:{value:e.homeAdvertise.status,callback:function(t){e.$set(e.homeAdvertise,"status",t)},expression:"homeAdvertise.status"}},[s("el-radio",{attrs:{label:0}},[e._v("下线")]),e._v(" "),s("el-radio",{attrs:{label:1}},[e._v("上线")])],1)],1),e._v(" "),s("el-form-item",{attrs:{label:"广告图片:",prop:"pic"}},[s("single-upload",{model:{value:e.homeAdvertise.pic,callback:function(t){e.$set(e.homeAdvertise,"pic",t)},expression:"homeAdvertise.pic"}})],1),e._v(" "),s("el-form-item",{attrs:{label:"排序:"}},[s("el-input",{staticClass:"input-width",model:{value:e.homeAdvertise.sort,callback:function(t){e.$set(e.homeAdvertise,"sort",t)},expression:"homeAdvertise.sort"}})],1),e._v(" "),s("el-form-item",{attrs:{label:"广告链接:"}},[s("el-input",{staticClass:"input-width",model:{value:e.homeAdvertise.url,callback:function(t){e.$set(e.homeAdvertise,"url",t)},expression:"homeAdvertise.url"}})],1),e._v(" "),s("el-form-item",{attrs:{label:"广告备注:"}},[s("el-input",{staticClass:"input-width",attrs:{type:"textarea",rows:5,placeholder:"请输入内容"},model:{value:e.homeAdvertise.note,callback:function(t){e.$set(e.homeAdvertise,"note",t)},expression:"homeAdvertise.note"}})],1),e._v(" "),s("el-form-item",[s("el-button",{attrs:{type:"primary"},on:{click:function(t){e.onSubmit("homeAdvertiseFrom")}}},[e._v("提交")]),e._v(" "),e.isEdit?e._e():s("el-button",{on:{click:function(t){e.resetForm("homeAdvertiseFrom")}}},[e._v("重置")])],1)],1)],1)],1)},staticRenderFns:[]};var b=s("VU/8")(h,f,!1,function(e){s("Tkas")},"data-v-a87002c8",null);t.a=b.exports},lV95:function(e,t,s){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r={name:"updateHomeAdvertise",components:{HomeAdvertiseDetail:s("bjEj").a}},i={render:function(){var e=this.$createElement;return(this._self._c||e)("home-advertise-detail",{attrs:{isEdit:!0}})},staticRenderFns:[]};var a=s("VU/8")(r,i,!1,function(e){s("73Qs")},null,null);t.default=a.exports},rD4Q:function(e,t){}});
  2. //# sourceMappingURL=5.60b78efc9110b7c770f7.js.map