Commit ec6e26b0 by 陈羽

update: 优化

parent 9ee8a6d8
......@@ -214,24 +214,25 @@ export default {
syncStatus: this.syncStatus,
search: this.search
};
tagList(params).then(res => {
this.total = res.data.result.totalCount;
if (Array.isArray(res.data.result.result) && res.data.result.result.length) {
res.data.result.result.map((el, index) => {
el.expend = false;
el.index = index;
el.check = false;
});
this.tableData = res.data.result.result;
this.loading = false;
this.$nextTick(() => {
this.chengePageToggleSelect();
});
} else {
this.tableData = [];
this.tableData = [];
tagList(params)
.then(res => {
this.total = res.data.result.totalCount;
if (Array.isArray(res.data.result.result) && res.data.result.result.length) {
res.data.result.result.map((el, index) => {
el.expend = false;
el.index = index;
el.check = false;
});
this.tableData = [].concat(res.data.result.result);
this.$nextTick(() => {
this.changePageToggleSelect();
});
}
})
.finally(_ => {
this.loading = false;
}
});
});
},
// 关闭同步接口
closeSync(row) {
......@@ -304,7 +305,7 @@ export default {
setTimeout(() => (this.isShake = false), 300);
},
rowCheckChange(row, column, event) {
if (this.canSync && row.syncFlag === 0) {
if (this.canSync && row.syncFlag === 0 && row.tagItems.length) {
this.$refs.table.toggleRowSelection(row);
row.check = !row.check;
}
......@@ -322,7 +323,7 @@ export default {
);
}
},
chengePageToggleSelect() {
changePageToggleSelect() {
this.cancelIds.forEach((id, index) => {
const item = this.tableData.find(el => el.tagId === id);
if (item) {
......@@ -360,6 +361,9 @@ export default {
let resData = res.data;
if (resData.errorCode == 1) {
this.$message.success('批量同步完成');
this.selectIds = {};
this.tagIds = [];
this.$refs.table.clearSelection();
this.getTableList();
} else {
errMsg.errorMsg(resData);
......@@ -373,6 +377,7 @@ export default {
});
},
clearSlected() {
this.selectIds = {};
this.tagIds = [];
this.$refs.table.clearSelection();
}
......
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