提交 ab5155f1 编写于 作者: hudan's avatar hudan

增加数据视图部件批操作工具栏拖拽

上级 28b2f7bf
......@@ -117,6 +117,7 @@
</div>
<el-backtop target=".content-container .app-data-view"></el-backtop>
<#if ctrl.getBatchPSDEToolbar?? && ctrl.getBatchPSDEToolbar()??>
<div class="drag-filed" @mousedown="down">
<row class='dataview-pagination'>
<div v-show="flag" class="batch-toolbar">
<#assign batchToolbar = ctrl.getBatchPSDEToolbar()/>
......@@ -128,6 +129,7 @@
<Icon type="md-code-working" @click="onClick"/>
</div>
</row>
</div>
</#if>
</div>
</#if>
......@@ -293,7 +295,46 @@ import CodeListService from "@/codelist/codelist-service";
}
}
</#if>
/**
* 拖拽元素对象
*
* @type {boolean}
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public dragEle:any;
/**
* 拖拽后位置left
*
* @type {boolean}
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public leftP:any;
/**
* 拖拽后位置top
*
* @type {boolean}
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public topP:any;
/**
* 拖拽标识
*
* @type {boolean}
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public dragflag:boolean=false;
/**
* 为拖拽不是点击
*
* @type {boolean}
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public moveflag:boolean = false;
<#if ctrl.getGroupMode?? && ctrl.getGroupMode() == 'CODELIST'>
/**
......@@ -631,6 +672,8 @@ import CodeListService from "@/codelist/codelist-service";
})
}
/**
* Vue声明周期,组件创建完毕
*
......@@ -638,6 +681,9 @@ import CodeListService from "@/codelist/codelist-service";
*/
public created() {
this.afterCreated();
this.$nextTick(()=>{
this.mouseEvent();
})
}
/**
......@@ -671,6 +717,37 @@ import CodeListService from "@/codelist/codelist-service";
}
}
/**
* 鼠标移动+放下
*
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public mouseEvent(){
this.dragEle = document.getElementsByClassName('drag-filed')[0];
document.onmousemove=(e:any)=>{
if(this.dragflag){
this.dragEle.style.left = (e.clientX - this.leftP) + 'px';
this.dragEle.style.top = (e.clientY - this.topP) + 'px';
this.moveflag = true;
}
}
document.onmouseup=(e:any)=>{
this.dragflag = false;
}
}
/**
* mousedown事件
*
* @param $event
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public down(e:any){
this.leftP = e.clientX - this.dragEle.offsetLeft;
this.topP = e.clientY - this.dragEle.offsetTop;
this.dragflag = true;
}
/**
* 加载更多
*
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册