fix: edit widget config

This commit is contained in:
Qiuxia Fan
2022-01-11 20:16:33 +08:00
parent 015416d31d
commit 6189378f28
11 changed files with 91 additions and 86 deletions

View File

@@ -32,11 +32,7 @@ limitations under the License. -->
@click="clickGrid(item)"
:class="{ active: dashboardStore.activedGridItem === item.i }"
>
<component
:is="item.type"
:data="item"
:active="dashboardStore.activedGridItem === item.i"
/>
<component :is="item.type" :data="item" />
</grid-item>
</grid-layout>
</template>
@@ -46,6 +42,7 @@ import { useDashboardStore } from "@/store/modules/dashboard";
import { LayoutConfig } from "@/types/dashboard";
import Widget from "../controls/Widget.vue";
import Tab from "../controls/Tab.vue";
export default defineComponent({
name: "Layout",
components: { Widget, Tab },

View File

@@ -79,7 +79,6 @@ limitations under the License. -->
<script lang="ts" setup>
import { reactive } from "vue";
import { useRoute } from "vue-router";
import { ElTooltip, ElCascader } from "element-plus";
import { useDashboardStore } from "@/store/modules/dashboard";
import { Options, SelectOpts, EntityType, ToolIcons } from "../data";
@@ -113,17 +112,19 @@ function changeService(val: { value: string; label: string }) {
function clickIcons(t: { id: string; content: string; name: string }) {
switch (t.id) {
case "addWidget":
dashboardStore.addWidget();
dashboardStore.addControl("Widget");
break;
case "addTab":
dashboardStore.addTab();
dashboardStore.addControl("Tab");
break;
case "addImage":
dashboardStore.addWidget();
dashboardStore.addControl("Image");
break;
case "settings":
dashboardStore.setConfigPanel(true);
break;
default:
dashboardStore.addControl("Widget");
}
}
</script>