diff --git a/package.json b/package.json index 9d833a8..72be3b0 100755 --- a/package.json +++ b/package.json @@ -3,7 +3,8 @@ "version": "0.0.1", "private": true, "scripts": { - "dev": "vite --host", + "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", diff --git a/src/assets/css/style.css b/src/assets/css/style.css index 7e3d44c..bd90444 100755 --- a/src/assets/css/style.css +++ b/src/assets/css/style.css @@ -5545,10 +5545,6 @@ body { grid-column-start: 2; } - .sm\:m-8 { - margin: 2rem; - } - .sm\:mx-0 { margin-left: 0px; margin-right: 0px; diff --git a/src/components/DatePicker.vue b/src/components/DatePicker.vue index 1821a2f..3a7bb7b 100755 --- a/src/components/DatePicker.vue +++ b/src/components/DatePicker.vue @@ -4,7 +4,7 @@ import { ref, watch } from 'vue' import VueTailwindDatepicker from 'vue-tailwind-datepicker' const dateValue = ref( - `${new Date().getDay().toString().length == 1 ? `0${new Date().getDay()}` : new Date().getDay()}-${new Date().getMonth().toString().length == 1 ? `0${new Date().getMonth()}` : new Date().getMonth()}-${new Date().getFullYear()} s/d ${new Date().getDay().toString().length == 1 ? `0${new Date().getDay()}` : new Date().getDay()}-${new Date().getMonth().toString().length == 1 ? `0${new Date().getMonth()}` : new Date().getMonth()}-${new Date().getFullYear()}` + `${new Date().getDay().toString().length == 1 ? `0${new Date().getDay()}` : new Date().getDay()}-${(new Date().getMonth() + 1).toString().length == 1 ? `0${new Date().getMonth() + 1}` : new Date().getMonth() + 1}-${new Date().getFullYear()} s/d ${new Date().getDay().toString().length == 1 ? `0${new Date().getDay()}` : new Date().getDay()}-${(new Date().getMonth() + 1).toString().length == 1 ? `0${new Date().getMonth() + 1}` : new Date().getMonth() + 1}-${new Date().getFullYear()}` ) const formatter = ref({ date: 'DD-MM-YYYY', @@ -15,14 +15,56 @@ const emit = defineEmits(['update:dateValue']) const customShortcuts = () => { return [ { - label: 'Last 15 Days', + label: 'Hari Ini', + atClick: () => { + const date = new Date() + return [new Date(date.setHours(0, 0, 0, 0)), new Date()] + } + }, + { + label: 'Kemarin', + atClick: () => { + const date = new Date() + return [new Date(date.setDate(date.getDate() - 1)), new Date(date.setHours(0, 0, 0, 0))] + } + }, + { + label: '7 Hari Terakhir', + atClick: () => { + const date = new Date() + return [new Date(date.setDate(date.getDate() - 7)), new Date()] + } + }, + { + label: '15 Hari Terakhir', atClick: () => { const date = new Date() return [new Date(date.setDate(date.getDate() - 15)), new Date()] } }, { - label: 'Last Years', + label: '30 Hari Terakhir', + atClick: () => { + const date = new Date() + return [new Date(date.setDate(date.getDate() - 30)), new Date()] + } + }, + { + label: '3 Bulan Terakhir', + atClick: () => { + const date = new Date() + return [new Date(date.setMonth(date.getMonth() - 3)), new Date()] + } + }, + { + label: '6 Bulan Terakhir', + atClick: () => { + const date = new Date() + return [new Date(date.setMonth(date.getMonth() - 6)), new Date()] + } + }, + { + label: '1 Tahun Terakhir', atClick: () => { const date = new Date() return [new Date(date.setFullYear(date.getFullYear() - 1)), new Date()] diff --git a/src/components/Form/FiltersType/Type7.vue b/src/components/Form/FiltersType/Type7.vue index ad0f5f6..e32f770 100755 --- a/src/components/Form/FiltersType/Type7.vue +++ b/src/components/Form/FiltersType/Type7.vue @@ -6,9 +6,9 @@ interface SlaOption { max: string } -import Select from '@/components/Select.vue'; -import DatePicker from '@/components/DatePicker.vue'; -import InputWithSuffix from '../InputWithSuffix.vue'; +import Select from '@/components/Select.vue' +import DatePicker from '@/components/DatePicker.vue' +import InputWithSuffix from '../InputWithSuffix.vue' import { selectedUid, selectedUp3Posko, @@ -17,8 +17,8 @@ import { itemsUid, itemsUp3, itemsPosko -} from './reference'; -import { onMounted, ref, watch } from 'vue'; +} from './reference' +import { onMounted, ref, watch } from 'vue' const props = defineProps({ slaOptions: { @@ -27,7 +27,7 @@ const props = defineProps({ { id: 1, name: 'Dibawah / Sesuai SLA (<= 45 menit)', - min: '1', + min: '0', max: '45' }, { @@ -143,14 +143,23 @@ onMounted(() => {
-
-
@@ -166,12 +175,19 @@ onMounted(() => {