diff --git a/src/api/menu.ts b/src/api/menu.ts index 17ba631..2250495 100644 --- a/src/api/menu.ts +++ b/src/api/menu.ts @@ -37,3 +37,13 @@ export function Edit(info: MenuItem) { export function Del(ids: number[]) { return http.request>("post", `Menu/Del`, { data: ids }); } +/**获取角色的菜单 */ +export function RoleMenu(roleId: number) { + return http.request>("get", `MenuRelation/RoleMenu?roleId=${roleId}`); +} +/**修改角色菜单 */ +export function SetMenu(data: { roleId: number; menuId: number[] }) { + return http.request>("post", `MenuRelation/SetMenu`, { + data: data + }); +} diff --git a/src/api/toschoolinfomanage.ts b/src/api/toschoolinfomanage.ts index 7ff18ec..c48da1f 100644 --- a/src/api/toschoolinfomanage.ts +++ b/src/api/toschoolinfomanage.ts @@ -55,4 +55,25 @@ export function getSchoolBusinessPeopleListApi(data: object) { return http.request>("post", `/Admin/QueryCombo`, { data }); +} +/** + * @description 导入excel + * @return {object} + */ +export function importExcel(file: File) { + let formData = new FormData(); + formData.append("file", file); + return http.request( + "post", + `SchoolBusiness/Import`, + { + data: formData + }, + { + headers: { + "Content-Type": "application/x-www-form-urlencoded" + }, + responseType: "blob" + } + ); } \ No newline at end of file diff --git a/src/layout/components/lay-navbar/index.vue b/src/layout/components/lay-navbar/index.vue index 07cb985..787c5b1 100644 --- a/src/layout/components/lay-navbar/index.vue +++ b/src/layout/components/lay-navbar/index.vue @@ -19,7 +19,7 @@ const { userName, userAvatar, avatarsStyle, - toggleSideBar + toggleSideBar, } = useNav(); @@ -45,7 +45,7 @@ const { - + @@ -55,20 +55,13 @@ const { - + diff --git a/src/layout/components/lay-notice/index.vue b/src/layout/components/lay-notice/index.vue index 55baa69..d250e20 100644 --- a/src/layout/components/lay-notice/index.vue +++ b/src/layout/components/lay-notice/index.vue @@ -8,11 +8,10 @@ const noticesNum = ref(0); const notices = ref(noticesData); const activeKey = ref(noticesData[0]?.key); -notices.value.map(v => (noticesNum.value += v.list.length)); +notices.value.map((v) => (noticesNum.value += v.list.length)); -const getLabel = computed( - () => item => - item.name + (item.list.length > 0 ? `(${item.list.length})` : "") +const getLabel = computed(() => (item) => + item.name + (item.list.length > 0 ? `(${item.list.length})` : "") ); @@ -23,7 +22,7 @@ const getLabel = computed( 'dropdown-badge', 'navbar-bg-hover', 'select-none', - Number(noticesNum) !== 0 && 'mr-[10px]' + Number(noticesNum) !== 0 && 'mr-[10px]', ]" > @@ -40,11 +39,7 @@ const getLabel = computed( class="dropdown-tabs" :style="{ width: notices.length === 0 ? '200px' : '330px' }" > - +