CN107704239B - Configuration generation method and device and electronic equipment - Google Patents

Configuration generation method and device and electronic equipment Download PDF

Info

Publication number
CN107704239B
CN107704239B CN201710930366.2A CN201710930366A CN107704239B CN 107704239 B CN107704239 B CN 107704239B CN 201710930366 A CN201710930366 A CN 201710930366A CN 107704239 B CN107704239 B CN 107704239B
Authority
CN
China
Prior art keywords
configuration
template
attribute information
class
creating
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.)
Active
Application number
CN201710930366.2A
Other languages
Chinese (zh)
Other versions
CN107704239A (en
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.)
Wuhan Qianxing Science And Technology Co ltd
Original Assignee
Wuhan Douyu Network Technology 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 Wuhan Douyu Network Technology Co Ltd filed Critical Wuhan Douyu Network Technology Co Ltd
Priority to CN201710930366.2A priority Critical patent/CN107704239B/en
Publication of CN107704239A publication Critical patent/CN107704239A/en
Application granted granted Critical
Publication of CN107704239B publication Critical patent/CN107704239B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/31Programming languages or programming paradigms
    • G06F8/315Object-oriented languages

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computing Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Stored Programmes (AREA)

Abstract

The embodiment of the invention provides a configuration generation method, a configuration generation device and electronic equipment, wherein the method comprises the following steps: packaging the configuration objects corresponding to the attribute information in the EChats into class templates, wherein the class templates contain template objects corresponding to the configuration objects in the EChats; creating an instance of the class template, and generating a modification panel of attribute information corresponding to each configuration object according to each configuration object in the instance; modifying and defining the template objects corresponding to the attribute information in the EChats according to the modification panel; responding to the user operation, and creating configuration information corresponding to the user operation according to each template object after the definition is modified; and converting the configuration information into a character string, and storing the converted character string. The configuration generation scheme provided by the invention can provide a unified and centralized mode to realize the function of modifying the EChats configuration by packaging and defining the configuration object, realize the unification and reusability of the EChats configuration and further simplify the development process.

Description

