@@ -5,8 +5,8 @@
< view v-if = "item.controller == 'Text'" class="order-wrap" :class="rowWrapClass" :style="rowWrapStyle" >
< view v-if = "item.controller == 'Text'" class="order-wrap" :class="rowWrapClass" :style="rowWrapStyle" >
< view : class = "['order-cell', { 'vertical-layout': mode === 'vertical' }]" :style = "rowCellStyle" >
< view : class = "['order-cell', { 'vertical-layout': mode === 'vertical' }]" :style = "rowCellStyle" >
< view class = "name" :style = "item._labelStyle" >
< view class = "name" :style = "item._labelStyle" >
< text class = "tit" > { { item . value . title } } < / text >
< text class = "required" : style = "{ color: requiredColor }" > { { item . value . required ? '*' : '' } } < / text >
< text class = "required" : style = "{ color: requiredColor }" > { { item . value . required ? '*' : '' } } < / text >
< text class = "tit" > { { item . value . title } } < / text >
< / view >
< / view >
< view : class = "['box', 'align-left']" :style = "item._boxAlignStyle" >
< view : class = "['box', 'align-left']" :style = "item._boxAlignStyle" >
< input
< input
@@ -23,8 +23,8 @@
< view v-if = "item.controller == 'Textarea'" class="order-wrap" :class="rowWrapClass" :style="rowWrapStyle" >
< view v-if = "item.controller == 'Textarea'" class="order-wrap" :class="rowWrapClass" :style="rowWrapStyle" >
< view : class = "['order-cell', 'flex-box', 'textarea', { 'vertical-layout': mode === 'vertical' }]" >
< view : class = "['order-cell', 'flex-box', 'textarea', { 'vertical-layout': mode === 'vertical' }]" >
< view class = "name" :style = "item._labelStyle" >
< view class = "name" :style = "item._labelStyle" >
< text class = "tit" > { { item . value . title } } < / text >
< text class = "required" : style = "{ color: requiredColor }" > { { item . value . required ? '*' : '' } } < / text >
< text class = "required" : style = "{ color: requiredColor }" > { { item . value . required ? '*' : '' } } < / text >
< text class = "tit" > { { item . value . title } } < / text >
< / view >
< / view >
< view : class = "['box', 'align-left']" :style = "item._boxAlignStyle" >
< view : class = "['box', 'align-left']" :style = "item._boxAlignStyle" >
<!-- 所有平台统一通过 formConfig . textareaRows / item . value . rows 控制显示行数 :
<!-- 所有平台统一通过 formConfig . textareaRows / item . value . rows 控制显示行数 :
@@ -51,8 +51,8 @@
>
>
< view : class = "['order-cell', { 'vertical-layout': mode === 'vertical' }]" >
< view : class = "['order-cell', { 'vertical-layout': mode === 'vertical' }]" >
< view class = "name" :style = "item._labelStyle" >
< view class = "name" :style = "item._labelStyle" >
< text class = "tit" > { { item . value . title } } < / text >
< text class = "required" : style = "{ color: requiredColor }" > { { item . value . required ? '*' : '' } } < / text >
< text class = "required" : style = "{ color: requiredColor }" > { { item . value . required ? '*' : '' } } < / text >
< text class = "tit" > { { item . value . title } } < / text >
< / view >
< / view >
< view : class = "['box', 'box-flex', 'align-right']" >
< view : class = "['box', 'box-flex', 'align-right']" >
< text v-if = "item.val != ''" > {{ item.val }} < / text >
< text v-if = "item.val != ''" > {{ item.val }} < / text >
@@ -67,22 +67,23 @@
< view v-if = "item.controller == 'Checkbox'" class="order-wrap" :class="rowWrapClass" :style="rowWrapStyle" >
< view v-if = "item.controller == 'Checkbox'" class="order-wrap" :class="rowWrapClass" :style="rowWrapStyle" >
< view : class = "['order-cell', { 'vertical-layout': mode === 'vertical' }]" >
< view : class = "['order-cell', { 'vertical-layout': mode === 'vertical' }]" >
< view class = "name" :style = "item._labelStyle" >
< view class = "name" :style = "item._labelStyle" >
< text class = "tit" > { { item . value . title } } < / text >
< text class = "required" : style = "{ color: requiredColor }" > { { item . value . required ? '*' : '' } } < / text >
< text class = "required" : style = "{ color: requiredColor }" > { { item . value . required ? '*' : '' } } < / text >
< text class = "tit" > { { item . value . title } } < / text >
< / view >
< / view >
< view : class = "['box', 'check-group-box', 'align-left', 'option-layout-' + (item.value.option_layout || 'wrap ')]" >
< view : class = "['box', 'check-group-box', 'align-left', 'option-layout-' + (item.value.option_layout || 'vertical ')]" >
< checkbox-group @change ="checkboxChange($event, index)" :style = "item._optionLayoutStyle" >
< checkbox-group @change ="checkboxChange($event, index)" :style = "item._optionLayoutStyle" >
< label v-for = "(v, k) in item.option_lists" :key="k" >
< label v-for = "(v, k) in item.option_lists" :key="k" >
< checkbox :value = "v.value" :checked = "v.checked" > < / checkbox >
< checkbox :value = "v.value" :checked = "v.checked" > < / checkbox >
< view class = "checkbox" >
< view class = "checkbox" >
< text
< text
: class = "[
: class = "[
'iconfont',
'iconfont',
!v. checked ? 'icon-fuxuankuang2' : ' ',
' check-icon ',
v.checked ? 'icon-fuxuankuang1 ' : ''
! v.checked ? 'icon-fuxuankuang2 ' : '',
]"
v.checked ? 'icon-fuxuankuang1' : ''
: style = "{ color: v.checked ? checkedColor : '' } "
] "
> < / text >
: style = "{ color: v.checked ? checkedColor : '' }"
> < / text >
{ { v . value } }
{ { v . value } }
< / view >
< / view >
< / label >
< / label >
@@ -95,22 +96,23 @@
< view v-if = "item.controller == 'Radio'" class="order-wrap" :class="rowWrapClass" :style="rowWrapStyle" >
< view v-if = "item.controller == 'Radio'" class="order-wrap" :class="rowWrapClass" :style="rowWrapStyle" >
< view : class = "['order-cell', { 'vertical-layout': mode === 'vertical' }]" >
< view : class = "['order-cell', { 'vertical-layout': mode === 'vertical' }]" >
< view class = "name" :style = "item._labelStyle" >
< view class = "name" :style = "item._labelStyle" >
< text class = "tit" > { { item . value . title } } < / text >
< text class = "required" : style = "{ color: requiredColor }" > { { item . value . required ? '*' : '' } } < / text >
< text class = "required" : style = "{ color: requiredColor }" > { { item . value . required ? '*' : '' } } < / text >
< text class = "tit" > { { item . value . title } } < / text >
< / view >
< / view >
< view : class = "['box', 'radio-group-box', 'align-left', 'option-layout-' + (item.value.option_layout || 'wrap ')]" >
< view : class = "['box', 'radio-group-box', 'align-left', 'option-layout-' + (item.value.option_layout || 'vertical ')]" >
< radio-group @change ="radioChange($event, index)" :style = "item._optionLayoutStyle" >
< radio-group @change ="radioChange($event, index)" :style = "item._optionLayoutStyle" >
< label v-for = "(v, k) in item.option_lists" :key="k" >
< label v-for = "(v, k) in item.option_lists" :key="k" >
< radio :value = "v.value" : checked = "item.val == v.value" > < / radio >
< radio :value = "v.value" : checked = "item.val == v.value" > < / radio >
< view class = "radio-box" >
< view class = "radio-box" >
< text
< text
: class = "[
: class = "[
'iconfont',
'iconfont',
item.val != v.value ? 'icon-yuan_checkbox' : ' ',
'radio-icon ',
item.val = = v.value ? 'icon-yuan_checked ' : ''
item.val ! = v.value ? 'icon-yuan_checkbox ' : '',
]"
item.val == v.value ? 'icon-yuan_checked' : ''
: style = "{ color: item.val == v.value ? checkedColor : '' } "
] "
> < / text >
: style = "{ color: item.val == v.value ? checkedColor : '' }"
> < / text >
{ { v . value } }
{ { v . value } }
< / view >
< / view >
< / label >
< / label >
@@ -123,8 +125,8 @@
< view v-if = "item.controller == 'Img'" class="order-wrap" :class="rowWrapClass" :style="rowWrapStyle" >
< view v-if = "item.controller == 'Img'" class="order-wrap" :class="rowWrapClass" :style="rowWrapStyle" >
< view : class = "['order-cell', 'flex-box', { 'vertical-layout': mode === 'vertical' }]" >
< view : class = "['order-cell', 'flex-box', { 'vertical-layout': mode === 'vertical' }]" >
< view class = "name" :style = "item._labelStyle" >
< view class = "name" :style = "item._labelStyle" >
< text class = "tit" > { { item . value . title } } < / text >
< text class = "required" : style = "{ color: requiredColor }" > { { item . value . required ? '*' : '' } } < / text >
< text class = "required" : style = "{ color: requiredColor }" > { { item . value . required ? '*' : '' } } < / text >
< text class = "tit" > { { item . value . title } } < / text >
< / view >
< / view >
< view : class = "['box', 'img-boxs', 'align-left']" :style = "item._boxAlignStyle" >
< view : class = "['box', 'img-boxs', 'align-left']" :style = "item._boxAlignStyle" >
< view v-for = "(v, k) in item.img_lists" :key="k" class="img-box" @tap="uploadImg(index)" >
< view v-for = "(v, k) in item.img_lists" :key="k" class="img-box" @tap="uploadImg(index)" >
@@ -142,8 +144,8 @@
< view v-if = "item.controller == 'Date'" class="order-wrap" :class="rowWrapClass" :style="rowWrapStyle" >
< view v-if = "item.controller == 'Date'" class="order-wrap" :class="rowWrapClass" :style="rowWrapStyle" >
< view : class = "['order-cell', { 'vertical-layout': mode === 'vertical' }]" >
< view : class = "['order-cell', { 'vertical-layout': mode === 'vertical' }]" >
< view class = "name" :style = "item._labelStyle" >
< view class = "name" :style = "item._labelStyle" >
< text class = "tit" > { { item . value . title } } < / text >
< text class = "required" : style = "{ color: requiredColor }" > { { item . value . required ? '*' : '' } } < / text >
< text class = "required" : style = "{ color: requiredColor }" > { { item . value . required ? '*' : '' } } < / text >
< text class = "tit" > { { item . value . title } } < / text >
< / view >
< / view >
< view : class = "['box', 'box-flex', 'align-right']" >
< view : class = "['box', 'box-flex', 'align-right']" >
< picker
< picker
@@ -164,8 +166,8 @@
< view v-if = "item.controller == 'Datelimit'" class="order-wrap" :class="rowWrapClass" :style="rowWrapStyle" >
< view v-if = "item.controller == 'Datelimit'" class="order-wrap" :class="rowWrapClass" :style="rowWrapStyle" >
< view : class = "['order-cell', 'flex-box', { 'vertical-layout': mode === 'vertical' }]" >
< view : class = "['order-cell', 'flex-box', { 'vertical-layout': mode === 'vertical' }]" >
< view class = "name" :style = "item._labelStyle" >
< view class = "name" :style = "item._labelStyle" >
< text class = "tit" > { { item . value . title } } < / text >
< text class = "required" : style = "{ color: requiredColor }" > { { item . value . required ? '*' : '' } } < / text >
< text class = "required" : style = "{ color: requiredColor }" > { { item . value . required ? '*' : '' } } < / text >
< text class = "tit" > { { item . value . title } } < / text >
< / view >
< / view >
< view : class = "['box', 'date-boxs', 'align-center']" :style = "item._boxAlignStyle" >
< view : class = "['box', 'date-boxs', 'align-center']" :style = "item._boxAlignStyle" >
< view class = "date-box" >
< view class = "date-box" >
@@ -203,8 +205,8 @@
< view v-if = "item.controller == 'Time'" class="order-wrap" :class="rowWrapClass" :style="rowWrapStyle" >
< view v-if = "item.controller == 'Time'" class="order-wrap" :class="rowWrapClass" :style="rowWrapStyle" >
< view : class = "['order-cell', { 'vertical-layout': mode === 'vertical' }]" >
< view : class = "['order-cell', { 'vertical-layout': mode === 'vertical' }]" >
< view class = "name" :style = "item._labelStyle" >
< view class = "name" :style = "item._labelStyle" >
< text class = "tit" > { { item . value . title } } < / text >
< text class = "required" : style = "{ color: requiredColor }" > { { item . value . required ? '*' : '' } } < / text >
< text class = "required" : style = "{ color: requiredColor }" > { { item . value . required ? '*' : '' } } < / text >
< text class = "tit" > { { item . value . title } } < / text >
< / view >
< / view >
< view : class = "['box', 'box-flex', 'align-right']" >
< view : class = "['box', 'box-flex', 'align-right']" >
< picker
< picker
@@ -225,8 +227,8 @@
< view v-if = "item.controller == 'Timelimit'" class="order-wrap" :class="rowWrapClass" :style="rowWrapStyle" >
< view v-if = "item.controller == 'Timelimit'" class="order-wrap" :class="rowWrapClass" :style="rowWrapStyle" >
< view : class = "['order-cell', 'flex-box', { 'vertical-layout': mode === 'vertical' }]" >
< view : class = "['order-cell', 'flex-box', { 'vertical-layout': mode === 'vertical' }]" >
< view class = "name" :style = "item._labelStyle" >
< view class = "name" :style = "item._labelStyle" >
< text class = "tit" > { { item . value . title } } < / text >
< text class = "required" : style = "{ color: requiredColor }" > { { item . value . required ? '*' : '' } } < / text >
< text class = "required" : style = "{ color: requiredColor }" > { { item . value . required ? '*' : '' } } < / text >
< text class = "tit" > { { item . value . title } } < / text >
< / view >
< / view >
< view : class = "['box', 'date-boxs', 'align-center']" :style = "item._boxAlignStyle" >
< view : class = "['box', 'date-boxs', 'align-center']" :style = "item._boxAlignStyle" >
< view class = "date-box" >
< view class = "date-box" >
@@ -264,8 +266,8 @@
< view v-if = "item.controller == 'City'" class="order-wrap" :class="rowWrapClass" :style="rowWrapStyle" >
< view v-if = "item.controller == 'City'" class="order-wrap" :class="rowWrapClass" :style="rowWrapStyle" >
< view : class = "['order-cell', { 'vertical-layout': mode === 'vertical' }]" >
< view : class = "['order-cell', { 'vertical-layout': mode === 'vertical' }]" >
< view class = "name" :style = "item._labelStyle" >
< view class = "name" :style = "item._labelStyle" >
< text class = "tit" > { { item . value . title } } < / text >
< text class = "required" : style = "{ color: requiredColor }" > { { item . value . required ? '*' : '' } } < / text >
< text class = "required" : style = "{ color: requiredColor }" > { { item . value . required ? '*' : '' } } < / text >
< text class = "tit" > { { item . value . title } } < / text >
< / view >
< / view >
< view : class = "['box', 'box-flex', 'align-right']" >
< view : class = "['box', 'box-flex', 'align-right']" >
< pick-regions
< pick-regions
@@ -302,7 +304,7 @@ export default {
} ,
} ,
mode : {
mode : {
type : String ,
type : String ,
default : 'horizont al' ,
default : 'vertic al' ,
validator : ( value ) => ! value || [ 'horizontal' , 'vertical' ] . includes ( value )
validator : ( value ) => ! value || [ 'horizontal' , 'vertical' ] . includes ( value )
} ,
} ,
// 表单配置(按平台差异化)
// 表单配置(按平台差异化)
@@ -362,40 +364,40 @@ export default {
config ( ) {
config ( ) {
// 内置默认值(最低优先级)- 与后端 D:\projects\shop-projects\backend\src\app\component\view\form\js\design.js getDefaultFormData().formConfig 对齐
// 内置默认值(最低优先级)- 与后端 D:\projects\shop-projects\backend\src\app\component\view\form\js\design.js getDefaultFormData().formConfig 对齐
const defaults = {
const defaults = {
formPaddingX : 14 ,
formPaddingX : 28 ,
bannerPaddingX : 0 ,
bannerPaddingX : 0 ,
tipPaddingX : 14 ,
tipPaddingX : 28 ,
rowPaddingY : 4 ,
rowPaddingY : 2 4,
rowMinHeight : 60 ,
rowMinHeight : 60 ,
labelGap : 16 ,
labelGap : 20 ,
formBgColor : '#ffffff' ,
formBgColor : '#ffffff' ,
rowDividerColor : '#f0f0f0' ,
rowDividerColor : '#f0f0f0' ,
showRowDivider : tru e,
showRowDivider : fals e,
inputHeight : 60 ,
inputHeight : 84 ,
inputRadius : 10 ,
inputRadius : 16 ,
labelWidthMode : 'auto' ,
labelWidthMode : 'auto' ,
labelFixedWidth : 180 ,
labelFixedWidth : 180 ,
labelFontSize : 28 ,
labelFontSize : 3 2,
labelColor : '#1f2937' ,
labelColor : '#1f2937' ,
labelFontWeight : 6 00,
labelFontWeight : 7 00,
labelAutoMaxWidth : 200 , // auto 模式下 label 宽度上限( rpx) , 超过后 ellipsis 截断
labelAutoMaxWidth : 200 , // auto 模式下 label 宽度上限( rpx) , 超过后 ellipsis 截断
requiredColor : '#ef4444' ,
requiredColor : '#ef4444' ,
checkedColor : '#ff4544 ' ,
checkedColor : '#3b82f6 ' ,
placeholderColor : '#ddd ' ,
placeholderColor : '#9ca3af ' ,
placeholderFontSize : 28 ,
placeholderFontSize : 28 ,
// textarea 显示行数 / 行高(与 ns-form 保持一致,由 formConfig 覆盖)
// textarea 显示行数 / 行高(与 ns-form 保持一致,由 formConfig 覆盖)
// 改用 :rows + line-height 驱动高度, rows 给原生 <textarea>, line-height 在 textareaStyle 算 px 高度
// 改用 :rows + line-height 驱动高度, rows 给原生 <textarea>, line-height 在 textareaStyle 算 px 高度
textareaRows : 4 ,
textareaRows : 4 ,
textareaLineHeight : 44 ,
textareaLineHeight : 48 ,
// 输入框视觉增强(可由后端 form_config 覆盖)
// 输入框视觉增强(可由后端 form_config 覆盖)
inputBorderColor : '#e5e7eb' ,
inputBorderColor : '#e5e7eb' ,
inputBgColor : '#f9fafb ' ,
inputBgColor : '#ffffff ' ,
inputFocusBorderColor : '#ff4544 ' ,
inputFocusBorderColor : '#3b82f6 ' ,
inputFocusBgColor : '#ffffff' ,
inputFocusBgColor : '#ffffff' ,
labelFontWeight : 6 00,
labelFontWeight : 7 00,
// 提交按钮
// 提交按钮
submitColor : '#ffffff' ,
submitColor : '#ffffff' ,
submitBgColor : '#ff4544 ' ,
submitBgColor : '#3b82f6 ' ,
submitMarginTop : 0 , // 提交按钮顶部外边距( rpx) : 调整表单与按钮之间的距离
submitMarginTop : 0 , // 提交按钮顶部外边距( rpx) : 调整表单与按钮之间的距离
// 提示语
// 提示语
tipFontSize : 32 ,
tipFontSize : 32 ,
@@ -588,22 +590,23 @@ export default {
const align = itemValue . input _align ;
const align = itemValue . input _align ;
this . $set ( item , '_boxAlignStyle' , align ? { 'text-align' : align } : { } ) ;
this . $set ( item , '_boxAlignStyle' , align ? { 'text-align' : align } : { } ) ;
// 选项排列样式: vertical 时给 checkbox-group / radio-group 加 flex-direction
// 选项排列样式:默认 vertical(每项一行),仅当后端显式配置 wrap 时横向换行
// 走 inline style( 不依赖 dev 编译产物的 SCSS 类,跨端兼容更稳)
// 走 inline style( 不依赖 dev 编译产物的 SCSS 类,跨端兼容更稳)
// 直接写 flex-direction 等 CSS 属性, inline style 优先级最高
// 直接写 flex-direction 等 CSS 属性, inline style 优先级最高
const optLayout = itemValue . option _layout ;
const optLayout = itemValue . option _layout ;
const optStyle = { } ;
const optStyle = { } ;
if ( optLayout === 'vertical ' ) {
if ( optLayout === 'wrap ' ) {
optStyle [ 'flex-direction' ] = 'column' ;
// wrap 模式:横向自动换行
optStyle [ 'align-items ' ] = 'flex-start ' ;
optStyle [ 'flex-direction ' ] = 'row ' ;
optStyle [ 'gap ' ] = '8px ' ;
optStyle [ 'align-items ' ] = 'center ' ;
} else {
optStyle [ 'gap' ] = '12rpx' ;
// wrap 模式:用 display: flex 基础属性兜底(不强制,让浏览器按 SCSS 默认渲染)
} else {
optStyle [ 'flex-direction' ] = 'row' ;
// vertical 模式(默认):每项独立一行
optStyle [ 'align-items ' ] = 'center ' ;
optStyle [ 'flex-direction ' ] = 'column ' ;
optStyle [ 'gap ' ] = '6px ' ;
optStyle [ 'align-items ' ] = 'flex-start ' ;
}
optStyle [ 'gap' ] = '20rpx' ;
this . $set ( item , '_optionLayoutStyle' , optStyle ) ;
}
this . $set ( item , '_optionLayoutStyle' , optStyle ) ;
} ) ;
} ) ;
} ,
} ,
// 容器样式(提供给外部 diy-form 使用)
// 容器样式(提供给外部 diy-form 使用)
@@ -1012,38 +1015,38 @@ export default {
. form - wrap {
. form - wrap {
background : # fff ;
background : # fff ;
/* 默认值兜底:与 ns-newform.config 默认值一致 */
/* 默认值兜底:与 ns-newform.config 默认值一致 */
-- form - padding - x : 14 rpx ;
-- form - padding - x : 28 rpx ;
-- banner - padding - x : 0 rpx ;
-- banner - padding - x : 0 rpx ;
-- tip - padding - x : 14 rpx ;
-- tip - padding - x : 28 rpx ;
-- tip - font - size : 24 rpx ;
-- tip - font - size : 3 2rpx ;
-- tip - color : # 666666 ;
-- tip - color : # 666666 ;
-- tip - bg - color : # ffffff ;
-- tip - bg - color : # ffffff ;
-- row - padding - y : 4 rpx ;
-- row - padding - y : 2 4rpx ;
-- row - min - height : 60 rpx ;
-- row - min - height : 60 rpx ;
-- label - gap : 16 rpx ;
-- label - gap : 20 rpx ;
-- form - bg - color : # ffffff ;
-- form - bg - color : # ffffff ;
-- row - divider - color : # f0f0f0 ;
-- row - divider - color : # f0f0f0 ;
-- input - height : 60 rpx ;
-- input - height : 84 rpx ;
-- input - radius : 10 rpx ;
-- input - radius : 16 rpx ;
-- label - fixed - width : 180 rpx ;
-- label - fixed - width : 180 rpx ;
-- label - font - size : 28 rpx ;
-- label - font - size : 3 2rpx ;
-- label - color : # 1 f2937 ;
-- label - color : # 1 f2937 ;
-- required - color : # ef4444 ;
-- required - color : # ef4444 ;
-- checked - color : # ff4544 ;
-- checked - color : # 3 b82f6 ;
-- submit - color : # ffffff ;
-- submit - color : # ffffff ;
-- submit - bg - color : # ff4544 ;
-- submit - bg - color : # 3 b82f6 ;
-- placeholder - color : # ddd ;
-- placeholder - color : # 9 ca3af ;
-- placeholder - font - size : 28 rpx ;
-- placeholder - font - size : 28 rpx ;
// textarea 行数 / 行高(运行时被 formWrapStyle 注入的 inline 覆盖;这里是兜底)
// textarea 行数 / 行高(运行时被 formWrapStyle 注入的 inline 覆盖;这里是兜底)
-- textarea - rows : 4 ;
-- textarea - rows : 4 ;
-- textarea - line - height : 44 rpx ;
-- textarea - line - height : 48 rpx ;
// 输入框视觉增强(边框 / 背景 / 聚焦 / label 字重)
// 输入框视觉增强(边框 / 背景 / 聚焦 / label 字重)
-- input - border - color : # e5e7eb ;
-- input - border - color : # e5e7eb ;
-- input - bg - color : # f9fafb ;
-- input - bg - color : # ffffff ;
-- input - focus - border - color : # ff4544 ;
-- input - focus - border - color : # 3 b82f6 ;
-- input - focus - bg - color : # ffffff ;
-- input - focus - bg - color : # ffffff ;
-- label - font - weight : 6 00;
-- label - font - weight : 7 00;
-- show - row - divider : 1 ;
-- show - row - divider : 0 ;
// 与后端 form-preview-wrap.no-divider-all 对齐:整组隐藏所有行分割线
// 与后端 form-preview-wrap.no-divider-all 对齐:整组隐藏所有行分割线
& . no - divider - all {
& . no - divider - all {
@@ -1097,7 +1100,8 @@ export default {
. name {
. name {
width : 100 % ;
width : 100 % ;
marg in - bottom : var ( -- label - gap , 16 rpx ) ;
min - height : auto ;
margin - bottom : var ( -- label - gap , 20 rpx ) ;
margin - right : 0 ;
margin - right : 0 ;
}
}
@@ -1161,7 +1165,7 @@ export default {
. required {
. required {
color : var ( -- required - color , # ef4444 ) ;
color : var ( -- required - color , # ef4444 ) ;
font - size : var ( -- item - label - font - size , var ( -- label - font - size , 28 rpx ) ) ;
font - size : var ( -- item - label - font - size , var ( -- label - font - size , 28 rpx ) ) ;
margin - lef t: 4 rpx ;
margin - righ t: 6 rpx ;
font - weight : bold ;
font - weight : bold ;
display : inline - block ;
display : inline - block ;
vertical - align : middle ;
vertical - align : middle ;
@@ -1223,12 +1227,12 @@ export default {
: : v - deep input {
: : v - deep input {
font - size : var ( -- label - font - size , 28 rpx ) ;
font - size : var ( -- label - font - size , 28 rpx ) ;
text - align : left ;
text - align : left ;
height : var ( -- input - height , 60 rpx ) ;
height : var ( -- input - height , 84 rpx ) ;
border : 1 rpx solid var ( -- input - border - color , # e5e7eb ) ;
border : 1 rpx solid var ( -- input - border - color , # e5e7eb ) ;
border - radius : var ( -- input - radius , 10 rpx ) ;
border - radius : var ( -- input - radius , 16 rpx ) ;
line - height : var ( -- input - height , 60 rpx ) ;
line - height : calc ( var ( -- input - height , 84 rpx ) - 2 rpx ) ;
padding : 0 1 2rpx ;
padding : 0 24 rpx ;
background : var ( -- input - bg - color , # f9fafb ) ;
background : var ( -- input - bg - color , # ffffff ) ;
color : var ( -- label - color , # 1 f2937 ) ;
color : var ( -- label - color , # 1 f2937 ) ;
transition : all 0.3 s ease ;
transition : all 0.3 s ease ;
width : 100 % ;
width : 100 % ;
@@ -1236,11 +1240,11 @@ export default {
& : focus {
& : focus {
background : var ( -- input - focus - bg - color , # ffffff ) ;
background : var ( -- input - focus - bg - color , # ffffff ) ;
border - color : var ( -- input - focus - border - color , # ff4544 ) ;
border - color : var ( -- input - focus - border - color , # 3 b82f6 ) ;
}
}
& : : placeholder {
& : : placeholder {
color : var ( -- placeholder - color , # ddd ) ;
color : var ( -- placeholder - color , # 9 ca3af ) ;
font - size : var ( -- placeholder - font - size , 28 rpx ) ;
font - size : var ( -- placeholder - font - size , 28 rpx ) ;
}
}
}
}
@@ -1249,12 +1253,12 @@ export default {
input {
input {
font - size : var ( -- label - font - size , 28 rpx ) ;
font - size : var ( -- label - font - size , 28 rpx ) ;
text - align : left ;
text - align : left ;
height : var ( -- input - height , 60 rpx ) ;
height : var ( -- input - height , 84 rpx ) ;
border : 1 rpx solid var ( -- input - border - color , # e5e7eb ) ;
border : 1 rpx solid var ( -- input - border - color , # e5e7eb ) ;
border - radius : var ( -- input - radius , 10 rpx ) ;
border - radius : var ( -- input - radius , 16 rpx ) ;
line - height : var ( -- input - height , 60 rpx ) ;
line - height : calc ( var ( -- input - height , 84 rpx ) - 2 rpx ) ;
padding : 0 1 2rpx ;
padding : 0 24 rpx ;
background : var ( -- input - bg - color , # f9fafb ) ;
background : var ( -- input - bg - color , # ffffff ) ;
color : var ( -- label - color , # 1 f2937 ) ;
color : var ( -- label - color , # 1 f2937 ) ;
transition : all 0.3 s ease ;
transition : all 0.3 s ease ;
width : 100 % ;
width : 100 % ;
@@ -1262,65 +1266,68 @@ export default {
& : focus {
& : focus {
background : var ( -- input - focus - bg - color , # ffffff ) ;
background : var ( -- input - focus - bg - color , # ffffff ) ;
border - color : var ( -- input - focus - border - color , # ff4544 ) ;
border - color : var ( -- input - focus - border - color , # 3 b82f6 ) ;
}
}
& : : placeholder {
& : : placeholder {
color : var ( -- placeholder - color , # ddd ) ;
color : var ( -- placeholder - color , # 9 ca3af ) ;
font - size : var ( -- placeholder - font - size , 28 rpx ) ;
font - size : var ( -- placeholder - font - size , 28 rpx ) ;
}
}
}
}
// H5 端 <textarea> 被 uni-app 编译为 <uni-textarea> 自定义组件,
// 真实 <textarea> 是其子节点,需要 ::v-deep 穿透 scoped 才能命中
: : v - deep textarea {
: : v - deep textarea {
font - size : var ( -- label - font - size , 28 rpx ) ;
font - size : var ( -- label - font - size , 28 rpx ) ;
width : 100 % ;
width : 100 % ;
// 行高 / 高度全部由 formConfig 动态决定( CSS 兜底公式与 JS textareaStyle 一致)
// 行高 / 高度全部由 formConfig 动态决定( CSS 兜底公式与 JS textareaStyle 一致)
line - height : var ( -- textarea - line - height , 44 rpx ) ;
line - height : var ( -- textarea - line - height , 48 rpx ) ;
min - height : calc ( var ( -- textarea - rows , 4 ) * var ( -- textarea - line - height , 44 rpx ) + 26 rpx ) ;
min - height : calc ( var ( -- textarea - rows , 4 ) * var ( -- textarea - line - height , 48 rpx ) + 26 rpx ) ;
height : calc ( var ( -- textarea - rows , 4 ) * var ( -- textarea - line - height , 44 rpx ) + 26 rpx ) ;
height : calc ( var ( -- textarea - rows , 4 ) * var ( -- textarea - line - height , 48 rpx ) + 26 rpx ) ;
text - align : left ;
text - align : left ;
border : 1 rpx solid var ( -- input - border - color , # e5e7eb ) ;
border : 1 rpx solid var ( -- input - border - color , # e5e7eb ) ;
border - radius : var ( -- input - radius , 10 rpx ) ;
border - radius : var ( -- input - radius , 16 rpx ) ;
padding : 12 rpx ;
padding : 12 rpx 24 rpx ;
background : var ( -- input - bg - color , # f9fafb ) ;
background : var ( -- input - bg - color , # ffffff ) ;
color : var ( -- label - color , # 1 f2937 ) ;
color : var ( -- label - color , # 1 f2937 ) ;
transition : all 0.3 s ease ;
transition : all 0.3 s ease ;
box - sizing : border - box ;
box - sizing : border - box ;
& : focus {
& : focus {
background : var ( -- input - focus - bg - color , # ffffff ) ;
background : var ( -- input - focus - bg - color , # ffffff ) ;
border - color : var ( -- input - focus - border - color , # ff4544 ) ;
border - color : var ( -- input - focus - border - color , # 3 b82f6 ) ;
}
}
& : : placeholder {
& : : placeholder {
color : var ( -- placeholder - color , # ddd ) ;
color : var ( -- placeholder - color , # 9 ca3af ) ;
font - size : var ( -- placeholder - font - size , 28 rpx ) ;
font - size : var ( -- placeholder - font - size , 28 rpx ) ;
}
}
}
}
// 非 H5 端(小程序 / 鸿蒙 / App) <textarea> 是直接原生元素,普通选择器即可
textarea {
textarea {
font - size : var ( -- label - font - size , 28 rpx ) ;
font - size : var ( -- label - font - size , 28 rpx ) ;
width : 100 % ;
width : 100 % ;
// 行高 / 高度全部由 formConfig 动态决定(与 ::v-deep textarea 同步)
// 行高 / 高度全部由 formConfig 动态决定(与 ::v-deep textarea 同步)
line - height : var ( -- textarea - line - height , 44 rpx ) ;
line - height : var ( -- textarea - line - height , 48 rpx ) ;
min - height : calc ( var ( -- textarea - rows , 4 ) * var ( -- textarea - line - height , 44 rpx ) + 26 rpx ) ;
min - height : calc ( var ( -- textarea - rows , 4 ) * var ( -- textarea - line - height , 48 rpx ) + 26 rpx ) ;
height : calc ( var ( -- textarea - rows , 4 ) * var ( -- textarea - line - height , 44 rpx ) + 26 rpx ) ;
height : calc ( var ( -- textarea - rows , 4 ) * var ( -- textarea - line - height , 48 rpx ) + 26 rpx ) ;
text - align : left ;
text - align : left ;
border : 1 rpx solid var ( -- input - border - color , # e5e7eb ) ;
border : 1 rpx solid var ( -- input - border - color , # e5e7eb ) ;
border - radius : var ( -- input - radius , 10 rpx ) ;
border - radius : var ( -- input - radius , 16 rpx ) ;
padding : 12 rpx ;
padding : 12 rpx 24 rpx ;
background : var ( -- input - bg - color , # f9fafb ) ;
background : var ( -- input - bg - color , # ffffff ) ;
color : var ( -- label - color , # 1 f2937 ) ;
color : var ( -- label - color , # 1 f2937 ) ;
transition : all 0.3 s ease ;
transition : all 0.3 s ease ;
box - sizing : border - box ;
box - sizing : border - box ;
& : focus {
& : focus {
background : var ( -- input - focus - bg - color , # ffffff ) ;
background : var ( -- input - focus - bg - color , # ffffff ) ;
border - color : var ( -- input - focus - border - color , # ff4544 ) ;
border - color : var ( -- input - focus - border - color , # 3 b82f6 ) ;
}
}
& : : placeholder {
& : : placeholder {
color : var ( -- placeholder - color , # ddd ) ;
color : var ( -- placeholder - color , # 9 ca3af ) ;
font - size : var ( -- placeholder - font - size , 28 rpx ) ;
font - size : var ( -- placeholder - font - size , 28 rpx ) ;
}
}
}
}
@@ -1328,22 +1335,22 @@ export default {
. uni - input , . select - address {
. uni - input , . select - address {
display : inline - block ;
display : inline - block ;
padding : 0 ;
padding : 0 ;
border - radius : var ( -- input - radius , 10 rpx ) ;
border - radius : var ( -- input - radius , 16 rpx ) ;
background : transparent ;
background : transparent ;
border : none ;
border : none ;
color : var ( -- label - color , # 1 f2937 ) ;
color : var ( -- label - color , # 1 f2937 ) ;
font - size : var ( -- label - font - size , 28 rpx ) ;
font - size : var ( -- label - font - size , 28 rpx ) ;
transition : all 0.3 s ease ;
transition : all 0.3 s ease ;
min - height : var ( -- input - height , 60 rpx ) ;
min - height : var ( -- input - height , 84 rpx ) ;
box - sizing : border - box ;
box - sizing : border - box ;
line - height : var ( -- input - height , 60 rpx ) ;
line - height : var ( -- input - height , 84 rpx ) ;
& . color - tip {
& . color - tip {
color : var ( -- placeholder - color , # ddd ) ;
color : var ( -- placeholder - color , # 9 ca3af ) ;
}
}
& . empty {
& . empty {
color : var ( -- placeholder - color , # ddd ) ;
color : var ( -- placeholder - color , # 9 ca3af ) ;
}
}
}
}
@@ -1381,13 +1388,19 @@ export default {
}
}
}
}
// 选项排列样式: vertical = 每个选项独立一行; wrap(默认) = 横向自动换行
// 选项排列样式: vertical = 每个选项独立一行; wrap = 横向自动换行
. option - layout - vertical {
. option - layout - vertical {
checkbox - group ,
checkbox - group ,
radio - group {
radio - group {
flex - direction : column ;
flex - direction : column ;
align - items : flex - start ;
align - items : flex - start ;
gap : 16 rpx ;
width : 100 % ;
label {
width : 100 % ;
justify - content : flex - start ;
padding : 12 rpx 0 ;
}
}
}
}
}
@@ -1416,7 +1429,14 @@ export default {
. radio - box {
. radio - box {
display : inline - flex ;
display : inline - flex ;
align - items : center ;
align - items : center ;
gap : 8 rpx ;
gap : 12 rpx ;
}
. check - icon ,
. radio - icon {
font - size : 40 rpx ;
line - height : 1 ;
color : # d1d5db ;
}
}
& . img - boxs {
& . img - boxs {
@@ -1509,7 +1529,7 @@ export default {
< style lang = "scss" scoped >
< style lang = "scss" scoped >
. placeholder {
. placeholder {
color : # 909399 ;
color : # 9ca3af ;
font - size : 28 rpx ;
font - size : 28 rpx ;
// #ifdef H5
// #ifdef H5
@@ -1518,6 +1538,6 @@ export default {
}
}
. color - tip {
. color - tip {
color : # 909399 ;
color : # 9ca3af ;
}
}
< / style >
< / style >