chengsc
2025-04-28 25f52fdb9a195ab651bff2ebb318119ce7f1f633
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
<template>
    <el-row :gutter="10">
        <el-col :span="12">
            <el-collapse v-model="activeNames">
                <el-collapse-item title="仓库一层" name="1">
                    <el-card class="box-card" shadow="hover">
                        <el-text style="margin-right: 15px;">1号穿梭车</el-text>
                        <el-button @click="write('ShuttleCar', '1', '41093', '1')">复位</el-button>
                        <el-button @click="write('ShuttleCar', '1', '41096', '1')">正向寻码</el-button>
                        <el-button @click="write('ShuttleCar', '1', '41096', '2')">反向寻码</el-button>
                    </el-card>
                    <el-card class="box-card" shadow="hover">
                        <el-text style="margin-right: 15px;">2号穿梭车</el-text>
                        <el-button @click="write('ShuttleCar', '2', '41093', '1')">复位</el-button>
                        <el-button @click="write('ShuttleCar', '2', '41096', '1')">正向寻码</el-button>
                        <el-button @click="write('ShuttleCar', '2', '41096', '2')">反向寻码</el-button>
                    </el-card>
                </el-collapse-item>
            </el-collapse>
        </el-col>
 
        <el-col :span="12">
            <el-collapse v-model="activeNames2">
                <el-collapse-item title="仓库二层" name="2">
                    <el-card class="box-card" shadow="hover" style="margin-top: 3px;">
                        <el-text style="margin-right: 15px;">卷帘门2</el-text>
                        <el-button @click="writeUp('Shutter', '2')">打开</el-button>
                        <el-button @click="writeDown('Shutter', '2')">关闭</el-button>
                    </el-card>
                    <el-card class="box-card" shadow="hover" style="margin-top: 3px;">
                        <el-text style="margin-right: 15px;">卷帘门3</el-text>
                        <el-button @click="writeUp('Shutter', '3')">打开</el-button>
                        <el-button @click="writeDown('Shutter', '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 state = ref<any>({});
 
const write = async (type: string, no: string, layer: string, FuncName: string) => {
 
    var data = {
        Type: type,
        No: no,
        Layer: layer,
        FuncName: FuncName
    };
 
    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: "Down"
    }
    var res = await WriteStartStop(data);
}
const writeUp = async (type: string, layer: string) => {
 
    var data = {
        Type: type,
        Layer: layer,
        FuncName: "Up"
    }
    var res = await WriteStartStop(data);
}
 
</script>
 
<style scoped>
.layout-parent>div:first-child {
    flex-direction: row;
}
</style>