|
|
@@ -20,18 +20,23 @@
|
|
|
</div>
|
|
|
<div class="deviceOptionBox">
|
|
|
<div
|
|
|
- v-for="item in deviceList"
|
|
|
+ v-for="item in deviceTypeList"
|
|
|
+ :key="item.id"
|
|
|
class="deviceOption"
|
|
|
>
|
|
|
- <img
|
|
|
- :src="item.url"
|
|
|
- style="width: 35px;height: 35px"
|
|
|
- alt=""
|
|
|
- >
|
|
|
- <el-text
|
|
|
- style="padding-top: 8px;color: #ffffff"
|
|
|
- size="small"
|
|
|
- >{{ item.label + item.value }}</el-text>
|
|
|
+ <div class="deviceOption">
|
|
|
+ <div style="width: 35px;height: 35px">
|
|
|
+ <img
|
|
|
+ :src="item.url"
|
|
|
+ style="width: 35px;height: 35px"
|
|
|
+ alt=""
|
|
|
+ >
|
|
|
+ </div>
|
|
|
+ <el-text
|
|
|
+ style="padding-top: 8px;color: #ffffff"
|
|
|
+ size="small"
|
|
|
+ >{{ item.label + item.value }}</el-text>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
@@ -57,7 +62,7 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="centerBox">
|
|
|
- <div style="width: 1200px;height: 600px">
|
|
|
+ <div style="width: 1200px;height: 600px;border: 3px solid #1b92fd; padding: 2px">
|
|
|
<Map />
|
|
|
</div>
|
|
|
<div class="centerBox_chart">
|
|
|
@@ -100,11 +105,11 @@
|
|
|
|
|
|
<script setup>
|
|
|
import Device from '@/assets/icons/device.png'
|
|
|
-import { reactive, onMounted } from 'vue'
|
|
|
-import environments from '@/assets/icons/environment.png'
|
|
|
-import fourWays from '@/assets/icons/fourWays.png'
|
|
|
-import inductance from '@/assets/icons/inductance.png'
|
|
|
-import singleLamp from '@/assets/icons/singleLamp.png'
|
|
|
+import { reactive, onMounted, watch } from 'vue'
|
|
|
+// import environments from '@/assets/icons/environment.png'
|
|
|
+// import fourWays from '@/assets/icons/fourWays.png'
|
|
|
+// import inductance from '@/assets/icons/inductance.png'
|
|
|
+// import singleLamp from '@/assets/icons/singleLamp.png'
|
|
|
import Setting from '@/assets/icons/setting.png'
|
|
|
import Sunlight from '@/assets/icons/sunlight.png'
|
|
|
import topBg from '@/assets/icons/topbg.png'
|
|
|
@@ -114,15 +119,18 @@ import Map from '@/view/screen/components/map.vue'
|
|
|
import * as echarts from 'echarts'
|
|
|
import { useScreenStore } from '@/pinia/modules/screen'
|
|
|
import { queryTunnelList } from '@/api/tunnel'
|
|
|
+import { queryAllDevices, queryAllDeviceGenres } from '@/api/device'
|
|
|
|
|
|
const useScreen = useScreenStore()
|
|
|
|
|
|
-const deviceList = reactive([
|
|
|
- { url: environments, label: '环境:', value: '1/0' },
|
|
|
- { url: fourWays, label: '四路:', value: '1/0' },
|
|
|
- { url: inductance, label: '电感:', value: '1/0' },
|
|
|
- { url: singleLamp, label: '单灯:', value: '1/0' },
|
|
|
-])
|
|
|
+// const deviceList = reactive([
|
|
|
+// { url: environments, label: '环境:', value: '1/0' },
|
|
|
+// { url: fourWays, label: '四路:', value: '1/0' },
|
|
|
+// { url: inductance, label: '电感:', value: '1/0' },
|
|
|
+// { url: singleLamp, label: '单灯:', value: '1/0' },
|
|
|
+// ])
|
|
|
+
|
|
|
+const deviceTypeList = reactive([])
|
|
|
|
|
|
const condition = {
|
|
|
pageInfo: {
|
|
|
@@ -144,6 +152,19 @@ onMounted(() => {
|
|
|
loadingLamp(lampData.envData)
|
|
|
}
|
|
|
})
|
|
|
+ queryAllDevices().then(res => {
|
|
|
+ console.log('res', res)
|
|
|
+ })
|
|
|
+ queryAllDeviceGenres().then(res => {
|
|
|
+ if (res.code === 0) {
|
|
|
+ const result = []
|
|
|
+ for (let i = 0; i < res.data.length; i += 4) {
|
|
|
+ result.push(res.data.slice(i, i + 4))
|
|
|
+ }
|
|
|
+ deviceTypeList.push(...result)
|
|
|
+ console.log('设备类型', deviceTypeList)
|
|
|
+ }
|
|
|
+ })
|
|
|
})
|
|
|
|
|
|
const loading = (list) => {
|
|
|
@@ -281,6 +302,12 @@ const loadingLamp = (list) => {
|
|
|
|
|
|
option && myChart.setOption(option)
|
|
|
}
|
|
|
+
|
|
|
+watch(() => useScreen.currentTunnel, (newValue) => {
|
|
|
+ loading(newValue.envData)
|
|
|
+ loadingLamp(newValue.envData)
|
|
|
+})
|
|
|
+
|
|
|
</script>
|
|
|
|
|
|
<style scoped lang="less">
|
|
|
@@ -345,7 +372,7 @@ const loadingLamp = (list) => {
|
|
|
}
|
|
|
.deviceOptionBox {
|
|
|
width: 370px;
|
|
|
- height: 60px;
|
|
|
+ height: 120px;
|
|
|
display: flex;
|
|
|
margin-top: 20px;
|
|
|
.deviceOption {
|