mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/fe-manage.git
synced 2025-12-15 05:46:45 +08:00
feat:锁定选中阶段 面授获取 公告 历史公告 项目积分规则 项目共享文档
This commit is contained in:
@@ -291,9 +291,10 @@ import StuScoreDetail from "../../components/drawers/StuScoreDetail";
|
||||
import { reactive, toRefs, computed, onMounted } from "vue";
|
||||
import * as api from "../../api/index1";
|
||||
// import { message } from "ant-design-vue";
|
||||
// import { scoreRule } from "../../api/indexTaskadd"; //获取项目积分规则
|
||||
import { scoreRule } from "../../api/indexTaskadd"; //获取项目积分规则
|
||||
import { setScoreRule } from "../../api/indexTaskadd"; //设置项目积分规则
|
||||
import { getProjStu } from "../../api/indexProjStu";
|
||||
import { message } from "ant-design-vue";
|
||||
export default {
|
||||
name: "ProjectScore",
|
||||
components: {
|
||||
@@ -512,6 +513,8 @@ export default {
|
||||
if (e == 2) {
|
||||
// console.log('获取项目积分-榜单')
|
||||
scoreRank(1, 1);
|
||||
} else if (e == 3) {
|
||||
getScoreRule();
|
||||
}
|
||||
rankReset();
|
||||
state.todayvalue = "1";
|
||||
@@ -558,29 +561,55 @@ export default {
|
||||
});
|
||||
};
|
||||
// end -----榜单----------------榜单----------------------榜单-----------榜单----------
|
||||
//设置积分规则
|
||||
const editRule = () => {
|
||||
console.log(props.projectId);
|
||||
let obj = {
|
||||
courseScore: state.score1,
|
||||
examItem: {
|
||||
numLimit: 0,
|
||||
score: state.five2,
|
||||
scoreLimit: state.five1,
|
||||
},
|
||||
//有名次要求的提交作业
|
||||
homeworkItem: {
|
||||
numLimit: state.four3,
|
||||
score: state.four5,
|
||||
scoreLimit: state.four4,
|
||||
},
|
||||
examItem: [
|
||||
{
|
||||
id: 0,
|
||||
projectId: props.projectId,
|
||||
numLimit: 0,
|
||||
score: state.five2,
|
||||
scoreLimit: state.five1,
|
||||
type: 3,
|
||||
},
|
||||
],
|
||||
|
||||
homeworkItem: [
|
||||
//有名次要求的提交作业
|
||||
{
|
||||
id: 0,
|
||||
projectId: props.projectId,
|
||||
numLimit: state.four3,
|
||||
score: state.four5,
|
||||
scoreLimit: state.four4,
|
||||
type: 2,
|
||||
},
|
||||
//无名次要求的提交作业
|
||||
{
|
||||
id: 0,
|
||||
projectId: props.projectId,
|
||||
numLimit: 0,
|
||||
score: state.done3,
|
||||
scoreLimit: state.done2,
|
||||
type: 2,
|
||||
},
|
||||
],
|
||||
leaderScore: state.seven1,
|
||||
projectId: props.projectId,
|
||||
signScore: state.six1,
|
||||
topCompleteCourseItem: {
|
||||
numLimit: state.four1,
|
||||
score: state.four2,
|
||||
scoreLimit: 0,
|
||||
},
|
||||
topCompleteCourseItem: [
|
||||
{
|
||||
id: 0,
|
||||
projectId: props.projectId,
|
||||
numLimit: state.four1,
|
||||
score: state.four2,
|
||||
scoreLimit: 0,
|
||||
type: 1,
|
||||
},
|
||||
],
|
||||
topStudentScore: state.seven2,
|
||||
totalScore: scoresum.value,
|
||||
};
|
||||
@@ -588,9 +617,13 @@ export default {
|
||||
setScoreRule(obj)
|
||||
.then((res) => {
|
||||
console.log(res.data, "修改成功");
|
||||
message.destroy();
|
||||
return message.success("修改积分规则成功");
|
||||
})
|
||||
.catch((err) => {
|
||||
console.log(err.data);
|
||||
message.destroy();
|
||||
return message.warning("修改积分规则失败");
|
||||
});
|
||||
// scoreRule({
|
||||
// projectId: props.projectId,
|
||||
@@ -655,6 +688,33 @@ export default {
|
||||
state.searchNameValue = null;
|
||||
getStu();
|
||||
};
|
||||
const getScoreRule = () => {
|
||||
scoreRule({
|
||||
projectId: props.projectId,
|
||||
})
|
||||
.then((res) => {
|
||||
console.log("获取了项目积分规则", res.data.data);
|
||||
let result = res.data.data;
|
||||
scoresum.value = result.totalScore; //Write operation failed: computed value is readonly
|
||||
state.seven1 = result.leaderScore;
|
||||
state.score1 = result.courseScore;
|
||||
state.done2 = result.homeworkItem[1].scoreLimit;
|
||||
state.done3 = result.homeworkItem[1].score;
|
||||
state.four1 = result.topCompleteCourseItem[0].numLimit;
|
||||
state.four2 = result.topCompleteCourseItem[0].score;
|
||||
state.four3 = result.homeworkItem[0].numLimit;
|
||||
state.four4 = result.homeworkItem[0].scoreLimit;
|
||||
state.four5 = result.homeworkItem[0].score;
|
||||
state.five1 = result.examItem[0].scoreLimit;
|
||||
state.five2 = result.examItem[0].score;
|
||||
state.six1 = result.signScore;
|
||||
state.seven1 = result.leaderScore;
|
||||
state.seven2 = result.topStudentScore;
|
||||
})
|
||||
.catch((err) => {
|
||||
console.log("获取项目积分规则失败了", err);
|
||||
});
|
||||
};
|
||||
onMounted(() => {
|
||||
getStu();
|
||||
});
|
||||
@@ -673,6 +733,7 @@ export default {
|
||||
changePagination,
|
||||
searchStu,
|
||||
resetStud,
|
||||
getScoreRule,
|
||||
};
|
||||
},
|
||||
// computed: {
|
||||
|
||||
Reference in New Issue
Block a user