全栈小学生 af883ac9e1 update
2024-08-06 17:54:17 +08:00

2 lines
6.1 KiB
JavaScript

import{d as E,v as k,r as f,bw as P,l as w,k as t,h as b,c as N,J as I,m as S,w as n,e as o,a as i,t as c,u as d,i as C,Y as D,j as B,D as T,G as F,K as R,H as W,E as j,L as q}from"./index-ad4e42d5.js";/* empty css *//* empty css *//* empty css *//* empty css */import L from"./index-3cd61bba.js";/* empty css */import{a0 as A,a1 as G,a2 as H}from"./sys-747f9e8e.js";/* empty css */import"./index.vue_vue_type_style_index_0_lang-32b12c72.js";/* empty css *//* empty css */import"./attachment-621e6518.js";import"./index.vue_vue_type_script_setup_true_lang-4946e851.js";/* 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 */import"./index.vue_vue_type_script_setup_true_lang-9334503d.js";/* empty css */import"./index.vue_vue_type_script_setup_true_lang-39123e55.js";import"./_plugin-vue_export-helper-c27b6911.js";import"./sortable.esm-be94e56d.js";const J={class:"main-container"},K={class:"panel-title !text-sm"},M={class:"text-[12px] text-[#a9a9a9]"},O={class:"text-[12px] text-[#a9a9a9]"},Y={class:"panel-title !text-sm"},$={class:"panel-title !text-sm"},z={class:"fixed-footer-wrap"},Q={class:"fixed-footer"},De=E({__name:"system",setup(X){k().meta.title;const m=f(!0),V=f(P()),l=w({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:"",front_end_icon:"",icon:"",wechat_code:"",enterprise_wechat:"",tel:""});(async()=>{const u=await(await A()).data;Object.keys(l).forEach(s=>{u[s]!=null&&(l[s]=u[s])});const e=await(await G()).data;l.wechat_code=e.wechat_code,l.enterprise_wechat=e.enterprise_wechat,l.tel=e.tel,m.value=!1})();const h=f(),g=w({site_name:[{required:!0,message:t("siteNamePlaceholder"),trigger:"blur"}],front_end_name:[{required:!0,message:t("frontEndNamePlaceholder"),trigger:"blur"}]}),v=async u=>{m.value||!u||await u.validate(async e=>{e&&(m.value=!0,H(l).then(()=>{m.value=!1,V.value=="admin"?D().getWebsiteInfo():B().getSiteInfo()}).catch(()=>{m.value=!1}))})};return(u,e)=>{const s=T,r=F,p=L,_=R,x=W,y=j,U=q;return b(),N("div",J,[I((b(),S(x,{class:"page-form",model:l,"label-width":"150px",ref_key:"formRef",ref:h,rules:g},{default:n(()=>[o(_,{class:"box-card !border-none",shadow:"never"},{default:n(()=>[i("h3",K,c(d(t)("websiteInfo")),1),o(r,{label:d(t)("siteName"),prop:"site_name"},{default:n(()=>[o(s,{modelValue:l.site_name,"onUpdate:modelValue":e[0]||(e[0]=a=>l.site_name=a),modelModifiers:{trim:!0},placeholder:d(t)("siteNamePlaceholder"),class:"input-width",clearable:"",maxlength:"20","show-word-limit":""},null,8,["modelValue","placeholder"])]),_:1},8,["label"]),o(r,{label:d(t)("logo")},{default:n(()=>[i("div",null,[o(p,{modelValue:l.logo,"onUpdate:modelValue":e[1]||(e[1]=a=>l.logo=a)},null,8,["modelValue"]),i("p",M,c(d(t)("logoPlaceholder")),1)])]),_:1},8,["label"]),o(r,{label:d(t)("icon")},{default:n(()=>[i("div",null,[o(p,{modelValue:l.icon,"onUpdate:modelValue":e[2]||(e[2]=a=>l.icon=a)},null,8,["modelValue"]),i("p",O,c(d(t)("iconPlaceholder")),1)])]),_:1},8,["label"]),o(r,{label:d(t)("keywords")},{default:n(()=>[o(s,{modelValue:l.keywords,"onUpdate:modelValue":e[3]||(e[3]=a=>l.keywords=a),placeholder:d(t)("keywordsPlaceholder"),class:"input-width",clearable:"",maxlength:"20","show-word-limit":""},null,8,["modelValue","placeholder"])]),_:1},8,["label"]),o(r,{label:d(t)("desc")},{default:n(()=>[o(s,{modelValue:l.desc,"onUpdate:modelValue":e[4]||(e[4]=a=>l.desc=a),type:"textarea",rows:4,clearable:"",placeholder:d(t)("descPlaceholder"),class:"input-width",maxlength:"100","show-word-limit":""},null,8,["modelValue","placeholder"])]),_:1},8,["label"])]),_:1}),o(_,{class:"box-card mt-[15px] !border-none",shadow:"never"},{default:n(()=>[i("h3",Y,c(d(t)("frontEndInfo")),1),o(r,{label:d(t)("frontEndName")},{default:n(()=>[o(s,{modelValue:l.front_end_name,"onUpdate:modelValue":e[5]||(e[5]=a=>l.front_end_name=a),placeholder:d(t)("frontEndNamePlaceholder"),class:"input-width",clearable:"",maxlength:"20","show-word-limit":""},null,8,["modelValue","placeholder"])]),_:1},8,["label"]),o(r,{label:d(t)("phone")},{default:n(()=>[o(s,{modelValue:l.phone,"onUpdate:modelValue":e[6]||(e[6]=a=>l.phone=a),placeholder:d(t)("phonePlaceholder"),class:"input-width",clearable:"",maxlength:"20","show-word-limit":""},null,8,["modelValue","placeholder"])]),_:1},8,["label"]),o(r,{label:d(t)("logo")},{default:n(()=>[o(p,{modelValue:l.front_end_logo,"onUpdate:modelValue":e[7]||(e[7]=a=>l.front_end_logo=a)},null,8,["modelValue"])]),_:1},8,["label"]),o(r,{label:d(t)("icon")},{default:n(()=>[o(p,{modelValue:l.front_end_icon,"onUpdate:modelValue":e[8]||(e[8]=a=>l.front_end_icon=a)},null,8,["modelValue"])]),_:1},8,["label"])]),_:1}),o(_,{class:"box-card mt-[15px] !border-none",shadow:"never"},{default:n(()=>[i("h3",$,c(d(t)("serviceInformation")),1),o(r,{label:d(t)("contactsTel")},{default:n(()=>[o(s,{modelValue:l.tel,"onUpdate:modelValue":e[9]||(e[9]=a=>l.tel=a),placeholder:d(t)("contactsTelPlaceholder"),class:"input-width",clearable:"",maxlength:"20","show-word-limit":""},null,8,["modelValue","placeholder"])]),_:1},8,["label"]),o(r,{label:d(t)("wechatCode")},{default:n(()=>[o(p,{modelValue:l.wechat_code,"onUpdate:modelValue":e[10]||(e[10]=a=>l.wechat_code=a)},null,8,["modelValue"])]),_:1},8,["label"]),o(r,{label:d(t)("customerServiceCode")},{default:n(()=>[o(p,{modelValue:l.enterprise_wechat,"onUpdate:modelValue":e[11]||(e[11]=a=>l.enterprise_wechat=a)},null,8,["modelValue"])]),_:1},8,["label"])]),_:1})]),_:1},8,["model","rules"])),[[U,m.value]]),i("div",z,[i("div",Q,[o(y,{type:"primary",loading:m.value,onClick:e[12]||(e[12]=a=>v(h.value))},{default:n(()=>[C(c(d(t)("save")),1)]),_:1},8,["loading"])])])])}}});export{De as default};