Configuration generation method and device and electronic equipment
Technical Field
The invention relates to the technical field of computers, in particular to a configuration generation method and device and electronic equipment.
Background
The ECharts is a relatively common open source chart class library, and in the current development process, each page using the ECharts basically needs to regenerate the configuration of the ECharts and is configured attribute by attribute, so that a large amount of repeated work and code redundancy are caused, great inconvenience is brought to the development and maintenance work of a project, and the development and maintenance efficiency and the page operation efficiency are further reduced.
Disclosure of Invention
In view of the above, the present invention provides a configuration generation method, an apparatus and an electronic device to solve the above problem.
The preferred embodiment of the present invention provides a configuration generation method, including:
packaging the configuration objects corresponding to the attribute information in the EChats into class templates, wherein the class templates contain template objects corresponding to the configuration objects in the EChats;
creating an instance of the class template, and generating a modification panel of attribute information corresponding to each configuration object according to each configuration object in the instance;
modifying and defining the template objects corresponding to the attribute information in the EChats according to the modification panel;
responding to the user operation, and creating configuration information corresponding to the user operation according to each template object after the definition is modified;
and converting the configuration information into a character string, and storing the converted character string.
Further, the step of creating an instance of the class template and generating a modification panel of attribute information corresponding to each configuration object according to each configuration object in the instance includes:
creating an example of the class template, traversing each configuration object in the example, and generating an ECharts grid system;
rendering the grid system and generating a modification panel of the attribute information corresponding to each configuration object.
Further, the step of modifying and defining the template object corresponding to each attribute information in the ECharts according to the modification panel includes:
modifying and defining the template object of the attribute information to be modified selected from the modification panel and mapping the template object into a corresponding React component;
and adding the mapped React component into the page.
Further, the step of encapsulating the configuration objects corresponding to the attribute information in the ECharts as class templates includes:
extracting attribute information for configuration in the EChats, and acquiring a corresponding configuration object according to the attribute information;
and packaging the configuration objects into class templates, and adding template objects corresponding to the configuration objects to the class templates according to the API and the service division of the ECharts.
Further, the step of creating, in response to the user operation, configuration information corresponding to the user operation according to each template object after the definition is modified includes:
responding to user operation, and creating an instance object of the class template according to the user operation;
obtaining a template object corresponding to the user operation by calling a creating function corresponding to the user operation in the class template;
and inserting the obtained template object into a root object of the instance object of the class template so as to complete the creation of the configuration information corresponding to the user operation.
Further, the step of converting the configuration information into a character string and transmitting and storing the converted character string includes:
converting the configuration information into a JSON character string through a JSON.stringiness function, and storing the converted JSON character string into a database through a provided interface.
Another preferred embodiment of the present invention provides a configuration generating apparatus, including:
the encapsulation module is used for encapsulating the configuration objects corresponding to the attribute information in the EChats into class templates, and the class templates contain template objects corresponding to the configuration objects in the EChats;
the generation module is used for creating an example of the class template and generating a modification panel of the attribute information corresponding to each configuration object according to each configuration object in the example;
the modification definition module is used for modifying and defining the template objects corresponding to the attribute information in the EChats according to the modification panel;
the creation module is used for responding to user operation and creating configuration information corresponding to the user operation according to each template object after the definition is modified;
and the conversion module is used for converting the configuration information into character strings and storing the converted character strings.
Further, the generation module comprises a grid system generation unit and a rendering unit;
the grid system generating unit is used for creating an example of the class template, traversing each configuration object in the example and generating an ECharts grid system;
and the rendering unit is used for rendering the grid system and generating a modification panel of the attribute information corresponding to each configuration object.
Another preferred embodiment of the present invention further provides an electronic device, including:
a memory;
a processor; and
a configuration generation device installed in the memory and including one or more software functional modules executed by the processor.
Another preferred embodiment of the present invention also provides a computer storage medium having a computer program stored thereon, which when executed by a processor implements the configuration generating method described above.
The embodiment of the invention provides a configuration generation method, a configuration generation device and electronic equipment. And modifying and defining the template objects corresponding to the attribute information in the EChats according to the modification panel. This provides a uniform and centralized way to implement the functionality of modifying the ECharts configuration. When a user carries out modification operation, corresponding configuration information is created according to the modification operation of the user, and the configuration information is serialized and then transmitted to a database so as to store the configuration information. The configuration generation scheme provided by the invention can realize the unification and the reusability of the ECharts configuration by encapsulating and defining the configuration objects, thereby further simplifying the development process.
In order to make the aforementioned and other objects, features and advantages of the present invention comprehensible, preferred embodiments accompanied with figures are described in detail below.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings needed to be used in the embodiments will be briefly described below, it should be understood that the following drawings only illustrate some embodiments of the present invention and therefore should not be considered as limiting the scope, and for those skilled in the art, other related drawings can be obtained according to the drawings without inventive efforts.
Fig. 1 is a schematic structural block diagram of an electronic device according to an embodiment of the present invention.
Fig. 2 is a flowchart of a configuration generation method according to an embodiment of the present invention.
Fig. 3 is a flowchart of the substeps of step S101 in fig. 2.
Fig. 4 is a flowchart of the substeps of step S103 in fig. 2.
Fig. 5 is a flowchart of the substeps of step S105 in fig. 2.
Fig. 6 is a flowchart of the substeps of step S107 in fig. 2.
Fig. 7 is a functional block diagram of a configuration generation apparatus according to an embodiment of the present invention.
Fig. 8 is a functional block diagram of a package module according to an embodiment of the present invention.
Fig. 9 is a functional block diagram of a generating module according to an embodiment of the present invention.
Fig. 10 is a functional block diagram of a modification definition module according to an embodiment of the present invention.
Fig. 11 is a functional block diagram of a creating module according to an embodiment of the present invention.
Icon: 100-an electronic device; 110-configuration generation means; 111-packaging the module; 1111-an extraction unit; 1112-a first adding unit; 112-a generation module; 1121-a grid system generating unit; 1122-a rendering unit; 113-modifying the definition module; 1131 — a mapping unit; 1132 — a second adding unit; 114-a creation module; 1141-a creating unit; 1142-a calling unit; 1143-an insertion unit; 115-a conversion module; 120-a processor; 130-memory.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. The components of embodiments of the present invention generally described and illustrated in the figures herein may be arranged and designed in a wide variety of different configurations. Thus, the following detailed description of the embodiments of the present invention, presented in the figures, is not intended to limit the scope of the invention, as claimed, but is merely representative of selected embodiments of the invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments of the present invention without making any creative effort, shall fall within the protection scope of the present invention.
It should be noted that: like reference numbers and letters refer to like items in the following figures, and thus, once an item is defined in one figure, it need not be further defined and explained in subsequent figures. Meanwhile, in the description of the present invention, unless otherwise explicitly specified or limited, the terms "mounted," "disposed," and "connected" are to be construed broadly, e.g., as being fixedly connected, detachably connected, or integrally connected; can be mechanically or electrically connected; they may be connected directly or indirectly through intervening media, or they may be interconnected between two elements. The specific meanings of the above terms in the present invention can be understood in specific cases to those skilled in the art.
Referring to fig. 1, a schematic block diagram of an electronic device 100 according to an embodiment of the invention is shown. In this embodiment, the electronic device 100 includes a configuration generating apparatus 110, a processor 120, and a memory 130. The memory 130 is electrically connected to the processor 120 directly or indirectly, so as to implement data transmission or interaction. The configuration generating device 110 includes at least one software functional module which can be stored in the memory 130 in the form of software or firmware or solidified in the operating system of the electronic device 100. The processor 120 is configured to execute an executable module stored in the memory 130, such as a software functional module or a computer program included in the configuration generation apparatus 110.
Please refer to fig. 2, which is a flowchart illustrating a configuration generating method applied to the electronic device 100 according to an embodiment of the present invention. It should be noted that the method provided by the present invention is not limited by the specific sequence shown in fig. 2 and described below. The respective steps shown in fig. 2 will be described in detail below.
Step S101, packaging the configuration objects corresponding to the attribute information in the ECharts into class templates, wherein the class templates contain template objects corresponding to the configuration objects in the ECharts.
Referring to fig. 3, in the present embodiment, step S101 may include two substeps, step S1011 and step S1013.
Step S1011, extracting attribute information for configuration in the ECharts, and obtaining a corresponding configuration object according to the attribute information.
Step S1013, the configuration objects are packaged into class templates, and template objects corresponding to the configuration objects are added to the class templates according to the API and the service division of the ECharts.
Optionally, in this embodiment, the attribute information that can be used for configuration in the ECharts is extracted according to the related information provided by the ECharts document. Correspondingly, each attribute information has a corresponding configuration object, and the configuration objects are packaged into ES6 type DataTemplate type templates. And adding template objects corresponding to the configuration objects, such as rowTpl template objects and pane tpl template objects, into the template according to Application Program Interfaces (API) of the ECharts and service partitioning. The panel tpl template object mainly includes configuration information corresponding to ECharts and related default values. Thus, the template of the type includes the template object corresponding to each configuration object in the ECharts.
In the embodiment, the configuration objects are packaged into the class of ES6 in a centralized manner, which facilitates introduction and use in the subsequent development process. And the components of the EChats are internally divided according to the service division, so that the subsequent processing according to the needs is facilitated. Thus, in a subsequent scenario that the chart needs to be divided into groups (for example, the chart is displayed in a manner of multiple rows and multiple columns), after the rowTpl is initialized, a local template, such as a panel tpl, can be generated by using a corresponding function derived from an instance of the class template. The function of a row of multiple ECharts charts is achieved by inserting multiple panceltpls into the rowTpl object. Similarly, multi-line presentation ECharts can be implemented by inserting multiple rowTpl templates in an instance of the DataTemplate class.
Step S103, creating an instance of the class template, and generating a modification panel of the attribute information corresponding to each configuration object according to each configuration object in the instance.
Referring to fig. 4, in the present embodiment, step S103 includes two substeps, step S1031 and step S1033.
And step S1031, creating an instance of the class template, traversing each configuration object in the instance, and generating the grid system of the ECharts.
Step S1033, rendering the grid system, and generating a modification panel of the attribute information corresponding to each configuration object.
In this embodiment, after creating an instance of the DataTemplate class template, the instance object needs to be rendered into a corresponding layout. It should be understood that the layout is implemented by row and panel, where row and panel correspond to the rows and columns of the grid layout. Optionally, each configuration object in the instance is traversed, e.g., cycled through row and panel, to generate a grid system of the entire graph. Rendering the grid system and generating a modification panel of the attribute information corresponding to each configuration object.
In the embodiment, the design can be more flexible by using the design of the grid system so as to meet more service scenes. Because the configuration object can comprise a plurality of rows and the rows can also comprise a plurality of panels, the data structure design is more convenient to manage and maintain, on one hand, the data can be inserted more simply and effectively, and on the other hand, the data can be traversed and acquired more quickly.
And step S105, modifying and defining the template objects corresponding to the attribute information in the EChats according to the modification panel.
Referring to fig. 5, in the present embodiment, the step S105 includes two substeps, i.e., a step S1051 and a step S1053.
Step S1051, modifying and defining the template object of the attribute information to be modified selected in the modification panel, and mapping the template object to a corresponding fact component.
And step S1053, adding the mapped React component into the page.
In this embodiment, after the basic layout of the entire editor is rendered according to the instance object of the class template DataTemplate, the editor component needs to provide corresponding functionality to enable the user to modify and customize some properties of the configuration object. Optionally, a template object of the selected attribute information to be modified in the modification panel is defined for modification and mapped to a corresponding read component, for example, some attribute information to be modified may be mapped to < AutoComplete/> components, and some attribute information to be selected may be mapped to < Select/> components. The mapped read component is added to the page, thus realizing the function of modifying the EChats configuration in a uniform and centralized way. In this way, the user can fill in the defined options, so that the editor can complete the attribute modification function.
In the present embodiment, the above setting is performed to follow the minimum authority principle, that is, only the attribute information that needs to be modified is exposed to the user. Finally, the modification is provided for the user through a proper component, so that the usability of the whole configuration editor can be enhanced, and the user experience is improved.
And step S107, responding to the user operation, and creating configuration information corresponding to the user operation according to each template object after the definition is modified.
Referring to fig. 6, in the present embodiment, the step S107 includes three substeps, namely step S1071, step S1073 and step S1075.
Step S1071, in response to the user operation, creates an instance object of the class template according to the user operation.
Step S1073, obtaining a template object corresponding to the user operation by calling a creation function corresponding to the user operation in the class template.
Step S1075, insert the obtained template object into the root object of the instance object of the class template to complete the configuration information corresponding to the user operation.
In the present embodiment, the solution provides a variety of editing functions, such as adding lines, adding ECharts panels, adding configuration objects in ECharts, and the like. Optionally, when the user performs a corresponding click operation, for example, after clicking to add a row, the editor may first create an instance object of the DataTemplate class, then obtain a corresponding template object by calling a corresponding function in the DataTemplate class, for example, by calling getRowTpl (), obtain a default data template object containing row information, and then insert the template object into a root object of the instance object of the DataTemplate class, thus completing the creation of the row.
Similarly, when the user clicks and adds EChats, the template object of the panel configuration item is obtained by calling the getPlanelTpl () function of the DataTemplate class, and finally the panel is inserted into the root object of the instance object of the DataTemplate class template to complete the creation of the panel.
Optionally, in this embodiment, the functions derived from the DataTemplate class template include, but are not limited to, the following:
getConfigTpl (): and returning the template object of the whole root configuration information.
getRowTpl (): and returning a line of template objects of the configuration information.
getprenelttpl (): a template object containing ECharts information is returned.
getTargetTpl (): a template object is returned containing configuration information for the ECharts items.
In this embodiment, the template objects using different configuration information contained in a unified class template facilitate centralized introduction and use of this class template. And the template object of the configuration information is split according to logic and business, so that the universality and the universality of the class can be improved, namely different template objects are respectively generated according to different business requirements, and thus different business requirements can be met.
Optionally, in this embodiment, the configuration information of the ECharts is stored in the state of the read (an object for maintaining the internal state of the read component), so that the entire modified configuration information can be dynamically rendered when the user edits various configuration information, and thus, the what-you-see-is-what-you-get editing function can be realized.
Due to the functional characteristics of the React, any modification and update of the State causes the page update to be redrawn, so that the configuration information is stored in the State of the React, and once the configuration of the ECharts chart is changed, the page is updated, so that the corresponding chart configuration object is regenerated, and the purpose of what you see is what you get is achieved.
Step S109, converting the configuration information into a character string, and storing the converted character string.
In this embodiment, step S109 specifically includes the following steps:
converting the configuration information into a JSON character string through a JSON.stringiness function, and storing the converted JSON character string into a database through a provided interface.
Optionally, in this embodiment, the electronic device 100 may establish communication with a backend server, and after the user completes creation and modification of the ECharts chart configuration information, the editor component serializes the configuration information into JSON strings through an interface provided by the backend server by using a JSON. Therefore, the purpose of storing the configuration information is achieved, and meanwhile, in the subsequent ECharts use process, the rendering of the whole chart service can be achieved only by acquiring the stored information. Optionally, after the user completes creation and modification of the ECharts chart configuration information, whether to save the modification or not can be selected according to the operation of the user. If the user selects to save, the conversion and transmission process of the configuration information is executed. If the user chooses not to save, the modification operation is destroyed.
Referring to fig. 7, a functional block diagram of a configuration generating device 110 according to an embodiment of the present invention is shown. The configuration generating apparatus 110 includes an encapsulating module 111, a generating module 112, a modification defining module 113, a creating module 114, and a converting module 115.
The encapsulating module 111 is configured to encapsulate the configuration objects corresponding to the attribute information in the ECharts as class templates, where the class templates include template objects corresponding to the configuration objects in the ECharts. Specifically, the encapsulation module 111 can be used to execute step S101 shown in fig. 2, and the detailed description of step S101 can be referred to for a specific operation method.
Optionally, referring to fig. 8, in the present embodiment, the encapsulation module 111 includes an extraction unit 1111 and a first adding unit 1112.
The extracting unit 1111 is configured to extract attribute information used for configuration in the ECharts, and obtain a corresponding configuration object according to the attribute information. Specifically, the extracting unit 1111 may be configured to perform step S1011 shown in fig. 3, and a specific operation method may refer to the detailed description of step S1011.
The first adding unit 1112 is configured to encapsulate the configuration objects as class templates, and add template objects corresponding to the configuration objects to the class templates according to API and service partitioning of ECharts. Specifically, the first adding unit 1112 can be used for executing step S1013 shown in fig. 3, and a specific operation method can refer to the detailed description of step S1013.
The generating module 112 is configured to create an instance of the class template, and generate a modification panel of attribute information corresponding to each configuration object according to each configuration object in the instance. Specifically, the generating module 112 may be configured to execute step S103 shown in fig. 2, and the detailed description of step S103 may be referred to for a specific operation method.
Optionally, referring to fig. 9, in the present embodiment, the generating module 112 includes a grid system generating unit 1121 and a rendering unit 1122.
The grid system generating unit 1121 is configured to create an instance of the class template, traverse each configuration object in the instance, and generate an ECharts grid system. Specifically, the grid system generating unit 1121 may be configured to execute step S1031 shown in fig. 4, and a specific operation method may refer to the detailed description of step S1031.
The rendering unit 1122 is configured to render the grid system, and generate a modification panel of the attribute information corresponding to each configuration object. Specifically, the rendering unit 1122 can be used to execute step S1033 shown in fig. 4, and the detailed description of step S1033 can be referred to for a specific operation method.
The modification definition module 113 is configured to modify and define the template objects corresponding to the attribute information in the ECharts according to the modification panel. Specifically, the modification definition module 113 may be configured to execute step S105 shown in fig. 2, and the detailed description of step S105 may be referred to for a specific operation method.
Optionally, referring to fig. 10, in the present embodiment, the modification definition module 113 includes a mapping unit 1131 and a second adding unit 1132.
The mapping unit 1131 is configured to perform modification definition on the template object of the attribute information that needs to be modified and is selected in the modification panel, and map the template object into a corresponding fact component. Specifically, the mapping unit 1131 may be configured to perform step S1051 shown in fig. 5, and the detailed description of step S1051 may be referred to for a specific operation method.
The second adding unit 1132 is configured to add the mapped read component to the page. Specifically, the second adding unit 1132 may be used to perform step S1053 shown in fig. 5, and a specific operation method may refer to the detailed description of step S1053.
The creating module 114 is configured to, in response to a user operation, create configuration information corresponding to the user operation according to each template object after the definition is modified. Specifically, the creating module 114 may be configured to execute step S107 shown in fig. 2, and the detailed description of step S107 may be referred to for a specific operation method.
Optionally, referring to fig. 11, in the present embodiment, the creating module 114 includes a creating unit 1141, a calling unit 1142, and an inserting unit 1143.
The creating unit 1141 is configured to create an instance object of the class template according to a user operation in response to the user operation. Specifically, the creating unit 1141 may be configured to execute step S1071 shown in fig. 6, and a specific operation method may refer to the detailed description of step S1071.
The invoking unit 1142 is configured to obtain a template object corresponding to a configuration corresponding to a user operation by invoking a creating function corresponding to the user operation in the class template. Specifically, the invoking unit 1142 may be configured to execute step S1073 shown in fig. 6, and the detailed description of the step S1073 may be referred to for a specific operation method.
The inserting unit 1143 is configured to insert the obtained template object into a root object of the instance object of the class template to complete configuration information corresponding to a user operation. Specifically, the inserting unit 1143 may be used to execute step S1075 shown in fig. 6, and the detailed operation method may refer to the detailed description of step S1075.
The conversion module 115 is configured to convert the configuration information into a character string, and store the converted character string. Specifically, the conversion module 115 may be configured to execute step S109 shown in fig. 2, and the detailed description of step S109 may be referred to for a specific operation method.
In addition, another preferred embodiment of the present invention further provides a storage medium, on which a computer program is stored, and the computer program realizes the steps of the configuration generation method when being executed by the processor 120.
In summary, the present invention provides a configuration generating method, an apparatus and an electronic device, in which a configuration object corresponding to each attribute information in an ECharts is encapsulated as a class template, and a modification panel corresponding to the attribute information is generated according to the configuration object in an instance of the class template. And modifying and defining the template objects corresponding to the attribute information in the EChats according to the modification panel. This provides a uniform and centralized way to implement the functionality of modifying the ECharts configuration. When a user carries out modification operation, corresponding configuration information is created according to the modification operation of the user, and the configuration information is serialized and then transmitted to a database of a back-end server so as to store the configuration information. The configuration generation scheme provided by the invention can realize the unification and the reusability of the ECharts configuration by encapsulating and defining the configuration objects, thereby further simplifying the development process.
In the embodiments provided in the present application, it should be understood that the disclosed apparatus and method may be implemented in other ways. The apparatus embodiments described above are merely illustrative and, for example, the flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of apparatus, methods and computer program products according to embodiments of the present invention. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention, and various modifications and changes may be made by those skilled in the art. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention. It should be noted that: like reference numbers and letters refer to like items in the following figures, and thus, once an item is defined in one figure, it need not be further defined and explained in subsequent figures.
The above description is only for the specific embodiments of the present invention, but the scope of the present invention is not limited thereto, and any person skilled in the art can easily conceive of the changes or substitutions within the technical scope of the present invention, and all the changes or substitutions should be covered within the scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the appended claims.

