vue2-client 1.2.41 → 1.2.44

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.
@@ -8,7 +8,7 @@
8
8
  :trigger="null">
9
9
  <div :class="['logo', theme]">
10
10
  <router-link to="/dashboard/workplace">
11
- <img src="@/assets/img/logo.png">
11
+ <img src="@vue2-client/assets/img/logo.png">
12
12
  <h1 style="font-weight: bold">{{ systemName }}</h1>
13
13
  </router-link>
14
14
  </div>
@@ -31,5 +31,7 @@ module.exports = {
31
31
  direction: 'left' // 动画方向,切换页面时动画的方向,参考 ./animate.config.js
32
32
  },
33
33
  footerLinks: [ // 页面底部链接,{link: '链接地址', name: '名称/显示文字', icon: '图标,支持 ant design vue 图标库'}
34
- ]
34
+ ],
35
+ // 兼容V2版本系统 true:启用, false:禁用
36
+ compatibleV2: true
35
37
  }
@@ -4,6 +4,7 @@
4
4
  <iframe
5
5
  ref="singlepage"
6
6
  :src="iframeSrc"
7
+ :name="this.fullPath"
7
8
  class="single-page-iframe"
8
9
  @load="load">
9
10
  </iframe>
@@ -23,6 +24,10 @@ export default {
23
24
  singlePageUrl: {
24
25
  type: String,
25
26
  default: ''
27
+ },
28
+ fullPath: {
29
+ type: String,
30
+ default: ''
26
31
  }
27
32
  },
28
33
  data () {
@@ -40,6 +45,7 @@ export default {
40
45
  this.setLogin(JSON.parse(sessionStorage.getItem(process.env.VUE_APP_LOGIN_KEY)))
41
46
  }
42
47
  this.iframe = this.$refs.singlepage.contentWindow
48
+ this.path = this.$route.path
43
49
  },
44
50
  methods: {
45
51
  ...mapMutations('account', ['setLogin']),
@@ -55,7 +61,10 @@ export default {
55
61
  page: this.singlePageUrl
56
62
  }
57
63
  console.log('发送参数', data)
58
- this.iframe?.postMessage(data, '*')
64
+ if (this.iframe) {
65
+ this.iframe.postMessage(data, '*')
66
+ }
67
+ this.$emit('load', this.fullPath)
59
68
  }
60
69
  }
61
70
  }
@@ -2,7 +2,7 @@
2
2
  <a-layout-header :class="[headerTheme, 'admin-header']">
3
3
  <div :class="['admin-header-wide', layout, pageWidth]">
4
4
  <router-link v-if="isMobile || layout === 'head'" to="/" :class="['logo', isMobile ? null : 'pc', headerTheme]">
5
- <img width="32" src="@/assets/img/logo.png" />
5
+ <img width="32" src="@vue2-client/assets/img/logo.png" />
6
6
  <h1 v-if="!isMobile">{{ systemName }}</h1>
7
7
  </router-link>
8
8
  <a-divider v-if="isMobile" type="vertical" />
@@ -1,27 +1,34 @@
1
1
  <template>
