提交 915ccf32 authored 作者: wangjiahao's avatar wangjiahao

feat:增加仪表盘设计组件及设计

上级 1e0ebd8c
...@@ -26,6 +26,7 @@ ...@@ -26,6 +26,7 @@
> >
<slot :name="handle"></slot> <slot :name="handle"></slot>
</div> </div>
<i class="el-icon-circle-close" @click.stop="removeView()"></i>
<slot></slot> <slot></slot>
</div> </div>
</template> </template>
...@@ -68,6 +69,10 @@ export default { ...@@ -68,6 +69,10 @@ export default {
replace: true, replace: true,
name: 'vue-drag-resize-rotate', name: 'vue-drag-resize-rotate',
props: { props: {
viewId: {
type: String,
default: ''
},
className: { className: {
type: String, type: String,
default: 'vdr' default: 'vdr'
...@@ -141,7 +146,7 @@ export default { ...@@ -141,7 +146,7 @@ export default {
type: Boolean, type: Boolean,
default: false default: false
}, },
// 新增 外部传入纵横比 w/h // 新增 外部传入纵横比 w/h
outsideAspectRatio: { outsideAspectRatio: {
type: [Number, String], type: [Number, String],
default: 0 default: 0
...@@ -394,6 +399,11 @@ export default { ...@@ -394,6 +399,11 @@ export default {
}, },
methods: { methods: {
removeView(){
debugger
console.log(this.viewId);
this.$emit('removeView',this.viewId)
},
// 重置边界和鼠标状态 // 重置边界和鼠标状态
resetBoundsAndMouseState() { resetBoundsAndMouseState() {
this.mouseClickPosition = { mouseX: 0, mouseY: 0, x: 0, y: 0, w: 0, h: 0 } this.mouseClickPosition = { mouseX: 0, mouseY: 0, x: 0, y: 0, w: 0, h: 0 }
...@@ -1310,13 +1320,15 @@ export default { ...@@ -1310,13 +1320,15 @@ export default {
} }
}, },
style() { style() {
return { let newStyle ={
transform: `translate(${this.left}px, ${this.top}px) rotate(${this.rotate}deg)`, transform: `translate(${this.left}px, ${this.top}px) rotate(${this.rotate}deg)`,
width: this.computedWidth, width: this.computedWidth,
height: this.computedHeight, height: this.computedHeight,
zIndex: this.zIndex, zIndex: this.zIndex,
...(this.dragging && this.disableUserSelect ? userSelectNone : userSelectAuto) ...(this.dragging && this.disableUserSelect ? userSelectNone : userSelectAuto)
}; };
this.$emit('newStyle', this.viewId,newStyle);
return newStyle;
}, },
// 控制柄显示与否 // 控制柄显示与否
actualHandles() { actualHandles() {
...@@ -1503,4 +1515,11 @@ export default { ...@@ -1503,4 +1515,11 @@ export default {
height: 7px; height: 7px;
background-color: #666; background-color: #666;
} }
.close {
float: right;
padding-top: 8px;
padding-bottom: 8px;
}
</style> </style>
...@@ -19,6 +19,9 @@ import message from '@/metersphere/common/js/message' ...@@ -19,6 +19,9 @@ import message from '@/metersphere/common/js/message'
import { left2RightDrag, bottom2TopDrag, right2LeftDrag } from '@/metersphere/common/js/directive' import { left2RightDrag, bottom2TopDrag, right2LeftDrag } from '@/metersphere/common/js/directive'
import directives from './directive' import directives from './directive'
import './styles/vdrr/common-temp.scss'
import vdrr from './components/vue-drag-resize-rotate' import vdrr from './components/vue-drag-resize-rotate'
Vue.component('vdrr', vdrr) Vue.component('vdrr', vdrr)
......
.vdr {
border: 1px dashed;
}
.vdrr {
border: 1px dashed;
}
差异被折叠。
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论