Commit 6f5566a6 authored by 皮倩雯's avatar 皮倩雯

fix: '修改表字段修改字段模态样式'

parent f7708f53
Pipeline #42625 skipped with stages
...@@ -26,14 +26,7 @@ import VerifyModal from './VerifyModal'; ...@@ -26,14 +26,7 @@ import VerifyModal from './VerifyModal';
import { PlusSquareOutlined } from '@ant-design/icons'; import { PlusSquareOutlined } from '@ant-design/icons';
import { shape } from 'prop-types'; import { shape } from 'prop-types';
const AddModal = props => { const AddModal = props => {
const { const { callBackSubmit = () => {}, isType, itemData, isVisible, formObj1, onCancel } = props;
callBackSubmit = () => {},
isType,
itemData,
isVisible,
formObj1,
onCancel,
} = props;
const [loading, setLoading] = useState(false); const [loading, setLoading] = useState(false);
const [fieldName, setFieldName] = useState([]); // 弹窗 const [fieldName, setFieldName] = useState([]); // 弹窗
const [eventList, setEventList] = useState([]); // 事件 const [eventList, setEventList] = useState([]); // 事件
...@@ -141,9 +134,7 @@ const AddModal = props => { ...@@ -141,9 +134,7 @@ const AddModal = props => {
data[0].Config = `${obj.code}.${obj.prefix ? obj.prefix : ''}`; data[0].Config = `${obj.code}.${obj.prefix ? obj.prefix : ''}`;
break; break;
case '坐标控件': case '坐标控件':
pramData.coordinates pramData.coordinates ? (data[0].Config = '当前坐标') : (data[0].Config = '');
? (data[0].Config = '当前坐标')
: (data[0].Config = '');
break; break;
case '图片': case '图片':
case '可预览图片': case '可预览图片':
...@@ -200,18 +191,12 @@ const AddModal = props => { ...@@ -200,18 +191,12 @@ const AddModal = props => {
must = false; must = false;
switch (res[0].data.root.Shape) { switch (res[0].data.root.Shape) {
case '坐标控件': case '坐标控件':
res[0].data.root.Config === '当前坐标' res[0].data.root.Config === '当前坐标' ? (coordinates = true) : (coordinates = false);
? (coordinates = true)
: (coordinates = false);
break; break;
case '图片': case '图片':
case '可预览图片': case '可预览图片':
res[0].data.root.Preset === '拍照相册' res[0].data.root.Preset === '拍照相册' ? (picture = true) : (picture = false);
? (picture = true) res[0].data.root.ValidationRule === 'required' ? (must = true) : (must = false);
: (picture = false);
res[0].data.root.ValidationRule === 'required'
? (must = true)
: (must = false);
break; break;
case '编码': case '编码':
let code = res[0].data.root.Config.split('.'); let code = res[0].data.root.Config.split('.');
...@@ -446,22 +431,15 @@ const AddModal = props => { ...@@ -446,22 +431,15 @@ const AddModal = props => {
> >
{isVisible && ( {isVisible && (
<Form form={form} {...layout}> <Form form={form} {...layout}>
<Item <Item label="字段名" name="Name" rules={[{ required: true, message: '请输入表名' }]}>
label="字段名" <Input placeholder="请输入别名" disabled style={{ width: '93%' }} />
name="Name"
rules={[{ required: true, message: '请输入表名' }]}
>
<Input placeholder="请输入别名" disabled />
</Item> </Item>
<Item label="别名" name="Alias"> <Item label="别名" name="Alias">
<Input placeholder="请输入别名" allowClear /> <Input placeholder="请输入别名" allowClear style={{ width: '93%' }} />
</Item> </Item>
<Item name="ReadOnly" label="属性"> <Item name="ReadOnly" label="属性">
<div> <div>
<Checkbox <Checkbox checked={pramData.ReadOnly} onChange={e => onChangeReady(e, 'ReadOnly')}>
checked={pramData.ReadOnly}
onChange={e => onChangeReady(e, 'ReadOnly')}
>
只读 只读
</Checkbox> </Checkbox>
<Checkbox <Checkbox
...@@ -486,11 +464,7 @@ const AddModal = props => { ...@@ -486,11 +464,7 @@ const AddModal = props => {
<Item label="形态"> <Item label="形态">
<div className={styles.listEvent}> <div className={styles.listEvent}>
<Select <Select style={{ width: '42%' }} value={Shape} onChange={handleCharacteristics}>
style={{ width: '42%' }}
value={Shape}
onChange={handleCharacteristics}
>
{characteristics.length {characteristics.length
? characteristics.map((item, index) => { ? characteristics.map((item, index) => {
return ( return (
...@@ -514,7 +488,7 @@ const AddModal = props => { ...@@ -514,7 +488,7 @@ const AddModal = props => {
<div className={styles.unit}> <div className={styles.unit}>
宽: 宽:
<Input <Input
style={{ width: '4rem' }} style={{ width: '3.8rem' }}
placeholder="" placeholder=""
allowClear allowClear
value={pramData.RowSpan} value={pramData.RowSpan}
...@@ -529,24 +503,14 @@ const AddModal = props => { ...@@ -529,24 +503,14 @@ const AddModal = props => {
return ( return (
<> <>
<Item label="前缀" name="prefix"> <Item label="前缀" name="prefix">
<Input <Input style={{ width: '93%' }} placeholder="" allowClear />
style={{ width: '95%' }}
placeholder=""
allowClear
/>
</Item> </Item>
<Item label="编码方式" name="code"> <Item label="编码方式" name="code">
<Radio.Group> <Radio.Group>
<Radio <Radio value="年份编码" style={{ marginRight: '0.5rem' }}>
value="年份编码"
style={{ marginRight: '0.5rem' }}
>
XJ-2019-000001(前缀-年份-六位编码) XJ-2019-000001(前缀-年份-六位编码)
</Radio> </Radio>
<Radio <Radio value="年月编码" style={{ marginRight: '0.5rem' }}>
value="年月编码"
style={{ marginRight: '0.5rem' }}
>
XJ-201909-000001(前缀-年份月份-六位编码) XJ-201909-000001(前缀-年份月份-六位编码)
</Radio> </Radio>
<Radio value="一般编码" defaultChecked> <Radio value="一般编码" defaultChecked>
...@@ -564,7 +528,7 @@ const AddModal = props => { ...@@ -564,7 +528,7 @@ const AddModal = props => {
<> <>
{' '} {' '}
<Item label="可选值" name="Config"> <Item label="可选值" name="Config">
<TextArea allowClear /> <TextArea allowClear style={{ width: '93%' }} />
</Item> </Item>
<Item colon={false} label=" "> <Item colon={false} label=" ">
{' '} {' '}
...@@ -572,28 +536,13 @@ const AddModal = props => { ...@@ -572,28 +536,13 @@ const AddModal = props => {
<span style={{ marginRight: '0.4rem' }}> <span style={{ marginRight: '0.4rem' }}>
以英文逗号为分隔符填写,或其他分隔符粘贴: 以英文逗号为分隔符填写,或其他分隔符粘贴:
</span> </span>
<Select <Select onChange={handleSeparator} style={{ width: '30.8%' }}>
onChange={handleSeparator} <Select.Option value="0">以,分隔(英文逗号)</Select.Option>
style={{ width: '30%' }} <Select.Option value="1">以/分隔(正斜杠)</Select.Option>
> <Select.Option value="2">以\\分隔(反斜杠)</Select.Option>
<Select.Option value="0"> <Select.Option value="3">以、分隔(中文顿号)</Select.Option>
以,分隔(英文逗号) <Select.Option value="4">以;分隔(英文分号)</Select.Option>
</Select.Option> <Select.Option value="5">以;分隔(中文分号)</Select.Option>
<Select.Option value="1">
以/分隔(正斜杠)
</Select.Option>
<Select.Option value="2">
以\\分隔(反斜杠)
</Select.Option>
<Select.Option value="3">
以、分隔(中文顿号)
</Select.Option>
<Select.Option value="4">
以;分隔(英文分号)
</Select.Option>
<Select.Option value="5">
以;分隔(中文分号)
</Select.Option>
<Select.Option value="6">(是)/否</Select.Option> <Select.Option value="6">(是)/否</Select.Option>
<Select.Option value="7">是/(否)</Select.Option> <Select.Option value="7">是/(否)</Select.Option>
<Select.Option value="8">(否)/是</Select.Option> <Select.Option value="8">(否)/是</Select.Option>
...@@ -613,10 +562,7 @@ const AddModal = props => { ...@@ -613,10 +562,7 @@ const AddModal = props => {
> >
允许从相册选取 允许从相册选取
</Checkbox> </Checkbox>
<Checkbox <Checkbox checked={pramData.must} onChange={e => onChangeReady(e, 'must')}>
checked={pramData.must}
onChange={e => onChangeReady(e, 'must')}
>
必填字段 必填字段
</Checkbox> </Checkbox>
</div> </div>
...@@ -663,7 +609,7 @@ const AddModal = props => { ...@@ -663,7 +609,7 @@ const AddModal = props => {
default: default:
return ( return (
<Item label="配置" name="Config"> <Item label="配置" name="Config">
<TextArea allowClear /> <TextArea allowClear style={{ width: '93%' }} />
</Item> </Item>
); );
} }
...@@ -674,7 +620,7 @@ const AddModal = props => { ...@@ -674,7 +620,7 @@ const AddModal = props => {
<Item label="预设值"> <Item label="预设值">
<div className={styles.listEvent}> <div className={styles.listEvent}>
<Input <Input
style={{ width: '40%', height: '1.8rem' }} style={{ width: '42%', height: '1.8rem' }}
value={pramData.Preset} value={pramData.Preset}
onChange={e => handleInput(e, 'Preset')} onChange={e => handleInput(e, 'Preset')}
placeholder="" placeholder=""
......
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