wxw
1 天以前 6b2ec7bd05459ddb4ea99df00267dbfda49cbdc7
Web/src/views/device/deviceStartStop/index.vue
@@ -5,15 +5,18 @@
                <el-collapse-item title="仓库一层" name="1">
                    <el-card class="box-card" shadow="hover">
                        <el-text style="margin-right: 15px;">1号穿梭车</el-text>
                        <el-text style="margin-right: 15px;">电量:{{carDL1}}</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-text style="margin-right: 15px;">电量:{{carDL2}}</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-button @click="write('ShuttleCar', '2', '41096', '2')">反向寻码</el-button>
                    </el-card>
                </el-collapse-item>
            </el-collapse>
@@ -45,12 +48,32 @@
import { ref, reactive, onMounted } from 'vue';
import { listStatus, listPosition } from '/@/api/wcs/wcsPlc';
import { WriteStartStop } from '/@/api/wcs/wcsDevice';
import { WriteStartStop,GetCarDL } from '/@/api/wcs/wcsDevice';
import { ElMessage } from "element-plus";
const carDL1= ref<any>({});
carDL1.value="获取中..";
const carDL2= ref<any>({});
carDL2.value="获取中..";
const activeNames = ref(['1'])
const activeNames2 = ref(['2'])
const state = ref<any>({});
const handleQuery = async () => {
   var resCar = await GetCarDL();
    if (resCar.data.result._dicList && resCar.data.result._dicList.length > 0) {
       resCar.data.result._dicList.forEach(car => {
            const name = Object.keys(car)[0];
            if(name=="穿梭车1"){
                carDL1.value=car[name]+"%";
            }
            if(name=="穿梭车2"){
                carDL2.value=car[name]+"%";
            }
        });
    }
};
handleQuery();
const write = async (type: string, no: string, layer: string, FuncName: string) => {
@@ -60,7 +83,6 @@
        Layer: layer,
        FuncName: FuncName
    };
    var res = await WriteStartStop(data);
    console.log(res.data.result);
    // ElMessage.success(res.data.result);