v-nuxt-ui 0.2.33 → 0.3.0
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/AsyncSelect.vue +13 -2
- package/dist/runtime/components/ScrollArea.vue +2 -2
- package/dist/runtime/components/Select.vue +13 -2
- package/dist/runtime/components/Watermark.d.vue.ts +2 -2
- package/dist/runtime/components/Watermark.vue.d.ts +2 -2
- package/dist/runtime/components/button/Confirm.d.vue.ts +22 -0
- package/dist/runtime/components/button/Confirm.vue +47 -0
- package/dist/runtime/components/button/Confirm.vue.d.ts +22 -0
- package/dist/runtime/components/button/Theme.vue +7 -13
- package/dist/runtime/components/date-picker/Input.d.vue.ts +1 -0
- package/dist/runtime/components/date-picker/Input.vue +12 -3
- package/dist/runtime/components/date-picker/Input.vue.d.ts +1 -0
- package/dist/runtime/components/form/save-modal-template/WithApi.vue +1 -2
- package/dist/runtime/components/form/save-modal-template/index.vue +23 -23
- package/dist/runtime/components/layout/button/ThemePicker.vue +2 -2
- package/dist/runtime/components/layout/default.vue +10 -4
- package/dist/runtime/components/simple-table/index.d.vue.ts +1 -1
- package/dist/runtime/components/simple-table/index.vue +72 -1
- package/dist/runtime/components/simple-table/index.vue.d.ts +1 -1
- package/dist/runtime/components/sys/department/SaveModal.vue +0 -1
- package/dist/runtime/components/sys/flow/EditNodeModal.vue +5 -4
- package/dist/runtime/components/sys/flow/SaveModal.vue +0 -1
- package/dist/runtime/components/sys/menu/SaveModal.vue +0 -1
- package/dist/runtime/components/sys/role/SaveModal.vue +0 -1
- package/dist/runtime/components/sys/table/SaveModal.vue +0 -1
- package/dist/runtime/components/sys/table/TableColumnModal.vue +5 -4
- package/dist/runtime/components/sys/user/SaveModal.vue +0 -1
- package/dist/runtime/components/sys/user/Table.vue +19 -29
- package/dist/runtime/components/table/Page.vue +23 -2
- package/dist/runtime/components/table/Pagination.vue +1 -1
- package/dist/runtime/components/table/header/index.vue +231 -84
- package/dist/runtime/components/table/header/settings/columns/DndList.d.vue.ts +1 -0
- package/dist/runtime/components/table/header/settings/columns/DndList.vue +3 -1
- package/dist/runtime/components/table/header/settings/columns/DndList.vue.d.ts +1 -0
- package/dist/runtime/components/table/header/settings/columns/Item.d.vue.ts +1 -0
- package/dist/runtime/components/table/header/settings/columns/Item.vue +7 -3
- package/dist/runtime/components/table/header/settings/columns/Item.vue.d.ts +1 -0
- package/dist/runtime/components/table/header/settings/columns/index.d.vue.ts +3 -3
- package/dist/runtime/components/table/header/settings/columns/index.vue +7 -5
- package/dist/runtime/components/table/header/settings/columns/index.vue.d.ts +3 -3
- package/dist/runtime/components/table/header/settings/index.d.vue.ts +3 -2
- package/dist/runtime/components/table/header/settings/index.vue +5 -4
- package/dist/runtime/components/table/header/settings/index.vue.d.ts +3 -2
- package/dist/runtime/components/table/query/order/Newer.d.vue.ts +1 -0
- package/dist/runtime/components/table/query/order/Newer.vue +9 -2
- package/dist/runtime/components/table/query/order/Newer.vue.d.ts +1 -0
- package/dist/runtime/components/table/query/order/index.vue +46 -54
- package/dist/runtime/components/table/query/order/{Item.d.vue.ts → item.d.vue.ts} +2 -0
- package/dist/runtime/components/table/query/order/{Item.vue → item.vue} +25 -17
- package/dist/runtime/components/table/query/order/{Item.vue.d.ts → item.vue.d.ts} +2 -0
- package/dist/runtime/components/table/query/where/Newer.vue +2 -2
- package/dist/runtime/components/table/query/where/index.vue +90 -77
- package/dist/runtime/components/table/query/where/simple/item/ColumnPicker.vue +8 -7
- package/dist/runtime/components/table/query/where/simple/item/OprPicker.d.vue.ts +1 -0
- package/dist/runtime/components/table/query/where/simple/item/OprPicker.vue +6 -1
- package/dist/runtime/components/table/query/where/simple/item/OprPicker.vue.d.ts +1 -0
- package/dist/runtime/components/table/query/where/simple/item/index.d.vue.ts +3 -1
- package/dist/runtime/components/table/query/where/simple/item/index.vue +84 -39
- package/dist/runtime/components/table/query/where/simple/item/index.vue.d.ts +3 -1
- package/dist/runtime/components/table/query/where/simple/item/opr/AsyncSelect.vue +0 -1
- package/dist/runtime/components/table/query/where/simple/item/opr/DatePicker.d.vue.ts +1 -0
- package/dist/runtime/components/table/query/where/simple/item/opr/DatePicker.vue +42 -40
- package/dist/runtime/components/table/query/where/simple/item/opr/DatePicker.vue.d.ts +1 -0
- package/dist/runtime/components/table/query/where/simple/item/opr/Input.vue +3 -0
- package/dist/runtime/components/table/query/where/simple/item/opr/InputNumber.vue +0 -1
- package/dist/runtime/components/table/query/where/simple/item/opr/Select.vue +0 -1
- package/dist/runtime/components/table/query/where/simple/item/opr/index.vue +3 -0
- package/dist/runtime/composables/api/useApi.js +1 -0
- package/dist/runtime/composables/form/useForm.d.ts +2 -2
- package/dist/runtime/composables/form/useForm.js +10 -9
- package/dist/runtime/composables/table/useTable.js +9 -1
- package/dist/runtime/composables/table/useTableColumns.d.ts +1 -1
- package/dist/runtime/composables/table/useTableColumns.js +2 -2
- package/dist/runtime/composables/table/useTableQuery.d.ts +1 -0
- package/dist/runtime/composables/table/useTableQuery.js +8 -3
- package/dist/runtime/composables/table/useTableView.js +209 -11
- package/dist/runtime/composables/useTheme.js +10 -3
- package/dist/runtime/constants/columns.js +6 -6
- package/dist/runtime/types/components/form/index.d.ts +1 -1
- package/dist/runtime/types/components/table/column.d.ts +3 -1
- package/dist/runtime/types/components/table/header.d.ts +3 -1
- package/dist/runtime/types/components/table/query/order.d.ts +2 -0
- package/dist/runtime/types/components/table/query/where.d.ts +0 -1
- package/dist/runtime/types/query.d.ts +1 -0
- package/dist/runtime/types/storage.d.ts +1 -0
- package/package.json +1 -1
- package/dist/runtime/components/form/save-model-template/ConfirmUpdateModal.d.vue.ts +0 -19
- package/dist/runtime/components/form/save-model-template/ConfirmUpdateModal.vue +0 -111
- package/dist/runtime/components/form/save-model-template/ConfirmUpdateModal.vue.d.ts +0 -19
- package/dist/runtime/components/form/save-model-template/WithApi.d.vue.ts +0 -19
- package/dist/runtime/components/form/save-model-template/WithApi.vue +0 -37
- package/dist/runtime/components/form/save-model-template/WithApi.vue.d.ts +0 -19
- package/dist/runtime/components/form/save-model-template/index.d.vue.ts +0 -21
- package/dist/runtime/components/form/save-model-template/index.vue +0 -123
- package/dist/runtime/components/form/save-model-template/index.vue.d.ts +0 -21
|
@@ -1,10 +1,14 @@
|
|
|
1
1
|
<script setup>
|
|
2
|
-
defineProps({
|
|
2
|
+
const props = defineProps({
|
|
3
3
|
columns: { type: Array, required: true },
|
|
4
4
|
stgCol: { type: Object, required: true },
|
|
5
|
-
onFixCol: { type: Function, required: true }
|
|
5
|
+
onFixCol: { type: Function, required: true },
|
|
6
|
+
onToggleChecked: { type: Function, required: false }
|
|
6
7
|
});
|
|
7
8
|
const checked = defineModel("checked", { type: Boolean, skipCheck: true, ...{ required: true } });
|
|
9
|
+
function handleToggleChecked() {
|
|
10
|
+
props.onToggleChecked?.(props.stgCol);
|
|
11
|
+
}
|
|
8
12
|
</script>
|
|
9
13
|
|
|
10
14
|
<template>
|
|
@@ -51,7 +55,7 @@ const checked = defineModel("checked", { type: Boolean, skipCheck: true, ...{ re
|
|
|
51
55
|
variant="ghost"
|
|
52
56
|
size="xs"
|
|
53
57
|
color="neutral"
|
|
54
|
-
@click="
|
|
58
|
+
@click="handleToggleChecked"
|
|
55
59
|
/>
|
|
56
60
|
</UTooltip>
|
|
57
61
|
</div>
|
|
@@ -5,6 +5,7 @@ declare const __VLS_export: <T>(__VLS_props: NonNullable<Awaited<typeof __VLS_se
|
|
|
5
5
|
columns: VColumn<T>[];
|
|
6
6
|
stgCol: Column;
|
|
7
7
|
onFixCol: (col: Column, fixType: FixType) => void;
|
|
8
|
+
onToggleChecked?: (col: Column) => void;
|
|
8
9
|
} & {
|
|
9
10
|
checked: boolean | undefined;
|
|
10
11
|
}) & {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import type { VColumn } from '#v/types';
|
|
1
|
+
import type { Column, VColumn } from '#v/types';
|
|
2
2
|
export type FixType = 'left' | 'right' | 'unfixed';
|
|
3
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<{
|
|
4
4
|
props: import("vue").PublicProps & __VLS_PrettifyLocal<{
|
|
5
|
-
|
|
5
|
+
name: string;
|
|
6
6
|
rawBizColumns: VColumn<T>[];
|
|
7
|
-
onUpdateBizColumns: (cols: VColumn<T>[]) => void;
|
|
7
|
+
onUpdateBizColumns: (cols: VColumn<T>[], storageColumns?: Column[]) => void;
|
|
8
8
|
}> & (typeof globalThis extends {
|
|
9
9
|
__VLS_PROPS_FALLBACK: infer P;
|
|
10
10
|
} ? P : {});
|
|
@@ -3,11 +3,11 @@ import { ref, computed, onMounted } from "vue";
|
|
|
3
3
|
import { useLocalStorage } from "@vueuse/core";
|
|
4
4
|
import TableHeaderSettingsColumnsDndList from "#v/components/table/header/settings/columns/DndList.vue";
|
|
5
5
|
const props = defineProps({
|
|
6
|
-
|
|
6
|
+
name: { type: String, required: true },
|
|
7
7
|
rawBizColumns: { type: Array, required: true },
|
|
8
8
|
onUpdateBizColumns: { type: Function, required: true }
|
|
9
9
|
});
|
|
10
|
-
const localTblSettings = useLocalStorage(`${props.
|
|
10
|
+
const localTblSettings = useLocalStorage(`${props.name}-table-settings`, {});
|
|
11
11
|
function getFullColumns(stgCols) {
|
|
12
12
|
const bizKeys = props.rawBizColumns.map((col) => col["accessorKey"]);
|
|
13
13
|
const stgColsFiltered = (stgCols ?? []).filter((s) => bizKeys.includes(s.accessorKey));
|
|
@@ -85,9 +85,11 @@ function syncToParentAndStorage() {
|
|
|
85
85
|
...allColumns.value.filter((c) => c.fixed === "right")
|
|
86
86
|
];
|
|
87
87
|
localTblSettings.value = { ...localTblSettings.value, columns: ordered };
|
|
88
|
-
const
|
|
89
|
-
|
|
90
|
-
|
|
88
|
+
const sortedBizColumns = ordered.map((settingCol) => {
|
|
89
|
+
const bizCol = props.rawBizColumns.find((col) => col["accessorKey"] === settingCol.accessorKey);
|
|
90
|
+
return bizCol ? { ...bizCol, checked: settingCol.checked } : void 0;
|
|
91
|
+
}).filter(Boolean);
|
|
92
|
+
props.onUpdateBizColumns(sortedBizColumns, ordered);
|
|
91
93
|
}
|
|
92
94
|
onMounted(() => {
|
|
93
95
|
syncToParentAndStorage();
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import type { VColumn } from '#v/types';
|
|
1
|
+
import type { Column, VColumn } from '#v/types';
|
|
2
2
|
export type FixType = 'left' | 'right' | 'unfixed';
|
|
3
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<{
|
|
4
4
|
props: import("vue").PublicProps & __VLS_PrettifyLocal<{
|
|
5
|
-
|
|
5
|
+
name: string;
|
|
6
6
|
rawBizColumns: VColumn<T>[];
|
|
7
|
-
onUpdateBizColumns: (cols: VColumn<T>[]) => void;
|
|
7
|
+
onUpdateBizColumns: (cols: VColumn<T>[], storageColumns?: Column[]) => void;
|
|
8
8
|
}> & (typeof globalThis extends {
|
|
9
9
|
__VLS_PROPS_FALLBACK: infer P;
|
|
10
10
|
} ? P : {});
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import type { VColumn } from '#v/types';
|
|
1
|
+
import type { Column, VColumn } from '#v/types';
|
|
2
2
|
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
3
|
props: import("vue").PublicProps & __VLS_PrettifyLocal<{
|
|
4
|
+
name: string;
|
|
4
5
|
tblName: string;
|
|
5
6
|
rawBizColumns: VColumn<T>[];
|
|
6
|
-
onUpdateBizColumns: (cols: VColumn<T>[]) => void;
|
|
7
|
+
onUpdateBizColumns: (cols: VColumn<T>[], storageColumns?: Column[]) => void;
|
|
7
8
|
} & {
|
|
8
9
|
onClose?: ((args_0: boolean) => any) | undefined;
|
|
9
10
|
}> & (typeof globalThis extends {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
<script setup>
|
|
2
2
|
import TableHeaderSettingsColumns from "#v/components/table/header/settings/columns/index.vue";
|
|
3
3
|
defineProps({
|
|
4
|
+
name: { type: String, required: true },
|
|
4
5
|
tblName: { type: String, required: true },
|
|
5
6
|
rawBizColumns: { type: Array, required: true },
|
|
6
7
|
onUpdateBizColumns: { type: Function, required: true }
|
|
@@ -11,20 +12,20 @@ const emit = defineEmits(["close"]);
|
|
|
11
12
|
<template>
|
|
12
13
|
<USlideover
|
|
13
14
|
:title="`${tblName}\u8BBE\u7F6E`"
|
|
14
|
-
description="
|
|
15
|
+
description="通过拖拽调整顺序,使用右侧按钮固定或隐藏列"
|
|
15
16
|
inset
|
|
16
17
|
:close="{ onClick: () => emit('close', false) }"
|
|
17
18
|
>
|
|
18
19
|
<template #body>
|
|
19
20
|
<TableHeaderSettingsColumns
|
|
20
21
|
:raw-biz-columns="rawBizColumns"
|
|
21
|
-
:
|
|
22
|
-
|
|
22
|
+
:name="name"
|
|
23
|
+
:on-update-biz-columns="onUpdateBizColumns"
|
|
23
24
|
/>
|
|
24
25
|
</template>
|
|
25
26
|
<template #footer>
|
|
26
27
|
<UButton
|
|
27
|
-
label="
|
|
28
|
+
label="关闭"
|
|
28
29
|
color="neutral"
|
|
29
30
|
variant="subtle"
|
|
30
31
|
icon="i-lucide-x"
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import type { VColumn } from '#v/types';
|
|
1
|
+
import type { Column, VColumn } from '#v/types';
|
|
2
2
|
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
3
|
props: import("vue").PublicProps & __VLS_PrettifyLocal<{
|
|
4
|
+
name: string;
|
|
4
5
|
tblName: string;
|
|
5
6
|
rawBizColumns: VColumn<T>[];
|
|
6
|
-
onUpdateBizColumns: (cols: VColumn<T>[]) => void;
|
|
7
|
+
onUpdateBizColumns: (cols: VColumn<T>[], storageColumns?: Column[]) => void;
|
|
7
8
|
} & {
|
|
8
9
|
onClose?: ((args_0: boolean) => any) | undefined;
|
|
9
10
|
}> & (typeof globalThis extends {
|
|
@@ -4,6 +4,7 @@ declare const __VLS_export: <T>(__VLS_props: NonNullable<Awaited<typeof __VLS_se
|
|
|
4
4
|
options: OrderQueryOption<T>[];
|
|
5
5
|
unselectedFields: string[];
|
|
6
6
|
bizColumns: VColumn<T>[];
|
|
7
|
+
disabled?: boolean;
|
|
7
8
|
} & {
|
|
8
9
|
onNew?: ((args_0: string) => any) | undefined;
|
|
9
10
|
}> & (typeof globalThis extends {
|
|
@@ -3,7 +3,8 @@ import { ref, computed } from "vue";
|
|
|
3
3
|
const props = defineProps({
|
|
4
4
|
options: { type: Array, required: true },
|
|
5
5
|
unselectedFields: { type: Array, required: true },
|
|
6
|
-
bizColumns: { type: Array, required: true }
|
|
6
|
+
bizColumns: { type: Array, required: true },
|
|
7
|
+
disabled: { type: Boolean, required: false }
|
|
7
8
|
});
|
|
8
9
|
const emit = defineEmits(["new"]);
|
|
9
10
|
const popoverOpen = ref(false);
|
|
@@ -11,7 +12,7 @@ const unselectedOptions = computed(() => {
|
|
|
11
12
|
const options = [
|
|
12
13
|
{
|
|
13
14
|
id: "unselected-fields",
|
|
14
|
-
label: "\u65B0\u589E\
|
|
15
|
+
label: "\u65B0\u589E\u6392\u5E8F\u5B57\u6BB5",
|
|
15
16
|
items: props.unselectedFields.map((field) => {
|
|
16
17
|
const option = props.options.find((option2) => option2.field === field);
|
|
17
18
|
const column = props.bizColumns.find((column2) => column2["accessorKey"] === field);
|
|
@@ -35,13 +36,19 @@ const unselectedOptions = computed(() => {
|
|
|
35
36
|
size="sm"
|
|
36
37
|
icon="i-lucide-plus"
|
|
37
38
|
variant="ghost"
|
|
39
|
+
square
|
|
40
|
+
:disabled="disabled"
|
|
38
41
|
>
|
|
39
42
|
新增排序条件
|
|
40
43
|
</UButton>
|
|
41
44
|
|
|
42
45
|
<template #content>
|
|
43
46
|
<UCommandPalette
|
|
47
|
+
size="sm"
|
|
44
48
|
:groups="unselectedOptions"
|
|
49
|
+
:input="{
|
|
50
|
+
size: 'xs'
|
|
51
|
+
}"
|
|
45
52
|
:ui="{ input: '[&>input]:h-8 [&>input]:text-sm' }"
|
|
46
53
|
placeholder="搜索未选字段"
|
|
47
54
|
/>
|
|
@@ -4,6 +4,7 @@ declare const __VLS_export: <T>(__VLS_props: NonNullable<Awaited<typeof __VLS_se
|
|
|
4
4
|
options: OrderQueryOption<T>[];
|
|
5
5
|
unselectedFields: string[];
|
|
6
6
|
bizColumns: VColumn<T>[];
|
|
7
|
+
disabled?: boolean;
|
|
7
8
|
} & {
|
|
8
9
|
onNew?: ((args_0: string) => any) | undefined;
|
|
9
10
|
}> & (typeof globalThis extends {
|
|
@@ -1,14 +1,16 @@
|
|
|
1
1
|
<script setup>
|
|
2
2
|
import { compareObjArrays } from "#v/utils";
|
|
3
|
-
import { computed
|
|
3
|
+
import { computed } from "vue";
|
|
4
4
|
import Dnd from "#v/components/Dnd.client.vue";
|
|
5
|
-
import TableQueryOrderItem from "#v/components/table/query/order/
|
|
5
|
+
import TableQueryOrderItem from "#v/components/table/query/order/item.vue";
|
|
6
6
|
import TableQueryOrderNewer from "#v/components/table/query/order/Newer.vue";
|
|
7
7
|
const props = defineProps({
|
|
8
8
|
orderOptions: { type: Array, required: true },
|
|
9
9
|
defaultOrderQuery: { type: Array, required: false },
|
|
10
10
|
orderQuery: { type: Array, required: true },
|
|
11
11
|
onUpdateOrderQuery: { type: Function, required: true },
|
|
12
|
+
orderQueryOpen: { type: Boolean, required: false },
|
|
13
|
+
onUpdateOrderQueryOpen: { type: Function, required: false },
|
|
12
14
|
fetching: { type: Boolean, required: false },
|
|
13
15
|
triggerFetching: { type: Function, required: true },
|
|
14
16
|
bizColumns: { type: Array, required: true },
|
|
@@ -47,62 +49,52 @@ const dragOrderQuery = computed({
|
|
|
47
49
|
onUpdateAndTriggerFetching(newOrderQuery);
|
|
48
50
|
}
|
|
49
51
|
});
|
|
50
|
-
const open = ref(false);
|
|
51
52
|
</script>
|
|
52
53
|
|
|
53
54
|
<template>
|
|
54
|
-
<
|
|
55
|
-
<
|
|
55
|
+
<div class="flex flex-col p-4 gap-2.5">
|
|
56
|
+
<div class="font-bold text-xs text-dimmed">
|
|
57
|
+
排序条件
|
|
58
|
+
</div>
|
|
59
|
+
<Dnd
|
|
60
|
+
v-if="dragOrderQuery.length > 0"
|
|
61
|
+
v-model="dragOrderQuery"
|
|
62
|
+
handle=".order-query-handle"
|
|
63
|
+
class="flex flex-col gap-2.5"
|
|
64
|
+
>
|
|
65
|
+
<TableQueryOrderItem
|
|
66
|
+
v-for="item in dragOrderQuery"
|
|
67
|
+
:key="item.field"
|
|
68
|
+
:field="item.field"
|
|
69
|
+
:biz-columns="bizColumns"
|
|
70
|
+
:opr="item.order"
|
|
71
|
+
:order-options="orderOptions"
|
|
72
|
+
:unselected-fields="unselectedOrderFields"
|
|
73
|
+
:disabled="fetching"
|
|
74
|
+
handle-class-name="order-query-handle"
|
|
75
|
+
@change="(newField, orderType) => onChangeField(item.field, newField, orderType)"
|
|
76
|
+
@remove="onRemoveField(item.field)"
|
|
77
|
+
/>
|
|
78
|
+
</Dnd>
|
|
79
|
+
<div class="flex flex-col">
|
|
80
|
+
<TableQueryOrderNewer
|
|
81
|
+
:options="orderOptions"
|
|
82
|
+
:unselected-fields="unselectedOrderFields"
|
|
83
|
+
:biz-columns="bizColumns"
|
|
84
|
+
:disabled="fetching"
|
|
85
|
+
@new="onNewField"
|
|
86
|
+
/>
|
|
56
87
|
<UButton
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
:
|
|
88
|
+
size="sm"
|
|
89
|
+
color="neutral"
|
|
90
|
+
variant="ghost"
|
|
91
|
+
square
|
|
92
|
+
:disabled="isOrderQueryDefault || fetching"
|
|
93
|
+
icon="i-lucide-timer-reset"
|
|
94
|
+
@click="() => onUpdateAndTriggerFetching(defaultOrderQuery ?? [])"
|
|
62
95
|
>
|
|
63
|
-
|
|
96
|
+
重置
|
|
64
97
|
</UButton>
|
|
65
|
-
</
|
|
66
|
-
|
|
67
|
-
<div class="flex flex-col gap-2 p-2">
|
|
68
|
-
<!-- items -->
|
|
69
|
-
<Dnd
|
|
70
|
-
v-if="dragOrderQuery.length > 0"
|
|
71
|
-
v-model="dragOrderQuery"
|
|
72
|
-
handle=".order-query-handle"
|
|
73
|
-
class="flex flex-col gap-2"
|
|
74
|
-
>
|
|
75
|
-
<TableQueryOrderItem
|
|
76
|
-
v-for="item in dragOrderQuery"
|
|
77
|
-
:key="item.field"
|
|
78
|
-
:field="item.field"
|
|
79
|
-
:biz-columns="bizColumns"
|
|
80
|
-
:opr="item.order"
|
|
81
|
-
:order-options="orderOptions"
|
|
82
|
-
:unselected-fields="unselectedOrderFields"
|
|
83
|
-
@change="(newField, orderType) => onChangeField(item.field, newField, orderType)"
|
|
84
|
-
@remove="onRemoveField(item.field)"
|
|
85
|
-
/>
|
|
86
|
-
</Dnd>
|
|
87
|
-
<div class="flex flex-col">
|
|
88
|
-
<TableQueryOrderNewer
|
|
89
|
-
:options="orderOptions"
|
|
90
|
-
:unselected-fields="unselectedOrderFields"
|
|
91
|
-
:biz-columns="bizColumns"
|
|
92
|
-
@new="onNewField"
|
|
93
|
-
/>
|
|
94
|
-
<UButton
|
|
95
|
-
size="sm"
|
|
96
|
-
color="neutral"
|
|
97
|
-
variant="ghost"
|
|
98
|
-
:disabled="isOrderQueryDefault || fetching"
|
|
99
|
-
icon="i-lucide-timer-reset"
|
|
100
|
-
@click="() => onUpdateAndTriggerFetching(defaultOrderQuery ?? [])"
|
|
101
|
-
>
|
|
102
|
-
重置
|
|
103
|
-
</UButton>
|
|
104
|
-
</div>
|
|
105
|
-
</div>
|
|
106
|
-
</template>
|
|
107
|
-
</UPopover>
|
|
98
|
+
</div>
|
|
99
|
+
</div>
|
|
108
100
|
</template>
|
|
@@ -6,6 +6,8 @@ declare const __VLS_export: <T>(__VLS_props: NonNullable<Awaited<typeof __VLS_se
|
|
|
6
6
|
opr: OrderQueryOpr;
|
|
7
7
|
orderOptions: OrderQueryOption<T>[];
|
|
8
8
|
unselectedFields: string[];
|
|
9
|
+
handleClassName?: string;
|
|
10
|
+
disabled?: boolean;
|
|
9
11
|
} & {
|
|
10
12
|
onChange?: ((args_0: string, args_1: OrderQueryOpr) => any) | undefined;
|
|
11
13
|
onRemove?: (() => any) | undefined;
|
|
@@ -5,7 +5,9 @@ const props = defineProps({
|
|
|
5
5
|
bizColumns: { type: Array, required: true },
|
|
6
6
|
opr: { type: [String, null], required: true },
|
|
7
7
|
orderOptions: { type: Array, required: true },
|
|
8
|
-
unselectedFields: { type: Array, required: true }
|
|
8
|
+
unselectedFields: { type: Array, required: true },
|
|
9
|
+
handleClassName: { type: String, required: false },
|
|
10
|
+
disabled: { type: Boolean, required: false }
|
|
9
11
|
});
|
|
10
12
|
const emit = defineEmits(["change", "remove"]);
|
|
11
13
|
const selectedValue = computed({
|
|
@@ -45,19 +47,26 @@ const onToggleOrderType = () => {
|
|
|
45
47
|
</script>
|
|
46
48
|
|
|
47
49
|
<template>
|
|
48
|
-
<
|
|
49
|
-
<
|
|
50
|
-
|
|
51
|
-
|
|
50
|
+
<UFieldGroup size="sm">
|
|
51
|
+
<UButton
|
|
52
|
+
variant="outline"
|
|
53
|
+
icon="i-lucide-grip-vertical"
|
|
54
|
+
color="neutral"
|
|
55
|
+
class="cursor-move hover:bg-default active:bg-default"
|
|
56
|
+
:class="handleClassName"
|
|
57
|
+
:disabled="disabled"
|
|
58
|
+
/>
|
|
52
59
|
<UDropdownMenu
|
|
53
60
|
:items="unselectedOptions"
|
|
61
|
+
size="sm"
|
|
54
62
|
:ui="{ content: 'w-54' }"
|
|
63
|
+
:disabled="disabled"
|
|
55
64
|
>
|
|
56
65
|
<UButton
|
|
57
66
|
variant="outline"
|
|
58
67
|
color="neutral"
|
|
59
68
|
size="sm"
|
|
60
|
-
|
|
69
|
+
:disabled="disabled"
|
|
61
70
|
>
|
|
62
71
|
{{ selectedLabel }}
|
|
63
72
|
</UButton>
|
|
@@ -67,19 +76,18 @@ const onToggleOrderType = () => {
|
|
|
67
76
|
color="neutral"
|
|
68
77
|
variant="outline"
|
|
69
78
|
size="sm"
|
|
79
|
+
:disabled="disabled"
|
|
70
80
|
@click="onToggleOrderType"
|
|
71
81
|
>
|
|
72
82
|
{{ props.opr === "asc" ? "\u5347\u5E8F" : "\u964D\u5E8F" }}
|
|
73
83
|
</UButton>
|
|
74
|
-
<
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
</UTooltip>
|
|
84
|
-
</div>
|
|
84
|
+
<UButton
|
|
85
|
+
size="xs"
|
|
86
|
+
icon="i-lucide-x"
|
|
87
|
+
variant="outline"
|
|
88
|
+
color="neutral"
|
|
89
|
+
:disabled="disabled"
|
|
90
|
+
@click="emit('remove')"
|
|
91
|
+
/>
|
|
92
|
+
</UFieldGroup>
|
|
85
93
|
</template>
|
|
@@ -6,6 +6,8 @@ declare const __VLS_export: <T>(__VLS_props: NonNullable<Awaited<typeof __VLS_se
|
|
|
6
6
|
opr: OrderQueryOpr;
|
|
7
7
|
orderOptions: OrderQueryOption<T>[];
|
|
8
8
|
unselectedFields: string[];
|
|
9
|
+
handleClassName?: string;
|
|
10
|
+
disabled?: boolean;
|
|
9
11
|
} & {
|
|
10
12
|
onChange?: ((args_0: string, args_1: OrderQueryOpr) => any) | undefined;
|
|
11
13
|
onRemove?: (() => any) | undefined;
|
|
@@ -35,14 +35,14 @@ const unselectedOptions = computed(() => {
|
|
|
35
35
|
});
|
|
36
36
|
const items = [];
|
|
37
37
|
if (commonFields.length > 0) {
|
|
38
|
-
items.push({ type: "label", label: "\u5E38\u7528\u6761\u4EF6" });
|
|
38
|
+
items.push({ type: "label", label: "\u5E38\u7528\u67E5\u8BE2\u6761\u4EF6" });
|
|
39
39
|
commonFields.forEach((field) => items.push(buildFieldItem(field)));
|
|
40
40
|
}
|
|
41
41
|
if (otherFields.length > 0) {
|
|
42
42
|
if (items.length > 0) {
|
|
43
43
|
items.push({ type: "separator" });
|
|
44
44
|
}
|
|
45
|
-
items.push({ type: "label", label: "\u5176\u4ED6\u6761\u4EF6" });
|
|
45
|
+
items.push({ type: "label", label: "\u5176\u4ED6\u67E5\u8BE2\u6761\u4EF6" });
|
|
46
46
|
otherFields.forEach((field) => items.push(buildFieldItem(field)));
|
|
47
47
|
}
|
|
48
48
|
return items;
|