v-nuxt-ui 0.2.28 → 0.2.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/table/ExcelExportModal.d.vue.ts +1 -0
- package/dist/runtime/components/table/ExcelExportModal.vue +26 -9
- package/dist/runtime/components/table/ExcelExportModal.vue.d.ts +1 -0
- package/dist/runtime/components/table/header/index.vue +2 -1
- package/package.json +1 -1
package/dist/module.json
CHANGED
|
@@ -7,6 +7,7 @@ declare const __VLS_export: <T>(__VLS_props: NonNullable<Awaited<typeof __VLS_se
|
|
|
7
7
|
columns: VColumn<T>[];
|
|
8
8
|
whereQueryOptions: WhereQueryOption<T>[];
|
|
9
9
|
extraWhereQueryInitValues?: WhereQuery<T>;
|
|
10
|
+
initWhereQuery?: WhereQuery<T>;
|
|
10
11
|
listFn?(payload: Omit<QueryTemplate<T>, "selectQuery">, ...args: unknown[]): Promise<{
|
|
11
12
|
data: Ref<RequestResult<PageResult<T>>>;
|
|
12
13
|
}>;
|
|
@@ -5,7 +5,7 @@ import { defu } from "defu";
|
|
|
5
5
|
import { useExporting } from "#v/composables/useBoolean";
|
|
6
6
|
import { useDate } from "#v/composables/useDate";
|
|
7
7
|
import { dateFormat, TIME_ZONE } from "#v/constants";
|
|
8
|
-
import { genTableExcel } from "#v/utils";
|
|
8
|
+
import { cloneJson, genTableExcel } from "#v/utils";
|
|
9
9
|
import TableQueryWhere from "#v/components/table/query/where/index.vue";
|
|
10
10
|
const props = defineProps({
|
|
11
11
|
filename: { type: String, required: false },
|
|
@@ -13,9 +13,10 @@ const props = defineProps({
|
|
|
13
13
|
columns: { type: Array, required: true },
|
|
14
14
|
whereQueryOptions: { type: Array, required: true },
|
|
15
15
|
extraWhereQueryInitValues: { type: Object, required: false },
|
|
16
|
+
initWhereQuery: { type: Object, required: false },
|
|
16
17
|
listFn: { type: Function, required: false }
|
|
17
18
|
});
|
|
18
|
-
const whereQuery = ref();
|
|
19
|
+
const whereQuery = ref(props.initWhereQuery);
|
|
19
20
|
const emit = defineEmits(["close"]);
|
|
20
21
|
const { exporting, startExporting, endExporting } = useExporting();
|
|
21
22
|
const exportExcel = async () => {
|
|
@@ -51,14 +52,30 @@ const exportExcel = async () => {
|
|
|
51
52
|
>
|
|
52
53
|
<template #body>
|
|
53
54
|
<UFormField label="筛选条件">
|
|
54
|
-
<
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
55
|
+
<template #label>
|
|
56
|
+
<div class="flex items-center gap-1">
|
|
57
|
+
<span>筛选条件</span>
|
|
58
|
+
<UTooltip text="同步查询条件" :delay="0" :content="{ side: 'top' }">
|
|
59
|
+
<UButton
|
|
60
|
+
variant="ghost"
|
|
61
|
+
color="neutral"
|
|
62
|
+
size="xs"
|
|
63
|
+
icon="i-lucide-refresh-ccw"
|
|
64
|
+
@click="whereQuery = cloneJson(initWhereQuery)"
|
|
65
|
+
/>
|
|
66
|
+
</UTooltip>
|
|
67
|
+
</div>
|
|
68
|
+
</template>
|
|
69
|
+
<div class="ring ring-default rounded-md">
|
|
70
|
+
<TableQueryWhere
|
|
71
|
+
:where-query="whereQuery"
|
|
72
|
+
:where-options="whereQueryOptions"
|
|
73
|
+
:trigger-fetching="async () => {
|
|
58
74
|
}"
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
75
|
+
hide-query-button
|
|
76
|
+
@update-where-query="(newWhereQuery) => whereQuery = newWhereQuery"
|
|
77
|
+
/>
|
|
78
|
+
</div>
|
|
62
79
|
</UFormField>
|
|
63
80
|
</template>
|
|
64
81
|
<template #footer>
|
|
@@ -7,6 +7,7 @@ declare const __VLS_export: <T>(__VLS_props: NonNullable<Awaited<typeof __VLS_se
|
|
|
7
7
|
columns: VColumn<T>[];
|
|
8
8
|
whereQueryOptions: WhereQueryOption<T>[];
|
|
9
9
|
extraWhereQueryInitValues?: WhereQuery<T>;
|
|
10
|
+
initWhereQuery?: WhereQuery<T>;
|
|
10
11
|
listFn?(payload: Omit<QueryTemplate<T>, "selectQuery">, ...args: unknown[]): Promise<{
|
|
11
12
|
data: Ref<RequestResult<PageResult<T>>>;
|
|
12
13
|
}>;
|
|
@@ -67,7 +67,8 @@ async function handleExportExcel() {
|
|
|
67
67
|
filenameWithDateTime: props.exportExcel.filenameWithDateTime,
|
|
68
68
|
listFn: props.apiGroup?.().countAndList,
|
|
69
69
|
whereQueryOptions: props.whereQueryProps.whereOptions,
|
|
70
|
-
extraWhereQueryInitValues: defu(props.extraWhereQueryInitValues, props.exportExcel.extraWhereQueryInitValues)
|
|
70
|
+
extraWhereQueryInitValues: defu(props.extraWhereQueryInitValues, props.exportExcel.extraWhereQueryInitValues),
|
|
71
|
+
initWhereQuery: props.whereQueryProps.whereQuery
|
|
71
72
|
});
|
|
72
73
|
}
|
|
73
74
|
async function handleBatchDelete() {
|
package/package.json
CHANGED