From 97b927aa930d24047eb556aa63f519e534e14d33 Mon Sep 17 00:00:00 2001 From: "peng.peng" Date: Mon, 13 Mar 2023 16:10:10 +0800 Subject: [PATCH] =?UTF-8?q?(*)=E6=A8=A1=E5=9E=8B=E7=AE=A1=E7=90=86UI?= =?UTF-8?q?=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../containers/metaModelManagement.js | 168 +++++++++++++++++- 1 file changed, 165 insertions(+), 3 deletions(-) diff --git a/web/client/src/sections/metadataManagement/containers/metaModelManagement.js b/web/client/src/sections/metadataManagement/containers/metaModelManagement.js index 85213aa..4e2d7dd 100644 --- a/web/client/src/sections/metadataManagement/containers/metaModelManagement.js +++ b/web/client/src/sections/metadataManagement/containers/metaModelManagement.js @@ -1,7 +1,169 @@ import React, { useEffect, useState } from 'react' +import { Spin, Select, Tree, Row, Col, Button } from 'antd'; +import { connect } from 'react-redux'; +import ProTable from '@ant-design/pro-table'; -function MetaModelManagement (props) { - return <>模型管理 +const TreeNode = Tree.TreeNode; +const DATABASE_TYPE = ['目录', '库', '表', '字段', '主键', '外键', '索引']; +function MetaModelManagement(props) { + const { loading, clientHeight } = props; + const [selectedKeys, setSelectKeys] = useState([DATABASE_TYPE[0]]) + const [pageSize, setPageSize] = useState(10); + const [currentPage, setCurrentPage] = useState(1); + + const columns = [ + { + title: '属性名称', + dataIndex: 'attributeName', + ellipsis: true, + search: false, + }, + { + title: '属性代码', + dataIndex: 'attributeCode', + ellipsis: true, + search: false, + }, + { + title: '数据类型', + dataIndex: 'dataType', + ellipsis: true, + search: false, + }, + { + title: '输入控件', + dataIndex: 'control', + ellipsis: true, + search: false, + }, + { + title: '长度', + dataIndex: 'length', + ellipsis: true, + search: false, + }, + { + title: '小数位数', + dataIndex: 'company', + ellipsis: true, + search: false, + }, + { + title: '允许为空', + dataIndex: 'readOnly', + ellipsis: true, + search: false, + }, + { + title: '是否只读', + dataIndex: 'readOnly', + ellipsis: true, + search: false, + }, + { + title: '描述', + dataIndex: 'description', + ellipsis: true, + search: false, + }, + + + { + title: '操作', + width: 160, + key: 'option', + valueType: 'option', + render: (text, record) => { + const options = []; + + options.push(删除) + return options; + + }, + }, + ]; + + + return + + + { + if (e.selected) { + setSelectKeys(keys) + } + }} + defaultExpandAll={true} + > + + + {DATABASE_TYPE.map(s => )} + + + + + + + + { + + }} + dateFormatter="string" + search={false} + scroll={ + { + scrollToFirstRowOnChange: true, + y: clientHeight - 260 + } + } + pagination={{ + total: 0, + showSizeChanger: true, + showQuickJumper: true, + current: currentPage, + pageSize: pageSize || 10, + pageSizeOptions: [10, 20, 50], + showTotal: (total) => { + return {`共${Math.ceil(total / pageSize)}页,${total}项`} + }, + onShowSizeChange: (currentPage, pageSize) => { + setCurrentPage(currentPage); + setPageSize(pageSize); + + }, + onChange: (page, pageSize) => { + setCurrentPage(page); + setPageSize(pageSize); + + } + }} + dataSource={[]} + headerTitle={} + options={false} + /> + + + + +} + +function mapStateToProps(state) { + const { + auth, global, + } = state; + return { + loading: auth.isRequesting, + clientHeight: global.clientHeight, + + }; } -export default MetaModelManagement \ No newline at end of file +export default connect(mapStateToProps)(MetaModelManagement); + +