Merge remote-tracking branch 'origin/dev' into test

This commit is contained in:
fan 2019-10-21 16:08:07 +08:00
commit 04bebc8201
25 changed files with 510 additions and 134 deletions

View File

@ -3,8 +3,8 @@ import request from '@/utils/request';
/** 分页查找上线的剧本*/
export function getScriptPageListOnline(params) {
return request({
// url: `/api/script/paging/online`,
url: `/api/script/paging/published`,
url: `/api/script/paging/online`,
// url: `/api/script/paging/published`,
method: 'get',
params: params
});

View File

@ -48,3 +48,12 @@ export function getSubSystemDetail(id) {
method: 'get'
});
}
export function getMapSystemPageList(params) {
/** 分页查询地图系统 */
return request({
url: `/api/mapSystem`,
method: 'get',
params
});
}

View File

@ -25,6 +25,7 @@ import trainRoom from './trainRoom';
import menu from './menu';
import ibp from './ibp';
import approval from './approval';
import systemGenerate from './systemGenerate';
export default {
...enLocale,
@ -53,5 +54,6 @@ export default {
trainRoom,
menu,
ibp,
approval
approval,
systemGenerate
};

View File

@ -0,0 +1,9 @@
export default {
map: 'Map',
mapName: 'Map Name',
prdName: 'Product Name',
name: 'Name',
type: 'Type',
updateData: 'Modify',
generate: 'Generate'
};

View File

@ -25,6 +25,7 @@ import trainRoom from './trainRoom';
import menu from './menu';
import ibp from './ibp';
import approval from './approval';
import systemGenerate from './systemGenerate';
export default {
...cnLocale,
@ -53,5 +54,6 @@ export default {
trainRoom,
menu,
ibp,
approval
approval,
systemGenerate
};

View File

@ -0,0 +1,9 @@
export default {
map: '地图',
mapName: '地图名称',
prdName: '产品名称',
name: '名称',
type: '类型',
updateData: '更新',
generate: '生成'
};

View File

@ -103,7 +103,11 @@ export default {
{ enlabel: 'Pending review', label: '待审核', value: '1'},
{ enlabel: 'Successfully released', label: '发布成功', value: '2'},
{ enlabel: 'Overrule', label: '被驳回', value: '3'}
],
productType: [
{ enlabel: 'Lesson System', label: '教学系统', value: 'Lesson'},
{ enlabel: 'Exam System', label: '考试系统', value: 'Exam'},
{ enlabel: 'Simulation System', label: '仿真系统', value: 'Simulation'}
]
}
};

View File

