@dative-gpi/foundation-core-components 1.0.139 → 1.0.140-selectable
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 +0 -2
- package/components/autocompletes/FSAutocompleteDashboard.vue +0 -2
- package/components/autocompletes/FSAutocompleteRole.vue +0 -2
- package/components/customProperties/FSMetaField.vue +8 -8
- package/components/customProperties/FSMetaFormContent.vue +4 -3
- package/components/customProperties/helpers.ts +3 -113
- package/components/entities/FSEntityField.vue +3 -3
- package/components/explorers/FSBaseDevicesExplorer.vue +3 -3
- package/components/explorers/FSBaseFoldersExplorer.vue +1 -1
- package/components/lists/alerts/FSBaseAlertsList.vue +3 -3
- package/components/lists/authTokens/FSBaseAuthTokensList.vue +1 -0
- package/components/lists/chartOrganisationTypes/FSBaseChartOrganisationTypesList.vue +19 -5
- package/components/lists/chartOrganisations/FSBaseChartOrganisationsList.vue +31 -17
- package/components/lists/charts/FSBaseChartsList.vue +24 -8
- package/components/lists/dashboardOrganisationTypes/FSBaseDashboardOrganisationTypesList.vue +18 -1
- package/components/lists/dashboards/FSBaseDashboardsList.vue +20 -2
- package/components/lists/dashboards/FSSimpleDashboardsList.vue +13 -3
- package/components/lists/deviceOrganisations/FSBaseDeviceOrganisationsList.vue +4 -3
- package/components/lists/folders/FSBaseFoldersList.vue +1 -1
- package/components/lists/groups/FSBaseGroupsList.vue +4 -4
- package/components/lists/locations/FSBaseLocationsList.vue +3 -3
- package/components/lists/models/FSBaseModelsList.vue +2 -2
- package/components/lists/roleOrganisationTypes/FSBaseRoleOrganisationTypesList.vue +3 -3
- package/components/lists/roleOrganisations/FSBaseRoleOrganisationsList.vue +3 -3
- package/components/lists/scenarioOrganisationTypes/FSBaseScenarioOrganisationTypesList.vue +3 -3
- package/components/lists/scenarioOrganisations/FSBaseScenarioOrganisationsList.vue +3 -3
- package/components/lists/scenarios/FSBaseScenariosList.vue +1 -1
- package/components/lists/serviceAccountOrganisations/FSBaseServiceAccountOrganisationsList.vue +4 -4
- package/components/lists/serviceAccountRoleOrganisations/FSBaseServiceAccountRoleOrganisationsList.vue +3 -3
- package/components/lists/userOrganisations/FSBaseUserOrganisationsList.vue +4 -4
- 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 +3 -3
- package/components/tiles/FSGroupTile.vue +3 -3
- package/components/tiles/FSLocationTile.vue +4 -3
- package/components/tiles/FSServiceAccountOrganisationTile.vue +3 -3
- package/components/tiles/FSUserOrganisationTile.vue +3 -3
- package/package.json +7 -7
- package/components/lists/reports/FSBaseReportExecutionsList.vue +0 -137
- package/components/lists/reports/FSBaseReportsList.vue +0 -135
|
@@ -25,7 +25,6 @@
|
|
|
25
25
|
<FSChip
|
|
26
26
|
:color="chartOriginColor(item.type)"
|
|
27
27
|
:label="chartOriginLabel(item.type)"
|
|
28
|
-
:editable="false"
|
|
29
28
|
/>
|
|
30
29
|
</template>
|
|
31
30
|
<template
|
|
@@ -46,7 +45,6 @@
|
|
|
46
45
|
<FSChip
|
|
47
46
|
:color="chartOriginColor(props.item.type)"
|
|
48
47
|
:label="chartOriginLabel(props.item.type)"
|
|
49
|
-
:editable="false"
|
|
50
48
|
/>
|
|
51
49
|
</template>
|
|
52
50
|
</FSButton>
|
|
@@ -25,7 +25,6 @@
|
|
|
25
25
|
<FSChip
|
|
26
26
|
:color="dashboardTypeColor(item.type)"
|
|
27
27
|
:label="dashboardTypeLabel(item.type)"
|
|
28
|
-
:editable="false"
|
|
29
28
|
/>
|
|
30
29
|
</template>
|
|
31
30
|
<template
|
|
@@ -46,7 +45,6 @@
|
|
|
46
45
|
<FSChip
|
|
47
46
|
:color="dashboardTypeColor(props.item.type)"
|
|
48
47
|
:label="dashboardTypeLabel(props.item.type)"
|
|
49
|
-
:editable="false"
|
|
50
48
|
/>
|
|
51
49
|
</template>
|
|
52
50
|
</FSButton>
|
|
@@ -25,7 +25,6 @@
|
|
|
25
25
|
<FSChip
|
|
26
26
|
:color="roleTypeColor(item.type)"
|
|
27
27
|
:label="roleTypeLabel(item.type)"
|
|
28
|
-
:editable="false"
|
|
29
28
|
/>
|
|
30
29
|
</template>
|
|
31
30
|
<template
|
|
@@ -46,7 +45,6 @@
|
|
|
46
45
|
<FSChip
|
|
47
46
|
:color="roleTypeColor(props.item.type)"
|
|
48
47
|
:label="roleTypeLabel(props.item.type)"
|
|
49
|
-
:editable="false"
|
|
50
48
|
/>
|
|
51
49
|
</template>
|
|
52
50
|
</FSButton>
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<FSSelectField
|
|
3
3
|
v-if="$props.customProperty.useOnlyAllowedValues"
|
|
4
|
-
:
|
|
4
|
+
:disabled="$props.disabled"
|
|
5
5
|
:itemTitle="itemTitle"
|
|
6
6
|
:label="$props.label"
|
|
7
7
|
:class="classes"
|
|
@@ -30,35 +30,35 @@
|
|
|
30
30
|
>
|
|
31
31
|
<FSNumberField
|
|
32
32
|
v-if="$props.customProperty.dataType === PropertyDataType.Number"
|
|
33
|
-
:
|
|
33
|
+
:disabled="$props.disabled"
|
|
34
34
|
:label="$props.label"
|
|
35
35
|
:modelValue="asNumber()"
|
|
36
36
|
@update:modelValue="onUpdate"
|
|
37
37
|
/>
|
|
38
38
|
<FSSwitch
|
|
39
39
|
v-else-if="$props.customProperty.dataType === PropertyDataType.Boolean"
|
|
40
|
-
:
|
|
40
|
+
:disabled="$props.disabled"
|
|
41
41
|
:label="$props.label"
|
|
42
42
|
:modelValue="asBoolean()"
|
|
43
43
|
@update:modelValue="onUpdate"
|
|
44
44
|
/>
|
|
45
45
|
<FSTextField
|
|
46
46
|
v-else-if="$props.customProperty.dataType === PropertyDataType.String"
|
|
47
|
-
:
|
|
47
|
+
:disabled="$props.disabled"
|
|
48
48
|
:label="$props.label"
|
|
49
49
|
:modelValue="$props.modelValue"
|
|
50
50
|
@update:modelValue="onUpdate"
|
|
51
51
|
/>
|
|
52
52
|
<FSDateTimeField
|
|
53
53
|
v-else-if="$props.customProperty.dataType === PropertyDataType.DateTime"
|
|
54
|
-
:
|
|
54
|
+
:disabled="$props.disabled"
|
|
55
55
|
:label="$props.label"
|
|
56
56
|
:modelValue="asNumber()"
|
|
57
57
|
@update:modelValue="onUpdate"
|
|
58
58
|
/>
|
|
59
59
|
<FSIconField
|
|
60
60
|
v-else-if="$props.customProperty.dataType === PropertyDataType.Icon"
|
|
61
|
-
:
|
|
61
|
+
:disabled="$props.disabled"
|
|
62
62
|
:label="$props.label"
|
|
63
63
|
:modelValue="modelValue"
|
|
64
64
|
@update:modelValue="onUpdate"
|
|
@@ -108,10 +108,10 @@ export default defineComponent({
|
|
|
108
108
|
required: false,
|
|
109
109
|
default: null
|
|
110
110
|
},
|
|
111
|
-
|
|
111
|
+
disabled: {
|
|
112
112
|
type: Boolean,
|
|
113
113
|
required: false,
|
|
114
|
-
default:
|
|
114
|
+
default: false
|
|
115
115
|
}
|
|
116
116
|
},
|
|
117
117
|
emits: ["update:modelValue"],
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
<FSMetaField
|
|
18
18
|
v-for="(property, index) in properties"
|
|
19
19
|
:customProperty="property"
|
|
20
|
-
:
|
|
20
|
+
:disabled="disabled"
|
|
21
21
|
:key="index"
|
|
22
22
|
:modelValue="modelValue[property.code]"
|
|
23
23
|
@update:modelValue="(event) => $emit('update:modelValue', { ...modelValue, [property.code]: event})"
|
|
@@ -50,12 +50,13 @@ export default defineComponent({
|
|
|
50
50
|
type: Object as PropType<{ [key: string]: string }>,
|
|
51
51
|
required: true
|
|
52
52
|
},
|
|
53
|
-
|
|
53
|
+
disabled: {
|
|
54
54
|
type: Boolean,
|
|
55
55
|
required: false,
|
|
56
|
-
default:
|
|
56
|
+
default: false
|
|
57
57
|
}
|
|
58
58
|
},
|
|
59
|
+
emits: ["update:modelValue"],
|
|
59
60
|
setup(props) {
|
|
60
61
|
const categories = props.customProperties.reduce((acc, curr) => {
|
|
61
62
|
if (acc[curr.categoryLabel] === undefined) {
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { useDateExpression } from "@dative-gpi/foundation-shared-services/composables";
|
|
2
2
|
import { FilterType, PropertyDataType } from "@dative-gpi/foundation-shared-domain/enums";
|
|
3
3
|
|
|
4
4
|
import { type CustomPropertyInfos, } from "../../../foundation-core-domain/models";
|
|
5
5
|
|
|
6
|
-
const {
|
|
6
|
+
const { convert: convertExpressionToEpoch } = useDateExpression();
|
|
7
7
|
|
|
8
8
|
export const getColor = (property: CustomPropertyInfos, value: string): string | undefined => {
|
|
9
9
|
if (property.colorful) {
|
|
10
10
|
for (const color of [...property.colorMap].sort((a, b) => b.priority - a.priority)) {
|
|
11
11
|
let filterValues = [...color.filterValues];
|
|
12
12
|
if ([PropertyDataType.DateTime].includes(property.dataType)) {
|
|
13
|
-
filterValues = filterValues.map(fv =>
|
|
13
|
+
filterValues = filterValues.map(fv => convertExpressionToEpoch(fv).toString());
|
|
14
14
|
}
|
|
15
15
|
switch (color.filterType) {
|
|
16
16
|
case FilterType.None: return color.color;
|
|
@@ -80,113 +80,3 @@ export const getColor = (property: CustomPropertyInfos, value: string): string |
|
|
|
80
80
|
}
|
|
81
81
|
}
|
|
82
82
|
}
|
|
83
|
-
|
|
84
|
-
const getEpoch = (expression: string): string => {
|
|
85
|
-
if (!isNaN(parseInt(expression))) {
|
|
86
|
-
return expression;
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
const date = new Date();
|
|
90
|
-
if (expression.startsWith("now")) {
|
|
91
|
-
expression = expression.substring(3).replace(/\s/g, "");
|
|
92
|
-
}
|
|
93
|
-
else {
|
|
94
|
-
return (date.getTime()).toString();
|
|
95
|
-
}
|
|
96
|
-
let match = /^(?:(?:([-+])(\d*))?(\w+))?(?:\/(\w))?/g.exec(expression);
|
|
97
|
-
while (match != null && (match[0] != null && match[0].length > 0)) {
|
|
98
|
-
if (match[1] != null && match[3] != null) {
|
|
99
|
-
if (!["-", "+"].includes(match[1]) || isNaN(parseInt(match[2])) || !["s", "m", "h", "d", "w", "M", "y"].includes(match[3])) {
|
|
100
|
-
return (date.getTime()).toString();
|
|
101
|
-
}
|
|
102
|
-
const offset = match[1] == "-" ? -1 * parseInt(match[2]): 1* parseInt(match[2]);
|
|
103
|
-
switch (match[3]) {
|
|
104
|
-
case "s": {
|
|
105
|
-
date.setSeconds(date.getSeconds() + offset);
|
|
106
|
-
break;
|
|
107
|
-
}
|
|
108
|
-
case "m": {
|
|
109
|
-
date.setMinutes(date.getMinutes() + offset);
|
|
110
|
-
break;
|
|
111
|
-
}
|
|
112
|
-
case "h": {
|
|
113
|
-
date.setHours(date.getHours() + offset);
|
|
114
|
-
break;
|
|
115
|
-
}
|
|
116
|
-
case "d": {
|
|
117
|
-
date.setDate(date.getDate() + offset);
|
|
118
|
-
break;
|
|
119
|
-
}
|
|
120
|
-
case "w": {
|
|
121
|
-
date.setDate(date.getDate() + offset * 7);
|
|
122
|
-
break;
|
|
123
|
-
}
|
|
124
|
-
case "M": {
|
|
125
|
-
date.setMonth(date.getMonth() + offset);
|
|
126
|
-
break;
|
|
127
|
-
}
|
|
128
|
-
case "y": {
|
|
129
|
-
date.setFullYear(date.getFullYear() + offset);
|
|
130
|
-
break;
|
|
131
|
-
}
|
|
132
|
-
}
|
|
133
|
-
}
|
|
134
|
-
if (match[4] != null) {
|
|
135
|
-
if (!["s", "m", "h", "d", "w", "M", "y"].includes(match[4])) {
|
|
136
|
-
return (date.getTime()).toString();
|
|
137
|
-
}
|
|
138
|
-
switch (match[4]) {
|
|
139
|
-
case "s": {
|
|
140
|
-
date.setMilliseconds(0);
|
|
141
|
-
break;
|
|
142
|
-
}
|
|
143
|
-
case "m": {
|
|
144
|
-
date.setMilliseconds(0);
|
|
145
|
-
date.setSeconds(0);
|
|
146
|
-
break;
|
|
147
|
-
}
|
|
148
|
-
case "h": {
|
|
149
|
-
date.setMilliseconds(0);
|
|
150
|
-
date.setSeconds(0);
|
|
151
|
-
date.setMinutes(0);
|
|
152
|
-
break;
|
|
153
|
-
}
|
|
154
|
-
case "d": {
|
|
155
|
-
date.setMilliseconds(0);
|
|
156
|
-
date.setSeconds(0);
|
|
157
|
-
date.setMinutes(0);
|
|
158
|
-
date.setHours(0);
|
|
159
|
-
break;
|
|
160
|
-
}
|
|
161
|
-
case "w": {
|
|
162
|
-
date.setMilliseconds(0);
|
|
163
|
-
date.setSeconds(0);
|
|
164
|
-
date.setMinutes(0);
|
|
165
|
-
date.setHours(0);
|
|
166
|
-
date.setDate(date.getDate() - date.getDay() + (date.getDay() === 0 ? -6 : 1));
|
|
167
|
-
break;
|
|
168
|
-
}
|
|
169
|
-
case "M": {
|
|
170
|
-
date.setMilliseconds(0);
|
|
171
|
-
date.setSeconds(0);
|
|
172
|
-
date.setMinutes(0);
|
|
173
|
-
date.setHours(0);
|
|
174
|
-
date.setDate(1);
|
|
175
|
-
break;
|
|
176
|
-
}
|
|
177
|
-
case "y": {
|
|
178
|
-
date.setMilliseconds(0);
|
|
179
|
-
date.setSeconds(0);
|
|
180
|
-
date.setMinutes(0);
|
|
181
|
-
date.setHours(0);
|
|
182
|
-
date.setDate(1);
|
|
183
|
-
date.setMonth(0);
|
|
184
|
-
break;
|
|
185
|
-
}
|
|
186
|
-
}
|
|
187
|
-
}
|
|
188
|
-
expression = expression.substring(match[0].length);
|
|
189
|
-
match = /(?:(?:([-+])(\d*))?(\w+))?(?:\/(\w))?/g.exec(expression);
|
|
190
|
-
}
|
|
191
|
-
return (date.getTime() + getOffsetDifference()).toString();
|
|
192
|
-
}
|
|
@@ -3,7 +3,7 @@
|
|
|
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"
|
|
@@ -96,10 +96,10 @@ export default defineComponent({
|
|
|
96
96
|
required: false,
|
|
97
97
|
default: null
|
|
98
98
|
},
|
|
99
|
-
|
|
99
|
+
disabled: {
|
|
100
100
|
type: Boolean,
|
|
101
101
|
required: false,
|
|
102
|
-
default:
|
|
102
|
+
default: false
|
|
103
103
|
},
|
|
104
104
|
entityType: {
|
|
105
105
|
type: Number as PropType<EntityType>,
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
:loading="fetchingDeviceExplorerElements"
|
|
5
5
|
:singleSelect="$props.singleSelect"
|
|
6
6
|
:items="deviceExplorerElements"
|
|
7
|
-
:showSelect="$props.
|
|
7
|
+
:showSelect="$props.selectable"
|
|
8
8
|
:tableCode="$props.tableCode"
|
|
9
9
|
:itemTo="$props.itemTo"
|
|
10
10
|
:noSearch="$props.recursiveSearch"
|
|
@@ -52,7 +52,7 @@
|
|
|
52
52
|
>
|
|
53
53
|
<FSTagGroup
|
|
54
54
|
variant="slide"
|
|
55
|
-
:
|
|
55
|
+
:disabled="true"
|
|
56
56
|
:tags="item.tags"
|
|
57
57
|
/>
|
|
58
58
|
</template>
|
|
@@ -221,7 +221,7 @@ export default defineComponent({
|
|
|
221
221
|
required: false,
|
|
222
222
|
default: null
|
|
223
223
|
},
|
|
224
|
-
|
|
224
|
+
selectable: {
|
|
225
225
|
type: Boolean,
|
|
226
226
|
required: false,
|
|
227
227
|
default: true
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
>
|
|
51
51
|
<FSTagGroup
|
|
52
52
|
variant="slide"
|
|
53
|
-
:
|
|
53
|
+
:showRemove="false"
|
|
54
54
|
:tags="item.tags"
|
|
55
55
|
/>
|
|
56
56
|
</template>
|
|
@@ -60,7 +60,7 @@
|
|
|
60
60
|
<FSTagGroup
|
|
61
61
|
variant="slide"
|
|
62
62
|
:tags="item.groupByValues.map((gbv: any) => `${gbv.label}: ${gbv.value}`)"
|
|
63
|
-
:
|
|
63
|
+
:showRemove="false"
|
|
64
64
|
/>
|
|
65
65
|
</template>
|
|
66
66
|
<template
|
|
@@ -120,7 +120,7 @@
|
|
|
120
120
|
<FSTagGroup
|
|
121
121
|
variant="slide"
|
|
122
122
|
:tags="item.history.map((h: any) => AlertTools.statusLabel(h.status))"
|
|
123
|
-
:
|
|
123
|
+
:showRemove="false"
|
|
124
124
|
/>
|
|
125
125
|
</template>
|
|
126
126
|
<template
|
|
@@ -7,6 +7,8 @@
|
|
|
7
7
|
:headersOptions="headersOptions"
|
|
8
8
|
:tableCode="$props.tableCode"
|
|
9
9
|
:modelValue="$props.modelValue"
|
|
10
|
+
:showSelect="$props.selectable"
|
|
11
|
+
:singleSelect="$props.singleSelect"
|
|
10
12
|
@update:modelValue="$emit('update:modelValue', $event)"
|
|
11
13
|
v-bind="$attrs"
|
|
12
14
|
>
|
|
@@ -49,7 +51,7 @@
|
|
|
49
51
|
>
|
|
50
52
|
<FSTagGroup
|
|
51
53
|
variant="slide"
|
|
52
|
-
:
|
|
54
|
+
:disabled="true"
|
|
53
55
|
:tags="item.tags"
|
|
54
56
|
/>
|
|
55
57
|
</template>
|
|
@@ -71,21 +73,23 @@
|
|
|
71
73
|
#item.modelsLabels="{ item }"
|
|
72
74
|
>
|
|
73
75
|
<FSTagGroup
|
|
74
|
-
:
|
|
76
|
+
:disabled="true"
|
|
75
77
|
:tags="item.modelsLabels.map((d: any) => d.label)"
|
|
76
78
|
/>
|
|
77
79
|
</template>
|
|
78
80
|
<template
|
|
79
|
-
#item.tile="{item}"
|
|
81
|
+
#item.tile="{ item, toggleSelect}"
|
|
80
82
|
>
|
|
81
83
|
<FSChartTileUI
|
|
82
|
-
variant="standard"
|
|
83
84
|
:label="item.label"
|
|
84
85
|
:category-label="item.chartCategoryLabel"
|
|
86
|
+
:singleSelect="$props.singleSelect"
|
|
87
|
+
:selectable="$props.selectable"
|
|
85
88
|
:icon="item.icon"
|
|
86
89
|
:imageId="item.imageId"
|
|
87
90
|
:type="item.chartType"
|
|
88
|
-
:
|
|
91
|
+
:modelValue="isSelected(item.id)"
|
|
92
|
+
@update:modelValue="toggleSelect(item)"
|
|
89
93
|
:to="$props.itemTo && $props.itemTo(item)"
|
|
90
94
|
/>
|
|
91
95
|
</template>
|
|
@@ -144,6 +148,16 @@ export default defineComponent({
|
|
|
144
148
|
type: Array as PropType<string[]>,
|
|
145
149
|
default: () => [],
|
|
146
150
|
required: false
|
|
151
|
+
},
|
|
152
|
+
selectable: {
|
|
153
|
+
type: Boolean,
|
|
154
|
+
required: false,
|
|
155
|
+
default: true
|
|
156
|
+
},
|
|
157
|
+
singleSelect: {
|
|
158
|
+
type: Boolean,
|
|
159
|
+
required: false,
|
|
160
|
+
default: false
|
|
147
161
|
}
|
|
148
162
|
},
|
|
149
163
|
emits: ["update:modelValue"],
|
|
@@ -7,6 +7,8 @@
|
|
|
7
7
|
:headersOptions="headersOptions"
|
|
8
8
|
:tableCode="$props.tableCode"
|
|
9
9
|
:modelValue="$props.modelValue"
|
|
10
|
+
:singleSelect="$props.singleSelect"
|
|
11
|
+
:showSelect="$props.selectable"
|
|
10
12
|
@update:modelValue="$emit('update:modelValue', $event)"
|
|
11
13
|
v-bind="$attrs"
|
|
12
14
|
>
|
|
@@ -49,7 +51,7 @@
|
|
|
49
51
|
>
|
|
50
52
|
<FSTagGroup
|
|
51
53
|
variant="slide"
|
|
52
|
-
:
|
|
54
|
+
:disabled="true"
|
|
53
55
|
:tags="item.tags"
|
|
54
56
|
/>
|
|
55
57
|
</template>
|
|
@@ -57,24 +59,10 @@
|
|
|
57
59
|
#item.modelsLabels="{ item }"
|
|
58
60
|
>
|
|
59
61
|
<FSTagGroup
|
|
60
|
-
:
|
|
62
|
+
:disabled="true"
|
|
61
63
|
:tags="item.modelsLabels.map((d: any) => d.label)"
|
|
62
64
|
/>
|
|
63
65
|
</template>
|
|
64
|
-
<template
|
|
65
|
-
#item.tile="{ item }"
|
|
66
|
-
>
|
|
67
|
-
<FSChartTileUI
|
|
68
|
-
variant="standard"
|
|
69
|
-
:label="item.label"
|
|
70
|
-
:categoryLabel="item.chartCategoryLabel"
|
|
71
|
-
:icon="item.icon"
|
|
72
|
-
:imageId="item.imageId"
|
|
73
|
-
:type="item.chartType"
|
|
74
|
-
:color="ColorEnum.Light"
|
|
75
|
-
:to="$props.itemTo && $props.itemTo(item)"
|
|
76
|
-
/>
|
|
77
|
-
</template>
|
|
78
66
|
<template
|
|
79
67
|
#item.chartType="{ item }"
|
|
80
68
|
>
|
|
@@ -89,6 +77,22 @@
|
|
|
89
77
|
</FSText>
|
|
90
78
|
</FSRow>
|
|
91
79
|
</template>
|
|
80
|
+
<template
|
|
81
|
+
#item.tile="{ item, toggleSelect }"
|
|
82
|
+
>
|
|
83
|
+
<FSChartTileUI
|
|
84
|
+
:label="item.label"
|
|
85
|
+
:singleSelect="$props.singleSelect"
|
|
86
|
+
:selectable="$props.selectable"
|
|
87
|
+
:categoryLabel="item.chartCategoryLabel"
|
|
88
|
+
:icon="item.icon"
|
|
89
|
+
:imageId="item.imageId"
|
|
90
|
+
:type="item.chartType"
|
|
91
|
+
:modelValue="isSelected(item.id)"
|
|
92
|
+
@update:modelValue="toggleSelect(item)"
|
|
93
|
+
:to="$props.itemTo && $props.itemTo(item)"
|
|
94
|
+
/>
|
|
95
|
+
</template>
|
|
92
96
|
</FSDataTable>
|
|
93
97
|
</template>
|
|
94
98
|
|
|
@@ -144,7 +148,17 @@ export default defineComponent({
|
|
|
144
148
|
type: Array as PropType<string[]>,
|
|
145
149
|
default: () => [],
|
|
146
150
|
required: false
|
|
147
|
-
}
|
|
151
|
+
},
|
|
152
|
+
selectable: {
|
|
153
|
+
type: Boolean,
|
|
154
|
+
required: false,
|
|
155
|
+
default: true
|
|
156
|
+
},
|
|
157
|
+
singleSelect: {
|
|
158
|
+
type: Boolean,
|
|
159
|
+
required: false,
|
|
160
|
+
default: false
|
|
161
|
+
},
|
|
148
162
|
},
|
|
149
163
|
emits: ["update:modelValue"],
|
|
150
164
|
setup(props) {
|
|
@@ -4,6 +4,8 @@
|
|
|
4
4
|
:loading="fetchingChartOrganisationTypes || fetchingChartOrganisations"
|
|
5
5
|
:headersOptions="headersOptions"
|
|
6
6
|
:items="charts"
|
|
7
|
+
:showSelect="$props.selectable"
|
|
8
|
+
:singleSelect="$props.singleSelect"
|
|
7
9
|
:tableCode="$props.tableCode"
|
|
8
10
|
:modelValue="$props.modelValue"
|
|
9
11
|
@update:modelValue="onSelect"
|
|
@@ -48,7 +50,7 @@
|
|
|
48
50
|
>
|
|
49
51
|
<FSTagGroup
|
|
50
52
|
variant="slide"
|
|
51
|
-
:
|
|
53
|
+
:disabled="true"
|
|
52
54
|
:tags="item.tags"
|
|
53
55
|
/>
|
|
54
56
|
</template>
|
|
@@ -70,7 +72,7 @@
|
|
|
70
72
|
#item.modelsLabels="{ item }"
|
|
71
73
|
>
|
|
72
74
|
<FSTagGroup
|
|
73
|
-
:
|
|
75
|
+
:disabled="true"
|
|
74
76
|
:tags="item.modelsLabels.map((d: any) => d.label)"
|
|
75
77
|
/>
|
|
76
78
|
</template>
|
|
@@ -78,14 +80,15 @@
|
|
|
78
80
|
#item.tile="{ item }"
|
|
79
81
|
>
|
|
80
82
|
<FSChartTileUI
|
|
81
|
-
variant="standard"
|
|
82
83
|
:label="item.label"
|
|
83
84
|
:categoryLabel="item.chartCategoryLabel"
|
|
84
85
|
:icon="item.icon"
|
|
85
86
|
:imageId="item.imageId"
|
|
86
87
|
:type="item.chartType"
|
|
87
|
-
:
|
|
88
|
-
|
|
88
|
+
:singleSelect="$props.singleSelect"
|
|
89
|
+
:selectable="$props.selectable"
|
|
90
|
+
:modelValue="isSelected(item.id)"
|
|
91
|
+
@update:modelValue="update(item.id)"
|
|
89
92
|
/>
|
|
90
93
|
</template>
|
|
91
94
|
</FSDataTable>
|
|
@@ -141,6 +144,16 @@ export default defineComponent({
|
|
|
141
144
|
type: Array as PropType<string[]>,
|
|
142
145
|
default: () => [],
|
|
143
146
|
required: false
|
|
147
|
+
},
|
|
148
|
+
selectable: {
|
|
149
|
+
type: Boolean,
|
|
150
|
+
required: false,
|
|
151
|
+
default: true
|
|
152
|
+
},
|
|
153
|
+
singleSelect: {
|
|
154
|
+
type: Boolean,
|
|
155
|
+
required: false,
|
|
156
|
+
default: false
|
|
144
157
|
}
|
|
145
158
|
},
|
|
146
159
|
emits: ["update", "update:modelValue", "update:scope"],
|
|
@@ -219,11 +232,14 @@ export default defineComponent({
|
|
|
219
232
|
}));
|
|
220
233
|
|
|
221
234
|
const update = (value : string) => {
|
|
222
|
-
const
|
|
223
|
-
if (
|
|
235
|
+
const isAlreadySelected = isSelected(value);
|
|
236
|
+
if (isAlreadySelected) {
|
|
224
237
|
onSelect(props.modelValue.filter(m => m != value));
|
|
225
238
|
}
|
|
226
|
-
else {
|
|
239
|
+
else if(props.singleSelect){
|
|
240
|
+
onSelect([value]);
|
|
241
|
+
}
|
|
242
|
+
else{
|
|
227
243
|
onSelect([...props.modelValue, value]);
|
|
228
244
|
}
|
|
229
245
|
}
|
package/components/lists/dashboardOrganisationTypes/FSBaseDashboardOrganisationTypesList.vue
CHANGED
|
@@ -6,6 +6,8 @@
|
|
|
6
6
|
:itemTo="$props.itemTo"
|
|
7
7
|
:tableCode="$props.tableCode"
|
|
8
8
|
:modelValue="$props.modelValue"
|
|
9
|
+
:showSelect="$props.selectable"
|
|
10
|
+
:singleSelect="$props.singleSelect"
|
|
9
11
|
@update:modelValue="$emit('update:modelValue', $event)"
|
|
10
12
|
v-bind="$attrs"
|
|
11
13
|
>
|
|
@@ -59,7 +61,7 @@
|
|
|
59
61
|
>
|
|
60
62
|
<FSTagGroup
|
|
61
63
|
variant="slide"
|
|
62
|
-
:
|
|
64
|
+
:showRemove="false"
|
|
63
65
|
:tags="item.tags"
|
|
64
66
|
/>
|
|
65
67
|
</template>
|
|
@@ -68,6 +70,8 @@
|
|
|
68
70
|
>
|
|
69
71
|
<FSDashboardOrganisationTypeTileUI
|
|
70
72
|
:bottomColor="item.colors"
|
|
73
|
+
:selectable="$props.selectable"
|
|
74
|
+
:singleSelect="$props.singleSelect"
|
|
71
75
|
:to="$props.itemTo && $props.itemTo(item)"
|
|
72
76
|
:modelValue="isSelected(item.id)"
|
|
73
77
|
@update:modelValue="toggleSelect(item)"
|
|
@@ -125,8 +129,21 @@ export default defineComponent({
|
|
|
125
129
|
type: Array as PropType<string[]>,
|
|
126
130
|
required: false,
|
|
127
131
|
default: () => []
|
|
132
|
+
},
|
|
133
|
+
selectable: {
|
|
134
|
+
type: Boolean,
|
|
135
|
+
required: false,
|
|
136
|
+
default: true
|
|
137
|
+
},
|
|
138
|
+
singleSelect: {
|
|
139
|
+
type: Boolean,
|
|
140
|
+
required: false,
|
|
141
|
+
default: false
|
|
128
142
|
}
|
|
129
143
|
},
|
|
144
|
+
emits: [
|
|
145
|
+
"update:modelValue"
|
|
146
|
+
],
|
|
130
147
|
setup(props) {
|
|
131
148
|
const { getMany: getDashboardOrganisationTypes, fetching: fetchingDashboardOrganisationTypes, entities: dashboardOrganisationTypes } = useDashboardOrganisationTypes();
|
|
132
149
|
const { fetch: fetchUserOrganisation, entity: userOrganisation } = useCurrentUserOrganisation();
|