feat:增加项目-排行榜-积分排行榜-列表/搜索/重置

This commit is contained in:
wyx
2023-02-08 16:07:35 +08:00
parent 2dd9298ea4
commit e32ec87fd3

View File

@@ -877,11 +877,11 @@
</div> </div>
</div> </div>
<div class="right"> <div class="right">
<div class="btn btn1" @click="rankSearch"> <div class="btn btn1" @click="rankSearch" style="cursor: pointer;">
<div class="img1"></div> <div class="img1"></div>
<div class="te">搜索</div> <div class="te">搜索</div>
</div> </div>
<div class="btn btn2" @click="rankReset"> <div class="btn btn2" @click="rankReset" style="cursor: pointer;">
<div class="img2"></div> <div class="img2"></div>
<div class="te">重置</div> <div class="te">重置</div>
</div> </div>
@@ -928,6 +928,7 @@
<a-select <a-select
v-model:value="valuestu3" v-model:value="valuestu3"
style="width: 80px" style="width: 80px"
@change="jfSelectChange"
:options="rankxuefen" :options="rankxuefen"
></a-select> ></a-select>
</div> </div>
@@ -937,7 +938,7 @@
<a-table <a-table
:columns="xuefentablecolumns" :columns="xuefentablecolumns"
:data-source="xuefentabledata" :data-source="xuefentabledata"
:loading="tableDataTotal === -1 ? true : false" :loading="scoreRankLoading"
expandRowByClick="true" expandRowByClick="true"
:scroll="{ y: 330 }" :scroll="{ y: 330 }"
@expand="expandTable" @expand="expandTable"
@@ -2308,10 +2309,10 @@ export default {
valuestu2: "第一阶段", valuestu2: "第一阶段",
//积分排行 //积分排行
rankxuefen: [ rankxuefen: [
{ value: "学员", label: "学员" }, { value: 0, label: "学员" },
{ value: "小组", label: "小组" }, { value: 1, label: "小组" },
], ],
valuestu3: "学员", valuestu3: 0,
//学时排行 //学时排行
rankxueshi: [ rankxueshi: [
{ value: "学员", label: "学员" }, { value: "学员", label: "学员" },
@@ -2359,7 +2360,7 @@ export default {
checkedBOEU: false, //是否BOEU实施 checkedBOEU: false, //是否BOEU实施
radioV1: "", radioV1: "",
radioV2: "", radioV2: "",
activeKey: "7", //1:概览 2.任务... activeKey: "6", //1:概览 2.任务...
activeKey1: "8", //8:学员管理 9小组管理 activeKey1: "8", //8:学员管理 9小组管理
activeKey2: "3", activeKey2: "3",
activeKeyNotice: "11", activeKeyNotice: "11",
@@ -2514,84 +2515,35 @@ export default {
className: "h", className: "h",
}, },
], ],
scoreRankLoading:true,
//学分排行表 //学分排行表
xuefentabledata: [ xuefentabledata: [
{
rank: "1",
name: "哈哈",
jd: "80",
},
{
rank: "2",
name: "哈哈",
jd: "70",
},
{
rank: "3",
name: "哈哈",
jd: "70",
},
{
rank: "4",
name: "哈哈",
jd: "70",
},
{
rank: "5",
name: "哈哈",
jd: "70",
},
{
rank: "6",
name: "哈哈",
jd: "70",
},
{
rank: "7",
name: "哈哈",
jd: "70",
},
{
rank: "8",
name: "哈哈",
jd: "70",
},
{
rank: "9",
name: "哈哈",
jd: "70",
},
{
rank: "10",
name: "哈哈",
jd: "7",
},
], ],
xuefentablecolumns: [ xuefentablecolumns: [
{ {
title: "排名", title: "排名",
dataIndex: "rank", dataIndex: "index",
key: "rank", key: "index",
width: 50, width: 50,
align: "center", align: "center",
className: "h", className: "h",
customRender: (text) => { customRender: (text) => {
if (text.record.rank == "1") { if (text.record.index == "1") {
return ( return (
<img <img
style={{ width: 24, height: 24 }} style={{ width: 24, height: 24 }}
src={require("../../assets/images/taskpage/one.png")} src={require("../../assets/images/taskpage/one.png")}
/> />
); );
} else if (text.record.rank == "2") { } else if (text.record.index == "2") {
return ( return (
<img <img
style={{ width: 24, height: 24 }} style={{ width: 24, height: 24 }}
src={require("../../assets/images/taskpage/two.png")} src={require("../../assets/images/taskpage/two.png")}
/> />
); );
} else if (text.record.rank == "3") { } else if (text.record.index == "3") {
return ( return (
<img <img
style={{ width: 24, height: 24 }} style={{ width: 24, height: 24 }}
@@ -2599,7 +2551,7 @@ export default {
/> />
); );
} else { } else {
return <div>{text.record.rank}</div>; return <div>{text.record.index}</div>;
} }
}, },
}, },
@@ -2614,8 +2566,8 @@ export default {
{ {
title: "积分", title: "积分",
dataIndex: "jd", dataIndex: "pointsCountStr",
key: "jd", key: "pointsCountStr",
width: 50, width: 50,
align: "center", align: "center",
className: "h", className: "h",
@@ -2890,50 +2842,57 @@ export default {
// 排行榜 - start // 排行榜 - start
// 积分排行榜 Top10 // 积分排行榜 Top10
// 项目积分切换查询 -- 学员 小组
const jfSelectChange = (e) => {
console.log(e)
scoreRank();
}
//项目积分榜单 //项目积分榜单
// const scoreRank = (period, type) => { const scoreRank = (period, type) => {
// state.scoreRankLoading = true; state.scoreRankLoading = true;
// state.datascore = []; state.datascore = [];
// state.datascoreg = []; state.datascoreg = [];
// console.log("projectId----->", props.projectId,period, type); console.log("projectId----->", state.projectId,period, type);
// console.log('我是查询榜单传递的数据',{ console.log('我是查询榜单传递的数据',{
// projectId: props.projectId, // 项目id projectId: state.projectId, // 项目id
// name: state.searchRankName, // 名字,没有则传空字符串 name: "", // 名字,没有则传空字符串
// startTime:state.startTime, // 数据查询的起始时间 10位时间戳 startTime: state.rankStartTime?state.rankStartTime:0, // 数据查询的起始时间 10位时间戳
// size: 5, // 前多少名 endTime: state.rankEndTime?state.rankEndTime:0,
// type: Number(state.stuValue), // 查询类型 0 学员积分榜 1 小组积分榜 size: 10, // 前多少名
// }) type: Number(state.valuestu3), // 查询类型 0 学员积分榜 1 小组积分榜
// let obj = { })
// projectId: props.projectId, // 项目id let obj = {
// name: state.searchRankName, // 名字,没有则传空字符串 projectId: state.projectId, // 项目id
// startTime: state.startTime, // 数据查询的起始时间 10位时间戳 name: "", // 名字,没有则传空字符串
// size: 5, // 前多少名 startTime: state.rankStartTime?state.rankStartTime:0, // 数据查询的起始时间 10位时间戳
// type: Number(state.stuValue), // 查询类型 0 学员积分榜 1 小组积分榜 endTime: state.rankEndTime?state.rankEndTime:0,
// }; size: 10, // 前多少名
type: Number(state.valuestu3), // 查询类型 0 学员积分榜 1 小组积分榜
};
// api api
// .scoreRank(obj) .scoreRank(obj)
// .then((res) => { .then((res) => {
// console.log("获取项目积分-榜单", res); console.log("获取项目积分-榜单", res);
// if(res.data.code==200){ if(res.data.code==200){
// state.datascore = res.data.data; state.datascore = res.data.data;
// state.datascoreg = res.data.data; state.datascoreg = res.data.data;
// state.scoreRankLoading = false; state.scoreRankLoading = false;
// }else{ }else{
// state.datascore = []; state.datascore = [];
// state.datascoreg = []; state.datascoreg = [];
// state.scoreRankLoading = false; state.scoreRankLoading = false;
// } }
// }) })
// .catch((err) => { .catch((err) => {
// console.log("获取项目积分-榜单失败", err); console.log("获取项目积分-榜单失败", err);
// message.destroy(); message.destroy();
// message.error('榜单获取失败'); message.error('榜单获取失败');
// state.datascore = []; state.datascore = [];
// state.datascoreg = []; state.datascoreg = [];
// state.scoreRankLoading = false; state.scoreRankLoading = false;
// }); });
// }; };
// 排行榜 - end // 排行榜 - end
@@ -3651,11 +3610,15 @@ export default {
//排行榜 //排行榜
if (e == 6) { if (e == 6) {
//获取进度榜 //获取进度榜
getbillboard(1, 1); // getbillboard(1, 1);
//获取学分榜 //获取学分榜
getbillboard(2, 1); // getbillboard(2, 1);
//获取学时榜 //获取学时榜
getbillboard(3, 1); // getbillboard(3, 1);
// 获取积分排行榜
scoreRank();
} else if (e == 3) { } else if (e == 3) {
state.tabFlag = true; state.tabFlag = true;
} else { } else {
@@ -3702,11 +3665,14 @@ state.ischeckCertificate=false
//搜索 //搜索
const rankSearch = () => { const rankSearch = () => {
//获取进度榜 //获取进度榜
getbillboard(1, 1); // getbillboard(1, 1);
//获取学分榜 //获取学分榜
getbillboard(2, 1); // getbillboard(2, 1);
//获取学时榜 //获取学时榜
getbillboard(3, 1); // getbillboard(3, 1);
// 获取积分排行
scoreRank();
}; };
//重置 //重置
const rankReset = () => { const rankReset = () => {
@@ -3714,6 +3680,9 @@ state.ischeckCertificate=false
state.rankEndTime = null; state.rankEndTime = null;
state.valueDate = null; state.valueDate = null;
state.valueName = null; state.valueName = null;
// 获取积分排行
scoreRank()
}; };
// end -----排行榜----------------排行榜----------------------排行榜-----------排行榜---------- // end -----排行榜----------------排行榜----------------------排行榜-----------排行榜----------
@@ -4826,6 +4795,10 @@ state.ischeckCertificate=false
previewPic, previewPic,
getCertificate, getCertificate,
checkCertificate, checkCertificate,
scoreRank,
jfSelectChange,
}; };
}, },
}; };