widget.qw 1.0.80 → 1.0.82
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/.env.development +9 -9
- package/.env.production +8 -8
- package/README.md +75 -75
- package/build/style.css +471 -471
- package/build/widget.qw.es.js +56 -56
- package/build/widget.qw.umd.js +56 -56
- package/index.html +17 -17
- package/package.json +47 -47
- package/src/App.vue +26 -26
- package/src/api/index.js +165 -165
- package/src/components/AuditBar.vue +396 -396
- package/src/components/BillCard.vue +164 -164
- package/src/components/CascaderPicker.vue +132 -132
- package/src/components/CascaderPop.vue +371 -371
- package/src/components/CheckGroup.vue +113 -113
- package/src/components/DatetimePicker/DatetimePop.vue +342 -342
- package/src/components/DatetimePicker/index.vue +124 -124
- package/src/components/DayDropdown.vue +56 -56
- package/src/components/FilePicker.vue +169 -169
- package/src/components/Input.vue +80 -80
- package/src/components/MonthDropdown.vue +51 -51
- package/src/components/MultiPicker.vue +123 -123
- package/src/components/ObjsEditor.vue +334 -334
- package/src/components/SecretNotify.js +5 -5
- package/src/components/Sheet.vue +92 -92
- package/src/components/SingleApiPicker.vue +108 -108
- package/src/components/SinglePicker.vue +102 -102
- package/src/components/SingleUserSelector.vue +425 -425
- package/src/components/Switch.vue +64 -64
- package/src/components/TreePicker.vue +113 -113
- package/src/components/UserPicker.vue +106 -106
- package/src/components/UserProfile.vue +129 -129
- package/src/components/UsersPicker.vue +118 -118
- package/src/components/YearDropdown.vue +59 -59
- package/src/components/data_selector.vue +303 -303
- package/src/components/image_picker.vue +123 -123
- package/src/components/images_picker.vue +195 -195
- package/src/components/index.js +162 -162
- package/src/components/mult_list_selector.vue +155 -155
- package/src/components/subdepartment_selector.vue +481 -481
- package/src/components/user_selector.vue +639 -639
- package/src/components/widget/DataPop.vue +95 -95
- package/src/components/widget/TreePop.vue +88 -88
- package/src/components/widget/UserPop.vue +347 -347
- package/src/env.d.ts +8 -8
- package/src/main.js +117 -117
- package/src/router/index.ts +173 -173
- package/src/util/array_util.js +32 -32
- package/src/util/auth_util.js +72 -72
- package/src/util/bool_util.js +5 -5
- package/src/util/bus.js +1 -1
- package/src/util/cache_util.js +18 -18
- package/src/util/errer_code.js +6 -6
- package/src/util/eval_util.js +19 -19
- package/src/util/icon_util.js +36 -36
- package/src/util/image_util.js +27 -27
- package/src/util/index.js +57 -57
- package/src/util/num_util.js +70 -70
- package/src/util/obj_util.js +28 -28
- package/src/util/request.js +73 -73
- package/src/util/request_json.js +71 -71
- package/src/util/request_json_mute.js +65 -65
- package/src/util/request_upload.js +79 -79
- package/src/util/route_util.js +31 -31
- package/src/util/str_util.js +143 -143
- package/src/util/time_util.js +406 -406
- package/src/util/toast_util.js +24 -24
- package/src/util/tree_util.js +153 -153
- package/src/util/uuid_util.js +9 -9
- package/src/util/validate.js +182 -182
- package/src/util/vue_filter.js +223 -223
- package/src/views/auditbar/index.vue +78 -78
- package/src/views/billcard/index.vue +48 -48
- package/src/views/cascaderpop/index.vue +90 -90
- package/src/views/checkgroup/index.vue +35 -35
- package/src/views/dataSelector/index.vue +48 -48
- package/src/views/datetimepicker/index.vue +34 -34
- package/src/views/daydropdown/index.vue +31 -31
- package/src/views/filepicker/index.vue +32 -32
- package/src/views/imagepicker/index.vue +31 -31
- package/src/views/imagespicker/index.vue +37 -31
- package/src/views/input/index.vue +35 -35
- package/src/views/monthdropdown/index.vue +31 -31
- package/src/views/multListSelector/index.vue +61 -61
- package/src/views/multipicker/index.vue +36 -36
- package/src/views/objseditor/index.vue +277 -277
- package/src/views/productSelector/index.vue +35 -35
- package/src/views/projectpicker/index.vue +41 -41
- package/src/views/secretnotify/index.vue +27 -27
- package/src/views/sheet/index.vue +45 -45
- package/src/views/singlepicker/index.vue +35 -35
- package/src/views/subdepartmentSelector/index.vue +40 -40
- package/src/views/switch/index.vue +34 -34
- package/src/views/treepicker/index.vue +41 -41
- package/src/views/userSelector/index.vue +54 -54
- package/src/views/userSelectorNew/index.vue +45 -45
- package/src/views/userpicker/index.vue +43 -43
- package/src/views/userprofile/index.vue +30 -30
- package/src/views/userspicker/index.vue +43 -43
- package/src/views/yeardropdown/index.vue +32 -32
- package/src/vm/index.js +1 -1
- package/tsconfig.json +19 -19
- package/tsconfig.node.json +8 -8
- package/vite.config.ts +122 -122
package/src/util/validate.js
CHANGED
|
@@ -1,183 +1,183 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Created by PanJiaChen on 16/11/18.
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* @param {string} path
|
|
7
|
-
* @returns {Boolean}
|
|
8
|
-
*/
|
|
9
|
-
export function isExternal(path) {
|
|
10
|
-
return /^(https?:|mailto:|tel:)/.test(path);
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
* @param {string} str
|
|
15
|
-
* @returns {Boolean}
|
|
16
|
-
*/
|
|
17
|
-
export function validUsername(str) {
|
|
18
|
-
const valid_map = ["admin", "editor"];
|
|
19
|
-
return valid_map.indexOf(str.trim()) >= 0;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
/**
|
|
23
|
-
* @param {string} url
|
|
24
|
-
* @returns {Boolean}
|
|
25
|
-
*/
|
|
26
|
-
export function isURL(url) {
|
|
27
|
-
const reg = /^(https?|ftp):\/\/([a-zA-Z0-9.-]+(:[a-zA-Z0-9.&%$-]+)*@)*((25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]?)(\.(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])){3}|([a-zA-Z0-9-]+\.)*[a-zA-Z0-9-]+\.(com|edu|gov|int|mil|net|org|biz|arpa|info|name|pro|aero|coop|museum|[a-zA-Z]{2}))(:[0-9]+)*(\/($|[a-zA-Z0-9.,?'\\+&%$#=~_-]+))*$/;
|
|
28
|
-
return reg.test(url);
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
/**
|
|
32
|
-
* @param {string} str
|
|
33
|
-
* @returns {Boolean}
|
|
34
|
-
*/
|
|
35
|
-
export function validLowerCase(str) {
|
|
36
|
-
const reg = /^[a-z]+$/;
|
|
37
|
-
return reg.test(str);
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
/**
|
|
41
|
-
* @param {string} str
|
|
42
|
-
* @returns {Boolean}
|
|
43
|
-
*/
|
|
44
|
-
export function validUpperCase(str) {
|
|
45
|
-
const reg = /^[A-Z]+$/;
|
|
46
|
-
return reg.test(str);
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
/**
|
|
50
|
-
* @param {string} str
|
|
51
|
-
* @returns {Boolean}
|
|
52
|
-
*/
|
|
53
|
-
export function validateAlphabet(str) {
|
|
54
|
-
const reg = /^[A-Za-z]+$/;
|
|
55
|
-
return reg.test(str);
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
/**
|
|
59
|
-
* @param {string} email
|
|
60
|
-
* @returns {Boolean}
|
|
61
|
-
*/
|
|
62
|
-
export function validateEmail(email) {
|
|
63
|
-
if (!email)
|
|
64
|
-
return false
|
|
65
|
-
|
|
66
|
-
const reg = /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
|
|
67
|
-
return reg.test(email);
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
export function validatePhone(phone) {
|
|
71
|
-
if (!phone)
|
|
72
|
-
return false
|
|
73
|
-
|
|
74
|
-
if (!(/^1[3456789]\d{9}$/.test(phone))) {
|
|
75
|
-
return false;
|
|
76
|
-
}
|
|
77
|
-
return true;
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
/**
|
|
81
|
-
* 6位数字验证码
|
|
82
|
-
* @param {string} str
|
|
83
|
-
* @returns {Boolean}
|
|
84
|
-
*/
|
|
85
|
-
export function validateCode6(code) {
|
|
86
|
-
if (code.length != 6)
|
|
87
|
-
return false;
|
|
88
|
-
|
|
89
|
-
let reg = /^\d{6}$/;
|
|
90
|
-
return reg.test(code);
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
/**
|
|
94
|
-
* @param {string} str
|
|
95
|
-
* @returns {Boolean}
|
|
96
|
-
*/
|
|
97
|
-
export function isString(str) {
|
|
98
|
-
if (typeof str === "string" || str instanceof String) {
|
|
99
|
-
return true;
|
|
100
|
-
}
|
|
101
|
-
return false;
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
/**
|
|
105
|
-
* @param {Array} arg
|
|
106
|
-
* @returns {Boolean}
|
|
107
|
-
*/
|
|
108
|
-
export function isArray(arg) {
|
|
109
|
-
if (typeof Array.isArray === "undefined") {
|
|
110
|
-
return Object.prototype.toString.call(arg) === "[object Array]";
|
|
111
|
-
}
|
|
112
|
-
return Array.isArray(arg);
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
export function strIsEmpty(str) {
|
|
116
|
-
if (!str || typeof(str) == 'undefined' || str == '' || str == null)
|
|
117
|
-
return true
|
|
118
|
-
else
|
|
119
|
-
return false
|
|
120
|
-
};
|
|
121
|
-
|
|
122
|
-
export function objIsNull(obj) {
|
|
123
|
-
if (!obj || typeof(obj) == 'undefined' || obj == '' || obj == null)
|
|
124
|
-
return true
|
|
125
|
-
else
|
|
126
|
-
return false
|
|
127
|
-
};
|
|
128
|
-
|
|
129
|
-
export function numIsate(num) {
|
|
130
|
-
if (!num || typeof(num) == 'undefined' || num == null || num <= 0)
|
|
131
|
-
return false
|
|
132
|
-
else
|
|
133
|
-
return true
|
|
134
|
-
};
|
|
135
|
-
|
|
136
|
-
export function listIsEmpty(list) {
|
|
137
|
-
if (!list || typeof(list) == 'undefined' || list == null || list.length == 0)
|
|
138
|
-
return true
|
|
139
|
-
else
|
|
140
|
-
return false
|
|
141
|
-
};
|
|
142
|
-
|
|
143
|
-
export function boolIsTrue(flag) {
|
|
144
|
-
if (!flag || typeof(flag) == 'undefined' || flag == null)
|
|
145
|
-
return false
|
|
146
|
-
else
|
|
147
|
-
return true
|
|
148
|
-
};
|
|
149
|
-
|
|
150
|
-
/**
|
|
151
|
-
* 颜色
|
|
152
|
-
* 例如:
|
|
153
|
-
* 6位颜色值:#ffffff
|
|
154
|
-
* 3位颜色值:#aaa
|
|
155
|
-
* @param {string} str
|
|
156
|
-
* @returns {Boolean}
|
|
157
|
-
*/
|
|
158
|
-
export function validColor(color) {
|
|
159
|
-
if (!color)
|
|
160
|
-
return false;
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
//3位或6位
|
|
164
|
-
// let reg=/^#([0-9a-fA-F]{6}|[0-9a-fA-F]{3})$/;
|
|
165
|
-
let reg = /^#([0-9a-fA-F]{6})$/;
|
|
166
|
-
return reg.test(color);
|
|
167
|
-
}
|
|
168
|
-
|
|
169
|
-
/**
|
|
170
|
-
* 验证是否是字母和数字组合
|
|
171
|
-
* @param {*} str
|
|
172
|
-
* @returns
|
|
173
|
-
*/
|
|
174
|
-
export function validateAlphabetNumber(str) {
|
|
175
|
-
// 判断字符串是否为数字和字母组合
|
|
176
|
-
var zg = /^[0-9a-zA-Z]*$/;
|
|
177
|
-
|
|
178
|
-
if (!zg.test(str)) {
|
|
179
|
-
return false;
|
|
180
|
-
} else {
|
|
181
|
-
return true;
|
|
182
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
* Created by PanJiaChen on 16/11/18.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* @param {string} path
|
|
7
|
+
* @returns {Boolean}
|
|
8
|
+
*/
|
|
9
|
+
export function isExternal(path) {
|
|
10
|
+
return /^(https?:|mailto:|tel:)/.test(path);
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* @param {string} str
|
|
15
|
+
* @returns {Boolean}
|
|
16
|
+
*/
|
|
17
|
+
export function validUsername(str) {
|
|
18
|
+
const valid_map = ["admin", "editor"];
|
|
19
|
+
return valid_map.indexOf(str.trim()) >= 0;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* @param {string} url
|
|
24
|
+
* @returns {Boolean}
|
|
25
|
+
*/
|
|
26
|
+
export function isURL(url) {
|
|
27
|
+
const reg = /^(https?|ftp):\/\/([a-zA-Z0-9.-]+(:[a-zA-Z0-9.&%$-]+)*@)*((25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]?)(\.(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])){3}|([a-zA-Z0-9-]+\.)*[a-zA-Z0-9-]+\.(com|edu|gov|int|mil|net|org|biz|arpa|info|name|pro|aero|coop|museum|[a-zA-Z]{2}))(:[0-9]+)*(\/($|[a-zA-Z0-9.,?'\\+&%$#=~_-]+))*$/;
|
|
28
|
+
return reg.test(url);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* @param {string} str
|
|
33
|
+
* @returns {Boolean}
|
|
34
|
+
*/
|
|
35
|
+
export function validLowerCase(str) {
|
|
36
|
+
const reg = /^[a-z]+$/;
|
|
37
|
+
return reg.test(str);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* @param {string} str
|
|
42
|
+
* @returns {Boolean}
|
|
43
|
+
*/
|
|
44
|
+
export function validUpperCase(str) {
|
|
45
|
+
const reg = /^[A-Z]+$/;
|
|
46
|
+
return reg.test(str);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* @param {string} str
|
|
51
|
+
* @returns {Boolean}
|
|
52
|
+
*/
|
|
53
|
+
export function validateAlphabet(str) {
|
|
54
|
+
const reg = /^[A-Za-z]+$/;
|
|
55
|
+
return reg.test(str);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* @param {string} email
|
|
60
|
+
* @returns {Boolean}
|
|
61
|
+
*/
|
|
62
|
+
export function validateEmail(email) {
|
|
63
|
+
if (!email)
|
|
64
|
+
return false
|
|
65
|
+
|
|
66
|
+
const reg = /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
|
|
67
|
+
return reg.test(email);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
export function validatePhone(phone) {
|
|
71
|
+
if (!phone)
|
|
72
|
+
return false
|
|
73
|
+
|
|
74
|
+
if (!(/^1[3456789]\d{9}$/.test(phone))) {
|
|
75
|
+
return false;
|
|
76
|
+
}
|
|
77
|
+
return true;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* 6位数字验证码
|
|
82
|
+
* @param {string} str
|
|
83
|
+
* @returns {Boolean}
|
|
84
|
+
*/
|
|
85
|
+
export function validateCode6(code) {
|
|
86
|
+
if (code.length != 6)
|
|
87
|
+
return false;
|
|
88
|
+
|
|
89
|
+
let reg = /^\d{6}$/;
|
|
90
|
+
return reg.test(code);
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
/**
|
|
94
|
+
* @param {string} str
|
|
95
|
+
* @returns {Boolean}
|
|
96
|
+
*/
|
|
97
|
+
export function isString(str) {
|
|
98
|
+
if (typeof str === "string" || str instanceof String) {
|
|
99
|
+
return true;
|
|
100
|
+
}
|
|
101
|
+
return false;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
/**
|
|
105
|
+
* @param {Array} arg
|
|
106
|
+
* @returns {Boolean}
|
|
107
|
+
*/
|
|
108
|
+
export function isArray(arg) {
|
|
109
|
+
if (typeof Array.isArray === "undefined") {
|
|
110
|
+
return Object.prototype.toString.call(arg) === "[object Array]";
|
|
111
|
+
}
|
|
112
|
+
return Array.isArray(arg);
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
export function strIsEmpty(str) {
|
|
116
|
+
if (!str || typeof(str) == 'undefined' || str == '' || str == null)
|
|
117
|
+
return true
|
|
118
|
+
else
|
|
119
|
+
return false
|
|
120
|
+
};
|
|
121
|
+
|
|
122
|
+
export function objIsNull(obj) {
|
|
123
|
+
if (!obj || typeof(obj) == 'undefined' || obj == '' || obj == null)
|
|
124
|
+
return true
|
|
125
|
+
else
|
|
126
|
+
return false
|
|
127
|
+
};
|
|
128
|
+
|
|
129
|
+
export function numIsate(num) {
|
|
130
|
+
if (!num || typeof(num) == 'undefined' || num == null || num <= 0)
|
|
131
|
+
return false
|
|
132
|
+
else
|
|
133
|
+
return true
|
|
134
|
+
};
|
|
135
|
+
|
|
136
|
+
export function listIsEmpty(list) {
|
|
137
|
+
if (!list || typeof(list) == 'undefined' || list == null || list.length == 0)
|
|
138
|
+
return true
|
|
139
|
+
else
|
|
140
|
+
return false
|
|
141
|
+
};
|
|
142
|
+
|
|
143
|
+
export function boolIsTrue(flag) {
|
|
144
|
+
if (!flag || typeof(flag) == 'undefined' || flag == null)
|
|
145
|
+
return false
|
|
146
|
+
else
|
|
147
|
+
return true
|
|
148
|
+
};
|
|
149
|
+
|
|
150
|
+
/**
|
|
151
|
+
* 颜色
|
|
152
|
+
* 例如:
|
|
153
|
+
* 6位颜色值:#ffffff
|
|
154
|
+
* 3位颜色值:#aaa
|
|
155
|
+
* @param {string} str
|
|
156
|
+
* @returns {Boolean}
|
|
157
|
+
*/
|
|
158
|
+
export function validColor(color) {
|
|
159
|
+
if (!color)
|
|
160
|
+
return false;
|
|
161
|
+
|
|
162
|
+
|
|
163
|
+
//3位或6位
|
|
164
|
+
// let reg=/^#([0-9a-fA-F]{6}|[0-9a-fA-F]{3})$/;
|
|
165
|
+
let reg = /^#([0-9a-fA-F]{6})$/;
|
|
166
|
+
return reg.test(color);
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
/**
|
|
170
|
+
* 验证是否是字母和数字组合
|
|
171
|
+
* @param {*} str
|
|
172
|
+
* @returns
|
|
173
|
+
*/
|
|
174
|
+
export function validateAlphabetNumber(str) {
|
|
175
|
+
// 判断字符串是否为数字和字母组合
|
|
176
|
+
var zg = /^[0-9a-zA-Z]*$/;
|
|
177
|
+
|
|
178
|
+
if (!zg.test(str)) {
|
|
179
|
+
return false;
|
|
180
|
+
} else {
|
|
181
|
+
return true;
|
|
182
|
+
}
|
|
183
183
|
}
|