当前位置:网站首页>Uview customer management JS
Uview customer management JS
2022-06-12 04:51:00 【MuQing】
var isChinese = function(temp) {
var re = /[^\u4E00-\u9FA5]/;
if (re.test(temp)) {
return false;
}
return true;
}
var isnumber= function(theObj) {
var reg = /^[0-9]+.?[0-9]*$/;
if (reg.test(theObj)) {
return true;
}
return false;
}
var isChar = function(char) {
var reg = /[A-Za-z]/;
if (!reg.test(char)) {
return false;
}
return true;
}
var pySort = function(arr, empty) {
var $this = this;
// alert($this)
if (!String.prototype.localeCompare)
return null;
// var letters = "ABCDEFGHIJKLMNOPQRSTUVWXYZ#".split('');
var letters = "ABCDEFGHJKLMNOPQRSTWXYZ#123456789".split('');
var zh = " Ah, did you send the bad amount to the GAHA level card? Oh, the crawler is scattered to him. Wow, why ".split(''); //* No space occupying i,u,v Chinese characters beginning with Pinyin
// console.log(arr)
var arrList = [];
for (var m = 0; m < arr.length; m++) {
arrList.push(arr[m]);
}
var result = [];
var curr;
for (var i = 0; i < letters.length; i++) {
curr = {
letter: letters[i],
data: []
};
// console.log(arrList)
if (i != 26) {
for (var j = 0; j < arrList.length; j++) {
var initial = arrList[j].name.charAt(0); // Intercept the first character
// console.log(initial)
if (arrList[j].name.charAt(0) == letters[i] || arrList[j].name.charAt(0) == letters[i].toLowerCase()) { // The first character is in English
// console.log("1")
curr.data.push(arrList[j]);
} else if (zh[i] != '*' && isChinese(initial)) { // Judge whether there are no Chinese characters , Is it Chinese
// console.log("2")
if (initial.localeCompare(zh[i]) >= 0 && (!zh[i + 1] || initial.localeCompare(zh[i + 1]) < 0)) { // Judge which category Chinese characters are in
console.log(initial)
console.log(zh[i])
console.log(letters[i])
console.log(initial.localeCompare(zh[i]))
console.log(initial.localeCompare(zh[i + 1]))
console.log("--------------------")
curr.data.push(arrList[j]);
}
// curr.data.push(arrList[j]);
}
}
} else {
// for (var k = 0; k < arrList.length; k++) {
// var ini = arrList[k].name.charAt(0); // Intercept the first character
// if (!isChar(ini) && !isChinese(ini)) {
// curr.data.push(arrList[k]);
// console.log(ini)
// }
// }
}
if (empty || curr.data.length) {
console.log(curr.data.length)
console.log(result)
result.push(curr);
console.log(result)
curr.data.sort(function(a, b) {
console.log(a)
console.log(b)
return b.name.localeCompare(a.name); // Sort , English order , Chinese characters come after English
});
}
}
return result;
}
exports.isChinese = isChinese
exports.isChar = isChar
exports.pySort = pySort
边栏推荐
- [wechat applet] the mobile terminal selects and publishes pictures
- Microsoft announces that it will discontinue support for older versions of visual studio
- Link: fatal error lnk1168: cannot open debug/test Solution of exe for writing
- QT compiling security video monitoring system 44 video uploading
- [GIS tutorial] ArcGIS for sunshine analysis (with exercise data download)
- [backtracking method] queen n problem
- Ubunt 20.04 uses CDROM or ISO as the installation source
- Data processing and data set preparation
- 22-2-28 there are many things to do at work today, ETH analysis
- Radiometric calibration and atmospheric correction of sentry 2 L1C multispectral data using sen2cor
猜你喜欢

Normalized vegetation index (NDVI) data, NPP data, GPP data, evapotranspiration data, vegetation type data, ecosystem type distribution data

SQL injection upload one sentence Trojan horse (turn)

22-2-28 there are many things to do at work today, ETH analysis

One dragon and one knight accompanying programmers are 36 years old

asp. Net core theme Middleware

Enhanced vegetation index evi, NDVI data, NPP data, GPP data, land use data, vegetation type data, rainfall data

@What happens if bean and @component are used on the same class?

2022-02-28 WPF upper computer 126 understand mqtt

How to count the total length of roads in the region and draw data histogram

InnoDB data storage structure – MySQL
随机推荐
National land use data of 30m precision secondary classification
QT compile 45 graphic report of security video monitoring system
2022 "college entrance examination memory" has been packaged, please check!
Find missing sequence numbers - SQL query to find missing sequence numbers
February 19, 2022 [Nolan] Nolan resurrected? Change · Nolan [soul orchid] can be connected to XDD / silly girl
From science to startup
Things to challenge
Why should a redis cluster use a reverse proxy? Just read this one
AI and logistics Patent
[backtracking] backtracking to solve subset problems
Big manufacturers compete to join rust, performance and safety are the key, and the 2021 rust developer survey report is announced
Unable to resolve dependency tree
Advanced MySQL knowledge points (7)
Install pycharm under Kali and create a shortcut access
C# TaskFactory. Startnew method
Chapter 1
2022 electrician (elementary) operation certificate examination question bank and online simulation examination
[SC] OpenService FAILED 5: Access is denied.
Please calculate the value of the following function recursively: PX (x, n) =x-x^2 +x^3- x^4+... (-1) n-1) (xn) n > 0 * * input format requirements: "%lf%d" prompt: "enter X and n:"
Sustainable service business models