refactor(utils): 将箭头函数转换为函数声明
parent
b177e1664d
commit
fb470e6513
|
|
@ -430,7 +430,7 @@ export function getTreeNodePaths(options) {
|
||||||
/**
|
/**
|
||||||
* 根据 level 属性处理树数据,添加 isLeaf 属性控制节点是否可展开
|
* 根据 level 属性处理树数据,添加 isLeaf 属性控制节点是否可展开
|
||||||
*/
|
*/
|
||||||
export const processTreeDataByLevel = (options) => {
|
export function processTreeDataByLevel(options) {
|
||||||
const { data, level, childrenKey, currentLevel = 1 } = options;
|
const { data, level, childrenKey, currentLevel = 1 } = options;
|
||||||
return data.map((item) => {
|
return data.map((item) => {
|
||||||
const processedItem = { ...item };
|
const processedItem = { ...item };
|
||||||
|
|
@ -457,12 +457,12 @@ export const processTreeDataByLevel = (options) => {
|
||||||
|
|
||||||
return processedItem;
|
return processedItem;
|
||||||
});
|
});
|
||||||
};
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据 onlyLastLevel 属性处理树数据,添加 selectable 属性控制节点是否可选择
|
* 根据 onlyLastLevel 属性处理树数据,添加 selectable 属性控制节点是否可选择
|
||||||
*/
|
*/
|
||||||
export const processTreeDataForOnlyLastLevel = (options) => {
|
export function processTreeDataForOnlyLastLevel(options) {
|
||||||
const { data, childrenKey, onlyLastLevel = false } = options;
|
const { data, childrenKey, onlyLastLevel = false } = options;
|
||||||
if (!onlyLastLevel)
|
if (!onlyLastLevel)
|
||||||
return data;
|
return data;
|
||||||
|
|
@ -483,12 +483,12 @@ export const processTreeDataForOnlyLastLevel = (options) => {
|
||||||
|
|
||||||
return processedItem;
|
return processedItem;
|
||||||
});
|
});
|
||||||
};
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 验证结束时间是否大于开始时间
|
* 验证结束时间是否大于开始时间
|
||||||
*/
|
*/
|
||||||
export const validatorEndTime = (timeStart, message = "结束时间不能早于开始时间") => {
|
export function validatorEndTime(timeStart, message = "结束时间不能早于开始时间") {
|
||||||
return {
|
return {
|
||||||
validator: (_, value) => {
|
validator: (_, value) => {
|
||||||
if (value && timeStart && value < timeStart)
|
if (value && timeStart && value < timeStart)
|
||||||
|
|
@ -497,12 +497,12 @@ export const validatorEndTime = (timeStart, message = "结束时间不能早于
|
||||||
return Promise.resolve();
|
return Promise.resolve();
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
};
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 验证时间是否大于等于当前时间
|
* 验证时间是否大于等于当前时间
|
||||||
*/
|
*/
|
||||||
export const validatorTimeGTCurrentDay = (message = "需要大于当前时间") => {
|
export function validatorTimeGTCurrentDay(message = "需要大于当前时间") {
|
||||||
return {
|
return {
|
||||||
validator: (_, value) => {
|
validator: (_, value) => {
|
||||||
if (value && value <= dayjs().format("YYYY-MM-DD HH:mm:ss"))
|
if (value && value <= dayjs().format("YYYY-MM-DD HH:mm:ss"))
|
||||||
|
|
@ -511,7 +511,7 @@ export const validatorTimeGTCurrentDay = (message = "需要大于当前时间")
|
||||||
return Promise.resolve();
|
return Promise.resolve();
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
};
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 动态加载js资源
|
* 动态加载js资源
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue