vue2-client 1.2.44 → 1.2.45
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -32,6 +32,8 @@ module.exports = {
|
|
|
32
32
|
},
|
|
33
33
|
footerLinks: [ // 页面底部链接,{link: '链接地址', name: '名称/显示文字', icon: '图标,支持 ant design vue 图标库'}
|
|
34
34
|
],
|
|
35
|
+
// 旧系统路径
|
|
36
|
+
iframeSrc: '../../singlepage/page.html',
|
|
35
37
|
// 兼容V2版本系统 true:启用, false:禁用
|
|
36
|
-
compatibleV2:
|
|
38
|
+
compatibleV2: false
|
|
37
39
|
}
|
|
@@ -1,79 +1,78 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<page-toggle-transition :disabled="animate.disabled" :animate="animate.name" :direction="animate.direction">
|
|
3
|
-
<template v-if="login">
|
|
4
|
-
<iframe
|
|
5
|
-
ref="singlepage"
|
|
6
|
-
:src="iframeSrc"
|
|
7
|
-
:name="this.fullPath"
|
|
8
|
-
class="single-page-iframe"
|
|
9
|
-
@load="load">
|
|
10
|
-
</iframe>
|
|
11
|
-
</template>
|
|
12
|
-
</page-toggle-transition>
|
|
13
|
-
</template>
|
|
14
|
-
|
|
15
|
-
<script>
|
|
16
|
-
import PageToggleTransition from '@vue2-client/components/transition/PageToggleTransition'
|
|
17
|
-
import { ACCESS_TOKEN } from '@vue2-client/store/mutation-types'
|
|
18
|
-
import { mapState, mapMutations } from 'vuex'
|
|
19
|
-
|
|
20
|
-
export default {
|
|
21
|
-
name: 'SinglePageView',
|
|
22
|
-
components: { PageToggleTransition },
|
|
23
|
-
props: {
|
|
24
|
-
singlePageUrl: {
|
|
25
|
-
type: String,
|
|
26
|
-
default: ''
|
|
27
|
-
},
|
|
28
|
-
fullPath: {
|
|
29
|
-
type: String,
|
|
30
|
-
default: ''
|
|
31
|
-
}
|
|
32
|
-
},
|
|
33
|
-
data () {
|
|
34
|
-
return {
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
...mapState('
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
this.
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
</style>
|
|
1
|
+
<template>
|
|
2
|
+
<page-toggle-transition :disabled="animate.disabled" :animate="animate.name" :direction="animate.direction">
|
|
3
|
+
<template v-if="login">
|
|
4
|
+
<iframe
|
|
5
|
+
ref="singlepage"
|
|
6
|
+
:src="iframeSrc"
|
|
7
|
+
:name="this.fullPath"
|
|
8
|
+
class="single-page-iframe"
|
|
9
|
+
@load="load">
|
|
10
|
+
</iframe>
|
|
11
|
+
</template>
|
|
12
|
+
</page-toggle-transition>
|
|
13
|
+
</template>
|
|
14
|
+
|
|
15
|
+
<script>
|
|
16
|
+
import PageToggleTransition from '@vue2-client/components/transition/PageToggleTransition'
|
|
17
|
+
import { ACCESS_TOKEN } from '@vue2-client/store/mutation-types'
|
|
18
|
+
import { mapState, mapMutations } from 'vuex'
|
|
19
|
+
|
|
20
|
+
export default {
|
|
21
|
+
name: 'SinglePageView',
|
|
22
|
+
components: { PageToggleTransition },
|
|
23
|
+
props: {
|
|
24
|
+
singlePageUrl: {
|
|
25
|
+
type: String,
|
|
26
|
+
default: ''
|
|
27
|
+
},
|
|
28
|
+
fullPath: {
|
|
29
|
+
type: String,
|
|
30
|
+
default: ''
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
data () {
|
|
34
|
+
return {
|
|
35
|
+
iframe: null
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
computed: {
|
|
39
|
+
...mapState('setting', ['animate', 'iframeSrc']),
|
|
40
|
+
...mapState('account', ['login'])
|
|
41
|
+
},
|
|
42
|
+
mounted () {
|
|
43
|
+
if (!this.login) {
|
|
44
|
+
this.setLogin(JSON.parse(sessionStorage.getItem(process.env.VUE_APP_LOGIN_KEY)))
|
|
45
|
+
}
|
|
46
|
+
this.iframe = this.$refs.singlepage.contentWindow
|
|
47
|
+
this.path = this.$route.path
|
|
48
|
+
},
|
|
49
|
+
methods: {
|
|
50
|
+
...mapMutations('account', ['setLogin']),
|
|
51
|
+
load () {
|
|
52
|
+
const appdata = {
|
|
53
|
+
singleValues: this.$appdata.getSingleValues(),
|
|
54
|
+
params: this.$appdata.getParams()
|
|
55
|
+
}
|
|
56
|
+
const data = {
|
|
57
|
+
token: localStorage.getItem(ACCESS_TOKEN),
|
|
58
|
+
login: this.login,
|
|
59
|
+
appdata: appdata,
|
|
60
|
+
page: this.singlePageUrl
|
|
61
|
+
}
|
|
62
|
+
console.log('发送参数', data)
|
|
63
|
+
if (this.iframe) {
|
|
64
|
+
this.iframe.postMessage(data, '*')
|
|
65
|
+
}
|
|
66
|
+
this.$emit('load', this.fullPath)
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
</script>
|
|
71
|
+
|
|
72
|
+
<style lang="less">
|
|
73
|
+
.single-page-iframe {
|
|
74
|
+
width: 100%;
|
|
75
|
+
height: calc(100vh - 117px);
|
|
76
|
+
border: none;
|
|
77
|
+
}
|
|
78
|
+
</style>
|