import{_ as a}from"./index.js?v=1763625242172";import{_ as e}from"./index.vue_vue_type_script_setup_true_lang.js?v=1763625242172";import{fe as t,a5 as s,x as l,m as i,ff as n,fg as o}from"./page_layout.js?v=1763625242172";import{e as d,c as r,f as m,a as p}from"./public.js?v=1763625242172";import{au as u,aC as c,d9 as _,dg as f,dP as v}from"./naive.js?v=1763625242172";import{k as x,P as h,r as w,e as y,R as P,S as j,X as g,a3 as S,U as b,V as H,aj as C,j as k,a4 as U,N as $}from"./vue.js?v=1763625242172";import"./common.js?v=1763625242172";import"./__commonjsHelpers__.js?v=1763625242172";const N={class:"p-20px"},R={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:X}=V.data,z=w(""),A=async()=>{const a=z.value.trim();""!==a?(await n({name:a}),z.value="",await M(),null==X||X(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($(G)),await M(),null==X||X(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==X||X(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 P(),j("div",N,[g(n,null,{default:S((()=>[b("div",R,[g(l,{value:H(z),"onUpdate:value":s[0]||(s[0]=a=>C(z)?z.value=a:null),placeholder:t.$t("Site.PHP.index_46")},null,8,["value","placeholder"])]),b("div",null,[g(i,{type:"primary",onClick:A},{default:S((()=>[k(U(t.$t("Site.Cert.index_62")),1)])),_:1})])])),_:1}),b("div",q,[g(o,{"max-height":300,data:H(K).data,columns:H(L)},null,8,["data","columns"])]),g(m,{show:H(B).show,"onUpdate:show":s[2]||(s[2]=a=>H(B).show=a),title:H(B).title,width:350,footer:!0,onConfirm:J},{default:S((()=>[b("div",D,[g(r,{ref_key:"formRef",ref:F,model:H(G),rules:I},{default:S((()=>[g(d,{label:t.$t("Site.PHP.index_47"),path:"name"},{default:S((()=>[b("div",E,[g(l,{value:H(G).name,"onUpdate:value":s[1]||(s[1]=a=>H(G).name=a),placeholder:""},null,8,["value"])])])),_:1},8,["label"])])),_:1},8,["model"])])])),_:1},8,["show","title"])])}}});export{O as default};
