diff --git a/public/images/browse.png b/public/images/browse.png new file mode 100644 index 00000000..3196a8b2 Binary files /dev/null and b/public/images/browse.png differ diff --git a/public/images/collect.png b/public/images/collect.png new file mode 100644 index 00000000..4d1f7349 Binary files /dev/null and b/public/images/collect.png differ diff --git a/public/images/headerBack.png b/public/images/headerBack.png new file mode 100644 index 00000000..0b1cf3ec Binary files /dev/null and b/public/images/headerBack.png differ diff --git a/public/images/list01.png b/public/images/list01.png new file mode 100644 index 00000000..47456321 Binary files /dev/null and b/public/images/list01.png differ diff --git a/public/images/listred01.png b/public/images/listred01.png new file mode 100644 index 00000000..6d696edf Binary files /dev/null and b/public/images/listred01.png differ diff --git a/src/api/modules/cases.js b/src/api/modules/cases.js index 88c02e73..46ad3d60 100644 --- a/src/api/modules/cases.js +++ b/src/api/modules/cases.js @@ -1,6 +1,6 @@ /* 案例模块的相关处理*/ import ajax from '@/utils/xajax.js' - +import ajaxs from '@/api/ajax.js' /**首页查询 * pageSize * orderField @@ -88,6 +88,12 @@ const usernameList = function (pageSize) { const queryPraises = function (pageSize) { return ajax.get(`/xboe/m/boe/cases/query-praises?pageSize=${pageSize}`); } +const queryPraisesNew = function (pageSize,rankType) { + return ajax.get(`/xboe/m/boe/cases/queryPopularity?pageSize=${pageSize}&rankType=${rankType}`); +} +const queryRecommendRank = function (pageSize) { + return ajax.get(`/xboe/m/boe/cases/queryRecommendRank?pageSize=${pageSize}`); +} /* 好评榜 @param pageSize 长度 @@ -95,6 +101,9 @@ const queryPraises = function (pageSize) { const queryComments = function (pageSize) { return ajax.get(`/xboe/m/boe/cases/query-comments?pageSize=${pageSize}`); } +const queryCommentsNew = function (pageSize,rankType) { + return ajax.get(`/xboe/m/boe/cases/queryHighOpinion?pageSize=${pageSize}&rankType=${rankType}`); +} /** * 专业分类 @@ -186,11 +195,30 @@ const endReadTimer = (data)=> ajax.postJson('/xboe/m/boe/cases/recommend/record const caseYears = function (query = {}) { return ajax.post('/xboe/m/boe/cases/caseYears', query); } - - - - +//案例推荐榜单 +const getQueryRecommendRank = function (params) { + return ajax.get(`/xboe/m/boe/cases/queryRecommendRank?pageSize=${params.pageSize}`) +} +//案例上榜 +const riseIntoRank = (data) => ajax.post(`/xboe/m/boe/cases/riseIntoRank?caseId=${data.caseId}`) +//取消上榜 +const cancelRiseIntoRank = (data) => ajax.post(`/xboe/m/boe/cases/cancelRiseIntoRank?caseId=${data.caseId}`) +//调整榜单 +const adjustRank = (data) => ajax.post(`/xboe/m/boe/cases/adjustRank?caseIds=${data.caseIds}`) +//收藏案例 +const queryFavoriteCaseOfIndex = (params) => ajax.get(`/xboe/m/boe/cases/queryFavoriteCaseOfIndex?pageIndex=${params.pageIndex}&pageSize=${params.pageSize}&orderField=${params.orderField}&orderAsc=${params.orderAsc}`) +//浏览记录 +const queryViewRecord = (data) => ajaxs.post(`/statApi/xboe/m/stat/userdynamic/list?pageIndex=${data.pageIndex}&pageSize=${data.pageSize}&contentType=${data.contentType}&aid=${data.aid}&hidden=${data.hidden}`) +//浏览量TOP榜单 +const queryPopularityOfMajor = (params) => ajax.get(`/xboe/m/boe/cases/queryPopularityOfMajor?pageSize=${params.pageSize}&rankMonth=${params.rankMonth}&majorId=${params.majorId}`) export default { + getQueryRecommendRank, + queryPopularityOfMajor, + queryViewRecord, + queryFavoriteCaseOfIndex, + riseIntoRank, + cancelRiseIntoRank, + adjustRank, indexList, queryList, queryListV2, @@ -202,7 +230,10 @@ export default { query, usernameList, queryPraises, + queryPraisesNew, + queryRecommendRank, queryComments, + queryCommentsNew, majorTypes, details, ids, diff --git a/src/assets/images/asterisk.png b/src/assets/images/asterisk.png new file mode 100644 index 00000000..49c7ac99 Binary files /dev/null and b/src/assets/images/asterisk.png differ diff --git a/src/assets/images/collect.png b/src/assets/images/collect.png new file mode 100644 index 00000000..abda1923 Binary files /dev/null and b/src/assets/images/collect.png differ diff --git a/src/assets/images/collect_active.png b/src/assets/images/collect_active.png new file mode 100644 index 00000000..cb46d1c1 Binary files /dev/null and b/src/assets/images/collect_active.png differ diff --git a/src/assets/images/time.png b/src/assets/images/time.png new file mode 100644 index 00000000..8799761b Binary files /dev/null and b/src/assets/images/time.png differ diff --git a/src/assets/images/time_active.png b/src/assets/images/time_active.png new file mode 100644 index 00000000..51584c54 Binary files /dev/null and b/src/assets/images/time_active.png differ diff --git a/src/assets/styles/portal.scss b/src/assets/styles/portal.scss index 98df7892..ee2e1d63 100644 --- a/src/assets/styles/portal.scss +++ b/src/assets/styles/portal.scss @@ -110,7 +110,7 @@ body {margin: 0px;padding: 0px;} padding-bottom:12px } .ranking-data{ - min-height: 246px; + min-height: 196px; margin: 0px; overflow-y: auto; } @@ -130,7 +130,7 @@ body {margin: 0px;padding: 0px;} padding-bottom:12px } .ranking-data{ - min-height: 246px; + min-height: 196px; margin: 0px; // overflow-y: auto; } diff --git a/src/components/Portal/authorInfo.vue b/src/components/Portal/authorInfo.vue index d7418ea8..159bade5 100644 --- a/src/components/Portal/authorInfo.vue +++ b/src/components/Portal/authorInfo.vue @@ -15,6 +15,7 @@
{{userName}} {{userInfo}} + {{tag}}
@@ -49,6 +50,12 @@ onlyAvatar:{ type:Boolean, default:false + }, + authorTags: { + type:Array, + default(){ + return [] + } } }, data(){ @@ -119,6 +126,14 @@ font-weight: 300; margin-left: 4px; } + .comWords { + background: #409EFF; + border-radius: 2px; + font-weight: 400; + font-size: 12px; + color: #FFFFFF; + padding: 3px 10px 4px 8px; + } .uavatar{ // border: 1px solid #73adfe; width: 28px; diff --git a/src/router/index.js b/src/router/index.js index c67ae200..cc7b6b28 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -214,6 +214,20 @@ export const constantRoutes = [{ name: 'caseDetail', meta: {title: '案例详情', keepAlive: true, icon: 'dashboard', noCache: false, affix: true}, }, + { + path: '/case/charts', + hidden: true, + component: (resolve) => require(['@/views/portal/case/Charts'], resolve), + name: 'caseCharts', + meta: {title: '排行榜', keepAlive: true, icon: 'dashboard', noCache: false, affix: true}, + }, + { + path: '/case/excellent', + hidden: true, + component: (resolve) => require(['@/views/portal/case/Excellent'], resolve), + name: 'caseExcellent', + meta: {title: '浏览量榜单', keepAlive: true, icon: 'dashboard', noCache: false, affix: true}, + }, { path: '/article', hidden: true, diff --git a/src/views/case/ManageList.vue b/src/views/case/ManageList.vue index 8b855b3a..96cf5cfa 100644 --- a/src/views/case/ManageList.vue +++ b/src/views/case/ManageList.vue @@ -32,6 +32,9 @@ +
+ 推荐榜单 +
@@ -49,6 +52,7 @@ @@ -121,6 +129,71 @@ 关闭 + +
+
+
+ + 年度 +
+ +
+
+
+ + 组织领域 +
+ +
+
+
+ 最佳理由 +
+ +
+
+ + 取 消 + 确 定 + +
+ +
+ + + + + + + + + + + +
+ +
@@ -131,6 +204,14 @@ export default { name: 'articleItems', data() { return { + adminList: [], + caseType: process.env.VUE_APP_CASE_TYPE, + RankingShow: false, + bestYear: '', + bestOrg: '', + bestId: '', + bestTextarea: '', + bestValue: false, excellent: false, queryObj: { pageIndex: 1, @@ -139,6 +220,8 @@ export default { excellent: '', }, //查询对象 caseList: [], //案例列表 + tableData: [], + caseIds: '', count: 0, recommend: { dlgShow: false, @@ -171,8 +254,150 @@ export default { }, mounted() { this.getData(); + this.getList(); + apiCase.treeList(1,Number(this.caseType ?? 155),1).then(res=>{ + if(res.code == 200){ + this.adminList = res.result; + } + }) + }, + watch:{ + RankingShow(val){ + if(val){ + this.getList() + } + } }, methods: { + orgDomainTranslate(code) { // 组织领域翻译 + if (code == '') { + return + } + let name = ''; + let data = this.adminList.find(item => { + return item.code == code; + }); + if (data) { + name = data.name; + } + return name; + }, + suggest(record){ + this.$confirm('你确认要推荐此案例么?', '提示', { + confirmButtonText: '确定', + cancelButtonText: '取消', + type: 'warning' + }).then(() => { + apiCase.riseIntoRank({caseId:record.id}).then(res=>{ + if(res.status == 200 ){ + this.$message.success('成功') + this.getData() + } + }).catch(()=>{ + this.$message.error('失败') + }) + }) + }, + handleNotRank(record){ + this.$confirm('你确认要取消推荐么?', '提示', { + confirmButtonText: '确定', + cancelButtonText: '取消', + type: 'warning' + }).then(() => { + apiCase.cancelRiseIntoRank({caseId:record?.caseId}).then(res=>{ + if(res.status == 200){ + this.$message.success('取消推荐成功') + this.getList() + this.getData() + } + }).catch(()=>{ + this.$message.error('取消推荐失败') + }) + }) + }, + moveUp(row,index){ + console.log(row,index,'index') + if(index == 0){ + this.$message.error('已经排到第一位了') + return + } + this.swapArray(this.tableData,index,index-1) + }, + moveDown(row,index){ + if(index == this.tableData.length - 1){ + this.$message.error('已经排到最后一位了') + return + } + this.swapArray(this.tableData,index,index+1) + }, + swapArray(arr, index1, index2){ + const temp = arr[index1]; + arr.splice(index1, 1); + arr.splice(index2, 0, temp); + }, + getList(){ + apiCase.getQueryRecommendRank({pageSize:3}).then(res=>{ + console.log(res,'res') + if(res.status == 200){ + this.tableData = res.result + this.caseIds = res.result.map(item=>item.caseId).join(',') + } + }) + }, + notBest(){ + this.bestValue = false + this.bestYear = '' + this.bestOrg = '' + this.bestId = '' + this.bestTextarea = '' + }, + parameBest(){ + this.excellent = true; + let data = { + id: this.bestId, + excellent: this.excellent, + excellentReason: this.bestTextarea + } + apiCase.excellent(data).then(res=>{ + if (res.status == 200) { + this.$message({ + type: 'success', + message: '设置最佳案例成功!' + }); + this.getData() + }else{ + this.$message({ + type: 'error', + message: '设置最佳案例失败!' + }); + } + this.notBest() + }) + }, + recoRanking(){ + this.RankingShow = true + }, + closeDrawer(){ + this.RankingShow = false + }, + queryList(){ + if(this.caseIds != this.tableData.map(item=>item.caseId).join(',')){ + apiCase.adjustRank({caseIds:this.tableData.map(item=>item.caseId).join(',')}).then(res=>{ + if(res.status == 200){ + this.$message({ + message: '调整成功', + type: 'success' + }) + } + }).catch(()=>{ + this.$message({ + message: '调整失败', + type: 'error' + }) + }) + } + this.RankingShow = false + }, // 导出 importList() { apiCase.exports(this.queryObj).then(res => { @@ -354,6 +579,12 @@ export default { this.$message({ type: 'info', message: '已取消删除', offset: 50 }); }); }, + theBest(item){ + this.bestValue = true + this.bestId = item.id + this.bestOrg = this.orgDomainTranslate(item.orgDomainParent) + this.bestYear = item.sysCreateTime.split('-')[0] + }, //添加推荐 shareItem(item) { this.shareItemData = { ...item } @@ -467,6 +698,48 @@ export default { \ No newline at end of file diff --git a/src/views/portal/case/Excellent.vue b/src/views/portal/case/Excellent.vue new file mode 100644 index 00000000..f9aaebf1 --- /dev/null +++ b/src/views/portal/case/Excellent.vue @@ -0,0 +1,644 @@ + + + + + \ No newline at end of file diff --git a/src/views/portal/case/Index.vue b/src/views/portal/case/Index.vue index c80452a5..b8470d40 100644 --- a/src/views/portal/case/Index.vue +++ b/src/views/portal/case/Index.vue @@ -139,23 +139,53 @@
+ 全部 最佳案例 + :class="{ actice: queryCondition.type == 'excellent' }">年度最佳 推荐案例 - 最热 最新 + :class="{ actice: queryCondition.type == 'new' }">最新 -->
-
当前已检索 - {{ caseList.count }} 条数据
+ +
+
发布时间
+
+
+
+
+
+
+
浏览量
+
+
+
+
+
+ style=" width: 147px; border-radius:20px !important;" placeholder="全部年份"> +
+
+
收藏案例
+
+
+
+
浏览记录
+
+
+
+
+
+ 当前已检索 + {{ caseList.count }} 条数据
@@ -170,9 +200,15 @@
- - 最佳 + 最佳 --> + + {{item.excellentTag}} + + + {{tag.tagName}} +
@@ -184,7 +220,7 @@
+ :sex="item.authorInfo.sex" :authorTags="item.authorTags" :aid="item.authorInfo.aid">