(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-c9204b84"],{2977:function(e,t,n){},"3c03":function(e,t,n){"use strict";n("2977")},"3ef3":function(e,t,n){"use strict";n.r(t);var a=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"app-container"},[n("div",{directives:[{name:"loading",rawName:"v-loading",value:e.loading,expression:"loading"}],staticClass:"app-form"},[n("div",{staticClass:"app-form-group"},[n("div",{staticClass:"app-form-ti"},[e._v("基础配置")]),n("form-generator",{ref:"formGenerator",attrs:{"form-config":e.formConfig,"submit-text":"保存配置"},on:{submit:e.handleSave},scopedSlots:e._u([{key:"backend_notice",fn:function(t){var a=t.form;return[n("el-form-item",{attrs:{label:"文字公告"}},[n("div",{staticStyle:{width:"600px"}},[e._l(a.backend_notice,(function(t,i){return n("div",{key:i,staticStyle:{display:"flex",gap:"10px","margin-bottom":"10px"}},[n("el-input",{attrs:{placeholder:"请输入公告"},model:{value:a.backend_notice[i],callback:function(t){e.$set(a.backend_notice,i,t)},expression:"form.backend_notice[index]"}}),n("el-button",{attrs:{type:"danger",plain:"",disabled:1===a.backend_notice.length},on:{click:function(t){return e.removeNotice(i)}}},[e._v("删除")])],1)})),n("el-button",{attrs:{type:"primary",plain:""},on:{click:function(t){return e.addNotice()}}},[e._v("新增公告")])],2)])]}}]),model:{value:e.form,callback:function(t){e.form=t},expression:"form"}})],1)])])},i=[],o=n("7f70"),c=(n("e8d6"),n("baf6"),n("6994"),n("8849")),r={name:"SiteBasics",components:{FormGenerator:c["a"]},data:function(){return{form:{beian:"",logo:"",login_bg:"",username:"",password:"",backend_notice:[],backend_notice_image:"",backend_notice_image_link:""},formConfig:[{type:"input",label:"登录底部信息",prop:"beian",placeholder:"请输入底部信息"},{type:"image",label:"登录logo",prop:"logo",placeholder:"请上传后台logo"},{type:"image",label:"后台登录图",prop:"login_bg",placeholder:"请上传后台登录图"},{type:"input",label:"文字公告",prop:"backend_notice",width:"400px",slot:"backend_notice"},{type:"image",label:"图片公告",prop:"backend_notice_image",width:"400px",tip:"推荐尺寸：1700*100",tipType:"info"},{type:"input",label:"图片公告链接",prop:"backend_notice_image_link",width:"400px"}],loading:!1}},created:function(){this.getData()},methods:{getData:function(){var e=this;this.loading=!0,this.api.get("site/getInfo",{type:2}).then((function(t){1==t.code&&(e.form=Object.assign(e.form,t.data),e.form.backend_notice||(e.form.backend_notice=[]))})).finally((function(){e.loading=!1}))},addNotice:function(){this.form.backend_notice.push("")},removeNotice:function(e){this.form.backend_notice.splice(e,1)},handleSave:function(){var e=this;this.$refs.formGenerator.validate().then((function(){e.loading=!0,e.api.get("site/submit",Object(o["a"])(Object(o["a"])({},e.form),{},{type:2})).then((function(t){1==t.code?(e.$message.success("保存成功"),e.getData(),e.$store.dispatch("settings/getSetting")):e.$message.error(t.message||"保存失败")})).finally((function(){e.loading=!1}))})).catch((function(){e.$message.warning("请完善表单信息")}))}}},l=r,s=(n("3c03"),n("3d7a")),p=Object(s["a"])(l,a,i,!1,null,"0483ecfa",null);t["default"]=p.exports}}]);