Check ulang integrasi api dan master data, master config dan drp
This commit is contained in:
@@ -9,8 +9,7 @@
|
||||
:data-source="customDataSource"
|
||||
key-expr="id"
|
||||
:allow-column-reordering="true"
|
||||
:column-auto-width="true"
|
||||
@exporting="onExporting">
|
||||
:column-auto-width="true">
|
||||
<DxRemoteOperations :group-paging="true" />
|
||||
<DxEditing
|
||||
:allow-adding="true"
|
||||
@@ -27,7 +26,7 @@
|
||||
cancel-row-changes="Batal"
|
||||
></DxTexts>
|
||||
<DxForm label-location="top" :col-count="1">
|
||||
<DxItem dataField="metodepenyampaian">
|
||||
<DxItem dataField="metodePenyampaian">
|
||||
<DxRequiredRule message="Metode penyampaian harus diisi" />
|
||||
</DxItem>
|
||||
<DxItem dataField="keterangan" />
|
||||
@@ -60,7 +59,7 @@
|
||||
info-text="Hal {0} dari {1} ({2} data)" />
|
||||
<DxFilterRow :visible="false" />
|
||||
<DxColumn data-field="id" caption="No" :width="45"></DxColumn>
|
||||
<DxColumn data-field="metodepenyampaian" caption="Metode Penyampaian"></DxColumn>
|
||||
<DxColumn data-field="metodePenyampaian" caption="Metode Penyampaian"></DxColumn>
|
||||
<DxColumn data-field="keterangan" caption="Keterangan"></DxColumn>
|
||||
<DxColumn type="buttons" caption="Aksi">
|
||||
<DxButton name="edit"/>
|
||||
@@ -95,11 +94,6 @@ import DxDataGrid, {
|
||||
DxRequiredRule
|
||||
} from "devextreme-vue/data-grid";
|
||||
import CustomStore from "devextreme/data/custom_store";
|
||||
import { Workbook } from 'exceljs';
|
||||
import { saveAs } from 'file-saver-es';
|
||||
import { exportDataGrid as exportDataGridToExcel } from 'devextreme/excel_exporter';
|
||||
import { jsPDF } from 'jspdf';
|
||||
import { exportDataGrid as exportDataGridToPDF } from 'devextreme/pdf_exporter';
|
||||
|
||||
const URL = process.env.VUE_APP_ROOT_API+'/metodepenyampaian';
|
||||
|
||||
@@ -107,7 +101,7 @@ const customDataSource = new CustomStore({
|
||||
key: 'id',
|
||||
|
||||
load: () => {
|
||||
return fetch(URL+'?size=100')
|
||||
return fetch(URL+process.env.VUE_APP_PAGE_SIZE)
|
||||
.then((response) => response.json())
|
||||
.catch(() => { throw new Error('Terdapat kesalahan memuat data'); });
|
||||
},
|
||||
@@ -155,55 +149,6 @@ export default {
|
||||
DxTexts,
|
||||
DxRequiredRule
|
||||
},
|
||||
methods: {
|
||||
onExporting(e) {
|
||||
e.cancel = true;
|
||||
|
||||
switch (e.format) {
|
||||
case "pdf": {
|
||||
const doc = new jsPDF();
|
||||
exportDataGridToPDF({
|
||||
jsPDFDocument: doc,
|
||||
component: e.component,
|
||||
indent: 5,
|
||||
}).then(() => {
|
||||
doc.save('Jenispengadaan.pdf');
|
||||
});
|
||||
}
|
||||
break;
|
||||
|
||||
case "xlsx": {
|
||||
const workbook = new Workbook();
|
||||
const worksheet = workbook.addWorksheet('Metode Penyampaian');
|
||||
|
||||
exportDataGridToExcel({
|
||||
component: e.component,
|
||||
worksheet: worksheet,
|
||||
autoFilterEnabled: true,
|
||||
}).then(() => {
|
||||
workbook.xlsx.writeBuffer().then((buffer) => {
|
||||
saveAs(new Blob([buffer], { type: 'application/octet-stream' }), 'DataGrid.xlsx');
|
||||
});
|
||||
});
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
},
|
||||
onCellPrepared(e) {
|
||||
var isEditing = e.row.isEditing, $links = e.cellElement.find(".dx-link");
|
||||
|
||||
$links.text("");
|
||||
|
||||
if(isEditing){
|
||||
$links.filter(".dx-link-save").addClass("dx-icon-save").addClass("yellowClass");
|
||||
$links.filter(".dx-link-cancel").addClass("dx-icon-revert").addClass("yellowClass");
|
||||
} else {
|
||||
$links.filter(".dx-link-edit").addClass("dx-icon-edit").addClass("greenClass");
|
||||
$links.filter(".dx-link-delete").addClass("dx-icon-trash").addClass("redClass");
|
||||
}
|
||||
},
|
||||
},
|
||||
|
||||
data() {
|
||||
return {
|
||||
|
Reference in New Issue
Block a user