change - 传感器汇总页面调整:

1.左边的传感器部分,字体靠右显示
2.左边的传感器部分,添加选中效果
3.列表搜索部分,时间添加日历选择
4.列表部分,更改为40行
main
wenjy 3 years ago
parent e86b062eaa
commit 56fbd35ddb

@ -135,6 +135,10 @@ public class SensorSummaryController extends BaseController {
info.put("sensorLocation", x.getSensorLocation()); info.put("sensorLocation", x.getSensorLocation());
List<BaseSensorType> baseSensorTypeList = baseSensorTypeService.selectBaseSensorTypeList(new BaseSensorType(sensorTypeId, null, 0L));
info.put("sensorType", baseSensorTypeList.get(0).getSensortypeName());
result.add(info); result.add(info);
} }

File diff suppressed because one or more lines are too long

@ -2,7 +2,7 @@ body::-webkit-scrollbar {
display: none; display: none;
} }
.sensorTypeItem{ .sensorTypeItem{
margin-top: 5%; /*margin-top: 5%;
margin-left: 5%; margin-left: 5%;
width: 90%; width: 90%;
height: 10%; height: 10%;
@ -12,7 +12,21 @@ body::-webkit-scrollbar {
color: white; color: white;
font-size: 1em; font-size: 1em;
line-height: 100%; line-height: 100%;
padding-left: 37%; padding-left: 37%;*/
margin-top: 5%;
margin-left: 5%;
width: 90%;
height: 10%;
border: 0px solid red;
background: url(../../img/4/type-background.png) no-repeat 0px 0px;
background-size: 99% 100%;
color: white;
font-size: 0.9em;
line-height: 100%;
padding-left: 58%;
border-radius: 6px;
background-color: #05335C;
} }
.sensorTypeItem span{ .sensorTypeItem span{
position: absolute; position: absolute;

@ -22,7 +22,7 @@ $(()=>{
div.setAttribute("class","sensorTypeItem"); div.setAttribute("class","sensorTypeItem");
document.getElementById("sensorType").contentWindow.document.body.appendChild(div); document.getElementById("sensorType").contentWindow.document.body.appendChild(div);
}) })
sensorInfoList(res[0].sensortypeId); sensorInfoList("cttemperature");
}, },
error: () => { error: () => {
console.log("失败"); console.log("失败");
@ -31,6 +31,17 @@ $(()=>{
}) })
var lastBackground = "";
function btnBaby1_onclick(){ function btnBaby1_onclick(){
if(lastBackground != null && lastBackground != ""){
lastBackground.style.backgroundColor = "#05335C";
}
this.style.backgroundColor = "#428BCA";
sensorInfoList(this.id); sensorInfoList(this.id);
lastBackground = this;
} }

@ -11,19 +11,24 @@ const sensorInfoList = function (sensorTypeId) {
json: 'callback', json: 'callback',
processData: false, processData: false,
contentType: false, contentType: false,
beforeSend: function () {
$.modal.loading("正在处理中,请稍候...");
},
success: function (json) { success: function (json) {
$.modal.closeLoading();
const sensorTypeArray = getparamsFunction(sensorTypeId); const sensorTypeArray = getparamsFunction(sensorTypeId);
const columnsArray = []; const columnsArray = [];
if(sensorTypeArray.length > 0){ if(sensorTypeArray.length > 0){
columnsArray.push({field: "id", title: "序号", width: 60,height: 60, colspan: 1, rowspan: 1, align: "center"}); columnsArray.push({field: "id", title: "序号", width: 60,height: 60, colspan: 1, rowspan: 1, align: "center"});
columnsArray.push({field: "sensorId", title: "传感器ID", width: 180,height: 60, colspan: 1, rowspan: 1, align: "center"}); columnsArray.push({field: "sensorId", title: "传感器ID", width: 180,height: 60, colspan: 1, rowspan: 1, align: "center"});
columnsArray.push({field: "sensorType", title: "设备类型", width: 180,height: 60, colspan: 1, rowspan: 1, align: "center"});
if (json.length > 0) { if (json.length > 0) {
const jsonObj = Object.keys(json[0]); const jsonObj = Object.keys(json[0]);
console.log(jsonObj); console.log(jsonObj);
for (let i = 0; i < jsonObj.length; i++) {//Object.keys(obj) 获取key名称 for (let i = 0; i < jsonObj.length; i++) {//Object.keys(obj) 获取key名称
let property = jsonObj[i]; let property = jsonObj[i];
if (property != "id" && property != "edgeId" && property != "sensorId" && property != 'sensorLocation' && property != 'datatype' && property != 'collectTime') { if (property != "id" && property != "edgeId" && property != "sensorId" && property != 'sensorLocation' && property != 'datatype' && property != 'collectTime' && property != 'sensorType') {
columnsArray.push({ columnsArray.push({
field: property, field: property,
title: typeof(sensorTypeArray.find(x=>x.paramTitle.includes(property))) == "undefined" ? property : sensorTypeArray.find(x=>x.paramTitle.includes(property)).paramText, title: typeof(sensorTypeArray.find(x=>x.paramTitle.includes(property))) == "undefined" ? property : sensorTypeArray.find(x=>x.paramTitle.includes(property)).paramText,
@ -75,8 +80,8 @@ const sensorInfoList = function (sensorTypeId) {
pageNumber: 1, pageNumber: 1,
pagination: true, pagination: true,
sidePagination: 'client', sidePagination: 'client',
pageSize: 10, pageSize: 40,
pageList: [5, 10, 15, 20, 25, 50], pageList: [20, 50, 100, 150, 200, 500],
showRefresh: false, showRefresh: false,
columns: columnsArray columns: columnsArray
}); });

@ -45,9 +45,25 @@
<script th:src="@{/js/Iot-ui/bootstrap-table.js}"></script> <script th:src="@{/js/Iot-ui/bootstrap-table.js}"></script>
<script th:src="@{/js/Iot-ui/sensorTableList.js}"></script> <script th:src="@{/js/Iot-ui/sensorTableList.js}"></script>
<script th:src="@{/js/Iot-ui/sensorSummary.js}"></script> <script th:src="@{/js/Iot-ui/sensorSummary.js}"></script>
<script th:inline="javascript">
<th:block th:include="include :: datetimepicker-js"/>
<th:block th:include="include :: footer"/>
<script>
<!-- laydate示例 -->
layui.use('laydate', function () {
var laydate = layui.laydate;
laydate.render({
elem: '#collectTime',
type: 'datetime',
trigger: 'click',
done: (value) => {
onSearchByCollectTime(document.getElementById("collectTime"));
}
});
});
</script> </script>
</body> </body>
</html> </html>
Loading…
Cancel
Save