Commit 8780570f authored by caicaicai's avatar caicaicai

修改

parent e8979c00
......@@ -61,6 +61,7 @@
</div>
</div>
<!-- 语音所需内容,隐藏无需展示 -->
<div class="main" style="display:none;">
<slot name="top"></slot>
......@@ -181,7 +182,7 @@ export default {
this.searchText = '';
this.selectCarRadioArray = [];
this.situationWhich = 10000;
this.userName1 = value;
this.userName1 = value; //车牌号
this.recOpen();
//车队
httpGet(carFleetQuery,{size:9999,page:0}).then((res) => {
......@@ -235,7 +236,7 @@ export default {
//初始化weosocket
initWebSocket(){
//const wsuri = 'ws://8.143.203.103:9090/webSocket' + '/' + this.userName1;
const wsuri = 'ws://192.168.0.111:8001/webSocket' + '/' + this.userName1;
const wsuri = 'ws://192.168.0.111:9090/webSocket' + '/' + this.userName1;
this.websocket = new WebSocket(wsuri);
this.websocket.onopen = this.websocketonopen;
this.websocket.onerror = this.websocketonerror;
......@@ -252,17 +253,31 @@ export default {
console.log("WebSocket连接发生错误");
},
//WebSocket数据接收
websocketonmessage(e){
websocketonmessage(e){
console.log(e);
let that = this;
if(e == undefined){
return
let str1 = localStorage.getItem(this.userName1 + 'voiceData');
if(!str1){
return
}else{
let arr2 = JSON.parse(str1);
that.videoContentAllArray = arr2;
}
}else{
let array1 = [...that.videoContentAllArray];
array1.push(JSON.parse(e.data));
that.videoContentAllArray = array1;
//that.videoContent = JSON.parse(e.data).contentText;
//that.videoContentUserName = JSON.parse(e.data).toUserId;
let str1 = localStorage.getItem(this.userName1 + 'voiceData');
let str2 = JSON.parse(e.data);
if(!str1){
let arr1 = [];
arr1.unshift(str2);
that.videoContentAllArray = arr1;
localStorage.setItem(this.userName1 + 'voiceData',JSON.stringify(arr1));
}else{
let arr2 = JSON.parse(str1);
arr2.unshift(str2);
that.videoContentAllArray = arr2;
localStorage.setItem(this.userName1 + 'voiceData',JSON.stringify(arr2));
}
}
},
//WebSocket数据发送
......@@ -588,6 +603,7 @@ export default {
this.dialogCancel();
this.waitDialogClickFn();
},
//播放语音
selectSituation(item){
this.recClose();
// Blobdata 就是后端返回给你的Blob数据
......@@ -601,10 +617,13 @@ export default {
};
},
//删除某个语音
selectDeleteSituation(index){
let array2 = [...this.videoContentAllArray];
array2.splice(index,1);
this.videoContentAllArray = array2;
let str1 = localStorage.getItem(this.userName1 + 'voiceData');
let arr3 = JSON.parse(str1);
arr3.splice(index,1);
this.videoContentAllArray = arr3;
localStorage.setItem(this.userName1 + 'voiceData',JSON.stringify(arr3));
},
addWavHeader(samples, sampleRateTmp, sampleBits, channelCount) {
const dataLength = samples.byteLength;
......
......@@ -56,9 +56,9 @@
<personalCenter ref="personalCenterMethod" v-show="selectFunction == 6"/>
<smallWindow ref="smallWindowMethod" v-show="selectFunction == 7"/>
<!-- 地图区域 -->
<div id="centerDiv" class="mapcontainer">
<!-- <div id="centerDiv" class="mapcontainer">
<mars3dViewerMap :url="configUrl" @onload="onMapload"/>
</div>
</div> -->
<!-- 电铲待装车辆列表 -->
<div class="waitingtrucksView" v-if="carclass == '电铲'">
<div class="waitingtrucksView_title">待装卡车列表</div>
......
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