Commit bff70189 authored by chenfenglei's avatar chenfenglei

优化二维码上下位置替换

parent ca92d720
...@@ -148,6 +148,8 @@ ...@@ -148,6 +148,8 @@
size="small"> size="small">
移除 移除
</el-button> </el-button>
<i class="iconfont icon-shangyi" @click="upIndex(scope.$index, list)" v-if="!$store.state.readonly" style="cursor: pointer;color: #409EFF;margin-left:10px;"></i>
<i class="iconfont icon-xiayi" @click="downIndex(scope.$index, list)" v-if="!$store.state.readonly" style="cursor: pointer;color: #409EFF;"></i>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
...@@ -367,6 +369,28 @@ ...@@ -367,6 +369,28 @@
}); });
}) })
}, },
upIndex(index , list){
if(index>0){
var tempOption = list[index - 1];
Vue.set(list, index - 1, list[index]);
Vue.set(list, index, tempOption);
this.$message({
type: 'success',
message: '操作成功!'
});
}
},
downIndex(index , list){
if(index < list.length-1){
var tempOption = list[index + 1];
Vue.set(list, index + 1, list[index]);
Vue.set(list, index, tempOption);
this.$message({
type: 'success',
message: '操作成功!'
});
}
},
} }
} }
</script> </script>
......
...@@ -146,6 +146,7 @@ ...@@ -146,6 +146,7 @@
category_up_id : data.id , category_up_id : data.id ,
category_down_id : item[i-1].id category_down_id : item[i-1].id
}; };
console.log(json)
sortCategoryApi(json).then(res=>{ sortCategoryApi(json).then(res=>{
this.getList() this.getList()
}) })
......
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