[go: up one dir, main page]

CN116069324A - Dynamic form construction method and device based on Vue - Google Patents

Dynamic form construction method and device based on Vue Download PDF

Info

Publication number
CN116069324A
CN116069324A CN202211708734.6A CN202211708734A CN116069324A CN 116069324 A CN116069324 A CN 116069324A CN 202211708734 A CN202211708734 A CN 202211708734A CN 116069324 A CN116069324 A CN 116069324A
Authority
CN
China
Prior art keywords
component
metadata
target information
vue
information
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202211708734.6A
Other languages
Chinese (zh)
Inventor
周海
田松林
刘兆平
杨洪河
曾庆涛
赵铭
林镇锋
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
China Southern Power Grid Digital Platform Technology Guangdong Co ltd
Original Assignee
China Southern Power Grid Digital Platform Technology Guangdong Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by China Southern Power Grid Digital Platform Technology Guangdong Co ltd filed Critical China Southern Power Grid Digital Platform Technology Guangdong Co ltd
Priority to CN202211708734.6A priority Critical patent/CN116069324A/en
Publication of CN116069324A publication Critical patent/CN116069324A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/38Creation or generation of source code for implementing user interfaces
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/36Software reuse
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management
    • G06F8/75Structural analysis for program understanding

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Human Computer Interaction (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention discloses a dynamic form construction method and a device based on Vue, wherein the method comprises the following steps: analyzing UI components configured through preset form fields to obtain metadata sets of all the UI components, wherein each metadata set comprises a plurality of metadata, each metadata corresponds to each UI component, analyzing all metadata in the metadata sets to obtain component types corresponding to each metadata, analyzing the component types corresponding to each metadata to obtain first target information corresponding to each metadata, and transmitting the first target information matched with the UI components to the corresponding UI components to trigger the UI components to generate the corresponding form components according to the first target information. By implementing the method and the device, the UI component configured in the form field can be analyzed to obtain various metadata, corresponding target information is obtained according to metadata analysis, and the UI component can generate the corresponding form component according to the corresponding target information, so that the construction efficiency of the form page is improved, and the development cost of the form page is reduced.

Description

一种基于Vue的动态表单构建方法及装置A Vue-based dynamic form construction method and device

技术领域technical field

本发明涉及软件设计开发技术领域,尤其涉及一种基于Vue的动态表单构建方法及装置。The invention relates to the technical field of software design and development, in particular to a Vue-based dynamic form construction method and device.

背景技术Background technique

现时前端开发项目中表单页面的构建方式一般是开发人员以人工配置的方式,根据表单所需的数据逐一手动配置所需的表单组件代码,这种构建方式使得在前端项目得开发过程中无法动态地构建表单页面,从而导致了表单页面的构建效率低以及开发成本高问题。现时本发明提供了一种基于Vue的动态表单构建方法及装置,使构建表单的方式动态化,以解决现有技术中对表单页面的构建效率低以及开发成本高的问题。At present, the construction method of form pages in front-end development projects is generally that developers manually configure the required form component codes one by one according to the data required by the form. This construction method makes it impossible to dynamically The form page is constructed in an accurate manner, which leads to the problems of low construction efficiency and high development cost of the form page. At present, the present invention provides a Vue-based dynamic form construction method and device, which makes the form construction method dynamic, so as to solve the problems of low construction efficiency and high development cost of form pages in the prior art.

发明内容Contents of the invention

本发明所要解决的技术问题在于,提供一种基于Vue的动态表单构建方法及装置,能够有效地提高表单页面的构建效率以及降低表单页面的开发成本。The technical problem to be solved by the present invention is to provide a Vue-based dynamic form construction method and device, which can effectively improve the construction efficiency of form pages and reduce the development cost of form pages.

为了解决上述技术问题,本发明第一方面公开了一种基于Vue的动态表单构建方法,所述方法包括:In order to solve the above technical problems, the first aspect of the present invention discloses a Vue-based dynamic form construction method, the method comprising:

解析通过预设的表单字段配置的UI组件,得到所有UI组件的元数据集合,所述元数据集合包括多个元数据,每一个元数据与每一个UI组件相对应;Analyzing the UI components configured through the preset form fields to obtain the metadata collection of all UI components, the metadata collection includes multiple metadata, and each metadata corresponds to each UI component;

解析所述元数据集合中的所有元数据,得到所述每一个元数据对应的组件类型;Parse all the metadata in the metadata set to obtain the component type corresponding to each piece of metadata;

解析所述每一个元数据对应的组件类型,得到所述每一个元数据对应的第一目标信息;Analyzing the component type corresponding to each piece of metadata to obtain the first target information corresponding to each piece of metadata;

向对应的UI组件传入与所述UI组件相匹配的第一目标信息,以触发所述UI组件根据所述第一目标信息生成对应的表单组件。The first target information matching the UI component is passed to the corresponding UI component, so as to trigger the UI component to generate a corresponding form component according to the first target information.

一种可选的实施方式,在本发明第一方面中,所述UI组件为基于Vue开发的前端组件,所述Vue的架构版本为Vue2.0;An optional implementation manner, in the first aspect of the present invention, the UI component is a front-end component developed based on Vue, and the architecture version of the Vue is Vue2.0;

所述解析所述每一个元数据对应的组件类型,得到所述每一个元数据对应的第一目标信息,包括:The analyzing the component type corresponding to each piece of metadata to obtain the first target information corresponding to each piece of metadata includes:

通过与对应的组件类型相匹配的数据解析器解析所述每一个元数据对应的组件类型,得到所述每一个元数据对应的第一目标信息;Parsing the component type corresponding to each piece of metadata by a data parser that matches the corresponding component type, to obtain the first target information corresponding to each piece of metadata;

其中,所述第一目标信息包括:第一标识信息、第一参数信息。Wherein, the first target information includes: first identification information and first parameter information.

作为一种可选的实施方式,在本发明第一方面中,在所述解析所述元数据集合中的所有元数据,得到所述每一个元数据对应的组件类型之后,所述方法还包括:As an optional implementation manner, in the first aspect of the present invention, after parsing all the metadata in the metadata set to obtain the component type corresponding to each piece of metadata, the method further includes :

遍历所述元数据集合并解析所述元数据集合中的所有元数据,得到所述每一个元数据对应的公共信息;Traversing the metadata set and parsing all the metadata in the metadata set to obtain the public information corresponding to each piece of metadata;

解析所述每一个元数据对应的公共信息,得到所述每一个元数据对应的第二目标信息;Analyzing the public information corresponding to each of the metadata to obtain the second target information corresponding to each of the metadata;

其中,所述每一个元数据对应的公共信息,包括:Wherein, the public information corresponding to each metadata includes:

每一个元数据对应每一个UI组件的所述组件类型、是否只读、是否可编辑、组件值、字段名称中的至少一种公共信息;Each piece of metadata corresponds to at least one public information of the component type, read-only, editable, component value, and field name of each UI component;

所述第二目标信息包括:第二标识信息、第二参数信息。The second target information includes: second identification information and second parameter information.

作为一种可选的实施方式,在本发明第一方面中,所述向对应的UI组件传入与所述UI组件相匹配的第一目标信息,以触发所述UI组件根据所述第一目标信息生成对应的表单组件,包括:As an optional implementation manner, in the first aspect of the present invention, the first target information matching the UI component is passed to the corresponding UI component, so as to trigger the UI component to Target information generates corresponding form components, including:

通过所述Vue的component组件向对应的UI组件传入与所述UI组件相匹配的第一目标信息,以触发所述UI组件根据所述第一目标信息生成对应的表单组件。The first target information matching the UI component is passed to the corresponding UI component through the component component of Vue, so as to trigger the UI component to generate a corresponding form component according to the first target information.

作为一种可选的实施方式,在本发明第一方面中,所述解析通过表单字段配置的UI组件,得到所有UI组件的元数据集合,包括:As an optional implementation, in the first aspect of the present invention, the parsing is performed through UI components configured through form fields to obtain metadata sets of all UI components, including:

解析通过预设的表单字段与组件参数配置的UI组件,得到所有UI组件的元数据集合;Analyze the UI components configured through the preset form fields and component parameters, and get the metadata collection of all UI components;

所述解析所述每一个元数据对应的公共信息,得到所述每一个元数据对应的第二目标信息,包括:The analyzing the public information corresponding to each metadata to obtain the second target information corresponding to each metadata includes:

解析所述每一个元数据对应的是否只读、是否可编辑、组件值、字段名称的公共信息,得到所述每一个元数据对应的第二目标信息;Analyzing the public information of read-only, editable, component value, and field name corresponding to each metadata, to obtain the second target information corresponding to each metadata;

所述方法还包括:The method also includes:

通过所述Vue的component组件向对应的UI组件传入与所述UI组件相匹配的第二目标信息,以触发所述UI组件根据所述目标信息初始化对应的表单组件的组件属性,所述组件属性用于初始化所述表单组件的功能属性。Pass the second target information matching the UI component to the corresponding UI component through the component component of Vue, so as to trigger the UI component to initialize the component properties of the corresponding form component according to the target information, and the component property is used to initialize the functional properties of the form component.

作为一种可选的实施方式,在本发明第一方面中,在所述通过所述Vue的component组件向对应的UI组件传入与所述UI组件相匹配的第二目标信息之前,所述方法还包括:As an optional implementation manner, in the first aspect of the present invention, before passing the second target information matching the UI component to the corresponding UI component through the Vue component, the Methods also include:

判断所述UI组件对应的第一目标信息中的第一标识信息与所述第二目标信息中的第二标识信息是否相匹配;judging whether the first identification information in the first target information corresponding to the UI component matches the second identification information in the second target information;

若判断到所述UI组件对应的第一标识信息与所述第二标识信息相匹配时,触发执行所述通过所述Vue的component组件向对应的UI组件传入与所述UI组件相匹配的第二目标信息的操作;If it is determined that the first identification information corresponding to the UI component matches the second identification information, trigger the execution of passing the information that matches the UI component to the corresponding UI component through the component component of the Vue. Operation of the second target information;

若判断到所述UI组件对应的第一标识信息与所述第二标识信息不相匹配时,触发执行所述解析所述每一个元数据对应的是否只读、是否可编辑、组件值、字段名称的公共信息,得到所述每一个元数据对应的第二目标信息的操作,并更新所述第二目标信息。If it is determined that the first identification information corresponding to the UI component does not match the second identification information, trigger the execution of the parsing of whether the metadata corresponds to read-only, editable, component value, field public information of the name, obtain the operation of the second target information corresponding to each piece of metadata, and update the second target information.

作为一种可选的实施方式,在本发明第一方面中,所述方法还包括:As an optional implementation manner, in the first aspect of the present invention, the method further includes:

检测所述公共信息是否改变;detecting whether said public information has changed;

当检测到所述公共信息中的某一种信息发生改变时,根据改变后的公共信息更新所述第一目标信息与所述第二目标信息;updating the first target information and the second target information according to the changed public information when it is detected that a certain type of information in the public information has changed;

通过所述Vue的component组件向对应的UI组件传入更新后的第一目标信息与更新后的第二目标信息,以触发所述UI组件根据所述更新后的第一目标信息与所述更新后的第二目标信息生成对应的表单组件。Pass the updated first target information and updated second target information to the corresponding UI component through the component component of Vue, so as to trigger the UI component according to the updated first target information and the updated The following second target information generates a corresponding form component.

本发明第二方面公开了一种基于Vue的动态表单构建装置,所述装置包括:The second aspect of the present invention discloses a Vue-based dynamic form construction device, the device comprising:

解析模块,用于解析通过表单字段配置的UI组件,得到所有UI组件的元数据集合,所述元数据集合包括多个元数据,每一个元数据与每一个UI组件相对应;The parsing module is configured to parse the UI components configured through the form fields to obtain the metadata collection of all UI components, the metadata collection includes a plurality of metadata, and each metadata corresponds to each UI component;

所述解析模块,还用于解析所述元数据集合中的所有元数据,得到所述每一个元数据对应的组件类型;The parsing module is further configured to parse all the metadata in the metadata set to obtain the component type corresponding to each piece of metadata;

所述解析模块,还用解析所述每一个元数据对应的组件类型,得到所述每一个元数据对应的第一目标信息;The parsing module further obtains the first target information corresponding to each metadata by parsing the component type corresponding to each metadata;

传入模块,用于向对应的UI组件传入所述解析模块解析得到的与所述UI组件相匹配的第一目标信息,以触发所述UI组件根据所述第一目标信息生成对应的表单组件。The incoming module is used to pass in the first target information that is parsed by the parsing module and matches the UI component to the corresponding UI component, so as to trigger the UI component to generate a corresponding form according to the first target information components.

作为一种可选的实施方式,在本发明第二方面中,所述UI组件为基于Vue开发的前端组件,所述Vue的架构版本为Vue2.0;As an optional implementation, in the second aspect of the present invention, the UI component is a front-end component developed based on Vue, and the architecture version of Vue is Vue2.0;

所述解析模块解析所述每一个元数据对应的组件类型,得到所述每一个元数据对应的第一目标信息的具体方式为:The parsing module parses the component type corresponding to each metadata, and obtains the first target information corresponding to each metadata in a specific manner as follows:

通过与对应的组件类型相匹配的数据解析器解析所述每一个元数据对应的组件类型,得到所述每一个元数据对应的第一目标信息;Parsing the component type corresponding to each piece of metadata by a data parser that matches the corresponding component type, to obtain the first target information corresponding to each piece of metadata;

其中,所述第一目标信息包括:第一标识信息、第一参数信息。Wherein, the first target information includes: first identification information and first parameter information.

作为一种可选的实施方式,在本发明第二方面中,在所述解析模块解析所述元数据集合中的所有元数据,得到所述每一个元数据对应的组件类型之后,所述装置还包括:As an optional implementation manner, in the second aspect of the present invention, after the parsing module parses all the metadata in the metadata set to obtain the component type corresponding to each piece of metadata, the device Also includes:

遍历模块,遍历所述元数据集合;Traversing modules, traversing the metadata collection;

所述解析模块,还用于解析所述遍历模块遍历得到的所述元数据集合中的所有元数据,得到所述每一个元数据对应的公共信息;The parsing module is further configured to parse all metadata in the metadata set traversed by the traversal module to obtain public information corresponding to each metadata;

所述解析模块,还用于解析所述每一个元数据对应的公共信息,得到所述每一个元数据对应的第二目标信息;The parsing module is further configured to parse the public information corresponding to each metadata, and obtain the second target information corresponding to each metadata;

其中,所述每一个元数据对应的公共信息,包括:Wherein, the public information corresponding to each metadata includes:

每一个元数据对应每一个UI组件的所述组件类型、是否只读、是否可编辑、组件值、字段名称中的至少一种公共信息;Each piece of metadata corresponds to at least one public information of the component type, read-only, editable, component value, and field name of each UI component;

所述第二目标信息包括:第二标识信息、第二参数信息。The second target information includes: second identification information and second parameter information.

作为一种可选的实施方式,在本发明第二方面中,所述传入模块向对应的UI组件传入与所述UI组件相匹配的第一目标信息,以触发所述UI组件根据所述第一目标信息生成对应的表单组件的具体方式为:As an optional implementation manner, in the second aspect of the present invention, the input module transmits the first target information matching the UI component to the corresponding UI component, so as to trigger the UI component to The specific way to generate the corresponding form component for the first target information is as follows:

通过所述Vue的component组件向对应的UI组件传入与所述UI组件相匹配的第一目标信息,以触发所述UI组件根据所述第一目标信息生成对应的表单组件。The first target information matching the UI component is passed to the corresponding UI component through the component component of Vue, so as to trigger the UI component to generate a corresponding form component according to the first target information.

作为一种可选的实施方式,在本发明第二方面中,所述解析模块解析通过表单字段配置的UI组件,得到所有UI组件的元数据集合的具体方式为:As an optional implementation, in the second aspect of the present invention, the parsing module parses the UI components configured through the form fields, and obtains the metadata collection of all UI components in a specific manner as follows:

解析通过预设的表单字段与组件参数配置的UI组件,得到所有UI组件的元数据集合;Analyze the UI components configured through the preset form fields and component parameters, and get the metadata collection of all UI components;

所述解析模块解析所述每一个元数据对应的公共信息,得到所述每一个元数据对应的第二目标信息的具体方式为:The parsing module parses the public information corresponding to each metadata, and obtains the second target information corresponding to each metadata in a specific manner as follows:

解析所述每一个元数据对应的是否只读、是否可编辑、组件值、字段名称的公共信息,得到所述每一个元数据对应的第二目标信息;Analyzing the public information of read-only, editable, component value, and field name corresponding to each metadata, to obtain the second target information corresponding to each metadata;

所述传入模块,还用于通过所述Vue的component组件向对应的UI组件传入与所述UI组件相匹配的第二目标信息,以触发所述UI组件根据所述目标信息初始化对应的表单组件的组件属性,所述组件属性用于初始化所述表单组件的功能属性。The incoming module is also used to pass the second target information matching the UI component to the corresponding UI component through the component component of Vue, so as to trigger the UI component to initialize the corresponding target information according to the target information. The component attribute of the form component, the component attribute is used to initialize the function attribute of the form component.

作为一种可选的实施方式,在本发明第二方面中,在所述传入模块通过所述Vue的component组件向对应的UI组件传入与所述UI组件相匹配的第二目标信息之前,所述装置还包括:As an optional implementation, in the second aspect of the present invention, before the incoming module passes the second target information matching the UI component to the corresponding UI component through the Vue component , the device also includes:

判断模块,用于判断所述UI组件对应的第一目标信息中的第一标识信息与所述第二目标信息中的第二标识信息是否相匹配;若判断到所述UI组件对应的第一标识信息与所述第二标识信息相匹配时,触发传入模块执行所述通过所述Vue的component组件向对应的UI组件传入与所述UI组件相匹配的第二目标信息的操作;若判断到所述UI组件对应的第一标识信息与所述第二标识信息不相匹配时,触发所述解析模块执行所述解析所述每一个元数据对应的是否只读、是否可编辑、组件值、字段名称的公共信息,得到所述每一个元数据对应的第二目标信息的操作;A judging module, configured to judge whether the first identification information in the first target information corresponding to the UI component matches the second identification information in the second target information; if it is determined that the first identification information corresponding to the UI component When the identification information matches the second identification information, trigger the incoming module to perform the operation of passing the second target information matching the UI component to the corresponding UI component through the component component of the Vue; if When it is determined that the first identification information corresponding to the UI component does not match the second identification information, the parsing module is triggered to perform the parsing of whether the metadata corresponds to read-only, editable, component The public information of value and field name, the operation of obtaining the second target information corresponding to each metadata;

第一更新模块,用于更新所述解析模块解析得到的所述第二目标信息。A first updating module, configured to update the second target information analyzed by the parsing module.

作为一种可选的实施方式,在本发明第二方面中,所述As an optional implementation, in the second aspect of the present invention, the

本发明第三方面公开了另一种基于Vue的动态表单构建装置,所述装置包括:The third aspect of the present invention discloses another Vue-based dynamic form construction device, which includes:

存储有可执行程序代码的存储器;a memory storing executable program code;

与所述存储器耦合的处理器;a processor coupled to the memory;

所述处理器调用所述存储器中存储的所述可执行程序代码,执行本发明第一方面公开的基于Vue的动态表单构建方法中部分或全部的步骤。The processor invokes the executable program code stored in the memory to execute some or all of the steps in the Vue-based dynamic form construction method disclosed in the first aspect of the present invention.

本发明第四方面公开了一种计算机存储介质,所述计算机存储介质存储有计算机指令,所述计算机指令被调用时,用于执行本发明第一方面公开的基于Vue的动态表单构建方法中部分或全部的步骤。The fourth aspect of the present invention discloses a computer storage medium, the computer storage medium stores computer instructions, and when the computer instructions are called, it is used to execute part of the Vue-based dynamic form construction method disclosed in the first aspect of the present invention. or all steps.

与现有技术相比,本发明实施例具有以下有益效果:提供了一种基于Vue的动态表单构建方法及装置,该基于Vue的动态表单构建方法包括:解析通过预设的表单字段配置的UI组件,得到所有UI组件的元数据集合,元数据集合包括多个元数据,每一个元数据与每一个UI组件相对应,解析元数据集合中的所有元数据,得到每一个元数据对应的组件类型;解析每一个元数据对应的组件类型,得到每一个元数据对应的第一目标信息,向对应的UI组件传入与UI组件相匹配的第一目标信息,以触发UI组件根据第一目标信息生成对应的表单组件。可见,实施本发明能够解析预设表单字段配置的UI组件,得到多个元数据,该元数据能够解析为多种UI组件的参数,有利于提高表单页面的构建效率以及灵活性;解析所有元数据得到每一个元数据对应的组件类型,解析对应的组件类型得到每一个元数据对应的第一目标信息,有利于提高表单页面的构建效率以及准确率;最后向UI组件传入对应的第一目标信息以使UI组件生成对应的表单组件,使功能各异的表单组件生成的方式动态化,从而有利于提高表单页面的构建效率以及降低表单页面的开发成本。Compared with the prior art, the embodiments of the present invention have the following beneficial effects: a Vue-based dynamic form construction method and device are provided, and the Vue-based dynamic form construction method includes: parsing the UI configured through preset form fields Components, get the metadata collection of all UI components, the metadata collection includes multiple metadata, each metadata corresponds to each UI component, parse all the metadata in the metadata collection, and get the component corresponding to each metadata Type; analyze the component type corresponding to each metadata, obtain the first target information corresponding to each metadata, and pass the first target information matching the UI component to the corresponding UI component, so as to trigger the UI component according to the first target The information generates the corresponding form component. It can be seen that the implementation of the present invention can analyze the UI components of the preset form field configuration to obtain a plurality of metadata, which can be parsed into parameters of various UI components, which is conducive to improving the construction efficiency and flexibility of form pages; The data obtains the component type corresponding to each metadata, and analyzes the corresponding component type to obtain the first target information corresponding to each metadata, which is conducive to improving the construction efficiency and accuracy of the form page; finally, the corresponding first target information is passed to the UI component. The target information enables UI components to generate corresponding form components, making the way of generating form components with different functions dynamic, which is conducive to improving the construction efficiency of form pages and reducing the development cost of form pages.

附图说明Description of drawings

为了更清楚地说明本发明实施例中的技术方案,下面将对实施例描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings that need to be used in the description of the embodiments will be briefly introduced below. Obviously, the drawings in the following description are only some embodiments of the present invention. For those skilled in the art, other drawings can also be obtained based on these drawings without creative effort.

图1是本发明实施例公开的一种基于Vue的动态表单构建方法的流程示意图;Fig. 1 is a schematic flow diagram of a Vue-based dynamic form construction method disclosed in an embodiment of the present invention;

图2是本发明实施例公开的又一种基于Vue的动态表单构建方法的流程示意图;Fig. 2 is a schematic flow diagram of another Vue-based dynamic form construction method disclosed in the embodiment of the present invention;

图3是本发明实施例公开的一种基于Vue的动态表单构建装置的结构示意图;Fig. 3 is a schematic structural diagram of a Vue-based dynamic form construction device disclosed in an embodiment of the present invention;

图4是本发明实施例公开的另一种基于Vue的动态表单构建装置的结构示意图;Fig. 4 is a schematic structural diagram of another Vue-based dynamic form construction device disclosed in the embodiment of the present invention;

图5是本发明实施例公开的又一种基于Vue的动态表单构建装置的结构示意图。Fig. 5 is a schematic structural diagram of another Vue-based dynamic form construction device disclosed in an embodiment of the present invention.

具体实施方式Detailed ways

为了使本技术领域的人员更好地理解本发明方案,下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。In order to enable those skilled in the art to better understand the solutions of the present invention, the following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only It is a part of embodiments of the present invention, but not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by persons of ordinary skill in the art without creative efforts fall within the protection scope of the present invention.

本发明的说明书和权利要求书及上述附图中的术语“第一”、“第二”等是用于区域别不同对象,而不是用于描述特定顺序。此外,术语“包括”和“具有”以及它们任何变形,意图在于覆盖不排他的包含。例如包含了一系列步骤或单元的过程、方法、装置、产品或设备没有限定于已列出的步骤或单元,而是可选地还包括没有列出的步骤或单元,或可选地还包括对于这些过程、方法、产品或设备固有的其他步骤或单元。The terms "first", "second" and the like in the description and claims of the present invention and the above drawings are used to distinguish different objects rather than to describe a specific order. Furthermore, the terms "include" and "have", as well as any variations thereof, are intended to cover a non-exclusive inclusion. For example, a process, method, device, product or equipment comprising a series of steps or units is not limited to the listed steps or units, but optionally also includes steps or units not listed, or optionally further includes For other steps or units inherent in these processes, methods, products or devices.

在本文中提及“实施例”意味着,结合实施例描述的特定特征、结构或特性可以包含在本发明的至少一个实施例中。在说明书中的各个位置出现该短语并不一定均是指相同的实施例,也不是与其它实施例互斥的独立的或备选的实施例。本领域技术人员显式地和隐式地理解的是,本文所描述的实施例可以与其它实施例相结合。Reference herein to an "embodiment" means that a particular feature, structure, or characteristic described in connection with the embodiment can be included in at least one embodiment of the present invention. The occurrences of this phrase in various places in the specification are not necessarily all referring to the same embodiment, nor are separate or alternative embodiments mutually exclusive of other embodiments. It is understood explicitly and implicitly by those skilled in the art that the embodiments described herein can be combined with other embodiments.

本发明公开了一种基于Vue的动态表单构建方法及装置,该基于Vue的动态表单构建方法包括:解析通过预设的表单字段配置的UI组件,得到所有UI组件的元数据集合,元数据集合包括多个元数据,每一个元数据与每一个UI组件相对应,解析元数据集合中的所有元数据,得到每一个元数据对应的组件类型;解析每一个元数据对应的组件类型,得到每一个元数据对应的第一目标信息,向对应的UI组件传入与UI组件相匹配的第一目标信息,以触发UI组件根据第一目标信息生成对应的表单组件。实施本发明能够解析预设表单字段配置的UI组件,得到多个元数据,该元数据能够解析为多种UI组件的参数,有利于提高表单页面的构建效率以及灵活性;解析所有元数据得到每一个元数据对应的组件类型,解析对应的组件类型得到每一个元数据对应的第一目标信息,有利于提高表单页面的构建效率以及准确率;最后向UI组件传入对应的第一目标信息以使UI组件生成对应的表单组件,使功能各异的表单组件生成的方式动态化,从而有利于提高表单页面的构建效率以及降低表单页面的开发成本。以下分别进行详细说明。The present invention discloses a Vue-based dynamic form construction method and device. The Vue-based dynamic form construction method includes: analyzing UI components configured through preset form fields to obtain metadata sets of all UI components, metadata sets Including multiple metadata, each metadata corresponds to each UI component, parses all metadata in the metadata collection, and obtains the component type corresponding to each metadata; parses the component type corresponding to each metadata, and obtains each First target information corresponding to one piece of metadata, and the first target information matching the UI component is passed to the corresponding UI component, so as to trigger the UI component to generate a corresponding form component according to the first target information. The implementation of the present invention can analyze the UI components of the preset form field configuration to obtain a plurality of metadata, which can be parsed into parameters of various UI components, which is conducive to improving the construction efficiency and flexibility of the form page; analyzing all the metadata to obtain The component type corresponding to each metadata, parse the corresponding component type to get the first target information corresponding to each metadata, which is conducive to improving the construction efficiency and accuracy of the form page; finally pass the corresponding first target information to the UI component The UI components can be used to generate corresponding form components, and the way of generating form components with different functions can be made dynamic, so as to improve the construction efficiency of form pages and reduce the development cost of form pages. Each will be described in detail below.

实施例一Embodiment one

请参阅图1,图1是本发明实施例公开的一种基于Vue的动态表单构建方法流程示意图。其中,图1所描述的基于Vue的动态表单构建方法可以应用于基于Vue的动态表单构建装置中,该装置可以应用于本地终端设备或移动终端设备的应用程序中。其中,本地终端设备可以包括PC终端、本地服务器等,移动终端设备可以包括智能手机(Android手机、iOS手机)、平板电脑、掌上电脑、个人数字助理(Personal Digital Assistant,PDA)、智能导航仪以及移动互联网设备(Mobile Internet Devices,MID)等中的至少一种,本发明实施例不做限定。如图1所示,该基于Vue的动态表单构建方法可以包括以下操作:Please refer to FIG. 1 . FIG. 1 is a schematic flowchart of a Vue-based dynamic form construction method disclosed in an embodiment of the present invention. Wherein, the Vue-based dynamic form construction method described in FIG. 1 can be applied to a Vue-based dynamic form construction device, and the device can be applied to an application program of a local terminal device or a mobile terminal device. Among them, the local terminal equipment can include PC terminals, local servers, etc., and the mobile terminal equipment can include smart phones (Android mobile phones, iOS mobile phones), tablet computers, handheld computers, personal digital assistants (Personal Digital Assistant, PDA), intelligent navigators and At least one of Mobile Internet Devices (Mobile Internet Devices, MID), etc., which is not limited in this embodiment of the present invention. As shown in Figure 1, the Vue-based dynamic form construction method may include the following operations:

101、解析通过预设的表单字段配置的UI组件,得到所有UI组件的元数据集合。101. Analyzing UI components configured through preset form fields to obtain metadata sets of all UI components.

本发明实施例中,可选的,解析通过表单字段配置的UI组件,可以包括:In the embodiment of the present invention, optionally, parsing the UI components configured through form fields may include:

解析通过预设的表单字段与组件参数配置的UI组件。Parses UI components configured through preset form fields and component parameters.

本发明实施例中,可选的,组件参数可以用于渲染UI组件,预设的表单字段可以包括字段名称、字段类型、字段内容等中的至少一种,元数据集合可以包括多个元数据,每一个元数据与每一个UI组件相对应,每一个元数据可以用于整合生成对应的表单组件。进一步地,字段类型可以包括文本字段、数字字段、日期字段、时间字段、货币字段、图像字段等中的至少一种,UI组件可以为基于Vue开发的前端组件,Vue的架构版本可以包括Vue1.0、Vue2.0、Vue3.0中的其中一种。这样将根据预设表单字段配置好的表单解析得到对应的多个不同类型的元数据,解析得到的元数据越丰富与详细,越有利于提高表单页面的构建效率以及降低表单页面的开发成本。In the embodiment of the present invention, optionally, component parameters can be used to render UI components, preset form fields can include at least one of field name, field type, field content, etc., and the metadata set can include multiple metadata , each metadata corresponds to each UI component, and each metadata can be used to integrate and generate corresponding form components. Further, the field type may include at least one of text field, number field, date field, time field, currency field, image field, etc., the UI component may be a front-end component developed based on Vue, and the architecture version of Vue may include Vue1. 0, one of Vue2.0, Vue3.0. In this way, multiple different types of metadata will be obtained by parsing the configured form according to the preset form fields. The richer and more detailed the metadata obtained by parsing, the more conducive to improving the construction efficiency of the form page and reducing the development cost of the form page.

102、解析元数据集合中的所有元数据,得到每一个元数据对应的组件类型。102. Parse all the metadata in the metadata set, and obtain the component type corresponding to each piece of metadata.

本发明实施例中,可选的,每一个元数据对应的组件类型可以包括复选框组件、输入框组件、下拉框组件、文本框组件、筛选框组件等中的其中一种。这样通过元数据解析得到对应的组件类型越丰富与详细,越有利于提高表单页面的构建效率以及提高表单页面的构建灵活性。In this embodiment of the present invention, optionally, the component type corresponding to each piece of metadata may include one of a check box component, an input box component, a drop-down box component, a text box component, a filter box component, and the like. In this way, the richer and more detailed the corresponding component types obtained through metadata analysis, the more conducive to improving the construction efficiency of the form page and improving the construction flexibility of the form page.

103、解析每一个元数据对应的组件类型,得到每一个元数据对应的第一目标信息。103. Analyze the component type corresponding to each metadata, and obtain the first target information corresponding to each metadata.

本发明实施例中,解析每一个元数据对应的组件类型,得到每一个元数据对应的第一目标信息,可以包括:In the embodiment of the present invention, parsing the component type corresponding to each metadata to obtain the first target information corresponding to each metadata may include:

通过与对应的组件类型相匹配的数据解析器解析每一个元数据对应的组件类型,得到每一个元数据对应的第一目标信息。The component type corresponding to each piece of metadata is parsed by a data parser that matches the corresponding component type, and the first target information corresponding to each piece of metadata is obtained.

其中,第一目标信息可以包括第一标识信息、第一参数信息。进一步地,第一标识信息可以包括该元数据对应组件类型的标识名称、标识编号等中的至少一种,每一个第一标识信息对应唯一的元数据。这样根据特定对应的组件类型解析器解析每一个元数据对应的组件类型得到对应的第一目标信息,且每一个元数据对应唯一的一个元数据,提高了表单页面的构建准确性,从而有利于提高表单页面的构建效率以及降低表单页面的开发成本。Wherein, the first target information may include first identification information and first parameter information. Further, the first identification information may include at least one of the identification name and identification number of the component type corresponding to the metadata, and each piece of first identification information corresponds to unique metadata. In this way, according to the specific corresponding component type parser, the component type corresponding to each metadata is parsed to obtain the corresponding first target information, and each metadata corresponds to a unique metadata, which improves the construction accuracy of the form page, thereby facilitating Improve the construction efficiency of form pages and reduce the development cost of form pages.

104、向对应的UI组件传入与UI组件相匹配的第一目标信息,以触发UI组件根据第一目标信息生成对应的表单组件。104. Introduce first target information matching the UI component to the corresponding UI component, so as to trigger the UI component to generate a corresponding form component according to the first target information.

本发明实施例中,可选的,向对应的UI组件传入与UI组件相匹配的第一目标信息,以触发UI组件根据第一目标信息生成对应的表单组件,可以包括:In the embodiment of the present invention, optionally, the first target information matching the UI component is passed to the corresponding UI component, so as to trigger the UI component to generate a corresponding form component according to the first target information, which may include:

通过Vue的component组件向对应的UI组件传入与UI组件相匹配的第一目标信息,以触发UI组件根据第一目标信息生成对应的表单组件。Pass the first target information matching the UI component to the corresponding UI component through the component component of Vue, so as to trigger the UI component to generate the corresponding form component according to the first target information.

其中,Vue的component组件为Vue内的一个内置组件,该component组件用于配合is组件属性动态渲染组件,is组件属性用于动态切换组件(例如:Vue代码表示为:<component:is=’组件变量名’>…<component>,其中组件变量名可以为第一目标信息)。这样通过Vue的component组件向对应的UI组件传入与UI组件相匹配的第一目标信息,使UI组件根据第一目标信息生成对应的表单组件,有利于提高表单页面的构建准确率,从而有利于提高表单页面的构建效率以及降低表单页面的开发成本。Among them, the component component of Vue is a built-in component in Vue. The component component is used to dynamically render components with the is component attribute, and the is component attribute is used to dynamically switch components (for example: Vue code is expressed as: <component:is='component Variable name'>...<component>, where the component variable name can be the first target information). In this way, the first target information that matches the UI component is passed to the corresponding UI component through the component component of Vue, so that the UI component generates the corresponding form component according to the first target information, which is conducive to improving the construction accuracy of the form page, thereby effectively It is beneficial to improve the construction efficiency of the form page and reduce the development cost of the form page.

在一个可选的实施例中,在解析元数据集合中的所有元数据,得到每一个元数据对应的组件类型之后,该方法还包括以下操作:In an optional embodiment, after parsing all the metadata in the metadata collection and obtaining the component type corresponding to each piece of metadata, the method further includes the following operations:

遍历元数据集合并解析元数据集合中的所有元数据,得到每一个元数据对应的公共信息。Traverse the metadata collection and parse all the metadata in the metadata collection to obtain the public information corresponding to each metadata.

解析每一个元数据对应的公共信息,得到每一个元数据对应的第二目标信息。The public information corresponding to each metadata is analyzed to obtain the second target information corresponding to each metadata.

其中,每一个元数据对应的公共信息,可以包括:Among them, the public information corresponding to each metadata may include:

每一个元数据对应每一个UI组件的组件类型、是否只读、是否可编辑、组件值、组件属性、字段名称、字段类型等中的至少一种公共信息。Each piece of metadata corresponds to at least one public information of each UI component, such as component type, read-only, editable, component value, component attribute, field name, field type, and the like.

第二目标信息可以包括第二标识信息、第二参数信息。进一步地,第二标识信息可以包括该元数据对应公共信息的标识名称、标识编号等中的至少一种,每一个第二标识信息对应唯一的元数据。The second target information may include second identification information and second parameter information. Further, the second identification information may include at least one of an identification name, an identification number, and the like that the metadata corresponds to public information, and each piece of second identification information corresponds to unique metadata.

在该可选的实施例中,进一步可选的,解析每一个元数据对应的公共信息,得到每一个元数据对应的第二目标信息,具体包括:In this optional embodiment, it is further optional to analyze the public information corresponding to each metadata to obtain the second target information corresponding to each metadata, specifically including:

解析每一个元数据对应的是否只读、是否可编辑、组件值、字段名称的公共信息,得到每一个元数据对应的第二目标信息。The public information corresponding to each metadata is read-only, editable, component value, field name, and the second target information corresponding to each metadata is obtained.

可见,该可选的实施例能够解析元数据得到对应的公共信息,并根据对应的多种公共信息解析得到元数据对应的多种第二目标信息,这样解析得到的第二目标信息越丰富与详细,越有利于提高表单页面的构建效率以及降低表单页面的开发成本。It can be seen that this optional embodiment can analyze the metadata to obtain the corresponding public information, and analyze and obtain various second target information corresponding to the metadata according to the corresponding various public information. In this way, the second target information obtained through analysis is richer and more relevant The more detailed, the more conducive to improving the construction efficiency of the form page and reducing the development cost of the form page.

在另一个可选的实施例中,执行步骤104之后,该方法还可以执行以下操作:In another optional embodiment, after step 104 is performed, the method may also perform the following operations:

通过Vue的component组件向对应的UI组件传入与UI组件相匹配的第二目标信息,以触发UI组件根据目标信息初始化对应的表单组件的组件属性,该组件属性用于初始化表单组件的功能属性。Pass the second target information that matches the UI component to the corresponding UI component through the component component of Vue to trigger the UI component to initialize the component properties of the corresponding form component according to the target information, which is used to initialize the functional properties of the form component .

可见,该可选的实施例还能够解析元数据得到对应的公共信息,并根据对应的公共信息解析得到元数据对应的第二目标信息,该第二目标信息还能够使UI组件初始化功能属性,提高表单组件生成的自动化,进一步有利于从而有利于提高表单页面的构建效率以及降低表单页面的开发成本。It can be seen that this optional embodiment can also parse the metadata to obtain the corresponding public information, and analyze the corresponding public information to obtain the second target information corresponding to the metadata, and the second target information can also enable the UI component to initialize the functional attributes, Improving the automation of form component generation is further beneficial to improving the construction efficiency of the form page and reducing the development cost of the form page.

在又一个可选的实施例中,在通过Vue的component组件向对应的UI组件传入与UI组件相匹配的第二目标信息之前,该方法还包括以下操作:In yet another optional embodiment, before passing the second target information matching the UI component to the corresponding UI component through the Vue component component, the method further includes the following operations:

判断UI组件对应的第一目标信息中的第一标识信息与第二目标信息中的第二标识信息是否相匹配。It is judged whether the first identification information in the first target information corresponding to the UI component matches the second identification information in the second target information.

若判断到UI组件对应的第一标识信息与第二标识信息相匹配时,触发执行通过所述Vue的component组件向对应的UI组件传入与UI组件相匹配的第二目标信息的操作。If it is determined that the first identification information corresponding to the UI component matches the second identification information, the operation of passing the second target information matching the UI component to the corresponding UI component through the component component of Vue is triggered.

若判断到UI组件对应的第一标识信息与所述第二标识信息不相匹配时,触发执行解析每一个元数据对应的是否只读、是否可编辑、组件值、字段名称的公共信息,得到每一个元数据对应的第二目标信息的操作,并更新第二目标信息。If it is determined that the first identification information corresponding to the UI component does not match the second identification information, trigger the execution of parsing the public information corresponding to each metadata, whether it is read-only, whether it can be edited, component value, and field name, and obtain Each piece of metadata corresponds to an operation on the second target information, and updates the second target information.

可见,该可选的实施例还能够实时地判断公共信息解析得到对应的第二标识信息与第一标识信息是否相匹配,当判断到两者不相匹配时,对解析出的公共信息进行重新解析,得到新的第二目标信息,并对错误的第二目标信息进行实时地更新,能够快速地检测并修复错误的构建信息,进一步有利于提高表单页面的构建效率以及准确率。It can be seen that this optional embodiment can also judge in real time whether the corresponding second identification information obtained by parsing the public information matches the first identification information, and when it is judged that the two do not match, the parsed public information is redistributed. Analyzing, obtaining new second target information, and updating the wrong second target information in real time, can quickly detect and repair wrong construction information, and further help to improve the efficiency and accuracy of form page construction.

实施例二Embodiment two

请参阅图2,图2是本发明实施例公开的一种基于Vue的动态表单构建方法流程示意图。其中,图1所描述的基于Vue的动态表单构建方法可以应用于基于Vue的动态表单构建装置中,该装置可以应用于本地终端设备或移动终端设备的应用程序中。其中,本地终端设备可以包括PC终端、本地服务器等,移动终端设备可以包括智能手机(Android手机、iOS手机)、平板电脑、掌上电脑、个人数字助理(Personal Digital Assistant,PDA)、智能导航仪以及移动互联网设备(Mobile Internet Devices,MID)等中的至少一种,本发明实施例不做限定。如图2所示,该基于Vue的动态表单构建方法可以包括以下操作:Please refer to FIG. 2 . FIG. 2 is a schematic flowchart of a Vue-based dynamic form construction method disclosed in an embodiment of the present invention. Wherein, the Vue-based dynamic form construction method described in FIG. 1 can be applied to a Vue-based dynamic form construction device, and the device can be applied to an application program of a local terminal device or a mobile terminal device. Among them, the local terminal equipment can include PC terminals, local servers, etc., and the mobile terminal equipment can include smart phones (Android mobile phones, iOS mobile phones), tablet computers, handheld computers, personal digital assistants (Personal Digital Assistant, PDA), intelligent navigators and At least one of Mobile Internet Devices (Mobile Internet Devices, MID), etc., which is not limited in this embodiment of the present invention. As shown in Figure 2, the Vue-based dynamic form construction method may include the following operations:

201、解析通过预设的表单字段配置的UI组件,得到所有UI组件的元数据集合,元数据集合包括多个元数据,每一个元数据与每一个UI组件相对应。201. Analyze the UI components configured through preset form fields to obtain metadata sets of all UI components. The metadata sets include multiple metadata, and each metadata corresponds to each UI component.

202、解析元数据集合中的所有元数据,得到每一个元数据对应的组件类型。202. Parse all the metadata in the metadata set to obtain a component type corresponding to each piece of metadata.

203、解析每一个元数据对应的组件类型,得到每一个元数据对应的第一目标信息。203. Analyze the component type corresponding to each metadata, and obtain the first target information corresponding to each metadata.

204、遍历元数据集合并解析元数据集合中的所有元数据,得到每一个元数据对应的公共信息。204. Traverse the metadata set and parse all metadata in the metadata set to obtain public information corresponding to each piece of metadata.

205、解析每一个元数据对应的公共信息,得到每一个元数据对应的第二目标信息。205. Analyze the public information corresponding to each metadata, and obtain the second target information corresponding to each metadata.

206、检测公共信息是否改变,当检测到公共信息中的某一种信息发生改变时,执行步骤207。206. Detect whether the public information has changed, and when it is detected that a certain type of information in the public information has changed, perform step 207.

本发明实施例中,可选的,当检测到公共信息中的某一种信息未发生改变时,重新执行步骤206。In this embodiment of the present invention, optionally, when it is detected that certain information in the public information has not changed, step 206 is re-executed.

207、根据改变后的公共信息更新第一目标信息与第二目标信息,并通过Vue的component组件向对应的UI组件传入更新后的第一目标信息与更新后的第二目标信息,以触发UI组件根据更新后的第一目标信息与更新后的第二目标信息生成对应的表单组件。207. Update the first target information and the second target information according to the changed public information, and pass the updated first target information and the updated second target information to the corresponding UI component through the component component of Vue to trigger The UI component generates a corresponding form component according to the updated first target information and the updated second target information.

本发明实施例中,需要说明的是,针对步骤201-205的相关描述,请参阅实施例一中针对步骤101-103以及可选实施例的详细描述,本发明实施例不再赘述。In this embodiment of the present invention, it should be noted that, for related descriptions of steps 201-205, please refer to the detailed description of steps 101-103 and optional embodiments in Embodiment 1, and details are not repeated in this embodiment of the present invention.

可见,本发明实施例还能够实时地检测元数据解析得到的公共信息是否改变,当检测到公共信息中的某一种信息发生改变时,实时地对第一目标信息以及第二目标信息进行解析更新,能够及时地监测构建表单组件所需的目标信息的变更并对其变更进行实时地更新,提高了构建表单的是实时性,进一步有利于提高表单页面的构建效率以及降低表单页面的开发成本。It can be seen that the embodiment of the present invention can also detect in real time whether the public information obtained by metadata analysis has changed, and when it is detected that a certain type of information in the public information has changed, analyze the first target information and the second target information in real time Update, which can timely monitor the change of the target information required to build the form component and update the change in real time, which improves the real-time performance of building the form, further helps to improve the construction efficiency of the form page and reduce the development cost of the form page .

可见,实施图2所描述的方法能够解析预设表单字段配置的UI组件,得到多个元数据,该元数据能够解析为多种UI组件的参数,有利于提高表单页面的构建效率以及灵活性;解析所有元数据得到每一个元数据对应的组件类型,解析对应的组件类型得到每一个元数据对应的第一目标信息,有利于提高表单页面的构建效率以及准确率;最后向UI组件传入对应的第一目标信息以使UI组件生成对应的表单组件,使功能各异的表单组件生成的方式动态化,从而有利于提高表单页面的构建效率以及降低表单页面的开发成本;还能够实时地检测元数据解析得到的公共信息是否改变,当检测到公共信息中的某一种信息发生改变时,实时地对第一目标信息以及第二目标信息进行解析更新,能够及时地监测构建表单组件所需的目标信息的变更并对其变更进行实时地更新,提高了构建表单的是实时性,进一步有利于提高表单页面的构建效率以及降低表单页面的开发成本。It can be seen that the implementation of the method described in Figure 2 can analyze the UI components of the preset form field configuration, and obtain multiple metadata, which can be parsed into parameters of various UI components, which is conducive to improving the efficiency and flexibility of form page construction ; Parse all metadata to get the component type corresponding to each metadata, and parse the corresponding component type to get the first target information corresponding to each metadata, which is conducive to improving the construction efficiency and accuracy of the form page; finally, pass it to the UI component The corresponding first target information enables UI components to generate corresponding form components, making the way of generating form components with different functions dynamic, which is conducive to improving the construction efficiency of form pages and reducing the development cost of form pages; it can also real-time Detect whether the public information obtained by metadata analysis has changed. When a certain type of information in the public information is detected to change, it will analyze and update the first target information and the second target information in real time, and can timely monitor the information generated by the form component. The change of the required target information is updated in real time, which improves the real-time performance of building the form, further helps to improve the construction efficiency of the form page and reduce the development cost of the form page.

实施例三Embodiment Three

请参阅图3,图3是本发明实施例公开的一种基于Vue的动态表单构建装置的结构示意图。其中,图3所描述的基于Vue的动态表单构建装置可以执行上述基于Vue的动态表单构建方法,该装置可以应用于本地终端设备或移动终端设备的应用程序中。其中,本地终端设备可以包括PC终端、本地服务器等,移动终端设备可以包括智能手机(Android手机、iOS手机)、平板电脑、掌上电脑、个人数字助理(Personal Digital Assistant,PDA)、智能导航仪以及移动互联网设备(Mobile Internet Devices,MID)等中的至少一种,本发明实施例不做限定。如图3所示,该装置可以包括:解析模块301、传入模块302,其中:Please refer to FIG. 3 . FIG. 3 is a schematic structural diagram of a Vue-based dynamic form construction device disclosed in an embodiment of the present invention. Wherein, the Vue-based dynamic form construction device described in FIG. 3 can execute the above-mentioned Vue-based dynamic form construction method, and the device can be applied to an application program of a local terminal device or a mobile terminal device. Among them, the local terminal equipment can include PC terminals, local servers, etc., and the mobile terminal equipment can include smart phones (Android mobile phones, iOS mobile phones), tablet computers, handheld computers, personal digital assistants (Personal Digital Assistant, PDA), intelligent navigators and At least one of Mobile Internet Devices (Mobile Internet Devices, MID), etc., which is not limited in this embodiment of the present invention. As shown in Figure 3, the device may include: a parsing module 301, an incoming module 302, wherein:

解析模块301,用于解析通过表单字段配置的UI组件,得到所有UI组件的元数据集合,元数据集合包括多个元数据,每一个元数据与每一个UI组件相对应;The parsing module 301 is configured to parse the UI components configured through the form fields to obtain the metadata collection of all UI components, the metadata collection includes multiple metadata, and each metadata corresponds to each UI component;

解析模块301,还用于解析元数据集合中的所有元数据,得到每一个元数据对应的组件类型。The parsing module 301 is further configured to parse all the metadata in the metadata set to obtain the component type corresponding to each piece of metadata.

解析模块301,还用解析每一个元数据对应的组件类型,得到每一个元数据对应的第一目标信息。The parsing module 301 further obtains the first target information corresponding to each metadata by parsing the component type corresponding to each metadata.

传入模块302,用于向对应的UI组件传入解析模块301解析得到的与UI组件相匹配的第一目标信息,以触发UI组件根据第一目标信息生成对应的表单组件。The importing module 302 is configured to transfer to the corresponding UI component the first target information that is parsed by the parsing module 301 and matches the UI component, so as to trigger the UI component to generate a corresponding form component according to the first target information.

可见,实施图3所描述的基于Vue的动态表单构建装置通过解析预设表单字段配置的UI组件,得到多个元数据,该元数据能够解析为多种UI组件的参数,有利于提高表单页面的构建效率以及灵活性;解析所有元数据得到每一个元数据对应的组件类型,解析对应的组件类型得到每一个元数据对应的第一目标信息,有利于提高表单页面的构建效率以及准确率;最后向UI组件传入对应的第一目标信息以使UI组件生成对应的表单组件,使功能各异的表单组件生成的方式动态化,从而有利于提高表单页面的构建效率以及降低表单页面的开发成本。It can be seen that implementing the Vue-based dynamic form construction device described in Figure 3 obtains multiple metadata by parsing the UI components configured by the preset form fields, and the metadata can be parsed into parameters of various UI components, which is conducive to improving the form page. construction efficiency and flexibility; parse all metadata to get the component type corresponding to each metadata, and parse the corresponding component type to get the first target information corresponding to each metadata, which is conducive to improving the construction efficiency and accuracy of form pages; Finally, the corresponding first target information is passed to the UI component to enable the UI component to generate the corresponding form component, making the generation of form components with different functions dynamic, which is conducive to improving the construction efficiency of the form page and reducing the development of the form page cost.

在一个可选的实施例中,UI组件为基于Vue开发的前端组件,Vue的架构版本为Vue2.0。In an optional embodiment, the UI component is a front-end component developed based on Vue, and the architecture version of Vue is Vue2.0.

以及,如图4所示,解析模块301解析每一个元数据对应的组件类型,得到每一个元数据对应的第一目标信息的具体方式为:And, as shown in FIG. 4 , the parsing module 301 parses the component type corresponding to each metadata, and obtains the first target information corresponding to each metadata in a specific manner as follows:

通过与对应的组件类型相匹配的数据解析器解析每一个元数据对应的组件类型,得到每一个元数据对应的第一目标信息。The component type corresponding to each piece of metadata is parsed by a data parser that matches the corresponding component type, and the first target information corresponding to each piece of metadata is obtained.

其中,第一目标信息包括:第一标识信息、第一参数信息。Wherein, the first target information includes: first identification information and first parameter information.

可见,实施图4所描述的基于Vue的动态表单构建装置通过预设表单字段配置好的表单解析得到对应的多个不同类型的元数据,解析得到的元数据越丰富与详细,越有利于提高表单页面的构建效率以及降低表单页面的开发成本;通过特定对应的组件类型解析器解析每一个元数据对应的组件类型得到对应的第一目标信息,且每一个元数据对应唯一的一个元数据,提高了表单页面的构建准确性,从而有利于提高表单页面的构建效率以及降低表单页面的开发成本。It can be seen that implementing the Vue-based dynamic form construction device described in Figure 4 can obtain multiple different types of metadata corresponding to the configured form analysis of the preset form fields. The richer and more detailed the metadata obtained by the analysis, the more conducive to improving The construction efficiency of the form page and the reduction of the development cost of the form page; the component type corresponding to each metadata is parsed by a specific corresponding component type parser to obtain the corresponding first target information, and each metadata corresponds to a unique piece of metadata, The construction accuracy of the form page is improved, thereby helping to improve the construction efficiency of the form page and reduce the development cost of the form page.

在另一个可选的实施例中,在解析模块301解析元数据集合中的所有元数据,得到每一个元数据对应的组件类型之后,该装置还包括:In another optional embodiment, after the parsing module 301 parses all metadata in the metadata set to obtain the component type corresponding to each metadata, the device further includes:

遍历模块303,遍历元数据集合。The traversal module 303 traverses the metadata collection.

解析模块301,还用于解析遍历模块303遍历得到的元数据集合中的所有元数据,得到每一个元数据对应的公共信息。The parsing module 301 is further configured to parse and traverse all metadata in the metadata set obtained by traversing the traversal module 303 to obtain public information corresponding to each metadata.

解析模块301,还用于解析每一个元数据对应的公共信息,得述每一个元数据对应的第二目标信息。The analyzing module 301 is further configured to analyze the public information corresponding to each metadata, and obtain the second target information corresponding to each metadata.

其中,每一个元数据对应的公共信息,包括:Among them, the public information corresponding to each metadata includes:

每一个元数据对应每一个UI组件的组件类型、是否只读、是否可编辑、组件值、字段名称中的至少一种公共信息。Each piece of metadata corresponds to at least one public information among the component type, read-only, editable, component value, and field name of each UI component.

第二目标信息包括:第二标识信息、第二参数信息。The second target information includes: second identification information and second parameter information.

可见,实施图4所描述的基于Vue的动态表单构建装置解析元数据得到对应的公共信息,并根据对应的多种公共信息解析得到元数据对应的多种第二目标信息,这样解析得到的第二目标信息越丰富与详细,越有利于提高表单页面的构建效率以及降低表单页面的开发成本。It can be seen that implementing the Vue-based dynamic form construction device described in Figure 4 parses the metadata to obtain the corresponding public information, and analyzes the corresponding multiple public information to obtain various second target information corresponding to the metadata. 2. The richer and more detailed the target information is, the more beneficial it is to improve the construction efficiency of the form page and reduce the development cost of the form page.

在又一个可选的实施例中,如图4所示,传入模块302向对应的UI组件传入与UI组件相匹配的第一目标信息,以触发UI组件根据第一目标信息生成对应的表单组件的具体方式为:In yet another optional embodiment, as shown in FIG. 4 , the input module 302 transmits the first target information matching the UI component to the corresponding UI component, so as to trigger the UI component to generate the corresponding target information according to the first target information. The specific method of the form component is:

通过Vue的component组件向对应的UI组件传入与UI组件相匹配的第一目标信息,以触发UI组件根据第一目标信息生成对应的表单组件。Pass the first target information matching the UI component to the corresponding UI component through the component component of Vue, so as to trigger the UI component to generate the corresponding form component according to the first target information.

可见,实施图4所描述的基于Vue的动态表单构建装置通过Vue的component组件向对应的UI组件传入与UI组件相匹配的第一目标信息,使UI组件根据第一目标信息生成对应的表单组件,有利于提高表单页面的构建准确率,从而有利于提高表单页面的构建效率以及降低表单页面的开发成本。It can be seen that implementing the Vue-based dynamic form construction device described in Figure 4 passes the first target information matching the UI component to the corresponding UI component through the Vue component component, so that the UI component generates the corresponding form according to the first target information Components are beneficial to improve the accuracy of form page construction, thereby improving the construction efficiency of form pages and reducing the development cost of form pages.

在又一个可选的实施例中,如图4所示,解析模块301解析通过表单字段配置的UI组件,得到所有UI组件的元数据集合的具体方式为:In yet another optional embodiment, as shown in FIG. 4 , the parsing module 301 parses the UI components configured through the form fields, and obtains the metadata collection of all UI components in a specific manner as follows:

解析通过预设的表单字段与组件参数配置的UI组件,得到所有UI组件的元数据集合;Analyze the UI components configured through the preset form fields and component parameters, and get the metadata collection of all UI components;

解析模块301解析每一个元数据对应的公共信息,得到每一个元数据对应的第二目标信息的具体方式为:The parsing module 301 parses the public information corresponding to each metadata, and the specific way to obtain the second target information corresponding to each metadata is as follows:

解析每一个元数据对应的是否只读、是否可编辑、组件值、字段名称的公共信息,得到每一个元数据对应的第二目标信息。The public information corresponding to each metadata is read-only, editable, component value, field name, and the second target information corresponding to each metadata is obtained.

传入模块302,还用于通过Vue的component组件向对应的UI组件传入与UI组件相匹配的第二目标信息,以触发UI组件根据目标信息初始化对应的表单组件的组件属性,组件属性用于初始化表单组件的功能属性。The incoming module 302 is also used to pass in the second target information matching the UI component to the corresponding UI component through the component component of Vue, so as to trigger the UI component to initialize the component attribute of the corresponding form component according to the target information. The component attribute uses Functional properties for initializing form components.

可见,实施图4所描述的基于Vue的动态表单构建装置通过解析元数据得到对应的公共信息,并根据对应的公共信息解析得到元数据对应的第二目标信息,该第二目标信息还能够使UI组件初始化功能属性,提高表单组件生成的自动化,进一步有利于从而有利于提高表单页面的构建效率以及降低表单页面的开发成本。It can be seen that the implementation of the Vue-based dynamic form construction device described in Figure 4 obtains the corresponding public information by parsing the metadata, and obtains the second target information corresponding to the metadata according to the parsing of the corresponding public information. The second target information can also make the The UI component initializes functional attributes and improves the automation of form component generation, which is further beneficial to improving the construction efficiency of the form page and reducing the development cost of the form page.

在又一个可选的实施例中,如图4所示,在传入模块302通过Vue的component组件向对应的UI组件传入与UI组件相匹配的第二目标信息之前,该装置还包括:In yet another optional embodiment, as shown in FIG. 4, before the input module 302 transmits the second target information matching the UI component to the corresponding UI component through the component component of Vue, the device further includes:

判断模块304,用于判断解析模块301解析得到的UI组件对应的第一目标信息中的第一标识信息与第二目标信息中的第二标识信息是否相匹配,若判断到UI组件对应的第一标识信息与第二标识信息相匹配时,触发传入模块302执行通过Vue的component组件向对应的UI组件传入与UI组件相匹配的第二目标信息的操作;若判断到UI组件对应的第一标识信息与第二标识信息不相匹配时,触发解析模块301执行解析每一个元数据对应的是否只读、是否可编辑、组件值、字段名称的公共信息,得到每一个元数据对应的第二目标信息的操作。A judging module 304, configured to judge whether the first identification information in the first target information corresponding to the UI component parsed by the parsing module 301 matches the second identification information in the second target information; When the first identification information matches the second identification information, trigger the input module 302 to execute the operation of passing the second target information matching the UI component to the corresponding UI component through the component component of Vue; if it is determined that the corresponding UI component When the first identification information does not match the second identification information, the parsing module 301 is triggered to analyze the public information corresponding to each metadata, whether it is read-only, whether it can be edited, component values, and field names, and obtains the public information corresponding to each metadata. Operation of the second target information.

第一更新模块305,用于更新解析模块301解析得到的第二目标信息。The first update module 305 is configured to update the second target information analyzed by the analysis module 301 .

可见,实施图4所描述的基于Vue的动态表单构建装置通过实时地判断公共信息解析得到对应的第二标识信息与第一标识信息是否相匹配,当判断到两者不相匹配时,对解析出的公共信息进行重新解析,得到新的第二目标信息,并对错误的第二目标信息进行实时地更新,能够快速地检测并修复错误的构建信息,进一步有利于提高表单页面的构建效率以及准确率。It can be seen that implementing the Vue-based dynamic form construction device described in FIG. 4 judges in real time whether the corresponding second identification information obtained by parsing the public information matches the first identification information. When it is judged that the two do not match, the parsing Re-analyze the public information to obtain new second target information, and update the wrong second target information in real time, which can quickly detect and repair wrong construction information, and further help to improve the construction efficiency of form pages and Accuracy.

在又一个可选的实施例中,该装置还包括:In another optional embodiment, the device also includes:

检测模块306,用于检测解析模块301解析得到的公共信息是否改变。The detection module 306 is configured to detect whether the public information parsed by the parsing module 301 has changed.

第二更新模块307,用于当检测模块306检测到公共信息中的某一种信息发生改变时,根据改变后的公共信息更新第一目标信息与第二目标信息。The second update module 307 is configured to update the first target information and the second target information according to the changed public information when the detection module 306 detects that a certain type of information in the public information changes.

传入模块302,还用于通过Vue的component组件向对应的UI组件传入第二更新模块更新后的第一目标信息与更新后的第二目标信息,以触发UI组件根据更新后的第一目标信息与更新后的第二目标信息生成对应的表单组件。The incoming module 302 is also used to pass in the updated first target information and the updated second target information of the second update module to the corresponding UI component through the component component of Vue, so as to trigger the UI component according to the updated first target information. A form component corresponding to the target information and the updated second target information is generated.

可见,实施图4所描述的基于Vue的动态表单构建装置通过实时地检测元数据解析得到的公共信息是否改变,当检测到公共信息中的某一种信息发生改变时,实时地对第一目标信息以及第二目标信息进行解析更新,能够及时地监测构建表单组件所需的目标信息的变更并对其变更进行实时地更新,提高了构建表单的是实时性,进一步有利于提高表单页面的构建效率以及降低表单页面的开发成本。It can be seen that the implementation of the Vue-based dynamic form construction device described in Figure 4 detects whether the public information obtained by metadata analysis has changed in real time, and when a change in a certain type of public information is detected, the first target Information and the second target information are analyzed and updated, which can timely monitor the change of the target information required to build the form component and update the change in real time, which improves the real-time performance of building the form and further helps to improve the construction of the form page Efficiency and reduced development costs for form pages.

实施例四Embodiment Four

请参阅图5,图5是本发明实施例公开的一种基于Vue的动态表单构建装置的结构示意图。其中,图5所描述的基于Vue的动态表单构建装置可以执行上述基于Vue的动态表单构建方法,该装置可以应用于本地终端设备或移动终端设备的应用程序中。其中,本地终端设备可以包括PC终端、本地服务器等,移动终端设备可以包括智能手机(Android手机、iOS手机)、平板电脑、掌上电脑、个人数字助理(Personal Digital Assistant,PDA)、智能导航仪以及移动互联网设备(Mobile Internet Devices,MID)等中的至少一种,本发明实施例不做限定。如图5所示,该装置可以包括:Please refer to FIG. 5 . FIG. 5 is a schematic structural diagram of a Vue-based dynamic form construction device disclosed in an embodiment of the present invention. Wherein, the Vue-based dynamic form construction device described in FIG. 5 can execute the above-mentioned Vue-based dynamic form construction method, and the device can be applied to an application program of a local terminal device or a mobile terminal device. Among them, the local terminal equipment can include PC terminals, local servers, etc., and the mobile terminal equipment can include smart phones (Android mobile phones, iOS mobile phones), tablet computers, handheld computers, personal digital assistants (Personal Digital Assistant, PDA), intelligent navigators and At least one of Mobile Internet Devices (Mobile Internet Devices, MID), etc., which is not limited in this embodiment of the present invention. As shown in Figure 5, the device may include:

存储有可执行程序代码的存储器501;A memory 501 storing executable program codes;

与存储器501耦合的处理器502;a processor 502 coupled to the memory 501;

进一步的,还可以包括与处理器502耦合的输入接口503和输出接口504;Further, an input interface 503 and an output interface 504 coupled with the processor 502 may also be included;

其中,处理器502调用存储器501中存储的可执行程序代码,执行本发明实施例一或实施例二所公开的基于Vue的动态表单构建方法中部分或者全部的步骤。Wherein, the processor 502 invokes the executable program code stored in the memory 501 to execute some or all of the steps in the Vue-based dynamic form construction method disclosed in Embodiment 1 or Embodiment 2 of the present invention.

实施例五Embodiment five

本发明实施例公开了一种计算机可存储介质,该计算机可存储介质存储有计算机指令,该计算机指令被调用时,用于执行本发明实施例一或实施例二所公开的基于Vue的动态表单构建方法中部分或者全部的步骤。The embodiment of the present invention discloses a computer-storage medium, the computer-storage medium stores computer instructions, and when the computer instructions are called, it is used to execute the Vue-based dynamic form disclosed in the first or second embodiment of the present invention Build some or all of the steps in the method.

以上所描述的装置实施例仅是示意性的,其中作为分离部件说明的模块可以是或者也可以不是物理上分开的,作为模块展示的部件可以是或者也可以不是物理模块,即可以位于一个地方,或者也可以分布到多个网络模块上。可以根据实际的需要选择其中的部分或者全部模块来实现本实施例方案的目的。本领域普通技术人员在不付出创造性的劳动的情况下,即可以理解并实施。The device embodiments described above are only illustrative, and the modules described as separate components may or may not be physically separated, and the components shown as modules may or may not be physical modules, that is, they may be located in one place , or can also be distributed to multiple network modules. Part or all of the modules can be selected according to actual needs to achieve the purpose of the solution of this embodiment. It can be understood and implemented by those skilled in the art without any creative effort.

通过以上的实施例的具体描述,本领域的技术人员可以清楚地了解到各实施方式可借助软件加必需的通用硬件平台的方式来实现,当然也可以通过硬件。基于这样的理解,上述技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品可以存储在计算机可读存储介质中,存储介质包括只读存储器(Read-Only Memory,ROM)、随机存储器(Random Access Memory,RAM)、可编程只读存储器(Programmable Read-only Memory,PROM)、可擦除可编程只读存储器(ErasableProgrammable Read Only Memory,EPROM)、一次可编程只读存储器(One-timeProgrammable Read-Only Memory,OTPROM)、电子抹除式可复写只读存储器(Electrically-Erasable Programmable Read-Only Memory,EEPROM)、只读光盘(CompactDisc Read-Only Memory,CD-ROM)或其他光盘存储器、磁盘存储器、磁带存储器,或者能够用于携带或存储数据的计算机可读的任何其他介质。Through the specific description of the above embodiments, those skilled in the art can clearly understand that each implementation manner can be implemented by means of software plus a necessary general-purpose hardware platform, and of course also by hardware. Based on this understanding, the above-mentioned technical solution essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, and the storage medium includes a read-only memory (Read-Only Memory, ROM), random access memory (Random Access Memory, RAM), programmable read-only memory (Programmable Read-only Memory, PROM), erasable programmable read-only memory (Erasable Programmable Read Only Memory, EPROM) , One-time Programmable Read-Only Memory (OTPROM), Electronically Erasable Programmable Read-Only Memory (EEPROM), Compact Disc Read-Only Memory , CD-ROM) or other optical disk storage, magnetic disk storage, magnetic tape storage, or any other computer-readable medium that can be used to carry or store data.