2
- <admin-layout>
3
- <contextmenu :itemList="menuItemList" :visible.sync="menuVisible" @select="onMenuSelect" />
4
- <tabs-head
5
- v-if="multiPage"
6
- :active="activePage"
7
- :page-list="pageList"
8
- @change="changePage"
9
- @close="remove"
10
- @refresh="refresh"
11
- @contextmenu="onContextmenu"
12
- />
13
- <div :class="['tabs-view-content', layout, pageWidth]" :style="`margin-top: ${multiPage ? -24 : 0}px`">
14
- <page-toggle-transition v-show="!$route.meta.singlePage" :disabled="animate.disabled" :animate="animate.name" :direction="animate.direction">
15
- <a-keep-alive :exclude-keys="excludeKeys" v-if="multiPage && cachePage" v-model="clearCaches">
16
- <router-view v-if="!refreshing" ref="tabContent" :key="$route.path" />
17
- </a-keep-alive>
18
- <router-view ref="tabContent" v-else-if="!refreshing" />
19
- </page-toggle-transition>
20
- <template v-for="page in single">
21
- <single-page-view v-show="page.meta.singlePage === $route.meta.singlePage" :single-page-url="page.meta.singlePage" :key="page.meta.singlePage" />
22
- </template>
23
- </div>
24
- </admin-layout>
2
+ <div id="TabsView">
3
+ <admin-layout>
4
+ <contextmenu :itemList="menuItemList" :visible.sync="menuVisible" @select="onMenuSelect" />
5
+ <tabs-head
6
+ v-if="multiPage"
7
+ :active="activePage"
8
+ :page-list="pageList"
9
+ @change="changePage"
10
+ @close="remove"
11
+ @refresh="refresh"
12
+ @contextmenu="onContextmenu"
13
+ />
14
+ <div :class="['tabs-view-content', layout, pageWidth]" :style="`margin-top: ${multiPage ? -24 : 0}px`">
15
+ <page-toggle-transition v-show="!$route.meta.singlePage" :disabled="animate.disabled" :animate="animate.name" :direction="animate.direction">
16
+ <a-keep-alive :exclude-keys="excludeKeys" v-if="multiPage && cachePage" v-model="clearCaches">
17
+ <router-view v-if="!refreshing" ref="tabContent" :key="$route.path" />
18
+ </a-keep-alive>
19
+ <router-view ref="tabContent" v-else-if="!refreshing" />
20
+ </page-toggle-transition>
21
+ <template v-for="page in single">
22
+ <single-page-view
23
+ v-show="page.meta.singlePage === $route.meta.singlePage"
24
+ :single-page-url="page.meta.singlePage"
25
+ :full-path="page.fullPath"
26
+ :key="page.meta.singlePage"
27
+ @load="onSinglePageLoad" />
28
+ </template>
29
+ </div>
30
+ </admin-layout>
31
+ </div>
25
32
  </template>
26
33
 
27
34
  <script>
