text: "use strict";(self.webpackChunk=self.webpackChunk||[]).push([[977],{9496:(a,e,t)=>{t.d(e,{Z:()=>s});const s=function(a){return!!a&&moment(a).format("Do MMMM YYYY")}},9977:(a,e,t)=>{t.r(e),t.d(e,{default:()=>l});var s,n=t(9496);function i(a,e,t){return e in a?Object.defineProperty(a,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):a[e]=t,a}const r={filters:{indoDate:function(a){return(0,n.Z)(a)}},data:function(){return{table:{rows:[],columns:[{label:"NISN",field:"nisn"},{label:"Nama Siswa/i",field:"nama",sortable:!0},{label:"Kelas",field:"rombel",sortable:!1},{label:"JK",field:"jenis_kelamin",sortable:!0},{label:"TTL",field:"ttl",sortable:!1},{label:"",field:"aksi",sortable:!1}],totalRows:"",serverParams:{perPage:10,searchTerm:""},perPageDropDown:[10,25,50,100],selectedRows:[]}}},mounted:function(){this.initData()},methods:(s={initData:function(){var a=this,e=this.table.serverParams;axios.get("/api/admin/siswa",{params:e}).then((function(e){a.table.rows=e.data.data,a.table.totalRows=e.data.total}))},liveSearch:function(){this.table.serverParams.manual_filter=1,this.initData()},resetFilter:function(){this.table.serverParams.manual_filter=0;var a=this.rombel.map((function(a){return a.id}));this.table.serverParams.rombel=a,this.table.serverParams.tingkat=["X","XI","XII"],this.table.serverParams.jenis_kelamin=["l","p"],this.table.serverParams.searchTerm="",this.initData()},fitlerToggle:function(){0==this.is_filtered?this.is_filtered=!0:this.is_filtered=!1},selectionChanged:function(a){this.selectionRow=a,this.table.selectedRows=[];for(var e=0;e<a.selectedRows.length;e++)this.table.selectedRows.push(a.selectedRows[e].pg_id)},onColumnSearch:function(a){this.updateParams(a),this.updateParams({page:1}),this.initData()},onPageChange:function(a){this.updateParams({page:a.currentPage}),this.initData()},onPerPageChange:function(a){this.updateParams({perPage:a.currentPerPage}),this.initData()},onSortChange:function(a){this.updateParams({sort_type:a[0].type,sort_field:a[0].field}),this.updateParams({page:1}),this.initData()},onColumnFilter:function(a){a.columnFilters;this.updateParams({page:1}),this.initData()}},i(s,"onColumnSearch",(function(a){this.updateParams(a),this.updateParams({page:1}),this.initData()})),i(s,"loadItems",(function(){this.handleDatatableChange(this.table.serverParams).then((function(){}))})),i(s,"updateParams",(function(a){this.table.serverParams=Object.assign({},this.table.serverParams,a)})),s)};const l=(0,t(1900).Z)(r,(function(){var a=this,e=a.$createElement,t=a._self._c||e;return t("div",[t("div",{staticClass:"card"},[t("div",{staticClass:"card-header"},[t("div",{staticClass:"float-start"},[t("h4",{staticClass:"card-title"},[a._v("Manajemen Data Siswa / Peserta PKL")]),a._v(" "),t("p",{staticClass:"text-muted mb-0"},[a._v("Menampilkan "+a._s(a.table.rows.length)+" Data Siswa / Peserta PKL")])]),a._v(" "),a._m(0)]),a._v(" "),t("div",{staticClass:"card-body"},[t("div",{staticClass:"table-responsive"},[t("vue-good-table",{attrs:{"search-options":{enabled:!0,trigger:"enter",skipDiacritics:!0,placeholder:"Type and enter to search"},mode:"remote",totalRows:a.table.totalRows,"pagination-options":{enabled:!0,mode:"pages",perPage:a.table.serverParams.perPage,position:"bottom",perPageDropdown:a.table.perPageDropDown,dropdownAllowAll:!1,setCurrentPage:a.table.serverParams.page,nextLabel:"Next",prevLabel:"Prev",rowsPerPageLabel:"Rows per page",ofLabel:"of",pageLabel:"page",allLabel:"All"},columns:a.table.columns,rows:a.table.rows,styleClass:"vgt-table condensed pgTble"},on:{"on-selected-rows-change":a.selectionChanged,"on-search":a.onColumnSearch,"on-page-change":a.onPageChange,"on-sort-change":a.onSortChange,"on-column-filter":a.onColumnFilter,"on-per-page-change":a.onPerPageChange},scopedSlots:a._u([{key:"table-row",fn:function(e){return["nisn"==e.column.field?t("span",[a._v("\n                            "+a._s(e.row.nisn)+"\n                        ")]):a._e(),a._v(" "),"nama"==e.column.field?t("span",[t("router-link",{attrs:{to:{name:"admin.siswa.detail",params:{siswa_id:e.row.id}},"data-toggle":"tooltip","data-placement":"top",title:"Klik Untuk Melihat Detail "+e.row.nama}},[a._v(a._s(e.row.nama))])],1):a._e(),a._v(" "),"jenis_kelamin"==e.column.field?t("span",["l"==e.row.jenis_kelamin?t("span",{staticClass:"badge bg-success"},[t("i",{staticClass:"fa fa-mars"}),a._v(" L\n                            ")]):t("span",{staticClass:"badge bg-danger"},[t("i",{staticClass:"fa fa-venus"}),a._v(" P\n                            ")])]):a._e(),a._v(" "),"rombel"==e.column.field?t("span",[a._v("\n                            "+a._s(e.row.rombel.nama)+"\n                        ")]):a._e(),a._v(" "),"ttl"==e.column.field?t("span",[t("i",[a._v(a._s(e.row.tempat_lahir))]),a._v("\n                            , "+a._s(a._f("indoDate")(e.row.tanggal_lahir))+"\n                        ")]):a._e(),a._v(" "),"aksi"==e.column.field?t("span",[t("span",{staticClass:"pointer badge bg-warning",on:{click:function(t){return a.editsiswa(e.row.id)}}},[t("i",{staticClass:"fa fa-wrench"}),a._v(" Edit\n                            ")]),a._v(" "),t("span",{staticClass:"pointer badge bg-danger pointer",on:{click:function(t){return a.deletesiswa(e.row.id)}}},[t("i",{staticClass:"fa fa-trash"}),a._v(" Hapus\n                            ")])]):a._e()]}}])})],1)])])])}),[function(){var a=this,e=a.$createElement,t=a._self._c||e;return t("div",{staticClass:"float-end"},[t("button",{staticClass:"btn btn-primary"},[t("i",{staticClass:"fa fa-plus"}),a._v(" Tambah Siswa\n                ")])])}],!1,null,null,null).exports}}]);