From fb470e65136e56689c8c54da0703d71df4fab5d0 Mon Sep 17 00:00:00 2001 From: LiuJiaNan <15703339975@163.com> Date: Thu, 12 Mar 2026 16:26:35 +0800 Subject: [PATCH] =?UTF-8?q?refactor(utils):=20=E5=B0=86=E7=AE=AD=E5=A4=B4?= =?UTF-8?q?=E5=87=BD=E6=95=B0=E8=BD=AC=E6=8D=A2=E4=B8=BA=E5=87=BD=E6=95=B0?= =?UTF-8?q?=E5=A3=B0=E6=98=8E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/utils/index.js | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) 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资源