diff --git a/src/api/article.js b/src/api/article.js index 2243c66e..9eacd90d 100644 --- a/src/api/article.js +++ b/src/api/article.js @@ -23,3 +23,18 @@ export function fetchPv(pv) { }) } +export function createArticle(data) { + return request({ + url: '/article/create', + method: 'post', + data + }) +} + +export function updateArticle(data) { + return request({ + url: '/article/update', + method: 'post', + data + }) +} diff --git a/src/mock/article.js b/src/mock/article.js index a42030ed..20dc4e1c 100644 --- a/src/mock/article.js +++ b/src/mock/article.js @@ -60,5 +60,11 @@ export default { status: 'published', tags: [], title: 'vue-element-admin' + }), + createArticle: () => ({ + data: 'success' + }), + updateArticle: () => ({ + data: 'success' }) } diff --git a/src/mock/index.js b/src/mock/index.js index c2fbb7f0..c140b890 100644 --- a/src/mock/index.js +++ b/src/mock/index.js @@ -17,6 +17,8 @@ Mock.mock(/\/user\/info\.*/, 'get', loginAPI.getUserInfo) Mock.mock(/\/article\/list/, 'get', articleAPI.getList) Mock.mock(/\/article\/detail/, 'get', articleAPI.getArticle) Mock.mock(/\/article\/pv/, 'get', articleAPI.getPv) +Mock.mock(/\/article\/create/, 'post', articleAPI.createArticle) +Mock.mock(/\/article\/update/, 'post', articleAPI.updateArticle) // 搜索相关 Mock.mock(/\/search\/user/, 'get', remoteSearchAPI.searchUser) diff --git a/src/views/example/table/complexTable.vue b/src/views/example/table/complexTable.vue index 92a3d2ef..fbadc452 100644 --- a/src/views/example/table/complexTable.vue +++ b/src/views/example/table/complexTable.vue @@ -3,90 +3,79 @@
- - - - 搜索 添加 - 导出 + 导出 显示审核人
- - + - - - - - - - - - + -
@@ -96,34 +85,29 @@
- - + + - + + + + + + + - - - - - - - - - - - @@ -131,8 +115,8 @@ @@ -150,8 +134,8 @@