@longhongguo/form-create-ant-design-vue 3.2.96 → 3.2.98

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@longhongguo/form-create-ant-design-vue",
3
- "version": "3.2.96",
3
+ "version": "3.2.98",
4
4
  "description": "AntDesignVue版本低代码表单|FormCreate 是一个可以通过 JSON 生成具有动态渲染、数据收集、验证和提交功能的低代码表单生成组件。支持6个UI框架,适配移动端,并且支持生成任何 Vue 组件。内置20种常用表单组件和自定义组件,再复杂的表单都可以轻松搞定。",
5
5
  "main": "./dist/form-create.min.js",
6
6
  "module": "./dist/form-create.esm.js",
@@ -55,7 +55,7 @@
55
55
  "@form-create/core": "^3.2.33",
56
56
  "@form-create/utils": "^3.2.31",
57
57
  "@longhongguo/component-antdv-upload": "^3.2.41",
58
- "@longhongguo/form-create-core": "latest",
58
+ "@longhongguo/form-create-core": "^3.2.56",
59
59
  "moment": "^2.30.1"
60
60
  },
61
61
  "publishConfig": {
@@ -110,24 +110,15 @@ export default {
110
110
  ctx.rule.children = []
111
111
  }
112
112
 
113
- // 读取 childFlex 和 childWidth 配置,用于直接设置到子元素的 style
114
- const childFlex = props.childFlex ?? ctx.rule.childFlex
115
- const isVertical =
116
- flexDirection === 'column' || flexDirection === 'column-reverse'
117
- const childWidth = isVertical
118
- ? props.childWidth ?? ctx.rule.childWidth ?? '100%'
119
- : undefined
120
-
121
113
  // 为 flex 容器的所有子组件设置 col: false,避免被 a-col 包装
122
- // 同时直接给子元素设置 flex 值和宽度(如果是垂直方向)
123
114
  // 这样可以确保子组件直接作为 flex 子项,而不是占满整行
124
115
  if (ctx.rule.children && Array.isArray(ctx.rule.children)) {
125
116
  ctx.rule.children.forEach((child) => {
126
117
  if (
127
118
  child &&
128
119
  typeof child === 'object' &&
129
- child.type !== 'DragTool' &&
130
- child.type !== 'DragBox'
120
+ !child.type === 'DragTool' &&
121
+ !child.type === 'DragBox'
131
122
  ) {
132
123
  // 只有当 col 未设置或为默认值时才设置
133
124
  if (child.col === undefined || child.col === null) {
@@ -139,29 +130,6 @@ export default {
139
130
  ) {
140
131
  child.col.show = false
141
132
  }
142
-
143
- // 确保子元素的 style 对象存在(使用响应式的方式)
144
- if (!child.style) {
145
- child.style = {}
146
- }
147
-
148
- // 如果配置了 childFlex,直接给子元素设置 flex 样式
149
- // 使用 Object.assign 确保样式对象被正确设置
150
- if (
151
- childFlex !== undefined &&
152
- childFlex !== null &&
153
- childFlex !== ''
154
- ) {
155
- const flexValue = String(childFlex).trim()
156
- // 直接设置 flex 属性,确保样式能够生效
157
- Object.assign(child.style, { flex: flexValue })
158
- }
159
-
160
- // 如果是垂直方向且配置了 childWidth,直接给子元素设置 width 样式
161
- if (isVertical && childWidth) {
162
- const widthValue = String(childWidth).trim()
163
- Object.assign(child.style, { width: widthValue })
164
- }
165
133
  }
166
134
  })
167
135
  }
@@ -216,16 +216,8 @@ export default {
216
216
  }
217
217
 
218
218
  // 确保 children 存在(如果没有设置,默认为空数组)
219
- // 重要:始终创建新的数组,确保每个 text 组件都有独立的 children 数组引用
220
- // 这样可以避免多个 text 组件绑定同一个字段时共享同一个数组引用
221
219
  if (!ctx.rule.children) {
222
220
  ctx.rule.children = []
223
- } else if (Array.isArray(ctx.rule.children)) {
224
- // 如果 children 已存在,创建一个新的数组副本,避免多个组件共享同一个数组引用
225
- ctx.rule.children = [...ctx.rule.children]
226
- } else {
227
- // 如果不是数组,转换为数组
228
- ctx.rule.children = [ctx.rule.children]
229
221
  }
230
222
 
231
223
  // 对于动态绑定的情况,初始化时设置一个占位符,确保组件能被渲染