eoss-ui 0.4.94 → 0.4.95
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/button-group.js +32 -25
- package/lib/button.js +32 -25
- package/lib/checkbox-group.js +32 -25
- package/lib/data-table-form.js +32 -25
- package/lib/data-table.js +32 -25
- package/lib/date-picker.js +32 -25
- package/lib/dialog.js +32 -25
- package/lib/eoss-ui.common.js +92 -98
- package/lib/flow-group.js +32 -25
- package/lib/flow-list.js +32 -25
- package/lib/flow.js +32 -25
- package/lib/form.js +32 -25
- package/lib/handle-user.js +32 -25
- package/lib/handler.js +32 -25
- package/lib/index.js +1 -1
- package/lib/input-number.js +32 -25
- package/lib/input.js +32 -25
- package/lib/login.js +32 -25
- package/lib/main.js +86 -92
- package/lib/nav.js +32 -25
- package/lib/page.js +32 -25
- package/lib/player.js +32 -25
- package/lib/qr-code.js +32 -25
- package/lib/radio-group.js +32 -25
- package/lib/retrial-auth.js +32 -25
- package/lib/select-ganged.js +32 -25
- package/lib/select.js +32 -25
- package/lib/selector-panel.js +32 -25
- package/lib/selector.js +32 -25
- package/lib/sizer.js +32 -25
- package/lib/steps.js +32 -25
- package/lib/switch.js +32 -25
- package/lib/table-form.js +32 -25
- package/lib/tabs.js +32 -25
- package/lib/tips.js +32 -25
- package/lib/tree-group.js +32 -25
- package/lib/tree.js +32 -25
- package/lib/upload.js +32 -25
- package/lib/utils/util.js +32 -25
- package/lib/wujie.js +32 -25
- package/lib/wxlogin.js +32 -25
- package/package.json +1 -1
- package/packages/main/src/main.vue +36 -39
- package/src/index.js +1 -1
- package/src/utils/util.js +64 -57
|
@@ -666,20 +666,6 @@ export default {
|
|
|
666
666
|
Object.prototype.hasOwnProperty.call(query, 'serverId') &&
|
|
667
667
|
Object.prototype.hasOwnProperty.call(query, 'authType')
|
|
668
668
|
) {
|
|
669
|
-
let url = util.win.top.location.href;
|
|
670
|
-
if (query.openType) {
|
|
671
|
-
switch (query.openType) {
|
|
672
|
-
case 'self':
|
|
673
|
-
url = util.win.location.href;
|
|
674
|
-
break;
|
|
675
|
-
case 'blank':
|
|
676
|
-
url = util.win.open(url);
|
|
677
|
-
break;
|
|
678
|
-
case 'parent':
|
|
679
|
-
url = util.win.parent.location.href;
|
|
680
|
-
break;
|
|
681
|
-
}
|
|
682
|
-
}
|
|
683
669
|
await util
|
|
684
670
|
.ajax({
|
|
685
671
|
method: 'post',
|
|
@@ -691,9 +677,8 @@ export default {
|
|
|
691
677
|
let { results } = res;
|
|
692
678
|
switch (results.statusCode) {
|
|
693
679
|
case 0:
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
type: storage,
|
|
680
|
+
util.setStorage({
|
|
681
|
+
type: this.storage,
|
|
697
682
|
key: {
|
|
698
683
|
ssId: results.ssId,
|
|
699
684
|
token: results.token,
|
|
@@ -701,41 +686,53 @@ export default {
|
|
|
701
686
|
deviceUnique: results.deviceUnique
|
|
702
687
|
}
|
|
703
688
|
});
|
|
704
|
-
this.getConfig();
|
|
705
|
-
if (this.socket) {
|
|
706
|
-
this.initWebSocket();
|
|
707
|
-
}
|
|
708
|
-
break;
|
|
709
|
-
case 1:
|
|
710
|
-
break;
|
|
711
|
-
case 2:
|
|
712
|
-
break;
|
|
713
|
-
case 3:
|
|
714
|
-
const href = results.authorizeUrl.replace(
|
|
715
|
-
'{redirectUri}',
|
|
716
|
-
encodeURIComponent(url)
|
|
717
|
-
);
|
|
718
689
|
if (query.openType) {
|
|
690
|
+
let url = util.win.top.location.href;
|
|
691
|
+
let newUrl = util.delUrlParam({
|
|
692
|
+
url: url,
|
|
693
|
+
key: ['serverId', 'authType', 'openType']
|
|
694
|
+
});
|
|
719
695
|
switch (query.openType) {
|
|
720
696
|
case 'self':
|
|
721
|
-
util.win.location.href =
|
|
697
|
+
util.win.location.href = newUrl;
|
|
722
698
|
break;
|
|
723
699
|
case 'blank':
|
|
724
|
-
util.win.open(
|
|
725
|
-
break;
|
|
726
|
-
case 'top':
|
|
727
|
-
util.win.top.location.href = href;
|
|
700
|
+
util.win.open(newUrl);
|
|
728
701
|
break;
|
|
729
702
|
case 'parent':
|
|
730
703
|
util.win.parent.location.href = href;
|
|
731
704
|
break;
|
|
705
|
+
default:
|
|
706
|
+
util.win.top.location.href = href;
|
|
732
707
|
}
|
|
733
708
|
} else {
|
|
734
|
-
|
|
709
|
+
this.getConfig();
|
|
710
|
+
if (this.socket) {
|
|
711
|
+
this.initWebSocket();
|
|
712
|
+
}
|
|
713
|
+
}
|
|
714
|
+
break;
|
|
715
|
+
case 1:
|
|
716
|
+
break;
|
|
717
|
+
case 2:
|
|
718
|
+
break;
|
|
719
|
+
case 3:
|
|
720
|
+
const href = results.authorizeUrl.replace(
|
|
721
|
+
'{redirectUri}',
|
|
722
|
+
encodeURIComponent(url)
|
|
723
|
+
);
|
|
724
|
+
switch (query.openType) {
|
|
725
|
+
case 'self':
|
|
726
|
+
util.win.location.href = href;
|
|
727
|
+
break;
|
|
728
|
+
case 'blank':
|
|
735
729
|
util.win.open(href);
|
|
736
|
-
|
|
730
|
+
break;
|
|
731
|
+
case 'parent':
|
|
732
|
+
util.win.parent.location.href = href;
|
|
733
|
+
break;
|
|
734
|
+
default:
|
|
737
735
|
util.win.top.location.href = href;
|
|
738
|
-
}
|
|
739
736
|
}
|
|
740
737
|
break;
|
|
741
738
|
case 4:
|
package/src/index.js
CHANGED
package/src/utils/util.js
CHANGED
|
@@ -448,7 +448,7 @@ const arrUnique = function (data, key) {
|
|
|
448
448
|
* @param {...number} numbers - 一组数字
|
|
449
449
|
* @return {number} 数组中数字的平均值
|
|
450
450
|
**/
|
|
451
|
-
const average = function(...numbers) {
|
|
451
|
+
const average = function (...numbers) {
|
|
452
452
|
// Ensure that all arguments are valid numbers
|
|
453
453
|
if (!numbers.every(Number.isFinite)) {
|
|
454
454
|
throw new Error('Invalid input. Please provide valid numbers.');
|
|
@@ -485,7 +485,7 @@ const browser = function () {
|
|
|
485
485
|
* @param {Array<string>} holidays - 假期日期字符串数组,格式为 "YYYY-MM-DD"
|
|
486
486
|
* @return {number} 工作日天数
|
|
487
487
|
**/
|
|
488
|
-
const calculateNetworkDays = function(start_date, end_date, holidays = []) {
|
|
488
|
+
const calculateNetworkDays = function (start_date, end_date, holidays = []) {
|
|
489
489
|
if (typeof start_date !== 'string' || typeof end_date !== 'string') {
|
|
490
490
|
throw new Error("Invalid input. Please provide valid date strings in the format 'YYYY-MM-DD'.");
|
|
491
491
|
}
|
|
@@ -533,7 +533,7 @@ const calculateNetworkDays = function(start_date, end_date, holidays = []) {
|
|
|
533
533
|
* @param {...string} strings - 多个文本字符串
|
|
534
534
|
* @return {string} 合并后的字符串
|
|
535
535
|
**/
|
|
536
|
-
const concatenate = function(separator, ...strings) {
|
|
536
|
+
const concatenate = function (separator, ...strings) {
|
|
537
537
|
if (typeof separator !== 'string' || !strings.every(str => typeof str === 'string')) {
|
|
538
538
|
throw new Error('Invalid input. Please provide a valid separator and valid strings.');
|
|
539
539
|
}
|
|
@@ -548,7 +548,7 @@ const concatenate = function(separator, ...strings) {
|
|
|
548
548
|
* @param {number} days - 要加上或减去的天数,正数表示加,负数表示减
|
|
549
549
|
* @return {string} 计算后的日期字符串
|
|
550
550
|
**/
|
|
551
|
-
const dateAddDays = function(start_date, days) {
|
|
551
|
+
const dateAddDays = function (start_date, days) {
|
|
552
552
|
if (typeof start_date !== 'string' || !Number.isInteger(days)) {
|
|
553
553
|
throw new Error("Invalid input. Please provide a valid date string in the format 'YYYY-MM-DD' and a valid integer for the number of days.");
|
|
554
554
|
}
|
|
@@ -578,7 +578,7 @@ const dateAddDays = function(start_date, days) {
|
|
|
578
578
|
* @param {String} [unit] - 计算的时间单位 ("y", "M", "d", "h", "m", "s")
|
|
579
579
|
* @return {Number} 两个日期之间的差距
|
|
580
580
|
**/
|
|
581
|
-
const dateDiff = function(start_date, end_date, unit) {
|
|
581
|
+
const dateDiff = function (start_date, end_date, unit) {
|
|
582
582
|
// Assuming date strings are in "YYYY-MM-DD" format
|
|
583
583
|
var startDate = new Date(start_date);
|
|
584
584
|
var endDate = new Date(end_date);
|
|
@@ -614,7 +614,7 @@ const dateDiff = function(start_date, end_date, unit) {
|
|
|
614
614
|
* @param {string} date - 日期字符串,格式为 "YYYY-MM-DD"
|
|
615
615
|
* @return {number} 当月的第几天
|
|
616
616
|
**/
|
|
617
|
-
const dayOfMonth = function(date) {
|
|
617
|
+
const dayOfMonth = function (date) {
|
|
618
618
|
if (typeof date !== 'string') {
|
|
619
619
|
throw new Error("Invalid input. Please provide a valid date string in the format 'YYYY-MM-DD'.");
|
|
620
620
|
}
|
|
@@ -651,22 +651,42 @@ const debounce = function (callback, delay) {
|
|
|
651
651
|
* @author huangbo
|
|
652
652
|
* @date 2022年5月7日
|
|
653
653
|
* @param {String} [url] - url地址
|
|
654
|
-
* @param {String} [key] - 参数名
|
|
654
|
+
* @param {String,Array} [key] - 参数名
|
|
655
655
|
**/
|
|
656
656
|
const delUrlParam = function ({ url, key }) {
|
|
657
657
|
let src = url ? decodeURI(url) : decodeURI(win.top.location.href);
|
|
658
658
|
let param = getParams({ url: src });
|
|
659
|
-
if (param &&
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
659
|
+
if (param && key.length) {
|
|
660
|
+
if (Array.isArray(key)) {
|
|
661
|
+
key.forEach(item => {
|
|
662
|
+
if (param.hasOwnProperty(item)) {
|
|
663
|
+
let reg = `${item}=${param[item]}`;
|
|
664
|
+
if (src.indexOf(reg + '&') > -1) {
|
|
665
|
+
src = src.replace(reg + '&', '');
|
|
666
|
+
} else if (src.indexOf('&' + reg) > -1) {
|
|
667
|
+
src = src.replace('&' + reg, '');
|
|
668
|
+
} else {
|
|
669
|
+
src = src.replace(reg, '');
|
|
670
|
+
}
|
|
671
|
+
}
|
|
672
|
+
if (Object.keys(param).length === key.length) {
|
|
673
|
+
src = src.replace('?', '');
|
|
674
|
+
}
|
|
675
|
+
});
|
|
668
676
|
} else {
|
|
669
|
-
|
|
677
|
+
if (param.hasOwnProperty(key)) {
|
|
678
|
+
let reg = `${key}=${param[key]}`;
|
|
679
|
+
if (Object.keys(param).length > 1) {
|
|
680
|
+
if (src.indexOf(reg + '&') > -1) {
|
|
681
|
+
src = src.replace(reg + '&', '');
|
|
682
|
+
}
|
|
683
|
+
if (src.indexOf('&' + reg) > -1) {
|
|
684
|
+
src = src.replace('&' + reg, '');
|
|
685
|
+
}
|
|
686
|
+
} else {
|
|
687
|
+
src = src.replace('?' + reg, '');
|
|
688
|
+
}
|
|
689
|
+
}
|
|
670
690
|
}
|
|
671
691
|
}
|
|
672
692
|
return src;
|
|
@@ -1069,7 +1089,7 @@ const getHue = function ($h, $i, $isLight) {
|
|
|
1069
1089
|
* @desc 返回当前日期
|
|
1070
1090
|
* @return {string} 当前日期字符串,格式为 "YYYY-MM-DD"
|
|
1071
1091
|
**/
|
|
1072
|
-
const getCurrentDate = function() {
|
|
1092
|
+
const getCurrentDate = function () {
|
|
1073
1093
|
const today = new Date();
|
|
1074
1094
|
|
|
1075
1095
|
const year = today.getFullYear();
|
|
@@ -1085,7 +1105,7 @@ const getCurrentDate = function() {
|
|
|
1085
1105
|
* @desc 返回当前日期和时间
|
|
1086
1106
|
* @return {string} 当前日期和时间字符串,格式为 "YYYY-MM-DD HH:mm:ss"
|
|
1087
1107
|
**/
|
|
1088
|
-
const getCurrentDateTime = function() {
|
|
1108
|
+
const getCurrentDateTime = function () {
|
|
1089
1109
|
const currentDateTime = new Date();
|
|
1090
1110
|
|
|
1091
1111
|
const year = currentDateTime.getFullYear();
|
|
@@ -1105,7 +1125,7 @@ const getCurrentDateTime = function() {
|
|
|
1105
1125
|
* @param {string} datetime - 日期时间字符串,格式为 "YYYY-MM-DD HH:mm:ss"
|
|
1106
1126
|
* @return {number} 给定日期或时间的小时部分
|
|
1107
1127
|
**/
|
|
1108
|
-
const getHour = function(datetime) {
|
|
1128
|
+
const getHour = function (datetime) {
|
|
1109
1129
|
if (typeof datetime !== 'string') {
|
|
1110
1130
|
throw new Error("Invalid input. Please provide a valid datetime string in the format 'YYYY-MM-DD HH:mm:ss'.");
|
|
1111
1131
|
}
|
|
@@ -1126,7 +1146,7 @@ const getHour = function(datetime) {
|
|
|
1126
1146
|
* @param {number} type - 可选参数,表示周的起始日,0 表示星期天,1 表示星期一,以此类推,默认为 0
|
|
1127
1147
|
* @return {number} 给定日期属于所在年的第几周
|
|
1128
1148
|
**/
|
|
1129
|
-
const getWeekNumber = function(date, type = 1) {
|
|
1149
|
+
const getWeekNumber = function (date, type = 1) {
|
|
1130
1150
|
if (typeof date !== 'string') {
|
|
1131
1151
|
throw new Error("Invalid input. Please provide a valid date string in the format 'YYYY-MM-DD'.");
|
|
1132
1152
|
}
|
|
@@ -1163,7 +1183,7 @@ const getWeekNumber = function(date, type = 1) {
|
|
|
1163
1183
|
* @param {string} text - 要计算字符个数的文本字符串
|
|
1164
1184
|
* @return {number} 文本字符串的字符个数
|
|
1165
1185
|
**/
|
|
1166
|
-
const getLength = function(text) {
|
|
1186
|
+
const getLength = function (text) {
|
|
1167
1187
|
if (typeof text !== 'string') {
|
|
1168
1188
|
throw new Error('Invalid input. Please provide a valid text string.');
|
|
1169
1189
|
}
|
|
@@ -1192,7 +1212,7 @@ const getLightness = function ($v, $i, $isLight) {
|
|
|
1192
1212
|
* @param {string} datetime - 日期时间字符串,格式为 "YYYY-MM-DD HH:mm:ss"
|
|
1193
1213
|
* @return {number} 给定日期或时间的分钟部分
|
|
1194
1214
|
**/
|
|
1195
|
-
const getMinute = function(datetime) {
|
|
1215
|
+
const getMinute = function (datetime) {
|
|
1196
1216
|
if (typeof datetime !== 'string') {
|
|
1197
1217
|
throw new Error("Invalid input. Please provide a valid datetime string in the format 'YYYY-MM-DD HH:mm:ss'.");
|
|
1198
1218
|
}
|
|
@@ -1212,7 +1232,7 @@ const getMinute = function(datetime) {
|
|
|
1212
1232
|
* @param {string} date - 日期字符串,格式为 "YYYY-MM-DD"
|
|
1213
1233
|
* @return {number} 给定日期的月份
|
|
1214
1234
|
**/
|
|
1215
|
-
const getMonth = function(date) {
|
|
1235
|
+
const getMonth = function (date) {
|
|
1216
1236
|
if (typeof date !== 'string') {
|
|
1217
1237
|
throw new Error("Invalid input. Please provide a valid date string in the format 'YYYY-MM-DD'.");
|
|
1218
1238
|
}
|
|
@@ -1432,7 +1452,7 @@ const getScript = function (url, callback) {
|
|
|
1432
1452
|
* @param {string} datetime - 日期时间字符串,格式为 "YYYY-MM-DD HH:mm:ss"
|
|
1433
1453
|
* @return {number} 给定日期或时间的秒钟部分
|
|
1434
1454
|
**/
|
|
1435
|
-
const getSecond = function(datetime) {
|
|
1455
|
+
const getSecond = function (datetime) {
|
|
1436
1456
|
if (typeof datetime !== 'string') {
|
|
1437
1457
|
throw new Error("Invalid input. Please provide a valid datetime string in the format 'YYYY-MM-DD HH:mm:ss'.");
|
|
1438
1458
|
}
|
|
@@ -1638,7 +1658,7 @@ const getValues = function (obj, flag) {
|
|
|
1638
1658
|
* @param {number} type - 可选参数,表示星期的起始日,0 表示星期天,1 表示星期一,以此类推,默认为 0
|
|
1639
1659
|
* @return {number} 给定日期是所在星期的第几天
|
|
1640
1660
|
**/
|
|
1641
|
-
const getWeekday = function(date, type = 0) {
|
|
1661
|
+
const getWeekday = function (date, type = 0) {
|
|
1642
1662
|
if (typeof date !== 'string') {
|
|
1643
1663
|
throw new Error("Invalid input. Please provide a valid date string in the format 'YYYY-MM-DD'.");
|
|
1644
1664
|
}
|
|
@@ -1863,17 +1883,17 @@ const isLogined = function ({
|
|
|
1863
1883
|
if (logined || cookie == true || cookie == 1) {
|
|
1864
1884
|
if (loginPage) {
|
|
1865
1885
|
sessionStorage.setItem('loginPage', loginPage);
|
|
1866
|
-
|
|
1867
|
-
|
|
1868
|
-
|
|
1869
|
-
|
|
1870
|
-
|
|
1871
|
-
|
|
1872
|
-
|
|
1873
|
-
|
|
1874
|
-
|
|
1875
|
-
}
|
|
1886
|
+
if (!startWith(loginPage, ['http', '/'], true)) {
|
|
1887
|
+
let pathname = win.top.location.pathname;
|
|
1888
|
+
if (pathname !== '/') {
|
|
1889
|
+
pathname = pathname.split('/');
|
|
1890
|
+
pathname.splice(pathname.length - 1);
|
|
1891
|
+
pathname = pathname.join('/');
|
|
1892
|
+
loginPage = pathname + '/' + loginPage.replace('./', '');
|
|
1893
|
+
} else {
|
|
1894
|
+
loginPage = pathname + loginPage.replace('./', '');
|
|
1876
1895
|
}
|
|
1896
|
+
}
|
|
1877
1897
|
}
|
|
1878
1898
|
next();
|
|
1879
1899
|
} else {
|
|
@@ -1882,20 +1902,6 @@ const isLogined = function ({
|
|
|
1882
1902
|
!token && Object.prototype.hasOwnProperty.call(to.query, 'serverId') &&
|
|
1883
1903
|
Object.prototype.hasOwnProperty.call(to.query, 'authType')
|
|
1884
1904
|
) {
|
|
1885
|
-
let url = win.top.location.href;
|
|
1886
|
-
if (to.query.openType) {
|
|
1887
|
-
switch (to.query.openType) {
|
|
1888
|
-
case 'self':
|
|
1889
|
-
url = win.location.href;
|
|
1890
|
-
break;
|
|
1891
|
-
case 'blank':
|
|
1892
|
-
url = win.open(url);
|
|
1893
|
-
break;
|
|
1894
|
-
case 'parent':
|
|
1895
|
-
url = win.parent.location.href;
|
|
1896
|
-
break;
|
|
1897
|
-
}
|
|
1898
|
-
}
|
|
1899
1905
|
ajax({
|
|
1900
1906
|
method: 'post',
|
|
1901
1907
|
url: authCenter,
|
|
@@ -1922,6 +1928,7 @@ const isLogined = function ({
|
|
|
1922
1928
|
case 2:
|
|
1923
1929
|
break;
|
|
1924
1930
|
case 3:
|
|
1931
|
+
let url = win.top.location.href;
|
|
1925
1932
|
const href = results.authorizeUrl.replace(
|
|
1926
1933
|
'{redirectUri}',
|
|
1927
1934
|
encodeURIComponent(url)
|
|
@@ -2154,7 +2161,7 @@ const loading = function ($loading, res) {
|
|
|
2154
2161
|
* @param {string} text - 要转换的文本字符串
|
|
2155
2162
|
* @return {string} 转换为小写字母后的字符串
|
|
2156
2163
|
**/
|
|
2157
|
-
const lowerCase = function(text) {
|
|
2164
|
+
const lowerCase = function (text) {
|
|
2158
2165
|
if (typeof text !== 'string') {
|
|
2159
2166
|
throw new Error('Invalid input. Please provide a valid text string.');
|
|
2160
2167
|
}
|
|
@@ -2322,7 +2329,7 @@ const rgbToHsv = function ($color) {
|
|
|
2322
2329
|
* @param {number} number - 人民币金额
|
|
2323
2330
|
* @return {string} 人民币大写形式
|
|
2324
2331
|
**/
|
|
2325
|
-
const rmbToCapital = function(number) {
|
|
2332
|
+
const rmbToCapital = function (number) {
|
|
2326
2333
|
if (!Number.isFinite(number)) {
|
|
2327
2334
|
throw new Error('Invalid input. Please provide a valid number for the RMB amount.');
|
|
2328
2335
|
}
|
|
@@ -2523,7 +2530,7 @@ const startWith = function (value, reg, or = true) {
|
|
|
2523
2530
|
* @param {number} num_chars - 要返回的字符数量
|
|
2524
2531
|
* @return {string} 从左侧提取的字符
|
|
2525
2532
|
**/
|
|
2526
|
-
const takeLeft = function(text, num_chars) {
|
|
2533
|
+
const takeLeft = function (text, num_chars) {
|
|
2527
2534
|
if (typeof text !== 'string' || !Number.isInteger(num_chars) || num_chars < 0) {
|
|
2528
2535
|
throw new Error('Invalid input. Please provide a valid text string and a non-negative integer for the number of characters.');
|
|
2529
2536
|
}
|
|
@@ -2539,7 +2546,7 @@ const takeLeft = function(text, num_chars) {
|
|
|
2539
2546
|
* @param {number} num_chars - 要返回的字符数量
|
|
2540
2547
|
* @return {string} 从右侧提取的字符
|
|
2541
2548
|
**/
|
|
2542
|
-
const takeRight = function(text, num_chars) {
|
|
2549
|
+
const takeRight = function (text, num_chars) {
|
|
2543
2550
|
if (typeof text !== 'string' || !Number.isInteger(num_chars) || num_chars < 0) {
|
|
2544
2551
|
throw new Error('Invalid input. Please provide a valid text string and a non-negative integer for the number of characters.');
|
|
2545
2552
|
}
|
|
@@ -2600,7 +2607,7 @@ const timeCycle = function (date) {
|
|
|
2600
2607
|
* @param {string} text - 要处理的文本字符串
|
|
2601
2608
|
* @return {string} 删除首尾空格后的字符串
|
|
2602
2609
|
**/
|
|
2603
|
-
const trimWhitespace = function(text) {
|
|
2610
|
+
const trimWhitespace = function (text) {
|
|
2604
2611
|
if (typeof text !== 'string') {
|
|
2605
2612
|
throw new Error('Invalid input. Please provide a valid text string.');
|
|
2606
2613
|
}
|
|
@@ -2691,7 +2698,7 @@ const updateTheme = function ($color, send) {
|
|
|
2691
2698
|
* @param {string} text - 要转换的文本字符串
|
|
2692
2699
|
* @return {string} 转换为大写字母后的字符串
|
|
2693
2700
|
**/
|
|
2694
|
-
const upperCase = function(text) {
|
|
2701
|
+
const upperCase = function (text) {
|
|
2695
2702
|
if (typeof text !== 'string') {
|
|
2696
2703
|
throw new Error('Invalid input. Please provide a valid text string.');
|
|
2697
2704
|
}
|
|
@@ -2755,7 +2762,7 @@ const uuid = function (len) {
|
|
|
2755
2762
|
**/
|
|
2756
2763
|
const watermark = function (option) {
|
|
2757
2764
|
// 默认设置
|
|
2758
|
-
let _width = parseInt(option.width || 480, 10)
|
|
2765
|
+
let _width = parseInt(option.width || 480, 10);
|
|
2759
2766
|
let _height = parseInt(option.width || 180, 10);
|
|
2760
2767
|
let _rows = Math.round(document.body.clientHeight / _height);
|
|
2761
2768
|
let _cols = Math.round(document.body.clientWidth / _width);
|