You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
119 lines
2.8 KiB
JavaScript
119 lines
2.8 KiB
JavaScript
import { _bbData } from "{{PATH}}/assets-js/module-lap-bb.js?v={time}";
|
|
import { temp } from "{{PATH}}/assets-js/module-lap-filter3.js?v={time}";
|
|
import { xlsx } from "{{PATH}}/assets-js/module-export-xlsx.js?v={time}";
|
|
import { Partisipasi } from "{js}module-data-partisipasi.js?v={time}";
|
|
|
|
globalThis.acc = JSON.parse(_id('acc').innerHTML);
|
|
globalThis.shup = JSON.parse(_id('shup').innerHTML);
|
|
|
|
temp();
|
|
|
|
const colors = ['#0074D9', '#FF4136', '#2ECC40', '#FF851B', '#7FDBFF', '#F012BE', '#3D9970', '#111111', '#01FF70', '#AAAAAA'];
|
|
|
|
let colorDanger = "#FF1744";
|
|
let DonutBar1 = Morris.Donut({
|
|
element: 'monthly-sales',
|
|
resize: true,
|
|
colors: colors,
|
|
data: [
|
|
{ label: "Induk", value: 0 },
|
|
]
|
|
});
|
|
|
|
let loader = function (callback) {
|
|
|
|
setTimeout(function () {
|
|
callback();
|
|
})
|
|
|
|
}
|
|
|
|
function loadData() {
|
|
|
|
};
|
|
|
|
const getNode = function (className, doc) {
|
|
let nod = document.querySelectorAll('.' + className);
|
|
if (doc !== undefined) {
|
|
nod = doc.querySelectorAll(className)
|
|
}
|
|
return Array.from(
|
|
nod
|
|
);
|
|
}
|
|
|
|
const setUpData = function () {
|
|
let tahun = _id('tahun').value;
|
|
Partisipasi(tahun, function(res){
|
|
let {usp, induk} = res;
|
|
|
|
let data = [
|
|
{
|
|
label: 'Induk',
|
|
value: induk
|
|
}
|
|
,{
|
|
label: 'USP',
|
|
value: usp
|
|
}
|
|
];
|
|
|
|
DonutBar1.setData(data);
|
|
|
|
_id('detail').innerHTML = '';
|
|
|
|
_id('detail').appendChild(
|
|
div()
|
|
.child(
|
|
el('div').css('height', '10px')
|
|
)
|
|
.child(
|
|
el('p').html(' Partisipasi anggota Induk sebesar ' + datax.induk.currency(0))
|
|
)
|
|
.child(
|
|
el('p').html(' Partisipasi anggota USP sebesar '+datax.usp.currency(0))
|
|
)
|
|
.child(
|
|
el('p').html('Untuk melihat detail laporan silahkan klik tombol Export Excel disamping.')
|
|
)
|
|
.get()
|
|
)
|
|
|
|
|
|
setTimeout(function () {
|
|
DonutBar1.resizeHandler();
|
|
}, 1000);
|
|
|
|
})
|
|
|
|
|
|
}
|
|
|
|
loader(function () {
|
|
setTimeout(function () {
|
|
loadData();
|
|
setUpData()
|
|
})
|
|
})
|
|
|
|
_id('play').addEventListener('click', function () {
|
|
loader(function () {
|
|
setTimeout(function () {
|
|
loadData();
|
|
setUpData()
|
|
})
|
|
})
|
|
});
|
|
|
|
$("#exportExcel").click(function(){
|
|
let tahun = _id('tahun').value;
|
|
window.location.href = '{{PATH}}/admin/api/export/excel/partisipasi/'+tahun;
|
|
})
|
|
|
|
|
|
$("#exportExcel2").click(function(){
|
|
let tahun = _id('tahun').value;
|
|
window.location.href = '{{PATH}}/admin/api/export/excel/partisipasi/'+tahun+'/2';
|
|
})
|
|
|