bfg-common 1.4.884 → 1.4.885
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/localization/local_be.json +3025 -3018
- package/assets/localization/local_en.json +3029 -3022
- package/assets/localization/local_hy.json +3029 -3022
- package/assets/localization/local_kk.json +8 -1
- package/assets/localization/local_ru.json +8 -1
- package/assets/localization/local_zh.json +8 -2
- package/components/common/graph/GraphNew.vue +179 -178
- package/components/common/monitor/advanced/tools/chartOptionsModal/actions/Actions.vue +106 -106
- package/components/common/monitor/advanced/tools/chartOptionsModal/actions/ActionsNew.vue +1 -0
- package/components/common/monitor/advanced/tools/chartOptionsModal/actions/lib/utils/optionsActions.ts +28 -25
- package/components/common/monitor/overview/Overview.vue +132 -224
- package/components/common/monitor/overview/OverviewNew.vue +120 -142
- package/components/common/monitor/overview/filters/Filters.vue +169 -166
- package/components/common/monitor/overview/filters/FiltersNew.vue +183 -172
- package/components/common/monitor/overview/filters/FiltersOld.vue +2 -0
- package/components/common/monitor/overview/filters/customIntervalModal/CustomIntervalModal.vue +173 -175
- package/components/common/monitor/overview/filters/customIntervalModal/CustomIntervalModalNew.vue +206 -186
- package/components/common/monitor/overview/filters/customIntervalModal/CustomIntervalModalOld.vue +2 -2
- package/package.json +2 -2
|
@@ -1,106 +1,106 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<common-monitor-advanced-tools-chart-options-modal-actions-new
|
|
3
|
-
v-if="isNewView"
|
|
4
|
-
v-model:is-confirm-modal="isConfirmModal"
|
|
5
|
-
v-model:local-selected-chart-option="localSelectedChartOption"
|
|
6
|
-
:chart-options="chartOptions"
|
|
7
|
-
:is-disabled-delete-action="isDisabledDeleteAction"
|
|
8
|
-
@save-options="onSaveOptions"
|
|
9
|
-
@delete-action="onDeleteAction"
|
|
10
|
-
@apply-delete="onApplyDelete"
|
|
11
|
-
/>
|
|
12
|
-
<common-monitor-advanced-tools-chart-options-modal-actions-old
|
|
13
|
-
v-else
|
|
14
|
-
v-model:is-confirm-modal="isConfirmModal"
|
|
15
|
-
v-model:local-selected-chart-option="localSelectedChartOption"
|
|
16
|
-
:chart-options="chartOptions"
|
|
17
|
-
:is-show-save-options-modal="isShowSaveOptionsModal"
|
|
18
|
-
:is-disabled-delete-action="isDisabledDeleteAction"
|
|
19
|
-
@show-save-options-modal="onShowSaveOptionsModal"
|
|
20
|
-
@hide-save-options-modal="onHideSaveOptionsModal"
|
|
21
|
-
@save-options="onSaveOptions"
|
|
22
|
-
@delete-action="onDeleteAction"
|
|
23
|
-
@apply-delete="onApplyDelete"
|
|
24
|
-
/>
|
|
25
|
-
</template>
|
|
26
|
-
|
|
27
|
-
<script setup lang="ts">
|
|
28
|
-
import type { UI_I_Localization } from '~/lib/models/interfaces'
|
|
29
|
-
import type { UI_I_OptionItem } from '~/components/atoms/lib/models/interfaces'
|
|
30
|
-
import { chartOptionItems } from '~/components/common/monitor/advanced/tools/chartOptionsModal/actions/lib/utils/optionsActions'
|
|
31
|
-
|
|
32
|
-
const props = defineProps<{
|
|
33
|
-
isDisabledSave: boolean
|
|
34
|
-
optionsNames: string[]
|
|
35
|
-
selectedChartOptionName: string
|
|
36
|
-
}>()
|
|
37
|
-
|
|
38
|
-
const emits = defineEmits<{
|
|
39
|
-
(event: 'save', value: string): void
|
|
40
|
-
(event: 'check-validation'): void
|
|
41
|
-
(event: 'select-local-option-name', value: string): void
|
|
42
|
-
(event: 'delete-chart-name', value: string): void
|
|
43
|
-
}>()
|
|
44
|
-
|
|
45
|
-
const { $store }: any = useNuxtApp()
|
|
46
|
-
|
|
47
|
-
const isNewView = computed<boolean>(() => $store.getters['main/getIsNewView'])
|
|
48
|
-
|
|
49
|
-
const localization = computed<UI_I_Localization>(() => useLocal())
|
|
50
|
-
|
|
51
|
-
const localSelectedChartOption = ref<string>('select_options')
|
|
52
|
-
const isDisabledDeleteAction = computed<boolean>(() => {
|
|
53
|
-
const chartOptionName = localSelectedChartOption.value
|
|
54
|
-
let result = false
|
|
55
|
-
|
|
56
|
-
if (chartOptionName !== 'select_options' && chartOptionName !== 'default')
|
|
57
|
-
result = true
|
|
58
|
-
|
|
59
|
-
return result
|
|
60
|
-
})
|
|
61
|
-
const chartOptions = computed<UI_I_OptionItem[]>(() =>
|
|
62
|
-
chartOptionItems(localization.value, props.optionsNames)
|
|
63
|
-
)
|
|
64
|
-
watch(
|
|
65
|
-
() => props.selectedChartOptionName,
|
|
66
|
-
(newValue) => {
|
|
67
|
-
localSelectedChartOption.value =
|
|
68
|
-
newValue || localSelectedChartOption.value || 'select_options'
|
|
69
|
-
},
|
|
70
|
-
{ immediate: true }
|
|
71
|
-
)
|
|
72
|
-
watch(
|
|
73
|
-
localSelectedChartOption,
|
|
74
|
-
(newValue) => {
|
|
75
|
-
emits('select-local-option-name', newValue)
|
|
76
|
-
},
|
|
77
|
-
{ immediate: true }
|
|
78
|
-
)
|
|
79
|
-
|
|
80
|
-
const isShowSaveOptionsModal = ref<boolean>(false)
|
|
81
|
-
const onShowSaveOptionsModal = (): void => {
|
|
82
|
-
if (!props.isDisabledSave) isShowSaveOptionsModal.value = true
|
|
83
|
-
|
|
84
|
-
emits('check-validation')
|
|
85
|
-
}
|
|
86
|
-
const onHideSaveOptionsModal = (): boolean =>
|
|
87
|
-
(isShowSaveOptionsModal.value = false)
|
|
88
|
-
const onSaveOptions = (name: string): void => {
|
|
89
|
-
onHideSaveOptionsModal()
|
|
90
|
-
emits('save', name)
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
const isConfirmModal = ref<boolean>(false)
|
|
94
|
-
|
|
95
|
-
const onDeleteAction = (): void => {
|
|
96
|
-
isConfirmModal.value = true
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
const onApplyDelete = (): void => {
|
|
100
|
-
isConfirmModal.value = false
|
|
101
|
-
emits('delete-chart-name', localSelectedChartOption.value)
|
|
102
|
-
localSelectedChartOption.value = 'select_options'
|
|
103
|
-
}
|
|
104
|
-
</script>
|
|
105
|
-
|
|
106
|
-
<style scoped lang="scss"></style>
|
|
1
|
+
<template>
|
|
2
|
+
<common-monitor-advanced-tools-chart-options-modal-actions-new
|
|
3
|
+
v-if="isNewView"
|
|
4
|
+
v-model:is-confirm-modal="isConfirmModal"
|
|
5
|
+
v-model:local-selected-chart-option="localSelectedChartOption"
|
|
6
|
+
:chart-options="chartOptions"
|
|
7
|
+
:is-disabled-delete-action="isDisabledDeleteAction"
|
|
8
|
+
@save-options="onSaveOptions"
|
|
9
|
+
@delete-action="onDeleteAction"
|
|
10
|
+
@apply-delete="onApplyDelete"
|
|
11
|
+
/>
|
|
12
|
+
<common-monitor-advanced-tools-chart-options-modal-actions-old
|
|
13
|
+
v-else
|
|
14
|
+
v-model:is-confirm-modal="isConfirmModal"
|
|
15
|
+
v-model:local-selected-chart-option="localSelectedChartOption"
|
|
16
|
+
:chart-options="chartOptions"
|
|
17
|
+
:is-show-save-options-modal="isShowSaveOptionsModal"
|
|
18
|
+
:is-disabled-delete-action="isDisabledDeleteAction"
|
|
19
|
+
@show-save-options-modal="onShowSaveOptionsModal"
|
|
20
|
+
@hide-save-options-modal="onHideSaveOptionsModal"
|
|
21
|
+
@save-options="onSaveOptions"
|
|
22
|
+
@delete-action="onDeleteAction"
|
|
23
|
+
@apply-delete="onApplyDelete"
|
|
24
|
+
/>
|
|
25
|
+
</template>
|
|
26
|
+
|
|
27
|
+
<script setup lang="ts">
|
|
28
|
+
import type { UI_I_Localization } from '~/lib/models/interfaces'
|
|
29
|
+
import type { UI_I_OptionItem } from '~/components/atoms/lib/models/interfaces'
|
|
30
|
+
import { chartOptionItems } from '~/components/common/monitor/advanced/tools/chartOptionsModal/actions/lib/utils/optionsActions'
|
|
31
|
+
|
|
32
|
+
const props = defineProps<{
|
|
33
|
+
isDisabledSave: boolean
|
|
34
|
+
optionsNames: string[]
|
|
35
|
+
selectedChartOptionName: string
|
|
36
|
+
}>()
|
|
37
|
+
|
|
38
|
+
const emits = defineEmits<{
|
|
39
|
+
(event: 'save', value: string): void
|
|
40
|
+
(event: 'check-validation'): void
|
|
41
|
+
(event: 'select-local-option-name', value: string): void
|
|
42
|
+
(event: 'delete-chart-name', value: string): void
|
|
43
|
+
}>()
|
|
44
|
+
|
|
45
|
+
const { $store }: any = useNuxtApp()
|
|
46
|
+
|
|
47
|
+
const isNewView = computed<boolean>(() => $store.getters['main/getIsNewView'])
|
|
48
|
+
|
|
49
|
+
const localization = computed<UI_I_Localization>(() => useLocal())
|
|
50
|
+
|
|
51
|
+
const localSelectedChartOption = ref<string>('select_options')
|
|
52
|
+
const isDisabledDeleteAction = computed<boolean>(() => {
|
|
53
|
+
const chartOptionName = localSelectedChartOption.value
|
|
54
|
+
let result = false
|
|
55
|
+
|
|
56
|
+
if (chartOptionName !== 'select_options' && chartOptionName !== 'default')
|
|
57
|
+
result = true
|
|
58
|
+
|
|
59
|
+
return result
|
|
60
|
+
})
|
|
61
|
+
const chartOptions = computed<UI_I_OptionItem[]>(() =>
|
|
62
|
+
chartOptionItems(localization.value, props.optionsNames, isNewView.value)
|
|
63
|
+
)
|
|
64
|
+
watch(
|
|
65
|
+
() => props.selectedChartOptionName,
|
|
66
|
+
(newValue) => {
|
|
67
|
+
localSelectedChartOption.value =
|
|
68
|
+
newValue || localSelectedChartOption.value || 'select_options'
|
|
69
|
+
},
|
|
70
|
+
{ immediate: true }
|
|
71
|
+
)
|
|
72
|
+
watch(
|
|
73
|
+
localSelectedChartOption,
|
|
74
|
+
(newValue) => {
|
|
75
|
+
emits('select-local-option-name', newValue)
|
|
76
|
+
},
|
|
77
|
+
{ immediate: true }
|
|
78
|
+
)
|
|
79
|
+
|
|
80
|
+
const isShowSaveOptionsModal = ref<boolean>(false)
|
|
81
|
+
const onShowSaveOptionsModal = (): void => {
|
|
82
|
+
if (!props.isDisabledSave) isShowSaveOptionsModal.value = true
|
|
83
|
+
|
|
84
|
+
emits('check-validation')
|
|
85
|
+
}
|
|
86
|
+
const onHideSaveOptionsModal = (): boolean =>
|
|
87
|
+
(isShowSaveOptionsModal.value = false)
|
|
88
|
+
const onSaveOptions = (name: string): void => {
|
|
89
|
+
onHideSaveOptionsModal()
|
|
90
|
+
emits('save', name)
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
const isConfirmModal = ref<boolean>(false)
|
|
94
|
+
|
|
95
|
+
const onDeleteAction = (): void => {
|
|
96
|
+
isConfirmModal.value = true
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
const onApplyDelete = (): void => {
|
|
100
|
+
isConfirmModal.value = false
|
|
101
|
+
emits('delete-chart-name', localSelectedChartOption.value)
|
|
102
|
+
localSelectedChartOption.value = 'select_options'
|
|
103
|
+
}
|
|
104
|
+
</script>
|
|
105
|
+
|
|
106
|
+
<style scoped lang="scss"></style>
|
|
@@ -1,25 +1,28 @@
|
|
|
1
|
-
import type { UI_I_Localization } from '~/lib/models/interfaces'
|
|
2
|
-
import type { UI_I_OptionItem } from '~/components/atoms/lib/models/interfaces'
|
|
3
|
-
|
|
4
|
-
export const chartOptionItems = (
|
|
5
|
-
localization: UI_I_Localization,
|
|
6
|
-
names: string[]
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
}
|
|
1
|
+
import type { UI_I_Localization } from '~/lib/models/interfaces'
|
|
2
|
+
import type { UI_I_OptionItem } from '~/components/atoms/lib/models/interfaces'
|
|
3
|
+
|
|
4
|
+
export const chartOptionItems = (
|
|
5
|
+
localization: UI_I_Localization,
|
|
6
|
+
names: string[],
|
|
7
|
+
isNewView: boolean
|
|
8
|
+
): UI_I_OptionItem[] => {
|
|
9
|
+
const mainOptionsNames = [
|
|
10
|
+
{
|
|
11
|
+
text: isNewView
|
|
12
|
+
? `--${localization.common.new}--`
|
|
13
|
+
: `--${localization.inventoryMonitor.selectOption}--`,
|
|
14
|
+
value: 'select_options',
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
text: localization.common.default,
|
|
18
|
+
value: 'default',
|
|
19
|
+
},
|
|
20
|
+
]
|
|
21
|
+
names.forEach((name) => {
|
|
22
|
+
mainOptionsNames.push({
|
|
23
|
+
text: name,
|
|
24
|
+
value: name,
|
|
25
|
+
})
|
|
26
|
+
})
|
|
27
|
+
return mainOptionsNames
|
|
28
|
+
}
|
|
@@ -1,224 +1,132 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<common-monitor-overview-new
|
|
3
|
-
v-if="isNewView"
|
|
4
|
-
:charts="chartsLocal"
|
|
5
|
-
:all-data="allData"
|
|
6
|
-
:update-helper="updateHelper"
|
|
7
|
-
/>
|
|
8
|
-
<common-monitor-overview-old
|
|
9
|
-
v-else
|
|
10
|
-
:charts="chartsLocal"
|
|
11
|
-
:all-data="allData"
|
|
12
|
-
:update-helper="updateHelper"
|
|
13
|
-
/>
|
|
14
|
-
</template>
|
|
15
|
-
|
|
16
|
-
<script setup lang="ts">
|
|
17
|
-
import { format } from 'date-fns'
|
|
18
|
-
import type {
|
|
19
|
-
I_SeriesColumn,
|
|
20
|
-
I_SeriesLine,
|
|
21
|
-
I_ColumnGraph,
|
|
22
|
-
I_LineGraph,
|
|
23
|
-
} from '~/node_modules/bfg-nuxt-3-graph/graph/lib/models/interfaces'
|
|
24
|
-
import {
|
|
25
|
-
columnGraphDataFunc,
|
|
26
|
-
graphDataFunc,
|
|
27
|
-
} from '~/node_modules/bfg-nuxt-3-graph/graph/lib/utils/renderGraph'
|
|
28
|
-
import type { UI_I_Localization } from '~/lib/models/interfaces'
|
|
29
|
-
import type { UI_I_GraphDataSettingItem } from '~/components/common/monitor/lib/models/interfaces'
|
|
30
|
-
|
|
31
|
-
const props = defineProps<{
|
|
32
|
-
charts: UI_I_GraphDataSettingItem[]
|
|
33
|
-
themeMode?: string
|
|
34
|
-
formatDate?: string
|
|
35
|
-
formatTime?: string
|
|
36
|
-
graphType: string
|
|
37
|
-
}>()
|
|
38
|
-
|
|
39
|
-
const { $formattedDatetime, $store }: any = useNuxtApp()
|
|
40
|
-
const isNewView = computed<boolean>(() => $store.getters['main/getIsNewView'])
|
|
41
|
-
|
|
42
|
-
const localization = computed<UI_I_Localization>(() => useLocal())
|
|
43
|
-
|
|
44
|
-
const allData = ref<UI_I_GraphDataSettingItem[]>([])
|
|
45
|
-
|
|
46
|
-
const chartsLocal = ref<any>([])
|
|
47
|
-
|
|
48
|
-
const getCurrentChart = (chart: any): void => {
|
|
49
|
-
chartsLocal.value = chart
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
const instanceOfSeriesLine = (
|
|
53
|
-
object: I_SeriesLine | I_SeriesColumn
|
|
54
|
-
): object is I_SeriesLine => {
|
|
55
|
-
return 'lines' in object
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
const getCurrentData = (
|
|
59
|
-
chart: UI_I_GraphDataSettingItem,
|
|
60
|
-
chartType: string
|
|
61
|
-
): I_LineGraph | I_ColumnGraph | null => {
|
|
62
|
-
if (!chart || !chart.data) return null
|
|
63
|
-
|
|
64
|
-
const themeMode = useLocalStorage('themeMode') || props.themeMode
|
|
65
|
-
const isDarkMode = themeMode === 'dark-theme'
|
|
66
|
-
|
|
67
|
-
let graphData = null
|
|
68
|
-
|
|
69
|
-
if (chartType === 'column' && !instanceOfSeriesLine(chart.data)) {
|
|
70
|
-
graphData = columnGraphDataFunc({
|
|
71
|
-
chart,
|
|
72
|
-
isDarkMode,
|
|
73
|
-
localization: localization.value,
|
|
74
|
-
})
|
|
75
|
-
} else if (instanceOfSeriesLine(chart.data)) {
|
|
76
|
-
graphData = graphDataFunc({
|
|
77
|
-
graphData: chart.data,
|
|
78
|
-
isDarkMode: isDarkMode,
|
|
79
|
-
localization: localization.value,
|
|
80
|
-
fullScreenCallBack: () => {},
|
|
81
|
-
disabledTitle: false,
|
|
82
|
-
disabledExportButton: true,
|
|
83
|
-
disabledLegends: true,
|
|
84
|
-
graphType: props.graphType,
|
|
85
|
-
width: 700,
|
|
86
|
-
chartCallBack: getCurrentChart,
|
|
87
|
-
formattedDatetime: $formattedDatetime,
|
|
88
|
-
format: format,
|
|
89
|
-
formatDate: props.formatDate,
|
|
90
|
-
timeFormat: props.formatTime,
|
|
91
|
-
})
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
return graphData
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
const updateHelper = ref<number>(0)
|
|
98
|
-
|
|
99
|
-
const updateGraph = (charts: Array<UI_I_GraphDataSettingItem | null>): void => {
|
|
100
|
-
allData.value = []
|
|
101
|
-
charts.forEach((chart) => {
|
|
102
|
-
if (chart && chart.data) {
|
|
103
|
-
const constructedData = getCurrentData(chart, chart.chartType)
|
|
104
|
-
if (constructedData)
|
|
105
|
-
allData.value.push({
|
|
106
|
-
title: chart.title,
|
|
107
|
-
loader: chart.loader,
|
|
108
|
-
data: constructedData,
|
|
109
|
-
chartType: 'column',
|
|
110
|
-
})
|
|
111
|
-
} else {
|
|
112
|
-
allData.value.push({
|
|
113
|
-
title: '',
|
|
114
|
-
loader: chart.loader,
|
|
115
|
-
data: null,
|
|
116
|
-
chartType: 'column',
|
|
117
|
-
})
|
|
118
|
-
}
|
|
119
|
-
})
|
|
120
|
-
updateHelper.value++
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
watch(
|
|
124
|
-
() => props.charts,
|
|
125
|
-
(newValue) => {
|
|
126
|
-
updateGraph(newValue)
|
|
127
|
-
},
|
|
128
|
-
{ deep: true, immediate: true }
|
|
129
|
-
)
|
|
130
|
-
</script>
|
|
131
|
-
|
|
132
|
-
<style>
|
|
133
|
-
:root {
|
|
134
|
-
--loader-bg-color: #ffffff;
|
|
135
|
-
}
|
|
136
|
-
:root.dark-theme {
|
|
137
|
-
--loader-bg-color: #22343c;
|
|
138
|
-
}
|
|
139
|
-
</style>
|
|
140
|
-
|
|
141
|
-
<style scoped lang="scss">
|
|
142
|
-
.charts-view {
|
|
143
|
-
position: relative;
|
|
144
|
-
display: flex;
|
|
145
|
-
flex-direction: row;
|
|
146
|
-
flex-wrap: wrap;
|
|
147
|
-
justify-content: space-between;
|
|
148
|
-
overflow: auto;
|
|
149
|
-
height: 100%;
|
|
150
|
-
|
|
151
|
-
.graphic-loader-block {
|
|
152
|
-
background-color: var(--loader-bg-color);
|
|
153
|
-
height: 100%;
|
|
154
|
-
display: flex;
|
|
155
|
-
flex-direction: column;
|
|
156
|
-
align-items: center;
|
|
157
|
-
justify-content: center;
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
.graph-empty-block {
|
|
161
|
-
display: flex;
|
|
162
|
-
flex-direction: column;
|
|
163
|
-
height: 100%;
|
|
164
|
-
background-color: var(--loader-bg-color);
|
|
165
|
-
|
|
166
|
-
.title {
|
|
167
|
-
text-align: center;
|
|
168
|
-
font-size: 18px;
|
|
169
|
-
margin-top: 10px;
|
|
170
|
-
color: var(--global-font-color);
|
|
171
|
-
}
|
|
172
|
-
|
|
173
|
-
.body-block {
|
|
174
|
-
height: 100%;
|
|
175
|
-
display: flex;
|
|
176
|
-
justify-content: center;
|
|
177
|
-
text-align: center;
|
|
178
|
-
align-items: center;
|
|
179
|
-
color: var(--global-font-color);
|
|
180
|
-
}
|
|
181
|
-
}
|
|
182
|
-
|
|
183
|
-
.chart-container {
|
|
184
|
-
box-sizing: border-box;
|
|
185
|
-
flex-grow: 1;
|
|
186
|
-
padding: 5px;
|
|
187
|
-
min-height: 300px;
|
|
188
|
-
height: 100%;
|
|
189
|
-
min-width: 300px;
|
|
190
|
-
width: 100%;
|
|
191
|
-
position: relative;
|
|
192
|
-
|
|
193
|
-
&:first-child:last-child {
|
|
194
|
-
height: 100%;
|
|
195
|
-
width: 100%;
|
|
196
|
-
}
|
|
197
|
-
|
|
198
|
-
&:first-child:nth-last-child(2),
|
|
199
|
-
&:nth-child(2):last-child {
|
|
200
|
-
width: 50%;
|
|
201
|
-
height: 100%;
|
|
202
|
-
}
|
|
203
|
-
}
|
|
204
|
-
|
|
205
|
-
.content-global-loading {
|
|
206
|
-
width: 100%;
|
|
207
|
-
height: 100%;
|
|
208
|
-
display: flex;
|
|
209
|
-
align-items: center;
|
|
210
|
-
justify-content: center;
|
|
211
|
-
color: var(--global-font-color);
|
|
212
|
-
}
|
|
213
|
-
}
|
|
214
|
-
@media (min-width: 1280px) {
|
|
215
|
-
.charts-view .chart-container {
|
|
216
|
-
width: 50%;
|
|
217
|
-
}
|
|
218
|
-
}
|
|
219
|
-
@media (min-height: 800px) {
|
|
220
|
-
.charts-view .chart-container {
|
|
221
|
-
height: 50%;
|
|
222
|
-
}
|
|
223
|
-
}
|
|
224
|
-
</style>
|
|
1
|
+
<template>
|
|
2
|
+
<common-monitor-overview-new
|
|
3
|
+
v-if="isNewView"
|
|
4
|
+
:charts="chartsLocal"
|
|
5
|
+
:all-data="allData"
|
|
6
|
+
:update-helper="updateHelper"
|
|
7
|
+
/>
|
|
8
|
+
<common-monitor-overview-old
|
|
9
|
+
v-else
|
|
10
|
+
:charts="chartsLocal"
|
|
11
|
+
:all-data="allData"
|
|
12
|
+
:update-helper="updateHelper"
|
|
13
|
+
/>
|
|
14
|
+
</template>
|
|
15
|
+
|
|
16
|
+
<script setup lang="ts">
|
|
17
|
+
import { format } from 'date-fns'
|
|
18
|
+
import type {
|
|
19
|
+
I_SeriesColumn,
|
|
20
|
+
I_SeriesLine,
|
|
21
|
+
I_ColumnGraph,
|
|
22
|
+
I_LineGraph,
|
|
23
|
+
} from '~/node_modules/bfg-nuxt-3-graph/graph/lib/models/interfaces'
|
|
24
|
+
import {
|
|
25
|
+
columnGraphDataFunc,
|
|
26
|
+
graphDataFunc,
|
|
27
|
+
} from '~/node_modules/bfg-nuxt-3-graph/graph/lib/utils/renderGraph'
|
|
28
|
+
import type { UI_I_Localization } from '~/lib/models/interfaces'
|
|
29
|
+
import type { UI_I_GraphDataSettingItem } from '~/components/common/monitor/lib/models/interfaces'
|
|
30
|
+
|
|
31
|
+
const props = defineProps<{
|
|
32
|
+
charts: UI_I_GraphDataSettingItem[]
|
|
33
|
+
themeMode?: string
|
|
34
|
+
formatDate?: string
|
|
35
|
+
formatTime?: string
|
|
36
|
+
graphType: string
|
|
37
|
+
}>()
|
|
38
|
+
|
|
39
|
+
const { $formattedDatetime, $store }: any = useNuxtApp()
|
|
40
|
+
const isNewView = computed<boolean>(() => $store.getters['main/getIsNewView'])
|
|
41
|
+
|
|
42
|
+
const localization = computed<UI_I_Localization>(() => useLocal())
|
|
43
|
+
|
|
44
|
+
const allData = ref<UI_I_GraphDataSettingItem[]>([])
|
|
45
|
+
|
|
46
|
+
const chartsLocal = ref<any>([])
|
|
47
|
+
|
|
48
|
+
const getCurrentChart = (chart: any): void => {
|
|
49
|
+
chartsLocal.value = chart
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
const instanceOfSeriesLine = (
|
|
53
|
+
object: I_SeriesLine | I_SeriesColumn
|
|
54
|
+
): object is I_SeriesLine => {
|
|
55
|
+
return 'lines' in object
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
const getCurrentData = (
|
|
59
|
+
chart: UI_I_GraphDataSettingItem,
|
|
60
|
+
chartType: string
|
|
61
|
+
): I_LineGraph | I_ColumnGraph | null => {
|
|
62
|
+
if (!chart || !chart.data) return null
|
|
63
|
+
|
|
64
|
+
const themeMode = useLocalStorage('themeMode') || props.themeMode
|
|
65
|
+
const isDarkMode = themeMode === 'dark-theme'
|
|
66
|
+
|
|
67
|
+
let graphData = null
|
|
68
|
+
|
|
69
|
+
if (chartType === 'column' && !instanceOfSeriesLine(chart.data)) {
|
|
70
|
+
graphData = columnGraphDataFunc({
|
|
71
|
+
chart,
|
|
72
|
+
isDarkMode,
|
|
73
|
+
localization: localization.value,
|
|
74
|
+
})
|
|
75
|
+
} else if (instanceOfSeriesLine(chart.data)) {
|
|
76
|
+
graphData = graphDataFunc({
|
|
77
|
+
graphData: chart.data,
|
|
78
|
+
isDarkMode: isDarkMode,
|
|
79
|
+
localization: localization.value,
|
|
80
|
+
fullScreenCallBack: () => {},
|
|
81
|
+
disabledTitle: false,
|
|
82
|
+
disabledExportButton: true,
|
|
83
|
+
disabledLegends: true,
|
|
84
|
+
graphType: props.graphType,
|
|
85
|
+
width: 700,
|
|
86
|
+
chartCallBack: getCurrentChart,
|
|
87
|
+
formattedDatetime: $formattedDatetime,
|
|
88
|
+
format: format,
|
|
89
|
+
formatDate: props.formatDate,
|
|
90
|
+
timeFormat: props.formatTime,
|
|
91
|
+
})
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
return graphData
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
const updateHelper = ref<number>(0)
|
|
98
|
+
|
|
99
|
+
const updateGraph = (charts: Array<UI_I_GraphDataSettingItem | null>): void => {
|
|
100
|
+
allData.value = []
|
|
101
|
+
charts.forEach((chart) => {
|
|
102
|
+
if (chart && chart.data) {
|
|
103
|
+
const constructedData = getCurrentData(chart, chart.chartType)
|
|
104
|
+
if (constructedData)
|
|
105
|
+
allData.value.push({
|
|
106
|
+
title: chart.title,
|
|
107
|
+
loader: chart.loader,
|
|
108
|
+
data: constructedData,
|
|
109
|
+
chartType: 'column',
|
|
110
|
+
})
|
|
111
|
+
} else {
|
|
112
|
+
allData.value.push({
|
|
113
|
+
title: '',
|
|
114
|
+
loader: chart.loader,
|
|
115
|
+
data: null,
|
|
116
|
+
chartType: 'column',
|
|
117
|
+
})
|
|
118
|
+
}
|
|
119
|
+
})
|
|
120
|
+
updateHelper.value++
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
watch(
|
|
124
|
+
() => props.charts,
|
|
125
|
+
(newValue) => {
|
|
126
|
+
updateGraph(newValue)
|
|
127
|
+
},
|
|
128
|
+
{ deep: true, immediate: true }
|
|
129
|
+
)
|
|
130
|
+
</script>
|
|
131
|
+
|
|
132
|
+
<style scoped lang="scss"></style>
|