refactor: mstable 代码优化

This commit is contained in:
chenjianxing 2021-09-23 18:33:12 +08:00 committed by jianxing
parent c2bcffa1e9
commit 7d05653ace
15 changed files with 91 additions and 181 deletions

View File

@ -18,6 +18,8 @@
operator-width="200" operator-width="200"
:enable-order-drag="enableOrderDrag" :enable-order-drag="enableOrderDrag"
row-key="id" row-key="id"
:row-order-group-id="condition.projectId"
:row-order-func="editApiScenarioCaseOrder"
@refresh="search(projectId)" @refresh="search(projectId)"
@callBackSelectAll="callBackSelectAll" @callBackSelectAll="callBackSelectAll"
@callBackSelect="callBackSelect" @callBackSelect="callBackSelect"
@ -244,7 +246,7 @@ import {downloadFile, getCurrentProjectID, getUUID, strMapToObj} from "@/common/
import {API_SCENARIO_CONFIGS} from "@/business/components/common/components/search/search-components"; import {API_SCENARIO_CONFIGS} from "@/business/components/common/components/search/search-components";
import {API_SCENARIO_LIST} from "../../../../../common/js/constants"; import {API_SCENARIO_LIST} from "../../../../../common/js/constants";
import {getCustomTableHeader, getCustomTableWidth, getLastTableSortField, handleRowDrop} from "@/common/js/tableUtils"; import {getCustomTableHeader, getCustomTableWidth, getLastTableSortField} from "@/common/js/tableUtils";
import {API_SCENARIO_FILTERS} from "@/common/js/table-constants"; import {API_SCENARIO_FILTERS} from "@/common/js/table-constants";
import {scenario} from "@/business/components/track/plan/event-bus"; import {scenario} from "@/business/components/track/plan/event-bus";
import MsTable from "@/business/components/common/components/table/MsTable"; import MsTable from "@/business/components/common/components/table/MsTable";
@ -552,6 +554,9 @@ export default {
isNotRunning() { isNotRunning() {
return "Running" !== this.report.status; return "Running" !== this.report.status;
}, },
editApiScenarioCaseOrder() {
return editApiScenarioCaseOrder;
}
}, },
methods: { methods: {
getProjectName() { getProjectName() {
@ -618,20 +623,6 @@ export default {
item.tags = JSON.parse(item.tags); item.tags = JSON.parse(item.tags);
} }
}); });
this.$nextTick(() => {
handleRowDrop(this.tableData, (param) => {
param.groupId = this.condition.projectId;
editApiScenarioCaseOrder(param);
});
if (this.$refs.scenarioTable) {
this.$refs.scenarioTable.clear();
this.$refs.scenarioTable.doLayout();
}
});
this.$emit('getTrashCase'); this.$emit('getTrashCase');
}); });
} }

View File

@ -283,13 +283,6 @@
} }
}); });
this.genProtocalFilter(this.condition.protocol); this.genProtocalFilter(this.condition.protocol);
this.$nextTick(function () {
if (this.$refs.apitable) {
this.$refs.apitable.doLayout();
this.$refs.apitable.checkTableRowIsSelect();
this.$refs.apitable.clear();
}
});
}); });
}, },

View File

