fix(操作日志): 修复性能测试报告日志问题

This commit is contained in:
fit2-zhao 2021-05-27 09:33:03 +08:00 committed by fit2-zhao
parent 3992b12f70
commit 3f20f5e834
4 changed files with 26 additions and 11 deletions

View File

@ -55,9 +55,7 @@ public class ReflexObjectUtil {
column.setDepthDff(true);
if (val != null) {
try {
if (f.getName().equals("loadConfiguration")) {
val = "{\"" + "压力配置" + "\":" + val.toString() + "}";
}
// 格式化
Gson gson = new GsonBuilder().setPrettyPrinting().create();
JsonObject jsonObject = gson.fromJson(val.toString(), JsonObject.class);
column.setOriginalValue(gson.toJson(jsonObject));
@ -115,6 +113,9 @@ public class ReflexObjectUtil {
continue;
}
}
if (StringUtils.isEmpty(JSON.toJSONString(originalColumns.get(i).getOriginalValue())) && StringUtils.isEmpty(JSON.toJSONString(newColumns.get(i).getOriginalValue()))) {
continue;
}
// 深度对比
DetailColumn column = new DetailColumn();
BeanUtils.copyBean(column, originalColumns.get(i));

View File

@ -619,6 +619,11 @@ public class PerformanceTestService {
public String getLogDetails(String id) {
LoadTestWithBLOBs loadTest = loadTestMapper.selectByPrimaryKey(id);
if (loadTest != null) {
String loadConfiguration = loadTest.getLoadConfiguration();
if (StringUtils.isNotEmpty(loadConfiguration)) {
loadConfiguration = "{\"" + "压力配置" + "\":" + loadConfiguration + "}";
}
loadTest.setLoadConfiguration(loadConfiguration);
List<DetailColumn> columns = ReflexObjectUtil.getColumns(loadTest, PerformanceReference.performanceColumns);
OperatingLogDetails details = new OperatingLogDetails(JSON.toJSONString(loadTest.getId()), loadTest.getProjectId(), loadTest.getName(), loadTest.getCreateUser(), columns);
return JSON.toJSONString(details);

View File

@ -7,6 +7,7 @@
<el-checkbox v-model="isSelectAll" v-if="isShowEnable === true && items.length > 1"/>
</el-row>
<div class="kv-row item" v-for="(item, index) in items" :key="index">
<el-row type="flex" :gutter="20" justify="space-between" align="middle">
<el-col class="kv-checkbox" v-if="isShowEnable">
<el-checkbox v-if="!isDisable(index)" v-model="item.enable"
@ -42,7 +43,7 @@
:fetch-suggestions="funcSearch"
highlight-first-item
show-word-limit>
<i slot="suffix" class="el-input__icon el-icon-edit pointer" @click="advanced"></i>
<i slot="suffix" class="el-input__icon el-icon-edit pointer" @click="advanced(item)"></i>
</el-autocomplete>
</div>
</el-col>
@ -52,7 +53,8 @@
</el-col>
</el-row>
</div>
<ms-api-variable-advance ref="variableAdvance"/>
<ms-api-variable-advance :current-item="currentItem" :parameters="keyValues" ref="variableAdvance"/>
</div>
</template>
@ -88,6 +90,7 @@
return {
keyValues: [],
loading: false,
currentItem: {},
isSelectAll: true
}
},
@ -109,7 +112,8 @@
}
},
methods: {
advanced() {
advanced(item) {
this.currentItem = item;
this.$refs.variableAdvance.open();
},
funcFilter(queryString) {

View File

@ -355,9 +355,14 @@ export default {
confirmButtonText: this.$t('commons.confirm'),
callback: (action) => {
if (action === 'confirm') {
let ids = [];
this.selectRows.forEach(row => {
this._handleDeleteNoMsg(row);
ids.push(row.id);
});
this.result = this.$post("/performance/report/batch/delete",{ids:ids}, () => {
this.initTableData();
});
this.$success(this.$t('commons.delete_success'));
}
},