95 lines
2.3 KiB
Vue
95 lines
2.3 KiB
Vue
<template>
|
|
<view>
|
|
<u--form labelWidth="auto" labelPosition="left" :model="formData" ref="uForm">
|
|
<u-form-item label="AGV起点:" borderBottom>
|
|
<u-input placeholder="请输入起点" border="surround" v-model="formData.start">
|
|
<template slot="suffix">
|
|
<u-button @click="chouseStart" type="success" size="mini" text="选择起点"></u-button>
|
|
</template>
|
|
</u-input>
|
|
</u-form-item>
|
|
<u-form-item label="AGV终点:" borderBottom>
|
|
<u-input placeholder="请输入终点点" border="surround" v-model="formData.end">
|
|
<template slot="suffix">
|
|
<u-button @click="chouseEnd" type="success" size="mini" text="选择终点"></u-button>
|
|
</template>
|
|
</u-input>
|
|
</u-form-item>
|
|
<u-form-item>
|
|
<u-button type="primary" text="执行" @click="doAction"></u-button>
|
|
</u-form-item>
|
|
</u--form>
|
|
<u-picker title="起点" :show="showStart" :columns="startColumns" @confirm="startConfirm"
|
|
@cancel="showStart = false" keyName="coordinate"></u-picker>
|
|
<u-picker title="终点" :show="showEnd" :columns="endColumns" @confirm="endConfirm" @cancel="showEnd = false"
|
|
keyName="coordinate"></u-picker>
|
|
</view>
|
|
</template>
|
|
|
|
<script>
|
|
import * as AgvApi from '@/api/agv/agv.js';
|
|
export default {
|
|
data() {
|
|
return {
|
|
showStart: false,
|
|
showEnd: false,
|
|
formData: {
|
|
//起点
|
|
start: '',
|
|
//终点
|
|
end: '',
|
|
},
|
|
startColumns: [],
|
|
endColumns: []
|
|
}
|
|
},
|
|
created() {
|
|
this.init()
|
|
},
|
|
methods: {
|
|
init() {
|
|
const goStartDictData = {
|
|
areaCode: 2,
|
|
type: 0
|
|
}
|
|
AgvApi.getAgvPosition(goStartDictData).then(res => {
|
|
if (res.code === 200) {
|
|
this.startColumns = [res.data];
|
|
}
|
|
})
|
|
const goEndDictData = {
|
|
areaCode: 2,
|
|
type: 1
|
|
}
|
|
AgvApi.getAgvPosition(goEndDictData).then(res => {
|
|
if (res.code === 200) {
|
|
this.endColumns = [res.data];
|
|
}
|
|
})
|
|
},
|
|
chouseStart() {
|
|
this.showStart = true;
|
|
},
|
|
chouseEnd() {
|
|
this.showEnd = true;
|
|
},
|
|
startConfirm(item) {
|
|
this.formData.start = item.value[0].coordinate;
|
|
this.showStart = false;
|
|
},
|
|
endConfirm(item) {
|
|
this.formData.end = item.value[0].coordinate;
|
|
this.showEnd = false;
|
|
},
|
|
// 执行AGV任务
|
|
doAction() {
|
|
const data = this.formData;
|
|
console.log(this.formData);
|
|
}
|
|
}
|
|
}
|
|
</script>
|
|
|
|
<style>
|
|
|
|
</style> |