@@ -144,6 +151,12 @@ export default {
144
151
  refresh (key, page) {
145
152
  page = page || this.pageList.find(item => item.path === key)
146
153
  page.loading = true
154
+ // 单页面刷新
155
+ const singlePage = this.allSinglePages.find(item => item.fullPath === key)
156
+ if (singlePage) {
157
+ window.frames[singlePage.fullPath].location.reload()
158
+ return
159
+ }
147
160
  this.clearCache(page)
148
161
  if (key === this.activePage) {
149
162
  // eslint-disable-next-line no-return-assign
@@ -154,6 +167,10 @@ export default {
154
167
  setTimeout(() => page.loading = false, 500)
155
168
  }
156
169
  },
170
+ onSinglePageLoad (fullPath) {
171
+ const page = this.pageList.find(item => item.fullPath === fullPath)
172
+ page.loading = false
173
+ },
157
174
  onContextmenu (pageKey, e) {
158
175
  if (pageKey) {
159
176
  e.preventDefault()
@@ -336,24 +353,23 @@ export default {
336
353
  }
337
354
  </script>
338
355
 
339
- <style scoped lang="less">
340
- .tabs-view{
341
- margin: -16px auto 8px;
342
- &.head.fixed{
343
- max-width: 1400px;
356
+ <style lang="less">
357
+ #TabsView {
358
+ .tabs-view {
359
+ margin: -16px auto 8px;
360
+ &.head.fixed {
361
+ max-width: 1400px;
362
+ }
344
363
  }
345
- }
346
- .tabs-view-content{
347
- position: relative;
348
- &.head.fixed{
349
- width: 1400px;
350
- margin: 0 auto;
364
+ .tabs-view-content {
365
+ position: relative;
366
+ &.head.fixed {
367
+ width: 1400px;
368
+ margin: 0 auto;
369
+ }
370
+ .ant-card:only-of-type {
371
+ min-height: calc(100vh - 64px - 56px - 16px);
372
+ }
351
373
  }
352
374
  }
353
375
  </style>
354
-
355
- <style scoped>
356
- .tabs-view-content >>> .ant-card:only-of-type {
357
- min-height: calc(100vh - 64px - 56px - 16px);
358
- }
359
- </style>
@@ -1,25 +1,21 @@
1
- <template>
2
- <exception-page :home-route="homePage" :style="`min-height: ${minHeight}`" type="403" />
3
- </template>
4
-
5
- <script>
6
- import ExceptionPage from '@vue2-client/components/exception/ExceptionPage'
7
- import { mapState } from 'vuex'
8
- const { homePage } = require('@vue2-client/config')
9
- export default {
10
- name: 'Exp403',
11
- components: { ExceptionPage },
12
- computed: {
13
- homePage () {
14
- return homePage
15
- },
16
- ...mapState('setting', ['pageMinHeight']),
17
- minHeight () {
18
- return this.pageMinHeight ? this.pageMinHeight + 'px' : '100vh'
19
- }
20
- }
21
- }
22
- </script>
23
-
24
- <style scoped lang="less">
25
- </style>
1
+ <template>
2
+ <exception-page :home-route="homePage" :style="`min-height: ${minHeight}`" type="403" />
3
+ </template>
4
+
5
+ <script>
6
+ import ExceptionPage from '@vue2-client/components/exception/ExceptionPage'
7
+ import { mapState } from 'vuex'
8
+ export default {
9
+ name: 'Exp403',
10
+ components: { ExceptionPage },
11
+ computed: {
12
+ ...mapState('setting', ['pageMinHeight', 'homePage']),
13
+ minHeight () {
14
+ return this.pageMinHeight ? this.pageMinHeight + 'px' : '100vh'
15
+ }
16
+ }
17
+ }
18
+ </script>
19
+
20
+ <style scoped lang="less">
21
+ </style>
@@ -1,25 +1,21 @@
1
- <template>
2
- <exception-page :home-route="homePage" :style="`min-height: ${minHeight}`" type="404" />
3
- </template>
4
-
5
- <script>
6
- import ExceptionPage from '@vue2-client/components/exception/ExceptionPage'
7
- import { mapState } from 'vuex'
8
- const { homePage } = require('@vue2-client/config')
9
- export default {
10
- name: 'Exp404',
11
- components: { ExceptionPage },
12
- computed: {
13
- homePage () {
14
- return homePage
15
- },
16
- ...mapState('setting', ['pageMinHeight']),
17
- minHeight () {
18
- return this.pageMinHeight ? this.pageMinHeight + 'px' : '100vh'
19
- }
20
- }
21
- }
22
- </script>
23
-
24
- <style scoped lang="less">
25
- </style>
1
+ <template>
2
+ <exception-page :home-route="homePage" :style="`min-height: ${minHeight}`" type="404" />
3
+ </template>
4
+
5
+ <script>
6
+ import ExceptionPage from '@vue2-client/components/exception/ExceptionPage'
7
+ import { mapState } from 'vuex'
8
+ export default {
9
+ name: 'Exp404',
10
+ components: { ExceptionPage },
11
+ computed: {
12
+ ...mapState('setting', ['pageMinHeight', 'homePage']),
13
+ minHeight () {
14
+ return this.pageMinHeight ? this.pageMinHeight + 'px' : '100vh'
15
+ }
16
+ }
17
+ }
18
+ </script>
19
+
20
+ <style scoped lang="less">
21
+ </style>
@@ -1,25 +1,21 @@
1
- <template>
2
- <exception-page :home-route="homePage" :style="`min-height: ${minHeight}`" type="500" />
3
- </template>
4
-
5
- <script>
6
- import ExceptionPage from '@vue2-client/components/exception/ExceptionPage'
7
- import { mapState } from 'vuex'
8
- const { homePage } = require('@vue2-client/config')
9
- export default {
10
- name: 'Exp500',
11
- components: { ExceptionPage },
12
- computed: {
13
- homePage () {
14
- return homePage
15
- },
16
- ...mapState('setting', ['pageMinHeight']),
17
- minHeight () {
18
- return this.pageMinHeight ? this.pageMinHeight + 'px' : '100vh'
19
- }
20
- }
21
- }
22
- </script>
23
-
24
- <style scoped lang="less">
25
- </style>
1
+ <template>
2
+ <exception-page :home-route="homePage" :style="`min-height: ${minHeight}`" type="500" />
3
+ </template>
4
+
5
+ <script>
6
+ import ExceptionPage from '@vue2-client/components/exception/ExceptionPage'
7
+ import { mapState } from 'vuex'
8
+ export default {
9
+ name: 'Exp500',
10
+ components: { ExceptionPage },
11
+ computed: {
12
+ ...mapState('setting', ['pageMinHeight', 'homePage']),
13
+ minHeight () {
14
+ return this.pageMinHeight ? this.pageMinHeight + 'px' : '100vh'
15
+ }
16
+ }
17
+ }
18
+ </script>
19
+
20
+ <style scoped lang="less">
21
+ </style>