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
package/base.json
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json.schemastore.org/tsconfig",
|
|
3
|
+
"compilerOptions": {
|
|
4
|
+
"target": "ESNext",
|
|
5
|
+
"module": "ESNext",
|
|
6
|
+
"moduleResolution": "Node",
|
|
7
|
+
"lib": [
|
|
8
|
+
"DOM",
|
|
9
|
+
"DOM.Iterable",
|
|
10
|
+
"ESNext"
|
|
11
|
+
],
|
|
12
|
+
"baseUrl": "./src",
|
|
13
|
+
"allowJs": true,
|
|
14
|
+
"sourceMap": false,
|
|
15
|
+
"skipLibCheck": true,
|
|
16
|
+
"esModuleInterop": true,
|
|
17
|
+
"allowSyntheticDefaultImports": true,
|
|
18
|
+
"strict": false,
|
|
19
|
+
"forceConsistentCasingInFileNames": true,
|
|
20
|
+
"downlevelIteration": true,
|
|
21
|
+
"noFallthroughCasesInSwitch": true,
|
|
22
|
+
"noEmitOnError": true,
|
|
23
|
+
"jsx": "react",
|
|
24
|
+
"paths": {
|
|
25
|
+
"i18n": [
|
|
26
|
+
"./i18n"
|
|
27
|
+
]
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
}
|
package/basetype.d.ts
CHANGED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import type { SelectProps } from '../../components/_adapt/Select';
|
|
2
|
+
import type { PlainObject } from "../../basetype";
|
|
3
|
+
import type { FC } from "react";
|
|
4
|
+
export type AsyncSelectProps = {
|
|
5
|
+
/**
|
|
6
|
+
* 是否启用缓存,用户登录会话期间进行缓存
|
|
7
|
+
*/
|
|
8
|
+
cache?: boolean;
|
|
9
|
+
/**
|
|
10
|
+
* 下拉框数据的接口地址
|
|
11
|
+
*/
|
|
12
|
+
api?: string;
|
|
13
|
+
/**
|
|
14
|
+
* 接口参数
|
|
15
|
+
*/
|
|
16
|
+
params?: PlainObject;
|
|
17
|
+
/**
|
|
18
|
+
* 下拉框key字段
|
|
19
|
+
*/
|
|
20
|
+
valueKey?: string;
|
|
21
|
+
/**
|
|
22
|
+
* 下拉框显示字段
|
|
23
|
+
*/
|
|
24
|
+
labelKey?: string;
|
|
25
|
+
/**
|
|
26
|
+
* 下拉框排序字段
|
|
27
|
+
*/
|
|
28
|
+
sortKey?: string;
|
|
29
|
+
/**
|
|
30
|
+
* 回显数据
|
|
31
|
+
*/
|
|
32
|
+
value?: string;
|
|
33
|
+
/**
|
|
34
|
+
* 组件默认参数
|
|
35
|
+
*/
|
|
36
|
+
selectProps?: SelectProps;
|
|
37
|
+
/**
|
|
38
|
+
* 改变事件
|
|
39
|
+
* @param cValue
|
|
40
|
+
* @param option
|
|
41
|
+
* @returns
|
|
42
|
+
*/
|
|
43
|
+
onChange?: (value: any, option?: any) => void;
|
|
44
|
+
};
|
|
45
|
+
export type AsyncSelectComponent = FC<AsyncSelectProps>;
|
|
@@ -0,0 +1,207 @@
|
|
|
1
|
+
import type { ReactNode, ForwardRefExoticComponent, RefAttributes } from 'react';
|
|
2
|
+
import type { TableProps as AntdTableProps } from 'antd/es/table';
|
|
3
|
+
import type { TableActionButton } from '../../components/Tables/Components/ActionBar';
|
|
4
|
+
import type { Field } from '../../components/SearchTool/SearchBar/type';
|
|
5
|
+
/**
|
|
6
|
+
* CardTable的ref属性
|
|
7
|
+
* @example
|
|
8
|
+
* import CardTable,{CardTableRef} from '../../../Pages/components/CardTable';
|
|
9
|
+
* export default (props)=> {
|
|
10
|
+
* const tableRef = useRef<CardTableRef>(null);
|
|
11
|
+
*
|
|
12
|
+
const btnAddClick = ()=> {
|
|
13
|
+
|
|
14
|
+
tableRef.current.query(); //重新加载列表数据,不带参数
|
|
15
|
+
|
|
16
|
+
tableRef.current.query({keyword_: "测试"}); //重新加载列表数据,带参数
|
|
17
|
+
|
|
18
|
+
//获取列表当前查询条件
|
|
19
|
+
let param = tableRef.current.getParams();
|
|
20
|
+
|
|
21
|
+
//获取列表当前选择的数据
|
|
22
|
+
let selected = tableRef.current.getSelected();
|
|
23
|
+
console.log("btnAddClick param",param);
|
|
24
|
+
console.log("btnAddClick selected",selected);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
return <React.Fragment>
|
|
28
|
+
<CardTable
|
|
29
|
+
api="/api/system/manager/p"
|
|
30
|
+
className="myCardTable1"
|
|
31
|
+
fieldTitle="niceName"
|
|
32
|
+
ref={tableRef}
|
|
33
|
+
searchBar={{
|
|
34
|
+
keyword:{
|
|
35
|
+
placeholder: "请输入帐号/姓名/创建人"
|
|
36
|
+
},
|
|
37
|
+
advancedQuery:{
|
|
38
|
+
cols:1,
|
|
39
|
+
fields:[
|
|
40
|
+
{ label: '帐号', field: 'account' },
|
|
41
|
+
{ label: '姓名', field: 'niceName' },
|
|
42
|
+
{ label: '角色', field: 'roleIds', type:'select',options: roleOption},
|
|
43
|
+
{ label: '创建者', field: 'creatorNiceName' },
|
|
44
|
+
{ label: '创建时间', field: 'updateTimeBegin,updateTimeEnd', type: 'daterange-single' },
|
|
45
|
+
{ label: '启用/禁用', field: 'state',type:"radio",options: [{label:"启用",value:"Y"},{label:"禁用",value:"N"}] }
|
|
46
|
+
]
|
|
47
|
+
|
|
48
|
+
}
|
|
49
|
+
}}
|
|
50
|
+
actionBar={{
|
|
51
|
+
topButton:[
|
|
52
|
+
{ label: '刷新', icon: "sync",roleCode:"api-system-manager-p", onClick: ()=>{} },
|
|
53
|
+
{ label: '手动添加', icon: "plus",roleCode:"api-system-manager-a", onClick: () =>{btnAddClick()} },
|
|
54
|
+
VTable.BUTTON_MORE([
|
|
55
|
+
{ label: '启用/禁用', icon: "pause",roleCode:"api-system-manager-state-u0", onClick: (ids,rows) => {} },
|
|
56
|
+
{ label: '初始化密码', icon: "redo",roleCode:"api-system-manager-init-pcode", onClick: (ids,rows) => {}}
|
|
57
|
+
])
|
|
58
|
+
],
|
|
59
|
+
rowButton:{
|
|
60
|
+
buttons:[
|
|
61
|
+
{ label: '刷新', icon: "sync",roleCode:"api-system-manager-p", onClick: (ids,rows)=>{} },
|
|
62
|
+
{ label: '手动添加', icon: "plus",roleCode:"api-system-manager-a", onClick: () =>{} }
|
|
63
|
+
] ,
|
|
64
|
+
buttonMore:[
|
|
65
|
+
{ label: '启用/禁用', icon: "pause",roleCode:"api-system-manager-state-u0", onClick: (ids,rows) => {console.log(rows,ids)} },
|
|
66
|
+
{ label: '初始化密码', icon: "redo",roleCode:"api-system-manager-init-pcode", onClick: (ids,rows) => {}}
|
|
67
|
+
]
|
|
68
|
+
}
|
|
69
|
+
}}
|
|
70
|
+
columns={
|
|
71
|
+
[
|
|
72
|
+
{
|
|
73
|
+
dataIndex: 'account', title: '账号', render: (text, obj, index) => {
|
|
74
|
+
return (<a href="javascript:void(0);" className="label label-info" title="查看详情" >{text}</a>);
|
|
75
|
+
}
|
|
76
|
+
},
|
|
77
|
+
{ dataIndex: 'niceName', title: '姓名' }
|
|
78
|
+
]
|
|
79
|
+
}
|
|
80
|
+
/>
|
|
81
|
+
* </React.Fragment>
|
|
82
|
+
* }
|
|
83
|
+
*/
|
|
84
|
+
export type CardTableRef = {
|
|
85
|
+
/**
|
|
86
|
+
* 获取选中的数据
|
|
87
|
+
*/
|
|
88
|
+
getSelected: () => [String[], Record<string, any>[]];
|
|
89
|
+
/**
|
|
90
|
+
* 清除选中的数据
|
|
91
|
+
*/
|
|
92
|
+
clearSelected: () => void;
|
|
93
|
+
/**
|
|
94
|
+
* 获取列表查询条件
|
|
95
|
+
*/
|
|
96
|
+
getParams: () => Record<string, any>;
|
|
97
|
+
/**
|
|
98
|
+
* 按条件查询数据
|
|
99
|
+
*/
|
|
100
|
+
query: (param?: Record<string, any> | null) => void;
|
|
101
|
+
[key: string]: any;
|
|
102
|
+
};
|
|
103
|
+
export type SearchBarProps = {
|
|
104
|
+
/**
|
|
105
|
+
* 模糊搜索,普通搜索,当不为null时,会在表格顶部显示一个模糊搜索框,默认为null——不显示模糊搜索框
|
|
106
|
+
*/
|
|
107
|
+
keyword: null | {
|
|
108
|
+
/**
|
|
109
|
+
* 搜索框中显示的提示信息,默认显示“请输入内容”,如果为null或空字符串,则输入框中不显示提示信息
|
|
110
|
+
*/
|
|
111
|
+
placeholder?: string;
|
|
112
|
+
/**
|
|
113
|
+
* 搜索框的长度,例如:'300' 或 '300px'
|
|
114
|
+
*/
|
|
115
|
+
width?: string;
|
|
116
|
+
/**
|
|
117
|
+
* 点击搜索按钮时传入后台的搜索条件的字段名称,不指定的话则默认为 “keyword_”,例如:{keyword_: "test"}
|
|
118
|
+
*/
|
|
119
|
+
fieldname?: string;
|
|
120
|
+
/**
|
|
121
|
+
* 模糊搜框位置,left:列表上方靠左,center:列表上方水平居中,默认是“left”
|
|
122
|
+
*/
|
|
123
|
+
position?: "left" | "center";
|
|
124
|
+
};
|
|
125
|
+
/**
|
|
126
|
+
* 高级搜索配置,为null或者其子属性fields为null、空数组时就不显示高级搜索按钮
|
|
127
|
+
*/
|
|
128
|
+
advancedQuery?: null | {
|
|
129
|
+
/**
|
|
130
|
+
* 搜索条件列表,同VTable.searchBar.fields
|
|
131
|
+
*/
|
|
132
|
+
fields: Field[];
|
|
133
|
+
/**
|
|
134
|
+
* 设置高级搜索弹窗中的搜索项的标题区域长度、输入控件区域长度,格式是:[120, 352],第一个数字是标题区域长度,第二个数字是输入控件区域长度
|
|
135
|
+
*/
|
|
136
|
+
fieldWidth?: [number, number];
|
|
137
|
+
/**
|
|
138
|
+
* 搜索参数支持的列,最多支持4,默认为3
|
|
139
|
+
*/
|
|
140
|
+
cols?: 1 | 2 | 3 | 4;
|
|
141
|
+
};
|
|
142
|
+
[key: string]: any;
|
|
143
|
+
};
|
|
144
|
+
export type ActionBarProps = {
|
|
145
|
+
/**
|
|
146
|
+
* 需要在列表上方靠右显示的功能按钮,同VTable的actionBar
|
|
147
|
+
*/
|
|
148
|
+
topButton?: (TableActionButton | null | false)[];
|
|
149
|
+
/**
|
|
150
|
+
* 需要在列表卡片内容块(一个卡片显示一条数据)中底部功能按钮显示区域显示的按钮
|
|
151
|
+
*/
|
|
152
|
+
rowButton?: {
|
|
153
|
+
/**
|
|
154
|
+
* 卡片底部直接显示展示的按钮(即不是在更多弹窗中显示的)展示效果
|
|
155
|
+
* @description 默认为“1”,1:效果一,只显示图标不显示名称;2:效果二,只显示按钮文字,不显示图标;3:效果三,即显示图标又显示名称
|
|
156
|
+
*/
|
|
157
|
+
buttonWay?: null | "1" | "2" | "3";
|
|
158
|
+
/**
|
|
159
|
+
* 卡片底部直接显示展示的按钮(即不是在更多弹窗中显示的),同VTable的actionBar
|
|
160
|
+
* @description 【注意】:按钮超过5个就展示前5个,其余的都放到更多下拉框中
|
|
161
|
+
*/
|
|
162
|
+
buttons?: (TableActionButton[]) | ReactNode;
|
|
163
|
+
/**
|
|
164
|
+
* 卡片底部展示一个更多按钮,点击或光标移上去显示下拉框显示更多的功能按钮
|
|
165
|
+
*/
|
|
166
|
+
buttonMore?: (TableActionButton[]) | ReactNode;
|
|
167
|
+
};
|
|
168
|
+
[key: string]: any;
|
|
169
|
+
};
|
|
170
|
+
export type CardTableProps = AntdTableProps<any> & {
|
|
171
|
+
/**
|
|
172
|
+
* 查询列表数据的接口地址,如果不设置该属性,或者该属性值为null,且传了dataSource,就按dataSource的数据来展示。如果api、dataSource都有值则使用api的值去查询数据
|
|
173
|
+
*/
|
|
174
|
+
api?: string;
|
|
175
|
+
/**
|
|
176
|
+
* 指定那个字段是主键(值是唯一的不重复的),如果不传默认是“id”
|
|
177
|
+
*/
|
|
178
|
+
rowKey?: string;
|
|
179
|
+
/**
|
|
180
|
+
* 默认搜索条件,如果有高级搜索时,高级搜索中查询条件控件也会按照这个设置初始值。例如:{name: "测试"}
|
|
181
|
+
*/
|
|
182
|
+
default?: any;
|
|
183
|
+
/**
|
|
184
|
+
* 搜索功能配置,包含普通搜索(一个查询输入框用来进行模糊搜索几列)和高级搜索(精确搜索,多个搜索项)
|
|
185
|
+
*/
|
|
186
|
+
searchBar?: SearchBarProps;
|
|
187
|
+
/**
|
|
188
|
+
* 功能按钮配置
|
|
189
|
+
*/
|
|
190
|
+
actionBar?: ActionBarProps;
|
|
191
|
+
/**
|
|
192
|
+
* 指定展示的数据项哪项是标题字段。
|
|
193
|
+
* @example 例如:数据是[{name:"测试",age:18}] ,columns=[{dataIndex: 'name', title: '名称'}],指定 fieldTitle=name ,则卡片第一行加粗加大显示“测试”,否则按照一般显示方式显示
|
|
194
|
+
*/
|
|
195
|
+
fieldTitle?: string;
|
|
196
|
+
/**
|
|
197
|
+
* 分页栏位置
|
|
198
|
+
*/
|
|
199
|
+
paginationPosition?: null | {
|
|
200
|
+
/**
|
|
201
|
+
* 首页、上一页、第几页按钮、下一页、尾页按钮位置,默认水平居中,left:靠左;center:水平居中;right:靠右
|
|
202
|
+
*/
|
|
203
|
+
item?: "left" | "center" | "right";
|
|
204
|
+
};
|
|
205
|
+
[key: string]: any;
|
|
206
|
+
};
|
|
207
|
+
export type CardTableComponent = ForwardRefExoticComponent<CardTableProps & RefAttributes<CardTableRef>>;
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
import type { FC, CSSProperties } from "react";
|
|
2
|
+
import type { PlainObject } from "../../basetype";
|
|
3
|
+
type CheckedArray = {
|
|
4
|
+
/**
|
|
5
|
+
* 组织机构ID
|
|
6
|
+
*/
|
|
7
|
+
id: string;
|
|
8
|
+
/**
|
|
9
|
+
* 组织机构名称
|
|
10
|
+
*/
|
|
11
|
+
name: string;
|
|
12
|
+
/**
|
|
13
|
+
* 组织机构codeUI
|
|
14
|
+
*/
|
|
15
|
+
codeUI: string;
|
|
16
|
+
/**
|
|
17
|
+
* 树节点复选框状态—— 0:非选中状态(空白);1:全选状态(绿色对勾);2:选中状态(绿色方块),包含自己;3:非选中状态(绿色横杠),不包含自己
|
|
18
|
+
*/
|
|
19
|
+
checkStats: string;
|
|
20
|
+
};
|
|
21
|
+
export interface EasyuiTreeProps {
|
|
22
|
+
/**
|
|
23
|
+
* 树组件父容器(div)的id属性值,避免一个页面上有多个树时不好区分的问题
|
|
24
|
+
*/
|
|
25
|
+
id: string;
|
|
26
|
+
/**
|
|
27
|
+
* 禁用模式状态下不可点击checkbox,其他状态可以
|
|
28
|
+
*/
|
|
29
|
+
disableMode?: boolean;
|
|
30
|
+
/**
|
|
31
|
+
* 有IP范围的组织机构ID集合,如果有数据就会自动将没有IP范围的组织机构节点名称置灰,并禁止勾选
|
|
32
|
+
*/
|
|
33
|
+
orgIdHasIp?: string[];
|
|
34
|
+
/**
|
|
35
|
+
* 是否在树节点前面显示复选框<br>
|
|
36
|
+
* true:显示(默认);false:不显示
|
|
37
|
+
*/
|
|
38
|
+
showCheckbox?: boolean;
|
|
39
|
+
/**
|
|
40
|
+
* 复选框选中的树节点。</br> 
|
|
41
|
+
* @格式 例如:{"id1":"1","id2":"3"} {"01.01":"1","01.02":"2"}<br>
|
|
42
|
+
* @description 其中冒号前面的是组织机构的id(英文字母加数字组成的)或codeUI(有“.”),
|
|
43
|
+
* 冒号后面的是选择状态——1:表示全选,本级及其所有下级都是选中状态(绿色对勾);2:表示部分选中,即本级是选中状态(绿色方块);3:表示不包含本级(绿色横杠),即
|
|
44
|
+
* tree-checkbox number 例如:tree-checkbox0、tree-checkbox1
|
|
45
|
+
*/
|
|
46
|
+
checkedKeysState?: any;
|
|
47
|
+
/**
|
|
48
|
+
* 管理员ID,即管理员表(cems_manager)中id的值,如果有值就查询其对应的有管理范围的组织机构数据进行展示,不传,默认查询当前登录的管理员的有管理范围的组织机构数据
|
|
49
|
+
*/
|
|
50
|
+
managerId?: string;
|
|
51
|
+
/**
|
|
52
|
+
* 是否获取管理区域机构树数据进行展示,默认不传该参数,默认展示组织机构树(组织机构及管理范围页对应的树)数据,用于管理员账号》管理区域配置组织机构树
|
|
53
|
+
*/
|
|
54
|
+
isManageAreaOrg?: boolean;
|
|
55
|
+
/**
|
|
56
|
+
* 是否显示禁用的树节点,默认为false(不显示),为true时表示即使树节点是禁用状态,也在页面上展示被禁用的树节点
|
|
57
|
+
*/
|
|
58
|
+
isShowDisabledNode?: boolean;
|
|
59
|
+
/**
|
|
60
|
+
* 页面标识,表示是那个页面在调用,好根据这个标识区分不同的页面,根据不同的页面做不同的处理
|
|
61
|
+
*/
|
|
62
|
+
page?: string;
|
|
63
|
+
/**
|
|
64
|
+
* 节点加载完后触发
|
|
65
|
+
*/
|
|
66
|
+
onLoad?: () => void;
|
|
67
|
+
/**
|
|
68
|
+
* 点击复选框触发
|
|
69
|
+
*/
|
|
70
|
+
onCheck?: (checkedIds: string[], checkedListNode: CheckedArray[], mapNode?: PlainObject) => void;
|
|
71
|
+
/**
|
|
72
|
+
* 点击节点触发
|
|
73
|
+
*/
|
|
74
|
+
onSelect?: (node: any) => void;
|
|
75
|
+
/**
|
|
76
|
+
* 根接口
|
|
77
|
+
*/
|
|
78
|
+
rootApi?: string;
|
|
79
|
+
/**
|
|
80
|
+
* 根接口参数
|
|
81
|
+
*/
|
|
82
|
+
rootApiParam?: PlainObject;
|
|
83
|
+
/**
|
|
84
|
+
* 下级接口
|
|
85
|
+
*/
|
|
86
|
+
childApi?: string;
|
|
87
|
+
/**
|
|
88
|
+
* 下级接口参数
|
|
89
|
+
*/
|
|
90
|
+
childApiParam?: PlainObject;
|
|
91
|
+
/**
|
|
92
|
+
* 下级接口里的上级字段名称,默认treeId
|
|
93
|
+
*/
|
|
94
|
+
parentKey?: string;
|
|
95
|
+
/**
|
|
96
|
+
* 获取所有下级的ID的接口,不包含传入的父级ID
|
|
97
|
+
*/
|
|
98
|
+
allApi?: string;
|
|
99
|
+
/**
|
|
100
|
+
* 所有ID接口参数
|
|
101
|
+
*/
|
|
102
|
+
allApiParam?: PlainObject;
|
|
103
|
+
/**
|
|
104
|
+
* 设置了根值,表示通过rootApi接口一次性获取所有节点
|
|
105
|
+
*/
|
|
106
|
+
rootId?: string;
|
|
107
|
+
/**
|
|
108
|
+
* 对rootApi和childApi请求的数据进行转换
|
|
109
|
+
* @param rData
|
|
110
|
+
* @returns
|
|
111
|
+
*/
|
|
112
|
+
afterFunc?: (rData: any) => any;
|
|
113
|
+
/**
|
|
114
|
+
* className
|
|
115
|
+
*/
|
|
116
|
+
className?: string;
|
|
117
|
+
/**
|
|
118
|
+
* 样式
|
|
119
|
+
*/
|
|
120
|
+
style?: CSSProperties;
|
|
121
|
+
/**
|
|
122
|
+
* 是否启用根节点缓存
|
|
123
|
+
*/
|
|
124
|
+
rootCache?: boolean;
|
|
125
|
+
/**
|
|
126
|
+
* 延期加载,当同时有多个组件时,第二个不请求api,等待用缓存,默认为false
|
|
127
|
+
*/
|
|
128
|
+
delayApi?: boolean;
|
|
129
|
+
}
|
|
130
|
+
export type EasyuiTreeComponent = FC<EasyuiTreeProps>;
|
|
131
|
+
export {};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export type GetTreeIconNumByOrgFlag = (orgFlag: string) => string;
|
|
2
|
+
export type GetOrgFlagByTreeIconNum = (treeIconNum: number) => string;
|
|
3
|
+
export type MD5 = (text: string) => string;
|
|
4
|
+
export type AES = (text: string, keyString: string, ivString?: string) => string;
|
|
5
|
+
export type RSA = (text: string, publicKey?: string) => string;
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
type ValidatorReg = {
|
|
2
|
+
pattern: RegExp;
|
|
3
|
+
message: string;
|
|
4
|
+
};
|
|
5
|
+
/**
|
|
6
|
+
* 验证器类型定义
|
|
7
|
+
*/
|
|
8
|
+
export type Validator = {
|
|
9
|
+
/**
|
|
10
|
+
* 正则表达式对象集合
|
|
11
|
+
* 包含各种验证模式的正则表达式,如ipv4、ipv6、端口号等
|
|
12
|
+
*/
|
|
13
|
+
reg: {
|
|
14
|
+
/** 验证是否为IPV4格式的数据 */
|
|
15
|
+
ipv4: ValidatorReg;
|
|
16
|
+
/** 验证是否为IPV6格式的数据 */
|
|
17
|
+
ipv6: ValidatorReg;
|
|
18
|
+
/** 验证是否为IPV4或IPV6格式的数据 */
|
|
19
|
+
ipv4Or6: ValidatorReg;
|
|
20
|
+
/** 验证是否为IPV4+端口格式的数据 */
|
|
21
|
+
ipv4Port: ValidatorReg;
|
|
22
|
+
/** 验证是否为协议+IPV6+端口格式的数据 */
|
|
23
|
+
hpIpv6Port: ValidatorReg;
|
|
24
|
+
/** 验证是否为协议+IPV4+端口格式的数据 */
|
|
25
|
+
hpIPv4Port: ValidatorReg;
|
|
26
|
+
/** 验证端口号格式 */
|
|
27
|
+
port: ValidatorReg;
|
|
28
|
+
/** 验证域名格式 */
|
|
29
|
+
domain: ValidatorReg;
|
|
30
|
+
/** 验证URL格式 */
|
|
31
|
+
url: ValidatorReg;
|
|
32
|
+
/** 验证邮箱格式 */
|
|
33
|
+
email: ValidatorReg;
|
|
34
|
+
/** 验证电话号码格式 */
|
|
35
|
+
phone: ValidatorReg;
|
|
36
|
+
/** 验证手机号格式 */
|
|
37
|
+
mobile: ValidatorReg;
|
|
38
|
+
/** 验证身份证号格式 */
|
|
39
|
+
idCard: ValidatorReg;
|
|
40
|
+
/** 验证MAC地址格式 */
|
|
41
|
+
mac: ValidatorReg;
|
|
42
|
+
/** 验证MAC地址格式 */
|
|
43
|
+
mac2: ValidatorReg;
|
|
44
|
+
/** 验证MAC地址格式 */
|
|
45
|
+
mac3: ValidatorReg;
|
|
46
|
+
/** 验证数字格式 */
|
|
47
|
+
number: ValidatorReg;
|
|
48
|
+
/** 验证整数格式 */
|
|
49
|
+
integer: ValidatorReg;
|
|
50
|
+
/** 验证英文字符串格式 */
|
|
51
|
+
englishStr: ValidatorReg;
|
|
52
|
+
/** 验证中文字符串格式 */
|
|
53
|
+
chineseStr: ValidatorReg;
|
|
54
|
+
/** 验证传真格式 */
|
|
55
|
+
fax: ValidatorReg;
|
|
56
|
+
/** 验证邮政编码格式 */
|
|
57
|
+
zipCode: ValidatorReg;
|
|
58
|
+
/** 其他正则验证规则 */
|
|
59
|
+
[key: string]: ValidatorReg;
|
|
60
|
+
};
|
|
61
|
+
/**
|
|
62
|
+
* 验证函数集合
|
|
63
|
+
* 包含各种复杂验证逻辑的函数,用于正则表达式无法满足的验证场景
|
|
64
|
+
*/
|
|
65
|
+
fun: {
|
|
66
|
+
/**
|
|
67
|
+
* funObj对象中扩展方法示例,如果要扩展校验方法,请操作该方法
|
|
68
|
+
* @param rule
|
|
69
|
+
* @param value 待验证的值
|
|
70
|
+
* @param callback
|
|
71
|
+
* @param type
|
|
72
|
+
* @return 返回{"result":false,"msg":""},其中result:true表示验证通过,不显示错误提示信息;false表示验证不通过,显示错误提示信息。其中msg表示验证不通过时显示的错误提示信息
|
|
73
|
+
*/
|
|
74
|
+
checkDemo: (rule: any, value: any, callback: any, type?: string) => any;
|
|
75
|
+
/**
|
|
76
|
+
* 检查是否包含或者不包含某些字符
|
|
77
|
+
* @param rule
|
|
78
|
+
* @param value 待验证的值
|
|
79
|
+
* @param callback
|
|
80
|
+
* @param type
|
|
81
|
+
* @return 返回{"result":false,"msg":""},其中result:true表示验证通过,不显示错误提示信息;false表示验证不通过,显示错误提示信息。其中msg表示验证不通过时显示的错误提示信息
|
|
82
|
+
*/
|
|
83
|
+
checkSpecialChar: (rule: any, value: any, callback: any, type?: string) => any;
|
|
84
|
+
/**
|
|
85
|
+
* 检查数据是否重复,请求接口返回
|
|
86
|
+
* @param rule
|
|
87
|
+
* @param value 待校验的值
|
|
88
|
+
* @param callback 回调函数
|
|
89
|
+
* @param url 判断数据是否重复的URL
|
|
90
|
+
* @param formData 当前编辑的那条记录的ID值(字符串)或者表单回显的json对象数据,从其中取ID的值
|
|
91
|
+
* @param paramKey {idKey:"指定传入后台的id值的key",valueKey:"指定传入后台的编辑项的key"},指定通过请求传入后台用于校验的当前记录的ID的Key,值的key,可以不传该参数。
|
|
92
|
+
* 若不传则传入后的参数为{id:"",value:""};
|
|
93
|
+
* 如果该参数为{idKey:"bookId",valueKey:"bookName"},则传入后台的参数为{bookId:"",bookName:""}
|
|
94
|
+
* @param formDataIdKey 可以为空,当传入的formData是表单json对象不是id值时,可以传入该参数用来表明formData中的那个字段是主键Id,好从formData中取Id的值,不传就取formData["id"]作为Id的值
|
|
95
|
+
*/
|
|
96
|
+
checkIsRepeat: (rule: any, value: any, callback: any, url: string, formData: any, paramKey?: any, formDataIdKey?: string) => any;
|
|
97
|
+
/**
|
|
98
|
+
* 比较两个IP地址的大小
|
|
99
|
+
* @param startIP 起始IP地址
|
|
100
|
+
* @param endIP 结束IP地址
|
|
101
|
+
* @returns 比较结果:1表示startIP大于endIP,0表示相等,-1表示startIP小于endIP
|
|
102
|
+
*/
|
|
103
|
+
compareIPSize: (startIP: string, endIP: string) => number;
|
|
104
|
+
getIPv6Long: (_ip: string) => string;
|
|
105
|
+
/**
|
|
106
|
+
* 将IPV4转成数字
|
|
107
|
+
* @param value
|
|
108
|
+
* @return 返回对应的数字
|
|
109
|
+
*/
|
|
110
|
+
ipToNum: (value: string) => number | string;
|
|
111
|
+
/**
|
|
112
|
+
* 检查是否符合格式 单IP或IP范围
|
|
113
|
+
* 返回 true符合 false不符合
|
|
114
|
+
*/
|
|
115
|
+
checkIPOrRange: (value: any) => boolean;
|
|
116
|
+
/**
|
|
117
|
+
* 检验Cron表达式的格式是否正确。格式:“秒 分 时 日 月份 星期” 或 “秒 分 时 日 月份 星期 年份”,例如:0/20 * * * * ? , 0 15 10 * * ? 2005
|
|
118
|
+
* @param rule
|
|
119
|
+
* @param value 需要校验的值
|
|
120
|
+
* @param callback 校验成功或失败时的回调函数,校验成功时不传参数,校验失败时会传入错误消息
|
|
121
|
+
* @param type 类型,值有:""|null|"second"|"minute"|"hour"|"day"|"month"|"week"|"year",如果传入无效值(""|null),则校验整个表达式,
|
|
122
|
+
* 如果传入"second"|"minute"|"hour"|"day"|"month"|"week"|"year",则会校验对应的域(秒 分 时 日 月分 星期 年份)上的数据格式
|
|
123
|
+
*/
|
|
124
|
+
checkCron: (rule: any, value: any, callback: any, type: any) => any;
|
|
125
|
+
/** 其他验证函数 */
|
|
126
|
+
[key: string]: (...args: any[]) => any;
|
|
127
|
+
};
|
|
128
|
+
/**
|
|
129
|
+
* 路径验证函数
|
|
130
|
+
* 用于验证指定路径是否符合特定类型的要求
|
|
131
|
+
* @param path 需要验证的路径字符串
|
|
132
|
+
* @param type 验证类型
|
|
133
|
+
* @returns 验证结果,true表示验证通过,false表示验证失败
|
|
134
|
+
*/
|
|
135
|
+
checkPath: (path: string, type: string) => boolean;
|
|
136
|
+
};
|
|
137
|
+
export {};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { FC } from 'react';
|
|
2
|
+
import type { BaseOptions } from './types';
|
|
3
|
+
export interface CUploadProps extends BaseOptions {
|
|
4
|
+
fromId?: String;
|
|
5
|
+
onChange: Function;
|
|
6
|
+
beforeChange?: (fileList: any) => boolean;
|
|
7
|
+
modelStatus?: Function;
|
|
8
|
+
fontSize?: Number;
|
|
9
|
+
showModel?: "modal" | "drawer";
|
|
10
|
+
showTitle?: String;
|
|
11
|
+
width?: string | number;
|
|
12
|
+
placement?: 'top' | 'right' | 'bottom' | 'left';
|
|
13
|
+
btnText?: String;
|
|
14
|
+
btnSize?: any;
|
|
15
|
+
btnType?: any;
|
|
16
|
+
disabled?: boolean;
|
|
17
|
+
style?: any;
|
|
18
|
+
className?: any;
|
|
19
|
+
suffix?: string;
|
|
20
|
+
fileLimitSize?: number;
|
|
21
|
+
url?: string;
|
|
22
|
+
}
|
|
23
|
+
export type CUploadComponent = FC<CUploadProps>;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import type { PlainObject } from '../../basetype';
|
|
2
|
+
import type { ForwardRefExoticComponent, RefAttributes } from 'react';
|
|
3
|
+
import type { BaseOptions } from './types';
|
|
4
|
+
export interface ChartBaseProps extends BaseOptions {
|
|
5
|
+
chartId: string;
|
|
6
|
+
chartOpt: PlainObject;
|
|
7
|
+
onClick?: (e: PlainObject) => void;
|
|
8
|
+
refresh?: number;
|
|
9
|
+
}
|
|
10
|
+
export interface ChartBarProps extends BaseOptions {
|
|
11
|
+
convertXY?: boolean;
|
|
12
|
+
chartId?: string;
|
|
13
|
+
data: PlainObject;
|
|
14
|
+
chartOpt?: PlainObject;
|
|
15
|
+
current?: string;
|
|
16
|
+
onClick?: (key: any, name: any) => void;
|
|
17
|
+
titleKey?: string;
|
|
18
|
+
valueKey?: string;
|
|
19
|
+
xLabelLine?: boolean;
|
|
20
|
+
xLabelLength?: number;
|
|
21
|
+
barWidth?: number;
|
|
22
|
+
}
|
|
23
|
+
export interface ChartPieProps extends BaseOptions {
|
|
24
|
+
chartId?: string;
|
|
25
|
+
data: PlainObject;
|
|
26
|
+
title?: string;
|
|
27
|
+
subText?: string;
|
|
28
|
+
current?: string;
|
|
29
|
+
onClick?: (e: PlainObject) => void;
|
|
30
|
+
isExcept?: boolean;
|
|
31
|
+
}
|
|
32
|
+
export interface ChartRef extends BaseOptions {
|
|
33
|
+
getDataURL: () => any;
|
|
34
|
+
}
|
|
35
|
+
export type ChartBaseComponent = ForwardRefExoticComponent<ChartBaseProps & RefAttributes<ChartRef>>;
|
|
36
|
+
export type ChartBarComponent = ForwardRefExoticComponent<ChartBarProps & RefAttributes<ChartRef>>;
|
|
37
|
+
export type ChartPieComponent = ForwardRefExoticComponent<ChartPieProps & RefAttributes<ChartRef>>;
|