|
@@ -55,20 +55,14 @@
|
|
|
</template>
|
|
|
<a-icon type="question-circle" />
|
|
|
</a-tooltip> -->
|
|
|
- <!-- draggable="true"
|
|
|
- @dragstart="handleDragStart($event, item.groupId)"
|
|
|
- @dragover="handleDragOver($event, item.groupId)"
|
|
|
- @dragenter.prevent.stop="handleDragEnter($event, item.groupId)"
|
|
|
- @dragend="handleDragEnd($event, item.groupId)" -->
|
|
|
</div>
|
|
|
<div class="label-item">
|
|
|
<div class="text-item">规则条件</div>
|
|
|
<div class="required-item"></div>
|
|
|
</div>
|
|
|
- <div class="input-item extraClass" style="min-width:80%" >
|
|
|
+ <div class="input-item extraClass" style="min-width:80%" >
|
|
|
<a-collapse accordion >
|
|
|
- <a-collapse-panel v-for="(item,index) in form.ruleList" :key="index" :header="item.groupName" :style="customStyle"
|
|
|
- >
|
|
|
+ <a-collapse-panel v-for="(item,index) in form.ruleList" :key="index" :header="item.groupName" :style="customStyle">
|
|
|
<span slot="extra">
|
|
|
<a-popconfirm
|
|
|
:title="`确定删除吗?`"
|
|
@@ -315,7 +309,6 @@ export default {
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
- dragging:null,
|
|
|
tabActiveKey:[0],
|
|
|
customStyle:'background: #f9f9fa;border-radius: 4px;margin-bottom:15px;overflow: hidden;border: 1px solid #d9d9d9;',
|
|
|
conditionList:[],
|
|
@@ -390,30 +383,7 @@ export default {
|
|
|
|
|
|
},
|
|
|
methods: {
|
|
|
- handleDragStart(e, item) {
|
|
|
- this.dragging = item
|
|
|
- },
|
|
|
- handleDragEnd(e, item) {
|
|
|
- this.dragging = null
|
|
|
- },
|
|
|
- //首先把div变成可以放置的元素,即重写dragenter/dragover
|
|
|
- handleDragOver(e) {
|
|
|
- e.dataTransfer.dropEffect = 'move' // e.dataTransfer.dropEffect="move";//在dragenter中针对放置目标来设置!
|
|
|
- },
|
|
|
- handleDragEnter(e, item) {
|
|
|
- e.dataTransfer.effectAllowed = 'move' //为需要移动的元素设置dragstart事件
|
|
|
- if (item === this.dragging) {
|
|
|
- return
|
|
|
- }
|
|
|
- const newItems = [...this.form.ruleList]
|
|
|
- console.log(newItems)
|
|
|
- const src = newItems.findIndex(v => v.groupId === this.dragging)
|
|
|
- const dst = newItems.findIndex(v => v.groupId === item)
|
|
|
-
|
|
|
- newItems.splice(dst, 0, ...newItems.splice(src, 1))
|
|
|
-this.form.ruleList = []
|
|
|
- this.form.ruleList = [...newItems]
|
|
|
- },
|
|
|
+
|
|
|
ruleTypeChange(item){
|
|
|
|
|
|
if(item.ruleType=='base'){
|
|
@@ -687,10 +657,10 @@ this.form.ruleList = []
|
|
|
getAction(this.url.ruleCondition,{
|
|
|
dataType:ele.dataType
|
|
|
}).then(result=>{
|
|
|
- // console.log(result)
|
|
|
+ console.log(result)
|
|
|
if(result.success){
|
|
|
ele.conditionList=result.result
|
|
|
- // console.log(this.form);
|
|
|
+ console.log(this.form);
|
|
|
this.form={};
|
|
|
this.form=res.result
|
|
|
}
|