mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/learning-system-portal.git
synced 2025-12-13 04:46:44 +08:00
统一定义一个部门名称截断的处理
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user