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

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

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