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 CHANGED
@@ -7,7 +7,7 @@
7
7
  "dependencies": [
8
8
  "@nuxt/ui"
9
9
  ],
10
- "version": "0.2.28",
10
+ "version": "0.2.29",
11
11
  "builder": {
12
12
  "@nuxt/module-builder": "1.0.2",
13
13
  "unbuild": "3.6.1"
@@ -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
- <TableQueryWhere
55
- :where-query="whereQuery"
56
- :where-options="whereQueryOptions"
57
- :trigger-fetching="async () => {
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
- hide-query-button
60
- @update-where-query="(newWhereQuery) => whereQuery = newWhereQuery"
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "v-nuxt-ui",
3
- "version": "0.2.28",
3
+ "version": "0.2.29",
4
4
  "description": "Veken UI Component Library - Reusable Nuxt UI components, composables, and utilities for enterprise applications",
5
5
  "type": "module",
6
6
  "style": "./dist/runtime/index.css",