vap1 0.4.7 → 0.5.0
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/base.json +30 -0
- package/basetype.d.ts +0 -1
- package/cems/admin/AsyncSelect.d.ts +45 -0
- package/cems/admin/AsyncSelect.js +2 -0
- package/cems/admin/CardTable.d.ts +207 -0
- package/cems/admin/CardTable.js +2 -0
- package/cems/admin/EasyuiTree.d.ts +131 -0
- package/cems/admin/EasyuiTree.js +2 -0
- package/cems/admin/utils.d.ts +5 -0
- package/cems/admin/utils.js +3 -0
- package/cems/admin/validator.d.ts +137 -0
- package/cems/admin/validator.js +2 -0
- package/cems/assets/CUpload.d.ts +23 -0
- package/cems/assets/CUpload.js +2 -0
- package/cems/assets/Charts.d.ts +37 -0
- package/cems/assets/Charts.js +2 -0
- package/cems/assets/DInfo.d.ts +38 -0
- package/cems/assets/DInfo.js +2 -0
- package/cems/assets/DModal.d.ts +84 -0
- package/cems/assets/DModal.js +2 -0
- package/cems/assets/DTable.d.ts +128 -0
- package/cems/assets/DTable.js +2 -0
- package/cems/assets/DivWidth.d.ts +14 -0
- package/cems/assets/DivWidth.js +2 -0
- package/cems/assets/Patch.d.ts +9 -0
- package/cems/assets/Patch.js +2 -0
- package/cems/assets/Sensitive.d.ts +33 -0
- package/cems/assets/Sensitive.js +2 -0
- package/cems/assets/types.d.ts +200 -0
- package/cems/assets/types.js +2 -0
- package/cems/assets/utils.d.ts +61 -0
- package/cems/assets/utils.js +2 -0
- package/cems/define.d.ts +9 -0
- package/cems/define.js +18 -0
- package/cems/index.d.ts +228 -0
- package/cems/index.js +81 -0
- package/cems/policy/CForm.d.ts +133 -0
- package/cems/policy/CForm.js +2 -0
- package/cems/policy/DApiTable.d.ts +78 -0
- package/cems/policy/DApiTable.js +2 -0
- package/cems/policy/DButton.d.ts +17 -0
- package/cems/policy/DButton.js +2 -0
- package/cems/policy/DCheckbox.d.ts +50 -0
- package/cems/policy/DCheckbox.js +2 -0
- package/cems/policy/DCheckboxGroup.d.ts +34 -0
- package/cems/policy/DCheckboxGroup.js +2 -0
- package/cems/policy/DCol.d.ts +33 -0
- package/cems/policy/DCol.js +2 -0
- package/cems/policy/DColorPicker.d.ts +9 -0
- package/cems/policy/DColorPicker.js +2 -0
- package/cems/policy/DDatePicker.d.ts +41 -0
- package/cems/policy/DDatePicker.js +2 -0
- package/cems/policy/DDiv.d.ts +65 -0
- package/cems/policy/DDiv.js +2 -0
- package/cems/policy/DDrawer.d.ts +6 -0
- package/cems/policy/DDrawer.js +2 -0
- package/cems/policy/DDynamicSelect.d.ts +50 -0
- package/cems/policy/DDynamicSelect.js +2 -0
- package/cems/policy/DDynamicTreeSelect.d.ts +45 -0
- package/cems/policy/DDynamicTreeSelect.js +2 -0
- package/cems/policy/DForm.d.ts +248 -0
- package/cems/policy/DForm.js +2 -0
- package/cems/policy/DIcon.d.ts +33 -0
- package/cems/policy/DIcon.js +2 -0
- package/cems/policy/DInput.d.ts +41 -0
- package/cems/policy/DInput.js +2 -0
- package/cems/policy/DLabel.d.ts +17 -0
- package/cems/policy/DLabel.js +2 -0
- package/cems/policy/DPTable.d.ts +86 -0
- package/cems/policy/DPTable.js +2 -0
- package/cems/policy/DRadio.d.ts +34 -0
- package/cems/policy/DRadio.js +2 -0
- package/cems/policy/DSCTable.d.ts +33 -0
- package/cems/policy/DSCTable.js +2 -0
- package/cems/policy/DSelect.d.ts +42 -0
- package/cems/policy/DSelect.js +2 -0
- package/cems/policy/DSlider.d.ts +21 -0
- package/cems/policy/DSlider.js +2 -0
- package/cems/policy/DSwitch.d.ts +21 -0
- package/cems/policy/DSwitch.js +2 -0
- package/cems/policy/DTab.d.ts +30 -0
- package/cems/policy/DTab.js +2 -0
- package/cems/policy/DTimePicker.d.ts +37 -0
- package/cems/policy/DTimePicker.js +2 -0
- package/cems/policy/DTree.d.ts +98 -0
- package/cems/policy/DTree.js +2 -0
- package/cems/policy/DUpload.d.ts +33 -0
- package/cems/policy/DUpload.js +2 -0
- package/cems/policy/types.d.ts +200 -0
- package/cems/policy/types.js +2 -0
- package/cems/policy/utils.d.ts +13 -0
- package/cems/policy/utils.js +2 -0
- package/components/Box/Box.d.ts +42 -6
- package/components/Box/Box.js +66 -16
- package/components/Box/SelectBar.d.ts +1 -1
- package/components/Box/SelectBar.js +19 -9
- package/components/Lists/BaseList.d.ts +5 -0
- package/components/Lists/BaseList.js +111 -0
- package/components/Lists/Fields/IconRender.d.ts +53 -0
- package/components/Lists/Fields/IconRender.js +174 -0
- package/components/Lists/Fields/ItemRender.d.ts +2 -0
- package/components/Lists/Fields/ItemRender.js +127 -0
- package/components/Lists/Fields/_utils.d.ts +3 -0
- package/components/Lists/Fields/_utils.js +80 -0
- package/components/Lists/Fields/index.d.ts +3 -0
- package/components/Lists/Fields/index.js +47 -0
- package/components/Lists/Grid/grid.d.ts +7 -0
- package/components/Lists/Grid/grid.js +18 -0
- package/components/Lists/Grid/index.d.ts +3 -0
- package/components/Lists/Grid/index.js +50 -0
- package/components/Lists/Row/index.d.ts +3 -0
- package/components/Lists/Row/index.js +14 -0
- package/components/Lists/SList.js +17 -7
- package/components/Lists/Timeline/index.d.ts +3 -0
- package/components/Lists/Timeline/index.js +117 -0
- package/components/Lists/VList.d.ts +3 -0
- package/components/Lists/VList.js +92 -0
- package/components/Lists/components/LayoutSwitcher.d.ts +13 -0
- package/components/Lists/components/LayoutSwitcher.js +121 -0
- package/components/Lists/components/SearchTool.d.ts +13 -0
- package/components/Lists/components/SearchTool.js +34 -0
- package/components/Lists/index.d.ts +129 -0
- package/components/Lists/index.js +2 -0
- package/components/SearchTool/SearchBand/BandInput.d.ts +3 -0
- package/components/SearchTool/SearchBand/BandInput.js +54 -0
- package/components/SearchTool/SearchBand/BandTag.d.ts +7 -0
- package/components/SearchTool/SearchBand/BandTag.js +82 -0
- package/components/SearchTool/SearchBand/_SearchBandAction.d.ts +3 -0
- package/components/SearchTool/SearchBand/_SearchBandAction.js +23 -0
- package/components/SearchTool/SearchBand/_SearchBandFix.d.ts +3 -0
- package/components/SearchTool/SearchBand/_SearchBandFix.js +72 -0
- package/components/SearchTool/SearchBand/_SearchBandTag.d.ts +3 -0
- package/components/SearchTool/SearchBand/_SearchBandTag.js +75 -0
- package/components/SearchTool/SearchBand/_register.d.ts +47 -0
- package/components/SearchTool/SearchBand/_register.js +15 -0
- package/components/SearchTool/SearchBand/hooks.d.ts +12 -0
- package/components/SearchTool/SearchBand/hooks.js +181 -0
- package/components/SearchTool/SearchBand/index.d.ts +3 -0
- package/components/SearchTool/SearchBand/index.js +66 -0
- package/components/SearchTool/SearchBand/type.d.ts +71 -0
- package/components/SearchTool/SearchBand/type.js +3 -0
- package/components/SearchTool/SearchBar/ActionButtons.js +17 -7
- package/components/SearchTool/SearchBar/ByField.d.ts +1 -1
- package/components/SearchTool/SearchBar/ByField.js +17 -7
- package/components/SearchTool/SearchBar/ByKeyword.d.ts +1 -1
- package/components/SearchTool/SearchBar/ByKeyword.js +17 -7
- package/components/SearchTool/SearchBar/SearchField.d.ts +1 -1
- package/components/SearchTool/SearchBar/_register.d.ts +1 -1
- package/components/SearchTool/SearchBar/index.d.ts +1 -65
- package/components/SearchTool/SearchBar/type.d.ts +133 -0
- package/components/SearchTool/SearchBar/type.js +35 -0
- package/components/SearchTool/index.d.ts +5 -63
- package/components/SearchTool/index.js +5 -0
- package/components/Tables/ApiTable.d.ts +5 -7
- package/components/Tables/ApiTable.js +17 -7
- package/components/Tables/ApiTableModal.d.ts +5 -7
- package/components/Tables/ApiTableModal.js +17 -7
- package/components/Tables/Components/ActionBar.d.ts +7 -10
- package/components/Tables/Components/ActionBar.js +73 -40
- package/components/Tables/Components/Actions.d.ts +3 -1
- package/components/Tables/Components/Actions.js +40 -3
- package/components/Tables/Components/index.d.ts +3 -1
- package/components/Tables/Components/useTableContext.d.ts +16 -0
- package/components/Tables/Components/useTableContext.js +116 -0
- package/components/Tables/STable.js +17 -7
- package/components/Tables/TopTable.js +17 -7
- package/components/Tables/Util.d.ts +2 -2
- package/components/Tables/Util.js +0 -1
- package/components/Tables/VTable.d.ts +9 -11
- package/components/Tables/VTable.js +119 -172
- package/components/Tables/VTableBack.d.ts +0 -0
- package/components/Tables/VTableBack.js +269 -0
- package/components/Tables/index.d.ts +11 -22
- package/components/TreeSelect/BaseTreeSelect.js +17 -7
- package/components/TreeSelect/DTreeSelect.js +19 -9
- package/components/TreeSelect/FTreeSelect.js +2 -2
- package/components/Trees/ActionTree.d.ts +3 -5
- package/components/Trees/ActionTree.js +19 -9
- package/components/Trees/BaseTree.js +17 -7
- package/components/Trees/COTree/COButton.js +17 -7
- package/components/Trees/COTree/COSelect.js +17 -7
- package/components/Trees/COTree/COTree.js +19 -9
- package/components/Trees/DTree.d.ts +0 -7
- package/components/Trees/DTree.js +19 -9
- package/components/Trees/FTree.js +19 -9
- package/components/Trees/STree.js +17 -7
- package/components/UForm/FormWrapper.js +17 -7
- package/components/UForm/UDescriptions.d.ts +2 -3
- package/components/UForm/UDescriptions.js +17 -7
- package/components/UForm/UForm.d.ts +1 -1
- package/components/UForm/UForm.js +24 -11
- package/components/UForm/UFormModal.js +19 -9
- package/components/UForm/_input.d.ts +5 -1
- package/components/UForm/_input.js +25 -8
- package/components/Upload/UploadImage.js +17 -7
- package/components/Upload/UploadModal.js +19 -9
- package/components/Upload/useUpload.js +2 -2
- package/components/_adapt/Alert.js +17 -7
- package/components/_adapt/ColorPicker.js +17 -7
- package/components/_adapt/Drawer.js +17 -7
- package/components/_adapt/Dropdown.js +17 -7
- package/components/_adapt/FloatButton.js +17 -7
- package/components/_adapt/Input.js +17 -7
- package/components/_adapt/InputNumber.js +17 -7
- package/components/_adapt/Layout.js +17 -7
- package/components/_adapt/Menu.js +17 -7
- package/components/_adapt/Modal.js +17 -7
- package/components/_adapt/Popconfirm.js +17 -7
- package/components/_adapt/Popover.js +17 -7
- package/components/_adapt/Progress.js +17 -7
- package/components/_adapt/Select.js +17 -7
- package/components/_adapt/Table.js +17 -7
- package/components/_adapt/Tabs.js +17 -7
- package/components/_adapt/Tag.js +17 -7
- package/components/_adapt/TreeSelect.js +17 -7
- package/components/_adapt/todo/Image.d.ts +0 -1
- package/components/_adapt/todo/Segmented.d.ts +0 -1
- package/components/_common/AutoComplete.js +35 -12
- package/components/_common/CountUp.js +17 -7
- package/components/_common/DateRange.d.ts +5 -2
- package/components/_common/DateRange.js +43 -40
- package/components/_common/HighLight.d.ts +1 -1
- package/components/_common/HighLight.js +26 -24
- package/components/_common/Loading.js +17 -7
- package/components/_common/MonthRange.js +17 -7
- package/components/_common/PromiseLabel.js +2 -2
- package/components/_common/UTitle.js +17 -7
- package/components/_common/Upagination.d.ts +1 -0
- package/components/_common/Upagination.js +5 -1
- package/components/_i18n.d.ts +1 -102
- package/components/index.js +4 -0
- package/deps/JsonView.js +17 -7
- package/deps/app-audit/LookUp.js +19 -9
- package/deps/app-data/useSource.js +19 -9
- package/deps/echarts.d.ts +3 -0
- package/deps/echarts.js +20 -10
- package/deps/editor/Article.js +17 -7
- package/deps/editor/Editor.js +17 -7
- package/deps/editor/EditorModal.js +17 -7
- package/deps/editor/support/buttons/ImageButton.js +17 -7
- package/deps/editor/tools/Button.js +0 -2
- package/deps/editor/tools/_TxtButton.js +17 -7
- package/deps/vapc/_basic.d.ts +1 -0
- package/deps/vapc/_basic.js +15 -0
- package/deps/vapc/index.d.ts +10 -0
- package/deps/vapc/index.js +70 -0
- package/hooks/useAjaxAction.js +2 -2
- package/hooks/useAjaxQuery.js +2 -2
- package/hooks/useApiBase.js +2 -2
- package/hooks/useApiGlobal.js +1 -1
- package/hooks/useArray.js +2 -2
- package/hooks/useDefault.d.ts +0 -1
- package/hooks/useDoLoad.d.ts +1 -1
- package/hooks/useError.d.ts +1 -1
- package/hooks/useMemoPromise.js +2 -2
- package/index.d.ts +2 -1
- package/login/Base65.d.ts +7 -1
- package/login/Base65.js +49 -22
- package/login/Password.d.ts +8 -5
- package/login/Password.js +68 -102
- package/package.json +1 -1
- package/screen/Page.js +17 -7
- package/screen/vapc-schema/dark.d.ts +1 -0
- package/screen/vapc-schema/dark.js +50 -0
- package/screen/vapc-schema/insight.d.ts +1 -0
- package/screen/vapc-schema/insight.js +49 -0
- package/uform/FormEditor.js +17 -7
- package/uform/FormViewer.js +17 -7
- package/uform/hooks/useEditor.d.ts +0 -1
- package/uform/hooks/useForm.d.ts +0 -1
- package/uform/inputs/index.d.ts +0 -1
- package/uform/panel/Editor/_GroupDefault.js +17 -7
- package/uform/panel/Editor/_GroupStep.js +17 -7
- package/uform/panel/Editor/_GroupTab.js +17 -7
- package/uform/panel/Editor/index.js +17 -7
- package/uform/panel/Items/Fields.js +17 -7
- package/uform/panel/Items/InputSelector.js +17 -7
- package/uform/panel/Items/Inputs.js +17 -7
- package/uform/panel/Items/index.d.ts +1 -1
- package/uform/panel/Propreties/CanvasProperties.js +17 -7
- package/uform/panel/Propreties/Component/FieldPlugin.js +17 -7
- package/uform/panel/Propreties/Component/LinkAsyncFunction.js +17 -7
- package/uform/panel/Propreties/Component/LinkSyncFunction.js +17 -7
- package/uform/panel/Propreties/Component/Links.js +17 -7
- package/uform/panel/Propreties/Component/OptionTable.js +17 -7
- package/uform/panel/Propreties/Component/RegexpModal.js +17 -7
- package/uform/panel/Propreties/Component/Validate.js +17 -7
- package/uform/panel/Propreties/Component/ValidateAsyncFunction.js +17 -7
- package/uform/panel/Propreties/Component/ValidateSyncFunction.js +17 -7
- package/uform/panel/Propreties/FieldOptions.js +17 -7
- package/uform/panel/Propreties/FieldProperties.js +17 -7
- package/uform/panel/Propreties/_ItemAdvance.js +17 -7
- package/uform/panel/Propreties/_ItemBase.js +17 -7
- package/uform/panel/Propreties/_ItemLink.js +17 -7
- package/uform/panel/Propreties/_ItemValidate.js +17 -7
- package/uform/schema.d.ts +1 -1
- package/uform/utils/Convert.js +2 -2
- package/utils/Ajax.d.ts +3 -0
- package/utils/Ajax.js +10 -7
- package/utils/CacheUtil.d.ts +1 -1
- package/utils/Const.js +17 -7
- package/utils/Format.d.ts +138 -14
- package/utils/Format.js +127 -13
- package/utils/Global.d.ts +12 -0
- package/utils/Global.js +7 -1
- package/utils/PageUtil.d.ts +111 -23
- package/utils/PageUtil.js +163 -28
- package/utils/Renders/ApiGetRender.js +20 -10
- package/utils/Renders/ApiPostRender.js +3 -3
- package/utils/Renders/CondictionRender.js +17 -7
- package/utils/Renders/DateRender.js +20 -2
- package/utils/Renders/ListRender.js +1 -1
- package/utils/Renders/NumberRender.js +24 -5
- package/utils/Renders/StringRender.js +81 -11
- package/utils/Renders/_define.d.ts +8 -7
- package/utils/Renders/_define.js +76 -17
- package/utils/StringUtil.d.ts +292 -62
- package/utils/StringUtil.js +310 -63
- package/utils/TreeUtil.js +14 -10
- package/utils/VAP.d.ts +26 -1
- package/utils/VAP.js +57 -0
- package/utils/_AjaxUtil.d.ts +1 -0
- package/utils/_AjaxUtil.js +70 -3
- package/utils/_Support.d.ts +2 -2
- package/utils/_Support.js +4 -2
- package/utils/crontab/crontabRender.js +0 -1
- package/utils/i18n.d.ts +13 -2
- package/utils/i18n.js +13 -2
- package/utils/index.d.ts +4 -0
- package/utils/index.js +19 -9
- package/components/SearchTool/_FieldType.d.ts +0 -8
- package/components/SearchTool/_FieldType.js +0 -51
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
import type { PlainObject, BaseOption, BaseItem } from '../../../basetype';
|
|
2
|
+
/**
|
|
3
|
+
*
|
|
4
|
+
| 类型 | 说明 |
|
|
5
|
+
| --- | --- |
|
|
6
|
+
| text ||
|
|
7
|
+
*
|
|
8
|
+
*/
|
|
9
|
+
export declare const _FieldType: readonly ["text", "number", "select", "multi-select", "radio", "radio-button", "checkbox", "switch", "date", "daterange", "daterange-single", "datetime", "datetimerange", "datetimerange-single", "month", "monthrange", "stree-select", "dtree-select", "ftree-select", "multi-stree-select", "multi-dtree-select", "multi-ftree-select", "autocomplete"];
|
|
10
|
+
/**
|
|
11
|
+
* 当没有指定 keyword时,SearchBar的配置参数
|
|
12
|
+
* 指字 keyword 时,将出以弹出方式展示
|
|
13
|
+
*/
|
|
14
|
+
export type SearchBarByFieldProps = {
|
|
15
|
+
/**
|
|
16
|
+
* 禁用
|
|
17
|
+
*/
|
|
18
|
+
disabled?: boolean;
|
|
19
|
+
/**
|
|
20
|
+
* searchBar扩展类名称
|
|
21
|
+
*/
|
|
22
|
+
className?: string;
|
|
23
|
+
/**
|
|
24
|
+
* 1. 传一个字,代表 inside 模式宽度
|
|
25
|
+
* 2. 传一个数字数组,
|
|
26
|
+
* 代表 outside 模式 [label宽度,input宽度]
|
|
27
|
+
* 或是 inside 模式加各的结果
|
|
28
|
+
*/
|
|
29
|
+
fieldWidth?: number | [number, number];
|
|
30
|
+
/**
|
|
31
|
+
* 搜索参数
|
|
32
|
+
*/
|
|
33
|
+
fields?: Field[];
|
|
34
|
+
/**
|
|
35
|
+
* 搜索参数支持的列,最多支持4,默认为3
|
|
36
|
+
*/
|
|
37
|
+
cols?: 1 | 2 | 3 | 4;
|
|
38
|
+
/**
|
|
39
|
+
* 变量有变动时使用
|
|
40
|
+
*/
|
|
41
|
+
onChange?: (param: PlainObject) => void;
|
|
42
|
+
/**
|
|
43
|
+
* 搜索被触发时
|
|
44
|
+
*/
|
|
45
|
+
onSearch: (param: PlainObject) => void;
|
|
46
|
+
/**
|
|
47
|
+
* 显示更多时触发
|
|
48
|
+
*/
|
|
49
|
+
onExpand?: (isShowMore: boolean) => void;
|
|
50
|
+
/**
|
|
51
|
+
* 默认参数
|
|
52
|
+
*/
|
|
53
|
+
default?: any;
|
|
54
|
+
/**
|
|
55
|
+
* 用于单独使用时,不需要按钮的情况
|
|
56
|
+
*/
|
|
57
|
+
hideAction?: boolean;
|
|
58
|
+
};
|
|
59
|
+
export type KeyWord = true | {
|
|
60
|
+
/**
|
|
61
|
+
* 提示,默认为 "请填写关键字"
|
|
62
|
+
*/
|
|
63
|
+
placeholder?: string;
|
|
64
|
+
/**
|
|
65
|
+
* 需要高亮的字段
|
|
66
|
+
* 高亮设定: 说明:高亮设定后, column 指定的 render 会失效
|
|
67
|
+
*/
|
|
68
|
+
highlight?: string[];
|
|
69
|
+
};
|
|
70
|
+
export type SearchBarProps = SearchBarByFieldProps & {
|
|
71
|
+
keyword?: KeyWord;
|
|
72
|
+
};
|
|
73
|
+
/**
|
|
74
|
+
* 搜索条件字段
|
|
75
|
+
*/
|
|
76
|
+
export type Field = BaseItem & {
|
|
77
|
+
/**
|
|
78
|
+
* api通信对应条件的字段
|
|
79
|
+
*/
|
|
80
|
+
field: string;
|
|
81
|
+
/**
|
|
82
|
+
* 字段标签
|
|
83
|
+
*/
|
|
84
|
+
label: string;
|
|
85
|
+
/**
|
|
86
|
+
* 默认为1,最多为3,超过3按3算,小于1 按1算,
|
|
87
|
+
* 可以参考 antd Descriptions / DescriptionItem 里面文档里面的 span 的用法
|
|
88
|
+
* */
|
|
89
|
+
span?: number;
|
|
90
|
+
/**
|
|
91
|
+
* 字段类型,目前支持
|
|
92
|
+
* text 文本输入(默认)
|
|
93
|
+
* number 文本输入(数字)
|
|
94
|
+
* autocomplete 文本输入(自动完成)
|
|
95
|
+
* select 普通选择器
|
|
96
|
+
* multiselect 多项选择器
|
|
97
|
+
* dictselect 字典选择器(必须指定字典ID)
|
|
98
|
+
* treeselect 静态树选择器(暂不支持动态树)
|
|
99
|
+
* inputselect 输入框,但有辅助选项
|
|
100
|
+
* radio 单选框(强㓡使用外置Label)
|
|
101
|
+
* checkbox 复选框(强制使用外围Label)
|
|
102
|
+
* datetime 时间(如 2010-06-25 12:00:00)
|
|
103
|
+
* date 日期 (如 2010-06-25)
|
|
104
|
+
* month 月份 (如 2010-06-01) 返回选择月份的首日
|
|
105
|
+
* timerange 时间区间
|
|
106
|
+
* daterange 日期区间
|
|
107
|
+
*
|
|
108
|
+
*
|
|
109
|
+
* 支持中:
|
|
110
|
+
* radiomore 单选,可自定义更多
|
|
111
|
+
* switch 双状态切换
|
|
112
|
+
* sider 区间划动
|
|
113
|
+
*/
|
|
114
|
+
type?: typeof _FieldType[number] | (string & {});
|
|
115
|
+
/**
|
|
116
|
+
* 输入框里面的提示
|
|
117
|
+
*/
|
|
118
|
+
placeholder?: string;
|
|
119
|
+
/**
|
|
120
|
+
* 是否可以清除 支持 text
|
|
121
|
+
* */
|
|
122
|
+
allowClear?: boolean;
|
|
123
|
+
/**
|
|
124
|
+
* select / multiselect / radio / checkbox 时,需要带的选项
|
|
125
|
+
* 使用方法1: 传入一个数组 ,以 {name:string,value:string|number} 的结构传入
|
|
126
|
+
* 使用方法2: 传入一个对象, 以 data: any[] 传入选项数据,再指定 name : stirng, value : string 来指定需要显示在页面的名称和选中后的取值
|
|
127
|
+
*/
|
|
128
|
+
options?: BaseOption[];
|
|
129
|
+
/**
|
|
130
|
+
* 扩展属性,具体使用方法后续说明
|
|
131
|
+
* */
|
|
132
|
+
config?: any;
|
|
133
|
+
};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports._FieldType = void 0;
|
|
4
|
+
/**
|
|
5
|
+
*
|
|
6
|
+
| 类型 | 说明 |
|
|
7
|
+
| --- | --- |
|
|
8
|
+
| text ||
|
|
9
|
+
*
|
|
10
|
+
*/
|
|
11
|
+
exports._FieldType = [
|
|
12
|
+
'text',
|
|
13
|
+
'number',
|
|
14
|
+
'select',
|
|
15
|
+
'multi-select',
|
|
16
|
+
'radio',
|
|
17
|
+
'radio-button',
|
|
18
|
+
'checkbox',
|
|
19
|
+
'switch',
|
|
20
|
+
'date',
|
|
21
|
+
'daterange',
|
|
22
|
+
'daterange-single',
|
|
23
|
+
'datetime',
|
|
24
|
+
'datetimerange',
|
|
25
|
+
'datetimerange-single',
|
|
26
|
+
'month',
|
|
27
|
+
'monthrange',
|
|
28
|
+
'stree-select',
|
|
29
|
+
'dtree-select',
|
|
30
|
+
'ftree-select',
|
|
31
|
+
'multi-stree-select',
|
|
32
|
+
'multi-dtree-select',
|
|
33
|
+
'multi-ftree-select',
|
|
34
|
+
'autocomplete',
|
|
35
|
+
];
|
|
@@ -1,63 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
export type Field = BaseItem & {
|
|
7
|
-
/**
|
|
8
|
-
* api通信对应条件的字段
|
|
9
|
-
*/
|
|
10
|
-
field: string;
|
|
11
|
-
/**
|
|
12
|
-
* 字段标签
|
|
13
|
-
*/
|
|
14
|
-
label: string;
|
|
15
|
-
/**
|
|
16
|
-
* 默认为1,最多为3,超过3按3算,小于1 按1算,
|
|
17
|
-
* 可以参考 antd Descriptions / DescriptionItem 里面文档里面的 span 的用法
|
|
18
|
-
* */
|
|
19
|
-
span?: number;
|
|
20
|
-
/**
|
|
21
|
-
* 字段类型,目前支持
|
|
22
|
-
* text 文本输入(默认)
|
|
23
|
-
* number 文本输入(数字)
|
|
24
|
-
* autocomplete 文本输入(自动完成)
|
|
25
|
-
* select 普通选择器
|
|
26
|
-
* multiselect 多项选择器
|
|
27
|
-
* dictselect 字典选择器(必须指定字典ID)
|
|
28
|
-
* treeselect 静态树选择器(暂不支持动态树)
|
|
29
|
-
* inputselect 输入框,但有辅助选项
|
|
30
|
-
* radio 单选框(强㓡使用外置Label)
|
|
31
|
-
* checkbox 复选框(强制使用外围Label)
|
|
32
|
-
* datetime 时间(如 2010-06-25 12:00:00)
|
|
33
|
-
* date 日期 (如 2010-06-25)
|
|
34
|
-
* month 月份 (如 2010-06-01) 返回选择月份的首日
|
|
35
|
-
* timerange 时间区间
|
|
36
|
-
* daterange 日期区间
|
|
37
|
-
*
|
|
38
|
-
*
|
|
39
|
-
* 支持中:
|
|
40
|
-
* radiomore 单选,可自定义更多
|
|
41
|
-
* switch 双状态切换
|
|
42
|
-
* sider 区间划动
|
|
43
|
-
*/
|
|
44
|
-
type?: typeof _FieldType[number] | (string & {});
|
|
45
|
-
/**
|
|
46
|
-
* 输入框里面的提示
|
|
47
|
-
*/
|
|
48
|
-
placeholder?: string;
|
|
49
|
-
/**
|
|
50
|
-
* 是否可以清除 支持 text
|
|
51
|
-
* */
|
|
52
|
-
allowClear?: boolean;
|
|
53
|
-
/**
|
|
54
|
-
* select / multiselect / radio / checkbox 时,需要带的选项
|
|
55
|
-
* 使用方法1: 传入一个数组 ,以 {name:string,value:string|number} 的结构传入
|
|
56
|
-
* 使用方法2: 传入一个对象, 以 data: any[] 传入选项数据,再指定 name : stirng, value : string 来指定需要显示在页面的名称和选中后的取值
|
|
57
|
-
*/
|
|
58
|
-
options?: BaseOption[];
|
|
59
|
-
/**
|
|
60
|
-
* 扩展属性,具体使用方法后续说明
|
|
61
|
-
* */
|
|
62
|
-
config?: any;
|
|
63
|
-
};
|
|
1
|
+
export { SearchBand } from './SearchBand';
|
|
2
|
+
export type { SearchBandProps, SearchBandFiled } from './SearchBand/type';
|
|
3
|
+
export { SearchBar } from './SearchBar';
|
|
4
|
+
export type { SearchBarProps, } from './SearchBar/type';
|
|
5
|
+
export { Field } from './SearchBar/type';
|
|
@@ -1,2 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SearchBar = exports.SearchBand = void 0;
|
|
4
|
+
var SearchBand_1 = require("./SearchBand");
|
|
5
|
+
Object.defineProperty(exports, "SearchBand", { enumerable: true, get: function () { return SearchBand_1.SearchBand; } });
|
|
6
|
+
var SearchBar_1 = require("./SearchBar");
|
|
7
|
+
Object.defineProperty(exports, "SearchBar", { enumerable: true, get: function () { return SearchBar_1.SearchBar; } });
|
|
@@ -3,16 +3,14 @@ import type { BaseTableProps } from './index';
|
|
|
3
3
|
import type { ApiModel } from '../../hooks/_list';
|
|
4
4
|
import type { ApiOption } from '../../hooks/useApiBase';
|
|
5
5
|
export type ApiTableProps = BaseTableProps & Pick<ApiOption, 'api' | 'aop' | 'tipDisabled' | 'tipField'>;
|
|
6
|
-
export declare const ApiTable: React.ForwardRefExoticComponent<import("./index").TableDefine & {
|
|
7
|
-
|
|
6
|
+
export declare const ApiTable: React.ForwardRefExoticComponent<import("./index").TableDefine & Pick<import("../..").BoxProps, "default" | "mode" | "selectBar"> & {
|
|
7
|
+
searchBar?: Omit<import("../SearchTool").SearchBarProps, "onChange" | "onSearch">;
|
|
8
|
+
} & {
|
|
8
9
|
columns: import("./index").TableCol[];
|
|
9
|
-
showIndex?:
|
|
10
|
+
showIndex?: false | string;
|
|
10
11
|
rowKey?: string;
|
|
11
12
|
select?: true | "DEFAULT" | "QUERY";
|
|
12
13
|
selectDisabled?: (record: any) => boolean;
|
|
13
|
-
actionBar?:
|
|
14
|
-
selectBar?: import("../Box/SelectBar").SelectBarProps;
|
|
15
|
-
searchBar?: Omit<import("../..").SearchBarProps, "onChange" | "onSearch">;
|
|
16
|
-
default?: import("../..").PlainObject;
|
|
14
|
+
actionBar?: Array<import("./Components/ActionBar").TableActionButton[]> | React.ReactNode;
|
|
17
15
|
autoLoad?: false;
|
|
18
16
|
} & Pick<ApiOption, "api" | "tipField" | "tipDisabled" | "aop"> & React.RefAttributes<ApiModel>>;
|
|
@@ -26,13 +26,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
26
26
|
}) : function(o, v) {
|
|
27
27
|
o["default"] = v;
|
|
28
28
|
});
|
|
29
|
-
var __importStar = (this && this.__importStar) || function (
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
};
|
|
29
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
30
|
+
var ownKeys = function(o) {
|
|
31
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
32
|
+
var ar = [];
|
|
33
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
34
|
+
return ar;
|
|
35
|
+
};
|
|
36
|
+
return ownKeys(o);
|
|
37
|
+
};
|
|
38
|
+
return function (mod) {
|
|
39
|
+
if (mod && mod.__esModule) return mod;
|
|
40
|
+
var result = {};
|
|
41
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
42
|
+
__setModuleDefault(result, mod);
|
|
43
|
+
return result;
|
|
44
|
+
};
|
|
45
|
+
})();
|
|
36
46
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
37
47
|
exports.ApiTable = void 0;
|
|
38
48
|
var react_1 = __importStar(require("react"));
|
|
@@ -3,17 +3,15 @@ import type { ModalProps } from '../_adapt/Modal';
|
|
|
3
3
|
import type { ApiTableProps } from './ApiTable';
|
|
4
4
|
import type { ApiModel } from '../../hooks/_list';
|
|
5
5
|
export type ApiTableModalProps = ApiTableProps & ModalProps;
|
|
6
|
-
export declare const ApiTableModal: React.ForwardRefExoticComponent<import(".").TableDefine & {
|
|
7
|
-
|
|
6
|
+
export declare const ApiTableModal: React.ForwardRefExoticComponent<import(".").TableDefine & Pick<import("../..").BoxProps, "default" | "mode" | "selectBar"> & {
|
|
7
|
+
searchBar?: Omit<import("../SearchTool").SearchBarProps, "onChange" | "onSearch">;
|
|
8
|
+
} & {
|
|
8
9
|
columns: import(".").TableCol[];
|
|
9
|
-
showIndex?:
|
|
10
|
+
showIndex?: false | string;
|
|
10
11
|
rowKey?: string;
|
|
11
12
|
select?: true | "DEFAULT" | "QUERY";
|
|
12
13
|
selectDisabled?: (record: any) => boolean;
|
|
13
|
-
actionBar?:
|
|
14
|
-
selectBar?: import("../Box/SelectBar").SelectBarProps;
|
|
15
|
-
searchBar?: Omit<import("../..").SearchBarProps, "onChange" | "onSearch">;
|
|
16
|
-
default?: import("../..").PlainObject;
|
|
14
|
+
actionBar?: Array<import("./Components/ActionBar").TableActionButton[]> | React.ReactNode;
|
|
17
15
|
autoLoad?: false;
|
|
18
16
|
} & Pick<import("../../hooks/useApiBase").ApiOption, "api" | "tipField" | "tipDisabled" | "aop"> & Omit<import("antd/es/modal").ModalProps, "visible" | "onCancel" | "onOk"> & {
|
|
19
17
|
open?: boolean;
|
|
@@ -26,13 +26,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
26
26
|
}) : function(o, v) {
|
|
27
27
|
o["default"] = v;
|
|
28
28
|
});
|
|
29
|
-
var __importStar = (this && this.__importStar) || function (
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
};
|
|
29
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
30
|
+
var ownKeys = function(o) {
|
|
31
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
32
|
+
var ar = [];
|
|
33
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
34
|
+
return ar;
|
|
35
|
+
};
|
|
36
|
+
return ownKeys(o);
|
|
37
|
+
};
|
|
38
|
+
return function (mod) {
|
|
39
|
+
if (mod && mod.__esModule) return mod;
|
|
40
|
+
var result = {};
|
|
41
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
42
|
+
__setModuleDefault(result, mod);
|
|
43
|
+
return result;
|
|
44
|
+
};
|
|
45
|
+
})();
|
|
36
46
|
var __read = (this && this.__read) || function (o, n) {
|
|
37
47
|
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
38
48
|
if (!m) return o;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { FC
|
|
1
|
+
import type { FC } from 'react';
|
|
2
2
|
import type { Key, PlainObject } from '../../../basetype';
|
|
3
3
|
import type { ActButton } from '../../SearchTool/SearchBar/ActionButtons';
|
|
4
4
|
export type TableAction = (ids?: Key[], objs?: PlainObject[], param?: PlainObject) => void;
|
|
@@ -22,16 +22,13 @@ export type TableActionButton = Omit<ActButton, 'onClick' | 'children'> & {
|
|
|
22
22
|
*/
|
|
23
23
|
children?: TableActionButton[];
|
|
24
24
|
};
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
onSelected: () => void;
|
|
25
|
+
type TableActionBarProps = {
|
|
26
|
+
buttons: Array<TableActionButton | null | false>;
|
|
28
27
|
};
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
};
|
|
34
|
-
export declare const ActionBar: FC<TableActionBar>;
|
|
28
|
+
/**
|
|
29
|
+
* 说明: 此ActionBar 仅供VTable使用
|
|
30
|
+
* */
|
|
31
|
+
export declare const VTableActionBar: FC<TableActionBarProps>;
|
|
35
32
|
/**
|
|
36
33
|
* 通用添加按钮
|
|
37
34
|
*/
|
|
@@ -26,79 +26,76 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
26
26
|
}) : function(o, v) {
|
|
27
27
|
o["default"] = v;
|
|
28
28
|
});
|
|
29
|
-
var __importStar = (this && this.__importStar) || function (
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
};
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
47
|
-
}
|
|
48
|
-
finally { if (e) throw e.error; }
|
|
49
|
-
}
|
|
50
|
-
return ar;
|
|
51
|
-
};
|
|
29
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
30
|
+
var ownKeys = function(o) {
|
|
31
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
32
|
+
var ar = [];
|
|
33
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
34
|
+
return ar;
|
|
35
|
+
};
|
|
36
|
+
return ownKeys(o);
|
|
37
|
+
};
|
|
38
|
+
return function (mod) {
|
|
39
|
+
if (mod && mod.__esModule) return mod;
|
|
40
|
+
var result = {};
|
|
41
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
42
|
+
__setModuleDefault(result, mod);
|
|
43
|
+
return result;
|
|
44
|
+
};
|
|
45
|
+
})();
|
|
52
46
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
53
47
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
54
48
|
};
|
|
55
49
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
56
|
-
exports.BUTTON_EXPORT = exports.BUTTON_IMPORT = exports.BUTTON_MORE = exports.BUTTON_DELETE = exports.BUTTON_ADD = exports.
|
|
50
|
+
exports.BUTTON_EXPORT = exports.BUTTON_IMPORT = exports.BUTTON_MORE = exports.BUTTON_DELETE = exports.BUTTON_ADD = exports.VTableActionBar = void 0;
|
|
57
51
|
var react_1 = __importStar(require("react"));
|
|
58
52
|
var lodash_1 = __importDefault(require("lodash"));
|
|
59
53
|
var ActionButtons_1 = require("../../SearchTool/SearchBar/ActionButtons");
|
|
60
54
|
var _i18n_1 = require("../../_i18n");
|
|
61
55
|
var i18n_1 = require("../../../utils/i18n");
|
|
62
|
-
var
|
|
63
|
-
var convertButton = function (item, selectedRowKeys,
|
|
56
|
+
var useTableContext_1 = require("./useTableContext");
|
|
57
|
+
var convertButton = function (item, selectedRowKeys, contextRef) {
|
|
64
58
|
var btn = __assign({}, item);
|
|
65
59
|
if (item.mustSelected)
|
|
66
60
|
btn.disabled = selectedRowKeys.length <= 0;
|
|
67
61
|
if (item.onClick)
|
|
68
|
-
btn.onClick = function () {
|
|
62
|
+
btn.onClick = function () {
|
|
63
|
+
item.onClick(contextRef.current.selectedRowKeys, contextRef.current.selectedObjects, contextRef.current.param);
|
|
64
|
+
};
|
|
69
65
|
return btn;
|
|
70
66
|
};
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
67
|
+
/**
|
|
68
|
+
* 说明: 此ActionBar 仅供VTable使用
|
|
69
|
+
* */
|
|
70
|
+
var VTableActionBar = function (props) {
|
|
71
|
+
var _a = (0, useTableContext_1.useTableContext)(), selectedRowKeys = _a.selectedRowKeys, selectedObjects = _a.selectedObjects, param = _a.param;
|
|
72
|
+
var contextRef = (0, react_1.useRef)({ selectedRowKeys: selectedRowKeys, selectedObjects: selectedObjects, param: param });
|
|
73
|
+
(0, react_1.useEffect)(function () {
|
|
74
|
+
contextRef.current = { selectedRowKeys: selectedRowKeys, selectedObjects: selectedObjects, param: param };
|
|
75
|
+
}, [selectedRowKeys, selectedObjects, param]);
|
|
79
76
|
var buttons = (0, react_1.useMemo)(function () {
|
|
80
77
|
var btns = [];
|
|
81
|
-
(props.buttons || []).
|
|
78
|
+
(props.buttons || []).forEach(function (btn) {
|
|
82
79
|
if (btn === false)
|
|
83
80
|
return;
|
|
84
81
|
if (btn === null) {
|
|
85
82
|
btns.push(null);
|
|
86
83
|
return;
|
|
87
84
|
}
|
|
88
|
-
var sub = convertButton(btn, selectedRowKeys,
|
|
85
|
+
var sub = convertButton(btn, selectedRowKeys, contextRef);
|
|
89
86
|
if (lodash_1.default.isArray(btn.children) && btn.children.length > 0) {
|
|
90
87
|
sub.children = [];
|
|
91
88
|
btn.children.map(function (item) {
|
|
92
|
-
sub.children.push(convertButton(item, selectedRowKeys,
|
|
89
|
+
sub.children.push(convertButton(item, selectedRowKeys, contextRef));
|
|
93
90
|
});
|
|
94
91
|
}
|
|
95
92
|
btns.push(sub);
|
|
96
93
|
});
|
|
97
94
|
return btns;
|
|
98
|
-
}, [
|
|
95
|
+
}, [props.buttons, selectedRowKeys]);
|
|
99
96
|
return react_1.default.createElement(ActionButtons_1.ActionButtons, { buttons: buttons });
|
|
100
97
|
};
|
|
101
|
-
exports.
|
|
98
|
+
exports.VTableActionBar = VTableActionBar;
|
|
102
99
|
/**
|
|
103
100
|
* 通用添加按钮
|
|
104
101
|
*/
|
|
@@ -128,3 +125,39 @@ exports.BUTTON_IMPORT = BUTTON_IMPORT;
|
|
|
128
125
|
*/
|
|
129
126
|
var BUTTON_EXPORT = function (onClick, props) { return (__assign(__assign({ label: (0, i18n_1.txt)(_i18n_1.V.BTN_EXPORT), icon: 'export' }, props), { onClick: onClick })); };
|
|
130
127
|
exports.BUTTON_EXPORT = BUTTON_EXPORT;
|
|
128
|
+
// import { useLayoutEffect } from 'react';
|
|
129
|
+
// import { useUpdate } from '../../../hooks'
|
|
130
|
+
// type TableActionBar = {
|
|
131
|
+
// buttons: (TableActionButton | null | false)[],
|
|
132
|
+
// queryParam: PlainObject
|
|
133
|
+
// selectedRef: MutableRefObject<any>
|
|
134
|
+
// }
|
|
135
|
+
// export const ActionBar: FC<TableActionBar> = props => {
|
|
136
|
+
// const update = useUpdate();
|
|
137
|
+
// useLayoutEffect(() => {
|
|
138
|
+
// props.selectedRef.current.onSelected = () => {
|
|
139
|
+
// update();
|
|
140
|
+
// }
|
|
141
|
+
// }, [])
|
|
142
|
+
// const [selectedRowKeys, selectedObjects] = props.selectedRef.current.selected;
|
|
143
|
+
// const buttons = useMemo(() => {
|
|
144
|
+
// const btns = [];
|
|
145
|
+
// (props.buttons || []).map(btn => {
|
|
146
|
+
// if (btn === false) return;
|
|
147
|
+
// if (btn === null) {
|
|
148
|
+
// btns.push(null);
|
|
149
|
+
// return;
|
|
150
|
+
// }
|
|
151
|
+
// let sub = convertButton(btn, selectedRowKeys, selectedObjects, props.queryParam);
|
|
152
|
+
// if (_.isArray(btn.children) && btn.children.length > 0) {
|
|
153
|
+
// sub.children = [];
|
|
154
|
+
// btn.children.map(item => {
|
|
155
|
+
// sub.children.push(convertButton(item, selectedRowKeys, selectedObjects, props.queryParam))
|
|
156
|
+
// })
|
|
157
|
+
// }
|
|
158
|
+
// btns.push(sub);
|
|
159
|
+
// });
|
|
160
|
+
// return btns;
|
|
161
|
+
// }, [selectedRowKeys, props.buttons, props.queryParam])
|
|
162
|
+
// return <ActionButtons buttons={buttons} />
|
|
163
|
+
// }
|
|
@@ -42,6 +42,8 @@ export type CustomAcitonProps = ActionPorps & {
|
|
|
42
42
|
};
|
|
43
43
|
export declare const INFO: FC<ActionPorps>;
|
|
44
44
|
export declare const EDIT: FC<ActionPorps>;
|
|
45
|
-
export declare const DELETE: FC<ActionPorps
|
|
45
|
+
export declare const DELETE: FC<ActionPorps & {
|
|
46
|
+
confirm?: ReactNode;
|
|
47
|
+
}>;
|
|
46
48
|
export declare const ACTION: FC<CustomAcitonProps>;
|
|
47
49
|
export declare const COL_OPERACTION: (props: TableColumn | ((value: any, record: any, index: number) => ReactNode)) => TableColumn;
|
|
@@ -10,12 +10,45 @@ var __assign = (this && this.__assign) || function () {
|
|
|
10
10
|
};
|
|
11
11
|
return __assign.apply(this, arguments);
|
|
12
12
|
};
|
|
13
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
14
|
+
if (k2 === undefined) k2 = k;
|
|
15
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
16
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
17
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
18
|
+
}
|
|
19
|
+
Object.defineProperty(o, k2, desc);
|
|
20
|
+
}) : (function(o, m, k, k2) {
|
|
21
|
+
if (k2 === undefined) k2 = k;
|
|
22
|
+
o[k2] = m[k];
|
|
23
|
+
}));
|
|
24
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
25
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
26
|
+
}) : function(o, v) {
|
|
27
|
+
o["default"] = v;
|
|
28
|
+
});
|
|
29
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
30
|
+
var ownKeys = function(o) {
|
|
31
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
32
|
+
var ar = [];
|
|
33
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
34
|
+
return ar;
|
|
35
|
+
};
|
|
36
|
+
return ownKeys(o);
|
|
37
|
+
};
|
|
38
|
+
return function (mod) {
|
|
39
|
+
if (mod && mod.__esModule) return mod;
|
|
40
|
+
var result = {};
|
|
41
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
42
|
+
__setModuleDefault(result, mod);
|
|
43
|
+
return result;
|
|
44
|
+
};
|
|
45
|
+
})();
|
|
13
46
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
14
47
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
15
48
|
};
|
|
16
49
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
50
|
exports.COL_OPERACTION = exports.ACTION = exports.DELETE = exports.EDIT = exports.INFO = void 0;
|
|
18
|
-
var react_1 =
|
|
51
|
+
var react_1 = __importStar(require("react"));
|
|
19
52
|
var lodash_1 = __importDefault(require("lodash"));
|
|
20
53
|
var Popconfirm_1 = require("../../_adapt/Popconfirm");
|
|
21
54
|
var Icon_1 = require("../../_adapt/Icon");
|
|
@@ -48,8 +81,12 @@ var DELETE = function (props) {
|
|
|
48
81
|
if (props.roleCode && !utils_1.PageUtil.hasRole(props.roleCode))
|
|
49
82
|
return utils_1.Const.NONE;
|
|
50
83
|
var title = utils_1.i18n.getText(props.ik, props.title, _i18n_1.V.ACT_DELETE);
|
|
51
|
-
var popTitle =
|
|
52
|
-
|
|
84
|
+
var popTitle = (0, react_1.useMemo)(function () {
|
|
85
|
+
if (props.confirm)
|
|
86
|
+
return props.confirm;
|
|
87
|
+
return react_1.default.createElement("span", null, utils_1.i18n.txt(_i18n_1.V.ACT_DELETE_CONFIRM, props.name || ''));
|
|
88
|
+
}, []);
|
|
89
|
+
return react_1.default.createElement(Popconfirm_1.Popconfirm, { onConfirm: function (e) { return utils_1.PageUtil.stopEvent(e, function () { return props.onClick(); }); }, placement: "right", title: popTitle, overlayClassName: 'c-table-action-confirm' },
|
|
53
90
|
react_1.default.createElement("span", { className: DEFAULT_CLASS.DELETE, title: "".concat(title, " ").concat(props.name || '') },
|
|
54
91
|
react_1.default.createElement(Icon_1.Icon, { type: 'delete' }),
|
|
55
92
|
react_1.default.createElement("span", null, title)));
|
|
@@ -6,7 +6,9 @@ export declare const defineTable: (table: TableDefined) => void;
|
|
|
6
6
|
export type TableDefined = {
|
|
7
7
|
INFO: FC<ActionPorps>;
|
|
8
8
|
EDIT: FC<ActionPorps>;
|
|
9
|
-
DELETE: FC<ActionPorps
|
|
9
|
+
DELETE: FC<ActionPorps & {
|
|
10
|
+
confirm?: ReactNode;
|
|
11
|
+
}>;
|
|
10
12
|
ACTION: FC<CustomAcitonProps>;
|
|
11
13
|
COL_OPERACTION: (props: TableColumn | ((value: any, record: any, index: number) => ReactNode)) => TableColumn;
|
|
12
14
|
BUTTON_ADD: (onClick: TableAction, props?: Partial<TableActionButton>) => TableActionButton;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { VTableProps } from '../VTable';
|
|
2
|
+
import type { FC, PropsWithChildren } from 'react';
|
|
3
|
+
export type TableContext = {
|
|
4
|
+
selectedRowKeys: Array<string | number>;
|
|
5
|
+
selectedObjects: Array<any>;
|
|
6
|
+
param: any;
|
|
7
|
+
};
|
|
8
|
+
type TableAction = {
|
|
9
|
+
setParam: (param: any, clean?: boolean) => void;
|
|
10
|
+
setSelection: (selectedRowKeys: string[], selectedObjects: any[]) => void;
|
|
11
|
+
initObjects: (List: Array<any>) => void;
|
|
12
|
+
reflushPage: (List: Array<any>) => void;
|
|
13
|
+
};
|
|
14
|
+
export declare const TableContextWrapper: FC<PropsWithChildren<Pick<VTableProps, 'default' | 'defaultSelectedKeys' | 'rowKey'>>>;
|
|
15
|
+
export declare const useTableContext: () => TableContext & TableAction;
|
|
16
|
+
export {};
|