bfg-common 1.5.200 → 1.5.201
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.
|
@@ -1,178 +1,145 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div ref="chartsView">
|
|
3
|
-
<common-monitor-advanced-graph-view-new
|
|
4
|
-
v-if="isNewView"
|
|
5
|
-
:loading="props.loading"
|
|
6
|
-
:is-loading="isLoading"
|
|
7
|
-
:chart-data="chartData"
|
|
8
|
-
:chart="chart"
|
|
9
|
-
:chart-helper="chartHelper"
|
|
10
|
-
:export-type="props.export"
|
|
11
|
-
:selected-row="props.selectedRow"
|
|
12
|
-
/>
|
|
13
|
-
<common-monitor-advanced-graph-view-old
|
|
14
|
-
v-else
|
|
15
|
-
:loading="props.loading"
|
|
16
|
-
:is-loading="isLoading"
|
|
17
|
-
:chart-data="chartData"
|
|
18
|
-
:chart="chart"
|
|
19
|
-
:chart-helper="chartHelper"
|
|
20
|
-
:export-type="props.export"
|
|
21
|
-
:selected-row="props.selectedRow"
|
|
22
|
-
/>
|
|
23
|
-
</div>
|
|
24
|
-
</template>
|
|
25
|
-
|
|
26
|
-
<script setup lang="ts">
|
|
27
|
-
import type {
|
|
28
|
-
I_LineGraph,
|
|
29
|
-
I_SeriesLine,
|
|
30
|
-
} from 'bfg-nuxt-3-graph/graph/lib/models/interfaces'
|
|
31
|
-
import { useDebounceFn, useElementSize } from '@vueuse/core'
|
|
32
|
-
import { graphDataFunc } from 'bfg-nuxt-3-graph/graph/lib/utils/renderGraph'
|
|
33
|
-
import { format } from 'date-fns'
|
|
34
|
-
import type { UI_I_Localization } from '~/lib/models/interfaces'
|
|
35
|
-
|
|
36
|
-
const props = defineProps<{
|
|
37
|
-
loading: boolean
|
|
38
|
-
data: I_SeriesLine | null
|
|
39
|
-
export: string
|
|
40
|
-
selectedRow: number[]
|
|
41
|
-
darkMode: boolean
|
|
42
|
-
language: string
|
|
43
|
-
selectedChartType: string
|
|
44
|
-
}>()
|
|
45
|
-
const emits = defineEmits<{
|
|
46
|
-
(event: 'open-advanced-page'): void
|
|
47
|
-
}>()
|
|
48
|
-
|
|
49
|
-
const { $store, $formattedDatetime, $getDateFormat }: any = useNuxtApp()
|
|
50
|
-
|
|
51
|
-
const localization = computed<UI_I_Localization>(() => useLocal())
|
|
52
|
-
|
|
53
|
-
const isNewView = computed<boolean>(() => $store.getters['main/getIsNewView'])
|
|
54
|
-
|
|
55
|
-
const isLoading = ref<boolean>(true)
|
|
56
|
-
|
|
57
|
-
const chartData = ref<I_LineGraph | null>(null)
|
|
58
|
-
|
|
59
|
-
const
|
|
60
|
-
const
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
newValue
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
)
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
)
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
)
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
)
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
{ immediate: true }
|
|
147
|
-
)
|
|
148
|
-
|
|
149
|
-
watch(width, (newValue) => {
|
|
150
|
-
if (newValue) startChart()
|
|
151
|
-
|
|
152
|
-
if (!chart.value?.isResizing) return
|
|
153
|
-
|
|
154
|
-
chart.value.setSize(1, chart.chartHeight)
|
|
155
|
-
|
|
156
|
-
if (isFullScreen.value) {
|
|
157
|
-
chart.value.setSize(window.innerWidth, chart.chartHeight)
|
|
158
|
-
return
|
|
159
|
-
}
|
|
160
|
-
|
|
161
|
-
setTimeout(() => {
|
|
162
|
-
chart.value.setSize(newValue, chart.chartHeight)
|
|
163
|
-
}, 1000)
|
|
164
|
-
})
|
|
165
|
-
|
|
166
|
-
const exportType = ref<string>('')
|
|
167
|
-
watch(
|
|
168
|
-
() => props.export,
|
|
169
|
-
(newValue) => {
|
|
170
|
-
if (!newValue) return
|
|
171
|
-
|
|
172
|
-
exportType.value = newValue
|
|
173
|
-
},
|
|
174
|
-
{ immediate: true }
|
|
175
|
-
)
|
|
176
|
-
</script>
|
|
177
|
-
|
|
178
|
-
<style scoped lang="scss"></style>
|
|
1
|
+
<template>
|
|
2
|
+
<div ref="chartsView">
|
|
3
|
+
<common-monitor-advanced-graph-view-new
|
|
4
|
+
v-if="isNewView"
|
|
5
|
+
:loading="props.loading"
|
|
6
|
+
:is-loading="isLoading"
|
|
7
|
+
:chart-data="chartData"
|
|
8
|
+
:chart="chart"
|
|
9
|
+
:chart-helper="chartHelper"
|
|
10
|
+
:export-type="props.export"
|
|
11
|
+
:selected-row="props.selectedRow"
|
|
12
|
+
/>
|
|
13
|
+
<common-monitor-advanced-graph-view-old
|
|
14
|
+
v-else
|
|
15
|
+
:loading="props.loading"
|
|
16
|
+
:is-loading="isLoading"
|
|
17
|
+
:chart-data="chartData"
|
|
18
|
+
:chart="chart"
|
|
19
|
+
:chart-helper="chartHelper"
|
|
20
|
+
:export-type="props.export"
|
|
21
|
+
:selected-row="props.selectedRow"
|
|
22
|
+
/>
|
|
23
|
+
</div>
|
|
24
|
+
</template>
|
|
25
|
+
|
|
26
|
+
<script setup lang="ts">
|
|
27
|
+
import type {
|
|
28
|
+
I_LineGraph,
|
|
29
|
+
I_SeriesLine,
|
|
30
|
+
} from 'bfg-nuxt-3-graph/graph/lib/models/interfaces'
|
|
31
|
+
import { useDebounceFn, useElementSize } from '@vueuse/core'
|
|
32
|
+
import { graphDataFunc } from 'bfg-nuxt-3-graph/graph/lib/utils/renderGraph'
|
|
33
|
+
import { format } from 'date-fns'
|
|
34
|
+
import type { UI_I_Localization } from '~/lib/models/interfaces'
|
|
35
|
+
|
|
36
|
+
const props = defineProps<{
|
|
37
|
+
loading: boolean
|
|
38
|
+
data: I_SeriesLine | null
|
|
39
|
+
export: string
|
|
40
|
+
selectedRow: number[]
|
|
41
|
+
darkMode: boolean
|
|
42
|
+
language: string
|
|
43
|
+
selectedChartType: string
|
|
44
|
+
}>()
|
|
45
|
+
const emits = defineEmits<{
|
|
46
|
+
(event: 'open-advanced-page'): void
|
|
47
|
+
}>()
|
|
48
|
+
|
|
49
|
+
const { $store, $formattedDatetime, $getDateFormat }: any = useNuxtApp()
|
|
50
|
+
|
|
51
|
+
const localization = computed<UI_I_Localization>(() => useLocal())
|
|
52
|
+
|
|
53
|
+
const isNewView = computed<boolean>(() => $store.getters['main/getIsNewView'])
|
|
54
|
+
|
|
55
|
+
const isLoading = ref<boolean>(true)
|
|
56
|
+
|
|
57
|
+
const chartData = ref<I_LineGraph | null>(null)
|
|
58
|
+
|
|
59
|
+
const chart = ref<any>(null)
|
|
60
|
+
const chartHelper = ref<number>(0)
|
|
61
|
+
|
|
62
|
+
const chartCallback = (newValue: any): void => {
|
|
63
|
+
newValue && (chart.value = newValue)
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
const newTabCallback = (newValue: boolean): void => {
|
|
67
|
+
newValue && emits('open-advanced-page')
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
watch(
|
|
71
|
+
chart,
|
|
72
|
+
(newValue) => {
|
|
73
|
+
isLoading.value = !newValue?.hasLoaded
|
|
74
|
+
},
|
|
75
|
+
{ immediate: true, deep: true }
|
|
76
|
+
)
|
|
77
|
+
|
|
78
|
+
let dateFormat = ''
|
|
79
|
+
|
|
80
|
+
const chartsView = ref(null)
|
|
81
|
+
const { width } = useElementSize(chartsView)
|
|
82
|
+
|
|
83
|
+
const startChart = useDebounceFn(() => {
|
|
84
|
+
if (!props.data || !width.value) return
|
|
85
|
+
|
|
86
|
+
chartData.value = graphDataFunc({
|
|
87
|
+
fullScreenCallBack: () => ({}),
|
|
88
|
+
format,
|
|
89
|
+
graphData: props.data,
|
|
90
|
+
isDarkMode: props.darkMode,
|
|
91
|
+
localization: localization.value,
|
|
92
|
+
disabledTitle: isNewView.value,
|
|
93
|
+
disabledExportButton: !isNewView.value,
|
|
94
|
+
disabledLegends: false,
|
|
95
|
+
graphType: props.selectedChartType,
|
|
96
|
+
width: Math.floor(width.value),
|
|
97
|
+
chartCallBack: chartCallback,
|
|
98
|
+
formattedDatetime: $formattedDatetime,
|
|
99
|
+
formatDate: dateFormat,
|
|
100
|
+
isNewView: isNewView.value,
|
|
101
|
+
isShowLinkNewWindow: true,
|
|
102
|
+
newTabCallBack: newTabCallback,
|
|
103
|
+
})
|
|
104
|
+
|
|
105
|
+
chartHelper.value++
|
|
106
|
+
}, 1000)
|
|
107
|
+
|
|
108
|
+
watch(
|
|
109
|
+
() => props.data,
|
|
110
|
+
(newValue) => {
|
|
111
|
+
if (!newValue) {
|
|
112
|
+
isLoading.value = true
|
|
113
|
+
return
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
startChart()
|
|
117
|
+
},
|
|
118
|
+
{ immediate: true }
|
|
119
|
+
)
|
|
120
|
+
|
|
121
|
+
watch(
|
|
122
|
+
() => props.darkMode,
|
|
123
|
+
() => {
|
|
124
|
+
startChart()
|
|
125
|
+
}
|
|
126
|
+
)
|
|
127
|
+
|
|
128
|
+
watch(
|
|
129
|
+
() => props.language,
|
|
130
|
+
() => {
|
|
131
|
+
dateFormat = $getDateFormat(props.language)
|
|
132
|
+
startChart()
|
|
133
|
+
}
|
|
134
|
+
)
|
|
135
|
+
|
|
136
|
+
watch(
|
|
137
|
+
() => props.selectedChartType,
|
|
138
|
+
() => {
|
|
139
|
+
startChart()
|
|
140
|
+
},
|
|
141
|
+
{ immediate: true }
|
|
142
|
+
)
|
|
143
|
+
</script>
|
|
144
|
+
|
|
145
|
+
<style scoped lang="scss"></style>
|
|
@@ -1,56 +1,56 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div class="advanced-graph-container">
|
|
3
|
-
<div v-if="props.isLoading" class="graphic-loader-block">
|
|
4
|
-
<div class="spinner"></div>
|
|
5
|
-
<p>{{ localization.inventoryMonitor.retrievingData }}...</p>
|
|
6
|
-
</div>
|
|
7
|
-
<template v-if="!props.loading && props.chartData">
|
|
8
|
-
<common-graph
|
|
9
|
-
:chart="props.chart"
|
|
10
|
-
:data="props.chartData"
|
|
11
|
-
:update="props.chartHelper"
|
|
12
|
-
:export-type="props.exportType"
|
|
13
|
-
:selected-row="props.selectedRow"
|
|
14
|
-
/>
|
|
15
|
-
</template>
|
|
16
|
-
</div>
|
|
17
|
-
</template>
|
|
18
|
-
|
|
19
|
-
<script setup lang="ts">
|
|
20
|
-
import type { I_LineGraph } from '~/node_modules/bfg-nuxt-3-graph/graph/lib/models/interfaces'
|
|
21
|
-
import type { UI_I_Localization } from '~/lib/models/interfaces'
|
|
22
|
-
|
|
23
|
-
const localization = computed<UI_I_Localization>(() => useLocal())
|
|
24
|
-
|
|
25
|
-
const props = defineProps<{
|
|
26
|
-
loading: boolean
|
|
27
|
-
isLoading: boolean
|
|
28
|
-
chartData: I_LineGraph | null
|
|
29
|
-
chart: any
|
|
30
|
-
chartHelper: number
|
|
31
|
-
exportType: string
|
|
32
|
-
selectedRow: number[]
|
|
33
|
-
}>()
|
|
34
|
-
</script>
|
|
35
|
-
|
|
36
|
-
<style scoped lang="scss">
|
|
37
|
-
.advanced-graph-container {
|
|
38
|
-
position: relative;
|
|
39
|
-
min-height: 400px;
|
|
40
|
-
|
|
41
|
-
.graphic-loader-block {
|
|
42
|
-
background-color: var(--loader-bg-color);
|
|
43
|
-
height: 100%;
|
|
44
|
-
display: flex;
|
|
45
|
-
flex-direction: column;
|
|
46
|
-
align-items: center;
|
|
47
|
-
justify-content: center;
|
|
48
|
-
position: absolute;
|
|
49
|
-
top: 0;
|
|
50
|
-
left: 0;
|
|
51
|
-
right: 0;
|
|
52
|
-
bottom: 0;
|
|
53
|
-
z-index: var(--z-fixed);
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
</style>
|
|
1
|
+
<template>
|
|
2
|
+
<div class="advanced-graph-container">
|
|
3
|
+
<div v-if="props.isLoading" class="graphic-loader-block">
|
|
4
|
+
<div class="spinner"></div>
|
|
5
|
+
<p>{{ localization.inventoryMonitor.retrievingData }}...</p>
|
|
6
|
+
</div>
|
|
7
|
+
<template v-if="!props.loading && props.chartData">
|
|
8
|
+
<common-graph
|
|
9
|
+
:chart="props.chart"
|
|
10
|
+
:data="props.chartData"
|
|
11
|
+
:update="props.chartHelper"
|
|
12
|
+
:export-type="props.exportType"
|
|
13
|
+
:selected-row="props.selectedRow"
|
|
14
|
+
/>
|
|
15
|
+
</template>
|
|
16
|
+
</div>
|
|
17
|
+
</template>
|
|
18
|
+
|
|
19
|
+
<script setup lang="ts">
|
|
20
|
+
import type { I_LineGraph } from '~/node_modules/bfg-nuxt-3-graph/graph/lib/models/interfaces'
|
|
21
|
+
import type { UI_I_Localization } from '~/lib/models/interfaces'
|
|
22
|
+
|
|
23
|
+
const localization = computed<UI_I_Localization>(() => useLocal())
|
|
24
|
+
|
|
25
|
+
const props = defineProps<{
|
|
26
|
+
loading: boolean
|
|
27
|
+
isLoading: boolean
|
|
28
|
+
chartData: I_LineGraph | null
|
|
29
|
+
chart: any
|
|
30
|
+
chartHelper: number
|
|
31
|
+
exportType: string
|
|
32
|
+
selectedRow: number[]
|
|
33
|
+
}>()
|
|
34
|
+
</script>
|
|
35
|
+
|
|
36
|
+
<style scoped lang="scss">
|
|
37
|
+
.advanced-graph-container {
|
|
38
|
+
position: relative;
|
|
39
|
+
min-height: 400px;
|
|
40
|
+
|
|
41
|
+
.graphic-loader-block {
|
|
42
|
+
background-color: var(--loader-bg-color);
|
|
43
|
+
height: 100%;
|
|
44
|
+
display: flex;
|
|
45
|
+
flex-direction: column;
|
|
46
|
+
align-items: center;
|
|
47
|
+
justify-content: center;
|
|
48
|
+
position: absolute;
|
|
49
|
+
top: 0;
|
|
50
|
+
left: 0;
|
|
51
|
+
right: 0;
|
|
52
|
+
bottom: 0;
|
|
53
|
+
z-index: var(--z-fixed);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
</style>
|