n20-common-lib 2.1.28 → 2.1.30

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": "n20-common-lib",
3
- "version": "2.1.28",
3
+ "version": "2.1.30",
4
4
  "private": false,
5
5
  "main": "src/index.js",
6
6
  "scripts": {
@@ -133,6 +133,12 @@ export default {
133
133
  value: {
134
134
  handler(val) {
135
135
  if (this.rangeAuto) {
136
+ if (val || val === '0') {
137
+ let nF = N.toString(val).split('.')[1] || ''
138
+ if (nF.length < this.fNum) {
139
+ return (this.valueStr = N.addThousands(N.subFixed(val, this.fNum)))
140
+ }
141
+ }
136
142
  this.valueStr = N.addThousands(val)
137
143
  } else {
138
144
  this.valueStr = N.addThousands(N.subFixed(val, this.fNum))
@@ -1,9 +1,9 @@
1
1
  <template>
2
2
  <div>
3
3
  <keep-alive v-if="dnsKey" :max="32">
4
- <router-view v-if="!$route.meta.noCache" ref="content-cache" :key="$route | keyF(updateK)" class="content-box" />
4
+ <router-view v-if="!$route.meta.noCache" ref="content-cache" :key="$route | keyF" class="content-box" />
5
5
  </keep-alive>
6
- <router-view v-if="!dnsKey || $route.meta.noCache" :key="updateK" class="content-box" />
6
+ <router-view v-if="!dnsKey || $route.meta.noCache" :key="$route | keyF" class="content-box" />
7
7
  </div>
8
8
  </template>
9
9
 
@@ -14,11 +14,9 @@ const routerBase = (process.env.BASE_URL + '/').replace(/\/\/$/, '/')
14
14
  export default {
15
15
  name: 'SubContent',
16
16
  filters: {
17
- keyF({ path, query = {} }, updateK) {
17
+ keyF({ path, query = {} }) {
18
18
  path = path.replace(/^\//, routerBase)
19
- let key = path + '^' + JSON.stringify({ ...query, _fromNo: undefined }) + '^' + window._tab_route_key[path]
20
-
21
- return key + updateK
19
+ return path + '^' + JSON.stringify({ ...query, _fromNo: undefined }) + '^' + window._tab_route_key[path]
22
20
  }
23
21
  },
24
22
  props: {
@@ -29,8 +27,7 @@ export default {
29
27
  },
30
28
  data() {
31
29
  return {
32
- dnsKey: this.isTest || (process.env.NODE_ENV === 'production' && process.env.VUE_APP_KEEP_ALIVE === 'true'),
33
- updateK: ''
30
+ dnsKey: this.isTest || (process.env.NODE_ENV === 'production' && process.env.VUE_APP_KEEP_ALIVE === 'true')
34
31
  }
35
32
  },
36
33
  beforeCreate() {
@@ -70,10 +67,7 @@ export default {
70
67
  }
71
68
  },
72
69
  updateActiveCache() {
73
- this.updateK = '_'
74
- this.$nextTick(() => {
75
- this.updateK = ''
76
- })
70
+ this.$forceUpdate()
77
71
  },
78
72
  removeCacheTimerFn() {
79
73
  this.removeCacheTimer = setInterval(() => {
@@ -20,14 +20,9 @@
20
20
  />
21
21
  <div ref="content-wrap" class="content-wrap">
22
22
  <keep-alive v-if="dnsKey" :max="32">
23
- <router-view
24
- v-if="!$route.meta.noCache"
25
- ref="content-cache"
26
- :key="$route | keyF(updateK)"
27
- class="content-box"
28
- />
23
+ <router-view v-if="!$route.meta.noCache" ref="content-cache" :key="$route | keyF" class="content-box" />
29
24
  </keep-alive>
30
- <router-view v-if="!dnsKey || $route.meta.noCache" :key="updateK" class="content-box" />
25
+ <router-view v-if="!dnsKey || $route.meta.noCache" :key="$route | keyF" class="content-box" />
31
26
  </div>
32
27
  </div>
33
28
  </template>
@@ -52,10 +47,8 @@ export default {
52
47
  tabsNav
53
48
  },
54
49
  filters: {
55
- keyF({ path, query = {} }, updateK) {
56
- let key = path + '^' + JSON.stringify({ ...query, _fromNo: undefined }) + '^' + window._tab_route_key[path]
57
-
58
- return key + updateK
50
+ keyF({ path, query = {} }) {
51
+ return path + '^' + JSON.stringify({ ...query, _fromNo: undefined }) + '^' + window._tab_route_key[path]
59
52
  }
60
53
  },
61
54
  props: {
@@ -91,7 +84,6 @@ export default {
91
84
 
92
85
  return {
93
86
  dnsKey: this.isTest || (process.env.NODE_ENV === 'production' && process.env.VUE_APP_KEEP_ALIVE === 'true'),
94
- updateK: '',
95
87
  headerH,
96
88
  tabsH,
97
89
  clientM,
@@ -393,16 +385,13 @@ export default {
393
385
  this.addRouterKey(tab.route, tab.query)
394
386
  if (this.activeNav === tab.uuid) {
395
387
  if (this.$route.matched[0]['path'] !== '*') {
396
- this.updateK = '_'
397
- this.$nextTick(() => {
398
- this.updateK = ''
399
- })
388
+ this.$forceUpdate()
400
389
  } else {
401
- // window.postMessage({
402
- // updateActiveCache: true,
403
- // targetName: '*',
404
- // originName: 'main'
405
- // })
390
+ window.postMessage({
391
+ updateActiveCache: true,
392
+ targetName: '*',
393
+ originName: 'main'
394
+ })
406
395
  this.CompatibleUpdateCache(tab.route) // 兼容旧的子模块清除缓存
407
396
  }
408
397
  }
@@ -20,14 +20,9 @@
20
20
  />
21
21
  <div ref="content-wrap" class="content-wrap">
22
22
  <keep-alive v-if="dnsKey" :max="32">
23
- <router-view
24
- v-if="!$route.meta.noCache"
25
- ref="content-cache"
26
- :key="$route | keyF(updateK)"
27
- class="content-box"
28
- />
23
+ <router-view v-if="!$route.meta.noCache" ref="content-cache" :key="$route | keyF" class="content-box" />
29
24
  </keep-alive>
30
- <router-view v-if="!dnsKey || $route.meta.noCache" :key="updateK" class="content-box" />
25
+ <router-view v-if="!dnsKey || $route.meta.noCache" :key="$route | keyF" class="content-box" />
31
26
  </div>
32
27
  </div>
33
28
  </template>
@@ -52,10 +47,8 @@ export default {
52
47
  tabsNav
53
48
  },
54
49
  filters: {
55
- keyF({ path, query = {} }, updateK) {
56
- let key = path + '^' + JSON.stringify({ ...query, _fromNo: undefined }) + '^' + window._tab_route_key[path]
57
-
58
- return key + updateK
50
+ keyF({ path, query = {} }) {
51
+ return path + '^' + JSON.stringify({ ...query, _fromNo: undefined }) + '^' + window._tab_route_key[path]
59
52
  }
60
53
  },
61
54
  props: {
@@ -91,7 +84,6 @@ export default {
91
84
 
92
85
  return {
93
86
  dnsKey: this.isTest || (process.env.NODE_ENV === 'production' && process.env.VUE_APP_KEEP_ALIVE === 'true'),
94
- updateK: '',
95
87
  headerH,
96
88
  tabsH,
97
89
  clientM,
@@ -403,16 +395,13 @@ export default {
403
395
  this.addRouterKey(tab.route, tab.query)
404
396
  if (this.activeNav === tab.uuid) {
405
397
  if (this.$route.matched[0]['path'] !== '*') {
406
- this.updateK = '_'
407
- this.$nextTick(() => {
408
- this.updateK = ''
409
- })
398
+ this.$forceUpdate()
410
399
  } else {
411
- // window.postMessage({
412
- // updateActiveCache: true,
413
- // targetName: '*',
414
- // originName: 'main'
415
- // })
400
+ window.postMessage({
401
+ updateActiveCache: true,
402
+ targetName: '*',
403
+ originName: 'main'
404
+ })
416
405
  this.CompatibleUpdateCache(tab.route) // 兼容旧的子模块清除缓存
417
406
  }
418
407
  }