+
@@ -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;
}
diff --git a/src/layout/MainLayout.vue b/src/layout/MainLayout.vue
index da4f99c..62eb536 100644
--- a/src/layout/MainLayout.vue
+++ b/src/layout/MainLayout.vue
@@ -23,7 +23,12 @@
:max-count="99"
:show-zero="false"
>
-
@@ -39,9 +45,9 @@
v-else
v-text="navBarStore.rightText"
class="nav-text"
- :style="{ color: navBarStore.rightTextColor ? navBarStore.rightTextColor : '#333' }"
- :class="{ clickable: !!navBarStore.rightAction }"
- @click="navBarStore.rightAction?.()"
+ :style="{ color: navBarStore.rightDisabled ? 'var(--td-text-color-disabled)' : navBarStore.rightTextColor ? navBarStore.rightTextColor : '#333' }"
+ :class="{ clickable: !!navBarStore.rightAction && !navBarStore.rightDisabled, disabled: navBarStore.rightDisabled }"
+ @click="!navBarStore.rightDisabled && navBarStore.rightAction?.()"
>
@@ -257,6 +263,11 @@ const tabBarHeight = computed(() => {
justify-content: center;
color: var(--td-text-color-primary, #333);
background: transparent;
+
+ &:disabled {
+ color: var(--td-text-color-disabled);
+ cursor: not-allowed;
+ }
}
.nav-title-slot {
@@ -288,6 +299,10 @@ const tabBarHeight = computed(() => {
&.clickable {
cursor: pointer;
}
+
+ &.disabled {
+ cursor: not-allowed;
+ }
}
}
diff --git a/src/pages/customer/CustomerEdit.vue b/src/pages/customer/CustomerEdit.vue
index 76f865c..0de3920 100644
--- a/src/pages/customer/CustomerEdit.vue
+++ b/src/pages/customer/CustomerEdit.vue
@@ -6,6 +6,7 @@
v-model.trim="formData.code"
placeholder="客户编码"
borderless
+ @blur="handleCodeBlur"
>