fix: 统一用户有效期日期选择控件
This commit is contained in:
@@ -285,13 +285,17 @@ async function createStudent() {
|
||||
nickname: studentForm.nickname || null,
|
||||
status: studentForm.status,
|
||||
dailyChatLimit: studentForm.dailyChatLimit,
|
||||
expiredAt: studentForm.expiredAt || null,
|
||||
expiredAt: toExpiryDateTime(studentForm.expiredAt),
|
||||
});
|
||||
ElMessage.success("学员已添加");
|
||||
resetStudentForm();
|
||||
await loadCurrentMenu();
|
||||
}
|
||||
|
||||
function toExpiryDateTime(date: string) {
|
||||
return date ? `${date}T23:59:59` : null;
|
||||
}
|
||||
|
||||
function handleStudentImportFile(event: Event) {
|
||||
const input = event.target as HTMLInputElement;
|
||||
studentImportFile.value = input.files?.[0] ?? null;
|
||||
@@ -840,12 +844,10 @@ function formatRecordDateTime(value: string, boundary: "start" | "end") {
|
||||
<el-input v-model="studentForm.name" placeholder="姓名" />
|
||||
<el-input v-model="studentForm.nickname" placeholder="昵称(可选)" />
|
||||
<el-input-number v-model="studentForm.dailyChatLimit" :min="0" />
|
||||
<el-date-picker
|
||||
v-model="studentForm.expiredAt"
|
||||
type="datetime"
|
||||
value-format="YYYY-MM-DDTHH:mm:ss"
|
||||
placeholder="有效期(可选)"
|
||||
/>
|
||||
<label class="record-date-field student-expiry-field">
|
||||
<span>有效期</span>
|
||||
<input v-model="studentForm.expiredAt" type="date" aria-label="学员有效期" title="留空表示长期有效" />
|
||||
</label>
|
||||
<div class="form-switch-row">
|
||||
<span>启用</span>
|
||||
<el-switch v-model="studentForm.status" :active-value="1" :inactive-value="0" />
|
||||
|
||||
@@ -341,8 +341,11 @@ textarea {
|
||||
}
|
||||
|
||||
.student-form-grid .el-input,
|
||||
.student-form-grid .el-input-number,
|
||||
.student-form-grid .el-date-editor {
|
||||
.student-form-grid .el-input-number {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.student-expiry-field {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user