alibaba / x-render

🚴‍♀️ 阿里 - 很易用的中后台「表单 / 表格 / 图表」解决方案
https://xrender.fun
6.91k stars 980 forks source link

DrawList 支持配置不渲染下层嵌套对象 #1486

Closed chenqien closed 3 months ago

chenqien commented 4 months ago

期望的新功能 (describe the expected new feature)

DrawList 支持配置不渲染下层嵌套对象

简述一下使用场景,便于开发者更好理解新功能的必要性 (describe your scenario for us to understand the need)

如下图以及对应的 schema, 1,2.0 版本中默认渲染了下层的对象,导致配置内容较多时页面极其卡顿。 2,本身 DrawList 样式用于复杂的表单配置,在上层全部渲染,交互也很混乱。

恳请考虑~~ 远不如 1.0 版本中 默认不渲染内嵌对象。

image

{ "type":"object", "title":"质检报告配置类目维度", "properties":{ "zzConfigList":{ "type":"array", "title":"配置信息", "required":true, "rules":[ { "required":true, "message":"必填" } ], "widget":"drawerList", "items":{ "type":"object", "widget":"lineTitle", "properties":{ "cateId":{ "type":"string",

            "title":"末级类目ID",
            "required":true,
            "width":"50%",
            "rules":[
              {
                "message":"长度超限,请确认",
                "max":11
              },
              {
                "message":"只允许填写数字",
                "pattern":"^[0-9]+$"
              },
              {
                "required":true,
                "message":"[末级类目ID]必填"
              }
            ],
            "default":""
          },
          "configs":{
            "type":"array",
            "title":"二级项",
            "required":false,
            "widget":"drawerList",
            "items":{
              "widget":"lineTitle",
              "type":"object",
              "properties":{
                "firstId":{
                  "type":"string",

                  "title":"一级质检项ID",
                  "required":true,
                  "width":"50%",
                  "rules":[
                    {
                      "message":"长度超限,请确认",
                      "max":11
                    },
                    {
                      "message":"只允许填写数字",
                      "pattern":"^[0-9]+$"
                    },
                    {
                      "required":true,
                      "message":"[一级质检项ID]必填"
                    }
                  ],
                  "default":""
                },

              }
            }
          }
        }
      }
    }
  },
  "displayType":"row"
}
lhbxs commented 4 months ago

你这个渲染好像不对,我用你的 schema 复现不了

lhbxs commented 4 months ago
截屏2024-02-28 上午11 06 07
lhbxs commented 4 months ago

你当前按照的 form-render是什么版本?

chenqien commented 4 months ago

@lhbxs 最新版本:2.4.2

可能我没把问题说清楚....

期望的是: 1,在以下页面正常填写嵌套的数据,并点击确定之后,

企业微信截图_ada5c18b-72aa-499c-94cc-19ff35e6c73b

2,在上层不渲染下一层的对象类型的数据,例如下图的红色框部分,不展示内容 以一个横杆“-”代替,在 1.X 版本中是这样的

企业微信截图_df3de50c-4d5f-4770-b732-e64ddacb9bdd
lhbxs commented 3 months ago

大概懂你的意思了。我给列增加了一个 columnHidden 属性配置,配置之后就不会在表格里面显示

lhbxs commented 3 months ago

1505