|
@@ -11,55 +11,42 @@
|
|
|
<span style="margin-left: 45px;color: #C8DEFE;font-size: 18px;font-weight: normal;font-family: Alibaba-PuHuiTi-R;">
|
|
|
大车机构
|
|
|
</span>
|
|
|
- <div style="display: flex;padding:30px 30px;margin-top: 30px;align-items: center;border-bottom: 1px solid #306AF7;">
|
|
|
+ <div style="display: flex;padding:30px 40px;margin-top: 30px;align-items: center;border-bottom: 1px solid #306AF7;">
|
|
|
<div style="display: flex;flex-direction: column;">
|
|
|
<span style="font-family: Alibaba-PuHuiTi-R;font-weight: normal;font-size: 16px;color: #ABC0E0;">
|
|
|
大车行程
|
|
|
</span>
|
|
|
<div style="margin-top: 5px;">
|
|
|
<span style="font-family: Alibaba-PuHuiTi-R;font-size: 36px;color: #4F80F8;">
|
|
|
- 00.00
|
|
|
+ {{ craneStrokeData.value}}
|
|
|
</span>
|
|
|
<span style="margin-left: -5px;font-family: Alibaba-PuHuiTi-R;font-size: 24px;color: #4F80F8;">
|
|
|
m
|
|
|
</span>
|
|
|
</div>
|
|
|
- <div style="display: flex;margin-top: 50px;">
|
|
|
- <div style="width: 70px;height: 28px;background-color: #294587;display: flex;align-items: center;">
|
|
|
- <div style="width: 5px;height: 5px;background-color: #4F80F8;margin: 0px 5px;"></div>
|
|
|
- <span style="font-family: Alibaba-PuHuiTi-R;font-size: 16px;color: #ABC0E0;">
|
|
|
- 方向
|
|
|
- </span>
|
|
|
- </div>
|
|
|
- <div style="width: 57px;height: 28px;background-color: rgba(41, 69, 135, 0.3);display: flex;align-items: center;justify-content: center;">
|
|
|
- <span style="font-family: Alibaba-PuHuiTi-R;font-size: 16px;color: #FFFFFF;">
|
|
|
- 左行
|
|
|
- </span>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- <div style="display: flex;margin-top: 10px;">
|
|
|
+ <div style="display: flex;margin-top: 40px;flex-direction: column;">
|
|
|
<div style="width: 70px;height: 28px;background-color: #294587;display: flex;align-items: center;">
|
|
|
<div style="width: 5px;height: 5px;background-color: #4F80F8;margin: 0px 5px;"></div>
|
|
|
<span style="font-family: Alibaba-PuHuiTi-R;font-size: 16px;color: #ABC0E0;">
|
|
|
挡位
|
|
|
</span>
|
|
|
</div>
|
|
|
- <div style="width: 57px;height: 28px;background-color: rgba(41, 69, 135, 0.3);display: flex;align-items: center;justify-content: center;">
|
|
|
+ <div style="height: 28px;background-color: rgba(41, 69, 135, 0.3);display: flex;align-items: center;justify-content: center;margin-top: 5px;">
|
|
|
<span style="font-family: Alibaba-PuHuiTi-R;font-size: 16px;color: #FFFFFF;">
|
|
|
- 一档
|
|
|
+ {{ formatGears(craneGearData) }}
|
|
|
</span>
|
|
|
</div>
|
|
|
</div>
|
|
|
- <div style="display: flex;margin-top: 10px;">
|
|
|
+ <div style="display: flex;margin-top: 10px;flex-direction: column;">
|
|
|
<div style="width: 70px;height: 28px;background-color: #294587;display: flex;align-items: center;">
|
|
|
<div style="width: 5px;height: 5px;background-color: #4F80F8;margin: 0px 5px;"></div>
|
|
|
<span style="font-family: Alibaba-PuHuiTi-R;font-size: 16px;color: #ABC0E0;">
|
|
|
制动器
|
|
|
</span>
|
|
|
</div>
|
|
|
- <div style="width: 57px;height: 28px;background-color: rgba(41, 69, 135, 0.3);display: flex;align-items: center;justify-content: center;">
|
|
|
+ <div style="height: 28px;background-color: rgba(41, 69, 135, 0.3);display: flex;align-items: center;justify-content: center;margin-top: 5px;">
|
|
|
<span style="font-family: Alibaba-PuHuiTi-R;font-size: 16px;color: #FFFFFF;">
|
|
|
- 闭合
|
|
|
+ {{ craneBrakeData.length > 0 ? craneBrakeData.value : '未知' }}
|
|
|
</span>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -71,7 +58,7 @@
|
|
|
</span>
|
|
|
<div style="margin-top: 5px;">
|
|
|
<span style="font-family: Alibaba-PuHuiTi-R;font-size: 24px;color: #4F80F8;">
|
|
|
- 00.00
|
|
|
+ {{ craneFrequencyData.length > 0 ? craneFrequencyData.value : '0.00'}}
|
|
|
</span>
|
|
|
<span style="margin-left: -5px;font-family: Alibaba-PuHuiTi-R;font-size: 14px;color: #4F80F8;">
|
|
|
Hz
|
|
@@ -82,7 +69,7 @@
|
|
|
</span>
|
|
|
<div style="margin-top: 5px;">
|
|
|
<span style="font-family: Alibaba-PuHuiTi-R;font-size: 24px;color: #4F80F8;">
|
|
|
- 00.00
|
|
|
+ {{craneCurrentData.length > 0 ? craneCurrentData.value : '0.00'}}
|
|
|
</span>
|
|
|
<span style="margin-left: -5px;font-family: Alibaba-PuHuiTi-R;font-size: 14px;color: #4F80F8;">
|
|
|
A
|
|
@@ -91,8 +78,8 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="left_bottom_grid">
|
|
|
- <div v-for="item in left_bottom_list" :key="item.id" class="left_bottom_grid_item">
|
|
|
- <span>{{ item.name }}</span>
|
|
|
+ <div v-for="item in craneSwitchVariablesData" :key="item.id" class="left_bottom_grid_item" :class="getColor(item)">
|
|
|
+ <span>{{ item.variableName }}</span>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -115,8 +102,8 @@
|
|
|
</div>
|
|
|
<div style="display: flex;align-items: center;justify-content: space-between;padding: 50px 30px 30px 30px;">
|
|
|
<div style="display: flex;align-items: center">
|
|
|
- <img style="width: 41px;height: 234px;" src="../../assets/img/screen_middle_bottom_left.png">
|
|
|
- <div style="display: flex;flex-direction: column;margin-left: 10px;">
|
|
|
+ <!-- <img style="width: 41px;height: 234px;" src="../../assets/img/screen_middle_bottom_left.png"> -->
|
|
|
+ <div style="display: flex;flex-direction: column;margin-left: 20px;">
|
|
|
<span style="font-family: Alibaba-PuHuiTi-R;font-weight: normal;font-size: 16px;color: #ABC0E0;">
|
|
|
起升高度
|
|
|
</span>
|
|
@@ -128,40 +115,27 @@
|
|
|
m
|
|
|
</span>
|
|
|
</div>
|
|
|
- <div style="display: flex;margin-top: 20px;">
|
|
|
- <div style="width: 70px;height: 28px;background-color: #294587;display: flex;align-items: center;">
|
|
|
- <div style="width: 5px;height: 5px;background-color: #4F80F8;margin: 0px 5px;"></div>
|
|
|
- <span style="font-family: Alibaba-PuHuiTi-R;font-size: 16px;color: #ABC0E0;">
|
|
|
- 方向
|
|
|
- </span>
|
|
|
- </div>
|
|
|
- <div style="width: 57px;height: 28px;background-color: rgba(41, 69, 135, 0.3);display: flex;align-items: center;justify-content: center;">
|
|
|
- <span style="font-family: Alibaba-PuHuiTi-R;font-size: 16px;color: #FFFFFF;">
|
|
|
- 左行
|
|
|
- </span>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- <div style="display: flex;margin-top: 10px;">
|
|
|
+ <div style="display: flex;margin-top: 20px;flex-direction: column;">
|
|
|
<div style="width: 70px;height: 28px;background-color: #294587;display: flex;align-items: center;">
|
|
|
<div style="width: 5px;height: 5px;background-color: #4F80F8;margin: 0px 5px;"></div>
|
|
|
<span style="font-family: Alibaba-PuHuiTi-R;font-size: 16px;color: #ABC0E0;">
|
|
|
挡位
|
|
|
</span>
|
|
|
</div>
|
|
|
- <div style="width: 57px;height: 28px;background-color: rgba(41, 69, 135, 0.3);display: flex;align-items: center;justify-content: center;">
|
|
|
+ <div style="height: 28px;background-color: rgba(41, 69, 135, 0.3);display: flex;align-items: center;justify-content: center;margin-top: 5px;">
|
|
|
<span style="font-family: Alibaba-PuHuiTi-R;font-size: 16px;color: #FFFFFF;">
|
|
|
- 一档
|
|
|
+ 左行一档
|
|
|
</span>
|
|
|
</div>
|
|
|
</div>
|
|
|
- <div style="display: flex;margin-top: 10px;">
|
|
|
+ <div style="display: flex;margin-top: 10px;flex-direction: column;">
|
|
|
<div style="width: 70px;height: 28px;background-color: #294587;display: flex;align-items: center;">
|
|
|
<div style="width: 5px;height: 5px;background-color: #4F80F8;margin: 0px 5px;"></div>
|
|
|
<span style="font-family: Alibaba-PuHuiTi-R;font-size: 16px;color: #ABC0E0;">
|
|
|
制动器
|
|
|
</span>
|
|
|
</div>
|
|
|
- <div style="width: 57px;height: 28px;background-color: rgba(41, 69, 135, 0.3);display: flex;align-items: center;justify-content: center;">
|
|
|
+ <div style="height: 28px;background-color: rgba(41, 69, 135, 0.3);display: flex;align-items: center;justify-content: center;margin-top: 5px;">
|
|
|
<span style="font-family: Alibaba-PuHuiTi-R;font-size: 16px;color: #FFFFFF;">
|
|
|
闭合
|
|
|
</span>
|
|
@@ -295,7 +269,7 @@
|
|
|
<span style="margin-right: 45px;color: #C8DEFE;font-size: 18px;font-weight: normal;font-family: Alibaba-PuHuiTi-R;">
|
|
|
小车机构
|
|
|
</span>
|
|
|
- <div style="display: flex;padding:30px 30px;margin-top: 30px;align-items: center;border-bottom: 1px solid #306AF7;">
|
|
|
+ <div style="display: flex;padding:30px 40px;margin-top: 30px;align-items: center;border-bottom: 1px solid #306AF7;">
|
|
|
<div style="height: 100%;display: flex;flex-direction: column;justify-content: flex-end;">
|
|
|
<span style="font-family: Alibaba-PuHuiTi-R;font-weight: normal;font-size: 16px;color: #ABC0E0;">
|
|
|
频率
|
|
@@ -323,7 +297,7 @@
|
|
|
<div style="width: 1px;height: 100%;background-color: #306AF7;margin: 0px 42px;" />
|
|
|
<div style="display: flex;flex-direction: column;">
|
|
|
<span style="font-family: Alibaba-PuHuiTi-R;font-weight: normal;font-size: 16px;color: #ABC0E0;">
|
|
|
- 大车行程
|
|
|
+ 小车行程
|
|
|
</span>
|
|
|
<div style="margin-top: 5px;">
|
|
|
<span style="font-family: Alibaba-PuHuiTi-R;font-size: 36px;color: #4F80F8;">
|
|
@@ -333,49 +307,35 @@
|
|
|
m
|
|
|
</span>
|
|
|
</div>
|
|
|
- <div style="display: flex;margin-top: 50px;">
|
|
|
- <div style="width: 70px;height: 28px;background-color: #294587;display: flex;align-items: center;">
|
|
|
- <div style="width: 5px;height: 5px;background-color: #4F80F8;margin: 0px 5px;"></div>
|
|
|
- <span style="font-family: Alibaba-PuHuiTi-R;font-size: 16px;color: #ABC0E0;">
|
|
|
- 方向
|
|
|
- </span>
|
|
|
- </div>
|
|
|
- <div style="width: 57px;height: 28px;background-color: rgba(41, 69, 135, 0.3);display: flex;align-items: center;justify-content: center;">
|
|
|
- <span style="font-family: Alibaba-PuHuiTi-R;font-size: 16px;color: #FFFFFF;">
|
|
|
- 左行
|
|
|
- </span>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- <div style="display: flex;margin-top: 10px;">
|
|
|
+ <div style="display: flex;margin-top: 50px;flex-direction: column;">
|
|
|
<div style="width: 70px;height: 28px;background-color: #294587;display: flex;align-items: center;">
|
|
|
<div style="width: 5px;height: 5px;background-color: #4F80F8;margin: 0px 5px;"></div>
|
|
|
<span style="font-family: Alibaba-PuHuiTi-R;font-size: 16px;color: #ABC0E0;">
|
|
|
挡位
|
|
|
</span>
|
|
|
</div>
|
|
|
- <div style="width: 57px;height: 28px;background-color: rgba(41, 69, 135, 0.3);display: flex;align-items: center;justify-content: center;">
|
|
|
+ <div style="height: 28px;background-color: rgba(41, 69, 135, 0.3);display: flex;align-items: center;justify-content: center;margin-top: 5px;">
|
|
|
<span style="font-family: Alibaba-PuHuiTi-R;font-size: 16px;color: #FFFFFF;">
|
|
|
- 一档
|
|
|
+ 左行一档
|
|
|
</span>
|
|
|
</div>
|
|
|
</div>
|
|
|
- <div style="display: flex;margin-top: 10px;">
|
|
|
+ <div style="display: flex;margin-top: 10px;flex-direction: column;">
|
|
|
<div style="width: 70px;height: 28px;background-color: #294587;display: flex;align-items: center;">
|
|
|
<div style="width: 5px;height: 5px;background-color: #4F80F8;margin: 0px 5px;"></div>
|
|
|
<span style="font-family: Alibaba-PuHuiTi-R;font-size: 16px;color: #ABC0E0;">
|
|
|
制动器
|
|
|
</span>
|
|
|
</div>
|
|
|
- <div style="width: 57px;height: 28px;background-color: rgba(41, 69, 135, 0.3);display: flex;align-items: center;justify-content: center;">
|
|
|
+ <div style="height: 28px;background-color: rgba(41, 69, 135, 0.3);display: flex;align-items: center;justify-content: center;margin-top: 5px';">
|
|
|
<span style="font-family: Alibaba-PuHuiTi-R;font-size: 16px;color: #FFFFFF;">
|
|
|
闭合
|
|
|
</span>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
-
|
|
|
</div>
|
|
|
- <div style="width: 100%;display: flex;justify-content: center;">
|
|
|
+ <div style="height: 200px;width: 100%;display: flex;justify-content: center;align-items: center">
|
|
|
<div class="right_small_grid">
|
|
|
<div v-for="item in right_samll_list" :key="item.id" class="right_small_grid_item">
|
|
|
<span>{{ item.name }}</span>
|
|
@@ -394,182 +354,210 @@
|
|
|
</div>
|
|
|
</template>
|
|
|
<script setup lang="ts">
|
|
|
+ import {getRealtime, getAlertRecordsByDevice} from '@/api/bigScreen';
|
|
|
+ import { filterTime } from '@/utils/dateUtil'
|
|
|
+ import { onSubscribe, onUnsubscribe, formatGears, formatValue, isTrue,parseGear} from '@/utils/tools';
|
|
|
import router from '@/router';
|
|
|
- const left_bottom_list = [
|
|
|
- {
|
|
|
- 'id':0,
|
|
|
- 'name':'左行限位'
|
|
|
- },
|
|
|
- {
|
|
|
- 'id':1,
|
|
|
- 'name':'左防撞减速限位'
|
|
|
- },
|
|
|
- {
|
|
|
- 'id':2,
|
|
|
- 'name':'右行限位'
|
|
|
- },
|
|
|
- {
|
|
|
- 'id':3,
|
|
|
- 'name':'右防撞减速限位'
|
|
|
- },
|
|
|
- {
|
|
|
- 'id':4,
|
|
|
- 'name':'有梯侧翻板夹轨器限位'
|
|
|
- },
|
|
|
- {
|
|
|
- 'id':5,
|
|
|
- 'name':'有梯侧定位器'
|
|
|
- },
|
|
|
- {
|
|
|
- 'id':6,
|
|
|
- 'name':'无梯侧翻板夹轨器限位'
|
|
|
- },
|
|
|
- {
|
|
|
- 'id':7,
|
|
|
- 'name':'无梯侧定位器'
|
|
|
- },
|
|
|
- {
|
|
|
- 'id':8,
|
|
|
- 'name':'有梯侧油泵夹轮限位'
|
|
|
- },
|
|
|
- {
|
|
|
- 'id':9,
|
|
|
- 'name':'无梯侧油泵夹轮限位'
|
|
|
- },
|
|
|
- ]
|
|
|
- const right_samll_list = [
|
|
|
- {
|
|
|
- 'id':0,
|
|
|
- 'name':'前行限位'
|
|
|
- },
|
|
|
- {
|
|
|
- 'id':1,
|
|
|
- 'name':'前极限限位'
|
|
|
- },
|
|
|
- {
|
|
|
- 'id':2,
|
|
|
- 'name':'热继保护'
|
|
|
- },
|
|
|
- {
|
|
|
- 'id':3,
|
|
|
- 'name':'后行限位'
|
|
|
- },
|
|
|
- {
|
|
|
- 'id':4,
|
|
|
- 'name':'后极限限位'
|
|
|
- },
|
|
|
- {
|
|
|
- 'id':5,
|
|
|
- 'name':'小车锚定'
|
|
|
+ const deviceId = ref(0)
|
|
|
+ const deviceCode = ref('')
|
|
|
+
|
|
|
+ const deviceData: any = ref({})
|
|
|
+ const craneData: any = ref({})
|
|
|
+ const craneStrokeData: any = ref({})
|
|
|
+ const craneGearData: any = ref({})
|
|
|
+ const craneBrakeData: any = ref({})
|
|
|
+ const craneFrequencyData: any = ref({})
|
|
|
+ const craneCurrentData: any = ref({})
|
|
|
+ const craneSwitchVariablesData: any = ref([])
|
|
|
+
|
|
|
+ const switchVariableArr: any = ref([])
|
|
|
+
|
|
|
+ const workingCurrentArr: any = ref([])
|
|
|
+
|
|
|
+ const alarmRecordArr: any = ref([]);
|
|
|
+
|
|
|
+ const valueVariableArr: any = ref([]);
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 拆分数组
|
|
|
+ * @param array 数组
|
|
|
+ * @param size 拆分的数量
|
|
|
+ */
|
|
|
+ const chunkArray = (array: any, size: number) => {
|
|
|
+ const arr: any = []
|
|
|
+ for (let index = 0; index < array.length; index += size) {
|
|
|
+ arr.push(array.slice(index, index + size));
|
|
|
+ }
|
|
|
+ return arr;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ onMounted(async () => {
|
|
|
+ deviceId.value = parseInt(useQuery('id'))
|
|
|
+ deviceCode.value = useQuery('code')
|
|
|
+ getData()
|
|
|
+ })
|
|
|
+
|
|
|
+ onUnmounted(() => {
|
|
|
+
|
|
|
+ })
|
|
|
+
|
|
|
+ const getColor = (item:any) => {
|
|
|
+ if(item.value){
|
|
|
+ return item.trueLight
|
|
|
+ }else{
|
|
|
+ return item.falseLight
|
|
|
}
|
|
|
- ]
|
|
|
- const right_bottom_list = [
|
|
|
- {
|
|
|
- 'id':0,
|
|
|
- 'name':'前行限位'
|
|
|
- },
|
|
|
- {
|
|
|
- 'id':1,
|
|
|
- 'name':'前极限限位'
|
|
|
- },
|
|
|
- {
|
|
|
- 'id':2,
|
|
|
- 'name':'热继保护'
|
|
|
- },
|
|
|
- {
|
|
|
- 'id':3,
|
|
|
- 'name':'后行限位'
|
|
|
- },
|
|
|
- {
|
|
|
- 'id':4,
|
|
|
- 'name':'后极限限位'
|
|
|
- },
|
|
|
- {
|
|
|
- 'id':5,
|
|
|
- 'name':'小车锚定'
|
|
|
+ }
|
|
|
+
|
|
|
+ const getData = async () => {
|
|
|
+ const res: any = await getRealtime({ deviceId: deviceId.value })
|
|
|
+ deviceData.value = res
|
|
|
+ //大车数据
|
|
|
+ craneData.value = deviceData.value.crane
|
|
|
+ //大车行程
|
|
|
+ craneStrokeData.value = craneData.value.stroke
|
|
|
+ //大车挡位
|
|
|
+ craneGearData.value = craneData.value.gear
|
|
|
+ //大车制动器
|
|
|
+ if(craneData.value.brake){
|
|
|
+ craneBrakeData.value = craneData.value.brake
|
|
|
}
|
|
|
- ]
|
|
|
- const right_alert = [
|
|
|
- {
|
|
|
- 'id':0,
|
|
|
- 'name':'设备超载',
|
|
|
- 'type':'报警',
|
|
|
- 'time':'2024-01-01 14:33'
|
|
|
- },
|
|
|
- {
|
|
|
- 'id':1,
|
|
|
- 'name':'设备超速',
|
|
|
- 'type':'报警',
|
|
|
- 'time':'2024-01-01 14:33'
|
|
|
- },
|
|
|
- {
|
|
|
- 'id':2,
|
|
|
- 'name':'设备故障',
|
|
|
- 'type':'报警',
|
|
|
- 'time':'2024-01-01 14:33'
|
|
|
- },
|
|
|
- {
|
|
|
- 'id':3,
|
|
|
- 'name':'设备损坏',
|
|
|
- 'type':'报警',
|
|
|
- 'time':'2024-01-01 14:33'
|
|
|
+ //大车频率
|
|
|
+ if(craneData.value.frequency){
|
|
|
+ craneFrequencyData.value = craneData.value.frequency
|
|
|
}
|
|
|
- ]
|
|
|
- const middle_bottom_right_grid_list = [
|
|
|
- {
|
|
|
- 'id':0,
|
|
|
- 'name':'上升限位'
|
|
|
- },
|
|
|
- {
|
|
|
- 'id':1,
|
|
|
- 'name':'上升预限位'
|
|
|
- },
|
|
|
- {
|
|
|
- 'id':2,
|
|
|
- 'name':'右行限位'
|
|
|
- },
|
|
|
- {
|
|
|
- 'id':3,
|
|
|
- 'name':'右防撞减速'
|
|
|
- },
|
|
|
- {
|
|
|
- 'id':4,
|
|
|
- 'name':'有梯侧翻板'
|
|
|
- },
|
|
|
- {
|
|
|
- 'id':5,
|
|
|
- 'name':'有梯侧定位器'
|
|
|
- },
|
|
|
- {
|
|
|
- 'id':6,
|
|
|
- 'name':'无梯侧翻板夹'
|
|
|
- },
|
|
|
- {
|
|
|
- 'id':7,
|
|
|
- 'name':'无梯侧定位器'
|
|
|
- },
|
|
|
- {
|
|
|
- 'id':8,
|
|
|
- 'name':'有梯侧油泵夹'
|
|
|
- },
|
|
|
- {
|
|
|
- 'id':9,
|
|
|
- 'name':'无梯侧油泵'
|
|
|
- },
|
|
|
- {
|
|
|
- 'id':10,
|
|
|
- 'name':'无梯侧油泵'
|
|
|
- },
|
|
|
- {
|
|
|
- 'id':11,
|
|
|
- 'name':'无梯侧油泵'
|
|
|
- },
|
|
|
- ]
|
|
|
- onMounted(async () => {
|
|
|
- })
|
|
|
+ //大车电流
|
|
|
+ if(craneData.value.current){
|
|
|
+ craneCurrentData.value = craneData.value.current
|
|
|
+ }
|
|
|
+ //大车开关量
|
|
|
+ craneSwitchVariablesData.value = craneData.value.switchVariables
|
|
|
|
|
|
+ const record = await getAlertRecordsByDevice({ deviceId: deviceId.value, maxCount: 10 })
|
|
|
+ alarmRecordArr.value = record
|
|
|
+
|
|
|
+ onSubscribe([`Json/${deviceCode.value}`], (topic: string, payload: any) => {
|
|
|
+ console.log('1111'+JSON.stringify(JSON.parse(payload)))
|
|
|
+ const jsonArray = JSON.parse(payload).Items
|
|
|
+ parseMqttData(jsonArray)
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
+ //解析数据
|
|
|
+ const parseMqttData = (jsonArray: any) => {
|
|
|
+ jsonArray.forEach((res: any) => {
|
|
|
+ const { Value, Code } = res
|
|
|
+ //大车档位
|
|
|
+ const craneGear = craneGearData.value
|
|
|
+ if (craneGear) {
|
|
|
+ if (parseGear(craneGear, Code, Value)) {
|
|
|
+ return
|
|
|
+ }
|
|
|
+ }
|
|
|
+ //大车行程
|
|
|
+ const craneStroke = craneStrokeData.value
|
|
|
+ if(craneStroke) {
|
|
|
+ if (craneStroke.code == Code) {
|
|
|
+ craneStroke.value = formatValue(Value, craneStroke.translate)
|
|
|
+ return
|
|
|
+ }
|
|
|
+ }
|
|
|
+ //大车制动器
|
|
|
+ const craneBrake = craneBrakeData.value
|
|
|
+ if(craneBrake) {
|
|
|
+ if (craneBrake.code == Code) {
|
|
|
+ craneBrake.value = formatValue(Value, craneBrake.translate)
|
|
|
+ return
|
|
|
+ }
|
|
|
+ }
|
|
|
+ //大车频率
|
|
|
+ const craneFrequency = craneFrequencyData.value
|
|
|
+ if(craneFrequency) {
|
|
|
+ if (craneFrequency.code == Code) {
|
|
|
+ craneFrequency.value = formatValue(Value, craneFrequency.translate)
|
|
|
+ return
|
|
|
+ }
|
|
|
+ }
|
|
|
+ //大车电流
|
|
|
+ const craneCurrent = craneCurrentData.value
|
|
|
+ if(craneCurrent) {
|
|
|
+ if (craneCurrent.code == Code) {
|
|
|
+ craneCurrent.value = formatValue(Value, craneCurrent.translate)
|
|
|
+ return
|
|
|
+ }
|
|
|
+ }
|
|
|
+ //大车开关量
|
|
|
+ craneSwitchVariablesData.value.forEach((item: any) => {
|
|
|
+ const result = item.find((item: any) => item.code == Code)
|
|
|
+ if (result) {
|
|
|
+ result.value = result.isReverse != Value
|
|
|
+ return
|
|
|
+ }
|
|
|
+ })
|
|
|
+ //小车
|
|
|
+ // deviceData.value.trolleys.forEach((item: any) => {
|
|
|
+ // //档位
|
|
|
+ // if (parseGear(item.gear, Code, Value)) {
|
|
|
+ // return
|
|
|
+ // }
|
|
|
+ // //吊钩
|
|
|
+ // item.hoists.forEach((item: any) => {
|
|
|
+ // //档位
|
|
|
+ // if (parseGear(item.gear, Code, Value)) {
|
|
|
+ // return
|
|
|
+ // }
|
|
|
+ // //重量
|
|
|
+ // const weight = item.weight
|
|
|
+ // if (weight?.code == Code) {
|
|
|
+ // weight.value = formatValue(Value, weight.translate)
|
|
|
+ // return
|
|
|
+ // }
|
|
|
+ // //超载
|
|
|
+ // const light = weight?.light
|
|
|
+ // if (light?.code == Code) {
|
|
|
+ // light.value = light.isReverse != Value
|
|
|
+ // return
|
|
|
+ // }
|
|
|
+ // })
|
|
|
+ // })
|
|
|
+
|
|
|
+ //开关量
|
|
|
+ switchVariableArr.value.forEach((item: any) => {
|
|
|
+ const result = item.find((item: any) => item.code == Code)
|
|
|
+ if (result) {
|
|
|
+ result.value = result.isReverse != Value
|
|
|
+ return
|
|
|
+ }
|
|
|
+ })
|
|
|
+
|
|
|
+ //工作电流
|
|
|
+ workingCurrentArr.value.forEach((item: any) => {
|
|
|
+ const result = item.find((item: any) => item.code == Code)
|
|
|
+ if (result) {
|
|
|
+ console.log(res)
|
|
|
+ result.value = formatValue(Value, result.translate)
|
|
|
+ return
|
|
|
+ }
|
|
|
+ })
|
|
|
+
|
|
|
+ //模拟量
|
|
|
+ valueVariableArr.value.forEach((item: any) => {
|
|
|
+ const result = item.find((item: any) => item.code == Code)
|
|
|
+ if (result) {
|
|
|
+ if (result.variableType == 10) {
|
|
|
+ result.value = Value === true ? '开启' : '闭合'
|
|
|
+ } else {
|
|
|
+ result.value = formatValue(Value, result.translate)
|
|
|
+ }
|
|
|
+ return
|
|
|
+ }
|
|
|
+ })
|
|
|
+ })
|
|
|
+ }
|
|
|
|
|
|
onUnmounted(() => {
|
|
|
+ onUnsubscribe(`Json/${deviceCode.value}`)
|
|
|
})
|
|
|
|
|
|
const backMainPage = () => {
|
|
@@ -588,25 +576,25 @@
|
|
|
position: relative;
|
|
|
}
|
|
|
.top-bg {
|
|
|
- width: 100%;
|
|
|
- height: 77px;
|
|
|
- background-image: url(../../assets/img/big_screen_top_bg.png);
|
|
|
- background-repeat: no-repeat;
|
|
|
- background-size: 100% 100%;
|
|
|
- position: absolute;
|
|
|
- cursor: pointer;
|
|
|
- .device-name {
|
|
|
- color: white;
|
|
|
- font-size: 30px;
|
|
|
- position: absolute;
|
|
|
- left: 50%;
|
|
|
- top: 35%;
|
|
|
- font-weight: bold;
|
|
|
- transform: translateX(-50%) translateY(-35%);
|
|
|
- font-family: Alibaba-PuHuiTi-R;
|
|
|
- font-style: normal;
|
|
|
- text-transform: none;
|
|
|
- }
|
|
|
+ width: 100%;
|
|
|
+ height: 77px;
|
|
|
+ background-image: url(../../assets/img/big_screen_top_bg.png);
|
|
|
+ background-repeat: no-repeat;
|
|
|
+ background-size: 100% 100%;
|
|
|
+ position: absolute;
|
|
|
+ cursor: pointer;
|
|
|
+ .device-name {
|
|
|
+ color: white;
|
|
|
+ font-size: 30px;
|
|
|
+ position: absolute;
|
|
|
+ left: 50%;
|
|
|
+ top: 35%;
|
|
|
+ font-weight: bold;
|
|
|
+ transform: translateX(-50%) translateY(-35%);
|
|
|
+ font-family: Alibaba-PuHuiTi-R;
|
|
|
+ font-style: normal;
|
|
|
+ text-transform: none;
|
|
|
+ }
|
|
|
}
|
|
|
.left {
|
|
|
top: 77px;
|
|
@@ -644,8 +632,6 @@
|
|
|
gap: 11px;
|
|
|
}
|
|
|
.left_bottom_grid_item {
|
|
|
- background-color: #334A6C;
|
|
|
- border: 1px solid #455A7A;
|
|
|
border-radius: 5px;
|
|
|
display: flex;
|
|
|
align-items: center;
|
|
@@ -654,6 +640,14 @@
|
|
|
font-size: 16px;
|
|
|
font-family: Alibaba-PuHuiTi-R;
|
|
|
}
|
|
|
+ .red{
|
|
|
+ background-color: red;
|
|
|
+ border: 1px solid #455A7A;
|
|
|
+ }
|
|
|
+ .green{
|
|
|
+ background-color: green;
|
|
|
+ border: 1px solid #455A7A;
|
|
|
+ }
|
|
|
.middle {
|
|
|
top: 77px;
|
|
|
left: 50%;
|
|
@@ -751,7 +745,6 @@
|
|
|
padding: 10px 39px;
|
|
|
}
|
|
|
.right_small_grid {
|
|
|
- margin-top: 36px;
|
|
|
display: grid;
|
|
|
grid-template-rows: 32px 32px;
|
|
|
grid-template-columns: 110px 110px 110px;
|