💬 更新前端表格选择方式和提示信息
This commit is contained in:
parent
2e714dc080
commit
9b6938b46e
|
@ -24,11 +24,11 @@ const MainCard = defineComponent({
|
||||||
<p class="card-subtitle mt-2 text-muted">
|
<p class="card-subtitle mt-2 text-muted">
|
||||||
<i class="bi bi-mouse me-1"></i>
|
<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> 进行跳转
|
<code class="bg-primary bg-opacity-10">生成</code> 也可以选择
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- 代码仓库链接区域:包含GitHub和Gitee仓库链接 -->
|
<!-- 代码仓库链接区域:包含GitHub和Gitee仓库链接 -->
|
||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
<div class="d-flex flex-wrap align-items-center gap-3">
|
<div class="d-flex flex-wrap align-items-center gap-3">
|
||||||
<!-- GitHub 仓库链接 -->
|
<!-- GitHub 仓库链接 -->
|
||||||
|
|
|
@ -57,19 +57,19 @@ const MainTable = defineComponent({
|
||||||
<tr :key="table.tableName" v-for="(table, index) in paginatedTableList">
|
<tr :key="table.tableName" v-for="(table, index) in paginatedTableList">
|
||||||
<td>
|
<td>
|
||||||
<input class="form-check-input border-secondary" type="checkbox"
|
<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>
|
||||||
<td>{{ (currentPage - 1) * itemsPerPage + index + 1 }}</td>
|
<td>{{ (currentPage - 1) * itemsPerPage + index + 1 }}</td>
|
||||||
<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 }}
|
{{ table.tableName }}
|
||||||
</a>
|
</a>
|
||||||
</td>
|
</td>
|
||||||
<td>{{ table.comment || '无注释' }}</td>
|
<td>{{ table.comment || '无注释' }}</td>
|
||||||
<td>{{ table.tableCat }}</td>
|
<td>{{ table.tableCat }}</td>
|
||||||
<td class="text-center">
|
<td class="text-center">
|
||||||
<button class="btn btn-sm btn-outline-primary" @click="onGeneratorCode(table)">
|
<button class="btn btn-sm btn-outline-primary" @click="onSelectTable(!table.checked, table)">
|
||||||
<i class="bi bi-gear"></i> 生成
|
<i class="bi bi-gear"></i> 选择
|
||||||
</button>
|
</button>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
@ -249,11 +249,11 @@ const MainTable = defineComponent({
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 选择单个表
|
* 选择单个表
|
||||||
* @param {Event} event - 事件对象
|
* @param {Boolean} checked - 事件对象
|
||||||
* @param {Object} table - 表数据对象
|
* @param {Object} table - 表数据对象
|
||||||
*/
|
*/
|
||||||
onSelectTable(event, table) {
|
onSelectTable(checked, table) {
|
||||||
table.checked = event.target.checked;
|
table.checked = checked;
|
||||||
this.updateFormSelectedTables();
|
this.updateFormSelectedTables();
|
||||||
|
|
||||||
// 更新表头全选状态
|
// 更新表头全选状态
|
||||||
|
|
Loading…
Reference in New Issue