diff --git a/dist.rar b/dist.rar deleted file mode 100644 index 64032a5..0000000 Binary files a/dist.rar and /dev/null differ diff --git a/public/model/Build/webgl.data.unityweb b/public/model/Build/webgl.data.unityweb index b5570a6..6d520d6 100644 Binary files a/public/model/Build/webgl.data.unityweb and b/public/model/Build/webgl.data.unityweb differ diff --git a/public/model/Build/webgl.framework.js.unityweb b/public/model/Build/webgl.framework.js.unityweb index 3784da4..22905bc 100644 Binary files a/public/model/Build/webgl.framework.js.unityweb and b/public/model/Build/webgl.framework.js.unityweb differ diff --git a/public/model/Build/webgl.wasm.unityweb b/public/model/Build/webgl.wasm.unityweb index da094a5..c2ced93 100644 Binary files a/public/model/Build/webgl.wasm.unityweb and b/public/model/Build/webgl.wasm.unityweb differ diff --git a/public/model/StreamingAssets/IPPort.txt b/public/model/StreamingAssets/IPPort.txt index 3ec5906..2869def 100644 --- a/public/model/StreamingAssets/IPPort.txt +++ b/public/model/StreamingAssets/IPPort.txt @@ -1 +1 @@ -10.155.161.49:5005 \ No newline at end of file +172.16.1.106:5005 \ No newline at end of file diff --git a/public/model/index.html b/public/model/index.html index 7b07919..5662322 100644 --- a/public/model/index.html +++ b/public/model/index.html @@ -1,5 +1,6 @@ + @@ -8,211 +9,225 @@ + -
- -
- -
-
+
+ +
+ +
+
+
+
+
+
-
- -
- - - - + + + + - + - + + \ No newline at end of file diff --git a/public/model/index1.html b/public/model/index1.html new file mode 100644 index 0000000..cc1c28f --- /dev/null +++ b/public/model/index1.html @@ -0,0 +1,234 @@ + + + + + + + Unity WebGL Player | U3D_TobaccoWarehouseISMDTSystem + + + + + + +
+ +
+ +
+
+
+
+
+ +
+ + + + + + + + + + + \ No newline at end of file diff --git a/src/api/batteryManagement/index.js b/src/api/batteryManagement/index.js new file mode 100644 index 0000000..15d7f13 --- /dev/null +++ b/src/api/batteryManagement/index.js @@ -0,0 +1,49 @@ +import request from '@/utils/request' +// 电池位监控 +export function getBatteryMonitor(params){ + return request({ + url:'/api/chargingApi/MonitorRealTime', + method:'get', + params + }) +} +// 获取电池编号的基本信息 +export function getBatteryStatics(params){ + return request({ + url:'/api/chargingApi/GetBatteryStatics', + method:'get', + params + }) +} +// 统计充电时间 +export function countChargeTime(params){ + return request({ + url:'/api/chargingApi/CountChargeTime', + method:'get', + params + }) +} +// 电池检测 +export function getBatteryInspect(params){ + return request({ + url:'/api/chargingApi/GetBatteryInspect', + method:'get', + params + }) +} +// 获取所有电池位编号 +export function getAllBatteryNum(params){ + return request({ + url:'/api/chargingApi/GetAllBatteryNum', + method:'get', + params + }) +} +// 获取全部电池位置 +export function getBatteryLocation(params){ + return request({ + url:'/api/chargingApi/GetBatteryLocation', + method:'get', + params + }) +} \ No newline at end of file diff --git a/src/assets/images/dialog/device/device1.png b/src/assets/images/dialog/device/device1.png index 8647da2..ed8bd2d 100644 Binary files a/src/assets/images/dialog/device/device1.png and b/src/assets/images/dialog/device/device1.png differ diff --git a/src/assets/images/dialog/device/device1Select.png b/src/assets/images/dialog/device/device1Select.png index 9b61684..b3b9d9a 100644 Binary files a/src/assets/images/dialog/device/device1Select.png and b/src/assets/images/dialog/device/device1Select.png differ diff --git a/src/assets/images/dialog/device/device1Selectx.png b/src/assets/images/dialog/device/device1Selectx.png new file mode 100644 index 0000000..9b61684 Binary files /dev/null and b/src/assets/images/dialog/device/device1Selectx.png differ diff --git a/src/assets/images/dialog/device/device1x.png b/src/assets/images/dialog/device/device1x.png new file mode 100644 index 0000000..8647da2 Binary files /dev/null and b/src/assets/images/dialog/device/device1x.png differ diff --git a/src/assets/images/home/unityBtn-D.png b/src/assets/images/home/unityBtn-D.png new file mode 100644 index 0000000..6f66db3 Binary files /dev/null and b/src/assets/images/home/unityBtn-D.png differ diff --git a/src/assets/images/home/unityBtn-S.png b/src/assets/images/home/unityBtn-S.png new file mode 100644 index 0000000..94f35f0 Binary files /dev/null and b/src/assets/images/home/unityBtn-S.png differ diff --git a/src/components/equipmentManagement/batteryManagement.vue b/src/components/equipmentManagement/batteryManagement.vue index 3cd2bfe..af5075a 100644 --- a/src/components/equipmentManagement/batteryManagement.vue +++ b/src/components/equipmentManagement/batteryManagement.vue @@ -14,7 +14,12 @@

