3.af91a9bd3e0f1276ce1e.js 6.1 KB

12
  1. webpackJsonp([3],{"3Djd":function(e,t){},M48v:function(e,t){},bjEj:function(e,t,r){"use strict";var s=r("woOf"),i=r.n(s),a=r("TZVV"),l=r("7+uW");r("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,r=e._self._c||t;return r("div",{staticClass:"el-page-header"},[r("div",{staticClass:"el-page-header__left",on:{click:function(t){e.$emit("back")}}},[r("i",{staticClass:"el-icon-back"}),e._v(" "),r("div",{staticClass:"el-page-header__title"},[e._t("title",[e._v(e._s(e.title))])],2)]),e._v(" "),r("div",{staticClass:"el-page-header__content"},[e._t("content",[e._v(e._s(e.content))])],2)])},staticRenderFns:[]};var u=r("VU/8")(d,m,!1,function(e){r("3Djd")},"data-v-724efcbc",null).exports,c=r("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:{name:""},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(r){if(!r)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(r){t.$refs[e].resetFields(),t.$message({message:"修改成功",type:"success",duration:1e3}),t.$router.back()}):Object(c.a)(t.homeAdvertise).then(function(r){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,r=e._self._c||t;return r("div",[r("pageHeader",{attrs:{content:e.isEdit?e.homeAdvertise.name:"新增广告"},on:{back:e.goBack}}),e._v(" "),r("el-card",{staticClass:"form-container",attrs:{shadow:"never"}},[r("el-form",{ref:"homeAdvertiseFrom",attrs:{model:e.homeAdvertise,rules:e.rules,"label-width":"150px",size:"small"}},[r("el-form-item",{attrs:{label:"广告名称:",prop:"name"}},[r("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(" "),r("el-form-item",{attrs:{label:"广告位置:"}},[r("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 r("el-option",{key:e.value,attrs:{label:e.label,value:e.value}})}))],1),e._v(" "),r("el-form-item",{attrs:{label:"开始时间:",prop:"startTime"}},[r("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(" "),r("el-form-item",{attrs:{label:"到期时间:",prop:"endTime"}},[r("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(" "),r("el-form-item",{attrs:{label:"上线/下线:",prop:"status"}},[r("el-radio-group",{model:{value:e.homeAdvertise.status,callback:function(t){e.$set(e.homeAdvertise,"status",t)},expression:"homeAdvertise.status"}},[r("el-radio",{attrs:{label:0}},[e._v("下线")]),e._v(" "),r("el-radio",{attrs:{label:1}},[e._v("上线")])],1)],1),e._v(" "),r("el-form-item",{attrs:{label:"广告图片:",prop:"pic"}},[r("single-upload",{model:{value:e.homeAdvertise.pic,callback:function(t){e.$set(e.homeAdvertise,"pic",t)},expression:"homeAdvertise.pic"}})],1),e._v(" "),r("el-form-item",{attrs:{label:"排序:"}},[r("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(" "),r("el-form-item",{attrs:{label:"广告链接:"}},[r("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(" "),r("el-form-item",{attrs:{label:"广告备注:"}},[r("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(" "),r("el-form-item",[r("el-button",{attrs:{type:"primary"},on:{click:function(t){e.onSubmit("homeAdvertiseFrom")}}},[e._v("提交")]),e._v(" "),e.isEdit?e._e():r("el-button",{on:{click:function(t){e.resetForm("homeAdvertiseFrom")}}},[e._v("重置")])],1)],1)],1)],1)},staticRenderFns:[]};var b=r("VU/8")(h,f,!1,function(e){r("eTIE")},"data-v-1b85474b",null);t.a=b.exports},eTIE:function(e,t){},lV95:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var s={name:"updateHomeAdvertise",components:{HomeAdvertiseDetail:r("bjEj").a}},i={render:function(){var e=this.$createElement;return(this._self._c||e)("home-advertise-detail",{attrs:{isEdit:!0}})},staticRenderFns:[]};var a=r("VU/8")(s,i,!1,function(e){r("M48v")},null,null);t.default=a.exports}});
  2. //# sourceMappingURL=3.af91a9bd3e0f1276ce1e.js.map