refactor(接口测试): 场景编辑变更记录加载较慢的优化

--bug=1011594 --user=王孝刚 【接口测试】场景编辑-变更记录加载较慢(50条记录)
https://www.tapd.cn/55049933/s/1127738
This commit is contained in:
wxg0103 2022-03-30 16:02:22 +08:00 committed by fit2-zhao
parent 4255fb6b0e
commit 8a29a86138
3 changed files with 35 additions and 11 deletions

View File

@ -75,8 +75,9 @@
<if test="request.sourceId != null and request.sourceId != ''">
and t3.source_id = #{request.sourceId, jdbcType=VARCHAR}
</if>
and JSON_UNQUOTE(JSON_EXTRACT(t.oper_content, '$.columns[*]')) is not null
</where>
order by t.oper_time desc limit 100
order by t.oper_time desc
)tt
LEFT JOIN `user` t1 ON tt.oper_user = t1.id
LEFT JOIN project t2 ON tt.project_id = t2.id

View File

@ -32,9 +32,10 @@ public class OperatingLogController {
}
@PostMapping("/get/source")
public List<OperatingLogDTO> findBySourceId(@RequestBody OperatingLogRequest request) {
return operatingLogService.findBySourceId(request);
@PostMapping("/get/source/{goPage}/{pageSize}")
public Pager<List<OperatingLogDTO>> findBySourceId(@PathVariable int goPage, @PathVariable int pageSize, @RequestBody OperatingLogRequest request) {
Page<Object> page = PageHelper.startPage(goPage, pageSize, true);
return PageUtils.setPageInfo(page, operatingLogService.findBySourceId(request));
}
@PostMapping("/save")

View File

@ -35,7 +35,10 @@
<div v-if="scope.row.details && scope.row.details.columns">
<div v-for="detail in scope.row.details.columns" :key="detail.id">
<div v-if="linkDatas.indexOf(detail.columnName)!== -1">
<el-link style="color: #409EFF" @click="openDetail(scope.row,detail)">{{ $t('operating_log.info') }}</el-link>
<el-link style="color: #409EFF" @click="openDetail(scope.row,detail)">{{
$t('operating_log.info')
}}
</el-link>
</div>
<el-tooltip :content="detail.newValue" v-else>
<div class="current-value">{{ detail.newValue ? detail.newValue : "空值" }}</div>
@ -45,6 +48,8 @@
</template>
</el-table-column>
</el-table>
<ms-table-pagination :change="getDetails" :current-page.sync="goPage" :page-size.sync="pageSize"
:total="totalCount"/>
<ms-history-detail ref="historyDetail"/>
<ms-tags-history-detail ref="tagsHistoryDetail"/>
@ -58,9 +63,13 @@ import MsTagsHistoryDetail from "./tags/TagsHistoryDetail";
import MsApiHistoryDetail from "./api/ApiHistoryDetail";
import MsEnvironmentHistoryDetail from "./api/EnvironmentHistoryDetail";
export default {
name: "MsChangeHistory",
components: {MsHistoryDetail, MsTagsHistoryDetail, MsApiHistoryDetail, MsEnvironmentHistoryDetail},
components: {
MsHistoryDetail, MsTagsHistoryDetail, MsApiHistoryDetail, MsEnvironmentHistoryDetail,
MsTablePagination: () => import("@/business/components/common/pagination/TablePagination"),
},
props: {
title: String,
},
@ -72,6 +81,11 @@ export default {
linkDatas: ["prerequisite", "steps", "remark", "request", "config",
"response", "scenarioDefinition", "tags", "loadConfiguration", "advancedConfiguration"],
showChangeField: true,
pageSize: 10,
goPage: 1,
totalCount: 0,
id: String,
module: String
}
},
methods: {
@ -79,8 +93,14 @@ export default {
this.infoVisible = false;
},
getDetails(id, modules) {
this.result = this.$post("/operating/log/get/source/", {sourceId: id, modules: modules}, response => {
let data = response.data;
id = this.id;
modules = this.module;
this.result = this.$post("/operating/log/get/source/" + this.goPage + '/' + this.pageSize, {
sourceId: id,
modules: modules
}, response => {
let data = response.data.listObject;
this.totalCount = response.data.itemCount;
this.loading = false;
if (data) {
//
@ -111,6 +131,8 @@ export default {
open(id, modules) {
this.infoVisible = true;
this.loading = true;
this.id = id;
this.module = modules;
this.getDetails(id, modules);
},
openDetail(row, value) {