text: webpackJsonp([5],{"/EfR":function(t,e,a){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=a("RRo+"),o=a.n(r),n=a("//Fk"),i=a.n(n),s=a("xSjb").BlobServiceClient,l={data:function(){return{fileList:[],iconUrl:"",blobSasUrl:"",containerName:"",fileName:""}},watch:{iconUrl:function(t){this.$emit("onIconChange",t)}},props:{folder:{type:String,default:"default",required:!1}},methods:{beforeUpdate:function(t){var e=this;return this.$http({url:this.$http.adornUrl("/thirdPart/azure/bloburl"),method:"get",params:this.$http.adornParams({})}).then(function(a){var r=a.data;e.blobSasUrl=r.url+"?"+r.signature,e.containerName=e.folder+"/"+r.date,e.fileName=t.name,e.iconUrl=r.url+e.containerName+"/"+e.fileName})},uploadSectionFile:function(t){var e=this,a=t.file;this.beforeUpdate(a).then(function(){var t=new s(e.blobSasUrl).getContainerClient(e.containerName);try{var r=[],o=t.getBlockBlobClient(e.fileName);r.push(o.uploadBrowserData(a)),i.a.all(r),e.$message({message:"上傳圖標成功",type:"success"})}catch(t){e.$message({message:"上傳圖標失敗",type:"fail"})}})}}},d={render:function(){var t=this.$createElement,e=this._self._c||t;return e("el-upload",{ref:"upload",attrs:{action:"http://localhost:88/api/thirdPart/azure/hello/","http-request":this.uploadSectionFile,"file-list":this.fileList,limit:1,"list-type":"picture"}},[e("el-button",{attrs:{size:"small",type:"primary"}},[this._v("点击上传")])],1)},staticRenderFns:[]},u={components:{SingleUploadBrandIcon:a("VU/8")(l,d,!1,null,null,null).exports},data:function(){return{visible:!1,dataForm:{brandId:0,name:"",logo:"",descript:"",showStatus:1,firstLetter:"",sort:0},dataRule:{name:[{required:!0,message:"品牌名不能为空",trigger:"blur"}],logo:[{required:!0,message:"品牌logo地址不能为空",trigger:"blur"}],descript:[{required:!0,message:"介绍不能为空",trigger:"blur"}],showStatus:[{required:!0,message:"显示状态[0-不显示；1-显示]不能为空",trigger:"blur"}],firstLetter:[{validator:function(t,e,a){""==e?a(new Error("首字母必须填写")):/^[a-zA-Z]$/.test(e)?a():a(new Error("首字母必须a-z或者A-Z之间"))},trigger:"blur"}],sort:[{validator:function(t,e,a){""==e?a(new Error("排序字段必须填写")):!o()(e)||e<0?a(new Error("排序必须是一个大于等于0的整数")):a()},trigger:"blur"}]}}},methods:{init:function(t){var e=this;this.dataForm.brandId=t||0,this.visible=!0,this.$nextTick(function(){e.$refs.dataForm.resetFields(),e.dataForm.brandId&&e.$http({url:e.$http.adornUrl("/product/brand/info/"+e.dataForm.brandId),method:"get",params:e.$http.adornParams()}).then(function(t){var a=t.data;a&&0===a.code&&(e.dataForm.name=a.brand.name,e.dataForm.logo=a.brand.logo,e.dataForm.descript=a.brand.descript,e.dataForm.showStatus=a.brand.showStatus,e.dataForm.firstLetter=a.brand.firstLetter,e.dataForm.sort=a.brand.sort)})})},dataFormSubmit:function(){var t=this;this.$refs.dataForm.validate(function(e){e&&t.$http({url:t.$http.adornUrl("/product/brand/"+(t.dataForm.brandId?"update":"save")),method:"post",data:t.$http.adornData({brandId:t.dataForm.brandId||void 0,name:t.dataForm.name,logo:t.dataForm.logo,descript:t.dataForm.descript,showStatus:t.dataForm.showStatus,firstLetter:t.dataForm.firstLetter,sort:t.dataForm.sort})}).then(function(e){var a=e.data;a&&0===a.code?(t.$message({message:"操作成功",type:"success",duration:1500,onClose:function(){t.visible=!1,t.$emit("refreshDataList")}}),t.$refs.updateBrandIcon.$refs.upload.clearFiles()):t.$message.error(a.msg)})})},onIconChange:function(t){this.dataForm.logo=t}}},c={render:function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("el-dialog",{attrs:{title:t.dataForm.id?"修改":"新增","close-on-click-modal":!1,visible:t.visible},on:{"update:visible":function(e){t.visible=e}}},[a("el-form",{ref:"dataForm",attrs:{model:t.dataForm,rules:t.dataRule,"label-width":"140px"},nativeOn:{keyup:function(e){if(!("button"in e)&&t._k(e.keyCode,"enter",13,e.key,"Enter"))return null;t.dataFormSubmit()}}},[a("el-form-item",{attrs:{label:"品牌名",prop:"name"}},[a("el-input",{attrs:{placeholder:"品牌名"},model:{value:t.dataForm.name,callback:function(e){t.$set(t.dataForm,"name",e)},expression:"dataForm.name"}})],1),t._v(" "),a("el-form-item",{attrs:{label:"品牌logo地址",prop:"logo"}},[a("single-upload-brand-icon",{ref:"updateBrandIcon",attrs:{folder:"brandicon"},on:{onIconChange:t.onIconChange}})],1),t._v(" "),a("el-form-item",{attrs:{label:"介绍",prop:"descript"}},[a("el-input",{attrs:{placeholder:"介绍"},model:{value:t.dataForm.descript,callback:function(e){t.$set(t.dataForm,"descript",e)},expression:"dataForm.descript"}})],1),t._v(" "),a("el-form-item",{attrs:{label:"显示状态",prop:"showStatus"}},[a("el-switch",{attrs:{"active-color":"#13ce66","inactive-color":"#ff4949","active-value":1,"inactive-value":0},model:{value:t.dataForm.showStatus,callback:function(e){t.$set(t.dataForm,"showStatus",e)},expression:"dataForm.showStatus"}})],1),t._v(" "),a("el-form-item",{attrs:{label:"检索首字母",prop:"firstLetter"}},[a("el-input",{attrs:{placeholder:"检索首字母"},model:{value:t.dataForm.firstLetter,callback:function(e){t.$set(t.dataForm,"firstLetter",e)},expression:"dataForm.firstLetter"}})],1),t._v(" "),a("el-form-item",{attrs:{label:"排序",prop:"sort"}},[a("el-input",{attrs:{placeholder:"排序"},model:{value:t.dataForm.sort,callback:function(e){t.$set(t.dataForm,"sort",t._n(e))},expression:"dataForm.sort"}})],1)],1),t._v(" "),a("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[a("el-button",{on:{click:function(e){t.visible=!1}}},[t._v("取消")]),t._v(" "),a("el-button",{attrs:{type:"primary"},on:{click:function(e){t.dataFormSubmit()}}},[t._v("确定")])],1)],1)},staticRenderFns:[]},m=a("VU/8")(u,c,!1,null,null,null);e.default=m.exports},"1alW":function(t,e,a){var r=a("kM2E");r(r.S,"Number",{isInteger:a("AKgy")})},AKgy:function(t,e,a){var r=a("EqjI"),o=Math.floor;t.exports=function(t){return!r(t)&&isFinite(t)&&o(t)===t}},"RRo+":function(t,e,a){t.exports={default:a("c45H"),__esModule:!0}},c45H:function(t,e,a){a("1alW"),t.exports=a("FeBl").Number.isInteger}});