lanjianrong преди 4 години
родител
ревизия
855a72ab30
променени са 6 файла, в които са добавени 14 реда и са изтрити 12013 реда
  1. 2 2
      package.json
  2. 0 11999
      pnpm-lock.yaml
  3. 6 6
      src/components/LazyCascader/LazyCascader.tsx
  4. 1 1
      src/components/LazyCascader/index.tsx
  5. 2 2
      src/components/LazyCascader/util.ts
  6. 3 3
      src/hooks/event/useScrollRequest.ts

+ 2 - 2
package.json

@@ -33,8 +33,8 @@
     "@ant-design/pro-layout": "6.38.8",
     "@ant-design/pro-table": "2.76.3",
     "@icon-park/react": "^1.3.3",
-    "@umijs/max": "4.0.0-rc.22",
-    "@umijs/plugins": "4.0.0-rc.22",
+    "@umijs/max": "4.0.2",
+    "@umijs/plugins": "4.0.2",
     "ahooks": "^3.4.1",
     "antd": "4.21.0",
     "antd-img-crop": "^3.16.0",

Файловите разлики са ограничени, защото са твърде много
+ 0 - 11999
pnpm-lock.yaml


+ 6 - 6
src/components/LazyCascader/LazyCascader.tsx

@@ -1,13 +1,14 @@
+import React, { forwardRef, useEffect, useState, useLayoutEffect } from 'react'
 import { getAuthCache } from '@/utils/auth'
 import { CASCADER_HISTORY_KEY } from '@/utils/cache/cacheEnum'
 import { isUnDef } from '@/utils/is'
-import type { CascaderProps } from 'antd'
 import { Cascader, Divider, Tag } from 'antd'
-import React, { forwardRef, useEffect, useState, useLayoutEffect } from 'react'
 import { connect } from '@umijs/max'
-import type { Dispatch } from '@umijs/max'
+import { authSaveRecord } from './shared'
 import styles from './index.less'
-import { saveRecordToAuth } from './util'
+
+import type { Dispatch } from '@umijs/max'
+import type { CascaderProps } from 'antd'
 import type { CascaderRef } from 'antd/lib/cascader'
 
 type LazyCascaderProps<T> = {
@@ -27,7 +28,6 @@ function CLazyCascader<T>({
   popupVisible = false,
   showFooter = false,
   defaultValue,
-  onBlur,
   isEditFormItem,
   ...resetProps
 }: LazyCascaderProps<T>) {
@@ -57,7 +57,7 @@ function CLazyCascader<T>({
     const len = nvalue?.length
     if (len === 3) {
       const { name, id } = selectedOptions[2]
-      const htr = saveRecordToAuth(
+      const htr = authSaveRecord(
         name,
         id,
         selectedOptions.map(item => ({ id: item.id, name: item.name }))

+ 1 - 1
src/components/LazyCascader/index.tsx

@@ -1,5 +1,5 @@
 import LazyCascader from './LazyCascader'
-import { validCascaderRule, formatValues } from './util'
+import { validCascaderRule, formatValues } from './shared'
 
 export default LazyCascader
 export { validCascaderRule, formatValues }

+ 2 - 2
src/components/LazyCascader/util.ts

@@ -20,8 +20,8 @@ export function formatValues(value) {
   return { province, city, area, ...resetVal }
 }
 
-/** 对级联数据进行auth历史性存储 */
-export function saveRecordToAuth(name = '', id = '', value = []) {
+/** 对级联数据进行历史性存储 */
+export function authSaveRecord(name = '', id = '', value = []) {
   if (!name || !id) return
   let hty = getAuthCache(CASCADER_HISTORY_KEY) || []
   // 数组为空

+ 3 - 3
src/hooks/event/useScrollRequest.ts

@@ -1,8 +1,8 @@
 /* eslint-disable  */
 import { useEffect, useState } from 'react'
-import { useMount, usePersistFn } from '_ahooks@2.10.2@ahooks'
-import { Target } from '_ahooks@2.10.2@ahooks/lib/useScroll'
-import { getTargetElement } from '_ahooks@2.10.2@ahooks/lib/utils/dom'
+import { useMount, usePersistFn } from 'ahooks'
+import { Target } from 'ahooks/lib/useScroll'
+import { getTargetElement } from 'ahooks/lib/utils/domTarget'
 
 type requestBasicParams = {
   current: number