Replace record audit date picker controls
This commit is contained in:
@@ -1030,10 +1030,19 @@ function buildChatQuery() {
|
||||
keyword: chatFilters.keyword,
|
||||
userId: chatFilters.userId,
|
||||
status: chatFilters.status,
|
||||
dateFrom: chatFilters.dateFrom,
|
||||
dateTo: chatFilters.dateTo,
|
||||
dateFrom: formatRecordDateTime(chatFilters.dateFrom, "start"),
|
||||
dateTo: formatRecordDateTime(chatFilters.dateTo, "end"),
|
||||
};
|
||||
}
|
||||
|
||||
function formatRecordDateTime(value: string, boundary: "start" | "end") {
|
||||
if (!value) return "";
|
||||
const [date, time = ""] = value.trim().replace("T", " ").split(" ");
|
||||
if (!date) return "";
|
||||
const [hour = "00", minute = "00", second] = time.split(":");
|
||||
const normalizedSecond = second ?? (boundary === "end" ? "59" : "00");
|
||||
return `${date} ${hour.padStart(2, "0")}:${minute.padStart(2, "0")}:${normalizedSecond.padStart(2, "0")}`;
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
@@ -1520,21 +1529,17 @@ function buildChatQuery() {
|
||||
<el-option label="已停止" value="STOPPED" />
|
||||
<el-option label="失败" value="FAILED" />
|
||||
</el-select>
|
||||
<el-date-picker
|
||||
v-model="chatFilters.dateFrom"
|
||||
class="record-date-item"
|
||||
type="datetime"
|
||||
placeholder="开始时间"
|
||||
value-format="YYYY-MM-DD HH:mm:ss"
|
||||
/>
|
||||
<span class="record-date-sep">至</span>
|
||||
<el-date-picker
|
||||
v-model="chatFilters.dateTo"
|
||||
class="record-date-item"
|
||||
type="datetime"
|
||||
placeholder="结束时间"
|
||||
value-format="YYYY-MM-DD HH:mm:ss"
|
||||
/>
|
||||
<div class="record-date-range" aria-label="时间范围">
|
||||
<label class="record-date-field">
|
||||
<span>开始时间</span>
|
||||
<input v-model="chatFilters.dateFrom" type="datetime-local" aria-label="开始时间" />
|
||||
</label>
|
||||
<span class="record-date-sep">至</span>
|
||||
<label class="record-date-field">
|
||||
<span>结束时间</span>
|
||||
<input v-model="chatFilters.dateTo" type="datetime-local" aria-label="结束时间" />
|
||||
</label>
|
||||
</div>
|
||||
<div class="record-filter-actions">
|
||||
<el-button type="primary" @click="searchChats">搜索</el-button>
|
||||
<el-button @click="resetChatFilters">重置</el-button>
|
||||
|
||||
@@ -719,8 +719,11 @@ textarea {
|
||||
width: 150px;
|
||||
}
|
||||
|
||||
.record-date-item {
|
||||
width: 180px;
|
||||
.record-date-range {
|
||||
display: flex;
|
||||
flex-wrap: nowrap;
|
||||
gap: 8px;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.record-date-sep {
|
||||
@@ -729,6 +732,45 @@ textarea {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding: 0 2px;
|
||||
min-height: 40px;
|
||||
}
|
||||
|
||||
.record-date-field {
|
||||
width: 210px;
|
||||
height: 40px;
|
||||
display: grid;
|
||||
grid-template-columns: auto minmax(0, 1fr);
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
padding: 0 11px;
|
||||
border: 1px solid #dcdfe6;
|
||||
border-radius: 4px;
|
||||
background: #ffffff;
|
||||
color: #606266;
|
||||
}
|
||||
|
||||
.record-date-field:focus-within {
|
||||
border-color: #409eff;
|
||||
}
|
||||
|
||||
.record-date-field span {
|
||||
color: #909399;
|
||||
font-size: 13px;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.record-date-field input {
|
||||
min-width: 0;
|
||||
border: 0;
|
||||
outline: none;
|
||||
background: transparent;
|
||||
color: #303133;
|
||||
font-size: 13px;
|
||||
}
|
||||
|
||||
.record-date-field input::-webkit-calendar-picker-indicator {
|
||||
cursor: pointer;
|
||||
opacity: 0.72;
|
||||
}
|
||||
|
||||
.record-filter-actions {
|
||||
|
||||
Reference in New Issue
Block a user