This commit is contained in:
Fine 2024-10-17 19:07:11 +08:00
parent 4d09ae6bd0
commit d2a17bbfae
6 changed files with 16 additions and 16 deletions

View File

@ -386,6 +386,6 @@ const msg = {
tabExpressions: "Tab Expressions",
hierarchyNodeMetrics: "Metrics for Hierarchy Graph Node",
hierarchyNodeDashboard: "As dashboard for Hierarchy Graph Node",
contentDecorations: "Content Decorations",
valueMappings: "Value Mappings",
};
export default msg;

View File

@ -386,6 +386,6 @@ const msg = {
tabExpressions: "Tab Expressions",
hierarchyNodeMetrics: "Metrics for Hierarchy Graph Node",
hierarchyNodeDashboard: "As dashboard for Hierarchy Graph Node",
contentDecorations: "Content Decorations",
valueMappings: "Value Mappings",
};
export default msg;

View File

@ -384,6 +384,6 @@ const msg = {
tabExpressions: "Tab表达式",
hierarchyNodeMetrics: "层次图节点的指标",
hierarchyNodeDashboard: "作为层次图节点的dashboard",
contentDecorations: "内容装饰",
valueMappings: "值映射",
};
export default msg;

View File

@ -14,8 +14,8 @@ See the License for the specific language governing permissions and
limitations under the License. -->
<template>
<div>
<span class="label">{{ t("contentDecorations") }}</span>
<content-decorations />
<span class="label">{{ t("valueMappings") }}</span>
<value-mappings />
</div>
<div>
<span class="label">{{ t("fontSize") }}</span>
@ -39,7 +39,7 @@ limitations under the License. -->
import { ref } from "vue";
import { useI18n } from "vue-i18n";
import { useDashboardStore } from "@/store/modules/dashboard";
import ContentDecorations from "./components/ContentDecorations.vue";
import ValueMappings from "./components/ValueMappings.vue";
const { t } = useI18n();
const dashboardStore = useDashboardStore();

View File

@ -14,8 +14,8 @@ See the License for the specific language governing permissions and
limitations under the License. -->
<template>
<div>
<span class="label">{{ t("contentDecorations") }}</span>
<content-decorations />
<span class="label">{{ t("valueMappings") }}</span>
<value-mappings />
</div>
<div class="item">
<span class="label">{{ t("showValues") }}</span>
@ -41,7 +41,7 @@ limitations under the License. -->
import { ref } from "vue";
import { useI18n } from "vue-i18n";
import { useDashboardStore } from "@/store/modules/dashboard";
import ContentDecorations from "./components/ContentDecorations.vue";
import ValueMappings from "./components/ValueMappings.vue";
const { t } = useI18n();
const dashboardStore = useDashboardStore();

View File

@ -39,8 +39,8 @@ limitations under the License. -->
const dashboardStore = useDashboardStore();
const graph = dashboardStore.selectedGrid.graph;
const decorations = ref<{ [key: string]: string }>(graph?.decorations || {});
const keys = ref<string[]>(graph.decorations ? Object.keys(decorations.value) : [""]);
const decorations = ref<{ [key: string]: string }>(graph?.valueMappings || {});
const keys = ref<string[]>(graph.valueMappings ? Object.keys(decorations.value) : [""]);
function changeKeys(event: any, index: number) {
const params = event.target.textContent || "";
@ -50,12 +50,12 @@ limitations under the License. -->
}
delete decorations.value[list[index]];
keys.value = Object.keys(decorations.value);
updateConfig({ decorations: decorations.value });
updateConfig();
}
function changeValues(event: any, key: string) {
decorations.value[key] = event.target.textContent || "";
updateConfig({ decorations: decorations.value });
updateConfig();
}
function addDecoration() {
@ -68,13 +68,13 @@ limitations under the License. -->
}
delete decorations.value[keys.value[index]];
keys.value.splice(index, 1);
updateConfig({ decorations: decorations.value });
updateConfig();
}
function updateConfig(param: { [key: string]: unknown }) {
function updateConfig() {
const graph = {
...dashboardStore.selectedGrid.graph,
...param,
valueMappings: decorations.value,
};
dashboardStore.selectWidget({ ...dashboardStore.selectedGrid, graph });
}