|
|
|
|
@ -2,10 +2,10 @@
|
|
|
|
|
<div>
|
|
|
|
|
<div class="button-box">
|
|
|
|
|
<a-button type="primary" class="open" @click="confirmLight('open')">
|
|
|
|
|
打开光源
|
|
|
|
|
打开全部光源
|
|
|
|
|
</a-button>
|
|
|
|
|
<a-button type="primary" class="close" @click="confirmLight('close')">
|
|
|
|
|
关闭光源
|
|
|
|
|
关闭全部光源
|
|
|
|
|
</a-button>
|
|
|
|
|
<a-button type="primary" @click="showModel('add','')">
|
|
|
|
|
新增巷道
|
|
|
|
|
@ -55,6 +55,14 @@
|
|
|
|
|
</template>
|
|
|
|
|
</span>
|
|
|
|
|
<span slot="action" slot-scope="text, record">
|
|
|
|
|
<a @click="openOneLight(record.id)">
|
|
|
|
|
打开光源
|
|
|
|
|
</a>
|
|
|
|
|
<a-divider type="vertical"/>
|
|
|
|
|
<a @click="closeOneLight(record.id)">
|
|
|
|
|
关闭光源
|
|
|
|
|
</a>
|
|
|
|
|
<a-divider type="vertical"/>
|
|
|
|
|
<a @click="showModel('edit',record)">
|
|
|
|
|
编辑
|
|
|
|
|
</a>
|
|
|
|
|
@ -240,13 +248,39 @@ export default {
|
|
|
|
|
return new Promise((resolve, reject) => {
|
|
|
|
|
that.closeLight();
|
|
|
|
|
setTimeout(resolve, 1000);
|
|
|
|
|
this.$message.success('已关闭光源');
|
|
|
|
|
}).catch(() => console.log('Oops errors!'));
|
|
|
|
|
},
|
|
|
|
|
cancelText: '取消',
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
openOneLight(streetId){
|
|
|
|
|
console.log("openOneLight"+streetId)
|
|
|
|
|
this.$axios.get('/street/lightSource/open/' + streetId, {
|
|
|
|
|
|
|
|
|
|
}).then(res => {
|
|
|
|
|
if(res.code==200){
|
|
|
|
|
this.$message.success('已打开光源');
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}).catch(err => {
|
|
|
|
|
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
closeOneLight(streetId){
|
|
|
|
|
console.log("closeOneLight"+streetId)
|
|
|
|
|
this.$axios.get('/street/lightSource/close/' + streetId, {
|
|
|
|
|
|
|
|
|
|
}).then(res => {
|
|
|
|
|
if(res.code==200){
|
|
|
|
|
this.$message.success('已关闭光源');
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}).catch(err => {
|
|
|
|
|
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
openLight(){
|
|
|
|
|
console.log("openLight")
|
|
|
|
|
this.$api.httpApi.openLight().then(res => {
|
|
|
|
|
|