mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/fe-manage.git
synced 2025-12-10 19:36:46 +08:00
feat:增加项目设置积分规则数据接入
This commit is contained in:
@@ -18,10 +18,10 @@ export const editProj = (obj) => http.post('/admin/project/edit', obj)
|
|||||||
export const editTask = (obj) => http.post('/admin/router/editTask', obj)
|
export const editTask = (obj) => http.post('/admin/router/editTask', obj)
|
||||||
|
|
||||||
//项目里获取项目积分规则
|
//项目里获取项目积分规则
|
||||||
export const scoreRule = (obj) => http.get('/admin/project/scoreRule', { params: obj })
|
export const scoreRule = (obj) => http.get('/points/project/rule', { params: obj })
|
||||||
|
|
||||||
//项目里设置项目积分规则
|
//项目里设置项目积分规则
|
||||||
export const setScoreRule = (obj) => http.post('/admin/project/setScoreRule', obj)
|
export const setScoreRule = (obj) => http.post('/points/project/rule/edit', obj)
|
||||||
|
|
||||||
//面授课开课列表
|
//面授课开课列表
|
||||||
export const planList = (obj) => http.post('/admin/offcourse/planList', obj)
|
export const planList = (obj) => http.post('/admin/offcourse/planList', obj)
|
||||||
|
|||||||
@@ -289,7 +289,7 @@
|
|||||||
|
|
||||||
<script>
|
<script>
|
||||||
import StuScoreDetail from "../../components/drawers/StuScoreDetail";
|
import StuScoreDetail from "../../components/drawers/StuScoreDetail";
|
||||||
import { reactive, toRefs, computed, onMounted } from "vue";
|
import { reactive, toRefs, onMounted } from "vue";
|
||||||
import * as api from "../../api/index1";
|
import * as api from "../../api/index1";
|
||||||
// import { message } from "ant-design-vue";
|
// import { message } from "ant-design-vue";
|
||||||
import { scoreRule } from "../../api/indexTaskadd"; //获取项目积分规则
|
import { scoreRule } from "../../api/indexTaskadd"; //获取项目积分规则
|
||||||
@@ -427,7 +427,8 @@ export default {
|
|||||||
searchNameValue: null, //学员获取的姓名
|
searchNameValue: null, //学员获取的姓名
|
||||||
checkStuId: null,
|
checkStuId: null,
|
||||||
proId: null,
|
proId: null,
|
||||||
startTime: (new Date(new Date(new Date().toLocaleDateString()).getTime())).getTime().toString()
|
startTime: (new Date(new Date(new Date().toLocaleDateString()).getTime())).getTime().toString(),
|
||||||
|
scoresum: 0
|
||||||
});
|
});
|
||||||
const getTableData = () => {
|
const getTableData = () => {
|
||||||
let datas = state.tabledataStu;
|
let datas = state.tabledataStu;
|
||||||
@@ -450,23 +451,7 @@ export default {
|
|||||||
});
|
});
|
||||||
state.tabledataStu = datas;
|
state.tabledataStu = datas;
|
||||||
};
|
};
|
||||||
const scoresum = computed(() => {
|
|
||||||
// console.log(Object.prototype.toString.call(Number(state.score1)));
|
|
||||||
// if (Object.prototype.toString.call(state.score1) !== "[object Number]") {
|
|
||||||
// message.destroy();
|
|
||||||
// return message.warning("请输入合法数字");
|
|
||||||
// }
|
|
||||||
return (
|
|
||||||
Number(state.score1) +
|
|
||||||
Number(state.done3) +
|
|
||||||
Number(state.four2) +
|
|
||||||
Number(state.four5) +
|
|
||||||
Number(state.five2) +
|
|
||||||
Number(state.six1) +
|
|
||||||
Number(state.seven1) +
|
|
||||||
Number(state.seven2)
|
|
||||||
);
|
|
||||||
});
|
|
||||||
getTableData();
|
getTableData();
|
||||||
|
|
||||||
const tabsChange = (e) => {
|
const tabsChange = (e) => {
|
||||||
@@ -559,55 +544,60 @@ export default {
|
|||||||
const editRule = () => {
|
const editRule = () => {
|
||||||
console.log(props.projectId);
|
console.log(props.projectId);
|
||||||
let obj = {
|
let obj = {
|
||||||
courseScore: state.score1,
|
projectId: Number(props.projectId),
|
||||||
examItem: [
|
datas:[
|
||||||
{
|
{
|
||||||
id: 0,
|
"type": 1,
|
||||||
projectId: props.projectId,
|
"pointsCount": Number(state.score1),
|
||||||
numLimit: 0,
|
"typeDesc": "完成【必修/选修】获得%p积分",
|
||||||
score: state.five2,
|
"typeDescConfig": ""
|
||||||
scoreLimit: state.five1,
|
|
||||||
type: 3,
|
|
||||||
},
|
},
|
||||||
],
|
|
||||||
|
|
||||||
homeworkItem: [
|
|
||||||
//有名次要求的提交作业
|
|
||||||
{
|
{
|
||||||
id: 0,
|
"type": 2,
|
||||||
projectId: props.projectId,
|
"pointsCount": Number(state.done3),
|
||||||
numLimit: state.four3,
|
"typeDesc": "完成作业成绩不低于%d分获得%p积分",
|
||||||
score: state.four5,
|
"typeDescConfig": state.done2
|
||||||
scoreLimit: state.four4,
|
|
||||||
type: 2,
|
|
||||||
},
|
},
|
||||||
//无名次要求的提交作业
|
|
||||||
{
|
{
|
||||||
id: 0,
|
"type": 3,
|
||||||
projectId: props.projectId,
|
"pointsCount": Number(state.four2),
|
||||||
numLimit: 0,
|
"typeDesc": "前%d名学完在线课程获得%p积分",
|
||||||
score: state.done3,
|
"typeDescConfig": state.four1
|
||||||
scoreLimit: state.done2,
|
|
||||||
type: 2,
|
|
||||||
},
|
},
|
||||||
],
|
|
||||||
leaderScore: state.seven1,
|
|
||||||
projectId: props.projectId,
|
|
||||||
signScore: state.six1,
|
|
||||||
topCompleteCourseItem: [
|
|
||||||
{
|
{
|
||||||
id: 0,
|
"type": 4,
|
||||||
projectId: props.projectId,
|
"pointsCount": Number(state.four5),
|
||||||
numLimit: state.four1,
|
"typeDesc": "前%d名提交作业且成绩不低于%d分获得%p积分",
|
||||||
score: state.four2,
|
"typeDescConfig": state.four3 + ';' + state.four4
|
||||||
scoreLimit: 0,
|
|
||||||
type: 1,
|
|
||||||
},
|
},
|
||||||
],
|
{
|
||||||
topStudentScore: state.seven2,
|
"type": 5,
|
||||||
totalScore: scoresum.value,
|
"pointsCount": Number(state.five2),
|
||||||
|
"typeDesc": "考试成绩高于%d分获得%p积分",
|
||||||
|
"typeDescConfig": state.five1
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": 6,
|
||||||
|
"pointsCount": Number(state.six1),
|
||||||
|
"typeDesc": "考勤正常学员获得%p积分",
|
||||||
|
"typeDescConfig": ""
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": 7,
|
||||||
|
"pointsCount": Number(state.seven1),
|
||||||
|
"typeDesc": "成为小组长获得%p积分",
|
||||||
|
"typeDescConfig": ""
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": 8,
|
||||||
|
"pointsCount": Number(state.seven2),
|
||||||
|
"typeDesc": "优秀学员可获得%p积分",
|
||||||
|
"typeDescConfig": ""
|
||||||
|
}
|
||||||
|
]
|
||||||
};
|
};
|
||||||
console.log(obj);
|
|
||||||
|
console.log('我是修改积分规则传递得参数', obj);
|
||||||
setScoreRule(obj)
|
setScoreRule(obj)
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
console.log(res.data, "修改成功");
|
console.log(res.data, "修改成功");
|
||||||
@@ -689,21 +679,30 @@ export default {
|
|||||||
.then((res) => {
|
.then((res) => {
|
||||||
console.log("获取了项目积分规则", res.data.data);
|
console.log("获取了项目积分规则", res.data.data);
|
||||||
let result = res.data.data;
|
let result = res.data.data;
|
||||||
scoresum.value = result.totalScore; //Write operation failed: computed value is readonly
|
//Write operation failed: computed value is readonly 总积分
|
||||||
state.seven1 = result.leaderScore;
|
|
||||||
state.score1 = result.courseScore;
|
state.scoresum = Number(result[0].pointsCount) + Number(result[1].pointsCount) + Number(result[2].pointsCount) + Number(result[3].pointsCount) + Number(result[4].pointsCount) + Number(result[5].pointsCount) + Number(result[6].pointsCount) + Number(result[7].pointsCount)
|
||||||
state.done2 = result.homeworkItem[1].scoreLimit;
|
|
||||||
state.done3 = result.homeworkItem[1].score;
|
state.score1 = result[0].pointsCount;
|
||||||
state.four1 = result.topCompleteCourseItem[0].numLimit;
|
|
||||||
state.four2 = result.topCompleteCourseItem[0].score;
|
state.done2 = result[1].typeDescConfig;
|
||||||
state.four3 = result.homeworkItem[0].numLimit;
|
state.done3 = result[1].pointsCount;
|
||||||
state.four4 = result.homeworkItem[0].scoreLimit;
|
|
||||||
state.four5 = result.homeworkItem[0].score;
|
state.four1 = result[2].typeDescConfig;
|
||||||
state.five1 = result.examItem[0].scoreLimit;
|
state.four2 = result[2].pointsCount;
|
||||||
state.five2 = result.examItem[0].score;
|
|
||||||
state.six1 = result.signScore;
|
state.four3 = result[3].typeDescConfig.slice(0,result[3].typeDescConfig.indexOf(';'));
|
||||||
state.seven1 = result.leaderScore;
|
state.four4 = result[3].typeDescConfig.slice(result[3].typeDescConfig.indexOf(';')+1);
|
||||||
state.seven2 = result.topStudentScore;
|
state.four5 = result[3].pointsCount;
|
||||||
|
|
||||||
|
state.five1 = result[4].typeDescConfig;
|
||||||
|
state.five2 = result[4].pointsCount;
|
||||||
|
|
||||||
|
state.six1 = result[5].pointsCount;
|
||||||
|
|
||||||
|
state.seven1 = result[6].pointsCount;
|
||||||
|
|
||||||
|
state.seven2 = result[7].pointsCount;
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
console.log("获取项目积分规则失败了", err);
|
console.log("获取项目积分规则失败了", err);
|
||||||
@@ -721,7 +720,6 @@ export default {
|
|||||||
tabsChange,
|
tabsChange,
|
||||||
scoreRank,
|
scoreRank,
|
||||||
editRule,
|
editRule,
|
||||||
scoresum,
|
|
||||||
getStu,
|
getStu,
|
||||||
setStuData,
|
setStuData,
|
||||||
changePagination,
|
changePagination,
|
||||||
|
|||||||
Reference in New Issue
Block a user