Commit ab593e04 by zhaochengxiang

主数据模版字段编辑

parent f256b872
...@@ -167,4 +167,147 @@ export const expandedTableData = [ ...@@ -167,4 +167,147 @@ export const expandedTableData = [
attr5: 'attr5', attr5: 'attr5',
attr6: 'attr6', attr6: 'attr6',
}, },
];
export const templateFileds = [
{
"name": "company_short_name",
"remark": "公司简称",
"cnName": "公司简称",
"modelingTemplateTag": null,
"datatype": {
"name": "Varchar",
"cnName": "字符串",
"supportedDBTypes": [
"Greenplum",
"MySQL"
],
"parameterNames": [
"length"
],
"parameterCnNames": [
"长度"
],
"parameterValues": [
68
],
"jdbctype": 12
},
"recommendedStats": null,
"iid": "fc3ad8bb-1ebd-4eb2-ae0e-5cc8305bced3",
"isPossibleNewTerm": null,
"isPossibleNewRecommendedDefinition": null,
"notNull": false,
"foreignKey": false,
"defaultValue": "",
"needAttention": false,
"definition": null,
"valueRange": null,
"partOfPrimaryKeyLogically": false
},
{
"name": "counterparty_executing_trader",
"remark": "对手方交易账户",
"cnName": "对手方交易账户",
"modelingTemplateTag": null,
"datatype": {
"name": "Char",
"cnName": "字符",
"supportedDBTypes": [
"Greenplum",
"MySQL"
],
"parameterNames": [
"length"
],
"parameterCnNames": [
"长度"
],
"parameterValues": [
13
],
"jdbctype": 1
},
"recommendedStats": null,
"iid": "9f0642cc-f9b6-4644-acc5-a6f146c5f89e",
"isPossibleNewTerm": null,
"isPossibleNewRecommendedDefinition": null,
"notNull": false,
"foreignKey": false,
"defaultValue": "",
"needAttention": false,
"definition": null,
"valueRange": null,
"partOfPrimaryKeyLogically": false
},
{
"name": "counterparty_member_branch_code",
"remark": "对手方营业部识别码",
"cnName": "对手方营业部识别码",
"modelingTemplateTag": null,
"datatype": {
"name": "Char",
"cnName": "字符",
"supportedDBTypes": [
"Greenplum",
"MySQL"
],
"parameterNames": [
"length"
],
"parameterCnNames": [
"长度"
],
"parameterValues": [
15
],
"jdbctype": 1
},
"recommendedStats": null,
"iid": "95070aa0-74de-4e97-9227-1952a875054e",
"isPossibleNewTerm": null,
"isPossibleNewRecommendedDefinition": null,
"notNull": false,
"foreignKey": false,
"defaultValue": "",
"needAttention": false,
"definition": null,
"valueRange": null,
"partOfPrimaryKeyLogically": false
},
{
"name": "record_sequence",
"remark": "记录序号",
"cnName": "记录序号",
"modelingTemplateTag": null,
"datatype": {
"name": "Char",
"cnName": "字符",
"supportedDBTypes": [
"Greenplum",
"MySQL"
],
"parameterNames": [
"length"
],
"parameterCnNames": [
"长度"
],
"parameterValues": [
6
],
"jdbctype": 1
},
"recommendedStats": null,
"iid": "ed72ad1a-9455-4be0-b093-2af2621a766e",
"isPossibleNewTerm": null,
"isPossibleNewRecommendedDefinition": null,
"notNull": false,
"foreignKey": false,
"defaultValue": "",
"needAttention": false,
"definition": null,
"valueRange": null,
"partOfPrimaryKeyLogically": false
}
]; ];
\ No newline at end of file
import { Form, Input, Divider } from "antd"; import { Form, Input, Divider, Row, Col } from "antd";
const { TextArea } = Input;
const UpdateBasicInfo = (props) => { const UpdateBasicInfo = (props) => {
const { form } = props; const { form } = props;
...@@ -16,20 +18,28 @@ const UpdateBasicInfo = (props) => { ...@@ -16,20 +18,28 @@ const UpdateBasicInfo = (props) => {
return ( return (
<div> <div>
<Divider>基本信息</Divider> <h3>基本信息</h3>
<Form <Form
form={form} form={form}
{...formItemLayout} {...formItemLayout}
> >
<Form.Item label='模版名称' name='name' rules={[{ required: true, message: '请填写模版名称' }]}> <Row gutter={10}>
<Input /> <Col xs={24} sm={24} lg={12}>
</Form.Item> <Form.Item label='中文名称' name='cnName' rules={[{ required: true, message: '请填写模版中文名称' }]}>
<Form.Item label='模版中文名称' name='cnName' rules={[{ required: true, message: '请填写模版中文名称' }]}> <Input />
<Input /> </Form.Item>
</Form.Item> </Col>
<Form.Item label='模版描述' name='desc'> <Col xs={24} sm={24} lg={12}>
<Input /> <Form.Item label='英文名称' name='name' rules={[{ required: true, message: '请填写模版名称' }]}>
</Form.Item> <Input />
</Form.Item>
</Col>
<Col xs={24} sm={24} lg={12}>
<Form.Item label='模版描述' name='desc'>
<TextArea row={4} />
</Form.Item>
</Col>
</Row>
</Form> </Form>
</div> </div>
); );
......
import { Modal, Form, Input, Button } from "antd"; import { Modal, Form } from "antd";
import { MinusCircleOutlined, PlusOutlined } from '@ant-design/icons';
import UpdateBasicInfo from "./UpdateBasicInfo"; import UpdateBasicInfo from "./UpdateBasicInfo";
import UpdateField from "./UpdateField";
import './UpdateTemplateModal.less'; import './UpdateTemplateModal.less';
const UpdateTemplateModal = (props) => { const UpdateTemplateModal = (props) => {
const { visible, onCancel } = props; const { visible, onCancel } = props;
const [form] = Form.useForm(); const [form] = Form.useForm();
const formItemLayout = {
labelCol: {
xs: { span: 24 },
sm: { span: 6 },
},
wrapperCol: {
xs: { span: 24 },
sm: { span: 18 },
},
};
const formItemLayoutWithOutLabel = {
wrapperCol: {
xs: {
span: 24,
offset: 0,
},
sm: {
span: 18,
offset: 6,
},
},
};
const onFormFinish = async() => { const onFormFinish = async() => {
try { try {
await form.validateFields(); await form.validateFields();
...@@ -45,12 +21,14 @@ const UpdateTemplateModal = (props) => { ...@@ -45,12 +21,14 @@ const UpdateTemplateModal = (props) => {
return ( return (
<Modal <Modal
className='update-template-modal' className='update-template-modal'
width='80%'
title='新建模版' title='新建模版'
visible={visible} visible={visible}
onCancel={onCancel} onCancel={onCancel}
onOk={onFormFinish} onOk={onFormFinish}
> >
<UpdateBasicInfo form={form} /> <UpdateBasicInfo form={form} />
<UpdateField />
</Modal> </Modal>
); );
} }
......
...@@ -3,7 +3,7 @@ import { Spin } from 'antd'; ...@@ -3,7 +3,7 @@ import { Spin } from 'antd';
import LocalStorage from 'local-storage'; import LocalStorage from 'local-storage';
import ImportActionHeader from './ImportActionHeader'; import ImportActionHeader from './ImportActionHeader';
import ImportActionTable from './ImportActionTable'; import { ImportActionTable } from './ImportActionTable';
import ImportActionIndex from './ImportActionIndex'; import ImportActionIndex from './ImportActionIndex';
import { getQueryParam } from '../../../../util'; import { getQueryParam } from '../../../../util';
import { Action } from '../../../../util/constant'; import { Action } from '../../../../util/constant';
......
...@@ -22,7 +22,7 @@ import './ImportActionTable.less'; ...@@ -22,7 +22,7 @@ import './ImportActionTable.less';
const { Option } = Select; const { Option } = Select;
const type = 'DragableTableBodyRow'; const type = `DragableTableBodyRow${generateUUID()}`;
const perSuggestCount = 5; const perSuggestCount = 5;
const supportMaxAttributeCountPerPage = 100; const supportMaxAttributeCountPerPage = 100;
const MENU_ID = 'model-attribute-menu'; const MENU_ID = 'model-attribute-menu';
...@@ -59,7 +59,7 @@ const ResizeableHeaderCell = props => { ...@@ -59,7 +59,7 @@ const ResizeableHeaderCell = props => {
); );
}; };
const DatatypeInput = ({ value = {}, datatypes, onChange }) => { export const DatatypeInput = ({ value = {}, datatypes, onChange }) => {
const onNameChange = (value) => { const onNameChange = (value) => {
...@@ -152,7 +152,7 @@ const DatatypeInput = ({ value = {}, datatypes, onChange }) => { ...@@ -152,7 +152,7 @@ const DatatypeInput = ({ value = {}, datatypes, onChange }) => {
) )
} }
const EditableCell = ({ export const EditableCell = ({
editing, editing,
dataIndex, dataIndex,
colTitle, colTitle,
...@@ -222,7 +222,7 @@ const EditableCell = ({ ...@@ -222,7 +222,7 @@ const EditableCell = ({
); );
}; };
const DragableBodyRow = ({ index, moveRow, className, style, ...restProps }) => { export const DragableBodyRow = ({ index, moveRow, className, style, ...restProps }) => {
const ref = useRef(); const ref = useRef();
const [{ isOver, dropClassName }, drop] = useDrop( const [{ isOver, dropClassName }, drop] = useDrop(
...@@ -275,7 +275,7 @@ const DragableBodyRow = ({ index, moveRow, className, style, ...restProps }) => ...@@ -275,7 +275,7 @@ const DragableBodyRow = ({ index, moveRow, className, style, ...restProps }) =>
); );
}; };
const ImportActionTable = (props) => { export const ImportActionTable = (props) => {
const { modelerData, onChange, editable, supportedDatatypes, constraint, template, validateReports, type = 'model', terms, action, originAction } = props; const { modelerData, onChange, editable, supportedDatatypes, constraint, template, validateReports, type = 'model', terms, action, originAction } = props;
const [ data, setData ] = useState([]); const [ data, setData ] = useState([]);
...@@ -1411,5 +1411,3 @@ const ImportActionTable = (props) => { ...@@ -1411,5 +1411,3 @@ const ImportActionTable = (props) => {
</div> </div>
); );
}; };
export default ImportActionTable;
\ No newline at end of file
...@@ -3,7 +3,7 @@ import { Spin, Tabs, Popover, Divider, Button, Space } from 'antd'; ...@@ -3,7 +3,7 @@ import { Spin, Tabs, Popover, Divider, Button, Space } from 'antd';
import { QuestionCircleOutlined } from '@ant-design/icons'; import { QuestionCircleOutlined } from '@ant-design/icons';
import TemplateActionHeader from './TemplateActionHeader'; import TemplateActionHeader from './TemplateActionHeader';
import ImportActionTable from '../../Model/Component/ImportActionTable'; import { ImportActionTable } from '../../Model/Component/ImportActionTable';
import { dispatchLatest, dispatch } from '../../../../model'; import { dispatchLatest, dispatch } from '../../../../model';
......
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