whychdw
2021-06-03 2baa58f9515a661d53118344e237e3441300b24f
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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
<template>
    <div class="params-container params-container-flex">
        <div class="form-title">
            试验步骤结果
        </div>
        <div class="form-wrapper">
            <el-form ref="ruleForm" class="params-dialog" label-width="100px" size="small">
                <div class="test-explain">
                    <p class="p-h">当前已完成步骤</p>
                    <p class="text-indent-two">② 在{{ point.name }},测取三相线电流,输入功率,输出功率或者输出载距,转速,定子绕组,直流电阻或温度</p>
                    <div class="point-wrapper">
                        <el-row :gutter="16">
                            <el-col :span="9">
                                <el-form-item :label="point.name" class="more-input">
                                    <el-input placeholder="" :value="point.percentage">
                                        <template slot="append">%</template>
                                    </el-input>
                                    <el-input placeholder="" :value="point.duration">
                                        <template slot="append">min</template>
                                    </el-input>
                                </el-form-item>
                            </el-col>
                        </el-row>
                    </div>
                    <p class="p-h">当前结果</p>
                    <el-row :gutter="layout.gutter">
                        <el-col :span="layout.span">
                            <el-form-item label="电机电流">
                                <el-input placeholder="" :value="params.curr">
                                    <template slot="append">A</template>
                                </el-input>
                            </el-form-item>
                        </el-col>
                        <el-col :span="layout.span">
                            <el-form-item label="电机电压">
                                <el-input placeholder="" :value="params.curr">
                                    <template slot="append">V</template>
                                </el-input>
                            </el-form-item>
                        </el-col>
                    </el-row>
                    <el-row :gutter="layout.gutter">
                        <el-col :span="layout.span">
                            <el-form-item label="输入功率">
                                <el-input placeholder="" :value="params.inPower">
                                    <template slot="append">W</template>
                                </el-input>
                            </el-form-item>
                        </el-col>
                        <el-col :span="layout.span">
                            <el-form-item label="输出功率">
                                <el-input placeholder="" :value="params.outPower">
                                    <template slot="append">W</template>
                                </el-input>
                            </el-form-item>
                        </el-col>
                    </el-row>
                    <el-row :gutter="layout.gutter">
                        <el-col :span="layout.span">
                            <el-form-item label="直流电阻">
                                <el-input placeholder="" :value="params.res">
                                    <template slot="append">Ω</template>
                                </el-input>
                            </el-form-item>
                        </el-col>
                        <el-col :span="layout.span">
                            <el-form-item label="当前定子温度">
                                <el-input placeholder="" :value="params.temp">
                                    <template slot="append">℃</template>
                                </el-input>
                            </el-form-item>
                        </el-col>
                    </el-row>
                </div>
            </el-form>
        </div>
        <div class="footer-button">
            <el-button type="primary" size="small" @click="preStep">重做当前步骤</el-button>
            <el-button type="primary" size="small" @click="completeTest" v-if="end">完成试验</el-button>
            <el-button type="primary" size="small" @click="nextStep" v-else>开始下一步</el-button>
        </div>
    </div>
</template>
 
<script>
import {redoTestPoint} from "@/pages/test/js/api";
 
export default {
    name: "pointResultTest",
    props: {
        point: {
            type: Object,
            default() {
                return {
                    duration: 0,
                    name: '',
                    percentage: 0,
                }
            }
        },
        end: {
            type: Boolean,
            default: false,
        },
    },
    data() {
        return {
            layout: {
                gutter: 16,
                span: 8,
            },
            params: {
                curr: 10,
                vol: 500,
                inPower: 5000,
                outPower: 5000,
                res: 45,
                temp: 40
            }
        }
    },
    methods: {
        nextStep() {
            this.$emit('nextStep');
        },
        preStep() {
            this.$confirm("确定重做当前步骤", "系统提示", {
                type: "warning",
            }).then(()=>{
                let point = this.point;
                redoTestPoint(point.id).then(res=>{
                    let rs = res.data;
                    if(rs.code == 1) {
                        this.$emit('preStep');
                    }
                    this.$layer.msg(rs.msg);
                }).catch(error=>{
                    console.log(error);
                });
            }).catch(error=>{
 
            });
 
        },
        completeTest() {
            this.$emit('completeTest', this.point);
        }
    }
}
</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;
}
 
.p-h {
    font-size: 18px;
    font-weight: 700;
}
</style>