|
|
@@ -1,28 +1,25 @@
|
|
|
<template>
|
|
|
<div>
|
|
|
-<!-- <el-row-->
|
|
|
-<!-- style="display: flex;flex-direction: row;align-items: center;margin-bottom: 10px;color: #333333">-->
|
|
|
-<!-- <el-button plain icon="el-icon-arrow-left" @click="goBack">上一页</el-button>-->
|
|
|
-<!-- </el-row>-->
|
|
|
<el-button type="text" size="small" @click="goBack">
|
|
|
<i class="el-icon-back">返回上一页</i>
|
|
|
</el-button>
|
|
|
<el-card shadow="never" class="description-card">
|
|
|
- <!-- <el-button plain icon="el-icon-arrow-left" @click="goBack" style="margin-right: 20px">返回</el-button> -->
|
|
|
- <el-link
|
|
|
- target="_blank"
|
|
|
- class="commit-id description-card-text"
|
|
|
- @click.stop.prevent="copy(commitId.id)"
|
|
|
- >
|
|
|
- <span>{{ commitId }}</span>
|
|
|
- <i class="el-icon-document-copy"></i>
|
|
|
- </el-link>
|
|
|
- <div class="description-card-text">
|
|
|
- <el-row style="height: 25px; line-height: 25px">
|
|
|
- <el-col :span="2">
|
|
|
- <b>类型:</b>
|
|
|
- </el-col>
|
|
|
- <el-col :span="22">
|
|
|
+ <el-row :gutter="20">
|
|
|
+ <el-col :span="16">
|
|
|
+ <el-link
|
|
|
+ target="_blank"
|
|
|
+ class="commit-id description-card-text"
|
|
|
+ @click.stop.prevent="copy(commitId)"
|
|
|
+ >
|
|
|
+ <span>{{ commitId }}</span>
|
|
|
+ <i class="el-icon-document-copy"></i>
|
|
|
+ </el-link>
|
|
|
+ <div class="description-card-text">
|
|
|
+ <el-row style="height: 25px; line-height: 25px">
|
|
|
+ <el-col :span="2">
|
|
|
+ <b>类型:</b>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="22">
|
|
|
<span v-if="!typeEditMode">
|
|
|
<el-tag v-if="commitInfo.relatedType === 'bug_id'" class="type-line type-tag" color="chocolate" size="medium">缺陷</el-tag>
|
|
|
<el-tag v-else-if="commitInfo.relatedType === 'none'" class="type-line type-tag" color="#ccc" size="medium">无类型</el-tag>
|
|
|
@@ -30,7 +27,7 @@
|
|
|
<span v-if="commitInfo.relatedType !== 'none'" class="type-line">关联节点ID: {{commitInfo.relatedId}}</span>
|
|
|
<el-button type="primary" size="mini" class="type-line" @click="typeEditMode = true">修改关联</el-button>
|
|
|
</span>
|
|
|
- <span v-if="typeEditMode">
|
|
|
+ <span v-if="typeEditMode">
|
|
|
<el-radio v-model="relatedTypeEdit" label="TREE_ID" size="large">需求</el-radio>
|
|
|
<el-radio v-model="relatedTypeEdit" label="BUG_ID" size="large">缺陷</el-radio>
|
|
|
<el-radio v-model="relatedTypeEdit" label="NONE" size="large">空</el-radio>
|
|
|
@@ -45,52 +42,93 @@
|
|
|
<el-button type="info" size="mini" class="type-line" @click="typeEditMode = false">取消</el-button>
|
|
|
<el-button type="primary" size="mini" class="type-line" @click="saveRelated">保存</el-button>
|
|
|
</span>
|
|
|
- </el-col>
|
|
|
- </el-row>
|
|
|
- </div>
|
|
|
- <div class="description-card-text">
|
|
|
- <el-row>
|
|
|
- <el-col :span="2">
|
|
|
- <b>信息:</b>
|
|
|
- </el-col>
|
|
|
- <el-col :span="22">
|
|
|
- <span>{{ commitInfo.message }}</span>
|
|
|
- </el-col>
|
|
|
- </el-row>
|
|
|
- </div>
|
|
|
- <div class="description-card-text">
|
|
|
- <el-row>
|
|
|
- <el-col :span="2">
|
|
|
- <b>时间:</b>
|
|
|
- </el-col>
|
|
|
- <el-col :span="22">
|
|
|
- <span>{{ commitInfo.timestamp }}</span>
|
|
|
- </el-col>
|
|
|
- </el-row>
|
|
|
- </div>
|
|
|
- <div class="description-card-text">
|
|
|
- <el-row>
|
|
|
- <el-col :span="2">
|
|
|
- <b>提交人:</b>
|
|
|
- </el-col>
|
|
|
- <el-col :span="22">
|
|
|
- <span>{{ commitInfo.gitlabUsername }}</span>
|
|
|
- </el-col>
|
|
|
- </el-row>
|
|
|
- </div>
|
|
|
- <div class="description-card-text">
|
|
|
- <el-row style="height: 35px; line-height: 35px">
|
|
|
- <el-col :span="2">
|
|
|
- <b>parent:</b>
|
|
|
- </el-col>
|
|
|
- <el-col :span="22">
|
|
|
- <el-tag v-for="(parent, index) in commitInfo.parents"
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ </div>
|
|
|
+ <div class="description-card-text">
|
|
|
+ <el-row>
|
|
|
+ <el-col :span="2">
|
|
|
+ <b>信息:</b>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="22">
|
|
|
+ <span>{{ commitInfo.message }}</span>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ </div>
|
|
|
+ <div class="description-card-text">
|
|
|
+ <el-row>
|
|
|
+ <el-col :span="2">
|
|
|
+ <b>时间:</b>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="22">
|
|
|
+ <span>{{ commitInfo.timestamp }}</span>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ </div>
|
|
|
+ <div class="description-card-text">
|
|
|
+ <el-row>
|
|
|
+ <el-col :span="2">
|
|
|
+ <b>提交人:</b>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="22">
|
|
|
+ <span>{{ commitInfo.gitlabUsername }}</span>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ </div>
|
|
|
+ <div class="description-card-text" v-if="JSON.stringify(commitInfo.parents) !== '[]'">
|
|
|
+ <el-row style="height: 35px; line-height: 35px">
|
|
|
+ <el-col :span="2">
|
|
|
+ <b>parent:</b>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="22">
|
|
|
+ <el-tag v-for="(parent, index) in commitInfo.parents"
|
|
|
:key="index"
|
|
|
@click="onParentTagClick(parent)"
|
|
|
- >{{parent}}</el-tag>
|
|
|
- </el-col>
|
|
|
- </el-row>
|
|
|
- </div>
|
|
|
+ >{{parent}}</el-tag>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ </div>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="8" class="left-line">
|
|
|
+ <div v-if="commitInfo.checkResult !== 'none'">
|
|
|
+ <el-row>
|
|
|
+ <el-col :span="8">
|
|
|
+ <el-tag v-if="commitInfo.checkResult === 'pass'" type="success">
|
|
|
+ <i class="el-icon-circle-check check-pass">质量检查通过</i>
|
|
|
+ </el-tag>
|
|
|
+ <el-tag v-if="commitInfo.checkResult === 'fail'" type="danger">
|
|
|
+ <i class="el-icon-circle-close check-fail">质量检查失败</i>
|
|
|
+ </el-tag>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="8" class="quality-card-text" style="text-align: center">
|
|
|
+ {{ commitQuality.checkTime }}
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="8" class="quality-card-text" style="text-align: center">
|
|
|
+ <el-link type="primary" @click.stop.prevent="openUrl(commitQuality.resultUrl)">详细信息</el-link>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ <div>
|
|
|
+ <el-table
|
|
|
+ :data="commitQuality.qualityConditions"
|
|
|
+ height="150"
|
|
|
+ size="small"
|
|
|
+ :row-class-name="tableRowClassName">
|
|
|
+ <el-table-column prop="metric" label="指标"/>
|
|
|
+ <el-table-column prop="value" label="值" width="100"/>
|
|
|
+ <el-table-column prop="status" label="状态" width="100"/>
|
|
|
+ </el-table>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div v-else style="color: gray; font-size: small">
|
|
|
+ <el-tooltip class="item" effect="dark" placement="bottom">
|
|
|
+ <template #content>还没有这个版本的代码检查记录,如有需要请移步至流水线界面创建质量检查流水线。<br/>
|
|
|
+ 如果是JAVA代码可以使用SONAR-JAVA8模板,否则可以使用SONAR-OTHER模板。<br/>
|
|
|
+ 提交检查任务后并得到结果后,可以在这里查看。</template>
|
|
|
+ <el-tag type="info">没有质量检查结果</el-tag>
|
|
|
+ </el-tooltip>
|
|
|
+ </div>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
</el-card>
|
|
|
<el-divider content-position="left">
|
|
|
变更详情
|
|
|
@@ -184,6 +222,7 @@ export default {
|
|
|
relatedIdEdit: 1,
|
|
|
bugList: [],
|
|
|
treeList: [],
|
|
|
+ commitQuality: {},
|
|
|
};
|
|
|
},
|
|
|
computed: {
|
|
|
@@ -195,6 +234,7 @@ export default {
|
|
|
},
|
|
|
},
|
|
|
async mounted() {
|
|
|
+ this.loadCommitQuality();
|
|
|
await this.loadCommitInfo();
|
|
|
await this.loadRelatedLists();
|
|
|
},
|
|
|
@@ -232,6 +272,10 @@ export default {
|
|
|
this.bugList = await BugListAPI.getBugListByProjectId(this.$store.state.workspace.currentProjectId);
|
|
|
this.treeList = await RequirementAPI.getTasksByProjectId(this.$store.state.workspace.currentProjectId);
|
|
|
},
|
|
|
+ async loadCommitQuality() {
|
|
|
+ this.commitQuality = await ProjectAPI.getQualityByCommit(this.projectId, this.commitId);
|
|
|
+ this.commitQuality.checkTime = formatter(this.commitQuality.checkTime);
|
|
|
+ },
|
|
|
drawDiffHtml() {
|
|
|
// this.diffString = this.diff[this.currentParentIndex][0].diff;
|
|
|
this.diffString = this.currentFileRow.diff;
|
|
|
@@ -273,6 +317,18 @@ export default {
|
|
|
await this.loadCommitInfo();
|
|
|
this.typeEditMode = false;
|
|
|
},
|
|
|
+ openUrl(url) {
|
|
|
+ window.open(url, '_blank');
|
|
|
+ },
|
|
|
+ tableRowClassName({
|
|
|
+ row,
|
|
|
+ rowIndex,
|
|
|
+ }) {
|
|
|
+ if (row.status === 'OK') {
|
|
|
+ return 'success-row';
|
|
|
+ }
|
|
|
+ return 'warning-row';
|
|
|
+ },
|
|
|
},
|
|
|
};
|
|
|
</script>
|
|
|
@@ -294,6 +350,18 @@ export default {
|
|
|
margin-top: 8px;
|
|
|
}
|
|
|
|
|
|
+.quality-card-text {
|
|
|
+ margin-top: 10px;
|
|
|
+ font-size: small;
|
|
|
+}
|
|
|
+
|
|
|
+/deep/ .el-table .warning-row{
|
|
|
+ background: #fde2e2;
|
|
|
+}
|
|
|
+/deep/ .el-table .success-row {
|
|
|
+ background: #e1f3d8;
|
|
|
+}
|
|
|
+
|
|
|
.commit-id {
|
|
|
font-size: 18px;
|
|
|
font-weight: bold;
|
|
|
@@ -316,6 +384,16 @@ export default {
|
|
|
.requirement {
|
|
|
background-color: #42b983;
|
|
|
}
|
|
|
+.check-pass {
|
|
|
+ color: green;
|
|
|
+}
|
|
|
+.check-fail {
|
|
|
+ color: red;
|
|
|
+}
|
|
|
+.left-line {
|
|
|
+ border-left-style: solid;
|
|
|
+ border-left-color: lightgrey;
|
|
|
+}
|
|
|
.type-line{
|
|
|
margin: 0;
|
|
|
margin-right: 20px;
|