签入版本

This commit is contained in:
2026-10-10 12:20:37 +08:00
parent f54d7735b0
commit 49b04a1ec4
108 changed files with 1459 additions and 1982 deletions
@@ -82,34 +82,34 @@ src/views/
```vue
<template>
<!-- 搜索区 -->
<el-form :model="searchForm" inline>
<el-form-item label="名称">
<el-input v-model="searchForm.name" />
</el-form-item>
<el-form-item>
<el-button type="primary" @click="fetchData">搜索</el-button>
</el-form-item>
</el-form>
<a-form :model="searchForm" layout="inline">
<a-form-item label="名称">
<a-input v-model:value="searchForm.name" allow-clear />
</a-form-item>
<a-form-item>
<a-button type="primary" @click="fetchData">搜索</a-button>
</a-form-item>
</a-form>
<!-- 操作栏 -->
<el-button v-perm="'sys:example:add'" type="primary" @click="handleAdd">新增</el-button>
<a-button v-perm="'sys:example:add'" type="primary" @click="handleAdd">新增</a-button>
<!-- 数据表格 -->
<el-table :data="tableData">
<el-table-column prop="id" label="ID" />
<el-table-column prop="name" label="名称" />
<el-table-column prop="statusText" label="状态" />
<el-table-column label="操作">
<template #default="{ row }">
<el-button v-perm="'sys:example:update'" @click="handleEdit(row)">编辑</el-button>
<el-button v-perm="'sys:example:delete'" type="danger" @click="handleDelete(row.id)">删除</el-button>
<a-table :data-source="tableData" :pagination="false" :row-key="(row) => row.id">
<a-table-column title="ID" data-index="id" />
<a-table-column title="名称" data-index="name" />
<a-table-column title="状态" data-index="statusText" />
<a-table-column title="操作">
<template #bodyCell="{ record }">
<a-button v-perm="'sys:example:update'" type="link" @click="handleEdit(record)">编辑</a-button>
<a-button v-perm="'sys:example:delete'" danger type="link" @click="handleDelete(record.id)">删除</a-button>
</template>
</el-table-column>
</el-table>
</a-table-column>
</a-table>
<!-- 分页 -->
<el-pagination v-model:current-page="pageNo" v-model:page-size="pageSize"
:total="total" @change="fetchData" />
<a-pagination v-model:current="pageNo" v-model:page-size="pageSize"
:total="total" show-total @change="fetchData" />
</template>
<script setup lang="ts">
@@ -312,10 +312,10 @@ src/utils/http/axios/
```vue
<!-- v-perm:单权限 -->
<el-button v-perm="'sys:user:add'" type="primary">新增</el-button>
<a-button v-perm="'sys:user:add'" type="primary">新增</a-button>
<!-- v-perms:多权限(满足任一即可) -->
<el-button v-perms="['sys:user:add', 'sys:user:update']">操作</el-button>
<a-button v-perms="['sys:user:add', 'sys:user:update']">操作</a-button>
```
无权限时元素直接从 DOM 移除,而非仅隐藏。