Commit 0dea122a authored by weishengfei's avatar weishengfei

feat(person): 动态修改宝宝出生日期/预产日期

- 新增 getlabelFn 函数,根据宝宝阶段动态修改表单标签
- 优化宝宝出生日期/预产日期的显示逻辑
- 移除多余的控制台日志输出
parent 9ab4906c
......@@ -82,7 +82,8 @@
}"
>
<text class="form-label">
{{ item.label }}
{{getlabelFn(item)}}
<!-- {{ item.label }} -->
<text v-if="item.required" class="required">*</text>
</text>
<!-- 输入框类型 -->
......@@ -673,7 +674,15 @@ function onDateStatusChange(status) {
}
return true;
}
const getlabelFn =(item) =>{
console.log(formData.value, item, '66666666666666666666666666')
if (item.name === "babyBirthday") {
item.label = formData.value.babyStage == 1 ? '预产日期':'宝宝出生日期'
}
return item.label
}
// getLabelByValue 支持所有映射字段
const getLabelByValue = (item, value) => {
......@@ -692,7 +701,7 @@ const getLabelByValue = (item, value) => {
// // 添加根据切换状态修改文案
if (item.name === "babyBirthday") {
console.log("🚀 ~ getLabelByValue ~ formData:", formData.value, item)
// console.log("🚀 ~ getLabelByValue ~ formData:", formData.value, item)
item.placeholder = formData.value.babyBirthday? formData.value.babyBirthday : formData.value.babyStage == 1 ? '请选择预产日期':'请选择出生日期'
return item.placeholder
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment