@longhongguo/form-create-ant-design-vue 3.3.7 → 3.3.8

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.3.07",
3
+ "version": "3.3.08",
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",
package/src/core/alias.js CHANGED
@@ -43,6 +43,9 @@ export default {
43
43
  alert: PRE + 'Alert',
44
44
  aAlert: PRE + 'Alert',
45
45
  Alert: PRE + 'Alert',
46
+ card: PRE + 'Card',
47
+ aCard: PRE + 'Card',
48
+ Card: PRE + 'Card',
46
49
  accTable: PRE + 'Table',
47
50
  accTableTable: PRE + 'Table'
48
51
  }
@@ -0,0 +1,38 @@
1
+ export default {
2
+ name: 'aCard',
3
+ mergeProp(ctx) {
4
+ // 确保 children 存在
5
+ if (!ctx.rule.children) {
6
+ ctx.rule.children = []
7
+ }
8
+
9
+ // 为 Card 容器的所有子组件设置 col: false,避免被 a-col 包装
10
+ // 这样子组件可以直接作为 Card 的子元素
11
+ if (ctx.rule.children && Array.isArray(ctx.rule.children)) {
12
+ ctx.rule.children.forEach((child) => {
13
+ if (
14
+ child &&
15
+ typeof child === 'object' &&
16
+ child.type !== 'DragTool' &&
17
+ child.type !== 'DragBox'
18
+ ) {
19
+ // 只有当 col 未设置或为默认值时才设置
20
+ if (child.col === undefined || child.col === null) {
21
+ child.col = false
22
+ } else if (
23
+ child.col &&
24
+ typeof child.col === 'object' &&
25
+ child.col.show !== false
26
+ ) {
27
+ child.col.show = false
28
+ }
29
+ }
30
+ })
31
+ }
32
+ },
33
+ render(children, ctx) {
34
+ // 使用默认渲染,通过 alias 映射到 aCard 组件
35
+ return ctx.$render.defaultRender(ctx, children)
36
+ }
37
+ }
38
+
@@ -18,6 +18,7 @@ import space from './space'
18
18
  import spin from './spin'
19
19
  import div from './div'
20
20
  import alert from './alert'
21
+ import card from './card'
21
22
  import accTable from './accTable'
22
23
 
23
24
  export default [
@@ -41,5 +42,6 @@ export default [
41
42
  spin,
42
43
  div,
43
44
  alert,
45
+ card,
44
46
  accTable
45
47
  ]