Claims (9)

1. A method for configuration generation, the method comprising:
packaging the configuration objects corresponding to the attribute information in the EChats into class templates, wherein the class templates contain template objects corresponding to the configuration objects in the EChats;
creating an instance of the class template, and generating a modification panel of attribute information corresponding to each configuration object according to each configuration object in the instance;
modifying and defining the template objects corresponding to the attribute information in the EChats according to the modification panel;
responding to the user operation, and creating configuration information corresponding to the user operation according to each template object after the definition is modified;
converting the configuration information into character strings, and storing the converted character strings;
wherein, the step of modifying and defining the template objects corresponding to the attribute information in the ECharts according to the modification panel includes:
modifying and defining the template object of the attribute information to be modified selected from the modification panel and mapping the template object into a corresponding React component;
and adding the mapped React component into the page.
2. The configuration generating method according to claim 1, wherein the step of creating an instance of the class template and generating a modification panel of attribute information corresponding to each configuration object according to each configuration object in the instance comprises:
creating an example of the class template, traversing each configuration object in the example, and generating an ECharts grid system;
rendering the grid system and generating a modification panel of the attribute information corresponding to each configuration object.
3. The configuration generation method according to claim 1, wherein the step of encapsulating the configuration objects corresponding to the attribute information in the ECharts as class templates includes:
extracting attribute information for configuration in the EChats, and acquiring a corresponding configuration object according to the attribute information;
and packaging the configuration objects into class templates, and adding template objects corresponding to the configuration objects to the class templates according to the API and the service division of the ECharts.
4. The configuration generating method according to claim 1, wherein the step of creating, in response to the user operation, the configuration information corresponding to the user operation from each of the template objects after the modification definition includes:
responding to user operation, and creating an instance object of the class template according to the user operation;
obtaining a template object corresponding to the user operation by calling a creating function corresponding to the user operation in the class template;
and inserting the obtained template object into a root object of the instance object of the class template so as to complete the creation of the configuration information corresponding to the user operation.
5. The method according to claim 1, wherein the step of converting the configuration information into a character string and storing the converted character string comprises:
converting the configuration information into a JSON character string through a JSON.stringiness function, and storing the converted JSON character string into a database through a provided interface.
6. An apparatus for generating a configuration, the apparatus comprising:
the encapsulation module is used for encapsulating the configuration objects corresponding to the attribute information in the EChats into class templates, and the class templates contain template objects corresponding to the configuration objects in the EChats;
the generation module is used for creating an example of the class template and generating a modification panel of the attribute information corresponding to each configuration object according to each configuration object in the example;
the modification definition module is used for modifying and defining the template objects corresponding to the attribute information in the EChats according to the modification panel;
the creation module is used for responding to user operation and creating configuration information corresponding to the user operation according to each template object after the definition is modified;
the conversion module is used for converting the configuration information into character strings and storing the converted character strings;
wherein the modification definition module is specifically configured to:
modifying and defining the template object of the attribute information to be modified selected from the modification panel and mapping the template object into a corresponding React component;
and adding the mapped React component into the page.
7. The configuration generation apparatus according to claim 6, wherein the generation module includes a mesh system generation unit and a rendering unit;
the grid system generating unit is used for creating an example of the class template, traversing each configuration object in the example and generating an ECharts grid system;
and the rendering unit is used for rendering the grid system and generating a modification panel of the attribute information corresponding to each configuration object.
8. An electronic device, comprising:
a memory;
a processor; and
the configuration generation apparatus of any of claims 6-7, installed in the memory and comprising one or more software functional modules executed by the processor.
9. A computer storage medium, having stored thereon a computer program which, when executed by a processor, implements the configuration generation method of any one of claims 1 to 5.
CN201710930366.2A 2017-10-09 2017-10-09 Configuration generation method and device and electronic equipment Active CN107704239B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710930366.2A CN107704239B (en) 2017-10-09 2017-10-09 Configuration generation method and device and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710930366.2A CN107704239B (en) 2017-10-09 2017-10-09 Configuration generation method and device and electronic equipment

