@hostlink/nuxt-light 1.14.3 → 1.15.0
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 +32 -0
- package/dist/runtime/components/l-app-main.vue +5 -1
- 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 +99 -0
- package/dist/runtime/components/l-input.vue +4 -1
- package/dist/runtime/components/l-page.vue +7 -13
- package/dist/runtime/components/l-table.vue +40 -14
- 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 +23 -10
- package/dist/runtime/index.d.ts +6 -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 +10 -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
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
|
|
3
|
+
import { useI18n } from 'vue-i18n';
|
|
4
|
+
|
|
5
|
+
const i18n = useI18n();
|
|
6
|
+
|
|
7
|
+
const props = defineProps({
|
|
8
|
+
gutter: {
|
|
9
|
+
type: String,
|
|
10
|
+
default: "none"
|
|
11
|
+
},
|
|
12
|
+
label: {
|
|
13
|
+
type: String,
|
|
14
|
+
default: null
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
})
|
|
18
|
+
|
|
19
|
+
</script>
|
|
20
|
+
|
|
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;margin:0}legend{padding-left:.5rem;padding-right:.5rem}
|
|
23
|
+
</style>
|
|
24
|
+
<template>
|
|
25
|
+
<fieldset :class="`q-gutter-${props.gutter}`">
|
|
26
|
+
<legend v-if="props.label">{{ i18n.t(props.label) }}</legend>
|
|
27
|
+
<slot></slot>
|
|
28
|
+
|
|
29
|
+
{{ props }}
|
|
30
|
+
|
|
31
|
+
</fieldset>
|
|
32
|
+
</template>
|
|
@@ -418,8 +418,12 @@ if (route.fullPath == "/" && my.default_page) {
|
|
|
418
418
|
<slot name="header"></slot>
|
|
419
419
|
<q-banner dense inline-actions class="bg-grey-4 q-ma-md" v-for=" error in errors " rounded>
|
|
420
420
|
{{ error }}
|
|
421
|
-
|
|
422
421
|
<template v-slot:action>
|
|
422
|
+
<q-btn flat label="Detail" @click="$q.dialog({
|
|
423
|
+
title: 'Error Detail',
|
|
424
|
+
message: error.stack,
|
|
425
|
+
fullWidth: true,
|
|
426
|
+
})"></q-btn>
|
|
423
427
|
<q-btn flat icon="sym_o_close" round dense @click="light.removeError(error)" />
|
|
424
428
|
</template>
|
|
425
429
|
</q-banner>
|
|
@@ -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,99 @@
|
|
|
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
|
+
ok: {
|
|
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
|
+
|
|
41
|
+
const onOk = async (data, node) => {
|
|
42
|
+
emits('submit', data)
|
|
43
|
+
|
|
44
|
+
if (props.ok) {
|
|
45
|
+
loading.value = true
|
|
46
|
+
try {
|
|
47
|
+
await props.ok(data)
|
|
48
|
+
onDialogOK(data)
|
|
49
|
+
} catch (error) {
|
|
50
|
+
|
|
51
|
+
$q.dialog({
|
|
52
|
+
title: 'Error',
|
|
53
|
+
message: error.message
|
|
54
|
+
})
|
|
55
|
+
} finally {
|
|
56
|
+
loading.value = false
|
|
57
|
+
}
|
|
58
|
+
} else {
|
|
59
|
+
onDialogOK(data)
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
const onCancel = async () => {
|
|
64
|
+
|
|
65
|
+
if (props.cancel) {
|
|
66
|
+
await props.cancel()
|
|
67
|
+
}
|
|
68
|
+
onDialogCancel()
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
</script>
|
|
72
|
+
<template>
|
|
73
|
+
<q-dialog ref="dialogRef">
|
|
74
|
+
|
|
75
|
+
<q-card :style="{ width }" :loading="loading">
|
|
76
|
+
|
|
77
|
+
<q-toolbar>
|
|
78
|
+
<q-toolbar-title v-if="title">
|
|
79
|
+
{{ title }}
|
|
80
|
+
</q-toolbar-title>
|
|
81
|
+
<q-space />
|
|
82
|
+
<q-btn icon="sym_o_close" flat round dense v-close-popup />
|
|
83
|
+
</q-toolbar>
|
|
84
|
+
|
|
85
|
+
<form-kit type="form" :bordered="false" :actions="false" :value="value" #default="context" @submit="onOk">
|
|
86
|
+
|
|
87
|
+
<q-card-section>
|
|
88
|
+
<slot name="default" v-bind="context"></slot>
|
|
89
|
+
</q-card-section>
|
|
90
|
+
<q-card-actions align="right">
|
|
91
|
+
<q-btn label="Cancel" @click="onCancel" unelevated color="grey-4" text-color="grey-8" />
|
|
92
|
+
<q-btn label="OK" type="submit" color="primary" unelevated :disabled="!context.state.valid" />
|
|
93
|
+
</q-card-actions>
|
|
94
|
+
</form-kit>
|
|
95
|
+
|
|
96
|
+
<q-inner-loading :showing="loading"></q-inner-loading>
|
|
97
|
+
</q-card>
|
|
98
|
+
</q-dialog>
|
|
99
|
+
</template>
|
|
@@ -5,7 +5,7 @@ import tc2sc from "../lib/tc2sc";
|
|
|
5
5
|
import { useLight } from '#imports';
|
|
6
6
|
|
|
7
7
|
import type { QInputProps } from "quasar";
|
|
8
|
-
export interface LInputProps extends
|
|
8
|
+
export interface LInputProps extends QInputProps {
|
|
9
9
|
showPassword?: boolean;
|
|
10
10
|
translate?: boolean;
|
|
11
11
|
required?: boolean;
|
|
@@ -26,8 +26,10 @@ const props = withDefaults(defineProps<LInputProps>(), {
|
|
|
26
26
|
stackLabel: undefined,
|
|
27
27
|
required: false,
|
|
28
28
|
hideBottomSpace: true,
|
|
29
|
+
dark: undefined,
|
|
29
30
|
});
|
|
30
31
|
|
|
32
|
+
|
|
31
33
|
const emit = defineEmits(["update:modelValue"]);
|
|
32
34
|
|
|
33
35
|
//clone rules to new_rules
|
|
@@ -147,6 +149,7 @@ const attrs = computed(() => {
|
|
|
147
149
|
if (props.color === undefined) a.color = light.color
|
|
148
150
|
return a;
|
|
149
151
|
})
|
|
152
|
+
|
|
150
153
|
</script>
|
|
151
154
|
<template>
|
|
152
155
|
<q-input v-bind="attrs" v-model="localValue" :rules="new_rules" :type="localType">
|
|
@@ -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,6 +61,7 @@ const props = withDefaults(defineProps<LTableProps>(), {
|
|
|
56
61
|
selected: () => [],
|
|
57
62
|
loadingLabel: "Loading...",
|
|
58
63
|
noDataLabel: "No data available",
|
|
64
|
+
dark: undefined,
|
|
59
65
|
});
|
|
60
66
|
|
|
61
67
|
const isServerSide = (props.rows == undefined);
|
|
@@ -98,6 +104,10 @@ export interface LTableRequest {
|
|
|
98
104
|
sort: string,
|
|
99
105
|
fields: Array<string>,
|
|
100
106
|
gql: {
|
|
107
|
+
__args: {
|
|
108
|
+
filters: any,
|
|
109
|
+
sort: string
|
|
110
|
+
},
|
|
101
111
|
data: {
|
|
102
112
|
__args: {
|
|
103
113
|
limit: number
|
|
@@ -118,10 +128,11 @@ export interface LTableRequest {
|
|
|
118
128
|
}
|
|
119
129
|
|
|
120
130
|
const emits = defineEmits<{
|
|
121
|
-
request: [p: LTableRequest],
|
|
131
|
+
"request-data": [p: LTableRequest],
|
|
122
132
|
"update:selected": [p: Array<any>]
|
|
123
133
|
}>()
|
|
124
134
|
|
|
135
|
+
|
|
125
136
|
const loading = ref(false);
|
|
126
137
|
|
|
127
138
|
let activeEdit = false;
|
|
@@ -159,6 +170,7 @@ onMounted(() => {
|
|
|
159
170
|
table.value && table.value.requestServerInteraction();
|
|
160
171
|
})
|
|
161
172
|
|
|
173
|
+
|
|
162
174
|
let primaryKey = ref(props.rowKey);
|
|
163
175
|
const modelName = ref(props.modelName);
|
|
164
176
|
|
|
@@ -243,7 +255,7 @@ const getData = async (
|
|
|
243
255
|
|
|
244
256
|
}
|
|
245
257
|
|
|
246
|
-
const
|
|
258
|
+
const onLocalRequest = async (p: any) => {
|
|
247
259
|
if (!isServerSide) return;
|
|
248
260
|
|
|
249
261
|
|
|
@@ -285,7 +297,7 @@ const onRequest = async (p: any) => {
|
|
|
285
297
|
}
|
|
286
298
|
|
|
287
299
|
|
|
288
|
-
const callback = {
|
|
300
|
+
const callback: LTableRequest = {
|
|
289
301
|
sort: sort,
|
|
290
302
|
fields: builder.get(),
|
|
291
303
|
offset: (p.pagination.page - 1) * p.pagination.rowsPerPage,
|
|
@@ -358,7 +370,7 @@ const onRequest = async (p: any) => {
|
|
|
358
370
|
|
|
359
371
|
loading.value = true;
|
|
360
372
|
//emits("request", p);
|
|
361
|
-
emits("
|
|
373
|
+
emits("requestData", callback);
|
|
362
374
|
|
|
363
375
|
}
|
|
364
376
|
|
|
@@ -395,7 +407,7 @@ const getFilterValue = () => {
|
|
|
395
407
|
const onFilters = () => {
|
|
396
408
|
|
|
397
409
|
//clone the filters
|
|
398
|
-
|
|
410
|
+
onLocalRequest({
|
|
399
411
|
pagination: {
|
|
400
412
|
page: 1,
|
|
401
413
|
rowsPerPage: props.pagination.rowsPerPage,
|
|
@@ -531,6 +543,16 @@ defineExpose({
|
|
|
531
543
|
requestServerInteraction
|
|
532
544
|
})
|
|
533
545
|
|
|
546
|
+
const onAdd = () => {
|
|
547
|
+
if (!props.addComponent) return;
|
|
548
|
+
|
|
549
|
+
$q.dialog({
|
|
550
|
+
|
|
551
|
+
component: props.addComponent
|
|
552
|
+
}).onOk(() => {
|
|
553
|
+
requestServerInteraction();
|
|
554
|
+
})
|
|
555
|
+
}
|
|
534
556
|
</script>
|
|
535
557
|
|
|
536
558
|
|
|
@@ -538,6 +560,10 @@ defineExpose({
|
|
|
538
560
|
<l-card flat bordered :maximizable="maximizable" :minimizable="minimizable" :title="title"
|
|
539
561
|
v-model:minimized="minimized" v-model:maximized="maximized">
|
|
540
562
|
|
|
563
|
+
<q-toolbar v-if="addComponent">
|
|
564
|
+
<q-btn icon="sym_o_add" label="Add" color="primary" @click="onAdd" v-if="addComponent" dense />
|
|
565
|
+
</q-toolbar>
|
|
566
|
+
|
|
541
567
|
|
|
542
568
|
<template v-if="errors.length > 0">
|
|
543
569
|
<div class="q-mb-sm">
|
|
@@ -547,7 +573,7 @@ defineExpose({
|
|
|
547
573
|
</div>
|
|
548
574
|
</template>
|
|
549
575
|
|
|
550
|
-
<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"
|
|
551
577
|
v-model:pagination="pagination" :filter="filter" v-model:selected="localSelected">
|
|
552
578
|
|
|
553
579
|
|
|
@@ -573,7 +599,7 @@ defineExpose({
|
|
|
573
599
|
<q-checkbox v-model="props.selected" />
|
|
574
600
|
</q-td>
|
|
575
601
|
<q-td v-if="hasRowExpand" auto-width>
|
|
576
|
-
<q-btn :class="{ 'text-grey-8': !isDark }" flat round
|
|
602
|
+
<q-btn :class="{ 'text-grey-8': !isDark }" flat round size="sm"
|
|
577
603
|
:icon="props.expand ? 'sym_o_expand_more' : 'sym_o_expand_less'"
|
|
578
604
|
@click="props.expand = !props.expand"></q-btn>
|
|
579
605
|
</q-td>
|
|
@@ -582,13 +608,13 @@ defineExpose({
|
|
|
582
608
|
<div :class="{ 'text-grey-8': !isDark }" v-if="primaryKey">
|
|
583
609
|
|
|
584
610
|
<l-view-btn v-if="actionView && props.row.canView"
|
|
585
|
-
:to="`/${modelName}/${props.row[primaryKey]}/view`" />
|
|
611
|
+
:to="`/${modelName}/${props.row[primaryKey]}/view`" size="sm"/>
|
|
586
612
|
|
|
587
613
|
<l-edit-btn v-if="activeEdit && props.row.canUpdate"
|
|
588
|
-
:to="`/${modelName}/${props.row[primaryKey]}/edit`" />
|
|
614
|
+
:to="`/${modelName}/${props.row[primaryKey]}/edit`" size="sm"/>
|
|
589
615
|
|
|
590
616
|
<l-delete-btn v-if="actionDelete && props.row.canDelete"
|
|
591
|
-
@submit="onDelete(props.row[primaryKey])"></l-delete-btn>
|
|
617
|
+
@submit="onDelete(props.row[primaryKey])" size="sm"></l-delete-btn>
|
|
592
618
|
|
|
593
619
|
<slot name="actions" v-bind="props"></slot>
|
|
594
620
|
</div>
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { ref } from 'vue'
|
|
3
|
+
const form = ref(null)
|
|
4
|
+
const ok = async (data, node) => {
|
|
5
|
+
await new Promise(resolve => setTimeout(resolve, 1000))
|
|
6
|
+
}
|
|
7
|
+
</script>
|
|
8
|
+
<template>
|
|
9
|
+
<l-form-dialog title="Add User" :ok="ok">
|
|
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,49 @@
|
|
|
1
|
-
<script setup>
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { type FormKitInputs } from '@formkit/inputs';
|
|
2
3
|
import { computed } from 'vue'
|
|
3
4
|
import { getErrorMessage } from 'formkit-quasar';
|
|
4
5
|
|
|
6
|
+
declare module '@formkit/inputs' {
|
|
7
|
+
interface FormKitInputProps<Props extends FormKitInputs<Props>> {
|
|
8
|
+
lInput: {
|
|
9
|
+
type: 'l-input';
|
|
10
|
+
name: string;
|
|
11
|
+
label: string;
|
|
12
|
+
number?: string;
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
|
|
5
18
|
const props = defineProps({
|
|
6
19
|
context: Object
|
|
7
20
|
});
|
|
8
21
|
|
|
9
|
-
const { error, errorMessage } = getErrorMessage(props.context
|
|
22
|
+
const { error, errorMessage } = getErrorMessage(props.context?.node);
|
|
10
23
|
|
|
11
24
|
const value = computed({
|
|
12
|
-
get: () => props.context
|
|
25
|
+
get: () => props.context?.value,
|
|
13
26
|
set: (val) => {
|
|
14
|
-
if (props.context
|
|
27
|
+
if (props.context?.number !== undefined) {
|
|
15
28
|
if (val === "") {
|
|
16
|
-
props.context
|
|
29
|
+
props.context?.node.input(0)
|
|
17
30
|
return
|
|
18
31
|
}
|
|
19
32
|
|
|
20
33
|
let tryprase = parseInt(val)
|
|
21
34
|
if (isNaN(tryprase)) {
|
|
22
|
-
props.context
|
|
35
|
+
props.context?.node.input(val)
|
|
23
36
|
return
|
|
24
37
|
}
|
|
25
38
|
|
|
26
|
-
if (props.context
|
|
27
|
-
props.context
|
|
39
|
+
if (props.context?.number === "integer") {
|
|
40
|
+
props.context?.node.input(parseInt(val))
|
|
28
41
|
return
|
|
29
42
|
}
|
|
30
43
|
|
|
31
44
|
props.context.node.input(parseFloat(val))
|
|
32
45
|
} else {
|
|
33
|
-
props.context
|
|
46
|
+
props.context?.node.input(val)
|
|
34
47
|
}
|
|
35
48
|
}
|
|
36
49
|
})
|
|
@@ -45,7 +58,7 @@ const onBlur = () => {
|
|
|
45
58
|
|
|
46
59
|
</script>
|
|
47
60
|
<template>
|
|
48
|
-
<l-input v-model="value" :label="context
|
|
61
|
+
<l-input v-model="value" :label="context?.label" v-bind="context?.attrs" :error="error" :type="context?.inputType"
|
|
49
62
|
:error-message="errorMessage" @blur="onBlur">
|
|
50
63
|
|
|
51
64
|
<template v-for="(s, name) in $slots" v-slot:[name]="props" :key="name">
|
package/dist/runtime/index.d.ts
CHANGED
|
@@ -34,9 +34,9 @@ declare const app: {
|
|
|
34
34
|
setCompanyLogo: (logo: string) => void;
|
|
35
35
|
getCompanyLogo: () => string;
|
|
36
36
|
getVersion: () => string;
|
|
37
|
-
addError: (
|
|
38
|
-
getErrors: () =>
|
|
39
|
-
removeError: (error:
|
|
37
|
+
addError: (err: Error) => void;
|
|
38
|
+
getErrors: () => Error[];
|
|
39
|
+
removeError: (error: Error) => void;
|
|
40
40
|
getStyle: (name: string) => any;
|
|
41
41
|
setStyles: (s: Object) => void;
|
|
42
42
|
getStyles: () => {
|
|
@@ -83,9 +83,9 @@ export declare const useLight: (options?: {
|
|
|
83
83
|
setCompanyLogo: (logo: string) => void;
|
|
84
84
|
getCompanyLogo: () => string;
|
|
85
85
|
getVersion: () => string;
|
|
86
|
-
addError: (
|
|
87
|
-
getErrors: () =>
|
|
88
|
-
removeError: (error:
|
|
86
|
+
addError: (err: Error) => void;
|
|
87
|
+
getErrors: () => Error[];
|
|
88
|
+
removeError: (error: Error) => void;
|
|
89
89
|
getStyle: (name: string) => any;
|
|
90
90
|
setStyles: (s: Object) => void;
|
|
91
91
|
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,23 @@ const columns = model("User").columns({
|
|
|
19
19
|
|
|
20
20
|
const status = ref("0");
|
|
21
21
|
|
|
22
|
+
//const testDialog = resolveComponent("l-test-dialog")
|
|
23
|
+
//const testDialog = resolveComponent("l-test2")
|
|
24
|
+
const testDialog = null
|
|
25
|
+
|
|
26
|
+
|
|
22
27
|
</script>
|
|
23
28
|
|
|
24
29
|
<template>
|
|
25
30
|
<l-page>
|
|
26
31
|
<l-tabs v-model="status">
|
|
27
32
|
<l-tab label="Active" name="0">
|
|
28
|
-
<l-table ref="table" row-key="user_id" @request="onRequest" :columns="columns"
|
|
33
|
+
<l-table ref="table" row-key="user_id" @request-data="onRequest" :columns="columns"
|
|
34
|
+
:add-component="testDialog"
|
|
29
35
|
:actions="['view', 'edit', 'delete']"></l-table>
|
|
30
36
|
</l-tab>
|
|
31
37
|
<l-tab label="Inactive" name="1">
|
|
32
|
-
<l-table row-key="user_id" @request="onRequest" :columns="columns"
|
|
38
|
+
<l-table row-key="user_id" @request-data="onRequest" :columns="columns"
|
|
33
39
|
:actions="['view', 'edit', 'delete']">
|
|
34
40
|
</l-table>
|
|
35
41
|
</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.0",
|
|
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
|
},
|