mirror of
https://github.com/lkddi/nexusphp.git
synced 2026-04-14 20:40:49 +08:00
2 lines
2.9 KiB
JavaScript
Vendored
2 lines
2.9 KiB
JavaScript
Vendored
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{r as o,i,b as s,t as d,u as p,v as c,p as u,d as g,e as h,j as b,o as f,c as m,f as y,k as w,g as x,h as C}from"./index.74b68f27.js";import{u as _,r as v}from"./table.9f49d458.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=h("el-button"),i=h("el-table-column"),s=h("el-popconfirm"),d=h("el-table"),p=h("el-pagination"),c=h("el-card"),u=b("loading");return f(),m(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;
|