bfg-common 1.5.677 → 1.5.679
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/components/common/layout/bottomPanel/BottomPanel.vue +68 -84
- package/components/common/layout/bottomPanel/New.vue +227 -243
- package/components/common/layout/bottomPanel/Old.vue +144 -160
- package/components/common/layout/bottomPanel/recentTasks/lib/models/interfaces.ts +14 -14
- package/package.json +1 -1
- package/components/common/layout/bottomPanel/alarms/Alarms.vue +0 -76
- package/components/common/layout/bottomPanel/alarms/lib/models/interfaces.ts +0 -23
- package/components/common/layout/bottomPanel/alarms/new/New.vue +0 -212
- package/components/common/layout/bottomPanel/alarms/new/lib/config/config.ts +0 -193
- package/components/common/layout/bottomPanel/alarms/new/lib/models/enums.ts +0 -10
- package/components/common/layout/bottomPanel/alarms/new/lib/models/interfaces.ts +0 -12
- package/components/common/layout/bottomPanel/alarms/old/Old.vue +0 -191
- package/components/common/layout/bottomPanel/alarms/old/lib/config/alarmTables.ts +0 -89
- package/components/common/layout/bottomPanel/alarms/old/lib/config/tableKeys.ts +0 -11
- package/components/common/layout/bottomPanel/alarms/old/lib/models/types.ts +0 -8
|
@@ -1,160 +1,144 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div
|
|
3
|
-
:class="[
|
|
4
|
-
'bottom-panel flex flex-col h-full',
|
|
5
|
-
{ collapsed: props.panelCollapsedModel },
|
|
6
|
-
]"
|
|
7
|
-
>
|
|
8
|
-
<div class="flex">
|
|
9
|
-
<div class="bottom-panel__trigger">
|
|
10
|
-
<button
|
|
11
|
-
id="bottom-panel-trigger"
|
|
12
|
-
data-id="bottom-panel-toggle-button"
|
|
13
|
-
class="btn-trigger flex items-center"
|
|
14
|
-
@click="emits('collapse-panel')"
|
|
15
|
-
>
|
|
16
|
-
<atoms-the-icon class="trigger-icon" name="angle" />
|
|
17
|
-
</button>
|
|
18
|
-
</div>
|
|
19
|
-
<atoms-nav-bar
|
|
20
|
-
v-model="activeTabModel"
|
|
21
|
-
:items="props.tabList"
|
|
22
|
-
:class="[
|
|
23
|
-
'bottom-panel__tabs',
|
|
24
|
-
props.panelCollapsedModel && 'collapsed',
|
|
25
|
-
]"
|
|
26
|
-
test-id="bottom-panel-nav-bar"
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
v-
|
|
36
|
-
|
|
37
|
-
:
|
|
38
|
-
:total-
|
|
39
|
-
:
|
|
40
|
-
:
|
|
41
|
-
|
|
42
|
-
@
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
<
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
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
|
-
padding-right: 15px;
|
|
146
|
-
margin-right: 15px;
|
|
147
|
-
border-right: 0.05rem solid #ccc;
|
|
148
|
-
box-shadow: inset 0 -0.05rem 0 var(--nav-panel-border-color);
|
|
149
|
-
}
|
|
150
|
-
}
|
|
151
|
-
</style>
|
|
152
|
-
|
|
153
|
-
<style>
|
|
154
|
-
:root {
|
|
155
|
-
--pannel-bg-color: #fafafa;
|
|
156
|
-
}
|
|
157
|
-
:root.dark-theme {
|
|
158
|
-
--pannel-bg-color: #1b2a32;
|
|
159
|
-
}
|
|
160
|
-
</style>
|
|
1
|
+
<template>
|
|
2
|
+
<div
|
|
3
|
+
:class="[
|
|
4
|
+
'bottom-panel flex flex-col h-full',
|
|
5
|
+
{ collapsed: props.panelCollapsedModel },
|
|
6
|
+
]"
|
|
7
|
+
>
|
|
8
|
+
<div class="flex">
|
|
9
|
+
<div class="bottom-panel__trigger">
|
|
10
|
+
<button
|
|
11
|
+
id="bottom-panel-trigger"
|
|
12
|
+
data-id="bottom-panel-toggle-button"
|
|
13
|
+
class="btn-trigger flex items-center"
|
|
14
|
+
@click="emits('collapse-panel')"
|
|
15
|
+
>
|
|
16
|
+
<atoms-the-icon class="trigger-icon" name="angle" />
|
|
17
|
+
</button>
|
|
18
|
+
</div>
|
|
19
|
+
<atoms-nav-bar
|
|
20
|
+
v-model="activeTabModel"
|
|
21
|
+
:items="props.tabList"
|
|
22
|
+
:class="[
|
|
23
|
+
'bottom-panel__tabs',
|
|
24
|
+
props.panelCollapsedModel && 'collapsed',
|
|
25
|
+
]"
|
|
26
|
+
test-id="bottom-panel-nav-bar"
|
|
27
|
+
/>
|
|
28
|
+
</div>
|
|
29
|
+
<div
|
|
30
|
+
v-show="!props.panelCollapsedModel"
|
|
31
|
+
class="bottom-panel__table-wrapper overflow-hidden"
|
|
32
|
+
>
|
|
33
|
+
<common-layout-bottom-panel-recent-tasks
|
|
34
|
+
v-show="activeTabModel === 'recentTask'"
|
|
35
|
+
v-model:status-filter="statusFilter"
|
|
36
|
+
:data-table="props.dataTableRecentTasks"
|
|
37
|
+
:total-items="props.totalItemsRecentTasks"
|
|
38
|
+
:total-pages="props.totalPagesRecentTasks"
|
|
39
|
+
:pagination="props.paginationRecentTasks"
|
|
40
|
+
:loading="props.loadingRecentTasks"
|
|
41
|
+
@sort="emits('sort-recent-task', $event)"
|
|
42
|
+
@pagination="emits('pagination-recent-task', $event)"
|
|
43
|
+
/>
|
|
44
|
+
|
|
45
|
+
<slot name="alarms" />
|
|
46
|
+
</div>
|
|
47
|
+
</div>
|
|
48
|
+
</template>
|
|
49
|
+
|
|
50
|
+
<script setup lang="ts">
|
|
51
|
+
import type { UI_I_CollapseNavItem } from '~/components/atoms/collapse/lib/models/interfaces'
|
|
52
|
+
import type { UI_I_RecentTaskItem } from '~/lib/models/store/tasks/interfaces'
|
|
53
|
+
import type { UI_I_Pagination } from '~/lib/models/table/interfaces'
|
|
54
|
+
import type { UI_T_NodeType } from '~/components/common/pages/home/lib/models/types'
|
|
55
|
+
import type { UI_T_BottomPanelTabType } from '~/components/common/layout/bottomPanel/lib/models/types'
|
|
56
|
+
import type { UI_T_SelectedStatus } from '~/components/common/layout/bottomPanel/recentTasks/old/lib/models/types'
|
|
57
|
+
|
|
58
|
+
const statusFilter = defineModel<UI_T_SelectedStatus>('statusFilter', {
|
|
59
|
+
required: true,
|
|
60
|
+
})
|
|
61
|
+
const activeTabModel = defineModel<UI_T_BottomPanelTabType>('selectedTab', {
|
|
62
|
+
required: true,
|
|
63
|
+
})
|
|
64
|
+
|
|
65
|
+
const props = defineProps<{
|
|
66
|
+
panelCollapsedModel: boolean
|
|
67
|
+
tabList: UI_I_CollapseNavItem[]
|
|
68
|
+
dataTableRecentTasks: UI_I_RecentTaskItem<UI_T_NodeType>[]
|
|
69
|
+
totalItemsRecentTasks: number
|
|
70
|
+
totalPagesRecentTasks: number
|
|
71
|
+
paginationRecentTasks: UI_I_Pagination
|
|
72
|
+
loadingRecentTasks: boolean
|
|
73
|
+
}>()
|
|
74
|
+
|
|
75
|
+
const emits = defineEmits<{
|
|
76
|
+
(event: 'collapse-panel'): void
|
|
77
|
+
(event: 'sort-recent-task', value: string): void
|
|
78
|
+
(event: 'pagination-recent-task', value: UI_I_Pagination | null): void
|
|
79
|
+
}>()
|
|
80
|
+
</script>
|
|
81
|
+
|
|
82
|
+
<style scoped lang="scss">
|
|
83
|
+
@import '~/assets/scss/common/mixins';
|
|
84
|
+
.bottom-panel {
|
|
85
|
+
background-color: var(--pannel-bg-color);
|
|
86
|
+
& > div:first-child {
|
|
87
|
+
height: 36px;
|
|
88
|
+
}
|
|
89
|
+
&__table-wrapper {
|
|
90
|
+
height: inherit;
|
|
91
|
+
:deep(.datagrid-outer-wrapper) {
|
|
92
|
+
padding-top: 0;
|
|
93
|
+
.datagrid {
|
|
94
|
+
border-radius: 0;
|
|
95
|
+
margin-top: 0;
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
&__tabs {
|
|
100
|
+
&.collapsed {
|
|
101
|
+
:deep(button.nav-link) {
|
|
102
|
+
box-shadow: none;
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
&.collapsed {
|
|
108
|
+
.btn-trigger {
|
|
109
|
+
.trigger-icon {
|
|
110
|
+
transform: rotate(0deg);
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
.btn-trigger {
|
|
115
|
+
height: 31px;
|
|
116
|
+
border: 0;
|
|
117
|
+
outline: none;
|
|
118
|
+
background-color: transparent;
|
|
119
|
+
padding-left: 15px;
|
|
120
|
+
cursor: pointer;
|
|
121
|
+
.trigger-icon {
|
|
122
|
+
width: 16px;
|
|
123
|
+
height: 16px;
|
|
124
|
+
fill: var(--triger-icon-color);
|
|
125
|
+
transform: rotate(180deg);
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
&__trigger {
|
|
129
|
+
padding-right: 15px;
|
|
130
|
+
margin-right: 15px;
|
|
131
|
+
border-right: 0.05rem solid #ccc;
|
|
132
|
+
box-shadow: inset 0 -0.05rem 0 var(--nav-panel-border-color);
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
</style>
|
|
136
|
+
|
|
137
|
+
<style>
|
|
138
|
+
:root {
|
|
139
|
+
--pannel-bg-color: #fafafa;
|
|
140
|
+
}
|
|
141
|
+
:root.dark-theme {
|
|
142
|
+
--pannel-bg-color: #1b2a32;
|
|
143
|
+
}
|
|
144
|
+
</style>
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import type { UI_T_NodeType } from '~/components/common/pages/home/lib/models/types'
|
|
2
|
-
import type { UI_T_NavNodes } from '~/lib/models/types'
|
|
3
|
-
|
|
4
|
-
interface UI_I_TargetData {
|
|
5
|
-
id: string
|
|
6
|
-
type: UI_T_NodeType
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
export interface UI_I_DataTargetForTable extends UI_I_TargetData {
|
|
10
|
-
nav: UI_T_NavNodes
|
|
11
|
-
isLink: boolean
|
|
12
|
-
iconClassName: string
|
|
13
|
-
testId?: string
|
|
14
|
-
}
|
|
1
|
+
import type { UI_T_NodeType } from '~/components/common/pages/home/lib/models/types'
|
|
2
|
+
import type { UI_T_NavNodes } from '~/lib/models/types'
|
|
3
|
+
|
|
4
|
+
interface UI_I_TargetData {
|
|
5
|
+
id: string
|
|
6
|
+
type: UI_T_NodeType
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export interface UI_I_DataTargetForTable extends UI_I_TargetData {
|
|
10
|
+
nav: UI_T_NavNodes
|
|
11
|
+
isLink: boolean
|
|
12
|
+
iconClassName: string
|
|
13
|
+
testId?: string
|
|
14
|
+
}
|
package/package.json
CHANGED
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<component
|
|
3
|
-
:is="currentComponent"
|
|
4
|
-
:data-table="props.dataTable?.items || []"
|
|
5
|
-
:total-items="props.dataTable?.items.length || 1"
|
|
6
|
-
:total-pages="1"
|
|
7
|
-
:pagination="pagination"
|
|
8
|
-
:loading="props.isLoading"
|
|
9
|
-
@pagination="onUpdatePagination"
|
|
10
|
-
@sort="onSortTable"
|
|
11
|
-
/>
|
|
12
|
-
</template>
|
|
13
|
-
|
|
14
|
-
<script setup lang="ts">
|
|
15
|
-
import type { UI_I_Pagination } from '~/lib/models/table/interfaces'
|
|
16
|
-
import type {
|
|
17
|
-
UI_I_Alarm,
|
|
18
|
-
UI_I_AlarmPayload,
|
|
19
|
-
} from '~/components/common/layout/bottomPanel/alarms/lib/models/interfaces'
|
|
20
|
-
|
|
21
|
-
const props = defineProps<{
|
|
22
|
-
dataTable: UI_I_Alarm | null
|
|
23
|
-
isLoading: boolean
|
|
24
|
-
}>()
|
|
25
|
-
|
|
26
|
-
const emits = defineEmits<{
|
|
27
|
-
(event: 'pause-global-refresh'): void
|
|
28
|
-
(event: 'get-alarms', value: UI_I_AlarmPayload): void
|
|
29
|
-
}>()
|
|
30
|
-
|
|
31
|
-
const { $store }: any = useNuxtApp()
|
|
32
|
-
|
|
33
|
-
const isNewView = computed<boolean>(() => $store.getters['main/getIsNewView'])
|
|
34
|
-
|
|
35
|
-
const currentComponent = computed(() =>
|
|
36
|
-
isNewView.value
|
|
37
|
-
? defineAsyncComponent(() => import('./new/New.vue'))
|
|
38
|
-
: defineAsyncComponent(() => import('./old/Old.vue'))
|
|
39
|
-
)
|
|
40
|
-
|
|
41
|
-
const sort = ref<string | null>(null)
|
|
42
|
-
const pagination = ref<UI_I_Pagination>({
|
|
43
|
-
page: 1,
|
|
44
|
-
pageSize: 35,
|
|
45
|
-
})
|
|
46
|
-
|
|
47
|
-
const getAlarms = (): void => {
|
|
48
|
-
pauseGlobalRefresh()
|
|
49
|
-
|
|
50
|
-
const payload: UI_I_AlarmPayload = {
|
|
51
|
-
...pagination.value,
|
|
52
|
-
sortBy: sort.value || '',
|
|
53
|
-
}
|
|
54
|
-
emits('get-alarms', payload)
|
|
55
|
-
}
|
|
56
|
-
const pauseGlobalRefresh = (): void => {
|
|
57
|
-
emits('pause-global-refresh')
|
|
58
|
-
}
|
|
59
|
-
getAlarms()
|
|
60
|
-
|
|
61
|
-
const onUpdatePagination = (event: UI_I_Pagination): void => {
|
|
62
|
-
pagination.value = event
|
|
63
|
-
getAlarms()
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
const onSortTable = (event: string): void => {
|
|
67
|
-
sort.value = event
|
|
68
|
-
getAlarms()
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
onUnmounted(() => {
|
|
72
|
-
pauseGlobalRefresh()
|
|
73
|
-
})
|
|
74
|
-
</script>
|
|
75
|
-
|
|
76
|
-
<style scoped lang="scss"></style>
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
API_UI_I_DataTable,
|
|
3
|
-
UI_I_Pagination,
|
|
4
|
-
} from '~/lib/models/table/interfaces'
|
|
5
|
-
|
|
6
|
-
export interface UI_I_AlarmPayload extends UI_I_Pagination {
|
|
7
|
-
sortBy: string
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
export interface UI_API_I_AlarmItem {
|
|
11
|
-
id: number
|
|
12
|
-
object: string
|
|
13
|
-
status: string
|
|
14
|
-
name: string
|
|
15
|
-
triggered: string
|
|
16
|
-
acknowledged: string
|
|
17
|
-
acknowledged_by: string
|
|
18
|
-
triggering_event: string
|
|
19
|
-
statusIcon: string
|
|
20
|
-
}
|
|
21
|
-
export interface UI_I_AlarmItem extends UI_API_I_AlarmItem {}
|
|
22
|
-
|
|
23
|
-
export interface UI_I_Alarm extends API_UI_I_DataTable<UI_I_AlarmItem> {}
|
|
@@ -1,212 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<ui-data-table
|
|
3
|
-
:data="data"
|
|
4
|
-
:options="options"
|
|
5
|
-
:loading="props.loading"
|
|
6
|
-
test-id="bottom-alarms-table"
|
|
7
|
-
classes="alarms-table"
|
|
8
|
-
@sort="onSorting"
|
|
9
|
-
>
|
|
10
|
-
<template #icon="{ item }">
|
|
11
|
-
<span class="flex-align-center">
|
|
12
|
-
<span :class="['icon', item.data.icon]" />
|
|
13
|
-
|
|
14
|
-
<span
|
|
15
|
-
:data-id="`rtask-${item.data.testId}`"
|
|
16
|
-
:class="item.data.isLink && 'target-link'"
|
|
17
|
-
@click="onSelectNodeOfTree(item.data)"
|
|
18
|
-
>
|
|
19
|
-
{{ item.text }}
|
|
20
|
-
</span>
|
|
21
|
-
</span>
|
|
22
|
-
</template>
|
|
23
|
-
|
|
24
|
-
<template #status="{ item }">
|
|
25
|
-
<ui-chip :test-id="item.data.testId" :color="item.data.chipColor" rounded>
|
|
26
|
-
<ui-icon
|
|
27
|
-
:name="item.data.icon"
|
|
28
|
-
width="14px"
|
|
29
|
-
height="14px"
|
|
30
|
-
class="chip-icon"
|
|
31
|
-
></ui-icon>
|
|
32
|
-
{{ item.text }}
|
|
33
|
-
</ui-chip>
|
|
34
|
-
</template>
|
|
35
|
-
|
|
36
|
-
<template #default-actions="{ item }">
|
|
37
|
-
<div class="actions">
|
|
38
|
-
<ui-button
|
|
39
|
-
:test-id="`resent-task-item-${item.data.id}-action`"
|
|
40
|
-
variant="text"
|
|
41
|
-
is-without-height
|
|
42
|
-
is-without-sizes
|
|
43
|
-
@click.stop="onShowActions(item.data.id)"
|
|
44
|
-
>
|
|
45
|
-
<ui-icon
|
|
46
|
-
:class="['action-icon', { active: actionsIsShow[item.data.id] }]"
|
|
47
|
-
name="vertical-dotes"
|
|
48
|
-
width="24"
|
|
49
|
-
/>
|
|
50
|
-
</ui-button>
|
|
51
|
-
<ui-dropdown
|
|
52
|
-
:show="actionsIsShow[item.data.id]"
|
|
53
|
-
:test-id="`resent-task-item-action-${item.data.id}`"
|
|
54
|
-
:items="actions"
|
|
55
|
-
:elem-id="`resent-task-item-${item.data.id}-action`"
|
|
56
|
-
width="max-content"
|
|
57
|
-
@select="onSelectAction(item.data.target, $event, item.data.id)"
|
|
58
|
-
@hide="onHideActionsDropdown(item.data.id)"
|
|
59
|
-
@click.stop
|
|
60
|
-
>
|
|
61
|
-
<template #row="{ item: dropMenu }">
|
|
62
|
-
<ui-icon
|
|
63
|
-
v-if="dropMenu.iconName === 'hide'"
|
|
64
|
-
name="password-hide"
|
|
65
|
-
width="16"
|
|
66
|
-
height="16"
|
|
67
|
-
/>
|
|
68
|
-
<span class="action-text">
|
|
69
|
-
{{ dropMenu.text }}
|
|
70
|
-
</span>
|
|
71
|
-
</template>
|
|
72
|
-
</ui-dropdown>
|
|
73
|
-
</div>
|
|
74
|
-
</template>
|
|
75
|
-
</ui-data-table>
|
|
76
|
-
</template>
|
|
77
|
-
|
|
78
|
-
<script setup lang="ts">
|
|
79
|
-
import type { UI_I_Dropdown } from '~/node_modules/bfg-uikit/components/ui/dropdown/models/interfaces'
|
|
80
|
-
import type {
|
|
81
|
-
UI_I_DataTable,
|
|
82
|
-
UI_I_DataTableHeader,
|
|
83
|
-
UI_I_DataTableBody,
|
|
84
|
-
} from '~/node_modules/bfg-uikit/components/ui/dataTable/models/interfaces'
|
|
85
|
-
import type { UI_I_Localization } from '~/lib/models/interfaces'
|
|
86
|
-
import type { UI_I_Pagination } from '~/lib/models/table/interfaces'
|
|
87
|
-
import type { UI_I_DataTargetForTable } from '~/components/common/layout/bottomPanel/recentTasks/lib/models/interfaces'
|
|
88
|
-
import type { UI_I_AlarmItem } from '~/components/common/layout/bottomPanel/alarms/new/lib/models/interfaces'
|
|
89
|
-
import {
|
|
90
|
-
getAlarmRowQuickActionsFunc,
|
|
91
|
-
options,
|
|
92
|
-
getHeaderDataFunc,
|
|
93
|
-
getBodyDataFunc,
|
|
94
|
-
} from '~/components/common/layout/bottomPanel/alarms/new/lib/config/config'
|
|
95
|
-
|
|
96
|
-
const props = defineProps<{
|
|
97
|
-
dataTable: UI_I_AlarmItem[]
|
|
98
|
-
loading: boolean
|
|
99
|
-
pagination: UI_I_Pagination
|
|
100
|
-
}>()
|
|
101
|
-
const emits = defineEmits<{
|
|
102
|
-
(event: 'sort', value: string): void
|
|
103
|
-
}>()
|
|
104
|
-
|
|
105
|
-
const localization = computed<UI_I_Localization>(() => useLocal())
|
|
106
|
-
// const { $store }: any = useNuxtApp()
|
|
107
|
-
|
|
108
|
-
const actionsIsShow = ref<boolean[]>([])
|
|
109
|
-
|
|
110
|
-
const data = computed<UI_I_DataTable>(() => ({
|
|
111
|
-
id: 'bottom-alarms-table',
|
|
112
|
-
header: resentTaskHeadItems.value,
|
|
113
|
-
body: resentTaskBodyItems.value,
|
|
114
|
-
}))
|
|
115
|
-
|
|
116
|
-
const resentTaskHeadItems = computed<UI_I_DataTableHeader[]>(() =>
|
|
117
|
-
getHeaderDataFunc(localization.value)
|
|
118
|
-
)
|
|
119
|
-
|
|
120
|
-
const resentTaskBodyItems = ref<UI_I_DataTableBody[]>([])
|
|
121
|
-
watch(
|
|
122
|
-
() => props.dataTable,
|
|
123
|
-
(newValue) => {
|
|
124
|
-
if (!newValue?.length) return
|
|
125
|
-
|
|
126
|
-
resentTaskBodyItems.value = getBodyDataFunc(newValue)
|
|
127
|
-
},
|
|
128
|
-
{ deep: true, immediate: true }
|
|
129
|
-
)
|
|
130
|
-
const onSorting = (value: string): void => {
|
|
131
|
-
emits('sort', value)
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
const actions = computed<UI_I_Dropdown[]>(() =>
|
|
135
|
-
getAlarmRowQuickActionsFunc(localization.value)
|
|
136
|
-
)
|
|
137
|
-
const onShowActions = (id: number): void => {
|
|
138
|
-
actionsIsShow.value[id] = true
|
|
139
|
-
}
|
|
140
|
-
const onSelectAction = (
|
|
141
|
-
_data: UI_I_DataTargetForTable,
|
|
142
|
-
action: string,
|
|
143
|
-
actionId: number
|
|
144
|
-
): void => {
|
|
145
|
-
switch (action) {
|
|
146
|
-
case 'view-object':
|
|
147
|
-
// onSelectNodeOfTree(data)
|
|
148
|
-
break
|
|
149
|
-
case 'alarm-details':
|
|
150
|
-
break
|
|
151
|
-
case 'event-details':
|
|
152
|
-
break
|
|
153
|
-
}
|
|
154
|
-
onHideActionsDropdown(actionId)
|
|
155
|
-
}
|
|
156
|
-
const onHideActionsDropdown = (id: number): void => {
|
|
157
|
-
actionsIsShow.value[id] = false
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
// const onSelectNodeOfTree = (data: UI_I_DataTargetForTable): void => {
|
|
161
|
-
// const { type, id, nav } = data
|
|
162
|
-
//
|
|
163
|
-
// const node = {
|
|
164
|
-
// id,
|
|
165
|
-
// type,
|
|
166
|
-
// }
|
|
167
|
-
//
|
|
168
|
-
// const path = `/inventory/type=${type};nav=${nav};id=${id}/summary`
|
|
169
|
-
// navigateTo(path)
|
|
170
|
-
//
|
|
171
|
-
// $store.dispatch('inventory/A_SELECT_NODE', { node, type })
|
|
172
|
-
// }
|
|
173
|
-
</script>
|
|
174
|
-
|
|
175
|
-
<style scoped lang="scss">
|
|
176
|
-
.alarms-table {
|
|
177
|
-
height: inherit;
|
|
178
|
-
|
|
179
|
-
.target-link {
|
|
180
|
-
font-family: 'Inter', sans-serif;
|
|
181
|
-
font-size: 13px;
|
|
182
|
-
color: var(--bottom-pannel-rtask-link-text);
|
|
183
|
-
font-weight: 400;
|
|
184
|
-
line-height: 15.73px;
|
|
185
|
-
cursor: pointer;
|
|
186
|
-
&:hover {
|
|
187
|
-
color: var(--bottom-pannel-rtask-link-hover-text);
|
|
188
|
-
}
|
|
189
|
-
}
|
|
190
|
-
.chip-icon {
|
|
191
|
-
min-width: 14px;
|
|
192
|
-
margin-right: 4px;
|
|
193
|
-
}
|
|
194
|
-
.icon {
|
|
195
|
-
margin-right: 4px;
|
|
196
|
-
}
|
|
197
|
-
|
|
198
|
-
.action-icon {
|
|
199
|
-
width: 16px;
|
|
200
|
-
height: 16px;
|
|
201
|
-
fill: var(--summary-dropdown-notification-item-action-color);
|
|
202
|
-
|
|
203
|
-
&.active {
|
|
204
|
-
fill: var(--summary-dropdown-notification-item-hover-action-color);
|
|
205
|
-
}
|
|
206
|
-
}
|
|
207
|
-
|
|
208
|
-
.action-text {
|
|
209
|
-
margin-left: 8px;
|
|
210
|
-
}
|
|
211
|
-
}
|
|
212
|
-
</style>
|