test_lgq/niucloud/public/admin/assets/system-afcf7177.js
2024-01-24 17:36:08 +08:00

2 lines
5.4 KiB
JavaScript

import{d as P,r as f,n as g,N as a,h,c as C,y as I,I as V,w as n,e as t,a as i,t as c,u as o,B,i as D,L as F,U as S,W as T,X as L,$ as R,Y as W,E as $,a0 as q}from"./index-4dcc0234.js";/* empty css *//* empty css *//* empty css *//* empty css */import{_ as j}from"./index-742b412a.js";import"./el-form-item-4ed993c7.js";/* empty css */import{_ as v,H as A,$ as H}from"./sys-8ead7f22.js";/* empty css */import"./index.vue_vue_type_style_index_0_lang-5c6c00d9.js";/* empty css */import"./attachment-c69dd9fd.js";/* empty css *//* empty css *//* empty css *//* empty css *//* empty css *//* empty css *//* empty css *//* empty css */import"./el-tooltip-4ed993c7.js";/* empty css *//* empty css *//* empty css *//* empty css *//* empty css */import"./index.vue_vue_type_script_setup_true_lang-9285296e.js";/* empty css */const O={class:"main-container"},X={class:"panel-title !text-sm"},Y={class:"text-[12px] text-[#a9a9a9]"},z={class:"text-[12px] text-[#a9a9a9]"},G={class:"panel-title !text-sm"},J={class:"panel-title !text-sm"},K={class:"fixed-footer-wrap"},M={class:"fixed-footer"},Ce=P({__name:"system",setup(Q){const m=f(!0),b=f(),e=g({site_name:"",logo:"",desc:"",latitude:"",keywords:"",longitude:"",province_id:"",city_id:"",district_id:"",address:"",full_address:"",business_hours:"",phone:"",front_end_name:"",front_end_logo:"",icon:"",wechat_code:"",enterprise_wechat:"",tel:""});(async(u=0)=>{const l=await(await v()).data;Object.keys(e).forEach(d=>{l[d]!=null&&(e[d]=l[d])});const r=await(await A()).data;e.wechat_code=r.wechat_code,e.enterprise_wechat=r.enterprise_wechat,e.tel=r.tel,b.value=F(),m.value=!1})();const w=f(),x=g({site_name:[{required:!0,message:a("siteNamePlaceholder"),trigger:"blur"}],front_end_name:[{required:!0,message:a("frontEndNamePlaceholder"),trigger:"blur"}]}),y=async u=>{m.value||!u||await u.validate(async l=>{l&&(m.value=!0,H(e).then(()=>{m.value=!1,E()}).catch(()=>{m.value=!1}))})},E=async()=>{const u=await(await v()).data;S.set({key:"siteInfo",data:u})};return(u,l)=>{const r=T,d=L,p=j,_=R,k=W,N=$,U=q;return h(),C("div",O,[I((h(),V(k,{model:e,"label-width":"150px",ref_key:"formRef",ref:w,rules:x,class:"page-form"},{default:n(()=>[t(_,{class:"box-card !border-none",shadow:"never"},{default:n(()=>[i("h3",X,c(o(a)("websiteInfo")),1),t(d,{label:o(a)("siteName"),prop:"site_name"},{default:n(()=>[t(r,{modelValue:e.site_name,"onUpdate:modelValue":l[0]||(l[0]=s=>e.site_name=s),placeholder:o(a)("siteNamePlaceholder"),class:"input-width",clearable:"",maxlength:"20"},null,8,["modelValue","placeholder"])]),_:1},8,["label"]),t(d,{label:o(a)("logo")},{default:n(()=>[i("div",null,[t(p,{modelValue:e.logo,"onUpdate:modelValue":l[1]||(l[1]=s=>e.logo=s)},null,8,["modelValue"]),i("p",Y,c(o(a)("logoPlaceholder")),1)])]),_:1},8,["label"]),t(d,{label:o(a)("icon")},{default:n(()=>[i("div",null,[t(p,{modelValue:e.icon,"onUpdate:modelValue":l[2]||(l[2]=s=>e.icon=s)},null,8,["modelValue"]),i("p",z,c(o(a)("iconPlaceholder")),1)])]),_:1},8,["label"]),t(d,{label:o(a)("keywords")},{default:n(()=>[t(r,{modelValue:e.keywords,"onUpdate:modelValue":l[3]||(l[3]=s=>e.keywords=s),placeholder:o(a)("keywordsPlaceholder"),class:"input-width",clearable:"",maxlength:"20"},null,8,["modelValue","placeholder"])]),_:1},8,["label"]),t(d,{label:o(a)("desc")},{default:n(()=>[t(r,{modelValue:e.desc,"onUpdate:modelValue":l[4]||(l[4]=s=>e.desc=s),type:"textarea",rows:"4",clearable:"",placeholder:o(a)("descPlaceholder"),class:"input-width",maxlength:"100"},null,8,["modelValue","placeholder"])]),_:1},8,["label"])]),_:1}),t(_,{class:"box-card !border-none",shadow:"never"},{default:n(()=>[i("h3",G,c(o(a)("frontEndInfo")),1),t(d,{label:o(a)("frontEndName")},{default:n(()=>[t(r,{modelValue:e.front_end_name,"onUpdate:modelValue":l[5]||(l[5]=s=>e.front_end_name=s),placeholder:o(a)("frontEndNamePlaceholder"),class:"input-width",clearable:"",maxlength:"20"},null,8,["modelValue","placeholder"])]),_:1},8,["label"]),t(d,{label:o(a)("frontEndLogo")},{default:n(()=>[t(p,{modelValue:e.front_end_logo,"onUpdate:modelValue":l[6]||(l[6]=s=>e.front_end_logo=s)},null,8,["modelValue"])]),_:1},8,["label"])]),_:1}),b.value=="admin"?(h(),V(_,{key:0,class:"box-card !border-none",shadow:"never"},{default:n(()=>[i("h3",J,c(o(a)("serviceInformation")),1),t(d,{label:o(a)("contactsTel")},{default:n(()=>[t(r,{modelValue:e.tel,"onUpdate:modelValue":l[7]||(l[7]=s=>e.tel=s),placeholder:o(a)("contactsTelPlaceholder"),class:"input-width",clearable:"",maxlength:"20"},null,8,["modelValue","placeholder"])]),_:1},8,["label"]),t(d,{label:o(a)("wechatCode")},{default:n(()=>[t(p,{modelValue:e.wechat_code,"onUpdate:modelValue":l[8]||(l[8]=s=>e.wechat_code=s)},null,8,["modelValue"])]),_:1},8,["label"]),t(d,{label:o(a)("customerServiceCode")},{default:n(()=>[t(p,{modelValue:e.enterprise_wechat,"onUpdate:modelValue":l[9]||(l[9]=s=>e.enterprise_wechat=s)},null,8,["modelValue"])]),_:1},8,["label"])]),_:1})):B("",!0)]),_:1},8,["model","rules"])),[[U,m.value]]),i("div",K,[i("div",M,[t(N,{type:"primary",loading:m.value,onClick:l[10]||(l[10]=s=>y(w.value))},{default:n(()=>[D(c(o(a)("save")),1)]),_:1},8,["loading"])])])])}}});export{Ce as default};