Publications (2)

Publication Number Publication Date
CN107704239A CN107704239A (en) 2018-02-16
CN107704239B true CN107704239B (en) 2020-10-16

Family

ID=61184791

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710930366.2A Active CN107704239B (en) 2017-10-09 2017-10-09 Configuration generation method and device and electronic equipment

Country Status (1)

Country Link
CN (1) CN107704239B (en)

Families Citing this family (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108614886B (en) * 2018-05-03 2021-10-15 北京云站科技有限公司 Website theme generation method and device
CN109165049A (en) * 2018-07-03 2019-01-08 北京辰森世纪科技股份有限公司 Module data processing method and processing device
CN110956025A (en) * 2018-09-27 2020-04-03 长沙博为软件技术股份有限公司 Method based on process template multiplexing
CN111124557A (en) * 2018-10-31 2020-05-08 北京国双科技有限公司 Interaction method and device for graph and table
CN110989891B (en) * 2019-12-23 2021-12-14 深圳市金蝶天燕云计算股份有限公司 Component deployment method in chart editor, chart editor and related equipment
CN111722844B (en) * 2020-05-29 2024-05-03 北京宝兰德软件股份有限公司 Design method and device of dynamic rich text component based on Web
CN112416304B (en) * 2020-11-23 2022-11-25 西安西热电站信息技术有限公司 Method for expanding echarts into html standard component

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP1860551A1 (en) * 2006-05-22 2007-11-28 Siemens Aktiengesellschaft Method and device for determining modification of a control software
CN105808237A (en) * 2016-02-25 2016-07-27 北京京东尚科信息技术有限公司 Page rendering method and page rendering system
CN106302008A (en) * 2016-08-05 2017-01-04 腾讯科技(深圳)有限公司 Data-updating method and device

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN100571348C (en) * 2008-01-14 2009-12-16 中兴通讯股份有限公司 The method of graphic generation of network TV electronic program guidance system template
IN2013CH04267A (en) * 2013-09-21 2015-10-02 Vayavya Labs Pvt Ltd
CN105786464A (en) * 2014-12-23 2016-07-20 远光软件股份有限公司 Interface design method and device based on template library
CN105183466B (en) * 2015-08-27 2019-04-26 国云科技股份有限公司 A kind of packaging method that simplified echarts is called
CN106250156B (en) * 2016-08-01 2019-03-12 腾讯科技(深圳)有限公司 Constructing method of component and device, component call method and apparatus

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP1860551A1 (en) * 2006-05-22 2007-11-28 Siemens Aktiengesellschaft Method and device for determining modification of a control software
CN105808237A (en) * 2016-02-25 2016-07-27 北京京东尚科信息技术有限公司 Page rendering method and page rendering system
CN106302008A (en) * 2016-08-05 2017-01-04 腾讯科技(深圳)有限公司 Data-updating method and device

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
react中使用Echarts图表;嗨_等风来;《简书》;20170922;全文 *

Also Published As

Publication number Publication date
CN107704239A (en) 2018-02-16

Similar Documents

Publication Publication Date Title
CN107704239B (en) Configuration generation method and device and electronic equipment
US8010479B2 (en) Simplifying the creation of user-defined custom elements for use in a graphical modeling application
CN111290778B (en) AI model packaging method, platform and electronic equipment
US9032002B2 (en) Single file serialization for physical and logical meta-model information
CN113076096B (en) Desktop application program development method, device, equipment and storage medium
CN105094832A (en) WYSIWYG method and system for dynamically generating user interface
CN111625226B (en) Prototype-based man-machine interaction design implementation method and system
CN102930580A (en) Data frame animation
CN110955410A (en) Automatic code generation method, device, equipment and medium
Sagebaum et al. Expression templates for primal value taping in the reverse mode of algorithmic differentiation
CN106055535B (en) Chart generation method and device
CN109117175B (en) APK decompilation-based desktop end packaging method and packaging tool for fast packaging
CN105653255A (en) Method arranging report template to automatically generate report files in office frame
CN113010227A (en) Simulation platform implementation method based on model drive
CN108170425A (en) A kind of amending method of program code, modification device and terminal device
CN112650966A (en) Method, generator and medium for generating dynamic list page of online design
CN108255471B (en) System configuration item configuration device, method and equipment based on configuration suite
CN115495069A (en) Model-driven coal industry software flow implementation method, device and equipment
CN107423291A (en) A kind of data translating method and client device
US10896161B2 (en) Integrated computing environment for managing and presenting design iterations
CN115983226A (en) Automatic creating method and device of form template, electronic equipment and storage medium
CA2738422A1 (en) Examining concurrent system states
US11640281B2 (en) Tool for introspection in object-oriented source code
CN109597845B (en) Report configuration method, report configuration device, computer equipment and storage medium
CN110795087B (en) Primitive processing method and device for UML design drawing and computer equipment

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
GR01 Patent grant
GR01 Patent grant
TR01 Transfer of patent right

Effective date of registration: 20231109

Address after: No. 10, 11th Floor, Building A-2, Zone II (Phase 6), National Geospatial Information Industry Base, Wuda Science and Technology Park, Donghu Development Zone, Wuhan City, Hubei Province, 430000

Patentee after: Wuhan Qianxing Science and Technology Co.,Ltd.

Address before: 430000 East Lake Development Zone, Wuhan City, Hubei Province, No. 1 Software Park East Road 4.1 Phase B1 Building 11 Building

Patentee before: WUHAN DOUYU NETWORK TECHNOLOGY Co.,Ltd.

TR01 Transfer of patent right