|
|
@@ -4,16 +4,16 @@
|
|
|
<i class="el-icon-back">返回上一页</i>
|
|
|
</el-button>
|
|
|
<el-card shadow="never" class="description-card">
|
|
|
- <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>
|
|
|
<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">
|
|
|
@@ -75,7 +75,7 @@
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
</div>
|
|
|
- <div class="description-card-text">
|
|
|
+ <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>
|
|
|
@@ -91,31 +91,32 @@
|
|
|
</el-col>
|
|
|
<el-col :span="8" class="left-line">
|
|
|
<div v-if="commitInfo.checkResult !== 'none'">
|
|
|
- <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>
|
|
|
- <div class="description-card-text">
|
|
|
- <el-row>
|
|
|
- <el-col :span="6">
|
|
|
- <b>时间</b>
|
|
|
- </el-col>
|
|
|
- <el-col :span="18">
|
|
|
- <span>{{ commitQuality.checkTime }}</span>
|
|
|
- </el-col>
|
|
|
- </el-row>
|
|
|
- </div>
|
|
|
- <div class="description-card-text">
|
|
|
- <el-row>
|
|
|
- <el-col :span="6">
|
|
|
- <b>详细结果</b>
|
|
|
- </el-col>
|
|
|
- <el-col :span="18">
|
|
|
- <el-link @click.stop.prevent="openUrl(commitQuality.resultUrl)">{{commitQuality.resultUrl}}</el-link>
|
|
|
- </el-col>
|
|
|
- </el-row>
|
|
|
+ <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">
|
|
|
+ {{ commitQuality.checkTime }}
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="8" class="quality-card-text">
|
|
|
+ <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">
|
|
|
@@ -273,6 +274,7 @@ export default {
|
|
|
},
|
|
|
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;
|
|
|
@@ -318,6 +320,15 @@ export default {
|
|
|
openUrl(url) {
|
|
|
window.open(url, '_blank');
|
|
|
},
|
|
|
+ tableRowClassName({
|
|
|
+ row,
|
|
|
+ rowIndex,
|
|
|
+ }) {
|
|
|
+ if (row.status === 'OK') {
|
|
|
+ return 'success-row';
|
|
|
+ }
|
|
|
+ return 'warning-row';
|
|
|
+ },
|
|
|
},
|
|
|
};
|
|
|
</script>
|
|
|
@@ -339,6 +350,18 @@ export default {
|
|
|
margin-top: 8px;
|
|
|
}
|
|
|
|
|
|
+.quality-card-text {
|
|
|
+ margin-top: 10px;
|
|
|
+ font-size: small;
|
|
|
+}
|
|
|
+
|
|
|
+.el-table .warning-row{
|
|
|
+ background: #fab6b6;
|
|
|
+}
|
|
|
+.el-table .success-row {
|
|
|
+ background: #b3e19d;
|
|
|
+}
|
|
|
+
|
|
|
.commit-id {
|
|
|
font-size: 18px;
|
|
|
font-weight: bold;
|