From c47d4ff80bd4616de6dbdb74b7de83beb813b227 Mon Sep 17 00:00:00 2001 From: jiangzhixiong <710328466@qq.com> Date: Sun, 7 Apr 2024 16:36:14 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E6=94=B9schema=E9=80=8F?= =?UTF-8?q?=E5=87=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/material/CHANGELOG.md | 12 +++++++++++ .../algorithmTable/AlgorithmTable.d.ts | 20 ------------------- .../algorithmTable/AlgorithmTable.js | 2 +- .../components/schemaFormModal/index.d.ts | 2 -- packages/material/es/index.d.ts | 1 + packages/material/es/index.js | 1 + .../algorithmTable/AlgorithmTable.d.ts | 20 ------------------- .../algorithmTable/AlgorithmTable.js | 2 +- .../components/schemaFormModal/index.d.ts | 2 -- packages/material/lib/index.d.ts | 1 + packages/material/lib/index.js | 5 ++++- packages/material/package.json | 2 +- .../algorithmTable/AlgorithmTable.tsx | 2 +- .../demo/useSchemaFormModal.tsx | 20 +++++++++++++++++++ .../material/src/algorithmConfig/index.md | 16 ++++++++++++--- packages/material/src/index.tsx | 1 + 16 files changed, 57 insertions(+), 52 deletions(-) delete mode 100644 packages/material/es/algorithmConfig/components/algorithmTable/AlgorithmTable.d.ts delete mode 100644 packages/material/es/algorithmConfig/components/schemaFormModal/index.d.ts delete mode 100644 packages/material/lib/algorithmConfig/components/algorithmTable/AlgorithmTable.d.ts delete mode 100644 packages/material/lib/algorithmConfig/components/schemaFormModal/index.d.ts create mode 100644 packages/material/src/algorithmConfig/demo/useSchemaFormModal.tsx diff --git a/packages/material/CHANGELOG.md b/packages/material/CHANGELOG.md index a2e825d..e29de51 100644 --- a/packages/material/CHANGELOG.md +++ b/packages/material/CHANGELOG.md @@ -1,5 +1,17 @@ # @zhst/material +## 0.7.7 + +### Patch Changes + +- 修改 schema 物料透出 + +## 0.7.6 + +### Patch Changes + +- 修改文件引用出错 + ## 0.7.5 ### Patch Changes diff --git a/packages/material/es/algorithmConfig/components/algorithmTable/AlgorithmTable.d.ts b/packages/material/es/algorithmConfig/components/algorithmTable/AlgorithmTable.d.ts deleted file mode 100644 index baec10b..0000000 --- a/packages/material/es/algorithmConfig/components/algorithmTable/AlgorithmTable.d.ts +++ /dev/null @@ -1,20 +0,0 @@ -import React from 'react'; -import type { ParamsType, ProTableProps } from '@ant-design/pro-components'; -import { AnyObject } from 'antd/es/_util/type'; -import { SelectProps } from 'antd/lib'; -export interface AlgorithmTableProps extends ProTableProps { - onAddAlgorithm?: (id?: string, record?: any) => void; - onItemSwitch?: (status?: boolean, id?: string, info?: any) => void; - onItemEdit?: (values?: any, info?: any) => void; - onItemDelete?: (id?: string, info?: any) => void; - onSortSelect?: SelectProps['onChange']; - onDraw?: (id: any, info?: any) => void; - selectedKey?: string; - sortList?: { - label: string; - value: string; - }[]; - tableType?: 'multiple' | 'single'; -} -declare const AlgorithmTable: (props: AlgorithmTableProps) => React.JSX.Element; -export default AlgorithmTable; diff --git a/packages/material/es/algorithmConfig/components/algorithmTable/AlgorithmTable.js b/packages/material/es/algorithmConfig/components/algorithmTable/AlgorithmTable.js index d50ba26..e952508 100644 --- a/packages/material/es/algorithmConfig/components/algorithmTable/AlgorithmTable.js +++ b/packages/material/es/algorithmConfig/components/algorithmTable/AlgorithmTable.js @@ -8,7 +8,7 @@ import { DeleteFilled, EditFilled, ImportOutlined, PlusCircleFilled } from '@ant import { ProTable } from '@ant-design/pro-components'; import { Popconfirm, Select, Space, Switch } from 'antd'; import theme from 'antd/es/theme'; -import SchemaFormModal from "../schemaFormModal/schemaFormModal"; +import SchemaFormModal from "../schemaFormModal"; var useToken = theme.useToken; var AlgorithmTable = function AlgorithmTable(props) { var onAddAlgorithm = props.onAddAlgorithm, diff --git a/packages/material/es/algorithmConfig/components/schemaFormModal/index.d.ts b/packages/material/es/algorithmConfig/components/schemaFormModal/index.d.ts deleted file mode 100644 index b42d137..0000000 --- a/packages/material/es/algorithmConfig/components/schemaFormModal/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import SchemaFormModal from './schemaFormModal'; -export default SchemaFormModal; diff --git a/packages/material/es/index.d.ts b/packages/material/es/index.d.ts index 8d44736..997d45d 100644 --- a/packages/material/es/index.d.ts +++ b/packages/material/es/index.d.ts @@ -3,4 +3,5 @@ export { default as AlgorithmConfig } from './algorithmConfig'; export type { AlgorithmConfigRef, AlgorithmConfigProps } from './algorithmConfig'; export { default as Login } from './login'; export { default as Password } from './password'; +export { default as SchemaFormModal } from './algorithmConfig/components/schemaFormModal'; export * from 'rc-util'; diff --git a/packages/material/es/index.js b/packages/material/es/index.js index 4ee0143..1b18d5e 100644 --- a/packages/material/es/index.js +++ b/packages/material/es/index.js @@ -2,4 +2,5 @@ export { default as AlgorithmConfigModal } from "./algorithmConfigModal"; export { default as AlgorithmConfig } from "./algorithmConfig"; export { default as Login } from "./login"; export { default as Password } from "./password"; +export { default as SchemaFormModal } from "./algorithmConfig/components/schemaFormModal"; export * from 'rc-util'; \ No newline at end of file diff --git a/packages/material/lib/algorithmConfig/components/algorithmTable/AlgorithmTable.d.ts b/packages/material/lib/algorithmConfig/components/algorithmTable/AlgorithmTable.d.ts deleted file mode 100644 index baec10b..0000000 --- a/packages/material/lib/algorithmConfig/components/algorithmTable/AlgorithmTable.d.ts +++ /dev/null @@ -1,20 +0,0 @@ -import React from 'react'; -import type { ParamsType, ProTableProps } from '@ant-design/pro-components'; -import { AnyObject } from 'antd/es/_util/type'; -import { SelectProps } from 'antd/lib'; -export interface AlgorithmTableProps extends ProTableProps { - onAddAlgorithm?: (id?: string, record?: any) => void; - onItemSwitch?: (status?: boolean, id?: string, info?: any) => void; - onItemEdit?: (values?: any, info?: any) => void; - onItemDelete?: (id?: string, info?: any) => void; - onSortSelect?: SelectProps['onChange']; - onDraw?: (id: any, info?: any) => void; - selectedKey?: string; - sortList?: { - label: string; - value: string; - }[]; - tableType?: 'multiple' | 'single'; -} -declare const AlgorithmTable: (props: AlgorithmTableProps) => React.JSX.Element; -export default AlgorithmTable; diff --git a/packages/material/lib/algorithmConfig/components/algorithmTable/AlgorithmTable.js b/packages/material/lib/algorithmConfig/components/algorithmTable/AlgorithmTable.js index cab3dfb..ced7659 100644 --- a/packages/material/lib/algorithmConfig/components/algorithmTable/AlgorithmTable.js +++ b/packages/material/lib/algorithmConfig/components/algorithmTable/AlgorithmTable.js @@ -37,7 +37,7 @@ var import_icons = require("@ant-design/icons"); var import_pro_components = require("@ant-design/pro-components"); var import_antd = require("antd"); var import_theme = __toESM(require("antd/es/theme")); -var import_schemaFormModal = __toESM(require("../schemaFormModal/schemaFormModal")); +var import_schemaFormModal = __toESM(require("../schemaFormModal")); var { useToken } = import_theme.default; var AlgorithmTable = (props) => { const { diff --git a/packages/material/lib/algorithmConfig/components/schemaFormModal/index.d.ts b/packages/material/lib/algorithmConfig/components/schemaFormModal/index.d.ts deleted file mode 100644 index b42d137..0000000 --- a/packages/material/lib/algorithmConfig/components/schemaFormModal/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import SchemaFormModal from './schemaFormModal'; -export default SchemaFormModal; diff --git a/packages/material/lib/index.d.ts b/packages/material/lib/index.d.ts index 8d44736..997d45d 100644 --- a/packages/material/lib/index.d.ts +++ b/packages/material/lib/index.d.ts @@ -3,4 +3,5 @@ export { default as AlgorithmConfig } from './algorithmConfig'; export type { AlgorithmConfigRef, AlgorithmConfigProps } from './algorithmConfig'; export { default as Login } from './login'; export { default as Password } from './password'; +export { default as SchemaFormModal } from './algorithmConfig/components/schemaFormModal'; export * from 'rc-util'; diff --git a/packages/material/lib/index.js b/packages/material/lib/index.js index 37156c6..b86b1de 100644 --- a/packages/material/lib/index.js +++ b/packages/material/lib/index.js @@ -33,13 +33,15 @@ __export(src_exports, { AlgorithmConfig: () => import_algorithmConfig.default, AlgorithmConfigModal: () => import_algorithmConfigModal.default, Login: () => import_login.default, - Password: () => import_password.default + Password: () => import_password.default, + SchemaFormModal: () => import_schemaFormModal.default }); module.exports = __toCommonJS(src_exports); var import_algorithmConfigModal = __toESM(require("./algorithmConfigModal")); var import_algorithmConfig = __toESM(require("./algorithmConfig")); var import_login = __toESM(require("./login")); var import_password = __toESM(require("./password")); +var import_schemaFormModal = __toESM(require("./algorithmConfig/components/schemaFormModal")); __reExport(src_exports, require("rc-util"), module.exports); // Annotate the CommonJS export names for ESM import in node: 0 && (module.exports = { @@ -47,5 +49,6 @@ __reExport(src_exports, require("rc-util"), module.exports); AlgorithmConfigModal, Login, Password, + SchemaFormModal, ...require("rc-util") }); diff --git a/packages/material/package.json b/packages/material/package.json index 52ce9f6..7adce7b 100644 --- a/packages/material/package.json +++ b/packages/material/package.json @@ -1,6 +1,6 @@ { "name": "@zhst/material", - "version": "0.7.5", + "version": "0.7.7", "description": "物料库", "keywords": [ "business", diff --git a/packages/material/src/algorithmConfig/components/algorithmTable/AlgorithmTable.tsx b/packages/material/src/algorithmConfig/components/algorithmTable/AlgorithmTable.tsx index 4d1db31..ae47860 100644 --- a/packages/material/src/algorithmConfig/components/algorithmTable/AlgorithmTable.tsx +++ b/packages/material/src/algorithmConfig/components/algorithmTable/AlgorithmTable.tsx @@ -8,7 +8,7 @@ import { Popconfirm, Select, Space, Switch } from 'antd'; import theme from 'antd/es/theme'; import { AnyObject } from 'antd/es/_util/type'; import { SelectProps } from 'antd/lib'; -import SchemaFormModal from '../schemaFormModal/schemaFormModal'; +import SchemaFormModal from '../schemaFormModal'; const { useToken } = theme diff --git a/packages/material/src/algorithmConfig/demo/useSchemaFormModal.tsx b/packages/material/src/algorithmConfig/demo/useSchemaFormModal.tsx new file mode 100644 index 0000000..a051e94 --- /dev/null +++ b/packages/material/src/algorithmConfig/demo/useSchemaFormModal.tsx @@ -0,0 +1,20 @@ +import React from 'react' +import { SchemaFormModal } from '@zhst/material' +import { Button, Space } from 'antd' + +export default () => { + return ( + + console.log('values', values)} + trigger={} + /> + console.log('values', values)} + trigger={} + /> + + ) +} diff --git a/packages/material/src/algorithmConfig/index.md b/packages/material/src/algorithmConfig/index.md index 27894b8..cf21815 100644 --- a/packages/material/src/algorithmConfig/index.md +++ b/packages/material/src/algorithmConfig/index.md @@ -13,6 +13,7 @@ group: 基本用法 空数据状态 +单独使用schemaFormModal ## API @@ -45,13 +46,14 @@ group: | onSortSelect | 筛选下拉框点击事件 | SelectProps['onChange'] | [] | - | | sortList | 筛选下拉框 | Array[{ label: string; value: string; }] | [] | - | -### timeTemplateTableProps +### SchemaFormModalProps -时间模板组件透传,继承 ProTable +时间模板组件透传,继承 pro-Components 的 BetaSchemaForm | 参数 | 说明 | 类型 | 默认值 | 版本 | | --- | --- | --- | --- | --- | -| onItemBlur | 失焦监听事件 | (value?: number | string, id?: any, record?: any) => void | - | - | +| type | fire 火焰、smoke:烟雾、traffic: 人流量、face: 面部遮挡、destroy:人员损坏、wander:人员徘徊、cameraBlock:摄像头遮挡、gather:人员聚集 | string | fire | - | +| onFinish | 提交事件,可以通过返回布尔值来判定 | async (values) => Promise | - | - | ### algorithmConfigRef @@ -59,3 +61,11 @@ group: | --- | --- | --- | --- | --- | | onDraw | 绘制 | () => void | - | - | | cancelDraw | 取消绘制 | () => void | - | - | + +### timeTemplateTableProps + +时间模板组件透传,继承 ProTable + +| 参数 | 说明 | 类型 | 默认值 | 版本 | +| --- | --- | --- | --- | --- | +| onItemBlur | 失焦监听事件 | (value?: number | string, id?: any, record?: any) => void | - | diff --git a/packages/material/src/index.tsx b/packages/material/src/index.tsx index c22604c..8f16ac8 100644 --- a/packages/material/src/index.tsx +++ b/packages/material/src/index.tsx @@ -3,4 +3,5 @@ export { default as AlgorithmConfig } from './algorithmConfig'; export type { AlgorithmConfigRef, AlgorithmConfigProps } from './algorithmConfig'; export { default as Login } from './login'; export { default as Password } from './password'; +export { default as SchemaFormModal } from './algorithmConfig/components/schemaFormModal'; export * from 'rc-util'