From 1c83cb1bf857ece2fe692c665f9624b1318be846 Mon Sep 17 00:00:00 2001 From: jacky Date: Tue, 16 Apr 2024 00:38:49 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=B8=80=E5=A4=A7=E5=A0=86?= =?UTF-8?q?=E4=B8=9C=E8=A5=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 1 + src/api/article.js | 100 ++++ src/api/breakpoint.js | 8 +- src/api/{articleCategory.js => category.js} | 34 +- src/api/channel.js | 52 ++- src/api/fetcher.js | 23 + src/api/mediaFile.js | 15 +- src/api/source.js | 12 + src/components/chooseImg/index.vue | 99 ++-- src/components/customPic/index.vue | 51 +-- src/components/richtext/rich-edit.vue | 20 +- src/components/richtext/rich-view.vue | 14 +- src/components/selectFile/selectFile.vue | 2 +- src/components/upload/common.vue | 35 +- src/components/upload/image.vue | 41 +- src/style/main.scss | 2 +- src/utils/arr.js | 15 + src/view/content/article/edit.vue | 417 +++++++++++++++++ src/view/content/article/index.vue | 481 ++++++++++++++++++++ src/view/content/category/index.vue | 65 ++- src/view/content/channel/index.vue | 164 ++++--- src/view/content/fetcher/article.vue | 163 +++++++ src/view/content/mediaFile/index.vue | 12 +- src/view/layout/aside/index.vue | 31 +- src/view/layout/index.vue | 163 ++----- src/view/person/person.vue | 68 +-- src/view/superAdmin/authority/authority.vue | 223 +++------ src/view/superAdmin/user/user.vue | 321 ++++--------- 28 files changed, 1753 insertions(+), 879 deletions(-) create mode 100644 src/api/article.js rename src/api/{articleCategory.js => category.js} (57%) create mode 100644 src/api/fetcher.js create mode 100644 src/api/source.js create mode 100644 src/utils/arr.js create mode 100644 src/view/content/article/edit.vue create mode 100644 src/view/content/article/index.vue create mode 100644 src/view/content/fetcher/article.vue diff --git a/package.json b/package.json index ae000fe..26e74c2 100644 --- a/package.json +++ b/package.json @@ -33,6 +33,7 @@ "spark-md5": "^3.0.2", "tailwindcss": "^3.3.3", "vue": "^3.4.21", + "vue-quill-editor": "^3.0.6", "vue-router": "^4.2.4" }, "devDependencies": { diff --git a/src/api/article.js b/src/api/article.js new file mode 100644 index 0000000..6278049 --- /dev/null +++ b/src/api/article.js @@ -0,0 +1,100 @@ +import service from '@/utils/request' + +// @Summary 获取文章列表 +// @Produce application/json +// @Router /cms/article/getList [post] +export const getArticleList = (data) => { + return service({ + url: '/cms/article/getList', + method: 'post', + data + }) +} + +// @Summary 新增文章 +// @Produce application/json +// @Param menu Object +// @Router /cms/article/add [post] +export const addArticle = (data) => { + return service({ + url: '/cms/article/add', + method: 'post', + data + }) +} + +// @Summary 删除文章 +// @Produce application/json +// @Param ID int +// @Router /cms/article/delete [delete] +export const deleteArticle = (data) => { + return service({ + url: '/cms/article/delete', + method: 'delete', + data + }) +} + +// @Summary 修改文章 +// @Produce application/json +// @Param menu Object +// @Router /cms/article/update [put] +export const updateArticle = (data) => { + return service({ + url: '/cms/article/update', + method: 'put', + data + }) +} + +// @Tags 文章文章 +// @Summary 根据id获取文章 +// @Security ApiKeyAuth +// @accept application/json +// @Produce application/json +// @Param data body api.GetById true "根据id获取文章" +// @Success 200 {string} json "{"success":true,"data":{},"msg":"获取成功"}" +// @Router /cms/article/get [get] +export const getArticleById = (params) => { + return service({ + url: '/cms/article/get', + method: 'get', + params + }) +} + +// @Summary 发布文章 +// @Produce application/json +// @Param menu Object +// @Router /cms/article/release [put] +export const releaseArticle = (data) => { + return service({ + url: '/cms/article/release', + method: 'post', + data + }) +} + +// @Summary 更新文章所属栏目 +// @Produce application/json +// @Param menu Object +// @Router /cms/article/setChannels [put] +export const setArticleChannels = (data) => { + return service({ + url: '/cms/article/setChannels', + method: 'put', + data + }) +} + +// @Summary 更新文章分类 +// @Produce application/json +// @Param menu Object +// @Router /cms/article/setChannels [put] +export const setArticleCategories = (data) => { + return service({ + url: '/cms/article/setCategories', + method: 'put', + data + }) +} diff --git a/src/api/breakpoint.js b/src/api/breakpoint.js index cdb6bbf..b2756e1 100644 --- a/src/api/breakpoint.js +++ b/src/api/breakpoint.js @@ -9,7 +9,7 @@ import service from '@/utils/request' export const findFile = (params) => { return service({ - url: '/mediaFile/findFile', + url: '/cms/mediaFile/findFile', method: 'get', params }) @@ -17,7 +17,7 @@ export const findFile = (params) => { export const breakpointContinue = (data) => { return service({ - url: '/mediaFile/breakpointContinue', + url: '/cms/mediaFile/breakpointContinue', method: 'post', donNotShowLoading: true, headers: { 'Content-Type': 'multipart/form-data' }, @@ -27,7 +27,7 @@ export const breakpointContinue = (data) => { export const breakpointContinueFinish = (params) => { return service({ - url: '/mediaFile/breakpointContinueFinish', + url: '/cms/mediaFile/breakpointContinueFinish', method: 'post', params }) @@ -35,7 +35,7 @@ export const breakpointContinueFinish = (params) => { export const removeChunk = (data, params) => { return service({ - url: '/mediaFile/removeChunk', + url: '/cms/mediaFile/removeChunk', method: 'post', data, params diff --git a/src/api/articleCategory.js b/src/api/category.js similarity index 57% rename from src/api/articleCategory.js rename to src/api/category.js index d01ab6b..4619d6a 100644 --- a/src/api/articleCategory.js +++ b/src/api/category.js @@ -2,21 +2,21 @@ import service from '@/utils/request' // @Summary 获取分类树 // @Produce application/json -// @Router /articleCategory/getCategoryTree [post] +// @Router /category/getTree [get] export const getCategoryTree = () => { return service({ - url: '/articleCategory/getCategoryTree', - method: 'post', + url: '/cms/category/getTree', + method: 'get', }) } // @Summary 新增分类 // @Produce application/json // @Param menu Object -// @Router /articleCategory/addCategory [post] +// @Router /category/add [post] export const addCategory = (data) => { return service({ - url: '/articleCategory/addCategory', + url: '/cms/category/add', method: 'post', data }) @@ -25,11 +25,11 @@ export const addCategory = (data) => { // @Summary 删除分类 // @Produce application/json // @Param ID int -// @Router /articleCategory/deleteCategory [post] +// @Router /category/delete [delete] export const deleteCategory = (data) => { return service({ - url: '/articleCategory/deleteCategory', - method: 'post', + url: '/cms/category/delete', + method: 'delete', data }) } @@ -37,11 +37,11 @@ export const deleteCategory = (data) => { // @Summary 修改分类 // @Produce application/json // @Param menu Object -// @Router /articleCategory/updateCategory [post] +// @Router /category/update [put] export const updateCategory = (data) => { return service({ - url: '/articleCategory/updateCategory', - method: 'post', + url: '/cms/category/update', + method: 'put', data }) } @@ -51,13 +51,13 @@ export const updateCategory = (data) => { // @Security ApiKeyAuth // @accept application/json // @Produce application/json -// @Param data body api.GetById true "根据id获取菜单" +// @Param id int true "根据id获取菜单" // @Success 200 {string} json "{"success":true,"data":{},"msg":"获取成功"}" -// @Router /articleCategory/getCategoryById [post] -export const getCategoryById = (data) => { +// @Router /category/get [get] +export const getCategoryById = (params) => { return service({ - url: '/articleCategory/getCategoryById', - method: 'post', - data + url: '/cms/category/get', + method: 'get', + params }) } diff --git a/src/api/channel.js b/src/api/channel.js index 0d84841..3eafd3a 100644 --- a/src/api/channel.js +++ b/src/api/channel.js @@ -2,21 +2,21 @@ import service from '@/utils/request' // @Summary 获取栏目树 // @Produce application/json -// @Router /channel/getChannelTree [post] +// @Router /cms/channel/getTree [get] export const getChannelTree = () => { return service({ - url: '/channel/getChannelTree', - method: 'post', + url: '/cms/channel/getTree', + method: 'get', }) } // @Summary 新增栏目 // @Produce application/json -// @Param menu Object -// @Router /channel/addChannel [post] +// @Param channel Object +// @Router /cms/channel/add [post] export const addChannel = (data) => { return service({ - url: '/channel/addChannel', + url: '/cms/channel/add', method: 'post', data }) @@ -25,23 +25,23 @@ export const addChannel = (data) => { // @Summary 删除栏目 // @Produce application/json // @Param ID int -// @Router /channel/deleteChannel [post] +// @Router /cms/channel/delete [delete] export const deleteChannel = (data) => { return service({ - url: '/channel/deleteChannel', - method: 'post', + url: '/cms/channel/delete', + method: 'delete', data }) } // @Summary 修改栏目 // @Produce application/json -// @Param menu Object -// @Router /channel/updateChannel [post] +// @Param channel Object +// @Router /cms/channel/update [put] export const updateChannel = (data) => { return service({ - url: '/channel/updateChannel', - method: 'post', + url: '/cms/channel/update', + method: 'put', data }) } @@ -51,13 +51,27 @@ export const updateChannel = (data) => { // @Security ApiKeyAuth // @accept application/json // @Produce application/json -// @Param data body api.GetById true "根据id获取栏目" +// @Param id int true "根据id获取栏目" // @Success 200 {string} json "{"success":true,"data":{},"msg":"获取成功"}" -// @Router /channel/getChannelById [post] -export const getChannelById = (data) => { +// @Router /cms/channel/get [get] +export const getChannelById = (params) => { return service({ - url: '/channel/getChannelById', - method: 'post', - data + url: '/cms/channel/get', + method: 'get', + params + }) +} + +// @Tags 文章栏目 +// @Summary 获取模板options +// @Security ApiKeyAuth +// @accept application/json +// @Produce application/json +// @Success 200 {string} json "{"success":true,"data":{},"msg":"获取成功"}" +// @Router /cms/channel/getTplOptions [get] +export const getTplOptions = () => { + return service({ + url: '/cms/channel/getTplOptions', + method: 'get', }) } diff --git a/src/api/fetcher.js b/src/api/fetcher.js new file mode 100644 index 0000000..baf9ab4 --- /dev/null +++ b/src/api/fetcher.js @@ -0,0 +1,23 @@ +import service from '@/utils/request' + +// @Summary 获取文章列表 +// @Produce application/json +// @Router /cms/fetcher/getArticleList [post] +export const getFetcherArticleList = (data) => { + return service({ + url: '/cms/fetcher/getArticleList', + method: 'post', + data + }) +} + +// @Summary 根据id获取文章 +// @accept application/json +// @Router /cms/fetcher/getArticle [get] +export const getFetcherArticleById = (params) => { + return service({ + url: '/cms/fetcher/getArticle', + method: 'get', + params + }) +} diff --git a/src/api/mediaFile.js b/src/api/mediaFile.js index b9b914e..a9ee42b 100644 --- a/src/api/mediaFile.js +++ b/src/api/mediaFile.js @@ -1,4 +1,5 @@ import service from '@/utils/request' + // @Tags MediaFile // @Summary 分页文件列表 // @Security ApiKeyAuth @@ -6,10 +7,10 @@ import service from '@/utils/request' // @Produce application/json // @Param data body modelInterface.PageInfo true "分页获取文件户列表" // @Success 200 {string} json "{"success":true,"data":{},"msg":"获取成功"}" -// @Router /mediaFile/getFileList [post] +// @Router /cms/mediaFile/getList [post] export const getFileList = (data) => { return service({ - url: '/mediaFile/getFileList', + url: '/cms/mediaFile/getList', method: 'post', data }) @@ -21,11 +22,11 @@ export const getFileList = (data) => { // @Produce application/json // @Param data body dbModel.MediaFile true "传入文件里面id即可" // @Success 200 {string} json "{"success":true,"data":{},"msg":"返回成功"}" -// @Router /mediaFile/deleteFile [post] +// @Router /cms/mediaFile/delete [delete] export const deleteFile = (data) => { return service({ - url: '/mediaFile/deleteFile', - method: 'post', + url: '/cms/mediaFile/delete', + method: 'delete', data }) } @@ -37,8 +38,8 @@ export const deleteFile = (data) => { */ export const editFileName = (data) => { return service({ - url: '/mediaFile/editFileName', - method: 'post', + url: '/cms/mediaFile/editName', + method: 'put', data }) } diff --git a/src/api/source.js b/src/api/source.js new file mode 100644 index 0000000..da46435 --- /dev/null +++ b/src/api/source.js @@ -0,0 +1,12 @@ +import service from '@/utils/request' + +// @Summary 获取来源列表 +// @Produce application/json +// @Router /cms/source/getList [post] +export const getSourceList = (data) => { + return service({ + url: '/cms/source/getList', + method: 'post', + data + }) +} diff --git a/src/components/chooseImg/index.vue b/src/components/chooseImg/index.vue index 7801304..4b15449 100644 --- a/src/components/chooseImg/index.vue +++ b/src/components/chooseImg/index.vue @@ -1,26 +1,30 @@