@dative-gpi/foundation-core-components 0.0.220 → 0.0.221
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/selects/FSAggregationSelector.vue +52 -0
- package/components/selects/FSAxisTypeSelector.vue +49 -0
- package/components/selects/FSDataCategorySelector.vue +61 -0
- package/components/selects/FSDataDefinitionSelector.vue +65 -0
- package/components/selects/FSDisplayAsSelector.vue +53 -0
- package/components/selects/FSFilterTypeSelector.vue +54 -0
- package/components/selects/FSHeatmapRuleSelector.vue +53 -0
- package/components/selects/FSModelSelector.vue +55 -0
- package/components/selects/FSOperationOnSelector.vue +52 -0
- package/components/selects/FSPlanningTypeSelector.vue +52 -0
- package/components/selects/FSPlotPerSelector.vue +52 -0
- package/components/selects/FSSerieTypeSelector.vue +52 -0
- package/package.json +7 -7
- package/utils/charts.ts +128 -1
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<FSCol>
|
|
3
|
+
<FSSelectField
|
|
4
|
+
:label="label ?? $tr('ui.common.aggregation-type','Aggregation')"
|
|
5
|
+
:items="aggregationTypeItems"
|
|
6
|
+
:modelValue="modelValue"
|
|
7
|
+
@update:modelValue="$emit('update:modelValue', $event)"
|
|
8
|
+
/>
|
|
9
|
+
</FSCol>
|
|
10
|
+
</template>
|
|
11
|
+
|
|
12
|
+
<script lang="ts">
|
|
13
|
+
import { computed, defineComponent, type PropType } from "vue";
|
|
14
|
+
|
|
15
|
+
import {AggregationType} from "@dative-gpi/foundation-core-domain/models";
|
|
16
|
+
|
|
17
|
+
import {aggregationTypeLabel, getEnumEntries} from "../../utils";
|
|
18
|
+
|
|
19
|
+
import FSSelectField from "@dative-gpi/foundation-shared-components/components/fields/FSSelectField.vue";
|
|
20
|
+
|
|
21
|
+
export default defineComponent({
|
|
22
|
+
components: {
|
|
23
|
+
FSSelectField
|
|
24
|
+
},
|
|
25
|
+
props: {
|
|
26
|
+
modelValue : {
|
|
27
|
+
type: Number as PropType<AggregationType>,
|
|
28
|
+
required: false
|
|
29
|
+
},
|
|
30
|
+
label : {
|
|
31
|
+
type: String,
|
|
32
|
+
required: false
|
|
33
|
+
}
|
|
34
|
+
},
|
|
35
|
+
emits: ['update:modelValue'],
|
|
36
|
+
setup() {
|
|
37
|
+
|
|
38
|
+
const aggregationTypeItems = computed(()=>{
|
|
39
|
+
return getEnumEntries(AggregationType).map((f)=>{
|
|
40
|
+
return {
|
|
41
|
+
id: f.value,
|
|
42
|
+
label: aggregationTypeLabel(f.value)
|
|
43
|
+
}
|
|
44
|
+
})
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
return {
|
|
48
|
+
aggregationTypeItems
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
})
|
|
52
|
+
</script>
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<FSCol>
|
|
3
|
+
<FSToggleSet
|
|
4
|
+
:hideHeader="true"
|
|
5
|
+
:values="axisTypeItems"
|
|
6
|
+
:modelValue="modelValue"
|
|
7
|
+
@update:modelValue="$emit('update:modelValue', $event)"
|
|
8
|
+
/>
|
|
9
|
+
</FSCol>
|
|
10
|
+
</template>
|
|
11
|
+
|
|
12
|
+
<script lang="ts">
|
|
13
|
+
import { computed, defineComponent, type PropType } from "vue";
|
|
14
|
+
|
|
15
|
+
import {AxisType} from "@dative-gpi/foundation-core-domain/models";
|
|
16
|
+
|
|
17
|
+
import {axisTypeLabel, getEnumEntries} from "../../utils";
|
|
18
|
+
|
|
19
|
+
import FSToggleSet from "@dative-gpi/foundation-shared-components/components/FSToggleSet.vue";
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
export default defineComponent({
|
|
23
|
+
components: {
|
|
24
|
+
FSToggleSet
|
|
25
|
+
},
|
|
26
|
+
props: {
|
|
27
|
+
modelValue: {
|
|
28
|
+
type: Number as PropType<AxisType>,
|
|
29
|
+
required: false
|
|
30
|
+
}
|
|
31
|
+
},
|
|
32
|
+
emits: ['update:modelValue'],
|
|
33
|
+
setup() {
|
|
34
|
+
|
|
35
|
+
const axisTypeItems = computed(()=>{
|
|
36
|
+
return getEnumEntries(AxisType).map((f)=>{
|
|
37
|
+
return {
|
|
38
|
+
id: f.value,
|
|
39
|
+
label: axisTypeLabel(f.value)
|
|
40
|
+
}
|
|
41
|
+
})
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
return {
|
|
45
|
+
axisTypeItems
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
})
|
|
49
|
+
</script>
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<FSAutocompleteField
|
|
3
|
+
:label="label ?? $tr('ui.common.data-category', 'Data category')"
|
|
4
|
+
:items="toggleDataCategories"
|
|
5
|
+
:modelValue="modelValue"
|
|
6
|
+
:toggleSet="toggleDataCategories.length < 5"
|
|
7
|
+
@update:modelValue="$emit('update:modelValue', $event);"
|
|
8
|
+
/>
|
|
9
|
+
</template>
|
|
10
|
+
|
|
11
|
+
<script lang="ts">
|
|
12
|
+
import { computed, defineComponent, watch } from "vue";
|
|
13
|
+
|
|
14
|
+
import {useDataCategories} from "@dative-gpi/foundation-core-services/composables";
|
|
15
|
+
|
|
16
|
+
import FSAutocompleteField from "@dative-gpi/foundation-shared-components/components/fields/FSAutocompleteField.vue";
|
|
17
|
+
|
|
18
|
+
export default defineComponent({
|
|
19
|
+
components: {
|
|
20
|
+
FSAutocompleteField
|
|
21
|
+
},
|
|
22
|
+
props:{
|
|
23
|
+
modelValue: {
|
|
24
|
+
type: String,
|
|
25
|
+
required: false
|
|
26
|
+
},
|
|
27
|
+
modelId: {
|
|
28
|
+
type: String,
|
|
29
|
+
required: false,
|
|
30
|
+
},
|
|
31
|
+
label: {
|
|
32
|
+
type: String,
|
|
33
|
+
required: false
|
|
34
|
+
},
|
|
35
|
+
},
|
|
36
|
+
emits: ['update:modelValue'],
|
|
37
|
+
setup(props) {
|
|
38
|
+
const {getMany : fetchdataCategories, entities : dataCategories} = useDataCategories()
|
|
39
|
+
|
|
40
|
+
const toggleDataCategories = computed(()=>{
|
|
41
|
+
return dataCategories.value.map((d) => {
|
|
42
|
+
return {
|
|
43
|
+
id: d.id,
|
|
44
|
+
label: d.label
|
|
45
|
+
}
|
|
46
|
+
})
|
|
47
|
+
})
|
|
48
|
+
|
|
49
|
+
watch(() => props.modelId, () => {
|
|
50
|
+
fetchdataCategories({modelId: props.modelId})
|
|
51
|
+
}, {immediate: true})
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
return {
|
|
55
|
+
toggleDataCategories,
|
|
56
|
+
dataCategories
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
})
|
|
60
|
+
|
|
61
|
+
</script>
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<FSAutocompleteField
|
|
3
|
+
:label="label ?? $tr('ui.common.data-definition', 'Data')"
|
|
4
|
+
:items="toggleDataDefinitions"
|
|
5
|
+
:modelValue="modelValue"
|
|
6
|
+
@update:modelValue="$emit('update:modelValue', $event)"
|
|
7
|
+
/>
|
|
8
|
+
</template>
|
|
9
|
+
|
|
10
|
+
<script lang="ts">
|
|
11
|
+
import { computed, defineComponent, watch } from "vue";
|
|
12
|
+
|
|
13
|
+
import {useDataDefinitions} from "@dative-gpi/foundation-core-services/composables";
|
|
14
|
+
|
|
15
|
+
import FSAutocompleteField from "@dative-gpi/foundation-shared-components/components/fields/FSAutocompleteField.vue";
|
|
16
|
+
|
|
17
|
+
export default defineComponent({
|
|
18
|
+
components: {
|
|
19
|
+
FSAutocompleteField
|
|
20
|
+
},
|
|
21
|
+
props:{
|
|
22
|
+
modelValue: {
|
|
23
|
+
type: String,
|
|
24
|
+
required: false
|
|
25
|
+
},
|
|
26
|
+
modelId: {
|
|
27
|
+
type: String,
|
|
28
|
+
required: false,
|
|
29
|
+
},
|
|
30
|
+
dataCategoryId: {
|
|
31
|
+
type: String,
|
|
32
|
+
required: false,
|
|
33
|
+
},
|
|
34
|
+
label: {
|
|
35
|
+
type: String,
|
|
36
|
+
required: false
|
|
37
|
+
},
|
|
38
|
+
|
|
39
|
+
},
|
|
40
|
+
emits: ['update:modelValue'],
|
|
41
|
+
setup(props) {
|
|
42
|
+
|
|
43
|
+
const {getMany : fetchDataDefinitions, entities : dataDefinitions} = useDataDefinitions()
|
|
44
|
+
|
|
45
|
+
const toggleDataDefinitions = computed(()=>{
|
|
46
|
+
return dataDefinitions.value.map((d) => {
|
|
47
|
+
return {
|
|
48
|
+
id: d.id,
|
|
49
|
+
label: d.label
|
|
50
|
+
}
|
|
51
|
+
})
|
|
52
|
+
})
|
|
53
|
+
|
|
54
|
+
watch(() => [props.modelId, props.dataCategoryId], async () => {
|
|
55
|
+
await fetchDataDefinitions({modelsIds: props.modelId ? [props.modelId] : undefined, dataCategoryId: props.dataCategoryId})
|
|
56
|
+
}, {immediate: true})
|
|
57
|
+
|
|
58
|
+
return {
|
|
59
|
+
toggleDataDefinitions,
|
|
60
|
+
dataDefinitions
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
})
|
|
64
|
+
|
|
65
|
+
</script>
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<FSCol>
|
|
3
|
+
<FSSelectField
|
|
4
|
+
:label="label ?? $tr('ui.common.display-as','Display as')"
|
|
5
|
+
:items="displayAsItems"
|
|
6
|
+
:modelValue="modelValue"
|
|
7
|
+
@update:modelValue="$emit('update:modelValue', $event)"
|
|
8
|
+
/>
|
|
9
|
+
</FSCol>
|
|
10
|
+
</template>
|
|
11
|
+
|
|
12
|
+
<script lang="ts">
|
|
13
|
+
import { computed, defineComponent, type PropType } from "vue";
|
|
14
|
+
|
|
15
|
+
import {DisplayAs} from "@dative-gpi/foundation-core-domain/models";
|
|
16
|
+
|
|
17
|
+
import FSSelectField from "@dative-gpi/foundation-shared-components/components/fields/FSSelectField.vue";
|
|
18
|
+
|
|
19
|
+
import {displayAsLabel, getEnumEntries} from "../../utils";
|
|
20
|
+
|
|
21
|
+
export default defineComponent({
|
|
22
|
+
components: {
|
|
23
|
+
FSSelectField
|
|
24
|
+
},
|
|
25
|
+
props: {
|
|
26
|
+
modelValue: {
|
|
27
|
+
type: Number as PropType<DisplayAs>,
|
|
28
|
+
required: false
|
|
29
|
+
},
|
|
30
|
+
label: {
|
|
31
|
+
type: String,
|
|
32
|
+
required: false
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
},
|
|
36
|
+
emits: ['update:modelValue'],
|
|
37
|
+
setup() {
|
|
38
|
+
|
|
39
|
+
const displayAsItems = computed(()=>{
|
|
40
|
+
return getEnumEntries(DisplayAs).map((f)=>{
|
|
41
|
+
return {
|
|
42
|
+
id: f.value,
|
|
43
|
+
label: displayAsLabel(f.value)
|
|
44
|
+
}
|
|
45
|
+
})
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
return {
|
|
49
|
+
displayAsItems,
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
})
|
|
53
|
+
</script>
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<FSCol>
|
|
3
|
+
<FSAutocompleteField
|
|
4
|
+
:label="label ?? $tr('ui.common.filter-type','Filter type')"
|
|
5
|
+
:toggleSet="true"
|
|
6
|
+
:items="filterTypeItems"
|
|
7
|
+
:modelValue="modelValue"
|
|
8
|
+
@update:modelValue="$emit('update:modelValue', $event)"
|
|
9
|
+
/>
|
|
10
|
+
</FSCol>
|
|
11
|
+
</template>
|
|
12
|
+
|
|
13
|
+
<script lang="ts">
|
|
14
|
+
import { computed, defineComponent, type PropType } from "vue";
|
|
15
|
+
|
|
16
|
+
import {FilterType} from "@dative-gpi/foundation-core-domain/models";
|
|
17
|
+
|
|
18
|
+
import FSAutocompleteField from "@dative-gpi/foundation-shared-components/components/fields/FSAutocompleteField.vue";
|
|
19
|
+
|
|
20
|
+
import {filterTypeLabel, getEnumEntries} from "../../utils";
|
|
21
|
+
|
|
22
|
+
export default defineComponent({
|
|
23
|
+
components: {
|
|
24
|
+
FSAutocompleteField
|
|
25
|
+
},
|
|
26
|
+
props: {
|
|
27
|
+
modelValue: {
|
|
28
|
+
type: Number as PropType<FilterType>,
|
|
29
|
+
required: false,
|
|
30
|
+
default : FilterType.None
|
|
31
|
+
},
|
|
32
|
+
label: {
|
|
33
|
+
type: String,
|
|
34
|
+
required: false
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
emits: ['update:modelValue'],
|
|
38
|
+
setup() {
|
|
39
|
+
|
|
40
|
+
const filterTypeItems = computed(()=>{
|
|
41
|
+
return getEnumEntries(FilterType).map((f)=>{
|
|
42
|
+
return {
|
|
43
|
+
id: f.value,
|
|
44
|
+
label: filterTypeLabel(f.value)
|
|
45
|
+
}
|
|
46
|
+
})
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
return {
|
|
50
|
+
filterTypeItems
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
})
|
|
54
|
+
</script>
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<FSCol>
|
|
3
|
+
<FSSelectField
|
|
4
|
+
:label="label ?? $tr('ui.common.heat-rule','Heat rule')"
|
|
5
|
+
:items="heatmapRuleItems"
|
|
6
|
+
:modelValue="modelValue"
|
|
7
|
+
@update:modelValue="$emit('update:modelValue', $event)"
|
|
8
|
+
/>
|
|
9
|
+
</FSCol>
|
|
10
|
+
</template>
|
|
11
|
+
|
|
12
|
+
<script lang="ts">
|
|
13
|
+
import { computed, defineComponent, type PropType } from "vue";
|
|
14
|
+
|
|
15
|
+
import {HeatmapRule} from "@dative-gpi/foundation-core-domain/models";
|
|
16
|
+
|
|
17
|
+
import FSSelectField from "@dative-gpi/foundation-shared-components/components/fields/FSSelectField.vue";
|
|
18
|
+
|
|
19
|
+
import {heatmapRuleLabel, getEnumEntries} from "../../utils";
|
|
20
|
+
|
|
21
|
+
export default defineComponent({
|
|
22
|
+
components: {
|
|
23
|
+
FSSelectField
|
|
24
|
+
},
|
|
25
|
+
props: {
|
|
26
|
+
modelValue: {
|
|
27
|
+
type: Number as PropType<HeatmapRule>,
|
|
28
|
+
required: false
|
|
29
|
+
},
|
|
30
|
+
label: {
|
|
31
|
+
type: String,
|
|
32
|
+
required: false
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
},
|
|
36
|
+
emits: ['update:modelValue'],
|
|
37
|
+
setup() {
|
|
38
|
+
|
|
39
|
+
const heatmapRuleItems = computed(()=>{
|
|
40
|
+
return getEnumEntries(HeatmapRule).map((f)=>{
|
|
41
|
+
return {
|
|
42
|
+
id: f.value,
|
|
43
|
+
label: heatmapRuleLabel(f.value)
|
|
44
|
+
}
|
|
45
|
+
})
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
return {
|
|
49
|
+
heatmapRuleItems
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
})
|
|
53
|
+
</script>
|
|
@@ -0,0 +1,55 @@
|
|
|
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
|
+
/>
|
|
9
|
+
</template>
|
|
10
|
+
|
|
11
|
+
<script lang="ts">
|
|
12
|
+
import { computed, defineComponent, onMounted } from "vue";
|
|
13
|
+
|
|
14
|
+
import {useModels} from "@dative-gpi/foundation-core-services/composables";
|
|
15
|
+
|
|
16
|
+
import FSAutocompleteField from "@dative-gpi/foundation-shared-components/components/fields/FSAutocompleteField.vue";
|
|
17
|
+
|
|
18
|
+
export default defineComponent({
|
|
19
|
+
components: {
|
|
20
|
+
FSAutocompleteField
|
|
21
|
+
},
|
|
22
|
+
props:{
|
|
23
|
+
modelValue: {
|
|
24
|
+
type: String,
|
|
25
|
+
required: false
|
|
26
|
+
},
|
|
27
|
+
label: {
|
|
28
|
+
type: String,
|
|
29
|
+
required: false
|
|
30
|
+
}
|
|
31
|
+
},
|
|
32
|
+
emits: ['update:modelValue'],
|
|
33
|
+
setup(){
|
|
34
|
+
const {getMany : fetchModels, entities : models} = useModels()
|
|
35
|
+
|
|
36
|
+
const modelItems = computed(()=>{
|
|
37
|
+
return models.value.map((d) => {
|
|
38
|
+
return {
|
|
39
|
+
id: d.id,
|
|
40
|
+
label: d.label
|
|
41
|
+
}
|
|
42
|
+
})
|
|
43
|
+
})
|
|
44
|
+
|
|
45
|
+
onMounted(() => {
|
|
46
|
+
fetchModels()
|
|
47
|
+
})
|
|
48
|
+
|
|
49
|
+
return {
|
|
50
|
+
modelItems,
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
})
|
|
54
|
+
|
|
55
|
+
</script>
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<FSCol>
|
|
3
|
+
<FSSelectField
|
|
4
|
+
:label="label ?? $tr('ui.common.operation-on','Operation on')"
|
|
5
|
+
:items="operationOnItems"
|
|
6
|
+
:modelValue="modelValue"
|
|
7
|
+
@update:modelValue="$emit('update:modelValue', $event)"
|
|
8
|
+
/>
|
|
9
|
+
</FSCol>
|
|
10
|
+
</template>
|
|
11
|
+
|
|
12
|
+
<script lang="ts">
|
|
13
|
+
import { computed, defineComponent, type PropType } from "vue";
|
|
14
|
+
|
|
15
|
+
import {OperationOn} from "@dative-gpi/foundation-core-domain/models";
|
|
16
|
+
|
|
17
|
+
import FSSelectField from "@dative-gpi/foundation-shared-components/components/fields/FSSelectField.vue";
|
|
18
|
+
|
|
19
|
+
import {operationOnLabel, getEnumEntries} from "../../utils";
|
|
20
|
+
|
|
21
|
+
export default defineComponent({
|
|
22
|
+
components: {
|
|
23
|
+
FSSelectField
|
|
24
|
+
},
|
|
25
|
+
props: {
|
|
26
|
+
modelValue: {
|
|
27
|
+
type: Number as PropType<OperationOn>,
|
|
28
|
+
required: false
|
|
29
|
+
},
|
|
30
|
+
label : {
|
|
31
|
+
type: String,
|
|
32
|
+
required: false
|
|
33
|
+
}
|
|
34
|
+
},
|
|
35
|
+
emits: ['update:modelValue'],
|
|
36
|
+
setup() {
|
|
37
|
+
|
|
38
|
+
const operationOnItems = computed(()=>{
|
|
39
|
+
return getEnumEntries(OperationOn).map((f)=>{
|
|
40
|
+
return {
|
|
41
|
+
id: f.value,
|
|
42
|
+
label: operationOnLabel(f.value)
|
|
43
|
+
}
|
|
44
|
+
})
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
return {
|
|
48
|
+
operationOnItems
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
})
|
|
52
|
+
</script>
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<FSCol>
|
|
3
|
+
<FSSelectField
|
|
4
|
+
:label="label ?? $tr('ui.common.planning-type','Planning type')"
|
|
5
|
+
:items="planningTypeItems"
|
|
6
|
+
:modelValue="modelValue"
|
|
7
|
+
@update:modelValue="$emit('update:modelValue', $event)"
|
|
8
|
+
/>
|
|
9
|
+
</FSCol>
|
|
10
|
+
</template>
|
|
11
|
+
|
|
12
|
+
<script lang="ts">
|
|
13
|
+
import { computed, defineComponent, type PropType } from "vue";
|
|
14
|
+
|
|
15
|
+
import {PlanningType} from "@dative-gpi/foundation-core-domain/models";
|
|
16
|
+
|
|
17
|
+
import FSSelectField from "@dative-gpi/foundation-shared-components/components/fields/FSSelectField.vue";
|
|
18
|
+
|
|
19
|
+
import {planningTypeLabel, getEnumEntries} from "../../utils";
|
|
20
|
+
|
|
21
|
+
export default defineComponent({
|
|
22
|
+
components: {
|
|
23
|
+
FSSelectField
|
|
24
|
+
},
|
|
25
|
+
props: {
|
|
26
|
+
modelValue: {
|
|
27
|
+
type: Number as PropType<PlanningType>,
|
|
28
|
+
required: false
|
|
29
|
+
},
|
|
30
|
+
label: {
|
|
31
|
+
type: String,
|
|
32
|
+
required: false
|
|
33
|
+
}
|
|
34
|
+
},
|
|
35
|
+
emits: ['update:modelValue'],
|
|
36
|
+
setup() {
|
|
37
|
+
|
|
38
|
+
const planningTypeItems = computed(()=>{
|
|
39
|
+
return getEnumEntries(PlanningType).map((f)=>{
|
|
40
|
+
return {
|
|
41
|
+
id: f.value,
|
|
42
|
+
label: planningTypeLabel(f.value)
|
|
43
|
+
}
|
|
44
|
+
})
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
return {
|
|
48
|
+
planningTypeItems
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
})
|
|
52
|
+
</script>
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<FSCol>
|
|
3
|
+
<FSSelectField
|
|
4
|
+
:label="label ?? $tr('ui.common.plot-per','Plot per')"
|
|
5
|
+
:items="plotPerItems"
|
|
6
|
+
:modelValue="modelValue"
|
|
7
|
+
@update:modelValue="$emit('update:modelValue', $event)"
|
|
8
|
+
/>
|
|
9
|
+
</FSCol>
|
|
10
|
+
</template>
|
|
11
|
+
|
|
12
|
+
<script lang="ts">
|
|
13
|
+
import { computed, defineComponent, type PropType } from "vue";
|
|
14
|
+
|
|
15
|
+
import {PlotPer} from "@dative-gpi/foundation-core-domain/models";
|
|
16
|
+
|
|
17
|
+
import FSSelectField from "@dative-gpi/foundation-shared-components/components/fields/FSSelectField.vue";
|
|
18
|
+
|
|
19
|
+
import {plotPerLabel, getEnumEntries} from "../../utils";
|
|
20
|
+
|
|
21
|
+
export default defineComponent({
|
|
22
|
+
components: {
|
|
23
|
+
FSSelectField
|
|
24
|
+
},
|
|
25
|
+
props: {
|
|
26
|
+
modelValue: {
|
|
27
|
+
type: Number as PropType<PlotPer>,
|
|
28
|
+
required: false
|
|
29
|
+
},
|
|
30
|
+
label: {
|
|
31
|
+
type: String,
|
|
32
|
+
required: false
|
|
33
|
+
}
|
|
34
|
+
},
|
|
35
|
+
emits: ['update:modelValue'],
|
|
36
|
+
setup() {
|
|
37
|
+
|
|
38
|
+
const plotPerItems = computed(()=>{
|
|
39
|
+
return getEnumEntries(PlotPer).map((f)=>{
|
|
40
|
+
return {
|
|
41
|
+
id: f.value,
|
|
42
|
+
label: plotPerLabel(f.value)
|
|
43
|
+
}
|
|
44
|
+
})
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
return {
|
|
48
|
+
plotPerItems
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
})
|
|
52
|
+
</script>
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<FSCol>
|
|
3
|
+
<FSSelectField
|
|
4
|
+
:label="label ?? $tr('ui.common.serie-type','Serie type')"
|
|
5
|
+
:items="serieTypeItems"
|
|
6
|
+
:modelValue="modelValue"
|
|
7
|
+
@update:modelValue="$emit('update:modelValue', $event)"
|
|
8
|
+
/>
|
|
9
|
+
</FSCol>
|
|
10
|
+
</template>
|
|
11
|
+
|
|
12
|
+
<script lang="ts">
|
|
13
|
+
import { computed, defineComponent, type PropType } from "vue";
|
|
14
|
+
|
|
15
|
+
import {SerieType} from "@dative-gpi/foundation-core-domain/models";
|
|
16
|
+
|
|
17
|
+
import FSSelectField from "@dative-gpi/foundation-shared-components/components/fields/FSSelectField.vue";
|
|
18
|
+
|
|
19
|
+
import {serieTypeLabel, getEnumEntries} from "../../utils";
|
|
20
|
+
|
|
21
|
+
export default defineComponent({
|
|
22
|
+
components: {
|
|
23
|
+
FSSelectField
|
|
24
|
+
},
|
|
25
|
+
props: {
|
|
26
|
+
modelValue: {
|
|
27
|
+
type: Number as PropType<SerieType>,
|
|
28
|
+
required: false
|
|
29
|
+
},
|
|
30
|
+
label: {
|
|
31
|
+
type: String,
|
|
32
|
+
required: false
|
|
33
|
+
}
|
|
34
|
+
},
|
|
35
|
+
emits: ['update:modelValue'],
|
|
36
|
+
setup() {
|
|
37
|
+
|
|
38
|
+
const serieTypeItems = computed(()=>{
|
|
39
|
+
return getEnumEntries(SerieType).map((f)=>{
|
|
40
|
+
return {
|
|
41
|
+
id: f.value,
|
|
42
|
+
label: serieTypeLabel(f.value)
|
|
43
|
+
}
|
|
44
|
+
})
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
return {
|
|
48
|
+
serieTypeItems
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
})
|
|
52
|
+
</script>
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dative-gpi/foundation-core-components",
|
|
3
3
|
"sideEffects": false,
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.221",
|
|
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": "0.0.
|
|
14
|
-
"@dative-gpi/foundation-core-services": "0.0.
|
|
15
|
-
"@dative-gpi/foundation-shared-components": "0.0.
|
|
16
|
-
"@dative-gpi/foundation-shared-domain": "0.0.
|
|
17
|
-
"@dative-gpi/foundation-shared-services": "0.0.
|
|
13
|
+
"@dative-gpi/foundation-core-domain": "0.0.221",
|
|
14
|
+
"@dative-gpi/foundation-core-services": "0.0.221",
|
|
15
|
+
"@dative-gpi/foundation-shared-components": "0.0.221",
|
|
16
|
+
"@dative-gpi/foundation-shared-domain": "0.0.221",
|
|
17
|
+
"@dative-gpi/foundation-shared-services": "0.0.221"
|
|
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": "6fbd963beb2ddf8fdeab7d8fcca490be6757b36f"
|
|
30
30
|
}
|
package/utils/charts.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { useTranslations as useTranslationsProvider } from "@dative-gpi/bones-ui/composables";
|
|
2
2
|
import type { ColorBase} from "@dative-gpi/foundation-shared-components/models";
|
|
3
3
|
import { ColorEnum } from "@dative-gpi/foundation-shared-components/models";
|
|
4
|
-
import { ChartOrigin } from "@dative-gpi/foundation-core-domain/models";
|
|
4
|
+
import { AggregationType, AxisType, ChartOrigin, DisplayAs, FilterType, HeatmapRule, OperationOn, PlanningType, PlotPer, SerieType } from "@dative-gpi/foundation-core-domain/models";
|
|
5
5
|
|
|
6
6
|
const { $tr } = useTranslationsProvider();
|
|
7
7
|
|
|
@@ -19,4 +19,131 @@ export const chartOriginColor = (type: ChartOrigin): ColorBase => {
|
|
|
19
19
|
case ChartOrigin.Organisation: return ColorEnum.Primary;
|
|
20
20
|
case ChartOrigin.OrganisationType: return ColorEnum.Warning;
|
|
21
21
|
}
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
export const aggregationTypeLabel = (aggregationType : AggregationType): string => {
|
|
25
|
+
switch (aggregationType) {
|
|
26
|
+
case AggregationType.None : return $tr("ui.common.none", "None");
|
|
27
|
+
case AggregationType.Sum : return $tr("ui.common.sum", "Sum");
|
|
28
|
+
case AggregationType.Cardinal : return $tr("ui.common.cardinal", "Cardinal");
|
|
29
|
+
case AggregationType.Mean : return $tr("ui.common.cean", "Mean");
|
|
30
|
+
case AggregationType.Median : return $tr("ui.common.median", "Median");
|
|
31
|
+
case AggregationType.First : return $tr("ui.common.first", "First");
|
|
32
|
+
case AggregationType.Last : return $tr("ui.common.last", "Last");
|
|
33
|
+
case AggregationType.Difference : return $tr("ui.common.difference", "Difference");
|
|
34
|
+
case AggregationType.Minimum : return $tr("ui.common.minimum", "Minimum");
|
|
35
|
+
case AggregationType.Maximum : return $tr("ui.common.maximum", "Maximum");
|
|
36
|
+
case AggregationType.Range : return $tr("ui.common.range", "Range");
|
|
37
|
+
default : return "";
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export const axisTypeLabel = (axisType: AxisType | number): string => {
|
|
42
|
+
switch (axisType) {
|
|
43
|
+
case AxisType.None : return $tr("ui.common.none", "None");
|
|
44
|
+
case AxisType.Date : return $tr("ui.common.date", "Date");
|
|
45
|
+
case AxisType.Value : return $tr("ui.common.value", "Value");
|
|
46
|
+
case AxisType.Category : return $tr("ui.common.category", "Category");
|
|
47
|
+
default : return "";
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
export const displayAsLabel = (display: DisplayAs | number): string => {
|
|
52
|
+
|
|
53
|
+
switch (display) {
|
|
54
|
+
case DisplayAs.None : return $tr("ui.common.none", "None");
|
|
55
|
+
case DisplayAs.Bars : return $tr("ui.common.bars", "Bars");
|
|
56
|
+
case DisplayAs.Lines : return $tr("ui.common.lines", "Lines");
|
|
57
|
+
case DisplayAs.Points : return $tr("ui.common.point", "Points");
|
|
58
|
+
default : return "";
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
export const filterTypeLabel = (filterType: FilterType | number): string => {
|
|
63
|
+
switch (filterType) {
|
|
64
|
+
case FilterType.None : return $tr("ui.common.none", "None");
|
|
65
|
+
case FilterType.Contains : return $tr("ui.common.contains", "contains");
|
|
66
|
+
case FilterType.Different : return "≠";
|
|
67
|
+
case FilterType.EndsWith : return $tr("ui.common.end-width", "end with") ;
|
|
68
|
+
case FilterType.Equal : return "=";
|
|
69
|
+
case FilterType.Less : return "<";
|
|
70
|
+
case FilterType.LessOrEqual : return "≤";
|
|
71
|
+
case FilterType.More : return ">";
|
|
72
|
+
case FilterType.MoreOrEqual : return "≥";
|
|
73
|
+
case FilterType.StartsWith : return $tr("ui.common.starts-with", "start with");
|
|
74
|
+
default : return "";
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
export const heatmapRuleLabel = (heatMap: HeatmapRule | number): string => {
|
|
79
|
+
switch (heatMap) {
|
|
80
|
+
case HeatmapRule.None : return $tr("ui.common.none", "None");
|
|
81
|
+
case HeatmapRule.Gradient : return $tr("ui.common.gradient", "Gradient");
|
|
82
|
+
case HeatmapRule.Ranges : return $tr("ui.common.ranges", "Ranges");
|
|
83
|
+
case HeatmapRule.Fixed : return $tr("ui.common.fixed", "Fixed");
|
|
84
|
+
default : return "";
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
export const operationOnLabel = (operationOn: OperationOn | number): string => {
|
|
89
|
+
|
|
90
|
+
switch (operationOn) {
|
|
91
|
+
case OperationOn.None : return $tr("ui.common.none", "None");
|
|
92
|
+
case OperationOn.SameEntity : return $tr("ui.common.same-entity", "Same entity");
|
|
93
|
+
case OperationOn.SameGroup : return $tr("ui.common.same-group", "Same group");
|
|
94
|
+
case OperationOn.SameGroupAndEntity : return $tr("ui.common.same-group-entity", "Same group and entity");
|
|
95
|
+
default : return "";
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
export const planningTypeLabel = (planningType : PlanningType | number): string => {
|
|
100
|
+
switch (planningType) {
|
|
101
|
+
case PlanningType.None : return $tr("ui.common.none", "None");
|
|
102
|
+
case PlanningType.UntilNext : return $tr("ui.common.until-next", "Until next");
|
|
103
|
+
case PlanningType.ElapsedTime : return $tr("ui.common.elapsed-time", "Elapsed time");
|
|
104
|
+
case PlanningType.SinglePoint : return $tr("ui.common.single-point", "Single point");
|
|
105
|
+
default : return "";
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
export const plotPerLabel = (plotper: PlotPer | number): string => {
|
|
110
|
+
|
|
111
|
+
switch (plotper) {
|
|
112
|
+
case PlotPer.None : return $tr("ui.common.none", "None");
|
|
113
|
+
case PlotPer.SinglePlot : return $tr("ui.common.single-slot", "Single slot");
|
|
114
|
+
case PlotPer.Model : return $tr("ui.common.model", "Model");
|
|
115
|
+
case PlotPer.Group : return $tr("ui.common.group", "Group");
|
|
116
|
+
case PlotPer.Location : return $tr("ui.common.location", "Location");
|
|
117
|
+
case PlotPer.Device : return $tr("ui.common.device", "Device");
|
|
118
|
+
default : return "";
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
export const serieTypeLabel = (serieType : SerieType): string => {
|
|
123
|
+
switch (serieType) {
|
|
124
|
+
case SerieType.Lines : return $tr("ui.common.lines", "Lines");
|
|
125
|
+
case SerieType.Area : return $tr("ui.common.area", "Area");
|
|
126
|
+
case SerieType.Range : return $tr("ui.common.range", "Range");
|
|
127
|
+
case SerieType.Histogram : return $tr("ui.common.histogram", "Histogram");
|
|
128
|
+
case SerieType.Operation : return $tr("ui.common.operation", "Operation");
|
|
129
|
+
case SerieType.Planning : return $tr("ui.common.planning", "Planning");
|
|
130
|
+
case SerieType.ScatterPlot : return $tr("ui.common.scatter-plot", "Scatter plot");
|
|
131
|
+
case SerieType.Top : return $tr("ui.common.top", "Top");
|
|
132
|
+
case SerieType.Bars : return $tr("ui.common.bars", "Bars");
|
|
133
|
+
case SerieType.StackedBars : return $tr("ui.common.stacked-bars", "Stacked bars");
|
|
134
|
+
case SerieType.Pie : return $tr("ui.common.pie", "Pie");
|
|
135
|
+
case SerieType.Heatmap : return $tr('ui.common.heatmap', 'Heatmap');
|
|
136
|
+
case SerieType.Slider : return $tr("ui.common.slider", "Slider");
|
|
137
|
+
case SerieType.Gauge : return $tr("ui.common.gauge", "Gauge");
|
|
138
|
+
case SerieType.ScoreCard : return $tr("ui.common.score-card", "Score card");
|
|
139
|
+
case SerieType.Table : return $tr("ui.common.table", "Table");
|
|
140
|
+
default : return "";
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
|
|
145
|
+
export const getEnumEntries = (e: any) => {
|
|
146
|
+
return Object.keys(e)
|
|
147
|
+
.filter(key => isNaN(Number(key)))
|
|
148
|
+
.map(key => ({key : key, value : e[key]}));
|
|
22
149
|
};
|