import{v as B,h as D,fG as R,O as A,n as E,x as T,m as U,fH as V,fI as I}from"./index-BTglIPU2.js?v=1773287522785";import{_ as M}from"./index.vue_vue_type_script_setup_true_lang-D8O2mMsP.js?v=1773287522785";import{u as j}from"./useTableColumns-DDeyYvje.js?v=1773287522785";import{u as q}from"./useTableData-BmkIKQ_R.js?v=1773287522785";import{b as G,B as L,k as X,at as Z,a1 as z}from"./naive-ui--dJnpVcV.js?v=1773287522785";import{k as F,R as J,r as y,e as K,$ as Q,Z as W,a0 as o,a9 as r,_ as d,X as Y,S as n,j as O,aa as tt,N as et}from"./vue-core-DJjvd5ZC.js?v=1773287522785";import"./prismjs-BZPoR7_J.js?v=1773287522785";import"./index-S15tYq5l.js?v=1773287522785";import"./copy-D-wIKr0q.js?v=1773287522785";import"./index-DIKmrNCq.js?v=1773287522785";import"./index.vue_vue_type_script_setup_true_lang-DeTfbeeM.js?v=1773287522785";import"./index-Cg6fMjw6.js?v=1773287522785";const at={class:"p-20px"},nt={class:"flex-1"},ot={class:"mt-12px"},st={class:"px-20px pt-24px pb-8px"},it={class:"w-150px"},ht=F({__name:"set",props:{data:{}},setup(v){const{t:i}=J(),x=v,{setOptions:a}=x.data,l=y(""),h=async()=>{const t=l.value.trim();if(t===""){U.error(i("Site.PHP.index_46"));return}await V({name:t}),l.value="",await c(),a==null||a(m.data)},_=B(),u=y(null),s=K({type_id:-1,name:""}),b={name:{required:!0,message:i("Site.PHP.index_46"),trigger:["blur","change"]}},g=t=>{s.type_id=t.type_id,s.name=t.name,_.title="".concat(i("Site.PHP.index_48")," [").concat(t.name,"]"),_.show=!0},w=async({hide:t})=>{var e;await((e=u.value)==null?void 0:e.validate()),await I(et(s)),await c(),a==null||a(m.data),t()},{table:m,columns:P}=q([{key:"name",title:"Name"},j({width:80,options:t=>[{label:"Edit",onClick:()=>{g(t)}},{label:"Del",onClick:()=>{D({title:"".concat(i("Site.PHP.index_49")," [").concat(t.name,"]"),content:i("Site.PHP.index_50"),onConfirm:async({hide:e})=>{await R({type_id:t.type_id}),await c(),a==null||a(m.data,t.type_id),e()}})}}]})]),c=async()=>{const{message:t}=await A();m.data=E(t)?t:[]};return c(),(t,e)=>{const f=G,S=L,k=X,C=Z,$=z,H=M,N=T;return Q(),W("div",at,[o(k,null,{default:r(()=>[d("div",nt,[o(f,{value:n(l),"onUpdate:value":e[0]||(e[0]=p=>Y(l)?l.value=p:null),placeholder:t.$t("Site.PHP.index_46")},null,8,["value","placeholder"])]),d("div",null,[o(S,{type:"primary",onClick:h},{default:r(()=>[O(tt(t.$t("Site.Cert.index_62")),1)]),_:1})])]),_:1}),d("div",ot,[o(C,{"max-height":300,data:n(m).data,columns:n(P)},null,8,["data","columns"])]),o(N,{show:n(_).show,"onUpdate:show":e[2]||(e[2]=p=>n(_).show=p),title:n(_).title,width:350,footer:!0,onConfirm:w},{default:r(()=>[d("div",st,[o(H,{ref_key:"formRef",ref:u,model:n(s),rules:b},{default:r(()=>[o($,{label:t.$t("Site.PHP.index_47"),path:"name"},{default:r(()=>[d("div",it,[o(f,{value:n(s).name,"onUpdate:value":e[1]||(e[1]=p=>n(s).name=p),placeholder:""},null,8,["value"])])]),_:1},8,["label"])]),_:1},8,["model"])])]),_:1},8,["show","title"])])}}});export{ht as default};
