Merge branch 'test' of https://git.code.tencent.com/lian-cbtc/jl-client into test
This commit is contained in:
commit
73d1af19d0
@ -26,8 +26,8 @@ export default {
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
'$store.state.socket.roomInvite': function (val) {
|
||||
if (val.creatorId) {
|
||||
'$store.state.socket.simulationInvite': function (val) {
|
||||
if (val.creator) {
|
||||
this.subscribeMessage(val);
|
||||
}
|
||||
},
|
||||
@ -73,7 +73,7 @@ export default {
|
||||
if (getSessionStorage('project') != 'refereeJsxt' && getSessionStorage('project') != 'jsxt' && !(getSessionStorage('project').includes('design'))) {
|
||||
this.$refs.deomonTopic.doShow(res);
|
||||
}
|
||||
this.$store.dispatch('socket/setRoomInvite');
|
||||
this.$store.dispatch('socket/setSimulationInvite');
|
||||
}
|
||||
},
|
||||
subscribe() {
|
||||
|
@ -360,4 +360,47 @@ export function quitCoversition(group, conversationId) {
|
||||
method: 'delete'
|
||||
});
|
||||
}
|
||||
|
||||
/** 发起会话 */
|
||||
export function startConversition(group, data) {
|
||||
return request({
|
||||
url: `/api/simulation/${group}/conversation`,
|
||||
method: 'post',
|
||||
data: data
|
||||
});
|
||||
}
|
||||
/** 根据会话id获取仿真会话 */
|
||||
export function getSimulationConversition(group, conversationId) {
|
||||
return request({
|
||||
url: `/api/simulation/${group}/conversation/${conversationId}`,
|
||||
method: 'get'
|
||||
});
|
||||
}
|
||||
/** 发送会话消息 */
|
||||
export function sendSimulationConversition(group, conversationId, file) {
|
||||
return request({
|
||||
url: `/api/simulation/${group}/conversation/${conversationId}/chat`,
|
||||
method: 'post',
|
||||
data: file
|
||||
});
|
||||
}
|
||||
/** 成员接收仿真会话邀请 */
|
||||
export function acceptConversitionInvite(group, conversationId) {
|
||||
return request({
|
||||
url: `/api/simulation/${group}/conversation/${conversationId}/connect`,
|
||||
method: 'post'
|
||||
});
|
||||
}
|
||||
/** 结束仿真会话 */
|
||||
export function overSimulationConversition(group, conversationId) {
|
||||
return request({
|
||||
url: `/api/simulation/${group}/conversation/${conversationId}/over`,
|
||||
method: 'put'
|
||||
});
|
||||
}
|
||||
/** 获取所有会话 */
|
||||
export function getAllConversition(group) {
|
||||
return request({
|
||||
url: `/api/simulation/${group}/conversation/listAll`,
|
||||
method: 'get'
|
||||
});
|
||||
}
|
||||
|
@ -208,3 +208,17 @@ export function getByGroupStationList(group) {
|
||||
method: 'get'
|
||||
});
|
||||
}
|
||||
/** 查询所有上线的地图信息列表 */
|
||||
export function getAllMapOnline() {
|
||||
return request({
|
||||
url: `/api/map/online/all`,
|
||||
method: 'get'
|
||||
});
|
||||
}
|
||||
/** 查询地图下所有需要值班员的车站 */
|
||||
export function getStationListNeedAttendant(id) {
|
||||
return request({
|
||||
url: `/api/map/${id}/station/needSupervisor`,
|
||||
method: 'get'
|
||||
});
|
||||
}
|
||||
|
47
src/api/jointSimulation.js
Normal file
47
src/api/jointSimulation.js
Normal file
@ -0,0 +1,47 @@
|
||||
import request from '@/utils/request';
|
||||
|
||||
// 分配(取消)用户角色扮演
|
||||
export function assignUsersPlayRoles(data, group) {
|
||||
return request({
|
||||
url: `/api/jointSimulation/${group}/assignRoles`,
|
||||
method: 'put',
|
||||
data: data
|
||||
});
|
||||
}
|
||||
// 添加新仿真成员
|
||||
export function addSimulationMember(data, group) {
|
||||
return request({
|
||||
url: `/api/jointSimulation/${group}/member`,
|
||||
method: 'post',
|
||||
data: data
|
||||
});
|
||||
}
|
||||
// 获取权限生成仿真用户
|
||||
export function jointSimulationByPermission(group) {
|
||||
return request({
|
||||
url: `/api/jointSimulation/${group}/permission`,
|
||||
method: 'post'
|
||||
});
|
||||
}
|
||||
// 生成综合仿真分享二维码
|
||||
export function getSimulationQrcode(group) {
|
||||
return request({
|
||||
url: `/api/jointSimulation/${group}/qrCode`,
|
||||
method: 'get'
|
||||
});
|
||||
}
|
||||
// 获取用户所在的综合演练
|
||||
export function getSimulationListCantainUser() {
|
||||
return request({
|
||||
url: `/api/jointSimulation/list/containUser`,
|
||||
method: 'get'
|
||||
});
|
||||
}
|
||||
// 将制定用户踢出房间
|
||||
export function kickOutMember(group, userId) {
|
||||
return request({
|
||||
url: `/api/jointSimulation/${group}/kickOut?userId=${userId}`,
|
||||
method: 'delete'
|
||||
|
||||
});
|
||||
}
|
@ -83,3 +83,13 @@ export function checkLoginLine() {
|
||||
method: 'get'
|
||||
});
|
||||
}
|
||||
// 获取登录信息(用户&设备)
|
||||
export function getLoginInfo(token) {
|
||||
return request({
|
||||
url: '/api/login/loginUserInfo',
|
||||
method: 'get',
|
||||
params: {
|
||||
token
|
||||
}
|
||||
});
|
||||
}
|
||||
|
@ -8,6 +8,14 @@ export function setCourseList(data) {
|
||||
data: data
|
||||
});
|
||||
}
|
||||
/** 贵州装备 创建对应课程考题 */
|
||||
export function setCourseListGzb(data) {
|
||||
return request({
|
||||
url: `/api/exam/project/GZB`,
|
||||
method: 'post',
|
||||
data: data
|
||||
});
|
||||
}
|
||||
|
||||
/** 获取对应课程下类型 */
|
||||
export function getCourseTypeList(data) {
|
||||
@ -93,3 +101,11 @@ export function getExamParperList(lessonId) {
|
||||
method: 'get'
|
||||
});
|
||||
}
|
||||
|
||||
/** 根据课程ID获取班级 */
|
||||
export function getExamClassList(lessonId) {
|
||||
return request({
|
||||
url: `/api/lesson/${lessonId}/classes`,
|
||||
method: 'get'
|
||||
});
|
||||
}
|
||||
|
@ -99,3 +99,47 @@ export function getDevicesByType(type) {
|
||||
method: 'get'
|
||||
});
|
||||
}
|
||||
/** 添加/修改车站综合监控配置 */
|
||||
export function setIscsLwConfig(id, data) {
|
||||
return request({
|
||||
url: `/api/device/${id}/config/iscslw`,
|
||||
method: 'put',
|
||||
data: data
|
||||
});
|
||||
}
|
||||
/** 添加/修改中心综合监控配置 */
|
||||
export function setIscsCwConfig(id, data) {
|
||||
return request({
|
||||
url: `/api/device/${id}/config/iscscw`,
|
||||
method: 'put',
|
||||
data: data
|
||||
});
|
||||
}
|
||||
|
||||
/** 添加/修改大屏工作站配置 */
|
||||
export function setLswConfig(id, data) {
|
||||
return request({
|
||||
url: `/api/device/${id}/config/lsw`,
|
||||
method: 'put',
|
||||
data: data
|
||||
});
|
||||
}
|
||||
|
||||
/** 添加/修改CCTV工作站配置 */
|
||||
export function setCctvConfig(id, data) {
|
||||
return request({
|
||||
url: `/api/device/${id}/config/cctv`,
|
||||
method: 'put',
|
||||
data: data
|
||||
});
|
||||
}
|
||||
|
||||
/** 添加/修改CCTV工作站配置 */
|
||||
export function setVrPsdConfig(id, data) {
|
||||
return request({
|
||||
url: `/api/device/${id}/config/vrpsd`,
|
||||
method: 'put',
|
||||
data: data
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -302,13 +302,6 @@ export function getScriptMemberData(group) {
|
||||
method: 'get'
|
||||
});
|
||||
}
|
||||
/** 获取剧本编制的所有成员角色(新版地图)*/
|
||||
export function getScriptMemberDataNew(group) {
|
||||
return request({
|
||||
url: `/api/scriptSimulation/${group}/allMember`,
|
||||
method: 'get'
|
||||
});
|
||||
}
|
||||
|
||||
/** 获取剧本出演成员角色 */
|
||||
export function getScriptPlayMember(group) {
|
||||
@ -770,4 +763,24 @@ export function getMemberInfo(group, memberId) {
|
||||
method: 'get'
|
||||
});
|
||||
}
|
||||
|
||||
/** 获取新版综合仿真仿真成员列表 */
|
||||
export function getSimulationMemberList(group) {
|
||||
return request({
|
||||
url: `/simulation/${group}/members`,
|
||||
method: 'get'
|
||||
});
|
||||
}
|
||||
/** 获取仿真用户信息 */
|
||||
export function getSimulationUserInfo(group) {
|
||||
return request({
|
||||
url: `/simulation/${group}/simulationUser`,
|
||||
method: 'get'
|
||||
});
|
||||
}
|
||||
// 获取所有仿真用户
|
||||
export function getAllSimulationUser(group) {
|
||||
return request({
|
||||
url: `/simulation/${group}/simulationUsers`,
|
||||
method: 'get'
|
||||
});
|
||||
}
|
||||
|
@ -206,5 +206,5 @@ export default {
|
||||
permissionAllNum:'权限总数',
|
||||
set: '设 置',
|
||||
joinNewRoom: '加入新房间',
|
||||
roomId: '房间号:'
|
||||
roomId: '仿真号:'
|
||||
};
|
||||
|
@ -494,7 +494,8 @@ class SkinCode extends defaultStyle {
|
||||
},
|
||||
lamp: {
|
||||
radiusR: 6, // 灯大小
|
||||
controlColor: '#00FF00' // 灯颜色
|
||||
controlColor: '#00FF00', // 灯颜色
|
||||
activeColor:'#ff0000' // 控制灯激活颜色
|
||||
},
|
||||
mouseOverStyle: {
|
||||
fontSize: 10,
|
||||
|
@ -449,7 +449,8 @@ class SkinCode extends defaultStyle {
|
||||
},
|
||||
lamp: {
|
||||
radiusR: 6, // 控制灯大小
|
||||
controlColor: '#00FF00' // 控制灯颜色
|
||||
controlColor: '#00FF00', // 控制灯颜色
|
||||
activeColor:'#ff0000' // 控制灯激活颜色
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -487,7 +487,8 @@ class SkinCode extends defaultStyle {
|
||||
},
|
||||
lamp: {
|
||||
radiusR: 6, // 控制灯大小
|
||||
controlColor: '#00FF00' // 控制灯颜色
|
||||
controlColor: '#00FF00', // 控制灯颜色
|
||||
activeColor:'#ff0000' // 控制灯激活颜色
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -11,7 +11,7 @@ import { selectLineCode } from './config/deviceStyle';
|
||||
import { deviceFactory, createBoundingRect, calculateDCenter } from './utils/parser';
|
||||
import { deepAssign } from '@/utils/index';
|
||||
import store from '@/store/index_APP_TARGET';
|
||||
import { loadPropConvert } from './theme/factory';
|
||||
import Vue from 'vue';
|
||||
|
||||
const renderer = 'canvas';
|
||||
const devicePixelRatio = 1;
|
||||
@ -27,6 +27,9 @@ class Jlmap {
|
||||
// 线路参数
|
||||
this.lineCode = '';
|
||||
|
||||
// 大屏判断
|
||||
this.screenFlag = false;
|
||||
|
||||
// 皮肤风格
|
||||
this.style = {};
|
||||
|
||||
@ -135,8 +138,12 @@ class Jlmap {
|
||||
|
||||
setOptions(opts) {
|
||||
const options = this.pullBack(opts);
|
||||
this.$options.update(options);
|
||||
this.$painter.updateTransform(this.$options);
|
||||
if (this.screenFlag) {
|
||||
this.$painter.updateScreen(options);
|
||||
} else {
|
||||
this.$options.update(options);
|
||||
this.$painter.updateTransform(this.$options);
|
||||
}
|
||||
if (this.$options.disabled == true) {
|
||||
this.$mouseController.disable();
|
||||
} else {
|
||||
@ -148,6 +155,18 @@ class Jlmap {
|
||||
if (this.methods.optionsUpdate instanceof Function) { this.methods.optionsUpdate(this.$options); }
|
||||
}
|
||||
|
||||
switchScreen(data, num, sum) {
|
||||
const sumHalf = sum / 2;
|
||||
const dx = data.width / sumHalf;
|
||||
const dy = data.height / sumHalf;
|
||||
const row = num <= sumHalf ? 0 : 1;
|
||||
const opts = {
|
||||
dx: dx * (row == 0 ? num - 1 : num - sumHalf - 1),
|
||||
dy: dy * row
|
||||
};
|
||||
this.$painter.updateScreenNum(opts);
|
||||
}
|
||||
|
||||
setCenter(deviceCode) {
|
||||
const device = this.mapDevice[deviceCode];
|
||||
if (device && device.instance) {
|
||||
@ -157,20 +176,23 @@ class Jlmap {
|
||||
}
|
||||
}
|
||||
setRevoverBigScreen() {
|
||||
this.screenFlag = false;
|
||||
this.$painter.updateTransform({ scaleRate: this.$options.scaleRate, offsetX: this.$options.offsetX, offsetY: this.$options.offsetY });
|
||||
}
|
||||
setRecover(opts) {
|
||||
this.screenFlag = false;
|
||||
this.$painter.updateTransform({ scaleRate: opts.scaleRate, offsetX: opts.offsetX, offsetY: opts.offsetY });
|
||||
}
|
||||
|
||||
setUpdateScreen(opts) {
|
||||
this.setRecover({ scaleRate: 1, offsetX: 0, offsetY: 0 });
|
||||
const arr = [];
|
||||
this.screenFlag = true;
|
||||
const screenList = [];
|
||||
const rectList = [];
|
||||
let rect = '';
|
||||
for (const i in this.mapDevice) {
|
||||
const element = this.mapDevice[i];
|
||||
if (element.instance && element._type == 'Section') {
|
||||
if (element.instance && (element._type == 'Section' || element._type == 'Station' || element._type == 'StationStand')) {
|
||||
if (!rect) {
|
||||
rect = element.instance.getBoundingRect().clone();
|
||||
} else {
|
||||
@ -178,18 +200,23 @@ class Jlmap {
|
||||
}
|
||||
}
|
||||
}
|
||||
const screenSplit = opts.list.length ? opts.list : loadPropConvert(this.lineCode).screenSplit;
|
||||
if (!opts.offsetList) {
|
||||
opts.offsetList = [];
|
||||
}
|
||||
const screenSplit = opts.list.length ? opts.list : Vue.prototype.$theme.loadPropConvert(this.lineCode).screenSplit;
|
||||
const screenDifference = Vue.prototype.$theme.loadPropConvert(this.lineCode).screenDifference || 160;
|
||||
const splitList = JSON.parse(JSON.stringify(screenSplit));
|
||||
const num = screenSplit.length + 1;
|
||||
const offsetY = (opts.height - 100) / num; // 高度差
|
||||
const maxWidth = rect.width;
|
||||
splitList.push(maxWidth);
|
||||
const scaleWidth = Math.floor((((opts.width - 200) * num) / rect.width) * 100) / 100;
|
||||
const scaleHeight = Math.floor(((opts.height - 100) / (rect.height * num)) * 100) / 100;
|
||||
const scale = Math.min(scaleWidth, scaleHeight);
|
||||
const scaleX = Math.floor((((opts.width - 200) * num) / rect.width) * 100) / 100;
|
||||
const scaleY = Math.floor(((opts.height - 100) / (rect.height * num)) * 100) / 100;
|
||||
const scale = Math.min(scaleX, scaleY);
|
||||
// console.log('scaleX', scaleX, 'scaleY', scaleY, 'scale', scale, offsetY, rect.height * scale);
|
||||
|
||||
// const offsetHeight = (offsetY - (rect.height * scale)) + Math.abs(rect.x * scale); // 高度差
|
||||
// console.log(offsetHeight, opts.height, screenSplit, offsetY, rect, '缩放对比>', scaleWidth, scaleHeight);
|
||||
// const offsetHeight = (offsetY - (rect.height * scale)) / 2; // 高度差
|
||||
// console.log(offsetHeight, opts.height, screenSplit, offsetY, rect, '缩放对比>', scaleX, scaleY);
|
||||
|
||||
for (let i = 0; i < splitList.length; i++) {
|
||||
let offsetX = '';
|
||||
@ -199,13 +226,13 @@ class Jlmap {
|
||||
const dx = (opts.width - (splitList[i] - splitList[i - 1]) * scale) / 2; // 居中计算偏移值
|
||||
offsetX = splitList[i - 1] * scale - dx;
|
||||
}
|
||||
// const param = { scaleRate: scale, offsetX: offsetX, offsetY: -(offsetY * i) - offsetHeight};
|
||||
const param = { scaleRate: scale, offsetX: offsetX, offsetY: -160 - (offsetY * i) };
|
||||
arr.push(param);
|
||||
const offset = opts.offsetList[i] || 0;
|
||||
const param = { scaleRateX: scale, scaleRateY: scale, offsetX: offsetX, offsetY: -screenDifference - (offsetY * i) - offset };
|
||||
screenList.push(param);
|
||||
const rect = {x: 0, y: 0, width: Number(splitList[i]) + 5, height: opts.height};
|
||||
rectList.push(rect);
|
||||
}
|
||||
this.$painter.updateTransform1(arr, rectList);
|
||||
this.$painter.updateTransform1(screenList, rectList);
|
||||
}
|
||||
|
||||
setLevelVisible(list) {
|
||||
|
@ -199,6 +199,12 @@ class Painter {
|
||||
this.$transformHandle.updateTransform(opt);
|
||||
}
|
||||
|
||||
updateScreen(opt) {
|
||||
this.$transformHandleScreen.updataOffset(opt);
|
||||
}
|
||||
updateScreenNum(opts) {
|
||||
this.$transformHandleScreen.updataOffsetNum(opts);
|
||||
}
|
||||
updateTransform1(list, opts) {
|
||||
this.screenFlag = true;
|
||||
this.$transformHandleScreen.updateTransform(list, opts);
|
||||
|
@ -1,7 +1,7 @@
|
||||
import Line from 'zrender/src/graphic/shape/Line';
|
||||
import Arc from 'zrender/src/graphic/shape/Arc';
|
||||
import Group from 'zrender/src/container/Group';
|
||||
import Path from 'zrender/src/graphic/Path';
|
||||
// import Path from 'zrender/src/graphic/Path';
|
||||
import {ESigFault} from './ESigFault';
|
||||
|
||||
class ESigLamp extends Group {
|
||||
@ -103,11 +103,11 @@ class ESigLamp extends Group {
|
||||
}
|
||||
|
||||
faultShow() {
|
||||
this.lampFault.show();
|
||||
this.lampFault && this.lampFault.show();
|
||||
}
|
||||
|
||||
faultHide() {
|
||||
this.lampFault.hide();
|
||||
this.lampFault && this.lampFault.hide();
|
||||
}
|
||||
|
||||
setColor(color) {
|
||||
|
@ -548,7 +548,9 @@ class Signal extends Group {
|
||||
// 恢复状态
|
||||
recover() {
|
||||
this.lamps.forEach(item=> { item.show(); });
|
||||
this.lamps[0].faultHide();
|
||||
if (this.style.Signal.lamp.faultType && this.style.Signal.lamp.faultType == 'flash') {
|
||||
this.lamps[0].faultHide();
|
||||
}
|
||||
this.sigName.setStyle({ textBorderWidth: 0 });
|
||||
this.sigName.setColor(this.style.Signal.text.defaultColor);
|
||||
this.setAutoClose();
|
||||
|
@ -61,8 +61,23 @@ export default class ZcControl extends Group {
|
||||
|
||||
// 设置状态
|
||||
setState(model) {
|
||||
this.recover();
|
||||
model.fault == 'FAULT' && this.fault();
|
||||
if (!this.isShowShape) return;
|
||||
}
|
||||
|
||||
recover() {
|
||||
if (this.style.ZcControl.visible) {
|
||||
this.control.setControlColor(this.style.ZcControl.lamp.controlColor);
|
||||
}
|
||||
}
|
||||
|
||||
fault() {
|
||||
if (this.style.ZcControl.visible) {
|
||||
this.control.setControlColor(this.style.ZcControl.lamp.activeColor);
|
||||
}
|
||||
}
|
||||
|
||||
createMouseEvent() {
|
||||
if (this.style.ZcControl.mouseOverStyle) {
|
||||
this.mouseEvent = new EMouse(this);
|
||||
|
@ -3,7 +3,6 @@
|
||||
<menu-cancel ref="menuCancel" />
|
||||
<menu-bar v-show="isShowBar" ref="menuBar" :selected="selected" />
|
||||
<menu-button ref="menuButton" />
|
||||
<menu-station-control ref="menuStationControl" :selected="selected" />
|
||||
<menu-station-stand ref="menuStationStand" :selected="selected" />
|
||||
<menu-switch ref="menuSwitch" :selected="selected" />
|
||||
<menu-signal ref="menuSignal" :selected="selected" />
|
||||
@ -22,7 +21,6 @@ import { mapGetters } from 'vuex';
|
||||
import MenuCancel from './menuCancel';
|
||||
import MenuSignal from './menuSignal';
|
||||
import MenuButton from './menuButton';
|
||||
import MenuStationControl from './menuStationControl';
|
||||
import MenuStationStand from './menuStationStand';
|
||||
import MenuSwitch from './menuSwitch';
|
||||
import MenuSection from './menuSection';
|
||||
@ -43,7 +41,6 @@ export default {
|
||||
MenuSignal,
|
||||
MenuSwitch,
|
||||
MenuSection,
|
||||
MenuStationControl,
|
||||
MenuStationStand,
|
||||
MenuStation,
|
||||
MenuTrain,
|
||||
|
@ -170,19 +170,10 @@ export default {
|
||||
}
|
||||
}
|
||||
},
|
||||
// 添加计划车
|
||||
// 添加计划车(开发专用)
|
||||
addPlanTrain() {
|
||||
const operate = {
|
||||
start: true,
|
||||
code: this.selected.code,
|
||||
operation: OperationEvent.Train.createPlanTrain.menu.operation,
|
||||
param: {
|
||||
sectionCode: this.selected.code
|
||||
}
|
||||
};
|
||||
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
|
||||
commitOperate(menuOperate.Train.createPlanTrain, {sectionCode:this.selected.code}, 0).then(({valid, operate})=>{
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.$refs.trainAddPlan.doShow(operate);
|
||||
}
|
||||
});
|
||||
|
@ -4,6 +4,7 @@
|
||||
<station-cmd-control ref="stationCmdControl" />
|
||||
<station-human-control-all ref="stationHumanControlAll" />
|
||||
<station-set-route-control-all ref="stationSetRouteControlAll" />
|
||||
<set-fault ref="setFault" pop-class="beijing-01__systerm" />
|
||||
<notice-info ref="noticeInfo" pop-class="beijing-01__systerm" />
|
||||
</div>
|
||||
</template>
|
||||
@ -20,12 +21,15 @@ import { DeviceMenu } from '@/scripts/ConstDic';
|
||||
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
|
||||
import MenuContextHandler from '@/scripts/cmdPlugin/MenuContextHandler';
|
||||
import CMD from '@/scripts/cmdPlugin/CommandEnum';
|
||||
import { mouseCancelState } from '@/jmapNew/theme/components/utils/menuItemStatus';
|
||||
// import { mouseCancelState } from '@/jmapNew/theme/components/utils/menuItemStatus';
|
||||
import SetFault from '@/jmapNew/theme/components/menus/dialog/setFault';
|
||||
import {menuOperate, commitOperate} from '@/jmapNew/theme/components/utils/menuOperate';
|
||||
|
||||
export default {
|
||||
name: 'StationMenu',
|
||||
components: {
|
||||
PopMenu,
|
||||
SetFault,
|
||||
StationCmdControl,
|
||||
StationHumanControlAll,
|
||||
StationSetRouteControlAll,
|
||||
@ -162,42 +166,18 @@ export default {
|
||||
},
|
||||
// 设置故障
|
||||
setStoppage() {
|
||||
const operate = {
|
||||
start: true,
|
||||
send: true,
|
||||
code: this.selected.code,
|
||||
operation: OperationEvent.Station.stoppage.menu.operation
|
||||
};
|
||||
|
||||
mouseCancelState(this.selected);
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
commitOperate(menuOperate.Common.setFault, { code: this.selected.zcCode }, 0).then(({valid, operate})=>{
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
} else {
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
this.$refs.setFault.doShow(menuOperate.Common.setFault, this.selected);
|
||||
}
|
||||
}).catch(() => {
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
});
|
||||
},
|
||||
// 取消故障
|
||||
cancelStoppage() {
|
||||
const operate = {
|
||||
start: true,
|
||||
send: true,
|
||||
code: this.selected.code,
|
||||
operation: OperationEvent.Station.cancelStoppage.menu.operation
|
||||
};
|
||||
|
||||
mouseCancelState(this.selected);
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
commitOperate(menuOperate.Common.cancelFault, { code: this.selected.zcCode }, 0).then(({valid, operate})=>{
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
} else {
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
this.$refs.setFault.doShow(menuOperate.Common.cancelFault, this.selected);
|
||||
}
|
||||
}).catch(() => {
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
});
|
||||
},
|
||||
// 全站设置联锁自动触发
|
||||
|
@ -1,69 +0,0 @@
|
||||
<template>
|
||||
<pop-menu ref="popMenu" :menu="menu" />
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import PopMenu from '@/components/PopMenu';
|
||||
import { mapGetters } from 'vuex';
|
||||
import { DeviceMenu } from '@/scripts/ConstDic';
|
||||
|
||||
export default {
|
||||
name: 'StationControlMenu',
|
||||
components: {
|
||||
PopMenu
|
||||
},
|
||||
props: {
|
||||
selected: {
|
||||
type: Object,
|
||||
default() {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
menu: [],
|
||||
menuNormal: [
|
||||
],
|
||||
menuForce: [
|
||||
]
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
...mapGetters('training', [
|
||||
'mode',
|
||||
'operatemode'
|
||||
]),
|
||||
...mapGetters('menuOperation', [
|
||||
'buttonOperation'
|
||||
])
|
||||
},
|
||||
watch: {
|
||||
'$store.state.menuOperation.menuCount': function (val) {
|
||||
if (this.$store.getters['menuOperation/checkDialogIsOpen'](DeviceMenu.StationControl) && !this.buttonOperation) {
|
||||
this.doShow(this.$store.state.menuOperation.menuPosition);
|
||||
} else {
|
||||
this.doClose();
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
clickEvent() {
|
||||
const self = this;
|
||||
window.onclick = function (e) {
|
||||
self.doClose();
|
||||
};
|
||||
},
|
||||
doShow(point) {
|
||||
if (this.$refs && this.$refs.popMenu) {
|
||||
this.$refs.popMenu.close();
|
||||
}
|
||||
},
|
||||
doClose() {
|
||||
if (this.$refs && this.$refs.popMenu) {
|
||||
this.$refs.popMenu.close();
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
@ -1,6 +1,7 @@
|
||||
<template>
|
||||
<div>
|
||||
<pop-menu ref="popMenu" :menu="menu" />
|
||||
<set-fault ref="setFault" pop-class="chengdou-01__systerm" />
|
||||
<notice-info ref="noticeInfo" pop-class="chengdou-01__system" />
|
||||
</div>
|
||||
</template>
|
||||
@ -12,11 +13,14 @@ import CancelMouseState from '@/mixin/CancelMouseState';
|
||||
import { mapGetters } from 'vuex';
|
||||
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
|
||||
import { DeviceMenu, OperateMode } from '@/scripts/ConstDic';
|
||||
import SetFault from '@/jmapNew/theme/components/menus/dialog/setFault';
|
||||
import {menuOperate, commitOperate} from '@/jmapNew/theme/components/utils/menuOperate';
|
||||
|
||||
export default {
|
||||
name: 'StationMenu',
|
||||
components: {
|
||||
PopMenu,
|
||||
SetFault,
|
||||
NoticeInfo
|
||||
},
|
||||
mixins: [
|
||||
@ -98,38 +102,18 @@ export default {
|
||||
},
|
||||
// 设置故障
|
||||
setStoppage() {
|
||||
const operate = {
|
||||
code: this.selected.code,
|
||||
operation: OperationEvent.Station.stoppage.menu.operation
|
||||
};
|
||||
|
||||
this.mouseCancelState(this.selected);
|
||||
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
|
||||
commitOperate(menuOperate.Common.setFault, { code: this.selected.zcCode }, 0).then(({valid, operate})=>{
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
} else {
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
this.$refs.setFault.doShow(menuOperate.Common.setFault, this.selected);
|
||||
}
|
||||
}).catch(() => {
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
});
|
||||
},
|
||||
// 取消故障
|
||||
cancelStoppage() {
|
||||
const operate = {
|
||||
code: this.selected.code,
|
||||
operation: OperationEvent.Station.cancelStoppage.menu.operation
|
||||
};
|
||||
|
||||
this.mouseCancelState(this.selected);
|
||||
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
|
||||
commitOperate(menuOperate.Common.cancelFault, { code: this.selected.zcCode }, 0).then(({valid, operate})=>{
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
} else {
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
this.$refs.setFault.doShow(menuOperate.Common.cancelFault, this.selected);
|
||||
}
|
||||
}).catch(() => {
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
@ -59,9 +59,6 @@ export default {
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
...mapGetters('map', [
|
||||
'signalList'
|
||||
]),
|
||||
show() {
|
||||
return this.dialogShow && !this.$store.state.menuOperation.break;
|
||||
},
|
||||
|
@ -2,7 +2,6 @@
|
||||
<div>
|
||||
<pop-menu ref="popMenu" :menu="menu" />
|
||||
<section-control ref="sectionControl" pop-class="chengdou-03__systerm" />
|
||||
<train-create ref="trainCreate" />
|
||||
<section-detail ref="sectionDetail" />
|
||||
<notice-info ref="noticeInfo" pop-class="chengdou-03__systerm" />
|
||||
<train-add-plan ref="trainAddPlan" pop-class="chengdou-03__systerm" />
|
||||
@ -16,7 +15,6 @@ import SectionControl from '@/jmapNew/theme/components/menus/dialog/sectionContr
|
||||
import TrainAddPlan from '@/jmapNew/theme/components/menus/dialog/trainAddPlan';
|
||||
import SetFault from '@/jmapNew/theme/components/menus/dialog/setFault';
|
||||
import SectionDetail from './dialog/sectionDetail';
|
||||
import TrainCreate from './dialog/trainCreate';
|
||||
import NoticeInfo from '@/jmapNew/theme/components/menus/childDialog/noticeInfo';
|
||||
import { mapGetters } from 'vuex';
|
||||
import CMD from '@/scripts/cmdPlugin/CommandEnum';
|
||||
@ -31,7 +29,6 @@ export default {
|
||||
PopMenu,
|
||||
SectionControl,
|
||||
SectionDetail,
|
||||
TrainCreate,
|
||||
NoticeInfo,
|
||||
TrainAddPlan,
|
||||
SetFault
|
||||
|
@ -1,6 +1,7 @@
|
||||
<template>
|
||||
<div>
|
||||
<pop-menu ref="popMenu" :menu="menu" />
|
||||
<set-fault ref="setFault" pop-class="chengdou-03__systerm" />
|
||||
<notice-info ref="noticeInfo" pop-class="chengdou-03__systerm" />
|
||||
</div>
|
||||
</template>
|
||||
@ -11,13 +12,15 @@ import MenuContextHandler from '@/scripts/cmdPlugin/MenuContextHandler';
|
||||
import NoticeInfo from '@/jmapNew/theme/components/menus/childDialog/noticeInfo';
|
||||
import CancelMouseState from '@/mixin/CancelMouseState';
|
||||
import { mapGetters } from 'vuex';
|
||||
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
|
||||
import { DeviceMenu, OperateMode } from '@/scripts/ConstDic';
|
||||
import SetFault from '@/jmapNew/theme/components/menus/dialog/setFault';
|
||||
import {menuOperate, commitOperate} from '@/jmapNew/theme/components/utils/menuOperate';
|
||||
|
||||
export default {
|
||||
name: 'StationMenu',
|
||||
components: {
|
||||
PopMenu,
|
||||
SetFault,
|
||||
NoticeInfo
|
||||
},
|
||||
mixins: [
|
||||
@ -100,42 +103,18 @@ export default {
|
||||
},
|
||||
// 设置故障
|
||||
setStoppage() {
|
||||
const operate = {
|
||||
start: true,
|
||||
send: true,
|
||||
code: this.selected.code,
|
||||
operation: OperationEvent.Station.stoppage.menu.operation
|
||||
};
|
||||
|
||||
this.mouseCancelState(this.selected);
|
||||
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
|
||||
commitOperate(menuOperate.Common.setFault, { code: this.selected.zcCode }, 0).then(({valid, operate})=>{
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
} else {
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
this.$refs.setFault.doShow(menuOperate.Common.setFault, this.selected);
|
||||
}
|
||||
}).catch(() => {
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
});
|
||||
},
|
||||
// 取消故障
|
||||
cancelStoppage() {
|
||||
const operate = {
|
||||
start: true,
|
||||
send: true,
|
||||
code: this.selected.code,
|
||||
operation: OperationEvent.Station.cancelStoppage.menu.operation
|
||||
};
|
||||
|
||||
this.mouseCancelState(this.selected);
|
||||
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
|
||||
commitOperate(menuOperate.Common.cancelFault, { code: this.selected.zcCode }, 0).then(({valid, operate})=>{
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
} else {
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
this.$refs.setFault.doShow(menuOperate.Common.cancelFault, this.selected);
|
||||
}
|
||||
}).catch(() => {
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
@ -101,16 +101,25 @@ export default {
|
||||
this.stationName = '';
|
||||
this.operation = operate.operation;
|
||||
this.cmdType = operate.cmdType;
|
||||
if (selected._type == 'Station') {
|
||||
if (selected.zcCode) {
|
||||
selected = this.$store.getters['map/getDeviceByCode'](selected.zcCode);
|
||||
} else {
|
||||
selected._type = '';
|
||||
}
|
||||
}
|
||||
this.deviceName = deviceType[selected._type] + '-' + selected.name;
|
||||
this.faultList = deviceFaultType[selected._type];
|
||||
if (this.faultList.length) {
|
||||
if (this.faultList && this.faultList.length) {
|
||||
this.form.faultType = this.faultList[0].value;
|
||||
}
|
||||
}
|
||||
this.dialogShow = true;
|
||||
this.$nextTick(function () {
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
});
|
||||
if (selected._type) {
|
||||
this.dialogShow = true;
|
||||
this.$nextTick(function () {
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
});
|
||||
}
|
||||
},
|
||||
doClose() {
|
||||
this.loading = false;
|
||||
|
@ -34,6 +34,12 @@ class Theme {
|
||||
return Object.assign({}, require(`./${this._mapMenu[code || this._code]}/menus/index`).default);
|
||||
}
|
||||
|
||||
// // 加载菜单组件
|
||||
// loadMenuComponent(code) {
|
||||
// const menuCode = code || this._code;
|
||||
// return new LoadMenuComponent(menuCode);
|
||||
// }
|
||||
|
||||
// 加载运行图计划表组件
|
||||
// loadPlanComponent(code) {
|
||||
// return Object.assign({}, require(`./${this._mapMenu[code || this._code]}/planSchedule/index`).default);
|
||||
|
@ -4,6 +4,7 @@
|
||||
<station-cmd-control ref="stationCmdControl" />
|
||||
<station-human-control-all ref="stationHumanControlAll" />
|
||||
<station-set-route-control-all ref="stationSetRouteControlAll" />
|
||||
<set-fault ref="setFault" pop-class="foshan-01__systerm" />
|
||||
<notice-info ref="noticeInfo" pop-class="foshan-01__systerm" />
|
||||
</div>
|
||||
</template>
|
||||
@ -16,7 +17,9 @@ import StationSetRouteControlAll from './dialog/stationSetRouteControlAll';
|
||||
import NoticeInfo from '@/jmapNew/theme/components/menus/childDialog/noticeInfo';
|
||||
import { mapGetters } from 'vuex';
|
||||
import { OperateMode } from '@/scripts/ConstDic';
|
||||
import SetFault from '@/jmapNew/theme/components/menus/dialog/setFault';
|
||||
import { MapDeviceType, OperationEvent, DeviceMenu } from '@/scripts/ConstDic';
|
||||
import {menuOperate, commitOperate} from '@/jmapNew/theme/components/utils/menuOperate';
|
||||
|
||||
export default {
|
||||
name: 'StationMenu',
|
||||
@ -25,6 +28,7 @@ export default {
|
||||
StationCmdControl,
|
||||
StationHumanControlAll,
|
||||
StationSetRouteControlAll,
|
||||
SetFault,
|
||||
NoticeInfo
|
||||
},
|
||||
props: {
|
||||
@ -133,46 +137,18 @@ export default {
|
||||
},
|
||||
// 设置故障
|
||||
setStoppage() {
|
||||
const operate = {
|
||||
start: true,
|
||||
send: true,
|
||||
code: this.selected.code,
|
||||
type: MapDeviceType.Station.type,
|
||||
label: MapDeviceType.Station.label,
|
||||
operation: OperationEvent.Station.stoppage.menu.operation
|
||||
};
|
||||
|
||||
this.mouseCancelState(this.selected);
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
commitOperate(menuOperate.Common.setFault, { code: this.selected.zcCode }, 0).then(({valid, operate})=>{
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
} else {
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
this.$refs.setFault.doShow(menuOperate.Common.setFault, this.selected);
|
||||
}
|
||||
}).catch(() => {
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
});
|
||||
},
|
||||
// 取消故障
|
||||
cancelStoppage() {
|
||||
const operate = {
|
||||
start: true,
|
||||
send: true,
|
||||
code: this.selected.code,
|
||||
type: MapDeviceType.Station.type,
|
||||
label: MapDeviceType.Station.label,
|
||||
operation: OperationEvent.Station.cancelStoppage.menu.operation
|
||||
};
|
||||
|
||||
this.mouseCancelState(this.selected);
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
commitOperate(menuOperate.Common.cancelFault, { code: this.selected.zcCode }, 0).then(({valid, operate})=>{
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
} else {
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
this.$refs.setFault.doShow(menuOperate.Common.cancelFault, this.selected);
|
||||
}
|
||||
}).catch(() => {
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
});
|
||||
},
|
||||
// 全站设置联锁自动触发
|
||||
|
@ -4,6 +4,7 @@
|
||||
<station-cmd-control ref="stationCmdControl" pop-class="fuzhou-01__systerm" />
|
||||
<station-human-control-all ref="stationHumanControlAll" pop-class="fuzhou-01__systerm" />
|
||||
<station-set-route-control-all ref="stationSetRouteControlAll" pop-class="fuzhou-01__systerm" />
|
||||
<set-fault ref="setFault" pop-class="fuzhou-01__systerm" />
|
||||
<notice-info ref="noticeInfo" pop-class="fuzhou-01__systerm" />
|
||||
</div>
|
||||
</template>
|
||||
@ -15,9 +16,9 @@ import StationHumanControlAll from '@/jmapNew/theme/components/menus/dialog/stat
|
||||
import StationSetRouteControlAll from '@/jmapNew/theme/components/menus/dialog/stationSetRouteControlAll';
|
||||
import NoticeInfo from '@/jmapNew/theme/components/menus/childDialog/noticeInfo';
|
||||
import { mapGetters } from 'vuex';
|
||||
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
|
||||
import { DeviceMenu, OperateMode } from '@/scripts/ConstDic';
|
||||
import CMD from '@/scripts/cmdPlugin/CommandEnum';
|
||||
import SetFault from '@/jmapNew/theme/components/menus/dialog/setFault';
|
||||
import MenuContextHandler from '@/scripts/cmdPlugin/MenuContextHandler';
|
||||
import {menuOperate, commitOperate} from '@/jmapNew/theme/components/utils/menuOperate';
|
||||
|
||||
@ -28,6 +29,7 @@ export default {
|
||||
StationCmdControl,
|
||||
StationHumanControlAll,
|
||||
StationSetRouteControlAll,
|
||||
SetFault,
|
||||
NoticeInfo
|
||||
},
|
||||
props: {
|
||||
@ -156,44 +158,18 @@ export default {
|
||||
},
|
||||
// 设置故障
|
||||
setStoppage() {
|
||||
const step = {
|
||||
start: true,
|
||||
code: `${this.selected.code}`,
|
||||
operation: OperationEvent.Station.stoppage.menu.operation,
|
||||
cmdType: CMD.Station.CMD_STOPPAGE,
|
||||
param: {
|
||||
Station_Code: `${this.selected.code}`
|
||||
}
|
||||
};
|
||||
this.$store.dispatch('training/next', step).then(({ valid }) => {
|
||||
commitOperate(menuOperate.Common.setFault, { code: this.selected.zcCode }, 0).then(({valid, operate})=>{
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
} else {
|
||||
this.$refs.noticeInfo.doShow(step);
|
||||
this.$refs.setFault.doShow(menuOperate.Common.setFault, this.selected);
|
||||
}
|
||||
}).catch(() => {
|
||||
this.$refs.noticeInfo.doShow(step);
|
||||
});
|
||||
},
|
||||
// 取消故障
|
||||
cancelStoppage() {
|
||||
const step = {
|
||||
start: true,
|
||||
code: `${this.selected.code}`,
|
||||
operation: OperationEvent.Station.cancelStoppage.menu.operation,
|
||||
cmdType: CMD.Station.CMD_CANCEL_STOPPAGE,
|
||||
param: {
|
||||
Station_Code: `${this.selected.code}`
|
||||
}
|
||||
};
|
||||
this.$store.dispatch('training/next', step).then(({ valid }) => {
|
||||
commitOperate(menuOperate.Common.cancelFault, { code: this.selected.zcCode }, 0).then(({valid, operate})=>{
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
} else {
|
||||
this.$refs.noticeInfo.doShow(step);
|
||||
this.$refs.setFault.doShow(menuOperate.Common.cancelFault, this.selected);
|
||||
}
|
||||
}).catch(() => {
|
||||
this.$refs.noticeInfo.doShow(step);
|
||||
});
|
||||
},
|
||||
// 全站设置联锁自动触发
|
||||
|
@ -4,6 +4,7 @@
|
||||
<station-cmd-control ref="stationCmdControl" />
|
||||
<station-human-control-all ref="stationHumanControlAll" />
|
||||
<station-set-route-control-all ref="stationSetRouteControlAll" />
|
||||
<set-fault ref="setFault" pop-class="haerbin-01__systerm" />
|
||||
<notice-info ref="noticeInfo" pop-class="haerbin-01__systerm" />
|
||||
</div>
|
||||
</template>
|
||||
@ -18,6 +19,8 @@ import { mapGetters } from 'vuex';
|
||||
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
|
||||
import { DeviceMenu, OperateMode } from '@/scripts/ConstDic';
|
||||
import CMD from '@/scripts/cmdPlugin/CommandEnum';
|
||||
import {menuOperate, commitOperate} from '@/jmapNew/theme/components/utils/menuOperate';
|
||||
import SetFault from '@/jmapNew/theme/components/menus/dialog/setFault';
|
||||
import MenuContextHandler from '@/scripts/cmdPlugin/MenuContextHandler';
|
||||
|
||||
export default {
|
||||
@ -26,6 +29,7 @@ export default {
|
||||
PopMenu,
|
||||
StationCmdControl,
|
||||
StationHumanControlAll,
|
||||
SetFault,
|
||||
StationSetRouteControlAll,
|
||||
NoticeInfo
|
||||
},
|
||||
@ -158,44 +162,18 @@ export default {
|
||||
},
|
||||
// 设置故障
|
||||
setStoppage() {
|
||||
const step = {
|
||||
start: true,
|
||||
code: `${this.selected.code}`,
|
||||
operation: OperationEvent.Station.stoppage.menu.operation,
|
||||
cmdType: CMD.Station.CMD_STOPPAGE,
|
||||
param: {
|
||||
Station_Code: `${this.selected.code}`
|
||||
}
|
||||
};
|
||||
this.$store.dispatch('training/next', step).then(({ valid }) => {
|
||||
commitOperate(menuOperate.Common.setFault, { code: this.selected.zcCode }, 0).then(({valid, operate})=>{
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
} else {
|
||||
this.$refs.noticeInfo.doShow(step);
|
||||
this.$refs.setFault.doShow(menuOperate.Common.setFault, this.selected);
|
||||
}
|
||||
}).catch(() => {
|
||||
this.$refs.noticeInfo.doShow(step);
|
||||
});
|
||||
},
|
||||
// 取消故障
|
||||
cancelStoppage() {
|
||||
const step = {
|
||||
start: true,
|
||||
code: `${this.selected.code}`,
|
||||
operation: OperationEvent.Station.cancelStoppage.menu.operation,
|
||||
cmdType: CMD.Station.CMD_CANCEL_STOPPAGE,
|
||||
param: {
|
||||
Station_Code: `${this.selected.code}`
|
||||
}
|
||||
};
|
||||
this.$store.dispatch('training/next', step).then(({ valid }) => {
|
||||
commitOperate(menuOperate.Common.cancelFault, { code: this.selected.zcCode }, 0).then(({valid, operate})=>{
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
} else {
|
||||
this.$refs.noticeInfo.doShow(step);
|
||||
this.$refs.setFault.doShow(menuOperate.Common.cancelFault, this.selected);
|
||||
}
|
||||
}).catch(() => {
|
||||
this.$refs.noticeInfo.doShow(step);
|
||||
});
|
||||
},
|
||||
// 全站设置联锁自动触发
|
||||
|
@ -3,6 +3,7 @@ import deviceType from '../../constant/deviceType';
|
||||
class Model {
|
||||
constructor() {
|
||||
this.screenLine = 3;
|
||||
this.screenDifference = 50;
|
||||
// 公共字段部分默认初始值
|
||||
this['public'] = {};
|
||||
this['public'][deviceType.Signal] = {
|
||||
|
@ -7,7 +7,6 @@
|
||||
<menu-station-stand ref="menuStationStand" :selected="selected" />
|
||||
<menu-station-control ref="menuStationControl" />
|
||||
<menu-station-turn-back ref="menuStationTurnBack" :selected="selected" />
|
||||
<!-- :selected="selected" -->
|
||||
<menu-switch ref="menuSwitch" :selected="selected" />
|
||||
<menu-signal ref="menuSignal" :selected="selected" />
|
||||
<menu-section ref="menuSection" :selected="selected" />
|
||||
|
@ -4,6 +4,7 @@
|
||||
<station-cmd-control ref="stationCmdControl" pop-class="ningbo-01__systerm" />
|
||||
<station-human-control-all ref="stationHumanControlAll" pop-class="ningbo-01__systerm" />
|
||||
<station-set-route-control-all ref="stationSetRouteControlAll" pop-class="ningbo-01__systerm" />
|
||||
<set-fault ref="setFault" pop-class="ningbo-01__systerm" />
|
||||
<notice-info ref="noticeInfo" pop-class="ningbo-01__systerm" />
|
||||
</div>
|
||||
</template>
|
||||
@ -17,9 +18,10 @@ import NoticeInfo from '@/jmapNew/theme/components/menus/childDialog/noticeInfo'
|
||||
import CMD from '@/scripts/cmdPlugin/CommandEnum';
|
||||
import { mapGetters } from 'vuex';
|
||||
import { OperateMode } from '@/scripts/ConstDic';
|
||||
import { OperationEvent, DeviceMenu } from '@/scripts/ConstDic';
|
||||
import { DeviceMenu } from '@/scripts/ConstDic';
|
||||
import MenuContextHandler from '@/scripts/cmdPlugin/MenuContextHandler';
|
||||
import {mouseCancelState} from '@/jmapNew/theme/components/utils/menuItemStatus';
|
||||
// import {mouseCancelState} from '@/jmapNew/theme/components/utils/menuItemStatus';
|
||||
import SetFault from '@/jmapNew/theme/components/menus/dialog/setFault';
|
||||
import {menuOperate, commitOperate} from '@/jmapNew/theme/components/utils/menuOperate';
|
||||
export default {
|
||||
name: 'StationMenu',
|
||||
@ -27,6 +29,7 @@ export default {
|
||||
PopMenu,
|
||||
StationCmdControl,
|
||||
StationHumanControlAll,
|
||||
SetFault,
|
||||
StationSetRouteControlAll,
|
||||
NoticeInfo
|
||||
},
|
||||
@ -85,12 +88,12 @@ export default {
|
||||
menuForce: [
|
||||
{
|
||||
label: '设置ZC故障',
|
||||
handler: this.undeveloped,
|
||||
handler: this.setStoppage,
|
||||
cmdType: CMD.Station.CMD_STATION_ADD_FAULT
|
||||
},
|
||||
{
|
||||
label: '取消ZC故障',
|
||||
handler: this.undeveloped,
|
||||
handler: this.cancelStoppage,
|
||||
cmdType: CMD.Station.CMD_STATION_REMOVE_FAULT
|
||||
}
|
||||
]
|
||||
@ -142,42 +145,18 @@ export default {
|
||||
},
|
||||
// 设置故障
|
||||
setStoppage() {
|
||||
const operate = {
|
||||
start: true,
|
||||
send: true,
|
||||
code: this.selected.code,
|
||||
operation: OperationEvent.Station.stoppage.menu.operation
|
||||
};
|
||||
|
||||
mouseCancelState(this.selected);
|
||||
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
|
||||
commitOperate(menuOperate.Common.setFault, { code: this.selected.zcCode }, 0).then(({valid, operate})=>{
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
} else {
|
||||
this.$refs.noticeInfo.doShow();
|
||||
this.$refs.setFault.doShow(menuOperate.Common.setFault, this.selected);
|
||||
}
|
||||
}).catch(() => {
|
||||
this.$refs.noticeInfo.doShow();
|
||||
});
|
||||
},
|
||||
// 取消故障
|
||||
cancelStoppage() {
|
||||
const operate = {
|
||||
start: true,
|
||||
send: true,
|
||||
code: this.selected.code,
|
||||
operation: OperationEvent.Station.cancelStoppage.menu.operation
|
||||
};
|
||||
|
||||
mouseCancelState(this.selected);
|
||||
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
|
||||
commitOperate(menuOperate.Common.cancelFault, { code: this.selected.zcCode }, 0).then(({valid, operate})=>{
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
} else {
|
||||
this.$refs.noticeInfo.doShow();
|
||||
this.$refs.setFault.doShow(menuOperate.Common.cancelFault, this.selected);
|
||||
}
|
||||
}).catch(() => {
|
||||
this.$refs.noticeInfo.doShow();
|
||||
});
|
||||
},
|
||||
// 全站设置联锁自动触发
|
||||
|
@ -4,6 +4,7 @@ class Model {
|
||||
constructor() {
|
||||
this.screenLine = 3;
|
||||
this.screenSplit = ['5165', '10303'];
|
||||
this.screenDifference = 180;
|
||||
// 公共字段部分默认初始值
|
||||
this['public'] = {};
|
||||
this['public'][deviceType.Signal] = {
|
||||
|
@ -5,6 +5,7 @@
|
||||
<station-human-control-all ref="stationHumanControlAll" pop-class="xian-01__systerm" />
|
||||
<station-set-route-control-all ref="stationSetRouteControlAll" pop-class="xian-01__systerm" />
|
||||
<notice-info ref="noticeInfo" pop-class="xian-01__systerm" />
|
||||
<set-fault ref="setFault" pop-class="xian-01__systerm" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@ -17,7 +18,7 @@ import NoticeInfo from '@/jmapNew/theme/components/menus/childDialog/noticeInfo'
|
||||
import { mapGetters } from 'vuex';
|
||||
import { OperateMode } from '@/scripts/ConstDic';
|
||||
import { DeviceMenu } from '@/scripts/ConstDic';
|
||||
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
|
||||
import SetFault from '@/jmapNew/theme/components/menus/dialog/setFault';
|
||||
import MenuContextHandler from '@/scripts/cmdPlugin/MenuContextHandler';
|
||||
import CMD from '@/scripts/cmdPlugin/CommandEnum';
|
||||
import {menuOperate, commitOperate} from '@/jmapNew/theme/components/utils/menuOperate';
|
||||
@ -28,6 +29,7 @@ export default {
|
||||
PopMenu,
|
||||
StationCmdControl,
|
||||
StationHumanControlAll,
|
||||
SetFault,
|
||||
StationSetRouteControlAll,
|
||||
NoticeInfo
|
||||
},
|
||||
@ -95,13 +97,13 @@ export default {
|
||||
},
|
||||
menuForce: [
|
||||
{
|
||||
label: '设置故障',
|
||||
handler: this.undeveloped,
|
||||
label: '设置ZC故障',
|
||||
handler: this.setStoppage,
|
||||
cmdType: CMD.Station.CMD_STATION_ADD_FAULT
|
||||
},
|
||||
{
|
||||
label: '取消故障',
|
||||
handler: this.undeveloped,
|
||||
label: '取消ZC故障',
|
||||
handler: this.cancelStoppage,
|
||||
cmdType: CMD.Station.CMD_STATION_REMOVE_FAULT
|
||||
}
|
||||
]
|
||||
@ -157,40 +159,18 @@ export default {
|
||||
},
|
||||
// 设置故障
|
||||
setStoppage() {
|
||||
const operate = {
|
||||
start: true,
|
||||
send: true,
|
||||
code: this.selected.code,
|
||||
operation: OperationEvent.Station.stoppage.menu.operation
|
||||
};
|
||||
|
||||
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
|
||||
commitOperate(menuOperate.Common.setFault, { code: this.selected.zcCode }, 0).then(({valid, operate})=>{
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
} else {
|
||||
this.$refs.noticeInfo.doShow();
|
||||
this.$refs.setFault.doShow(menuOperate.Common.setFault, this.selected);
|
||||
}
|
||||
}).catch(() => {
|
||||
this.$refs.noticeInfo.doShow();
|
||||
});
|
||||
},
|
||||
// 取消故障
|
||||
cancelStoppage() {
|
||||
const operate = {
|
||||
start: true,
|
||||
send: true,
|
||||
code: this.selected.code,
|
||||
operation: OperationEvent.Station.cancelStoppage.menu.operation
|
||||
};
|
||||
|
||||
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
|
||||
commitOperate(menuOperate.Common.cancelFault, { code: this.selected.zcCode }, 0).then(({valid, operate})=>{
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
} else {
|
||||
this.$refs.noticeInfo.doShow();
|
||||
this.$refs.setFault.doShow(menuOperate.Common.cancelFault, this.selected);
|
||||
}
|
||||
}).catch(() => {
|
||||
this.$refs.noticeInfo.doShow();
|
||||
});
|
||||
},
|
||||
// 全站设置联锁自动触发
|
||||
|
@ -3,6 +3,7 @@
|
||||
<pop-menu ref="popMenu" :menu="menu" pop-class="xian-02__pop_tip_station" :tip-msg="topTip" :tip-subhead="tipSubhead" />
|
||||
<station-cmd-control ref="stationCmdControl" />
|
||||
<notice-info ref="noticeInfo" pop-class="xian-02__systerm" />
|
||||
<set-fault ref="setFault" pop-class="xian-02__system" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@ -11,9 +12,10 @@ import PopMenu from '@/components/PopMenu/index';
|
||||
import StationCmdControl from './dialog/stationCmdControl';
|
||||
import NoticeInfo from '@/jmapNew/theme/components/menus/childDialog/noticeInfo';
|
||||
import { mapGetters } from 'vuex';
|
||||
|
||||
import {menuOperate, commitOperate} from '@/jmapNew/theme/components/utils/menuOperate';
|
||||
import CMD from '@/scripts/cmdPlugin/CommandEnum';
|
||||
// import MenuContextHandler from '@/scripts/cmdPlugin/MenuContextHandler';
|
||||
import SetFault from '@/jmapNew/theme/components/menus/dialog/setFault';
|
||||
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
|
||||
import { DeviceMenu, OperateMode } from '@/scripts/ConstDic';
|
||||
|
||||
@ -22,6 +24,7 @@ export default {
|
||||
components: {
|
||||
PopMenu,
|
||||
StationCmdControl,
|
||||
SetFault,
|
||||
NoticeInfo
|
||||
},
|
||||
props: {
|
||||
@ -142,12 +145,12 @@ export default {
|
||||
},
|
||||
menuForce: [
|
||||
{
|
||||
label: '设置故障',
|
||||
handler: this.undeveloped
|
||||
label: '设置ZC故障',
|
||||
handler: this.setStoppage
|
||||
},
|
||||
{
|
||||
label: '取消故障',
|
||||
handler: this.undeveloped
|
||||
label: '取消ZC故障',
|
||||
handler: this.cancelStoppage
|
||||
}
|
||||
]
|
||||
};
|
||||
@ -198,39 +201,18 @@ export default {
|
||||
},
|
||||
// 设置故障
|
||||
setStoppage() {
|
||||
const operate = {
|
||||
start: true,
|
||||
send: true,
|
||||
code: this.selected.code,
|
||||
operation: OperationEvent.Station.stoppage.menu.operation
|
||||
};
|
||||
|
||||
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
|
||||
commitOperate(menuOperate.Common.setFault, { code: this.selected.zcCode }, 0).then(({valid, operate})=>{
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
} else {
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
this.$refs.setFault.doShow(menuOperate.Common.setFault, this.selected);
|
||||
}
|
||||
}).catch(() => {
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
});
|
||||
},
|
||||
// 取消故障
|
||||
cancelStoppage() {
|
||||
const operate = {
|
||||
start: true,
|
||||
send: true,
|
||||
code: this.selected.code,
|
||||
operation: OperationEvent.Station.cancelStoppage.menu.operation
|
||||
};
|
||||
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
|
||||
commitOperate(menuOperate.Common.cancelFault, { code: this.selected.zcCode }, 0).then(({valid, operate})=>{
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
} else {
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
this.$refs.setFault.doShow(menuOperate.Common.cancelFault, this.selected);
|
||||
}
|
||||
}).catch(() => {
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
});
|
||||
},
|
||||
// 所有进路自排关
|
||||
|
@ -1,6 +1,5 @@
|
||||
|
||||
import {createTransform, createBoundingRect} from './utils/parser';
|
||||
|
||||
import {createTransform1, createBoundingRect} from './utils/parser';
|
||||
class TransformHandle {
|
||||
constructor(painter) {
|
||||
this.$painter = painter;
|
||||
@ -9,7 +8,13 @@ class TransformHandle {
|
||||
|
||||
this.rect = { x: 0, y: 0, width: 0, height: 0 };
|
||||
this.rectList = [];
|
||||
this.transform = [createTransform({ scaleRate: 1, offsetX: 0, offsetY: 0 })];
|
||||
this.transformInit = [];
|
||||
this.transform = [createTransform1({ scaleRateX: 1, scaleRateY: 1, offsetX: 0, offsetY: 0 })];
|
||||
}
|
||||
|
||||
revisibleView(view) {
|
||||
view.show();
|
||||
view.dirty();
|
||||
}
|
||||
|
||||
checkVisible(view, rect) {
|
||||
@ -31,6 +36,7 @@ class TransformHandle {
|
||||
const rect = this.rectList[i];
|
||||
if (this.checkVisible(view, rect)) {
|
||||
view.transform = this.transform[i];
|
||||
view.transformIndex = i;
|
||||
view.decomposeTransform(); // 修改 transform 后同步位置
|
||||
if (view.screenShow) {
|
||||
view.screenShow();
|
||||
@ -44,6 +50,24 @@ class TransformHandle {
|
||||
}
|
||||
}
|
||||
|
||||
// 视图进行缩放/平移
|
||||
transformView1(view) {
|
||||
if (view) {
|
||||
view.transform = this.transform[view.transformIndex];
|
||||
view.decomposeTransform();
|
||||
if (view.screenShow) {
|
||||
view.screenShow();
|
||||
} else {
|
||||
view.show();
|
||||
}
|
||||
view.dirty();
|
||||
}
|
||||
}
|
||||
// 处理所有视图缩放/平移
|
||||
transformAll1() {
|
||||
this.traverse(this.transformView1, this);
|
||||
}
|
||||
|
||||
// 处理所有视图缩放/平移
|
||||
transformAll() {
|
||||
this.traverse(this.transformView, this);
|
||||
@ -59,10 +83,26 @@ class TransformHandle {
|
||||
this.rectList = rectList;
|
||||
this.transform = [];
|
||||
list.forEach(item => {
|
||||
this.transform.push(createTransform(item));
|
||||
this.transform.push(createTransform1(item));
|
||||
});
|
||||
this.transformInit = JSON.parse(JSON.stringify(this.transform));
|
||||
this.transformAll();
|
||||
}
|
||||
updataOffset(opt) {
|
||||
this.transform.forEach(item => {
|
||||
item[4] = item[4] + opt.dx;
|
||||
item[5] = item[5] + opt.dy;
|
||||
});
|
||||
this.transformAll1();
|
||||
}
|
||||
updataOffsetNum(opts) {
|
||||
this.transform = JSON.parse(JSON.stringify(this.transformInit));
|
||||
this.transform.forEach(item => {
|
||||
item[4] = item[4] - opts.dx;
|
||||
item[5] = item[5] - opts.dy;
|
||||
});
|
||||
this.transformAll1();
|
||||
}
|
||||
|
||||
// 更新画布尺寸
|
||||
updateZrSize(opts) {
|
||||
|
@ -12,6 +12,13 @@ export function createTransform(opts) {
|
||||
return transform;
|
||||
}
|
||||
|
||||
export function createTransform1(opts) {
|
||||
let transform = matrix.create();
|
||||
transform = matrix.scale(matrix.create(), transform, [opts.scaleRateX, opts.scaleRateY]);
|
||||
transform = matrix.translate(matrix.create(), transform, [-opts.offsetX, -opts.offsetY]);
|
||||
return transform;
|
||||
}
|
||||
|
||||
export function createBoundingRect(view) {
|
||||
const rect = view.getBoundingRect().clone();
|
||||
const scale = view.scale[0];
|
||||
|
@ -30,7 +30,7 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import DeomonList from '@/views/demonstration/deomonList/index_APP_TARGET';
|
||||
import DeomonList from '@/views/demonstration/deomonList/index';
|
||||
import Qcode from './Qcode';
|
||||
import { getSessionStorage } from '@/utils/auth';
|
||||
import LangStorage from '@/utils/lang';
|
||||
|
@ -1,7 +1,6 @@
|
||||
<template>
|
||||
<el-dialog v-dialogDrag :title="$t('global.chooseRoom')" :visible.sync="dialogShow" width="30%" center>
|
||||
<el-input v-model="input" :placeholder="$t('global.inputRoomNumber')" />
|
||||
<el-checkbox v-if="!isShow" v-model="isNewMap">是否新版地图房间</el-checkbox>
|
||||
<el-dialog v-dialogDrag title="选择仿真" :visible.sync="dialogShow" width="30%" center>
|
||||
<el-input v-model="input" placeholder="请输入仿真号" />
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="dialogShow = false">{{ $t('global.cancel') }}</el-button>
|
||||
<el-button v-loading="loading" :disabled="!input.length" type="primary" @click="comit">{{ $t('global.confirm') }}</el-button>
|
||||
@ -10,8 +9,7 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { getPermissionJoint } from '@/api/chat';
|
||||
import { getPermissionJointNew } from '@/api/jointTraining';
|
||||
import { jointSimulationByPermission } from '@/api/jointSimulation';
|
||||
|
||||
export default {
|
||||
name: 'Dashboard',
|
||||
@ -19,8 +17,7 @@ export default {
|
||||
return {
|
||||
input: '',
|
||||
dialogShow: false,
|
||||
loading: false,
|
||||
isNewMap: false
|
||||
loading: false
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
@ -38,11 +35,7 @@ export default {
|
||||
async comit() {
|
||||
try {
|
||||
this.loading = true;
|
||||
if (this.isNewMap || this.isShow) {
|
||||
await getPermissionJointNew(`${this.input}`);
|
||||
} else {
|
||||
await getPermissionJoint(`${this.input}`);
|
||||
}
|
||||
await jointSimulationByPermission(`${this.input}`);
|
||||
this.dialogShow = false;
|
||||
} catch (error) {
|
||||
const errorMessage = this.isShow ? this.$t('tip.failedToAddNewRoom') : this.$t('error.scanningError');
|
||||
|
@ -1,10 +1,8 @@
|
||||
|
||||
<template>
|
||||
<div class="avatar-container" style="margin-left:40px;">
|
||||
<img v-if="isHyd||isJyd" class="logo_hyd" :src="logoImg" @click="goToMain">
|
||||
<img v-else-if="isTky" style="position: absolute;width: 120px;" :src="logoImg" @click="goToMain">
|
||||
<img v-else class="logo" :src="logoImg" @click="goToMain">
|
||||
<div class="titleInner" :style="marginLeft" @click="goToMain">{{ systemTitle }}</div>
|
||||
<img class="logo" :src="logoImg" :style="{width: navigationLogoWidth}" @click="goToMain">
|
||||
<div class="titleInner" :style="{marginLeft: navigationMarginLeft}" @click="goToMain">{{ systemTitle }}</div>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
@ -16,26 +14,16 @@ export default {
|
||||
return {
|
||||
logoImg: '',
|
||||
systemTitle: '',
|
||||
isHyd: false,
|
||||
isJyd: false,
|
||||
isTky: false,
|
||||
marginLeft: 'margin-left:60px;'
|
||||
navigationLogoWidth: '',
|
||||
navigationMarginLeft: ''
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
const project = getSessionStorage('project');
|
||||
this.systemTitle = loginInfo[project].homeTitle || loginInfo[project].title;
|
||||
this.logoImg = ProjectIcon[project];
|
||||
if (project.endsWith('hyd')) {
|
||||
this.isHyd = true;
|
||||
this.marginLeft = 'margin-left:140px;';
|
||||
} else if (project.endsWith('jyd')) {
|
||||
this.isJyd = true;
|
||||
this.marginLeft = 'margin-left:140px;';
|
||||
} else if (project.endsWith('tky')) {
|
||||
this.isTky = true;
|
||||
this.marginLeft = 'margin-left:140px;';
|
||||
}
|
||||
this.navigationLogoWidth = loginInfo[project].navigationLogoWidth;
|
||||
this.navigationMarginLeft = loginInfo[project].navigationMarginLeft;
|
||||
},
|
||||
methods: {
|
||||
goToMain() {
|
||||
|
@ -50,6 +50,11 @@ function getRouteInfo(to) {
|
||||
} else {
|
||||
const whitePage = PermissionParam[current_session] ? PermissionParam[current_session].whitePage : '';
|
||||
loginPath = whitePage || loginPage;
|
||||
if (to.query.projectDevice && to.query.type) {
|
||||
loginPath = `${loginPath}&projectDevice=${to.query.projectDevice}&type=${to.query.type}`;
|
||||
} else if (to.query.projectDevice) {
|
||||
loginPath = `${loginPath}&projectDevice=${to.query.projectDevice}`;
|
||||
}
|
||||
if (current_session && current_session.startsWith('jsxt') || current_session && current_session.startsWith('refereeJsxt')) {
|
||||
const raceId = getSessionStorage('raceId'); // 登陆时候保存 竞赛id
|
||||
loginPath = `${loginPath}?raceId=${raceId}`;
|
||||
@ -62,7 +67,7 @@ function getRouteInfo(to) {
|
||||
return { loginPath };
|
||||
}
|
||||
|
||||
function handleRoute(to, from, next, routeInfo) {
|
||||
function handleRoute(to, next, routeInfo) {
|
||||
if (store.getters.roles.length === 0) {
|
||||
store.dispatch('GetInfo', getToken()).then(res => {
|
||||
// 根据roles权限生成可访问的路由表
|
||||
@ -109,7 +114,7 @@ router.beforeEach((to, from, next) => {
|
||||
next();
|
||||
} else {
|
||||
// 进入系统重新计算路由
|
||||
handleRoute(to, from, next, routeInfo);
|
||||
handleRoute(to, next, routeInfo);
|
||||
}
|
||||
} else {
|
||||
if (whiteList.indexOf(to.path) !== -1) {
|
||||
|
@ -89,6 +89,7 @@ const DesignPlatform = () => import('@/views/designPlatform/index');
|
||||
const MapPreview = () => import('@/views/designPlatform/mapPreview');
|
||||
const MapPreviewNew = () => import('@/views/designPlatform/mapPreviewNew');
|
||||
const BigScreen = () => import('@/views/designPlatform/bigScreen');
|
||||
const BigSplitScreen = () => import('@/views/designPlatform/bigSplitScreen');
|
||||
|
||||
// const DesignPlatformUser = () => import('@/views/designUser/index');
|
||||
|
||||
@ -302,6 +303,11 @@ export const publicAsyncRoute = [
|
||||
component: BigScreen,
|
||||
hidden: true
|
||||
},
|
||||
{ // 大屏切分
|
||||
path: '/bigSplitScreen/:mapId',
|
||||
component: BigSplitScreen,
|
||||
hidden: true
|
||||
},
|
||||
{ // 综合演练室
|
||||
path: '/trainroom',
|
||||
component: TrainRoom,
|
||||
|
@ -6,7 +6,8 @@ Vue.use(VueRouter);
|
||||
|
||||
/* Layout */
|
||||
const Layout = () => import('@/layout');
|
||||
const Login = () => import('@/views/login/hydLogin');
|
||||
// const Login = () => import('@/views/login/hydLogin');
|
||||
const Login = () => import('@/views/login/index');
|
||||
|
||||
const Jlmap3dedit = () => import('@/views/jlmap3d/edit/jlmap3dedit');
|
||||
const Jlmap3d = () => import('@/views/jlmap3d/drive/jl3ddrive');
|
||||
|
@ -212,6 +212,22 @@ export default {
|
||||
'500006': { type: '权限错误:', message: '您已经领取,不能重复领取!'},
|
||||
'500007': { type: '权限错误:', message: '剩余分发权限数量不足!'},
|
||||
'500010': { type: '支付错误:', message: '微信统一支付调用失败!'}
|
||||
}
|
||||
},
|
||||
projectDeviceTypeList:[
|
||||
{label: '道岔', value: 'SWITCH'},
|
||||
{label: '信号机', value:'SIGNAL'},
|
||||
{label: '屏蔽门', value: 'PSD'},
|
||||
{label: 'IBP盘', value: 'IBP'},
|
||||
{label: '车站', value: 'LW'},
|
||||
{label: '教员机', value: 'IM'},
|
||||
{label: '行调工作站', value: 'CW'},
|
||||
{label: '大屏工作站', value: 'LSW'},
|
||||
{label: '列车驾驶终端', value: 'DRIVE'},
|
||||
{label: '虚拟站台屏蔽门终端', value: 'VR_PSD'},
|
||||
{label: '现地综合监控', value: 'ISCS_LW'},
|
||||
{label: '中心综合监控', value: 'ISCS_CW'},
|
||||
{label: '车辆段终端', value: 'DEPOT'},
|
||||
{label: '虚拟CCTV', value: 'CCTV'}
|
||||
]
|
||||
}
|
||||
};
|
||||
|
@ -10,79 +10,121 @@ import Link_Jyd from '@/assets/icon/link_jyd.png';
|
||||
import FaviconTky from '@/assets/icon/favicon_tky.png';
|
||||
import { LoginParams } from '@/utils/login';
|
||||
|
||||
export const loginInfo = { // 页面title & 退出登录跳转路径
|
||||
// title:页面title; loginPath:退出登录跳转路径; loginParam:登录接口参数project;loginTitle:登录页左上角title;logoWidth:登录页左上角logo宽度;
|
||||
// homeTitle:导航栏title(没有采用title); browserTitle:浏览器窗口title;bottomColumn:底部栏描述;bottomIcon:底部栏Icon;linkIcon:浏览器窗口icon(没有采用ProjectIcon)
|
||||
export const loginInfo = {
|
||||
xty: {
|
||||
title: '西安铁路职业技术学院城市轨道交通实训平台',
|
||||
loginPath: '/xty/login',
|
||||
loginParam: 'XTY'
|
||||
// loginPath: '/xty/login',
|
||||
loginPath:'/login?pro=xty',
|
||||
loginParam: 'XTY',
|
||||
navigationLogoWidth: '40px',
|
||||
navigationMarginLeft: '60px'
|
||||
},
|
||||
login: {
|
||||
title: LangStorage.getLang() == 'en' ? ' Urban Rail Transit Practical Training Platform' : '城市轨道交通实训平台',
|
||||
loginPath: '/login',
|
||||
loginParam: 'DEFAULT'
|
||||
loginParam: 'DEFAULT',
|
||||
navigationLogoWidth: '40px',
|
||||
navigationMarginLeft: '60px'
|
||||
},
|
||||
design: {
|
||||
title: LangStorage.getLang() == 'en' ? ' Urban Rail Transit Design Platform' : '城市轨道交通设计平台',
|
||||
loginPath: '/design/login',
|
||||
loginParam: 'DEFAULT'
|
||||
loginParam: 'DEFAULT',
|
||||
navigationLogoWidth: '40px',
|
||||
navigationMarginLeft: '60px'
|
||||
},
|
||||
designxty: {
|
||||
title: '西安铁路职业技术学院城市轨道交通设计平台',
|
||||
loginPath: '/designxty/login',
|
||||
loginParam: 'XTY'
|
||||
// loginPath: '/designxty/login',
|
||||
loginPath:'/design/login?project=xty',
|
||||
loginParam: 'XTY',
|
||||
navigationLogoWidth: '40px',
|
||||
navigationMarginLeft: '60px'
|
||||
},
|
||||
gzb: {
|
||||
title: '贵州装备制造职业学院城市轨道交通实训平台',
|
||||
loginPath: '/gzb/login',
|
||||
loginParam: 'GZB'
|
||||
// loginPath: '/gzb/login',
|
||||
loginPath:'/login?project=gzb',
|
||||
loginParam: 'GZB',
|
||||
navigationLogoWidth: '40px',
|
||||
navigationMarginLeft: '60px'
|
||||
},
|
||||
designgzb: {
|
||||
title: '贵州装备制造职业学院城市轨道交通设计平台',
|
||||
loginPath: '/designgzb/login',
|
||||
loginParam: 'GZB'
|
||||
// loginPath: '/designgzb/login',
|
||||
loginPath:'/design/login?project=gzb',
|
||||
loginParam: 'GZB',
|
||||
navigationLogoWidth: '40px',
|
||||
navigationMarginLeft: '60px'
|
||||
},
|
||||
hyd: {
|
||||
title: '城市轨道交通综合行车模拟仿真系统V1.0',
|
||||
loginPath: '/login',
|
||||
loginTitle: '城市轨道交通综合行车模拟仿真系统V1.0',
|
||||
logoWidth: '140px',
|
||||
loginPath: '/login?project=hyd',
|
||||
bottomColumn: '哈尔滨盈达科技有限公司 联系电话:0451-87001273',
|
||||
loginParam: 'DEFAULT'
|
||||
loginParam: 'DEFAULT',
|
||||
navigationLogoWidth: '120px',
|
||||
navigationMarginLeft: '140px'
|
||||
},
|
||||
designhyd: {
|
||||
title: '城市轨道交通设计平台V1.0',
|
||||
loginPath: '/design/login',
|
||||
loginTitle: '城市轨道交通设计平台V1.0',
|
||||
logoWidth: '140px',
|
||||
loginPath: '/design/login?project=hyd',
|
||||
bottomColumn: '哈尔滨盈达科技有限公司 联系电话:0451-87001273',
|
||||
loginParam: 'DEFAULT'
|
||||
loginParam: 'DEFAULT',
|
||||
navigationLogoWidth: '120px',
|
||||
navigationMarginLeft: '140px'
|
||||
},
|
||||
xadt: {
|
||||
title: '城市轨道交通实训平台',
|
||||
logoWidth: '60px',
|
||||
loginTitle: '调度一部',
|
||||
homeTitle: '调度一部',
|
||||
browserTitle: '西安地铁调度一部城市轨道交通实训平台',
|
||||
loginPath: '/xadt/login',
|
||||
loginParam: 'DEFAULT'
|
||||
loginPath:'/login?project=xadt',
|
||||
// loginPath: '/xadt/login',
|
||||
loginParam: 'DEFAULT',
|
||||
navigationLogoWidth: '40px',
|
||||
navigationMarginLeft: '60px'
|
||||
},
|
||||
designxadt: {
|
||||
title: '城市轨道交通设计平台',
|
||||
logoWidth: '60px',
|
||||
loginTitle: '调度一部',
|
||||
homeTitle: '调度一部',
|
||||
browserTitle: '西安地铁调度一部城市轨道交通设计平台',
|
||||
loginPath: '/designxadt/login',
|
||||
loginParam: 'DEFAULT'
|
||||
// loginPath: '/designxadt/login',
|
||||
loginPath:'/design/login?project=xadt',
|
||||
loginParam: 'DEFAULT',
|
||||
navigationLogoWidth: '40px',
|
||||
navigationMarginLeft: '60px'
|
||||
},
|
||||
jsxt:{
|
||||
title: '城市轨道交通竞赛平台',
|
||||
loginPath: '/jsxt/login',
|
||||
loginParam: 'DEFAULT'
|
||||
loginParam: 'DEFAULT',
|
||||
navigationLogoWidth: '40px',
|
||||
navigationMarginLeft: '60px'
|
||||
},
|
||||
refereeJsxt:{
|
||||
title: '城市轨道交通裁判平台',
|
||||
loginPath: '/refereeJsxt/login',
|
||||
loginParam: 'DEFAULT'
|
||||
loginParam: 'DEFAULT',
|
||||
navigationLogoWidth: '40px',
|
||||
navigationMarginLeft: '60px'
|
||||
},
|
||||
jyd: {
|
||||
title: '城市轨道交通实训平台',
|
||||
loginPath: '/jyd/login',
|
||||
loginTitle: 'jyd',
|
||||
// loginPath: '/jyd/login',
|
||||
loginPath:'/login?project=jyd',
|
||||
logoWidth: '300px',
|
||||
navigationLogoWidth: '120px',
|
||||
navigationMarginLeft: '140px',
|
||||
loginTitle: '空串',
|
||||
bottomColumn: '',
|
||||
bottomIcon: Bottom_Jyd,
|
||||
linkIcon: Link_Jyd,
|
||||
@ -90,8 +132,12 @@ export const loginInfo = { // 页面title & 退出登录跳转路径
|
||||
},
|
||||
designjyd: {
|
||||
title: '城市轨道交通设计平台',
|
||||
loginTitle: 'jyd',
|
||||
loginPath: '/designjyd/login',
|
||||
loginTitle: '空串',
|
||||
logoWidth: '300px',
|
||||
navigationLogoWidth: '120px',
|
||||
navigationMarginLeft: '140px',
|
||||
// loginPath: '/designjyd/login',
|
||||
loginPath:'/design/login?project=jyd',
|
||||
bottomColumn: '',
|
||||
bottomIcon: Bottom_Jyd,
|
||||
linkIcon: Link_Jyd,
|
||||
@ -99,19 +145,25 @@ export const loginInfo = { // 页面title & 退出登录跳转路径
|
||||
},
|
||||
tky: {
|
||||
title: '城市轨道交通实训平台',
|
||||
loginPath: '/tky/login',
|
||||
loginTitle: 'jyd',
|
||||
// loginPath: '/tky/login',
|
||||
loginPath:'/login?project=tky',
|
||||
loginTitle: '空串',
|
||||
bottomColumn: '',
|
||||
bottomIcon: FaviconTky,
|
||||
loginParam: 'DEFAULT'
|
||||
loginParam: 'DEFAULT',
|
||||
navigationLogoWidth: '75px',
|
||||
navigationMarginLeft: '90px'
|
||||
},
|
||||
designtky: {
|
||||
title: '城市轨道交通设计平台',
|
||||
loginPath: '/designtky/login',
|
||||
loginTitle: 'jyd',
|
||||
// loginPath: '/designtky/login',
|
||||
loginPath:'/design/login?project=tky',
|
||||
loginTitle: '空串',
|
||||
bottomIcon: FaviconTky,
|
||||
bottomColumn: '',
|
||||
loginParam: 'DEFAULT'
|
||||
loginParam: 'DEFAULT',
|
||||
navigationLogoWidth: '75px',
|
||||
navigationMarginLeft: '90px'
|
||||
}
|
||||
};
|
||||
|
||||
@ -153,29 +205,37 @@ export const GetMapListByProjectList = ['xty', 'designxty', 'gzb', 'designgzb',
|
||||
export const CaseHideProjectList = ['hyd', 'designhyd']; // 案例展示隐藏的项目
|
||||
export const VersionBaseNoShow = ['hyd', 'designhyd']; // 登录页右下角版本开发基于不展示
|
||||
export const MainBodyNoShow = ['hyd', 'designhyd', 'jyd', 'designjyd', 'tky', 'designtky']; // 登录页右下角主体不展示
|
||||
export const GenerateRouteProjectList = ['xty', 'designxty', 'gzb', 'designgzb', 'xadt', 'designxadt', 'jsxt', 'refereeJsxt', 'jyd', 'designjyd', 'tky', 'designtky'];// 需要在公共路由中生成登录页面的项目&登录页样式
|
||||
export const GenerateRouteProjectList = ['jsxt', 'refereeJsxt', 'gzb', 'designgzb', 'xty', 'designxty'];// 需要在公共路由中生成登录页面的项目&登录页样式
|
||||
export const goOtherPlatformMenu = { // 导航栏快速切换平台
|
||||
login: '/design/login',
|
||||
design: '/login',
|
||||
xty: '/designxty/login',
|
||||
designxty: '/xty/login',
|
||||
gzb: '/designgzb/login',
|
||||
designgzb: '/gzb/login',
|
||||
hyd: '/design/login',
|
||||
designhyd: '/login',
|
||||
xadt: '/designxadt/login',
|
||||
designxadt: '/xadt/login',
|
||||
jyd: '/designjyd/login',
|
||||
designjyd: '/jyd/login',
|
||||
tky: '/designtky/login',
|
||||
designtky: '/tky/login'
|
||||
xty: '/design/login?project=xty',
|
||||
designxty: '/login?project=xty',
|
||||
gzb: '/design/login?project=gzb',
|
||||
designgzb: '/login?project=gzb',
|
||||
hyd: '/design/login?project=hyd',
|
||||
designhyd: '/login?project=hyd',
|
||||
xadt: '/design/login?project=xadt',
|
||||
designxadt: '/login?project=xadt',
|
||||
jyd: '/design/login?project=jyd',
|
||||
designjyd: '/login?project=jyd',
|
||||
tky: '/design/login?project=tky',
|
||||
designtky: '/login?project=tky'
|
||||
};
|
||||
export const PermissionParam = { // 路径权限处理所需参数配置(跳转白名单&路径正则匹配&clientId)
|
||||
hyd: {
|
||||
systemType: '011'
|
||||
// systemType: '011'
|
||||
whitePage: '/login?project=hyd',
|
||||
reg: /^\/hyd/,
|
||||
systemType: '011',
|
||||
clientId: null
|
||||
},
|
||||
designhyd: {
|
||||
systemType: '011'
|
||||
// systemType: '011'
|
||||
whitePage: '/design/login?project=hyd',
|
||||
reg: /^\/designhyd/,
|
||||
systemType: '011',
|
||||
clientId: LoginParams.Design.clientId
|
||||
},
|
||||
login: {
|
||||
systemType: '011'
|
||||
@ -184,61 +244,61 @@ export const PermissionParam = { // 路径权限处理所需参数配置(跳
|
||||
systemType: '011'
|
||||
},
|
||||
designxty: {
|
||||
whitePage: '/designxty/login',
|
||||
whitePage: '/design/login?project=xty',
|
||||
reg: /^\/designxty/,
|
||||
systemType: '013',
|
||||
clientId: LoginParams.Design.clientId
|
||||
},
|
||||
designgzb: {
|
||||
whitePage: '/designgzb/login',
|
||||
whitePage: '/design/login?project=gzb',
|
||||
reg: /^\/designgzb/,
|
||||
systemType: '014',
|
||||
clientId: LoginParams.Design.clientId
|
||||
},
|
||||
designxadt: {
|
||||
whitePage: '/designxadt/login',
|
||||
whitePage: '/design/login?project=xadt',
|
||||
reg: /^\/designxadt/,
|
||||
systemType: '012',
|
||||
clientId: LoginParams.Design.clientId
|
||||
},
|
||||
designjyd: {
|
||||
whitePage: '/designjyd/login',
|
||||
whitePage: '/design/login?project=jyd',
|
||||
reg: /^\/designjyd/,
|
||||
systemType: '017',
|
||||
clientId: LoginParams.Design.clientId
|
||||
},
|
||||
designtky: {
|
||||
whitePage: '/designtky/login',
|
||||
whitePage: '/design/login?project=tky',
|
||||
reg: /^\/designtky/,
|
||||
systemType: '018',
|
||||
clientId: LoginParams.Design.clientId
|
||||
},
|
||||
xty: {
|
||||
whitePage: '/xty/login',
|
||||
whitePage: '/login?project=xty',
|
||||
reg: /^\/xty/,
|
||||
systemType: '013',
|
||||
clientId: null
|
||||
},
|
||||
gzb: {
|
||||
whitePage: '/gzb/login',
|
||||
whitePage: '/login?project=gzb',
|
||||
reg: /^\/gzb/,
|
||||
systemType: '014',
|
||||
clientId: null
|
||||
},
|
||||
xadt: {
|
||||
whitePage: '/xadt/login',
|
||||
whitePage: '/login?project=xadt',
|
||||
reg: /^\/xadt/,
|
||||
systemType: '012',
|
||||
clientId: null
|
||||
},
|
||||
jyd: {
|
||||
whitePage: '/jyd/login',
|
||||
whitePage: '/login?project=jyd',
|
||||
reg: /^\/jyd/,
|
||||
systemType: '017',
|
||||
clientId: null
|
||||
},
|
||||
tky: {
|
||||
whitePage: '/tky/login',
|
||||
whitePage: '/login?project=tky',
|
||||
reg: /^\/tky/,
|
||||
systemType: '018',
|
||||
clientId: null
|
||||
|
@ -40,6 +40,9 @@ export const deviceFaultType = {
|
||||
],
|
||||
StationStand: [
|
||||
{label: '屏蔽门故障打开', value: 'FAULT_PSD_OPEN'}
|
||||
],
|
||||
ZcControl:[
|
||||
{label: 'zc故障', value: 'FAULT'}
|
||||
]
|
||||
};
|
||||
/** 设备类型 */
|
||||
@ -49,5 +52,6 @@ export const deviceType = {
|
||||
Switch: '道岔',
|
||||
Station: '车站',
|
||||
StationStand: '站台',
|
||||
Train: '列车'
|
||||
Train: '列车',
|
||||
ZcControl:'ZC'
|
||||
};
|
||||
|
@ -416,11 +416,11 @@ const map = {
|
||||
return [];
|
||||
}
|
||||
},
|
||||
bigScreenSplitConfig: (state) => {
|
||||
bigScreenConfig: (state) => {
|
||||
if (state.map) {
|
||||
return state.map.bigScreenSplitConfig || [];
|
||||
return state.map.bigScreenConfig || {};
|
||||
} else {
|
||||
return [];
|
||||
return {};
|
||||
}
|
||||
},
|
||||
indicatorLightList: (state) => {
|
||||
|
@ -23,7 +23,7 @@ function handle(state, data) {
|
||||
case 'Simulation_DeviceStatus': // 仿真-设备状态消息
|
||||
state.equipmentStatus = msg;
|
||||
break;
|
||||
case 'Simulation_User': // 仿真-聊天界面用户进出仿真消息
|
||||
case 'Simulation_User': // 仿真-进出仿真消息
|
||||
handleSimulationUserinfo(state, msg); // 用户进出仿真消息
|
||||
break;
|
||||
case 'Simulation_Script_Tip': // 仿真-聊天界面用户进出仿真消息
|
||||
@ -64,7 +64,7 @@ function handle(state, data) {
|
||||
}
|
||||
break;
|
||||
case 'Simulation_Error': // 仿真-异常消息
|
||||
state.simulationError = msg;
|
||||
state.simulationError += 1;
|
||||
break;
|
||||
case 'Simulation_RunAsPlan_Start': // 仿真-仿真开始按计划行车消息
|
||||
state.simulationStart = msg;
|
||||
@ -73,9 +73,8 @@ function handle(state, data) {
|
||||
state.simulationReset = 'reset';
|
||||
break;
|
||||
case 'Simulation_Conversation': // 仿真-用户交互消息(聊天/命令)
|
||||
{ handleSimulationInfo(state, msg);
|
||||
state.simuConversitionCount++;
|
||||
break; }
|
||||
handleSimulationInfo(state, msg);
|
||||
break;
|
||||
case 'Simulation_PlayBack_Conversation': // 回放-用户交互消息
|
||||
handleSimulationInfo(state, msg);
|
||||
break;
|
||||
@ -85,8 +84,8 @@ function handle(state, data) {
|
||||
case 'JointTraining_User_Permit': // 综合演练室-用户获取权限消息
|
||||
state.userPermit = msg;
|
||||
break;
|
||||
case 'JointTraining_Room_Invite': // 综合演练室-房间邀请消息
|
||||
state.roomInvite = msg;
|
||||
case 'Simulation_Invite': // 综合演练-仿真邀请消息
|
||||
state.simulationInvite = msg;
|
||||
break;
|
||||
case 'Big_Screen_Simulation_DeviceStatus': // 大屏仿真状态数据
|
||||
state.equipmentStatus = msg;
|
||||
@ -128,6 +127,9 @@ function handle(state, data) {
|
||||
duration: 0
|
||||
});
|
||||
break;
|
||||
case 'Simulation_Member':
|
||||
state.memberChangeCount++;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@ -158,28 +160,20 @@ function handleRecordList(state, data) {
|
||||
}
|
||||
// 仿真内部聊天
|
||||
function handleSimulationInfo(state, data) {
|
||||
const userId = store.state.user.id;
|
||||
let isSelf = false;
|
||||
if (data.member.userId == userId) {
|
||||
isSelf = true;
|
||||
switch (data.messageType) {
|
||||
case 'INVITE':
|
||||
state.inviteSimulationConversition = data;
|
||||
break;
|
||||
case 'CONNECT':
|
||||
state.acceptConversionInvite = data;
|
||||
break;
|
||||
case 'OVER':
|
||||
state.overConversition = data;
|
||||
break;
|
||||
case 'MESSAGE':
|
||||
state.conversationInfo = data;
|
||||
break;
|
||||
}
|
||||
const myDate = new Date();
|
||||
const myDate1 = myDate.toLocaleDateString().replace(/\//g, '-');
|
||||
const chatTime = /\d{2}:\d{2}:\d{2}/.exec(data.chatTime)[0] || data.chatTime;
|
||||
const params = {
|
||||
id:data.conversationId,
|
||||
self: isSelf,
|
||||
message: data.message,
|
||||
voice: data.isAudio,
|
||||
src: data.isAudio ? `/audio/${data.audioPath}` : '',
|
||||
member:data.member,
|
||||
memberOnline:data.member.online,
|
||||
chatTime: data.chatTime,
|
||||
targetUser:data.targetMember ? data.targetMember : 'All',
|
||||
all: data.all,
|
||||
date: +new Date(`${myDate1} ${chatTime}`)
|
||||
};
|
||||
state.simulationText = params;
|
||||
}
|
||||
|
||||
// 剧本提示
|
||||
@ -224,7 +218,7 @@ const socket = {
|
||||
jointRoomPrepare: false, // 演练房间准备状态
|
||||
equipmentStatus: [], // 仿真-设备状态消息
|
||||
trainStationList: [], // 仿真-列车实际到发车站消息
|
||||
simulationError: '', // 仿真-异常消息
|
||||
simulationError: 0, // 仿真-异常消息
|
||||
simulationStart: '', // 仿真-开始消息
|
||||
simulationOver:0, // 退出仿真推送消息
|
||||
simulationReset: '', // 仿真-异常消息
|
||||
@ -233,6 +227,10 @@ const socket = {
|
||||
acceptInviteChat:{}, // 综合演练仿真-聊天界面用户接受聊天邀请,
|
||||
quitCoversition:{}, // 综合演练仿真-聊天界面用户退出群聊推送消息,
|
||||
// coversitionList:{}, // 历史仿真-用户消息列表
|
||||
inviteSimulationConversition: {}, // 仿真会话邀请消息
|
||||
acceptConversionInvite:{}, // 仿真会话成员接收邀请
|
||||
overConversition: {}, // 仿真会话结束
|
||||
conversationInfo: {}, // 仿真会话消息
|
||||
|
||||
message: {}, // 仿真聊天
|
||||
msgQueue: [], // 命令请求列表
|
||||
@ -244,7 +242,7 @@ const socket = {
|
||||
userOutRoom: {}, // 用户退出房间消息
|
||||
userInSimulation: {}, // 用户进入仿真消息
|
||||
userBackRoom: {}, // 用户从仿真返回房间消息
|
||||
roomInvite: {}, // 用户扫码信息
|
||||
simulationInvite: {}, // 用户扫码信息
|
||||
|
||||
permissionOver: {}, // 权限结束
|
||||
|
||||
@ -255,7 +253,8 @@ const socket = {
|
||||
tipOperateCount: 0, // 任务结束提示消息
|
||||
realDeviceInfo: 0, // 真实设备信息
|
||||
beLogoutCount: 0, // 被登出
|
||||
runPlanReloadCount: 0 // 仿真运行图变更
|
||||
runPlanReloadCount: 0, // 仿真运行图变更
|
||||
memberChangeCount: 0 // 仿真成员变更
|
||||
},
|
||||
getters: {
|
||||
},
|
||||
@ -276,10 +275,6 @@ const socket = {
|
||||
state.trainStationList = trainStationList;
|
||||
},
|
||||
|
||||
setSimulationError: (state, simulationError) => {
|
||||
state.simulationError = simulationError;
|
||||
},
|
||||
|
||||
setSimulationStart: (state, simulationStart) => {
|
||||
state.simulationStart = simulationStart;
|
||||
},
|
||||
@ -288,10 +283,6 @@ const socket = {
|
||||
state.simulationReset = simulationReset;
|
||||
},
|
||||
|
||||
setSimulationTextList: (state, simulationText) => {
|
||||
state.simulationText = simulationText;
|
||||
},
|
||||
|
||||
setPayOrder: (state, payOrder) => {
|
||||
state.payOrder = payOrder;
|
||||
},
|
||||
@ -305,8 +296,8 @@ const socket = {
|
||||
handlePushMsgQueue(state, msg);
|
||||
},
|
||||
|
||||
setRoomInvite: (state, roomInvite) => {
|
||||
state.roomInvite = roomInvite;
|
||||
setSimulationInvite: (state, simulationInvite) => {
|
||||
state.simulationInvite = simulationInvite;
|
||||
},
|
||||
setRoomSubscribe:(state, roomIsSubscribe)=>{
|
||||
state.roomIsSubscribe = roomIsSubscribe;
|
||||
@ -340,10 +331,6 @@ const socket = {
|
||||
commit('setTrainStationList', []);
|
||||
},
|
||||
|
||||
setSimulationError: ({ commit }) => {
|
||||
commit('setSimulationError', '');
|
||||
},
|
||||
|
||||
setSimulationStart: ({ commit }) => {
|
||||
commit('setSimulationStart', '');
|
||||
},
|
||||
@ -352,12 +339,8 @@ const socket = {
|
||||
commit('setSimulationReset', '');
|
||||
},
|
||||
|
||||
setSimulationTextList: ({ commit }) => {
|
||||
commit('setSimulationTextList', {});
|
||||
},
|
||||
|
||||
setRoomInvite: ({ commit }) => {
|
||||
commit('setRoomInvite', {});
|
||||
setSimulationInvite: ({ commit }) => {
|
||||
commit('setSimulationInvite', {});
|
||||
},
|
||||
|
||||
setMessage: ({ state }, data) => {
|
||||
|
@ -4,6 +4,7 @@ import OperateHandler from '@/scripts/plugin/OperateHandler';
|
||||
import deviceType from '../../jmap/constant/deviceType';
|
||||
import LangStorage from '@/utils/lang';
|
||||
import Handler from '@/scripts/cmdPlugin/Handler';
|
||||
import { deepAssign } from '@/utils/index';
|
||||
|
||||
/**
|
||||
* 实训状态数据
|
||||
@ -34,7 +35,10 @@ const training = {
|
||||
prdType: '', // 产品类型
|
||||
roles: '', // 角色权限类型
|
||||
group: '', // 设置全局 group
|
||||
centerStationCode:'' // 当前居中的集中站code
|
||||
centerStationCode:'', // 当前居中的集中站code
|
||||
memberList: [], // 综合仿真成员列表
|
||||
memberData: {}, // 综合仿真成员列表
|
||||
simulationUserList: [] // 综合仿真用户列表
|
||||
},
|
||||
|
||||
getters: {
|
||||
@ -77,6 +81,12 @@ const training = {
|
||||
roles: (state) => {
|
||||
return state.roles;
|
||||
},
|
||||
memberList: (state) => {
|
||||
return state.memberList;
|
||||
},
|
||||
simulationUserList: (state) => {
|
||||
return state.simulationUserList;
|
||||
},
|
||||
// 视图中的列车列表
|
||||
viewTrainList: (state) => () =>{
|
||||
const trainList = [];
|
||||
@ -107,6 +117,8 @@ const training = {
|
||||
},
|
||||
over: (state) => {
|
||||
state.started = false;
|
||||
state.memberList = [];
|
||||
state.simulationUserList = [];
|
||||
state.switchcount += 1;
|
||||
},
|
||||
updateMapState: (state, deviceStatus) => {
|
||||
@ -204,6 +216,52 @@ const training = {
|
||||
},
|
||||
setCenterStationCode:(state, centerStationCode) => {
|
||||
state.centerStationCode = centerStationCode;
|
||||
},
|
||||
setMemberList: (state, {memberList, userId}) => {
|
||||
state.memberList = memberList;
|
||||
state.memberData = {};
|
||||
if (memberList && memberList.length) {
|
||||
memberList.forEach(item => {
|
||||
state.memberData[item.id] = deepAssign({userId: ''}, item);
|
||||
state.memberData[item.id].disabled = userId == item.userId;
|
||||
});
|
||||
}
|
||||
},
|
||||
setSimulationUserList: (state, simulationUserList) => {
|
||||
state.simulationUserList = simulationUserList;
|
||||
},
|
||||
updateMemberAndUser: (state, {simulationUserList, userId}) => {
|
||||
simulationUserList.forEach(item => {
|
||||
let memberIndex = -1;
|
||||
let memberId = '';
|
||||
state.simulationUserList.forEach((user, index) =>{
|
||||
if (user.userId === item.userId) {
|
||||
memberId = user.memberId;
|
||||
user.online = item.online;
|
||||
user.memberId = item.memberId;
|
||||
user.role = item.role;
|
||||
memberIndex = index;
|
||||
}
|
||||
});
|
||||
try {
|
||||
if (state.memberData && memberId !== item.memberId && memberId && state.memberData[memberId]) {
|
||||
state.memberData[memberId].userId = '';
|
||||
state.memberData[memberId].disabled = false;
|
||||
}
|
||||
if (state.memberData && memberId !== item.memberId && item.memberId && state.memberData[item.memberId]) {
|
||||
state.memberData[item.memberId].userId = item.userId;
|
||||
state.memberData[item.memberId].disabled = item.userId == userId;
|
||||
}
|
||||
if (item.messageType === 'ENTER' && memberIndex < 0) {
|
||||
delete item.messageType;
|
||||
state.simulationUserList.push(item);
|
||||
} else if (item.messageType === 'KICK_OUT' && memberIndex > -1) {
|
||||
state.simulationUserList.splice(memberIndex, 1);
|
||||
}
|
||||
} catch (e) {
|
||||
console.error(e);
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
@ -599,6 +657,18 @@ const training = {
|
||||
/** 设置当前居中的集中站code */
|
||||
setCenterStationCode:({ commit }, centerStationCode) => {
|
||||
commit('setCenterStationCode', centerStationCode);
|
||||
},
|
||||
/** 设置综合演练仿真成员列表 */
|
||||
setMemberList: ({ commit }, data) => {
|
||||
commit('setMemberList', data);
|
||||
},
|
||||
/** 设置综合演练仿真用户列表 */
|
||||
setSimulationUserList: ({ commit }, simulationUserList) => {
|
||||
commit('setSimulationUserList', simulationUserList);
|
||||
},
|
||||
/** 更新综合演练仿真成员和用户列表 */
|
||||
updateMemberAndUser: ({ commit }, data) => {
|
||||
commit('updateMemberAndUser', data);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
@ -17,7 +17,8 @@ const user = {
|
||||
admin: false,
|
||||
wxId: '',
|
||||
wxUnionId: '',
|
||||
account: ''
|
||||
account: '',
|
||||
projectDevice: ''
|
||||
},
|
||||
|
||||
mutations: {
|
||||
@ -30,6 +31,9 @@ const user = {
|
||||
SET_NICKNAME: (state, nickname) => {
|
||||
state.nickname = nickname;
|
||||
},
|
||||
SET_PROJECTDEVICE: (state, projectDevice) => {
|
||||
state.projectDevice = projectDevice;
|
||||
},
|
||||
SET_ROLES: (state, roles) => {
|
||||
state.roles = roles;
|
||||
},
|
||||
@ -106,7 +110,9 @@ const user = {
|
||||
});
|
||||
});
|
||||
},
|
||||
|
||||
SetProjecteDevice({ commit }, deviceVo) {
|
||||
commit('SET_PROJECTDEVICE', deviceVo);
|
||||
},
|
||||
// 获取用户信息
|
||||
GetInfo({ commit }, token) {
|
||||
return new Promise((resolve, reject) => {
|
||||
|
@ -2,9 +2,9 @@ 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.6:9000'; // 旭强
|
||||
// BASE_API = 'http://192.168.3.41:9000'; // 张赛
|
||||
// BASE_API = 'http://192.168.3.82:9000'; // 杜康
|
||||
// BASE_API = 'http://b29z135112.zicp.vip';
|
||||
|
@ -22,8 +22,8 @@
|
||||
:style="{height: height+'px'}"
|
||||
>
|
||||
<div slot-scope="{ node, data }" class="list-elem custom-tree-node">
|
||||
<span v-if="data.state=='01'">{{ '['+data.mapName+']'+($t('global.trainingNotStart').replace('{name}', data.creator.nickName)) }}</span>
|
||||
<span v-else>{{ '['+data.mapName+']'+($t('global.trainingHasStart').replace('{name}', data.creator.nickName)) }}</span>
|
||||
<span v-if="data.state=='01'">{{ '['+data.map.name+']'+($t('global.trainingNotStart').replace('{name}', data.creator.nickname)) }}</span>
|
||||
<span v-else>{{ '['+data.map.name+']'+($t('global.trainingHasStart').replace('{name}', data.creator.nickname)) }}</span>
|
||||
<el-button
|
||||
type="text"
|
||||
size="mini"
|
||||
@ -43,8 +43,7 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { getjointTrainListNew, putJointTrainingSimulationEntranceNew, getjointTrainingNew } from '@/api/jointTraining';
|
||||
import { getPublishMapInfo } from '@/api/jmap/map';
|
||||
import { getSimulationListCantainUser } from '@/api/jointSimulation';
|
||||
import { launchFullscreen } from '@/utils/screen';
|
||||
import { getToken } from '@/utils/auth';
|
||||
import { creatSubscribe, clearSubscribe, roomTopic} from '@/utils/stomp';
|
||||
@ -100,8 +99,11 @@ export default {
|
||||
this.pageLoading = true;
|
||||
this.dialogShow = true;
|
||||
this.loading = false;
|
||||
const resp = await getjointTrainListNew();
|
||||
this.trainingList = resp.data || [];
|
||||
this.trainingList = [];
|
||||
const resp = await getSimulationListCantainUser();
|
||||
if (resp.data) {
|
||||
this.trainingList = resp.data;
|
||||
}
|
||||
} catch (e) {
|
||||
console.error(e);
|
||||
} finally {
|
||||
@ -113,18 +115,9 @@ export default {
|
||||
},
|
||||
async handleJoinRoom(data) {
|
||||
try {
|
||||
const rest = await getPublishMapInfo(data.mapId);
|
||||
await getjointTrainingNew(data.group);
|
||||
if (data.state == '02') {
|
||||
this.subscribe(data.group);
|
||||
launchFullscreen();
|
||||
const query = { lineCode: rest.data.lineCode, mapId: data.mapId, group: data.group, drawWay: true };
|
||||
await putJointTrainingSimulationEntranceNew(data.group);
|
||||
this.$router.push({ path: `/jointTrainingNew`, query: query });
|
||||
} else if (data.state == '01') {
|
||||
const query = { group: data.group, drawWay: true };
|
||||
this.$router.push({ path: `/trainroom`, query: query });
|
||||
}
|
||||
launchFullscreen();
|
||||
const query = { lineCode: data.map.lineCode, mapId: data.map.id, group: data.group};
|
||||
this.$router.push({path:'/jointTrainingNew', query:query});
|
||||
} catch (e) {
|
||||
console.error(e);
|
||||
} finally {
|
||||
@ -140,23 +133,23 @@ export default {
|
||||
</script>
|
||||
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
/deep/ {
|
||||
.el-dialog__body {
|
||||
padding: 0px 30px !important;
|
||||
}
|
||||
/deep/ {
|
||||
.el-dialog__body {
|
||||
padding: 0px 30px !important;
|
||||
}
|
||||
|
||||
.el-tree {
|
||||
overflow: hidden !important;
|
||||
.el-tree {
|
||||
overflow: auto !important;
|
||||
.list-elem {
|
||||
height: 30px;
|
||||
line-height: 30px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.el-tree-node.is-current>.el-tree-node__content {
|
||||
background-color: #e4e3e3 !important;
|
||||
}
|
||||
}
|
||||
.el-tree-node.is-current>.el-tree-node__content {
|
||||
background-color: #e4e3e3 !important;
|
||||
}
|
||||
}
|
||||
.custom-tree-node {
|
||||
flex: 1;
|
||||
display: flex;
|
@ -1,190 +0,0 @@
|
||||
<template>
|
||||
<el-dialog
|
||||
v-dialogDrag
|
||||
v-dialogLoading="pageLoading"
|
||||
:title="title"
|
||||
:visible.sync="show"
|
||||
width="600px"
|
||||
:before-close="doClose"
|
||||
:z-index="2000"
|
||||
:modal="false"
|
||||
:close-on-click-modal="false"
|
||||
>
|
||||
<el-scrollbar wrap-class="scrollbar-wrapper" :style="{height: height+'px'}">
|
||||
<el-tree
|
||||
ref="tree"
|
||||
node-key="group"
|
||||
class="filter-tree"
|
||||
default-expand-all
|
||||
:data="trainingList"
|
||||
:props="defaultProps"
|
||||
:filter-node-method="filterNode"
|
||||
:style="{height: height+'px'}"
|
||||
>
|
||||
<div slot-scope="{ node, data }" class="list-elem custom-tree-node">
|
||||
<span v-if="data.state=='01'">{{ '['+data.mapName+']'+($t('global.trainingNotStart').replace('{name}', data.creator.nickName)) }}</span>
|
||||
<span v-else>{{ '['+data.mapName+']'+($t('global.trainingHasStart').replace('{name}', data.creator.nickName)) }}</span>
|
||||
<el-button
|
||||
type="text"
|
||||
size="mini"
|
||||
@click="handleJoinRoom(data)"
|
||||
>进入</el-button>
|
||||
</div>
|
||||
</el-tree>
|
||||
</el-scrollbar>
|
||||
<span
|
||||
slot="footer"
|
||||
class="dialog-footer"
|
||||
>
|
||||
<el-button v-loading="loading" type="primary" @click="handleJoin">{{ $t('global.joinNewRoom') }}</el-button>
|
||||
<el-button @click="dialogShow = false">{{ $t('global.cancel') }}</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { getjointTrainList, getjointTraining, putJointTrainingSimulationEntrance } from '@/api/chat';
|
||||
import { getjointTrainListNew, putJointTrainingSimulationEntranceNew, getjointTrainingNew } from '@/api/jointTraining';
|
||||
import { getPublishMapInfo } from '@/api/jmap/map';
|
||||
import { launchFullscreen } from '@/utils/screen';
|
||||
import { getSessionStorage } from '@/utils/auth';
|
||||
import { ProjectCode } from '@/scripts/ProjectConfig';
|
||||
import { getToken } from '@/utils/auth';
|
||||
import { creatSubscribe, clearSubscribe, roomTopic} from '@/utils/stomp';
|
||||
|
||||
export default {
|
||||
name: 'DeomonList',
|
||||
data() {
|
||||
return {
|
||||
dialogShow: false,
|
||||
height: 120,
|
||||
trainingList: [],
|
||||
defaultProps: {
|
||||
label: 'roomName'
|
||||
},
|
||||
group: '',
|
||||
loading: false,
|
||||
pageLoading: false
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
show() {
|
||||
return this.dialogShow;
|
||||
},
|
||||
title() {
|
||||
return this.$t('global.synthesisTrainingTitle');
|
||||
},
|
||||
isWatch() {
|
||||
return true;
|
||||
},
|
||||
isjoin() {
|
||||
return true;
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
filterNode(value, data) {
|
||||
if (!value) return true;
|
||||
return data.label.indexOf(value) !== -1;
|
||||
},
|
||||
async subscribe(group) {
|
||||
if (!this.$store.state.socket.roomIsSubscribe) {
|
||||
this.clearSubscribe(group);
|
||||
const header = { group: group || '', 'X-Token': getToken() };
|
||||
creatSubscribe(`${roomTopic}\/${group}`, header);
|
||||
await this.$store.dispatch('socket/setRoomSubscribe', true);
|
||||
}
|
||||
},
|
||||
async clearSubscribe(group) {
|
||||
clearSubscribe(`${roomTopic}\/${group}`);
|
||||
await this.$store.dispatch('socket/setRoomSubscribe', false);
|
||||
},
|
||||
async doShow() {
|
||||
try {
|
||||
this.pageLoading = true;
|
||||
this.dialogShow = true;
|
||||
this.loading = false;
|
||||
const project = getSessionStorage('project');
|
||||
const param = {};
|
||||
if (ProjectCode[project]) {
|
||||
param.projectCode = ProjectCode[project];
|
||||
}
|
||||
const resp = await getjointTrainListNew(param);
|
||||
const rest = await getjointTrainList(param);
|
||||
const newMapData = resp.data || [];
|
||||
const oldMapData = rest.data || [];
|
||||
this.trainingList = [...newMapData, ...oldMapData];
|
||||
} catch (e) {
|
||||
console.error(e);
|
||||
} finally {
|
||||
this.pageLoading = false;
|
||||
}
|
||||
},
|
||||
async doClose() {
|
||||
this.dialogShow = false;
|
||||
},
|
||||
async handleJoinRoom(data) {
|
||||
try {
|
||||
const rest = await getPublishMapInfo(data.mapId);
|
||||
let path = '';
|
||||
if (rest.data.drawWay) {
|
||||
await getjointTrainingNew(data.group);
|
||||
path = '/jointTrainingNew';
|
||||
} else {
|
||||
await getjointTraining(data.group);
|
||||
path = '/jointTraining';
|
||||
}
|
||||
if (data.state == '02') {
|
||||
this.subscribe(data.group);
|
||||
launchFullscreen();
|
||||
const query = { lineCode: rest.data.lineCode, mapId: data.mapId, group: data.group, drawWay: rest.data.drawWay };
|
||||
if (rest.data.drawWay) {
|
||||
await putJointTrainingSimulationEntranceNew(data.group);
|
||||
} else {
|
||||
await putJointTrainingSimulationEntrance(data.group);
|
||||
}
|
||||
this.$router.push({ path: path, query: query });
|
||||
} else if (data.state == '01') {
|
||||
const query = { group: data.group, drawWay: rest.data.drawWay };
|
||||
this.$router.push({ path: `/trainroom`, query: query });
|
||||
}
|
||||
} catch (e) {
|
||||
console.error(e);
|
||||
} finally {
|
||||
this.loading = false;
|
||||
}
|
||||
},
|
||||
handleJoin() {
|
||||
this.$emit('enterQcode');
|
||||
this.dialogShow = false;
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
/deep/ {
|
||||
.el-dialog__body {
|
||||
padding: 0px 30px !important;
|
||||
}
|
||||
|
||||
.el-tree {
|
||||
overflow: auto !important;
|
||||
.list-elem {
|
||||
height: 30px;
|
||||
line-height: 30px;
|
||||
}
|
||||
}
|
||||
|
||||
.el-tree-node.is-current>.el-tree-node__content {
|
||||
background-color: #e4e3e3 !important;
|
||||
}
|
||||
}
|
||||
.custom-tree-node {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
font-size: 14px;
|
||||
padding-right: 8px;
|
||||
}
|
||||
</style>
|
@ -18,12 +18,7 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { getjointTraining, putJointTrainingSimulationEntrance } from '@/api/chat';
|
||||
import { getjointTrainingNew, putJointTrainingSimulationEntranceNew} from '@/api/jointTraining';
|
||||
import { getPublishMapInfo } from '@/api/jmap/map';
|
||||
import { launchFullscreen } from '@/utils/screen';
|
||||
import { getToken } from '@/utils/auth';
|
||||
import { creatSubscribe, clearSubscribe, roomTopic} from '@/utils/stomp';
|
||||
|
||||
export default {
|
||||
name: 'DeomonList',
|
||||
@ -32,8 +27,8 @@ export default {
|
||||
dialogShow: false,
|
||||
group: '',
|
||||
roomName: '',
|
||||
state: '',
|
||||
mapId: '',
|
||||
lineCode: '',
|
||||
loading: false
|
||||
};
|
||||
},
|
||||
@ -49,53 +44,22 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
doShow(data) {
|
||||
this.roomName = data.creator.nickName;
|
||||
this.roomName = data.creator.nickname;
|
||||
this.group = data.group;
|
||||
this.state = data.state;
|
||||
this.mapId = data.mapId;
|
||||
this.mapId = data.map.id;
|
||||
this.lineCode = data.map.lineCode;
|
||||
this.dialogShow = true;
|
||||
this.loading = false;
|
||||
},
|
||||
doClose() {
|
||||
this.dialogShow = false;
|
||||
},
|
||||
async subscribe() {
|
||||
if (!this.$store.state.socket.roomIsSubscribe) {
|
||||
this.clearSubscribe();
|
||||
const header = { group: this.group || '', 'X-Token': getToken() };
|
||||
creatSubscribe(`${roomTopic}\/${this.group}`, header);
|
||||
await this.$store.dispatch('socket/setRoomSubscribe', true);
|
||||
}
|
||||
},
|
||||
async clearSubscribe() {
|
||||
clearSubscribe(`${roomTopic}\/${this.group}`);
|
||||
await this.$store.dispatch('socket/setRoomSubscribe', false);
|
||||
},
|
||||
async handleJoin() {
|
||||
try {
|
||||
this.loading = true;
|
||||
const rest = await getPublishMapInfo(this.mapId);
|
||||
const drawWay = rest.data.drawWay;
|
||||
if (drawWay) {
|
||||
await getjointTrainingNew(this.group);
|
||||
} else {
|
||||
await getjointTraining(this.group);
|
||||
}
|
||||
if (this.state == '02') {
|
||||
this.subscribe();
|
||||
launchFullscreen();
|
||||
const query = { lineCode: rest.data.lineCode, mapId: this.mapId, group: this.group, drawWay: drawWay };
|
||||
if (drawWay) {
|
||||
await putJointTrainingSimulationEntranceNew(this.group);
|
||||
this.$router.push({ path: `/jointTrainingNew`, query: query });
|
||||
} else {
|
||||
await putJointTrainingSimulationEntrance(this.group);
|
||||
this.$router.push({ path: `/jointTraining`, query: query });
|
||||
}
|
||||
} else if (this.state == '01') {
|
||||
const query = { group: this.group, drawWay: drawWay };
|
||||
this.$router.push({ path: `/trainroom`, query: query });
|
||||
}
|
||||
launchFullscreen();
|
||||
const query = { lineCode: this.lineCode, mapId: this.mapId, group: this.group};
|
||||
this.$router.push({path: `/jointTrainingNew`, query: query});
|
||||
this.dialogShow = false;
|
||||
} catch (e) {
|
||||
this.$messageBox(this.$t('tip.enterTrainingRoomFailed'));
|
||||
|
@ -17,8 +17,6 @@
|
||||
<el-button v-if="!isLocal" type="success" :disabled="disabled" @click="buy">{{ $t('global.buy') }}</el-button>
|
||||
<el-button v-if="hasPermssion && !isComprehensive && !isLocal" type="primary" :disabled="disabled" @click="distribute">{{ $t('global.distributePermission') }}</el-button>
|
||||
<el-button v-show="isStartDemon" :disabled="disabled" type="primary" @click="start">{{ $t('demonstration.startSimulation') }}</el-button>
|
||||
<el-button v-show="isCreateRoom" :disabled="disabled" type="primary" @click="start">{{ $t('demonstration.createRoom') }}</el-button>
|
||||
<el-button v-show="isInRoom" :disabled="disabled" type="primary" @click="joinRoom">{{ $t('demonstration.enterRoom') }}</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
@ -28,8 +26,7 @@ import { getPublishMapInfo } from '@/api/jmap/map';
|
||||
import { getGoodsTryUse } from '@/api/management/goods';
|
||||
import { PermissionType, UrlConfig } from '@/scripts/ConstDic';
|
||||
import { launchFullscreen } from '@/utils/screen';
|
||||
import { postCreateRoom, getjointTraining } from '@/api/chat';
|
||||
import { postCreateRoomNew, getjointTrainingNew, checkRoomExistNew } from '@/api/jointTraining';
|
||||
import { } from '@/scripts/ConstDic';
|
||||
import { simulationNotify, schedulingNotify, createSimulationNew } from '@/api/simulation';
|
||||
import LimitList from '@/views/components/limits/index';
|
||||
import { getSubSystemDetail } from '@/api/trainingPlatform';
|
||||
@ -60,8 +57,6 @@ export default {
|
||||
prdType: '',
|
||||
pmsList: []
|
||||
},
|
||||
jointShow: false,
|
||||
jointGroup: '',
|
||||
lineCode:'',
|
||||
drawWay: false // 是否新版地图
|
||||
};
|
||||
@ -87,13 +82,7 @@ export default {
|
||||
return this.courseModel.prdType === '03';
|
||||
},
|
||||
isStartDemon() {
|
||||
return this.courseModel.prdType !== '03' && (this.hasPermssion || this.tryTime > 0);
|
||||
},
|
||||
isCreateRoom() {
|
||||
return this.courseModel.prdType === '03' && this.hasPermssion && !this.jointShow;
|
||||
},
|
||||
isInRoom() {
|
||||
return this.courseModel.prdType === '03' && this.hasPermssion && this.jointShow;
|
||||
return this.hasPermssion || this.tryTime > 0;
|
||||
},
|
||||
mapId() {
|
||||
return this.$route.query.mapId;
|
||||
@ -103,7 +92,7 @@ export default {
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
'$route': function (val) {
|
||||
'$route': function (val, oldval) {
|
||||
this.loadInitData();
|
||||
}
|
||||
},
|
||||
@ -142,9 +131,6 @@ export default {
|
||||
PermissionType: PermissionType.SIMULATION
|
||||
};
|
||||
this.currentPrdType = resp.data.prdType;
|
||||
if (resp.data.prdType === '03') {
|
||||
this.getJointTrainingList();
|
||||
}
|
||||
if (!this.courseModel.pmsList) {
|
||||
this.tryUser = 1;
|
||||
const paras = {
|
||||
@ -167,67 +153,22 @@ export default {
|
||||
}
|
||||
} catch (error) {
|
||||
// this.loading = false;
|
||||
// this.$message.error(this.$t('error.refreshFailed'));
|
||||
this.$message.error(this.$t('error.refreshFailed'));
|
||||
}
|
||||
},
|
||||
refresh() {
|
||||
this.loadInitData();
|
||||
},
|
||||
async getJointTrainingList() {
|
||||
try {
|
||||
if (this.mapId) {
|
||||
const res = await checkRoomExistNew({mapId: this.mapId});
|
||||
this.jointGroup = res.data;
|
||||
this.jointShow = false;
|
||||
if (res.data) {
|
||||
this.jointShow = true;
|
||||
}
|
||||
}
|
||||
} catch (error) {
|
||||
console.error(error, '获取是否拥有综合演练房间');
|
||||
}
|
||||
},
|
||||
async joinRoom() {
|
||||
this.disabled = true;
|
||||
if (this.drawWay) {
|
||||
await getjointTrainingNew(this.jointGroup);
|
||||
} else {
|
||||
await getjointTraining(this.jointGroup);
|
||||
}
|
||||
this.$store.dispatch('socket/setInRoom', true);
|
||||
const query = { lineCode: this.courseModel.lineCode, group: this.jointGroup, drawWay: this.drawWay};
|
||||
this.$router.push({ path: `/trainroom`, query: query });
|
||||
},
|
||||
async createRoom() {
|
||||
try {
|
||||
this.disabled = true;
|
||||
const param = {
|
||||
mapId: Number(this.mapId),
|
||||
prdType: this.courseModel.prdType
|
||||
};
|
||||
let res = '';
|
||||
if (this.drawWay) {
|
||||
res = await postCreateRoomNew(param);
|
||||
} else {
|
||||
res = await postCreateRoom(param);
|
||||
}
|
||||
if (res && res.code == 200) {
|
||||
const query = { lineCode: this.courseModel.lineCode, group: res.data, drawWay: this.drawWay };
|
||||
this.$router.push({ path: `/trainroom`, query: query });
|
||||
}
|
||||
} catch (error) {
|
||||
async enterIntegratedSimulation() {
|
||||
const data = { mapId: this.courseModel.mapId, prdType: this.currentPrdType };
|
||||
createSimulationNew(data).then(resp => {
|
||||
const query = { lineCode: this.courseModel.lineCode, group: resp.data, mapId: this.courseModel.mapId, drawWay: true };
|
||||
this.$router.push({ path: `/jointTrainingNew`, query: query });
|
||||
launchFullscreen();
|
||||
}).catch(error => {
|
||||
this.$messageBox(this.$t('error.createSimulationFailed') + error.message);
|
||||
this.disabled = false;
|
||||
if (error.code == 20001) {
|
||||
this.$confirm(this.$t('tip.createRoomFailedHint'), this.$t('global.tips'), {
|
||||
confirmButtonText: this.$t('global.confirm'),
|
||||
cancelButtonText: this.$t('global.cancel'),
|
||||
type: 'warning'
|
||||
}).then(() => {}).catch(() => {});
|
||||
}
|
||||
if (error.code == 500009) {
|
||||
this.$messageBox(error.message);
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
async enterISCS() {
|
||||
try {
|
||||
@ -245,7 +186,6 @@ export default {
|
||||
}
|
||||
} catch (error) {
|
||||
this.disabled = false;
|
||||
console.log(error);
|
||||
}
|
||||
},
|
||||
async enterScreen() {
|
||||
@ -262,7 +202,7 @@ export default {
|
||||
if (this.courseModel.prdType == '05') {
|
||||
this.jumpScheduling();
|
||||
} else if (this.courseModel.prdType == '03') {
|
||||
this.createRoom();
|
||||
this.enterIntegratedSimulation();
|
||||
} else if (this.courseModel.prdType == '06') {
|
||||
this.enterISCS();
|
||||
} else if (this.courseModel.prdType == '07') {
|
||||
|
@ -31,10 +31,10 @@ export default {
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
size: {
|
||||
width: document.documentElement.clientWidth - 400,
|
||||
height: document.documentElement.clientHeight - 80
|
||||
},
|
||||
// size: {
|
||||
// width: document.documentElement.clientWidth - 400,
|
||||
// height: document.documentElement.clientHeight - 80
|
||||
// },
|
||||
maskOpen: false,
|
||||
maskWidth: '100%',
|
||||
disPlay: false
|
||||
@ -45,10 +45,10 @@ export default {
|
||||
return this.$route.params.mapId;
|
||||
},
|
||||
height() {
|
||||
return this.$store.state.app.height - 50 - 30;
|
||||
return this.$store.state.app.height - 50 - 40;
|
||||
},
|
||||
...mapGetters('map', [
|
||||
'bigScreenSplitConfig'
|
||||
'bigScreenConfig'
|
||||
]),
|
||||
...mapGetters('config', [
|
||||
'canvasId'
|
||||
@ -69,7 +69,7 @@ export default {
|
||||
'$store.state.map.mapViewLoadedCount':function() {
|
||||
this.$store.dispatch('map/setTrainWindowShow', false);
|
||||
this.$jlmap.off('zoom');
|
||||
this.$jlmap.off('pan');
|
||||
// this.$jlmap.off('pan');
|
||||
this.handleUpdateScreen();
|
||||
if (this.$route.query.group) {
|
||||
this.subscribe();
|
||||
@ -135,19 +135,24 @@ export default {
|
||||
},
|
||||
handleUpdateScreen() {
|
||||
this.maskOpen = false;
|
||||
if (this.bigScreenSplitConfig.length) {
|
||||
if (this.bigScreenConfig.bigScreenSplitConfig && this.bigScreenConfig.bigScreenSplitConfig.length) {
|
||||
const offsetList = this.bigScreenConfig.offsetList;
|
||||
const width = this.bigScreenConfig.width;
|
||||
const height = this.bigScreenConfig.height;
|
||||
if (this.widthLeft) {
|
||||
const size = {
|
||||
width: this.$store.state.app.width - (this.widthLeft || 450) - 2,
|
||||
height: this.height,
|
||||
list: this.bigScreenSplitConfig.map(ele => ele.position)
|
||||
width: (this.$store.state.app.width - (this.widthLeft || 450) - 2) * width,
|
||||
height: this.height * height,
|
||||
list: this.bigScreenConfig.bigScreenSplitConfig.map(ele => ele.position),
|
||||
offsetList: offsetList
|
||||
};
|
||||
this.$jlmap.setUpdateScreen(size);
|
||||
} else {
|
||||
const size = {
|
||||
width: this.$store.state.app.width - 2,
|
||||
height: this.$store.state.app.height,
|
||||
list: this.bigScreenSplitConfig.map(ele => ele.position)
|
||||
width: (this.$store.state.app.width - 2) * width,
|
||||
height: this.$store.state.app.height * height,
|
||||
list: this.bigScreenConfig.bigScreenSplitConfig.map(ele => ele.position),
|
||||
offsetList: offsetList
|
||||
};
|
||||
this.$jlmap.setUpdateScreen(size);
|
||||
}
|
||||
@ -185,6 +190,7 @@ export default {
|
||||
.map-view {
|
||||
float: left;
|
||||
width: auto;
|
||||
overflow: hidden;
|
||||
}
|
||||
.mask{
|
||||
opacity: 1;
|
||||
|
219
src/views/designPlatform/bigSplitScreen.vue
Normal file
219
src/views/designPlatform/bigSplitScreen.vue
Normal file
@ -0,0 +1,219 @@
|
||||
<template>
|
||||
<div class="map-view">
|
||||
<div v-show="maskOpen" class="mask" :style="{'width': maskWidth}" />
|
||||
<div v-show="disPlay" class="display-draft display-select">
|
||||
<el-select v-model="value" placeholder="请选择" style="width: 125px;" @change="changeSplit">
|
||||
<el-option
|
||||
v-for="item in optionsList"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</div>
|
||||
<jlmap-visual ref="jlmapVisual" />
|
||||
<div v-show="disPlay" class="display-draft">
|
||||
<el-button-group>
|
||||
<el-button type="primary" @click="back">{{ $t('scriptRecord.scriptBack') }}</el-button>
|
||||
</el-button-group>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import JlmapVisual from '@/views/newMap/jlmapNew/index';
|
||||
import { loadNewMapDataByGroup, loadMapDataById } from '@/utils/loaddata';
|
||||
import { clearSimulation } from '@/api/simulation';
|
||||
import { EventBus } from '@/scripts/event-bus';
|
||||
import { mapGetters } from 'vuex';
|
||||
import { creatSubscribe, clearSubscribe, displayTopic} from '@/utils/stomp';
|
||||
import { getToken } from '@/utils/auth';
|
||||
import { getSessionStorage } from '@/utils/auth';
|
||||
|
||||
export default {
|
||||
name: 'MapPreview',
|
||||
components: {
|
||||
JlmapVisual
|
||||
},
|
||||
props: {
|
||||
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
maskOpen: false,
|
||||
maskWidth: '100%',
|
||||
disPlay: false,
|
||||
value: 1,
|
||||
optionsList: []
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
mapId() {
|
||||
return this.$route.params.mapId;
|
||||
},
|
||||
...mapGetters('map', [
|
||||
'bigScreenConfig'
|
||||
]),
|
||||
...mapGetters('config', [
|
||||
'canvasId'
|
||||
])
|
||||
},
|
||||
watch: {
|
||||
$route() {
|
||||
this.$nextTick(() => {
|
||||
this.initLoadData();
|
||||
});
|
||||
},
|
||||
'$store.state.app.windowSizeCount': function() {
|
||||
this.setWindowSize();
|
||||
},
|
||||
'$store.state.map.mapViewLoadedCount':function() {
|
||||
this.$store.dispatch('map/setTrainWindowShow', false);
|
||||
this.$jlmap.off('zoom');
|
||||
this.$jlmap.off('pan');
|
||||
this.handleUpdateScreen();
|
||||
if (this.$route.query.group) {
|
||||
this.subscribe();
|
||||
}
|
||||
},
|
||||
'$store.state.socket.equipmentStatus': function (val) {
|
||||
if (val.length && this.$route.query.group) {
|
||||
this.statusMessage(val);
|
||||
}
|
||||
}
|
||||
},
|
||||
async beforeDestroy() {
|
||||
await this.$store.dispatch('map/mapClear');
|
||||
},
|
||||
async mounted() {
|
||||
await this.setWindowSize();
|
||||
await this.initLoadData();
|
||||
this.disPlay = true;
|
||||
if (this.$route.path.includes('design/bigScreen')) {
|
||||
this.disPlay = false;
|
||||
}
|
||||
if (this.$route.query.projectDevice) {
|
||||
this.disPlay = false;
|
||||
const data = JSON.parse(JSON.parse(getSessionStorage('projectDevice')).config);
|
||||
console.log(data, data.quadrant);
|
||||
this.changeSplit(data.quadrant);
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
async initLoadData() { // 加载地图数据
|
||||
if (this.$route.query.group) {
|
||||
await loadNewMapDataByGroup(this.$route.query.group);
|
||||
} else {
|
||||
this.loadMapDataById(this.$route.params.mapId);
|
||||
}
|
||||
},
|
||||
// 通过id加载地图数据
|
||||
async loadMapDataById(mapId) {
|
||||
try {
|
||||
await this.$store.dispatch('training/changeMode', { mode: null });
|
||||
loadMapDataById(mapId).then(()=>{
|
||||
this.$store.dispatch('training/over');
|
||||
this.$store.dispatch('training/setMapDefaultState');
|
||||
this.$store.dispatch('map/clearJlmapTrainView');
|
||||
});
|
||||
} catch (error) {
|
||||
this.$messageBox(`获取地图数据失败: ${error.message}`);
|
||||
this.endViewLoading();
|
||||
}
|
||||
},
|
||||
async statusMessage(list) {
|
||||
await this.$store.dispatch('training/updateMapState', list);
|
||||
await this.$store.dispatch('socket/setEquipmentStatus');
|
||||
},
|
||||
setWindowSize() {
|
||||
this.$nextTick(() => {
|
||||
const width = this.$store.state.app.width;
|
||||
const height = this.$store.state.app.height;
|
||||
this.$store.dispatch('config/resize', { width, height });
|
||||
this.handleUpdateScreen();
|
||||
});
|
||||
},
|
||||
changeSplit(data) {
|
||||
const width = this.bigScreenConfig.width;
|
||||
const height = this.bigScreenConfig.height;
|
||||
const num = width * height;
|
||||
const size = {
|
||||
width: this.$store.state.app.width * width,
|
||||
height: this.$store.state.app.height * height
|
||||
};
|
||||
console.log(size, data, num, this.bigScreenConfig);
|
||||
this.$refs.jlmapVisual.setOffset(size, data, num);
|
||||
},
|
||||
handleUpdateScreen() {
|
||||
this.maskOpen = false;
|
||||
if (this.bigScreenConfig.bigScreenSplitConfig && this.bigScreenConfig.bigScreenSplitConfig.length) {
|
||||
const offsetList = this.bigScreenConfig.offsetList;
|
||||
const width = this.bigScreenConfig.width;
|
||||
const height = this.bigScreenConfig.height;
|
||||
const num = width * height;
|
||||
this.optionsList = [];
|
||||
for (let index = 0; index < num; index++) {
|
||||
const param = { value: index + 1, label: `第${index + 1}屏` };
|
||||
this.optionsList.push(param);
|
||||
}
|
||||
const size = {
|
||||
width: this.$store.state.app.width * width,
|
||||
height: this.$store.state.app.height * height,
|
||||
list: this.bigScreenConfig.bigScreenSplitConfig.map(ele => ele.position),
|
||||
offsetList: offsetList
|
||||
};
|
||||
this.$jlmap.setUpdateScreen(size);
|
||||
this.$refs.jlmapVisual.handleStateLoaded();
|
||||
} else {
|
||||
this.maskOpen = true;
|
||||
}
|
||||
},
|
||||
async back() {
|
||||
if (this.$route.query.group) {
|
||||
await clearSimulation(this.$route.query.group);
|
||||
this.clearSubscribe();
|
||||
}
|
||||
this.$store.dispatch('training/over').then(() => {
|
||||
EventBus.$emit('runPlanStop');
|
||||
EventBus.$emit('chatSubscribeStop');
|
||||
history.go(-1);
|
||||
});
|
||||
},
|
||||
async subscribe() {
|
||||
this.clearSubscribe();
|
||||
const header = { group: this.$route.query.group || '', 'X-Token': getToken() };
|
||||
creatSubscribe(`${displayTopic}\/${this.$route.query.group}`, header);
|
||||
|
||||
await this.$store.dispatch('training/setHasSubscribed');
|
||||
},
|
||||
clearSubscribe() {
|
||||
clearSubscribe(`${displayTopic}\/${this.$route.query.group}`);
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.map-view {
|
||||
float: left;
|
||||
width: auto;
|
||||
}
|
||||
.mask{
|
||||
opacity: 1;
|
||||
background: #000;
|
||||
position: absolute;
|
||||
right: 0;
|
||||
top: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
z-index: 9;
|
||||
}
|
||||
.display-draft {
|
||||
position: absolute;
|
||||
float: right;
|
||||
right: 15px;
|
||||
bottom: 15px;
|
||||
z-index: 19;
|
||||
}
|
||||
.display-select {
|
||||
top: 15px;
|
||||
}
|
||||
</style>
|
@ -127,6 +127,10 @@ export default {
|
||||
this.$router.push({ path: `/design/bigScreen/${obj.mapId}` });
|
||||
break;
|
||||
}
|
||||
case 'bigSplitScreen': {
|
||||
this.$router.push({ path: `/bigSplitScreen/${obj.mapId}` });
|
||||
break;
|
||||
}
|
||||
}
|
||||
},
|
||||
async refresh(filterSelect) {
|
||||
@ -193,6 +197,14 @@ export default {
|
||||
lineCode: elem.lineCode,
|
||||
cityCode: elem.cityCode
|
||||
});
|
||||
elem.children.push({
|
||||
id: '7',
|
||||
name: '大屏分屏预览',
|
||||
type: 'bigSplitScreen',
|
||||
mapId: elem.id,
|
||||
lineCode: elem.lineCode,
|
||||
cityCode: elem.cityCode
|
||||
});
|
||||
});
|
||||
this.treeData = res.data;
|
||||
this.treeList = this.filterText
|
||||
|
@ -8,25 +8,29 @@
|
||||
<el-tab-pane :label="this.$t('exam.itemList')" name="first">
|
||||
<div v-if="courseModel.treeList.length != 0" :style="{ height: height - 230 +'px' }">
|
||||
<el-scrollbar wrap-class="scrollbar-wrapper">
|
||||
<el-tree
|
||||
ref="tree"
|
||||
:data="courseModel.treeList"
|
||||
node-key="id"
|
||||
:props="defaultProps"
|
||||
:filter-node-method="filterNode"
|
||||
highlight-current
|
||||
:span="22"
|
||||
:default-expanded-keys="expandList"
|
||||
@node-click="clickEvent"
|
||||
@node-expand="nodeExpand"
|
||||
@node-collapse="nodeCollapse"
|
||||
>
|
||||
<span slot-scope="{ node }">
|
||||
<span v-if="valid||node.data.trial" class="el-icon-goods" />
|
||||
<span v-else class="el-icon-sold-out" />
|
||||
<span :style="{color: node.data.trial||valid ?'green':'black'}"> {{ node.label }}</span>
|
||||
</span>
|
||||
</el-tree>
|
||||
<el-table :data="courseModel.treeList" border style="width: 100%; margin-top: 20px">
|
||||
<el-table-column label="试卷名称">
|
||||
<template slot-scope="scope">
|
||||
<span :style="{color: scope.row.trial||valid ?'green':'black'}">{{ scope.row.name }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column v-if="isGzbShow" label="班级">
|
||||
<template slot-scope="scope">
|
||||
<el-tag v-for="item in scope.row.classes" :key="item.id" style="margin-right: 6px;">{{ item.name }}</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="duration" label="考试时长">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ scope.row.duration / 60 }}分钟</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="fullPoint" label="试卷总分" />
|
||||
<el-table-column label="操作">
|
||||
<template slot-scope="scope">
|
||||
<el-button size="mini" @click="clickEvent(scope.row)">查看详情</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-scrollbar>
|
||||
</div>
|
||||
<div v-else class="noList">
|
||||
@ -55,7 +59,7 @@ import { getCourseLessonDetail } from '@/api/management/exam';
|
||||
import { PermissionType } from '@/scripts/ConstDic';
|
||||
import { UrlConfig } from '@/scripts/ConstDic';
|
||||
import LimitList from '@/views/components/limits/index';
|
||||
import { getSessionStorage, setSessionStorage } from '@/utils/auth';
|
||||
import { getSessionStorage } from '@/utils/auth';
|
||||
import localStore from 'storejs';
|
||||
|
||||
export default {
|
||||
@ -77,15 +81,14 @@ export default {
|
||||
},
|
||||
EffectiveTypeList: [],
|
||||
activeName: 'first',
|
||||
defaultProps: {
|
||||
children: 'children',
|
||||
label: 'name'
|
||||
},
|
||||
expandList: [],
|
||||
valid: false
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
isGzbShow() {
|
||||
return getSessionStorage('project').startsWith('gzb');
|
||||
},
|
||||
hasPermssion() {
|
||||
let isShow = false;
|
||||
if (this.courseModel.pmsList && this.courseModel.pmsList.length) {
|
||||
@ -184,7 +187,7 @@ export default {
|
||||
this.$router.push({ path: `${UrlConfig.trainingPlatform.examHome}/${this.$route.params.subSystem}`});
|
||||
}, 100);
|
||||
},
|
||||
clickEvent(obj, node, data) {
|
||||
clickEvent(obj) {
|
||||
if (this.valid || obj.trial) {
|
||||
this.$router.push({ path: `${UrlConfig.trainingPlatform.examDetail}/${obj.id}`, query: { subSystem: this.$route.params.subSystem, mapId: this.courseModel.mapId }});
|
||||
} else {
|
||||
@ -199,21 +202,6 @@ export default {
|
||||
this.buy();
|
||||
}).catch(() => { });
|
||||
},
|
||||
filterNode(value, data) {
|
||||
if (!value) return true;
|
||||
return data.name.indexOf(value) !== -1;
|
||||
},
|
||||
nodeExpand(obj, node, ele) {
|
||||
const key = obj.id;
|
||||
this.expandList = this.expandList.filter(item => item !== key);
|
||||
this.expandList.push(key);
|
||||
setSessionStorage('trainingExamExpandList' + this.courseModel.id, this.expandList);
|
||||
},
|
||||
nodeCollapse(obj, node, ele) {
|
||||
const key = obj.id;
|
||||
this.expandList = this.expandList.filter(item => item !== key);
|
||||
setSessionStorage('trainingExamExpandList' + this.courseModel.id, this.expandList);
|
||||
},
|
||||
getExpandList(id) {
|
||||
let expand = getSessionStorage('trainingExamExpandList' + id);
|
||||
expand = expand ? (expand + '').split(',') : '';
|
||||
|
@ -114,7 +114,8 @@ export default {
|
||||
Stand: [],
|
||||
Station: [],
|
||||
ControlConvertMenu: [],
|
||||
TrainWindow: []
|
||||
TrainWindow: [],
|
||||
LimitControl: []
|
||||
};
|
||||
let ele;
|
||||
for ( ele in CMD['Switch']) {
|
||||
@ -132,6 +133,9 @@ export default {
|
||||
for ( ele in CMD['Station']) {
|
||||
this.trainingOperateTypeMap['Station'].push(CMD['Station'][ele]);
|
||||
}
|
||||
for ( ele in CMD['LimitControl']) {
|
||||
this.trainingOperateTypeMap['LimitControl'].push(CMD['LimitControl'][ele]);
|
||||
}
|
||||
for ( ele in CMD['ControlConvertMenu']) {
|
||||
this.trainingOperateTypeMap['ControlConvertMenu'].push(CMD['ControlConvertMenu'][ele]);
|
||||
}
|
||||
|
@ -8,7 +8,7 @@
|
||||
<el-card v-loading="loading">
|
||||
<el-table :data="tableData" border style="width: 100%">
|
||||
<el-table-column prop="name" :label="this.$t('exam.courseName')" />
|
||||
<el-table-column prop="classNames" label="所属班级">
|
||||
<el-table-column v-if="isGzbShow" prop="classNames" label="所属班级">
|
||||
<template slot-scope="scope">
|
||||
<el-tag v-for="(item, index) in scope.row.classNames" :key="index" type="success">{{ item }}</el-tag>
|
||||
</template>
|
||||
@ -48,6 +48,11 @@ export default {
|
||||
userId: ''
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
isGzbShow() {
|
||||
return getSessionStorage('project').startsWith('gzb');
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
'$route.params.subSystem': function(newVal) {
|
||||
this.loadInitPage();
|
||||
|
@ -9,11 +9,8 @@
|
||||
import Vue from 'vue';
|
||||
import IbpPan from '@/ibp/ibpPan';
|
||||
import { parser } from '@/ibp/utils/parser';
|
||||
// import ibpData from '@/ibp/constant/ibpData';
|
||||
import { mapGetters } from 'vuex';
|
||||
import { exitFullscreen } from '@/utils/screen';
|
||||
import { putJointTrainingSimulationUser } from '@/api/chat';
|
||||
import { putJointTrainingSimulationUserNew} from '@/api/jointTraining';
|
||||
import { handlerIbpEvent } from '@/api/simulation';
|
||||
import { IbpOperation } from '@/scripts/ConstDic';
|
||||
import { getIbpInfoByStation } from '@/api/ibp';
|
||||
@ -124,8 +121,6 @@ export default {
|
||||
if (!deviceCode) {
|
||||
return;
|
||||
}
|
||||
// console.log(deviceCode);
|
||||
// const ibpDatas = ibpData[deviceCode];
|
||||
try {
|
||||
const res = await getIbpInfoByStation(this.$route.query.mapId, deviceCode);
|
||||
if (res.data.data) {
|
||||
@ -241,16 +236,13 @@ export default {
|
||||
back() {
|
||||
this.group = this.$route.query.group;
|
||||
this.$store.dispatch('training/over').then(() => {
|
||||
if (this.drawWay === 'true') {
|
||||
putJointTrainingSimulationUserNew(this.group).then(() => {
|
||||
this.$router.replace({ path: `/trainroom`, query: { group: this.group, lineCode:this.$route.query.lineCode, drawWay: this.drawWay } });
|
||||
exitFullscreen();
|
||||
if (this.$route.query.projectDevice) {
|
||||
this.$store.dispatch('LogOut').then(() => {
|
||||
location.reload();
|
||||
});
|
||||
} else {
|
||||
putJointTrainingSimulationUser(this.group).then(() => {
|
||||
this.$router.replace({ path: `/trainroom`, query: { group: this.group, lineCode:this.$route.query.lineCode } });
|
||||
exitFullscreen();
|
||||
});
|
||||
history.go(-1);
|
||||
exitFullscreen();
|
||||
}
|
||||
});
|
||||
},
|
||||
|
@ -16,7 +16,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="select-box">
|
||||
<el-select v-model="currentSystem" placeholder="请选择" size="mini" @change="changeCurrentSystem">
|
||||
<el-select v-if="!projectDevice" v-model="currentSystem" placeholder="请选择" size="mini" @change="changeCurrentSystem">
|
||||
<el-option
|
||||
v-for="item in systemList"
|
||||
:key="item.value"
|
||||
@ -25,13 +25,16 @@
|
||||
/>
|
||||
</el-select>
|
||||
</div>
|
||||
<div class="back-box" @click="back">返回主页面</div>
|
||||
<div class="back-box" @click="back">{{ projectDevice? '退出': '返回主页面' }}</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { getByGroupStationList } from '@/api/jmap/map';
|
||||
import merge from 'webpack-merge';
|
||||
import { getToken } from '@/utils/auth';
|
||||
import { getSessionStorage } from '@/utils/auth';
|
||||
import { creatSubscribe, clearSubscribe, displayTopic} from '@/utils/stomp';
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
@ -271,6 +274,18 @@ export default {
|
||||
computed: {
|
||||
group() {
|
||||
return this.$route.query.group;
|
||||
},
|
||||
projectDevice() {
|
||||
return getSessionStorage('projectDevice');
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
'$store.state.socket.simulationRoleList':function(val) {
|
||||
(val || []).forEach(item => {
|
||||
if (item.messageType === 'KICK_OUT' && item.userId == this.$store.state.user.id) {
|
||||
this.back();
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
async created () {
|
||||
@ -290,6 +305,8 @@ export default {
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
window.onbeforeunload = this.clearSubscribe;
|
||||
this.subscribe();
|
||||
this.navList.forEach((nav, navIndex)=>{
|
||||
if (nav.children && nav.children.length > 0) {
|
||||
nav.children.forEach((child, childIndex)=>{
|
||||
@ -300,6 +317,14 @@ export default {
|
||||
});
|
||||
}
|
||||
});
|
||||
if (this.projectDevice && this.projectDevice.type === 'ISCS_LW') {
|
||||
this.currentSystem = 'local';
|
||||
} else if (this.projectDevice && this.projectDevice.type === 'ISCS_CW') {
|
||||
this.currentSystem = 'center';
|
||||
}
|
||||
},
|
||||
beforeDestroy() {
|
||||
this.clearSubscribe();
|
||||
},
|
||||
methods: {
|
||||
show(item) {
|
||||
@ -309,30 +334,61 @@ export default {
|
||||
}
|
||||
return flag;
|
||||
},
|
||||
async subscribe() {
|
||||
this.clearSubscribe();
|
||||
const header = { group: this.group || '', 'X-Token': getToken() };
|
||||
creatSubscribe(`${displayTopic}\/${this.group}`, header);
|
||||
|
||||
await this.$store.dispatch('training/setHasSubscribed');
|
||||
},
|
||||
clearSubscribe() {
|
||||
clearSubscribe(`${displayTopic}\/${this.group}`);
|
||||
},
|
||||
selectTab(item, index) { // 选择大分类
|
||||
if (this.selectIndex != index) {
|
||||
this.selectIndex = index;
|
||||
this.selectChildIndex = 0;
|
||||
if (item.children.length) {
|
||||
this.type = item.children[0].type;
|
||||
this.$router.push({ path: `/displayIscs/system/config/${item.children[0].type}`, query: {currentSystem:this.currentSystem, stationName: this.stationList[this.selectStationIndex].name, stationId: this.stationList[this.selectStationIndex].id, group: this.group } });
|
||||
const query = {currentSystem:this.currentSystem, stationName: this.stationList[this.selectStationIndex].name, stationId: this.stationList[this.selectStationIndex].id, group: this.group };
|
||||
if (this.projectDevice) {
|
||||
query.projectDevice = this.$route.query.projectDevice;
|
||||
query.type = this.$route.query.type;
|
||||
}
|
||||
this.$router.push({ path: `/displayIscs/system/config/${item.children[0].type}`, query: query });
|
||||
}
|
||||
}
|
||||
},
|
||||
selectChildren(item, index) { // 选择子菜单
|
||||
this.selectChildIndex = index;
|
||||
this.type = item.type;
|
||||
this.$router.push({ path: `/displayIscs/system/config/${item.type}`, query: {currentSystem: this.currentSystem, stationName: this.stationList[this.selectStationIndex].name, stationId: this.stationList[this.selectStationIndex].id, group: this.group } });
|
||||
const query = {currentSystem: this.currentSystem, stationName: this.stationList[this.selectStationIndex].name, stationId: this.stationList[this.selectStationIndex].id, group: this.group };
|
||||
if (this.projectDevice) {
|
||||
query.projectDevice = this.$route.query.projectDevice;
|
||||
query.type = this.$route.query.type;
|
||||
}
|
||||
this.$router.push({ path: `/displayIscs/system/config/${item.type}`, query: query });
|
||||
},
|
||||
selectStation(item, index) { // 选择子菜单
|
||||
this.selectStationIndex = index;
|
||||
if (!this.type) {
|
||||
this.type = this.$route.params.mode;
|
||||
}
|
||||
this.$router.push({ path: `/displayIscs/system/config/${this.type}`, query: {currentSystem: this.currentSystem, stationName: this.stationList[this.selectStationIndex].name, stationId: this.stationList[this.selectStationIndex].id, group: this.group } });
|
||||
const query = {currentSystem: this.currentSystem, stationName: this.stationList[this.selectStationIndex].name, stationId: this.stationList[this.selectStationIndex].id, group: this.group };
|
||||
if (this.projectDevice) {
|
||||
query.projectDevice = this.$route.query.projectDevice;
|
||||
query.type = this.$route.query.type;
|
||||
}
|
||||
this.$router.push({ path: `/displayIscs/system/config/${this.type}`, query: query });
|
||||
},
|
||||
back() {
|
||||
this.$router.push({ path: `/trainingPlatform` });
|
||||
if (this.projectDevice) {
|
||||
this.$store.dispatch('LogOut').then(() => {
|
||||
location.reload();
|
||||
});
|
||||
} else {
|
||||
this.$router.push({ path: `/trainingPlatform` });
|
||||
}
|
||||
},
|
||||
changeCurrentSystem() {
|
||||
this.$router.push({
|
||||
|
@ -22,7 +22,7 @@
|
||||
</template>
|
||||
<script>
|
||||
import { Notification } from 'element-ui';
|
||||
import ChatBox from '@/views/newMap/jointTrainingNew/chatView/chatBox';
|
||||
import ChatBox from '@/views/newMap/jointTrainingNew/newChatView/chatBox';
|
||||
import {setPlaySpeed, startPlaying, playingPause, endPlaying, fromPauseToPlay} from '@/api/competition';
|
||||
export default {
|
||||
name:'MenuPlay',
|
||||
|
@ -188,7 +188,8 @@ export default {
|
||||
Stand: [],
|
||||
Station: [],
|
||||
ControlConvertMenu: [],
|
||||
TrainWindow: []
|
||||
TrainWindow: [],
|
||||
LimitControl: []
|
||||
};
|
||||
let val;
|
||||
for ( val in CMD['Switch']) {
|
||||
@ -206,6 +207,9 @@ export default {
|
||||
for ( val in CMD['Station']) {
|
||||
this.trainingOperateTypeMap['Station'].push(CMD['Station'][val]);
|
||||
}
|
||||
for ( val in CMD['LimitControl']) {
|
||||
this.trainingOperateTypeMap['LimitControl'].push(CMD['LimitControl'][val]);
|
||||
}
|
||||
for ( val in CMD['ControlConvertMenu']) {
|
||||
this.trainingOperateTypeMap['ControlConvertMenu'].push(CMD['ControlConvertMenu'][val]);
|
||||
}
|
||||
@ -228,7 +232,8 @@ export default {
|
||||
Stand: [],
|
||||
Station: [],
|
||||
ControlConvertMenu: [],
|
||||
TrainWindow: []
|
||||
TrainWindow: [],
|
||||
LimitControl: []
|
||||
};
|
||||
if (res && res.code === 200) {
|
||||
res.data.forEach(item => {
|
||||
|
@ -170,7 +170,8 @@ export default {
|
||||
Stand: [],
|
||||
Station: [],
|
||||
ControlConvertMenu: [],
|
||||
TrainWindow: []
|
||||
TrainWindow: [],
|
||||
LimitControl: []
|
||||
};
|
||||
let val;
|
||||
for ( val in CMD['Switch']) {
|
||||
@ -188,6 +189,9 @@ export default {
|
||||
for ( val in CMD['Station']) {
|
||||
this.trainingOperateTypeMap['Station'].push(CMD['Station'][val]);
|
||||
}
|
||||
for ( val in CMD['LimitControl']) {
|
||||
this.trainingOperateTypeMap['LimitControl'].push(CMD['LimitControl'][val]);
|
||||
}
|
||||
for ( val in CMD['ControlConvertMenu']) {
|
||||
this.trainingOperateTypeMap['ControlConvertMenu'].push(CMD['ControlConvertMenu'][val]);
|
||||
}
|
||||
|
@ -1,421 +0,0 @@
|
||||
<template>
|
||||
<div class="login-container" :style="{'background-image': 'url('+bgImg+')'}">
|
||||
<div class="text-box">
|
||||
<img class="logo" :src="logoImg" style="width: 140px">
|
||||
<span>{{ title }}</span>
|
||||
</div>
|
||||
<div class="language_box">
|
||||
<el-tooltip effect="dark" :content="this.$t('login.clickSwitchLanguage')" placement="bottom-end">
|
||||
<el-button class="language_btn" type="text" @click="handleLanguage">{{ language }}</el-button>
|
||||
</el-tooltip>
|
||||
</div>
|
||||
<div class="content-box">
|
||||
<el-form ref="loginForm" class="login-form" :model="loginForm" :rules="loginRules" label-position="left">
|
||||
<el-form-item prop="username" class="item_form_box">
|
||||
<span class="svg-container svg-container_login">
|
||||
<svg-icon icon-class="user" />
|
||||
</span>
|
||||
<el-input v-model="loginForm.username" name="username" type="text" :placeholder="this.$t('login.accountName')" @keyup.enter.native="goToNext" />
|
||||
</el-form-item>
|
||||
<el-form-item prop="password" class="item_form_box item_form_password">
|
||||
<span class="svg-container">
|
||||
<svg-icon icon-class="password" />
|
||||
</span>
|
||||
<el-input
|
||||
ref="password"
|
||||
v-model="loginForm.password"
|
||||
name="password"
|
||||
:type="pwdType"
|
||||
:placeholder="this.$t('login.password')"
|
||||
@keyup.enter.native="handleLogin"
|
||||
/>
|
||||
<span class="show-pwd" @click="showPwd">
|
||||
<svg-icon v-if="pwdDisplay" icon-class="eye" />
|
||||
<svg-icon v-else icon-class="eye-open" />
|
||||
</span>
|
||||
</el-form-item>
|
||||
<div class="tip-message">{{ tipsMsg }}</div>
|
||||
<div style="display: inline-block;width: 100%;margin-bottom: 10px;">
|
||||
<div style="display:inline-block">
|
||||
<el-checkbox v-model="isAutoLogin">{{ $t('login.autoLogin') }}</el-checkbox>
|
||||
</div>
|
||||
<el-popover
|
||||
placement="right"
|
||||
title=""
|
||||
width="200"
|
||||
trigger="hover"
|
||||
class="popover_box"
|
||||
>
|
||||
<div>
|
||||
<img :src="QCode" alt="" style="width: 100px; height: 100px; display: block; margin:0 auto;">
|
||||
<div style="margin-top: 10px; word-break: break-word;text-align: center;">{{ $t('login.perfectInformation') }}</div>
|
||||
</div>
|
||||
<!--<div slot="reference">{{ $t('login.unableToLogin') }}</div>-->
|
||||
</el-popover>
|
||||
</div>
|
||||
<el-form-item>
|
||||
<el-button type="primary" style="width:100%;" :loading="loading" @click.native.prevent="handleLogin">
|
||||
{{ $t('login.login') }}
|
||||
</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import QCode from '@/assets/erCode.jpg';
|
||||
import { setSessionStorage, removeSessionStorage } from '@/utils/auth';
|
||||
import Cookies from 'js-cookie';
|
||||
import md5 from 'js-md5';
|
||||
import { UrlConfig } from '@/scripts/ConstDic';
|
||||
import { loginInfo, ProjectIcon } from '@/scripts/ProjectConfig';
|
||||
import { removeToken } from '@/utils/auth';
|
||||
import LangStorage from '@/utils/lang';
|
||||
import logoImgHyd from '@/assets/project_icon/logo_hyd.png';
|
||||
export default {
|
||||
name: 'Login',
|
||||
data() {
|
||||
const validateUsername = (rule, value, callback) => {
|
||||
if (value.length < 5) {
|
||||
callback(new Error(this.$t('login.enterTheCorrectUserName')));
|
||||
} else {
|
||||
callback();
|
||||
}
|
||||
};
|
||||
const validatePass = (rule, value, callback) => {
|
||||
if (value.length < 5) {
|
||||
callback(new Error(this.$t('login.passwordHint')));
|
||||
} else {
|
||||
callback();
|
||||
}
|
||||
};
|
||||
return {
|
||||
bgImg: '',
|
||||
QCode: QCode,
|
||||
isAutoLogin: false,
|
||||
loginForm: {
|
||||
username: '',
|
||||
password: ''
|
||||
},
|
||||
loginRules: {
|
||||
username: [{ required: true, trigger: 'blur', validator: validateUsername }],
|
||||
password: [{ required: true, trigger: 'blur', validator: validatePass }]
|
||||
},
|
||||
loading: false,
|
||||
pwdType: 'password',
|
||||
tipsMsg: '',
|
||||
qrcodeClassName: 'login-qrcode',
|
||||
sessionId: '',
|
||||
loginUrl: '',
|
||||
loadingCode: false,
|
||||
checkLogin: null,
|
||||
checkTimeout: null,
|
||||
scanSuccess: false,
|
||||
pwdDisplay: true,
|
||||
cookiesName: 'UserName',
|
||||
cookiesToken: 'UserToken',
|
||||
modelType: 'class',
|
||||
loginClient: 'LianKeTang',
|
||||
path: '/trainingPlatform',
|
||||
lang: 'zh',
|
||||
language: '中文',
|
||||
logoImg: logoImgHyd,
|
||||
title: ''
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
project() {
|
||||
return this.$route.path.split('/')[1];
|
||||
}
|
||||
},
|
||||
created() {
|
||||
document.querySelector("link[rel*='icon']").href = ProjectIcon['hyd'];
|
||||
this.computedAttribute();
|
||||
if (Cookies.get(this.cookiesName) && Cookies.get(this.cookiesToken)) {
|
||||
const model = {'username': Cookies.get(this.cookiesName), 'password': Cookies.get(this.cookiesToken)};
|
||||
model.type = this.modelType;
|
||||
this.$store.dispatch('Login', model).then(() => {
|
||||
this.$store.dispatch('SetAccount', model.username);
|
||||
this.handleLoginSucessRoute();
|
||||
}).catch(error => {
|
||||
if (error.code === '30001') {
|
||||
this.tipsMsg = this.$t('login.accountOrPasswordIsIncorrect');
|
||||
} else {
|
||||
this.tipsMsg = error.message;
|
||||
}
|
||||
this.loading = false;
|
||||
setTimeout(() => { this.tipsMsg = ''; }, 5000);
|
||||
});
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
if (this.project.startsWith('design')) {
|
||||
this.title = loginInfo['designhyd'].title;
|
||||
} else {
|
||||
this.title = loginInfo['hyd'].title;
|
||||
}
|
||||
document.title = this.title;
|
||||
},
|
||||
methods: {
|
||||
computedAttribute() {
|
||||
let sessionVal = 'hyd';
|
||||
if (this.project.startsWith('design')) {
|
||||
this.cookiesName = 'UserDesignName';
|
||||
this.cookiesToken = 'UserDesignToken';
|
||||
this.modelType = 'design';
|
||||
this.loginClient = 'Design';
|
||||
this.path = UrlConfig.design.prefix;
|
||||
sessionVal = 'designhyd';
|
||||
}
|
||||
|
||||
const nowLang = LangStorage.getLang('zh');
|
||||
if (nowLang === 'zh') {
|
||||
this.lang = 'en';
|
||||
this.language = 'English';
|
||||
}
|
||||
|
||||
removeToken();
|
||||
|
||||
setSessionStorage('project', sessionVal);
|
||||
},
|
||||
clearTimer(timer) {
|
||||
if (timer) {
|
||||
clearTimeout(timer);
|
||||
timer = null;
|
||||
}
|
||||
},
|
||||
showPwd() {
|
||||
if (this.pwdType === 'password') {
|
||||
this.pwdDisplay = false;
|
||||
this.pwdType = '';
|
||||
} else {
|
||||
this.pwdType = 'password';
|
||||
this.pwdDisplay = true;
|
||||
}
|
||||
},
|
||||
goToNext() {
|
||||
if (this.loginForm.username.length < 5) {
|
||||
return;
|
||||
} else {
|
||||
this.$refs['password'].focus();
|
||||
}
|
||||
},
|
||||
handleLogin() {
|
||||
this.$refs.loginForm.validate(valid => {
|
||||
if (valid) {
|
||||
const model = Object.assign({}, this.loginForm);
|
||||
model.password = md5(model.password);
|
||||
model.project = loginInfo[this.project].loginParam;
|
||||
model.type = this.modelType;
|
||||
this.loading = true;
|
||||
if (this.isAutoLogin) {
|
||||
Cookies.set(this.cookiesName, model.username, { expires: 2});
|
||||
Cookies.set(this.cookiesToken, model.password, { expires: 2});
|
||||
}
|
||||
console.log(model, '111111111111');
|
||||
this.$store.dispatch('Login', model).then(() => {
|
||||
this.$store.dispatch('SetAccount', model.username);
|
||||
this.handleLoginSucessRoute();
|
||||
}).catch(error => {
|
||||
if (error.code === '30001') {
|
||||
this.tipsMsg = this.$t('login.accountOrPasswordIsIncorrect');
|
||||
} else {
|
||||
this.tipsMsg = error.message;
|
||||
}
|
||||
this.loading = false;
|
||||
setTimeout(() => { this.tipsMsg = ''; }, 5000);
|
||||
});
|
||||
} else {
|
||||
console.log('error submit!!');
|
||||
return false;
|
||||
}
|
||||
});
|
||||
},
|
||||
handleLoginSucessRoute() {
|
||||
// 设置路由
|
||||
this.loading = false;
|
||||
this.tipsMsg = '';
|
||||
removeSessionStorage('againEnter');
|
||||
console.log(this.path);
|
||||
this.$router.push({ path: this.path });
|
||||
},
|
||||
handleLanguage() {
|
||||
this.$i18n.locale = this.lang;
|
||||
LangStorage.setLang(this.lang);
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style rel="stylesheet/scss" lang="scss">
|
||||
$bg:#fff;
|
||||
$light_gray:#eee;
|
||||
|
||||
.login-container {
|
||||
background: #E4EAEA;
|
||||
.el-form-item{
|
||||
background: #fff !important;
|
||||
border: 1px solid rgba(0, 0, 0, 0.1) !important;
|
||||
.el-input {
|
||||
height: 40px;
|
||||
width: 85%;
|
||||
background: #fff;
|
||||
input {
|
||||
background: #fff !important;
|
||||
border: 0px;
|
||||
-webkit-appearance: none;
|
||||
border-radius: 0px;
|
||||
padding: 8px 9px 7px 5px;
|
||||
color: #000;
|
||||
height: 100%;
|
||||
|
||||
&:-webkit-autofill {
|
||||
box-shadow: 0 0 0px 1000px $bg inset !important;
|
||||
-webkit-text-fill-color: #000 !important;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.item_form_box {
|
||||
border: 1px solid #ccc;
|
||||
border-radius: 5px;
|
||||
color: #454545;
|
||||
}
|
||||
|
||||
.item_form_password{
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
.tip-message {
|
||||
color: #F56C61;
|
||||
padding: 5px;
|
||||
font-size: 12px;
|
||||
height: 23px;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
$bg:#f0f0f0;
|
||||
$qrbg:#fff;
|
||||
$dark_gray:#889aa4;
|
||||
$light_gray:#eee;
|
||||
$qrcodeSize: 270px;
|
||||
.popover_box {
|
||||
position: absolute;
|
||||
right: 80px;
|
||||
bottom: 106px;
|
||||
cursor: pointer;
|
||||
color: #225592;
|
||||
font-size: 14px;
|
||||
}
|
||||
.login-container {
|
||||
position: fixed;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
background-repeat: no-repeat;
|
||||
background-origin: border-box;
|
||||
background-size: 100% 100%;
|
||||
.content-box{
|
||||
width: 450px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
background: #fff;
|
||||
padding: 30px 30px 30px;
|
||||
margin-bottom: 20px;
|
||||
box-sizing: border-box;
|
||||
position: relative;
|
||||
}
|
||||
.text-box{
|
||||
position: absolute;
|
||||
top: 10%;
|
||||
font-size: 40px;
|
||||
font-weight: bold;
|
||||
}
|
||||
.logo{
|
||||
vertical-align: middle;
|
||||
}
|
||||
.language_box{
|
||||
position: absolute;
|
||||
top: 20px;
|
||||
right: 40px;
|
||||
.language_btn{
|
||||
/*font-weight: bold;*/
|
||||
cursor: pointer;
|
||||
font-size: 18px;
|
||||
}
|
||||
}
|
||||
.login-form {
|
||||
width: 440px;
|
||||
padding: 0 50px;
|
||||
}
|
||||
|
||||
.svg-container {
|
||||
padding-left: 14px;
|
||||
color: $dark_gray;
|
||||
vertical-align: middle;
|
||||
width: 30px;
|
||||
display: inline-block;
|
||||
|
||||
&_login {
|
||||
font-size: 16px;
|
||||
}
|
||||
}
|
||||
|
||||
.title_box {
|
||||
font-size: 20px;
|
||||
color: #000;
|
||||
margin: 0px auto 30px auto;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.show-pwd {
|
||||
position: absolute;
|
||||
right: 10px;
|
||||
top: 3px;
|
||||
font-size: 16px;
|
||||
color: $dark_gray;
|
||||
cursor: pointer;
|
||||
user-select: none;
|
||||
}
|
||||
}
|
||||
|
||||
.qrcode-main{
|
||||
width: 300px;
|
||||
background-color: $qrbg;
|
||||
text-align: center;
|
||||
border-right: 1px solid #ececec;
|
||||
.tip-info {
|
||||
text-align: left;
|
||||
display: inline-block;
|
||||
color: green;
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
.login-code-box{
|
||||
width: 150px;
|
||||
margin: 0 auto;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.system-type {
|
||||
margin: 5px 0;
|
||||
display: block;
|
||||
}
|
||||
|
||||
.sub-title {
|
||||
font-size: 16px;
|
||||
text-align: center;
|
||||
color: #353535;
|
||||
line-height: 30px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
@ -1,28 +1,28 @@
|
||||
<template>
|
||||
<div
|
||||
v-loading="ibpDevice && !loadingCode"
|
||||
v-loading="syncLogin && !loadingCode"
|
||||
class="login-container"
|
||||
:style="{'background-image': 'url('+bgImg+')'}"
|
||||
element-loading-spinner="el-icon-loading"
|
||||
element-loading-text="检测主工作站登录中"
|
||||
element-loading-background="rgba(0, 0, 0, 0)"
|
||||
>
|
||||
<el-button v-if="ibpDevice && loadingCode" type="text" style="font-size: 24px;font-weight: bold;" @click="loginRefresh">主工作站未登录,点击重新检测</el-button>
|
||||
<div v-if="loginTitle && !ibpDevice" class="left-logo-box">
|
||||
<img class="logo" :src="logoImg" :style="{width: loginTitle==='jyd'?'300px':'60px'}">
|
||||
<span>{{ loginTitle==='jyd'?'':loginTitle }}</span>
|
||||
<el-button v-if="syncLogin && loadingCode" type="text" style="font-size: 24px;font-weight: bold;" @click="loginRefresh">主工作站未登录,点击重新检测</el-button>
|
||||
<div v-if="loginTitle && !syncLogin" :class="$route.query.project=='hyd'?'text-box':'left-logo-box'">
|
||||
<img class="logo" :src="logoImg" :style="{width: logoWidth}">
|
||||
<span>{{ loginTitle==='空串'?'':loginTitle }}</span>
|
||||
</div>
|
||||
<div v-if="isProject && !ibpDevice" class="text-box">
|
||||
<div v-if="isProject && !syncLogin" class="text-box">
|
||||
<img v-if="!loginTitle" class="logo" :src="logoImg" style="width: 80px">
|
||||
<span>{{ title }}</span>
|
||||
</div>
|
||||
<div v-if="!ibpDevice" class="language_box">
|
||||
<div v-if="!syncLogin" class="language_box">
|
||||
<el-tooltip effect="dark" :content="this.$t('login.clickSwitchLanguage')" placement="bottom-end">
|
||||
<el-button class="language_btn" type="text" @click="handleLanguage">{{ language }}</el-button>
|
||||
</el-tooltip>
|
||||
</div>
|
||||
<div v-if="!ibpDevice" class="content-box">
|
||||
<div class="qrcode-main">
|
||||
<div v-if="!syncLogin" class="content-box" :style="$route.query.project=='hyd'?'width: 450px;':''">
|
||||
<div v-if="$route.query.project!='hyd'" class="qrcode-main">
|
||||
<div class="login-code-box" @click="loginRefresh">
|
||||
<qrcode-vue
|
||||
v-loading="loadingCode"
|
||||
@ -37,7 +37,7 @@
|
||||
<div class="login-tip">
|
||||
<span class="sub-title">{{ $t('login.scanCodeLogin') }}</span>
|
||||
</div>
|
||||
<div v-if="project !== 'hyd'" class="tip-info">
|
||||
<div class="tip-info">
|
||||
<fieldset>
|
||||
<legend>{{ $t('login.recommendedConfiguration') }}</legend>
|
||||
<span>{{ $t('login.browser') }}
|
||||
@ -49,7 +49,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<el-form ref="loginForm" class="login-form" :model="loginForm" :rules="loginRules" label-position="left">
|
||||
<div v-if="!isProject" class="title_box">{{ $t('login.welcomeTo') + title }}</div>
|
||||
<div v-if="!isProject&&$route.query.project!='hyd'" class="title_box">{{ $t('login.welcomeTo') + title }}</div>
|
||||
<el-form-item prop="username" class="item_form_box">
|
||||
<span class="svg-container svg-container_login">
|
||||
<svg-icon icon-class="user" />
|
||||
@ -110,16 +110,18 @@ import { setSessionStorage, removeSessionStorage } from '@/utils/auth';
|
||||
import Cookies from 'js-cookie';
|
||||
import md5 from 'js-md5';
|
||||
import QrcodeVue from 'qrcode.vue';
|
||||
import { getLoginWmurl, checkLoginStatus } from '@/api/login';
|
||||
import { getLoginWmurl, checkLoginStatus, getLoginInfo } from '@/api/login';
|
||||
import { LoginParams } from '@/utils/login';
|
||||
import bgImg from '@/assets/bg1.jpg';
|
||||
import bgIbpImg from '@/assets/bg_ibp.png';
|
||||
import { UrlConfig } from '@/scripts/ConstDic';
|
||||
import { loginInfo, ProjectIcon, GenerateRouteProjectList, VersionBaseNoShow, MainBodyNoShow} from '@/scripts/ProjectConfig';
|
||||
import { removeToken } from '@/utils/auth';
|
||||
import { removeToken, getToken } from '@/utils/auth';
|
||||
import LangStorage from '@/utils/lang';
|
||||
import FloatPart from './floatPart';
|
||||
import { getIsSignUp } from '@/api/competition';
|
||||
import { getSimulationInfoNew } from '@/api/simulation';
|
||||
import { getSessionStorage } from '@/utils/auth';
|
||||
|
||||
export default {
|
||||
name: 'Login',
|
||||
@ -175,39 +177,56 @@ export default {
|
||||
language: '中文',
|
||||
versionBaseNoShow: VersionBaseNoShow,
|
||||
mainBodyNoShow: MainBodyNoShow
|
||||
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
project() {
|
||||
return this.$route.path.split('/')[1];
|
||||
const project = this.$route.query.project;
|
||||
const split = this.$route.path.split('/')[1];
|
||||
if (split == 'design') {
|
||||
return project ? split + project : split;
|
||||
} else if (split == 'login') {
|
||||
return project || 'login';
|
||||
} else {
|
||||
return split;
|
||||
}
|
||||
},
|
||||
loginTitle () {
|
||||
return loginInfo[this.$route.path.split('/')[1]].loginTitle;
|
||||
// this.$route.path.split('/')[1]
|
||||
return loginInfo[this.project].loginTitle;
|
||||
},
|
||||
title() {
|
||||
return loginInfo[this.$route.path.split('/')[1]].title;
|
||||
return loginInfo[this.project].title;
|
||||
},
|
||||
logoWidth() {
|
||||
return loginInfo[this.project].logoWidth;
|
||||
},
|
||||
isProject() {
|
||||
const projectName = this.$route.path.split('/')[1];
|
||||
const projectName = this.project;
|
||||
return GenerateRouteProjectList.includes(projectName);
|
||||
},
|
||||
logoImg() {
|
||||
const projectName = this.$route.path.split('/')[1];
|
||||
const projectName = this.project;
|
||||
return ProjectIcon[projectName];
|
||||
},
|
||||
bgImg() {
|
||||
return this.$route.query.ibpDevice ? bgIbpImg : bgImg;
|
||||
const bgImgAll = this.$route.query.project == 'hyd' ? '' : bgImg;
|
||||
const synchronousLogin = ['IBP', 'LSW', 'CCTV', 'ISCS_LW', 'ISCS_CW', 'VR_PSD'];
|
||||
return synchronousLogin.includes(this.$route.query.type) ? bgIbpImg : bgImgAll;
|
||||
},
|
||||
ibpDevice() {
|
||||
return this.$route.query.ibpDevice;
|
||||
syncLogin() {
|
||||
const synchronousLogin = ['IBP', 'LSW', 'CCTV', 'ISCS_LW', 'ISCS_CW', 'VR_PSD'];
|
||||
if (this.$route.query.type) {
|
||||
return synchronousLogin.includes(this.$route.query.type);
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
document.querySelector("link[rel*='icon']").href = loginInfo[this.project].linkIcon || ProjectIcon[this.project];
|
||||
this.computedAttribute();
|
||||
if (this.$route.query.projectDevice) {
|
||||
|
||||
}
|
||||
if (Cookies.get(this.cookiesName) && Cookies.get(this.cookiesToken)) {
|
||||
const model = {'username': Cookies.get(this.cookiesName), 'password': Cookies.get(this.cookiesToken), 'project':loginInfo[this.project].loginParam};
|
||||
model.type = this.modelType;
|
||||
@ -217,6 +236,8 @@ export default {
|
||||
}).catch(error => {
|
||||
if (error.code === '30001') {
|
||||
this.tipsMsg = this.$t('login.accountOrPasswordIsIncorrect');
|
||||
} else if (error.code == '10001') {
|
||||
this.tipsMsg = '教研机尚未登录,请稍后重试!';
|
||||
} else {
|
||||
this.tipsMsg = error.message;
|
||||
}
|
||||
@ -224,13 +245,12 @@ export default {
|
||||
setTimeout(() => { this.tipsMsg = ''; }, 5000);
|
||||
});
|
||||
}
|
||||
if (this.project === 'hyd') {
|
||||
this.bgImg = '';
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
document.title = loginInfo[this.project].browserTitle || loginInfo[this.project].title;
|
||||
this.loginRefresh();
|
||||
if (this.syncLogin || this.$route.query.project != 'hyd') {
|
||||
this.loginRefresh();
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
computedAttribute() {
|
||||
@ -288,7 +308,6 @@ export default {
|
||||
if (this && this._isDestroyed) {
|
||||
return;
|
||||
}
|
||||
|
||||
// 清空已存在的定时器
|
||||
// 设置定时器检测
|
||||
this.clearTimer(this.checkLogin);
|
||||
@ -332,6 +351,7 @@ export default {
|
||||
const model = Object.assign({}, this.loginForm);
|
||||
model.password = md5(model.password);
|
||||
model.type = this.modelType;
|
||||
model.project = loginInfo[this.project].loginParam;
|
||||
model.deviceCode = this.$route.query.projectDevice;
|
||||
this.loading = true;
|
||||
if (this.isAutoLogin) {
|
||||
@ -344,6 +364,8 @@ export default {
|
||||
}).catch(error => {
|
||||
if (error.code === '30001') {
|
||||
this.tipsMsg = this.$t('login.accountOrPasswordIsIncorrect');
|
||||
} else if (error.code == '10001') {
|
||||
this.tipsMsg = '教研机尚未登录,请稍后重试!';
|
||||
} else {
|
||||
this.tipsMsg = error.message;
|
||||
}
|
||||
@ -378,8 +400,33 @@ export default {
|
||||
this.$router.push({ path: this.path, query:{ raceId:this.$route.query.raceId } });
|
||||
}
|
||||
} else if (this.$route.query.projectDevice) {
|
||||
const query = { group: '', drawWay: true };
|
||||
this.$router.push({ path: `/trainroom`, query: query });
|
||||
getLoginInfo(getToken()).then(res => {
|
||||
getSimulationInfoNew(res.data.group).then(resp => {
|
||||
const query = { group: res.data.group, drawWay: true, mapId: resp.data.map.id, lineCode:resp.data.map.lineCode, projectDevice: this.$route.query.projectDevice };
|
||||
if (this.syncLogin) {
|
||||
query.type = this.$route.query.type;
|
||||
}
|
||||
console.log(res.data);
|
||||
setSessionStorage('projectDevice', JSON.stringify(res.data.deviceVO));
|
||||
if (this.$route.query.type == 'LSW') {
|
||||
console.log('进入', `/bigSplitScreen/${resp.data.map.id}`);
|
||||
this.$router.push({ path: `/bigSplitScreen/${resp.data.map.id}`, query: query });
|
||||
} else if (this.$route.query.type === 'ISCS_LW') {
|
||||
this.$router.push({ path: `/displayIscs/system`, query: query });
|
||||
} else if (this.$route.query.type == 'CCTV') {
|
||||
this.$router.push({ path: `/jlmap3d/passengerflow`, query:{
|
||||
mapid:resp.data.map.id,
|
||||
group:res.data.group,
|
||||
project: getSessionStorage('project')
|
||||
} });
|
||||
} else if (this.$route.query.type == 'VR_PSD') {
|
||||
// 待添加
|
||||
// this.$router.push({ path: `/bigSplitScreen/${resp.data.map.id}`, query: query });
|
||||
} else {
|
||||
this.$router.push({ path: `/jointTrainingNew`, query: query });
|
||||
}
|
||||
});
|
||||
});
|
||||
} else if (!this.$route.path.includes('jsxt/login') && !this.$route.path.includes('refereeJsxt/login')) {
|
||||
this.$router.push({ path: this.path });
|
||||
} else {
|
||||
|
@ -81,7 +81,6 @@ export default {
|
||||
async simulationError() {
|
||||
await this.$store.dispatch('map/clearJlmapTrainView');
|
||||
await this.$store.dispatch('map/setTrainWindowShow', false);
|
||||
await this.$store.dispatch('socket/setSimulationError');
|
||||
await this.$store.dispatch('training/setMapDefaultState');
|
||||
this.clearSubscribe();
|
||||
this.$confirm(this.$t('tip.getMapStateDataException'), this.$t('tip.hint'), {
|
||||
|
@ -102,6 +102,9 @@ export default {
|
||||
methods:{
|
||||
deviceSelect(em) {
|
||||
if (this.field.toUpperCase() === 'targetActive'.toUpperCase()) {
|
||||
if (em._type == 'Station') {
|
||||
em = this.$store.getters['map/getDeviceByCode'](em.zcCode);
|
||||
}
|
||||
this.faultRule.targetDeviceType = this.covertType(em._type);
|
||||
this.faultRule.targetDeviceCode = em.code;
|
||||
if (em._type.toUpperCase() === 'Section'.toUpperCase() && em.parentName) {
|
||||
@ -138,6 +141,7 @@ export default {
|
||||
case 'Signal':return 'SIGNAL';
|
||||
case 'Switch':return 'SWITCH';
|
||||
case 'Station':return 'STATION';
|
||||
case 'ZcControl':return 'ZC';
|
||||
case 'StationStand':return 'STAND';
|
||||
case 'Train':return 'TRAIN';
|
||||
}
|
||||
|
@ -53,8 +53,6 @@
|
||||
<script>
|
||||
import Cookies from 'js-cookie';
|
||||
import ConstConfig from '@/scripts/ConstConfig';
|
||||
// getDraftScriptByGroupNew
|
||||
// import {getScriptMemberDataNew } from '@/api/simulation';
|
||||
import {getScriptPageListOnlineNew, getDraftScriptByGroupNew, getScriptByIdNew } from '@/api/script';
|
||||
|
||||
// 剧本弹窗
|
||||
|
@ -7,9 +7,14 @@
|
||||
<el-card class="triggerFaultInfo">
|
||||
<div class="triggerFaultTitle">待触发故障信息</div>
|
||||
<div v-if="simulationFault.id" class="triggerFaultList">
|
||||
触发条件: {{ getTriangleInfo(simulationFault) }}<br>
|
||||
故障设备: {{ deviceMap[simulationFault.targetDeviceType]+formatNameByCode(simulationFault.targetDeviceCode) }}<br>
|
||||
故障类型: {{ covertFaultType(simulationFault) }}
|
||||
<div class="triggerFaultListLeft">
|
||||
触发条件: {{ getTriangleInfo(simulationFault) }}<br>
|
||||
故障设备: {{ deviceMap[simulationFault.targetDeviceType]+formatNameByCode(simulationFault.targetDeviceCode) }}<br>
|
||||
故障类型: {{ covertFaultType(simulationFault) }}
|
||||
</div>
|
||||
<div class="triggerFaultBtn">
|
||||
<el-button type="primary" size="medium" @click="cancleAutoFault">取消自动故障</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</el-card>
|
||||
<div class="card">
|
||||
@ -192,6 +197,7 @@ export default {
|
||||
case 'SIGNAL':return 'Signal';
|
||||
case 'SWITCH':return 'Switch';
|
||||
case 'STATION':return 'Station';
|
||||
case 'ZC':return 'ZcControl';
|
||||
case 'STAND':return 'StationStand';
|
||||
case 'TRAIN':return 'Train';
|
||||
}
|
||||
@ -199,7 +205,8 @@ export default {
|
||||
covertFaultType(row) {
|
||||
let faultType = '';
|
||||
if (row && row.id) {
|
||||
const currentList = deviceFaultType[this.covertType(row.targetDeviceType)];
|
||||
const type = this.covertType(row.targetDeviceType);
|
||||
const currentList = deviceFaultType[type];
|
||||
currentList.forEach(temp=>{
|
||||
if (temp.value === row.faultType) {
|
||||
faultType = temp.label;
|
||||
@ -224,9 +231,12 @@ export default {
|
||||
},
|
||||
getSimulationFaultRules() {
|
||||
getSimulationFaultRules(this.group).then(res=>{
|
||||
this.simulationFault = {};
|
||||
if (res.data) {
|
||||
this.simulationFault = res.data;
|
||||
}
|
||||
}).catch(error=>{
|
||||
this.$messageBox('获取待触发故障失败:' + error.message);
|
||||
});
|
||||
},
|
||||
doShow() {
|
||||
@ -270,14 +280,23 @@ export default {
|
||||
// row['loading' + idx] = true;
|
||||
setFailureModeNew(faultModel, this.group).then(() => {
|
||||
this.getSimulationFaultRules();
|
||||
this.$message.success(this.$t('display.faultChoose.setFaultSuccess'));
|
||||
this.$message.success('设置自动故障成功');
|
||||
}).catch(() => {
|
||||
this.$messageBox(this.$t('display.faultChoose.setFaultFail'));
|
||||
this.$messageBox('设置自动故障失败');
|
||||
});
|
||||
},
|
||||
reloadTable() {
|
||||
this.queryList.reload();
|
||||
},
|
||||
cancleAutoFault() {
|
||||
const faultModel = {auto:false};
|
||||
setFailureModeNew(faultModel, this.group).then(() => {
|
||||
this.getSimulationFaultRules();
|
||||
this.$message.success('取消自动故障成功');
|
||||
}).catch(() => {
|
||||
this.$messageBox('取消自动故障失败');
|
||||
});
|
||||
},
|
||||
dragEvent() {
|
||||
const offset = this.offset;
|
||||
const dialogHeaderEl = document.querySelector('.falutChooseTitle');
|
||||
@ -353,7 +372,11 @@ export default {
|
||||
#faultChoose .el-button--mini {
|
||||
margin-left: 5px;
|
||||
}
|
||||
|
||||
.triggerFaultListLeft{
|
||||
display: inline-block;
|
||||
float: left;
|
||||
width: 730px;
|
||||
}
|
||||
// 谷歌、safari、qq浏览器、360浏览器滚动条样式
|
||||
// 定义滚动条高宽及背景 高宽分别对应横竖滚动条的尺寸
|
||||
#faultChoose .el-table__body-wrapper::-webkit-scrollbar {
|
||||
|
@ -108,7 +108,7 @@ import MenuPractice from '@/views/newMap/displayNew/menuPractice';
|
||||
import Jl3dDrive from '@/views/jlmap3d/drive/jl3ddrive';
|
||||
import Jl3dDevice from '@/views/jlmap3d/device/jl3ddevice';
|
||||
import Scheduling from './demon/scheduling';
|
||||
import { clearSimulation, getSimulationInfoNew} from '@/api/simulation';
|
||||
import { clearSimulation, getSimulationInfoNew, getSimulationMemberList, getAllSimulationUser} from '@/api/simulation';
|
||||
import { getTrainingDetailNew } from '@/api/jmap/training';
|
||||
// loadScriptNew, , scriptExecuteNew
|
||||
import { mapGetters } from 'vuex';
|
||||
@ -342,6 +342,7 @@ export default {
|
||||
}
|
||||
this.checkLoginLineTimer();
|
||||
this.checkMouseStatusTimer();
|
||||
this.initMemberUserInfo();
|
||||
} catch (error) {
|
||||
this.$messageBox(`初始化失败: ${error.message}`);
|
||||
this.endViewLoading();
|
||||
@ -385,6 +386,18 @@ export default {
|
||||
this.endViewLoading();
|
||||
}
|
||||
},
|
||||
initMemberUserInfo() {
|
||||
getSimulationMemberList(this.$route.query.group).then(resp => {
|
||||
this.$store.dispatch('training/setMemberList', {memberList:resp.data, userId: this.$store.state.user.id});
|
||||
}).catch(() => {
|
||||
this.$messageBox('获取仿真成员列表失败!');
|
||||
});
|
||||
getAllSimulationUser(this.$route.query.group).then(resp => {
|
||||
this.$store.dispatch('training/setSimulationUserList', resp.data);
|
||||
}).catch(() => {
|
||||
this.$messageBox('获取所有仿真用户失败!');
|
||||
});
|
||||
},
|
||||
// 加载实操地图数据
|
||||
async initPracticeData() {
|
||||
this.$store.dispatch('training/end', TrainingMode.NORMAL);
|
||||
|
@ -35,7 +35,7 @@
|
||||
<!-- 单人仿真 -->
|
||||
<script>
|
||||
import SetTime from './demon/setTime';
|
||||
import ChatBox from './chatView/chatBox';
|
||||
import ChatBox from '../jointTrainingNew/newChatView/chatBox';
|
||||
import { Notification } from 'element-ui';
|
||||
import { getGoodsTryUse } from '@/api/management/goods';
|
||||
import { ranAsPlan, exitRunPlan, clearSimulation, getSimulationInfoNew } from '@/api/simulation';
|
||||
|
@ -205,7 +205,6 @@ export default {
|
||||
async selectQuest(row, id, mapLocation, roleName) {
|
||||
try {
|
||||
let res;
|
||||
debugger;
|
||||
if (this.isDesignPlatform) {
|
||||
res = this.drawWay ? await loadDraftScriptNew(id, this.group) : await loadDraftScript(row.id, id, this.group);
|
||||
} else {
|
||||
|
@ -1,9 +1,9 @@
|
||||
<template>
|
||||
<div class="jlmap-canvas" :style="{ width: width+'px', height: height+'px' }" @mousemove="mousemove">
|
||||
<div ref="jlmapCanvas" class="jlmap-canvas" :style="{ width: width+'px', height: height+'px' }" @mousemove="mousemove">
|
||||
<div v-show="maskOpen" class="mask" />
|
||||
<div :id="canvasId" style="background: #000;" class="display_canvas" />
|
||||
<progress-bar ref="progressBar" />
|
||||
<zoom-box v-if="!isScreen" :scale-rate="dataZoom.scaleRate" @setShrink="setShrink" @setMagnify="setMagnify" />
|
||||
<zoom-box v-if="!showZoom && !isScreen" :scale-rate="dataZoom.scaleRate" @setShrink="setShrink" @setMagnify="setMagnify" />
|
||||
<show-mode v-show="isDesign" :local-station-show="localStationShow" @setShowMode="setShowMode" />
|
||||
<switch-station v-show="isDesign && (showMode === '03') && localStationShow" ref="switchStation" :concentration-station-list="concentrationStationList" @setShowStation="setShowStation" />
|
||||
<div v-if="show && !isScreen" class="zoom-view" :style="{ width: width +'px'}">
|
||||
@ -95,6 +95,9 @@ export default {
|
||||
}
|
||||
return false;
|
||||
},
|
||||
showZoom() {
|
||||
return this.$route.path.includes('bigSplitScreen');
|
||||
},
|
||||
isScreen() {
|
||||
return this.$route.path.includes('displayBigScreen') || this.$route.path.includes('bigScreen') || this.$store.state.training.prdType === '07';
|
||||
},
|
||||
@ -446,6 +449,9 @@ export default {
|
||||
});
|
||||
this.$jlmap.updateShowStation(list, stationCode);
|
||||
!isTraining && this.setCenter(stationCode);
|
||||
},
|
||||
setOffset(data, num, sum) {
|
||||
this.$jlmap.switchScreen(data, num, sum);
|
||||
}
|
||||
}
|
||||
};
|
||||
@ -469,6 +475,7 @@ export default {
|
||||
-webkit-user-select: none;
|
||||
-ms-user-select: none;
|
||||
user-select: none;
|
||||
background: #000;
|
||||
}
|
||||
.title{
|
||||
text-align: right;
|
||||
|
@ -1,506 +0,0 @@
|
||||
<template>
|
||||
<!-- v-quickMenuDrag -->
|
||||
<div class="chatBox" :style="{'bottom':bottom+'px'}">
|
||||
<div v-show="!minimize" class="chat-box">
|
||||
<chat-member-list v-if="project!='refereeJsxt'|| IsAnswering" ref="chatMemberList" :group="group" :current-coversition="currentCoversition" />
|
||||
<div class="chat-box-main">
|
||||
<chat-coversition-list ref="chatCoversitionList" :user-role="userRole" @hideAddCoversition="hideAddCoversition" @setCurrentCoversition="setCurrentCoversition" @setHeadTitle="setHeadTitle" />
|
||||
<div class="chat-window">
|
||||
<div class="chat-box-header">
|
||||
<div class="chat-box-header-title">{{ headerTitle }}</div>
|
||||
<div class="minimality" @click="handleMinimality('min')">
|
||||
<i class="el-icon-remove" />
|
||||
</div>
|
||||
<div v-show="currentCoversition.all==undefined?true&&isShow:currentCoversition.all&&isShow" class="chat-createGroup" @click="handleCreateGroup()">
|
||||
<i class="el-icon-plus" style="font-weight: bolder;" />
|
||||
</div>
|
||||
<div class="chat-setting" @click="handleSetting()">
|
||||
<i class="el-icon-s-tools" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="chat-box-content">
|
||||
<chat-content ref="chatContent" :project="project" :is-answering="IsAnswering" :current-coversition="currentCoversition" @changeCoversition="changeCoversition" />
|
||||
<div v-if="recordSending" class="chat_record_tip">
|
||||
<div id="record_progress_bar" :style="'width:'+100/60*seconds+'%'" />
|
||||
<div class="record_icon" />
|
||||
<div class="record_tip_text">正在录音...</div>
|
||||
<div class="record_tip_confirm" @click="stopRecording()">确定</div>
|
||||
<div class="record_tip_cancle" @click="cancleRecording()">取消</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="chat-box-footer">
|
||||
<div class="chat-box-footer-tool" />
|
||||
<el-button v-if="isButtonShow" size="mini" type="danger" class="chat-box-footer-quit" :loading="quitLoading" @click="quitCoversition()">退出群聊</el-button>
|
||||
<el-button v-if="currentCoversition.all||isButtonShow" class="chat-box-footer-send" size="mini" type="primary" :disabled="recordSending" @click="startRecording()">发送语音</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div v-show="minimize" class="reminder-drag minimize-box">
|
||||
<div class="chat-title">聊天窗口</div>
|
||||
<div class="minimality" @click="handleMinimality('max')">
|
||||
<i class="el-icon-circle-plus" />
|
||||
</div>
|
||||
</div>
|
||||
<chat-setting ref="chatSetting" :form="form" @setSetting="setSetting" />
|
||||
<chat-create-group ref="createGroup" :group="group" @addCoversition="addCoversition" />
|
||||
<chat-tooltip :group="group" @getCoversitionList="getCoversitionList" />
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import ChatSetting from './chatSetting';
|
||||
import ChatContent from './chatContent';
|
||||
import ChatMemberList from './chatMemberList';
|
||||
import ChatCoversitionList from './chatCoversitionList';
|
||||
import ChatCreateGroup from './chatCreateGroup';
|
||||
import ChatTooltip from './chatTooltip';
|
||||
import RecordRTC from 'recordrtc';
|
||||
import {uploadAudioFileNew, quitCoversition} from '@/api/chat';
|
||||
import { getSessionStorage } from '@/utils/auth';
|
||||
export default {
|
||||
name: 'ChatBox',
|
||||
components:{
|
||||
ChatSetting,
|
||||
ChatContent,
|
||||
ChatMemberList,
|
||||
ChatCoversitionList,
|
||||
ChatCreateGroup,
|
||||
ChatTooltip
|
||||
},
|
||||
props: {
|
||||
group: {
|
||||
type: String,
|
||||
required: true
|
||||
},
|
||||
userRole: {
|
||||
type: String,
|
||||
required: true
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
minimize:true,
|
||||
bottom:15,
|
||||
recordSending:false,
|
||||
currentCoversition:{},
|
||||
seconds:0,
|
||||
inter:null,
|
||||
recorders: null,
|
||||
microphone:null,
|
||||
isHasCoversition:false,
|
||||
quitLoading:false,
|
||||
form:{
|
||||
language:'zh',
|
||||
sex:'1'
|
||||
},
|
||||
headerTitle:''
|
||||
};
|
||||
},
|
||||
computed:{
|
||||
isShow() {
|
||||
return this.userRole != 'ADMIN' && this.userRole != 'AUDIENCE' && !this.isHasCoversition;
|
||||
},
|
||||
isButtonShow() {
|
||||
return this.userRole != 'ADMIN' && this.userRole != 'AUDIENCE' && this.isHasCoversition;
|
||||
},
|
||||
project() {
|
||||
return getSessionStorage('project');
|
||||
},
|
||||
IsAnswering() {
|
||||
return !(this.$route.path.includes('refereeJsxtDisplay'));
|
||||
}
|
||||
},
|
||||
watch:{
|
||||
'$store.state.map.mapViewLoadedCount':function(val) {
|
||||
const object = document.querySelector('.menuButton');
|
||||
if (object) {
|
||||
const objectBottom = parseInt(object.style.bottom) || 0;
|
||||
this.bottom = this.bottom + object.offsetHeight + objectBottom;
|
||||
}
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.initPage();
|
||||
},
|
||||
methods:{
|
||||
async initPage() {
|
||||
},
|
||||
handleMinimality(data) {
|
||||
if (data == 'min') {
|
||||
this.minimize = true;
|
||||
this.$refs.chatSetting.doClose();
|
||||
this.$refs.createGroup.doClose();
|
||||
} else {
|
||||
this.minimize = false;
|
||||
}
|
||||
},
|
||||
setSetting(data) {
|
||||
this.form = data;
|
||||
},
|
||||
getCoversitionList() {
|
||||
this.$refs.chatCoversitionList.initPage(false);
|
||||
},
|
||||
setCurrentCoversition(coversition) {
|
||||
if (coversition && coversition.id) {
|
||||
this.currentCoversition = coversition;
|
||||
this.headerTitle = coversition.name;
|
||||
} else {
|
||||
this.headerTitle = '';
|
||||
}
|
||||
if (this.recordSending) {
|
||||
this.cancleRecording();
|
||||
}
|
||||
this.$refs.chatContent.scrollTop();
|
||||
},
|
||||
setHeadTitle(headerTitle) {
|
||||
this.headerTitle = headerTitle;
|
||||
},
|
||||
hideAddCoversition() {
|
||||
this.isHasCoversition = true;
|
||||
},
|
||||
quitCoversition() {
|
||||
this.quitLoading = true;
|
||||
quitCoversition(this.group, this.currentCoversition.id).then(res=>{
|
||||
this.currentCoversition = {all:undefined, id:null};
|
||||
this.$refs.chatCoversitionList.initPage(true);
|
||||
this.isHasCoversition = false;
|
||||
this.quitLoading = false;
|
||||
}).catch(error=>{
|
||||
this.$messageBox('退出会话失败: ' + error.message);
|
||||
this.quitLoading = false;
|
||||
});
|
||||
},
|
||||
addCoversition({data, headerTitle}) {
|
||||
this.$refs.chatCoversitionList.addCoversition(data);
|
||||
this.isHasCoversition = true;
|
||||
this.currentCoversition = {id:data.id, all:data.all};
|
||||
this.headerTitle = headerTitle;
|
||||
},
|
||||
// 语音录制开始
|
||||
startRecording() {
|
||||
const that = this;
|
||||
if (!this.recordSending && !this.recorders && !this.microphone) {
|
||||
this.$refs.chatSetting.doClose();
|
||||
const StereoAudioRecorder = RecordRTC.StereoAudioRecorder;
|
||||
navigator.getUserMedia(
|
||||
{ audio: true } // 只启用音频
|
||||
, function (stream) {
|
||||
that.microphone = stream;
|
||||
that.recorders = new RecordRTC(that.microphone, {
|
||||
type: 'audio',
|
||||
recorderType: StereoAudioRecorder,
|
||||
numberOfAudioChannels: 1,
|
||||
bitsPerSecond:256000,
|
||||
desiredSampRate: 16000
|
||||
});
|
||||
that.recorders.startRecording();
|
||||
that.recordSending = true;
|
||||
that.inter = setInterval(() => {
|
||||
if (that.seconds < 60) {
|
||||
that.seconds++;
|
||||
} else {
|
||||
clearInterval(that.inter);
|
||||
}
|
||||
}, 1000);
|
||||
}, function (error) {
|
||||
switch (error.code || error.name) {
|
||||
case 'PERMISSION_DENIED':
|
||||
case 'PermissionDeniedError':
|
||||
that.$message({
|
||||
showClose: true,
|
||||
message: '用户拒绝提供信息',
|
||||
type: 'error'
|
||||
});
|
||||
break;
|
||||
case 'NOT_SUPPORTED_ERROR':
|
||||
case 'NotSupportedError':
|
||||
that.$message({
|
||||
showClose: true,
|
||||
message: '浏览器不支持硬件设备',
|
||||
type: 'error'
|
||||
});
|
||||
break;
|
||||
case 'MANDATORY_UNSATISFIED_ERROR':
|
||||
case 'MandatoryUnsatisfiedError':
|
||||
that.$message({
|
||||
showClose: true,
|
||||
message: '无法发现指定的硬件设备',
|
||||
type: 'error'
|
||||
});
|
||||
break;
|
||||
default:
|
||||
that.$message({
|
||||
showClose: true,
|
||||
message: '无法打开麦克风',
|
||||
type: 'error'
|
||||
});
|
||||
break;
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
},
|
||||
cancleRecording() {
|
||||
if (this.microphone) {
|
||||
clearInterval(this.inter);
|
||||
this.seconds = 0;
|
||||
this.microphone.stop();
|
||||
this.microphone = null;
|
||||
this.recordSending = false;
|
||||
this.recorders = null;
|
||||
}
|
||||
},
|
||||
// 停止录制
|
||||
stopRecording() {
|
||||
const that = this;
|
||||
this.recorders.stopRecording(function(blobURL) {
|
||||
clearInterval(that.inter);
|
||||
that.seconds = 0;
|
||||
const blob = that.recorders.getBlob();
|
||||
const fd = new FormData();
|
||||
fd.append('file', blob);
|
||||
uploadAudioFileNew(that.group, that.form.language, that.form.sex, that.currentCoversition.id, fd)
|
||||
.then((data) => {
|
||||
})
|
||||
.catch(error => {
|
||||
console.log(error);
|
||||
});
|
||||
if (that.microphone) {
|
||||
that.microphone.stop();
|
||||
that.microphone = null;
|
||||
that.recordSending = false;
|
||||
that.recorders = null;
|
||||
}
|
||||
});
|
||||
},
|
||||
changeCoversition(data) {
|
||||
this.$refs.chatCoversitionList.changeCoversitionOther(data);
|
||||
},
|
||||
handleSetting() {
|
||||
this.$refs.chatSetting.doShow();
|
||||
},
|
||||
handleCreateGroup() {
|
||||
this.$refs.createGroup.doShow();
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.chatBox{
|
||||
width: 503px;
|
||||
// height: 400px;
|
||||
position: absolute;
|
||||
padding-left:5px;
|
||||
left: 0;
|
||||
bottom:28px;
|
||||
z-index:9;
|
||||
}
|
||||
.chat-box{
|
||||
width: 100%;
|
||||
height: 400px;
|
||||
}
|
||||
.chat-box-header{
|
||||
width: 100%;
|
||||
height: 40px;
|
||||
border-bottom: 1px #dedede solid;
|
||||
}
|
||||
.chat-box-header-title{
|
||||
font-size: 15px;
|
||||
margin-left: 15px;
|
||||
display: inline-block;
|
||||
margin-top: 10px;
|
||||
width: 70%;
|
||||
overflow: hidden;
|
||||
white-space: nowrap;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
.chat-box-content{
|
||||
width: 100%;
|
||||
height: 300px;
|
||||
border-bottom: 1px #dedede solid;
|
||||
position: relative;
|
||||
}
|
||||
.chat-box-contentTip{
|
||||
|
||||
}
|
||||
.chat-box-footer{
|
||||
display: inline-block;
|
||||
width: 100%;
|
||||
}
|
||||
.chat-window{
|
||||
display: inline-block;
|
||||
width: 400px;
|
||||
}
|
||||
.chat-setting{
|
||||
float: right;
|
||||
line-height: 40px;
|
||||
margin-right: 10px;
|
||||
cursor: pointer;
|
||||
font-size: 16px;
|
||||
}
|
||||
.chat-createGroup{
|
||||
float: right;
|
||||
line-height: 40px;
|
||||
margin-right: 10px;
|
||||
cursor: pointer;
|
||||
font-size: 16px;
|
||||
position: relative;
|
||||
}
|
||||
.chat-box-footer-tool{
|
||||
width: 100%;
|
||||
height: 30px;
|
||||
}
|
||||
.chat-box-footer-send{
|
||||
background: #36a2fd;
|
||||
width: 65px;
|
||||
font-size: 12px;
|
||||
padding: 5px 0px 4px 0px;
|
||||
text-align: center;
|
||||
border-radius: 3px;
|
||||
color: #fff;
|
||||
float: right;
|
||||
margin-right: 10px;
|
||||
margin-bottom: 10px;
|
||||
cursor: pointer;
|
||||
}
|
||||
.minimality {
|
||||
float: right;
|
||||
line-height: 40px;
|
||||
margin-right: 10px;
|
||||
cursor: pointer;
|
||||
font-size:16px;
|
||||
}
|
||||
.chat-box-main{
|
||||
position: absolute;
|
||||
width: 100%;
|
||||
left: 0;
|
||||
height: 100%;
|
||||
top: 0;
|
||||
border-right: 1px #dedede solid;
|
||||
z-index: 4;
|
||||
background: #fff;
|
||||
border-radius: 5px;
|
||||
left:5px;
|
||||
font-size:0;
|
||||
}
|
||||
.chat-coversition{
|
||||
|
||||
}
|
||||
.coversition-list{
|
||||
|
||||
}
|
||||
.chat-box-footer-quit{
|
||||
background: red;
|
||||
width: 65px;
|
||||
font-size: 12px;
|
||||
padding: 5px 0px 4px 0px;
|
||||
text-align: center;
|
||||
border-radius: 3px;
|
||||
color: #fff;
|
||||
float: left;
|
||||
margin-left: 10px;
|
||||
margin-bottom: 10px;
|
||||
cursor: pointer;
|
||||
}
|
||||
.showMembers{
|
||||
float: right;
|
||||
line-height: 40px;
|
||||
margin-right: 10px;
|
||||
cursor: pointer;
|
||||
font-size: 17px;
|
||||
}
|
||||
#record_progress_bar{
|
||||
height: 100%;
|
||||
position: absolute;
|
||||
background: #bbe5f5;
|
||||
}
|
||||
.chat_record_tip{
|
||||
height: 28px;
|
||||
display: inline-block;
|
||||
background: #dfe6ee;
|
||||
width: 100%;
|
||||
font-size: 13px;
|
||||
border-top: 1px #d8dce5 solid;
|
||||
position: absolute;
|
||||
bottom: 0;
|
||||
right: 0;
|
||||
}
|
||||
.record_icon{
|
||||
display: inline-block;
|
||||
width: 8px;
|
||||
height: 8px;
|
||||
background: #25d825;
|
||||
border-radius: 10px;
|
||||
left: 7px;
|
||||
margin-right: 0px;
|
||||
box-shadow: -1px 0px 3px #6d6d6d;
|
||||
border: 1px #28d228 solid;
|
||||
position: absolute;
|
||||
top: 10px;
|
||||
}
|
||||
.record_tip_text{
|
||||
display: inline-block;
|
||||
font-size: 12px;
|
||||
margin-left: 3px;
|
||||
// padding: 8px 0px 6px 0px;
|
||||
position: absolute;
|
||||
top: 8px;
|
||||
left:20px
|
||||
}
|
||||
.record_tip_confirm{
|
||||
position: absolute;
|
||||
right: 63px;
|
||||
padding: 3px 0px 2px 0px;
|
||||
border: 1px #a2a5aa solid;
|
||||
border-radius: 5px;
|
||||
width: 45px;
|
||||
text-align: center;
|
||||
font-size: 12px;
|
||||
top: 4px;
|
||||
background: #eeeeee;
|
||||
cursor: pointer;
|
||||
}
|
||||
.record_tip_cancle{
|
||||
position: absolute;
|
||||
right: 10px;
|
||||
padding: 3px 0px 2px 0px;
|
||||
border: 1px #a2a5aa solid;
|
||||
border-radius: 5px;
|
||||
width: 45px;
|
||||
text-align: center;
|
||||
font-size: 12px;
|
||||
top: 4px;
|
||||
background: #eeeeee;
|
||||
cursor: pointer;
|
||||
}
|
||||
.chat-box-footer-send.disbled{
|
||||
cursor: no-drop;
|
||||
}
|
||||
|
||||
.minimize-box {
|
||||
width: 97.5%;
|
||||
height: 40px;
|
||||
position: absolute;
|
||||
left: 5px;
|
||||
bottom: 0;
|
||||
z-index: 222;
|
||||
background: #fff;
|
||||
border-radius: 5px;
|
||||
|
||||
.chat-title {
|
||||
float: left;
|
||||
font-size: 15px;
|
||||
margin-left: 10px;
|
||||
line-height: 40px;
|
||||
}
|
||||
|
||||
.minimality {
|
||||
float: right;
|
||||
height: 40px;
|
||||
line-height: 40px;
|
||||
margin-right: 10px;
|
||||
cursor: pointer;
|
||||
}
|
||||
}
|
||||
|
||||
</style>
|
@ -1,172 +0,0 @@
|
||||
<template>
|
||||
<div class="chat-coversition">
|
||||
<div id="coversition-list-name" />
|
||||
<div class="coversition-list">
|
||||
<div
|
||||
v-for="coversition in coversitionList"
|
||||
:key="coversition.id"
|
||||
:class="coversition.id==currentCoversition.id?'coversition-active each-coversition':'each-coversition'"
|
||||
@click="changeCoversition(coversition)"
|
||||
>
|
||||
<div class="coversitionName">{{ coversition.name }}</div>
|
||||
<!-- <div v-if="!coversition.all" class="el-icon-close closeConversition" @click="closeCoversition(coversition.id)" /> -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import {getSimulationConversationListNew} from '@/api/chat';
|
||||
export default {
|
||||
name:'ChatCoversitionList',
|
||||
props: {
|
||||
userRole: {
|
||||
type: String,
|
||||
required: true
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
coversitionList:[],
|
||||
currentCoversition:{}
|
||||
};
|
||||
},
|
||||
watch:{
|
||||
'userRole':function(val) {
|
||||
this.initPage(true);
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
// this.initPage(true);
|
||||
},
|
||||
methods:{
|
||||
initPage(status) {
|
||||
getSimulationConversationListNew(this.$route.query.group).then(resp=>{
|
||||
if (resp.data) {
|
||||
const data = resp.data;
|
||||
if (this.userRole == 'ADMIN' || this.userRole == 'AUDIENCE') {
|
||||
this.coversitionList = data;
|
||||
} else {
|
||||
this.coversitionList = data.filter(coversition=>{ return coversition.all == false; });
|
||||
if (this.coversitionList.length >= 1) {
|
||||
this.$emit('hideAddCoversition');
|
||||
}
|
||||
}
|
||||
if (resp.data && resp.data.length && resp.data.length > 0 && status) {
|
||||
if (this.userRole == 'ADMIN' || this.userRole == 'AUDIENCE') {
|
||||
this.currentCoversition = data[0];
|
||||
this.$emit('setCurrentCoversition', resp.data[0]);
|
||||
} else {
|
||||
if (this.coversitionList.length >= 1) {
|
||||
this.currentCoversition = data[0];
|
||||
this.$emit('setCurrentCoversition', resp.data[0]);
|
||||
} else {
|
||||
this.currentCoversition = null;
|
||||
this.$emit('setCurrentCoversition', this.currentCoversition);
|
||||
}
|
||||
}
|
||||
} else if (resp.data && resp.data.length && resp.data.length > 0 && !status) {
|
||||
const coversition = data.filter(coversition=>{ return coversition.all == false; });
|
||||
this.currentCoversition = coversition[0];
|
||||
this.$emit('setCurrentCoversition', coversition[0]);
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
addCoversition(data) {
|
||||
const index = this.coversitionList.findIndex(item=>{ return item.id == data.id; });
|
||||
if (index < 0) {
|
||||
this.coversitionList.push(data);
|
||||
this.currentCoversition = data;
|
||||
}
|
||||
},
|
||||
changeCoversition(coversition) {
|
||||
this.$emit('setHeadTitle', coversition.name);
|
||||
this.currentCoversition = {id:coversition.id, all:coversition.all};
|
||||
this.$emit('setCurrentCoversition', coversition);
|
||||
// this.$refs.chatContent.reloadData(this.currentCoversition);
|
||||
},
|
||||
changeCoversitionOther(coversition) {
|
||||
const index = this.coversitionList.findIndex(item=>{ return item.id == coversition.id; });
|
||||
if (index < 0) {
|
||||
this.coversitionList.push(coversition);
|
||||
}
|
||||
this.changeCoversition(coversition);
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.chat-coversition{
|
||||
width: 100px;
|
||||
display: inline-block;
|
||||
border-right: 1px #dedede solid;
|
||||
height: 100%;
|
||||
vertical-align: top;
|
||||
background: #f9f9f9;
|
||||
border-radius: 5px 0px 0px 5px;
|
||||
}
|
||||
.coversition-list{
|
||||
padding: 3px 0px 10px 0px;
|
||||
height: 355px;
|
||||
overflow: auto;
|
||||
margin-top:40px;
|
||||
}
|
||||
.each-coversition{
|
||||
font-size: 14px;
|
||||
padding: 10px 7px 10px 10px;
|
||||
border-bottom: 1px #dedede solid;
|
||||
cursor: pointer;
|
||||
}
|
||||
.coversition-active{
|
||||
background: #e0e0e0;
|
||||
}
|
||||
.coversitionName{
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
display: inline-block;
|
||||
width: 60px;
|
||||
font-size: 14px;
|
||||
}
|
||||
.closeConversition{
|
||||
vertical-align: top;
|
||||
margin-top: 2px;
|
||||
}
|
||||
|
||||
// 谷歌、safari、qq浏览器、360浏览器滚动条样式
|
||||
// 定义滚动条高宽及背景 高宽分别对应横竖滚动条的尺寸
|
||||
.coversition-list::-webkit-scrollbar {
|
||||
width: 6px;
|
||||
height: 6px;
|
||||
// height: 110px;
|
||||
background-color: #FFFFFF;
|
||||
}
|
||||
/*定义滚动条轨道 内阴影+圆角*/
|
||||
.coversition-list::-webkit-scrollbar-track {
|
||||
// box-shadow: inset 0 0 6px rgba(0,0,0,0.3);
|
||||
border-radius: 10px;
|
||||
background-color: #FFFFFF;;
|
||||
}
|
||||
/*定义滑块 内阴影+圆角*/
|
||||
.coversition-list::-webkit-scrollbar-thumb {
|
||||
border-radius: 10px;
|
||||
// box-shadow: inset 0 0 6px rgba(0,0,0,.3);
|
||||
background-color: #cacaca;
|
||||
}
|
||||
/*滑块效果*/
|
||||
.coversition-list::-webkit-scrollbar-thumb:hover {
|
||||
border-radius: 5px;
|
||||
// box-shadow: inset 0 0 5px rgba(0,0,0,0.2);
|
||||
background: rgba(0,0,0,0.4);
|
||||
}
|
||||
/*IE滚动条颜色*/
|
||||
html {
|
||||
scrollbar-face-color:#bfbfbf;/*滚动条颜色*/
|
||||
scrollbar-highlight-color:#000;
|
||||
scrollbar-3dlight-color:#000;
|
||||
scrollbar-darkshadow-color:#000;
|
||||
scrollbar-Shadow-color:#adadad;/*滑块边色*/
|
||||
scrollbar-arrow-color:rgba(0,0,0,0.4);/*箭头颜色*/
|
||||
scrollbar-track-color:#eeeeee;/*背景颜色*/
|
||||
}
|
||||
</style>
|
@ -1,234 +0,0 @@
|
||||
<template>
|
||||
<div v-show="dialogVisible" class="chat-create-group-all">
|
||||
<div class="chat-create-group">
|
||||
<div class="create-group-header">
|
||||
<div class="create-group-title">添加会话对象</div>
|
||||
<div class="create-group-close">
|
||||
<i class="el-icon-close" @click="dialogVisible=false" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="create-group-content">
|
||||
<div class="chat-member-list">
|
||||
<el-checkbox-group v-model="checkList">
|
||||
<el-checkbox
|
||||
v-for="member in memberList"
|
||||
:key="member.id"
|
||||
class="each-chat-member"
|
||||
:label="member"
|
||||
:disabled="member.userId === userId"
|
||||
>{{ member.memberName }}</el-checkbox>
|
||||
</el-checkbox-group>
|
||||
</div>
|
||||
<div class="currentSelectList">
|
||||
<div
|
||||
v-for="member in checkList"
|
||||
:key="member.id"
|
||||
class="eachSelect"
|
||||
>
|
||||
{{ member.memberName }}
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<!-- :style="member.userId === userId ?'color:red':''" -->
|
||||
</div>
|
||||
<div class="create-group-bottom">
|
||||
<el-button :loading="loading" size="small" type="primary" @click="doCreate">创建会话</el-button>
|
||||
<el-button size="small" @click="doClose">取消</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import {getSimulationMembersNew, getSimulationConversationIdNew} from '@/api/chat';
|
||||
import ConstConfig from '@/scripts/ConstConfig';
|
||||
import Cookies from 'js-cookie';
|
||||
export default {
|
||||
name:'ChatCreateGroup',
|
||||
props: {
|
||||
group: {
|
||||
type: String,
|
||||
required: true
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogVisible:false,
|
||||
loading:false,
|
||||
memberList:[],
|
||||
checkList:[]
|
||||
};
|
||||
},
|
||||
computed:{
|
||||
userId() {
|
||||
return this.$store.state.user.id;
|
||||
}
|
||||
},
|
||||
methods:{
|
||||
doShow() {
|
||||
this.getSimulationMembers();
|
||||
this.dialogVisible = true;
|
||||
},
|
||||
getSimulationMembers() {
|
||||
getSimulationMembersNew(this.$route.query.group).then(resp => {
|
||||
let lastData = JSON.stringify(resp.data);
|
||||
const roleTypeList = ConstConfig.ConstSelect.roleTypeNew;
|
||||
roleTypeList.forEach(function(element) {
|
||||
const rolename = element.value;
|
||||
if (Cookies.get('user_lang') == 'en') {
|
||||
lastData = lastData.replace(new RegExp(rolename, 'g'), element.enLabel);
|
||||
} else {
|
||||
lastData = lastData.replace(new RegExp(rolename, 'g'), element.label);
|
||||
}
|
||||
});
|
||||
lastData = JSON.parse(lastData);
|
||||
lastData = lastData.filter(memberIn=>{ return memberIn.role != '观众'; });
|
||||
lastData.map(member=>{
|
||||
const deviceName = member.deviceName ? '-' + member.deviceName : '';
|
||||
const memberName = member.name ? '-' + member.name : '';
|
||||
member.memberName = member.role + deviceName + memberName;
|
||||
return member;
|
||||
});
|
||||
this.memberList = lastData;
|
||||
});
|
||||
},
|
||||
doCreate() {
|
||||
if (this.checkList.length > 0) {
|
||||
this.loading = true;
|
||||
const checkList = this.checkList.map(function(check) { return check.id; });
|
||||
getSimulationConversationIdNew(checkList, this.group).then(resp => {
|
||||
if (resp.data) {
|
||||
const data = resp.data;
|
||||
this.loading = false;
|
||||
this.$emit('addCoversition', {data:data, headerTitle:resp.data.name});
|
||||
this.dialogVisible = false;
|
||||
this.checkList = [];
|
||||
}
|
||||
}).catch(error=>{
|
||||
this.$messageBox('创建会话失败: ' + error.message);
|
||||
this.loading = false;
|
||||
this.dialogVisible = false;
|
||||
this.checkList = [];
|
||||
});
|
||||
}
|
||||
|
||||
},
|
||||
doClose() {
|
||||
this.checkList = [];
|
||||
this.dialogVisible = false;
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.chat-create-group-all{
|
||||
position:absolute;
|
||||
width:100%;
|
||||
height:100%;
|
||||
left:0;
|
||||
top:0;
|
||||
z-index:10;
|
||||
}
|
||||
.chat-create-group{
|
||||
position: absolute;
|
||||
width: 70%;
|
||||
height: 300px;
|
||||
border: 1px #dedede solid;
|
||||
left: 26%;
|
||||
top: 8%;
|
||||
z-index: 7;
|
||||
border-radius: 8px;
|
||||
box-shadow: #b5aeae 0 0 10px;
|
||||
background: #fff;
|
||||
}
|
||||
.create-group-header{
|
||||
padding-left: 10px;
|
||||
padding-top: 6px;
|
||||
font-size: 14px;
|
||||
border-bottom: 1px #dedede solid;
|
||||
padding-bottom: 6px;
|
||||
}
|
||||
.create-group-title{
|
||||
display: inline-block;
|
||||
}
|
||||
.create-group-close{
|
||||
float: right;
|
||||
display: inline-block;
|
||||
margin-right: 5px;
|
||||
font-size: 16px;
|
||||
cursor: pointer;
|
||||
}
|
||||
.chat-member-list{
|
||||
width: 54%;
|
||||
height: 216px;
|
||||
overflow-y: auto;
|
||||
padding: 5px 10px;
|
||||
font-size: 14px;
|
||||
overflow-x: hidden;
|
||||
border-right: 1px #ccc solid;
|
||||
display:inline-block;
|
||||
}
|
||||
.create-group-content{
|
||||
width: 100%;
|
||||
height: 220px;
|
||||
padding-bottom: 10px;
|
||||
border-bottom: 1px #dedede solid;
|
||||
}
|
||||
.create-group-bottom{
|
||||
text-align: center;
|
||||
margin-top:8px;
|
||||
}
|
||||
.each-chat-member{
|
||||
display:block;
|
||||
margin-top:5px;
|
||||
}
|
||||
.currentSelectList{
|
||||
display: inline-block;
|
||||
width: 44%;
|
||||
font-size: 14px;
|
||||
vertical-align: top;
|
||||
padding: 5px 10px;
|
||||
overflow-x: hidden;
|
||||
overflow-y: auto;
|
||||
height: 216px;
|
||||
}
|
||||
.eachSelect{
|
||||
display:block;
|
||||
margin-top:5px;
|
||||
}
|
||||
// 谷歌、safari、qq浏览器、360浏览器滚动条样式
|
||||
// 定义滚动条高宽及背景 高宽分别对应横竖滚动条的尺寸
|
||||
.chat-member-list::-webkit-scrollbar,.currentSelectList::-webkit-scrollbar {
|
||||
width: 6px;
|
||||
height: 6px;
|
||||
// height: 110px;
|
||||
background-color: #FFFFFF;
|
||||
}
|
||||
/*定义滚动条轨道 内阴影+圆角*/
|
||||
.chat-member-list::-webkit-scrollbar-track,.currentSelectList::-webkit-scrollbar-track{
|
||||
// box-shadow: inset 0 0 6px rgba(0,0,0,0.3);
|
||||
border-radius: 10px;
|
||||
background-color: #FFFFFF;;
|
||||
}
|
||||
/*定义滑块 内阴影+圆角*/
|
||||
.chat-member-list::-webkit-scrollbar-thumb,.currentSelectList::-webkit-scrollbar-thumb{
|
||||
border-radius: 10px;
|
||||
// box-shadow: inset 0 0 6px rgba(0,0,0,.3);
|
||||
background-color: #cacaca;
|
||||
}
|
||||
/*滑块效果*/
|
||||
.chat-member-list::-webkit-scrollbar-thumb:hover,.currentSelectList::-webkit-scrollbar-thumb:hover {
|
||||
border-radius: 5px;
|
||||
// box-shadow: inset 0 0 5px rgba(0,0,0,0.2);
|
||||
background: rgba(0,0,0,0.4);
|
||||
}
|
||||
/*IE滚动条颜色*/
|
||||
html {
|
||||
scrollbar-face-color:#bfbfbf;/*滚动条颜色*/
|
||||
scrollbar-highlight-color:#000;
|
||||
scrollbar-3dlight-color:#000;
|
||||
scrollbar-darkshadow-color:#000;
|
||||
scrollbar-Shadow-color:#adadad;/*滑块边色*/
|
||||
scrollbar-arrow-color:rgba(0,0,0,0.4);/*箭头颜色*/
|
||||
scrollbar-track-color:#eeeeee;/*背景颜色*/
|
||||
}
|
||||
</style>
|
@ -13,19 +13,22 @@
|
||||
:group="group"
|
||||
:data-error="dataError"
|
||||
:user-role="userRole"
|
||||
:is-admin="isAdmin"
|
||||
:device-code="deviceCode"
|
||||
:countdown-time="countdownTime"
|
||||
:admin-mode="adminMode"
|
||||
@getUserRole="getUserRole"
|
||||
@hidepanel="hidepanel"
|
||||
@showIbp="showIbp"
|
||||
@startCounting="startCounting"
|
||||
@hidejl3dcctv="hidejl3dcctv"
|
||||
@handlerMemberManage="handlerMemberManage"
|
||||
/>
|
||||
<menu-demon-schema
|
||||
ref="menuSchema"
|
||||
:group="group"
|
||||
:offset="offset"
|
||||
:user-role="userRole"
|
||||
:is-admin="isAdmin"
|
||||
:show-station="showStation"
|
||||
:station-list="stationList"
|
||||
:show-select-station="showSelectStation"
|
||||
@ -34,6 +37,7 @@
|
||||
@runPlanViewShow="runPlanViewShow"
|
||||
@faultChooseShow="faultChooseShow"
|
||||
@switchStationMode="switchStationMode"
|
||||
@changeAdminMode="changeAdminMode"
|
||||
/>
|
||||
<join-fault-choose ref="faultChoose" :group="group" :offset="offset" />
|
||||
<join-run-plan-Load ref="runPlanLoad" :group="group" />
|
||||
@ -41,6 +45,8 @@
|
||||
<menu-system-time ref="menuSystemTime" :offset="offset" :group="group" :right="right" />
|
||||
<menu-train-list v-if="prdType=='02'" @setCenter="setCenter" />
|
||||
<js-question v-if="project==='jsxt'" :offset="offset" :question-list="questionList" />
|
||||
<members-manage ref="membersManage" :is-admin="isAdmin" @addSimulationMember="addSimulationMember" />
|
||||
<add-member ref="addMember" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -61,18 +67,19 @@ import { mapGetters } from 'vuex';
|
||||
import { OperateMode, TrainingMode } from '@/scripts/ConstDic';
|
||||
import { checkLoginLine } from '@/api/login';
|
||||
import { loadNewMapDataByGroup } from '@/utils/loaddata';
|
||||
import { getUserRolesNew, deljointTrainRoomNew} from '@/api/jointTraining';
|
||||
import { clearSimulation, getSimulationInfoNew } from '@/api/simulation';
|
||||
import { clearSimulation, getSimulationInfoNew, getSimulationUserInfo, getSimulationMemberList, getAllSimulationUser } from '@/api/simulation';
|
||||
import {getRaceUserById, getTestPaperDatail} from '@/api/competition';
|
||||
import { getSessionStorage } from '@/utils/auth';
|
||||
import { getSessionStorage, getToken } from '@/utils/auth';
|
||||
import Jl3dDrive from '@/views/jlmap3d/drive/jl3ddrive';
|
||||
import Jl3dMaintainer from '@/views/jlmap3d/maintainer/jl3dmaintainer';
|
||||
import { EventBus } from '@/scripts/event-bus';
|
||||
import ibpData from '@/ibp/constant/ibpData';
|
||||
import { timeFormat } from '@/utils/date';
|
||||
import { Message } from 'element-ui';
|
||||
import Vue from 'vue';
|
||||
import localStore from 'storejs';
|
||||
import MembersManage from './memberManage/membersManage';
|
||||
import AddMember from './memberManage/addMember';
|
||||
import { getLoginInfo } from '@/api/login';
|
||||
|
||||
export default {
|
||||
name: 'JointTrainingDraft',
|
||||
@ -88,7 +95,9 @@ export default {
|
||||
Jl3dDrive,
|
||||
Jl3dMaintainer,
|
||||
IbpPlate,
|
||||
JsQuestion
|
||||
JsQuestion,
|
||||
MembersManage,
|
||||
AddMember
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
@ -120,7 +129,9 @@ export default {
|
||||
practicalTime: 0,
|
||||
countdown: null,
|
||||
questionList: [],
|
||||
practicalExamTime: 0
|
||||
practicalExamTime: 0,
|
||||
isAdmin: false,
|
||||
adminMode: true
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
@ -183,6 +194,10 @@ export default {
|
||||
this.mapBoxP.style.cursor = '';
|
||||
this.mapViewLoadedOver = true;
|
||||
this.showSelectStation && this.setShowStation(this.showStation);
|
||||
this.initMemberUserInfo();
|
||||
},
|
||||
'$store.state.socket.memberChangeCount': function () {
|
||||
this.initMemberUserInfo();
|
||||
},
|
||||
'$store.state.socket.permissionOver': function () {
|
||||
this.$alert(this.$t('tip.userRightsHaveBeenReclaimed'), this.$t('tip.hint'), {
|
||||
@ -191,24 +206,10 @@ export default {
|
||||
callback: async (action) => {
|
||||
await this.$store.dispatch('training/over');
|
||||
await clearSimulation(this.group);
|
||||
await deljointTrainRoomNew(this.group);
|
||||
this.$router.go(-1);
|
||||
}
|
||||
});
|
||||
},
|
||||
'$store.state.socket.jointRoomInfo': function (val) { // 综合演练房间信息
|
||||
if (val.creatorId) {
|
||||
this.handleRoomInfo(val);
|
||||
}
|
||||
},
|
||||
'$store.state.socket.roleList': function (val) { // 综合演练被踢出房间
|
||||
val.forEach(elem => {
|
||||
if (elem.id == this.userId && !elem.userRole) {
|
||||
this.$router.go(-1);
|
||||
this.messageInfo(this.$t('tip.beKickedOut'), 'warning');
|
||||
}
|
||||
});
|
||||
},
|
||||
'$store.state.app.windowSizeCount': function() {
|
||||
this.setWindowSize();
|
||||
},
|
||||
@ -220,6 +221,11 @@ export default {
|
||||
'$store.state.map.map': function (val) {
|
||||
this.showSelectStation = val.skinVO.code === '06' && this.$store.state.training.prdType === '01';
|
||||
this.setStationList(val);
|
||||
},
|
||||
'$store.state.socket.simulationRoleList':function(val) {
|
||||
if (val && val.length) {
|
||||
this.checkRoleChange(val);
|
||||
}
|
||||
}
|
||||
},
|
||||
async created() {
|
||||
@ -248,18 +254,6 @@ export default {
|
||||
mousemove(e) {
|
||||
this.mouseNum = 1;
|
||||
},
|
||||
handleRoomInfo(data) {
|
||||
if (data.state == '03') { // 退出房间
|
||||
this.$router.go(-1);
|
||||
} else if (data.state == '01') { // 进入准备中
|
||||
const query = { group: this.group, lineCode:this.lineCode };
|
||||
if (this.drawWay) {
|
||||
query.drawWay = this.drawWay;
|
||||
}
|
||||
this.$router.replace({ path: `/trainroom`, query: query });
|
||||
}
|
||||
this.$store.dispatch('socket/setJointRoomInfo'); // 清空房间信息
|
||||
},
|
||||
// 清除检查在线定时器
|
||||
clearAllTimer() {
|
||||
if (this.ierval) {
|
||||
@ -354,6 +348,23 @@ export default {
|
||||
this.endViewLoading();
|
||||
}
|
||||
},
|
||||
async initDeviceVo() {
|
||||
// getLoginInfo(getToken()).then(resp => {
|
||||
// this.$store.dispatch('SetProjecteDevice', resp.data.deviceVO);
|
||||
// });
|
||||
},
|
||||
initMemberUserInfo() {
|
||||
getSimulationMemberList(this.$route.query.group).then(resp => {
|
||||
this.$store.dispatch('training/setMemberList', {memberList:resp.data, userId: this.$store.state.user.id});
|
||||
}).catch(() => {
|
||||
this.$messageBox('获取仿真成员列表失败!');
|
||||
});
|
||||
getAllSimulationUser(this.$route.query.group).then(resp => {
|
||||
this.$store.dispatch('training/setSimulationUserList', resp.data);
|
||||
}).catch(() => {
|
||||
this.$messageBox('获取所有仿真用户失败!');
|
||||
});
|
||||
},
|
||||
async loadSimulationInfo() {
|
||||
const resp = await getSimulationInfoNew(this.group);
|
||||
if (resp && resp.code == 200 && resp.data && !resp.data.dataError) {
|
||||
@ -366,24 +377,23 @@ export default {
|
||||
} else {
|
||||
this.$store.dispatch('training/over');
|
||||
}
|
||||
// if (this.isDemon) {
|
||||
// this.$refs.menuDemon.initPlannedDriving(resp.data.planRunning);
|
||||
// } else if (this.isScript) {
|
||||
// this.$refs.menuScript.initPlannedDriving(resp.data.planRunning);
|
||||
// }
|
||||
} else if (resp && resp.code == 200 && resp.data && resp.data.dataError) {
|
||||
this.dataError = true;
|
||||
this.$messageBox('此地图数据正在维护中,无法运行!');
|
||||
}
|
||||
},
|
||||
async getUserRole() {
|
||||
const res = await getUserRolesNew(this.group);
|
||||
const res = await getSimulationUserInfo(this.group);
|
||||
const data = res.data || {};
|
||||
this.userRole = data.userRole;
|
||||
this.userRole = data.role || 'AUDIENCE';
|
||||
this.deviceCode = data.deviceCode;
|
||||
this.ibpPart = data.ibpPart;
|
||||
if (this.userRole === 'IBP') {
|
||||
this.isAdmin = data.admin;
|
||||
|
||||
const deviceVO = this.$store.state.user.projectDevice;
|
||||
if (deviceVO && deviceVO.type === 'IBP') {
|
||||
this.showIbp(this.deviceCode);
|
||||
const config = JSON.parse(deviceVO.config);
|
||||
this.ibpPart = config.part.toLowerCase();
|
||||
} else {
|
||||
this.hideIbp();
|
||||
}
|
||||
@ -421,30 +431,35 @@ export default {
|
||||
resp['code'] = 200;
|
||||
resp.data['userRole'] = 'ADMIN';
|
||||
} else {
|
||||
await this.initDeviceVo();
|
||||
resp = await this.getUserRole();
|
||||
}
|
||||
// console.log('/////////////' + resp.data.userRole);
|
||||
if (resp && resp.code == 200) {
|
||||
// Admin 管理员 Instructor 教员 Dispatcher 行调 STATION_SUPERVISOR 车站 Audience 观众 Driver 司机 MAINTAINER 通号 IBP:IBP盘
|
||||
this.userRole = resp.data.userRole;
|
||||
switch (this.userRole) {
|
||||
case 'ADMIN': this.$store.dispatch('training/setPrdType', '02'); this.$store.dispatch('training/setRoles', 'ADMIN'); this.hideIbp(); break;
|
||||
case 'INSTRUCTOR': this.$store.dispatch('training/setPrdType', '02'); this.$store.dispatch('training/setRoles', 'INSTRUCTOR'); this.hideIbp(); break;
|
||||
case 'DISPATCHER': this.$store.dispatch('training/setPrdType', '02'); this.$store.dispatch('training/setRoles', 'DISPATCHER'); this.hideIbp(); break;
|
||||
case 'STATION_SUPERVISOR': this.$store.dispatch('training/setPrdType', '01'); this.$store.dispatch('training/setRoles', 'STATION_SUPERVISOR'); this.hideIbp(); break;
|
||||
case 'INTERLOCK': this.$store.dispatch('training/setPrdType', '01'); this.$store.dispatch('training/setRoles', 'INTERLOCK'); this.hideIbp(); break;
|
||||
case 'AUDIENCE': this.$store.dispatch('training/setPrdType', ''); this.$store.dispatch('training/setRoles', 'AUDIENCE'); this.hideIbp(); break;
|
||||
case 'DRIVER': this.$store.dispatch('training/setPrdType', ''); this.$store.dispatch('training/setRoles', 'DRIVER'); this.hideIbp(); break;
|
||||
case 'MAINTAINER': this.$store.dispatch('training/setPrdType', ''); this.$store.dispatch('training/setRoles', 'MAINTAINER'); this.hideIbp(); break;
|
||||
case 'IBP': this.$store.dispatch('training/setPrdType', ''); this.$store.dispatch('training/setRoles', 'IBP'); this.showIbp(resp.data.deviceCode); break;
|
||||
case 'BIGSCREEN': this.$store.dispatch('training/setPrdType', ''); this.$store.dispatch('training/setRoles', 'BIGSCREEN'); this.hideIbp(); break;
|
||||
}
|
||||
this.userRole = resp.data.role || 'AUDIENCE';
|
||||
this.setSimulationPrdType();
|
||||
}
|
||||
await this.getTrainDetail();
|
||||
} else {
|
||||
this.endViewLoading();
|
||||
}
|
||||
},
|
||||
// 设置prdType和role
|
||||
setSimulationPrdType(swch) {
|
||||
// Admin 管理员 Dispatcher 行调 STATION_SUPERVISOR 车站 Audience 观众 Driver 司机 MAINTAINER 通号 IBP:IBP盘
|
||||
switch (this.userRole) {
|
||||
// case 'ADMIN': this.$store.dispatch('training/setPrdType', '02'); this.$store.dispatch('training/setRoles', 'ADMIN'); this.hideIbp(); break;
|
||||
case 'DISPATCHER': this.$store.dispatch('training/setPrdType', '02'); this.$store.dispatch('training/setRoles', 'DISPATCHER'); this.hideIbp(); break;
|
||||
case 'STATION_SUPERVISOR': this.$store.dispatch('training/setPrdType', '01'); this.$store.dispatch('training/setRoles', 'STATION_SUPERVISOR'); this.hideIbp(); break;
|
||||
case 'AUDIENCE': this.$store.dispatch('training/setPrdType', ''); this.$store.dispatch('training/setRoles', 'AUDIENCE'); this.hideIbp(); break;
|
||||
case 'DRIVER': this.$store.dispatch('training/setPrdType', ''); this.$store.dispatch('training/setRoles', 'DRIVER'); this.hideIbp(); break;
|
||||
case 'MAINTAINER': this.$store.dispatch('training/setPrdType', ''); this.$store.dispatch('training/setRoles', 'MAINTAINER'); this.hideIbp(); break;
|
||||
}
|
||||
if (this.isAdmin && this.adminMode) {
|
||||
this.$store.dispatch('training/setPrdType', swch || '02');
|
||||
this.$store.dispatch('training/setRoles', 'AUDIENCE');
|
||||
this.hideIbp();
|
||||
}
|
||||
},
|
||||
startCounting() {
|
||||
const storeKey = this.$store.state.user.id + '' + this.$route.query.raceId + 'practical';
|
||||
const startTime = localStore.get(storeKey);
|
||||
@ -515,18 +530,10 @@ export default {
|
||||
this.ibpShow = false;
|
||||
},
|
||||
showIbp(deviceCode) {
|
||||
if (!this.ibpShow) {
|
||||
this.drivingShow = false;
|
||||
this.panelShow = false;
|
||||
this.ibpShow = true;
|
||||
if (!deviceCode || !ibpData[deviceCode]) {
|
||||
Message.warning({message: this.$t('error.ibpNoDraw'), duration: 0, showClose: true, type: 'error'});
|
||||
return;
|
||||
} else {
|
||||
Message.closeAll();
|
||||
}
|
||||
this.$refs.ibpPlate.show(deviceCode, this.ibpPart);
|
||||
}
|
||||
this.drivingShow = false;
|
||||
this.panelShow = false;
|
||||
this.ibpShow = true;
|
||||
this.$refs.ibpPlate.show(deviceCode, this.ibpPart);
|
||||
},
|
||||
hidejl3dcctv() {
|
||||
const routeData = this.$router.resolve({
|
||||
@ -610,23 +617,42 @@ export default {
|
||||
list: this.bigScreenSplitConfig.map(ele => ele.position)
|
||||
};
|
||||
this.$jlmap.off('zoom');
|
||||
this.$jlmap.off('pan');
|
||||
this.$jlmap.setUpdateScreen(size);
|
||||
}
|
||||
},
|
||||
cancelBigScreenMode() {
|
||||
this.$jlmap.on('zoom');
|
||||
this.$jlmap.on('pan');
|
||||
this.$jlmap.setRevoverBigScreen();
|
||||
},
|
||||
handlerMemberManage() {
|
||||
this.$refs.membersManage.doShow();
|
||||
},
|
||||
addSimulationMember() {
|
||||
this.$refs.addMember.doShow();
|
||||
},
|
||||
changeAdminMode(adminMode, swch) {
|
||||
this.adminMode = adminMode;
|
||||
this.setSimulationPrdType(swch);
|
||||
},
|
||||
checkRoleChange(data) {
|
||||
data.forEach(item => {
|
||||
if (item.messageType === 'KICK_OUT' && item.userId == this.userId) {
|
||||
this.$messageBox('您已经被请离房间!');
|
||||
this.$refs.demonMenu.back();
|
||||
} else if (item.messageType === 'PLAY_CHANGE' && item.userId == this.userId) {
|
||||
this.userRole = item.role || 'AUDIENCE';
|
||||
this.setSimulationPrdType();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style>
|
||||
.main {
|
||||
display: block;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
overflow: hidden;
|
||||
}
|
||||
.main {
|
||||
display: block;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
overflow: hidden;
|
||||
}
|
||||
</style>
|
||||
|
80
src/views/newMap/jointTrainingNew/memberManage/addMember.vue
Normal file
80
src/views/newMap/jointTrainingNew/memberManage/addMember.vue
Normal file
@ -0,0 +1,80 @@
|
||||
<template>
|
||||
<el-dialog
|
||||
v-dialogDrag
|
||||
:title="title"
|
||||
:visible.sync="dialogVisible"
|
||||
width="500px"
|
||||
:before-close="handleClose"
|
||||
center
|
||||
:close-on-click-modal="false"
|
||||
>
|
||||
<el-form ref="form" :model="formModel" label-width="120px" :rules="rules">
|
||||
<el-form-item label="添加仿真成员:" prop="role">
|
||||
<el-select v-model="formModel.role" placeholder="请选择" size="small">
|
||||
<el-option
|
||||
v-for="item in typeList"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="doSave">{{ $t('global.confirm') }}</el-button>
|
||||
<el-button @click="handleClose">{{ $t('global.cancel') }}</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { addSimulationMember } from '@/api/jointSimulation';
|
||||
export default {
|
||||
name: 'AddMember',
|
||||
data() {
|
||||
return {
|
||||
dialogVisible: false,
|
||||
formModel: {
|
||||
role: ''
|
||||
},
|
||||
rules: {
|
||||
role: [
|
||||
{ required: true, message: '请选择显示位置', trigger: 'change' }
|
||||
]
|
||||
},
|
||||
typeList: [{label: '行调', value: 'DISPATCHER'}, {label: '通号', value: 'MAINTAINER'}]
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
title() {
|
||||
return '添加仿真角色成员';
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
initData(row) {
|
||||
|
||||
},
|
||||
doShow(row) {
|
||||
this.initData(row);
|
||||
this.dialogVisible = true;
|
||||
},
|
||||
doSave() {
|
||||
this.$refs.form.validate(() => {
|
||||
addSimulationMember(this.formModel, this.$route.query.group).then(() => {
|
||||
this.$message.success('添加仿真角色成员成功!');
|
||||
this.handleClose();
|
||||
}).catch(() => {
|
||||
this.$message.error('添加仿真角色成员失败!');
|
||||
});
|
||||
});
|
||||
},
|
||||
handleClose() {
|
||||
this.dialogVisible = false;
|
||||
this.formModel = {
|
||||
role: ''
|
||||
};
|
||||
this.$refs.form.resetFields();
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
103
src/views/newMap/jointTrainingNew/memberManage/content-menu.vue
Normal file
103
src/views/newMap/jointTrainingNew/memberManage/content-menu.vue
Normal file
@ -0,0 +1,103 @@
|
||||
<template>
|
||||
<div class="jointRoomMenu">
|
||||
<pop-menu ref="popMenu" :menu="menu" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import PopMenu from '@/components/PopMenu';
|
||||
import { DeviceMenu } from '@/scripts/ConstDic';
|
||||
import { kickOutMember } from '@/api/jointSimulation';
|
||||
|
||||
export default {
|
||||
components: {
|
||||
PopMenu
|
||||
},
|
||||
props: {
|
||||
clickUserId: {
|
||||
type: String,
|
||||
default: ''
|
||||
},
|
||||
menuDisabled: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
// menu: [{
|
||||
// label: this.$t('trainRoom.kickOutTheRoom'),
|
||||
// handler: this.kicked
|
||||
// }]
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
userId() {
|
||||
return this.$store.state.user ? this.$store.state.user.id : '';
|
||||
},
|
||||
position() {
|
||||
return this.$store.state.menuOperation.menuPosition;
|
||||
},
|
||||
drawWay() {
|
||||
return this.$route.query.drawWay + '';
|
||||
},
|
||||
menu() {
|
||||
return [{
|
||||
label: this.$t('trainRoom.kickOutTheRoom'),
|
||||
handler: this.kicked,
|
||||
disabled: this.menuDisabled
|
||||
}];
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
'$store.state.menuOperation.menuCount': function (val) {
|
||||
if (this.$store.getters['menuOperation/checkDialogIsOpen'](DeviceMenu.JointRoom)) {
|
||||
this.doShow();
|
||||
} else {
|
||||
this.doClose();
|
||||
}
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.closeEvent();
|
||||
},
|
||||
methods: {
|
||||
closeEvent() {
|
||||
const self = this;
|
||||
window.onclick = function (e) {
|
||||
self.doClose();
|
||||
};
|
||||
},
|
||||
doShow() {
|
||||
this.closeEvent();
|
||||
if (this.userId != this.clickUserId) {
|
||||
if (this.$refs && this.$refs.popMenu) {
|
||||
this.$refs.popMenu.resetShowPosition(this.position);
|
||||
}
|
||||
}
|
||||
},
|
||||
doClose() {
|
||||
if (this.$refs && this.$refs.popMenu) {
|
||||
this.$refs.popMenu.close();
|
||||
}
|
||||
},
|
||||
async kicked() {
|
||||
try {
|
||||
await kickOutMember(this.$route.query.group, this.clickUserId);
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
/deep/ {
|
||||
.menu-item{
|
||||
background: #f1ecec;
|
||||
.pop-menu {
|
||||
background: #5F9EA0;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
142
src/views/newMap/jointTrainingNew/memberManage/e-members.vue
Normal file
142
src/views/newMap/jointTrainingNew/memberManage/e-members.vue
Normal file
@ -0,0 +1,142 @@
|
||||
<template>
|
||||
<div class="member">
|
||||
<div class="member__head">
|
||||
<div class="member__head--title"> 成员列表</div>
|
||||
<div class="member__head--notes"> {{ members.length }}/{{ room.totalNum }}</div>
|
||||
</div>
|
||||
<div class="member__container">
|
||||
<el-input v-model="filterText" :placeholder="this.$t('global.enterNameToFilter')" clearable />
|
||||
<el-scrollbar class="member__container--list" wrap-class="scrollbar-wrapper" :style="{height: treeHeight+'px'}">
|
||||
<el-tree
|
||||
ref="tree"
|
||||
:data="filterMembers"
|
||||
:filter-node-method="handleFilterNode"
|
||||
:lazy="false"
|
||||
:props="defaultProps"
|
||||
@node-contextmenu="handleShowContextMenu"
|
||||
>
|
||||
<span slot-scope="{ node, data }">
|
||||
<span v-if="node.data.online" style="color: green;">{{ data.nickName + (data.admin? '【管理员】':'') + (data.referee? '【裁判员】':'') + (data.deviceVO? ` -- (${data.deviceVO.code})`:'') }}</span>
|
||||
<span v-else style="color: #ccc;">{{ data.nickName + (data.admin? '【管理员】':'') + (data.referee? '【裁判员】':'') + (data.deviceVO? ` -- (${data.deviceVO.code})`:'') }}</span>
|
||||
</span>
|
||||
</el-tree>
|
||||
</el-scrollbar>
|
||||
</div>
|
||||
<content-menu ref="menu" :click-user-id="clickUserId" :menu-disabled="menuDisabled" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { DeviceMenu } from '@/scripts/ConstDic';
|
||||
import ContentMenu from './content-menu';
|
||||
|
||||
export default {
|
||||
components: {
|
||||
ContentMenu
|
||||
},
|
||||
props: {
|
||||
room: {
|
||||
type: Object,
|
||||
required: true
|
||||
},
|
||||
members: {
|
||||
type: Array,
|
||||
required: true
|
||||
},
|
||||
height: {
|
||||
type: Number,
|
||||
required: true
|
||||
},
|
||||
isAdmin: {
|
||||
type: Boolean,
|
||||
default() {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
filterText: '',
|
||||
clickUserId: '',
|
||||
menuDisabled: false
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
defaultProps() {
|
||||
return { label: 'nickName' };
|
||||
},
|
||||
treeHeight() {
|
||||
return this.height - 64;
|
||||
},
|
||||
filterMembers() {
|
||||
return this.members.filter(e =>{ return e.nickName.includes(this.filterText); });
|
||||
},
|
||||
userId() {
|
||||
return this.$store.state.user ? this.$store.state.user.id : '';
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
handleFilterNode(value, data) {
|
||||
if (!value) return true;
|
||||
return data.name.indexOf(value) !== -1;
|
||||
},
|
||||
handleShowContextMenu(e, obj, node, vueElem) {
|
||||
e.preventDefault();
|
||||
const position = {
|
||||
x: e.clientX,
|
||||
y: e.clientY
|
||||
};
|
||||
if (this.isAdmin) {
|
||||
this.clickUserId = `${obj.userId || ''}`;
|
||||
this.menuDisabled = !!obj.deviceVO;
|
||||
this.$store.dispatch('menuOperation/setPopMenu', { position, menu: DeviceMenu.JointRoom });
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.member {
|
||||
background: #f0f0f0;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
border: 1px solid #ccc;
|
||||
|
||||
&__head {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
padding: 0 10px;
|
||||
border-bottom: 1px solid #ccc;
|
||||
|
||||
&--title {
|
||||
padding:10px 0px;
|
||||
font-size: 16px;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
&--notes {
|
||||
font-size: 16px;
|
||||
padding:10px 0px;
|
||||
display: flex;
|
||||
align-items: flex-end;
|
||||
}
|
||||
}
|
||||
|
||||
&__container {
|
||||
flex-grow: 1;
|
||||
&--list {
|
||||
background: #fff;
|
||||
height: auto;
|
||||
min-height: calc(100% - 200px);
|
||||
max-height: calc(100% - 200px);
|
||||
border-bottom: 1px #ccc solid;
|
||||
|
||||
&::-webkit-scrollbar {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
343
src/views/newMap/jointTrainingNew/memberManage/membersManage.vue
Normal file
343
src/views/newMap/jointTrainingNew/memberManage/membersManage.vue
Normal file
@ -0,0 +1,343 @@
|
||||
<template>
|
||||
<el-dialog
|
||||
v-dialogDrag
|
||||
title="仿真成员管理"
|
||||
:visible.sync="show"
|
||||
width="100%"
|
||||
:before-close="doClose"
|
||||
:z-index="2000"
|
||||
:modal="false"
|
||||
fullscreen
|
||||
:close-on-click-modal="false"
|
||||
center
|
||||
>
|
||||
<div class="room">
|
||||
<div class="room__container">
|
||||
<div style="width: 70%;">
|
||||
<div style="margin-left: 10px;margin-right: 10px;">
|
||||
<el-input v-model="queryMember" placeholder="请输入搜索人员">
|
||||
<el-button slot="append" icon="el-icon-search" />
|
||||
</el-input>
|
||||
<el-button @click="addMember">添加仿真成员</el-button>
|
||||
</div>
|
||||
<el-tree
|
||||
ref="tree"
|
||||
:data="treeData"
|
||||
:props="defaultProps"
|
||||
default-expand-all
|
||||
style="margin: 10px;margin-bottom: 0;border: 1px solid #ccc;overflow-y: auto;"
|
||||
:style="{height: height - 35 + 'px'}"
|
||||
:filter-node-method="filterNode"
|
||||
@node-click="handleNodeClick"
|
||||
>
|
||||
<span :id="data.id" slot-scope="{ node, data }" class="custom-tree-node">
|
||||
<span>{{ data.label }}</span>
|
||||
<span v-if="data.role">
|
||||
<el-select :key="data.id" v-model="data.userId" placeholder="请选择" clearable size="mini" @change="nodeMemberChange($event, data)">
|
||||
<el-option
|
||||
v-for="item in simulationUserList"
|
||||
:key="item.userId"
|
||||
:label="item.nickName"
|
||||
:value="item.userId"
|
||||
/>
|
||||
</el-select>
|
||||
</span>
|
||||
</span>
|
||||
</el-tree>
|
||||
</div>
|
||||
<e-members
|
||||
class="room__container--members"
|
||||
:room="room"
|
||||
:members="simulationUserList"
|
||||
:is-admin="isAdmin"
|
||||
:height="height"
|
||||
@message="messageInfo"
|
||||
/>
|
||||
</div>
|
||||
<div class="room__footer" />
|
||||
</div>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import eMembers from './e-members';
|
||||
import { assignUsersPlayRoles } from '@/api/jointSimulation';
|
||||
export default {
|
||||
name: 'MembersManage',
|
||||
components: {
|
||||
eMembers
|
||||
},
|
||||
props: {
|
||||
isAdmin: {
|
||||
type: Boolean,
|
||||
default() {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
show: false,
|
||||
queryMember: '',
|
||||
room: {
|
||||
totalNum: 0,
|
||||
group: '',
|
||||
mapId: '',
|
||||
creatorId: '',
|
||||
creator: {
|
||||
nickName: ''
|
||||
},
|
||||
permissionRest: 0,
|
||||
permissionNum: 0,
|
||||
state: ''
|
||||
},
|
||||
defaultProps: {
|
||||
children: 'children',
|
||||
label: 'label'
|
||||
},
|
||||
simulationUserList: [],
|
||||
stationList: [],
|
||||
availableStationList:[],
|
||||
activeTrains: [],
|
||||
standList: [],
|
||||
doorList: [],
|
||||
memberData: {},
|
||||
treeData: [{
|
||||
label: '行调',
|
||||
type: 'role',
|
||||
children: []
|
||||
}, {
|
||||
label: '车站值班员',
|
||||
type: 'role',
|
||||
children: []
|
||||
}, {
|
||||
label: '司机',
|
||||
type: 'role',
|
||||
children: []
|
||||
}, {
|
||||
label: '通号',
|
||||
children: []
|
||||
}]
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
height() {
|
||||
return this.$store.state.app.height - 130;
|
||||
},
|
||||
group() {
|
||||
return this.$route.query.group;
|
||||
},
|
||||
drawWay() {
|
||||
return this.$route.query.drawWay + '';
|
||||
},
|
||||
userId() {
|
||||
return this.$store.state.user ? this.$store.state.user.id : '';
|
||||
},
|
||||
username() {
|
||||
return this.$store.state.user.nickname;
|
||||
},
|
||||
projectDevice() {
|
||||
return this.$store.state.user.projectDevice;
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
queryMember(val) {
|
||||
this.$refs.tree.filter(val);
|
||||
},
|
||||
'$store.state.socket.simulationRoleList':function(val) {
|
||||
if (val && val.length) {
|
||||
this.handlerMemberOnOff(val);
|
||||
}
|
||||
},
|
||||
'$store.state.training.simulationUserList': function(val) {
|
||||
this.simulationUserList = val;
|
||||
},
|
||||
'$store.state.training.memberList': function (val) {
|
||||
if (val && val.length) {
|
||||
this.memberData = this.$store.state.training.memberData;
|
||||
const dispatcherList = [];
|
||||
const electricDispatcherList = [];
|
||||
const depotDispatcherList = [];
|
||||
const stationSupervisorList = [];
|
||||
const driverList = [];
|
||||
const maintainerList = [];
|
||||
val.forEach(item => {
|
||||
const device = this.$store.getters['map/getDeviceByCode'](item.deviceCode);
|
||||
switch (item.role) {
|
||||
case 'DISPATCHER':
|
||||
this.memberData[item.id].label = '行调' + (dispatcherList.length + 1);
|
||||
dispatcherList.push(this.memberData[item.id]);
|
||||
break;
|
||||
case 'ELECTRIC_DISPATCHER':
|
||||
electricDispatcherList.push(this.memberData[item.id]);
|
||||
break;
|
||||
case 'DEPOT_DISPATCHER':
|
||||
depotDispatcherList.push(this.memberData[item.id]);
|
||||
break;
|
||||
case 'STATION_SUPERVISOR':
|
||||
this.memberData[item.id].label = '值班员-' + device.name;
|
||||
stationSupervisorList.push(this.memberData[item.id]);
|
||||
break;
|
||||
case 'DRIVER':
|
||||
this.memberData[item.id].label = '司机-列车' + item.deviceCode;
|
||||
driverList.push(this.memberData[item.id]);
|
||||
break;
|
||||
case 'MAINTAINER':
|
||||
this.memberData[item.id].label = '通号' + (maintainerList.length + 1);
|
||||
maintainerList.push(this.memberData[item.id]);
|
||||
break;
|
||||
}
|
||||
});
|
||||
this.treeData = [{
|
||||
label: '行调',
|
||||
id: 'dispatcher',
|
||||
type: 'role',
|
||||
children: dispatcherList
|
||||
}, {
|
||||
label: '车站值班员',
|
||||
id: 'stationSupervisor',
|
||||
type: 'role',
|
||||
children: stationSupervisorList
|
||||
}, {
|
||||
label: '司机',
|
||||
id: 'driver',
|
||||
type: 'role',
|
||||
children: driverList
|
||||
}, {
|
||||
label: '通号',
|
||||
id: 'maintainer',
|
||||
type: 'role',
|
||||
children: maintainerList
|
||||
}];
|
||||
}
|
||||
},
|
||||
'$store.state.map.activeTrainListUpdate': function (val) {
|
||||
this.activeTrains = [];
|
||||
const activeTrainList = this.$store.state.map.activeTrainList;
|
||||
if (activeTrainList && activeTrainList.length) {
|
||||
activeTrainList.forEach(train => {
|
||||
this.activeTrains.push(train.groupNumber);
|
||||
});
|
||||
}
|
||||
this.$refs.tree.filter(this.queryMember);
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
},
|
||||
methods: {
|
||||
doShow() {
|
||||
this.show = true;
|
||||
this.memberData = this.$store.state.training.memberData;
|
||||
this.simulationUserList = this.$store.state.training.simulationUserList;
|
||||
this.$nextTick(() => {
|
||||
if (this.$refs.tree) {
|
||||
this.$refs.tree.filter(this.queryMember);
|
||||
}
|
||||
});
|
||||
},
|
||||
doClose() {
|
||||
this.show = false;
|
||||
},
|
||||
messageInfo(info) {
|
||||
this.$message({ showClose: true, ...info });
|
||||
},
|
||||
jumpInSimulation() {
|
||||
},
|
||||
clearSubscribe() {
|
||||
},
|
||||
handleNodeClick() {
|
||||
},
|
||||
nodeMemberChange(val, nodeData) {
|
||||
let user = '';
|
||||
this.simulationUserList.forEach(item => {
|
||||
if (val && item.userId === val) {
|
||||
user = item;
|
||||
} else if (!val && item.memberId === nodeData.id) {
|
||||
user = item;
|
||||
}
|
||||
});
|
||||
const data = [{userId: user.userId, memberId:val ? nodeData.id : ''}];
|
||||
const self = this;
|
||||
assignUsersPlayRoles(data, this.$route.query.group).then(resp => {
|
||||
this.$message.success('调整角色成员成功!');
|
||||
}).catch(() => {
|
||||
self.memberData[nodeData.id].userId = '';
|
||||
this.$message.error('调整角色成员失败!');
|
||||
});
|
||||
},
|
||||
addMember() {
|
||||
this.$emit('addSimulationMember');
|
||||
},
|
||||
filterNode(value, data) {
|
||||
let flag = false;
|
||||
if (this.memberData[data.id] && this.memberData[data.id].nickName) {
|
||||
flag = this.memberData[data.id].nickName.indexOf(value) !== -1;
|
||||
}
|
||||
let driverNoShow = true;
|
||||
if (data.role && data.role === 'DRIVER' && !this.activeTrains.includes(data.deviceCode)) {
|
||||
driverNoShow = false;
|
||||
}
|
||||
return (data.label.indexOf(value) !== -1 || flag) && driverNoShow;
|
||||
},
|
||||
handlerMemberOnOff(data) {
|
||||
this.$store.dispatch('training/updateMemberAndUser', {simulationUserList:data, userId: this.userId});
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.custom-tree-node {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
font-size: 14px;
|
||||
padding-right: 8px;
|
||||
margin: 2px;
|
||||
}
|
||||
.room {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
box-sizing: border-box;
|
||||
background: #f0f0f0;
|
||||
|
||||
&__container {
|
||||
display: flex;
|
||||
flex-grow: 1;
|
||||
padding: 10px;
|
||||
|
||||
&--members {
|
||||
flex-shrink: 1;
|
||||
flex-grow: 1;
|
||||
}
|
||||
|
||||
&--roles {
|
||||
flex-grow: 5;
|
||||
flex-shrink: 5;
|
||||
}
|
||||
|
||||
&--chat {
|
||||
flex-basis: 360px;
|
||||
}
|
||||
}
|
||||
&__footer {
|
||||
height: 20px;
|
||||
}
|
||||
}
|
||||
/deep/ {
|
||||
.el-input--mini .el-input__inner {
|
||||
height: 24px;
|
||||
line-height: 24px;
|
||||
}
|
||||
.el-input-group {
|
||||
width: calc(100% - 146px);
|
||||
}
|
||||
.el-dialog__body {
|
||||
padding: 6px 20px;
|
||||
}
|
||||
}
|
||||
|
||||
</style>
|
@ -3,22 +3,23 @@
|
||||
<chat-box :group="group" :user-role="userRole" />
|
||||
<div class="display-draft" :class="{'display-type-hb': $route.query.lineCode == '07' && $store.state.training.prdType=='01'}">
|
||||
<el-button-group>
|
||||
<el-button v-if="isProject && !dataError " type="primary" @click="setRelDevice">{{ $t('joinTraining.connectRealDevices') }}</el-button>
|
||||
<el-button v-if="isAdmin && adminMode" @click="memberManage">成员管理</el-button>
|
||||
<el-button v-if="isAdmin && adminMode" type="primary" @click="generateQrCode">生成二维码</el-button>
|
||||
<el-button v-if="hasRealDevice && !dataError " type="primary" @click="setRelDevice">{{ $t('joinTraining.connectRealDevices') }}</el-button>
|
||||
<el-button v-if="isDriver && !dataError" type="jumpjlmap3d" @click="jumpjlmap3d">{{ $t('joinTraining.driverPerspective') }}</el-button>
|
||||
<el-button v-if="isStationSupervisor && !dataError" type="jmap3dcctv" @click="jlmap3dcctv">cctv</el-button>
|
||||
<template v-if="isAdmin && project != 'refereeJsxt'">
|
||||
<template v-if="isAdmin && adminMode && project != 'refereeJsxt'">
|
||||
<el-button type="success" :disabled="isDisable || dataError" @click="selectBeginTime">{{ $t('joinTraining.drivingByPlan') }}</el-button>
|
||||
<el-button type="danger" :disabled="dataError" @click="end">{{ $t('joinTraining.initialize') }}</el-button>
|
||||
</template>
|
||||
<!-- <el-button type="primary" :loading="backLoading" @click="back">{{ $t('global.back') }}</el-button> -->
|
||||
</el-button-group>
|
||||
<template v-if="project==='jsxt'">
|
||||
<div style="background: #FFF;display: inline-block;height: 40px;line-height: 40px;padding: 0 5px;border: 2px solid #F00;border-radius: 6px;margin-right: 8px;">{{ '剩余时间:'+countdownTime }}</div>
|
||||
<el-button :disabled="!jsStart" type="success" @click="startCompetition">开始</el-button>
|
||||
<el-button :disabled="jsStart" type="danger" @click="endCompetition">提交</el-button>
|
||||
</template>
|
||||
<el-button v-if="project==='refereeJsxt'" type="success" @click="refeeEndCompetition">返回</el-button>
|
||||
<el-button v-if="project!=='jsxt'&&project!=='refereeJsxt'" type="primary" :loading="backLoading" @click="back">{{ $t('global.back') }}</el-button>
|
||||
<el-button v-if="project==='refereeJsxt'" type="success" @click="refeeEndCompetition">退出</el-button>
|
||||
<el-button v-if="project!=='jsxt'&&project!=='refereeJsxt'" type="primary" :loading="backLoading" @click="back">退出</el-button>
|
||||
</div>
|
||||
<qr-code ref="qrCode" />
|
||||
<set-time ref="setTime" @ConfirmSelectBeginTime="start" />
|
||||
@ -28,11 +29,11 @@
|
||||
|
||||
<script>
|
||||
import QrCode from '@/components/QrCode';
|
||||
import ChatBox from './chatView/chatBox';
|
||||
import ChatBox from './newChatView/chatBox';
|
||||
import SetTime from '@/views/newMap/displayNew/demon/setTime';
|
||||
import { ranAsPlan, exitRunPlan } from '@/api/simulation';
|
||||
import { ranAsPlan, exitRunPlan, clearSimulation } from '@/api/simulation';
|
||||
import { exitFullscreen } from '@/utils/screen';
|
||||
import { putJointTrainingSimulationUserNew} from '@/api/jointTraining';
|
||||
import { getSimulationQrcode } from '@/api/jointSimulation';
|
||||
import { EventBus } from '@/scripts/event-bus';
|
||||
import { getSessionStorage } from '@/utils/auth';
|
||||
import RealDevice from './menuDraft/realDevice';
|
||||
@ -43,8 +44,6 @@ import localStore from 'storejs';
|
||||
export default {
|
||||
name: 'MenuDemonJoint',
|
||||
components: {
|
||||
// ChartView,
|
||||
// ChartWindow,
|
||||
ChatBox,
|
||||
QrCode,
|
||||
SetTime,
|
||||
@ -74,6 +73,18 @@ export default {
|
||||
default() {
|
||||
return false;
|
||||
}
|
||||
},
|
||||
isAdmin: {
|
||||
type: Boolean,
|
||||
default() {
|
||||
return false;
|
||||
}
|
||||
},
|
||||
adminMode: {
|
||||
type: Boolean,
|
||||
default() {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
},
|
||||
data() {
|
||||
@ -85,7 +96,8 @@ export default {
|
||||
userId: '',
|
||||
stationList: [],
|
||||
stationLists: [],
|
||||
jsStart: true
|
||||
jsStart: true,
|
||||
isGoback: false
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
@ -96,17 +108,12 @@ export default {
|
||||
return this.userRole != 'DRIVER' && this.userRole != '';
|
||||
},
|
||||
isStationSupervisor() {
|
||||
console.log(this.userRole);
|
||||
return this.userRole == 'STATION_SUPERVISOR';
|
||||
},
|
||||
isDriver() {
|
||||
console.log(this.userRole);
|
||||
return this.userRole == 'DRIVER';
|
||||
},
|
||||
isAdmin() {
|
||||
return this.userRole == 'ADMIN';
|
||||
},
|
||||
isProject() {
|
||||
hasRealDevice() {
|
||||
return getSessionStorage('project').endsWith('gzb') && this.userRole === 'CI';
|
||||
},
|
||||
project() {
|
||||
@ -143,6 +150,10 @@ export default {
|
||||
'$store.state.socket.simulationOver':function(val) {
|
||||
if (val && this.project === 'refereeJsxt') {
|
||||
this.$router.go(-1);
|
||||
} else {
|
||||
if (!this.isGoback) {
|
||||
this.back();
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
@ -151,7 +162,6 @@ export default {
|
||||
this.backLoading = false;
|
||||
await this.initLoadPage();
|
||||
this.isDisable = this.$store.state.map.runPlanStatus;
|
||||
console.log(this.userRole);
|
||||
},
|
||||
beforeDestroy() {
|
||||
this.$store.dispatch('training/setGroup', '');
|
||||
@ -301,14 +311,21 @@ export default {
|
||||
});
|
||||
});
|
||||
},
|
||||
back() {
|
||||
async back() {
|
||||
this.isGoback = true;
|
||||
if (this.isAdmin) {
|
||||
await clearSimulation(this.group);
|
||||
}
|
||||
this.$store.dispatch('training/over').then(() => {
|
||||
this.backLoading = true;
|
||||
putJointTrainingSimulationUserNew(this.group).then(() => {
|
||||
this.$router.replace({ path: `/trainroom`, query: { lineCode: this.lineCode, group: this.group, drawWay: true } });
|
||||
if (this.$route.query.projectDevice) {
|
||||
this.$store.dispatch('LogOut').then(() => {
|
||||
location.reload();
|
||||
});
|
||||
} else {
|
||||
history.go(-1);
|
||||
exitFullscreen();
|
||||
this.backLoading = false;
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
jumpjlmap3d() {
|
||||
@ -359,100 +376,118 @@ export default {
|
||||
}).catch(()=> {
|
||||
this.$message.error('提交试卷失败!');
|
||||
});
|
||||
},
|
||||
memberManage() {
|
||||
this.$emit('handlerMemberManage');
|
||||
},
|
||||
generateQrCode() {
|
||||
const self = this;
|
||||
getSimulationQrcode(this.$route.query.group).then(resp => {
|
||||
const param = {
|
||||
url: resp.data,
|
||||
title: self.$t('综合演练二维码'),
|
||||
group: self.$route.query.group
|
||||
};
|
||||
if (self.$refs) {
|
||||
self.$refs.qrCode.doShow(param);
|
||||
}
|
||||
}).catch(() => {
|
||||
this.$messageBox('仿真生成二维码失败!');
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
@import "src/styles/mixin.scss";
|
||||
.tabs-roles {
|
||||
overflow: hidden;
|
||||
border-bottom: 1px solid #e4e7ed;
|
||||
height: 40px;
|
||||
line-height: 40px;
|
||||
-webkit-box-sizing: border-box;
|
||||
box-sizing: border-box;
|
||||
@import "src/styles/mixin.scss";
|
||||
.tabs-roles {
|
||||
overflow: hidden;
|
||||
border-bottom: 1px solid #e4e7ed;
|
||||
height: 40px;
|
||||
line-height: 40px;
|
||||
-webkit-box-sizing: border-box;
|
||||
box-sizing: border-box;
|
||||
|
||||
.roles {
|
||||
padding: 0 20px;
|
||||
height: 41px;
|
||||
list-style: none;
|
||||
font-size: 14px;
|
||||
font-weight: 500;
|
||||
color: #303133;
|
||||
cursor: pointer;
|
||||
border-left: 1px solid #e4e7ed;
|
||||
border-right: 1px solid #e4e7ed;
|
||||
float: left;
|
||||
}
|
||||
.roles {
|
||||
padding: 0 20px;
|
||||
height: 41px;
|
||||
list-style: none;
|
||||
font-size: 14px;
|
||||
font-weight: 500;
|
||||
color: #303133;
|
||||
cursor: pointer;
|
||||
border-left: 1px solid #e4e7ed;
|
||||
border-right: 1px solid #e4e7ed;
|
||||
float: left;
|
||||
}
|
||||
|
||||
.roles-first {
|
||||
border-right: none;
|
||||
}
|
||||
.roles-first {
|
||||
border-right: none;
|
||||
}
|
||||
|
||||
.roles-active {
|
||||
border-bottom-color: #fff;
|
||||
color: #409EFF;
|
||||
}
|
||||
.roles-active {
|
||||
border-bottom-color: #fff;
|
||||
color: #409EFF;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
.tabs-content {
|
||||
height: 300px;
|
||||
width: 100%;
|
||||
display: flex;
|
||||
}
|
||||
.tabs-content {
|
||||
height: 300px;
|
||||
width: 100%;
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.display-score {
|
||||
background-color: black;
|
||||
display: -moz-inline-box;
|
||||
display: inline-block;
|
||||
text-align: left;
|
||||
height: 32px;
|
||||
line-height: 24px;
|
||||
border-radius: 4px;
|
||||
padding-left: 2px;
|
||||
margin-left: 10px;
|
||||
font-family: "Microsoft" !important;
|
||||
font-size: 18px !important;
|
||||
color: #fff;
|
||||
}
|
||||
.display-score {
|
||||
background-color: black;
|
||||
display: -moz-inline-box;
|
||||
display: inline-block;
|
||||
text-align: left;
|
||||
height: 32px;
|
||||
line-height: 24px;
|
||||
border-radius: 4px;
|
||||
padding-left: 2px;
|
||||
margin-left: 10px;
|
||||
font-family: "Microsoft" !important;
|
||||
font-size: 18px !important;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.reminder-drag {
|
||||
position: absolute;
|
||||
float: left;
|
||||
left: 10px;
|
||||
bottom: 10px;
|
||||
width: 500px;
|
||||
height: 340px;
|
||||
background-color: #fff;
|
||||
border-radius: 5px;
|
||||
overflow: hidden;
|
||||
z-index: 2;
|
||||
font-size: 18px;
|
||||
.reminder-drag {
|
||||
position: absolute;
|
||||
float: left;
|
||||
left: 10px;
|
||||
bottom: 10px;
|
||||
width: 500px;
|
||||
height: 340px;
|
||||
background-color: #fff;
|
||||
border-radius: 5px;
|
||||
overflow: hidden;
|
||||
z-index: 2;
|
||||
font-size: 18px;
|
||||
|
||||
/deep/ {
|
||||
.el-tabs__header {
|
||||
margin: 0;
|
||||
}
|
||||
}
|
||||
/deep/ {
|
||||
.el-tabs__header {
|
||||
margin: 0;
|
||||
}
|
||||
}
|
||||
|
||||
.title-bar {
|
||||
height: 40px;
|
||||
}
|
||||
.title-bar {
|
||||
height: 40px;
|
||||
}
|
||||
|
||||
.content {
|
||||
height: 300px;
|
||||
}
|
||||
}
|
||||
.content {
|
||||
height: 300px;
|
||||
}
|
||||
}
|
||||
|
||||
.display-draft {
|
||||
position: absolute;
|
||||
float: right;
|
||||
right: 40px;
|
||||
bottom: 28px;
|
||||
}
|
||||
.display-type-hb{
|
||||
bottom: 105px;
|
||||
}
|
||||
.display-draft {
|
||||
position: absolute;
|
||||
float: right;
|
||||
right: 40px;
|
||||
bottom: 28px;
|
||||
}
|
||||
.display-type-hb{
|
||||
bottom: 105px;
|
||||
}
|
||||
</style>
|
||||
|
@ -1,7 +1,7 @@
|
||||
<template>
|
||||
<div class="schema" :style="{top: offset+'px'}">
|
||||
<el-select
|
||||
v-if="userRole == 'INSTRUCTOR' || userRole == 'ADMIN'"
|
||||
v-if="isAdmin && adminMode"
|
||||
v-model="swch"
|
||||
size="small"
|
||||
style="width: 100px;"
|
||||
@ -17,17 +17,16 @@
|
||||
<template>
|
||||
<el-button v-if="runing && !dataError" size="small" :disabled="viewDisabled" @click="viewRunPlan">{{ $t('joinTraining.runGraphPreview') }}</el-button>
|
||||
</template>
|
||||
<template v-if="userRole == 'ADMIN'">
|
||||
<template v-if="isAdmin && adminMode">
|
||||
<el-button v-if="!runing && !dataError" size="small" type="warning" @click="loadRunPlan">
|
||||
{{ $t('joinTraining.runGraphLoading') }}</el-button>
|
||||
</template>
|
||||
<template v-if="userRole == 'INSTRUCTOR' || userRole == 'ADMIN'">
|
||||
<template v-if="isAdmin && adminMode">
|
||||
<el-button v-if="mode==OperateMode.FAULT && !dataError" size="small" type="danger" @click="setFault">{{ $t('joinTraining.faultSetting') }}</el-button>
|
||||
</template>
|
||||
</el-button-group>
|
||||
|
||||
<el-radio-group
|
||||
v-if="(userRole == 'INSTRUCTOR' || userRole == 'ADMIN') && !dataError && !isScreen"
|
||||
v-if="isAdmin && adminMode && !dataError && !isScreen"
|
||||
v-model="mode"
|
||||
size="small"
|
||||
@change="changeOperateMode(mode)"
|
||||
@ -35,6 +34,10 @@
|
||||
<el-radio-button class="mode" :label="OperateMode.NORMAL">{{ $t('joinTraining.normalOperation') }}</el-radio-button>
|
||||
<el-radio-button class="mode" :label="OperateMode.FAULT">{{ $t('joinTraining.faultOperation') }}</el-radio-button>
|
||||
</el-radio-group>
|
||||
<el-radio-group v-if="isAdmin" v-model="adminMode" size="small" @change="changeAdminMode">
|
||||
<el-radio-button class="mode" :label="true">管理模式</el-radio-button>
|
||||
<el-radio-button class="mode" :label="false">演练模式</el-radio-button>
|
||||
</el-radio-group>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
@ -82,6 +85,12 @@ export default {
|
||||
default() {
|
||||
return false;
|
||||
}
|
||||
},
|
||||
isAdmin: {
|
||||
type: Boolean,
|
||||
default() {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
},
|
||||
data() {
|
||||
@ -101,16 +110,14 @@ export default {
|
||||
{ value: '07', name: '大屏'}
|
||||
],
|
||||
runing: false,
|
||||
userId: ''
|
||||
userId: '',
|
||||
adminMode: true
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
...mapGetters('runPlan', [
|
||||
'stations'
|
||||
]),
|
||||
isShowMenuBar() {
|
||||
return this.$store.state.map.roles == 'Admin';
|
||||
},
|
||||
isScreen() {
|
||||
return this.$store.state.training.prdType === '07';
|
||||
}
|
||||
@ -138,7 +145,6 @@ export default {
|
||||
if (opt && opt.mapId) {
|
||||
this.viewDisabled = true;
|
||||
getByGroupStationList(this.$route.query.group).then(response => {
|
||||
// getStationList(opt.mapId).then(response => {
|
||||
const stations = response.data;
|
||||
this.$store.dispatch('runPlan/setStations', stations).then(() => {
|
||||
getEveryDayRunPlanNew(this.group).then(resp => {
|
||||
@ -184,6 +190,9 @@ export default {
|
||||
},
|
||||
switchStationMode(val) {
|
||||
this.$emit('switchStationMode', val);
|
||||
},
|
||||
changeAdminMode(adminMode) {
|
||||
this.$emit('changeAdminMode', adminMode, this.swch);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
785
src/views/newMap/jointTrainingNew/newChatView/chatBox.vue
Normal file
785
src/views/newMap/jointTrainingNew/newChatView/chatBox.vue
Normal file
@ -0,0 +1,785 @@
|
||||
<template>
|
||||
<!-- v-quickMenuDrag -->
|
||||
<div class="chatBox" :style="{'bottom':bottom+'px'}">
|
||||
<div v-show="!minimize" class="chat-box">
|
||||
<div class="chat-box-main">
|
||||
<div v-if="!conversitionId && userRole !== 'AUDIENCE'" class="chat-window">
|
||||
<div class="chat-box-header">
|
||||
<div class="chat-box-header-title">
|
||||
<el-input v-model="queryMember" size="small" placeholder="请输入搜索人员">
|
||||
<el-button slot="append" icon="el-icon-search" />
|
||||
</el-input>
|
||||
</div>
|
||||
<div class="minimality" @click="handleMinimality('min')">
|
||||
<i class="el-icon-remove" />
|
||||
</div>
|
||||
<div class="chat-setting" @click="handleSetting()">
|
||||
<i class="el-icon-s-tools" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="chat-box-content">
|
||||
<el-tree
|
||||
ref="tree"
|
||||
:data="treeData"
|
||||
:props="defaultProps"
|
||||
node-key="id"
|
||||
default-expand-all
|
||||
show-checkbox
|
||||
:filter-node-method="filterNode"
|
||||
style="margin: 10px;overflow-y: auto;height: 100%;margin-right: 0;"
|
||||
@node-click="handleNodeClick"
|
||||
@check-change="handleCheckChange"
|
||||
>
|
||||
<span :id="data.id" slot-scope="{ node, data }">
|
||||
<span style="font-size: 14px">{{ data.label + (data.userId? '(' + (simulationUsers[data.userId]||{}).nickName + ')': '') }}</span>
|
||||
</span>
|
||||
</el-tree>
|
||||
</div>
|
||||
<div class="chat-box-footer">
|
||||
<div style="width: 400px;font-size: 14px;">{{ userString }}</div>
|
||||
<el-button size="mini" type="primary" class="chat-box-footer-create" :loading="createLoading" @click="createCoversition()">创建群聊</el-button>
|
||||
</div>
|
||||
</div>
|
||||
<div v-else class="chat-window">
|
||||
<div class="chat-box-header">
|
||||
<div class="chat-box-header-title">{{ headerTitle }}</div>
|
||||
<div class="minimality" @click="handleMinimality('min')">
|
||||
<i class="el-icon-remove" />
|
||||
</div>
|
||||
<div class="chat-setting" @click="handleSetting()">
|
||||
<i class="el-icon-s-tools" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="chat-box-content">
|
||||
<chat-content
|
||||
ref="chatContent"
|
||||
:project="project"
|
||||
:is-answering="IsAnswering"
|
||||
:conversition-id="conversitionId"
|
||||
:conversition-member-list="conversitionMemberList"
|
||||
:message-list="messageList"
|
||||
:simulation-users="simulationUsers"
|
||||
@changeMessageList="changeMessageList"
|
||||
/>
|
||||
<div v-if="recordSending" class="chat_record_tip">
|
||||
<div id="record_progress_bar" :style="'width:'+100/60*seconds+'%'" />
|
||||
<div class="record_icon" />
|
||||
<div class="record_tip_text">正在录音...</div>
|
||||
<div class="record_tip_confirm" @click="stopRecording()">确定</div>
|
||||
<div class="record_tip_cancle" @click="cancleRecording()">取消</div>
|
||||
</div>
|
||||
<chat-member-list ref="chatMemberList" :conversition-member-list="conversitionMemberList" :simulation-users="simulationUsers" @connectMember="connectMember" />
|
||||
</div>
|
||||
<div class="chat-box-footer">
|
||||
<div class="chat-box-footer-tool" />
|
||||
<el-button v-if="isConversitionCreator && isButtonShow" size="mini" type="danger" class="chat-box-footer-quit" :loading="quitLoading" @click="quitConversition()">退出群聊</el-button>
|
||||
<el-button v-if="isButtonShow" class="chat-box-footer-send" size="mini" type="primary" :disabled="recordSending" @click="startRecording()">发送语音</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div v-show="minimize" class="reminder-drag minimize-box">
|
||||
<div class="chat-title">聊天窗口</div>
|
||||
<div class="minimality" @click="handleMinimality('max')">
|
||||
<i class="el-icon-circle-plus" />
|
||||
</div>
|
||||
</div>
|
||||
<chat-setting ref="chatSetting" :form="form" @setSetting="setSetting" />
|
||||
<chat-tooltip :group="group" :simulation-users="simulationUsers" @acceptInvite="acceptInvite" />
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import ChatSetting from './chatSetting';
|
||||
import ChatTooltip from './chatTooltip';
|
||||
import ChatContent from './chatContent';
|
||||
import ChatMemberList from './chatMemberList';
|
||||
import RecordRTC from 'recordrtc';
|
||||
import {sendSimulationConversition, startConversition, overSimulationConversition, getAllConversition} from '@/api/chat';
|
||||
import { getSessionStorage } from '@/utils/auth';
|
||||
export default {
|
||||
name: 'ChatBox',
|
||||
components:{
|
||||
ChatSetting,
|
||||
ChatTooltip,
|
||||
ChatContent,
|
||||
ChatMemberList
|
||||
},
|
||||
props: {
|
||||
group: {
|
||||
type: String,
|
||||
required: true
|
||||
},
|
||||
userRole: {
|
||||
type: String,
|
||||
required: true
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
minimize:true,
|
||||
bottom:15,
|
||||
recordSending:false,
|
||||
currentCoversition:{},
|
||||
conversitionId: '',
|
||||
seconds:0,
|
||||
inter:null,
|
||||
recorders: null,
|
||||
microphone:null,
|
||||
isHasCoversition:false,
|
||||
createLoading:false,
|
||||
form:{
|
||||
language:'zh',
|
||||
sex:'1'
|
||||
},
|
||||
headerTitle:'',
|
||||
treeData: [],
|
||||
defaultProps: {
|
||||
children: 'children',
|
||||
label: 'label'
|
||||
},
|
||||
queryMember: '',
|
||||
activeTrains: [],
|
||||
firstClick: true,
|
||||
memberData: {},
|
||||
simulationUsers: {},
|
||||
userString: '',
|
||||
memberIdList: [],
|
||||
quitLoading: false,
|
||||
conversitionMemberList: [],
|
||||
isConversitionCreator: true,
|
||||
messageList: []
|
||||
};
|
||||
},
|
||||
computed:{
|
||||
isShow() {
|
||||
return this.userRole != 'ADMIN' && this.userRole != 'AUDIENCE' && !this.isHasCoversition;
|
||||
},
|
||||
isButtonShow() {
|
||||
return this.userRole != 'AUDIENCE';
|
||||
},
|
||||
project() {
|
||||
return getSessionStorage('project');
|
||||
},
|
||||
IsAnswering() {
|
||||
return !(this.$route.path.includes('refereeJsxtDisplay'));
|
||||
}
|
||||
},
|
||||
watch:{
|
||||
queryMember(val) {
|
||||
if (this.$refs.tree) {
|
||||
this.$refs.tree.filter(val);
|
||||
}
|
||||
},
|
||||
userRole(val) {
|
||||
if (val === 'AUDIENCE') {
|
||||
this.isAudienceInitData();
|
||||
}
|
||||
},
|
||||
'$store.state.map.mapViewLoadedCount':function(val) {
|
||||
const object = document.querySelector('.menuButton');
|
||||
if (object) {
|
||||
const objectBottom = parseInt(object.style.bottom) || 0;
|
||||
this.bottom = this.bottom + object.offsetHeight + objectBottom;
|
||||
}
|
||||
},
|
||||
'$store.state.map.activeTrainListUpdate': function (val) {
|
||||
this.activeTrains = [];
|
||||
const activeTrainList = this.$store.state.map.activeTrainList;
|
||||
if (activeTrainList && activeTrainList.length) {
|
||||
activeTrainList.forEach(train => {
|
||||
this.activeTrains.push(train.groupNumber);
|
||||
});
|
||||
}
|
||||
if (this.$refs.tree) {
|
||||
this.$refs.tree.filter(this.queryMember());
|
||||
}
|
||||
},
|
||||
'$store.state.training.simulationUserList': function(val) {
|
||||
this.simulationUsers = {};
|
||||
if (val && val.length) {
|
||||
val.forEach(user => {
|
||||
this.simulationUsers[user.userId] = user;
|
||||
});
|
||||
}
|
||||
},
|
||||
'$store.state.socket.overConversition': function (val) {
|
||||
this.conversitionId = '';
|
||||
this.conversitionMemberList = [];
|
||||
this.messageList = [];
|
||||
},
|
||||
'$store.state.training.memberList': function (val) {
|
||||
if (val && val.length) {
|
||||
this.memberData = this.$store.state.training.memberData;
|
||||
const dispatcherList = [];
|
||||
const electricDispatcherList = [];
|
||||
const depotDispatcherList = [];
|
||||
const stationSupervisorList = [];
|
||||
const driverList = [];
|
||||
const maintainerList = [];
|
||||
val.forEach(item => {
|
||||
const device = this.$store.getters['map/getDeviceByCode'](item.deviceCode);
|
||||
switch (item.role) {
|
||||
case 'DISPATCHER':
|
||||
this.memberData[item.id].label = '行调' + (dispatcherList.length + 1);
|
||||
dispatcherList.push(this.memberData[item.id]);
|
||||
break;
|
||||
case 'ELECTRIC_DISPATCHER':
|
||||
electricDispatcherList.push(this.memberData[item.id]);
|
||||
break;
|
||||
case 'DEPOT_DISPATCHER':
|
||||
depotDispatcherList.push(this.memberData[item.id]);
|
||||
break;
|
||||
case 'STATION_SUPERVISOR':
|
||||
this.memberData[item.id].label = '值班员-' + device.name;
|
||||
stationSupervisorList.push(this.memberData[item.id]);
|
||||
break;
|
||||
case 'DRIVER':
|
||||
this.memberData[item.id].label = '司机-列车' + item.deviceCode;
|
||||
driverList.push(this.memberData[item.id]);
|
||||
break;
|
||||
case 'MAINTAINER':
|
||||
this.memberData[item.id].label = '通号' + (maintainerList.length + 1);
|
||||
maintainerList.push(this.memberData[item.id]);
|
||||
break;
|
||||
}
|
||||
});
|
||||
this.treeData = [{
|
||||
label: '行调',
|
||||
id: 'dispatcher',
|
||||
type: 'role',
|
||||
children: dispatcherList
|
||||
}, {
|
||||
label: '车站值班员',
|
||||
id: 'stationSupervisor',
|
||||
type: 'role',
|
||||
children: stationSupervisorList
|
||||
}, {
|
||||
label: '司机',
|
||||
id: 'driver',
|
||||
type: 'role',
|
||||
children: driverList
|
||||
}, {
|
||||
label: '通号',
|
||||
id: 'maintainer',
|
||||
type: 'role',
|
||||
children: maintainerList
|
||||
}];
|
||||
}
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.firstClick = true;
|
||||
},
|
||||
methods:{
|
||||
handleMinimality(data) {
|
||||
if (data == 'min') {
|
||||
this.minimize = true;
|
||||
this.$refs.chatSetting.doClose();
|
||||
} else {
|
||||
this.firstClick && this.$nextTick(() => {
|
||||
this.isAudienceInitData();
|
||||
if (this.$refs.tree) {
|
||||
this.$refs.tree.filter(this.queryMember);
|
||||
}
|
||||
this.firstClick = false;
|
||||
});
|
||||
this.minimize = false;
|
||||
}
|
||||
},
|
||||
setSetting(data) {
|
||||
this.form = data;
|
||||
},
|
||||
setCurrentCoversition(coversition) {
|
||||
if (coversition && coversition.id) {
|
||||
this.currentCoversition = coversition;
|
||||
this.headerTitle = coversition.name;
|
||||
} else {
|
||||
this.headerTitle = '';
|
||||
}
|
||||
if (this.recordSending) {
|
||||
this.cancleRecording();
|
||||
}
|
||||
this.$refs.chatContent.scrollTop();
|
||||
},
|
||||
setHeadTitle(headerTitle) {
|
||||
this.headerTitle = headerTitle;
|
||||
},
|
||||
hideAddCoversition() {
|
||||
this.isHasCoversition = true;
|
||||
},
|
||||
createCoversition() {
|
||||
this.createLoading = true;
|
||||
startConversition(this.group, this.memberIdList).then(resp => {
|
||||
this.conversitionId = resp.data.id;
|
||||
this.conversitionMemberList = resp.data.memberList;
|
||||
this.messageList = [];
|
||||
this.userString = '';
|
||||
this.isConversitionCreator = true;
|
||||
this.$message.success('创建会话成功!');
|
||||
this.createLoading = false;
|
||||
}).catch((error) => {
|
||||
this.$message.error(error.code == '3005' ? '创建会话失败:仿真会话成员忙线中!' : '创建仿真失败!');
|
||||
this.createLoading = false;
|
||||
});
|
||||
},
|
||||
addCoversition({data, headerTitle}) {
|
||||
this.$refs.chatCoversitionList.addCoversition(data);
|
||||
this.isHasCoversition = true;
|
||||
this.currentCoversition = {id:data.id, all:data.all};
|
||||
this.headerTitle = headerTitle;
|
||||
},
|
||||
// 语音录制开始
|
||||
startRecording() {
|
||||
const that = this;
|
||||
if (!this.recordSending && !this.recorders && !this.microphone) {
|
||||
this.$refs.chatSetting.doClose();
|
||||
const StereoAudioRecorder = RecordRTC.StereoAudioRecorder;
|
||||
navigator.getUserMedia(
|
||||
{ audio: true } // 只启用音频
|
||||
, function (stream) {
|
||||
that.microphone = stream;
|
||||
that.recorders = new RecordRTC(that.microphone, {
|
||||
type: 'audio',
|
||||
recorderType: StereoAudioRecorder,
|
||||
numberOfAudioChannels: 1,
|
||||
bitsPerSecond:256000,
|
||||
desiredSampRate: 16000
|
||||
});
|
||||
that.recorders.startRecording();
|
||||
that.recordSending = true;
|
||||
that.inter = setInterval(() => {
|
||||
if (that.seconds < 60) {
|
||||
that.seconds++;
|
||||
} else {
|
||||
clearInterval(that.inter);
|
||||
}
|
||||
}, 1000);
|
||||
}, function (error) {
|
||||
switch (error.code || error.name) {
|
||||
case 'PERMISSION_DENIED':
|
||||
case 'PermissionDeniedError':
|
||||
that.$message({
|
||||
showClose: true,
|
||||
message: '用户拒绝提供信息',
|
||||
type: 'error'
|
||||
});
|
||||
break;
|
||||
case 'NOT_SUPPORTED_ERROR':
|
||||
case 'NotSupportedError':
|
||||
that.$message({
|
||||
showClose: true,
|
||||
message: '浏览器不支持硬件设备',
|
||||
type: 'error'
|
||||
});
|
||||
break;
|
||||
case 'MANDATORY_UNSATISFIED_ERROR':
|
||||
case 'MandatoryUnsatisfiedError':
|
||||
that.$message({
|
||||
showClose: true,
|
||||
message: '无法发现指定的硬件设备',
|
||||
type: 'error'
|
||||
});
|
||||
break;
|
||||
default:
|
||||
that.$message({
|
||||
showClose: true,
|
||||
message: '无法打开麦克风',
|
||||
type: 'error'
|
||||
});
|
||||
break;
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
},
|
||||
cancleRecording() {
|
||||
if (this.microphone) {
|
||||
clearInterval(this.inter);
|
||||
this.seconds = 0;
|
||||
this.microphone.stop();
|
||||
this.microphone = null;
|
||||
this.recordSending = false;
|
||||
this.recorders = null;
|
||||
}
|
||||
},
|
||||
// 停止录制
|
||||
stopRecording() {
|
||||
const that = this;
|
||||
this.recorders.stopRecording(function(blobURL) {
|
||||
clearInterval(that.inter);
|
||||
that.seconds = 0;
|
||||
const blob = that.recorders.getBlob();
|
||||
const fd = new FormData();
|
||||
fd.append('file', blob);
|
||||
sendSimulationConversition(that.group, that.conversitionId, fd)
|
||||
.then((data) => {
|
||||
})
|
||||
.catch(error => {
|
||||
console.log(error);
|
||||
});
|
||||
if (that.microphone) {
|
||||
that.microphone.stop();
|
||||
that.microphone = null;
|
||||
that.recordSending = false;
|
||||
that.recorders = null;
|
||||
}
|
||||
});
|
||||
},
|
||||
handleSetting() {
|
||||
this.$refs.chatSetting.doShow();
|
||||
},
|
||||
handleCreateGroup() {
|
||||
this.$refs.createGroup.doShow();
|
||||
},
|
||||
handleNodeClick() {
|
||||
|
||||
},
|
||||
handleCheckChange() {
|
||||
const memberList = this.$refs.tree.getCheckedKeys();
|
||||
this.userString = '';
|
||||
this.memberIdList = [];
|
||||
if (memberList && memberList.length) {
|
||||
memberList.forEach(memberId => {
|
||||
const member = this.memberData[memberId];
|
||||
if (member && member.userId) {
|
||||
this.memberIdList.push(member.id);
|
||||
this.userString += ((this.userString ? ',' : '') + member.label + '(' + this.simulationUsers[member.userId].nickName + ')');
|
||||
} else if (member) {
|
||||
this.userString += ((this.userString ? ',' : '') + member.label);
|
||||
this.memberIdList.push(member.id);
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
filterNode(value, data) {
|
||||
let flag = false;
|
||||
if (this.memberData[data.id] && this.memberData[data.id].nickName) {
|
||||
flag = this.memberData[data.id].nickName.indexOf(value) !== -1;
|
||||
}
|
||||
let driverNoShow = true;
|
||||
if (data.role && data.role === 'DRIVER' && !this.activeTrains.includes(data.deviceCode)) {
|
||||
driverNoShow = false;
|
||||
}
|
||||
return (data.label.indexOf(value) !== -1 || flag) && driverNoShow;
|
||||
},
|
||||
quitConversition() {
|
||||
this.quitLoading = true;
|
||||
overSimulationConversition(this.group, this.conversitionId).then(resp => {
|
||||
this.conversitionId = '';
|
||||
this.conversitionMemberList = [];
|
||||
this.messageList = [];
|
||||
this.quitLoading = false;
|
||||
}).catch(() => {
|
||||
this.$message.error('退出会话失败!');
|
||||
this.quitLoading = false;
|
||||
});
|
||||
},
|
||||
acceptInvite(data) {
|
||||
this.userString = '';
|
||||
this.conversitionId = data.id;
|
||||
this.conversitionMemberList = data.memberList;
|
||||
this.isConversitionCreator = false;
|
||||
this.messageList = [];
|
||||
if (data.messageList && data.messageList) {
|
||||
data.messageList.forEach(message => {
|
||||
const member = this.memberData[message.memberId];
|
||||
message.src = `/audio/${message.audioPath}`;
|
||||
if (member) {
|
||||
message.self = this.$store.state.userId == member.userId;
|
||||
}
|
||||
this.messageList.push(message);
|
||||
});
|
||||
}
|
||||
},
|
||||
connectMember(val) {
|
||||
this.conversitionMemberList.forEach(member => {
|
||||
if (member.memberId == val.memberId) {
|
||||
member.connect = true;
|
||||
}
|
||||
});
|
||||
},
|
||||
sortByMessageTime(message1, message2) {
|
||||
const time1 = new Date(message1.time).valueOf();
|
||||
const time2 = new Date(message2.time).valueOf();
|
||||
return time1 - time2;
|
||||
},
|
||||
isAudienceInitData() {
|
||||
getAllConversition(this.group).then(resp => {
|
||||
if (resp.data && resp.data.length) {
|
||||
const messageList = [];
|
||||
resp.data.forEach(conversation => {
|
||||
if (this.userRole == 'AUDIENCE') {
|
||||
(conversation.messageList || []).forEach(message => {
|
||||
const member = this.memberData[message.memberId];
|
||||
message.src = `/audio/${message.audioPath}`;
|
||||
message.members = conversation.memberList;
|
||||
if (member) {
|
||||
message.self = this.$store.state.userId == member.userId;
|
||||
}
|
||||
messageList.push(message);
|
||||
});
|
||||
} else {
|
||||
const user = this.simulationUsers[this.$store.state.user.id];
|
||||
!conversation.over && conversation.memberList.forEach(member =>{
|
||||
if (member.memberId == user.memberId) {
|
||||
this.conversitionMemberList = conversation.memberList;
|
||||
this.conversitionId = conversation.id;
|
||||
this.messageList = [];
|
||||
conversation.messageList.forEach(message => {
|
||||
const member = this.memberData[message.memberId];
|
||||
message.src = `/audio/${message.audioPath}`;
|
||||
if (member) {
|
||||
message.self = this.$store.state.userId == member.userId;
|
||||
}
|
||||
this.messageList.push(message);
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
this.messageList = messageList.sort(this.sortByMessageTime);
|
||||
}
|
||||
});
|
||||
this.conversitionMemberList = [];
|
||||
this.$store.state.training.memberList.forEach(item =>{
|
||||
this.conversitionMemberList.push({memberId: item.id, connect:true });
|
||||
});
|
||||
},
|
||||
changeMessageList(data) {
|
||||
this.messageList.push(data);
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.chatBox{
|
||||
width: 503px;
|
||||
position: absolute;
|
||||
padding-left:5px;
|
||||
left: 0;
|
||||
bottom:28px;
|
||||
z-index:9;
|
||||
}
|
||||
.chat-box{
|
||||
width: 100%;
|
||||
height: 400px;
|
||||
}
|
||||
.chat-box-header{
|
||||
width: 100%;
|
||||
height: 40px;
|
||||
border-bottom: 1px #dedede solid;
|
||||
}
|
||||
.chat-box-header-title{
|
||||
font-size: 15px;
|
||||
margin-left: 15px;
|
||||
display: inline-block;
|
||||
margin-top: 5px;
|
||||
width: 70%;
|
||||
overflow: hidden;
|
||||
white-space: nowrap;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
.chat-box-content{
|
||||
width: 100%;
|
||||
height: 300px;
|
||||
border-bottom: 1px #dedede solid;
|
||||
position: relative;
|
||||
}
|
||||
.chat-box-contentTip{
|
||||
|
||||
}
|
||||
.chat-box-footer{
|
||||
display: inline-block;
|
||||
width: 100%;
|
||||
height: 50px;
|
||||
overflow-y: auto;
|
||||
}
|
||||
.chat-window{
|
||||
display: inline-block;
|
||||
width: 100%;
|
||||
}
|
||||
.chat-setting{
|
||||
float: right;
|
||||
line-height: 40px;
|
||||
margin-right: 10px;
|
||||
cursor: pointer;
|
||||
font-size: 16px;
|
||||
}
|
||||
.chat-createGroup{
|
||||
float: right;
|
||||
line-height: 40px;
|
||||
margin-right: 10px;
|
||||
cursor: pointer;
|
||||
font-size: 16px;
|
||||
position: relative;
|
||||
}
|
||||
.chat-box-footer-tool{
|
||||
width: 100%;
|
||||
height: 17px;
|
||||
}
|
||||
.chat-box-footer-send{
|
||||
background: #36a2fd;
|
||||
width: 65px;
|
||||
font-size: 12px;
|
||||
padding: 5px 0px 4px 0px;
|
||||
text-align: center;
|
||||
border-radius: 3px;
|
||||
color: #fff;
|
||||
float: right;
|
||||
margin-right: 10px;
|
||||
margin-bottom: 10px;
|
||||
cursor: pointer;
|
||||
}
|
||||
.chat-box-footer-quit{
|
||||
width: 65px;
|
||||
font-size: 12px;
|
||||
padding: 5px 0px 4px 0px;
|
||||
text-align: center;
|
||||
border-radius: 3px;
|
||||
color: #fff;
|
||||
margin-left: 10px;
|
||||
margin-bottom: 10px;
|
||||
cursor: pointer;
|
||||
}
|
||||
.minimality {
|
||||
float: right;
|
||||
line-height: 40px;
|
||||
margin-right: 10px;
|
||||
cursor: pointer;
|
||||
font-size:16px;
|
||||
}
|
||||
.chat-box-main{
|
||||
position: absolute;
|
||||
width: 100%;
|
||||
left: 0;
|
||||
height: 100%;
|
||||
top: 0;
|
||||
border-right: 1px #dedede solid;
|
||||
z-index: 4;
|
||||
background: #fff;
|
||||
border-radius: 5px;
|
||||
left:5px;
|
||||
font-size:0;
|
||||
}
|
||||
.chat-coversition{
|
||||
|
||||
}
|
||||
.coversition-list{
|
||||
|
||||
}
|
||||
.chat-box-footer-create{
|
||||
width: 65px;
|
||||
font-size: 12px;
|
||||
padding: 5px 0px 4px 0px;
|
||||
text-align: center;
|
||||
border-radius: 3px;
|
||||
color: #fff;
|
||||
position: absolute;
|
||||
right: 5px;
|
||||
bottom: 5px;
|
||||
margin-right: 10px;
|
||||
margin-top: 10px;
|
||||
cursor: pointer;
|
||||
}
|
||||
.showMembers{
|
||||
float: right;
|
||||
line-height: 40px;
|
||||
margin-right: 10px;
|
||||
cursor: pointer;
|
||||
font-size: 17px;
|
||||
}
|
||||
#record_progress_bar{
|
||||
height: 100%;
|
||||
position: absolute;
|
||||
background: #bbe5f5;
|
||||
}
|
||||
.chat_record_tip{
|
||||
height: 28px;
|
||||
display: inline-block;
|
||||
background: #dfe6ee;
|
||||
width: 370px;
|
||||
font-size: 13px;
|
||||
border-top: 1px #d8dce5 solid;
|
||||
position: absolute;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
}
|
||||
.record_icon{
|
||||
display: inline-block;
|
||||
width: 8px;
|
||||
height: 8px;
|
||||
background: #25d825;
|
||||
border-radius: 10px;
|
||||
left: 7px;
|
||||
margin-right: 0px;
|
||||
box-shadow: -1px 0px 3px #6d6d6d;
|
||||
border: 1px #28d228 solid;
|
||||
position: absolute;
|
||||
top: 10px;
|
||||
}
|
||||
.record_tip_text{
|
||||
display: inline-block;
|
||||
font-size: 12px;
|
||||
margin-left: 3px;
|
||||
// padding: 8px 0px 6px 0px;
|
||||
position: absolute;
|
||||
top: 8px;
|
||||
left:20px
|
||||
}
|
||||
.record_tip_confirm{
|
||||
position: absolute;
|
||||
right: 63px;
|
||||
padding: 3px 0px 2px 0px;
|
||||
border: 1px #a2a5aa solid;
|
||||
border-radius: 5px;
|
||||
width: 45px;
|
||||
text-align: center;
|
||||
font-size: 12px;
|
||||
top: 4px;
|
||||
background: #eeeeee;
|
||||
cursor: pointer;
|
||||
}
|
||||
.record_tip_cancle{
|
||||
position: absolute;
|
||||
right: 10px;
|
||||
padding: 3px 0px 2px 0px;
|
||||
border: 1px #a2a5aa solid;
|
||||
border-radius: 5px;
|
||||
width: 45px;
|
||||
text-align: center;
|
||||
font-size: 12px;
|
||||
top: 4px;
|
||||
background: #eeeeee;
|
||||
cursor: pointer;
|
||||
}
|
||||
.chat-box-footer-send.disbled{
|
||||
cursor: no-drop;
|
||||
}
|
||||
|
||||
.minimize-box {
|
||||
width: 97.5%;
|
||||
height: 40px;
|
||||
position: absolute;
|
||||
left: 5px;
|
||||
bottom: 0;
|
||||
z-index: 222;
|
||||
background: #fff;
|
||||
border-radius: 5px;
|
||||
|
||||
.chat-title {
|
||||
float: left;
|
||||
font-size: 15px;
|
||||
margin-left: 10px;
|
||||
line-height: 40px;
|
||||
}
|
||||
|
||||
.minimality {
|
||||
float: right;
|
||||
height: 40px;
|
||||
line-height: 40px;
|
||||
margin-right: 10px;
|
||||
cursor: pointer;
|
||||
}
|
||||
}
|
||||
|
||||
</style>
|
@ -1,19 +1,19 @@
|
||||
<template>
|
||||
<div class="chatcontentIn">
|
||||
<div class="chatcontentInner">
|
||||
<div v-for="(chatContent,index) in chatContentList" :key="index" class="chatContentInClass">
|
||||
<div v-for="(chatContent,index) in messageList" :key="index" class="chatContentInClass">
|
||||
<div :class="chatContent.self?'rightUser':'leftUser'">
|
||||
<div class="userHeader">
|
||||
<!-- chatContent.all&& -->
|
||||
<div v-if="!chatContent.self" class="userName">{{ covertName(chatContent.member,false) }}</div>
|
||||
<div :class="chatContent.self?'userChatTime textRight':'userChatTime'">{{ formatTime(chatContent.chatTime) }}</div>
|
||||
<div v-if="!chatContent.self" class="userName">{{ covertName(chatContent,false) }}</div>
|
||||
<div :class="chatContent.self?'userChatTime textRight':'userChatTime'">{{ chatContent.time }}</div>
|
||||
</div>
|
||||
<div class="userBubble" @click="playAudio(baseUrl+chatContent.src)">
|
||||
<div class="userMessage">
|
||||
<!-- chatContent.all&& -->
|
||||
<span v-if="!chatContent.member.robot&&chatContent.all">{{ covertName(chatContent.targetUser,true) }}</span>
|
||||
<span>{{ covertName(chatContent,true) }}</span>
|
||||
<span class="el-icon-video-play playicon" />
|
||||
<span class="messageText">{{ chatContent.message }}</span>
|
||||
<span class="messageText">{{ chatContent.content }}</span>
|
||||
</div>
|
||||
</div>
|
||||
<audio id="audioPlay" style="display:none" />
|
||||
@ -23,23 +23,30 @@
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import {getSimulationContextListNew} from '@/api/chat';
|
||||
import ConstConfig from '@/scripts/ConstConfig';
|
||||
import Cookies from 'js-cookie';
|
||||
|
||||
export default {
|
||||
props:{
|
||||
currentCoversition:{
|
||||
type:Object,
|
||||
required:true
|
||||
},
|
||||
project:{
|
||||
type:String,
|
||||
messageList:{
|
||||
type:Array,
|
||||
required:true
|
||||
},
|
||||
isAnswering:{
|
||||
type:Boolean,
|
||||
required:true
|
||||
},
|
||||
conversitionId: {
|
||||
type: String,
|
||||
required: true
|
||||
},
|
||||
conversitionMemberList: {
|
||||
type: Array,
|
||||
required: true
|
||||
},
|
||||
simulationUsers: {
|
||||
type: Object,
|
||||
required: true
|
||||
}
|
||||
},
|
||||
data() {
|
||||
@ -53,54 +60,33 @@ export default {
|
||||
};
|
||||
},
|
||||
watch:{
|
||||
'$store.state.socket.simulationText':function (val, old) { // 仿真聊天
|
||||
// if (this.currentCoversition.id == val.conversationId) {
|
||||
// const simulationText = this.$store.state.socket.simulationText;
|
||||
// this.chatContentList.push(simulationText);
|
||||
// }
|
||||
const simulationText = this.$store.state.socket.simulationText;
|
||||
if (this.currentCoversition.id == val.id) {
|
||||
this.chatContentList.push(simulationText);
|
||||
if (simulationText.member.userId != this.$store.state.user.id) {
|
||||
this.currentAudioList.push(this.baseUrl + simulationText.src);
|
||||
console.log(this.isPlay);
|
||||
'$store.state.socket.conversationInfo':function (val, old) { // 仿真聊天
|
||||
const conversationInfo = this.$store.state.socket.conversationInfo;
|
||||
const member = this.$store.state.training.memberData[val.message.memberId];
|
||||
conversationInfo.message.src = `/audio/${conversationInfo.message.audioPath}`;
|
||||
if (member) {
|
||||
conversationInfo.message.self = this.$store.state.userId == member.userId;
|
||||
}
|
||||
if (this.conversitionId == val.id) {
|
||||
this.$emit('changeMessageList', conversationInfo.message);
|
||||
if (member && member.userId != this.$store.state.user.id) {
|
||||
this.currentAudioList.push(this.baseUrl + '/audio/' + conversationInfo.message.audioPath);
|
||||
if (!this.isPlay) {
|
||||
this.isPlay = true;
|
||||
this.playAllAudio();
|
||||
}
|
||||
}
|
||||
this.scrollTop();
|
||||
} else {
|
||||
if (!simulationText.all) {
|
||||
this.$emit('changeCoversition', simulationText);
|
||||
// this.$emit('addCoversition', {data:simulationText, headerTitle:''});
|
||||
this.chatContentList.push(simulationText);
|
||||
if (simulationText.member.userId != this.$store.state.user.id) {
|
||||
this.currentAudioList.push(this.baseUrl + simulationText.src);
|
||||
console.log(this.isPlay);
|
||||
if (!this.isPlay) {
|
||||
this.isPlay = true;
|
||||
this.playAllAudio();
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (this.project == 'refereeJsxt') {
|
||||
this.chatContentList.push(simulationText);
|
||||
simulationText.name = '所有人';
|
||||
this.$emit('changeCoversition', simulationText);
|
||||
} else if (this.userRole === 'AUDIENCE') {
|
||||
this.$emit('changeMessageList', conversationInfo.message);
|
||||
if (member && member.userId != this.$store.state.user.id) {
|
||||
this.currentAudioList.push(this.baseUrl + '/audio/' + conversationInfo.message.audioPath);
|
||||
if (!this.isPlay) {
|
||||
this.isPlay = true;
|
||||
this.playAllAudio();
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
$route() {
|
||||
this.inintData();
|
||||
},
|
||||
currentCoversition:function (val, old) {
|
||||
if (val && (this.project != 'refereeJsxt' || this.isAnswering)) {
|
||||
this.chatContentList = [];
|
||||
this.coversition = this.currentCoversition;
|
||||
this.inintData();
|
||||
}
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
@ -109,22 +95,22 @@ export default {
|
||||
},
|
||||
methods:{
|
||||
inintData() {
|
||||
if (this.coversition.id) {
|
||||
getSimulationContextListNew(this.$route.query.group, this.coversition.id).then(res=>{
|
||||
const userId = this.$store.state.user.id;
|
||||
const coversitionList = res.data.map(coversition=>{
|
||||
coversition.self = false;
|
||||
if (coversition.member.userId == userId) {
|
||||
coversition.self = true;
|
||||
}
|
||||
coversition.src = coversition.isAudio ? `/audio/${coversition.audioPath}` : '';
|
||||
coversition.targetUser = coversition.targetMember ? coversition.targetMember : 'All';
|
||||
return coversition;
|
||||
});
|
||||
this.chatContentList = coversitionList;
|
||||
this.scrollTop();
|
||||
});
|
||||
}
|
||||
// if (this.coversition.id) {
|
||||
// getSimulationContextListNew(this.$route.query.group, this.coversition.id).then(res=>{
|
||||
// const userId = this.$store.state.user.id;
|
||||
// const coversitionList = res.data.map(coversition=>{
|
||||
// coversition.self = false;
|
||||
// if (coversition.member.userId == userId) {
|
||||
// coversition.self = true;
|
||||
// }
|
||||
// coversition.src = coversition.isAudio ? `/audio/${coversition.audioPath}` : '';
|
||||
// coversition.targetUser = coversition.targetMember ? coversition.targetMember : 'All';
|
||||
// return coversition;
|
||||
// });
|
||||
// this.chatContentList = coversitionList;
|
||||
// this.scrollTop();
|
||||
// });
|
||||
// }
|
||||
// const coversitionListAll = Object.assign({}, this.$store.state.socket.coversitionList);
|
||||
// const coversitionList = coversitionListAll[this.coversition.id] || [];
|
||||
// // console.log('inintData---coversitionList' + JSON.stringify(this.$store.state.socket.coversitionList[this.coversition.id]));
|
||||
@ -136,9 +122,9 @@ export default {
|
||||
document.querySelector('.chatcontentIn').scrollTop = scrollTop;
|
||||
});
|
||||
},
|
||||
formatTime(time) {
|
||||
return /\d{2}:\d{2}:\d{2}/.exec(time)[0] || time;
|
||||
},
|
||||
// formatTime(time) {
|
||||
// return /\d{2}:\d{2}:\d{2}/.exec(time)[0] || time;
|
||||
// },
|
||||
playAllAudio() {
|
||||
this.playEachAudio(this.currentAudioList[this.currentAudioIndex]);
|
||||
},
|
||||
@ -159,58 +145,41 @@ export default {
|
||||
});
|
||||
},
|
||||
covertName(data, status) {
|
||||
if (data != 'All') {
|
||||
if (data instanceof Array) {
|
||||
let result = '';
|
||||
data.forEach(each=>{
|
||||
result += this.covertEachName(each, status);
|
||||
});
|
||||
return result;
|
||||
} else {
|
||||
return this.covertEachName(data, status);
|
||||
}
|
||||
if (status) {
|
||||
let result = '';
|
||||
const members = data.members || this.conversitionMemberList;
|
||||
(members || []).forEach(member => {
|
||||
if (member.memberId != data.memberId) {
|
||||
result += ('@' + this.covertEachName(member.memberId));
|
||||
}
|
||||
});
|
||||
return result;
|
||||
} else {
|
||||
return '@All';
|
||||
return this.covertEachName(data.memberId);
|
||||
}
|
||||
},
|
||||
covertEachName(data, status) {
|
||||
const roleTypeList = ConstConfig.ConstSelect.roleTypeNew;
|
||||
roleTypeList.forEach(function(element) {
|
||||
const rolename = element.value;
|
||||
if (Cookies.get('user_lang') == 'en') {
|
||||
if (rolename == data.role) {
|
||||
data.role = element.enLabel;
|
||||
}
|
||||
} else {
|
||||
if (rolename == data.role) {
|
||||
data.role = element.label;
|
||||
}
|
||||
}
|
||||
});
|
||||
const deviceName = data.deviceName ? '-' + data.deviceName : '';
|
||||
const memberName = data.name ? '-' + data.name : '';
|
||||
if (status) {
|
||||
return '@' + data.role + deviceName + memberName;
|
||||
} else {
|
||||
return data.role + deviceName + memberName;
|
||||
covertEachName(memberId) {
|
||||
let name = '';
|
||||
const member = this.$store.state.training.memberData[memberId];
|
||||
if (member && member.userId) {
|
||||
const user = this.simulationUsers[member.userId];
|
||||
name = member.label + '(' + user.nickName + ')';
|
||||
} else if (member) {
|
||||
name = member.label;
|
||||
}
|
||||
return name;
|
||||
},
|
||||
playAudio(audioUrl) {
|
||||
document.querySelector('#audioPlay').src = audioUrl;
|
||||
document.querySelector('#audioPlay').play();
|
||||
}
|
||||
// reloadData(currentCoversition) {
|
||||
// this.chatContentList = [];
|
||||
// this.coversition = currentCoversition;
|
||||
// this.inintData();
|
||||
// }
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.chatcontentIn{
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
width: 380px;
|
||||
display: inline-block;
|
||||
overflow: auto;
|
||||
padding-bottom: 20px;
|
@ -1,31 +1,28 @@
|
||||
<template>
|
||||
<div :class="showMembers?'memberAnimate chat-box-members':'chat-box-members'">
|
||||
<div class="chat-box-members">
|
||||
<div class="chat-member-title">成员列表</div>
|
||||
<div class="chat-member-list">
|
||||
<div
|
||||
v-for="member in memberList"
|
||||
:key="member.id"
|
||||
v-for="member in conversitionMemberList"
|
||||
:key="member.memberId"
|
||||
class="each-chat-member"
|
||||
:style="member.userId === userId ?'color:red':''"
|
||||
:title="member.memberName"
|
||||
>{{ member.memberName }}</div>
|
||||
:style="computedStyle(member)"
|
||||
:title="memberData[member.memberId].label + (memberData[member.memberId].userId? '(' + simulationUsers[memberData[member.memberId].userId].nickName + ')': '')"
|
||||
>{{ memberData[member.memberId].label + (memberData[member.memberId].userId? '(' + simulationUsers[memberData[member.memberId].userId].nickName + ')': '') }}</div>
|
||||
<!-- :class="member.online?'each-chat-member':'each-chat-member each-chat-member-outline'" -->
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
// getSimulationMembersNew,
|
||||
import {getSimulationChatMemberNew} from '@/api/chat';
|
||||
import ConstConfig from '@/scripts/ConstConfig';
|
||||
import Cookies from 'js-cookie';
|
||||
|
||||
export default {
|
||||
name: 'ChatMemberList',
|
||||
props: {
|
||||
group: {
|
||||
type: String,
|
||||
conversitionMemberList:{
|
||||
type: Array,
|
||||
required: true
|
||||
},
|
||||
currentCoversition:{
|
||||
simulationUsers: {
|
||||
type: Object,
|
||||
required: true
|
||||
}
|
||||
@ -39,57 +36,31 @@ export default {
|
||||
computed:{
|
||||
userId() {
|
||||
return this.$store.state.user.id;
|
||||
},
|
||||
memberData() {
|
||||
return this.$store.state.training.memberData;
|
||||
}
|
||||
},
|
||||
watch:{
|
||||
currentCoversition:function (val, old) {
|
||||
if (val) {
|
||||
this.getSimulationMembers();
|
||||
}
|
||||
},
|
||||
'$store.state.socket.acceptInviteChat':function(val) {
|
||||
this.getSimulationMembers();
|
||||
},
|
||||
'$store.state.socket.quitCoversition':function(val) {
|
||||
this.getSimulationMembers();
|
||||
'$store.state.socket.acceptConversionInvite':function(val) {
|
||||
this.$emit('connectMember', val);
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
},
|
||||
methods:{
|
||||
getSimulationMembers() {
|
||||
this.memberList = [];
|
||||
if (this.currentCoversition.id) {
|
||||
getSimulationChatMemberNew(this.$route.query.group, this.currentCoversition.id).then(resp => {
|
||||
let lastData = JSON.stringify(resp.data);
|
||||
const roleTypeList = ConstConfig.ConstSelect.roleTypeNew;
|
||||
roleTypeList.forEach(function(element) {
|
||||
const rolename = element.value;
|
||||
if (Cookies.get('user_lang') == 'en') {
|
||||
lastData = lastData.replace(new RegExp(rolename, 'g'), element.enLabel);
|
||||
} else {
|
||||
lastData = lastData.replace(new RegExp(rolename, 'g'), element.label);
|
||||
}
|
||||
});
|
||||
lastData = JSON.parse(lastData);
|
||||
lastData = lastData.filter(memberIn=>{ return memberIn.role != '观众'; });
|
||||
lastData.map(member=>{
|
||||
const deviceName = member.deviceName ? '-' + member.deviceName : '';
|
||||
const memberName = member.name ? '-' + member.name : '';
|
||||
member.memberName = member.role + deviceName + memberName;
|
||||
return member;
|
||||
});
|
||||
this.memberList = lastData;
|
||||
});
|
||||
computedStyle(member) {
|
||||
const userId = this.memberData[member.memberId].userId;
|
||||
if (userId && userId == this.userId) {
|
||||
return {color: 'red'};
|
||||
} else {
|
||||
return {color: member.connect ? 'green' : 'gray'};
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.memberAnimate{
|
||||
transform: translateX(97%);
|
||||
}
|
||||
.chat-box-members{
|
||||
position: absolute;
|
||||
width: 140px;
|
||||
@ -102,6 +73,8 @@ export default {
|
||||
transition: transform 1s;
|
||||
padding: 12px 2px 10px 16px;
|
||||
font-size: 14px;
|
||||
display: inline-block;
|
||||
border-left: 1px #dedede solid;
|
||||
}
|
||||
.chat-member-title{
|
||||
}
|
||||
@ -109,7 +82,7 @@ export default {
|
||||
margin-top: 13px;
|
||||
font-size: 12px;
|
||||
margin-left: 2px;
|
||||
height: 350px;
|
||||
height: 250px;
|
||||
overflow-y: auto;
|
||||
}
|
||||
.each-chat-member{
|
@ -15,15 +15,17 @@
|
||||
|
||||
</template>
|
||||
<script>
|
||||
import ConstConfig from '@/scripts/ConstConfig';
|
||||
import Cookies from 'js-cookie';
|
||||
import {acceptCoversitionInvite} from '@/api/chat';
|
||||
import {acceptConversitionInvite} from '@/api/chat';
|
||||
export default {
|
||||
name:'ChatTooltip',
|
||||
props: {
|
||||
group: {
|
||||
type: String,
|
||||
required: true
|
||||
},
|
||||
simulationUsers: {
|
||||
type: Object,
|
||||
required: true
|
||||
}
|
||||
},
|
||||
data() {
|
||||
@ -35,37 +37,28 @@ export default {
|
||||
};
|
||||
},
|
||||
watch:{
|
||||
'$store.state.socket.inviteOtherIntoChat':function(val) {
|
||||
'$store.state.socket.inviteSimulationConversition':function(val) {
|
||||
this.userName = this.coverName(val);
|
||||
this.dialogVisible = true;
|
||||
this.conversationId = val.conversationId;
|
||||
this.conversationId = val.id;
|
||||
}
|
||||
},
|
||||
// {"conversationId":"22e10b17-7a6c-4b1b-8724-f87fb2053b76","from":{"id":"17","userId":"75","name":"赵",
|
||||
// "role":"STATION_SUPERVISOR","deviceType":"STATION","deviceCode":"Station32955","deviceName":"世纪大道","online":true,"robot":false}
|
||||
methods:{
|
||||
coverName(inviteUser) {
|
||||
const member = inviteUser.from;
|
||||
const roleTypeList = ConstConfig.ConstSelect.roleTypeNew;
|
||||
let data = member.role;
|
||||
roleTypeList.forEach(function(element) {
|
||||
const rolename = element.value;
|
||||
if (Cookies.get('user_lang') == 'en') {
|
||||
data = data.replace(rolename, element.enLabel);
|
||||
} else {
|
||||
data = data.replace(rolename, element.label);
|
||||
}
|
||||
});
|
||||
const deviceName = member.deviceName ? '-' + member.deviceName : '';
|
||||
const memberName = member.name ? '-' + member.name : '';
|
||||
return data + deviceName + memberName;
|
||||
const member = this.$store.state.training.memberData[inviteUser.creatorId];
|
||||
if (member.userId) {
|
||||
const user = this.simulationUsers[member.userId];
|
||||
return member.label + '(' + user.nickName + ')';
|
||||
} else {
|
||||
return member.label;
|
||||
}
|
||||
},
|
||||
doCreate() {
|
||||
this.loading = true;
|
||||
acceptCoversitionInvite(this.group, this.conversationId).then(res=>{
|
||||
acceptConversitionInvite(this.group, this.conversationId).then(res=>{
|
||||
this.loading = false;
|
||||
this.dialogVisible = false;
|
||||
this.$emit('getCoversitionList');
|
||||
this.$emit('acceptInvite', res.data);
|
||||
}).catch(error=>{
|
||||
this.$messageBox('接受邀请失败: ' + error.message);
|
||||
});
|
@ -81,7 +81,6 @@ export default {
|
||||
async simulationError() {
|
||||
await this.$store.dispatch('map/clearJlmapTrainView');
|
||||
await this.$store.dispatch('map/setTrainWindowShow', false);
|
||||
await this.$store.dispatch('socket/setSimulationError');
|
||||
await this.$store.dispatch('training/setMapDefaultState');
|
||||
this.clearSubscribe();
|
||||
this.$confirm(this.$t('tip.getMapStateDataException'), this.$t('tip.hint'), {
|
||||
|
@ -199,12 +199,12 @@
|
||||
/>
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
<div v-show="!projectType">
|
||||
<template v-show="!projectType">
|
||||
<split-screen
|
||||
ref="splitScreen"
|
||||
:selected="selected"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
</div>
|
||||
</div>
|
||||
</transition>
|
||||
|
@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<div style="height:100%">
|
||||
<div style="height: calc(100% - 50px);">
|
||||
<el-scrollbar wrap-class="scrollbar-wrapper">
|
||||
<el-table :data="tableData" style="width: 80%; margin: 0 auto;">
|
||||
<el-table-column label="区段名称">
|
||||
@ -23,7 +23,7 @@
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<el-card class="box-card" shadow="never" style="width: 80%; margin: 0 auto; border-top: none;">
|
||||
<el-card class="box-card" shadow="never" style="width: 80%; margin: 0 auto 15px; border-top: none;">
|
||||
<div slot="header" class="clearfix">
|
||||
<span style="font-size: 12px;">{{ cardTitle }}</span>
|
||||
<el-button v-if="cardMode === 'generate'" style="float: right; padding: 3px 0" type="text" @click="generateOverlab">生成</el-button>
|
||||
@ -51,6 +51,21 @@
|
||||
</el-form>
|
||||
</div>
|
||||
</el-card>
|
||||
<el-form ref="form" :model="formData" :rules="rules" label-width="140px" size="mini">
|
||||
<el-form-item label="宽度:" prop="width">
|
||||
<el-input-number v-model="formData.width" style="width: 150px;" :min="1" />
|
||||
<span style="color: #ababab;">屏</span>
|
||||
</el-form-item>
|
||||
<el-form-item label="高度:" prop="height">
|
||||
<el-input-number v-model="formData.height" style="width: 150px;" :min="1" />
|
||||
<span style="color: #ababab;">屏</span>
|
||||
</el-form-item>
|
||||
<template v-for="(item, i) in list">
|
||||
<el-form-item :key="i" :label="'第'+ (i + 1) +'行偏移值:'" prop="offsetTop">
|
||||
<el-input-number v-model="list[i]['offsetTop']" style="width: 150px;" :min="0" />
|
||||
</el-form-item>
|
||||
</template>
|
||||
</el-form>
|
||||
<div style="display: table; margin-left: 90px; margin-top: 12px; margin-bottom: 20px;">
|
||||
<el-button type="primary" @click="save">保存</el-button>
|
||||
<el-button v-if="isPreview" type="primary" @click="preview">预览</el-button>
|
||||
@ -79,8 +94,23 @@ export default {
|
||||
return {
|
||||
tableData: [],
|
||||
addModel: {
|
||||
sectionCode: ''
|
||||
sectionCode: '',
|
||||
offsetTop: 0
|
||||
},
|
||||
formData: {
|
||||
width: 3,
|
||||
height: 2,
|
||||
offsetTop: 0
|
||||
},
|
||||
rules: {
|
||||
width: [
|
||||
{ required: true, message: '请输入宽度', trigger: 'blur' }
|
||||
],
|
||||
height: [
|
||||
{ required: true, message: '请输入高度', trigger: 'blur' }
|
||||
]
|
||||
},
|
||||
list: [],
|
||||
field: '',
|
||||
cardMode: 'generate',
|
||||
index: '',
|
||||
@ -90,7 +120,7 @@ export default {
|
||||
computed: {
|
||||
...mapGetters('map', [
|
||||
'sectionList',
|
||||
'bigScreenSplitConfig'
|
||||
'bigScreenConfig'
|
||||
]),
|
||||
cardTitle() {
|
||||
if (this.cardMode === 'generate') {
|
||||
@ -106,9 +136,9 @@ export default {
|
||||
selected: function (val, oldVal) {
|
||||
this.deviceSelect(val);
|
||||
},
|
||||
bigScreenSplitConfig: function(val) {
|
||||
if (val.length) {
|
||||
this.handleList(val);
|
||||
bigScreenConfig: function(data) {
|
||||
if (data) {
|
||||
this.handleList(data);
|
||||
}
|
||||
}
|
||||
},
|
||||
@ -126,17 +156,31 @@ export default {
|
||||
}
|
||||
}
|
||||
},
|
||||
handleList(list) {
|
||||
handleList(data) {
|
||||
this.tableData = [];
|
||||
list.forEach(item => {
|
||||
data.bigScreenSplitConfig.forEach(item => {
|
||||
const section = this.$store.getters['map/getDeviceByCode'](item.sectionCode);
|
||||
const param = {
|
||||
position: String(section.points[section.points.length - 1].x),
|
||||
name: `${section.name}(${section.code})`,
|
||||
offsetTop: 0,
|
||||
sectionCode: section.code
|
||||
};
|
||||
this.tableData.push(param);
|
||||
});
|
||||
this.formData = {
|
||||
width: data.width,
|
||||
height: data.height
|
||||
};
|
||||
if (data.offsetList.length) {
|
||||
this.list = [];
|
||||
data.offsetList.forEach(item => {
|
||||
const param = {offsetTop: item};
|
||||
this.list.push(param);
|
||||
});
|
||||
} else {
|
||||
this.list = this.tableData.concat({offsetTop: 0});
|
||||
}
|
||||
},
|
||||
hover(field) {
|
||||
this.field = field == this.field ? '' : field;
|
||||
@ -163,10 +207,12 @@ export default {
|
||||
const section = this.$store.getters['map/getDeviceByCode'](this.addModel.sectionCode);
|
||||
const param = {
|
||||
position: String(section.points[section.points.length - 1].x),
|
||||
offsetTop: 0,
|
||||
name: `${section.name}(${section.code})`,
|
||||
sectionCode: section.code
|
||||
};
|
||||
this.tableData.splice(this.index, 1, param);
|
||||
this.list = this.tableData.concat({offsetTop: 0});
|
||||
}
|
||||
this.clear();
|
||||
this.cardMode = 'generate';
|
||||
@ -176,7 +222,12 @@ export default {
|
||||
if (this.tableData.length) {
|
||||
const map = this.$store.state.map.map;
|
||||
const param = {
|
||||
bigScreenSplitConfig: this.tableData,
|
||||
bigScreenConfig: {
|
||||
bigScreenSplitConfig: this.tableData,
|
||||
width: this.formData.width,
|
||||
height: this.formData.height,
|
||||
offsetList: this.list.map(ele => ele.offsetTop)
|
||||
},
|
||||
mapId: this.$route.params.mapId
|
||||
};
|
||||
saveMap(Object.assign(map, param)).then(response => {
|
||||
@ -190,11 +241,11 @@ export default {
|
||||
if (this.tableData.length) {
|
||||
this.isPreview = false;
|
||||
this.$jlmap && this.$jlmap.off('zoom');
|
||||
this.$jlmap && this.$jlmap.off('pan');
|
||||
const size = {
|
||||
width: this.$jlmap.$zr.getWidth(),
|
||||
height: this.$jlmap.$zr.getHeight(),
|
||||
list: this.tableData.map(ele => ele.position)
|
||||
width: this.$jlmap.$zr.getWidth() * this.formData.width,
|
||||
height: this.$jlmap.$zr.getHeight() * this.formData.height,
|
||||
list: this.tableData.map(ele => ele.position),
|
||||
offsetList: this.list.map(ele => ele.offsetTop)
|
||||
};
|
||||
this.$jlmap && this.$jlmap.setUpdateScreen(size);
|
||||
} else {
|
||||
@ -204,7 +255,6 @@ export default {
|
||||
recover() { // 恢复缩放比
|
||||
this.isPreview = true;
|
||||
this.$jlmap && this.$jlmap.on('zoom');
|
||||
this.$jlmap && this.$jlmap.on('pan');
|
||||
const param = {
|
||||
scaleRate: this.$store.state.map.dataZoom.scaleRate,
|
||||
offsetX: this.$store.state.map.dataZoom.offsetX,
|
||||
@ -224,9 +274,11 @@ export default {
|
||||
const section = this.$store.getters['map/getDeviceByCode'](this.addModel.sectionCode);
|
||||
this.tableData.push({
|
||||
position: String(section.points[section.points.length - 1].x),
|
||||
offsetTop: 0,
|
||||
name: `${section.name}(${section.code})`,
|
||||
sectionCode: section.code
|
||||
});
|
||||
this.list = this.tableData.concat({offsetTop: 0});
|
||||
this.clear();
|
||||
}
|
||||
}
|
||||
|
@ -140,7 +140,8 @@ export default {
|
||||
Stand: [],
|
||||
Station: [],
|
||||
ControlConvertMenu: [],
|
||||
TrainWindow: []
|
||||
TrainWindow: [],
|
||||
LimitControl: []
|
||||
};
|
||||
let val;
|
||||
for ( val in CMD['Switch']) {
|
||||
@ -158,6 +159,9 @@ export default {
|
||||
for ( val in CMD['Station']) {
|
||||
this.trainingOperateTypeMap['Station'].push(CMD['Station'][val]);
|
||||
}
|
||||
for ( val in CMD['LimitControl']) {
|
||||
this.trainingOperateTypeMap['LimitControl'].push(CMD['LimitControl'][val]);
|
||||
}
|
||||
for ( val in CMD['ControlConvertMenu']) {
|
||||
this.trainingOperateTypeMap['ControlConvertMenu'].push(CMD['ControlConvertMenu'][val]);
|
||||
}
|
||||
@ -175,7 +179,8 @@ export default {
|
||||
Stand: [],
|
||||
Station: [],
|
||||
ControlConvertMenu: [],
|
||||
TrainWindow: []
|
||||
TrainWindow: [],
|
||||
LimitControl: []
|
||||
};
|
||||
if (res && res.code === 200) {
|
||||
res.data.forEach(item => {
|
||||
|
@ -42,13 +42,19 @@
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-form-item>
|
||||
<el-form-item v-if="isClassShow" label="班级" prop="classes">
|
||||
<el-select v-model="form.classes" placeholder="选择班级" multiple style="width: 200px;">
|
||||
<el-option v-for="nor in classList" :key="nor.id" :label="nor.name" :value="nor.id" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('publish.fullScore')" prop="fullMark">
|
||||
<el-input-number v-model="form.fullMark" placeholder="" :disabled="isEdit" :min="1" />
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('publish.passingScore')" prop="passMark">
|
||||
<el-input-number v-model="form.passMark" placeholder="" :disabled="isEdit" :min="1" />
|
||||
</el-form-item>
|
||||
<el-form-item v-if="trialShow" :label="$t('publish.whetherToTry')" required>
|
||||
<!-- v-if="trialShow" -->
|
||||
<el-form-item :label="$t('publish.whetherToTry')" required>
|
||||
<el-radio-group v-model="trial">
|
||||
<el-radio label="1">{{ $t('publish.trialNo') }}</el-radio>
|
||||
<el-radio label="2">{{ $t('publish.trialYes') }}</el-radio>
|
||||
@ -67,7 +73,8 @@
|
||||
|
||||
<script>
|
||||
import { getPublishLessonList } from '@/api/jmap/lesson';
|
||||
import { getExamLessonDetail, updateExamRules } from '@/api/management/exam';
|
||||
import { getExamLessonDetail, updateExamRules, getExamClassList } from '@/api/management/exam';
|
||||
import { getSessionStorage } from '@/utils/auth';
|
||||
|
||||
export default {
|
||||
name: 'ExamFrom',
|
||||
@ -121,6 +128,7 @@ export default {
|
||||
formDetail: {
|
||||
name: '',
|
||||
region: '',
|
||||
classes: [],
|
||||
startDate: '',
|
||||
endDate: '',
|
||||
desc: '',
|
||||
@ -130,9 +138,10 @@ export default {
|
||||
passMark: ''
|
||||
},
|
||||
trial: '1',
|
||||
trialShow: false,
|
||||
// trialShow: false,
|
||||
form: this.$store.state.exam.courseDetail,
|
||||
options: [],
|
||||
classList: [],
|
||||
selectDisable: false,
|
||||
rules: {
|
||||
name: [
|
||||
@ -141,6 +150,9 @@ export default {
|
||||
region: [
|
||||
{ required: true, message: this.$t('publish.selectTestScope'), trigger: 'change' }
|
||||
],
|
||||
classes: [
|
||||
{ required: true, message: '请选择班级', trigger: 'change' }
|
||||
],
|
||||
duration: [
|
||||
{ required: true, validator: duration, trigger: 'blur' }
|
||||
],
|
||||
@ -159,6 +171,9 @@ export default {
|
||||
computed: {
|
||||
isEdit() {
|
||||
return this.$route.params.mode == 'edit';
|
||||
},
|
||||
isClassShow() {
|
||||
return getSessionStorage('project').startsWith('gzb');
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
@ -181,16 +196,18 @@ export default {
|
||||
this.refresh();
|
||||
},
|
||||
mounted() {
|
||||
const user = this.$store.state.user;
|
||||
const roles = user.roles;
|
||||
this.trialShow = roles.indexOf('04') != -1;
|
||||
// const user = this.$store.state.user;
|
||||
// const roles = user.roles;
|
||||
// this.trialShow = roles.indexOf('04') != -1;
|
||||
this.init();
|
||||
this.getClassList();
|
||||
},
|
||||
methods: {
|
||||
setData(data) {
|
||||
this.form = {
|
||||
name: data.name,
|
||||
region: data.region,
|
||||
classes: data.classes,
|
||||
startDate: Date.parse(new Date(data.startDate)),
|
||||
endDate: Date.parse(new Date(data.endDate)),
|
||||
desc: data.desc,
|
||||
@ -200,6 +217,14 @@ export default {
|
||||
passMark: data.passMark
|
||||
};
|
||||
},
|
||||
getClassList() {
|
||||
if (this.isClassShow) {
|
||||
this.classList = [];
|
||||
getExamClassList(this.$route.params.lessonId).then(res => {
|
||||
this.classList = res.data;
|
||||
});
|
||||
}
|
||||
},
|
||||
init() {
|
||||
this.$nextTick(() => {
|
||||
if (this.$route.params.ruleId != 0) {
|
||||
@ -207,6 +232,7 @@ export default {
|
||||
this.formDetail = {
|
||||
name: res.data.name,
|
||||
region: `${res.data.lessonId}`,
|
||||
classes: res.data.classes ? res.data.classes.map(ele => ele.id) : [],
|
||||
startDate: Date.parse(new Date(res.data.startTime)),
|
||||
endDate: Date.parse(new Date(res.data.endTime)),
|
||||
desc: res.data.remarks,
|
||||
@ -243,6 +269,21 @@ export default {
|
||||
}
|
||||
});
|
||||
},
|
||||
createQuickly() {
|
||||
this.$refs['form'].validate((valid) => {
|
||||
if (valid) {
|
||||
if (this.form.startDate) {
|
||||
this.form.startDate = this.getDate(this.form.startDate);
|
||||
}
|
||||
if (this.form.endDate) {
|
||||
this.form.endDate = this.getDate(this.form.endDate);
|
||||
}
|
||||
this.form['trial'] = this.trial;
|
||||
this.$store.dispatch('exam/setCourseDetail', this.form);
|
||||
this.$emit('createQuickly', this.form);
|
||||
}
|
||||
});
|
||||
},
|
||||
getDate(date) {
|
||||
const now = new Date(date);
|
||||
const y = now.getFullYear();
|
||||
@ -251,20 +292,21 @@ export default {
|
||||
return y + '-' + (m < 10 ? '0' + m : m) + '-' + (d < 10 ? '0' + d : d) + ' ' + now.toTimeString().substr(0, 8);
|
||||
},
|
||||
updateForm() {
|
||||
this.$refs['form'].validate((valid) => {
|
||||
this.$refs['form'].validate(async (valid) => {
|
||||
if (valid) {
|
||||
const model = {
|
||||
id: this.$route.params.ruleId,
|
||||
name: this.form.name,
|
||||
classes: this.form.classes.map(ele => { return { id: ele}; }),
|
||||
trial: this.trial == 2
|
||||
};
|
||||
|
||||
updateExamRules(model).then(response => {
|
||||
try {
|
||||
await updateExamRules(model);
|
||||
this.$store.dispatch('exam/setCourseDetail', this.form);
|
||||
this.$message.success(this.$t('publish.updateExamRuleSuccess'));
|
||||
}).catch(() => {
|
||||
} catch (error) {
|
||||
this.$messageBox(this.$t('publish.updateExamRuleFailed'));
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
@ -10,7 +10,7 @@
|
||||
</el-steps>
|
||||
<div class="joylink-card forms">
|
||||
<template v-if="display == 1" class="definition">
|
||||
<exam-from ref="exam" @definition="definition" />
|
||||
<exam-from ref="exam" @definition="definition" @createQuickly="createQuicklySave" />
|
||||
</template>
|
||||
<template v-else class="rule">
|
||||
<rule-from ref="rule" :course="course" :draw-way="drawWay" :line-code="lineCode" @regulation="regulation" />
|
||||
@ -23,6 +23,7 @@
|
||||
<el-button v-if="isUpdate" type="warning" @click="update">{{ $t('global.update') }}</el-button>
|
||||
<el-button v-if="isCreate" type="primary" @click="create">{{ $t('global.create') }}</el-button>
|
||||
<el-button type="primary" @click="turnback">{{ $t('global.back') }}</el-button>
|
||||
<el-button v-if="isFastCreate" type="primary" @click="createQuickly">快速创建</el-button>
|
||||
</el-button-group>
|
||||
</div>
|
||||
</div>
|
||||
@ -34,6 +35,9 @@ import { getPublishLessonList } from '@/api/jmap/lesson';
|
||||
import RuleFrom from './rule';
|
||||
import ExamFrom from './examFrom';
|
||||
import { getPublishMapInfo } from '@/api/jmap/map';
|
||||
import { getExamLessonDetail, setCourseList, setCourseListGzb } from '@/api/management/exam';
|
||||
import { UrlConfig } from '@/scripts/ConstDic';
|
||||
import { getSessionStorage } from '@/utils/auth';
|
||||
|
||||
export default {
|
||||
name: 'ExamRule',
|
||||
@ -65,6 +69,12 @@ export default {
|
||||
},
|
||||
isCreate() {
|
||||
return this.display == 2;
|
||||
},
|
||||
isFastCreate() {
|
||||
return this.display == 1 && this.$route.params.mode != 'edit' && Number(this.$route.params.ruleId);
|
||||
},
|
||||
isGzbShow() {
|
||||
return getSessionStorage('project').startsWith('gzb');
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
@ -94,7 +104,7 @@ export default {
|
||||
});
|
||||
});
|
||||
},
|
||||
definition(data) {
|
||||
async definition(data) {
|
||||
this.course = data;
|
||||
this.formData = {};
|
||||
this.display = 2;
|
||||
@ -103,10 +113,57 @@ export default {
|
||||
this.mapId = elem.mapId;
|
||||
}
|
||||
});
|
||||
getPublishMapInfo(this.mapId).then(res=>{
|
||||
const res = await getPublishMapInfo(this.mapId);
|
||||
if (res.data) {
|
||||
this.drawWay = res.data.drawWay;
|
||||
this.lineCode = res.data.lineCode;
|
||||
}
|
||||
},
|
||||
async createQuicklySave(data) {
|
||||
this.OrganizationList.forEach(elem => {
|
||||
if (elem.id == data.region) {
|
||||
this.mapId = elem.mapId;
|
||||
}
|
||||
});
|
||||
const resp = await getExamLessonDetail(this.$route.params.ruleId);
|
||||
const ruleList = resp.data.examDefinitionRulesVOList;
|
||||
const result = {
|
||||
duration: Number(data.duration) * 60, // 时长
|
||||
examDefinitionRulesVOList: ruleList, // 规则
|
||||
fullPoint: Number(data.fullMark), // 满分
|
||||
classes: data.classes.map(ele => { return {id: ele}; }),
|
||||
lessonId: data.region, // 课程id
|
||||
name: data.name, // 名称
|
||||
passingPoint: Number(data.passMark), // 及格分
|
||||
remarks: data.desc, // 考试说明
|
||||
endTime: data.endDate,
|
||||
startTime: data.startDate,
|
||||
type: data.type, // 类型
|
||||
trial: data.trial == 2 // 权限判断
|
||||
};
|
||||
let res = {};
|
||||
try {
|
||||
if (this.isGzbShow) {
|
||||
res = await setCourseListGzb(result);
|
||||
} else {
|
||||
res = await setCourseList(result);
|
||||
}
|
||||
this.$message.success({ message: res.message });
|
||||
this.$store.dispatch('exam/setRuleList', []); // 清空规则列表数据
|
||||
const path = `${this.$route.path.match(/(\/.*)\/examRule/)[1]}${UrlConfig.examRuleManage}`;
|
||||
const lessonId = this.$route.params.lessonId;
|
||||
if (parseInt(lessonId)) {
|
||||
this.$router.push({ path: `${path}`, query: { lessonId: lessonId } });
|
||||
} else {
|
||||
this.$router.push({ path: `${path}` });
|
||||
}
|
||||
} catch (error) {
|
||||
if (error) {
|
||||
this.$messageBox(`${this.$t('publish.saveRuleFailed')} ${error.message}`);
|
||||
} else {
|
||||
this.$messageBox(`${this.$t('publish.saveRuleFailed')}`);
|
||||
}
|
||||
}
|
||||
},
|
||||
regulation(data) {
|
||||
this.formData = data;
|
||||
@ -117,6 +174,9 @@ export default {
|
||||
}
|
||||
});
|
||||
},
|
||||
createQuickly() {
|
||||
this.$refs.exam.createQuickly();
|
||||
},
|
||||
prevStep() {
|
||||
this.$refs.rule.regulation();
|
||||
},
|
||||
|
@ -27,13 +27,14 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { getExamLessonDetail, setCourseList } from '@/api/management/exam';
|
||||
import { getExamLessonDetail, setCourseList, setCourseListGzb } from '@/api/management/exam';
|
||||
import { getDetailList } from '@/api/management/dictionary';
|
||||
import { UrlConfig } from '@/scripts/ConstDic';
|
||||
import editRule from './editRule';
|
||||
import LangStorage from '@/utils/lang';
|
||||
import ConstConfig from '@/scripts/ConstConfig';
|
||||
import CMD from '@/scripts/cmdPlugin/CommandEnum';
|
||||
import { getSessionStorage } from '@/utils/auth';
|
||||
|
||||
export default {
|
||||
name: 'Rule',
|
||||
@ -79,10 +80,15 @@ export default {
|
||||
trainingOperateTypeMap: {}
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
isGzbShow() {
|
||||
return getSessionStorage('project').startsWith('gzb');
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
},
|
||||
async mounted() {
|
||||
if (this.drawWay) {
|
||||
if (this.drawWay) {
|
||||
this.trainingOperateTypeMap = {
|
||||
Switch: [],
|
||||
Section: [],
|
||||
@ -202,6 +208,7 @@ export default {
|
||||
examDefinitionRulesVOList: this.ruleList, // 规则
|
||||
fullPoint: Number(this.course.fullMark), // 满分
|
||||
lessonId: this.course.region, // 课程id
|
||||
classes: this.course.classes.map(ele => { return {id: ele}; }),
|
||||
name: this.course.name, // 名称
|
||||
passingPoint: Number(this.course.passMark), // 及格分
|
||||
remarks: this.course.desc, // 考试说明
|
||||
@ -218,8 +225,14 @@ export default {
|
||||
this.$messageBox(this.$t('publish.addExamRules'));
|
||||
}
|
||||
},
|
||||
save(data) {
|
||||
setCourseList(data).then(res => {
|
||||
async save(data) {
|
||||
try {
|
||||
let res = {};
|
||||
if (this.isGzbShow) {
|
||||
res = await setCourseListGzb(data);
|
||||
} else {
|
||||
res = await setCourseList(data);
|
||||
}
|
||||
this.$message.success({ message: res.message });
|
||||
this.$store.dispatch('exam/setCourseDetail', this.formDetail); // 清空 form 表单数据
|
||||
this.$store.dispatch('exam/setRuleList', []); // 清空规则列表数据
|
||||
@ -230,13 +243,13 @@ export default {
|
||||
} else {
|
||||
this.$router.push({ path: `${path}` });
|
||||
}
|
||||
}).catch(error => {
|
||||
} catch (error) {
|
||||
if (error) {
|
||||
this.$messageBox(`${this.$t('publish.saveRuleFailed')} ${error.message}`);
|
||||
} else {
|
||||
this.$messageBox(`${this.$t('publish.saveRuleFailed')}`);
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
addRuleList(data, arr) {
|
||||
let value;
|
||||
|
@ -34,7 +34,7 @@
|
||||
<script>
|
||||
import Vue from 'vue';
|
||||
import GetActionNew from '../scriptRecord/getActionNew';
|
||||
import {getScriptMemberDataNew, executeScriptNew, dumpScriptDataNew, saveScriptDataNew, saveScriptScenesNew, updateMapLocationNew, simulationPause} from '@/api/simulation';
|
||||
import {getSimulationMemberList, executeScriptNew, dumpScriptDataNew, saveScriptDataNew, saveScriptScenesNew, updateMapLocationNew, simulationPause} from '@/api/simulation';
|
||||
import ConstConfig from '@/scripts/ConstConfig';
|
||||
import {getDraftScriptByGroupNew, changeScriptRole} from '@/api/script';
|
||||
import Cookies from 'js-cookie';
|
||||
@ -112,7 +112,7 @@ export default {
|
||||
},
|
||||
methods:{
|
||||
initData() {
|
||||
getScriptMemberDataNew(this.group).then(resp => {
|
||||
getSimulationMemberList(this.group).then(resp => {
|
||||
const lastData = JSON.stringify(resp.data);
|
||||
this.memberList = this.covert(lastData, ConstConfig.ConstSelect.roleTypeNew);
|
||||
}).catch(error => {
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user