|
|
@@ -0,0 +1,118 @@
|
|
|
+<template>
|
|
|
+ <div>
|
|
|
+ <div v-if="detailLoading"><page-section-loading show /></div>
|
|
|
+ <div v-else>
|
|
|
+ <!--空数据处理-->
|
|
|
+ <div
|
|
|
+ class="page-section"
|
|
|
+ v-if="!(dlDetail.buildList && dlDetail.buildList.length > 0)"
|
|
|
+ style="height: 60vh;"
|
|
|
+ >
|
|
|
+ <no-data-svg></no-data-svg>
|
|
|
+ </div>
|
|
|
+ <div
|
|
|
+ v-for="(item, index) in dlDetail.buildList"
|
|
|
+ :key="item.id"
|
|
|
+ class="gap-section"
|
|
|
+ >
|
|
|
+ <div class="page-section">
|
|
|
+ <div class="level">
|
|
|
+ <div class="level-left">
|
|
|
+ <build-tag :build-state="item.buildState" />
|
|
|
+ <strong style="padding-left: 10px">
|
|
|
+ {{ item.commitMessage }} · #构建ID:{{ item.id }}
|
|
|
+ </strong>
|
|
|
+ </div>
|
|
|
+ <div class="level-right">
|
|
|
+ <strong>完成时间:{{ item.buildTime }}</strong>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="level">
|
|
|
+ <div class="level-left">
|
|
|
+ <strong style="padding-left: 10px">
|
|
|
+ #branchID:{{ item.branchId }}
|
|
|
+ </strong>
|
|
|
+ </div>
|
|
|
+ <div v-if="item.buildState === 1" class="level-right">
|
|
|
+ <strong>mirror : {{ item.mirrorId }}</strong>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <a
|
|
|
+ class="button is-info is-small"
|
|
|
+ @click="changeBuildMessageStatus(index)"
|
|
|
+ aria-controls="contentIdForA11y2"
|
|
|
+ >查看详细编译信息</a
|
|
|
+ >
|
|
|
+ <div class="code-section" v-show="buildMessageIsOpen[index]">
|
|
|
+ <p v-html="item.buildMessage"></p>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+import PageSectionLoading from "@/components/PageBody/PageSectionLoading/index";
|
|
|
+import BuildTag from "@/views/student/DlWork/components/BuildTag";
|
|
|
+import NoDataSvg from "@/components/NoDataSvg";
|
|
|
+export default {
|
|
|
+ name: "BuildDetail",
|
|
|
+ components: { BuildTag, PageSectionLoading, NoDataSvg },
|
|
|
+ props: {
|
|
|
+ dlDetail: {
|
|
|
+ type: Object,
|
|
|
+ default: () => {}
|
|
|
+ },
|
|
|
+ detailLoading: {
|
|
|
+ type: Boolean,
|
|
|
+ default: false
|
|
|
+ }
|
|
|
+ },
|
|
|
+ computed: {},
|
|
|
+ watch: {
|
|
|
+ dlDetail: function(newVal) {
|
|
|
+ let buildMessageIsOpen = [];
|
|
|
+ for (let i = 0; i < newVal.buildList.length; i++) {
|
|
|
+ let buildInfo = newVal.buildList[i];
|
|
|
+ buildInfo.buildTime = buildInfo.buildTime.replace("T", " ") + "ms";
|
|
|
+ buildMessageIsOpen.push(false);
|
|
|
+ this.dlDetail.buildList[i] = buildInfo;
|
|
|
+ }
|
|
|
+ this.buildMessageIsOpen = buildMessageIsOpen;
|
|
|
+ }
|
|
|
+ },
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ buildMessageIsOpen: [],
|
|
|
+ testBuildMessage: "测试换行<br>第一行<br>第二行<br>"
|
|
|
+ };
|
|
|
+ },
|
|
|
+ mounted() {},
|
|
|
+ methods: {
|
|
|
+ changeBuildMessageStatus(index) {
|
|
|
+ let status = !this.buildMessageIsOpen[index];
|
|
|
+ this.buildMessageIsOpen.splice(index, 1, status);
|
|
|
+ }
|
|
|
+ }
|
|
|
+};
|
|
|
+</script>
|
|
|
+
|
|
|
+<style lang="scss" scoped>
|
|
|
+@import "../../../../assets/scss/app";
|
|
|
+.gap-section {
|
|
|
+ padding-bottom: $default-margin-between;
|
|
|
+}
|
|
|
+
|
|
|
+.gap-section:last-child {
|
|
|
+ padding-bottom: 0;
|
|
|
+}
|
|
|
+
|
|
|
+.code-section {
|
|
|
+ margin: $default-margin-between -#{$default-margin-between} -#{$default-margin-between};
|
|
|
+ padding: $default-margin-between;
|
|
|
+ background-color: #2d3044;
|
|
|
+ color: #cacff1;
|
|
|
+ white-space: pre-line;
|
|
|
+}
|
|
|
+</style>
|