Commit 34c2c725 by 无尘

fix: 修改数据维度

parent 3b597fdc
......@@ -4,7 +4,7 @@
* @Author: 无尘
* @Date: 2020-08-27 11:36:51
* @LastEditors: 无尘
* @LastEditTime: 2020-09-07 10:55:18
* @LastEditTime: 2020-09-07 14:50:22
-->
<template>
......@@ -108,7 +108,7 @@ export default {
const that = this;
that.$emit('showTab', '/data-dimension');
that.rowDrop('memberCardData');
that.rowDrop('serviceNumData');
that.rowsDrop('serviceNumData');
if (!!that.brandId) {
that.getMemberCrad();
}
......@@ -131,7 +131,22 @@ export default {
let arr = JSON.parse(JSON.stringify(that[data]));
const currRow = arr.splice(oldIndex, 1)[0];
arr.splice(newIndex, 0, currRow);
that.setSort(arr);
that.setSort(arr, data);
}
});
},
rowsDrop(data) {
const tbody = this.$refs[data].$el.querySelectorAll('.el-table__body-wrapper > table > tbody')[0];
const that = this;
Sortable.create(tbody, {
onEnd({ newIndex, oldIndex }) {
if (newIndex == oldIndex) {
return false;
}
let arr = JSON.parse(JSON.stringify(that[data]));
const currRow = arr.splice(oldIndex, 1)[0];
arr.splice(newIndex, 0, currRow);
that.setSort(arr, data);
}
});
},
......
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