From d1a4e4870809b76d44c66ea76c3b06f09ff72e68 Mon Sep 17 00:00:00 2001 From: simple321vip Date: Sun, 29 Jan 2023 20:12:16 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E6=97=A5=E5=8E=86=E7=BB=84?= =?UTF-8?q?=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- mock/calendar.ts | 30 +++++++ mock/onenote.ts | 28 ++++++ src/api/calendar.ts | 21 +++++ src/components/layout/Layout.vue | 3 + src/components/layout/MainApp.vue | 8 +- src/components/layout/NavBar.vue | 17 ++++ src/entity/index.ts | 8 +- src/router/index.ts | 7 ++ src/service/calendar.ts | 14 +++ src/store/modules/settings.ts | 6 ++ src/utils/date.ts | 10 ++- src/utils/number.ts | 12 ++- src/view/calendar/index.vue | 138 +++++++++++++++++++++++++++++- src/view/settings/index.vue | 26 ++++++ 14 files changed, 319 insertions(+), 9 deletions(-) create mode 100644 mock/calendar.ts create mode 100644 mock/onenote.ts create mode 100644 src/api/calendar.ts create mode 100644 src/service/calendar.ts create mode 100644 src/view/settings/index.vue diff --git a/mock/calendar.ts b/mock/calendar.ts new file mode 100644 index 0000000..06a8c4d --- /dev/null +++ b/mock/calendar.ts @@ -0,0 +1,30 @@ +import { MockMethod } from 'vite-plugin-mock' + +export default [ + { + url: '/calendar/api/v1/event', + method: 'get', + response: () => { + return [ + { + date: '2023-01-09', + title: '春游', + eventInfo: '春节不觉晓,处处闻啼鸟,夜来风雨声,花落知多少', + }, + { + date: '2023-01-30', + title: '月底发工资', + eventInfo: '发了工资少一半,还了信用卡再少一半,试问如何攒下钱,只有两个字:做梦', + } + ] + } + }, + { + url: '/calendar/api/v1/event', + method: 'put', + response: () => { + return { + } + } + }, +] as MockMethod[] \ No newline at end of file diff --git a/mock/onenote.ts b/mock/onenote.ts new file mode 100644 index 0000000..9b0bbf6 --- /dev/null +++ b/mock/onenote.ts @@ -0,0 +1,28 @@ +import { MockMethod } from 'vite-plugin-mock' + +export default [ + { + url: '/onenote/api/v1/one_note', + method: 'get', + response: () => { + return [ + { + section_id: 'x111', + section_name: 'A', + page_list: [ + { + page_id: 'y111', + section_id: 'x111', + page_name: 'B', + }, + { + page_id: 'y222', + section_id: 'x111', + page_name: 'C', + }, + ] + } + ] + } + } +] as MockMethod[] \ No newline at end of file diff --git a/src/api/calendar.ts b/src/api/calendar.ts new file mode 100644 index 0000000..5f96db8 --- /dev/null +++ b/src/api/calendar.ts @@ -0,0 +1,21 @@ +import { service } from '../utils/request' + +const put_event = (data: Object) => { + return service({ + url: '/calendar/api/v1/event', + method: 'PUT', + data: data + }) +} + +const get_event = () => { + return service({ + url: '/calendar/api/v1/event', + method: 'GET', + }) +} + +export { + get_event, + put_event, +} \ No newline at end of file diff --git a/src/components/layout/Layout.vue b/src/components/layout/Layout.vue index e37b7d9..9b89b2b 100644 --- a/src/components/layout/Layout.vue +++ b/src/components/layout/Layout.vue @@ -82,13 +82,16 @@ iniPage() .el-main { padding: 16px; + overflow: hidden; } .el-aside { margin-left: -10px; + background: #191a23; } .el-footer { + margin-top: 20px; display: flex; justify-content: space-around; } diff --git a/src/components/layout/MainApp.vue b/src/components/layout/MainApp.vue index 6e9a73b..2e47e2a 100644 --- a/src/components/layout/MainApp.vue +++ b/src/components/layout/MainApp.vue @@ -1,10 +1,14 @@ \ No newline at end of file diff --git a/src/view/settings/index.vue b/src/view/settings/index.vue new file mode 100644 index 0000000..42356fc --- /dev/null +++ b/src/view/settings/index.vue @@ -0,0 +1,26 @@ + + + + + \ No newline at end of file