bfg-common 1.4.861 → 1.4.862

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.
Files changed (56) hide show
  1. package/.idea/inspectionProfiles/Project_Default.xml +2 -1
  2. package/assets/localization/local_be.json +3012 -3009
  3. package/assets/localization/local_en.json +5 -2
  4. package/assets/localization/local_hy.json +5 -2
  5. package/assets/localization/local_kk.json +5 -2
  6. package/assets/localization/local_ru.json +5 -2
  7. package/assets/localization/local_zh.json +5 -2
  8. package/components/common/chartOptionsModal/counters/timespan/form/Form.vue +40 -313
  9. package/components/common/chartOptionsModal/counters/timespan/form/FormNew.vue +241 -0
  10. package/components/common/chartOptionsModal/counters/timespan/form/FormOld.vue +372 -0
  11. package/components/common/graph/GraphOld.vue +50 -31
  12. package/components/common/monitor/advanced/Advanced.vue +0 -3
  13. package/components/common/monitor/advanced/AdvancedNew.vue +0 -2
  14. package/components/common/monitor/advanced/AdvancedOld.vue +0 -2
  15. package/components/common/monitor/advanced/graphView/GraphView.vue +16 -18
  16. package/components/common/monitor/advanced/tools/Tools.vue +0 -3
  17. package/components/common/monitor/advanced/tools/ToolsNew.vue +0 -2
  18. package/components/common/monitor/advanced/tools/ToolsOld.vue +0 -2
  19. package/components/common/monitor/advanced/tools/chartOptionsModal/ChartOptionsModal.vue +113 -114
  20. package/components/common/monitor/advanced/tools/chartOptionsModal/ChartOptionsModalNew.vue +190 -0
  21. package/components/common/monitor/advanced/tools/chartOptionsModal/ChartOptionsModalOld.vue +189 -0
  22. package/components/common/monitor/advanced/tools/chartOptionsModal/Notification.vue +13 -20
  23. package/components/common/monitor/advanced/tools/chartOptionsModal/NotificationNew.vue +20 -0
  24. package/components/common/monitor/advanced/tools/chartOptionsModal/NotificationOld.vue +27 -0
  25. package/components/common/monitor/advanced/tools/chartOptionsModal/actions/Actions.vue +28 -79
  26. package/components/common/monitor/advanced/tools/chartOptionsModal/actions/ActionsNew.vue +160 -0
  27. package/components/common/monitor/advanced/tools/chartOptionsModal/actions/ActionsOld.vue +114 -0
  28. package/components/common/monitor/advanced/tools/chartOptionsModal/counters/Counters.vue +75 -56
  29. package/components/common/monitor/advanced/tools/chartOptionsModal/counters/CountersNew.vue +97 -0
  30. package/components/common/monitor/advanced/tools/chartOptionsModal/counters/CountersOld.vue +110 -0
  31. package/components/common/monitor/advanced/tools/chartOptionsModal/counters/table/Table.vue +19 -58
  32. package/components/common/monitor/advanced/tools/chartOptionsModal/counters/table/tableNew/TableNew.vue +46 -0
  33. package/components/common/monitor/advanced/tools/chartOptionsModal/counters/table/tableNew/config/options.ts +19 -0
  34. package/components/common/monitor/advanced/tools/chartOptionsModal/counters/table/tableNew/config/tableData.ts +71 -0
  35. package/components/common/monitor/advanced/tools/chartOptionsModal/counters/table/tableNew/utils/constructTable.ts +29 -0
  36. package/components/common/monitor/advanced/tools/chartOptionsModal/counters/table/tableOld/TableOld.vue +85 -0
  37. package/components/common/monitor/advanced/tools/chartOptionsModal/counters/table/{lib → tableOld/lib}/config/tableConfig.ts +1 -1
  38. package/components/common/monitor/advanced/tools/chartOptionsModal/counters/timespan/Timespan.vue +71 -47
  39. package/components/common/monitor/advanced/tools/chartOptionsModal/counters/timespan/TimespanNew.vue +150 -0
  40. package/components/common/monitor/advanced/tools/chartOptionsModal/counters/timespan/TimespanOld.vue +95 -0
  41. package/components/common/monitor/advanced/tools/chartOptionsModal/counters/timespan/object/Object.vue +21 -26
  42. package/components/common/monitor/advanced/tools/chartOptionsModal/counters/timespan/object/objectNew/ObjectNew.vue +56 -0
  43. package/components/common/monitor/advanced/tools/chartOptionsModal/counters/timespan/object/objectNew/lib/config/options.ts +25 -0
  44. package/components/common/monitor/advanced/tools/chartOptionsModal/counters/timespan/object/objectNew/lib/config/tableData.ts +47 -0
  45. package/components/common/monitor/advanced/tools/chartOptionsModal/counters/timespan/object/objectNew/lib/utils/constructTable.ts +22 -0
  46. package/components/common/monitor/advanced/tools/chartOptionsModal/counters/timespan/object/objectOld/ObjectOld.vue +84 -0
  47. package/components/common/monitor/advanced/tools/chartOptionsModal/metrics/Metrics.vue +17 -29
  48. package/components/common/monitor/advanced/tools/chartOptionsModal/metrics/MetricsOld.vue +32 -0
  49. package/components/common/monitor/advanced/tools/chartOptionsModal/metrics/metricsNew/MetricsNew.vue +101 -0
  50. package/components/common/monitor/advanced/tools/chartOptionsModal/metrics/metricsNew/lib/utils/constructAccordion.ts +32 -0
  51. package/components/common/monitor/overview/Overview.vue +224 -221
  52. package/components/common/monitor/overview/filters/customIntervalModal/CustomIntervalModalNew.vue +186 -181
  53. package/components/common/pages/hardwareHealth/historyTestimony/Graph.vue +26 -30
  54. package/lib/utils/date.ts +12 -0
  55. package/package.json +2 -2
  56. /package/components/common/monitor/advanced/tools/chartOptionsModal/counters/table/{lib → tableOld/lib}/models/types.ts +0 -0
