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

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

View File

@ -239,7 +239,7 @@ export function getPermissionJoint(group) {
});
}
//
// 添加或更新真实设备和仿真对象连接
export function setRealDevice(group, data) {
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'
});
}

View File

@ -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'
};

View File

@ -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!'
};

View File

@ -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'
};

View File

@ -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:'
};

View File

@ -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',

View File

@ -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'
};

View File

@ -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'
};

View File

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

View File

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

View File

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

View File

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

View File

@ -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: '课程树:'
};

View File

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

View File

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

View File

@ -157,13 +157,13 @@ export function Jl3dDriving(updatemmi,sound) {
if (trainlisttest.list[code].runMode == '02') {
if (trainlisttest.list[code].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);
}
@ -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);
if(code == drivingcode){
let nextcode;
if(code == drivingcode){
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;

View File

@ -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;
}

View File

@ -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');
}
}
};

View File

@ -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;

View File

@ -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">
@ -68,8 +68,16 @@
</el-submenu>
</template>
</template>
<quick-entry ref="quickEntry" v-if="isShow"/>
<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>
@ -91,6 +99,7 @@ export default {
routes: [],
isShow: false,
activePath: '',
isRoute: true
};
},
computed: {
@ -103,17 +112,16 @@ export default {
this.routes = this.$router.options.routes;
if (getSessionStorage('design')) {
this.isShow=false;
}
else{
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){
} 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{
} else {
this.activePath=this.$route.path;
}
},
@ -149,6 +157,12 @@ export default {
return true;
}
return false;
},
goToTraining(){
let routeData = this.$router.resolve({
path: "/",
});
window.open(routeData.href, '_blank');
}
}
};
@ -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;

View File

@ -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];

View File

@ -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,

View File

@ -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: {

View File

@ -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();
}

View File

@ -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);

View File

@ -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;

View File

@ -1,21 +1,14 @@
<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>-->
<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"></lesson-detail>
<lesson-detail ref="lessonDetail" />
</div>
</template>
@ -58,7 +51,7 @@
},
userName: {
type: 'text',
label: this.$t('approval.applicant')+this.$t('global.colon'),
label: this.$t('approval.applicant')+this.$t('global.colon')
}
}
},
@ -90,13 +83,13 @@
title: this.$t('approval.applyTime'),
prop: 'uploadTime',
type: 'tag',
columnValue: (row) => { return this.handleTime(row.uploadTime)},
columnValue: (row) => { return this.handleTime(row.uploadTime); },
tagType: (row) => { return ''; }
},
{
type: 'button',
title: this.$t('global.operate'),
width: '250',
width: '400',
buttons: [
{
name: this.$t('approval.lookOver'),
@ -120,7 +113,7 @@
form: {
labelWidth: '150px',
items: [
{ prop: 'explanation', label: this.$t('approval.explanation'), type: 'textarea', required: true},
{ prop: 'explanation', label: this.$t('approval.explanation'), type: 'textarea', required: true}
]
},
rules: {
@ -128,7 +121,10 @@
{ required: true, message: this.$t('rules.enterRejectReason'), trigger: 'blur' }
]
}
}
};
},
watch: {
},
created() {
listPublishMap().then(response=>{
@ -143,9 +139,6 @@
},
beforeDestroy() {
},
watch: {
},
methods: {
goDetail(index, row) {
@ -167,10 +160,10 @@
this.loading = false;
this.$message.success(this.$t('tip.coursePublishSuccessful'));
this.doClose();
}).catch(error => {
}).catch(() => {
this.loading = false;
this.$messageBox(this.$t('tip.coursePublishFailed'));
})
});
});
},
noPass(index, row) {
@ -178,7 +171,7 @@
this.rejectId = row.id;
},
handleTime(time) {
let timeList = time.split("T");
const timeList = time.split('T');
return timeList[0] + ' ' +timeList[1];
},
doClose() {
@ -193,13 +186,13 @@
this.dialogFormVisible = false;
this.rejectId = '';
this.doClose();
}).catch(error => {
}).catch(() => {
this.loading = false;
this.$messageBox(this.$t('tip.rejectedCourseReleaseApplicationSuccessful'));
this.dialogFormVisible = false;
this.rejectId = '';
this.doClose();
})
});
}
});
},
@ -210,5 +203,11 @@
this.textarea = '';
}
}
}
};
</script>
<style lang="scss" scoped>
/deep/
.el-row .el-button+.el-button{
margin-top: 10px;
}
</style>

