1
<el-form-item label="时间管理" prop="timeManager">
<el-date-picker
v-model="timeManager"
:disabled="form.id?true:false"
type="datetimerange"
start-placeholder="开始日期"
end-placeholder="结束日期"
format="YYYY-MM-DD HH:mm:ss"
/>
</el-form-item>
2 转换格式(提交后台)
const startTime = formatDate(leaveManagement.value[0], 'yyyy-MM-dd HH:mm:ss')
const endTime = formatDate(leaveManagement.value[1], 'yyyy-MM-dd HH:mm:ss')
3 后端返回赋值视图层
const timeManager= ref(['2025-01-02 00:00:00','2025-01-02 23:59:59'])