试卷管理调整
This commit is contained in:
parent
51f45c87b1
commit
c4af4ee996
@ -90,3 +90,11 @@ export function getExamListByMapIdAndPrdType(mapId, prdType) {
|
||||
params: { prdType: prdType }
|
||||
});
|
||||
}
|
||||
/** 更新试卷规则 */
|
||||
export function updateExamRule(data) {
|
||||
return request({
|
||||
url: `/api/exam/update/rules`,
|
||||
method: 'put',
|
||||
data:data
|
||||
});
|
||||
}
|
||||
|
@ -3,14 +3,14 @@ export function getBaseUrl() {
|
||||
if (process.env.NODE_ENV === 'development') {
|
||||
// BASE_API = 'https://joylink.club/jlcloud';
|
||||
// BASE_API = 'https://test.joylink.club/jlcloud';
|
||||
BASE_API = 'http://114.116.51.125/jlcloud';
|
||||
// BASE_API = 'http://114.116.51.125/jlcloud';
|
||||
// BASE_API = 'http://192.168.8.152:9000'; // 袁琪
|
||||
// BASE_API = 'http://192.168.8.172:9200'; // 旭强
|
||||
// BASE_API = 'http://192.168.8.109:9000'; // 张赛
|
||||
// BASE_API = 'http://192.168.8.140:9000'; // 杜康
|
||||
// BASE_API = 'http://b29z135112.zicp.vip';
|
||||
// BASE_API = 'http://2925963m2a.zicp.vip'; // 杜康
|
||||
// BASE_API = 'http://2i38984j47.qicp.vip'; // 张赛
|
||||
BASE_API = 'http://2i38984j47.qicp.vip'; // 张赛
|
||||
} else {
|
||||
BASE_API = process.env.VUE_APP_BASE_API;
|
||||
}
|
||||
|
@ -86,6 +86,16 @@ export default {
|
||||
},
|
||||
tagType: (row) => { return ''; }
|
||||
},
|
||||
{
|
||||
title: '试卷规则状态',
|
||||
prop: 'abnormal',
|
||||
type: 'tag',
|
||||
width: '80',
|
||||
columnValue: (row) => {
|
||||
return row.abnormal ? '异常' : '正常';
|
||||
},
|
||||
tagType: (row) => { return ''; }
|
||||
},
|
||||
{
|
||||
title: '开始时间',
|
||||
prop: 'startTime'
|
||||
|
@ -62,13 +62,13 @@ export default {
|
||||
return this.display == 2;
|
||||
},
|
||||
isNextStep() {
|
||||
return this.display == 1 && this.$route.params.mode != 'edit';
|
||||
return this.display == 1;
|
||||
},
|
||||
isUpdate() {
|
||||
return this.display == 1 && this.$route.params.mode == 'edit';
|
||||
return this.$route.params.mode == 'edit';
|
||||
},
|
||||
isCreate() {
|
||||
return this.display == 2;
|
||||
return this.display == 2 && this.$route.params.mode !== 'edit';
|
||||
},
|
||||
isFastCreate() {
|
||||
return this.display == 1 && this.$route.params.mode != 'edit' && Number(this.$route.params.ruleId);
|
||||
@ -149,7 +149,11 @@ export default {
|
||||
this.$refs.exam.checkedForm('goNextStep');
|
||||
},
|
||||
update() {
|
||||
this.$refs.exam.updateForm();
|
||||
if(this.display === 1) {
|
||||
this.$refs.exam.updateForm();
|
||||
} else if (this.display === 2) {
|
||||
this.$refs.rule.updateOk();
|
||||
}
|
||||
},
|
||||
create() {
|
||||
this.$refs.rule.creatOk();
|
||||
|
@ -38,7 +38,7 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { createExam } from '@/api/management/exam';
|
||||
import { createExam, updateExamRule } from '@/api/management/exam';
|
||||
import { UrlConfig, getOperateTypeMap } from '@/scripts/ConstDic';
|
||||
import editRule from './editRule';
|
||||
import ConstConfig from '@/scripts/ConstConfig';
|
||||
@ -135,6 +135,37 @@ export default {
|
||||
this.$messageBox(this.$t('publish.addExamRules'));
|
||||
}
|
||||
},
|
||||
async updateOk() {
|
||||
console.log(this.examData, '===')
|
||||
if (this.ruleList.length) {
|
||||
let flag = 0;
|
||||
this.ruleList.forEach(rule => {
|
||||
flag = flag + (Number(rule.num) * Number(rule.point));
|
||||
});
|
||||
if (flag == this.examData.fullMark) {
|
||||
const result = {
|
||||
id: this.$route.params.ruleId,
|
||||
duration: Number(this.examData.duration) * 60, // 时长
|
||||
examDefinitionRulesVOList: this.ruleList, // 规则
|
||||
fullPoint: Number(this.examData.fullMark), // 满分
|
||||
mapId: this.examData.mapId,
|
||||
prdType: this.examData.prdType,
|
||||
name: this.examData.name, // 名称
|
||||
passingPoint: Number(this.examData.passMark), // 及格分
|
||||
remarks: this.examData.desc, // 考试说明
|
||||
endTime: this.examData.endDate,
|
||||
startTime: this.examData.startDate,
|
||||
type: this.examData.type, // 类型
|
||||
trial: this.examData.trial == 2 // 权限判断
|
||||
};
|
||||
await this.update(result);
|
||||
} else {
|
||||
this.$messageBox(this.$t('publish.addExamRluesError'));
|
||||
}
|
||||
} else {
|
||||
this.$messageBox(this.$t('publish.addExamRules'));
|
||||
}
|
||||
},
|
||||
async save(data) {
|
||||
try {
|
||||
const res = await createExam(data);
|
||||
@ -150,6 +181,21 @@ export default {
|
||||
this.$messageBox(`${this.$t('publish.saveRuleFailed')} ${error.message}`);
|
||||
}
|
||||
},
|
||||
async update(data) {
|
||||
try {
|
||||
const res = await updateExamRule(data);
|
||||
this.$message.success({ message: res.message });
|
||||
this.$store.dispatch('exam/setRuleList', []); // 清空规则列表数据
|
||||
const path = `${this.$route.path.match(/(\/.*)\/examRule/)[1]}${UrlConfig.examRuleManage}`;
|
||||
if (this.$route.query.source === 'org') {
|
||||
this.$router.go(-1);
|
||||
} else {
|
||||
this.$router.replace({ path: `${path}`, query: { mapId: this.$route.query.mapId, noPreLogout: this.$route.query.noPreLogout} });
|
||||
}
|
||||
} catch (error) {
|
||||
this.$messageBox(`${this.$t('publish.saveRuleFailed')} ${error.message}`);
|
||||
}
|
||||
},
|
||||
addRuleList(data) {
|
||||
const element = {
|
||||
trainingType: data.trainingType,
|
||||
|
Loading…
Reference in New Issue
Block a user