import{_ as a}from"./index.js?v=1749179669910";import{_ as e}from"./index.vue_vue_type_script_setup_true_lang.js?v=1749179669910";import{N as t,m as s}from"./page_layout.js?v=1749179669910";import{b8 as l,c as i,b9 as n,ba as o}from"./site.js?v=1749179669910";import{e as d,c as r,f as m,a as u}from"./public.js?v=1749179669910";import{_ as c,T as p,bU as _,bZ as v,cj as f}from"./naive.js?v=1749179669910";import{d as x,O as b,r as h,j as w,R as P,S as j,P as y,a1 as S,U as g,V as H,aj as C,c as k,a2 as U,M as $}from"./vue.js?v=1749179669910";import"./common.js?v=1749179669910";import"./__commonjsHelpers__.js?v=1749179669910";const B={class:"p-20px"},N={class:"flex-1"},O={class:"mt-12px"},R={class:"px-20px pt-24px pb-8px"},q={class:"w-150px"},D=x({__name:"set",props:{data:{}},setup(x){const{t:D}=b(),E=x,{setOptions:M}=E.data,T=h(""),V=async()=>{const a=T.value.trim();""!==a?(await n({name:a}),T.value="",await K(),null==M||M(I.data)):s.error(D("Site.PHP.index_46"))},Z=d(),z=h(null),A=w({id:-1,name:""}),F={name:{required:!0,message:D("Site.PHP.index_46"),trigger:["blur","change"]}},G=async({hide:a})=>{var e;await(null==(e=z.value)?void 0:e.validate()),await o($(A)),await K(),null==M||M(I.data),a()},{table:I,columns:J}=r([{key:"name",title:"Name"},m({width:120,options:a=>[{label:D("Public.Btn.Edit"),disabled:0===a.id,onClick:()=>{(a=>{A.id=a.id,A.name=a.name,Z.title="".concat(D("Site.PHP.index_48")," [").concat(a.name,"]"),Z.show=!0})(a)}},{label:D("Public.Btn.Delete"),disabled:0===a.id,onClick:()=>{u({title:"".concat(D("Site.PHP.index_49")," [").concat(a.name,"]"),content:D("Site.PHP.index_50"),onConfirm:async({hide:e})=>{await l({id:a.id}),await K(),null==M||M(I.data,a.id),e()}})}}]})]),K=async()=>{const{message:a}=await i();I.data=t(a)?a:[]};return K(),(t,s)=>{const l=c,i=p,n=_,o=v,d=f,r=e,m=a;return P(),j("div",B,[y(n,null,{default:S((()=>[g("div",N,[y(l,{value:H(T),"onUpdate:value":s[0]||(s[0]=a=>C(T)?T.value=a:null),placeholder:t.$t("Site.PHP.index_46")},null,8,["value","placeholder"])]),g("div",null,[y(i,{type:"primary",onClick:V},{default:S((()=>[k(U(t.$t("Site.Cert.index_62")),1)])),_:1})])])),_:1}),g("div",O,[y(o,{"max-height":300,data:H(I).data,columns:H(J)},null,8,["data","columns"])]),y(m,{show:H(Z).show,"onUpdate:show":s[2]||(s[2]=a=>H(Z).show=a),title:H(Z).title,width:350,footer:!0,onConfirm:G},{default:S((()=>[g("div",R,[y(r,{ref_key:"formRef",ref:z,model:H(A),rules:F},{default:S((()=>[y(d,{label:t.$t("Site.PHP.index_47"),path:"name"},{default:S((()=>[g("div",q,[y(l,{value:H(A).name,"onUpdate:value":s[1]||(s[1]=a=>H(A).name=a),placeholder:""},null,8,["value"])])])),_:1},8,["label"])])),_:1},8,["model"])])])),_:1},8,["show","title"])])}}});export{D as default};
