|
|
|
|
@ -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>
|
|
|
|
|
|