吉安感知网项目-前端
shuishen
2026-01-22 0dcf3e02ece4ecbb6b1983c4379671936693b409
feat:区域划分可飞行时段日期选择调整
2 files modified
69 ■■■■■ changed files
applications/drone-command/src/styles/common/cockpit.scss 36 ●●●●● patch | view | raw | blame | history
applications/drone-command/src/views/areaManage/partition/FormDiaLog.vue 33 ●●●●● patch | view | raw | blame | history
applications/drone-command/src/styles/common/cockpit.scss
@@ -204,6 +204,42 @@
                color: #fff !important;
                .el-date-range-picker__time-header {
                    .el-time-panel {
                        background: #1A1A2A !important;
                        border-radius: 0px 0px 8px 8px;
                        border: none !important;
                        // 将 time-picker-popper 的样式移到这里
                        .el-time-panel__header {
                            background: #161B2C !important;
                            color: #ffffff !important;
                            border-bottom: 1px solid rgba(71, 157, 255, 0.3) !important;
                        }
                        .el-time-panel__content {
                            .el-time-spinner__item {
                                &:hover {
                                    background: transparent !important;
                                }
                                &.active {
                                    color: #479dff !important;
                                    font-weight: bold;
                                }
                            }
                        }
                        .el-time-panel__footer {
                            .el-time-panel__btn {
                                color: #fff;
                            }
                            .el-time-panel__btn:first-child {
                                color: #86909C;
                            }
                        }
                    }
                    .el-input__wrapper {
                        box-shadow: none;
                        background: #2E2E48 !important;
applications/drone-command/src/views/areaManage/partition/FormDiaLog.vue
@@ -116,6 +116,7 @@
                        <el-date-picker class="command-date-picker"
                            popper-class="command-date-picker-popper" v-model="flyDateRange"
                            type="datetimerange" range-separator="至" start-placeholder="开始时间" end-placeholder="结束时间"
                            :disabled-date="disabledFlyDate" :disabled-time="disabledFlyTime"
                            value-format="YYYY-MM-DD HH:mm:ss" clearable />
                    </el-form-item>
                    <el-form-item label="关联派出所" prop="policeStationId">
@@ -226,6 +227,38 @@
    deviceIds: fieldRules(false),
}
function isSameDay (left, right) {
    return (
        left.getFullYear() === right.getFullYear() &&
        left.getMonth() === right.getMonth() &&
        left.getDate() === right.getDate()
    )
}
const disabledFlyDate = time => {
    const startOfToday = new Date()
    startOfToday.setHours(0, 0, 0, 0)
    return time.getTime() < startOfToday.getTime()
}
const disabledFlyTime = date => {
    if (!date) return {}
    const now = new Date()
    if (!isSameDay(date, now)) return {}
    const currentHour = now.getHours()
    const currentMinute = now.getMinutes()
    const currentSecond = now.getSeconds()
    return {
        disabledHours: () => Array.from({ length: currentHour }, (_, index) => index),
        disabledMinutes: hour =>
            hour === currentHour ? Array.from({ length: currentMinute }, (_, index) => index) : [],
        disabledSeconds: (hour, minute) =>
            hour === currentHour && minute === currentMinute
                ? Array.from({ length: currentSecond }, (_, index) => index)
                : [],
    }
}
// 关闭弹框
function handleCancel () {
    visible.value = false