import{c as e,d as a,h as t,f as s,a as n,e as l,_ as o}from"./public.js?v=1763625242172";import{_ as i}from"./index.js?v=1763625242172";import{_ as r}from"./index.vue_vue_type_script_setup_true_lang5.js?v=1763625242172";import{_ as u}from"./index.vue_vue_type_script_setup_true_lang7.js?v=1763625242172";import{c as d,m as c,y as p}from"./page_layout.js?v=1763625242172";import{g as m,a as _,d as y,b as g,s as f}from"./compiler.js?v=1763625242172";import{k as x,P as h,R as w,S as v,X as C,a3 as S,j,a4 as b,V as I,aj as k,e as $,N as L,U as R,F as U,r as z}from"./vue.js?v=1763625242172";import{dk as T,aC as F,dS as N,dj as P,d9 as B}from"./naive.js?v=1763625242172";import"./common.js?v=1763625242172";import"./__commonjsHelpers__.js?v=1763625242172";import"./index.vue_vue_type_script_setup_true_lang6.js?v=1763625242172";const D={class:"p-20px"},H=x({__name:"user",props:{data:{}},setup(s,{expose:n}){const{t:l}=h(),o=s,{getList:i}=o.data,{keys:r,table:u,columns:p}=e([{type:"selection",width:40},{key:"id",title:l("Site.TableRow.index_2")}]),{loading:y,setLoading:g}=a();(async()=>{try{g(!0);const{message:e}=await m();d(e)&&(u.data=e.data.map((e=>({id:e}))))}finally{r.value=[],g(!1)}})();return n({onConfirm:async()=>{if(!r.value.length)return c.error(l("Security.Compiler.Index_5")),!1;await _({users:JSON.stringify(r.value)}),null==i||i()}}),(e,a)=>{const s=T,n=t;return w(),v("div",D,[C(s,{"show-icon":!1,class:"mb-15px"},{default:S((()=>[j(b(e.$t("Security.Compiler.Index_3")),1)])),_:1}),C(n,{"checked-row-keys":I(r),"onUpdate:checkedRowKeys":a[0]||(a[0]=e=>k(r)?r.value=e:null),"row-key":"id",loading:I(y),data:I(u).data,"max-height":250,columns:I(p)},null,8,["checked-row-keys","loading","data","columns"])])}}}),J=x({__name:"index",setup(c){const{t:m}=h(),_=()=>{P.show=!0},f=$({p:1,limit:10}),{table:x,columns:k}=e([{key:"name",title:m("Site.TableRow.index_2")},s({width:130,options:e=>[{label:m("Public.Btn.Del"),onClick:()=>{n({title:"".concat(m("Ftp.Table.index_10")," ").concat(e.name),content:m("Security.Compiler.Index_6"),onConfirm:async()=>{await y({user:e.name}),N()}})}}]})]),{loading:z,setLoading:T}=a(),N=async()=>{try{T(!0);const{message:e}=await g(L(f));d(e)&&(x.data=e.data.map((e=>({name:e}))),x.total=p(e.page))}finally{T(!1)}};N();const P=l(m("Security.Compiler.Index_1"),{getList:N});return(e,a)=>{const s=F,n=t,l=u,d=r,c=o,p=i;return w(),v(U,null,[C(d,null,{toolsLeft:S((()=>[C(s,{type:"primary",onClick:_},{default:S((()=>[j(b(e.$t("Security.Compiler.Index_1")),1)])),_:1})])),table:S((()=>[C(n,{loading:I(z),data:I(x).data,columns:I(k)},null,8,["loading","data","columns"])])),pageRight:S((()=>[C(l,{page:I(f).p,"onUpdate:page":a[0]||(a[0]=e=>I(f).p=e),"page-size":I(f).limit,"onUpdate:pageSize":a[1]||(a[1]=e=>I(f).limit=e),"item-count":I(x).total,onRefresh:N},null,8,["page","page-size","item-count"])])),_:1}),C(c,null,{default:S((()=>[R("li",null,b(e.$t("Security.Compiler.Index_2")),1)])),_:1}),C(p,{show:I(P).show,"onUpdate:show":a[2]||(a[2]=e=>I(P).show=e),title:I(P).title,data:I(P).data,width:600,"min-height":350,footer:!0,component:H},null,8,["show","title","data"])],64)}}}),K=x({__name:"index",setup(e){const{t:t}=h(),s=z(!1),l=async e=>{s.value=!e;const a=t("Security.Conf.Index_35"),l=t("Security.Conf.Index_36");n({title:a,content:l,onConfirm:async({hide:a})=>{try{await f({status:e?1:0}),c.success(t("Security.Compiler.Index_4")),a(),s.value=e}catch(n){console.error(n)}}})},{loading:o,setLoading:i}=a(!0);return(async()=>{i(!0);const{message:e}=await f(null,!1);d(e)&&(s.value=e.result),i(!1)})(),(e,a)=>{const t=P,n=B,i=N,r=T;return w(),v(U,null,[C(i,null,{default:S((()=>[C(n,{class:"p-15px items-center"},{default:S((()=>[R("span",null,b(e.$t("Security.Conf.Index_30")),1),C(t,{value:I(s),"onUpdate:value":[a[0]||(a[0]=e=>k(s)?s.value=e:null),l],loading:I(o),"rubber-band":!1,size:"small"},null,8,["value","loading"])])),_:1})])),_:1}),C(i,{class:"mt-15px p-15px"},{default:S((()=>[R("h3",null,b(e.$t("Security.Conf.Index_31",[I(s)?e.$t("Security.Conf.Index_33"):e.$t("Security.Conf.Index_34")])),1),C(r,{"show-icon":!1,class:"my-15px"},{default:S((()=>[j(b(e.$t("Security.Conf.Index_32")),1)])),_:1}),C(J)])),_:1})],64)}}});export{K as default};
