This commit is contained in:
qsh
2023-03-21 00:53:28 +08:00
parent 953377e655
commit 955687d473
171 changed files with 7149 additions and 7341 deletions

View File

@@ -78,7 +78,7 @@ export function selectDictLabel(datas, value) {
}
var actions = [];
Object.keys(datas).some((key) => {
if (datas[key].value == '' + value) {
if (datas[key].value === '' + value) {
actions.push(datas[key].label);
return true;
}
@@ -100,7 +100,7 @@ export function selectDictLabels(datas, value, separator) {
Object.keys(value.split(currentSeparator)).some((val) => {
var match = false;
Object.keys(datas).some((key) => {
if (datas[key].value == '' + temp[val]) {
if (datas[key].value === '' + temp[val]) {
actions.push(datas[key].label + currentSeparator);
match = true;
}
@@ -130,7 +130,7 @@ export function sprintf(str) {
// 转换字符串undefined,null等转化为""
export function parseStrEmpty(str) {
if (!str || str == 'undefined' || str == 'null') {
if (!str || str === 'undefined' || str === 'null') {
return '';
}
return str;
@@ -140,7 +140,7 @@ export function parseStrEmpty(str) {
export function mergeRecursive(source, target) {
for (var p in target) {
try {
if (target[p].constructor == Object) {
if (target[p].constructor === Object) {
source[p] = mergeRecursive(source[p], target[p]);
} else {
source[p] = target[p];
@@ -241,15 +241,14 @@ export async function blobValidate(data) {
}
}
export function isNullOrEmpty(val) {
if (val === null || val === undefined) {
return true
return true;
} else if (val === {} || Object.keys(val).length === 0) {
return true
return true;
} else if (val.length === 0) {
return true
return true;
} else {
return false
return false;
}
}