1
yangpeixing
9 天以前 3425c6c10844112bc52f71c6a76522c47aff3a6c
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
<template>
    <div class="button-example">
        <div class="button-row">
            <el-button type="success" class="elevatorbtn" @click="startElevator()">
                <span class="text">
                    启动
                </span>
            </el-button>
            <el-button type="danger" class="elevatorbtn" @click="stopElevator()">
                <span class="text">
                    停止
                </span>
            </el-button>
            <el-button type="warning" class="elevatorbtn" @click="ResetElevator()">
                <span class="text">
                    复位
                </span>
            </el-button>
            <el-button type="primary" class="elevatorbtn" @click="initialzationElevator()">
                <span class="text">
                    初始化
                </span>
            </el-button>
        </div>
    </div>
</template>
<script>
export default {
    data() {
        return {
            show: false
        }
    },
    methods: {
        startElevator() {
            this.http.post(`http://10.31.3.241:9291/api/Elevator/startElevator`)
                .then((x) => {
                    if (!x.status) {
                        this.$message.error(x.message)
                    } else {
                        console.log(x);
                        this.show = false
                        this.$Message.success('启动成功')
                        $vue.refresh();
                    }
                })
        },
        stopElevator() {
            this.http.post(`http://10.31.3.241:9291/api/Elevator/stopElevator`)
                .then((x) => {
                    if (!x.status) {
                        this.$message.error(x.message)
                    } else {
                        console.log(x);
                        this.show = false
                        this.$Message.success('停止成功')
                        $vue.refresh();
                    }
                })
        },
        ResetElevator() {
            this.http.post(`http://10.31.3.241:9291/api/Elevator/ResetElevator`)
                .then((x) => {
                    if (!x.status) {
                        this.$message.error(x.message)
                    } else {
                        console.log(x);
                        this.show = false
                        this.$Message.success('复位成功')
                        $vue.refresh();
                    }
                })
        },
        initialzationElevator() {
            this.http.post(`http://10.31.3.241:9291/api/Elevator/initialization`)
                .then((x) => {
                    if (!x.status) {
                        this.$message.error(x.message)
                    } else {
                        console.log(x);
                        this.show = false
                        this.$Message.success('初始化成功')
                        $vue.refresh();
                    }
                })
        }
    }
}
</script>
<style>
.elevatorbtn {
    width: 13rem;
    height: 7rem;
    margin-right: 30px;
}
 
.text {
    font-size: 50px;
}
 
.button-example {
    width: 100%;
    display: flex;
    justify-content: center;
    padding-top: 17rem;
}
</style>