This commit is contained in:
joylink_cuiweidong 2020-12-14 17:19:31 +08:00
commit c437ac62c1
5 changed files with 41 additions and 22 deletions

View File

@ -108,7 +108,7 @@ export default {
inputQuestionNumber: 'Please input question number',
inputQuestionNumberError: 'The number of questions entered must be greater than 0',
inputValidNumber: 'Please input valid number',
inputNumberError: 'The input value must be greater than the number of questions',
inputNumberError: 'The input value must be less than the number of questions',
inputScorePerQuestion: 'Please input score per question',
selectTestType: 'Please select test type',
modifyRules: 'Modify Rules',

View File

@ -109,7 +109,7 @@ export default {
inputQuestionNumber: '请输入题数',
inputQuestionNumberError: '输入的题数大于0',
inputValidNumber: '请输入有效数字',
inputNumberError: '输入值必须于题数',
inputNumberError: '输入值必须于题数',
inputScorePerQuestion: '请输入每题分值',
// inputNumericType 请输入数字值
// addRules 添加规则

View File

@ -2,10 +2,10 @@ export function getBaseUrl() {
let BASE_API;
if (process.env.NODE_ENV === 'development') {
// BASE_API = 'https://joylink.club/jlcloud';
// BASE_API = 'https://test.joylink.club/jlcloud';
BASE_API = 'https://test.joylink.club/jlcloud';
// BASE_API = 'http://192.168.8.107:9000'; // 袁琪
// BASE_API = 'http://192.168.8.129:9000'; // 旭强
BASE_API = 'http://192.168.8.119:9000'; // 张赛
// BASE_API = 'http://192.168.8.119:9000'; // 张赛
// BASE_API = 'http://192.168.8.110:9000'; // 杜康
// BASE_API = 'http://b29z135112.zicp.vip';
// BASE_API = 'http://2925963m2a.zicp.vip'; // 杜康

View File

@ -114,18 +114,18 @@ export default {
this.loading = false;
this.$message.success(this.$t('tip.coursePublishSuccessful'));
this.doClose();
}).catch(() => {
}).catch((error) => {
this.loading = false;
this.$messageBox(this.$t('tip.coursePublishFailed'));
this.$messageBox(this.$t('tip.coursePublishFailed') + ':' + error.message);
});
} else if (valid && !this.hasRelease) {
releaseOrCancel(this.editModel.id, '1').then(response => {
this.loading = false;
this.$message.success(this.$t('tip.coursePublishSuccessful'));
this.doClose();
}).catch(() => {
}).catch((error) => {
this.loading = false;
this.$messageBox(this.$t('tip.coursePublishFailed'));
this.$messageBox(this.$t('tip.coursePublishFailed') + ':' + error.message);
});
} else {
this.loading = false;

View File

@ -278,7 +278,7 @@ export default {
this.questionList = [];
this.signalList.forEach(item => {
const signalModel = deepAssign({}, item); //
const section = this.findSection(signalModel); // model
const section = this.findSection(signalModel); // model
if (section.code && item.sectionCode != section.code) {
signalModel.sectionCode = section.code; //
}
@ -293,9 +293,6 @@ export default {
}
}
models.push(signalModel);
// if (this.editModel.code == signalModel.code) {
// this.editModel.sectionCode = signalModel.sectionCode;
// }
});
this.$emit('updateMapModel', models);
this.$message.success('数据构建成功!');
@ -307,20 +304,42 @@ export default {
},
//
findSection(signal) {
// 01 02
let model = {};
if (signal.code == 'S40506' || signal.code == 'X99289' || signal.code == 'S63773') {
debugger;
}
const arrList = [];
this.sectionList.forEach(section => {
if (!signal.right && section.type != '02' && section.type != '04') {
if (section.points[0].x == signal.position.x && Math.abs(section.points[0].y - signal.position.y) <= 20) {
model = section;
}
} else if (signal.right && section.type != '02' && section.type != '04') {
if (section.points[section.points.length - 1].x == signal.position.x && Math.abs(section.points[section.points.length - 1].y - signal.position.y) <= 20) {
model = section;
if (section.type == '01' || section.type == '03') {
if ((signal.position.x == section.points[0].x || section.points[section.points.length - 1].x == signal.position.x) && (section.points[0].y == signal.position.y || section.points[section.points.length - 1].y == signal.position.y)) {
console.log(section);
arrList.push(section);
}
}
});
return model;
const sectionObj = {
left: {},
right: {}
};
arrList.forEach(item => {
if (this.handleFindlistByCode(arrList, item.leftSectionCode)) {
sectionObj.left = this.handleFindlistByCode(arrList, item.leftSectionCode);
}
if (this.handleFindlistByCode(arrList, item.rightSectionCode)) {
sectionObj.right = this.handleFindlistByCode(arrList, item.rightSectionCode);
}
});
if (signal.right) {
return sectionObj.left;
}
if (!signal.right) {
return sectionObj.right;
}
},
handleFindlistByCode(list, code) {
const model = list.find(ele => ele.code == code);
if (model && model.code) {
return model;
}
},
setSignalName() {
const models = [];