增加转换时间格式方法 修改examDate_radio_change 内容
This commit is contained in:
parent
fc9010db2a
commit
4790b2ec0e
@ -432,9 +432,28 @@ const examDate_radio_value = ref(1);
|
||||
const examDate_radio_change = ()=>{
|
||||
if([1,2,3,4].includes(examDate_radio_value.value))
|
||||
{
|
||||
//switch case
|
||||
queryParams.examDate=['2024-07-01 00:00:00','2024-07-09 23:59:59'];
|
||||
|
||||
let timesta = new Date()
|
||||
let timeend = new Date()
|
||||
//判断当前选择的是那个时间
|
||||
if (examDate_radio_value.value===1) {
|
||||
|
||||
queryParams.examDate=[nowDate(timesta),nowDate(timeend)];
|
||||
} else if (examDate_radio_value.value===2)
|
||||
{
|
||||
timesta.setDate(timesta.getDate() - 1)
|
||||
queryParams.examDate=[nowDate(timesta),nowDate(timeend)];
|
||||
}
|
||||
else if(examDate_radio_value.value===3)
|
||||
{
|
||||
timesta.setDate(timesta.getDate() - 3)
|
||||
queryParams.examDate=[nowDate(timesta),nowDate(timeend)];
|
||||
}
|
||||
else if(examDate_radio_value.value===4)
|
||||
{
|
||||
timesta.setDate(timesta.getDate() - 7)
|
||||
queryParams.examDate=[nowDate(timesta),nowDate(timeend)];
|
||||
}
|
||||
|
||||
handleQuery();
|
||||
}else if(5===examDate_radio_value.value)
|
||||
{
|
||||
@ -442,6 +461,20 @@ const examDate_radio_change = ()=>{
|
||||
}
|
||||
}
|
||||
|
||||
///转换时间格式
|
||||
function nowDate(time) {
|
||||
var year = time.getFullYear(); // 年
|
||||
var month = (time.getMonth() + 1).toString().padStart(2, '0'); // 月
|
||||
var date = time.getDate().toString().padStart(2, '0'); // 日
|
||||
var hour = time.getHours().toString().padStart(2, '0'); // 时
|
||||
var minute = time.getMinutes().toString().padStart(2, '0'); // 分
|
||||
var second = time.getSeconds().toString().padStart(2, '0'); // 秒
|
||||
return (
|
||||
year + "-" + month + "-" + date + " " + hour + ":" + minute + ":" + second
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
|
||||
/** 查询列表 */
|
||||
const getList = async () => {
|
||||
|
Loading…
Reference in New Issue
Block a user