Commit 4f53e130 by 李伟康

refactor(DailyReport): 优化日报组件功能

- 为 input 添加 maxlength 属性,限制输入长度为 3
- 修改 carForm 渲染逻辑,增加只读和禁用状态的显示
- 优化 textarea 样式,调整宽度计算方式
1 parent 2f9c8944
......@@ -39,6 +39,7 @@
placeholder-class="placeholder"
@blur="handleBlur($event, i)"
:disabled="filterDisabled(isEditReport)"
:maxlength="3"
>
</template>
<template v-else-if="i.type == 'picker'">
......@@ -101,7 +102,7 @@
<template v-for="(i,ind) in filterTemplateList">
<view
:class="['form-item flex',{name:i.name}]"
:key="ind"
:key="`${index}_${ind}_${dateKey}`"
:id="i.refId ? `${i.refId}_${index}` : ''"
>
<template v-if="i.name">
......@@ -115,15 +116,25 @@
</template>
</view>
<view class="value flex">
<input
class="input"
:type="i.type || 'text'"
:value="item[i.key]"
:placeholder="i.inputPlaceholder || '请输入'"
placeholder-class="placeholder"
@blur="handleCarInputBlur($event, i , item)"
:disabled="filterDisabled(isEditReport) || i.disabled"
>
<template v-if="filterDisabled(isEditReport) || i.disabled">
<template v-if="item[i.key] != null">
{{item[i.key] }}
</template>
<template v-else>
<view class="placeholder">{{i.inputPlaceholder || '请输入'}}</view>
</template>
</template>
<template v-else>
<input
class="input"
:type="i.type || 'text'"
v-model="item[i.key]"
:placeholder="i.inputPlaceholder || '请输入'"
placeholder-class="placeholder"
@blur="handleCarInputBlur($event, i , item)"
:maxlength="3"
>
</template>
</view>
</template>
</view>
......@@ -605,7 +616,7 @@ export default {
let { value } = e.detail
this.orderObj[i.value] = value
this.orderObj[i.submitValue] = value == 1 ? 'Y' : 'N'
}
},
}
}
</script>
......@@ -676,7 +687,7 @@ export default {
font-size: 28rpx;
}
.textarea {
width:calc(100% - 24rpx);
width: calc(100% - 24rpx);
margin-left: 24rpx;
text-align: right;
}
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!