Merge branch 'dev' of https://git.qcloud.com/joylink/jl-nclient into dev
# Conflicts: # src/layout/components/Logout.vue
This commit is contained in:
commit
dd89b94e64
@ -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!'
|
||||
};
|
||||
|
@ -118,5 +118,6 @@ export default {
|
||||
rejected: 'Rejected',
|
||||
review: 'Review',
|
||||
explanation: 'Explanation',
|
||||
courseDetails: 'Course details'
|
||||
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',
|
||||
|
@ -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: '删除真实设备失败!'
|
||||
};
|
||||
|
@ -117,6 +117,7 @@ export default {
|
||||
rejected: '已驳回',
|
||||
review: '查看',
|
||||
explanation: '驳回说明',
|
||||
courseDetails: '课程详情'
|
||||
courseDetails: '课程详情',
|
||||
courseTree: '课程树:'
|
||||
};
|
||||
|
||||
|
@ -27,5 +27,10 @@ export default {
|
||||
recording: '录音中...',
|
||||
sendText: '发送文字',
|
||||
left: '左',
|
||||
right: '右'
|
||||
right: '右',
|
||||
realDevice: '真实设备',
|
||||
plcGatewayOnline: '[PLC网关在线]',
|
||||
plcGatewayOffline: '[PLC网关离线]',
|
||||
uplinkPlatform: '上行站台',
|
||||
downlinkPlatform: '下行站台'
|
||||
};
|
||||
|
@ -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>
|
||||
|
@ -94,8 +94,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;
|
||||
|
@ -68,8 +68,15 @@
|
||||
</el-submenu>
|
||||
</template>
|
||||
</template>
|
||||
<quick-entry v-if="isShow" ref="quickEntry" />
|
||||
<user-logout ref="userLogout" />
|
||||
<div class="rightGroup">
|
||||
<quick-entry v-if="isShow" ref="quickEntry" />
|
||||
<div v-if="!isShow" class="avatar-container" @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>
|
||||
|
||||
@ -149,6 +156,12 @@ export default {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
},
|
||||
goToTraining() {
|
||||
const routeData = this.$router.resolve({
|
||||
path: '/'
|
||||
});
|
||||
window.open(routeData.href, '_blank');
|
||||
}
|
||||
}
|
||||
};
|
||||
@ -157,6 +170,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,26 +199,8 @@ export default {
|
||||
.avatar-container {
|
||||
height: $height;
|
||||
display: inline-block;
|
||||
position: absolute;
|
||||
right: 35px;
|
||||
|
||||
.avatar-wrapper {
|
||||
cursor: pointer;
|
||||
position: relative;
|
||||
|
||||
.user-avatar {
|
||||
width: 40px;
|
||||
height: 40px;
|
||||
border-radius: 10px;
|
||||
}
|
||||
|
||||
.el-icon-caret-bottom {
|
||||
position: absolute;
|
||||
right: -20px;
|
||||
top: 25px;
|
||||
font-size: 12px;
|
||||
}
|
||||
}
|
||||
position: relative;
|
||||
margin-right:10px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
@ -3,6 +3,9 @@
|
||||
<div class="main-container">
|
||||
<navbar />
|
||||
<app-main :style="{width: width+'px', height: height+'px'}" />
|
||||
<el-footer style="height:30px;text-align:right;line-height: 30px;">
|
||||
<span style="font-size:14px;">Copyright ©2018 北京玖琏科技有限公司 京ICP备18028522号</span>
|
||||
</el-footer>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
@ -37,7 +40,7 @@ export default {
|
||||
return this.$store.state.app.width;
|
||||
},
|
||||
height() {
|
||||
return this.$store.state.app.height - 60;
|
||||
return this.$store.state.app.height - 60-30;
|
||||
}
|
||||
},
|
||||
created() {
|
||||
|
@ -5,9 +5,9 @@ import NProgress from 'nprogress'; // Progress 进度条
|
||||
import 'nprogress/nprogress.css';// Progress 进度条样式
|
||||
import { admin, userDesign} from './router';
|
||||
import { getToken, getScreenToken, getDesignToken} from '@/utils/auth'; // 验权
|
||||
// getPlanToken
|
||||
import { LoginParams } from '@/utils/login';
|
||||
import { getSessionStorage } from '@/utils/auth';
|
||||
import localStore from 'storejs';
|
||||
|
||||
function hasPermission(roles, permissionRoles) {
|
||||
if (roles.indexOf(admin) >= 0) return true;
|
||||
@ -29,7 +29,6 @@ function getRouteInfo(to) {
|
||||
let getTokenInfo = () => { };
|
||||
let clientId = '';
|
||||
const toRoutePath = to.redirectedFrom || to.path;
|
||||
|
||||
if (/^\/dp/.test(toRoutePath) || /^\/display\/dp/.test(toRoutePath)) {
|
||||
loginPath = loginScreenPage;
|
||||
getTokenInfo = getScreenToken;
|
||||
@ -88,7 +87,15 @@ function handleRoute(to, from, next, routeInfo) {
|
||||
} else {
|
||||
// 除没有动态改变权限的需求可直接next() 删下方权限判断
|
||||
if (hasPermission(store.getters.roles, to.meta.roles)) {
|
||||
next();
|
||||
if (to.path==='/404' && to.redirectedFrom==='/') {
|
||||
if (getSessionStorage('design') === 'true') {
|
||||
next('/design/home');
|
||||
} else {
|
||||
next(localStore.get('trainingPlatformRoute'+store.getters.id) ||'/trainingPlatform');
|
||||
}
|
||||
} else {
|
||||
next();
|
||||
}
|
||||
} else {
|
||||
next({ path: '/401', replace: true, query: { noGoBack: true } });
|
||||
}
|
||||
|
@ -153,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',
|
||||
@ -313,6 +321,11 @@ export const constantRoutes = [
|
||||
component: Jlmap3dedit,
|
||||
hidden: true
|
||||
},
|
||||
// {
|
||||
// path: '/',
|
||||
// redirect: redirectPath,
|
||||
// hidden: true
|
||||
// },
|
||||
{
|
||||
path: '/401',
|
||||
component: Error401,
|
||||
|
@ -11,6 +11,7 @@ const getters = {
|
||||
roles: state => state.user.roles,
|
||||
canvasWidth: state => state.config.width,
|
||||
canvasHeight: state => state.config.height,
|
||||
id: state => state.user.id,
|
||||
permission_routes: state => state.permission.routes
|
||||
};
|
||||
export default getters;
|
||||
|
@ -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: {
|
||||
|
@ -3,9 +3,9 @@ export function getBaseUrl() {
|
||||
let BASE_API;
|
||||
if (process.env.NODE_ENV === 'development') {
|
||||
// BASE_API = 'https://joylink.club/jlcloud';
|
||||
BASE_API = 'https://test.joylink.club/jlcloud';
|
||||
// BASE_API = 'https://test.joylink.club/jlcloud';
|
||||
// BASE_API = 'http://192.168.3.5:9000'; // 袁琪
|
||||
// BASE_API = 'http://192.168.3.6:9000'; // 旭强
|
||||
BASE_API = 'http://192.168.3.6:9000'; // 旭强
|
||||
// BASE_API = 'http://192.168.3.41:9000'; // 王兴杰
|
||||
} 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')
|
||||
},
|
||||
@ -45,7 +43,7 @@
|
||||
type: 'text',
|
||||
label: this.$t('approval.applicant')
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
},
|
||||
queryList: {
|
||||
@ -178,4 +176,10 @@
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
</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>
|
||||
|
@ -44,7 +44,7 @@
|
||||
},
|
||||
computed: {
|
||||
height() {
|
||||
return this.$store.state.app.height - 50;
|
||||
return this.$store.state.app.height - 50-30;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
@ -40,7 +40,7 @@ export default {
|
||||
'lessonbar'
|
||||
]),
|
||||
height() {
|
||||
return this.$store.state.app.height - 50;
|
||||
return this.$store.state.app.height - 50-30;
|
||||
},
|
||||
width() {
|
||||
return this.$store.state.app.width;
|
||||
|
@ -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>
|
||||
|
@ -281,7 +281,8 @@ export default {
|
||||
}
|
||||
|
||||
.zoom-view {
|
||||
position: fixed;
|
||||
// position: fixed;
|
||||
position: absolute;
|
||||
height: 28px;
|
||||
}
|
||||
|
||||
|
@ -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,9 +2,9 @@
|
||||
<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>
|
||||
@ -78,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,
|
||||
@ -125,14 +133,6 @@ export default {
|
||||
showControl: (row) => {
|
||||
return row.status ==='1';
|
||||
}
|
||||
},
|
||||
{
|
||||
name: this.$t('lesson.courseDetails'),
|
||||
handleClick: this.goDetail,
|
||||
type: 'primary',
|
||||
showControl: (row) => {
|
||||
return row.status !=='1';
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
@ -210,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(() => {
|
||||
@ -227,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'));
|
||||
});
|
||||
|
@ -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 = [];
|
||||
|
@ -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">
|
||||
|
@ -75,7 +75,7 @@ export default {
|
||||
},
|
||||
computed: {
|
||||
height() {
|
||||
return this.$store.state.app.height - 50;
|
||||
return this.$store.state.app.height - 50-30;
|
||||
},
|
||||
skinCode() {
|
||||
return this.$route.query.skinCode || '02';
|
||||
|
@ -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>
|
@ -116,7 +116,7 @@ export default {
|
||||
},
|
||||
computed: {
|
||||
height() {
|
||||
return this.$store.state.app.height - 50;
|
||||
return this.$store.state.app.height - 50-30;
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
|
@ -174,10 +174,15 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="Scheduling">
|
||||
<p class="title">真实设备-<span>{{ hasPlc?'[PLC网关在线]':'[PLC网关离线]' }}</span></p>
|
||||
<p class="title">{{ $t('trainRoom.realDevice') }}-<span>{{ hasPlc?$t('trainRoom.plcGatewayOnline'):$t('trainRoom.plcGatewayOffline') }}</span></p>
|
||||
<ul>
|
||||
<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"
|
||||
@ -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);
|
||||
@ -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'));
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user