| | |
| | | this.nowlayOut.children.splice(i, 1); |
| | | } |
| | | }) |
| | | let sendData = JSON.parse(JSON.stringify(this.nowlayOut)); |
| | | sendData.children.map((item) => { |
| | | item.x = item.x / clientWidth; |
| | | item.y = item.y / clientHeight; |
| | | item.w = item.w / clientWidth; |
| | | item.h = item.h / clientHeight; |
| | | }) |
| | | this.$emit('removeModular', sendData); |
| | | }, |
| | | // 加载布局数据 |
| | | loadLayout() { |
| | |
| | | <div class="content-warp"> |
| | | <div class="screenWarp" :style="'background-image:url('+screenBg+')'" ref="cover"> |
| | | <screen-title :title="layOut.name" :bgImg="screenTitleBg"></screen-title> |
| | | <setting-modular :layOut="layOut" @onResizstop="onResizstop" @onDragstop="onDragstop" :draggable="true" |
| | | :resizable="true"></setting-modular> |
| | | <setting-modular :layOut="layOut" @onResizstop="onResizstop" @onDragstop="onDragstop" |
| | | @removeModular="removeModular" :draggable="true" :resizable="true"></setting-modular> |
| | | </div> |
| | | </div> |
| | | </div> |
| | |
| | | onDragstop(data) { |
| | | this.layOut = data |
| | | }, |
| | | removeModular(data) { |
| | | this.layOut = data |
| | | }, |
| | | saveLayout() { |
| | | let postData = JSON.parse(JSON.stringify(this.layOut)) |
| | | postData.children.map(item => { |