diff --git a/src/main/index.ts b/src/main/index.ts index 2d42d11..9ff274d 100644 --- a/src/main/index.ts +++ b/src/main/index.ts @@ -42,7 +42,8 @@ function createWindow(): void { }, vibrancy: 'fullscreen-ui', // bug trace: https://github.com/electron/electron/issues/38466#issuecomment-2576225294 - backgroundMaterial: 'tabbed' + backgroundMaterial: 'tabbed', + maximizable: false }) mainWindow.on('ready-to-show', () => { diff --git a/src/renderer/src/views/panel/PanelIndex.vue b/src/renderer/src/views/panel/PanelIndex.vue index 0b2e7c7..d34add6 100644 --- a/src/renderer/src/views/panel/PanelIndex.vue +++ b/src/renderer/src/views/panel/PanelIndex.vue @@ -21,14 +21,17 @@ import { useGlobalStore } from '@renderer/store' import { storeToRefs } from 'pinia' import { computed, ref } from 'vue' -import { IGoal } from '@renderer/types' +import { IGoal, ICourse } from '@renderer/types' +import { InfoFilled, Plus } from '@element-plus/icons-vue' const store = useGlobalStore() const { courseInfo } = storeToRefs(store) +const tempCourseInfo = ref({ ...store.courseInfo! }) const tempGoal = ref({ importance: 'H', indicator: '', target: '' }) const tempGoalList = ref(store.goals) const showAddGoal = ref(false) +const showEditCourse = ref(false) const addGoalSubmit = computed(() => !Object.values(tempGoal.value).every((v) => v)) @@ -54,44 +57,95 @@ const handleAddGoalSubmit = () => { const handleDeleteGoal = (idx: number) => { tempGoalList.value.splice(idx, 1) } + +const handleEditCourse = (action: 'save' | 'cancel') => { + if (action === 'save') { + store.saveCourseInfo(tempCourseInfo.value) + tempCourseInfo.value = { ...store.courseInfo! } + } else if (action === 'cancel') { + tempCourseInfo.value = { ...store.courseInfo! } + } + showEditCourse.value = false +}