Kaynağa Gözat

feat: 5.20例行提交

lanjianrong 4 yıl önce
ebeveyn
işleme
9fab71a491

+ 4 - 1
README.md

@@ -35,4 +35,7 @@ git push origin master --force //将重置后的 master 分支强制推送更新
 2. 新增路由页面:
 2. 新增路由页面:
  1. 要使用PageContainer包裹并将title、breadcrumb置为false(不需要渲染标题以及面包屑),水印配置视具体页面调整(默认配置查看app.tsx中的layout配置)。
  1. 要使用PageContainer包裹并将title、breadcrumb置为false(不需要渲染标题以及面包屑),水印配置视具体页面调整(默认配置查看app.tsx中的layout配置)。
  2. locales/zh-CH/menu.js要加上对应国际化配置。
  2. locales/zh-CH/menu.js要加上对应国际化配置。
-3. 本项目使用@umijs/plugin-dva整合数据流进行全局状态管理, [详见](https://umijs.org/zh-CN/plugins/plugin-dva)
+3. 本项目使用@umijs/plugin-dva整合数据流进行全局状态管理, [详见](https://umijs.org/zh-CN/plugins/plugin-dva)。
+4. 项目使用ProTable封装的BasicTable进行表格的渲染,支持透传[ProTable](https://procomponents.ant.design/components/table#api)所有属性。
+ 1. 表格自动进行高度自适应,若使用request api自动接管请求,任何情况下都将返回的对象的success: true,data都要返回数组即使是空数组。
+ 2. mainMenuType参数决定是否开启数据权限配置项、表格配置本地化存储。

+ 1 - 1
package.json

@@ -72,7 +72,7 @@
     "react-infinite-scroll-component": "^6.1.0",
     "react-infinite-scroll-component": "^6.1.0",
     "react-markdown": "^7.1.0",
     "react-markdown": "^7.1.0",
     "umi": "3.5.4",
     "umi": "3.5.4",
-    "vditor": "^3.8.7",
+    "vditor": "3.8.14",
     "virtuallist-antd": "^0.7.2"
     "virtuallist-antd": "^0.7.2"
   },
   },
   "devDependencies": {
   "devDependencies": {

+ 3 - 2
src/components/Table/src/BasicTable.tsx

@@ -1,11 +1,12 @@
 /* eslint-disable react-hooks/rules-of-hooks */
 /* eslint-disable react-hooks/rules-of-hooks */
 /* eslint-disable no-param-reassign */
 /* eslint-disable no-param-reassign */
-import React, { useRef, useState, useLayoutEffect, useMemo } from 'react'
+import React, { useRef, useState, useMemo } from 'react'
 import PermSelect from '@/pages/Customer/Company/components/PermSelect'
 import PermSelect from '@/pages/Customer/Company/components/PermSelect'
 import { TABLE_COLUMNS_MAP, ColumnStateEnum } from '@/utils/cache/cacheEnum'
 import { TABLE_COLUMNS_MAP, ColumnStateEnum } from '@/utils/cache/cacheEnum'
 import { isBoolean, isMobile, isNullOrUnDef, isObject, isUnDef } from '@/utils/is'
 import { isBoolean, isMobile, isNullOrUnDef, isObject, isUnDef } from '@/utils/is'
 import ProTable from '@ant-design/pro-table'
 import ProTable from '@ant-design/pro-table'
 import { useModel } from 'umi'
 import { useModel } from 'umi'
+import { useUpdateLayoutEffect } from 'ahooks'
 import { getAuthCache, getPermAuthCache, setAuthCache } from '@/utils/auth'
 import { getAuthCache, getPermAuthCache, setAuthCache } from '@/utils/auth'
 import { useTableScroll } from './hooks/useTableScroll'
 import { useTableScroll } from './hooks/useTableScroll'
 import type { ColumnsState } from '@ant-design/pro-table'
 import type { ColumnsState } from '@ant-design/pro-table'
@@ -76,7 +77,7 @@ const BasicTable: {
     paginationRef: !isBoolean(resetProps.pagination)
     paginationRef: !isBoolean(resetProps.pagination)
   })
   })
 
 
-  useLayoutEffect(() => {
+  useUpdateLayoutEffect(() => {
     if (state.dataSource || !isUnDef(resetProps.dataSource)) {
     if (state.dataSource || !isUnDef(resetProps.dataSource)) {
       redoHeight(state.dataSource || resetProps.dataSource)
       redoHeight(state.dataSource || resetProps.dataSource)
     }
     }

+ 1 - 1
src/pages/Hr/Notification/components/RighEditor.jsx

@@ -52,7 +52,7 @@ const RighEditor = ({ value, onChange }) => {
         'edit-mode',
         'edit-mode',
         {
         {
           name: 'more',
           name: 'more',
-          toolbar: ['both', 'code-theme', 'content-theme', 'export', 'outline', 'preview', 'devtools', 'info', 'help']
+          toolbar: ['both', 'code-theme', 'content-theme', 'export', 'outline', 'preview', 'devtools', 'help']
         }
         }
       ],
       ],
       value: state.initValue,
       value: state.initValue,

+ 1 - 1
src/pages/Product/Cloud/index.jsx

@@ -275,7 +275,7 @@ const Cloud = () => {
           } = await queryRoadpricingList({ ...params, ...sortOrder, ...filter })
           } = await queryRoadpricingList({ ...params, ...sortOrder, ...filter })
           return {
           return {
             data: list,
             data: list,
-            success: code === consts.RET_CODE.SUCCESS,
+            success: true,
             total
             total
           }
           }
         }}
         }}

+ 1 - 1
src/types/typing.d.ts

@@ -31,7 +31,7 @@ export type BasicTableProps<T, U extends ParamsType, ValueType = 'text'> = {
   searchTooptip?: boolean | string | ReactNode
   searchTooptip?: boolean | string | ReactNode
   /** @deprecated 启用列可伸缩功能(已弃用) */
   /** @deprecated 启用列可伸缩功能(已弃用) */
   resizable?: boolean
   resizable?: boolean
-  /** @name 枚举表中的菜单常量 */
+  /** @name 枚举表中的菜单常量,会渲染数据权限下拉框 */
   mainMenuType?: MainMenuKeyEnum
   mainMenuType?: MainMenuKeyEnum
   /** @name 枚举表中的表格列常量 */
   /** @name 枚举表中的表格列常量 */
   columnStateType?: ColumnStateEnum
   columnStateType?: ColumnStateEnum