@hostlink/nuxt-light 1.14.4 → 1.15.1
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/Fieldset.vue +8 -4
- package/dist/runtime/components/l-app-main.vue +14 -6
- package/dist/runtime/components/l-delete-btn.vue +1 -1
- package/dist/runtime/components/l-dialog-database-field-add.vue +6 -5
- package/dist/runtime/components/l-edit-btn.vue +1 -1
- package/dist/runtime/components/l-form-dialog.vue +103 -0
- package/dist/runtime/components/l-page.vue +7 -13
- package/dist/runtime/components/l-table.vue +40 -15
- package/dist/runtime/components/l-test2.vue +12 -0
- package/dist/runtime/components/l-user-eventlog.vue +1 -1
- package/dist/runtime/components/l-user-userlog.vue +1 -1
- package/dist/runtime/components/l-view-btn.vue +1 -1
- package/dist/runtime/formkit/Form.vue +18 -6
- package/dist/runtime/formkit/Input.vue +12 -10
- package/dist/runtime/index.d.ts +26 -6
- package/dist/runtime/index.js +3 -3
- package/dist/runtime/pages/EventLog/index.vue +1 -1
- package/dist/runtime/pages/MailLog/index.vue +1 -1
- package/dist/runtime/pages/Permission/index.vue +1 -1
- package/dist/runtime/pages/System/fs.vue +10 -9
- package/dist/runtime/pages/System/menu/index.vue +4 -4
- package/dist/runtime/pages/SystemValue/index.vue +1 -1
- package/dist/runtime/pages/User/index.vue +11 -4
- package/dist/runtime/pages/User/setting/style.vue +1 -1
- package/dist/runtime/pages/UserLog/index.vue +1 -1
- package/dist/runtime/plugin.js +7 -3
- package/package.json +2 -2
package/dist/module.json
CHANGED
|
@@ -19,14 +19,18 @@ const props = defineProps({
|
|
|
19
19
|
</script>
|
|
20
20
|
|
|
21
21
|
<style scoped>
|
|
22
|
-
body.body--dark fieldset{border-color:hsla(0,0%,100%,.6)}fieldset{border:1px solid rgba(0,0,0,.24);border-radius:4px
|
|
22
|
+
body.body--dark fieldset{border-color:hsla(0,0%,100%,.6)}fieldset{border:1px solid rgba(0,0,0,.24);border-radius:4px}legend{padding-left:.5rem;padding-right:.5rem}
|
|
23
23
|
</style>
|
|
24
24
|
<template>
|
|
25
|
-
<fieldset
|
|
25
|
+
<fieldset>
|
|
26
26
|
<legend v-if="props.label">{{ i18n.t(props.label) }}</legend>
|
|
27
|
-
<slot></slot>
|
|
28
27
|
|
|
29
|
-
{
|
|
28
|
+
<div :class="`q-gutter-${props.gutter}`">
|
|
29
|
+
<slot></slot>
|
|
30
|
+
</div>
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
|
|
30
34
|
|
|
31
35
|
</fieldset>
|
|
32
36
|
</template>
|
|
@@ -416,13 +416,21 @@ if (route.fullPath == "/" && my.default_page) {
|
|
|
416
416
|
|
|
417
417
|
<q-page-container :class="containerClass" :style="containerStyle"> <!-- Error message -->
|
|
418
418
|
<slot name="header"></slot>
|
|
419
|
-
<
|
|
420
|
-
|
|
419
|
+
<div class="q-gutter-sm q-pa-sm" v-if="errors.length > 0">
|
|
420
|
+
<q-banner dense inline-actions class="bg-grey-4" v-for=" error in errors " rounded>
|
|
421
|
+
{{ error }}
|
|
422
|
+
<template v-slot:action>
|
|
423
|
+
<q-btn flat label="Detail" @click="$q.dialog({
|
|
424
|
+
title: 'Error Detail',
|
|
425
|
+
message: error.stack,
|
|
426
|
+
fullWidth: true,
|
|
427
|
+
})"></q-btn>
|
|
428
|
+
<q-btn flat icon="sym_o_close" round dense @click="light.removeError(error)" />
|
|
429
|
+
</template>
|
|
430
|
+
</q-banner>
|
|
431
|
+
|
|
432
|
+
</div>
|
|
421
433
|
|
|
422
|
-
<template v-slot:action>
|
|
423
|
-
<q-btn flat icon="sym_o_close" round dense @click="light.removeError(error)" />
|
|
424
|
-
</template>
|
|
425
|
-
</q-banner>
|
|
426
434
|
|
|
427
435
|
<!-- router-view v-slot="{ Component }">
|
|
428
436
|
|
|
@@ -33,13 +33,14 @@ const types = ["varchar", "int", "date", "time", "datetime", "timestamp", "text"
|
|
|
33
33
|
|
|
34
34
|
|
|
35
35
|
<template>
|
|
36
|
-
<q-dialog ref="dialogRef"
|
|
36
|
+
<q-dialog ref="dialogRef">
|
|
37
37
|
<q-card class="q-dialog-plugin">
|
|
38
|
-
<
|
|
38
|
+
<q-toolbar>
|
|
39
|
+
<q-toolbar-title>Add Field</q-toolbar-title>
|
|
39
40
|
<q-space />
|
|
40
|
-
<q-btn dense flat icon="sym_o_close"
|
|
41
|
-
</
|
|
42
|
-
<form-kit type="l-form" @submit="onOKClick" :value="{
|
|
41
|
+
<q-btn dense flat icon="sym_o_close" v-close-popup />
|
|
42
|
+
</q-toolbar>
|
|
43
|
+
<form-kit type="l-form" :bordered="false" @submit="onOKClick" :value="{
|
|
43
44
|
name: '',
|
|
44
45
|
type: '',
|
|
45
46
|
length: '',
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { useDialogPluginComponent } from 'quasar'
|
|
3
|
+
import { ref } from 'vue'
|
|
4
|
+
|
|
5
|
+
const props = defineProps({
|
|
6
|
+
title: {
|
|
7
|
+
type: String,
|
|
8
|
+
default: null
|
|
9
|
+
},
|
|
10
|
+
width: {
|
|
11
|
+
type: String,
|
|
12
|
+
default: '500px'
|
|
13
|
+
},
|
|
14
|
+
save: {
|
|
15
|
+
type: Function,
|
|
16
|
+
default: null
|
|
17
|
+
},
|
|
18
|
+
cancel: {
|
|
19
|
+
type: Function,
|
|
20
|
+
default: null
|
|
21
|
+
},
|
|
22
|
+
value: {
|
|
23
|
+
type: Object,
|
|
24
|
+
default: () => {
|
|
25
|
+
return {}
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
})
|
|
30
|
+
|
|
31
|
+
const { dialogRef, onDialogHide, onDialogOK, onDialogCancel } = useDialogPluginComponent()
|
|
32
|
+
import { useQuasar } from 'quasar'
|
|
33
|
+
const $q = useQuasar()
|
|
34
|
+
|
|
35
|
+
const loading = ref(false)
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
const emits = defineEmits(['submit'])
|
|
39
|
+
|
|
40
|
+
const onSubmit = async (data, node) => {
|
|
41
|
+
emits('submit', data)
|
|
42
|
+
|
|
43
|
+
if (props.save) {
|
|
44
|
+
loading.value = true
|
|
45
|
+
try {
|
|
46
|
+
await props.save(data)
|
|
47
|
+
$q.notify({
|
|
48
|
+
type: 'positive',
|
|
49
|
+
message: 'Data saved successfully'
|
|
50
|
+
})
|
|
51
|
+
onDialogOK(data)
|
|
52
|
+
} catch (error) {
|
|
53
|
+
|
|
54
|
+
$q.dialog({
|
|
55
|
+
title: 'Error',
|
|
56
|
+
message: error.message
|
|
57
|
+
})
|
|
58
|
+
|
|
59
|
+
} finally {
|
|
60
|
+
loading.value = false
|
|
61
|
+
}
|
|
62
|
+
} else {
|
|
63
|
+
onDialogOK(data)
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
const onCancel = async () => {
|
|
68
|
+
|
|
69
|
+
if (props.cancel) {
|
|
70
|
+
await props.cancel()
|
|
71
|
+
}
|
|
72
|
+
onDialogCancel()
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
</script>
|
|
76
|
+
<template>
|
|
77
|
+
<q-dialog ref="dialogRef">
|
|
78
|
+
|
|
79
|
+
<q-card :style="{ width }" :loading="loading">
|
|
80
|
+
|
|
81
|
+
<q-toolbar>
|
|
82
|
+
<q-toolbar-title v-if="title">
|
|
83
|
+
{{ title }}
|
|
84
|
+
</q-toolbar-title>
|
|
85
|
+
<q-space />
|
|
86
|
+
<q-btn icon="sym_o_close" flat round dense v-close-popup />
|
|
87
|
+
</q-toolbar>
|
|
88
|
+
|
|
89
|
+
<form-kit type="form" :bordered="false" :actions="false" :value="value" #default="context" @submit="onSubmit">
|
|
90
|
+
|
|
91
|
+
<q-card-section>
|
|
92
|
+
<slot name="default" v-bind="context"></slot>
|
|
93
|
+
</q-card-section>
|
|
94
|
+
<q-card-actions align="right">
|
|
95
|
+
<q-btn icon="sym_o_close" :label="$t('Cancel')" @click="onCancel" unelevated color="grey-4" text-color="grey-8" />
|
|
96
|
+
<q-btn icon="sym_o_check" :label="$t('Save')" type="submit" color="primary" unelevated :disabled="!context.state.valid" />
|
|
97
|
+
</q-card-actions>
|
|
98
|
+
</form-kit>
|
|
99
|
+
|
|
100
|
+
<q-inner-loading :showing="loading"></q-inner-loading>
|
|
101
|
+
</q-card>
|
|
102
|
+
</q-dialog>
|
|
103
|
+
</template>
|
|
@@ -15,7 +15,7 @@ export type LPageProps = QPageProps & {
|
|
|
15
15
|
editBtn?: boolean;
|
|
16
16
|
deleteBtn?: boolean;
|
|
17
17
|
addBtn?: boolean;
|
|
18
|
-
gutter?:
|
|
18
|
+
gutter?: "none" | "xs" | "sm" | "md" | "lg" | "xl";
|
|
19
19
|
padding?: boolean
|
|
20
20
|
}
|
|
21
21
|
|
|
@@ -23,6 +23,7 @@ const props = withDefaults(defineProps<LPageProps>(), {
|
|
|
23
23
|
title: "",
|
|
24
24
|
backBtn: true,
|
|
25
25
|
padding: true,
|
|
26
|
+
gutter: "none"
|
|
26
27
|
});
|
|
27
28
|
|
|
28
29
|
const showToolbar = computed(() => {
|
|
@@ -54,19 +55,12 @@ useHead({
|
|
|
54
55
|
})
|
|
55
56
|
|
|
56
57
|
const localClass = computed(() => {
|
|
57
|
-
return
|
|
58
|
-
"q-gutter-none": props.gutter === "none",
|
|
59
|
-
"q-gutter-xs": props.gutter === "xs",
|
|
60
|
-
"q-gutter-sm": props.gutter === "sm",
|
|
61
|
-
"q-gutter-md": props.gutter === "md",
|
|
62
|
-
"q-gutter-lg": props.gutter === "lg",
|
|
63
|
-
"q-gutter-xl": props.gutter === "xl",
|
|
64
|
-
}
|
|
58
|
+
return 'q-gutter-' + props.gutter
|
|
65
59
|
})
|
|
66
60
|
</script>
|
|
67
61
|
|
|
68
62
|
<template>
|
|
69
|
-
<q-page :padding="
|
|
63
|
+
<q-page :padding="padding">
|
|
70
64
|
<!-- q-breadcrumbs>
|
|
71
65
|
<q-breadcrumbs-el icon="home" to="/" />
|
|
72
66
|
<q-breadcrumbs-el label="Permission" to="/Permission" />
|
|
@@ -81,11 +75,11 @@ const localClass = computed(() => {
|
|
|
81
75
|
<q-toolbar-title>{{ $t(title) }}</q-toolbar-title>
|
|
82
76
|
</q-toolbar>
|
|
83
77
|
|
|
84
|
-
|
|
85
|
-
<div class="q-gutter-sm q-mb-sm">
|
|
78
|
+
<div :class="localClass">
|
|
86
79
|
<slot name="header"></slot>
|
|
80
|
+
<slot></slot>
|
|
87
81
|
</div>
|
|
88
82
|
|
|
89
|
-
|
|
83
|
+
|
|
90
84
|
</q-page>
|
|
91
85
|
</template>
|
|
@@ -1,29 +1,31 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import { useQuasar, QTable, type QTableColumn, type QTableProps } from 'quasar';
|
|
2
|
+
import { useQuasar, QTable, type QTableColumn, type QTableProps, Dialog } from 'quasar';
|
|
3
3
|
|
|
4
4
|
import { ref, computed, onMounted, useSlots, useAttrs, watch, defineComponent, h } from "vue";
|
|
5
5
|
import { t, q, useLight, GQLFieldBuilder, model } from '../';
|
|
6
6
|
import { toQuery } from '@hostlink/light';
|
|
7
7
|
|
|
8
|
+
const $q = useQuasar();
|
|
9
|
+
|
|
8
10
|
|
|
9
11
|
const minimized = defineModel<boolean>("minimized", { default: false })
|
|
10
12
|
const maximized = defineModel<boolean>("maximized", { default: false })
|
|
11
13
|
|
|
12
|
-
|
|
13
14
|
// extends QTableColumn
|
|
14
|
-
export
|
|
15
|
+
export type LTableColumn = QTableColumn & {
|
|
15
16
|
searchable?: boolean,
|
|
16
17
|
searchType?: string,
|
|
17
18
|
searchOptions?: Array<any> | Function,
|
|
18
19
|
searchMultiple?: boolean,
|
|
19
20
|
gqlField?: string | Array<string> | Object,
|
|
20
21
|
backgroundColor?: string | Function
|
|
22
|
+
|
|
21
23
|
}
|
|
22
24
|
|
|
23
25
|
const errors = ref<InstanceType<any>>([
|
|
24
26
|
]);
|
|
25
27
|
|
|
26
|
-
export
|
|
28
|
+
export type LTableProps = QTableProps & {
|
|
27
29
|
columns?: Array<LTableColumn>,
|
|
28
30
|
actions?: Array<string>,
|
|
29
31
|
sortBy?: string | null | undefined,
|
|
@@ -34,8 +36,11 @@ export interface LTableProps extends QTableProps {
|
|
|
34
36
|
maximizable?: boolean,
|
|
35
37
|
minimizable?: boolean,
|
|
36
38
|
rows?: Array<any>,
|
|
39
|
+
onRequestData?: (request: LTableRequest) => void
|
|
40
|
+
addComponent?: Dialog
|
|
37
41
|
}
|
|
38
42
|
|
|
43
|
+
|
|
39
44
|
const props = withDefaults(defineProps<LTableProps>(), {
|
|
40
45
|
actions: () => [],
|
|
41
46
|
rowsPerPageLabel: "Records per page:",
|
|
@@ -56,7 +61,7 @@ const props = withDefaults(defineProps<LTableProps>(), {
|
|
|
56
61
|
selected: () => [],
|
|
57
62
|
loadingLabel: "Loading...",
|
|
58
63
|
noDataLabel: "No data available",
|
|
59
|
-
dark: undefined
|
|
64
|
+
dark: undefined,
|
|
60
65
|
});
|
|
61
66
|
|
|
62
67
|
const isServerSide = (props.rows == undefined);
|
|
@@ -99,6 +104,10 @@ export interface LTableRequest {
|
|
|
99
104
|
sort: string,
|
|
100
105
|
fields: Array<string>,
|
|
101
106
|
gql: {
|
|
107
|
+
__args: {
|
|
108
|
+
filters: any,
|
|
109
|
+
sort: string
|
|
110
|
+
},
|
|
102
111
|
data: {
|
|
103
112
|
__args: {
|
|
104
113
|
limit: number
|
|
@@ -119,10 +128,11 @@ export interface LTableRequest {
|
|
|
119
128
|
}
|
|
120
129
|
|
|
121
130
|
const emits = defineEmits<{
|
|
122
|
-
request: [p: LTableRequest],
|
|
131
|
+
"request-data": [p: LTableRequest],
|
|
123
132
|
"update:selected": [p: Array<any>]
|
|
124
133
|
}>()
|
|
125
134
|
|
|
135
|
+
|
|
126
136
|
const loading = ref(false);
|
|
127
137
|
|
|
128
138
|
let activeEdit = false;
|
|
@@ -160,6 +170,7 @@ onMounted(() => {
|
|
|
160
170
|
table.value && table.value.requestServerInteraction();
|
|
161
171
|
})
|
|
162
172
|
|
|
173
|
+
|
|
163
174
|
let primaryKey = ref(props.rowKey);
|
|
164
175
|
const modelName = ref(props.modelName);
|
|
165
176
|
|
|
@@ -244,7 +255,7 @@ const getData = async (
|
|
|
244
255
|
|
|
245
256
|
}
|
|
246
257
|
|
|
247
|
-
const
|
|
258
|
+
const onLocalRequest = async (p: any) => {
|
|
248
259
|
if (!isServerSide) return;
|
|
249
260
|
|
|
250
261
|
|
|
@@ -286,7 +297,7 @@ const onRequest = async (p: any) => {
|
|
|
286
297
|
}
|
|
287
298
|
|
|
288
299
|
|
|
289
|
-
const callback = {
|
|
300
|
+
const callback: LTableRequest = {
|
|
290
301
|
sort: sort,
|
|
291
302
|
fields: builder.get(),
|
|
292
303
|
offset: (p.pagination.page - 1) * p.pagination.rowsPerPage,
|
|
@@ -359,7 +370,7 @@ const onRequest = async (p: any) => {
|
|
|
359
370
|
|
|
360
371
|
loading.value = true;
|
|
361
372
|
//emits("request", p);
|
|
362
|
-
emits("
|
|
373
|
+
emits("requestData", callback);
|
|
363
374
|
|
|
364
375
|
}
|
|
365
376
|
|
|
@@ -396,7 +407,7 @@ const getFilterValue = () => {
|
|
|
396
407
|
const onFilters = () => {
|
|
397
408
|
|
|
398
409
|
//clone the filters
|
|
399
|
-
|
|
410
|
+
onLocalRequest({
|
|
400
411
|
pagination: {
|
|
401
412
|
page: 1,
|
|
402
413
|
rowsPerPage: props.pagination.rowsPerPage,
|
|
@@ -532,6 +543,16 @@ defineExpose({
|
|
|
532
543
|
requestServerInteraction
|
|
533
544
|
})
|
|
534
545
|
|
|
546
|
+
const onAdd = () => {
|
|
547
|
+
if (!props.addComponent) return;
|
|
548
|
+
|
|
549
|
+
$q.dialog({
|
|
550
|
+
|
|
551
|
+
component: props.addComponent
|
|
552
|
+
}).onOk(() => {
|
|
553
|
+
requestServerInteraction();
|
|
554
|
+
})
|
|
555
|
+
}
|
|
535
556
|
</script>
|
|
536
557
|
|
|
537
558
|
|
|
@@ -539,6 +560,10 @@ defineExpose({
|
|
|
539
560
|
<l-card flat bordered :maximizable="maximizable" :minimizable="minimizable" :title="title"
|
|
540
561
|
v-model:minimized="minimized" v-model:maximized="maximized">
|
|
541
562
|
|
|
563
|
+
<q-toolbar v-if="addComponent">
|
|
564
|
+
<q-btn icon="sym_o_add" label="Add" color="primary" @click="onAdd" v-if="addComponent" />
|
|
565
|
+
</q-toolbar>
|
|
566
|
+
|
|
542
567
|
|
|
543
568
|
<template v-if="errors.length > 0">
|
|
544
569
|
<div class="q-mb-sm">
|
|
@@ -548,7 +573,7 @@ defineExpose({
|
|
|
548
573
|
</div>
|
|
549
574
|
</template>
|
|
550
575
|
|
|
551
|
-
<q-table v-bind="attrs" :loading="loading" :rows="rows" ref="table" @request="
|
|
576
|
+
<q-table v-bind="attrs" :loading="loading" :rows="rows" ref="table" @request="onLocalRequest" :columns="columns"
|
|
552
577
|
v-model:pagination="pagination" :filter="filter" v-model:selected="localSelected">
|
|
553
578
|
|
|
554
579
|
|
|
@@ -574,7 +599,7 @@ defineExpose({
|
|
|
574
599
|
<q-checkbox v-model="props.selected" />
|
|
575
600
|
</q-td>
|
|
576
601
|
<q-td v-if="hasRowExpand" auto-width>
|
|
577
|
-
<q-btn :class="{ 'text-grey-8': !isDark }" flat round
|
|
602
|
+
<q-btn :class="{ 'text-grey-8': !isDark }" flat round size="sm"
|
|
578
603
|
:icon="props.expand ? 'sym_o_expand_more' : 'sym_o_expand_less'"
|
|
579
604
|
@click="props.expand = !props.expand"></q-btn>
|
|
580
605
|
</q-td>
|
|
@@ -583,13 +608,13 @@ defineExpose({
|
|
|
583
608
|
<div :class="{ 'text-grey-8': !isDark }" v-if="primaryKey">
|
|
584
609
|
|
|
585
610
|
<l-view-btn v-if="actionView && props.row.canView"
|
|
586
|
-
:to="`/${modelName}/${props.row[primaryKey]}/view`" />
|
|
611
|
+
:to="`/${modelName}/${props.row[primaryKey]}/view`" size="sm" />
|
|
587
612
|
|
|
588
613
|
<l-edit-btn v-if="activeEdit && props.row.canUpdate"
|
|
589
|
-
:to="`/${modelName}/${props.row[primaryKey]}/edit`" />
|
|
614
|
+
:to="`/${modelName}/${props.row[primaryKey]}/edit`" size="sm" />
|
|
590
615
|
|
|
591
616
|
<l-delete-btn v-if="actionDelete && props.row.canDelete"
|
|
592
|
-
@submit="onDelete(props.row[primaryKey])"></l-delete-btn>
|
|
617
|
+
@submit="onDelete(props.row[primaryKey])" size="sm"></l-delete-btn>
|
|
593
618
|
|
|
594
619
|
<slot name="actions" v-bind="props"></slot>
|
|
595
620
|
</div>
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { ref } from 'vue'
|
|
3
|
+
const form = ref(null)
|
|
4
|
+
const save = async (data, node) => {
|
|
5
|
+
await new Promise(resolve => setTimeout(resolve, 1000))
|
|
6
|
+
}
|
|
7
|
+
</script>
|
|
8
|
+
<template>
|
|
9
|
+
<l-form-dialog title="Add User" :save="save">
|
|
10
|
+
<form-kit type="l-input" name="name" label="Name" dense validation="required" />
|
|
11
|
+
</l-form-dialog>
|
|
12
|
+
</template>
|
|
@@ -5,7 +5,7 @@ const props = defineProps(['id']);
|
|
|
5
5
|
<template>
|
|
6
6
|
<div>
|
|
7
7
|
<l-table row-key="eventlog_id" sort-by="eventlog_id:desc"
|
|
8
|
-
:columns="model('EventLog').columns(['eventlog_id', 'class', 'id', 'action', 'created_time'])" @request="async (req) => {
|
|
8
|
+
:columns="model('EventLog').columns(['eventlog_id', 'class', 'id', 'action', 'created_time'])" @request-data="async (req) => {
|
|
9
9
|
const a = {
|
|
10
10
|
listUser: {
|
|
11
11
|
__args: {
|
|
@@ -6,7 +6,7 @@ const columns = model('UserLog').columns(["userlog_id", "login_dt", "last_access
|
|
|
6
6
|
</script>
|
|
7
7
|
<template>
|
|
8
8
|
<div>
|
|
9
|
-
<l-table row-key="userlog_id" sort-by="userlog_id:desc" :columns="columns" @request="async (req) => {
|
|
9
|
+
<l-table row-key="userlog_id" sort-by="userlog_id:desc" :columns="columns" @request-data="async (req) => {
|
|
10
10
|
req.loadObjects('UserLog', { filters: { user_id: props.id } })
|
|
11
11
|
}" />
|
|
12
12
|
</div>
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
<script setup>
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { type FormKitInputs } from '@formkit/inputs';
|
|
2
3
|
import { useRouter, useRoute } from "vue-router";
|
|
3
4
|
import { useQuasar } from "quasar";
|
|
4
5
|
import { model } from "#imports"
|
|
@@ -7,25 +8,36 @@ const route = useRoute();
|
|
|
7
8
|
const router = useRouter();
|
|
8
9
|
const quasar = useQuasar();
|
|
9
10
|
|
|
11
|
+
declare module '@formkit/inputs' {
|
|
12
|
+
interface FormKitInputProps<Props extends FormKitInputs<Props>> {
|
|
13
|
+
lForm: {
|
|
14
|
+
type: 'l-form';
|
|
15
|
+
gutter?: string;
|
|
16
|
+
bordered?: boolean;
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
|
|
10
22
|
let props = defineProps({
|
|
11
23
|
context: Object
|
|
12
24
|
});
|
|
13
25
|
|
|
14
26
|
let onSubmit = async () => {
|
|
15
|
-
props.context
|
|
27
|
+
props.context?.handlers.submit(new Event("submit"));
|
|
16
28
|
}
|
|
17
29
|
|
|
18
|
-
const gutter = props.gutter ?? "md";
|
|
30
|
+
const gutter = props.context?.gutter ?? "md";
|
|
19
31
|
|
|
20
32
|
//check bordered is undefined
|
|
21
33
|
let bordered = true;
|
|
22
|
-
if (props.context
|
|
34
|
+
if (props.context?.bordered !== undefined) {
|
|
23
35
|
bordered = props.context.bordered;
|
|
24
36
|
}
|
|
25
37
|
|
|
26
38
|
let redirect = true;
|
|
27
|
-
if (props.context
|
|
28
|
-
|
|
39
|
+
if (props.context?.attrs.onSubmitted) {
|
|
40
|
+
|
|
29
41
|
redirect = false;
|
|
30
42
|
}
|
|
31
43
|
|
|
@@ -1,36 +1,38 @@
|
|
|
1
|
-
<script setup>
|
|
1
|
+
<script setup lang="ts">
|
|
2
2
|
import { computed } from 'vue'
|
|
3
3
|
import { getErrorMessage } from 'formkit-quasar';
|
|
4
4
|
|
|
5
|
+
|
|
6
|
+
|
|
5
7
|
const props = defineProps({
|
|
6
8
|
context: Object
|
|
7
9
|
});
|
|
8
10
|
|
|
9
|
-
const { error, errorMessage } = getErrorMessage(props.context
|
|
11
|
+
const { error, errorMessage } = getErrorMessage(props.context?.node);
|
|
10
12
|
|
|
11
13
|
const value = computed({
|
|
12
|
-
get: () => props.context
|
|
14
|
+
get: () => props.context?.value,
|
|
13
15
|
set: (val) => {
|
|
14
|
-
if (props.context
|
|
16
|
+
if (props.context?.number !== undefined) {
|
|
15
17
|
if (val === "") {
|
|
16
|
-
props.context
|
|
18
|
+
props.context?.node.input(0)
|
|
17
19
|
return
|
|
18
20
|
}
|
|
19
21
|
|
|
20
22
|
let tryprase = parseInt(val)
|
|
21
23
|
if (isNaN(tryprase)) {
|
|
22
|
-
props.context
|
|
24
|
+
props.context?.node.input(val)
|
|
23
25
|
return
|
|
24
26
|
}
|
|
25
27
|
|
|
26
|
-
if (props.context
|
|
27
|
-
props.context
|
|
28
|
+
if (props.context?.number === "integer") {
|
|
29
|
+
props.context?.node.input(parseInt(val))
|
|
28
30
|
return
|
|
29
31
|
}
|
|
30
32
|
|
|
31
33
|
props.context.node.input(parseFloat(val))
|
|
32
34
|
} else {
|
|
33
|
-
props.context
|
|
35
|
+
props.context?.node.input(val)
|
|
34
36
|
}
|
|
35
37
|
}
|
|
36
38
|
})
|
|
@@ -45,7 +47,7 @@ const onBlur = () => {
|
|
|
45
47
|
|
|
46
48
|
</script>
|
|
47
49
|
<template>
|
|
48
|
-
<l-input v-model="value" :label="context
|
|
50
|
+
<l-input v-model="value" :label="context?.label" v-bind="context?.attrs" :error="error" :type="context?.inputType"
|
|
49
51
|
:error-message="errorMessage" @blur="onBlur">
|
|
50
52
|
|
|
51
53
|
<template v-for="(s, name) in $slots" v-slot:[name]="props" :key="name">
|
package/dist/runtime/index.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { type FormKitInputs } from '@formkit/inputs';
|
|
1
2
|
export interface User {
|
|
2
3
|
user_id?: number;
|
|
3
4
|
username: string;
|
|
@@ -34,9 +35,9 @@ declare const app: {
|
|
|
34
35
|
setCompanyLogo: (logo: string) => void;
|
|
35
36
|
getCompanyLogo: () => string;
|
|
36
37
|
getVersion: () => string;
|
|
37
|
-
addError: (
|
|
38
|
-
getErrors: () =>
|
|
39
|
-
removeError: (error:
|
|
38
|
+
addError: (err: Error) => void;
|
|
39
|
+
getErrors: () => Error[];
|
|
40
|
+
removeError: (error: Error) => void;
|
|
40
41
|
getStyle: (name: string) => any;
|
|
41
42
|
setStyles: (s: Object) => void;
|
|
42
43
|
getStyles: () => {
|
|
@@ -54,6 +55,25 @@ declare module 'vue' {
|
|
|
54
55
|
$light: typeof app;
|
|
55
56
|
}
|
|
56
57
|
}
|
|
58
|
+
declare module '@formkit/inputs' {
|
|
59
|
+
interface FormKitInputProps<Props extends FormKitInputs<Props>> {
|
|
60
|
+
lInput: {
|
|
61
|
+
type: 'l-input';
|
|
62
|
+
name: string;
|
|
63
|
+
label: string;
|
|
64
|
+
number?: string;
|
|
65
|
+
dense?: boolean;
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
interface FormKitInputProps<Props extends FormKitInputs<Props>> {
|
|
69
|
+
lDatePicker: {
|
|
70
|
+
type: 'l-date-picker';
|
|
71
|
+
name: string;
|
|
72
|
+
label: string;
|
|
73
|
+
dense?: boolean;
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
}
|
|
57
77
|
export declare const useLight: (options?: {
|
|
58
78
|
color?: string;
|
|
59
79
|
}) => {
|
|
@@ -83,9 +103,9 @@ export declare const useLight: (options?: {
|
|
|
83
103
|
setCompanyLogo: (logo: string) => void;
|
|
84
104
|
getCompanyLogo: () => string;
|
|
85
105
|
getVersion: () => string;
|
|
86
|
-
addError: (
|
|
87
|
-
getErrors: () =>
|
|
88
|
-
removeError: (error:
|
|
106
|
+
addError: (err: Error) => void;
|
|
107
|
+
getErrors: () => Error[];
|
|
108
|
+
removeError: (error: Error) => void;
|
|
89
109
|
getStyle: (name: string) => any;
|
|
90
110
|
setStyles: (s: Object) => void;
|
|
91
111
|
getStyles: () => {
|
package/dist/runtime/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import packageJson from "../../package.json";
|
|
2
2
|
import { watch, reactive, toRaw } from "vue";
|
|
3
3
|
import { m, q } from "./lib/index.js";
|
|
4
|
-
const errors = [];
|
|
4
|
+
const errors = reactive([]);
|
|
5
5
|
let styles = {};
|
|
6
6
|
const COLOR_CODE = {
|
|
7
7
|
red: "#f44336",
|
|
@@ -125,8 +125,8 @@ const app = reactive({
|
|
|
125
125
|
getVersion: () => {
|
|
126
126
|
return packageJson.version;
|
|
127
127
|
},
|
|
128
|
-
addError: (
|
|
129
|
-
errors.push(
|
|
128
|
+
addError: (err) => {
|
|
129
|
+
errors.push(err);
|
|
130
130
|
},
|
|
131
131
|
getErrors: () => {
|
|
132
132
|
return errors;
|
|
@@ -5,7 +5,7 @@ const columns = model('EventLog').columns(['eventlog_id', 'class', 'id', 'action
|
|
|
5
5
|
<template>
|
|
6
6
|
<l-page>
|
|
7
7
|
|
|
8
|
-
<l-table @request="$event.loadObjects('EventLog')" :columns="columns"
|
|
8
|
+
<l-table @request-data="$event.loadObjects('EventLog')" :columns="columns"
|
|
9
9
|
sort-by="eventlog_id:desc" :actions="['view']">
|
|
10
10
|
|
|
11
11
|
</l-table>
|
|
@@ -15,7 +15,7 @@ const content = ref("")
|
|
|
15
15
|
</q-card-section>
|
|
16
16
|
</l-card>
|
|
17
17
|
</q-dialog>
|
|
18
|
-
<l-table row-key="maillog_id" @request="$event.loadObjects('MailLog', {}, ['body'])" :columns="columns"
|
|
18
|
+
<l-table row-key="maillog_id" @request-data="$event.loadObjects('MailLog', {}, ['body'])" :columns="columns"
|
|
19
19
|
sort-by="maillog_id:desc" >
|
|
20
20
|
|
|
21
21
|
<template #row-expand="props">
|
|
@@ -17,7 +17,7 @@ const columns = [
|
|
|
17
17
|
</script>
|
|
18
18
|
<template>
|
|
19
19
|
<l-page>
|
|
20
|
-
<l-table row-key="permission_id" @request="$event.loadObjects('Permission')" :columns="columns"
|
|
20
|
+
<l-table row-key="permission_id" @request-data="$event.loadObjects('Permission')" :columns="columns"
|
|
21
21
|
:actions="['delete']"></l-table>
|
|
22
22
|
</l-page>
|
|
23
23
|
</template>
|
|
@@ -58,8 +58,10 @@ const columns = [
|
|
|
58
58
|
]
|
|
59
59
|
</script>
|
|
60
60
|
<template>
|
|
61
|
-
<l-page>
|
|
62
|
-
|
|
61
|
+
<l-page gutter="xs">
|
|
62
|
+
<template #header>
|
|
63
|
+
<l-btn label="Add" icon="sym_o_add" @click="dialog = true"></l-btn>
|
|
64
|
+
</template>
|
|
63
65
|
<q-dialog v-model="dialog" persistent>
|
|
64
66
|
<l-card style="width: 500px; max-width: 90vw;" :bordered="false" closeable>
|
|
65
67
|
|
|
@@ -84,10 +86,11 @@ const columns = [
|
|
|
84
86
|
<FormKit type="l-input" label="Region" name="region" validation="required"></FormKit>
|
|
85
87
|
<FormKit type="l-input" label="Endpoint" name="endpoint" validation="required"></FormKit>
|
|
86
88
|
<FormKit type="l-input" label="Prefix" name="prefix"></FormKit>
|
|
87
|
-
<FormKit type="l-select" label="Visibility" name="visibility" validation="required"
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
89
|
+
<FormKit type="l-select" label="Visibility" name="visibility" validation="required"
|
|
90
|
+
:options="[
|
|
91
|
+
{ label: 'Public', value: 'public' },
|
|
92
|
+
{ label: 'Private', value: 'private' }
|
|
93
|
+
]"></FormKit>
|
|
91
94
|
</template>
|
|
92
95
|
|
|
93
96
|
<template v-if="value.type == 'hostlink'">
|
|
@@ -100,9 +103,7 @@ const columns = [
|
|
|
100
103
|
</l-card>
|
|
101
104
|
|
|
102
105
|
</q-dialog>
|
|
103
|
-
|
|
104
|
-
<l-btn label="Add" icon="sym_o_add" @click="dialog = true"></l-btn>
|
|
105
|
-
</template>
|
|
106
|
+
|
|
106
107
|
<l-table :rows="items" :columns="columns">
|
|
107
108
|
<template #body-cell-actions="props">
|
|
108
109
|
<q-td auto-width>
|
|
@@ -226,7 +226,7 @@ const menusOnly = computed(() => {
|
|
|
226
226
|
</q-dialog>
|
|
227
227
|
|
|
228
228
|
<l-card>
|
|
229
|
-
<q-
|
|
229
|
+
<q-toolbar class="q-gutter-xs">
|
|
230
230
|
<l-btn @click="onSave" label="Save" icon="sym_o_save" />
|
|
231
231
|
<l-btn @click="onReload" label="Reload" icon="sym_o_refresh" />
|
|
232
232
|
<template v-if="selectedNode.type == 'root'">
|
|
@@ -234,7 +234,6 @@ const menusOnly = computed(() => {
|
|
|
234
234
|
<l-btn @click="onAddHeader(selectedNode)" label="Add Header" icon="sym_o_add" />
|
|
235
235
|
<l-btn @click="onAddSeparator(selectedNode)" label="Add Separator" icon="sym_o_add" />
|
|
236
236
|
</template>
|
|
237
|
-
|
|
238
237
|
<template v-else>
|
|
239
238
|
<q-btn-dropdown :color="$light.color" label="Add" icon="sym_o_add">
|
|
240
239
|
<q-list>
|
|
@@ -284,7 +283,7 @@ const menusOnly = computed(() => {
|
|
|
284
283
|
</q-list>
|
|
285
284
|
</q-btn-dropdown>
|
|
286
285
|
</template>
|
|
287
|
-
</q-
|
|
286
|
+
</q-toolbar>
|
|
288
287
|
<q-splitter v-model="splitterModel" style="height:680px">
|
|
289
288
|
<template #before>
|
|
290
289
|
|
|
@@ -318,7 +317,8 @@ const menusOnly = computed(() => {
|
|
|
318
317
|
Icons</a>
|
|
319
318
|
</li>
|
|
320
319
|
<li>
|
|
321
|
-
<a href="https://quasar.dev/vue-components/icon#webfont-usage"
|
|
320
|
+
<a href="https://quasar.dev/vue-components/icon#webfont-usage"
|
|
321
|
+
target="_blank">Quasar
|
|
322
322
|
Icons</a>
|
|
323
323
|
</li>
|
|
324
324
|
</ul>
|
|
@@ -4,7 +4,7 @@ const columns = model("SystemValue").columns(["name", "value"]);
|
|
|
4
4
|
</script>
|
|
5
5
|
<template>
|
|
6
6
|
<l-page>
|
|
7
|
-
<l-table row-key="systemvalue_id" :columns="columns" @request="$event.loadObjects('SystemValue')"
|
|
7
|
+
<l-table row-key="systemvalue_id" :columns="columns" @request-data="$event.loadObjects('SystemValue')"
|
|
8
8
|
:actions="['edit', 'delete']"></l-table>
|
|
9
9
|
</l-page>
|
|
10
10
|
</template>
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
<script setup>
|
|
2
2
|
import { ref } from 'vue'
|
|
3
|
-
import { model } from "#imports"
|
|
3
|
+
import { model, resolveComponent } from "#imports"
|
|
4
4
|
const onRequest = async (request) => {
|
|
5
|
-
|
|
6
5
|
request.loadObjects("User", { status: status.value });
|
|
7
6
|
};
|
|
7
|
+
|
|
8
8
|
const columns = model("User").columns({
|
|
9
9
|
username: true,
|
|
10
10
|
first_name: true,
|
|
@@ -19,17 +19,24 @@ const columns = model("User").columns({
|
|
|
19
19
|
|
|
20
20
|
const status = ref("0");
|
|
21
21
|
|
|
22
|
+
//const testDialog = resolveComponent("l-test-dialog")
|
|
23
|
+
|
|
24
|
+
//const testDialog = null
|
|
25
|
+
const testDialog = resolveComponent("l-test2")
|
|
26
|
+
|
|
27
|
+
|
|
22
28
|
</script>
|
|
23
29
|
|
|
24
30
|
<template>
|
|
25
31
|
<l-page>
|
|
26
32
|
<l-tabs v-model="status">
|
|
27
33
|
<l-tab label="Active" name="0">
|
|
28
|
-
<l-table ref="table" row-key="user_id" @request="onRequest" :columns="columns"
|
|
34
|
+
<l-table ref="table" row-key="user_id" @request-data="onRequest" :columns="columns"
|
|
35
|
+
:add-component="testDialog"
|
|
29
36
|
:actions="['view', 'edit', 'delete']"></l-table>
|
|
30
37
|
</l-tab>
|
|
31
38
|
<l-tab label="Inactive" name="1">
|
|
32
|
-
<l-table row-key="user_id" @request="onRequest" :columns="columns"
|
|
39
|
+
<l-table row-key="user_id" @request-data="onRequest" :columns="columns"
|
|
33
40
|
:actions="['view', 'edit', 'delete']">
|
|
34
41
|
</l-table>
|
|
35
42
|
</l-tab>
|
|
@@ -4,7 +4,7 @@ const columns = model("UserLog").columns(["userlog_id", "username", "login_dt",
|
|
|
4
4
|
</script>
|
|
5
5
|
<template>
|
|
6
6
|
<l-page>
|
|
7
|
-
<l-table @request="$event.loadObjects('UserLog')" :columns="columns" sort-by="login_dt:desc">
|
|
7
|
+
<l-table @request-data="$event.loadObjects('UserLog')" :columns="columns" sort-by="login_dt:desc">
|
|
8
8
|
</l-table>
|
|
9
9
|
</l-page>
|
|
10
10
|
</template>
|
package/dist/runtime/plugin.js
CHANGED
|
@@ -24,10 +24,14 @@ export default defineNuxtPlugin((nuxtApp) => {
|
|
|
24
24
|
api.models.create("MailLog", TypeMailLog);
|
|
25
25
|
api.models.create("EventLog", TypeEventLog);
|
|
26
26
|
nuxtApp.vueApp.config.globalProperties.$light = useLight();
|
|
27
|
-
nuxtApp.vueApp.config.errorHandler = (
|
|
28
|
-
console.log(
|
|
27
|
+
nuxtApp.vueApp.config.errorHandler = (err, instance, info) => {
|
|
28
|
+
console.log(err);
|
|
29
29
|
const light = useLight();
|
|
30
|
-
|
|
30
|
+
if (err instanceof Error) {
|
|
31
|
+
light.addError(err);
|
|
32
|
+
} else {
|
|
33
|
+
light.addError(new Error(err));
|
|
34
|
+
}
|
|
31
35
|
};
|
|
32
36
|
const i18n = createI18n({
|
|
33
37
|
legacy: false,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hostlink/nuxt-light",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.15.1",
|
|
4
4
|
"description": "HostLink Nuxt Light Framework",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
"diff2html": "^3.4.47",
|
|
43
43
|
"formkit-quasar": "^0.0.15",
|
|
44
44
|
"json-to-graphql-query": "^2.2.5",
|
|
45
|
-
"quasar": "^2.
|
|
45
|
+
"quasar": "^2.17.0",
|
|
46
46
|
"vue-i18n": "^9.2.2",
|
|
47
47
|
"xlsx": "https://cdn.sheetjs.com/xlsx-0.20.2/xlsx-0.20.2.tgz"
|
|
48
48
|
},
|