Replace record audit date picker controls
This commit is contained in:
@@ -1030,10 +1030,19 @@ function buildChatQuery() {
|
|||||||
keyword: chatFilters.keyword,
|
keyword: chatFilters.keyword,
|
||||||
userId: chatFilters.userId,
|
userId: chatFilters.userId,
|
||||||
status: chatFilters.status,
|
status: chatFilters.status,
|
||||||
dateFrom: chatFilters.dateFrom,
|
dateFrom: formatRecordDateTime(chatFilters.dateFrom, "start"),
|
||||||
dateTo: chatFilters.dateTo,
|
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>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
@@ -1520,21 +1529,17 @@ function buildChatQuery() {
|
|||||||
<el-option label="已停止" value="STOPPED" />
|
<el-option label="已停止" value="STOPPED" />
|
||||||
<el-option label="失败" value="FAILED" />
|
<el-option label="失败" value="FAILED" />
|
||||||
</el-select>
|
</el-select>
|
||||||
<el-date-picker
|
<div class="record-date-range" aria-label="时间范围">
|
||||||
v-model="chatFilters.dateFrom"
|
<label class="record-date-field">
|
||||||
class="record-date-item"
|
<span>开始时间</span>
|
||||||
type="datetime"
|
<input v-model="chatFilters.dateFrom" type="datetime-local" aria-label="开始时间" />
|
||||||
placeholder="开始时间"
|
</label>
|
||||||
value-format="YYYY-MM-DD HH:mm:ss"
|
<span class="record-date-sep">至</span>
|
||||||
/>
|
<label class="record-date-field">
|
||||||
<span class="record-date-sep">至</span>
|
<span>结束时间</span>
|
||||||
<el-date-picker
|
<input v-model="chatFilters.dateTo" type="datetime-local" aria-label="结束时间" />
|
||||||
v-model="chatFilters.dateTo"
|
</label>
|
||||||
class="record-date-item"
|
</div>
|
||||||
type="datetime"
|
|
||||||
placeholder="结束时间"
|
|
||||||
value-format="YYYY-MM-DD HH:mm:ss"
|
|
||||||
/>
|
|
||||||
<div class="record-filter-actions">
|
<div class="record-filter-actions">
|
||||||
<el-button type="primary" @click="searchChats">搜索</el-button>
|
<el-button type="primary" @click="searchChats">搜索</el-button>
|
||||||
<el-button @click="resetChatFilters">重置</el-button>
|
<el-button @click="resetChatFilters">重置</el-button>
|
||||||
|
|||||||
@@ -719,8 +719,11 @@ textarea {
|
|||||||
width: 150px;
|
width: 150px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.record-date-item {
|
.record-date-range {
|
||||||
width: 180px;
|
display: flex;
|
||||||
|
flex-wrap: nowrap;
|
||||||
|
gap: 8px;
|
||||||
|
align-items: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
.record-date-sep {
|
.record-date-sep {
|
||||||
@@ -729,6 +732,45 @@ textarea {
|
|||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
padding: 0 2px;
|
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 {
|
.record-filter-actions {
|
||||||
|
|||||||
Reference in New Issue
Block a user