perf: 优化测试用例每页显示速度

This commit is contained in:
Captain.B 2020-11-24 10:39:25 +08:00
parent c0b4b813f3
commit e6fc2adb58
5 changed files with 510 additions and 487 deletions

View File

@ -258,7 +258,8 @@
</select>
<select id="list" resultType="io.metersphere.track.dto.TestCaseDTO">
select test_case.* from test_case
select <include refid="io.metersphere.base.mapper.TestCaseMapper.Base_Column_List"/>
from test_case
<where>
<if test="request.combine != null">
<include refid="combine">

View File

@ -71,7 +71,8 @@
name: "TestCase",
components: {
MsMainContainer,
MsAsideContainer, MsContainer, TestCaseMove, TestCaseList, NodeTree, TestCaseEdit, SelectMenu, BatchMove},
MsAsideContainer, MsContainer, TestCaseMove, TestCaseList, NodeTree, TestCaseEdit, SelectMenu, BatchMove
},
comments: {},
data() {
return {

View File

@ -161,6 +161,7 @@ export default {
data() {
return {
result: {},
testCase: {},
dialogFormVisible: false,
readOnly: true,
form: {
@ -190,9 +191,15 @@ export default {
]
};
},
mounted() {
this.$get('test/case/get/' + this.testCaseId, response => {
this.testCase = response.data;
});
},
methods: {},
props: {
testCase: {
type: Object
testCaseId: {
type: String
}
},
}

View File

@ -256,9 +256,9 @@
<script>
import {TokenKey, WORKSPACE_ID} from '../../../../../common/js/constants';
import {TokenKey, WORKSPACE_ID} from '@/common/js/constants';
import MsDialogFooter from '../../../common/components/MsDialogFooter'
import {listenGoBack, removeGoBackListener} from "../../../../../common/js/utils";
import {listenGoBack, removeGoBackListener} from "@/common/js/utils";
import {LIST_CHANGE, TrackEvent} from "@/business/components/common/head/ListEvent";
import {Message} from "element-ui";
import TestCaseAttachment from "@/business/components/track/case/components/TestCaseAttachment";

View File

@ -35,6 +35,7 @@
@filter-change="filter"
@select-all="handleSelectAll"
@select="handleSelectionChange"
@cell-mouse-enter="showPopover"
row-key="id"
class="test-content adjust-table">
<el-table-column
@ -65,7 +66,7 @@
width="60%"
trigger="hover"
>
<test-case-detail :test-case="scope.row"/>
<test-case-detail v-if="currentCaseId === scope.row.id" :test-case-id="currentCaseId"/>
<span slot="reference">{{ scope.row.name }}</span>
</el-popover>
</template>
@ -166,11 +167,11 @@ import MethodTableItem from "../../common/tableItems/planview/MethodTableItem";
import MsTableOperator from "../../../common/components/MsTableOperator";
import MsTableOperatorButton from "../../../common/components/MsTableOperatorButton";
import MsTableButton from "../../../common/components/MsTableButton";
import {_filter, _sort} from "../../../../../common/js/utils";
import {_filter, _sort} from "@/common/js/utils";
import {TEST_CASE_CONFIGS} from "../../../common/components/search/search-components";
import ShowMoreBtn from "./ShowMoreBtn";
import BatchEdit from "./BatchEdit";
import {WORKSPACE_ID} from "../../../../../common/js/constants";
import {WORKSPACE_ID} from "@/common/js/constants";
import {LIST_CHANGE, TrackEvent} from "@/business/components/common/head/ListEvent";
import StatusTableItem from "@/business/components/track/common/tableItems/planview/StatusTableItem";
import TestCaseDetail from "./TestCaseDetail";
@ -262,7 +263,8 @@ export default {
{name: this.$t('test_track.case.auto'), id: 'auto'}
],
maintainer: [],
}
},
currentCaseId: null
}
},
props: {
@ -319,10 +321,16 @@ export default {
this.$emit('testCaseEdit');
},
handleEdit(testCase) {
this.$get('test/case/get/' + testCase.id, response => {
let testCase = response.data;
this.$emit('testCaseEdit', testCase);
});
},
handleCopy(testCase) {
this.$get('test/case/get/' + testCase.id, response => {
let testCase = response.data;
this.$emit('testCaseCopy', testCase);
});
},
handleDelete(testCase) {
this.$alert(this.$t('test_track.case.delete_confirm') + '\'' + testCase.name + '\'' + "", '', {
@ -481,6 +489,12 @@ export default {
this.$post('/user/ws/member/tester/list', {workspaceId: workspaceId}, response => {
this.valueArr.maintainer = response.data;
});
},
showPopover(row, column, cell) {
if (column.property === 'name') {
console.log(row, column);
this.currentCaseId = row.id;
}
}
}
}