修改时间选择

main
夜笙歌 2 years ago
parent fce82d7d91
commit cb45225017

@ -18,11 +18,8 @@
</li> </li>
<li class="select-time"> <li class="select-time">
<label>采集时间:</label> <label>采集时间:</label>
<input class="time-input" id="startTime" name="beginCollectTime" placeholder="开始时间" <input class="time-input" id="startEndTime" name="beginCollectTime" placeholder="开始时间"
type="text"/> type="text" style="width:275px"/>
<span>-</span>
<input class="time-input" id="endTime" name="endCollectTime" placeholder="结束时间"
type="text"/>
</li> </li>
<li> <li>
<a class="btn btn-primary btn-rounded btn-sm" onclick="tableRefresh()"><i <a class="btn btn-primary btn-rounded btn-sm" onclick="tableRefresh()"><i
@ -63,8 +60,8 @@
let formData = new FormData(); let formData = new FormData();
formData.append("sensorId", sensorId[0]); formData.append("sensorId", sensorId[0]);
formData.append("sensorType", sensorId[1]); formData.append("sensorType", sensorId[1]);
formData.append("beginCollectTime", $("#startTime").val()); formData.append("beginCollectTime", $("#startEndTime").val().split(' - ')?.[0] || '');
formData.append("endCollectTime", $("#endTime").val()); formData.append("endCollectTime", $("#startEndTime").val().split(' - ')?.[1] || '');
$.ajax({ $.ajax({
type: "post", type: "post",
@ -204,15 +201,11 @@
var laydate = layui.laydate; var laydate = layui.laydate;
laydate.render({ laydate.render({
elem: '#startTime', elem: '#startEndTime',
type: 'datetime', type: 'datetime',
trigger: 'click' trigger: 'click',
}); range: true,
format: 'yyyy-MM-dd HH:mm:ss',
laydate.render({
elem: '#endTime',
type: 'datetime',
trigger: 'click'
}); });
}); });
</script> </script>

Loading…
Cancel
Save