webpackJsonp([31],{"3AQR":function(e,t,a){var r=a("r37Y");"string"==typeof r&&(r=[[e.i,r,""]]),r.locals&&(e.exports=r.locals);a("Xatw")("2abc6f95",r,!0)},aSlm:function(e,t,a){"use strict";a.d(t,"a",function(){return l});var r=a("vLgD"),l={createWebConfig:function(e){return e.status||(e.status=0),Object(r.a)({url:"/admin/webConfigs",method:"post",data:e})},deleteWebConfig:function(e){return Object(r.a)({url:"/admin/webConfigs/delete",method:"post",data:e})},getWebConfigList:function(e,t,a){var l={};return l.name=e.name,-1!=e.type&&(l.type=e.type),l.current=t,l.size=a,console.log("params",l),Object(r.a)({url:"/admin/webConfigs",method:"get",params:l})},getOneNotice:function(e){return Object(r.a)({url:"/notice/getOneObj",method:"get",params:{id:e}})},updateWebConfig:function(e){return Object(r.a)({url:"/admin/webConfigs",method:"patch",data:e})}}},r37Y:function(e,t,a){(e.exports=a("uszS")(!1)).push([e.i,"\n.form-input[data-v-1489276e]{width:350px\n}",""])},vJSG:function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=a("vvmr"),l=a.n(r),s=a("Z4qH"),o=a("aSlm"),i=(a("PuB8"),{mixins:[s.a],data:function(){return{PROTOCOL:window.location.protocol+"//",dialogTitle:"新建资源配置",ruleForm:{name:"",type:"",value:"",url:"",sort:""},statusFlag:"",rules:{name:[{required:!0,message:"请输入名称",trigger:"blur"}],value:[{required:!0,message:"请上传资源图片",trigger:"blur"}],type:[{required:!0,message:"请选择资源类型",trigger:"blur"}]},fileList:[],uploadHeaders:{Authorization:sessionStorage.token}}},watch:{dialogType:function(e){1===e?(this.statusFlag=0,this.dialogTitle="新建资源配置"):this.dialogTitle="编辑资源配置"}},methods:{handleUploadSuccess:function(e,t){e&&e.data?(this.ruleForm.value=e.data,this.$message.success("图片上传成功")):this.$message.error("图片上传失败")},getRequestData:function(){var e=this.ruleForm.url,t=void 0===e?"":e;return l()({},this.ruleForm,{url:t?""+this.PROTOCOL+t:""})},createCallback:function(){return o.a.createWebConfig(this.getRequestData())},updateCallback:function(){return o.a.updateWebConfig(this.getRequestData())},editCallback:function(e){this.statusFlag=1===e.status}}}),n={render:function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("el-dialog",{attrs:{title:e.dialogTitle,visible:e.dialogVisible,width:"40%"},on:{"update:visible":function(t){e.dialogVisible=t},close:e.closeDialog}},[a("el-form",{ref:"ruleForm",staticClass:"conin-config-add",attrs:{model:e.ruleForm,rules:e.rules,"label-width":"100px"}},[a("el-form-item",{attrs:{label:"资源名称",prop:"name"}},[a("el-input",{staticClass:"form-input",model:{value:e.ruleForm.name,callback:function(t){e.$set(e.ruleForm,"name",t)},expression:"ruleForm.name"}})],1),e._v(" "),a("el-form-item",{attrs:{label:"资源类型",prop:"type"}},[a("el-select",{staticClass:"form-input",attrs:{placeholder:"请选择"},model:{value:e.ruleForm.type,callback:function(t){e.$set(e.ruleForm,"type",t)},expression:"ruleForm.type"}},[a("el-option",{attrs:{label:"大banner图",value:"WEB_BANNER"}}),e._v(" "),a("el-option",{attrs:{label:"小banner图",value:"LINK_BANNER"}})],1)],1),e._v(" "),a("el-form-item",{attrs:{label:"图片"}},[a("el-upload",{ref:"elUpload",staticClass:"avatar-uploader",attrs:{action:"/admin/image/AliYunImgUpload","show-file-list":!1,headers:e.uploadHeaders,"on-success":e.handleUploadSuccess}},[e.ruleForm.value?a("img",{staticClass:"avatar",attrs:{src:e.ruleForm.value}}):a("i",{staticClass:"el-icon-plus avatar-uploader-icon"})])],1),e._v(" "),a("el-form-item",{attrs:{label:"链接",prop:"url"}},[a("el-input",{staticClass:"form-input",attrs:{placeholder:"请输入链接"},model:{value:e.ruleForm.url,callback:function(t){e.$set(e.ruleForm,"url",t)},expression:"ruleForm.url"}},[a("template",{slot:"prepend"},[e._v(e._s(e.PROTOCOL))])],2)],1),e._v(" "),a("el-form-item",{attrs:{label:"排序",prop:"sort"}},[a("el-input-number",{staticClass:"form-input",attrs:{type:"number"},model:{value:e.ruleForm.sort,callback:function(t){e.$set(e.ruleForm,"sort",t)},expression:"ruleForm.sort"}})],1),e._v(" "),a("el-form-item",{attrs:{label:"状态"}},[a("el-switch",{attrs:{"active-text":"开启","inactive-text":"关闭"},model:{value:e.statusFlag,callback:function(t){e.statusFlag=t},expression:"statusFlag"}})],1)],1),e._v(" "),a("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[a("el-button",{on:{click:function(t){e.dialogVisible=!1}}},[e._v("取 消")]),e._v(" "),a("el-button",{attrs:{type:"primary"},on:{click:function(t){e.submitForm("ruleForm")}}},[e._v("确 定")])],1)],1)},staticRenderFns:[]};var u=a("rCDr")(i,n,!1,function(e){a("3AQR")},"data-v-1489276e",null);t.default=u.exports}});