diff --git a/mock/onenote.ts b/mock/onenote.ts index 9b0bbf6..f9db3b2 100644 --- a/mock/onenote.ts +++ b/mock/onenote.ts @@ -2,27 +2,74 @@ import { MockMethod } from 'vite-plugin-mock' export default [ { - url: '/onenote/api/v1/one_note', + url: '/onenote/api/v1/category', 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', - }, - ] - } + category_id: '4444', + category_color: ' #B0E0E6', + category_icon: 'Document', + category_theme: 'WIKI' + }, + { + category_id: '4444', + category_color: ' #B0E0E6', + category_icon: 'Collection', + category_theme: 'Collection' + }, + { + category_id: '4444', + category_color: ' #B0E0E6', + category_icon: 'Files', + category_theme: 'Files' + }, + { + category_id: '4444', + category_color: ' #B0E0E6', + category_icon: 'Phone', + category_theme: 'Phone' + }, ] } + }, + { + url: '/onenote/api/v1/4444/items/', + method: 'get', + response: () => { + return [ + { + item_id: '00001', + item_name: '中国联通', + item_value: '13332247026' + }, + { + item_id: '00002', + item_name: '中国联通副号', + item_value: '13333333333' + }, + ] + } + }, + { + url: '/onenote/api/v1/category', + method: 'put', + response: () => { + return {} + } + }, + { + url: '/onenote/api/v1/item', + method: 'put', + response: () => { + return {} + } + }, + { + url: '/onenote/api/v1/item', + method: 'delete', + response: () => { + return {} + } } ] as MockMethod[] \ No newline at end of file diff --git a/src/api/onenote.ts b/src/api/onenote.ts index 298437b..bc7decf 100644 --- a/src/api/onenote.ts +++ b/src/api/onenote.ts @@ -1,10 +1,49 @@ import { service } from '../utils/request' -const get_notes = (params: Object) => { +const get_categorys = () => { return service({ - url: '/onenote/api/v1/one_note', + url: '/onenote/api/v1/category', method: 'GET', - params: params + }) +} + +const get_items = (category_id: string) => { + return service({ + url: '/onenote/api/v1/' + category_id + '/items/', + method: 'GET', + }) +} + + +const put_category = (data: Object) => { + return service({ + url: '/onenote/api/v1/category', + method: 'PUT', + data: data + }) +} + +const put_item = (data: Object) => { + return service({ + url: '/onenote/api/v1/item', + method: 'PUT', + data: data + }) +} + +const post_item = (data: Object) => { + return service({ + url: '/onenote/api/v1/item', + method: 'post', + data: data + }) +} + +const delete_item = (data: Object) => { + return service({ + url: '/onenote/api/v1/item', + method: 'delete', + data: data }) } @@ -24,12 +63,6 @@ const update_section = (params: Object) => { }) } -const insert_section = () => { - return service({ - url: '/onenote/api/v1/one_note/insert_section', - method: 'PUT' - }) -} const insert_page = (params: Object) => { return service({ @@ -39,4 +72,4 @@ const insert_page = (params: Object) => { }) } -export { get_notes, update_page, update_section, insert_section, insert_page } +export { get_categorys, get_items, update_page, update_section, put_category, put_item, post_item, delete_item, insert_page } diff --git a/src/view/onenote/NavTab.vue b/src/view/onenote/NavTab.vue deleted file mode 100644 index dee4d53..0000000 --- a/src/view/onenote/NavTab.vue +++ /dev/null @@ -1,58 +0,0 @@ - - - - {{ nav_name }} - - - - - - \ No newline at end of file diff --git a/src/view/onenote/PageTab.vue b/src/view/onenote/PageTab.vue deleted file mode 100644 index 41d3c8e..0000000 --- a/src/view/onenote/PageTab.vue +++ /dev/null @@ -1,101 +0,0 @@ - - - - - {{ page_data.page_name }} - - - - - - \ No newline at end of file diff --git a/src/view/onenote/SectionTab.vue b/src/view/onenote/SectionTab.vue deleted file mode 100644 index fbcec2a..0000000 --- a/src/view/onenote/SectionTab.vue +++ /dev/null @@ -1,90 +0,0 @@ - - - - {{ section_data.section_name }} - - - - - - \ No newline at end of file diff --git a/src/view/onenote/index.vue b/src/view/onenote/index.vue index e66602e..1f80b5c 100644 --- a/src/view/onenote/index.vue +++ b/src/view/onenote/index.vue @@ -1,153 +1,276 @@ - - - - - - - - - + - - - - - + + + + + + + + - + - - + + + + {{ card.category_theme }} + + + + + + + + + + + + + + + 管理 + + + + + + + + + {{ current_category }} + + + + + + + + {{ item.item_name }} + + + + + {{ item.item_value }} + + + + + + + + Pick a icon! + + {{ element_ui_icon }} + + el-icon: + + + Pick a color! + + {{ cainiao_color }} + + color: + + + Pick a theme! + + theme: + + + 确认 + + + + + name: + + + + text: + + + 删除 + 确认 + +