Browse Source

fix: 对接电动门接口 电梯接口

temp
zhaohy 3 months ago
parent
commit
580d82639d
  1. 6
      hx-ai-intelligent/src/api/liftSystem.ts
  2. 28
      hx-ai-intelligent/src/view/alarmManagement/energyAlarm/look.vue
  3. 28
      hx-ai-intelligent/src/view/alarmManagement/equipmentAlarm/look.vue
  4. 24
      hx-ai-intelligent/src/view/alarmManagement/gatewayAlarm/look.vue
  5. 130
      hx-ai-intelligent/src/view/equipmentControl/liftSystem/index.vue
  6. 42
      hx-ai-intelligent/src/view/equipmentControl/liftSystem/liftInfo.vue
  7. 101
      hx-ai-intelligent/src/view/equipmentControl/liftSystem/liftPage.vue
  8. 20
      hx-ai-intelligent/src/view/equipmentControl/liftSystem/liftPosition.ts
  9. 13
      hx-ai-intelligent/src/view/equipmentControl/planToAdd/index.vue

6
hx-ai-intelligent/src/api/liftSystem.ts

@ -0,0 +1,6 @@
import { BASE_URL } from './index';
export enum liftSystemApi {
getDeviceState = `${BASE_URL}/elevatorCtrl/getDeviceState`, // 查询设备最新状态
getDeviceRecordList = `${BASE_URL}/elevatorCtrl/getDeviceRecordList`, // 查询设备日志列表
}

28
hx-ai-intelligent/src/view/alarmManagement/energyAlarm/look.vue

@ -10,12 +10,13 @@
@close="handleClose">
<div style="width: 100%; height: 100%; overflow-y: auto; overflow-x: hidden">
<!-- top -->
<div class="box">
<div class="card"></div>
<div style="left: 25px; position: absolute; height: 35px; line-height: 35px">
<div class="boxstyle">
<div
class="ns-title-extra-box"
style="left: 5px; position: absolute; height: 35px; line-height: 30px">
告警编号{{ infoObject.alarmCode }}
</div>
<div style="right: 20px; position: absolute; height: 35px; line-height: 35px">
<div style="right: 20px; position: absolute; height: 35px; line-height: 30px">
{{ infoObject.updateTime }}
</div>
</div>
@ -284,23 +285,18 @@
});
</script>
<style scoped lang="less">
.box {
.boxstyle {
width: 100%;
height: 35px;
display: flex;
position: relative;
font-size: @font-size-base;
border-bottom: 1px solid @primary-color;
}
.card {
position: absolute;
left: 0px;
top: 0px;
width: 5px;
height: 35px;
background-color: @primary-color;
color: rgba(51, 51, 51, 1);
font-size: 16px;
font-weight: 700;
}
:deep(.ant-descriptions-item-label) {
width: 25%;
width: 134px;
text-align: center;
font-weight: 700;
}
</style>

28
hx-ai-intelligent/src/view/alarmManagement/equipmentAlarm/look.vue

@ -10,12 +10,13 @@
@close="handleClose">
<div style="width: 100%; height: 100%; overflow-y: auto; overflow-x: hidden">
<!-- top -->
<div class="box">
<div class="card"></div>
<div style="left: 25px; position: absolute; height: 35px; line-height: 35px">
<div class="boxstyle">
<div
class="ns-title-extra-box"
style="left: 5px; position: absolute; height: 35px; line-height: 30px">
告警编号{{ infoObject.alarmCode }}
</div>
<div style="right: 20px; position: absolute; height: 35px; line-height: 35px">
<div style="right: 20px; position: absolute; height: 35px; line-height: 30px">
{{ infoObject.updateTime }}
</div>
</div>
@ -34,7 +35,7 @@
}}</a-descriptions-item>
<a-descriptions-item label="错误码">{{ infoObject.errorCode }}</a-descriptions-item>
<a-descriptions-item label="告警描述">
<div style="color: #2778ff">{{ infoObject.alarmTitle }}</div>
<div style="color: rgba(255, 118, 54, 1)">{{ infoObject.alarmTitle }}</div>
{{ infoObject.abnormalDescription }}</a-descriptions-item
>
<a-descriptions-item label="设备信息"> {{ infoObject.deviceInfo }} </a-descriptions-item>
@ -291,15 +292,18 @@
font-size: @font-size-base;
border-bottom: 1px solid @primary-color;
}
.card {
position: absolute;
left: 0px;
top: 0px;
width: 5px;
.boxstyle {
width: 100%;
height: 35px;
background-color: @primary-color;
display: flex;
position: relative;
color: rgba(51, 51, 51, 1);
font-size: 16px;
font-weight: 700;
}
:deep(.ant-descriptions-item-label) {
width: 25%;
width: 134px;
text-align: center;
font-weight: 700;
}
</style>

24
hx-ai-intelligent/src/view/alarmManagement/gatewayAlarm/look.vue

@ -11,11 +11,12 @@
<div style="width: 100%; height: 100%; overflow-y: auto; overflow-x: hidden">
<!-- top -->
<div class="boxstyle">
<div class="card"></div>
<div style="left: 25px; position: absolute; height: 35px; line-height: 35px">
<div
class="ns-title-extra-box"
style="left: 25px; position: absolute; height: 35px; line-height: 30px">
告警编号{{ infoObject.alarmCode }}
</div>
<div style="right: 20px; position: absolute; height: 35px; line-height: 35px">
<div style="right: 30px; position: absolute; height: 35px; line-height: 30px">
{{ infoObject.updateTime }}
</div>
</div>
@ -276,18 +277,13 @@
height: 35px;
display: flex;
position: relative;
font-size: @font-size-base;
border-bottom: 1px solid @primary-color;
}
.card {
position: absolute;
left: 0px;
top: 0px;
width: 5px;
height: 35px;
background-color: @primary-color;
color: rgba(51, 51, 51, 1);
font-size: 16px;
font-weight: 700;
}
:deep(.ant-descriptions-item-label) {
width: 25%;
width: 134px;
text-align: center;
font-weight: 700;
}
</style>

