角色列表接口完成

This commit is contained in:
2026-08-18 15:54:56 +08:00
parent bf355b3fbf
commit b8571da035
4 changed files with 37 additions and 20 deletions
+7 -17
View File
@@ -5,6 +5,7 @@ import { Icon } from '@iconify/vue'
import { useThemeStore } from '@/store/modules/theme';
import { useRouter } from 'vue-router';
import { NButton, NPopconfirm } from 'naive-ui';
import { roleListApi } from '@/service/api/role';
const router = useRouter();
const appStore = useAppStore();
@@ -100,28 +101,17 @@ const columns = ref([
}
},
])
const list = ref<{ id: number, name: string }[]>([])
const list = ref<{ id: number, name: string, intro: string, perms: string[] }[]>([])
// 获取列表
const getList = async () => {
loading.value = true;
setTimeout(() => {
try {
const res = await roleListApi();
list.value = res.data;
} finally {
loading.value = false;
list.value = [
{id:1,name:'角色名称1'},
{id:2,name:'角色名称2'},
{id:3,name:'角色名称3'},
{id:4,name:'角色名称4'},
{id:5,name:'角色名称5'},
{id:6,name:'角色名称6'},
{id:7,name:'角色名称7'},
{id:8,name:'角色名称8'},
{id:9,name:'角色名称9'},
{id:10,name:'角色名称10'},
{id:11,name:'角色名称11'},
{id:12,name:'角色名称12'},
]
}, 1000)
}
}
// 打开添加角色弹框