动态表单设计
背景
实现动态表单功能,支持表单自定义并实现后期的数据统计、分析。
方案讨论
- 一 、基于非结构化的Json。
- 优点:通过NoSql的mongdb存储可以减少json解析的复杂度及资源损耗,可以提高效率。
- 缺点:非结构化的Json,模板定义和表单数据值存在一起,后期的数据分析非常困难。解决不了非结构化数据分析的根本问题。
{
"item": [
{
"repeats": 0,
"childType": "text",
"itemType": 1,
"updateDate": "1619599422000",
"max": 0,
"prefix": "1",
"readOnly": 0,
"optionRepeats": 0,
"qtId": "584824102494277632",
"sectionId": "584824208362704896",
"type": "string",
"required": 0,
"itemId": "569271103424434176",
"score": 0,
"sequence": 1,
"configRes": {
"childType": "text",
"configContent": "{\"childType\":\"text\",\"max\":0,\"showTypeName\":\"¶àÐÐÎı¾Ìâ\",\"typeName\":\"×Ö·û´®\",\"characterLimit\":\"none\",\"textType\":\"string\",\"type\":\"string\",\"categoryName\":\"ÎÒµÄÌâ¿â\",\"min\":0,\"showType\":\"text\",\"id\":\"569271103424434176\",\"text\":\"ÐÕÃû\",\"categoryId\":\"1371773393070960641\"}",
"textType": "string",
"characterLimit": "none"
},
"linkId": "ab108b9f-86ae-43c7-885c-9eb3de2935e9",
"min": 0,
"showType": "text",
"sectionItemRId": "1387326646303043586",
"id": "1387326646303043586",
"text": "ÐÕÃû",
"createDate": "161959