← Back
Editing: index32.js
import{_ as e}from"./index103.js?v=VERSION_NUMBER";import{b as t,N as a}from"./useMethods.js?v=VERSION_NUMBER";import{ay as s,a8 as i,K as l,c1 as n,p as o,c2 as r,n as c,L as m,c3 as u,u as p,aM as d,a6 as h,R as v,e as b}from"./utils-lib.js?v=VERSION_NUMBER";import{c as f,a as y,u as w}from"./column.js?v=VERSION_NUMBER";import{k as g,r as _,c as C,w as j,aB as k,p as x,a4 as R,q as W,v as B,e as O,A as T,y as N,x as q}from"./base-lib.js?v=VERSION_NUMBER";import"./__commonjsHelpers__.js?v=VERSION_NUMBER";import"./index104.js?v=VERSION_NUMBER";const{refs:{customLimit:L,isRefreshNetworkList:A}}=s(),E=g({isRefresh:!0}),H=_([]),I=[{active:!0,label:"添加网络",type:"button",onClick:()=>{c({component:()=>m((()=>import("./index226.js?v=VERSION_NUMBER")),__vite__mapDeps([]),import.meta.url),title:"添加网络",area:58,btn:"添加"})}},{active:!1,label:"清理网络",type:"button",onClick:async()=>{try{await o({type:"calc",title:"清理网络",width:"35rem",content:"您真的要清理未使用的网络吗?"}),l({request:u(),message:!0,loading:"正在清理",success:()=>{A.value=!0}})}catch(e){}}}],J=async e=>{try{await o({type:"calc",title:"删除网络【".concat(e.name,"】"),width:"35rem",content:"您真的要删除网络【".concat(e.name,"】吗?")});const t={id:e.id};l({request:r({data:JSON.stringify(t)}),message:!0,success:()=>{A.value=!0}})}catch(t){}},M=i([{label:"删除项目",value:"delete",event:async(e,t,a,s)=>{const{label:i,value:l}=s,n=async(e,t)=>{const{id:a}=e;if("delete"===l){const e={id:a};return await r({data:JSON.stringify(e)})}};await e({title:"批量".concat(i,"网络"),content:"批量".concat(i,"已选的网络,是否继续操作!"),column:[{label:"网络名",prop:"name"},f()],onConfirm:async()=>(await t(n),A.value=!0,!1)})}}]),P=(e,t)=>{setTimeout((()=>{L.value.network||((e,t)=>{setTimeout((()=>{e.value>900?t.value.limit=20:t.value.limit=10}),0)})(e,t)}),0)},S={class:"relative container-table-tab"},D={class:"flex items-center"},K=b(C({__name:"index",setup(i){const{refs:{isRefreshNetworkList:o}}=s(),{mainHeight:r}=p(),{BtOperation:c}=d({options:I});j((()=>o.value),(e=>{o.value&&(E.isRefresh=!0,g())}));const{BtTable:m,BtPage:u,BtBatch:b,BtColumn:f,refresh:g,param:_}=h({request:e=>(async e=>{if(A.value=!1,!E.isRefresh)return{data:t({limit:e.limit,list:H.value,p:e.p})||[],total:H.value.length};E.isRefresh=!1;const a=await l({request:n(),data:Array});return H.value=a,{data:t({limit:e.limit,list:H.value,p:e.p})||[],total:H.value.length}})(e),columns:[y(),{label:"网络名",prop:"name",showOverflowTooltip:!0,minWidth:100},{label:"设备",prop:"driver",minWidth:100,isCustom:!0},{label:"ipv4网络号",prop:"subnet",minWidth:100,isCustom:!0},{label:"ipv4网关",prop:"gateway",minWidth:100,isCustom:!0},{label:"ipv6网络号",prop:"subnetv6",minWidth:100,isCustom:!1},{label:"ipv6网关",prop:"gatewayv6",minWidth:100,isCustom:!1},{label:"标签",prop:"labels",minWidth:100,showOverflowTooltip:!0,isCustom:!0,render:e=>{if(!e.labels)return k("span","");return(Object.entries(e.labels)||[]).map((e=>"".concat(e[0],":").concat(e[1]))).join(",")}},{label:"创建时间",prop:"time",minWidth:100,isCustom:!0,render:e=>v(e.time)},w([{onClick:J,title:"删除"}])],extension:[M]});return x((async()=>{P(r,_)})),R((()=>{E.isRefresh=!0,H.value=[]})),(t,s)=>{const i=e;return W(),B("div",S,[O(i,null,{"header-left":T((()=>[N("div",D,[O(q(c)),N("a",{class:"ml-[1rem] bt-link",onClick:s[0]||(s[0]=e=>q(a)())},"需求反馈")])])),"header-right":T((()=>[O(q(f))])),content:T((()=>[O(q(m),{key:"NetTable","max-height":q(r)-220},null,8,["max-height"])])),"footer-left":T((()=>[O(q(b))])),"footer-right":T((()=>[O(q(u))])),popup:T((()=>s[1]||(s[1]=[]))),_:1})])}}}),[["__scopeId","data-v-7cbd071d"]]);export{K as default}; function __vite__mapDeps(indexes) { if (!__vite__mapDeps.viteFileDeps) { __vite__mapDeps.viteFileDeps = [] } return indexes.map((i) => __vite__mapDeps.viteFileDeps[i]) }
Save File
Cancel