v-nuxt-ui 0.1.18 → 0.1.19

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.
Files changed (51) hide show
  1. package/dist/module.json +1 -1
  2. package/dist/runtime/components/layout/Login.d.vue.ts +20 -0
  3. package/dist/runtime/components/layout/Login.vue +36 -0
  4. package/dist/runtime/components/layout/Login.vue.d.ts +20 -0
  5. package/dist/runtime/components/layout/default.vue +3 -3
  6. package/dist/runtime/components/sys/company/CreateModal.d.vue.ts +13 -0
  7. package/dist/runtime/components/sys/company/CreateModal.vue +23 -0
  8. package/dist/runtime/components/sys/company/CreateModal.vue.d.ts +13 -0
  9. package/dist/runtime/components/sys/company/Table.d.vue.ts +3 -0
  10. package/dist/runtime/components/sys/company/Table.vue +53 -0
  11. package/dist/runtime/components/sys/company/Table.vue.d.ts +3 -0
  12. package/dist/runtime/components/sys/department/CreateModal.d.vue.ts +13 -0
  13. package/dist/runtime/components/sys/department/CreateModal.vue +77 -0
  14. package/dist/runtime/components/sys/department/CreateModal.vue.d.ts +13 -0
  15. package/dist/runtime/components/sys/department/Table.d.vue.ts +3 -0
  16. package/dist/runtime/components/sys/department/Table.vue +61 -0
  17. package/dist/runtime/components/sys/department/Table.vue.d.ts +3 -0
  18. package/dist/runtime/components/sys/job-title/CreateModal.d.vue.ts +13 -0
  19. package/dist/runtime/components/sys/job-title/CreateModal.vue +26 -0
  20. package/dist/runtime/components/sys/job-title/CreateModal.vue.d.ts +13 -0
  21. package/dist/runtime/components/sys/job-title/Table.d.vue.ts +3 -0
  22. package/dist/runtime/components/sys/job-title/Table.vue +67 -0
  23. package/dist/runtime/components/sys/job-title/Table.vue.d.ts +3 -0
  24. package/dist/runtime/components/sys/menu/CreateModal.d.vue.ts +13 -0
  25. package/dist/runtime/components/sys/menu/CreateModal.vue +58 -0
  26. package/dist/runtime/components/sys/menu/CreateModal.vue.d.ts +13 -0
  27. package/dist/runtime/components/sys/menu/Table.d.vue.ts +3 -0
  28. package/dist/runtime/components/sys/menu/Table.vue +96 -0
  29. package/dist/runtime/components/sys/menu/Table.vue.d.ts +3 -0
  30. package/dist/runtime/components/sys/role/CreateModal.d.vue.ts +13 -0
  31. package/dist/runtime/components/sys/role/CreateModal.vue +86 -0
  32. package/dist/runtime/components/sys/role/CreateModal.vue.d.ts +13 -0
  33. package/dist/runtime/components/sys/role/Table.d.vue.ts +3 -0
  34. package/dist/runtime/components/sys/role/Table.vue +68 -0
  35. package/dist/runtime/components/sys/role/Table.vue.d.ts +3 -0
  36. package/dist/runtime/components/sys/user/CreateModal.d.vue.ts +13 -0
  37. package/dist/runtime/components/sys/user/CreateModal.vue +179 -0
  38. package/dist/runtime/components/sys/user/CreateModal.vue.d.ts +13 -0
  39. package/dist/runtime/components/sys/user/Table.d.vue.ts +3 -0
  40. package/dist/runtime/components/sys/user/Table.vue +168 -0
  41. package/dist/runtime/components/sys/user/Table.vue.d.ts +3 -0
  42. package/package.json +1 -1
  43. /package/dist/runtime/components/layout/{ModuleMenu.d.vue.ts → button/ModuleMenu.d.vue.ts} +0 -0
  44. /package/dist/runtime/components/layout/{ModuleMenu.vue → button/ModuleMenu.vue} +0 -0
  45. /package/dist/runtime/components/layout/{ModuleMenu.vue.d.ts → button/ModuleMenu.vue.d.ts} +0 -0
  46. /package/dist/runtime/components/layout/{ThemePicker.d.vue.ts → button/ThemePicker.d.vue.ts} +0 -0
  47. /package/dist/runtime/components/layout/{ThemePicker.vue → button/ThemePicker.vue} +0 -0
  48. /package/dist/runtime/components/layout/{ThemePicker.vue.d.ts → button/ThemePicker.vue.d.ts} +0 -0
  49. /package/dist/runtime/components/layout/{UserMenu.d.vue.ts → button/UserMenu.d.vue.ts} +0 -0
  50. /package/dist/runtime/components/layout/{UserMenu.vue → button/UserMenu.vue} +0 -0
  51. /package/dist/runtime/components/layout/{UserMenu.vue.d.ts → button/UserMenu.vue.d.ts} +0 -0
