whychdw
2021-05-26 c04bbbbe82d0f1ee4bd01ba2ca9f2b3c0b71425e
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
<template>
    <el-dialog
        :visible.sync="visible" class="position-absolute dialog-center dialog-no-header" width="560px"
        top="0" :modal="false" :destroy-on-close="true" :close-on-press-escape="false" :close-on-click-modal="false"
        :modal-append-to-body="false">
        <div class="params-container params-container-flex">
            <div class="form-title">
                试验完成
            </div>
            <div class="form-wrapper">
                <div class="form-content">
                    <img src="../images/u10489.svg">
                    <div class="form-text">{{ testLabel }}已完成</div>
                </div>
            </div>
            <div class="footer-button">
                <el-button size="small">试验数据回放</el-button>
                <el-button type="primary" size="small" >查看试验数据</el-button>
                <el-button type="primary" size="small" @click="newTest">开启新试验</el-button>
            </div>
        </div>
    </el-dialog>
</template>
 
<script>
import {constTestType} from "@/pages/test/js/const";
import {getItemByValue, getLabel} from "@/assets/js/tools";
 
export default {
    name: "completeTestDialog",
    props: {
        type: {
            type: String,
            default: ""
        },
        visible: {
            type: Boolean,
            default: false,
        }
    },
    data() {
        return {
            testLabel: "",
            testUrl: "",
        }
    },
    methods: {
        newTest() {
            this.$router.push("/index/testManager");
        }
    },
    mounted() {
        let item = getItemByValue(this.type, constTestType);
        if(item != -1) {
            this.testLabel = item.label;
            this.testUrl = item.router;
        }else {
            this.testLabel = "未知";
            this.testUrl = "";
        }
 
    }
}
</script>
 
<style scoped>
.params-container {
    padding: 0;
}
.form-title {
    line-height: 50px;
    background-color: rgba(102, 110, 232, 1);
    color: #FFFFFF;
    text-align: center;
}
.form-wrapper {
    padding: 8px;
}
.form-content {
    text-align: center;
}
.form-content img{
    width: 285px;
    height: auto;
}
.form-text {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 32px;
}
.footer-button {
    border-top: 1px solid #cccccc;
}
</style>