@cfmm/umi-plugins-ui-v2 0.0.22 → 0.0.23
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/components/PermissionSelect.tpl +2 -1
- package/dist/cjs/hooks/useFetchList.tpl +66 -0
- package/dist/cjs/hooks/useRouteAuth.tpl +4 -1
- package/dist/cjs/index.js +19 -8
- package/dist/cjs/types/UseFetchListTypes.d.ts +1 -0
- package/dist/cjs/types/UseFetchListTypes.js +7 -0
- package/dist/cjs/types/index.d.ts +1 -0
- package/dist/cjs/types/index.js +8 -1
- package/dist/cjs/writeTmpFile/index.d.ts +2 -1
- package/dist/cjs/writeTmpFile/index.js +7 -0
- package/dist/cjs/writeTmpFile/writeIndex.js +1 -1
- package/dist/cjs/writeTmpFile/writeStatusConfig.d.ts +6 -0
- package/dist/cjs/writeTmpFile/writeStatusConfig.js +36 -0
- package/dist/cjs/writeTmpFile/writeTypes.js +1 -1
- package/dist/esm/components/PermissionSelect.tpl +2 -1
- package/dist/esm/hooks/useFetchList.tpl +66 -0
- package/dist/esm/hooks/useRouteAuth.tpl +4 -1
- package/dist/esm/index.js +20 -9
- package/dist/esm/types/UseFetchListTypes.d.ts +1 -0
- package/dist/esm/types/UseFetchListTypes.js +1 -0
- package/dist/esm/types/index.d.ts +1 -0
- package/dist/esm/types/index.js +2 -1
- package/dist/esm/writeTmpFile/index.d.ts +2 -1
- package/dist/esm/writeTmpFile/index.js +2 -1
- package/dist/esm/writeTmpFile/writeIndex.js +1 -1
- package/dist/esm/writeTmpFile/writeStatusConfig.d.ts +6 -0
- package/dist/esm/writeTmpFile/writeStatusConfig.js +30 -0
- package/dist/esm/writeTmpFile/writeTypes.js +2 -2
- package/package.json +1 -1
|
@@ -4,6 +4,7 @@ import { DataNode } from 'rc-tree/lib/interface';
|
|
|
4
4
|
import React, { useEffect, useState } from 'react';
|
|
5
5
|
import { useIntl, request } from '@umijs/max';
|
|
6
6
|
import { BASE_API } from "../constants";
|
|
7
|
+
import { STATUS_ENABLED_VALUES } from '../statusConfig';
|
|
7
8
|
import { PermissionSelectFormProps, MenuItem, PermissionItem } from "../types";
|
|
8
9
|
|
|
9
10
|
export async function queryAllMenus() {
|
|
@@ -19,7 +20,7 @@ export async function queryAllPermissions() {
|
|
|
19
20
|
}
|
|
20
21
|
|
|
21
22
|
const checkStatus = (status: string): boolean => {
|
|
22
|
-
return status
|
|
23
|
+
return STATUS_ENABLED_VALUES.includes(status?.toString());
|
|
23
24
|
}
|
|
24
25
|
|
|
25
26
|
/**
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { useEffect, useState } from 'react';
|
|
2
|
+
import { FetchListOptions } from '../types';
|
|
3
|
+
import useQueryTableList from './useQueryTableList';
|
|
4
|
+
import useMemoizedFn from './useMemoizedFn';
|
|
5
|
+
|
|
6
|
+
type FetchFn<T = any, K = API.TableListParams> = (params?: K) => Promise<API.Result_Base_List<T[]>>;
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* 查询菜单列表
|
|
10
|
+
* @param fetchFn 请求函数
|
|
11
|
+
* @param params 查询参数
|
|
12
|
+
* @param options 查询选项
|
|
13
|
+
* @param options.manualFetch 是否手动查询列表
|
|
14
|
+
* @param options.baseLocalCode 基础本地代码
|
|
15
|
+
* @param options.baseLocalName 基础本地名称
|
|
16
|
+
* @param options.config 查询配置
|
|
17
|
+
* @param options.config.showLoadingMsg 是否显示message.loading
|
|
18
|
+
* @param options.config.waitingMsg loading时的提示内容
|
|
19
|
+
* @param options.config.failMsg 查询失败时的提示内容
|
|
20
|
+
* @param options.afterFetch 查询后回调
|
|
21
|
+
* @returns {
|
|
22
|
+
* list: 列表数据
|
|
23
|
+
* loading: 是否加载中
|
|
24
|
+
* error: 错误信息
|
|
25
|
+
* fetchList: 查询列表函数
|
|
26
|
+
* reloadList: 重新查询列表函数
|
|
27
|
+
* }
|
|
28
|
+
*/
|
|
29
|
+
const useFetchList = <T extends Record<string, any>, K = API.TableListParams>(
|
|
30
|
+
fetchFn: FetchFn<T, K>,
|
|
31
|
+
params?: K,
|
|
32
|
+
options?: FetchListOptions<T>,
|
|
33
|
+
) => {
|
|
34
|
+
const { manualFetch, config, baseLocalCode, baseLocalName, afterFetch } = options || {};
|
|
35
|
+
const { queryList, loading, error } = useQueryTableList({ baseLocalCode, baseLocalName });
|
|
36
|
+
const [list, setList] = useState<T[]>([]);
|
|
37
|
+
|
|
38
|
+
const reloadList = useMemoizedFn(async () => {
|
|
39
|
+
return await fetchList(params);
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
const fetchList = useMemoizedFn(async (params?: K) => {
|
|
43
|
+
const response = await queryList(params, {
|
|
44
|
+
queryFn: fetchFn,
|
|
45
|
+
showLoadingMsg: false,
|
|
46
|
+
...config,
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
if (response.success && response.data) {
|
|
50
|
+
setList(response.data);
|
|
51
|
+
afterFetch?.(response);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
return response;
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
useEffect(() => {
|
|
58
|
+
if (!manualFetch) {
|
|
59
|
+
fetchList(params);
|
|
60
|
+
}
|
|
61
|
+
}, []);
|
|
62
|
+
|
|
63
|
+
return { list, loading, error, fetchList, reloadList };
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
export { useFetchList };
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { CurrentUser } from '../types';
|
|
2
2
|
import { history, useLocation, useMemoizedFn, useParams } from '@umijs/max';
|
|
3
3
|
import { useMemo } from 'react';
|
|
4
|
+
import { STATUS_ENABLED_VALUES } from '../statusConfig';
|
|
4
5
|
|
|
5
6
|
export type UserStatusRedirect = '/400' | '/401' | '/403' | '/404';
|
|
6
7
|
|
|
@@ -12,6 +13,8 @@ const whiteListRoutes = ['/400', '/401', '/403', '/404', '/login', '/'];
|
|
|
12
13
|
* @returns 权限检查相关状态和方法
|
|
13
14
|
*/
|
|
14
15
|
export const useRouteAuth = (currentUser?: CurrentUser) => {
|
|
16
|
+
const checkStatus = useMemoizedFn((status: string | number) => STATUS_ENABLED_VALUES.includes(status.toString()));
|
|
17
|
+
|
|
15
18
|
const params = useParams();
|
|
16
19
|
const { pathname } = useLocation();
|
|
17
20
|
|
|
@@ -36,7 +39,7 @@ export const useRouteAuth = (currentUser?: CurrentUser) => {
|
|
|
36
39
|
* 无需再区分「存在性」与「权限」两份列表。
|
|
37
40
|
*/
|
|
38
41
|
const validMenus = useMemo(
|
|
39
|
-
() => currentUser?.menus?.filter((item: any) => item.status
|
|
42
|
+
() => currentUser?.menus?.filter((item: any) => checkStatus(item.status)) ?? [],
|
|
40
43
|
[currentUser?.menus],
|
|
41
44
|
);
|
|
42
45
|
|
package/dist/cjs/index.js
CHANGED
|
@@ -38,14 +38,24 @@ var getContentAndFileType = function getContentAndFileType(filePath) {
|
|
|
38
38
|
var _default = exports.default = function _default(api) {
|
|
39
39
|
// See https://umijs.org/docs/guides/plugins
|
|
40
40
|
api.describe({
|
|
41
|
-
key: 'cfmmUI'
|
|
42
|
-
//
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
41
|
+
key: 'cfmmUI',
|
|
42
|
+
// 插件默认启用;仅在有自定义参数时才需要配置 cfmmUI
|
|
43
|
+
/**
|
|
44
|
+
* export default {
|
|
45
|
+
* cfmmUI: {
|
|
46
|
+
* statusEnabledValues: ['Y'], // 或 ['1', 'Y']
|
|
47
|
+
* },
|
|
48
|
+
* }
|
|
49
|
+
*/
|
|
50
|
+
config: {
|
|
51
|
+
schema: function schema(joi) {
|
|
52
|
+
// 配置状态字段,支持字符串和数字的数组
|
|
53
|
+
return joi.object({
|
|
54
|
+
statusEnabledValues: joi.array().items(joi.alternatives().try(joi.string(), joi.number())).min(1)
|
|
55
|
+
});
|
|
56
|
+
},
|
|
57
|
+
onChange: api.ConfigChangeType.regenerateTmpFiles
|
|
58
|
+
}
|
|
49
59
|
// enableBy: api.EnableBy.config,
|
|
50
60
|
});
|
|
51
61
|
|
|
@@ -112,6 +122,7 @@ var _default = exports.default = function _default(api) {
|
|
|
112
122
|
api.writeTmpFile(_writeTmpFile.runtime);
|
|
113
123
|
api.writeTmpFile(_writeTmpFile.writeIndex);
|
|
114
124
|
api.writeTmpFile((0, _writeTmpFile.writeConstants)(api));
|
|
125
|
+
api.writeTmpFile((0, _writeTmpFile.writeStatusConfig)(api));
|
|
115
126
|
api.writeTmpFile(_writeTmpFile.writeTypes);
|
|
116
127
|
});
|
|
117
128
|
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const UseFetchListTypes = "\n/**\n * \u67E5\u8BE2\u5217\u8868\u9009\u9879\u7684hooks\n * \u4F7F\u7528\u793A\u4F8B\uFF1A\n * const { list, loading, error, fetchList, reloadList } = useFetchList<TableListItem, TableListParams>(\n * queryMaterial,\n * params,\n * {\n * baseLocalCode,\n * baseLocalName,\n * ...options,\n * },\n * );\n */\nexport type FetchListOptions<T extends Record<string, any> = any> = {\n /**\n * \u662F\u5426\u624B\u52A8\u67E5\u8BE2\u5217\u8868\n */\n manualFetch?: boolean;\n /**\n * \u57FA\u7840\u672C\u5730\u4EE3\u7801\n */\n baseLocalCode?: string;\n /**\n * \u57FA\u7840\u672C\u5730\u540D\u79F0\n */\n baseLocalName?: string;\n /**\n * \u67E5\u8BE2\u914D\u7F6E\n */\n config?: {\n /**\n * \u662F\u5426\u663E\u793Amessage.loading\n */\n showLoadingMsg?: boolean;\n /**\n * loading\u65F6\u7684\u63D0\u793A\u5185\u5BB9\n */\n waitingMsg?: string;\n /**\n * \u67E5\u8BE2\u5931\u8D25\u65F6\u7684\u63D0\u793A\u5185\u5BB9\n */\n failMsg?: string;\n };\n /**\n * \u67E5\u8BE2\u540E\u56DE\u8C03\n */\n afterFetch?: (response: API.Result_TableListType<T>) => void;\n};\n";
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.UseFetchListTypes = void 0;
|
|
7
|
+
var UseFetchListTypes = exports.UseFetchListTypes = "\n/**\n * \u67E5\u8BE2\u5217\u8868\u9009\u9879\u7684hooks\n * \u4F7F\u7528\u793A\u4F8B\uFF1A\n * const { list, loading, error, fetchList, reloadList } = useFetchList<TableListItem, TableListParams>(\n * queryMaterial,\n * params,\n * {\n * baseLocalCode,\n * baseLocalName,\n * ...options,\n * },\n * );\n */\nexport type FetchListOptions<T extends Record<string, any> = any> = {\n /**\n * \u662F\u5426\u624B\u52A8\u67E5\u8BE2\u5217\u8868\n */\n manualFetch?: boolean;\n /**\n * \u57FA\u7840\u672C\u5730\u4EE3\u7801\n */\n baseLocalCode?: string;\n /**\n * \u57FA\u7840\u672C\u5730\u540D\u79F0\n */\n baseLocalName?: string;\n /**\n * \u67E5\u8BE2\u914D\u7F6E\n */\n config?: {\n /**\n * \u662F\u5426\u663E\u793Amessage.loading\n */\n showLoadingMsg?: boolean;\n /**\n * loading\u65F6\u7684\u63D0\u793A\u5185\u5BB9\n */\n waitingMsg?: string;\n /**\n * \u67E5\u8BE2\u5931\u8D25\u65F6\u7684\u63D0\u793A\u5185\u5BB9\n */\n failMsg?: string;\n };\n /**\n * \u67E5\u8BE2\u540E\u56DE\u8C03\n */\n afterFetch?: (response: API.Result_TableListType<T>) => void;\n};\n";
|
|
@@ -34,3 +34,4 @@ export { ExportPageWrapperTypes } from "./ExportPageWrapperTypes";
|
|
|
34
34
|
export { MySetpsTypes } from "./MySetpsTypes";
|
|
35
35
|
export { CrudTableTypes } from "./CrudTableTypes";
|
|
36
36
|
export { DndTagTypes } from "./DndTagTypes";
|
|
37
|
+
export { UseFetchListTypes } from "./UseFetchListTypes";
|
package/dist/cjs/types/index.js
CHANGED
|
@@ -195,6 +195,12 @@ Object.defineProperty(exports, "ThemeSwitchTypes", {
|
|
|
195
195
|
return _ThemeSwitchTypes.ThemeSwitchTypes;
|
|
196
196
|
}
|
|
197
197
|
});
|
|
198
|
+
Object.defineProperty(exports, "UseFetchListTypes", {
|
|
199
|
+
enumerable: true,
|
|
200
|
+
get: function get() {
|
|
201
|
+
return _UseFetchListTypes.UseFetchListTypes;
|
|
202
|
+
}
|
|
203
|
+
});
|
|
198
204
|
Object.defineProperty(exports, "ViewTableItemDrawerTypes", {
|
|
199
205
|
enumerable: true,
|
|
200
206
|
get: function get() {
|
|
@@ -254,4 +260,5 @@ var _KeepAliveTabsTypes = require("./KeepAliveTabsTypes");
|
|
|
254
260
|
var _ExportPageWrapperTypes = require("./ExportPageWrapperTypes");
|
|
255
261
|
var _MySetpsTypes = require("./MySetpsTypes");
|
|
256
262
|
var _CrudTableTypes = require("./CrudTableTypes");
|
|
257
|
-
var _DndTagTypes = require("./DndTagTypes");
|
|
263
|
+
var _DndTagTypes = require("./DndTagTypes");
|
|
264
|
+
var _UseFetchListTypes = require("./UseFetchListTypes");
|
|
@@ -2,4 +2,5 @@ import runtime from "./runtime";
|
|
|
2
2
|
import writeIndex from "./writeIndex";
|
|
3
3
|
import writeTypes from "./writeTypes";
|
|
4
4
|
import writeConstants from "./writeConstants";
|
|
5
|
-
|
|
5
|
+
import writeStatusConfig from './writeStatusConfig';
|
|
6
|
+
export { runtime, writeIndex, writeTypes, writeConstants, writeStatusConfig };
|
|
@@ -21,6 +21,12 @@ Object.defineProperty(exports, "writeIndex", {
|
|
|
21
21
|
return _writeIndex.default;
|
|
22
22
|
}
|
|
23
23
|
});
|
|
24
|
+
Object.defineProperty(exports, "writeStatusConfig", {
|
|
25
|
+
enumerable: true,
|
|
26
|
+
get: function get() {
|
|
27
|
+
return _writeStatusConfig.default;
|
|
28
|
+
}
|
|
29
|
+
});
|
|
24
30
|
Object.defineProperty(exports, "writeTypes", {
|
|
25
31
|
enumerable: true,
|
|
26
32
|
get: function get() {
|
|
@@ -31,4 +37,5 @@ var _runtime = _interopRequireDefault(require("./runtime"));
|
|
|
31
37
|
var _writeIndex = _interopRequireDefault(require("./writeIndex"));
|
|
32
38
|
var _writeTypes = _interopRequireDefault(require("./writeTypes"));
|
|
33
39
|
var _writeConstants = _interopRequireDefault(require("./writeConstants"));
|
|
40
|
+
var _writeStatusConfig = _interopRequireDefault(require("./writeStatusConfig"));
|
|
34
41
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
@@ -6,5 +6,5 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
var _default = exports.default = {
|
|
8
8
|
path: "index.tsx",
|
|
9
|
-
content: "\n // \u5BFC\u5165\u7EC4\u4EF6\n import QrCodeModal from \"./components/QrCodeModal\";\n import CreateForm from \"./components/AddDrawerForm\";\n import MyFooterToolbar from \"./components/MyFooterToolbar\";\n import DropdownButton from \"./components/DropdownButton\";\n import DynamicIcon, { getAntdIconList } from \"./components/DynamicIcon\";\n import DynamicIconModal from \"./components/DynamicIconModal\";\n import HighlightStr from \"./components/HighlightStr\";\n import EditMultiLangForm from \"./components/EditMultiLangForm\";\n import MyColorPicker from \"./components/MyColorPicker\";\n import MySelect from \"./components/MySelect\";\n import MySelectLang from \"./components/MySelectLang\";\n import PermissionSelect from \"./components/PermissionSelect\";\n import DataPermissionSelect from \"./components/DataPermissionSelect\";\n import UTCDatePicker from \"./components/UTCDatePicker\";\n import ProFormUTCDatePicker from \"./components/ProFormUTCDatePicker\";\n import UTCRangePicker from \"./components/UTCRangePicker\";\n import ProFormUTCRangePicker from \"./components/ProFormUTCRangePicker\";\n import RandomAvatar from \"./components/RandomAvatar\";\n import RefDrawerForm from \"./components/RefDrawerForm\";\n import UpdateForm from \"./components/UpdateForm\";\n import ViewTableItemDrawer from \"./components/ViewTableItemDrawer\";\n import WangEditor from \"./components/WangEditor\";\n import WangEditorView from \"./components/WangEditorView\";\n import MyUpload from \"./components/MyUpload\";\n import CopyButton from \"./components/CopyButton\";\n import ImportExecl from \"./components/ImportExecl\";\n import MyPageContainer from \"./components/MyPageContainer\";\n import MyReactEcharts from \"./components/MyReactEcharts\";\n import MyTagList from \"./components/MyTagList\";\n import VolumeFormItem from \"./components/VolumeFormItem\";\n import ReportTable from \"./components/ReportTable\";\n import DicDropDownList from \"./components/DicDropDownList\";\n import ActionLogDrawer from \"./components/ActionLogDrawer\";\n import DndTabs from \"./components/DndTabs\";\n import DndTag from \"./components/DndTag\";\n import TimeTypeSelect from \"./components/TimeTypeSelect\";\n import ImportDataUpload from \"./components/ImportDataUpload\";\n import PDFWrapper from \"./components/PDFWrapper\";\n import ExportPageWrapper from \"./components/ExportPageWrapper\";\n import { PageExporter } from \"./utils/exportPage\";\n import MySetps from \"./components/MySetps\";\n import CrudTable from \"./components/CrudTable\";\n\n import MenuFooter from \"./components/MenuFooter\";\n import GlobalHeader from \"./components/GlobalHeader\";\n import GlobalFooter from \"./components/GlobalFooter\";\n import AvatarDropdown from \"./components/AvatarDropdown\";\n import HeaderSearch from \"./components/HeaderSearch\";\n import ThemeSwitch from \"./components/ThemeSwitch\";\n import KeepAliveTabs from \"./components/KeepAliveTabs\";\n import KeepAliveDndTabs from \"./components/KeepAliveDndTabs\";\n\n import Authorized from \"./components/Authorized\";\n import AuthorizedRoute from \"./components/AuthorizedRoute\";\n import AuthorizeRender from \"./components/AuthorizeRender\";\n import CheckPermissions from \"./components/CheckPermissions\";\n import PromiseRender from \"./components/PromiseRender\";\n import Secured from \"./components/Secured\";\n import renderAuthorize from \"./components/renderAuthorize\";\n import { getAuthorityFunction } from \"./utils/authorityFunction\";\n\n import LoadingSvg from \"./components/LoadingSvg\";\n import PageLoading from \"./components/PageLoading\";\n import NoFoundPage from \"./components/NoFoundPage\";\n import UserDisable from \"./components/UserDisable\";\n import UserNoPermission from \"./components/UserNoPermission\";\n import UserNoPagePermission from \"./components/UserNoPagePermission\";\n\n import useAction from \"./hooks/useAction\";\n import useFormatLocale from \"./hooks/useFormatLocale\";\n import useActionLocales from \"./hooks/useActionLocales\";\n import useQueryTableList from \"./hooks/useQueryTableList\";\n import useAuthority from \"./hooks/useAuthority\";\n import useColumnTitle, { useBatchColumnTitles } from \"./hooks/useColumnTitle\";\n import useMemoizedFn from \"./hooks/useMemoizedFn\";\n import { useKeepAliveTabs } from \"./hooks/useKeepAliveTabs\";\n import { usePageExport } from \"./hooks/usePageExport\";\n import { useRouteAuth } from \"./hooks/useRouteAuth\";\n\n // \u5BFC\u51FAhooks\n export {\n useAction,\n useFormatLocale,\n useActionLocales,\n useQueryTableList,\n useAuthority,\n useColumnTitle,\n useBatchColumnTitles,\n useMemoizedFn,\n useKeepAliveTabs,\n usePageExport,\n useRouteAuth,\n }\n\n // \u5BFC\u51FA\u7EC4\u4EF6\n export { \n QrCodeModal, \n CreateForm, \n MyFooterToolbar,\n DropdownButton,\n DynamicIcon,\n DynamicIconModal,\n HighlightStr,\n getAntdIconList,\n EditMultiLangForm,\n MyColorPicker,\n MySelect,\n MySelectLang,\n PermissionSelect,\n DataPermissionSelect,\n UTCDatePicker,\n ProFormUTCDatePicker,\n UTCRangePicker,\n ProFormUTCRangePicker,\n RandomAvatar,\n RefDrawerForm,\n UpdateForm,\n ViewTableItemDrawer,\n WangEditor,\n WangEditorView,\n MyUpload,\n CopyButton,\n ImportExecl,\n MyPageContainer,\n MyReactEcharts,\n MyTagList,\n VolumeFormItem,\n ReportTable,\n DicDropDownList,\n ActionLogDrawer,\n DndTabs,\n DndTag,\n TimeTypeSelect,\n ImportDataUpload,\n PDFWrapper,\n ExportPageWrapper,\n PageExporter,\n MySetps,\n CrudTable,\n\n MenuFooter,\n GlobalHeader,\n GlobalFooter,\n AvatarDropdown,\n HeaderSearch,\n ThemeSwitch,\n KeepAliveTabs,\n KeepAliveDndTabs,\n \n Authorized,\n AuthorizedRoute,\n AuthorizeRender,\n CheckPermissions,\n PromiseRender,\n Secured,\n renderAuthorize,\n getAuthorityFunction,\n\n PageLoading,\n LoadingSvg,\n NoFoundPage,\n UserDisable,\n UserNoPermission,\n UserNoPagePermission,\n };\n "
|
|
9
|
+
content: "\n // \u5BFC\u5165\u7EC4\u4EF6\n import QrCodeModal from \"./components/QrCodeModal\";\n import CreateForm from \"./components/AddDrawerForm\";\n import MyFooterToolbar from \"./components/MyFooterToolbar\";\n import DropdownButton from \"./components/DropdownButton\";\n import DynamicIcon, { getAntdIconList } from \"./components/DynamicIcon\";\n import DynamicIconModal from \"./components/DynamicIconModal\";\n import HighlightStr from \"./components/HighlightStr\";\n import EditMultiLangForm from \"./components/EditMultiLangForm\";\n import MyColorPicker from \"./components/MyColorPicker\";\n import MySelect from \"./components/MySelect\";\n import MySelectLang from \"./components/MySelectLang\";\n import PermissionSelect from \"./components/PermissionSelect\";\n import DataPermissionSelect from \"./components/DataPermissionSelect\";\n import UTCDatePicker from \"./components/UTCDatePicker\";\n import ProFormUTCDatePicker from \"./components/ProFormUTCDatePicker\";\n import UTCRangePicker from \"./components/UTCRangePicker\";\n import ProFormUTCRangePicker from \"./components/ProFormUTCRangePicker\";\n import RandomAvatar from \"./components/RandomAvatar\";\n import RefDrawerForm from \"./components/RefDrawerForm\";\n import UpdateForm from \"./components/UpdateForm\";\n import ViewTableItemDrawer from \"./components/ViewTableItemDrawer\";\n import WangEditor from \"./components/WangEditor\";\n import WangEditorView from \"./components/WangEditorView\";\n import MyUpload from \"./components/MyUpload\";\n import CopyButton from \"./components/CopyButton\";\n import ImportExecl from \"./components/ImportExecl\";\n import MyPageContainer from \"./components/MyPageContainer\";\n import MyReactEcharts from \"./components/MyReactEcharts\";\n import MyTagList from \"./components/MyTagList\";\n import VolumeFormItem from \"./components/VolumeFormItem\";\n import ReportTable from \"./components/ReportTable\";\n import DicDropDownList from \"./components/DicDropDownList\";\n import ActionLogDrawer from \"./components/ActionLogDrawer\";\n import DndTabs from \"./components/DndTabs\";\n import DndTag from \"./components/DndTag\";\n import TimeTypeSelect from \"./components/TimeTypeSelect\";\n import ImportDataUpload from \"./components/ImportDataUpload\";\n import PDFWrapper from \"./components/PDFWrapper\";\n import ExportPageWrapper from \"./components/ExportPageWrapper\";\n import { PageExporter } from \"./utils/exportPage\";\n import MySetps from \"./components/MySetps\";\n import CrudTable from \"./components/CrudTable\";\n\n import MenuFooter from \"./components/MenuFooter\";\n import GlobalHeader from \"./components/GlobalHeader\";\n import GlobalFooter from \"./components/GlobalFooter\";\n import AvatarDropdown from \"./components/AvatarDropdown\";\n import HeaderSearch from \"./components/HeaderSearch\";\n import ThemeSwitch from \"./components/ThemeSwitch\";\n import KeepAliveTabs from \"./components/KeepAliveTabs\";\n import KeepAliveDndTabs from \"./components/KeepAliveDndTabs\";\n\n import Authorized from \"./components/Authorized\";\n import AuthorizedRoute from \"./components/AuthorizedRoute\";\n import AuthorizeRender from \"./components/AuthorizeRender\";\n import CheckPermissions from \"./components/CheckPermissions\";\n import PromiseRender from \"./components/PromiseRender\";\n import Secured from \"./components/Secured\";\n import renderAuthorize from \"./components/renderAuthorize\";\n import { getAuthorityFunction } from \"./utils/authorityFunction\";\n\n import LoadingSvg from \"./components/LoadingSvg\";\n import PageLoading from \"./components/PageLoading\";\n import NoFoundPage from \"./components/NoFoundPage\";\n import UserDisable from \"./components/UserDisable\";\n import UserNoPermission from \"./components/UserNoPermission\";\n import UserNoPagePermission from \"./components/UserNoPagePermission\";\n\n import useAction from \"./hooks/useAction\";\n import useFormatLocale from \"./hooks/useFormatLocale\";\n import useActionLocales from \"./hooks/useActionLocales\";\n import useQueryTableList from \"./hooks/useQueryTableList\";\n import useAuthority from \"./hooks/useAuthority\";\n import useColumnTitle, { useBatchColumnTitles } from \"./hooks/useColumnTitle\";\n import useMemoizedFn from \"./hooks/useMemoizedFn\";\n import { useKeepAliveTabs } from \"./hooks/useKeepAliveTabs\";\n import { usePageExport } from \"./hooks/usePageExport\";\n import { useRouteAuth } from \"./hooks/useRouteAuth\";\n import { useFetchList } from \"./hooks/useFetchList\";\n\n // \u5BFC\u51FAhooks\n export {\n useAction,\n useFormatLocale,\n useActionLocales,\n useQueryTableList,\n useAuthority,\n useColumnTitle,\n useBatchColumnTitles,\n useMemoizedFn,\n useKeepAliveTabs,\n usePageExport,\n useRouteAuth,\n useFetchList,\n }\n\n // \u5BFC\u51FA\u7EC4\u4EF6\n export { \n QrCodeModal, \n CreateForm, \n MyFooterToolbar,\n DropdownButton,\n DynamicIcon,\n DynamicIconModal,\n HighlightStr,\n getAntdIconList,\n EditMultiLangForm,\n MyColorPicker,\n MySelect,\n MySelectLang,\n PermissionSelect,\n DataPermissionSelect,\n UTCDatePicker,\n ProFormUTCDatePicker,\n UTCRangePicker,\n ProFormUTCRangePicker,\n RandomAvatar,\n RefDrawerForm,\n UpdateForm,\n ViewTableItemDrawer,\n WangEditor,\n WangEditorView,\n MyUpload,\n CopyButton,\n ImportExecl,\n MyPageContainer,\n MyReactEcharts,\n MyTagList,\n VolumeFormItem,\n ReportTable,\n DicDropDownList,\n ActionLogDrawer,\n DndTabs,\n DndTag,\n TimeTypeSelect,\n ImportDataUpload,\n PDFWrapper,\n ExportPageWrapper,\n PageExporter,\n MySetps,\n CrudTable,\n\n MenuFooter,\n GlobalHeader,\n GlobalFooter,\n AvatarDropdown,\n HeaderSearch,\n ThemeSwitch,\n KeepAliveTabs,\n KeepAliveDndTabs,\n \n Authorized,\n AuthorizedRoute,\n AuthorizeRender,\n CheckPermissions,\n PromiseRender,\n Secured,\n renderAuthorize,\n getAuthorityFunction,\n\n PageLoading,\n LoadingSvg,\n NoFoundPage,\n UserDisable,\n UserNoPermission,\n UserNoPagePermission,\n };\n "
|
|
10
10
|
};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
8
|
+
var DEFAULT_STATUS_ENABLED_VALUES = ['1', 'Y'];
|
|
9
|
+
var getStatusEnabledValues = function getStatusEnabledValues(cfmmUIConfig) {
|
|
10
|
+
// 没有配置使用默认值
|
|
11
|
+
if (!cfmmUIConfig || _typeof(cfmmUIConfig) !== 'object' || Array.isArray(cfmmUIConfig)) {
|
|
12
|
+
return DEFAULT_STATUS_ENABLED_VALUES;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
// 获取状态启用值
|
|
16
|
+
var statusEnabledValues = cfmmUIConfig.statusEnabledValues;
|
|
17
|
+
// 如果状态启用值不是数组,则返回默认值
|
|
18
|
+
if (!Array.isArray(statusEnabledValues)) {
|
|
19
|
+
return DEFAULT_STATUS_ENABLED_VALUES;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
// 过滤掉非字符串和数字的值
|
|
23
|
+
var normalizedValues = statusEnabledValues.map(function (value) {
|
|
24
|
+
return value === null || value === void 0 ? void 0 : value.toString().trim();
|
|
25
|
+
}).filter(function (value) {
|
|
26
|
+
return Boolean(value);
|
|
27
|
+
});
|
|
28
|
+
return normalizedValues.length > 0 ? normalizedValues : DEFAULT_STATUS_ENABLED_VALUES;
|
|
29
|
+
};
|
|
30
|
+
var _default = exports.default = function _default(api) {
|
|
31
|
+
var statusEnabledValues = getStatusEnabledValues(api.userConfig.cfmmUI);
|
|
32
|
+
return {
|
|
33
|
+
path: 'statusConfig.ts',
|
|
34
|
+
content: "\n export const STATUS_ENABLED_VALUES = ".concat(JSON.stringify(statusEnabledValues), ";\n ")
|
|
35
|
+
};
|
|
36
|
+
};
|
|
@@ -8,5 +8,5 @@ var _types = require("../types");
|
|
|
8
8
|
// 修改方法,不再尝试读取外部文件
|
|
9
9
|
var _default = exports.default = {
|
|
10
10
|
path: 'types.d.ts',
|
|
11
|
-
content: "\n import React from 'react';\n import { ModalProps, DrawerProps, SelectProps, DatePickerProps, UploadProps, UploadFile, TooltipProps, ButtonProps, TabsProps, SwitchProps, FloatButtonProps, StepsProps, FlexProps, TagProps } from 'antd';\n import { PresetColorType, PresetStatusColorType } from \"antd/lib/_util/colors\";\n import { AutoCompleteProps } from 'antd/es/auto-complete';\n import { RangePickerProps } from 'antd/lib/date-picker';\n import { LiteralUnion } from \"antd/lib/_util/type\";\n import { IconComponentProps } from '@ant-design/icons/lib/components/Icon';\n import { ActionType, ProFormItemProps, ProColumns, ProTableProps, DrawerFormProps, ModalFormProps, PageContainerProps, ProFormInstance } from '@ant-design/pro-components';\n import dayjs, { OpUnitType } from 'dayjs';\n import { IEditorConfig, IToolbarConfig } from '@wangeditor/editor';\n import type { DragEndEvent } from '@dnd-kit/core';\n import { fileTypeMap } from './components'; \n import { ExcelExportOptions } from './utils/excelHelper';\n import { HandleImportListOptions } from './utils/importHelper';\n\n\n ".concat(_types.servicesTypes, "\n\n ").concat(_types.HighlightStrTypes, "\n\n ").concat(_types.DropdownButtonTypes, "\n\n ").concat(_types.DynamicIconTypes, "\n\n ").concat(_types.MyFooterToolbarTypes, "\n\n ").concat(_types.QrCodeModalTypes, "\n\n ").concat(_types.MenuFooterTypes, "\n\n ").concat(_types.EditMultiLangFormTypes, "\n\n ").concat(_types.MySelectTypes, "\n\n ").concat(_types.MySelectLangTypes, "\n\n ").concat(_types.PermissionSelectTypes, "\n\n ").concat(_types.DataPermissionSelectTypes, "\n\n ").concat(_types.DatePickerTypes, "\n\n ").concat(_types.RandomAvatarTypes, "\n\n ").concat(_types.RefDrawerFormTypes, "\n\n ").concat(_types.ViewTableItemDrawerTypes, "\n\n ").concat(_types.WangEditorTypes, "\n\n ").concat(_types.MyPageContainerTypes, "\n\n ").concat(_types.MyTagListTypes, "\n\n ").concat(_types.VolumeFormItemTypes, "\n\n ").concat(_types.ImportExeclTypes, "\n\n ").concat(_types.MyUploadTypes, "\n\n ").concat(_types.ReportTableTypes, "\n\n ").concat(_types.DicDropDownListTypes, "\n\n ").concat(_types.ActionLogDrawerTypes, "\n\n ").concat(_types.DndTabsTypes, "\n\n ").concat(_types.ImportDataUploadTypes, "\n\n ").concat(_types.AvatarDropdownTypes, "\n\n ").concat(_types.HeaderSearchTypes, "\n\n ").concat(_types.ThemeSwitchTypes, "\n\n ").concat(_types.GlobalHeaderTypes, "\n\n ").concat(_types.KeepAliveTabsTypes, "\n\n ").concat(_types.ExportPageWrapperTypes, "\n\n ").concat(_types.MySetpsTypes, "\n\n ").concat(_types.CrudTableTypes, "\n\n ").concat(_types.DndTagTypes, "\n ")
|
|
11
|
+
content: "\n import React from 'react';\n import { ModalProps, DrawerProps, SelectProps, DatePickerProps, UploadProps, UploadFile, TooltipProps, ButtonProps, TabsProps, SwitchProps, FloatButtonProps, StepsProps, FlexProps, TagProps } from 'antd';\n import { PresetColorType, PresetStatusColorType } from \"antd/lib/_util/colors\";\n import { AutoCompleteProps } from 'antd/es/auto-complete';\n import { RangePickerProps } from 'antd/lib/date-picker';\n import { LiteralUnion } from \"antd/lib/_util/type\";\n import { IconComponentProps } from '@ant-design/icons/lib/components/Icon';\n import { ActionType, ProFormItemProps, ProColumns, ProTableProps, DrawerFormProps, ModalFormProps, PageContainerProps, ProFormInstance } from '@ant-design/pro-components';\n import dayjs, { OpUnitType } from 'dayjs';\n import { IEditorConfig, IToolbarConfig } from '@wangeditor/editor';\n import type { DragEndEvent } from '@dnd-kit/core';\n import { fileTypeMap } from './components'; \n import { ExcelExportOptions } from './utils/excelHelper';\n import { HandleImportListOptions } from './utils/importHelper';\n\n\n ".concat(_types.servicesTypes, "\n\n ").concat(_types.HighlightStrTypes, "\n\n ").concat(_types.DropdownButtonTypes, "\n\n ").concat(_types.DynamicIconTypes, "\n\n ").concat(_types.MyFooterToolbarTypes, "\n\n ").concat(_types.QrCodeModalTypes, "\n\n ").concat(_types.MenuFooterTypes, "\n\n ").concat(_types.EditMultiLangFormTypes, "\n\n ").concat(_types.MySelectTypes, "\n\n ").concat(_types.MySelectLangTypes, "\n\n ").concat(_types.PermissionSelectTypes, "\n\n ").concat(_types.DataPermissionSelectTypes, "\n\n ").concat(_types.DatePickerTypes, "\n\n ").concat(_types.RandomAvatarTypes, "\n\n ").concat(_types.RefDrawerFormTypes, "\n\n ").concat(_types.ViewTableItemDrawerTypes, "\n\n ").concat(_types.WangEditorTypes, "\n\n ").concat(_types.MyPageContainerTypes, "\n\n ").concat(_types.MyTagListTypes, "\n\n ").concat(_types.VolumeFormItemTypes, "\n\n ").concat(_types.ImportExeclTypes, "\n\n ").concat(_types.MyUploadTypes, "\n\n ").concat(_types.ReportTableTypes, "\n\n ").concat(_types.DicDropDownListTypes, "\n\n ").concat(_types.ActionLogDrawerTypes, "\n\n ").concat(_types.DndTabsTypes, "\n\n ").concat(_types.ImportDataUploadTypes, "\n\n ").concat(_types.AvatarDropdownTypes, "\n\n ").concat(_types.HeaderSearchTypes, "\n\n ").concat(_types.ThemeSwitchTypes, "\n\n ").concat(_types.GlobalHeaderTypes, "\n\n ").concat(_types.KeepAliveTabsTypes, "\n\n ").concat(_types.ExportPageWrapperTypes, "\n\n ").concat(_types.MySetpsTypes, "\n\n ").concat(_types.CrudTableTypes, "\n\n ").concat(_types.DndTagTypes, "\n\n ").concat(_types.UseFetchListTypes, "\n ")
|
|
12
12
|
};
|
|
@@ -4,6 +4,7 @@ import { DataNode } from 'rc-tree/lib/interface';
|
|
|
4
4
|
import React, { useEffect, useState } from 'react';
|
|
5
5
|
import { useIntl, request } from '@umijs/max';
|
|
6
6
|
import { BASE_API } from "../constants";
|
|
7
|
+
import { STATUS_ENABLED_VALUES } from '../statusConfig';
|
|
7
8
|
import { PermissionSelectFormProps, MenuItem, PermissionItem } from "../types";
|
|
8
9
|
|
|
9
10
|
export async function queryAllMenus() {
|
|
@@ -19,7 +20,7 @@ export async function queryAllPermissions() {
|
|
|
19
20
|
}
|
|
20
21
|
|
|
21
22
|
const checkStatus = (status: string): boolean => {
|
|
22
|
-
return status
|
|
23
|
+
return STATUS_ENABLED_VALUES.includes(status?.toString());
|
|
23
24
|
}
|
|
24
25
|
|
|
25
26
|
/**
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { useEffect, useState } from 'react';
|
|
2
|
+
import { FetchListOptions } from '../types';
|
|
3
|
+
import useQueryTableList from './useQueryTableList';
|
|
4
|
+
import useMemoizedFn from './useMemoizedFn';
|
|
5
|
+
|
|
6
|
+
type FetchFn<T = any, K = API.TableListParams> = (params?: K) => Promise<API.Result_Base_List<T[]>>;
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* 查询菜单列表
|
|
10
|
+
* @param fetchFn 请求函数
|
|
11
|
+
* @param params 查询参数
|
|
12
|
+
* @param options 查询选项
|
|
13
|
+
* @param options.manualFetch 是否手动查询列表
|
|
14
|
+
* @param options.baseLocalCode 基础本地代码
|
|
15
|
+
* @param options.baseLocalName 基础本地名称
|
|
16
|
+
* @param options.config 查询配置
|
|
17
|
+
* @param options.config.showLoadingMsg 是否显示message.loading
|
|
18
|
+
* @param options.config.waitingMsg loading时的提示内容
|
|
19
|
+
* @param options.config.failMsg 查询失败时的提示内容
|
|
20
|
+
* @param options.afterFetch 查询后回调
|
|
21
|
+
* @returns {
|
|
22
|
+
* list: 列表数据
|
|
23
|
+
* loading: 是否加载中
|
|
24
|
+
* error: 错误信息
|
|
25
|
+
* fetchList: 查询列表函数
|
|
26
|
+
* reloadList: 重新查询列表函数
|
|
27
|
+
* }
|
|
28
|
+
*/
|
|
29
|
+
const useFetchList = <T extends Record<string, any>, K = API.TableListParams>(
|
|
30
|
+
fetchFn: FetchFn<T, K>,
|
|
31
|
+
params?: K,
|
|
32
|
+
options?: FetchListOptions<T>,
|
|
33
|
+
) => {
|
|
34
|
+
const { manualFetch, config, baseLocalCode, baseLocalName, afterFetch } = options || {};
|
|
35
|
+
const { queryList, loading, error } = useQueryTableList({ baseLocalCode, baseLocalName });
|
|
36
|
+
const [list, setList] = useState<T[]>([]);
|
|
37
|
+
|
|
38
|
+
const reloadList = useMemoizedFn(async () => {
|
|
39
|
+
return await fetchList(params);
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
const fetchList = useMemoizedFn(async (params?: K) => {
|
|
43
|
+
const response = await queryList(params, {
|
|
44
|
+
queryFn: fetchFn,
|
|
45
|
+
showLoadingMsg: false,
|
|
46
|
+
...config,
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
if (response.success && response.data) {
|
|
50
|
+
setList(response.data);
|
|
51
|
+
afterFetch?.(response);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
return response;
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
useEffect(() => {
|
|
58
|
+
if (!manualFetch) {
|
|
59
|
+
fetchList(params);
|
|
60
|
+
}
|
|
61
|
+
}, []);
|
|
62
|
+
|
|
63
|
+
return { list, loading, error, fetchList, reloadList };
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
export { useFetchList };
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { CurrentUser } from '../types';
|
|
2
2
|
import { history, useLocation, useMemoizedFn, useParams } from '@umijs/max';
|
|
3
3
|
import { useMemo } from 'react';
|
|
4
|
+
import { STATUS_ENABLED_VALUES } from '../statusConfig';
|
|
4
5
|
|
|
5
6
|
export type UserStatusRedirect = '/400' | '/401' | '/403' | '/404';
|
|
6
7
|
|
|
@@ -12,6 +13,8 @@ const whiteListRoutes = ['/400', '/401', '/403', '/404', '/login', '/'];
|
|
|
12
13
|
* @returns 权限检查相关状态和方法
|
|
13
14
|
*/
|
|
14
15
|
export const useRouteAuth = (currentUser?: CurrentUser) => {
|
|
16
|
+
const checkStatus = useMemoizedFn((status: string | number) => STATUS_ENABLED_VALUES.includes(status.toString()));
|
|
17
|
+
|
|
15
18
|
const params = useParams();
|
|
16
19
|
const { pathname } = useLocation();
|
|
17
20
|
|
|
@@ -36,7 +39,7 @@ export const useRouteAuth = (currentUser?: CurrentUser) => {
|
|
|
36
39
|
* 无需再区分「存在性」与「权限」两份列表。
|
|
37
40
|
*/
|
|
38
41
|
const validMenus = useMemo(
|
|
39
|
-
() => currentUser?.menus?.filter((item: any) => item.status
|
|
42
|
+
() => currentUser?.menus?.filter((item: any) => checkStatus(item.status)) ?? [],
|
|
40
43
|
[currentUser?.menus],
|
|
41
44
|
);
|
|
42
45
|
|
package/dist/esm/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { readFileSync, readdirSync } from 'fs';
|
|
2
2
|
import { join } from 'path';
|
|
3
|
-
import { runtime, writeConstants, writeIndex, writeTypes } from "./writeTmpFile";
|
|
3
|
+
import { runtime, writeConstants, writeIndex, writeStatusConfig, writeTypes } from "./writeTmpFile";
|
|
4
4
|
import dayjs from 'dayjs';
|
|
5
5
|
import 'dayjs/locale/th';
|
|
6
6
|
import 'dayjs/locale/zh-cn';
|
|
@@ -31,14 +31,24 @@ var getContentAndFileType = function getContentAndFileType(filePath) {
|
|
|
31
31
|
export default (function (api) {
|
|
32
32
|
// See https://umijs.org/docs/guides/plugins
|
|
33
33
|
api.describe({
|
|
34
|
-
key: 'cfmmUI'
|
|
35
|
-
//
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
34
|
+
key: 'cfmmUI',
|
|
35
|
+
// 插件默认启用;仅在有自定义参数时才需要配置 cfmmUI
|
|
36
|
+
/**
|
|
37
|
+
* export default {
|
|
38
|
+
* cfmmUI: {
|
|
39
|
+
* statusEnabledValues: ['Y'], // 或 ['1', 'Y']
|
|
40
|
+
* },
|
|
41
|
+
* }
|
|
42
|
+
*/
|
|
43
|
+
config: {
|
|
44
|
+
schema: function schema(joi) {
|
|
45
|
+
// 配置状态字段,支持字符串和数字的数组
|
|
46
|
+
return joi.object({
|
|
47
|
+
statusEnabledValues: joi.array().items(joi.alternatives().try(joi.string(), joi.number())).min(1)
|
|
48
|
+
});
|
|
49
|
+
},
|
|
50
|
+
onChange: api.ConfigChangeType.regenerateTmpFiles
|
|
51
|
+
}
|
|
42
52
|
// enableBy: api.EnableBy.config,
|
|
43
53
|
});
|
|
44
54
|
|
|
@@ -105,6 +115,7 @@ export default (function (api) {
|
|
|
105
115
|
api.writeTmpFile(runtime);
|
|
106
116
|
api.writeTmpFile(writeIndex);
|
|
107
117
|
api.writeTmpFile(writeConstants(api));
|
|
118
|
+
api.writeTmpFile(writeStatusConfig(api));
|
|
108
119
|
api.writeTmpFile(writeTypes);
|
|
109
120
|
});
|
|
110
121
|
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const UseFetchListTypes = "\n/**\n * \u67E5\u8BE2\u5217\u8868\u9009\u9879\u7684hooks\n * \u4F7F\u7528\u793A\u4F8B\uFF1A\n * const { list, loading, error, fetchList, reloadList } = useFetchList<TableListItem, TableListParams>(\n * queryMaterial,\n * params,\n * {\n * baseLocalCode,\n * baseLocalName,\n * ...options,\n * },\n * );\n */\nexport type FetchListOptions<T extends Record<string, any> = any> = {\n /**\n * \u662F\u5426\u624B\u52A8\u67E5\u8BE2\u5217\u8868\n */\n manualFetch?: boolean;\n /**\n * \u57FA\u7840\u672C\u5730\u4EE3\u7801\n */\n baseLocalCode?: string;\n /**\n * \u57FA\u7840\u672C\u5730\u540D\u79F0\n */\n baseLocalName?: string;\n /**\n * \u67E5\u8BE2\u914D\u7F6E\n */\n config?: {\n /**\n * \u662F\u5426\u663E\u793Amessage.loading\n */\n showLoadingMsg?: boolean;\n /**\n * loading\u65F6\u7684\u63D0\u793A\u5185\u5BB9\n */\n waitingMsg?: string;\n /**\n * \u67E5\u8BE2\u5931\u8D25\u65F6\u7684\u63D0\u793A\u5185\u5BB9\n */\n failMsg?: string;\n };\n /**\n * \u67E5\u8BE2\u540E\u56DE\u8C03\n */\n afterFetch?: (response: API.Result_TableListType<T>) => void;\n};\n";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export var UseFetchListTypes = "\n/**\n * \u67E5\u8BE2\u5217\u8868\u9009\u9879\u7684hooks\n * \u4F7F\u7528\u793A\u4F8B\uFF1A\n * const { list, loading, error, fetchList, reloadList } = useFetchList<TableListItem, TableListParams>(\n * queryMaterial,\n * params,\n * {\n * baseLocalCode,\n * baseLocalName,\n * ...options,\n * },\n * );\n */\nexport type FetchListOptions<T extends Record<string, any> = any> = {\n /**\n * \u662F\u5426\u624B\u52A8\u67E5\u8BE2\u5217\u8868\n */\n manualFetch?: boolean;\n /**\n * \u57FA\u7840\u672C\u5730\u4EE3\u7801\n */\n baseLocalCode?: string;\n /**\n * \u57FA\u7840\u672C\u5730\u540D\u79F0\n */\n baseLocalName?: string;\n /**\n * \u67E5\u8BE2\u914D\u7F6E\n */\n config?: {\n /**\n * \u662F\u5426\u663E\u793Amessage.loading\n */\n showLoadingMsg?: boolean;\n /**\n * loading\u65F6\u7684\u63D0\u793A\u5185\u5BB9\n */\n waitingMsg?: string;\n /**\n * \u67E5\u8BE2\u5931\u8D25\u65F6\u7684\u63D0\u793A\u5185\u5BB9\n */\n failMsg?: string;\n };\n /**\n * \u67E5\u8BE2\u540E\u56DE\u8C03\n */\n afterFetch?: (response: API.Result_TableListType<T>) => void;\n};\n";
|
|
@@ -34,3 +34,4 @@ export { ExportPageWrapperTypes } from "./ExportPageWrapperTypes";
|
|
|
34
34
|
export { MySetpsTypes } from "./MySetpsTypes";
|
|
35
35
|
export { CrudTableTypes } from "./CrudTableTypes";
|
|
36
36
|
export { DndTagTypes } from "./DndTagTypes";
|
|
37
|
+
export { UseFetchListTypes } from "./UseFetchListTypes";
|
package/dist/esm/types/index.js
CHANGED
|
@@ -33,4 +33,5 @@ export { KeepAliveTabsTypes } from "./KeepAliveTabsTypes";
|
|
|
33
33
|
export { ExportPageWrapperTypes } from "./ExportPageWrapperTypes";
|
|
34
34
|
export { MySetpsTypes } from "./MySetpsTypes";
|
|
35
35
|
export { CrudTableTypes } from "./CrudTableTypes";
|
|
36
|
-
export { DndTagTypes } from "./DndTagTypes";
|
|
36
|
+
export { DndTagTypes } from "./DndTagTypes";
|
|
37
|
+
export { UseFetchListTypes } from "./UseFetchListTypes";
|
|
@@ -2,4 +2,5 @@ import runtime from "./runtime";
|
|
|
2
2
|
import writeIndex from "./writeIndex";
|
|
3
3
|
import writeTypes from "./writeTypes";
|
|
4
4
|
import writeConstants from "./writeConstants";
|
|
5
|
-
|
|
5
|
+
import writeStatusConfig from './writeStatusConfig';
|
|
6
|
+
export { runtime, writeIndex, writeTypes, writeConstants, writeStatusConfig };
|
|
@@ -2,4 +2,5 @@ import runtime from "./runtime";
|
|
|
2
2
|
import writeIndex from "./writeIndex";
|
|
3
3
|
import writeTypes from "./writeTypes";
|
|
4
4
|
import writeConstants from "./writeConstants";
|
|
5
|
-
|
|
5
|
+
import writeStatusConfig from "./writeStatusConfig";
|
|
6
|
+
export { runtime, writeIndex, writeTypes, writeConstants, writeStatusConfig };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export default {
|
|
2
2
|
path: "index.tsx",
|
|
3
|
-
content: "\n // \u5BFC\u5165\u7EC4\u4EF6\n import QrCodeModal from \"./components/QrCodeModal\";\n import CreateForm from \"./components/AddDrawerForm\";\n import MyFooterToolbar from \"./components/MyFooterToolbar\";\n import DropdownButton from \"./components/DropdownButton\";\n import DynamicIcon, { getAntdIconList } from \"./components/DynamicIcon\";\n import DynamicIconModal from \"./components/DynamicIconModal\";\n import HighlightStr from \"./components/HighlightStr\";\n import EditMultiLangForm from \"./components/EditMultiLangForm\";\n import MyColorPicker from \"./components/MyColorPicker\";\n import MySelect from \"./components/MySelect\";\n import MySelectLang from \"./components/MySelectLang\";\n import PermissionSelect from \"./components/PermissionSelect\";\n import DataPermissionSelect from \"./components/DataPermissionSelect\";\n import UTCDatePicker from \"./components/UTCDatePicker\";\n import ProFormUTCDatePicker from \"./components/ProFormUTCDatePicker\";\n import UTCRangePicker from \"./components/UTCRangePicker\";\n import ProFormUTCRangePicker from \"./components/ProFormUTCRangePicker\";\n import RandomAvatar from \"./components/RandomAvatar\";\n import RefDrawerForm from \"./components/RefDrawerForm\";\n import UpdateForm from \"./components/UpdateForm\";\n import ViewTableItemDrawer from \"./components/ViewTableItemDrawer\";\n import WangEditor from \"./components/WangEditor\";\n import WangEditorView from \"./components/WangEditorView\";\n import MyUpload from \"./components/MyUpload\";\n import CopyButton from \"./components/CopyButton\";\n import ImportExecl from \"./components/ImportExecl\";\n import MyPageContainer from \"./components/MyPageContainer\";\n import MyReactEcharts from \"./components/MyReactEcharts\";\n import MyTagList from \"./components/MyTagList\";\n import VolumeFormItem from \"./components/VolumeFormItem\";\n import ReportTable from \"./components/ReportTable\";\n import DicDropDownList from \"./components/DicDropDownList\";\n import ActionLogDrawer from \"./components/ActionLogDrawer\";\n import DndTabs from \"./components/DndTabs\";\n import DndTag from \"./components/DndTag\";\n import TimeTypeSelect from \"./components/TimeTypeSelect\";\n import ImportDataUpload from \"./components/ImportDataUpload\";\n import PDFWrapper from \"./components/PDFWrapper\";\n import ExportPageWrapper from \"./components/ExportPageWrapper\";\n import { PageExporter } from \"./utils/exportPage\";\n import MySetps from \"./components/MySetps\";\n import CrudTable from \"./components/CrudTable\";\n\n import MenuFooter from \"./components/MenuFooter\";\n import GlobalHeader from \"./components/GlobalHeader\";\n import GlobalFooter from \"./components/GlobalFooter\";\n import AvatarDropdown from \"./components/AvatarDropdown\";\n import HeaderSearch from \"./components/HeaderSearch\";\n import ThemeSwitch from \"./components/ThemeSwitch\";\n import KeepAliveTabs from \"./components/KeepAliveTabs\";\n import KeepAliveDndTabs from \"./components/KeepAliveDndTabs\";\n\n import Authorized from \"./components/Authorized\";\n import AuthorizedRoute from \"./components/AuthorizedRoute\";\n import AuthorizeRender from \"./components/AuthorizeRender\";\n import CheckPermissions from \"./components/CheckPermissions\";\n import PromiseRender from \"./components/PromiseRender\";\n import Secured from \"./components/Secured\";\n import renderAuthorize from \"./components/renderAuthorize\";\n import { getAuthorityFunction } from \"./utils/authorityFunction\";\n\n import LoadingSvg from \"./components/LoadingSvg\";\n import PageLoading from \"./components/PageLoading\";\n import NoFoundPage from \"./components/NoFoundPage\";\n import UserDisable from \"./components/UserDisable\";\n import UserNoPermission from \"./components/UserNoPermission\";\n import UserNoPagePermission from \"./components/UserNoPagePermission\";\n\n import useAction from \"./hooks/useAction\";\n import useFormatLocale from \"./hooks/useFormatLocale\";\n import useActionLocales from \"./hooks/useActionLocales\";\n import useQueryTableList from \"./hooks/useQueryTableList\";\n import useAuthority from \"./hooks/useAuthority\";\n import useColumnTitle, { useBatchColumnTitles } from \"./hooks/useColumnTitle\";\n import useMemoizedFn from \"./hooks/useMemoizedFn\";\n import { useKeepAliveTabs } from \"./hooks/useKeepAliveTabs\";\n import { usePageExport } from \"./hooks/usePageExport\";\n import { useRouteAuth } from \"./hooks/useRouteAuth\";\n\n // \u5BFC\u51FAhooks\n export {\n useAction,\n useFormatLocale,\n useActionLocales,\n useQueryTableList,\n useAuthority,\n useColumnTitle,\n useBatchColumnTitles,\n useMemoizedFn,\n useKeepAliveTabs,\n usePageExport,\n useRouteAuth,\n }\n\n // \u5BFC\u51FA\u7EC4\u4EF6\n export { \n QrCodeModal, \n CreateForm, \n MyFooterToolbar,\n DropdownButton,\n DynamicIcon,\n DynamicIconModal,\n HighlightStr,\n getAntdIconList,\n EditMultiLangForm,\n MyColorPicker,\n MySelect,\n MySelectLang,\n PermissionSelect,\n DataPermissionSelect,\n UTCDatePicker,\n ProFormUTCDatePicker,\n UTCRangePicker,\n ProFormUTCRangePicker,\n RandomAvatar,\n RefDrawerForm,\n UpdateForm,\n ViewTableItemDrawer,\n WangEditor,\n WangEditorView,\n MyUpload,\n CopyButton,\n ImportExecl,\n MyPageContainer,\n MyReactEcharts,\n MyTagList,\n VolumeFormItem,\n ReportTable,\n DicDropDownList,\n ActionLogDrawer,\n DndTabs,\n DndTag,\n TimeTypeSelect,\n ImportDataUpload,\n PDFWrapper,\n ExportPageWrapper,\n PageExporter,\n MySetps,\n CrudTable,\n\n MenuFooter,\n GlobalHeader,\n GlobalFooter,\n AvatarDropdown,\n HeaderSearch,\n ThemeSwitch,\n KeepAliveTabs,\n KeepAliveDndTabs,\n \n Authorized,\n AuthorizedRoute,\n AuthorizeRender,\n CheckPermissions,\n PromiseRender,\n Secured,\n renderAuthorize,\n getAuthorityFunction,\n\n PageLoading,\n LoadingSvg,\n NoFoundPage,\n UserDisable,\n UserNoPermission,\n UserNoPagePermission,\n };\n "
|
|
3
|
+
content: "\n // \u5BFC\u5165\u7EC4\u4EF6\n import QrCodeModal from \"./components/QrCodeModal\";\n import CreateForm from \"./components/AddDrawerForm\";\n import MyFooterToolbar from \"./components/MyFooterToolbar\";\n import DropdownButton from \"./components/DropdownButton\";\n import DynamicIcon, { getAntdIconList } from \"./components/DynamicIcon\";\n import DynamicIconModal from \"./components/DynamicIconModal\";\n import HighlightStr from \"./components/HighlightStr\";\n import EditMultiLangForm from \"./components/EditMultiLangForm\";\n import MyColorPicker from \"./components/MyColorPicker\";\n import MySelect from \"./components/MySelect\";\n import MySelectLang from \"./components/MySelectLang\";\n import PermissionSelect from \"./components/PermissionSelect\";\n import DataPermissionSelect from \"./components/DataPermissionSelect\";\n import UTCDatePicker from \"./components/UTCDatePicker\";\n import ProFormUTCDatePicker from \"./components/ProFormUTCDatePicker\";\n import UTCRangePicker from \"./components/UTCRangePicker\";\n import ProFormUTCRangePicker from \"./components/ProFormUTCRangePicker\";\n import RandomAvatar from \"./components/RandomAvatar\";\n import RefDrawerForm from \"./components/RefDrawerForm\";\n import UpdateForm from \"./components/UpdateForm\";\n import ViewTableItemDrawer from \"./components/ViewTableItemDrawer\";\n import WangEditor from \"./components/WangEditor\";\n import WangEditorView from \"./components/WangEditorView\";\n import MyUpload from \"./components/MyUpload\";\n import CopyButton from \"./components/CopyButton\";\n import ImportExecl from \"./components/ImportExecl\";\n import MyPageContainer from \"./components/MyPageContainer\";\n import MyReactEcharts from \"./components/MyReactEcharts\";\n import MyTagList from \"./components/MyTagList\";\n import VolumeFormItem from \"./components/VolumeFormItem\";\n import ReportTable from \"./components/ReportTable\";\n import DicDropDownList from \"./components/DicDropDownList\";\n import ActionLogDrawer from \"./components/ActionLogDrawer\";\n import DndTabs from \"./components/DndTabs\";\n import DndTag from \"./components/DndTag\";\n import TimeTypeSelect from \"./components/TimeTypeSelect\";\n import ImportDataUpload from \"./components/ImportDataUpload\";\n import PDFWrapper from \"./components/PDFWrapper\";\n import ExportPageWrapper from \"./components/ExportPageWrapper\";\n import { PageExporter } from \"./utils/exportPage\";\n import MySetps from \"./components/MySetps\";\n import CrudTable from \"./components/CrudTable\";\n\n import MenuFooter from \"./components/MenuFooter\";\n import GlobalHeader from \"./components/GlobalHeader\";\n import GlobalFooter from \"./components/GlobalFooter\";\n import AvatarDropdown from \"./components/AvatarDropdown\";\n import HeaderSearch from \"./components/HeaderSearch\";\n import ThemeSwitch from \"./components/ThemeSwitch\";\n import KeepAliveTabs from \"./components/KeepAliveTabs\";\n import KeepAliveDndTabs from \"./components/KeepAliveDndTabs\";\n\n import Authorized from \"./components/Authorized\";\n import AuthorizedRoute from \"./components/AuthorizedRoute\";\n import AuthorizeRender from \"./components/AuthorizeRender\";\n import CheckPermissions from \"./components/CheckPermissions\";\n import PromiseRender from \"./components/PromiseRender\";\n import Secured from \"./components/Secured\";\n import renderAuthorize from \"./components/renderAuthorize\";\n import { getAuthorityFunction } from \"./utils/authorityFunction\";\n\n import LoadingSvg from \"./components/LoadingSvg\";\n import PageLoading from \"./components/PageLoading\";\n import NoFoundPage from \"./components/NoFoundPage\";\n import UserDisable from \"./components/UserDisable\";\n import UserNoPermission from \"./components/UserNoPermission\";\n import UserNoPagePermission from \"./components/UserNoPagePermission\";\n\n import useAction from \"./hooks/useAction\";\n import useFormatLocale from \"./hooks/useFormatLocale\";\n import useActionLocales from \"./hooks/useActionLocales\";\n import useQueryTableList from \"./hooks/useQueryTableList\";\n import useAuthority from \"./hooks/useAuthority\";\n import useColumnTitle, { useBatchColumnTitles } from \"./hooks/useColumnTitle\";\n import useMemoizedFn from \"./hooks/useMemoizedFn\";\n import { useKeepAliveTabs } from \"./hooks/useKeepAliveTabs\";\n import { usePageExport } from \"./hooks/usePageExport\";\n import { useRouteAuth } from \"./hooks/useRouteAuth\";\n import { useFetchList } from \"./hooks/useFetchList\";\n\n // \u5BFC\u51FAhooks\n export {\n useAction,\n useFormatLocale,\n useActionLocales,\n useQueryTableList,\n useAuthority,\n useColumnTitle,\n useBatchColumnTitles,\n useMemoizedFn,\n useKeepAliveTabs,\n usePageExport,\n useRouteAuth,\n useFetchList,\n }\n\n // \u5BFC\u51FA\u7EC4\u4EF6\n export { \n QrCodeModal, \n CreateForm, \n MyFooterToolbar,\n DropdownButton,\n DynamicIcon,\n DynamicIconModal,\n HighlightStr,\n getAntdIconList,\n EditMultiLangForm,\n MyColorPicker,\n MySelect,\n MySelectLang,\n PermissionSelect,\n DataPermissionSelect,\n UTCDatePicker,\n ProFormUTCDatePicker,\n UTCRangePicker,\n ProFormUTCRangePicker,\n RandomAvatar,\n RefDrawerForm,\n UpdateForm,\n ViewTableItemDrawer,\n WangEditor,\n WangEditorView,\n MyUpload,\n CopyButton,\n ImportExecl,\n MyPageContainer,\n MyReactEcharts,\n MyTagList,\n VolumeFormItem,\n ReportTable,\n DicDropDownList,\n ActionLogDrawer,\n DndTabs,\n DndTag,\n TimeTypeSelect,\n ImportDataUpload,\n PDFWrapper,\n ExportPageWrapper,\n PageExporter,\n MySetps,\n CrudTable,\n\n MenuFooter,\n GlobalHeader,\n GlobalFooter,\n AvatarDropdown,\n HeaderSearch,\n ThemeSwitch,\n KeepAliveTabs,\n KeepAliveDndTabs,\n \n Authorized,\n AuthorizedRoute,\n AuthorizeRender,\n CheckPermissions,\n PromiseRender,\n Secured,\n renderAuthorize,\n getAuthorityFunction,\n\n PageLoading,\n LoadingSvg,\n NoFoundPage,\n UserDisable,\n UserNoPermission,\n UserNoPagePermission,\n };\n "
|
|
4
4
|
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
+
var DEFAULT_STATUS_ENABLED_VALUES = ['1', 'Y'];
|
|
3
|
+
var getStatusEnabledValues = function getStatusEnabledValues(cfmmUIConfig) {
|
|
4
|
+
// 没有配置使用默认值
|
|
5
|
+
if (!cfmmUIConfig || _typeof(cfmmUIConfig) !== 'object' || Array.isArray(cfmmUIConfig)) {
|
|
6
|
+
return DEFAULT_STATUS_ENABLED_VALUES;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
// 获取状态启用值
|
|
10
|
+
var statusEnabledValues = cfmmUIConfig.statusEnabledValues;
|
|
11
|
+
// 如果状态启用值不是数组,则返回默认值
|
|
12
|
+
if (!Array.isArray(statusEnabledValues)) {
|
|
13
|
+
return DEFAULT_STATUS_ENABLED_VALUES;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
// 过滤掉非字符串和数字的值
|
|
17
|
+
var normalizedValues = statusEnabledValues.map(function (value) {
|
|
18
|
+
return value === null || value === void 0 ? void 0 : value.toString().trim();
|
|
19
|
+
}).filter(function (value) {
|
|
20
|
+
return Boolean(value);
|
|
21
|
+
});
|
|
22
|
+
return normalizedValues.length > 0 ? normalizedValues : DEFAULT_STATUS_ENABLED_VALUES;
|
|
23
|
+
};
|
|
24
|
+
export default (function (api) {
|
|
25
|
+
var statusEnabledValues = getStatusEnabledValues(api.userConfig.cfmmUI);
|
|
26
|
+
return {
|
|
27
|
+
path: 'statusConfig.ts',
|
|
28
|
+
content: "\n export const STATUS_ENABLED_VALUES = ".concat(JSON.stringify(statusEnabledValues), ";\n ")
|
|
29
|
+
};
|
|
30
|
+
});
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { DropdownButtonTypes, DynamicIconTypes, HighlightStrTypes, MyFooterToolbarTypes, QrCodeModalTypes, MenuFooterTypes, EditMultiLangFormTypes, MySelectTypes, MySelectLangTypes, PermissionSelectTypes, DataPermissionSelectTypes, DatePickerTypes, RandomAvatarTypes, RefDrawerFormTypes, ViewTableItemDrawerTypes, WangEditorTypes, servicesTypes, MyPageContainerTypes, MyTagListTypes, VolumeFormItemTypes, ImportExeclTypes, MyUploadTypes, ReportTableTypes, DicDropDownListTypes, ActionLogDrawerTypes, DndTabsTypes, ImportDataUploadTypes, AvatarDropdownTypes, HeaderSearchTypes, ThemeSwitchTypes, GlobalHeaderTypes, KeepAliveTabsTypes, ExportPageWrapperTypes, MySetpsTypes, CrudTableTypes, DndTagTypes } from "../types";
|
|
1
|
+
import { DropdownButtonTypes, DynamicIconTypes, HighlightStrTypes, MyFooterToolbarTypes, QrCodeModalTypes, MenuFooterTypes, EditMultiLangFormTypes, MySelectTypes, MySelectLangTypes, PermissionSelectTypes, DataPermissionSelectTypes, DatePickerTypes, RandomAvatarTypes, RefDrawerFormTypes, ViewTableItemDrawerTypes, WangEditorTypes, servicesTypes, MyPageContainerTypes, MyTagListTypes, VolumeFormItemTypes, ImportExeclTypes, MyUploadTypes, ReportTableTypes, DicDropDownListTypes, ActionLogDrawerTypes, DndTabsTypes, ImportDataUploadTypes, AvatarDropdownTypes, HeaderSearchTypes, ThemeSwitchTypes, GlobalHeaderTypes, KeepAliveTabsTypes, ExportPageWrapperTypes, MySetpsTypes, CrudTableTypes, DndTagTypes, UseFetchListTypes } from "../types";
|
|
2
2
|
|
|
3
3
|
// 修改方法,不再尝试读取外部文件
|
|
4
4
|
export default {
|
|
5
5
|
path: 'types.d.ts',
|
|
6
|
-
content: "\n import React from 'react';\n import { ModalProps, DrawerProps, SelectProps, DatePickerProps, UploadProps, UploadFile, TooltipProps, ButtonProps, TabsProps, SwitchProps, FloatButtonProps, StepsProps, FlexProps, TagProps } from 'antd';\n import { PresetColorType, PresetStatusColorType } from \"antd/lib/_util/colors\";\n import { AutoCompleteProps } from 'antd/es/auto-complete';\n import { RangePickerProps } from 'antd/lib/date-picker';\n import { LiteralUnion } from \"antd/lib/_util/type\";\n import { IconComponentProps } from '@ant-design/icons/lib/components/Icon';\n import { ActionType, ProFormItemProps, ProColumns, ProTableProps, DrawerFormProps, ModalFormProps, PageContainerProps, ProFormInstance } from '@ant-design/pro-components';\n import dayjs, { OpUnitType } from 'dayjs';\n import { IEditorConfig, IToolbarConfig } from '@wangeditor/editor';\n import type { DragEndEvent } from '@dnd-kit/core';\n import { fileTypeMap } from './components'; \n import { ExcelExportOptions } from './utils/excelHelper';\n import { HandleImportListOptions } from './utils/importHelper';\n\n\n ".concat(servicesTypes, "\n\n ").concat(HighlightStrTypes, "\n\n ").concat(DropdownButtonTypes, "\n\n ").concat(DynamicIconTypes, "\n\n ").concat(MyFooterToolbarTypes, "\n\n ").concat(QrCodeModalTypes, "\n\n ").concat(MenuFooterTypes, "\n\n ").concat(EditMultiLangFormTypes, "\n\n ").concat(MySelectTypes, "\n\n ").concat(MySelectLangTypes, "\n\n ").concat(PermissionSelectTypes, "\n\n ").concat(DataPermissionSelectTypes, "\n\n ").concat(DatePickerTypes, "\n\n ").concat(RandomAvatarTypes, "\n\n ").concat(RefDrawerFormTypes, "\n\n ").concat(ViewTableItemDrawerTypes, "\n\n ").concat(WangEditorTypes, "\n\n ").concat(MyPageContainerTypes, "\n\n ").concat(MyTagListTypes, "\n\n ").concat(VolumeFormItemTypes, "\n\n ").concat(ImportExeclTypes, "\n\n ").concat(MyUploadTypes, "\n\n ").concat(ReportTableTypes, "\n\n ").concat(DicDropDownListTypes, "\n\n ").concat(ActionLogDrawerTypes, "\n\n ").concat(DndTabsTypes, "\n\n ").concat(ImportDataUploadTypes, "\n\n ").concat(AvatarDropdownTypes, "\n\n ").concat(HeaderSearchTypes, "\n\n ").concat(ThemeSwitchTypes, "\n\n ").concat(GlobalHeaderTypes, "\n\n ").concat(KeepAliveTabsTypes, "\n\n ").concat(ExportPageWrapperTypes, "\n\n ").concat(MySetpsTypes, "\n\n ").concat(CrudTableTypes, "\n\n ").concat(DndTagTypes, "\n ")
|
|
6
|
+
content: "\n import React from 'react';\n import { ModalProps, DrawerProps, SelectProps, DatePickerProps, UploadProps, UploadFile, TooltipProps, ButtonProps, TabsProps, SwitchProps, FloatButtonProps, StepsProps, FlexProps, TagProps } from 'antd';\n import { PresetColorType, PresetStatusColorType } from \"antd/lib/_util/colors\";\n import { AutoCompleteProps } from 'antd/es/auto-complete';\n import { RangePickerProps } from 'antd/lib/date-picker';\n import { LiteralUnion } from \"antd/lib/_util/type\";\n import { IconComponentProps } from '@ant-design/icons/lib/components/Icon';\n import { ActionType, ProFormItemProps, ProColumns, ProTableProps, DrawerFormProps, ModalFormProps, PageContainerProps, ProFormInstance } from '@ant-design/pro-components';\n import dayjs, { OpUnitType } from 'dayjs';\n import { IEditorConfig, IToolbarConfig } from '@wangeditor/editor';\n import type { DragEndEvent } from '@dnd-kit/core';\n import { fileTypeMap } from './components'; \n import { ExcelExportOptions } from './utils/excelHelper';\n import { HandleImportListOptions } from './utils/importHelper';\n\n\n ".concat(servicesTypes, "\n\n ").concat(HighlightStrTypes, "\n\n ").concat(DropdownButtonTypes, "\n\n ").concat(DynamicIconTypes, "\n\n ").concat(MyFooterToolbarTypes, "\n\n ").concat(QrCodeModalTypes, "\n\n ").concat(MenuFooterTypes, "\n\n ").concat(EditMultiLangFormTypes, "\n\n ").concat(MySelectTypes, "\n\n ").concat(MySelectLangTypes, "\n\n ").concat(PermissionSelectTypes, "\n\n ").concat(DataPermissionSelectTypes, "\n\n ").concat(DatePickerTypes, "\n\n ").concat(RandomAvatarTypes, "\n\n ").concat(RefDrawerFormTypes, "\n\n ").concat(ViewTableItemDrawerTypes, "\n\n ").concat(WangEditorTypes, "\n\n ").concat(MyPageContainerTypes, "\n\n ").concat(MyTagListTypes, "\n\n ").concat(VolumeFormItemTypes, "\n\n ").concat(ImportExeclTypes, "\n\n ").concat(MyUploadTypes, "\n\n ").concat(ReportTableTypes, "\n\n ").concat(DicDropDownListTypes, "\n\n ").concat(ActionLogDrawerTypes, "\n\n ").concat(DndTabsTypes, "\n\n ").concat(ImportDataUploadTypes, "\n\n ").concat(AvatarDropdownTypes, "\n\n ").concat(HeaderSearchTypes, "\n\n ").concat(ThemeSwitchTypes, "\n\n ").concat(GlobalHeaderTypes, "\n\n ").concat(KeepAliveTabsTypes, "\n\n ").concat(ExportPageWrapperTypes, "\n\n ").concat(MySetpsTypes, "\n\n ").concat(CrudTableTypes, "\n\n ").concat(DndTagTypes, "\n\n ").concat(UseFetchListTypes, "\n ")
|
|
7
7
|
};
|