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

This commit is contained in:
joylink_cuiweidong 2019-10-23 17:47:20 +08:00
commit 15b423a38b
54 changed files with 964 additions and 1276 deletions

View File

@ -239,7 +239,7 @@ export function getPermissionJoint(group) {
}); });
} }
// // 添加或更新真实设备和仿真对象连接
export function setRealDevice(group, data) { export function setRealDevice(group, data) {
return request({ return request({
url: `/api/jointTraining/room/realDevice?group=${group}`, url: `/api/jointTraining/room/realDevice?group=${group}`,
@ -247,3 +247,20 @@ export function setRealDevice(group, data) {
data: data data: data
}); });
} }
// 删除真实设备和仿真对象连接
export function delRealDevice(id, group) {
return request({
url: `/api/jointTraining/room/realDevice/${id}`,
method: 'delete',
params: { group: group }
});
}
// 获取真实设备列表
export function getRealDevices(group) {
return request({
url: `/api/jointTraining/room/${group}/devices`,
method: 'get'
});
}

View File

@ -32,5 +32,6 @@ export default {
instructions: 'Instructions', instructions: 'Instructions',
chapterTrainingName: 'Chapter/training name', chapterTrainingName: 'Chapter/training name',
revokeScriptSuccess: 'Revoke script success', revokeScriptSuccess: 'Revoke script success',
revokeScriptFailed: 'Revoke script failed' revokeScriptFailed: 'Revoke script failed',
skin: 'Skin'
}; };

View File

@ -94,5 +94,11 @@ export default {
getTrainListFailed: 'Failed to get train list', getTrainListFailed: 'Failed to get train list',
getDraftCourseDataFailed: 'Failed to get draft course data!', getDraftCourseDataFailed: 'Failed to get draft course data!',
failedToGetCourseData: 'Failed to get course data!', failedToGetCourseData: 'Failed to get course data!',
failedToGetSystemData: 'Failed to get system data!' failedToGetSystemData: 'Failed to get system data!',
inquiryPLCDeviceFailed: 'Inquiry PLC device failed!',
getScreenDoorsListFailed: 'Get the list of screen doors failed!',
theDeviceTypeAlreadyExists: 'The device type already exists!',
connectToRealDeviceFailed: 'Connect to real device failed!',
getRealDeviceListFailed: 'Get real device list failed!',
deleteRealDeviceFailed: 'Delete real device failed!'
}; };

View File

@ -37,5 +37,8 @@ export default {
theBestTimeToCompleteTheQuestion: 'The best time to complete the question', theBestTimeToCompleteTheQuestion: 'The best time to complete the question',
trainingNotes: 'Training notes', trainingNotes: 'Training notes',
giveUpTheExam: 'Give up the exam', giveUpTheExam: 'Give up the exam',
nameOfTestPaper: 'Test name' nameOfTestPaper: 'Test name',
courseDescription: 'Course description',
enterTheExam: 'Enter the exam',
returnCourseList: 'Return course list'
}; };

View File

@ -58,7 +58,7 @@ export default {
courseList: 'Course list', courseList: 'Course list',
countSkinCode: 'Duplicate skin cannot be the same type as the copied skin', countSkinCode: 'Duplicate skin cannot be the same type as the copied skin',
createNewCoursesFromRelease: 'Create new courses from release', createNewCoursesFromRelease: 'Create new courses from release',
courseName: 'Course name', courseName: 'Course name',
parentChapter: 'Parent chapter', parentChapter: 'Parent chapter',
chapterName: 'Chapter name', chapterName: 'Chapter name',
chapterInstructions: 'Chapter instructions', chapterInstructions: 'Chapter instructions',
@ -71,7 +71,7 @@ export default {
draftCourseName: 'Draft course name', draftCourseName: 'Draft course name',
associatedSkin: 'Associated skin', associatedSkin: 'Associated skin',
associatedProducts: 'Associated products', associatedProducts: 'Associated products',
courseDescription: 'Course description', courseDescription: 'Course description',
editCourse: 'Edit course', editCourse: 'Edit course',
createCourse: 'Create course', createCourse: 'Create course',
courseRelease: 'Course release', courseRelease: 'Course release',
@ -116,5 +116,8 @@ export default {
pendingReview: 'Pending review', pendingReview: 'Pending review',
published: 'Published', published: 'Published',
rejected: 'Rejected', rejected: 'Rejected',
review: 'Review' review: 'Review',
explanation: 'Explanation',
courseDetails: 'Course details',
courseTree: 'Course tree:'
}; };

View File

@ -4,7 +4,7 @@ export default {
pleaseSelect: 'please choose', pleaseSelect: 'please choose',
pleaseEnter: 'please input', pleaseEnter: 'please input',
sketchMap: 'Draft map list', sketchMap: 'Draft map list',
newConstruction: 'create', newConstruction: 'Create',
importMap: 'Import the map', importMap: 'Import the map',
createNewMap: 'A new map', createNewMap: 'A new map',
normalCreate: 'The normal to create', normalCreate: 'The normal to create',

View File

@ -16,5 +16,7 @@ export default {
permissionDistribute: 'Permission distribution (class)', permissionDistribute: 'Permission distribution (class)',
authorityTransferred: 'Authority transferred', authorityTransferred: 'Authority transferred',
courseList: 'Course list', courseList: 'Course list',
seconds: 'seconds' seconds: 'seconds',
enterTheCourse: 'Enter the course',
returnCourseList: 'Return course list'
}; };

View File

@ -27,5 +27,10 @@ export default {
recording: 'recording...', recording: 'recording...',
sendText: 'Send text', sendText: 'Send text',
left: 'left', left: 'left',
right: 'right' right: 'right',
realDevice: 'Real device',
plcGatewayOnline: '[PLC gateway online]',
plcGatewayOffline: '[PLC gateway offline]',
uplinkPlatform: 'Uplink platform',
downlinkPlatform: 'Downlink platform'
}; };

View File

@ -32,6 +32,6 @@ export default {
instructions: '说明', instructions: '说明',
chapterTrainingName: '章节/课程名称', chapterTrainingName: '章节/课程名称',
revokeScriptSuccess: '撤回成功', revokeScriptSuccess: '撤回成功',
revokeScriptFailed: '撤回失败' revokeScriptFailed: '撤回失败',
skin: '皮肤'
}; };

View File

@ -94,5 +94,11 @@ export default {
getTrainListFailed: '获取列车列表失败', getTrainListFailed: '获取列车列表失败',
getDraftCourseDataFailed: '获取草稿课程数据失败!', getDraftCourseDataFailed: '获取草稿课程数据失败!',
failedToGetCourseData: '获取课程数据失败!', failedToGetCourseData: '获取课程数据失败!',
failedToGetSystemData: '获取系统数据失败!' failedToGetSystemData: '获取系统数据失败!',
inquiryPLCDeviceFailed: '查询PLC设备失败',
getScreenDoorsListFailed: '获取屏蔽门列表失败!',
theDeviceTypeAlreadyExists: '已存在该设备类型!',
connectToRealDeviceFailed: '关联真实设备失败!',
getRealDeviceListFailed: '获取真实设备列表失败!',
deleteRealDeviceFailed: '删除真实设备失败!'
}; };

View File

@ -37,5 +37,8 @@ export default {
maximumTimeToCompleteThisQuestion: '完成本题最大用时', maximumTimeToCompleteThisQuestion: '完成本题最大用时',
theBestTimeToCompleteTheQuestion: '完成本题最佳用时', theBestTimeToCompleteTheQuestion: '完成本题最佳用时',
trainingNotes: '实训说明', trainingNotes: '实训说明',
giveUpTheExam: '放弃考试' giveUpTheExam: '放弃考试',
courseDescription: '课程说明',
enterTheExam: '进入考试',
returnCourseList: '返回课程列表'
}; };

View File

@ -161,6 +161,6 @@ export default {
help: '帮助', help: '帮助',
city: '城市', city: '城市',
simulationSystem: '仿真系统', simulationSystem: '仿真系统',
lessonSystem: '课程系统', lessonSystem: '教学系统',
examSystem: '考试系统' examSystem: '考试系统'
}; };

View File

@ -57,7 +57,7 @@ export default {
contentSorting: '内容排序', contentSorting: '内容排序',
courseList: '课程列表', courseList: '课程列表',
createNewCoursesFromRelease: '从发布课程新建', createNewCoursesFromRelease: '从发布课程新建',
courseName: '课程名称', courseName: '课程名称',
parentChapter: '父级章节:', parentChapter: '父级章节:',
chapterName: '章节名称:', chapterName: '章节名称:',
chapterInstructions: '章节说明:', chapterInstructions: '章节说明:',
@ -70,7 +70,7 @@ export default {
draftCourseName: '草稿课程名称:', draftCourseName: '草稿课程名称:',
associatedSkin: '关联皮肤:', associatedSkin: '关联皮肤:',
associatedProducts: '关联产品:', associatedProducts: '关联产品:',
courseDescription: '课程说明', courseDescription: '课程说明',
editCourse: '编辑课程', editCourse: '编辑课程',
createCourse: '创建课程', createCourse: '创建课程',
courseRelease: '课程发布', courseRelease: '课程发布',
@ -115,7 +115,9 @@ export default {
pendingReview: '待审核', pendingReview: '待审核',
published: '已发布', published: '已发布',
rejected: '已驳回', rejected: '已驳回',
review: '查看' review: '查看',
explanation: '驳回说明',
courseDetails: '课程详情',
courseTree: '课程树:'
}; };

View File

@ -16,5 +16,7 @@ export default {
permissionDistribute: '权限分发(上课)', permissionDistribute: '权限分发(上课)',
authorityTransferred: '权限转赠', authorityTransferred: '权限转赠',
courseList: '课程列表', courseList: '课程列表',
seconds: '秒' seconds: '秒',
enterTheCourse: '进入课程',
returnCourseList: '返回课程列表'
}; };

View File

@ -27,5 +27,10 @@ export default {
recording: '录音中...', recording: '录音中...',
sendText: '发送文字', sendText: '发送文字',
left: '左', left: '左',
right: '右' right: '右',
realDevice: '真实设备',
plcGatewayOnline: '[PLC网关在线]',
plcGatewayOffline: '[PLC网关离线]',
uplinkPlatform: '上行站台',
downlinkPlatform: '下行站台'
}; };

View File

