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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vue2-client",
3
- "version": "1.2.44",
3
+ "version": "1.2.45",
4
4
  "private": false,
5
5
  "scripts": {
6
6
  "serve": "vue-cli-service serve",
@@ -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: true
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
- iframeSrc: '../singlepage/page.html',
36
- iframe: null
37
- }
38
- },
39
- computed: {
40
- ...mapState('setting', ['animate']),
41
- ...mapState('account', ['login'])
42
- },
43
- mounted () {
44
- if (!this.login) {
45
- this.setLogin(JSON.parse(sessionStorage.getItem(process.env.VUE_APP_LOGIN_KEY)))
46
- }
47
- this.iframe = this.$refs.singlepage.contentWindow
48
- this.path = this.$route.path
49
- },
50
- methods: {
51
- ...mapMutations('account', ['setLogin']),
52
- load () {
53
- const appdata = {
54
- singleValues: this.$appdata.getSingleValues(),
55
- params: this.$appdata.getParams()
56
- }
57
- const data = {
58
- token: localStorage.getItem(ACCESS_TOKEN),
59
- login: this.login,
60
- appdata: appdata,
61
- page: this.singlePageUrl
62
- }
63
- console.log('发送参数', data)
64
- if (this.iframe) {
65
- this.iframe.postMessage(data, '*')
66
- }
67
- this.$emit('load', this.fullPath)
68
- }
69
- }
70
- }
71
- </script>
72
-
73
- <style lang="less">
74
- .single-page-iframe {
75
- width: 100%;
76
- height: calc(100vh - 117px);
77
- border: none;
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>