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 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 { 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 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 { 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文本 textAContent: 'A'// textA文本
}, },
trainNumber: { trainNumber: {
trainNumberOffset: { x: 0, y: 1}// 目的地码偏移量
}, },
trainServer: { trainServer: {
serviceNumberPrefix: '00', // 服务号(表号)前缀 serviceNumberPrefix: '00', // 服务号(表号)前缀

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -1,34 +1,36 @@
<template> <template>
<div> <div class="tab-pane-big">
<div class="actionList"> <el-scrollbar wrapClass="scrollbar-wrapper" ref="elActionScrollbar">
<i class="el-icon-back" @click="backToMember"></i> <div class="actionList">
<span class="titleStyle">{{memberName}}角色<span class="titleStyle">/</span><span class="titleStyle">{{behaviorName}}行为</span><span class="titleStyle">/</span><span class="titleStyle">动作信息</span></span> <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> </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> </template>
<script> <script>
import Vue from 'vue'; import Vue from 'vue';
import AddAction from './addAction'; import AddAction from './addAction';
import {getMembersByGroup,deleteMemberBehaviorAction} from '@/api/simulation'; import {getQuestRecord,deleteMemberBehaviorAction} from '@/api/simulation';
export default { export default {
name: 'getAction', name: 'getAction',
props: { props: {
@ -68,8 +70,8 @@
let group=obj.group; let group=obj.group;
let memberId=this.$props.memberId; let memberId=this.$props.memberId;
let behaviorId=this.$props.behaviorId; let behaviorId=this.$props.behaviorId;
getMembersByGroup(group).then(response=>{ getQuestRecord(group).then(response=>{
let datalist=response.data; let datalist=response.data.memberVOList;
let behaviorList=datalist.find(elem=>{return elem.id==memberId}).behaviorVOList; let behaviorList=datalist.find(elem=>{return elem.id==memberId}).behaviorVOList;
this.actionList=behaviorList.find(elem=>{return elem.id==behaviorId}).actionVOList; this.actionList=behaviorList.find(elem=>{return elem.id==behaviorId}).actionVOList;
this.loading=false; this.loading=false;
@ -96,7 +98,8 @@
this.reloadTable(); this.reloadTable();
}, },
modifyAction(row){ modifyAction(row){
this.$emit('backToTop'); var div = this.$refs['elActionScrollbar'].$refs['wrap'];
div.scrollTop=0;
this.operateType="modify"; this.operateType="modify";
this.buttonName="修改动作" this.buttonName="修改动作"
this.$refs.addBehavior.doShow(row); this.$refs.addBehavior.doShow(row);

View File

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

View File

@ -60,6 +60,7 @@
this.$store.dispatch('scriptRecord/updateDeviceCondition', deviceConditionList); this.$store.dispatch('scriptRecord/updateDeviceCondition', deviceConditionList);
this.$store.dispatch('scriptRecord/updateMemberList', response.data.memberVOList); this.$store.dispatch('scriptRecord/updateMemberList', response.data.memberVOList);
this.$store.dispatch('scriptRecord/updateScript', response.data.script); this.$store.dispatch('scriptRecord/updateScript', response.data.script);
debugger;
if(response.data.mapLocation) if(response.data.mapLocation)
{ {
let mapLocation={"offsetX":response.data.mapLocation.x,"offsetY":response.data.mapLocation.y,"scaleRate":response.data.mapLocation.scale}; 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> <role-condition-script :group="group" @getBehaviorList="getBehaviorList"></role-condition-script>
</template> </template>
<template v-if="displayType=='behavior'"> <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>
<template v-if="displayType=='action'"> <template v-if="displayType=='action'">
<div class="tab-pane-big"> <get-action ref="getAction" :group="group" :memberId="memberId" :behaviorId="behaviorId" @backToBehavior="backToBehavior"></get-action>
<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>
</template> </template>
<el-button-group class="button-group"> <el-button-group class="button-group">
<el-button type="primary" @click="saveMaplocation">更新定位</el-button> <el-button type="primary" @click="saveMaplocation">更新定位</el-button>
@ -138,10 +134,6 @@
this.displayType="behavior"; this.displayType="behavior";
this.memberId=id; this.memberId=id;
}, },
backToActionTop(){
var div = this.$refs['elActionScrollbar'].$refs['wrap'];
div.scrollTop=0;
},
saveMaplocation() saveMaplocation()
{ {
let data=Vue.prototype.$jlmap.$options; 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" /> <zoom-box v-if="!isScreen" :scale-rate="dataZoom.scaleRate" @setShrink="setShrink" @setMagnify="setMagnify" />
<div v-if="show" class="zoom-view" :style="{ width: width +'px'}"> <div v-if="show" class="zoom-view" :style="{ width: width +'px'}">
<el-form :model="dataZoom" label-width="60px" size="mini" inline> <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-input v-model="dataZoom.offsetX" :disabled="true" />
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-input v-model="dataZoom.offsetY" :disabled="true" /> <el-input v-model="dataZoom.offsetY" :disabled="true" />
</el-form-item> </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-input v-model="dataZoom.scaleRate" :disabled="true" />
</el-form-item> </el-form-item>
</el-form> </el-form>

View File

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

View File

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

View File

@ -1,124 +1,134 @@
<template> <template>
<el-card class="map-list-main" v-loading="loading"> <el-card v-loading="loading" class="map-list-main">
<div slot="header" class="clearfix"> <div slot="header" class="clearfix">
<span>实训列表</span> <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> </div>
<el-input placeholder="输入关键字进行过滤" v-model="filterText" clearable></el-input> </el-tree>
<el-scrollbar wrapClass="scrollbar-wrapper" :style="{ height: (height-60) +'px' }"> </el-scrollbar>
<el-tree ref="tree" :data="treeData" :props="defaultProps" node-key="id" <operate-menu ref="menu" :point="point" :node="node" @refresh="refresh" @trainingShow="trainingShow" />
:default-expanded-keys="defaultShowKeys" :filter-node-method="filterNode" </el-card>
@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>
</template> </template>
<script> <script>
import { DeviceMenu } from '@/scripts/ConstDic'; import { DeviceMenu } from '@/scripts/ConstDic';
import { getTrainingTree } from '@/api/jmap/training'; import { getTrainingTree } from '@/api/jmap/training';
import OperateMenu from './operateMenu'; 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 { return node || {};
name: 'TrainingOperate', },
components: { trainingShow() {
OperateMenu this.$emit('trainingStart', { id: this.node.data.id, lessonId: this.getParent(this.node).data.id });
}, },
props: { refresh() {
height: { this.loading = true;
type: Number getTrainingTree().then(response => {
} this.treeData = response.data;
}, this.defaultShowKeys = [this.$route.params.trainingId];
data() { this.$nextTick(() => {
return { this.loading = false;
loading: true, this.$refs.tree.setCurrentKey(this.$route.params.trainingId); // value node-key
defaultShowKeys: [], if (this.filterText) {
filterText: '', this.$refs.tree.filter(this.filterText);
treeData: [], }
defaultProps: { });
children: 'children', }).catch(() => {
label: 'name' this.loading = false;
}, this.$messageBox(this.$t('error.refreshFailed'));
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('刷新失败')
});
}
}
}
</script> </script>
<style> <style>
@ -129,4 +139,4 @@
.el-tree-node.is-current>.el-tree-node__content { .el-tree-node.is-current>.el-tree-node__content {
background-color: #e4e3e3 !important; background-color: #e4e3e3 !important;
} }
</style> </style>

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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