package/dist/module.json CHANGED
@@ -7,7 +7,7 @@
7
7
  "dependencies": [
8
8
  "@nuxt/ui"
9
9
  ],
10
- "version": "0.1.18",
10
+ "version": "0.1.19",
11
11
  "builder": {
12
12
  "@nuxt/module-builder": "1.0.2",
13
13
  "unbuild": "3.6.1"
@@ -0,0 +1,20 @@
1
+ type __VLS_Props = {
2
+ title: string;
3
+ backgroundImage: string;
4
+ backgroundImageClass?: string;
5
+ logo: string;
6
+ logoClass?: string;
7
+ };
8
+ declare var __VLS_8: {};
9
+ type __VLS_Slots = {} & {
10
+ default?: (props: typeof __VLS_8) => any;
11
+ };
12
+ declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
13
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
14
+ declare const _default: typeof __VLS_export;
15
+ export default _default;
16
+ type __VLS_WithSlots<T, S> = T & {
17
+ new (): {
18
+ $slots: S;
19
+ };
20
+ };
@@ -0,0 +1,36 @@
1
+ <script setup>
2
+ defineProps({
3
+ title: { type: String, required: true },
4
+ backgroundImage: { type: String, required: true },
5
+ backgroundImageClass: { type: String, required: false },
6
+ logo: { type: String, required: true },
7
+ logoClass: { type: String, required: false }
8
+ });
9
+ </script>
10
+
11
+ <template>
12
+ <div class="fixed inset-0 flex flex-col items-center justify-center px-3">
13
+ <img
14
+ :src="backgroundImage"
15
+ alt="Veken Building"
16
+ class="absolute w-screen h-screen object-cover object-left opacity-8"
17
+ :class="backgroundImageClass"
18
+ >
19
+ <UCard class="w-full max-w-md z-10">
20
+ <template #header>
21
+ <div class="flex flex-wrap gap-3 items-center justify-between">
22
+ <img
23
+ :src="logo"
24
+ alt="Veken Logo"
25
+ class="h-9"
26
+ :class="logoClass"
27
+ >
28
+ <div class="font-bold text-lg">
29
+ {{ title }}
30
+ </div>
31
+ </div>
32
+ </template>
33
+ <slot />
34
+ </UCard>
35
+ </div>
36
+ </template>
@@ -0,0 +1,20 @@
1
+ type __VLS_Props = {
2
+ title: string;
3
+ backgroundImage: string;
4
+ backgroundImageClass?: string;
5
+ logo: string;
6
+ logoClass?: string;
7
+ };
8
+ declare var __VLS_8: {};
9
+ type __VLS_Slots = {} & {
10
+ default?: (props: typeof __VLS_8) => any;
11
+ };
12
+ declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
13
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
14
+ declare const _default: typeof __VLS_export;
15
+ export default _default;
16
+ type __VLS_WithSlots<T, S> = T & {
17
+ new (): {
18
+ $slots: S;
19
+ };
20
+ };
@@ -6,9 +6,9 @@ import UDashboardGroup from "@nuxt/ui/components/DashboardGroup.vue";
6
6
  import UDashboardSidebar from "@nuxt/ui/components/DashboardSidebar.vue";
7
7
  import UNavigationMenu from "@nuxt/ui/components/NavigationMenu.vue";
8
8
  import ScrollArea from "#v/components/ScrollArea.vue";
9
- import LayoutModuleMenu from "#v/components/layout/ModuleMenu.vue";
10
- import LayoutThemePicker from "#v/components/layout/ThemePicker.vue";
11
- import LayoutUserMenu from "#v/components/layout/UserMenu.vue";
9
+ import LayoutModuleMenu from "#v/components/layout/button/ModuleMenu.vue";
10
+ import LayoutThemePicker from "#v/components/layout/button/ThemePicker.vue";
11
+ import LayoutUserMenu from "#v/components/layout/button/UserMenu.vue";
12
12
  import Watermark from "#v/components/Watermark.vue";
13
13
  import { ref, watch } from "vue";
14
14
  const open = ref(false);
@@ -0,0 +1,13 @@
1
+ import type { Company } from 'v-nuxt-ui/types';
2
+ type __VLS_Props = {
3
+ model: Company;
4
+ };
5
+ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
6
+ close: (args_0: boolean) => any;
7
+ save: (args_0: Company) => any;
8
+ }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
9
+ onClose?: ((args_0: boolean) => any) | undefined;
10
+ onSave?: ((args_0: Company) => any) | undefined;
11
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
12
+ declare const _default: typeof __VLS_export;
13
+ export default _default;
@@ -0,0 +1,23 @@
1
+ <script setup>
2
+ import * as z from "zod";
3
+ import FormCreateModalTemplateWithApi from "#v/components/form/create-modal-template/WithApi.vue";
4
+ import { useCompanyApi } from "#v/composables";
5
+ defineProps({
6
+ model: { type: null, required: true }
7
+ });
8
+ const emit = defineEmits(["close", "save"]);
9
+ </script>
10
+
11
+ <template>
12
+ <FormCreateModalTemplateWithApi
13
+ title="公司信息"
14
+ :on-close="(ok) => emit('close', ok)"
15
+ :on-save="(model) => emit('save', model)"
16
+ :fields="[
17
+ { name: 'fullname', type: 'input', label: '\u516C\u53F8\u5168\u79F0', colSpan: '24', zodType: z.string().min(2, '\u540D\u79F0\u5B57\u6570\u4E0D\u8DB3') },
18
+ { name: 'nickname', type: 'input', label: '\u516C\u53F8\u7B80\u79F0', colSpan: '24', zodType: z.string().min(2, '\u540D\u79F0\u5B57\u6570\u4E0D\u8DB3') }
19
+ ]"
20
+ :model-value="model"
21
+ :api-group="useCompanyApi"
22
+ />
23
+ </template>
@@ -0,0 +1,13 @@
1
+ import type { Company } from 'v-nuxt-ui/types';
2
+ type __VLS_Props = {
3
+ model: Company;
4
+ };
5
+ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
6
+ close: (args_0: boolean) => any;
7
+ save: (args_0: Company) => any;
8
+ }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
9
+ onClose?: ((args_0: boolean) => any) | undefined;
10
+ onSave?: ((args_0: Company) => any) | undefined;
11
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
12
+ declare const _default: typeof __VLS_export;
13
+ export default _default;
@@ -0,0 +1,3 @@
1
+ declare const __VLS_export: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
2
+ declare const _default: typeof __VLS_export;
3
+ export default _default;
@@ -0,0 +1,53 @@
1
+ <script setup>
2
+ import { useOverlay } from "@nuxt/ui/composables";
3
+ import { useCompanyApi } from "#v/composables";
4
+ import SysCompaniesCreateModal from "./CreateModal.vue";
5
+ import { getOprColumns } from "#v/constants";
6
+ import TablePage from "#v/components/table/Page.vue";
7
+ const overlay = useOverlay();
8
+ const createModal = overlay.create(SysCompaniesCreateModal);
9
+ const columns = [
10
+ {
11
+ accessorKey: "fullname",
12
+ header: "\u516C\u53F8\u5168\u79F0",
13
+ meta: {
14
+ class: {
15
+ td: "w-300"
16
+ }
17
+ },
18
+ sortOption: true,
19
+ filterOption: {
20
+ type: "input",
21
+ initHide: false
22
+ }
23
+ },
24
+ {
25
+ accessorKey: "nickname",
26
+ header: "\u516C\u53F8\u7B80\u79F0",
27
+ meta: {
28
+ class: {
29
+ td: "w-300"
30
+ }
31
+ },
32
+ sortOption: true,
33
+ filterOption: {
34
+ type: "input",
35
+ initHide: false
36
+ }
37
+ },
38
+ ...getOprColumns()
39
+ ];
40
+ </script>
41
+
42
+ <template>
43
+ <TablePage
44
+ name="sys-company"
45
+ cn-name="公司信息"
46
+ :use-api-group="useCompanyApi"
47
+ :biz-columns="columns"
48
+ :extra-order-query-options="[
49
+ { field: 'createdAt', label: '\u521B\u5EFA\u65F6\u95F4', defaultOpr: 'desc' }
50
+ ]"
51
+ @edit-row-from-modal="async (row) => await createModal.open({ model: row }).result"
52
+ />
53
+ </template>
@@ -0,0 +1,3 @@
1
+ declare const __VLS_export: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
2
+ declare const _default: typeof __VLS_export;
3
+ export default _default;
@@ -0,0 +1,13 @@
1
+ import type { Department } from 'v-nuxt-ui/types';
2
+ type __VLS_Props = {
3
+ model: Department;
4
+ };
5
+ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
6
+ close: (args_0: boolean) => any;
7
+ save: (args_0: Department) => any;
8
+ }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
9
+ onClose?: ((args_0: boolean) => any) | undefined;
10
+ onSave?: ((args_0: Department) => any) | undefined;
11
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
12
+ declare const _default: typeof __VLS_export;
13
+ export default _default;
@@ -0,0 +1,77 @@
1
+ <script setup>
2
+ import * as z from "zod";
3
+ import FormCreateModalTemplate from "#v/components/form/create-modal-template/index.vue";
4
+ import { useCompanyApi, useDepartmentApi, useFormSubmission, useFormValues, useUserApi } from "#v/composables";
5
+ import { toRef, watch } from "vue";
6
+ const props = defineProps({
7
+ model: { type: null, required: true }
8
+ });
9
+ const emit = defineEmits(["close", "save"]);
10
+ const { oldValues, newValues } = useFormValues(toRef(props.model), { id: 0 });
11
+ watch(
12
+ () => newValues.value.parentId,
13
+ () => {
14
+ if (!newValues.value.companyId) {
15
+ newValues.value.companyId = newValues.value.parent?.companyId;
16
+ newValues.value.company = newValues.value.parent?.company;
17
+ }
18
+ }
19
+ );
20
+ const { onSubmit } = useFormSubmission(
21
+ toRef(oldValues),
22
+ toRef(newValues),
23
+ (close) => emit("close", close),
24
+ (model) => emit("save", model),
25
+ useDepartmentApi
26
+ );
27
+ </script>
28
+
29
+ <template>
30
+ <FormCreateModalTemplate
31
+ title="部门信息"
32
+ :on-close="(ok) => emit('close', ok)"
33
+ :fields="[
34
+ { name: 'name', type: 'input', label: '\u90E8\u95E8\u540D\u79F0', colSpan: '12', zodType: z.string().min(2, '\u540D\u79F0\u5B57\u6570\u4E0D\u8DB3') },
35
+ {
36
+ name: 'parentId',
37
+ label: '\u4E0A\u7EA7\u90E8\u95E8',
38
+ colSpan: '12',
39
+ type: 'async-tree-select',
40
+ labelField: 'name',
41
+ searchFields: ['name'],
42
+ listApi: useDepartmentApi().list,
43
+ fetchAll: true,
44
+ initModelValues: newValues.parent,
45
+ onUpdateInitModelValues: (newInitModelValues) => newValues.parent = newInitModelValues,
46
+ zodType: z.number().min(0)
47
+ },
48
+ {
49
+ name: 'companyId',
50
+ label: '\u96B6\u5C5E\u516C\u53F8',
51
+ colSpan: '12',
52
+ type: 'async-select',
53
+ labelField: 'nickname',
54
+ searchFields: ['nickname'],
55
+ listApi: useCompanyApi().list,
56
+ initModelValues: newValues.company,
57
+ onUpdateInitModelValues: (newInitModelValues) => newValues.company = newInitModelValues,
58
+ zodType: z.number().min(0)
59
+ },
60
+ {
61
+ name: 'leaderId',
62
+ label: '\u76F4\u5C5E\u9886\u5BFC',
63
+ colSpan: '12',
64
+ type: 'async-select',
65
+ labelField: 'nickname',
66
+ searchFields: ['nickname'],
67
+ listApi: useUserApi().list,
68
+ initModelValues: newValues.leader,
69
+ onUpdateInitModelValues: (newInitModelValues) => newValues.leader = newInitModelValues,
70
+ zodType: z.number().min(0)
71
+ }
72
+ ]"
73
+ :model-value="newValues"
74
+ @update-model-value="(newVal) => newValues = { id: 0, ...newVal }"
75
+ @submit="onSubmit"
76
+ />
77
+ </template>
@@ -0,0 +1,13 @@
1
+ import type { Department } from 'v-nuxt-ui/types';
2
+ type __VLS_Props = {
3
+ model: Department;
4
+ };
5
+ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
6
+ close: (args_0: boolean) => any;
7
+ save: (args_0: Department) => any;
8
+ }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
9
+ onClose?: ((args_0: boolean) => any) | undefined;
10
+ onSave?: ((args_0: Department) => any) | undefined;
11
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
12
+ declare const _default: typeof __VLS_export;
13
+ export default _default;
@@ -0,0 +1,3 @@
1
+ declare const __VLS_export: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
2
+ declare const _default: typeof __VLS_export;
3
+ export default _default;
@@ -0,0 +1,61 @@
1
+ <script setup>
2
+ import { useOverlay } from "@nuxt/ui/composables";
3
+ import { useDepartmentApi } from "#v/composables";
4
+ import SysDepartmentsCreateModal from "./CreateModal.vue";
5
+ import { getOprColumns } from "#v/constants";
6
+ import TablePage from "#v/components/table/Page.vue";
7
+ const overlay = useOverlay();
8
+ const createModal = overlay.create(SysDepartmentsCreateModal);
9
+ const columns = [
10
+ {
11
+ accessorKey: "name",
12
+ header: "\u90E8\u95E8\u540D\u79F0",
13
+ sortOption: true,
14
+ filterOption: {
15
+ type: "input",
16
+ initHide: false
17
+ }
18
+ },
19
+ {
20
+ accessorKey: "companyId",
21
+ header: "\u96B6\u5C5E\u516C\u53F8",
22
+ sortOption: true,
23
+ cell: ({ row }) => row.original.company?.nickname
24
+ },
25
+ {
26
+ accessorKey: "parentId",
27
+ header: "\u4E0A\u7EA7\u90E8\u95E8",
28
+ sortOption: true,
29
+ cell: ({ row }) => row.original.parent?.name ?? "\u65E0"
30
+ },
31
+ {
32
+ accessorKey: "leaderId",
33
+ header: "\u76F4\u7BA1\u9886\u5BFC",
34
+ sortOption: true,
35
+ cell: ({ row }) => row.original.leader?.nickname
36
+ },
37
+ ...getOprColumns()
38
+ ];
39
+ </script>
40
+
41
+ <template>
42
+ <TablePage
43
+ name="sys-department"
44
+ cn-name="部门信息"
45
+ :use-api-group="useDepartmentApi"
46
+ :biz-columns="columns"
47
+ fetch-all
48
+ :extra-order-query-options="[
49
+ { field: 'createdAt', label: '\u521B\u5EFA\u65F6\u95F4', defaultOpr: 'desc' }
50
+ ]"
51
+ treeify-col-name="parentId"
52
+ :extra-row-actions="[{
53
+ icon: 'i-lucide-clipboard-plus',
54
+ label: '\u4EE5\u6B64\u4F5C\u4E3A\u7236\u90E8\u95E8\u590D\u5236',
55
+ asyncFn: async (raw) => {
56
+ await createModal.open({ model: useDepartmentApi().copyAsParent?.(raw) ?? { id: 0 } });
57
+ }
58
+ }]"
59
+ @edit-row-from-modal="async (row) => await createModal.open({ model: row }).result"
60
+ />
61
+ </template>
@@ -0,0 +1,3 @@
1
+ declare const __VLS_export: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
2
+ declare const _default: typeof __VLS_export;
3
+ export default _default;
@@ -0,0 +1,13 @@
1
+ import type { JobTitle } from 'v-nuxt-ui/types';
2
+ type __VLS_Props = {
3
+ model: JobTitle;
4
+ };
5
+ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
6
+ close: (args_0: boolean) => any;
7
+ save: (args_0: JobTitle) => any;
8
+ }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
9
+ onClose?: ((args_0: boolean) => any) | undefined;
10
+ onSave?: ((args_0: JobTitle) => any) | undefined;
11
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
12
+ declare const _default: typeof __VLS_export;
13
+ export default _default;
@@ -0,0 +1,26 @@
1
+ <script setup>
2
+ import * as z from "zod";
3
+ import FormCreateModalTemplateWithApi from "#v/components/form/create-modal-template/CreateModalTemplateFormWithApi.vue";
4
+ import { useJobTitleApi } from "#v/composables";
5
+ defineProps({
6
+ model: { type: null, required: true }
7
+ });
8
+ const emit = defineEmits(["close", "save"]);
9
+ </script>
10
+
11
+ <template>
12
+ <FormCreateModalTemplateWithApi
13
+ title="职位信息"
14
+ :on-close="(ok) => emit('close', ok)"
15
+ :on-save="(model) => emit('save', model)"
16
+ :fields="[
17
+ { name: 'name', type: 'input', label: '\u540D\u79F0', colSpan: '12', zodType: z.string().min(2, '\u540D\u79F0\u5B57\u6570\u4E0D\u8DB3') },
18
+ { name: 'disabled', type: 'switch', colSpan: '12', label: '\u7981\u7528' },
19
+ { name: 'description', type: 'textarea', label: '\u63CF\u8FF0', colSpan: '24', zodType: z.string().optional().nullable() },
20
+ { name: 'remark', type: 'textarea', label: '\u5907\u6CE8', colSpan: '24', zodType: z.string().optional().nullable() }
21
+ ]"
22
+ :model-value="model"
23
+ :default-model-value="{ disabled: false }"
24
+ :api-group="useJobTitleApi"
25
+ />
26
+ </template>
@@ -0,0 +1,13 @@
1
+ import type { JobTitle } from 'v-nuxt-ui/types';
2
+ type __VLS_Props = {
3
+ model: JobTitle;
4
+ };
5
+ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
6
+ close: (args_0: boolean) => any;
7
+ save: (args_0: JobTitle) => any;
8
+ }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
9
+ onClose?: ((args_0: boolean) => any) | undefined;
10
+ onSave?: ((args_0: JobTitle) => any) | undefined;
11
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
12
+ declare const _default: typeof __VLS_export;
13
+ export default _default;
@@ -0,0 +1,3 @@
1
+ declare const __VLS_export: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
2
+ declare const _default: typeof __VLS_export;
3
+ export default _default;
@@ -0,0 +1,67 @@
1
+ <script setup>
2
+ import { useOverlay } from "@nuxt/ui/composables";
3
+ import { useJobTitleApi } from "#v/composables";
4
+ import SysJobTitlesCreateModal from "./CreateModal.vue";
5
+ import { getOprColumns, booleanOptions } from "#v/constants";
6
+ import UBadge from "@nuxt/ui/components/Badge.vue";
7
+ import { h } from "vue";
8
+ import TablePage from "#v/components/table/Page.vue";
9
+ const overlay = useOverlay();
10
+ const createModal = overlay.create(SysJobTitlesCreateModal);
11
+ const columns = [
12
+ {
13
+ accessorKey: "name",
14
+ header: "\u804C\u4F4D\u540D\u79F0",
15
+ sortOption: true,
16
+ filterOption: {
17
+ type: "input",
18
+ initHide: false
19
+ }
20
+ },
21
+ {
22
+ accessorKey: "description",
23
+ header: "\u63CF\u8FF0",
24
+ sortOption: true,
25
+ filterOption: {
26
+ type: "input"
27
+ }
28
+ },
29
+ {
30
+ accessorKey: "disabled",
31
+ header: "\u7981\u7528",
32
+ cell: ({ cell }) => h(
33
+ UBadge,
34
+ {
35
+ modelValue: cell.getValue(),
36
+ label: cell.getValue() ? "\u662F" : "\u5426",
37
+ variant: "soft",
38
+ color: cell.getValue() ? "error" : "neutral"
39
+ }
40
+ ),
41
+ sortOption: true,
42
+ filterOption: {
43
+ type: "select",
44
+ items: booleanOptions
45
+ }
46
+ },
47
+ {
48
+ accessorKey: "remark",
49
+ header: "\u5907\u6CE8",
50
+ sortOption: true
51
+ },
52
+ ...getOprColumns()
53
+ ];
54
+ </script>
55
+
56
+ <template>
57
+ <TablePage
58
+ name="sys-job-title"
59
+ cn-name="职位信息"
60
+ :use-api-group="useJobTitleApi"
61
+ :biz-columns="columns"
62
+ :extra-order-query-options="[
63
+ { field: 'createdAt', label: '\u521B\u5EFA\u65F6\u95F4', defaultOpr: 'desc' }
64
+ ]"
65
+ @edit-row-from-modal="async (row) => await createModal.open({ model: row }).result"
66
+ />
67
+ </template>
@@ -0,0 +1,3 @@
1
+ declare const __VLS_export: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
2
+ declare const _default: typeof __VLS_export;
3
+ export default _default;
@@ -0,0 +1,13 @@
1
+ import type { Menu } from 'v-nuxt-ui/types';
2
+ type __VLS_Props = {
3
+ model: Menu;
4
+ };
5
+ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
6
+ close: (args_0: boolean) => any;
7
+ save: (args_0: Menu) => any;
8
+ }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
9
+ onClose?: ((args_0: boolean) => any) | undefined;
10
+ onSave?: ((args_0: Menu) => any) | undefined;
11
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
12
+ declare const _default: typeof __VLS_export;
13
+ export default _default;
@@ -0,0 +1,58 @@
1
+ <script setup>
2
+ import * as z from "zod";
3
+ import FormCreateModalTemplate from "#v/components/form/create-modal-template/index.vue";
4
+ import { useMenuApi, useFormSubmission, useFormValues } from "#v/composables";
5
+ import { toRef } from "vue";
6
+ import { menuTypeOptions } from "#v/constants";
7
+ const props = defineProps({
8
+ model: { type: null, required: true }
9
+ });
10
+ const emit = defineEmits(["close", "save"]);
11
+ const { oldValues, newValues } = useFormValues(toRef(props.model), { id: 0, disabled: false, isAdmin: false });
12
+ const { onSubmit } = useFormSubmission(
13
+ toRef(oldValues),
14
+ toRef(newValues),
15
+ (close) => emit("close", close),
16
+ (model) => emit("save", model),
17
+ useMenuApi,
18
+ ["staticRouteKeys"]
19
+ );
20
+ </script>
21
+
22
+ <template>
23
+ <FormCreateModalTemplate
24
+ title="菜单信息"
25
+ :on-close="(ok) => emit('close', ok)"
26
+ :fields="[
27
+ { name: 'name', type: 'input', label: '\u83DC\u5355\u540D\u79F0', colSpan: '12', zodType: z.string().min(2, '\u540D\u79F0\u5B57\u6570\u4E0D\u8DB3') },
28
+ { name: 'type', type: 'radio-select', items: menuTypeOptions, orientation: 'horizontal', label: '\u83DC\u5355\u7C7B\u578B', colSpan: '12', zodType: z.string() },
29
+ {
30
+ name: 'parentId',
31
+ label: '\u4E0A\u7EA7\u83DC\u5355',
32
+ colSpan: '12',
33
+ type: 'async-tree-select',
34
+ labelField: 'name',
35
+ searchFields: ['name'],
36
+ listApi: useMenuApi().list,
37
+ fetchAll: true,
38
+ enableEmptyOption: true,
39
+ initModelValues: newValues.parent,
40
+ onUpdateInitModelValues: (newInitModelValues) => newValues.parent = newInitModelValues,
41
+ extraQuery: {
42
+ orderQuery: [
43
+ { field: 'order', order: 'asc' }
44
+ ]
45
+ },
46
+ zodType: z.number().min(0)
47
+ },
48
+ { name: 'order', type: 'input', label: '\u83DC\u5355\u6392\u5E8F', colSpan: '12', zodType: z.string() },
49
+ { name: 'staticRouteKeys', type: 'dynamic-input', label: '\u83DC\u5355\u9759\u6001\u8DEF\u7531', colSpan: '24', zodType: z.array(z.string()), required: newValues.type !== 'button' },
50
+ { name: 'permission', type: 'input', label: '\u83DC\u5355\u6743\u9650', colSpan: '24', zodType: z.string(), hidden: newValues.type !== 'button' },
51
+ { name: 'disabled', type: 'button-switch', label: '\u662F\u5426\u7981\u7528', colSpan: '12', zodType: z.boolean() },
52
+ { name: 'isAdmin', type: 'button-switch', label: '\u662F\u5426\u662F\u7CFB\u7EDF\u83DC\u5355', colSpan: '12', zodType: z.boolean() }
53
+ ]"
54
+ :model-value="newValues"
55
+ @update-model-value="(newVal) => newValues = { id: 0, ...newVal }"
56
+ @submit="onSubmit"
57
+ />
58
+ </template>
@@ -0,0 +1,13 @@
1
+ import type { Menu } from 'v-nuxt-ui/types';
2
+ type __VLS_Props = {
3
+ model: Menu;
4
+ };
5
+ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
6
+ close: (args_0: boolean) => any;
7
+ save: (args_0: Menu) => any;
8
+ }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
9
+ onClose?: ((args_0: boolean) => any) | undefined;
10
+ onSave?: ((args_0: Menu) => any) | undefined;
11
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
12
+ declare const _default: typeof __VLS_export;
13
+ export default _default;
@@ -0,0 +1,3 @@
1
+ declare const __VLS_export: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
2
+ declare const _default: typeof __VLS_export;
3
+ export default _default;