vap1 0.4.5 → 0.4.7

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.
Files changed (72) hide show
  1. package/basetype.d.ts +4 -0
  2. package/components/Box/Box.d.ts +2 -2
  3. package/components/Box/Box.js +1 -1
  4. package/components/{SearchBar → SearchTool/SearchBar}/ActionButtons.d.ts +2 -2
  5. package/components/{SearchBar → SearchTool/SearchBar}/ActionButtons.js +5 -5
  6. package/components/{SearchBar → SearchTool/SearchBar}/ByField.js +4 -4
  7. package/components/{SearchBar → SearchTool/SearchBar}/ByKeyword.js +3 -3
  8. package/components/{SearchBar → SearchTool/SearchBar}/SearchField.d.ts +1 -1
  9. package/components/{SearchBar → SearchTool/SearchBar}/SearchTags.js +1 -1
  10. package/components/{SearchBar → SearchTool/SearchBar}/_register.d.ts +1 -1
  11. package/components/{SearchBar → SearchTool/SearchBar}/_register.js +3 -3
  12. package/components/SearchTool/SearchBar/index.d.ts +71 -0
  13. package/components/{SearchBar → SearchTool/SearchBar}/index.js +1 -1
  14. package/components/{SearchBar → SearchTool}/index.d.ts +1 -70
  15. package/components/SearchTool/index.js +2 -0
  16. package/components/Tables/ApiTable.d.ts +1 -1
  17. package/components/Tables/ApiTableModal.d.ts +1 -1
  18. package/components/Tables/Components/ActionBar.d.ts +1 -1
  19. package/components/Tables/Components/ActionBar.js +1 -1
  20. package/components/Tables/VTable.d.ts +4 -2
  21. package/components/Tables/index.d.ts +1 -1
  22. package/components/TreeSelect/STreeSelect.js +1 -1
  23. package/components/UForm/_FieldType.d.ts +1 -1
  24. package/components/UForm/_FieldType.js +4 -0
  25. package/components/UForm/_input.d.ts +1 -1
  26. package/components/_adapt/Col.d.ts +1 -1
  27. package/components/_common/UTitle.d.ts +1 -1
  28. package/components/_common/UTitle.js +1 -1
  29. package/components/index.d.ts +2 -2
  30. package/components/index.js +1 -1
  31. package/deps/app-data/Const.d.ts +68 -3
  32. package/deps/app-data/Const.js +47 -3
  33. package/deps/app-data/TimeConst.d.ts +0 -0
  34. package/deps/app-data/TimeConst.js +58 -0
  35. package/deps/app-data/useSource.d.ts +22 -0
  36. package/deps/app-data/useSource.js +243 -162
  37. package/index.d.ts +1 -1
  38. package/index.js +1 -1
  39. package/package.json +1 -1
  40. package/utils/Ajax.js +12 -9
  41. package/utils/Format.js +5 -10
  42. package/utils/Global.d.ts +34 -2
  43. package/utils/Global.js +17 -1
  44. package/utils/Renders/ApiGetRender.js +5 -2
  45. package/utils/TreeUtil.js +2 -4
  46. package/utils/VAP.js +0 -1
  47. package/utils/_Support.d.ts +1 -1
  48. package/utils/crontab/_en.d.ts +2 -0
  49. package/utils/crontab/_en.js +178 -0
  50. package/utils/crontab/_global.d.ts +11 -0
  51. package/utils/crontab/_global.js +23 -0
  52. package/utils/crontab/_zh_CN.d.ts +2 -0
  53. package/utils/crontab/_zh_CN.js +180 -0
  54. package/utils/crontab/_zh_TW.d.ts +2 -0
  55. package/utils/crontab/_zh_TW.js +170 -0
  56. package/utils/crontab/crontabParser.d.ts +1 -0
  57. package/utils/crontab/crontabParser.js +251 -0
  58. package/utils/crontab/crontabRender.d.ts +23 -0
  59. package/utils/crontab/crontabRender.js +503 -0
  60. package/utils/crontab/index.d.ts +3 -0
  61. package/utils/crontab/index.js +9 -0
  62. package/utils/crontab/type.d.ts +79 -0
  63. package/utils/crontab/type.js +2 -0
  64. package/utils/crontab/utils.d.ts +20 -0
  65. package/utils/crontab/utils.js +122 -0
  66. package/utils/py.js +2 -0
  67. /package/components/{SearchBar → SearchTool/SearchBar}/ByField.d.ts +0 -0
  68. /package/components/{SearchBar → SearchTool/SearchBar}/ByKeyword.d.ts +0 -0
  69. /package/components/{SearchBar → SearchTool/SearchBar}/SearchField.js +0 -0
  70. /package/components/{SearchBar → SearchTool/SearchBar}/SearchTags.d.ts +0 -0
  71. /package/components/{SearchBar → SearchTool}/_FieldType.d.ts +0 -0
  72. /package/components/{SearchBar → SearchTool}/_FieldType.js +0 -0
