diff --git a/src/api/article.js b/src/api/article.js index 77e68a5..49c4a3c 100644 --- a/src/api/article.js +++ b/src/api/article.js @@ -91,9 +91,9 @@ export const submitArticle = (data) => { // @Produce application/json // @Param menu Object // @Router /cms/article/review [put] -export const reviewArticle = (data) => { +export const reviewBackArticle = (data) => { return service({ - url: '/cms/article/review', + url: '/cms/article/reviewBack', method: 'put', data }) diff --git a/src/api/fetcher.js b/src/api/fetcher.js index baf9ab4..58d679c 100644 --- a/src/api/fetcher.js +++ b/src/api/fetcher.js @@ -11,12 +11,12 @@ export const getFetcherArticleList = (data) => { }) } -// @Summary 根据id获取文章 +// @Summary 根据id导入文章 // @accept application/json -// @Router /cms/fetcher/getArticle [get] -export const getFetcherArticleById = (params) => { +// @Router /cms/fetcher/importArticle [get] +export const importFetcherArticleById = (params) => { return service({ - url: '/cms/fetcher/getArticle', + url: '/cms/fetcher/importArticle', method: 'get', params }) diff --git a/src/view/content/article/index.vue b/src/view/content/article/index.vue index 98cbb7c..311c576 100644 --- a/src/view/content/article/index.vue +++ b/src/view/content/article/index.vue @@ -41,17 +41,19 @@
新增文章 - 删除 + 删除
- + @@ -102,21 +104,30 @@ @@ -148,12 +159,13 @@ import { setArticleChannels, setArticleCategories, submitArticle, - reviewArticle, + reviewBackArticle, releaseArticle, cancelArticle } from '@/api/article' import ArticleEdit from '@/view/content/components/articleEdit.vue' - +import { useBtnAuth } from '@/utils/btnAuth' +const btnAuth = useBtnAuth() const articleEditTitle = ref('') const articleEditRef = ref(false) const page = ref(1) @@ -359,23 +371,23 @@ const handleRowReview = row => { cancelButtonText: '否', type: 'warning' }).then(async valid => { - // 确认通过,状态为待发布 - const res = await reviewArticle({ ID: row.ID, status: 3 }) + // 确认通过,发布文章 + const res = await releaseArticle({ ID: row.ID }) if (res.code === 0) { ElMessage({ type: 'success', - message: '审核确认通过!' + message: '审核通过!' }) - row.status = 3 + row.status = 4 } }).catch(async (action) => { - // 确认不通过,状态为待提审 + // 确认不通过,状态为草稿 if (action === 'cancel') { - const res = await reviewArticle({ ID: row.ID, status: 1 }) + const res = await reviewBackArticle({ ID: row.ID }) if (res.code === 0) { ElMessage({ type: 'warning', - message: '审核确认不通过!' + message: '审核不通过!' }) row.status = 1 } @@ -383,14 +395,6 @@ const handleRowReview = row => { }) } -// 预览 -const handleRowPreview = (row) => { - ElMessage({ - type: 'warning', - message: '开发中。。。' - }) -} - // ----- 列表更新栏目相关 ----- const handleChangeChannels = async row => { await nextTick() diff --git a/src/view/content/channel/index.vue b/src/view/content/channel/index.vue index b4ddbef..322b61c 100644 --- a/src/view/content/channel/index.vue +++ b/src/view/content/channel/index.vue @@ -10,6 +10,12 @@ + + + @@ -96,12 +102,12 @@
- + - + diff --git a/src/view/content/components/articleEdit.vue b/src/view/content/components/articleEdit.vue index d8ce887..8950115 100644 --- a/src/view/content/components/articleEdit.vue +++ b/src/view/content/components/articleEdit.vue @@ -55,7 +55,9 @@ - +
+ +
@@ -151,7 +153,7 @@ import { updateArticle, getArticleById, } from '@/api/article' -import { getFetcherArticleById } from '@/api/fetcher' +import { importFetcherArticleById } from '@/api/fetcher' // 组件定义 defineOptions({ @@ -348,7 +350,7 @@ const initFormByArticle = async (id) => { // 从爬虫数据中获取内容并填充至文章内容中 const initFormByFetcher = async (id) => { - const res = await getFetcherArticleById({ ID: id }) + const res = await importFetcherArticleById({ ID: id }) if (res.code === 0 && res.data && res.data.article) { fetcherArticleId.value = id const { title, author, source, content, publicTime } = res.data.article diff --git a/src/view/content/fetcher/article.vue b/src/view/content/fetcher/article.vue index 65be19d..d837c99 100644 --- a/src/view/content/fetcher/article.vue +++ b/src/view/content/fetcher/article.vue @@ -121,6 +121,7 @@ const initSearchInfo = () => { formatTimeToStr(startDate, 'yyyy-MM-dd'), formatTimeToStr(endDate, 'yyyy-MM-dd'), ], + state: 0, } } @@ -162,8 +163,7 @@ const handleRowEdit = (ID) => { // ----- 查询 ----- const getTableData = async () => { - const state = 0 - const res = await getFetcherArticleList({ page: page.value, pageSize: pageSize.value, ...searchInfo.value, state }) + const res = await getFetcherArticleList({ page: page.value, pageSize: pageSize.value, ...searchInfo.value }) if (res.code === 0) { tableData.value = res.data.list total.value = res.data.total diff --git a/src/view/layout/aside/index.vue b/src/view/layout/aside/index.vue index 3fcd676..0d29eec 100644 --- a/src/view/layout/aside/index.vue +++ b/src/view/layout/aside/index.vue @@ -105,7 +105,6 @@ const selectMenuItem = (index, _, ele, aaa) => { if (index.indexOf('http://') > -1 || index.indexOf('https://') > -1) { window.open(index) } else { - console.log(index, query, params) router.push({ name: index, query, params }) } } diff --git a/src/view/superAdmin/api/api.vue b/src/view/superAdmin/api/api.vue index 73184e2..4c6339f 100644 --- a/src/view/superAdmin/api/api.vue +++ b/src/view/superAdmin/api/api.vue @@ -1,121 +1,45 @@