From 02784341411f7e3e8d9f90e7fa604a7604af0550 Mon Sep 17 00:00:00 2001 From: wyx Date: Fri, 3 Feb 2023 15:17:40 +0800 Subject: [PATCH 1/5] =?UTF-8?q?feat:=E5=A2=9E=E5=8A=A0=E9=A1=B9=E7=9B=AE?= =?UTF-8?q?=E7=A7=AF=E5=88=86-=E6=A6=9C=E5=8D=95-=EF=BC=88=E5=AD=A6?= =?UTF-8?q?=E5=91=98=E7=A7=AF=E5=88=86=E6=A6=9C=E3=80=81=E5=B0=8F=E7=BB=84?= =?UTF-8?q?=E7=A7=AF=E5=88=86=E6=A6=9C=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/index1.js | 3 +- src/components/drawers/ProjectScore.vue | 154 +++++++++++------------- 2 files changed, 74 insertions(+), 83 deletions(-) diff --git a/src/api/index1.js b/src/api/index1.js index 1a2376f0..b4049d65 100644 --- a/src/api/index1.js +++ b/src/api/index1.js @@ -87,7 +87,8 @@ export const editLearnInfo = (obj) => http.post('/admin/router/editInfo', obj) //项目基础信息----------------------------------- //项目积分榜单 -export const scoreRank = (obj) => http.post("/admin/project/scoreRank", obj); +// export const scoreRank = (obj) => http.post("/admin/project/scoreRank", obj); +export const scoreRank = (params) => http.get('/points/top/list', { params }) //排行榜 export const billboard = (obj) => http.post("/admin/project/billboard", obj); //项目基础信息----------------------------------- diff --git a/src/components/drawers/ProjectScore.vue b/src/components/drawers/ProjectScore.vue index 0d322145..7fbbda9f 100644 --- a/src/components/drawers/ProjectScore.vue +++ b/src/components/drawers/ProjectScore.vue @@ -53,21 +53,21 @@
-
+
-
学员积分榜
+
学员积分榜
-
+
-
小组积分榜
+
小组积分榜
@@ -104,33 +104,33 @@
- + @@ -296,6 +296,7 @@ import { scoreRule } from "../../api/indexTaskadd"; //获取项目积分规则 import { setScoreRule } from "../../api/indexTaskadd"; //设置项目积分规则 import { getProjStu } from "../../api/indexProjStu"; import { message } from "ant-design-vue"; +import {checkPer} from "@/utils/utils"; export default { name: "ProjectScore", components: { @@ -390,67 +391,20 @@ export default { }, ], datascore: [ - { - id: 1, - name: "张三的名字很长很长很长", - score: "10分", - }, - { - id: 2, - name: "李四", - score: "10分", - }, - { - id: 3, - name: "王五的名字一定要比张三的还长", - score: "10分", - }, - { - id: 4, - name: "赵六", - score: "10分", - }, - { - id: 5, - name: "冯七", - score: "10分", - }, + ], datascoreg: [ - { - id: 1, - name: "第一组的同学们", - score: "10分", - }, - { - id: 2, - name: "第2组的同学们", - score: "9分", - }, - { - id: 3, - name: "第3组的同学们", - score: "8分", - }, - { - id: 4, - name: "第4组的同学们", - score: "7分", - }, - { - id: 5, - name: "第五组的同学们", - score: "6分", - }, + ], + scoreRankLoading:true, valueName: "", //排行榜输入姓名 valueDate: "", //排行榜输入日期 noticeChecked: true, noticeContent: "请输入要发布的公告", - activeKeyScore: "2", + activeKeyScore: "1", stuName: "请输入姓名", todayvalue: "1", - stuValue: false, + stuValue: 0, Svisible: false, score1: null, done2: null, @@ -466,13 +420,14 @@ export default { seven1: null, seven2: null, edit: true, - searchRankName: null, //榜单搜索名称 + searchRankName: "", //榜单搜索名称 pageSize: 10, currentPage: 1, tableDataTotal: null, searchNameValue: null, //学员获取的姓名 checkStuId: null, proId: null, + startTime: (new Date(new Date(new Date().toLocaleDateString()).getTime())).getTime().toString() }); const getTableData = () => { let datas = state.tabledataStu; @@ -517,52 +472,86 @@ export default { const tabsChange = (e) => { if (e == 2) { // console.log('获取项目积分-榜单') - scoreRank(1, 1); + scoreRank(); } else if (e == 3) { getScoreRule(); } rankReset(); state.todayvalue = "1"; - state.stuValue = 1; + state.stuValue = 0; }; //重置 const rankReset = () => { - state.searchRankName = null; + state.searchRankName = ""; + scoreRank(); }; // start -------榜单---------------榜单------------榜单------------------榜单--------- //学员积分还是小组积分 const typeChange = (num) => { - state.stuValue = num; - scoreRank(state.stuValue, state.todayvalue); + console.log(num) + state.stuValue = Number(num); + scoreRank(); }; //选择时间 const changeday = (e) => { state.todayvalue = e.target.value; - scoreRank(state.stuValue, state.todayvalue); + console.log('切换时间显示-今天-七天-近一个月', e.target.value) + if(e.target.value==1){ + state.startTime = (new Date(new Date(new Date().toLocaleDateString()).getTime())).getTime().toString() + }else if(e.target.value==2){ + state.startTime = ((new Date(new Date(new Date().toLocaleDateString()).getTime())).getTime() - 7*24*60*60*1000).toString() + }else{ + state.startTime = ((new Date(new Date(new Date().toLocaleDateString()).getTime())).getTime() - 31*24*60*60*1000).toString() + } + scoreRank(); }; //搜索 const searchRank = () => { - scoreRank(state.stuValue, state.todayvalue); + scoreRank(); }; //项目积分榜单 const scoreRank = (period, type) => { - console.log("projectId", props.projectId); + state.scoreRankLoading = true; + state.datascore = []; + state.datascoreg = []; + console.log("projectId----->", props.projectId,period, type); + console.log('我是查询榜单传递的数据',{ + projectId: props.projectId, // 项目id + name: state.searchRankName, // 名字,没有则传空字符串 + startTime:state.startTime, // 数据查询的起始时间 10位时间戳 + size: 5, // 前多少名 + type: Number(state.stuValue), // 查询类型 0 学员积分榜 1 小组积分榜 + }) let obj = { - name: state.searchRankName, - pageNo: 1, - pageSize: 5, - period: Number(period), - projectId: props.projectId, - type: Number(type), + projectId: props.projectId, // 项目id + name: state.searchRankName, // 名字,没有则传空字符串 + startTime: state.startTime, // 数据查询的起始时间 10位时间戳 + size: 5, // 前多少名 + type: Number(state.stuValue), // 查询类型 0 学员积分榜 1 小组积分榜 }; + api .scoreRank(obj) .then((res) => { console.log("获取项目积分-榜单", res); + if(res.data.code==200){ + state.datascore = res.data.data; + state.datascoreg = res.data.data; + state.scoreRankLoading = false; + }else{ + state.datascore = []; + state.datascoreg = []; + state.scoreRankLoading = false; + } }) .catch((err) => { console.log("获取项目积分-榜单失败", err); + message.destroy(); + message.error('榜单获取失败'); + state.datascore = []; + state.datascoreg = []; + state.scoreRankLoading = false; }); }; // end -----榜单----------------榜单----------------------榜单-----------榜单---------- @@ -739,6 +728,7 @@ export default { searchStu, resetStud, getScoreRule, + checkPer }; }, // computed: { From 531a9d37cb7755515797eb4689fabc6eb60521b1 Mon Sep 17 00:00:00 2001 From: wyx Date: Fri, 3 Feb 2023 16:30:39 +0800 Subject: [PATCH 2/5] =?UTF-8?q?feat:=E4=BF=AE=E6=94=B9=E9=83=A8=E5=88=86?= =?UTF-8?q?=E5=8D=8F=E8=AE=AE=E6=8E=A5=E5=8F=A3=E8=87=AA=E5=8A=A8=E8=8E=B7?= =?UTF-8?q?=E5=8F=96=EF=BC=88http/https=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env | 12 ++++++------ .env.boe | 4 ++-- .env.prod | 12 ++++++------ .env.release | 12 ++++++------ .env.test | 2 +- src/api/method.js | 4 ++-- src/api/request.js | 2 +- src/components/NavTop.vue | 2 +- src/views/courselibrary/CoursewareManage.vue | 2 +- vue.config.js | 4 ++-- 10 files changed, 28 insertions(+), 28 deletions(-) diff --git a/.env b/.env index 5afca6ef..d398e4b1 100644 --- a/.env +++ b/.env @@ -5,21 +5,21 @@ VUE_APP_BASE_API=/manageApi #文件路径 VUE_APP_FILE_PATH=/upload/ # 代理url 本地调试,不可以用在其他地方 -VUE_APP_PROXY_URL=http://43.143.139.204/manageApi +VUE_APP_PROXY_URL=//43.143.139.204/manageApi # 登录url -VUE_APP_LOGIN_URL=https://u-pre.boe.com/web +VUE_APP_LOGIN_URL=//u-pre.boe.com/web # boe域名 -VUE_APP_BOE_API_URL=https://u-pre.boe.com +VUE_APP_BOE_API_URL=//u-pre.boe.com #打包路径 VUE_APP_OUTPUT_DIR=./dist # iframe嵌套url -VUE_APP_IFRAME_URL=https://u-pre.boe.com/pc/iframe +VUE_APP_IFRAME_URL=//u-pre.boe.com/pc/iframe # 学员端路由 -VUE_APP_IFRAME_STUDENT_URL=https://u-pre.boe.com/pc/loadingVUE_APP_BOE_API_URLVUE_APP_BOE_API_URL +VUE_APP_IFRAME_STUDENT_URL=//u-pre.boe.com/pc/loadingVUE_APP_BOE_API_URLVUE_APP_BOE_API_URL # 课程二维码 -VUE_APP_COURSE_STUDY=https://u-pre.boe.com/pc/course/studyindex?id= +VUE_APP_COURSE_STUDY=//u-pre.boe.com/pc/course/studyindex?id= # 导入学员模板 VUE_APP_UP_LOAD_STUDENT_TEMPLATE=导入学员模版-1673963663229.xlsx diff --git a/.env.boe b/.env.boe index fdaf95b3..65a0c556 100644 --- a/.env.boe +++ b/.env.boe @@ -2,9 +2,9 @@ NODE_ENV=boe VUE_APP_BASE=/manage VUE_APP_BASE_API=/manageApi -VUE_APP_LOGIN_URL=https://u-pre.boe.com/web +VUE_APP_LOGIN_URL=//u-pre.boe.com/web -VUE_APP_BOE_API_URL=https://u-pre.boe.com +VUE_APP_BOE_API_URL=//u-pre.boe.com # 导入学员模板 VUE_APP_UP_LOAD_STUDENT_TEMPLATE=导入学员模版-1673963663229.xlsx \ No newline at end of file diff --git a/.env.prod b/.env.prod index 3fc171f3..f7f9f813 100644 --- a/.env.prod +++ b/.env.prod @@ -2,15 +2,15 @@ NODE_ENV=prod VUE_APP_BASE=/manage VUE_APP_BASE_API=/manageApi -VUE_APP_PROXY_URL=https://u.boe.com/ +VUE_APP_PROXY_URL=//u.boe.com/ -VUE_APP_LOGIN_URL=https://u.boe.com/web +VUE_APP_LOGIN_URL=//u.boe.com/web -VUE_APP_BOE_API_URL=https://u.boe.com +VUE_APP_BOE_API_URL=//u.boe.com -VUE_APP_IFRAME_URL=https://u.boe.com/pc/iframe -VUE_APP_IFRAME_STUDENT_URL=https://u.boe.com/pc/loading +VUE_APP_IFRAME_URL=//u.boe.com/pc/iframe +VUE_APP_IFRAME_STUDENT_URL=//u.boe.com/pc/loading -VUE_APP_COURSE_STUDY=https://u.boe.com/pc/course/studyindex?id= +VUE_APP_COURSE_STUDY=//u.boe.com/pc/course/studyindex?id= VUE_APP_UP_LOAD_STUDENT_TEMPLATE=导入学员模版-1673963663229.xlsx diff --git a/.env.release b/.env.release index 4870808f..55d0b0e4 100644 --- a/.env.release +++ b/.env.release @@ -2,15 +2,15 @@ NODE_ENV=release VUE_APP_BASE=/manage-release VUE_APP_BASE_API=/manageApi-release -VUE_APP_PROXY_URL=https://u-pre.boe.com/ -VUE_APP_LOGIN_URL=https://u.boe.com/web-release +VUE_APP_PROXY_URL=//u-pre.boe.com/ +VUE_APP_LOGIN_URL=//u.boe.com/web-release -VUE_APP_BOE_API_URL=https://u.boe.com +VUE_APP_BOE_API_URL=//u.boe.com -VUE_APP_IFRAME_URL=https://u.boe.com/pc-release/iframe -VUE_APP_IFRAME_STUDENT_URL=https://u.boe.com/pc-release/loading +VUE_APP_IFRAME_URL=//u.boe.com/pc-release/iframe +VUE_APP_IFRAME_STUDENT_URL=//u.boe.com/pc-release/loading -VUE_APP_COURSE_STUDY=https://u.boe.com/pc-release/course/studyindex?id= +VUE_APP_COURSE_STUDY=//u.boe.com/pc-release/course/studyindex?id= VUE_APP_UP_LOAD_STUDENT_TEMPLATE=导入学员模版-1673963663229.xlsx \ No newline at end of file diff --git a/.env.test b/.env.test index 310c858d..8772bab7 100644 --- a/.env.test +++ b/.env.test @@ -1,2 +1,2 @@ NODE_ENV=test -VUE_APP_BOE_API_URL=https://u-pre.boe.com \ No newline at end of file +VUE_APP_BOE_API_URL=//u-pre.boe.com \ No newline at end of file diff --git a/src/api/method.js b/src/api/method.js index d4cd4a3a..7e1add2b 100644 --- a/src/api/method.js +++ b/src/api/method.js @@ -277,9 +277,9 @@ const commonData = { const organizationalTree = [] //嵌套页面 -const iframeUrl = process.env.VUE_APP_IFRAME_URL +const iframeUrl = window.location.protocol + process.env.VUE_APP_IFRAME_URL //学员端路由 -const studentUrl = process.env.VUE_APP_IFRAME_STUDENT_URL +const studentUrl = window.location.protocol + process.env.VUE_APP_IFRAME_STUDENT_URL //二维码 const codeUrl = "https://u-pre.boe.com" diff --git a/src/api/request.js b/src/api/request.js index 54e2361d..ccd6697c 100644 --- a/src/api/request.js +++ b/src/api/request.js @@ -197,7 +197,7 @@ export async function boeRequest(_url, params) { } } const body = method !== 'get' ? params || {} : {} - url = process.env.NODE_ENV === 'development' ? url : process.env.VUE_APP_BOE_API_URL + url + url = process.env.NODE_ENV === 'development' ? url : window.location.protocol + process.env.VUE_APP_BOE_API_URL + url return fetch(url, { method, headers: { diff --git a/src/components/NavTop.vue b/src/components/NavTop.vue index d1d06503..6c05f4c3 100644 --- a/src/components/NavTop.vue +++ b/src/components/NavTop.vue @@ -81,7 +81,7 @@ const changeRole = (value) => { const logOut = () => { store.replaceState(createStore({state: {openpages: []}}).state); localStorage.clear(); - (process.env.NODE_ENV === 'development' || process.env.NODE_ENV === 'alpine') ? router.push({path: '/login'}) : (window.location.href = process.env.VUE_APP_LOGIN_URL) + (process.env.NODE_ENV === 'development' || process.env.NODE_ENV === 'alpine') ? router.push({path: '/login'}) : (window.location.href = window.location.protocol + process.env.VUE_APP_LOGIN_URL) };