This commit is contained in:
Qiuxia Fan 2022-03-25 15:08:35 +08:00
parent e19e03d413
commit 5593416257
4 changed files with 7 additions and 2 deletions

View File

@ -22,7 +22,7 @@ export const NewControl = {
i: "0",
type: "Widget",
widget: {
title: "Title",
title: "",
},
graph: {},
standard: {},

View File

@ -164,6 +164,7 @@ export const dashboardStore = defineStore({
}
if (type === "Text") {
newItem.h = 6;
newItem.graph = TextConfig;
}
if (this.layout[idx].children) {
const items = children.map((d: LayoutConfig) => {

View File

@ -121,6 +121,7 @@ import Widget from "./Widget.vue";
import Trace from "./Trace.vue";
import Profile from "./Profile.vue";
import Log from "./Log.vue";
import Text from "./Text.vue";
const props = {
data: {
@ -131,7 +132,7 @@ const props = {
};
export default defineComponent({
name: "Tab",
components: { Topology, Widget, Trace, Profile, Log },
components: { Topology, Widget, Trace, Profile, Log, Text },
props,
setup(props) {
const { t } = useI18n();

View File

@ -59,6 +59,9 @@ export default defineComponent({
function clickGrid(item: LayoutConfig) {
dashboardStore.activeGridItem(item.i);
dashboardStore.selectWidget(item);
if (item.type === "Tab") {
dashboardStore.setActiveTabIndex(0);
}
}
onBeforeUnmount(() => {
dashboardStore.setLayout([]);