Browse Source

模型管理功规则调整 移除是否可读

master
peng.peng 2 years ago
parent
commit
5248eb1f8b
  1. 48
      web/client/src/sections/metadataManagement/components/modelModal.js
  2. 15
      web/client/src/sections/metadataManagement/containers/metaModelManagement.js

48
web/client/src/sections/metadataManagement/components/modelModal.js

@ -1,13 +1,21 @@
import React from 'react';
import React, { useRef } from 'react';
import { Button, Form } from 'antd';
import {
ModalForm,
ProFormSelect,
ProFormTextArea,
ProFormDigit,
ProFormText
ProFormText,
ProFormDependency
} from '@ant-design/pro-form';
const DATA_TYPES = {
"整型": "数字输入框",
"字符型": "文本框",
"布尔型": "下拉框",
"数字输入框": "整型",
"文本框": "字符型",
"下拉框": "布尔型",
}
export default (props) => {
const { title, triggerRender, editData = null, onFinish, readOnly, models } = props;
const formItemLayout = { labelCol: { span: 6 }, wrapperCol: { span: 16 } };
@ -15,9 +23,10 @@ export default (props) => {
...editData,
} : {};
const [form] = Form.useForm();
const formRef = useRef();
return (
<ModalForm
form={form}
formRef={formRef}
title={title || ''}
initialValues={initialValues}
trigger={
@ -63,18 +72,18 @@ export default (props) => {
name="dataType"
label="数据类型"
fieldProps={{
showSearch: true
showSearch: true,
onChange: value => {
formRef?.current?.setFieldsValue({
control: DATA_TYPES[value]
})
}
}}
/>
<ProFormDigit
name="length"
label="长度"
fieldProps={{ precision: 0, max: 99999999, }}
/>
<ProFormSelect
rules={[{ required: true, message: '请选择输入控件' }]}
disabled={true}
options={[
{ label: '数字输入框', value: '数字输入框' },
{ label: '文本框', value: '文本框' },
@ -82,6 +91,19 @@ export default (props) => {
]}
name="control"
label="输入控件"
fieldProps={{
showSearch: true,
onChange: value => {
formRef?.current?.setFieldsValue({
dataType: DATA_TYPES[value]
})
}
}}
/>
<ProFormDigit
name="length"
label="长度"
fieldProps={{ precision: 0, max: 99999999, }}
/>
<ProFormSelect
@ -92,7 +114,7 @@ export default (props) => {
name="nullable"
label="是否允许为空"
/>
{/*
<ProFormSelect
rules={[{ required: true, message: '请选是否只读' }]}
options={[
@ -100,7 +122,7 @@ export default (props) => {
{ label: '否', value: false }]}
name="readOnly"
label="是否只读"
/>
/> */}
<ProFormTextArea
name="description"

15
web/client/src/sections/metadataManagement/containers/metaModelManagement.js

@ -49,6 +49,7 @@ function MetaModelManagement(props) {
return dispatch(actions.metadataManagement.addMetaModel({
modelType: selectedKeys[0],
...values,
readOnly: false
})).then(res => {
if (res.success) {
queryData();
@ -97,13 +98,13 @@ function MetaModelManagement(props) {
search: false,
render: (text, record) => record?.nullable ? '是' : '否'
},
{
title: '是否只读',
dataIndex: 'readOnly',
ellipsis: true,
search: false,
render: (text, record) => record?.readOnly ? '是' : '否'
},
// {
// title: '是否只读',
// dataIndex: 'readOnly',
// ellipsis: true,
// search: false,
// render: (text, record) => record?.readOnly ? '是' : '否'
// },
{
title: '描述',
dataIndex: 'description',

Loading…
Cancel
Save