diff --git a/src/main.js b/src/main.js index b22ffd1..38f4416 100644 --- a/src/main.js +++ b/src/main.js @@ -97,7 +97,7 @@ Object.keys(filters).forEach(key => { }) Vue.use(new VueSocketIO({ - debug: true, + debug: false, connection: process.env.VUE_APP_WEBSOCKET, // options: { autoConnect:false,path: "",transports: ['websocket', 'xhr-polling', 'jsonp-polling'], } //Optional options })) diff --git a/src/views/zyjhzx/sliao/comps/baifang.js b/src/views/zyjhzx/sliao/comps/baifang.js index c05053b..7f4b347 100644 --- a/src/views/zyjhzx/sliao/comps/baifang.js +++ b/src/views/zyjhzx/sliao/comps/baifang.js @@ -78,7 +78,7 @@ const baifang=function (option={}) { if(_index===0){ _index=this.getAttr('index') } - this.zIndex(4) + this.zIndex(slList.length-1) const {y:thisY}=this.absolutePosition() 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){ child.setAttr('moveDir',dir); _index+=dir>0?1:-1 + child.move({ y:dir }) @@ -102,7 +103,7 @@ const baifang=function (option={}) { if (movedIndex===-1){ movedList.push(child) }else { - slList.splice(movedIndex, 1); + movedList.splice(movedIndex, 1); movedList.push(child) } this.startPos={ @@ -128,11 +129,11 @@ const baifang=function (option={}) { duo:item.dwId, movedList:mList } + console.log(_index) // const element = slList.splice(index-1, 1)[0]; // slList.splice(_index-1, 0, element); // this.setAttr('index',_index) // _index=0 - // handler(slList) daoduo(data).then(res=>{ if (res.success){ const element = slList.splice(index-1, 1)[0]; @@ -208,6 +209,7 @@ const baifang=function (option={}) { } function handler(slList){ + console.log(slList) slGroup.destroyChildren() for (let i = 1; i <= slList.length; i++) { const item=slList[i-1] diff --git a/src/views/zyjhzx/sliao/comps/liliao.js b/src/views/zyjhzx/sliao/comps/liliao.js index 99424a4..83fdc66 100644 --- a/src/views/zyjhzx/sliao/comps/liliao.js +++ b/src/views/zyjhzx/sliao/comps/liliao.js @@ -1,5 +1,7 @@ import Konva from "konva"; +let selectIndex=null + const liliao=function (width,height,dw,callback) { const _width=width*0.4,_height=height*0.715 @@ -54,10 +56,6 @@ const liliao=function (width,height,dw,callback) { let selectedShape=null; - const getSelectedShape=function (){ - return selectedShape; - } - const duowei=function (index,item){ const alignSize=3 const width=((_width-60)/alignSize),height=208 @@ -80,6 +78,7 @@ const liliao=function (width,height,dw,callback) { selectedShape=selectShape selectedShape.show() currentDw=item + selectIndex=index callback(index,dw[index]) }) @@ -116,6 +115,9 @@ const liliao=function (width,height,dw,callback) { group.add(shape) shape.zIndex(0) setSelectShape(shape) + if (selectIndex===index){ + shape.show() + } } const text=new Konva.Text({ @@ -135,7 +137,7 @@ const liliao=function (width,height,dw,callback) { } return { - container,duowei,getCurrentDw,getSelectedShape + container,duowei,getCurrentDw } } diff --git a/src/views/zyjhzx/sliao/index.vue b/src/views/zyjhzx/sliao/index.vue index a1b7a74..19c94dc 100644 --- a/src/views/zyjhzx/sliao/index.vue +++ b/src/views/zyjhzx/sliao/index.vue @@ -36,7 +36,6 @@ export default { sljhGroup:null, drawBaiFang:null, ycldwGroup:null, - getSelectedShape:null, canSl:false, workerGroup:null, getCurrentWorker:null, @@ -498,9 +497,8 @@ export default { this.ycldwGroup.destroyChildren() } this.dw=res.data - const {container,getCurrentDw,getSelectedShape}= liliao(this.width,this.height,this.dw,this.initDwInfo) + const {container,getCurrentDw}= liliao(this.width,this.height,this.dw,this.initDwInfo) const group=container() - this.getSelectedShape=getSelectedShape this.ycldwGroup=group this.layer.add(group) }) @@ -541,7 +539,7 @@ export default { const {group}=initSearch() this.layer.add(group) - this.search(this.$refs.sliaoSearch.getQueryParam()) + //this.search(this.$refs.sliaoSearch.getQueryParam()) const {layer:sljhLayer,group:sljhGroup}=sljh(this.width,this.height) this.sljhGroup=sljhGroup