设计平台 课程设计 实训管理 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' 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', updateOperateStepFailed: 'The update action step failed',
packagePermissionFailed: 'Packaging authority failed', packagePermissionFailed: 'Packaging authority failed',
acquisitionTimeFailed: 'Acquisition Time Failed', acquisitionTimeFailed: 'Acquisition Time Failed',
getProductListFailed: 'Failed to get product list',
obtainChapterDataFailed: 'Failed to obtain chapter data', obtainChapterDataFailed: 'Failed to obtain chapter data',
obtainCourseDetailsFailed: 'Failed to obtain course details', obtainCourseDetailsFailed: 'Failed to obtain course details',
obtainCourseInformationFailed: 'Failed to obtain course information', obtainCourseInformationFailed: 'Failed to obtain course information',

View File

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

View File

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