fix: 修复改了资源池之后资源池ID变了的问题

This commit is contained in:
Captain.B 2020-10-28 12:19:19 +08:00
parent d26c05a306
commit 9a34a5f27f
2 changed files with 206 additions and 203 deletions

View File

@ -210,7 +210,6 @@ public class TestResourcePoolService {
private void updateTestResource(TestResource testResource) {
testResource.setUpdateTime(System.currentTimeMillis());
testResource.setCreateTime(System.currentTimeMillis());
testResource.setId(UUID.randomUUID().toString());
testResourceMapper.insertSelective(testResource);
}

View File

@ -3,7 +3,8 @@
<el-card class="table-card" v-loading="result.loading">
<template v-slot:header>
<ms-table-header :condition.sync="condition" @search="search" @create="create"
:create-tip="$t('test_resource_pool.create_resource_pool')" :title="$t('commons.test_resource_pool')"/>
:create-tip="$t('test_resource_pool.create_resource_pool')"
:title="$t('commons.test_resource_pool')"/>
</template>
<el-table border class="adjust-table" :data="items" style="width: 100%">
<el-table-column prop="name" :label="$t('commons.name')"/>
@ -174,14 +175,14 @@
</template>
<script>
import MsCreateBox from "../CreateBox";
import MsTablePagination from "../../common/pagination/TablePagination";
import MsTableHeader from "../../common/components/MsTableHeader";
import MsTableOperator from "../../common/components/MsTableOperator";
import MsDialogFooter from "../../common/components/MsDialogFooter";
import {listenGoBack, removeGoBackListener} from "../../../../common/js/utils";
import MsCreateBox from "../CreateBox";
import MsTablePagination from "../../common/pagination/TablePagination";
import MsTableHeader from "../../common/components/MsTableHeader";
import MsTableOperator from "../../common/components/MsTableOperator";
import MsDialogFooter from "../../common/components/MsDialogFooter";
import {listenGoBack, removeGoBackListener} from "../../../../common/js/utils";
export default {
export default {
name: "MsTestResourcePool",
components: {MsCreateBox, MsTablePagination, MsTableHeader, MsTableOperator, MsDialogFooter},
data() {
@ -286,7 +287,9 @@
let resources = [];
if (this.form.resources) {
this.form.resources.forEach(function (resource) {
resources.push(JSON.parse(resource.configuration));
let configuration = JSON.parse(resource.configuration);
configuration.id = resource.id
resources.push(configuration);
})
}
this.infoList = resources;
@ -298,7 +301,7 @@
cancelButtonText: this.$t('commons.cancel'),
type: 'warning'
}).then(() => {
this.result = this.$get(`/testresourcepool/delete/${row.id}`,() => {
this.result = this.$get(`/testresourcepool/delete/${row.id}`, () => {
this.initTableData();
this.$success(this.$t('commons.delete_success'));
});
@ -334,7 +337,8 @@
let resources = [];
let poolId = this.form.id;
this.infoList.forEach(function (info) {
let resource = {"configuration": JSON.stringify(info)};
let configuration = JSON.stringify(info);
let resource = {"configuration": configuration, id: info.id};
if (poolId) {
resource.testResourcePoolId = poolId;
}
@ -386,13 +390,13 @@
})
}
}
}
}
</script>
<style scoped>
.box {
.box {
padding-left: 5px;
}
}
</style>