@dative-gpi/foundation-core-components 0.0.84 → 0.0.85
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/FSDataTable.vue +37 -31
- package/package.json +7 -7
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<FSLoadDataTable
|
|
3
|
-
v-if="
|
|
3
|
+
v-if="gettingUserOrganisationTable"
|
|
4
4
|
/>
|
|
5
5
|
<FSDataTableUI
|
|
6
6
|
v-else
|
|
@@ -18,14 +18,20 @@
|
|
|
18
18
|
@update:page="updatePage"
|
|
19
19
|
v-bind="$attrs"
|
|
20
20
|
>
|
|
21
|
-
<template
|
|
22
|
-
|
|
21
|
+
<template
|
|
22
|
+
v-for="(_, name) in $slots"
|
|
23
|
+
v-slot:[name]="slotData"
|
|
24
|
+
>
|
|
25
|
+
<slot
|
|
26
|
+
:name="name"
|
|
27
|
+
v-bind="slotData"
|
|
28
|
+
/>
|
|
23
29
|
</template>
|
|
24
30
|
</FSDataTableUI>
|
|
25
31
|
</template>
|
|
26
32
|
|
|
27
33
|
<script lang="ts">
|
|
28
|
-
import { defineComponent,
|
|
34
|
+
import { defineComponent, onUnmounted, ref, Ref, watch } from "vue";
|
|
29
35
|
import { useRouter } from "vue-router";
|
|
30
36
|
|
|
31
37
|
import { useUserOrganisationTable, useUpdateUserOrganisationTable } from "@dative-gpi/foundation-core-services/composables";
|
|
@@ -48,8 +54,8 @@ export default defineComponent({
|
|
|
48
54
|
}
|
|
49
55
|
},
|
|
50
56
|
setup(props) {
|
|
51
|
-
const { get, getting, entity } = useUserOrganisationTable();
|
|
52
|
-
const { update } = useUpdateUserOrganisationTable();
|
|
57
|
+
const { get: getUserOrganisationTable, getting: gettingUserOrganisationTable, entity: userOrganisationTable } = useUserOrganisationTable();
|
|
58
|
+
const { update: updateUserOrganisationTable } = useUpdateUserOrganisationTable();
|
|
53
59
|
const { debounce, cancel } = useDebounce();
|
|
54
60
|
const router = useRouter();
|
|
55
61
|
|
|
@@ -63,24 +69,26 @@ export default defineComponent({
|
|
|
63
69
|
const reset = (): void => {
|
|
64
70
|
if (router && router.currentRoute.value.query[props.tableCode]) {
|
|
65
71
|
const query = JSON.parse(router.currentRoute.value.query[props.tableCode] as string);
|
|
66
|
-
innerHeaders.value = query.columns;
|
|
72
|
+
// innerHeaders.value = query.columns;
|
|
73
|
+
// innerFilters.value = query.filters;
|
|
67
74
|
innerRowsPerPage.value = query.rowsPerPage;
|
|
68
75
|
innerSortBy.value = query.sortByKey ? {
|
|
69
76
|
key: query.sortByKey,
|
|
70
77
|
order: query.sortByOrder
|
|
71
78
|
} : null;
|
|
72
79
|
innerMode.value = query.mode;
|
|
73
|
-
innerFilters.value = query.filters;
|
|
74
80
|
innerPage.value = query.page;
|
|
75
81
|
}
|
|
76
|
-
else {
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
order: entity.value.sortByOrder
|
|
82
|
+
else if (userOrganisationTable.value) {
|
|
83
|
+
innerRowsPerPage.value = userOrganisationTable.value.rowsPerPage;
|
|
84
|
+
innerSortBy.value = userOrganisationTable.value.sortByKey ? {
|
|
85
|
+
key: userOrganisationTable.value.sortByKey!,
|
|
86
|
+
order: userOrganisationTable.value.sortByOrder!
|
|
82
87
|
} : null;
|
|
83
|
-
innerMode.value =
|
|
88
|
+
innerMode.value = userOrganisationTable.value.mode;
|
|
89
|
+
}
|
|
90
|
+
if (userOrganisationTable.value) {
|
|
91
|
+
innerHeaders.value = userOrganisationTable.value.columns;
|
|
84
92
|
}
|
|
85
93
|
};
|
|
86
94
|
|
|
@@ -116,7 +124,7 @@ export default defineComponent({
|
|
|
116
124
|
|
|
117
125
|
const updateTable = (): void => {
|
|
118
126
|
updateRouter();
|
|
119
|
-
|
|
127
|
+
updateUserOrganisationTable(props.tableCode, {
|
|
120
128
|
columns: innerHeaders.value.map(column => ({
|
|
121
129
|
columnId: column.columnId,
|
|
122
130
|
hidden: column.hidden,
|
|
@@ -135,12 +143,12 @@ export default defineComponent({
|
|
|
135
143
|
query: {
|
|
136
144
|
...router.currentRoute.value.query,
|
|
137
145
|
[props.tableCode]: JSON.stringify({
|
|
138
|
-
columns: innerHeaders.value,
|
|
146
|
+
// columns: innerHeaders.value,
|
|
147
|
+
// filters: innerFilters.value,
|
|
139
148
|
rowsPerPage: innerRowsPerPage.value,
|
|
140
149
|
sortByKey: innerSortBy.value?.key,
|
|
141
150
|
sortByOrder: innerSortBy.value?.order,
|
|
142
151
|
mode: innerMode.value,
|
|
143
|
-
filters: innerFilters.value,
|
|
144
152
|
page: innerPage.value
|
|
145
153
|
})
|
|
146
154
|
}
|
|
@@ -148,36 +156,34 @@ export default defineComponent({
|
|
|
148
156
|
}
|
|
149
157
|
};
|
|
150
158
|
|
|
151
|
-
onMounted(() => {
|
|
152
|
-
get(props.tableCode);
|
|
153
|
-
});
|
|
154
|
-
|
|
155
159
|
onUnmounted(() => {
|
|
156
160
|
cancel();
|
|
157
161
|
updateTable();
|
|
158
162
|
});
|
|
159
163
|
|
|
160
164
|
watch(() => props.tableCode, () => {
|
|
161
|
-
|
|
162
|
-
|
|
165
|
+
if (props.tableCode) {
|
|
166
|
+
getUserOrganisationTable(props.tableCode);
|
|
167
|
+
}
|
|
168
|
+
}, { immediate: true });
|
|
163
169
|
|
|
164
|
-
watch(
|
|
170
|
+
watch(userOrganisationTable, () => {
|
|
165
171
|
reset();
|
|
166
172
|
});
|
|
167
173
|
|
|
168
174
|
return {
|
|
169
|
-
|
|
170
|
-
innerHeaders,
|
|
175
|
+
gettingUserOrganisationTable,
|
|
171
176
|
innerRowsPerPage,
|
|
177
|
+
innerFilters,
|
|
178
|
+
innerHeaders,
|
|
172
179
|
innerSortBy,
|
|
173
180
|
innerMode,
|
|
174
|
-
innerFilters,
|
|
175
181
|
innerPage,
|
|
176
|
-
updateHeaders,
|
|
177
|
-
updateMode,
|
|
178
|
-
updateSortBy,
|
|
179
182
|
updateRowsPerPage,
|
|
180
183
|
updateFilters,
|
|
184
|
+
updateHeaders,
|
|
185
|
+
updateSortBy,
|
|
186
|
+
updateMode,
|
|
181
187
|
updatePage
|
|
182
188
|
};
|
|
183
189
|
},
|
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.85",
|
|
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.85",
|
|
14
|
+
"@dative-gpi/foundation-core-services": "0.0.85",
|
|
15
|
+
"@dative-gpi/foundation-shared-components": "0.0.85",
|
|
16
|
+
"@dative-gpi/foundation-shared-domain": "0.0.85",
|
|
17
|
+
"@dative-gpi/foundation-shared-services": "0.0.85",
|
|
18
18
|
"color": "^4.2.3",
|
|
19
19
|
"vue": "^3.4.23",
|
|
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": "9c0b770f8b54cce1cd3aa7c25c91ad1a99b08862"
|
|
28
28
|
}
|