The invention discloses a data description method of the front-end interface and a generation method of the front-end interface. The data description method includes multi-level segmentation of the front-end interface to obtain multi-level blocks; according to the order of composition, the description of blocks and components carried in blocks is made in JSON data format to form a tree shaped JSON data group; wherein, the description of components includes type, name Lower level and style. The description of block includes the definition of interface structure and segmentation interface. The definition of segmentation interface includes block length and block height. The generation method of the front-end interface includes storing the data description of the front-end interface on the server side; the client obtains the data description from the server side, analyzes it, and then maps it to the interface label to generate the front-end interface. This data description method can clearly describe the structure of the front-end interface, so that the client can automatically produce the front-end interface and dynamic rendering front-end interface according to the description.
【技术实现步骤摘要】
前端界面的数据描述方法及前端界面的生成方法
本专利技术涉及软件开发领域,具体涉及一种前端界面的数据描述方法,还涉及前端界面的生成方法。
技术介绍
为了满足前端界面的快速开发与后台部署以及界面变更的维护工作,实现由后台管理界面直接管理前端界面,达到实时同步的维护修改前端界面,需要通过一种规范的报文结构与客户端进行通信。
技术实现思路
本专利技术的第一目的是提供一种前端界面的数据描述方法。本专利技术的第二目的是提供一种前端界面的生成方法。为达上述目的,本专利技术采用的技术方案如下:一种前端界面的数据描述方法,本前端界面的数据描述方法包括以下步骤:将前端界面进行多级切分获得多级区块;以及按照构成顺序,用JSON数据格式对区块和区块内承载的组件进行描述,形成一个树形的JSON数据组,所述树形的JSON数据组即为前端界面的数据描述;其中,组件的描述包括类型、名称、下级和样式,区块的描述包括界面结构定义和切分界面定义,切分界面定义包括区块长度和区块高度。在所述的将前端界面进行多级切分获得多级区块的步骤中,优选地,区块的切分规则包括同一区块内的组件的类型相近或功能相近。在所述的将前端界面进行多级切分获得多级区块的步骤中,优选地,最末级的区块中的组件的类型相同或功能相同。通过上述方法生成了由多级区块和组件构成的、用JSON数据格式描述的报文结构,即树形的JSON数据组。该报文结构清晰的描述了前端界面的结构,客户端从服务器端获取该报文结构后,通 ...
【技术保护点】
1.一种前端界面的数据描述方法,其特征在于,包括:/n将前端界面进行多级切分获得多级区块;以及/n按照构成顺序,用JSON数据格式对区块和区块内承载的组件进行描述,形成一个树形的JSON数据组,所述树形的JSON数据组即为前端界面的数据描述;/n其中,组件的描述包括类型、名称、下级和样式,区块的描述包括界面结构定义和切分界面定义,切分界面定义包括区块长度和区块高度。/n
【技术特征摘要】
1.一种前端界面的数据描述方法,其特征在于,包括:
将前端界面进行多级切分获得多级区块;以及
按照构成顺序,用JSON数据格式对区块和区块内承载的组件进行描述,形成一个树形的JSON数据组,所述树形的JSON数据组即为前端界面的数据描述;
其中,组件的描述包括类型、名称、下级和样式,区块的描述包括界面结构定义和切分界面定义,切分界面定义包括区块长度和区块高度。
2.根据权利要求1所述的前端界面的数据描述方法,其特征在于,所述的将前端界面进行多级切分获得多级区块的步骤中,...
【专利技术属性】
技术研发人员:王鹏,
申请(专利权)人:深圳科蓝金信科技发展有限公司,
类型:发明
国别省市:广东;44
还没有人留言评论。发表了对其他浏览者有用的留言会获得科技券。