diff --git a/src/pages/base/index.vue b/src/pages/base/index.vue
index d25e603..93fb9a2 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} = storeToRefs(store);
+const {user, theme,isAdministrator} = storeToRefs(store);
function changeTheme(newTheme: string) {
theme.value = newTheme;
@@ -25,13 +25,21 @@ function changeTheme(newTheme: string) {
+
+
+    借阅者
+
+
+    管理员
+
+
-
-
-
+
+
+
@@ -44,12 +52,12 @@ function changeTheme(newTheme: string) {
-
-
-
-
-
-
+
+
+
+
+
+
@@ -145,6 +153,7 @@ function changeTheme(newTheme: string) {
width: 100%;
overflow: auto;
}
+
/* 设置滚动条的宽度和高度 */
::-webkit-scrollbar {
width: 12px;
diff --git a/src/pages/record/modules/recordTable.vue b/src/pages/record/modules/recordTable.vue
index e8148a5..0a4f6c2 100644
--- a/src/pages/record/modules/recordTable.vue
+++ b/src/pages/record/modules/recordTable.vue
@@ -4,6 +4,8 @@ import SuperTable from "@/components/super-table.vue";
import type {TableProps} from "tdesign-vue-next";
import {ref} from "vue";
import {useRecordStore} from "@/store/modules/record.ts";
+import {useUserStore} from "@/store";
+import {storeToRefs} from "pinia";
/*
{
@@ -14,6 +16,8 @@ import {useRecordStore} from "@/store/modules/record.ts";
},
*/
const data = useRecordStore().infos;
+const {isAdministrator} = storeToRefs(useUserStore());
+console.log(isAdministrator.value)
const columns = ref([
{
colKey: "title",
@@ -31,6 +35,13 @@ const columns = ref([
colKey: "status",
title: "状态",
cell: (_, row: any) => GetTypeHtml(row!)
+ },
+ {
+ colKey: "operation",
+ title: "操作",
+ fixed: 'right',
+ width: 150,
+ cell: () => GetOperationHtml()
}
]);
@@ -50,6 +61,13 @@ function GetTypeHtml({row: {status}}: { row: { status: string } }) {
}
}
+
+function GetOperationHtml() {
+ if (!isAdministrator.value)
+ return 归还
+ return 取消预订
+}
+
const configurableColumns = ref(['title', 'borrow_date', 'due_date', 'status']);
const indexColumns = ref(['title', 'borrow_date', 'due_date', 'status']);
const defaultDisplayColumns = ref([...configurableColumns.value]);
@@ -61,7 +79,8 @@ const pagination = ref({
-
+