update build info page

This commit is contained in:
Eleven 2021-08-22 00:36:57 +08:00
parent cf849108cd
commit 01626d694f
2 changed files with 17 additions and 6 deletions

View File

@ -54,8 +54,6 @@ import java.util.Objects;
@Feature(cls = ClassFeature.BUILD) @Feature(cls = ClassFeature.BUILD)
public class BuildInfoController extends BaseServerController { public class BuildInfoController extends BaseServerController {
@Resource
private BuildService buildService;
@Resource @Resource
private DbBuildHistoryLogService dbBuildHistoryLogService; private DbBuildHistoryLogService dbBuildHistoryLogService;
@Resource @Resource
@ -155,12 +153,17 @@ public class BuildInfoController extends BaseServerController {
buildInfoModel = new BuildInfoModel(); buildInfoModel = new BuildInfoModel();
buildInfoModel.setId(IdUtil.fastSimpleUUID()); buildInfoModel.setId(IdUtil.fastSimpleUUID());
} }
buildInfoModel.setGroup(group); // 判断 group 是否为空
buildInfoModel.setName(name); if (StrUtil.isNotEmpty(group)) {
buildInfoModel.setGroup(group);
}
// 如果是 SVN // 如果是 SVN
if (BuildModel.RepoType.Svn.getCode() == repositoryModel.getRepoType()) { if (BuildModel.RepoType.Svn.getCode() == repositoryModel.getRepoType()) {
branchName = "trunk"; branchName = "trunk";
} }
// 设置参数
buildInfoModel.setRepositoryId(repositoryId);
buildInfoModel.setName(name);
buildInfoModel.setBranchName(branchName); buildInfoModel.setBranchName(branchName);
buildInfoModel.setResultDirFile(resultDirFile); buildInfoModel.setResultDirFile(resultDirFile);
buildInfoModel.setScript(script); buildInfoModel.setScript(script);

View File

@ -9,7 +9,7 @@
</a-select> </a-select>
<a-button type="primary" @click="handleFilter">搜索</a-button> <a-button type="primary" @click="handleFilter">搜索</a-button>
<a-button type="primary" @click="handleAdd">新增</a-button> <a-button type="primary" @click="handleAdd">新增</a-button>
<a-button type="primary" @click="loadData">刷新</a-button> <a-button type="primary" @click="handleFilter">刷新</a-button>
</div> </div>
<!-- 表格 --> <!-- 表格 -->
<a-table <a-table
@ -103,7 +103,7 @@
</a-row> </a-row>
</a-form-model-item> </a-form-model-item>
<a-form-model-item label="仓库地址" prop="repositoryId"> <a-form-model-item label="仓库地址" prop="repositoryId">
<a-select v-model="temp.repositoryId"> <a-select v-model="temp.repositoryId" @select="changeRepositpry">
<a-select-option v-for="item in repositoryList" :key="item.id" :value="item.id">{{ item.name }}[{{ item.gitUrl }}]</a-select-option> <a-select-option v-for="item in repositoryList" :key="item.id" :value="item.id">{{ item.name }}[{{ item.gitUrl }}]</a-select-option>
</a-select> </a-select>
</a-form-model-item> </a-form-model-item>
@ -419,6 +419,14 @@ export default {
this.loadData(); this.loadData();
this.loadRepositoryList(); this.loadRepositoryList();
}, },
//
changeRepositpry(value) {
this.repositoryList.forEach(element => {
if (element.id === value) {
this.tempRepository = element;
}
})
},
// //
handleAdd() { handleAdd() {
this.temp = { this.temp = {