This commit is contained in:
zyy 2020-08-03 15:32:20 +08:00
commit 057071769f
7 changed files with 119 additions and 74 deletions

View File

@ -123,7 +123,10 @@ const runPlan = {
},
/** 设置stations数据 */
setStations: ({ commit }, mapModel) => {
commit('setStations', mapModel);
return new Promise((resolve) => {
commit('setStations', mapModel);
resolve(mapModel);
});
},
/** 重置运行图数据更新池 */
resetRunPlanData:({ commit }) => {

View File

@ -2,9 +2,9 @@ export function getBaseUrl() {
let BASE_API;
if (process.env.NODE_ENV === 'development') {
// BASE_API = 'https://joylink.club/jlcloud';
BASE_API = 'https://test.joylink.club/jlcloud';
// BASE_API = 'https://test.joylink.club/jlcloud';
// BASE_API = 'http://192.168.3.5:9000'; // 袁琪
// BASE_API = 'http://192.168.3.6:9000'; // 旭强
BASE_API = 'http://192.168.3.6:9000'; // 旭强
// BASE_API = 'http://192.168.3.41:9000'; // 张赛
// BASE_API = 'http://192.168.3.82:9000'; // 杜康
// BASE_API = 'http://b29z135112.zicp.vip';

View File

@ -203,7 +203,8 @@ export default {
trainLabelPosition:0,
updateCount: 0,
op: null,
updateData: []
updateData: [],
seriesMap: {}
};
},
computed: {
@ -377,11 +378,15 @@ export default {
async loadChartPage() {
try {
this.series = [];
this.seriesMap = {};
const stations = this.$store.state.runPlan.stations;
const planData = this.$store.state.runPlan.planData;
this.kmRangeCoordMap = this.PlanConvert.convertStationsToMap(stations);
this.pushModels(this.series, [this.PlanConvert.initializeYaxis(stations)]);
this.oldseries = this.pushModels(this.series, this.PlanConvert.convertDataToModels(planData, stations, this.kmRangeCoordMap, { color: '#000', width: 1 }));
this.oldseries.forEach(item => {
this.seriesMap[item.name] = item;
});
await this.analyticalServiceNumber(this.$store.state.runPlan.editData);
} catch (error) {
this.$messageBox(`加载运行图数据失败`);
@ -499,30 +504,50 @@ export default {
op.series.splice(this.trainLabelPosition - 1, 1);
this.myChart && this.myChart.setOption(op, true);
}
this.oldseries.forEach((item, index) => {
if (item.name == serviceNumber && item.data) {
if (tripNumber) {
const temp = item.data.filter(elem => elem[3] == tripNumber);
if (temp.length) {
data = temp;
item.markPoint.data.forEach(each=>{
if (each.name == temp[0][4]) {
markPoint = deepAssign({}, {data:[each]});
markPoint.symbol = 'roundRect';
markPoint.symbolSize = 1;
markPoint.data[0].label.color = '#f00';
}
});
if (tripNumber && this.seriesMap[serviceNumber]) {
const temp = this.seriesMap[serviceNumber].data.filter(elem => elem[3] == tripNumber);
if (temp.length) {
data = temp;
this.seriesMap[serviceNumber].markPoint.data.forEach(each=> {
if (each.name == temp[0][4]) {
markPoint = deepAssign({}, {data:[each]});
markPoint.symbol = 'roundRect';
markPoint.symbolSize = 1;
markPoint.data[0].label.color = '#f00';
}
} else {
markPoint = deepAssign({}, item.markPoint);
markPoint.data.forEach(each=>{
each.label.color = '#f00';
});
data = item.data;
}
});
}
});
} else if (this.seriesMap[serviceNumber]) {
markPoint = deepAssign({}, this.seriesMap[serviceNumber].markPoint);
markPoint.data.forEach(each => {
each.label.color = '#f00';
});
data = this.seriesMap[serviceNumber].data;
}
// this.oldseries.forEach((item, index) => {
// if (item.name == serviceNumber && item.data) {
// if (tripNumber) {
// const temp = item.data.filter(elem => elem[3] == tripNumber);
// if (temp.length) {
// data = temp;
// item.markPoint.data.forEach(each=>{
// if (each.name == temp[0][4]) {
// markPoint = deepAssign({}, {data:[each]});
// markPoint.symbol = 'roundRect';
// markPoint.symbolSize = 1;
// markPoint.data[0].label.color = '#f00';
// }
// });
// }
// } else {
// markPoint = deepAssign({}, item.markPoint);
// markPoint.data.forEach(each=>{
// each.label.color = '#f00';
// });
// data = item.data;
// }
// }
// });
op.series.push({
name: 'trainLabel',
lineStyle: {

View File

@ -6,19 +6,18 @@
<span v-if="countTime" class="display-score">{{ $t('display.demon.trialTime') }} {{ countTime }}</span>
</el-row>
</div>
<div class="display_top_draft" :style="{top: offset+'px'}">
<div v-if="!dataError" class="display_top_draft" :style="{top: offset+'px'}">
<div class="btn_hover" @click="menuClick">菜单</div>
<el-button-group ref="button_group_box" class="button_group_box" :style="`transform: translateX(-${btnWidth}px)`">
<template v-if="!dataError"> <!-- 地图错误判断 -->
<!-- 设备视图 -->
<el-button v-if="isShow3dmodel && !isShowScheduling" size="small" @click="jumpjlmap3dmodel">{{ jl3dmodel }}</el-button>
<!-- 三维视图 -->
<el-button v-if="!isShowScheduling" size="small" @click="jumpjlmap3d">{{ jl3dname }}</el-button>
<!-- cctv视图 -->
<el-button v-if="!isShowScheduling" size="small" @click="jumpjl3dpassflow">{{ jl3dpassflow }}</el-button>
<!-- 排班计划 -->
<el-button v-if="isShowScheduling" type="primary" size="small" @click="jumpScheduling">{{ $t('display.demon.dispatchingPlan') }}</el-button>
</template>
<!-- 地图错误判断 -->
<!-- 设备视图 -->
<el-button v-if="isShow3dmodel && !isShowScheduling" size="small" @click="jumpjlmap3dmodel">{{ jl3dmodel }}</el-button>
<!-- 三维视图 -->
<el-button v-if="!isShowScheduling" size="small" @click="jumpjlmap3d">{{ jl3dname }}</el-button>
<!-- cctv视图 -->
<el-button v-if="!isShowScheduling" size="small" @click="jumpjl3dpassflow">{{ jl3dpassflow }}</el-button>
<!-- 排班计划 -->
<el-button v-if="isShowScheduling" type="primary" size="small" @click="jumpScheduling">{{ $t('display.demon.dispatchingPlan') }}</el-button>
</el-button-group>
</div>
<div class="display-draft" :class="{'haerbin_btn_box': $route.query.lineCode == '07'}" :style="{bottom: offsetBottom + 'px'}">
@ -412,6 +411,7 @@ export default {
height: 32px;
overflow: hidden;
padding-left: 44px;
z-index: 9;
.btn_hover{
position: absolute;
left: 0;

View File

@ -354,6 +354,7 @@ export default {
type: 'role',
children: maintainerList
}];
this.initCommonMemberList();
}
}
},
@ -609,33 +610,36 @@ export default {
});
}
this.commonMessageList = messages.sort(this.sortByMessageTime);
const temDispatcherList = [];
const temStationSupervisorList = [];
const temMaintainerList = [];
const temDriverList = [];
this.$store.state.training.memberList.forEach(item =>{
switch (item.type) {
case 'DISPATCHER':
temDispatcherList.push({memberId: item.id, connect:true });
break;
case 'STATION_SUPERVISOR':
temStationSupervisorList.push({memberId: item.id, connect:true });
break;
case 'MAINTAINER':
temMaintainerList.push({memberId: item.id, connect:true });
break;
case 'DRIVER':
temDriverList.push({memberId: item.id, connect:true });
break;
}
});
this.commonMemberList = [...temDispatcherList, ...temStationSupervisorList, ...temMaintainerList, ...temDriverList];
if (this.userRole === 'AUDIENCE' || this.commonConversation) {
this.conversitionMemberList = [];
this.messageList = [...this.commonMessageList];
this.conversitionMemberList = this.commonMemberList;
this.initCommonMemberList();
});
},
initCommonMemberList() {
const temDispatcherList = [];
const temStationSupervisorList = [];
const temMaintainerList = [];
const temDriverList = [];
this.$store.state.training.memberList.forEach(item =>{
switch (item.type) {
case 'DISPATCHER':
temDispatcherList.push({memberId: item.id, connect:true });
break;
case 'STATION_SUPERVISOR':
temStationSupervisorList.push({memberId: item.id, connect:true });
break;
case 'MAINTAINER':
temMaintainerList.push({memberId: item.id, connect:true });
break;
case 'DRIVER':
temDriverList.push({memberId: item.id, connect:true });
break;
}
});
this.commonMemberList = [...temDispatcherList, ...temStationSupervisorList, ...temMaintainerList, ...temDriverList];
if (this.userRole === 'AUDIENCE' || this.commonConversation) {
this.conversitionMemberList = [];
this.messageList = [...this.commonMessageList];
this.conversitionMemberList = this.commonMemberList;
}
},
changeMessageList(data) {
if (data.flag) {

View File

@ -1,20 +1,20 @@
<template>
<div>
<chat-box :group="group" :user-role="userRole" />
<div class="display_top_draft" :style="{top: offset+'px'}">
<!-- 地图没有报错-->
<!-- 地图错误判断 -->
<div v-if="!dataError&&hasOneButton" class="display_top_draft" :style="{top: offset+'px'}">
<div class="btn_hover" @click="menuClick">菜单</div>
<el-button-group ref="button_group_box" class="button_group_box" :style="`transform: translateX(-${btnWidth}px)`">
<template v-if="!dataError"> <!-- 地图错误判断 -->
<!-- 设备视图 -->
<el-button v-if="isShow3dmodel && isShowScheduling" size="small" @click="jumpjlmap3dmodel">{{ $t('display.demon.deviceView') }}</el-button>
<!-- 三维视图 / 司机视角 -->
<el-button v-if="isShowScheduling || isDriver" size="small" @click="jumpjlmap3d">{{ jl3dname }}</el-button>
<!-- cctv视图 -->
<el-button v-if="isShowScheduling || isStationSupervisor" size="small" @click="jumpjl3dpassflow">{{ $t('display.demon.passengerflow') }}</el-button>
<el-button v-if="isAdmin && !noQrcodeList.includes(project)" type="primary" size="small" @click="generateQrCode">生成二维码</el-button>
<el-button v-if="isAdmin" size="small" @click="memberManage">成员管理</el-button>
<el-button v-if="isAdmin && isProject" size="small" @click="handleEquipment">设备管理</el-button>
</template>
<!-- 设备视图 -->
<el-button v-if="isShow3dmodel && isShowScheduling" size="small" @click="jumpjlmap3dmodel">{{ $t('display.demon.deviceView') }}</el-button>
<!-- 三维视图 / 司机视角 -->
<el-button v-if="isShowScheduling || isDriver" size="small" @click="jumpjlmap3d">{{ jl3dname }}</el-button>
<!-- cctv视图 -->
<el-button v-if="isShowScheduling || isStationSupervisor" size="small" @click="jumpjl3dpassflow">{{ $t('display.demon.passengerflow') }}</el-button>
<el-button v-if="isAdmin && !noQrcodeList.includes(project)" type="primary" size="small" @click="generateQrCode">生成二维码</el-button>
<el-button v-if="isAdmin" size="small" @click="memberManage">成员管理</el-button>
<el-button v-if="isAdmin && isProject" size="small" @click="handleEquipment">设备管理</el-button>
</el-button-group>
</div>
<div class="display-draft" :class="{'display-type-hb': lineCode == '07' && $store.state.training.prdType=='01', 'haerbin_btn_box': lineCode == '07'}" :style="{bottom: offsetBottom + 'px'}">
@ -138,6 +138,17 @@ export default {
},
isProject() {
return getSessionStorage('project') != 'login' && getSessionStorage('project') != 'design';
},
hasOneButton() {
let num = 0;
if ((this.isShow3dmodel && this.isShowScheduling) ||
(this.isShowScheduling || this.isDriver) ||
(this.isShowScheduling || this.isStationSupervisor) ||
(this.isAdmin && !this.noQrcodeList.includes(this.project)) ||
(this.isAdmin) || (this.isAdmin && this.isProject)) {
num++;
}
return num > 0;
}
},
watch: {
@ -516,6 +527,7 @@ export default {
height: 32px;
overflow: hidden;
padding-left: 44px;
z-index: 9;
.btn_hover{
position: absolute;
left: 0;

View File

@ -313,6 +313,7 @@ export default {
} catch (error) {
this.viewDisabled = false;
console.log(error);
this.$messageBox(`加载运行图数据失败`);
}
},