fix: apply config

This commit is contained in:
Qiuxia Fan 2022-01-13 12:42:20 +08:00
parent 22ebade7ac
commit 9dc9dd3672
2 changed files with 15 additions and 2 deletions

View File

@ -139,7 +139,19 @@ export const dashboardStore = defineStore({
this.entity = type; this.entity = type;
}, },
setConfigs(param: { [key: string]: unknown }) { setConfigs(param: { [key: string]: unknown }) {
const index = this.layout.findIndex((d: LayoutConfig) => d.i === param.i); const actived = this.activedGridItem.split("-");
const index = this.layout.findIndex(
(d: LayoutConfig) => actived[0] === d.i
);
if (actived.length === 3) {
this.layout[index].children[actived[1]].children[actived[2]] = {
...this.layout[index],
...param,
};
this.selectedGrid = this.layout[index];
return;
}
this.layout[index] = { this.layout[index] = {
...this.layout[index], ...this.layout[index],
...param, ...param,

View File

@ -64,7 +64,8 @@ function handleClick(e: any) {
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.ds-main { .ds-main {
height: calc(100% - 40px); height: calc(100% - 45px);
overflow: auto;
} }
.layout { .layout {