接口参数调整

This commit is contained in:
fan 2019-10-21 11:15:15 +08:00
parent 9ed65095cc
commit be2bbc67cd
12 changed files with 171 additions and 213 deletions

View File

@ -150,6 +150,7 @@ export const userSimulation = '013'; // 仿真系统
export const userScreen = '014'; // 大屏系统
export const userPlan = '015'; // 计划系统
export const userDesign='016'; // 设计系统
const isDev = process.env.NODE_ENV === 'development';
export const UrlConfig = {
display: '/display',
@ -168,7 +169,7 @@ export const UrlConfig = {
},
lesson: {
prefix: '/lesson',
record: '/lesson/record/training',
record: '/system/record/training',
manage: '/lesson/manage/training'
},
dp: {
@ -558,21 +559,6 @@ export const asyncRouter = [
roles: [admin, lessonCreater, userDesign]
},
children: [
{
path: 'record',
redirect: '/lesson/record/training/0/null',
component: Trainingrecord,
meta: {
i18n: 'router.trainingRecord'
},
children: [
{
path: 'training/:trainingId/:trainingName',
component: TrainingrecordManage,
hidden: true
}
]
},
{
path: 'manage/trainingRule',
component: TrainingRuleList,
@ -1057,6 +1043,22 @@ export const asyncRouter = [
meta: {
i18n: 'router.productEdit'
}
},
{
path: 'record',
redirect: 'record/training/0/null',
component: Trainingrecord,
meta: {
i18n: 'router.trainingRecord'
},
hidden: !isDev,
children: [
{
path: 'training/:trainingId/:trainingName',
component: TrainingrecordManage,
hidden: true
}
]
}
]
},
@ -1113,9 +1115,6 @@ router.beforeEach((to, from, next) => {
} else {
document.title = '琏课堂';
}
// else if (name.includes('/plan/') || name.includes('/planEdit/')) {
// document.title = '琏计划';
// }
next();
});

View File

@ -69,7 +69,7 @@ export default {
},
methods: {
refresh() {
this.$refs && this.$refs.demonList && this.$refs.demonList.refresh();
this.$refs && this.$refs.demonList && this.$refs.demonList.loadInitData();
},
drapWidth(width) {
this.widthLeft = Number(width);

View File

@ -30,7 +30,7 @@
accept=".json, application/json"
@change="importf"
>
{{ $t('map.importMap') }}
{{ $t('map.importMap') }}
</el-button>
<el-button size="small" type="primary" class="eachButton" @click="createMap">{{ $t('map.newConstruction') }}</el-button>
</div>
@ -39,14 +39,14 @@
:point="point"
:edit-model="editModel"
:skin-code="skinCode"
@refresh="refresh"
@refresh="loadInitData"
@jlmap3d="jlmap3d"
/>
</el-card>
</template>
<script>
import { DeviceMenu } from '@/scripts/ConstDic';
import { postBuildMapImport, getListByCityCode } from '@/api/jmap/mapdraft';
import { postBuildMapImport, listMap } from '@/api/jmap/mapdraft';
import { UrlConfig } from '@/router/index';
import { removeSessionStorage } from '@/utils/auth';
import localStore from 'storejs';
@ -107,6 +107,7 @@ export default {
},
mounted() {
this.heightUp = Number(localStore.get('upHeight')?localStore.get('upHeight'):(this.height)/2);
this.loadInitData();
},
methods: {
filterNode(value, data) {
@ -116,11 +117,11 @@ export default {
createMap() {
this.$emit('createMap');
},
async refresh() {
async loadInitData() {
this.loading = true;
this.treeData = this.treeList = [];
try {
const res = await getListByCityCode();
const res = await listMap();
res.data&&res.data.forEach(elem=>{
// if(elem.children)
// {
@ -150,36 +151,18 @@ export default {
this.treeList = this.filterText
? res.data.filter(elem => { return elem.name.includes(this.filterText); })
: res.data;
this.$nextTick(() => {
// const mapId = getSessionStorage('demonList') || null;
// this.$refs.tree.setCurrentKey(mapId);
this.loading = false;
});
this.loading = false;
} catch (error) {
this.loading = false;
this.$messageBox(this.$t('error.refreshFailed'));
}
},
clickEvent(obj, data, ele) {
if (obj.type=='map') {
// this.mapId = data.data.id;
// this.mapName=data.data.name;
// this.skinCode=data.data.skinCode;
}
switch (obj.type) {
// case 'scriptDesign':{
// this.$router.push({ path: `${UrlConfig.designUser.scriptHome}/${this.mapId}` });
// break;
// }
case 'mapDesign': {
// this.resize();
this.$router.push({ path: `${UrlConfig.designUser.mapDraw}/${obj.mapId}/draft`, query: { name: obj.mapName } });
break;
}
// case 'lessonDesign': {
// this.$router.push({ path: `${UrlConfig.designUser.lessonHome}/${this.mapId}` });
// break;
// }
case 'runPlanDesign': {
this.$router.push({ path: `${UrlConfig.designUser.runPlan}/${obj.mapId}?skinCode=${obj.skinCode}` });
break;
@ -225,7 +208,7 @@ export default {
postBuildMapImport(JSON.parse(data)).then(res => {
loading.close();
that.$message.success('导入成功!');
that.refresh();
that.loadInitData();
loading.close();
}).catch(error => {
loading.close();

View File

@ -1,131 +1,131 @@
<template>
<div class="app-wrapper">
<map-create ref="mapCreate" :skin-code="skinCode" @refresh="refresh1" @editmap="handleNodeClick" />
<!-- <el-scrollbar wrap-class="scrollbar-wrapper"> -->
<div>
<div v-show="listShow" class="examList" :style="{width: widthLeft+'px'}">
<demon-list ref="demonList" :height="height" :width="widthLeft" @createMap="createMap"/>
</div>
<drap-left :width-left="widthLeft" @drapWidth="drapWidth" />
<transition>
<!-- position:'relative', -->
<!-- :style="{left:widthLeft+'px', width: (width - widthLeft)+'px'}" -->
<router-view :product-list="productList" />
</transition>
</div>
<!-- </el-scrollbar> -->
<div class="app-wrapper">
<map-create ref="mapCreate" :skin-code="skinCode" @refresh="refresh1" @editmap="handleNodeClick" />
<!-- <el-scrollbar wrap-class="scrollbar-wrapper"> -->
<div>
<div v-show="listShow" class="examList" :style="{width: widthLeft+'px'}">
<demon-list ref="demonList" :height="height" :width="widthLeft" @createMap="createMap" />
</div>
<drap-left :width-left="widthLeft" @drapWidth="drapWidth" />
<transition>
<!-- position:'relative', -->
<!-- :style="{left:widthLeft+'px', width: (width - widthLeft)+'px'}" -->
<router-view :product-list="productList" />
</transition>
</div>
<!-- </el-scrollbar> -->
</div>
</template>
<script>
import { mapGetters } from 'vuex';
import demonList from './userDemonList';
import drapLeft from '@/views/components/drapLeft/index';
import { launchFullscreen } from '@/utils/screen';
import localStore from 'storejs';
import { getSessionStorage, setSessionStorage } from '@/utils/auth';
import MapCreate from '@/views/map/mapdraft/mapmanage/create';
import { mapGetters } from 'vuex';
import demonList from './userDemonList';
import drapLeft from '@/views/components/drapLeft/index';
import { launchFullscreen } from '@/utils/screen';
import localStore from 'storejs';
import { getSessionStorage, setSessionStorage } from '@/utils/auth';
import MapCreate from '@/views/map/mapdraft/mapmanage/create';
export default {
name: 'DesignPlatform',
components: {
demonList,
drapLeft,
MapCreate
},
data() {
return {
listShow: true,
widthLeft: Number(localStore.get('LeftWidth')) || 450,
productList: [],
skinCode: '',
};
},
computed: {
...mapGetters([
'lessonbar'
]),
height() {
return this.$store.state.app.height - 50;
},
width() {
return this.$store.state.app.width;
}
},
watch: {
'lessonbar.opened': function (val) {
this.listShow = val;
},
widthLeft(val) {
this.setMapResize(val);
},
'$store.state.app.windowSizeCount': function() {
this.resize();
}
},
mounted() {
const againEnter = getSessionStorage('againEnter') || null;
if (!againEnter){
launchFullscreen();
setSessionStorage('againEnter',true);
}
this.resize();
this.widthLeft = Number(localStore.get('LeftWidth'));
},
methods: {
refresh() {
this.$refs && this.$refs.demonList && this.$refs.demonList.refresh();
},
drapWidth(width) {
this.widthLeft = Number(width);
},
export default {
name: 'DesignPlatform',
components: {
demonList,
drapLeft,
MapCreate
},
data() {
return {
listShow: true,
widthLeft: Number(localStore.get('LeftWidth')) || 450,
productList: [],
skinCode: ''
};
},
computed: {
...mapGetters([
'lessonbar'
]),
height() {
return this.$store.state.app.height - 50;
},
width() {
return this.$store.state.app.width;
}
},
watch: {
'lessonbar.opened': function (val) {
this.listShow = val;
},
widthLeft(val) {
this.setMapResize(val);
},
'$store.state.app.windowSizeCount': function() {
this.resize();
}
},
mounted() {
const againEnter = getSessionStorage('againEnter') || null;
if (!againEnter) {
launchFullscreen();
setSessionStorage('againEnter', true);
}
this.resize();
this.widthLeft = Number(localStore.get('LeftWidth'));
},
methods: {
refresh() {
this.$refs && this.$refs.demonList && this.$refs.demonList.loadInitData();
},
drapWidth(width) {
this.widthLeft = Number(width);
},
createMap() {
this.$refs.mapCreate.show();
},
refresh1() {
this.$refs.demonList.refresh2();
},
createMap() {
this.$refs.mapCreate.show();
},
getSkinCode(node) {
let next = node;
while (next) {
if (next.data && next.data.type == 'skin') {
this.skinCode = next.data.id;
break;
}
next = next.parent;
}
},
handleNodeClick(obj, node) {
this.getSkinCode(node);
if (obj && obj.type == 'map') {
this.editModel = obj;
this.$store.dispatch('menuOperation/setPopMenu', { position: null, menu: null });
this.mapSelected({ view: 'draft' });
}
},
mapSelected(data) {
if (data && this.editModel) {
this.$router.push({ path: `${UrlConfig.map.draft}/${this.editModel.id}/${data.view}`, query: { name: this.editModel.name } });
}
},
resize() {
this.widthLeft = Number(localStore.get('LeftWidth')) || this.widthLeft;
const width = this.$store.state.app.width - 521 - this.widthLeft;
const height = this.$store.state.app.height - 90;
this.$store.dispatch('config/resize', { width: width, height: height });
},
setMapResize(LeftWidth) {
const widths = this.$store.state.app.width - 521 - LeftWidth;
const heights = this.$store.state.app.height - 90;
this.$store.dispatch('config/resize', { width: widths, height: heights });
}
}
};
refresh1() {
this.$refs.demonList.loadInitData();
},
getSkinCode(node) {
let next = node;
while (next) {
if (next.data && next.data.type == 'skin') {
this.skinCode = next.data.id;
break;
}
next = next.parent;
}
},
handleNodeClick(obj, node) {
this.getSkinCode(node);
if (obj && obj.type == 'map') {
this.editModel = obj;
this.$store.dispatch('menuOperation/setPopMenu', { position: null, menu: null });
this.mapSelected({ view: 'draft' });
}
},
mapSelected(data) {
if (data && this.editModel) {
this.$router.push({ path: `${UrlConfig.map.draft}/${this.editModel.id}/${data.view}`, query: { name: this.editModel.name } });
}
},
resize() {
this.widthLeft = Number(localStore.get('LeftWidth')) || this.widthLeft;
const width = this.$store.state.app.width - 521 - this.widthLeft;
const height = this.$store.state.app.height - 90;
this.$store.dispatch('config/resize', { width: width, height: height });
},
setMapResize(LeftWidth) {
const widths = this.$store.state.app.width - 521 - LeftWidth;
const heights = this.$store.state.app.height - 90;
this.$store.dispatch('config/resize', { width: widths, height: heights });
}
}
};
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
@import "src/styles/mixin.scss";

View File

@ -134,12 +134,10 @@ export default {
},
mounted() {
this.loading = true;
console.log('==========');
this.loadInitData();
},
methods: {
loadInitData() {
console.log('==========');
getLessonTree(this.$route.params.skinCode).then(response=> {
response.data.forEach(elem => {
if (elem.children) {

View File

@ -67,13 +67,13 @@ export default {
data: []
}
},
generateType: {
/* generateType: {
type: 'select',
label: this.$t('lesson.automaticOrManual'),
config: {
data: [{ value: '02', label: this.$t('lesson.manual') }, { value: '01', label: this.$t('lesson.automatic') }]
}
},
},*/
name: {
type: 'text',
label: this.$t('lesson.trainingName')
@ -138,20 +138,20 @@ export default {
name: this.$t('lesson.demonstration'),
handleClick: this.demoDisplay,
type: ''
},
{
}
/* {
name: this.$t('lesson.trainingRecord'),
handleClick: this.trainingRecord,
type: ''
}
}*/
]
}
],
actions: [
{ text: this.$t('lesson.generateTraining'), btnCode: 'employee_auto', handler: this.autoMaticTrainging },
{ text: this.$t('lesson.updateTraining'), btnCode: 'employee_edit', handler: this.editTrainingByType, type: 'warning'},
{ text: this.$t('lesson.deleteTraining'), btnCode: 'employee_delete', handler: this.delAutoMaticTrainging, type: 'danger'},
{ text: this.$t('lesson.addTraining'), btnCode: 'employee_add', handler: this.addingTraining, type: 'primary' }
{ text: this.$t('lesson.deleteTraining'), btnCode: 'employee_delete', handler: this.delAutoMaticTrainging, type: 'danger'}
/* { text: this.$t('lesson.addTraining'), btnCode: 'employee_add', handler: this.addingTraining, type: 'primary' }*/
]
},
@ -242,9 +242,9 @@ export default {
delAutoMaticTrainging() {
this.$refs.draftTrain.show({ event: '03', title: this.$t('lesson.deleteAutoGeneratedTraining') });
},
addingTraining() {
this.$refs.draftTrain.show({ event: '04', title: this.$t('lesson.addTraining') });
},
// addingTraining() {
// this.$refs.draftTrain.show({ event: '04', title: this.$t('lesson.addTraining') });
// },
demoDisplay(index, node) {
trainingNotify({ trainingId: node.id }).then(resp => {
/** 区分演示和正式需要在演示时设置lessonId为0*/

View File

@ -86,12 +86,12 @@ export default {
},
clickEvent(obj, node, data) {
this.$store.dispatch('menuOperation/setPopMenu', { position: null, menu: null });
if (obj && obj.type === 'training') {
if (obj && obj.type === 'Training') {
this.$emit('selectMapSure', obj);
}
},
showContextMenu(e, obj, node, vueElem) {
if (obj && obj.type === 'trainingType' || obj.type === 'training') {
if (obj && obj.type === 'TrainingType' || obj.type === 'Training') {
e.preventDefault();
this.point = {
x: e.clientX,
@ -103,7 +103,7 @@ export default {
}
},
getParent(node) {
while (node && node.data.type != 'skin') {
while (node && node.data.type != 'Skin') {
node = node.parent;
}

View File

@ -9,7 +9,7 @@
/>
</div>
<drap-left :width-left="widthLeft" @drapWidth="drapWidth" />
<div class="mapContext">
<div>
<router-view />
</div>
</div>
@ -100,9 +100,4 @@ export default {
float: left;
width: 350px;
}
.mapContext {
float: right;
width: auto;
}
</style>

View File

@ -44,12 +44,12 @@ export default {
trainingId() {
return this.$route.params.trainingId;
},
width() {
return this.$store.state.app.width - 481 - this.widthLeft;
},
height() {
return this.$store.state.app.height - 90;
}
width() {
return this.$store.state.app.width - 481 - this.widthLeft;
},
height() {
return this.$store.state.app.height - 90;
}
},
watch: {
$route(newVal) {
@ -120,7 +120,7 @@ export default {
.blockContext {
// float: left;
height: 100%;
overflow: hidden;
overflow: hidden;
}
.mapContext {
@ -129,7 +129,7 @@ export default {
.stepContext {
float: right;
width: 520px;
width: 480px;
box-shadow: 0 2px 12px 0 rgba(0, 0, 0, .1);
}
</style>

View File

@ -5,7 +5,6 @@
{{ $t('lesson.trainingName') }} :
<b>{{ trainingName }}</b>
</span>
<el-button type="text" style="float: right; padding: 3px 0; margin-left: 10px" @click="back">{{ $t('global.back') }}</el-button>
<el-button type="text" :disabled="started" style="float: right; padding: 3px 0" @click="reset">{{ $t('global.reset') }}</el-button>
</div>
<el-tabs v-model="enabledTab" class="ViewControl" type="card">
@ -78,10 +77,8 @@ export default {
},
reset() {
this.$refs.stepInfo.reset();
},
back() {
this.$router.go(-1);
}
}
};
</script>

View File

@ -33,16 +33,6 @@
<el-form-item :label="$t('map.mapName')" prop="name">
<el-input v-model="newModel.name" />
</el-form-item>
<el-form-item :label="$t('global.city')" prop="cityCode">
<el-select v-model="newModel.cityCode" :placeholder="$t('map.pleaseSelect')">
<el-option
v-for="item in cityList"
:key="item.code"
:label="item.name"
:value="item.code"
/>
</el-select>
</el-form-item>
</el-form>
</el-tab-pane>
<el-tab-pane :label="$t('map.publishMapCreation')" name="second">
@ -111,7 +101,6 @@ export default {
newModel: {
id: '',
name: '',
cityCode: '',
skinCode: ''
},
pullModel: {
@ -124,9 +113,6 @@ export default {
],
skinCode: [
{ required: true, message: this.$t('rules.pleaseChooseSkinCode'), trigger: 'change' }
],
cityCode: [
{ required: true, message: this.$t('rules.selectCity'), trigger: 'change'}
]
},
pullRules: {

View File

@ -172,7 +172,7 @@ export default {
});
} else {
this.addModel.prdType = '01';
this.loading = false;
this.loading = false;
}
//