|
@@ -108,7 +108,7 @@ export default {
|
|
|
|
|
|
/* 拖拽完成 */
|
|
|
dropOverHandle(b, a, i, e) {
|
|
|
- // console.log(i, a);
|
|
|
+ console.log(b,a,i);
|
|
|
// 被拖拽节点对应的 Node、结束拖拽时最后进入的节点、被拖拽节点的放置位置
|
|
|
const isEDB=b.data.EdbCode?true:false
|
|
|
let list=a.parent.childNodes;
|
|
@@ -117,9 +117,9 @@ export default {
|
|
|
|
|
|
ClassifyId=isEDB?0:b.data.ClassifyId
|
|
|
EdbInfoId=isEDB?b.data.EdbInfoId:0
|
|
|
- ParentClassifyId=a.parent.data.ClassifyId||0
|
|
|
|
|
|
if(i!=='inner'){
|
|
|
+ ParentClassifyId=a.parent.data.ClassifyId||0
|
|
|
list.forEach((item,index)=>{
|
|
|
if(isEDB){
|
|
|
if(item.data.EdbInfoId===b.data.EdbInfoId){
|
|
@@ -154,7 +154,9 @@ export default {
|
|
|
NextClassifyId=nData.EdbCode?0:nData.ClassifyId
|
|
|
NextEdbInfoId=nData.EdbCode?nData.EdbInfoId:0
|
|
|
}
|
|
|
- }
|
|
|
+ }else{
|
|
|
+ ParentClassifyId=a.data.ClassifyId||0
|
|
|
+ }
|
|
|
|
|
|
const params={
|
|
|
ClassifyId,
|
|
@@ -176,15 +178,14 @@ export default {
|
|
|
|
|
|
/* 拖拽覆盖添加背景色 */
|
|
|
dropMouseOver(node1, node2, e) {
|
|
|
- if (
|
|
|
- (node1.level === 2 && node2.level === 1) &&
|
|
|
- (e.target.childNodes[0].className.includes("el-tree-node__content") ||
|
|
|
- e.target.className.includes("el-tree-node__content"))
|
|
|
- ) {
|
|
|
- e.target.childNodes[0].className.includes("el-tree-node__content")
|
|
|
- ? (e.target.childNodes[0].style.backgroundColor = "#409eff")
|
|
|
- : (e.target.style.backgroundColor = "#409eff");
|
|
|
- }
|
|
|
+ // 被拖拽节点对应的 Node、所进入节点对应的 Node、event
|
|
|
+ if((node1.level>=node2.level) && (e.target.childNodes[0].className.includes('el-tree-node__content')
|
|
|
+ || e.target.className.includes('el-tree-node__content'))) {
|
|
|
+ // console.log(e.target.childNodes[0])
|
|
|
+ e.target.childNodes[0].className.includes('el-tree-node__content')
|
|
|
+ ? e.target.childNodes[0].style.backgroundColor = '#409eff'
|
|
|
+ : e.target.style.backgroundColor = '#409eff';
|
|
|
+ }
|
|
|
},
|
|
|
|
|
|
/* 拖拽离开/拖拽完成重置背景色 */
|