@dative-gpi/foundation-core-components 1.0.51 → 1.0.52
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/lists/alerts/FSBaseAlertsList.vue +342 -0
- package/components/lists/alerts/FSButtonAcknowledgeAlert.vue +101 -0
- package/components/lists/authTokens/FSBaseAuthTokensList.vue +3 -1
- package/components/lists/chartOrganisationTypes/FSBaseChartOrganisationTypesList.vue +156 -0
- package/components/lists/chartOrganisations/FSBaseChartOrganisationsList.vue +157 -0
- package/components/lists/charts/FSBaseChartsList.vue +204 -0
- package/components/lists/comments/FSBaseCommentsList.vue +127 -0
- package/components/lists/dashboards/FSBaseDashboardsList.vue +1 -6
- package/components/lists/dataCategories/FSBaseDataCategoriesList.vue +154 -0
- package/components/lists/dataDefinitions/FSBaseDataDefinitionsList.vue +128 -0
- package/components/lists/deviceOrganisations/FSBaseDeviceOrganisationsList.vue +1 -0
- package/components/lists/folders/FSBaseFoldersList.vue +1 -6
- package/components/lists/models/FSBaseModelsList.vue +126 -0
- package/components/lists/roleOrganisationTypes/FSBaseRoleOrganisationTypesList.vue +121 -0
- package/components/lists/roleOrganisations/FSBaseRoleOrganisationsList.vue +121 -0
- package/components/lists/scenarioOrganisationTypes/FSBaseScenarioOrganisationTypesList.vue +114 -0
- package/components/lists/scenarioOrganisations/FSBaseScenarioOrganisationsList.vue +101 -0
- package/components/lists/scenarios/FSBaseScenariosList.vue +200 -0
- package/components/lists/serviceAccountOrganisations/FSBaseServiceAccountOrganisationsList.vue +142 -0
- package/components/lists/userOrganisations/FSBaseUserOrganisationsList.vue +3 -1
- package/package.json +7 -7
- package/utils/users.ts +3 -0
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<FSDataTable
|
|
3
|
+
:loading="fetchingDataDefinitions"
|
|
4
|
+
:items="dataDefinitions"
|
|
5
|
+
:tableCode="$props.tableCode"
|
|
6
|
+
:modelValue="$props.modelValue"
|
|
7
|
+
@update:modelValue="$emit('update:modelValue', $event)"
|
|
8
|
+
v-bind="$attrs"
|
|
9
|
+
>
|
|
10
|
+
<template
|
|
11
|
+
v-for="(_, name) in $slots"
|
|
12
|
+
v-slot:[name]="slotData"
|
|
13
|
+
>
|
|
14
|
+
<slot
|
|
15
|
+
:name="name"
|
|
16
|
+
v-bind="slotData"
|
|
17
|
+
/>
|
|
18
|
+
</template>
|
|
19
|
+
<template
|
|
20
|
+
#toolbar
|
|
21
|
+
>
|
|
22
|
+
<FSButtonCheckbox
|
|
23
|
+
:label="$tr('ui.common.data-correlated','Correlated only')"
|
|
24
|
+
:color="ColorEnum.Success"
|
|
25
|
+
/>
|
|
26
|
+
</template>
|
|
27
|
+
<template
|
|
28
|
+
#item.tile="{ item }"
|
|
29
|
+
>
|
|
30
|
+
<FSClickable
|
|
31
|
+
padding="12px"
|
|
32
|
+
height="60px"
|
|
33
|
+
width="233px"
|
|
34
|
+
:color="isSelected(item.id) ? ColorEnum.Primary : ColorEnum.Light"
|
|
35
|
+
@click="$emit('update:modelValue', [item.id])"
|
|
36
|
+
v-bind="$attrs"
|
|
37
|
+
>
|
|
38
|
+
<template
|
|
39
|
+
#default
|
|
40
|
+
>
|
|
41
|
+
<FSRow
|
|
42
|
+
align="center-center"
|
|
43
|
+
>
|
|
44
|
+
<FSIcon
|
|
45
|
+
icon="mdi-thermometer"
|
|
46
|
+
/>
|
|
47
|
+
<FSSpan
|
|
48
|
+
:lineClamp="1"
|
|
49
|
+
>
|
|
50
|
+
{{ item.label }}
|
|
51
|
+
</FSSpan>
|
|
52
|
+
<v-spacer/>
|
|
53
|
+
<FSIcon
|
|
54
|
+
:color="ColorEnum.Primary"
|
|
55
|
+
icon="mdi-link"
|
|
56
|
+
/>
|
|
57
|
+
</FSRow>
|
|
58
|
+
</template>
|
|
59
|
+
</FSClickable>
|
|
60
|
+
</template>
|
|
61
|
+
</FSDataTable>
|
|
62
|
+
</template>
|
|
63
|
+
|
|
64
|
+
<script lang="ts">
|
|
65
|
+
import { defineComponent, type PropType, watch } from "vue";
|
|
66
|
+
import _ from "lodash";
|
|
67
|
+
|
|
68
|
+
import {ColorEnum} from "@dative-gpi/foundation-shared-components/models";
|
|
69
|
+
|
|
70
|
+
import { useDataDefinitions } from "@dative-gpi/foundation-core-services/composables";
|
|
71
|
+
import type { DataDefinitionFilters } from "@dative-gpi/foundation-core-domain/models";
|
|
72
|
+
|
|
73
|
+
import FSDataTable from "../FSDataTable.vue";
|
|
74
|
+
import FSRow from "@dative-gpi/foundation-shared-components/components/FSRow.vue";
|
|
75
|
+
import FSSpan from "@dative-gpi/foundation-shared-components/components/FSSpan.vue";
|
|
76
|
+
import FSIcon from "@dative-gpi/foundation-shared-components/components/FSIcon.vue";
|
|
77
|
+
import FSClickable from "@dative-gpi/foundation-shared-components/components/FSClickable.vue";
|
|
78
|
+
import FSButtonCheckbox from "@dative-gpi/foundation-shared-components/components/buttons/FSButtonCheckbox.vue";
|
|
79
|
+
|
|
80
|
+
export default defineComponent({
|
|
81
|
+
name: "FSBaseDataDefinitionsList",
|
|
82
|
+
components: {
|
|
83
|
+
FSButtonCheckbox,
|
|
84
|
+
FSDataTable,
|
|
85
|
+
FSClickable,
|
|
86
|
+
FSSpan,
|
|
87
|
+
FSIcon,
|
|
88
|
+
FSRow,
|
|
89
|
+
},
|
|
90
|
+
props: {
|
|
91
|
+
dataDefinitionFilters: {
|
|
92
|
+
type: Object as PropType<DataDefinitionFilters>,
|
|
93
|
+
required: false,
|
|
94
|
+
default: null
|
|
95
|
+
},
|
|
96
|
+
modelValue: {
|
|
97
|
+
type: Array as PropType<string[]>,
|
|
98
|
+
default: () => [],
|
|
99
|
+
required: false
|
|
100
|
+
},
|
|
101
|
+
tableCode: {
|
|
102
|
+
type: String,
|
|
103
|
+
required: true
|
|
104
|
+
}
|
|
105
|
+
},
|
|
106
|
+
emits: ["update:modelValue"],
|
|
107
|
+
setup(props) {
|
|
108
|
+
const { getMany: fetchDataDefinitions, fetching: fetchingDataDefinitions, entities: dataDefinitions } = useDataDefinitions();
|
|
109
|
+
|
|
110
|
+
const isSelected = (id: string): boolean => {
|
|
111
|
+
return props.modelValue.includes(id);
|
|
112
|
+
};
|
|
113
|
+
|
|
114
|
+
watch(() => props.dataDefinitionFilters, (next, previous) => {
|
|
115
|
+
if ((!next && !previous) || !_.isEqual(next, previous)) {
|
|
116
|
+
fetchDataDefinitions(props.dataDefinitionFilters);
|
|
117
|
+
}
|
|
118
|
+
}, { immediate: true });
|
|
119
|
+
|
|
120
|
+
return {
|
|
121
|
+
fetchingDataDefinitions,
|
|
122
|
+
dataDefinitions,
|
|
123
|
+
ColorEnum,
|
|
124
|
+
isSelected
|
|
125
|
+
};
|
|
126
|
+
}
|
|
127
|
+
});
|
|
128
|
+
</script>
|
|
@@ -1,11 +1,8 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<FSLoadDataTable
|
|
3
|
-
v-if="fetchingFolders || fetchingDashboardOrganisations || fetchingDashboardShallows"
|
|
4
|
-
/>
|
|
5
2
|
<FSDataTable
|
|
6
|
-
v-else
|
|
7
3
|
:items="items"
|
|
8
4
|
:item-to="$props.itemTo"
|
|
5
|
+
:loading="fetchingFolders || fetchingDashboardOrganisations || fetchingDashboardShallows"
|
|
9
6
|
:tableCode="$props.tableCode"
|
|
10
7
|
:modelValue="selecteds"
|
|
11
8
|
@update:modelValue="onSelect"
|
|
@@ -89,7 +86,6 @@ import { FoldersListType, type FoldersListItem } from "@dative-gpi/foundation-co
|
|
|
89
86
|
import type { FolderFilters, DashboardOrganisationFilters, DashboardShallowFilters, DashboardInfos } from "@dative-gpi/foundation-core-domain/models";
|
|
90
87
|
|
|
91
88
|
import FSDataTable from "../FSDataTable.vue";
|
|
92
|
-
import FSLoadDataTable from "@dative-gpi/foundation-shared-components/components/lists/FSLoadDataTable.vue";
|
|
93
89
|
import FSIcon from "@dative-gpi/foundation-shared-components/components/FSIcon.vue";
|
|
94
90
|
import FSFolderTileUI from "@dative-gpi/foundation-shared-components/components/tiles/FSFolderTileUI.vue";
|
|
95
91
|
import FSDashboardOrganisationTileUI from "@dative-gpi/foundation-shared-components/components/tiles/FSDashboardOrganisationTileUI.vue";
|
|
@@ -100,7 +96,6 @@ export default defineComponent({
|
|
|
100
96
|
name: "FSBaseFoldersList",
|
|
101
97
|
components: {
|
|
102
98
|
FSDataTable,
|
|
103
|
-
FSLoadDataTable,
|
|
104
99
|
FSIcon,
|
|
105
100
|
FSFolderTileUI,
|
|
106
101
|
FSDashboardOrganisationTileUI,
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<FSDataTable
|
|
3
|
+
:loading="fetchingModels"
|
|
4
|
+
:items="models"
|
|
5
|
+
:tableCode="$props.tableCode"
|
|
6
|
+
:modelValue="$props.modelValue"
|
|
7
|
+
@update:modelValue="$emit('update:modelValue', $event)"
|
|
8
|
+
v-bind="$attrs"
|
|
9
|
+
>
|
|
10
|
+
<template
|
|
11
|
+
v-for="(_, name) in $slots"
|
|
12
|
+
v-slot:[name]="slotData"
|
|
13
|
+
>
|
|
14
|
+
<slot
|
|
15
|
+
:name="name"
|
|
16
|
+
v-bind="slotData"
|
|
17
|
+
/>
|
|
18
|
+
</template>
|
|
19
|
+
<template
|
|
20
|
+
#header.connectable-title
|
|
21
|
+
>
|
|
22
|
+
<FSIcon>
|
|
23
|
+
mdi-wifi
|
|
24
|
+
</FSIcon>
|
|
25
|
+
</template>
|
|
26
|
+
<template
|
|
27
|
+
#item.imageId="{ item }"
|
|
28
|
+
>
|
|
29
|
+
<FSImage
|
|
30
|
+
v-if="item.imageId"
|
|
31
|
+
height="32px"
|
|
32
|
+
width="32px"
|
|
33
|
+
:imageId="item.imageId"
|
|
34
|
+
/>
|
|
35
|
+
</template>
|
|
36
|
+
<template
|
|
37
|
+
#item.icon="{ item }"
|
|
38
|
+
>
|
|
39
|
+
<FSIcon >
|
|
40
|
+
{{ item.icon }}
|
|
41
|
+
</FSIcon>
|
|
42
|
+
</template>
|
|
43
|
+
<template
|
|
44
|
+
#item.connectable="{ item }"
|
|
45
|
+
>
|
|
46
|
+
<FSIconCheck
|
|
47
|
+
:value="item.connectable"
|
|
48
|
+
/>
|
|
49
|
+
</template>
|
|
50
|
+
<template
|
|
51
|
+
#item.tile="{ item }"
|
|
52
|
+
>
|
|
53
|
+
<FSModelTileUI
|
|
54
|
+
:imageId="item.imageId"
|
|
55
|
+
:label="item.label"
|
|
56
|
+
:color="isSelected(item.id) ? ColorEnum.Primary : ColorEnum.Background"
|
|
57
|
+
@click="$emit('update:modelValue', [item.id])"
|
|
58
|
+
v-bind="$attrs"
|
|
59
|
+
/>
|
|
60
|
+
</template>
|
|
61
|
+
</FSDataTable>
|
|
62
|
+
</template>
|
|
63
|
+
|
|
64
|
+
<script lang="ts">
|
|
65
|
+
import { defineComponent, type PropType, watch } from "vue";
|
|
66
|
+
import _ from "lodash";
|
|
67
|
+
|
|
68
|
+
import {ColorEnum} from "@dative-gpi/foundation-shared-components/models";
|
|
69
|
+
|
|
70
|
+
import { useModels } from "@dative-gpi/foundation-core-services/composables";
|
|
71
|
+
import type { ModelFilters } from "@dative-gpi/foundation-core-domain/models";
|
|
72
|
+
|
|
73
|
+
import FSDataTable from "../FSDataTable.vue";
|
|
74
|
+
import FSIcon from "@dative-gpi/foundation-shared-components/components/FSIcon.vue";
|
|
75
|
+
import FSImage from "@dative-gpi/foundation-shared-components/components/FSImage.vue";
|
|
76
|
+
import FSIconCheck from "@dative-gpi/foundation-shared-components/components/FSIconCheck.vue";
|
|
77
|
+
import FSModelTileUI from "@dative-gpi/foundation-shared-components/components/tiles/FSModelTileUI.vue";
|
|
78
|
+
|
|
79
|
+
export default defineComponent({
|
|
80
|
+
name: "FSBaseModelsList",
|
|
81
|
+
components: {
|
|
82
|
+
FSModelTileUI,
|
|
83
|
+
FSDataTable,
|
|
84
|
+
FSIconCheck,
|
|
85
|
+
FSImage,
|
|
86
|
+
FSIcon,
|
|
87
|
+
},
|
|
88
|
+
props: {
|
|
89
|
+
modelFilters: {
|
|
90
|
+
type: Object as PropType<ModelFilters>,
|
|
91
|
+
required: false,
|
|
92
|
+
default: null
|
|
93
|
+
},
|
|
94
|
+
modelValue: {
|
|
95
|
+
type: Array as PropType<string[]>,
|
|
96
|
+
default: () => [],
|
|
97
|
+
required: false
|
|
98
|
+
},
|
|
99
|
+
tableCode: {
|
|
100
|
+
type: String,
|
|
101
|
+
required: true
|
|
102
|
+
}
|
|
103
|
+
},
|
|
104
|
+
emits: ["update:modelValue"],
|
|
105
|
+
setup(props) {
|
|
106
|
+
const { getMany: fetchModels, fetching: fetchingModels, entities: models } = useModels();
|
|
107
|
+
|
|
108
|
+
const isSelected = (id: string): boolean => {
|
|
109
|
+
return props.modelValue.includes(id);
|
|
110
|
+
};
|
|
111
|
+
|
|
112
|
+
watch(() => props.modelFilters, (next, previous) => {
|
|
113
|
+
if ((!next && !previous) || !_.isEqual(next, previous)) {
|
|
114
|
+
fetchModels(props.modelFilters);
|
|
115
|
+
}
|
|
116
|
+
}, { immediate: true });
|
|
117
|
+
|
|
118
|
+
return {
|
|
119
|
+
fetchingModels,
|
|
120
|
+
models,
|
|
121
|
+
ColorEnum,
|
|
122
|
+
isSelected
|
|
123
|
+
};
|
|
124
|
+
}
|
|
125
|
+
});
|
|
126
|
+
</script>
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<FSDataTable
|
|
3
|
+
:items="roleOrganisationTypes"
|
|
4
|
+
:itemTo="$props.itemTo"
|
|
5
|
+
:loading="fetchingRoleOrganisations"
|
|
6
|
+
:tableCode="$props.tableCode"
|
|
7
|
+
:modelValue="$props.modelValue"
|
|
8
|
+
@update:modelValue="$emit('update:modelValue', $event)"
|
|
9
|
+
v-bind="$attrs"
|
|
10
|
+
>
|
|
11
|
+
<template
|
|
12
|
+
v-for="(_, name) in $slots"
|
|
13
|
+
v-slot:[name]="slotData"
|
|
14
|
+
>
|
|
15
|
+
<slot
|
|
16
|
+
:name="name"
|
|
17
|
+
v-bind="slotData"
|
|
18
|
+
/>
|
|
19
|
+
</template>
|
|
20
|
+
<template
|
|
21
|
+
#item.icon="{ item }"
|
|
22
|
+
>
|
|
23
|
+
<FSIcon>
|
|
24
|
+
{{ item.icon }}
|
|
25
|
+
</FSIcon>
|
|
26
|
+
</template>
|
|
27
|
+
<template
|
|
28
|
+
#item.userType="{ item }"
|
|
29
|
+
>
|
|
30
|
+
<FSRow
|
|
31
|
+
align="center-left"
|
|
32
|
+
>
|
|
33
|
+
<FSIcon>
|
|
34
|
+
{{ userTypeIcon(item.userType) }}
|
|
35
|
+
</FSIcon>
|
|
36
|
+
<FSText>
|
|
37
|
+
{{ userTypeLabel(item.userType) }}
|
|
38
|
+
</FSText>
|
|
39
|
+
</FSRow>
|
|
40
|
+
</template>
|
|
41
|
+
<template
|
|
42
|
+
#item.tags="{ item }"
|
|
43
|
+
>
|
|
44
|
+
<FSTagGroup
|
|
45
|
+
variant="slide"
|
|
46
|
+
:editable="false"
|
|
47
|
+
:tags="item.tags"
|
|
48
|
+
/>
|
|
49
|
+
</template>
|
|
50
|
+
</FSDataTable>
|
|
51
|
+
</template>
|
|
52
|
+
|
|
53
|
+
<script lang="ts">
|
|
54
|
+
import type { PropType} from "vue";
|
|
55
|
+
import { defineComponent, watch } from "vue";
|
|
56
|
+
import type { RouteLocation } from "vue-router";
|
|
57
|
+
import _ from "lodash";
|
|
58
|
+
|
|
59
|
+
import type { RoleOrganisationTypeFilters, RoleOrganisationTypeInfos } from "@dative-gpi/foundation-core-domain/models";
|
|
60
|
+
import { userTypeIcon, userTypeLabel } from "@dative-gpi/foundation-core-components/utils";
|
|
61
|
+
import { useRoleOrganisationTypes } from "@dative-gpi/foundation-core-services/composables";
|
|
62
|
+
|
|
63
|
+
import FSDataTable from "../FSDataTable.vue";
|
|
64
|
+
import FSRow from "@dative-gpi/foundation-shared-components/components/FSRow.vue";
|
|
65
|
+
import FSText from "@dative-gpi/foundation-shared-components/components/FSText.vue";
|
|
66
|
+
import FSIcon from "@dative-gpi/foundation-shared-components/components/FSIcon.vue";
|
|
67
|
+
import FSTagGroup from "@dative-gpi/foundation-shared-components/components/FSTagGroup.vue";
|
|
68
|
+
|
|
69
|
+
export default defineComponent({
|
|
70
|
+
name: "FSBaseRoleOrganisationTypesList",
|
|
71
|
+
components: {
|
|
72
|
+
FSRow,
|
|
73
|
+
FSIcon,
|
|
74
|
+
FSText,
|
|
75
|
+
FSTagGroup,
|
|
76
|
+
FSDataTable,
|
|
77
|
+
},
|
|
78
|
+
props: {
|
|
79
|
+
roleOrganisationTypesFilters: {
|
|
80
|
+
type: Object as PropType<RoleOrganisationTypeFilters | null>,
|
|
81
|
+
required: false,
|
|
82
|
+
default: null
|
|
83
|
+
},
|
|
84
|
+
modelValue: {
|
|
85
|
+
type: Array as PropType<string[]>,
|
|
86
|
+
required: false,
|
|
87
|
+
default: () => []
|
|
88
|
+
},
|
|
89
|
+
tableCode: {
|
|
90
|
+
type: String,
|
|
91
|
+
required: true
|
|
92
|
+
},
|
|
93
|
+
itemTo: {
|
|
94
|
+
type: Function as PropType<(item: RoleOrganisationTypeInfos) => Partial<RouteLocation>>,
|
|
95
|
+
required: false
|
|
96
|
+
},
|
|
97
|
+
},
|
|
98
|
+
emits: ["update:modelValue"],
|
|
99
|
+
setup(props) {
|
|
100
|
+
const { getMany: getManyRoleOrganisationTypes, entities: roleOrganisationTypes, fetching: fetchingRoleOrganisations } = useRoleOrganisationTypes();
|
|
101
|
+
|
|
102
|
+
const isSelected = (id: string): boolean => {
|
|
103
|
+
return props.modelValue.includes(id);
|
|
104
|
+
};
|
|
105
|
+
|
|
106
|
+
watch(() => props.roleOrganisationTypesFilters, (next, previous) => {
|
|
107
|
+
if ((!next && !previous) || !_.isEqual(next, previous)) {
|
|
108
|
+
getManyRoleOrganisationTypes(props.roleOrganisationTypesFilters ?? undefined);
|
|
109
|
+
}
|
|
110
|
+
}, { immediate: true });
|
|
111
|
+
|
|
112
|
+
return {
|
|
113
|
+
fetchingRoleOrganisations,
|
|
114
|
+
roleOrganisationTypes,
|
|
115
|
+
userTypeLabel,
|
|
116
|
+
userTypeIcon,
|
|
117
|
+
isSelected
|
|
118
|
+
};
|
|
119
|
+
}
|
|
120
|
+
});
|
|
121
|
+
</script>
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<FSDataTable
|
|
3
|
+
:items="roleOrganisations"
|
|
4
|
+
:itemTo="$props.itemTo"
|
|
5
|
+
:loading="fetchingRoleOrganisations"
|
|
6
|
+
:tableCode="$props.tableCode"
|
|
7
|
+
:modelValue="$props.modelValue"
|
|
8
|
+
@update:modelValue="$emit('update:modelValue', $event)"
|
|
9
|
+
v-bind="$attrs"
|
|
10
|
+
>
|
|
11
|
+
<template
|
|
12
|
+
v-for="(_, name) in $slots"
|
|
13
|
+
v-slot:[name]="slotData"
|
|
14
|
+
>
|
|
15
|
+
<slot
|
|
16
|
+
:name="name"
|
|
17
|
+
v-bind="slotData"
|
|
18
|
+
/>
|
|
19
|
+
</template>
|
|
20
|
+
<template
|
|
21
|
+
#item.icon="{ item }"
|
|
22
|
+
>
|
|
23
|
+
<FSIcon>
|
|
24
|
+
{{ item.icon }}
|
|
25
|
+
</FSIcon>
|
|
26
|
+
</template>
|
|
27
|
+
<template
|
|
28
|
+
#item.userType="{ item }"
|
|
29
|
+
>
|
|
30
|
+
<FSRow
|
|
31
|
+
align="center-left"
|
|
32
|
+
>
|
|
33
|
+
<FSIcon>
|
|
34
|
+
{{ userTypeIcon(item.userType) }}
|
|
35
|
+
</FSIcon>
|
|
36
|
+
<FSText>
|
|
37
|
+
{{ userTypeLabel(item.userType) }}
|
|
38
|
+
</FSText>
|
|
39
|
+
</FSRow>
|
|
40
|
+
</template>
|
|
41
|
+
<template
|
|
42
|
+
#item.tags="{ item }"
|
|
43
|
+
>
|
|
44
|
+
<FSTagGroup
|
|
45
|
+
variant="slide"
|
|
46
|
+
:editable="false"
|
|
47
|
+
:tags="item.tags"
|
|
48
|
+
/>
|
|
49
|
+
</template>
|
|
50
|
+
</FSDataTable>
|
|
51
|
+
</template>
|
|
52
|
+
|
|
53
|
+
<script lang="ts">
|
|
54
|
+
import type { PropType} from "vue";
|
|
55
|
+
import { defineComponent, watch } from "vue";
|
|
56
|
+
import type { RouteLocation } from "vue-router";
|
|
57
|
+
import _ from "lodash";
|
|
58
|
+
|
|
59
|
+
import type { RoleOrganisationFilters, RoleOrganisationInfos } from "@dative-gpi/foundation-core-domain/models";
|
|
60
|
+
import { userTypeIcon, userTypeLabel } from "@dative-gpi/foundation-core-components/utils";
|
|
61
|
+
import { useRoleOrganisations } from "@dative-gpi/foundation-core-services/composables";
|
|
62
|
+
|
|
63
|
+
import FSDataTable from "../FSDataTable.vue";
|
|
64
|
+
import FSRow from "@dative-gpi/foundation-shared-components/components/FSRow.vue";
|
|
65
|
+
import FSIcon from "@dative-gpi/foundation-shared-components/components/FSIcon.vue";
|
|
66
|
+
import FSText from "@dative-gpi/foundation-shared-components/components/FSText.vue";
|
|
67
|
+
import FSTagGroup from "@dative-gpi/foundation-shared-components/components/FSTagGroup.vue";
|
|
68
|
+
|
|
69
|
+
export default defineComponent({
|
|
70
|
+
name: "FSBaseRoleOrganisationsList",
|
|
71
|
+
components: {
|
|
72
|
+
FSDataTable,
|
|
73
|
+
FSRow,
|
|
74
|
+
FSIcon,
|
|
75
|
+
FSText,
|
|
76
|
+
FSTagGroup
|
|
77
|
+
},
|
|
78
|
+
props: {
|
|
79
|
+
roleOrganisationsFilters: {
|
|
80
|
+
type: Object as PropType<RoleOrganisationFilters | null>,
|
|
81
|
+
required: false,
|
|
82
|
+
default: null
|
|
83
|
+
},
|
|
84
|
+
modelValue: {
|
|
85
|
+
type: Array as PropType<string[]>,
|
|
86
|
+
required: false,
|
|
87
|
+
default: () => []
|
|
88
|
+
},
|
|
89
|
+
tableCode: {
|
|
90
|
+
type: String,
|
|
91
|
+
required: true
|
|
92
|
+
},
|
|
93
|
+
itemTo: {
|
|
94
|
+
type: Function as PropType<(item: RoleOrganisationInfos) => Partial<RouteLocation>>,
|
|
95
|
+
required: false
|
|
96
|
+
},
|
|
97
|
+
},
|
|
98
|
+
emits: ["update:modelValue"],
|
|
99
|
+
setup(props) {
|
|
100
|
+
const { getMany: getManyRoleOrganisations, entities: roleOrganisations, fetching: fetchingRoleOrganisations } = useRoleOrganisations();
|
|
101
|
+
|
|
102
|
+
const isSelected = (id: string): boolean => {
|
|
103
|
+
return props.modelValue.includes(id);
|
|
104
|
+
};
|
|
105
|
+
|
|
106
|
+
watch(() => props.roleOrganisationsFilters, (next, previous) => {
|
|
107
|
+
if ((!next && !previous) || !_.isEqual(next, previous)) {
|
|
108
|
+
getManyRoleOrganisations(props.roleOrganisationsFilters ?? undefined);
|
|
109
|
+
}
|
|
110
|
+
}, { immediate: true });
|
|
111
|
+
|
|
112
|
+
return {
|
|
113
|
+
fetchingRoleOrganisations,
|
|
114
|
+
roleOrganisations,
|
|
115
|
+
userTypeLabel,
|
|
116
|
+
userTypeIcon,
|
|
117
|
+
isSelected
|
|
118
|
+
};
|
|
119
|
+
}
|
|
120
|
+
});
|
|
121
|
+
</script>
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<FSDataTable
|
|
3
|
+
:items="scenarioOrganisationTypes"
|
|
4
|
+
:itemTo="$props.itemTo"
|
|
5
|
+
:loading="fetchingScenarioOrganisationTypes"
|
|
6
|
+
:modelValue="$props.modelValue"
|
|
7
|
+
:tableCode="$props.tableCode"
|
|
8
|
+
@update:modelValue="$emit('update:modelValue', $event)"
|
|
9
|
+
v-bind="$attrs"
|
|
10
|
+
>
|
|
11
|
+
<template
|
|
12
|
+
v-for="(_, name) in $slots"
|
|
13
|
+
v-slot:[name]="slotData"
|
|
14
|
+
>
|
|
15
|
+
<slot
|
|
16
|
+
:name="name"
|
|
17
|
+
v-bind="slotData"
|
|
18
|
+
/>
|
|
19
|
+
</template>
|
|
20
|
+
|
|
21
|
+
<template
|
|
22
|
+
#item.icon="{ item }"
|
|
23
|
+
>
|
|
24
|
+
<FSIcon>
|
|
25
|
+
{{ item.icon }}
|
|
26
|
+
</FSIcon>
|
|
27
|
+
</template>
|
|
28
|
+
|
|
29
|
+
<template
|
|
30
|
+
#item.imageId="{ item }"
|
|
31
|
+
>
|
|
32
|
+
<FSImage
|
|
33
|
+
v-if="item.imageId"
|
|
34
|
+
height="32px"
|
|
35
|
+
width="32px"
|
|
36
|
+
:imageId="item.imageId"
|
|
37
|
+
/>
|
|
38
|
+
</template>
|
|
39
|
+
|
|
40
|
+
<template
|
|
41
|
+
#item.tags="{ item }"
|
|
42
|
+
>
|
|
43
|
+
<FSTagGroup
|
|
44
|
+
variant="slide"
|
|
45
|
+
:editable="false"
|
|
46
|
+
:tags="item.tags"
|
|
47
|
+
/>
|
|
48
|
+
</template>
|
|
49
|
+
</FSDataTable>
|
|
50
|
+
</template>
|
|
51
|
+
|
|
52
|
+
<script lang="ts">
|
|
53
|
+
import { defineComponent, type PropType, watch } from "vue";
|
|
54
|
+
import type { RouteLocation } from "vue-router";
|
|
55
|
+
import _ from "lodash";
|
|
56
|
+
|
|
57
|
+
import type { ScenarioOrganisationTypeFilters, ScenarioOrganisationTypeInfos } from "@dative-gpi/foundation-core-domain/models";
|
|
58
|
+
import { useScenarioOrganisationTypes } from "@dative-gpi/foundation-core-services/composables";
|
|
59
|
+
|
|
60
|
+
import FSDataTable from "../FSDataTable.vue";
|
|
61
|
+
import FSIcon from "@dative-gpi/foundation-shared-components/components/FSIcon.vue";
|
|
62
|
+
import FSImage from "@dative-gpi/foundation-shared-components/components/FSImage.vue";
|
|
63
|
+
import FSTagGroup from "@dative-gpi/foundation-shared-components/components/FSTagGroup.vue";
|
|
64
|
+
|
|
65
|
+
export default defineComponent({
|
|
66
|
+
name: "FSBaseScenarioOrganisationTypesList",
|
|
67
|
+
components: {
|
|
68
|
+
FSDataTable,
|
|
69
|
+
FSIcon,
|
|
70
|
+
FSImage,
|
|
71
|
+
FSTagGroup
|
|
72
|
+
},
|
|
73
|
+
props: {
|
|
74
|
+
modelValue: {
|
|
75
|
+
type: Array as PropType<string[]>,
|
|
76
|
+
default: () => [],
|
|
77
|
+
required: false
|
|
78
|
+
},
|
|
79
|
+
scenarioOrganisationTypeFilters: {
|
|
80
|
+
type: Object as PropType<ScenarioOrganisationTypeFilters>,
|
|
81
|
+
required: false,
|
|
82
|
+
default: null
|
|
83
|
+
},
|
|
84
|
+
tableCode: {
|
|
85
|
+
type: String,
|
|
86
|
+
required: true
|
|
87
|
+
},
|
|
88
|
+
itemTo: {
|
|
89
|
+
type: Function as PropType<(item: ScenarioOrganisationTypeInfos) => Partial<RouteLocation>>,
|
|
90
|
+
required: false
|
|
91
|
+
},
|
|
92
|
+
},
|
|
93
|
+
emits: ["update:modelValue"],
|
|
94
|
+
setup(props) {
|
|
95
|
+
const { entities: scenarioOrganisationTypes, fetching: fetchingScenarioOrganisationTypes, getMany: getManyScenarioOrganisationTypes } = useScenarioOrganisationTypes();
|
|
96
|
+
|
|
97
|
+
const isSelected = (id: string): boolean => {
|
|
98
|
+
return props.modelValue.includes(id);
|
|
99
|
+
};
|
|
100
|
+
|
|
101
|
+
watch(() => props.scenarioOrganisationTypeFilters, (next, previous) => {
|
|
102
|
+
if ((!next && !previous) || !_.isEqual(next, previous)) {
|
|
103
|
+
getManyScenarioOrganisationTypes(props.scenarioOrganisationTypeFilters);
|
|
104
|
+
}
|
|
105
|
+
}, { immediate: true });
|
|
106
|
+
|
|
107
|
+
return {
|
|
108
|
+
fetchingScenarioOrganisationTypes,
|
|
109
|
+
scenarioOrganisationTypes,
|
|
110
|
+
isSelected
|
|
111
|
+
};
|
|
112
|
+
}
|
|
113
|
+
});
|
|
114
|
+
</script>
|