1. 修正 日志 页面的搜索BUG

2. 优化 日志 页面的数据显示
This commit is contained in:
fengyarnom 2024-11-28 15:07:21 +08:00
parent 55849e2e76
commit 3f3323df3d
3 changed files with 49 additions and 5 deletions

View File

@ -43,15 +43,14 @@ public class GnssSingleDataController extends BasicController implements CommonE
JSONObject search = null;
if (searchParams != null) {
search = (JSONObject) JSONObject.parse(searchParams);
System.out.println(search);
String deviceId = search.getString("deviceid");
String deviceId = search.getString("sl_deviceid"); // sql where like deviceid
Integer freqency = search.getInteger("freqency");
String begin = search.getString("dgt_.createtime");
String end = search.getString("dlt_.createtime");
if(deviceId != null && !deviceId.isEmpty() && freqency!=0){
Page pageable = new Page<>(page == null ? 1 : page, limit == null ? 10 : limit);
// 缺省按1小时采样如果时间跨度较大则按最多300条记录的采样率采样
int sample = 6;

View File

@ -54,7 +54,7 @@
"target": "_self"
},
{
"title": "Log",
"title": "日志",
"href": "page/gnss_single_data",
"icon": "fa fa-clipboard",
"target": "_self"

View File

@ -20,7 +20,7 @@
<div class="layui-inline">
<label class="layui-form-label">设备号</label>
<div class="layui-input-inline">
<input type="text" name="deviceid" id="input_deviceid" class="layui-input" style="position:absolute;z-index:2;width:85%;" value="" autocomplete="off">
<input type="text" name="sl_deviceid" id="input_deviceid" class="layui-input" style="position:absolute;z-index:2;width:85%;" value="" autocomplete="off">
<select id="deviceid" lay-search="" lay-filter="device" >
<option value="">全部</option>
</select>
@ -245,5 +245,50 @@
});
</script>
<script type="text/javascript">
const STATUS_CONFIG_F9P = {
0: { text: '无B562', color: 'layui-bg-gray' },
1: { text: '浮点解', color: 'layui-bg-gray' },
2: { text: '固定解', color: 'layui-bg-green' },
default: { text: '其他', color: 'layui-bg-gray' }
};
const STATUS_CONFIG_GGA = {
4: { text: '固定解', color: 'layui-bg-green' },
5: { text: '浮点解', color: 'layui-bg-gray' },
default: { text: '其他', color: 'layui-bg-gray' }
};
function renderStatus(model,status) {
if(model === 0){
const config = STATUS_CONFIG_F9P[status] || STATUS_CONFIG_F9P.default;
return `<span class="layui-badge ${config.color}">${config.text}</span>`;
}
else if(model === 1){
const config = STATUS_CONFIG_GGA[status] || STATUS_CONFIG_GGA.default;
return `<span class="layui-badge ${config.color}">${config.text}</span>`;
}
}
</script>
<script type="text/html" id="status">
{{ renderStatus(d.model,d.status) }}
</script>
<script type="text/javascript">
const MODEL_CONFIG = {
0: { text: 'ECEF - F9P', color: 'layui-bg-orange' },
1: { text: 'GGA - 博通', color: 'layui-bg-green' }
};
function renderModel(model) {
const config = MODEL_CONFIG[model] || MODEL_CONFIG[0];
return `<span class="layui-badge ${config.color}">${config.text}</span>`;
}
</script>
<script type="text/html" id="model">
{{ renderModel(d.model) }}
</script>
</body>
</html>