View File

@ -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, '获取发布地图');

View File

@ -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>

View File

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

View File

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

View File

@ -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'));
});
}
},

View File

@ -5,10 +5,12 @@
</div>
<div style="display: flex;align-items:flex-start">
<div class="tree_box">
<el-scrollbar wrap-class="scrollbar-wrapper" :style="{ height: (height-50) +'px' }">
<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: 380px"
style="width: 370px"
:data="treeList"
node-key="id"
:props="defaultProps"
@ -22,6 +24,7 @@
/>
</el-scrollbar>
</div>
</div>
<transition>
<router-view @refresh="refresh" />
</transition>
@ -136,7 +139,8 @@ export default {
position: relative;
left: 10px;
width: 400px;
padding-right: 10px;
padding-right: 20px;
padding-top: 20px;
}
.right_box{
}

View File

@ -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'}"-->
<!--&gt;-->
<!--<el-table-column-->
<!--prop="name"-->
<!--border-->
<!--:label="this.$t('lesson.lesson')"-->
<!--/>-->
<!--<el-table-column-->
<!--:label="this.$t('global.status')"-->
<!--&gt;-->
<!--<template slot-scope="scope">-->
<!--<span>{{ handlerStatus(scope.row) }}</span>-->
<!--</template>-->
<!--</el-table-column>-->
<!--<el-table-column-->
<!--prop="explanation"-->
<!--show-overflow-tooltip-->
<!--:label="this.$t('lesson.rejectReason')"-->
<!--/>-->
<!--<el-table-column-->
<!--width="500"-->
<!--:label="this.$t('global.operate')"-->
<!--&gt;-->
<!--<template slot-scope="scope">-->
<!--<el-button-->
<!--v-if="scope.row.status!=='1'"-->
<!--size="mini"-->
<!--type="primary"-->
<!--@click="createChapter(scope.row)"-->
<!--&gt;{{ scope.row.type==='lesson'? $t('lesson.createChapter'):$t('lesson.updateChapter') }}</el-button>-->
<!--<el-button-->
<!--v-if="scope.row.status==='1'"-->
<!--size="mini"-->
<!--type="primary"-->
<!--@click="goDetail(scope.row)"-->
<!--&gt;-->
<!--{{ $t('lesson.review') }}-->
<!--</el-button>-->
<!--<el-button-->
<!--v-if="scope.row.type === 'lesson' && scope.row.status!=='1'"-->
<!--size="mini"-->
<!--type="primary"-->
<!--plain-->
<!--@click="treeSort(scope.row)"-->
<!--&gt;{{ $t('lesson.contentSorting') }}</el-button>-->
<!--<el-button-->
<!--v-if="scope.row.type === 'lesson'&& scope.row.status!=='1'"-->
<!--size="mini"-->
<!--type="info"-->
<!--@click="editLesson(scope.row)"-->
<!--&gt;{{ $t('lesson.editCourse') }}</el-button>-->
<!--<el-button-->
<!--v-if="scope.row.type === 'lesson'&& scope.row.status==='0'"-->
<!--size="mini"-->
<!--type="primary"-->
<!--@click="publish(scope.row)"-->
<!--&gt;{{ hasRelease?$t('global.release'):$t('lesson.applicationForRelease') }}</el-button>-->
<!--<el-button-->
<!--v-if="scope.row.type === 'lesson'&& scope.row.status!=='1'"-->
<!--size="mini"-->
<!--type="danger"-->
<!--@click="deleteLesson(scope.row)"-->
<!--&gt;{{ $t('global.delete') }}</el-button>-->
<!--<el-button-->
<!--v-if="scope.row.status ==='1'"-->
<!--size="mini"-->
<!--type="danger"-->
<!--@click="revertLesson(scope.row)"-->
<!--&gt;-->
<!--{{ $t('lesson.withdraw') }}-->
<!--</el-button>-->
<!--</template>-->
<!--</el-table-column>-->
<!--</el-table>-->
<QueryListPage ref="queryListPage" :query-form="queryForm" :pager-config="pagerConfig" :query-list="queryList" />
</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'));
});

View File

@ -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">

View File

@ -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"

View File

@ -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 = [];

View File

@ -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
}
]
};
},

View File

