feat:增加项目积分的学员获取

This commit is contained in:
lixg
2022-11-07 15:59:58 +08:00
parent 58652aa012
commit cac7ff9ec1
3 changed files with 81 additions and 10 deletions

View File

@@ -2,7 +2,7 @@
* @Author: lixg lixg@dongwu-inc.com
* @Date: 2022-11-04 22:45:31
* @LastEditors: lixg lixg@dongwu-inc.com
* @LastEditTime: 2022-11-06 16:48:50
* @LastEditTime: 2022-11-07 11:12:01
* @FilePath: /fe-manage/src/api/index1.js
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
@@ -72,12 +72,22 @@ export const addStudent = (obj) => http.post('/admin/router/addStudent', obj);
//项目基础信息-----------------------------------
//学员获取
export const getProjectStudent=(obj)=>http.post('/admin/project/studentList',obj)
//项目积分榜单
export const scoreRank = (obj) => http.post('/admin/project/scoreRank', obj);
//获取规则
export const scoreRule=(projectId)=>http.get('/admin/project/scoreRule',{
params: {
projectId: projectId,
}
})
//排行榜
export const billboard = (obj) => http.post('/admin/project/billboard', obj);
//项目基础信息-----------------------------------
// 测试方法
// import * as api from '../../api/index'
// api.getLearnPath({}).then(res => {

View File

@@ -9,16 +9,16 @@
<div class="groupname" style="width: 42px">姓名</div>
<a-input
class="ant-input"
v-model:value="value"
v-model:value="studentName"
placeholder="请输入姓名"
/>
</div>
<div class="groupright">
<div class="btn1">
<div class="btn1" @click="searchProjectStudent">
<img src="../../assets/images/courseManage/search0.png" />
<span class="btn1text">搜索</span>
</div>
<div class="btn2">
<div class="btn2" @click="projectStudentReset">
<img src="../../assets/images/courseManage/reset1.png" />
<span class="btn2text">重置</span>
</div>
@@ -367,13 +367,17 @@ export default {
activeKeyScore: "2",
stuName: "请输入姓名",
todayvalue: "1",
tableDataTotal: 30,
stuValue: false,
Svisible: false,
score1: 5,
score2: 5,
edit: true,
searchRankName:null,//榜单搜索名称
studentName:null,//学员搜索名称
pageSize:10,
currentPage:1,
tableDataTotal: -1,
});
const getTableData = () => {
let datas = state.tabledataStu;
@@ -399,21 +403,59 @@ export default {
getTableData();
const tabsChange = (e) => {
if (e == 1) {
// console.log('获取项目积分-学员')
getProjectStudent();
}
if (e == 2) {
// console.log('获取项目积分-榜单')
scoreRank(1, 1);
}
if(e==3){
scoreRule()
}
projectStudentReset()
rankReset()
state.todayvalue='1'
state.stuValue=1
};
// start -------学员---------------学员------------学员------------------学员---------
//重置
const projectStudentReset=()=>{
state.studentName=null
}
//搜索
const searchProjectStudent = () => {
state.currentPage=1
getProjectStudent()
};
//项目积分榜单
const getProjectStudent = () => {
console.log("projectId", props.projectId,state.studentName);
let obj = {
projectId:props.projectId,
pageSize:state.pageSize,
pageNo:state.currentPage,
name:state.studentName,
};
api
.getProjectStudent(obj)
.then((res) => {
console.log("获取项目积分-学员", res);
})
.catch((err) => {
console.log("获取项目积分-学员", err);
});
};
// end -----学员----------------学员----------------------学员-----------学员----------
// start -------榜单---------------榜单------------榜单------------------榜单---------
//重置
const rankReset=()=>{
state.searchRankName=null
}
// start -------榜单---------------榜单------------榜单------------------榜单---------
//学员积分还是小组积分
const typeChange = (num) => {
state.stuValue = num;
@@ -449,6 +491,22 @@ export default {
});
};
// end -----榜单----------------榜单----------------------榜单-----------榜单----------
// start -------获取规则---------------获取规则------------获取规则------------------获取规则---------
//获取规则
const scoreRule = () => {
console.log("projectId", props.projectId);
api
.scoreRule(props.projectId)
.then((res) => {
console.log("获取项目积分-获取规则", res);
})
.catch((err) => {
console.log("获取项目积分-获取规则", err);
});
};
// end -----获取规则----------------获取规则----------------------获取规则-----------获取规则----------
return {
...toRefs(state),
typeChange,
@@ -456,7 +514,11 @@ export default {
searchRank,
rankReset,
tabsChange,
projectStudentReset,
searchProjectStudent,
getProjectStudent,
scoreRank,
scoreRule,
};
},
computed: {

View File

@@ -1060,7 +1060,6 @@ export default {
const getStageData = (tableData) => {
let data = tableData;
let array = [];
console.log('tableData',data)
data.map((value) => {
let obj = {
id: value.stageId,
@@ -2350,9 +2349,9 @@ export default {
display: flex;
flex-direction: column;
align-items: center; // background-color: #bfa;
.chosen {
// background-color: pink;
}
// .chosen {
// // background-color: pink;
// }
.ghost {
// background-color: red;
opacity: 0 !important;