update parameters

This commit is contained in:
Fine 2025-02-19 11:12:29 +08:00
parent e1869840df
commit 7da36bc4cf
3 changed files with 15 additions and 4 deletions

View File

@ -13,7 +13,12 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and See the License for the specific language governing permissions and
limitations under the License. --> limitations under the License. -->
<template> <template>
<SelectorLegend :data="option.legend.data" :show="legendSelector" @change="changeLegend" /> <SelectorLegend
:data="option.legend.data"
:show="legendSelector.isSelector"
:isConfigPage="legendSelector.isConfigPage"
@change="changeLegend"
/>
<div class="chart" ref="chartRef" :style="`height:${height};width:${width};`"> <div class="chart" ref="chartRef" :style="`height:${height};width:${width};`">
<div v-if="!available" class="no-data">No Data</div> <div v-if="!available" class="no-data">No Data</div>
<div <div
@ -87,8 +92,8 @@ limitations under the License. -->
default: () => [], default: () => [],
}, },
legendSelector: { legendSelector: {
type: Boolean, type: Object as PropType<Indexable>,
default: false, default: () => ({ isConfigPage: false, isSelector: false }),
}, },
}); });
const available = computed( const available = computed(

View File

@ -40,6 +40,10 @@ limitations under the License. -->
type: Boolean, type: Boolean,
default: false, default: false,
}, },
isConfigPage: {
type: Boolean,
default: false,
},
}); });
const emits = defineEmits(["change"]); const emits = defineEmits(["change"]);
const Options = computed(() => props.data.map((d: { name: string }) => ({ label: d.name, value: d.name }))); const Options = computed(() => props.data.map((d: { name: string }) => ({ label: d.name, value: d.name })));

View File

@ -19,7 +19,7 @@ limitations under the License. -->
:filters="config.filters" :filters="config.filters"
:relatedTrace="config.relatedTrace" :relatedTrace="config.relatedTrace"
:associate="config.associate || []" :associate="config.associate || []"
:legendSelector="legendSelector" :legendSelector="{ isSelector: legendSelector, sConfigPage: dashboardStore.showConfig }"
@select="clickEvent" @select="clickEvent"
/> />
<Legend :config="config.legend" :data="data" :intervalTime="intervalTime" /> <Legend :config="config.legend" :data="data" :intervalTime="intervalTime" />
@ -33,6 +33,7 @@ limitations under the License. -->
import useLegendProcess from "@/hooks/useLegendProcessor"; import useLegendProcess from "@/hooks/useLegendProcessor";
import { isDef } from "@/utils/is"; import { isDef } from "@/utils/is";
import { useAppStoreWithOut } from "@/store/modules/app"; import { useAppStoreWithOut } from "@/store/modules/app";
import { useDashboardStore } from "@/store/modules/dashboard";
import { Themes } from "@/constants/data"; import { Themes } from "@/constants/data";
/*global defineProps, defineEmits */ /*global defineProps, defineEmits */
@ -66,6 +67,7 @@ limitations under the License. -->
}, },
}); });
const appStore = useAppStoreWithOut(); const appStore = useAppStoreWithOut();
const dashboardStore = useDashboardStore();
const setRight = ref<boolean>(false); const setRight = ref<boolean>(false);
const legendSelector = computed(() => props.config.legend?.asSelector); const legendSelector = computed(() => props.config.legend?.asSelector);
const option = computed(() => getOption()); const option = computed(() => getOption());