feat: 更新发行申请表单,添加订阅开始和结束时间字段,优化日期验证逻辑

This commit is contained in:
2025-12-21 03:42:45 +07:00
parent fcaf7db923
commit 101554ef5e
9 changed files with 175 additions and 97 deletions

View File

@@ -10,9 +10,9 @@ interface Props {
interface Emits {
"update:modelValue": [value: boolean];
"scan-success": [result: QRScanResult];
"scan-error": [error: Error];
"scan-cancelled": [];
"scanSuccess": [result: QRScanResult];
"scanError": [error: Error];
"scanCancelled": [];
}
const props = withDefaults(defineProps<Props>(), {
@@ -37,17 +37,17 @@ async function handleStartScan() {
const result = await startScan();
if (result) {
emit("scan-success", result);
emit("scanSuccess", result);
await handleClose();
}
else {
emit("scan-cancelled");
emit("scanCancelled");
await handleClose();
}
}
catch (error) {
console.error("Scan failed:", error);
emit("scan-error", error as Error);
emit("scanError", error as Error);
await handleClose();
}
finally {

View File

@@ -14,9 +14,10 @@ const props = defineProps<Props>();
const emit = defineEmits<{
(e: "update:value", value: string): void;
}>();
const model = defineModel({ type: String, required: true });
function handleChange(value: string) {
const formattedValue = props.formatterValue ? props.formatterValue(value) : new Date(value).toISOString();
model.value = formattedValue;
props.onChange(formattedValue);
emit("update:value", formattedValue);
}
@@ -41,7 +42,7 @@ function formatDisplay(value: string) {
:id="datetime"
class="ui-datetime"
done-text="Done"
presentation="date"
presentation="date-time"
:show-default-buttons="true"
:min="props.min"
:max="props.max"