diff --git a/src/api/modules/enterpriseApi.ts b/src/api/modules/enterpriseApi.ts index c81c05b..54ab01d 100644 --- a/src/api/modules/enterpriseApi.ts +++ b/src/api/modules/enterpriseApi.ts @@ -538,3 +538,45 @@ export const locationSubmitReform = (params: FormData) => { export const locationSubmitAll = (params: FormData) => { return http.post(BASEURL + `/ent/acceptInspectRecord/apply`, params); }; + +// 塔吊在线监管 +// 设备管理列表 +export const towerCraneEquipAll = (params: any) => { + return http.post(BASEURL + `/ent/towerCrane/list`, params); +}; +// 设备管理分页列表 +export const towerCraneEquipPage = (params: any) => { + return http.post(BASEURL + `/ent/towerCrane/page`, params); +}; +// 设备管理新增 +export const towerCraneEquipAdd = (params: any) => { + return http.post(BASEURL + `/ent/towerCrane/add`, params); +}; +// 设备管理编辑 +export const towerCraneEquipEdit = (params: any) => { + return http.post(BASEURL + `/ent/towerCrane/edit`, params); +}; +// 设备管理删除 +export const towerCraneEquipDel = (params: any) => { + return http.post(BASEURL + `/ent/towerCrane/delete`, params); +}; + +// 获取运行数据 +export const operationData = (params: any) => { + return http.post(BASEURL + `/ent/towerCraneCurrentData/getOperation`, params); +}; + +// 报警数据分页列表 +export const towerCraneAlarmPage = (params: any) => { + return http.post(BASEURL + `/ent/towerCraneAlarm/page`, params); +}; + +// 实时数据分页列表 +export const towerCraneDataPage = (params: any) => { + return http.post(BASEURL + `/ent/towerCraneCurrentData/page`, params); +}; + +// 工作循环数据分页列表 +export const towerCraneWorkCyclePage = (params: any) => { + return http.post(BASEURL + `/ent/towerCraneWorkCycle/page`, params); +}; diff --git a/src/api/modules/goverment.ts b/src/api/modules/goverment.ts index c37d70a..b2080c3 100644 --- a/src/api/modules/goverment.ts +++ b/src/api/modules/goverment.ts @@ -587,3 +587,31 @@ export const locationOptionAudit = (params: any) => { export const locationAllOptionAudit = (params: any) => { return http.post(BASEURL + `/gov/acceptInspectRecord/examine`, params); }; + +// 塔吊在线监管 +// 设备管理列表 +export const towerCraneEquipAll = (params: any) => { + return http.post(BASEURL + `/gov/towerCrane/list`, params); +}; +// 获取运行数据 +export const operationData = (params: any) => { + return http.post(BASEURL + `/gov/towerCraneCurrentData/getOperation`, params); +}; +// 分页列表查询实时数据项目信息 +export const getRealTimepPojectPage = (params: any) => { + return http.post(BASEURL + `/gov/towerCrane/projectPage`, params); +}; +// 分页列表查询实时数据工程信息 +export const getRealTimeEngineeringPage = (params: any) => { + return http.post(BASEURL + `/gov/towerCrane/engineeringPage`, params); +}; + +// 报警数据分页列表 +export const towerCraneAlarmPage = (params: any) => { + return http.post(BASEURL + `/gov/towerCraneAlarm/page`, params); +}; + +// 实时数据分页列表 +export const towerCraneDataPage = (params: any) => { + return http.post(BASEURL + `/gov/towerCraneCurrentData/page`, params); +}; diff --git a/src/api/modules/project.ts b/src/api/modules/project.ts index 4f24fa3..f342d6e 100644 --- a/src/api/modules/project.ts +++ b/src/api/modules/project.ts @@ -575,3 +575,45 @@ export const locationSubmitReform = (params: FormData) => { export const locationSubmitAll = (params: FormData) => { return http.post(BASEURL + `/project/acceptInspectRecord/apply`, params); }; + +// 塔吊在线监管 +// 设备管理列表 +export const towerCraneEquipAll = (params: any) => { + return http.post(BASEURL + `/project/towerCrane/list`, params); +}; +// 设备管理分页列表 +export const towerCraneEquipPage = (params: any) => { + return http.post(BASEURL + `/project/towerCrane/page`, params); +}; +// 设备管理新增 +export const towerCraneEquipAdd = (params: any) => { + return http.post(BASEURL + `/project/towerCrane/add`, params); +}; +// 设备管理编辑 +export const towerCraneEquipEdit = (params: any) => { + return http.post(BASEURL + `/project/towerCrane/edit`, params); +}; +// 设备管理删除 +export const towerCraneEquipDel = (params: any) => { + return http.post(BASEURL + `/project/towerCrane/delete`, params); +}; + +// 获取运行数据 +export const operationData = (params: any) => { + return http.post(BASEURL + `/project/towerCraneCurrentData/getOperation`, params); +}; + +// 报警数据分页列表 +export const towerCraneAlarmPage = (params: any) => { + return http.post(BASEURL + `/project/towerCraneAlarm/page`, params); +}; + +// 实时数据分页列表 +export const towerCraneDataPage = (params: any) => { + return http.post(BASEURL + `/project/towerCraneCurrentData/page`, params); +}; + +// 工作循环数据分页列表 +export const towerCraneWorkCyclePage = (params: any) => { + return http.post(BASEURL + `/project/towerCraneWorkCycle/page`, params); +}; diff --git a/src/assets/images/AIwaring/升降机.png b/src/assets/images/AIwaring/升降机.png new file mode 100644 index 0000000..0c9030a Binary files /dev/null and b/src/assets/images/AIwaring/升降机.png differ diff --git a/src/assets/images/AIwaring/塔吊.png b/src/assets/images/AIwaring/塔吊.png new file mode 100644 index 0000000..e979a2e Binary files /dev/null and b/src/assets/images/AIwaring/塔吊.png differ diff --git a/src/assets/images/onlineSupervision/liftImg.jpg b/src/assets/images/onlineSupervision/liftImg.jpg new file mode 100644 index 0000000..aa2ba1e Binary files /dev/null and b/src/assets/images/onlineSupervision/liftImg.jpg differ diff --git a/src/assets/images/onlineSupervision/上行速度.png b/src/assets/images/onlineSupervision/上行速度.png new file mode 100644 index 0000000..a87f1a5 Binary files /dev/null and b/src/assets/images/onlineSupervision/上行速度.png differ diff --git a/src/assets/images/onlineSupervision/下行速度.png b/src/assets/images/onlineSupervision/下行速度.png new file mode 100644 index 0000000..dd996bb Binary files /dev/null and b/src/assets/images/onlineSupervision/下行速度.png differ diff --git a/src/assets/images/onlineSupervision/人数.png b/src/assets/images/onlineSupervision/人数.png new file mode 100644 index 0000000..b5aacea Binary files /dev/null and b/src/assets/images/onlineSupervision/人数.png differ diff --git a/src/views/enterprise/towerCraneSupervision/equipManagement/index.scss b/src/views/enterprise/towerCraneSupervision/equipManagement/index.scss new file mode 100644 index 0000000..ebdacf0 --- /dev/null +++ b/src/views/enterprise/towerCraneSupervision/equipManagement/index.scss @@ -0,0 +1,40 @@ +.date-select { + width: 100%; + display: flex; + align-items: center; + justify-content: space-between; +} +.basic-form { + .face-img { + width: 100%; + align-self: flex-start; + :deep(.face-uploader .el-upload) { + border: 1px dashed #d9d9d9 !important; + border-radius: 6px !important; + cursor: pointer !important; + position: relative !important; + overflow: hidden !important; + } + .face-uploader .el-upload:hover { + border-color: #409eff !important; + } + :deep(.el-icon) { + font-size: 28px; + color: #8c939d; + width: 53px; + height: 53px; + line-height: 53px; + text-align: center; + } + .face-avatar { + width: 53px; + height: 53px; + display: block; + } + } +} +:deep() { + .tabs-option { + display: none; + } +} diff --git a/src/views/enterprise/towerCraneSupervision/equipManagement/index.vue b/src/views/enterprise/towerCraneSupervision/equipManagement/index.vue new file mode 100644 index 0000000..bdff8f3 --- /dev/null +++ b/src/views/enterprise/towerCraneSupervision/equipManagement/index.vue @@ -0,0 +1,786 @@ + + + + diff --git a/src/views/enterprise/towerCraneSupervision/historyData/alarmData/index.scss b/src/views/enterprise/towerCraneSupervision/historyData/alarmData/index.scss new file mode 100644 index 0000000..78172c0 --- /dev/null +++ b/src/views/enterprise/towerCraneSupervision/historyData/alarmData/index.scss @@ -0,0 +1,16 @@ +@mixin flex { + display: flex; + align-items: center; +} +.table-data { + @include flex; + > span { + display: inline-block; + width: 50%; + } +} +:deep() { + .tabs-option { + display: none; + } +} diff --git a/src/views/enterprise/towerCraneSupervision/historyData/alarmData/index.vue b/src/views/enterprise/towerCraneSupervision/historyData/alarmData/index.vue new file mode 100644 index 0000000..a4611e8 --- /dev/null +++ b/src/views/enterprise/towerCraneSupervision/historyData/alarmData/index.vue @@ -0,0 +1,233 @@ + + + + diff --git a/src/views/enterprise/towerCraneSupervision/historyData/realTimeData/index.scss b/src/views/enterprise/towerCraneSupervision/historyData/realTimeData/index.scss new file mode 100644 index 0000000..78172c0 --- /dev/null +++ b/src/views/enterprise/towerCraneSupervision/historyData/realTimeData/index.scss @@ -0,0 +1,16 @@ +@mixin flex { + display: flex; + align-items: center; +} +.table-data { + @include flex; + > span { + display: inline-block; + width: 50%; + } +} +:deep() { + .tabs-option { + display: none; + } +} diff --git a/src/views/enterprise/towerCraneSupervision/historyData/realTimeData/index.vue b/src/views/enterprise/towerCraneSupervision/historyData/realTimeData/index.vue new file mode 100644 index 0000000..e081034 --- /dev/null +++ b/src/views/enterprise/towerCraneSupervision/historyData/realTimeData/index.vue @@ -0,0 +1,491 @@ + + + + diff --git a/src/views/enterprise/towerCraneSupervision/historyData/workCycleData/index.scss b/src/views/enterprise/towerCraneSupervision/historyData/workCycleData/index.scss new file mode 100644 index 0000000..78172c0 --- /dev/null +++ b/src/views/enterprise/towerCraneSupervision/historyData/workCycleData/index.scss @@ -0,0 +1,16 @@ +@mixin flex { + display: flex; + align-items: center; +} +.table-data { + @include flex; + > span { + display: inline-block; + width: 50%; + } +} +:deep() { + .tabs-option { + display: none; + } +} diff --git a/src/views/enterprise/towerCraneSupervision/historyData/workCycleData/index.vue b/src/views/enterprise/towerCraneSupervision/historyData/workCycleData/index.vue new file mode 100644 index 0000000..8e84577 --- /dev/null +++ b/src/views/enterprise/towerCraneSupervision/historyData/workCycleData/index.vue @@ -0,0 +1,315 @@ + + + + diff --git a/src/views/enterprise/towerCraneSupervision/operatingData/index.scss b/src/views/enterprise/towerCraneSupervision/operatingData/index.scss new file mode 100644 index 0000000..e33d19a --- /dev/null +++ b/src/views/enterprise/towerCraneSupervision/operatingData/index.scss @@ -0,0 +1,276 @@ +@mixin boxStyle { + border-radius: 8px; + background: #ffffff; +} +@mixin flex { + display: flex; + align-items: center; +} +.operate-box { + width: 100%; + height: 100%; + @include flex; + .monitor-data { + @include boxStyle; + flex: 1; + height: 100%; + min-height: 600px; + .monitor-title { + margin-top: 15px; + margin-left: 36px; + @include flex; + span:first-child { + font-size: 30px; + font-family: Source Han Sans CN-Bold, Source Han Sans CN; + font-weight: bold; + color: #333333; + margin-right: 20px; + } + span:last-child { + font-size: 22px; + font-family: Source Han Sans CN-Medium, Source Han Sans CN; + font-weight: 500; + } + } + .monitor-content { + display: flex; + height: calc(100% - 265px); + margin-top: 36px; + margin-left: 36px; + .monitor-tool { + position: relative; + span { + font-size: 18px; + font-family: Source Han Sans CN-Regular, Source Han Sans CN; + font-weight: 400; + color: #000000; + } + .property-one { + position: absolute; + top: 0; + left: 0; + } + .property-two { + position: absolute; + top: 0; + right: 0; + } + .property-three { + position: absolute; + top: 180px; + left: 0; + } + .other-info { + position: absolute; + top: 240px; + right: 0px; + display: flex; + flex-direction: column; + > span { + margin-bottom: 20px; + } + } + img { + width: 688px; + height: 100%; + } + } + .monitor-aspect { + margin-left: 86px; + display: flex; + flex-wrap: wrap; + align-content: flex-start; + &-item { + width: 184px; + height: 100px; + background: #ffffff; + border-radius: 4px; + border: 1px solid #ebebeb; + @include flex; + flex-direction: column; + justify-content: center; + margin-right: 26px; + margin-bottom: 30px; + > div:first-child { + @include flex; + margin-bottom: 12px; + span { + font-size: 18px; + font-family: Source Han Sans CN-Medium, Source Han Sans CN; + font-weight: 500; + color: #333333; + margin-right: 7px; + } + img { + width: 20px; + height: 20px; + } + } + > div:last-child { + @include flex; + span { + font-size: 18px; + font-family: Source Han Sans CN-Medium, Source Han Sans CN; + font-weight: 500; + color: #00378f; + } + } + } + } + } + .monitor-equip { + margin-top: 31px; + margin-left: 36px; + margin-bottom: 16px; + @include flex; + .monitor-state:not(:last-child) { + margin-right: 26px; + } + .monitor-state { + @include flex; + flex-direction: column; + align-items: center; + cursor: pointer; + > div { + position: relative; + img { + width: 184px; + height: 100px; + } + span { + width: 32px; + height: 15px; + font-size: 10px; + font-family: Source Han Sans CN-Regular, Source Han Sans CN; + font-weight: 400; + color: #ffffff; + text-align: center; + position: absolute; + top: 0; + right: 0; + } + } + > span { + font-size: 16px; + font-family: Source Han Sans CN-Regular, Source Han Sans CN; + font-weight: 400; + color: #000000; + } + } + .active-class { + box-shadow: 0px 4px 8px 0px rgba(48, 62, 100, 0.2); + } + } + } + .no-data { + @include boxStyle; + flex: 1; + height: 100%; + min-height: 600px; + display: flex; + justify-content: center; + align-items: center; + flex-direction: column; + color: #999; + } + .history-data { + @include boxStyle; + width: 300px; + height: 100%; + margin-left: 20px; + :deep() { + .leftMenu { + height: 100%; + } + .content { + height: calc(100% - 100px); + } + } + .search-wrapper { + @include flex; + height: 50px; + padding: 0 10px; + background-color: #ffffff; + border-bottom: 1px solid #e5e5e5; + } + .alarm-list { + height: calc(100% - 50px); + min-height: 83%; + overflow-y: scroll; + &-item { + display: flex; + flex-direction: column; + border-bottom: 1px solid #e5e5e5; + padding: 12px; + > div { + span { + font-size: 12px; + font-family: Source Han Sans CN-Regular, Source Han Sans CN; + font-weight: 400; + color: #333333; + } + } + > div:not(:last-child) { + margin-bottom: 8px; + } + } + } + .info-list { + height: calc(100% - 50px); + min-height: 83%; + overflow-y: scroll; + &-item { + display: flex; + flex-direction: column; + border-bottom: 1px solid #e5e5e5; + padding: 12px; + > div:nth-child(1) { + font-size: 16px; + font-family: Source Han Sans CN-Medium, Source Han Sans CN; + font-weight: 500; + color: #333333; + margin-bottom: 10px; + } + &-aspect { + display: flex; + align-items: center; + justify-content: space-between; + &-item { + margin-bottom: 8px; + span { + font-size: 12px; + font-family: Source Han Sans CN-Regular, Source Han Sans CN; + font-weight: 400; + } + > span:nth-child(1) { + display: inline-block; + width: 36px; + height: 18px; + color: #606266; + margin-right: 20px; + text-align: left; + } + > span:nth-child(2) { + display: inline-block; + width: 42px; + height: 18px; + color: #333333; + } + } + } + > div:last-child { + font-size: 10px; + font-family: Source Han Sans CN-Regular, Source Han Sans CN; + font-weight: 400; + color: rgba(102, 102, 102, 0.8); + margin-top: 5px; + } + } + } + } +} +:deep() { + .tabs-option { + display: none; + } +} diff --git a/src/views/enterprise/towerCraneSupervision/operatingData/index.vue b/src/views/enterprise/towerCraneSupervision/operatingData/index.vue new file mode 100644 index 0000000..63554c8 --- /dev/null +++ b/src/views/enterprise/towerCraneSupervision/operatingData/index.vue @@ -0,0 +1,379 @@ + + + + diff --git a/src/views/goverment/towerCraneSupervision/operatingData/index.scss b/src/views/goverment/towerCraneSupervision/operatingData/index.scss index 4721bef..fa64dac 100644 --- a/src/views/goverment/towerCraneSupervision/operatingData/index.scss +++ b/src/views/goverment/towerCraneSupervision/operatingData/index.scss @@ -40,6 +40,8 @@ } img { margin: 0 4px; + width: 12px; + height: 12px; } } .bottom_item { @@ -175,6 +177,9 @@ margin-left: 36px; margin-bottom: 16px; @include flex; + .monitor-state:not(:last-child) { + margin-right: 26px; + } .monitor-state { @include flex; flex-direction: column; @@ -206,13 +211,34 @@ color: #000000; } } + .active-class { + box-shadow: 0px 4px 8px 0px rgba(48, 62, 100, 0.2); + } } } + .no-data { + @include boxStyle; + flex: 1; + height: 100%; + display: flex; + justify-content: center; + align-items: center; + flex-direction: column; + color: #999; + } .history-data { @include boxStyle; width: 300px; height: 100%; margin-left: 20px; + :deep() { + .leftMenu { + height: 100%; + } + .content { + height: calc(100% - 100px); + } + } .search-wrapper { @include flex; height: 50px; @@ -221,6 +247,9 @@ border-bottom: 1px solid #e5e5e5; } .alarm-list { + height: calc(100% - 50px); + min-height: 83%; + overflow-y: scroll; &-item { display: flex; flex-direction: column; @@ -240,6 +269,9 @@ } } .info-list { + height: calc(100% - 50px); + min-height: 83%; + overflow-y: scroll; &-item { display: flex; flex-direction: column; diff --git a/src/views/goverment/towerCraneSupervision/operatingData/index.vue b/src/views/goverment/towerCraneSupervision/operatingData/index.vue index f3daa14..c0d06d7 100644 --- a/src/views/goverment/towerCraneSupervision/operatingData/index.vue +++ b/src/views/goverment/towerCraneSupervision/operatingData/index.vue @@ -17,8 +17,8 @@ {{ data.projectName || data.engineeringName }}
- - 接入视频路数:{{ data.deviceNum }} + + 接入塔吊总数:{{ data.deviceNum ? data.deviceNum : 0 }}
@@ -44,22 +44,24 @@
-
+
- 十字门小学 - 在线 + {{ equipInfo.devName }} + {{ + equipInfo.online == 1 ? "在线" : "离线" + }}
- 尾臂长: 1.4m - 臂长: 5m - 塔身高: 7m + 尾臂长: {{ equipInfo.posteriorArmLength ? equipInfo.posteriorArmLength : 0 }}m + 臂长: {{ equipInfo.forearmLength ? equipInfo.forearmLength : 0 }}m + 塔身高: {{ equipInfo.towerHeight ? equipInfo.towerHeight : 0 }}m
- 备案编号: TD2374693 - 安装日期: 2022-12-01 - 终端编号: TD2374693 - 更新时间: 2023-05-23 + 设备编号: {{ equipInfo.devNumber ? equipInfo.devNumber : "" }} + 安装日期: {{ equipInfo.installTime ? equipInfo.installTime : "" }} + + 更新时间: {{ equipInfo.realTime ? equipInfo.realTime : "" }}
@@ -69,22 +71,34 @@
- {{ item.value }} + {{ equipInfo[item.prop] ? equipInfo[item.prop] : 0 }} {{ item.unit }}
-
+
- - 在线 + + {{ + item.online == 1 ? "在线" : "离线" + }}
- 1号塔吊 + {{ item.devName }}
+
+ notData +
暂无数据
+
查询
-
+
设备名称: - 2号塔吊 + {{ item.devName }}
- 终端编号: - DEYE20071702 + 设备编号: + {{ item.devNumber }}
报警项目: - 幅度限位报警 + {{ alarmTransform(item) }}
报警时间: - 2022-12-23 + {{ item.createTime }}
-
-
2号塔吊
+
+
{{ item.devName }}
角度 - 190.0° + {{ item.angle ? item.angle : 0 }}°
倾角 - 120.0° + {{ item.obliquity ? item.obliquity : 0 }}°
高度 - 96.35m + {{ item.height ? item.height : 0 }}m
倾角X - 120.0° + {{ item.obliquityX ? item.obliquityX : 0 }}°
载重比 - 1.57% + {{ item.loadRatio ? item.loadRatio : 0 }}%
倾角Y - 120.0° + {{ item.obliquityY ? item.obliquityY : 0 }}°
载重 - 70.0kg + {{ item.loading ? item.loading : 0 }}kg
幅度 - 51.67m + {{ item.ranger ? item.ranger : 0 }}m
-
监测时间: 2023-05-23
+
监测时间: {{ item.createTime ? item.createTime : "" }}
- - - - -
@@ -191,14 +198,26 @@ import { ref, onMounted, watch } from "vue"; import { ElMessage } from "element-plus"; import { getRelevanceList } from "@/api/modules/common"; -import engineeringEngDrawer from "@/components/engineeringEngDrawer/index.vue"; -import allEngineering from "@/components/allEngineering/index.vue"; -import { getEngineeringName } from "@/api/modules/project"; import LeftMenuPlus from "@/components/LeftMenuPlus/LeftMenu.vue"; import layoutTop from "@/components/layoutTop/index.vue"; import LeftMenu from "@/components/LeftMenu/LeftMenu.vue"; +import { + getRealTimepPojectPage, + getRealTimeEngineeringPage, + towerCraneAlarmPage, + towerCraneDataPage, + towerCraneEquipAll, + operationData +} from "@/api/modules/goverment"; +const monitorList = ref([]); +const alarmList = ref([]); +const equipList = ref([]); +const equipInfo = ref({}); const records = ref([]); const alarmActive = ref(0); +const leftMenuSearchForm = ref({ + name: "" +}); const searchForm = ref({ timeRange: [] }); @@ -219,144 +238,248 @@ const aspectList = ref([ value: 10, unit: "N·M", img: new URL("@/assets/images/onlineSupervision/力矩.png", import.meta.url).href, - prop: "inServiceWorker" + prop: "torque" }, { name: "载重", value: 10, unit: "T", img: new URL("@/assets/images/onlineSupervision/载重.png", import.meta.url).href, - prop: "workerAttendanceTotal" + prop: "loading" }, { name: "风速", value: 10, unit: "m/s", img: new URL("@/assets/images/onlineSupervision/风速.png", import.meta.url).href, - prop: "workerAttendanceTotal" + prop: "windSpeed" }, { name: "高度", value: 10, unit: "m", img: new URL("@/assets/images/onlineSupervision/高度.png", import.meta.url).href, - prop: "workerAttendanceTotal" + prop: "height" }, { name: "回转角度", value: 10, unit: "°", img: new URL("@/assets/images/onlineSupervision/回转角度.png", import.meta.url).href, - prop: "workerAttendanceTotal" + prop: "angle" }, { name: "塔身倾角", value: 10, unit: "°", img: new URL("@/assets/images/onlineSupervision/塔身倾角.png", import.meta.url).href, - prop: "workerAttendanceTotal" + prop: "obliquity" }, { name: "幅度", value: 10, unit: "m", img: new URL("@/assets/images/onlineSupervision/幅度.png", import.meta.url).href, - prop: "workerAttendanceTotal" + prop: "ranger" } ]); -const activeValue = ref("eng"); -const engList = ref([]); -const engVisable = ref(false); const searchSn = ref(""); // 获取 ProTable 元素,调用其获取刷新数据方法(还能获取到当前查询参数,方便导出携带参数) const proTable = ref(); -// 还得做一个监听showicon +// 报警项目转换 +const alarmTransform = (obj: any) => { + let str = ""; + if (obj["environmentAlarm"] == 1) str += "环境防碰撞报警,"; + if (obj["forceAlarm"] == 1) str += "力矩报警,"; + if (obj["heightLowerAlarm"] == 1) str += "高度下限位报警,"; + if (obj["heightUpperAlarm"] == 1) str += "高度上限位报警,"; + if (obj["maxRangeAlarm"] == 1) str += "幅度外限位报警,"; + if (obj["minRangeAlarm"] == 1) str += "幅度内限位报警,"; + if (obj["multiAntiCollisionAlarm"] == 1) str += "多机防撞报警,"; + if (obj["negAngleAlarm"] == 1) str += "逆时针回转限位报警,"; + if (obj["obliquityAlarm"] == 1) str += "倾角报警,"; + if (obj["posAngleAlarm"] == 1) str += "顺时针回转限位报警,"; + if (obj["standardHighAlarm"] == 1) str += "塔机间竖向高度报警,"; + if (obj["windSpeedAlarm"] == 1) str += "风速报警"; + return str; +}; +// 获取设备列表 +const getEquipList = async () => { + let requestData = {} as any; + if (alarmActive.value == 0) { + requestData.projectSn = searchSn.value; + } else { + requestData.engineeringSn = searchSn.value; + } + const res = await towerCraneEquipAll(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 = []; + } +}; +// 获取设备信息 +const getEquipInfo = async (obj: any) => { + let requestData = { + id: obj.id + }; + const res = await operationData(requestData); + console.log(res); + if (res && res.result) { + equipInfo.value = { ...obj, ...res.result }; + } else { + equipInfo.value = { ...obj }; + } +}; +// 获取历史检测信息 +const getMonitorList = async () => { + let requestData = { + pageNo: pages.value.pageNo, + pageSize: pages.value.pageSize + } as any; + if (alarmActive.value == 0) { + requestData.projectSn = searchSn.value; + } else { + requestData.engineeringSn = searchSn.value; + } + if (searchForm.value.timeRange && searchForm.value.timeRange.length > 0) { + requestData.createTime_begin = searchForm.value.timeRange[0]; + requestData.createTime_end = searchForm.value.timeRange[1]; + } + const res = await towerCraneDataPage(requestData); + console.log(res); + if (res && res.result && res.result.records.length > 0) { + monitorList.value = res.result.records; + pages.value.total = +res.result.total; + } else { + monitorList.value = []; + pages.value.total = 0; + } +}; +// 获取历史报警列表 +const getAlarmList = async () => { + let requestData = { + pageNo: pages.value.pageNo, + pageSize: pages.value.pageSize + } as any; + if (alarmActive.value == 0) { + requestData.projectSn = searchSn.value; + } else { + requestData.engineeringSn = searchSn.value; + } + if (searchForm.value.timeRange && searchForm.value.timeRange.length > 0) { + requestData.createTime_begin = searchForm.value.timeRange[0]; + requestData.createTime_end = searchForm.value.timeRange[1]; + } + const res = await towerCraneAlarmPage(requestData); + console.log(res); + if (res && res.result && res.result.records.length > 0) { + alarmList.value = res.result.records; + pages.value.total = +res.result.total; + } else { + alarmList.value = []; + pages.value.total = 0; + } +}; function parse(val) { return val.trim() ? JSON.parse(val) : {}; } // 页面的项目名称和工程名称的div点击事件 const onSearch = async (params: any) => { - // 第一步匹配 - // const curr = monitorList.value.find(item => - // active.value === 0 ? item.projectSn === params.projectSn : item.engineeringSn === params.engineeringSn - // ); - // // 匹配到的 去做一个处理 开关啥的 - // monitorList.value = monitorList.value.map(item => (item === curr ? { ...curr, showGif: true } : { ...item, showGif: false })); - // params.longitude !== "" && params.longitude !== null - // ? map.value?.setCenter([params.longitude, +params.latitude]) - // : map.value?.setCenter([116.481181, 39.90923]); + console.log(params); + active.value === 0 ? (searchSn.value = params.projectSn) : (searchSn.value = params.engineeringSn); + getEquipList(); + if (active.value === 0) { + getAlarmList(); + } else { + getMonitorList(); + } }; -// 页面的搜索按钮 +// leftMenu页面的搜索按钮 const onSearchInput = async (params: string) => { - // if (active.value === 0) { - // const { result } = await getAIprojectPage({ projectName: params, ...pages.value }); - // records.value = result.records; - // } else { - // const { result } = await getAIengineeringPage({ engineeringName: params, ...pages.value }); - // records.value = result.records; - // } + leftMenuSearchForm.value.name = params; + if (active.value === 0) { + getProPage(); + } else { + getEngPage(); + } +}; +// leftMenu页面的分页 +const onCurChange = async (params: number) => { + alarmPages.value.pageSize = params; + if (active.value === 0) { + getProPage(); + } else { + getEngPage(); + } }; // 右侧报警数据搜索 const search = () => { console.log(666); -}; -// 页面的分页 -const onCurChange = async (params: number) => { - console.log(params); - // if (active.value === 0) { - // pages.value.total = +result.total; - // } else { - // pages.value.total = +result.total; - // } -}; -// 抽屉tab选择时 -const tabsSelect = val => { - activeValue.value = val; - if (val == "eng") { - getengineering(); - } else if (val == "project") { - getProject(); + if (active.value === 0) { + getAlarmList(); + } else { + getMonitorList(); } }; -// 获取项目信息 -const getProject = async () => { - const res = await getEngineeringName(); - engList.value = [res.result]; - if (res.result) { - searchSn.value = res.result.projectSn; - } - // proTable.value.getTableList(); - console.log(res); + +// 获取项目名称分页 +const getProPage = async () => { + let requestData = { + ...pages.value, + projectName: leftMenuSearchForm.value.name + }; + const { result } = await getRealTimepPojectPage(requestData); + records.value = result.records; + pages.value.total = Number(result.total); }; -const getengineering = async () => { - // let newParams = JSON.parse(JSON.stringify(params)); - const res = await getRelevanceList(); - engList.value = res.result; - if (res.result && res.result.length > 0) { - searchSn.value = res.result[0].engineeringSn; - } - // proTable.value.getTableList(); - console.log(res); -}; -// 点击抽屉的工程名称更新页面 -const onUpdate = async row => { - if (activeValue.value == "eng") { - searchSn.value = row.engineeringSn; - } else if (activeValue.value == "project") { - searchSn.value = row.projectSn; - } - // proTable.value.getTableList(); - ElMessage.success("页面已更新"); +// 获取工程名称分页 +const getEngPage = async () => { + let requestData = { + ...pages.value, + engineeringName: leftMenuSearchForm.value.name + }; + const { result } = await getRealTimeEngineeringPage(requestData); + records.value = result.records; + pages.value.total = +result.total; }; watch( () => active.value, - () => { + n => { searchForm.value.timeRange = []; + if (n === 0) { + getAlarmList(); + } else { + getMonitorList(); + } } ); -onMounted(() => { - getengineering(); +watch( + () => alarmActive.value, + async (value: number) => { + pages.value.pageNo = 1; + pages.value.total = 0; + leftMenuSearchForm.value.name = ""; + if (value === 0) { + await getProPage(); + onSearch(records.value[0]); + } else { + await getEngPage(); + onSearch(records.value[0]); + } + }, + { + deep: true + } +); +onMounted(async () => { + await getProPage(); + onSearch(records.value[0]); + searchSn.value = (records.value as any)[0].projectSn; });