import{i as S,m as B,h as L,ap as j,v as M,x as O,c as P}from"./index-BTglIPU2.js?v=1773287522785";import{_ as E}from"./index-DIKmrNCq.js?v=1773287522785";import{_ as J}from"./index.vue_vue_type_script_setup_true_lang-DgjjuUjT.js?v=1773287522785";import{_ as K}from"./index.vue_vue_type_script_setup_true_lang-C5hb-Th7.js?v=1773287522785";import{_ as N}from"./index.vue_vue_type_script_setup_true_lang-BeO8Hyma.js?v=1773287522785";import{u as $}from"./useLoading-CZ2gSAW7.js?v=1773287522785";import{u as X}from"./useTableColumns-DDeyYvje.js?v=1773287522785";import{u as z}from"./useTableData-BmkIKQ_R.js?v=1773287522785";import{g as Z,a as q,d as A,b as H,s as U}from"./compiler-LRY1dVfI.js?v=1773287522785";import{k as I,R as k,$ as v,Z as R,a0 as a,a9 as u,j as T,aa as f,S as t,X as D,e as Q,N as W,F,_ as h,r as Y}from"./vue-core-DJjvd5ZC.js?v=1773287522785";import{ad as G,B as tt,k as et,a8 as nt,a2 as ot}from"./naive-ui--dJnpVcV.js?v=1773287522785";import"./prismjs-BZPoR7_J.js?v=1773287522785";import"./index.vue_vue_type_script_setup_true_lang-B7YvCBmY.js?v=1773287522785";import"./data-BVsViUMm.js?v=1773287522785";import"./index-S15tYq5l.js?v=1773287522785";import"./copy-D-wIKr0q.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"},st=I({__name:"user",props:{data:{}},setup(x,{expose:l}){const{t:s}=k(),_=x,{getList:p}=_.data,{keys:r,table:g,columns:e}=z([{type:"selection",width:40},{key:"id",title:s("Site.TableRow.index_2")}]),{loading:c,setLoading:i}=$();return(async()=>{try{i(!0);const{message:m}=await Z();S(m)&&(g.data=m.data.map(d=>({id:d})))}finally{r.value=[],i(!1)}})(),l({onConfirm:async()=>{if(!r.value.length)return B.error(s("Security.Compiler.Index_5")),!1;await q({users:JSON.stringify(r.value)}),p==null||p()}}),(m,d)=>{const w=G,b=N;return v(),R("div",at,[a(w,{"show-icon":!1,class:"mb-15px"},{default:u(()=>[T(f(m.$t("Security.Compiler.Index_3")),1)]),_:1}),a(b,{"checked-row-keys":t(r),"onUpdate:checkedRowKeys":d[0]||(d[0]=C=>D(r)?r.value=C:null),"row-key":"id",loading:t(c),data:t(g).data,"max-height":250,columns:t(e)},null,8,["checked-row-keys","loading","data","columns"])])}}}),it=I({__name:"index",setup(x){const{t:l}=k(),s=()=>{i.show=!0},_=Q({p:1,limit:10}),{table:p,columns:r}=z([{key:"name",title:l("Site.TableRow.index_2")},X({width:130,options:n=>[{label:l("Public.Btn.Del"),onClick:()=>{L({title:"".concat(l("Ftp.Table.index_10")," ").concat(n.name),content:l("Security.Compiler.Index_6"),onConfirm:async()=>{await A({user:n.name}),c()}})}}]})]),{loading:g,setLoading:e}=$(),c=async()=>{try{e(!0);const{message:n}=await H(W(_));S(n)&&(p.data=n.data.map(o=>({name:o})),p.total=j(n.page))}finally{e(!1)}};c();const i=M(l("Security.Compiler.Index_1"),{getList:c});return(n,o)=>{const m=tt,d=N,w=K,b=J,C=E,V=O;return v(),R(F,null,[a(b,null,{toolsLeft:u(()=>[a(m,{type:"primary",onClick:s},{default:u(()=>[T(f(n.$t("Security.Compiler.Index_1")),1)]),_:1})]),table:u(()=>[a(d,{loading:t(g),data:t(p).data,columns:t(r)},null,8,["loading","data","columns"])]),pageRight:u(()=>[a(w,{page:t(_).p,"onUpdate:page":o[0]||(o[0]=y=>t(_).p=y),"page-size":t(_).limit,"onUpdate:pageSize":o[1]||(o[1]=y=>t(_).limit=y),"item-count":t(p).total,onRefresh:c},null,8,["page","page-size","item-count"])]),_:1}),a(C,null,{default:u(()=>[h("li",null,f(n.$t("Security.Compiler.Index_2")),1)]),_:1}),a(V,{show:t(i).show,"onUpdate:show":o[2]||(o[2]=y=>t(i).show=y),title:t(i).title,data:t(i).data,width:600,"min-height":350,footer:!0,component:st},null,8,["show","title","data"])],64)}}}),lt=I({__name:"index",setup(x){const{t:l}=k(),s=Y(!1),_=async e=>{s.value=!e;const c=l("Security.Conf.Index_35"),i=l("Security.Conf.Index_36");L({title:c,content:i,onConfirm:async({hide:n})=>{try{await U({status:e?1:0}),B.success(l("Security.Compiler.Index_4")),n(),s.value=e}catch(o){console.error(o)}}})},{loading:p,setLoading:r}=$(!0);return(async()=>{r(!0);const{message:e}=await U(null,!1);S(e)&&(s.value=e.result),r(!1)})(),(e,c)=>{const i=nt,n=et,o=ot,m=G;return v(),R(F,null,[a(o,null,{default:u(()=>[a(n,{class:"p-15px items-center"},{default:u(()=>[h("span",null,f(e.$t("Security.Conf.Index_30")),1),a(i,{value:t(s),"onUpdate:value":[c[0]||(c[0]=d=>D(s)?s.value=d:null),_],loading:t(p),"rubber-band":!1,size:"small"},null,8,["value","loading"])]),_:1})]),_:1}),a(o,{class:"mt-15px p-15px"},{default:u(()=>[h("h3",null,f(e.$t("Security.Conf.Index_31",[t(s)?e.$t("Security.Conf.Index_33"):e.$t("Security.Conf.Index_34")])),1),a(m,{"show-icon":!1,class:"my-15px"},{default:u(()=>[T(f(e.$t("Security.Conf.Index_32")),1)]),_:1}),a(it)]),_:1})],64)}}}),kt=P(lt,[["__scopeId","data-v-6f78f08a"]]);export{kt as default};
