|
|
@@ -86,10 +86,11 @@ export const handleOptionsLabel = (data: any, type?: string) => {
|
|
|
};
|
|
|
const _value = isObject(v) ? Object.values(v) : [v];
|
|
|
const typeStr = type ? typeKey[type] : '';
|
|
|
- if (DoubleFilter.includes(t) && !range) {
|
|
|
+ if (DoubleFilter.includes(t) && _value.length === 2) {
|
|
|
const str = termsTypeKey[t].replace('_value', _value[0]).replace('_value2', _value[1]);
|
|
|
return `${c} ${str} ${typeStr} `;
|
|
|
- } else if (DoubleFilter.includes(t) && !!range) {
|
|
|
+ } else if (DoubleFilter.includes(t) && !!range && _value.length === 1) {
|
|
|
+ console.log(_value, range);
|
|
|
const str = termsTypeKey[t].replace('_value和_value2', _value[0]);
|
|
|
return `${c} ${str} ${typeStr} `;
|
|
|
} else {
|
|
|
@@ -157,6 +158,7 @@ const ParamsItem = observer((props: ParamsItemProps) => {
|
|
|
[];
|
|
|
setTtOptions(_termTypeOptions);
|
|
|
setValueType(labelOptions.dataType);
|
|
|
+ enumRef.current = labelOptions.options;
|
|
|
if (labelOptions.metrics) {
|
|
|
// 指标值
|
|
|
const _metrics = labelOptions.metrics.map((mItem: any) => ({
|
|
|
@@ -183,7 +185,7 @@ const ParamsItem = observer((props: ParamsItemProps) => {
|
|
|
useEffect(() => {
|
|
|
setTermType(props.data.termType || '');
|
|
|
setValue(props.data.value);
|
|
|
- console.log('props.data-----', props.data);
|
|
|
+ // console.log('props.data-----', props.data);
|
|
|
setColumn(props.data.column || '');
|
|
|
// if(props.data.value?.source === 'metric'){
|
|
|
// setIsRange(true)
|
|
|
@@ -403,7 +405,7 @@ const ParamsItem = observer((props: ParamsItemProps) => {
|
|
|
value={value}
|
|
|
enumList={enumRef.current}
|
|
|
onChange={(v, lb, item) => {
|
|
|
- // console.log('-----', v, lb, item);
|
|
|
+ console.log('-----', v, lb, item);
|
|
|
const _value = { ...v };
|
|
|
if (item) {
|
|
|
_value.metric = item.id;
|
|
|
@@ -418,6 +420,7 @@ const ParamsItem = observer((props: ParamsItemProps) => {
|
|
|
if (!!metricsOptions.length) {
|
|
|
if (DoubleFilter.includes(termType) && !isRange) {
|
|
|
labelCache.current[2] = { 0: v?.value?.[0], 1: v?.value?.[1] };
|
|
|
+ labelCache.current.length = 3;
|
|
|
} else {
|
|
|
labelCache.current[2] = { 0: lb };
|
|
|
labelCache.current[4] = 'range';
|
|
|
@@ -426,7 +429,7 @@ const ParamsItem = observer((props: ParamsItemProps) => {
|
|
|
labelCache.current[2] = { 0: lb };
|
|
|
}
|
|
|
labelCache.current[3] = props.data.type;
|
|
|
- console.log('labelCache------', [...labelCache.current]);
|
|
|
+ // console.log('labelCache------', [...labelCache.current]);
|
|
|
props.onLabelChange?.([...labelCache.current]);
|
|
|
valueEventChange(_value);
|
|
|
}}
|