@hostlink/nuxt-light 0.0.35 → 0.0.37
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-add-btn.vue +13 -9
- package/dist/runtime/components/l-app-main.vue +9 -4
- package/dist/runtime/components/l-back-btn.vue +1 -1
- package/dist/runtime/components/l-btn.vue +15 -3
- package/dist/runtime/components/l-card.vue +12 -3
- package/dist/runtime/components/l-col.vue +16 -2
- package/dist/runtime/components/l-date-picker.vue +19 -8
- package/dist/runtime/components/l-form.vue +9 -2
- package/dist/runtime/components/l-input.vue +20 -3
- package/dist/runtime/components/l-login.vue +15 -10
- package/dist/runtime/components/l-save-btn.vue +1 -1
- package/dist/runtime/components/l-select.vue +18 -15
- package/dist/runtime/components/l-table.vue +7 -4
- package/dist/runtime/index.d.ts +1 -1
- package/dist/runtime/index.mjs +4 -1
- package/dist/runtime/locales/zh-hk.json +5 -1
- package/dist/runtime/pages/System/menu/index.vue +8 -8
- package/dist/runtime/pages/User/_user_id/edit.vue +4 -9
- package/dist/runtime/pages/User/add.vue +4 -11
- package/dist/runtime/pages/User/setting/index.vue +2 -3
- package/dist/runtime/pages/User/setting/style.vue +118 -5
- package/package.json +1 -1
package/dist/module.json
CHANGED
|
@@ -1,24 +1,28 @@
|
|
|
1
1
|
<script setup>
|
|
2
2
|
import { useRoute } from "vue-router"
|
|
3
|
-
import { useI18n } from "vue-i18n"
|
|
4
|
-
const i18n = useI18n()
|
|
5
3
|
const route = useRoute();
|
|
6
4
|
|
|
7
5
|
//get relative path
|
|
8
6
|
const relativePath = route.path.split("/").slice(1).join("/");
|
|
9
7
|
|
|
10
|
-
const props = defineProps(
|
|
11
|
-
|
|
12
|
-
|
|
8
|
+
const props = defineProps({
|
|
9
|
+
label: {
|
|
10
|
+
type: String,
|
|
11
|
+
default: "Add"
|
|
12
|
+
},
|
|
13
|
+
to: {
|
|
14
|
+
type: String,
|
|
15
|
+
default: null
|
|
16
|
+
}
|
|
17
|
+
});
|
|
13
18
|
|
|
14
19
|
const to = props.to ?? relativePath + "/add";
|
|
15
20
|
|
|
16
|
-
|
|
17
21
|
</script>
|
|
18
22
|
<template>
|
|
19
|
-
<
|
|
23
|
+
<l-btn color="primary" icon="sym_o_add" :to="to" :label="label">
|
|
20
24
|
<q-tooltip>
|
|
21
|
-
{{ label }}
|
|
25
|
+
{{ $t(label) }}
|
|
22
26
|
</q-tooltip>
|
|
23
|
-
</
|
|
27
|
+
</l-btn>
|
|
24
28
|
</template>
|
|
@@ -3,19 +3,24 @@ import { useQuasar } from 'quasar';
|
|
|
3
3
|
import { useI18n } from 'vue-i18n';
|
|
4
4
|
import { useLight, q, getCurrentUser, m, f } from '../';
|
|
5
5
|
import { ref, computed, reactive, provide, watch } from 'vue';
|
|
6
|
-
//import packageJson from '../../package.json'
|
|
7
6
|
|
|
8
7
|
const quasar = useQuasar();
|
|
9
8
|
quasar.dark.set(false);
|
|
10
9
|
const light = useLight();
|
|
10
|
+
|
|
11
11
|
const props = defineProps({
|
|
12
12
|
company: {
|
|
13
13
|
type: String
|
|
14
14
|
}
|
|
15
15
|
});
|
|
16
16
|
|
|
17
|
-
|
|
18
|
-
|
|
17
|
+
const tt = await q({
|
|
18
|
+
app: ["menus", "viewAsMode", "languages"],
|
|
19
|
+
my: ["styles", "language", f('granted_storage:granted', { right: "system.storage" }, [])],
|
|
20
|
+
})
|
|
21
|
+
|
|
22
|
+
let app = tt.app
|
|
23
|
+
let my = tt.my
|
|
19
24
|
let system = null
|
|
20
25
|
if (my.granted_storage) {
|
|
21
26
|
system = await q("system", ["diskFreeSpace", "diskUsageSpace", "diskTotalSpace", "diskFreeSpacePercent"]);
|
|
@@ -322,7 +327,7 @@ const storageUsagePercent = computed(() => {
|
|
|
322
327
|
<q-footer class="bg-white text-grey" bordered>
|
|
323
328
|
<q-item>
|
|
324
329
|
<q-item-section>
|
|
325
|
-
{{ company }}
|
|
330
|
+
{{ company }} {{ light.getVersion() }} - Copyright 2023 HostLink(HK)
|
|
326
331
|
</q-item-section>
|
|
327
332
|
</q-item>
|
|
328
333
|
</q-footer>
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
<script setup>
|
|
2
|
-
import { ref } from "vue";
|
|
3
|
-
import { q, f } from '../';
|
|
2
|
+
import { ref, useAttrs } from "vue";
|
|
3
|
+
import { q, f, useLight } from '../';
|
|
4
4
|
import { useI18n } from "vue-i18n"
|
|
5
5
|
const i18n = useI18n()
|
|
6
6
|
|
|
7
7
|
const props = defineProps(["permission", "label"]);
|
|
8
8
|
|
|
9
|
+
const light = useLight();
|
|
10
|
+
|
|
9
11
|
const label = i18n.t(props.label);
|
|
10
12
|
|
|
11
13
|
const granted = ref(false);
|
|
@@ -20,10 +22,20 @@ if (props.permission) {
|
|
|
20
22
|
}
|
|
21
23
|
|
|
22
24
|
|
|
25
|
+
const attrs = {
|
|
26
|
+
...{
|
|
27
|
+
rounded: light.getStyle("buttonRounded", true),
|
|
28
|
+
outline: light.getStyle("buttonOutline", true),
|
|
29
|
+
unelevated: light.getStyle("buttonUnelevated", false),
|
|
30
|
+
dense: light.getStyle("buttonDense", false),
|
|
31
|
+
},
|
|
32
|
+
...useAttrs(),
|
|
33
|
+
}
|
|
34
|
+
|
|
23
35
|
|
|
24
36
|
</script>
|
|
25
37
|
<template>
|
|
26
|
-
<q-btn
|
|
38
|
+
<q-btn v-bind="attrs" color="primary" v-if="granted" :label="$t(label)">
|
|
27
39
|
|
|
28
40
|
<slot></slot>
|
|
29
41
|
</q-btn>
|
|
@@ -1,17 +1,26 @@
|
|
|
1
1
|
<script setup>
|
|
2
|
+
import { useLight } from '../'
|
|
3
|
+
import { useAttrs } from 'vue'
|
|
2
4
|
|
|
3
5
|
defineProps({
|
|
4
6
|
loading: Boolean,
|
|
5
7
|
})
|
|
6
8
|
|
|
9
|
+
const light = useLight();
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
const attrs = {
|
|
13
|
+
...{
|
|
14
|
+
flat: light.getStyle("cardFlat", true),
|
|
15
|
+
bordered: light.getStyle("cardBordered", true),
|
|
16
|
+
square: light.getStyle("cardSquare", false),
|
|
17
|
+
}, ...useAttrs()
|
|
7
18
|
|
|
8
|
-
const save = () => {
|
|
9
|
-
console.log("save")
|
|
10
19
|
}
|
|
11
20
|
|
|
12
21
|
</script>
|
|
13
22
|
<template>
|
|
14
|
-
<q-card
|
|
23
|
+
<q-card v-bind="attrs">
|
|
15
24
|
<slot></slot>
|
|
16
25
|
|
|
17
26
|
<q-inner-loading :showing="loading" label="Please wait..." label-class="text-primary" />
|
|
@@ -1,14 +1,28 @@
|
|
|
1
1
|
<script setup>
|
|
2
|
+
import { computed } from 'vue'
|
|
2
3
|
const props = defineProps({
|
|
3
4
|
md: {
|
|
4
5
|
type: [Number, String],
|
|
5
6
|
default: 12
|
|
7
|
+
},
|
|
8
|
+
gutter: {
|
|
9
|
+
type: String,
|
|
10
|
+
default: "none"
|
|
11
|
+
}
|
|
12
|
+
})
|
|
13
|
+
|
|
14
|
+
const classes = computed(() => {
|
|
15
|
+
return {
|
|
16
|
+
[`col-md-${props.md}`]: true
|
|
6
17
|
}
|
|
7
18
|
})
|
|
8
19
|
|
|
9
20
|
</script>
|
|
10
21
|
<template>
|
|
11
|
-
<div class="col-12" :class="
|
|
12
|
-
<
|
|
22
|
+
<div class="col-12" :class="classes">
|
|
23
|
+
<div :class="`q-gutter-${props.gutter}`">
|
|
24
|
+
<slot></slot>
|
|
25
|
+
</div>
|
|
26
|
+
|
|
13
27
|
</div>
|
|
14
28
|
</template>
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
<script setup>
|
|
2
|
-
import { ref, computed } from "vue";
|
|
3
|
-
import {
|
|
2
|
+
import { ref, computed, useAttrs } from "vue";
|
|
3
|
+
import { useLight } from '../';
|
|
4
|
+
|
|
5
|
+
const i18n = useI18n();
|
|
6
|
+
const light = useLight();
|
|
7
|
+
|
|
4
8
|
const props = defineProps({
|
|
5
9
|
modelValue: {
|
|
6
10
|
type: [String, Object],
|
|
@@ -53,15 +57,22 @@ if (props.required && !props.range) {
|
|
|
53
57
|
});
|
|
54
58
|
}
|
|
55
59
|
|
|
56
|
-
const
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
60
|
+
const attrs = {
|
|
61
|
+
...{
|
|
62
|
+
filled: light.getStyle("inputFilled", false),
|
|
63
|
+
outlined: light.getStyle("inputOutlined", true),
|
|
64
|
+
standout: light.getStyle("inputStandout", false),
|
|
65
|
+
rounded: light.getStyle("inputRounded", false),
|
|
66
|
+
dense: light.getStyle("inputDense", false),
|
|
67
|
+
square: light.getStyle("inputSquare", false),
|
|
68
|
+
stackLabel: light.getStyle("inputStackLabel", false)
|
|
69
|
+
},
|
|
70
|
+
...useAttrs(),
|
|
71
|
+
}
|
|
61
72
|
|
|
62
73
|
</script>
|
|
63
74
|
<template>
|
|
64
|
-
<q-input v-model="localValue" :rules="rules" :label="
|
|
75
|
+
<q-input v-bind="attrs" v-model="localValue" :rules="rules" :label="$t(label)" hide-bottom-space>
|
|
65
76
|
<template v-slot:prepend>
|
|
66
77
|
<q-btn icon="sym_o_event" round dense flat>
|
|
67
78
|
<q-popup-proxy cover transition-show="scale" transition-hide="scale" ref="popup">
|
|
@@ -16,6 +16,10 @@ const props = defineProps({
|
|
|
16
16
|
bordered: {
|
|
17
17
|
type: Boolean,
|
|
18
18
|
default: true
|
|
19
|
+
},
|
|
20
|
+
gutter: {
|
|
21
|
+
type: String,
|
|
22
|
+
default: "md"
|
|
19
23
|
}
|
|
20
24
|
});
|
|
21
25
|
|
|
@@ -33,7 +37,7 @@ const save = async () => {
|
|
|
33
37
|
|
|
34
38
|
if (props.modelValue) {
|
|
35
39
|
const [module, id_name] = route.name.split("-");
|
|
36
|
-
|
|
40
|
+
|
|
37
41
|
|
|
38
42
|
if (route.params[id_name]) {//edit
|
|
39
43
|
|
|
@@ -71,7 +75,10 @@ const onSubmit = (e) => {
|
|
|
71
75
|
<q-form ref="form" @submit="onSubmit">
|
|
72
76
|
<l-card :bordered="bordered">
|
|
73
77
|
<q-card-section>
|
|
74
|
-
<
|
|
78
|
+
<div :class="`q-gutter-${gutter}`">
|
|
79
|
+
<slot></slot>
|
|
80
|
+
</div>
|
|
81
|
+
|
|
75
82
|
</q-card-section>
|
|
76
83
|
|
|
77
84
|
<q-card-actions align="right">
|
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
<script setup>
|
|
2
|
-
import { computed, ref } from "vue";
|
|
2
|
+
import { computed, ref, useSlots, useAttrs } from "vue";
|
|
3
3
|
import { useI18n } from 'vue-i18n';
|
|
4
4
|
import tc2sc from "../lib/tc2sc";
|
|
5
|
+
import { useLight } from '../';
|
|
5
6
|
|
|
6
7
|
const i18n = useI18n();
|
|
8
|
+
const light = useLight();
|
|
9
|
+
const slots = useSlots();
|
|
7
10
|
|
|
8
11
|
const props = defineProps({
|
|
9
12
|
modelValue: {
|
|
@@ -98,10 +101,23 @@ const onClickTc2Sc = () => {
|
|
|
98
101
|
}
|
|
99
102
|
|
|
100
103
|
|
|
104
|
+
|
|
105
|
+
const attrs = {
|
|
106
|
+
...{
|
|
107
|
+
filled: light.getStyle("inputFilled", false),
|
|
108
|
+
outlined: light.getStyle("inputOutlined", false),
|
|
109
|
+
standout: light.getStyle("inputStandout", false),
|
|
110
|
+
rounded: light.getStyle("inputRounded", false),
|
|
111
|
+
dense: light.getStyle("inputDense", false),
|
|
112
|
+
square: light.getStyle("inputSquare", false),
|
|
113
|
+
stackLabel: light.getStyle("inputStackLabel", false)
|
|
114
|
+
},
|
|
115
|
+
...useAttrs(),
|
|
116
|
+
}
|
|
101
117
|
</script>
|
|
102
118
|
<template>
|
|
103
|
-
|
|
104
|
-
|
|
119
|
+
{{ slotNames }}
|
|
120
|
+
<q-input v-bind="attrs" :label="localLabel" v-model="localValue" :rules="new_rules" hide-bottom-space :type="localType">
|
|
105
121
|
<template v-if="translate" #prepend>
|
|
106
122
|
<q-btn icon="sym_o_translate" flat dense rounded>
|
|
107
123
|
<q-menu dens>
|
|
@@ -121,5 +137,6 @@ const onClickTc2Sc = () => {
|
|
|
121
137
|
<q-icon name="sym_o_visibility_off" class="cursor-pointer" :color="showPassword ? 'grey-5' : 'primary'"
|
|
122
138
|
@click="isShowPassword = true" v-else />
|
|
123
139
|
</template>
|
|
140
|
+
|
|
124
141
|
</q-input>
|
|
125
142
|
</template>
|
|
@@ -1,14 +1,16 @@
|
|
|
1
1
|
<script setup>
|
|
2
2
|
import { ref, reactive } from 'vue'
|
|
3
3
|
import { useQuasar } from 'quasar';
|
|
4
|
+
import { useI18n } from 'vue-i18n';
|
|
4
5
|
import { login, m, notify } from '../';
|
|
6
|
+
|
|
5
7
|
defineProps({
|
|
6
8
|
company: String,
|
|
7
9
|
companyLogo: String,
|
|
8
10
|
twoFactorAuthentication: Boolean
|
|
9
|
-
|
|
10
11
|
})
|
|
11
12
|
|
|
13
|
+
const i18n = useI18n();
|
|
12
14
|
const form1 = ref(null);
|
|
13
15
|
const data = reactive({
|
|
14
16
|
username: "", password: "", code: ""
|
|
@@ -32,7 +34,7 @@ const forgetPassword = async () => {
|
|
|
32
34
|
|
|
33
35
|
//show dialog
|
|
34
36
|
qua.dialog({
|
|
35
|
-
title: "Forget password",
|
|
37
|
+
title: i18n.t("Forget password"),
|
|
36
38
|
message: "Please enter your email address, we will send you a code to reset your password",
|
|
37
39
|
prompt: {
|
|
38
40
|
model: "",
|
|
@@ -105,23 +107,26 @@ const forgetPassword = async () => {
|
|
|
105
107
|
</script>
|
|
106
108
|
|
|
107
109
|
<template>
|
|
108
|
-
<q-card bordered flat style="min-width:400px;max-width: 400px;" class="fixed-center
|
|
110
|
+
<q-card bordered flat style="min-width:400px;max-width: 400px;" class="fixed-center">
|
|
109
111
|
<q-card-section>
|
|
110
112
|
<q-img :src="companyLogo" class="full-width" />
|
|
111
113
|
<div class="text-h6">
|
|
112
114
|
{{ company }}
|
|
113
115
|
</div>
|
|
114
116
|
<q-form ref="form1">
|
|
115
|
-
<
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
117
|
+
<div class="q-gutter-sm">
|
|
118
|
+
<l-input v-model.trim="data.username" label="Username" :rules="[v => !!v || $t('Username is required')]"
|
|
119
|
+
clearable />
|
|
120
|
+
<l-input v-model="data.password" label="Password" type="password" clearable show-password
|
|
121
|
+
:rules="[v => !!v || $t('Password is required')]" @keydown.enter.prevent="submit" />
|
|
122
|
+
<l-input v-if="twoFactorAuthentication" v-model="data.code" label="2FA code" required type="text" clearable>
|
|
123
|
+
</l-input>
|
|
124
|
+
</div>
|
|
120
125
|
</q-form>
|
|
121
126
|
</q-card-section>
|
|
122
127
|
<q-card-actions>
|
|
123
|
-
<
|
|
124
|
-
<
|
|
128
|
+
<l-btn label="Login" outline rounded color="primary" icon="sym_o_login" @click="submit" />
|
|
129
|
+
<l-btn label="Forget password" outline rounded color="primary" icon="sym_o_lock_reset" @click="forgetPassword" />
|
|
125
130
|
</q-card-actions>
|
|
126
131
|
</q-card>
|
|
127
132
|
</template>
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
<script setup>
|
|
2
|
-
import { computed, ref } from "vue";
|
|
3
|
-
import {
|
|
4
|
-
const props = defineProps({
|
|
2
|
+
import { computed, ref, useAttrs } from "vue";
|
|
3
|
+
import { useLight } from '../';
|
|
5
4
|
|
|
5
|
+
const light = useLight();
|
|
6
|
+
const props = defineProps({
|
|
6
7
|
rules: {
|
|
7
8
|
type: Array,
|
|
8
9
|
default: () => []
|
|
@@ -25,8 +26,6 @@ const props = defineProps({
|
|
|
25
26
|
},
|
|
26
27
|
})
|
|
27
28
|
|
|
28
|
-
|
|
29
|
-
|
|
30
29
|
if (props.required) {
|
|
31
30
|
props.rules.push((val) => {
|
|
32
31
|
if (Number.isInteger(val)) {
|
|
@@ -49,28 +48,32 @@ const filterFn = (val, update, abort) => {
|
|
|
49
48
|
}
|
|
50
49
|
|
|
51
50
|
update(() => {
|
|
52
|
-
|
|
53
51
|
const needle = val.toLowerCase();
|
|
54
|
-
|
|
55
52
|
select_options.value = props.options.filter(v => v[props.optionLabel].toLowerCase().indexOf(needle) > -1);
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
53
|
})
|
|
61
54
|
}
|
|
62
55
|
|
|
63
56
|
|
|
64
|
-
const localLabel = computed(() => {
|
|
65
|
-
return t(props.label);
|
|
66
|
-
});
|
|
67
57
|
|
|
68
58
|
const clearable = computed(() => {
|
|
69
59
|
return !props.required;
|
|
70
60
|
});
|
|
71
61
|
|
|
62
|
+
const attrs = {
|
|
63
|
+
...{
|
|
64
|
+
filled: light.getStyle("inputFilled", false),
|
|
65
|
+
outlined: light.getStyle("inputOutlined", true),
|
|
66
|
+
standout: light.getStyle("inputStandout", false),
|
|
67
|
+
rounded: light.getStyle("inputRounded", false),
|
|
68
|
+
dense: light.getStyle("inputDense", false),
|
|
69
|
+
square: light.getStyle("inputSquare", false),
|
|
70
|
+
stackLabel: light.getStyle("inputStackLabel", false)
|
|
71
|
+
},
|
|
72
|
+
...useAttrs(),
|
|
73
|
+
}
|
|
74
|
+
|
|
72
75
|
</script>
|
|
73
76
|
<template>
|
|
74
|
-
<q-select :label="
|
|
77
|
+
<q-select v-bind="attrs" :label="$t(label)" emit-value map-options :options="select_options" @filter="filterFn"
|
|
75
78
|
:option-label="optionLabel" hide-bottom-space :rules="rules" :clearable="clearable" />
|
|
76
79
|
</template>
|
|
@@ -10,7 +10,7 @@ const errors = ref<InstanceType<any>>([]);
|
|
|
10
10
|
|
|
11
11
|
const light = useLight();
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
|
|
14
14
|
|
|
15
15
|
const props = defineProps({
|
|
16
16
|
columns: {
|
|
@@ -337,7 +337,10 @@ const onDelete = async (id: any) => {
|
|
|
337
337
|
|
|
338
338
|
|
|
339
339
|
|
|
340
|
-
|
|
340
|
+
//style
|
|
341
|
+
const dense = light.getStyle("tableDense", false);
|
|
342
|
+
const flat = light.getStyle("tableFlat", true);
|
|
343
|
+
const bordered = light.getStyle("tableBorder", true);
|
|
341
344
|
</script>
|
|
342
345
|
<template>
|
|
343
346
|
<template v-if="errors.length > 0">
|
|
@@ -347,8 +350,8 @@ const onDelete = async (id: any) => {
|
|
|
347
350
|
</ul>
|
|
348
351
|
</div>
|
|
349
352
|
</template>
|
|
350
|
-
<q-table flat bordered :dense="
|
|
351
|
-
:loading="loading" @request="onRequest" :selection="selection" :rows="rows"
|
|
353
|
+
<q-table :flat="flat" :bordered="bordered" :dense="dense" :columns="renderColumns" v-model:pagination="pagination"
|
|
354
|
+
ref="table" :loading="loading" @request="onRequest" :selection="selection" :rows="rows"
|
|
352
355
|
:rows-per-page-label="t(props.rowsPerPageLabel)">
|
|
353
356
|
|
|
354
357
|
<template v-for="s in ss" v-slot:[s]="props">
|
package/dist/runtime/index.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ interface Light {
|
|
|
2
2
|
addError: (error: String) => void;
|
|
3
3
|
getErrors: () => String[];
|
|
4
4
|
removeError: (error: String) => void;
|
|
5
|
-
getStyle: (name: String) => any;
|
|
5
|
+
getStyle: (name: String, defaultValue: any) => any;
|
|
6
6
|
setStyles: (styles: Object) => void;
|
|
7
7
|
getVersion(): string;
|
|
8
8
|
}
|
package/dist/runtime/index.mjs
CHANGED
|
@@ -147,5 +147,9 @@
|
|
|
147
147
|
"Server": "伺服器",
|
|
148
148
|
"Remove": "移除",
|
|
149
149
|
"Records per page:": "每頁顯示:",
|
|
150
|
-
"storage_usage": "剩餘 {0}, 共 {1}"
|
|
150
|
+
"storage_usage": "剩餘 {0}, 共 {1}",
|
|
151
|
+
"Login": "登入",
|
|
152
|
+
"Forget password": "忘記密碼",
|
|
153
|
+
"Password is required": "密碼為必填",
|
|
154
|
+
"Username is required": "使用者名稱為必填"
|
|
151
155
|
}
|
|
@@ -219,12 +219,12 @@ const onAddChildMenu = (node, type) => {
|
|
|
219
219
|
<l-card>
|
|
220
220
|
<q-splitter v-model="splitterModel" style="height:680px">
|
|
221
221
|
<template #before>
|
|
222
|
-
<q-card-
|
|
222
|
+
<q-card-actions>
|
|
223
223
|
<l-btn @click="onAdd" label="Add" icon="sym_o_add" />
|
|
224
224
|
<l-btn @click="onReload" label="Reload" icon="sym_o_refresh" />
|
|
225
225
|
|
|
226
226
|
<l-btn @click="onSave" label="Save" icon="sym_o_save" />
|
|
227
|
-
</q-card-
|
|
227
|
+
</q-card-actions>
|
|
228
228
|
|
|
229
229
|
<q-tree :nodes="menus" selected-color="primary" default-expand-all v-model:selected="selected"
|
|
230
230
|
node-key="uuid" ref="tree1" />
|
|
@@ -232,9 +232,10 @@ const onAddChildMenu = (node, type) => {
|
|
|
232
232
|
|
|
233
233
|
<template #after v-if="selected">
|
|
234
234
|
|
|
235
|
-
<q-card-
|
|
235
|
+
<q-card-actions>
|
|
236
236
|
<l-btn outline rounded color="primary" @click="onRemove(selectedNode)" label="Remove"
|
|
237
237
|
icon="sym_o_remove" />
|
|
238
|
+
|
|
238
239
|
<l-btn outline rounded color="primary" @click="onAddChild(selectedNode)" label="Add Child"
|
|
239
240
|
icon="sym_o_add" />
|
|
240
241
|
|
|
@@ -266,18 +267,17 @@ const onAddChildMenu = (node, type) => {
|
|
|
266
267
|
</q-btn-dropdown>
|
|
267
268
|
|
|
268
269
|
|
|
269
|
-
</q-card-
|
|
270
|
+
</q-card-actions>
|
|
270
271
|
|
|
271
272
|
|
|
272
273
|
<q-card-section>
|
|
273
|
-
<q-
|
|
274
|
+
<div class="q-gutter-md">
|
|
274
275
|
<l-input label="Label" v-model="selectedNode.label" />
|
|
275
276
|
<l-input label="To" v-model="selectedNode.to" />
|
|
276
|
-
<l-input label="Icon" v-model="selectedNode.icon" />
|
|
277
|
+
<l-input label="Icon" v-model="selectedNode.icon" hint="example: sym_o_add"/>
|
|
277
278
|
<l-input label="Permission" v-model="selectedNode.permission" />
|
|
278
279
|
<l-input label="UUID" v-model="selectedNode.uuid" readonly />
|
|
279
|
-
|
|
280
|
-
</q-form>
|
|
280
|
+
</div>
|
|
281
281
|
</q-card-section>
|
|
282
282
|
</template>
|
|
283
283
|
|
|
@@ -8,20 +8,20 @@ const obj = reactive(await getObject(["first_name", "last_name", "email", "phone
|
|
|
8
8
|
|
|
9
9
|
<template>
|
|
10
10
|
<l-page>
|
|
11
|
-
<l-form v-model="obj">
|
|
11
|
+
<l-form v-model="obj" gutter="none">
|
|
12
12
|
<l-row>
|
|
13
|
-
<l-col md="6">
|
|
13
|
+
<l-col md="6" gutter="md">
|
|
14
14
|
<l-input label="First name" v-model="obj.first_name" required />
|
|
15
15
|
<l-input label="Last name" v-model="obj.last_name" />
|
|
16
16
|
<l-input label="Email" v-model="obj.email" required type="email" />
|
|
17
17
|
</l-col>
|
|
18
|
-
<l-col md="6">
|
|
18
|
+
<l-col md="6" gutter="md">
|
|
19
19
|
<l-input label="Phone" v-model="obj.phone" />
|
|
20
20
|
<l-input label="Address1" v-model="obj.addr1" />
|
|
21
21
|
<l-input label="Address2" v-model="obj.addr2" />
|
|
22
22
|
<l-input label="Address3" v-model="obj.addr3" />
|
|
23
23
|
</l-col>
|
|
24
|
-
<l-col>
|
|
24
|
+
<l-col gutter="md">
|
|
25
25
|
<l-date-picker label="Join date" v-model="obj.join_date" required />
|
|
26
26
|
<l-date-picker label="Expiry date" v-model="obj.expiry_date" />
|
|
27
27
|
|
|
@@ -40,12 +40,7 @@ const obj = reactive(await getObject(["first_name", "last_name", "email", "phone
|
|
|
40
40
|
|
|
41
41
|
|
|
42
42
|
</l-col>
|
|
43
|
-
|
|
44
|
-
|
|
45
43
|
</l-row>
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
44
|
</l-form>
|
|
50
45
|
</l-page>
|
|
51
46
|
</template>
|
|
@@ -21,23 +21,22 @@ roles = roles.map((role) => {
|
|
|
21
21
|
</script>
|
|
22
22
|
<template>
|
|
23
23
|
<l-page>
|
|
24
|
-
<l-form v-model="obj">
|
|
24
|
+
<l-form v-model="obj" gutter="none">
|
|
25
25
|
<l-row>
|
|
26
|
-
<l-col md="6">
|
|
26
|
+
<l-col md="6" gutter="md">
|
|
27
27
|
<l-input label="Username" v-model="obj.username" required />
|
|
28
28
|
<l-input label="Password" v-model="obj.password" required type="password" />
|
|
29
29
|
<l-input label="First name" v-model="obj.first_name" required />
|
|
30
30
|
<l-input label="Last name" v-model="obj.last_name" />
|
|
31
31
|
<l-input label="Email" v-model="obj.email" required type="email" />
|
|
32
|
-
|
|
33
32
|
</l-col>
|
|
34
|
-
<l-col md="6">
|
|
33
|
+
<l-col md="6" gutter="md">
|
|
35
34
|
<l-input label="Phone" v-model="obj.phone" />
|
|
36
35
|
<l-input label="Address1" v-model="obj.addr1" />
|
|
37
36
|
<l-input label="Address2" v-model="obj.addr2" />
|
|
38
37
|
<l-input label="Address3" v-model="obj.addr3" />
|
|
39
38
|
</l-col>
|
|
40
|
-
<l-col>
|
|
39
|
+
<l-col gutter="md">
|
|
41
40
|
<l-date-picker label="Join date" v-model="obj.join_date" required />
|
|
42
41
|
<l-date-picker label="Expiry date" v-model="obj.expiry_date" />
|
|
43
42
|
|
|
@@ -63,14 +62,8 @@ roles = roles.map((role) => {
|
|
|
63
62
|
<q-option-group type="checkbox" :options="roles" v-model="obj.roles" inline>
|
|
64
63
|
</q-option-group>
|
|
65
64
|
</q-field>
|
|
66
|
-
|
|
67
65
|
</l-col>
|
|
68
|
-
|
|
69
|
-
|
|
70
66
|
</l-row>
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
67
|
</l-form>
|
|
75
68
|
</l-page>
|
|
76
69
|
</template>
|
|
@@ -27,8 +27,7 @@ const save = async () => {
|
|
|
27
27
|
<l-form @save="save" :bordered="false">
|
|
28
28
|
<l-input label="Username" v-model="obj.username" readonly></l-input>
|
|
29
29
|
<l-input label="Email" v-model="obj.email" required></l-input>
|
|
30
|
-
<l-input label="First
|
|
31
|
-
<l-input label="Last
|
|
32
|
-
|
|
30
|
+
<l-input label="First name" v-model="obj.first_name" required></l-input>
|
|
31
|
+
<l-input label="Last name" v-model="obj.last_name"></l-input>
|
|
33
32
|
</l-form>
|
|
34
33
|
</template>
|
|
@@ -4,18 +4,131 @@ import { reactive } from 'vue'
|
|
|
4
4
|
let my = await q("my", ["styles"]);
|
|
5
5
|
|
|
6
6
|
const styles = reactive({
|
|
7
|
-
|
|
7
|
+
|
|
8
|
+
tableDense: my.styles.tableDense === undefined ? false : my.styles.tableDense,
|
|
9
|
+
tableFlat: my.styles.tableFlat === undefined ? true : my.styles.tableFlat,
|
|
10
|
+
tableBorder: my.styles.tableBorder === undefined ? true : my.styles.tableBorder,
|
|
11
|
+
|
|
12
|
+
cardFlat: my.styles.cardFlat === undefined ? true : my.styles.cardFlat,
|
|
13
|
+
cardBordered: my.styles.cardBordered === undefined ? true : my.styles.cardBordered,
|
|
14
|
+
cardSquare: my.styles.cardSquare === undefined ? false : my.styles.cardSquare,
|
|
15
|
+
|
|
16
|
+
buttonOutline: my.styles.buttonOutline === undefined ? true : my.styles.buttonOutline,
|
|
17
|
+
buttonRounded: my.styles.buttonRounded === undefined ? true : my.styles.buttonRounded,
|
|
18
|
+
buttonUnelevated: my.styles.buttonUnelevated === undefined ? false : my.styles.buttonUnelevated,
|
|
19
|
+
buttonDense: my.styles.buttonDense === undefined ? false : my.styles.buttonDense,
|
|
20
|
+
|
|
21
|
+
inputFilled: my.styles.inputFilled === undefined ? false : my.styles.inputFilled,
|
|
22
|
+
inputOutlined: my.styles.inputOutlined === undefined ? false : my.styles.inputOutlined,
|
|
23
|
+
inputStandout: my.styles.inputStandout === undefined ? false : my.styles.inputStandout,
|
|
24
|
+
inputRounded: my.styles.inputRounded === undefined ? false : my.styles.inputRounded,
|
|
25
|
+
inputDense: my.styles.inputDense === undefined ? false : my.styles.inputDense,
|
|
26
|
+
inputSquare: my.styles.inputSquare === undefined ? false : my.styles.inputSquare,
|
|
27
|
+
inputStackLabel: my.styles.inputStackLabel === undefined ? false : my.styles.inputStackLabel,
|
|
28
|
+
|
|
8
29
|
})
|
|
9
30
|
|
|
10
31
|
const onSave = async () => {
|
|
11
|
-
await m("
|
|
12
|
-
|
|
13
|
-
value: styles.tableDense
|
|
32
|
+
await m("updateMyStyles", {
|
|
33
|
+
value: styles
|
|
14
34
|
});
|
|
35
|
+
|
|
36
|
+
//reload
|
|
37
|
+
window.location.reload();
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
const setDefault = async () => {
|
|
41
|
+
|
|
42
|
+
styles.tableDense = false;
|
|
43
|
+
styles.tableFlat = true;
|
|
44
|
+
styles.tableBorder = true;
|
|
45
|
+
|
|
46
|
+
styles.cardFlat = true;
|
|
47
|
+
styles.cardBordered = true;
|
|
48
|
+
styles.cardSquare = false;
|
|
49
|
+
|
|
50
|
+
styles.buttonOutline = true;
|
|
51
|
+
styles.buttonRounded = true;
|
|
52
|
+
styles.buttonUnelevated = false;
|
|
53
|
+
styles.buttonDense = false;
|
|
54
|
+
|
|
55
|
+
styles.inputFilled = false;
|
|
56
|
+
styles.inputOutlined = false;
|
|
57
|
+
styles.inputStandout = false;
|
|
58
|
+
styles.inputRounded = false;
|
|
59
|
+
styles.inputDense = false;
|
|
60
|
+
styles.inputSquare = false;
|
|
61
|
+
styles.inputStackLabel = false;
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
|
|
15
65
|
}
|
|
16
66
|
</script>
|
|
17
67
|
<template>
|
|
18
68
|
<l-form @save="onSave" :bordered="false">
|
|
19
|
-
<
|
|
69
|
+
<div>
|
|
70
|
+
<q-checkbox v-model="styles.tableDense" label="Table dense" />
|
|
71
|
+
<q-checkbox v-model="styles.tableFlat" label="Table flat" />
|
|
72
|
+
<q-checkbox v-model="styles.tableBorder" label="Table bordered" />
|
|
73
|
+
|
|
74
|
+
</div>
|
|
75
|
+
|
|
76
|
+
<div>
|
|
77
|
+
<q-checkbox v-model="styles.cardFlat" label="Card flat" />
|
|
78
|
+
<q-checkbox v-model="styles.cardBordered" label="Card bordered" />
|
|
79
|
+
<q-checkbox v-model="styles.cardSquare" label="Card square" />
|
|
80
|
+
|
|
81
|
+
</div>
|
|
82
|
+
|
|
83
|
+
<div>
|
|
84
|
+
<q-checkbox v-model="styles.buttonOutline" label="Button outline" />
|
|
85
|
+
<q-checkbox v-model="styles.buttonRounded" label="Button rounded" />
|
|
86
|
+
<q-checkbox v-model="styles.buttonUnelevated" label="Button unelevated" />
|
|
87
|
+
<q-checkbox v-model="styles.buttonDense" label="Button dense" />
|
|
88
|
+
|
|
89
|
+
</div>
|
|
90
|
+
|
|
91
|
+
<div>
|
|
92
|
+
<q-checkbox v-model="styles.inputFilled" label="Input filled" />
|
|
93
|
+
<q-checkbox v-model="styles.inputOutlined" label="Input outlined" />
|
|
94
|
+
<q-checkbox v-model="styles.inputStandout" label="Input standout" />
|
|
95
|
+
<q-checkbox v-model="styles.inputRounded" label="Input rounded" />
|
|
96
|
+
<q-checkbox v-model="styles.inputDense" label="Input dense" />
|
|
97
|
+
<q-checkbox v-model="styles.inputSquare" label="Input square" />
|
|
98
|
+
<q-checkbox v-model="styles.inputStackLabel" label="Input stack label" />
|
|
99
|
+
|
|
100
|
+
|
|
101
|
+
</div>
|
|
102
|
+
|
|
103
|
+
<l-btn @click="setDefault()" icon="sym_o_refresh" label="Default"></l-btn>
|
|
104
|
+
|
|
105
|
+
|
|
106
|
+
<q-card bordered flat>
|
|
107
|
+
<q-card-section>
|
|
108
|
+
<div>
|
|
109
|
+
UI preview
|
|
110
|
+
<div class="q-gutter-md q-mt-md">
|
|
111
|
+
|
|
112
|
+
<q-btn color="primary" icon="sym_o_person" label="Button" :outline="styles.buttonOutline"
|
|
113
|
+
:rounded="styles.buttonRounded" :unelevated="styles.buttonUnelevated"
|
|
114
|
+
:dense="styles.buttonDense"></q-btn>
|
|
115
|
+
|
|
116
|
+
<q-input label="Input" :filled="styles.inputFilled" :outlined="styles.inputOutlined"
|
|
117
|
+
:standout="styles.inputStandout" :rounded="styles.inputRounded" :dense="styles.inputDense"
|
|
118
|
+
:square="styles.inputSquare" :stack-label="styles.inputStackLabel">
|
|
119
|
+
></q-input>
|
|
120
|
+
|
|
121
|
+
|
|
122
|
+
</div>
|
|
123
|
+
|
|
124
|
+
|
|
125
|
+
|
|
126
|
+
|
|
127
|
+
|
|
128
|
+
</div>
|
|
129
|
+
</q-card-section>
|
|
130
|
+
|
|
131
|
+
</q-card>
|
|
132
|
+
|
|
20
133
|
</l-form>
|
|
21
134
|
</template>
|