1 line
3.8 KiB
JavaScript
1 line
3.8 KiB
JavaScript
"use strict";(self["webpackChunkX_PHP_Admin"]=self["webpackChunkX_PHP_Admin"]||[]).push([[776],{9776:function(e,t,a){a.r(t),a.d(t,{default:function(){return u}});var l=a(6808);function i(e,t,a,i,n,o){const d=(0,l.up)("x-page-header"),u=(0,l.up)("x-form"),s=(0,l.up)("el-tab-pane"),m=(0,l.up)("el-alert"),r=(0,l.up)("el-input"),p=(0,l.up)("el-table-column"),c=(0,l.up)("x-form-table"),f=(0,l.up)("el-button"),g=(0,l.up)("el-tabs"),h=(0,l.up)("el-card"),w=(0,l.up)("el-main"),b=(0,l.up)("el-footer"),y=(0,l.up)("el-container"),V=(0,l.Q2)("loading");return(0,l.wg)(),(0,l.j4)(y,null,{default:(0,l.w5)((()=>[(0,l.Wm)(w,null,{default:(0,l.w5)((()=>[(0,l.Wm)(h,{shadow:"never",class:"setting"},{default:(0,l.w5)((()=>[(0,l.Wm)(d,{title:"系统设置",description:"可以配置和修改网站的各种设置",icon:"el-icon-setting"}),(0,l.wy)(((0,l.wg)(),(0,l.j4)(g,{"tab-position":n.tabposition,modelValue:n.activename,"onUpdate:modelValue":t[2]||(t[2]=e=>n.activename=e)},{default:(0,l.w5)((()=>[((0,l.wg)(!0),(0,l.iD)(l.HY,null,(0,l.Ko)(n.settingList,(e=>((0,l.wg)(),(0,l.j4)(s,{key:e.key,label:e.name,name:e.key},{default:(0,l.w5)((()=>[(0,l.Wm)(u,{ref_for:!0,ref:"formref",config:n.formList[e.key],modelValue:n.info,"onUpdate:modelValue":t[0]||(t[0]=e=>n.info=e),loading:n.loading},null,8,["config","modelValue","loading"])])),_:2},1032,["label","name"])))),128)),(0,l.Wm)(s,{label:"扩展配置"},{default:(0,l.w5)((()=>[(0,l.Wm)(m,{title:"扩展配置为系统业务所有的配置",type:"warning",style:{"margin-bottom":"15px"}}),(0,l.Wm)(c,{modelValue:n.extend,"onUpdate:modelValue":t[1]||(t[1]=e=>n.extend=e),hideAdd:!0,"drag-sort":"",placeholder:"暂无数据"},{default:(0,l.w5)((()=>[(0,l.Wm)(p,{label:"KEY",prop:"key",width:"150"},{default:(0,l.w5)((e=>[(0,l.Wm)(r,{modelValue:e.row.key,"onUpdate:modelValue":t=>e.row.key=t,placeholder:"请输入内容"},null,8,["modelValue","onUpdate:modelValue"])])),_:1}),(0,l.Wm)(p,{label:"VALUE",prop:"value",width:"350"},{default:(0,l.w5)((e=>[(0,l.Wm)(r,{modelValue:e.row.value,"onUpdate:modelValue":t=>e.row.value=t,placeholder:"请输入内容"},null,8,["modelValue","onUpdate:modelValue"])])),_:1}),(0,l.Wm)(p,{label:"备注",prop:"title"},{default:(0,l.w5)((e=>[(0,l.Wm)(r,{modelValue:e.row.title,"onUpdate:modelValue":t=>e.row.title=t,placeholder:"请输入内容"},null,8,["modelValue","onUpdate:modelValue"])])),_:1})])),_:1},8,["modelValue"]),(0,l.Wm)(f,{type:"primary",icon:"el-icon-plus",onClick:o.table_add,style:{"margin-top":"20px"}},null,8,["onClick"])])),_:1})])),_:1},8,["tab-position","modelValue"])),[[V,n.loading]])])),_:1})])),_:1}),(0,l.Wm)(b,null,{default:(0,l.w5)((()=>[(0,l.Wm)(f,{type:"primary",onClick:o.submit,style:{"max-width":"500px",width:"100%"},loading:n.submitloading},{default:(0,l.w5)((()=>[(0,l.Uk)("保存")])),_:1},8,["onClick","loading"])])),_:1})])),_:1})}a(8311);var n={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(){var e={key:"",value:"",title:""};this.extend.push(e)}}},o=a(8700);const d=(0,o.Z)(n,[["render",i],["__scopeId","data-v-6cef1a8e"]]);var u=d}}]); |