@ -157,13 +157,13 @@ export function Jl3dDriving(updatemmi,sound) {
if (trainlisttest.list[code].runMode == '02') { if (trainlisttest.list[code].runMode == '02') {
if (trainlisttest.list[code].isStandTrack == true) { if (trainlisttest.list[code].isStandTrack == true) {
trainlisttest.list[code].speeds = parseFloat(data.body[tl].v*10/36/23/trainlisttest.list[code].len); trainlisttest.list[code].speeds = parseFloat(data.body[tl].v*10/36/24/trainlisttest.list[code].len);
} else { } else {
trainlisttest.list[code].speeds = parseFloat(data.body[tl].v*10/36/23/trainlisttest.list[code].len); trainlisttest.list[code].speeds = parseFloat(data.body[tl].v*10/36/24/trainlisttest.list[code].len);
} }
} else { } else {
trainlisttest.list[code].speeds = parseFloat(data.body[tl].v*10/36/23/trainlisttest.list[code].len); trainlisttest.list[code].speeds = parseFloat(data.body[tl].v*10/36/24/trainlisttest.list[code].len);
} }
if (code == drivingcode) { if (code == drivingcode) {
@ -357,7 +357,7 @@ export function Jl3dDriving(updatemmi,sound) {
// trainlisttest.list[code].startmark = 1; // trainlisttest.list[code].startmark = 1;
}else{ }else{
trainlisttest.list[code].speeds = data.body[i].speed; trainlisttest.list[code].speeds = data.body[i].speed;
trainlisttest.list[code].speeds = parseFloat(data.body[i].speed*10/36/23/trainlisttest.list[code].len); trainlisttest.list[code].speeds = parseFloat(data.body[i].speed*10/36/24/trainlisttest.list[code].len);
} }
@ -414,45 +414,45 @@ export function Jl3dDriving(updatemmi,sound) {
updatemmi.updatenowlen(0); updatemmi.updatenowlen(0);
} }
} }
if (data.body[i].directionType == '02') { // 向右 if (data.body[i].directionType == '02') { // 向右
if (trainlisttest.list[code].status != data.body[i].directionType) { if (trainlisttest.list[code].status != data.body[i].directionType) {
trainlisttest.list[code].progress = 0; trainlisttest.list[code].progress = 0;
const rotaposx = trainlisttest.list[code].children[5].matrixWorld.elements[12]; const rotaposx = trainlisttest.list[code].children[5].matrixWorld.elements[12];
const rotaposz = trainlisttest.list[code].children[0].matrixWorld.elements[14]; const rotaposz = trainlisttest.list[code].children[0].matrixWorld.elements[14];
trainlisttest.list[code].rotation.y = 0; trainlisttest.list[code].rotation.y = 0;
trainlisttest.list[code].position.x = rotaposx; trainlisttest.list[code].position.x = rotaposx;
for (let tl=0; tl<6; tl++) { for (let tl=0; tl<6; tl++) {
trainlisttest.list[code].children[tl].position.z = rotaposz; trainlisttest.list[code].children[tl].position.z = rotaposz;
}
trainlisttest.list[code].progress = (rotaposx-rails.linkrail[data.body[i].linkCode].lp.x)/rails.linkrail[data.body[i].linkCode].lengthfact;
trainlisttest.list[code].status = '02';
trainlisttest.list[code].curve = rails.linkrail[data.body[i].linkCode].lineleft;
trainlisttest.list[code].nextcurve = null;
}
trainlisttest.list[code].len = rails.linkrail[data.body[i].linkCode].lengthfact;
} else if (data.body[i].directionType == '03') { // 向左
if (trainlisttest.list[code].status != data.body[i].directionType) {
trainlisttest.list[code].progress = 0;
const rotaposx = trainlisttest.list[code].children[5].matrixWorld.elements[12];
const rotaposz = Math.abs(trainlisttest.list[code].children[0].matrixWorld.elements[14]);
trainlisttest.list[code].rotation.y = Math.PI;
trainlisttest.list[code].position.x = rotaposx;
for (let tl=0; tl<6; tl++) {
trainlisttest.list[code].children[tl].position.z = -rotaposz;
}
trainlisttest.list[code].progress = 1-(rotaposx-rails.linkrail[data.body[i].linkCode].lp.x)/rails.linkrail[data.body[i].linkCode].lengthfact;
trainlisttest.list[code].status = '03';
trainlisttest.list[code].curve = rails.linkrail[data.body[i].linkCode].lineright;
trainlisttest.list[code].nextcurve = null;
} }
trainlisttest.list[code].len = rails.linkrail[data.body[i].linkCode].lengthfact; trainlisttest.list[code].progress = (rotaposx-rails.linkrail[data.body[i].linkCode].lp.x)/rails.linkrail[data.body[i].linkCode].lengthfact;
trainlisttest.list[code].status = '02';
trainlisttest.list[code].curve = rails.linkrail[data.body[i].linkCode].lineleft;
trainlisttest.list[code].nextcurve = null;
} }
trainlisttest.list[code].len = rails.linkrail[data.body[i].linkCode].lengthfact;
} else if (data.body[i].directionType == '03') { // 向左
if (trainlisttest.list[code].status != data.body[i].directionType) {
trainlisttest.list[code].progress = 0;
const rotaposx = trainlisttest.list[code].children[5].matrixWorld.elements[12];
const rotaposz = Math.abs(trainlisttest.list[code].children[0].matrixWorld.elements[14]);
trainlisttest.list[code].rotation.y = Math.PI;
trainlisttest.list[code].position.x = rotaposx;
for (let tl=0; tl<6; tl++) {
trainlisttest.list[code].children[tl].position.z = -rotaposz;
}
trainlisttest.list[code].progress = 1-(rotaposx-rails.linkrail[data.body[i].linkCode].lp.x)/rails.linkrail[data.body[i].linkCode].lengthfact;
trainlisttest.list[code].status = '03';
trainlisttest.list[code].curve = rails.linkrail[data.body[i].linkCode].lineright;
trainlisttest.list[code].nextcurve = null;
}
trainlisttest.list[code].len = rails.linkrail[data.body[i].linkCode].lengthfact;
}
// console.log(data.body[i].directionType); // console.log(data.body[i].directionType);
@ -468,9 +468,9 @@ export function Jl3dDriving(updatemmi,sound) {
// console.log(rails.linkrail[nextcode].lineleft.points); // console.log(rails.linkrail[nextcode].lineleft.points);
// console.log("***********************"); // console.log("***********************");
// console.log(rails.linkrail[nextcode].lineleft.points); // console.log(rails.linkrail[nextcode].lineleft.points);
let nextcode;
if(code == drivingcode){ if(code == drivingcode){
let nextcode;
if(data.body[i].directionType == '02'){ if(data.body[i].directionType == '02'){
trainlisttest.list[code].status = '02'; trainlisttest.list[code].status = '02';
@ -501,19 +501,29 @@ export function Jl3dDriving(updatemmi,sound) {
let nextcode; let nextcode;
if(data.body[i].directionType == '02'){ if(data.body[i].directionType == '02'){
if(rails.linkrail[data.body[i].linkCode].lineleft){ if(rails.linkrail[data.body[i].linkCode].lineleft){
nextcode = rails.linkrail[data.body[i].linkCode].rconnect;
trainlisttest.list[code].status = '02'; trainlisttest.list[code].status = '02';
if(nextcode){
trainlisttest.list[code].nextcurve = rails.linkrail[nextcode].lineleft;
trainlisttest.list[code].nextlen = rails.linkrail[nextcode].lengthfact;
}
trainlisttest.list[code].curve = rails.linkrail[data.body[i].linkCode].lineleft; trainlisttest.list[code].curve = rails.linkrail[data.body[i].linkCode].lineleft;
trainlisttest.list[code].len = rails.linkrail[data.body[i].linkCode].lengthfact; trainlisttest.list[code].len = rails.linkrail[data.body[i].linkCode].lengthfact;
trainlisttest.list[code].progress = data.body[i].linkOffsetPercent; trainlisttest.list[code].progress = data.body[i].linkOffsetPercent;
trainlisttest.list[code].speeds = parseFloat(trainlisttest.list[code].speed*10/36/23/trainlisttest.list[code].len); trainlisttest.list[code].speeds = parseFloat(trainlisttest.list[code].speed*10/36/24/trainlisttest.list[code].len);
} }
}else if(data.body[i].directionType == '03'){ }else if(data.body[i].directionType == '03'){
if(rails.linkrail[data.body[i].linkCode].lineright){ if(rails.linkrail[data.body[i].linkCode].lineright){
nextcode = rails.linkrail[data.body[i].linkCode].lconnect;
trainlisttest.list[code].status = '03'; trainlisttest.list[code].status = '03';
if(nextcode){
trainlisttest.list[code].nextcurve = rails.linkrail[nextcode].lineright;
trainlisttest.list[code].nextlen = rails.linkrail[nextcode].lengthfact;
}
trainlisttest.list[code].curve = rails.linkrail[data.body[i].linkCode].lineright; trainlisttest.list[code].curve = rails.linkrail[data.body[i].linkCode].lineright;
trainlisttest.list[code].len = rails.linkrail[data.body[i].linkCode].lengthfact; trainlisttest.list[code].len = rails.linkrail[data.body[i].linkCode].lengthfact;
trainlisttest.list[code].progress = 1-data.body[i].linkOffsetPercent; trainlisttest.list[code].progress = 1-data.body[i].linkOffsetPercent;
trainlisttest.list[code].speeds = parseFloat(trainlisttest.list[code].speed*10/36/23/trainlisttest.list[code].len); trainlisttest.list[code].speeds = parseFloat(trainlisttest.list[code].speed*10/36/24/trainlisttest.list[code].len);
} }
} }
trainlisttest.list[code].nextcode = nextcode; trainlisttest.list[code].nextcode = nextcode;

View File

@ -146,7 +146,7 @@ export function UpdateTrain(camera,traindata,control){
trainmodel.progress = 0; trainmodel.progress = 0;
trainmodel.len = trainmodel.nextlen; trainmodel.len = trainmodel.nextlen;
trainmodel.nowcode = trainmodel.nextcode; trainmodel.nowcode = trainmodel.nextcode;
trainmodel.speeds = parseFloat(trainmodel.speed*10/36/22/trainmodel.len); trainmodel.speeds = parseFloat(trainmodel.speed*10/36/24/trainmodel.len);
trainmodel.curve = trainmodel.nextcurve; trainmodel.curve = trainmodel.nextcurve;
trainmodel.nextcurve = null; trainmodel.nextcurve = null;
@ -296,7 +296,7 @@ export function UpdateTrain(camera,traindata,control){
// console.log(trainmodel.rotalist); // console.log(trainmodel.rotalist);
} }
console.log(trainmodel.nextcurve); // console.log(trainmodel.nextcurve);
if(trainmodel.progress > -(trainmodel.speeds)){ if(trainmodel.progress > -(trainmodel.speeds)){
trainmodel.progress += trainmodel.speeds; trainmodel.progress += trainmodel.speeds;
} }

View File

@ -1,5 +1,6 @@
<template> <template>
<div class="avatar-container" style="right: 80px;"> <div class="avatar-container">
<!-- style="right: 80px;" -->
<el-menu-item v-for="item in entryList" v-show="!item.hidden" :key="item.name" class="avatar-wrapper" index="" @click="item.handle"> <el-menu-item v-for="item in entryList" v-show="!item.hidden" :key="item.name" class="avatar-wrapper" index="" @click="item.handle">
<span style="color: white;">{{ $t(item.name) }}</span> <span style="color: white;">{{ $t(item.name) }}</span>
</el-menu-item> </el-menu-item>
@ -22,14 +23,19 @@ export default {
return { return {
entryList: [ entryList: [
{ {
name: 'global.quickEntry', // global.designPlatform
handle: this.quickEntry name: '城市轨道交通设计平台',
handle: this.goToDesign
}, },
{ {
name: 'global.scan', name: 'global.scan',
handle: this.qcodeEntry, handle: this.qcodeEntry,
hidden: process.env.NODE_ENV != 'development' hidden: process.env.NODE_ENV != 'development'
} },
{
name: 'global.quickEntry',
handle: this.quickEntry
},
], ],
stomp: null, stomp: null,
header: null header: null
@ -50,6 +56,12 @@ export default {
}, },
qcodeEntry() { qcodeEntry() {
this.$refs.qcode.doShow(); this.$refs.qcode.doShow();
},
goToDesign(){
let routeData = this.$router.resolve({
path: "/design",
});
window.open(routeData.href, '_blank');
} }
} }
}; };

View File

@ -84,8 +84,10 @@ export default {
.avatar-container { .avatar-container {
height: $height; height: $height;
display: inline-block; display: inline-block;
position: absolute; // position: absolute;
right: 35px; position: relative;
right: 0px;
// right: 35px;
.avatar-wrapper { .avatar-wrapper {
cursor: pointer; cursor: pointer;

View File

@ -1,14 +1,14 @@
<template> <template>
<el-menu <el-menu
class="navbar" class="navbar"
router :router="isRoute"
:default-active="activePath" :default-active="activePath"
mode="horizontal" mode="horizontal"
background-color="#545c64" background-color="#545c64"
text-color="#fff" text-color="#fff"
active-text-color="#ffd04b" active-text-color="#ffd04b"
> >
<system-title></system-title> <system-title />
<template v-for="(item,idx) in routers"> <template v-for="(item,idx) in routers">
<template v-if="!item.hidden&&item.children"> <template v-if="!item.hidden&&item.children">
<template v-if="hasOneScreenShowingChildren(item.children) &&!item.alwaysShow"> <template v-if="hasOneScreenShowingChildren(item.children) &&!item.alwaysShow">
@ -24,7 +24,7 @@
</template> </template>
<template v-else-if="hasOneShowingChildren(item.children) &&!item.alwaysShow"> <template v-else-if="hasOneShowingChildren(item.children) &&!item.alwaysShow">
<template :to="item.path+'/'+item.children[0].path"> <template :to="item.path+'/'+item.children[0].path">
<!-- --> <!-- -->
<el-menu-item :key="idx" :index="item.redirect ? item.redirect : (item.path+'/'+item.children[0].path)"> <el-menu-item :key="idx" :index="item.redirect ? item.redirect : (item.path+'/'+item.children[0].path)">
<span <span
v-if="item.children[0].meta&&item.children[0].meta.i18n" v-if="item.children[0].meta&&item.children[0].meta.i18n"
@ -68,8 +68,16 @@
</el-submenu> </el-submenu>
</template> </template>
</template> </template>
<quick-entry ref="quickEntry" v-if="isShow"/> <div class="rightGroup">
<user-logout ref="userLogout" /> <quick-entry v-if="isShow" ref="quickEntry" />
<!-- style="right: 80px;" -->
<div class="avatar-container" v-if="!isShow" @click="goToTraining">
<el-menu-item class="avatar-wrapper" index="">
<span style="color: white;">城市轨道交通实训平台</span>
</el-menu-item>
</div>
<user-logout ref="userLogout" />
</div>
</el-menu> </el-menu>
</template> </template>
@ -83,14 +91,15 @@ import { getSessionStorage } from '@/utils/auth';
export default { export default {
components: { components: {
UserLogout, UserLogout,
QuickEntry, QuickEntry,
SystemTitle SystemTitle
}, },
data() { data() {
return { return {
routes: [], routes: [],
isShow:false, isShow: false,
activePath:'', activePath: '',
isRoute: true
}; };
}, },
computed: { computed: {
@ -100,22 +109,21 @@ export default {
]) ])
}, },
mounted() { mounted() {
this.routes = this.$router.options.routes; this.routes = this.$router.options.routes;
if (getSessionStorage('design')) { if (getSessionStorage('design')) {
this.isShow=false; this.isShow=false;
} this.isRoute = true;
else{ } else {
this.isShow=true; this.isShow=true;
} this.isRoute = false;
if(this.$route.fullPath.indexOf('design/userlist')>=0){ }
this.activePath='/design/userlist/home'; if (this.$route.fullPath.indexOf('design/userlist')>=0) {
} this.activePath='/design/userlist/home';
else if(this.$route.fullPath.indexOf('design/lesson')>=0 || this.$route.fullPath.indexOf('design/script')>=0 || this.$route.fullPath.indexOf('design/runPlan')>=0){ } else if (this.$route.fullPath.indexOf('design/lesson')>=0 || this.$route.fullPath.indexOf('design/script')>=0 || this.$route.fullPath.indexOf('design/runPlan')>=0) {
this.activePath='/design/home'; this.activePath='/design/home';
} } else {
else{ this.activePath=this.$route.path;
this.activePath=this.$route.path; }
}
}, },
methods: { methods: {
toggleSideBar() { toggleSideBar() {
@ -125,7 +133,7 @@ export default {
const showingChildren = children.filter(item => { const showingChildren = children.filter(item => {
if (!item.hidden && !item.target) { return item; } if (!item.hidden && !item.target) { return item; }
}); });
if (showingChildren.length === 1) { if (showingChildren.length === 1) {
return true; return true;
} }
return false; return false;
@ -149,7 +157,13 @@ export default {
return true; return true;
} }
return false; return false;
} },
goToTraining(){
let routeData = this.$router.resolve({
path: "/",
});
window.open(routeData.href, '_blank');
}
} }
}; };
</script> </script>
@ -157,6 +171,12 @@ export default {
<style rel="stylesheet/scss" lang="scss" scoped> <style rel="stylesheet/scss" lang="scss" scoped>
$height: 61px; $height: 61px;
.rightGroup{
position: absolute;
right: 35px;
display: inline-block;
}
.navbar { .navbar {
height: $height; height: $height;
line-height: $height; line-height: $height;
@ -180,8 +200,10 @@ export default {
.avatar-container { .avatar-container {
height: $height; height: $height;
display: inline-block; display: inline-block;
position: absolute; position: relative;
right: 35px; margin-right:10px;
// position: absolute;
// right: 35px;
.avatar-wrapper { .avatar-wrapper {
cursor: pointer; cursor: pointer;

View File

@ -15,18 +15,7 @@ function hasPermission(roles, permissionRoles) {
return roles.some(role => permissionRoles.indexOf(role) >= 0); return roles.some(role => permissionRoles.indexOf(role) >= 0);
} }
const project = getSessionStorage('project'); const whiteList = ['/login', '/dp/login', '/en/login', '/design/login', '/design/en/login', '/login/xty']; // 不重定向白名单
// const whiteList = ['/login', '/login1', '/dp/login', '/dp/login1', '/design/login1']; // 不重定向白名单
//
// const loginPage = whiteList[0] + (('/'+project) || '');
//
// const loginScreenPage = isDev ? whiteList[3] : whiteList[2];
//
// const loginPlanPage = isDev ? whiteList[5] : whiteList[4];
// const loginDesignPage = isDev ? whiteList[4] : whiteList[4];
const whiteList = ['/login', '/dp/login', '/en/login', '/design/login', '/en/design/login', '/login/xty']; // 不重定向白名单
const loginPage = whiteList[0]; const loginPage = whiteList[0];

View File

@ -88,7 +88,6 @@ import PublishLesson from '@/views/publish/publishLesson/index';
import IbpEdit from '@/views/ibp/ibpDraft/ibpEdit/index'; import IbpEdit from '@/views/ibp/ibpDraft/ibpEdit/index';
import TrainingPlatform from '@/views/trainingPlatform/index'; import TrainingPlatform from '@/views/trainingPlatform/index';
import TrainingPlatformHome from '@/views/trainingPlatform/home';
import Commodity from '@/views/orderauthor/commodity/index'; import Commodity from '@/views/orderauthor/commodity/index';
import CommodityDraft from '@/views/orderauthor/commodity/draft'; import CommodityDraft from '@/views/orderauthor/commodity/draft';
@ -154,6 +153,14 @@ export const userPlan = '015'; // 计划系统
export const userDesign='016'; // 设计系统 export const userDesign='016'; // 设计系统
const isDev = process.env.NODE_ENV === 'development'; const isDev = process.env.NODE_ENV === 'development';
const design = getSessionStorage('design');
let redirectPath = '';
if (design === 'true') {
redirectPath = '/design/home';
} else {
redirectPath = '/trainingPlatform';
}
export const UrlConfig = { export const UrlConfig = {
display: '/display', display: '/display',
scriptDisplay: '/scriptDisplay', scriptDisplay: '/scriptDisplay',
@ -250,7 +257,6 @@ export const UrlConfig = {
}, },
trainingPlatform: { trainingPlatform: {
trainingPlatform: '/trainingPlatform', trainingPlatform: '/trainingPlatform',
trainingPlatformHome: '/trainingPlatform/home',
prodDetail: '/trainingPlatform/detail', prodDetail: '/trainingPlatform/detail',
teachDetail: '/trainingPlatform/teach', teachDetail: '/trainingPlatform/teach',
teachHome: '/trainingPlatform/teachHome', teachHome: '/trainingPlatform/teachHome',
@ -315,6 +321,11 @@ export const constantRoutes = [
component: Jlmap3dedit, component: Jlmap3dedit,
hidden: true hidden: true
}, },
{
path: '/',
redirect: redirectPath,
hidden: true
},
{ {
path: '/401', path: '/401',
component: Error401, component: Error401,
@ -608,19 +619,11 @@ export const asyncRouter = [
children: [ children: [
{ {
path: '', path: '',
redirect: '/trainingPlatform/home', redirect: '/trainingPlatform/permission/14',
component: TrainingPlatform, component: TrainingPlatform,
meta: { meta: {
}, },
children: [ children: [
{
path: 'home',
redirect: '/trainingPlatform/permission/14',
component: TrainingPlatformHome,
meta: {
},
hidden: true
},
{ {
path: 'detail/:subSystem', path: 'detail/:subSystem',
component: DemonstrationDetail, component: DemonstrationDetail,

View File

@ -89,7 +89,7 @@ function handle(state, data) {
state.tipOperateCount++; state.tipOperateCount++;
break; break;
case 'JointTraining_Device': case 'JointTraining_Device':
handleDeviceInfo(state, msg); state.realDeviceInfo++;
break; break;
case 'Simulation_Control_Pause': // 暂停中 case 'Simulation_Control_Pause': // 暂停中
store.dispatch('scriptRecord/updateSimulationPause', msg); store.dispatch('scriptRecord/updateSimulationPause', msg);
@ -185,11 +185,6 @@ function handleUserinfo(state, data) {
state.roleInfo = data; state.roleInfo = data;
} }
} }
function handleDeviceInfo(state, data) {
if (data) {
state.deviceInfo = data;
}
}
function handleMessageInfo(state, type, data) { function handleMessageInfo(state, type, data) {
const message = { const message = {
join: true, join: true,
@ -284,7 +279,7 @@ const socket = {
permissionOver: {}, // 权限结束 permissionOver: {}, // 权限结束
tipOperateCount: 0, // 任务结束提示消息 tipOperateCount: 0, // 任务结束提示消息
deviceInfo: [] // 真实设备信息 realDeviceInfo: 0 // 真实设备信息
}, },
getters: { getters: {

View File

@ -1,6 +1,6 @@
import { setSessionStorage, removeSessionStorage } from '@/utils/auth'; import { setSessionStorage, removeSessionStorage } from '@/utils/auth';
import { login, logout, getInfo } from '@/api/login'; import { login, logout, getInfo } from '@/api/login';
import { getToken, setToken, removeToken, removeScreenToken, setScreenToken, getScreenToken, setPlanToken, getDesignToken, setDesignToken, getPlanToken, removeDesignToken, removePlanToken, handleToken, handleRemoveToken } from '@/utils/auth'; import { getToken, setToken, removeToken, getDesignToken, setDesignToken, removeDesignToken, handleToken, handleRemoveToken } from '@/utils/auth';
import { getUserConfigInfo } from '@/api/management/user'; import { getUserConfigInfo } from '@/api/management/user';
import { LoginParams } from '@/utils/login'; import { LoginParams } from '@/utils/login';
import { creatSubscribe, perpetualTopic } from '@/utils/stomp'; import { creatSubscribe, perpetualTopic } from '@/utils/stomp';
@ -9,8 +9,6 @@ import Cookies from 'js-cookie';
const user = { const user = {
state: { state: {
token: getToken(), token: getToken(),
tokenScreen: getScreenToken(),
tokenPlan: getPlanToken(),
tokenDesign: getDesignToken(), tokenDesign: getDesignToken(),
name: '', name: '',
nickname: '', nickname: '',
@ -70,25 +68,7 @@ const user = {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
let params = null; let params = null;
let execFc = null; let execFc = null;
if (userInfo.type == 'dp') { if (userInfo.type == 'design') {
params = Object.assign({ account: username, password }, LoginParams.DaPing);
execFc = (token) => {
setScreenToken(token);
commit('SET_TOKENSCREEN', token);
const header = { group: '', 'X-Token': getScreenToken() };
creatSubscribe(perpetualTopic, header);
};
}
// else if (userInfo.type == 'plan') {
// params = Object.assign({ account: username, password }, LoginParams.LianJiHua);
// execFc = (token) => {
// setPlanToken(token);
// commit('SET_TOKENPLAN', token);
// const header = { group: '', 'X-Token': getPlanToken() };
// creatSubscribe(perpetualTopic, header);
// };
// }
else if (userInfo.type == 'design') {
params = Object.assign({ account: username, password }, LoginParams.Design); params = Object.assign({ account: username, password }, LoginParams.Design);
execFc = (token) => { execFc = (token) => {
setDesignToken(token); setDesignToken(token);
@ -175,18 +155,10 @@ const user = {
// 前端登出 // 前端登出
FedLogOut({ commit }, clientId) { FedLogOut({ commit }, clientId) {
return new Promise(resolve => { return new Promise(resolve => {
if (clientId == LoginParams.DaPing.clientId) { if (clientId == LoginParams.Design.clientId) {
commit('SET_TOKENSCREEN', '');
removeScreenToken();
} else if (clientId == LoginParams.Design.clientId) {
commit('SET_TOKENDESIGN', ''); commit('SET_TOKENDESIGN', '');
removeDesignToken(); removeDesignToken();
} } else {
// else if (clientId == LoginParams.LianJiHua.clientId) {
// commit('SET_TOKENPLAN', '');
// removePlanToken();
// }
else {
commit('SET_TOKEN', ''); commit('SET_TOKEN', '');
removeToken(); removeToken();
} }

View File

@ -2,11 +2,6 @@ import SessionStorage from 'sessionstorage';
import { LoginParams } from '@/utils/login'; import { LoginParams } from '@/utils/login';
const TokenKey = 'Admin-Token'; const TokenKey = 'Admin-Token';
const TokenScreenKey = 'Screen-Token';
const TokenPlanKey = 'Plan-Token';
const TokenDesignKey='Design-Token'; const TokenDesignKey='Design-Token';
// 设置教学实训仿真系统token // 设置教学实训仿真系统token
@ -19,16 +14,6 @@ export function setToken(token) {
export function removeToken() { export function removeToken() {
return SessionStorage.removeItem(TokenKey); return SessionStorage.removeItem(TokenKey);
} }
// 设置大屏token
export function getScreenToken() {
return SessionStorage.getItem(TokenScreenKey);
}
export function setScreenToken(token) {
return SessionStorage.setItem(TokenScreenKey, token);
}
export function removeScreenToken() {
return SessionStorage.removeItem(TokenScreenKey);
}
// 设置城市轨道交通设计平台token // 设置城市轨道交通设计平台token
export function getDesignToken() { export function getDesignToken() {
@ -41,16 +26,6 @@ export function removeDesignToken() {
return SessionStorage.removeItem(TokenDesignKey); return SessionStorage.removeItem(TokenDesignKey);
} }
// 设置琏计划token
export function getPlanToken() {
return SessionStorage.getItem(TokenPlanKey);
}
export function setPlanToken(token) {
return SessionStorage.setItem(TokenPlanKey, token);
}
export function removePlanToken() {
return SessionStorage.removeItem(TokenPlanKey);
}
// 操作sessionStorage // 操作sessionStorage
export function getSessionStorage(key) { export function getSessionStorage(key) {
return SessionStorage.getItem(key); return SessionStorage.getItem(key);

View File

@ -4,8 +4,8 @@ export function getBaseUrl() {
if (process.env.NODE_ENV === 'development') { if (process.env.NODE_ENV === 'development') {
// BASE_API = 'https://joylink.club/jlcloud'; // BASE_API = 'https://joylink.club/jlcloud';
// BASE_API = 'https://test.joylink.club/jlcloud'; // BASE_API = 'https://test.joylink.club/jlcloud';
BASE_API = 'http://192.168.3.5:9000'; // 袁琪 // BASE_API = 'http://192.168.3.5:9000'; // 袁琪
// BASE_API = 'http://192.168.3.6:9000'; // 旭强 BASE_API = 'http://192.168.3.6:9000'; // 旭强
// BASE_API = 'http://192.168.3.41:9000'; // 王兴杰 // BASE_API = 'http://192.168.3.41:9000'; // 王兴杰
} else { } else {
BASE_API = process.env.VUE_APP_BASE_API; BASE_API = process.env.VUE_APP_BASE_API;

View File

@ -1,214 +1,213 @@
<template> <template>
<div> <div>
<QueryListPage ref="queryListPage" :pager-config="pagerConfig" :query-form="queryForm" :query-list="queryList"></QueryListPage> <QueryListPage ref="queryListPage" :pager-config="pagerConfig" :query-form="queryForm" :query-list="queryList" />
<el-dialog :title="this.$t('approval.explanation')" :visible.sync="dialogFormVisible" v-dialogDrag> <el-dialog v-dialogDrag :title="this.$t('approval.explanation')" :visible.sync="dialogFormVisible">
<!--<el-input type="textarea" <data-form ref="dataform" :form="form" :form-model="formModel" :rules="rules" />
:rows="2" <div slot="footer" class="dialog-footer">
:placeholder="this.$t('rules.enterRejectReason')" <el-button @click="rejectCancel">{{ $t('global.cancel') }}</el-button>
@focus="inputFocus" <el-button type="primary" @click="rejectConfirm">{{ $t('global.confirm') }}</el-button>
@blur="inputBlur" </div>
v-model="textarea"></el-input> </el-dialog>
<span v-show="needReason" style="color: red">{{'*'+$t('rules.enterRejectReason')}}</span>--> <lesson-detail ref="lessonDetail" />
<data-form ref="dataform" :form="form" :form-model="formModel" :rules="rules" /> </div>
<div slot="footer" class="dialog-footer">
<el-button @click="rejectCancel">{{$t('global.cancel')}}</el-button>
<el-button type="primary" @click="rejectConfirm">{{$t('global.confirm')}}</el-button>
</div>
</el-dialog>
<lesson-detail ref="lessonDetail"></lesson-detail>
</div>
</template> </template>
<script> <script>
import {adminPublishLesson,rejectedLessonRelease,reviewLessonList} from '@/api/designPlatform'; import {adminPublishLesson, rejectedLessonRelease, reviewLessonList} from '@/api/designPlatform';
import { listPublishMap } from '@/api/jmap/map'; import { listPublishMap } from '@/api/jmap/map';
import LessonDetail from './detail'; import LessonDetail from './detail';
export default { export default {
name: 'LessonApproval', name: 'LessonApproval',
components: { components: {
LessonDetail LessonDetail
}, },
data() { data() {
return{ return {
dialogFormVisible: false, dialogFormVisible: false,
rejectId: '', rejectId: '',
formModel: { formModel: {
explanation: '' explanation: ''
}, },
mapList: [], mapList: [],
pagerConfig: { pagerConfig: {
pageSize: 'pageSize', pageSize: 'pageSize',
pageIndex: 'pageNum' pageIndex: 'pageNum'
}, },
queryForm: { queryForm: {
labelWidth: '120px', labelWidth: '120px',
reset: true, reset: true,
queryObject: { queryObject: {
mapId: { mapId: {
type: 'select', type: 'select',
label: this.$t('approval.map')+this.$t('global.colon'), label: this.$t('approval.map')+this.$t('global.colon'),
config: { config: {
data: [] data: []
} }
}, },
lessonName: { lessonName: {
type: 'text', type: 'text',
label: this.$t('lesson.courseName') label: this.$t('lesson.courseName')
}, },
userName: { userName: {
type: 'text', type: 'text',
label: this.$t('approval.applicant')+this.$t('global.colon'), label: this.$t('approval.applicant')+this.$t('global.colon')
} }
} }
}, },
queryList: { queryList: {
query: reviewLessonList, query: reviewLessonList,
selectCheckShow: false, selectCheckShow: false,
indexShow: true, indexShow: true,
columns: [ columns: [
{ {
title: this.$t('lesson.courseName'), title: this.$t('lesson.courseName'),
prop: 'name' prop: 'name'
}, },
{ {
title: this.$t('approval.map'), title: this.$t('approval.map'),
prop: 'mapId ', prop: 'mapId ',
type: 'tag', type: 'tag',
columnValue: (row) => { return this.$convertField(row.mapId , this.mapList, ['value', 'label']); }, columnValue: (row) => { return this.$convertField(row.mapId, this.mapList, ['value', 'label']); },
tagType: (row) => { return ''; } tagType: (row) => { return ''; }
}, },
{ {
title: this.$t('approval.courseDescription'), title: this.$t('approval.courseDescription'),
prop: 'remarks' prop: 'remarks'
}, },
{ {
title: this.$t('approval.applicant'), title: this.$t('approval.applicant'),
prop: 'userName' prop: 'userName'
}, },
{ {
title: this.$t('approval.applyTime'), title: this.$t('approval.applyTime'),
prop: 'uploadTime', prop: 'uploadTime',
type: 'tag', type: 'tag',
columnValue: (row) => { return this.handleTime(row.uploadTime)}, columnValue: (row) => { return this.handleTime(row.uploadTime); },
tagType: (row) => { return ''; } tagType: (row) => { return ''; }
}, },
{ {
type: 'button', type: 'button',
title: this.$t('global.operate'), title: this.$t('global.operate'),
width: '250', width: '400',
buttons: [ buttons: [
{ {
name: this.$t('approval.lookOver'), name: this.$t('approval.lookOver'),
handleClick: this.goDetail, handleClick: this.goDetail,
type: '' type: ''
}, },
{ {
name: this.$t('approval.applyPassed'), name: this.$t('approval.applyPassed'),
handleClick: this.pass, handleClick: this.pass,
type: '' type: ''
}, },
{ {
name: this.$t('approval.applyReject'), name: this.$t('approval.applyReject'),
handleClick: this.noPass, handleClick: this.noPass,
type: '' type: ''
} }
] ]
} }
] ]
}, },
form :{ form: {
labelWidth: '150px', labelWidth: '150px',
items: [ items: [
{ prop: 'explanation', label: this.$t('approval.explanation'), type: 'textarea', required: true}, { prop: 'explanation', label: this.$t('approval.explanation'), type: 'textarea', required: true}
] ]
}, },
rules :{ rules: {
explanation: [ explanation: [
{ required: true, message: this.$t('rules.enterRejectReason'), trigger: 'blur' } { required: true, message: this.$t('rules.enterRejectReason'), trigger: 'blur' }
] ]
} }
} };
}, },
created(){ watch: {
listPublishMap().then(response=>{
response.data.forEach(elem => {
this.mapList.push({ value: elem.id, label: elem.name });
});
this.queryForm.queryObject.mapId.config.data = this.mapList;
});
},
mounted(){
}, },
beforeDestroy(){ created() {
listPublishMap().then(response=>{
response.data.forEach(elem => {
this.mapList.push({ value: elem.id, label: elem.name });
});
this.queryForm.queryObject.mapId.config.data = this.mapList;
});
},
mounted() {
}, },
watch: { beforeDestroy() {
}, },
methods: { methods: {
goDetail(index,row) { goDetail(index, row) {
this.$refs.lessonDetail.show(row.id); this.$refs.lessonDetail.show(row.id);
}, },
pass(index,row) { pass(index, row) {
this.$confirm(this.$t('tip.publishTheCourseHint'), this.$t('global.tips'), { this.$confirm(this.$t('tip.publishTheCourseHint'), this.$t('global.tips'), {
confirmButtonText: this.$t('global.confirm'), confirmButtonText: this.$t('global.confirm'),
cancelButtonText: this.$t('global.cancel'), cancelButtonText: this.$t('global.cancel'),
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
const params = { const params = {
cityCode: row.cityCode, cityCode: row.cityCode,
mapId: row.mapId, mapId: row.mapId,
name: row.name, name: row.name,
prdCode: row.prdCode prdCode: row.prdCode
}; };
adminPublishLesson(params,row.id).then(response => { adminPublishLesson(params, row.id).then(response => {
this.loading = false; this.loading = false;
this.$message.success(this.$t('tip.coursePublishSuccessful')); this.$message.success(this.$t('tip.coursePublishSuccessful'));
this.doClose(); this.doClose();
}).catch(error => { }).catch(() => {
this.loading = false; this.loading = false;
this.$messageBox(this.$t('tip.coursePublishFailed')); this.$messageBox(this.$t('tip.coursePublishFailed'));
}) });
}); });
}, },
noPass(index,row) { noPass(index, row) {
this.dialogFormVisible = true; this.dialogFormVisible = true;
this.rejectId = row.id; this.rejectId = row.id;
}, },
handleTime(time) { handleTime(time) {
let timeList = time.split("T"); const timeList = time.split('T');
return timeList[0] + ' ' +timeList[1]; return timeList[0] + ' ' +timeList[1];
}, },
doClose() { doClose() {
this.$refs.queryListPage.refresh(true); this.$refs.queryListPage.refresh(true);
}, },
rejectConfirm() { rejectConfirm() {
this.$refs.dataform.validateForm(() => { this.$refs.dataform.validateForm(() => {
if (this.rejectId){ if (this.rejectId) {
rejectedLessonRelease(this.formModel,this.rejectId).then(resp =>{ rejectedLessonRelease(this.formModel, this.rejectId).then(resp =>{
this.loading = false; this.loading = false;
this.$message.success(this.$t('tip.rejectedCourseReleaseApplicationSuccessful')); this.$message.success(this.$t('tip.rejectedCourseReleaseApplicationSuccessful'));
this.dialogFormVisible = false; this.dialogFormVisible = false;
this.rejectId = ''; this.rejectId = '';
this.doClose(); this.doClose();
}).catch(error => { }).catch(() => {
this.loading = false; this.loading = false;
this.$messageBox(this.$t('tip.rejectedCourseReleaseApplicationSuccessful')); this.$messageBox(this.$t('tip.rejectedCourseReleaseApplicationSuccessful'));
this.dialogFormVisible = false; this.dialogFormVisible = false;
this.rejectId = ''; this.rejectId = '';
this.doClose(); this.doClose();
}) });
} }
}); });
}, },
rejectCancel() { rejectCancel() {
this.dialogFormVisible = false; this.dialogFormVisible = false;
this.rejectId = ''; this.rejectId = '';
this.textarea = ''; this.textarea = '';
} }
} }
} };
</script> </script>
<style lang="scss" scoped>
/deep/
.el-row .el-button+.el-button{
margin-top: 10px;
}
</style>

View File

@ -10,7 +10,9 @@
<script> <script>
import RunPlanOperate from './operate'; import RunPlanOperate from './operate';
import { reviewRunPlanList,publishRunPlan,rejectRunPlan,previewRunPlan } from '@/api/designPlatform'; import { reviewRunPlanList,publishRunPlan,rejectRunPlan,previewRunPlan } from '@/api/designPlatform';
import { listPublishMap } from '@/api/jmap/map'; // import { listPublishMap } from '@/api/jmap/map';
import { getSkinCodeList } from '@/api/management/mapskin';
import { launchFullscreen } from '@/utils/screen'; import { launchFullscreen } from '@/utils/screen';
import { UrlConfig } from '@/router/index'; import { UrlConfig } from '@/router/index';
export default { export default {
@ -24,22 +26,23 @@
pageSize: 'pageSize', pageSize: 'pageSize',
pageIndex: 'pageNum' pageIndex: 'pageNum'
}, },
skinList:[],
queryForm: { queryForm: {
labelWidth: '100px', labelWidth: '150px',
reset: true, reset: true,
queryObject: { queryObject: {
mapId: { mapId: {
type: 'select', type: 'select',
label: this.$t('approval.map'), label: this.$t('approval.skin'),
config: { config: {
data: [] data: []
} }
}, },
'scriptName':{ 'name':{
type: 'text', type: 'text',
label: this.$t('approval.runPlanName') label: this.$t('approval.runPlanName')
}, },
'userName': { 'creatorName': {
type: 'text', type: 'text',
label: this.$t('approval.applicant') label: this.$t('approval.applicant')
} }
@ -57,16 +60,16 @@
prop: 'name' prop: 'name'
}, },
{ {
title: this.$t('approval.map'), title: this.$t('approval.skin'),
prop: 'mapId ', prop: 'mapId ',
width:250, width:250,
type: 'tag', type: 'tag',
columnValue: (row) => { return this.$convertField(row.mapId , this.mapList, ['value', 'label']); }, columnValue: (row) => { return this.$convertField(row.skinCode , this.skinList, ['value', 'label']); },
tagType: (row) => { return ''; } tagType: (row) => { return ''; }
}, },
{ {
title: this.$t('approval.applicant'), title: this.$t('approval.applicant'),
prop: 'userName' prop: 'creatorName'
}, },
{ {
title: this.$t('approval.applyTime'), title: this.$t('approval.applyTime'),
@ -124,11 +127,11 @@
async loadInitData() { async loadInitData() {
try { try {
// //
this.mapList = []; this.skinList = [];
const res = await listPublishMap(); const res = await getSkinCodeList();
res.data.forEach(elem => { res.data.forEach(elem => {
this.queryForm.queryObject.mapId.config.data.push({ value: elem.id, label: elem.name }); this.queryForm.queryObject.mapId.config.data.push({ value: elem.code, label: elem.name });
this.mapList.push({ value: elem.id, label: elem.name }); this.skinList.push({ value: elem.code, label: elem.name });
}); });
} catch (error) { } catch (error) {
console.error(error, '获取发布地图'); console.error(error, '获取发布地图');

View File

@ -1,8 +1,6 @@
<template> <template>
<div> <div>
<QueryListPage ref="queryListPage" :pager-config="pagerConfig" :query-form="queryForm" :query-list="queryList" /> <QueryListPage ref="queryListPage" :pager-config="pagerConfig" :query-form="queryForm" :query-list="queryList" />
<!-- <script-operate ref='applyPassed' @reloadTable="reloadTable" @create="handleConfirmPass" :title="$t('approval.passedScript')" type="applyPassed">
</script-operate> -->
<script-operate ref='applyReject' @reloadTable="reloadTable" @create="handleConfirmReject" :title="$t('approval.rejectScript')"> <script-operate ref='applyReject' @reloadTable="reloadTable" @create="handleConfirmReject" :title="$t('approval.rejectScript')">
</script-operate> </script-operate>
</div> </div>
@ -37,7 +35,7 @@
data: [] data: []
} }
}, },
'scriptName':{ 'name':{
type: 'text', type: 'text',
label: this.$t('approval.scriptName') label: this.$t('approval.scriptName')
}, },
@ -168,6 +166,20 @@
this.$messageBox(`${this.$t('approval.rejectScriptFailed')}: ${error.message}`); this.$messageBox(`${this.$t('approval.rejectScriptFailed')}: ${error.message}`);
}) })
}, },
handleConfirmPass(data){
publishScript(data.id).then(resp => {
this.reloadTable();
this.$message.success(this.$t('approval.passedScriptSuccess'));
}).catch(error => {
this.$messageBox(`${this.$t('approval.passedScriptFailed')}: ${error.message}`);
})
},
} }
} }
</script> </script>
<style lang="scss" scoped>
/deep/
.el-row .el-button+.el-button{
margin-top: 10px;
}
</style>

View File

@ -20,7 +20,8 @@
<span <span
class="el-icon-tickets" class="el-icon-tickets"
:style="{color: data.valid ? 'green':''}" :style="{color: data.valid ? 'green':''}"
>&nbsp;{{ tnode.label }}</span> ></span>
<span>&nbsp;{{ tnode.label }}</span>
</span> </span>
</el-tree> </el-tree>
</el-scrollbar> </el-scrollbar>

View File

@ -17,7 +17,8 @@
<span <span
class="el-icon-tickets" class="el-icon-tickets"
:style="{color: data.valid ? 'green':''}" :style="{color: data.valid ? 'green':''}"
>&nbsp;{{ tnode.label }}</span> ></span>
<span>&nbsp;{{ tnode.label }}</span>
</span> </span>
</el-tree> </el-tree>
</el-scrollbar> </el-scrollbar>

View File

@ -1,29 +1,29 @@
<template> <template>
<el-card> <el-card>
<div slot="header" style="text-align: center;"> <div slot="header" style="text-align: center;">
<span class="title">{{this.$t('exam.trainingName')}} {{ courseModel.name }}</span> <span class="title">{{ this.$t('exam.trainingName') }} {{ courseModel.name }}</span>
</div> </div>
<div style="margin:50px" :style="{ height: height - 150 +'px' }"> <div style="margin:50px" :style="{ height: height - 150 +'px' }">
<p class="time-item"> <p class="time-item">
<span class="time-label">{{this.$t('exam.examinationTiming')}}</span> <span class="time-label">{{ this.$t('exam.examinationTiming') }}</span>
<span class="time-elem">{{ formatExamUsedTime }}</span> <span class="time-elem">{{ formatExamUsedTime }}</span>
</p> </p>
<p class="list-item"> <p class="list-item">
<span class="list-label">{{this.$t('exam.maximumTimeToCompleteThisQuestion')}}</span> <span class="list-label">{{ this.$t('exam.maximumTimeToCompleteThisQuestion') }}</span>
<span class="list-elem">{{ courseModel.maxDuration | setTime }}{{this.$t('global.second')}} </span> <span class="list-elem">{{ courseModel.maxDuration | setTime }}{{ this.$t('global.second') }} </span>
</p> </p>
<p class="list-item"> <p class="list-item">
<span class="list-label">{{this.$t('exam.theBestTimeToCompleteTheQuestion')}}</span> <span class="list-label">{{ this.$t('exam.theBestTimeToCompleteTheQuestion') }}</span>
<span class="list-elem">{{ courseModel.minDuration | setTime }}{{this.$t('global.second')}}</span> <span class="list-elem">{{ courseModel.minDuration | setTime }}{{ this.$t('global.second') }}</span>
</p> </p>
<p class="list-item"> <p class="list-item">
<span class="list-label"> {{this.$t('exam.trainingNotes')}}</span> <span class="list-label"> {{ this.$t('exam.trainingNotes') }}</span>
<span class="list-elem">{{ courseModel.remarks }}</span> <span class="list-elem">{{ courseModel.remarks }}</span>
</p> </p>
<p> <p>
<span class="list-label" /> <span class="list-label" />
<el-button :loading="loading" type="primary" @click="start">{{this.$t('exam.startTheExam')}}</el-button> <el-button :loading="loading" type="primary" @click="start">{{ this.$t('exam.startTheExam') }}</el-button>
<el-button :loading="loading" type="danger" @click="back">{{this.$t('exam.giveUpTheExam')}}</el-button> <el-button :loading="loading" type="danger" @click="back">{{ this.$t('exam.giveUpTheExam') }}</el-button>
</p> </p>
</div> </div>
</el-card> </el-card>
@ -105,7 +105,7 @@ export default {
}).then(() => { }).then(() => {
// //
setExamGive(this.$route.query.userExamId).then(() => { setExamGive(this.$route.query.userExamId).then(() => {
this.$router.back(); this.$router.back();
}); });
}).catch(() => { }).catch(() => {
this.loading = false; this.loading = false;

View File

@ -2,7 +2,7 @@
<div style="height: 100%; padding-bottom: 20px"> <div style="height: 100%; padding-bottom: 20px">
<el-card> <el-card>
<div slot="header" style="text-align: center;"> <div slot="header" style="text-align: center;">
<b>考试系统</b> <b>{{ $t('global.examSystem') }}</b>
</div> </div>
</el-card> </el-card>
<el-card v-loading="loading"> <el-card v-loading="loading">
@ -13,19 +13,19 @@
> >
<el-table-column <el-table-column
prop="name" prop="name"
label="课程" :label="this.$t('exam.courseName')"
/> />
<el-table-column <el-table-column
prop="remarks" prop="remarks"
show-overflow-tooltip show-overflow-tooltip
label="说明" :label="this.$t('exam.courseDescription')"
/> />
<el-table-column <el-table-column
label="操作" :label="this.$t('global.operate')"
> >
<template slot-scope="scope"> <template slot-scope="scope">
<el-button size="mini" type="primary" @click="goLesson(scope.row)"> <el-button size="mini" type="primary" @click="goLesson(scope.row)">
进入考试 {{ $t('exam.enterTheExam') }}
</el-button> </el-button>
</template> </template>
</el-table-column> </el-table-column>
@ -63,7 +63,7 @@ export default {
this.tableData = resp.data.lessonList; this.tableData = resp.data.lessonList;
} }
}).catch(()=>{ }).catch(()=>{
this.$messageBox('获取考试信息失败!'); this.$messageBox(this.$t('error.obtainCourseInformationFailed'));
}); });
} }
}, },

View File

@ -5,22 +5,25 @@
</div> </div>
<div style="display: flex;align-items:flex-start"> <div style="display: flex;align-items:flex-start">
<div class="tree_box"> <div class="tree_box">
<el-scrollbar wrap-class="scrollbar-wrapper" :style="{ height: (height-50) +'px' }"> <div style="border: 2px dashed #B0C4DE">
<el-tree <p>{{ this.$t('lesson.courseTree') }}</p>
ref="tree" <el-scrollbar wrap-class="scrollbar-wrapper" :style="{ height: (height-80) +'px' }">
style="width: 380px" <el-tree
:data="treeList" ref="tree"
node-key="id" style="width: 370px"
:props="defaultProps" :data="treeList"
default-expand-all node-key="id"
highlight-current :props="defaultProps"
:span="22" default-expand-all
:filter-node-method="filterNode" highlight-current
:default-expanded-keys="expandList" :span="22"
@node-contextmenu="showContextMenu" :filter-node-method="filterNode"
@node-click="clickEvent" :default-expanded-keys="expandList"
/> @node-contextmenu="showContextMenu"
</el-scrollbar> @node-click="clickEvent"
/>
</el-scrollbar>
</div>
</div> </div>
<transition> <transition>
<router-view @refresh="refresh" /> <router-view @refresh="refresh" />
@ -136,7 +139,8 @@ export default {
position: relative; position: relative;
left: 10px; left: 10px;
width: 400px; width: 400px;
padding-right: 10px; padding-right: 20px;
padding-top: 20px;
} }
.right_box{ .right_box{
} }

View File

@ -2,93 +2,14 @@
<div style="height: 100%; overflow: hidden"> <div style="height: 100%; overflow: hidden">
<el-card> <el-card>
<div class="button_group"> <div class="button_group">
<el-button v-if="hasRelease" size="mini" @click="operationManage">{{ $t('lesson.trainingRule') }}</el-button>
<el-button v-if="hasRelease" size="mini" @click="trainingManage">{{ $t('lesson.trainingManage') }}</el-button> <el-button v-if="hasRelease" size="mini" @click="trainingManage">{{ $t('lesson.trainingManage') }}</el-button>
<el-button v-if="hasRelease" size="mini" @click="taskManage">{{ $t('lesson.taskManage') }}</el-button> <el-button v-if="hasRelease" size="mini" @click="taskManage">{{ $t('lesson.taskManage') }}</el-button>
<el-button v-if="hasRelease" size="mini" @click="operationManage">{{ $t('lesson.trainingRule') }}</el-button>
<el-button size="mini" type="primary" @click="lessonCreateByPublish">{{ $t('lesson.createNewCoursesFromRelease') }}</el-button> <el-button size="mini" type="primary" @click="lessonCreateByPublish">{{ $t('lesson.createNewCoursesFromRelease') }}</el-button>
<el-button size="mini" type="primary" @click="lessonCreate">{{ $t('lesson.newConstruction') }}</el-button> <el-button size="mini" type="primary" @click="lessonCreate">{{ $t('lesson.newConstruction') }}</el-button>
</div> </div>
</el-card> </el-card>
<el-card v-loading="loading"> <el-card v-loading="loading">
<!--<el-table-->
<!--:data="tableData"-->
<!--row-key="id"-->
<!--border-->
<!--default-expand-all-->
<!--:tree-props="{children: 'children', hasChildren: 'hasChildren'}"-->
<!--&gt;-->
<!--<el-table-column-->
<!--prop="name"-->
<!--border-->
<!--:label="this.$t('lesson.lesson')"-->
<!--/>-->
<!--<el-table-column-->
<!--:label="this.$t('global.status')"-->
<!--&gt;-->
<!--<template slot-scope="scope">-->
<!--<span>{{ handlerStatus(scope.row) }}</span>-->
<!--</template>-->
<!--</el-table-column>-->
<!--<el-table-column-->
<!--prop="explanation"-->
<!--show-overflow-tooltip-->
<!--:label="this.$t('lesson.rejectReason')"-->
<!--/>-->
<!--<el-table-column-->
<!--width="500"-->
<!--:label="this.$t('global.operate')"-->
<!--&gt;-->
<!--<template slot-scope="scope">-->
<!--<el-button-->
<!--v-if="scope.row.status!=='1'"-->
<!--size="mini"-->
<!--type="primary"-->
<!--@click="createChapter(scope.row)"-->
<!--&gt;{{ scope.row.type==='lesson'? $t('lesson.createChapter'):$t('lesson.updateChapter') }}</el-button>-->
<!--<el-button-->
<!--v-if="scope.row.status==='1'"-->
<!--size="mini"-->
<!--type="primary"-->
<!--@click="goDetail(scope.row)"-->
<!--&gt;-->
<!--{{ $t('lesson.review') }}-->
<!--</el-button>-->
<!--<el-button-->
<!--v-if="scope.row.type === 'lesson' && scope.row.status!=='1'"-->
<!--size="mini"-->
<!--type="primary"-->
<!--plain-->
<!--@click="treeSort(scope.row)"-->
<!--&gt;{{ $t('lesson.contentSorting') }}</el-button>-->
<!--<el-button-->
<!--v-if="scope.row.type === 'lesson'&& scope.row.status!=='1'"-->
<!--size="mini"-->
<!--type="info"-->
<!--@click="editLesson(scope.row)"-->
<!--&gt;{{ $t('lesson.editCourse') }}</el-button>-->
<!--<el-button-->
<!--v-if="scope.row.type === 'lesson'&& scope.row.status==='0'"-->
<!--size="mini"-->
<!--type="primary"-->
<!--@click="publish(scope.row)"-->
<!--&gt;{{ hasRelease?$t('global.release'):$t('lesson.applicationForRelease') }}</el-button>-->
<!--<el-button-->
<!--v-if="scope.row.type === 'lesson'&& scope.row.status!=='1'"-->
<!--size="mini"-->
<!--type="danger"-->
<!--@click="deleteLesson(scope.row)"-->
<!--&gt;{{ $t('global.delete') }}</el-button>-->
<!--<el-button-->
<!--v-if="scope.row.status ==='1'"-->
<!--size="mini"-->
<!--type="danger"-->
<!--@click="revertLesson(scope.row)"-->
<!--&gt;-->
<!--{{ $t('lesson.withdraw') }}-->
<!--</el-button>-->
<!--</template>-->
<!--</el-table-column>-->
<!--</el-table>-->
<QueryListPage ref="queryListPage" :query-form="queryForm" :pager-config="pagerConfig" :query-list="queryList" /> <QueryListPage ref="queryListPage" :query-form="queryForm" :pager-config="pagerConfig" :query-list="queryList" />
</el-card> </el-card>
<publish-create ref="publishCreate" @refresh="refresh" /> <publish-create ref="publishCreate" @refresh="refresh" />
@ -132,15 +53,15 @@ export default {
indexShow: true, indexShow: true,
columns: [ columns: [
{ {
title: '课程名称', title: this.$t('lesson.courseName'),
prop: 'name' prop: 'name'
}, },
{ {
title: '课程说明', title: this.$t('lesson.courseDescription'),
prop: 'remarks' prop: 'remarks'
}, },
{ {
title: '状态', title: this.$t('global.status'),
prop: 'status', prop: 'status',
type: 'tag', type: 'tag',
columnValue: (row) => { columnValue: (row) => {
@ -149,7 +70,7 @@ export default {
tagType: (row) => { return 'success'; } tagType: (row) => { return 'success'; }
}, },
{ {
title: '驳回说明', title: this.$t('lesson.explanation'),
prop: 'explanation' prop: 'explanation'
}, },
{ {
@ -157,6 +78,14 @@ export default {
title: this.$t('global.operate'), title: this.$t('global.operate'),
width: '400', width: '400',
buttons: [ buttons: [
{
name: this.$t('lesson.courseDetails'),
handleClick: this.goDetail,
type: 'primary',
showControl: (row) => {
return row.status !=='1';
}
},
{ {
name: this.$t('lesson.contentSorting'), name: this.$t('lesson.contentSorting'),
handleClick: this.treeSort, handleClick: this.treeSort,
@ -204,20 +133,9 @@ export default {
showControl: (row) => { showControl: (row) => {
return row.status ==='1'; return row.status ==='1';
} }
},
{
name: '课程详情',
handleClick: this.goDetail,
type: 'primary',
showControl: (row) => {
return row.status !=='1';
}
} }
] ]
} }
],
actions: [
/* { text: this.$t('global.create'), btnCode: 'employee_insert', handler: this.handleCreateRunPlan }*/
] ]
} }
@ -292,7 +210,7 @@ export default {
this.$refs.queryListPage.refresh(true); this.$refs.queryListPage.refresh(true);
}, },
lessonCreate() { lessonCreate() {
this.$router.push({ path: `${UrlConfig.design.lessonEdit}/lessonCreate`, query: {skinCode: this.$route.params.skinCode} }); this.$router.push({ path: `${UrlConfig.design.lessonEdit}/lessonCreate`, query: {skinCode: this.$route.params.skinCode, mapId: this.$route.params.mapId, cityCode: this.$route.query.cityCode} });
}, },
lessonCreateByPublish() { lessonCreateByPublish() {
this.$nextTick(() => { this.$nextTick(() => {
@ -309,6 +227,7 @@ export default {
this.$message.success(this.$t('tip.successfullyDelete')); this.$message.success(this.$t('tip.successfullyDelete'));
this.loading = true; this.loading = true;
this.refresh(); this.refresh();
this.loading = false;
}).catch(() => { }).catch(() => {
this.$messageBox(this.$t('tip.failDelete')); this.$messageBox(this.$t('tip.failDelete'));
}); });

View File

@ -7,7 +7,7 @@
<el-card class="forms"> <el-card class="forms">
<el-scrollbar wrap-class="scrollbar-wrapper" :style="{height:height -160 + 'px'}" style="padding-top: 40px"> <el-scrollbar wrap-class="scrollbar-wrapper" :style="{height:height -160 + 'px'}" style="padding-top: 40px">
<el-form ref="form" :model="chapterModel" :rules="rules" label-width="135px"> <el-form ref="form" :model="chapterModel" :rules="rules" label-width="135px">
<el-form-item :label="this.$t('lesson.courseName')" prop="lessonName"> <el-form-item :label="this.$t('lesson.courseName')+this.$t('global.colon')" prop="lessonName">
<el-input v-model="chapterModel.lessonName" :disabled="true" /> <el-input v-model="chapterModel.lessonName" :disabled="true" />
</el-form-item> </el-form-item>
<el-form-item :label="this.$t('lesson.parentChapter')" prop="parentName"> <el-form-item :label="this.$t('lesson.parentChapter')" prop="parentName">

View File

@ -7,7 +7,7 @@
<el-card class="forms"> <el-card class="forms">
<el-scrollbar wrap-class="scrollbar-wrapper" :style="{height:height-160 + 'px'}" style="padding-top: 40px"> <el-scrollbar wrap-class="scrollbar-wrapper" :style="{height:height-160 + 'px'}" style="padding-top: 40px">
<el-form ref="form" :model="courseModel" :rules="rules" label-width="135px"> <el-form ref="form" :model="courseModel" :rules="rules" label-width="135px">
<el-form-item :label="this.$t('lesson.courseName')" prop="name"> <el-form-item :label="this.$t('lesson.courseName')+this.$t('global.colon')" prop="name">
<el-input v-model="courseModel.name" /> <el-input v-model="courseModel.name" />
</el-form-item> </el-form-item>
<el-form-item :label="this.$t('lesson.associatedSkin')" prop="skinCode"> <el-form-item :label="this.$t('lesson.associatedSkin')" prop="skinCode">
@ -30,7 +30,7 @@
/> />
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item :label="$t('lesson.courseDescription')" prop="remarks"> <el-form-item :label="$t('lesson.courseDescription')+this.$t('global.colon')" prop="remarks">
<el-input <el-input
v-model="courseModel.remarks" v-model="courseModel.remarks"
type="textarea" type="textarea"

View File

@ -9,16 +9,6 @@
label-width="140px" label-width="140px"
@submit.native.prevent @submit.native.prevent
> >
<el-form-item :label="this.$t('lesson.releaseAssociatedCity')" prop="cityCode">
<el-select v-model="editModel.cityCode" :placeholder="this.$t('rules.pleaseSelect')" :disabled="this.disabled" @change="cityChange">
<el-option v-for="item in cityList" :key="item.code" :label="item.name" :value="item.code" />
</el-select>
</el-form-item>
<el-form-item :label="this.$t('lesson.releaseAssociatedMap')" prop="mapId">
<el-select v-model="editModel.mapId" :placeholder="this.$t('rules.pleaseSelect')" :disabled="this.disabled" @change="mapChange">
<el-option v-for="item in mapList" :key="item.id" :label="item.name" :value="item.id" />
</el-select>
</el-form-item>
<el-form-item :label="this.$t('lesson.publishCourseName')" prop="name"> <el-form-item :label="this.$t('lesson.publishCourseName')" prop="name">
<el-input v-model="editModel.name" :disabled="!this.hasRelease" /> <el-input v-model="editModel.name" :disabled="!this.hasRelease" />
</el-form-item> </el-form-item>
@ -33,7 +23,6 @@
<script> <script>
import { getPublishMapListBySkinCode } from '@/api/jmap/map'; import { getPublishMapListBySkinCode } from '@/api/jmap/map';
import { getLessonNameByMapIdAndLessonId } from '@/api/jmap/lessondraft';
import { adminPublishLesson, releaseOrCancel } from '@/api/designPlatform'; import { adminPublishLesson, releaseOrCancel } from '@/api/designPlatform';
export default { export default {
@ -78,16 +67,6 @@ export default {
} }
}, },
methods: { methods: {
cityChange(code) {
this.editModel.mapId = '';
this.mapList = this.cityMapDict[code];
},
async mapChange(mapId) {
const resp = await getLessonNameByMapIdAndLessonId({ mapId: mapId, lessonId: this.editModel.id });
if (resp && resp.data) {
this.editModel.name = resp.data.name;
}
},
doShow(model) { doShow(model) {
this.mapList = []; this.mapList = [];
this.cityList = []; this.cityList = [];

View File

@ -29,24 +29,23 @@ export default {
menu: [], menu: [],
menuChapte: [ menuChapte: [
{ {
label: '更新章节', label: this.$t('lesson.updateChapter'),
handler: this.updateChapter handler: this.updateChapter
}, },
{ {
label: '创建章节', label: this.$t('lesson.createChapter'),
handler: this.createChapterInChapter handler: this.createChapterInChapter
} }
], ],
menuLesson: [ menuLesson: [
{ {
label: '创建章节', label: this.$t('lesson.editCourse'),
handler: this.createChapter handler: this.editLesson
}, },
{ {
label: '编辑课程', label: this.$t('lesson.createChapter'),
handler: this.editLesson handler: this.createChapter
} }
] ]
}; };
}, },

View File

@ -35,7 +35,7 @@
<span class="svg-container svg-container_login"> <span class="svg-container svg-container_login">
<svg-icon icon-class="user" /> <svg-icon icon-class="user" />
</span> </span>
<el-input v-model="loginForm.username" name="username" type="text" placeholder="手机号/邮箱" /> <el-input v-model="loginForm.username" name="username" type="text" placeholder="手机号/邮箱" @keyup.enter.native="goToNext"/>
</el-form-item> </el-form-item>
<el-form-item prop="password" class="item_form_box item_form_password"> <el-form-item prop="password" class="item_form_box item_form_password">
<span class="svg-container"> <span class="svg-container">
@ -46,17 +46,18 @@
name="password" name="password"
:type="pwdType" :type="pwdType"
placeholder="密码" placeholder="密码"
@keyup.enter="handleLogin" ref="password"
@keyup.enter.native="handleLogin"
/> />
<span class="show-pwd" @click="showPwd"> <span class="show-pwd" @click="showPwd">
<svg-icon icon-class="eye" v-if="pwdDisplay"/> <svg-icon v-if="pwdDisplay" icon-class="eye" />
<svg-icon icon-class="eye-open" v-else/> <svg-icon v-else icon-class="eye-open" />
</span> </span>
</el-form-item> </el-form-item>
<div class="tip-message">{{ tipsMsg }}</div> <div class="tip-message">{{ tipsMsg }}</div>
<div style="display: inline-block;width: 100%;margin-bottom: 10px;"> <div style="display: inline-block;width: 100%;margin-bottom: 10px;">
<div style="display:inline-block"> <div style="display:inline-block">
<el-checkbox v-model="isAutoLogin">自动登录</el-checkbox> <el-checkbox v-model="isAutoLogin">自动登录</el-checkbox>
</div> </div>
<el-popover <el-popover
placement="right" placement="right"
@ -72,19 +73,6 @@
<div slot="reference">无法登录?</div> <div slot="reference">无法登录?</div>
</el-popover> </el-popover>
</div> </div>
<!-- <el-popover
placement="right"
title=""
width="200"
trigger="hover"
class="popover_box"
>
<div>
<img :src="QCode" alt="" style="width: 100px; height: 100px; display: block; margin:0 auto;">
<div style="margin-top: 10px;">请在琏课堂小程序助手完善个人信息设置登录密码手机号或邮箱</div>
</div>
<div slot="reference">无法登录?</div>
</el-popover> -->
<el-form-item> <el-form-item>
<el-button type="primary" style="width:100%;" :loading="loading" @click.native.prevent="handleLogin"> <el-button type="primary" style="width:100%;" :loading="loading" @click.native.prevent="handleLogin">
登录 登录
@ -100,8 +88,6 @@
// import md5 from 'js-md5'; // import md5 from 'js-md5';
import QCode from '@/assets/erCode.jpg'; import QCode from '@/assets/erCode.jpg';
import { removeSessionStorage } from '@/utils/auth'; import { removeSessionStorage } from '@/utils/auth';
import { UrlConfig } from '@/router/index';
import localStore from 'storejs';
import Cookies from 'js-cookie'; import Cookies from 'js-cookie';
import md5 from 'js-md5'; import md5 from 'js-md5';
import QrcodeVue from 'qrcode.vue'; import QrcodeVue from 'qrcode.vue';
@ -110,6 +96,7 @@ import { LoginParams } from '@/utils/login';
import bgImg from '@/assets/bg1.jpg'; import bgImg from '@/assets/bg1.jpg';
import { setToken } from '@/utils/auth'; import { setToken } from '@/utils/auth';
import { loginTitle } from '@/scripts/ConstDic'; import { loginTitle } from '@/scripts/ConstDic';
import { removeToken, removeDesignToken} from '@/utils/auth';
export default { export default {
name: 'Login', name: 'Login',
@ -131,14 +118,14 @@ export default {
}; };
return { return {
bgImg: bgImg, bgImg: bgImg,
QCode: QCode, QCode: QCode,
isAutoLogin:false, isAutoLogin: false,
loginForm: { loginForm: {
username: '', username: '',
password: '' password: ''
}, },
loginRules: { loginRules: {
username: [{ required: true, trigger: 'blur', validator: validateUsername }], username: [{ required: true, trigger: 'blur', validator: validateUsername },{ required: true, trigger: 'change', validator: validateUsername }],
password: [{ required: true, trigger: 'blur', validator: validatePass }] password: [{ required: true, trigger: 'blur', validator: validatePass }]
}, },
loading: false, loading: false,
@ -150,8 +137,8 @@ export default {
loadingCode: false, loadingCode: false,
checkLogin: null, checkLogin: null,
checkTimeout: null, checkTimeout: null,
scanSuccess: false, scanSuccess: false,
pwdDisplay:true pwdDisplay: true
}; };
}, },
computed: { computed: {
@ -165,23 +152,29 @@ export default {
mounted() { mounted() {
document.title = loginTitle[this.$route.params.project||'default']; document.title = loginTitle[this.$route.params.project||'default'];
this.loginRefresh(); this.loginRefresh();
}, },
beforeCreate(){ beforeCreate() {
if(Cookies.get('UserName')&&Cookies.get('UserToken')){ removeToken();
const model = {'username':Cookies.get('UserName'),'password':Cookies.get('UserToken')}; removeDesignToken();
model.type = 'class'; if (Cookies.get('UserName')&&Cookies.get('UserToken')) {
model.project = this.$route.params.project; const model = {'username': Cookies.get('UserName'), 'password': Cookies.get('UserToken')};
removeSessionStorage('againEnter'); model.type = 'class';
this.$store.dispatch('Login', model).then(() => { model.project = this.$route.params.project;
this.$store.dispatch('SetAccount', model.username); this.$store.dispatch('Login', model).then(() => {
this.handleLoginSucessRoute(); this.$store.dispatch('SetAccount', model.username);
}).catch(error => { this.handleLoginSucessRoute();
this.tipsMsg = error.message; }).catch(error => {
this.loading = false; if(error.code=='30001'){
setTimeout(() => { this.tipsMsg = ''; }, 5000); this.tipsMsg = '账号或密码不正确!';
}); }
} else{
}, this.tipsMsg = error.message;
}
this.loading = false;
setTimeout(() => { this.tipsMsg = ''; }, 5000);
});
}
},
methods: { methods: {
clearTimer(timer) { clearTimer(timer) {
if (timer) { if (timer) {
@ -224,8 +217,8 @@ export default {
// //
self.$store.dispatch('QrLoginSetting', { key: 'SET_TOKEN', value: response.data.token }).then(() => { self.$store.dispatch('QrLoginSetting', { key: 'SET_TOKEN', value: response.data.token }).then(() => {
// //
self.clearTimer(self.checkLogin); self.clearTimer(self.checkLogin);
this.handleLoginSucessRoute(); this.handleLoginSucessRoute();
}); });
}).catch(error => { }).catch(error => {
if (error.data && error.data.status == '1') { if (error.data && error.data.status == '1') {
@ -236,14 +229,21 @@ export default {
}, 3000); }, 3000);
}, },
showPwd() { showPwd() {
if (this.pwdType === 'password') { if (this.pwdType === 'password') {
this.pwdDisplay=false; this.pwdDisplay=false;
this.pwdType = ''; this.pwdType = '';
} else { } else {
this.pwdType = 'password'; this.pwdType = 'password';
this.pwdDisplay=true; this.pwdDisplay=true;
} }
}, },
goToNext(){
if (this.loginForm.username.length < 5) {
return;
}else{
this.$refs['password'].focus();
}
},
handleLogin() { handleLogin() {
this.$refs.loginForm.validate(valid => { this.$refs.loginForm.validate(valid => {
if (valid) { if (valid) {
@ -251,17 +251,21 @@ export default {
model.password = md5(model.password); model.password = md5(model.password);
model.type = 'class'; model.type = 'class';
model.project = this.$route.params.project; model.project = this.$route.params.project;
this.loading = true; this.loading = true;
if(this.isAutoLogin){ if (this.isAutoLogin) {
Cookies.set('UserName', model.username, { expires: 2}); Cookies.set('UserName', model.username, { expires: 2});
Cookies.set('UserToken', model.password, { expires: 2}); Cookies.set('UserToken', model.password, { expires: 2});
} }
removeSessionStorage('againEnter');
this.$store.dispatch('Login', model).then(() => { this.$store.dispatch('Login', model).then(() => {
this.$store.dispatch('SetAccount', model.username); this.$store.dispatch('SetAccount', model.username);
this.handleLoginSucessRoute(); this.handleLoginSucessRoute();
}).catch(error => { }).catch(error => {
this.tipsMsg = error.message; if(error.code=='30001'){
this.tipsMsg = '账号或密码不正确!';
}
else{
this.tipsMsg = error.message;
}
this.loading = false; this.loading = false;
setTimeout(() => { this.tipsMsg = ''; }, 5000); setTimeout(() => { this.tipsMsg = ''; }, 5000);
}); });
@ -271,17 +275,18 @@ export default {
} }
}); });
}, },
handleLoginSucessRoute() { handleLoginSucessRoute() {
// //
this.loading = false; this.loading = false;
this.tipsMsg = ''; this.tipsMsg = '';
const path = UrlConfig.trainingPlatform.trainingPlatformHome; removeSessionStorage('againEnter');
this.$nextTick(() => { const path = '/trainingPlatform';
this.$i18n.locale = 'zh'; this.$nextTick(() => {
Cookies.set('user_lang', 'zh'); this.$i18n.locale = 'zh';
}); Cookies.set('user_lang', 'zh');
this.$router.push({ path: path }); });
} this.$router.push({ path: path });
}
} }
}; };
</script> </script>

View File

@ -34,7 +34,7 @@
<span class="svg-container svg-container_login"> <span class="svg-container svg-container_login">
<svg-icon icon-class="user" /> <svg-icon icon-class="user" />
</span> </span>
<el-input v-model="loginForm.username" name="username" type="text" placeholder="Mobile phone number/email" /> <el-input v-model="loginForm.username" name="username" type="text" placeholder="Mobile phone number/email" @keyup.enter.native="goToNext"/>
</el-form-item> </el-form-item>
<el-form-item prop="password" class="item_form_box item_form_password"> <el-form-item prop="password" class="item_form_box item_form_password">
<span class="svg-container"> <span class="svg-container">
@ -45,17 +45,18 @@
name="password" name="password"
:type="pwdType" :type="pwdType"
placeholder="密码" placeholder="密码"
@keyup.enter="handleLogin" ref="password"
@keyup.enter.native="handleLogin"
/> />
<span class="show-pwd" @click="showPwd"> <span class="show-pwd" @click="showPwd">
<svg-icon icon-class="eye" v-if="pwdDisplay"/> <svg-icon v-if="pwdDisplay" icon-class="eye" />
<svg-icon icon-class="eye-open" v-else/> <svg-icon v-else icon-class="eye-open" />
</span> </span>
</el-form-item> </el-form-item>
<div class="tip-message">{{ tipsMsg }}</div> <div class="tip-message">{{ tipsMsg }}</div>
<div style="display: inline-block;width: 100%;margin-bottom: 10px;"> <div style="display: inline-block;width: 100%;margin-bottom: 10px;">
<div style="display:inline-block"> <div style="display:inline-block">
<el-checkbox v-model="isAutoLogin">自动登录</el-checkbox> <el-checkbox v-model="isAutoLogin">自动登录</el-checkbox>
</div> </div>
<el-popover <el-popover
placement="right" placement="right"
@ -93,6 +94,7 @@ import { LoginParams } from '@/utils/login';
import bgImg from '@/assets/bg1.jpg'; import bgImg from '@/assets/bg1.jpg';
import { setDesignToken } from '@/utils/auth'; import { setDesignToken } from '@/utils/auth';
import QCode from '@/assets/erCode.jpg'; import QCode from '@/assets/erCode.jpg';
import { removeToken, removeDesignToken} from '@/utils/auth';
export default { export default {
name: 'LoginDesign', name: 'LoginDesign',
@ -113,19 +115,19 @@ export default {
} }
}; };
return { return {
bgImg: bgImg, bgImg: bgImg,
isAutoLogin:false, isAutoLogin: false,
loginForm: { loginForm: {
username: '', username: '',
password: '' password: ''
}, },
loginRules: { loginRules: {
username: [{ required: true, trigger: 'blur', validator: validateUsername }], username: [{ required: true, trigger: 'blur', validator: validateUsername },{ required: true, trigger: 'change', validator: validateUsername }],
password: [{ required: true, trigger: 'blur', validator: validatePass }] password: [{ required: true, trigger: 'blur', validator: validatePass }]
}, },
loading: false, loading: false,
pwdType: 'password', pwdType: 'password',
QCode: QCode, QCode: QCode,
tipsMsg: '', tipsMsg: '',
qrcodeClassName: 'login-qrcode', qrcodeClassName: 'login-qrcode',
sessionId: '', sessionId: '',
@ -133,27 +135,34 @@ export default {
loadingCode: false, loadingCode: false,
checkLogin: null, checkLogin: null,
checkTimeout: null, checkTimeout: null,
scanSuccess: false, scanSuccess: false,
pwdDisplay:true pwdDisplay: true
}; };
}, },
beforeCreate(){ beforeCreate() {
if(Cookies.get('UserDesignName')&&Cookies.get('UserDesignToken')){ removeToken();
const model = {'username':Cookies.get('UserDesignName'),'password':Cookies.get('UserDesignToken')}; removeDesignToken();
model.type = 'design'; if (Cookies.get('UserDesignName')&&Cookies.get('UserDesignToken')) {
this.$store.dispatch('Login', model).then(() => { const model = {'username': Cookies.get('UserDesignName'), 'password': Cookies.get('UserDesignToken')};
removeSessionStorage('design'); model.type = 'design';
setSessionStorage('design', true); this.$store.dispatch('Login', model).then(() => {
this.handleLoginSucessRoute(); removeSessionStorage('design');
}).catch(error => { setSessionStorage('design', true);
this.handleLoginSucessRoute();
}).catch(error => {
if(error.code=='30001'){
this.tipsMsg = '账号或密码不正确!';
}
else{
this.tipsMsg = error.message; this.tipsMsg = error.message;
this.loading = false; }
setTimeout(() => { this.tipsMsg = ''; }, 5000); this.loading = false;
}); setTimeout(() => { this.tipsMsg = ''; }, 5000);
} });
}, }
},
mounted() { mounted() {
document.title = '城市轨道交通设计平台'; document.title = '城市轨道交通设计平台';
this.loginRefresh(); this.loginRefresh();
}, },
methods: { methods: {
@ -162,9 +171,16 @@ export default {
clearTimeout(timer); clearTimeout(timer);
timer = null; timer = null;
} }
}, },
judgeAutoLogin(){ judgeAutoLogin() {
},
goToNext(){
if (this.loginForm.username.length < 5) {
return;
}else{
this.$refs['password'].focus();
}
}, },
loginRefresh() { loginRefresh() {
this.loadingCode = true; this.loadingCode = true;
@ -194,18 +210,18 @@ export default {
// //
// //
this.clearTimer(this.checkLogin); this.clearTimer(this.checkLogin);
this.checkLogin = setTimeout(() => { this.checkLogin = setTimeout(() => {
checkLoginStatus(self.sessionId).then(response => { checkLoginStatus(self.sessionId).then(response => {
setDesignToken(response.data.token); setDesignToken(response.data.token);
// //
self.$store.dispatch('QrLoginSetting', { key: 'SET_TOKENDESIGN', value: response.data.token }).then(() => { self.$store.dispatch('QrLoginSetting', { key: 'SET_TOKENDESIGN', value: response.data.token }).then(() => {
// //
self.clearTimer(self.checkLogin); self.clearTimer(self.checkLogin);
removeSessionStorage('design'); removeSessionStorage('design');
setSessionStorage('design', true); setSessionStorage('design', true);
this.handleLoginSucessRoute(); this.handleLoginSucessRoute();
}); });
}).catch(error => { }).catch(error => {
if (error.data && error.data.status == '1') { if (error.data && error.data.status == '1') {
self.scanSuccess = true; self.scanSuccess = true;
@ -216,33 +232,38 @@ export default {
}, },
showPwd() { showPwd() {
if (this.pwdType === 'password') { if (this.pwdType === 'password') {
this.pwdDisplay=false; this.pwdDisplay=false;
this.pwdType = ''; this.pwdType = '';
} else { } else {
this.pwdType = 'password'; this.pwdType = 'password';
this.pwdDisplay=true; this.pwdDisplay=true;
} }
}, },
handleLogin() { handleLogin() {
this.$refs.loginForm.validate(valid => { this.$refs.loginForm.validate(valid => {
if (valid) { if (valid) {
const model = Object.assign({}, this.loginForm); const model = Object.assign({}, this.loginForm);
model.password = md5(model.password); model.password = md5(model.password);
if(this.isAutoLogin){ if (this.isAutoLogin) {
Cookies.set('UserDesignName', model.username, { expires: 2}); Cookies.set('UserDesignName', model.username, { expires: 2});
Cookies.set('UserDesignToken', model.password, { expires: 2}); Cookies.set('UserDesignToken', model.password, { expires: 2});
} }
// model.type = 'plan'; // model.type = 'plan';
model.type = 'design'; model.type = 'design';
this.loading = true; this.loading = true;
this.$store.dispatch('Login', model).then(() => { this.$store.dispatch('Login', model).then(() => {
this.$store.dispatch('SetAccount', model.username); this.$store.dispatch('SetAccount', model.username);
this.handleLoginSucessRoute(); this.handleLoginSucessRoute();
}).catch(error => { }).catch(error => {
this.tipsMsg = error.message; if(error.code=='30001'){
this.tipsMsg = '账号或密码不正确!';
}
else{
this.tipsMsg = error.message;
}
this.loading = false; this.loading = false;
setTimeout(() => { this.tipsMsg = ''; }, 5000); setTimeout(() => { this.tipsMsg = ''; }, 5000);
}); });
@ -252,18 +273,19 @@ export default {
return false; return false;
} }
}); });
}, },
handleLoginSucessRoute() { handleLoginSucessRoute() {
// //
this.loading = false; this.loading = false;
this.tipsMsg = ''; this.tipsMsg = '';
const path = UrlConfig.design.prefix; removeSessionStorage('againEnter');
this.$nextTick(() => { const path = UrlConfig.design.prefix;
this.$i18n.locale = 'zh'; this.$nextTick(() => {
Cookies.set('user_lang', 'zh'); this.$i18n.locale = 'zh';
}); Cookies.set('user_lang', 'zh');
this.$router.push({ path: path }); });
} this.$router.push({ path: path });
}
} }
}; };
</script> </script>

View File

@ -36,7 +36,7 @@
<span class="svg-container svg-container_login"> <span class="svg-container svg-container_login">
<svg-icon icon-class="user" /> <svg-icon icon-class="user" />
</span> </span>
<el-input v-model="loginForm.username" name="username" type="text" placeholder="Mobile phone number/email" /> <el-input v-model="loginForm.username" name="username" type="text" placeholder="Mobile phone number/email" @keyup.enter.native="goToNext"/>
</el-form-item> </el-form-item>
<el-form-item prop="password" class="item_form_box item_form_password"> <el-form-item prop="password" class="item_form_box item_form_password">
<span class="svg-container"> <span class="svg-container">
@ -47,7 +47,8 @@
name="password" name="password"
:type="pwdType" :type="pwdType"
placeholder="password" placeholder="password"
@keyup.enter="handleLogin" ref="password"
@keyup.enter.native="handleLogin"
/> />
<span class="show-pwd" @click="showPwd"> <span class="show-pwd" @click="showPwd">
<svg-icon icon-class="eye" /> <svg-icon icon-class="eye" />
@ -56,7 +57,7 @@
<div class="tip-message">{{ tipsMsg }}</div> <div class="tip-message">{{ tipsMsg }}</div>
<div style="display: inline-block;width: 100%;margin-bottom: 10px;"> <div style="display: inline-block;width: 100%;margin-bottom: 10px;">
<div style="display:inline-block"> <div style="display:inline-block">
<el-checkbox v-model="isAutoLogin">Auto Login</el-checkbox> <el-checkbox v-model="isAutoLogin">Auto Login</el-checkbox>
</div> </div>
<el-popover <el-popover
placement="right" placement="right"
@ -72,19 +73,6 @@
<div slot="reference">unable to login?</div> <div slot="reference">unable to login?</div>
</el-popover> </el-popover>
</div> </div>
<!-- <el-popover
placement="right"
title=""
width="200"
trigger="hover"
class="popover_box"
>
<div>
<img :src="QCode" alt="" style="width: 100px; height: 100px; display: block; margin:0 auto;">
<div style="margin-top: 10px;">Please in lian classroom small program assistant, perfect personal information, set login password, mobile phone number or email.</div>
</div>
<div slot="reference">unable to login?</div>
</el-popover> -->
<el-form-item> <el-form-item>
<el-button type="primary" style="width:100%;" :loading="loading" @click.native.prevent="handleLogin"> <el-button type="primary" style="width:100%;" :loading="loading" @click.native.prevent="handleLogin">
login login
@ -99,8 +87,6 @@
<script> <script>
import QCode from '@/assets/erCode.jpg'; import QCode from '@/assets/erCode.jpg';
import { removeSessionStorage } from '@/utils/auth'; import { removeSessionStorage } from '@/utils/auth';
import { UrlConfig } from '@/router/index';
import localStore from 'storejs';
import Cookies from 'js-cookie'; import Cookies from 'js-cookie';
import md5 from 'js-md5'; import md5 from 'js-md5';
import QrcodeVue from 'qrcode.vue'; import QrcodeVue from 'qrcode.vue';
@ -109,9 +95,10 @@ import { LoginParams } from '@/utils/login';
import bgImg from '@/assets/bg1.jpg'; import bgImg from '@/assets/bg1.jpg';
import { setToken } from '@/utils/auth'; import { setToken } from '@/utils/auth';
import { loginTitle } from '@/scripts/ConstDic'; import { loginTitle } from '@/scripts/ConstDic';
import { removeToken, removeDesignToken} from '@/utils/auth';
export default { export default {
name: 'Login', name: 'LoginEn',
components: { QrcodeVue }, components: { QrcodeVue },
data() { data() {
const validateUsername = (rule, value, callback) => { const validateUsername = (rule, value, callback) => {
@ -129,15 +116,15 @@ export default {
} }
}; };
return { return {
QCode: QCode, QCode: QCode,
isAutoLogin:false, isAutoLogin: false,
bgImg: bgImg, bgImg: bgImg,
loginForm: { loginForm: {
username: '', username: '',
password: '' password: ''
}, },
loginRules: { loginRules: {
username: [{ required: true, trigger: 'blur', validator: validateUsername }], username: [{ required: true, trigger: 'blur', validator: validateUsername },{ required: true, trigger: 'change', validator: validateUsername }],
password: [{ required: true, trigger: 'blur', validator: validatePass }] password: [{ required: true, trigger: 'blur', validator: validatePass }]
}, },
loading: false, loading: false,
@ -159,35 +146,29 @@ export default {
title() { title() {
return loginTitle[this.$route.params.project||'default']; return loginTitle[this.$route.params.project||'default'];
} }
}, },
beforeCreate(){ beforeCreate() {
if(Cookies.get('UserName')&&Cookies.get('UserToken')){ removeToken();
const model = {'username':Cookies.get('UserName'),'password':Cookies.get('UserToken')}; removeDesignToken();
model.type = 'class'; if (Cookies.get('UserName')&&Cookies.get('UserToken')) {
model.project = this.$route.params.project; const model = {'username': Cookies.get('UserName'), 'password': Cookies.get('UserToken')};
removeSessionStorage('againEnter'); model.type = 'class';
this.$store.dispatch('Login', model).then(() => { model.project = this.$route.params.project;
this.$store.dispatch('SetAccount', model.username); this.$store.dispatch('Login', model).then(() => {
this.handleLoginSucessRoute(); this.$store.dispatch('SetAccount', model.username);
// // this.handleLoginSucessRoute();
// this.loading = false; }).catch(error => {
// this.tipsMsg = ''; if(error.code=='30001'){
// // let path = localStore.get('trainingPlatformRoute'+model.username); this.tipsMsg = 'The account number or password is incorrect!';
// // if (!path || !path.startsWith('/trainingPlatform')) { }
// path = UrlConfig.trainingPlatform.trainingPlatformHome; else{
// // } this.tipsMsg = error.message;
// this.$nextTick(() => { }
// this.$i18n.locale = 'en'; this.loading = false;
// Cookies.set('user_lang', 'en'); setTimeout(() => { this.tipsMsg = ''; }, 5000);
// }); });
// this.$router.push({ path: path }); }
}).catch(error => { },
this.tipsMsg = error.message;
this.loading = false;
setTimeout(() => { this.tipsMsg = ''; }, 5000);
});
}
},
mounted() { mounted() {
document.title = loginTitle[this.$route.params.project||'default']; document.title = loginTitle[this.$route.params.project||'default'];
this.loginRefresh(); this.loginRefresh();
@ -234,17 +215,8 @@ export default {
// //
self.$store.dispatch('QrLoginSetting', { key: 'SET_TOKEN', value: response.data.token }).then(() => { self.$store.dispatch('QrLoginSetting', { key: 'SET_TOKEN', value: response.data.token }).then(() => {
// //
self.clearTimer(self.checkLogin); self.clearTimer(self.checkLogin);
this.handleLoginSucessRoute(); this.handleLoginSucessRoute();
// let path = '/en/login';
// if (this.project) {
// path = path + '/' + this.project;
// }
// self.$router.push({ path: path });
// self.$nextTick(() => {
// self.$i18n.locale = 'en';
// Cookies.set('user_lang', 'en');
// });
}); });
}).catch(error => { }).catch(error => {
if (error.data && error.data.status == '1') { if (error.data && error.data.status == '1') {
@ -260,7 +232,14 @@ export default {
} else { } else {
this.pwdType = 'password'; this.pwdType = 'password';
} }
}, },
goToNext(){
if (this.loginForm.username.length < 5) {
return;
}else{
this.$refs['password'].focus();
}
},
handleLogin() { handleLogin() {
this.$refs.loginForm.validate(valid => { this.$refs.loginForm.validate(valid => {
if (valid) { if (valid) {
@ -269,17 +248,20 @@ export default {
model.type = 'class'; model.type = 'class';
model.project = this.$route.params.project; model.project = this.$route.params.project;
this.loading = true; this.loading = true;
if(this.isAutoLogin){ if (this.isAutoLogin) {
Cookies.set('UserName', model.username, { expires: 2}); Cookies.set('UserName', model.username, { expires: 2});
Cookies.set('UserToken', model.password, { expires: 2}); Cookies.set('UserToken', model.password, { expires: 2});
} }
removeSessionStorage('againEnter'); this.$store.dispatch('Login', model).then(() => {
this.$store.dispatch('SetAccount', model.username);
this.$store.dispatch('Login', model).then(() => { this.handleLoginSucessRoute();
this.$store.dispatch('SetAccount', model.username);
this.handleLoginSucessRoute();
}).catch(error => { }).catch(error => {
this.tipsMsg = error.message; if(error.code=='30001'){
this.tipsMsg = 'The account number or password is incorrect!';
}
else{
this.tipsMsg = error.message;
}
this.loading = false; this.loading = false;
setTimeout(() => { this.tipsMsg = ''; }, 5000); setTimeout(() => { this.tipsMsg = ''; }, 5000);
}); });
@ -288,18 +270,19 @@ export default {
return false; return false;
} }
}); });
}, },
handleLoginSucessRoute() { handleLoginSucessRoute() {
// //
this.loading = false; this.loading = false;
this.tipsMsg = ''; this.tipsMsg = '';
const path = UrlConfig.trainingPlatform.trainingPlatformHome; removeSessionStorage('againEnter');
this.$nextTick(() => { const path = '/trainingPlatform';
this.$i18n.locale = 'en'; this.$nextTick(() => {
Cookies.set('user_lang', 'en'); this.$i18n.locale = 'en';
}); Cookies.set('user_lang', 'en');
this.$router.push({ path: path }); });
} this.$router.push({ path: path });
}
} }
}; };
</script> </script>

View File

@ -34,7 +34,7 @@
<span class="svg-container svg-container_login"> <span class="svg-container svg-container_login">
<svg-icon icon-class="user" /> <svg-icon icon-class="user" />
</span> </span>
<el-input v-model="loginForm.username" name="username" type="text" placeholder="Mobile phone number/email" /> <el-input v-model="loginForm.username" name="username" type="text" placeholder="Mobile phone number/email" @keyup.enter.native="goToNext"/>
</el-form-item> </el-form-item>
<el-form-item prop="password" class="item_form_box item_form_password"> <el-form-item prop="password" class="item_form_box item_form_password">
<span class="svg-container"> <span class="svg-container">
@ -45,7 +45,8 @@
name="password" name="password"
:type="pwdType" :type="pwdType"
placeholder="password" placeholder="password"
@keyup.enter="handleLogin" ref="password"
@keyup.enter.native="handleLogin"
/> />
<span class="show-pwd" @click="showPwd"> <span class="show-pwd" @click="showPwd">
<svg-icon icon-class="eye" /> <svg-icon icon-class="eye" />
@ -54,7 +55,7 @@
<div class="tip-message">{{ tipsMsg }}</div> <div class="tip-message">{{ tipsMsg }}</div>
<div style="display: inline-block;width: 100%;margin-bottom: 10px;"> <div style="display: inline-block;width: 100%;margin-bottom: 10px;">
<div style="display:inline-block"> <div style="display:inline-block">
<el-checkbox v-model="isAutoLogin">Auto Login</el-checkbox> <el-checkbox v-model="isAutoLogin">Auto Login</el-checkbox>
</div> </div>
<el-popover <el-popover
placement="right" placement="right"
@ -70,19 +71,6 @@
<div slot="reference">unable to login?</div> <div slot="reference">unable to login?</div>
</el-popover> </el-popover>
</div> </div>
<!-- <el-popover
placement="right"
title=""
width="200"
trigger="hover"
class="popover_box"
>
<div>
<img :src="QCode" alt="" style="width: 100px; height: 100px; display: block; margin:0 auto;">
<div style="margin-top: 10px;">Please in lian classroom small program assistant, perfect personal information, set login password, mobile phone number or email.</div>
</div>
<div slot="reference">unable to login?</div>
</el-popover> -->
<el-form-item> <el-form-item>
<el-button type="primary" style="width:100%;" :loading="loading" @click.native.prevent="handleLogin"> <el-button type="primary" style="width:100%;" :loading="loading" @click.native.prevent="handleLogin">
login login
@ -104,9 +92,10 @@ import { getLoginWmurl, checkLoginStatus } from '@/api/login';
import { LoginParams } from '@/utils/login'; import { LoginParams } from '@/utils/login';
import bgImg from '@/assets/bg1.jpg'; import bgImg from '@/assets/bg1.jpg';
import { setDesignToken } from '@/utils/auth'; import { setDesignToken } from '@/utils/auth';
import { removeToken, removeDesignToken} from '@/utils/auth';
export default { export default {
name: 'LoginDesign', name: 'LoginEnDesign',
components: { QrcodeVue }, components: { QrcodeVue },
data() { data() {
const validateUsername = (rule, value, callback) => { const validateUsername = (rule, value, callback) => {
@ -124,15 +113,15 @@ export default {
} }
}; };
return { return {
QCode:QCode, QCode: QCode,
isAutoLogin:false, isAutoLogin: false,
bgImg: bgImg, bgImg: bgImg,
loginForm: { loginForm: {
username: '', username: '',
password: '' password: ''
}, },
loginRules: { loginRules: {
username: [{ required: true, trigger: 'blur', validator: validateUsername }], username: [{ required: true, trigger: 'blur', validator: validateUsername },{ required: true, trigger: 'change', validator: validateUsername }],
password: [{ required: true, trigger: 'blur', validator: validatePass }] password: [{ required: true, trigger: 'blur', validator: validatePass }]
}, },
loading: false, loading: false,
@ -146,22 +135,29 @@ export default {
checkTimeout: null, checkTimeout: null,
scanSuccess: false scanSuccess: false
}; };
}, },
beforeCreate(){ beforeCreate() {
if(Cookies.get('UserDesignName')&&Cookies.get('UserDesignToken')){ removeToken();
const model = {'username':Cookies.get('UserDesignName'),'password':Cookies.get('UserDesignToken')}; removeDesignToken();
model.type = 'design'; if (Cookies.get('UserDesignName')&&Cookies.get('UserDesignToken')) {
this.$store.dispatch('Login', model).then(() => { const model = {'username': Cookies.get('UserDesignName'), 'password': Cookies.get('UserDesignToken')};
removeSessionStorage('design'); model.type = 'design';
setSessionStorage('design', true); this.$store.dispatch('Login', model).then(() => {
this.handleLoginSucessRoute(); removeSessionStorage('design');
}).catch(error => { setSessionStorage('design', true);
this.tipsMsg = error.message; this.handleLoginSucessRoute();
this.loading = false; }).catch(error => {
setTimeout(() => { this.tipsMsg = ''; }, 5000); if(error.code=='30001'){
}); this.tipsMsg = 'The account number or password is incorrect!';
} }
}, else{
this.tipsMsg = error.message;
}
this.loading = false;
setTimeout(() => { this.tipsMsg = ''; }, 5000);
});
}
},
mounted() { mounted() {
document.title = '城市轨道交通设计平台'; document.title = '城市轨道交通设计平台';
this.loginRefresh(); this.loginRefresh();
@ -208,16 +204,10 @@ export default {
// //
self.$store.dispatch('QrLoginSetting', { key: 'SET_TOKENDESIGN', value: response.data.token }).then(() => { self.$store.dispatch('QrLoginSetting', { key: 'SET_TOKENDESIGN', value: response.data.token }).then(() => {
// //
self.clearTimer(self.checkLogin); self.clearTimer(self.checkLogin);
removeSessionStorage('design'); removeSessionStorage('design');
setSessionStorage('design', true); setSessionStorage('design', true);
this.handleLoginSucessRoute(); this.handleLoginSucessRoute();
// self.$router.push({ path: '/design/login' });
// this.$router.push({ path: `${UrlConfig.design.prefix}` });
// self.$nextTick(() => {
// self.$i18n.locale = 'en';
// Cookies.set('user_lang', 'en');
// });
}); });
}).catch(error => { }).catch(error => {
if (error.data && error.data.status == '1') { if (error.data && error.data.status == '1') {
@ -240,35 +230,25 @@ export default {
const model = Object.assign({}, this.loginForm); const model = Object.assign({}, this.loginForm);
model.password = md5(model.password); model.password = md5(model.password);
// model.type = 'plan'; // model.type = 'plan';
model.type = 'design'; model.type = 'design';
if(this.isAutoLogin){ if (this.isAutoLogin) {
Cookies.set('UserDesignName', model.username, { expires: 2}); Cookies.set('UserDesignName', model.username, { expires: 2});
Cookies.set('UserDesignToken', model.password, { expires: 2}); Cookies.set('UserDesignToken', model.password, { expires: 2});
} }
this.loading = true; this.loading = true;
// this.$store.dispatch('Login', model).then(() => {
// this.$store.dispatch('GetUserConfigInfo');
// //
// this.loading = false;
// this.tipsMsg = '';
// this.$router.push({ path: `${UrlConfig.design.prefix}` });
// this.$nextTick(() => {
// this.$i18n.locale = 'en';
// Cookies.set('user_lang', 'en');
// });
// }).catch(error => {
// this.tipsMsg = error.message;
// this.loading = false;
// setTimeout(() => { this.tipsMsg = ''; }, 5000);
// });
this.$store.dispatch('Login', model).then(() => { this.$store.dispatch('Login', model).then(() => {
this.$store.dispatch('SetAccount', model.username); this.$store.dispatch('SetAccount', model.username);
this.handleLoginSucessRoute(); this.handleLoginSucessRoute();
}).catch(error => { }).catch(error => {
this.tipsMsg = error.message; if(error.code=='30001'){
this.tipsMsg = 'The account number or password is incorrect!';
}
else{
this.tipsMsg = error.message;
}
this.loading = false; this.loading = false;
setTimeout(() => { this.tipsMsg = ''; }, 5000); setTimeout(() => { this.tipsMsg = ''; }, 5000);
}); });
@ -279,17 +259,25 @@ export default {
} }
}); });
}, },
handleLoginSucessRoute() { goToNext(){
// if (this.loginForm.username.length < 5) {
this.loading = false; return;
this.tipsMsg = ''; }else{
const path = UrlConfig.design.prefix; this.$refs['password'].focus();
this.$nextTick(() => { }
this.$i18n.locale = 'en'; },
Cookies.set('user_lang', 'en'); handleLoginSucessRoute() {
}); //
this.$router.push({ path: path }); this.loading = false;
} this.tipsMsg = '';
removeSessionStorage('againEnter');
const path = UrlConfig.design.prefix;
this.$nextTick(() => {
this.$i18n.locale = 'en';
Cookies.set('user_lang', 'en');
});
this.$router.push({ path: path });
}
} }
}; };
</script> </script>

View File

@ -6,7 +6,7 @@
</div> </div>
<!-- <map-create ref="mapCreate" :skin-code="skinCode" @refresh="refresh" @editmap="handleNodeClick" /> --> <!-- <map-create ref="mapCreate" :skin-code="skinCode" @refresh="refresh" @editmap="handleNodeClick" /> -->
<div class="map-draft"> <div class="map-draft">
<div v-show="viewDraft==='draft'"> <div v-show="viewDraft === 'draft'">
<map-operate <map-operate
ref="mapOperate" ref="mapOperate"
:card-height="cardHeight" :card-height="cardHeight"
@ -46,13 +46,13 @@
</transition> </transition>
</template> </template>
<script> <script>
import { saveMap, getMapDetail, verifyMap } from '@/api/jmap/mapdraft'; import { saveMap, getMapDetail, verifyMap, postBuildMapImport } from '@/api/jmap/mapdraft';
import { ViewMode, TrainingMode, getDeviceMenuByDeviceType } from '@/scripts/ConstDic'; import { ViewMode, TrainingMode, getDeviceMenuByDeviceType } from '@/scripts/ConstDic';
import { checkLoginLine } from '@/api/login'; import { checkLoginLine } from '@/api/login';
import JlmapVisual from '@/views/jlmap/index'; import JlmapVisual from '@/views/jlmap/index';
import MapOperate from './mapoperate/index'; import MapOperate from './mapoperate/index';
import { EventBus } from '@/scripts/event-bus'; import { EventBus } from '@/scripts/event-bus';
import MapCreate from '../mapmanage/create'; // import MapCreate from '../mapmanage/create';
import ConfigMap from './configMap'; import ConfigMap from './configMap';
@ -64,8 +64,8 @@ export default {
JlmapVisual, JlmapVisual,
MapOperate, MapOperate,
DataRelation, DataRelation,
ConfigMap, ConfigMap
// MapCreate, // MapCreate,
}, },
data() { data() {
return { return {
@ -303,38 +303,38 @@ export default {
setCenter(code) { setCenter(code) {
this.$refs.jlmapVisual.setCenter(code); this.$refs.jlmapVisual.setCenter(code);
}, },
createMap() { createMap() {
this.$refs.mapCreate.show(); this.$refs.mapCreate.show();
}, },
importf() { importf() {
const loading = this.$loading({ const loading = this.$loading({
lock: true, lock: true,
text: '正在导入中...', text: '正在导入中...',
spinner: 'el-icon-loading', spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.7)' background: 'rgba(0, 0, 0, 0.7)'
}); });
setTimeout(() => { setTimeout(() => {
const obj = this.$refs.files; const obj = this.$refs.files;
if (!obj.files) return; if (!obj.files) return;
const f = obj.files[0]; const f = obj.files[0];
const reader = new FileReader(); const reader = new FileReader();
const that = this; const that = this;
reader.readAsText(f, 'utf-8'); reader.readAsText(f, 'utf-8');
reader.onload = function(e) { reader.onload = function(e) {
const data = e.target.result; const data = e.target.result;
postBuildMapImport(JSON.parse(data)).then(res => { postBuildMapImport(JSON.parse(data)).then(res => {
loading.close(); loading.close();
that.$message.success('导入成功!'); that.$message.success('导入成功!');
that.refresh(); that.refresh();
loading.close(); loading.close();
}).catch(error => { }).catch(error => {
loading.close(); loading.close();
that.$message.error('导入失败' + error.message); that.$message.error('导入失败' + error.message);
}); });
obj.value = ''; obj.value = '';
}; };
}); });
} }
} }
}; };
</script> </script>

View File

@ -7,30 +7,10 @@
{{ $t('map.mapName') }} {{ $t('map.mapName') }}
<b>{{ mapInfo.name }}</b> <b>{{ mapInfo.name }}</b>
</span> </span>
<el-button <el-button v-if="isSave" type="text" style="float: right; padding: 3px 0" :disabled="mapSaveing" @click="saveMapEvent">{{ $t('map.save') }}</el-button>
v-if="isSave" <el-button v-if="isSave" type="text" style="float: right; padding: 3px 0; margin-right: 5px;" :disabled="mapSaveing" @click="verifyMapEvent">{{ $t('map.dataVerification') }}</el-button>
type="text" <el-button type="text" style="float: right; padding: 3px 0; margin-right: 5px;" @click="dataRelation">{{ $t('map.advanced') }}</el-button>
style="float: right; padding: 3px 0" <el-button type="text" style="float: right; padding: 3px 0; margin-right: 5px;" @click="showMap">{{ $t('map.viewLayer') }}</el-button>
:disabled="mapSaveing"
@click="saveMapEvent"
>{{ $t('map.save') }}</el-button>
<el-button
v-if="isSave"
type="text"
style="float: right; padding: 3px 0; margin-right: 5px;"
:disabled="mapSaveing"
@click="verifyMapEvent"
>{{ $t('map.dataVerification') }}</el-button>
<el-button
type="text"
style="float: right; padding: 3px 0; margin-right: 5px;"
@click="dataRelation"
>{{ $t('map.advanced') }}</el-button>
<el-button
type="text"
style="float: right; padding: 3px 0; margin-right: 5px;"
@click="showMap"
>{{ $t('map.viewLayer') }}</el-button>
</div> </div>
<el-tabs v-model="enabledTab" class="mapEdit" type="card"> <el-tabs v-model="enabledTab" class="mapEdit" type="card">
<el-tab-pane :label="$t('map.link')" name="Link"> <el-tab-pane :label="$t('map.link')" name="Link">

View File

@ -146,8 +146,8 @@ export default {
props: { props: {
selected: { selected: {
type: Object, type: Object,
default: function () { default() {
return null; return {};
} }
}, },
cardHeight: { cardHeight: {
@ -497,7 +497,7 @@ export default {
} }
}, },
watch: { watch: {
selected(val, oldVal) { selected(val) {
this.deviceSelect(val); this.deviceSelect(val);
} }
}, },
@ -540,9 +540,9 @@ export default {
}, },
deviceSelect(selected) { deviceSelect(selected) {
if (!this.fieldS) { // if (!this.fieldS) { //
this.editModel.points = [];
if (selected && selected._type.toUpperCase() === 'Section'.toUpperCase()) { if (selected && selected._type.toUpperCase() === 'Section'.toUpperCase()) {
this.$refs.dataform.resetFields(); this.$refs.dataform.resetFields();
this.editModel.points = [];
this.activeName = 'first'; this.activeName = 'first';
this.editModel = deepAssign(this.editModel, selected); this.editModel = deepAssign(this.editModel, selected);
this.editModel.logicSectionNum = selected.type === '01' ? selected.logicSectionNum : [0]; this.editModel.logicSectionNum = selected.type === '01' ? selected.logicSectionNum : [0];

View File

@ -11,7 +11,7 @@
size="mini" size="mini"
@submit.native.prevent @submit.native.prevent
> >
<el-form-item :label="this.$t('map.mapName')" prop="name"> <el-form-item :label="this.$t('orderAuthor.permissionName')" prop="name">
<el-input v-model="editModel.name" /> <el-input v-model="editModel.name" />
</el-form-item> </el-form-item>
<el-form-item :label="this.$t('orderAuthor.describtion')" prop="remarks"> <el-form-item :label="this.$t('orderAuthor.describtion')" prop="remarks">

View File

@ -1,171 +0,0 @@
<template>
<el-card :style="{height: height+'px'}">
<div class="home-box">
<el-card class="box-card">
<div id="scriptTitle">{{$t('scriptRecord.scriptDetail')}}</div>
<div id="sciptForm">
<data-form ref="dataform" :form="form" :form-model="formModel" :rules="rules" />
</div>
<div id="btnList">
<span slot="footer" class="btn-footer">
<el-button type="success" @click="drawUp">{{$t('scriptRecord.scriptRecord')}}</el-button>
<el-button type="primary" @click="modifyScript">{{$t('scriptRecord.scriptModify')}}</el-button>
<el-button type="danger" @click="deleteScript">{{$t('scriptRecord.scriptDelete')}}</el-button>
</span>
</div>
</el-card>
</div>
</el-card>
</template>
<script>
import Cookies from 'js-cookie';
import { UrlConfig } from '@/router/index';
import {listPublishMap} from '@/api/jmap/map';
import {getQuestById, updateQuest, deleteQuest} from '@/api/quest';
import { launchFullscreen } from '@/utils/screen';
import { scriptRecordNotify } from '@/api/simulation';
export default {
name: 'ScriptDetail',
data() {
return {
mapList: [],
taskStatusList: [],
disabled: true,
formModel: {
name: '',
mapId: '',
description: ''
},
isShow: false
};
},
computed: {
form() {
const form = {
labelWidth: '150px',
items: [
{ prop: 'name', label: this.$t('scriptRecord.scriptName'), type: 'text', required: true},
{ prop: 'mapId', label: this.$t('scriptRecord.map'), type: 'select', required: true, options: this.mapList, disabled: this.disabled},
{ prop: 'description', label: this.$t('scriptRecord.scriptDescription'), type: 'textarea', required: true}
]
};
return form;
},
rules() {
const crules = {
name: [
{ required: true, message: this.$t('scriptRecord.scriptNameRule'), trigger: 'blur' },
{ required: true, message: this.$t('scriptRecord.scriptNameRule'), trigger: 'change' }
],
mapId: [
{ required: true, message: '请选择地图', trigger: 'change' }
],
description: [
{ required: true, message: this.$t('scriptRecord.scriptDescriptionRule'), trigger: 'blur' },
{ required: true, message: this.$t('scriptRecord.scriptDescriptionRule'), trigger: 'change' }
]
};
return crules;
},
height() {
return this.$store.state.app.height - 50;
}
},
watch: {
$route(newVal) {
this.loadInitData();
}
},
mounted() {
listPublishMap().then(response => {
this.mapList = response.data.map(elem => { return { value: elem.id, label: elem.name }; });
this.loadInitData();
});
},
methods: {
loadInitData() {
const scriptId =this.$route.params.scriptId;
if (parseInt(scriptId)) {
getQuestById(scriptId).then(resp=>{
const data={'name': resp.data.name, 'description': resp.data.description, 'mapId': resp.data.mapId,'lang':resp.data.lang};
this.formModel=data;
this.formModel.id=scriptId;
}).catch(error => {
this.$message.error(this.$t('scriptRecord.getScriptFail')+':' + error.message);
});
}
},
drawUp() {
const data=this.formModel;
scriptRecordNotify(data.id).then(resp => {
const query = { mapId: data.mapId, group: resp.data, scriptId: data.id,lang:data.lang };
this.$router.push({ path: `${UrlConfig.scriptDisplay}/script`, query });
launchFullscreen();
}).catch(error => {
this.$messageBox(`${this.$t('scriptRecord.createSimulationFail')}: ${error.message}`);
});
},
modifyScript() {
const data=this.formModel;
if(Cookies.get("user_lang")=="en"){
data.lang='en';
}else{
data.lang='zh';
}
updateQuest(data.id, data).then(resp => {
this.$emit('refresh');
this.$message.success(this.$t('scriptRecord.modifyScriptSuccess'));
}).catch(error => {
this.$messageBox(`${this.$t('scriptRecord.modifyScriptFail')}: ${error.message}`);
});
},
deleteScript() {
const data=this.formModel;
this.$confirm(this.$t('scriptRecord.deleteScriptTip'), this.$t('global.tips'), {
confirmButtonText: this.$t('global.confirm'),
cancelButtonText: this.$t('global.cancel'),
type: 'warning'
}).then(() => {
deleteQuest(data.id).then(response => {
this.$message.success(this.$t('scriptRecord.deleteScriptSucess'));
this.$emit('refresh');
this.$router.push({ path: `${UrlConfig.script.prefix}` });
}).catch(() => {
this.$messageBox(this.$t('scriptRecord.deleteScriptFail'));
});
}).catch(() => { });
}
}
};
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
@import "src/styles/mixin.scss";
.home-box {
padding: 20px 100px;
float: left;
width: 100%;
font-family: 'Microsoft YaHei';
}
.box-card {
width:800px;
margin: 0 auto;
margin-top: 20px;
padding-bottom: 50px;
}
#scriptTitle{
padding: 30px 40px;
}
#sciptForm{
margin-top: 10px;
padding: 0px 130px 0px 100px;
}
#btnList{
margin: 0px 100px;
}
.btn-footer{
margin-left: 100px;
margin-top: 10px;
display: inline-block;
}
</style>

View File

@ -44,7 +44,7 @@
<el-button type="success" @click="buy">{{ $t('teach.buy') }}</el-button> <el-button type="success" @click="buy">{{ $t('teach.buy') }}</el-button>
<el-button v-if="hasPermssion" type="primary" @click="distribute">{{ $t('teach.permissionDistribute') }}</el-button> <el-button v-if="hasPermssion" type="primary" @click="distribute">{{ $t('teach.permissionDistribute') }}</el-button>
<el-button v-if="hasPermssion" type="primary" @click="transfer">{{ $t('teach.authorityTransferred') }}</el-button> <el-button v-if="hasPermssion" type="primary" @click="transfer">{{ $t('teach.authorityTransferred') }}</el-button>
<el-button type="primary" @click="backLessonList">返回课程列表</el-button> <el-button type="primary" @click="backLessonList">{{ $t('teach.returnCourseList') }}</el-button>
</div> </div>
</el-card> </el-card>
</template> </template>

View File

@ -2,7 +2,7 @@
<div style="height: 100%; padding-bottom: 20px;"> <div style="height: 100%; padding-bottom: 20px;">
<el-card> <el-card>
<div slot="header" style="text-align: center;"> <div slot="header" style="text-align: center;">
<b>教学系统</b> <b>{{ $t('global.lessonSystem') }}</b>
</div> </div>
</el-card> </el-card>
<el-card v-loading="loading"> <el-card v-loading="loading">
@ -13,19 +13,19 @@
> >
<el-table-column <el-table-column
prop="name" prop="name"
label="课程" :label="this.$t('teach.courseName')"
/> />
<el-table-column <el-table-column
prop="remarks" prop="remarks"
show-overflow-tooltip show-overflow-tooltip
label="说明" :label="this.$t('teach.courseDescription')"
/> />
<el-table-column <el-table-column
label="操作" :label="this.$t('global.operate')"
> >
<template slot-scope="scope"> <template slot-scope="scope">
<el-button size="mini" type="primary" @click="goLesson(scope.row)"> <el-button size="mini" type="primary" @click="goLesson(scope.row)">
进入课程 {{ $t('teach.enterTheCourse') }}
</el-button> </el-button>
</template> </template>
</el-table-column> </el-table-column>
@ -63,7 +63,7 @@ export default {
this.tableData = resp.data.lessonList; this.tableData = resp.data.lessonList;
} }
}).catch(()=>{ }).catch(()=>{
this.$messageBox('获取课程信息失败!'); this.$messageBox(this.$t('error.obtainCourseInformationFailed'));
}); });
} }
}, },

View File

@ -173,35 +173,40 @@
<el-button icon="el-icon-plus" circle plain @click="addingRoles('bigScreen', '增加大屏')" /> <el-button icon="el-icon-plus" circle plain @click="addingRoles('bigScreen', '增加大屏')" />
</div> </div>
</div> </div>
<!--<div class="Scheduling">--> <div class="Scheduling">
<!--<p class="title">真实设备-<span>{{hasPlc?'[PLC网关在线]':'[PLC网关离线]'}}</span></p>--> <p class="title">{{ $t('trainRoom.realDevice') }}-<span>{{ hasPlc?$t('trainRoom.plcGatewayOnline'):$t('trainRoom.plcGatewayOffline') }}</span></p>
<!--<ul>--> <ul>
<!--<li v-for="(nor, index) in stationStandList" :key="index" class="selectPerson">--> <li v-for="(nor, index) in stationStandList" :key="index" class="selectPerson">
<!--<span>{{ realDeviceType[nor.deviceType] }}</span>--> <span>{{ realDeviceType[nor.deviceType] }}</span>
<!--<div style="float: right; margin-right: 15px;">--> <i
<!--<el-select--> v-if="userId == roomInfo.creatorId"
<!--v-model="nor.deviceCode"--> class="el-icon-close delPerson"
<!--:placeholder="$t('global.choose')"--> @click="handleDelDevice(nor)"
<!--size="mini"--> />
<!--:disabled="userId != roomInfo.creatorId"--> <div style="float: right; margin-right: 15px;">
<!--@change="handleChangeDevice(nor, doorList, stationStandList)"--> <el-select
<!--&gt;--> v-model="nor.deviceCode"
<!--<el-option--> :placeholder="$t('global.choose')"
<!--v-for="item in doorList"--> size="mini"
<!--:key="item.code"--> :disabled="userId != roomInfo.creatorId"
<!--:label="item.name"--> @change="handleChangeDevice(nor, doorList, stationStandList)"
<!--:value="item.code"--> >
<!--:disabled="item.disabled"--> <el-option
<!--style="margin-left: 10px"--> v-for="item in doorList"
<!--/>--> :key="item.code"
<!--</el-select>--> :label="item.name"
<!--</div>--> :value="item.code"
<!--</li>--> :disabled="item.disabled"
<!--</ul>--> style="margin-left: 10px"
<!--<div v-if="userId == roomInfo.creatorId" class="add-box">--> />
<!--<el-button icon="el-icon-plus" circle plain @click="addingDevice" />--> </el-select>
<!--</div>--> </div>
<!--</div>--> </li>
</ul>
<div v-if="userId == roomInfo.creatorId" class="add-box">
<el-button icon="el-icon-plus" circle plain @click="addingDevice" />
</div>
</div>
</div> </div>
</div> </div>
<div class="start-box"> <div class="start-box">
@ -284,7 +289,7 @@
</template> </template>
<script> <script>
import { getJoinTrainCode, deljointTrainRoom, putUserRoles, postRoomDetail, getJointTrainRoomUserList, putJointTrainingExit, startJointTraining, putJointTrainingSimulation, putJointTrainingSimulationEntrance, setRealDevice } from '@/api/chat'; import { getJoinTrainCode, deljointTrainRoom, putUserRoles, postRoomDetail, getJointTrainRoomUserList, putJointTrainingExit, startJointTraining, putJointTrainingSimulation, putJointTrainingSimulationEntrance, setRealDevice, delRealDevice, getRealDevices } from '@/api/chat';
import { getStationList } from '@/api/runplan'; import { getStationList } from '@/api/runplan';
import { launchFullscreen } from '@/utils/screen'; import { launchFullscreen } from '@/utils/screen';
import { DeviceMenu, RealDeviceType } from '@/scripts/ConstDic'; import { DeviceMenu, RealDeviceType } from '@/scripts/ConstDic';
@ -407,10 +412,8 @@ export default {
await this.addPeopleList(val); await this.addPeopleList(val);
} }
}, },
'$store.state.socket.deviceInfo': async function (val) { '$store.state.socket.realDeviceInfo': async function (val) {
if (val) { // await this.getDevicesList(); //
await this.handlerDeviceList(val);
}
} }
}, },
beforeDestroy() { beforeDestroy() {
@ -422,7 +425,8 @@ export default {
this.userId = this.$store.state.user.id; this.userId = this.$store.state.user.id;
this.getRoomInfo(); // info this.getRoomInfo(); // info
this.getUserList(); // this.getUserList(); //
// this.checkPlcGateway(); //PLC this.checkPlcGateway(); // PLC
this.getDevicesList(); //
this.timeDemon = setInterval(() => { this.timeDemon = setInterval(() => {
checkLoginLine(); checkLoginLine();
}, 5000 * 60); }, 5000 * 60);
@ -622,7 +626,7 @@ export default {
this.stationList = resp.data; this.stationList = resp.data;
this.computePermissionRest(); this.computePermissionRest();
// //
// this.handleDoorList(res.data.mapId, resp.data); this.handleDoorList(res.data.mapId, resp.data);
}, },
// list Admin Instructor Dispatcher Attendant Audience Driver Repair IBP IBP // list Admin Instructor Dispatcher Attendant Audience Driver Repair IBP IBP
async getUserList() { async getUserList() {
@ -723,7 +727,11 @@ export default {
this.loading = true; this.loading = true;
await putJointTrainingExit(this.$route.query.group); await putJointTrainingExit(this.$route.query.group);
this.loading = false; this.loading = false;
this.$router.push({ path: `/trainingPlatform/detail/${this.$route.query.subSystem}`, query: {mapId: this.mapId}}); if (this.$route.query.subSystem) {
this.$router.push({ path: `/trainingPlatform/detail/${this.$route.query.subSystem}`, query: {mapId: this.mapId}});
} else {
this.$router.go(-1);
}
} catch (error) { } catch (error) {
this.messageInfo( this.$t('error.operationFailure'), 'error'); this.messageInfo( this.$t('error.operationFailure'), 'error');
} }
@ -901,7 +909,7 @@ export default {
this.hasPlc = false; this.hasPlc = false;
} }
}).catch(() => { }).catch(() => {
this.$messageBox('查询PLC设备失败'); this.$messageBox(this.$t('error.inquiryPLCDeviceFailed'));
}); });
}, },
handleDoorList(mapId, stationList) { handleDoorList(mapId, stationList) {
@ -910,33 +918,48 @@ export default {
stationList.forEach(item => { stationList.forEach(item => {
res.data.forEach(it =>{ res.data.forEach(it =>{
if (item.code === it.stationCode) { if (item.code === it.stationCode) {
const direction = parseInt(it.doorLocationType)%2 ===0? '上行站台':'下行站台'; const direction = parseInt(it.doorLocationType)%2 ===0? this.$t('trainRoom.uplinkPlatform'):this.$t('trainRoom.downlinkPlatform');
doorList.push({code: it.code, name: item.name+direction}); doorList.push({code: it.code, name: item.name+direction});
} }
}); });
}); });
this.doorList = doorList; this.doorList = doorList;
}).catch((error) => { }).catch(() => {
this.$messageBox('获取屏蔽门列表失败!'); this.$messageBox(this.$t('error.getScreenDoorsListFailed'));
}); });
}, },
addingDevice() { addingDevice() {
const roomDeviceVo = {id: '', deviceType: 'ScreenDoor', deviceCode: ''}; const roomDeviceVo = {id: '', deviceType: 'ScreenDoor', deviceCode: ''};
let typeSame = false;
this.stationStandList.forEach( item =>{
if (item.deviceType === roomDeviceVo.deviceType) {
typeSame = true;
}
});
if (typeSame) {
this.$message.info(this.$t('error.theDeviceTypeAlreadyExists'));
return;
}
setRealDevice(this.$route.query.group, roomDeviceVo); setRealDevice(this.$route.query.group, roomDeviceVo);
}, },
handleChangeDevice(nor, doorList, stationStandList) { handleChangeDevice(nor, doorList, stationStandList) {
setRealDevice(this.$route.query.group, nor); setRealDevice(this.$route.query.group, nor).then(resp => {
doorList.forEach(item => { }).catch(() => {
item.disabled = false; this.$messageBox(this.$t('error.connectToRealDeviceFailed'));
stationStandList.forEach(nor => {
if (item.code == nor.deviceCode) {
item.disabled = true;
}
});
}); });
}, },
handlerDeviceList(data) { getDevicesList() {
this.stationStandList = [data]; getRealDevices(this.$route.query.group).then( resp => {
this.stationStandList = resp.data;
}).catch(() => {
this.$messageBox(this.$t('error.getRealDeviceListFailed'));
});
},
handleDelDevice(nor) {
delRealDevice(nor.id, this.$route.query.group).then( resp => {
}).catch(() => {
this.$messageBox(this.$t('error.deleteRealDeviceFailed'));
});
} }
} }
}; };

View File

@ -90,10 +90,6 @@ export default {
beforeDestroy () { beforeDestroy () {
}, },
mounted() { mounted() {
const path = localStore.get('trainingPlatformRoute'+ this.userId);
if (path && path.startsWith('/trainingPlatform')) {
this.$router.push(path);
}
}, },
methods: { methods: {
filterNode(value, data) { filterNode(value, data) {
@ -148,8 +144,8 @@ export default {
// this.$router.push({ path: `${UrlConfig.trainingPlatform.runPlan}/${this.mapId}`, query: {skinCode: '02'} }); // this.$router.push({ path: `${UrlConfig.trainingPlatform.runPlan}/${this.mapId}`, query: {skinCode: '02'} });
// break; // break;
} }
}).catch((error) => { }).catch(() => {
this.$messageBox('获取子系统信息失败!'+error); this.$messageBox(this.$t('systemGenerate.getSubSystemInfoFail'));
}); });
} }
}, },

View File

@ -1,97 +0,0 @@
<template>
<el-card :style="{height: height+'px'}">
<div class="home-box" :style="{height: height+'px'}">
<el-scrollbar wrap-class="scrollbar-wrapper">
<h1 class="title">
城市轨道交通实训平台
<img :src="logo" alt="" class="logo-img">
</h1>
<div class="card-box">
<el-carousel :interval="4000" type="card" height="380px">
<el-carousel-item v-for="(item, index) in listImg" :key="index">
<img :src="item.src" alt="" height="100%" width="100%">
</el-carousel-item>
</el-carousel>
</div>
<div class="brief-box">{{ $t('demonstration.simulationSystemDescription') }}</div>
</el-scrollbar>
</div>
</el-card>
</template>
<script>
import logo from '@/assets/logo.png';
import home1 from '@/assets/home/home1.png';
import home2 from '@/assets/home/home2.png';
import home3 from '@/assets/home/demon1.jpg';
import home4 from '@/assets/home/tring1.png';
import home5 from '@/assets/home/tring4.jpg';
import home6 from '@/assets/home/demon2.jpg';
export default {
name: 'Home',
data() {
return {
listImg: [
{ src: home1 },
{ src: home2 },
{ src: home3 },
{ src: home4 },
{ src: home5 },
{ src: home6 }
],
logo: logo
};
},
computed: {
height() {
return this.$store.state.app.height - 50;
}
}
};
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
@import "src/styles/mixin.scss";
/deep/ .el-carousel {
overflow: hidden;
}
.home-box {
padding: 15px 100px;
float: left;
width: 100%;
font-family: 'Microsoft YaHei';
.title {
font-size: 35px;
width: 100%;
text-align: center;
font-weight: 400;
margin-top: 55px;
border-bottom: 2px dashed #333;
padding-bottom: 15px;
margin-bottom: 70px;
position: relative;
.logo-img {
position: absolute;
right: 0;
top: 0;
width: 55px;
}
}
.card-box {
width: 100%;
padding: 0 50px;
}
.brief-box {
font-size: 18px;
text-indent: 2em;
line-height: 32px;
padding: 40px 20px 0;
font-family: unset;
}
}
</style>

View File

@ -42,6 +42,9 @@ export default {
}, },
width() { width() {
return this.$store.state.app.width; return this.$store.state.app.width;
},
userId() {
return this.$store.state.user.id;
} }
}, },
watch: { watch: {
@ -53,6 +56,10 @@ export default {
const againEnter = getSessionStorage('againEnter') || null; const againEnter = getSessionStorage('againEnter') || null;
if (!againEnter) { if (!againEnter) {
launchFullscreen(); launchFullscreen();
const path = localStore.get('trainingPlatformRoute'+ this.userId);
if (path && path.startsWith('/trainingPlatform')) {
this.$router.push(path);
}
setSessionStorage('againEnter', true); setSessionStorage('againEnter', true);
} }