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());
List<BaseSensorType> baseSensorTypeList = baseSensorTypeService.selectBaseSensorTypeList(new BaseSensorType(sensorTypeId, null, 0L));
info.put("sensorType", baseSensorTypeList.get(0).getSensortypeName());
result.add(info);
}

File diff suppressed because one or more lines are too long

@ -2,7 +2,7 @@ body::-webkit-scrollbar {
display: none;
}
.sensorTypeItem{
margin-top: 5%;
/*margin-top: 5%;
margin-left: 5%;
width: 90%;
height: 10%;
@ -12,9 +12,23 @@ body::-webkit-scrollbar {
color: white;
font-size: 1em;
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{
position: absolute;
left: 48%;
}
}

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

@ -11,19 +11,24 @@ const sensorInfoList = function (sensorTypeId) {
json: 'callback',
processData: false,
contentType: false,
beforeSend: function () {
$.modal.loading("正在处理中,请稍候...");
},
success: function (json) {
$.modal.closeLoading();
const sensorTypeArray = getparamsFunction(sensorTypeId);
const columnsArray = [];
if(sensorTypeArray.length > 0){
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: "sensorType", title: "设备类型", width: 180,height: 60, colspan: 1, rowspan: 1, align: "center"});
if (json.length > 0) {
const jsonObj = Object.keys(json[0]);
console.log(jsonObj);
for (let i = 0; i < jsonObj.length; i++) {//Object.keys(obj) 获取key名称
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({
field: property,
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,
pagination: true,
sidePagination: 'client',
pageSize: 10,
pageList: [5, 10, 15, 20, 25, 50],
pageSize: 40,
pageList: [20, 50, 100, 150, 200, 500],
showRefresh: false,
columns: columnsArray
});

@ -45,9 +45,25 @@
<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/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>
</body>
</html>
Loading…
Cancel
Save