设计平台,课程 创建章节 获取实训列表接口修改

This commit is contained in:
joylink_cuiweidong 2019-12-27 09:47:07 +08:00
parent 11de837332
commit 9b3c41dbfb
2 changed files with 15 additions and 16 deletions

View File

@ -98,7 +98,7 @@ export default {
}, },
detail: { detail: {
mapId: '', mapId: '',
prdId: '' prdType: ''
}, },
loading: false loading: false
}; };
@ -176,7 +176,7 @@ export default {
loadTrainingList(data) { loadTrainingList(data) {
getLessonDetail({ id: data.lessonId }).then(resp => { getLessonDetail({ id: data.lessonId }).then(resp => {
this.detail.mapId = resp.data.mapId; this.detail.mapId = resp.data.mapId;
this.detail.prdId = resp.data.prdId; this.detail.prdType = resp.data.prdType;
this.chapterModel.lessonId = resp.data.id; this.chapterModel.lessonId = resp.data.id;
this.chapterModel.lessonName = resp.data.name; this.chapterModel.lessonName = resp.data.name;
if (data.type === 'Chapter') { if (data.type === 'Chapter') {

View File

@ -13,7 +13,8 @@
</template> </template>
<script> <script>
import { getProductList } from '@/api/management/mapprd'; import ConstConfig from '@/scripts/ConstConfig';
import Cookies from 'js-cookie';
import { pageQueryTraining } from '@/api/jmap/training'; import { pageQueryTraining } from '@/api/jmap/training';
import { getPublishMapListOnline } from '@/api/jmap/map'; import { getPublishMapListOnline } from '@/api/jmap/map';
import localStore from 'storejs'; import localStore from 'storejs';
@ -43,7 +44,6 @@ export default {
pageSize: 'pageSize', pageSize: 'pageSize',
pageIndex: 'pageNum' pageIndex: 'pageNum'
}, },
prdTypeList: [],
trainingTypeList: [], trainingTypeList: [],
trainingOperateTypeMap: {}, trainingOperateTypeMap: {},
queryForm: { queryForm: {
@ -92,9 +92,9 @@ export default {
}, },
{ {
title: this.$t('lesson.product'), title: this.$t('lesson.product'),
prop: 'prdId', prop: 'prdType',
type: 'tag', type: 'tag',
columnValue: (row) => { return this.$convertField(row.prdId, this.prdTypeList, ['code', 'name']); }, columnValue: (row) => { return this.$convertField(row.prdId, this.prdTypeList, ['label', 'name']); },
tagType: (row) => { return 'success'; } tagType: (row) => { return 'success'; }
}, },
{ {
@ -134,6 +134,14 @@ export default {
} }
}; };
}, },
computed:{
prdTypeList() {
const productTypeList = ConstConfig.ConstSelect.prdType;
return Cookies.get('user_lang') == 'en'
? productTypeList.map(elem => { return { value: elem.value, label: elem.enlabel }; })
: productTypeList.map(elem => { return { value: elem.value, label: elem.label }; });
}
},
created() { created() {
this.loadInitData(); this.loadInitData();
}, },
@ -147,7 +155,7 @@ export default {
}, },
async queryFunction(params) { async queryFunction(params) {
params['mapId'] = this.detail.mapId; params['mapId'] = this.detail.mapId;
params['prdId'] = this.detail.prdId; params['prdType'] = this.detail.prdType;
const res = await pageQueryTraining(params); const res = await pageQueryTraining(params);
this.trainings.forEach(ele => { this.trainings.forEach(ele => {
res.data.list.forEach(item => { res.data.list.forEach(item => {
@ -172,15 +180,6 @@ export default {
this.mapIdList = response.data; this.mapIdList = response.data;
}); });
getProductList({ pageSize: 500, pageNum: 1 }).then(res => {
const list = res.data.list;
if (list && list.length > 0) {
list.forEach(elem => {
this.prdTypeList.push({ code: elem.code, name: elem.name });
});
}
});
this.trainingOperateTypeMap = {}; this.trainingOperateTypeMap = {};
const list01 = await this.$Dictionary.stationControl(); const list01 = await this.$Dictionary.stationControl();
this.trainingOperateTypeMap['01'] = list01; // this.trainingOperateTypeMap['01'] = list01; //