feat: apply dashboard config

This commit is contained in:
Qiuxia Fan
2022-01-07 11:34:41 +08:00
parent e72368b6fc
commit edda37078a
6 changed files with 75 additions and 23 deletions

View File

@@ -63,7 +63,7 @@ export const dashboardStore = defineStore({
this.showConfig = show;
},
selectWidget(widget: Nullable<LayoutConfig>) {
this.selectedWidget = ConfigData || widget;
this.selectedWidget = ConfigData || widget; //todo
},
setLayer(id: string) {
this.layerId = id;
@@ -71,6 +71,13 @@ export const dashboardStore = defineStore({
setEntity(type: string) {
this.entity = type;
},
setConfigs(param: { [key: string]: unknown }) {
const index = this.layout.findIndex((d: LayoutConfig) => d.i === param.i);
this.layout[index] = {
...this.layout[index],
...param,
};
},
async fetchMetricType(item: string) {
const res: AxiosResponse = await graph
.query("queryTypeOfMetrics")

View File

@@ -25,8 +25,8 @@ export const ConfigData: LayoutConfig = {
queryMetricType: "readMetricsValues",
chart: "Line",
widget: {
title: "Title",
tips: "Tooltip",
title: "Title123",
tips: "Tooltip123",
},
graph: {
showBackground: true,