@dative-gpi/foundation-core-components 1.0.29 → 1.0.30
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 +2 -2
- package/components/autocompletes/FSAutocompleteDashboard.vue +1 -0
- package/components/autocompletes/FSAutocompleteDataDefinition.vue +1 -1
- package/components/autocompletes/FSAutocompleteModel.vue +1 -1
- package/components/autocompletes/FSAutocompleteRole.vue +2 -2
- package/components/autocompletes/FSAutocompleteServiceAccountRoleOrganisation.vue +120 -0
- package/components/autocompletes/FSAutocompleteUserOrganisation.vue +7 -18
- package/package.json +7 -7
- package/components/selects/FSDataCategorySelector.vue +0 -139
- package/components/selects/FSDataDefinitionSelector.vue +0 -105
- package/components/selects/FSModelSelector.vue +0 -56
|
@@ -67,6 +67,7 @@
|
|
|
67
67
|
@click="props.toggle(props.item)"
|
|
68
68
|
>
|
|
69
69
|
<template
|
|
70
|
+
v-if="props.item.type"
|
|
70
71
|
#append
|
|
71
72
|
>
|
|
72
73
|
<FSChip
|
|
@@ -179,7 +180,7 @@ export default defineComponent({
|
|
|
179
180
|
]);
|
|
180
181
|
};
|
|
181
182
|
|
|
182
|
-
const { toggleSet,
|
|
183
|
+
const { toggleSet, init, onUpdate } = useAutocomplete(
|
|
183
184
|
charts,
|
|
184
185
|
[() => props.chartOrganisationTypeFilters, () => props.chartOrganisationFilters],
|
|
185
186
|
emit,
|
|
@@ -190,7 +191,6 @@ export default defineComponent({
|
|
|
190
191
|
return {
|
|
191
192
|
toggleSet,
|
|
192
193
|
loading,
|
|
193
|
-
search,
|
|
194
194
|
charts,
|
|
195
195
|
chartOriginColor,
|
|
196
196
|
chartOriginLabel,
|
|
@@ -67,6 +67,7 @@
|
|
|
67
67
|
@click="props.toggle(props.item)"
|
|
68
68
|
>
|
|
69
69
|
<template
|
|
70
|
+
v-if="props.item.type"
|
|
70
71
|
#append
|
|
71
72
|
>
|
|
72
73
|
<FSChip
|
|
@@ -179,7 +180,7 @@ export default defineComponent({
|
|
|
179
180
|
]);
|
|
180
181
|
};
|
|
181
182
|
|
|
182
|
-
const { toggleSet,
|
|
183
|
+
const { toggleSet, init, onUpdate } = useAutocomplete(
|
|
183
184
|
roles,
|
|
184
185
|
[() => props.roleOrganisationTypeFilters, () => props.roleOrganisationFilters],
|
|
185
186
|
emit,
|
|
@@ -191,7 +192,6 @@ export default defineComponent({
|
|
|
191
192
|
toggleSet,
|
|
192
193
|
RoleType,
|
|
193
194
|
loading,
|
|
194
|
-
search,
|
|
195
195
|
roles,
|
|
196
196
|
roleTypeColor,
|
|
197
197
|
roleTypeLabel,
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<FSAutocompleteField
|
|
3
|
+
:toggleSet="!$props.toggleSetDisabled && toggleSet"
|
|
4
|
+
:items="serviceAccountRoleOrganisations"
|
|
5
|
+
:multiple="$props.multiple"
|
|
6
|
+
:loading="loading"
|
|
7
|
+
:modelValue="$props.modelValue"
|
|
8
|
+
@update:modelValue="onUpdate"
|
|
9
|
+
v-bind="$attrs"
|
|
10
|
+
>
|
|
11
|
+
<template
|
|
12
|
+
#autocomplete-selection="{ item }"
|
|
13
|
+
>
|
|
14
|
+
<FSRow
|
|
15
|
+
v-if="$props.modelValue"
|
|
16
|
+
align="center-center"
|
|
17
|
+
:wrap="false"
|
|
18
|
+
>
|
|
19
|
+
<FSIcon
|
|
20
|
+
v-if="item.raw.icon"
|
|
21
|
+
>
|
|
22
|
+
{{ item.raw.icon }}
|
|
23
|
+
</FSIcon>
|
|
24
|
+
<FSSpan>
|
|
25
|
+
{{ item.raw.label }}
|
|
26
|
+
</FSSpan>
|
|
27
|
+
</FSRow>
|
|
28
|
+
</template>
|
|
29
|
+
<template
|
|
30
|
+
#item-label="{ item, font }"
|
|
31
|
+
>
|
|
32
|
+
<FSRow
|
|
33
|
+
align="center-left"
|
|
34
|
+
:wrap="false"
|
|
35
|
+
>
|
|
36
|
+
<FSIcon
|
|
37
|
+
v-if="item.raw.icon"
|
|
38
|
+
>
|
|
39
|
+
{{ item.raw.icon }}
|
|
40
|
+
</FSIcon>
|
|
41
|
+
<FSSpan
|
|
42
|
+
:font="font"
|
|
43
|
+
>
|
|
44
|
+
{{ item.raw.label }}
|
|
45
|
+
</FSSpan>
|
|
46
|
+
</FSRow>
|
|
47
|
+
</template>
|
|
48
|
+
</FSAutocompleteField>
|
|
49
|
+
</template>
|
|
50
|
+
|
|
51
|
+
<script lang="ts">
|
|
52
|
+
import { computed, defineComponent, type PropType } from "vue";
|
|
53
|
+
|
|
54
|
+
import { type ServiceAccountRoleOrganisationsFilters } from "@dative-gpi/foundation-core-domain/models";
|
|
55
|
+
import { useServiceAccountRoleOrganisations } from "@dative-gpi/foundation-core-services/composables";
|
|
56
|
+
import { useAutocomplete } from "@dative-gpi/foundation-shared-components/composables";
|
|
57
|
+
|
|
58
|
+
import FSAutocompleteField from "@dative-gpi/foundation-shared-components/components/fields/FSAutocompleteField.vue";
|
|
59
|
+
import FSIcon from "@dative-gpi/foundation-shared-components/components/FSIcon.vue";
|
|
60
|
+
import FSSpan from "@dative-gpi/foundation-shared-components/components/FSSpan.vue";
|
|
61
|
+
import FSRow from "@dative-gpi/foundation-shared-components/components/FSRow.vue";
|
|
62
|
+
|
|
63
|
+
export default defineComponent({
|
|
64
|
+
name: "FSAutocompleteServiceAccountRoleOrganisation",
|
|
65
|
+
components: {
|
|
66
|
+
FSAutocompleteField,
|
|
67
|
+
FSIcon,
|
|
68
|
+
FSSpan,
|
|
69
|
+
FSRow
|
|
70
|
+
},
|
|
71
|
+
props: {
|
|
72
|
+
serviceAccountRoleOrganisationsFilters: {
|
|
73
|
+
type: Object as PropType<ServiceAccountRoleOrganisationsFilters>,
|
|
74
|
+
required: false,
|
|
75
|
+
default: null
|
|
76
|
+
},
|
|
77
|
+
modelValue: {
|
|
78
|
+
type: [Array, String] as PropType<string[] | string | null>,
|
|
79
|
+
required: false,
|
|
80
|
+
default: null
|
|
81
|
+
},
|
|
82
|
+
multiple: {
|
|
83
|
+
type: Boolean,
|
|
84
|
+
required: false,
|
|
85
|
+
default: false
|
|
86
|
+
},
|
|
87
|
+
toggleSetDisabled: {
|
|
88
|
+
type: Boolean,
|
|
89
|
+
required: false,
|
|
90
|
+
default: false
|
|
91
|
+
}
|
|
92
|
+
},
|
|
93
|
+
emits: ["update:modelValue"],
|
|
94
|
+
setup(props, { emit }) {
|
|
95
|
+
const { getMany: getManyServiceAccountRoleOrganisations, fetching: fetchingServiceAccountRoleOrganisations, entities: serviceAccountRoleOrganisations } = useServiceAccountRoleOrganisations();
|
|
96
|
+
|
|
97
|
+
const loading = computed((): boolean => {
|
|
98
|
+
return init.value && fetchingServiceAccountRoleOrganisations.value;
|
|
99
|
+
});
|
|
100
|
+
|
|
101
|
+
const fetch = (search: string | null) => {
|
|
102
|
+
return getManyServiceAccountRoleOrganisations({ ...props.serviceAccountRoleOrganisationsFilters, search: search ?? undefined })
|
|
103
|
+
};
|
|
104
|
+
|
|
105
|
+
const { toggleSet, init, onUpdate } = useAutocomplete(
|
|
106
|
+
serviceAccountRoleOrganisations,
|
|
107
|
+
[() => props.serviceAccountRoleOrganisationsFilters],
|
|
108
|
+
emit,
|
|
109
|
+
fetch
|
|
110
|
+
);
|
|
111
|
+
|
|
112
|
+
return {
|
|
113
|
+
serviceAccountRoleOrganisations,
|
|
114
|
+
toggleSet,
|
|
115
|
+
loading,
|
|
116
|
+
onUpdate
|
|
117
|
+
};
|
|
118
|
+
}
|
|
119
|
+
});
|
|
120
|
+
</script>
|
|
@@ -53,24 +53,22 @@
|
|
|
53
53
|
>
|
|
54
54
|
<FSButton
|
|
55
55
|
:variant="props.getVariant(props.item)"
|
|
56
|
+
:padding="['6px 16px', '4px 12px']"
|
|
56
57
|
:color="props.getColor(props.item)"
|
|
57
58
|
:class="props.getClass(props.item)"
|
|
59
|
+
:label="props.item.name"
|
|
58
60
|
@click="props.toggle(props.item)"
|
|
59
61
|
>
|
|
60
|
-
<
|
|
61
|
-
|
|
62
|
-
|
|
62
|
+
<template
|
|
63
|
+
v-if="props.item.imageId"
|
|
64
|
+
#prepend
|
|
63
65
|
>
|
|
64
66
|
<FSImage
|
|
65
|
-
v-if="props.item.imageId"
|
|
66
67
|
height="26px"
|
|
67
68
|
width="26px"
|
|
68
69
|
:imageId="props.item.imageId"
|
|
69
70
|
/>
|
|
70
|
-
|
|
71
|
-
{{ props.item.name }}
|
|
72
|
-
</FSSpan>
|
|
73
|
-
</FSRow>
|
|
71
|
+
</template>
|
|
74
72
|
</FSButton>
|
|
75
73
|
</template>
|
|
76
74
|
</FSAutocompleteField>
|
|
@@ -127,19 +125,12 @@ export default defineComponent({
|
|
|
127
125
|
const loading = computed((): boolean => {
|
|
128
126
|
return init.value && fetchingUserOrganisations.value;
|
|
129
127
|
});
|
|
130
|
-
|
|
131
|
-
const toggleSetItems = computed((): any[] => {
|
|
132
|
-
return userOrganisations.value.map((userOrganisation: UserOrganisationInfos) => ({
|
|
133
|
-
id: userOrganisation.id,
|
|
134
|
-
label: userOrganisation.name
|
|
135
|
-
}));
|
|
136
|
-
});
|
|
137
128
|
|
|
138
129
|
const fetch = (search: string | null) => {
|
|
139
130
|
return getManyUserOrganisations({ ...props.userOrganisationFilters, search: search ?? undefined });
|
|
140
131
|
};
|
|
141
132
|
|
|
142
|
-
const { toggleSet,
|
|
133
|
+
const { toggleSet, init, onUpdate } = useAutocomplete(
|
|
143
134
|
userOrganisations,
|
|
144
135
|
[() => props.userOrganisationFilters],
|
|
145
136
|
emit,
|
|
@@ -151,10 +142,8 @@ export default defineComponent({
|
|
|
151
142
|
|
|
152
143
|
return {
|
|
153
144
|
userOrganisations,
|
|
154
|
-
toggleSetItems,
|
|
155
145
|
toggleSet,
|
|
156
146
|
loading,
|
|
157
|
-
search,
|
|
158
147
|
onUpdate
|
|
159
148
|
};
|
|
160
149
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dative-gpi/foundation-core-components",
|
|
3
3
|
"sideEffects": false,
|
|
4
|
-
"version": "1.0.
|
|
4
|
+
"version": "1.0.30",
|
|
5
5
|
"description": "",
|
|
6
6
|
"publishConfig": {
|
|
7
7
|
"access": "public"
|
|
@@ -10,11 +10,11 @@
|
|
|
10
10
|
"author": "",
|
|
11
11
|
"license": "ISC",
|
|
12
12
|
"dependencies": {
|
|
13
|
-
"@dative-gpi/foundation-core-domain": "1.0.
|
|
14
|
-
"@dative-gpi/foundation-core-services": "1.0.
|
|
15
|
-
"@dative-gpi/foundation-shared-components": "1.0.
|
|
16
|
-
"@dative-gpi/foundation-shared-domain": "1.0.
|
|
17
|
-
"@dative-gpi/foundation-shared-services": "1.0.
|
|
13
|
+
"@dative-gpi/foundation-core-domain": "1.0.30",
|
|
14
|
+
"@dative-gpi/foundation-core-services": "1.0.30",
|
|
15
|
+
"@dative-gpi/foundation-shared-components": "1.0.30",
|
|
16
|
+
"@dative-gpi/foundation-shared-domain": "1.0.30",
|
|
17
|
+
"@dative-gpi/foundation-shared-services": "1.0.30"
|
|
18
18
|
},
|
|
19
19
|
"peerDependencies": {
|
|
20
20
|
"@dative-gpi/bones-ui": "^0.0.75",
|
|
@@ -26,5 +26,5 @@
|
|
|
26
26
|
"sass": "1.71.1",
|
|
27
27
|
"sass-loader": "13.3.2"
|
|
28
28
|
},
|
|
29
|
-
"gitHead": "
|
|
29
|
+
"gitHead": "33f1a6d59ab513176b3710729a39ec701462fdfb"
|
|
30
30
|
}
|
|
@@ -1,139 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<FSAutocompleteField
|
|
3
|
-
:width="$props.width ? $props.width : '100%'"
|
|
4
|
-
:label="label ?? $tr('ui.common.data-category', 'Data category')"
|
|
5
|
-
:items="toggleDataCategories"
|
|
6
|
-
:modelValue="modelValue"
|
|
7
|
-
@update:modelValue="$emit('update:modelValue', $event)"
|
|
8
|
-
v-bind="$attrs"
|
|
9
|
-
>
|
|
10
|
-
<template
|
|
11
|
-
#autocomplete-selection="{item}"
|
|
12
|
-
>
|
|
13
|
-
<FSRow
|
|
14
|
-
:wrap="false"
|
|
15
|
-
align="center-center"
|
|
16
|
-
:width="$props.width ? $props.width : '100vh'"
|
|
17
|
-
>
|
|
18
|
-
<FSCol>
|
|
19
|
-
<FSText>
|
|
20
|
-
{{ item.raw.label }}
|
|
21
|
-
</FSText>
|
|
22
|
-
</FSCol>
|
|
23
|
-
<FSRow>
|
|
24
|
-
<FSRow
|
|
25
|
-
align="center-right"
|
|
26
|
-
>
|
|
27
|
-
<FSChip
|
|
28
|
-
:label="item.raw.unit"
|
|
29
|
-
:color="item.raw.correlated ? ColorEnum.Success : ColorEnum.Warning"
|
|
30
|
-
>
|
|
31
|
-
<FSRow
|
|
32
|
-
v-if="item.raw.correlated"
|
|
33
|
-
align="center-center"
|
|
34
|
-
:wrap="false"
|
|
35
|
-
>
|
|
36
|
-
<FSIcon
|
|
37
|
-
icon="mdi-link"
|
|
38
|
-
size="16px"
|
|
39
|
-
/>
|
|
40
|
-
<FSText
|
|
41
|
-
font="text-overline"
|
|
42
|
-
>
|
|
43
|
-
{{ $tr('ui.common.linked', 'Linked') }}
|
|
44
|
-
</FSText>
|
|
45
|
-
</FSRow>
|
|
46
|
-
<FSRow
|
|
47
|
-
v-else
|
|
48
|
-
align="center-center"
|
|
49
|
-
:wrap="false"
|
|
50
|
-
>
|
|
51
|
-
<FSIcon
|
|
52
|
-
icon="mdi-link-off"
|
|
53
|
-
size="16px"
|
|
54
|
-
/>
|
|
55
|
-
<FSSpan
|
|
56
|
-
font="text-overline"
|
|
57
|
-
>
|
|
58
|
-
{{ $tr('ui.common.not-linked', 'Not linked') }}
|
|
59
|
-
</FSSpan>
|
|
60
|
-
</FSRow>
|
|
61
|
-
</FSChip>
|
|
62
|
-
</FSRow>
|
|
63
|
-
</FSRow>
|
|
64
|
-
</FSRow>
|
|
65
|
-
</template></FSAutocompleteField>
|
|
66
|
-
</template>
|
|
67
|
-
|
|
68
|
-
<script lang="ts">
|
|
69
|
-
import { computed, defineComponent, watch } from "vue";
|
|
70
|
-
|
|
71
|
-
import { ColorEnum } from "@dative-gpi/foundation-shared-components/models";
|
|
72
|
-
|
|
73
|
-
import {useDataCategories} from "@dative-gpi/foundation-core-services/composables";
|
|
74
|
-
|
|
75
|
-
import FSAutocompleteField from "@dative-gpi/foundation-shared-components/components/fields/FSAutocompleteField.vue";
|
|
76
|
-
import FSChip from "@dative-gpi/foundation-shared-components/components/FSChip.vue";
|
|
77
|
-
import FSRow from "@dative-gpi/foundation-shared-components/components/FSRow.vue";
|
|
78
|
-
import FSCol from "@dative-gpi/foundation-shared-components/components/FSCol.vue";
|
|
79
|
-
import FSText from "@dative-gpi/foundation-shared-components/components/FSText.vue";
|
|
80
|
-
import FSIcon from "@dative-gpi/foundation-shared-components/components/FSIcon.vue";
|
|
81
|
-
import FSSpan from "@dative-gpi/foundation-shared-components/components/FSSpan.vue";
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
export default defineComponent({
|
|
85
|
-
components: {
|
|
86
|
-
FSAutocompleteField,
|
|
87
|
-
FSChip,
|
|
88
|
-
FSRow,
|
|
89
|
-
FSCol,
|
|
90
|
-
FSText,
|
|
91
|
-
FSIcon,
|
|
92
|
-
FSSpan
|
|
93
|
-
},
|
|
94
|
-
props:{
|
|
95
|
-
modelValue: {
|
|
96
|
-
type: String,
|
|
97
|
-
required: false
|
|
98
|
-
},
|
|
99
|
-
modelId: {
|
|
100
|
-
type: String,
|
|
101
|
-
required: false,
|
|
102
|
-
},
|
|
103
|
-
label: {
|
|
104
|
-
type: String,
|
|
105
|
-
required: false
|
|
106
|
-
},
|
|
107
|
-
width: {
|
|
108
|
-
type: String,
|
|
109
|
-
required: false
|
|
110
|
-
}
|
|
111
|
-
},
|
|
112
|
-
emits: ['update:modelValue'],
|
|
113
|
-
setup(props) {
|
|
114
|
-
const {getMany : fetchdataCategories, entities : dataCategories} = useDataCategories()
|
|
115
|
-
|
|
116
|
-
const toggleDataCategories = computed(()=>{
|
|
117
|
-
return dataCategories.value.map((d) => {
|
|
118
|
-
return {
|
|
119
|
-
id: d.id,
|
|
120
|
-
label: d.label,
|
|
121
|
-
correlated: d.correlated
|
|
122
|
-
}
|
|
123
|
-
})
|
|
124
|
-
})
|
|
125
|
-
|
|
126
|
-
watch(() => props.modelId, () => {
|
|
127
|
-
fetchdataCategories({modelId: props.modelId})
|
|
128
|
-
}, {immediate: true})
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
return {
|
|
132
|
-
ColorEnum,
|
|
133
|
-
toggleDataCategories,
|
|
134
|
-
dataCategories
|
|
135
|
-
}
|
|
136
|
-
}
|
|
137
|
-
})
|
|
138
|
-
|
|
139
|
-
</script>
|
|
@@ -1,105 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<FSAutocompleteField
|
|
3
|
-
:width="$props.width ? $props.width : '100%'"
|
|
4
|
-
:label="label ?? $tr('ui.common.data-definition', 'Data')"
|
|
5
|
-
:items="toggleDataDefinitions"
|
|
6
|
-
:modelValue="modelValue"
|
|
7
|
-
@update:modelValue="$emit('update:modelValue', $event)"
|
|
8
|
-
v-bind="$attrs"
|
|
9
|
-
>
|
|
10
|
-
<template
|
|
11
|
-
#autocomplete-selection="{item}"
|
|
12
|
-
>
|
|
13
|
-
<FSRow
|
|
14
|
-
:wrap="false"
|
|
15
|
-
align="center-center"
|
|
16
|
-
:width="$props.width ? $props.width : '100vh'"
|
|
17
|
-
>
|
|
18
|
-
<FSCol>
|
|
19
|
-
<FSText>
|
|
20
|
-
{{ item.raw.label }}
|
|
21
|
-
</FSText>
|
|
22
|
-
</FSCol>
|
|
23
|
-
<FSRow
|
|
24
|
-
v-if="item.raw.showUnit"
|
|
25
|
-
>
|
|
26
|
-
<FSRow
|
|
27
|
-
align="center-right"
|
|
28
|
-
>
|
|
29
|
-
<FSChip
|
|
30
|
-
:label="item.raw.unit"
|
|
31
|
-
/>
|
|
32
|
-
</FSRow>
|
|
33
|
-
</FSRow>
|
|
34
|
-
</FSRow>
|
|
35
|
-
</template>
|
|
36
|
-
</FSAutocompleteField>
|
|
37
|
-
</template>
|
|
38
|
-
|
|
39
|
-
<script lang="ts">
|
|
40
|
-
import { computed, defineComponent, watch } from "vue";
|
|
41
|
-
|
|
42
|
-
import {useDataDefinitions} from "@dative-gpi/foundation-core-services/composables";
|
|
43
|
-
|
|
44
|
-
import FSAutocompleteField from "@dative-gpi/foundation-shared-components/components/fields/FSAutocompleteField.vue";
|
|
45
|
-
import FSChip from "@dative-gpi/foundation-shared-components/components/FSChip.vue";
|
|
46
|
-
import FSRow from "@dative-gpi/foundation-shared-components/components/FSRow.vue";
|
|
47
|
-
import FSCol from "@dative-gpi/foundation-shared-components/components/FSCol.vue";
|
|
48
|
-
|
|
49
|
-
export default defineComponent({
|
|
50
|
-
components: {
|
|
51
|
-
FSAutocompleteField,
|
|
52
|
-
FSChip,
|
|
53
|
-
FSRow,
|
|
54
|
-
FSCol,
|
|
55
|
-
},
|
|
56
|
-
props:{
|
|
57
|
-
modelValue: {
|
|
58
|
-
type: String,
|
|
59
|
-
required: false
|
|
60
|
-
},
|
|
61
|
-
modelId: {
|
|
62
|
-
type: String,
|
|
63
|
-
required: false,
|
|
64
|
-
},
|
|
65
|
-
dataCategoryId: {
|
|
66
|
-
type: String,
|
|
67
|
-
required: false,
|
|
68
|
-
},
|
|
69
|
-
label: {
|
|
70
|
-
type: String,
|
|
71
|
-
required: false
|
|
72
|
-
},
|
|
73
|
-
width : {
|
|
74
|
-
type: String,
|
|
75
|
-
required: false
|
|
76
|
-
}
|
|
77
|
-
},
|
|
78
|
-
emits: ['update:modelValue'],
|
|
79
|
-
setup(props) {
|
|
80
|
-
|
|
81
|
-
const {getMany : fetchDataDefinitions, entities : dataDefinitions} = useDataDefinitions()
|
|
82
|
-
|
|
83
|
-
const toggleDataDefinitions = computed(()=>{
|
|
84
|
-
return dataDefinitions.value.map((d) => {
|
|
85
|
-
return {
|
|
86
|
-
id: d.id,
|
|
87
|
-
label: d.label,
|
|
88
|
-
showUnit : d.unit && d.unit.trim().length > 0,
|
|
89
|
-
unit : d.unit,
|
|
90
|
-
}
|
|
91
|
-
})
|
|
92
|
-
})
|
|
93
|
-
|
|
94
|
-
watch(() => [props.modelId, props.dataCategoryId], async () => {
|
|
95
|
-
await fetchDataDefinitions({modelsIds: props.modelId ? [props.modelId] : undefined, dataCategoryId: props.dataCategoryId})
|
|
96
|
-
}, {immediate: true})
|
|
97
|
-
|
|
98
|
-
return {
|
|
99
|
-
toggleDataDefinitions,
|
|
100
|
-
dataDefinitions
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
})
|
|
104
|
-
|
|
105
|
-
</script>
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<FSAutocompleteField
|
|
3
|
-
:label="label ?? $tr('ui.common.model', 'Model')"
|
|
4
|
-
:items="modelItems"
|
|
5
|
-
:toggleSet="modelItems.length < 5"
|
|
6
|
-
:modelValue="modelValue"
|
|
7
|
-
@update:modelValue="$emit('update:modelValue', $event)"
|
|
8
|
-
v-bind="$attrs"
|
|
9
|
-
/>
|
|
10
|
-
</template>
|
|
11
|
-
|
|
12
|
-
<script lang="ts">
|
|
13
|
-
import { computed, defineComponent, onMounted } from "vue";
|
|
14
|
-
|
|
15
|
-
import {useModels} from "@dative-gpi/foundation-core-services/composables";
|
|
16
|
-
|
|
17
|
-
import FSAutocompleteField from "@dative-gpi/foundation-shared-components/components/fields/FSAutocompleteField.vue";
|
|
18
|
-
|
|
19
|
-
export default defineComponent({
|
|
20
|
-
components: {
|
|
21
|
-
FSAutocompleteField
|
|
22
|
-
},
|
|
23
|
-
props:{
|
|
24
|
-
modelValue: {
|
|
25
|
-
type: String,
|
|
26
|
-
required: false
|
|
27
|
-
},
|
|
28
|
-
label: {
|
|
29
|
-
type: String,
|
|
30
|
-
required: false
|
|
31
|
-
}
|
|
32
|
-
},
|
|
33
|
-
emits: ['update:modelValue'],
|
|
34
|
-
setup(){
|
|
35
|
-
const {getMany : fetchModels, entities : models} = useModels()
|
|
36
|
-
|
|
37
|
-
const modelItems = computed(()=>{
|
|
38
|
-
return models.value.map((d) => {
|
|
39
|
-
return {
|
|
40
|
-
id: d.id,
|
|
41
|
-
label: d.label
|
|
42
|
-
}
|
|
43
|
-
})
|
|
44
|
-
})
|
|
45
|
-
|
|
46
|
-
onMounted(() => {
|
|
47
|
-
fetchModels()
|
|
48
|
-
})
|
|
49
|
-
|
|
50
|
-
return {
|
|
51
|
-
modelItems,
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
})
|
|
55
|
-
|
|
56
|
-
</script>
|