|
|
@@ -0,0 +1,114 @@
|
|
|
+<template>
|
|
|
+ <div class="custom-card">
|
|
|
+ <div class="state" :class="stateClass">{{stateMessage}}</div>
|
|
|
+ <div class="branch">
|
|
|
+ <p>所属分支</p>
|
|
|
+ <p>{{branchId}}</p>
|
|
|
+ </div>
|
|
|
+ <div v-if="buildState" class="mirror">
|
|
|
+ <p>所属镜像</p>
|
|
|
+ <p>{{mirrorId}}</p>
|
|
|
+ </div>
|
|
|
+ <div class="message">
|
|
|
+ <p>commit message</p>
|
|
|
+ <div>{{commitMessage}}</div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+export default {
|
|
|
+ name: "ProjectBuildCard",
|
|
|
+ props: {
|
|
|
+ buildId: {
|
|
|
+ type: Number,
|
|
|
+ default: 0
|
|
|
+ },
|
|
|
+ buildState: {
|
|
|
+ type: Number,
|
|
|
+ default: 0
|
|
|
+ },
|
|
|
+ branchId: {
|
|
|
+ type: Number,
|
|
|
+ default: 2131242345
|
|
|
+ },
|
|
|
+ commitMessage: {
|
|
|
+ type: String,
|
|
|
+ default: "commit"
|
|
|
+ },
|
|
|
+ buildMessage: {
|
|
|
+ type: String,
|
|
|
+ default: "build"
|
|
|
+ },
|
|
|
+ mirrorId: {
|
|
|
+ type: Number,
|
|
|
+ default: 0
|
|
|
+ }
|
|
|
+ },
|
|
|
+ computed: {
|
|
|
+ stateMessage() {
|
|
|
+ switch (this.buildState) {
|
|
|
+ case 0:
|
|
|
+ return "构建中";
|
|
|
+ case 1:
|
|
|
+ return "构建成功";
|
|
|
+ case -1:
|
|
|
+ return "构建失败";
|
|
|
+ default:
|
|
|
+ return "构建中";
|
|
|
+ }
|
|
|
+ },
|
|
|
+ stateClass() {
|
|
|
+ switch (this.buildState) {
|
|
|
+ case 0:
|
|
|
+ return "process";
|
|
|
+ case 1:
|
|
|
+ return "success";
|
|
|
+ case -1:
|
|
|
+ return "fail";
|
|
|
+ default:
|
|
|
+ return "process";
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+};
|
|
|
+</script>
|
|
|
+
|
|
|
+<style lang="scss" scoped>
|
|
|
+@import "../../assets/scss/app";
|
|
|
+.custom-card {
|
|
|
+ width: 100%;
|
|
|
+ height: 100%;
|
|
|
+ position: relative;
|
|
|
+ background: #ffffff;
|
|
|
+ box-shadow: $default-shadow;
|
|
|
+ border-radius: $default-radius;
|
|
|
+ color: #152935;
|
|
|
+ border: $default-border;
|
|
|
+ .state {
|
|
|
+ max-width: 100%;
|
|
|
+ text-align: center;
|
|
|
+ }
|
|
|
+ .process {
|
|
|
+ background-color: $yellow;
|
|
|
+ }
|
|
|
+ .success {
|
|
|
+ background-color: $green;
|
|
|
+ }
|
|
|
+ .fail {
|
|
|
+ background-color: $orange;
|
|
|
+ }
|
|
|
+ .branch {
|
|
|
+ display: flex;
|
|
|
+ justify-content: space-between;
|
|
|
+ padding: 10px;
|
|
|
+ }
|
|
|
+ .mirror {
|
|
|
+ display: flex;
|
|
|
+ justify-content: space-between;
|
|
|
+ padding: 10px;
|
|
|
+ }
|
|
|
+ .message {
|
|
|
+ }
|
|
|
+}
|
|
|
+</style>
|