修改时间选择

main
夜笙歌 2 years ago
parent fce82d7d91
commit cb45225017

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

Loading…
Cancel
Save