@dative-gpi/foundation-core-components 1.0.56 → 1.0.58-groupings
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/FSMetaValue.vue +63 -31
- package/components/customProperties/helpers.ts +57 -165
- package/components/entities/FSBaseEntitiesList.vue +14 -4
- package/components/entities/FSDialogSelectEntities.vue +28 -106
- package/components/entities/FSEntityField.vue +75 -14
- package/components/entities/FSSelectEntitiesList.vue +225 -0
- package/components/explorers/FSBaseDevicesExplorer.vue +312 -0
- package/components/explorers/FSBaseFoldersExplorer.vue +286 -0
- package/components/lists/FSDataTable.vue +23 -21
- package/components/lists/alerts/FSBaseAlertsList.vue +95 -97
- package/components/lists/alerts/FSButtonAcknowledgeAlert.vue +4 -4
- package/components/lists/authTokens/FSBaseAuthTokensList.vue +6 -4
- package/components/lists/chartOrganisationTypes/FSBaseChartOrganisationTypesList.vue +103 -38
- package/components/lists/chartOrganisations/FSBaseChartOrganisationsList.vue +104 -39
- package/components/lists/charts/FSBaseChartsList.vue +147 -66
- package/components/lists/comments/FSBaseCommentsList.vue +39 -23
- package/components/lists/connectivityScenarios/FSBaseConnectivityScenariosList.vue +128 -0
- package/components/lists/dashboardOrganisationTypes/FSBaseDashboardOrganisationTypesList.vue +39 -7
- package/components/lists/dashboards/FSBaseDashboardsList.vue +44 -13
- package/components/lists/dashboards/FSSimpleDashboardsList.vue +33 -7
- package/components/lists/dataCategories/FSBaseDataCategoriesList.vue +6 -5
- package/components/lists/dataDefinitions/FSBaseDataDefinitionsList.vue +6 -4
- package/components/lists/deviceOrganisations/FSBaseDeviceOrganisationsList.vue +179 -61
- package/components/lists/folders/FSBaseFoldersList.vue +37 -146
- package/components/lists/groupings/FSBaseGroupingsList.vue +117 -0
- package/components/lists/groups/FSBaseGroupsList.vue +24 -7
- package/components/lists/locations/FSBaseLocationsList.vue +52 -13
- package/components/lists/models/FSBaseModelsList.vue +45 -15
- package/components/lists/roleOrganisationTypes/FSBaseRoleOrganisationTypesList.vue +17 -10
- package/components/lists/roleOrganisations/FSBaseRoleOrganisationsList.vue +28 -21
- package/components/lists/scenarioOrganisationTypes/FSBaseScenarioOrganisationTypesList.vue +56 -13
- package/components/lists/scenarioOrganisations/FSBaseScenarioOrganisationsList.vue +56 -12
- package/components/lists/scenarios/FSBaseScenariosList.vue +122 -81
- package/components/lists/serviceAccountOrganisations/FSBaseServiceAccountOrganisationsList.vue +31 -18
- package/components/lists/serviceAccountRoleOrganisations/FSBaseServiceAccountRoleOrganisationsList.vue +128 -0
- package/components/lists/userOrganisations/FSBaseUserOrganisationsList.vue +30 -19
- 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 +12 -5
- package/components/tiles/FSFolderTile.vue +3 -3
- 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/FSTreeViewFolder.vue +15 -3
- package/components/treeviews/FSTreeViewGroup.vue +22 -4
- package/package.json +9 -9
- package/utils/dashboards.ts +3 -3
- 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
|
@@ -9,86 +9,42 @@
|
|
|
9
9
|
<template
|
|
10
10
|
#body
|
|
11
11
|
>
|
|
12
|
-
<
|
|
13
|
-
|
|
12
|
+
<FSSelectEntitiesList
|
|
13
|
+
:singleSelect="$props.singleSelect"
|
|
14
|
+
:entityType="$props.entityType"
|
|
15
|
+
:modelValue="actualSelecteds"
|
|
16
|
+
:filters="$props.filters"
|
|
17
|
+
@update:modelValue="actualSelecteds = $event"
|
|
14
18
|
>
|
|
15
|
-
<
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
align="center-left"
|
|
23
|
-
height="50px"
|
|
24
|
-
>
|
|
25
|
-
<FSSlideGroup
|
|
26
|
-
v-if="actualSelecteds.length > 0"
|
|
27
|
-
>
|
|
28
|
-
<FSSimpleEntitiesList
|
|
29
|
-
:entity-type="$props.entityType"
|
|
30
|
-
:filters="simpleListFilters"
|
|
31
|
-
:showEdit="false"
|
|
32
|
-
:showRemove="false"
|
|
33
|
-
direction="row"
|
|
34
|
-
/>
|
|
35
|
-
</FSSlideGroup>
|
|
36
|
-
<FSText
|
|
37
|
-
v-else
|
|
38
|
-
>
|
|
39
|
-
{{ $tr("ui.common.no-selection", "No selection") }}
|
|
40
|
-
</FSText>
|
|
41
|
-
</FSRow>
|
|
42
|
-
</FSCol>
|
|
43
|
-
|
|
44
|
-
<FSCol>
|
|
45
|
-
<FSText
|
|
46
|
-
font="text-button"
|
|
47
|
-
>
|
|
48
|
-
{{ $tr("ui.common.entities-list", "Entities list") }}
|
|
49
|
-
</FSText>
|
|
50
|
-
<FSBaseEntitiesList
|
|
51
|
-
:entity-type="$props.entityType"
|
|
52
|
-
:tableCode="tableCode"
|
|
53
|
-
v-model="actualSelecteds"
|
|
54
|
-
v-bind="baseTableAttrs"
|
|
19
|
+
<template
|
|
20
|
+
v-for="(_, name) in $slots"
|
|
21
|
+
v-slot:[name]="slotData"
|
|
22
|
+
>
|
|
23
|
+
<slot
|
|
24
|
+
:name="name"
|
|
25
|
+
v-bind="slotData"
|
|
55
26
|
/>
|
|
56
|
-
</
|
|
57
|
-
</
|
|
27
|
+
</template>
|
|
28
|
+
</FSSelectEntitiesList>
|
|
58
29
|
</template>
|
|
59
30
|
</FSDialogSubmit>
|
|
60
31
|
</template>
|
|
61
32
|
|
|
62
33
|
<script lang="ts">
|
|
63
|
-
import { defineComponent, type PropType,
|
|
64
|
-
|
|
65
|
-
import { EntityType } from "@dative-gpi/foundation-shared-domain/enums";
|
|
66
|
-
import type { DashboardOrganisationFilters, DashboardOrganisationTypeFilters, DeviceOrganisationFilters } from "@dative-gpi/foundation-core-domain/models";
|
|
34
|
+
import { defineComponent, type PropType, ref, watch } from "vue";
|
|
67
35
|
|
|
68
|
-
import {
|
|
36
|
+
import type { EntityType } from "@dative-gpi/foundation-shared-domain/enums";
|
|
69
37
|
|
|
70
|
-
import FSSlideGroup from "@dative-gpi/foundation-shared-components/components/FSSlideGroup.vue";
|
|
71
38
|
import FSDialogSubmit from "@dative-gpi/foundation-shared-components/components/FSDialogSubmit.vue";
|
|
72
|
-
import
|
|
73
|
-
import FSRow from "@dative-gpi/foundation-shared-components/components/FSRow.vue";
|
|
74
|
-
import FSText from "@dative-gpi/foundation-shared-components/components/FSText.vue";
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
import FSSimpleEntitiesList from "./FSSimpleEntitiesList.vue";
|
|
78
|
-
import FSBaseEntitiesList from "./FSBaseEntitiesList.vue";
|
|
39
|
+
import FSSelectEntitiesList from "./FSSelectEntitiesList.vue";
|
|
79
40
|
|
|
80
41
|
export default defineComponent({
|
|
81
42
|
name: "FSDialogSelectEntities",
|
|
82
43
|
components: {
|
|
83
|
-
|
|
84
|
-
FSBaseEntitiesList,
|
|
85
|
-
FSSlideGroup,
|
|
44
|
+
FSSelectEntitiesList,
|
|
86
45
|
FSDialogSubmit,
|
|
87
|
-
FSCol,
|
|
88
|
-
FSRow,
|
|
89
|
-
FSText
|
|
90
46
|
},
|
|
91
|
-
emits: ["update:modelValue", "update:selecteds"],
|
|
47
|
+
emits: ["update", "update:modelValue", "update:selecteds"],
|
|
92
48
|
props: {
|
|
93
49
|
entityType: {
|
|
94
50
|
type: Number as PropType<EntityType>,
|
|
@@ -99,6 +55,11 @@ export default defineComponent({
|
|
|
99
55
|
required: false,
|
|
100
56
|
default: () => []
|
|
101
57
|
},
|
|
58
|
+
singleSelect: {
|
|
59
|
+
type: Boolean,
|
|
60
|
+
required: false,
|
|
61
|
+
default: false
|
|
62
|
+
},
|
|
102
63
|
filters: {
|
|
103
64
|
type: Object,
|
|
104
65
|
required: false,
|
|
@@ -110,49 +71,13 @@ export default defineComponent({
|
|
|
110
71
|
default: false
|
|
111
72
|
}
|
|
112
73
|
},
|
|
113
|
-
setup(props, {
|
|
74
|
+
setup(props, { emit }){
|
|
114
75
|
const actualSelecteds = ref<string[]>([]);
|
|
115
76
|
|
|
116
|
-
const simpleListFilters = computed(() => {
|
|
117
|
-
switch(props.entityType) {
|
|
118
|
-
case EntityType.Device:
|
|
119
|
-
return {
|
|
120
|
-
deviceOrganisationsIds: actualSelecteds.value
|
|
121
|
-
} satisfies DeviceOrganisationFilters;
|
|
122
|
-
case EntityType.Dashboard:
|
|
123
|
-
return {
|
|
124
|
-
dashboardOrganisationIds: actualSelecteds.value,
|
|
125
|
-
dashboardOrganisationTypeIds: actualSelecteds.value
|
|
126
|
-
} satisfies DashboardOrganisationFilters & DashboardOrganisationTypeFilters;
|
|
127
|
-
default:
|
|
128
|
-
return undefined;
|
|
129
|
-
};
|
|
130
|
-
})
|
|
131
|
-
|
|
132
|
-
const tableCode = computed(() => {
|
|
133
|
-
switch(props.entityType) {
|
|
134
|
-
case EntityType.Device:
|
|
135
|
-
return T.DEVICES_SELECT;
|
|
136
|
-
default:
|
|
137
|
-
return null;
|
|
138
|
-
};
|
|
139
|
-
})
|
|
140
|
-
|
|
141
|
-
const baseTableAttrs = computed(() => {
|
|
142
|
-
switch(props.entityType) {
|
|
143
|
-
case EntityType.Device:
|
|
144
|
-
return {
|
|
145
|
-
deviceOrganisationFilters: props.filters,
|
|
146
|
-
...attrs
|
|
147
|
-
};
|
|
148
|
-
default:
|
|
149
|
-
return null;
|
|
150
|
-
};
|
|
151
|
-
});
|
|
152
|
-
|
|
153
77
|
const onSubmit = () => {
|
|
154
78
|
emit("update:selecteds", actualSelecteds.value);
|
|
155
79
|
emit("update:modelValue", false);
|
|
80
|
+
emit("update", { selecteds: actualSelecteds.value, modelValue: false });
|
|
156
81
|
}
|
|
157
82
|
|
|
158
83
|
watch(() => props.selecteds, (value) => {
|
|
@@ -161,10 +86,7 @@ export default defineComponent({
|
|
|
161
86
|
|
|
162
87
|
return {
|
|
163
88
|
onSubmit,
|
|
164
|
-
actualSelecteds
|
|
165
|
-
simpleListFilters,
|
|
166
|
-
baseTableAttrs,
|
|
167
|
-
tableCode
|
|
89
|
+
actualSelecteds
|
|
168
90
|
}
|
|
169
91
|
}
|
|
170
92
|
});
|
|
@@ -3,14 +3,15 @@
|
|
|
3
3
|
:description="$props.description"
|
|
4
4
|
:hideHeader="$props.hideHeader"
|
|
5
5
|
:required="$props.required"
|
|
6
|
-
:
|
|
6
|
+
:disabled="$props.disabled"
|
|
7
7
|
:label="$props.label"
|
|
8
8
|
:messages="$props.messages"
|
|
9
9
|
:entityType="$props.entityType"
|
|
10
10
|
:allowedEntityTypes="$props.allowedEntityTypes || []"
|
|
11
11
|
:itemsCount="($props.modelValue || []).length"
|
|
12
|
-
@update:entityType="
|
|
12
|
+
@update:entityType="onEntityTypeChanged"
|
|
13
13
|
:showEntities="$props.showEntities"
|
|
14
|
+
:showCount="$props.showCount"
|
|
14
15
|
@click:select="dialog = true"
|
|
15
16
|
>
|
|
16
17
|
<template
|
|
@@ -18,18 +19,19 @@
|
|
|
18
19
|
>
|
|
19
20
|
<FSSimpleEntitiesList
|
|
20
21
|
:entity-type="$props.entityType"
|
|
21
|
-
:filters="
|
|
22
|
+
:filters="simpleListFilters"
|
|
22
23
|
:showEdit="false"
|
|
23
24
|
@click:remove="onRemove"
|
|
24
25
|
/>
|
|
25
26
|
</template>
|
|
26
27
|
</FSEntityFieldUI>
|
|
27
28
|
<FSDialogSelectEntities
|
|
29
|
+
:singleSelect="$props.singleSelect"
|
|
28
30
|
:entity-type="$props.entityType"
|
|
29
31
|
:filters="$props.filters"
|
|
30
32
|
v-model="dialog"
|
|
31
33
|
:selecteds="$props.modelValue || []"
|
|
32
|
-
@update:selecteds="
|
|
34
|
+
@update:selecteds="onModelValueChanged"
|
|
33
35
|
/>
|
|
34
36
|
</template>
|
|
35
37
|
|
|
@@ -39,7 +41,7 @@ import { defineComponent, ref, type PropType, computed } from "vue";
|
|
|
39
41
|
|
|
40
42
|
import { EntityType } from "@dative-gpi/foundation-shared-domain/enums";
|
|
41
43
|
|
|
42
|
-
import type { DeviceOrganisationFilters } from "@dative-gpi/foundation-core-domain/models";
|
|
44
|
+
import type { DashboardOrganisationFilters, DashboardOrganisationTypeFilters, DeviceOrganisationFilters, FolderFilters, GroupFilters, LocationFilters, ModelFilters, UserOrganisationFilters } from "@dative-gpi/foundation-core-domain/models";
|
|
43
45
|
|
|
44
46
|
import FSEntityFieldUI from "@dative-gpi/foundation-shared-components/components/fields/FSEntityFieldUI.vue";
|
|
45
47
|
|
|
@@ -94,10 +96,10 @@ export default defineComponent({
|
|
|
94
96
|
required: false,
|
|
95
97
|
default: null
|
|
96
98
|
},
|
|
97
|
-
|
|
99
|
+
disabled: {
|
|
98
100
|
type: Boolean,
|
|
99
101
|
required: false,
|
|
100
|
-
default:
|
|
102
|
+
default: false
|
|
101
103
|
},
|
|
102
104
|
entityType: {
|
|
103
105
|
type: Number as PropType<EntityType>,
|
|
@@ -112,32 +114,91 @@ export default defineComponent({
|
|
|
112
114
|
type: Boolean,
|
|
113
115
|
required: false,
|
|
114
116
|
default: true
|
|
117
|
+
},
|
|
118
|
+
singleSelect: {
|
|
119
|
+
type: Boolean,
|
|
120
|
+
required: false,
|
|
121
|
+
default: false
|
|
122
|
+
},
|
|
123
|
+
showCount: {
|
|
124
|
+
type: Boolean,
|
|
125
|
+
required: false,
|
|
126
|
+
default: true
|
|
115
127
|
}
|
|
116
128
|
},
|
|
117
|
-
emits: ["update:modelValue", "update:entityType"],
|
|
129
|
+
emits: ["update","update:modelValue", "update:entityType"],
|
|
118
130
|
setup(props, { emit }) {
|
|
119
131
|
const dialog = ref(false);
|
|
120
132
|
|
|
121
|
-
const
|
|
133
|
+
const simpleListFilters = computed(() => {
|
|
122
134
|
switch(props.entityType) {
|
|
123
135
|
case EntityType.Device:
|
|
124
136
|
return {
|
|
125
137
|
deviceOrganisationsIds: props.modelValue
|
|
126
138
|
} satisfies DeviceOrganisationFilters;
|
|
139
|
+
case EntityType.Dashboard:
|
|
140
|
+
return {
|
|
141
|
+
dashboardOrganisationsIds: props.modelValue,
|
|
142
|
+
dashboardOrganisationTypesIds: props.modelValue,
|
|
143
|
+
dashboardShallowsIds: props.modelValue
|
|
144
|
+
} satisfies DashboardOrganisationFilters & DashboardOrganisationTypeFilters;
|
|
145
|
+
case EntityType.Group:
|
|
146
|
+
return {
|
|
147
|
+
groupsIds: props.modelValue
|
|
148
|
+
} satisfies GroupFilters;
|
|
149
|
+
case EntityType.Folder:
|
|
150
|
+
return {
|
|
151
|
+
foldersIds: props.modelValue
|
|
152
|
+
} satisfies FolderFilters;
|
|
153
|
+
case EntityType.Location:
|
|
154
|
+
return {
|
|
155
|
+
locationsIds: props.modelValue
|
|
156
|
+
} satisfies LocationFilters;
|
|
157
|
+
case EntityType.User:
|
|
158
|
+
return {
|
|
159
|
+
userOrganisationsIds: props.modelValue
|
|
160
|
+
} satisfies UserOrganisationFilters;
|
|
161
|
+
case EntityType.Model:
|
|
162
|
+
return {
|
|
163
|
+
modelsIds: props.modelValue
|
|
164
|
+
} satisfies ModelFilters;
|
|
127
165
|
default:
|
|
128
|
-
return
|
|
166
|
+
return undefined;
|
|
129
167
|
};
|
|
130
|
-
})
|
|
168
|
+
})
|
|
131
169
|
|
|
132
170
|
const onRemove = (id: string) => {
|
|
133
171
|
emit("update:modelValue", props.modelValue.filter((i) => i !== id));
|
|
172
|
+
emit("update", {
|
|
173
|
+
entityType: props.entityType,
|
|
174
|
+
modelValue: props.modelValue.filter((i) => i !== id)
|
|
175
|
+
})
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
const onEntityTypeChanged = (entityType: EntityType) => {
|
|
179
|
+
emit('update:entityType', entityType);
|
|
180
|
+
emit('update:modelValue', []);
|
|
181
|
+
emit("update", {
|
|
182
|
+
entityType,
|
|
183
|
+
modelValue: []
|
|
184
|
+
})
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
const onModelValueChanged = (modelValue: string[]) => {
|
|
188
|
+
emit('update:modelValue', modelValue);
|
|
189
|
+
emit("update", {
|
|
190
|
+
entityType: props.entityType,
|
|
191
|
+
modelValue
|
|
192
|
+
})
|
|
134
193
|
}
|
|
135
194
|
|
|
136
195
|
return {
|
|
137
196
|
dialog,
|
|
138
|
-
|
|
139
|
-
onRemove
|
|
197
|
+
simpleListFilters,
|
|
198
|
+
onRemove,
|
|
199
|
+
onEntityTypeChanged,
|
|
200
|
+
onModelValueChanged
|
|
140
201
|
}
|
|
141
202
|
}
|
|
142
203
|
});
|
|
143
|
-
</script>
|
|
204
|
+
</script>
|
|
@@ -0,0 +1,225 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<FSCol
|
|
3
|
+
gap="24px"
|
|
4
|
+
>
|
|
5
|
+
<FSCol>
|
|
6
|
+
<FSText
|
|
7
|
+
font="text-button"
|
|
8
|
+
>
|
|
9
|
+
{{ $tr("ui.common.selection-reminder", "Selection reminder") }}
|
|
10
|
+
</FSText>
|
|
11
|
+
<FSRow
|
|
12
|
+
align="center-left"
|
|
13
|
+
height="50px"
|
|
14
|
+
>
|
|
15
|
+
<FSSlideGroup
|
|
16
|
+
v-if="$props.modelValue && $props.modelValue.length > 0"
|
|
17
|
+
>
|
|
18
|
+
<FSSimpleEntitiesList
|
|
19
|
+
:entity-type="$props.entityType"
|
|
20
|
+
:filters="simpleListFilters"
|
|
21
|
+
:showEdit="false"
|
|
22
|
+
:showRemove="showRemove"
|
|
23
|
+
@click:remove="onRemove"
|
|
24
|
+
direction="row"
|
|
25
|
+
/>
|
|
26
|
+
</FSSlideGroup>
|
|
27
|
+
<FSText
|
|
28
|
+
v-else
|
|
29
|
+
>
|
|
30
|
+
{{ $tr("ui.common.no-selection", "No selection") }}
|
|
31
|
+
</FSText>
|
|
32
|
+
</FSRow>
|
|
33
|
+
</FSCol>
|
|
34
|
+
|
|
35
|
+
<FSCol>
|
|
36
|
+
<FSText
|
|
37
|
+
font="text-button"
|
|
38
|
+
>
|
|
39
|
+
{{ $tr("ui.common.entities-list", "Entities list") }}
|
|
40
|
+
</FSText>
|
|
41
|
+
<FSBaseEntitiesList
|
|
42
|
+
:singleSelect="$props.singleSelect"
|
|
43
|
+
:entity-type="$props.entityType"
|
|
44
|
+
:tableCode="tableCode"
|
|
45
|
+
:modelValue="$props.modelValue"
|
|
46
|
+
@update:modelValue="$emit('update:modelValue', $event)"
|
|
47
|
+
v-bind="baseTableAttrs"
|
|
48
|
+
>
|
|
49
|
+
<template
|
|
50
|
+
v-for="(_, name) in $slots"
|
|
51
|
+
v-slot:[getNameSlot(name)]="slotData"
|
|
52
|
+
>
|
|
53
|
+
<slot
|
|
54
|
+
:name="name"
|
|
55
|
+
v-bind="slotData"
|
|
56
|
+
/>
|
|
57
|
+
</template>
|
|
58
|
+
</FSBaseEntitiesList>
|
|
59
|
+
</FSCol>
|
|
60
|
+
</FSCol>
|
|
61
|
+
</template>
|
|
62
|
+
|
|
63
|
+
<script lang="ts">
|
|
64
|
+
import { defineComponent, type PropType, computed } from "vue";
|
|
65
|
+
|
|
66
|
+
import { EntityType } from "@dative-gpi/foundation-shared-domain/enums";
|
|
67
|
+
import type { DashboardOrganisationFilters, DashboardOrganisationTypeFilters, DashboardShallowFilters, DeviceOrganisationFilters, FolderFilters, GroupFilters, LocationFilters, ModelFilters, UserOrganisationFilters } from "@dative-gpi/foundation-core-domain/models";
|
|
68
|
+
|
|
69
|
+
import { TABLES as T } from "../../utils";
|
|
70
|
+
|
|
71
|
+
import FSSlideGroup from "@dative-gpi/foundation-shared-components/components/FSSlideGroup.vue";
|
|
72
|
+
import FSCol from "@dative-gpi/foundation-shared-components/components/FSCol.vue";
|
|
73
|
+
import FSRow from "@dative-gpi/foundation-shared-components/components/FSRow.vue";
|
|
74
|
+
import FSText from "@dative-gpi/foundation-shared-components/components/FSText.vue";
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
import FSSimpleEntitiesList from "./FSSimpleEntitiesList.vue";
|
|
78
|
+
import FSBaseEntitiesList from "./FSBaseEntitiesList.vue";
|
|
79
|
+
|
|
80
|
+
export default defineComponent({
|
|
81
|
+
name: "FSSelectEntitiesList",
|
|
82
|
+
components: {
|
|
83
|
+
FSSimpleEntitiesList,
|
|
84
|
+
FSBaseEntitiesList,
|
|
85
|
+
FSSlideGroup,
|
|
86
|
+
FSCol,
|
|
87
|
+
FSRow,
|
|
88
|
+
FSText
|
|
89
|
+
},
|
|
90
|
+
emits: ["update:modelValue"],
|
|
91
|
+
props: {
|
|
92
|
+
entityType: {
|
|
93
|
+
type: Number as PropType<EntityType>,
|
|
94
|
+
required: true
|
|
95
|
+
},
|
|
96
|
+
singleSelect: {
|
|
97
|
+
type: Boolean,
|
|
98
|
+
required: false,
|
|
99
|
+
default: false
|
|
100
|
+
},
|
|
101
|
+
modelValue: {
|
|
102
|
+
type: Array as PropType<string[]>,
|
|
103
|
+
required: false,
|
|
104
|
+
default: () => []
|
|
105
|
+
},
|
|
106
|
+
filters: {
|
|
107
|
+
type: Object,
|
|
108
|
+
required: false,
|
|
109
|
+
default: null
|
|
110
|
+
},
|
|
111
|
+
showRemove: {
|
|
112
|
+
type: Boolean,
|
|
113
|
+
required: false,
|
|
114
|
+
default: false
|
|
115
|
+
}
|
|
116
|
+
},
|
|
117
|
+
setup(props, { emit, attrs }){
|
|
118
|
+
const simpleListFilters = computed(() => {
|
|
119
|
+
switch(props.entityType) {
|
|
120
|
+
case EntityType.Device:
|
|
121
|
+
return {
|
|
122
|
+
deviceOrganisationsIds: props.modelValue
|
|
123
|
+
} satisfies DeviceOrganisationFilters;
|
|
124
|
+
case EntityType.Dashboard:
|
|
125
|
+
return {
|
|
126
|
+
dashboardOrganisationsIds: props.modelValue,
|
|
127
|
+
dashboardOrganisationTypesIds: props.modelValue,
|
|
128
|
+
dashboardShallowsIds: props.modelValue
|
|
129
|
+
} satisfies DashboardOrganisationFilters & DashboardOrganisationTypeFilters & DashboardShallowFilters;
|
|
130
|
+
case EntityType.Group:
|
|
131
|
+
return {
|
|
132
|
+
groupsIds: props.modelValue
|
|
133
|
+
} satisfies GroupFilters;
|
|
134
|
+
case EntityType.Folder:
|
|
135
|
+
return {
|
|
136
|
+
foldersIds: props.modelValue
|
|
137
|
+
} satisfies FolderFilters;
|
|
138
|
+
case EntityType.Location:
|
|
139
|
+
return {
|
|
140
|
+
locationsIds: props.modelValue
|
|
141
|
+
} satisfies LocationFilters;
|
|
142
|
+
case EntityType.User:
|
|
143
|
+
return {
|
|
144
|
+
userOrganisationsIds: props.modelValue
|
|
145
|
+
} satisfies UserOrganisationFilters;
|
|
146
|
+
case EntityType.Model:
|
|
147
|
+
return {
|
|
148
|
+
modelsIds: props.modelValue
|
|
149
|
+
} satisfies ModelFilters;
|
|
150
|
+
default:
|
|
151
|
+
return undefined;
|
|
152
|
+
};
|
|
153
|
+
})
|
|
154
|
+
|
|
155
|
+
const tableCode = computed(() => {
|
|
156
|
+
switch(props.entityType) {
|
|
157
|
+
case EntityType.Device:
|
|
158
|
+
return T.DEVICES_SELECT;
|
|
159
|
+
default:
|
|
160
|
+
return null;
|
|
161
|
+
};
|
|
162
|
+
})
|
|
163
|
+
|
|
164
|
+
const baseTableAttrs = computed(() => {
|
|
165
|
+
switch(props.entityType) {
|
|
166
|
+
case EntityType.Device:
|
|
167
|
+
return {
|
|
168
|
+
deviceOrganisationFilters: props.filters,
|
|
169
|
+
...attrs
|
|
170
|
+
};
|
|
171
|
+
case EntityType.Dashboard:
|
|
172
|
+
return {
|
|
173
|
+
dashboardShallowsFilters: props.filters,
|
|
174
|
+
dashboardOrganisationsFilters: props.filters,
|
|
175
|
+
dashboardOrganisationTypeFetchFilter: props.filters,
|
|
176
|
+
...attrs
|
|
177
|
+
};
|
|
178
|
+
case EntityType.Group:
|
|
179
|
+
return {
|
|
180
|
+
groupsFilters: props.filters,
|
|
181
|
+
...attrs
|
|
182
|
+
};
|
|
183
|
+
case EntityType.Folder:
|
|
184
|
+
return {
|
|
185
|
+
foldersFilters: props.filters,
|
|
186
|
+
...attrs
|
|
187
|
+
};
|
|
188
|
+
case EntityType.Location:
|
|
189
|
+
return {
|
|
190
|
+
locationsFilters: props.filters,
|
|
191
|
+
...attrs
|
|
192
|
+
};
|
|
193
|
+
case EntityType.User:
|
|
194
|
+
return {
|
|
195
|
+
userOrganisationsFilters: props.filters,
|
|
196
|
+
...attrs
|
|
197
|
+
};
|
|
198
|
+
case EntityType.Model:
|
|
199
|
+
return {
|
|
200
|
+
modelsFilters: props.filters,
|
|
201
|
+
...attrs
|
|
202
|
+
};
|
|
203
|
+
default:
|
|
204
|
+
return null;
|
|
205
|
+
};
|
|
206
|
+
});
|
|
207
|
+
|
|
208
|
+
const onRemove = (id: string) => {
|
|
209
|
+
emit("update:modelValue", props.modelValue.filter((i) => i !== id));
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
const getNameSlot = (name: string | number) => {
|
|
213
|
+
return name.toString().replace("base-list-", "");
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
return {
|
|
217
|
+
simpleListFilters,
|
|
218
|
+
baseTableAttrs,
|
|
219
|
+
tableCode,
|
|
220
|
+
onRemove,
|
|
221
|
+
getNameSlot
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
});
|
|
225
|
+
</script>
|