diff --git a/src/enums/pageEnum.ts b/src/enums/pageEnum.ts index c7ca3632..5bae8c22 100644 --- a/src/enums/pageEnum.ts +++ b/src/enums/pageEnum.ts @@ -2,7 +2,7 @@ export enum PageEnum { // basic login path BASE_LOGIN = '/login', // basic home path - BASE_HOME = '/dashboard', + BASE_HOME = '/main/meteorological', // error page path ERROR_PAGE = '/exception', // error log page path diff --git a/src/router/routes/modules/dashboard.ts b/src/router/routes/modules/dashboard.ts deleted file mode 100644 index e13f18c1..00000000 --- a/src/router/routes/modules/dashboard.ts +++ /dev/null @@ -1,37 +0,0 @@ -import type { AppRouteModule } from '/@/router/types' - -import { LAYOUT } from '/@/router/constant' -import { t } from '/@/hooks/web/useI18n' - -const dashboard: AppRouteModule = { - path: '/dashboard', - name: 'Dashboard', - component: LAYOUT, - redirect: '/dashboard/workbench', - meta: { - orderNo: 10, - icon: 'ion:grid-outline', - title: t('routes.dashboard.dashboard'), - }, - children: [ - // { - // path: 'analysis', - // name: 'Analysis', - // component: () => import('/@/views/dashboard/analysis/index.vue'), - // meta: { - // // affix: true, - // title: t('routes.dashboard.analysis'), - // }, - // }, - { - path: 'workbench', - name: 'Workbench', - component: () => import('/@/views/dashboard/workbench/index.vue'), - meta: { - title: t('routes.dashboard.workbench'), - }, - }, - ], -} - -export default dashboard diff --git a/src/views/main/meteorological/components/AirHumidity.vue b/src/views/main/meteorological/components/AirHumidity.vue index f8efce68..3311ade5 100644 --- a/src/views/main/meteorological/components/AirHumidity.vue +++ b/src/views/main/meteorological/components/AirHumidity.vue @@ -27,6 +27,10 @@ type: Object as PropType, default: () => {}, }, + company: { + type: String as PropType, + default: '', + }, }) const chartRef = ref(null) const { setOptions } = useECharts(chartRef as Ref) @@ -34,6 +38,7 @@ () => props.data, (e) => { if (e) { + const format = props.company === 'day' ? 'HH:mm' : 'YYYY-MM-DD' setOptions({ tooltip: { trigger: 'axis', @@ -46,7 +51,7 @@ }, xAxis: { type: 'category', - data: Object.keys(e).map((e) => dayjs(e).format('YYYY-MM-DD HH:mm')), + data: Object.keys(e).map((e) => dayjs(e).format(format)), axisTick: { show: false, }, @@ -86,8 +91,6 @@ type: 'inside', //slider表示有滑动块的,inside表示内置的 show: false, xAxisIndex: 0, - start: 50, - end: 100, }, ], }) diff --git a/src/views/main/meteorological/components/AirTemperature.vue b/src/views/main/meteorological/components/AirTemperature.vue index f081827c..58ff8cd2 100644 --- a/src/views/main/meteorological/components/AirTemperature.vue +++ b/src/views/main/meteorological/components/AirTemperature.vue @@ -28,6 +28,10 @@ type: Object as PropType, default: () => {}, }, + company: { + type: String as PropType, + default: '', + }, }) const chartRef = ref(null) const { setOptions } = useECharts(chartRef as Ref) @@ -35,6 +39,7 @@ () => props.data, (e) => { if (e) { + const format = props.company === 'day' ? 'HH:mm' : 'YYYY-MM-DD' setOptions({ tooltip: { trigger: 'axis', @@ -47,7 +52,7 @@ }, xAxis: { type: 'category', - data: Object.keys(e).map((e) => dayjs(e).format('YYYY-MM-DD HH:mm')), + data: Object.keys(e).map((e) => dayjs(e).format(format)), axisTick: { show: false, }, @@ -99,8 +104,6 @@ type: 'inside', //slider表示有滑动块的,inside表示内置的 show: false, xAxisIndex: 0, - start: 50, - end: 100, }, ], }) diff --git a/src/views/main/meteorological/components/CO2.vue b/src/views/main/meteorological/components/CO2.vue index e8b523f8..571ef3c0 100644 --- a/src/views/main/meteorological/components/CO2.vue +++ b/src/views/main/meteorological/components/CO2.vue @@ -27,6 +27,10 @@ type: Object as PropType, default: () => {}, }, + company: { + type: String as PropType, + default: '', + }, }) const chartRef = ref(null) const { setOptions } = useECharts(chartRef as Ref) @@ -34,6 +38,7 @@ () => props.data, (e) => { if (e) { + const format = props.company === 'day' ? 'HH:mm' : 'YYYY-MM-DD' setOptions({ tooltip: { trigger: 'axis', @@ -46,7 +51,7 @@ }, xAxis: { type: 'category', - data: Object.keys(e).map((e) => dayjs(e).format('YYYY-MM-DD HH:mm')), + data: Object.keys(e).map((e) => dayjs(e).format(format)), axisTick: { show: false, }, @@ -85,8 +90,6 @@ type: 'inside', //slider表示有滑动块的,inside表示内置的 show: false, xAxisIndex: 0, - start: 50, - end: 100, }, ], }) diff --git a/src/views/main/meteorological/components/LightIntensity.vue b/src/views/main/meteorological/components/LightIntensity.vue index 03b7c0e2..dc71c52a 100644 --- a/src/views/main/meteorological/components/LightIntensity.vue +++ b/src/views/main/meteorological/components/LightIntensity.vue @@ -27,6 +27,10 @@ type: Object as PropType, default: () => {}, }, + company: { + type: String as PropType, + default: '', + }, }) const chartRef = ref(null) const { setOptions } = useECharts(chartRef as Ref) @@ -34,6 +38,7 @@ () => props.data, (e) => { if (e) { + const format = props.company === 'day' ? 'HH:mm' : 'YYYY-MM-DD' setOptions({ tooltip: { trigger: 'axis', @@ -46,7 +51,7 @@ }, xAxis: { type: 'category', - data: Object.keys(e).map((e) => dayjs(e).format('YYYY-MM-DD HH:mm')), + data: Object.keys(e).map((e) => dayjs(e).format(format)), axisTick: { show: false, }, @@ -83,8 +88,6 @@ type: 'inside', //slider表示有滑动块的,inside表示内置的 show: false, xAxisIndex: 0, - start: 50, - end: 100, }, ], }) diff --git a/src/views/main/meteorological/components/Noise.vue b/src/views/main/meteorological/components/Noise.vue index 8e52d72f..4971d426 100644 --- a/src/views/main/meteorological/components/Noise.vue +++ b/src/views/main/meteorological/components/Noise.vue @@ -27,6 +27,10 @@ type: Object as PropType, default: () => {}, }, + company: { + type: String as PropType, + default: '', + }, }) const chartRef = ref(null) const { setOptions } = useECharts(chartRef as Ref) @@ -34,6 +38,7 @@ () => props.data, (e) => { if (e) { + const format = props.company === 'day' ? 'HH:mm' : 'YYYY-MM-DD' setOptions({ tooltip: { trigger: 'axis', @@ -46,7 +51,7 @@ }, xAxis: { type: 'category', - data: Object.keys(e).map((e) => dayjs(e).format('YYYY-MM-DD HH:mm')), + data: Object.keys(e).map((e) => dayjs(e).format(format)), axisTick: { show: false, }, @@ -85,8 +90,6 @@ type: 'inside', //slider表示有滑动块的,inside表示内置的 show: false, xAxisIndex: 0, - start: 50, - end: 100, }, ], }) diff --git a/src/views/main/meteorological/components/PM10.vue b/src/views/main/meteorological/components/PM10.vue index 3356be37..72858f20 100644 --- a/src/views/main/meteorological/components/PM10.vue +++ b/src/views/main/meteorological/components/PM10.vue @@ -27,6 +27,10 @@ type: Object as PropType, default: () => {}, }, + company: { + type: String as PropType, + default: '', + }, }) const chartRef = ref(null) const { setOptions } = useECharts(chartRef as Ref) @@ -34,6 +38,7 @@ () => props.data, (e) => { if (e) { + const format = props.company === 'day' ? 'HH:mm' : 'YYYY-MM-DD' setOptions({ tooltip: { trigger: 'axis', @@ -46,7 +51,7 @@ }, xAxis: { type: 'category', - data: Object.keys(e).map((e) => dayjs(e).format('YYYY-MM-DD HH:mm')), + data: Object.keys(e).map((e) => dayjs(e).format(format)), axisTick: { show: false, }, @@ -85,8 +90,6 @@ type: 'inside', //slider表示有滑动块的,inside表示内置的 show: false, xAxisIndex: 0, - start: 50, - end: 100, }, ], }) diff --git a/src/views/main/meteorological/components/PM25.vue b/src/views/main/meteorological/components/PM25.vue index 159314e4..ed5d3026 100644 --- a/src/views/main/meteorological/components/PM25.vue +++ b/src/views/main/meteorological/components/PM25.vue @@ -27,6 +27,10 @@ type: Object as PropType, default: () => {}, }, + company: { + type: String as PropType, + default: '', + }, }) const chartRef = ref(null) const { setOptions } = useECharts(chartRef as Ref) @@ -34,6 +38,7 @@ () => props.data, (e) => { if (e) { + const format = props.company === 'day' ? 'HH:mm' : 'YYYY-MM-DD' setOptions({ tooltip: { trigger: 'axis', @@ -46,7 +51,7 @@ }, xAxis: { type: 'category', - data: Object.keys(e).map((e) => dayjs(e).format('YYYY-MM-DD HH:mm')), + data: Object.keys(e).map((e) => dayjs(e).format(format)), axisTick: { show: false, }, @@ -85,8 +90,6 @@ type: 'inside', //slider表示有滑动块的,inside表示内置的 show: false, xAxisIndex: 0, - start: 50, - end: 100, }, ], }) diff --git a/src/views/main/meteorological/components/Pressure.vue b/src/views/main/meteorological/components/Pressure.vue index 82315fa6..98c1afe1 100644 --- a/src/views/main/meteorological/components/Pressure.vue +++ b/src/views/main/meteorological/components/Pressure.vue @@ -27,6 +27,10 @@ type: Object as PropType, default: () => {}, }, + company: { + type: String as PropType, + default: '', + }, }) const chartRef = ref(null) const { setOptions } = useECharts(chartRef as Ref) @@ -34,6 +38,7 @@ () => props.data, (e) => { if (e) { + const format = props.company === 'day' ? 'HH:mm' : 'YYYY-MM-DD' setOptions({ tooltip: { trigger: 'axis', @@ -46,7 +51,7 @@ }, xAxis: { type: 'category', - data: Object.keys(e).map((e) => dayjs(e).format('YYYY-MM-DD HH:mm')), + data: Object.keys(e).map((e) => dayjs(e).format(format)), axisTick: { show: false, }, @@ -85,8 +90,6 @@ type: 'inside', //slider表示有滑动块的,inside表示内置的 show: false, xAxisIndex: 0, - start: 50, - end: 100, }, ], }) diff --git a/src/views/main/meteorological/components/Rainfall.vue b/src/views/main/meteorological/components/Rainfall.vue index 2cce907e..2fc644b5 100644 --- a/src/views/main/meteorological/components/Rainfall.vue +++ b/src/views/main/meteorological/components/Rainfall.vue @@ -27,6 +27,10 @@ type: Object as PropType, default: () => {}, }, + company: { + type: String as PropType, + default: '', + }, }) const chartRef = ref(null) const { setOptions } = useECharts(chartRef as Ref) @@ -34,6 +38,7 @@ () => props.data, (e) => { if (e) { + const format = props.company === 'day' ? 'HH:mm' : 'YYYY-MM-DD' setOptions({ tooltip: { trigger: 'axis', @@ -46,7 +51,7 @@ }, xAxis: { type: 'category', - data: Object.keys(e).map((e) => dayjs(e).format('YYYY-MM-DD HH:mm')), + data: Object.keys(e).map((e) => dayjs(e).format(format)), axisTick: { show: false, }, @@ -83,8 +88,6 @@ type: 'inside', //slider表示有滑动块的,inside表示内置的 show: false, xAxisIndex: 0, - start: 50, - end: 100, }, ], }) diff --git a/src/views/main/meteorological/components/WindDirection.vue b/src/views/main/meteorological/components/WindDirection.vue index 9241663c..deea3ff0 100644 --- a/src/views/main/meteorological/components/WindDirection.vue +++ b/src/views/main/meteorological/components/WindDirection.vue @@ -27,6 +27,10 @@ type: Object as PropType, default: () => {}, }, + company: { + type: String as PropType, + default: '', + }, }) const chartRef = ref(null) const { setOptions } = useECharts(chartRef as Ref) @@ -34,6 +38,7 @@ () => props.data, (e) => { if (e) { + const format = props.company === 'day' ? 'HH:mm' : 'YYYY-MM-DD' setOptions({ tooltip: { trigger: 'axis', @@ -46,7 +51,7 @@ }, xAxis: { type: 'category', - data: Object.keys(e).map((e) => dayjs(e).format('YYYY-MM-DD HH:mm')), + data: Object.keys(e).map((e) => dayjs(e).format(format)), axisTick: { show: false, }, @@ -83,8 +88,6 @@ type: 'inside', //slider表示有滑动块的,inside表示内置的 show: false, xAxisIndex: 0, - start: 50, - end: 100, }, ], }) diff --git a/src/views/main/meteorological/components/WindSpeed.vue b/src/views/main/meteorological/components/WindSpeed.vue index b0a7396d..0db0af82 100644 --- a/src/views/main/meteorological/components/WindSpeed.vue +++ b/src/views/main/meteorological/components/WindSpeed.vue @@ -28,6 +28,10 @@ type: Object as PropType, default: () => {}, }, + company: { + type: String as PropType, + default: '', + }, }) const chartRef = ref(null) const { setOptions } = useECharts(chartRef as Ref) @@ -35,6 +39,7 @@ () => props.data, (e) => { if (e) { + const format = props.company === 'day' ? 'HH:mm' : 'YYYY-MM-DD' setOptions({ tooltip: { trigger: 'axis', @@ -47,7 +52,7 @@ }, xAxis: { type: 'category', - data: Object.keys(e).map((e) => dayjs(e).format('YYYY-MM-DD HH:mm')), + data: Object.keys(e).map((e) => dayjs(e).format(format)), axisTick: { show: false, }, @@ -99,8 +104,6 @@ type: 'inside', //slider表示有滑动块的,inside表示内置的 show: false, xAxisIndex: 0, - start: 50, - end: 100, }, ], }) diff --git a/src/views/main/meteorological/index.vue b/src/views/main/meteorological/index.vue index ea14444c..ef3358b4 100644 --- a/src/views/main/meteorological/index.vue +++ b/src/views/main/meteorological/index.vue @@ -85,6 +85,7 @@ :extra="name" class="md:w-386px w-full !mr-4 !mb-4" :loading="false" + :company="formState.time_interval" />