This commit is contained in:
parent
207913a253
commit
ccf101167a
|
@ -35,8 +35,7 @@
|
||||||
<el-row>
|
<el-row>
|
||||||
<el-col :span="24">
|
<el-col :span="24">
|
||||||
<div class="table-part">
|
<div class="table-part">
|
||||||
<el-table v-loading="loading" :data="tableData"
|
<el-table v-loading="loading" :data="tableData" class="user-table" border max-height="700px">
|
||||||
class="user-table" border max-height="700px">
|
|
||||||
<el-table-column v-if="getColumnVisibility('selection')" type="selection"
|
<el-table-column v-if="getColumnVisibility('selection')" type="selection"
|
||||||
min-width="55"></el-table-column>
|
min-width="55"></el-table-column>
|
||||||
<el-table-column v-if="getColumnVisibility('id')" prop="id" label="序号"
|
<el-table-column v-if="getColumnVisibility('id')" prop="id" label="序号"
|
||||||
|
@ -45,11 +44,20 @@
|
||||||
min-width="180"></el-table-column>
|
min-width="180"></el-table-column>
|
||||||
<el-table-column v-if="getColumnVisibility('email')" prop="email" label="邮箱"
|
<el-table-column v-if="getColumnVisibility('email')" prop="email" label="邮箱"
|
||||||
min-width="200"></el-table-column>
|
min-width="200"></el-table-column>
|
||||||
<el-table-column v-if="getColumnVisibility('actions')" label="操作" min-width="200" align="center">
|
<el-table-column v-if="getColumnVisibility('actions')" label="操作" min-width="200"
|
||||||
|
align="center">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<el-button type="text" size="small"
|
<el-tooltip v-if="scope.row.isLocked" content="此用户无法被编辑或删除">
|
||||||
@click="showEditUserDialog(scope.row)">编辑</el-button>
|
<el-button type="text" size="small" disabled>
|
||||||
<el-button type="text" size="small" @click="confirmDelete(scope.row)">删除</el-button>
|
编辑
|
||||||
|
</el-button>
|
||||||
|
</el-tooltip>
|
||||||
|
<el-button v-else type="text" size="small" @click="showEditUserDialog(scope.row)">
|
||||||
|
编辑
|
||||||
|
</el-button>
|
||||||
|
<el-button type="text" size="small" :disabled="scope.row.isLocked"
|
||||||
|
@click="confirmDelete(scope.row)">删除
|
||||||
|
</el-button>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
|
@ -138,9 +146,10 @@ const refreshTable = async () => {
|
||||||
try {
|
try {
|
||||||
const users = await apiInstance.getAllUsers(); // 调用getAllUsers方法获取用户
|
const users = await apiInstance.getAllUsers(); // 调用getAllUsers方法获取用户
|
||||||
tableData.value = users.map((user: any, index: number) => ({
|
tableData.value = users.map((user: any, index: number) => ({
|
||||||
id: index + 1, // 增加id索引
|
id: index + 1,
|
||||||
username: user.username,
|
username: user.username,
|
||||||
email: user.email
|
email: user.email,
|
||||||
|
isLocked: ['turingvideo'].includes(user.username)
|
||||||
}));
|
}));
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
ElMessage.error('刷新用户列表失败');
|
ElMessage.error('刷新用户列表失败');
|
||||||
|
|
Loading…
Reference in New Issue