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