@webitel/ui-sdk 3.1.46 → 3.1.47
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/package.json
CHANGED
|
@@ -22,6 +22,7 @@ export const useTableStore = (namespace) => {
|
|
|
22
22
|
|
|
23
23
|
const search = computed(() => getNamespacedState(store.state, tableNamespace).search);
|
|
24
24
|
|
|
25
|
+
const error = computed(() => getNamespacedState(store.state, tableNamespace).errors);
|
|
25
26
|
async function loadData() {
|
|
26
27
|
return store.dispatch(`${tableNamespace}/LOAD_DATA_LIST`);
|
|
27
28
|
}
|
|
@@ -69,6 +70,7 @@ export const useTableStore = (namespace) => {
|
|
|
69
70
|
page,
|
|
70
71
|
size,
|
|
71
72
|
search,
|
|
73
|
+
error,
|
|
72
74
|
|
|
73
75
|
loadData,
|
|
74
76
|
setSize,
|
|
@@ -12,6 +12,7 @@ export default class TableStoreModule extends BaseStoreModule {
|
|
|
12
12
|
search: '',
|
|
13
13
|
page: 1,
|
|
14
14
|
sort: '',
|
|
15
|
+
error: {},
|
|
15
16
|
isLoading: false,
|
|
16
17
|
isNextPage: false,
|
|
17
18
|
};
|
|
@@ -43,6 +44,7 @@ export default class TableStoreModule extends BaseStoreModule {
|
|
|
43
44
|
context.dispatch('AFTER_SET_DATA_LIST_HOOK', afterHook);
|
|
44
45
|
} catch (err) {
|
|
45
46
|
console.error(err);
|
|
47
|
+
context.commit('SET_ERROR', err);
|
|
46
48
|
} finally {
|
|
47
49
|
context.commit('SET_LOADING', false);
|
|
48
50
|
}
|
|
@@ -175,6 +177,9 @@ export default class TableStoreModule extends BaseStoreModule {
|
|
|
175
177
|
SET_LOADING: (state, value) => {
|
|
176
178
|
state.isLoading = value;
|
|
177
179
|
},
|
|
180
|
+
SET_ERROR: (state, value) => {
|
|
181
|
+
state.error = value;
|
|
182
|
+
},
|
|
178
183
|
};
|
|
179
184
|
|
|
180
185
|
constructor({ headers = [] }) {
|