Merge remote-tracking branch 'remotes/origin/test'
This commit is contained in:
commit
15b423a38b
@ -239,7 +239,7 @@ export function getPermissionJoint(group) {
|
||||
});
|
||||
}
|
||||
|
||||
//
|
||||
// 添加或更新真实设备和仿真对象连接
|
||||
export function setRealDevice(group, data) {
|
||||
return request({
|
||||
url: `/api/jointTraining/room/realDevice?group=${group}`,
|
||||
@ -247,3 +247,20 @@ export function setRealDevice(group, 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'
|
||||
});
|
||||
}
|
||||
|
@ -32,5 +32,6 @@ export default {
|
||||
instructions: 'Instructions',
|
||||
chapterTrainingName: 'Chapter/training name',
|
||||
revokeScriptSuccess: 'Revoke script success',
|
||||
revokeScriptFailed: 'Revoke script failed'
|
||||
revokeScriptFailed: 'Revoke script failed',
|
||||
skin: 'Skin'
|
||||
};
|
||||
|
@ -94,5 +94,11 @@ export default {
|
||||
getTrainListFailed: 'Failed to get train list',
|
||||
getDraftCourseDataFailed: 'Failed to get draft 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!'
|
||||
};
|
||||
|
@ -37,5 +37,8 @@ export default {
|
||||
theBestTimeToCompleteTheQuestion: 'The best time to complete the question',
|
||||
trainingNotes: 'Training notes',
|
||||
giveUpTheExam: 'Give up the exam',
|
||||
nameOfTestPaper: 'Test name'
|
||||
nameOfTestPaper: 'Test name',
|
||||
courseDescription: 'Course description',
|
||||
enterTheExam: 'Enter the exam',
|
||||
returnCourseList: 'Return course list'
|
||||
};
|
||||
|
@ -58,7 +58,7 @@ export default {
|
||||
courseList: 'Course list',
|
||||
countSkinCode: 'Duplicate skin cannot be the same type as the copied skin',
|
||||
createNewCoursesFromRelease: 'Create new courses from release',
|
||||
courseName: 'Course name:',
|
||||
courseName: 'Course name',
|
||||
parentChapter: 'Parent chapter:',
|
||||
chapterName: 'Chapter name:',
|
||||
chapterInstructions: 'Chapter instructions:',
|
||||
@ -71,7 +71,7 @@ export default {
|
||||
draftCourseName: 'Draft course name:',
|
||||
associatedSkin: 'Associated skin:',
|
||||
associatedProducts: 'Associated products:',
|
||||
courseDescription: 'Course description:',
|
||||
courseDescription: 'Course description',
|
||||
editCourse: 'Edit course',
|
||||
createCourse: 'Create course',
|
||||
courseRelease: 'Course release',
|
||||
@ -116,5 +116,8 @@ export default {
|
||||
pendingReview: 'Pending review',
|
||||
published: 'Published',
|
||||
rejected: 'Rejected',
|
||||
review: 'Review'
|
||||
review: 'Review',
|
||||
explanation: 'Explanation',
|
||||
courseDetails: 'Course details',
|
||||
courseTree: 'Course tree:'
|
||||
};
|
||||
|
@ -4,7 +4,7 @@ export default {
|
||||
pleaseSelect: 'please choose',
|
||||
pleaseEnter: 'please input',
|
||||
sketchMap: 'Draft map list',
|
||||
newConstruction: 'create',
|
||||
newConstruction: 'Create',
|
||||
importMap: 'Import the map',
|
||||
createNewMap: 'A new map',
|
||||
normalCreate: 'The normal to create',
|
||||
|
@ -16,5 +16,7 @@ export default {
|
||||
permissionDistribute: 'Permission distribution (class)',
|
||||
authorityTransferred: 'Authority transferred',
|
||||
courseList: 'Course list',
|
||||
seconds: 'seconds'
|
||||
seconds: 'seconds',
|
||||
enterTheCourse: 'Enter the course',
|
||||
returnCourseList: 'Return course list'
|
||||
};
|
||||
|
@ -27,5 +27,10 @@ export default {
|
||||
recording: 'recording...',
|
||||
sendText: 'Send text',
|
||||
left: 'left',
|
||||
right: 'right'
|
||||
right: 'right',
|
||||
realDevice: 'Real device',
|
||||
plcGatewayOnline: '[PLC gateway online]',
|
||||
plcGatewayOffline: '[PLC gateway offline]',
|
||||
uplinkPlatform: 'Uplink platform',
|
||||
downlinkPlatform: 'Downlink platform'
|
||||
};
|
||||
|
@ -32,6 +32,6 @@ export default {
|
||||
instructions: '说明',
|
||||
chapterTrainingName: '章节/课程名称',
|
||||
revokeScriptSuccess: '撤回成功',
|
||||
revokeScriptFailed: '撤回失败'
|
||||
|
||||
revokeScriptFailed: '撤回失败',
|
||||
skin: '皮肤'
|
||||
};
|
||||
|
@ -94,5 +94,11 @@ export default {
|
||||
getTrainListFailed: '获取列车列表失败',
|
||||
getDraftCourseDataFailed: '获取草稿课程数据失败!',
|
||||
failedToGetCourseData: '获取课程数据失败!',
|
||||
failedToGetSystemData: '获取系统数据失败!'
|
||||
failedToGetSystemData: '获取系统数据失败!',
|
||||
inquiryPLCDeviceFailed: '查询PLC设备失败!',
|
||||
getScreenDoorsListFailed: '获取屏蔽门列表失败!',
|
||||
theDeviceTypeAlreadyExists: '已存在该设备类型!',
|
||||
connectToRealDeviceFailed: '关联真实设备失败!',
|
||||
getRealDeviceListFailed: '获取真实设备列表失败!',
|
||||
deleteRealDeviceFailed: '删除真实设备失败!'
|
||||
};
|
||||
|
@ -37,5 +37,8 @@ export default {
|
||||
maximumTimeToCompleteThisQuestion: '完成本题最大用时',
|
||||
theBestTimeToCompleteTheQuestion: '完成本题最佳用时',
|
||||
trainingNotes: '实训说明',
|
||||
giveUpTheExam: '放弃考试'
|
||||
giveUpTheExam: '放弃考试',
|
||||
courseDescription: '课程说明',
|
||||
enterTheExam: '进入考试',
|
||||
returnCourseList: '返回课程列表'
|
||||
};
|
||||
|
@ -161,6 +161,6 @@ export default {
|
||||
help: '帮助',
|
||||
city: '城市',
|
||||
simulationSystem: '仿真系统',
|
||||
lessonSystem: '课程系统',
|
||||
lessonSystem: '教学系统',
|
||||
examSystem: '考试系统'
|
||||
};
|
||||
|
@ -57,7 +57,7 @@ export default {
|
||||
contentSorting: '内容排序',
|
||||
courseList: '课程列表',
|
||||
createNewCoursesFromRelease: '从发布课程新建',
|
||||
courseName: '课程名称:',
|
||||
courseName: '课程名称',
|
||||
parentChapter: '父级章节:',
|
||||
chapterName: '章节名称:',
|
||||
chapterInstructions: '章节说明:',
|
||||
@ -70,7 +70,7 @@ export default {
|
||||
draftCourseName: '草稿课程名称:',
|
||||
associatedSkin: '关联皮肤:',
|
||||
associatedProducts: '关联产品:',
|
||||
courseDescription: '课程说明:',
|
||||
courseDescription: '课程说明',
|
||||
editCourse: '编辑课程',
|
||||
createCourse: '创建课程',
|
||||
courseRelease: '课程发布',
|
||||
@ -115,7 +115,9 @@ export default {
|
||||
pendingReview: '待审核',
|
||||
published: '已发布',
|
||||
rejected: '已驳回',
|
||||
review: '查看'
|
||||
|
||||
review: '查看',
|
||||
explanation: '驳回说明',
|
||||
courseDetails: '课程详情',
|
||||
courseTree: '课程树:'
|
||||
};
|
||||
|
||||
|
@ -16,5 +16,7 @@ export default {
|
||||
permissionDistribute: '权限分发(上课)',
|
||||
authorityTransferred: '权限转赠',
|
||||
courseList: '课程列表',
|
||||
seconds: '秒'
|
||||
seconds: '秒',
|
||||
enterTheCourse: '进入课程',
|
||||
returnCourseList: '返回课程列表'
|
||||
};
|
||||
|
@ -27,5 +27,10 @@ export default {
|
||||
recording: '录音中...',
|
||||
sendText: '发送文字',
|
||||
left: '左',
|
||||
right: '右'
|
||||
right: '右',
|
||||
realDevice: '真实设备',
|
||||
plcGatewayOnline: '[PLC网关在线]',
|
||||
plcGatewayOffline: '[PLC网关离线]',
|
||||
uplinkPlatform: '上行站台',
|
||||
downlinkPlatform: '下行站台'
|
||||
};
|
||||
|
@ -157,13 +157,13 @@ export function Jl3dDriving(updatemmi,sound) {
|
||||
if (trainlisttest.list[code].runMode == '02') {
|
||||
|
||||
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 {
|
||||
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 {
|
||||
|
||||
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) {
|
||||
@ -357,7 +357,7 @@ export function Jl3dDriving(updatemmi,sound) {
|
||||
// trainlisttest.list[code].startmark = 1;
|
||||
}else{
|
||||
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);
|
||||
}
|
||||
}
|
||||
if (data.body[i].directionType == '02') { // 向右
|
||||
if (data.body[i].directionType == '02') { // 向右
|
||||
|
||||
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 = trainlisttest.list[code].children[0].matrixWorld.elements[14];
|
||||
trainlisttest.list[code].rotation.y = 0;
|
||||
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 = (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;
|
||||
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 = trainlisttest.list[code].children[0].matrixWorld.elements[14];
|
||||
trainlisttest.list[code].rotation.y = 0;
|
||||
trainlisttest.list[code].position.x = rotaposx;
|
||||
for (let tl=0; tl<6; tl++) {
|
||||
trainlisttest.list[code].children[tl].position.z = rotaposz;
|
||||
}
|
||||
|
||||
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);
|
||||
@ -468,9 +468,9 @@ export function Jl3dDriving(updatemmi,sound) {
|
||||
// console.log(rails.linkrail[nextcode].lineleft.points);
|
||||
// console.log("***********************");
|
||||
// console.log(rails.linkrail[nextcode].lineleft.points);
|
||||
|
||||
let nextcode;
|
||||
if(code == drivingcode){
|
||||
let nextcode;
|
||||
|
||||
|
||||
if(data.body[i].directionType == '02'){
|
||||
trainlisttest.list[code].status = '02';
|
||||
@ -501,19 +501,29 @@ export function Jl3dDriving(updatemmi,sound) {
|
||||
let nextcode;
|
||||
if(data.body[i].directionType == '02'){
|
||||
if(rails.linkrail[data.body[i].linkCode].lineleft){
|
||||
nextcode = rails.linkrail[data.body[i].linkCode].rconnect;
|
||||
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].len = rails.linkrail[data.body[i].linkCode].lengthfact;
|
||||
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'){
|
||||
if(rails.linkrail[data.body[i].linkCode].lineright){
|
||||
nextcode = rails.linkrail[data.body[i].linkCode].lconnect;
|
||||
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].len = rails.linkrail[data.body[i].linkCode].lengthfact;
|
||||
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;
|
||||
|
@ -146,7 +146,7 @@ export function UpdateTrain(camera,traindata,control){
|
||||
trainmodel.progress = 0;
|
||||
trainmodel.len = trainmodel.nextlen;
|
||||
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.nextcurve = null;
|
||||
@ -296,7 +296,7 @@ export function UpdateTrain(camera,traindata,control){
|
||||
// console.log(trainmodel.rotalist);
|
||||
}
|
||||
|
||||
console.log(trainmodel.nextcurve);
|
||||
// console.log(trainmodel.nextcurve);
|
||||
if(trainmodel.progress > -(trainmodel.speeds)){
|
||||
trainmodel.progress += trainmodel.speeds;
|
||||
}
|
||||
|
@ -1,5 +1,6 @@
|
||||
<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">
|
||||
<span style="color: white;">{{ $t(item.name) }}</span>
|
||||
</el-menu-item>
|
||||
@ -22,14 +23,19 @@ export default {
|
||||
return {
|
||||
entryList: [
|
||||
{
|
||||
name: 'global.quickEntry',
|
||||
handle: this.quickEntry
|
||||
// global.designPlatform
|
||||
name: '城市轨道交通设计平台',
|
||||
handle: this.goToDesign
|
||||
},
|
||||
{
|
||||
name: 'global.scan',
|
||||
handle: this.qcodeEntry,
|
||||
hidden: process.env.NODE_ENV != 'development'
|
||||
}
|
||||
},
|
||||
{
|
||||
name: 'global.quickEntry',
|
||||
handle: this.quickEntry
|
||||
},
|
||||
],
|
||||
stomp: null,
|
||||
header: null
|
||||
@ -50,6 +56,12 @@ export default {
|
||||
},
|
||||
qcodeEntry() {
|
||||
this.$refs.qcode.doShow();
|
||||
},
|
||||
goToDesign(){
|
||||
let routeData = this.$router.resolve({
|
||||
path: "/design",
|
||||
});
|
||||
window.open(routeData.href, '_blank');
|
||||
}
|
||||
}
|
||||
};
|
||||
|
@ -84,8 +84,10 @@ export default {
|
||||
.avatar-container {
|
||||
height: $height;
|
||||
display: inline-block;
|
||||
position: absolute;
|
||||
right: 35px;
|
||||
// position: absolute;
|
||||
position: relative;
|
||||
right: 0px;
|
||||
// right: 35px;
|
||||
|
||||
.avatar-wrapper {
|
||||
cursor: pointer;
|
||||
|
@ -1,14 +1,14 @@
|
||||
<template>
|
||||
<el-menu
|
||||
class="navbar"
|
||||
router
|
||||
:router="isRoute"
|
||||
:default-active="activePath"
|
||||
mode="horizontal"
|
||||
background-color="#545c64"
|
||||
text-color="#fff"
|
||||
active-text-color="#ffd04b"
|
||||
>
|
||||
<system-title></system-title>
|
||||
<system-title />
|
||||
<template v-for="(item,idx) in routers">
|
||||
<template v-if="!item.hidden&&item.children">
|
||||
<template v-if="hasOneScreenShowingChildren(item.children) &&!item.alwaysShow">
|
||||
@ -24,7 +24,7 @@
|
||||
</template>
|
||||
<template v-else-if="hasOneShowingChildren(item.children) &&!item.alwaysShow">
|
||||
<template :to="item.path+'/'+item.children[0].path">
|
||||
<!-- -->
|
||||
<!-- -->
|
||||
<el-menu-item :key="idx" :index="item.redirect ? item.redirect : (item.path+'/'+item.children[0].path)">
|
||||
<span
|
||||
v-if="item.children[0].meta&&item.children[0].meta.i18n"
|
||||
@ -68,8 +68,16 @@
|
||||
</el-submenu>
|
||||
</template>
|
||||
</template>
|
||||
<quick-entry ref="quickEntry" v-if="isShow"/>
|
||||
<user-logout ref="userLogout" />
|
||||
<div class="rightGroup">
|
||||
<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>
|
||||
</template>
|
||||
|
||||
@ -83,14 +91,15 @@ import { getSessionStorage } from '@/utils/auth';
|
||||
export default {
|
||||
components: {
|
||||
UserLogout,
|
||||
QuickEntry,
|
||||
SystemTitle
|
||||
QuickEntry,
|
||||
SystemTitle
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
routes: [],
|
||||
isShow:false,
|
||||
activePath:'',
|
||||
routes: [],
|
||||
isShow: false,
|
||||
activePath: '',
|
||||
isRoute: true
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
@ -100,22 +109,21 @@ export default {
|
||||
])
|
||||
},
|
||||
mounted() {
|
||||
this.routes = this.$router.options.routes;
|
||||
if (getSessionStorage('design')) {
|
||||
this.isShow=false;
|
||||
}
|
||||
else{
|
||||
this.isShow=true;
|
||||
}
|
||||
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){
|
||||
this.activePath='/design/home';
|
||||
}
|
||||
else{
|
||||
this.activePath=this.$route.path;
|
||||
}
|
||||
this.routes = this.$router.options.routes;
|
||||
if (getSessionStorage('design')) {
|
||||
this.isShow=false;
|
||||
this.isRoute = true;
|
||||
} else {
|
||||
this.isShow=true;
|
||||
this.isRoute = false;
|
||||
}
|
||||
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) {
|
||||
this.activePath='/design/home';
|
||||
} else {
|
||||
this.activePath=this.$route.path;
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
toggleSideBar() {
|
||||
@ -125,7 +133,7 @@ export default {
|
||||
const showingChildren = children.filter(item => {
|
||||
if (!item.hidden && !item.target) { return item; }
|
||||
});
|
||||
if (showingChildren.length === 1) {
|
||||
if (showingChildren.length === 1) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
@ -149,7 +157,13 @@ export default {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
},
|
||||
goToTraining(){
|
||||
let routeData = this.$router.resolve({
|
||||
path: "/",
|
||||
});
|
||||
window.open(routeData.href, '_blank');
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
@ -157,6 +171,12 @@ export default {
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
$height: 61px;
|
||||
|
||||
.rightGroup{
|
||||
position: absolute;
|
||||
right: 35px;
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
.navbar {
|
||||
height: $height;
|
||||
line-height: $height;
|
||||
@ -180,8 +200,10 @@ export default {
|
||||
.avatar-container {
|
||||
height: $height;
|
||||
display: inline-block;
|
||||
position: absolute;
|
||||
right: 35px;
|
||||
position: relative;
|
||||
margin-right:10px;
|
||||
// position: absolute;
|
||||
// right: 35px;
|
||||
|
||||
.avatar-wrapper {
|
||||
cursor: pointer;
|
||||
|
@ -15,18 +15,7 @@ function hasPermission(roles, permissionRoles) {
|
||||
return roles.some(role => permissionRoles.indexOf(role) >= 0);
|
||||
}
|
||||
|
||||
const project = getSessionStorage('project');
|
||||
|
||||
// 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 whiteList = ['/login', '/dp/login', '/en/login', '/design/login', '/design/en/login', '/login/xty']; // 不重定向白名单
|
||||
|
||||
const loginPage = whiteList[0];
|
||||
|
||||
|
@ -88,7 +88,6 @@ import PublishLesson from '@/views/publish/publishLesson/index';
|
||||
|
||||
import IbpEdit from '@/views/ibp/ibpDraft/ibpEdit/index';
|
||||
import TrainingPlatform from '@/views/trainingPlatform/index';
|
||||
import TrainingPlatformHome from '@/views/trainingPlatform/home';
|
||||
|
||||
import Commodity from '@/views/orderauthor/commodity/index';
|
||||
import CommodityDraft from '@/views/orderauthor/commodity/draft';
|
||||
@ -154,6 +153,14 @@ export const userPlan = '015'; // 计划系统
|
||||
export const userDesign='016'; // 设计系统
|
||||
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 = {
|
||||
display: '/display',
|
||||
scriptDisplay: '/scriptDisplay',
|
||||
@ -250,7 +257,6 @@ export const UrlConfig = {
|
||||
},
|
||||
trainingPlatform: {
|
||||
trainingPlatform: '/trainingPlatform',
|
||||
trainingPlatformHome: '/trainingPlatform/home',
|
||||
prodDetail: '/trainingPlatform/detail',
|
||||
teachDetail: '/trainingPlatform/teach',
|
||||
teachHome: '/trainingPlatform/teachHome',
|
||||
@ -315,6 +321,11 @@ export const constantRoutes = [
|
||||
component: Jlmap3dedit,
|
||||
hidden: true
|
||||
},
|
||||
{
|
||||
path: '/',
|
||||
redirect: redirectPath,
|
||||
hidden: true
|
||||
},
|
||||
{
|
||||
path: '/401',
|
||||
component: Error401,
|
||||
@ -608,19 +619,11 @@ export const asyncRouter = [
|
||||
children: [
|
||||
{
|
||||
path: '',
|
||||
redirect: '/trainingPlatform/home',
|
||||
redirect: '/trainingPlatform/permission/14',
|
||||
component: TrainingPlatform,
|
||||
meta: {
|
||||
},
|
||||
children: [
|
||||
{
|
||||
path: 'home',
|
||||
redirect: '/trainingPlatform/permission/14',
|
||||
component: TrainingPlatformHome,
|
||||
meta: {
|
||||
},
|
||||
hidden: true
|
||||
},
|
||||
{
|
||||
path: 'detail/:subSystem',
|
||||
component: DemonstrationDetail,
|
||||
|
@ -89,7 +89,7 @@ function handle(state, data) {
|
||||
state.tipOperateCount++;
|
||||
break;
|
||||
case 'JointTraining_Device':
|
||||
handleDeviceInfo(state, msg);
|
||||
state.realDeviceInfo++;
|
||||
break;
|
||||
case 'Simulation_Control_Pause': // 暂停中
|
||||
store.dispatch('scriptRecord/updateSimulationPause', msg);
|
||||
@ -185,11 +185,6 @@ function handleUserinfo(state, data) {
|
||||
state.roleInfo = data;
|
||||
}
|
||||
}
|
||||
function handleDeviceInfo(state, data) {
|
||||
if (data) {
|
||||
state.deviceInfo = data;
|
||||
}
|
||||
}
|
||||
function handleMessageInfo(state, type, data) {
|
||||
const message = {
|
||||
join: true,
|
||||
@ -284,7 +279,7 @@ const socket = {
|
||||
permissionOver: {}, // 权限结束
|
||||
|
||||
tipOperateCount: 0, // 任务结束提示消息
|
||||
deviceInfo: [] // 真实设备信息
|
||||
realDeviceInfo: 0 // 真实设备信息
|
||||
},
|
||||
|
||||
getters: {
|
||||
|
@ -1,6 +1,6 @@
|
||||
import { setSessionStorage, removeSessionStorage } from '@/utils/auth';
|
||||
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 { LoginParams } from '@/utils/login';
|
||||
import { creatSubscribe, perpetualTopic } from '@/utils/stomp';
|
||||
@ -9,8 +9,6 @@ import Cookies from 'js-cookie';
|
||||
const user = {
|
||||
state: {
|
||||
token: getToken(),
|
||||
tokenScreen: getScreenToken(),
|
||||
tokenPlan: getPlanToken(),
|
||||
tokenDesign: getDesignToken(),
|
||||
name: '',
|
||||
nickname: '',
|
||||
@ -70,25 +68,7 @@ const user = {
|
||||
return new Promise((resolve, reject) => {
|
||||
let params = null;
|
||||
let execFc = null;
|
||||
if (userInfo.type == 'dp') {
|
||||
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') {
|
||||
if (userInfo.type == 'design') {
|
||||
params = Object.assign({ account: username, password }, LoginParams.Design);
|
||||
execFc = (token) => {
|
||||
setDesignToken(token);
|
||||
@ -175,18 +155,10 @@ const user = {
|
||||
// 前端登出
|
||||
FedLogOut({ commit }, clientId) {
|
||||
return new Promise(resolve => {
|
||||
if (clientId == LoginParams.DaPing.clientId) {
|
||||
commit('SET_TOKENSCREEN', '');
|
||||
removeScreenToken();
|
||||
} else if (clientId == LoginParams.Design.clientId) {
|
||||
if (clientId == LoginParams.Design.clientId) {
|
||||
commit('SET_TOKENDESIGN', '');
|
||||
removeDesignToken();
|
||||
}
|
||||
// else if (clientId == LoginParams.LianJiHua.clientId) {
|
||||
// commit('SET_TOKENPLAN', '');
|
||||
// removePlanToken();
|
||||
// }
|
||||
else {
|
||||
} else {
|
||||
commit('SET_TOKEN', '');
|
||||
removeToken();
|
||||
}
|
||||
|
@ -2,11 +2,6 @@ import SessionStorage from 'sessionstorage';
|
||||
import { LoginParams } from '@/utils/login';
|
||||
|
||||
const TokenKey = 'Admin-Token';
|
||||
|
||||
const TokenScreenKey = 'Screen-Token';
|
||||
|
||||
const TokenPlanKey = 'Plan-Token';
|
||||
|
||||
const TokenDesignKey='Design-Token';
|
||||
|
||||
// 设置教学,实训,仿真系统token
|
||||
@ -19,16 +14,6 @@ export function setToken(token) {
|
||||
export function removeToken() {
|
||||
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
|
||||
export function getDesignToken() {
|
||||
@ -41,16 +26,6 @@ export function removeDesignToken() {
|
||||
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
|
||||
export function getSessionStorage(key) {
|
||||
return SessionStorage.getItem(key);
|
||||
|
@ -4,8 +4,8 @@ export function getBaseUrl() {
|
||||
if (process.env.NODE_ENV === 'development') {
|
||||
// BASE_API = 'https://joylink.club/jlcloud';
|
||||
// BASE_API = 'https://test.joylink.club/jlcloud';
|
||||
BASE_API = 'http://192.168.3.5:9000'; // 袁琪
|
||||
// BASE_API = 'http://192.168.3.6:9000'; // 旭强
|
||||
// BASE_API = 'http://192.168.3.5:9000'; // 袁琪
|
||||
BASE_API = 'http://192.168.3.6:9000'; // 旭强
|
||||
// BASE_API = 'http://192.168.3.41:9000'; // 王兴杰
|
||||
} else {
|
||||
BASE_API = process.env.VUE_APP_BASE_API;
|
||||
|
@ -1,214 +1,213 @@
|
||||
<template>
|
||||
<div>
|
||||
<QueryListPage ref="queryListPage" :pager-config="pagerConfig" :query-form="queryForm" :query-list="queryList"></QueryListPage>
|
||||
<el-dialog :title="this.$t('approval.explanation')" :visible.sync="dialogFormVisible" v-dialogDrag>
|
||||
<!--<el-input type="textarea"
|
||||
:rows="2"
|
||||
:placeholder="this.$t('rules.enterRejectReason')"
|
||||
@focus="inputFocus"
|
||||
@blur="inputBlur"
|
||||
v-model="textarea"></el-input>
|
||||
<span v-show="needReason" style="color: red">{{'*'+$t('rules.enterRejectReason')}}</span>-->
|
||||
<data-form ref="dataform" :form="form" :form-model="formModel" :rules="rules" />
|
||||
<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>
|
||||
<div>
|
||||
<QueryListPage ref="queryListPage" :pager-config="pagerConfig" :query-form="queryForm" :query-list="queryList" />
|
||||
<el-dialog v-dialogDrag :title="this.$t('approval.explanation')" :visible.sync="dialogFormVisible">
|
||||
<data-form ref="dataform" :form="form" :form-model="formModel" :rules="rules" />
|
||||
<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" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {adminPublishLesson,rejectedLessonRelease,reviewLessonList} from '@/api/designPlatform';
|
||||
import { listPublishMap } from '@/api/jmap/map';
|
||||
import LessonDetail from './detail';
|
||||
import {adminPublishLesson, rejectedLessonRelease, reviewLessonList} from '@/api/designPlatform';
|
||||
import { listPublishMap } from '@/api/jmap/map';
|
||||
import LessonDetail from './detail';
|
||||
|
||||
export default {
|
||||
name: 'LessonApproval',
|
||||
components: {
|
||||
LessonDetail
|
||||
},
|
||||
data() {
|
||||
return{
|
||||
dialogFormVisible: false,
|
||||
rejectId: '',
|
||||
formModel: {
|
||||
explanation: ''
|
||||
},
|
||||
mapList: [],
|
||||
pagerConfig: {
|
||||
pageSize: 'pageSize',
|
||||
pageIndex: 'pageNum'
|
||||
},
|
||||
queryForm: {
|
||||
labelWidth: '120px',
|
||||
reset: true,
|
||||
queryObject: {
|
||||
mapId: {
|
||||
type: 'select',
|
||||
label: this.$t('approval.map')+this.$t('global.colon'),
|
||||
config: {
|
||||
data: []
|
||||
}
|
||||
},
|
||||
lessonName: {
|
||||
type: 'text',
|
||||
label: this.$t('lesson.courseName')
|
||||
},
|
||||
userName: {
|
||||
type: 'text',
|
||||
label: this.$t('approval.applicant')+this.$t('global.colon'),
|
||||
}
|
||||
}
|
||||
},
|
||||
queryList: {
|
||||
query: reviewLessonList,
|
||||
selectCheckShow: false,
|
||||
indexShow: true,
|
||||
columns: [
|
||||
{
|
||||
title: this.$t('lesson.courseName'),
|
||||
prop: 'name'
|
||||
},
|
||||
{
|
||||
title: this.$t('approval.map'),
|
||||
prop: 'mapId ',
|
||||
type: 'tag',
|
||||
columnValue: (row) => { return this.$convertField(row.mapId , this.mapList, ['value', 'label']); },
|
||||
tagType: (row) => { return ''; }
|
||||
},
|
||||
{
|
||||
title: this.$t('approval.courseDescription'),
|
||||
prop: 'remarks'
|
||||
},
|
||||
{
|
||||
title: this.$t('approval.applicant'),
|
||||
prop: 'userName'
|
||||
},
|
||||
{
|
||||
title: this.$t('approval.applyTime'),
|
||||
prop: 'uploadTime',
|
||||
type: 'tag',
|
||||
columnValue: (row) => { return this.handleTime(row.uploadTime)},
|
||||
tagType: (row) => { return ''; }
|
||||
},
|
||||
{
|
||||
type: 'button',
|
||||
title: this.$t('global.operate'),
|
||||
width: '250',
|
||||
buttons: [
|
||||
{
|
||||
name: this.$t('approval.lookOver'),
|
||||
handleClick: this.goDetail,
|
||||
type: ''
|
||||
},
|
||||
{
|
||||
name: this.$t('approval.applyPassed'),
|
||||
handleClick: this.pass,
|
||||
type: ''
|
||||
},
|
||||
{
|
||||
name: this.$t('approval.applyReject'),
|
||||
handleClick: this.noPass,
|
||||
type: ''
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
form :{
|
||||
labelWidth: '150px',
|
||||
items: [
|
||||
{ prop: 'explanation', label: this.$t('approval.explanation'), type: 'textarea', required: true},
|
||||
]
|
||||
},
|
||||
rules :{
|
||||
explanation: [
|
||||
{ required: true, message: this.$t('rules.enterRejectReason'), trigger: 'blur' }
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
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(){
|
||||
export default {
|
||||
name: 'LessonApproval',
|
||||
components: {
|
||||
LessonDetail
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogFormVisible: false,
|
||||
rejectId: '',
|
||||
formModel: {
|
||||
explanation: ''
|
||||
},
|
||||
mapList: [],
|
||||
pagerConfig: {
|
||||
pageSize: 'pageSize',
|
||||
pageIndex: 'pageNum'
|
||||
},
|
||||
queryForm: {
|
||||
labelWidth: '120px',
|
||||
reset: true,
|
||||
queryObject: {
|
||||
mapId: {
|
||||
type: 'select',
|
||||
label: this.$t('approval.map')+this.$t('global.colon'),
|
||||
config: {
|
||||
data: []
|
||||
}
|
||||
},
|
||||
lessonName: {
|
||||
type: 'text',
|
||||
label: this.$t('lesson.courseName')
|
||||
},
|
||||
userName: {
|
||||
type: 'text',
|
||||
label: this.$t('approval.applicant')+this.$t('global.colon')
|
||||
}
|
||||
}
|
||||
},
|
||||
queryList: {
|
||||
query: reviewLessonList,
|
||||
selectCheckShow: false,
|
||||
indexShow: true,
|
||||
columns: [
|
||||
{
|
||||
title: this.$t('lesson.courseName'),
|
||||
prop: 'name'
|
||||
},
|
||||
{
|
||||
title: this.$t('approval.map'),
|
||||
prop: 'mapId ',
|
||||
type: 'tag',
|
||||
columnValue: (row) => { return this.$convertField(row.mapId, this.mapList, ['value', 'label']); },
|
||||
tagType: (row) => { return ''; }
|
||||
},
|
||||
{
|
||||
title: this.$t('approval.courseDescription'),
|
||||
prop: 'remarks'
|
||||
},
|
||||
{
|
||||
title: this.$t('approval.applicant'),
|
||||
prop: 'userName'
|
||||
},
|
||||
{
|
||||
title: this.$t('approval.applyTime'),
|
||||
prop: 'uploadTime',
|
||||
type: 'tag',
|
||||
columnValue: (row) => { return this.handleTime(row.uploadTime); },
|
||||
tagType: (row) => { return ''; }
|
||||
},
|
||||
{
|
||||
type: 'button',
|
||||
title: this.$t('global.operate'),
|
||||
width: '400',
|
||||
buttons: [
|
||||
{
|
||||
name: this.$t('approval.lookOver'),
|
||||
handleClick: this.goDetail,
|
||||
type: ''
|
||||
},
|
||||
{
|
||||
name: this.$t('approval.applyPassed'),
|
||||
handleClick: this.pass,
|
||||
type: ''
|
||||
},
|
||||
{
|
||||
name: this.$t('approval.applyReject'),
|
||||
handleClick: this.noPass,
|
||||
type: ''
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
form: {
|
||||
labelWidth: '150px',
|
||||
items: [
|
||||
{ prop: 'explanation', label: this.$t('approval.explanation'), type: 'textarea', required: true}
|
||||
]
|
||||
},
|
||||
rules: {
|
||||
explanation: [
|
||||
{ required: true, message: this.$t('rules.enterRejectReason'), trigger: 'blur' }
|
||||
]
|
||||
}
|
||||
};
|
||||
},
|
||||
watch: {
|
||||
|
||||
},
|
||||
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: {
|
||||
goDetail(index,row) {
|
||||
this.$refs.lessonDetail.show(row.id);
|
||||
},
|
||||
pass(index,row) {
|
||||
this.$confirm(this.$t('tip.publishTheCourseHint'), this.$t('global.tips'), {
|
||||
confirmButtonText: this.$t('global.confirm'),
|
||||
cancelButtonText: this.$t('global.cancel'),
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
const params = {
|
||||
cityCode: row.cityCode,
|
||||
mapId: row.mapId,
|
||||
name: row.name,
|
||||
prdCode: row.prdCode
|
||||
};
|
||||
adminPublishLesson(params,row.id).then(response => {
|
||||
this.loading = false;
|
||||
this.$message.success(this.$t('tip.coursePublishSuccessful'));
|
||||
this.doClose();
|
||||
}).catch(error => {
|
||||
this.loading = false;
|
||||
this.$messageBox(this.$t('tip.coursePublishFailed'));
|
||||
})
|
||||
});
|
||||
},
|
||||
noPass(index,row) {
|
||||
this.dialogFormVisible = true;
|
||||
this.rejectId = row.id;
|
||||
},
|
||||
handleTime(time) {
|
||||
let timeList = time.split("T");
|
||||
return timeList[0] + ' ' +timeList[1];
|
||||
},
|
||||
doClose() {
|
||||
this.$refs.queryListPage.refresh(true);
|
||||
},
|
||||
rejectConfirm() {
|
||||
this.$refs.dataform.validateForm(() => {
|
||||
if (this.rejectId){
|
||||
rejectedLessonRelease(this.formModel,this.rejectId).then(resp =>{
|
||||
this.loading = false;
|
||||
this.$message.success(this.$t('tip.rejectedCourseReleaseApplicationSuccessful'));
|
||||
this.dialogFormVisible = false;
|
||||
this.rejectId = '';
|
||||
this.doClose();
|
||||
}).catch(error => {
|
||||
this.loading = false;
|
||||
this.$messageBox(this.$t('tip.rejectedCourseReleaseApplicationSuccessful'));
|
||||
this.dialogFormVisible = false;
|
||||
this.rejectId = '';
|
||||
this.doClose();
|
||||
})
|
||||
}
|
||||
});
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
goDetail(index, row) {
|
||||
this.$refs.lessonDetail.show(row.id);
|
||||
},
|
||||
pass(index, row) {
|
||||
this.$confirm(this.$t('tip.publishTheCourseHint'), this.$t('global.tips'), {
|
||||
confirmButtonText: this.$t('global.confirm'),
|
||||
cancelButtonText: this.$t('global.cancel'),
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
const params = {
|
||||
cityCode: row.cityCode,
|
||||
mapId: row.mapId,
|
||||
name: row.name,
|
||||
prdCode: row.prdCode
|
||||
};
|
||||
adminPublishLesson(params, row.id).then(response => {
|
||||
this.loading = false;
|
||||
this.$message.success(this.$t('tip.coursePublishSuccessful'));
|
||||
this.doClose();
|
||||
}).catch(() => {
|
||||
this.loading = false;
|
||||
this.$messageBox(this.$t('tip.coursePublishFailed'));
|
||||
});
|
||||
});
|
||||
},
|
||||
noPass(index, row) {
|
||||
this.dialogFormVisible = true;
|
||||
this.rejectId = row.id;
|
||||
},
|
||||
handleTime(time) {
|
||||
const timeList = time.split('T');
|
||||
return timeList[0] + ' ' +timeList[1];
|
||||
},
|
||||
doClose() {
|
||||
this.$refs.queryListPage.refresh(true);
|
||||
},
|
||||
rejectConfirm() {
|
||||
this.$refs.dataform.validateForm(() => {
|
||||
if (this.rejectId) {
|
||||
rejectedLessonRelease(this.formModel, this.rejectId).then(resp =>{
|
||||
this.loading = false;
|
||||
this.$message.success(this.$t('tip.rejectedCourseReleaseApplicationSuccessful'));
|
||||
this.dialogFormVisible = false;
|
||||
this.rejectId = '';
|
||||
this.doClose();
|
||||
}).catch(() => {
|
||||
this.loading = false;
|
||||
this.$messageBox(this.$t('tip.rejectedCourseReleaseApplicationSuccessful'));
|
||||
this.dialogFormVisible = false;
|
||||
this.rejectId = '';
|
||||
this.doClose();
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
rejectCancel() {
|
||||
this.dialogFormVisible = false;
|
||||
this.rejectId = '';
|
||||
this.textarea = '';
|
||||
}
|
||||
}
|
||||
}
|
||||
rejectCancel() {
|
||||
this.dialogFormVisible = false;
|
||||
this.rejectId = '';
|
||||
this.textarea = '';
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
/deep/
|
||||
.el-row .el-button+.el-button{
|
||||
margin-top: 10px;
|
||||
}
|
||||
</style>
|
||||
|
@ -10,7 +10,9 @@
|
||||
<script>
|
||||
import RunPlanOperate from './operate';
|
||||
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 { UrlConfig } from '@/router/index';
|
||||
export default {
|
||||
@ -24,22 +26,23 @@
|
||||
pageSize: 'pageSize',
|
||||
pageIndex: 'pageNum'
|
||||
},
|
||||
skinList:[],
|
||||
queryForm: {
|
||||
labelWidth: '100px',
|
||||
labelWidth: '150px',
|
||||
reset: true,
|
||||
queryObject: {
|
||||
mapId: {
|
||||
type: 'select',
|
||||
label: this.$t('approval.map'),
|
||||
label: this.$t('approval.skin'),
|
||||
config: {
|
||||
data: []
|
||||
}
|
||||
},
|
||||
'scriptName':{
|
||||
'name':{
|
||||
type: 'text',
|
||||
label: this.$t('approval.runPlanName')
|
||||
},
|
||||
'userName': {
|
||||
'creatorName': {
|
||||
type: 'text',
|
||||
label: this.$t('approval.applicant')
|
||||
}
|
||||
@ -57,16 +60,16 @@
|
||||
prop: 'name'
|
||||
},
|
||||
{
|
||||
title: this.$t('approval.map'),
|
||||
title: this.$t('approval.skin'),
|
||||
prop: 'mapId ',
|
||||
width:250,
|
||||
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 ''; }
|
||||
},
|
||||
{
|
||||
title: this.$t('approval.applicant'),
|
||||
prop: 'userName'
|
||||
prop: 'creatorName'
|
||||
},
|
||||
{
|
||||
title: this.$t('approval.applyTime'),
|
||||
@ -124,11 +127,11 @@
|
||||
async loadInitData() {
|
||||
try {
|
||||
// 获取地图
|
||||
this.mapList = [];
|
||||
const res = await listPublishMap();
|
||||
this.skinList = [];
|
||||
const res = await getSkinCodeList();
|
||||
res.data.forEach(elem => {
|
||||
this.queryForm.queryObject.mapId.config.data.push({ value: elem.id, label: elem.name });
|
||||
this.mapList.push({ value: elem.id, label: elem.name });
|
||||
this.queryForm.queryObject.mapId.config.data.push({ value: elem.code, label: elem.name });
|
||||
this.skinList.push({ value: elem.code, label: elem.name });
|
||||
});
|
||||
} catch (error) {
|
||||
console.error(error, '获取发布地图');
|
||||
|
@ -1,8 +1,6 @@
|
||||
<template>
|
||||
<div>
|
||||
<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>
|
||||
</div>
|
||||
@ -37,7 +35,7 @@
|
||||
data: []
|
||||
}
|
||||
},
|
||||
'scriptName':{
|
||||
'name':{
|
||||
type: 'text',
|
||||
label: this.$t('approval.scriptName')
|
||||
},
|
||||
@ -168,6 +166,20 @@
|
||||
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>
|
||||
<style lang="scss" scoped>
|
||||
/deep/
|
||||
.el-row .el-button+.el-button{
|
||||
margin-top: 10px;
|
||||
}
|
||||
</style>
|
||||
|
@ -20,7 +20,8 @@
|
||||
<span
|
||||
class="el-icon-tickets"
|
||||
:style="{color: data.valid ? 'green':''}"
|
||||
> {{ tnode.label }}</span>
|
||||
></span>
|
||||
<span> {{ tnode.label }}</span>
|
||||
</span>
|
||||
</el-tree>
|
||||
</el-scrollbar>
|
||||
|
@ -17,7 +17,8 @@
|
||||
<span
|
||||
class="el-icon-tickets"
|
||||
:style="{color: data.valid ? 'green':''}"
|
||||
> {{ tnode.label }}</span>
|
||||
></span>
|
||||
<span> {{ tnode.label }}</span>
|
||||
</span>
|
||||
</el-tree>
|
||||
</el-scrollbar>
|
||||
|
@ -1,29 +1,29 @@
|
||||
<template>
|
||||
<el-card>
|
||||
<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 style="margin:50px" :style="{ height: height - 150 +'px' }">
|
||||
<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>
|
||||
</p>
|
||||
<p class="list-item">
|
||||
<span class="list-label">{{this.$t('exam.maximumTimeToCompleteThisQuestion')}}:</span>
|
||||
<span class="list-elem">{{ courseModel.maxDuration | setTime }}{{this.$t('global.second')}} </span>
|
||||
<span class="list-label">{{ this.$t('exam.maximumTimeToCompleteThisQuestion') }}:</span>
|
||||
<span class="list-elem">{{ courseModel.maxDuration | setTime }}{{ this.$t('global.second') }} </span>
|
||||
</p>
|
||||
<p class="list-item">
|
||||
<span class="list-label">{{this.$t('exam.theBestTimeToCompleteTheQuestion')}}:</span>
|
||||
<span class="list-elem">{{ courseModel.minDuration | setTime }}{{this.$t('global.second')}}</span>
|
||||
<span class="list-label">{{ this.$t('exam.theBestTimeToCompleteTheQuestion') }}:</span>
|
||||
<span class="list-elem">{{ courseModel.minDuration | setTime }}{{ this.$t('global.second') }}</span>
|
||||
</p>
|
||||
<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>
|
||||
</p>
|
||||
<p>
|
||||
<span class="list-label" />
|
||||
<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="primary" @click="start">{{ this.$t('exam.startTheExam') }}</el-button>
|
||||
<el-button :loading="loading" type="danger" @click="back">{{ this.$t('exam.giveUpTheExam') }}</el-button>
|
||||
</p>
|
||||
</div>
|
||||
</el-card>
|
||||
@ -105,7 +105,7 @@ export default {
|
||||
}).then(() => {
|
||||
// 放弃试卷接口
|
||||
setExamGive(this.$route.query.userExamId).then(() => {
|
||||
this.$router.back();
|
||||
this.$router.back();
|
||||
});
|
||||
}).catch(() => {
|
||||
this.loading = false;
|
||||
|
@ -2,7 +2,7 @@
|
||||
<div style="height: 100%; padding-bottom: 20px">
|
||||
<el-card>
|
||||
<div slot="header" style="text-align: center;">
|
||||
<b>考试系统</b>
|
||||
<b>{{ $t('global.examSystem') }}</b>
|
||||
</div>
|
||||
</el-card>
|
||||
<el-card v-loading="loading">
|
||||
@ -13,19 +13,19 @@
|
||||
>
|
||||
<el-table-column
|
||||
prop="name"
|
||||
label="课程"
|
||||
:label="this.$t('exam.courseName')"
|
||||
/>
|
||||
<el-table-column
|
||||
prop="remarks"
|
||||
show-overflow-tooltip
|
||||
label="说明"
|
||||
:label="this.$t('exam.courseDescription')"
|
||||
/>
|
||||
<el-table-column
|
||||
label="操作"
|
||||
:label="this.$t('global.operate')"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<el-button size="mini" type="primary" @click="goLesson(scope.row)">
|
||||
进入考试
|
||||
{{ $t('exam.enterTheExam') }}
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
@ -63,7 +63,7 @@ export default {
|
||||
this.tableData = resp.data.lessonList;
|
||||
}
|
||||
}).catch(()=>{
|
||||
this.$messageBox('获取考试信息失败!');
|
||||
this.$messageBox(this.$t('error.obtainCourseInformationFailed'));
|
||||
});
|
||||
}
|
||||
},
|
||||
|
@ -5,22 +5,25 @@
|
||||
</div>
|
||||
<div style="display: flex;align-items:flex-start">
|
||||
<div class="tree_box">
|
||||
<el-scrollbar wrap-class="scrollbar-wrapper" :style="{ height: (height-50) +'px' }">
|
||||
<el-tree
|
||||
ref="tree"
|
||||
style="width: 380px"
|
||||
:data="treeList"
|
||||
node-key="id"
|
||||
:props="defaultProps"
|
||||
default-expand-all
|
||||
highlight-current
|
||||
:span="22"
|
||||
:filter-node-method="filterNode"
|
||||
:default-expanded-keys="expandList"
|
||||
@node-contextmenu="showContextMenu"
|
||||
@node-click="clickEvent"
|
||||
/>
|
||||
</el-scrollbar>
|
||||
<div style="border: 2px dashed #B0C4DE">
|
||||
<p>{{ this.$t('lesson.courseTree') }}</p>
|
||||
<el-scrollbar wrap-class="scrollbar-wrapper" :style="{ height: (height-80) +'px' }">
|
||||
<el-tree
|
||||
ref="tree"
|
||||
style="width: 370px"
|
||||
:data="treeList"
|
||||
node-key="id"
|
||||
:props="defaultProps"
|
||||
default-expand-all
|
||||
highlight-current
|
||||
:span="22"
|
||||
:filter-node-method="filterNode"
|
||||
:default-expanded-keys="expandList"
|
||||
@node-contextmenu="showContextMenu"
|
||||
@node-click="clickEvent"
|
||||
/>
|
||||
</el-scrollbar>
|
||||
</div>
|
||||
</div>
|
||||
<transition>
|
||||
<router-view @refresh="refresh" />
|
||||
@ -136,7 +139,8 @@ export default {
|
||||
position: relative;
|
||||
left: 10px;
|
||||
width: 400px;
|
||||
padding-right: 10px;
|
||||
padding-right: 20px;
|
||||
padding-top: 20px;
|
||||
}
|
||||
.right_box{
|
||||
}
|
||||
|
@ -2,93 +2,14 @@
|
||||
<div style="height: 100%; overflow: hidden">
|
||||
<el-card>
|
||||
<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="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="lessonCreate">{{ $t('lesson.newConstruction') }}</el-button>
|
||||
</div>
|
||||
</el-card>
|
||||
<el-card v-loading="loading">
|
||||
<!--<el-table-->
|
||||
<!--:data="tableData"-->
|
||||
<!--row-key="id"-->
|
||||
<!--border-->
|
||||
<!--default-expand-all-->
|
||||
<!--:tree-props="{children: 'children', hasChildren: 'hasChildren'}"-->
|
||||
<!-->-->
|
||||
<!--<el-table-column-->
|
||||
<!--prop="name"-->
|
||||
<!--border-->
|
||||
<!--:label="this.$t('lesson.lesson')"-->
|
||||
<!--/>-->
|
||||
<!--<el-table-column-->
|
||||
<!--:label="this.$t('global.status')"-->
|
||||
<!-->-->
|
||||
<!--<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')"-->
|
||||
<!-->-->
|
||||
<!--<template slot-scope="scope">-->
|
||||
<!--<el-button-->
|
||||
<!--v-if="scope.row.status!=='1'"-->
|
||||
<!--size="mini"-->
|
||||
<!--type="primary"-->
|
||||
<!--@click="createChapter(scope.row)"-->
|
||||
<!-->{{ 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)"-->
|
||||
<!-->-->
|
||||
<!--{{ $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)"-->
|
||||
<!-->{{ $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)"-->
|
||||
<!-->{{ $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)"-->
|
||||
<!-->{{ 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)"-->
|
||||
<!-->{{ $t('global.delete') }}</el-button>-->
|
||||
<!--<el-button-->
|
||||
<!--v-if="scope.row.status ==='1'"-->
|
||||
<!--size="mini"-->
|
||||
<!--type="danger"-->
|
||||
<!--@click="revertLesson(scope.row)"-->
|
||||
<!-->-->
|
||||
<!--{{ $t('lesson.withdraw') }}-->
|
||||
<!--</el-button>-->
|
||||
<!--</template>-->
|
||||
<!--</el-table-column>-->
|
||||
<!--</el-table>-->
|
||||
<QueryListPage ref="queryListPage" :query-form="queryForm" :pager-config="pagerConfig" :query-list="queryList" />
|
||||
</el-card>
|
||||
<publish-create ref="publishCreate" @refresh="refresh" />
|
||||
@ -132,15 +53,15 @@ export default {
|
||||
indexShow: true,
|
||||
columns: [
|
||||
{
|
||||
title: '课程名称',
|
||||
title: this.$t('lesson.courseName'),
|
||||
prop: 'name'
|
||||
},
|
||||
{
|
||||
title: '课程说明',
|
||||
title: this.$t('lesson.courseDescription'),
|
||||
prop: 'remarks'
|
||||
},
|
||||
{
|
||||
title: '状态',
|
||||
title: this.$t('global.status'),
|
||||
prop: 'status',
|
||||
type: 'tag',
|
||||
columnValue: (row) => {
|
||||
@ -149,7 +70,7 @@ export default {
|
||||
tagType: (row) => { return 'success'; }
|
||||
},
|
||||
{
|
||||
title: '驳回说明',
|
||||
title: this.$t('lesson.explanation'),
|
||||
prop: 'explanation'
|
||||
},
|
||||
{
|
||||
@ -157,6 +78,14 @@ export default {
|
||||
title: this.$t('global.operate'),
|
||||
width: '400',
|
||||
buttons: [
|
||||
{
|
||||
name: this.$t('lesson.courseDetails'),
|
||||
handleClick: this.goDetail,
|
||||
type: 'primary',
|
||||
showControl: (row) => {
|
||||
return row.status !=='1';
|
||||
}
|
||||
},
|
||||
{
|
||||
name: this.$t('lesson.contentSorting'),
|
||||
handleClick: this.treeSort,
|
||||
@ -204,20 +133,9 @@ export default {
|
||||
showControl: (row) => {
|
||||
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);
|
||||
},
|
||||
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() {
|
||||
this.$nextTick(() => {
|
||||
@ -309,6 +227,7 @@ export default {
|
||||
this.$message.success(this.$t('tip.successfullyDelete'));
|
||||
this.loading = true;
|
||||
this.refresh();
|
||||
this.loading = false;
|
||||
}).catch(() => {
|
||||
this.$messageBox(this.$t('tip.failDelete'));
|
||||
});
|
||||
|
@ -7,7 +7,7 @@
|
||||
<el-card class="forms">
|
||||
<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-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-form-item>
|
||||
<el-form-item :label="this.$t('lesson.parentChapter')" prop="parentName">
|
||||
|
@ -7,7 +7,7 @@
|
||||
<el-card class="forms">
|
||||
<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-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-form-item>
|
||||
<el-form-item :label="this.$t('lesson.associatedSkin')" prop="skinCode">
|
||||
@ -30,7 +30,7 @@
|
||||
/>
|
||||
</el-select>
|
||||
</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
|
||||
v-model="courseModel.remarks"
|
||||
type="textarea"
|
||||
|
@ -9,16 +9,6 @@
|
||||
label-width="140px"
|
||||
@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-input v-model="editModel.name" :disabled="!this.hasRelease" />
|
||||
</el-form-item>
|
||||
@ -33,7 +23,6 @@
|
||||
|
||||
<script>
|
||||
import { getPublishMapListBySkinCode } from '@/api/jmap/map';
|
||||
import { getLessonNameByMapIdAndLessonId } from '@/api/jmap/lessondraft';
|
||||
import { adminPublishLesson, releaseOrCancel } from '@/api/designPlatform';
|
||||
|
||||
export default {
|
||||
@ -78,16 +67,6 @@ export default {
|
||||
}
|
||||
},
|
||||
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) {
|
||||
this.mapList = [];
|
||||
this.cityList = [];
|
||||
|
@ -29,24 +29,23 @@ export default {
|
||||
menu: [],
|
||||
menuChapte: [
|
||||
{
|
||||
label: '更新章节',
|
||||
label: this.$t('lesson.updateChapter'),
|
||||
handler: this.updateChapter
|
||||
},
|
||||
{
|
||||
label: '创建章节',
|
||||
label: this.$t('lesson.createChapter'),
|
||||
handler: this.createChapterInChapter
|
||||
}
|
||||
],
|
||||
menuLesson: [
|
||||
{
|
||||
label: '创建章节',
|
||||
handler: this.createChapter
|
||||
label: this.$t('lesson.editCourse'),
|
||||
handler: this.editLesson
|
||||
},
|
||||
{
|
||||
label: '编辑课程',
|
||||
handler: this.editLesson
|
||||
label: this.$t('lesson.createChapter'),
|
||||
handler: this.createChapter
|
||||
}
|
||||
|
||||
]
|
||||
};
|
||||
},
|
||||
|
@ -35,7 +35,7 @@
|
||||
<span class="svg-container svg-container_login">
|
||||
<svg-icon icon-class="user" />
|
||||
</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 prop="password" class="item_form_box item_form_password">
|
||||
<span class="svg-container">
|
||||
@ -46,17 +46,18 @@
|
||||
name="password"
|
||||
:type="pwdType"
|
||||
placeholder="密码"
|
||||
@keyup.enter="handleLogin"
|
||||
ref="password"
|
||||
@keyup.enter.native="handleLogin"
|
||||
/>
|
||||
<span class="show-pwd" @click="showPwd">
|
||||
<svg-icon icon-class="eye" v-if="pwdDisplay"/>
|
||||
<svg-icon icon-class="eye-open" v-else/>
|
||||
<svg-icon v-if="pwdDisplay" icon-class="eye" />
|
||||
<svg-icon v-else icon-class="eye-open" />
|
||||
</span>
|
||||
</el-form-item>
|
||||
<div class="tip-message">{{ tipsMsg }}</div>
|
||||
<div style="display: inline-block;width: 100%;margin-bottom: 10px;">
|
||||
<div style="display:inline-block">
|
||||
<el-checkbox v-model="isAutoLogin">自动登录</el-checkbox>
|
||||
<el-checkbox v-model="isAutoLogin">自动登录</el-checkbox>
|
||||
</div>
|
||||
<el-popover
|
||||
placement="right"
|
||||
@ -72,19 +73,6 @@
|
||||
<div slot="reference">无法登录?</div>
|
||||
</el-popover>
|
||||
</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-button type="primary" style="width:100%;" :loading="loading" @click.native.prevent="handleLogin">
|
||||
登录
|
||||
@ -100,8 +88,6 @@
|
||||
// import md5 from 'js-md5';
|
||||
import QCode from '@/assets/erCode.jpg';
|
||||
import { removeSessionStorage } from '@/utils/auth';
|
||||
import { UrlConfig } from '@/router/index';
|
||||
import localStore from 'storejs';
|
||||
import Cookies from 'js-cookie';
|
||||
import md5 from 'js-md5';
|
||||
import QrcodeVue from 'qrcode.vue';
|
||||
@ -110,6 +96,7 @@ import { LoginParams } from '@/utils/login';
|
||||
import bgImg from '@/assets/bg1.jpg';
|
||||
import { setToken } from '@/utils/auth';
|
||||
import { loginTitle } from '@/scripts/ConstDic';
|
||||
import { removeToken, removeDesignToken} from '@/utils/auth';
|
||||
|
||||
export default {
|
||||
name: 'Login',
|
||||
@ -131,14 +118,14 @@ export default {
|
||||
};
|
||||
return {
|
||||
bgImg: bgImg,
|
||||
QCode: QCode,
|
||||
isAutoLogin:false,
|
||||
QCode: QCode,
|
||||
isAutoLogin: false,
|
||||
loginForm: {
|
||||
username: '',
|
||||
password: ''
|
||||
},
|
||||
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 }]
|
||||
},
|
||||
loading: false,
|
||||
@ -150,8 +137,8 @@ export default {
|
||||
loadingCode: false,
|
||||
checkLogin: null,
|
||||
checkTimeout: null,
|
||||
scanSuccess: false,
|
||||
pwdDisplay:true
|
||||
scanSuccess: false,
|
||||
pwdDisplay: true
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
@ -165,23 +152,29 @@ export default {
|
||||
mounted() {
|
||||
document.title = loginTitle[this.$route.params.project||'default'];
|
||||
this.loginRefresh();
|
||||
},
|
||||
beforeCreate(){
|
||||
if(Cookies.get('UserName')&&Cookies.get('UserToken')){
|
||||
const model = {'username':Cookies.get('UserName'),'password':Cookies.get('UserToken')};
|
||||
model.type = 'class';
|
||||
model.project = this.$route.params.project;
|
||||
removeSessionStorage('againEnter');
|
||||
this.$store.dispatch('Login', model).then(() => {
|
||||
this.$store.dispatch('SetAccount', model.username);
|
||||
this.handleLoginSucessRoute();
|
||||
}).catch(error => {
|
||||
this.tipsMsg = error.message;
|
||||
this.loading = false;
|
||||
setTimeout(() => { this.tipsMsg = ''; }, 5000);
|
||||
});
|
||||
}
|
||||
},
|
||||
},
|
||||
beforeCreate() {
|
||||
removeToken();
|
||||
removeDesignToken();
|
||||
if (Cookies.get('UserName')&&Cookies.get('UserToken')) {
|
||||
const model = {'username': Cookies.get('UserName'), 'password': Cookies.get('UserToken')};
|
||||
model.type = 'class';
|
||||
model.project = this.$route.params.project;
|
||||
this.$store.dispatch('Login', model).then(() => {
|
||||
this.$store.dispatch('SetAccount', model.username);
|
||||
this.handleLoginSucessRoute();
|
||||
}).catch(error => {
|
||||
if(error.code=='30001'){
|
||||
this.tipsMsg = '账号或密码不正确!';
|
||||
}
|
||||
else{
|
||||
this.tipsMsg = error.message;
|
||||
}
|
||||
this.loading = false;
|
||||
setTimeout(() => { this.tipsMsg = ''; }, 5000);
|
||||
});
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
clearTimer(timer) {
|
||||
if (timer) {
|
||||
@ -224,8 +217,8 @@ export default {
|
||||
// 设置扫码登录
|
||||
self.$store.dispatch('QrLoginSetting', { key: 'SET_TOKEN', value: response.data.token }).then(() => {
|
||||
// 清除定时器,设置路由
|
||||
self.clearTimer(self.checkLogin);
|
||||
this.handleLoginSucessRoute();
|
||||
self.clearTimer(self.checkLogin);
|
||||
this.handleLoginSucessRoute();
|
||||
});
|
||||
}).catch(error => {
|
||||
if (error.data && error.data.status == '1') {
|
||||
@ -236,14 +229,21 @@ export default {
|
||||
}, 3000);
|
||||
},
|
||||
showPwd() {
|
||||
if (this.pwdType === 'password') {
|
||||
this.pwdDisplay=false;
|
||||
if (this.pwdType === 'password') {
|
||||
this.pwdDisplay=false;
|
||||
this.pwdType = '';
|
||||
} else {
|
||||
this.pwdType = 'password';
|
||||
this.pwdDisplay=true;
|
||||
this.pwdType = 'password';
|
||||
this.pwdDisplay=true;
|
||||
}
|
||||
},
|
||||
},
|
||||
goToNext(){
|
||||
if (this.loginForm.username.length < 5) {
|
||||
return;
|
||||
}else{
|
||||
this.$refs['password'].focus();
|
||||
}
|
||||
},
|
||||
handleLogin() {
|
||||
this.$refs.loginForm.validate(valid => {
|
||||
if (valid) {
|
||||
@ -251,17 +251,21 @@ export default {
|
||||
model.password = md5(model.password);
|
||||
model.type = 'class';
|
||||
model.project = this.$route.params.project;
|
||||
this.loading = true;
|
||||
if(this.isAutoLogin){
|
||||
Cookies.set('UserName', model.username, { expires: 2});
|
||||
Cookies.set('UserToken', model.password, { expires: 2});
|
||||
}
|
||||
removeSessionStorage('againEnter');
|
||||
this.loading = true;
|
||||
if (this.isAutoLogin) {
|
||||
Cookies.set('UserName', model.username, { expires: 2});
|
||||
Cookies.set('UserToken', model.password, { expires: 2});
|
||||
}
|
||||
this.$store.dispatch('Login', model).then(() => {
|
||||
this.$store.dispatch('SetAccount', model.username);
|
||||
this.handleLoginSucessRoute();
|
||||
this.$store.dispatch('SetAccount', model.username);
|
||||
this.handleLoginSucessRoute();
|
||||
}).catch(error => {
|
||||
this.tipsMsg = error.message;
|
||||
if(error.code=='30001'){
|
||||
this.tipsMsg = '账号或密码不正确!';
|
||||
}
|
||||
else{
|
||||
this.tipsMsg = error.message;
|
||||
}
|
||||
this.loading = false;
|
||||
setTimeout(() => { this.tipsMsg = ''; }, 5000);
|
||||
});
|
||||
@ -271,17 +275,18 @@ export default {
|
||||
}
|
||||
});
|
||||
},
|
||||
handleLoginSucessRoute() {
|
||||
// 设置路由
|
||||
this.loading = false;
|
||||
this.tipsMsg = '';
|
||||
const path = UrlConfig.trainingPlatform.trainingPlatformHome;
|
||||
this.$nextTick(() => {
|
||||
this.$i18n.locale = 'zh';
|
||||
Cookies.set('user_lang', 'zh');
|
||||
});
|
||||
this.$router.push({ path: path });
|
||||
}
|
||||
handleLoginSucessRoute() {
|
||||
// 设置路由
|
||||
this.loading = false;
|
||||
this.tipsMsg = '';
|
||||
removeSessionStorage('againEnter');
|
||||
const path = '/trainingPlatform';
|
||||
this.$nextTick(() => {
|
||||
this.$i18n.locale = 'zh';
|
||||
Cookies.set('user_lang', 'zh');
|
||||
});
|
||||
this.$router.push({ path: path });
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
@ -34,7 +34,7 @@
|
||||
<span class="svg-container svg-container_login">
|
||||
<svg-icon icon-class="user" />
|
||||
</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 prop="password" class="item_form_box item_form_password">
|
||||
<span class="svg-container">
|
||||
@ -45,17 +45,18 @@
|
||||
name="password"
|
||||
:type="pwdType"
|
||||
placeholder="密码"
|
||||
@keyup.enter="handleLogin"
|
||||
ref="password"
|
||||
@keyup.enter.native="handleLogin"
|
||||
/>
|
||||
<span class="show-pwd" @click="showPwd">
|
||||
<svg-icon icon-class="eye" v-if="pwdDisplay"/>
|
||||
<svg-icon icon-class="eye-open" v-else/>
|
||||
<svg-icon v-if="pwdDisplay" icon-class="eye" />
|
||||
<svg-icon v-else icon-class="eye-open" />
|
||||
</span>
|
||||
</el-form-item>
|
||||
<div class="tip-message">{{ tipsMsg }}</div>
|
||||
<div style="display: inline-block;width: 100%;margin-bottom: 10px;">
|
||||
<div style="display:inline-block">
|
||||
<el-checkbox v-model="isAutoLogin">自动登录</el-checkbox>
|
||||
<el-checkbox v-model="isAutoLogin">自动登录</el-checkbox>
|
||||
</div>
|
||||
<el-popover
|
||||
placement="right"
|
||||
@ -93,6 +94,7 @@ import { LoginParams } from '@/utils/login';
|
||||
import bgImg from '@/assets/bg1.jpg';
|
||||
import { setDesignToken } from '@/utils/auth';
|
||||
import QCode from '@/assets/erCode.jpg';
|
||||
import { removeToken, removeDesignToken} from '@/utils/auth';
|
||||
|
||||
export default {
|
||||
name: 'LoginDesign',
|
||||
@ -113,19 +115,19 @@ export default {
|
||||
}
|
||||
};
|
||||
return {
|
||||
bgImg: bgImg,
|
||||
isAutoLogin:false,
|
||||
bgImg: bgImg,
|
||||
isAutoLogin: false,
|
||||
loginForm: {
|
||||
username: '',
|
||||
password: ''
|
||||
},
|
||||
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 }]
|
||||
},
|
||||
loading: false,
|
||||
pwdType: 'password',
|
||||
QCode: QCode,
|
||||
pwdType: 'password',
|
||||
QCode: QCode,
|
||||
tipsMsg: '',
|
||||
qrcodeClassName: 'login-qrcode',
|
||||
sessionId: '',
|
||||
@ -133,27 +135,34 @@ export default {
|
||||
loadingCode: false,
|
||||
checkLogin: null,
|
||||
checkTimeout: null,
|
||||
scanSuccess: false,
|
||||
pwdDisplay:true
|
||||
scanSuccess: false,
|
||||
pwdDisplay: true
|
||||
};
|
||||
},
|
||||
beforeCreate(){
|
||||
if(Cookies.get('UserDesignName')&&Cookies.get('UserDesignToken')){
|
||||
const model = {'username':Cookies.get('UserDesignName'),'password':Cookies.get('UserDesignToken')};
|
||||
model.type = 'design';
|
||||
this.$store.dispatch('Login', model).then(() => {
|
||||
removeSessionStorage('design');
|
||||
setSessionStorage('design', true);
|
||||
this.handleLoginSucessRoute();
|
||||
}).catch(error => {
|
||||
},
|
||||
beforeCreate() {
|
||||
removeToken();
|
||||
removeDesignToken();
|
||||
if (Cookies.get('UserDesignName')&&Cookies.get('UserDesignToken')) {
|
||||
const model = {'username': Cookies.get('UserDesignName'), 'password': Cookies.get('UserDesignToken')};
|
||||
model.type = 'design';
|
||||
this.$store.dispatch('Login', model).then(() => {
|
||||
removeSessionStorage('design');
|
||||
setSessionStorage('design', true);
|
||||
this.handleLoginSucessRoute();
|
||||
}).catch(error => {
|
||||
if(error.code=='30001'){
|
||||
this.tipsMsg = '账号或密码不正确!';
|
||||
}
|
||||
else{
|
||||
this.tipsMsg = error.message;
|
||||
this.loading = false;
|
||||
setTimeout(() => { this.tipsMsg = ''; }, 5000);
|
||||
});
|
||||
}
|
||||
},
|
||||
}
|
||||
this.loading = false;
|
||||
setTimeout(() => { this.tipsMsg = ''; }, 5000);
|
||||
});
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
document.title = '城市轨道交通设计平台';
|
||||
document.title = '城市轨道交通设计平台';
|
||||
this.loginRefresh();
|
||||
},
|
||||
methods: {
|
||||
@ -162,9 +171,16 @@ export default {
|
||||
clearTimeout(timer);
|
||||
timer = null;
|
||||
}
|
||||
},
|
||||
judgeAutoLogin(){
|
||||
},
|
||||
judgeAutoLogin() {
|
||||
|
||||
},
|
||||
goToNext(){
|
||||
if (this.loginForm.username.length < 5) {
|
||||
return;
|
||||
}else{
|
||||
this.$refs['password'].focus();
|
||||
}
|
||||
},
|
||||
loginRefresh() {
|
||||
this.loadingCode = true;
|
||||
@ -194,18 +210,18 @@ export default {
|
||||
|
||||
// 清空已存在的定时器
|
||||
// 设置定时器检测
|
||||
this.clearTimer(this.checkLogin);
|
||||
this.clearTimer(this.checkLogin);
|
||||
this.checkLogin = setTimeout(() => {
|
||||
checkLoginStatus(self.sessionId).then(response => {
|
||||
setDesignToken(response.data.token);
|
||||
// 设置扫码登录
|
||||
self.$store.dispatch('QrLoginSetting', { key: 'SET_TOKENDESIGN', value: response.data.token }).then(() => {
|
||||
// 清除定时器,设置路由
|
||||
self.clearTimer(self.checkLogin);
|
||||
removeSessionStorage('design');
|
||||
// 设置扫码登录
|
||||
self.$store.dispatch('QrLoginSetting', { key: 'SET_TOKENDESIGN', value: response.data.token }).then(() => {
|
||||
// 清除定时器,设置路由
|
||||
self.clearTimer(self.checkLogin);
|
||||
removeSessionStorage('design');
|
||||
setSessionStorage('design', true);
|
||||
this.handleLoginSucessRoute();
|
||||
});
|
||||
this.handleLoginSucessRoute();
|
||||
});
|
||||
}).catch(error => {
|
||||
if (error.data && error.data.status == '1') {
|
||||
self.scanSuccess = true;
|
||||
@ -216,33 +232,38 @@ export default {
|
||||
},
|
||||
showPwd() {
|
||||
if (this.pwdType === 'password') {
|
||||
this.pwdDisplay=false;
|
||||
this.pwdDisplay=false;
|
||||
this.pwdType = '';
|
||||
} else {
|
||||
this.pwdType = 'password';
|
||||
this.pwdDisplay=true;
|
||||
this.pwdType = 'password';
|
||||
this.pwdDisplay=true;
|
||||
}
|
||||
},
|
||||
handleLogin() {
|
||||
this.$refs.loginForm.validate(valid => {
|
||||
if (valid) {
|
||||
const model = Object.assign({}, this.loginForm);
|
||||
model.password = md5(model.password);
|
||||
const model = Object.assign({}, this.loginForm);
|
||||
model.password = md5(model.password);
|
||||
|
||||
if(this.isAutoLogin){
|
||||
Cookies.set('UserDesignName', model.username, { expires: 2});
|
||||
Cookies.set('UserDesignToken', model.password, { expires: 2});
|
||||
}
|
||||
if (this.isAutoLogin) {
|
||||
Cookies.set('UserDesignName', model.username, { expires: 2});
|
||||
Cookies.set('UserDesignToken', model.password, { expires: 2});
|
||||
}
|
||||
// model.type = 'plan';
|
||||
model.type = 'design';
|
||||
model.type = 'design';
|
||||
|
||||
this.loading = true;
|
||||
|
||||
this.$store.dispatch('Login', model).then(() => {
|
||||
this.$store.dispatch('SetAccount', model.username);
|
||||
this.handleLoginSucessRoute();
|
||||
this.$store.dispatch('Login', model).then(() => {
|
||||
this.$store.dispatch('SetAccount', model.username);
|
||||
this.handleLoginSucessRoute();
|
||||
}).catch(error => {
|
||||
this.tipsMsg = error.message;
|
||||
if(error.code=='30001'){
|
||||
this.tipsMsg = '账号或密码不正确!';
|
||||
}
|
||||
else{
|
||||
this.tipsMsg = error.message;
|
||||
}
|
||||
this.loading = false;
|
||||
setTimeout(() => { this.tipsMsg = ''; }, 5000);
|
||||
});
|
||||
@ -252,18 +273,19 @@ export default {
|
||||
return false;
|
||||
}
|
||||
});
|
||||
},
|
||||
handleLoginSucessRoute() {
|
||||
// 设置路由
|
||||
this.loading = false;
|
||||
this.tipsMsg = '';
|
||||
const path = UrlConfig.design.prefix;
|
||||
this.$nextTick(() => {
|
||||
this.$i18n.locale = 'zh';
|
||||
Cookies.set('user_lang', 'zh');
|
||||
});
|
||||
this.$router.push({ path: path });
|
||||
}
|
||||
},
|
||||
handleLoginSucessRoute() {
|
||||
// 设置路由
|
||||
this.loading = false;
|
||||
this.tipsMsg = '';
|
||||
removeSessionStorage('againEnter');
|
||||
const path = UrlConfig.design.prefix;
|
||||
this.$nextTick(() => {
|
||||
this.$i18n.locale = 'zh';
|
||||
Cookies.set('user_lang', 'zh');
|
||||
});
|
||||
this.$router.push({ path: path });
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
@ -36,7 +36,7 @@
|
||||
<span class="svg-container svg-container_login">
|
||||
<svg-icon icon-class="user" />
|
||||
</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 prop="password" class="item_form_box item_form_password">
|
||||
<span class="svg-container">
|
||||
@ -47,7 +47,8 @@
|
||||
name="password"
|
||||
:type="pwdType"
|
||||
placeholder="password"
|
||||
@keyup.enter="handleLogin"
|
||||
ref="password"
|
||||
@keyup.enter.native="handleLogin"
|
||||
/>
|
||||
<span class="show-pwd" @click="showPwd">
|
||||
<svg-icon icon-class="eye" />
|
||||
@ -56,7 +57,7 @@
|
||||
<div class="tip-message">{{ tipsMsg }}</div>
|
||||
<div style="display: inline-block;width: 100%;margin-bottom: 10px;">
|
||||
<div style="display:inline-block">
|
||||
<el-checkbox v-model="isAutoLogin">Auto Login</el-checkbox>
|
||||
<el-checkbox v-model="isAutoLogin">Auto Login</el-checkbox>
|
||||
</div>
|
||||
<el-popover
|
||||
placement="right"
|
||||
@ -72,19 +73,6 @@
|
||||
<div slot="reference">unable to login?</div>
|
||||
</el-popover>
|
||||
</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-button type="primary" style="width:100%;" :loading="loading" @click.native.prevent="handleLogin">
|
||||
login
|
||||
@ -99,8 +87,6 @@
|
||||
<script>
|
||||
import QCode from '@/assets/erCode.jpg';
|
||||
import { removeSessionStorage } from '@/utils/auth';
|
||||
import { UrlConfig } from '@/router/index';
|
||||
import localStore from 'storejs';
|
||||
import Cookies from 'js-cookie';
|
||||
import md5 from 'js-md5';
|
||||
import QrcodeVue from 'qrcode.vue';
|
||||
@ -109,9 +95,10 @@ import { LoginParams } from '@/utils/login';
|
||||
import bgImg from '@/assets/bg1.jpg';
|
||||
import { setToken } from '@/utils/auth';
|
||||
import { loginTitle } from '@/scripts/ConstDic';
|
||||
import { removeToken, removeDesignToken} from '@/utils/auth';
|
||||
|
||||
export default {
|
||||
name: 'Login',
|
||||
name: 'LoginEn',
|
||||
components: { QrcodeVue },
|
||||
data() {
|
||||
const validateUsername = (rule, value, callback) => {
|
||||
@ -129,15 +116,15 @@ export default {
|
||||
}
|
||||
};
|
||||
return {
|
||||
QCode: QCode,
|
||||
isAutoLogin:false,
|
||||
QCode: QCode,
|
||||
isAutoLogin: false,
|
||||
bgImg: bgImg,
|
||||
loginForm: {
|
||||
username: '',
|
||||
password: ''
|
||||
},
|
||||
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 }]
|
||||
},
|
||||
loading: false,
|
||||
@ -159,35 +146,29 @@ export default {
|
||||
title() {
|
||||
return loginTitle[this.$route.params.project||'default'];
|
||||
}
|
||||
},
|
||||
beforeCreate(){
|
||||
if(Cookies.get('UserName')&&Cookies.get('UserToken')){
|
||||
const model = {'username':Cookies.get('UserName'),'password':Cookies.get('UserToken')};
|
||||
model.type = 'class';
|
||||
model.project = this.$route.params.project;
|
||||
removeSessionStorage('againEnter');
|
||||
this.$store.dispatch('Login', model).then(() => {
|
||||
this.$store.dispatch('SetAccount', model.username);
|
||||
this.handleLoginSucessRoute();
|
||||
// // 设置路由
|
||||
// this.loading = false;
|
||||
// this.tipsMsg = '';
|
||||
// // let path = localStore.get('trainingPlatformRoute'+model.username);
|
||||
// // if (!path || !path.startsWith('/trainingPlatform')) {
|
||||
// path = UrlConfig.trainingPlatform.trainingPlatformHome;
|
||||
// // }
|
||||
// this.$nextTick(() => {
|
||||
// this.$i18n.locale = 'en';
|
||||
// Cookies.set('user_lang', 'en');
|
||||
// });
|
||||
// this.$router.push({ path: path });
|
||||
}).catch(error => {
|
||||
this.tipsMsg = error.message;
|
||||
this.loading = false;
|
||||
setTimeout(() => { this.tipsMsg = ''; }, 5000);
|
||||
});
|
||||
}
|
||||
},
|
||||
},
|
||||
beforeCreate() {
|
||||
removeToken();
|
||||
removeDesignToken();
|
||||
if (Cookies.get('UserName')&&Cookies.get('UserToken')) {
|
||||
const model = {'username': Cookies.get('UserName'), 'password': Cookies.get('UserToken')};
|
||||
model.type = 'class';
|
||||
model.project = this.$route.params.project;
|
||||
this.$store.dispatch('Login', model).then(() => {
|
||||
this.$store.dispatch('SetAccount', model.username);
|
||||
this.handleLoginSucessRoute();
|
||||
}).catch(error => {
|
||||
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() {
|
||||
document.title = loginTitle[this.$route.params.project||'default'];
|
||||
this.loginRefresh();
|
||||
@ -234,17 +215,8 @@ export default {
|
||||
// 设置扫码登录
|
||||
self.$store.dispatch('QrLoginSetting', { key: 'SET_TOKEN', value: response.data.token }).then(() => {
|
||||
// 清除定时器,设置路由
|
||||
self.clearTimer(self.checkLogin);
|
||||
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');
|
||||
// });
|
||||
self.clearTimer(self.checkLogin);
|
||||
this.handleLoginSucessRoute();
|
||||
});
|
||||
}).catch(error => {
|
||||
if (error.data && error.data.status == '1') {
|
||||
@ -260,7 +232,14 @@ export default {
|
||||
} else {
|
||||
this.pwdType = 'password';
|
||||
}
|
||||
},
|
||||
},
|
||||
goToNext(){
|
||||
if (this.loginForm.username.length < 5) {
|
||||
return;
|
||||
}else{
|
||||
this.$refs['password'].focus();
|
||||
}
|
||||
},
|
||||
handleLogin() {
|
||||
this.$refs.loginForm.validate(valid => {
|
||||
if (valid) {
|
||||
@ -269,17 +248,20 @@ export default {
|
||||
model.type = 'class';
|
||||
model.project = this.$route.params.project;
|
||||
this.loading = true;
|
||||
if(this.isAutoLogin){
|
||||
Cookies.set('UserName', model.username, { expires: 2});
|
||||
Cookies.set('UserToken', model.password, { expires: 2});
|
||||
}
|
||||
removeSessionStorage('againEnter');
|
||||
|
||||
this.$store.dispatch('Login', model).then(() => {
|
||||
this.$store.dispatch('SetAccount', model.username);
|
||||
this.handleLoginSucessRoute();
|
||||
if (this.isAutoLogin) {
|
||||
Cookies.set('UserName', model.username, { expires: 2});
|
||||
Cookies.set('UserToken', model.password, { expires: 2});
|
||||
}
|
||||
this.$store.dispatch('Login', model).then(() => {
|
||||
this.$store.dispatch('SetAccount', model.username);
|
||||
this.handleLoginSucessRoute();
|
||||
}).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;
|
||||
setTimeout(() => { this.tipsMsg = ''; }, 5000);
|
||||
});
|
||||
@ -288,18 +270,19 @@ export default {
|
||||
return false;
|
||||
}
|
||||
});
|
||||
},
|
||||
handleLoginSucessRoute() {
|
||||
// 设置路由
|
||||
this.loading = false;
|
||||
this.tipsMsg = '';
|
||||
const path = UrlConfig.trainingPlatform.trainingPlatformHome;
|
||||
this.$nextTick(() => {
|
||||
this.$i18n.locale = 'en';
|
||||
Cookies.set('user_lang', 'en');
|
||||
});
|
||||
this.$router.push({ path: path });
|
||||
}
|
||||
},
|
||||
handleLoginSucessRoute() {
|
||||
// 设置路由
|
||||
this.loading = false;
|
||||
this.tipsMsg = '';
|
||||
removeSessionStorage('againEnter');
|
||||
const path = '/trainingPlatform';
|
||||
this.$nextTick(() => {
|
||||
this.$i18n.locale = 'en';
|
||||
Cookies.set('user_lang', 'en');
|
||||
});
|
||||
this.$router.push({ path: path });
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
@ -34,7 +34,7 @@
|
||||
<span class="svg-container svg-container_login">
|
||||
<svg-icon icon-class="user" />
|
||||
</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 prop="password" class="item_form_box item_form_password">
|
||||
<span class="svg-container">
|
||||
@ -45,7 +45,8 @@
|
||||
name="password"
|
||||
:type="pwdType"
|
||||
placeholder="password"
|
||||
@keyup.enter="handleLogin"
|
||||
ref="password"
|
||||
@keyup.enter.native="handleLogin"
|
||||
/>
|
||||
<span class="show-pwd" @click="showPwd">
|
||||
<svg-icon icon-class="eye" />
|
||||
@ -54,7 +55,7 @@
|
||||
<div class="tip-message">{{ tipsMsg }}</div>
|
||||
<div style="display: inline-block;width: 100%;margin-bottom: 10px;">
|
||||
<div style="display:inline-block">
|
||||
<el-checkbox v-model="isAutoLogin">Auto Login</el-checkbox>
|
||||
<el-checkbox v-model="isAutoLogin">Auto Login</el-checkbox>
|
||||
</div>
|
||||
<el-popover
|
||||
placement="right"
|
||||
@ -70,19 +71,6 @@
|
||||
<div slot="reference">unable to login?</div>
|
||||
</el-popover>
|
||||
</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-button type="primary" style="width:100%;" :loading="loading" @click.native.prevent="handleLogin">
|
||||
login
|
||||
@ -104,9 +92,10 @@ import { getLoginWmurl, checkLoginStatus } from '@/api/login';
|
||||
import { LoginParams } from '@/utils/login';
|
||||
import bgImg from '@/assets/bg1.jpg';
|
||||
import { setDesignToken } from '@/utils/auth';
|
||||
import { removeToken, removeDesignToken} from '@/utils/auth';
|
||||
|
||||
export default {
|
||||
name: 'LoginDesign',
|
||||
name: 'LoginEnDesign',
|
||||
components: { QrcodeVue },
|
||||
data() {
|
||||
const validateUsername = (rule, value, callback) => {
|
||||
@ -124,15 +113,15 @@ export default {
|
||||
}
|
||||
};
|
||||
return {
|
||||
QCode:QCode,
|
||||
isAutoLogin:false,
|
||||
QCode: QCode,
|
||||
isAutoLogin: false,
|
||||
bgImg: bgImg,
|
||||
loginForm: {
|
||||
username: '',
|
||||
password: ''
|
||||
},
|
||||
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 }]
|
||||
},
|
||||
loading: false,
|
||||
@ -146,22 +135,29 @@ export default {
|
||||
checkTimeout: null,
|
||||
scanSuccess: false
|
||||
};
|
||||
},
|
||||
beforeCreate(){
|
||||
if(Cookies.get('UserDesignName')&&Cookies.get('UserDesignToken')){
|
||||
const model = {'username':Cookies.get('UserDesignName'),'password':Cookies.get('UserDesignToken')};
|
||||
model.type = 'design';
|
||||
this.$store.dispatch('Login', model).then(() => {
|
||||
removeSessionStorage('design');
|
||||
setSessionStorage('design', true);
|
||||
this.handleLoginSucessRoute();
|
||||
}).catch(error => {
|
||||
this.tipsMsg = error.message;
|
||||
this.loading = false;
|
||||
setTimeout(() => { this.tipsMsg = ''; }, 5000);
|
||||
});
|
||||
}
|
||||
},
|
||||
},
|
||||
beforeCreate() {
|
||||
removeToken();
|
||||
removeDesignToken();
|
||||
if (Cookies.get('UserDesignName')&&Cookies.get('UserDesignToken')) {
|
||||
const model = {'username': Cookies.get('UserDesignName'), 'password': Cookies.get('UserDesignToken')};
|
||||
model.type = 'design';
|
||||
this.$store.dispatch('Login', model).then(() => {
|
||||
removeSessionStorage('design');
|
||||
setSessionStorage('design', true);
|
||||
this.handleLoginSucessRoute();
|
||||
}).catch(error => {
|
||||
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() {
|
||||
document.title = '城市轨道交通设计平台';
|
||||
this.loginRefresh();
|
||||
@ -208,16 +204,10 @@ export default {
|
||||
// 设置扫码登录
|
||||
self.$store.dispatch('QrLoginSetting', { key: 'SET_TOKENDESIGN', value: response.data.token }).then(() => {
|
||||
// 清除定时器,设置路由
|
||||
self.clearTimer(self.checkLogin);
|
||||
removeSessionStorage('design');
|
||||
self.clearTimer(self.checkLogin);
|
||||
removeSessionStorage('design');
|
||||
setSessionStorage('design', true);
|
||||
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');
|
||||
// });
|
||||
this.handleLoginSucessRoute();
|
||||
});
|
||||
}).catch(error => {
|
||||
if (error.data && error.data.status == '1') {
|
||||
@ -240,35 +230,25 @@ export default {
|
||||
const model = Object.assign({}, this.loginForm);
|
||||
model.password = md5(model.password);
|
||||
// model.type = 'plan';
|
||||
model.type = 'design';
|
||||
model.type = 'design';
|
||||
|
||||
if(this.isAutoLogin){
|
||||
Cookies.set('UserDesignName', model.username, { expires: 2});
|
||||
Cookies.set('UserDesignToken', model.password, { expires: 2});
|
||||
}
|
||||
if (this.isAutoLogin) {
|
||||
Cookies.set('UserDesignName', model.username, { expires: 2});
|
||||
Cookies.set('UserDesignToken', model.password, { expires: 2});
|
||||
}
|
||||
|
||||
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('SetAccount', model.username);
|
||||
this.handleLoginSucessRoute();
|
||||
this.$store.dispatch('Login', model).then(() => {
|
||||
this.$store.dispatch('SetAccount', model.username);
|
||||
this.handleLoginSucessRoute();
|
||||
}).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;
|
||||
setTimeout(() => { this.tipsMsg = ''; }, 5000);
|
||||
});
|
||||
@ -279,17 +259,25 @@ export default {
|
||||
}
|
||||
});
|
||||
},
|
||||
handleLoginSucessRoute() {
|
||||
// 设置路由
|
||||
this.loading = false;
|
||||
this.tipsMsg = '';
|
||||
const path = UrlConfig.design.prefix;
|
||||
this.$nextTick(() => {
|
||||
this.$i18n.locale = 'en';
|
||||
Cookies.set('user_lang', 'en');
|
||||
});
|
||||
this.$router.push({ path: path });
|
||||
}
|
||||
goToNext(){
|
||||
if (this.loginForm.username.length < 5) {
|
||||
return;
|
||||
}else{
|
||||
this.$refs['password'].focus();
|
||||
}
|
||||
},
|
||||
handleLoginSucessRoute() {
|
||||
// 设置路由
|
||||
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>
|
||||
|
@ -6,7 +6,7 @@
|
||||
</div>
|
||||
<!-- <map-create ref="mapCreate" :skin-code="skinCode" @refresh="refresh" @editmap="handleNodeClick" /> -->
|
||||
<div class="map-draft">
|
||||
<div v-show="viewDraft==='draft'">
|
||||
<div v-show="viewDraft === 'draft'">
|
||||
<map-operate
|
||||
ref="mapOperate"
|
||||
:card-height="cardHeight"
|
||||
@ -46,13 +46,13 @@
|
||||
</transition>
|
||||
</template>
|
||||
<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 { checkLoginLine } from '@/api/login';
|
||||
import JlmapVisual from '@/views/jlmap/index';
|
||||
import MapOperate from './mapoperate/index';
|
||||
import { EventBus } from '@/scripts/event-bus';
|
||||
import MapCreate from '../mapmanage/create';
|
||||
// import MapCreate from '../mapmanage/create';
|
||||
|
||||
import ConfigMap from './configMap';
|
||||
|
||||
@ -64,8 +64,8 @@ export default {
|
||||
JlmapVisual,
|
||||
MapOperate,
|
||||
DataRelation,
|
||||
ConfigMap,
|
||||
// MapCreate,
|
||||
ConfigMap
|
||||
// MapCreate,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
@ -303,38 +303,38 @@ export default {
|
||||
setCenter(code) {
|
||||
this.$refs.jlmapVisual.setCenter(code);
|
||||
},
|
||||
createMap() {
|
||||
this.$refs.mapCreate.show();
|
||||
},
|
||||
importf() {
|
||||
const loading = this.$loading({
|
||||
lock: true,
|
||||
text: '正在导入中...',
|
||||
spinner: 'el-icon-loading',
|
||||
background: 'rgba(0, 0, 0, 0.7)'
|
||||
});
|
||||
setTimeout(() => {
|
||||
const obj = this.$refs.files;
|
||||
if (!obj.files) return;
|
||||
const f = obj.files[0];
|
||||
const reader = new FileReader();
|
||||
const that = this;
|
||||
reader.readAsText(f, 'utf-8');
|
||||
reader.onload = function(e) {
|
||||
const data = e.target.result;
|
||||
postBuildMapImport(JSON.parse(data)).then(res => {
|
||||
loading.close();
|
||||
that.$message.success('导入成功!');
|
||||
that.refresh();
|
||||
loading.close();
|
||||
}).catch(error => {
|
||||
loading.close();
|
||||
that.$message.error('导入失败' + error.message);
|
||||
});
|
||||
obj.value = '';
|
||||
};
|
||||
});
|
||||
}
|
||||
createMap() {
|
||||
this.$refs.mapCreate.show();
|
||||
},
|
||||
importf() {
|
||||
const loading = this.$loading({
|
||||
lock: true,
|
||||
text: '正在导入中...',
|
||||
spinner: 'el-icon-loading',
|
||||
background: 'rgba(0, 0, 0, 0.7)'
|
||||
});
|
||||
setTimeout(() => {
|
||||
const obj = this.$refs.files;
|
||||
if (!obj.files) return;
|
||||
const f = obj.files[0];
|
||||
const reader = new FileReader();
|
||||
const that = this;
|
||||
reader.readAsText(f, 'utf-8');
|
||||
reader.onload = function(e) {
|
||||
const data = e.target.result;
|
||||
postBuildMapImport(JSON.parse(data)).then(res => {
|
||||
loading.close();
|
||||
that.$message.success('导入成功!');
|
||||
that.refresh();
|
||||
loading.close();
|
||||
}).catch(error => {
|
||||
loading.close();
|
||||
that.$message.error('导入失败' + error.message);
|
||||
});
|
||||
obj.value = '';
|
||||
};
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
@ -7,30 +7,10 @@
|
||||
{{ $t('map.mapName') }}
|
||||
<b>{{ mapInfo.name }}</b>
|
||||
</span>
|
||||
<el-button
|
||||
v-if="isSave"
|
||||
type="text"
|
||||
style="float: right; padding: 3px 0"
|
||||
: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>
|
||||
<el-button v-if="isSave" type="text" style="float: right; padding: 3px 0" :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>
|
||||
<el-tabs v-model="enabledTab" class="mapEdit" type="card">
|
||||
<el-tab-pane :label="$t('map.link')" name="Link">
|
||||
|
@ -146,8 +146,8 @@ export default {
|
||||
props: {
|
||||
selected: {
|
||||
type: Object,
|
||||
default: function () {
|
||||
return null;
|
||||
default() {
|
||||
return {};
|
||||
}
|
||||
},
|
||||
cardHeight: {
|
||||
@ -497,7 +497,7 @@ export default {
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
selected(val, oldVal) {
|
||||
selected(val) {
|
||||
this.deviceSelect(val);
|
||||
}
|
||||
},
|
||||
@ -540,9 +540,9 @@ export default {
|
||||
},
|
||||
deviceSelect(selected) {
|
||||
if (!this.fieldS) { // 判断是否激活选择站台
|
||||
this.editModel.points = [];
|
||||
if (selected && selected._type.toUpperCase() === 'Section'.toUpperCase()) {
|
||||
this.$refs.dataform.resetFields();
|
||||
this.editModel.points = [];
|
||||
this.activeName = 'first';
|
||||
this.editModel = deepAssign(this.editModel, selected);
|
||||
this.editModel.logicSectionNum = selected.type === '01' ? selected.logicSectionNum : [0];
|
||||
|
@ -11,7 +11,7 @@
|
||||
size="mini"
|
||||
@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-form-item>
|
||||
<el-form-item :label="this.$t('orderAuthor.describtion')" prop="remarks">
|
||||
|
@ -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>
|
@ -44,7 +44,7 @@
|
||||
<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="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>
|
||||
</el-card>
|
||||
</template>
|
||||
|
@ -2,7 +2,7 @@
|
||||
<div style="height: 100%; padding-bottom: 20px;">
|
||||
<el-card>
|
||||
<div slot="header" style="text-align: center;">
|
||||
<b>教学系统</b>
|
||||
<b>{{ $t('global.lessonSystem') }}</b>
|
||||
</div>
|
||||
</el-card>
|
||||
<el-card v-loading="loading">
|
||||
@ -13,19 +13,19 @@
|
||||
>
|
||||
<el-table-column
|
||||
prop="name"
|
||||
label="课程"
|
||||
:label="this.$t('teach.courseName')"
|
||||
/>
|
||||
<el-table-column
|
||||
prop="remarks"
|
||||
show-overflow-tooltip
|
||||
label="说明"
|
||||
:label="this.$t('teach.courseDescription')"
|
||||
/>
|
||||
<el-table-column
|
||||
label="操作"
|
||||
:label="this.$t('global.operate')"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<el-button size="mini" type="primary" @click="goLesson(scope.row)">
|
||||
进入课程
|
||||
{{ $t('teach.enterTheCourse') }}
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
@ -63,7 +63,7 @@ export default {
|
||||
this.tableData = resp.data.lessonList;
|
||||
}
|
||||
}).catch(()=>{
|
||||
this.$messageBox('获取课程信息失败!');
|
||||
this.$messageBox(this.$t('error.obtainCourseInformationFailed'));
|
||||
});
|
||||
}
|
||||
},
|
||||
|
@ -173,35 +173,40 @@
|
||||
<el-button icon="el-icon-plus" circle plain @click="addingRoles('bigScreen', '增加大屏')" />
|
||||
</div>
|
||||
</div>
|
||||
<!--<div class="Scheduling">-->
|
||||
<!--<p class="title">真实设备-<span>{{hasPlc?'[PLC网关在线]':'[PLC网关离线]'}}</span></p>-->
|
||||
<!--<ul>-->
|
||||
<!--<li v-for="(nor, index) in stationStandList" :key="index" class="selectPerson">-->
|
||||
<!--<span>{{ realDeviceType[nor.deviceType] }}</span>-->
|
||||
<!--<div style="float: right; margin-right: 15px;">-->
|
||||
<!--<el-select-->
|
||||
<!--v-model="nor.deviceCode"-->
|
||||
<!--:placeholder="$t('global.choose')"-->
|
||||
<!--size="mini"-->
|
||||
<!--:disabled="userId != roomInfo.creatorId"-->
|
||||
<!--@change="handleChangeDevice(nor, doorList, stationStandList)"-->
|
||||
<!-->-->
|
||||
<!--<el-option-->
|
||||
<!--v-for="item in doorList"-->
|
||||
<!--:key="item.code"-->
|
||||
<!--:label="item.name"-->
|
||||
<!--:value="item.code"-->
|
||||
<!--:disabled="item.disabled"-->
|
||||
<!--style="margin-left: 10px"-->
|
||||
<!--/>-->
|
||||
<!--</el-select>-->
|
||||
<!--</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 class="Scheduling">
|
||||
<p class="title">{{ $t('trainRoom.realDevice') }}-<span>{{ hasPlc?$t('trainRoom.plcGatewayOnline'):$t('trainRoom.plcGatewayOffline') }}</span></p>
|
||||
<ul>
|
||||
<li v-for="(nor, index) in stationStandList" :key="index" class="selectPerson">
|
||||
<span>{{ realDeviceType[nor.deviceType] }}</span>
|
||||
<i
|
||||
v-if="userId == roomInfo.creatorId"
|
||||
class="el-icon-close delPerson"
|
||||
@click="handleDelDevice(nor)"
|
||||
/>
|
||||
<div style="float: right; margin-right: 15px;">
|
||||
<el-select
|
||||
v-model="nor.deviceCode"
|
||||
:placeholder="$t('global.choose')"
|
||||
size="mini"
|
||||
:disabled="userId != roomInfo.creatorId"
|
||||
@change="handleChangeDevice(nor, doorList, stationStandList)"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in doorList"
|
||||
:key="item.code"
|
||||
:label="item.name"
|
||||
:value="item.code"
|
||||
:disabled="item.disabled"
|
||||
style="margin-left: 10px"
|
||||
/>
|
||||
</el-select>
|
||||
</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 class="start-box">
|
||||
@ -284,7 +289,7 @@
|
||||
</template>
|
||||
|
||||
<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 { launchFullscreen } from '@/utils/screen';
|
||||
import { DeviceMenu, RealDeviceType } from '@/scripts/ConstDic';
|
||||
@ -407,10 +412,8 @@ export default {
|
||||
await this.addPeopleList(val);
|
||||
}
|
||||
},
|
||||
'$store.state.socket.deviceInfo': async function (val) {
|
||||
if (val) { // 分配设备信息
|
||||
await this.handlerDeviceList(val);
|
||||
}
|
||||
'$store.state.socket.realDeviceInfo': async function (val) {
|
||||
await this.getDevicesList(); // 分配设备信息
|
||||
}
|
||||
},
|
||||
beforeDestroy() {
|
||||
@ -422,7 +425,8 @@ export default {
|
||||
this.userId = this.$store.state.user.id;
|
||||
this.getRoomInfo(); // 获取房间信息 info
|
||||
this.getUserList(); // 房间人员 列表
|
||||
// this.checkPlcGateway(); //PLC网关
|
||||
this.checkPlcGateway(); // PLC网关
|
||||
this.getDevicesList(); // 获取真实设备列表
|
||||
this.timeDemon = setInterval(() => {
|
||||
checkLoginLine();
|
||||
}, 5000 * 60);
|
||||
@ -622,7 +626,7 @@ export default {
|
||||
this.stationList = resp.data;
|
||||
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盘
|
||||
async getUserList() {
|
||||
@ -723,7 +727,11 @@ export default {
|
||||
this.loading = true;
|
||||
await putJointTrainingExit(this.$route.query.group);
|
||||
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) {
|
||||
this.messageInfo( this.$t('error.operationFailure'), 'error');
|
||||
}
|
||||
@ -901,7 +909,7 @@ export default {
|
||||
this.hasPlc = false;
|
||||
}
|
||||
}).catch(() => {
|
||||
this.$messageBox('查询PLC设备失败!');
|
||||
this.$messageBox(this.$t('error.inquiryPLCDeviceFailed'));
|
||||
});
|
||||
},
|
||||
handleDoorList(mapId, stationList) {
|
||||
@ -910,33 +918,48 @@ export default {
|
||||
stationList.forEach(item => {
|
||||
res.data.forEach(it =>{
|
||||
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});
|
||||
}
|
||||
});
|
||||
});
|
||||
this.doorList = doorList;
|
||||
}).catch((error) => {
|
||||
this.$messageBox('获取屏蔽门列表失败!');
|
||||
}).catch(() => {
|
||||
this.$messageBox(this.$t('error.getScreenDoorsListFailed'));
|
||||
});
|
||||
},
|
||||
addingDevice() {
|
||||
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);
|
||||
},
|
||||
handleChangeDevice(nor, doorList, stationStandList) {
|
||||
setRealDevice(this.$route.query.group, nor);
|
||||
doorList.forEach(item => {
|
||||
item.disabled = false;
|
||||
stationStandList.forEach(nor => {
|
||||
if (item.code == nor.deviceCode) {
|
||||
item.disabled = true;
|
||||
}
|
||||
});
|
||||
setRealDevice(this.$route.query.group, nor).then(resp => {
|
||||
}).catch(() => {
|
||||
this.$messageBox(this.$t('error.connectToRealDeviceFailed'));
|
||||
});
|
||||
},
|
||||
handlerDeviceList(data) {
|
||||
this.stationStandList = [data];
|
||||
getDevicesList() {
|
||||
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'));
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
|
@ -90,10 +90,6 @@ export default {
|
||||
beforeDestroy () {
|
||||
},
|
||||
mounted() {
|
||||
const path = localStore.get('trainingPlatformRoute'+ this.userId);
|
||||
if (path && path.startsWith('/trainingPlatform')) {
|
||||
this.$router.push(path);
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
filterNode(value, data) {
|
||||
@ -148,8 +144,8 @@ export default {
|
||||
// this.$router.push({ path: `${UrlConfig.trainingPlatform.runPlan}/${this.mapId}`, query: {skinCode: '02'} });
|
||||
// break;
|
||||
}
|
||||
}).catch((error) => {
|
||||
this.$messageBox('获取子系统信息失败!'+error);
|
||||
}).catch(() => {
|
||||
this.$messageBox(this.$t('systemGenerate.getSubSystemInfoFail'));
|
||||
});
|
||||
}
|
||||
},
|
||||
|
@ -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>
|
@ -42,6 +42,9 @@ export default {
|
||||
},
|
||||
width() {
|
||||
return this.$store.state.app.width;
|
||||
},
|
||||
userId() {
|
||||
return this.$store.state.user.id;
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
@ -53,6 +56,10 @@ export default {
|
||||
const againEnter = getSessionStorage('againEnter') || null;
|
||||
if (!againEnter) {
|
||||
launchFullscreen();
|
||||
const path = localStore.get('trainingPlatformRoute'+ this.userId);
|
||||
if (path && path.startsWith('/trainingPlatform')) {
|
||||
this.$router.push(path);
|
||||
}
|
||||
setSessionStorage('againEnter', true);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user