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

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: {
mapId: '',
prdId: ''
prdType: ''
},
loading: false
};
@ -176,7 +176,7 @@ export default {
loadTrainingList(data) {
getLessonDetail({ id: data.lessonId }).then(resp => {
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.lessonName = resp.data.name;
if (data.type === 'Chapter') {

View File

@ -13,7 +13,8 @@
</template>
<script>
import { getProductList } from '@/api/management/mapprd';
import ConstConfig from '@/scripts/ConstConfig';
import Cookies from 'js-cookie';
import { pageQueryTraining } from '@/api/jmap/training';
import { getPublishMapListOnline } from '@/api/jmap/map';
import localStore from 'storejs';
@ -43,7 +44,6 @@ export default {
pageSize: 'pageSize',
pageIndex: 'pageNum'
},
prdTypeList: [],
trainingTypeList: [],
trainingOperateTypeMap: {},
queryForm: {
@ -92,9 +92,9 @@ export default {
},
{
title: this.$t('lesson.product'),
prop: 'prdId',
prop: 'prdType',
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'; }
},
{
@ -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() {
this.loadInitData();
},
@ -147,7 +155,7 @@ export default {
},
async queryFunction(params) {
params['mapId'] = this.detail.mapId;
params['prdId'] = this.detail.prdId;
params['prdType'] = this.detail.prdType;
const res = await pageQueryTraining(params);
this.trainings.forEach(ele => {
res.data.list.forEach(item => {
@ -172,15 +180,6 @@ export default {
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 = {};
const list01 = await this.$Dictionary.stationControl();
this.trainingOperateTypeMap['01'] = list01; //