v-nuxt-ui 0.1.27 → 0.1.29
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/date-picker/index.d.vue.ts +1 -2
- package/dist/runtime/components/date-picker/index.vue +1 -1
- package/dist/runtime/components/date-picker/index.vue.d.ts +1 -2
- package/dist/runtime/components/form/field/AsyncObjectSelect.vue +4 -1
- package/dist/runtime/components/form/field/AsyncSelect.d.vue.ts +4 -0
- package/dist/runtime/components/form/field/AsyncSelect.vue +3 -0
- package/dist/runtime/components/form/field/AsyncSelect.vue.d.ts +4 -0
- package/dist/runtime/components/form/field/AsyncTreeSelect.vue +3 -0
- package/dist/runtime/components/form/field/index.vue +3 -0
- package/dist/runtime/components/sys/calendar/board.vue +4 -3
- package/dist/runtime/components/sys/company/CreateModal.d.vue.ts +1 -1
- package/dist/runtime/components/sys/company/CreateModal.vue +1 -1
- package/dist/runtime/components/sys/company/CreateModal.vue.d.ts +1 -1
- package/dist/runtime/components/sys/department/CreateModal.d.vue.ts +1 -1
- package/dist/runtime/components/sys/department/CreateModal.vue +1 -1
- package/dist/runtime/components/sys/department/CreateModal.vue.d.ts +1 -1
- package/dist/runtime/components/sys/issue-record/CreateModal.d.vue.ts +13 -0
- package/dist/runtime/components/sys/issue-record/CreateModal.vue +23 -0
- package/dist/runtime/components/sys/issue-record/CreateModal.vue.d.ts +13 -0
- package/dist/runtime/components/sys/issue-record/Table.d.vue.ts +3 -0
- package/dist/runtime/components/sys/issue-record/Table.vue +32 -0
- package/dist/runtime/components/sys/issue-record/Table.vue.d.ts +3 -0
- package/dist/runtime/components/sys/job-title/CreateModal.d.vue.ts +1 -1
- package/dist/runtime/components/sys/job-title/CreateModal.vue +1 -1
- package/dist/runtime/components/sys/job-title/CreateModal.vue.d.ts +1 -1
- package/dist/runtime/components/sys/menu/CreateModal.d.vue.ts +1 -1
- package/dist/runtime/components/sys/menu/CreateModal.vue +1 -1
- package/dist/runtime/components/sys/menu/CreateModal.vue.d.ts +1 -1
- package/dist/runtime/components/sys/role/CreateModal.d.vue.ts +1 -1
- package/dist/runtime/components/sys/role/CreateModal.vue +1 -1
- package/dist/runtime/components/sys/role/CreateModal.vue.d.ts +1 -1
- package/dist/runtime/components/sys/user/CreateModal.d.vue.ts +1 -1
- package/dist/runtime/components/sys/user/CreateModal.vue +1 -1
- package/dist/runtime/components/sys/user/CreateModal.vue.d.ts +1 -1
- package/dist/runtime/components/table/query/where/simple/item/opr/AsyncSelect.vue +4 -1
- package/dist/runtime/composables/api/sys/index.d.ts +2 -0
- package/dist/runtime/composables/api/sys/index.js +2 -0
- package/dist/runtime/composables/api/sys/useCalendarApi.d.ts +10 -0
- package/dist/runtime/composables/api/sys/useIssueRecordApi.d.ts +2 -0
- package/dist/runtime/composables/api/sys/useIssueRecordApi.js +3 -0
- package/dist/runtime/composables/table/useTableRowActions.js +33 -21
- package/dist/runtime/constants/calendar.d.ts +3 -7
- package/dist/runtime/constants/calendar.js +9 -15
- package/dist/runtime/types/components/form/field.d.ts +4 -1
- package/dist/runtime/types/components/table/index.d.ts +1 -0
- package/dist/runtime/types/models/sys.d.ts +3 -0
- package/dist/runtime/types/time.d.ts +6 -0
- package/dist/runtime/types/time.js +7 -0
- package/package.json +1 -1
package/dist/module.json
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import type { ButtonProps } from '@nuxt/ui';
|
|
2
2
|
import type { DateRange, DateValue } from 'reka-ui';
|
|
3
|
-
import type { TimeUnit } from '#v/
|
|
4
|
-
import type { DateShortcut } from '#v/types';
|
|
3
|
+
import type { DateShortcut, TimeUnit } from '#v/types';
|
|
5
4
|
type __VLS_Props = {
|
|
6
5
|
size?: ButtonProps['size'];
|
|
7
6
|
loading?: ButtonProps['loading'];
|
|
@@ -12,7 +12,7 @@ const props = defineProps({
|
|
|
12
12
|
loading: { type: Boolean, required: false },
|
|
13
13
|
range: { type: Boolean, required: false },
|
|
14
14
|
placeholder: { type: String, required: false },
|
|
15
|
-
timeUnit: { type:
|
|
15
|
+
timeUnit: { type: String, required: false },
|
|
16
16
|
leadingIcon: { type: null, required: false },
|
|
17
17
|
shortcuts: { type: Array, required: false },
|
|
18
18
|
peerButtons: { type: Array, required: false }
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import type { ButtonProps } from '@nuxt/ui';
|
|
2
2
|
import type { DateRange, DateValue } from 'reka-ui';
|
|
3
|
-
import type { TimeUnit } from '#v/
|
|
4
|
-
import type { DateShortcut } from '#v/types';
|
|
3
|
+
import type { DateShortcut, TimeUnit } from '#v/types';
|
|
5
4
|
type __VLS_Props = {
|
|
6
5
|
size?: ButtonProps['size'];
|
|
7
6
|
loading?: ButtonProps['loading'];
|
|
@@ -15,7 +15,10 @@ const props = defineProps({
|
|
|
15
15
|
disableOprSelector: { type: Boolean, required: false },
|
|
16
16
|
multiple: { type: Boolean, required: false },
|
|
17
17
|
placeholder: { type: String, required: false },
|
|
18
|
-
size: { type: null, required: false }
|
|
18
|
+
size: { type: null, required: false },
|
|
19
|
+
canCreate: { type: Boolean, required: false },
|
|
20
|
+
createModalComponent: { type: null, required: false },
|
|
21
|
+
createModalOpenProps: { type: Object, required: false }
|
|
19
22
|
});
|
|
20
23
|
const modelValue = defineModel("modelValue", { type: null, ...{ required: true } });
|
|
21
24
|
const initModelValue = ref(modelValue.value);
|
|
@@ -1,8 +1,12 @@
|
|
|
1
|
+
import type { Component } from 'vue';
|
|
1
2
|
import type { VFormFieldAsyncSelectProps } from '#v/types';
|
|
2
3
|
declare const __VLS_export: <T>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_exposed?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
|
|
3
4
|
props: import("vue").PublicProps & __VLS_PrettifyLocal<(VFormFieldAsyncSelectProps<T> & {
|
|
4
5
|
icon?: string;
|
|
5
6
|
disabled?: boolean;
|
|
7
|
+
canCreate?: boolean;
|
|
8
|
+
createModalComponent?: Component;
|
|
9
|
+
createModalOpenProps?: Record<string, any>;
|
|
6
10
|
} & {
|
|
7
11
|
modelValue: string[] | number[] | number | string | null | undefined;
|
|
8
12
|
}) & {
|
|
@@ -25,6 +25,9 @@ const props = defineProps({
|
|
|
25
25
|
multiple: { type: Boolean, required: false },
|
|
26
26
|
placeholder: { type: String, required: false },
|
|
27
27
|
size: { type: null, required: false },
|
|
28
|
+
canCreate: { type: Boolean, required: false },
|
|
29
|
+
createModalComponent: { type: void 0, required: false },
|
|
30
|
+
createModalOpenProps: { type: Object, required: false },
|
|
28
31
|
icon: { type: String, required: false },
|
|
29
32
|
disabled: { type: Boolean, required: false }
|
|
30
33
|
});
|
|
@@ -1,8 +1,12 @@
|
|
|
1
|
+
import type { Component } from 'vue';
|
|
1
2
|
import type { VFormFieldAsyncSelectProps } from '#v/types';
|
|
2
3
|
declare const __VLS_export: <T>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_exposed?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
|
|
3
4
|
props: import("vue").PublicProps & __VLS_PrettifyLocal<(VFormFieldAsyncSelectProps<T> & {
|
|
4
5
|
icon?: string;
|
|
5
6
|
disabled?: boolean;
|
|
7
|
+
canCreate?: boolean;
|
|
8
|
+
createModalComponent?: Component;
|
|
9
|
+
createModalOpenProps?: Record<string, any>;
|
|
6
10
|
} & {
|
|
7
11
|
modelValue: string[] | number[] | number | string | null | undefined;
|
|
8
12
|
}) & {
|
|
@@ -23,6 +23,9 @@ const props = defineProps({
|
|
|
23
23
|
multiple: { type: Boolean, required: false },
|
|
24
24
|
placeholder: { type: String, required: false },
|
|
25
25
|
size: { type: null, required: false },
|
|
26
|
+
canCreate: { type: Boolean, required: false },
|
|
27
|
+
createModalComponent: { type: null, required: false },
|
|
28
|
+
createModalOpenProps: { type: Object, required: false },
|
|
26
29
|
icon: { type: String, required: false },
|
|
27
30
|
disabled: { type: Boolean, required: false }
|
|
28
31
|
});
|
|
@@ -147,6 +147,9 @@ const fieldModelValue = computed({
|
|
|
147
147
|
:disabled="field.disabled"
|
|
148
148
|
:enable-empty-option="field.enableEmptyOption"
|
|
149
149
|
:extra-search-field-fn="field.extraSearchFieldFn"
|
|
150
|
+
:can-create="field.canCreate"
|
|
151
|
+
:create-modal-component="field.createModalComponent"
|
|
152
|
+
:create-modal-open-props="field.createModalOpenProps"
|
|
150
153
|
@update-init-model-values="field.onUpdateInitModelValues"
|
|
151
154
|
/>
|
|
152
155
|
<FormFieldAsyncObjectSelect
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
<script setup>
|
|
2
2
|
import { useDate, useFetching, useSubmitting } from "#v/composables";
|
|
3
3
|
import { useCalendarApi } from "#v/composables/api/sys/useCalendarApi";
|
|
4
|
-
import { TIME_ZONE,
|
|
4
|
+
import { TIME_ZONE, dateFormat, calendarEventTypeOptions } from "#v/constants";
|
|
5
|
+
import { CalendarEventType } from "#v/types";
|
|
5
6
|
import { endOfMonth, now, startOfMonth } from "@internationalized/date";
|
|
6
7
|
import { useToast } from "@nuxt/ui/runtime/composables/useToast.js";
|
|
7
8
|
import { ref, computed, watch } from "vue";
|
|
@@ -193,8 +194,8 @@ watch(
|
|
|
193
194
|
class="inline-block size-2 rounded-full"
|
|
194
195
|
:class="`bg-(--color-light) dark:bg-(--color-dark)`"
|
|
195
196
|
:style="{
|
|
196
|
-
'--color-light': `var(--ui-${item.color})`,
|
|
197
|
-
'--color-dark': `var(--ui-${item.color})`
|
|
197
|
+
'--color-light': `var(--ui-${String(item.color)})`,
|
|
198
|
+
'--color-dark': `var(--ui-${String(item.color)})`
|
|
198
199
|
}"
|
|
199
200
|
/>
|
|
200
201
|
</div>
|
|
@@ -3,7 +3,7 @@ import * as z from "zod";
|
|
|
3
3
|
import FormCreateModalTemplateWithApi from "#v/components/form/create-modal-template/WithApi.vue";
|
|
4
4
|
import { useCompanyApi } from "#v/composables";
|
|
5
5
|
defineProps({
|
|
6
|
-
model: { type:
|
|
6
|
+
model: { type: Object, required: true }
|
|
7
7
|
});
|
|
8
8
|
const emit = defineEmits(["close", "save"]);
|
|
9
9
|
</script>
|
|
@@ -4,7 +4,7 @@ import FormCreateModalTemplate from "#v/components/form/create-modal-template/in
|
|
|
4
4
|
import { useCompanyApi, useDepartmentApi, useFormSubmission, useFormValues, useUserApi } from "#v/composables";
|
|
5
5
|
import { toRef, watch } from "vue";
|
|
6
6
|
const props = defineProps({
|
|
7
|
-
model: { type:
|
|
7
|
+
model: { type: Object, required: true }
|
|
8
8
|
});
|
|
9
9
|
const emit = defineEmits(["close", "save"]);
|
|
10
10
|
const { oldValues, newValues } = useFormValues(toRef(props.model), { id: 0 });
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { IssueRecord } from '#v/types';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
model: IssueRecord;
|
|
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: IssueRecord) => any;
|
|
8
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
9
|
+
onClose?: ((args_0: boolean) => any) | undefined;
|
|
10
|
+
onSave?: ((args_0: IssueRecord) => 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 { useIssueRecordApi } from "#v/composables";
|
|
5
|
+
defineProps({
|
|
6
|
+
model: { type: Object, required: true }
|
|
7
|
+
});
|
|
8
|
+
const emit = defineEmits(["close", "save"]);
|
|
9
|
+
</script>
|
|
10
|
+
|
|
11
|
+
<template>
|
|
12
|
+
<FormCreateModalTemplateWithApi
|
|
13
|
+
title="改进建议"
|
|
14
|
+
description="您可以针对该网页提出任何改进建议或直接联系chenrn@mail.veken.com"
|
|
15
|
+
:on-close="(ok) => emit('close', ok)"
|
|
16
|
+
:on-save="(model) => emit('save', model)"
|
|
17
|
+
:fields="[
|
|
18
|
+
{ name: 'description', type: 'textarea', label: '\u63CF\u8FF0', colSpan: '24', zodType: z.string() }
|
|
19
|
+
]"
|
|
20
|
+
:model-value="model"
|
|
21
|
+
:api-group="useIssueRecordApi"
|
|
22
|
+
/>
|
|
23
|
+
</template>
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { IssueRecord } from '#v/types';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
model: IssueRecord;
|
|
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: IssueRecord) => any;
|
|
8
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
9
|
+
onClose?: ((args_0: boolean) => any) | undefined;
|
|
10
|
+
onSave?: ((args_0: IssueRecord) => 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,32 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { getOprColumns } from "#v/constants";
|
|
3
|
+
import { useOverlay } from "@nuxt/ui/composables";
|
|
4
|
+
import { useIssueRecordApi } from "#v/composables";
|
|
5
|
+
import SysIssueRecordsCreateModal from "./CreateModal.vue";
|
|
6
|
+
import TablePage from "#v/components/table/Page.vue";
|
|
7
|
+
const overlay = useOverlay();
|
|
8
|
+
const createModal = overlay.create(SysIssueRecordsCreateModal);
|
|
9
|
+
const columns = [
|
|
10
|
+
{
|
|
11
|
+
accessorKey: "description",
|
|
12
|
+
header: "\u63CF\u8FF0",
|
|
13
|
+
filterOption: {
|
|
14
|
+
type: "input"
|
|
15
|
+
}
|
|
16
|
+
},
|
|
17
|
+
...getOprColumns()
|
|
18
|
+
];
|
|
19
|
+
</script>
|
|
20
|
+
|
|
21
|
+
<template>
|
|
22
|
+
<TablePage
|
|
23
|
+
name="sys-issue-record"
|
|
24
|
+
cn-name="改进建议"
|
|
25
|
+
:use-api-group="useIssueRecordApi"
|
|
26
|
+
:biz-columns="columns"
|
|
27
|
+
:extra-order-query-options="[
|
|
28
|
+
{ field: 'createdAt', label: '\u521B\u5EFA\u65F6\u95F4', defaultOpr: 'desc' }
|
|
29
|
+
]"
|
|
30
|
+
@edit-row-from-modal="async (row) => await createModal.open({ model: row }).result"
|
|
31
|
+
/>
|
|
32
|
+
</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;
|
|
@@ -3,7 +3,7 @@ import * as z from "zod";
|
|
|
3
3
|
import FormCreateModalTemplateWithApi from "#v/components/form/create-modal-template/WithApi.vue";
|
|
4
4
|
import { useJobTitleApi } from "#v/composables";
|
|
5
5
|
defineProps({
|
|
6
|
-
model: { type:
|
|
6
|
+
model: { type: Object, required: true }
|
|
7
7
|
});
|
|
8
8
|
const emit = defineEmits(["close", "save"]);
|
|
9
9
|
</script>
|
|
@@ -5,7 +5,7 @@ import { useMenuApi, useFormSubmission, useFormValues } from "#v/composables";
|
|
|
5
5
|
import { toRef } from "vue";
|
|
6
6
|
import { menuTypeOptions } from "#v/constants";
|
|
7
7
|
const props = defineProps({
|
|
8
|
-
model: { type:
|
|
8
|
+
model: { type: Object, required: true }
|
|
9
9
|
});
|
|
10
10
|
const emit = defineEmits(["close", "save"]);
|
|
11
11
|
const { oldValues, newValues } = useFormValues(toRef(props.model), { id: 0, disabled: false, isAdmin: false });
|
|
@@ -5,7 +5,7 @@ import { useFormSubmission, useFormValues, useMenuApi, useRoleApi } from "#v/com
|
|
|
5
5
|
import { computed, onMounted, ref, toRef } from "vue";
|
|
6
6
|
import { treeifyOptions } from "#v/utils";
|
|
7
7
|
const props = defineProps({
|
|
8
|
-
model: { type:
|
|
8
|
+
model: { type: Object, required: true }
|
|
9
9
|
});
|
|
10
10
|
const emit = defineEmits(["close", "save"]);
|
|
11
11
|
const { oldValues, newValues } = useFormValues(toRef(props.model), { id: 0, disabled: false, isAdmin: false });
|
|
@@ -6,7 +6,7 @@ import FormCreateModalTemplate from "#v/components/form/create-modal-template/in
|
|
|
6
6
|
import { loginTypeOptions, genderOptions, Gender } from "#v/constants";
|
|
7
7
|
import * as z from "zod";
|
|
8
8
|
const props = defineProps({
|
|
9
|
-
model: { type:
|
|
9
|
+
model: { type: Object, required: true }
|
|
10
10
|
});
|
|
11
11
|
const emit = defineEmits(["close", "save"]);
|
|
12
12
|
const { oldValues, newValues } = useFormValues(toRef(props.model), { id: 0, needFillWh: false, isAdmin: false });
|
|
@@ -22,7 +22,10 @@ const props = defineProps({
|
|
|
22
22
|
disableOprSelector: { type: Boolean, required: false },
|
|
23
23
|
multiple: { type: Boolean, required: false },
|
|
24
24
|
placeholder: { type: String, required: false },
|
|
25
|
-
size: { type: null, required: false, default: "sm" }
|
|
25
|
+
size: { type: null, required: false, default: "sm" },
|
|
26
|
+
canCreate: { type: Boolean, required: false },
|
|
27
|
+
createModalComponent: { type: null, required: false },
|
|
28
|
+
createModalOpenProps: { type: Object, required: false }
|
|
26
29
|
});
|
|
27
30
|
const whereQueryItem = defineModel("whereQueryItem", { type: Object, ...{ required: true } });
|
|
28
31
|
const { fetching, startFetching, endFetching } = useFetching();
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { PageResult, Calendar, CalendarsSavePayload, ApiGroup, RequestResult } from '#v/types';
|
|
2
|
+
import type { UseFetchOptions } from 'nuxt/app';
|
|
3
|
+
import type { Ref } from 'vue';
|
|
4
|
+
type CalendarApi = {
|
|
5
|
+
batchSave: (payload: CalendarsSavePayload, customOptions?: UseFetchOptions<PageResult<Calendar>>) => Promise<{
|
|
6
|
+
data: Ref<RequestResult<PageResult<Calendar>>>;
|
|
7
|
+
}>;
|
|
8
|
+
} & ApiGroup<Calendar>;
|
|
9
|
+
export declare const useCalendarApi: () => CalendarApi;
|
|
10
|
+
export {};
|
|
@@ -47,35 +47,47 @@ export function useTableRowActions(props) {
|
|
|
47
47
|
}
|
|
48
48
|
});
|
|
49
49
|
}
|
|
50
|
-
|
|
51
|
-
|
|
50
|
+
const buildActionItem = (action) => {
|
|
51
|
+
const item = {
|
|
52
52
|
label: action.label,
|
|
53
53
|
icon: action.icon,
|
|
54
54
|
type: action.type,
|
|
55
|
-
color: action.color
|
|
56
|
-
|
|
57
|
-
|
|
55
|
+
color: action.color
|
|
56
|
+
};
|
|
57
|
+
if (action.children && action.children.length > 0) {
|
|
58
|
+
item.children = action.children.map(buildActionItem);
|
|
59
|
+
return item;
|
|
60
|
+
}
|
|
61
|
+
item.onClick = async () => {
|
|
62
|
+
if (action.fn) {
|
|
63
|
+
try {
|
|
58
64
|
action.fn(row.original);
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
}
|
|
65
|
+
} catch (e) {
|
|
66
|
+
console.error("Error in row action fn:", e);
|
|
62
67
|
}
|
|
63
|
-
if (action.
|
|
64
|
-
|
|
65
|
-
try {
|
|
66
|
-
await action.asyncFn(row.original);
|
|
67
|
-
} finally {
|
|
68
|
-
actionLoadingRowIdxSet.value.delete(row.index);
|
|
69
|
-
}
|
|
68
|
+
if (action.refetchAfterFn) {
|
|
69
|
+
await fetchList();
|
|
70
70
|
}
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
71
|
+
}
|
|
72
|
+
if (action.asyncFn) {
|
|
73
|
+
actionLoadingRowIdxSet.value.add(row.index);
|
|
74
|
+
try {
|
|
75
|
+
await action.asyncFn(row.original);
|
|
76
|
+
} finally {
|
|
77
|
+
actionLoadingRowIdxSet.value.delete(row.index);
|
|
76
78
|
}
|
|
77
79
|
}
|
|
78
|
-
|
|
80
|
+
if (action.fnWithModal) {
|
|
81
|
+
const result = await action.fnWithModal(row.original);
|
|
82
|
+
if (result) {
|
|
83
|
+
await fetchList();
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
};
|
|
87
|
+
return item;
|
|
88
|
+
};
|
|
89
|
+
extraRowActions?.forEach((action) => {
|
|
90
|
+
actionItems.push(buildActionItem(action));
|
|
79
91
|
});
|
|
80
92
|
if (!disableRowDeletion) {
|
|
81
93
|
if (actionItems.length > 0) {
|
|
@@ -1,12 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
HOLIDAY = 1,
|
|
4
|
-
ADJUSTRED = 2,
|
|
5
|
-
WEEKEND = 3
|
|
6
|
-
}
|
|
1
|
+
import { CalendarEventType } from '#v/types';
|
|
2
|
+
import type { ChipProps } from '@nuxt/ui';
|
|
7
3
|
export declare const calendarEventTypeOptions: {
|
|
8
4
|
label: string;
|
|
9
5
|
value: CalendarEventType;
|
|
10
|
-
color:
|
|
6
|
+
color: ChipProps['color'];
|
|
11
7
|
}[];
|
|
12
8
|
export declare const calendarEventTypeShortNameMap: Map<CalendarEventType, string>;
|
|
@@ -1,19 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
CalendarEventType2[CalendarEventType2["NONE"] = 0] = "NONE";
|
|
3
|
-
CalendarEventType2[CalendarEventType2["HOLIDAY"] = 1] = "HOLIDAY";
|
|
4
|
-
CalendarEventType2[CalendarEventType2["ADJUSTRED"] = 2] = "ADJUSTRED";
|
|
5
|
-
CalendarEventType2[CalendarEventType2["WEEKEND"] = 3] = "WEEKEND";
|
|
6
|
-
return CalendarEventType2;
|
|
7
|
-
})(CalendarEventType || {});
|
|
1
|
+
import { CalendarEventType } from "#v/types";
|
|
8
2
|
export const calendarEventTypeOptions = [
|
|
9
|
-
{ label: "\u56FD\u5BB6\u6CD5\u5B9A\u5047", value:
|
|
10
|
-
{ label: "\u516C\u53F8\u8C03\u6574\u5047", value:
|
|
11
|
-
{ label: "\u5468\u672B\u4F11\u606F\u65E5", value:
|
|
12
|
-
{ label: "\u65E0", value:
|
|
3
|
+
{ label: "\u56FD\u5BB6\u6CD5\u5B9A\u5047", value: CalendarEventType.HOLIDAY, color: "primary" },
|
|
4
|
+
{ label: "\u516C\u53F8\u8C03\u6574\u5047", value: CalendarEventType.ADJUSTRED, color: "warning" },
|
|
5
|
+
{ label: "\u5468\u672B\u4F11\u606F\u65E5", value: CalendarEventType.WEEKEND, color: "success" },
|
|
6
|
+
{ label: "\u65E0", value: CalendarEventType.NONE, color: "neutral" }
|
|
13
7
|
];
|
|
14
8
|
export const calendarEventTypeShortNameMap = /* @__PURE__ */ new Map([
|
|
15
|
-
[
|
|
16
|
-
[
|
|
17
|
-
[
|
|
18
|
-
[
|
|
9
|
+
[CalendarEventType.NONE, "\u73ED"],
|
|
10
|
+
[CalendarEventType.HOLIDAY, "\u5047"],
|
|
11
|
+
[CalendarEventType.ADJUSTRED, "\u8C03"],
|
|
12
|
+
[CalendarEventType.WEEKEND, "\u4F11"]
|
|
19
13
|
]);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { VNode, Ref } from 'vue';
|
|
1
|
+
import type { VNode, Ref, Component } from 'vue';
|
|
2
2
|
import type { ButtonProps, FormFieldProps, InputProps, RadioGroupProps, SelectMenuItem, SelectProps, TreeItem } from '@nuxt/ui';
|
|
3
3
|
import type { ZodType } from 'zod';
|
|
4
4
|
import type { PageResult, RequestResult } from '../../request.js';
|
|
@@ -20,6 +20,9 @@ export type VFormFieldAsyncSelectProps<T> = {
|
|
|
20
20
|
multiple?: boolean;
|
|
21
21
|
placeholder?: string;
|
|
22
22
|
size?: SelectProps['size'];
|
|
23
|
+
canCreate?: boolean;
|
|
24
|
+
createModalComponent?: Component;
|
|
25
|
+
createModalOpenProps?: Record<string, any>;
|
|
23
26
|
};
|
|
24
27
|
export type VFormFieldAsyncTreeSelectProps<T> = {
|
|
25
28
|
fetchAll?: boolean;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export var CalendarEventType = /* @__PURE__ */ ((CalendarEventType2) => {
|
|
2
|
+
CalendarEventType2[CalendarEventType2["NONE"] = 0] = "NONE";
|
|
3
|
+
CalendarEventType2[CalendarEventType2["HOLIDAY"] = 1] = "HOLIDAY";
|
|
4
|
+
CalendarEventType2[CalendarEventType2["ADJUSTRED"] = 2] = "ADJUSTRED";
|
|
5
|
+
CalendarEventType2[CalendarEventType2["WEEKEND"] = 3] = "WEEKEND";
|
|
6
|
+
return CalendarEventType2;
|
|
7
|
+
})(CalendarEventType || {});
|
package/package.json
CHANGED