var e=Object.defineProperty,a=Object.prototype.hasOwnProperty,t=Object.getOwnPropertySymbols,l=Object.prototype.propertyIsEnumerable,r=(a,t,l)=>t in a?e(a,t,{enumerable:!0,configurable:!0,writable:!0,value:l}):a[t]=l,n=(e,n)=>{for(var o in n||(n={}))a.call(n,o)&&r(e,o,n[o]);if(t)for(var o of t(n))l.call(n,o)&&r(e,o,n[o]);return e};import{k as o,o as s,a as d,t as i,u,q as c,p as m,m as p,b as g,c as h,d as f,e as b,w as C,f as y,j as x}from"./index.a0f02932.js";import{u as w,r as v,a as S}from"./table.388c40bd.js";const _={name:"ExamUserTable",setup(){const e=o(null),a=u(),t=w();s((()=>{l()}));const l=async()=>{t.loading=!0;let e=await d.listExamUser(t.query);v(e,t),t.loading=!1};return n(n({},i(t)),{multipleTable:e,handleSelectionChange:e=>{t.multipleSelection=e},handleAdd:()=>{a.push({name:"user-form"})},handleEdit:e=>{a.push({name:"user-form",query:{id:e}})},handleDelete:async e=>{let a=await d.deleteExam(e);c.success(a.msg),t.query.page=1,await l()},handleDetail:e=>{a.push({name:"user-detail",query:{id:e}})},fetchTableData:l,changePage:e=>{t.query.page=e,l()},handleSortChange:e=>{S(e,t),l()},formatColumnUser:(e,a)=>e.user.username,formatColumnExam:(e,a)=>e.exam.name,formatColumnDownloaded:(e,a)=>e.downloaded_text})}},E=x();m("data-v-d8d731de");const j=y("div",{class:"nexus-table-header"},[y("div",{class:"left"}),y("div",{class:"right"})],-1);p();const D=E(((e,a,t,l,r,n)=>{const o=g("el-table-column"),s=g("el-table"),d=g("el-pagination"),i=g("el-card"),u=h("loading");return f(),b(i,null,{header:E((()=>[j])),default:E((()=>[C(y(s,{ref:"multipleTable",data:e.tableData,"tooltip-effect":"dark",onSortChange:l.handleSortChange,onSelectionChange:l.handleSelectionChange},{default:E((()=>[y(o,{type:"selection",width:"55"}),y(o,{prop:"id",label:"Id",width:"60",sortable:"custom"}),y(o,{prop:"exam_id",label:"Exam",formatter:l.formatColumnExam},null,8,["formatter"]),y(o,{prop:"uid",label:"User",formatter:l.formatColumnUser},null,8,["formatter"]),y(o,{prop:"is_done_text",label:"Is done"}),y(o,{prop:"created_at",label:"Created At"}),y(o,{label:"Action",width:"100"},{default:E((e=>[y("a",{style:{cursor:"pointer","margin-right":"10px"},onClick:a=>l.handleDetail(e.row.uid)},"Detail",8,["onClick"])])),_:1})])),_:1},8,["data","onSortChange","onSelectionChange"]),[[u,e.loading]]),y(d,{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})}));_.render=D,_.__scopeId="data-v-d8d731de";export default _;
