Files
chuanggao-website/client/dist/assets/InfoManage-C0ryJf5B.js
2026-05-12 16:53:18 +08:00

2 lines
7.2 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import{L as Z,d as X,o as _,s as I,b as N,e as s,m as o,z as t,r as V,I as P,C as r,T as R,g as y,j as S,y as T,p as k,k as M,J as b,_ as O}from"./index-eVF4AHSu.js";import{r as D}from"./media-BgGGvhcR.js";import{M as x}from"./MediaSelector-DyRQc9ag.js";import{u as c,e as B,p as F,r as G}from"./validate-B1skQ9Qw.js";import"./upload-C79x1DTb.js";import"./pagination-BgSlm-mj.js";const U=Z();async function K(){try{return await U.get("/admin/company/info")}catch(i){return console.warn("[admin/company/info] fallback:",i),{id:1,siteCode:"cg",brandNameZh:"创高家具",brandNameEn:"ChuangGao Furniture",sloganZh:"匠心定制,品质生活",sloganEn:"Crafted for Quality Living",contactPhone:"400-XXX-XXXX",contactEmail:"contact@chuanggao.com",addressZh:"广东省佛山市",addressEn:"Foshan, Guangdong, China",icpRecord:"粤ICP备xxxxxxxx号",copyrightText:"© 2024 创高家具 版权所有"}}}async function L(i){await U.putJson("/admin/company/update",i)}const Q={class:"company-manage"},j={class:"page-header"},J={class:"form-section"},q={class:"image-field"},z={class:"form-section"},A={class:"form-section"},H={class:"form-section"},W={class:"form-section"},Y=X({__name:"InfoManage",setup(i){const p=V(!1),f=V(!1),g=V(),l=P({}),v={brandNameZh:[G("品牌名称(中文)")],contactPhone:[F()],contactEmail:[B()],weiboUrl:[c("请输入正确的微博链接")],douyinUrl:[c("请输入正确的抖音链接")],xiaohongshuUrl:[c("请输入正确的小红书链接")]};_(async()=>{p.value=!0;try{const u=await K();Object.assign(l,u)}catch(u){console.warn("[InfoManage] fetchCompanyInfo failed:",u)}finally{p.value=!1}});async function E(){var e;if(await((e=g.value)==null?void 0:e.validate().catch(()=>!1))){f.value=!0;try{await L(l),b.success("保存成功")}catch(m){b.error(m instanceof Error?m.message:"保存失败")}finally{f.value=!1}}}return(u,e)=>{const m=r("el-button"),d=r("el-input"),n=r("el-form-item"),h=r("el-image"),w=r("el-form"),C=R("loading");return I((y(),N("div",Q,[s("div",j,[e[23]||(e[23]=s("h2",{class:"page-title"},"公司信息管理",-1)),o(m,{type:"primary",loading:f.value,onClick:E},{default:t(()=>[...e[22]||(e[22]=[S("保存",-1)])]),_:1},8,["loading"])]),o(w,{ref_key:"formRef",ref:g,model:l,rules:v,"label-width":"140px","label-position":"right",class:"company-form"},{default:t(()=>[s("div",J,[e[24]||(e[24]=s("h3",{class:"section-title"},"品牌信息",-1)),o(n,{label:"品牌名称(中文)"},{default:t(()=>[o(d,{modelValue:l.brandNameZh,"onUpdate:modelValue":e[0]||(e[0]=a=>l.brandNameZh=a),placeholder:"创高家具"},null,8,["modelValue"])]),_:1}),o(n,{label:"品牌名称(英文)"},{default:t(()=>[o(d,{modelValue:l.brandNameEn,"onUpdate:modelValue":e[1]||(e[1]=a=>l.brandNameEn=a),placeholder:"ChuangGao Furniture"},null,8,["modelValue"])]),_:1}),o(n,{label:"品牌口号(中文)"},{default:t(()=>[o(d,{modelValue:l.sloganZh,"onUpdate:modelValue":e[2]||(e[2]=a=>l.sloganZh=a),placeholder:"匠心定制,品质生活"},null,8,["modelValue"])]),_:1}),o(n,{label:"品牌口号(英文)"},{default:t(()=>[o(d,{modelValue:l.sloganEn,"onUpdate:modelValue":e[3]||(e[3]=a=>l.sloganEn=a),placeholder:"Crafted for Quality Living"},null,8,["modelValue"])]),_:1}),o(n,{label:"Logo"},{default:t(()=>[s("div",q,[o(x,{modelValue:l.logo,"onUpdate:modelValue":e[4]||(e[4]=a=>l.logo=a),"used-in":"company"},null,8,["modelValue"]),l.logo?(y(),T(h,{key:0,src:k(D)(l.logo),fit:"contain",class:"image-preview"},null,8,["src"])):M("",!0)])]),_:1})]),s("div",z,[e[25]||(e[25]=s("h3",{class:"section-title"},"联系信息",-1)),o(n,{label:"联系电话",prop:"contactPhone"},{default:t(()=>[o(d,{modelValue:l.contactPhone,"onUpdate:modelValue":e[5]||(e[5]=a=>l.contactPhone=a),placeholder:"400-XXX-XXXX"},null,8,["modelValue"])]),_:1}),o(n,{label:"联系邮箱",prop:"contactEmail"},{default:t(()=>[o(d,{modelValue:l.contactEmail,"onUpdate:modelValue":e[6]||(e[6]=a=>l.contactEmail=a),placeholder:"contact@chuanggao.com"},null,8,["modelValue"])]),_:1}),o(n,{label:"公司地址(中文)"},{default:t(()=>[o(d,{modelValue:l.addressZh,"onUpdate:modelValue":e[7]||(e[7]=a=>l.addressZh=a),placeholder:"广东省佛山市..."},null,8,["modelValue"])]),_:1}),o(n,{label:"公司地址(英文)"},{default:t(()=>[o(d,{modelValue:l.addressEn,"onUpdate:modelValue":e[8]||(e[8]=a=>l.addressEn=a),placeholder:"Foshan, Guangdong, China"},null,8,["modelValue"])]),_:1})]),s("div",A,[e[26]||(e[26]=s("h3",{class:"section-title"},"社交媒体",-1)),o(n,{label:"微信公众号二维码"},{default:t(()=>[o(x,{modelValue:l.wechatQr,"onUpdate:modelValue":e[9]||(e[9]=a=>l.wechatQr=a),"used-in":"company"},null,8,["modelValue"])]),_:1}),o(n,{label:"微博链接",prop:"weiboUrl"},{default:t(()=>[o(d,{modelValue:l.weiboUrl,"onUpdate:modelValue":e[10]||(e[10]=a=>l.weiboUrl=a),placeholder:"https://weibo.com/..."},null,8,["modelValue"])]),_:1}),o(n,{label:"抖音链接",prop:"douyinUrl"},{default:t(()=>[o(d,{modelValue:l.douyinUrl,"onUpdate:modelValue":e[11]||(e[11]=a=>l.douyinUrl=a),placeholder:"https://douyin.com/..."},null,8,["modelValue"])]),_:1}),o(n,{label:"小红书链接"},{default:t(()=>[o(d,{modelValue:l.xiaohongshuUrl,"onUpdate:modelValue":e[12]||(e[12]=a=>l.xiaohongshuUrl=a),placeholder:"https://xiaohongshu.com/..."},null,8,["modelValue"])]),_:1})]),s("div",H,[e[27]||(e[27]=s("h3",{class:"section-title"},"备案信息",-1)),o(n,{label:"ICP备案号"},{default:t(()=>[o(d,{modelValue:l.icpRecord,"onUpdate:modelValue":e[13]||(e[13]=a=>l.icpRecord=a),placeholder:"粤ICP备xxxxxxxx号"},null,8,["modelValue"])]),_:1}),o(n,{label:"版权信息"},{default:t(()=>[o(d,{modelValue:l.copyrightText,"onUpdate:modelValue":e[14]||(e[14]=a=>l.copyrightText=a),placeholder:"© 2024 创高家具 版权所有"},null,8,["modelValue"])]),_:1})]),s("div",W,[e[28]||(e[28]=s("h3",{class:"section-title"},"SEO 配置",-1)),o(n,{label:"SEO标题中文"},{default:t(()=>[o(d,{modelValue:l.seoTitleZh,"onUpdate:modelValue":e[15]||(e[15]=a=>l.seoTitleZh=a)},null,8,["modelValue"])]),_:1}),o(n,{label:"SEO标题英文"},{default:t(()=>[o(d,{modelValue:l.seoTitleEn,"onUpdate:modelValue":e[16]||(e[16]=a=>l.seoTitleEn=a)},null,8,["modelValue"])]),_:1}),o(n,{label:"SEO关键词中文"},{default:t(()=>[o(d,{modelValue:l.seoKeywordsZh,"onUpdate:modelValue":e[17]||(e[17]=a=>l.seoKeywordsZh=a),type:"textarea",rows:2},null,8,["modelValue"])]),_:1}),o(n,{label:"SEO关键词英文"},{default:t(()=>[o(d,{modelValue:l.seoKeywordsEn,"onUpdate:modelValue":e[18]||(e[18]=a=>l.seoKeywordsEn=a),type:"textarea",rows:2},null,8,["modelValue"])]),_:1}),o(n,{label:"SEO描述中文"},{default:t(()=>[o(d,{modelValue:l.seoDescriptionZh,"onUpdate:modelValue":e[19]||(e[19]=a=>l.seoDescriptionZh=a),type:"textarea",rows:3},null,8,["modelValue"])]),_:1}),o(n,{label:"SEO描述英文"},{default:t(()=>[o(d,{modelValue:l.seoDescriptionEn,"onUpdate:modelValue":e[20]||(e[20]=a=>l.seoDescriptionEn=a),type:"textarea",rows:3},null,8,["modelValue"])]),_:1}),o(n,{label:"统计代码"},{default:t(()=>[o(d,{modelValue:l.analyticsCode,"onUpdate:modelValue":e[21]||(e[21]=a=>l.analyticsCode=a),type:"textarea",rows:3,placeholder:"百度/谷歌统计代码"},null,8,["modelValue"])]),_:1})])]),_:1},8,["model"])])),[[C,p.value]])}}}),ne=O(Y,[["__scopeId","data-v-25ce802e"]]);export{ne as default};