refactor(shopAdmin): 重构管理员页面
- 新增 SuperAdmin 和 Admin 组件 - 优化管理员列表展示逻辑 - 添加超级管理员单独展示区域 -调整新建按钮文字为"添加" - 移除不必要的注释代码
This commit is contained in:
41
src/views/shop/shopAdmin/components/super-admin.vue
Normal file
41
src/views/shop/shopAdmin/components/super-admin.vue
Normal file
@@ -0,0 +1,41 @@
|
||||
<template>
|
||||
<a-card title="管理员" style="margin-bottom: 20px">
|
||||
<div class="title flex flex-col">
|
||||
<div class="text-gray-400 pb-2">系统所有者,拥有全部权限</div>
|
||||
</div>
|
||||
<div v-if="item" class="bg-gray-50 rounded-lg w-80 p-4 flex justify-between items-center">
|
||||
<a-space>
|
||||
<a-avatar size="large" :src="item.avatar"/>
|
||||
<div class="text-gray-400 flex flex-col">
|
||||
<span>{{ item.nickname }}</span>
|
||||
<span>{{ item.createTime }}</span>
|
||||
</div>
|
||||
</a-space>
|
||||
<a>更换</a>
|
||||
</div>
|
||||
</a-card>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import {ref, onMounted} from 'vue';
|
||||
import {
|
||||
listUsers
|
||||
} from '@/api/system/user';
|
||||
import {User} from "@/api/system/user/model";
|
||||
|
||||
const item = ref<User>();
|
||||
|
||||
const reload = async () => {
|
||||
const list = await listUsers({
|
||||
isSuperAdmin: true
|
||||
});
|
||||
console.log(list)
|
||||
if (list.length > 0) {
|
||||
item.value = list[0];
|
||||
}
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
reload();
|
||||
})
|
||||
</script>
|
||||
Reference in New Issue
Block a user