1 line
4.1 KiB
JavaScript
1 line
4.1 KiB
JavaScript
"use strict";(self["webpackChunkx_php_admin"]=self["webpackChunkx_php_admin"]||[]).push([[658],{8658:function(e,t,a){a.r(t),a.d(t,{default:function(){return u}});var l=a(6808);const i={key:0};function n(e,t,a,n,o,d){const s=(0,l.up)("x-page-header"),u=(0,l.up)("el-alert"),p=(0,l.up)("el-option"),r=(0,l.up)("el-select"),m=(0,l.up)("el-input"),c=(0,l.up)("el-table-column"),g=(0,l.up)("x-form-table"),f=(0,l.up)("el-button"),h=(0,l.up)("x-form"),w=(0,l.up)("el-tab-pane"),b=(0,l.up)("el-tabs"),y=(0,l.up)("el-card"),k=(0,l.up)("el-main"),v=(0,l.up)("el-footer"),_=(0,l.up)("el-container"),x=(0,l.Q2)("loading");return(0,l.wg)(),(0,l.j4)(_,null,{default:(0,l.w5)((()=>[(0,l.Wm)(k,null,{default:(0,l.w5)((()=>[(0,l.Wm)(y,{shadow:"never",class:"setting"},{default:(0,l.w5)((()=>[(0,l.Wm)(s,{title:"系统设置",description:"可以修改网站及应用的各种配置",icon:"el-icon-setting"}),(0,l.wy)(((0,l.wg)(),(0,l.j4)(b,{"tab-position":o.tabposition,modelValue:o.activename,"onUpdate:modelValue":t[1]||(t[1]=e=>o.activename=e)},{default:(0,l.w5)((()=>[((0,l.wg)(!0),(0,l.iD)(l.HY,null,(0,l.Ko)(o.settingList,(e=>((0,l.wg)(),(0,l.j4)(w,{key:e.key,label:e.name,name:e.key},{default:(0,l.w5)((()=>["extend"==e.type?((0,l.wg)(),(0,l.iD)("div",i,[e.tips?((0,l.wg)(),(0,l.j4)(u,{key:0,title:e.tips,type:"warning",style:{"margin-bottom":"15px"}},null,8,["title"])):(0,l.kq)("",!0),(0,l.Wm)(g,{modelValue:o.extend[e.key],"onUpdate:modelValue":t=>o.extend[e.key]=t,hideAdd:!0,"drag-sort":"",placeholder:"暂无数据"},{default:(0,l.w5)((()=>[((0,l.wg)(!0),(0,l.iD)(l.HY,null,(0,l.Ko)(e.column,(e=>((0,l.wg)(),(0,l.j4)(c,{label:e.label,prop:e.prop,width:e.width,key:e.prop},{default:(0,l.w5)((t=>["select"==e.component?((0,l.wg)(),(0,l.j4)(r,(0,l.dG)({key:0,modelValue:t.row[e.prop],"onUpdate:modelValue":a=>t.row[e.prop]=a},e.options,{clearable:"",filterable:"",style:{width:"100%"}}),{default:(0,l.w5)((()=>[((0,l.wg)(!0),(0,l.iD)(l.HY,null,(0,l.Ko)(e.options.items,(e=>((0,l.wg)(),(0,l.j4)(p,{key:e.value,label:e.label||e.name,value:e.value},null,8,["label","value"])))),128))])),_:2},1040,["modelValue","onUpdate:modelValue"])):((0,l.wg)(),(0,l.j4)(m,{key:1,modelValue:t.row[e.prop],"onUpdate:modelValue":a=>t.row[e.prop]=a,placeholder:e.placeholder},null,8,["modelValue","onUpdate:modelValue","placeholder"]))])),_:2},1032,["label","prop","width"])))),128))])),_:2},1032,["modelValue","onUpdate:modelValue"]),(0,l.Wm)(f,{type:"primary",icon:"el-icon-plus",onClick:t=>d.table_add(e),style:{"margin-top":"20px"}},null,8,["onClick"])])):((0,l.wg)(),(0,l.j4)(h,{key:1,ref_for:!0,ref:"formref",config:o.formList[e.key],modelValue:o.info,"onUpdate:modelValue":t[0]||(t[0]=e=>o.info=e),loading:o.loading},null,8,["config","modelValue","loading"]))])),_:2},1032,["label","name"])))),128))])),_:1},8,["tab-position","modelValue"])),[[x,o.loading]])])),_:1})])),_:1}),(0,l.Wm)(v,null,{default:(0,l.w5)((()=>[(0,l.Wm)(f,{type:"primary",onClick:d.submit,style:{"max-width":"500px",width:"100%"},loading:o.submitloading},{default:(0,l.w5)((()=>[(0,l.Uk)("保存")])),_:1},8,["onClick","loading"])])),_:1})])),_:1})}a(8311);var o={name:"setting",data(){return{info:{},activename:"init",tabposition:"left",settingList:[],extend:[],formList:{},loading:!1,submitloading:!1}},mounted(){this.render()},created(){this.onLayoutResize(),window.addEventListener("resize",this.onLayoutResize)},methods:{onLayoutResize(){this.tabposition=document.body.clientWidth<992?"top":"left"},render(){this.loading=!0,setTimeout((async()=>{var e=await this.$http.get("setting/get");if(200!=e.code)return this.$message.warning(e.message),!1;this.settingList=e.data.settingList,this.info=e.data.info,this.formList=e.data.formList,this.extend=e.data.extend||[],this.loading=!1,e.data.activename&&(this.activename=e.data.activename)}),100)},async submit(){this.submitloading=!0;var e=this.$http.post("setting/submit",{info:this.info,extend:this.extend});this.submitloading=!1,this.$message.success(e.message||"操作成功")},table_add(e){var t={};e.column.forEach((function(e){t[e.prop]=""})),this.extend[e.key].push(t)}}},d=a(8700);const s=(0,d.Z)(o,[["render",n],["__scopeId","data-v-35fd3bd4"]]);var u=s}}]); |