fix(web-antdv-next): TableAction 和 AI 菜单使用 MenuItem 并修正 Dropdown trigger
parent
d3bcfd7177
commit
4f5caf1566
|
|
@ -11,7 +11,15 @@ import { IconifyIcon } from '@vben/icons';
|
||||||
import { $t } from '@vben/locales';
|
import { $t } from '@vben/locales';
|
||||||
import { isBoolean, isFunction } from '@vben/utils';
|
import { isBoolean, isFunction } from '@vben/utils';
|
||||||
|
|
||||||
import { Button, Dropdown, Menu, Popconfirm, Space, Tooltip } from 'antdv-next';
|
import {
|
||||||
|
Button,
|
||||||
|
Dropdown,
|
||||||
|
Menu,
|
||||||
|
MenuItem,
|
||||||
|
Popconfirm,
|
||||||
|
Space,
|
||||||
|
Tooltip,
|
||||||
|
} from 'antdv-next';
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
actions: {
|
actions: {
|
||||||
|
|
@ -188,7 +196,7 @@ watch(
|
||||||
</slot>
|
</slot>
|
||||||
<template #popupRender>
|
<template #popupRender>
|
||||||
<Menu>
|
<Menu>
|
||||||
<Menu.Item
|
<MenuItem
|
||||||
v-for="(action, index) in getDropdownList"
|
v-for="(action, index) in getDropdownList"
|
||||||
:key="index"
|
:key="index"
|
||||||
:disabled="action.disabled"
|
:disabled="action.disabled"
|
||||||
|
|
@ -225,7 +233,7 @@ watch(
|
||||||
{{ action.label }}
|
{{ action.label }}
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
</Menu.Item>
|
</MenuItem>
|
||||||
</Menu>
|
</Menu>
|
||||||
</template>
|
</template>
|
||||||
</Dropdown>
|
</Dropdown>
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,7 @@ import { ref } from 'vue';
|
||||||
|
|
||||||
import { IconifyIcon } from '@vben/icons';
|
import { IconifyIcon } from '@vben/icons';
|
||||||
|
|
||||||
import { Avatar, Button, Card, Dropdown, Menu } from 'antdv-next';
|
import { Avatar, Button, Card, Dropdown, Menu, MenuItem } from 'antdv-next';
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
loading: {
|
loading: {
|
||||||
|
|
@ -103,18 +103,18 @@ async function handleTabsScroll() {
|
||||||
</Button>
|
</Button>
|
||||||
<template #popupRender>
|
<template #popupRender>
|
||||||
<Menu>
|
<Menu>
|
||||||
<Menu.Item @click="handleMoreClick(['delete', role])">
|
<MenuItem @click="handleMoreClick(['delete', role])">
|
||||||
<div class="flex items-center">
|
<div class="flex items-center">
|
||||||
<IconifyIcon icon="lucide:trash" color="red" />
|
<IconifyIcon icon="lucide:trash" color="red" />
|
||||||
<span class="ml-2 text-red-500">删除</span>
|
<span class="ml-2 text-red-500">删除</span>
|
||||||
</div>
|
</div>
|
||||||
</Menu.Item>
|
</MenuItem>
|
||||||
<Menu.Item @click="handleMoreClick(['edit', role])">
|
<MenuItem @click="handleMoreClick(['edit', role])">
|
||||||
<div class="flex items-center">
|
<div class="flex items-center">
|
||||||
<IconifyIcon icon="lucide:edit" color="#787878" />
|
<IconifyIcon icon="lucide:edit" color="#787878" />
|
||||||
<span class="ml-2 text-primary">编辑</span>
|
<span class="ml-2 text-primary">编辑</span>
|
||||||
</div>
|
</div>
|
||||||
</Menu.Item>
|
</MenuItem>
|
||||||
</Menu>
|
</Menu>
|
||||||
</template>
|
</template>
|
||||||
</Dropdown>
|
</Dropdown>
|
||||||
|
|
|
||||||
|
|
@ -12,6 +12,7 @@ import {
|
||||||
Form,
|
Form,
|
||||||
InputNumber,
|
InputNumber,
|
||||||
Menu,
|
Menu,
|
||||||
|
MenuItem,
|
||||||
message,
|
message,
|
||||||
Tooltip,
|
Tooltip,
|
||||||
} from 'antdv-next';
|
} from 'antdv-next';
|
||||||
|
|
@ -207,7 +208,7 @@ onMounted(async () => {
|
||||||
<div class="mb-2.5">
|
<div class="mb-2.5">
|
||||||
<Dropdown
|
<Dropdown
|
||||||
v-if="modelData.list && modelData.list.length > 0"
|
v-if="modelData.list && modelData.list.length > 0"
|
||||||
trigger="click"
|
:trigger="['click']"
|
||||||
>
|
>
|
||||||
<div class="flex cursor-pointer items-center">
|
<div class="flex cursor-pointer items-center">
|
||||||
<IconifyIcon icon="lucide:file-text" class="mr-1" />
|
<IconifyIcon icon="lucide:file-text" class="mr-1" />
|
||||||
|
|
@ -222,7 +223,7 @@ onMounted(async () => {
|
||||||
</div>
|
</div>
|
||||||
<template #popupRender>
|
<template #popupRender>
|
||||||
<Menu>
|
<Menu>
|
||||||
<Menu.Item
|
<MenuItem
|
||||||
v-for="(file, index) in modelData.list"
|
v-for="(file, index) in modelData.list"
|
||||||
:key="index"
|
:key="index"
|
||||||
@click="selectFile(index)"
|
@click="selectFile(index)"
|
||||||
|
|
@ -231,7 +232,7 @@ onMounted(async () => {
|
||||||
<span v-if="file.segments" class="ml-1 text-sm text-gray-500">
|
<span v-if="file.segments" class="ml-1 text-sm text-gray-500">
|
||||||
({{ file.segments.length }} 个分片)
|
({{ file.segments.length }} 个分片)
|
||||||
</span>
|
</span>
|
||||||
</Menu.Item>
|
</MenuItem>
|
||||||
</Menu>
|
</Menu>
|
||||||
</template>
|
</template>
|
||||||
</Dropdown>
|
</Dropdown>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue