Merge branch 'test' of https://git.code.tencent.com/lian-cbtc/jl-client into test
This commit is contained in:
commit
f02775868c
@ -686,8 +686,8 @@ class SkinCode extends defaultStyle {
|
||||
trainServerOffset: { x: 4, y: 4 }// 列车服务号偏移
|
||||
},
|
||||
trainTarget: {
|
||||
tripNumberPrefix: '000', // 车次号前缀
|
||||
defaultTripNumber: 'DDD', // 默认车次号2
|
||||
tripNumberPrefix: '0000', // 车次号前缀
|
||||
defaultTripNumber: 'BBBB', // 默认车次号2
|
||||
trainTargetOffset: { x: 36, y: 4 }, // 列车车次号偏移
|
||||
trainTargetTextAlign: 'left'// 车次号文字显示位置
|
||||
},
|
||||
@ -708,7 +708,7 @@ class SkinCode extends defaultStyle {
|
||||
common: {
|
||||
trainHeight: 20, // 列车高度
|
||||
trainHeadDistance: 4, // 列车和车头之间的间距
|
||||
trainWidth: 40, // 列车长度
|
||||
trainWidth: 48, // 列车长度
|
||||
trainTextFontSize: 12, // 列车字号
|
||||
fontFamily: 'consolas', // 默认字体 族类
|
||||
haveTextHSDA: true, // 是否需创建textHSDA对象
|
||||
|
@ -256,6 +256,7 @@ class Jlmap {
|
||||
} else {
|
||||
elem['points'] = { x: model.points[model.points.length - 1].x, y: model.points[model.points.length - 1].y };
|
||||
}
|
||||
console.log(elem, 'overAp');
|
||||
}
|
||||
// const oDevice = this.mapDevice[code] || deviceFactory(type, elem, this.showConfig);
|
||||
const oDevice = deviceFactory(type, elem, this.showConfig);
|
||||
|
@ -27,7 +27,6 @@ const Jlmap3dOtherVR = () => import('@/views/jlmap3d/maintainer/jl3dothervr');
|
||||
const DisplayNew = () => import('@/views/newMap/displayNew/index');
|
||||
const DesignDisplayNew = () => import('@/views/newMap/displayNew/scriptDisplay/scriptPreview/index');
|
||||
|
||||
const TrainRoom = () => import('@/views/trainRoom/index');
|
||||
const JointTrainingNew = () => import('@/views/newMap/jointTrainingNew/index');
|
||||
|
||||
const Errpr404 = () => import('@/views/error-page/404');
|
||||
@ -60,7 +59,6 @@ const Taskmanage = () => import('@/views/lesson/taskmanage/list');
|
||||
const TrainingRuleList = () => import('@/views/lesson/trainingRule/list');
|
||||
const TrainingRuleEdit = () => import('@/views/lesson/trainingRule/detail/index');
|
||||
const Trainingmanage = () => import('@/views/lesson/trainingmanage/index');
|
||||
const TrainingmanageOld = () => import('@/views/lesson/trainingmanage/oldMap');
|
||||
const LessonEdit = () => import('@/views/lesson/lessoncategory/index');
|
||||
const LessonHome = () => import('@/views/lesson/home');
|
||||
const LessonDetail = () => import('@/views/lesson/details');
|
||||
@ -325,11 +323,6 @@ export const publicAsyncRoute = [
|
||||
component: BigSplitScreen,
|
||||
hidden: true
|
||||
},
|
||||
{ // 综合演练室
|
||||
path: '/trainroom',
|
||||
component: TrainRoom,
|
||||
hidden: true
|
||||
},
|
||||
{
|
||||
path: '/refereeJsxtDisplay',
|
||||
component: RefereeDisplay,
|
||||
@ -461,11 +454,6 @@ export const asyncRouter = [
|
||||
component: Trainingmanage,
|
||||
hidden: true
|
||||
},
|
||||
{// 老地图实训管理
|
||||
path: 'lesson/TrainingmanageOld',
|
||||
component: TrainingmanageOld,
|
||||
hidden: true
|
||||
},
|
||||
{ // 创建课程
|
||||
path: 'lesson/edit/:type',
|
||||
component: LessonEdit,
|
||||
|
@ -17,7 +17,6 @@ const Jlmap3dPassFlow = () => import('@/views/jlmap3d/passflow/jl3dpassflow');
|
||||
const Jlmap3dTrain = () => import('@/views/jlmap3d/devicetrain/jl3ddevicetrain');
|
||||
const DisplayNew = () => import('@/views/newMap/displayNew/index');
|
||||
|
||||
const TrainRoom = () => import('@/views/trainRoom/index');
|
||||
const JointTrainingNew = () => import('@/views/newMap/jointTrainingNew/index');
|
||||
|
||||
const Errpr404 = () => import('@/views/error-page/404');
|
||||
@ -209,12 +208,6 @@ export const publicAsyncRoute = [
|
||||
component: DisplayNew,
|
||||
hidden: true
|
||||
},
|
||||
|
||||
{ // 综合演练室
|
||||
path: '/trainroom',
|
||||
component: TrainRoom,
|
||||
hidden: true
|
||||
},
|
||||
{
|
||||
path: '/jointTrainingNew',
|
||||
component: JointTrainingNew,
|
||||
|
@ -2,13 +2,13 @@ import { getSessionStorage } from '@/utils/auth';
|
||||
import { listPublishMap, getMapListByProjectCode } from '@/api/jmap/map';
|
||||
import { ProjectCode } from '@/scripts/ProjectConfig';
|
||||
|
||||
export async function getMapListByProject(drawWay) {
|
||||
export async function getMapListByProject() {
|
||||
const project = getSessionStorage('project');
|
||||
let mapList = [];
|
||||
if (project.endsWith('xty') || project.endsWith('gzb')) {
|
||||
mapList = await getMapListByProjectCode(ProjectCode[project]);
|
||||
} else {
|
||||
mapList = await listPublishMap({ 'drawWay': drawWay });
|
||||
mapList = await listPublishMap({ 'drawWay': true });
|
||||
}
|
||||
return mapList;
|
||||
}
|
||||
|
@ -116,17 +116,9 @@ export default {
|
||||
},
|
||||
async handleJoinRoom(data) {
|
||||
try {
|
||||
const rest = await getPublishMapInfo(data.map.id);
|
||||
launchFullscreen();
|
||||
if (rest.data.drawWay) {
|
||||
const query = { lineCode: data.map.lineCode, mapId: data.map.id, group: data.group};
|
||||
this.$router.push({path:'/jointTrainingNew', query:query});
|
||||
} else {
|
||||
await getjointTraining(data.group);
|
||||
const query = { group: data.group, drawWay: rest.data.drawWay };
|
||||
this.$router.push({ path: `/trainroom`, query: query });
|
||||
}
|
||||
|
||||
} catch (e) {
|
||||
console.error(e);
|
||||
} finally {
|
||||
|
@ -76,24 +76,9 @@ export default {
|
||||
try {
|
||||
this.loading = true;
|
||||
const rest = await getPublishMapInfo(this.mapId);
|
||||
const drawWay = rest.data.drawWay;
|
||||
if (drawWay) {
|
||||
launchFullscreen();
|
||||
const query = { lineCode: this.lineCode, mapId: this.mapId, group: this.group};
|
||||
this.$router.push({path: `/jointTrainingNew`, query: query});
|
||||
} 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 };
|
||||
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 });
|
||||
}
|
||||
}
|
||||
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>
|
||||
@ -63,7 +61,6 @@ export default {
|
||||
jointShow: false,
|
||||
jointGroup: '',
|
||||
lineCode:'',
|
||||
drawWay: false, // 是否新版地图
|
||||
loadingProjectList: ['login', 'design', 'xty', 'designxty', 'gzb', 'designxty', 'xadt', 'designxadt', 'drts', 'designdrts']
|
||||
};
|
||||
},
|
||||
@ -88,19 +85,13 @@ export default {
|
||||
return this.courseModel.prdType === '03';
|
||||
},
|
||||
isStartDemon() {
|
||||
return (this.hasPermssion || this.tryTime > 0) && !(this.courseModel.prdType === '03' && !this.drawWay);
|
||||
return (this.hasPermssion || this.tryTime > 0);
|
||||
},
|
||||
mapId() {
|
||||
return this.$route.query.mapId;
|
||||
},
|
||||
project() {
|
||||
return getSessionStorage('project');
|
||||
},
|
||||
isCreateRoom() {
|
||||
return this.courseModel.prdType === '03' && this.hasPermssion && !this.jointShow && !this.drawWay;
|
||||
},
|
||||
isInRoom() {
|
||||
return this.courseModel.prdType === '03' && this.hasPermssion && this.jointShow && !this.drawWay;
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
@ -130,7 +121,6 @@ export default {
|
||||
const resp = await getSubSystemDetail(this.$route.params.subSystem);
|
||||
this.tryUser = 0;
|
||||
this.loading = false;
|
||||
this.drawWay = res.data.drawWay;
|
||||
const remarksList = {
|
||||
'01':'ATS现地工作站原理级仿真系统,实现车站值班员培训功能。',
|
||||
'02':'ATS行调工作站原理级仿真系统,实现行车调度员培训功能。',
|
||||
@ -151,9 +141,6 @@ export default {
|
||||
PermissionType: PermissionType.SIMULATION
|
||||
};
|
||||
this.currentPrdType = resp.data.prdType;
|
||||
if (resp.data.prdType === '03' && !this.drawWay) {
|
||||
this.getJointTrainingList();
|
||||
}
|
||||
if (!this.courseModel.pmsList) {
|
||||
this.tryUser = 1;
|
||||
const paras = {
|
||||
@ -200,7 +187,7 @@ export default {
|
||||
this.disabled = true;
|
||||
await getjointTraining(this.jointGroup);
|
||||
this.$store.dispatch('socket/setInRoom', true);
|
||||
const query = { lineCode: this.courseModel.lineCode, group: this.jointGroup, drawWay: this.drawWay};
|
||||
const query = { lineCode: this.courseModel.lineCode, group: this.jointGroup};
|
||||
this.$router.push({ path: `/trainroom`, query: query });
|
||||
},
|
||||
async createRoom() {
|
||||
@ -212,7 +199,7 @@ export default {
|
||||
};
|
||||
const res = await postCreateRoom(param);
|
||||
if (res && res.code == 200) {
|
||||
const query = { lineCode: this.courseModel.lineCode, group: res.data, drawWay: this.drawWay };
|
||||
const query = { lineCode: this.courseModel.lineCode, group: res.data };
|
||||
this.$router.push({ path: `/trainroom`, query: query });
|
||||
}
|
||||
} catch (error) {
|
||||
@ -232,7 +219,7 @@ export default {
|
||||
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 };
|
||||
const query = { lineCode: this.courseModel.lineCode, group: resp.data, mapId: this.courseModel.mapId};
|
||||
if (this.loadingProjectList.includes(this.project)) {
|
||||
this.$store.dispatch('app/transitionAnimations');
|
||||
}
|
||||
@ -248,11 +235,7 @@ export default {
|
||||
this.disabled = true;
|
||||
const data = { mapId: this.courseModel.mapId, prdType: this.currentPrdType, lineCode: this.courseModel.lineCode };
|
||||
let res = {};
|
||||
if (!this.drawWay) {
|
||||
res = await simulationNotify(data);
|
||||
} else {
|
||||
res = await createSimulationNew(data);
|
||||
}
|
||||
if (res && res.code == 200) {
|
||||
const query = { group: res.data, lineCode:this.courseModel.lineCode };
|
||||
this.$router.push({ path: `/displayIscs/system`, query: query });
|
||||
@ -278,8 +261,7 @@ export default {
|
||||
if (this.courseModel.prdType == '05') {
|
||||
this.jumpScheduling();
|
||||
} else if (this.courseModel.prdType == '03') {
|
||||
this.drawWay && this.enterIntegratedSimulation();
|
||||
!this.drawWay && this.createRoom();
|
||||
this.enterIntegratedSimulation();
|
||||
} else if (this.courseModel.prdType == '06') {
|
||||
this.enterISCS();
|
||||
} else if (this.courseModel.prdType == '07') {
|
||||
@ -293,7 +275,6 @@ export default {
|
||||
setTimeout(() => {
|
||||
const data = { mapId: this.courseModel.mapId, prdType: this.currentPrdType };
|
||||
try {
|
||||
if (this.drawWay) {
|
||||
createSimulationNew(data).then(resp => {
|
||||
const query = { lineCode: this.courseModel.lineCode, group: resp.data, prdType: this.courseModel.prdType, mapId: this.courseModel.mapId, goodsId: this.goodsId, try: this.tryUser };
|
||||
if (this.loadingProjectList.includes(this.project)) {
|
||||
@ -302,13 +283,6 @@ export default {
|
||||
this.$router.push({ path: `${UrlConfig.displayNew}/demon`, query: query });
|
||||
launchFullscreen();
|
||||
});
|
||||
} else {
|
||||
schedulingNotify(data).then(resp => {
|
||||
const query = { lineCode: this.courseModel.lineCode, group: resp.data, prdType: this.courseModel.prdType, mapId: this.courseModel.mapId, goodsId: this.goodsId, try: this.tryUser };
|
||||
this.$router.push({ path: `${UrlConfig.display}/demon`, query: query });
|
||||
launchFullscreen();
|
||||
});
|
||||
}
|
||||
} catch (e) {
|
||||
this.$messageBox(this.$t('error.createSimulationFailed') + e.message);
|
||||
this.disabled = false;
|
||||
@ -319,16 +293,6 @@ export default {
|
||||
this.disabled = true;
|
||||
setTimeout(() => {
|
||||
const data = { mapId: this.courseModel.mapId, prdType: this.currentPrdType };
|
||||
if (!this.drawWay) {
|
||||
simulationNotify(data).then(resp => {
|
||||
const query = { lineCode: this.courseModel.lineCode, group: resp.data, prdType: this.courseModel.prdType, mapId: this.courseModel.mapId, goodsId: this.goodsId, try: this.tryUser, project: this.project };
|
||||
this.$router.push({ path: `${UrlConfig.display}/demon`, query: query });
|
||||
launchFullscreen();
|
||||
}).catch(error => {
|
||||
this.$messageBox(this.$t('error.createSimulationFailed') + error.message);
|
||||
this.disabled = false;
|
||||
});
|
||||
} else {
|
||||
createSimulationNew(data).then(resp => {
|
||||
const query = { lineCode: this.courseModel.lineCode, group: resp.data, prdType: this.courseModel.prdType, mapId: this.courseModel.mapId, goodsId: this.goodsId, try: this.tryUser, project: this.project };
|
||||
this.$store.dispatch('training/setPrdType', this.currentPrdType); // 改变prdType
|
||||
@ -341,7 +305,6 @@ export default {
|
||||
this.$messageBox(this.$t('error.createSimulationFailed') + error.message);
|
||||
this.disabled = false;
|
||||
});
|
||||
}
|
||||
}, 100);
|
||||
},
|
||||
buy() {
|
||||
|
@ -93,18 +93,18 @@ export default {
|
||||
switch (obj.type) {
|
||||
case 'scriptDesign': {
|
||||
setSessionStorage('designType', 'scriptDesign');
|
||||
const query = {lineCode:obj.lineCode, drawWay:obj.drawWay};
|
||||
const query = {lineCode:obj.lineCode};
|
||||
this.$router.push({ path: `${UrlConfig.design.scriptHome}/${obj.mapId}?`, query});
|
||||
break;
|
||||
}
|
||||
case 'lessonDesign': {
|
||||
setSessionStorage('designType', 'lessonDesign');
|
||||
this.$router.push({ path: `${UrlConfig.design.lessonHome}/${obj.mapId}?lineCode=${obj.lineCode}&cityCode=${obj.cityCode}&drawWay=${data.parent.data.drawWay}` });
|
||||
this.$router.push({ path: `${UrlConfig.design.lessonHome}/${obj.mapId}?lineCode=${obj.lineCode}&cityCode=${obj.cityCode}` });
|
||||
break;
|
||||
}
|
||||
case 'runPlanDesign': {
|
||||
setSessionStorage('designType', 'runPlanDesign');
|
||||
this.$router.push({ path: `${UrlConfig.design.runPlan}/${obj.mapId}?lineCode=${obj.lineCode}&drawWay=${obj.drawWay}` });
|
||||
this.$router.push({ path: `${UrlConfig.design.runPlan}/${obj.mapId}?lineCode=${obj.lineCode}` });
|
||||
break;
|
||||
}
|
||||
case 'map': {
|
||||
@ -152,7 +152,6 @@ export default {
|
||||
type: 'mapPreview',
|
||||
mapId: elem.id,
|
||||
cityCode: elem.cityCode,
|
||||
drawWay: elem.drawWay
|
||||
}
|
||||
];
|
||||
this.isAdministrator() ? elem.children.push({id: '2', name: this.$t('designPlatform.lessonDesign'), type: 'lessonDesign', mapId: elem.id, cityCode: elem.cityCode, lineCode: elem.lineCode}) : '';
|
||||
@ -164,7 +163,6 @@ export default {
|
||||
mapId: elem.id,
|
||||
cityCode: elem.cityCode,
|
||||
lineCode: elem.lineCode,
|
||||
drawWay: elem.drawWay
|
||||
// code:elem.children.find(n => { return n.name.includes("行调")})
|
||||
});
|
||||
elem.children.push(
|
||||
@ -175,7 +173,6 @@ export default {
|
||||
mapId: elem.id,
|
||||
lineCode: elem.lineCode,
|
||||
cityCode: elem.cityCode,
|
||||
drawWay: elem.drawWay
|
||||
}
|
||||
);
|
||||
if (process.env.VUE_APP_PRO !== 'local') {
|
||||
|
@ -85,7 +85,6 @@ export default {
|
||||
typeList: [],
|
||||
examList: [],
|
||||
trainingOperateTypeMap: {},
|
||||
drawWay: false,
|
||||
lineCode: '', // 线路对应的皮肤
|
||||
loadingProjectList: ['login', 'design', 'xty', 'designxty', 'gzb', 'designxty', 'xadt', 'designxadt', 'drts', 'designdrts']
|
||||
};
|
||||
@ -108,75 +107,17 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
async getList() {
|
||||
if (this.drawWay) {
|
||||
this.typeList = [];
|
||||
for (const val in ConstConfig.ConstSelect.trainingDeviceType) {
|
||||
this.typeList.push({name: LangStorage.getLang() == 'en' ? ConstConfig.ConstSelect.trainingDeviceType[val].enlabel : ConstConfig.ConstSelect.trainingDeviceType[val].label, code: val});
|
||||
}
|
||||
this.trainingOperateTypeMap = getTrainingOperateTypeMap();
|
||||
} else {
|
||||
this.trainingOperateTypeMap = {};
|
||||
this.$Dictionary.stationControl().then(list => {
|
||||
this.trainingOperateTypeMap['01'] = list; // 控制权实训
|
||||
});
|
||||
this.$Dictionary.signalOperation().then(list => {
|
||||
this.trainingOperateTypeMap['02'] = list; // 信号机实训
|
||||
});
|
||||
this.$Dictionary.switchOperation().then(list => {
|
||||
this.trainingOperateTypeMap['03'] = list; // 道岔实训
|
||||
});
|
||||
this.$Dictionary.sectionOperation().then(list => {
|
||||
this.trainingOperateTypeMap['04'] = list; // 区段实训
|
||||
});
|
||||
this.$Dictionary.stationStandOperation().then(list => {
|
||||
this.trainingOperateTypeMap['05'] = list; // 站台实训
|
||||
});
|
||||
this.$Dictionary.trainPlanOperation().then(list => {
|
||||
this.trainingOperateTypeMap['06'] = list; // 行车计划实训
|
||||
});
|
||||
this.$Dictionary.trainOperation().then(list => {
|
||||
this.trainingOperateTypeMap['07'] = list; // 列车实训
|
||||
});
|
||||
const res = await getDetailList('training_type');
|
||||
this.typeList = res.data;
|
||||
if (LangStorage.getLang() == 'en' && this.typeList) {
|
||||
this.typeList.forEach(item => {
|
||||
switch (item.code) {
|
||||
case '01':
|
||||
item.name = 'Control permission operation';
|
||||
break;
|
||||
case '02':
|
||||
item.name = 'Signalling machine operation';
|
||||
break;
|
||||
case '03':
|
||||
item.name = 'Turnout operation';
|
||||
break;
|
||||
case '04':
|
||||
item.name = 'Section operation';
|
||||
break;
|
||||
case '05':
|
||||
item.name = 'Platform operation';
|
||||
break;
|
||||
case '06':
|
||||
item.name = 'Train scheduling operation';
|
||||
break;
|
||||
case '07':
|
||||
item.name = 'Train operation';
|
||||
break;
|
||||
case '08':
|
||||
item.name = 'Temporary speed limit operation of the whole line';
|
||||
break;
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
},
|
||||
async loadInitPage(examId) {
|
||||
if (examId) {
|
||||
try {
|
||||
const response = await getPublishMapInfo(this.$route.query.mapId);
|
||||
if (response.data) {
|
||||
this.drawWay = response.data.drawWay;
|
||||
this.lineCode = response.data.lineCode;
|
||||
this.typeList = [];
|
||||
await this.getList();
|
||||
@ -246,26 +187,7 @@ export default {
|
||||
async exmaStart() {
|
||||
this.disabled = true;
|
||||
await this.examDetail();
|
||||
if (this.examList.length && !this.drawWay) {
|
||||
examNotify({ examId: this.$route.params.examId }).then(resp => {
|
||||
const query = {
|
||||
group: resp.data,
|
||||
trainingId: this.examList[0].trainingId,
|
||||
userExamId: this.userExam.id,
|
||||
examQuestionId: this.examList[0].id,
|
||||
subSystem: this.$route.query.subSystem,
|
||||
examId: this.$route.params.examId,
|
||||
mapId: this.$route.query.mapId,
|
||||
lineCode: this.lineCode,
|
||||
noPreLogout: this.$route.query.noPreLogout
|
||||
};
|
||||
this.$router.push({ path: `${UrlConfig.display}/exam`, query: query });
|
||||
launchFullscreen();
|
||||
}).catch(error => {
|
||||
this.disabled = false;
|
||||
this.$messageBox( this.$t('error.createSimulationFailed') + `: ${error.message}`);
|
||||
});
|
||||
} else if (this.examList.length && this.drawWay) {
|
||||
if (this.examList.length) {
|
||||
examNotifyNew({ examId: this.$route.params.examId }).then(resp => {
|
||||
const query = {
|
||||
group: resp.data,
|
||||
|
@ -66,9 +66,6 @@ export default {
|
||||
]),
|
||||
ibpId() {
|
||||
return ['ibp', (Math.random().toFixed(5)) * 100000].join('_');
|
||||
},
|
||||
drawWay() {
|
||||
return this.$route.query.drawWay + '';
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
|
@ -130,10 +130,8 @@ export default {
|
||||
getLineCodeList().then(response => {
|
||||
this.lineCodeList = response.data;
|
||||
});
|
||||
|
||||
// 新地图
|
||||
const drawWay = true;
|
||||
getMapListByProject(drawWay).then(response => {
|
||||
getMapListByProject().then(response => {
|
||||
this.publishMapList = response.data;
|
||||
}).catch(() => {
|
||||
this.$messageBox(this.$t('map.failedLoadListPublishedMaps'));
|
||||
|
@ -67,9 +67,6 @@ export default {
|
||||
iscsId() {
|
||||
return ['iscs', (Math.random().toFixed(5)) * 100000].join('_');
|
||||
},
|
||||
drawWay() {
|
||||
return this.$route.query.drawWay + '';
|
||||
},
|
||||
width() {
|
||||
return this.$store.state.config.width;
|
||||
},
|
||||
@ -262,17 +259,11 @@ 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();
|
||||
});
|
||||
} else {
|
||||
putJointTrainingSimulationUser(this.group).then(() => {
|
||||
this.$router.replace({ path: `/trainroom`, query: { group: this.group, lineCode:this.$route.query.lineCode } });
|
||||
exitFullscreen();
|
||||
});
|
||||
}
|
||||
|
||||
});
|
||||
},
|
||||
iscsDestroy() {
|
||||
|
@ -35,10 +35,6 @@
|
||||
|
||||
},
|
||||
props: {
|
||||
drawWay: {
|
||||
type: String,
|
||||
default: 'false'
|
||||
},
|
||||
groupNum: {
|
||||
type: String,
|
||||
default: null
|
||||
|
@ -16,7 +16,7 @@
|
||||
</el-select>
|
||||
</div>
|
||||
|
||||
<Centerc-Pane ref="centercontrol" :draw-way="drawWay" :group-num="groupnum" :user-role="userrole" />
|
||||
<Centerc-Pane ref="centercontrol" :group-num="groupnum" :user-role="userrole" />
|
||||
|
||||
<!-- <Left-Pane ref="leftcontrol" /> -->
|
||||
|
||||
@ -87,7 +87,6 @@ import axios from 'axios';
|
||||
trainlist:null,
|
||||
groupnum:"",
|
||||
userrole:'',
|
||||
drawWay:'',
|
||||
nowdrive:null,
|
||||
|
||||
tuoguanbutton:false,
|
||||
|
@ -86,13 +86,13 @@ export default {
|
||||
return data.name.indexOf(value) !== -1;
|
||||
},
|
||||
editLesson() {
|
||||
this.$router.push( {path: `/design/lesson/details/edit/lessonEdit`, query: {id: this.lessonId, cityCode: this.$route.query.cityCode, mapId: this.$route.query.mapId, drawWay: this.$route.query.drawWay, lineCode:this.$route.query.lineCode}} );
|
||||
this.$router.push( {path: `/design/lesson/details/edit/lessonEdit`, query: {id: this.lessonId, cityCode: this.$route.query.cityCode, mapId: this.$route.query.mapId, lineCode:this.$route.query.lineCode}} );
|
||||
},
|
||||
createChapte(node) {
|
||||
this.$router.push({path: `/design/lesson/details/edit/chapterCreate`, query: {id: node.data.id, type:node.data.type, lessonId: this.lessonId, cityCode: this.$route.query.cityCode, mapId: this.$route.query.mapId, drawWay: this.$route.query.drawWay, lineCode:this.$route.query.lineCode}});
|
||||
this.$router.push({path: `/design/lesson/details/edit/chapterCreate`, query: {id: node.data.id, type:node.data.type, lessonId: this.lessonId, cityCode: this.$route.query.cityCode, mapId: this.$route.query.mapId, lineCode:this.$route.query.lineCode}});
|
||||
},
|
||||
updateChapte(node) {
|
||||
this.$router.push( {path: `/design/lesson/details/edit/chapterEdit`, query: {id: node.data.id, type:node.data.type, lessonId: this.lessonId, cityCode: this.$route.query.cityCode, mapId: this.$route.query.mapId, drawWay: this.$route.query.drawWay, lineCode:this.$route.query.lineCode}});
|
||||
this.$router.push( {path: `/design/lesson/details/edit/chapterEdit`, query: {id: node.data.id, type:node.data.type, lessonId: this.lessonId, cityCode: this.$route.query.cityCode, mapId: this.$route.query.mapId, lineCode:this.$route.query.lineCode}});
|
||||
},
|
||||
showContextMenu(e, obj, node, vueElem) {
|
||||
if (obj && obj.type === 'Lesson' || obj.type === 'Chapter') {
|
||||
|
@ -175,7 +175,7 @@ export default {
|
||||
this.$refs.queryListPage.refresh(true);
|
||||
},
|
||||
lessonCreate() {
|
||||
this.$router.push({ path: `${UrlConfig.design.lessonEdit}/lessonCreate`, query: {mapId: this.$route.params.mapId, cityCode: this.$route.query.cityCode, drawWay: this.$route.query.drawWay, lineCode: this.$route.query.lineCode} });
|
||||
this.$router.push({ path: `${UrlConfig.design.lessonEdit}/lessonCreate`, query: {mapId: this.$route.params.mapId, cityCode: this.$route.query.cityCode, lineCode: this.$route.query.lineCode} });
|
||||
},
|
||||
lessonCreateByPublish() {
|
||||
this.$nextTick(() => {
|
||||
@ -204,14 +204,10 @@ export default {
|
||||
this.$router.push({path: `${UrlConfig.design.taskManage}`, query: {mapId: this.$route.params.mapId}});
|
||||
},
|
||||
trainingManage() {
|
||||
if (this.$route.query.drawWay + '' === 'true') {
|
||||
this.$router.push({path: `${UrlConfig.design.trainingManage}`, query: {mapId: this.$route.params.mapId, drawWay: this.$route.query.drawWay, lineCode: this.$route.query.lineCode}});
|
||||
} else {
|
||||
this.$router.push({path: `${UrlConfig.design.trainingManageOld}`, query: {mapId: this.$route.params.mapId, drawWay: this.$route.query.drawWay, lineCode: this.$route.query.lineCode}});
|
||||
}
|
||||
this.$router.push({path: `${UrlConfig.design.trainingManage}`, query: {mapId: this.$route.params.mapId, lineCode: this.$route.query.lineCode}});
|
||||
},
|
||||
operationManage() {
|
||||
this.$router.push({path: `${UrlConfig.design.trainingRule}`, query: {mapId: this.$route.params.mapId, lineCode: this.$route.query.lineCode, drawWay: this.$route.query.drawWay}});
|
||||
this.$router.push({path: `${UrlConfig.design.trainingRule}`, query: {mapId: this.$route.params.mapId, lineCode: this.$route.query.lineCode}});
|
||||
},
|
||||
revertLesson(index, row) {
|
||||
this.$confirm(this.$t('tip.cancelCoursePublicationHint'), this.$t('global.tips'), {
|
||||
@ -234,7 +230,7 @@ export default {
|
||||
this.$refs.lessonDetail.show(row.id);
|
||||
},
|
||||
goDetail(index, row) {
|
||||
this.$router.push({path: `/design/lesson/details`, query: {lessonId: row.id, lineCode: this.$route.query.lineCode, cityCode: this.$route.query.cityCode, mapId: this.$route.params.mapId, drawWay: this.$route.query.drawWay}});
|
||||
this.$router.push({path: `/design/lesson/details`, query: {lessonId: row.id, lineCode: this.$route.query.lineCode, cityCode: this.$route.query.cityCode, mapId: this.$route.params.mapId}});
|
||||
}
|
||||
}
|
||||
};
|
||||
|
@ -217,7 +217,7 @@ export default {
|
||||
});
|
||||
},
|
||||
back() {
|
||||
this.$router.push({ path: `${UrlConfig.design.lessonHome}/${this.$route.query.mapId}`, query: {cityCode: this.$route.query.cityCode, drawWay: this.$route.query.drawWay, lineCode: this.$route.query.lineCode} });
|
||||
this.$router.push({ path: `${UrlConfig.design.lessonHome}/${this.$route.query.mapId}`, query: {cityCode: this.$route.query.cityCode, lineCode: this.$route.query.lineCode} });
|
||||
}
|
||||
}
|
||||
};
|
||||
|
@ -158,11 +158,7 @@ export default {
|
||||
params['mapId'] = this.detail.mapId;
|
||||
params['prdType'] = this.detail.prdType;
|
||||
let res = '';
|
||||
if ((this.$route.query.drawWay + '') === 'true') {
|
||||
res = await pageQueryTrainingNew(params);
|
||||
} else {
|
||||
res = await pageQueryTraining(params);
|
||||
}
|
||||
res.data.list.forEach(item => {
|
||||
item.isShow = false;
|
||||
this.trainings.forEach(ele => {
|
||||
@ -179,7 +175,6 @@ export default {
|
||||
getPublishMapListOnline().then(response => {
|
||||
this.mapIdList = response.data;
|
||||
});
|
||||
if (this.$route.query.drawWay + '' === 'true') {
|
||||
this.trainingOperateTypeMap = getTrainingOperateTypeMap();
|
||||
const lineCode = this.$route.query.lineCode;
|
||||
const res = await getCmdList(lineCode, {});
|
||||
@ -215,68 +210,6 @@ export default {
|
||||
} else {
|
||||
this.$message.error(this.$t('error.failedToObtainTrainingType'));
|
||||
}
|
||||
} else {
|
||||
this.trainingOperateTypeMap = {};
|
||||
this.$Dictionary.stationControl().then(list => {
|
||||
this.trainingOperateTypeMap['01'] = []; // 控制权实训
|
||||
list.forEach(item => {
|
||||
this.trainingOperateTypeMap['01'].push({value: item.code, label: item.name});
|
||||
});
|
||||
});
|
||||
this.$Dictionary.signalOperation().then(list => {
|
||||
this.trainingOperateTypeMap['02'] = []; // 信号机实训
|
||||
list.forEach(item => {
|
||||
this.trainingOperateTypeMap['02'].push({value: item.code, label: item.name});
|
||||
});
|
||||
});
|
||||
this.$Dictionary.switchOperation().then(list => {
|
||||
this.trainingOperateTypeMap['03'] = []; // 道岔实训
|
||||
list.forEach(item => {
|
||||
this.trainingOperateTypeMap['03'].push({value: item.code, label: item.name});
|
||||
});
|
||||
});
|
||||
this.$Dictionary.sectionOperation().then(list => {
|
||||
this.trainingOperateTypeMap['04'] = []; // 区段实训
|
||||
list.forEach(item => {
|
||||
this.trainingOperateTypeMap['04'].push({value: item.code, label: item.name});
|
||||
});
|
||||
});
|
||||
this.$Dictionary.stationStandOperation().then(list => {
|
||||
this.trainingOperateTypeMap['05'] = []; // 站台实训
|
||||
list.forEach(item => {
|
||||
this.trainingOperateTypeMap['05'].push({value: item.code, label: item.name});
|
||||
});
|
||||
});
|
||||
this.$Dictionary.trainPlanOperation().then(list => {
|
||||
this.trainingOperateTypeMap['06'] = []; // 行车计划实训
|
||||
list.forEach(item => {
|
||||
this.trainingOperateTypeMap['06'].push({value: item.code, label: item.name});
|
||||
});
|
||||
});
|
||||
this.$Dictionary.trainOperation().then(list => {
|
||||
this.trainingOperateTypeMap['07'] = []; // 列车实训
|
||||
list.forEach(item => {
|
||||
this.trainingOperateTypeMap['07'].push({value: item.code, label: item.name});
|
||||
});
|
||||
});
|
||||
this.$Dictionary.limitOperation().then(list => {
|
||||
this.trainingOperateTypeMap['08'] = []; // 限速实训
|
||||
list.forEach(item => {
|
||||
this.trainingOperateTypeMap['08'].push({value: item.code, label: item.name});
|
||||
});
|
||||
});
|
||||
// 获取实训类型
|
||||
this.trainingTypeList = [];
|
||||
this.$Dictionary.trainingType().then(list => {
|
||||
this.trainingTypeList = list;
|
||||
list.forEach(elem => {
|
||||
this.queryForm.queryObject.type.config.data.push({
|
||||
value: elem.code,
|
||||
label: elem.name
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
const json = localStore.get(this.$route.path);
|
||||
if (json && json.type) {
|
||||
this.typeChoose(json);
|
||||
|
@ -189,7 +189,7 @@ export default {
|
||||
}
|
||||
},
|
||||
back() {
|
||||
this.$router.push({ path: `${UrlConfig.design.lessonHome}/${this.$route.query.mapId}`, query: {cityCode: this.$route.query.cityCode, lineCode: this.$route.query.lineCode, drawWay: this.$route.query.drawWay} });
|
||||
this.$router.push({ path: `${UrlConfig.design.lessonHome}/${this.$route.query.mapId}`, query: {cityCode: this.$route.query.cityCode, lineCode: this.$route.query.lineCode} });
|
||||
}
|
||||
}
|
||||
};
|
||||
|
@ -160,7 +160,6 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
init() {
|
||||
if (this.$route.query.drawWay + '' === 'true') {
|
||||
this.trainingOperateTypeMap = getTrainingOperateTypeMap();
|
||||
let val;
|
||||
const trainingDeviceTypeList = ConstConfig.ConstSelect.trainingDeviceType || {};
|
||||
@ -168,69 +167,6 @@ export default {
|
||||
this.trainingTypeList.push({code: val, name: Cookies.get('user_lang') == 'en' ? trainingDeviceTypeList[val].enlabel : trainingDeviceTypeList[val].label});
|
||||
this.queryForm.queryObject.trainingType.config.data.push({value: val, label: Cookies.get('user_lang') == 'en' ? trainingDeviceTypeList[val].enlabel : trainingDeviceTypeList[val].label});
|
||||
}
|
||||
} else {
|
||||
this.trainingOperateTypeMap = {};
|
||||
this.$Dictionary.stationControl().then(list => {
|
||||
this.trainingOperateTypeMap['01'] = []; // 控制权实训
|
||||
list.forEach(item => {
|
||||
this.trainingOperateTypeMap['01'].push({value: item.code, label: item.name});
|
||||
});
|
||||
});
|
||||
this.$Dictionary.signalOperation().then(list => {
|
||||
this.trainingOperateTypeMap['02'] = []; // 信号机实训
|
||||
list.forEach(item => {
|
||||
this.trainingOperateTypeMap['02'].push({value: item.code, label: item.name});
|
||||
});
|
||||
});
|
||||
this.$Dictionary.switchOperation().then(list => {
|
||||
this.trainingOperateTypeMap['03'] = []; // 道岔实训
|
||||
list.forEach(item => {
|
||||
this.trainingOperateTypeMap['03'].push({value: item.code, label: item.name});
|
||||
});
|
||||
});
|
||||
this.$Dictionary.sectionOperation().then(list => {
|
||||
this.trainingOperateTypeMap['04'] = []; // 区段实训
|
||||
list.forEach(item => {
|
||||
this.trainingOperateTypeMap['04'].push({value: item.code, label: item.name});
|
||||
});
|
||||
});
|
||||
this.$Dictionary.stationStandOperation().then(list => {
|
||||
this.trainingOperateTypeMap['05'] = []; // 站台实训
|
||||
list.forEach(item => {
|
||||
this.trainingOperateTypeMap['05'].push({value: item.code, label: item.name});
|
||||
});
|
||||
});
|
||||
this.$Dictionary.trainPlanOperation().then(list => {
|
||||
this.trainingOperateTypeMap['06'] = []; // 行车计划实训
|
||||
list.forEach(item => {
|
||||
this.trainingOperateTypeMap['06'].push({value: item.code, label: item.name});
|
||||
});
|
||||
});
|
||||
this.$Dictionary.trainOperation().then(list => {
|
||||
this.trainingOperateTypeMap['07'] = []; // 列车实训
|
||||
list.forEach(item => {
|
||||
this.trainingOperateTypeMap['07'].push({value: item.code, label: item.name});
|
||||
});
|
||||
});
|
||||
this.$Dictionary.limitOperation().then(list => {
|
||||
this.trainingOperateTypeMap['08'] = []; // 限速实训
|
||||
list.forEach(item => {
|
||||
this.trainingOperateTypeMap['08'].push({value: item.code, label: item.name});
|
||||
});
|
||||
});
|
||||
// 获取实训类型
|
||||
this.trainingTypeList = [];
|
||||
this.$Dictionary.trainingType().then(list => {
|
||||
this.trainingTypeList = list;
|
||||
list.forEach(elem => {
|
||||
this.queryForm.queryObject.trainingType.config.data.push({
|
||||
value: elem.code,
|
||||
label: elem.name
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
this.placeholderMap = {};
|
||||
getPlaceholderList({ trainingType: '' }).then(res => {
|
||||
res.data.forEach(item => {
|
||||
|
@ -270,17 +270,10 @@ export default {
|
||||
let updateAutoTrainingFunction = '';
|
||||
let deleteAutoTrainingFunction = '';
|
||||
let addTrainingFunction = '';
|
||||
if ((this.$route.query.drawWay + '') === 'true') {
|
||||
addAutoTrainingFunction = addAutoTrainingNew;
|
||||
updateAutoTrainingFunction = updateAutoTrainingNew;
|
||||
deleteAutoTrainingFunction = deleteAutoTrainingNew;
|
||||
addTrainingFunction = addTrainingNew;
|
||||
} else {
|
||||
addAutoTrainingFunction = addAutoTraining;
|
||||
updateAutoTrainingFunction = updateAutoTraining;
|
||||
deleteAutoTrainingFunction = deleteAutoTraining;
|
||||
addTrainingFunction = addTraining;
|
||||
}
|
||||
this.$refs.form.validate((valid) => {
|
||||
if (valid) {
|
||||
this.loading = true;
|
||||
|
@ -148,9 +148,6 @@ export default {
|
||||
? productTypeList.map(elem => { return { value: elem.value, label: elem.enlabel }; })
|
||||
: productTypeList.map(elem => { return { value: elem.value, label: elem.label }; });
|
||||
},
|
||||
drawWay() {
|
||||
return this.$route.query.drawWay + '';
|
||||
},
|
||||
project() {
|
||||
return getSessionStorage('project');
|
||||
}
|
||||
@ -304,7 +301,6 @@ export default {
|
||||
// this.$refs.draftTrain.show({ event: '03', title: this.$t('lesson.deleteAutoGeneratedTraining') });
|
||||
// },
|
||||
demoDisplay(index, node) {
|
||||
if (this.drawWay === 'true') {
|
||||
trainingNotifyNew({ trainingId: node.id }).then(resp => {
|
||||
/** 区分演示和正式,需要在演示时设置lessonId为0*/
|
||||
if (this.loadingProjectList.includes(this.project)) {
|
||||
@ -316,17 +312,6 @@ export default {
|
||||
}).catch(error => {
|
||||
this.$messageBox(this.$t('error.createSimulationFailed') + error.message);
|
||||
});
|
||||
} else {
|
||||
trainingNotify({ trainingId: node.id }).then(resp => {
|
||||
/** 区分演示和正式,需要在演示时设置lessonId为0*/
|
||||
const query = { group: resp.data, trainingId: node.id, lessonId: 0, mapId: this.$route.query.mapId };
|
||||
this.$router.push({ path: `${UrlConfig.display}/manage`, query: query });
|
||||
launchFullscreen();
|
||||
}).catch(error => {
|
||||
this.$messageBox(this.$t('error.createSimulationFailed') + error.message);
|
||||
});
|
||||
}
|
||||
|
||||
},
|
||||
reloadTable() {
|
||||
this.queryList.reload();
|
||||
@ -335,30 +320,16 @@ export default {
|
||||
this.$router.go(-1);
|
||||
},
|
||||
trainingRecord(index, node) {
|
||||
if (this.drawWay === 'true') {
|
||||
trainingNotifyNew({ trainingId: node.id }).then(resp => {
|
||||
this.group = resp.data;
|
||||
this.$router.push({ path: `${UrlConfig.design.trainingRecord}/${node.id}/${node.name}`, query: { group: resp.data } });
|
||||
}).catch(error => {
|
||||
this.$messageBox(`${this.$t('error.createSimulationFailed')}: ${error.message}`);
|
||||
});
|
||||
} else {
|
||||
trainingNotify({ trainingId: node.id }).then(resp => {
|
||||
this.group = resp.data;
|
||||
this.$router.push({ path: `${UrlConfig.design.trainingRecord}/${node.id}/${node.name}`, query: { group: resp.data } });
|
||||
}).catch(error => {
|
||||
this.$messageBox(`${this.$t('error.createSimulationFailed')}: ${error.message}`);
|
||||
});
|
||||
}
|
||||
|
||||
},
|
||||
queryFunction(params) {
|
||||
params['mapId'] = this.$route.query.mapId;
|
||||
if (this.drawWay === 'true') {
|
||||
return pageQueryTrainingNew(params);
|
||||
} else {
|
||||
return pageQueryTraining(params);
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
@ -1,381 +0,0 @@
|
||||
<template>
|
||||
<div style="height: 100%; overflow-y: auto;">
|
||||
<QueryListPage ref="queryListPage" :pager-config="pagerConfig" :query-form="queryForm" :query-list="queryList" style="width: 98%;margin-left:1%;margin-top:20px;" />
|
||||
<!-- <training-draft
|
||||
ref="draftTrain"
|
||||
:map-id-list="mapIdList"
|
||||
:training-type-list="trainingTypeList"
|
||||
:training-operate-type-map="trainingOperateTypeMap"
|
||||
@refresh="reloadTable"
|
||||
/> -->
|
||||
<div class="draft">
|
||||
<el-button-group>
|
||||
<el-button type="primary" @click="turnback">{{ $t('global.back') }}</el-button>
|
||||
</el-button-group>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import ConstConfig from '@/scripts/ConstConfig';
|
||||
import Cookies from 'js-cookie';
|
||||
import { pageQueryTraining, pageQueryTrainingNew, createAllTrainingList } from '@/api/jmap/training';
|
||||
import { trainingNotify, trainingNotifyNew } from '@/api/simulation';
|
||||
import { launchFullscreen } from '@/utils/screen';
|
||||
import { getPublishMapListOnline } from '@/api/jmap/map';
|
||||
import { getOperateTrainingList } from '@/api/management/operation';
|
||||
import { UrlConfig } from '@/scripts/ConstDic';
|
||||
// import TrainingDraft from './draft';
|
||||
import localStore from 'storejs';
|
||||
|
||||
export default {
|
||||
name: 'TrainingGeneration',
|
||||
components: {
|
||||
// TrainingDraft
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
mapIdList: [],
|
||||
trainingTypeList: [],
|
||||
trainingOperateTypeMap: {},
|
||||
trainingTypeMap: {},
|
||||
pagerConfig: {
|
||||
pageSize: 'pageSize',
|
||||
pageIndex: 'pageNum'
|
||||
},
|
||||
queryForm: {
|
||||
labelWidth: '120px',
|
||||
queryObject: {
|
||||
prdType: {
|
||||
type: 'select',
|
||||
label: this.$t('lesson.prdType'),
|
||||
change: this.prdChoose,
|
||||
config: {
|
||||
data: []
|
||||
}
|
||||
},
|
||||
type: {
|
||||
type: 'select',
|
||||
label: this.$t('lesson.trainingType'),
|
||||
change: this.typeChoose,
|
||||
config: {
|
||||
data: []
|
||||
}
|
||||
},
|
||||
operateType: {
|
||||
type: 'select',
|
||||
label: this.$t('lesson.operationType'),
|
||||
config: {
|
||||
data: []
|
||||
}
|
||||
},
|
||||
name: {
|
||||
type: 'text',
|
||||
label: this.$t('lesson.trainingName')
|
||||
}
|
||||
}
|
||||
},
|
||||
queryList: {
|
||||
query: this.queryFunction,
|
||||
selectCheckShow: false,
|
||||
indexShow: true,
|
||||
columns: [
|
||||
{
|
||||
title: this.$t('lesson.trainingName'),
|
||||
prop: 'name'
|
||||
},
|
||||
{
|
||||
title: this.$t('lesson.prdType'),
|
||||
prop: 'prdType',
|
||||
type: 'tag',
|
||||
columnValue: (row) => { return this.$convertField(row.prdType, this.prdTypeList, ['value', 'label']); },
|
||||
tagType: (row) => { return 'success'; }
|
||||
},
|
||||
{
|
||||
title: this.$t('lesson.trainingType'),
|
||||
prop: 'type',
|
||||
type: 'tag',
|
||||
columnValue: (row) => { return this.$convertField(row.type, this.trainingTypeList, ['code', 'name']); },
|
||||
tagType: (row) => { return 'success'; }
|
||||
},
|
||||
{
|
||||
title: this.$t('lesson.operationType'),
|
||||
prop: 'operateType',
|
||||
type: 'tag',
|
||||
columnValue: (row) => { return this.$convertField(row.operateType, this.trainingOperateTypeMap[row.type], ['code', 'name']); },
|
||||
tagType: (row) => { return 'success'; }
|
||||
},
|
||||
{
|
||||
title: this.$t('lesson.minDuration'),
|
||||
prop: 'minDuration'
|
||||
},
|
||||
{
|
||||
title: this.$t('lesson.maxDuration'),
|
||||
prop: 'maxDuration'
|
||||
},
|
||||
{
|
||||
title: this.$t('lesson.remarks'),
|
||||
prop: 'remarks'
|
||||
},
|
||||
{
|
||||
type: 'button',
|
||||
title: this.$t('global.operate'),
|
||||
width: '250',
|
||||
buttons: [
|
||||
{
|
||||
name: this.$t('lesson.demonstration'),
|
||||
handleClick: this.demoDisplay,
|
||||
type: ''
|
||||
}
|
||||
/* {
|
||||
name: this.$t('lesson.trainingRecord'),
|
||||
handleClick: this.trainingRecord,
|
||||
type: ''
|
||||
}*/
|
||||
]
|
||||
}
|
||||
],
|
||||
actions: [
|
||||
{ text: this.$t('lesson.generateTraining'), btnCode: 'employee_auto', handler: this.autoMaticTrainging }
|
||||
// { text: this.$t('lesson.updateTraining'), btnCode: 'employee_edit', handler: this.editTrainingByType, type: 'warning'},
|
||||
// { text: this.$t('lesson.deleteTraining'), btnCode: 'employee_delete', handler: this.delAutoMaticTrainging, type: 'danger'}
|
||||
]
|
||||
},
|
||||
|
||||
currentModel: {}
|
||||
};
|
||||
},
|
||||
computed:{
|
||||
prdTypeList() {
|
||||
const productTypeList = ConstConfig.ConstSelect.prdType;
|
||||
return Cookies.get('user_lang') == 'en'
|
||||
? productTypeList.map(elem => { return { value: elem.value, label: elem.enlabel }; })
|
||||
: productTypeList.map(elem => { return { value: elem.value, label: elem.label }; });
|
||||
},
|
||||
drawWay() {
|
||||
return this.$route.query.drawWay + '';
|
||||
}
|
||||
},
|
||||
async created() {
|
||||
const json = localStore.get(this.$route.path);
|
||||
await this.loadInitData(json);
|
||||
this.typeChoose(json);
|
||||
},
|
||||
mounted() {
|
||||
this.interCheckGenerateStatus();
|
||||
},
|
||||
beforeDestroy() {
|
||||
this.isLeaving = true;
|
||||
},
|
||||
methods: {
|
||||
async loadInitData(queryData) {
|
||||
this.mapIdList = [];
|
||||
this.queryForm.queryObject.prdType.config.data = [];
|
||||
getPublishMapListOnline().then(response => {
|
||||
this.mapIdList = response.data;
|
||||
});
|
||||
this.queryForm.queryObject.prdType.config.data = this.prdTypeList;
|
||||
|
||||
// 获取实训类型
|
||||
this.trainingTypeList = [];
|
||||
this.$Dictionary.trainingType().then(list => {
|
||||
this.trainingTypeList = list;
|
||||
});
|
||||
this.trainingOperateTypeMap = {};
|
||||
const list01 = await this.$Dictionary.stationControl();
|
||||
this.trainingOperateTypeMap['01'] = list01; // 控制权实训
|
||||
const list02 = await this.$Dictionary.signalOperation();
|
||||
this.trainingOperateTypeMap['02'] = list02; // 信号机实训
|
||||
const list03 = await this.$Dictionary.switchOperation();
|
||||
this.trainingOperateTypeMap['03'] = list03; // 道岔实训
|
||||
const list04 = await this.$Dictionary.sectionOperation();
|
||||
this.trainingOperateTypeMap['04'] = list04; // 区段实训
|
||||
const list05 = await this.$Dictionary.stationStandOperation();
|
||||
this.trainingOperateTypeMap['05'] = list05; // 站台实训
|
||||
const list06 = await this.$Dictionary.trainPlanOperation();
|
||||
this.trainingOperateTypeMap['06'] = list06; // 行车计划实训
|
||||
const list07 = await this.$Dictionary.trainOperation();
|
||||
this.trainingOperateTypeMap['07'] = list07; // 列车实训
|
||||
const list08 = await this.$Dictionary.limitOperation();
|
||||
this.trainingOperateTypeMap['08'] = list08; // 限速实训
|
||||
await this.prdChoose(queryData);
|
||||
|
||||
this.reloadTable();
|
||||
},
|
||||
interCheckGenerateStatus() {
|
||||
createAllTrainingList(this.$route.query.mapId, false).then((data)=>{
|
||||
if (data.data) {
|
||||
this.queryList.actions.pop();
|
||||
this.queryList.actions.push({ text: this.$t('lesson.trainingGenerating'), btnCode: 'employee_auto', handler: this.autoMaticTrainging, disabled:true });
|
||||
} else {
|
||||
this.queryList.actions.pop();
|
||||
this.queryList.actions.push({ text: this.$t('lesson.generateTraining'), btnCode: 'employee_auto', handler: this.autoMaticTrainging, disabled:false });
|
||||
}
|
||||
setTimeout(() => {
|
||||
if (!this.isLeaving) {
|
||||
this.interCheckGenerateStatus(this.$route.query.mapId, false);
|
||||
}
|
||||
}, 15000);
|
||||
}).catch(()=>{
|
||||
setTimeout(() => {
|
||||
if (!this.isLeaving) {
|
||||
this.interCheckGenerateStatus(this.$route.query.mapId, false);
|
||||
}
|
||||
}, 15000);
|
||||
});
|
||||
},
|
||||
async prdChoose(queryData) {
|
||||
this.trainingTypeMap = {};
|
||||
const mapId = this.$route.query.mapId;
|
||||
const res = await getOperateTrainingList({ mapId: mapId, productType: queryData.prdType });
|
||||
if (res && res.code == 200) {
|
||||
const trainingTypeLists = res.data;
|
||||
this.trainingTypeList.forEach(elem => {
|
||||
trainingTypeLists.forEach(item => {
|
||||
if (item.id == elem.code) {
|
||||
item.label = elem.name;
|
||||
item.value = elem.code;
|
||||
}
|
||||
if (this.trainingOperateTypeMap[item.id].length) {
|
||||
this.trainingOperateTypeMap[item.id].forEach(i => {
|
||||
item.children.forEach(v => {
|
||||
if (i.code == v.id) {
|
||||
v.name = i.name;
|
||||
v.code = i.code;
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
trainingTypeLists.forEach(item => {
|
||||
item.children.forEach(v => {
|
||||
if (!this.trainingTypeMap[item.id]) {
|
||||
this.trainingTypeMap[item.id] = [];
|
||||
}
|
||||
|
||||
this.trainingTypeMap[item.id].push({
|
||||
label: v.name,
|
||||
value: v.code
|
||||
});
|
||||
});
|
||||
});
|
||||
this.queryForm.queryObject.type.config.data = trainingTypeLists;
|
||||
}
|
||||
},
|
||||
typeChoose(form) {
|
||||
this.queryForm.queryObject.operateType.config.data = [];
|
||||
form.operateType = '';
|
||||
if (form && form.type && this.trainingTypeMap[form.type]) {
|
||||
this.trainingTypeMap[form.type].forEach(elem => {
|
||||
this.queryForm.queryObject.operateType.config.data.push({ value: elem.value, label: elem.label });
|
||||
});
|
||||
}
|
||||
},
|
||||
autoMaticTrainging() {
|
||||
this.$confirm('您确定是否生成所有实训,此操作会删除之前已生成好的实训!', this.$t('global.tips'), {
|
||||
confirmButtonText: this.$t('global.confirm'),
|
||||
cancelButtonText: this.$t('global.cancel'),
|
||||
type: 'warning',
|
||||
beforeClose: async (action, instance, done) => {
|
||||
if (action === 'confirm') {
|
||||
instance.confirmButtonLoading = true;
|
||||
// instance.confirmButtonText = '生成中...';
|
||||
this.queryList.actions.pop();
|
||||
this.queryList.actions.push({ text: this.$t('lesson.trainingGenerating'), btnCode: 'employee_auto', handler: this.autoMaticTrainging, disabled:true });
|
||||
try {
|
||||
const data = await createAllTrainingList(this.$route.query.mapId, true);
|
||||
this.$message.success('实训生成中...');
|
||||
instance.confirmButtonLoading = false;
|
||||
if (!data.data) {
|
||||
this.queryList.actions.pop();
|
||||
this.queryList.actions.push({ text: this.$t('lesson.generateTraining'), btnCode: 'employee_auto', handler: this.autoMaticTrainging, disabled:false });
|
||||
}
|
||||
done();
|
||||
} catch (error) {
|
||||
instance.confirmButtonLoading = false;
|
||||
this.$message.error(`生成实训失败: ${error.message}`);
|
||||
this.queryList.actions.pop();
|
||||
this.queryList.actions.push({ text: this.$t('lesson.generateTraining'), btnCode: 'employee_auto', handler: this.autoMaticTrainging, disabled:false });
|
||||
}
|
||||
} else {
|
||||
instance.confirmButtonLoading = false;
|
||||
done();
|
||||
}
|
||||
}
|
||||
}
|
||||
).then(async (action) => {
|
||||
// done();
|
||||
});
|
||||
// this.$refs.draftTrain.show({ event: '01', title: this.$t('lesson.automaticGenerationOfTraining') });
|
||||
},
|
||||
// editTrainingByType() {
|
||||
// this.$refs.draftTrain.show({ event: '02', title: this.$t('lesson.modifyTrainingByCategory') });
|
||||
// },
|
||||
// delAutoMaticTrainging() {
|
||||
// this.$refs.draftTrain.show({ event: '03', title: this.$t('lesson.deleteAutoGeneratedTraining') });
|
||||
// },
|
||||
demoDisplay(index, node) {
|
||||
if (this.drawWay === 'true') {
|
||||
trainingNotifyNew({ trainingId: node.id }).then(resp => {
|
||||
/** 区分演示和正式,需要在演示时设置lessonId为0*/
|
||||
const query = { group: resp.data, trainingId: node.id, lessonId: 0, mapId: this.$route.query.mapId, lineCode: this.$route.query.lineCode };
|
||||
this.$router.push({ path: `${UrlConfig.displayNew}/manage`, query: query });
|
||||
launchFullscreen();
|
||||
}).catch(error => {
|
||||
this.$messageBox(this.$t('error.createSimulationFailed') + error.message);
|
||||
});
|
||||
} else {
|
||||
trainingNotify({ trainingId: node.id }).then(resp => {
|
||||
/** 区分演示和正式,需要在演示时设置lessonId为0*/
|
||||
const query = { group: resp.data, trainingId: node.id, lessonId: 0, mapId: this.$route.query.mapId };
|
||||
this.$router.push({ path: `${UrlConfig.display}/manage`, query: query });
|
||||
launchFullscreen();
|
||||
}).catch(error => {
|
||||
this.$messageBox(this.$t('error.createSimulationFailed') + error.message);
|
||||
});
|
||||
}
|
||||
|
||||
},
|
||||
reloadTable() {
|
||||
this.queryList.reload();
|
||||
},
|
||||
turnback() {
|
||||
this.$router.go(-1);
|
||||
},
|
||||
trainingRecord(index, node) {
|
||||
if (this.drawWay === 'true') {
|
||||
trainingNotifyNew({ trainingId: node.id }).then(resp => {
|
||||
this.group = resp.data;
|
||||
this.$router.push({ path: `${UrlConfig.design.trainingRecord}/${node.id}/${node.name}`, query: { group: resp.data } });
|
||||
}).catch(error => {
|
||||
this.$messageBox(`${this.$t('error.createSimulationFailed')}: ${error.message}`);
|
||||
});
|
||||
} else {
|
||||
trainingNotify({ trainingId: node.id }).then(resp => {
|
||||
this.group = resp.data;
|
||||
this.$router.push({ path: `${UrlConfig.design.trainingRecord}/${node.id}/${node.name}`, query: { group: resp.data } });
|
||||
}).catch(error => {
|
||||
this.$messageBox(`${this.$t('error.createSimulationFailed')}: ${error.message}`);
|
||||
});
|
||||
}
|
||||
|
||||
},
|
||||
queryFunction(params) {
|
||||
params['mapId'] = this.$route.query.mapId;
|
||||
if (this.drawWay === 'true') {
|
||||
return pageQueryTrainingNew(params);
|
||||
} else {
|
||||
return pageQueryTraining(params);
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
.draft {
|
||||
width: 400px;
|
||||
text-align: center;
|
||||
margin: 20px auto;
|
||||
}
|
||||
</style>
|
@ -490,7 +490,6 @@ export default {
|
||||
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,
|
||||
|
@ -441,6 +441,7 @@ export default {
|
||||
children: parentDepartmentList
|
||||
}];
|
||||
this.initCommonMemberList();
|
||||
this.filterNode();
|
||||
// this.$nextTick(() => {
|
||||
// if (this.$refs.tree) {
|
||||
// this.$refs.tree.filter(this.queryMember);
|
||||
|
@ -91,10 +91,6 @@ export default {
|
||||
isLocalStation() {
|
||||
return this.$store.state.training.prdType === '01';
|
||||
},
|
||||
drawWay() {
|
||||
const drawWay = this.$route.query.drawWay;
|
||||
return drawWay && JSON.parse(drawWay);
|
||||
},
|
||||
running() {
|
||||
return this.$store.state.training.started;
|
||||
},
|
||||
|
@ -99,10 +99,6 @@ export default {
|
||||
},
|
||||
prdType() {
|
||||
return this.$store.state.training.prdType;
|
||||
},
|
||||
drawWay() {
|
||||
const drawWay = this.$route.query.drawWay;
|
||||
return drawWay && JSON.parse(drawWay);
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
@ -131,7 +127,7 @@ export default {
|
||||
},
|
||||
async selectRole(role) {
|
||||
try {
|
||||
const res = this.drawWay ? await loadDraftScriptNew(role.id, this.group) : await loadDraftScript(this.$route.query.scriptId, role.id, this.group);
|
||||
const res = await loadDraftScriptNew(role.id, this.group);
|
||||
if (res && res.code == 200) {
|
||||
if (this.querymapLocation) {
|
||||
const newMapLocation = {'offsetX': this.mapLocation.x, 'offsetY': this.mapLocation.y, 'scaleRate': this.mapLocation.scale};
|
||||
|
@ -38,9 +38,6 @@ export default {
|
||||
position() {
|
||||
return this.$store.state.menuOperation.menuPosition;
|
||||
},
|
||||
drawWay() {
|
||||
return this.$route.query.drawWay + '';
|
||||
},
|
||||
menu() {
|
||||
return [{
|
||||
label: this.$t('trainRoom.kickOutTheRoom'),
|
||||
|
@ -123,9 +123,6 @@ export default {
|
||||
group() {
|
||||
return this.$route.query.group;
|
||||
},
|
||||
drawWay() {
|
||||
return this.$route.query.drawWay + '';
|
||||
},
|
||||
userId() {
|
||||
return this.$store.state.user ? this.$store.state.user.id : '';
|
||||
},
|
||||
|
@ -162,9 +162,6 @@ export default {
|
||||
hasRelease() {
|
||||
return this.$store.state.user.roles.includes('04') ||
|
||||
this.$store.state.user.roles.includes('05');
|
||||
},
|
||||
drawWay() {
|
||||
return this.$route.query.drawWay + '';
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
@ -226,7 +223,7 @@ export default {
|
||||
if (refresh) {
|
||||
this.$store.dispatch('runPlan/refresh');
|
||||
} else {
|
||||
const query = { lineCode: lineCode, mapId: this.$route.params.mapId, planId: planId, planName: planName, drawWay:this.drawWay };
|
||||
const query = { lineCode: lineCode, mapId: this.$route.params.mapId, planId: planId, planName: planName };
|
||||
this.$router.push({ path: `/plan/tool`, query: query });
|
||||
}
|
||||
},
|
||||
|
@ -123,9 +123,6 @@ export default {
|
||||
},
|
||||
height() {
|
||||
return this.$store.state.app.height;
|
||||
},
|
||||
drawWay() {
|
||||
return this.$route.query.drawWay + '';
|
||||
}
|
||||
},
|
||||
created() {
|
||||
|
@ -205,9 +205,6 @@ export default {
|
||||
computed: {
|
||||
title() {
|
||||
return this.$t('planMonitor.addTask');
|
||||
},
|
||||
drawWay() {
|
||||
return this.$route.query.drawWay + '';
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
@ -253,27 +250,7 @@ export default {
|
||||
}
|
||||
|
||||
const mapId = this.$route.query.mapId;
|
||||
if (mapId && this.drawWay == 'false') {
|
||||
getStationRunning(mapId).then(resp => { // 查询是否有站间运行时间
|
||||
const list = resp.data;
|
||||
list.forEach(elem => {
|
||||
this.stopStationMap[[elem.startSectionCode, elem.endSectionCode].toString()] = elem;
|
||||
});
|
||||
if (list && list.length) {
|
||||
list.forEach(elem => {
|
||||
if (!elem.runPlanLevelVO) {
|
||||
this.$alert(`${this.$t('planMonitor.tipOperationTime')}`, {
|
||||
confirmButtonText: this.$t('global.confirm'),
|
||||
callback: action => {
|
||||
this.doClose();
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
});
|
||||
} else if (mapId && this.drawWay == 'true') {
|
||||
if (mapId) {
|
||||
getMapStationRun(mapId).then(resp =>{
|
||||
const list = resp.data;
|
||||
list.forEach(elem => {
|
||||
|
@ -32,23 +32,17 @@
|
||||
<span style="margin-left: 10px">{{ formatName(scope.row.endSectionCode) }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column v-if="drawWay=='false'" prop="directionCode" :label="$t('planMonitor.modifying.direction')" width="60">
|
||||
<template slot-scope="scope">
|
||||
<span style="margin-left: 10px">{{ DirectionCodeMap[scope.row.directionCode] }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column v-if="drawWay=='true'" prop="right" :label="$t('planMonitor.modifying.direction')" width="60">
|
||||
<el-table-column prop="right" :label="$t('planMonitor.modifying.direction')" width="60">
|
||||
<template slot-scope="scope">
|
||||
<span style="margin-left: 10px">{{ scope.row.right?'上行':'下行' }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="distance" :label="$t('planMonitor.modifying.distance')" width="65">
|
||||
<template slot-scope="scope">
|
||||
<span v-if="drawWay=='true'" style="margin-left: 10px">{{ scope.row.distance }}</span>
|
||||
<span v-if="drawWay=='false'" style="margin-left: 10px">{{ scope.row.distance/100 }}</span>
|
||||
<span style="margin-left: 10px">{{ scope.row.distance }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<div v-if="drawWay=='true'">
|
||||
<div>
|
||||
<el-table-column prop="l1" :label="$t('planMonitor.updateStation.level1')" width="70">
|
||||
<template slot-scope="scope">
|
||||
<span
|
||||
@ -90,48 +84,6 @@
|
||||
</template>
|
||||
</el-table-column>
|
||||
</div>
|
||||
<div v-if="drawWay=='false'">
|
||||
<el-table-column prop="runPlanLevelVO" :label="$t('planMonitor.updateStation.level1')" width="70">
|
||||
<template slot-scope="scope">
|
||||
<span
|
||||
style="margin-left: 10px"
|
||||
:style="{color: scope.row.isEditStatus? 'red': 'black'}"
|
||||
>{{ scope.row.runPlanLevelVO.level1 || '' }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="runPlanLevelVO" :label="$t('planMonitor.updateStation.level2')" width="70">
|
||||
<template slot-scope="scope">
|
||||
<span
|
||||
style="margin-left: 10px"
|
||||
:style="{color: scope.row.isEditStatus? 'red': 'black'}"
|
||||
>{{ scope.row.runPlanLevelVO.level2 || '' }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="runPlanLevelVO" :label="$t('planMonitor.updateStation.level3')" width="70">
|
||||
<template slot-scope="scope">
|
||||
<span
|
||||
style="margin-left: 10px"
|
||||
:style="{color: scope.row.isEditStatus? 'red': 'black'}"
|
||||
>{{ scope.row.runPlanLevelVO.level3 || '' }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="runPlanLevelVO" :label="$t('planMonitor.updateStation.level4')" width="70">
|
||||
<template slot-scope="scope">
|
||||
<span
|
||||
style="margin-left: 10px"
|
||||
:style="{color: scope.row.isEditStatus? 'red': 'black'}"
|
||||
>{{ scope.row.runPlanLevelVO.level4 || '' }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="runPlanLevelVO" :label="$t('planMonitor.updateStation.level5')" width="70">
|
||||
<template slot-scope="scope">
|
||||
<span
|
||||
style="margin-left: 10px"
|
||||
:style="{color: scope.row.isEditStatus?'red': 'black'}"
|
||||
>{{ scope.row.runPlanLevelVO.level5 || '' }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</div>
|
||||
<!-- <el-table-column :label="$t('planMonitor.modifying.operation')" width="100">
|
||||
<template slot-scope="scope">
|
||||
<el-button type="text" size="small" @click="handleUpdate(scope.row)">{{ $t('planMonitor.modifying.edit') }}</el-button>
|
||||
@ -140,7 +92,6 @@
|
||||
</el-table>
|
||||
</el-row>
|
||||
<div class="button-group" style="text-align: center; margin-top: 10px;">
|
||||
<el-button v-if="drawWay=='false'" type="primary" @click="handleSave">{{ $t('planMonitor.modifying.save') }}</el-button>
|
||||
<el-button @click="doClose">{{ $t('planMonitor.modifying.cancelAndQuit') }}</el-button>
|
||||
</div>
|
||||
<!-- <update-station-interval-time ref="updateStationIntervalTime" @handleConfirm="handleConfirm" /> -->
|
||||
@ -175,9 +126,6 @@ export default {
|
||||
computed: {
|
||||
title() {
|
||||
return this.$t('planMonitor.modifying.modifyRunLevel');
|
||||
},
|
||||
drawWay() {
|
||||
return this.$route.query.drawWay + '';
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
@ -194,22 +142,7 @@ export default {
|
||||
});
|
||||
|
||||
this.stationIntervalData = [];
|
||||
if (this.$route.query.lineCode && this.drawWay == 'false') {
|
||||
getStationRunning(this.$route.query.mapId).then(resp => {
|
||||
const list = resp.data;
|
||||
list.forEach(elem => {
|
||||
elem.isEditStatus = false;
|
||||
if (!elem.runPlanLevelVO || elem.runPlanLevelVO.length <= 0) {
|
||||
elem.runPlanLevelVO = { stationRunningId: elem.id };
|
||||
Object.keys(this.runSpeedLevels).forEach(key => {
|
||||
elem.runPlanLevelVO[key] = parseInt((elem.distance / 100) / (this.runSpeedLevels[key] / 3.6));
|
||||
elem.isEditStatus = true;
|
||||
});
|
||||
}
|
||||
});
|
||||
this.stationIntervalData = list;
|
||||
});
|
||||
} else if (this.$route.query.lineCode && this.drawWay == 'true') {
|
||||
if (this.$route.query.lineCode) {
|
||||
getMapStationRun(this.$route.query.mapId).then(resp =>{
|
||||
const list = resp.data;
|
||||
list.forEach(elem => {
|
||||
|
@ -294,9 +294,6 @@ export default {
|
||||
computed: {
|
||||
title() {
|
||||
return this.$t('planMonitor.modifying.modifyTask');
|
||||
},
|
||||
drawWay() {
|
||||
return this.$route.query.drawWay + '';
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
@ -331,16 +328,6 @@ export default {
|
||||
runTime = parseInt(stopStationObj.runPlanLevelVO[runLevel]);
|
||||
} else if (stopStationObj['l3']) {
|
||||
runTime = parseInt(stopStationObj['l3']);
|
||||
} else {
|
||||
if (this.drawWay == ' false') {
|
||||
// this.$messageBox(`${this.$t('planMonitor.modifying.setMessageTip1')} ${stopStationObj.startSectionCode} ${this.$t('planMonitor.modifying.setMessageTip2')} ${stopStationObj.endSectionCode} ${this.$t('planMonitor.modifying.setMessageTip3')}`);
|
||||
this.$alert(`${this.$t('planMonitor.tipOperationTime')}`, {
|
||||
confirmButtonText: this.$t('global.confirm'),
|
||||
callback: action => {
|
||||
this.doClose();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -386,15 +373,7 @@ export default {
|
||||
this.serviceNumber = params.serviceNumber;
|
||||
this.planId = this.$route.query.planId;
|
||||
this.PlanConvert = this.$theme.loadPlanConvert(lineCode);
|
||||
|
||||
if (mapId && this.drawWay == 'false') {
|
||||
getStationRunning(mapId).then(resp => {
|
||||
const list = resp.data;
|
||||
list.forEach(elem => {
|
||||
this.stopStationMap[[elem.startSectionCode, elem.endSectionCode].toString()] = elem;
|
||||
});
|
||||
});
|
||||
} else if (mapId && this.drawWay == 'true') {
|
||||
if (mapId) {
|
||||
getMapStationRun(mapId).then(resp => {
|
||||
const list = resp.data;
|
||||
list.forEach(elem => {
|
||||
|
@ -49,10 +49,6 @@ export default {
|
||||
type: Object,
|
||||
required: true
|
||||
},
|
||||
drawWay: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
lineCode: {
|
||||
type: String,
|
||||
default: ''
|
||||
@ -132,7 +128,6 @@ export default {
|
||||
async mounted() {
|
||||
await this.getList();
|
||||
await this.refresh();
|
||||
if (this.drawWay) {
|
||||
this.trainingOperateTypeMap = getTrainingOperateTypeMap();
|
||||
const lineCode = this.lineCode;
|
||||
const res = await getCmdList(lineCode, {});
|
||||
@ -167,30 +162,6 @@ export default {
|
||||
} else {
|
||||
this.$message.error(this.$t('error.failedToObtainTrainingType'));
|
||||
}
|
||||
} else {
|
||||
this.trainingOperateTypeMap = {};
|
||||
this.$Dictionary.stationControl().then(list => {
|
||||
this.trainingOperateTypeMap['01'] = list; // 控制权实训
|
||||
});
|
||||
this.$Dictionary.signalOperation().then(list => {
|
||||
this.trainingOperateTypeMap['02'] = list; // 信号机实训
|
||||
});
|
||||
this.$Dictionary.switchOperation().then(list => {
|
||||
this.trainingOperateTypeMap['03'] = list; // 道岔实训
|
||||
});
|
||||
this.$Dictionary.sectionOperation().then(list => {
|
||||
this.trainingOperateTypeMap['04'] = list; // 区段实训
|
||||
});
|
||||
this.$Dictionary.stationStandOperation().then(list => {
|
||||
this.trainingOperateTypeMap['05'] = list; // 站台实训
|
||||
});
|
||||
this.$Dictionary.trainPlanOperation().then(list => {
|
||||
this.trainingOperateTypeMap['06'] = list; // 行车计划实训
|
||||
});
|
||||
this.$Dictionary.trainOperation().then(list => {
|
||||
this.trainingOperateTypeMap['07'] = list; // 列车实训
|
||||
});
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
show() {
|
||||
|
@ -13,7 +13,7 @@
|
||||
<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" />
|
||||
<rule-from ref="rule" :course="course" :line-code="lineCode" @regulation="regulation" />
|
||||
</template>
|
||||
</div>
|
||||
<div class="draft">
|
||||
@ -52,7 +52,6 @@ export default {
|
||||
lessonName: '',
|
||||
formData: {},
|
||||
mapId: '',
|
||||
drawWay: false,
|
||||
lineCode: '',
|
||||
OrganizationList: []
|
||||
};
|
||||
@ -83,7 +82,6 @@ export default {
|
||||
if (elem.id === val.region) {
|
||||
this.mapId = elem.mapId;
|
||||
getPublishMapInfo(this.mapId).then(res=>{
|
||||
this.drawWay = res.data.drawWay;
|
||||
this.lineCode = res.data.lineCode;
|
||||
});
|
||||
}
|
||||
@ -115,7 +113,6 @@ export default {
|
||||
});
|
||||
const res = await getPublishMapInfo(this.mapId);
|
||||
if (res.data) {
|
||||
this.drawWay = res.data.drawWay;
|
||||
this.lineCode = res.data.lineCode;
|
||||
}
|
||||
},
|
||||
|
@ -17,7 +17,6 @@
|
||||
<edit-rule
|
||||
ref="addRule"
|
||||
:course-id="courseId"
|
||||
:draw-way="drawWay"
|
||||
:line-code="lineCode"
|
||||
:edit-course="editCourse"
|
||||
@addRuleList="addRuleList"
|
||||
@ -45,10 +44,6 @@ export default {
|
||||
type: Object,
|
||||
default: null
|
||||
},
|
||||
drawWay: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
lineCode: {
|
||||
type: String,
|
||||
default: ''
|
||||
@ -87,49 +82,16 @@ export default {
|
||||
watch: {
|
||||
},
|
||||
async mounted() {
|
||||
if (this.drawWay) {
|
||||
this.trainingOperateTypeMap = getTrainingOperateTypeMap();
|
||||
} else {
|
||||
this.trainingOperateTypeMap = {};
|
||||
this.$Dictionary.stationControl().then(list => {
|
||||
this.trainingOperateTypeMap['01'] = list; // 控制权实训
|
||||
});
|
||||
this.$Dictionary.signalOperation().then(list => {
|
||||
this.trainingOperateTypeMap['02'] = list; // 信号机实训
|
||||
});
|
||||
this.$Dictionary.switchOperation().then(list => {
|
||||
this.trainingOperateTypeMap['03'] = list; // 道岔实训
|
||||
});
|
||||
this.$Dictionary.sectionOperation().then(list => {
|
||||
this.trainingOperateTypeMap['04'] = list; // 区段实训
|
||||
});
|
||||
this.$Dictionary.stationStandOperation().then(list => {
|
||||
this.trainingOperateTypeMap['05'] = list; // 站台实训
|
||||
});
|
||||
this.$Dictionary.trainPlanOperation().then(list => {
|
||||
this.trainingOperateTypeMap['06'] = list; // 行车计划实训
|
||||
});
|
||||
this.$Dictionary.trainOperation().then(list => {
|
||||
this.trainingOperateTypeMap['07'] = list; // 列车实训
|
||||
});
|
||||
}
|
||||
await this.getList();
|
||||
await this.init();
|
||||
},
|
||||
methods: {
|
||||
async getList() {
|
||||
this.typeList = [];
|
||||
if (this.drawWay) {
|
||||
for (const val in ConstConfig.ConstSelect.trainingDeviceType) {
|
||||
this.typeList.push({name: LangStorage.getLang() == 'en' ? ConstConfig.ConstSelect.trainingDeviceType[val].enlabel : ConstConfig.ConstSelect.trainingDeviceType[val].label, code: val});
|
||||
}
|
||||
} else {
|
||||
await getDetailList('training_type').then(res => {
|
||||
this.typeList = res.data;
|
||||
}).catch(error => {
|
||||
console.error(error);
|
||||
});
|
||||
}
|
||||
},
|
||||
async init() {
|
||||
if (this.$route.params.ruleId != 0 && this.ruleList.length == 0) {
|
||||
|
@ -136,7 +136,6 @@ export default {
|
||||
{
|
||||
name: this.$t('publish.simulationDataCheck'),
|
||||
handleClick: this.handleSimulationCheck,
|
||||
showControl: (row) => { return row.drawWay; }
|
||||
},
|
||||
{
|
||||
name: '导入',
|
||||
|
@ -132,25 +132,13 @@ export default {
|
||||
}
|
||||
},
|
||||
drawUp(index, row) {
|
||||
const drawWay = this.$route.query.drawWay;
|
||||
if (drawWay && JSON.parse(drawWay)) {
|
||||
scriptRecordNotifyNew(row.id).then(resp => {
|
||||
const query = { mapId: row.mapId, group: resp.data, scriptId: row.id, lang:row.lang, lineCode:this.$route.query.lineCode, drawWay:drawWay};
|
||||
const query = { mapId: row.mapId, group: resp.data, scriptId: row.id, lang:row.lang, lineCode:this.$route.query.lineCode};
|
||||
this.$router.push({ path: `${UrlConfig.scriptDisplayNew}/script`, query });
|
||||
launchFullscreen();
|
||||
}).catch(error => {
|
||||
this.$messageBox(`${this.$t('scriptRecord.createSimulationFail')}: ${error.message}`);
|
||||
});
|
||||
} else {
|
||||
scriptRecordNotify(row.id).then(resp => {
|
||||
const query = { mapId: row.mapId, group: resp.data, scriptId: row.id, lang:row.lang, lineCode:this.$route.query.lineCode };
|
||||
this.$router.push({ path: `${UrlConfig.scriptDisplay}/script`, query });
|
||||
launchFullscreen();
|
||||
}).catch(error => {
|
||||
this.$messageBox(`${this.$t('scriptRecord.createSimulationFail')}: ${error.message}`);
|
||||
});
|
||||
}
|
||||
|
||||
},
|
||||
deleteScript(index, row) {
|
||||
this.$confirm(this.$t('scriptRecord.deleteScriptTip'), this.$t('global.tips'), {
|
||||
@ -271,28 +259,16 @@ export default {
|
||||
},
|
||||
// 剧本预览
|
||||
previewScript(index, row) {
|
||||
const drawWay = this.$route.query.drawWay;
|
||||
if (drawWay && JSON.parse(drawWay)) {
|
||||
scriptDraftRecordNotifyNew(row.id).then(resp => {
|
||||
if (this.loadingProjectList.includes(this.project)) {
|
||||
this.$store.dispatch('app/transitionAnimations');
|
||||
}
|
||||
const query = { mapId: row.mapId, group: resp.data, scriptId: row.id, try:0, lineCode:this.$route.query.lineCode, drawWay:true};
|
||||
const query = { mapId: row.mapId, group: resp.data, scriptId: row.id, try:0, lineCode:this.$route.query.lineCode};
|
||||
this.$router.push({ path: `${UrlConfig.design.displayNew}/demon`, query });
|
||||
launchFullscreen();
|
||||
}).catch(error => {
|
||||
this.$messageBox(`${this.$t('scriptRecord.createSimulationFail')}: ${error.message}`);
|
||||
});
|
||||
} else {
|
||||
scriptDraftRecordNotify(row.id).then(resp => {
|
||||
const query = { mapId: row.mapId, group: resp.data, scriptId: row.id, try:0, lineCode:this.$route.query.lineCode, drawWay:false};
|
||||
this.$router.push({ path: `${UrlConfig.design.display}/demon`, query });
|
||||
launchFullscreen();
|
||||
}).catch(error => {
|
||||
this.$messageBox(`${this.$t('scriptRecord.createSimulationFail')}: ${error.message}`);
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
};
|
||||
|
@ -79,7 +79,6 @@ export default {
|
||||
},
|
||||
lineCode: '', // 线路皮肤码
|
||||
expandList: [],
|
||||
drawWay: false,
|
||||
loadingProjectList: ['login', 'design', 'xty', 'designxty', 'gzb', 'designxty', 'xadt', 'designxadt', 'drts', 'designdrts']
|
||||
};
|
||||
},
|
||||
@ -116,7 +115,6 @@ export default {
|
||||
initLoadPage() {
|
||||
getPublishMapInfo(this.$route.query.mapId).then(res => {
|
||||
if (res.data) {
|
||||
this.drawWay = res.data.drawWay;
|
||||
this.lineCode = res.data.lineCode;
|
||||
}
|
||||
}).catch(() => {
|
||||
@ -151,7 +149,6 @@ export default {
|
||||
if (obj && obj.type === 'Training') {
|
||||
if (obj.valid) {
|
||||
this.disabled = true;
|
||||
if (this.drawWay) {
|
||||
trainingNotifyNew({ trainingId: obj.id }).then(resp => {
|
||||
const query = {
|
||||
group: resp.data, trainingId: obj.id, lessonId: this.$route.query.lessonId, mapId: this.courseModel.mapId, lineCode: this.lineCode, noPreLogout: this.$route.query.noPreLogout
|
||||
@ -169,18 +166,6 @@ export default {
|
||||
this.$messageBox(`${this.$t('tip.createSimulationFaild')} : ${error.message}`);
|
||||
this.disabled = false;
|
||||
});
|
||||
} else {
|
||||
trainingNotify({ trainingId: obj.id }).then(resp => {
|
||||
const query = {
|
||||
group: resp.data, trainingId: obj.id, lessonId: this.$route.query.lessonId, mapId: this.courseModel.mapId
|
||||
};
|
||||
this.$router.push({ path: `${UrlConfig.display}/teach`, query: query });
|
||||
launchFullscreen();
|
||||
}).catch(error => {
|
||||
this.$messageBox(`${this.$t('tip.createSimulationFaild')} : ${error.message}`);
|
||||
this.disabled = false;
|
||||
});
|
||||
}
|
||||
} else {
|
||||
this.$confirm(this.$t('tip.accessCourseNo'), this.$t('tip.hint'), {
|
||||
confirmButtonText: this.$t('tip.confirm'),
|
||||
|
@ -1,164 +0,0 @@
|
||||
<template>
|
||||
<el-dialog v-dialogDrag class="person" :title="$t(titleI18n)" :visible.sync="show" width="20%" :z-index="2000" :modal="true" :before-close="cancel" :close-on-click-modal="false">
|
||||
<el-input v-model="filterText" :placeholder="this.$t('global.enterNameToFilter')" clearable />
|
||||
<ul class="person__container">
|
||||
<li v-for="(item,index) in filterList" :key="index" class="person__container--li">
|
||||
<input
|
||||
v-model="item.select"
|
||||
class="checkbox"
|
||||
type="checkbox"
|
||||
>
|
||||
<span>{{ item.node.nickName }}</span>
|
||||
</li>
|
||||
</ul>
|
||||
<span slot="footer" class="person__footer">
|
||||
<el-button @click="cancel">{{ $t('global.cancel') }}</el-button>
|
||||
<el-button type="primary" @click="commit">{{ $t('global.confirm') }}</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
props: {
|
||||
audienceList: {
|
||||
type: Array,
|
||||
default() {
|
||||
return [];
|
||||
}
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
visible: false,
|
||||
roleType: '',
|
||||
filterText: ''
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
show() {
|
||||
return this.visible;
|
||||
},
|
||||
props() {
|
||||
return { label: 'name' };
|
||||
},
|
||||
personList() {
|
||||
return this.audienceList.map(e => { return { select: false, node: e }; });
|
||||
},
|
||||
filterList() {
|
||||
return this.personList.filter(e => e.node.nickName.includes(this.filterText));
|
||||
},
|
||||
titleI18n() {
|
||||
return {
|
||||
'Dispatcher': 'trainRoom.increaseDispatchers',
|
||||
'Attendant': 'trainRoom.increaseStationAttendant',
|
||||
'Instructor': 'trainRoom.increaseTeacher',
|
||||
'Repair': 'trainRoom.increaseUniversalAccount',
|
||||
'Driver': 'trainRoom.driver',
|
||||
'IBP': 'trainRoom.increaseIbp',
|
||||
'CI': 'trainRoom.interlock'
|
||||
}[this.roleType];
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
doShow(roleType) {
|
||||
this.roleType = roleType;
|
||||
this.visible = true;
|
||||
},
|
||||
doClose() {
|
||||
this.visible = false;
|
||||
},
|
||||
commit() {
|
||||
const userList = this.personList.filter(e => { return e.select; }).map(e=> { return e.node; });
|
||||
this.$emit('dispatch', {roleType: this.roleType, userList});
|
||||
this.visible = false;
|
||||
},
|
||||
cancel() {
|
||||
this.doClose();
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
ul,
|
||||
li {
|
||||
list-style: none;
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
::-webkit-scrollbar {
|
||||
width: 2px;
|
||||
}
|
||||
|
||||
::-webkit-scrollbar-thumb {
|
||||
background-color: #c7c7c7;
|
||||
}
|
||||
|
||||
/deep/ .el-dialog__body {
|
||||
padding: 10px 20px;
|
||||
}
|
||||
|
||||
.person {
|
||||
&__container {
|
||||
max-height: 270px;
|
||||
overflow-y: scroll;
|
||||
width: 100%;
|
||||
|
||||
&--li {
|
||||
height: 30px;
|
||||
line-height: 30px;
|
||||
|
||||
.checkbox {
|
||||
margin-right: 5px;
|
||||
cursor: pointer;
|
||||
font-size: 14px;
|
||||
width: 14px;
|
||||
height: 14px;
|
||||
position: relative;
|
||||
display: block;
|
||||
margin-top: 9px;
|
||||
float: left;
|
||||
|
||||
&.disabled {
|
||||
cursor: not-allowed;
|
||||
}
|
||||
|
||||
&.disabled:after {
|
||||
background-color: #edf2fc;
|
||||
border-color: #dcdfe6;
|
||||
}
|
||||
}
|
||||
|
||||
.checkbox:after {
|
||||
position: absolute;
|
||||
width: 14px;
|
||||
height: 14px;
|
||||
top: 0;
|
||||
content: " ";
|
||||
background-color: #fff;
|
||||
color: #fff;
|
||||
display: inline-block;
|
||||
visibility: visible;
|
||||
padding: 0px 3px;
|
||||
border: 1px solid #dcdfe6;
|
||||
border-radius: 3px;
|
||||
}
|
||||
|
||||
.checkbox:checked:after {
|
||||
content: "✓";
|
||||
font-size: 12px;
|
||||
width: 14px;
|
||||
height: 14px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
background-color: #409EFF;
|
||||
border: 1px solid #409EFF;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
</style>
|
@ -1,92 +0,0 @@
|
||||
<template>
|
||||
<div class="jointRoomMenu">
|
||||
<pop-menu ref="popMenu" :menu="menu" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import PopMenu from '@/components/PopMenu';
|
||||
import { DeviceMenu } from '@/scripts/ConstDic';
|
||||
import { putJointTrainingUserkicked } from '@/api/chat';
|
||||
|
||||
export default {
|
||||
components: {
|
||||
PopMenu
|
||||
},
|
||||
props: {
|
||||
clickUserId: {
|
||||
type: String,
|
||||
default: ''
|
||||
}
|
||||
},
|
||||
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 + '';
|
||||
}
|
||||
},
|
||||
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 putJointTrainingUserkicked(this.clickUserId, this.$route.query.group);
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
/deep/ {
|
||||
.menu-item{
|
||||
background: #f1ecec;
|
||||
.pop-menu {
|
||||
background: #5F9EA0;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
@ -1,499 +0,0 @@
|
||||
<template>
|
||||
<!-- 聊天窗口 -->
|
||||
<div class="chat">
|
||||
<div class="chat__head">
|
||||
<div class="chat__head--title"> 会话窗口</div>
|
||||
</div>
|
||||
<div ref="content" class="chat__container" :style="{height: listHeight+'px'}">
|
||||
<ul class="chat__container--list">
|
||||
<div v-for="(nor, index) in textList" :key="index" style="margin-top: 5px;">
|
||||
<li v-if="nor.self" style="position: relative">
|
||||
<div class="userName" style="position: absolute; right: 4px; top: 4px; font-size: 14px;">
|
||||
{{ covertTime(nor.chatTime) }} {{ nor.userName }}</div>
|
||||
<div class="news">
|
||||
<span>{{ nor.value }}</span>
|
||||
</div>
|
||||
<div v-if="nor.voice" class="yuyin" @click="playAudio(nor)">
|
||||
<i class="el-icon-caret-right" />
|
||||
</div>
|
||||
</li>
|
||||
<li v-if="nor.other" style="position: relative">
|
||||
<div class="userName" style="position: absolute; left: 12px; top: 4px; font-size: 14px;">
|
||||
{{ nor.userName }} {{ covertTime(nor.chatTime) }}</div>
|
||||
<div class="answers">
|
||||
<span>{{ nor.value }}</span>
|
||||
</div>
|
||||
<div v-if="nor.voice" class="yuyin1" @click="playAudio(nor)">
|
||||
<i class="el-icon-caret-right" />
|
||||
</div>
|
||||
</li>
|
||||
<li v-if="nor.join" class="roomTip">{{ nor.roomTip }}</li>
|
||||
</div>
|
||||
</ul>
|
||||
<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>
|
||||
<audio ref="audio" />
|
||||
<div class="chat__footer">
|
||||
<div class="chat_tool">
|
||||
<div class="microphoneBtn" @click="startRecording()">
|
||||
<span class="el-icon-microphone" />
|
||||
</div>
|
||||
</div>
|
||||
<textarea id="dope" v-model="text" class="chat__footer--text" style="width: 99%;height: 47px; border: none;outline: none;" @keyup="handleSetInputState" @keyup.enter="handleSendText" />
|
||||
<button class="chat__footer--send" :disabled="disabled" @click="handleSendText">{{ $t('trainRoom.sendText') }}</button>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
// import HZRecorder from '@/utils/HZRecorder';
|
||||
import RecordRTC from 'recordrtc';
|
||||
import { chatWithText, chatWithAudio, chatWithAudioNew } from '@/api/chat';
|
||||
import { chatWithTextNew } from '@/api/jointTraining';
|
||||
|
||||
export default {
|
||||
props: {
|
||||
room: {
|
||||
type: Object,
|
||||
required: true
|
||||
},
|
||||
members: {
|
||||
type: Array,
|
||||
required: true
|
||||
},
|
||||
height: {
|
||||
type: Number,
|
||||
required: true
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
textList: [],
|
||||
recordSending:false,
|
||||
text: '',
|
||||
seconds:0,
|
||||
inter:null,
|
||||
recorders: null,
|
||||
sending: false,
|
||||
disabled:true,
|
||||
microphone:null,
|
||||
baseUrl:process.env.VUE_APP_VOICE_API
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
listHeight() {
|
||||
return this.height - 119;
|
||||
},
|
||||
group() {
|
||||
return this.$route.query.group;
|
||||
},
|
||||
userId() {
|
||||
return this.$store.state.user ? this.$store.state.user.id : '';
|
||||
},
|
||||
drawWay() {
|
||||
const drawWay = this.$route.query.drawWay;
|
||||
return drawWay && JSON.parse(drawWay);
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
'$store.state.socket.chatContent': function (val) { // 房间内语音聊天
|
||||
if (val.chatInfo) {
|
||||
this.handelTextList(val);
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
async handleSetInputState(keyCode) {
|
||||
if (!this.text.trim()) {
|
||||
this.disabled = true;
|
||||
} else {
|
||||
this.disabled = false;
|
||||
}
|
||||
},
|
||||
covertTime(time) {
|
||||
return time.slice(0, time.indexOf('.'));
|
||||
},
|
||||
async handleSendText() {
|
||||
try {
|
||||
if (this.text.trim()) {
|
||||
if (this.drawWay) {
|
||||
await chatWithTextNew(this.text, this.group);
|
||||
} else {
|
||||
await chatWithText(this.text, this.group);
|
||||
}
|
||||
this.text = '';
|
||||
this.disabled = true;
|
||||
}
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
}
|
||||
},
|
||||
async handelTextList(params) {
|
||||
if (!params.inSimulation) {
|
||||
this.textList.push(params);
|
||||
this.textList.sort((a, b) => {
|
||||
return a.date - b.date;
|
||||
});
|
||||
}
|
||||
this.sending = false;
|
||||
this.$store.dispatch('socket/setChatContent', {});
|
||||
this.$nextTick(() => {
|
||||
if (this.$refs.content) {
|
||||
this.$refs.content.scrollTop = this.$refs.content.scrollHeight;
|
||||
}
|
||||
});
|
||||
},
|
||||
// 语音录制开始
|
||||
startRecording() {
|
||||
const that = this;
|
||||
if (!this.recordSending && !this.recorders && !this.microphone) {
|
||||
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;
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
},
|
||||
// 停止录制
|
||||
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);
|
||||
if (that.drawWay) {
|
||||
chatWithAudioNew(fd, that.group)
|
||||
.then((data) => {
|
||||
})
|
||||
.catch(error => {
|
||||
console.log(error);
|
||||
});
|
||||
} else {
|
||||
chatWithAudio(fd, that.group)
|
||||
.then((data) => {
|
||||
})
|
||||
.catch(error => {
|
||||
console.log(error);
|
||||
});
|
||||
}
|
||||
|
||||
if (that.microphone) {
|
||||
that.microphone.stop();
|
||||
that.microphone = null;
|
||||
that.recordSending = false;
|
||||
that.recorders = null;
|
||||
}
|
||||
});
|
||||
},
|
||||
cancleRecording() {
|
||||
if (this.microphone) {
|
||||
clearInterval(this.inter);
|
||||
this.seconds = 0;
|
||||
this.microphone.stop();
|
||||
this.microphone = null;
|
||||
this.recordSending = false;
|
||||
this.recorders = null;
|
||||
}
|
||||
},
|
||||
playAudio(nor) {
|
||||
this.$refs.audio.src = this.baseUrl + nor.src;
|
||||
this.$refs.audio.play();
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
ul,
|
||||
li {
|
||||
list-style: none;
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
::-webkit-scrollbar {
|
||||
width: 0px;
|
||||
}
|
||||
|
||||
::-webkit-scrollbar-thumb {
|
||||
background-color: #c7c7c7;
|
||||
}
|
||||
|
||||
.chat {
|
||||
border: 1px solid #ccc;
|
||||
height: 100%;
|
||||
background-color: #fff;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: space-between;
|
||||
|
||||
&__head {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
background: #f0f0f0;
|
||||
border-bottom: 1px solid #ccc;
|
||||
|
||||
&--title {
|
||||
font-size: 16px;
|
||||
font-weight: bold;
|
||||
padding:10px 0px 10px 10px;
|
||||
}
|
||||
}
|
||||
|
||||
&__container {
|
||||
-webkit-box-flex: 1;
|
||||
overflow-y: scroll;
|
||||
padding-right: 8px;
|
||||
padding-left: 2px;
|
||||
position: relative;
|
||||
&--list {
|
||||
list-style: none;
|
||||
margin: 0;
|
||||
padding: 10px 0;
|
||||
|
||||
li {
|
||||
width: 100%;
|
||||
overflow: hidden;
|
||||
padding-top: 8px;
|
||||
}
|
||||
|
||||
.yuyin {
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
cursor: pointer;
|
||||
margin-top: 21px;
|
||||
margin-right: 3px;
|
||||
float: right;
|
||||
border: 1px solid #ccc;
|
||||
border-radius: 50%;
|
||||
}
|
||||
|
||||
.yuyin1 {
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
cursor: pointer;
|
||||
margin-top: 21px;
|
||||
margin-left: 3px;
|
||||
float: left;
|
||||
border: 1px solid #ccc;
|
||||
border-radius: 50%;
|
||||
}
|
||||
|
||||
.news {
|
||||
max-width: 55%;
|
||||
width: auto;
|
||||
height: auto;
|
||||
background: #2683f5;
|
||||
padding: 6px 10px;
|
||||
margin-top: 15px;
|
||||
line-height: 20px;
|
||||
font-size: 14px;
|
||||
border-radius: 4px;
|
||||
position: relative;
|
||||
float: right;
|
||||
color: #fff;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.answers {
|
||||
max-width: 55%;
|
||||
width: auto;
|
||||
height: auto;
|
||||
background: #eee;
|
||||
padding: 5px 10px;
|
||||
margin-top: 15px;
|
||||
line-height: 22px;
|
||||
font-size: 14px;
|
||||
border-radius: 5px;
|
||||
margin-left: 10px;
|
||||
position: relative;
|
||||
float: left;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.roomTip{
|
||||
font-size: 12px;
|
||||
text-align: center;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#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;
|
||||
}
|
||||
|
||||
&__footer {
|
||||
width: 100%;
|
||||
height: 113px;
|
||||
position: relative;
|
||||
|
||||
.chat_tool{
|
||||
border-top: 1px solid #d8dce5;
|
||||
width: 100%;
|
||||
padding: 5px;
|
||||
}
|
||||
.microphoneBtn{
|
||||
font-size: 18px;
|
||||
padding: 2px;
|
||||
width: 24px;
|
||||
text-align: center;
|
||||
&:hover{
|
||||
color:#0188fb;
|
||||
cursor: pointer;
|
||||
}
|
||||
}
|
||||
|
||||
&--text {
|
||||
width: 99%;
|
||||
height: 75px;
|
||||
border: none;
|
||||
outline: none;
|
||||
resize: none;
|
||||
font-size: 16px;
|
||||
padding-left: 10px;
|
||||
padding-top: 0px;
|
||||
}
|
||||
|
||||
&--send {
|
||||
width: 70px;
|
||||
height: 25px;
|
||||
background: #0188fb;
|
||||
border: 0;
|
||||
position: absolute;
|
||||
bottom: 10px;
|
||||
right: 10px;
|
||||
color: #fff;
|
||||
cursor: pointer;
|
||||
font-size: 12px;
|
||||
line-height: 25px;
|
||||
text-align: center;
|
||||
&:disabled{
|
||||
background: #6dbcff;
|
||||
cursor: no-drop;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
@ -1,152 +0,0 @@
|
||||
<template>
|
||||
<div class="device">
|
||||
<div class="device__head">
|
||||
<div class="device__head--title">
|
||||
{{ $t(titleI18n) }}<span>-{{ hasPlc? $t('trainRoom.plcGatewayOnline') : $t('trainRoom.plcGatewayOffline') }}</span>
|
||||
</div>
|
||||
<div class="device__head--add">
|
||||
<el-button v-if="userId == room.creatorId" icon="el-icon-plus" circle plain @click="handleAddDevice()" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="device__container">
|
||||
<ul class="device__container--list">
|
||||
<li v-for="(node, index) in options" :key="index">
|
||||
<span>{{ realDeviceType[node.deviceType] }}</span>
|
||||
<i v-if="userId == room.creatorId" class="el-icon-close delete" @click="handleDelDevice(node, index)" />
|
||||
<div style="float: right; margin-right: 15px;">
|
||||
<el-select
|
||||
v-model="node.deviceCode"
|
||||
:placeholder="$t('global.choose')"
|
||||
size="mini"
|
||||
:disabled="userId != room.creatorId"
|
||||
@change="handleUpdDevice(node, index)"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in deviceList"
|
||||
:key="item.code"
|
||||
:label="item.name"
|
||||
:value="item.code"
|
||||
:disabled="item.disabled"
|
||||
style="margin-left: 10px"
|
||||
/>
|
||||
</el-select>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { RealDeviceType } from '@/scripts/ConstDic';
|
||||
|
||||
export default {
|
||||
props: {
|
||||
titleI18n: {
|
||||
type: String,
|
||||
required: true
|
||||
},
|
||||
room: {
|
||||
type:Object,
|
||||
required: true
|
||||
},
|
||||
options: {
|
||||
type: Array,
|
||||
required: true
|
||||
},
|
||||
deviceType: {
|
||||
type: String,
|
||||
default: ''
|
||||
},
|
||||
deviceList: {
|
||||
type: Array,
|
||||
default() {
|
||||
return [];
|
||||
}
|
||||
},
|
||||
hasPlc: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
realDeviceType: RealDeviceType
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
userId() {
|
||||
return this.$store.state.user ? this.$store.state.user.id : '';
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
handleAddDevice() {
|
||||
this.$emit('addDevice', { deviceType: this.deviceType });
|
||||
},
|
||||
handleUpdDevice(node, index) {
|
||||
this.$emit('changeDevice', { deviceType: this.deviceType, device: node, deviceList: this.deviceList });
|
||||
},
|
||||
handleDelDevice(node, index) {
|
||||
this.$emit('delDevice', { deviceType: this.deviceType, device: node, deviceList: this.deviceList });
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
ul,
|
||||
li {
|
||||
list-style: none;
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.device {
|
||||
border: 1px solid #ccc;
|
||||
height: 200px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: space-between;
|
||||
position: relative;
|
||||
|
||||
&__head {
|
||||
border-bottom: 1px solid #ccc;
|
||||
background: #f0f0f0;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
padding: 3px;
|
||||
&--title {
|
||||
font-size: 14px;
|
||||
font-weight: bold;
|
||||
margin-left:10px;
|
||||
}
|
||||
|
||||
&--add {
|
||||
margin-right:2px;
|
||||
/deep/ .el-button.is-circle {
|
||||
padding: 5px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
&__container {
|
||||
flex-grow: 1;
|
||||
&--list {
|
||||
li {
|
||||
height: 30px;
|
||||
line-height: 30px;
|
||||
padding-left: 10px;
|
||||
display: flow-root;
|
||||
}
|
||||
|
||||
.delete {
|
||||
float: right;
|
||||
margin-right: 10px;
|
||||
margin-top: 7px;
|
||||
cursor: pointer;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
@ -1,134 +0,0 @@
|
||||
<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.inRoom" style="color: green;">{{ data.nickName }}</span>
|
||||
<span v-else style="color: #ccc;">{{ data.nickName }}</span>
|
||||
</span>
|
||||
</el-tree>
|
||||
</el-scrollbar>
|
||||
</div>
|
||||
<content-menu ref="menu" :click-user-id="clickUserId" />
|
||||
</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
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
filterText: '',
|
||||
clickUserId: ''
|
||||
};
|
||||
},
|
||||
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.userId == this.room.creatorId) {
|
||||
this.clickUserId = `${obj.id || ''}`;
|
||||
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% - 40px);
|
||||
max-height: calc(100% - 40px);
|
||||
border-bottom: 1px #ccc solid;
|
||||
|
||||
&::-webkit-scrollbar {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
@ -1,179 +0,0 @@
|
||||
<template>
|
||||
<div class="role">
|
||||
<div class="role__head">
|
||||
<div class="role__head--title">
|
||||
{{ $t(titleI18n) }}
|
||||
</div>
|
||||
<div class="role__head--add">
|
||||
<el-button v-if="userId == room.creatorId && !projectDevice" :disabled="addRoleDis" icon="el-icon-plus" circle plain @click="handleAddUser()" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="role__container">
|
||||
<ul class="role__container--list">
|
||||
<li v-for="(node, index) in options" :key="index">
|
||||
<span>{{ node.nickName }}</span>
|
||||
<i v-if="userId == room.creatorId" class="el-icon-close delete" @click="handleDelUser(node, index)" />
|
||||
<div v-if="hasDevice" style="float: right; margin-right: 15px;">
|
||||
<el-cascader
|
||||
v-if="roleType == 'IBP'"
|
||||
v-model="node.deviceCode"
|
||||
size="mini"
|
||||
:placeholder="$t('global.choose')"
|
||||
:disabled="isDisable || starting"
|
||||
:options="deviceList"
|
||||
@change="handleUpdUser(node, index)"
|
||||
/>
|
||||
<el-select
|
||||
v-if="roleType.toUpperCase() == 'ATTENDANT' || roleType.toUpperCase() === 'STATION_SUPERVISOR'"
|
||||
v-model="node.deviceCode"
|
||||
:placeholder="$t('global.choose')"
|
||||
size="mini"
|
||||
:disabled="isDisable || starting"
|
||||
@change="handleUpdUser(node, index)"
|
||||
>
|
||||
<el-option
|
||||
v-for="(item,deviceIndex) in deviceList"
|
||||
:key="deviceIndex"
|
||||
:label="item.name"
|
||||
:value="item.code"
|
||||
:disabled="item.disabled"
|
||||
style="margin-left: 10px"
|
||||
/>
|
||||
</el-select>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
export default {
|
||||
props: {
|
||||
titleI18n: {
|
||||
type: String,
|
||||
required: true
|
||||
},
|
||||
room: {
|
||||
type:Object,
|
||||
required: true
|
||||
},
|
||||
options: {
|
||||
type: Array,
|
||||
required: true
|
||||
},
|
||||
roleType: {
|
||||
type: String,
|
||||
default: ''
|
||||
},
|
||||
deviceList: {
|
||||
type: Array,
|
||||
default() {
|
||||
return [];
|
||||
}
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
hasDevice() {
|
||||
return ['ATTENDANT', 'IBP', 'STATION_SUPERVISOR'].includes(this.roleType.toUpperCase());
|
||||
},
|
||||
isDisable() {
|
||||
return this.userId != this.room.creatorId;
|
||||
},
|
||||
userId() {
|
||||
return this.$store.state.user ? this.$store.state.user.id : '';
|
||||
},
|
||||
projectDevice() {
|
||||
return this.$store.state.user.projectDevice;
|
||||
},
|
||||
addRoleDis() {
|
||||
if (this.roleType === 'CI' && this.options.length > 0) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
},
|
||||
starting() {
|
||||
return this.$route.query.drawWay + '' === 'true' && this.room.state == '02';
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
handleAddUser() {
|
||||
this.$emit('addUser', { roleType: this.roleType });
|
||||
},
|
||||
handleUpdUser(node, index) {
|
||||
this.$emit('changeUser', { roleType: this.roleType, user: node, deviceList: this.deviceList });
|
||||
},
|
||||
handleDelUser(node, index) {
|
||||
this.$emit('delUser', { roleType: this.roleType, user: node, deviceList: this.deviceList });
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
ul,
|
||||
li {
|
||||
list-style: none;
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
}
|
||||
.role {
|
||||
border: 1px solid #ccc;
|
||||
height: 200px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: space-between;
|
||||
position: relative;
|
||||
|
||||
&__head {
|
||||
border-bottom: 1px solid #ccc;
|
||||
background: #f0f0f0;
|
||||
display: flex;
|
||||
height: 33px;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
padding: 3px;
|
||||
&--title {
|
||||
font-size: 14px;
|
||||
font-weight: bold;
|
||||
margin-left:10px;
|
||||
}
|
||||
|
||||
&--add {
|
||||
margin-right:2px;
|
||||
/deep/ .el-button.is-circle {
|
||||
padding: 5px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
&__container {
|
||||
flex-grow: 1;
|
||||
&--list {
|
||||
li {
|
||||
height: 30px;
|
||||
line-height: 30px;
|
||||
padding-left: 10px;
|
||||
display: flow-root;
|
||||
|
||||
&:hover {
|
||||
background: #D6E0F2;
|
||||
}
|
||||
}
|
||||
|
||||
.delete {
|
||||
float: right;
|
||||
margin-right: 10px;
|
||||
margin-top: 7px;
|
||||
cursor: pointer;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
@ -1,582 +0,0 @@
|
||||
<template>
|
||||
<div class="roles">
|
||||
<div class="roles__head">
|
||||
<div class="roles__head--title">
|
||||
<div class="label">人员分配</div>
|
||||
<div class="notes">{{ room.permissionRest }} / {{ room.permissionNum - 1 }}</div>
|
||||
</div>
|
||||
<div class="roles__head--reset">
|
||||
<!--<el-button size="mini" round>重置</el-button>-->
|
||||
</div>
|
||||
</div>
|
||||
<div class="roles__container">
|
||||
<el-scrollbar wrap-class="scrollbar-wrapper" :style="{height: rolesHeight+'px', width: '100%'}">
|
||||
<div class="roles">
|
||||
<e-role
|
||||
class="role"
|
||||
title-i18n="trainRoom.dispatcher"
|
||||
role-type="Dispatcher"
|
||||
:room="room"
|
||||
:options="dispatcherList"
|
||||
@addUser="handleAddUser"
|
||||
@changeUser="handleUpdUser"
|
||||
@delUser="handleDelUser"
|
||||
/>
|
||||
<e-role
|
||||
class="role"
|
||||
title-i18n="trainRoom.stationAttendant"
|
||||
role-type="Attendant"
|
||||
:room="room"
|
||||
:options="attendantList"
|
||||
:device-list="stationListForAttendant"
|
||||
@addUser="handleAddUser"
|
||||
@changeUser="handleUpdUser"
|
||||
@delUser="handleDelUser"
|
||||
/>
|
||||
<e-role
|
||||
v-if="drawWay != 'true'"
|
||||
class="role"
|
||||
title-i18n="trainRoom.teacher"
|
||||
role-type="Instructor"
|
||||
:room="room"
|
||||
:options="instructorList"
|
||||
@addUser="handleAddUser"
|
||||
@changeUser="handleUpdUser"
|
||||
@delUser="handleDelUser"
|
||||
/>
|
||||
<e-role
|
||||
class="role"
|
||||
title-i18n="trainRoom.universalAccount"
|
||||
role-type="Repair"
|
||||
:room="room"
|
||||
:options="repairList"
|
||||
@addUser="handleAddUser"
|
||||
@changeUser="handleUpdUser"
|
||||
@delUser="handleDelUser"
|
||||
/>
|
||||
<e-role
|
||||
class="role"
|
||||
title-i18n="trainRoom.driver"
|
||||
role-type="Driver"
|
||||
:room="room"
|
||||
:options="driverList"
|
||||
@addUser="handleAddUser"
|
||||
@changeUser="handleUpdUser"
|
||||
@delUser="handleDelUser"
|
||||
/>
|
||||
<e-role
|
||||
v-if="drawWay != 'true'"
|
||||
class="role"
|
||||
title-i18n="trainRoom.ibp"
|
||||
role-type="IBP"
|
||||
:room="room"
|
||||
:options="ibpList"
|
||||
:device-list="stationListForIBP"
|
||||
@addUser="handleAddUser"
|
||||
@changeUser="handleUpdUser"
|
||||
@delUser="handleDelUser"
|
||||
/>
|
||||
<e-role
|
||||
v-if="isGzbProject"
|
||||
class="role"
|
||||
title-i18n="trainRoom.interlock"
|
||||
role-type="CI"
|
||||
:room="room"
|
||||
:options="ciList"
|
||||
@addUser="handleAddUser"
|
||||
@changeUser="handleUpdUser"
|
||||
@delUser="handleDelUser"
|
||||
/>
|
||||
<e-device
|
||||
v-if="isXtyProject"
|
||||
class="role"
|
||||
title-i18n="trainRoom.realDevice"
|
||||
device-type="StationStand"
|
||||
:room="room"
|
||||
:options="standList"
|
||||
:device-list="doorList"
|
||||
:has-plc="hasPlc"
|
||||
@addDevice="handleAddDevice"
|
||||
@changeDevice="handleUpdDevice"
|
||||
@delDevice="handleDelDevice"
|
||||
/>
|
||||
</div>
|
||||
</el-scrollbar>
|
||||
</div>
|
||||
<div class="roles__footer">
|
||||
<el-button v-if="userId == room.creatorId" style="margin-left: 10px" type="danger" :disabled="disabled" @click="handleExit">{{ $t('trainRoom.destroyRoom') }}</el-button>
|
||||
<el-button v-if="userId == room.creatorId && !isLocal" style="margin-left: 10px" type="success" :disabled="disabled" @click="handlePostQrcode">{{ $t('trainRoom.generatingQRCode') }}</el-button>
|
||||
<el-button v-if="userId == room.creatorId && isLocal" style="margin-left: 10px" type="success" :disabled="disabled" @click="handleGetGroup">{{ $t('trainRoom.getGroupId') }}</el-button>
|
||||
<template v-if="!starting">
|
||||
<el-button v-if="userId == room.creatorId" style="margin-left: 10px" type="primary" :disabled="disabled" @click="handleStart"> {{ $t('trainRoom.startSimulation') }}</el-button>
|
||||
</template>
|
||||
<template v-else>
|
||||
<el-button type="primary" style="margin-left: 10px" :disabled="disabled" @click="handleJoin"> {{ $t('trainRoom.enterSimulation') }}</el-button>
|
||||
<el-button v-if="userId == room.creatorId" style="margin-left: 10px" type="warning" :disabled="disabled" @click="handleStop"> {{ $t('trainRoom.endSimulation') }}</el-button>
|
||||
</template>
|
||||
<el-button v-if="!projectDevice" type="" :disabled="disabled" @click="handleBack">{{ $t('global.back') }}</el-button>
|
||||
</div>
|
||||
<add-person ref="addPerson" :audience-list="audienceList" @dispatch="handleDispatchUser" />
|
||||
<qr-code ref="qrCode" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import eRole from './e-role';
|
||||
import eDevice from './e-device';
|
||||
import AddPerson from './add-person';
|
||||
import QrCode from '@/components/QrCode';
|
||||
import { getJoinTrainCode, startJointTraining, deljointTrainRoom, putJointTrainingExit, putJointTrainingSimulation, putUserRoles, setRealDevice, delRealDevice } from '@/api/chat';
|
||||
import { getJoinTrainCodeNew, startJointTrainingNew, deljointTrainRoomNew, putUserRolesNew, putJointTrainingExitNew, putJointTrainingSimulationNew, setRealDeviceNew, delRealDeviceNew } from '@/api/jointTraining';
|
||||
import { getPlcGateway } from '@/api/simulation';
|
||||
import { getSessionStorage } from '@/utils/auth';
|
||||
|
||||
export default {
|
||||
components : {
|
||||
eRole,
|
||||
eDevice,
|
||||
AddPerson,
|
||||
QrCode
|
||||
},
|
||||
props: {
|
||||
room: {
|
||||
type: Object,
|
||||
required: true
|
||||
},
|
||||
members: {
|
||||
type: Array,
|
||||
required: true
|
||||
},
|
||||
height: {
|
||||
type: Number,
|
||||
required: true
|
||||
},
|
||||
stationList: {
|
||||
type: Array,
|
||||
default() {
|
||||
return [];
|
||||
}
|
||||
},
|
||||
availableStationList:{
|
||||
type: Array,
|
||||
default() {
|
||||
return [];
|
||||
}
|
||||
},
|
||||
standList: {
|
||||
type: Array,
|
||||
default() {
|
||||
return [];
|
||||
}
|
||||
},
|
||||
doorList: {
|
||||
type: Array,
|
||||
default() {
|
||||
return [];
|
||||
}
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
disabled: false,
|
||||
hasPlc: false
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
rolesHeight() {
|
||||
return this.height - 100;
|
||||
},
|
||||
projectDevice() {
|
||||
return this.$store.state.user.projectDevice;
|
||||
},
|
||||
isXtyProject() {
|
||||
return getSessionStorage('project').endsWith('xty');
|
||||
},
|
||||
isGzbProject() {
|
||||
return getSessionStorage('project').endsWith('gzb');
|
||||
},
|
||||
isLocal() {
|
||||
return process.env.VUE_APP_PRO === 'local';
|
||||
},
|
||||
group() {
|
||||
return this.$route.query.group;
|
||||
},
|
||||
drawWay() {
|
||||
return this.$route.query.drawWay + '';
|
||||
},
|
||||
userId() {
|
||||
return this.$store.state.user ? this.$store.state.user.id : '';
|
||||
},
|
||||
starting() {
|
||||
return this.room.state == '02';
|
||||
},
|
||||
stationListForAttendant() {
|
||||
if (this.drawWay === 'true') {
|
||||
return this.availableStationList;
|
||||
} else {
|
||||
return this.stationList.filter(elem => { return elem.centralized; }).map(item => {
|
||||
const elem = { code: item.code, name: item.name, disabled: false };
|
||||
this.attendantList.forEach(nor => {
|
||||
if (elem.code == nor.deviceCode) {
|
||||
elem.disabled = true;
|
||||
}
|
||||
});
|
||||
return elem;
|
||||
});
|
||||
}
|
||||
|
||||
},
|
||||
stationListForIBP() {
|
||||
return this.stationList.map(item => {
|
||||
const elem = { value: item.code, label: item.name, children: [{value: 'left', label: this.$t('trainRoom.left')}, {value: 'right', label: this.$t('trainRoom.right')}] };
|
||||
return elem;
|
||||
});
|
||||
},
|
||||
dispatcherList() {
|
||||
return this.members.filter(elem => { return [elem.userRole.toUpperCase()].includes('DISPATCHER'); });
|
||||
},
|
||||
attendantList() {
|
||||
return this.members.filter(elem => { return [elem.userRole.toUpperCase()].includes('ATTENDANT') || [elem.userRole.toUpperCase()].includes('STATION_SUPERVISOR'); });
|
||||
},
|
||||
instructorList() {
|
||||
return this.members.filter(elem => { return [elem.userRole.toUpperCase()].includes('INSTRUCTOR'); });
|
||||
},
|
||||
repairList() {
|
||||
return this.members.filter(elem => { return [elem.userRole.toUpperCase()].includes('REPAIR') || [elem.userRole.toUpperCase()].includes('MAINTAINER'); });
|
||||
},
|
||||
driverList() {
|
||||
return this.members.filter(elem => { return [elem.userRole.toUpperCase()].includes('DRIVER'); });
|
||||
},
|
||||
ibpList() {
|
||||
return this.members.filter(elem => { return [elem.userRole.toUpperCase()].includes('IBP'); });
|
||||
},
|
||||
audienceList() {
|
||||
return this.members.filter(elem => { return [elem.userRole.toUpperCase()].includes('AUDIENCE'); });
|
||||
},
|
||||
ciList() {
|
||||
return this.members.filter(elem => { return [elem.userRole.toUpperCase()].includes('CI'); });
|
||||
}
|
||||
},
|
||||
async mounted() {
|
||||
await this.checkPlcGateway();
|
||||
},
|
||||
methods: {
|
||||
async checkPlcGateway() {
|
||||
try {
|
||||
const resp = await getPlcGateway(this.group);
|
||||
this.hasPlc = !!resp.data;
|
||||
} catch (e) {
|
||||
this.hasPlc = false;
|
||||
this.$messageBox(this.$t('error.inquiryPLCDeviceFailed'));
|
||||
}
|
||||
},
|
||||
async handleAddDevice({deviceType}) {
|
||||
const roomDeviceVo = {id: '', deviceType: 'ScreenDoor', deviceCode: ''};
|
||||
if (this.standList.findIndex(elem => { return elem.deviceType == roomDeviceVo.deviceType; }) > -1) {
|
||||
this.$message.info(this.$t('error.theDeviceTypeAlreadyExists'));
|
||||
return;
|
||||
}
|
||||
if (this.drawWay === 'true') {
|
||||
await setRealDeviceNew(this.group, roomDeviceVo);
|
||||
} else {
|
||||
await setRealDevice(this.group, roomDeviceVo);
|
||||
}
|
||||
},
|
||||
async handleUpdDevice({deviceType, device}) {
|
||||
try {
|
||||
if (this.drawWay === 'true') {
|
||||
await setRealDeviceNew(this.group, device);
|
||||
} else {
|
||||
await setRealDevice(this.group, device);
|
||||
}
|
||||
} catch (e) {
|
||||
this.$messageBox(this.$t('error.connectToRealDeviceFailed'));
|
||||
}
|
||||
},
|
||||
async handleDelDevice({deviceType, device}) {
|
||||
try {
|
||||
if (this.drawWay === 'true') {
|
||||
await delRealDeviceNew(device.id, this.group);
|
||||
} else {
|
||||
await delRealDevice(device.id, this.group);
|
||||
}
|
||||
} catch (e) {
|
||||
this.$messageBox(this.$t('error.deleteRealDeviceFailed'));
|
||||
}
|
||||
},
|
||||
async handleAddUser({roleType}) {
|
||||
this.$refs.addPerson.doShow(roleType);
|
||||
},
|
||||
async handleDelUser({roleType, user}) {
|
||||
const params = [{
|
||||
id: user.id,
|
||||
nickName: user.nickName,
|
||||
userRole: 'Audience',
|
||||
deviceCode: ''
|
||||
}];
|
||||
if (this.drawWay === 'true') {
|
||||
params[0].userRole = 'AUDIENCE';
|
||||
try {
|
||||
await putUserRolesNew(params, this.group);
|
||||
} catch (error) {
|
||||
this.$message(error.message);
|
||||
}
|
||||
} else {
|
||||
await putUserRoles(params, this.group);
|
||||
}
|
||||
},
|
||||
async handleUpdUser({roleType, user, deviceList}) {
|
||||
let deviceCode = '';
|
||||
if (roleType === 'IBP') {
|
||||
user.ibpPart = user.deviceCode[1];
|
||||
deviceCode = user.deviceCode[0];
|
||||
} else {
|
||||
user.ibpPart = '';
|
||||
deviceCode = user.deviceCode;
|
||||
}
|
||||
|
||||
const params = [{
|
||||
id: user.id,
|
||||
nickName: user.nickName,
|
||||
userRole: roleType,
|
||||
deviceCode: deviceCode,
|
||||
ibpPart: user.ibpPart
|
||||
}];
|
||||
if (this.drawWay === 'true') {
|
||||
params[0].userRole = roleType.toUpperCase();
|
||||
if (roleType === 'Attendant') {
|
||||
params[0].userRole = 'STATION_SUPERVISOR';
|
||||
} else if (roleType === 'Repair') {
|
||||
params[0].userRole = 'MAINTAINER';
|
||||
}
|
||||
try {
|
||||
await putUserRolesNew(params, this.group);
|
||||
} catch (error) {
|
||||
this.$message(error.message);
|
||||
}
|
||||
|
||||
} else {
|
||||
await putUserRoles(params, this.group);
|
||||
}
|
||||
|
||||
this.stationList.forEach(item => {
|
||||
item.disabled = false;
|
||||
deviceList.forEach(nor => {
|
||||
if (item.code === nor.deviceCode) {
|
||||
item.disabled = true;
|
||||
}
|
||||
});
|
||||
});
|
||||
},
|
||||
async handleDispatchUser({roleType, userList}) {
|
||||
if (userList.length) {
|
||||
try {
|
||||
let list = [];
|
||||
if (this.drawWay === 'true') {
|
||||
if (roleType === 'Attendant') {
|
||||
list = userList.map(elem => { return { id: elem.id, nickName: elem.nickName, userRole: 'STATION_SUPERVISOR' }; });
|
||||
} else if (roleType === 'Repair') {
|
||||
list = userList.map(elem => { return { id: elem.id, nickName: elem.nickName, userRole: 'MAINTAINER'}; });
|
||||
} else {
|
||||
list = userList.map(elem => { return { id: elem.id, nickName: elem.nickName, userRole: roleType.toUpperCase() }; });
|
||||
}
|
||||
try {
|
||||
await putUserRolesNew(list, this.group);
|
||||
} catch (error) {
|
||||
this.$message(error.message);
|
||||
}
|
||||
|
||||
} else {
|
||||
list = userList.map(elem => { return { id: elem.id, nickName: elem.nickName, userRole: roleType }; });
|
||||
await putUserRoles(list, this.group);
|
||||
}
|
||||
list.forEach(item => {
|
||||
this.treeData.forEach(nor => {
|
||||
if (item.id == nor.id) {
|
||||
nor.userRole = item.userRole;
|
||||
}
|
||||
});
|
||||
});
|
||||
} catch (error) {
|
||||
if (error.code == 500009) {
|
||||
this.messageInfo({error:'error', message: this.$t('error.exceededTheTotalNumberOfAssignableRoles')} );
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
async handlePostQrcode() {
|
||||
this.disabled = true;
|
||||
let res = '';
|
||||
if (this.drawWay === 'true') {
|
||||
res = await getJoinTrainCodeNew({}, this.group);
|
||||
} else {
|
||||
res = await getJoinTrainCode({}, this.group);
|
||||
}
|
||||
if (res.code == '200') {
|
||||
const param = {
|
||||
url: res.data,
|
||||
title: this.$t('trainRoom.distributeTheRoomQRCode'),
|
||||
group: this.group
|
||||
};
|
||||
if (this.$refs) {
|
||||
this.$refs.qrCode.doShow(param);
|
||||
}
|
||||
}
|
||||
this.disabled = false;
|
||||
},
|
||||
async handleJoin() {
|
||||
try {
|
||||
this.disabled = true;
|
||||
this.$emit('joinTraining');
|
||||
} catch (e) {
|
||||
console.error(e);
|
||||
}
|
||||
},
|
||||
async handleStart() {
|
||||
this.disabled = true;
|
||||
if (this.attendantList.findIndex(item => { return !item.deviceCode; }) < 0) {
|
||||
try {
|
||||
if (this.drawWay === 'true') {
|
||||
await startJointTrainingNew(this.group);
|
||||
} else {
|
||||
await startJointTraining(this.group);
|
||||
}
|
||||
} catch (error) {
|
||||
this.$emit('message', {type:'error', message: this.$t('error.startedComprehensiveDrillFailure')});
|
||||
this.disabled = false;
|
||||
}
|
||||
} else {
|
||||
this.$emit('message', {type:'error', message: this.$t('error.stationAttendantStationCannotBeEmpty')});
|
||||
this.disabled = false;
|
||||
}
|
||||
},
|
||||
async handleStop() {
|
||||
try {
|
||||
this.disabled = true;
|
||||
let res = '';
|
||||
if (this.drawWay === 'true') {
|
||||
res = await putJointTrainingSimulationNew(this.group);
|
||||
} else {
|
||||
res = await putJointTrainingSimulation(this.group);
|
||||
}
|
||||
this.mapId = res.data.mapId;
|
||||
} catch (e) {
|
||||
console.error(e);
|
||||
} finally {
|
||||
this.disabled = false;
|
||||
}
|
||||
},
|
||||
async handleExit() {
|
||||
this.disabled = true;
|
||||
this.$confirm( this.$t('tip.destroyRoomHint'), this.$t('tip.hint'), {
|
||||
confirmButtonText: this.$t('global.confirm'),
|
||||
cancelButtonText: this.$t('global.cancel'),
|
||||
type: 'warning'
|
||||
}).then(async () => {
|
||||
try {
|
||||
if (this.drawWay === 'true') {
|
||||
await deljointTrainRoomNew(this.group);
|
||||
} else {
|
||||
await deljointTrainRoom(this.group);
|
||||
}
|
||||
} catch (error) {
|
||||
this.$emit('message', {type:'error', message: this.$t('error.destroyedRoomFailed')});
|
||||
} finally {
|
||||
this.disabled = false;
|
||||
}
|
||||
}).catch(() => {
|
||||
this.disabled = false;
|
||||
});
|
||||
},
|
||||
handleGetGroup() {
|
||||
this.$messageBox(this.group, this.$t('trainRoom.groupId'), 'success');
|
||||
},
|
||||
async handleBack() {
|
||||
try {
|
||||
this.disabled = true;
|
||||
if (this.drawWay === 'true') {
|
||||
await putJointTrainingExitNew(this.group);
|
||||
} else {
|
||||
await putJointTrainingExit(this.group);
|
||||
}
|
||||
this.$emit('clearSubscribe');
|
||||
this.$router.go(-1);
|
||||
} catch (error) {
|
||||
this.disabled = false;
|
||||
this.$emit('message', {type:'error', message: this.$t('error.operationFailure')});
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.roles {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
background: #fff;
|
||||
|
||||
&__head {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
padding: 0 30px;
|
||||
border-top: 1px solid #ccc;
|
||||
box-shadow: 0 3px 3px #ccc;
|
||||
background: #F0F0F0;
|
||||
|
||||
&--title {
|
||||
display: flex;
|
||||
align-items: flex-end;
|
||||
padding: 10px 0px;
|
||||
|
||||
.label {
|
||||
font-size: 16px;
|
||||
font-weight: bold;
|
||||
border-left: 5px solid #CF2727;
|
||||
padding: 0 5px
|
||||
}
|
||||
|
||||
.notes {
|
||||
font-size: 12px;
|
||||
padding: 0 5px
|
||||
}
|
||||
}
|
||||
|
||||
&--reset {
|
||||
.el-button {
|
||||
background: #CF2727;
|
||||
color: #fff;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
&__container {
|
||||
display: flex;
|
||||
flex-grow: 1;
|
||||
padding: 5px 10px;
|
||||
.roles {
|
||||
display: flex;
|
||||
justify-content: flex-start;
|
||||
flex-flow: row wrap;
|
||||
flex-grow: 1;
|
||||
|
||||
.role {
|
||||
display: flex;
|
||||
flex-basis: 340px;
|
||||
margin-top: 20px;
|
||||
margin-left: 40px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
&__footer {
|
||||
height: 60px;
|
||||
display: flex;
|
||||
padding: 0 30px;
|
||||
align-items: center;
|
||||
border-top: 1px solid #ccc;
|
||||
border-bottom: 1px solid #ccc;
|
||||
}
|
||||
}
|
||||
</style>
|
@ -1,435 +0,0 @@
|
||||
<template>
|
||||
<div class="room">
|
||||
<div class="room__head">
|
||||
<div class="room__head--title">
|
||||
{{ $t('trainRoom.comprehensiveDrillRoom') }}
|
||||
</div>
|
||||
<div class="room__head--notes">
|
||||
{{ $t('trainRoom.comprehensiveTrainingManager') + room.creator.nickName }}
|
||||
</div>
|
||||
<div v-if="projectDevice" class="room__head--info">
|
||||
<el-dropdown class="avatar-container" trigger="hover" :show-timeout="100" style="height:20px; cursor: pointer;">
|
||||
<div class="avatar-wrapper">
|
||||
<span style="color: white;font-size: 16px;">
|
||||
{{ username }}
|
||||
</span>
|
||||
<i class="el-icon-caret-bottom" style="color: #909399;" />
|
||||
</div>
|
||||
<el-dropdown-menu slot="dropdown" class="user-dropdown">
|
||||
<el-dropdown-item>
|
||||
<span style="display:block;" @click="handleDetail">{{ $t('global.personalDetails') }}</span>
|
||||
</el-dropdown-item>
|
||||
<el-dropdown-item>
|
||||
<span style="display:block;" @click="logout">{{ $t('global.exit') }}</span>
|
||||
</el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
<user-info ref="userInfo" />
|
||||
</el-dropdown>
|
||||
</div>
|
||||
</div>
|
||||
<div class="room__container">
|
||||
<e-members
|
||||
class="room__container--members"
|
||||
:room="room"
|
||||
:members="members"
|
||||
:height="height"
|
||||
@message="messageInfo"
|
||||
/>
|
||||
<e-roles
|
||||
class="room__container--roles"
|
||||
:room="room"
|
||||
:members="members"
|
||||
:height="height"
|
||||
:station-list="stationList"
|
||||
:available-station-list="availableStationList"
|
||||
:stand-list="standList"
|
||||
:door-list="doorList"
|
||||
@message="messageInfo"
|
||||
@joinTraining="jumpInSimulation"
|
||||
@clearSubscribe="clearSubscribe"
|
||||
/>
|
||||
<e-chat
|
||||
class="room__container--chat"
|
||||
:room="room"
|
||||
:members="members"
|
||||
:height="height"
|
||||
@message="messageInfo"
|
||||
/>
|
||||
</div>
|
||||
<div class="room__footer" />
|
||||
<user-info ref="userInfo" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { getToken } from '@/utils/auth';
|
||||
import { creatSubscribe, clearSubscribe, roomTopic} from '@/utils/stomp';
|
||||
import eMembers from './e-members';
|
||||
import eChat from './e-chat';
|
||||
import eRoles from './e-roles';
|
||||
import { postRoomDetail, getJointTrainRoomUserList, getRealDevices, putJointTrainingSimulationEntrance, getjointTraining } from '@/api/chat';
|
||||
import { postRoomDetailNew, getJointTrainRoomUserListNew, putJointTrainingSimulationEntranceNew, getjointTrainingNew, getRealDevicesNew, getAvailableStaionList} from '@/api/jointTraining';
|
||||
import { getPublishMapInfo, hasDoorStationList } from '@/api/jmap/map';
|
||||
import { launchFullscreen } from '@/utils/screen';
|
||||
import { getStationList } from '@/api/runplan';
|
||||
import { checkLoginLine } from '@/api/login';
|
||||
import userInfo from '@/layout/components/userInfo';
|
||||
|
||||
export default {
|
||||
components: {
|
||||
eMembers,
|
||||
eChat,
|
||||
eRoles,
|
||||
userInfo
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
room: {
|
||||
totalNum: 0,
|
||||
group: '',
|
||||
mapId: '',
|
||||
creatorId: '',
|
||||
creator: {
|
||||
nickName: ''
|
||||
},
|
||||
permissionRest: 0,
|
||||
permissionNum: 0,
|
||||
state: ''
|
||||
},
|
||||
userMap: [],
|
||||
members: [],
|
||||
stationList: [],
|
||||
availableStationList:[],
|
||||
standList: [],
|
||||
doorList: [],
|
||||
timer: null
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
height() {
|
||||
return this.$store.state.app.height - 100;
|
||||
},
|
||||
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: {
|
||||
members: {
|
||||
deep: true,
|
||||
handler() {
|
||||
this.room.permissionRest = this.members.filter(elem => ['AUDIENCE'].includes(elem.userRole.toUpperCase())).length;
|
||||
}
|
||||
},
|
||||
// 用户信息
|
||||
'$store.state.socket.roleList': async function (val) {
|
||||
if (val.length) {
|
||||
await this.dispatchUsers(val);
|
||||
}
|
||||
},
|
||||
// 房间消息
|
||||
'$store.state.socket.jointRoomInfo': async function (val) {
|
||||
if (val.creatorId) {
|
||||
await this.dispatchRoomInfo(val);
|
||||
}
|
||||
},
|
||||
// 设备信息
|
||||
'$store.state.socket.realDeviceInfo': async function (val) {
|
||||
await this.getStandList();
|
||||
},
|
||||
// 路由切换
|
||||
'$route': async function() {
|
||||
await this.loadInit();
|
||||
}
|
||||
},
|
||||
async created() {
|
||||
await this.loadInit();
|
||||
},
|
||||
methods: {
|
||||
async loadInit() {
|
||||
await this.subscribe();
|
||||
if (!this.$store.state.socket.setInRoom && this.drawWay !== 'true') {
|
||||
await getjointTraining(this.group);
|
||||
} else if (!this.$store.state.socket.setInRoom && this.drawWay === 'true') {
|
||||
await getjointTrainingNew(this.group);
|
||||
}
|
||||
await this.getRoomInfo();
|
||||
await this.getUserList();
|
||||
await this.getStandList();
|
||||
await this.getStaionList(this.room.mapId);
|
||||
if (this.drawWay === 'true') {
|
||||
await this.getAvailableStaionList(this.room.mapId);
|
||||
}
|
||||
await this.getDoorList(this.room.mapId, this.stationList);
|
||||
if (this.timer) { clearInterval(this.timer); }
|
||||
this.timer = setInterval(() => {
|
||||
checkLoginLine();
|
||||
}, 5000 * 60);
|
||||
},
|
||||
async getRoomInfo() {
|
||||
let resp = '';
|
||||
if (this.drawWay === 'true') {
|
||||
resp = await postRoomDetailNew(this.group);
|
||||
} else {
|
||||
resp = await postRoomDetail(this.group);
|
||||
}
|
||||
this.room = {
|
||||
permissionRest: 0,
|
||||
totalNum: Number(resp.data.permissionNum) + Number(resp.data.audiencePermissionNum),
|
||||
...resp.data || {}
|
||||
};
|
||||
},
|
||||
async getStandList() {
|
||||
let resp = '';
|
||||
if (this.drawWay === 'true') {
|
||||
resp = await getRealDevicesNew(this.group);
|
||||
} else {
|
||||
resp = await getRealDevices(this.group);
|
||||
}
|
||||
this.standList = resp.data || [];
|
||||
},
|
||||
async getStaionList(mapId) {
|
||||
const resp = await getStationList(mapId);
|
||||
this.stationList = resp.data || [];
|
||||
},
|
||||
async getAvailableStaionList(mapId) {
|
||||
const resp = await getAvailableStaionList(mapId);
|
||||
this.availableStationList = resp.data || [];
|
||||
},
|
||||
async getDoorList(mapId, stationList) {
|
||||
const doorList = [];
|
||||
hasDoorStationList(mapId).then(res =>{
|
||||
stationList.forEach(item => {
|
||||
res.data.forEach(it =>{
|
||||
if (item.code === it.stationCode) {
|
||||
const direction = parseInt(it.doorLocationType) % 2 === 0 ? this.$t('trainRoom.uplinkPlatform') : this.$t('trainRoom.downlinkPlatform');
|
||||
doorList.push({code: it.code, name: item.name + direction});
|
||||
}
|
||||
});
|
||||
});
|
||||
this.doorList = doorList;
|
||||
}).catch(() => {
|
||||
this.$messageBox(this.$t('error.getScreenDoorsListFailed'));
|
||||
});
|
||||
},
|
||||
async getUserList() {
|
||||
let res = '';
|
||||
if (this.drawWay === 'true') {
|
||||
res = await getJointTrainRoomUserListNew(this.group);
|
||||
} else {
|
||||
res = await getJointTrainRoomUserList(this.group);
|
||||
}
|
||||
this.members = (res.data || []).map(elem => { return this.transformUser(elem); });
|
||||
},
|
||||
async dispatchUsers(users) {
|
||||
users.forEach(user => {
|
||||
const index = this.members.findIndex(elem => { return user.id == elem.id; });
|
||||
if (user.userRole) {
|
||||
if (index >= 0) {
|
||||
this.checkUserState(user, this.members[index]);
|
||||
this.members.splice(index, 1, this.transformUser(user));
|
||||
} else {
|
||||
this.checkUserState(user, null);
|
||||
this.members.push(this.transformUser(user));
|
||||
}
|
||||
} else {
|
||||
if (this.members[index]) {
|
||||
this.checkUserState(user, this.members[index]);
|
||||
this.members.splice(index, 1);
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
async dispatchRoomInfo(room) {
|
||||
Object.assign(this.room, room);
|
||||
switch (room.state) {
|
||||
case '03': // 房间销毁
|
||||
{ this.clearSubscribe();
|
||||
this.$router.go(-1);
|
||||
break; }
|
||||
case '02': // 开始仿真
|
||||
{
|
||||
// this.clearSubscribe();
|
||||
await this.jumpInSimulation();
|
||||
break; }
|
||||
}
|
||||
|
||||
// 清空房间信息
|
||||
this.$store.dispatch('socket/setJointRoomInfo');
|
||||
},
|
||||
async checkUserState(user, old) {
|
||||
const message = {
|
||||
join: true,
|
||||
id: user.id,
|
||||
userName: user.nickName,
|
||||
userRole: user.userRole,
|
||||
name: user.name,
|
||||
roomTip: '',
|
||||
chatInfo: true,
|
||||
inSimulation: user.inSimulation,
|
||||
inRoom: user.inRoom,
|
||||
session: 'session',
|
||||
oneself: user.id === this.$store.state.user.id
|
||||
};
|
||||
if (old) {
|
||||
if (!user.userRole) {
|
||||
this.$store.dispatch('socket/setChatContent', {...message, roomTip: `${user.nickName}被提出房间`});
|
||||
if (this.userId == user.id) {
|
||||
await this.jumpOutRoom();
|
||||
}
|
||||
} else if (old.userRole) {
|
||||
if (old.inRoom && !user.inRoom) {
|
||||
this.$store.dispatch('socket/setChatContent', {...message, roomTip: `${user.nickName}离线`});
|
||||
if (this.userId == user.id) {
|
||||
await this.jumpOutRoom();
|
||||
}
|
||||
}
|
||||
|
||||
if (!old.inRoom && user.inRoom) {
|
||||
this.$store.dispatch('socket/setChatContent', {...message, roomTip: `${user.nickName}在线`});
|
||||
}
|
||||
|
||||
if (!old.inSimulation && user.inSimulation) {
|
||||
this.$store.dispatch('socket/setChatContent', {...message, roomTip: `${user.nickName}进入仿真`});
|
||||
if (this.userId == user.id && user.userRole.toUpperCase() !== 'ADMIN') {
|
||||
await this.jumpInSimulation();
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
this.$store.dispatch('socket/setChatContent', {...message, roomTip: `${user.nickName}进入房间`});
|
||||
}
|
||||
},
|
||||
async jumpInSimulation() {
|
||||
const room = this.room;
|
||||
if (this.drawWay === 'true') {
|
||||
await putJointTrainingSimulationEntranceNew(room.group);
|
||||
} else {
|
||||
await putJointTrainingSimulationEntrance(room.group);
|
||||
}
|
||||
const rest = await getPublishMapInfo(room.mapId);
|
||||
const query = { lineCode: rest.data.lineCode, mapId: room.mapId, group: room.group, roomId: room.id };
|
||||
if (this.drawWay === 'true') {
|
||||
query.drawWay = this.drawWay;
|
||||
this.$router.replace({ path: `/jointTrainingNew`, query: query});
|
||||
} else {
|
||||
this.$router.replace({ path: `/jointTraining`, query: query });
|
||||
}
|
||||
// 清空房间信息
|
||||
this.$store.dispatch('socket/setJointRoomInfo');
|
||||
launchFullscreen();
|
||||
},
|
||||
async jumpOutRoom() {
|
||||
this.$router.go(-1);
|
||||
this.messageInfo({error: 'warning', message: this.$t('tip.beKickedOut')});
|
||||
},
|
||||
transformUser(user) {
|
||||
// 根据用户角色专用数据数据
|
||||
switch (user.userRole) {
|
||||
case 'IBP':
|
||||
user.deviceCode = [user.deviceCode || '', user.ibpPart || ''];
|
||||
break;
|
||||
}
|
||||
|
||||
return user;
|
||||
},
|
||||
messageInfo(info) {
|
||||
this.$message({ showClose: true, ...info });
|
||||
},
|
||||
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);
|
||||
},
|
||||
logout() {
|
||||
this.$store.dispatch('LogOut').then(() => {
|
||||
location.reload(); // 为了重新实例化vue-router对象 避免bug
|
||||
});
|
||||
},
|
||||
handleDetail() {
|
||||
this.$refs.userInfo.doShow();
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.room {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
box-sizing: border-box;
|
||||
background: #f0f0f0;
|
||||
|
||||
&__head {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
background: #000;
|
||||
color: #fff;
|
||||
padding: 10px;
|
||||
position: relative;
|
||||
|
||||
&--title {
|
||||
font-size: 22px;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
&--notes {
|
||||
position: absolute;
|
||||
left: 10px;
|
||||
bottom: 5px;
|
||||
}
|
||||
&--info {
|
||||
position: absolute;
|
||||
right: 10px;
|
||||
bottom: 5px;
|
||||
}
|
||||
}
|
||||
|
||||
&__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;
|
||||
}
|
||||
|
||||
}
|
||||
</style>
|
Loading…
Reference in New Issue
Block a user