增加光源控制

feature/light-source
yiming 4 years ago
parent a98d220aec
commit 2c89634ad4

Binary file not shown.

@ -14,11 +14,7 @@ export default {
url: "/order/list", url: "/order/list",
name: "获取历史监控列表" name: "获取历史监控列表"
}, },
realTimeLychee: {
method: "GET",
url: "/realTime/lychee",
name: "获取荔枝的ip"
},
getStreetList: { getStreetList: {
method: "POST", method: "POST",
url: "/street/page", url: "/street/page",
@ -34,6 +30,21 @@ export default {
url: "/street", url: "/street",
name: "编辑巷道" name: "编辑巷道"
}, },
openLight:{
method: "GET",
url: "/street/lightSource/open",
name: "打开光源"
},
closeLight:{
method: "GET",
url: "/street/lightSource/close",
name: "关闭光源"
},
statusLight:{
method: "GET",
url: "/street/lightSource/status",
name: "获取光源状态"
},
// deleteStreet: { // deleteStreet: {
// method: "DELETE", // method: "DELETE",
// url: "/street", // url: "/street",

@ -1,8 +1,17 @@
<template> <template>
<div> <div>
<a-button type="primary" class="add" @click="showModel('add','')"> <div class="button-box">
新增巷道 <a-button @click="confirmLight('open')">
</a-button> 打开光源
</a-button>
<a-button @click="confirmLight('close')">
关闭光源
</a-button>
<a-button type="primary" @click="showModel('add','')">
新增巷道
</a-button>
</div>
<a-table <a-table
style="margin-top:40px" style="margin-top:40px"
@ -47,6 +56,7 @@
@sure="submit" @sure="submit"
@close="closeModel" @close="closeModel"
/> />
</div> </div>
</template> </template>
@ -104,11 +114,13 @@ export default {
columns, columns,
visible:false, visible:false,
modelTitle:'', modelTitle:'',
modelData:[] modelData:[],
}; };
}, },
mounted() { mounted() {
this.handleGetStreetList() this.handleGetStreetList()
}, },
methods: { methods: {
handleGetStreetList(pagination) { handleGetStreetList(pagination) {
@ -146,10 +158,12 @@ export default {
this.modelData = data this.modelData = data
} }
}, },
submit(visible){ submit(visible){
this.visible = visible this.visible = visible
this.handleGetStreetList() this.handleGetStreetList()
}, },
closeModel(visible,data){ closeModel(visible,data){
this.visible = visible this.visible = visible
this.modelData=data this.modelData=data
@ -167,6 +181,55 @@ export default {
}).catch(err => { }).catch(err => {
}) })
},
confirmLight(type) {
const that = this
if(type == "open"){
this.$confirm({
title: "打开光源",
content: "确认打开光源?",
okText: '确认',
onOk() {
return new Promise((resolve, reject) => {
that.openLight();
setTimeout(resolve, 1000);
}).catch(() => console.log('Oops errors!'));
},
cancelText: '取消',
});
}else{
this.$confirm({
title: "关闭光源",
content: "确认关闭光源?",
okText: '确认',
onOk() {
return new Promise((resolve, reject) => {
that.closeLight();
setTimeout(resolve, 1000);
}).catch(() => console.log('Oops errors!'));
},
cancelText: '取消',
});
}
},
openLight(){
console.log("openLight")
this.$api.httpApi.openLight().then(res => {
}).catch(err => {
});
},
closeLight(){
this.$api.httpApi.closeLight().then(res => {
}).catch(err => {
});
} }
}, },
components:{ components:{
@ -180,4 +243,15 @@ export default {
top:20px; top:20px;
right: 40px; right: 40px;
} }
.button-box{
position: absolute;
top:20px;
right: 40px;
display: flex;
align-items: center;
justify-content: center;
.add{
margin-right: 15px;
}
}
</style> </style>

@ -29,12 +29,12 @@
<div class="across-layout"> <div class="across-layout">
<a-form-item label="PLC IP" :label-col="formItemAcrossLayout.labelCol"> <a-form-item label="PLC IP" :label-col="formItemAcrossLayout.labelCol">
<a-input <a-input
v-decorator="['plcIp', { rules: [{ message: '请输入PLC IP地址!' }] }]" v-decorator="['plcIp']"
/> />
</a-form-item> </a-form-item>
<a-form-item label="PLC PORT" :label-col="formItemAcrossLayout.labelCol"> <a-form-item label="PLC PORT" :label-col="formItemAcrossLayout.labelCol">
<a-input <a-input
v-decorator="['plcPort', { rules: [{ message: '请输入端口!' }] }]" v-decorator="['plcPort']"
/> />
</a-form-item> </a-form-item>
</div> </div>
@ -254,8 +254,8 @@ export default {
rightShelveId: newVal.rightShelveId, rightShelveId: newVal.rightShelveId,
rightInsideShelveId:newVal.rightInsideShelveId, rightInsideShelveId:newVal.rightInsideShelveId,
rightOutsideShelveId:newVal.rightOutsideShelveId, rightOutsideShelveId:newVal.rightOutsideShelveId,
camera1Id:newVal.camera1Name, camera1Id:newVal.camera1Id,
camera2Id:newVal.camera2Name, camera2Id:newVal.camera2Id,
camera1Name:newVal.camera1Name, camera1Name:newVal.camera1Name,
camera2Name:newVal.camera2Name camera2Name:newVal.camera2Name
}) })

Loading…
Cancel
Save