12-23-上传master

This commit is contained in:
xingsy
2020-12-23 11:14:35 +08:00
parent 9769f83bc8
commit b42e0c1ddd
553 changed files with 56506 additions and 0 deletions

48
src/utils/CommonUtils.ts Normal file
View File

@ -0,0 +1,48 @@
/*
* @Author: liqiang
* @Date: 2020-11-24 15:26:54
* @LastEditTime: 2020-12-09 14:13:30
* @LastEditors: Please set LastEditors
* @Description: In User Settings Edit
* @FilePath: \ebtp-cloud-frontend\src\utils\CommonUtils.ts
*/
/**
* 判断是否等于空
* @param value
*/
export function isEmpty(value: any) {
return value === null || value === void 0 || value === '';
}
/**
* 判断不等于空
* @param value
*/
export function isNotEmpty(value: any) {
return value !== null && value !== void 0 && value !== '';
}
/**
* proTable下拉选格式转换
* @param data 字典数据
*/
export function proTableValueEnum(data: any) {
let json = {};
if(isEmpty(data)){
return json;
}
for (const item of data) {
json[item.code] = { text: item.dicName };
}
return json;
}
/**
* 获取url路径信息
* @param name
*/
export function getURLInformation(name: string) {
let reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
let r = window.location.search.substr(1).match(reg);
return r !== null ? unescape(r[2]) : null;
}