@@ -1,181 +1,186 @@
1
- <template>
2
- <ui-modal
3
- show
4
- :title="titleLocal"
5
- :subtitle="props.selectedItemName"
6
- :texts="modalTexts"
7
- test-id="overview-custom-interval-modal"
8
- @hide="onHide"
9
- @submit="onSubmit"
10
- >
11
- <template #content>
12
- <div class="time-range">
13
- <ui-alert
14
- v-show="alertShow"
15
- status="alert-danger"
16
- :messages="props.alertItems"
17
- class="overview-alert"
18
- test-id="overview-alert"
19
- @remove="alertShow = false"
20
- />
21
-
22
- <p class="date-time-format-description">
23
- {{ localization.inventoryMonitor.dateTimeIsoFormat }}
24
- </p>
25
-
26
- <div class="filed-wrap from">
27
- <lable for="date-from" class="filed-lable">{{
28
- localization.common.from
29
- }}</lable>
30
- <ui-input-with-datepicker
31
- id="date-from"
32
- v-model="currentDateFromLocal"
33
- test-id="date-from"
34
- format="mm-dd-yyyy"
35
- time-format="12"
36
- />
37
- </div>
38
-
39
- <div class="filed-wrap">
40
- <lable for="date-to" class="filed-lable">{{
41
- localization.common.to
42
- }}</lable>
43
- <ui-input-with-datepicker
44
- id="date-to"
45
- v-model="currentDateToLocal"
46
- test-id="date-to"
47
- format="mm-dd-yyyy"
48
- time-format="12"
49
- />
50
- </div>
51
- </div>
52
- </template>
53
-
54
- <template #footerLeftContent><span></span></template>
55
- </ui-modal>
56
- </template>
57
-
58
- <script setup lang="ts">
59
- import type { UI_I_Localization } from '~/lib/models/interfaces'
60
- import type { UI_I_ModalTexts } from 'bfg-uikit/components/ui/modal/models/interfaces'
61
-
62
- const alertShow = defineModel<boolean>('alert-show')
63
- const currentDateFrom = defineModel<string>('current-date-from')
64
- // const dateFrom = defineModel<string>('date-from')
65
- const currentTimeFrom = defineModel<string>('current-time-from')
66
- const currentDateTo = defineModel<string>('current-date-to')
67
- // const dateTo = defineModel<string>('date-to')
68
- const currentTimeTo = defineModel<string>('current-time-to')
69
-
70
- const props = defineProps<{
71
- titleIntervalModal: string
72
- selectedItemName: string
73
- currentLang: string
74
- alertItems: any[]
75
- formatDate: string
76
- }>()
77
-
78
- const emits = defineEmits<{
79
- (event: 'hide'): void
80
- (event: 'submit'): void
81
- (event: 'update-date-from', value: any): void
82
- (event: 'update-date-to', value: any): void
83
- }>()
84
-
85
- const { $isDate, $getUnixByDate, $formattedDate, $formattedTime } = useNuxtApp()
86
-
87
- const localization = computed<UI_I_Localization>(() => useLocal())
88
-
89
- const titleLocal = computed<string>(() =>
90
- props.titleIntervalModal.replace(':', '')
91
- )
92
- const modalTexts = computed<UI_I_ModalTexts>(() => ({
93
- button1: localization.value.common.cancel,
94
- button2: localization.value.common.save,
95
- }))
96
-
97
- const currentDateFromLocal = computed<number>({
98
- get() {
99
- // console.log(currentDateFrom.value, 11111, currentTimeFrom.value)
100
- // TODO fix PM
101
- return $isDate(currentDateFrom.value)
102
- ? $getUnixByDate(currentDateFrom.value + ' ' + currentTimeFrom.value)
103
- : 0
104
- },
105
- set(newValue) {
106
- // console.log($formattedDate(new Date(newValue), props.formatDate), 22222)
107
- // console.log($formattedTime(newValue, '', true), 33333)
108
- currentDateFrom.value = $formattedDate(new Date(newValue), props.formatDate)
109
- currentTimeFrom.value = $formattedTime(newValue, '', true)
110
- },
111
- })
112
- const currentDateToLocal = computed<number>({
113
- get() {
114
- // TODO fix PM
115
- return $isDate(currentDateTo.value)
116
- ? $getUnixByDate(currentDateTo.value + ' ' + currentTimeTo.value)
117
- : 0
118
- },
119
- set(newValue) {
120
- currentDateTo.value = $formattedDate(new Date(newValue), props.formatDate)
121
- currentTimeTo.value = $formattedTime(newValue, '', true)
122
- },
123
- })
124
-
125
- // const onUpdateDateFrom = (event: any): void => {
126
- // emits('update-date-from', event)
127
- // }
128
- // const onUpdateDateTo = (event: any): void => {
129
- // emits('update-date-to', event)
130
- // }
131
-
132
- const onSubmit = (): void => {
133
- emits('submit')
134
- }
135
- const onHide = (): void => {
136
- emits('hide')
137
- }
138
- </script>
139
-
140
- <style>
141
- :root {
142
- --overview-time-range-lable-color: #4d5d69;
143
- --overview-time-range-border-color: #e9ebed;
144
- }
145
- :root.dark-theme {
146
- --overview-time-range-lable-color: #e9eaec;
147
- --overview-time-range-border-color: #e9ebed1f;
148
- }
149
- </style>
150
- <style scoped lang="scss">
151
- .time-range {
152
- padding: 0 32px;
153
-
154
- .overview-alert {
155
- margin-bottom: 16px;
156
- }
157
-
158
- .date-time-format-description {
159
- font-size: 12px;
160
- color: #9da6ad;
161
- padding-bottom: 12px;
162
- border-bottom: 1px solid var(--overview-time-range-border-color);
163
- }
164
-
165
- .filed-wrap {
166
- margin-bottom: 16px;
167
-
168
- &.from {
169
- margin-bottom: 24px;
170
- }
171
- .filed-lable {
172
- display: block;
173
- font-size: 16px;
174
- font-weight: 500;
175
- color: var(--overview-time-range-lable-color);
176
- margin: 16px 0;
177
- text-transform: capitalize;
178
- }
179
- }
180
- }
181
- </style>
1
+ <template>
2
+ <ui-modal
3
+ show
4
+ :title="titleLocal"
5
+ :subtitle="props.selectedItemName"
6
+ :texts="modalTexts"
7
+ test-id="overview-custom-interval-modal"
8
+ @hide="onHide"
9
+ @submit="onSubmit"
10
+ >
11
+ <template #content>
12
+ <div class="time-range">
13
+ <ui-alert
14
+ v-show="alertShow"
15
+ status="alert-danger"
16
+ :messages="props.alertItems"
17
+ class="overview-alert"
18
+ test-id="overview-alert"
19
+ @remove="alertShow = false"
20
+ />
21
+
22
+ <p class="date-time-format-description">
23
+ {{ localization.inventoryMonitor.dateTimeIsoFormat }}
24
+ </p>
25
+
26
+ <div class="filed-wrap from">
27
+ <lable for="date-from" class="filed-lable">{{
28
+ localization.common.from
29
+ }}</lable>
30
+ <ui-input-with-datepicker
31
+ id="date-from"
32
+ v-model="currentDateFromLocal"
33
+ :format="datepickerFormat"
34
+ test-id="date-from"
35
+ time-format="12"
36
+ />
37
+ </div>
38
+
39
+ <div class="filed-wrap">
40
+ <lable for="date-to" class="filed-lable">{{
41
+ localization.common.to
42
+ }}</lable>
43
+ <ui-input-with-datepicker
44
+ id="date-to"
45
+ v-model="currentDateToLocal"
46
+ :format="datepickerFormat"
47
+ test-id="date-to"
48
+ time-format="12"
49
+ />
50
+ </div>
51
+ </div>
52
+ </template>
53
+
54
+ <template #footerLeftContent><span></span></template>
55
+ </ui-modal>
56
+ </template>
57
+
58
+ <script setup lang="ts">
59
+ import type { UI_I_ModalTexts } from 'bfg-uikit/components/ui/modal/models/interfaces'
60
+ import type { UI_I_Localization } from '~/lib/models/interfaces'
61
+ import { getUiDatepickerFormatByLanguage } from '~/lib/utils/date'
62
+
63
+ const alertShow = defineModel<boolean>('alert-show')
64
+ const currentDateFrom = defineModel<string>('current-date-from')
65
+ // const dateFrom = defineModel<string>('date-from')
66
+ const currentTimeFrom = defineModel<string>('current-time-from')
67
+ const currentDateTo = defineModel<string>('current-date-to')
68
+ // const dateTo = defineModel<string>('date-to')
69
+ const currentTimeTo = defineModel<string>('current-time-to')
70
+
71
+ const props = defineProps<{
72
+ titleIntervalModal: string
73
+ selectedItemName: string
74
+ currentLang: string
75
+ alertItems: any[]
76
+ formatDate: string
77
+ }>()
78
+
79
+ const emits = defineEmits<{
80
+ (event: 'hide'): void
81
+ (event: 'submit'): void
82
+ (event: 'update-date-from', value: any): void
83
+ (event: 'update-date-to', value: any): void
84
+ }>()
85
+
86
+ const { $isDate, $getUnixByDate, $formattedDate, $formattedTime } = useNuxtApp()
87
+
88
+ const localization = computed<UI_I_Localization>(() => useLocal())
89
+
90
+ const datepickerFormat = computed<string>(() =>
91
+ getUiDatepickerFormatByLanguage(props.currentLang)
92
+ )
93
+
94
+ const titleLocal = computed<string>(() =>
95
+ props.titleIntervalModal.replace(':', '')
96
+ )
97
+ const modalTexts = computed<UI_I_ModalTexts>(() => ({
98
+ button1: localization.value.common.cancel,
99
+ button2: localization.value.common.save,
100
+ }))
101
+
102
+ const currentDateFromLocal = computed<number>({
103
+ get() {
104
+ // console.log(currentDateFrom.value, 11111, currentTimeFrom.value)
105
+ // TODO fix PM
106
+ return $isDate(currentDateFrom.value)
107
+ ? $getUnixByDate(currentDateFrom.value + ' ' + currentTimeFrom.value)
108
+ : 0
109
+ },
110
+ set(newValue) {
111
+ // console.log($formattedDate(new Date(newValue), props.formatDate), 22222)
112
+ // console.log($formattedTime(newValue, '', true), 33333)
113
+ currentDateFrom.value = $formattedDate(new Date(newValue), props.formatDate)
114
+ currentTimeFrom.value = $formattedTime(newValue, '', true)
115
+ },
116
+ })
117
+ const currentDateToLocal = computed<number>({
118
+ get() {
119
+ // TODO fix PM
120
+ return $isDate(currentDateTo.value)
121
+ ? $getUnixByDate(currentDateTo.value + ' ' + currentTimeTo.value)
122
+ : 0
123
+ },
124
+ set(newValue) {
125
+ currentDateTo.value = $formattedDate(new Date(newValue), props.formatDate)
126
+ currentTimeTo.value = $formattedTime(newValue, '', true)
127
+ },
128
+ })
129
+
130
+ // const onUpdateDateFrom = (event: any): void => {
131
+ // emits('update-date-from', event)
132
+ // }
133
+ // const onUpdateDateTo = (event: any): void => {
134
+ // emits('update-date-to', event)
135
+ // }
136
+
137
+ const onSubmit = (): void => {
138
+ emits('submit')
139
+ }
140
+ const onHide = (): void => {
141
+ emits('hide')
142
+ }
143
+ </script>
144
+
145
+ <style>
146
+ :root {
147
+ --overview-time-range-lable-color: #4d5d69;
148
+ --overview-time-range-border-color: #e9ebed;
149
+ }
150
+ :root.dark-theme {
151
+ --overview-time-range-lable-color: #e9eaec;
152
+ --overview-time-range-border-color: #e9ebed1f;
153
+ }
154
+ </style>
155
+ <style scoped lang="scss">
156
+ .time-range {
157
+ padding: 0 32px;
158
+
159
+ .overview-alert {
160
+ margin-bottom: 16px;
161
+ }
162
+
163
+ .date-time-format-description {
164
+ font-size: 12px;
165
+ color: #9da6ad;
166
+ padding-bottom: 12px;
167
+ border-bottom: 1px solid var(--overview-time-range-border-color);
168
+ }
169
+
170
+ .filed-wrap {
171
+ margin-bottom: 16px;
172
+
173
+ &.from {
174
+ margin-bottom: 24px;
175
+ }
176
+ .filed-lable {
177
+ display: block;
178
+ font-size: 16px;
179
+ font-weight: 500;
180
+ color: var(--overview-time-range-lable-color);
181
+ margin: 16px 0;
182
+ text-transform: capitalize;
183
+ }
184
+ }
185
+ }
186
+ </style>
@@ -283,22 +283,20 @@ const temperatureChartCallback = (newValue: any): void => {
283
283
  const updatePowerChart = (): void => {
284
284
  if (!props.powerData) return
285
285
 
286
- powerDataLocal.value = graphDataFunc(
287
- props.powerData,
288
- props.isDarkMode,
289
- localization.value,
290
- () => {},
291
- false,
292
- false,
293
- true,
294
- 'spline',
295
- '',
296
- undefined,
297
- powerChartCallback,
298
- props.formattedDatetime,
286
+ powerDataLocal.value = graphDataFunc({
299
287
  format,
300
- dateFormat
301
- )
288
+ graphData: props.powerData,
289
+ isDarkMode: props.isDarkMode,
290
+ localization: localization.value,
291
+ fullScreenCallBack: () => {},
292
+ disabledTitle: false,
293
+ disabledExportButton: false,
294
+ disabledLegends: true,
295
+ graphType: 'spline',
296
+ chartCallBack: powerChartCallback,
297
+ formattedDatetime: props.formattedDatetime,
298
+ formatDate: dateFormat,
299
+ })
302
300
 
303
301
  updatePowerHelper.value++
304
302
  }
@@ -306,22 +304,20 @@ const updatePowerChart = (): void => {
306
304
  const updateTemperatureChart = (): void => {
307
305
  if (!props.temperatureData) return
308
306
 
309
- temperatureDataLocal.value = graphDataFunc(
310
- props.temperatureData,
311
- props.isDarkMode,
312
- localization.value,
313
- () => {},
314
- false,
315
- false,
316
- true,
317
- 'spline',
318
- '',
319
- undefined,
320
- temperatureChartCallback,
321
- props.formattedDatetime,
307
+ temperatureDataLocal.value = graphDataFunc({
322
308
  format,
323
- dateFormat
324
- )
309
+ graphData: props.temperatureData,
310
+ isDarkMode: props.isDarkMode,
311
+ localization: localization.value,
312
+ fullScreenCallBack: () => {},
313
+ disabledTitle: false,
314
+ disabledExportButton: false,
315
+ disabledLegends: true,
316
+ graphType: 'spline',
317
+ chartCallBack: temperatureChartCallback,
318
+ formattedDatetime: props.formattedDatetime,
319
+ formatDate: dateFormat,
320
+ })
325
321
 
326
322
  updateTemperatureHelper.value++
327
323
  }
@@ -0,0 +1,12 @@
1
+ export const getUiDatepickerFormatByLanguage = (language: string): string => {
2
+ let result = 'mm-dd-yyyy'
3
+ switch (language) {
4
+ case 'en_US':
5
+ result = 'mm-dd-yyyy'
6
+ break
7
+ case 'ru_RU':
8
+ result = 'dd.mm.yyyy'
9
+ break
10
+ }
11
+ return result
12
+ }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "bfg-common",
3
3
  "private": false,
4
- "version": "1.4.861",
4
+ "version": "1.4.862",
5
5
  "scripts": {
6
6
  "build": "nuxt build",
7
7
  "dev": "nuxt dev --port=3002",
@@ -34,7 +34,7 @@
34
34
  "@nuxtjs/eslint-config-typescript": "^12.0.0",
35
35
  "@vueuse/components": "^10.1.2",
36
36
  "date-fns": "^2.29.3",
37
- "bfg-nuxt-3-graph": "1.0.20",
37
+ "bfg-nuxt-3-graph": "1.0.21",
38
38
  "bfg-uikit": "1.0.356",
39
39
  "html2canvas": "^1.4.1",
40
40
  "prettier-eslint": "^15.0.1"