This commit is contained in:
fan 2020-04-09 14:49:06 +08:00
commit f2ba430cc5
12 changed files with 107 additions and 43 deletions

View File

@ -218,9 +218,9 @@ export function addAutoTrainingNew(data) {
}
/** 一键生成所有实训(新版地图) */
export function createAllTrainingList(mapId) {
export function createAllTrainingList(mapId, noCheck) {
return request({
url: `/api/v1/training/generate/${mapId}`,
url: `/api/v1/training/generate/${mapId}?noCheck=${noCheck}`,
method: 'post'
});
}

View File

@ -153,6 +153,8 @@
:key="index"
:type="button.type ? button.type: 'primary'"
size="small"
:disabled="button.disabled"
:loading="button.disabled"
:style="button.style"
class="button_style"
@click="button.handler"
@ -259,6 +261,8 @@ export default {
'queryForm.queryObject': function(newVal) {
this.initPageData();
},
'queryList.actions':function(newVal) {
},
canQuery(newVal) {
this.queryFlag = newVal;
},

View File

@ -88,6 +88,7 @@ export default {
maxTime: 'Largest time:',
trainingDescription: 'Training description:',
generateTraining: 'Generate training',
trainingGenerating:'Training generating...',
updateTraining: 'Update training',
deleteTraining: 'Delete training',
automaticGenerationOfTraining: 'Automatic generation of training',

View File

@ -87,6 +87,7 @@ export default {
maxTime: '最大用时:',
trainingDescription: '实训描述:',
generateTraining: '一键生成实训',
trainingGenerating:'实训生成中...',
updateTraining: '修改实训',
deleteTraining: '删除实训',
automaticGenerationOfTraining: '自动生成实训',

View File

@ -214,7 +214,7 @@ class SkinCode extends defaultStyle {
textFontSize: 10, // 站台默认字体大小
haveJumpShow: false, // 站台是否有列车停跳显示
functionButtonShow: '03', // 功能灯按钮显示条件01所有模式下显示 02 行调显示 03现地显示
standType:'notFill' // 站台的样式NotFill为未填充目前是西安二号线线路样式fill为其他线路样式
standType:'notFill' // 站台的样式NotFill为未填充目前是西安二号线线路样式
},
safetyDoor: { // 屏蔽门
height: 3, // 站台屏蔽门高度
@ -224,10 +224,10 @@ class SkinCode extends defaultStyle {
},
stand: { // 站台
headFontSize: 10, // 站台首端字体大小
spareColor: 'white', // 站台空闲颜色
stopColor: 'yellow', // 站台列车停站颜色
jumpStopColor: 'blue', // 站台跳停颜色
designatedJumpStopColor: 'lightSkyBlue' // 站台指定列车跳停颜色
spareColor: '#808080', // 站台空闲颜色
stopColor: '#808080', // 站台列车停站颜色
jumpStopColor: 'yellow', // 站台跳停颜色
designatedJumpStopColor: 'yellow' // 站台指定列车跳停颜色
},
standEmergent: { // 紧急关闭
mergentR: 4, // 站台紧急关闭半径

View File

@ -86,16 +86,25 @@ class ESafeStand extends Group {
},
style: {
lineWidth: 0,
stroke: style.sidelineColor,
fill: style.StationStand.stand.spareColor
stroke: style.sidelineColor
}
});
if (style.StationStand.common.standType && style.StationStand.common.standType == 'notFill') {
this.stand && this.stand.setStyle('lineWidth', 2);
} else {
this.stand && this.stand.setStyle('fill', style.StationStand.stand.spareColor);
}
this.add(this.stand);
}
}
setColor(color) {
this.stand && this.stand.setStyle('fill', color);
const style = this.model.style;
if (style.StationStand.common.standType && style.StationStand.common.standType == 'notFill') {
this.stand && this.stand.setStyle('stroke', color);
} else {
this.stand && this.stand.setStyle('fill', color);
}
}
}

View File

@ -139,6 +139,9 @@ export default {
watch: {
'$store.state.menuOperation.setMenuChangeCount': function (val) {
if (this.selected._type) {
if (this.selected._type == 'Section' && this.selected.type == '03') {
this.selected = this.selected.switch;
}
this.canCommand = true;
const step = {
operation: 'click',

View File

@ -82,7 +82,7 @@ export default {
if (this.operation == OperationEvent.StationControl.requestCentralControl.menu.operation) {
return OperationEvent.StationControl.requestCentralControl.choose.domId;
} else if (this.operation == OperationEvent.StationControl.requestStationControl.menu.operation) {
return OperationEvent.StationControl.StationControl.choose.domId;
return OperationEvent.StationControl.requestStationControl.choose.domId;
} else {
return '';
}
@ -95,7 +95,7 @@ export default {
if (this.operation == OperationEvent.StationControl.requestCentralControl.menu.operation) {
return OperationEvent.StationControl.requestCentralControl.confirm.domId;
} else if (this.operation == OperationEvent.StationControl.requestStationControl.menu.operation) {
return OperationEvent.StationControl.StationControl.confirm.domId;
return OperationEvent.StationControl.requestStationControl.confirm.domId;
} else {
return '';
}

View File

@ -2,11 +2,11 @@ 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.3.5:9000'; // 袁琪
// BASE_API = 'http://192.168.3.6:9000'; // 旭强
// BASE_API = 'http://192.168.3.41:9000'; // 张赛
BASE_API = 'http://192.168.3.82:9000'; // 杜康
// BASE_API = 'http://192.168.3.82:9000'; // 杜康
// BASE_API = 'http://192.168.3.41:9000'; // 张赛
// BASE_API = 'http://b29z135112.zicp.vip';
// BASE_API = 'http://2925963m2a.zicp.vip'; // 杜康

View File

@ -49,6 +49,7 @@ export default {
ControlConvertMenu: [],
TrainWindow: []
},
isLeaving:false,
trainingTypeMap: {},
pagerConfig: {
pageSize: 'pageSize',
@ -147,7 +148,7 @@ export default {
}
],
actions: [
{ text: this.$t('lesson.generateTraining'), btnCode: 'employee_auto', handler: this.autoMaticTrainging }
{ text: this.$t('lesson.generateTraining'), btnCode: 'employee_auto', handler: this.autoMaticTrainging, disabled:false }
// { text: this.$t('lesson.updateTraining'), btnCode: 'employee_edit', handler: this.editTrainingByType, type: 'warning'},
// { text: this.$t('lesson.deleteTraining'), btnCode: 'employee_delete', handler: this.delAutoMaticTrainging, type: 'danger'}
]
@ -172,6 +173,12 @@ export default {
await this.loadInitData(json);
this.typeChoose(json);
},
mounted() {
this.interCheckGenerateStatus();
},
beforeDestroy() {
this.isLeaving = true;
},
methods: {
async loadInitData(queryData) {
this.mapIdList = [];
@ -231,6 +238,28 @@ export default {
}
this.reloadTable();
},
interCheckGenerateStatus() {
createAllTrainingList(this.$route.query.mapId, false).then((data)=>{
if (data.data) {
this.queryList.actions.pop();
this.queryList.actions.push({ text: this.$t('lesson.trainingGenerating'), btnCode: 'employee_auto', handler: this.autoMaticTrainging, disabled:true });
} else {
this.queryList.actions.pop();
this.queryList.actions.push({ text: this.$t('lesson.generateTraining'), btnCode: 'employee_auto', handler: this.autoMaticTrainging, disabled:false });
}
setTimeout(() => {
if (!this.isLeaving) {
this.interCheckGenerateStatus(this.$route.query.mapId, false);
}
}, 30000);
}).catch(()=>{
setTimeout(() => {
if (!this.isLeaving) {
this.interCheckGenerateStatus(this.$route.query.mapId, false);
}
}, 30000);
});
},
async prdChoose(queryData) {
let flag = true;
this.trainingTypeList.forEach(item => {
@ -334,15 +363,26 @@ export default {
beforeClose: async (action, instance, done) => {
if (action === 'confirm') {
instance.confirmButtonLoading = true;
instance.confirmButtonText = '生成中...';
// instance.confirmButtonText = '...';
this.queryList.actions.pop();
this.queryList.actions.push({ text: this.$t('lesson.trainingGenerating'), btnCode: 'employee_auto', handler: this.autoMaticTrainging, disabled:true });
try {
await createAllTrainingList(this.$route.query.mapId);
this.$message.success('生成实训成功');
const data = await createAllTrainingList(this.$route.query.mapId, true);
this.$message.success('实训生成中...');
instance.confirmButtonLoading = false;
if (!data.data) {
this.queryList.actions.pop();
this.queryList.actions.push({ text: this.$t('lesson.generateTraining'), btnCode: 'employee_auto', handler: this.autoMaticTrainging, disabled:false });
}
done();
} catch (error) {
instance.confirmButtonLoading = false;
this.$message.error(`生成实训失败: ${error.message}`);
this.queryList.actions.pop();
this.queryList.actions.push({ text: this.$t('lesson.generateTraining'), btnCode: 'employee_auto', handler: this.autoMaticTrainging, disabled:false });
}
} else {
instance.confirmButtonLoading = false;
done();
}
}

View File

@ -77,6 +77,9 @@ export default {
device = this.$store.getters['map/getDeviceByCode'](section.relSwitchCode);
}
}
if (device._type == 'Section' && device.type == '03') { // model
device = device.switch;
}
return device;
},

View File

@ -21,9 +21,6 @@
</el-form-item>
</div>
</div>
<el-form-item v-if="createModel.type == '01'" label="距离长度:" prop="length">
<el-input-number v-model="createModel.length" />
</el-form-item>
<el-form-item v-if="createModel.type == '03'" :label="$t('map.leftAssociatedSection')" prop="leftSectionCode">
<el-select v-model="createModel.leftSectionCode" filterable>
<el-option v-for="item in switchAndPhySicalSectionList" :key="item.code" :label="item.name" :value="item.code" />
@ -34,8 +31,8 @@
@click="hover('getSectionStart')"
>{{ $t('map.activate') }}</el-button>
</el-form-item>
<el-form-item v-if="createModel.type == '03'" label="距离长度:" prop="length">
<el-input-number v-model="createModel.length" />
<el-form-item v-if="createModel.type == '03' || createModel.type == '01'" label="距离长度:" prop="length">
<el-input-number v-model="createModel.length" :min="0" />
</el-form-item>
<el-form-item v-if="createModel.type == '02' || createModel.type == '04'" label="起始区段:" prop="leftSectionCode">
<el-select v-model="createModel.leftSectionCode" filterable>
@ -293,27 +290,33 @@ export default {
const end_x = endModel.points[0].x;
const start_y = startModel.points[startModel.points.length - 1].y;
const end_y = endModel.points[0].y;
if (this.createModel.leftSectionCode === this.createModel.rightSectionCode) {
this.$messageBox('左关联区段不能和右关联区段相同');
return;
if (end_x > start_x) {
if (this.createModel.leftSectionCode === this.createModel.rightSectionCode) {
this.$messageBox('左关联区段不能和右关联区段相同');
return;
}
if (start_x === end_x && start_y === end_y) {
this.$messageBox('左关联区段终点不能和右关联区段起点相同');
return;
}
model.points = [
{ x: start_x, y: start_y },
{ x: end_x, y: end_y }
];
const models = [];
model.leftSectionCode = this.createModel.leftSectionCode;
startModel.rightSectionCode = model.code;
endModel.leftSectionCode = model.code;
model.rightSectionCode = this.createModel.rightSectionCode;
models.push(model);
models.push(startModel);
models.push(endModel);
this.$emit('updateMapModel', models, 'second');
} else {
this.$messageBox('画图顺序应左往右绘制, 请求重新定义左右关联区段');
this.createModel.rightSectionCode = '';
this.createModel.leftSectionCode = '';
}
if (start_x === end_x && start_y === end_y) {
this.$messageBox('左关联区段终点不能和右关联区段起点相同');
return;
}
model.points = [
{ x: start_x, y: start_y },
{ x: end_x, y: end_y }
];
const models = [];
model.leftSectionCode = this.createModel.leftSectionCode;
startModel.rightSectionCode = model.code;
endModel.leftSectionCode = model.code;
model.rightSectionCode = this.createModel.rightSectionCode;
models.push(model);
models.push(startModel);
models.push(endModel);
this.$emit('updateMapModel', models, 'second');
},
//
create() {