|
@@ -21,7 +21,6 @@ const FilterItem = ({ item, sn, onRemove }: IProps) => {
|
|
|
const intl = useIntl();
|
|
const intl = useIntl();
|
|
|
return (
|
|
return (
|
|
|
<ProForm.Group>
|
|
<ProForm.Group>
|
|
|
- <Text>{sn === 0 ? "当" : "且"}</Text>
|
|
|
|
|
<ProFormSelect
|
|
<ProFormSelect
|
|
|
initialValue={item.field}
|
|
initialValue={item.field}
|
|
|
name={`field_${sn}`}
|
|
name={`field_${sn}`}
|
|
@@ -46,15 +45,18 @@ const FilterItem = ({ item, sn, onRemove }: IProps) => {
|
|
|
name={`operator_${sn}`}
|
|
name={`operator_${sn}`}
|
|
|
style={{ width: 120 }}
|
|
style={{ width: 120 }}
|
|
|
options={[
|
|
options={[
|
|
|
- {
|
|
|
|
|
- value: "includes",
|
|
|
|
|
- label: "包含",
|
|
|
|
|
- },
|
|
|
|
|
- {
|
|
|
|
|
- value: "not-includes",
|
|
|
|
|
- label: "不包含",
|
|
|
|
|
- },
|
|
|
|
|
- ]}
|
|
|
|
|
|
|
+ "includes",
|
|
|
|
|
+ "not-includes",
|
|
|
|
|
+ "equal",
|
|
|
|
|
+ "not-equal",
|
|
|
|
|
+ "null",
|
|
|
|
|
+ "not-null",
|
|
|
|
|
+ ].map((item) => {
|
|
|
|
|
+ return {
|
|
|
|
|
+ value: item,
|
|
|
|
|
+ label: intl.formatMessage({ id: `labels.filters.${item}` }),
|
|
|
|
|
+ };
|
|
|
|
|
+ })}
|
|
|
/>
|
|
/>
|
|
|
<UserSelect
|
|
<UserSelect
|
|
|
name={"value_" + sn}
|
|
name={"value_" + sn}
|
|
@@ -83,7 +85,7 @@ const Filter = ({ initValue, onChange }: IWidget) => {
|
|
|
arrowPointAtCenter
|
|
arrowPointAtCenter
|
|
|
title={intl.formatMessage({ id: "labels.filter" })}
|
|
title={intl.formatMessage({ id: "labels.filter" })}
|
|
|
content={
|
|
content={
|
|
|
- <div style={{ width: 750 }}>
|
|
|
|
|
|
|
+ <div style={{ width: 780 }}>
|
|
|
<ProForm
|
|
<ProForm
|
|
|
formRef={formRef}
|
|
formRef={formRef}
|
|
|
submitter={{
|
|
submitter={{
|
|
@@ -133,22 +135,45 @@ const Filter = ({ initValue, onChange }: IWidget) => {
|
|
|
}
|
|
}
|
|
|
}}
|
|
}}
|
|
|
>
|
|
>
|
|
|
- {filterList.map((item, id) => {
|
|
|
|
|
- return (
|
|
|
|
|
- <FilterItem
|
|
|
|
|
- item={item}
|
|
|
|
|
- key={id}
|
|
|
|
|
- sn={id}
|
|
|
|
|
- onRemove={() => {
|
|
|
|
|
- setFilterList((origin) => {
|
|
|
|
|
- return origin.filter(
|
|
|
|
|
- (value, index: number) => index !== id
|
|
|
|
|
- );
|
|
|
|
|
- });
|
|
|
|
|
- }}
|
|
|
|
|
- />
|
|
|
|
|
- );
|
|
|
|
|
- })}
|
|
|
|
|
|
|
+ <ProForm.Group>
|
|
|
|
|
+ <Text type="secondary">{"满足以下"}</Text>
|
|
|
|
|
+ <ProFormSelect
|
|
|
|
|
+ name={"operator"}
|
|
|
|
|
+ initialValue={"and"}
|
|
|
|
|
+ style={{ width: 120 }}
|
|
|
|
|
+ options={["and", "or"].map((item) => {
|
|
|
|
|
+ return {
|
|
|
|
|
+ value: item,
|
|
|
|
|
+ label: intl.formatMessage({ id: `labels.filters.${item}` }),
|
|
|
|
|
+ };
|
|
|
|
|
+ })}
|
|
|
|
|
+ />
|
|
|
|
|
+ </ProForm.Group>
|
|
|
|
|
+ <div
|
|
|
|
|
+ style={{
|
|
|
|
|
+ border: "1px solid rgba(128, 128, 128, 0.5)",
|
|
|
|
|
+ borderRadius: 6,
|
|
|
|
|
+ marginBottom: 8,
|
|
|
|
|
+ padding: "8px 0 8px 8px",
|
|
|
|
|
+ }}
|
|
|
|
|
+ >
|
|
|
|
|
+ {filterList.map((item, id) => {
|
|
|
|
|
+ return (
|
|
|
|
|
+ <FilterItem
|
|
|
|
|
+ item={item}
|
|
|
|
|
+ key={id}
|
|
|
|
|
+ sn={id}
|
|
|
|
|
+ onRemove={() => {
|
|
|
|
|
+ setFilterList((origin) => {
|
|
|
|
|
+ return origin.filter(
|
|
|
|
|
+ (value, index: number) => index !== id
|
|
|
|
|
+ );
|
|
|
|
|
+ });
|
|
|
|
|
+ }}
|
|
|
|
|
+ />
|
|
|
|
|
+ );
|
|
|
|
|
+ })}
|
|
|
|
|
+ </div>
|
|
|
</ProForm>
|
|
</ProForm>
|
|
|
</div>
|
|
</div>
|
|
|
}
|
|
}
|