n20-common-lib 2.10.18 → 2.10.20
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.10.
|
|
3
|
+
"version": "2.10.20",
|
|
4
4
|
"private": false,
|
|
5
5
|
"scripts": {
|
|
6
6
|
"serve": "vue-cli-service serve",
|
|
@@ -67,7 +67,6 @@
|
|
|
67
67
|
"v-viewer": "1.6.4",
|
|
68
68
|
"vue-jsonp": "2.0.0",
|
|
69
69
|
"vuedraggable": "*",
|
|
70
|
-
"json-bigint": "^1.0.0",
|
|
71
70
|
"webpack-duplicate-relano-plugin": "^0.1.0",
|
|
72
71
|
"xe-utils": "^3.5.11"
|
|
73
72
|
},
|
|
@@ -1,42 +1,42 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div v-loading="loading" :element-loading-text="loadingText"></div>
|
|
3
|
-
</template>
|
|
4
|
-
|
|
5
|
-
<script>
|
|
6
|
-
import { $lc } from '../../utils/i18n/index'
|
|
7
|
-
export default {
|
|
8
|
-
name: 'ContentLoading',
|
|
9
|
-
data() {
|
|
10
|
-
return {
|
|
11
|
-
loading: true,
|
|
12
|
-
loadingText: $lc('加载中'),
|
|
13
|
-
timeout: 12000
|
|
14
|
-
}
|
|
15
|
-
},
|
|
16
|
-
mounted() {
|
|
17
|
-
this.setTimeOut()
|
|
18
|
-
},
|
|
19
|
-
activated() {
|
|
20
|
-
this.setTimeOut()
|
|
21
|
-
},
|
|
22
|
-
deactivated() {
|
|
23
|
-
this.clearTimeOut()
|
|
24
|
-
},
|
|
25
|
-
beforeDestroy() {
|
|
26
|
-
this.clearTimeOut()
|
|
27
|
-
},
|
|
28
|
-
methods: {
|
|
29
|
-
setTimeOut() {
|
|
30
|
-
clearTimeout(this.sT)
|
|
31
|
-
|
|
32
|
-
this.sT = setTimeout(() => {
|
|
33
|
-
this.loadingText = $lc('请求超时,请刷新尝试')
|
|
34
|
-
}, this.timeout)
|
|
35
|
-
},
|
|
36
|
-
clearTimeOut() {
|
|
37
|
-
this.loadingText = $lc('加载中')
|
|
38
|
-
clearTimeout(this.sT)
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
</script>
|
|
1
|
+
<template>
|
|
2
|
+
<div v-loading="loading" :element-loading-text="loadingText"></div>
|
|
3
|
+
</template>
|
|
4
|
+
|
|
5
|
+
<script>
|
|
6
|
+
import { $lc } from '../../utils/i18n/index'
|
|
7
|
+
export default {
|
|
8
|
+
name: 'ContentLoading',
|
|
9
|
+
data() {
|
|
10
|
+
return {
|
|
11
|
+
loading: true,
|
|
12
|
+
loadingText: $lc('加载中'),
|
|
13
|
+
timeout: 12000
|
|
14
|
+
}
|
|
15
|
+
},
|
|
16
|
+
mounted() {
|
|
17
|
+
this.setTimeOut()
|
|
18
|
+
},
|
|
19
|
+
activated() {
|
|
20
|
+
this.setTimeOut()
|
|
21
|
+
},
|
|
22
|
+
deactivated() {
|
|
23
|
+
this.clearTimeOut()
|
|
24
|
+
},
|
|
25
|
+
beforeDestroy() {
|
|
26
|
+
this.clearTimeOut()
|
|
27
|
+
},
|
|
28
|
+
methods: {
|
|
29
|
+
setTimeOut() {
|
|
30
|
+
clearTimeout(this.sT)
|
|
31
|
+
|
|
32
|
+
this.sT = setTimeout(() => {
|
|
33
|
+
this.loadingText = $lc('请求超时,请刷新尝试')
|
|
34
|
+
}, this.timeout)
|
|
35
|
+
},
|
|
36
|
+
clearTimeOut() {
|
|
37
|
+
this.loadingText = $lc('加载中')
|
|
38
|
+
clearTimeout(this.sT)
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
</script>
|
|
@@ -61,7 +61,7 @@
|
|
|
61
61
|
:field="item.prop"
|
|
62
62
|
>
|
|
63
63
|
<template slot-scope="scope">
|
|
64
|
-
<renderer :
|
|
64
|
+
<renderer :render-content="item.render" :scope="scope" />
|
|
65
65
|
</template>
|
|
66
66
|
</vxe-column>
|
|
67
67
|
<vxe-column
|
|
@@ -216,6 +216,11 @@ export default {
|
|
|
216
216
|
key: 0
|
|
217
217
|
}
|
|
218
218
|
},
|
|
219
|
+
computed: {
|
|
220
|
+
_columns() {
|
|
221
|
+
return this.calcColumnWidth(this.columns)
|
|
222
|
+
}
|
|
223
|
+
},
|
|
219
224
|
watch: {
|
|
220
225
|
columns() {
|
|
221
226
|
this.colsKey = this.colsKey + 1
|
|
@@ -231,11 +236,6 @@ export default {
|
|
|
231
236
|
}
|
|
232
237
|
}
|
|
233
238
|
},
|
|
234
|
-
computed: {
|
|
235
|
-
_columns() {
|
|
236
|
-
return this.calcColumnWidth(this.columns)
|
|
237
|
-
}
|
|
238
|
-
},
|
|
239
239
|
activated() {
|
|
240
240
|
this.$refs.vxeTable.loadData(this.data)
|
|
241
241
|
},
|
|
@@ -336,9 +336,7 @@ export default {
|
|
|
336
336
|
calcColumnWidth(columns) {
|
|
337
337
|
columns = XEUtils.clone(columns, true)
|
|
338
338
|
const wrapperEl = document.querySelector('div#app')
|
|
339
|
-
const notHasWidth = columns.filter(
|
|
340
|
-
(column) => !column.width && !column.minWidth && column.label !== $lc('操作')
|
|
341
|
-
)
|
|
339
|
+
const notHasWidth = columns.filter((column) => !column.width && !column.minWidth && column.label !== $lc('操作'))
|
|
342
340
|
if (!wrapperEl || notHasWidth.length > 0) {
|
|
343
341
|
return columns
|
|
344
342
|
}
|
|
@@ -349,7 +347,7 @@ export default {
|
|
|
349
347
|
if (column.static && column.label === $lc('操作') && !column.width && !column.minWidth) {
|
|
350
348
|
column.width = 80
|
|
351
349
|
}
|
|
352
|
-
if (column.type) {
|
|
350
|
+
if (column.type === 'checkbox') {
|
|
353
351
|
column.width = 80
|
|
354
352
|
}
|
|
355
353
|
const width = column.minWidth || column.width
|
|
@@ -358,6 +356,7 @@ export default {
|
|
|
358
356
|
column['minWidth'] = undefined
|
|
359
357
|
columnsWidth += column.width
|
|
360
358
|
})
|
|
359
|
+
|
|
361
360
|
if (columnsWidth >= windowWidth) return columns
|
|
362
361
|
return columns.map((column) => {
|
|
363
362
|
if (!column.type) {
|
|
@@ -365,9 +364,11 @@ export default {
|
|
|
365
364
|
column['width'] = windowWidth * rate
|
|
366
365
|
return column
|
|
367
366
|
}
|
|
367
|
+
|
|
368
368
|
return column
|
|
369
369
|
})
|
|
370
370
|
}
|
|
371
|
+
|
|
371
372
|
return calc(columns)
|
|
372
373
|
}
|
|
373
374
|
}
|
package/src/utils/axios.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import _axios from 'axios'
|
|
2
2
|
import ElementUI from 'element-ui'
|
|
3
|
-
import JSONBig from 'json-bigint'
|
|
4
3
|
import auth from './auth'
|
|
5
4
|
import { $lc } from './i18n/index'
|
|
6
5
|
const _Loading = ElementUI.Loading
|
|
@@ -84,19 +83,7 @@ const config = {
|
|
|
84
83
|
timeout: 120000,
|
|
85
84
|
validateStatus(status) {
|
|
86
85
|
return status === 200
|
|
87
|
-
}
|
|
88
|
-
// 处理big数据
|
|
89
|
-
transformResponse: [
|
|
90
|
-
function (data) {
|
|
91
|
-
if (data instanceof Blob) {
|
|
92
|
-
return data
|
|
93
|
-
} else {
|
|
94
|
-
const json = JSONBig({ storeAsString: true })
|
|
95
|
-
const res = json.parse(data)
|
|
96
|
-
return res
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
]
|
|
86
|
+
}
|
|
100
87
|
}
|
|
101
88
|
const axios = _axios.create(config)
|
|
102
89
|
|