mirror of
https://github.com/apache/skywalking-booster-ui.git
synced 2025-05-13 16:27:33 +00:00
dispatch action
This commit is contained in:
parent
6c5983d30c
commit
ea4cc86d85
@ -148,11 +148,14 @@ function instanceEvent() {
|
|||||||
|
|
||||||
function associateMetrics() {
|
function associateMetrics() {
|
||||||
emits("select", currentParams.value);
|
emits("select", currentParams.value);
|
||||||
const dataIndex = currentParams.value?.dataIndex;
|
const { dataIndex, seriesIndex } = currentParams.value || {
|
||||||
updateOptions(dataIndex);
|
dataIndex: 0,
|
||||||
|
seriesIndex: 0,
|
||||||
|
};
|
||||||
|
updateOptions({ dataIndex, seriesIndex });
|
||||||
}
|
}
|
||||||
|
|
||||||
function updateOptions(dataIndex?: number) {
|
function updateOptions(params?: { dataIndex: number; seriesIndex: number }) {
|
||||||
const instance = getInstance();
|
const instance = getInstance();
|
||||||
if (!instance) {
|
if (!instance) {
|
||||||
return;
|
return;
|
||||||
@ -167,8 +170,14 @@ function updateOptions(dataIndex?: number) {
|
|||||||
} else {
|
} else {
|
||||||
instance.dispatchAction({
|
instance.dispatchAction({
|
||||||
type: "updateAxisPointer",
|
type: "updateAxisPointer",
|
||||||
dataIndex: dataIndex || props.filters.dataIndex,
|
dataIndex: params ? params.dataIndex : props.filters.dataIndex,
|
||||||
seriesIndex: 0,
|
seriesIndex: params ? params.seriesIndex : 0,
|
||||||
|
});
|
||||||
|
const ids = props.option.series.map((_: unknown, index: number) => index);
|
||||||
|
instance.dispatchAction({
|
||||||
|
type: "highlight",
|
||||||
|
dataIndex: params ? params.dataIndex : props.filters.dataIndex,
|
||||||
|
seriesIndex: ids,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user