设计平台 课程设计 实训管理 prdtype 接口调整

This commit is contained in:
joylink_cuiweidong 2019-12-27 10:47:07 +08:00
parent e67d1fb279
commit f985a93c9e
4 changed files with 18 additions and 39 deletions

View File

@ -17,12 +17,3 @@ export function getCommodityMapProduct(mapId) {
method: 'get'
});
}
/** 获取产品管理列表*/
export function getProductList(data) {
return request({
url: `/api/mapPrd/list`,
method: 'get',
params: data
});
}

View File

@ -60,7 +60,6 @@ export default {
updateOperateStepFailed: 'The update action step failed',
packagePermissionFailed: 'Packaging authority failed',
acquisitionTimeFailed: 'Acquisition Time Failed',
getProductListFailed: 'Failed to get product list',
obtainChapterDataFailed: 'Failed to obtain chapter data',
obtainCourseDetailsFailed: 'Failed to obtain course details',
obtainCourseInformationFailed: 'Failed to obtain course information',

View File

@ -60,7 +60,6 @@ export default {
updateOperateStepFailed: '更新操作步骤失败',
packagePermissionFailed: '打包权限失败',
acquisitionTimeFailed: '获取时间失败',
getProductListFailed: '获取产品列表失败',
obtainChapterDataFailed: '获取章节数据失败',
obtainCourseDetailsFailed: '获取课程详情失败',
obtainCourseInformationFailed: '获取课程信息失败',

View File

@ -17,9 +17,10 @@
</template>
<script>
import ConstConfig from '@/scripts/ConstConfig';
import Cookies from 'js-cookie';
import { pageQueryTraining } from '@/api/jmap/training';
import { trainingNotify } from '@/api/simulation';
import { getCommodityMapProduct, getProductList } from '@/api/management/mapprd';
import { launchFullscreen } from '@/utils/screen';
import { getPublishMapListOnline } from '@/api/jmap/map';
import { UrlConfig } from '@/router/index';
@ -35,7 +36,6 @@ export default {
return {
mapIdList: [],
trainingTypeList: [],
prdTypeList: [],
trainingOperateTypeMap: {},
pagerConfig: {
pageSize: 'pageSize',
@ -44,9 +44,9 @@ export default {
queryForm: {
labelWidth: '120px',
queryObject: {
prdId: {
prdType: {
type: 'select',
label: this.$t('lesson.product'),
label: this.$t('lesson.prdType'),
change: this.prdChoose,
config: {
data: []
@ -83,10 +83,10 @@ export default {
prop: 'name'
},
{
title: this.$t('lesson.product'),
prop: 'prdId',
title: this.$t('lesson.prdType'),
prop: 'prdType',
type: 'tag',
columnValue: (row) => { return this.$convertField(row.prdId, this.prdTypeList, ['id', 'name']); },
columnValue: (row) => { return this.$convertField(row.prdType, this.prdTypeList, ['value', 'label']); },
tagType: (row) => { return 'success'; }
},
{
@ -143,39 +143,29 @@ export default {
currentModel: {}
};
},
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 }; });
}
},
async created() {
await this.loadInitData();
const json = localStore.get(this.$route.path);
json.type = '';
json.prdId = '';
json.prdType = '';
json.operateType = '';
},
methods: {
async loadInitData() {
this.mapIdList = [];
this.queryForm.queryObject.prdId.config.data = [];
this.queryForm.queryObject.prdType.config.data = [];
getPublishMapListOnline().then(response => {
this.mapIdList = response.data;
});
getCommodityMapProduct(this.$route.query.mapId).then((response) => {
const productList = response.data;
if (productList && productList.length > 0) {
productList.forEach(elem => {
//
if (elem.prdType != '03') {
this.queryForm.queryObject.prdId.config.data.push({ value: elem.id, label: elem.name });
}
});
}
});
this.prdTypeList = [];
getProductList({ pageSize: 500, pageNum: 1 }).then(res => {
const list = res.data.list;
if (list && list.length > 0) {
this.prdTypeList = list.filter(elem => { return elem.prdType != '03'; });
}
});
this.queryForm.queryObject.prdType.config.data = this.prdTypeList;
//
this.trainingTypeList = [];