|
|
@@ -0,0 +1,155 @@
|
|
|
+<template>
|
|
|
+ <div class="columns is-desktop">
|
|
|
+ <div class="column">
|
|
|
+ <div v-if="detailLoading"><page-section-loading show /></div>
|
|
|
+ <div v-else class="page-section">
|
|
|
+ <h5 class="title is-5">机器学习测试:</h5>
|
|
|
+ <router-link
|
|
|
+ class="test-item"
|
|
|
+ :key="item.id"
|
|
|
+ :to="`${$route.path}/unit/${item.id}`"
|
|
|
+ v-for="item in dlTestList"
|
|
|
+ tag="div"
|
|
|
+ >
|
|
|
+ <div><strong>准确率测试 : #</strong> {{ item.id }}</div>
|
|
|
+ <span>准确率 : </span>
|
|
|
+ <div class="tag is-success" style="width: 40px;height:1.5em">
|
|
|
+ <strong style="color: white;">{{
|
|
|
+ item.accuracy ? item.accuracy : "100%"
|
|
|
+ }}</strong>
|
|
|
+ </div>
|
|
|
+ <br />
|
|
|
+ <span>得分 : </span>
|
|
|
+ <strong>{{ item.score ? item.score : "100" }}</strong
|
|
|
+ ><br />
|
|
|
+ <span>{{ displayUnixTime(item.time) }}</span>
|
|
|
+ </router-link>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <!--<div class="column">-->
|
|
|
+ <!--<div v-if="detailLoading"><page-section-loading show /></div>-->
|
|
|
+ <!--<div v-else class="page-section">-->
|
|
|
+ <!--<h5 class="test-title title is-5">-->
|
|
|
+ <!--页面测试:-->
|
|
|
+ <!--<div-->
|
|
|
+ <!--v-if="functionTestList && functionTestList.length > 0"-->
|
|
|
+ <!--:class="{ 'is-loading': testing }"-->
|
|
|
+ <!--@click="makeTest"-->
|
|
|
+ <!--class="button is-primary test-title__action"-->
|
|
|
+ <!-->-->
|
|
|
+ <!--触发测试-->
|
|
|
+ <!--</div>-->
|
|
|
+ <!--</h5>-->
|
|
|
+ <!--<router-link-->
|
|
|
+ <!--class="test-item"-->
|
|
|
+ <!--:key="item.id"-->
|
|
|
+ <!--:to="`${$route.path}/functional/${item.id}`"-->
|
|
|
+ <!--v-for="item in functionTestList"-->
|
|
|
+ <!--tag="div"-->
|
|
|
+ <!-->-->
|
|
|
+ <!--<div><strong>FUNCTIONAL TEST : #</strong> {{ item.id }}</div>-->
|
|
|
+ <!--<pass-tag :pass="item.isPassAll" />-->
|
|
|
+ <!--<span style="padding-left: 10px">{{-->
|
|
|
+ <!--displayUnixTime(item.time)-->
|
|
|
+ <!--}}</span>-->
|
|
|
+ <!--</router-link>-->
|
|
|
+ <!--</div>-->
|
|
|
+ <!--</div>-->
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+import timeMixins from "@/mixins/time";
|
|
|
+// import { makeFunctionalTest } from "@/api/codehw";
|
|
|
+import PageSectionLoading from "@/components/PageBody/PageSectionLoading/index";
|
|
|
+
|
|
|
+export default {
|
|
|
+ components: { PageSectionLoading },
|
|
|
+ props: {
|
|
|
+ projectDetail: {
|
|
|
+ type: Object,
|
|
|
+ default: () => ({
|
|
|
+ dlTestList: []
|
|
|
+ })
|
|
|
+ },
|
|
|
+ detailLoading: {
|
|
|
+ type: Boolean,
|
|
|
+ default: false
|
|
|
+ }
|
|
|
+ },
|
|
|
+ computed: {
|
|
|
+ dlTestList() {
|
|
|
+ return this.sortTestList(this.projectDetail.dlTestList);
|
|
|
+ }
|
|
|
+ },
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ testing: false
|
|
|
+ };
|
|
|
+ },
|
|
|
+ mixins: [timeMixins],
|
|
|
+ methods: {
|
|
|
+ // async makeTest() {
|
|
|
+ // const { functionTestList } = this;
|
|
|
+ // if (functionTestList && functionTestList.length > 0) {
|
|
|
+ // this.testing = true;
|
|
|
+ // const { deployId } = functionTestList[0];
|
|
|
+ // const { homeworkId, projectId } = this.$route.params;
|
|
|
+ // const { data } = await makeFunctionalTest({
|
|
|
+ // homeworkId,
|
|
|
+ // projectId,
|
|
|
+ // deployId
|
|
|
+ // });
|
|
|
+ // this.testing = false;
|
|
|
+ // if (data.success) {
|
|
|
+ // this.$toast.open({
|
|
|
+ // message: `测试触发成功`,
|
|
|
+ // type: "is-success"
|
|
|
+ // });
|
|
|
+ // } else {
|
|
|
+ // this.$toast.open({
|
|
|
+ // message: `测试触发失败`,
|
|
|
+ // type: "is-danger"
|
|
|
+ // });
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // },
|
|
|
+ sortTestList(list) {
|
|
|
+ console.log(list);
|
|
|
+ if (!list) return [];
|
|
|
+ const copyList = list.slice(0);
|
|
|
+ copyList.sort((a, b) => b.time - a.time);
|
|
|
+ return copyList;
|
|
|
+ }
|
|
|
+ }
|
|
|
+};
|
|
|
+</script>
|
|
|
+
|
|
|
+<style lang="scss" scoped>
|
|
|
+@import "../../../assets/scss/app";
|
|
|
+
|
|
|
+.test-item {
|
|
|
+ padding: $default-margin $default-margin-between;
|
|
|
+ margin: 0 -#{$default-margin-between};
|
|
|
+ cursor: pointer;
|
|
|
+}
|
|
|
+
|
|
|
+.test-title {
|
|
|
+ position: relative;
|
|
|
+
|
|
|
+ &__action {
|
|
|
+ position: absolute;
|
|
|
+ right: 0;
|
|
|
+ transform: translateY(-20%);
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+.test-item:hover,
|
|
|
+.test-item:nth-child(even):hover {
|
|
|
+ background-color: #dde3ef;
|
|
|
+}
|
|
|
+
|
|
|
+.test-item:nth-child(even) {
|
|
|
+ background-color: rgba(244, 247, 252, 0.6);
|
|
|
+}
|
|
|
+</style>
|