@hostlink/nuxt-light 0.0.76 → 0.0.78
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/dist/module.json +1 -1
- package/dist/runtime/components/l-app-main.vue +5 -1
- package/dist/runtime/components/l-audit-card.vue +1 -1
- package/dist/runtime/components/l-card.vue +17 -6
- package/dist/runtime/components/l-customizer.vue +28 -8
- package/dist/runtime/components/l-table.vue +41 -17
- package/dist/runtime/components/l-tabs.vue +5 -1
- package/dist/runtime/lib/GQLFieldBuilder.d.ts +5 -0
- package/dist/runtime/lib/GQLFieldBuilder.mjs +35 -0
- package/dist/runtime/lib/index.d.ts +2 -1
- package/dist/runtime/lib/index.mjs +3 -1
- package/dist/runtime/lib/q.mjs +2 -2
- package/dist/runtime/pages/MailLog/index.vue +1 -4
- package/dist/runtime/pages/Permission/all.vue +12 -12
- package/dist/runtime/pages/Permission/export.vue +13 -5
- package/dist/runtime/pages/Permission/index.vue +2 -5
- package/dist/runtime/pages/System/database/backup.vue +1 -0
- package/dist/runtime/pages/System/database/table.vue +11 -2
- package/dist/runtime/pages/System/setting.vue +0 -2
- package/dist/runtime/pages/User/index.vue +3 -9
- package/package.json +1 -1
package/dist/module.json
CHANGED
|
@@ -34,6 +34,7 @@ if (my.granted_storage) {
|
|
|
34
34
|
|
|
35
35
|
light.setStyles(my.styles);
|
|
36
36
|
|
|
37
|
+
|
|
37
38
|
const menus = ref(app.menus)
|
|
38
39
|
|
|
39
40
|
const i18n = useI18n();
|
|
@@ -136,6 +137,9 @@ watch(() => style.color, async (value) => {
|
|
|
136
137
|
name: "color",
|
|
137
138
|
value: value
|
|
138
139
|
})
|
|
140
|
+
|
|
141
|
+
my.styles["color"] = value;
|
|
142
|
+
light.setStyles(my.styles);
|
|
139
143
|
})
|
|
140
144
|
|
|
141
145
|
watch(() => style.theme, async (value) => {
|
|
@@ -191,7 +195,7 @@ const storageUsagePercent = computed(() => {
|
|
|
191
195
|
|
|
192
196
|
<template>
|
|
193
197
|
<q-layout :view="layoutView">
|
|
194
|
-
<q-header bordered class="text-white" :class="style.color">
|
|
198
|
+
<q-header bordered class="text-white" :class="`bg-${style.color}`">
|
|
195
199
|
<q-toolbar>
|
|
196
200
|
<q-btn dense flat round icon="menu" class="q-mr-sm" @click="toggleLeftDrawer" />
|
|
197
201
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<script setup>
|
|
2
2
|
import { useLight } from '../'
|
|
3
|
-
import { useAttrs } from 'vue'
|
|
3
|
+
import { useAttrs, ref, computed } from 'vue'
|
|
4
4
|
|
|
5
5
|
defineProps({
|
|
6
6
|
loading: Boolean,
|
|
@@ -16,16 +16,27 @@ const attrs = {
|
|
|
16
16
|
bordered: light.getStyle("cardBordered", true),
|
|
17
17
|
square: light.getStyle("cardSquare", false),
|
|
18
18
|
}, ...useAttrs()
|
|
19
|
-
|
|
20
19
|
}
|
|
21
20
|
|
|
21
|
+
const color = light.getStyle("color", 'primary');
|
|
22
|
+
|
|
23
|
+
const cl = ["text-white", `bg-${color}`];
|
|
24
|
+
|
|
25
|
+
const minimize = ref(false);
|
|
26
|
+
|
|
27
|
+
const icon = computed(() => minimize.value ? "sym_o_add" : "sym_o_remove");
|
|
22
28
|
</script>
|
|
23
29
|
<template>
|
|
24
30
|
<q-card v-bind="attrs">
|
|
25
|
-
<q-
|
|
26
|
-
<
|
|
27
|
-
|
|
28
|
-
|
|
31
|
+
<q-bar :class="cl" v-if="title">
|
|
32
|
+
<div>{{ title }}</div>
|
|
33
|
+
<q-space />
|
|
34
|
+
<q-btn dense flat :icon="icon" @click="minimize = !minimize" />
|
|
35
|
+
</q-bar>
|
|
36
|
+
<template v-if="!minimize">
|
|
37
|
+
<slot></slot>
|
|
38
|
+
</template>
|
|
39
|
+
|
|
29
40
|
|
|
30
41
|
<q-inner-loading :showing="loading" label="Please wait..." label-class="text-primary" />
|
|
31
42
|
</q-card>
|
|
@@ -1,12 +1,32 @@
|
|
|
1
1
|
<script setup>
|
|
2
2
|
const COLORS = [
|
|
3
|
-
'
|
|
4
|
-
'
|
|
5
|
-
'
|
|
6
|
-
'
|
|
7
|
-
'
|
|
8
|
-
'
|
|
9
|
-
'
|
|
3
|
+
'primary',
|
|
4
|
+
'secondary',
|
|
5
|
+
'positive',
|
|
6
|
+
'negative',
|
|
7
|
+
'info',
|
|
8
|
+
'warning',
|
|
9
|
+
'dark',
|
|
10
|
+
'red',
|
|
11
|
+
'pink',
|
|
12
|
+
'purple',
|
|
13
|
+
'deep-purple',
|
|
14
|
+
'indigo',
|
|
15
|
+
'blue',
|
|
16
|
+
'light-blue',
|
|
17
|
+
'cyan',
|
|
18
|
+
'teal',
|
|
19
|
+
'green',
|
|
20
|
+
'light-green',
|
|
21
|
+
'lime',
|
|
22
|
+
'yellow',
|
|
23
|
+
'amber',
|
|
24
|
+
'orange',
|
|
25
|
+
'deep-orange',
|
|
26
|
+
'brown',
|
|
27
|
+
'grey',
|
|
28
|
+
'blue-grey'
|
|
29
|
+
|
|
10
30
|
]
|
|
11
31
|
|
|
12
32
|
defineEmits(['update:theme', 'update:menuOverlayHeader', 'update:dense', 'update:headerColor', 'update:miniState'])
|
|
@@ -62,7 +82,7 @@ const props = defineProps({
|
|
|
62
82
|
<q-item-section>
|
|
63
83
|
<q-item-label>Header color</q-item-label>
|
|
64
84
|
<div class="row">
|
|
65
|
-
<div v-for="c in COLORS" :key="c" :class="c" style="width: 1.5rem; height: 1.5rem;"
|
|
85
|
+
<div v-for="c in COLORS" :key="c" :class="`bg-${c}`" style="width: 1.5rem; height: 1.5rem;"
|
|
66
86
|
class="q-ma-xs cursor-pointer rounded-borders" @click="$emit('update:headerColor', c)" />
|
|
67
87
|
</div>
|
|
68
88
|
</q-item-section>
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
2
|
import { useQuasar, QTable } from 'quasar';
|
|
3
3
|
import { ref, computed, onMounted, useSlots, reactive, useAttrs } from "vue";
|
|
4
|
-
import { t, deleteObject, q, f, useLight } from '../';
|
|
4
|
+
import { t, deleteObject, q, f, useLight, GQLFieldBuilder } from '../';
|
|
5
|
+
import { toQuery } from '@hostlink/light'
|
|
5
6
|
|
|
6
7
|
const errors = ref<InstanceType<any>>([]);
|
|
7
8
|
|
|
@@ -21,6 +22,7 @@ const props = defineProps({
|
|
|
21
22
|
searchType?: string,
|
|
22
23
|
searchOptions?: Array<any>,
|
|
23
24
|
field?: string | Object,
|
|
25
|
+
gqlField?: string | Array<string> | Object,
|
|
24
26
|
}>
|
|
25
27
|
},
|
|
26
28
|
actions: {
|
|
@@ -194,6 +196,15 @@ const getData = async (
|
|
|
194
196
|
limit: number,
|
|
195
197
|
fields: Array<string> = []) => {
|
|
196
198
|
|
|
199
|
+
const query: any = {};
|
|
200
|
+
query[operation] = {
|
|
201
|
+
meta: {
|
|
202
|
+
total: true,
|
|
203
|
+
key: true,
|
|
204
|
+
name: true
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
|
|
197
208
|
let offset_limit: any = {}
|
|
198
209
|
if (offset) {
|
|
199
210
|
offset_limit.offset = offset;
|
|
@@ -203,6 +214,12 @@ const getData = async (
|
|
|
203
214
|
offset_limit.limit = limit;
|
|
204
215
|
}
|
|
205
216
|
|
|
217
|
+
if (offset_limit) {
|
|
218
|
+
query[operation].data = {
|
|
219
|
+
__args: offset_limit
|
|
220
|
+
};
|
|
221
|
+
}
|
|
222
|
+
|
|
206
223
|
let params: any = {}
|
|
207
224
|
if (sort) {
|
|
208
225
|
params.sort = sort;
|
|
@@ -212,7 +229,13 @@ const getData = async (
|
|
|
212
229
|
params.filters = filters
|
|
213
230
|
}
|
|
214
231
|
|
|
215
|
-
|
|
232
|
+
query[operation].__args = params;
|
|
233
|
+
|
|
234
|
+
query[operation].data = query[operation].data || {};
|
|
235
|
+
Object.assign(query[operation].data, fields);
|
|
236
|
+
|
|
237
|
+
const resp = await q(query);
|
|
238
|
+
return resp[operation];
|
|
216
239
|
|
|
217
240
|
}
|
|
218
241
|
|
|
@@ -226,41 +249,43 @@ const onRequest = async (p: any) => {
|
|
|
226
249
|
},
|
|
227
250
|
async loadData(operation: string, filters: any = null, fields: Array<any> = []) {
|
|
228
251
|
|
|
252
|
+
|
|
253
|
+
const builder = GQLFieldBuilder();
|
|
254
|
+
|
|
229
255
|
//
|
|
230
|
-
let localFields: Array<any> = [];
|
|
231
256
|
|
|
232
257
|
if (props.rowKey) {
|
|
233
|
-
|
|
258
|
+
builder.add(props.rowKey);
|
|
234
259
|
}
|
|
235
260
|
|
|
236
261
|
fields.forEach((f) => {
|
|
237
|
-
|
|
262
|
+
builder.add(f);
|
|
238
263
|
});
|
|
239
264
|
|
|
240
265
|
props.columns?.forEach((col) => {
|
|
241
|
-
if (col.
|
|
242
|
-
|
|
266
|
+
if (col.gqlField) {
|
|
267
|
+
builder.add(col.gqlField);
|
|
243
268
|
}
|
|
244
|
-
|
|
269
|
+
|
|
270
|
+
if (col.name.startsWith("_")) {
|
|
245
271
|
return;
|
|
246
272
|
}
|
|
247
|
-
|
|
273
|
+
builder.add(col.name);
|
|
274
|
+
|
|
248
275
|
});
|
|
249
276
|
|
|
250
277
|
if (actionView) {
|
|
251
|
-
|
|
278
|
+
builder.add("canView");
|
|
252
279
|
}
|
|
253
280
|
|
|
254
281
|
if (actionDelete) {
|
|
255
|
-
|
|
282
|
+
builder.add("canDelete");
|
|
256
283
|
}
|
|
257
284
|
|
|
258
285
|
if (activeEdit) {
|
|
259
|
-
|
|
286
|
+
builder.add("canUpdate");
|
|
260
287
|
}
|
|
261
288
|
|
|
262
|
-
|
|
263
|
-
|
|
264
289
|
let localFilters = getFilterValue();
|
|
265
290
|
//merge the filters
|
|
266
291
|
if (filters) {
|
|
@@ -280,7 +305,7 @@ const onRequest = async (p: any) => {
|
|
|
280
305
|
loading.value = true;
|
|
281
306
|
const offset = (p.pagination.page - 1) * p.pagination.rowsPerPage;
|
|
282
307
|
const limit = p.pagination.rowsPerPage;
|
|
283
|
-
const allData = await getData(operation, localFilters, sort, offset, limit,
|
|
308
|
+
const allData = await getData(operation, localFilters, sort, offset, limit, builder.get());
|
|
284
309
|
|
|
285
310
|
rows.value = allData.data;
|
|
286
311
|
|
|
@@ -407,8 +432,7 @@ const filter = ref('');
|
|
|
407
432
|
|
|
408
433
|
<q-table v-bind="attrs" :row-key="rowKey" :loading="loading" :rows="rows" ref="table" @request="onRequest"
|
|
409
434
|
:rows-per-page-label="$t(props.rowsPerPageLabel)" :columns="renderColumns"
|
|
410
|
-
:rows-per-page-options="rowsPerPageOptions" :selection="selection" v-model:pagination="pagination"
|
|
411
|
-
:filter="filter">
|
|
435
|
+
:rows-per-page-options="rowsPerPageOptions" :selection="selection" v-model:pagination="pagination" :filter="filter">
|
|
412
436
|
|
|
413
437
|
<template #top-right="props" v-if="fullscreen || searchable">
|
|
414
438
|
<q-input v-if="searchable" outlined dense debounce="300" v-model="filter" placeholder="Search">
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
<script setup>
|
|
2
|
+
import { useLight } from '../'
|
|
2
3
|
import { useSlots, computed, ref } from 'vue';
|
|
3
4
|
|
|
5
|
+
const light = useLight();
|
|
4
6
|
const props = defineProps(["modelValue"])
|
|
5
7
|
const emit = defineEmits(["update:modelValue"])
|
|
6
8
|
const slots = useSlots();
|
|
@@ -30,11 +32,13 @@ const localValue = computed({
|
|
|
30
32
|
}
|
|
31
33
|
})
|
|
32
34
|
|
|
35
|
+
const color = light.getStyle("color", 'primary');
|
|
36
|
+
|
|
33
37
|
</script>
|
|
34
38
|
|
|
35
39
|
<template>
|
|
36
40
|
<l-card>
|
|
37
|
-
<q-tabs class="text-grey" active-color="
|
|
41
|
+
<q-tabs class="text-grey" :active-color="color" :indicator-color="color" align="justify" v-model="localValue">
|
|
38
42
|
<q-tab v-for="tab in tabContents" :label="$t(tab.label)" :name="tab.name"></q-tab>
|
|
39
43
|
</q-tabs>
|
|
40
44
|
<q-tab-panels v-model="localValue">
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { toQuery } from "@hostlink/light";
|
|
2
|
+
export default function() {
|
|
3
|
+
const merge = (obj1, obj2) => {
|
|
4
|
+
for (let key in obj2) {
|
|
5
|
+
if (obj2.hasOwnProperty(key)) {
|
|
6
|
+
obj1[key] = obj1[key] && obj1[key].toString() === "[object Object]" ? merge(obj1[key], obj2[key]) : obj1[key] = obj2[key];
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
return obj1;
|
|
10
|
+
};
|
|
11
|
+
let fields = {};
|
|
12
|
+
return {
|
|
13
|
+
//deep merge
|
|
14
|
+
merge,
|
|
15
|
+
add: (f) => {
|
|
16
|
+
if (typeof f === "string") {
|
|
17
|
+
fields[f] = true;
|
|
18
|
+
return;
|
|
19
|
+
}
|
|
20
|
+
if (Array.isArray(f)) {
|
|
21
|
+
f.forEach((item) => {
|
|
22
|
+
fields[item] = true;
|
|
23
|
+
});
|
|
24
|
+
return;
|
|
25
|
+
}
|
|
26
|
+
if (typeof f === "object") {
|
|
27
|
+
fields = merge(fields, toQuery(f));
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
get() {
|
|
32
|
+
return fields;
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
}
|
|
@@ -14,7 +14,8 @@ import updateObject from "./updateObject";
|
|
|
14
14
|
import listObject from "./listObject";
|
|
15
15
|
import loadObject from "./loadObject";
|
|
16
16
|
import isGranted from "./isGranted";
|
|
17
|
+
import GQLFieldBuilder from "./GQLFieldBuilder";
|
|
17
18
|
declare const notify: (message: string, color?: string) => void;
|
|
18
19
|
import getID from "./getID";
|
|
19
20
|
declare const getApiBase: () => {};
|
|
20
|
-
export { addObject, f, getApiUrl, getCurrentUser, getObject, list, listData, m, q, removeObject, t, updateObject, notify, getID, deleteObject, listObject, isGranted, getApiBase, loadObject };
|
|
21
|
+
export { addObject, f, getApiUrl, getCurrentUser, getObject, list, listData, m, q, removeObject, t, updateObject, notify, getID, deleteObject, listObject, isGranted, getApiBase, loadObject, GQLFieldBuilder, };
|
|
@@ -16,6 +16,7 @@ import updateObject from "./updateObject.mjs";
|
|
|
16
16
|
import listObject from "./listObject.mjs";
|
|
17
17
|
import loadObject from "./loadObject.mjs";
|
|
18
18
|
import isGranted from "./isGranted.mjs";
|
|
19
|
+
import GQLFieldBuilder from "./GQLFieldBuilder.mjs";
|
|
19
20
|
const notify = function(message, color = "green") {
|
|
20
21
|
Notify.create({
|
|
21
22
|
message,
|
|
@@ -47,5 +48,6 @@ export {
|
|
|
47
48
|
listObject,
|
|
48
49
|
isGranted,
|
|
49
50
|
getApiBase,
|
|
50
|
-
loadObject
|
|
51
|
+
loadObject,
|
|
52
|
+
GQLFieldBuilder
|
|
51
53
|
};
|
package/dist/runtime/lib/q.mjs
CHANGED
|
@@ -2,14 +2,14 @@ import axios from "axios";
|
|
|
2
2
|
import f from "./f.mjs";
|
|
3
3
|
import { jsonToGraphQLQuery } from "json-to-graphql-query";
|
|
4
4
|
import { getApiBase } from "./index.mjs";
|
|
5
|
-
import
|
|
5
|
+
import { toQuery } from "@hostlink/light";
|
|
6
6
|
export default async function(operation, args = null, fields = []) {
|
|
7
7
|
const service = axios.create({
|
|
8
8
|
withCredentials: true
|
|
9
9
|
});
|
|
10
10
|
let query;
|
|
11
11
|
if (operation instanceof Object) {
|
|
12
|
-
query = jsonToGraphQLQuery(
|
|
12
|
+
query = jsonToGraphQLQuery(toQuery(operation));
|
|
13
13
|
} else {
|
|
14
14
|
if (arguments.length === 2) {
|
|
15
15
|
fields = args;
|
|
@@ -35,9 +35,6 @@ const columns = [
|
|
|
35
35
|
|
|
36
36
|
<template>
|
|
37
37
|
<l-page>
|
|
38
|
-
<l-table @request="$event.loadObjects('MailLog'
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
</l-table>
|
|
38
|
+
<l-table @request="$event.loadObjects('MailLog')" :columns="columns" sort-by="maillog_id:desc" />
|
|
42
39
|
</l-page>
|
|
43
40
|
</template>
|
|
@@ -1,9 +1,18 @@
|
|
|
1
1
|
<script setup>
|
|
2
2
|
import { reactive } from 'vue'
|
|
3
|
-
import {
|
|
4
|
-
const app = await q("app", ["permissions"])
|
|
3
|
+
import { m } from '../../'
|
|
5
4
|
|
|
6
|
-
|
|
5
|
+
import { query } from '@hostlink/light';
|
|
6
|
+
|
|
7
|
+
const { app, listRole: roles } = await query({
|
|
8
|
+
app: {
|
|
9
|
+
permissions: true
|
|
10
|
+
},
|
|
11
|
+
listRole: {
|
|
12
|
+
name: true,
|
|
13
|
+
permissions: true
|
|
14
|
+
}
|
|
15
|
+
})
|
|
7
16
|
|
|
8
17
|
const columns = [{
|
|
9
18
|
label: "Permission",
|
|
@@ -41,13 +50,6 @@ app.permissions.forEach(permission => {
|
|
|
41
50
|
});
|
|
42
51
|
|
|
43
52
|
const onUpdate = (value, role, permission) => {
|
|
44
|
-
/* if (value) {
|
|
45
|
-
app.permissions.push(role);
|
|
46
|
-
} else {
|
|
47
|
-
app.permissions.splice(app.permissions.indexOf(role), 1);
|
|
48
|
-
}
|
|
49
|
-
app.save(); */
|
|
50
|
-
|
|
51
53
|
if (value) {
|
|
52
54
|
m("addPermission", { value: permission, role })
|
|
53
55
|
} else {
|
|
@@ -60,8 +62,6 @@ const onUpdate = (value, role, permission) => {
|
|
|
60
62
|
row[role] = value;
|
|
61
63
|
}
|
|
62
64
|
});
|
|
63
|
-
|
|
64
|
-
|
|
65
65
|
}
|
|
66
66
|
|
|
67
67
|
</script>
|
|
@@ -1,15 +1,23 @@
|
|
|
1
1
|
<script setup>
|
|
2
2
|
import { reactive } from 'vue'
|
|
3
3
|
import { utils, writeFileXLSX } from 'xlsx';
|
|
4
|
-
import {
|
|
4
|
+
import { query } from '@hostlink/light';
|
|
5
5
|
const obj = reactive({
|
|
6
6
|
roles: []
|
|
7
7
|
});
|
|
8
8
|
|
|
9
|
-
const app = await
|
|
10
|
-
|
|
9
|
+
const { app, listRole } = await query({
|
|
10
|
+
app: {
|
|
11
|
+
permissions: true
|
|
12
|
+
},
|
|
13
|
+
listRole: {
|
|
14
|
+
name: true,
|
|
15
|
+
permissions: true
|
|
16
|
+
}
|
|
11
17
|
|
|
12
|
-
|
|
18
|
+
})
|
|
19
|
+
|
|
20
|
+
let roles = listRole.map((role) => {
|
|
13
21
|
return {
|
|
14
22
|
label: role.name,
|
|
15
23
|
value: role.name,
|
|
@@ -19,7 +27,7 @@ let roles = allData.map((role) => {
|
|
|
19
27
|
const submit = () => {
|
|
20
28
|
|
|
21
29
|
//filter roles
|
|
22
|
-
let e =
|
|
30
|
+
let e = listRole.filter((role) => {
|
|
23
31
|
return obj.roles.indexOf(role.name) != -1;
|
|
24
32
|
});
|
|
25
33
|
|
|
@@ -1,8 +1,4 @@
|
|
|
1
1
|
<script setup>
|
|
2
|
-
const onRequest = async (request) => {
|
|
3
|
-
request.loadObjects("Permission", null, ["permission_id"])
|
|
4
|
-
};
|
|
5
|
-
|
|
6
2
|
const columns = [
|
|
7
3
|
{
|
|
8
4
|
label: "Role",
|
|
@@ -21,6 +17,7 @@ const columns = [
|
|
|
21
17
|
</script>
|
|
22
18
|
<template>
|
|
23
19
|
<l-page>
|
|
24
|
-
<l-table @request="
|
|
20
|
+
<l-table row-key="permission_id" @request="$event.loadObjects('Permission')" :columns="columns"
|
|
21
|
+
:actions="['delete']"></l-table>
|
|
25
22
|
</l-page>
|
|
26
23
|
</template>
|
|
@@ -1,6 +1,15 @@
|
|
|
1
1
|
<script setup>
|
|
2
|
-
import {
|
|
3
|
-
|
|
2
|
+
import { query } from '@hostlink/light';
|
|
3
|
+
|
|
4
|
+
const { system: { database } } = await query({
|
|
5
|
+
system: {
|
|
6
|
+
database: {
|
|
7
|
+
table: true
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
})
|
|
11
|
+
|
|
12
|
+
|
|
4
13
|
</script>
|
|
5
14
|
<template>
|
|
6
15
|
<l-page>
|
|
@@ -1,11 +1,7 @@
|
|
|
1
1
|
<script setup>
|
|
2
2
|
import { ref } from 'vue'
|
|
3
3
|
const onRequest = async (request) => {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
request.loadObjects("User", {
|
|
7
|
-
status: status.value
|
|
8
|
-
}, ["user_id"]);
|
|
4
|
+
request.loadObjects("User", { status: status.value });
|
|
9
5
|
};
|
|
10
6
|
|
|
11
7
|
const columns = [
|
|
@@ -52,13 +48,11 @@ const status = ref("0");
|
|
|
52
48
|
|
|
53
49
|
<l-tabs v-model="status">
|
|
54
50
|
<l-tab label="Active" name="0">
|
|
55
|
-
<l-table
|
|
56
|
-
|
|
57
|
-
@request="onRequest" :columns="columns" :actions="['view', 'edit', 'delete']">
|
|
51
|
+
<l-table row-key="user_id" @request="onRequest" :columns="columns" :actions="['view', 'edit', 'delete']">
|
|
58
52
|
</l-table>
|
|
59
53
|
</l-tab>
|
|
60
54
|
<l-tab label="Inactive" name="1">
|
|
61
|
-
<l-table @request="onRequest" :columns="columns" :actions="['view', 'edit', 'delete']">
|
|
55
|
+
<l-table row-key="user_id" @request="onRequest" :columns="columns" :actions="['view', 'edit', 'delete']">
|
|
62
56
|
</l-table>
|
|
63
57
|
</l-tab>
|
|
64
58
|
</l-tabs>
|