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