@ -221,13 +221,6 @@ export default {
item.tags = JSON.parse(item.tags); item.tags = JSON.parse(item.tags);
} }
}); });
this.$nextTick(function () {
if (this.$refs.table) {
this.$refs.table.doLayout();
this.$refs.table.checkTableRowIsSelect();
this.$refs.table.clear();
}
});
}); });
}, },
clear() { clear() {

View File

@ -23,6 +23,8 @@
:fields.sync="fields" :fields.sync="fields"
:field-key="tableHeaderKey" :field-key="tableHeaderKey"
:remember-order="true" :remember-order="true"
:row-order-group-id="condition.projectId"
:row-order-func="editApiTestCaseOrder"
:enable-order-drag="enableOrderDrag" :enable-order-drag="enableOrderDrag"
row-key="id" row-key="id"
operator-width="190px" operator-width="190px"
@ -225,7 +227,6 @@ import {
getCustomTableHeader, getCustomTableHeader,
getCustomTableWidth, getCustomTableWidth,
getLastTableSortField, getLastTableSortField,
handleRowDrop
} from "@/common/js/tableUtils"; } from "@/common/js/tableUtils";
import {API_CASE_LIST} from "@/common/js/constants"; import {API_CASE_LIST} from "@/common/js/constants";
import HeaderLabelOperate from "@/business/components/common/head/HeaderLabelOperate"; import HeaderLabelOperate from "@/business/components/common/head/HeaderLabelOperate";
@ -453,6 +454,9 @@ export default {
}, },
selectRows() { selectRows() {
return this.$refs.caseTable.getSelectRows(); return this.$refs.caseTable.getSelectRows();
},
editApiTestCaseOrder() {
return editApiTestCaseOrder;
} }
}, },
methods: { methods: {
@ -586,17 +590,6 @@ export default {
isNext = true; isNext = true;
} }
}); });
this.$nextTick(() => {
if (this.$refs.caseTable) {
this.$refs.caseTable.clear();
}
handleRowDrop(this.tableData, (param) => {
param.groupId = this.condition.projectId;
editApiTestCaseOrder(param);
});
})
}); });
} }
}, },

View File

