feat: resize events to rerender charts

This commit is contained in:
Qiuxia Fan
2022-01-11 14:32:52 +08:00
parent 4a6ac51b7a
commit d4dedecd1b
5 changed files with 64 additions and 7 deletions

View File

@@ -32,7 +32,7 @@ limitations under the License. -->
</div>
</el-popover>
</div>
<div class="body" :style="{ height: '200px', width: '400px' }">
<div class="body">
<component
:is="data.graph.type"
:intervalTime="appStoreWithOut.intervalTime"
@@ -48,10 +48,9 @@ import { LayoutConfig } from "@/types/dashboard";
import { useDashboardStore } from "@/store/modules/dashboard";
import { useAppStoreWithOut } from "@/store/modules/app";
import graphs from "../graphs";
import { ElMessage } from "element-plus";
import { ElMessage, ElPopover } from "element-plus";
import Loading from "@/utils/loading";
import { useI18n } from "vue-i18n";
import { ElPopover } from "element-plus";
const props = {
data: {
@@ -121,6 +120,7 @@ export default defineComponent({
<style lang="scss" scoped>
.widget {
font-size: 12px;
height: 100%;
}
.header {
@@ -149,8 +149,8 @@ export default defineComponent({
}
.body {
padding: 5px;
height: 200px;
padding: 5px 10px;
width: 100%;
height: calc(100% - 30px);
}
</style>

View File

@@ -30,6 +30,7 @@ limitations under the License. -->
:i="item.i"
:key="item.i"
@click="clickGrid(item)"
@resized="resizedEvent"
:class="{ active: dashboardStore.activedGridItem === item.i }"
>
<component
@@ -57,10 +58,14 @@ export default defineComponent({
function clickGrid(item: LayoutConfig) {
dashboardStore.activeGridItem(item.i);
}
function resizedEvent() {
console.log("test");
}
return {
dashboardStore,
layoutUpdatedEvent,
clickGrid,
resizedEvent,
};
},
});