|
|
@ -78,7 +78,7 @@ const baifang=function (option={}) {
|
|
|
|
if(_index===0){
|
|
|
|
if(_index===0){
|
|
|
|
_index=this.getAttr('index')
|
|
|
|
_index=this.getAttr('index')
|
|
|
|
}
|
|
|
|
}
|
|
|
|
this.zIndex(4)
|
|
|
|
this.zIndex(slList.length-1)
|
|
|
|
const {y:thisY}=this.absolutePosition()
|
|
|
|
const {y:thisY}=this.absolutePosition()
|
|
|
|
|
|
|
|
|
|
|
|
const dir=thisY-this.startPos.y>0?-40:40
|
|
|
|
const dir=thisY-this.startPos.y>0?-40:40
|
|
|
@ -95,6 +95,7 @@ const baifang=function (option={}) {
|
|
|
|
if (thisY>=thatY&&thisY<=thatY+40&&moveDir!==dir){
|
|
|
|
if (thisY>=thatY&&thisY<=thatY+40&&moveDir!==dir){
|
|
|
|
child.setAttr('moveDir',dir);
|
|
|
|
child.setAttr('moveDir',dir);
|
|
|
|
_index+=dir>0?1:-1
|
|
|
|
_index+=dir>0?1:-1
|
|
|
|
|
|
|
|
|
|
|
|
child.move({
|
|
|
|
child.move({
|
|
|
|
y:dir
|
|
|
|
y:dir
|
|
|
|
})
|
|
|
|
})
|
|
|
@ -102,7 +103,7 @@ const baifang=function (option={}) {
|
|
|
|
if (movedIndex===-1){
|
|
|
|
if (movedIndex===-1){
|
|
|
|
movedList.push(child)
|
|
|
|
movedList.push(child)
|
|
|
|
}else {
|
|
|
|
}else {
|
|
|
|
slList.splice(movedIndex, 1);
|
|
|
|
movedList.splice(movedIndex, 1);
|
|
|
|
movedList.push(child)
|
|
|
|
movedList.push(child)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
this.startPos={
|
|
|
|
this.startPos={
|
|
|
@ -128,11 +129,11 @@ const baifang=function (option={}) {
|
|
|
|
duo:item.dwId,
|
|
|
|
duo:item.dwId,
|
|
|
|
movedList:mList
|
|
|
|
movedList:mList
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
console.log(_index)
|
|
|
|
// const element = slList.splice(index-1, 1)[0];
|
|
|
|
// const element = slList.splice(index-1, 1)[0];
|
|
|
|
// slList.splice(_index-1, 0, element);
|
|
|
|
// slList.splice(_index-1, 0, element);
|
|
|
|
// this.setAttr('index',_index)
|
|
|
|
// this.setAttr('index',_index)
|
|
|
|
// _index=0
|
|
|
|
// _index=0
|
|
|
|
// handler(slList)
|
|
|
|
|
|
|
|
daoduo(data).then(res=>{
|
|
|
|
daoduo(data).then(res=>{
|
|
|
|
if (res.success){
|
|
|
|
if (res.success){
|
|
|
|
const element = slList.splice(index-1, 1)[0];
|
|
|
|
const element = slList.splice(index-1, 1)[0];
|
|
|
@ -208,6 +209,7 @@ const baifang=function (option={}) {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function handler(slList){
|
|
|
|
function handler(slList){
|
|
|
|
|
|
|
|
console.log(slList)
|
|
|
|
slGroup.destroyChildren()
|
|
|
|
slGroup.destroyChildren()
|
|
|
|
for (let i = 1; i <= slList.length; i++) {
|
|
|
|
for (let i = 1; i <= slList.length; i++) {
|
|
|
|
const item=slList[i-1]
|
|
|
|
const item=slList[i-1]
|
|
|
|