vsyswin-ui 0.2.68 → 0.2.69
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/lib/vsyswin-ui.common.js +50295 -50682
- package/lib/vsyswin-ui.common.js.map +1 -1
- package/lib/vsyswin-ui.umd.js +50295 -50682
- package/lib/vsyswin-ui.umd.js.map +1 -1
- package/lib/vsyswin-ui.umd.min.js +183 -181
- package/lib/vsyswin-ui.umd.min.js.map +1 -1
- package/package.json +3 -2
- package/packages/index.js +1 -1
- package/packages/progress/index.js +69 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vsyswin-ui",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.69",
|
|
4
4
|
"main": "lib/vsyswin-ui.umd.min.js",
|
|
5
5
|
"private": false,
|
|
6
6
|
"description": "Vue2.x的应用组件库.",
|
|
@@ -22,6 +22,7 @@
|
|
|
22
22
|
"jquery": "^3.5.1",
|
|
23
23
|
"lodash": "^4.17.20",
|
|
24
24
|
"moment": "^2.29.1",
|
|
25
|
+
"nprogress": "^0.2.0",
|
|
25
26
|
"throttle-debounce": "^3.0.1",
|
|
26
27
|
"vue": "^2.6.12",
|
|
27
28
|
"vuedraggable": "^2.23.2"
|
|
@@ -44,4 +45,4 @@
|
|
|
44
45
|
"vue-template-compiler": "^2.6.11",
|
|
45
46
|
"xe-utils": "^3.0.4"
|
|
46
47
|
}
|
|
47
|
-
}
|
|
48
|
+
}
|
package/packages/index.js
CHANGED
|
@@ -14,7 +14,7 @@ import newSearchBar from './newSearchBar' // 高级筛选
|
|
|
14
14
|
import table from './table' // 表格组件
|
|
15
15
|
import dragSet from './drag-set'
|
|
16
16
|
import buttonEllipsis from './button-ellipsis'
|
|
17
|
-
|
|
17
|
+
export { default as Progress } from './progress';
|
|
18
18
|
const { buttonList, buttonItem } = buttonEllipsis
|
|
19
19
|
|
|
20
20
|
// 存储组件列表
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import NProgress from 'nprogress';
|
|
2
|
+
import 'nprogress/nprogress.css';
|
|
3
|
+
|
|
4
|
+
const ProgressBar = function (config = {}) {
|
|
5
|
+
this.options = Object.assign({
|
|
6
|
+
timeout: 8000,
|
|
7
|
+
exclude: ['option/getOptions', 'basicsWebData/getTypeOptions', 'menuName/queryMenuName']
|
|
8
|
+
}, config);
|
|
9
|
+
this.state = 'done';
|
|
10
|
+
this.isMerge = false;
|
|
11
|
+
this.count = 0;
|
|
12
|
+
this.timer = null;
|
|
13
|
+
const { timeout, exclude } = this.options;
|
|
14
|
+
this.start = function (opt = {}, url = '') {
|
|
15
|
+
if (opt.noProgress) {
|
|
16
|
+
return;
|
|
17
|
+
}
|
|
18
|
+
this.count++;
|
|
19
|
+
const f = exclude.find(it => url.includes(it));
|
|
20
|
+
if (!f) {
|
|
21
|
+
if (this.state !== 'start') {
|
|
22
|
+
this.state = 'start';
|
|
23
|
+
NProgress.start();
|
|
24
|
+
} else {
|
|
25
|
+
NProgress.inc();
|
|
26
|
+
}
|
|
27
|
+
clearTimeout(this.timer);
|
|
28
|
+
this.timer = setTimeout(() => {
|
|
29
|
+
NProgress.done();
|
|
30
|
+
}, timeout);
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
this.done = function (opt = {}) {
|
|
34
|
+
if (opt.noProgress) {
|
|
35
|
+
return;
|
|
36
|
+
}
|
|
37
|
+
if (!this.isMerge) {
|
|
38
|
+
if (opt.noEnd) {
|
|
39
|
+
this.count--;
|
|
40
|
+
if (this.state === 'start') {
|
|
41
|
+
NProgress.inc();
|
|
42
|
+
}
|
|
43
|
+
return;
|
|
44
|
+
}
|
|
45
|
+
setTimeout(() => {
|
|
46
|
+
this.count--;
|
|
47
|
+
if (this.count <= 0) {
|
|
48
|
+
this.state = 'done';
|
|
49
|
+
this.count = 0;
|
|
50
|
+
NProgress.done();
|
|
51
|
+
} else if (this.state === 'start') {
|
|
52
|
+
NProgress.inc();
|
|
53
|
+
}
|
|
54
|
+
}, 200);
|
|
55
|
+
}
|
|
56
|
+
};
|
|
57
|
+
this.MStart = function () {
|
|
58
|
+
this.isMerge = true;
|
|
59
|
+
this.state = 'start';
|
|
60
|
+
NProgress.start();
|
|
61
|
+
};
|
|
62
|
+
this.MDone = function () {
|
|
63
|
+
this.isMerge = false;
|
|
64
|
+
this.state = 'done';
|
|
65
|
+
NProgress.done();
|
|
66
|
+
};
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
export default ProgressBar
|