Merge remote-tracking branch 'remotes/origin/dev' into test

This commit is contained in:
joylink_cuiweidong 2019-11-18 14:29:03 +08:00
commit 68d13d935f
17 changed files with 150 additions and 113 deletions

View File

@ -27,7 +27,7 @@ export default {
this.subscribeMessage(val); this.subscribeMessage(val);
} }
}, },
'$store.state.socket.beLogout': async function(val) { '$store.state.socket.beLogoutCount': async function(val) {
this.$alert(this.$t('tip.logoutTips'), this.$t('tip.hint'), { this.$alert(this.$t('tip.logoutTips'), this.$t('tip.hint'), {
confirmButtonText: this.$t('tip.confirm'), confirmButtonText: this.$t('tip.confirm'),
callback: action => { callback: action => {

View File

@ -41,7 +41,7 @@ Vue.prototype.$addWindowResizeListener = function(cb) {
Vue.prototype.$theme = new Theme(); Vue.prototype.$theme = new Theme();
Vue.prototype.$messageBox = function(msge) { Vue.prototype.$messageBox = function(msge) {
if (this.$confirm) { if (this.$confirm) {
this.$confirm(`${msge || this.$t('global.processFailure')}`, this.$t('global.tips'), { this.$confirm(`${msge || this.$t('global.processFailure')}`, this.$t('global.tips'), {
confirmButtonText: this.$t('global.confirm'), confirmButtonText: this.$t('global.confirm'),
type: 'warning', type: 'warning',
showCancelButton: false, showCancelButton: false,

View File

@ -530,7 +530,7 @@ const map = {
if (map && map.skinVO) { if (map && map.skinVO) {
state.map = map; state.map = map;
state.mapDevice = parser(map, map.skinVO.code); state.mapDevice = parser(map, map.skinVO.code);
Vue.prototype.$jlmap.setMapDevice(state.mapDevice); Vue.prototype.$jlmap && Vue.prototype.$jlmap.setMapDevice(state.mapDevice);
} else { } else {
state.map = null; state.map = null;
state.mapDevice = {}; state.mapDevice = {};

View File

@ -9,9 +9,6 @@ function handle(state, data) {
case 'Order_Pay_Result': // 订单支付结果消息 case 'Order_Pay_Result': // 订单支付结果消息
state.payOrder = msg; state.payOrder = msg;
break; break;
case 'Be_Logged_Out': // 重复登录被登出
state.beLogout = msg;
break;
case 'JointTraining_Room': // 综合演练室-房间消息 case 'JointTraining_Room': // 综合演练室-房间消息
if (!path.includes('/plan') || !path.includes('/dp/')) { if (!path.includes('/plan') || !path.includes('/dp/')) {
state.jointRoomInfo = msg; // 房间信息 state.jointRoomInfo = msg; // 房间信息
@ -74,6 +71,9 @@ function handle(state, data) {
case 'JointTraining_Device': case 'JointTraining_Device':
state.realDeviceInfo++; state.realDeviceInfo++;
break; break;
case 'Be_Logged_Out': // 重复登录被登出
state.beLogoutCount++;
break;
case 'Simulation_Control_Pause': // 暂停中 case 'Simulation_Control_Pause': // 暂停中
store.dispatch('scriptRecord/updateSimulationPause', msg); store.dispatch('scriptRecord/updateSimulationPause', msg);
break; break;
@ -196,7 +196,6 @@ const socket = {
state: { state: {
payOrder: {}, // 支付消息 payOrder: {}, // 支付消息
beLogout: {}, // 被登出
jointRoomInfo: {}, // 受邀请房间信息 jointRoomInfo: {}, // 受邀请房间信息
chatContent: {}, // 聊天室聊天内容 chatContent: {}, // 聊天室聊天内容
roleList: [], // 设置角色信息 roleList: [], // 设置角色信息
@ -223,7 +222,8 @@ const socket = {
permissionOver: {}, // 权限结束 permissionOver: {}, // 权限结束
tipOperateCount: 0, // 任务结束提示消息 tipOperateCount: 0, // 任务结束提示消息
realDeviceInfo: 0 // 真实设备信息 realDeviceInfo: 0, // 真实设备信息
beLogoutCount: 0 // 被登出
}, },
getters: { getters: {

View File

@ -15,7 +15,7 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item :label="$t('map.mapName')" prop="name"> <el-form-item :label="$t('map.mapName')" prop="name">
<el-input v-model="newModel.name" /> <el-input v-model.trim="newModel.name" />
</el-form-item> </el-form-item>
</el-form> </el-form>
</el-tab-pane> </el-tab-pane>
@ -32,7 +32,7 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item :label="$t('map.mapName')" prop="name"> <el-form-item :label="$t('map.mapName')" prop="name">
<el-input v-model="pullModel.name" /> <el-input v-model.trim="pullModel.name" />
</el-form-item> </el-form-item>
</el-form> </el-form>
</el-tab-pane> </el-tab-pane>
@ -96,7 +96,7 @@ export default {
{ required: true, message: this.$t('rules.pleaseSelectMapSource'), trigger: 'change' } { required: true, message: this.$t('rules.pleaseSelectMapSource'), trigger: 'change' }
], ],
name: [ name: [
{ required: true, message: this.$t('rules.pleaseEnterMapName'), trigger: 'change' } { required: true, message: this.$t('rules.pleaseEnterMapName'), trigger: 'blur' }
] ]
}, },
cityList: [] cityList: []

View File

@ -14,7 +14,7 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item :label="$t('map.mapName')" prop="name"> <el-form-item :label="$t('map.mapName')" prop="name">
<el-input v-model="editModel.name" /> <el-input v-model.trim="editModel.name" />
</el-form-item> </el-form-item>
</el-form> </el-form>
</template> </template>

View File

@ -176,11 +176,11 @@ export default {
} }
}, },
async confirm() { confirm() {
const roleName = this.memberList.find(elem=>{ return elem.id == this.form.role; }); const roleName = this.memberList.find(elem=>{ return elem.id == this.form.role; });
this.$emit('selectQuest', this.row, this.form.role, this.mapLocation, roleName.role);
this.doClose(); this.doClose();
this.roleDoClose(); this.roleDoClose();
this.$emit('selectQuest', this.row, this.form.role, this.mapLocation, roleName.role);
}, },
roleDoClose() { roleDoClose() {

View File

@ -35,6 +35,7 @@
:offset="offset" :offset="offset"
:group="group" :group="group"
@switchMode="switchMode" @switchMode="switchMode"
@selectQuest="selectQuest"
/> />
<!--@runPlanViewShow="runPlanViewShow" <!--@runPlanViewShow="runPlanViewShow"
@faultChooseShow="faultChooseShow" @faultChooseShow="faultChooseShow"

View File

@ -186,8 +186,6 @@ export default {
}, },
back() { back() {
this.$store.dispatch('training/over').then(() => { this.$store.dispatch('training/over').then(() => {
EventBus.$emit('runPlanStop');
EventBus.$emit('chatSubscribeStop');
history.go(-1); history.go(-1);
Notification.closeAll(); Notification.closeAll();
}); });

View File

@ -172,7 +172,7 @@ export default {
this.$refs.addQuest.doShow(); this.$refs.addQuest.doShow();
}, },
viewScriptRoles() { viewScriptRoles() {
const row = {id: this.$route.query.scriptId}; const row = {id: this.$route.query.scriptId, group:this.$route.query.group};
this.$refs.addQuest.handleLoad(1, row); this.$refs.addQuest.handleLoad(1, row);
}, },
selectQuest(row, id, mapLocation, roleName) { selectQuest(row, id, mapLocation, roleName) {

View File

@ -104,7 +104,8 @@ export default {
updateTime: '' updateTime: ''
}, },
detailShow: false, detailShow: false,
examIndex: 0 examIndex: 0,
scanInter:null
}; };
}, },
computed: { computed: {
@ -115,12 +116,7 @@ export default {
return this.$store.state.exam.totalTime - this.$store.state.exam.usedTime; return this.$store.state.exam.totalTime - this.$store.state.exam.usedTime;
}, },
formatRemainTime() { formatRemainTime() {
if (this.remainTime < 0) { return this.remainTime >= 0 ? timeFormat(this.remainTime) : '';
this.$message.success(this.$t('display.exam.autoSubmit'));
this.submit();
}
return timeFormat(this.remainTime);
}, },
isFirst() { isFirst() {
return this.examIndex == 0; return this.examIndex == 0;
@ -129,8 +125,15 @@ export default {
return this.examIndex == this.trainingList.length - 1; return this.examIndex == this.trainingList.length - 1;
} }
}, },
mounted() { watch: {
'$store.state.map.mapViewLoadedCount': function() {
this.$store.dispatch('exam/stopCountTime');
this.loadInitData(); this.loadInitData();
this.$store.dispatch('exam/countUsedTime');
}
},
beforeDestroy() {
this.clearScanCommit();
}, },
methods: { methods: {
backList() { backList() {
@ -170,13 +173,13 @@ export default {
this.detailShow = false; this.detailShow = false;
}, },
// //
loadInitData() { async loadInitData() {
// //
refreshExamList(this.$route.query.userExamId).then(response => { refreshExamList(this.$route.query.userExamId).then(response => {
this.examName = response.data.examName; this.examName = response.data.examName;
this.$store.dispatch('exam/setUsedTime', response.data.usedTime); this.$store.commit('exam/setUsedTime', response.data.usedTime);
this.$store.dispatch('exam/setTotalTime', response.data.duration); this.$store.commit('exam/setTotalTime', response.data.duration);
this.$store.dispatch('trainingList/setTrainingList', response.data.userExamQuestionsVOs).then(response => { }); this.$store.commit('trainingList/setTrainingList', response.data.userExamQuestionsVOs);
const obj = { const obj = {
trainingId: '', trainingId: '',
id: '' id: ''
@ -190,6 +193,7 @@ export default {
obj.id = response.data.userExamQuestionsVOs[0].id; obj.id = response.data.userExamQuestionsVOs[0].id;
} }
this.selectedTraining(obj); this.selectedTraining(obj);
this.scanCommit();
}).catch(error => { }).catch(error => {
// 50009y // 50009y
if (error.code === 500009) { if (error.code === 500009) {
@ -199,9 +203,22 @@ export default {
} }
}); });
this.shrink(); this.shrink();
}, },
scanCommit() {
this.clearScanCommit();
this.scanInter = setInterval(()=>{
if (this.remainTime < 0) {
this.$message.success(this.$t('display.exam.autoSubmit'));
this.clearScanCommit();
this.submit();
}
}, 1000);
},
clearScanCommit() {
clearInterval(this.scanInter);
this.scanInter = null;
},
nextExam() { nextExam() {
const obj = { const obj = {
trainingId: '', trainingId: '',

View File

@ -16,7 +16,7 @@
<el-row> <el-row>
<el-form ref="form" :model="newModel" label-width="140px" size="mini" :rules="rules" @submit.native.prevent> <el-form ref="form" :model="newModel" label-width="140px" size="mini" :rules="rules" @submit.native.prevent>
<el-form-item :label="this.$t('planMonitor.runGraphName')+this.$t('global.colon')" prop="name"> <el-form-item :label="this.$t('planMonitor.runGraphName')+this.$t('global.colon')" prop="name">
<el-input v-model="newModel.name" autofocus /> <el-input v-model.trim="newModel.name" autofocus />
</el-form-item> </el-form-item>
</el-form> </el-form>
</el-row> </el-row>
@ -35,7 +35,7 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item :label="this.$t('planMonitor.runGraphName')+this.$t('global.colon')" prop="name"> <el-form-item :label="this.$t('planMonitor.runGraphName')+this.$t('global.colon')" prop="name">
<el-input v-model="pullModel.name" autofocus /> <el-input v-model.trim="pullModel.name" autofocus />
</el-form-item> </el-form-item>
</el-form> </el-form>
</el-row> </el-row>

View File

@ -91,8 +91,8 @@ export default {
this.$message.success(this.$t('tip.runGraphNameModifiedSuccessfully')); this.$message.success(this.$t('tip.runGraphNameModifiedSuccessfully'));
this.$emit('renewal'); this.$emit('renewal');
this.doClose(); this.doClose();
}).catch(() => { }).catch(error => {
this.$messageBox(this.$t('tip.modifyRunGraphNameFailed')); this.$messageBox(this.$t('tip.modifyRunGraphNameFailed') + error.message);
this.doClose(); this.doClose();
}); });
} }

View File

@ -356,6 +356,7 @@ export default {
this.PlanConvert = this.$theme.loadPlanConvert(lineCode); this.PlanConvert = this.$theme.loadPlanConvert(lineCode);
const editData = this.$store.state.runPlan.editData[this.editModel.serviceNumber]; const editData = this.$store.state.runPlan.editData[this.editModel.serviceNumber];
debugger;
if (editData) { if (editData) {
const tripNumberList = Object.keys(editData.trainMap).sort((a, b) => { return editData.trainMap[a].oldIndex - editData.trainMap[b].oldIndex; }); const tripNumberList = Object.keys(editData.trainMap).sort((a, b) => { return editData.trainMap[a].oldIndex - editData.trainMap[b].oldIndex; });
const trainInfo = editData.trainMap[tripNumberList[0]]; const trainInfo = editData.trainMap[tripNumberList[0]];

View File

@ -27,6 +27,7 @@ import { getStationList, queryRunPlan } from '@/api/runplan';
import {getRpDetailByUserMapId, getUserMapDetailByMapId} from '@/api/designPlatform'; import {getRpDetailByUserMapId, getUserMapDetailByMapId} from '@/api/designPlatform';
import { loadMapDataById } from '@/utils/loaddata'; import { loadMapDataById } from '@/utils/loaddata';
import { getPublishMapInfo } from '@/api/jmap/map'; import { getPublishMapInfo } from '@/api/jmap/map';
import {getMapDetail} from '@/api/jmap/mapdraft';
import DataTable from './menus/components/dataTable'; import DataTable from './menus/components/dataTable';
import echarts from 'echarts'; import echarts from 'echarts';
@ -373,13 +374,20 @@ export default {
this.$store.dispatch('runPlan/clear').then(() => { this.$store.dispatch('runPlan/clear').then(() => {
this.loadInitChart().then(() => { this.loadInitChart().then(() => {
if (this.$route.query.mapId) { if (this.$route.query.mapId) {
if (/^\/plan\/usertool/.test(this.$route.fullPath)) {
getMapDetail(this.$route.query.mapId).then(response => {
this.$store.dispatch('map/setMapData', response.data).then(()=>{
this.$store.dispatch('map/clearJlmapTrainView');
});
});
} else {
loadMapDataById(this.$route.query.mapId); loadMapDataById(this.$route.query.mapId);
}
getStationList(this.$route.query.mapId).then(resp => { getStationList(this.$route.query.mapId).then(resp => {
this.$store.dispatch('runPlan/setStations', resp.data).then(() => { this.$store.dispatch('runPlan/setStations', resp.data).then(() => {
this.loadInitData(); this.loadInitData();
if (this.planId) { if (this.planId) {
this.myChart && this.myChart.showLoading(); this.myChart && this.myChart.showLoading();
if (/^\/plan\/usertool/.test(this.$route.fullPath)) { if (/^\/plan\/usertool/.test(this.$route.fullPath)) {
getRpDetailByUserMapId(this.planId).then(rest => { getRpDetailByUserMapId(this.planId).then(rest => {
this.$store.dispatch('runPlan/setPlanData', rest.data).then(() => { this.$store.dispatch('runPlan/setPlanData', rest.data).then(() => {

View File

@ -38,8 +38,8 @@ export default {
const form = { const form = {
labelWidth: '150px', labelWidth: '150px',
items: [ items: [
{ prop: 'name', label: this.$t('scriptRecord.scriptName'), type: 'text', required: true}, { prop: 'name', label: this.$t('scriptRecord.scriptName'), type: 'text' },
{ prop: 'description', label: this.$t('scriptRecord.scriptDescription'), type: 'textarea', required: true} { prop: 'description', label: this.$t('scriptRecord.scriptDescription'), type: 'textarea' }
] ]
}; };
return form; return form;
@ -47,18 +47,28 @@ export default {
rules() { rules() {
const crules = { const crules = {
name: [ name: [
{ required: true, message: this.$t('scriptRecord.inputScriptName'), trigger: 'blur' }, // { required: true, message: this.$t('scriptRecord.inputScriptName'), trigger: 'blur' },
{ required: true, message: this.$t('scriptRecord.inputScriptName'), trigger: 'change' } // { required: true, message: this.$t('scriptRecord.inputScriptName'), trigger: 'change' }
], { validator: this.validateScriptName, trigger: 'blur' },
description:[ { validator: this.validateScriptName, trigger: 'change' }
{ required: true, message: this.$t('scriptRecord.inputScriptDescription'), trigger: 'blur' },
{ required: true, message: this.$t('scriptRecord.inputScriptDescription'), trigger: 'change' }
] ]
// description:[
// { required: true, message: this.$t('scriptRecord.inputScriptDescription'), trigger: 'blur' },
// { required: true, message: this.$t('scriptRecord.inputScriptDescription'), trigger: 'change' }
// ]
}; };
return crules; return crules;
} }
}, },
methods: { methods: {
validateScriptName(rule, value, callback) {
if (value.trim().length === 0) {
this.formModel.name = this.formModel.name.replace(/\s/g, '');
return callback(new Error(this.$t('scriptRecord.inputScriptName')));
} else {
return callback();
}
},
doShow(questid) { doShow(questid) {
if (questid) { if (questid) {
getQuestById(questid).then(resp=>{ getQuestById(questid).then(resp=>{

View File

@ -23,7 +23,7 @@
<span> km/h</span> <span> km/h</span>
</el-form-item> </el-form-item>
<el-form-item :label="$t('scriptRecord.signal')" class="conditionVO" prop="param.signal"> <el-form-item :label="$t('scriptRecord.signal')" class="conditionVO" prop="param.signal">
<el-input v-model="commandData.param.signal" disabled="disabled" style="width:130px" /> <el-input v-model="signalName" disabled="disabled" style="width:130px" />
<el-button <el-button
:type="field === 'selectSingalCode' ? 'danger' : 'primary'" :type="field === 'selectSingalCode' ? 'danger' : 'primary'"
size="mini" size="mini"
@ -58,7 +58,8 @@ export default {
{id:'NRM', name:'NRM'} {id:'NRM', name:'NRM'}
], ],
field: '', field: '',
fieldS:'' fieldS:'',
signalName:''
}; };
}, },
watch: { watch: {
@ -84,7 +85,8 @@ export default {
}, },
deviceSelect(em) { deviceSelect(em) {
if (this.field.toUpperCase() === 'selectSingalCode'.toUpperCase() && em._type.toUpperCase() === 'Signal'.toUpperCase()) { if (this.field.toUpperCase() === 'selectSingalCode'.toUpperCase() && em._type.toUpperCase() === 'Signal'.toUpperCase()) {
this.commandData.param.signal = em.name; this.commandData.param.signal = em.code;
this.signalName = em.name;
this.field = ''; this.field = '';
} }
}, },