v-nuxt-ui 0.2.18 → 0.2.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.
- package/dist/module.json +1 -1
- package/dist/runtime/components/sys/user/Table.vue +1 -0
- package/dist/runtime/components/table/query/where/index.vue +4 -3
- package/dist/runtime/composables/table/useTable.js +1 -0
- package/dist/runtime/composables/useEChart.js +10 -4
- package/dist/runtime/types/components/table/query/where.d.ts +1 -0
- package/package.json +1 -1
package/dist/module.json
CHANGED
|
@@ -6,6 +6,7 @@ import TableQueryWhereSimpleItem from "#v/components/table/query/where/simple/it
|
|
|
6
6
|
import TableQueryWhereNewer from "#v/components/table/query/where/Newer.vue";
|
|
7
7
|
const props = defineProps({
|
|
8
8
|
whereOptions: { type: Array, required: true },
|
|
9
|
+
extraWhereQueryInitValues: { type: Object, required: false },
|
|
9
10
|
defaultWhereQuery: { type: Object, required: false },
|
|
10
11
|
whereQuery: { type: null, required: true },
|
|
11
12
|
onUpdateWhereQuery: { type: Function, required: true },
|
|
@@ -66,9 +67,9 @@ const isWhereQueryEmpty = computed(() => {
|
|
|
66
67
|
return !props.whereQuery || Object.keys(props.whereQuery ?? {}).length === 0 || // 仅检查有对应option的item的值是否为空
|
|
67
68
|
(props.whereQuery?.items?.filter((query) => props.whereOptions.find((option) => option.field === query.field)).length ?? 0) === 0 && (props.whereQuery?.groups?.length ?? 0) === 0;
|
|
68
69
|
});
|
|
69
|
-
const
|
|
70
|
+
const whereQueryWithoutInitValues = computed(() => {
|
|
70
71
|
if (!props.whereQuery) return [];
|
|
71
|
-
const defaultKeys = props.
|
|
72
|
+
const defaultKeys = props.extraWhereQueryInitValues?.items?.map((query) => query.field) ?? [];
|
|
72
73
|
return props.whereQuery.items?.filter((query) => {
|
|
73
74
|
const field = query.field;
|
|
74
75
|
return !defaultKeys.includes(field);
|
|
@@ -92,7 +93,7 @@ defineExpose({ focusField });
|
|
|
92
93
|
<!-- key如果是field,那么field修改后,不能聚焦后面的组件,所以这里的key用idx代替 -->
|
|
93
94
|
<template v-if="!isWhereQueryEmpty">
|
|
94
95
|
<TableQueryWhereSimpleItem
|
|
95
|
-
v-for="(item, idx) in
|
|
96
|
+
v-for="(item, idx) in whereQueryWithoutInitValues"
|
|
96
97
|
:ref="(el) => setItemRef(item.field, el)"
|
|
97
98
|
:key="idx"
|
|
98
99
|
:where-query-item="item"
|
|
@@ -254,6 +254,7 @@ export function useTable(props) {
|
|
|
254
254
|
}));
|
|
255
255
|
const tblWhereQueryProps = computed(() => ({
|
|
256
256
|
whereOptions: whereQueryOptions.value,
|
|
257
|
+
extraWhereQueryInitValues,
|
|
257
258
|
defaultWhereQuery: whereQueryInitValues.value,
|
|
258
259
|
whereQuery: whereQuery.value,
|
|
259
260
|
onUpdateWhereQuery: (query) => whereQuery.value = query,
|
|
@@ -241,12 +241,18 @@ const _useEChart = () => {
|
|
|
241
241
|
enableXAxis = true,
|
|
242
242
|
enableYAxis = true
|
|
243
243
|
} = config;
|
|
244
|
-
const
|
|
244
|
+
const hasXAxisOption = option?.xAxis !== void 0;
|
|
245
|
+
const hasYAxisOption = option?.yAxis !== void 0;
|
|
246
|
+
let commonOption = defu(
|
|
245
247
|
getCommonGridOption(),
|
|
246
|
-
getCommonLegendOption()
|
|
247
|
-
getCommonXAxisOption(enableXAxis),
|
|
248
|
-
getCommonYAxisOption(enableYAxis)
|
|
248
|
+
getCommonLegendOption()
|
|
249
249
|
);
|
|
250
|
+
if (enableXAxis || hasXAxisOption) {
|
|
251
|
+
commonOption = defu(commonOption, getCommonXAxisOption(enableXAxis));
|
|
252
|
+
}
|
|
253
|
+
if (enableYAxis || hasYAxisOption) {
|
|
254
|
+
commonOption = defu(commonOption, getCommonYAxisOption(enableYAxis));
|
|
255
|
+
}
|
|
250
256
|
const merged = defu(option, commonOption);
|
|
251
257
|
if (merged.xAxis && Array.isArray(merged.xAxis) && merged.xAxis.length > 1) {
|
|
252
258
|
const xAxisDefaults = getCommonXAxisOption(enableXAxis).xAxis;
|
|
@@ -5,6 +5,7 @@ export type WhereQueryOption<T> = {
|
|
|
5
5
|
} & WhereQueryColumnOption<T>;
|
|
6
6
|
export type WhereQueryProps<T> = {
|
|
7
7
|
whereOptions: WhereQueryOption<T>[];
|
|
8
|
+
extraWhereQueryInitValues?: WhereQuery<T>;
|
|
8
9
|
defaultWhereQuery?: WhereQuery<T>;
|
|
9
10
|
whereQuery: WhereQuery<T> | undefined;
|
|
10
11
|
onUpdateWhereQuery: (query: WhereQuery<T> | undefined) => void;
|
package/package.json
CHANGED