import{b as e,c as a,f as t,h as s,d as n,e as l,_ as o}from"./public.js?v=1753954525509";import{_ as i}from"./index.js?v=1753954525509";import{_ as r}from"./index.vue_vue_type_script_setup_true_lang4.js?v=1753954525509";import{_ as u}from"./index.vue_vue_type_script_setup_true_lang5.js?v=1753954525509";import{c,m as d,x as p}from"./page_layout.js?v=1753954525509";import{g as m,a as _,d as y,b as g,s as f}from"./compiler.js?v=1753954525509";import{k as x,P as h,U as w,V as v,Q as C,a2 as S,j as b,a3 as I,X as j,ah as k,e as $,N as L,W as U,F as R,r as z}from"./vue.js?v=1753954525509";import{c6 as T,ay as D,cD as F,c5 as N,bY as P}from"./naive.js?v=1753954525509";import"./common.js?v=1753954525509";import"./__commonjsHelpers__.js?v=1753954525509";import"./index.vue_vue_type_script_setup_true_lang7.js?v=1753954525509";const B={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();c(e)&&(u.data=e.data.map((e=>({id:e}))))}finally{r.value=[],g(!1)}})();return n({onConfirm:async()=>{if(!r.value.length)return d.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",B,[C(s,{"show-icon":!1,class:"mb-15px"},{default:S((()=>[b(I(e.$t("Security.Compiler.Index_3")),1)])),_:1}),C(n,{"checked-row-keys":j(r),"onUpdate:checkedRowKeys":a[0]||(a[0]=e=>k(r)?r.value=e:null),"row-key":"id",loading:j(y),data:j(u).data,"max-height":250,columns:j(p)},null,8,["checked-row-keys","loading","data","columns"])])}}}),J=x({__name:"index",setup(d){const{t:m}=h(),_=()=>{N.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}),F()}})}}]})]),{loading:z,setLoading:T}=a(),F=async()=>{try{T(!0);const{message:e}=await g(L(f));c(e)&&(x.data=e.data.map((e=>({name:e}))),x.total=p(e.page))}finally{T(!1)}};F();const N=l(m("Security.Compiler.Index_1"),{getList:F});return(e,a)=>{const s=D,n=t,l=u,c=r,d=o,p=i;return w(),v(R,null,[C(c,null,{toolsLeft:S((()=>[C(s,{type:"primary",onClick:_},{default:S((()=>[b(I(e.$t("Security.Compiler.Index_1")),1)])),_:1})])),table:S((()=>[C(n,{loading:j(z),data:j(x).data,columns:j(k)},null,8,["loading","data","columns"])])),pageRight:S((()=>[C(l,{page:j(f).p,"onUpdate:page":a[0]||(a[0]=e=>j(f).p=e),"page-size":j(f).limit,"onUpdate:pageSize":a[1]||(a[1]=e=>j(f).limit=e),"item-count":j(x).total,onRefresh:F},null,8,["page","page-size","item-count"])])),_:1}),C(d,null,{default:S((()=>[U("li",null,I(e.$t("Security.Compiler.Index_2")),1)])),_:1}),C(p,{show:j(N).show,"onUpdate:show":a[2]||(a[2]=e=>j(N).show=e),title:j(N).title,data:j(N).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}),d.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);c(e)&&(s.value=e.result),i(!1)})(),(e,a)=>{const t=N,n=P,i=F,r=T;return w(),v(R,null,[C(i,null,{default:S((()=>[C(n,{class:"p-15px items-center"},{default:S((()=>[U("span",null,I(e.$t("Security.Conf.Index_30")),1),C(t,{value:j(s),"onUpdate:value":[a[0]||(a[0]=e=>k(s)?s.value=e:null),l],loading:j(o),"rubber-band":!1,size:"small"},null,8,["value","loading"])])),_:1})])),_:1}),C(i,{class:"mt-15px p-15px"},{default:S((()=>[U("h3",null,I(e.$t("Security.Conf.Index_31",[j(s)?e.$t("Security.Conf.Index_33"):e.$t("Security.Conf.Index_34")])),1),C(r,{"show-icon":!1,class:"my-15px"},{default:S((()=>[b(I(e.$t("Security.Conf.Index_32")),1)])),_:1}),C(J)])),_:1})],64)}}});export{K as default};