130
hx-ai-intelligent/src/view/equipmentControl/liftSystem/index.vue

@ -29,9 +29,17 @@
</template>
<script setup lang="ts">
import { ref, onMounted } from 'vue';
import { ref, onMounted, onUnmounted } from 'vue';
import liftInfo from './liftInfo.vue';
import liftPage from './liftPage.vue';
import { liftSystemApi } from '/@/api/liftSystem';
import { http } from '/nerv-lib/util';
//
import { items } from '/@/store/item';
//
const state = items();
//
import { liftPosition, longPosition } from './liftPosition';
//
//
@ -42,85 +50,53 @@
const selctLeft = ref({});
// table ref
const leftPage = ref(null);
// ===========================================================
onMounted(() => {});
const liftBox = ref([]);
// tab ========================================================
const liftBox = ref([
{
name: '1站台西侧扶梯',
workState: 1,
faultState: 2,
direction: 1,
type: 2,
isLeft: true,
styleText: { left: '10%', bottom: '33%' },
},
{
name: '2站台西侧扶梯',
workState: 1,
faultState: 2,
direction: 1,
type: 2,
isLeft: true,
styleText: { left: '3%', bottom: '52%' },
},
{
name: '2站台东侧扶梯',
workState: 1,
faultState: 2,
direction: 1,
type: 2,
isLeft: true,
styleText: { left: '48%', bottom: '69%' },
},
{
name: '1站台东侧扶梯',
workState: 1,
faultState: 2,
direction: 1,
type: 2,
isLeft: true,
styleText: { left: '65%', bottom: '62%' },
},
{
name: '办公东区扶梯',
workState: 1,
faultState: 2,
direction: 1,
type: 2,
isLeft: true,
styleText: { left: '78%', bottom: '42%' },
},
{
name: '办公西区扶梯',
workState: 1,
faultState: 2,
direction: 1,
type: 2,
isLeft: true,
styleText: { left: '15%', bottom: '15%' },
},
{
name: '1站台直梯',
workState: 0,
faultState: 3,
direction: 0,
type: 1,
isLeft: false,
styleText: { left: '35%', bottom: '50%' },
},
{
name: '2站台直梯',
workState: 0,
faultState: 3,
direction: 0,
//
const getList = () => {
let leftIndex = 0;
let longIndex = 0;
http
.get(liftSystemApi.getDeviceState, {
projectId: state.projectId,
siteId: state.siteId,
floor: 1,
})
.then((res) => {
let data = [];
res.data.forEach((item: any) => {
//
if (item.record.deviceId.includes('0301')) {
data.push({
...item,
type: 2, //
isLeft: true, //
styleText: liftPosition()[leftIndex++],
});
} else {
data.push({
...item,
type: 1,
isLeft: false,
styleText: { left: '52%', bottom: '52%' },
},
]);
styleText: longPosition()[longIndex++],
});
}
});
console.log(data);
liftBox.value = data;
});
};
//
const intervalId = setInterval(getList, 60000);
// ===========================================================
onMounted(() => {
getList();
});
//
onUnmounted(() => {
//
clearInterval(intervalId);
});
//
const clickLift = (item: any) => {
visible.value = true;

42
hx-ai-intelligent/src/view/equipmentControl/liftSystem/liftInfo.vue

@ -7,7 +7,7 @@
<div class="info-box">
<div class="box-title">
<div class="dot"></div>
<span>{{ info.name }}</span>
<span>{{ info.deviceInfoName }}</span>
</div>
<div class="box-inner">
<!-- 是否开启 -->
@ -15,13 +15,16 @@
<div class="item-box">
<div class="icon">
<div class="icon-item">
<img v-if="info.workState" src="../image/liftState/switch-on.svg" alt="" />
<img
v-if="info.record.switchStatus.value === 1"
src="../image/liftState/switch-on.svg"
alt="" />
<img v-else src="../image/liftState/switch-off.svg" alt="" />
</div>
</div>
</div>
<div class="item-text">
<span v-if="info.workState" style="color: var(--on)">开启</span>
<span v-if="info.record.switchStatus.value === 1" style="color: var(--on)">开启</span>
<span v-else style="color: var(--off)">关闭</span>
</div>
</div>
@ -33,7 +36,9 @@
<div class="icon-item">
<img
:src="
{ '0': stateNormal, '1': stateRepair, '2': stateFault, '3': stateAlarm }[3]
{ '0': stateNormal, '1': stateFault, '2': stateRepair, '3': stateAlarm }[
info.record.runStatus.value
]
"
alt="" />
</div>
@ -44,12 +49,12 @@
:style="{
color: {
'0': 'rgba(0, 255, 210, 1)', //
'1': 'rgba(255, 188, 70, 1)', //
'2': 'rgba(255, 118, 54, 1)', //
'1': 'rgba(255, 118, 54, 1)', //
'2': 'rgba(255, 188, 70, 1)', //
'3': 'rgba(243, 97, 99, 1)', //
}[3],
}[info.record.runStatus.value],
}"
>{{ { '0': '正常', '1': '维修', '2': '故障', '3': '告警' }[3] }}</div
>{{ info.record.runStatus.label }}</div
>
</div>
<!-- 如何运行 -->
@ -66,7 +71,7 @@
'2': liftPause,
'3': liftStop,
'4': liftUnknown,
}[2]
}[info.record.runMode.value]
"
alt="" />
</div>
@ -81,17 +86,9 @@
'2': 'rgba(255, 188, 70, 1)', //
'3': 'rgba(243, 97, 99, 1)', //
'4': 'rgba(167, 66, 255, 1)', //
}[2],
}[info.record.runMode.value],
}"
>{{
{
'0': '上行', //
'1': '下行', //
'2': '暂停', //
'3': '急停', //
'4': '未知', //
}[2]
}}</div
>{{ info.record.runMode.label }}</div
>
</div>
</div>
@ -189,19 +186,20 @@
.box-title {
font-size: 14px;
height: auto;
margin-left: 12px;
color: var(--text);
//
.dot {
display: inline-block;
width: 2px;
height: 12px;
height: 10px;
vertical-align: middle;
margin-top: -4px;
margin-top: -2.5px;
background: var(--text);
}
//
span {
padding-left: 8px;
padding-left: 4px;
}
}
//