@ -102,7 +102,6 @@ export default {
methods: {
async loadInitData() {
this.loading = true;
this.currentPrdCode = this.prodId;
try {
const resp = await getSubSystemDetail(this.$route.params.subSystem);
this.tryUser = 0;
@ -119,6 +118,7 @@ export default {
pmsList: resp.data.permissionList || [],
PermissionType: PermissionType.SIMULATION
};
this.currentPrdCode = resp.data.mapPrd.code;
if (resp.data.mapPrd.prdType === '03') {
this.getJointTrainingList();
}

View File

@ -24,6 +24,7 @@ import { exitFullscreen } from '@/utils/screen';
import { timeFormat } from '@/utils/date';
import { refreshExamList, finishOneExamQuestion } from '@/api/management/userexam';
import { launchFullscreen } from '@/utils/screen';
import { UrlConfig } from '@/router/index';
export default {
name: 'MenuExam',
@ -124,7 +125,7 @@ export default {
type: 'warning'
}).then(() => {
this.$emit('quit');
this.$router.back();
this.$router.push({ path: `${UrlConfig.trainingPlatform.examDetail}/${this.$route.query.examId}`, query: { subSystem: this.$route.query.subSystem }});
Notification.closeAll();
exitFullscreen();
}).catch(() => {
@ -141,7 +142,7 @@ export default {
}).catch(error => {
// 50009y
if (error.code === 500009) {
this.$router.replace({ path: `/trainingPlatform/result/${this.$route.params.userExamId}` });
this.$router.replace({ path: `/trainingPlatform/result/${this.$route.params.userExamId}`, query: {subSystem: this.$route.query.subSystem} });
} else {
this.$messageBox(this.$t('display.exam.refreshListError'));
}

View File

@ -191,7 +191,7 @@ export default {
}).catch(error => {
// 50009y
if (error.code === 500009) {
this.$router.replace({ path: `/exam/result/${this.$route.params.userExamId}` });
this.$router.replace({ path: `/trainingPlatform/result/${this.$route.params.userExamId}`, query: { subSystem: this.$route.query.subSystem } });
} else {
this.$messageBox(this.$t('display.exam.refreshListError'));
@ -233,7 +233,9 @@ export default {
group: this.$route.query.group,
userExamId: this.$route.query.userExamId,
trainingId: obj.trainingId,
examQuestionId: obj.id
examQuestionId: obj.id,
subSystem: this.$route.query.subSystem,
examId: this.$route.query.examId
};
this.$router.push({ path: '/display/exam', query: query });
this.$emit('refresh');
@ -260,7 +262,7 @@ export default {
exitFullscreen();
this.$store.dispatch('exam/over').then(() => {
this.$store.dispatch('trainingList/clearTrainingList');
this.$router.replace({ path: `/trainingPlatform/result/${this.$route.query.userExamId}` });
this.$router.replace({ path: `/trainingPlatform/result/${this.$route.query.userExamId}`, query: {subSystem: this.$route.query.subSystem} });
});
},
shrink() {

View File

@ -102,8 +102,8 @@ export default {
}
},
watch: {
'$route.query.prodId': function (val) {
this.loadInitPage(val, this.$route.query.type);
'$route.params.subSystem': function (val) {
this.loadInitPage();
}
},
mounted() {
@ -162,10 +162,9 @@ export default {
}
},
clickEvent(obj, node, data) {
// setSessionStorage('trainingExamCheckId', obj.id);
if (obj.type === 'Exam') {
if (obj.valid) {
this.$router.push(`${UrlConfig.trainingPlatform.examDetail}/${obj.id}`);
this.$router.push({ path: `${UrlConfig.trainingPlatform.examDetail}/${obj.id}`, query: { subSystem: this.$route.params.subSystem }});
} else {
this.$confirm(this.$t('tip.accessCourseNo'), this.$t('tip.hint'), {
confirmButtonText: this.$t('tip.confirm'),

View File

@ -200,7 +200,9 @@ export default {
group: resp.data,
trainingId: this.examList[0].trainingId,
userExamId: this.userExam.id,
examQuestionId: this.examList[0].id
examQuestionId: this.examList[0].id,
subSystem: this.$route.query.subSystem,
examId: this.$route.params.examId
};
this.$router.push({ path: `${UrlConfig.display}/exam`, query: query });
launchFullscreen();
@ -213,7 +215,7 @@ export default {
}
},
back() {
this.$router.back();
this.$router.push({ path: `${UrlConfig.trainingPlatform.course}/${this.$route.query.subSystem}`});
}
}
};

View File

@ -118,7 +118,7 @@ export default {
},
back() {
const examId = this.resultModel.examId;
this.$router.push(`${UrlConfig.trainingPlatform.examDetail}/${examId}`);
this.$router.push({path: `${UrlConfig.trainingPlatform.examDetail}/${examId}`, query: { subSystem: this.$route.query.subSystem }});
}
}
};

View File

@ -121,7 +121,7 @@ export default {
await this.$store.dispatch('training/over');
await runDiagramOver(this.group);
await deljointTrainRoom(this.group);
await this.$router.push({ path: `/trainingPlatform/prodDetail/${this.mapId}` });
await this.$router.push({ path: `/trainingPlatform/detail/${this.subSystem}`, query: {mapId: this.mapId} });
}
});
},
@ -149,6 +149,7 @@ export default {
this.group = this.$route.query.group;
this.mapId = this.$route.query.mapId;
this.skinCode = this.$route.query.skinCode;
this.subSystem = this.$route.query.subSystem;
Message.closeAll();
},
async mounted() {

View File

@ -298,7 +298,7 @@ export default {
back() {
this.$store.dispatch('training/over').then(() => {
putJointTrainingSimulationUser(this.group).then(() => {
this.$router.push({ path: `/trainroom`, query: { group: this.group } });
this.$router.push({ path: `/trainroom`, query: { skinCode: this.$route.query.skinCode, group: this.group, subSystem: this.$route.query.subSystem } });
exitFullscreen();
});
});

View File

@ -214,9 +214,9 @@ export default {
});
},
createChapter(row) {
if (row.type === 'lesson') {
if (row.type === 'Lesson') {
this.$router.push({path: `${UrlConfig.design.lessonEdit}/chapterCreate`, query: {lessonId: row.id}});
} else if (row.type === 'chapter') {
} else if (row.type === 'Chapter') {
this.$router.push( {path: `${UrlConfig.design.lessonEdit}/chapterEdit`, query: {id: row.id, lessonId: row.parentId}} );
}
},

View File

@ -54,6 +54,10 @@
</span>
</el-form-item>
<div class="tip-message">{{ tipsMsg }}</div>
<div style="display: inline-block;width: 100%;margin-bottom: 10px;">
<div style="display:inline-block">
<el-checkbox v-model="isAutoLogin">自动登录</el-checkbox>
</div>
<el-popover
placement="right"
title=""
@ -67,6 +71,20 @@
</div>
<div slot="reference">无法登录?</div>
</el-popover>
</div>
<!-- <el-popover
placement="right"
title=""
width="200"
trigger="hover"
class="popover_box"
>
<div>
<img :src="QCode" alt="" style="width: 100px; height: 100px; display: block; margin:0 auto;">
<div style="margin-top: 10px;">请在琏课堂小程序助手完善个人信息设置登录密码手机号或邮箱</div>
</div>
<div slot="reference">无法登录?</div>
</el-popover> -->
<el-form-item>
<el-button type="primary" style="width:100%;" :loading="loading" @click.native.prevent="handleLogin">
登录
@ -80,6 +98,7 @@
<script>
// import md5 from 'js-md5';
import QCode from '@/assets/erCode.jpg';
import { removeSessionStorage } from '@/utils/auth';
import { UrlConfig } from '@/router/index';
import localStore from 'storejs';
@ -91,7 +110,6 @@ import { LoginParams } from '@/utils/login';
import bgImg from '@/assets/bg1.jpg';
import { setToken } from '@/utils/auth';
import { loginTitle } from '@/scripts/ConstDic';
import QCode from '@/assets/erCode.jpg';
export default {
name: 'Login',
@ -114,6 +132,7 @@ export default {
return {
bgImg: bgImg,
QCode: QCode,
isAutoLogin:false,
loginForm: {
username: '',
password: ''
@ -146,6 +165,34 @@ export default {
mounted() {
document.title = loginTitle[this.$route.params.project||'default'];
this.loginRefresh();
},
beforeCreate(){
if(Cookies.get('UserName')&&Cookies.get('UserToken')){
const model = {'username':Cookies.get('UserName'),'password':Cookies.get('UserToken')};
model.type = 'class';
model.project = this.$route.params.project;
removeSessionStorage('againEnter');
this.$store.dispatch('Login', model).then(() => {
this.$store.dispatch('GetUserConfigInfo');
this.$store.dispatch('SetAccount', model.username);
//
this.loading = false;
this.tipsMsg = '';
let path = localStore.get('trainingPlatformRoute'+model.username);
if (!path || !path.startsWith('/trainingPlatform')) {
path = UrlConfig.trainingPlatform.trainingPlatformHome;
}
this.$nextTick(() => {
this.$i18n.locale = 'zh';
Cookies.set('user_lang', 'zh');
});
this.$router.push({ path: path });
}).catch(error => {
this.tipsMsg = error.message;
this.loading = false;
setTimeout(() => { this.tipsMsg = ''; }, 5000);
});
}
},
methods: {
clearTimer(timer) {
@ -225,6 +272,10 @@ export default {
model.type = 'class';
model.project = this.$route.params.project;
this.loading = true;
if(this.isAutoLogin){
Cookies.set('UserName', model.username, { expires: 1/48});
Cookies.set('UserToken', model.password, { expires: 1/48});
}
removeSessionStorage('againEnter');
this.$store.dispatch('Login', model).then(() => {
this.$store.dispatch('GetUserConfigInfo');

View File

@ -53,6 +53,10 @@
</span>
</el-form-item>
<div class="tip-message">{{ tipsMsg }}</div>
<div style="display: inline-block;width: 100%;margin-bottom: 10px;">
<div style="display:inline-block">
<el-checkbox v-model="isAutoLogin">自动登录</el-checkbox>
</div>
<el-popover
placement="right"
title=""
@ -66,6 +70,7 @@
</div>
<div slot="reference">无法登录?</div>
</el-popover>
</div>
<el-form-item>
<el-button type="primary" style="width:100%;" :loading="loading" @click.native.prevent="handleLogin">
登录
@ -108,6 +113,7 @@ export default {
};
return {
bgImg: bgImg,
isAutoLogin:false,
loginForm: {
username: '',
password: ''
@ -129,6 +135,27 @@ export default {
scanSuccess: false,
pwdDisplay:true
};
},
beforeCreate(){
if(Cookies.get('UserDesignName')&&Cookies.get('UserDesignToken')){
const model = {'username':Cookies.get('UserDesignName'),'password':Cookies.get('UserDesignToken')};
model.type = 'design';
this.$store.dispatch('Login', model).then(() => {
this.$store.dispatch('GetUserConfigInfo');
//
this.loading = false;
this.tipsMsg = '';
this.$nextTick(() => {
this.$i18n.locale = 'zh';
Cookies.set('user_lang', 'zh');
});
this.$router.push({ path: `${UrlConfig.design.prefix}` });
}).catch(error => {
this.tipsMsg = error.message;
this.loading = false;
setTimeout(() => { this.tipsMsg = ''; }, 5000);
});
}
},
mounted() {
document.title = '城市轨道交通设计平台';
@ -140,6 +167,9 @@ export default {
clearTimeout(timer);
timer = null;
}
},
judgeAutoLogin(){
},
loginRefresh() {
this.loadingCode = true;
@ -205,6 +235,11 @@ export default {
if (valid) {
const model = Object.assign({}, this.loginForm);
model.password = md5(model.password);
if(this.isAutoLogin){
Cookies.set('UserDesignName', model.username, { expires: 1/48});
Cookies.set('UserDesignToken', model.password, { expires: 1/48});
}
// model.type = 'plan';
model.type = 'design';
@ -255,7 +290,6 @@ export default {
padding: 8px 9px 7px 5px;
color: #000;
height: 100%;
&:-webkit-autofill {
box-shadow: 0 0 0px 1000px $bg inset !important;
-webkit-text-fill-color: #000 !important;
@ -290,10 +324,18 @@ export default {
$dark_gray:#889aa4;
$light_gray:#eee;
$qrcodeSize: 270px;
// .popover_box {
// position: absolute;
// right: 80px;
// bottom: 106px;
// cursor: pointer;
// color: #225592;
// font-size: 14px;
// }
.popover_box {
position: absolute;
right: 80px;
bottom: 106px;
position: relative;
display: inline-block;
float: right;
cursor: pointer;
color: #225592;
font-size: 14px;

View File

@ -54,6 +54,10 @@
</span>
</el-form-item>
<div class="tip-message">{{ tipsMsg }}</div>
<div style="display: inline-block;width: 100%;margin-bottom: 10px;">
<div style="display:inline-block">
<el-checkbox v-model="isAutoLogin">Auto Login</el-checkbox>
</div>
<el-popover
placement="right"
title=""
@ -67,6 +71,20 @@
</div>
<div slot="reference">unable to login?</div>
</el-popover>
</div>
<!-- <el-popover
placement="right"
title=""
width="200"
trigger="hover"
class="popover_box"
>
<div>
<img :src="QCode" alt="" style="width: 100px; height: 100px; display: block; margin:0 auto;">
<div style="margin-top: 10px;">Please in lian classroom small program assistant, perfect personal information, set login password, mobile phone number or email.</div>
</div>
<div slot="reference">unable to login?</div>
</el-popover> -->
<el-form-item>
<el-button type="primary" style="width:100%;" :loading="loading" @click.native.prevent="handleLogin">
login
@ -79,6 +97,7 @@
</template>
<script>
import QCode from '@/assets/erCode.jpg';
import { removeSessionStorage } from '@/utils/auth';
import { UrlConfig } from '@/router/index';
import localStore from 'storejs';
@ -110,6 +129,8 @@ export default {
}
};
return {
QCode: QCode,
isAutoLogin:false,
bgImg: bgImg,
loginForm: {
username: '',
@ -138,6 +159,34 @@ export default {
title() {
return loginTitle[this.$route.params.project||'default'];
}
},
beforeCreate(){
if(Cookies.get('UserName')&&Cookies.get('UserToken')){
const model = {'username':Cookies.get('UserName'),'password':Cookies.get('UserToken')};
model.type = 'class';
model.project = this.$route.params.project;
removeSessionStorage('againEnter');
this.$store.dispatch('Login', model).then(() => {
this.$store.dispatch('GetUserConfigInfo');
this.$store.dispatch('SetAccount', model.username);
//
this.loading = false;
this.tipsMsg = '';
let path = localStore.get('trainingPlatformRoute'+model.username);
if (!path || !path.startsWith('/trainingPlatform')) {
path = UrlConfig.trainingPlatform.trainingPlatformHome;
}
this.$nextTick(() => {
this.$i18n.locale = 'en';
Cookies.set('user_lang', 'en');
});
this.$router.push({ path: path });
}).catch(error => {
this.tipsMsg = error.message;
this.loading = false;
setTimeout(() => { this.tipsMsg = ''; }, 5000);
});
}
},
mounted() {
document.title = loginTitle[this.$route.params.project||'default'];
@ -219,6 +268,10 @@ export default {
model.type = 'class';
model.project = this.$route.params.project;
this.loading = true;
if(this.isAutoLogin){
Cookies.set('UserName', model.username, { expires: 1/48});
Cookies.set('UserToken', model.password, { expires: 1/48});
}
removeSessionStorage('againEnter');
this.$store.dispatch('Login', model).then(() => {
this.$store.dispatch('GetUserConfigInfo');

View File

@ -52,6 +52,10 @@
</span>
</el-form-item>
<div class="tip-message">{{ tipsMsg }}</div>
<div style="display: inline-block;width: 100%;margin-bottom: 10px;">
<div style="display:inline-block">
<el-checkbox v-model="isAutoLogin">Auto Login</el-checkbox>
</div>
<el-popover
placement="right"
title=""
@ -65,18 +69,32 @@
</div>
<div slot="reference">unable to login?</div>
</el-popover>
</div>
<!-- <el-popover
placement="right"
title=""
width="200"
trigger="hover"
class="popover_box"
>
<div>
<img :src="QCode" alt="" style="width: 100px; height: 100px; display: block; margin:0 auto;">
<div style="margin-top: 10px;">Please in lian classroom small program assistant, perfect personal information, set login password, mobile phone number or email.</div>
</div>
<div slot="reference">unable to login?</div>
</el-popover> -->
<el-form-item>
<el-button type="primary" style="width:100%;" :loading="loading" @click.native.prevent="handleLogin">
login
</el-button>
</el-form-item>
</el-form>
</div>
</div>
</template>
<script>
import QCode from '@/assets/erCode.jpg';
import { UrlConfig } from '@/router/index';
import Cookies from 'js-cookie';
import md5 from 'js-md5';
@ -105,6 +123,8 @@ export default {
}
};
return {
QCode:QCode,
isAutoLogin:false,
bgImg: bgImg,
loginForm: {
username: '',
@ -125,6 +145,27 @@ export default {
checkTimeout: null,
scanSuccess: false
};
},
beforeCreate(){
if(Cookies.get('UserDesignName')&&Cookies.get('UserDesignToken')){
const model = {'username':Cookies.get('UserDesignName'),'password':Cookies.get('UserDesignToken')};
model.type = 'design';
this.$store.dispatch('Login', model).then(() => {
this.$store.dispatch('GetUserConfigInfo');
//
this.loading = false;
this.tipsMsg = '';
this.$nextTick(() => {
this.$i18n.locale = 'en';
Cookies.set('user_lang', 'en');
});
this.$router.push({ path: `${UrlConfig.design.prefix}` });
}).catch(error => {
this.tipsMsg = error.message;
this.loading = false;
setTimeout(() => { this.tipsMsg = ''; }, 5000);
});
}
},
mounted() {
document.title = '城市轨道交通设计平台';
@ -202,6 +243,11 @@ export default {
// model.type = 'plan';
model.type = 'design';
if(this.isAutoLogin){
Cookies.set('UserDesignName', model.username, { expires: 1/48});
Cookies.set('UserDesignToken', model.password, { expires: 1/48});
}
this.loading = true;
this.$store.dispatch('Login', model).then(() => {
this.$store.dispatch('GetUserConfigInfo');

View File

@ -1,9 +1,10 @@
<template>
<el-card>
<div slot="header" style="text-align: center;">
<!-- <div slot="header" style="text-align: center;">
<b>地图子系统生成</b>
</div>
<div style="margin:50px" :style="{ height: height - 160 +'px' }">
</div> -->
<QueryListPage ref="subSystemListPage" :pager-config="pagerConfig" :query-form="queryForm" :query-list="queryList" />
<!-- <div style="margin:50px" :style="{ height: height - 160 +'px' }">
<el-select v-model="mapId" clearable placeholder="请选择地图">
<el-option
v-for="item in mapList"
@ -13,29 +14,109 @@
</el-option>
</el-select>
<el-button type="primary" @click="generate">生成</el-button>
</div>
</div> -->
</el-card>
</template>
<script>
import Cookies from 'js-cookie';
import { listPublishMap } from '@/api/jmap/map';
import { generateMapSystem } from '@/api/trainingPlatform';
import { generateMapSystem,getMapSystemPageList } from '@/api/trainingPlatform';
import ConstConfig from '@/scripts/ConstConfig';
export default {
name: 'SystemGenerate',
data() {
return{
mapList:[],
mapId: ''
prdTypeList:[],
mapId: '',
pagerConfig: {
pageSize: 'pageSize',
pageIndex: 'pageNum'
},
queryForm: {
labelWidth: '100px',
reset: true,
queryObject: {
mapId: {
type: 'select',
label: this.$t('systemGenerate.map'),
config: {
data: []
}
},
created(){
listPublishMap().then(response=>{
response.data.forEach(elem => {
this.mapList.push({ value: elem.id, label: elem.name });
});
});
'name': {
type: 'text',
label: this.$t('systemGenerate.name')
},
'type': {
type: 'select',
label: this.$t('systemGenerate.type'),
config: {
data: []
}
},
}
},
queryList: {
query: this.queryFunction,
selectCheckShow: false,
indexShow: true,
columns: [
{
title: this.$t('systemGenerate.name'),
prop: 'name'
},
{
title: this.$t('systemGenerate.type'),
type: 'tag',
prop: 'type',
columnValue: (row) => { return this.$convertField(row.type , this.prdTypeList, ['value', 'label']); },
tagType: (row) => { return ''; }
},
{
title: this.$t('systemGenerate.mapName'),
type: 'tag',
prop: 'mapName',
columnValue: (row) => { return row.mapName},
tagType: (row) => { return ''; }
},
{
title: this.$t('systemGenerate.prdName'),
prop: 'prdName'
},
{
type: 'button',
title: this.$t('global.operate'),
width: '400',
buttons: [
{
name: this.$t('systemGenerate.updateData'),
handleClick: this.updateData,
type: ''
},
],
},
],
actions: [
{ text: this.$t('global.add'), handler: this.handleAdd },
{ text: this.$t('systemGenerate.generate'), handler: this.generate }
]
},
}
},
// created(){
// listPublishMap().then(response=>{
// response.data.forEach(elem => {
// this.mapList.push({ value: elem.id, label: elem.name });
// });
// });
// },
mounted(){
this.loadInitData();
},
computed: {
height() {
@ -43,20 +124,57 @@
}
},
methods: {
generate() {
if(!this.mapId){this.$messageBox('请选择要生成子系统的地图!'); return;}
this.$confirm('此操作将生成该地图下子系统,是否继续?', this.$t('tip.hint'), {
confirmButtonText: this.$t('tip.confirm'),
cancelButtonText: this.$t('tip.cancel'),
type: 'warning'
}).then(() => {
generateMapSystem(this.mapId).then(response => {
this.$message.success('生成该地图下子系统成功!');
}).catch(() => {
this.$messageBox('生成该地图下子系统失败!');
updateData(index,row){
},
handleAdd(){
},
async loadInitData() {
try {
//
this.mapList = [];
const res = await listPublishMap();
this.allMapList=res.data;
res.data.forEach(elem => {
this.queryForm.queryObject.mapId.config.data.push({ value: elem.id, label: elem.name });
});
}).catch(() => { });
let productTypeList=ConstConfig.ConstSelect.productType;
if(Cookies.get("user_lang")=="en"){
productTypeList.forEach(elem => {
this.queryForm.queryObject.type.config.data.push({ value: elem.value, label: elem.enlabel });
this.prdTypeList.push({ value: elem.value, label: elem.enlabel });
});
}else{
productTypeList.forEach(elem => {
this.queryForm.queryObject.type.config.data.push({ value: elem.value, label: elem.label });
this.prdTypeList.push({ value: elem.value, label: elem.label });
});
}
} catch (error) {
console.error(error, '获取发布地图');
}
},
generate() {
},
// generate() {
// if(!this.mapId){this.$messageBox(''); return;}
// this.$confirm('', this.$t('tip.hint'), {
// confirmButtonText: this.$t('tip.confirm'),
// cancelButtonText: this.$t('tip.cancel'),
// type: 'warning'
// }).then(() => {
// generateMapSystem(this.mapId).then(response => {
// this.$message.success('');
// }).catch(() => {
// this.$messageBox('');
// });
// }).catch(() => { });
// },
queryFunction(params) {
return getMapSystemPageList(params);
},
}
}
</script>

View File

@ -22,14 +22,18 @@
highlight-current
:default-expanded-keys="expandList"
:span="22"
@node-click="clickEvent"
@node-expand="nodeExpand"
@node-collapse="nodeCollapse"
>
<span slot-scope="{ node, data }">
<span slot-scope="{ node, data }" class="custom-tree-node">
<span v-if="node.data.valid" class="el-icon-goods" :style="{color: 'green'}">&nbsp;{{ node.label }}</span>
<span v-else class="el-icon-sold-out">&nbsp;{{ node.label }}</span>
<span>
<el-button v-if="node.data.type ==='Training'&&node.data.valid" type="text" size="mini" @click="startTraining(data)">开始实训</el-button>
<el-button v-if="node.data.type ==='Lesson'&& !node.data.valid" type="text" size="mini" @click="buy(node)">购买</el-button>
</span>
</span>
</el-tree>
</el-scrollbar>
</div>
@ -124,6 +128,7 @@ export default {
PermissionType: PermissionType.LESSON
};
}
this.getExpandList(this.courseModel.id);
}).catch(error => {
this.$message.error(this.$t('tip.failedCourse') + ':' + error.message);
});
@ -143,7 +148,7 @@ export default {
this.$refs.limitList.distribute(this.courseModel);
}
},
clickEvent(obj, node, ele) {
/* clickEvent(obj, node, ele) {
if (obj && obj.type==='Training') {
if (obj.valid) {
this.$router.push({ path: `${UrlConfig.trainingPlatform.practical}/${obj.id}/${this.courseModel.id}`});
@ -156,7 +161,7 @@ export default {
}).catch(() => { });
}
}
},
},*/
filterNode(value, data) {
if (!value) return true;
return data.name.indexOf(value) !== -1;
@ -175,7 +180,7 @@ export default {
},
nodeCollapse(obj, node, ele) {
const key = obj.id;
if (type === 'lesson') {
if (obj.type === 'Lesson') {
this.expandList = [];
} else {
this.expandList = this.expandList.filter(item => item!==key);
@ -188,6 +193,20 @@ export default {
if (expand instanceof Array) {
this.expandList = expand;
}
},
startTraining(data) {
if (data && data.type==='Training') {
if (data.valid) {
this.$router.push({ path: `${UrlConfig.trainingPlatform.practical}/${data.id}/${this.courseModel.id}`});
} else {
this.$confirm(this.$t('tip.accessCourseNo'), this.$t('tip.hint'), {
confirmButtonText: this.$t('tip.confirm'),
cancelButtonText: this.$t('tip.cancel')
}).then(() => {
this.buy();
}).catch(() => { });
}
}
}
}
};
@ -210,4 +229,11 @@ export default {
justify-content: center;
transform: translateY(-20px);
}
.custom-tree-node {
flex: 1;
display: flex;
align-items: center;
justify-content: space-between;
padding-right: 50px;
}
</style>

View File

@ -465,7 +465,7 @@ export default {
this.starting = true;
await putJointTrainingSimulationEntrance(param.group);
const rest = await getPublishMapInfo(param.mapId);
const query = { skinCode: rest.data.skinCode, mapId: param.mapId, group: param.group };
const query = { skinCode: rest.data.skinCode, mapId: param.mapId, group: param.group, subSystem: this.$route.query.subSystem };
this.$router.push({ path: `/jointTraining`, query: query });
launchFullscreen();
}
@ -487,7 +487,7 @@ export default {
this.loading = true;
await putJointTrainingSimulationEntrance(this.$route.query.group);
const rest = await getPublishMapInfo(this.mapId);
const query = { skinCode: rest.data.skinCode, mapId: this.mapId, group: this.$route.query.group };
const query = { skinCode: rest.data.skinCode, mapId: this.mapId, group: this.$route.query.group, subSystem: this.$route.query.subSystem };
this.$router.push({ path: `/jointTraining`, query: query });
launchFullscreen();
},

View File

@ -124,7 +124,7 @@ export default {
this.$router.push({ path: `${UrlConfig.trainingPlatform.teachDetail}/${obj.id}`});
break;
case 'Simulation':
this.setLocalRoute(`${UrlConfig.trainingPlatform.prodDetail}/${obj.id}`);
this.setLocalRoute(`${UrlConfig.trainingPlatform.prodDetail}/${obj.id}?mapId=${this.mapId}`);
this.$router.push({ path: `${UrlConfig.trainingPlatform.prodDetail}/${obj.id}`, query: { mapId: this.mapId}});
break;
// case '':