@hostlink/nuxt-light 1.25.2 → 1.26.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/MyTest.vue +10 -0
- package/dist/runtime/components/l-table.vue +12 -3
- package/dist/runtime/lib/defineLightModel.d.ts +3 -0
- package/dist/runtime/pages/User/index.vue +1 -0
- package/dist/runtime/types/User.d.ts +7 -8
- package/dist/runtime/types/User.js +10 -12
- package/package.json +1 -1
package/dist/module.json
CHANGED
|
@@ -354,7 +354,7 @@ const onLocalRequest = async (p: any) => {
|
|
|
354
354
|
color: "negative"
|
|
355
355
|
})
|
|
356
356
|
this.setData({ data: [], meta: { total: 0, key: "", name: "" } });
|
|
357
|
-
|
|
357
|
+
|
|
358
358
|
}
|
|
359
359
|
}
|
|
360
360
|
}
|
|
@@ -550,7 +550,8 @@ const onAdd = () => {
|
|
|
550
550
|
v-model:minimized="minimized" v-model:maximized="maximized">
|
|
551
551
|
|
|
552
552
|
<q-toolbar v-if="addComponent">
|
|
553
|
-
<q-btn icon="sym_o_add" :label="$t('Add')" :color="$light.color" @click="onAdd" v-if="addComponent"
|
|
553
|
+
<q-btn icon="sym_o_add" :label="$t('Add')" :color="$light.color" @click="onAdd" v-if="addComponent"
|
|
554
|
+
outline />
|
|
554
555
|
</q-toolbar>
|
|
555
556
|
|
|
556
557
|
|
|
@@ -617,7 +618,15 @@ const onAdd = () => {
|
|
|
617
618
|
:style="getCellStyle(col, props.row)" :class="getCellClass(col, props.row)"><template
|
|
618
619
|
v-if="col.to" class="bg-primary">
|
|
619
620
|
<l-link :to="col.to(props.row)">{{ col.value }}</l-link>
|
|
620
|
-
</template
|
|
621
|
+
</template>
|
|
622
|
+
<template v-else-if="col.component">
|
|
623
|
+
<component :is="col.component" v-model="props.row"
|
|
624
|
+
v-bind="col.componentProps ? col.componentProps(props.row) : null" />
|
|
625
|
+
</template>
|
|
626
|
+
<template v-else>
|
|
627
|
+
{{ col.value }}
|
|
628
|
+
</template>
|
|
629
|
+
</q-td>
|
|
621
630
|
</template>
|
|
622
631
|
</template>
|
|
623
632
|
</q-tr>
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { Component } from "vue";
|
|
1
2
|
export interface LightModelGqlField {
|
|
2
3
|
[key: string]: string | LightModelGqlField | boolean;
|
|
3
4
|
}
|
|
@@ -11,6 +12,8 @@ export interface LightModelField {
|
|
|
11
12
|
gqlField?: LightModelGqlField;
|
|
12
13
|
to?: (row: any) => string;
|
|
13
14
|
field?: (row: any) => string;
|
|
15
|
+
component?: Component;
|
|
16
|
+
componentProps?: any;
|
|
14
17
|
}
|
|
15
18
|
export interface LightModelFields {
|
|
16
19
|
[key: string]: LightModelField;
|
|
@@ -44,18 +44,17 @@ declare const _default: {
|
|
|
44
44
|
}[];
|
|
45
45
|
format: (value: any) => string;
|
|
46
46
|
};
|
|
47
|
-
test: {
|
|
48
|
-
label: string;
|
|
49
|
-
name: string;
|
|
50
|
-
to: (row: any) => string;
|
|
51
|
-
gqlField: string[];
|
|
52
|
-
field: (row: any) => any;
|
|
53
|
-
backgroundColor: (row: any) => "primary" | undefined;
|
|
54
|
-
};
|
|
55
47
|
has2FA: {
|
|
56
48
|
label: string;
|
|
57
49
|
searchType: string;
|
|
58
50
|
format: (value: any) => "Yes" | "No";
|
|
59
51
|
};
|
|
52
|
+
_test: {
|
|
53
|
+
label: string;
|
|
54
|
+
component: any;
|
|
55
|
+
componentProps: (a: any) => {
|
|
56
|
+
test: any;
|
|
57
|
+
};
|
|
58
|
+
};
|
|
60
59
|
};
|
|
61
60
|
export default _default;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import MyTest from "../components/MyTest.vue";
|
|
1
2
|
export default {
|
|
2
3
|
username: {
|
|
3
4
|
label: "Username",
|
|
@@ -56,23 +57,20 @@ export default {
|
|
|
56
57
|
return ["Active", "Inactive"][value];
|
|
57
58
|
}
|
|
58
59
|
},
|
|
59
|
-
test: {
|
|
60
|
-
label: "Test",
|
|
61
|
-
name: "_test",
|
|
62
|
-
to: (row) => `/User/${row.user_id}/view`,
|
|
63
|
-
gqlField: ["user_id", "first_name"],
|
|
64
|
-
field: (row) => row.first_name,
|
|
65
|
-
backgroundColor: (row) => {
|
|
66
|
-
if (row.username == "admin") {
|
|
67
|
-
return "primary";
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
},
|
|
71
60
|
has2FA: {
|
|
72
61
|
label: "2FA",
|
|
73
62
|
searchType: "select",
|
|
74
63
|
format: (value) => {
|
|
75
64
|
return value ? "Yes" : "No";
|
|
76
65
|
}
|
|
66
|
+
},
|
|
67
|
+
_test: {
|
|
68
|
+
label: "Test",
|
|
69
|
+
component: MyTest,
|
|
70
|
+
componentProps: (a) => {
|
|
71
|
+
return {
|
|
72
|
+
test: a.username
|
|
73
|
+
};
|
|
74
|
+
}
|
|
77
75
|
}
|
|
78
76
|
};
|