diff --git a/src/api/rating/topicRecommend.js b/src/api/rating/topicRecommend.js new file mode 100644 index 0000000..2ae836f --- /dev/null +++ b/src/api/rating/topicRecommend.js @@ -0,0 +1,67 @@ +import request from '@/utils/request' + +/** + * 获取话题推荐列表 + * @param {*} data + * @returns + */ +export function getList(data) { + return request({ + url: 'management/api/rating/topic_recommend/list', + method: 'get', + params: data, + }) +} + +/** + * 添加话题推荐 + * @param {{ topicId: string }} data + * @returns + */ +export function doAdd(data) { + return request({ + url: 'management/api/rating/topic_recommend', + method: 'post', + data, + }) +} + +/** + * 切换话题推荐状态 + * @param {*} id + * @param {*} enable + * @returns + */ +export function toggleEnable(id, enable) { + return request({ + url: `/management/api/rating/topic_recommend/toggle/${id}`, + method: 'patch', + data: { enable }, + }) +} + +/** + * 移动话题推荐 + * @param {*} id + * @param {*} to + * @returns + */ +export function moveTo(id, to) { + return request({ + url: `/management/api/rating/topic_recommend/move_to/${id}`, + method: 'patch', + data: { to }, + }) +} +/** + * 编辑话题推荐 + * @param {*} id + * @returns + */ +export function doEdit(id, data) { + return request({ + url: `/management/api/rating/topic_recommend/${id}`, + method: 'put', + data, + }) +} diff --git a/src/router/index.js b/src/router/index.js index d8deee6..f3e518a 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -61,6 +61,12 @@ export const asyncRoutes = [ component: () => import('@/views/rating/topic/index'), meta: { title: '评分话题' }, }, + { + path: 'topic-recommend', + name: 'RatingTopicRecommendIndex', + component: () => import('@/views/rating/topicRecommend/index'), + meta: { title: '话题推荐' }, + }, { path: 'topic-item', name: 'RatingTopicItemIndex', diff --git a/src/views/rating/topicRecommend/components/TopicRecommendAdd.vue b/src/views/rating/topicRecommend/components/TopicRecommendAdd.vue new file mode 100644 index 0000000..20dfad4 --- /dev/null +++ b/src/views/rating/topicRecommend/components/TopicRecommendAdd.vue @@ -0,0 +1,143 @@ + + + + + + + + {{ item.title }} + 已通过 + 审核中 + 已拒绝 + 禁用 + + + + + + + + + + + + + diff --git a/src/views/rating/topicRecommend/index.vue b/src/views/rating/topicRecommend/index.vue new file mode 100644 index 0000000..3512d50 --- /dev/null +++ b/src/views/rating/topicRecommend/index.vue @@ -0,0 +1,162 @@ + + + + + 添加推荐 + + + + + + + + {{ row.topic ? row.topic.title : '-' }} + + Topic ID: + {{ row.topicId }} + + + + + + + + 审核中 + 已通过 + 已拒绝 + 禁用 + - + + + + + + + + + + + + + + + + + + + + + + + + +