💬 更新前端表格选择方式和提示信息

This commit is contained in:
Bunny 2025-07-01 16:37:37 +08:00
parent 2e714dc080
commit 9b6938b46e
2 changed files with 9 additions and 9 deletions

View File

@ -24,11 +24,11 @@ const MainCard = defineComponent({
<p class="card-subtitle mt-2 text-muted">
<i class="bi bi-mouse me-1"></i>
点击 <code class="bg-primary bg-opacity-10">表名</code>
<code class="bg-primary bg-opacity-10">生成</code>
<code class="bg-primary bg-opacity-10">生成</code>
</p>
</div>
<!-- 代码仓库链接区域包含GitHub和Gitee仓库链接 -->
<!-- 代码仓库链接区域包含GitHub和Gitee仓库链接 -->
<div class="card-body">
<div class="d-flex flex-wrap align-items-center gap-3">
<!-- GitHub 仓库链接 -->

View File

@ -57,19 +57,19 @@ const MainTable = defineComponent({
<tr :key="table.tableName" v-for="(table, index) in paginatedTableList">
<td>
<input class="form-check-input border-secondary" type="checkbox"
v-model="table.checked" @change="onSelectTable($event, table)">
v-model="table.checked" @change="onSelectTable($event.target.checked, table)">
</td>
<td>{{ (currentPage - 1) * itemsPerPage + index + 1 }}</td>
<td>
<a class="text-decoration-none" href="#" @click.prevent="onGeneratorCode(table)">
<a class="text-decoration-none" href="#" @click.prevent="onSelectTable(!table.checked, table)">
{{ table.tableName }}
</a>
</td>
<td>{{ table.comment || '无注释' }}</td>
<td>{{ table.tableCat }}</td>
<td class="text-center">
<button class="btn btn-sm btn-outline-primary" @click="onGeneratorCode(table)">
<i class="bi bi-gear"></i>
<button class="btn btn-sm btn-outline-primary" @click="onSelectTable(!table.checked, table)">
<i class="bi bi-gear"></i>
</button>
</td>
</tr>
@ -249,11 +249,11 @@ const MainTable = defineComponent({
/**
* 选择单个表
* @param {Event} event - 事件对象
* @param {Boolean} checked - 事件对象
* @param {Object} table - 表数据对象
*/
onSelectTable(event, table) {
table.checked = event.target.checked;
onSelectTable(checked, table) {
table.checked = checked;
this.updateFormSelectedTables();
// 更新表头全选状态