package/basetype.d.ts CHANGED
@@ -60,3 +60,7 @@ export type BaseOption = BaseItem & {
60
60
  [propName: string]: any;
61
61
  };
62
62
  export type { ApiModel } from './hooks/_list';
63
+ export type Without<T, U> = {
64
+ [P in Exclude<keyof T, keyof U>]?: never;
65
+ };
66
+ export type XOR<T, U> = (T | U) extends object ? (T extends object ? U extends object ? (Without<T, U> & U) | (Without<U, T> & T) : T | U : T | U) : T | U;
@@ -1,8 +1,8 @@
1
1
  import React from 'react';
2
2
  import type { MutableRefObject, ReactNode, CSSProperties } from 'react';
3
3
  import type { SelectBarProps } from './SelectBar';
4
- import type { SearchBarProps } from '../SearchBar';
5
- import type { ActButton } from '../SearchBar/ActionButtons';
4
+ import type { SearchBarProps } from '../SearchTool/SearchBar';
5
+ import type { ActButton } from '../SearchTool/SearchBar/ActionButtons';
6
6
  import type { Key, PlainObject } from '../../basetype';
7
7
  import type { UPaginationProps } from '../_common/Upagination';
8
8
  type BoxState = {
@@ -59,7 +59,7 @@ var lodash_1 = __importDefault(require("lodash"));
59
59
  var Layout_1 = require("../_adapt/Layout");
60
60
  var hooks_1 = require("../../hooks");
61
61
  var SelectBar_1 = require("./SelectBar");
62
- var SearchBar_1 = require("../SearchBar");
62
+ var SearchBar_1 = require("../SearchTool/SearchBar");
63
63
  var Upagination_1 = require("../_common/Upagination");
64
64
  var utils_1 = require("../../utils");
65
65
  var _register_1 = require("./_register");
@@ -1,6 +1,6 @@
1
1
  import type { FC, ReactNode } from 'react';
2
- import type { ButtonType } from '../_adapt/_Antd5';
3
- import type { ButtonProps } from '../_adapt/Button';
2
+ import type { ButtonType } from '../../_adapt/_Antd5';
3
+ import type { ButtonProps } from '../../_adapt/Button';
4
4
  import type { ButtonSize } from 'antd/es/button';
5
5
  export type ActButton = {
6
6
  /**
@@ -51,11 +51,11 @@ Object.defineProperty(exports, "__esModule", { value: true });
51
51
  exports.ActionButtons = void 0;
52
52
  var react_1 = __importStar(require("react"));
53
53
  var lodash_1 = __importDefault(require("lodash"));
54
- var Popconfirm_1 = require("../_adapt/Popconfirm");
55
- var Icon_1 = require("../_adapt/Icon");
56
- var Button_1 = require("../_adapt/Button");
57
- var Dropdown_1 = require("../_adapt/Dropdown");
58
- var utils_1 = require("../../utils");
54
+ var Popconfirm_1 = require("../../_adapt/Popconfirm");
55
+ var Icon_1 = require("../../_adapt/Icon");
56
+ var Button_1 = require("../../_adapt/Button");
57
+ var Dropdown_1 = require("../../_adapt/Dropdown");
58
+ var utils_1 = require("../../../utils");
59
59
  var getIcon = function (icon) {
60
60
  if (lodash_1.default.isString(icon)) {
61
61
  return react_1.default.createElement(Icon_1.Icon, { type: icon });
@@ -57,10 +57,10 @@ exports.SearchBarByField = exports.InnerSearchBarByField = void 0;
57
57
  var react_1 = __importStar(require("react"));
58
58
  var lodash_1 = __importDefault(require("lodash"));
59
59
  var antd_1 = require("antd");
60
- var Button_1 = require("../_adapt/Button");
61
- var Popover_1 = require("../_adapt/Popover");
62
- var utils_1 = require("../../utils");
63
- var _i18n_1 = require("../_i18n");
60
+ var Button_1 = require("../../_adapt/Button");
61
+ var Popover_1 = require("../../_adapt/Popover");
62
+ var utils_1 = require("../../../utils");
63
+ var _i18n_1 = require("../../_i18n");
64
64
  var SearchField_1 = require("./SearchField");
65
65
  var _register_1 = require("./_register");
66
66
  exports.InnerSearchBarByField = (0, react_1.forwardRef)(function (props, ref) {
@@ -53,10 +53,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
53
53
  exports.SearchBarByKeyword = void 0;
54
54
  var react_1 = __importStar(require("react"));
55
55
  var antd_1 = require("antd");
56
- var Popover_1 = require("../_adapt/Popover");
56
+ var Popover_1 = require("../../_adapt/Popover");
57
57
  var ByField_1 = require("./ByField");
58
- var utils_1 = require("../../utils");
59
- var _i18n_1 = require("../_i18n");
58
+ var utils_1 = require("../../../utils");
59
+ var _i18n_1 = require("../../_i18n");
60
60
  var SearchBarByKeyword = function (props) {
61
61
  var _a = __read((0, react_1.useState)(false), 2), open = _a[0], setOpen = _a[1];
62
62
  var spanRef = (0, react_1.useRef)(null);
@@ -1,6 +1,6 @@
1
1
  import { SearchFieldComponent } from './_register';
2
2
  import type { FC } from 'react';
3
- import type { Field } from './index';
3
+ import type { Field } from '../index';
4
4
  export type FieldInput = FC<{
5
5
  SearchField: SearchFieldComponent;
6
6
  disabled: boolean;
@@ -5,7 +5,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.SearchTags = void 0;
7
7
  var react_1 = __importDefault(require("react"));
8
- var Tag_1 = require("../_adapt/Tag");
8
+ var Tag_1 = require("../../_adapt/Tag");
9
9
  var SearchTags = function () {
10
10
  return react_1.default.createElement("div", null,
11
11
  react_1.default.createElement("h1", null,
@@ -1,4 +1,4 @@
1
- import type { Field } from './index';
1
+ import type { Field } from '../index';
2
2
  import type { ComponentType } from 'react';
3
3
  export type SearchFieldProps = {
4
4
  /**
@@ -1,9 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.getSearchField = exports.registerSearchField = void 0;
4
- var _Support_1 = require("../../utils/_Support");
5
- var StringUtil_1 = require("../../utils/StringUtil");
6
- var _RegisterUtil_1 = require("../_RegisterUtil");
4
+ var _Support_1 = require("../../../utils/_Support");
5
+ var StringUtil_1 = require("../../../utils/StringUtil");
6
+ var _RegisterUtil_1 = require("../../_RegisterUtil");
7
7
  var DEFAULT = { outside: false, fieldNum: 1, defaultSpan: 1, };
8
8
  var _C_SEARCH_FIELD = (0, _Support_1.globalDefault)('_C_SEARCH_FIELD', new Map());
9
9
  /**
@@ -0,0 +1,71 @@
1
+ import { ActionButtons } from './ActionButtons';
2
+ import type { PropsWithChildren, ExoticComponent } from 'react';
3
+ import type { Field } from '../index';
4
+ import type { PlainObject } from '../../../basetype';
5
+ /**
6
+ * 当没有指定 keyword时,SearchBar的配置参数
7
+ * 指字 keyword 时,将出以弹出方式展示
8
+ */
9
+ export type SearchBarByFieldProps = {
10
+ /**
11
+ * 禁用
12
+ */
13
+ disabled?: boolean;
14
+ /**
15
+ * searchBar扩展类名称
16
+ */
17
+ className?: string;
18
+ /**
19
+ * 1. 传一个字,代表 inside 模式宽度
20
+ * 2. 传一个数字数组,
21
+ * 代表 outside 模式 [label宽度,input宽度]
22
+ * 或是 inside 模式加各的结果
23
+ */
24
+ fieldWidth?: number | [number, number];
25
+ /**
26
+ * 搜索参数
27
+ */
28
+ fields?: Field[];
29
+ /**
30
+ * 搜索参数支持的列,最多支持4,默认为3
31
+ */
32
+ cols?: 1 | 2 | 3 | 4;
33
+ /**
34
+ * 变量有变动时使用
35
+ */
36
+ onChange?: (param: PlainObject) => void;
37
+ /**
38
+ * 搜索被触发时
39
+ */
40
+ onSearch: (param: PlainObject) => void;
41
+ /**
42
+ * 显示更多时触发
43
+ */
44
+ onExpand?: (isShowMore: boolean) => void;
45
+ /**
46
+ * 默认参数
47
+ */
48
+ default?: any;
49
+ /**
50
+ * 用于单独使用时,不需要按钮的情况
51
+ */
52
+ hideAction?: boolean;
53
+ };
54
+ export type KeyWord = true | {
55
+ /**
56
+ * 提示,默认为 "请填写关键字"
57
+ */
58
+ placeholder?: string;
59
+ /**
60
+ * 需要高亮的字段
61
+ * 高亮设定: 说明:高亮设定后, column 指定的 render 会失效
62
+ */
63
+ highlight?: string[];
64
+ };
65
+ export type SearchBarProps = SearchBarByFieldProps & {
66
+ keyword?: KeyWord;
67
+ };
68
+ export interface SearchBar extends ExoticComponent<PropsWithChildren<SearchBarProps>> {
69
+ ActionButtons: typeof ActionButtons;
70
+ }
71
+ export declare const SearchBar: SearchBar;
@@ -17,7 +17,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
17
17
  exports.SearchBar = void 0;
18
18
  var react_1 = __importDefault(require("react"));
19
19
  var lodash_1 = __importDefault(require("lodash"));
20
- var utils_1 = require("../../utils");
20
+ var utils_1 = require("../../../utils");
21
21
  var ByField_1 = require("./ByField");
22
22
  var ByKeyword_1 = require("./ByKeyword");
23
23
  var ActionButtons_1 = require("./ActionButtons");
@@ -1,6 +1,4 @@
1
- import { ActionButtons } from './ActionButtons';
2
- import type { PropsWithChildren, ExoticComponent } from 'react';
3
- import type { BaseOption, PlainObject, BaseItem } from '../../basetype';
1
+ import type { BaseOption, BaseItem } from '../../basetype';
4
2
  import type { _FieldType } from './_FieldType';
5
3
  /**
6
4
  * 搜索条件字段
@@ -63,70 +61,3 @@ export type Field = BaseItem & {
63
61
  * */
64
62
  config?: any;
65
63
  };
66
- /**
67
- * 当没有指定 keyword时,SearchBar的配置参数
68
- * 指字 keyword 时,将出以弹出方式展示
69
- */
70
- export type SearchBarByFieldProps = {
71
- /**
72
- * 禁用
73
- */
74
- disabled?: boolean;
75
- /**
76
- * searchBar扩展类名称
77
- */
78
- className?: string;
79
- /**
80
- * 1. 传一个字,代表 inside 模式宽度
81
- * 2. 传一个数字数组,
82
- * 代表 outside 模式 [label宽度,input宽度]
83
- * 或是 inside 模式加各的结果
84
- */
85
- fieldWidth?: number | [number, number];
86
- /**
87
- * 搜索参数
88
- */
89
- fields?: Field[];
90
- /**
91
- * 搜索参数支持的列,最多支持4,默认为3
92
- */
93
- cols?: 1 | 2 | 3 | 4;
94
- /**
95
- * 变量有变动时使用
96
- */
97
- onChange?: (param: PlainObject) => void;
98
- /**
99
- * 搜索被触发时
100
- */
101
- onSearch: (param: PlainObject) => void;
102
- /**
103
- * 显示更多时触发
104
- */
105
- onExpand?: (isShowMore: boolean) => void;
106
- /**
107
- * 默认参数
108
- */
109
- default?: any;
110
- /**
111
- * 用于单独使用时,不需要按钮的情况
112
- */
113
- hideAction?: boolean;
114
- };
115
- export type KeyWord = true | {
116
- /**
117
- * 提示,默认为 "请填写关键字"
118
- */
119
- placeholder?: string;
120
- /**
121
- * 需要高亮的字段
122
- * 高亮设定: 说明:高亮设定后, column 指定的 render 会失效
123
- */
124
- highlight?: string[];
125
- };
126
- export type SearchBarProps = SearchBarByFieldProps & {
127
- keyword?: KeyWord;
128
- };
129
- export interface SearchBar extends ExoticComponent<PropsWithChildren<SearchBarProps>> {
130
- ActionButtons: typeof ActionButtons;
131
- }
132
- export declare const SearchBar: SearchBar;
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -12,7 +12,7 @@ export declare const ApiTable: React.ForwardRefExoticComponent<import("./index")
12
12
  selectDisabled?: (record: any) => boolean;
13
13
  actionBar?: React.ReactNode | import("./Components/ActionBar").TableActionButton[];
14
14
  selectBar?: import("../Box/SelectBar").SelectBarProps;
15
- searchBar?: Omit<import("../SearchBar").SearchBarProps, "onChange" | "onSearch">;
15
+ searchBar?: Omit<import("../..").SearchBarProps, "onChange" | "onSearch">;
16
16
  default?: import("../..").PlainObject;
17
17
  autoLoad?: false;
18
18
  } & Pick<ApiOption, "api" | "tipField" | "tipDisabled" | "aop"> & React.RefAttributes<ApiModel>>;
