|
|
@ -153,6 +153,7 @@
|
|
|
|
}"
|
|
|
|
}"
|
|
|
|
@click.self="setOptionsOnClickScreen"
|
|
|
|
@click.self="setOptionsOnClickScreen"
|
|
|
|
>
|
|
|
|
>
|
|
|
|
|
|
|
|
<div v-if="grade" class="bg-grid"></div>
|
|
|
|
<widget
|
|
|
|
<widget
|
|
|
|
ref="widgets"
|
|
|
|
ref="widgets"
|
|
|
|
v-for="(widget, index) in widgets"
|
|
|
|
v-for="(widget, index) in widgets"
|
|
|
@ -164,6 +165,7 @@
|
|
|
|
@onActivated="setOptionsOnClickWidget"
|
|
|
|
@onActivated="setOptionsOnClickWidget"
|
|
|
|
@contextmenu.prevent.native="rightClick($event, index)"
|
|
|
|
@contextmenu.prevent.native="rightClick($event, index)"
|
|
|
|
@mousedown.prevent.native="widgetsClick(index)"
|
|
|
|
@mousedown.prevent.native="widgetsClick(index)"
|
|
|
|
|
|
|
|
@mouseup.prevent.native="widgetsMouseup"
|
|
|
|
/>
|
|
|
|
/>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</vue-ruler-tool>
|
|
|
|
</vue-ruler-tool>
|
|
|
@ -242,6 +244,7 @@ export default {
|
|
|
|
},
|
|
|
|
},
|
|
|
|
data() {
|
|
|
|
data() {
|
|
|
|
return {
|
|
|
|
return {
|
|
|
|
|
|
|
|
grade: false,
|
|
|
|
layerWidget: [],
|
|
|
|
layerWidget: [],
|
|
|
|
widgetTools: widgetTools, // 左侧工具栏的组件图标,将js变量加入到当前作用域
|
|
|
|
widgetTools: widgetTools, // 左侧工具栏的组件图标,将js变量加入到当前作用域
|
|
|
|
widthLeftForTools: 200, // 左侧工具栏宽度
|
|
|
|
widthLeftForTools: 200, // 左侧工具栏宽度
|
|
|
@ -355,6 +358,10 @@ export default {
|
|
|
|
// 如果是新的设计工作台
|
|
|
|
// 如果是新的设计工作台
|
|
|
|
this.initEchartData();
|
|
|
|
this.initEchartData();
|
|
|
|
this.widgets = [];
|
|
|
|
this.widgets = [];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
window.addEventListener("mouseup", () => {
|
|
|
|
|
|
|
|
this.grade = false;
|
|
|
|
|
|
|
|
});
|
|
|
|
},
|
|
|
|
},
|
|
|
|
methods: {
|
|
|
|
methods: {
|
|
|
|
handlerLayerWidget(val) {
|
|
|
|
handlerLayerWidget(val) {
|
|
|
@ -378,8 +385,6 @@ export default {
|
|
|
|
if (code != 200) return;
|
|
|
|
if (code != 200) return;
|
|
|
|
const processData = this.handleInitEchartsData(data);
|
|
|
|
const processData = this.handleInitEchartsData(data);
|
|
|
|
const screenData = this.handleBigScreen(data.dashboard);
|
|
|
|
const screenData = this.handleBigScreen(data.dashboard);
|
|
|
|
console.log(screenData);
|
|
|
|
|
|
|
|
console.log(processData);
|
|
|
|
|
|
|
|
this.widgets = processData;
|
|
|
|
this.widgets = processData;
|
|
|
|
this.dashboard = screenData;
|
|
|
|
this.dashboard = screenData;
|
|
|
|
},
|
|
|
|
},
|
|
|
@ -618,6 +623,10 @@ export default {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
this.setOptionsOnClickWidget(index);
|
|
|
|
this.setOptionsOnClickWidget(index);
|
|
|
|
|
|
|
|
this.grade = true;
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
widgetsMouseup(e) {
|
|
|
|
|
|
|
|
this.grade = false;
|
|
|
|
},
|
|
|
|
},
|
|
|
|
handleMouseDown() {
|
|
|
|
handleMouseDown() {
|
|
|
|
const draggableArr = this.$refs.widgets;
|
|
|
|
const draggableArr = this.$refs.widgets;
|
|
|
@ -888,6 +897,20 @@ export default {
|
|
|
|
margin: 0;
|
|
|
|
margin: 0;
|
|
|
|
padding: 0;
|
|
|
|
padding: 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
.bg-grid {
|
|
|
|
|
|
|
|
position: absolute;
|
|
|
|
|
|
|
|
top: 0;
|
|
|
|
|
|
|
|
left: 0;
|
|
|
|
|
|
|
|
width: 100%;
|
|
|
|
|
|
|
|
height: 100%;
|
|
|
|
|
|
|
|
background-size: 30px 30px, 30px 30px;
|
|
|
|
|
|
|
|
background-image: linear-gradient(
|
|
|
|
|
|
|
|
hsla(0, 0%, 100%, 0.1) 1px,
|
|
|
|
|
|
|
|
transparent 0
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
linear-gradient(90deg, hsla(0, 0%, 100%, 0.1) 1px, transparent 0);
|
|
|
|
|
|
|
|
// z-index: 2;
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|