@dative-gpi/foundation-core-components 1.0.65 → 1.0.67-map-edit
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/autocompletes/FSAutocompleteChart.vue +15 -8
- package/components/autocompletes/FSAutocompleteDashboard.vue +14 -6
- package/components/autocompletes/FSAutocompleteDashboardOrganisation.vue +7 -1
- package/components/autocompletes/FSAutocompleteDataCategory.vue +11 -5
- package/components/autocompletes/FSAutocompleteDataDefinition.vue +7 -1
- package/components/autocompletes/FSAutocompleteGroup.vue +7 -1
- package/components/autocompletes/FSAutocompleteLocation.vue +6 -0
- package/components/autocompletes/FSAutocompleteManufacturer.vue +8 -0
- package/components/autocompletes/FSAutocompleteModel.vue +9 -1
- package/components/autocompletes/FSAutocompleteOrganisationType.vue +7 -1
- package/components/autocompletes/FSAutocompleteRole.vue +14 -6
- package/components/autocompletes/FSAutocompleteServiceAccountRoleOrganisation.vue +7 -1
- package/components/autocompletes/FSAutocompleteUserOrganisation.vue +9 -1
- package/components/customProperties/FSMetaField.vue +35 -40
- package/components/customProperties/FSMetaFormContent.vue +4 -3
- package/components/customProperties/FSMetaHistory.vue +2 -2
- package/components/customProperties/helpers.ts +57 -165
- package/components/entities/FSBaseEntitiesList.vue +12 -2
- package/components/entities/FSDialogSelectEntities.vue +19 -2
- package/components/entities/FSEntityField.vue +75 -14
- package/components/entities/FSSelectEntitiesList.vue +40 -7
- package/components/explorers/FSBaseDevicesExplorer.vue +322 -0
- package/components/explorers/FSBaseFoldersExplorer.vue +126 -24
- package/components/lists/FSDataTable.vue +22 -16
- package/components/lists/alerts/FSBaseAlertsList.vue +96 -106
- package/components/lists/alerts/FSButtonAcknowledgeAlert.vue +4 -4
- package/components/lists/authTokens/FSBaseAuthTokensList.vue +6 -4
- package/components/lists/chartOrganisationTypes/FSBaseChartOrganisationTypesList.vue +97 -34
- package/components/lists/chartOrganisations/FSBaseChartOrganisationsList.vue +98 -34
- package/components/lists/charts/FSBaseChartsList.vue +153 -64
- package/components/lists/comments/FSBaseCommentsList.vue +39 -23
- package/components/lists/connectivityScenarios/FSBaseConnectivityScenariosList.vue +128 -0
- package/components/lists/dashboardOrganisationTypes/FSBaseDashboardOrganisationTypesList.vue +41 -8
- package/components/lists/dashboards/FSBaseDashboardsList.vue +76 -16
- package/components/lists/dashboards/FSSimpleDashboardsList.vue +33 -7
- package/components/lists/dataCategories/FSBaseDataCategoriesList.vue +8 -6
- package/components/lists/dataDefinitions/FSBaseDataDefinitionsList.vue +8 -5
- package/components/lists/deviceOrganisations/FSBaseDeviceOrganisationsList.vue +70 -44
- package/components/lists/folders/FSBaseFoldersList.vue +27 -15
- package/components/lists/groups/FSBaseGroupsList.vue +13 -9
- package/components/lists/locations/FSBaseLocationsList.vue +17 -13
- package/components/lists/models/FSBaseModelsList.vue +31 -13
- package/components/lists/playlists/FSSimplePlaylistsList.vue +44 -0
- package/components/lists/roleOrganisationTypes/FSBaseRoleOrganisationTypesList.vue +6 -5
- package/components/lists/roleOrganisations/FSBaseRoleOrganisationsList.vue +17 -16
- package/components/lists/scenarioOrganisationTypes/FSBaseScenarioOrganisationTypesList.vue +45 -8
- package/components/lists/scenarioOrganisations/FSBaseScenarioOrganisationsList.vue +45 -7
- package/components/lists/scenarios/FSBaseScenariosList.vue +121 -86
- package/components/lists/serviceAccountOrganisations/FSBaseServiceAccountOrganisationsList.vue +10 -7
- package/components/lists/serviceAccountRoleOrganisations/FSBaseServiceAccountRoleOrganisationsList.vue +128 -0
- package/components/lists/userOrganisations/FSBaseUserOrganisationsList.vue +10 -7
- package/components/lists/userOrganisations/FSChipUserOrganisationsList.vue +61 -0
- package/components/tiles/FSChartTile.vue +71 -0
- package/components/tiles/FSDashboardOrganisationTile.vue +3 -3
- package/components/tiles/FSDashboardOrganisationTypeTile.vue +3 -3
- package/components/tiles/FSDashboardShallowTile.vue +3 -3
- package/components/tiles/FSDeviceOrganisationTile.vue +3 -3
- package/components/tiles/FSFolderTile.vue +7 -5
- package/components/tiles/FSGroupTile.vue +3 -3
- package/components/tiles/FSLocationTile.vue +5 -3
- package/components/tiles/FSModelTile.vue +64 -0
- package/components/tiles/FSServiceAccountOrganisationTile.vue +3 -3
- package/components/tiles/FSUserOrganisationTile.vue +3 -3
- package/components/treeviews/FSTreeViewGroup.vue +7 -1
- package/package.json +9 -9
- package/utils/dashboards.ts +4 -4
- package/utils/index.ts +0 -1
- package/utils/roles.ts +3 -3
- package/utils/users.ts +3 -3
- package/components/selects/FSAggregationSelector.vue +0 -51
- package/components/selects/FSAxisTypeSelector.vue +0 -48
- package/components/selects/FSDisplayAsSelector.vue +0 -52
- package/components/selects/FSFilterTypeSelector.vue +0 -53
- package/components/selects/FSHeatmapRuleSelector.vue +0 -52
- package/components/selects/FSOperationOnSelector.vue +0 -51
- package/components/selects/FSPlanningTypeSelector.vue +0 -51
- package/components/selects/FSPlotPerSelector.vue +0 -51
- package/components/selects/FSSelectEntityType.vue +0 -59
- package/components/selects/FSSerieTypeSelector.vue +0 -51
- package/utils/charts.ts +0 -137
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<FSDataTable
|
|
3
|
+
defaultMode="iterator"
|
|
3
4
|
:items="items"
|
|
4
5
|
:item-to="$props.itemTo"
|
|
5
6
|
:loading="fetchingFolders || fetchingDashboardOrganisations || fetchingDashboardShallows"
|
|
6
7
|
:tableCode="$props.tableCode"
|
|
8
|
+
:headersOptions="headersOptions"
|
|
7
9
|
:modelValue="selecteds"
|
|
10
|
+
:selectable="$props.selectable"
|
|
8
11
|
@update:modelValue="onSelect"
|
|
9
12
|
v-bind="$attrs"
|
|
10
13
|
>
|
|
@@ -17,7 +20,31 @@
|
|
|
17
20
|
v-bind="slotData"
|
|
18
21
|
/>
|
|
19
22
|
</template>
|
|
20
|
-
|
|
23
|
+
<template
|
|
24
|
+
#header.imageId-title
|
|
25
|
+
>
|
|
26
|
+
<FSIcon>
|
|
27
|
+
mdi-panorama-variant-outline
|
|
28
|
+
</FSIcon>
|
|
29
|
+
</template>
|
|
30
|
+
<template
|
|
31
|
+
#item.imageId="{ item }"
|
|
32
|
+
>
|
|
33
|
+
<FSImage
|
|
34
|
+
v-if="item.imageId"
|
|
35
|
+
height="32px"
|
|
36
|
+
width="32px"
|
|
37
|
+
:imageId="item.imageId"
|
|
38
|
+
:thumbnail="true"
|
|
39
|
+
/>
|
|
40
|
+
</template>
|
|
41
|
+
<template
|
|
42
|
+
#item.icon="{ item }"
|
|
43
|
+
>
|
|
44
|
+
<FSIcon>
|
|
45
|
+
{{ item.icon }}
|
|
46
|
+
</FSIcon>
|
|
47
|
+
</template>
|
|
21
48
|
<template
|
|
22
49
|
#item.main="{ item }"
|
|
23
50
|
>
|
|
@@ -32,29 +59,54 @@
|
|
|
32
59
|
mdi-home
|
|
33
60
|
</FSIcon>
|
|
34
61
|
</template>
|
|
35
|
-
|
|
36
62
|
<template
|
|
37
|
-
#item.
|
|
63
|
+
#item.locked="{ item }"
|
|
38
64
|
>
|
|
39
|
-
<
|
|
40
|
-
|
|
41
|
-
|
|
65
|
+
<FSIconCheck
|
|
66
|
+
:value="item.locked"
|
|
67
|
+
/>
|
|
42
68
|
</template>
|
|
43
|
-
|
|
44
69
|
<template
|
|
45
|
-
#item.
|
|
70
|
+
#item.tags="{ item }"
|
|
71
|
+
>
|
|
72
|
+
<FSTagGroup
|
|
73
|
+
variant="slide"
|
|
74
|
+
:showRemove="false"
|
|
75
|
+
:tags="item.tags"
|
|
76
|
+
/>
|
|
77
|
+
</template>
|
|
78
|
+
<template
|
|
79
|
+
#item.dashboardType="{ item }"
|
|
80
|
+
>
|
|
81
|
+
<FSChip
|
|
82
|
+
v-if="item.type === FoldersListType.Dashboard"
|
|
83
|
+
:color="ColorEnum.Light"
|
|
84
|
+
:label="dashboardTypeLabel(item.dashboardType)"
|
|
85
|
+
/>
|
|
86
|
+
<FSChip
|
|
87
|
+
v-else-if="item.type === FoldersListType.Folder"
|
|
88
|
+
:color="ColorEnum.Light"
|
|
89
|
+
:label="$tr('ui.common.folder', 'Folder')"
|
|
90
|
+
/>
|
|
91
|
+
</template>
|
|
92
|
+
<template
|
|
93
|
+
#item.tile="{ index, item, toggleSelect }"
|
|
46
94
|
>
|
|
47
95
|
<FSFolderTileUI
|
|
48
96
|
v-if="item.type == FoldersListType.Folder"
|
|
97
|
+
:key="index"
|
|
49
98
|
:bottomColor="item.colors"
|
|
50
99
|
v-bind="item"
|
|
100
|
+
:selectable="$props.selectable"
|
|
51
101
|
:modelValue="isSelected(item.id)"
|
|
52
102
|
@update:modelValue="toggleSelect(item)"
|
|
53
103
|
:to="$props.itemTo && $props.itemTo(item)"
|
|
54
104
|
/>
|
|
55
105
|
<FSDashboardOrganisationTileUI
|
|
56
106
|
v-if="item.type == FoldersListType.Dashboard && item.dashboardType == DashboardType.Organisation"
|
|
107
|
+
:key="index"
|
|
57
108
|
:bottomColor="item.colors"
|
|
109
|
+
:selectable="$props.selectable"
|
|
58
110
|
:modelValue="isSelected(item.id)"
|
|
59
111
|
@update:modelValue="toggleSelect(item)"
|
|
60
112
|
:to="$props.itemTo && $props.itemTo(item)"
|
|
@@ -62,7 +114,9 @@
|
|
|
62
114
|
/>
|
|
63
115
|
<FSDashboardShallowTileUI
|
|
64
116
|
v-if="item.type == FoldersListType.Dashboard && item.dashboardType == DashboardType.Shallow"
|
|
117
|
+
:key="index"
|
|
65
118
|
:bottomColor="item.colors"
|
|
119
|
+
:selectable="$props.selectable"
|
|
66
120
|
:modelValue="isSelected(item.id)"
|
|
67
121
|
@update:modelValue="toggleSelect(item)"
|
|
68
122
|
:to="$props.itemTo && $props.itemTo(item)"
|
|
@@ -74,31 +128,41 @@
|
|
|
74
128
|
|
|
75
129
|
<script lang="ts">
|
|
76
130
|
import _ from "lodash";
|
|
77
|
-
import type { PropType} from "vue";
|
|
78
131
|
import type { RouteLocation } from "vue-router";
|
|
79
|
-
import { computed, defineComponent, onMounted, ref, watch } from "vue";
|
|
132
|
+
import { computed, defineComponent, onMounted, type PropType, ref, watch } from "vue";
|
|
80
133
|
|
|
81
134
|
import { useOrganisation } from "@dative-gpi/foundation-shared-services/composables";
|
|
82
135
|
import { useDashboardOrganisations, useFolders, useDashboardShallows, useAppOrganisationId, useCurrentUserOrganisation } from "@dative-gpi/foundation-core-services/composables";
|
|
83
136
|
|
|
84
137
|
import { DashboardType } from "@dative-gpi/foundation-shared-domain/enums";
|
|
85
|
-
import { FoldersListType, type FoldersListItem } from "@dative-gpi/foundation-core-components/utils";
|
|
138
|
+
import { dashboardTypeLabel, FoldersListType, type FoldersListItem } from "@dative-gpi/foundation-core-components/utils";
|
|
86
139
|
import type { FolderFilters, DashboardOrganisationFilters, DashboardShallowFilters, DashboardInfos } from "@dative-gpi/foundation-core-domain/models";
|
|
87
140
|
|
|
88
|
-
import FSDataTable from "../lists/FSDataTable.vue";
|
|
89
141
|
import FSIcon from "@dative-gpi/foundation-shared-components/components/FSIcon.vue";
|
|
142
|
+
import FSChip from '@dative-gpi/foundation-shared-components/components/FSChip.vue';
|
|
143
|
+
import FSImage from "@dative-gpi/foundation-shared-components/components/FSImage.vue";
|
|
144
|
+
import FSTagGroup from "@dative-gpi/foundation-shared-components/components/FSTagGroup.vue";
|
|
145
|
+
import FSIconCheck from "@dative-gpi/foundation-shared-components/components/FSIconCheck.vue";
|
|
90
146
|
import FSFolderTileUI from "@dative-gpi/foundation-shared-components/components/tiles/FSFolderTileUI.vue";
|
|
91
|
-
import FSDashboardOrganisationTileUI from "@dative-gpi/foundation-shared-components/components/tiles/FSDashboardOrganisationTileUI.vue";
|
|
92
147
|
import FSDashboardShallowTileUI from "@dative-gpi/foundation-shared-components/components/tiles/FSDashboardShallowTileUI.vue";
|
|
148
|
+
import FSDashboardOrganisationTileUI from "@dative-gpi/foundation-shared-components/components/tiles/FSDashboardOrganisationTileUI.vue";
|
|
149
|
+
|
|
150
|
+
import FSDataTable from "../lists/FSDataTable.vue";
|
|
151
|
+
import { ColorEnum } from '@dative-gpi/foundation-shared-components/models';
|
|
152
|
+
import { useTranslations } from '@dative-gpi/bones-ui';
|
|
93
153
|
|
|
94
154
|
export default defineComponent({
|
|
95
155
|
name: "FSBaseFoldersExplorer",
|
|
96
156
|
components: {
|
|
97
|
-
FSDataTable,
|
|
98
|
-
FSIcon,
|
|
99
|
-
FSFolderTileUI,
|
|
100
157
|
FSDashboardOrganisationTileUI,
|
|
101
|
-
FSDashboardShallowTileUI
|
|
158
|
+
FSDashboardShallowTileUI,
|
|
159
|
+
FSFolderTileUI,
|
|
160
|
+
FSDataTable,
|
|
161
|
+
FSIconCheck,
|
|
162
|
+
FSTagGroup,
|
|
163
|
+
FSImage,
|
|
164
|
+
FSChip,
|
|
165
|
+
FSIcon
|
|
102
166
|
},
|
|
103
167
|
props: {
|
|
104
168
|
foldersFilters: {
|
|
@@ -128,11 +192,16 @@ export default defineComponent({
|
|
|
128
192
|
tableCode: {
|
|
129
193
|
type: String,
|
|
130
194
|
required: true
|
|
195
|
+
},
|
|
196
|
+
selectable: {
|
|
197
|
+
type: Boolean,
|
|
198
|
+
required: false,
|
|
199
|
+
default: true
|
|
131
200
|
}
|
|
132
201
|
},
|
|
133
|
-
emits: ["update:modelValue", "update:type", "update:dashboard-type"],
|
|
202
|
+
emits: ["update", "update:modelValue", "update:type", "update:dashboard-type"],
|
|
134
203
|
setup(props, { emit }) {
|
|
135
|
-
|
|
204
|
+
const { $tr } = useTranslations();
|
|
136
205
|
const { fetch: fetchUserOrganisation, entity: userOrganisation } = useCurrentUserOrganisation();
|
|
137
206
|
const { entity: organisation, get: getOrganisation } = useOrganisation();
|
|
138
207
|
const { organisationId } = useAppOrganisationId();
|
|
@@ -171,14 +240,44 @@ export default defineComponent({
|
|
|
171
240
|
})) as FoldersListItem[]
|
|
172
241
|
], d => d.label)
|
|
173
242
|
]
|
|
174
|
-
})
|
|
243
|
+
});
|
|
244
|
+
|
|
245
|
+
const headersOptions = computed(() => ({
|
|
246
|
+
dashboardType: {
|
|
247
|
+
fixedFilters: [
|
|
248
|
+
{
|
|
249
|
+
value: DashboardType.Organisation,
|
|
250
|
+
text: dashboardTypeLabel(DashboardType.Organisation)
|
|
251
|
+
},
|
|
252
|
+
{
|
|
253
|
+
value: DashboardType.Shallow,
|
|
254
|
+
text: dashboardTypeLabel(DashboardType.Shallow)
|
|
255
|
+
},
|
|
256
|
+
{
|
|
257
|
+
value: 10,
|
|
258
|
+
text: $tr("ui.common.folder", "Folder")
|
|
259
|
+
},
|
|
260
|
+
],
|
|
261
|
+
methodFilter: (value: number, dashboardType: DashboardType) => {
|
|
262
|
+
if(dashboardType !== DashboardType.None) {
|
|
263
|
+
return value === dashboardType;
|
|
264
|
+
} else {
|
|
265
|
+
return value === 10;
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
}));
|
|
175
270
|
|
|
176
271
|
const onSelect = (values: string[]) => {
|
|
177
272
|
selecteds.value = values;
|
|
178
273
|
const selectedItems = items.value.filter(i => selecteds.value!.includes(i.id));
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
274
|
+
const newDashboardType = selectedItems.map(i => i.dashboardType);
|
|
275
|
+
const newModelValue = selectedItems.map(i => i.id);
|
|
276
|
+
const newType = selectedItems.map(i => i.type);
|
|
277
|
+
emit("update:dashboard-type", newDashboardType);
|
|
278
|
+
emit("update:modelValue", newModelValue);
|
|
279
|
+
emit("update:type", newType);
|
|
280
|
+
emit("update", { dashboardType: newDashboardType, modelValue: newModelValue, type: newType });
|
|
182
281
|
};
|
|
183
282
|
|
|
184
283
|
const isSelected = (id: string) => {
|
|
@@ -223,12 +322,15 @@ export default defineComponent({
|
|
|
223
322
|
fetchingFolders,
|
|
224
323
|
mainOrganisationDashboardId,
|
|
225
324
|
mainUserDashboardId,
|
|
325
|
+
headersOptions,
|
|
326
|
+
ColorEnum,
|
|
226
327
|
selecteds,
|
|
227
328
|
items,
|
|
228
329
|
onSelect,
|
|
229
330
|
isSelected,
|
|
230
331
|
FoldersListType,
|
|
231
|
-
DashboardType
|
|
332
|
+
DashboardType,
|
|
333
|
+
dashboardTypeLabel
|
|
232
334
|
};
|
|
233
335
|
}
|
|
234
336
|
});
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<FSLoadDataTable
|
|
3
|
-
v-if="!initialized || gettingUserOrganisationTable"
|
|
3
|
+
v-if="($props.tableCode && !initialized) || gettingUserOrganisationTable || !table"
|
|
4
4
|
/>
|
|
5
5
|
<FSDataTableUI
|
|
6
6
|
v-else
|
|
7
7
|
@update:rowsPerPage="table.rowsPerPage = $event"
|
|
8
|
+
@update:showFilters="table.showFilters = $event"
|
|
8
9
|
@update:filters="table.filters = $event"
|
|
9
10
|
@update:headers="table.headers = $event"
|
|
10
11
|
@update:sortBy="table.sortBy = $event"
|
|
@@ -41,15 +42,26 @@ export default defineComponent({
|
|
|
41
42
|
FSDataTableUI
|
|
42
43
|
},
|
|
43
44
|
props: {
|
|
45
|
+
defaultMode: {
|
|
46
|
+
type: String as PropType<"table" | "iterator">,
|
|
47
|
+
required: false,
|
|
48
|
+
default: "table"
|
|
49
|
+
},
|
|
44
50
|
tableCode: {
|
|
45
|
-
type: String
|
|
46
|
-
required:
|
|
51
|
+
type: String as PropType<string | null>,
|
|
52
|
+
required: false,
|
|
53
|
+
default: null
|
|
47
54
|
},
|
|
48
55
|
debounceTime: {
|
|
49
56
|
type: Number,
|
|
50
57
|
required: false,
|
|
51
58
|
default: 1000
|
|
52
59
|
},
|
|
60
|
+
extraHeaders: {
|
|
61
|
+
type: Array as PropType<FSDataTableColumn[]>,
|
|
62
|
+
required: false,
|
|
63
|
+
default: () => []
|
|
64
|
+
},
|
|
53
65
|
headersOptions: {
|
|
54
66
|
type: Object as PropType<{ [key: string]: Partial<FSDataTableColumn> }>,
|
|
55
67
|
required: false,
|
|
@@ -63,7 +75,7 @@ export default defineComponent({
|
|
|
63
75
|
const { getTable, setTable } = useTables();
|
|
64
76
|
const { debounce, cancel } = useDebounce();
|
|
65
77
|
|
|
66
|
-
const computedTable = computed(() => computeTable(props.headersOptions));
|
|
78
|
+
const computedTable = computed(() => computeTable(props.headersOptions, props.defaultMode, props.extraHeaders));
|
|
67
79
|
|
|
68
80
|
onUnmounted(() => {
|
|
69
81
|
cancel();
|
|
@@ -71,23 +83,17 @@ export default defineComponent({
|
|
|
71
83
|
});
|
|
72
84
|
|
|
73
85
|
const update = () => {
|
|
74
|
-
|
|
75
|
-
updateUserOrganisationTable,
|
|
76
|
-
|
|
77
|
-
props.tableCode
|
|
78
|
-
);
|
|
86
|
+
if (props.tableCode) {
|
|
87
|
+
updateTable(updateUserOrganisationTable, setTable, props.tableCode, props.defaultMode);
|
|
88
|
+
}
|
|
79
89
|
}
|
|
80
90
|
|
|
81
91
|
watch(() => props.tableCode, async (): Promise<void> => {
|
|
82
|
-
onTableCodeChange(
|
|
83
|
-
getUserOrganisationTable,
|
|
84
|
-
getTable,
|
|
85
|
-
props.tableCode
|
|
86
|
-
);
|
|
92
|
+
onTableCodeChange(getUserOrganisationTable, getTable, props.tableCode, props.defaultMode);
|
|
87
93
|
}, { immediate: true });
|
|
88
94
|
|
|
89
|
-
watch(() => table.value, () => {
|
|
90
|
-
if (table.value && initialized.value) {
|
|
95
|
+
watch(() => (table.value ? { ...table.value } : null), (_, former) => {
|
|
96
|
+
if (table.value && former && initialized.value) {
|
|
91
97
|
debounce(update, props.debounceTime);
|
|
92
98
|
}
|
|
93
99
|
}, { deep: true });
|
|
@@ -5,8 +5,10 @@
|
|
|
5
5
|
:itemTo="$props.itemTo"
|
|
6
6
|
:items="alertsOrdered"
|
|
7
7
|
:loading="fetchingAlerts"
|
|
8
|
+
:headersOptions="headersOptions"
|
|
8
9
|
:tableCode="$props.tableCode"
|
|
9
10
|
:modelValue="$props.modelValue"
|
|
11
|
+
:selectable="$props.selectable"
|
|
10
12
|
@update:modelValue="$emit('update:modelValue', $event)"
|
|
11
13
|
v-bind="$attrs"
|
|
12
14
|
>
|
|
@@ -19,39 +21,12 @@
|
|
|
19
21
|
v-bind="slotData"
|
|
20
22
|
/>
|
|
21
23
|
</template>
|
|
22
|
-
|
|
23
|
-
#toolbar
|
|
24
|
-
>
|
|
25
|
-
<FSButtonCheckbox
|
|
26
|
-
:label="$tr('page.alerts.not-acknowledged-only', 'Not acknowledged only')"
|
|
27
|
-
:color="ColorEnum.Warning"
|
|
28
|
-
v-model="innerNotTreatedOnly"
|
|
29
|
-
/>
|
|
30
|
-
<FSButtonCheckbox
|
|
31
|
-
:label="$tr('page.alerts.hide-pending', 'Hide pending')"
|
|
32
|
-
:color="ColorEnum.Light"
|
|
33
|
-
variant="full"
|
|
34
|
-
v-model="innerHidePending"
|
|
35
|
-
/>
|
|
36
|
-
<FSRow
|
|
37
|
-
align="center-right"
|
|
38
|
-
>
|
|
39
|
-
<FSRow
|
|
40
|
-
width="hug"
|
|
41
|
-
>
|
|
42
|
-
<FSTermField
|
|
43
|
-
variant="default"
|
|
44
|
-
:editable="!innerNotTreatedOnly"
|
|
45
|
-
v-model:startDate="startDate"
|
|
46
|
-
v-model:endDate="endDate"
|
|
47
|
-
/>
|
|
48
|
-
</FSRow>
|
|
49
|
-
</FSRow>
|
|
50
|
-
</template>
|
|
24
|
+
|
|
51
25
|
<template
|
|
52
26
|
#item.criticity="{ item }"
|
|
53
27
|
>
|
|
54
28
|
<FSRow
|
|
29
|
+
:wrap="false"
|
|
55
30
|
align="center-left"
|
|
56
31
|
gap="2px"
|
|
57
32
|
>
|
|
@@ -77,7 +52,7 @@
|
|
|
77
52
|
>
|
|
78
53
|
<FSTagGroup
|
|
79
54
|
variant="slide"
|
|
80
|
-
:
|
|
55
|
+
:showRemove="false"
|
|
81
56
|
:tags="item.tags"
|
|
82
57
|
/>
|
|
83
58
|
</template>
|
|
@@ -87,7 +62,7 @@
|
|
|
87
62
|
<FSTagGroup
|
|
88
63
|
variant="slide"
|
|
89
64
|
:tags="item.groupByValues.map((gbv: any) => `${gbv.label}: ${gbv.value}`)"
|
|
90
|
-
:
|
|
65
|
+
:showRemove="false"
|
|
91
66
|
/>
|
|
92
67
|
</template>
|
|
93
68
|
<template
|
|
@@ -98,6 +73,7 @@
|
|
|
98
73
|
width="32px"
|
|
99
74
|
height="32px"
|
|
100
75
|
:imageId="item.deviceOrganisationImageId"
|
|
76
|
+
:thumbnail="true"
|
|
101
77
|
/>
|
|
102
78
|
</template>
|
|
103
79
|
<template
|
|
@@ -117,7 +93,7 @@
|
|
|
117
93
|
v-else
|
|
118
94
|
font="text-overline"
|
|
119
95
|
>
|
|
120
|
-
{{ $tr('
|
|
96
|
+
{{ $tr('ui.alert.not-acknowledged', 'Not acknowledged') }}
|
|
121
97
|
</FSSpan>
|
|
122
98
|
</template>
|
|
123
99
|
<template
|
|
@@ -128,6 +104,7 @@
|
|
|
128
104
|
width="32px"
|
|
129
105
|
height="32px"
|
|
130
106
|
:imageId="item.acknowledgingUserImageId"
|
|
107
|
+
:thumbnail="true"
|
|
131
108
|
/>
|
|
132
109
|
</template>
|
|
133
110
|
<template
|
|
@@ -145,7 +122,7 @@
|
|
|
145
122
|
<FSTagGroup
|
|
146
123
|
variant="slide"
|
|
147
124
|
:tags="item.history.map((h: any) => AlertTools.statusLabel(h.status))"
|
|
148
|
-
:
|
|
125
|
+
:showRemove="false"
|
|
149
126
|
/>
|
|
150
127
|
</template>
|
|
151
128
|
<template
|
|
@@ -158,25 +135,7 @@
|
|
|
158
135
|
</FSSpan>
|
|
159
136
|
</template>
|
|
160
137
|
<template
|
|
161
|
-
#item.
|
|
162
|
-
>
|
|
163
|
-
<FSSpan
|
|
164
|
-
font="text-overline"
|
|
165
|
-
>
|
|
166
|
-
{{ epochToShortTimeFormat(item.triggerSourceTimestamp) }}
|
|
167
|
-
</FSSpan>
|
|
168
|
-
</template>
|
|
169
|
-
<template
|
|
170
|
-
#item.triggerEnqueuedTimestamp="{ item }"
|
|
171
|
-
>
|
|
172
|
-
<FSSpan
|
|
173
|
-
font="text-overline"
|
|
174
|
-
>
|
|
175
|
-
{{ epochToShortTimeFormat(item.triggerEnqueuedTimestamp) }}
|
|
176
|
-
</FSSpan>
|
|
177
|
-
</template>
|
|
178
|
-
<template
|
|
179
|
-
#item.triggerProcessedTimestamp="{ item }"
|
|
138
|
+
#item.triggerActualTimestamp="{ item }"
|
|
180
139
|
>
|
|
181
140
|
<FSSpan
|
|
182
141
|
font="text-overline"
|
|
@@ -194,31 +153,39 @@
|
|
|
194
153
|
</FSSpan>
|
|
195
154
|
</template>
|
|
196
155
|
<template
|
|
197
|
-
#item.
|
|
156
|
+
#item.currentActualTimestamp="{ item }"
|
|
198
157
|
>
|
|
199
158
|
<FSSpan
|
|
200
159
|
font="text-overline"
|
|
201
160
|
>
|
|
202
|
-
{{ epochToShortTimeFormat(item.
|
|
161
|
+
{{ epochToShortTimeFormat(item.currentActualTimestamp) }}
|
|
203
162
|
</FSSpan>
|
|
204
163
|
</template>
|
|
205
164
|
<template
|
|
206
|
-
#item.
|
|
165
|
+
#item.currentStatus="{ item }"
|
|
207
166
|
>
|
|
208
167
|
<FSSpan
|
|
209
168
|
font="text-overline"
|
|
210
169
|
>
|
|
211
|
-
{{
|
|
170
|
+
{{ AlertTools.statusLabel(item.currentStatus) }}
|
|
212
171
|
</FSSpan>
|
|
213
172
|
</template>
|
|
214
173
|
<template
|
|
215
|
-
#item.
|
|
174
|
+
#item.tile="{ index, item, toggleSelect }"
|
|
216
175
|
>
|
|
217
|
-
<
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
176
|
+
<FSAlertTileUI
|
|
177
|
+
:key="index"
|
|
178
|
+
variant="standard"
|
|
179
|
+
:label="item.label"
|
|
180
|
+
:deviceOrganisationLabel="item.deviceOrganisationLabel"
|
|
181
|
+
:icon="item.icon"
|
|
182
|
+
:selectable="$props.selectable"
|
|
183
|
+
:triggerProcessedTimestamp="item.triggerProcessedTimestamp"
|
|
184
|
+
:to="$props.itemTo && $props.itemTo(item)"
|
|
185
|
+
:modelValue="isSelected(item.id)"
|
|
186
|
+
:color="alertColorByCriticity(item.criticity)"
|
|
187
|
+
@update:modelValue="toggleSelect(item)"
|
|
188
|
+
/>
|
|
222
189
|
</template>
|
|
223
190
|
</FSDataTable>
|
|
224
191
|
</template>
|
|
@@ -226,13 +193,17 @@
|
|
|
226
193
|
<script lang="ts">
|
|
227
194
|
import type { PropType} from "vue";
|
|
228
195
|
import type { RouteLocation } from "vue-router";
|
|
229
|
-
import { computed, defineComponent,
|
|
196
|
+
import { computed, defineComponent, watch } from "vue";
|
|
230
197
|
import _ from "lodash";
|
|
231
198
|
|
|
199
|
+
import { useTranslations } from "@dative-gpi/bones-ui";
|
|
200
|
+
|
|
232
201
|
import type { AlertFilters, AlertInfos } from "@dative-gpi/foundation-core-domain/models";
|
|
233
202
|
import { useDateFormat } from "@dative-gpi/foundation-shared-services/composables";
|
|
203
|
+
import { getEnumEntries } from "@dative-gpi/foundation-shared-domain/tools";
|
|
234
204
|
import { useAlerts } from "@dative-gpi/foundation-core-services/composables";
|
|
235
205
|
import { ColorEnum } from "@dative-gpi/foundation-shared-components/models";
|
|
206
|
+
import { Criticity } from "@dative-gpi/foundation-shared-domain/enums";
|
|
236
207
|
import { AlertStatus } from "@dative-gpi/foundation-shared-domain/enums";
|
|
237
208
|
|
|
238
209
|
import { AlertTools } from "@dative-gpi/foundation-shared-components/tools";
|
|
@@ -244,23 +215,27 @@ import FSSpan from "@dative-gpi/foundation-shared-components/components/FSSpan.v
|
|
|
244
215
|
import FSIcon from "@dative-gpi/foundation-shared-components/components/FSIcon.vue";
|
|
245
216
|
import FSImage from "@dative-gpi/foundation-shared-components/components/FSImage.vue";
|
|
246
217
|
import FSTagGroup from "@dative-gpi/foundation-shared-components/components/FSTagGroup.vue";
|
|
247
|
-
import
|
|
248
|
-
|
|
218
|
+
import FSAlertTileUI from "@dative-gpi/foundation-shared-components/components/tiles/FSAlertTileUI.vue";
|
|
219
|
+
|
|
249
220
|
|
|
250
221
|
export default defineComponent({
|
|
251
222
|
name: "FSBaseAlertsList",
|
|
252
223
|
components: {
|
|
253
224
|
FSButtonAcknowledgeAlert,
|
|
254
|
-
|
|
225
|
+
FSAlertTileUI,
|
|
255
226
|
FSDataTable,
|
|
256
|
-
|
|
227
|
+
FSTagGroup,
|
|
257
228
|
FSImage,
|
|
258
|
-
|
|
229
|
+
FSIcon,
|
|
259
230
|
FSSpan,
|
|
260
|
-
|
|
261
|
-
FSTermField,
|
|
231
|
+
FSRow
|
|
262
232
|
},
|
|
263
233
|
props: {
|
|
234
|
+
tableCode: {
|
|
235
|
+
type: String as PropType<string | null>,
|
|
236
|
+
required: false,
|
|
237
|
+
default: null
|
|
238
|
+
},
|
|
264
239
|
alertFilters: {
|
|
265
240
|
type: Object as PropType<AlertFilters>,
|
|
266
241
|
required: false,
|
|
@@ -284,73 +259,88 @@ export default defineComponent({
|
|
|
284
259
|
required: false,
|
|
285
260
|
default: false
|
|
286
261
|
},
|
|
287
|
-
tableCode: {
|
|
288
|
-
type: String,
|
|
289
|
-
required: true
|
|
290
|
-
},
|
|
291
262
|
itemTo: {
|
|
292
263
|
type: Function as PropType<(item: AlertInfos) => Partial<RouteLocation>>,
|
|
293
264
|
required: false
|
|
265
|
+
},
|
|
266
|
+
selectable: {
|
|
267
|
+
type: Boolean,
|
|
268
|
+
required: false,
|
|
269
|
+
default: true
|
|
294
270
|
}
|
|
295
271
|
},
|
|
296
272
|
emits: ["update:modelValue"],
|
|
297
273
|
setup(props) {
|
|
274
|
+
const { $tr } = useTranslations();
|
|
298
275
|
const { getMany: getManyAlerts, entities: alerts, fetching : fetchingAlerts } = useAlerts();
|
|
299
276
|
const { epochToShortTimeFormat } = useDateFormat();
|
|
300
277
|
|
|
301
|
-
const innerNotTreatedOnly = ref<boolean | undefined>(props.notAcknowledged);
|
|
302
|
-
const innerHidePending = ref<boolean | undefined>(props.hidePending);
|
|
303
|
-
const startDate = ref<string>("now - 1w");
|
|
304
|
-
const endDate = ref<string>("now");
|
|
305
|
-
|
|
306
278
|
|
|
307
279
|
const criticityColor = (row: any) => {
|
|
308
280
|
return AlertTools.criticityColor(row.criticity);
|
|
309
281
|
};
|
|
310
282
|
|
|
283
|
+
const alertColorByCriticity = (criticity: Criticity | number) => {
|
|
284
|
+
return AlertTools.criticityColor(criticity);
|
|
285
|
+
};
|
|
286
|
+
|
|
287
|
+
const isSelected = (id: string): boolean => {
|
|
288
|
+
return props.modelValue.includes(id);
|
|
289
|
+
};
|
|
290
|
+
|
|
311
291
|
const alertsOrdered = computed(() => {
|
|
312
292
|
const als = [...alerts.value]
|
|
313
293
|
return als.sort((a: AlertInfos, b: AlertInfos) => {
|
|
314
294
|
return (a.acknowledged === b.acknowledged) ?
|
|
315
|
-
+b.
|
|
295
|
+
+b.currentActualTimestamp! - +a.currentActualTimestamp! : a.acknowledged ? 1 : -1
|
|
316
296
|
});
|
|
317
297
|
});
|
|
318
298
|
|
|
319
|
-
|
|
299
|
+
const headersOptions = computed(() => ({
|
|
300
|
+
currentStatus: {
|
|
301
|
+
fixedFilters: getEnumEntries(AlertStatus).map(e => ({
|
|
302
|
+
value: e.value,
|
|
303
|
+
text: AlertTools.statusLabel(e.value)
|
|
304
|
+
})),
|
|
305
|
+
methodFilter: (value: AlertStatus, item: AlertStatus) => value == item
|
|
306
|
+
},
|
|
307
|
+
criticity: {
|
|
308
|
+
fixedFilters: getEnumEntries(Criticity).map(e => ({
|
|
309
|
+
value: e.value,
|
|
310
|
+
text: AlertTools.criticityLabel(e.value)
|
|
311
|
+
})),
|
|
312
|
+
methodFilter: (value: Criticity, item: Criticity) => value == item
|
|
313
|
+
},
|
|
314
|
+
acknowledged: {
|
|
315
|
+
fixedFilters: [
|
|
316
|
+
{ value: true, text: $tr('entity.alert.acknowledged', 'Acknowledged') },
|
|
317
|
+
{ value: false, text: $tr('ui.alert.not-acknowledged', 'Not acknowledged') }
|
|
318
|
+
],
|
|
319
|
+
methodFilter: (value: boolean, item: boolean) => value === item
|
|
320
|
+
},
|
|
321
|
+
}));
|
|
322
|
+
|
|
323
|
+
watch([() => props.alertFilters, () => props.notAcknowledged, () => props.hidePending], (next, previous) => {
|
|
320
324
|
if (!_.isEqual(next, previous)) {
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
});
|
|
327
|
-
}
|
|
328
|
-
else{
|
|
329
|
-
getManyAlerts({
|
|
330
|
-
...props.alertFilters,
|
|
331
|
-
statuses: innerHidePending.value ?
|
|
332
|
-
[AlertStatus.Unresolved, AlertStatus.Resolved, AlertStatus.Triggered] : undefined,
|
|
333
|
-
startDate: startDate.value,
|
|
334
|
-
endDate: endDate.value
|
|
335
|
-
}); // TODO, gérer les conditions pour que les alertes s'affichent ici notamment lorsqu'elles sont acquittées
|
|
336
|
-
// la FilterFactory gère pas ces conditions correctement
|
|
337
|
-
}
|
|
338
|
-
|
|
325
|
+
getManyAlerts({
|
|
326
|
+
...props.alertFilters,
|
|
327
|
+
acknowledged: props.notAcknowledged ? false : undefined,
|
|
328
|
+
statuses: props.hidePending ? [AlertStatus.Unresolved, AlertStatus.Triggered, AlertStatus.Resolved, AlertStatus.Abandoned] : undefined
|
|
329
|
+
});
|
|
339
330
|
}
|
|
340
331
|
}, { immediate: true });
|
|
341
332
|
|
|
342
333
|
|
|
343
334
|
return {
|
|
344
|
-
|
|
335
|
+
fetchingAlerts,
|
|
336
|
+
headersOptions,
|
|
337
|
+
alertsOrdered,
|
|
345
338
|
AlertTools,
|
|
346
339
|
ColorEnum,
|
|
347
|
-
alertsOrdered,
|
|
348
|
-
fetchingAlerts,
|
|
349
|
-
startDate,
|
|
350
|
-
endDate,
|
|
351
|
-
innerHidePending,
|
|
352
340
|
epochToShortTimeFormat,
|
|
353
|
-
|
|
341
|
+
alertColorByCriticity,
|
|
342
|
+
criticityColor,
|
|
343
|
+
isSelected
|
|
354
344
|
};
|
|
355
345
|
}
|
|
356
346
|
});
|