@ -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,11 +46,12 @@
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>
@ -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',
@ -138,7 +125,7 @@ export default {
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,
@ -167,16 +154,22 @@ export default {
this.loginRefresh();
},
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;
removeSessionStorage('againEnter');
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);
});
@ -243,6 +236,13 @@ export default {
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 => {
@ -256,12 +256,16 @@ export default {
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();
}).catch(error => {
if(error.code=='30001'){
this.tipsMsg = '账号或密码不正确!';
}
else{
this.tipsMsg = error.message;
}
this.loading = false;
setTimeout(() => { this.tipsMsg = ''; }, 5000);
});
@ -275,7 +279,8 @@ export default {
//
this.loading = false;
this.tipsMsg = '';
const path = UrlConfig.trainingPlatform.trainingPlatformHome;
removeSessionStorage('againEnter');
const path = '/trainingPlatform';
this.$nextTick(() => {
this.$i18n.locale = 'zh';
Cookies.set('user_lang', 'zh');

View File

@ -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,11 +45,12 @@
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>
@ -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',
@ -120,7 +122,7 @@ export default {
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,
@ -138,6 +140,8 @@ export default {
};
},
beforeCreate() {
removeToken();
removeDesignToken();
if (Cookies.get('UserDesignName')&&Cookies.get('UserDesignToken')) {
const model = {'username': Cookies.get('UserDesignName'), 'password': Cookies.get('UserDesignToken')};
model.type = 'design';
@ -146,7 +150,12 @@ export default {
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);
});
@ -165,6 +174,13 @@ export default {
},
judgeAutoLogin() {
},
goToNext(){
if (this.loginForm.username.length < 5) {
return;
}else{
this.$refs['password'].focus();
}
},
loginRefresh() {
this.loadingCode = true;
@ -242,7 +258,12 @@ export default {
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);
});
@ -257,6 +278,7 @@ export default {
//
this.loading = false;
this.tipsMsg = '';
removeSessionStorage('againEnter');
const path = UrlConfig.design.prefix;
this.$nextTick(() => {
this.$i18n.locale = 'zh';

View File

@ -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" />
@ -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) => {
@ -137,7 +124,7 @@ export default {
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,
@ -161,28 +148,22 @@ export default {
}
},
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;
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 => {
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);
});
@ -236,15 +217,6 @@ export default {
//
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');
// });
});
}).catch(error => {
if (error.data && error.data.status == '1') {
@ -260,6 +232,13 @@ 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 => {
@ -273,13 +252,16 @@ export default {
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();
}).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);
});
@ -293,7 +275,8 @@ export default {
//
this.loading = false;
this.tipsMsg = '';
const path = UrlConfig.trainingPlatform.trainingPlatformHome;
removeSessionStorage('againEnter');
const path = '/trainingPlatform';
this.$nextTick(() => {
this.$i18n.locale = 'en';
Cookies.set('user_lang', 'en');

View File

@ -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" />
@ -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) => {
@ -132,7 +121,7 @@ export default {
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,
@ -148,6 +137,8 @@ export default {
};
},
beforeCreate() {
removeToken();
removeDesignToken();
if (Cookies.get('UserDesignName')&&Cookies.get('UserDesignToken')) {
const model = {'username': Cookies.get('UserDesignName'), 'password': Cookies.get('UserDesignToken')};
model.type = 'design';
@ -156,7 +147,12 @@ export default {
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);
});
@ -212,12 +208,6 @@ export default {
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');
// });
});
}).catch(error => {
if (error.data && error.data.status == '1') {
@ -248,27 +238,17 @@ export default {
}
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();
}).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);
});
@ -278,11 +258,19 @@ export default {
return false;
}
});
},
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';

View File

@ -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,7 +64,7 @@ export default {
JlmapVisual,
MapOperate,
DataRelation,
ConfigMap,
ConfigMap
// MapCreate,
},
data() {

View File

@ -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">

View File

@ -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];

View File

@ -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">

View File

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

View File

@ -44,7 +44,7 @@
<el-button type="success" @click="buy">{{ $t('teach.buy') }}</el-button>
<el-button 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>

View File

@ -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'));
});
}
},

View File

@ -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)"-->
<!--&gt;-->
<!--<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;
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'));
});
}
}
};

View File

@ -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'));
});
}
},

View File

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

View File

@ -42,6 +42,9 @@ export default {
},
width() {
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);
}