n20-common-lib 2.4.35 → 2.4.37

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.4.34",
3
+ "version": "2.4.37",
4
4
  "private": false,
5
5
  "main": "src/index.js",
6
6
  "scripts": {
@@ -1,14 +1,14 @@
1
1
  .content-box {
2
2
  box-sizing: border-box;
3
- margin: 8px;
3
+ margin: 0 8px 8px 8px;
4
4
  padding: 8px;
5
- border-radius: 6px;
5
+ border-radius: 0 0 6px 6px;
6
6
  height: var(--client-height);
7
7
  background: $--color-white;
8
8
  overflow: auto;
9
9
 
10
10
  &.element-doc {
11
- margin: 8px;
11
+ margin: 0 8px 8px 8px;
12
12
  padding: 8px;
13
13
  height: var(--client-height);
14
14
  overflow: auto;
@@ -1,10 +1,13 @@
1
- $--item-margin: 8px;
1
+ $--item-margin: 4px;
2
2
  $--item-radius: 4px;
3
+ $--layout-margin-top: 0;
3
4
  $--item-hover-padding: 12px;
4
5
 
5
6
  .tabs-nav-wrap {
6
7
  &.el-tabs--card > .el-tabs__header {
7
8
  border-bottom: none;
9
+ height: $--tabsnav-height;
10
+ margin-bottom: 0;
8
11
  }
9
12
  &.el-tabs--card > .el-tabs__header .el-tabs__item {
10
13
  transition: color 0.3s cubic-bezier(0.645, 0.045, 0.355, 1), padding 0.3s cubic-bezier(0.645, 0.045, 0.355, 1),
@@ -12,16 +15,16 @@ $--item-hover-padding: 12px;
12
15
  }
13
16
  .el-tabs__nav {
14
17
  border: none !important;
15
- padding-top: $--layou-margin;
18
+ padding-top: $--layout-margin-top;
16
19
  }
17
20
  .el-tabs__item {
18
- height: $--tabsnav-height - 2 * $--layou-margin;
19
- line-height: $--tabsnav-height - 2 * $--layou-margin;
21
+ height: $--tabsnav-height;
22
+ line-height: $--tabsnav-height;
20
23
  padding-left: $--item-hover-padding !important;
21
24
  padding-right: $--item-hover-padding !important;
22
25
  margin-right: $--item-margin;
23
- border-radius: $--item-radius;
24
- background: $--color-white;
26
+ border-radius: $--item-radius $--item-radius 0 0;
27
+ background: $--button-default-border-color;
25
28
  border: none !important;
26
29
  font-weight: $--font-weight-primary;
27
30
  &:first-child {
@@ -34,13 +37,16 @@ $--item-hover-padding: 12px;
34
37
  margin-right: $--layou-margin;
35
38
  }
36
39
 
37
- // &:hover {
38
- // background: #f4f5f8;
39
- // }
40
+ &:hover {
41
+ color: $--color-text-primary;
42
+ background: $--color-white;
43
+ font-weight: $--font-weight-bold;
44
+ }
40
45
 
41
46
  &.is-active {
42
- color: $--color-white;
43
- background: $--color-primary;
47
+ color: $--color-text-primary;
48
+ background: $--color-white;
49
+ font-weight: $--font-weight-bold;
44
50
  }
45
51
 
46
52
  &:focus.is-active.is-focus {
@@ -3,7 +3,7 @@ $--aside-width: 190px;
3
3
  $--aside-height: 40px;
4
4
  $--aside-collapse-width: 50px;
5
5
  $--header-height: 48px;
6
- $--tabsnav-height: 42px;
6
+ $--tabsnav-height: 28px;
7
7
  $--layou-margin: 8px;
8
8
 
9
9
  body {
@@ -86,7 +86,7 @@ body {
86
86
  .content-wrap {
87
87
  box-sizing: border-box;
88
88
  position: fixed !important;
89
- top: $--header-height + $--tabsnav-height - 6;
89
+ top: $--header-height + $--tabsnav-height;
90
90
  left: $--aside-width;
91
91
  right: 0;
92
92
  bottom: 0;
@@ -426,14 +426,19 @@ export default {
426
426
  })
427
427
  },
428
428
  logoutA() {
429
- axios.delete('/bems/prod_1.0/uas/api/authorization/logout').then(() => {
430
- if (this.afterLogout) {
431
- let After = this.afterLogout()
432
- After.then && After.then(auth.removeToken())
433
- } else {
429
+ axios
430
+ .delete('/bems/prod_1.0/uas/api/authorization/logout', {}, { noMsg: true })
431
+ .then(() => {
432
+ if (this.afterLogout) {
433
+ let After = this.afterLogout()
434
+ After.then && After.then(auth.removeToken())
435
+ } else {
436
+ auth.removeToken()
437
+ }
438
+ })
439
+ .catch(() => {
434
440
  auth.removeToken()
435
- }
436
- })
441
+ })
437
442
  },
438
443
  // 检查是否代理中
439
444
  async getProxyAuthIing() {
@@ -570,14 +570,19 @@ export default {
570
570
  })
571
571
  },
572
572
  logoutA() {
573
- axios.delete('/bems/prod_1.0/uas/api/authorization/logout').then(() => {
574
- if (this.afterLogout) {
575
- let After = this.afterLogout()
576
- After.then && After.then(auth.removeToken())
577
- } else {
573
+ axios
574
+ .delete('/bems/prod_1.0/uas/api/authorization/logout', {}, { noMsg: true })
575
+ .then(() => {
576
+ if (this.afterLogout) {
577
+ let After = this.afterLogout()
578
+ After.then && After.then(auth.removeToken())
579
+ } else {
580
+ auth.removeToken()
581
+ }
582
+ })
583
+ .catch(() => {
578
584
  auth.removeToken()
579
- }
580
- })
585
+ })
581
586
  },
582
587
  // 检查是否代理中
583
588
  async getProxyAuthIing() {
@@ -92,8 +92,8 @@ export default {
92
92
  },
93
93
  data() {
94
94
  let headerH = 48
95
- let tabsH = 35
96
- let clientM = 8 + 1
95
+ let tabsH = 28
96
+ let clientM = 0
97
97
 
98
98
  return {
99
99
  dnsKey: this.isTest || (process.env.NODE_ENV === 'production' && process.env.VUE_APP_KEEP_ALIVE === 'true'),
@@ -219,15 +219,15 @@ export default {
219
219
  },
220
220
  pwd: '',
221
221
  rules: {
222
- username: [{ required: true, message: '请输入账号!', trigger: 'blur' }],
223
- password: [{ required: true, message: '请输入密码!', trigger: 'blur' }],
224
- code: [{ required: true, message: '请输入验证码!', trigger: 'blur' }],
225
- imageCode: [{ required: true, message: '请输入图形验证码!', trigger: 'blur' }],
222
+ username: [{ required: true, message: $lc('请输入账号!'), trigger: 'blur' }],
223
+ password: [{ required: true, message: $lc('请输入密码!'), trigger: 'blur' }],
224
+ code: [{ required: true, message: $lc('请输入验证码!'), trigger: 'blur' }],
225
+ imageCode: [{ required: true, message: $lc('请输入图形验证码!'), trigger: 'blur' }],
226
226
  phone: [
227
- { required: true, message: '请输入手机号!', trigger: 'blur' },
227
+ { required: true, message: $lc('请输入手机号!'), trigger: 'blur' },
228
228
  {
229
229
  pattern: /^1\d{10}$/,
230
- message: '请输入正确手机号!',
230
+ message: $lc('请输入正确手机号!'),
231
231
  trigger: 'blur'
232
232
  }
233
233
  ]
@@ -60,7 +60,7 @@
60
60
  import getJsonc from '../../assets/getJsonc'
61
61
  import realUrl from '../../assets/realUrl'
62
62
  import axios from '../../utils/axios'
63
-
63
+ import { $lc } from '../../utils/i18n/index'
64
64
  import loginForm from './form.vue'
65
65
  import retrievePw from './retrievePw.vue'
66
66
  export default {
@@ -170,9 +170,41 @@ export default {
170
170
  this.init()
171
171
  },
172
172
  methods: {
173
+ // 系统分辨率是否缩放
174
+ getScreenSetting() {
175
+ var ratio = 0
176
+ var screen = window.screen
177
+ var ua = navigator.userAgent.toLowerCase()
178
+ if (window.devicePixelRatio !== undefined) {
179
+ ratio = window.devicePixelRatio
180
+ console.log(ratio)
181
+ } else if (~ua.indexOf('msie')) {
182
+ if (screen.deviceXDPI && screen.logicalXDPI) {
183
+ //IE
184
+ ratio = screen.deviceXDPI / screen.logicalXDPI
185
+ }
186
+ } else if (window.outerWidth !== undefined && window.innerWidth !== undefined) {
187
+ ratio = window.outerWidth / window.innerWidth
188
+ }
189
+ if (ratio !== 1) {
190
+ if (ua.includes('mac os') && ratio !== 2) {
191
+ this.$notify.info({
192
+ title: $lc('提示'),
193
+ message: $lc('检测到当前屏幕分辨率不是100%,建议调整分辨率后刷新业务来确保呈现效果最佳。')
194
+ })
195
+ }
196
+ if (!ua.includes('mac os')) {
197
+ this.$notify.info({
198
+ title: $lc('提示'),
199
+ message: $lc('检测到当前屏幕分辨率不是100%,建议调整分辨率后刷新业务来确保呈现效果最佳。')
200
+ })
201
+ }
202
+ }
203
+ },
173
204
  async init() {
174
- const { _layoutData = {}, loginSetting } = await getJsonc('/server-config.jsonc')
205
+ const { _layoutData = {}, loginSetting, screenInspect } = await getJsonc('/server-config.jsonc')
175
206
  let _loginSetting = loginSetting || _layoutData.loginSetting
207
+ screenInspect && this.getScreenSetting()
176
208
  if (_loginSetting !== 'JSON') {
177
209
  let P_1 = axios.get(`/bems/1.0/sysSetting/list`, null, { loading: false, noMsg: true }).then(({ data }) => {
178
210
  this.pageData.LOGIN_MODE = data.find((d) => d.pmName === 'LOGIN_MODE')
@@ -131,7 +131,7 @@
131
131
  <script>
132
132
  import 'swiper/swiper.min.css'
133
133
  import Swiper from 'swiper'
134
-
134
+ import { $lc } from '../../utils/i18n/index'
135
135
  import getJsonc from '../../assets/getJsonc'
136
136
  import realUrl from '../../assets/realUrl'
137
137
  import axios from '../../utils/axios'
@@ -359,6 +359,7 @@ export default {
359
359
  // window.addEventListener('resize', this.setWrapSty)
360
360
 
361
361
  this.init()
362
+
362
363
  localStorage.setItem('pageInSystemNo', this.form.SYSTEM_LIST[0].NO)
363
364
  },
364
365
  beforeDestroy() {
@@ -392,12 +393,45 @@ export default {
392
393
  // this.wrapStyle = `.login-wrap{width:${W}px; height:${Math.floor(W / ratioO)}px; transform: scale(${winW / W});}`
393
394
  // }
394
395
  // },
396
+ // 系统分辨率是否缩放
397
+ getScreenSetting() {
398
+ var ratio = 0
399
+ var screen = window.screen
400
+ var ua = navigator.userAgent.toLowerCase()
401
+ if (window.devicePixelRatio !== undefined) {
402
+ ratio = window.devicePixelRatio
403
+ console.log(ratio)
404
+ } else if (~ua.indexOf('msie')) {
405
+ if (screen.deviceXDPI && screen.logicalXDPI) {
406
+ //IE
407
+ ratio = screen.deviceXDPI / screen.logicalXDPI
408
+ }
409
+ } else if (window.outerWidth !== undefined && window.innerWidth !== undefined) {
410
+ ratio = window.outerWidth / window.innerWidth
411
+ }
412
+ if (ratio !== 1) {
413
+ if (ua.includes('mac os') && ratio !== 2) {
414
+ this.$notify.info({
415
+ title: $lc('提示'),
416
+ message: $lc('检测到当前屏幕分辨率不是100%,建议调整分辨率后刷新业务来确保呈现效果最佳。')
417
+ })
418
+ }
419
+ if (!ua.includes('mac os')) {
420
+ this.$notify.info({
421
+ title: $lc('提示'),
422
+ message: $lc('检测到当前屏幕分辨率不是100%,建议调整分辨率后刷新业务来确保呈现效果最佳。')
423
+ })
424
+ }
425
+ }
426
+ },
427
+
395
428
  async init() {
396
- const { _layoutData = {}, loginSetting } = await getJsonc('/server-config.jsonc')
429
+ const { _layoutData = {}, loginSetting, screenInspect } = await getJsonc('/server-config.jsonc')
397
430
  let _loginSetting = loginSetting || _layoutData.loginSetting
398
431
  if (_loginSetting !== 'JSON') {
399
432
  await this.getSysSet()
400
433
  }
434
+ screenInspect && this.getScreenSetting()
401
435
  this.jsonData = _layoutData
402
436
 
403
437
  if (this.systemList.length <= 1) {
package/src/i18n.json CHANGED
@@ -1235,6 +1235,9 @@
1235
1235
  "锚点定位": {
1236
1236
  "en": "Anchor point positioning"
1237
1237
  },
1238
+ "检测到当前屏幕分辨率不是100%,建议调整分辨率后刷新业务来确保呈现效果最佳。": {
1239
+ "en": "Detected that the current screen resolution is not 100%, it is recommended to adjust the resolution after refreshing the business to ensure that the best effect is displayed."
1240
+ },
1238
1241
  "拖拽列表组件": {
1239
1242
  "en": "Drag and drop list components"
1240
1243
  },