2024-04-30 13:24:02 +08:00

185 lines
3.7 KiB
Vue

<template>
<view>
<view :key="1">
<view class="tip-box">
<u-row :gutter="20">
<u-col span="2">
<u-text text="起点" size="48"></u-text>
</u-col>
<u-col span="4">
<u-input v-model="start_point" placeholder="请输入起点" clearable></u-input>
</u-col>
<u-col span="2">
<u-text text="终点" size="48"></u-text>
</u-col>
<u-col span="4">
<u-input v-model="end_point" placeholder="请输入终点" clearable></u-input>
</u-col>
</u-row>
<u-gap height="20"></u-gap>
<u-row>
<u-col span="6" align="center">
<view class="tip-icon" @click="start_agv"><span>启动</span></view>
</u-col>
<u-col span="6" align="center">
<view class="tip-icon2" @click="stop_agv"><span style="font-size: 0.5rem">紧急终止</span></view>
</u-col>
</u-row>
</view>
</view>
<u-toast ref="uToast"></u-toast>
</view>
</template>
<script>
import {
go_workshop,
emergency_stop_agv
} from '@/api/materialManagement/MaterialRequsition.js';
export default {
data() {
return {
loading: false,
start_point: '',
end_point: '',
reqCode:''
};
},
watch: {},
filters: {
},
mounted() {
this.init();
},
methods: {
init() {
},
start_agv() {
if (this.start_point == '' || this.end_point == '') {
this.$refs.uToast.show({
type: 'error',
message: '起点或者终点不能为空'
});
return;
}
const query = {
start_point: this.start_point,
end_point: this.end_point
};
go_workshop(query).then((res) => {
if (res.code == 200) {
this.reqCode = res.data.data;
this.$refs.uToast.show({
type: 'error',
message: 'agv起动成功' + res.data
});
}
});
},
stop_agv() {
if (this.reqCode == '') {
this.$refs.uToast.show({
type: 'error',
message: '无任务编号'
});
return;
}
const query = {
reqCode: this.reqCode
};
emergency_stop_agv().then((res) => {
if (res.code == 200) {
this.$refs.uToast.show({
type: 'success',
message: '成功取消' + res.data
});
}
});
}
}
};
</script>
<style scoped>
.area {
height: 350px;
background-color: white;
overflow: hidden;
/* 隐藏超出部分 */
overflow-y: scroll;
/* 添加垂直滚动条 */
}
.cartoon-list-item {
background-color: #c8d3db;
/* 设置蓝色背景 */
padding: 10px;
/* 设置内边距 */
border-radius: 10px;
/* 设置圆角边框 */
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
/* 添加阴影效果 */
margin-bottom: 10px;
/* 设置底部外边距 */
font-family: 'Comic Sans MS', cursive;
/* 设置卡通化字体 */
color: white;
/* 设置文字颜色为白色 */
}
.cartoon-list-item:hover {
transform: scale(1.05);
/* 鼠标悬停时放大 */
}
.tip-box {
width: 100%;
margin-top: 20px;
background-color: #fff;
/* 白色背景 */
padding: 20px;
border-radius: 10px;
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
/* 添加阴影 */
}
.tip-icon {
margin-top: 5px;
width: 50px;
height: 50px;
background-color: #00ff00;
border-radius: 50%;
display: flex;
justify-content: center;
align-items: center;
font-size: 24px;
color: #fff;
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
/* 添加阴影 */
}
.tip-icon2 {
margin-top: 5px;
width: 50px;
height: 50px;
background-color: red;
border-radius: 50%;
display: flex;
justify-content: center;
align-items: center;
font-size: 24px;
color: #fff;
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
/* 添加阴影 */
}
.tip-text {
margin-top: 10px;
font-size: 16px;
color: #333;
}
</style>