Merge remote-tracking branch 'remotes/origin/dev' into test
This commit is contained in:
commit
68d13d935f
@ -27,7 +27,7 @@ export default {
|
||||
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'), {
|
||||
confirmButtonText: this.$t('tip.confirm'),
|
||||
callback: action => {
|
||||
|
@ -12,90 +12,90 @@ Vue.component('QueryListPage', QueryListPage);
|
||||
Vue.component('TurnbackBar', TurnbackBar);
|
||||
|
||||
Vue.prototype.$ConstSelect = (function() {
|
||||
ConstConfig.ConstSelect.translate = function(value, codeName) {
|
||||
if (codeName) {
|
||||
const obj = this[codeName].filter(function(item) {
|
||||
return item.value === value;
|
||||
})[0];
|
||||
return obj && obj.label;
|
||||
}
|
||||
};
|
||||
return ConstConfig.ConstSelect;
|
||||
ConstConfig.ConstSelect.translate = function(value, codeName) {
|
||||
if (codeName) {
|
||||
const obj = this[codeName].filter(function(item) {
|
||||
return item.value === value;
|
||||
})[0];
|
||||
return obj && obj.label;
|
||||
}
|
||||
};
|
||||
return ConstConfig.ConstSelect;
|
||||
})();
|
||||
|
||||
Vue.prototype.$Dictionary = Dictionary;
|
||||
|
||||
Vue.prototype.__windowResizeFlag = false;
|
||||
Vue.prototype.$addWindowResizeListener = function(cb) {
|
||||
window.addEventListener('resize', function() {
|
||||
if (!Vue.__windowResizeFlag) {
|
||||
Vue.__windowResizeFlag = true;
|
||||
setTimeout(function() {
|
||||
Vue.__windowResizeFlag = false;
|
||||
cb();
|
||||
}, 100);
|
||||
}
|
||||
});
|
||||
window.addEventListener('resize', function() {
|
||||
if (!Vue.__windowResizeFlag) {
|
||||
Vue.__windowResizeFlag = true;
|
||||
setTimeout(function() {
|
||||
Vue.__windowResizeFlag = false;
|
||||
cb();
|
||||
}, 100);
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
Vue.prototype.$theme = new Theme();
|
||||
Vue.prototype.$messageBox = function(msge) {
|
||||
if (this.$confirm) {
|
||||
this.$confirm(`${msge || this.$t('global.processFailure')}!`, this.$t('global.tips'), {
|
||||
confirmButtonText: this.$t('global.confirm'),
|
||||
type: 'warning',
|
||||
showCancelButton: false,
|
||||
center: true
|
||||
}).then(() => {
|
||||
}).catch(() => {
|
||||
});
|
||||
}
|
||||
if (this.$confirm) {
|
||||
this.$confirm(`${msge || this.$t('global.processFailure')}`, this.$t('global.tips'), {
|
||||
confirmButtonText: this.$t('global.confirm'),
|
||||
type: 'warning',
|
||||
showCancelButton: false,
|
||||
center: true
|
||||
}).then(() => {
|
||||
}).catch(() => {
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
Vue.prototype.$convertField = function(fieldValue, enumList, converFormat, isList = false) {
|
||||
const arr = [];
|
||||
if (enumList && converFormat && converFormat.length >= 2) {
|
||||
const value = converFormat[0];
|
||||
const label = converFormat[1];
|
||||
if (isList) {
|
||||
enumList.forEach((element, i) => {
|
||||
fieldValue.forEach((v, j) => {
|
||||
if ('' + fieldValue[j] === '' + enumList[i][value]) {
|
||||
arr.push(enumList[i][label]);
|
||||
}
|
||||
});
|
||||
});
|
||||
} else {
|
||||
for (let i = 0; i < enumList.length; i++) {
|
||||
if ('' + fieldValue === '' + enumList[i][value]) {
|
||||
return enumList[i][label];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
const arr = [];
|
||||
if (enumList && converFormat && converFormat.length >= 2) {
|
||||
const value = converFormat[0];
|
||||
const label = converFormat[1];
|
||||
if (isList) {
|
||||
enumList.forEach((element, i) => {
|
||||
fieldValue.forEach((v, j) => {
|
||||
if ('' + fieldValue[j] === '' + enumList[i][value]) {
|
||||
arr.push(enumList[i][label]);
|
||||
}
|
||||
});
|
||||
});
|
||||
} else {
|
||||
for (let i = 0; i < enumList.length; i++) {
|
||||
if ('' + fieldValue === '' + enumList[i][value]) {
|
||||
return enumList[i][label];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return isList ? arr: '';
|
||||
return isList ? arr : '';
|
||||
};
|
||||
|
||||
Vue.prototype.$convertSpecifiedField = function(dataDict, enumList, key, value, fieldList) {
|
||||
if (dataDict && enumList && fieldList && enumList.length && fieldList.length) {
|
||||
fieldList.forEach(field => {
|
||||
enumList.forEach(elem => {
|
||||
if (elem[key] === dataDict[field]) {
|
||||
dataDict[field] = elem[value];
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
if (dataDict && enumList && fieldList && enumList.length && fieldList.length) {
|
||||
fieldList.forEach(field => {
|
||||
enumList.forEach(elem => {
|
||||
if (elem[key] === dataDict[field]) {
|
||||
dataDict[field] = elem[value];
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
Vue.prototype.$convertList = function(FromList, ToList, checktypeFunction) {
|
||||
if (FromList) {
|
||||
ToList.length = 0;
|
||||
FromList.forEach(elem => {
|
||||
if (checktypeFunction(elem)) {
|
||||
ToList.push({ value: elem.code, label: elem.name });
|
||||
}
|
||||
});
|
||||
}
|
||||
if (FromList) {
|
||||
ToList.length = 0;
|
||||
FromList.forEach(elem => {
|
||||
if (checktypeFunction(elem)) {
|
||||
ToList.push({ value: elem.code, label: elem.name });
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
|
@ -530,7 +530,7 @@ const map = {
|
||||
if (map && map.skinVO) {
|
||||
state.map = map;
|
||||
state.mapDevice = parser(map, map.skinVO.code);
|
||||
Vue.prototype.$jlmap.setMapDevice(state.mapDevice);
|
||||
Vue.prototype.$jlmap && Vue.prototype.$jlmap.setMapDevice(state.mapDevice);
|
||||
} else {
|
||||
state.map = null;
|
||||
state.mapDevice = {};
|
||||
|
@ -9,9 +9,6 @@ function handle(state, data) {
|
||||
case 'Order_Pay_Result': // 订单支付结果消息
|
||||
state.payOrder = msg;
|
||||
break;
|
||||
case 'Be_Logged_Out': // 重复登录被登出
|
||||
state.beLogout = msg;
|
||||
break;
|
||||
case 'JointTraining_Room': // 综合演练室-房间消息
|
||||
if (!path.includes('/plan') || !path.includes('/dp/')) {
|
||||
state.jointRoomInfo = msg; // 房间信息
|
||||
@ -74,6 +71,9 @@ function handle(state, data) {
|
||||
case 'JointTraining_Device':
|
||||
state.realDeviceInfo++;
|
||||
break;
|
||||
case 'Be_Logged_Out': // 重复登录被登出
|
||||
state.beLogoutCount++;
|
||||
break;
|
||||
case 'Simulation_Control_Pause': // 暂停中
|
||||
store.dispatch('scriptRecord/updateSimulationPause', msg);
|
||||
break;
|
||||
@ -196,7 +196,6 @@ const socket = {
|
||||
|
||||
state: {
|
||||
payOrder: {}, // 支付消息
|
||||
beLogout: {}, // 被登出
|
||||
jointRoomInfo: {}, // 受邀请房间信息
|
||||
chatContent: {}, // 聊天室聊天内容
|
||||
roleList: [], // 设置角色信息
|
||||
@ -223,7 +222,8 @@ const socket = {
|
||||
permissionOver: {}, // 权限结束
|
||||
|
||||
tipOperateCount: 0, // 任务结束提示消息
|
||||
realDeviceInfo: 0 // 真实设备信息
|
||||
realDeviceInfo: 0, // 真实设备信息
|
||||
beLogoutCount: 0 // 被登出
|
||||
},
|
||||
|
||||
getters: {
|
||||
|
@ -15,7 +15,7 @@
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<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>
|
||||
</el-tab-pane>
|
||||
@ -32,7 +32,7 @@
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<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>
|
||||
</el-tab-pane>
|
||||
@ -96,7 +96,7 @@ export default {
|
||||
{ required: true, message: this.$t('rules.pleaseSelectMapSource'), trigger: 'change' }
|
||||
],
|
||||
name: [
|
||||
{ required: true, message: this.$t('rules.pleaseEnterMapName'), trigger: 'change' }
|
||||
{ required: true, message: this.$t('rules.pleaseEnterMapName'), trigger: 'blur' }
|
||||
]
|
||||
},
|
||||
cityList: []
|
||||
|
@ -14,7 +14,7 @@
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<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>
|
||||
</template>
|
||||
|
@ -176,11 +176,11 @@ export default {
|
||||
}
|
||||
},
|
||||
|
||||
async confirm() {
|
||||
confirm() {
|
||||
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.roleDoClose();
|
||||
this.$emit('selectQuest', this.row, this.form.role, this.mapLocation, roleName.role);
|
||||
},
|
||||
|
||||
roleDoClose() {
|
||||
|
@ -35,6 +35,7 @@
|
||||
:offset="offset"
|
||||
:group="group"
|
||||
@switchMode="switchMode"
|
||||
@selectQuest="selectQuest"
|
||||
/>
|
||||
<!--@runPlanViewShow="runPlanViewShow"
|
||||
@faultChooseShow="faultChooseShow"
|
||||
|
@ -186,8 +186,6 @@ export default {
|
||||
},
|
||||
back() {
|
||||
this.$store.dispatch('training/over').then(() => {
|
||||
EventBus.$emit('runPlanStop');
|
||||
EventBus.$emit('chatSubscribeStop');
|
||||
history.go(-1);
|
||||
Notification.closeAll();
|
||||
});
|
||||
|
@ -172,7 +172,7 @@ export default {
|
||||
this.$refs.addQuest.doShow();
|
||||
},
|
||||
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);
|
||||
},
|
||||
selectQuest(row, id, mapLocation, roleName) {
|
||||
|
@ -104,7 +104,8 @@ export default {
|
||||
updateTime: ''
|
||||
},
|
||||
detailShow: false,
|
||||
examIndex: 0
|
||||
examIndex: 0,
|
||||
scanInter:null
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
@ -115,12 +116,7 @@ export default {
|
||||
return this.$store.state.exam.totalTime - this.$store.state.exam.usedTime;
|
||||
},
|
||||
formatRemainTime() {
|
||||
if (this.remainTime < 0) {
|
||||
this.$message.success(this.$t('display.exam.autoSubmit'));
|
||||
this.submit();
|
||||
}
|
||||
|
||||
return timeFormat(this.remainTime);
|
||||
return this.remainTime >= 0 ? timeFormat(this.remainTime) : '';
|
||||
},
|
||||
isFirst() {
|
||||
return this.examIndex == 0;
|
||||
@ -129,8 +125,15 @@ export default {
|
||||
return this.examIndex == this.trainingList.length - 1;
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.loadInitData();
|
||||
watch: {
|
||||
'$store.state.map.mapViewLoadedCount': function() {
|
||||
this.$store.dispatch('exam/stopCountTime');
|
||||
this.loadInitData();
|
||||
this.$store.dispatch('exam/countUsedTime');
|
||||
}
|
||||
},
|
||||
beforeDestroy() {
|
||||
this.clearScanCommit();
|
||||
},
|
||||
methods: {
|
||||
backList() {
|
||||
@ -170,13 +173,13 @@ export default {
|
||||
this.detailShow = false;
|
||||
},
|
||||
// 获取试题列表
|
||||
loadInitData() {
|
||||
async loadInitData() {
|
||||
// 刷新考试列表
|
||||
refreshExamList(this.$route.query.userExamId).then(response => {
|
||||
this.examName = response.data.examName;
|
||||
this.$store.dispatch('exam/setUsedTime', response.data.usedTime);
|
||||
this.$store.dispatch('exam/setTotalTime', response.data.duration);
|
||||
this.$store.dispatch('trainingList/setTrainingList', response.data.userExamQuestionsVOs).then(response => { });
|
||||
this.$store.commit('exam/setUsedTime', response.data.usedTime);
|
||||
this.$store.commit('exam/setTotalTime', response.data.duration);
|
||||
this.$store.commit('trainingList/setTrainingList', response.data.userExamQuestionsVOs);
|
||||
const obj = {
|
||||
trainingId: '',
|
||||
id: ''
|
||||
@ -190,6 +193,7 @@ export default {
|
||||
obj.id = response.data.userExamQuestionsVOs[0].id;
|
||||
}
|
||||
this.selectedTraining(obj);
|
||||
this.scanCommit();
|
||||
}).catch(error => {
|
||||
// 如果时50009则表示考试已完成,不能再次进行y
|
||||
if (error.code === 500009) {
|
||||
@ -199,9 +203,22 @@ export default {
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
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() {
|
||||
const obj = {
|
||||
trainingId: '',
|
||||
|
@ -16,7 +16,7 @@
|
||||
<el-row>
|
||||
<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-input v-model="newModel.name" autofocus />
|
||||
<el-input v-model.trim="newModel.name" autofocus />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-row>
|
||||
@ -35,7 +35,7 @@
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<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>
|
||||
</el-row>
|
||||
|
@ -91,8 +91,8 @@ export default {
|
||||
this.$message.success(this.$t('tip.runGraphNameModifiedSuccessfully'));
|
||||
this.$emit('renewal');
|
||||
this.doClose();
|
||||
}).catch(() => {
|
||||
this.$messageBox(this.$t('tip.modifyRunGraphNameFailed'));
|
||||
}).catch(error => {
|
||||
this.$messageBox(this.$t('tip.modifyRunGraphNameFailed') + error.message);
|
||||
this.doClose();
|
||||
});
|
||||
}
|
||||
|
@ -356,6 +356,7 @@ export default {
|
||||
this.PlanConvert = this.$theme.loadPlanConvert(lineCode);
|
||||
|
||||
const editData = this.$store.state.runPlan.editData[this.editModel.serviceNumber];
|
||||
debugger;
|
||||
if (editData) {
|
||||
const tripNumberList = Object.keys(editData.trainMap).sort((a, b) => { return editData.trainMap[a].oldIndex - editData.trainMap[b].oldIndex; });
|
||||
const trainInfo = editData.trainMap[tripNumberList[0]];
|
||||
|
@ -27,6 +27,7 @@ import { getStationList, queryRunPlan } from '@/api/runplan';
|
||||
import {getRpDetailByUserMapId, getUserMapDetailByMapId} from '@/api/designPlatform';
|
||||
import { loadMapDataById } from '@/utils/loaddata';
|
||||
import { getPublishMapInfo } from '@/api/jmap/map';
|
||||
import {getMapDetail} from '@/api/jmap/mapdraft';
|
||||
import DataTable from './menus/components/dataTable';
|
||||
import echarts from 'echarts';
|
||||
|
||||
@ -373,13 +374,20 @@ export default {
|
||||
this.$store.dispatch('runPlan/clear').then(() => {
|
||||
this.loadInitChart().then(() => {
|
||||
if (this.$route.query.mapId) {
|
||||
loadMapDataById(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);
|
||||
}
|
||||
getStationList(this.$route.query.mapId).then(resp => {
|
||||
this.$store.dispatch('runPlan/setStations', resp.data).then(() => {
|
||||
this.loadInitData();
|
||||
if (this.planId) {
|
||||
this.myChart && this.myChart.showLoading();
|
||||
|
||||
if (/^\/plan\/usertool/.test(this.$route.fullPath)) {
|
||||
getRpDetailByUserMapId(this.planId).then(rest => {
|
||||
this.$store.dispatch('runPlan/setPlanData', rest.data).then(() => {
|
||||
|
@ -38,8 +38,8 @@ export default {
|
||||
const form = {
|
||||
labelWidth: '150px',
|
||||
items: [
|
||||
{ prop: 'name', label: this.$t('scriptRecord.scriptName'), type: 'text', required: true},
|
||||
{ prop: 'description', label: this.$t('scriptRecord.scriptDescription'), type: 'textarea', required: true}
|
||||
{ prop: 'name', label: this.$t('scriptRecord.scriptName'), type: 'text' },
|
||||
{ prop: 'description', label: this.$t('scriptRecord.scriptDescription'), type: 'textarea' }
|
||||
]
|
||||
};
|
||||
return form;
|
||||
@ -47,18 +47,28 @@ export default {
|
||||
rules() {
|
||||
const crules = {
|
||||
name: [
|
||||
{ required: true, message: this.$t('scriptRecord.inputScriptName'), trigger: 'blur' },
|
||||
{ required: true, message: this.$t('scriptRecord.inputScriptName'), trigger: 'change' }
|
||||
],
|
||||
description:[
|
||||
{ required: true, message: this.$t('scriptRecord.inputScriptDescription'), trigger: 'blur' },
|
||||
{ required: true, message: this.$t('scriptRecord.inputScriptDescription'), trigger: 'change' }
|
||||
// { required: true, message: this.$t('scriptRecord.inputScriptName'), trigger: 'blur' },
|
||||
// { required: true, message: this.$t('scriptRecord.inputScriptName'), trigger: 'change' }
|
||||
{ validator: this.validateScriptName, trigger: 'blur' },
|
||||
{ validator: this.validateScriptName, trigger: 'change' }
|
||||
]
|
||||
// description:[
|
||||
// { required: true, message: this.$t('scriptRecord.inputScriptDescription'), trigger: 'blur' },
|
||||
// { required: true, message: this.$t('scriptRecord.inputScriptDescription'), trigger: 'change' }
|
||||
// ]
|
||||
};
|
||||
return crules;
|
||||
}
|
||||
},
|
||||
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) {
|
||||
if (questid) {
|
||||
getQuestById(questid).then(resp=>{
|
||||
|
@ -23,7 +23,7 @@
|
||||
<span> km/h</span>
|
||||
</el-form-item>
|
||||
<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
|
||||
:type="field === 'selectSingalCode' ? 'danger' : 'primary'"
|
||||
size="mini"
|
||||
@ -58,7 +58,8 @@ export default {
|
||||
{id:'NRM', name:'NRM'}
|
||||
],
|
||||
field: '',
|
||||
fieldS:''
|
||||
fieldS:'',
|
||||
signalName:''
|
||||
};
|
||||
},
|
||||
watch: {
|
||||
@ -84,7 +85,8 @@ export default {
|
||||
},
|
||||
deviceSelect(em) {
|
||||
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 = '';
|
||||
}
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user