调整车站值班员按钮

This commit is contained in:
zyy 2020-09-24 18:34:25 +08:00
parent 8a28526fe1
commit 88ec572564
2 changed files with 59 additions and 36 deletions

View File

@ -1,11 +1,22 @@
<template> <template>
<div class="chatBox" :class="{'active': drawer}" :style="{'bottom':bottom+'px'}"> <div class="chatBox" :class="{'active': drawer}" :style="{'bottom':bottom+'px'}">
<div class="menuTrainListBtn" @click="clickBtn"> <div class="menuTrainListBtn" @click="clickBtn">
<!-- <i class="el-icon-more" /> --> <template v-if="userRole == 'DISPATCHER'">
<p style="margin: 0;"></p> <p style="margin: 0;"></p>
<p style="margin: 0;"></p> <p style="margin: 0;"></p>
<p style="margin: 0;"></p> <p style="margin: 0;"></p>
<p style="margin: 0;"></p> <p style="margin: 0;"></p>
</template>
<template v-if="userRole != 'AUDIENCE' && userRole != 'DISPATCHER'">
<p style="margin: 0;"></p>
<p style="margin: 0;"></p>
</template>
<template v-if="userRole == 'AUDIENCE'">
<p style="margin: 0;"></p>
<p style="margin: 0;"></p>
<p style="margin: 0;"></p>
<p style="margin: 0;"></p>
</template>
</div> </div>
<div class="chat-box-main"> <div class="chat-box-main">
<!-- v-if="!conversitionId && userRole !== 'AUDIENCE' && !commonConversation" --> <!-- v-if="!conversitionId && userRole !== 'AUDIENCE' && !commonConversation" -->
@ -116,20 +127,8 @@
width="360px" width="360px"
@changeMessageList="changeMessageList" @changeMessageList="changeMessageList"
/> />
<!-- <div v-if="recordSending" class="chat_record_tip">
<div id="record_progress_bar" :style="'width:'+100/60*seconds+'%'" />
<div class="record_icon" />
<div class="record_tip_text">正在录音...</div>
<div class="record_tip_confirm" @click="stopRecording()">确定</div>
<div class="record_tip_cancle" @click="cancleRecording()">取消</div>
</div> -->
<chat-member-list ref="chatMemberList" :conversition-member-list="conversitionMemberList" :simulation-users="simulationUsers" /> <chat-member-list ref="chatMemberList" :conversition-member-list="conversitionMemberList" :simulation-users="simulationUsers" />
</div> </div>
<!-- <div class="chat-box-footer">
<div class="chat-box-footer-tool" />
<el-button v-if="isButtonShow && !commonConversation" size="mini" type="danger" class="chat-box-footer-quit" :loading="quitLoading" @click="quitConversition()">退出会话</el-button>
<el-button v-if="isButtonShow && !commonConversation" class="chat-box-footer-send" size="mini" type="primary" :disabled="recordSending" @click="startRecording()">发送语音</el-button>
</div> -->
</template> </template>
</div> </div>
<chat-setting ref="chatSetting" :form="form" @setSetting="setSetting" /> <chat-setting ref="chatSetting" :form="form" @setSetting="setSetting" />
@ -320,7 +319,7 @@ export default {
}, },
'$store.state.training.memberList': function (val) { '$store.state.training.memberList': function (val) {
if (val && val.length) { if (val && val.length) {
this.memberData = this.$store.state.training.memberData; this.memberData = JSON.parse(JSON.stringify(this.$store.state.training.memberData));
const dispatcherList = []; const dispatcherList = [];
const electricDispatcherList = []; const electricDispatcherList = [];
const depotDispatcherList = []; const depotDispatcherList = [];
@ -361,6 +360,7 @@ export default {
break; break;
} }
}); });
stationSupervisorList.push({ label: '全部集中站', value: 'allConcentrateStation', active: false }, { label: '全部车站', value: 'allStation', active: false });
this.treeData = [{ this.treeData = [{
label: '行调', label: '行调',
id: 'dispatcher', id: 'dispatcher',
@ -549,8 +549,30 @@ export default {
handleSetting() { handleSetting() {
this.$refs.chatSetting.doShow(); this.$refs.chatSetting.doShow();
}, },
handleCheckChange(data) { handleCheckChange(data, jude = false) {
if (data.value == 'allConcentrateStation' || data.value == 'allStation') {
data.active = !data.active; data.active = !data.active;
if (data.value == 'allConcentrateStation') {
this.treeData[1] && this.treeData[1]['children'].forEach(item => {
const stationModel = this.$store.getters['map/getDeviceByCode'](item.deviceCode);
if (stationModel && stationModel.centralized) {
item.active = data.active;
this.handleCheckChange(item, true);
}
});
}
if (data.value == 'allStation') {
this.treeData[1] && this.treeData[1]['children'].forEach(item => {
if (item.value != 'allConcentrateStation' && item.value != 'allStation') {
item.active = data.active;
this.handleCheckChange(item, true);
}
});
}
} else {
if (!jude) {
data.active = !data.active;
}
const member = data; const member = data;
if (data.active) { if (data.active) {
if (member && member.type === 'DRIVER' && !this.activeTrains.includes(member.deviceCode)) { if (member && member.type === 'DRIVER' && !this.activeTrains.includes(member.deviceCode)) {
@ -570,6 +592,7 @@ export default {
} }
}); });
} }
}
}, },
filterNode() { filterNode() {
this.treeData[2] && this.treeData[2]['children'].forEach(train => { this.treeData[2] && this.treeData[2]['children'].forEach(train => {

View File

@ -26,7 +26,7 @@
@node-click="handleNodeClick" @node-click="handleNodeClick"
> >
<span :id="data.id" slot-scope="{ node, data }" class="custom-tree-node"> <span :id="data.id" slot-scope="{ node, data }" class="custom-tree-node">
<span>{{ data.label }}</span> <span>{{ node.label }}</span>
<span v-if="data.type"> <span v-if="data.type">
<el-select :key="data.id" v-model="data.userId" placeholder="请选择" clearable size="mini" @change="nodeMemberChange($event, data)"> <el-select :key="data.id" v-model="data.userId" placeholder="请选择" clearable size="mini" @change="nodeMemberChange($event, data)">
<el-option <el-option
@ -147,7 +147,7 @@ export default {
}, },
'$store.state.training.memberList': function (val) { '$store.state.training.memberList': function (val) {
if (val && val.length) { if (val && val.length) {
this.memberData = this.$store.state.training.memberData; this.memberData = JSON.parse(JSON.stringify(this.$store.state.training.memberData));
const dispatcherList = []; const dispatcherList = [];
const electricDispatcherList = []; const electricDispatcherList = [];
const depotDispatcherList = []; const depotDispatcherList = [];