diff --git a/src/utils/index.js b/src/utils/index.js index 0967f5f..bdbe792 100644 --- a/src/utils/index.js +++ b/src/utils/index.js @@ -430,7 +430,7 @@ export function getTreeNodePaths(options) { /** * 根据 level 属性处理树数据,添加 isLeaf 属性控制节点是否可展开 */ -export const processTreeDataByLevel = (options) => { +export function processTreeDataByLevel(options) { const { data, level, childrenKey, currentLevel = 1 } = options; return data.map((item) => { const processedItem = { ...item }; @@ -457,12 +457,12 @@ export const processTreeDataByLevel = (options) => { return processedItem; }); -}; +} /** * 根据 onlyLastLevel 属性处理树数据,添加 selectable 属性控制节点是否可选择 */ -export const processTreeDataForOnlyLastLevel = (options) => { +export function processTreeDataForOnlyLastLevel(options) { const { data, childrenKey, onlyLastLevel = false } = options; if (!onlyLastLevel) return data; @@ -483,12 +483,12 @@ export const processTreeDataForOnlyLastLevel = (options) => { return processedItem; }); -}; +} /** * 验证结束时间是否大于开始时间 */ -export const validatorEndTime = (timeStart, message = "结束时间不能早于开始时间") => { +export function validatorEndTime(timeStart, message = "结束时间不能早于开始时间") { return { validator: (_, value) => { if (value && timeStart && value < timeStart) @@ -497,12 +497,12 @@ export const validatorEndTime = (timeStart, message = "结束时间不能早于 return Promise.resolve(); }, }; -}; +} /** * 验证时间是否大于等于当前时间 */ -export const validatorTimeGTCurrentDay = (message = "需要大于当前时间") => { +export function validatorTimeGTCurrentDay(message = "需要大于当前时间") { return { validator: (_, value) => { if (value && value <= dayjs().format("YYYY-MM-DD HH:mm:ss")) @@ -511,7 +511,7 @@ export const validatorTimeGTCurrentDay = (message = "需要大于当前时间") return Promise.resolve(); }, }; -}; +} /** * 动态加载js资源