101
hx-ai-intelligent/src/view/equipmentControl/liftSystem/liftPage.vue

@ -12,7 +12,7 @@
src="../image/liftState/escalator.png"
alt="" />
<div style="margin-left: 6px; font-size: 20px; line-height: 28px">
{{ selctLeft.name }}
{{ selctLeft.deviceInfoName }}
</div>
</div>
<!-- 左侧抽屉的关闭按钮 -->
@ -23,6 +23,7 @@
<a-table
style="width: 100%"
:columns="column"
:loading="loading"
:data-source="dataSource"
:pagination="pagination">
<template #bodyCell="{ record, column }">
@ -31,15 +32,15 @@
style="background-color: rgba(0, 0, 0, 0.5); width: 50px"
:style="{
border: {
'0': '1px solid rgba(0, 255, 210, 1)', //2
'1': '1px solid rgba(191, 205, 226, 1)', //
}[record.switch],
'1': '1px solid rgba(0, 255, 210, 1)', //2
'0': '1px solid rgba(191, 205, 226, 1)', //
}[record.switchStatus.value],
color: {
'0': 'rgba(0, 255, 210, 1)', //
'1': 'rgba(191, 205, 226, 1)', //
}[record.switch],
'1': 'rgba(0, 255, 210, 1)', //
'0': 'rgba(191, 205, 226, 1)', //
}[record.switchStatus.value],
}"
>{{ { '0': '开启', '1': '关闭' }[record.switch] }}</a-tag
>{{ { '1': '开启', '0': '关闭' }[record.switchStatus.value] }}</a-tag
>
</template>
<template v-if="column.dataIndex === 'state'">
@ -48,18 +49,18 @@
:style="{
border: {
'0': '1px solid rgba(0, 255, 210, 1)', //
'1': '1px solid rgba(255, 188, 70, 1)', //
'2': '1px solid rgba(255, 118, 54, 1)', //
'1': '1px solid rgba(255, 118, 54, 1)', //
'2': '1px solid rgba(255, 188, 70, 1)', //
'3': '1px solid rgba(243, 97, 99, 1)', //
}[record.state],
}[record.runStatus.value],
color: {
'0': 'rgba(0, 255, 210, 1)', //
'1': 'rgba(255, 188, 70, 1)', //
'2': 'rgba(255, 118, 54, 1)', //
'1': 'rgba(255, 118, 54, 1)', //
'2': 'rgba(255, 188, 70, 1)', //
'3': 'rgba(243, 97, 99, 1)', //
}[record.state],
}[record.runStatus.value],
}"
>{{ { '0': '正常', '1': '维修', '2': '故障', '3': '告警' }[record.state] }}</a-tag
>{{ record.runStatus.label }}</a-tag
>
</template>
<template v-if="column.dataIndex === 'lift'">
@ -72,24 +73,16 @@
'2': '1px solid rgba(255, 188, 70, 1)', //
'3': '1px solid rgba(243, 97, 99, 1)', //
'4': '1px solid rgba(167, 66, 255, 1)', //
}[record.lift],
}[record.runMode.value],
color: {
'0': 'rgba(0, 255, 210, 1)', //
'1': 'rgba(0, 255, 210, 1)', //
'2': 'rgba(255, 188, 70, 1)', //
'3': 'rgba(243, 97, 99, 1)', //
'4': 'rgba(167, 66, 255, 1)', //
}[record.lift],
}[record.runMode.value],
}"
>{{
{
'0': '上行', //
'1': '下行', //
'2': '暂停', //
'3': '急停', //
'4': '未知', //
}[record.lift]
}}</a-tag
>{{ record.runMode.label }}</a-tag
>
</template>
</template>
@ -99,38 +92,25 @@
</template>
<script setup lang="ts">
import { DoubleRightOutlined } from '@ant-design/icons-vue';
import { liftSystemApi } from '/@/api/liftSystem';
import { http } from '/nerv-lib/util';
//
import { items } from '/@/store/item';
//
const state = items();
import { ref } from 'vue';
const emit = defineEmits(['clickDrawer']);
const selctLeft = ref({});
const loading = ref(false);
//
const handleChangePage = (current: number, pageSize: number) => {
pagination.value.current = current;
pagination.value.pageSize = pageSize;
getList();
};
const dataSource = ref([
{ time: '2022-03-01 10:00:00', state: '0', switch: '0', lift: 1 },
{ time: '2022-03-01 10:00:00', state: '1', switch: 0, lift: 2 },
{ time: '2022-03-01 10:00:00', state: '2', switch: 0, lift: 1 },
{ time: '2022-03-01 10:00:00', state: '3', switch: 0, lift: 0 },
{ time: '2022-03-01 10:00:00', state: '1', switch: 0, lift: 1 },
{ time: '2022-03-01 10:00:00', state: '3', switch: 0, lift: 3 },
{ time: '2022-03-01 10:00:00', state: '2', switch: 0, lift: 1 },
{ time: '2022-03-01 10:00:00', state: '0', switch: 0, lift: 4 },
{ time: '2022-03-01 10:00:00', state: '1', switch: 0, lift: 1 },
{ time: '2022-03-01 10:00:00', state: '3', switch: 0, lift: 1 },
{ time: '2022-03-01 10:00:00', state: '2', switch: 0, lift: 1 },
{ time: '2022-03-01 10:00:00', state: '2', switch: 0, lift: 0 },
{ time: '2022-03-01 10:00:00', state: '1', switch: 0, lift: 1 },
{ time: '2022-03-01 10:00:00', state: '3', switch: 0, lift: 3 },
{ time: '2022-03-01 10:00:00', state: '1', switch: 0, lift: 1 },
{ time: '2022-03-01 10:00:00', state: '0', switch: 0, lift: 4 },
{ time: '2022-03-01 10:00:00', state: '2', switch: 0, lift: 1 },
{ time: '2022-03-01 10:00:00', state: '1', switch: 0, lift: 2 },
{ time: '2022-03-01 10:00:00', state: '2', switch: 0, lift: 1 },
]);
const dataSource = ref([]);
const pagination = ref({
total: dataSource.value.length,
size: 'small',
@ -169,9 +149,31 @@
width: 80,
},
];
const getList = () => {
loading.value = true;
http
.get(liftSystemApi.getDeviceRecordList, {
projectId: state.projectId,
siteId: state.siteId,
codeList: selctLeft.value.record.deviceInfoCode,
page: pagination.value.current,
size: pagination.value.pageSize,
})
.then((res) => {
if (res.msg === 'success') {
dataSource.value = res.data.data;
pagination.value.total = res.data.total;
}
})
.finally(() => {
loading.value = false;
});
};
const toggle = (data: any) => {
pagination.value.current = 1;
selctLeft.value = data;
getList();
};
const clickDrawer = () => {
emit('clickDrawer');
@ -278,4 +280,7 @@
:deep(.anticon) {
color: #fff !important;
}
:deep(.ant-empty-description) {
color: white !important;
}
</style>

20
hx-ai-intelligent/src/view/equipmentControl/liftSystem/liftPosition.ts

@ -1,3 +1,21 @@
// 此文件只定义lift(即电梯)的位置信息
// 与显示状态和分组信息无关
export const liftPosition = [];
export const liftPosition = () => {
return [
{ left: '10%', bottom: '33%' },
{ left: '3%', bottom: '52%' },
{ left: '48%', bottom: '69%' },
{ left: '65%', bottom: '62%' },
{ left: '78%', bottom: '42%' },
{ left: '15%', bottom: '15%' },
];
};
export const longPosition = () => {
return [
{ left: '35%', bottom: '50%' },
{ left: '52%', bottom: '52%' },
{ left: '35%', bottom: '50%' },
{ left: '52%', bottom: '52%' },
];
};

13
hx-ai-intelligent/src/view/equipmentControl/planToAdd/index.vue

@ -35,6 +35,13 @@
title: '编辑',
schemas: [
{ field: 'id', component: 'NsInput', show: false },
{ field: 'siteId', component: 'NsInput', show: false },
{ field: 'planCode', component: 'NsInput', show: false },
{ field: 'planGroupCode', component: 'NsInput', show: false },
{ field: 'planGroupName', component: 'NsInput', show: false },
{ field: 'planName', component: 'NsInput', show: false },
{ field: 'projectId', component: 'NsInput', show: false },
{ field: 'deviceType', component: 'NsInput', show: false },
{ field: 'orgId', component: 'NsInput', show: false },
{
field: 'createTime',
@ -157,11 +164,14 @@
name: 'energyAlarmEdit',
dynamicParams: ['uuid', 'appealType'],
handle: (data: any) => {
if (data?.executeStatus?.value === 2) {
NsMessage.warning('当前计划正在执行,无法进行编辑。如需编辑,请先停止计划.');
} else {
const obj = { ...data };
nsModalFormConfig.value.title = '编辑';
setTimeout(() => {
nsModalFormConfig.value.data = {
id: obj.id,
...obj,
};
if (obj.startTime) {
nsModalFormConfig.value.data.createTime = obj.startTime
@ -170,6 +180,7 @@
}
}, 1);
modalFormRef.value?.toggle();
}
},
},
{

Loading…
Cancel
Save