IPC-610
2024-10-31 9b85a8b67aa6354ee9ea1a13c5799bf1c934922f
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
<template> 
    <el-row :gutter="10">
        <el-col :span="8">
            <el-collapse v-model="activeNames">
                <el-collapse-item title="仓库一层" name="1">
                    <el-card class="box-card" shadow="hover">
                        <el-text style="margin-right: 15px;">托盘输送</el-text>
                        <el-button @click="write('OnePalletStart','1')">启动</el-button>
                        <el-button @click="write('OnePalletStop','1')">停止</el-button>
                    </el-card>
                    <el-card class="box-card" shadow="hover" style="margin-top: 3px;">
                        <el-text style="margin-right: 15px;">拆跺机器人1</el-text>
                        <el-button @click="write('OneChaiStart','1')">启动</el-button>
                        <el-button @click="write('OneChaiStop','1')">停止</el-button>
                    </el-card> 
                    
                    <el-card class="box-card" shadow="hover" style="margin-top: 3px;">
                        <el-text style="margin-right: 15px;">拆跺机器人2</el-text>
                        <el-button @click="write('OneChaiTwoStart','1')">启动</el-button>
                        <el-button @click="write('OneChaiTwoStop','1')">停止</el-button>
                    </el-card> 
                    <el-card class="box-card" shadow="hover" style="margin-top: 3px;">
                        <el-text style="margin-right: 15px;">件箱输送</el-text>
                        <el-button @click="write('OneBoxStart','1')">启动</el-button>
                        <el-button @click="write('OneBoxStop','1')">停止</el-button>
                    </el-card> 
                </el-collapse-item>
            </el-collapse> 
        </el-col>
        
        <el-col :span="8">
            <el-collapse v-model="activeNames2">
                <el-collapse-item title="仓库二层" name="2">
                    <el-card class="box-card" shadow="hover">
                        <el-text style="margin-right: 15px;">托盘输送</el-text>
                        <el-button  @mousedown="writeDown('TwoPalletStart','2')"  @mouseup="writeUp('TwoPalletStart','2')">启动</el-button>
                        <el-button  @mousedown="writeDown('TwoPalletStop','2')"  @mouseup="writeUp('TwoPalletStop','2')">停止</el-button>
                    </el-card>
                    <el-card class="box-card" shadow="hover" style="margin-top: 3px;">
                        <el-text style="margin-right: 15px;">码跺机器人1</el-text>
                        <el-button @mousedown="writeDown('TwoMaStart','2')"  @mouseup="writeUp('TwoMaStart','2')">启动</el-button>
                        <el-button @mousedown="writeDown('TwoMaStop','2')"  @mouseup="writeUp('TwoMaStop','2')">停止</el-button>
                    </el-card> 
                    
                    <el-card class="box-card" shadow="hover" style="margin-top: 3px;">
                        <el-text style="margin-right: 15px;">码跺机器人2</el-text>
                        <el-button @mousedown="writeDown('TwoMaTwoStart','2')"  @mouseup="writeUp('TwoMaTwoStart','2')">启动</el-button>
                        <el-button @mousedown="writeDown('TwoMaTwoStop','2')"  @mouseup="writeUp('TwoMaTwoStop','2')">停止</el-button>
                    </el-card> 
                    <el-card class="box-card" shadow="hover" style="margin-top: 3px;">
                        <el-text style="margin-right: 15px;">件箱输送</el-text>
                        <el-button @mousedown="writeDown('TwoBoxStart','2')"  @mouseup="writeUp('TwoBoxStart','2')">启动</el-button>
                        <el-button @mousedown="writeDown('TwoBoxStop','2')"  @mouseup="writeUp('TwoBoxStop','2')">停止</el-button>
                    </el-card> 
                </el-collapse-item>
            </el-collapse>
        </el-col>
 
        <el-col :span="8">
            <el-collapse v-model="activeNames3">
                <el-collapse-item title="仓库三层" name="3">
                    <el-card class="box-card" shadow="hover" style="margin-top: 3px;">
                        <el-text style="margin-right: 15px;">托盘输送</el-text>
                        <el-button @click="write('ThreePalletStart','3')">启动</el-button>
                        <el-button @click="write('ThreePalletStop','3')">停止</el-button>
                    </el-card>
                </el-collapse-item>
            </el-collapse>
        </el-col>
 
    </el-row>
    
</template>
 
<script lang="ts" setup>
 
 
import { ref, reactive, onMounted } from 'vue';
import { listStatus, listPosition } from '/@/api/wcs/wcsPlc';
import { WriteStartStop } from '/@/api/wcs/wcsDevice';
import { ElMessage } from "element-plus";
 
const activeNames = ref(['1'])
const activeNames2 = ref(['2'])
const activeNames3= ref(['3'])
 
const state = ref<any>({});
 
const write = async (type: string,layer: string) => {
     
    var data = {
        Type:type,
        Layer: layer
    };
    
    var res = await WriteStartStop(data);
    console.log(res.data.result);
    // ElMessage.success(res.data.result);
}
const writeDown = async (type: string,layer: string) => {
    
    var data={
        Type:type,
        Layer: layer,
        FuncName : "true"
    }
    var res = await WriteStartStop(data);
    console.log(type+"按下事件");
    
}
const writeUp = async (type: string,layer: string) => {
    
    var data={
        Type:type,
        Layer: layer,
        FuncName : "false"
    }
    var res = await WriteStartStop(data);
    console.log(type+"抬起事件");
    
}
 
</script>
 
<style scoped>
 
.layout-parent > div:first-child{
    flex-direction:row;
}
 
</style>