提交 dc7bbb8e 编写于 作者: M mindspore-ci-bot 提交者: Gitee

!526 Traceability page, full data and sort button violent click event code processing optimization

Merge pull request !526 from 秦君艳/databutton
...@@ -338,6 +338,9 @@ import Echarts from 'echarts'; ...@@ -338,6 +338,9 @@ import Echarts from 'echarts';
export default { export default {
data() { data() {
return { return {
tableSortTimer: null,
showAllTimer: null,
unhideTimer: null,
loading: true, loading: true,
errorData: true, errorData: true,
tagDialogShow: false, tagDialogShow: false,
...@@ -363,6 +366,7 @@ export default { ...@@ -363,6 +366,7 @@ export default {
recordsNumber: 0, recordsNumber: 0,
// Number of displayed records. // Number of displayed records.
showNumber: 0, showNumber: 0,
delayTime: 500,
selectArrayValue: [], selectArrayValue: [],
customizedColumnOptions: [], customizedColumnOptions: [],
// Set the type of customized // Set the type of customized
...@@ -852,6 +856,11 @@ export default { ...@@ -852,6 +856,11 @@ export default {
* Unhide * Unhide
*/ */
unhideRecords() { unhideRecords() {
if (this.unhideTimer) {
clearTimeout(this.unhideTimer);
this.unhideTimer = null;
}
this.unhideTimer = setTimeout(() => {
this.showEchartPic = true; this.showEchartPic = true;
this.$refs.table.clearSelection(); this.$refs.table.clearSelection();
if (this.parallelEchart) { if (this.parallelEchart) {
...@@ -883,6 +892,7 @@ export default { ...@@ -883,6 +892,7 @@ export default {
this.tableFilter, this.tableFilter,
); );
this.queryLineagesData(params); this.queryLineagesData(params);
}, this.delayTime);
}, },
/** /**
* Input search filtering in the select module * Input search filtering in the select module
...@@ -1579,6 +1589,11 @@ export default { ...@@ -1579,6 +1589,11 @@ export default {
*/ */
echartShowAllData() { echartShowAllData() {
// The first page is displayed. // The first page is displayed.
if (this.showAllTimer) {
clearTimeout(this.showAllTimer);
this.showAllTimer = null;
}
this.showAllTimer = setTimeout(() => {
this.initOver = false; this.initOver = false;
this.echartNoData = false; this.echartNoData = false;
this.showEchartPic = true; this.showEchartPic = true;
...@@ -1595,6 +1610,7 @@ export default { ...@@ -1595,6 +1610,7 @@ export default {
} }
this.$refs.table.clearSelection(); this.$refs.table.clearSelection();
this.init(); this.init();
}, this.delayTime);
}, },
/** /**
...@@ -1649,6 +1665,11 @@ export default { ...@@ -1649,6 +1665,11 @@ export default {
* @param {Object} data * @param {Object} data
*/ */
tableSortChange(data) { tableSortChange(data) {
if (this.tableSortTimer) {
clearTimeout(this.tableSortTimer);
this.tableSortTimer = null;
}
this.tableSortTimer = setTimeout(() => {
this.sortInfo.sorted_name = data.prop; this.sortInfo.sorted_name = data.prop;
this.sortInfo.sorted_type = data.order; this.sortInfo.sorted_type = data.order;
const params = {}; const params = {};
...@@ -1668,6 +1689,7 @@ export default { ...@@ -1668,6 +1689,7 @@ export default {
} }
params.body = Object.assign({}, tempParam, this.tableFilter); params.body = Object.assign({}, tempParam, this.tableFilter);
this.queryLineagesData(params); this.queryLineagesData(params);
}, this.delayTime);
}, },
/** /**
...@@ -1946,6 +1968,9 @@ export default { ...@@ -1946,6 +1968,9 @@ export default {
* Destroy the page * Destroy the page
*/ */
destroyed() { destroyed() {
this.tableSortTimer = null;
this.showAllTimer = null;
this.unhideTimer = null;
if (this.dataCheckedSummary && this.dataCheckedSummary.length) { if (this.dataCheckedSummary && this.dataCheckedSummary.length) {
const summaryDirList = []; const summaryDirList = [];
this.dataCheckedSummary.forEach((item) => { this.dataCheckedSummary.forEach((item) => {
......
...@@ -365,6 +365,8 @@ export default { ...@@ -365,6 +365,8 @@ export default {
watch: {}, watch: {},
data() { data() {
return { return {
sortChangeTimer: null,
unhideRecordsTimer: null,
tagDialogShow: false, tagDialogShow: false,
errorData: true, errorData: true,
tagScope: {}, tagScope: {},
...@@ -375,6 +377,7 @@ export default { ...@@ -375,6 +377,7 @@ export default {
// Number of data records returned by the interface. // Number of data records returned by the interface.
recordsNumber: 0, recordsNumber: 0,
showNumber: 0, showNumber: 0,
delayTime: 500,
showEchartPic: true, showEchartPic: true,
hideRecord: false, hideRecord: false,
hidenDirChecked: [], hidenDirChecked: [],
...@@ -1430,6 +1433,11 @@ export default { ...@@ -1430,6 +1433,11 @@ export default {
* Unhide * Unhide
*/ */
unhideRecords() { unhideRecords() {
if (this.unhideRecordsTimer) {
clearTimeout(this.unhideRecordsTimer);
this.unhideRecordsTimer = null;
}
this.unhideRecordsTimer = setTimeout(() => {
this.showEchartPic = true; this.showEchartPic = true;
this.$refs.table.clearSelection(); this.$refs.table.clearSelection();
this.$store.commit('setHidenDirChecked', []); this.$store.commit('setHidenDirChecked', []);
...@@ -1482,6 +1490,7 @@ export default { ...@@ -1482,6 +1490,7 @@ export default {
this.errorData = true; this.errorData = true;
}, },
); );
}, this.delayTime);
}, },
/** /**
...@@ -1489,6 +1498,11 @@ export default { ...@@ -1489,6 +1498,11 @@ export default {
* @param {Object} column current column * @param {Object} column current column
*/ */
sortChange(column) { sortChange(column) {
if (this.sortChangeTimer) {
clearTimeout(this.sortChangeTimer);
this.sortChangeTimer = null;
}
this.sortChangeTimer = setTimeout(() => {
this.sortInfo.sorted_name = column.prop; this.sortInfo.sorted_name = column.prop;
this.sortInfo.sorted_type = column.order; this.sortInfo.sorted_type = column.order;
this.recordsNumber = 0; this.recordsNumber = 0;
...@@ -1539,6 +1553,7 @@ export default { ...@@ -1539,6 +1553,7 @@ export default {
.catch(() => { .catch(() => {
this.errorData = true; this.errorData = true;
}); });
}, this.delayTime);
}, },
/** /**
...@@ -1986,6 +2001,8 @@ export default { ...@@ -1986,6 +2001,8 @@ export default {
* Destroy the page * Destroy the page
*/ */
destroyed() { destroyed() {
this.sortChangeTimer = null;
this.unhideRecordsTimer = null;
if (this.checkedSummary.length) { if (this.checkedSummary.length) {
const tempList = []; const tempList = [];
this.checkedSummary.forEach((item) => { this.checkedSummary.forEach((item) => {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册