diff --git a/src/pages/base/index.vue b/src/pages/base/index.vue index 93fb9a2..7387247 100644 --- a/src/pages/base/index.vue +++ b/src/pages/base/index.vue @@ -3,7 +3,7 @@ import {useUserStore} from "@/store"; import {storeToRefs} from "pinia"; let store = useUserStore(); -const {user, theme,isAdministrator} = storeToRefs(store); +const {user, theme, identity} = storeToRefs(store); function changeTheme(newTheme: string) { theme.value = newTheme; @@ -26,11 +26,17 @@ function changeTheme(newTheme: string) {

欢迎回来:{{ user }}

- +    借阅者 - -    管理员 + +    图书管理员 + + +    系统管理员
@@ -58,26 +64,62 @@ function changeTheme(newTheme: string) { - + 图书列表 + :to="'/base/reservation'" v-if="identity === 'user' || identity==='admin'"> 预定列表 + :to="'/base/record'" v-if="identity === 'user'"> 借阅记录 + + + 借书 + + + + 还书 + + + + + + 人员管理 + + + + 图书管理 + + + + 修改历史 + @@ -93,7 +135,8 @@ function changeTheme(newTheme: string) { - Copyright @ 2024-2024 AlexJR?. All Rights Reserved
由TDesign强力驱动 + Copyright @ 2024-2024 沈嘉瑞 吴肸昊 谢清华 杨可. All Rights + Reserved
diff --git a/src/pages/borrow/index.vue b/src/pages/borrow/index.vue new file mode 100644 index 0000000..3a24d42 --- /dev/null +++ b/src/pages/borrow/index.vue @@ -0,0 +1,55 @@ + + + + \ No newline at end of file diff --git a/src/pages/peopleManage/index.vue b/src/pages/peopleManage/index.vue new file mode 100644 index 0000000..ab32145 --- /dev/null +++ b/src/pages/peopleManage/index.vue @@ -0,0 +1,28 @@ + + + + \ No newline at end of file diff --git a/src/pages/peopleManage/modules/peopleTable.vue b/src/pages/peopleManage/modules/peopleTable.vue new file mode 100644 index 0000000..69e3a1d --- /dev/null +++ b/src/pages/peopleManage/modules/peopleTable.vue @@ -0,0 +1,76 @@ + + + + + \ No newline at end of file diff --git a/src/pages/record/index.vue b/src/pages/record/index.vue index db16d88..b3fa751 100644 --- a/src/pages/record/index.vue +++ b/src/pages/record/index.vue @@ -12,7 +12,6 @@ const lightTheme = computed(() => theme.value === 'light'); diff --git a/src/pages/record/modules/recordTable.vue b/src/pages/record/modules/recordTable.vue index 0a4f6c2..9ff6fc7 100644 --- a/src/pages/record/modules/recordTable.vue +++ b/src/pages/record/modules/recordTable.vue @@ -16,8 +16,7 @@ import {storeToRefs} from "pinia"; }, */ const data = useRecordStore().infos; -const {isAdministrator} = storeToRefs(useUserStore()); -console.log(isAdministrator.value) +const {identity} = storeToRefs(useUserStore()); const columns = ref([ { colKey: "title", @@ -63,19 +62,22 @@ function GetTypeHtml({row: {status}}: { row: { status: string } }) { } function GetOperationHtml() { - if (!isAdministrator.value) - return 归还 - return 取消预订 + switch (identity.value) { + case 'user': + return 续借 + case 'admin': + return 取消预订 + } } const configurableColumns = ref(['title', 'borrow_date', 'due_date', 'status']); const indexColumns = ref(['title', 'borrow_date', 'due_date', 'status']); -const defaultDisplayColumns = ref([...configurableColumns.value]); -const pagination = ref({ - defaultPageSize: 10, - total: 10, - defaultCurrent: 1, -}) +// const defaultDisplayColumns = ref([...configurableColumns.value]); +// const pagination = ref({ +// defaultPageSize: 10, +// total: 10, +// defaultCurrent: 1, +// })