diff --git a/src/components/b_table.tsx b/src/components/b_table.tsx index dc492f6..61944f0 100644 --- a/src/components/b_table.tsx +++ b/src/components/b_table.tsx @@ -1,6 +1,5 @@ import { Button, - message, Pagination, PaginationProps, Popconfirm, @@ -10,7 +9,15 @@ import { } from "antd"; import { useState } from "react"; const BTable = (props: any) => { - const { store, dataSource, selectCallback, scroll } = props; + const { + store, + dataSource, + selectCallback, + scroll, + editCallback, + deleteCallback, + actionCloumn, + } = props; const [selectedRowKeys, setSelectedRowKeys] = useState([]); const onSelectChange = (newSelectedRowKeys: React.Key[]) => { setSelectedRowKeys(newSelectedRowKeys); @@ -33,30 +40,37 @@ const BTable = (props: any) => { Size: 20, }); }; - const cancel: PopconfirmProps["onCancel"] = (e) => { - message.error("Click on No"); - }; - const confirm: PopconfirmProps["onConfirm"] = (e) => { - message.success("Click on Yes"); - }; - const actionColumn = { + const cancel: PopconfirmProps["onCancel"] = (e) => {}; + + const actionDefultColumn = { title: "操作", fixed: "right", with: 200, render: (any, record) => ( - + {actionCloumn} { + deleteCallback(record.identity); + }} onCancel={cancel} okText="Yes" cancelText="No" > - + ), @@ -69,7 +83,7 @@ const BTable = (props: any) => { scroll={scroll} loading={store.listStatus} rowSelection={rowSelection} - columns={[...props.columns, actionColumn]} + columns={[...props.columns, actionDefultColumn]} dataSource={dataSource} />
diff --git a/src/components/form/interface.ts b/src/components/form/interface.ts index 8bde48a..8de5a32 100644 --- a/src/components/form/interface.ts +++ b/src/components/form/interface.ts @@ -37,7 +37,7 @@ export interface SimpleFormData { initialValues?: Object | null | undefined, onFinish: Function, formRef?: React.RefObject>, - onFinishFailed: Function, + onFinishFailed?: Function, formDatas: Array, createCallback?: Function children?: React.ReactElement diff --git a/src/components/form/simple_form.tsx b/src/components/form/simple_form.tsx index 858a286..facea0e 100644 --- a/src/components/form/simple_form.tsx +++ b/src/components/form/simple_form.tsx @@ -41,7 +41,7 @@ const SimpleForm = (props: SimpleFormData) => { name={v.name} rules={v.rules} > - + ); case FormType.inputNumber: @@ -52,7 +52,7 @@ const SimpleForm = (props: SimpleFormData) => { name={v.name} rules={v.rules} > - + ); case FormType.password: @@ -63,7 +63,7 @@ const SimpleForm = (props: SimpleFormData) => { name={v.name} rules={v.rules} > - + ); case FormType.cehckbox: @@ -87,7 +87,6 @@ const SimpleForm = (props: SimpleFormData) => { > { form.setFieldValue(v.name, res); }} @@ -116,7 +115,6 @@ const SimpleForm = (props: SimpleFormData) => { { - console.log(res); form.setFieldValue(v.name, res); }} /> diff --git a/src/components/layout/layout.tsx b/src/components/layout/layout.tsx index 5e86868..0ee1fdb 100644 --- a/src/components/layout/layout.tsx +++ b/src/components/layout/layout.tsx @@ -22,6 +22,18 @@ const LayOut = (props: Store) => { justifyContent: "space-between", }; const logoStyle = { width: 60, color: "white" }; + const contentstyle = { + padding: 12, + margin: 0, + minHeight: 280, + background: colorBgContainer, + borderRadius: borderRadiusLG, + }; + const breadItem = [ + { title: "首页" }, + { title: "数据集管理" }, + { title: "数据管理" }, + ]; useEffect(() => { // if (usrStore.isNeedLogin) { // nav("/login"); @@ -59,19 +71,8 @@ const LayOut = (props: Store) => { /> - - + +