fix: BUG修改

This commit is contained in:
cjp 2023-09-09 14:33:31 +08:00
parent e9e575fa8b
commit 8f7bdb1cc0
3 changed files with 51 additions and 20 deletions

View File

@ -18,7 +18,7 @@
<span>额定人数: {{ equipInfo.ratedPeopleNum ? equipInfo.ratedPeopleNum : 0 }}</span>
<span>当前楼层数: {{ equipInfo.floorNum ? equipInfo.floorNum : 0 }}</span>
<span>最大高度: {{ equipInfo.height ? equipInfo.height : 0 }}m</span>
<span>高度百分比: {{ equipInfo.heightRatio ? equipInfo.heightRatio : 0 }}%</span>
<!-- <span>高度百分比: {{ equipInfo.heightRatio ? equipInfo.heightRatio : 0 }}%</span> -->
<!-- <span>额定上行速度: {{ equipInfo.maxHeight ? equipInfo.maxHeight : 0 }}m</span>
<span>额定下行速度: {{ equipInfo.maxHeight ? equipInfo.maxHeight : 0 }}m</span> -->
</div>
@ -179,6 +179,7 @@ const monitorList = ref([]);
const alarmList = ref([]);
const equipList = ref([]);
const equipInfo = ref({});
const activeValue = ref("eng");
const searchForm = ref({
timeRange: []
});
@ -280,7 +281,8 @@ const alarmTransform = (obj: any) => {
const getMonitorList = async () => {
let requestData = {
pageNo: pages.value.pageNo,
pageSize: pages.value.pageSize
pageSize: pages.value.pageSize,
devId: equipInfo.value.id
} as any;
requestData.engineeringSn = searchSn.value;
if (searchForm.value.timeRange && searchForm.value.timeRange.length > 0) {
@ -301,7 +303,8 @@ const getMonitorList = async () => {
const getAlarmList = async () => {
let requestData = {
pageNo: pages.value.pageNo,
pageSize: pages.value.pageSize
pageSize: pages.value.pageSize,
devId: equipInfo.value.id
} as any;
requestData.engineeringSn = searchSn.value;
if (searchForm.value.timeRange && searchForm.value.timeRange.length > 0) {
@ -322,17 +325,23 @@ const getAlarmList = async () => {
const getEquipList = async () => {
let requestData = {} as any;
requestData.engineeringSn = searchSn.value;
const res = await lifterEquipAll(requestData);
console.log(res);
if (res && res.result && res.result.length > 0) {
equipList.value = res.result;
getEquipInfo(res.result[0]);
if (searchSn.value) {
const res = await lifterEquipAll(requestData);
console.log(res);
if (res && res.result && res.result.length > 0) {
equipList.value = res.result;
getEquipInfo(res.result[0]);
} else {
equipList.value = [];
}
} else {
equipInfo.value = {};
equipList.value = [];
}
};
//
const getEquipInfo = async (obj: any) => {
equipActive.value = equipList.value.findIndex(item => item.id == obj.id);
let requestData = {
id: obj.id
};
@ -343,6 +352,11 @@ const getEquipInfo = async (obj: any) => {
} else {
equipInfo.value = { ...obj };
}
if (active.value === 0) {
getAlarmList();
} else {
getMonitorList();
}
};
//
const search = () => {
@ -371,6 +385,11 @@ const getengineering = async () => {
searchSn.value = res.result[0].engineeringSn;
}
getEquipList();
if (active.value === 0) {
getAlarmList();
} else {
getMonitorList();
}
console.log(res);
};
//

View File

@ -57,14 +57,14 @@
<span>额定人数: {{ equipInfo.ratedPeopleNum ? equipInfo.ratedPeopleNum : 0 }}</span>
<span>当前楼层数: {{ equipInfo.floorNum ? equipInfo.floorNum : 0 }}</span>
<span>最大高度: {{ equipInfo.maxHeight ? equipInfo.maxHeight : 0 }}m</span>
<span>高度百分比: {{ equipInfo.heightRatio ? equipInfo.heightRatio : 0 }}%</span>
<!-- <span>高度百分比: {{ equipInfo.heightRatio ? equipInfo.heightRatio : 0 }}%</span> -->
<!-- <span>额定上行速度: {{ equipInfo.maxHeight ? equipInfo.maxHeight : 0 }}m</span>
<span>额定下行速度: {{ equipInfo.maxHeight ? equipInfo.maxHeight : 0 }}m</span> -->
</div>
<div class="other-info">
<span>备案编号: {{ equipInfo.filingNumber ? equipInfo.filingNumber : "" }}</span>
<span :title="equipInfo.filingNumber">备案编号: {{ equipInfo.filingNumber ? equipInfo.filingNumber : "" }}</span>
<span>安装日期: {{ equipInfo.installTime ? equipInfo.installTime : "" }}</span>
<span>终端编号: {{ equipInfo.devNumber ? equipInfo.devNumber : "" }}</span>
<span :title="equipInfo.devNumber">终端编号: {{ equipInfo.devNumber ? equipInfo.devNumber : "" }}</span>
<span>更新时间: {{ equipInfo.realTime ? equipInfo.realTime : "" }}</span>
<!-- <span>安装时间: {{ equipInfo.installTime ? equipInfo.installTime : "" }}</span> -->
</div>
@ -326,11 +326,16 @@ const getEquipList = async () => {
} else {
requestData.engineeringSn = searchSn.value;
}
const res = await lifterEquipAll(requestData);
console.log(res, "设备列表");
if (res && res.result && res.result.length > 0) {
equipList.value = res.result;
getEquipInfo(res.result[0]);
if (searchSn.value) {
const res = await lifterEquipAll(requestData);
console.log(res);
if (res && res.result && res.result.length > 0) {
equipList.value = res.result;
getEquipInfo(res.result[0]);
} else {
equipInfo.value = {};
equipList.value = [];
}
} else {
equipInfo.value = {};
equipList.value = [];
@ -349,12 +354,18 @@ const getEquipInfo = async (obj: any) => {
} else {
equipInfo.value = { ...obj };
}
if (active.value === 0) {
getAlarmList();
} else {
getMonitorList();
}
};
//
const getMonitorList = async () => {
let requestData = {
pageNo: pages.value.pageNo,
pageSize: pages.value.pageSize
pageSize: pages.value.pageSize,
devId: equipInfo.value.id
} as any;
if (alarmActive.value == 0) {
requestData.projectSn = searchSn.value;
@ -379,7 +390,8 @@ const getMonitorList = async () => {
const getAlarmList = async () => {
let requestData = {
pageNo: pages.value.pageNo,
pageSize: pages.value.pageSize
pageSize: pages.value.pageSize,
devId: equipInfo.value.id
} as any;
if (alarmActive.value == 0) {
requestData.projectSn = searchSn.value;
@ -469,7 +481,7 @@ const getEngPage = async () => {
};
const { result } = await getLifterRealTimeEngineeringPage(requestData);
records.value = result.records;
pages.value.total = Number(result.total);
pages.value.total = +result.total;
};
watch(
() => active.value,

View File

@ -18,7 +18,7 @@
<span>额定人数: {{ equipInfo.ratedPeopleNum ? equipInfo.ratedPeopleNum : 0 }}</span>
<span>当前楼层数: {{ equipInfo.floorNum ? equipInfo.floorNum : 0 }}</span>
<span>最大高度: {{ equipInfo.maxHeight ? equipInfo.maxHeight : 0 }}m</span>
<span>高度百分比: {{ equipInfo.heightRatio ? equipInfo.heightRatio : 0 }}%</span>
<!-- <span>高度百分比: {{ equipInfo.heightRatio ? equipInfo.heightRatio : 0 }}%</span> -->
<!-- <span>额定上行速度: {{ equipInfo.maxHeight ? equipInfo.maxHeight : 0 }}m</span>
<span>额定下行速度: {{ equipInfo.maxHeight ? equipInfo.maxHeight : 0 }}m</span> -->
</div>