var e=Object.defineProperty,a=Object.prototype.hasOwnProperty,t=Object.getOwnPropertySymbols,l=Object.prototype.propertyIsEnumerable,n=(a,t,l)=>t in a?e(a,t,{enumerable:!0,configurable:!0,writable:!0,value:l}):a[t]=l,r=(e,r)=>{for(var o in r||(r={}))a.call(r,o)&&n(e,o,r[o]);if(t)for(var o of t(r))l.call(r,o)&&n(e,o,r[o]);return e};import{k as o,o as i,a as s,t as d,u as p,q as c,p as u,m as g,b,c as h,d as m,e as f,f as y,w,j as x,g as C}from"./index.a0f02932.js";import{u as _,r as v}from"./table.388c40bd.js";const T={name:"ExamTable",setup(){const e=o(null),a=p(),t=_();i((()=>{console.log("ExamTable onMounted"),l()}));const l=async()=>{t.loading=!0;let e=await s.listExam(t.query);v(e,t),t.loading=!1};return r(r({},d(t)),{multipleTable:e,handleSelectionChange:e=>{t.multipleSelection=e},handleAdd:()=>{a.push({name:"exam-form"})},handleEdit:e=>{a.push({path:"/exam-form",query:{id:e}})},handleDelete:async e=>{let a=await s.deleteExam(e);c.success(a.msg),t.query.page=1,await l()},fetchTableData:l,changePage:e=>{t.query.page=e,l()}})}},E=x();u("data-v-3c87518a");const D={class:"nexus-table-header"},j=y("div",{class:"left"},null,-1),k={class:"right"},P=C("Add"),S=y("a",{style:{cursor:"pointer"}},"Delete",-1);g();const O=E(((e,a,t,l,n,r)=>{const o=b("el-button"),i=b("el-table-column"),s=b("el-popconfirm"),d=b("el-table"),p=b("el-pagination"),c=b("el-card"),u=h("loading");return m(),f(c,{class:""},{header:E((()=>[y("div",D,[j,y("div",k,[y(o,{type:"primary",size:"small",icon:"el-icon-plus",onClick:l.handleAdd},{default:E((()=>[P])),_:1},8,["onClick"])])])])),default:E((()=>[w(y(d,{ref:"multipleTable",data:e.tableData,"tooltip-effect":"dark",onSelectionChange:l.handleSelectionChange},{default:E((()=>[y(i,{type:"selection",width:"55"}),y(i,{prop:"id",label:"Id",width:"50"}),y(i,{prop:"name",label:"Name"}),y(i,{label:"Indexes",width:"250px"},{default:E((e=>[y("p",{style:{"white-space":"pre-line"},innerHTML:e.row.indexes_formatted},null,8,["innerHTML"])])),_:1}),y(i,{prop:"begin",label:"Begin",width:"160"}),y(i,{prop:"end",label:"End",width:"160"}),y(i,{prop:"duration_text",label:"Duration"}),y(i,{label:"Target users",width:"350px"},{default:E((e=>[y("p",{style:{"white-space":"pre-line"},innerHTML:e.row.filters_formatted},null,8,["innerHTML"])])),_:1}),y(i,{prop:"is_discovered_text",label:"Discovered"}),y(i,{prop:"status_text",label:"Status"}),y(i,{label:"Action",width:"100"},{default:E((e=>[y("a",{style:{cursor:"pointer","margin-right":"10px"},onClick:a=>l.handleEdit(e.row.id)},"Edit",8,["onClick"]),y(s,{title:"Confirm Delete ?",onConfirm:a=>l.handleDelete(e.row.id)},{reference:E((()=>[S])),_:2},1032,["onConfirm"])])),_:1})])),_:1},8,["data","onSelectionChange"]),[[u,e.loading]]),y(p,{background:"",layout:"prev, pager, next",total:e.total,"page-size":e.perPage,"current-page":e.currentPage,onCurrentChange:l.changePage},null,8,["total","page-size","current-page","onCurrentChange"])])),_:1})}));T.render=O,T.__scopeId="data-v-3c87518a";export default T;
