|
@@ -50,9 +50,10 @@
|
|
|
style="width: 100%;display: flex; justify-content: space-between"
|
|
style="width: 100%;display: flex; justify-content: space-between"
|
|
|
>
|
|
>
|
|
|
<el-switch
|
|
<el-switch
|
|
|
- v-for="item in relayList[0]"
|
|
|
|
|
|
|
+ v-for="(item,index) in relayList[0].relay"
|
|
|
:key="item.id"
|
|
:key="item.id"
|
|
|
v-model="item.state"
|
|
v-model="item.state"
|
|
|
|
|
+ :disabled="index === 0"
|
|
|
@change="changeTransparency($event,'四路',item)"
|
|
@change="changeTransparency($event,'四路',item)"
|
|
|
/>
|
|
/>
|
|
|
</div>
|
|
</div>
|
|
@@ -71,13 +72,26 @@
|
|
|
style="width: 100%;display: flex; justify-content: space-between"
|
|
style="width: 100%;display: flex; justify-content: space-between"
|
|
|
>
|
|
>
|
|
|
<el-switch
|
|
<el-switch
|
|
|
- v-for="item in relayList[1]"
|
|
|
|
|
|
|
+ v-for="(item,index) in relayList[1].relay"
|
|
|
:key="item.id"
|
|
:key="item.id"
|
|
|
v-model="item.state"
|
|
v-model="item.state"
|
|
|
|
|
+ :disabled="index === 0"
|
|
|
@change="changeTransparencyTwo($event,'四路',item)"
|
|
@change="changeTransparencyTwo($event,'四路',item)"
|
|
|
/>
|
|
/>
|
|
|
</div>
|
|
</div>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
|
|
+ <el-form-item
|
|
|
|
|
+ v-if="dialogData.switchType === '单灯控制器'"
|
|
|
|
|
+ label-width="0"
|
|
|
|
|
+ >
|
|
|
|
|
+ <el-button
|
|
|
|
|
+ type="primary"
|
|
|
|
|
+ style="width: 100%"
|
|
|
|
|
+ @click="singleLamp"
|
|
|
|
|
+ >
|
|
|
|
|
+ 设定
|
|
|
|
|
+ </el-button>
|
|
|
|
|
+ </el-form-item>
|
|
|
<el-form-item label-width="0">
|
|
<el-form-item label-width="0">
|
|
|
<div style="width: 100%; display: flex; justify-content: space-between">
|
|
<div style="width: 100%; display: flex; justify-content: space-between">
|
|
|
<el-button
|
|
<el-button
|
|
@@ -98,7 +112,7 @@ import { defineComponent, ref, reactive } from 'vue-demi'
|
|
|
import { useScreenStore } from '@/pinia/modules/screen'
|
|
import { useScreenStore } from '@/pinia/modules/screen'
|
|
|
import { updateTunnelLamp } from '@/api/tunnel'
|
|
import { updateTunnelLamp } from '@/api/tunnel'
|
|
|
import { ElMessage } from 'element-plus'
|
|
import { ElMessage } from 'element-plus'
|
|
|
-import {deviceSwitch} from "@/api/device";
|
|
|
|
|
|
|
+import { deviceSwitch } from '@/api/device'
|
|
|
const useScreen = useScreenStore()
|
|
const useScreen = useScreenStore()
|
|
|
export default defineComponent({
|
|
export default defineComponent({
|
|
|
name: 'MarkerDemo',
|
|
name: 'MarkerDemo',
|
|
@@ -129,8 +143,8 @@ export default defineComponent({
|
|
|
|
|
|
|
|
const onMapInited = () => {
|
|
const onMapInited = () => {
|
|
|
// 地图加载完成后,可以获取地图实例、点标记实例,调用地图实例、点标记实例方法
|
|
// 地图加载完成后,可以获取地图实例、点标记实例,调用地图实例、点标记实例方法
|
|
|
- console.log(mapRef.value.map)
|
|
|
|
|
- console.log(markerRef.value.marker)
|
|
|
|
|
|
|
+ // console.log(mapRef.value.map)
|
|
|
|
|
+ // console.log(markerRef.value.marker)
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
const getLayerInstance = () => {
|
|
const getLayerInstance = () => {
|
|
@@ -182,44 +196,65 @@ export default defineComponent({
|
|
|
relayList.length = 0
|
|
relayList.length = 0
|
|
|
item.devices.forEach(option => {
|
|
item.devices.forEach(option => {
|
|
|
if (option.genre === 6) {
|
|
if (option.genre === 6) {
|
|
|
- relayList.push(option.deviceRelays)
|
|
|
|
|
|
|
+ relayList.push({ radarId: option.radarId, relay: option.deviceRelays })
|
|
|
}
|
|
}
|
|
|
})
|
|
})
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
const changeTransparency = (e, type, data) => {
|
|
const changeTransparency = (e, type, data) => {
|
|
|
- const option = {
|
|
|
|
|
- 0: [0.8, 33, 1],
|
|
|
|
|
- 50: [0.5, 66, 2],
|
|
|
|
|
- 100: [0.2, 100, 3]
|
|
|
|
|
- }
|
|
|
|
|
// materialOne.opacity = option[e][0]
|
|
// materialOne.opacity = option[e][0]
|
|
|
if (type === '单灯') {
|
|
if (type === '单灯') {
|
|
|
- updateTunnelLamp({
|
|
|
|
|
- id: lampData.ID,
|
|
|
|
|
|
|
+ transparency.value = e
|
|
|
|
|
+ } else {
|
|
|
|
|
+ deviceSwitch({
|
|
|
tunnelSn: lampData.tunnelSn,
|
|
tunnelSn: lampData.tunnelSn,
|
|
|
- lampValue2: option[e][1]
|
|
|
|
|
|
|
+ radarId: relayList[0].radarId,
|
|
|
|
|
+ relayId: data.relayId,
|
|
|
|
|
+ state: e
|
|
|
}).then(res => {
|
|
}).then(res => {
|
|
|
if (res.code === 0) {
|
|
if (res.code === 0) {
|
|
|
- ElMessage.success('已发送')
|
|
|
|
|
|
|
+ console.log('发送成功')
|
|
|
}
|
|
}
|
|
|
})
|
|
})
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ const changeTransparencyTwo = (e, type, data) => {
|
|
|
|
|
+ // materialOne.opacity = option[e][0]
|
|
|
|
|
+ if (type === '单灯') {
|
|
|
|
|
+ transparencyTwo.value = e
|
|
|
} else {
|
|
} else {
|
|
|
- console.log(relayList[0])
|
|
|
|
|
- console.log(lampData, data.relayId, e)
|
|
|
|
|
- // deviceSwitch({
|
|
|
|
|
- // tunnelSn: lampData.tunnelSn,
|
|
|
|
|
- // radarId: relayList[0].radarId,
|
|
|
|
|
- // relayId: data.relayId,
|
|
|
|
|
- // state: e
|
|
|
|
|
- // }).then(res => {
|
|
|
|
|
- // if (res.code === 0) {
|
|
|
|
|
- // console.log('发送成功')
|
|
|
|
|
- // }
|
|
|
|
|
- // })
|
|
|
|
|
|
|
+ deviceSwitch({
|
|
|
|
|
+ tunnelSn: lampData.tunnelSn,
|
|
|
|
|
+ radarId: relayList[1].radarId,
|
|
|
|
|
+ relayId: data.relayId,
|
|
|
|
|
+ state: e
|
|
|
|
|
+ }).then(res => {
|
|
|
|
|
+ if (res.code === 0) {
|
|
|
|
|
+ console.log('发送成功')
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
- const changeTransparencyTwo = () => {}
|
|
|
|
|
|
|
+ const singleLamp = () => {
|
|
|
|
|
+ const option = {
|
|
|
|
|
+ 0: [0.8, 33, 1],
|
|
|
|
|
+ 50: [0.5, 66, 2],
|
|
|
|
|
+ 100: [0.2, 100, 3]
|
|
|
|
|
+ }
|
|
|
|
|
+ const lamp1 = option[transparency.value][1]
|
|
|
|
|
+ const lamp2 = option[transparencyTwo.value][1]
|
|
|
|
|
+ console.log(lamp1, lamp2)
|
|
|
|
|
+ updateTunnelLamp({
|
|
|
|
|
+ id: lampData.ID,
|
|
|
|
|
+ tunnelSn: lampData.tunnelSn,
|
|
|
|
|
+ lampValue1: lamp1,
|
|
|
|
|
+ lampValue2: lamp2
|
|
|
|
|
+ }).then(res => {
|
|
|
|
|
+ if (res.code === 0) {
|
|
|
|
|
+ ElMessage.success('已发送')
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
|
|
+ }
|
|
|
return {
|
|
return {
|
|
|
center,
|
|
center,
|
|
|
zoom,
|
|
zoom,
|
|
@@ -259,7 +294,8 @@ export default defineComponent({
|
|
|
brightness,
|
|
brightness,
|
|
|
changeTransparency,
|
|
changeTransparency,
|
|
|
changeTransparencyTwo,
|
|
changeTransparencyTwo,
|
|
|
- relayList
|
|
|
|
|
|
|
+ relayList,
|
|
|
|
|
+ singleLamp
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
})
|
|
})
|