diff --git a/mock/onenote.ts b/mock/onenote.ts index f9db3b2..1f4b2ee 100644 --- a/mock/onenote.ts +++ b/mock/onenote.ts @@ -65,6 +65,13 @@ export default [ return {} } }, + { + url: '/onenote/api/v1/item', + method: 'post', + response: () => { + return {} + } + }, { url: '/onenote/api/v1/item', method: 'delete', diff --git a/src/api/onenote.ts b/src/api/onenote.ts index bc7decf..983a7fc 100644 --- a/src/api/onenote.ts +++ b/src/api/onenote.ts @@ -7,14 +7,6 @@ const get_categorys = () => { }) } -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', @@ -23,6 +15,13 @@ const put_category = (data: Object) => { }) } +const get_items = (category_id: string) => { + return service({ + url: '/onenote/api/v1/' + category_id + '/items/', + method: 'GET', + }) +} + const put_item = (data: Object) => { return service({ url: '/onenote/api/v1/item', @@ -47,29 +46,4 @@ const delete_item = (data: Object) => { }) } -const update_page = (params: Object) => { - return service({ - url: '/onenote/api/v1/one_note/update_page', - method: 'POST', - data: params - }) -} - -const update_section = (params: Object) => { - return service({ - url: '/onenote/api/v1/one_note/update_section', - method: 'POST', - data: params - }) -} - - -const insert_page = (params: Object) => { - return service({ - url: '/onenote/one_note/insert_page', - method: 'PUT', - data: params - }) -} - -export { get_categorys, get_items, update_page, update_section, put_category, put_item, post_item, delete_item, insert_page } +export { get_categorys, get_items, put_category, put_item, post_item, delete_item } diff --git a/src/view/onenote/index.vue b/src/view/onenote/index.vue index 1f80b5c..7f835eb 100644 --- a/src/view/onenote/index.vue +++ b/src/view/onenote/index.vue @@ -38,12 +38,12 @@ - {{ current_category }} + {{ current_category.category_theme }} + - - + {{ item.item_name }} @@ -90,8 +90,11 @@ text: - 删除 - 确认 + 删除 + 取消 + 确认 + 确认 @@ -99,7 +102,7 @@