统一定义一个部门名称截断的处理

This commit is contained in:
daihh
2022-06-08 20:52:11 +08:00
parent 6dabf8a0fd
commit cf138e3365
4 changed files with 33 additions and 23 deletions

View File

@@ -5,6 +5,25 @@ export const deepCopy = (obj) => {
return JSON.parse(JSON.stringify(obj));
};
/**截取名称部分,以/划分 */
export const cutFullName = (fullName,num) => {
let newName=fullName;
if(newName){
let names=newName.split('/');
if(names.length>1){
newName=names[1];
if(num==2){
if(names.length>2){
newName+="/"+names[2];
}
}
}
}
return newName;
};
/**
* 获取url协议
* @param {Object} type