diff --git a/ruoyi-admin/src/main/resources/static/js/Iot-ui/sensorTableList.js b/ruoyi-admin/src/main/resources/static/js/Iot-ui/sensorTableList.js index 575ec60..84ffcda 100644 --- a/ruoyi-admin/src/main/resources/static/js/Iot-ui/sensorTableList.js +++ b/ruoyi-admin/src/main/resources/static/js/Iot-ui/sensorTableList.js @@ -158,11 +158,12 @@ const onSearchByCollectTime = function (obj) { setTimeout(function () { var storeId = document.getElementById('table'); var rowsLength = storeId.rows.length; - var key = obj.value; + var [startTime,endTime] = obj.value.split(' - '); var searchCol = storeId.rows.item(0).cells.length-3; for (var i = 1; i < rowsLength; i++) { var searchText = storeId.rows[i].cells[searchCol].innerHTML; - if (searchText.match(key)) { + console.log(searchText) + if ((new Date(searchText).getTime() >= new Date(startTime).getTime()) && (new Date(searchText).getTime() <= new Date(endTime).getTime())) { storeId.rows[i].style.display = ''; } else { storeId.rows[i].style.display = 'none'; @@ -173,4 +174,4 @@ const onSearchByCollectTime = function (obj) { const historyButton = function(id) { location.href = '/record/recordSensorData/getPage?id='+id; -} \ No newline at end of file +} diff --git a/ruoyi-admin/src/main/resources/templates/iot-ui/sensorSummary.html b/ruoyi-admin/src/main/resources/templates/iot-ui/sensorSummary.html index 6a34098..5f340b2 100644 --- a/ruoyi-admin/src/main/resources/templates/iot-ui/sensorSummary.html +++ b/ruoyi-admin/src/main/resources/templates/iot-ui/sensorSummary.html @@ -1,49 +1,52 @@ - +
- -