Commit 31d250cc by zhaochengxiang

增加资产要素静态页面

parent 1cc621c1
......@@ -18,6 +18,10 @@ export const routes = [
{
name: 'model',
text: '数据模型',
},
{
name: 'factor',
text: '资产要素',
}
]
}
......
import React, { useState } from "react";
import { Table } from 'antd';
import './FactorTable.less';
const FactorTable = (props) => {
const { data, loading, onSelect } = props;
const [ selectedRowKeys, setSelectedRowKeys ] = useState([]);
const columns = [
{
title: '序号',
dataIndex: 'key',
editable: false,
render: (text, record, index) => {
return (index+1).toString();
}
},
{
title: '操作时间',
dataIndex: 'time',
},
{
title: '操作人',
dataIndex: 'user',
},
{
title: '操作类型',
dataIndex: 'type',
},
{
title: '状态',
dataIndex: 'status',
},
{
title: '变更内容',
dataIndex: 'content'
},
];
const onSelectChange = keys => {
setSelectedRowKeys(keys);
onSelect && onSelect(keys);
};
const rowSelection = {
selectedRowKeys,
onChange: onSelectChange,
};
return (
<div className='factor-table'>
<Table
loading={loading}
rowSelection={rowSelection}
columns={columns}
rowKey={'id'}
dataSource={data}
pagination={false}
/>
</div>
);
}
export default FactorTable;
\ No newline at end of file
.factor-table {
.yy-table {
height: calc(100vh - 64px - 20px - 53px - 20px) !important;
overflow: auto !important;
}
}
\ No newline at end of file
import React, { useState } from 'react';
import { Button } from 'antd';
import FactorTable from './Component/FactorTable';
const testData = [
{
id: '1',
time: '2020-03-09 12:28:09',
user: 'xxx',
type: '导入',
status: '成功',
content: '本次新增了ID、中文名称、英文名称、描述、资产形态等5个要素'
},
{
id: '2',
time: '2020-03-09 12:28:09',
user: 'xxx',
type: '导入',
status: '成功',
content: '本次新增了ID、中文名称、英文名称、描述、资产形态等5个要素'
},
];
const Factor = (props) => {
const [ loading, setLoading ] = useState(false);
const [ tableData, setTableData ] = useState(testData);
const [ selectFactorIds, setSelectFactorIds ] = useState([]);
const onImportBtnClick = () => {
}
const onExportBtnClick = () => {
}
const onTableSelect = (ids) => {
setSelectFactorIds(ids||[]);
}
return (
<div style={{ backgroundColor: '#fff' }}>
<div
className='p-3'
style={{
display: 'flex',
borderBottom: "1px solid #EFEFEF",
}}
>
<Button type="primary" className='ml-3' style={{ marginLeft: 'auto' }} onClick={onImportBtnClick}>导入</Button>
<Button type="primary" className='ml-3' onClick={onExportBtnClick}>导出</Button>
</div>
<div className='p-3'>
<FactorTable loading={loading} data={tableData} onSelect={onTableSelect} />
</div>
</div>
);
}
export default Factor;
import React, { useState, useCallback, useRef, useEffect } from 'react';
import { Table, Input, InputNumber, Form, Typography, Radio, Divider, Button, Popconfirm, Select, Row, Col, Descriptions } from 'antd';
import { Table, Input, InputNumber, Form, Typography, Radio, Divider, Button, Popconfirm, Select, Row, Col } from 'antd';
import { DndProvider, useDrag, useDrop } from 'react-dnd';
import { HTML5Backend } from 'react-dnd-html5-backend';
import update from 'immutability-helper';
import { generateUUID } from '../../../../util';
import { dispatchLatest } from '../../../../model';
import { template } from '@babel/core';
const { Option } = Select;
......@@ -90,6 +89,7 @@ const DatatypeInput = ({ value = {}, datatypes, onChange }) => {
onChange={(value) => {
onParameterValuesChange(value, index);
}}
min={0}
value={parameterValues[index]}
style={{ width: 60 }}
/>
......
import React, { useState, useEffect } from "react";
import { Table, Space, Button, Tooltip, Modal } from 'antd';
import { EditOutlined, CheckOutlined, ReconciliationOutlined, DeleteOutlined } from '@ant-design/icons';
import { EditOutlined, ReconciliationOutlined, DeleteOutlined } from '@ant-design/icons';
import { dispatchLatest } from '../../../../model';
import { showMessage } from '../../../../util';
......
......@@ -93,9 +93,9 @@ class Model extends React.Component {
const { importModalVisible, exportModalVisible, catalogId, importModalAction, tableData, loadingTableData, modelerId, selectModelerIds } = this.state;
return (
<div style={{ backgroundColor: '#ECEEF3', height: '100%' }}>
<Row style={{ height: '100%' }}>
<Col span={6} style={{ height: '100%' }} >
<div style={{ backgroundColor: '#ECEEF3' }}>
<Row>
<Col span={6} >
<div className='mr-3' style={{ backgroundColor: '#fff' }}>
<ModelTree onSelect={this.onTreeSelect} />
</div>
......
......@@ -7,6 +7,7 @@ import { ManageLayout } from "../../layout";
import Map from './Map';
import Model from './Model';
import Factor from './Factor';
class Manage extends Component {
constructor(props) {
......@@ -29,7 +30,7 @@ class Manage extends Component {
<Switch>
<Route path={`${match.path}/map`} component={Map} />
<Route path={`${match.path}/model`} component={Model} />
<Route path={`${match.path}/factor`} component={Factor} />
</Switch>
) : (
<GetSession {...this.props} />
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment