Commit ab593e04 by zhaochengxiang

主数据模版字段编辑

parent f256b872
......@@ -168,3 +168,146 @@ export const expandedTableData = [
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 { form } = props;
......@@ -16,20 +18,28 @@ const UpdateBasicInfo = (props) => {
return (
<div>
<Divider>基本信息</Divider>
<h3>基本信息</h3>
<Form
form={form}
{...formItemLayout}
>
<Form.Item label='模版名称' name='name' rules={[{ required: true, message: '请填写模版名称' }]}>
<Row gutter={10}>
<Col xs={24} sm={24} lg={12}>
<Form.Item label='中文名称' name='cnName' rules={[{ required: true, message: '请填写模版中文名称' }]}>
<Input />
</Form.Item>
<Form.Item label='模版中文名称' name='cnName' rules={[{ required: true, message: '请填写模版中文名称' }]}>
</Col>
<Col xs={24} sm={24} lg={12}>
<Form.Item label='英文名称' name='name' rules={[{ required: true, message: '请填写模版名称' }]}>
<Input />
</Form.Item>
</Col>
<Col xs={24} sm={24} lg={12}>
<Form.Item label='模版描述' name='desc'>
<Input />
<TextArea row={4} />
</Form.Item>
</Col>
</Row>
</Form>
</div>
);
......
import { Modal, Form, Input, Button } from "antd";
import { MinusCircleOutlined, PlusOutlined } from '@ant-design/icons';
import { Modal, Form } from "antd";
import UpdateBasicInfo from "./UpdateBasicInfo";
import UpdateField from "./UpdateField";
import './UpdateTemplateModal.less';
const UpdateTemplateModal = (props) => {
const { visible, onCancel } = props;
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() => {
try {
await form.validateFields();
......@@ -45,12 +21,14 @@ const UpdateTemplateModal = (props) => {
return (
<Modal
className='update-template-modal'
width='80%'
title='新建模版'
visible={visible}
onCancel={onCancel}
onOk={onFormFinish}
>
<UpdateBasicInfo form={form} />
<UpdateField />
</Modal>
);
}
......
......@@ -3,7 +3,7 @@ import { Spin } from 'antd';
import LocalStorage from 'local-storage';
import ImportActionHeader from './ImportActionHeader';
import ImportActionTable from './ImportActionTable';
import { ImportActionTable } from './ImportActionTable';
import ImportActionIndex from './ImportActionIndex';
import { getQueryParam } from '../../../../util';
import { Action } from '../../../../util/constant';
......
......@@ -22,7 +22,7 @@ import './ImportActionTable.less';
const { Option } = Select;
const type = 'DragableTableBodyRow';
const type = `DragableTableBodyRow${generateUUID()}`;
const perSuggestCount = 5;
const supportMaxAttributeCountPerPage = 100;
const MENU_ID = 'model-attribute-menu';
......@@ -59,7 +59,7 @@ const ResizeableHeaderCell = props => {
);
};
const DatatypeInput = ({ value = {}, datatypes, onChange }) => {
export const DatatypeInput = ({ value = {}, datatypes, onChange }) => {
const onNameChange = (value) => {
......@@ -152,7 +152,7 @@ const DatatypeInput = ({ value = {}, datatypes, onChange }) => {
)
}
const EditableCell = ({
export const EditableCell = ({
editing,
dataIndex,
colTitle,
......@@ -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 [{ isOver, dropClassName }, drop] = useDrop(
......@@ -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 [ data, setData ] = useState([]);
......@@ -1411,5 +1411,3 @@ const ImportActionTable = (props) => {
</div>
);
};
export default ImportActionTable;
\ No newline at end of file
......@@ -3,7 +3,7 @@ import { Spin, Tabs, Popover, Divider, Button, Space } from 'antd';
import { QuestionCircleOutlined } from '@ant-design/icons';
import TemplateActionHeader from './TemplateActionHeader';
import ImportActionTable from '../../Model/Component/ImportActionTable';
import { ImportActionTable } from '../../Model/Component/ImportActionTable';
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