最后应说明的是:本发明实施例公开的一种基于Vue的动态表单构建方法及装置所揭露的仅为本发明较佳实施例而已,仅用于说明本发明的技术方案,而非对其限制;尽管参照前述实施例对本发明进行了详细的说明,本领域的普通技术人员应当理解;其依然可以对前述各项实施例所记载的技术方案进行修改,或者对其中部分技术特征进行等同替换;而这些修改或替换,并不使相应的技术方案的本质脱离本发明各项实施例技术方案的精神和范围。Finally, it should be noted that: the Vue-based dynamic form construction method and device disclosed in the embodiment of the present invention are only the preferred embodiments of the present invention, and are only used to illustrate the technical solutions of the present invention, not to Restrictions; Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that it is still possible to modify the technical solutions described in the foregoing embodiments, or perform equivalent replacements for some of the technical features However, these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the various embodiments of the present invention.

Claims (10)

1. A dynamic form construction method based on Vue, the method comprising:
analyzing UI components configured through a preset form field to obtain metadata sets of all the UI components, wherein each metadata set comprises a plurality of metadata, and each metadata corresponds to each UI component;
analyzing all metadata in the metadata set to obtain the component type corresponding to each metadata;
analyzing the component type corresponding to each piece of metadata to obtain first target information corresponding to each piece of metadata;
And transmitting first target information matched with the UI component to the corresponding UI component so as to trigger the UI component to generate a corresponding form component according to the first target information.
2. The dynamic form construction method based on the Vue according to claim 1, wherein the UI component is a front-end component developed based on the Vue, and the architecture version of the Vue is Vue2.0;
the analyzing the component type corresponding to each piece of metadata to obtain the first target information corresponding to each piece of metadata includes:
analyzing the component type corresponding to each piece of metadata through a data analyzer matched with the corresponding component type to obtain first target information corresponding to each piece of metadata;
wherein the first target information includes: first identification information and first parameter information.
3. The dynamic Vue-based form construction method of claim 2, wherein,
after parsing all metadata in the metadata set to obtain the component type corresponding to each metadata, the method further includes:
traversing the metadata set and analyzing all metadata in the metadata set to obtain public information corresponding to each piece of metadata;
Analyzing the public information corresponding to each piece of metadata to obtain second target information corresponding to each piece of metadata;
wherein, the public information corresponding to each metadata includes:
each metadata corresponds to at least one common information of the component type, whether read-only, editable, component value and field name of each UI component;
the second target information includes: second identification information and second parameter information.
4. The dynamic form construction method based on Vue according to claim 3, wherein the step of transmitting first target information matched with the UI component to the corresponding UI component to trigger the UI component to generate the corresponding form component according to the first target information includes:
and transmitting first target information matched with the UI component to the corresponding UI component through the component of the Vue so as to trigger the UI component to generate a corresponding form component according to the first target information.
5. The dynamic form construction method based on Vue according to claim 3 or 4, wherein the parsing the UI components configured by the form field to obtain metadata sets of all the UI components includes:
Analyzing UI components configured through preset form fields and component parameters to obtain metadata sets of all the UI components;
the analyzing the public information corresponding to each piece of metadata to obtain second target information corresponding to each piece of metadata includes:
analyzing the public information of whether the metadata is read-only or editable, the component value and the field name, and obtaining second target information corresponding to each metadata;
the method further comprises the steps of:
and transmitting second target information matched with the UI component to the corresponding UI component through the component of the Vue so as to trigger the UI component to initialize component attributes of the corresponding form component according to the target information, wherein the component attributes are used for initializing functional attributes of the form component.
6. The method for dynamically constructing a form based on Vue according to claim 5, wherein before the second target information matched with the UI component is transferred to the corresponding UI component through the component of Vue, the method further comprises:
judging whether first identification information in first target information corresponding to the UI component is matched with second identification information in second target information or not;
If the first identification information corresponding to the UI component is judged to be matched with the second identification information, triggering and executing the operation of transmitting second target information matched with the UI component to the corresponding UI component through the component of the Vue;
and if the first identification information corresponding to the UI component is not matched with the second identification information, triggering and executing the analysis of the public information of whether read-only, editable, component values and field names corresponding to each piece of metadata to obtain the operation of the second target information corresponding to each piece of metadata, and updating the second target information.
7. The Vue-based dynamic form construction method of claim 3 or 6, further comprising:
detecting whether the public information is changed;
when detecting that one of the public information is changed, updating the first target information and the second target information according to the changed public information;
and transmitting the updated first target information and the updated second target information to the corresponding UI component through the component of the Vue so as to trigger the UI component to generate a corresponding form component according to the updated first target information and the updated second target information.
8. A Vue-based dynamic form building apparatus, the apparatus comprising:
the analysis module is used for analyzing the UI components configured through the form field to obtain metadata sets of all the UI components, wherein the metadata sets comprise a plurality of metadata, and each metadata corresponds to each UI component;
the analysis module is further configured to analyze all metadata in the metadata set to obtain a component type corresponding to each metadata;
the analysis module is used for analyzing the component type corresponding to each piece of metadata to obtain first target information corresponding to each piece of metadata;
and the input module is used for inputting the first target information which is obtained by analysis by the analysis module and is matched with the UI component into the corresponding UI component so as to trigger the UI component to generate a corresponding form component according to the first target information.
9. A Vue-based dynamic form building apparatus, the apparatus comprising:
a memory storing executable program code;
a processor coupled to the memory;
the processor invokes the executable program code stored in the memory to perform the Vue-based dynamic form construction method of any one of claims 1-7.
10. A computer storage medium storing computer instructions which when invoked are used to perform the Vue-based dynamic form construction method of any one of claims 1-7.
CN202211708734.6A 2022-12-29 2022-12-29 Dynamic form construction method and device based on Vue Pending CN116069324A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211708734.6A CN116069324A (en) 2022-12-29 2022-12-29 Dynamic form construction method and device based on Vue

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211708734.6A CN116069324A (en) 2022-12-29 2022-12-29 Dynamic form construction method and device based on Vue

