@dative-gpi/foundation-core-components 0.0.69 → 0.0.70
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.
|
@@ -28,8 +28,8 @@
|
|
|
28
28
|
import { defineComponent, onMounted, onUnmounted, ref, Ref, watch } from "vue";
|
|
29
29
|
import { useRouter } from "vue-router";
|
|
30
30
|
|
|
31
|
+
import { useUserOrganisationTable, useUpdateUserOrganisationTable } from "@dative-gpi/foundation-core-services/composables";
|
|
31
32
|
import { FSDataTableColumn, FSDataTableFilter, FSDataTableOrder } from "@dative-gpi/foundation-shared-components/models";
|
|
32
|
-
import { useTable, useUpdateTable } from "@dative-gpi/foundation-core-services/composables";
|
|
33
33
|
import { useDebounce } from "@dative-gpi/foundation-shared-components/composables";
|
|
34
34
|
|
|
35
35
|
import FSLoadDataTable from "@dative-gpi/foundation-shared-components/components/lists/FSLoadDataTable.vue";
|
|
@@ -48,9 +48,9 @@ export default defineComponent({
|
|
|
48
48
|
}
|
|
49
49
|
},
|
|
50
50
|
setup(props) {
|
|
51
|
-
const { get, getting, entity } =
|
|
51
|
+
const { get, getting, entity } = useUserOrganisationTable();
|
|
52
|
+
const { update } = useUpdateUserOrganisationTable();
|
|
52
53
|
const { debounce, cancel } = useDebounce();
|
|
53
|
-
const { update } = useUpdateTable();
|
|
54
54
|
const router = useRouter();
|
|
55
55
|
|
|
56
56
|
const innerHeaders: Ref<FSDataTableColumn[]> = ref([]);
|
|
@@ -65,7 +65,10 @@ export default defineComponent({
|
|
|
65
65
|
const query = JSON.parse(router.currentRoute.value.query[props.tableCode] as string);
|
|
66
66
|
innerHeaders.value = query.columns;
|
|
67
67
|
innerRowsPerPage.value = query.rowsPerPage;
|
|
68
|
-
innerSortBy.value = query.
|
|
68
|
+
innerSortBy.value = query.sortByKey ? {
|
|
69
|
+
key: query.sortByKey,
|
|
70
|
+
order: query.sortByOrder
|
|
71
|
+
} : null;
|
|
69
72
|
innerMode.value = query.mode;
|
|
70
73
|
innerFilters.value = query.filters;
|
|
71
74
|
innerPage.value = query.page;
|
|
@@ -73,7 +76,10 @@ export default defineComponent({
|
|
|
73
76
|
else {
|
|
74
77
|
innerHeaders.value = entity.value.columns;
|
|
75
78
|
innerRowsPerPage.value = entity.value.rowsPerPage;
|
|
76
|
-
innerSortBy.value = entity.value.
|
|
79
|
+
innerSortBy.value = entity.value.sortByKey ? {
|
|
80
|
+
key: entity.value.sortByKey,
|
|
81
|
+
order: entity.value.sortByOrder
|
|
82
|
+
} : null;
|
|
77
83
|
innerMode.value = entity.value.mode;
|
|
78
84
|
}
|
|
79
85
|
};
|
|
@@ -117,7 +123,8 @@ export default defineComponent({
|
|
|
117
123
|
index: column.index
|
|
118
124
|
})),
|
|
119
125
|
rowsPerPage: innerRowsPerPage.value,
|
|
120
|
-
|
|
126
|
+
sortByKey: innerSortBy.value?.key,
|
|
127
|
+
sortByOrder: innerSortBy.value?.order,
|
|
121
128
|
mode: innerMode.value
|
|
122
129
|
});
|
|
123
130
|
};
|
|
@@ -130,7 +137,8 @@ export default defineComponent({
|
|
|
130
137
|
[props.tableCode]: JSON.stringify({
|
|
131
138
|
columns: innerHeaders.value,
|
|
132
139
|
rowsPerPage: innerRowsPerPage.value,
|
|
133
|
-
|
|
140
|
+
sortByKey: innerSortBy.value?.key,
|
|
141
|
+
sortByOrder: innerSortBy.value?.order,
|
|
134
142
|
mode: innerMode.value,
|
|
135
143
|
filters: innerFilters.value,
|
|
136
144
|
page: innerPage.value
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<FSLoadTile
|
|
3
|
+
v-if="getting"
|
|
4
|
+
:editable="$props.editable"
|
|
5
|
+
:modelValue="modelValue"
|
|
6
|
+
@update:modelValue="(value) => $emit('update:modelValue', value)"
|
|
7
|
+
/>
|
|
8
|
+
<FSGroupTileUI
|
|
9
|
+
v-else-if="entity"
|
|
10
|
+
:imageId="entity.imageId"
|
|
11
|
+
:name="name"
|
|
12
|
+
:roleLabel="entity.roleLabel"
|
|
13
|
+
:roleIcon="entity.roleIcon"
|
|
14
|
+
:editable="$props.editable"
|
|
15
|
+
:modelValue="modelValue"
|
|
16
|
+
@update:modelValue="(value) => $emit('update:modelValue', value)"
|
|
17
|
+
v-bind="$attrs"
|
|
18
|
+
/>
|
|
19
|
+
</template>
|
|
20
|
+
|
|
21
|
+
<script lang="ts">
|
|
22
|
+
import { computed, defineComponent, onMounted, watch } from "vue";
|
|
23
|
+
|
|
24
|
+
import { useUserOrganisation } from "@dative-gpi/foundation-core-services/composables";
|
|
25
|
+
|
|
26
|
+
import FSUserOrganisationTileUI from "@dative-gpi/foundation-shared-components/components/tiles/FSUserOrganisationTileUI.vue";
|
|
27
|
+
import FSLoadTile from "@dative-gpi/foundation-shared-components/components/tiles/FSLoadTile.vue";
|
|
28
|
+
import { UserType } from "@dative-gpi/foundation-core-domain/models";
|
|
29
|
+
|
|
30
|
+
export default defineComponent({
|
|
31
|
+
name: "FSUserOrganisationTile",
|
|
32
|
+
components: {
|
|
33
|
+
FSUserOrganisationTileUI,
|
|
34
|
+
FSLoadTile
|
|
35
|
+
},
|
|
36
|
+
props: {
|
|
37
|
+
userOrganisationId: {
|
|
38
|
+
type: String,
|
|
39
|
+
required: true
|
|
40
|
+
},
|
|
41
|
+
modelValue: {
|
|
42
|
+
type: Boolean,
|
|
43
|
+
required: false,
|
|
44
|
+
default: false
|
|
45
|
+
},
|
|
46
|
+
editable: {
|
|
47
|
+
type: Boolean,
|
|
48
|
+
required: false,
|
|
49
|
+
default: true
|
|
50
|
+
}
|
|
51
|
+
},
|
|
52
|
+
setup(props) {
|
|
53
|
+
const { get, getting, entity } = useUserOrganisation();
|
|
54
|
+
|
|
55
|
+
const name = computed((): string => {
|
|
56
|
+
if (entity.value) {
|
|
57
|
+
switch (entity.value.userType) {
|
|
58
|
+
case UserType.User: return entity.value.name;
|
|
59
|
+
default: return entity.value.label;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
return "";
|
|
63
|
+
});
|
|
64
|
+
|
|
65
|
+
onMounted(() => {
|
|
66
|
+
get(props.userOrganisationId);
|
|
67
|
+
});
|
|
68
|
+
|
|
69
|
+
watch(() => props.userOrganisationId, () => {
|
|
70
|
+
get(props.userOrganisationId);
|
|
71
|
+
});
|
|
72
|
+
|
|
73
|
+
return {
|
|
74
|
+
getting,
|
|
75
|
+
entity,
|
|
76
|
+
name
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
});
|
|
80
|
+
</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.70",
|
|
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.70",
|
|
14
|
+
"@dative-gpi/foundation-core-services": "0.0.70",
|
|
15
|
+
"@dative-gpi/foundation-shared-components": "0.0.70",
|
|
16
|
+
"@dative-gpi/foundation-shared-domain": "0.0.70",
|
|
17
|
+
"@dative-gpi/foundation-shared-services": "0.0.70",
|
|
18
18
|
"color": "^4.2.3",
|
|
19
19
|
"vue": "^3.2.0",
|
|
20
20
|
"vuedraggable": "^4.1.0"
|
|
@@ -24,5 +24,5 @@
|
|
|
24
24
|
"sass": "^1.69.5",
|
|
25
25
|
"sass-loader": "^13.3.2"
|
|
26
26
|
},
|
|
27
|
-
"gitHead": "
|
|
27
|
+
"gitHead": "e280ffdb9ee5d27727cc01325689b792168febcd"
|
|
28
28
|
}
|