12 |
- webpackJsonp([6],{"FO5+":function(e,t,r){"use strict";var n=r("woOf"),a=r.n(n),s=r("s/Rn"),o={bigPic:"",brandStory:"",factoryStatus:0,firstLetter:"",logo:"",name:"",showStatus:0,sort:0},i={name:"BrandDetail",components:{SingleUpload:r("TZVV").a},props:{isEdit:{type:Boolean,default:!1}},data:function(){return{brand:a()({},o),rules:{name:[{required:!0,message:"请输入品牌名称",trigger:"blur"},{min:2,max:140,message:"长度在 2 到 140 个字符",trigger:"blur"}],sort:[{type:"number",message:"排序必须为数字"}]}}},created:function(){var e=this;this.isEdit?Object(s.d)(this.$route.query.id).then(function(t){e.brand=t.data}):this.brand=a()({},o)},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(s.e)(t.$route.query.id,t.brand).then(function(r){t.$refs[e].resetFields(),t.$message({message:"修改成功",type:"success",duration:1e3}),t.$router.back()}):Object(s.a)(t.brand).then(function(r){t.$refs[e].resetFields(),t.brand=a()({},o),t.$message({message:"提交成功",type:"success",duration:1e3})})})})},resetForm:function(e){this.$refs[e].resetFields(),this.brand=a()({},o)}}},l={render:function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("el-card",{staticClass:"form-container",attrs:{shadow:"never"}},[r("el-form",{ref:"brandFrom",attrs:{model:e.brand,rules:e.rules,"label-width":"150px"}},[r("el-form-item",{attrs:{label:"品牌名称:",prop:"name"}},[r("el-input",{model:{value:e.brand.name,callback:function(t){e.$set(e.brand,"name",t)},expression:"brand.name"}})],1),e._v(" "),r("el-form-item",{attrs:{label:"品牌首字母:"}},[r("el-input",{model:{value:e.brand.firstLetter,callback:function(t){e.$set(e.brand,"firstLetter",t)},expression:"brand.firstLetter"}})],1),e._v(" "),r("el-form-item",{attrs:{label:"品牌LOGO:",prop:"logo"}},[r("single-upload",{model:{value:e.brand.logo,callback:function(t){e.$set(e.brand,"logo",t)},expression:"brand.logo"}})],1),e._v(" "),r("el-form-item",{attrs:{label:"排序:",prop:"sort"}},[r("el-input",{model:{value:e.brand.sort,callback:function(t){e.$set(e.brand,"sort",e._n(t))},expression:"brand.sort"}})],1),e._v(" "),r("el-form-item",{attrs:{label:"是否显示:"}},[r("el-radio-group",{model:{value:e.brand.showStatus,callback:function(t){e.$set(e.brand,"showStatus",t)},expression:"brand.showStatus"}},[r("el-radio",{attrs:{label:1}},[e._v("是")]),e._v(" "),r("el-radio",{attrs:{label:0}},[e._v("否")])],1)],1),e._v(" "),r("el-form-item",[r("el-button",{attrs:{type:"primary"},on:{click:function(t){e.onSubmit("brandFrom")}}},[e._v("提交")]),e._v(" "),e.isEdit?e._e():r("el-button",{on:{click:function(t){e.resetForm("brandFrom")}}},[e._v("重置")])],1)],1)],1)},staticRenderFns:[]};var u=r("VU/8")(i,l,!1,function(e){r("wXAl")},null,null);t.a=u.exports},JJZq:function(e,t){},f7GL:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n={name:"updateBrand",components:{BrandDetail:r("FO5+").a}},a={render:function(){var e=this.$createElement;return(this._self._c||e)("brand-detail",{attrs:{"is-edit":!0}})},staticRenderFns:[]};var s=r("VU/8")(n,a,!1,function(e){r("JJZq")},null,null);t.default=s.exports},wXAl:function(e,t){}});
- //# sourceMappingURL=6.23a8b6791e6be31d1d2b.js.map
|