chore: 优化部分代码

This commit is contained in:
2024-12-12 21:20:32 +08:00
parent 53fd8a465a
commit 030dedebbd
2 changed files with 8 additions and 8 deletions

View File

@@ -40,9 +40,7 @@
<template v-if="selectedKeys.length > 0"> <template v-if="selectedKeys.length > 0">
已选中 {{ selectedKeys.length }} 条记录(可跨页) 已选中 {{ selectedKeys.length }} 条记录(可跨页)
</template> </template>
<template v-else> <template v-else>未选中任何记录</template>
未选中任何记录
</template>
<template v-if="selectedKeys.length > 0" #action> <template v-if="selectedKeys.length > 0" #action>
<a-link @click="onClearSelected">清空</a-link> <a-link @click="onClearSelected">清空</a-link>
</template> </template>

View File

@@ -36,14 +36,16 @@
</a-button> </a-button>
</template> </template>
<template #toolbar-right> <template #toolbar-right>
<a-button type="primary" status="danger" :disabled="!selectedKeys.length" @click="onDelete"> <a-button type="primary" status="danger" :disabled="!selectedKeys.length" :title="!selectedKeys.length ? '请选择' : ''" @click="onDelete">
<template #icon><icon-delete /></template> <template #icon><icon-delete /></template>
<span>删除</span> <template #default>删除</template>
</a-button> </a-button>
<a-button type="primary" :disabled="!selectedKeys.length" @click="onRead"> <a-button type="primary" :disabled="!selectedKeys.length" :title="!selectedKeys.length ? '请选择' : ''" @click="onRead">
<span>标记为已读</span> <template #default>标记为已读</template>
</a-button>
<a-button type="primary" :disabled="selectedKeys.length" :title="!selectedKeys.length ? '请选择' : ''" @click="onReadAll">
<template #default>全部已读</template>
</a-button> </a-button>
<a-button type="primary" :disabled="selectedKeys.length" @click="onReadAll">全部已读</a-button>
</template> </template>
<template #title="{ record }"> <template #title="{ record }">
<a-tooltip :content="record.content"><span>{{ record.title }}</span></a-tooltip> <a-tooltip :content="record.content"><span>{{ record.title }}</span></a-tooltip>