feat(web-admin): mobile-friendly OA money field for phone preview

Add decimal inputmode, taller touch targets under 768px, and wrapping uppercase; document phase-1 vs phase-2 mobile scope.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
zlwuandCursor committed 2026-07-30 11:15:40 +08:00
1 parent 221a6fd360
commit be41e8f202
3 files changed
+67 -6

No files matched your search

@@ -4,6 +4,7 @@
:placeholder="placeholder"
:disabled="disabled"
:clearable="clearable"
:inputmode="inputmode"
style="width: 100%"
@focus="handleFocus"
@blur="handleBlur"
@@ -29,6 +30,8 @@
placeholder?: string
disabled?: boolean
clearable?: boolean
/** 移动端数字键盘提示,如 decimal;不传则不设置 */
inputmode?: string
}
const props = withDefaults(defineProps<Props>(), {
@@ -37,7 +40,8 @@
precision: 2,
placeholder: '',
disabled: false,
clearable: true
clearable: true,
inputmode: undefined
})
const emit = defineEmits<{
@@ -1,13 +1,18 @@
<!-- FormCreate 自定义控件:金额(数字 + 可选人民币大写) -->
<!-- FormCreate 自定义控件:金额(数字 + 可选人民币大写;窄屏/手机预览友好) -->
<template>
<div class="oa-money-field">
<template v-if="isDesignerHost">
<el-input model-value="" :placeholder="placeholder || '请输入金额'" disabled />
<el-input
model-value=""
:placeholder="placeholder || '请输入金额'"
inputmode="decimal"
disabled
/>
<div v-if="showUpper" class="oa-money-field__upper">大写金额预览</div>
</template>
<template v-else-if="disabled">
<div class="oa-money-field__readonly">
<span>{{ displayNumber || '—' }}</span>
<span class="oa-money-field__num">{{ displayNumber || '—' }}</span>
<div v-if="showUpper && upperText" class="oa-money-field__upper">{{ upperText }}</div>
</div>
</template>
@@ -17,6 +22,7 @@
:placeholder="placeholder || '请输入金额'"
:min="0"
:precision="2"
inputmode="decimal"
@update:model-value="onInput"
/>
<div v-if="showUpper && upperText" class="oa-money-field__upper">{{ upperText }}</div>
@@ -81,10 +87,41 @@
</script>
<style scoped>
.oa-money-field {
width: 100%;
}
/* 窄屏/手机预览:触控高度与全宽 */
.oa-money-field :deep(.el-input__wrapper) {
min-height: 40px;
}
.oa-money-field__readonly {
width: 100%;
word-break: break-word;
}
.oa-money-field__num {
display: block;
line-height: 1.5;
}
.oa-money-field__upper {
margin-top: 6px;
font-size: 12px;
line-height: 1.4;
line-height: 1.5;
color: var(--mint-text-muted, #64748b);
word-break: break-word;
overflow-wrap: anywhere;
}
@media (max-width: 767px) {
.oa-money-field :deep(.el-input__wrapper) {
min-height: 44px;
}
.oa-money-field__upper {
font-size: 11px;
}
}
</style>