disable form for bound customer code

This commit is contained in:
Timi
2026-08-29 12:06:32 +08:00
parent 04179fa55c
commit 4217fdb71b
4 changed files with 213 additions and 17 deletions
+13 -2
View File
@@ -1,18 +1,19 @@
<template>
<div class="birthdate-picker">
<t-radio-group class="mode" v-model="calendarProxy" variant="default-filled">
<t-radio-group class="mode" v-model="calendarProxy" variant="default-filled" :disabled="props.disabled">
<t-radio :block="false" borderless value="SOLAR">公历</t-radio>
<t-radio :block="false" borderless value="LUNAR">农历</t-radio>
<t-button
v-if="modelValue"
class="clear"
size="extra-small"
:disabled="props.disabled"
@click="clearValue"
>
清除
</t-button>
</t-radio-group>
<div class="value" @click="openPicker">
<div class="value" :class="{ disabled: props.disabled }" @click="openPicker">
<span :class="{ placeholder: !displayValue }" v-text="displayValue || placeholder" />
<t-icon name="chevron-right" size="1.25rem" />
</div>
@@ -58,10 +59,12 @@ type PickerValue = string | number;
const props = withDefaults(defineProps<{
modelValue?: string;
calendar?: BirthdateCalendar;
disabled?: boolean;
placeholder?: string;
}>(), {
modelValue: "",
calendar: "SOLAR",
disabled: false,
placeholder: "请选择出生日期"
});
@@ -145,6 +148,9 @@ const lunarColumns = computed(() => {
});
function openPicker(): void {
if (props.disabled) {
return;
}
if (calendarProxy.value === "SOLAR") {
solarDraft.value = props.modelValue || today;
} else {
@@ -238,6 +244,11 @@ function clearValue(): void {
align-items: center;
justify-content: space-between;
&.disabled {
color: var(--td-text-color-disabled);
cursor: not-allowed;
}
span {
line-height: 1.5;
}