@ -15,6 +15,8 @@
:remember-order="true" :remember-order="true"
@refresh="initTable" @refresh="initTable"
:fields.sync="fields" :fields.sync="fields"
:row-order-func="editApiDefinitionOrder"
:row-order-group-id="condition.projectId"
:table-is-loading="this.result.loading" :table-is-loading="this.result.loading"
:field-key="tableHeaderKey" :field-key="tableHeaderKey"
:enable-order-drag="enableOrderDrag" :enable-order-drag="enableOrderDrag"
@ -208,12 +210,10 @@ import MsTipButton from "@/business/components/common/components/MsTipButton";
import CaseBatchMove from "@/business/components/api/definition/components/basis/BatchMove"; import CaseBatchMove from "@/business/components/api/definition/components/basis/BatchMove";
import { import {
initCondition, initCondition,
getCustomTableHeader, getCustomTableWidth, buildBatchParam, checkTableRowIsSelected, getCustomTableHeader, getCustomTableWidth, buildBatchParam, getLastTableSortField
saveLastTableSortField, getLastTableSortField, handleRowDrop
} from "@/common/js/tableUtils"; } from "@/common/js/tableUtils";
import HeaderLabelOperate from "@/business/components/common/head/HeaderLabelOperate"; import HeaderLabelOperate from "@/business/components/common/head/HeaderLabelOperate";
import {Body} from "@/business/components/api/definition/model/ApiTestModel"; import {Body} from "@/business/components/api/definition/model/ApiTestModel";
import {buildNodePath} from "@/business/components/api/definition/model/NodeTree";
import {editApiDefinitionOrder} from "@/network/api"; import {editApiDefinitionOrder} from "@/network/api";
@ -420,6 +420,9 @@ export default {
} else { } else {
return this.$t('api_test.definition.api_type'); return this.$t('api_test.definition.api_type');
} }
},
editApiDefinitionOrder() {
return editApiDefinitionOrder;
} }
}, },
created: function () { created: function () {
@ -474,7 +477,7 @@ export default {
initCondition(this.condition, false); initCondition(this.condition, false);
this.closeCaseModel(); this.closeCaseModel();
this.initTable(); this.initTable();
} },
}, },
methods: { methods: {
getProjectName() { getProjectName() {
@ -548,18 +551,6 @@ export default {
item.tags = JSON.parse(item.tags); item.tags = JSON.parse(item.tags);
} }
}); });
checkTableRowIsSelected(this, this.$refs.table);
this.$nextTick(() => {
if (this.$refs.table) {
this.$refs.table.clear();
}
handleRowDrop(this.tableData, (param) => {
param.groupId = this.condition.projectId;
editApiDefinitionOrder(param);
});
})
}); });
} }
if (this.needRefreshModule()) { if (this.needRefreshModule()) {

View File

@ -94,7 +94,7 @@ import {
getSelectDataCounts, getSelectDataCounts,
setUnSelectIds, setUnSelectIds,
toggleAllSelection, toggleAllSelection,
checkTableRowIsSelect, getCustomTableHeader, saveCustomTableWidth, saveLastTableSortField, checkTableRowIsSelect, getCustomTableHeader, saveCustomTableWidth, saveLastTableSortField, handleRowDrop,
} from "@/common/js/tableUtils"; } from "@/common/js/tableUtils";
import MsTableHeaderSelectPopover from "@/business/components/common/components/table/MsTableHeaderSelectPopover"; import MsTableHeaderSelectPopover from "@/business/components/common/components/table/MsTableHeaderSelectPopover";
import MsTablePagination from "@/business/components/common/pagination/TablePagination"; import MsTablePagination from "@/business/components/common/pagination/TablePagination";
@ -105,6 +105,7 @@ import HeaderLabelOperate from "@/business/components/common/head/HeaderLabelOpe
import HeaderCustom from "@/business/components/common/head/HeaderCustom"; import HeaderCustom from "@/business/components/common/head/HeaderCustom";
import MsCustomTableHeader from "@/business/components/common/components/table/MsCustomTableHeader"; import MsCustomTableHeader from "@/business/components/common/components/table/MsCustomTableHeader";
import {lineToHump} from "@/common/js/utils"; import {lineToHump} from "@/common/js/utils";
import {editTestCaseOrder} from "@/network/testCase";
/** /**
* 参考 ApiList * 参考 ApiList
@ -219,6 +220,9 @@ export default {
rememberOrder: Boolean, rememberOrder: Boolean,
enableOrderDrag: Boolean, enableOrderDrag: Boolean,
rowKey: [String, Function], rowKey: [String, Function],
// idid
rowOrderGroupId: String,
rowOrderFunc: Function
}, },
mounted() { mounted() {
this.setDefaultOrders(); this.setDefaultOrders();
@ -226,6 +230,18 @@ export default {
watch: { watch: {
selectNodeIds() { selectNodeIds() {
this.selectDataCounts = 0; this.selectDataCounts = 0;
},
//
data(newVar, oldVar) {
// newVar === oldVar
if (newVar !== oldVar) {
this.$nextTick(() => {
this.clear();
this.doLayout();
this.checkTableRowIsSelect();
this.listenRowDrop();
});
}
} }
}, },
methods: { methods: {
@ -255,6 +271,16 @@ export default {
} }
} }
}, },
listenRowDrop() {
if (this.rowOrderGroupId) {
handleRowDrop(this.data, (param) => {
param.groupId = this.rowOrderGroupId;
if (this.rowOrderFunc) {
this.rowOrderFunc(param);
}
});
}
},
isScrollShow(column, tableTop){ // isScrollShow(column, tableTop){ //
let columnTop = column.getBoundingClientRect().top; let columnTop = column.getBoundingClientRect().top;
return columnTop - tableTop > 30; return columnTop - tableTop > 30;

View File

@ -19,6 +19,8 @@
:remember-order="true" :remember-order="true"
:enable-order-drag="enableOrderDrag" :enable-order-drag="enableOrderDrag"
row-key="id" row-key="id"
:row-order-group-id="projectId"
:row-order-func="editLoadTestCaseOrder"
operator-width="190px" operator-width="190px"
:screen-height="screenHeight" :screen-height="screenHeight"
:enable-selection="false" :enable-selection="false"
@ -104,7 +106,7 @@ import MsTableOperators from "../../common/components/MsTableOperators";
import {getCurrentProjectID, getCurrentWorkspaceId} from "@/common/js/utils"; import {getCurrentProjectID, getCurrentWorkspaceId} from "@/common/js/utils";
import MsTableHeader from "../../common/components/MsTableHeader"; import MsTableHeader from "../../common/components/MsTableHeader";
import {TEST_CONFIGS} from "../../common/components/search/search-components"; import {TEST_CONFIGS} from "../../common/components/search/search-components";
import {getLastTableSortField, handleRowDrop} from "@/common/js/tableUtils"; import {getLastTableSortField} from "@/common/js/tableUtils";
import MsTable from "@/business/components/common/components/table/MsTable"; import MsTable from "@/business/components/common/components/table/MsTable";
import {editLoadTestCaseOrder} from "@/network/load-test"; import {editLoadTestCaseOrder} from "@/network/load-test";
@ -172,8 +174,13 @@ export default {
this.initTableData(); this.initTableData();
} }
}, },
computed: {
editLoadTestCaseOrder() {
return editLoadTestCaseOrder;
}
},
created: function () { created: function () {
this.projectId = this.$route.params.projectId; this.projectId = getCurrentProjectID();
this.initTableData(); this.initTableData();
this.getMaintainerOptions(); this.getMaintainerOptions();
}, },
@ -203,16 +210,6 @@ export default {
this.$set(test, 'reportCount', response.data); this.$set(test, 'reportCount', response.data);
}); });
}); });
this.$nextTick(() => {
handleRowDrop(this.tableData, (param) => {
param.groupId = getCurrentProjectID();
editLoadTestCaseOrder(param);
});
if (this.$refs.table) {
this.$refs.table.clear();
}
});
}); });
}, },
search(combine) { search(combine) {

View File

@ -17,6 +17,8 @@
:remember-order="true" :remember-order="true"
:enable-order-drag="enableOrderDrag" :enable-order-drag="enableOrderDrag"
row-key="id" row-key="id"
:row-order-group-id="projectId"
:row-order-func="editTestCaseOrder"
@handlePageChange="initTableData" @handlePageChange="initTableData"
@handleRowClick="handleEdit" @handleRowClick="handleEdit"
:fields.sync="fields" :fields.sync="fields"
@ -202,13 +204,12 @@ import ReviewStatus from "@/business/components/track/case/components/ReviewStat
import MsTag from "@/business/components/common/components/MsTag"; import MsTag from "@/business/components/common/components/MsTag";
import { import {
buildBatchParam, buildBatchParam,
checkTableRowIsSelected,
deepClone, deepClone,
getCustomFieldBatchEditOption, getCustomFieldBatchEditOption,
getCustomFieldValue, getCustomFieldValue,
getCustomTableWidth, getLastTableSortField, getCustomTableWidth, getLastTableSortField,
getPageInfo, getPageInfo,
getTableHeaderWithCustomFields, handleRowDrop, getTableHeaderWithCustomFields,
initCondition, initCondition,
} from "@/common/js/tableUtils"; } from "@/common/js/tableUtils";
import HeaderLabelOperate from "@/business/components/common/head/HeaderLabelOperate"; import HeaderLabelOperate from "@/business/components/common/head/HeaderLabelOperate";
@ -384,6 +385,9 @@ export default {
}, },
systemFiledMap() { systemFiledMap() {
return SYSTEM_FIELD_NAME_MAP; return SYSTEM_FIELD_NAME_MAP;
},
editTestCaseOrder() {
return editTestCaseOrder;
} }
}, },
created: function () { created: function () {
@ -579,12 +583,6 @@ export default {
let data = response.data; let data = response.data;
this.page.total = data.itemCount; this.page.total = data.itemCount;
this.page.data = data.listObject; this.page.data = data.listObject;
if (this.$refs.table) {
this.$refs.table.clear();
this.$nextTick(() => {
this.$refs.table.doLayout();
});
}
this.page.data.forEach(item => { this.page.data.forEach(item => {
if (item.customFields) { if (item.customFields) {
item.customFields = JSON.parse(item.customFields); item.customFields = JSON.parse(item.customFields);
@ -598,21 +596,9 @@ export default {
} }
}); });
checkTableRowIsSelected(this, this.$refs.table);
this.handleRowDrop();
}); });
} }
}, },
handleRowDrop() {
this.$nextTick(() => {
handleRowDrop(this.page.data, (param) => {
param.groupId = this.projectId;
editTestCaseOrder(param);
});
});
},
search() { search() {
this.initTableData(); this.initTableData();
}, },

View File

@ -48,7 +48,6 @@ export default {
open() { open() {
this.init(); this.init();
this.$refs.baseRelevance.open(); this.$refs.baseRelevance.open();
this.$refs.apiCaseList.clear();
}, },
init() { init() {
if (this.$refs.apiCaseList) { if (this.$refs.apiCaseList) {

View File

@ -25,6 +25,8 @@
:fields.sync="fields" :fields.sync="fields"
:field-key="tableHeaderKey" :field-key="tableHeaderKey"
@refresh="initTable" @refresh="initTable"
:row-order-group-id="planId"
:row-order-func="editTestPlanApiCaseOrder"
:enable-order-drag="enableOrderDrag" :enable-order-drag="enableOrderDrag"
row-key="id" row-key="id"
ref="table"> ref="table">
@ -174,7 +176,7 @@ import TestPlanApiCaseResult from "./TestPlanApiCaseResult";
import {TEST_PLAN_API_CASE} from "@/common/js/constants"; import {TEST_PLAN_API_CASE} from "@/common/js/constants";
import { import {
buildBatchParam, buildBatchParam,
checkTableRowIsSelect, deepClone, getCustomTableHeader, getCustomTableWidth, handleRowDrop, checkTableRowIsSelect, deepClone, getCustomTableHeader, getCustomTableWidth,
} from "@/common/js/tableUtils"; } from "@/common/js/tableUtils";
import HeaderCustom from "@/business/components/common/head/HeaderCustom"; import HeaderCustom from "@/business/components/common/head/HeaderCustom";
import HeaderLabelOperate from "@/business/components/common/head/HeaderLabelOperate"; import HeaderLabelOperate from "@/business/components/common/head/HeaderLabelOperate";
@ -341,6 +343,9 @@ export default {
isApiModel() { isApiModel() {
return this.model === 'api'; return this.model === 'api';
}, },
editTestPlanApiCaseOrder() {
return editTestPlanApiCaseOrder;
}
}, },
methods: { methods: {
customHeader() { customHeader() {
@ -386,14 +391,6 @@ export default {
item.tags = JSON.parse(item.tags); item.tags = JSON.parse(item.tags);
} }
}); });
if (this.$refs.table) {
this.$refs.table.clear();
setTimeout(this.$refs.table.doLayout, 200);
this.$nextTick(() => {
checkTableRowIsSelect(this, this.condition, this.tableData, this.$refs.table, this.$refs.table.selectRows);
});
}
}); });
} }
if (this.planId) { if (this.planId) {
@ -406,25 +403,9 @@ export default {
item.tags = JSON.parse(item.tags); item.tags = JSON.parse(item.tags);
} }
}); });
if (this.$refs.table) {
this.$refs.table.clear();
setTimeout(this.$refs.table.doLayout, 200);
this.$nextTick(() => {
checkTableRowIsSelect(this, this.condition, this.tableData, this.$refs.table, this.$refs.table.selectRows);
});
}
this.handleRowDrop();
}); });
} }
}, },
handleRowDrop() {
this.$nextTick(() => {
handleRowDrop(this.tableData, (param) => {
param.groupId = this.planId;
editTestPlanApiCaseOrder(param);
});
});
},
search() { search() {
this.initTable(); this.initTable();
}, },

View File

@ -21,6 +21,8 @@
:field-key="tableHeaderKey" :field-key="tableHeaderKey"
:enable-order-drag="enableOrderDrag" :enable-order-drag="enableOrderDrag"
row-key="id" row-key="id"
:row-order-func="editTestPlanScenarioCaseOrder"
:row-order-group-id="planId"
@refresh="search" @refresh="search"
ref="table"> ref="table">
<span v-for="(item) in fields" :key="item.key"> <span v-for="(item) in fields" :key="item.key">
@ -180,8 +182,7 @@ import MsTestPlanList from "../../../../../api/automation/scenario/testplan/Test
import TestPlanScenarioListHeader from "./TestPlanScenarioListHeader"; import TestPlanScenarioListHeader from "./TestPlanScenarioListHeader";
import { import {
initCondition, initCondition,
buildBatchParam, buildBatchParam, getCustomTableHeader, getCustomTableWidth
checkTableRowIsSelect, getCustomTableHeader, getCustomTableWidth, handleRowDrop
} from "../../../../../../../common/js/tableUtils"; } from "../../../../../../../common/js/tableUtils";
import {TEST_PLAN_SCENARIO_CASE} from "@/common/js/constants"; import {TEST_PLAN_SCENARIO_CASE} from "@/common/js/constants";
import HeaderLabelOperate from "@/business/components/common/head/HeaderLabelOperate"; import HeaderLabelOperate from "@/business/components/common/head/HeaderLabelOperate";
@ -290,6 +291,9 @@ export default {
projectId() { projectId() {
return getCurrentProjectID(); return getCurrentProjectID();
}, },
editTestPlanScenarioCaseOrder() {
return editTestPlanScenarioCaseOrder;
}
}, },
created() { created() {
this.search(); this.search();
@ -344,20 +348,6 @@ export default {
} }
}) })
this.loading = false; this.loading = false;
handleRowDrop(this.tableData, (param) => {
param.groupId = this.planId;
editTestPlanScenarioCaseOrder(param);
});
if (this.$refs.table) {
this.$refs.table.selectRows.clear();
setTimeout(this.$refs.table.doLayout, 200);
this.$nextTick(() => {
checkTableRowIsSelect(this, this.condition, this.tableData, this.$refs.table, this.$refs.table.selectRows);
});
}
}); });
} }
if (this.reviewId) { if (this.reviewId) {
@ -373,12 +363,6 @@ export default {
} }
}); });
this.loading = false; this.loading = false;
if (this.$refs.table) {
setTimeout(this.$refs.table.doLayout, 200);
this.$nextTick(() => {
checkTableRowIsSelect(this, this.condition, this.tableData, this.$refs.table, this.$refs.table.selectRows);
});
}
}); });
} }
}, },

View File

@ -34,6 +34,8 @@
:fields.sync="fields" :fields.sync="fields"
:remember-order="true" :remember-order="true"
@refresh="initTableData" @refresh="initTableData"
:row-order-group-id="planId"
:row-order-func="editTestPlanTestCaseOrder"
:enable-order-drag="enableOrderDrag" :enable-order-drag="enableOrderDrag"
row-key="id" row-key="id"
ref="table"> ref="table">
@ -269,9 +271,9 @@ import ClassicEditor from "@ckeditor/ckeditor5-build-classic";
import {hub} from "@/business/components/track/plan/event-bus"; import {hub} from "@/business/components/track/plan/event-bus";
import MsTag from "@/business/components/common/components/MsTag"; import MsTag from "@/business/components/common/components/MsTag";
import { import {
buildBatchParam, checkTableRowIsSelected, buildBatchParam,
getCustomFieldValue, getCustomTableWidth, getLastTableSortField, getCustomFieldValue, getCustomTableWidth, getLastTableSortField,
getTableHeaderWithCustomFields, handleRowDrop, getTableHeaderWithCustomFields,
initCondition, initCondition,
} from "@/common/js/tableUtils"; } from "@/common/js/tableUtils";
import MsTable from "@/business/components/common/components/table/MsTable"; import MsTable from "@/business/components/common/components/table/MsTable";
@ -394,6 +396,11 @@ export default {
type: Array type: Array
}, },
}, },
computed: {
editTestPlanTestCaseOrder() {
return editTestPlanTestCaseOrder;
}
},
watch: { watch: {
planId() { planId() {
this.refreshTableAndPlan(); this.refreshTableAndPlan();
@ -486,17 +493,6 @@ export default {
this.$set(this.tableData[i], "issuesContent", JSON.parse(this.tableData[i].issues)); this.$set(this.tableData[i], "issuesContent", JSON.parse(this.tableData[i].issues));
} }
} }
this.$nextTick(() => {
handleRowDrop(this.tableData, (param) => {
param.groupId = this.planId;
editTestPlanTestCaseOrder(param);
});
});
if (this.$refs.table) {
this.$refs.table.clear();
}
checkTableRowIsSelected(this, this.$refs.table);
}); });
} }
}, },

View File

@ -23,6 +23,8 @@
:field-key="tableHeaderKey" :field-key="tableHeaderKey"
:enable-order-drag="enableOrderDrag" :enable-order-drag="enableOrderDrag"
row-key="id" row-key="id"
:row-order-group-id="planId"
:row-order-func="editTestPlanLoadCaseOrder"
@refresh="initTable" @refresh="initTable"
ref="table"> ref="table">
<span v-for="(item) in fields" :key="item.key"> <span v-for="(item) in fields" :key="item.key">
@ -124,8 +126,7 @@ import MsTablePagination from "@/business/components/common/pagination/TablePagi
import MsPerformanceTestStatus from "@/business/components/performance/test/PerformanceTestStatus"; import MsPerformanceTestStatus from "@/business/components/performance/test/PerformanceTestStatus";
import LoadCaseReport from "@/business/components/track/plan/view/comonents/load/LoadCaseReport"; import LoadCaseReport from "@/business/components/track/plan/view/comonents/load/LoadCaseReport";
import { import {
buildBatchParam, buildBatchParam, getCustomTableHeader, getCustomTableWidth
checkTableRowIsSelect, getCustomTableHeader, getCustomTableWidth, handleRowDrop
} from "@/common/js/tableUtils"; } from "@/common/js/tableUtils";
import {TEST_PLAN_LOAD_CASE} from "@/common/js/constants"; import {TEST_PLAN_LOAD_CASE} from "@/common/js/constants";
import {getCurrentProjectID, getCurrentUser, getCurrentUserId} from "@/common/js/utils"; import {getCurrentProjectID, getCurrentUser, getCurrentUserId} from "@/common/js/utils";
@ -223,6 +224,11 @@ export default {
reviewId: String, reviewId: String,
clickType: String, clickType: String,
}, },
computed: {
editTestPlanLoadCaseOrder() {
return editTestPlanLoadCaseOrder;
}
},
created() { created() {
this.initTable(); this.initTable();
this.refreshStatus(); this.refreshStatus();
@ -316,19 +322,6 @@ export default {
let {itemCount, listObject} = data; let {itemCount, listObject} = data;
this.total = itemCount; this.total = itemCount;
this.tableData = listObject; this.tableData = listObject;
this.$nextTick(() => {
handleRowDrop(this.tableData, (param) => {
param.groupId = this.planId;
editTestPlanLoadCaseOrder(param);
});
});
if (this.$refs.table) {
setTimeout(this.$refs.table.doLayout, 200);
this.$nextTick(() => {
checkTableRowIsSelect(this, this.condition, this.tableData, this.$refs.table, this.$refs.table.selectRows);
});
}
}) })
} }
if (this.reviewId) { if (this.reviewId) {
@ -338,12 +331,6 @@ export default {
let {itemCount, listObject} = data; let {itemCount, listObject} = data;
this.total = itemCount; this.total = itemCount;
this.tableData = listObject; this.tableData = listObject;
if (this.$refs.table) {
setTimeout(this.$refs.table.doLayout, 200);
this.$nextTick(() => {
checkTableRowIsSelect(this, this.condition, this.tableData, this.$refs.table, this.$refs.table.selectRows);
});
}
}) })
} }
}, },

View File

@ -86,7 +86,7 @@ import {
_filter, _filter,
_handleSelect, _handleSelect,
_handleSelectAll, _handleSelectAll,
_sort, checkTableRowIsSelect, _sort,
getSelectDataCounts, getSelectDataCounts,
initCondition, initCondition,
setUnSelectIds, toggleAllSelection,saveLastTableSortField,getLastTableSortField setUnSelectIds, toggleAllSelection,saveLastTableSortField,getLastTableSortField
@ -173,12 +173,6 @@ export default {
let data = response.data; let data = response.data;
this.total = data.itemCount; this.total = data.itemCount;
this.tableData = data.listObject; this.tableData = data.listObject;
if (this.$refs.testPlanReportTable) {
// setTimeout(this.$refs.testPlanReportTable,200);
}
this.$nextTick(() => {
checkTableRowIsSelect(this,this.condition,this.tableData,this.$refs.testPlanReportTable,this.selectRows);
});
}); });
}, },
buildPagePath(path) { buildPagePath(path) {

View File

@ -170,7 +170,7 @@ import TestReviewTestCaseEdit from "./TestReviewTestCaseEdit";
import ReviewStatus from "@/business/components/track/case/components/ReviewStatus"; import ReviewStatus from "@/business/components/track/case/components/ReviewStatus";
import { import {
_handleSelectAll, _handleSelectAll,
buildBatchParam, checkTableRowIsSelected, deepClone, getCustomTableWidth, getLastTableSortField, buildBatchParam, deepClone, getCustomTableWidth, getLastTableSortField,
getSelectDataCounts, getTableHeaderWithCustomFields, getSelectDataCounts, getTableHeaderWithCustomFields,
initCondition, initCondition,
toggleAllSelection toggleAllSelection
@ -328,7 +328,6 @@ export default {
this.total = data.itemCount; this.total = data.itemCount;
this.tableData = data.listObject; this.tableData = data.listObject;
this.tableClear(); this.tableClear();
checkTableRowIsSelected(this, this.$refs.table);
}); });
} }