Commit 2d5aaea3 authored by zhanglw's avatar zhanglw

广播紧急通知

parent 44150d75
...@@ -2772,6 +2772,14 @@ var HttpReq = function(){ ...@@ -2772,6 +2772,14 @@ var HttpReq = function(){
data:data, data:data,
}) })
}, },
//紧急通知确认状态
ddNoticeReadStatus: function(param){
return request({
url: '/api/Notice/jinJiNoticeReadStatus',
method: 'get',
params:param,
})
},
}, },
......
...@@ -87,7 +87,7 @@ ...@@ -87,7 +87,7 @@
<div style="width:40%;text-align:left;" :class="item.id===selectedCarid?'selected':''"> <div style="width:40%;text-align:left;" :class="item.id===selectedCarid?'selected':''">
<div style="max-width:150px;overflow: hidden;white-space: nowrap;text-overflow: ellipsis;">{{ item.carNumber }}</div></div> <div style="max-width:150px;overflow: hidden;white-space: nowrap;text-overflow: ellipsis;">{{ item.carNumber }}</div></div>
<div style="width:30%;text-align:center;" :class="item.id===selectedCarid?'selected':''">{{ item.driver }}</div> <div style="width:30%;text-align:center;" :class="item.id===selectedCarid?'selected':''">{{ item.driver }}</div>
<div style="width:20%;text-align:right;padding-right:5px;" title="点击通话"> <div style="width:20%;text-align:right;padding-right:5px;" title="点击通话" @click="openVoiceView('通话', item)">
<span v-if="item.online==0" style="color:#a3a3a3">离线 <i class="el-icon-phone"></i></span> <span v-if="item.online==0" style="color:#a3a3a3">离线 <i class="el-icon-phone"></i></span>
<span v-else style="color:mediumseagreen">在线 <i class="el-icon-phone-outline"></i></span> <span v-else style="color:mediumseagreen">在线 <i class="el-icon-phone-outline"></i></span>
</div> </div>
...@@ -122,7 +122,7 @@ ...@@ -122,7 +122,7 @@
<div style="width:40%;text-align:left;" :class="item.id===selectedCarid?'selected':''"> <div style="width:40%;text-align:left;" :class="item.id===selectedCarid?'selected':''">
<div style="max-width:150px;overflow: hidden;white-space: nowrap;text-overflow: ellipsis;">{{ item.carNumber }}</div></div> <div style="max-width:150px;overflow: hidden;white-space: nowrap;text-overflow: ellipsis;">{{ item.carNumber }}</div></div>
<div style="width:30%;text-align:center;" :class="item.id===selectedCarid?'selected':''">{{ item.driver }}</div> <div style="width:30%;text-align:center;" :class="item.id===selectedCarid?'selected':''">{{ item.driver }}</div>
<div style="width:20%;text-align:right;padding-right:5px;" title="点击通话"> <div style="width:20%;text-align:right;padding-right:5px;" title="点击通话" @click="openVoiceView('通话', item)">
<span v-if="item.online==0" style="color:#a3a3a3">离线 <i class="el-icon-phone"></i></span> <span v-if="item.online==0" style="color:#a3a3a3">离线 <i class="el-icon-phone"></i></span>
<span v-else style="color:mediumseagreen">在线 <i class="el-icon-phone-outline"></i></span> <span v-else style="color:mediumseagreen">在线 <i class="el-icon-phone-outline"></i></span>
</div> </div>
...@@ -132,8 +132,8 @@ ...@@ -132,8 +132,8 @@
</div> </div>
</div> </div>
<div class="voiceAppContent_4"> <div class="voiceAppContent_4">
<button class="voiceAppContent_4_btns" @click="openVoiceView(1)">广播</button> <button class="voiceAppContent_4_btns" @click="openVoiceView('广播')">广播</button>
<button class="voiceAppContent_4_btns" @click="openVoiceView(2)">紧急通知</button> <button class="voiceAppContent_4_btns" @click="openVoiceView('紧急通知')">紧急通知</button>
<button class="voiceAppContent_4_btns">下班</button> <button class="voiceAppContent_4_btns">下班</button>
</div> </div>
</div> </div>
...@@ -189,6 +189,9 @@ ...@@ -189,6 +189,9 @@
<!-- 录音弹窗 --> <!-- 录音弹窗 -->
<div class="peopleScheAssembly" v-if="voiceViewShow"> <div class="peopleScheAssembly" v-if="voiceViewShow">
<div style="color:white;font-size:14px;margin-bottom:1vh;font-size: 18px;font-weight: 600;">车辆调度<span style="font-size:14px">{{curPaItem.pointName}}</span></div> <div style="color:white;font-size:14px;margin-bottom:1vh;font-size: 18px;font-weight: 600;">车辆调度<span style="font-size:14px">{{curPaItem.pointName}}</span></div>
<el-select v-show="actionType!=='通话'" v-model="selectCarFleet" placeholder="请选择车队" style="width:100%;margin:5px" @change="toSearchFn()">
<el-option v-for="(item,index) in carFleetData" :key="index" :label="item.name" :value="item.name" style="font-size:14px;"></el-option>
</el-select>
<div class="rolling"> <div class="rolling">
<div class="table-box"> <div class="table-box">
<dl> <dl>
...@@ -199,14 +202,14 @@ ...@@ -199,14 +202,14 @@
</dl> </dl>
</div> </div>
</div> </div>
<div class="voiceAppContent_2_content" style="padding:0;height: 35vh"> <div class="voiceAppContent_2_content" style="padding:0;height: 32vh">
<div class="rolling"> <div class="rolling">
<div class="table-box"> <div class="table-box">
<dl> <dl>
<dd v-for="(item,index) in actionTargets" :key="index" :class="item.actionType===actionType?'selected':''" @click="checkedActionType(item)"> <dd v-for="(item,index) in carsInforData" :key="index" :class="item.selected?'selected':''" @click="checkedActionType(item)">
<div style="width:10%;text-align:right;" :class="item.actionType===actionType?'selected':''"><i v-if="item.actionType===actionType" style="color:lightgray" class="el-icon-check"></i></div> <div style="width:10%;text-align:right;" :class="item.selected?'selected':''"><i v-if="item.selected" style="color:lightgray" class="el-icon-check"></i></div>
<div style="width:90%;text-align:center;" :class="item.actionType===actionType?'selected':''"> <div style="width:90%;text-align:center;" :class="item.selected?'selected':''">
{{item.title}}<span v-if="item.name">{{item.name}}</span> {{ item.number }}({{ item.odo == 0 ? '离线' : '在线'}})
</div> </div>
</dd> </dd>
</dl> </dl>
...@@ -260,6 +263,7 @@ export default { ...@@ -260,6 +263,7 @@ export default {
loading: false, loading: false,
selectCarFleet: null, selectCarFleet: null,
peopleScheAssemblyShow: false, peopleScheAssemblyShow: false,
carClass: '',
voiceViewShow: false, voiceViewShow: false,
chartsLiquid: null, chartsLiquid: null,
peningAreaList: [], peningAreaList: [],
...@@ -277,9 +281,9 @@ export default { ...@@ -277,9 +281,9 @@ export default {
wjList:[], wjList:[],
kcList:[], kcList:[],
carList: [], carList: [],
carFleetData: [],
carsInforData: [],
//录音相关数据 //录音相关数据
actionType: 0,
actionTargets: [],
type: "mp3", type: "mp3",
bitRate: 16, bitRate: 16,
sampleRate: 16000, sampleRate: 16000,
...@@ -316,29 +320,48 @@ export default { ...@@ -316,29 +320,48 @@ export default {
this.loadData(); this.loadData();
this.$nextTick(() => { this.$nextTick(() => {
this.initWebSocket(); this.initWebSocket();
//车队信息
HttpReq.truckDispatching.carFleetQuery({size: 9999}).then((res) => {
if (res.code == 200) {
this.carFleetData = res.data.content;
this.selectCarFleet = this.carFleetData[0].name
}
})
this.heartbeatTimer = setInterval(() => { this.heartbeatTimer = setInterval(() => {
this.reconnect(); this.reconnect();
}, 20000); }, 20000);
}) })
}, },
methods: { methods: {
toSearchFn(){
this.$nextTick(() => {
HttpReq.truckDispatching.carInformationQuery({
road: this.selectCarFleet
}).then((res) => {
if (res.code == 200) {
this.carsInforData = res.data.content.map(function(item) {
item.selected = true;
return item;
});
}
})
});
},
checkedActionType(item) { checkedActionType(item) {
this.actionType = item.actionType; item.selected = !item.selected;
}, },
openVoiceView(type){ openVoiceView(type,carObj) {
this.voiceViewShow=true; this.voiceViewShow = true;
if (type === 1) { this.actionType = type;
this.actionType = 1; this.carsInforData = [];
this.actionTargets = [ if(type==='通话'){
{title: '广播全域', actionType: 1}, this.carsInforData.push({
{title: '广播当前区域', name: this.curPaItem.pointName, actionType: 2} number: carObj.carNumber,
] odo: carObj.online,
}else if (type === 2) { selected: true,
this.actionType = 3; });
this.actionTargets = [ }else{
{title: '紧急通知全域', actionType: 3}, this.toSearchFn();
{title: '紧急通知仅当前区域', name: this.curPaItem.pointName, actionType: 4}
]
} }
//开启录音 //开启录音
this.recOpen(); this.recOpen();
...@@ -366,6 +389,8 @@ export default { ...@@ -366,6 +389,8 @@ export default {
this.selectedCarid = null; this.selectedCarid = null;
this.wjList = []; this.wjList = [];
this.kcList = []; this.kcList = [];
this.curPaItem.wjNum = 0;
this.curPaItem.kcNum = 0;
this.curPaItem.targetTaskTotal = 0 this.curPaItem.targetTaskTotal = 0
this.curPaItem.targetTaskCurrent = 0; this.curPaItem.targetTaskCurrent = 0;
HttpReq.truckDispatching.ddManualSchedulingDetailsById({id: item.id}).then((res) => { HttpReq.truckDispatching.ddManualSchedulingDetailsById({id: item.id}).then((res) => {
...@@ -448,6 +473,7 @@ export default { ...@@ -448,6 +473,7 @@ export default {
openCarListView(carClass) { openCarListView(carClass) {
this.peopleScheAssemblyShow = true; this.peopleScheAssemblyShow = true;
this.carList = []; this.carList = [];
this.carClass = carClass;
HttpReq.truckDispatching.ddManualSchedulingFindCarsByArea({ HttpReq.truckDispatching.ddManualSchedulingFindCarsByArea({
carClass: carClass, carClass: carClass,
pointName: this.curPaItem.pointName pointName: this.curPaItem.pointName
...@@ -466,6 +492,7 @@ export default { ...@@ -466,6 +492,7 @@ export default {
}); });
HttpReq.truckDispatching.ddChangeCarsScheduling({ HttpReq.truckDispatching.ddChangeCarsScheduling({
carStatusIdList: ids, carStatusIdList: ids,
carClass: this.carClass,
currentPoint: this.curPaItem.pointName currentPoint: this.curPaItem.pointName
}).then((res) => { }).then((res) => {
if (res.code == 200) { if (res.code == 200) {
...@@ -525,10 +552,13 @@ export default { ...@@ -525,10 +552,13 @@ export default {
websocketonmessage(e) { websocketonmessage(e) {
if (e) { if (e) {
let obj1 = JSON.parse(e.data); let obj1 = JSON.parse(e.data);
let carNumberList = obj1.toUserId.split(';');
carNumberList.pop();
HttpReq.truckDispatching.recentNoticeAdd({ HttpReq.truckDispatching.recentNoticeAdd({
noticeClass: obj1.fromUserId, noticeClass: obj1.fromUserId,
flag: 1, flag: 1,
videoContent: obj1.contentText videoContent: obj1.contentText,
carNumberList: carNumberList,
}).then((res) => { }).then((res) => {
}).catch(function (error) { }).catch(function (error) {
}); });
...@@ -687,10 +717,23 @@ export default { ...@@ -687,10 +717,23 @@ export default {
}); });
return; return;
} }
return; let toUserIds = [];
var blob = this.recLogLast.res.blob; This.carsInforData.forEach((item)=>{
if(item.selected){
toUserIds.push(item.number);
}
});
if(!toUserIds.length){
This.$notify({
title: '请先选择通话对象!',
type: 'warning',
duration: 2500
});
return;
}
toUserIds.push('pcBigScreen');
let blob = this.recLogLast.res.blob;
this.blobToDataURI(blob); this.blobToDataURI(blob);
/***方式一:将blob文件转成base64纯文本编码 ***/ /***方式一:将blob文件转成base64纯文本编码 ***/
var reader = new FileReader(); var reader = new FileReader();
reader.onloadend = function () { reader.onloadend = function () {
...@@ -698,7 +741,7 @@ export default { ...@@ -698,7 +741,7 @@ export default {
postData = This.resultBlob; //录音文件内容 postData = This.resultBlob; //录音文件内容
//发送语音数据 //发送语音数据
if (This.websocket.readyState == 1) { // that.websock.readyState = 1 表示连接成功,可以立即发送信息 if (This.websocket.readyState == 1) { // that.websock.readyState = 1 表示连接成功,可以立即发送信息
This.websocketsend(`{"toUserId":"${This.toUserIds}","contentText":"${postData}","fromUserId":"${This.dialogTitle}"}`); This.websocketsend(`{"toUserId":"${toUserIds.join(';')}","contentText":"${postData}","fromUserId":"${This.actionType}"}`);
This.$notify({ This.$notify({
title: '上传成功!', title: '上传成功!',
type: 'success', type: 'success',
...@@ -706,7 +749,7 @@ export default { ...@@ -706,7 +749,7 @@ export default {
}); });
} else if (This.websocket.readyState == 0) { // 表示正在连接,设置300ms后发送信息 } else if (This.websocket.readyState == 0) { // 表示正在连接,设置300ms后发送信息
setTimeout(function () { setTimeout(function () {
This.websocketsend(`{"toUserId":"${This.carAllNumberString}","contentText":"${postData}","fromUserId":"${This.dialogTitle}"}`); This.websocketsend(`{"toUserId":"${toUserIds.join(';')}","contentText":"${postData}","fromUserId":"${This.actionType}"}`);
This.$notify({ This.$notify({
title: '上传成功!', title: '上传成功!',
type: 'success', type: 'success',
...@@ -716,7 +759,7 @@ export default { ...@@ -716,7 +759,7 @@ export default {
} else { // 连接未创建或者创建失败,则重新创建连接,并设置500ms后发送信息 } else { // 连接未创建或者创建失败,则重新创建连接,并设置500ms后发送信息
This.initWebSocket(); This.initWebSocket();
setTimeout(function () { setTimeout(function () {
This.websocketsend(`{"toUserId":"${This.carAllNumberString}","contentText":"${postData}","fromUserId":"${This.dialogTitle}"}`); This.websocketsend(`{"toUserId":"${toUserIds.join(';')}","contentText":"${postData}","fromUserId":"${This.actionType}"}`);
This.$notify({ This.$notify({
title: '上传成功!', title: '上传成功!',
type: 'success', type: 'success',
...@@ -1325,6 +1368,11 @@ export default { ...@@ -1325,6 +1368,11 @@ export default {
background-color: #021445 !important; background-color: #021445 !important;
color: #31E5F5; color: #31E5F5;
} }
.el-select-dropdown__item.selected{
background-color: #021445 !important;
color: #31E5F5;
font-weight: 800;
}
.el-select-dropdown__item { .el-select-dropdown__item {
padding: 0px 20px; padding: 0px 20px;
......
...@@ -12,7 +12,10 @@ ...@@ -12,7 +12,10 @@
<div>录音回放</div> <div>录音回放</div>
</dt> </dt>
<dd v-for="(item,index) in recentNoticeData" :key="index"> <dd v-for="(item,index) in recentNoticeData" :key="index">
<div>{{ item.noticeClass }}</div> <div>
<span v-if="item.noticeClass==='紧急通知'" style="cursor: pointer;text-decoration:underline;" @click="openConfirmView(item)">{{item.noticeClass}} <i class="el-icon-search"></i></span>
<span v-else>{{ item.noticeClass }}</span>
</div>
<div>{{ item.createTime }}</div> <div>{{ item.createTime }}</div>
<div style="cursor: pointer;text-decoration:underline;" <div style="cursor: pointer;text-decoration:underline;"
@click="item.noticeClass == '智能调度' ? '' : item.noticeClass == '人工调度' ? '' : selectSituation(item)"> @click="item.noticeClass == '智能调度' ? '' : item.noticeClass == '人工调度' ? '' : selectSituation(item)">
...@@ -23,6 +26,40 @@ ...@@ -23,6 +26,40 @@
</div> </div>
</div> </div>
</div> </div>
<div class="vonfirm-view-box" v-if="confirmViewShow">
<div style="color:white;font-size:14px;margin-bottom:1vh;font-size: 18px;font-weight: 600;">通知确认情况</div>
<div class="rolling" style="padding:0;height: 3vh">
<div class="table-box">
<dl>
<dt>
<div style="width:10%"></div>
<div style="width:60%;text-align:left;padding-left:10px;">车牌号</div>
<div style="width:30%;text-align:right;padding-right:30px;">状态</div>
</dt>
</dl>
</div>
</div>
<div style="padding:0;height: 47vh">
<div class="rolling" style="height: 100%">
<div class="table-box">
<dl>
<dd v-for="(item,index) in carList" :key="index">
<div style="width:10%"></div>
<div style="width:60%;text-align:left;padding-left:10px;">{{item.carNumber}}</div>
<div style="width:30%;text-align:right;padding-right:5px;">
<span v-if="item.isRead===0" style="color:#a3a3a3">未确认</span>
<span v-else style="color:mediumseagreen">已确认</span>
<i style="color:lightgray" class="el-icon-s-promotion"></i>
</div>
</dd>
</dl>
</div>
</div>
</div>
<div class="voiceAppContent_4">
<button class="voiceAppContent_4_btns" @click="closeConfirmView()">关闭窗口</button>
</div>
</div>
<!-- 播放器 --> <!-- 播放器 -->
<audio id="audioIndex" controls currentTime autoplay :src="srcUrl" style="display:none"></audio> <audio id="audioIndex" controls currentTime autoplay :src="srcUrl" style="display:none"></audio>
</div> </div>
...@@ -38,12 +75,26 @@ export default { ...@@ -38,12 +75,26 @@ export default {
DPcomputer17BoxTimer: null, DPcomputer17BoxTimer: null,
recentNoticeData: [], //近期通知列表 recentNoticeData: [], //近期通知列表
srcUrl: null, srcUrl: null,
confirmViewShow: false,
carList: [],
} }
}, },
mounted() { mounted() {
this.loadData(); this.loadData();
}, },
methods: { methods: {
openConfirmView(item){
this.confirmViewShow = true;
this.carList = [];
HttpReq.truckDispatching.ddNoticeReadStatus({id:item.id}).then((res) => {
if (res.code == 200) {
this.carList = res.data||[];
}
})
},
closeConfirmView(){
this.confirmViewShow = false;
},
loadData() { loadData() {
this.srcUrl = null; this.srcUrl = null;
//近期通知列表 //近期通知列表
...@@ -51,7 +102,6 @@ export default { ...@@ -51,7 +102,6 @@ export default {
if (res.code == 200) { if (res.code == 200) {
this.recentNoticeData = res.data.content; this.recentNoticeData = res.data.content;
} }
;
}) })
this.DPcomputer17BoxTimer = setInterval(() => { this.DPcomputer17BoxTimer = setInterval(() => {
...@@ -60,7 +110,6 @@ export default { ...@@ -60,7 +110,6 @@ export default {
if (res.code == 200) { if (res.code == 200) {
this.recentNoticeData = res.data.content; this.recentNoticeData = res.data.content;
} }
;
}) })
}, 5000) }, 5000)
...@@ -286,4 +335,41 @@ export default { ...@@ -286,4 +335,41 @@ export default {
font-size: 15px; font-size: 15px;
color: #A6F6F9; color: #A6F6F9;
} }
.DPcomputer17Box .vonfirm-view-box {
position: absolute;
bottom: 33vh;
left: 0.7vw;
height: 58vh;
width: 18.5vw;
z-index: 50;
background: no-repeat center center url('~@/assets/images/cutGraph/guzhangshenbankuang1.png');
background-size: 100% 100%;
padding: 10px 10px 0px;
box-sizing: border-box;
}
.DPcomputer17Box .voiceAppContent_4 {
width: 100%;
display: flex;
flex-wrap: wrap;
align-content: flex-start;
justify-content: space-evenly;
}
.DPcomputer17Box .voiceAppContent_4_btns {
background-color: #112251;
border: 1px solid #00FCF9;
color: #00FFFF;
border-radius: 5px;
height: 2.5vh;
/*margin: 5px 2vw 3px;*/
width: 25%;
font-size: 15px;
cursor: pointer;
}
.DPcomputer17Box .voiceAppContent_4_btns:active {
background: linear-gradient(to top, #007EFF, #30CFBE);
border: 1px solid #00FCF9;
color: white;
}
</style> </style>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment