修复新建任务视图交互

This commit is contained in:
whyour 2022-09-06 00:40:06 +08:00
parent daf6f94c51
commit f7b6237355
2 changed files with 16 additions and 9 deletions

View File

@ -161,6 +161,14 @@
} }
} }
.view-create-modal-sorts {
display: flex;
.ant-space-item:nth-child(2) {
flex: 1;
}
}
tr.drop-over-downward td { tr.drop-over-downward td {
border-bottom: 2px dashed #1890ff; border-bottom: 2px dashed #1890ff;
} }

View File

@ -101,9 +101,9 @@ const ViewCreateModal = ({
</Select> </Select>
); );
const propertyElement = (props: any) => { const propertyElement = (props: any, style: React.CSSProperties = {}) => {
return ( return (
<Select style={{ width: 120 }}> <Select style={style}>
{props.map((x) => ( {props.map((x) => (
<Select.Option key={x.name} value={x.value}> <Select.Option key={x.name} value={x.value}>
{x.name} {x.name}
@ -114,7 +114,7 @@ const ViewCreateModal = ({
}; };
const typeElement = ( const typeElement = (
<Select style={{ width: 120 }}> <Select>
{SORTTYPES.map((x) => ( {SORTTYPES.map((x) => (
<Select.Option key={x.name} value={x.value}> <Select.Option key={x.name} value={x.value}>
{x.name} {x.name}
@ -170,6 +170,7 @@ const ViewCreateModal = ({
label={index === 0 ? '筛选条件' : ''} label={index === 0 ? '筛选条件' : ''}
key={key} key={key}
style={{ marginBottom: 0 }} style={{ marginBottom: 0 }}
required
> >
<Space className="view-create-modal-filters" align="baseline"> <Space className="view-create-modal-filters" align="baseline">
<Form.Item <Form.Item
@ -177,7 +178,7 @@ const ViewCreateModal = ({
name={[name, 'property']} name={[name, 'property']}
rules={[{ required: true }]} rules={[{ required: true }]}
> >
{propertyElement(PROPERTIES)} {propertyElement(PROPERTIES, { width: 120 })}
</Form.Item> </Form.Item>
<Form.Item <Form.Item
{...restField} {...restField}
@ -225,13 +226,13 @@ const ViewCreateModal = ({
key={key} key={key}
style={{ marginBottom: 0 }} style={{ marginBottom: 0 }}
> >
<Space className="view-create-modal-filters" align="baseline"> <Space className="view-create-modal-sorts" align="baseline">
<Form.Item <Form.Item
{...restField} {...restField}
name={[name, 'property']} name={[name, 'property']}
rules={[{ required: true }]} rules={[{ required: true }]}
> >
{propertyElement(PROPERTIES)} {propertyElement(PROPERTIES, { width: 240 })}
</Form.Item> </Form.Item>
<Form.Item <Form.Item
{...restField} {...restField}
@ -240,9 +241,7 @@ const ViewCreateModal = ({
> >
{typeElement} {typeElement}
</Form.Item> </Form.Item>
{index !== 0 && (
<MinusCircleOutlined onClick={() => remove(name)} /> <MinusCircleOutlined onClick={() => remove(name)} />
)}
</Space> </Space>
</Form.Item> </Form.Item>
))} ))}