电池编号

@@ -62,20 +67,24 @@ label="充电结束时间" align="center" /> - +
@@ -89,10 +98,20 @@ import { ref, onMounted, nextTick } from "vue"; import getPath from "@/utils/getPath"; import * as echarts from "echarts"; +import { + getBatteryMonitor, + getBatteryStatics, + countChargeTime, + getAllBatteryNum, + getBatteryInspect, +} from "@/api/batteryManagement/index.js"; +import moment from "moment"; const batteryNumList = ref([ - 20230013, 20230013, 20230013, 20230013, 20230013, 20230013, 20230013, - 20230013, 20230013, 20230013, 20230013, 20230013, 20230013, 20230013, + // 20230013, 20230013, 20230013, 20230013, 20230013, 20230013, 20230013, + // 20230013, 20230013, 20230013, 20230013, 20230013, 20230013, 20230013, ]); +const selectBattery = ref(""); +const batteryIndex = ref(0); const analysisList = ref([ { pic: getPath.analysisItem1, @@ -103,7 +122,7 @@ const analysisList = ref([ { pic: getPath.analysisItem2, name: "充电次数(次)", - num: 3, + num: 0, color: "rgba(25, 174, 250, 1)", }, { @@ -116,28 +135,44 @@ const analysisList = ref([ const emit = defineEmits(["closeBattery"]); const tableList = ref([ - { - startTime: "2023-03-08T17:45:04.417", - endTime:'2023-03-08T17:45:04.417', - errorMsg:'无故障' - }, - { - startTime: "2023-03-08T17:45:04.417", - endTime:'2023-03-08T17:45:04.417', - errorMsg:'无故障' - }, + // { + // startTime: "2023-03-08T17:45:04.417", + // endTime: "2023-03-08T17:45:04.417", + // isError: "无故障", + // }, + // { + // startTime: "2023-03-08T17:45:04.417", + // endTime: "2023-03-08T17:45:04.417", + // isError: "无故障", + // }, ]); +const total = ref(0); +const tableParams = ref({ + index: 1, + size: 5, +}); function close() { emit("closeBattery", -1); } -function drawLineChart() { +function drawLineChart(data) { let dom = document.querySelector("#plate-chart"); dom.removeAttribute("_echarts_instance_"); let myChart; myChart = echarts.init(dom); + let list = []; + data.forEach((item) => { + console.log(); + list.push({ + value:moment.duration(item).asMinutes().toFixed(1) + }); + }); + console.log(list, "数组"); + // data = []; let option = { - tooltip: {}, + tooltip: { + trigger: 'axis', + }, grid: { top: "20%", left: "1%", @@ -168,7 +203,9 @@ function drawLineChart() { }, }, axisTick: { show: false }, - data: ["1", "2", "3"], + data: data.map((el, index) => { + return index; + }), }, ], yAxis: [ @@ -178,7 +215,7 @@ function drawLineChart() { nameTextStyle: { color: "#FFF", align: "middle", - padding: [0, 0, 0, 0], + padding: data.length === 0 ? [0, -35, 0, 0] : [0, 0, 0, 0], }, // min: 0, // max: 1, @@ -231,7 +268,9 @@ function drawLineChart() { shadowBlur: 20, //shadowBlur设图形阴影的模糊大小。配合shadowColor,shadowOffsetX/Y, 设置图形的阴影效果。 }, }, - data: [0.3, 0.8, 0.4, 0.5, 0.8, 0.9, 0.4], + data: list.map((el) => { + return el.value; + }), }, ], }; @@ -244,11 +283,74 @@ function drawLineChart() { }); } +// 获取所有电池位编号 +function getAllBettery() { + getAllBatteryNum().then((res) => { + if (res.code == 200) { + batteryNumList.value = res.result; + selectBattery.value = res.result[0]; + getRightData(); + } else { + return; + } + }); +} +// 获取右侧数据 +function getRightData() { + getBetteryDetail(); + getCountChargeTime(); + getBatteryInspectData(); +} +function clickBat(item) { + selectBattery.value = item; + getRightData(); +} +// 获取电池编号的基本信息 +function getBetteryDetail() { + let params = { + batteryNo: selectBattery.value, + }; + getBatteryStatics(params).then((res) => { + analysisList.value.forEach((el) => { + if (el.name.indexOf("报警次数") != -1) { + el.num = res.result.errorNum; + } else if (el.name.indexOf("充电次数") != -1) { + el.num = res.result.chargeNum; + } else if (el.name.indexOf("使用寿命") != -1) { + el.num = res.result.useTime; + } + }); + }); +} +// 统计充电时间 +function getCountChargeTime() { + let params = { + batteryNo: selectBattery.value, + }; + countChargeTime(params).then((res) => { + if (res.code == 200) { + drawLineChart(res.result); + } + }); +} +// 电池检测 +function getBatteryInspectData() { + tableParams.value.batteryNo = selectBattery.value; + getBatteryInspect(tableParams.value).then((res) => { + total.value = res.result.totalNum; + tableList.value = res.result.data; + }); +} + onMounted(() => { - drawLineChart(); + // drawLineChart(); + getAllBettery(); });