You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
1 lines
20 KiB
1 lines
20 KiB
import{g as be,j as xe,c as n,a as e,k as r,p as me,F as v,r as y,v as ee,l as I,D as w,t as u,m as x,q as V,d as te,s as p,x as he,C as le,o,n as R,G as z,A as ye,_ as fe}from"./ydFS6PsN.js";import{u as _e}from"./CWcpm1jv.js";import{u as ge}from"./CQ70mTiW.js";const ke={class:"flex items-center justify-between mb-5"},we={class:"flex items-center gap-3"},Ce=["value"],Ve={class:"flex gap-4",style:{"align-items":"flex-start"}},Se={style:{width:"248px","flex-shrink":"0"}},Ue={class:"flex flex-col gap-2"},Te=["onClick"],Me={style:{"min-width":"0",flex:"1"}},De={class:"flex items-center gap-2"},Ae={class:"font-semibold text-slate-800 text-sm truncate"},$e={class:"flex flex-wrap gap-1 mt-1"},je={key:0,class:"lock-badge"},Le={key:0,class:"text-xs text-slate-400 text-center py-8"},Ne={class:"flex-1 min-w-0"},Oe={class:"bg-white rounded-2xl border border-slate-100 shadow-sm p-6"},Fe={key:0,class:"text-center text-slate-300 py-20"},Ie={class:"flex items-center justify-between mb-5"},Re={class:"flex items-center gap-3"},ze={class:"text-base font-semibold text-slate-800"},Be={class:"text-xs text-slate-400 mt-0.5"},Ee={class:"flex gap-2"},He={class:"grid grid-cols-2 gap-4 mb-4"},Ge={class:"form-control"},Je={class:"form-control"},qe={class:"form-control mb-4"},Ke={class:"mb-4"},Pe={class:"flex flex-wrap gap-3"},Qe=["value"],We={class:"text-xs text-slate-600"},Xe={key:0,class:"text-xs text-slate-400 py-4 text-center"},Ye={key:1,class:"overflow-x-auto"},Ze={class:"table text-xs"},et=["onUpdate:modelValue"],tt=["onUpdate:modelValue"],lt={class:"text-center"},st=["onUpdate:modelValue"],nt={class:"relative"},ot=["type","onUpdate:modelValue"],at=["onClick"],it=["onUpdate:modelValue"],dt=["onClick"],ct={class:"flex items-center justify-between mb-5"},ut={class:"flex gap-2"},rt={class:"grid grid-cols-2 gap-4 mb-4"},vt={class:"form-control"},pt={class:"form-control"},bt={class:"form-control mb-4"},xt={class:"mb-4"},mt={class:"flex flex-wrap gap-3"},ht=["value"],yt={class:"text-xs text-slate-600"},ft={key:0,class:"text-xs text-slate-400 py-4 text-center"},_t={key:1,class:"overflow-x-auto"},gt={class:"table text-xs"},kt=["onUpdate:modelValue"],wt=["onUpdate:modelValue"],Ct={class:"text-center"},Vt=["onUpdate:modelValue"],St={class:"relative"},Ut=["type","onUpdate:modelValue"],Tt=["onClick"],Mt=["onUpdate:modelValue"],Dt=["onClick"],At={key:0,class:"text-center py-10 text-slate-400"},$t={class:"flex items-center justify-between mb-5"},jt={class:"flex items-center gap-3"},Lt={class:"text-base font-semibold text-slate-800"},Nt={class:"badge badge-warning badge-sm mt-0.5"},Ot={class:"rounded-lg px-3 py-2 mb-4 text-xs",style:{background:"#fefce8",border:"1px solid #fde047",color:"#854d0e"}},Ft={class:"overflow-x-auto"},It={class:"table text-xs"},Rt={class:"font-mono text-slate-700"},zt={class:"text-slate-500"},Bt={class:"text-center"},Et={key:0,class:"override-badge"},Ht={key:1,class:"inherit-badge"},Gt={class:"relative"},Jt=["type","onUpdate:modelValue"],qt=["onClick"],Kt=["onUpdate:modelValue","placeholder"],Pt={class:"sync-overlay"},Qt={class:"sync-box"},Wt={class:"flex items-start gap-3 mb-4"},Xt={style:{width:"42px",height:"42px",background:"linear-gradient(135deg,#4f46e5,#7c3aed)","border-radius":"13px",display:"flex","align-items":"center","justify-content":"center","flex-shrink":"0"}},Yt={style:{width:"20px",height:"20px",color:"#fff"},fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},Zt={class:"text-xs text-slate-400 mt-1"},el=["innerHTML"],tl={class:"flex items-center justify-between mb-1"},ll={class:"flex gap-2"},sl={class:"sync-region-grid"},nl=["onClick"],ol=["checked","onClick"],al=be({__name:"serviceconfig",setup(il){const S=[{value:1,label:"中国"},{value:2,label:"美国"},{value:3,label:"东亚"},{value:4,label:"东南亚"},{value:5,label:"南亚"},{value:6,label:"中东"},{value:7,label:"欧洲"},{value:8,label:"俄罗斯"},{value:9,label:"非洲"},{value:10,label:"南美"},{value:11,label:"北美"},{value:12,label:"大洋洲"},{value:13,label:"巴西"},{value:14,label:"印度"}],A=[{v:1,label:"STT 语音识别",short:"STT",color:"#0369a1",bg:"#dbeafe"},{v:2,label:"TTS 语音合成",short:"TTS",color:"#7c3aed",bg:"#ede9fe"},{v:3,label:"MT 机器翻译",short:"MT",color:"#059669",bg:"#dcfce7"},{v:4,label:"AST 端到端",short:"AST",color:"#c2410c",bg:"#fff7ed"},{v:5,label:"LLM 大语言",short:"LLM",color:"#b45309",bg:"#fef9c3"},{v:6,label:"存储 OSS/COS",short:"存储",color:"#475569",bg:"#f1f5f9"}],{webApi:k}=_e(),{success:U,error:_}=ge();function $(s){return A.find(l=>l.v===s)||{short:"?",color:"#999",bg:"#eee",v:0,label:""}}function B(s){return(s||"").split(",").map(l=>parseInt(l)||0).filter(l=>l>0)}function E(s){return(s.fields||[]).filter(l=>l.encrypted).length}const T=p([]),a=p(null),b=p(0),m=p("empty"),c=he({id:"",name:"",description:"",enable:!1}),g=p([]),h=p([]),M=p([]),j=p(!1),H=le(()=>{const s=S.find(l=>l.value===b.value);return s?s.label:"区域"+b.value});async function L(){try{const s=await k("getsvcconfigs",{});T.value=s?.items??[]}catch(s){_(s?.message??"加载失败");return}if(a.value){const s=T.value.find(l=>l.id===a.value.id);s&&D(s)}}function se(){a.value?D(a.value):m.value!=="new"&&(m.value="empty")}function D(s){s&&(a.value=s,b.value===0?ne():ie())}function ne(){const s=a.value;c.id=s.id,c.name=s.name||"",c.description=s.description||"",c.enable=!!s.enable,g.value=B(s.categories),h.value=JSON.parse(JSON.stringify(s.fields||[])).map(l=>({...l,_show:!1})),m.value="default"}function oe(){a.value=null,c.id="",c.name="",c.description="",c.enable=!1,g.value=[],h.value=[],m.value="new"}function ae(){a.value?D(a.value):m.value="empty"}function G(){h.value.push({key:"",description:"",encrypted:!1,def_value:"",sort:h.value.length,_show:!1})}function J(s){h.value.splice(s,1),h.value.forEach((l,t)=>{l.sort=t})}async function ie(){const s=a.value;j.value=!0,m.value="region";try{const t=(await k("getsvcregionoverride",{svc_id:s.id,region:b.value}))?.fields??[];M.value=t.map(d=>({...d,_input:d.encrypted?"":d.is_overridden&&d.value||"",_show:!1}))}catch(l){_(l?.message??"加载区域覆盖失败"),M.value=[]}finally{j.value=!1}}function de(s){const l={name:c.name||"",description:c.description||"",categories:g.value.slice().sort((t,d)=>t-d).join(","),enable:c.enable||!1,fields:h.value.map(t=>({key:t.key,description:t.description,encrypted:t.encrypted,def_value:t.def_value,sort:t.sort}))};return s?l.id=c.id||"":l.id=a.value.id,l}function ce(){const s={};return M.value.forEach(l=>{s[l.key]=l._input||""}),s}async function q(s){const l=s||!a.value;if(b.value===0){const t=de(l);if(!t.id||!t.name)return _("服务ID 和名称 必填"),!1;const d=l?"addsvcconfig":"updatesvcconfig";try{const i=await k(d,t);return a.value=i,await L(),U("保存成功"),!0}catch(i){return _(i?.message??"保存失败"),!1}}else{const t=ce();try{return await k("savesvcregionoverride",{svc_id:a.value.id,region:b.value,overrides:t}),U("区域覆盖已保存"),!0}catch(d){return _(d?.message??"保存失败"),!1}}}async function ue(){if(a.value&&window.confirm("确定删除服务「"+a.value.name+"」及其所有区域覆盖?")){try{await k("delsvcconfig",{id:a.value.id})}catch(s){_(s?.message??"删除失败");return}a.value=null,U("已删除"),await L(),m.value="empty"}}const N=p(!1),O=p(!1),K=p(""),P=p(""),f=p([]),Q=le(()=>S.filter(s=>s.value!==b.value));function F(s){O.value=s;const l=a.value?a.value.name:c.name||"新服务",t=b.value===0;K.value=t?"「"+l+"」默认配置将保存,可同步推送到其他区域。":"「"+l+"」在当前区域的字段覆盖将保存,可同步到其他区域。",P.value=t?"✦ 同步内容:各字段<b>默认值</b>推送为目标区域「覆盖值」,目标区域原有覆盖值将被替换。":"✦ 同步内容:当前区域的字段覆盖值复制到目标区域。",f.value=[],N.value=!0}function W(s){const l=f.value.indexOf(s);l>=0?f.value.splice(l,1):f.value.push(s)}function X(s){f.value=s?Q.value.map(l=>l.value):[]}function Y(){N.value=!1}async function re(){Y(),await q(O.value)}async function ve(){const s=f.value.slice();if(Y(),!await q(O.value)||!s.length)return;const t=a.value?a.value.id:null;if(!t)return;let d=0;try{d=(await k("syncsvctoregins",{svc_id:t,src_region:b.value,target_regions:s}))?.synced??0}catch(C){_(C?.message??"同步失败");return}const i=s.map(C=>{const Z=S.find(pe=>pe.value===C);return Z?Z.label:"区域"+C});U("已保存并同步到:"+i.join("、")+"("+d+" 个)")}return xe(L),(s,l)=>(o(),n("div",null,[e("div",ke,[l[15]||(l[15]=e("div",null,[e("h2",{class:"text-lg font-semibold text-slate-800"},"依赖服务配置"),e("p",{class:"text-xs text-slate-400 mt-1"},"配置火山引擎、阿里云等第三方服务;字段支持加密存储。默认配置全区域共用,可按区域覆盖字段值。")],-1)),e("div",we,[r(e("select",{"onUpdate:modelValue":l[0]||(l[0]=t=>b.value=t),class:"select select-bordered select-sm",onChange:se},[l[14]||(l[14]=e("option",{value:0},"默认(全区域)",-1)),(o(),n(v,null,y(S,t=>e("option",{key:t.value,value:t.value},u(t.label),9,Ce)),64))],544),[[me,b.value,void 0,{number:!0}]]),r(e("button",{class:"btn btn-primary btn-sm text-white",onClick:oe},"+ 新增服务",512),[[ee,b.value===0]])])]),e("div",Ve,[e("div",Se,[e("div",Ue,[(o(!0),n(v,null,y(T.value,t=>(o(),n("div",{key:t.id,class:R(["svc-item",{active:a.value&&a.value.id===t.id}]),onClick:d=>D(t)},[e("div",{class:"svc-logo",style:w({background:t.color||"#6366f1"})},u(t.icon||(t.name||"").charAt(0)),5),e("div",Me,[e("div",De,[e("span",Ae,u(t.name),1),e("span",{class:R(["badge badge-xs",t.enable?"badge-success":"badge-ghost"])},u(t.enable?"启用":"停用"),3)]),e("div",$e,[(o(!0),n(v,null,y(B(t.categories),d=>(o(),n("span",{key:d,class:"cat-chip",style:w({color:$(d).color,background:$(d).bg})},u($(d).short),5))),128)),E(t)?(o(),n("span",je,"🔒"+u(E(t)),1)):I("",!0)])])],10,Te))),128)),T.value.length?I("",!0):(o(),n("p",Le,"暂无服务"))])]),e("div",Ne,[e("div",Oe,[m.value==="empty"?(o(),n("div",Fe,[...l[16]||(l[16]=[e("div",{class:"text-5xl mb-3"},"⚙️",-1),e("p",{class:"text-sm"},"从左侧选择一个服务开始配置",-1)])])):m.value==="default"&&a.value?(o(),n(v,{key:1},[e("div",Ie,[e("div",Re,[e("div",{class:"svc-logo",style:w({background:a.value.color||"#6366f1",width:"44px",height:"44px",fontSize:"20px"})},u(a.value.icon||(a.value.name||"").charAt(0)),5),e("div",null,[e("h3",ze,u(a.value.name),1),e("p",Be,u(a.value.id),1)])]),e("div",Ee,[e("button",{class:"btn btn-error btn-sm btn-outline",onClick:ue},"删除服务"),e("button",{class:"btn btn-primary btn-sm text-white",onClick:l[1]||(l[1]=t=>F(!1))},"保存")])]),l[23]||(l[23]=e("div",{class:"divider text-xs text-slate-400 my-3"},"基本信息",-1)),e("div",He,[e("div",Ge,[l[17]||(l[17]=e("label",{class:"label"},[e("span",{class:"label-text"},"服务名称 *")],-1)),r(e("input",{"onUpdate:modelValue":l[2]||(l[2]=t=>c.name=t),class:"input input-bordered"},null,512),[[x,c.name]])]),e("div",Je,[l[18]||(l[18]=e("label",{class:"label"},[e("span",{class:"label-text"},"启用")],-1)),r(e("input",{"onUpdate:modelValue":l[3]||(l[3]=t=>c.enable=t),type:"checkbox",class:"toggle toggle-primary mt-3"},null,512),[[V,c.enable]])])]),e("div",qe,[l[19]||(l[19]=e("label",{class:"label"},[e("span",{class:"label-text"},"服务描述")],-1)),r(e("input",{"onUpdate:modelValue":l[4]||(l[4]=t=>c.description=t),class:"input input-bordered"},null,512),[[x,c.description]])]),e("div",Ke,[l[20]||(l[20]=e("p",{class:"text-sm font-medium text-slate-700 mb-2"},[te("服务类别 "),e("span",{class:"text-slate-400 text-xs"},"(可多选)")],-1)),e("div",Pe,[(o(),n(v,null,y(A,t=>e("label",{key:t.v,class:"flex items-center gap-2 cursor-pointer"},[r(e("input",{type:"checkbox",class:"checkbox checkbox-sm checkbox-primary",value:t.v,"onUpdate:modelValue":l[5]||(l[5]=d=>g.value=d)},null,8,Qe),[[V,g.value]]),e("span",{class:"cat-chip",style:w({color:t.color,background:t.bg})},u(t.short),5),e("span",We,u(t.label),1)])),64))])]),l[24]||(l[24]=e("div",{class:"divider text-xs text-slate-400 my-3"},"自定义字段",-1)),e("div",null,[h.value.length?(o(),n("div",Ye,[e("table",Ze,[l[22]||(l[22]=e("thead",null,[e("tr",null,[e("th",{class:"w-32"},"字段名"),e("th",null,"字段描述"),e("th",{class:"w-16 text-center"},"加密"),e("th",null,"默认值"),e("th",{class:"w-12"})])],-1)),e("tbody",null,[(o(!0),n(v,null,y(h.value,(t,d)=>(o(),n("tr",{key:d},[e("td",null,[r(e("input",{class:"field-input","onUpdate:modelValue":i=>t.key=i,placeholder:"key"},null,8,et),[[x,t.key]])]),e("td",null,[r(e("input",{class:"field-input","onUpdate:modelValue":i=>t.description=i,placeholder:"用途描述"},null,8,tt),[[x,t.description]])]),e("td",lt,[r(e("input",{type:"checkbox",class:"checkbox checkbox-xs checkbox-primary","onUpdate:modelValue":i=>t.encrypted=i},null,8,st),[[V,t.encrypted]])]),e("td",null,[t.encrypted?(o(),n(v,{key:0},[e("div",nt,[r(e("input",{type:t._show?"text":"password",class:"field-input pr-14","onUpdate:modelValue":i=>t.def_value=i,placeholder:"留空保留原值"},null,8,ot),[[z,t.def_value]]),e("button",{type:"button",class:"absolute right-2 top-1/2 -translate-y-1/2 text-xs text-slate-400 hover:text-slate-700",onClick:i=>t._show=!t._show},u(t._show?"隐藏":"显示"),9,at)]),l[21]||(l[21]=e("span",{class:"lock-badge ml-1"},"🔒 加密",-1))],64)):r((o(),n("input",{key:1,class:"field-input","onUpdate:modelValue":i=>t.def_value=i},null,8,it)),[[x,t.def_value]])]),e("td",null,[e("button",{class:"btn btn-ghost btn-xs text-error",onClick:i=>J(d)},"×",8,dt)])]))),128))])])])):(o(),n("p",Xe,"尚无自定义字段,点击下方添加")),e("button",{class:"btn btn-ghost btn-sm mt-2 text-primary",onClick:G},"+ 添加字段")])],64)):m.value==="new"?(o(),n(v,{key:2},[e("div",ct,[l[25]||(l[25]=e("h3",{class:"text-base font-semibold text-slate-800"},"新增依赖服务",-1)),e("div",ut,[e("button",{class:"btn btn-ghost btn-sm",onClick:ae},"取消"),e("button",{class:"btn btn-primary btn-sm text-white",onClick:l[6]||(l[6]=t=>F(!0))},"创建")])]),l[32]||(l[32]=e("div",{class:"divider text-xs text-slate-400 my-3"},"基本信息",-1)),e("div",rt,[e("div",vt,[l[26]||(l[26]=e("label",{class:"label"},[e("span",{class:"label-text"},[te("服务ID * "),e("span",{class:"text-slate-400 text-xs"},"(唯一,如 volcengine)")])],-1)),r(e("input",{"onUpdate:modelValue":l[7]||(l[7]=t=>c.id=t),class:"input input-bordered font-mono",placeholder:"volcengine"},null,512),[[x,c.id]])]),e("div",pt,[l[27]||(l[27]=e("label",{class:"label"},[e("span",{class:"label-text"},"服务名称 *")],-1)),r(e("input",{"onUpdate:modelValue":l[8]||(l[8]=t=>c.name=t),class:"input input-bordered",placeholder:"火山引擎"},null,512),[[x,c.name]])])]),e("div",bt,[l[28]||(l[28]=e("label",{class:"label"},[e("span",{class:"label-text"},"服务描述")],-1)),r(e("input",{"onUpdate:modelValue":l[9]||(l[9]=t=>c.description=t),class:"input input-bordered",placeholder:"简述该服务的用途"},null,512),[[x,c.description]])]),e("div",xt,[l[29]||(l[29]=e("p",{class:"text-sm font-medium text-slate-700 mb-2"},"服务类别",-1)),e("div",mt,[(o(),n(v,null,y(A,t=>e("label",{key:t.v,class:"flex items-center gap-2 cursor-pointer"},[r(e("input",{type:"checkbox",class:"checkbox checkbox-sm checkbox-primary",value:t.v,"onUpdate:modelValue":l[10]||(l[10]=d=>g.value=d)},null,8,ht),[[V,g.value]]),e("span",{class:"cat-chip",style:w({color:t.color,background:t.bg})},u(t.short),5),e("span",yt,u(t.label),1)])),64))])]),l[33]||(l[33]=e("div",{class:"divider text-xs text-slate-400 my-3"},"自定义字段",-1)),e("div",null,[h.value.length?(o(),n("div",_t,[e("table",gt,[l[31]||(l[31]=e("thead",null,[e("tr",null,[e("th",{class:"w-32"},"字段名"),e("th",null,"字段描述"),e("th",{class:"w-16 text-center"},"加密"),e("th",null,"默认值"),e("th",{class:"w-12"})])],-1)),e("tbody",null,[(o(!0),n(v,null,y(h.value,(t,d)=>(o(),n("tr",{key:d},[e("td",null,[r(e("input",{class:"field-input","onUpdate:modelValue":i=>t.key=i,placeholder:"key"},null,8,kt),[[x,t.key]])]),e("td",null,[r(e("input",{class:"field-input","onUpdate:modelValue":i=>t.description=i,placeholder:"用途描述"},null,8,wt),[[x,t.description]])]),e("td",Ct,[r(e("input",{type:"checkbox",class:"checkbox checkbox-xs checkbox-primary","onUpdate:modelValue":i=>t.encrypted=i},null,8,Vt),[[V,t.encrypted]])]),e("td",null,[t.encrypted?(o(),n(v,{key:0},[e("div",St,[r(e("input",{type:t._show?"text":"password",class:"field-input pr-14","onUpdate:modelValue":i=>t.def_value=i,placeholder:"留空保留原值"},null,8,Ut),[[z,t.def_value]]),e("button",{type:"button",class:"absolute right-2 top-1/2 -translate-y-1/2 text-xs text-slate-400 hover:text-slate-700",onClick:i=>t._show=!t._show},u(t._show?"隐藏":"显示"),9,Tt)]),l[30]||(l[30]=e("span",{class:"lock-badge ml-1"},"🔒 加密",-1))],64)):r((o(),n("input",{key:1,class:"field-input","onUpdate:modelValue":i=>t.def_value=i},null,8,Mt)),[[x,t.def_value]])]),e("td",null,[e("button",{class:"btn btn-ghost btn-xs text-error",onClick:i=>J(d)},"×",8,Dt)])]))),128))])])])):(o(),n("p",ft,"尚无自定义字段,点击下方添加")),e("button",{class:"btn btn-ghost btn-sm mt-2 text-primary",onClick:G},"+ 添加字段")])],64)):m.value==="region"&&a.value?(o(),n(v,{key:3},[j.value?(o(),n("div",At,"加载中...")):(o(),n(v,{key:1},[e("div",$t,[e("div",jt,[e("div",{class:"svc-logo",style:w({background:a.value.color||"#6366f1",width:"44px",height:"44px",fontSize:"20px"})},u(a.value.icon||(a.value.name||"").charAt(0)),5),e("div",null,[e("h3",Lt,u(a.value.name),1),e("span",Nt,u(H.value)+" 覆盖模式",1)])]),e("button",{class:"btn btn-primary btn-sm text-white",onClick:l[11]||(l[11]=t=>F(!1))},"保存覆盖")]),e("div",Ot," ✦ 当前编辑「"+u(H.value)+"」的字段覆盖值。留空的字段将继承默认值。加密字段留空保留已存储密文。 ",1),e("div",Ft,[e("table",It,[l[35]||(l[35]=e("thead",null,[e("tr",null,[e("th",{class:"w-32"},"字段名"),e("th",null,"字段描述"),e("th",{class:"w-24 text-center"},"状态"),e("th",null,"有效值")])],-1)),e("tbody",null,[(o(!0),n(v,null,y(M.value,(t,d)=>(o(),n("tr",{key:d},[e("td",Rt,u(t.key),1),e("td",zt,u(t.description),1),e("td",Bt,[t.is_overridden?(o(),n("span",Et,"覆盖")):(o(),n("span",Ht,"继承"))]),e("td",null,[t.encrypted?(o(),n(v,{key:0},[e("div",Gt,[r(e("input",{type:t._show?"text":"password",class:"field-input pr-14","onUpdate:modelValue":i=>t._input=i,placeholder:"留空继承默认"},null,8,Jt),[[z,t._input]]),e("button",{type:"button",class:"absolute right-2 top-1/2 -translate-y-1/2 text-xs text-slate-400 hover:text-slate-700",onClick:i=>t._show=!t._show},u(t._show?"隐藏":"显示"),9,qt)]),l[34]||(l[34]=e("span",{class:"lock-badge ml-1"},"🔒",-1))],64)):r((o(),n("input",{key:1,class:"field-input","onUpdate:modelValue":i=>t._input=i,placeholder:"留空继承:"+(t.value||"")},null,8,Kt)),[[x,t._input]])])]))),128))])])])],64))],64)):I("",!0)])])]),r(e("div",Pt,[e("div",Qt,[e("div",Wt,[e("div",Xt,[(o(),n("svg",Yt,[...l[36]||(l[36]=[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z"},null,-1)])]))]),e("div",null,[l[37]||(l[37]=e("h3",{class:"text-base font-semibold text-slate-800"},"同步到其他区域",-1)),e("p",Zt,u(K.value),1)])]),e("div",{class:"text-xs px-3 py-2 rounded-lg mb-3",style:{background:"#f0fdf4",border:"1px solid #bbf7d0",color:"#15803d"},innerHTML:P.value},null,8,el),e("div",tl,[l[38]||(l[38]=e("span",{class:"text-xs font-semibold text-slate-500"},"选择目标区域",-1)),e("div",ll,[e("button",{class:"btn btn-ghost btn-xs",onClick:l[12]||(l[12]=t=>X(!0))},"全选"),e("button",{class:"btn btn-ghost btn-xs",onClick:l[13]||(l[13]=t=>X(!1))},"清空")])]),e("div",sl,[(o(!0),n(v,null,y(Q.value,t=>(o(),n("label",{key:t.value,class:R(["sync-region-item",{checked:f.value.includes(t.value)}]),onClick:d=>W(t.value)},[e("input",{type:"checkbox",class:"checkbox checkbox-xs checkbox-primary",checked:f.value.includes(t.value),onClick:ye(d=>W(t.value),["stop"])},null,8,ol),e("span",null,u(t.label),1)],10,nl))),128))]),l[39]||(l[39]=e("p",{class:"text-[11px] text-slate-400 mb-5"},"⚠ 已勾选区域中与当前配置相同的字段将被覆盖;加密字段密文一并同步。",-1)),e("div",{class:"flex gap-3 justify-end"},[e("button",{class:"btn btn-ghost",onClick:re},"仅保存当前区域"),e("button",{class:"btn btn-primary text-white",onClick:ve},"保存并同步")])])],512),[[ee,N.value]])]))}}),rl=fe(al,[["__scopeId","data-v-8f55f9ae"]]);export{rl as default};
|
|
|