| | |
| | | card.h = height; |
| | | card.x = x; |
| | | card.y = y; |
| | | this.modularArr.map(item => { |
| | | if (item.id == `chart${this.draggableActived.id}`) { |
| | | item.resize(); |
| | | } |
| | | }) |
| | | } |
| | | return true; |
| | | }); |
| | |
| | | item.y *= clientHeight; |
| | | item.w *= clientWidth; |
| | | item.h *= clientHeight; |
| | | let nowBox = this.$refs[`layout-box${item.id}`]; |
| | | let modular = require(`./charts/${item.type}.vue`).default; |
| | | let modularExtend = Vue.extend(modular); |
| | | let chartModular = new modularExtend().$mount(); |
| | | chartModular.id = `chart${item.id}`; |
| | | let nowBox = this.$refs[`layout-box${item.id}`]; |
| | | if (nowBox[0].children.length == 0) { |
| | | nowBox[0].appendChild(chartModular.$el) |
| | | this.modularArr.push(chartModular); |
| | | } |
| | | if (this.nowlayOut.isremoved) { |
| | | } else { |
| | | nowBox[0].replaceChild(chartModular.$el, nowBox[0].children[0]) |
| | | } |
| | | // if (this.nowlayOut.isremoved) { |
| | | // nowBox[0].replaceChild(chartModular.$el, nowBox[0].children[0]) |
| | | // } |
| | | chartModular.setData(item.setData); |
| | | chartModular.resize(); |
| | | }) |