From 6c990967a208e1181976c341ed9489f176d5fe26 Mon Sep 17 00:00:00 2001 From: jacky Date: Sat, 20 Apr 2024 00:32:27 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=B9=BF=E5=91=8A=E7=AE=A1?= =?UTF-8?q?=E7=90=86=20=E4=BF=AE=E5=A4=8D=E9=83=A8=E5=88=86=E9=A1=B5?= =?UTF-8?q?=E9=9D=A2=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/adContent.js | 75 ++++ src/api/adPosition.js | 63 +++ src/components/upload/image.vue | 2 +- src/utils/image.js | 6 +- src/view/ad/content.vue | 439 ++++++++++++++++++++ src/view/ad/position.vue | 294 +++++++++++++ src/view/content/components/articleEdit.vue | 6 +- src/view/content/fetcher/article.vue | 13 +- src/view/content/mediaFile/index.vue | 2 +- 9 files changed, 891 insertions(+), 9 deletions(-) create mode 100644 src/api/adContent.js create mode 100644 src/api/adPosition.js create mode 100644 src/view/ad/content.vue create mode 100644 src/view/ad/position.vue diff --git a/src/api/adContent.js b/src/api/adContent.js new file mode 100644 index 0000000..898c359 --- /dev/null +++ b/src/api/adContent.js @@ -0,0 +1,75 @@ +import service from '@/utils/request' + +// @Summary 获取列表 +// @Produce application/json +// @Router /cms/adContent/getList [post] +export const getAdContentList = (data) => { + return service({ + url: '/cms/adContent/getList', + method: 'post', + data + }) +} + +// @Summary 新增 +// @Produce application/json +// @Param menu Object +// @Router /cms/adContent/add [post] +export const addAdContent = (data) => { + return service({ + url: '/cms/adContent/add', + method: 'post', + data + }) +} + +// @Summary 删除 +// @Produce application/json +// @Param ID int +// @Router /cms/adContent/delete [delete] +export const deleteAdContent = (data) => { + return service({ + url: '/cms/adContent/delete', + method: 'delete', + data + }) +} + +// @Summary 批量删除 +// @Param data body request.IdsReq true "批量删除" +// @Success 200 {string} string "{"success":true,"data":{},"msg":"删除成功"}" +// @Router /cms/adContent/deleteByIds [delete] +export const deleteAdContentByIds = (params) => { + return service({ + url: '/cms/adContent/deleteByIds', + method: 'delete', + params + }) +} + +// @Summary 修改 +// @Produce application/json +// @Param menu Object +// @Router /cms/adContent/update [put] +export const updateAdContent = (data) => { + return service({ + url: '/cms/adContent/update', + method: 'put', + data + }) +} + +// @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/adContent/get [get] +export const getAdContentById = (params) => { + return service({ + url: '/cms/adContent/get', + method: 'get', + params + }) +} diff --git a/src/api/adPosition.js b/src/api/adPosition.js new file mode 100644 index 0000000..7688139 --- /dev/null +++ b/src/api/adPosition.js @@ -0,0 +1,63 @@ +import service from '@/utils/request' + +// @Summary 获取列表 +// @Produce application/json +// @Router /cms/adPosition/getList [post] +export const getAdPositionList = (data) => { + return service({ + url: '/cms/adPosition/getList', + method: 'post', + data + }) +} + +// @Summary 新增 +// @Produce application/json +// @Param menu Object +// @Router /cms/adPosition/add [post] +export const addAdPosition = (data) => { + return service({ + url: '/cms/adPosition/add', + method: 'post', + data + }) +} + +// @Summary 删除 +// @Produce application/json +// @Param ID int +// @Router /cms/adPosition/delete [delete] +export const deleteAdPosition = (data) => { + return service({ + url: '/cms/adPosition/delete', + method: 'delete', + data + }) +} + +// @Summary 修改 +// @Produce application/json +// @Param menu Object +// @Router /cms/adPosition/update [put] +export const updateAdPosition = (data) => { + return service({ + url: '/cms/adPosition/update', + method: 'put', + data + }) +} + +// @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/adPosition/get [get] +export const getAdPositionById = (params) => { + return service({ + url: '/cms/adPosition/get', + method: 'get', + params + }) +} diff --git a/src/components/upload/image.vue b/src/components/upload/image.vue index 4d5fd50..551992f 100644 --- a/src/components/upload/image.vue +++ b/src/components/upload/image.vue @@ -48,7 +48,7 @@ const beforeUpload = (file) => { const isJPG = file.type === 'image/jpeg' const isPng = file.type === 'image/png' if (!isJPG && !isPng) { - ElMessage.error('上传头像图片只能是 jpg或png 格式!') + ElMessage.error('上传图片只能是 jpg或png 格式!') return false } diff --git a/src/utils/image.js b/src/utils/image.js index 0111b81..ccc70db 100644 --- a/src/utils/image.js +++ b/src/utils/image.js @@ -96,6 +96,8 @@ export const getUrl = (url) => url && url.slice(0, 4) !== 'http' ? path + url : export const isVideoExt = (url) => url.endsWith('.mp4') || url.endsWith('.mov') || url.endsWith('.webm') || url.endsWith('.ogg'); -export const isVideoMime = (type) => type == 'video/mp4' || type == 'video/webm' || type == 'video/ogg'; +export const isVideoMime = (type) => type === 'video/mp4' || type === 'video/webm' || type === 'video/ogg'; -export const isImageMime = (type) => type == 'image/jpeg' || type == 'image/png' || type == 'image/webp' || type == 'image/svg+xml'; +export const isImageMime = (type) => type === 'image/jpeg' || type === 'image/png' || type === 'image/webp' || type === 'image/svg+xml'; + +export const isGifMime = (type) => type === 'image/gif'; diff --git a/src/view/ad/content.vue b/src/view/ad/content.vue new file mode 100644 index 0000000..dbe86ec --- /dev/null +++ b/src/view/ad/content.vue @@ -0,0 +1,439 @@ + + + + + diff --git a/src/view/ad/position.vue b/src/view/ad/position.vue new file mode 100644 index 0000000..323bd79 --- /dev/null +++ b/src/view/ad/position.vue @@ -0,0 +1,294 @@ + + + + + + + \ No newline at end of file diff --git a/src/view/content/components/articleEdit.vue b/src/view/content/components/articleEdit.vue index 8950115..a08b89f 100644 --- a/src/view/content/components/articleEdit.vue +++ b/src/view/content/components/articleEdit.vue @@ -141,11 +141,11 @@ import { getUrl } from '@/utils/image' import { reactive, ref } from 'vue' import { ElMessage } from 'element-plus' import RichEdit from '@/components/richtext/rich-edit.vue' -import ChooseImg from '@/components/chooseImg/index.vue' import { getSourceList } from '@/api/source' import { getCategoryTree } from '@/api/category' import { getChannelTree } from '@/api/channel' import { getTagList } from '@/api/tag' +import ChooseImg from '@/components/chooseImg/index.vue' import UploadCommon from '@/components/upload/common.vue' import UploadImage from '@/components/upload/image.vue' import { @@ -319,8 +319,8 @@ const openPage = async (params) => { initFormByFetcher(params.fetcherId) } else { // 新建 + fullscreenLoading.value = false } - fullscreenLoading.value = false } const initFormByArticle = async (id) => { @@ -346,6 +346,7 @@ const initFormByArticle = async (id) => { }) showErrMessage.value = '获取数据失败' } + fullscreenLoading.value = false } // 从爬虫数据中获取内容并填充至文章内容中 @@ -369,6 +370,7 @@ const initFormByFetcher = async (id) => { }) showErrMessage.value = '获取数据失败' } + fullscreenLoading.value = false } // ---- 以下为图片相关操作 ---- diff --git a/src/view/content/fetcher/article.vue b/src/view/content/fetcher/article.vue index d837c99..b0f1f69 100644 --- a/src/view/content/fetcher/article.vue +++ b/src/view/content/fetcher/article.vue @@ -45,12 +45,19 @@ - - + + - +