Commit 48139478 authored by zhengke's avatar zhengke

修改

parent 96074263
...@@ -177,10 +177,7 @@ ...@@ -177,10 +177,7 @@
</el-select> </el-select>
<div class="temp-list-wrap"> <div class="temp-list-wrap">
<div v-for="(subItem,subIndex) in detailsList" class="temp-list-item" :key="subIndex" <div v-for="(subItem,subIndex) in detailsList" class="temp-list-item" :key="subIndex"
draggable="true" @dragstart="dragLeftStart($event,subItem)" @dragover="onDragover($event,subItem)"> draggable="true" @dragstart="dragLeftStart($event,subItem)">
<!-- <div v-for="(subItem,subIndex) in detailsList" class="temp-list-item" :key="subIndex"
draggable="true" @dragstart="dragLeftStart($event,subItem)"
@click="AddData(subItem)"> -->
<img v-if="subItem.TemplateData&&subItem.TemplateData.CoverImg" :src="subItem.TemplateData.CoverImg" <img v-if="subItem.TemplateData&&subItem.TemplateData.CoverImg" :src="subItem.TemplateData.CoverImg"
:alt="subItem.SubTemplateName" /> :alt="subItem.SubTemplateName" />
<div class="temp-font">{{subItem.SubTemplateName}}</div> <div class="temp-font">{{subItem.SubTemplateName}}</div>
...@@ -189,13 +186,9 @@ ...@@ -189,13 +186,9 @@
</div> </div>
<div class="WebSite_right"> <div class="WebSite_right">
<div class="WebSite_right_preview"> <div class="WebSite_right_preview">
<!-- <div v-for="(item,index) in dataList" draggable="true" @dragstart="handleDragStart($event, item)" <div v-for="(item,index) in dataList" draggable="true" @drop="drop($event,index)" @dragstart="handleDragStart($event, item)"
@dragover.prevent="handleDragOver($event, item)" @dragenter="handleDragEnter($event, item)"
@dragend="handleDragEnd($event, item)" :key="index"> -->
<div v-for="(item,index) in dataList" draggable="true" @drop="drop($event,index)" @dragover="allowDrop($event)" @dragstart="handleDragStart($event, item)"
@dragover.prevent="handleDragOver($event, item)" @dragenter="handleDragEnter($event, item)" @dragover.prevent="handleDragOver($event, item)" @dragenter="handleDragEnter($event, item)"
@dragend="handleDragEnd($event, item)" :key="index"> @dragend="handleDragEnd($event, item)" :key="index">
<div class="diy-component-preview"> <div class="diy-component-preview">
<div class="WebSite_item"> <div class="WebSite_item">
<div class="ui-sortable-handle"> <div class="ui-sortable-handle">
...@@ -340,6 +333,7 @@ ...@@ -340,6 +333,7 @@
otherdialog otherdialog
}, },
methods: { methods: {
//右边上下拖动开始
handleDragStart(e, item) { handleDragStart(e, item) {
if(this.isDraggable){ if(this.isDraggable){
this.dragging = item; this.dragging = item;
...@@ -369,6 +363,7 @@ ...@@ -369,6 +363,7 @@
this.dataList = newItems this.dataList = newItems
} }
}, },
//右边上下拖动结束
//显示弹窗 //显示弹窗
showDialog(item) { showDialog(item) {
this.isShowDialog = true; this.isShowDialog = true;
...@@ -397,7 +392,7 @@ ...@@ -397,7 +392,7 @@
}; };
this.dataList.push(obj); this.dataList.push(obj);
}, },
//从左拖动到右边开始
dragLeftStart(ev,item){ dragLeftStart(ev,item){
this.isDraggable=false; this.isDraggable=false;
var obj = { var obj = {
...@@ -407,12 +402,7 @@ ...@@ -407,12 +402,7 @@
}; };
this.dragObj=obj; this.dragObj=obj;
}, },
onDragover(ev){ //从左拖动到右边结束
ev.stopPropagation();
},
allowDrop(ev){
ev.preventDefault();
},
drop(ev,index){ drop(ev,index){
if(!this.isDraggable){ if(!this.isDraggable){
this.dataList.splice(index,0,this.dragObj); this.dataList.splice(index,0,this.dragObj);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment