fix: 尝试修复表格固定列之后错乱的问题

This commit is contained in:
Captain.B 2021-03-29 10:56:14 +08:00
parent fd34e063ff
commit c5e977b091
5 changed files with 671 additions and 656 deletions

View File

@ -69,7 +69,8 @@
<el-table-column v-if="item.id == 'tags'" prop="tags" min-width="120px" <el-table-column v-if="item.id == 'tags'" prop="tags" min-width="120px"
:label="$t('api_test.automation.tag')" :key="index"> :label="$t('api_test.automation.tag')" :key="index">
<template v-slot:default="scope"> <template v-slot:default="scope">
<ms-tag v-for="(itemName,index) in scope.row.tags" :key="index" type="success" effect="plain" :content="itemName" :show-tooltip="true" tooltip style="margin-left: 0px; margin-right: 2px"/> <ms-tag v-for="(itemName,index) in scope.row.tags" :key="index" type="success" effect="plain" :content="itemName" :show-tooltip="true"
tooltip style="margin-left: 0px; margin-right: 2px"/>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column v-if="item.id == 'userId'" prop="userId" min-width="120px" <el-table-column v-if="item.id == 'userId'" prop="userId" min-width="120px"
@ -175,20 +176,21 @@
import PriorityTableItem from "../../../track/common/tableItems/planview/PriorityTableItem"; import PriorityTableItem from "../../../track/common/tableItems/planview/PriorityTableItem";
import PlanStatusTableItem from "../../../track/common/tableItems/plan/PlanStatusTableItem"; import PlanStatusTableItem from "../../../track/common/tableItems/plan/PlanStatusTableItem";
import BatchEdit from "../../../track/case/components/BatchEdit"; import BatchEdit from "../../../track/case/components/BatchEdit";
import {API_SCENARIO_LIST, TEST_CASE_LIST, TEST_PLAN_LIST, WORKSPACE_ID} from "../../../../../common/js/constants"; import {API_SCENARIO_LIST, PROJECT_NAME, WORKSPACE_ID} from "../../../../../common/js/constants";
import {PROJECT_NAME} from "../../../../../common/js/constants";
import EnvironmentSelect from "../../definition/components/environment/EnvironmentSelect"; import EnvironmentSelect from "../../definition/components/environment/EnvironmentSelect";
import BatchMove from "../../../track/case/components/BatchMove"; import BatchMove from "../../../track/case/components/BatchMove";
import {_sort, getLabel, getSystemLabel} from "@/common/js/tableUtils";
import {Api_Scenario_List} from "@/business/components/common/model/JsonData";
import HeaderCustom from "@/business/components/common/head/HeaderCustom";
import { import {
_filter, _filter,
_handleSelect, _handleSelect,
_handleSelectAll, _handleSelectAll,
_sort,
getLabel,
getSelectDataCounts, getSelectDataCounts,
setUnSelectIds, toggleAllSelection setUnSelectIds,
toggleAllSelection
} from "@/common/js/tableUtils"; } from "@/common/js/tableUtils";
import {Api_Scenario_List} from "@/business/components/common/model/JsonData";
import HeaderCustom from "@/business/components/common/head/HeaderCustom";
import HeaderLabelOperate from "@/business/components/common/head/HeaderLabelOperate"; import HeaderLabelOperate from "@/business/components/common/head/HeaderLabelOperate";
export default { export default {
@ -343,8 +345,6 @@
this.condition.filters = {status: ["Prepare", "Underway", "Completed"]}; this.condition.filters = {status: ["Prepare", "Underway", "Completed"]};
this.search(); this.search();
this.getPrincipalOptions([]); this.getPrincipalOptions([]);
getSystemLabel(this, this.type)
}, },
watch: { watch: {
selectNodeIds() { selectNodeIds() {
@ -440,9 +440,12 @@
item.tags = JSON.parse(item.tags); item.tags = JSON.parse(item.tags);
} }
}); });
this.result.loading = false;
if (this.$refs.scenarioTable) { if (this.$refs.scenarioTable) {
setTimeout(this.$refs.scenarioTable.doLayout, 200) setTimeout(() => {
this.$refs.scenarioTable.doLayout();
this.result.loading = false;
}, 500)
} }
if (!this.condition.selectAll) { if (!this.condition.selectAll) {

View File

@ -353,7 +353,10 @@ export default {
} }
}) })
if (this.$refs.caseTable) { if (this.$refs.caseTable) {
setTimeout(this.$refs.caseTable.doLayout, 200) setTimeout(() => {
this.$refs.caseTable.doLayout();
this.result.loading = false;
}, 500)
} }
this.$nextTick(function(){ this.$nextTick(function(){
this.checkTableRowIsSelect(); this.checkTableRowIsSelect();

View File

@ -465,7 +465,10 @@
} }
}) })
if (this.$refs.apiDefinitionTable) { if (this.$refs.apiDefinitionTable) {
setTimeout(this.$refs.apiDefinitionTable.doLayout, 200) setTimeout(() => {
this.$refs.apiDefinitionTable.doLayout();
this.result.loading = false;
}, 500)
} }
// nexttick: // nexttick:
this.$nextTick(function(){ this.$nextTick(function(){

View File

@ -393,7 +393,10 @@ export default {
item.tags = JSON.parse(item.tags); item.tags = JSON.parse(item.tags);
}) })
if (this.$refs.table) { if (this.$refs.table) {
setTimeout(this.$refs.table.doLayout, 200) setTimeout(() => {
this.$refs.table.doLayout();
this.result.loading = false;
}, 500)
} }
this.$nextTick(function(){ this.$nextTick(function(){

View File

@ -476,7 +476,10 @@ export default {
} }
this.selectRows.clear(); this.selectRows.clear();
if (this.$refs.table) { if (this.$refs.table) {
setTimeout(this.$refs.table.doLayout, 200) setTimeout(() => {
this.$refs.table.doLayout();
this.result.loading = false;
}, 500)
} }
}); });
} }