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

This commit is contained in:
ival 2019-08-09 15:24:05 +08:00
commit 378be47db0
43 changed files with 1530 additions and 1330 deletions

View File

@ -0,0 +1,9 @@
export default {
refreshFailed: 'Refresh failed',
createSimulationFailed: 'Failure to create simulation',
loadMapDataFailed: 'Failed to load map data',
getMapStepsFailed: 'Failed to get map step data',
resetFailed: 'Reset failure',
startTrainingFailed: 'Failure to start training',
saveBackgroundFailed: 'Failed to save background'
};

View File

@ -0,0 +1,10 @@
export default {
offset: 'Offset',
zoom: 'Zoom',
tips: 'Tips',
confirm: 'Confirm',
cancel: 'Cancel',
reset: 'Reset',
coachingModel: 'Coaching model',
normalMode: 'Normal mode'
};

View File

@ -1,5 +1,15 @@
import enLocale from 'element-ui/lib/locale/lang/en';
import global from './global';
import router from './router';
import lesson from './lesson';
import error from './error';
import rules from './rules';
export default {
...enLocale
...enLocale,
global,
router,
lesson,
error,
rules
};

View File

@ -0,0 +1,25 @@
export default {
trainingList: 'Training list',
filterPlaceholder: 'Input key for filtering',
addTraining: 'Add training',
editTraining: 'Edit training',
demonstration: 'Demonstration',
hasCalcelDelete: 'Canceled deletion',
isConfirmDelete: 'Whether to confirm deletion?',
trainingName: 'Training Name',
stationList: 'Station List',
stepInfo: 'Step Information',
selectMap: 'Please select the map',
selectTraining: 'Please select the training',
findStationPlaceholder: 'Input keywords to inquire station',
stepNo: 'Step No',
deviceNumber: 'Device Number',
deviceType: 'Device Type',
operationType: 'Operation Type',
returnValue: 'Return Value',
tips: 'Tips',
startRecording: 'Start Recording',
endRecording: 'End Recording',
nextStep: 'Next Step',
selectMode: 'Mode'
};

View File

@ -0,0 +1,58 @@
export default {
homePage: 'Home',
mapManage: 'Map',
skinManage: 'Skin management',
mapDraw: 'Map draw',
runPlanManage: 'Run plan',
productEdit: 'Product editor',
lessaonManage: 'Lesson',
lessonEdit: 'Lesson editor',
trainingRecord: 'Trainning recording',
trainingRule: 'Training rules',
trainingManage: 'Training management',
taskManage: 'Task management',
scriptManage: 'Script management',
teachSystem: 'Teaching',
examSystem: 'Examination',
demonstrationSystem: 'Simulation',
dpSystem: 'Large screen',
planSystem: 'Lian classroom',
replayManage: 'Playback',
permissionManage: 'Permission',
pulishManage: 'Publication',
publishMapManage: 'Publishing map management',
productStateManage: 'Product state management',
publishLessonManage: 'Publishing lesson management',
runPlanTemplateManage: 'Template run plan management',
runPlanCommonManage: 'General run plan management',
runPlanEveryDayManage: 'Daily run plan Management',
examRuleManage: 'Management of examination rules',
orderAuthorityManage: 'Order&Authority',
commodityManage: 'Commodity management',
orderManage: 'Order management',
authorityManage: 'authority management',
authorityTransferManage: 'Privilege distribution management',
addCommodity: 'Adding goods',
addOrder: 'Adding orders',
addCoursePermissions: 'Adding course permissions',
systemManage: 'System',
dataDictionary: 'Data dictionary',
dataDictionaryDetails: 'Data dictionary details',
userManage: 'user management',
userTrainingManage: 'User training management',
userExamManage: 'User examination management',
userSimulationManage: 'User simulation management',
existingSimulation: 'Existence simulation management'
};

View File

@ -0,0 +1,5 @@
export default {
deviceTypeNotNull: 'Device type code cannot be empty',
operationTypeNotNull: 'Operator code cannot be empty',
tipsNotNull: 'Tips cannot be empty'
};

View File

@ -0,0 +1,9 @@
export default {
refreshFailed: '刷新失败',
createSimulationFailed: '创建仿真失败',
loadMapDataFailed: '加载地图数据失败',
getMapStepsFailed: '获取地图步骤数据',
resetFailed: '重置失败',
startTrainingFailed: '开始实训失败',
saveBackgroundFailed: '保存背景失败'
};

View File

@ -0,0 +1,10 @@
export default {
offset: '偏移',
zoom: '缩放',
tips: '提示',
confirm: '确定',
cancel: '取消',
reset: '重置',
coachingModel: '教练模式',
normalMode: '正常模式'
};

View File

@ -1,5 +1,15 @@
import cnLocale from 'element-ui/lib/locale/lang/zh-CN';
import global from './global';
import router from './router';
import lesson from './lesson';
import error from './error';
import rules from './rules';
export default {
...cnLocale
...cnLocale,
global,
router,
lesson,
error,
rules
};

View File

@ -0,0 +1,25 @@
export default {
trainingList: '实训列表',
filterPlaceholder: '输入关键字进行过滤',
addTraining: '添加实训',
editTraining: '修改实训',
demonstration: '演示',
hasCalcelDelete: '已取消删除',
isConfirmDelete: '是否确认删除?',
trainingName: '实训名称',
stationList: '车站列表',
stepInfo: '步骤信息',
selectMap: '请选择地图',
selectTraining: '请选择实训',
findStationPlaceholder: '输入关键字查询车站',
stepNo: '步骤序号',
deviceNumber: '设备编号',
deviceType: '设备类型',
operationType: '操作类型',
returnValue: '返回值',
tips: '提示语',
startRecording: '开始录制',
endRecording: '结束录制',
nextStep: '下一步',
selectMode: '模式选择'
};

View File

@ -0,0 +1,57 @@
export default {
homePage: '首页',
mapManage: '地图管理',
skinManage: '皮肤管理',
mapDraw: '地图绘制',
runPlanManage: '运行图管理',
productEdit: '产品编辑',
lessaonManage: '课程管理',
trainingRecord: '实训录制',
taskManage: '任务管理',
trainingRule: '操作定义',
trainingManage: '实训管理',
lessonEdit: '课程编辑',
scriptManage: '剧本管理',
teachSystem: '教学系统',
examSystem: '考试系统',
demonstrationSystem: '仿真系统',
dpSystem: '大屏系统',
planSystem: '涟课堂',
replayManage: '回放管理',
permissionManage: '权限管理',
pulishManage: '发布内容管理',
publishMapManage: '发布地图管理',
productStateManage: '产品状态管理',
runPlanTemplateManage: '模板运行图管理',
runPlanCommonManage: '通用运行图管理',
runPlanEveryDayManage: '每日运行图管理',
examRuleManage: '试题规则管理',
orderAuthorityManage: '订单权限管理',
commodityManage: '商品管理',
orderManage: '订单管理',
authorityManage: '权限管理',
authorityTransferManage: '权限分发管理',
addCommodity: '添加商品',
addOrder: '添加订单',
addCoursePermissions: '添加课程权限',
systemManage: '系统管理',
dataDictionary: '数据字典',
dataDictionaryDetails: '数据字典明细',
userManage: '用户管理',
userTrainingManage: '用户实训管理',
userExamManage: '用户考试管理',
userSimulationManage: '用户仿真管理',
existingSimulation: '存在仿真管理'
};

View File

@ -0,0 +1,5 @@
export default {
deviceTypeNotNull: '设备类型码不能为空',
operationTypeNotNull: '操作码不能为空',
tipsNotNull: '提示信息不能为空'
};

View File

