Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
liuzhen@situdata.com
/
yunxiao-admin-fe
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
9e8e52ec
authored
2020-11-20 16:14:24 +0800
by
zhen
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
修改目录层级
1 parent
08afbf02
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
145 additions
and
19 deletions
src/router/index.js
src/views/iframe.vue
vue.config.js
src/router/index.js
View file @
9e8e52e
...
...
@@ -48,6 +48,7 @@ export const constantRoutes = [
path
:
'/'
,
component
:
Layout
,
redirect
:
'/monitor'
,
alwaysShow
:
true
,
meta
:
{
title
:
'资源监控'
,
icon
:
'home'
...
...
@@ -71,14 +72,20 @@ export const constantRoutes = [
title
:
'远程订单详情'
},
props
:
route
=>
({
custInfo
:
route
.
query
})
},
}
]
},
{
path
:
'/product'
,
component
:
Layout
,
children
:
[
{
path
:
'product-infor-management'
,
name
:
'product-infor-management'
,
component
:
()
=>
import
(
'@/views/productInforManagement'
),
meta
:
{
title
:
'产品资料管理'
,
icon
:
'
report
'
icon
:
'
work
'
}
},
{
...
...
@@ -103,6 +110,11 @@ export const constantRoutes = [
}
}
]
},
{
path
:
'/iframe'
,
component
:
()
=>
import
(
'@/views/iframe'
),
hidden
:
true
}
]
/**
...
...
src/views/iframe.vue
0 → 100644
View file @
9e8e52e
<
template
>
<div>
<h2>
客户端
</h2>
<p>
<el-button
type=
"primary"
@
click=
"open"
>
呼叫
</el-button>
<el-button
type=
"primary"
@
click=
"cancelCall"
>
取消呼叫
</el-button>
</p>
<iframe
v-if=
"isStart"
ref=
"srtcIframe"
title=
"srtcIframe"
:src=
"target"
frameborder=
"2"
allow=
"microphone;camera;midi;encrypted-media;fullscreen;"
></iframe>
<p>
callback:
{{
message
}}
</p>
<p>
这还少恩位置
</p>
<p>
这还少恩位置
</p>
<p>
这还少恩位置
</p>
</div>
</
template
>
<
script
>
export
default
{
data
()
{
return
{
baseUrl
:
'https://localhost:8080'
,
isStart
:
false
,
target
:
''
,
strWindowFeatures
:
`
left=2400,
top=200
height=500,
width=700,
menubar=1,
toolbar=1,
fullscreen=1
`
,
message
:
''
,
windowRef
:
''
}
},
beforeMount
()
{
window
.
addEventListener
(
'message'
,
this
.
receiveMessage
,
false
)
},
methods
:
{
open
()
{
this
.
isStart
=
true
this
.
target
=
`
${
this
.
baseUrl
}
/#/srtc-iframe`
this
.
$nextTick
().
then
(()
=>
{
this
.
$refs
.
srtcIframe
.
onload
=
()
=>
{
this
.
sendMessage
()
}
})
},
sendMessage
()
{
this
.
$refs
.
srtcIframe
.
contentWindow
.
postMessage
(
{
type
:
'startCall'
,
data
:
{
appUserName
:
'123'
,
appUserPhone
:
'16621043587'
,
orderId
:
'123213'
,
webUserName
:
'lz'
}
},
this
.
baseUrl
)
},
cancelCall
()
{
this
.
$refs
.
srtcIframe
.
contentWindow
.
postMessage
(
{
type
:
'cancelCall'
},
this
.
baseUrl
)
},
receiveMessage
(
e
)
{
if
(
e
.
origin
!==
this
.
baseUrl
)
{
return
}
const
{
type
,
data
}
=
e
// switch (type) {
// case 'userJoin':
// this.popMessage(data)
// break
// case 'appHangUp':
// this.popMessage(data)
// break
// case 'webHangUp':
// this.popMessage(data)
// break
// }
this
.
popMessage
(
`
${
type
}
---
${
data
}
`
)
},
popMessage
(
data
)
{
this
.
$message
({
type
:
'error'
,
message
:
data
})
}
}
}
</
script
>
<
style
lang=
"scss"
scoped
>
iframe
{
width
:
500px
;
height
:
600px
;
position
:
fixed
;
top
:
0
;
right
:
0
;
}
</
style
>
vue.config.js
View file @
9e8e52e
...
...
@@ -26,23 +26,23 @@ module.exports = {
assetsDir
:
'static'
,
// 打包时不生成map文件,减少打包体积,加快打包速度
productionSourceMap
:
false
,
//
devServer: {
// https: true,
//
inline: true,
//
proxy: {
//
'/chery': {
//
target: process.env.VUE_APP_BASE_API
//
}
//
// '/': {
//
// bypass: devServerProxyBypass,
//
// secure: false,
//
// target: serverTarget,
//
// headers: {
//
// Host: new URL(serverTarget).host
//
// }
//
// }
//
}
//
},
devServer
:
{
https
:
true
//
inline: true,
//
proxy: {
//
'/chery': {
//
target: process.env.VUE_APP_BASE_API
//
}
//
// '/': {
//
// bypass: devServerProxyBypass,
//
// secure: false,
//
// target: serverTarget,
//
// headers: {
//
// Host: new URL(serverTarget).host
//
// }
//
// }
//
}
},
configureWebpack
:
{},
chainWebpack
:
config
=>
{
config
.
resolve
.
alias
...
...
Write
Preview
Styling with
Markdown
is supported
Attach a file
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 post a comment