Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
卡
卡车调度系统
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
caicaicai
卡车调度系统
Commits
b19a45dc
Commit
b19a45dc
authored
May 12, 2022
by
caicaicai
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改
parent
e69a32f1
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
27 deletions
+5
-27
Map2.vue
src/components/mars3d/Map2.vue
+1
-1
index.vue
...iews/MLargeScreen/components/intelligentSchedul/index.vue
+4
-26
No files found.
src/components/mars3d/Map2.vue
View file @
b19a45dc
...
@@ -173,8 +173,8 @@ export default {
...
@@ -173,8 +173,8 @@ export default {
let
array1
=
[];
let
array1
=
[];
res
.
data
.
line
.
forEach
((
item
,
index
)
=>
{
res
.
data
.
line
.
forEach
((
item
,
index
)
=>
{
let
array2
=
[];
let
array2
=
[];
array2
.
push
(
item
.
lat
);
array2
.
push
(
item
.
lon
);
array2
.
push
(
item
.
lon
);
array2
.
push
(
item
.
lat
);
array2
.
push
(
1000
);
array2
.
push
(
1000
);
array1
.
push
(
array2
);
array1
.
push
(
array2
);
})
})
...
...
src/views/MLargeScreen/components/intelligentSchedul/index.vue
View file @
b19a45dc
...
@@ -171,7 +171,8 @@
...
@@ -171,7 +171,8 @@
<slot
name=
"bottom"
></slot>
<slot
name=
"bottom"
></slot>
</div>
</div>
<audio
controls
currentTime
autoplay
:src=
'srcUrl'
style=
"display:none;"
></audio>
<audio
controls
currentTime
autoplay
:src=
'srcUrl'
style=
"display:none;"
></audio>
<!-- 语音发起dialog -->
<!-- 语音发起dialog -->
<el-dialog
:title=
"dialogTitle"
:visible.sync=
"dialogVisible"
width=
"30%"
>
<el-dialog
:title=
"dialogTitle"
:visible.sync=
"dialogVisible"
width=
"30%"
>
...
@@ -678,6 +679,7 @@ export default {
...
@@ -678,6 +679,7 @@ export default {
})
})
carNumberString
=
carNumberString
+
'
pcBigScreen
'
;
carNumberString
=
carNumberString
+
'
pcBigScreen
'
;
this
.
carAllNumberString
=
carNumberString
;
this
.
carAllNumberString
=
carNumberString
;
var
This
=
this
;
var
This
=
this
;
if
(
!
this
.
recLogLast
){
if
(
!
this
.
recLogLast
){
this
.
reclog
(
"
请先录音,然后停止后再上传
"
,
1
);
this
.
reclog
(
"
请先录音,然后停止后再上传
"
,
1
);
...
@@ -690,38 +692,14 @@ export default {
...
@@ -690,38 +692,14 @@ export default {
};
};
var
blob
=
this
.
recLogLast
.
res
.
blob
;
var
blob
=
this
.
recLogLast
.
res
.
blob
;
//本例子假设使用原始XMLHttpRequest请求方式,实际使用中自行调整为自己的请求方式
//录音结束时拿到了blob文件对象,可以用FileReader读取出内容,或者用FormData上传
var
api
=
"
https://xx.xx/test_request
"
;
var
onreadystatechange
=
function
(
title
){
return
function
(){
if
(
xhr
.
readyState
==
4
){
if
(
xhr
.
status
==
200
){
This
.
reclog
(
title
+
"
上传成功
"
,
2
);
}
else
{
This
.
reclog
(
title
+
"
没有完成上传,演示上传地址无需关注上传结果,只要浏览器控制台内Network面板内看到的请求数据结构是预期的就ok了。
"
,
"
#d8c1a0
"
);
console
.
error
(
title
+
"
上传失败
"
,
xhr
.
status
,
xhr
.
responseText
);
};
};
};
};
This
.
reclog
(
"
开始上传到
"
+
api
+
"
,请求稍后...
"
,
"
#f60
"
);
/***方式一:将blob文件转成base64纯文本编码
,使用普通application/x-www-form-urlencoded表单上传
***/
/***方式一:将blob文件转成base64纯文本编码
***/
var
reader
=
new
FileReader
();
var
reader
=
new
FileReader
();
reader
.
onloadend
=
function
(){
reader
.
onloadend
=
function
(){
var
postData
=
""
;
var
postData
=
""
;
postData
+=
"
mime=
"
+
encodeURIComponent
(
blob
.
type
);
//告诉后端,这个录音是什么格式的,可能前后端都固定的mp3可以不用写
postData
+=
"
mime=
"
+
encodeURIComponent
(
blob
.
type
);
//告诉后端,这个录音是什么格式的,可能前后端都固定的mp3可以不用写
postData
+=
"
&upfile_b64=
"
+
encodeURIComponent
((
/.+;
\s
*base64
\s
*,
\s
*
(
.+
)
$/i
.
exec
(
reader
.
result
)
||
[])[
1
])
//录音文件内容,后端进行base64解码成二进制
postData
+=
"
&upfile_b64=
"
+
encodeURIComponent
((
/.+;
\s
*base64
\s
*,
\s
*
(
.+
)
$/i
.
exec
(
reader
.
result
)
||
[])[
1
])
//录音文件内容,后端进行base64解码成二进制
//...其他表单参数
// var xhr=new XMLHttpRequest();
// xhr.open("POST", api);
// xhr.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
// xhr.onreadystatechange=onreadystatechange("上传方式一【Base64】");
// xhr.send(postData);
//发送语音数据
//发送语音数据
if
(
This
.
websocket
.
readyState
==
1
)
{
// that.websock.readyState = 1 表示连接成功,可以立即发送信息
if
(
This
.
websocket
.
readyState
==
1
)
{
// that.websock.readyState = 1 表示连接成功,可以立即发送信息
This
.
websocketsend
(
`{"toUserId":"
${
This
.
carAllNumberString
}
","contentText":"
${
postData
}
","fromUserId":"
${
This
.
dialogTitle1
}
"}`
);
This
.
websocketsend
(
`{"toUserId":"
${
This
.
carAllNumberString
}
","contentText":"
${
postData
}
","fromUserId":"
${
This
.
dialogTitle1
}
"}`
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment