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数据 */ /** 设置stations数据 */
setStations: ({ commit }, mapModel) => { setStations: ({ commit }, mapModel) => {
commit('setStations', mapModel); return new Promise((resolve) => {
commit('setStations', mapModel);
resolve(mapModel);
});
}, },
/** 重置运行图数据更新池 */ /** 重置运行图数据更新池 */
resetRunPlanData:({ commit }) => { resetRunPlanData:({ commit }) => {

View File

@ -2,9 +2,9 @@ export function getBaseUrl() {
let BASE_API; let BASE_API;
if (process.env.NODE_ENV === 'development') { if (process.env.NODE_ENV === 'development') {
// BASE_API = 'https://joylink.club/jlcloud'; // 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.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.41:9000'; // 张赛
// BASE_API = 'http://192.168.3.82:9000'; // 杜康 // BASE_API = 'http://192.168.3.82:9000'; // 杜康
// BASE_API = 'http://b29z135112.zicp.vip'; // BASE_API = 'http://b29z135112.zicp.vip';

View File

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

View File

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

View File

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

View File

@ -1,20 +1,20 @@
<template> <template>
<div> <div>
<chat-box :group="group" :user-role="userRole" /> <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> <div class="btn_hover" @click="menuClick">菜单</div>
<el-button-group ref="button_group_box" class="button_group_box" :style="`transform: translateX(-${btnWidth}px)`"> <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="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>
<el-button v-if="isShowScheduling || isDriver" size="small" @click="jumpjlmap3d">{{ jl3dname }}</el-button> <!-- cctv视图 -->
<!-- cctv视图 --> <el-button v-if="isShowScheduling || isStationSupervisor" size="small" @click="jumpjl3dpassflow">{{ $t('display.demon.passengerflow') }}</el-button>
<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 && !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" size="small" @click="memberManage">成员管理</el-button> <el-button v-if="isAdmin && isProject" size="small" @click="handleEquipment">设备管理</el-button>
<el-button v-if="isAdmin && isProject" size="small" @click="handleEquipment">设备管理</el-button>
</template>
</el-button-group> </el-button-group>
</div> </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'}"> <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() { isProject() {
return getSessionStorage('project') != 'login' && getSessionStorage('project') != 'design'; 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: { watch: {
@ -516,6 +527,7 @@ export default {
height: 32px; height: 32px;
overflow: hidden; overflow: hidden;
padding-left: 44px; padding-left: 44px;
z-index: 9;
.btn_hover{ .btn_hover{
position: absolute; position: absolute;
left: 0; left: 0;

View File

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