|
|
@@ -57,7 +57,6 @@ const handleOptions = (options: any[]): any[] => {
|
|
|
};
|
|
|
|
|
|
const DoubleFilter = ['nbtw', 'btw', 'in', 'nin'];
|
|
|
-
|
|
|
export const handleOptionsLabel = (data: any, type?: string) => {
|
|
|
if (data && isArray(data)) {
|
|
|
try {
|
|
|
@@ -277,7 +276,7 @@ const ParamsItem = observer((props: ParamsItemProps) => {
|
|
|
const _value = {
|
|
|
...value,
|
|
|
};
|
|
|
- if (value && DoubleFilter.includes(v!)) {
|
|
|
+ if (value && DoubleFilter.includes(v!) && !metricsOptions.length) {
|
|
|
_value.value = [undefined, undefined];
|
|
|
} else {
|
|
|
_value.value = undefined;
|
|
|
@@ -294,7 +293,7 @@ const ParamsItem = observer((props: ParamsItemProps) => {
|
|
|
});
|
|
|
}}
|
|
|
/>
|
|
|
- {DoubleFilter.includes(termType) ? (
|
|
|
+ {DoubleFilter.includes(termType) && !metricsOptions.length ? (
|
|
|
<>
|
|
|
<ParamsDropdown
|
|
|
options={valueOptions}
|
|
|
@@ -370,15 +369,25 @@ const ParamsItem = observer((props: ParamsItemProps) => {
|
|
|
placeholder="参数值"
|
|
|
valueType={valueType}
|
|
|
value={value}
|
|
|
- onChange={(v, lb) => {
|
|
|
- setValue({
|
|
|
- ...v,
|
|
|
- });
|
|
|
+ onChange={(v, lb, item) => {
|
|
|
+ const _value = { ...v };
|
|
|
+ if (item) {
|
|
|
+ _value.metric = item.id;
|
|
|
+ }
|
|
|
+ setValue(_value);
|
|
|
ValueRef.current.value = v;
|
|
|
- labelCache.current[2] = { 0: lb };
|
|
|
+ if (!!metricsOptions.length) {
|
|
|
+ if (DoubleFilter.includes(termType)) {
|
|
|
+ labelCache.current[2] = { 0: v?.value[0], 1: v?.value[1] };
|
|
|
+ } else {
|
|
|
+ labelCache.current[2] = { 0: lb };
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ labelCache.current[2] = { 0: lb };
|
|
|
+ }
|
|
|
labelCache.current[3] = props.data.type;
|
|
|
props.onLabelChange?.([...labelCache.current]);
|
|
|
- valueEventChange(v);
|
|
|
+ valueEventChange(_value);
|
|
|
}}
|
|
|
icon={<AIcon type={'icon-canshu'} />}
|
|
|
/>
|