修改更新欠费状态功能
This commit is contained in:
@@ -159,7 +159,9 @@ const props = defineProps({
|
||||
// schema 项配置
|
||||
item: { type: Object, required: true },
|
||||
// 字典映射表(来自父级 BasicForm)
|
||||
dictMap: { type: Object, default: () => ({}) }
|
||||
dictMap: { type: Object, default: () => ({}) },
|
||||
// 拉伸模式(固定每行 N 项的栅格布局):忽略 item.width,控件填满单元格
|
||||
stretch: { type: Boolean, default: false }
|
||||
})
|
||||
|
||||
const comp = computed(() => props.item.component || 'input')
|
||||
@@ -167,8 +169,11 @@ const placeholder = computed(() => props.item.placeholder)
|
||||
const valueKey = computed(() => props.item.valueKey || 'value')
|
||||
const labelKey = computed(() => props.item.labelKey || 'label')
|
||||
|
||||
// 控件宽度样式
|
||||
const controlStyle = computed(() => (props.item.width ? { width: props.item.width } : null))
|
||||
// 控件宽度样式(stretch 模式下填满单元格)
|
||||
const controlStyle = computed(() => {
|
||||
if (props.stretch) return { width: '100%' }
|
||||
return props.item.width ? { width: props.item.width } : null
|
||||
})
|
||||
|
||||
// 选项:静态 options 优先,其次字典
|
||||
const options = computed(() => {
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
:label-position="labelPosition"
|
||||
:disabled="disabled"
|
||||
:size="size"
|
||||
:class="['basic-form', { 'basic-form--grid': !inline }]"
|
||||
:class="['basic-form', { 'basic-form--grid': !inline, 'basic-form--perrow': inline && perRow > 0 }]"
|
||||
>
|
||||
<!-- 行内布局:直接平铺 -->
|
||||
<template v-if="inline">
|
||||
@@ -17,10 +17,11 @@
|
||||
:label="item.label"
|
||||
:prop="item.prop"
|
||||
:label-width="item.labelWidth"
|
||||
:style="perRow > 0 && item.colSpan > 1 ? { gridColumn: 'span ' + item.colSpan } : undefined"
|
||||
v-bind="item.formItemProps"
|
||||
>
|
||||
<slot :name="`form-${item.prop}`" :model="modelValue" :item="item">
|
||||
<form-control :model="modelValue" :item="item" :dict-map="dictMap" />
|
||||
<form-control :model="modelValue" :item="item" :dict-map="dictMap" :stretch="perRow > 0" />
|
||||
</slot>
|
||||
</el-form-item>
|
||||
</template>
|
||||
@@ -81,6 +82,7 @@
|
||||
* valueKey: 'value', // 选项值字段(默认 value)
|
||||
* labelKey: 'label', // 选项标签字段(默认 label)
|
||||
* span: 12, // 栅格占位(grid 布局,默认 24)
|
||||
* colSpan: 2, // 占据的列数(行内 perRow 栅格模式,默认 1)
|
||||
* width: '200px', // 控件宽度
|
||||
* show: true, // 是否显示
|
||||
* disabled: false,
|
||||
@@ -117,6 +119,11 @@ const props = defineProps({
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
// 行内布局下固定每行项数(>0 时启用栅格模式,控件拉伸填满单元格;0 表示自动流式换行)
|
||||
perRow: {
|
||||
type: Number,
|
||||
default: 0
|
||||
},
|
||||
// 标签宽度
|
||||
labelWidth: {
|
||||
type: [String, Number],
|
||||
@@ -239,6 +246,26 @@ defineExpose({
|
||||
margin-bottom: 18px;
|
||||
}
|
||||
|
||||
/* 行内固定每行 N 项:CSS 栅格,多余项自动换行 */
|
||||
.basic-form--perrow {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(v-bind(perRow), minmax(0, 1fr));
|
||||
column-gap: 16px;
|
||||
row-gap: 2px;
|
||||
}
|
||||
.basic-form--perrow :deep(.el-form-item) {
|
||||
display: flex;
|
||||
margin-right: 0;
|
||||
}
|
||||
.basic-form--perrow :deep(.el-form-item__content) {
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
}
|
||||
/* 操作区居中时独占整行 */
|
||||
.basic-form--perrow .basic-form-action--center {
|
||||
grid-column: 1 / -1;
|
||||
}
|
||||
|
||||
/* 操作区居中:占满整行、内容水平居中(搜索按钮换行后居中显示的场景) */
|
||||
.basic-form .basic-form-action--center {
|
||||
width: 100%;
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
:rules="searchRules"
|
||||
:label-width="searchLabelWidth"
|
||||
:action-align="searchActionAlign"
|
||||
:per-row="searchPerRow"
|
||||
:size="size"
|
||||
inline
|
||||
v-show="showSearch"
|
||||
@@ -184,6 +185,11 @@ const props = defineProps({
|
||||
type: String,
|
||||
default: 'left'
|
||||
},
|
||||
// 搜索区固定每行项数(>0 时启用栅格布局,多余项自动换行;0 为流式换行)
|
||||
searchPerRow: {
|
||||
type: Number,
|
||||
default: 0
|
||||
},
|
||||
// 列表加载函数:(params) => Promise<{rows, total}> | {rows, total}
|
||||
query: {
|
||||
type: Function,
|
||||
|
||||
Reference in New Issue
Block a user