|
@@ -44,6 +44,63 @@
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
</div>
|
|
</div>
|
|
|
</template>
|
|
</template>
|
|
|
|
|
+ <template #captureTime>
|
|
|
|
|
+ <el-date-picker
|
|
|
|
|
+ v-model="ruleFormData.captureTime"
|
|
|
|
|
+ placeholder="请选择抓拍时间"
|
|
|
|
|
+ type="datetime"
|
|
|
|
|
+ format="YYYY-MM-DD HH:mm:ss"
|
|
|
|
|
+ dateFormat="MMM DD YYYY"
|
|
|
|
|
+ timeFormat="HH:mm:ss"
|
|
|
|
|
+ valueFormat="YYYY-MM-DD HH:mm:ss"
|
|
|
|
|
+ :editable="false"
|
|
|
|
|
+ :disabledDate="(time) => time.getTime() > Date.now()"
|
|
|
|
|
+ :disabledHours="
|
|
|
|
|
+ (role, comparingDate) => {
|
|
|
|
|
+ if (!role) return [];
|
|
|
|
|
+ const now = new Date();
|
|
|
|
|
+ now.setHours(0, 0, 0, 0);
|
|
|
|
|
+ if (comparingDate.valueOf() < now.getTime()) return [];
|
|
|
|
|
+ const huors = 23 - new Date().getHours();
|
|
|
|
|
+ return Array.from({ length: huors }, (_, i) => 23 - i);
|
|
|
|
|
+ }
|
|
|
|
|
+ "
|
|
|
|
|
+ :disabledMinutes="
|
|
|
|
|
+ (hour, role, comparingDate) => {
|
|
|
|
|
+ if (!role) return [];
|
|
|
|
|
+ const now = new Date();
|
|
|
|
|
+ const nowHour = now.getHours();
|
|
|
|
|
+ if (hour < nowHour) return [];
|
|
|
|
|
+ now.setHours(0, 0, 0, 0);
|
|
|
|
|
+ if (comparingDate.valueOf() < now.getTime()) return [];
|
|
|
|
|
+ const minutes = 59 - new Date().getMinutes();
|
|
|
|
|
+ return Array.from({ length: minutes }, (_, i) => 59 - i);
|
|
|
|
|
+ }
|
|
|
|
|
+ "
|
|
|
|
|
+ :disabledSeconds="
|
|
|
|
|
+ (hour, minute, role, comparingDate) => {
|
|
|
|
|
+ if (!role) return [];
|
|
|
|
|
+ const now = new Date();
|
|
|
|
|
+ const nowHour = now.getHours();
|
|
|
|
|
+ const nowMinutes = now.getMinutes();
|
|
|
|
|
+ if (hour < nowHour) return [];
|
|
|
|
|
+ if (hour === nowHour && minute < nowMinutes) return [];
|
|
|
|
|
+ now.setHours(0, 0, 0, 0);
|
|
|
|
|
+ if (comparingDate.valueOf() < now.getTime()) return [];
|
|
|
|
|
+ const seconds = 59 - new Date().getSeconds();
|
|
|
|
|
+ return Array.from({ length: seconds }, (_, i) => 59 - i);
|
|
|
|
|
+ }
|
|
|
|
|
+ "
|
|
|
|
|
+ @change="
|
|
|
|
|
+ (val) => {
|
|
|
|
|
+ if (new Date(val).getTime() > Date.now()) {
|
|
|
|
|
+ ElMessage.error('抓拍时间不晚于当前时间,请重新选择');
|
|
|
|
|
+ ruleFormData.captureTime = '';
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ "
|
|
|
|
|
+ ></el-date-picker>
|
|
|
|
|
+ </template>
|
|
|
<template #capturePhotos>
|
|
<template #capturePhotos>
|
|
|
<UploadImages
|
|
<UploadImages
|
|
|
:maxCount="5"
|
|
:maxCount="5"
|
|
@@ -108,6 +165,7 @@
|
|
|
ruleFormData.creatName = actDetail.value.creatName;
|
|
ruleFormData.creatName = actDetail.value.creatName;
|
|
|
|
|
|
|
|
imageList.value = unformatImage(actDetail.value.capturePhotos)!;
|
|
imageList.value = unformatImage(actDetail.value.capturePhotos)!;
|
|
|
|
|
+ cloneRuleFormData();
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
const imageList = ref<string[]>([]);
|
|
const imageList = ref<string[]>([]);
|
|
@@ -151,9 +209,8 @@
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
onMounted(() => {
|
|
onMounted(() => {
|
|
|
- getDetail();
|
|
|
|
|
- cloneRuleFormData();
|
|
|
|
|
beforeRouteLeave();
|
|
beforeRouteLeave();
|
|
|
|
|
+ getDetail();
|
|
|
});
|
|
});
|
|
|
</script>
|
|
</script>
|
|
|
|
|
|