Merge remote-tracking branch 'remotes/origin/test'
This commit is contained in:
commit
43c5392205
@ -159,5 +159,8 @@ export default {
|
||||
enterLastStep: 'Please enter a hint and click next',
|
||||
pleaseOpearte: 'Please proceed',
|
||||
help: 'help',
|
||||
city: 'City'
|
||||
city: 'City',
|
||||
simulationSystem: 'The simulation system',
|
||||
lessonSystem: 'The lesson system',
|
||||
examSystem: 'The exam system'
|
||||
};
|
||||
|
@ -159,5 +159,8 @@ export default {
|
||||
enterLastStep: '请输入提示并点击下一步',
|
||||
pleaseOpearte: '请开始操作',
|
||||
help: '帮助',
|
||||
city: '城市'
|
||||
city: '城市',
|
||||
simulationSystem: '仿真系统',
|
||||
lessonSystem: '课程系统',
|
||||
examSystem: '考试系统'
|
||||
};
|
||||
|
@ -96,7 +96,7 @@ export function JLmapDriving(dom, data, skinCode,storemod) {
|
||||
// 地图模型数据
|
||||
let mapdata = new Jl3ddata();
|
||||
|
||||
let camera = new THREE.PerspectiveCamera(70, dom.clientWidth/dom.clientHeight, 1, 11000);
|
||||
let camera = new THREE.PerspectiveCamera(70, dom.clientWidth/dom.clientHeight, 1, 1000);
|
||||
camera.position.set( 0, 0, 0 );
|
||||
camera.aspect = window.innerWidth / window.innerHeight;
|
||||
camera.updateProjectionMatrix();
|
||||
|
@ -157,13 +157,13 @@ export function Jl3dDriving(updatemmi,sound) {
|
||||
if (trainlisttest.list[code].runMode == '02') {
|
||||
|
||||
if (trainlisttest.list[code].isStandTrack == true) {
|
||||
trainlisttest.list[code].speeds = parseFloat(data.body[tl].v*10/36/21/trainlisttest.list[code].len);
|
||||
trainlisttest.list[code].speeds = parseFloat(data.body[tl].v*10/36/23/trainlisttest.list[code].len);
|
||||
} else {
|
||||
trainlisttest.list[code].speeds = parseFloat(data.body[tl].v*10/36/21/trainlisttest.list[code].len);
|
||||
trainlisttest.list[code].speeds = parseFloat(data.body[tl].v*10/36/23/trainlisttest.list[code].len);
|
||||
}
|
||||
} else {
|
||||
|
||||
trainlisttest.list[code].speeds = parseFloat(data.body[tl].v*10/36/21/trainlisttest.list[code].len);
|
||||
trainlisttest.list[code].speeds = parseFloat(data.body[tl].v*10/36/23/trainlisttest.list[code].len);
|
||||
}
|
||||
|
||||
if (code == drivingcode) {
|
||||
@ -357,7 +357,7 @@ export function Jl3dDriving(updatemmi,sound) {
|
||||
// trainlisttest.list[code].startmark = 1;
|
||||
}else{
|
||||
trainlisttest.list[code].speeds = data.body[i].speed;
|
||||
trainlisttest.list[code].speeds = parseFloat(data.body[i].speed*10/36/22/trainlisttest.list[code].len);
|
||||
trainlisttest.list[code].speeds = parseFloat(data.body[i].speed*10/36/23/trainlisttest.list[code].len);
|
||||
}
|
||||
|
||||
|
||||
@ -505,7 +505,7 @@ export function Jl3dDriving(updatemmi,sound) {
|
||||
trainlisttest.list[code].curve = rails.linkrail[data.body[i].linkCode].lineleft;
|
||||
trainlisttest.list[code].len = rails.linkrail[data.body[i].linkCode].lengthfact;
|
||||
trainlisttest.list[code].progress = data.body[i].linkOffsetPercent;
|
||||
trainlisttest.list[code].speeds = parseFloat(trainlisttest.list[code].speed*10/36/21/trainlisttest.list[code].len);
|
||||
trainlisttest.list[code].speeds = parseFloat(trainlisttest.list[code].speed*10/36/23/trainlisttest.list[code].len);
|
||||
}
|
||||
}else if(data.body[i].directionType == '03'){
|
||||
if(rails.linkrail[data.body[i].linkCode].lineright){
|
||||
@ -513,7 +513,7 @@ export function Jl3dDriving(updatemmi,sound) {
|
||||
trainlisttest.list[code].curve = rails.linkrail[data.body[i].linkCode].lineright;
|
||||
trainlisttest.list[code].len = rails.linkrail[data.body[i].linkCode].lengthfact;
|
||||
trainlisttest.list[code].progress = 1-data.body[i].linkOffsetPercent;
|
||||
trainlisttest.list[code].speeds = parseFloat(trainlisttest.list[code].speed*10/36/21/trainlisttest.list[code].len);
|
||||
trainlisttest.list[code].speeds = parseFloat(trainlisttest.list[code].speed*10/36/23/trainlisttest.list[code].len);
|
||||
}
|
||||
}
|
||||
trainlisttest.list[code].nextcode = nextcode;
|
||||
|
@ -142,11 +142,11 @@ export function UpdateTrain(camera,traindata,control){
|
||||
// if(trainmodel.status == '02'){
|
||||
// }else if(trainmodel.status == '03'){
|
||||
// }
|
||||
|
||||
|
||||
trainmodel.progress = 0;
|
||||
trainmodel.len = trainmodel.nextlen;
|
||||
trainmodel.nowcode = trainmodel.nextcode;
|
||||
trainmodel.speeds = parseFloat(trainmodel.speed*10/36/21/trainmodel.len);
|
||||
trainmodel.speeds = parseFloat(trainmodel.speed*10/36/22/trainmodel.len);
|
||||
trainmodel.curve = trainmodel.nextcurve;
|
||||
|
||||
trainmodel.nextcurve = null;
|
||||
|
@ -9,7 +9,7 @@ let defaultsignal = {
|
||||
deviceType:"signal",
|
||||
type:"low",
|
||||
picUrl:"",
|
||||
assetUrl:"https://test.joylink.club/oss/models/signal/d3d.FBX"
|
||||
assetUrl:"https://joylink.club/oss/models/signal/d3d.FBX"
|
||||
}
|
||||
|
||||
let defaulttrain = {
|
||||
@ -18,7 +18,7 @@ let defaulttrain = {
|
||||
deviceType:"train",
|
||||
type:"num4",
|
||||
picUrl:"",
|
||||
assetUrl:"https://test.joylink.club/oss/models/train/train.FBX"
|
||||
assetUrl:"https://joylink.club/oss/models/train/train.FBX"
|
||||
}
|
||||
|
||||
|
||||
@ -28,7 +28,7 @@ let defaultstation = {
|
||||
deviceType:"stand",
|
||||
type:"num4",
|
||||
picUrl:"",
|
||||
assetUrl:"https://test.joylink.club/oss/models/station/fuzhou/fuzhou.FBX"
|
||||
assetUrl:"https://joylink.club/oss/models/station/fuzhou/fuzhou.FBX"
|
||||
}
|
||||
//https://test.joylink.club/oss/models/station/fuzhou/fuzhou.FBX
|
||||
//https://joylink.club/oss/models/station/fuzhou/fuzhou.FBX
|
||||
@ -58,7 +58,7 @@ let defaultsuidao = {
|
||||
deviceType:"suidao",
|
||||
type:"suidao",
|
||||
picUrl:"",
|
||||
assetUrl:"https://test.joylink.club/oss/models/suidao/suidao.FBX"
|
||||
assetUrl:"https://joylink.club/oss/models/suidao/suidao.FBX"
|
||||
}
|
||||
//https://test.joylink.club/oss/models/suidao/suidao.FBX
|
||||
//https://joylink.club/oss/models/suidao/suidao.FBX
|
||||
@ -70,7 +70,7 @@ let defaultautorail = {
|
||||
deviceType:"autorail",
|
||||
type:"autorail",
|
||||
picUrl:"",
|
||||
assetUrl:"../../static/model/auto/rail.FBX"
|
||||
assetUrl:"https://joylink.club/oss/models/auto/rail.FBX"
|
||||
}
|
||||
|
||||
let defaultautosuidao = {
|
||||
@ -79,7 +79,7 @@ let defaultautosuidao = {
|
||||
deviceType:"autosuidao",
|
||||
type:"autosuidao",
|
||||
picUrl:"",
|
||||
assetUrl:"https://test.joylink.club/oss/models/auto/suidao.FBX"
|
||||
assetUrl:"https://joylink.club/oss/models/auto/suidao.FBX"
|
||||
}
|
||||
|
||||
let autoswitch1 = {
|
||||
@ -88,7 +88,7 @@ let autoswitch1 = {
|
||||
deviceType:"autoswitch1",
|
||||
type:"fuzhou",
|
||||
picUrl:"",
|
||||
assetUrl:"https://test.joylink.club/oss/models/auto/switch1.FBX"
|
||||
assetUrl:"https://joylink.club/oss/models/auto/switch1.FBX"
|
||||
}
|
||||
|
||||
let autoswitch2 = {
|
||||
@ -97,7 +97,7 @@ let autoswitch2 = {
|
||||
deviceType:"autoswitch2",
|
||||
type:"fuzhou",
|
||||
picUrl:"",
|
||||
assetUrl:"https://test.joylink.club/oss/models/auto/switch2.FBX"
|
||||
assetUrl:"https://joylink.club/oss/models/auto/switch2.FBX"
|
||||
}
|
||||
|
||||
export function AssetLoader(){
|
||||
|
@ -358,11 +358,11 @@ export const asyncRouter = [
|
||||
component: Mapedit,
|
||||
hidden: true
|
||||
},
|
||||
// {
|
||||
// path: 'lesson/edit/:type',
|
||||
// component: LessonEdit,
|
||||
// hidden: true
|
||||
// },
|
||||
{
|
||||
path: 'lesson/edit/:type',
|
||||
component: LessonEdit,
|
||||
hidden: true
|
||||
},
|
||||
{
|
||||
path: 'runPlan/detail/:mapId',
|
||||
component: PlanMonitorDetail,
|
||||
|
@ -2,8 +2,8 @@
|
||||
// 登陆配置参数
|
||||
export const LoginParams = {
|
||||
LianKeTang: { clientId: '1', secret: 'joylink' }, // "琏课堂"
|
||||
DaPing: { clientId: '2', secret: 'bigscreen' }, // "大屏系统"
|
||||
LianJiHua: { clientId: '3', secret: 'linkplan' }, // "琏计划"
|
||||
// DaPing: { clientId: '2', secret: 'bigscreen' }, // "大屏系统"
|
||||
// LianJiHua: { clientId: '3', secret: 'linkplan' }, // "琏计划"
|
||||
Assistant: { clientId: '4', secret: 'linkassistant' }, // "琏课堂助手"
|
||||
Design: { clientId: '6', secret: 'design' } // "城市轨道交通设计平台"
|
||||
Design: { clientId: '2', secret: 'design' } // "城市轨道交通设计平台"
|
||||
};
|
||||
|
@ -29,7 +29,6 @@
|
||||
</template>
|
||||
<script>
|
||||
import { listPublishMap } from '@/api/jmap/map';
|
||||
// import { getTrainingSystemList} from '@/api/trainingPlatform';
|
||||
import { UrlConfig } from '@/router/index';
|
||||
import { getSessionStorage, setSessionStorage, removeSessionStorage } from '@/utils/auth';
|
||||
import FilterCity from '@/views/components/filterCity';
|
||||
|
@ -57,6 +57,7 @@ import { PermissionType } from '@/scripts/ConstDic';
|
||||
import { UrlConfig } from '@/router/index';
|
||||
import LimitList from '@/views/components/limits/index';
|
||||
import { getSessionStorage, setSessionStorage } from '@/utils/auth';
|
||||
import localStore from 'storejs';
|
||||
|
||||
export default {
|
||||
name: 'ExamDetailView',
|
||||
@ -198,6 +199,7 @@ export default {
|
||||
}
|
||||
},
|
||||
backLessonList() {
|
||||
localStore.remove('examDetail'+this.$route.params.subSystem);
|
||||
this.$router.push({ path: `${UrlConfig.trainingPlatform.examHome}/${this.$route.params.subSystem}`});
|
||||
}
|
||||
}
|
||||
|
@ -37,6 +37,7 @@
|
||||
<script>
|
||||
import { getSubSystemDetail } from '@/api/trainingPlatform';
|
||||
import { UrlConfig } from '@/router/index';
|
||||
import localStore from 'storejs';
|
||||
|
||||
export default {
|
||||
name: 'ExamHome',
|
||||
@ -46,6 +47,11 @@ export default {
|
||||
loading: false
|
||||
};
|
||||
},
|
||||
watch: {
|
||||
$route(newVal) {
|
||||
this.loadInitPage();
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.loadInitPage();
|
||||
},
|
||||
@ -62,6 +68,7 @@ export default {
|
||||
}
|
||||
},
|
||||
goLesson(row) {
|
||||
localStore.set('examDetail'+this.$route.params.subSystem, `${UrlConfig.trainingPlatform.course}/${this.$route.params.subSystem}?lessonId=${row.id}`);
|
||||
this.$router.push({ path: `${UrlConfig.trainingPlatform.course}/${this.$route.params.subSystem}`, query: {lessonId: row.id}});
|
||||
}
|
||||
}
|
||||
|
@ -23,28 +23,38 @@
|
||||
</el-scrollbar>
|
||||
</div>
|
||||
<transition>
|
||||
<router-view />
|
||||
<router-view @refresh="refresh" />
|
||||
</transition>
|
||||
</div>
|
||||
<operate-menu ref="menu" :point="point" :node="node" @refresh="refresh" @changeRouter="changeRouter" />
|
||||
</el-card>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { getLessonTree } from '@/api/jmap/lessondraft';
|
||||
import { DeviceMenu } from '@/scripts/ConstDic';
|
||||
import OperateMenu from './operateMenu';
|
||||
export default {
|
||||
name: 'LessonDetail',
|
||||
components: {
|
||||
OperateMenu
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
treeList: [],
|
||||
defaultProps: {
|
||||
children: 'children',
|
||||
label: 'name',
|
||||
disabled: this.showNode
|
||||
label: 'name'
|
||||
},
|
||||
name: '',
|
||||
lessonId: '',
|
||||
expandList: []
|
||||
expandList: [],
|
||||
point: {
|
||||
x: 0,
|
||||
y: 0
|
||||
},
|
||||
node: {
|
||||
}
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
@ -66,7 +76,6 @@ export default {
|
||||
this.lessonId = resp.data[0].id;
|
||||
this.treeList = resp.data;
|
||||
}
|
||||
|
||||
this.editLesson();
|
||||
});
|
||||
|
||||
@ -78,22 +87,44 @@ export default {
|
||||
return data.name.indexOf(value) !== -1;
|
||||
},
|
||||
editLesson() {
|
||||
this.$router.push( {path: `/design/lesson/details/edit/lessonEdit`, query: {id: this.treeList[0].id, skinCode: this.$route.query.skinCode}} );
|
||||
this.$router.push( {path: `/design/lesson/details/edit/lessonEdit`, query: {id: this.lessonId, skinCode: this.$route.query.skinCode, cityCode: this.$route.query.cityCode, mapId: this.$route.query.mapId}} );
|
||||
},
|
||||
showNode(obj) {
|
||||
return obj.type !== 'Training';
|
||||
createChapte(node) {
|
||||
this.$router.push({path: `/design/lesson/details/edit/chapterCreate`, query: {id: node.data.id, lessonId: this.lessonId, skinCode: this.$route.query.skinCode, cityCode: this.$route.query.cityCode, mapId: this.$route.query.mapId}});
|
||||
},
|
||||
updateChapte(node) {
|
||||
this.$router.push( {path: `/design/lesson/details/edit/chapterEdit`, query: {id: node.data.id, skinCode: this.$route.query.skinCode, lessonId: this.lessonId, cityCode: this.$route.query.cityCode, mapId: this.$route.query.mapId}});
|
||||
},
|
||||
showContextMenu(e, obj, node, vueElem) {
|
||||
if (obj && obj.type === 'TrainingType' || obj.type === 'Training') {
|
||||
if (obj && obj.type === 'Lesson' || obj.type === 'Chapter') {
|
||||
e.preventDefault();
|
||||
this.point = {
|
||||
x: e.clientX,
|
||||
y: e.clientY
|
||||
};
|
||||
this.node = node;
|
||||
const menu = DeviceMenu.Training;
|
||||
const menu = DeviceMenu.Lesson;
|
||||
this.$store.dispatch('menuOperation/setPopMenu', { position: this.point, menu: menu });
|
||||
}
|
||||
},
|
||||
changeRouter(params) {
|
||||
switch (params.event) {
|
||||
case '01':
|
||||
this.editLesson();
|
||||
break;
|
||||
case '02':
|
||||
this.createChapte(params.node);
|
||||
break;
|
||||
case '03':
|
||||
this.updateChapte(params.node);
|
||||
break;
|
||||
case '04':
|
||||
this.createChapte(params.node);
|
||||
break;
|
||||
}
|
||||
},
|
||||
refresh() {
|
||||
this.initPageData();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
@ -181,6 +181,14 @@ export default {
|
||||
return row.status ==='0'&& !this.hasRelease;
|
||||
}
|
||||
},
|
||||
{
|
||||
name: this.$t('lesson.review'),
|
||||
handleClick: this.review,
|
||||
type: 'primary',
|
||||
showControl: (row) => {
|
||||
return row.status==='1';
|
||||
}
|
||||
},
|
||||
{
|
||||
name: this.$t('global.delete'),
|
||||
handleClick: this.deleteLesson,
|
||||
@ -200,7 +208,10 @@ export default {
|
||||
{
|
||||
name: '课程详情',
|
||||
handleClick: this.goDetail,
|
||||
type: 'primary'
|
||||
type: 'primary',
|
||||
showControl: (row) => {
|
||||
return row.status !=='1';
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
@ -230,6 +241,7 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
loadInitData() {
|
||||
this.loading = true;
|
||||
getLessonTree(this.$route.params.skinCode).then(response=> {
|
||||
response.data.forEach(elem => {
|
||||
if (elem.children) {
|
||||
@ -279,9 +291,6 @@ export default {
|
||||
refresh() {
|
||||
this.$refs.queryListPage.refresh(true);
|
||||
},
|
||||
editLesson(row) {
|
||||
this.$router.push( {path: `${UrlConfig.design.lessonEdit}/lessonEdit`, query: {id: row.id, skinCode: row.code}} );
|
||||
},
|
||||
lessonCreate() {
|
||||
this.$router.push({ path: `${UrlConfig.design.lessonEdit}/lessonCreate`, query: {skinCode: this.$route.params.skinCode} });
|
||||
},
|
||||
@ -304,15 +313,8 @@ export default {
|
||||
this.$messageBox(this.$t('tip.failDelete'));
|
||||
});
|
||||
},
|
||||
createChapter(index, row) {
|
||||
if (row.type === 'Lesson') {
|
||||
this.$router.push({path: `${UrlConfig.design.lessonEdit}/chapterCreate`, query: {lessonId: row.id}});
|
||||
} else if (row.type === 'Chapter') {
|
||||
this.$router.push( {path: `${UrlConfig.design.lessonEdit}/chapterEdit`, query: {id: row.id, lessonId: row.parentId}} );
|
||||
}
|
||||
},
|
||||
treeSort(index, row) {
|
||||
this.$router.push({path: `${UrlConfig.design.lessonEdit}/treeSort`, query: row});
|
||||
this.$router.push({path: `${UrlConfig.design.lessonEdit}/treeSort`, query: {id: row.id}});
|
||||
},
|
||||
taskManage() {
|
||||
this.$router.push({path: `${UrlConfig.design.taskManage}`, query: {mapId: this.$route.params.mapId, skinCode: this.$route.params.skinCode}});
|
||||
@ -340,9 +342,11 @@ export default {
|
||||
});
|
||||
});
|
||||
},
|
||||
review(index, row) {
|
||||
this.$refs.lessonDetail.show(row.id);
|
||||
},
|
||||
goDetail(index, row) {
|
||||
// this.$refs.lessonDetail.show(row.id);
|
||||
this.$router.push({path: `/design/lesson/details`, query: {lessonId: row.id, skinCode: this.$route.params.skinCode}});
|
||||
this.$router.push({path: `/design/lesson/details`, query: {lessonId: row.id, skinCode: this.$route.params.skinCode, cityCode: this.$route.query.cityCode, mapId: this.$route.params.mapId}});
|
||||
}
|
||||
}
|
||||
};
|
||||
|
@ -10,9 +10,9 @@
|
||||
<el-form-item :label="this.$t('lesson.courseName')" prop="lessonName">
|
||||
<el-input v-model="chapterModel.lessonName" :disabled="true" />
|
||||
</el-form-item>
|
||||
<!--<el-form-item :label="this.$t('lesson.parentChapter')" prop="parentName">
|
||||
<el-input v-model="chapterModel.parentName" :disabled="true"></el-input>
|
||||
</el-form-item>-->
|
||||
<el-form-item :label="this.$t('lesson.parentChapter')" prop="parentName">
|
||||
<el-input v-model="chapterModel.parentName" :disabled="true" />
|
||||
</el-form-item>
|
||||
<el-form-item :label="this.$t('lesson.chapterName')" prop="name">
|
||||
<el-input v-model="chapterModel.name" />
|
||||
</el-form-item>
|
||||
@ -72,7 +72,7 @@
|
||||
|
||||
<script>
|
||||
import { createLessonChapter, updateLessonChapter, getLessonDetail, getLessonChapterDetail } from '@/api/jmap/lessondraft';
|
||||
import localStore from 'storejs';
|
||||
import { UrlConfig } from '@/router/index';
|
||||
import TrainList from './list';
|
||||
|
||||
export default {
|
||||
@ -97,7 +97,9 @@ export default {
|
||||
lessonName: '',
|
||||
name: '',
|
||||
remarks: '',
|
||||
trainings: []
|
||||
trainings: [],
|
||||
parentId: null,
|
||||
parentName: ''
|
||||
},
|
||||
detail: {
|
||||
mapId: '',
|
||||
@ -125,16 +127,12 @@ export default {
|
||||
initData(isNew, data) {
|
||||
this.isEdit = !isNew;
|
||||
this.clearForm();
|
||||
if (isNew) {
|
||||
this.loadTrainingList(data);
|
||||
} else {
|
||||
this.loadTrainingList(data);
|
||||
}
|
||||
this.loadTrainingList(data);
|
||||
},
|
||||
getChapter(data) {
|
||||
getLessonChapterDetail(data).then(response => {
|
||||
this.setChapterModel(response.data);
|
||||
}).catch(error => {
|
||||
}).catch(() => {
|
||||
this.$messageBox(this.$t('error.obtainChapterDataFailed'));
|
||||
});
|
||||
},
|
||||
@ -156,10 +154,21 @@ export default {
|
||||
});
|
||||
},
|
||||
setChapterModel(data) {
|
||||
const lessonName = this.chapterModel.lessonName;
|
||||
this.chapterModel = data;
|
||||
this.chapterModel.trainings = data.trainings || [];
|
||||
this.chapterModel.lessonName = lessonName;
|
||||
if (!this.isEdit) {
|
||||
const lessonName = this.chapterModel.lessonName;
|
||||
const parentName = data.name;
|
||||
const parentId = data.id;
|
||||
this.chapterModel.lessonId = data.lessonId;
|
||||
this.chapterModel.trainings = [];
|
||||
this.chapterModel.lessonName = lessonName;
|
||||
this.chapterModel.parentName = parentName;
|
||||
this.chapterModel.parentId = parentId;
|
||||
} else {
|
||||
const lessonName = this.chapterModel.lessonName;
|
||||
this.chapterModel = data;
|
||||
this.chapterModel.trainings = data.trainings || [];
|
||||
this.chapterModel.lessonName = lessonName;
|
||||
}
|
||||
},
|
||||
clearForm() {
|
||||
this.chapterModel.trainingId = '';
|
||||
@ -174,10 +183,10 @@ export default {
|
||||
this.detail.prdCode = resp.data.prdCode;
|
||||
this.chapterModel.lessonId = resp.data.id;
|
||||
this.chapterModel.lessonName = resp.data.name;
|
||||
if (this.isEdit) {
|
||||
if (data.id !== data.lessonId) {
|
||||
this.getChapter(data);
|
||||
}
|
||||
}).catch(error => {
|
||||
}).catch(() => {
|
||||
this.$messageBox(this.$t('error.obtainCourseDetailsFailed'));
|
||||
});
|
||||
},
|
||||
@ -187,7 +196,7 @@ export default {
|
||||
createLessonChapter(this.chapterModel).then(response => {
|
||||
this.$emit('refresh');
|
||||
this.$message.success(this.$t('tip.createSuccess'));
|
||||
}).catch(error => {
|
||||
}).catch(() => {
|
||||
this.$messageBox(this.$t('error.refreshFailed'));
|
||||
});
|
||||
}
|
||||
@ -199,14 +208,14 @@ export default {
|
||||
updateLessonChapter(this.chapterModel).then(response => {
|
||||
this.$emit('refresh');
|
||||
this.$message.success(this.$t('tip.updateSuccessfully'));
|
||||
}).catch(error => {
|
||||
}).catch(() => {
|
||||
this.$messageBox(this.$t('error.refreshFailed'));
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
back() {
|
||||
this.$router.go(-1);
|
||||
this.$router.push({ path: `${UrlConfig.design.lessonHome}/${this.$route.query.mapId}/${this.$route.query.skinCode}`, query: {cityCode: this.$route.query.cityCode} });
|
||||
}
|
||||
}
|
||||
};
|
||||
|
@ -57,9 +57,10 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { createLesson, updateLesson, getLessonDetail, delLesson } from '@/api/jmap/lessondraft';
|
||||
import { createLesson, updateLesson, getLessonDetail } from '@/api/jmap/lessondraft';
|
||||
import { getCommodityMapProduct } from '@/api/management/mapprd';
|
||||
import { getSkinCodeList } from '@/api/management/mapskin';
|
||||
import { UrlConfig } from '@/router/index';
|
||||
|
||||
export default {
|
||||
name: 'CourseEdit',
|
||||
@ -146,7 +147,8 @@ export default {
|
||||
createLesson(model).then(response => {
|
||||
this.$emit('refresh');
|
||||
this.$message.success(this.$t('tip.createSuccess'));
|
||||
}).catch(error => {
|
||||
this.back();
|
||||
}).catch(() => {
|
||||
this.$messageBox(this.$t('tip.creatingFailed'));
|
||||
});
|
||||
}
|
||||
@ -165,7 +167,7 @@ export default {
|
||||
updateLesson(model).then(response => {
|
||||
this.$emit('refresh');
|
||||
this.$message.success(this.$t('tip.updateSuccessfully'));
|
||||
}).catch(error => {
|
||||
}).catch(() => {
|
||||
this.$messageBox(this.$t('tip.updateFailed'));
|
||||
});
|
||||
}
|
||||
@ -182,13 +184,13 @@ export default {
|
||||
name: data.name,
|
||||
remarks: data.remarks
|
||||
};
|
||||
}).catch(error => {
|
||||
}).catch(() => {
|
||||
this.$messageBox(this.$t('error.obtainCourseInformationFailed'));
|
||||
});
|
||||
}
|
||||
},
|
||||
back() {
|
||||
this.$router.back();
|
||||
this.$router.push({ path: `${UrlConfig.design.lessonHome}/${this.$route.query.mapId}/${this.$route.query.skinCode}`, query: {cityCode: this.$route.query.cityCode} });
|
||||
}
|
||||
}
|
||||
};
|
||||
|
@ -81,19 +81,19 @@ export default {
|
||||
});
|
||||
},
|
||||
allowDrop(draggingNode, dropNode, type) {
|
||||
if (draggingNode && draggingNode.data.type === 'chapter') {
|
||||
if (draggingNode && draggingNode.data.type === 'Chapter') {
|
||||
return dropNode && draggingNode.parent == dropNode.parent && (
|
||||
dropNode.data.type === 'chapter' && type !== 'inner');
|
||||
} else if (draggingNode && draggingNode.data.type === 'training') {
|
||||
dropNode.data.type === 'Chapter' && type !== 'Inner');
|
||||
} else if (draggingNode && draggingNode.data.type === 'Training') {
|
||||
return dropNode && draggingNode.parent == dropNode.parent && (
|
||||
dropNode.data.type === 'training' && type !== 'inner');
|
||||
dropNode.data.type === 'Training' && type !== 'Inner');
|
||||
}
|
||||
},
|
||||
allowDrag(draggingNode) {
|
||||
return draggingNode && (draggingNode.data.type === 'chapter' || draggingNode.data.type === 'training');
|
||||
return draggingNode && (draggingNode.data.type === 'Chapter' || draggingNode.data.type === 'Training');
|
||||
},
|
||||
getLeesonId(node) {
|
||||
if (node.parent.data.type === 'lesson') {
|
||||
if (node.parent.data.type === 'Lesson') {
|
||||
return node.parent.data.id;
|
||||
} else {
|
||||
return this.getLeesonId(node.parent);
|
||||
|
@ -46,6 +46,28 @@ export default {
|
||||
return this.$store.state.app.height - 125;
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
$route() {
|
||||
const data = this.$route.query;
|
||||
switch (this.$route.params.type) {
|
||||
case 'lessonCreate':
|
||||
this.lessonCreate(data);
|
||||
break;
|
||||
case 'lessonEdit':
|
||||
this.lessonEdit(data);
|
||||
break;
|
||||
case 'chapterCreate':
|
||||
this.chapterCreate(data);
|
||||
break;
|
||||
case 'chapterEdit':
|
||||
this.chapterEdit(data);
|
||||
break;
|
||||
case 'treeSort':
|
||||
this.treeSort(data);
|
||||
break;
|
||||
}
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
const data = this.$route.query;
|
||||
switch (this.$route.params.type) {
|
||||
@ -112,6 +134,7 @@ export default {
|
||||
});
|
||||
},
|
||||
refresh(filterSelect) {
|
||||
this.$emit('refresh');
|
||||
}
|
||||
}
|
||||
};
|
||||
|
114
src/views/lesson/operateMenu.vue
Normal file
114
src/views/lesson/operateMenu.vue
Normal file
@ -0,0 +1,114 @@
|
||||
<template>
|
||||
<div>
|
||||
<pop-menu ref="popMenu" :menu="menu" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { DeviceMenu } from '@/scripts/ConstDic';
|
||||
import PopMenu from '@/components/PopMenu';
|
||||
|
||||
export default {
|
||||
name: 'TrainingOperateMenu',
|
||||
components: {
|
||||
PopMenu
|
||||
},
|
||||
props: {
|
||||
point: {
|
||||
type: Object,
|
||||
required: true
|
||||
},
|
||||
node: {
|
||||
type: Object,
|
||||
required: true
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
menuShow: false,
|
||||
menu: [],
|
||||
menuChapte: [
|
||||
{
|
||||
label: '更新章节',
|
||||
handler: this.updateChapter
|
||||
},
|
||||
{
|
||||
label: '创建章节',
|
||||
handler: this.createChapterInChapter
|
||||
}
|
||||
],
|
||||
menuLesson: [
|
||||
{
|
||||
label: '创建章节',
|
||||
handler: this.createChapter
|
||||
},
|
||||
{
|
||||
label: '编辑课程',
|
||||
handler: this.editLesson
|
||||
}
|
||||
|
||||
]
|
||||
};
|
||||
},
|
||||
watch: {
|
||||
node: function (val, old) {
|
||||
if (val && val.data) {
|
||||
switch (val.data.type) {
|
||||
case 'Lesson':
|
||||
this.menu = this.menuLesson;
|
||||
break;
|
||||
case 'Chapter':
|
||||
this.menu = this.menuChapte;
|
||||
break;
|
||||
}
|
||||
}
|
||||
},
|
||||
'$store.state.menuOperation.menuCount': function (val) {
|
||||
if (this.$store.getters['menuOperation/checkDialogIsOpen'](DeviceMenu.Lesson)) {
|
||||
this.doShow(this.$store.state.menuOperation.menuPosition);
|
||||
} else {
|
||||
this.doClose();
|
||||
}
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.closeEvent();
|
||||
},
|
||||
methods: {
|
||||
closeEvent() {
|
||||
const self = this;
|
||||
window.onclick = function (e) {
|
||||
self.doClose();
|
||||
};
|
||||
},
|
||||
doShow(point) {
|
||||
this.closeEvent();
|
||||
if (this.$refs && this.$refs.popMenu) {
|
||||
this.$refs.popMenu.resetShowPosition(point);
|
||||
}
|
||||
this.menuShow = true;
|
||||
},
|
||||
doClose() {
|
||||
if (this.$refs && this.$refs.popMenu) {
|
||||
this.$refs.popMenu.close();
|
||||
}
|
||||
this.menuShow = false;
|
||||
},
|
||||
updateChapter() {
|
||||
this.$emit('changeRouter', {event: '03', node: this.node});
|
||||
},
|
||||
createChapter() {
|
||||
this.$emit('changeRouter', {event: '02', node: this.node});
|
||||
},
|
||||
editLesson() {
|
||||
this.$emit('changeRouter', {event: '01', node: this.node});
|
||||
},
|
||||
createChapterInChapter() {
|
||||
this.$emit('changeRouter', {event: '04', node: this.node});
|
||||
},
|
||||
refresh(filterSelect) {
|
||||
this.$emit('refresh', filterSelect);
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
@ -173,20 +173,8 @@ export default {
|
||||
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 });
|
||||
this.$store.dispatch('SetAccount', model.username);
|
||||
this.handleLoginSucessRoute();
|
||||
}).catch(error => {
|
||||
this.tipsMsg = error.message;
|
||||
this.loading = false;
|
||||
@ -237,15 +225,7 @@ export default {
|
||||
self.$store.dispatch('QrLoginSetting', { key: 'SET_TOKEN', value: response.data.token }).then(() => {
|
||||
// 清除定时器,设置路由
|
||||
self.clearTimer(self.checkLogin);
|
||||
let path = '/login';
|
||||
if (this.project) {
|
||||
path = path + '/' + this.project;
|
||||
}
|
||||
self.$router.push({ path: path });
|
||||
self.$nextTick(() => {
|
||||
self.$i18n.locale = 'zh';
|
||||
Cookies.set('user_lang', 'zh');
|
||||
});
|
||||
this.handleLoginSucessRoute();
|
||||
});
|
||||
}).catch(error => {
|
||||
if (error.data && error.data.status == '1') {
|
||||
@ -278,20 +258,8 @@ export default {
|
||||
}
|
||||
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 });
|
||||
this.$store.dispatch('SetAccount', model.username);
|
||||
this.handleLoginSucessRoute();
|
||||
}).catch(error => {
|
||||
this.tipsMsg = error.message;
|
||||
this.loading = false;
|
||||
@ -302,7 +270,18 @@ export default {
|
||||
return false;
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
handleLoginSucessRoute() {
|
||||
// 设置路由
|
||||
this.loading = false;
|
||||
this.tipsMsg = '';
|
||||
const path = UrlConfig.trainingPlatform.trainingPlatformHome;
|
||||
this.$nextTick(() => {
|
||||
this.$i18n.locale = 'zh';
|
||||
Cookies.set('user_lang', 'zh');
|
||||
});
|
||||
this.$router.push({ path: path });
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
@ -206,12 +206,15 @@ export default {
|
||||
// 设置扫码登录
|
||||
self.$store.dispatch('QrLoginSetting', { key: 'SET_TOKENDESIGN', value: response.data.token }).then(() => {
|
||||
// 清除定时器,设置路由
|
||||
self.clearTimer(self.checkLogin);
|
||||
self.$router.push({ path: '/design/login' });
|
||||
self.clearTimer(self.checkLogin);
|
||||
|
||||
this.$router.push({ path: `${UrlConfig.design.prefix}` });
|
||||
self.$nextTick(() => {
|
||||
self.$i18n.locale = 'zh';
|
||||
Cookies.set('user_lang', 'zh');
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
});
|
||||
}).catch(error => {
|
||||
if (error.data && error.data.status == '1') {
|
||||
@ -244,16 +247,25 @@ export default {
|
||||
model.type = 'design';
|
||||
|
||||
this.loading = true;
|
||||
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}` });
|
||||
// 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);
|
||||
// });
|
||||
|
||||
this.$store.dispatch('Login', model).then(() => {
|
||||
this.$store.dispatch('SetAccount', model.username);
|
||||
this.handleLoginSucessRoute();
|
||||
}).catch(error => {
|
||||
this.tipsMsg = error.message;
|
||||
this.loading = false;
|
||||
@ -265,7 +277,18 @@ export default {
|
||||
return false;
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
handleLoginSucessRoute() {
|
||||
// 设置路由
|
||||
this.loading = false;
|
||||
this.tipsMsg = '';
|
||||
const path = UrlConfig.design.prefix;
|
||||
this.$nextTick(() => {
|
||||
this.$i18n.locale = 'zh';
|
||||
Cookies.set('user_lang', 'zh');
|
||||
});
|
||||
this.$router.push({ path: path });
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
@ -167,15 +167,14 @@ export default {
|
||||
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')) {
|
||||
// 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');
|
||||
@ -273,21 +272,10 @@ export default {
|
||||
Cookies.set('UserToken', model.password, { expires: 1/48});
|
||||
}
|
||||
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 });
|
||||
|
||||
this.$store.dispatch('Login', model).then(() => {
|
||||
this.$store.dispatch('SetAccount', model.username);
|
||||
this.handleLoginSucessRoute();
|
||||
}).catch(error => {
|
||||
this.tipsMsg = error.message;
|
||||
this.loading = false;
|
||||
@ -298,7 +286,18 @@ export default {
|
||||
return false;
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
handleLoginSucessRoute() {
|
||||
// 设置路由
|
||||
this.loading = false;
|
||||
this.tipsMsg = '';
|
||||
const path = UrlConfig.trainingPlatform.trainingPlatformHome;
|
||||
this.$nextTick(() => {
|
||||
this.$i18n.locale = 'en';
|
||||
Cookies.set('user_lang', 'en');
|
||||
});
|
||||
this.$router.push({ path: path });
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
@ -214,7 +214,8 @@ export default {
|
||||
self.$store.dispatch('QrLoginSetting', { key: 'SET_TOKENDESIGN', value: response.data.token }).then(() => {
|
||||
// 清除定时器,设置路由
|
||||
self.clearTimer(self.checkLogin);
|
||||
self.$router.push({ path: '/design/login' });
|
||||
// self.$router.push({ path: '/design/login' });
|
||||
this.$router.push({ path: `${UrlConfig.design.prefix}` });
|
||||
self.$nextTick(() => {
|
||||
self.$i18n.locale = 'en';
|
||||
Cookies.set('user_lang', 'en');
|
||||
@ -249,16 +250,25 @@ export default {
|
||||
}
|
||||
|
||||
this.loading = true;
|
||||
this.$store.dispatch('Login', model).then(() => {
|
||||
this.$store.dispatch('GetUserConfigInfo');
|
||||
// 设置路由
|
||||
this.loading = false;
|
||||
this.tipsMsg = '';
|
||||
this.$router.push({ path: `${UrlConfig.design.prefix}` });
|
||||
this.$nextTick(() => {
|
||||
this.$i18n.locale = 'en';
|
||||
Cookies.set('user_lang', 'en');
|
||||
});
|
||||
// this.$store.dispatch('Login', model).then(() => {
|
||||
// this.$store.dispatch('GetUserConfigInfo');
|
||||
// // 设置路由
|
||||
// this.loading = false;
|
||||
// this.tipsMsg = '';
|
||||
// this.$router.push({ path: `${UrlConfig.design.prefix}` });
|
||||
// this.$nextTick(() => {
|
||||
// this.$i18n.locale = 'en';
|
||||
// Cookies.set('user_lang', 'en');
|
||||
// });
|
||||
// }).catch(error => {
|
||||
// this.tipsMsg = error.message;
|
||||
// this.loading = false;
|
||||
// setTimeout(() => { this.tipsMsg = ''; }, 5000);
|
||||
// });
|
||||
|
||||
this.$store.dispatch('Login', model).then(() => {
|
||||
this.$store.dispatch('SetAccount', model.username);
|
||||
this.handleLoginSucessRoute();
|
||||
}).catch(error => {
|
||||
this.tipsMsg = error.message;
|
||||
this.loading = false;
|
||||
@ -270,7 +280,18 @@ export default {
|
||||
return false;
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
handleLoginSucessRoute() {
|
||||
// 设置路由
|
||||
this.loading = false;
|
||||
this.tipsMsg = '';
|
||||
const path = UrlConfig.design.prefix;
|
||||
this.$nextTick(() => {
|
||||
this.$i18n.locale = 'en';
|
||||
Cookies.set('user_lang', 'en');
|
||||
});
|
||||
this.$router.push({ path: path });
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
@ -17,11 +17,6 @@
|
||||
</div>
|
||||
</el-card>
|
||||
</template>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<script>
|
||||
import Cookies from 'js-cookie';
|
||||
import { UrlConfig } from '@/router/index';
|
||||
|
@ -15,6 +15,7 @@
|
||||
:props="defaultProps"
|
||||
:filter-node-method="filterNode"
|
||||
highlight-current
|
||||
default-expand-all
|
||||
:default-expanded-keys="expandList"
|
||||
:span="22"
|
||||
@node-click="clickEvent"
|
||||
@ -56,6 +57,7 @@ import LimitList from '@/views/components/limits/index';
|
||||
import { getSessionStorage, setSessionStorage } from '@/utils/auth';
|
||||
import { trainingNotify } from '@/api/simulation';
|
||||
import { launchFullscreen } from '@/utils/screen';
|
||||
import localStore from 'storejs';
|
||||
|
||||
export default {
|
||||
name: 'LessonDetail',
|
||||
@ -204,6 +206,7 @@ export default {
|
||||
}
|
||||
},
|
||||
backLessonList() {
|
||||
localStore.remove('teachDetail'+this.$route.params.subSystem);
|
||||
this.$router.push({ path: `${UrlConfig.trainingPlatform.teachHome}/${this.$route.params.subSystem}`});
|
||||
}
|
||||
}
|
||||
|
@ -68,6 +68,7 @@ export default {
|
||||
}
|
||||
},
|
||||
goLesson(row) {
|
||||
localStore.set('teachDetail'+this.$route.params.subSystem, `${UrlConfig.trainingPlatform.teachDetail}/${this.$route.params.subSystem}?lessonId=${row.id}&mapId=${row.mapId}&prdCode=${row.prdCode}`);
|
||||
this.$router.push({ path: `${UrlConfig.trainingPlatform.teachDetail}/${this.$route.params.subSystem}`, query: {lessonId: row.id, mapId: row.mapId, prdCode: row.prdCode}});
|
||||
}
|
||||
}
|
||||
|
@ -3,9 +3,9 @@
|
||||
<div slot="header" class="clearfix">
|
||||
<span>{{ $t('global.mapList') }}</span>
|
||||
</div>
|
||||
<!-- v-if="project!=='xty' " -->
|
||||
<!-- v-if="project!=='xty' " -->
|
||||
<filter-city ref="filerCity" filter-empty :query-function="queryFunction" :local-param-name="localParamName" @filterSelectChange="refresh" />
|
||||
<!-- v-if="project!=='xty' " -->
|
||||
<!-- v-if="project!=='xty' " -->
|
||||
<el-input v-model="filterText" :placeholder="this.$t('global.filteringKeywords')" clearable />
|
||||
<el-scrollbar wrap-class="scrollbar-wrapper" :style="{ height: (height-(project?50:125)) +'px' }">
|
||||
<el-tree
|
||||
@ -22,11 +22,14 @@
|
||||
@node-expand="nodeExpand"
|
||||
@node-collapse="nodeCollapse"
|
||||
>
|
||||
<span slot-scope="{ node:tnode, data }">
|
||||
<span slot-scope="{ node }">
|
||||
<span
|
||||
class="el-icon-tickets"
|
||||
:style="{color: data.valid ? 'green':''}"
|
||||
> {{ tnode.label }}</span>
|
||||
/>
|
||||
<span v-if="node.data.id ==='Simulation'"> {{ node.data.name+ $t('global.simulationSystem') }}</span>
|
||||
<span v-else-if="node.data.id ==='Lesson'"> {{ node.data.name+ $t('global.lessonSystem') }}</span>
|
||||
<span v-else-if="node.data.id ==='Exam'"> {{ node.data.name+ $t('global.examSystem') }}</span>
|
||||
<span v-else> {{ node.data.name }}</span>
|
||||
</span>
|
||||
</el-tree>
|
||||
</el-scrollbar>
|
||||
@ -34,7 +37,7 @@
|
||||
</template>
|
||||
<script>
|
||||
import { getPublishMapTree } from '@/api/management/mapprd';
|
||||
import { getTrainingSystemList, getTrainingSystemListByMapId, getSubSystemInfo } from '@/api/trainingPlatform';
|
||||
import { getTrainingSystemList, getSubSystemInfo } from '@/api/trainingPlatform';
|
||||
import { UrlConfig } from '@/router/index';
|
||||
import FilterCity from '@/views/components/filterCity';
|
||||
import localStore from 'storejs';
|
||||
@ -72,8 +75,8 @@ export default {
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
account() {
|
||||
return this.$store.state.user.account;
|
||||
userId() {
|
||||
return this.$store.state.user.id;
|
||||
},
|
||||
project() {
|
||||
return getSessionStorage('project');
|
||||
@ -87,9 +90,10 @@ export default {
|
||||
beforeDestroy () {
|
||||
},
|
||||
mounted() {
|
||||
// if (this.project === 'xty') {
|
||||
// this.projectInitData('18');
|
||||
// }
|
||||
const path = localStore.get('trainingPlatformRoute'+ this.userId);
|
||||
if (path && path.startsWith('/trainingPlatform')) {
|
||||
this.$router.push(path);
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
filterNode(value, data) {
|
||||
@ -103,7 +107,7 @@ export default {
|
||||
}
|
||||
},
|
||||
clickEvent(obj, data, ele) {
|
||||
localStore.set('trainingPlatformCheckId'+this.filterSelect+this.account, obj.id);
|
||||
localStore.set('trainingPlatformCheckId'+this.filterSelect+this.userId, obj.id);
|
||||
while (data) {
|
||||
if (data.data.type === 'Map') {
|
||||
this.mapId = data.data.id;
|
||||
@ -116,16 +120,25 @@ export default {
|
||||
this.$router.push({ path: `${UrlConfig.trainingPlatform.permission}/${this.mapId}`});
|
||||
} else if ( obj.type === 'MapSystem') {
|
||||
getSubSystemInfo(obj.id).then(resp => {
|
||||
let router = '';
|
||||
switch (resp.data.type) {
|
||||
case 'Exam':
|
||||
this.setLocalRoute(`${UrlConfig.trainingPlatform.examHome}/${obj.id}`);
|
||||
// this.$router.push({ path: `${UrlConfig.trainingPlatform.course}/${obj.id}`});
|
||||
this.$router.push({ path: `${UrlConfig.trainingPlatform.examHome}/${obj.id}`});
|
||||
router = localStore.get('examDetail' + obj.id);
|
||||
if (router) {
|
||||
this.$router.push(router);
|
||||
} else {
|
||||
this.$router.push({ path: `${UrlConfig.trainingPlatform.examHome}/${obj.id}`});
|
||||
}
|
||||
break;
|
||||
case 'Lesson':
|
||||
this.setLocalRoute(`${UrlConfig.trainingPlatform.teachHome}/${obj.id}`);
|
||||
// this.$router.push({ path: `${UrlConfig.trainingPlatform.teachDetail}/${obj.id}`});
|
||||
this.$router.push({ path: `${UrlConfig.trainingPlatform.teachHome}/${obj.id}`});
|
||||
router = localStore.get('teachDetail' + obj.id);
|
||||
if (router) {
|
||||
this.$router.push(router);
|
||||
} else {
|
||||
this.$router.push({ path: `${UrlConfig.trainingPlatform.teachHome}/${obj.id}`});
|
||||
}
|
||||
break;
|
||||
case 'Simulation':
|
||||
this.setLocalRoute(`${UrlConfig.trainingPlatform.prodDetail}/${obj.id}?mapId=${this.mapId}`);
|
||||
@ -135,13 +148,13 @@ export default {
|
||||
// this.$router.push({ path: `${UrlConfig.trainingPlatform.runPlan}/${this.mapId}`, query: {skinCode: '02'} });
|
||||
// break;
|
||||
}
|
||||
}).catch(() => {
|
||||
this.$messageBox('获取子系统信息失败!');
|
||||
}).catch((error) => {
|
||||
this.$messageBox('获取子系统信息失败!'+error);
|
||||
});
|
||||
}
|
||||
},
|
||||
setLocalRoute(path) {
|
||||
localStore.set('trainingPlatformRoute'+this.account, path);
|
||||
localStore.set('trainingPlatformRoute'+this.userId, path);
|
||||
},
|
||||
async refresh(filterSelect) {
|
||||
this.loading = true;
|
||||
@ -149,10 +162,10 @@ export default {
|
||||
this.filterSelect = filterSelect;
|
||||
try {
|
||||
let params={};
|
||||
if(this.project === 'xty'){
|
||||
params={'customized':'xty'};
|
||||
if (this.project === 'xty') {
|
||||
params={'customized': 'xty'};
|
||||
}
|
||||
const res = await getTrainingSystemList(filterSelect,params);
|
||||
const res = await getTrainingSystemList(filterSelect, params);
|
||||
res.data.forEach(item =>{
|
||||
item.key = item.id + item.type;
|
||||
item.children && item.children.forEach(childrenItem => {
|
||||
@ -163,7 +176,7 @@ export default {
|
||||
this.getExpandList(filterSelect);
|
||||
// this.changeCityWithPage(this.treeList);
|
||||
this.$nextTick(() => {
|
||||
const checkId = localStore.get('trainingPlatformCheckId'+filterSelect+this.account) || null;
|
||||
const checkId = localStore.get('trainingPlatformCheckId'+filterSelect+this.userId) || null;
|
||||
this.$refs.tree && this.$refs.tree.setCurrentKey(checkId);
|
||||
this.loading = false;
|
||||
});
|
||||
@ -172,38 +185,19 @@ export default {
|
||||
this.$messageBox(this.$t('error.refreshFailed'));
|
||||
}
|
||||
},
|
||||
// async projectInitData(mapId) {
|
||||
// this.loading = true;
|
||||
// this.treeList = [];
|
||||
// try {
|
||||
// debugger;
|
||||
// const resp = await getTrainingSystemListByMapId(mapId);
|
||||
// this.treeList = resp.data;
|
||||
// this.loading = false;
|
||||
// this.getExpandList(this.filterSelect);
|
||||
// this.$nextTick(() => {
|
||||
// const checkId = localStore.get('trainingPlatformCheckId'+this.filterSelect+this.account) || null;
|
||||
// this.$refs.tree && this.$refs.tree.setCurrentKey(checkId);
|
||||
// this.loading = false;
|
||||
// });
|
||||
// } catch (e) {
|
||||
// this.loading = false;
|
||||
// this.$messageBox(this.$t('error.failedToGetSystemData'));
|
||||
// }
|
||||
// },
|
||||
nodeExpand(obj, node, ele) {
|
||||
const key = obj.id;
|
||||
this.expandList = this.expandList.filter(item => item!==key);
|
||||
this.expandList.push(key);
|
||||
localStore.set('trainIngPlatformExpandList'+this.filterSelect+this.account, this.expandList);
|
||||
localStore.set('trainIngPlatformExpandList'+this.filterSelect+this.userId, this.expandList);
|
||||
},
|
||||
nodeCollapse(obj, node, ele) {
|
||||
const key = obj.id;
|
||||
this.expandList = this.expandList.filter(item => item!==key);
|
||||
localStore.set('trainIngPlatformExpandList'+this.filterSelect+this.account, this.expandList);
|
||||
localStore.set('trainIngPlatformExpandList'+this.filterSelect+this.userId, this.expandList);
|
||||
},
|
||||
getExpandList(filterSelect) {
|
||||
let expand = localStore.get('trainIngPlatformExpandList'+filterSelect+this.account);
|
||||
let expand = localStore.get('trainIngPlatformExpandList'+filterSelect+this.userId);
|
||||
expand = expand?(expand+'').split(','):'';
|
||||
if (expand instanceof Array) {
|
||||
this.expandList = expand;
|
||||
|
Loading…
Reference in New Issue
Block a user