Merge branch 'feature/light-source' into 'master'

增加光源控制

See merge request duoji/duoji-frontend!2
taiwan-tingli
wang.yiming 4 years ago
commit 2d7e36eef6

Binary file not shown.

@ -14,11 +14,7 @@ export default {
url: "/order/list",
name: "获取历史监控列表"
},
realTimeLychee: {
method: "GET",
url: "/realTime/lychee",
name: "获取荔枝的ip"
},
getStreetList: {
method: "POST",
url: "/street/page",
@ -34,6 +30,21 @@ export default {
url: "/street",
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: {
// method: "DELETE",
// url: "/street",

@ -1,8 +1,17 @@
<template>
<div>
<a-button type="primary" class="add" @click="showModel('add','')">
新增巷道
</a-button>
<div class="button-box">
<a-button @click="confirmLight('open')">
打开光源
</a-button>
<a-button @click="confirmLight('close')">
关闭光源
</a-button>
<a-button type="primary" @click="showModel('add','')">
新增巷道
</a-button>
</div>
<a-table
style="margin-top:40px"
@ -47,6 +56,7 @@
@sure="submit"
@close="closeModel"
/>
</div>
</template>
@ -104,11 +114,13 @@ export default {
columns,
visible:false,
modelTitle:'',
modelData:[]
modelData:[],
};
},
mounted() {
this.handleGetStreetList()
},
methods: {
handleGetStreetList(pagination) {
@ -146,10 +158,12 @@ export default {
this.modelData = data
}
},
submit(visible){
this.visible = visible
this.handleGetStreetList()
},
closeModel(visible,data){
this.visible = visible
this.modelData=data
@ -167,6 +181,55 @@ export default {
}).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:{
@ -180,4 +243,15 @@ export default {
top:20px;
right: 40px;
}
.button-box{
position: absolute;
top:20px;
right: 40px;
display: flex;
align-items: center;
justify-content: center;
.add{
margin-right: 15px;
}
}
</style>

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

Loading…
Cancel
Save