From 1ade86c93115ba1513584f70e6fe321755e78232 Mon Sep 17 00:00:00 2001 From: kur0nek-o Date: Sun, 28 Apr 2024 10:41:31 +0700 Subject: [PATCH] fix: report in rekapitulasi gangguan all --- package.json | 2 +- public/version.json | 2 +- src/assets/css/style.css | 330 ++++++++-------- .../Anomali/Gangguan/Anomali_LAPPGU_LPT.vue | 8 +- src/report/Gangguan/Rekap/RGangguan_ALL.ts | 352 ++++++++++++------ 5 files changed, 409 insertions(+), 285 deletions(-) diff --git a/package.json b/package.json index 43f86a2..f6c989d 100755 --- a/package.json +++ b/package.json @@ -1 +1 @@ -{"name":"eis","version":"0.0.149-vm","private":true,"scripts":{"dev":"vite","host":"vite --host","tailwind":"tailwindcss -i ./src/assets/css/tailwind.css -o ./src/assets/css/style.css --watch","build":"run-p type-check build-only","preview":"vite preview --host","test:unit":"vitest","build-only":"vite build","type-check":"vue-tsc --noEmit -p tsconfig.vitest.json --composite false","lint":"eslint . --ext .vue,.js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts --fix --ignore-path .gitignore","format":"prettier --write src/","deploy":"node deploy.js"},"dependencies":{"@apollo/client":"^3.8.10","@apollo/link-context":"^2.0.0-beta.3","@flavorly/vanilla-components":"^0.7.65","@headlessui/tailwindcss":"^0.2.0","@headlessui/vue":"^1.7.19","@heroicons/vue":"^2.0.18","@lottiefiles/lottie-player":"^2.0.4","@phosphor-icons/vue":"^2.1.6","@types/qs":"^6.9.12","@types/uuid":"^9.0.8","@types/vue-select":"^3.16.8","@vue/apollo-components":"^4.0.0","@vue/apollo-composable":"^4.0.1","@vue/apollo-option":"^4.0.0","axios":"^1.6.7","devextreme":"23.2.4","devextreme-vue":"23.2.4","docx":"^8.5.0","dotenv":"^16.3.1","encrypt-storage":"^2.12.22","exceljs":"^4.4.0","file-saver":"^2.0.5","graphql":"^16.8.1","graphql-tag":"^2.12.6","jspdf":"^2.5.1","jspdf-autotable":"^3.8.2","pinia":"^2.1.3","qs":"^6.11.2","uuid":"^9.0.1","vue":"^3.3.4","vue-html-to-paper":"^2.0.3","vue-router":"^4.2.2","vue-tailwind-datepicker":"^1.6.1","vue3-star-ratings":"^3.0.5"},"devDependencies":{"@rushstack/eslint-patch":"^1.5.1","@tailwindcss/aspect-ratio":"^0.4.2","@tailwindcss/container-queries":"^0.1.1","@tailwindcss/forms":"^0.5.7","@tailwindcss/typography":"^0.5.10","@tsconfig/node18":"^2.0.1","@types/file-saver":"^2.0.6","@types/jsdom":"^21.1.1","@types/node":"^18.16.17","@vitejs/plugin-vue":"^4.2.3","@vitejs/plugin-vue-jsx":"^3.0.1","@vue/eslint-config-prettier":"^8.0.0","@vue/eslint-config-typescript":"^12.0.0","@vue/test-utils":"^2.3.2","@vue/tsconfig":"^0.4.0","autoprefixer":"^10.4.14","eslint":"^8.39.0","eslint-plugin-vue":"^9.11.0","jsdom":"^22.1.0","npm-run-all":"^4.1.5","postcss":"^8.4.24","prettier":"^3.0.3","tailwindcss":"^3.3.2","typescript":"~5.2.2","vite":"^4.3.9","vitest":"^1.3.1","vue-tsc":"^2.0.5"}} \ No newline at end of file +{"name":"eis","version":"0.0.150-vm","private":true,"scripts":{"dev":"vite","host":"vite --host","tailwind":"tailwindcss -i ./src/assets/css/tailwind.css -o ./src/assets/css/style.css --watch","build":"run-p type-check build-only","preview":"vite preview --host","test:unit":"vitest","build-only":"vite build","type-check":"vue-tsc --noEmit -p tsconfig.vitest.json --composite false","lint":"eslint . --ext .vue,.js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts --fix --ignore-path .gitignore","format":"prettier --write src/","deploy":"node deploy.js"},"dependencies":{"@apollo/client":"^3.8.10","@apollo/link-context":"^2.0.0-beta.3","@flavorly/vanilla-components":"^0.7.65","@headlessui/tailwindcss":"^0.2.0","@headlessui/vue":"^1.7.19","@heroicons/vue":"^2.0.18","@lottiefiles/lottie-player":"^2.0.4","@phosphor-icons/vue":"^2.1.6","@types/qs":"^6.9.12","@types/uuid":"^9.0.8","@types/vue-select":"^3.16.8","@vue/apollo-components":"^4.0.0","@vue/apollo-composable":"^4.0.1","@vue/apollo-option":"^4.0.0","axios":"^1.6.7","devextreme":"23.2.4","devextreme-vue":"23.2.4","docx":"^8.5.0","dotenv":"^16.3.1","encrypt-storage":"^2.12.22","exceljs":"^4.4.0","file-saver":"^2.0.5","graphql":"^16.8.1","graphql-tag":"^2.12.6","jspdf":"^2.5.1","jspdf-autotable":"^3.8.2","pinia":"^2.1.3","qs":"^6.11.2","uuid":"^9.0.1","vue":"^3.3.4","vue-html-to-paper":"^2.0.3","vue-router":"^4.2.2","vue-tailwind-datepicker":"^1.6.1","vue3-star-ratings":"^3.0.5"},"devDependencies":{"@rushstack/eslint-patch":"^1.5.1","@tailwindcss/aspect-ratio":"^0.4.2","@tailwindcss/container-queries":"^0.1.1","@tailwindcss/forms":"^0.5.7","@tailwindcss/typography":"^0.5.10","@tsconfig/node18":"^2.0.1","@types/file-saver":"^2.0.6","@types/jsdom":"^21.1.1","@types/node":"^18.16.17","@vitejs/plugin-vue":"^4.2.3","@vitejs/plugin-vue-jsx":"^3.0.1","@vue/eslint-config-prettier":"^8.0.0","@vue/eslint-config-typescript":"^12.0.0","@vue/test-utils":"^2.3.2","@vue/tsconfig":"^0.4.0","autoprefixer":"^10.4.14","eslint":"^8.39.0","eslint-plugin-vue":"^9.11.0","jsdom":"^22.1.0","npm-run-all":"^4.1.5","postcss":"^8.4.24","prettier":"^3.0.3","tailwindcss":"^3.3.2","typescript":"~5.2.2","vite":"^4.3.9","vitest":"^1.3.1","vue-tsc":"^2.0.5"}} \ No newline at end of file diff --git a/public/version.json b/public/version.json index f193fcd..b1cb652 100644 --- a/public/version.json +++ b/public/version.json @@ -1 +1 @@ -{"version":"0.0.149-vm"} \ No newline at end of file +{"version":"0.0.150-vm"} \ No newline at end of file diff --git a/src/assets/css/style.css b/src/assets/css/style.css index 1dd8ec9..9f6fd67 100755 --- a/src/assets/css/style.css +++ b/src/assets/css/style.css @@ -1,5 +1,5 @@ /* -! tailwindcss v3.4.1 | MIT License | https://tailwindcss.com +! tailwindcss v3.4.3 | MIT License | https://tailwindcss.com */ /* @@ -211,6 +211,8 @@ textarea { /* 1 */ line-height: inherit; /* 1 */ + letter-spacing: inherit; + /* 1 */ color: inherit; /* 1 */ margin: 0; @@ -234,9 +236,9 @@ select { */ button, -[type='button'], -[type='reset'], -[type='submit'] { +input:where([type='button']), +input:where([type='reset']), +input:where([type='submit']) { -webkit-appearance: button; /* 1 */ background-color: transparent; @@ -687,6 +689,10 @@ select { --tw-backdrop-opacity: ; --tw-backdrop-saturate: ; --tw-backdrop-sepia: ; + --tw-contain-size: ; + --tw-contain-layout: ; + --tw-contain-paint: ; + --tw-contain-style: ; } ::backdrop { @@ -737,6 +743,10 @@ select { --tw-backdrop-opacity: ; --tw-backdrop-saturate: ; --tw-backdrop-sepia: ; + --tw-contain-size: ; + --tw-contain-layout: ; + --tw-contain-paint: ; + --tw-contain-style: ; } .container { @@ -4803,734 +4813,734 @@ body { color: rgb(3 91 113 / var(--tw-text-opacity)); } -:is(.dark .dark\:divide-gray-700) > :not([hidden]) ~ :not([hidden]) { +.dark\:divide-gray-700:is(.dark *) > :not([hidden]) ~ :not([hidden]) { --tw-divide-opacity: 1; border-color: rgb(55 65 81 / var(--tw-divide-opacity)); } -:is(.dark .dark\:divide-gray-700\/90) > :not([hidden]) ~ :not([hidden]) { +.dark\:divide-gray-700\/90:is(.dark *) > :not([hidden]) ~ :not([hidden]) { border-color: rgb(55 65 81 / 0.9); } -:is(.dark .dark\:divide-gray-800) > :not([hidden]) ~ :not([hidden]) { +.dark\:divide-gray-800:is(.dark *) > :not([hidden]) ~ :not([hidden]) { --tw-divide-opacity: 1; border-color: rgb(31 41 55 / var(--tw-divide-opacity)); } -:is(.dark .dark\:divide-gray-900) > :not([hidden]) ~ :not([hidden]) { +.dark\:divide-gray-900:is(.dark *) > :not([hidden]) ~ :not([hidden]) { --tw-divide-opacity: 1; border-color: rgb(17 24 39 / var(--tw-divide-opacity)); } -:is(.dark .dark\:border) { +.dark\:border:is(.dark *) { border-width: 1px; } -:is(.dark .dark\:border-blue-600) { +.dark\:border-blue-600:is(.dark *) { --tw-border-opacity: 1; border-color: rgb(37 99 235 / var(--tw-border-opacity)); } -:is(.dark .dark\:border-gray-500) { +.dark\:border-gray-500:is(.dark *) { --tw-border-opacity: 1; border-color: rgb(107 114 128 / var(--tw-border-opacity)); } -:is(.dark .dark\:border-gray-600) { +.dark\:border-gray-600:is(.dark *) { --tw-border-opacity: 1; border-color: rgb(75 85 99 / var(--tw-border-opacity)); } -:is(.dark .dark\:border-gray-700) { +.dark\:border-gray-700:is(.dark *) { --tw-border-opacity: 1; border-color: rgb(55 65 81 / var(--tw-border-opacity)); } -:is(.dark .dark\:border-green-500) { +.dark\:border-green-500:is(.dark *) { --tw-border-opacity: 1; border-color: rgb(34 197 94 / var(--tw-border-opacity)); } -:is(.dark .dark\:border-green-600) { +.dark\:border-green-600:is(.dark *) { --tw-border-opacity: 1; border-color: rgb(22 163 74 / var(--tw-border-opacity)); } -:is(.dark .dark\:border-orange-500) { +.dark\:border-orange-500:is(.dark *) { --tw-border-opacity: 1; border-color: rgb(249 115 22 / var(--tw-border-opacity)); } -:is(.dark .dark\:border-primary-500) { +.dark\:border-primary-500:is(.dark *) { --tw-border-opacity: 1; border-color: rgb(3 91 113 / var(--tw-border-opacity)); } -:is(.dark .dark\:border-purple-500) { +.dark\:border-purple-500:is(.dark *) { --tw-border-opacity: 1; border-color: rgb(168 85 247 / var(--tw-border-opacity)); } -:is(.dark .dark\:border-red-500) { +.dark\:border-red-500:is(.dark *) { --tw-border-opacity: 1; border-color: rgb(255 0 0 / var(--tw-border-opacity)); } -:is(.dark .dark\:border-red-600) { +.dark\:border-red-600:is(.dark *) { --tw-border-opacity: 1; border-color: rgb(204 0 0 / var(--tw-border-opacity)); } -:is(.dark .dark\:border-yellow-600) { +.dark\:border-yellow-600:is(.dark *) { --tw-border-opacity: 1; border-color: rgb(204 204 0 / var(--tw-border-opacity)); } -:is(.dark .dark\:bg-blue-200) { +.dark\:bg-blue-200:is(.dark *) { --tw-bg-opacity: 1; background-color: rgb(191 219 254 / var(--tw-bg-opacity)); } -:is(.dark .dark\:bg-blue-600\/10) { +.dark\:bg-blue-600\/10:is(.dark *) { background-color: rgb(37 99 235 / 0.1); } -:is(.dark .dark\:bg-gray-600) { +.dark\:bg-gray-600:is(.dark *) { --tw-bg-opacity: 1; background-color: rgb(75 85 99 / var(--tw-bg-opacity)); } -:is(.dark .dark\:bg-gray-700) { +.dark\:bg-gray-700:is(.dark *) { --tw-bg-opacity: 1; background-color: rgb(55 65 81 / var(--tw-bg-opacity)); } -:is(.dark .dark\:bg-gray-700\/50) { +.dark\:bg-gray-700\/50:is(.dark *) { background-color: rgb(55 65 81 / 0.5); } -:is(.dark .dark\:bg-gray-800) { +.dark\:bg-gray-800:is(.dark *) { --tw-bg-opacity: 1; background-color: rgb(31 41 55 / var(--tw-bg-opacity)); } -:is(.dark .dark\:bg-gray-800\/50) { +.dark\:bg-gray-800\/50:is(.dark *) { background-color: rgb(31 41 55 / 0.5); } -:is(.dark .dark\:bg-gray-800\/70) { +.dark\:bg-gray-800\/70:is(.dark *) { background-color: rgb(31 41 55 / 0.7); } -:is(.dark .dark\:bg-gray-900) { +.dark\:bg-gray-900:is(.dark *) { --tw-bg-opacity: 1; background-color: rgb(17 24 39 / var(--tw-bg-opacity)); } -:is(.dark .dark\:bg-gray-900\/80) { +.dark\:bg-gray-900\/80:is(.dark *) { background-color: rgb(17 24 39 / 0.8); } -:is(.dark .dark\:bg-green-200) { +.dark\:bg-green-200:is(.dark *) { --tw-bg-opacity: 1; background-color: rgb(187 247 208 / var(--tw-bg-opacity)); } -:is(.dark .dark\:bg-green-500) { +.dark\:bg-green-500:is(.dark *) { --tw-bg-opacity: 1; background-color: rgb(34 197 94 / var(--tw-bg-opacity)); } -:is(.dark .dark\:bg-green-500\/30) { +.dark\:bg-green-500\/30:is(.dark *) { background-color: rgb(34 197 94 / 0.3); } -:is(.dark .dark\:bg-green-600\/10) { +.dark\:bg-green-600\/10:is(.dark *) { background-color: rgb(22 163 74 / 0.1); } -:is(.dark .dark\:bg-green-700) { +.dark\:bg-green-700:is(.dark *) { --tw-bg-opacity: 1; background-color: rgb(21 128 61 / var(--tw-bg-opacity)); } -:is(.dark .dark\:bg-orange-500) { +.dark\:bg-orange-500:is(.dark *) { --tw-bg-opacity: 1; background-color: rgb(249 115 22 / var(--tw-bg-opacity)); } -:is(.dark .dark\:bg-orange-500\/30) { +.dark\:bg-orange-500\/30:is(.dark *) { background-color: rgb(249 115 22 / 0.3); } -:is(.dark .dark\:bg-orange-700) { +.dark\:bg-orange-700:is(.dark *) { --tw-bg-opacity: 1; background-color: rgb(194 65 12 / var(--tw-bg-opacity)); } -:is(.dark .dark\:bg-primary-300) { +.dark\:bg-primary-300:is(.dark *) { --tw-bg-opacity: 1; background-color: rgb(104 157 170 / var(--tw-bg-opacity)); } -:is(.dark .dark\:bg-primary-400) { +.dark\:bg-primary-400:is(.dark *) { --tw-bg-opacity: 1; background-color: rgb(53 124 141 / var(--tw-bg-opacity)); } -:is(.dark .dark\:bg-primary-500) { +.dark\:bg-primary-500:is(.dark *) { --tw-bg-opacity: 1; background-color: rgb(3 91 113 / var(--tw-bg-opacity)); } -:is(.dark .dark\:bg-primary-500\/20) { +.dark\:bg-primary-500\/20:is(.dark *) { background-color: rgb(3 91 113 / 0.2); } -:is(.dark .dark\:bg-primary-500\/60) { +.dark\:bg-primary-500\/60:is(.dark *) { background-color: rgb(3 91 113 / 0.6); } -:is(.dark .dark\:bg-primary-600\/10) { +.dark\:bg-primary-600\/10:is(.dark *) { background-color: rgb(2 73 90 / 0.1); } -:is(.dark .dark\:bg-purple-500) { +.dark\:bg-purple-500:is(.dark *) { --tw-bg-opacity: 1; background-color: rgb(168 85 247 / var(--tw-bg-opacity)); } -:is(.dark .dark\:bg-purple-500\/30) { +.dark\:bg-purple-500\/30:is(.dark *) { background-color: rgb(168 85 247 / 0.3); } -:is(.dark .dark\:bg-purple-700) { +.dark\:bg-purple-700:is(.dark *) { --tw-bg-opacity: 1; background-color: rgb(126 34 206 / var(--tw-bg-opacity)); } -:is(.dark .dark\:bg-red-200) { +.dark\:bg-red-200:is(.dark *) { --tw-bg-opacity: 1; background-color: rgb(255 153 153 / var(--tw-bg-opacity)); } -:is(.dark .dark\:bg-red-500) { +.dark\:bg-red-500:is(.dark *) { --tw-bg-opacity: 1; background-color: rgb(255 0 0 / var(--tw-bg-opacity)); } -:is(.dark .dark\:bg-red-500\/20) { +.dark\:bg-red-500\/20:is(.dark *) { background-color: rgb(255 0 0 / 0.2); } -:is(.dark .dark\:bg-red-500\/30) { +.dark\:bg-red-500\/30:is(.dark *) { background-color: rgb(255 0 0 / 0.3); } -:is(.dark .dark\:bg-red-500\/70) { +.dark\:bg-red-500\/70:is(.dark *) { background-color: rgb(255 0 0 / 0.7); } -:is(.dark .dark\:bg-red-600\/10) { +.dark\:bg-red-600\/10:is(.dark *) { background-color: rgb(204 0 0 / 0.1); } -:is(.dark .dark\:bg-red-700) { +.dark\:bg-red-700:is(.dark *) { --tw-bg-opacity: 1; background-color: rgb(153 0 0 / var(--tw-bg-opacity)); } -:is(.dark .dark\:bg-yellow-200) { +.dark\:bg-yellow-200:is(.dark *) { --tw-bg-opacity: 1; background-color: rgb(255 255 153 / var(--tw-bg-opacity)); } -:is(.dark .dark\:bg-yellow-600\/10) { +.dark\:bg-yellow-600\/10:is(.dark *) { background-color: rgb(204 204 0 / 0.1); } -:is(.dark .dark\:bg-opacity-50) { +.dark\:bg-opacity-50:is(.dark *) { --tw-bg-opacity: 0.5; } -:is(.dark .dark\:from-gray-500) { +.dark\:from-gray-500:is(.dark *) { --tw-gradient-from: #6b7280 var(--tw-gradient-from-position); --tw-gradient-to: rgb(107 114 128 / 0) var(--tw-gradient-to-position); --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to); } -:is(.dark .dark\:to-gray-700) { +.dark\:to-gray-700:is(.dark *) { --tw-gradient-to: #374151 var(--tw-gradient-to-position); } -:is(.dark .dark\:fill-\[\#fff\]) { +.dark\:fill-\[\#fff\]:is(.dark *) { fill: #fff; } -:is(.dark .dark\:text-black) { +.dark\:text-black:is(.dark *) { --tw-text-opacity: 1; color: rgb(0 0 0 / var(--tw-text-opacity)); } -:is(.dark .dark\:text-blue-200) { +.dark\:text-blue-200:is(.dark *) { --tw-text-opacity: 1; color: rgb(191 219 254 / var(--tw-text-opacity)); } -:is(.dark .dark\:text-blue-400) { +.dark\:text-blue-400:is(.dark *) { --tw-text-opacity: 1; color: rgb(96 165 250 / var(--tw-text-opacity)); } -:is(.dark .dark\:text-blue-700) { +.dark\:text-blue-700:is(.dark *) { --tw-text-opacity: 1; color: rgb(29 78 216 / var(--tw-text-opacity)); } -:is(.dark .dark\:text-blue-900) { +.dark\:text-blue-900:is(.dark *) { --tw-text-opacity: 1; color: rgb(30 58 138 / var(--tw-text-opacity)); } -:is(.dark .dark\:text-blue-900\/90) { +.dark\:text-blue-900\/90:is(.dark *) { color: rgb(30 58 138 / 0.9); } -:is(.dark .dark\:text-gray-200) { +.dark\:text-gray-200:is(.dark *) { --tw-text-opacity: 1; color: rgb(229 231 235 / var(--tw-text-opacity)); } -:is(.dark .dark\:text-gray-300) { +.dark\:text-gray-300:is(.dark *) { --tw-text-opacity: 1; color: rgb(209 213 219 / var(--tw-text-opacity)); } -:is(.dark .dark\:text-gray-400) { +.dark\:text-gray-400:is(.dark *) { --tw-text-opacity: 1; color: rgb(156 163 175 / var(--tw-text-opacity)); } -:is(.dark .dark\:text-gray-50) { +.dark\:text-gray-50:is(.dark *) { --tw-text-opacity: 1; color: rgb(249 250 251 / var(--tw-text-opacity)); } -:is(.dark .dark\:text-gray-500) { +.dark\:text-gray-500:is(.dark *) { --tw-text-opacity: 1; color: rgb(107 114 128 / var(--tw-text-opacity)); } -:is(.dark .dark\:text-gray-600) { +.dark\:text-gray-600:is(.dark *) { --tw-text-opacity: 1; color: rgb(75 85 99 / var(--tw-text-opacity)); } -:is(.dark .dark\:text-gray-700) { +.dark\:text-gray-700:is(.dark *) { --tw-text-opacity: 1; color: rgb(55 65 81 / var(--tw-text-opacity)); } -:is(.dark .dark\:text-gray-900) { +.dark\:text-gray-900:is(.dark *) { --tw-text-opacity: 1; color: rgb(17 24 39 / var(--tw-text-opacity)); } -:is(.dark .dark\:text-green-200) { +.dark\:text-green-200:is(.dark *) { --tw-text-opacity: 1; color: rgb(187 247 208 / var(--tw-text-opacity)); } -:is(.dark .dark\:text-green-400) { +.dark\:text-green-400:is(.dark *) { --tw-text-opacity: 1; color: rgb(74 222 128 / var(--tw-text-opacity)); } -:is(.dark .dark\:text-green-600) { +.dark\:text-green-600:is(.dark *) { --tw-text-opacity: 1; color: rgb(22 163 74 / var(--tw-text-opacity)); } -:is(.dark .dark\:text-green-700) { +.dark\:text-green-700:is(.dark *) { --tw-text-opacity: 1; color: rgb(21 128 61 / var(--tw-text-opacity)); } -:is(.dark .dark\:text-green-900) { +.dark\:text-green-900:is(.dark *) { --tw-text-opacity: 1; color: rgb(20 83 45 / var(--tw-text-opacity)); } -:is(.dark .dark\:text-green-900\/90) { +.dark\:text-green-900\/90:is(.dark *) { color: rgb(20 83 45 / 0.9); } -:is(.dark .dark\:text-primary-200) { +.dark\:text-primary-200:is(.dark *) { --tw-text-opacity: 1; color: rgb(154 189 198 / var(--tw-text-opacity)); } -:is(.dark .dark\:text-primary-400) { +.dark\:text-primary-400:is(.dark *) { --tw-text-opacity: 1; color: rgb(53 124 141 / var(--tw-text-opacity)); } -:is(.dark .dark\:text-red-200) { +.dark\:text-red-200:is(.dark *) { --tw-text-opacity: 1; color: rgb(255 153 153 / var(--tw-text-opacity)); } -:is(.dark .dark\:text-red-300) { +.dark\:text-red-300:is(.dark *) { --tw-text-opacity: 1; color: rgb(255 102 102 / var(--tw-text-opacity)); } -:is(.dark .dark\:text-red-300\/70) { +.dark\:text-red-300\/70:is(.dark *) { color: rgb(255 102 102 / 0.7); } -:is(.dark .dark\:text-red-400) { +.dark\:text-red-400:is(.dark *) { --tw-text-opacity: 1; color: rgb(255 51 51 / var(--tw-text-opacity)); } -:is(.dark .dark\:text-red-600) { +.dark\:text-red-600:is(.dark *) { --tw-text-opacity: 1; color: rgb(204 0 0 / var(--tw-text-opacity)); } -:is(.dark .dark\:text-red-700) { +.dark\:text-red-700:is(.dark *) { --tw-text-opacity: 1; color: rgb(153 0 0 / var(--tw-text-opacity)); } -:is(.dark .dark\:text-red-900) { +.dark\:text-red-900:is(.dark *) { --tw-text-opacity: 1; color: rgb(51 0 0 / var(--tw-text-opacity)); } -:is(.dark .dark\:text-red-900\/90) { +.dark\:text-red-900\/90:is(.dark *) { color: rgb(51 0 0 / 0.9); } -:is(.dark .dark\:text-vtd-primary-400) { +.dark\:text-vtd-primary-400:is(.dark *) { --tw-text-opacity: 1; color: rgb(53 124 141 / var(--tw-text-opacity)); } -:is(.dark .dark\:text-white) { +.dark\:text-white:is(.dark *) { --tw-text-opacity: 1; color: rgb(255 255 255 / var(--tw-text-opacity)); } -:is(.dark .dark\:text-yellow-200) { +.dark\:text-yellow-200:is(.dark *) { --tw-text-opacity: 1; color: rgb(255 255 153 / var(--tw-text-opacity)); } -:is(.dark .dark\:text-yellow-400) { +.dark\:text-yellow-400:is(.dark *) { --tw-text-opacity: 1; color: rgb(255 255 51 / var(--tw-text-opacity)); } -:is(.dark .dark\:text-yellow-600) { +.dark\:text-yellow-600:is(.dark *) { --tw-text-opacity: 1; color: rgb(204 204 0 / var(--tw-text-opacity)); } -:is(.dark .dark\:text-yellow-700) { +.dark\:text-yellow-700:is(.dark *) { --tw-text-opacity: 1; color: rgb(153 153 0 / var(--tw-text-opacity)); } -:is(.dark .dark\:text-yellow-900) { +.dark\:text-yellow-900:is(.dark *) { --tw-text-opacity: 1; color: rgb(51 51 0 / var(--tw-text-opacity)); } -:is(.dark .dark\:text-yellow-900\/90) { +.dark\:text-yellow-900\/90:is(.dark *) { color: rgb(51 51 0 / 0.9); } -:is(.dark .dark\:text-opacity-70) { +.dark\:text-opacity-70:is(.dark *) { --tw-text-opacity: 0.7; } -:is(.dark .dark\:ring-gray-200\/20) { +.dark\:ring-gray-200\/20:is(.dark *) { --tw-ring-color: rgb(229 231 235 / 0.2); } -:is(.dark .dark\:ring-gray-600\/60) { +.dark\:ring-gray-600\/60:is(.dark *) { --tw-ring-color: rgb(75 85 99 / 0.6); } -:is(.dark .dark\:ring-red-400) { +.dark\:ring-red-400:is(.dark *) { --tw-ring-opacity: 1; --tw-ring-color: rgb(255 51 51 / var(--tw-ring-opacity)); } -:is(.dark .dark\:ring-red-500\/60) { +.dark\:ring-red-500\/60:is(.dark *) { --tw-ring-color: rgb(255 0 0 / 0.6); } -:is(.dark .dark\:ring-white\/10) { +.dark\:ring-white\/10:is(.dark *) { --tw-ring-color: rgb(255 255 255 / 0.1); } -:is(.dark .dark\:ring-white\/20) { +.dark\:ring-white\/20:is(.dark *) { --tw-ring-color: rgb(255 255 255 / 0.2); } -:is(.dark .dark\:ring-white\/30) { +.dark\:ring-white\/30:is(.dark *) { --tw-ring-color: rgb(255 255 255 / 0.3); } -:is(.dark .dark\:ring-offset-gray-900) { +.dark\:ring-offset-gray-900:is(.dark *) { --tw-ring-offset-color: #111827; } -:is(.dark .before\:dark\:border-gray-700)::before { +.before\:dark\:border-gray-700:is(.dark *)::before { content: var(--tw-content); --tw-border-opacity: 1; border-color: rgb(55 65 81 / var(--tw-border-opacity)); } -:is(.dark .before\:dark\:bg-gray-900)::before { +.before\:dark\:bg-gray-900:is(.dark *)::before { content: var(--tw-content); --tw-bg-opacity: 1; background-color: rgb(17 24 39 / var(--tw-bg-opacity)); } -:is(.dark .dark\:after\:from-gray-500)::after { +.dark\:after\:from-gray-500:is(.dark *)::after { content: var(--tw-content); --tw-gradient-from: #6b7280 var(--tw-gradient-from-position); --tw-gradient-to: rgb(107 114 128 / 0) var(--tw-gradient-to-position); --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to); } -:is(.dark .dark\:after\:to-gray-700)::after { +.dark\:after\:to-gray-700:is(.dark *)::after { content: var(--tw-content); --tw-gradient-to: #374151 var(--tw-gradient-to-position); } -:is(.dark .checked\:dark\:bg-primary-300):checked { +.checked\:dark\:bg-primary-300:is(.dark *):checked { --tw-bg-opacity: 1; background-color: rgb(104 157 170 / var(--tw-bg-opacity)); } -:is(.dark .checked\:dark\:bg-red-300):checked { +.checked\:dark\:bg-red-300:is(.dark *):checked { --tw-bg-opacity: 1; background-color: rgb(255 102 102 / var(--tw-bg-opacity)); } -:is(.dark .dark\:checked\:bg-primary-600:checked) { +.dark\:checked\:bg-primary-600:checked:is(.dark *) { --tw-bg-opacity: 1; background-color: rgb(2 73 90 / var(--tw-bg-opacity)); } -:is(.dark .dark\:checked\:bg-red-600:checked) { +.dark\:checked\:bg-red-600:checked:is(.dark *) { --tw-bg-opacity: 1; background-color: rgb(204 0 0 / var(--tw-bg-opacity)); } -:is(.dark .checked\:dark\:text-black):checked { +.checked\:dark\:text-black:is(.dark *):checked { --tw-text-opacity: 1; color: rgb(0 0 0 / var(--tw-text-opacity)); } -:is(.dark .dark\:hover\:bg-blue-300:hover) { +.dark\:hover\:bg-blue-300:hover:is(.dark *) { --tw-bg-opacity: 1; background-color: rgb(147 197 253 / var(--tw-bg-opacity)); } -:is(.dark .dark\:hover\:bg-blue-700\/20:hover) { +.dark\:hover\:bg-blue-700\/20:hover:is(.dark *) { background-color: rgb(29 78 216 / 0.2); } -:is(.dark .dark\:hover\:bg-gray-700:hover) { +.dark\:hover\:bg-gray-700:hover:is(.dark *) { --tw-bg-opacity: 1; background-color: rgb(55 65 81 / var(--tw-bg-opacity)); } -:is(.dark .dark\:hover\:bg-green-300:hover) { +.dark\:hover\:bg-green-300:hover:is(.dark *) { --tw-bg-opacity: 1; background-color: rgb(134 239 172 / var(--tw-bg-opacity)); } -:is(.dark .dark\:hover\:bg-green-700\/20:hover) { +.dark\:hover\:bg-green-700\/20:hover:is(.dark *) { background-color: rgb(21 128 61 / 0.2); } -:is(.dark .dark\:hover\:bg-primary-400\/20:hover) { +.dark\:hover\:bg-primary-400\/20:hover:is(.dark *) { background-color: rgb(53 124 141 / 0.2); } -:is(.dark .dark\:hover\:bg-primary-700\/20:hover) { +.dark\:hover\:bg-primary-700\/20:hover:is(.dark *) { background-color: rgb(2 73 90 / 0.2); } -:is(.dark .dark\:hover\:bg-red-300:hover) { +.dark\:hover\:bg-red-300:hover:is(.dark *) { --tw-bg-opacity: 1; background-color: rgb(255 102 102 / var(--tw-bg-opacity)); } -:is(.dark .dark\:hover\:bg-red-400\/20:hover) { +.dark\:hover\:bg-red-400\/20:hover:is(.dark *) { background-color: rgb(255 51 51 / 0.2); } -:is(.dark .dark\:hover\:bg-red-700\/20:hover) { +.dark\:hover\:bg-red-700\/20:hover:is(.dark *) { background-color: rgb(153 0 0 / 0.2); } -:is(.dark .dark\:hover\:bg-yellow-300:hover) { +.dark\:hover\:bg-yellow-300:hover:is(.dark *) { --tw-bg-opacity: 1; background-color: rgb(255 255 102 / var(--tw-bg-opacity)); } -:is(.dark .dark\:hover\:bg-yellow-700\/20:hover) { +.dark\:hover\:bg-yellow-700\/20:hover:is(.dark *) { background-color: rgb(153 153 0 / 0.2); } -:is(.dark .dark\:hover\:text-gray-100:hover) { +.dark\:hover\:text-gray-100:hover:is(.dark *) { --tw-text-opacity: 1; color: rgb(243 244 246 / var(--tw-text-opacity)); } -:is(.dark .dark\:hover\:text-gray-300:hover) { +.dark\:hover\:text-gray-300:hover:is(.dark *) { --tw-text-opacity: 1; color: rgb(209 213 219 / var(--tw-text-opacity)); } -:is(.dark .dark\:hover\:text-red-200:hover) { +.dark\:hover\:text-red-200:hover:is(.dark *) { --tw-text-opacity: 1; color: rgb(255 153 153 / var(--tw-text-opacity)); } -:is(.dark .dark\:hover\:text-vtd-primary-300:hover) { +.dark\:hover\:text-vtd-primary-300:hover:is(.dark *) { --tw-text-opacity: 1; color: rgb(104 157 170 / var(--tw-text-opacity)); } -:is(.dark .dark\:hover\:text-white:hover) { +.dark\:hover\:text-white:hover:is(.dark *) { --tw-text-opacity: 1; color: rgb(255 255 255 / var(--tw-text-opacity)); } -:is(.dark .dark\:focus\:border-primary-600:focus) { +.dark\:focus\:border-primary-600:focus:is(.dark *) { --tw-border-opacity: 1; border-color: rgb(2 73 90 / var(--tw-border-opacity)); } -:is(.dark .dark\:focus\:border-red-400:focus) { +.dark\:focus\:border-red-400:focus:is(.dark *) { --tw-border-opacity: 1; border-color: rgb(255 51 51 / var(--tw-border-opacity)); } -:is(.dark .dark\:focus\:border-vtd-primary-500:focus) { +.dark\:focus\:border-vtd-primary-500:focus:is(.dark *) { --tw-border-opacity: 1; border-color: rgb(3 91 113 / var(--tw-border-opacity)); } -:is(.dark .dark\:focus\:bg-primary-500\/20:focus) { +.dark\:focus\:bg-primary-500\/20:focus:is(.dark *) { background-color: rgb(3 91 113 / 0.2); } -:is(.dark .dark\:focus\:bg-red-500\/20:focus) { +.dark\:focus\:bg-red-500\/20:focus:is(.dark *) { background-color: rgb(255 0 0 / 0.2); } -:is(.dark .dark\:focus\:bg-opacity-50:focus) { +.dark\:focus\:bg-opacity-50:focus:is(.dark *) { --tw-bg-opacity: 0.5; } -:is(.dark .dark\:focus\:text-vtd-primary-300:focus) { +.dark\:focus\:text-vtd-primary-300:focus:is(.dark *) { --tw-text-opacity: 1; color: rgb(104 157 170 / var(--tw-text-opacity)); } -:is(.dark .dark\:focus\:text-white:focus) { +.dark\:focus\:text-white:focus:is(.dark *) { --tw-text-opacity: 1; color: rgb(255 255 255 / var(--tw-text-opacity)); } -:is(.dark .dark\:focus\:ring-blue-800:focus) { +.dark\:focus\:ring-blue-800:focus:is(.dark *) { --tw-ring-opacity: 1; --tw-ring-color: rgb(30 64 175 / var(--tw-ring-opacity)); } -:is(.dark .dark\:focus\:ring-green-800:focus) { +.dark\:focus\:ring-green-800:focus:is(.dark *) { --tw-ring-opacity: 1; --tw-ring-color: rgb(22 101 52 / var(--tw-ring-opacity)); } -:is(.dark .dark\:focus\:ring-primary-500:focus) { +.dark\:focus\:ring-primary-500:focus:is(.dark *) { --tw-ring-opacity: 1; --tw-ring-color: rgb(3 91 113 / var(--tw-ring-opacity)); } -:is(.dark .dark\:focus\:ring-primary-600:focus) { +.dark\:focus\:ring-primary-600:focus:is(.dark *) { --tw-ring-opacity: 1; --tw-ring-color: rgb(2 73 90 / var(--tw-ring-opacity)); } -:is(.dark .dark\:focus\:ring-red-400:focus) { +.dark\:focus\:ring-red-400:focus:is(.dark *) { --tw-ring-opacity: 1; --tw-ring-color: rgb(255 51 51 / var(--tw-ring-opacity)); } -:is(.dark .dark\:focus\:ring-red-500:focus) { +.dark\:focus\:ring-red-500:focus:is(.dark *) { --tw-ring-opacity: 1; --tw-ring-color: rgb(255 0 0 / var(--tw-ring-opacity)); } -:is(.dark .dark\:focus\:ring-red-800:focus) { +.dark\:focus\:ring-red-800:focus:is(.dark *) { --tw-ring-opacity: 1; --tw-ring-color: rgb(102 0 0 / var(--tw-ring-opacity)); } -:is(.dark .dark\:focus\:ring-yellow-800:focus) { +.dark\:focus\:ring-yellow-800:focus:is(.dark *) { --tw-ring-opacity: 1; --tw-ring-color: rgb(102 102 0 / var(--tw-ring-opacity)); } -:is(.dark .dark\:focus\:ring-opacity-20:focus) { +.dark\:focus\:ring-opacity-20:focus:is(.dark *) { --tw-ring-opacity: 0.2; } -:is(.dark .dark\:focus\:ring-opacity-25:focus) { +.dark\:focus\:ring-opacity-25:focus:is(.dark *) { --tw-ring-opacity: 0.25; } -:is(.dark .dark\:focus\:ring-offset-blue-200:focus) { +.dark\:focus\:ring-offset-blue-200:focus:is(.dark *) { --tw-ring-offset-color: #bfdbfe; } -:is(.dark .dark\:focus\:ring-offset-gray-800:focus) { +.dark\:focus\:ring-offset-gray-800:focus:is(.dark *) { --tw-ring-offset-color: #1f2937; } -:is(.dark .dark\:focus\:ring-offset-gray-900:focus) { +.dark\:focus\:ring-offset-gray-900:focus:is(.dark *) { --tw-ring-offset-color: #111827; } -:is(.dark .dark\:focus\:ring-offset-green-200:focus) { +.dark\:focus\:ring-offset-green-200:focus:is(.dark *) { --tw-ring-offset-color: #bbf7d0; } -:is(.dark .dark\:focus\:ring-offset-red-200:focus) { +.dark\:focus\:ring-offset-red-200:focus:is(.dark *) { --tw-ring-offset-color: #ff9999; } -:is(.dark .dark\:focus\:ring-offset-yellow-200:focus) { +.dark\:focus\:ring-offset-yellow-200:focus:is(.dark *) { --tw-ring-offset-color: #ffff99; } -:is(.dark .dark\:focus-visible\:ring-red-500:focus-visible) { +.dark\:focus-visible\:ring-red-500:focus-visible:is(.dark *) { --tw-ring-opacity: 1; --tw-ring-color: rgb(255 0 0 / var(--tw-ring-opacity)); } -:is(.dark .group:hover .dark\:group-hover\:bg-gray-600) { +.group:hover .dark\:group-hover\:bg-gray-600:is(.dark *) { --tw-bg-opacity: 1; background-color: rgb(75 85 99 / var(--tw-bg-opacity)); } diff --git a/src/components/Pages/Anomali/Gangguan/Anomali_LAPPGU_LPT.vue b/src/components/Pages/Anomali/Gangguan/Anomali_LAPPGU_LPT.vue index 0c1f409..0752c97 100755 --- a/src/components/Pages/Anomali/Gangguan/Anomali_LAPPGU_LPT.vue +++ b/src/components/Pages/Anomali/Gangguan/Anomali_LAPPGU_LPT.vue @@ -671,7 +671,7 @@

Jarak Closing (m):

- +

Dispatch Oleh:

- +
diff --git a/src/report/Gangguan/Rekap/RGangguan_ALL.ts b/src/report/Gangguan/Rekap/RGangguan_ALL.ts index 7f38bd1..e3f26fb 100644 --- a/src/report/Gangguan/Rekap/RGangguan_ALL.ts +++ b/src/report/Gangguan/Rekap/RGangguan_ALL.ts @@ -12,78 +12,149 @@ const reportName = 'Rekapitulasi Gangguan All' const fontSize = 5 const detailFontSize = 3 -const getGroupParent = (reportMeta: any) => { - if (reportMeta.posko.id != 0) { - return { - parent: reportMeta.up3.name, - summaryName: reportMeta.posko.name, - summaryKey: 'nama_posko' - } - } - - if (reportMeta.up3.id != 0) { - return { - parent: reportMeta.uid.name, - summaryName: reportMeta.up3.name, - summaryKey: 'nama_up3' - } - } - - if (reportMeta.uid.id != 0) { - return { - parent: 'regional', - summaryName: reportMeta.uid.name, - summaryKey: 'nama_uid' - } - } - - return '' -} - const groupingData = (data: any, reportMeta: any) => { const groupedData: any = {} - const groupParent = getGroupParent(reportMeta) - if (groupParent === '') { - return { - data, - parent: '', - summaryName: '' + const reportMetaMapping: any = { + up3: 'nama_posko', + uid: 'nama_up3', + default: 'nama_uid' + } + + let key = 'nama_uid' + for (const prop in reportMetaMapping) { + if (reportMeta[prop] && reportMeta[prop].id != 0) { + key = reportMetaMapping[prop] + break } } data.forEach((item: any) => { - const group = item[groupParent.summaryKey] + const groupKey = item[key] - if (!groupedData[group]) { - groupedData[group] = [] + if (!groupedData[groupKey]) { + groupedData[groupKey] = { data: [] } } - groupedData[group].push(item) + groupedData[groupKey].data.push(item) }) - return { - data: groupedData, - parent: groupParent.parent, - summaryName: groupParent.summaryName + for (const key in groupedData) { + const data = groupedData[key].data + + data.forEach((item: any) => { + if (!groupedData[key].summary) { + groupedData[key].summary = { + total: 0, + total_selesai: 0, + // persen_selesai: 0, + total_inproses: 0, + // persen_inproses: 0, + avg_durasi_dispatch: [], + max_durasi_dispatch: [], + min_durasi_dispatch: [], + total_diatas_sla_dispatch: 0, + total_dibawah_sla_dispatch: 0, + avg_durasi_response: [], + max_durasi_response: [], + min_durasi_response: [], + total_diatas_sla_response: 0, + total_dibawah_sla_response: 0, + avg_durasi_recovery: [], + max_durasi_recovery: [], + min_durasi_recovery: [], + total_diatas_sla_recovery: 0, + total_dibawah_sla_recovery: 0 + } + } + + groupedData[key].summary.total += item.total + groupedData[key].summary.total_selesai += item.total_selesai + groupedData[key].summary.total_inproses += item.total_inproses + groupedData[key].summary.avg_durasi_dispatch.push(item.avg_durasi_dispatch) + groupedData[key].summary.max_durasi_dispatch.push(item.max_durasi_dispatch) + groupedData[key].summary.min_durasi_dispatch.push(item.min_durasi_dispatch) + groupedData[key].summary.total_diatas_sla_dispatch += item.total_diatas_sla_dispatch + groupedData[key].summary.total_dibawah_sla_dispatch += item.total_dibawah_sla_dispatch + groupedData[key].summary.avg_durasi_response.push(item.avg_durasi_response) + groupedData[key].summary.max_durasi_response.push(item.max_durasi_response) + groupedData[key].summary.min_durasi_response.push(item.min_durasi_response) + groupedData[key].summary.total_diatas_sla_response += item.total_diatas_sla_response + groupedData[key].summary.total_dibawah_sla_response += item.total_dibawah_sla_response + groupedData[key].summary.avg_durasi_recovery.push(item.avg_durasi_recovery) + groupedData[key].summary.max_durasi_recovery.push(item.max_durasi_recovery) + groupedData[key].summary.min_durasi_recovery.push(item.min_durasi_recovery) + groupedData[key].summary.total_diatas_sla_recovery += item.total_diatas_sla_recovery + groupedData[key].summary.total_dibawah_sla_recovery += item.total_dibawah_sla_recovery + }) + + groupedData[key].summary.persen_selesai = + groupedData[key].summary.total_selesai != groupedData[key].summary.total + ? (groupedData[key].summary.total_selesai / groupedData[key].summary.total) * 100 + : 100 + groupedData[key].summary.persen_inproses = + groupedData[key].summary.total_inproses != groupedData[key].summary.total + ? (groupedData[key].summary.total_inproses / groupedData[key].summary.total) * 100 + : 100 + + groupedData[key].summary.avg_durasi_dispatch = groupedData[key].summary.avg_durasi_dispatch + .length + ? groupedData[key].summary.avg_durasi_dispatch.reduce((a: any, b: any) => a + b) / + groupedData[key].summary.avg_durasi_dispatch.length + : 0 + + groupedData[key].summary.max_durasi_dispatch = Math.max( + ...groupedData[key].summary.max_durasi_dispatch + ) + groupedData[key].summary.min_durasi_dispatch = Math.min( + ...groupedData[key].summary.min_durasi_dispatch + ) + + groupedData[key].summary.avg_durasi_response = groupedData[key].summary.avg_durasi_response + .length + ? groupedData[key].summary.avg_durasi_response.reduce((a: any, b: any) => a + b) / + groupedData[key].summary.avg_durasi_response.length + : 0 + + groupedData[key].summary.max_durasi_response = Math.max( + ...groupedData[key].summary.max_durasi_response + ) + groupedData[key].summary.min_durasi_response = Math.min( + ...groupedData[key].summary.min_durasi_response + ) + + groupedData[key].summary.avg_durasi_recovery = groupedData[key].summary.avg_durasi_recovery + .length + ? groupedData[key].summary.avg_durasi_recovery.reduce((a: any, b: any) => a + b) / + groupedData[key].summary.avg_durasi_recovery.length + : 0 + + groupedData[key].summary.max_durasi_recovery = Math.max( + ...groupedData[key].summary.max_durasi_recovery + ) + groupedData[key].summary.min_durasi_recovery = Math.min( + ...groupedData[key].summary.min_durasi_recovery + ) } + + return groupedData +} + +const getTitle = (reportMeta: any) => { + if (reportMeta.up3.id != 0) { + return 'nama_up3' + } + + if (reportMeta.uid.id != 0) { + return 'nama_uid' + } + + return 'nama_regional' } const formatData = (rawData: any, reportMeta: any) => { - const tempData = groupingData(rawData, reportMeta) - const data = tempData.data[tempData.summaryName] || tempData.data const formattedData: any = [] - - let parentName = '' - let summaryName = tempData.summaryName ? tempData.summaryName : 'Seluruh Unit' - - if (tempData.parent === '') { - parentName = 'Seluruh Unit' - } else if (tempData.parent === 'regional') { - parentName = tempData.data[tempData.summaryName][0].nama_regional - } else { - parentName = tempData.parent - } + const groupedData: any = {} const total: any = { total: 0, @@ -108,74 +179,117 @@ const formatData = (rawData: any, reportMeta: any) => { total_dibawah_sla_recovery: 0 } - data.forEach((item: any) => { - total.total += item.total - total.total_selesai += item.total_selesai - total.total_inproses += item.total_inproses - total.avg_durasi_dispatch.push(item.avg_durasi_dispatch) - total.max_durasi_dispatch.push(item.max_durasi_dispatch) - total.min_durasi_dispatch.push(item.min_durasi_dispatch) - total.total_diatas_sla_dispatch += item.total_diatas_sla_dispatch - total.total_dibawah_sla_dispatch += item.total_dibawah_sla_dispatch - total.avg_durasi_response.push(item.avg_durasi_response) - total.max_durasi_response.push(item.max_durasi_response) - total.min_durasi_response.push(item.min_durasi_response) - total.total_diatas_sla_response += item.total_diatas_sla_response - total.total_dibawah_sla_response += item.total_dibawah_sla_response - total.avg_durasi_recovery.push(item.avg_durasi_recovery) - total.max_durasi_recovery.push(item.max_durasi_recovery) - total.min_durasi_recovery.push(item.min_durasi_recovery) - total.total_diatas_sla_recovery += item.total_diatas_sla_recovery - total.total_dibawah_sla_recovery += item.total_dibawah_sla_recovery - }) + const data = groupingData(rawData, reportMeta) + const title = getTitle(reportMeta) - const persenSelesai = - total.total_selesai != total.total ? (total.total_selesai / total.total) * 100 : 100 - const persenInproses = - total.total_inproses != total.total ? (total.total_inproses / total.total) * 100 : 100 + for (const key in data) { + const groupKey = data[key].data[0][title] - formattedData.push([{ content: parentName, colSpan: 22, styles: { fontStyle: 'bold' } }]) + if (!groupedData[groupKey]) { + groupedData[groupKey] = { data: [] } + } - const result = [ - formatNumber(total.total), - formatNumber(total.total_selesai), - formatPercentage(persenSelesai), - formatNumber(total.total_inproses), - formatPercentage(persenInproses), - formatNumber( - total.avg_durasi_dispatch.length - ? total.avg_durasi_dispatch.reduce((a: any, b: any) => a + b) / - total.avg_durasi_dispatch.length - : 0 - ), - formatWaktu(Math.max(...total.max_durasi_dispatch)), - formatWaktu(Math.min(...total.min_durasi_dispatch)), - formatNumber(total.total_diatas_sla_dispatch), - formatNumber(total.total_dibawah_sla_dispatch), - formatNumber( - total.avg_durasi_response.length - ? total.avg_durasi_response.reduce((a: any, b: any) => a + b) / - total.avg_durasi_response.length - : 0 - ), - formatWaktu(Math.max(...total.max_durasi_response)), - formatWaktu(Math.min(...total.min_durasi_response)), - formatNumber(total.total_diatas_sla_response), - formatNumber(total.total_dibawah_sla_response), - formatNumber( - total.avg_durasi_recovery.length - ? total.avg_durasi_recovery.reduce((a: any, b: any) => a + b) / - total.avg_durasi_recovery.length - : 0 - ), - formatWaktu(Math.max(...total.max_durasi_recovery)), - formatWaktu(Math.min(...total.min_durasi_recovery)), - formatNumber(total.total_diatas_sla_recovery), - formatNumber(total.total_dibawah_sla_recovery) - ] + groupedData[groupKey].data.push({ + key: key, + value: data[key] + }) + } - formattedData.push([{ content: '1', styles: { halign: 'right' } }, summaryName, ...result]) - formattedData.push([{ content: 'TOTAL', colSpan: 2, styles: { fontStyle: 'bold' } }, ...result]) + for (const key in groupedData) { + formattedData.push([{ content: key, colSpan: 22, styles: { fontStyle: 'bold' } }]) + + groupedData[key].data.forEach((item: any, index: any) => { + const summary = item.value.summary + + formattedData.push([ + { content: index + 1, styles: { halign: 'right' } }, + item.key, + formatNumber(summary.total), + formatNumber(summary.total_selesai), + formatPercentage(summary.persen_selesai), + formatNumber(summary.total_inproses), + formatPercentage(summary.persen_inproses), + formatNumber(summary.avg_durasi_dispatch), + formatWaktu(summary.max_durasi_dispatch), + formatWaktu(summary.min_durasi_dispatch), + formatNumber(summary.total_diatas_sla_dispatch), + formatNumber(summary.total_dibawah_sla_dispatch), + formatNumber(summary.avg_durasi_response), + formatWaktu(summary.max_durasi_response), + formatWaktu(summary.min_durasi_response), + formatNumber(summary.total_diatas_sla_response), + formatNumber(summary.total_dibawah_sla_response), + formatNumber(summary.avg_durasi_recovery), + formatWaktu(summary.max_durasi_recovery), + formatWaktu(summary.min_durasi_recovery), + formatNumber(summary.total_diatas_sla_recovery), + formatNumber(summary.total_dibawah_sla_recovery) + ]) + + total.total += summary.total + total.total_selesai += summary.total_selesai + total.total_inproses += summary.total_inproses + total.avg_durasi_dispatch.push(summary.avg_durasi_dispatch) + total.max_durasi_dispatch.push(summary.max_durasi_dispatch) + total.min_durasi_dispatch.push(summary.min_durasi_dispatch) + total.total_diatas_sla_dispatch += summary.total_diatas_sla_dispatch + total.total_dibawah_sla_dispatch += summary.total_dibawah_sla_dispatch + total.avg_durasi_response.push(summary.avg_durasi_response) + total.max_durasi_response.push(summary.max_durasi_response) + total.min_durasi_response.push(summary.min_durasi_response) + total.total_diatas_sla_response += summary.total_diatas_sla_response + total.total_dibawah_sla_response += summary.total_dibawah_sla_response + total.avg_durasi_recovery.push(summary.avg_durasi_recovery) + total.max_durasi_recovery.push(summary.max_durasi_recovery) + total.min_durasi_recovery.push(summary.min_durasi_recovery) + total.total_diatas_sla_recovery += summary.total_diatas_sla_recovery + total.total_dibawah_sla_recovery += summary.total_dibawah_sla_recovery + }) + + const persenSelesai = + total.total_selesai != total.total ? (total.total_selesai / total.total) * 100 : 100 + const persenInproses = + total.total_inproses != total.total ? (total.total_inproses / total.total) * 100 : 100 + + formattedData.push([ + { content: 'TOTAL', colSpan: 2, styles: { fontStyle: 'bold' } }, + formatNumber(total.total), + formatNumber(total.total_selesai), + formatPercentage(persenSelesai), + formatNumber(total.total_inproses), + formatPercentage(persenInproses), + formatNumber( + total.avg_durasi_dispatch.length + ? total.avg_durasi_dispatch.reduce((a: any, b: any) => a + b) / + total.avg_durasi_dispatch.length + : 0 + ), + formatWaktu(Math.max(...total.max_durasi_dispatch)), + formatWaktu(Math.min(...total.min_durasi_dispatch)), + formatNumber(total.total_diatas_sla_dispatch), + formatNumber(total.total_dibawah_sla_dispatch), + formatNumber( + total.avg_durasi_response.length + ? total.avg_durasi_response.reduce((a: any, b: any) => a + b) / + total.avg_durasi_response.length + : 0 + ), + formatWaktu(Math.max(...total.max_durasi_response)), + formatWaktu(Math.min(...total.min_durasi_response)), + formatNumber(total.total_diatas_sla_response), + formatNumber(total.total_dibawah_sla_response), + formatNumber( + total.avg_durasi_recovery.length + ? total.avg_durasi_recovery.reduce((a: any, b: any) => a + b) / + total.avg_durasi_recovery.length + : 0 + ), + formatWaktu(Math.max(...total.max_durasi_recovery)), + formatWaktu(Math.min(...total.min_durasi_recovery)), + formatNumber(total.total_diatas_sla_recovery), + formatNumber(total.total_dibawah_sla_recovery) + ]) + } return formattedData }