Merge remote-tracking branch 'origin/dev' into test
This commit is contained in:
commit
04bebc8201
@ -3,8 +3,8 @@ import request from '@/utils/request';
|
|||||||
/** 分页查找上线的剧本*/
|
/** 分页查找上线的剧本*/
|
||||||
export function getScriptPageListOnline(params) {
|
export function getScriptPageListOnline(params) {
|
||||||
return request({
|
return request({
|
||||||
// url: `/api/script/paging/online`,
|
url: `/api/script/paging/online`,
|
||||||
url: `/api/script/paging/published`,
|
// url: `/api/script/paging/published`,
|
||||||
method: 'get',
|
method: 'get',
|
||||||
params: params
|
params: params
|
||||||
});
|
});
|
||||||
|
@ -48,3 +48,12 @@ export function getSubSystemDetail(id) {
|
|||||||
method: 'get'
|
method: 'get'
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function getMapSystemPageList(params) {
|
||||||
|
/** 分页查询地图系统 */
|
||||||
|
return request({
|
||||||
|
url: `/api/mapSystem`,
|
||||||
|
method: 'get',
|
||||||
|
params
|
||||||
|
});
|
||||||
|
}
|
||||||
|
@ -25,6 +25,7 @@ import trainRoom from './trainRoom';
|
|||||||
import menu from './menu';
|
import menu from './menu';
|
||||||
import ibp from './ibp';
|
import ibp from './ibp';
|
||||||
import approval from './approval';
|
import approval from './approval';
|
||||||
|
import systemGenerate from './systemGenerate';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
...enLocale,
|
...enLocale,
|
||||||
@ -53,5 +54,6 @@ export default {
|
|||||||
trainRoom,
|
trainRoom,
|
||||||
menu,
|
menu,
|
||||||
ibp,
|
ibp,
|
||||||
approval
|
approval,
|
||||||
|
systemGenerate
|
||||||
};
|
};
|
||||||
|
9
src/i18n/langs/en/systemGenerate.js
Normal file
9
src/i18n/langs/en/systemGenerate.js
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
export default {
|
||||||
|
map: 'Map',
|
||||||
|
mapName: 'Map Name',
|
||||||
|
prdName: 'Product Name',
|
||||||
|
name: 'Name',
|
||||||
|
type: 'Type',
|
||||||
|
updateData: 'Modify',
|
||||||
|
generate: 'Generate'
|
||||||
|
};
|
@ -25,6 +25,7 @@ import trainRoom from './trainRoom';
|
|||||||
import menu from './menu';
|
import menu from './menu';
|
||||||
import ibp from './ibp';
|
import ibp from './ibp';
|
||||||
import approval from './approval';
|
import approval from './approval';
|
||||||
|
import systemGenerate from './systemGenerate';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
...cnLocale,
|
...cnLocale,
|
||||||
@ -53,5 +54,6 @@ export default {
|
|||||||
trainRoom,
|
trainRoom,
|
||||||
menu,
|
menu,
|
||||||
ibp,
|
ibp,
|
||||||
approval
|
approval,
|
||||||
|
systemGenerate
|
||||||
};
|
};
|
||||||
|
9
src/i18n/langs/zh/systemGenerate.js
Normal file
9
src/i18n/langs/zh/systemGenerate.js
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
export default {
|
||||||
|
map: '地图',
|
||||||
|
mapName: '地图名称',
|
||||||
|
prdName: '产品名称',
|
||||||
|
name: '名称',
|
||||||
|
type: '类型',
|
||||||
|
updateData: '更新',
|
||||||
|
generate: '生成'
|
||||||
|
};
|
@ -103,7 +103,11 @@ export default {
|
|||||||
{ enlabel: 'Pending review', label: '待审核', value: '1'},
|
{ enlabel: 'Pending review', label: '待审核', value: '1'},
|
||||||
{ enlabel: 'Successfully released', label: '发布成功', value: '2'},
|
{ enlabel: 'Successfully released', label: '发布成功', value: '2'},
|
||||||
{ enlabel: 'Overrule', label: '被驳回', value: '3'}
|
{ enlabel: 'Overrule', label: '被驳回', value: '3'}
|
||||||
|
],
|
||||||
|
productType: [
|
||||||
|
{ enlabel: 'Lesson System', label: '教学系统', value: 'Lesson'},
|
||||||
|
{ enlabel: 'Exam System', label: '考试系统', value: 'Exam'},
|
||||||
|
{ enlabel: 'Simulation System', label: '仿真系统', value: 'Simulation'}
|
||||||
]
|
]
|
||||||
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -102,7 +102,6 @@ export default {
|
|||||||
methods: {
|
methods: {
|
||||||
async loadInitData() {
|
async loadInitData() {
|
||||||
this.loading = true;
|
this.loading = true;
|
||||||
this.currentPrdCode = this.prodId;
|
|
||||||
try {
|
try {
|
||||||
const resp = await getSubSystemDetail(this.$route.params.subSystem);
|
const resp = await getSubSystemDetail(this.$route.params.subSystem);
|
||||||
this.tryUser = 0;
|
this.tryUser = 0;
|
||||||
@ -119,6 +118,7 @@ export default {
|
|||||||
pmsList: resp.data.permissionList || [],
|
pmsList: resp.data.permissionList || [],
|
||||||
PermissionType: PermissionType.SIMULATION
|
PermissionType: PermissionType.SIMULATION
|
||||||
};
|
};
|
||||||
|
this.currentPrdCode = resp.data.mapPrd.code;
|
||||||
if (resp.data.mapPrd.prdType === '03') {
|
if (resp.data.mapPrd.prdType === '03') {
|
||||||
this.getJointTrainingList();
|
this.getJointTrainingList();
|
||||||
}
|
}
|
||||||
|
@ -24,6 +24,7 @@ import { exitFullscreen } from '@/utils/screen';
|
|||||||
import { timeFormat } from '@/utils/date';
|
import { timeFormat } from '@/utils/date';
|
||||||
import { refreshExamList, finishOneExamQuestion } from '@/api/management/userexam';
|
import { refreshExamList, finishOneExamQuestion } from '@/api/management/userexam';
|
||||||
import { launchFullscreen } from '@/utils/screen';
|
import { launchFullscreen } from '@/utils/screen';
|
||||||
|
import { UrlConfig } from '@/router/index';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'MenuExam',
|
name: 'MenuExam',
|
||||||
@ -124,7 +125,7 @@ export default {
|
|||||||
type: 'warning'
|
type: 'warning'
|
||||||
}).then(() => {
|
}).then(() => {
|
||||||
this.$emit('quit');
|
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();
|
Notification.closeAll();
|
||||||
exitFullscreen();
|
exitFullscreen();
|
||||||
}).catch(() => {
|
}).catch(() => {
|
||||||
@ -141,7 +142,7 @@ export default {
|
|||||||
}).catch(error => {
|
}).catch(error => {
|
||||||
// 如果时50009则表示考试已完成,不能再次进行y
|
// 如果时50009则表示考试已完成,不能再次进行y
|
||||||
if (error.code === 500009) {
|
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 {
|
} else {
|
||||||
this.$messageBox(this.$t('display.exam.refreshListError'));
|
this.$messageBox(this.$t('display.exam.refreshListError'));
|
||||||
}
|
}
|
||||||
|
@ -191,7 +191,7 @@ export default {
|
|||||||
}).catch(error => {
|
}).catch(error => {
|
||||||
// 如果时50009则表示考试已完成,不能再次进行y
|
// 如果时50009则表示考试已完成,不能再次进行y
|
||||||
if (error.code === 500009) {
|
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 {
|
} else {
|
||||||
this.$messageBox(this.$t('display.exam.refreshListError'));
|
this.$messageBox(this.$t('display.exam.refreshListError'));
|
||||||
|
|
||||||
@ -233,7 +233,9 @@ export default {
|
|||||||
group: this.$route.query.group,
|
group: this.$route.query.group,
|
||||||
userExamId: this.$route.query.userExamId,
|
userExamId: this.$route.query.userExamId,
|
||||||
trainingId: obj.trainingId,
|
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.$router.push({ path: '/display/exam', query: query });
|
||||||
this.$emit('refresh');
|
this.$emit('refresh');
|
||||||
@ -260,7 +262,7 @@ export default {
|
|||||||
exitFullscreen();
|
exitFullscreen();
|
||||||
this.$store.dispatch('exam/over').then(() => {
|
this.$store.dispatch('exam/over').then(() => {
|
||||||
this.$store.dispatch('trainingList/clearTrainingList');
|
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() {
|
shrink() {
|
||||||
|
@ -102,8 +102,8 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
'$route.query.prodId': function (val) {
|
'$route.params.subSystem': function (val) {
|
||||||
this.loadInitPage(val, this.$route.query.type);
|
this.loadInitPage();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
@ -162,10 +162,9 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
clickEvent(obj, node, data) {
|
clickEvent(obj, node, data) {
|
||||||
// setSessionStorage('trainingExamCheckId', obj.id);
|
|
||||||
if (obj.type === 'Exam') {
|
if (obj.type === 'Exam') {
|
||||||
if (obj.valid) {
|
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 {
|
} else {
|
||||||
this.$confirm(this.$t('tip.accessCourseNo'), this.$t('tip.hint'), {
|
this.$confirm(this.$t('tip.accessCourseNo'), this.$t('tip.hint'), {
|
||||||
confirmButtonText: this.$t('tip.confirm'),
|
confirmButtonText: this.$t('tip.confirm'),
|
||||||
|
@ -200,7 +200,9 @@ export default {
|
|||||||
group: resp.data,
|
group: resp.data,
|
||||||
trainingId: this.examList[0].trainingId,
|
trainingId: this.examList[0].trainingId,
|
||||||
userExamId: this.userExam.id,
|
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 });
|
this.$router.push({ path: `${UrlConfig.display}/exam`, query: query });
|
||||||
launchFullscreen();
|
launchFullscreen();
|
||||||
@ -213,7 +215,7 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
back() {
|
back() {
|
||||||
this.$router.back();
|
this.$router.push({ path: `${UrlConfig.trainingPlatform.course}/${this.$route.query.subSystem}`});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -118,7 +118,7 @@ export default {
|
|||||||
},
|
},
|
||||||
back() {
|
back() {
|
||||||
const examId = this.resultModel.examId;
|
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 }});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -121,7 +121,7 @@ export default {
|
|||||||
await this.$store.dispatch('training/over');
|
await this.$store.dispatch('training/over');
|
||||||
await runDiagramOver(this.group);
|
await runDiagramOver(this.group);
|
||||||
await deljointTrainRoom(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.group = this.$route.query.group;
|
||||||
this.mapId = this.$route.query.mapId;
|
this.mapId = this.$route.query.mapId;
|
||||||
this.skinCode = this.$route.query.skinCode;
|
this.skinCode = this.$route.query.skinCode;
|
||||||
|
this.subSystem = this.$route.query.subSystem;
|
||||||
Message.closeAll();
|
Message.closeAll();
|
||||||
},
|
},
|
||||||
async mounted() {
|
async mounted() {
|
||||||
|
@ -298,7 +298,7 @@ export default {
|
|||||||
back() {
|
back() {
|
||||||
this.$store.dispatch('training/over').then(() => {
|
this.$store.dispatch('training/over').then(() => {
|
||||||
putJointTrainingSimulationUser(this.group).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();
|
exitFullscreen();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@ -214,9 +214,9 @@ export default {
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
createChapter(row) {
|
createChapter(row) {
|
||||||
if (row.type === 'lesson') {
|
if (row.type === 'Lesson') {
|
||||||
this.$router.push({path: `${UrlConfig.design.lessonEdit}/chapterCreate`, query: {lessonId: row.id}});
|
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}} );
|
this.$router.push( {path: `${UrlConfig.design.lessonEdit}/chapterEdit`, query: {id: row.id, lessonId: row.parentId}} );
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -54,6 +54,10 @@
|
|||||||
</span>
|
</span>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<div class="tip-message">{{ tipsMsg }}</div>
|
<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
|
<el-popover
|
||||||
placement="right"
|
placement="right"
|
||||||
title=""
|
title=""
|
||||||
@ -67,6 +71,20 @@
|
|||||||
</div>
|
</div>
|
||||||
<div slot="reference">无法登录?</div>
|
<div slot="reference">无法登录?</div>
|
||||||
</el-popover>
|
</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-form-item>
|
||||||
<el-button type="primary" style="width:100%;" :loading="loading" @click.native.prevent="handleLogin">
|
<el-button type="primary" style="width:100%;" :loading="loading" @click.native.prevent="handleLogin">
|
||||||
登录
|
登录
|
||||||
@ -80,6 +98,7 @@
|
|||||||
|
|
||||||
<script>
|
<script>
|
||||||
// import md5 from 'js-md5';
|
// import md5 from 'js-md5';
|
||||||
|
import QCode from '@/assets/erCode.jpg';
|
||||||
import { removeSessionStorage } from '@/utils/auth';
|
import { removeSessionStorage } from '@/utils/auth';
|
||||||
import { UrlConfig } from '@/router/index';
|
import { UrlConfig } from '@/router/index';
|
||||||
import localStore from 'storejs';
|
import localStore from 'storejs';
|
||||||
@ -91,7 +110,6 @@ import { LoginParams } from '@/utils/login';
|
|||||||
import bgImg from '@/assets/bg1.jpg';
|
import bgImg from '@/assets/bg1.jpg';
|
||||||
import { setToken } from '@/utils/auth';
|
import { setToken } from '@/utils/auth';
|
||||||
import { loginTitle } from '@/scripts/ConstDic';
|
import { loginTitle } from '@/scripts/ConstDic';
|
||||||
import QCode from '@/assets/erCode.jpg';
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'Login',
|
name: 'Login',
|
||||||
@ -114,6 +132,7 @@ export default {
|
|||||||
return {
|
return {
|
||||||
bgImg: bgImg,
|
bgImg: bgImg,
|
||||||
QCode: QCode,
|
QCode: QCode,
|
||||||
|
isAutoLogin:false,
|
||||||
loginForm: {
|
loginForm: {
|
||||||
username: '',
|
username: '',
|
||||||
password: ''
|
password: ''
|
||||||
@ -146,6 +165,34 @@ export default {
|
|||||||
mounted() {
|
mounted() {
|
||||||
document.title = loginTitle[this.$route.params.project||'default'];
|
document.title = loginTitle[this.$route.params.project||'default'];
|
||||||
this.loginRefresh();
|
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: {
|
methods: {
|
||||||
clearTimer(timer) {
|
clearTimer(timer) {
|
||||||
@ -225,6 +272,10 @@ export default {
|
|||||||
model.type = 'class';
|
model.type = 'class';
|
||||||
model.project = this.$route.params.project;
|
model.project = this.$route.params.project;
|
||||||
this.loading = true;
|
this.loading = true;
|
||||||
|
if(this.isAutoLogin){
|
||||||
|
Cookies.set('UserName', model.username, { expires: 1/48});
|
||||||
|
Cookies.set('UserToken', model.password, { expires: 1/48});
|
||||||
|
}
|
||||||
removeSessionStorage('againEnter');
|
removeSessionStorage('againEnter');
|
||||||
this.$store.dispatch('Login', model).then(() => {
|
this.$store.dispatch('Login', model).then(() => {
|
||||||
this.$store.dispatch('GetUserConfigInfo');
|
this.$store.dispatch('GetUserConfigInfo');
|
||||||
|
@ -53,6 +53,10 @@
|
|||||||
</span>
|
</span>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<div class="tip-message">{{ tipsMsg }}</div>
|
<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
|
<el-popover
|
||||||
placement="right"
|
placement="right"
|
||||||
title=""
|
title=""
|
||||||
@ -66,6 +70,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div slot="reference">无法登录?</div>
|
<div slot="reference">无法登录?</div>
|
||||||
</el-popover>
|
</el-popover>
|
||||||
|
</div>
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-button type="primary" style="width:100%;" :loading="loading" @click.native.prevent="handleLogin">
|
<el-button type="primary" style="width:100%;" :loading="loading" @click.native.prevent="handleLogin">
|
||||||
登录
|
登录
|
||||||
@ -108,6 +113,7 @@ export default {
|
|||||||
};
|
};
|
||||||
return {
|
return {
|
||||||
bgImg: bgImg,
|
bgImg: bgImg,
|
||||||
|
isAutoLogin:false,
|
||||||
loginForm: {
|
loginForm: {
|
||||||
username: '',
|
username: '',
|
||||||
password: ''
|
password: ''
|
||||||
@ -129,6 +135,27 @@ export default {
|
|||||||
scanSuccess: false,
|
scanSuccess: false,
|
||||||
pwdDisplay:true
|
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() {
|
mounted() {
|
||||||
document.title = '城市轨道交通设计平台';
|
document.title = '城市轨道交通设计平台';
|
||||||
@ -140,6 +167,9 @@ export default {
|
|||||||
clearTimeout(timer);
|
clearTimeout(timer);
|
||||||
timer = null;
|
timer = null;
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
judgeAutoLogin(){
|
||||||
|
|
||||||
},
|
},
|
||||||
loginRefresh() {
|
loginRefresh() {
|
||||||
this.loadingCode = true;
|
this.loadingCode = true;
|
||||||
@ -205,6 +235,11 @@ export default {
|
|||||||
if (valid) {
|
if (valid) {
|
||||||
const model = Object.assign({}, this.loginForm);
|
const model = Object.assign({}, this.loginForm);
|
||||||
model.password = md5(model.password);
|
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 = 'plan';
|
||||||
model.type = 'design';
|
model.type = 'design';
|
||||||
|
|
||||||
@ -255,7 +290,6 @@ export default {
|
|||||||
padding: 8px 9px 7px 5px;
|
padding: 8px 9px 7px 5px;
|
||||||
color: #000;
|
color: #000;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
|
|
||||||
&:-webkit-autofill {
|
&:-webkit-autofill {
|
||||||
box-shadow: 0 0 0px 1000px $bg inset !important;
|
box-shadow: 0 0 0px 1000px $bg inset !important;
|
||||||
-webkit-text-fill-color: #000 !important;
|
-webkit-text-fill-color: #000 !important;
|
||||||
@ -290,10 +324,18 @@ export default {
|
|||||||
$dark_gray:#889aa4;
|
$dark_gray:#889aa4;
|
||||||
$light_gray:#eee;
|
$light_gray:#eee;
|
||||||
$qrcodeSize: 270px;
|
$qrcodeSize: 270px;
|
||||||
|
// .popover_box {
|
||||||
|
// position: absolute;
|
||||||
|
// right: 80px;
|
||||||
|
// bottom: 106px;
|
||||||
|
// cursor: pointer;
|
||||||
|
// color: #225592;
|
||||||
|
// font-size: 14px;
|
||||||
|
// }
|
||||||
.popover_box {
|
.popover_box {
|
||||||
position: absolute;
|
position: relative;
|
||||||
right: 80px;
|
display: inline-block;
|
||||||
bottom: 106px;
|
float: right;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
color: #225592;
|
color: #225592;
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
|
@ -54,6 +54,10 @@
|
|||||||
</span>
|
</span>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<div class="tip-message">{{ tipsMsg }}</div>
|
<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
|
<el-popover
|
||||||
placement="right"
|
placement="right"
|
||||||
title=""
|
title=""
|
||||||
@ -67,6 +71,20 @@
|
|||||||
</div>
|
</div>
|
||||||
<div slot="reference">unable to login?</div>
|
<div slot="reference">unable to login?</div>
|
||||||
</el-popover>
|
</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-form-item>
|
||||||
<el-button type="primary" style="width:100%;" :loading="loading" @click.native.prevent="handleLogin">
|
<el-button type="primary" style="width:100%;" :loading="loading" @click.native.prevent="handleLogin">
|
||||||
login
|
login
|
||||||
@ -79,6 +97,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
import QCode from '@/assets/erCode.jpg';
|
||||||
import { removeSessionStorage } from '@/utils/auth';
|
import { removeSessionStorage } from '@/utils/auth';
|
||||||
import { UrlConfig } from '@/router/index';
|
import { UrlConfig } from '@/router/index';
|
||||||
import localStore from 'storejs';
|
import localStore from 'storejs';
|
||||||
@ -110,6 +129,8 @@ export default {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
return {
|
return {
|
||||||
|
QCode: QCode,
|
||||||
|
isAutoLogin:false,
|
||||||
bgImg: bgImg,
|
bgImg: bgImg,
|
||||||
loginForm: {
|
loginForm: {
|
||||||
username: '',
|
username: '',
|
||||||
@ -138,6 +159,34 @@ export default {
|
|||||||
title() {
|
title() {
|
||||||
return loginTitle[this.$route.params.project||'default'];
|
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() {
|
mounted() {
|
||||||
document.title = loginTitle[this.$route.params.project||'default'];
|
document.title = loginTitle[this.$route.params.project||'default'];
|
||||||
@ -219,6 +268,10 @@ export default {
|
|||||||
model.type = 'class';
|
model.type = 'class';
|
||||||
model.project = this.$route.params.project;
|
model.project = this.$route.params.project;
|
||||||
this.loading = true;
|
this.loading = true;
|
||||||
|
if(this.isAutoLogin){
|
||||||
|
Cookies.set('UserName', model.username, { expires: 1/48});
|
||||||
|
Cookies.set('UserToken', model.password, { expires: 1/48});
|
||||||
|
}
|
||||||
removeSessionStorage('againEnter');
|
removeSessionStorage('againEnter');
|
||||||
this.$store.dispatch('Login', model).then(() => {
|
this.$store.dispatch('Login', model).then(() => {
|
||||||
this.$store.dispatch('GetUserConfigInfo');
|
this.$store.dispatch('GetUserConfigInfo');
|
||||||
|
@ -52,6 +52,10 @@
|
|||||||
</span>
|
</span>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<div class="tip-message">{{ tipsMsg }}</div>
|
<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
|
<el-popover
|
||||||
placement="right"
|
placement="right"
|
||||||
title=""
|
title=""
|
||||||
@ -65,18 +69,32 @@
|
|||||||
</div>
|
</div>
|
||||||
<div slot="reference">unable to login?</div>
|
<div slot="reference">unable to login?</div>
|
||||||
</el-popover>
|
</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-form-item>
|
||||||
<el-button type="primary" style="width:100%;" :loading="loading" @click.native.prevent="handleLogin">
|
<el-button type="primary" style="width:100%;" :loading="loading" @click.native.prevent="handleLogin">
|
||||||
login
|
login
|
||||||
</el-button>
|
</el-button>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
import QCode from '@/assets/erCode.jpg';
|
||||||
import { UrlConfig } from '@/router/index';
|
import { UrlConfig } from '@/router/index';
|
||||||
import Cookies from 'js-cookie';
|
import Cookies from 'js-cookie';
|
||||||
import md5 from 'js-md5';
|
import md5 from 'js-md5';
|
||||||
@ -105,6 +123,8 @@ export default {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
return {
|
return {
|
||||||
|
QCode:QCode,
|
||||||
|
isAutoLogin:false,
|
||||||
bgImg: bgImg,
|
bgImg: bgImg,
|
||||||
loginForm: {
|
loginForm: {
|
||||||
username: '',
|
username: '',
|
||||||
@ -125,6 +145,27 @@ export default {
|
|||||||
checkTimeout: null,
|
checkTimeout: null,
|
||||||
scanSuccess: false
|
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() {
|
mounted() {
|
||||||
document.title = '城市轨道交通设计平台';
|
document.title = '城市轨道交通设计平台';
|
||||||
@ -202,6 +243,11 @@ export default {
|
|||||||
// model.type = 'plan';
|
// model.type = 'plan';
|
||||||
model.type = 'design';
|
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.loading = true;
|
||||||
this.$store.dispatch('Login', model).then(() => {
|
this.$store.dispatch('Login', model).then(() => {
|
||||||
this.$store.dispatch('GetUserConfigInfo');
|
this.$store.dispatch('GetUserConfigInfo');
|
||||||
|
@ -1,9 +1,10 @@
|
|||||||
<template>
|
<template>
|
||||||
<el-card>
|
<el-card>
|
||||||
<div slot="header" style="text-align: center;">
|
<!-- <div slot="header" style="text-align: center;">
|
||||||
<b>地图子系统生成</b>
|
<b>地图子系统生成</b>
|
||||||
</div>
|
</div> -->
|
||||||
<div style="margin:50px" :style="{ height: height - 160 +'px' }">
|
<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-select v-model="mapId" clearable placeholder="请选择地图">
|
||||||
<el-option
|
<el-option
|
||||||
v-for="item in mapList"
|
v-for="item in mapList"
|
||||||
@ -13,29 +14,109 @@
|
|||||||
</el-option>
|
</el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
<el-button type="primary" @click="generate">生成</el-button>
|
<el-button type="primary" @click="generate">生成</el-button>
|
||||||
</div>
|
</div> -->
|
||||||
|
|
||||||
</el-card>
|
</el-card>
|
||||||
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
import Cookies from 'js-cookie';
|
||||||
import { listPublishMap } from '@/api/jmap/map';
|
import { listPublishMap } from '@/api/jmap/map';
|
||||||
import { generateMapSystem } from '@/api/trainingPlatform';
|
import { generateMapSystem,getMapSystemPageList } from '@/api/trainingPlatform';
|
||||||
|
import ConstConfig from '@/scripts/ConstConfig';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'SystemGenerate',
|
name: 'SystemGenerate',
|
||||||
data() {
|
data() {
|
||||||
return{
|
return{
|
||||||
mapList:[],
|
prdTypeList:[],
|
||||||
mapId: ''
|
mapId: '',
|
||||||
|
pagerConfig: {
|
||||||
|
pageSize: 'pageSize',
|
||||||
|
pageIndex: 'pageNum'
|
||||||
|
},
|
||||||
|
queryForm: {
|
||||||
|
labelWidth: '100px',
|
||||||
|
reset: true,
|
||||||
|
queryObject: {
|
||||||
|
mapId: {
|
||||||
|
type: 'select',
|
||||||
|
label: this.$t('systemGenerate.map'),
|
||||||
|
config: {
|
||||||
|
data: []
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
created(){
|
'name': {
|
||||||
listPublishMap().then(response=>{
|
type: 'text',
|
||||||
response.data.forEach(elem => {
|
label: this.$t('systemGenerate.name')
|
||||||
this.mapList.push({ value: elem.id, label: elem.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: {
|
computed: {
|
||||||
height() {
|
height() {
|
||||||
@ -43,20 +124,57 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
generate() {
|
updateData(index,row){
|
||||||
if(!this.mapId){this.$messageBox('请选择要生成子系统的地图!'); return;}
|
|
||||||
this.$confirm('此操作将生成该地图下子系统,是否继续?', this.$t('tip.hint'), {
|
},
|
||||||
confirmButtonText: this.$t('tip.confirm'),
|
handleAdd(){
|
||||||
cancelButtonText: this.$t('tip.cancel'),
|
|
||||||
type: 'warning'
|
},
|
||||||
}).then(() => {
|
async loadInitData() {
|
||||||
generateMapSystem(this.mapId).then(response => {
|
try {
|
||||||
this.$message.success('生成该地图下子系统成功!');
|
// 获取地图
|
||||||
}).catch(() => {
|
this.mapList = [];
|
||||||
this.$messageBox('生成该地图下子系统失败!');
|
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>
|
</script>
|
||||||
|
@ -22,14 +22,18 @@
|
|||||||
highlight-current
|
highlight-current
|
||||||
:default-expanded-keys="expandList"
|
:default-expanded-keys="expandList"
|
||||||
:span="22"
|
:span="22"
|
||||||
@node-click="clickEvent"
|
|
||||||
@node-expand="nodeExpand"
|
@node-expand="nodeExpand"
|
||||||
@node-collapse="nodeCollapse"
|
@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'}"> {{ node.label }}</span>
|
<span v-if="node.data.valid" class="el-icon-goods" :style="{color: 'green'}"> {{ node.label }}</span>
|
||||||
<span v-else class="el-icon-sold-out"> {{ node.label }}</span>
|
<span v-else class="el-icon-sold-out"> {{ 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>
|
||||||
|
</span>
|
||||||
|
|
||||||
</el-tree>
|
</el-tree>
|
||||||
</el-scrollbar>
|
</el-scrollbar>
|
||||||
</div>
|
</div>
|
||||||
@ -124,6 +128,7 @@ export default {
|
|||||||
PermissionType: PermissionType.LESSON
|
PermissionType: PermissionType.LESSON
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
this.getExpandList(this.courseModel.id);
|
||||||
}).catch(error => {
|
}).catch(error => {
|
||||||
this.$message.error(this.$t('tip.failedCourse') + ':' + error.message);
|
this.$message.error(this.$t('tip.failedCourse') + ':' + error.message);
|
||||||
});
|
});
|
||||||
@ -143,7 +148,7 @@ export default {
|
|||||||
this.$refs.limitList.distribute(this.courseModel);
|
this.$refs.limitList.distribute(this.courseModel);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
clickEvent(obj, node, ele) {
|
/* clickEvent(obj, node, ele) {
|
||||||
if (obj && obj.type==='Training') {
|
if (obj && obj.type==='Training') {
|
||||||
if (obj.valid) {
|
if (obj.valid) {
|
||||||
this.$router.push({ path: `${UrlConfig.trainingPlatform.practical}/${obj.id}/${this.courseModel.id}`});
|
this.$router.push({ path: `${UrlConfig.trainingPlatform.practical}/${obj.id}/${this.courseModel.id}`});
|
||||||
@ -156,7 +161,7 @@ export default {
|
|||||||
}).catch(() => { });
|
}).catch(() => { });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},*/
|
||||||
filterNode(value, data) {
|
filterNode(value, data) {
|
||||||
if (!value) return true;
|
if (!value) return true;
|
||||||
return data.name.indexOf(value) !== -1;
|
return data.name.indexOf(value) !== -1;
|
||||||
@ -175,7 +180,7 @@ export default {
|
|||||||
},
|
},
|
||||||
nodeCollapse(obj, node, ele) {
|
nodeCollapse(obj, node, ele) {
|
||||||
const key = obj.id;
|
const key = obj.id;
|
||||||
if (type === 'lesson') {
|
if (obj.type === 'Lesson') {
|
||||||
this.expandList = [];
|
this.expandList = [];
|
||||||
} else {
|
} else {
|
||||||
this.expandList = this.expandList.filter(item => item!==key);
|
this.expandList = this.expandList.filter(item => item!==key);
|
||||||
@ -188,6 +193,20 @@ export default {
|
|||||||
if (expand instanceof Array) {
|
if (expand instanceof Array) {
|
||||||
this.expandList = expand;
|
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;
|
justify-content: center;
|
||||||
transform: translateY(-20px);
|
transform: translateY(-20px);
|
||||||
}
|
}
|
||||||
|
.custom-tree-node {
|
||||||
|
flex: 1;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
|
padding-right: 50px;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
@ -465,7 +465,7 @@ export default {
|
|||||||
this.starting = true;
|
this.starting = true;
|
||||||
await putJointTrainingSimulationEntrance(param.group);
|
await putJointTrainingSimulationEntrance(param.group);
|
||||||
const rest = await getPublishMapInfo(param.mapId);
|
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 });
|
this.$router.push({ path: `/jointTraining`, query: query });
|
||||||
launchFullscreen();
|
launchFullscreen();
|
||||||
}
|
}
|
||||||
@ -487,7 +487,7 @@ export default {
|
|||||||
this.loading = true;
|
this.loading = true;
|
||||||
await putJointTrainingSimulationEntrance(this.$route.query.group);
|
await putJointTrainingSimulationEntrance(this.$route.query.group);
|
||||||
const rest = await getPublishMapInfo(this.mapId);
|
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 });
|
this.$router.push({ path: `/jointTraining`, query: query });
|
||||||
launchFullscreen();
|
launchFullscreen();
|
||||||
},
|
},
|
||||||
|
@ -124,7 +124,7 @@ export default {
|
|||||||
this.$router.push({ path: `${UrlConfig.trainingPlatform.teachDetail}/${obj.id}`});
|
this.$router.push({ path: `${UrlConfig.trainingPlatform.teachDetail}/${obj.id}`});
|
||||||
break;
|
break;
|
||||||
case 'Simulation':
|
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}});
|
this.$router.push({ path: `${UrlConfig.trainingPlatform.prodDetail}/${obj.id}`, query: { mapId: this.mapId}});
|
||||||
break;
|
break;
|
||||||
// case '运行图编制':
|
// case '运行图编制':
|
||||||
|
Loading…
Reference in New Issue
Block a user