@@ -12,7 +12,7 @@ export declare const ApiTableModal: React.ForwardRefExoticComponent<import(".").
12
12
  selectDisabled?: (record: any) => boolean;
13
13
  actionBar?: React.ReactNode | import("./Components/ActionBar").TableActionButton[];
14
14
  selectBar?: import("../Box/SelectBar").SelectBarProps;
15
- searchBar?: Omit<import("../SearchBar").SearchBarProps, "onChange" | "onSearch">;
15
+ searchBar?: Omit<import("../..").SearchBarProps, "onChange" | "onSearch">;
16
16
  default?: import("../..").PlainObject;
17
17
  autoLoad?: false;
18
18
  } & Pick<import("../../hooks/useApiBase").ApiOption, "api" | "tipField" | "tipDisabled" | "aop"> & Omit<import("antd/es/modal").ModalProps, "visible" | "onCancel" | "onOk"> & {
@@ -1,6 +1,6 @@
1
1
  import type { FC, MutableRefObject } from 'react';
2
2
  import type { Key, PlainObject } from '../../../basetype';
3
- import type { ActButton } from '../../SearchBar/ActionButtons';
3
+ import type { ActButton } from '../../SearchTool/SearchBar/ActionButtons';
4
4
  export type TableAction = (ids?: Key[], objs?: PlainObject[], param?: PlainObject) => void;
5
5
  /**
6
6
  * VTable Button 区域点击后的方法,支持三个参数
@@ -56,7 +56,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
56
56
  exports.BUTTON_EXPORT = exports.BUTTON_IMPORT = exports.BUTTON_MORE = exports.BUTTON_DELETE = exports.BUTTON_ADD = exports.ActionBar = void 0;
57
57
  var react_1 = __importStar(require("react"));
58
58
  var lodash_1 = __importDefault(require("lodash"));
59
- var ActionButtons_1 = require("../../SearchBar/ActionButtons");
59
+ var ActionButtons_1 = require("../../SearchTool/SearchBar/ActionButtons");
60
60
  var _i18n_1 = require("../../_i18n");
61
61
  var i18n_1 = require("../../../utils/i18n");
62
62
  var hooks_1 = require("../../../hooks");
@@ -28,13 +28,15 @@ export type VTableProps = BaseTableProps & {
28
28
  export declare const VTable: React.ForwardRefExoticComponent<import("./index").TableDefine & {
29
29
  mode?: import("../Box/Box").BoxMode;
30
30
  columns: import("./index").TableCol[];
31
- showIndex?: string | false;
31
+ showIndex?: string | false; /**
32
+ * 列表模型,可以使用系统提供的 useApi/useArray 等,也可自行实现列表模型
33
+ */
32
34
  rowKey?: string;
33
35
  select?: true | "DEFAULT" | "QUERY";
34
36
  selectDisabled?: (record: any) => boolean;
35
37
  actionBar?: React.ReactNode | import("./Components/ActionBar").TableActionButton[];
36
38
  selectBar?: import("../Box/SelectBar").SelectBarProps;
37
- searchBar?: Omit<import("../SearchBar").SearchBarProps, "onChange" | "onSearch">;
39
+ searchBar?: Omit<import("../..").SearchBarProps, "onChange" | "onSearch">;
38
40
  default?: PlainObject;
39
41
  autoLoad?: false;
40
42
  } & {
@@ -2,7 +2,7 @@ import type { TableDefined } from './Components';
2
2
  import type { ReactNode, ForwardRefExoticComponent, ExoticComponent, RefAttributes } from 'react';
3
3
  import type { TableProps } from '../_adapt/Table';
4
4
  import type { ColumnProps } from 'antd/es/table/interface';
5
- import type { SearchBarProps } from '../SearchBar/index';
5
+ import type { SearchBarProps } from '../SearchTool/SearchBar/index';
6
6
  import type { TableActionButton } from './Components/ActionBar';
7
7
  import type { PlainObject, BaseItem, ApiModel } from '../../basetype';
8
8
  import type { BoxMode } from '../Box/Box';
@@ -26,7 +26,7 @@ var _STreeSelect = function (props) {
26
26
  // 说明,等待数据处理好了再绑定,让 defaultExpand 之类的默认属性能生效
27
27
  if (!treeState.inited)
28
28
  return utils_1.Const.NONE;
29
- return react_1.default.createElement(antd_1.TreeSelect, __assign({}, baseProps, extraProps, { value: value == null ? undefined : value, disabled: props.disabled }), (0, BaseTreeSelect_1.renderRoot)(props, treeState));
29
+ return react_1.default.createElement(antd_1.TreeSelect, __assign({}, baseProps, extraProps, { treeDefaultExpandAll: props.treeDefaultExpandAll, allowClear: props.allowClear, value: value == null ? undefined : value, disabled: props.disabled }), (0, BaseTreeSelect_1.renderRoot)(props, treeState));
30
30
  };
31
31
  var STreeSelect = function (props) { return react_1.default.createElement(BaseTreeSelect_1.BaseTreeSelect, __assign({}, props),
32
32
  react_1.default.createElement(_STreeSelect, __assign({}, props))); };
@@ -5,4 +5,4 @@
5
5
  | text ||
6
6
  *
7
7
  */
8
- export declare const _FieldType: readonly ["text", "textarea", "password", "color", "number", "slider", "slider-range", "slider-range", "input-with-select", "button", "select", "multi-select", "switch", "switch-checkbox", "radio", "radio-button", "radio-with-more", "checkbox", "checkbox-with-all", "icon", "stree-select", "dtree-select", "ftree-select", "multi-stree-select", "multi-dtree-select", "multi-ftree-select", "date", "datetime", "month", "week", "time", "daterange", "datetimerange", "daterange-single", "datetimerange-single", "timerange", "monthrange", "json-array", "json-table", "file", "multi-file", "img", "idcard", "ip", "ip4", "ip6", "phone", "telephone", "mobilephone", "port", "mac", "url", "email", "crontab", "organization", "role", "roles", "cems-org-button"];
8
+ export declare const _FieldType: readonly ["text", "textarea", "password", "color", "number", "slider", "slider-range", "slider-range", "input-with-select", "button", "divider", "select", "multi-select", "switch", "switch-checkbox", "radio", "radio-button", "radio-with-more", "checkbox", "checkbox-with-all", "icon", "stree-select", "dtree-select", "ftree-select", "multi-stree-select", "multi-dtree-select", "multi-ftree-select", "date", "datetime", "month", "week", "time", "daterange", "datetimerange", "daterange-single", "datetimerange-single", "timerange", "monthrange", "json-array", "json-table", "file", "multi-file", "img", "idcard", "ip", "ip4", "ip6", "phone", "telephone", "mobilephone", "port", "mac", "url", "email", "crontab", "organization", "role", "roles", "cems-org-button"];
@@ -51,6 +51,10 @@ exports._FieldType = [
51
51
  * 一个没有任何意义的按钮,使用时,请设置 dataType:'none'
52
52
  */
53
53
  'button',
54
+ /**
55
+ * 一个没有任何意义的分割,使用时,请设置 dataType:'none'
56
+ */
57
+ 'divider',
54
58
  /**
55
59
  * 下拉选择
56
60
  */
@@ -2,7 +2,7 @@ import type { ReactNode } from 'react';
2
2
  import type { UFormField } from './index';
3
3
  import type { PlainObject } from '../../basetype';
4
4
  import type { TableColumn } from '../Tables';
5
- import type { SearchBarProps } from '../SearchBar';
5
+ import type { SearchBarProps } from '../SearchTool/SearchBar';
6
6
  export declare const copyMultiValue: (fields: string[], data: PlainObject, properties: string[]) => PlainObject;
7
7
  /**
8
8
  * 获取复合字段的 字段与值,以数组形式返回
@@ -1,6 +1,6 @@
1
1
  import type { FC, CSSProperties, ReactNode } from 'react';
2
2
  import type { ColProps as AntdColprops } from 'antd/es/grid/col';
3
- import type { ActButton } from '../SearchBar/ActionButtons';
3
+ import type { ActButton } from '../SearchTool/SearchBar/ActionButtons';
4
4
  import type { UTitleProps } from '../_common/UTitle';
5
5
  export type ColProps = Omit<AntdColprops, 'title'> & UTitleProps & {
6
6
  /**
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
  import type { ReactNode, CSSProperties } from 'react';
3
- import type { ActButton } from '../SearchBar/ActionButtons';
3
+ import type { ActButton } from '../SearchTool/SearchBar/ActionButtons';
4
4
  export type UTitleProps = {
5
5
  className?: string;
6
6
  style?: CSSProperties;
@@ -32,7 +32,7 @@ var lodash_1 = __importDefault(require("lodash"));
32
32
  var utils_1 = require("../../utils");
33
33
  var Popover_1 = require("../_adapt/Popover");
34
34
  var Icon_1 = require("../_adapt/Icon");
35
- var ActionButtons_1 = require("../SearchBar/ActionButtons");
35
+ var ActionButtons_1 = require("../SearchTool/SearchBar/ActionButtons");
36
36
  var UTitle = function (props) {
37
37
  var elAction = '';
38
38
  var actions = [];
@@ -1,7 +1,7 @@
1
1
  export { registerFormField, } from './UForm/_register';
2
2
  export { getPlaceholder, getMultiFieldValues, registerApiTableSelector, copyMultiValue } from './UForm/_input';
3
3
  export type { FormFieldComponent, FormFieldProps, FormFieldOptions, } from './UForm/_register';
4
- export { registerSearchField, } from './SearchBar/_register';
5
- export type { SearchFieldComponent, SearchFieldProps, SearchFieldOptions, } from './SearchBar/_register';
4
+ export { registerSearchField, } from './SearchTool/SearchBar/_register';
5
+ export type { SearchFieldComponent, SearchFieldProps, SearchFieldOptions, } from './SearchTool/SearchBar/_register';
6
6
  export { registerSelectBar } from './Box/_register';
7
7
  export type { SelectBarComponent, SelectBarProps, SelectBarOptions, } from './Box/_register';
@@ -10,7 +10,7 @@ Object.defineProperty(exports, "getMultiFieldValues", { enumerable: true, get: f
10
10
  Object.defineProperty(exports, "registerApiTableSelector", { enumerable: true, get: function () { return _input_1.registerApiTableSelector; } });
11
11
  Object.defineProperty(exports, "copyMultiValue", { enumerable: true, get: function () { return _input_1.copyMultiValue; } });
12
12
  // SearchField 搜索条件输入字段
13
- var _register_2 = require("./SearchBar/_register");
13
+ var _register_2 = require("./SearchTool/SearchBar/_register");
14
14
  Object.defineProperty(exports, "registerSearchField", { enumerable: true, get: function () { return _register_2.registerSearchField; } });
15
15
  // SelectBar - 左侧边栏
16
16
  var _register_3 = require("./Box/_register");
@@ -1,6 +1,71 @@
1
- export declare const API_PREFIX = "/api-data";
2
- export declare const IMAGE_PREFIX = "/data/images";
1
+ export declare const API_PREFIX: string;
2
+ export declare const IMAGE_PREFIX: string;
3
3
  export declare enum SOURCE_TYPE {
4
4
  ELASTIC = 1,
5
- MYSQL = 2
5
+ MYSQL = 2,
6
+ DORIS = 5
6
7
  }
8
+ export type FIELD_TYPE = 'keyword' | 'date' | 'long' | 'double' | 'text' | 'json' | 'object' | 'pic' | 'base64';
9
+ /**
10
+ * 数据源
11
+ */
12
+ export type Source = {
13
+ /**
14
+ * 数据源ID
15
+ */
16
+ id: number;
17
+ /**
18
+ * 数据源名称(表名称/索引名称)
19
+ */
20
+ name: string;
21
+ /**
22
+ * 数据源标题
23
+ */
24
+ title: string;
25
+ /**
26
+ * 数据源标题
27
+ */
28
+ icon?: string;
29
+ /**
30
+ * 数据源时间字段
31
+ */
32
+ timeField?: string;
33
+ /**
34
+ * 数据源类型
35
+ * 1 = Elastic Search
36
+ * 2 = MySQL
37
+ * 5 = Doris
38
+ */
39
+ type: 1 | 2 | 5;
40
+ };
41
+ export type SourceField = {
42
+ /**
43
+ * 字段
44
+ */
45
+ field: string;
46
+ /**
47
+ * 字段名称
48
+ */
49
+ name: string;
50
+ /**
51
+ * 是否可排序
52
+ */
53
+ sorter: boolean;
54
+ /**
55
+ * 是否可被过滤
56
+ */
57
+ filter: boolean;
58
+ /**
59
+ * 是否可被 filter
60
+ */
61
+ tag: boolean;
62
+ /**
63
+ * 字段类型
64
+ */
65
+ type: FIELD_TYPE;
66
+ /**
67
+ * 字段类型
68
+ */
69
+ dict?: string;
70
+ };
71
+ export declare const getSourceByName: (sourceName: string, sources: Source[]) => Source;
@@ -1,10 +1,54 @@
1
1
  "use strict";
2
+ var __values = (this && this.__values) || function(o) {
3
+ var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
4
+ if (m) return m.call(o);
5
+ if (o && typeof o.length === "number") return {
6
+ next: function () {
7
+ if (o && i >= o.length) o = void 0;
8
+ return { value: o && o[i++], done: !o };
9
+ }
10
+ };
11
+ throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
12
+ };
13
+ var __importDefault = (this && this.__importDefault) || function (mod) {
14
+ return (mod && mod.__esModule) ? mod : { "default": mod };
15
+ };
2
16
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.SOURCE_TYPE = exports.IMAGE_PREFIX = exports.API_PREFIX = void 0;
4
- exports.API_PREFIX = '/api-data';
5
- exports.IMAGE_PREFIX = '/data/images';
17
+ exports.getSourceByName = exports.SOURCE_TYPE = exports.IMAGE_PREFIX = exports.API_PREFIX = void 0;
18
+ var lodash_1 = __importDefault(require("lodash"));
19
+ var PageUtil_1 = require("../../utils/PageUtil");
20
+ exports.API_PREFIX = (0, PageUtil_1.resolveURL)('/api-data');
21
+ exports.IMAGE_PREFIX = (0, PageUtil_1.resolveURL)('/data/images');
6
22
  var SOURCE_TYPE;
7
23
  (function (SOURCE_TYPE) {
8
24
  SOURCE_TYPE[SOURCE_TYPE["ELASTIC"] = 1] = "ELASTIC";
9
25
  SOURCE_TYPE[SOURCE_TYPE["MYSQL"] = 2] = "MYSQL";
26
+ SOURCE_TYPE[SOURCE_TYPE["DORIS"] = 5] = "DORIS";
10
27
  })(SOURCE_TYPE || (exports.SOURCE_TYPE = SOURCE_TYPE = {}));
28
+ var getSourceByName = function (sourceName, sources) {
29
+ var e_1, _a;
30
+ var find = lodash_1.default.find(sources, { name: sourceName });
31
+ if (find)
32
+ return find;
33
+ var matched = [];
34
+ try {
35
+ for (var sources_1 = __values(sources), sources_1_1 = sources_1.next(); !sources_1_1.done; sources_1_1 = sources_1.next()) {
36
+ var source = sources_1_1.value;
37
+ var prefix = source.name.replace('-*', '').replace('*', '');
38
+ if (lodash_1.default.startsWith(sourceName, prefix)) {
39
+ matched.push(source);
40
+ }
41
+ }
42
+ }
43
+ catch (e_1_1) { e_1 = { error: e_1_1 }; }
44
+ finally {
45
+ try {
46
+ if (sources_1_1 && !sources_1_1.done && (_a = sources_1.return)) _a.call(sources_1);
47
+ }
48
+ finally { if (e_1) throw e_1.error; }
49
+ }
50
+ if (matched.length == 0)
51
+ return { id: 0, title: sourceName, name: sourceName, type: 1 };
52
+ return lodash_1.default.orderBy(matched, function (item) { return item.name.length; }, 'desc')[0];
53
+ };
54
+ exports.getSourceByName = getSourceByName;
File without changes