Publications (1)

Publication Number Publication Date
CN116069324A true CN116069324A (en) 2023-05-05

Family

ID=86181438

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211708734.6A Pending CN116069324A (en) 2022-12-29 2022-12-29 Dynamic form construction method and device based on Vue

Country Status (1)

Country Link
CN (1) CN116069324A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117519889A (en) * 2024-01-05 2024-02-06 北京中盈安信技术服务股份有限公司 Form component switching method and device, storage medium and electronic equipment

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6493704B1 (en) * 1999-09-13 2002-12-10 Oracle Corporation Method and apparatus for using metadata to dynamically generate a display page to solicit input from a user
CN112199626A (en) * 2020-11-06 2021-01-08 南威软件股份有限公司 Dynamic form generation method based on DSL layout engine
CN113760251A (en) * 2020-11-09 2021-12-07 北京沃东天骏信息技术有限公司 Form development method and device based on Vue
CN113935298A (en) * 2021-10-13 2022-01-14 百融云创科技股份有限公司 A form page design method and system for user-defined metadata
CN115238218A (en) * 2022-09-26 2022-10-25 北京美络克思科技有限公司 Webpage design method and webpage design device
CN115495075A (en) * 2022-09-21 2022-12-20 平安银行股份有限公司 Configuration interface generation method and system and computer equipment

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6493704B1 (en) * 1999-09-13 2002-12-10 Oracle Corporation Method and apparatus for using metadata to dynamically generate a display page to solicit input from a user
CN112199626A (en) * 2020-11-06 2021-01-08 南威软件股份有限公司 Dynamic form generation method based on DSL layout engine
CN113760251A (en) * 2020-11-09 2021-12-07 北京沃东天骏信息技术有限公司 Form development method and device based on Vue
CN113935298A (en) * 2021-10-13 2022-01-14 百融云创科技股份有限公司 A form page design method and system for user-defined metadata
CN115495075A (en) * 2022-09-21 2022-12-20 平安银行股份有限公司 Configuration interface generation method and system and computer equipment
CN115238218A (en) * 2022-09-26 2022-10-25 北京美络克思科技有限公司 Webpage design method and webpage design device

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117519889A (en) * 2024-01-05 2024-02-06 北京中盈安信技术服务股份有限公司 Form component switching method and device, storage medium and electronic equipment
CN117519889B (en) * 2024-01-05 2024-03-29 北京中盈安信技术服务股份有限公司 Form component switching method and device, storage medium and electronic equipment