@ -423,6 +423,7 @@ class SkinStyle extends defaultStyle {
textAContent: 'A'// textA文本
},
trainNumber: {
trainNumberOffset: { x: 0, y: 1}// 目的地码偏移量
},
trainServer: {
serviceNumberPrefix: '00', // 服务号(表号)前缀

View File

@ -334,28 +334,28 @@ class SkinStyle extends defaultStyle {
targetCodePrefix: '000', // 目的地码前缀
defaultTargetCode: 'AAA', // 默认目的地码
trainTargetTextAlign: 'left', // 车次号文字显示位置
trainNumberOffset: { x: 0, y: 1}// 目的地码偏移量
trainNumberOffset: { x: 1, y: 1}// 目的地码偏移量
},
trainServer: {
serviceNumberPrefix: '00', // 服务号(表号)前缀
defaultServiceNumber: 'BB', // 默认服务号(表号)
trainServerOffset: { x: 16, y: 1}// 列车服务号偏移
trainServerOffset: { x: 26, y: 1}// 列车服务号偏移
},
trainTarget: {
tripNumberPrefix: '0000', // 车次号前缀
defaultDirectionCode: 'D', // 默认车次号1
defaultTripNumber: 'CCC', // 默认车次号2
trainTargetOffset: { x: 26, y: 1}// 列车车次号偏移
trainTargetOffset: { x: 42, y: 1}// 列车车次号偏移
},
trainTargetNumber: {
groupNumberPrefix: '000', // 车组号前缀
defaultGroupNumber: 'EEE', // 默认车组号
trainTargetNumberOffset: {x: 0, y: 0}// 车组号偏移量
trainTargetNumberOffset: {x: 0, y: 1}// 车组号偏移量
},
trainHead: {
trainMoreLength: 1, // 列车车头比车身高出的长度,上下相比车体伸出去的边框
trainHeadTriangleFirst: { x: 0, y: 0}, // 列车车头三角坐标1偏移量
trainHeadTriangleSecond: { x: 4, y: 8.5}, // 列车车头三角坐标2偏移量
trainHeadTriangleSecond: { x: 4, y: 7.5}, // 列车车头三角坐标2偏移量
trainHeadTriangleThird: { x: 0, y: 15}, // 列车车头三角坐标3偏移量
trainHeadRectHeight: 15, // 列车车头矩形高度
trainConntWidth: 4, // 列车竖杠的宽度
@ -366,8 +366,8 @@ class SkinStyle extends defaultStyle {
trainHeadDistance: 2, // 列车和车头之间的间距
trainWidth: 76, // 列车长度
trainTextFontSize: 15, // 列车字号
fontFamily: '宋体', // 默认字体 族类
nameFontSize: 11, // 字体大小
fontFamily: 'consolas', // 默认字体 族类
nameFontSize: 15, // 字体大小
haveTextHSDA: false, // 是否需创建textHSDA对象
haveArrowText: true, // 是否需创建arrowText对象
haveTrainBorder: false// 是否需创建trainBorder对象

View File

@ -101,7 +101,6 @@ export default class TrainBody extends Group {
:model.tripNumber || style.Train.trainTarget.defaultTripNumber) + ''; // 车次号
const targetCode = style.Train.trainNumber.targetCodePrefix + (model.targetCode || style.Train.trainNumber.defaultTargetCode) + ''; // 目的地码
const groupNumber = style.Train.trainTargetNumber.groupNumberPrefix + (model.groupNumber || style.Train.trainTargetNumber.defaultGroupNumber) + ''; // 车组号
this.textTrainServer = new ETextName({
zlevel: model.zlevel,
z: model.z+1,
@ -119,7 +118,7 @@ export default class TrainBody extends Group {
z: this.model.z+1,
x: parseInt(model.point.x + model.style.Train.trainTarget.trainTargetOffset.x),
y: parseInt(model.point.y + model.style.Train.trainTarget.trainTargetOffset.y),
text: tripNumber.substring(tripNumber.length - 3),
text: tripNumber.substring(tripNumber.length - style.Train.trainTarget.tripNumberPrefix.length),
textFill: style.trainTextColor,
fontSize: model.fontSize,
fontFamily: style.Train.common.fontFamily,
@ -129,8 +128,8 @@ export default class TrainBody extends Group {
this.textTrainNumber = new ETextName({
zlevel: model.zlevel,
z: model.z+1,
x: parseInt(model.point.x + style.Train.trainBody.lrPadding),
y: parseInt(model.point.y + style.Train.trainBody.upPadding),
x: parseInt(model.point.x + style.Train.trainNumber.trainNumberOffset.x),
y: parseInt(model.point.y + style.Train.trainNumber.trainNumberOffset.y),
text: targetCode.substring(targetCode.length - 3),
textFill: style.trainTextColor,
textStroke: style.trainTextColor,

View File

@ -63,6 +63,7 @@ export default class Train extends Group {
targetCode: model.targetCode,
groupNumber: model.groupNumber,
directionType: model.directionType,
directionCode: model.directionCode,
sectionModel: model.sectionModel,
runControlStatus: model.runControlStatus,
runStatus: model.runStatus,

View File

@ -61,7 +61,7 @@ export default {
}
tripObj.arrivalList.push(stationObj);
if (tripObj == tripNew) {
if (tripObj.code && tripObj == tripNew) {
JsonData.push(tripObj);
}
}

View File

@ -1,17 +1,17 @@
<template>
<section class="app-main">
<el-scrollbar wrapClass="scrollbar-wrapper">
<el-scrollbar wrap-class="scrollbar-wrapper">
<transition name="fade" mode="out-in">
<router-view></router-view>
<router-view />
</transition>
</el-scrollbar>
</section>
</template>
<script>
export default {
name: 'AppMain',
computed: {
}
}
export default {
name: 'AppMain',
computed: {
}
};
</script>

View File

@ -1,40 +1,37 @@
<template>
<div class="avatar-container" style="right: 80px;">
<el-menu-item class="avatar-wrapper" v-for="item in entryList" :key="item.name" index="" @click="item.handle">
<span style="color: white;">{{item.name}}</span>
</el-menu-item>
</div>
<div class="avatar-container" style="right: 80px;">
<el-menu-item v-for="item in entryList" :key="item.name" class="avatar-wrapper" index="" @click="item.handle">
<span style="color: white;">{{ item.name }}</span>
</el-menu-item>
</div>
</template>
<script>
import Vue from 'vue';
import StompClient from '@/utils/sock';
export default {
name: 'Entry',
data() {
return {
entryList: [
],
stomp: null,
header: null,
}
},
watch: {
},
mounted() {
},
computed: {
username() {
return this.$store.state.user.nickname
}
},
methods: {
}
}
export default {
name: 'Entry',
data() {
return {
entryList: [
],
stomp: null,
header: null
};
},
computed: {
username() {
return this.$store.state.user.nickname;
}
},
watch: {
},
mounted() {
},
methods: {
}
};
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
</style>

View File

@ -1,40 +1,40 @@
<template>
<el-dropdown class="avatar-container" trigger="hover" :show-timeout="100">
<div class="avatar-wrapper">
<!-- <img class="user-avatar" :src="avatar+'?imageView2/1/w/80/h/80'"> -->
<span style="color: white;">
{{username}}
</span>
<i class="el-icon-caret-bottom" style="color: #909399;"></i>
</div>
<el-dropdown-menu slot="dropdown" class="user-dropdown">
<el-dropdown-item>
<span style="display:block;" @click="logout">退出</span>
</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
<el-dropdown class="avatar-container" trigger="hover" :show-timeout="100">
<div class="avatar-wrapper">
<!-- <img class="user-avatar" :src="avatar+'?imageView2/1/w/80/h/80'"> -->
<span style="color: white;">
{{ username }}
</span>
<i class="el-icon-caret-bottom" style="color: #909399;" />
</div>
<el-dropdown-menu slot="dropdown" class="user-dropdown">
<el-dropdown-item>
<span style="display:block;" @click="logout">退出</span>
</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
</template>
<script>
export default {
name: 'Logout',
data() {
return {
}
},
computed: {
username() {
return this.$store.state.user.nickname
}
},
methods: {
logout() {
this.$store.dispatch('LogOut').then(() => {
location.reload(); // vue-router bug
})
}
}
}
export default {
name: 'Logout',
data() {
return {
};
},
computed: {
username() {
return this.$store.state.user.nickname;
}
},
methods: {
logout() {
this.$store.dispatch('LogOut').then(() => {
location.reload(); // vue-router bug
});
}
}
};
</script>
<style rel="stylesheet/scss" lang="scss" scoped>

View File

@ -1,114 +1,130 @@
<template>
<el-menu class="navbar" router :default-active="$route.path" mode="horizontal" background-color="#545c64"
text-color="#fff" active-text-color="#ffd04b">
<template v-for="item in routers" v-if="!item.hidden&&item.children">
<template v-if="hasOneScreenShowingChildren(item.children) &&!item.alwaysShow">
<el-menu-item index="">
<a :href="item.redirect ? item.redirect : (item.path+'/'+item.children[0].path)" target="_blank"
style="width: 100%; height: 100%; display: block;">{{item.children[0].meta.title}}</a>
</el-menu-item>
</template>
<template v-else-if="hasOneShowingChildren(item.children) &&!item.alwaysShow"
:to="item.path+'/'+item.children[0].path">
<el-menu-item :index="item.redirect ? item.redirect : (item.path+'/'+item.children[0].path)">
<span v-if="item.children[0].meta&&item.children[0].meta.title"
slot="title">{{item.children[0].meta.title}}</span>
</el-menu-item>
</template>
<el-submenu v-else :index="item.name||item.path" :key="item.name" :show-timeout="100">
<template slot="title">
<span v-if="item.meta&&item.meta.title" slot="title">{{item.meta.title}}</span>
</template>
<template v-for="child in item.children" v-if="!child.hidden">
<template v-if="child.children&&child.children.length>0&&hasShowingChildren(child.children)">
<el-submenu :index="child.name||child.path" :key="child.name" :show-timeout="100">
<template slot="title">
<span v-if="child.meta&&child.meta.title" slot="title">{{child.meta.title}}</span>
</template>
<template v-for="grandchild in child.children" v-if="!grandchild.hidden">
<template :to="child.path+'/'+grandchild.path">
<el-menu-item
:index="item.redirect ? item.redirect : (child.path+'/'+grandchild.path)">
<span v-if="grandchild.meta&&grandchild.meta.title"
slot="title">{{grandchild.meta.title}}</span>
</el-menu-item>
</template>
</template>
</el-submenu>
</template>
<template v-else :to="item.path+'/'+child.path">
<el-menu-item :index="item.redirect ? item.redirect : (item.path+'/'+child.path)">
<span v-if="child.meta&&child.meta.title" slot="title">{{child.meta.title}}</span>
</el-menu-item>
</template>
</template>
</el-submenu>
<el-menu
class="navbar"
router
:default-active="$route.path"
mode="horizontal"
background-color="#545c64"
text-color="#fff"
active-text-color="#ffd04b"
>
<template v-for="item in routers" v-if="!item.hidden&&item.children">
<template v-if="hasOneScreenShowingChildren(item.children) &&!item.alwaysShow">
<el-menu-item :index="item.redirect">
<a
:href="item.redirect ? item.redirect : (item.path+'/'+item.children[0].path)"
target="_blank"
style="width: 100%; height: 100%; display: block;"
>{{ item.children[0].meta.title || $t(item.children[0].meta.i18n) }}</a>
</el-menu-item>
</template>
<template
v-else-if="hasOneShowingChildren(item.children) &&!item.alwaysShow"
:to="item.path+'/'+item.children[0].path"
>
<el-menu-item :index="item.redirect ? item.redirect : (item.path+'/'+item.children[0].path)">
<span
v-if="item.children[0].meta"
slot="title"
>{{ item.children[0].meta.title || $t(item.children[0].meta.i18n) }}</span>
</el-menu-item>
</template>
<el-submenu v-else :key="item.name" :index="item.name||item.path" :show-timeout="100">
<template slot="title">
<span v-if="item.meta" slot="title">{{ $t(item.meta.i18n) || item.meta.title }}</span>
</template>
<quick-entry ref="quickEntry"></quick-entry>
<user-logout ref="userLogout"></user-logout>
</el-menu>
<template v-for="child in item.children" v-if="!child.hidden">
<template v-if="child.children&&child.children.length>0&&hasShowingChildren(child.children)">
<el-submenu :key="child.name" :index="child.name||child.path" :show-timeout="100">
<template slot="title">
<span v-if="child.meta" slot="title">{{ child.meta.title || $t(item.meta.i18n) }}</span>
</template>
<template v-for="grandchild in child.children" v-if="!grandchild.hidden">
<template :to="child.path+'/'+grandchild.path">
<el-menu-item
:index="item.redirect ? item.redirect : (child.path+'/'+grandchild.path)"
>
<span
v-if="grandchild.meta"
slot="title"
>{{ $t(grandchild.meta.title || grandchild.meta.i18n) }}</span>
</el-menu-item>
</template>
</template>
</el-submenu>
</template>
<template v-else :to="item.path+'/'+child.path">
<el-menu-item :index="item.redirect ? item.redirect : (item.path+'/'+child.path)">
<span v-if="child.meta" slot="title">{{ child.meta.title || $t(child.meta.i18n) }}</span>
</el-menu-item>
</template>
</template>
</el-submenu>
</template>
<quick-entry ref="quickEntry" />
<user-logout ref="userLogout" />
</el-menu>
</template>
<script>
import { mapGetters } from 'vuex';
import UserLogout from './Logout';
import QuickEntry from './Entry';
import { mapGetters } from 'vuex';
import UserLogout from './Logout';
import QuickEntry from './Entry';
export default {
components: {
UserLogout,
QuickEntry
},
data() {
return {
routes: []
}
},
computed: {
...mapGetters([
'avatar',
'routers'
])
},
mounted() {
this.routes = this.$router.options.routes;
},
methods: {
toggleSideBar() {
this.$store.dispatch('ToggleSideBar')
},
hasOneShowingChildren(children) {
const showingChildren = children.filter(item => {
if (!item.hidden && !item.target)
return item
})
if (showingChildren.length === 1) {
return true
}
return false
},
hasOneScreenShowingChildren(children) {
const showingChildren = children.filter(item => {
if (!item.hidden && item.target) {
return item
}
})
if (showingChildren.length === 1) {
return true
}
return false
},
hasShowingChildren(children) {
const showingChildren = children.filter(item => {
return !item.hidden
})
if (showingChildren.length >= 1) {
return true
}
return false
}
}
}
export default {
components: {
UserLogout,
QuickEntry
},
data() {
return {
routes: []
};
},
computed: {
...mapGetters([
'avatar',
'routers'
])
},
mounted() {
this.routes = this.$router.options.routes;
},
methods: {
toggleSideBar() {
this.$store.dispatch('ToggleSideBar');
},
hasOneShowingChildren(children) {
const showingChildren = children.filter(item => {
if (!item.hidden && !item.target) { return item; }
});
if (showingChildren.length === 1) {
return true;
}
return false;
},
hasOneScreenShowingChildren(children) {
const showingChildren = children.filter(item => {
if (!item.hidden && item.target) {
return item;
}
});
if (showingChildren.length === 1) {
return true;
}
return false;
},
hasShowingChildren(children) {
const showingChildren = children.filter(item => {
return !item.hidden;
});
if (showingChildren.length >= 1) {
return true;
}
return false;
}
}
};
</script>
<style rel="stylesheet/scss" lang="scss" scoped>

View File

@ -2,27 +2,30 @@
<div class="menu-wrapper">
<template v-for="item in routes" v-if="!item.hidden&&item.children">
<router-link v-if="hasOneShowingChildren(item.children) && !item.children[0].children&&!item.alwaysShow" :to="item.path+'/'+item.children[0].path"
:key="item.children[0].name">
<router-link
v-if="hasOneShowingChildren(item.children) && !item.children[0].children&&!item.alwaysShow"
:key="item.children[0].name"
:to="item.path+'/'+item.children[0].path"
>
<el-menu-item :index="item.path+'/'+item.children[0].path" :class="{'submenu-title-noDropdown':!isNest}">
<svg-icon v-if="item.children[0].meta&&item.children[0].meta.icon" :icon-class="item.children[0].meta.icon"></svg-icon>
<span v-if="item.children[0].meta&&item.children[0].meta.title" slot="title">{{item.children[0].meta.title}}</span>
<svg-icon v-if="item.children[0].meta&&item.children[0].meta.icon" :icon-class="item.children[0].meta.icon" />
<span v-if="item.children[0].meta&&item.children[0].meta.title" slot="title">{{ item.children[0].meta.title }}</span>
</el-menu-item>
</router-link>
<el-submenu v-else :index="item.name||item.path" :key="item.name">
<el-submenu v-else :key="item.name" :index="item.name||item.path">
<template slot="title">
<svg-icon v-if="item.meta&&item.meta.icon" :icon-class="item.meta.icon"></svg-icon>
<span v-if="item.meta&&item.meta.title" slot="title">{{item.meta.title}}</span>
<svg-icon v-if="item.meta&&item.meta.icon" :icon-class="item.meta.icon" />
<span v-if="item.meta&&item.meta.title" slot="title">{{ item.meta.title }}</span>
</template>
<template v-for="child in item.children" v-if="!child.hidden">
<sidebar-item :is-nest="true" class="nest-menu" v-if="child.children&&child.children.length>0" :routes="[child]" :key="child.path"></sidebar-item>
<sidebar-item v-if="child.children&&child.children.length>0" :key="child.path" :is-nest="true" class="nest-menu" :routes="[child]" />
<router-link v-else :to="item.path+'/'+child.path" :key="child.name">
<router-link v-else :key="child.name" :to="item.path+'/'+child.path">
<el-menu-item :index="item.path+'/'+child.path">
<svg-icon v-if="child.meta&&child.meta.icon" :icon-class="child.meta.icon"></svg-icon>
<span v-if="child.meta&&child.meta.title" slot="title">{{child.meta.title}}</span>
<svg-icon v-if="child.meta&&child.meta.icon" :icon-class="child.meta.icon" />
<span v-if="child.meta&&child.meta.title" slot="title">{{ child.meta.title }}</span>
</el-menu-item>
</router-link>
</template>
@ -34,26 +37,27 @@
<script>
export default {
name: 'SidebarItem',
props: {
routes: {
type: Array
},
isNest: {
type: Boolean,
default: false
}
},
methods: {
hasOneShowingChildren(children) {
const showingChildren = children.filter(item => {
return !item.hidden
})
if (showingChildren.length === 1) {
return true
}
return false
}
}
}
name: 'SidebarItem',
props: {
routes: {
type: Array,
required: true
},
isNest: {
type: Boolean,
default: false
}
},
methods: {
hasOneShowingChildren(children) {
const showingChildren = children.filter(item => {
return !item.hidden;
});
if (showingChildren.length === 1) {
return true;
}
return false;
}
}
};
</script>

View File

@ -1,29 +1,36 @@
<template>
<el-scrollbar wrapClass="scrollbar-wrapper">
<el-menu mode="vertical" :show-timeout="200" :default-active="$route.path" :collapse="isCollapse" background-color="#304156"
text-color="#bfcbd9" active-text-color="#409EFF">
<sidebar-item :routes="routes"></sidebar-item>
<el-scrollbar wrap-class="scrollbar-wrapper">
<el-menu
mode="vertical"
:show-timeout="200"
:default-active="$route.path"
:collapse="isCollapse"
background-color="#304156"
text-color="#bfcbd9"
active-text-color="#409EFF"
>
<sidebar-item :routes="routes" />
</el-menu>
</el-scrollbar>
</template>
<script>
import { mapGetters } from 'vuex'
import SidebarItem from './SidebarItem'
import { mapGetters } from 'vuex';
import SidebarItem from './SidebarItem';
export default {
components: { SidebarItem },
computed: {
...mapGetters([
'sidebar',
'routers'
]),
routes() {
return this.$router.options.routes
},
isCollapse() {
return !this.sidebar.opened
}
}
}
export default {
components: { SidebarItem },
computed: {
...mapGetters([
'sidebar',
'routers'
]),
routes() {
return this.$router.options.routes;
},
isCollapse() {
return !this.sidebar.opened;
}
}
};
</script>

View File

@ -1,66 +1,66 @@
<template>
<div class="app-wrapper" :class="classObj">
<div class="main-container">
<navbar></navbar>
<app-main :style="{width: mainWidth+'px', height: mainHeight+'px'}"></app-main>
</div>
<div class="app-wrapper" :class="classObj">
<div class="main-container">
<navbar />
<app-main :style="{width: mainWidth+'px', height: mainHeight+'px'}" />
</div>
</div>
</template>
<script>
import { Navbar, Sidebar, AppMain } from './components';
import Breadcrumb from '@/components/Breadcrumb';
import WindowResizeHandler from '@/mixin/WindowResizeHandler';
import { Navbar, AppMain } from './components'; // Sidebar
// import Breadcrumb from '@/components/Breadcrumb';
import WindowResizeHandler from '@/mixin/WindowResizeHandler';
export default {
name: 'layout',
components: {
Navbar,
Sidebar,
AppMain,
Breadcrumb
},
mixins: [
WindowResizeHandler
],
data() {
return {
mainWidth: document.documentElement.clientWidth,
mainHeight: document.documentElement.clientHeight
}
},
computed: {
sidebar() {
return this.$store.state.app.sidebar
},
device() {
return this.$store.state.app.device
},
classObj() {
return {
withoutAnimation: this.sidebar.withoutAnimation,
mobile: this.device === 'mobile'
}
}
},
created() {
this.watchRouterUpdate();
},
methods: {
resizeHandler: function () {
this.mainWidth = this._clientWidth;
this.mainHeight = this._clientHeight - 60;
},
handleClickOutside() {
this.$store.dispatch('CloseSideBar', { withoutAnimation: false })
},
watchRouterUpdate() {
this.$router.beforeEach((to, from, next) => {
next();
});
},
}
}
export default {
name: 'Layout',
components: {
Navbar,
// Sidebar,
AppMain
// Breadcrumb
},
mixins: [
WindowResizeHandler
],
data() {
return {
mainWidth: document.documentElement.clientWidth,
mainHeight: document.documentElement.clientHeight
};
},
computed: {
sidebar() {
return this.$store.state.app.sidebar;
},
device() {
return this.$store.state.app.device;
},
classObj() {
return {
withoutAnimation: this.sidebar.withoutAnimation,
mobile: this.device === 'mobile'
};
}
},
created() {
this.watchRouterUpdate();
},
methods: {
resizeHandler: function () {
this.mainWidth = this._clientWidth;
this.mainHeight = this._clientHeight - 60;
},
handleClickOutside() {
this.$store.dispatch('CloseSideBar', { withoutAnimation: false });
},
watchRouterUpdate() {
this.$router.beforeEach((to, from, next) => {
next();
});
}
}
};
</script>
<style rel="stylesheet/scss" lang="scss" scoped>

View File

@ -26,7 +26,7 @@ Vue.use(VueI18n);
Vue.config.productionTip = false;
const i18n = new VueI18n({
export const i18n = new VueI18n({
locale: LangStorage.getLang('zh'),
messages
});
@ -38,15 +38,3 @@ new Vue({
i18n,
render: h => h(App)
});
router.beforeEach((to, from, next) => {
const name = to.fullPath;
if (name.includes('/dp/') || name.includes('display/dp')) {
document.title = '琏课堂-大屏系统';
} else if (name.includes('/plan/') || name.includes('/planEdit/')) {
document.title = '琏计划';
} else {
document.title = '琏课堂';
}
next();
});

View File

@ -31,11 +31,11 @@ export const lessonCreater = '03'; // 课程创建权限
export const admin = '04'; // 管理员
export const superAdmin = '05'; // 超级管理员
export const userExam = '011'; // 考试系统
export const userLesson = '012'; // 教学系统
export const userExam = '011'; // 考试系统
export const userLesson = '012'; // 教学系统
export const userSimulation = '013'; // 仿真系统
export const userScreen = '014'; // 大屏系统
export const userPlan = '015'; // 计划系统
export const userScreen = '014'; // 大屏系统
export const userPlan = '015'; // 计划系统
export const UrlConfig = {
display: '/display',
@ -181,9 +181,11 @@ export const constantRoutes = [
redirect: '/dashboard',
children: [{
path: 'dashboard',
name: 'Dashboard',
component: () => import('@/views/dashboard/index'),
meta: { title: '首页', icon: 'dashboard' }
meta: {
i18n: 'router.homePage',
icon: 'dashboard'
}
}]
},
@ -195,7 +197,6 @@ export const asyncRouter = [
path: '/',
component: Layout,
redirect: '/dashboard',
name: 'Dashboard',
hidden: true,
children: [
{
@ -208,7 +209,6 @@ export const asyncRouter = [
path: '/display/:mode',
component: resolve => require(['@/views/display/index'], resolve),
meta: {
title: '实训视图'
},
hidden: true
},
@ -216,65 +216,52 @@ export const asyncRouter = [
path: '/trainroom',
component: resolve => require(['@/views/trainRoom/index'], resolve),
meta: {
title: '综合演练房间'
},
hidden: true
},
{
path: '/jointTraining',
name: '联合演练试图',
component: resolve => require(['@/views/jointTraining/index'], resolve),
hidden: true
},
{
path: '/jlmap3d',
name: '三维test',
component: resolve => require(['@/views/jlmap3d/index'], resolve),
meta: {
title: '三维test'
},
hidden: true
},
{
path: '/map',
name: '地图管理',
meta: {
title: '地图管理',
i18n: 'router.mapManage',
roles: [admin, mapCreater]
},
component: Layout,
children: [
{
path: 'skinStyle',
name: '皮肤管理',
component: resolve => require(['@/views/map/skinStyle/index'], resolve),
meta: {
title: '皮肤管理'
i18n: 'router.skinManage'
}
},
{
path: 'skinStyle/draft/:mode/:skinStyleId',
name: '操作权限',
hidden: true,
component: resolve => require(['@/views/map/skinStyle/draft'], resolve),
meta: {
title: '操作权限'
}
component: resolve => require(['@/views/map/skinStyle/draft'], resolve)
},
{
path: 'draw',
redirect: '/map/draw/0/draft',
component: resolve => require(['@/views/map/mapdraft/index'], resolve),
meta: {
title: '地图绘制'
i18n: 'router.mapDraw'
},
children: [
{
path: ':mapId/:view',
component: resolve => require(['@/views/map/mapdraft/mapedit/index'], resolve),
meta: {
title: '地图绘制'
},
hidden: true
}
]
@ -282,10 +269,9 @@ export const asyncRouter = [
{
path: 'runPlan',
redirect: '/map/runPlan/view/draft',
name: '运行图管理',
component: resolve => require(['@/views/map/runplan/index'], resolve),
meta: {
title: '运行图管理'
i18n: 'router.runPlanManage'
},
children: [{
path: 'view/:mode',
@ -295,10 +281,9 @@ export const asyncRouter = [
},
{
path: 'product',
name: '产品编辑',
component: resolve => require(['@/views/lesson/trainingcategory/index'], resolve),
meta: {
title: '产品编辑'
i18n: 'router.productEdit'
}
}
]
@ -306,9 +291,8 @@ export const asyncRouter = [
{
path: '/lesson',
component: Layout,
name: '课程管理',
meta: {
title: '课程管理',
i18n: 'router.lessaonManage',
roles: [admin, lessonCreater]
},
children: [
@ -317,58 +301,49 @@ export const asyncRouter = [
redirect: '/lesson/record/training/0/null',
component: resolve => require(['@/views/lesson/trainingrecord/index'], resolve),
meta: {
title: '实训录制'
i18n: 'router.trainingRecord'
},
children: [
{
path: 'training/:trainingId/:trainingName',
component: resolve => require(['@/views/lesson/trainingrecord/manage/index'], resolve),
meta: {
title: '实训录制'
},
hidden: true
}
]
},
{
path: 'manage/taskmanage',
name: '任务管理',
path: 'manage/taskManage',
component: resolve => require(['@/views/lesson/taskmanage/list'], resolve),
meta: {
title: '任务管理'
i18n: 'router.taskManage'
}
},
{
path: 'manage/trainingRule',
name: '操作定义',
component: resolve => require(['@/views/lesson/trainingRule/list'], resolve),
meta: {
title: '操作定义'
i18n: 'router.trainingRule'
}
},
{
path: 'manage/trainingRule/detail',
name: '操作定义明细',
hidden: true,
component: resolve => require(['@/views/lesson/trainingRule/detail/index'], resolve),
meta: {
title: '操作定义明细'
}
},
{
path: 'manage/training',
name: '实训管理',
component: resolve => require(['@/views/lesson/trainingmanage/index'], resolve),
meta: {
title: '实训管理'
i18n: 'router.trainingManage'
}
},
{
path: 'edit',
name: '课程编辑',
component: resolve => require(['@/views/lesson/lessoncategory/index'], resolve),
meta: {
title: '课程编辑'
i18n: 'router.lessonEdit'
}
}
]
@ -377,14 +352,14 @@ export const asyncRouter = [
path: '/script',
component: Layout,
meta: {
roles: [admin, user]
roles: [admin, lessonCreater]
},
children: [
{
path: 'scriptmanage',
path: 'scriptManage',
component: resolve => require(['@/views/lesson/scriptmanage/list'], resolve),
meta: {
title: '剧本管理'
i18n: 'router.scriptManage'
}
}
]
@ -392,7 +367,6 @@ export const asyncRouter = [
{
path: '/teach',
redirect: '/teach/home',
name: '教学系统',
component: resolve => require(['@/views/teach/index'], resolve),
meta: {
roles: [admin, userLesson, user]
@ -402,24 +376,22 @@ export const asyncRouter = [
path: 'home',
component: resolve => require(['@/views/teach/home'], resolve),
meta: {
title: '教学系统'
i18n: 'router.teachSystem'
}
},
{
// 课程详情
path: 'detail/:lessonId',
name: '课程详情',
component: resolve => require(['@/views/teach/detail/index'], resolve),
meta: {
title: '课程详情'
},
hidden: true
},
{
// 实训详情
path: 'practical/:trainingId/:lessonId',
name: '实训详情',
component: resolve => require(['@/views/teach/practical/index'], resolve),
meta: {
title: '实训详情'
},
hidden: true
},
@ -436,7 +408,6 @@ export const asyncRouter = [
path: '/exam',
redirect: '/exam/home',
component: resolve => require(['@/views/exam/index'], resolve),
name: '考试系统',
meta: {
roles: [admin, userExam, user]
},
@ -445,65 +416,46 @@ export const asyncRouter = [
path: 'home',
component: resolve => require(['@/views/exam/home'], resolve),
meta: {
title: '考试系统'
i18n: 'router.examSystem'
}
},
{
// 试卷详情
path: 'detail/:examId',
name: '试卷详情',
component: resolve => require(['@/views/exam/detail/examDetail'], resolve),
meta: {
title: '试卷详情'
},
hidden: true
},
{
path: 'course/:lessonId',
component: resolve => require(['@/views/exam/detail/courseDetail'], resolve),
meta: {
},
hidden: true
},
{
// 规则管理
path: 'examRule/manage',
name: '试题设置',
component: resolve => require(['@/views/publish/examRule/index'], resolve),
meta: {
title: '试题设置'
},
hidden: true
},
{
path: 'examRule/draft/:mode/:ruleId/:lessonId',
hidden: true,
component: resolve => require(['@/views/publish/examRule/draft/index'], resolve),
meta: {
title: '添加订单'
}
component: resolve => require(['@/views/publish/examRule/draft/index'], resolve)
},
{
path: 'pay/:lessonId',
component: resolve => require(['@/views/components/pay/index'], resolve),
meta: {
},
hidden: true
},
{
// 开始考试
path: 'questionDetail/:examQuestionId',
name: '开始考试',
component: resolve => require(['@/views/exam/detail/questionDetail'], resolve),
meta: {
title: '开始考试'
},
hidden: true
},
{
// 考试结果
path: 'result/:userExamId',
name: '考试结果',
component: resolve => require(['@/views/exam/result'], resolve),
meta: {
title: '考试结果'
},
hidden: true
}
]
@ -512,7 +464,6 @@ export const asyncRouter = [
path: '/demonstration',
redirect: '/demonstration/home',
component: resolve => require(['@/views/demonstration/index'], resolve),
name: '仿真系统',
meta: {
roles: [admin, userSimulation, user]
},
@ -521,23 +472,17 @@ export const asyncRouter = [
path: 'home',
component: resolve => require(['@/views/demonstration/home'], resolve),
meta: {
title: '仿真系统'
i18n: 'router.demonstrationSystem'
}
},
{
path: 'detail/:mapId',
name: '地图详情',
component: resolve => require(['@/views/demonstration/detail/index'], resolve),
meta: {
title: '地图详情'
},
hidden: true
},
{
path: 'pay/:lessonId',
component: resolve => require(['@/views/components/pay/index'], resolve),
meta: {
},
hidden: true
}
]
@ -546,7 +491,6 @@ export const asyncRouter = [
path: '/dp',
redirect: '/dp/home',
component: resolve => require(['@/views/screenMonitor/index'], resolve),
name: '大屏系统',
meta: {
roles: [admin, userScreen, user]
},
@ -555,22 +499,18 @@ export const asyncRouter = [
path: 'home',
component: resolve => require(['@/views/screenMonitor/home'], resolve),
meta: {
title: '大屏系统'
i18n: 'router.dpSystem'
},
target: true
},
{
path: 'detail/:lessonId',
component: resolve => require(['@/views/screenMonitor/detail/index'], resolve),
meta: {
},
hidden: true
},
{
path: 'pay/:lessonId',
component: resolve => require(['@/views/components/pay/index'], resolve),
meta: {
},
hidden: true
}
]
@ -586,7 +526,6 @@ export const asyncRouter = [
path: '/plan',
redirect: '/plan/home',
component: resolve => require(['@/views/planMonitor/index'], resolve),
name: '琏计划',
meta: {
roles: [admin, user]
},
@ -595,22 +534,18 @@ export const asyncRouter = [
path: 'home',
component: resolve => require(['@/views/planMonitor/home'], resolve),
meta: {
title: '琏计划'
i18n: 'router.planSystem'
},
target: true
},
{
path: 'detail/:lessonId',
component: resolve => require(['@/views/planMonitor/detail'], resolve),
meta: {
},
hidden: true
},
{
path: 'pay/:lessonId',
component: resolve => require(['@/views/components/pay/index'], resolve),
meta: {
},
hidden: true
}
]
@ -626,7 +561,7 @@ export const asyncRouter = [
path: 'manage',
component: resolve => require(['@/views/replay/index'], resolve),
meta: {
title: '回放管理'
i18n: 'router.replayManage'
}
}
]
@ -642,54 +577,47 @@ export const asyncRouter = [
path: 'manage',
component: resolve => require(['@/views/package/index'], resolve),
meta: {
title: '权限管理'
i18n: 'router.permissionManage'
}
},
{
path: 'draft',
component: resolve => require(['@/views/package/draft/ruleForm'], resolve),
meta: {
},
hidden: true
}
]
},
{
path: '/publish',
name: '发布内容管理',
component: Layout,
meta: {
title: '发布内容管理',
i18n: 'router.pulishManage',
roles: [admin]
},
children: [
{
path: 'map',
name: '发布地图管理',
component: resolve => require(['@/views/publish/publishMap/index'], resolve),
meta: {
title: '发布地图管理'
i18n: 'router.publishMapManage'
}
},
{
path: 'product',
name: '产品状态管理',
component: resolve => require(['@/views/publish/productStatus/index'], resolve),
meta: {
title: '产品状态管理'
i18n: 'router.productStateManage'
}
},
{
path: 'lesson',
name: '发布课程管理',
component: resolve => require(['@/views/publish/publishLesson/index'], resolve),
meta: {
title: '发布课程管理'
i18n: 'router.publishLessonManage'
}
},
// {
// path: 'script',
// name: '仿真脚本管理',
// component: resolve => require(['@/views/publish/simulationScript/index'], resolve),
// meta: {
// title: '仿真脚本管理',
@ -699,57 +627,48 @@ export const asyncRouter = [
path: 'runPlan/template',
component: resolve => require(['@/views/publish/runPlanTemplate/index'], resolve),
meta: {
title: '运行图模板管理'
i18n: 'router.runPlanTemplateManage'
}
},
{
path: 'runPlan/common',
component: resolve => require(['@/views/publish/runPlanCommon/index'], resolve),
meta: {
title: '运行图通用管理'
i18n: 'router.runPlanCommonManage'
}
},
{
path: 'runPlan/everyDay',
component: resolve => require(['@/views/publish/runPlanEveryDay/index'], resolve),
meta: {
title: '运行图每日管理'
i18n: 'router.runPlanEveryDayManage'
}
},
{
path: 'examRule/manage',
name: '试题管理',
component: resolve => require(['@/views/publish/examRule/index'], resolve),
meta: {
title: '试题管理'
i18n: 'router.examRuleManage'
}
},
{
path: 'map/draft/:mode/:mapId',
component: resolve => require(['@/views/publish/publishMap/draft'], resolve),
meta: {
},
hidden: true
},
{
path: 'examRule/draft/:mode/:ruleId/:lessonId',
hidden: true,
component: resolve => require(['@/views/publish/examRule/draft/index'], resolve),
meta: {
}
hidden: true
},
{
path: 'runPlan/common/:mode',
component: resolve => require(['@/views/publish/runPlanCommon/draft'], resolve),
meta: {
},
hidden: true
},
{
path: 'runPlan/view/:mode',
component: resolve => require(['@/views/map/runplan/chart'], resolve),
meta: {
},
hidden: true
}
]
@ -757,83 +676,71 @@ export const asyncRouter = [
{
path: '/orderauthor',
component: Layout,
name: '订单权限管理',
meta: {
title: '订单权限管理',
i18n: 'router.orderAuthorityManage',
roles: [admin]
},
children: [
{
path: 'commodity/manage',
name: '商品管理',
component: resolve => require(['@/views/orderauthor/commodity/index'], resolve),
meta: {
title: '商品管理'
i18n: 'router.commodityManage'
}
},
{
path: 'order/manage',
name: '订单管理',
component: resolve => require(['@/views/orderauthor/order/list'], resolve),
meta: {
title: '订单管理'
i18n: 'router.orderManage'
}
},
{
path: 'author/manage',
name: '权限管理',
component: resolve => require(['@/views/orderauthor/author/index'], resolve),
meta: {
title: '权限管理'
i18n: 'router.authorityManage'
}
},
{
path: 'transfer/manage',
name: '权限分发管理',
component: resolve => require(['@/views/orderauthor/permission/index'], resolve),
meta: {
title: '权限分发管理'
i18n: 'router.authorityTransferManage'
}
},
{
path: 'commodity/draft/:mode/:commodityId',
name: '添加商品',
hidden: true,
component: resolve => require(['@/views/orderauthor/commodity/draft'], resolve),
meta: {
title: '添加商品'
i18n: 'router.addCommodity'
}
},
{
path: 'order/draft/:mode/:orderId',
name: '添加订单',
hidden: true,
component: resolve => require(['@/views/orderauthor/order/draft'], resolve),
meta: {
title: '添加订单'
i18n: 'router.addOrder'
}
},
{
path: 'author/draft/:mode/:userId',
name: '添加课程权限',
hidden: true,
component: resolve => require(['@/views/orderauthor/author/draft'], resolve),
meta: {
title: '添加课程权限'
i18n: 'router.addCoursePermissions'
}
},
{
path: 'transfer/detail/:permissionId',
component: resolve => require(['@/views/orderauthor/permission/detail'], resolve),
meta: {
},
hidden: true
},
{
path: 'transfer/package',
component: resolve => require(['@/views/orderauthor/permission/draft/ruleForm'], resolve),
meta: {
},
hidden: true
}
]
@ -842,65 +749,58 @@ export const asyncRouter = [
path: '/system',
component: Layout,
meta: {
title: '系统管理',
i18n: 'router.systemManage',
roles: [admin]
},
children: [
{
path: 'dictionary',
name: 'Dictionary',
component: resolve => require(['@/views/management/dictionary/index'], resolve),
meta: {
title: '数据字典'
i18n: 'router.dataDictionary'
}
},
{
path: 'dictionary/detail',
name: '数据字典明细',
hidden: true,
component: resolve => require(['@/views/management/dictionaryDetail/index'], resolve),
meta: {
title: '数据字典明细'
i18n: 'router.dataDictionaryDetails'
}
},
{
path: 'userManage',
name: '用户管理',
component: resolve => require(['@/views/management/userControl/index'], resolve),
meta: {
title: '用户管理'
i18n: 'router.userManage'
}
},
{
path: 'userTrainingManage',
name: '用户实训管理',
component: resolve => require(['@/views/management/userTraining/index'], resolve),
meta: {
title: '用户实训管理'
i18n: 'router.userTrainingManage'
}
},
{
path: 'userExamManage',
name: '用户考试管理',
component: resolve => require(['@/views/management/userExam/index'], resolve),
meta: {
title: '用户考试管理'
i18n: 'router.userExamManage'
}
},
{
path: 'userSimulationManage',
name: '用户仿真管理',
component: resolve => require(['@/views/management/userSimulation/index'], resolve),
meta: {
title: '用户仿真管理'
i18n: 'router.userSimulationManage'
}
},
{
path: 'existingSimulation',
name: '存在仿真管理',
component: resolve => require(['@/views/management/existingSimulation/index'], resolve),
meta: {
title: '存在仿真管理'
i18n: 'router.existingSimulation'
}
}
]
@ -915,4 +815,16 @@ const createRouter = () => new Router({
const router = createRouter();
router.beforeEach((to, from, next) => {
const name = to.fullPath;
if (name.includes('/dp/') || name.includes('display/dp')) {
document.title = '琏课堂-大屏系统';
} else if (name.includes('/plan/') || name.includes('/planEdit/')) {
document.title = '琏计划';
} else {
document.title = '琏课堂';
}
next();
});
export default router;

View File

@ -46,7 +46,7 @@
import Vue from 'vue';
import DeviceTypeDic from '@/scripts/DeviceTypeDic';
import DeviceCondition from './deviceCondition';
import {getMembersByGroup,postMemberBehavior} from '@/api/simulation';
import {getQuestRecord,postMemberBehavior} from '@/api/simulation';
export default {
name: 'addBehavior',
props: {
@ -123,8 +123,8 @@
loadInitData(obj) {
let group=obj.group;
let memberId=this.$props.memberId;
getMembersByGroup(group).then(response=>{
let datalist=response.data;
getQuestRecord(group).then(response=>{
let datalist=response.data.memberVOList;
this.targetMemberList=datalist;
});
},
@ -140,7 +140,7 @@
handleInputConfirm() {
let inputValue = this.inputValue;
if (inputValue) {
this.behavior.conditionVO.importantList.push(inputValue);
this.behavior.conditionVO.importantList.push(inputValue);
}
this.inputVisible = false;
this.inputValue = '';
@ -150,40 +150,49 @@
if (valid) {
let group=this.$props.group;
let memberId=this.$props.memberId;
if(this.behavior.conditionVO.triggerType=="DeviceCondition")
switch(this.behavior.conditionVO.triggerType)
{
if(this.isAdding)
case 'DeviceCondition':
{
this.behavior.conditionVO.deviceConditionList.pop();
this.$refs.deviceCondition.resetDisabled();
if(this.isAdding)
{
this.behavior.conditionVO.deviceConditionList.pop();
this.$refs.deviceCondition.resetDisabled();
}
if(this.behavior.conditionVO.deviceConditionList.length<=0)
{
this.$messageBox(`请添加设备条件`);
return;
}
break;
}
if(this.behavior.conditionVO.deviceConditionList.length<=0)
case 'None':
{
this.$messageBox(`请添加设备条件`);
return;
this.behavior.conditionVO={};
this.behavior.conditionVO.triggerType="None";
break;
}
}
if(this.behavior.conditionVO.triggerType=="None")
{
this.behavior.conditionVO={};
this.behavior.conditionVO.triggerType="None";
}
if(memberId)
{
let behavior=this.behavior;
postMemberBehavior(group,memberId,behavior).then(response=>{
this.behavior.auto=false;
this.behavior.description="";
this.behavior.conditionVO.triggerType="None";
this.behavior.conditionVO.importantList=[];
this.behavior.targetMemberId=null;
this.behavior.conditionVO.content="";
this.behavior.conditionVO.keyWord="";
this.behavior.id=null;
this.behavior={
auto:false,
description:"",
conditionVO:{
triggerType:"None",
importantList:[],
content:"",
keyWord:"",
deviceConditionList:[],
},
targetMemberId:null,
id:null
};
this.isConversationShow=false;
this.isDeviceShow=false;
this.behavior.conditionVO.deviceConditionList=[];
if(this.$props.operateType=="add")
if(this.$props.operateType==="add")
{
this.$message.success('添加行为成功');
}
@ -194,7 +203,7 @@
}
this.$emit('create');
}).catch(error => {
if(this.$props.operateType=="add")
if(this.$props.operateType==="add")
{
this.$messageBox(`添加行为失败: ${error.message}`);
}
@ -236,7 +245,6 @@
case 'DeviceCondition':{
this.isConversationShow=false;
this.isDeviceShow=true;
// this.$refs.deviceCondition.resetDisabled();
var newData=JSON.parse(JSON.stringify(data.conditionVO.deviceConditionList).replace(/\"code\"/g,'"isAdded":true,"code"'));
this.behavior.conditionVO.deviceConditionList=newData;
this.resetDisabled();
@ -249,7 +257,6 @@
}
},
resetDisabled(){
// debugger;
if(this.$refs['deviceCondition'])
{
this.$refs['deviceCondition'].resetDisabled();

View File

@ -1,34 +1,36 @@
<template>
<div>
<div class="actionList">
<i class="el-icon-back" @click="backToMember"></i>
<span class="titleStyle">{{memberName}}角色<span class="titleStyle">/</span><span class="titleStyle">{{behaviorName}}行为</span><span class="titleStyle">/</span><span class="titleStyle">动作信息</span></span>
<div class="tab-pane-big">
<el-scrollbar wrapClass="scrollbar-wrapper" ref="elActionScrollbar">
<div class="actionList">
<i class="el-icon-back" @click="backToMember"></i>
<span class="titleStyle">{{memberName}}角色<span class="titleStyle">/</span><span class="titleStyle">{{behaviorName}}行为</span><span class="titleStyle">/</span><span class="titleStyle">动作信息</span></span>
</div>
<add-action ref="addBehavior" :group="group" :memberId="memberId" :behaviorId="behaviorId" @create="create" :buttonName="buttonName" :operateType="operateType" @modifyButtonName="modifyButtonName"></add-action>
<el-table
v-loading="loading"
:data="actionList" border class="actionListTable">
<el-table-column prop="reply" label="回复消息" width="200">
</el-table-column>
<el-table-column prop="time" label="完成时间" width="200">
</el-table-column>
<el-table-column prop="type" label="动作类型" width="200">
</el-table-column>
<el-table-column label="操作" width="200">
<template slot-scope="scope">
<el-row>
<el-button type="primary" size="mini" @click="modifyAction(scope.row)">修改</el-button>
<el-button type="primary" size="mini" @click="deleteAction(scope.row)">删除</el-button>
</el-row>
</template>
</el-table-column>
</el-table>
</el-scrollbar>
</div>
<add-action ref="addBehavior" :group="group" :memberId="memberId" :behaviorId="behaviorId" @create="create" :buttonName="buttonName" :operateType="operateType" @modifyButtonName="modifyButtonName"></add-action>
<el-table
v-loading="loading"
:data="actionList" border class="actionListTable">
<el-table-column prop="reply" label="回复消息" width="200">
</el-table-column>
<el-table-column prop="time" label="完成时间" width="200">
</el-table-column>
<el-table-column prop="type" label="动作类型" width="200">
</el-table-column>
<el-table-column label="操作" width="200">
<template slot-scope="scope">
<el-row>
<el-button type="primary" size="mini" @click="modifyAction(scope.row)">修改</el-button>
<el-button type="primary" size="mini" @click="deleteAction(scope.row)">删除</el-button>
</el-row>
</template>
</el-table-column>
</el-table>
</div>
</template>
<script>
import Vue from 'vue';
import AddAction from './addAction';
import {getMembersByGroup,deleteMemberBehaviorAction} from '@/api/simulation';
import {getQuestRecord,deleteMemberBehaviorAction} from '@/api/simulation';
export default {
name: 'getAction',
props: {
@ -68,8 +70,8 @@
let group=obj.group;
let memberId=this.$props.memberId;
let behaviorId=this.$props.behaviorId;
getMembersByGroup(group).then(response=>{
let datalist=response.data;
getQuestRecord(group).then(response=>{
let datalist=response.data.memberVOList;
let behaviorList=datalist.find(elem=>{return elem.id==memberId}).behaviorVOList;
this.actionList=behaviorList.find(elem=>{return elem.id==behaviorId}).actionVOList;
this.loading=false;
@ -96,7 +98,8 @@
this.reloadTable();
},
modifyAction(row){
this.$emit('backToTop');
var div = this.$refs['elActionScrollbar'].$refs['wrap'];
div.scrollTop=0;
this.operateType="modify";
this.buttonName="修改动作"
this.$refs.addBehavior.doShow(row);

View File

@ -45,7 +45,7 @@
</template>
<script>
import Vue from 'vue';
import {getMembersByGroup,deleteMemberBehavior} from '@/api/simulation';
import {getQuestRecord,deleteMemberBehavior} from '@/api/simulation';
import AddBehavior from './addBehavior';
export default {
name: 'behaviorList',
@ -80,8 +80,8 @@
loadInitData(obj) {
let group=obj.group;
let memberId=this.$props.memberId;
getMembersByGroup(group).then(response=>{
let datalist=response.data;
getQuestRecord(group).then(response=>{
let datalist=response.data.memberVOList;
this.behaviorList=datalist.find(elem=>{return elem.id==memberId}).behaviorVOList;
this.loading=false;
});

View File

@ -60,6 +60,7 @@
this.$store.dispatch('scriptRecord/updateDeviceCondition', deviceConditionList);
this.$store.dispatch('scriptRecord/updateMemberList', response.data.memberVOList);
this.$store.dispatch('scriptRecord/updateScript', response.data.script);
debugger;
if(response.data.mapLocation)
{
let mapLocation={"offsetX":response.data.mapLocation.x,"offsetY":response.data.mapLocation.y,"scaleRate":response.data.mapLocation.scale};

View File

@ -14,14 +14,10 @@
<role-condition-script :group="group" @getBehaviorList="getBehaviorList"></role-condition-script>
</template>
<template v-if="displayType=='behavior'">
<get-behavior ref="getBehavior" :group="group" :memberId="memberId" @backToMember="backToMember" @getActions="getActions"></get-behavior>
<get-behavior ref="getBehavior" :group="group" :memberId="memberId" @backToMember="backToMember" @getActions="getActions"></get-behavior>
</template>
<template v-if="displayType=='action'">
<div class="tab-pane-big">
<el-scrollbar wrapClass="scrollbar-wrapper" ref="elActionScrollbar">
<get-action ref="getAction" :group="group" :memberId="memberId" :behaviorId="behaviorId" @backToBehavior="backToBehavior" @backToTop="backToActionTop"></get-action>
</el-scrollbar>
</div>
<get-action ref="getAction" :group="group" :memberId="memberId" :behaviorId="behaviorId" @backToBehavior="backToBehavior"></get-action>
</template>
<el-button-group class="button-group">
<el-button type="primary" @click="saveMaplocation">更新定位</el-button>
@ -138,10 +134,6 @@
this.displayType="behavior";
this.memberId=id;
},
backToActionTop(){
var div = this.$refs['elActionScrollbar'].$refs['wrap'];
div.scrollTop=0;
},
saveMaplocation()
{
let data=Vue.prototype.$jlmap.$options;

View File

@ -5,13 +5,13 @@
<zoom-box v-if="!isScreen" :scale-rate="dataZoom.scaleRate" @setShrink="setShrink" @setMagnify="setMagnify" />
<div v-if="show" class="zoom-view" :style="{ width: width +'px'}">
<el-form :model="dataZoom" label-width="60px" size="mini" inline>
<el-form-item label="偏移:">
<el-form-item :label="$t(`global.offset`)">
<el-input v-model="dataZoom.offsetX" :disabled="true" />
</el-form-item>
<el-form-item>
<el-input v-model="dataZoom.offsetY" :disabled="true" />
</el-form-item>
<el-form-item label="缩放:" style="float: right">
<el-form-item :label="$t(`global.zoom`)" style="float: right">
<el-input v-model="dataZoom.scaleRate" :disabled="true" />
</el-form-item>
</el-form>

View File

@ -1,296 +1,308 @@
<template>
<el-dialog :title="operation.title" :visible.sync="dialogShow" width="30%" :before-close="close">
<el-form ref="form" :model="operateModel" label-width="120px" :rules="rules" size="mini">
<el-form-item label="实训名称:" prop="name">
<el-input v-model="operateModel.name"></el-input>
</el-form-item>
<el-form-item label="产品类型:" prop="prdCode">
<el-select v-model="operateModel.prdCode" placeholder="" :disabled="true">
<el-option v-for="option in productTypesList" :key="option.code" :label="option.name"
:value="option.code">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="实训类型:" prop="type">
<el-select v-model="operateModel.type" placeholder="" :disabled="true">
<el-option v-for="option in trainTypesList" :key="option.code" :label="option.name"
:value="option.code">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="操作类型:">
<el-select v-model="operateModel.operateType">
<el-option v-for="(option, index) in operationList" :key="index" :label="option.name"
:value="option.code">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="最小用时:" prop="minDuration">
<el-input-number v-model="operateModel.minDuration" :min="0" :max="10000"></el-input-number>s
</el-form-item>
<el-form-item label="最大用时:" prop="maxDuration">
<el-input-number v-model="operateModel.maxDuration" :min="0" :max="10000"></el-input-number>s
</el-form-item>
<el-form-item label="实训说明:" prop="remarks">
<el-input type="textarea" :autosize="{ minRows: 4, maxRows: 4}" placeholder="请输入内容"
v-model="operateModel.remarks">
</el-input>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="handleClose"> </el-button>
<el-button type="primary" @click="handleDeal"> </el-button>
</span>
</el-dialog>
<el-dialog :title="operation.title" :visible.sync="dialogShow" width="30%" :before-close="close">
<el-form ref="form" :model="operateModel" label-width="120px" :rules="rules" size="mini">
<el-form-item label="实训名称:" prop="name">
<el-input v-model="operateModel.name" />
</el-form-item>
<el-form-item label="产品类型:" prop="prdCode">
<el-select v-model="operateModel.prdCode" placeholder="" :disabled="true">
<el-option
v-for="option in productTypesList"
:key="option.code"
:label="option.name"
:value="option.code"
/>
</el-select>
</el-form-item>
<el-form-item label="实训类型:" prop="type">
<el-select v-model="operateModel.type" placeholder="" :disabled="true">
<el-option
v-for="option in trainTypesList"
:key="option.code"
:label="option.name"
:value="option.code"
/>
</el-select>
</el-form-item>
<el-form-item label="操作类型:">
<el-select v-model="operateModel.operateType">
<el-option
v-for="(option, index) in operationList"
:key="index"
:label="option.name"
:value="option.code"
/>
</el-select>
</el-form-item>
<el-form-item label="最小用时:" prop="minDuration">
<el-input-number v-model="operateModel.minDuration" :min="0" :max="10000" />s
</el-form-item>
<el-form-item label="最大用时:" prop="maxDuration">
<el-input-number v-model="operateModel.maxDuration" :min="0" :max="10000" />s
</el-form-item>
<el-form-item label="实训说明:" prop="remarks">
<el-input
v-model="operateModel.remarks"
type="textarea"
:autosize="{ minRows: 4, maxRows: 4}"
placeholder="请输入内容"
/>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="handleClose"> </el-button>
<el-button type="primary" @click="handleDeal"> </el-button>
</span>
</el-dialog>
</template>
<script>
import { addTraining, updateTraining, getTrainingDetail } from '@/api/jmap/training'
import localStore from 'storejs';
import { addTraining, updateTraining, getTrainingDetail } from '@/api/jmap/training';
import localStore from 'storejs';
export default {
name: 'TreeDraft',
props: {
node: {
type: Object,
required: true
}
},
data() {
var minDurations = (rule, value, callback) => {
if (!value) {
return callback(new Error('请输入标准用时'));
}
setTimeout(() => {
if (!Number.isInteger(value)) {
callback(new Error('请输入数字值'));
} else {
callback();
}
}, 100);
};
var maxDurations = (rule, value, callback) => {
if (!value) {
return callback(new Error('请输入标准用时'));
}
setTimeout(() => {
if (!Number.isInteger(value)) {
callback(new Error('请输入数字值'));
} else {
if (value < this.operateModel.minDuration) {
callback(new Error('必须大于最小时间'));
} else {
callback();
}
}
}, 100);
};
return {
dialogShow: false,
productTypesList: [],
trainTypesList: [],
operationList: [],
trainingOperateTypeMap: {},
operation: {
title: '',
event: ''
},
operateModel: {
id: '',
name: '',
type: '',
prdCode: '',
skinStyle: '',
operateType: '',
maxDuration: 0,
minDuration: 0,
remarks: '',
},
rules: {
name: [
{ required: true, message: '请输入实训名称', trigger: 'change' }
],
minDuration: [
{ required: true, validator: minDurations, trigger: 'blur' }
],
maxDuration: [
{ required: true, validator: maxDurations, trigger: 'blur' }
],
remarks: [
{ required: true, message: '请输入实训说明', trigger: 'change' }
]
}
}
},
watch: {
node: function (val, old) {
this.initLoadData();
},
},
computed: {
},
mounted() {
this.$Dictionary.trainingType().then(list => {
this.trainTypesList = list;
});
this.operationList = [];
this.$Dictionary.stationControl().then(list => {
this.trainingOperateTypeMap['01'] = list; //
});
this.$Dictionary.signalOperation().then(list => {
this.trainingOperateTypeMap['02'] = list; //
});
this.$Dictionary.switchOperation().then(list => {
this.trainingOperateTypeMap['03'] = list; //
});
this.$Dictionary.sectionOperation().then(list => {
this.trainingOperateTypeMap['04'] = list; //
});
this.$Dictionary.stationStandOperation().then(list => {
this.trainingOperateTypeMap['05'] = list; //
});
this.$Dictionary.trainPlanOperation().then(list => {
this.trainingOperateTypeMap['06'] = list; //
});
this.$Dictionary.trainOperation().then(list => {
this.trainingOperateTypeMap['07'] = list; //
});
},
methods: {
initLoadData() {
let node = this.node;
if (this.$refs && this.$refs.form) {
this.$refs['form'].resetFields();
}
if (node && node.data) {
switch (node.data.type) {
case 'trainingType': {
if (node.parent) {
this.operateModel.type = node.data.id;
this.operateModel.prdCode = node.parent.data.id;
this.operateModel.skinStyle = node.parent.parent.data.id;
this.productTypesList = [{
code: node.parent.data.id,
name: node.parent.data.name
}];
export default {
name: 'TreeDraft',
props: {
node: {
type: Object,
required: true
}
},
data() {
var minDurations = (rule, value, callback) => {
if (!value) {
return callback(new Error('请输入标准用时'));
}
setTimeout(() => {
if (!Number.isInteger(value)) {
callback(new Error('请输入数字值'));
} else {
callback();
}
}, 100);
};
var maxDurations = (rule, value, callback) => {
if (!value) {
return callback(new Error('请输入标准用时'));
}
setTimeout(() => {
if (!Number.isInteger(value)) {
callback(new Error('请输入数字值'));
} else {
if (value < this.operateModel.minDuration) {
callback(new Error('必须大于最小时间'));
} else {
callback();
}
}
}, 100);
};
return {
dialogShow: false,
productTypesList: [],
trainTypesList: [],
operationList: [],
trainingOperateTypeMap: {},
operation: {
title: '',
event: ''
},
operateModel: {
id: '',
name: '',
type: '',
prdCode: '',
skinStyle: '',
operateType: '',
maxDuration: 0,
minDuration: 0,
remarks: ''
},
rules: {
name: [
{ required: true, message: '请输入实训名称', trigger: 'change' }
],
minDuration: [
{ required: true, validator: minDurations, trigger: 'blur' }
],
maxDuration: [
{ required: true, validator: maxDurations, trigger: 'blur' }
],
remarks: [
{ required: true, message: '请输入实训说明', trigger: 'change' }
]
}
};
},
computed: {
},
watch: {
node: function (val, old) {
this.initLoadData();
}
},
mounted() {
this.$Dictionary.trainingType().then(list => {
this.trainTypesList = list;
});
this.operationList = [];
this.$Dictionary.stationControl().then(list => {
this.trainingOperateTypeMap['01'] = list; //
});
this.$Dictionary.signalOperation().then(list => {
this.trainingOperateTypeMap['02'] = list; //
});
this.$Dictionary.switchOperation().then(list => {
this.trainingOperateTypeMap['03'] = list; //
});
this.$Dictionary.sectionOperation().then(list => {
this.trainingOperateTypeMap['04'] = list; //
});
this.$Dictionary.stationStandOperation().then(list => {
this.trainingOperateTypeMap['05'] = list; //
});
this.$Dictionary.trainPlanOperation().then(list => {
this.trainingOperateTypeMap['06'] = list; //
});
this.$Dictionary.trainOperation().then(list => {
this.trainingOperateTypeMap['07'] = list; //
});
},
methods: {
initLoadData() {
const node = this.node;
if (this.$refs && this.$refs.form) {
this.$refs['form'].resetFields();
}
if (node && node.data) {
switch (node.data.type) {
case 'trainingType':
if (node.parent) {
this.operateModel.type = node.data.id;
this.operateModel.prdCode = node.parent.data.id;
this.operateModel.skinStyle = node.parent.parent.data.id;
this.productTypesList = [{
code: node.parent.data.id,
name: node.parent.data.name
}];
}
}
this.operateModel.id = '';
this.operateModel.name = '';
this.operateModel.minDuration = '';
this.operateModel.maxDuration = ''
this.operateModel.remarks = '';
this.operateModel.operateType = '';
this.operationList = this.trainingOperateTypeMap[node.data.id] || [];
} break;
case 'training': {
if (node.parent && node.parent.parent) {
this.operateModel.type = node.parent.data.id;
this.operateModel.prdCode = node.parent.parent.data.id;
this.operateModel.skinStyle = node.parent.parent.parent.data.id;
this.operationList = this.trainingOperateTypeMap[node.parent.data.id] || [];
this.productTypesList = [{
code: node.parent.parent.data.id,
name: node.parent.parent.data.name
}];
}
this.operateModel.id = '';
this.operateModel.name = '';
this.operateModel.minDuration = '';
this.operateModel.maxDuration = '';
this.operateModel.remarks = '';
this.operateModel.operateType = '';
this.operationList = this.trainingOperateTypeMap[node.data.id] || [];
break;
case 'training':
if (node.parent && node.parent.parent) {
this.operateModel.type = node.parent.data.id;
this.operateModel.prdCode = node.parent.parent.data.id;
this.operateModel.skinStyle = node.parent.parent.parent.data.id;
this.operationList = this.trainingOperateTypeMap[node.parent.data.id] || [];
this.productTypesList = [{
code: node.parent.parent.data.id,
name: node.parent.parent.data.name
}];
}
this.operateModel.id = node.data.id;
this.operateModel.name = node.data.name;
getTrainingDetail({ id: node.data.id }).then(response => {
this.operateModel.minDuration = response.data.minDuration;
this.operateModel.maxDuration = response.data.maxDuration;
this.operateModel.operateType = response.data.operateType;
this.operateModel.remarks = response.data.remarks
}).catch(error => {
this.$messageBox("获取骤数据失败");
})
} break;
}
}
},
show(data) {
this.operation = data
this.initLoadData();
this.dialogShow = true;
},
close() {
this.dialogShow = false;
},
handleDeal() {
let operation = this.operation;
if (operation) {
let event = operation.event;
switch (event) {
case '01': { this.addTraining(); } break;
case '02': { this.edtTraining(); } break;
}
}
},
handleClose() {
this.dialogShow = false;
this.operateModel = {
id: '',
name: '',
type: '',
prdCode: '',
skinStyle: '',
operateType: '',
maxDuration: 0,
minDuration: 0,
remarks: '',
};
this.$refs['form'].resetFields();
},
addTraining() {
this.$refs.form.validate((valid) => {
if (valid) {
let data = {
name: this.operateModel.name,
type: this.operateModel.type,
prdCode: this.operateModel.prdCode,
skinStyle: this.operateModel.skinStyle,
operateType: this.operateModel.operateType,
minDuration: this.operateModel.minDuration,
maxDuration: this.operateModel.maxDuration,
remarks: this.operateModel.remarks,
}
addTraining(data).then(response => {
this.$emit('refresh', [localStore.get('cityCode') || '', localStore.get('skinStyle') || '']);
this.close();
this.$message.success('添加实训成功!');
}).catch(error => {
this.$messageBox('新增实训失败');
});
}
});
},
edtTraining() {
this.$refs.form.validate((valid) => {
if (valid) {
let data = {
id: this.operateModel.id,
name: this.operateModel.name,
type: this.operateModel.type,
prdCode: this.operateModel.prdCode,
skinStyle: this.operateModel.skinStyle,
operateType: this.operateModel.operateType,
minDuration: this.operateModel.minDuration,
maxDuration: this.operateModel.maxDuration,
remarks: this.operateModel.remarks,
}
updateTraining(data).then(response => {
this.$emit('refresh', [localStore.get('cityCode') || '', localStore.get('skinStyle') || '']);
this.close();
this.$message.success('更新实训成功!');
}).catch(error => {
this.$messageBox('更新实训失败');
});
}
});
}
}
}
this.operateModel.id = node.data.id;
this.operateModel.name = node.data.name;
getTrainingDetail({ id: node.data.id }).then(response => {
this.operateModel.minDuration = response.data.minDuration;
this.operateModel.maxDuration = response.data.maxDuration;
this.operateModel.operateType = response.data.operateType;
this.operateModel.remarks = response.data.remarks;
}).catch(() => {
this.$messageBox('获取骤数据失败');
});
break;
}
}
},
show(data) {
this.operation = data;
this.initLoadData();
this.dialogShow = true;
},
close() {
this.dialogShow = false;
},
handleDeal() {
const operation = this.operation;
if (operation) {
const event = operation.event;
switch (event) {
case '01': this.addTraining(); break;
case '02': this.edtTraining(); break;
}
}
},
handleClose() {
this.dialogShow = false;
this.operateModel = {
id: '',
name: '',
type: '',
prdCode: '',
skinStyle: '',
operateType: '',
maxDuration: 0,
minDuration: 0,
remarks: ''
};
this.$refs['form'].resetFields();
},
addTraining() {
this.$refs.form.validate((valid) => {
if (valid) {
const data = {
name: this.operateModel.name,
type: this.operateModel.type,
prdCode: this.operateModel.prdCode,
skinStyle: this.operateModel.skinStyle,
operateType: this.operateModel.operateType,
minDuration: this.operateModel.minDuration,
maxDuration: this.operateModel.maxDuration,
remarks: this.operateModel.remarks
};
addTraining(data).then(response => {
this.$emit('refresh', [localStore.get('cityCode') || '', localStore.get('skinStyle') || '']);
this.close();
this.$message.success('添加实训成功!');
}).catch(() => {
this.$messageBox('新增实训失败');
});
}
});
},
edtTraining() {
this.$refs.form.validate((valid) => {
if (valid) {
const data = {
id: this.operateModel.id,
name: this.operateModel.name,
type: this.operateModel.type,
prdCode: this.operateModel.prdCode,
skinStyle: this.operateModel.skinStyle,
operateType: this.operateModel.operateType,
minDuration: this.operateModel.minDuration,
maxDuration: this.operateModel.maxDuration,
remarks: this.operateModel.remarks
};
updateTraining(data).then(response => {
this.$emit('refresh', [localStore.get('cityCode') || '', localStore.get('skinStyle') || '']);
this.close();
this.$message.success('更新实训成功!');
}).catch(() => {
this.$messageBox('更新实训失败');
});
}
});
}
}
};
</script>

View File

@ -1,126 +1,125 @@
<template>
<div>
<pop-menu ref="popMenu" :menu="menu"></pop-menu>
<training-draft ref="draft" :node="node" @refresh="refresh"></training-draft>
</div>
<div>
<pop-menu ref="popMenu" :menu="menu" />
<training-draft ref="draft" :node="node" @refresh="refresh" />
</div>
</template>
<script>
import { DeviceMenu } from '@/scripts/ConstDic';
import { launchFullscreen } from '@/utils/screen';
import PopMenu from '@/components/PopMenu';
import TrainingDraft from './draft';
import { DeviceMenu } from '@/scripts/ConstDic';
import { launchFullscreen } from '@/utils/screen';
import PopMenu from '@/components/PopMenu';
import TrainingDraft from './draft';
export default {
name: 'TrainingOperateMenu',
components: {
PopMenu,
TrainingDraft
},
props: {
point: {
type: Object,
required: true
},
node: {
type: Object,
required: true
}
},
data() {
return {
menuShow: false,
menu: [],
menuCreate: [
{
label: '添加实训',
handler: this.addTrainging
},
],
menuEdit: [
{
label: '修改实训',
handler: this.edtTrainging
},
{
label: '演示',
handler: this.startTraining
}
export default {
name: 'TrainingOperateMenu',
components: {
PopMenu,
TrainingDraft
},
props: {
point: {
type: Object,
required: true
},
node: {
type: Object,
required: true
}
},
data() {
return {
menuShow: false,
menu: [],
menuCreate: [
{
label: this.$t('lesson.addTraining'),
handler: this.addTrainging
}
],
menuEdit: [
{
label: this.$t('lesson.editTraining'),
handler: this.edtTrainging
},
{
label: this.$t('lesson.demonstration'),
handler: this.startTraining
}
]
}
},
watch: {
node: function (val, old) {
if (val && val.data) {
switch (val.data.type) {
case 'trainingType': {
this.menu = this.menuCreate
} break;
case 'training': {
this.menu = this.menuEdit
} break;
}
}
},
'$store.state.menuOperation.menuCount': function (val) {
if (this.$store.getters['menuOperation/checkDialogIsOpen'](DeviceMenu.Training)) {
this.doShow(this.$store.state.menuOperation.menuPosition);
} else {
this.doClose();
}
}
},
mounted() {
this.closeEvent();
},
methods: {
closeEvent() {
let self = this;
window.onclick = function (e) {
self.doClose();
}
},
doShow(point) {
this.closeEvent();
if (this.$refs && this.$refs.popMenu) {
this.$refs.popMenu.resetShowPosition(point);
}
this.menuShow = true;
},
doClose() {
if (this.$refs && this.$refs.popMenu) {
this.$refs.popMenu.close();
}
this.menuShow = false;
},
addTrainging() {
this.$refs.draft.show({ event: '01', title: '添加实训' });
},
edtTrainging() {
this.$refs.draft.show({ event: '02', title: '编辑实训' });
},
delTrainging() {
let _that = this;
this.$confirm('是否确认删除?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
}).catch(() => {
this.$message.info({ message: '已取消删除' });
});
},
startTraining() {
this.$emit('trainingShow');
this.doClose();
setTimeout(() => {
launchFullscreen();
}, 0);
},
refresh(filterSelect) {
this.$emit('refresh', filterSelect);
}
}
}
]
};
},
watch: {
node: function (val, old) {
if (val && val.data) {
switch (val.data.type) {
case 'trainingType':
this.menu = this.menuCreate;
break;
case 'training':
this.menu = this.menuEdit;
break;
}
}
},
'$store.state.menuOperation.menuCount': function (val) {
if (this.$store.getters['menuOperation/checkDialogIsOpen'](DeviceMenu.Training)) {
this.doShow(this.$store.state.menuOperation.menuPosition);
} else {
this.doClose();
}
}
},
mounted() {
this.closeEvent();
},
methods: {
closeEvent() {
const self = this;
window.onclick = function (e) {
self.doClose();
};
},
doShow(point) {
this.closeEvent();
if (this.$refs && this.$refs.popMenu) {
this.$refs.popMenu.resetShowPosition(point);
}
this.menuShow = true;
},
doClose() {
if (this.$refs && this.$refs.popMenu) {
this.$refs.popMenu.close();
}
this.menuShow = false;
},
addTrainging() {
this.$refs.draft.show({ event: '01', title: this.$t('lesson.addTraining') });
},
edtTrainging() {
this.$refs.draft.show({ event: '02', title: this.$t('lesson.editTraining') });
},
delTrainging() {
this.$confirm(this.$t('lesson.isConfirmDelete'), this.$t('global.tips'), {
confirmButtonText: this.$t('global.confirm'),
cancelButtonText: this.$t('global.cancel'),
type: 'warning'
}).then(() => {
}).catch(() => {
this.$message.info({ message: this.$t('lesson.hasCalcelDelete') });
});
},
startTraining() {
this.$emit('trainingShow');
this.doClose();
setTimeout(() => {
launchFullscreen();
}, 0);
},
refresh(filterSelect) {
this.$emit('refresh', filterSelect);
}
}
};
</script>

View File

@ -1,124 +1,134 @@
<template>
<el-card class="map-list-main" v-loading="loading">
<div slot="header" class="clearfix">
<span>实训列表</span>
<el-card v-loading="loading" class="map-list-main">
<div slot="header" class="clearfix">
<span>{{ $t(`lesson.trainingList`) }}</span>
</div>
<el-input v-model="filterText" :placeholder="$t(`lesson.filterPlaceholder`)" clearable />
<el-scrollbar wrap-class="scrollbar-wrapper" :style="{ height: (height-60) +'px' }">
<el-tree
ref="tree"
:data="treeData"
:props="defaultProps"
node-key="id"
:default-expanded-keys="defaultShowKeys"
:filter-node-method="filterNode"
expand-on-click-node
highlight-current
:span="22"
@node-contextmenu="showContextMenu"
@node-click="clickEvent"
>
<div slot-scope="{ node: nodeScop }">
<span v-if="nodeScop.data.type == 'skin'" class="el-icon-news">&nbsp;{{ nodeScop.label }}</span>
<span v-else-if="nodeScop.data.type == 'prd'" class="el-icon-tickets">&nbsp;{{ nodeScop.label }}</span>
<span
v-else-if="nodeScop.data.type == 'trainingType'"
class="el-icon-document"
>&nbsp;{{ nodeScop.label }}</span>
<span
v-else-if="nodeScop.data.type == 'training'"
class="el-icon-edit-outline"
>&nbsp;{{ nodeScop.label }}</span>
</div>
<el-input placeholder="输入关键字进行过滤" v-model="filterText" clearable></el-input>
<el-scrollbar wrapClass="scrollbar-wrapper" :style="{ height: (height-60) +'px' }">
<el-tree ref="tree" :data="treeData" :props="defaultProps" node-key="id"
:default-expanded-keys="defaultShowKeys" :filter-node-method="filterNode"
@node-contextmenu="showContextMenu" expand-on-click-node highlight-current @node-click="clickEvent"
:span=22>
<div slot-scope="{ node }">
<span v-if="node.data.type == 'skin'" class="el-icon-news">&nbsp;{{ node.label }}</span>
<span v-else-if="node.data.type == 'prd'" class="el-icon-tickets">&nbsp;{{ node.label }}</span>
<span v-else-if="node.data.type == 'trainingType'"
class="el-icon-document">&nbsp;{{ node.label }}</span>
<span v-else-if="node.data.type == 'training'"
class="el-icon-edit-outline">&nbsp;{{ node.label }}</span>
</div>
</el-tree>
</el-scrollbar>
<operate-menu ref="menu" :point="point" :node="node" @refresh="refresh" @trainingShow="trainingShow">
</operate-menu>
</el-card>
</el-tree>
</el-scrollbar>
<operate-menu ref="menu" :point="point" :node="node" @refresh="refresh" @trainingShow="trainingShow" />
</el-card>
</template>
<script>
import { DeviceMenu } from '@/scripts/ConstDic';
import { getTrainingTree } from '@/api/jmap/training';
import OperateMenu from './operateMenu';
import { DeviceMenu } from '@/scripts/ConstDic';
import { getTrainingTree } from '@/api/jmap/training';
import OperateMenu from './operateMenu';
export default {
name: 'TrainingOperate',
components: {
OperateMenu
},
props: {
height: {
type: Number,
required: true
}
},
data() {
return {
loading: true,
defaultShowKeys: [],
filterText: '',
treeData: [],
defaultProps: {
children: 'children',
label: 'name'
},
point: {
x: 0,
y: 0
},
node: {
}
};
},
watch: {
filterText(val) {
this.$refs.tree.filter(val);
}
},
mounted() {
this.refresh();
},
methods: {
filterNode(value, data) {
if (!value) return true;
return data.name.indexOf(value) !== -1;
},
clickEvent(obj, node, data) {
this.$store.dispatch('menuOperation/setPopMenu', { position: null, menu: null });
if (obj && obj.type === 'training') {
this.$emit('selectMapSure', obj);
}
},
showContextMenu(e, obj, node, vueElem) {
if (obj && obj.type === 'trainingType' || obj.type === 'training') {
e.preventDefault();
this.point = {
x: e.clientX,
y: e.clientY
};
this.node = node;
const menu = DeviceMenu.Training;
this.$store.dispatch('menuOperation/setPopMenu', { position: this.point, menu: menu });
}
},
getParent(node) {
while (node && node.data.type != 'skin') {
node = node.parent;
}
export default {
name: 'TrainingOperate',
components: {
OperateMenu
},
props: {
height: {
type: Number
}
},
data() {
return {
loading: true,
defaultShowKeys: [],
filterText: '',
treeData: [],
defaultProps: {
children: 'children',
label: 'name'
},
point: {
x: 0,
y: 0
},
node: {
}
}
},
watch: {
filterText(val) {
this.$refs.tree.filter(val);
}
},
mounted() {
this.refresh();
},
methods: {
filterNode(value, data) {
if (!value) return true;
return data.name.indexOf(value) !== -1;
},
clickEvent(obj, node, data) {
this.$store.dispatch('menuOperation/setPopMenu', { position: null, menu: null });
if (obj && 'training' === obj.type) {
this.$emit('selectMapSure', obj);
}
},
showContextMenu(e, obj, node, vueElem) {
if (obj && 'trainingType' === obj.type || 'training' === obj.type) {
e.preventDefault();
this.point = {
x: e.clientX,
y: e.clientY
}
this.node = node;
let menu = DeviceMenu.Training;
this.$store.dispatch('menuOperation/setPopMenu', { position: this.point, menu: menu });
}
},
getParent(node) {
while (true) {
if (!node || node.data.type === 'skin') {
return node
}
node = node.parent;
}
return {}
},
trainingShow() {
this.$emit('trainingStart', { id: this.node.data.id, lessonId: this.getParent(this.node).data.id })
},
refresh() {
this.loading = true;
getTrainingTree().then(response => {
this.treeData = response.data;
this.defaultShowKeys = [this.$route.params.trainingId];
this.$nextTick(() => {
this.loading = false;
this.$refs.tree.setCurrentKey(this.$route.params.trainingId); // value node-key
if (this.filterText) {
this.$refs.tree.filter(this.filterText);
}
});
}).catch(error => {
this.loading = false;
this.$messageBox('刷新失败')
});
}
}
}
return node || {};
},
trainingShow() {
this.$emit('trainingStart', { id: this.node.data.id, lessonId: this.getParent(this.node).data.id });
},
refresh() {
this.loading = true;
getTrainingTree().then(response => {
this.treeData = response.data;
this.defaultShowKeys = [this.$route.params.trainingId];
this.$nextTick(() => {
this.loading = false;
this.$refs.tree.setCurrentKey(this.$route.params.trainingId); // value node-key
if (this.filterText) {
this.$refs.tree.filter(this.filterText);
}
});
}).catch(() => {
this.loading = false;
this.$messageBox(this.$t('error.refreshFailed'));
});
}
}
};
</script>
<style>

View File

@ -73,7 +73,7 @@ export default {
this.group = resp.data;
this.$router.push({ path: `${UrlConfig.lesson.record}/${data.id}/${data.name}`, query: { group: resp.data } });
}).catch(error => {
this.$messageBox(`创建仿真失败: ${error.message}`);
this.$messageBox(`${this.$t('error.createSimulationFailed')}: ${error.message}`);
});
},
trainingStart(data) {
@ -81,7 +81,7 @@ export default {
trainingNotify({ trainingId: data.id }).then(resp => {
this.$router.push({ path: `${UrlConfig.display}/record`, query: { trainingId: this.$route.params.trainingId, trainingName: this.$route.params.trainingName, group: resp.data, lessonId: 0 } });
}).catch(error => {
this.$messageBox(`创建仿真失败: ${error.message}`);
this.$messageBox(`${this.$t('error.createSimulationFailed')}: ${error.message}`);
});
},
drapWidth(width) {

View File

@ -81,12 +81,12 @@ export default {
this.$store.dispatch('training/setPrdType', res.data.prdType);
this.$store.dispatch('training/setTrainingData', stepdData);
}).catch(() => {
this.$messageBox('加载地图数据失败');
this.$messageBox(this.$t('error.loadMapDataFailed'));
this.endViewLoading();
});
});
}).catch(() => {
this.$messageBox('获取实训步骤数据失败');
this.$messageBox(this.$t('error.getMapStepsFailed'));
this.endViewLoading();
});
} else {

View File

@ -1,85 +1,87 @@
<template>
<el-card class="map-list-main">
<div slot="header" class="clearfix">
<span>
实训名称
<b>{{ trainingName}}</b>
</span>
<el-button type="text" :disabled="started" @click="reset" style="float: right; padding: 3px 0">重置</el-button>
</div>
<el-tabs class="ViewControl" type="card" v-model="enabledTab">
<el-tab-pane label="车站列表" name="StationList">
<station-list-operate ref="stationList" :height="stationListHeight" @getStationObj="getStationObj"></station-list-operate>
</el-tab-pane>
<el-tab-pane label="步骤信息" name="StepInfo">
<step-Info-operate ref="stepInfo" :height="stepDraftHeight" :trainingObj="trainingObj" :stationObj="stationObj"></step-Info-operate>
</el-tab-pane>
</el-tabs>
</el-card>
<el-card class="map-list-main">
<div slot="header" class="clearfix">
<span>
{{ $t('lesson.trainingName') }} :
<b>{{ trainingName }}</b>
</span>
<el-button type="text" :disabled="started" style="float: right; padding: 3px 0" @click="reset">{{ $t('global.reset') }}</el-button>
</div>
<el-tabs v-model="enabledTab" class="ViewControl" type="card">
<el-tab-pane :label="$t('lesson.stationList')" name="StationList">
<station-list-operate ref="stationList" :height="stationListHeight" @getStationObj="getStationObj" />
</el-tab-pane>
<el-tab-pane :label="$t('lesson.stepInfo')" name="StepInfo">
<step-Info-operate ref="stepInfo" :height="stepDraftHeight" :training-obj="trainingObj" :station-obj="stationObj" />
</el-tab-pane>
</el-tabs>
</el-card>
</template>
<script>
import zrender from 'zrender'
import { mapGetters } from 'vuex';
import StepInfoOperate from './stepinfo/index';
import StationListOperate from './stationlist/index';
import WindowResizeHandler from '@/mixin/WindowResizeHandler';
import { mapGetters } from 'vuex';
import StepInfoOperate from './stepinfo/index';
import StationListOperate from './stationlist/index';
import WindowResizeHandler from '@/mixin/WindowResizeHandler';
export default {
name: 'LessonDraft',
components: {
StepInfoOperate,
StationListOperate
},
props: {
trainingObj: {
type: Object
}
},
mixins: [
WindowResizeHandler
],
data() {
return {
enabledTab: 'StationList',
stationObj: null,
stationListHeight: 0,
stepDraftHeight: 0,
point: {
x: 0,
y: 0
}
}
},
computed: {
mapName: function () {
return this.map.name || '请选择地图';
},
trainingName: function () {
let name = '请选择实训'
if (this.trainingObj) {
name = this.trainingObj.name;
}
return name;
},
...mapGetters('map', [
'map'
]),
...mapGetters('training', [
'started',
]),
},
methods: {
resizeHandler: function () {
this.stepDraftHeight = this._clientHeight - 150;
this.stationListHeight = this._clientHeight - 195;
},
getStationObj: function (data) {
this.stationObj = data;
},
reset() {
this.$refs.stepInfo.reset();
}
}
}
export default {
name: 'LessonDraft',
components: {
StepInfoOperate,
StationListOperate
},
mixins: [
WindowResizeHandler
],
props: {
trainingObj: {
type: Object,
default() {
return null;
}
}
},
data() {
return {
enabledTab: 'StationList',
stationObj: null,
stationListHeight: 0,
stepDraftHeight: 0,
point: {
x: 0,
y: 0
}
};
},
computed: {
mapName: function () {
return this.map.name || this.$t('lesson.selectMap');
},
trainingName: function () {
let name = this.$t('lesson.selectTraining');
if (this.trainingObj) {
name = this.trainingObj.name;
}
return name;
},
...mapGetters('map', [
'map'
]),
...mapGetters('training', [
'started'
])
},
methods: {
resizeHandler: function () {
this.stepDraftHeight = this._clientHeight - 150;
this.stationListHeight = this._clientHeight - 195;
},
getStationObj: function (data) {
this.stationObj = data;
},
reset() {
this.$refs.stepInfo.reset();
}
}
};
</script>

View File

@ -1,73 +1,82 @@
<template>
<div class="mainContext">
<el-input placeholder="输入关键字查询车站" v-model="filterText" clearable> </el-input>
<div class="treeMenu" :style="{ height: height +'px' }">
<el-scrollbar wrapClass="scrollbar-wrapper">
<el-tree ref="StationTree" class="treeList" :data="stationData" :props="defaultProps"
:filter-node-method="filterNode" accordion @node-click="clickEvent" default-expand-all
:expand-on-click-node="false">
<span slot-scope="{ node, data }"> {{ node.label }}</span>
</el-tree>
</el-scrollbar>
</div>
<div class="mainContext">
<el-input v-model="filterText" :placeholder="$t('lesson.findStationPlaceholder')" clearable />
<div class="treeMenu" :style="{ height: height +'px' }">
<el-scrollbar wrap-class="scrollbar-wrapper">
<el-tree
ref="StationTree"
class="treeList"
:data="stationData"
:props="defaultProps"
:filter-node-method="filterNode"
accordion
default-expand-all
:expand-on-click-node="false"
@node-click="clickEvent"
>
<span slot-scope="{ node }"> {{ node.label }}</span>
</el-tree>
</el-scrollbar>
</div>
</div>
</template>
<script>
import { mapGetters } from 'vuex';
import { mapGetters } from 'vuex';
export default {
name: 'StationListOperate',
props: {
height: {
type: Number
},
},
data() {
return {
filterText: '',
stationData: [],
defaultProps: {
children: 'children',
label: 'label'
}
}
},
computed: {
...mapGetters('map', [
'stationList'
])
},
watch: {
'stationList': function (val, old) {
if (val) {
this.stationData = [];
val.forEach(elem => {
if (elem.visible) {
this.stationData.push({
id: elem.code,
label: elem.name
});
}
});
}
},
filterText(val) {
this.$refs.StationTree.filter(val);
}
},
mounted() {
},
methods: {
filterNode(value, data) {
if (!value) return true;
return data.label.indexOf(value) !== -1;
},
clickEvent(obj, node, data) {
this.$store.dispatch('training/updateOffsetStationCode', { offsetStationCode: obj.id });
this.$emit('getStationObj', obj);
}
}
}
export default {
name: 'StationListOperate',
props: {
height: {
type: Number,
required: true
}
},
data() {
return {
filterText: '',
stationData: [],
defaultProps: {
children: 'children',
label: 'label'
}
};
},
computed: {
...mapGetters('map', [
'stationList'
])
},
watch: {
'stationList': function (val, old) {
if (val) {
this.stationData = [];
val.forEach(elem => {
if (elem.visible) {
this.stationData.push({
id: elem.code,
label: elem.name
});
}
});
}
},
filterText(val) {
this.$refs.StationTree.filter(val);
}
},
mounted() {
},
methods: {
filterNode(value, data) {
if (!value) return true;
return data.label.indexOf(value) !== -1;
},
clickEvent(obj, node, data) {
this.$store.dispatch('training/updateOffsetStationCode', { offsetStationCode: obj.id });
this.$emit('getStationObj', obj);
}
}
};
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
.treeList {

View File

@ -1,49 +1,51 @@
<template>
<el-tabs>
<el-scrollbar wrapClass="scrollbar-wrapper">
<div class="mainContext" :style="{height: height +'px' }">
<step-operate ref="step" :trainingObj="trainingObj" :stationObj="stationObj"></step-operate>
<list-operate ref="list" :trainingObj="trainingObj"></list-operate>
</div>
</el-scrollbar>
</el-tabs>
<el-tabs>
<el-scrollbar wrap-class="scrollbar-wrapper">
<div class="mainContext" :style="{height: height +'px' }">
<step-operate ref="step" :training-obj="trainingObj" :station-obj="stationObj" />
<list-operate ref="list" :training-obj="trainingObj" />
</div>
</el-scrollbar>
</el-tabs>
</template>
<script>
import ListOperate from './list';
import StepOperate from './step';
import ListOperate from './list';
import StepOperate from './step';
export default {
name: 'StepInfoOperate',
components: {
ListOperate,
StepOperate
},
props: {
height: {
type: Number
},
stationObj: {
type: Object
},
trainingObj: {
type: Object
}
},
data() {
return {
}
},
watch: {
trainingObj: function (val, old) {
if (val) {
}
}
},
methods: {
reset: function () {
this.$refs.step.reset();
}
}
}
export default {
name: 'StepInfoOperate',
components: {
ListOperate,
StepOperate
},
props: {
height: {
type: Number,
required: true
},
stationObj: {
type: Object,
default() {
return null;
}
},
trainingObj: {
type: Object,
default() {
return null;
}
}
},
data() {
return {
};
},
watch: {
},
methods: {
reset: function () {
this.$refs.step.reset();
}
}
};
</script>

View File

@ -1,40 +1,37 @@
<template>
<div class="mainContext">
<el-table ref="stepTree" :data="steps" border style="width: 100%; padding-bottom: 30px;" height="320px">
<el-table-column prop="order" label="步骤编号" width="80">
</el-table-column>
<el-table-column prop="code" label="设备编号" width="180">
</el-table-column>
<el-table-column prop="operation" label="操作类型">
</el-table-column>
</el-table>
</div>
<div class="mainContext">
<el-table ref="stepTree" :data="steps" border style="width: 100%; padding-bottom: 30px;" height="320px">
<el-table-column prop="order" :label="$t('lesson.stepNo')" width="80" />
<el-table-column prop="code" :label="$t('lesson.deviceNumber')" width="180" />
<el-table-column prop="operation" :label="$t('lesson.operationType')" />
</el-table>
</div>
</template>
<script>
import { mapGetters } from 'vuex';
import { mapGetters } from 'vuex';
export default {
name: 'TreeOperate',
props: {
stepData: {
type: Object
},
trainingObj: {
type: Object
}
},
data() {
return {
export default {
name: 'TreeOperate',
props: {
trainingObj: {
type: Object,
default() {
return null;
}
}
},
data() {
return {
}
},
computed: {
...mapGetters('training', [
'steps'
])
},
methods: {
};
},
computed: {
...mapGetters('training', [
'steps'
])
},
methods: {
}
}
}
};
</script>

View File

@ -1,41 +1,45 @@
<template>
<div class="mainContext">
<el-form ref="form" label-width="90px" :model="stepModel" :rules="rules" size="mini">
<el-form-item label="模式选择:">
<el-form ref="form" :label-width="$i18n.locale == 'zh'? '90px': '140px'" :model="stepModel" :rules="rules" size="mini">
<el-form-item :label="`${$t('lesson.selectMode')}:`">
<el-radio-group v-model="modeSelect" size="mini" @change="changeOperateMode">
<el-radio :label="OperateMode.ADMIN" border>教练模式</el-radio>
<el-radio :label="OperateMode.NORMAL" border>正常模式</el-radio>
<el-radio :label="OperateMode.ADMIN" border>{{ $t('global.coachingModel') }}</el-radio>
<el-radio :label="OperateMode.NORMAL" border>{{ $t('global.normalMode') }}</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="步骤序号:">
<el-form-item :label="`${$t('lesson.stepNo')}:`">
<el-input v-model="index" :disabled="true" />
</el-form-item>
<el-form-item label="设备编号:" prop="code">
<el-form-item :label="`${$t('lesson.deviceNumber')}:`" prop="code">
<el-input v-model="stepModel.code" :disabled="true" />
</el-form-item>
<el-form-item label="设备类型:" prop="type">
<el-form-item :label="`${$t('lesson.deviceType')}:`" prop="type">
<el-input v-model="stepModel.type" :disabled="true" />
</el-form-item>
<el-form-item label="操作类型:" prop="operation">
<el-form-item :label="`${$t('lesson.operationType')}:`" prop="operation">
<el-input v-model="stepModel.operation" :disabled="true" />
</el-form-item>
<el-form-item label="返回值:" prop="returnCode">
<el-form-item :label="`${$t('lesson.returnValue')}:`" prop="returnCode">
<el-input v-model="stepModel.returnCode" :disabled="true" />
</el-form-item>
<el-form-item label="提示语:" prop="tipMessage">
<el-form-item :label="`${$t('lesson.tips')}:`" prop="tipMessage">
<el-input
v-model="stepModel.tipMessage"
type="textarea"
:autosize="{ minRows: 4, maxRows: 4}"
placeholder="请输入内容"
/>
</el-form-item>
<el-form-item>
<el-button-group>
<el-button :loading="saveLoading" :disabled="saveDisabled" size="small" @click="start">开始制作
<el-button :loading="saveLoading" :disabled="saveDisabled" size="small" @click="start">
{{ $t('lesson.startRecording') }}
</el-button>
<el-button v-if="started" size="small" @click="next">
{{ $t('lesson.nextStep') }}
</el-button>
<el-button v-if="started" size="small" @click="end">
{{ $t('lesson.endRecording') }}
</el-button>
<el-button v-if="started" size="small" @click="next">下一步</el-button>
<el-button v-if="started" size="small" @click="end">结束制作</el-button>
</el-button-group>
</el-form-item>
</el-form>
@ -52,11 +56,14 @@ export default {
name: 'StepOperate',
props: {
trainingObj: {
type: Object
type: Object,
default() {
return null;
}
},
stationObj: {
type: Object,
default: function () {
default () {
return { id: '', name: '' };
}
}
@ -88,9 +95,9 @@ export default {
]),
rules() {
return {
type: { required: true, message: '设备类型码不能为空', trigger: 'change' },
operation: { required: true, message: '操作码不能为空', trigger: 'change' },
tipMessage: { required: true, message: '请输入提示信息', trigger: 'change' }
type: { required: true, message: this.$t('rules.deviceTypeNotNull'), trigger: 'change' },
operation: { required: true, message: this.$t('rules.operationTypeNotNull'), trigger: 'change' },
tipMessage: { required: true, message: this.$t('rules.tipsNotNull'), trigger: 'change' }
};
},
group() {
@ -139,7 +146,7 @@ export default {
});
});
}).catch(() => {
this.$messageBox('重置失败');
this.$messageBox(this.$t('error.resetFailed'));
});
}
},
@ -157,11 +164,11 @@ export default {
this.saveLoading = false;
this.saveDisabled = true;
}).catch(() => {
this.$messageBox('开始实训失败');
this.$messageBox(this.$t('error.startTrainingFailed'));
this.saveLoading = false;
});
}).catch(() => {
this.$messageBox('保存背景失败');
this.$messageBox(this.$t('error.saveBackgroundFailed'));
this.saveLoading = false;
});
}
@ -212,7 +219,7 @@ export default {
this.$store.dispatch('training/emitTipFresh');
this.$message.success('保存步骤数据成功');
this.saveDisabled = false;
}).catch(error => {
}).catch(() => {
this.saveDisabled = false;
this.$messageBox('保存步骤数据失败');
});

View File

@ -131,6 +131,7 @@ export default {
if (file && skinStyle) {
const loading = this.$loading({
lock: true,
visible: true,
text: '正在导入中...',
spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.7)'
@ -159,7 +160,7 @@ export default {
for (const index in wb.Sheets) {
jsonData = PlanConvert.importData(wb.Sheets[index], jsonData);
}
console.log(jsonData, '数列表');
importRunPlan({ skinStyle: skinStyle, runPlanList: jsonData }).then(response => {
loading.close();
that.refresh();