当前位置:网站首页>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
边栏推荐
- Day17 array features array boundary array application traversal array multidimensional array creation and traversal arrays operation array bubble sort
- CCF access control system
- EnterpriseTECH STAR Question
- The master programmer "plays" a C program that is not like C
- Introduction to distributed locks
- JS function and variable have the same name (function and variable parsing rules)
- Unable to resolve dependency tree
- Musk promotes the development of fascinating new products partners remind important questions
- File contains (regardless of suffix) Apache log remote file contains PHP encapsulated pseudo protocol:
- Realease package appears – missing type parameter
猜你喜欢

ShanMeng and Beijing Adoption Day start NFT digital collection public offering

One dragon and one knight accompanying programmers are 36 years old

Simulation of array implementation stack

Oracle's instr()

2022 electrician (elementary) operation certificate examination question bank and online simulation examination

Summary of common interview questions in redis

Token based authentication

Ten trends of Internet Security in 2022 industry released

Find missing sequence numbers - SQL query to find missing sequence numbers

2022 examination questions and online simulation examination for safety management personnel of hazardous chemical business units
随机推荐
JS set the position of the current scroll bar
@What happens if bean and @component are used on the same class?
2022 examination questions and simulation examination for crane driver (limited to bridge crane)
Kwai opens a milestone activity for fans to record every achievement moment for creators
Simulation of array implementation stack
加速训练之并行化 tf.data.Dataset 生成器
one billion one hundred and eleven million one hundred and eleven thousand one hundred and eleven
Acquisition of Lai data, NPP data, GPP data and vegetation coverage data
Surface net radiation flux data, solar radiation data, rainfall data, air temperature data, sunshine duration, water vapor pressure distribution, wind speed and direction data, surface temperature
JWT學習與使用
How to count the total length of roads in the region and draw data histogram
CCF access control system
Install/Remove of the Service Denied!
Difference between thread and task
New year news of osdu open underground data space Forum
Some points needing attention about thread pool
[SC] OpenService FAILED 5: Access is denied.
Realease package appears – missing type parameter
Soil type, soil texture, soil nutrient and change data, soil organic matter, soil pH, soil nitrogen, phosphorus and potassium
A complete set of installation procedures (for learning and communication only)