Similar Documents

Publication Publication Date Title
RU2722692C1 (en) Method and system for detecting malicious files in a non-isolated medium
CN107292170B (en) Method, device and system for detecting SQL injection attack
CN112800427B (en) Webshell detection method and device, electronic equipment and storage medium
CN110532176A (en) A kind of formalization verification method, electronic device and the storage medium of intelligence contract
US20190095318A1 (en) Test-assisted application programming interface (api) learning
CN106295346B (en) Application vulnerability detection method and device and computing equipment
CN114430335B (en) Web fingerprint matching method and device
CN111092894A (en) Webshell detection method based on incremental learning, terminal device and storage medium
CN111694746A (en) Flash defect fuzzy evaluation tool for compilation type language AS3
CN117407288B (en) Test case recommendation method based on FPGA (field programmable Gate array) test platform
CN117725592A (en) A smart contract vulnerability detection method based on directed graph attention network
CN114116510A (en) A kind of interface parameter verification method and device
CN110287700B (en) An iOS application security analysis method and device
CN114969762A (en) Vulnerability information processing method, service device and vulnerability detection module
CN114201756A (en) Vulnerability detection method and related device for intelligent contract code segment
CN115587364B (en) Firmware vulnerability input point location method and device based on front-end and back-end correlation analysis
CN116069324A (en) Dynamic form construction method and device based on Vue
CN110175128B (en) Similar code case acquisition method, device, equipment and storage medium
Utkin et al. Evaluating the impact of source code parsers on ML4SE models
CN114036353A (en) Data packet matching method, device, electronic device and storage medium
CN114817920A (en) Source code positioning detection method, system, electronic equipment and storage medium
CN114386402A (en) Statement review method, device, computer equipment and storage medium
CN115292178A (en) Test data searching method, device, storage medium and terminal
CN115412274A (en) Attack tracing method and related data processing and association display method and device
CN113742192A (en) Log rule quality analysis method, system, electronic device and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination