diff --git a/backend/src/views/tools/notebook/components/edit.vue b/backend/src/views/tools/notebook/components/edit.vue
index f25e9a7..06f353e 100644
--- a/backend/src/views/tools/notebook/components/edit.vue
+++ b/backend/src/views/tools/notebook/components/edit.vue
@@ -15,6 +15,16 @@
+
+
+
+
@@ -38,6 +48,7 @@ const emit = defineEmits(['save-success', 'create-success']);
const noteTitle = ref('');
const noteContent = ref('');
+const pinned = ref(false);
const loading = ref(false);
const isNew = ref(false);
@@ -47,6 +58,7 @@ const loadNote = async () => {
isNew.value = true;
noteTitle.value = '新建笔记';
noteContent.value = '';
+ pinned.value = false;
return;
}
@@ -58,6 +70,7 @@ const loadNote = async () => {
if (response.code === 200) {
noteTitle.value = response.data.title || '无标题';
noteContent.value = response.data.content || '';
+ pinned.value = Number(response.data.pinned) === 1;
} else {
ElMessage.error('加载笔记失败');
}
@@ -84,6 +97,7 @@ const handleSave = async () => {
const response = await createNotebook({
title: noteTitle.value,
content: noteContent.value,
+ pinned: pinned.value ? 1 : 0,
});
if (response.code === 200) {
@@ -98,6 +112,7 @@ const handleSave = async () => {
const response = await updateNotebook(props.noteId, {
title: noteTitle.value,
content: noteContent.value,
+ pinned: pinned.value ? 1 : 0,
});
if (response.code === 200) {
@@ -175,6 +190,15 @@ onMounted(() => {
}
}
+.editor-toolbar {
+ min-height: 42px;
+ padding: 8px 20px;
+ display: flex;
+ align-items: center;
+ border-bottom: 1px solid var(--el-border-color-lighter);
+ background: var(--el-bg-color);
+}
+
.editor-body {
flex: 1;
padding: 20px;
diff --git a/backend/src/views/tools/notebook/index.vue b/backend/src/views/tools/notebook/index.vue
index 6252f37..ffd7836 100644
--- a/backend/src/views/tools/notebook/index.vue
+++ b/backend/src/views/tools/notebook/index.vue
@@ -28,6 +28,15 @@
>
+
+
+
+
@@ -38,6 +48,7 @@ const emit = defineEmits(['save-success', 'create-success']);
const noteTitle = ref('');
const noteContent = ref('');
+const pinned = ref(false);
const loading = ref(false);
const isNew = ref(false);
@@ -47,6 +58,7 @@ const loadNote = async () => {
isNew.value = true;
noteTitle.value = '新建笔记';
noteContent.value = '';
+ pinned.value = false;
return;
}
@@ -58,6 +70,7 @@ const loadNote = async () => {
if (response.code === 200) {
noteTitle.value = response.data.title || '无标题';
noteContent.value = response.data.content || '';
+ pinned.value = Number(response.data.pinned) === 1;
} else {
ElMessage.error('加载笔记失败');
}
@@ -84,6 +97,7 @@ const handleSave = async () => {
const response = await createNotebook({
title: noteTitle.value,
content: noteContent.value,
+ pinned: pinned.value ? 1 : 0,
});
if (response.code === 200) {
@@ -98,6 +112,7 @@ const handleSave = async () => {
const response = await updateNotebook(props.noteId, {
title: noteTitle.value,
content: noteContent.value,
+ pinned: pinned.value ? 1 : 0,
});
if (response.code === 200) {
@@ -175,6 +190,15 @@ onMounted(() => {
}
}
+.editor-toolbar {
+ min-height: 42px;
+ padding: 8px 20px;
+ display: flex;
+ align-items: center;
+ border-bottom: 1px solid var(--el-border-color-lighter);
+ background: var(--el-bg-color);
+}
+
.editor-body {
flex: 1;
padding: 20px;
diff --git a/platform/src/views/tools/notebook/index.vue b/platform/src/views/tools/notebook/index.vue
index e09913a..c7148e8 100644
--- a/platform/src/views/tools/notebook/index.vue
+++ b/platform/src/views/tools/notebook/index.vue
@@ -28,6 +28,15 @@
>