diff --git a/src/api/rating/topic.js b/src/api/rating/topic.js new file mode 100644 index 0000000..325b0dd --- /dev/null +++ b/src/api/rating/topic.js @@ -0,0 +1,41 @@ +import request from '@/utils/request' + +export function getList(data) { + return request({ + url: 'management/api/rating/topic/list', + method: 'get', + params: data, + }) +} + +export function doAdd(data) { + return request({ + url: 'management/api/rating/topic', + method: 'post', + data, + }) +} + +export function doEdit(id, data) { + return request({ + url: `/management/api/rating/topic/${id}`, + method: 'put', + data, + }) +} + +export function doDelete(data) { + return request({ + url: `/management/api/rating/topic`, + method: 'delete', + data, + }) +} + +export function toggleEnable(id, isEnabled) { + return request({ + url: `/management/api/rating/topic/enable/${id}`, + method: 'patch', + data: { isEnabled }, + }) +} diff --git a/src/api/rating/topicItem.js b/src/api/rating/topicItem.js new file mode 100644 index 0000000..3800e15 --- /dev/null +++ b/src/api/rating/topicItem.js @@ -0,0 +1,41 @@ +import request from '@/utils/request' + +export function getList(data) { + return request({ + url: 'management/api/rating/topicItem/list', + method: 'get', + params: data, + }) +} + +export function doAdd(data) { + return request({ + url: 'management/api/rating/topicItem', + method: 'post', + data, + }) +} + +export function doEdit(id, data) { + return request({ + url: `/management/api/rating/topicItem/${id}`, + method: 'put', + data, + }) +} + +export function doDelete(data) { + return request({ + url: `/management/api/rating/topicItem`, + method: 'delete', + data, + }) +} + +export function toggleEnable(id, isEnabled) { + return request({ + url: `/management/api/rating/topicItem/enable/${id}`, + method: 'patch', + data: { isEnabled }, + }) +} diff --git a/src/api/system/ability.js b/src/api/system/ability.js index 9f179a2..434dcc5 100644 --- a/src/api/system/ability.js +++ b/src/api/system/ability.js @@ -31,6 +31,7 @@ export function doDelete(data) { data, }) } + export function toggleEnable(id, isEnabled) { return request({ url: `/management/api/ability/rule/enable/${id}`, diff --git a/src/router/index.js b/src/router/index.js index 47e5a44..7e5f834 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -48,6 +48,27 @@ export const asyncRoutes = [ }, ], }, + { + path: '/rating', + component: Layout, + redirect: 'noRedirect', + name: 'RatingMini', + meta: { title: '夯拉评分', icon: 'gift', permissions: ['admin'] }, + children: [ + { + path: 'topic', + name: 'RatingTopicIndex', + component: () => import('@/views/rating/topic/index'), + meta: { title: '评分话题' }, + }, + { + path: 'topic-item', + name: 'RatingTopicItemIndex', + component: () => import('@/views/rating/topicItem/index'), + meta: { title: '评分项' }, + }, + ], + }, { path: '/spring', component: Layout, diff --git a/src/utils/blessing.js b/src/utils/blessing.js index 9bafcde..31d6044 100644 --- a/src/utils/blessing.js +++ b/src/utils/blessing.js @@ -22,5 +22,9 @@ export function getSceneName(scene) { export const getThumbUrl = (url, w = 200, h = 200) => { if (!url) return '' - return `${url}?imageView2/1/w/${w}/h/${h}/q/80` + if (url.startsWith('http')) { + return `${url}?imageView2/1/w/${w}/h/${h}/q/80` + } else { + return `https://file.lihailezzc.com/${url}?imageView2/1/w/${w}/h/${h}/q/80` + } } diff --git a/src/views/rating/topic/index.vue b/src/views/rating/topic/index.vue new file mode 100644 index 0000000..c8b6d68 --- /dev/null +++ b/src/views/rating/topic/index.vue @@ -0,0 +1,144 @@ + + + + + diff --git a/src/views/rating/topicItem/index.vue b/src/views/rating/topicItem/index.vue new file mode 100644 index 0000000..ff25da8 --- /dev/null +++ b/src/views/rating/topicItem/index.vue @@ -0,0 +1,181 @@ + + + + +