CN107704239A - Configuration generating method, device and electronic equipment - Google Patents
Configuration generating method, device and electronic equipment Download PDFInfo
- Publication number
- CN107704239A CN107704239A CN201710930366.2A CN201710930366A CN107704239A CN 107704239 A CN107704239 A CN 107704239A CN 201710930366 A CN201710930366 A CN 201710930366A CN 107704239 A CN107704239 A CN 107704239A
- Authority
- CN
- China
- Prior art keywords
- configuration
- template
- echarts
- attribute information
- user
- 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.)
- Granted
Links
- 238000000034 method Methods 0.000 title claims abstract description 39
- 230000004048 modification Effects 0.000 claims abstract description 59
- 238000012986 modification Methods 0.000 claims abstract description 59
- 238000005538 encapsulation Methods 0.000 claims abstract description 18
- 238000006243 chemical reaction Methods 0.000 claims abstract description 12
- 230000006870 function Effects 0.000 claims description 29
- 230000008859 change Effects 0.000 claims description 9
- 238000009877 rendering Methods 0.000 claims description 9
- 238000004590 computer program Methods 0.000 claims description 8
- 230000015654 memory Effects 0.000 claims description 8
- 230000000694 effects Effects 0.000 claims description 6
- 238000013507 mapping Methods 0.000 claims description 5
- 230000004044 response Effects 0.000 claims description 4
- 230000008569 process Effects 0.000 abstract description 9
- 238000011161 development Methods 0.000 abstract description 5
- 238000010586 diagram Methods 0.000 description 12
- 238000011017 operating method Methods 0.000 description 12
- 238000000605 extraction Methods 0.000 description 4
- 238000003780 insertion Methods 0.000 description 4
- 230000037431 insertion Effects 0.000 description 4
- 230000006399 behavior Effects 0.000 description 3
- 238000013461 design Methods 0.000 description 3
- 230000005540 biological transmission Effects 0.000 description 2
- 230000009471 action Effects 0.000 description 1
- 239000012141 concentrate Substances 0.000 description 1
- 239000000284 extract Substances 0.000 description 1
- 238000005194 fractionation Methods 0.000 description 1
- 230000006872 improvement Effects 0.000 description 1
- 238000009434 installation Methods 0.000 description 1
- 230000003993 interaction Effects 0.000 description 1
- 238000012423 maintenance Methods 0.000 description 1
- 238000004321 preservation Methods 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/30—Creation or generation of source code
- G06F8/31—Programming languages or programming paradigms
- G06F8/315—Object-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 embodiments of the invention provide a kind of configuration generating method, device and electronic equipment, methods described includes:It is class template by configuration object encapsulation corresponding with each attribute information in ECharts, the class template includes template object corresponding to each configuration object in ECharts;The example of the class template is created, the modification panel of the attribute information corresponding with each each configuration object of configuration object generation in the example;Template object corresponding with each attribute information in ECharts is modified definition according to the modification panel;User's operation is responded, each template object after being defined according to modification creates and the corresponding configuration information of user's operation;The configuration information is converted into character string, the character string after conversion is preserved.Configuration generation scheme provided by the invention, can pass through the encapsulation and definition to configuring object, there is provided unified and concentration mode changes the function of ECharts configurations to realize, realizes the unitized, reusable of ECharts configurations, further simplified development process.
Description
Technical field
The present invention relates to field of computer technology, is set in particular to a kind of configuration generating method, device and electronics
It is standby.
Background technology
ECharts is at present using commonplace chart class libraries of increasing income, at present in development process, due to each use
The ECharts page will substantially regenerate ECharts configuration, and attributively go to configure one by one, cause substantial amounts of
The redundancy of repeated work and code, exploitation and maintenance work to project bring great inconvenience, further reduced
Develop the efficiency safeguarded and the efficiency of page operation.
The content of the invention
In view of this, it is an object of the present invention to provide a kind of configuration generating method, device and electronic equipment to solve on
State problem.
Presently preferred embodiments of the present invention provides a kind of configuration generating method, and methods described includes:
It is class template by configuration object encapsulation corresponding with each attribute information in ECharts, the class template includes
Template object corresponding to object is respectively configured in ECharts;
The example of the class template is created, the category corresponding with each each configuration object of configuration object generation in the example
The modification panel of property information;
Template object corresponding with each attribute information in ECharts is modified definition according to the modification panel;
User's operation is responded, each template object after being defined according to modification creates and the corresponding configuration information of user's operation;
The configuration information is converted into character string, the character string after conversion is preserved.
Further, the example for creating the class template, each configuration object in the example are generated with respectively matching somebody with somebody
The step of putting the modification panel of attribute information corresponding to object, including:
The example of the class template is created, each configuration object in the example is traveled through, generates ECharts grid
System;
The grid system is rendered, generates the modification panel of attribute information corresponding with each configuration object.
Further, it is described according to it is described modification panel to template object corresponding with each attribute information in ECharts
Modify definition the step of, including:
The template object for the attribute information changed the needs selected in the modification panel, which is modified, to be defined and is mapped to
Corresponding React components;
React components after mapping are added in the page.
Further, the step by configuration object encapsulation corresponding with each attribute information in ECharts for class template
Suddenly, including:
The attribute information for being used to be configured in ECharts is extracted, the configuration according to corresponding to obtaining the attribute information
Object;
It is class template by the configuration object encapsulation, and according to ECharts API and delineation of activities addition and each configuration pair
As corresponding template object to the class template.
Further, the response user operation, each template object after being defined according to modification create and user's operation pair
The step of configuration information answered, including:
User's operation is responded, the instance objects for creating class template are operated according to user;
By calling the establishment function corresponding with user's operation in the class template to obtain and the corresponding mould of user's operation
Plate object;
The template object of acquisition is inserted into the root object of the instance objects of the class template, to complete to operate with user
The establishment of corresponding configuration information.
Further, it is described that the configuration information is converted into character string, the character string transmission after conversion is preserved
The step of, including:
The configuration information is converted to by JSON character strings, and the interface for passing through offer by JSON.stringify functions
JSON character strings after conversion are preserved to database.
Another preferred embodiment of the present invention provides a kind of configuration generating means, and described device includes:
Package module, it is described for being class template by configuration object encapsulation corresponding with each attribute information in ECharts
Class template includes template object corresponding to each configuration object in ECharts;
Generation module, for creating the example of the class template, each configuration object in the example is generated with respectively matching somebody with somebody
Put the modification panel of attribute information corresponding to object;
Change definition module, for according to it is described modification panel to template corresponding with each attribute information in ECharts
Object is modified definition;
Creation module, for responding user's operation, each template object after being defined according to modification creates and user's operation pair
The configuration information answered;
Modular converter, for the configuration information to be converted into character string, the character string after conversion is preserved.
Further, the generation module includes grid system generation unit and rendering unit;
Grid system generation unit, for creating the example of the class template, each configuration object in the example is carried out
Traversal, generate ECharts grid system;
Rendering unit, for being rendered to the grid system, generate repairing for attribute information corresponding to each configuration object
Change panel.
Another preferred embodiment of the present invention also provides a kind of electronic equipment, including:
Memory;
Processor;And
Generating means are configured, the configuration generating means are installed in the memory and including one or more by described
The software function module of computing device.
Another preferred embodiment of the present invention also provides a kind of computer-readable storage medium, is stored thereon with computer program,
The computer program realizes above-mentioned configuration generating method when being executed by processor.
The embodiment of the present invention provides a kind of configuration generating method, device and electronic equipment, by by ECharts with it is each
Configuration object encapsulation is class template corresponding to attribute information, the configuration object generation attribute information in the example of the class template
Corresponding modification panel.Template object corresponding with each attribute information in ECharts is modified according to the modification panel
Definition.The mode of unification and concentration a kind of is so provided to realize the function of modification ECharts configurations.Modified behaviour in user
When making, corresponding configuration information is created according to the modification of user operation, database is transferred to after configuration information is serialized,
Configuration information is preserved with this.Configuration generation scheme provided by the invention, it can be come real by the encapsulation and definition to configuring object
The unitized, reusable of existing ECharts configurations, further simplifies development process.
To enable the above objects, features and advantages of the present invention to become apparent, preferred embodiment cited below particularly, and coordinate
Appended accompanying drawing, is described in detail below.
Brief description of the drawings
In order to illustrate the technical solution of the embodiments of the present invention more clearly, below by embodiment it is required use it is attached
Figure is briefly described, it will be appreciated that the following drawings illustrate only certain embodiments of the present invention, therefore be not construed as pair
The restriction of scope, for those of ordinary skill in the art, on the premise of not paying creative work, can also be according to this
A little accompanying drawings obtain other related accompanying drawings.
Fig. 1 is the schematic block diagram of a kind of electronic equipment provided in an embodiment of the present invention.
Fig. 2 is a kind of flow chart of configuration generating method provided in an embodiment of the present invention.
Fig. 3 is the flow chart of step S101 sub-step in Fig. 2.
Fig. 4 is the flow chart of step S103 sub-step in Fig. 2.
Fig. 5 is the flow chart of step S105 sub-step in Fig. 2.
Fig. 6 is the flow chart of step S107 sub-step in Fig. 2.
Fig. 7 is the functional block diagram of configuration generating means provided in an embodiment of the present invention.
Fig. 8 is the functional block diagram of package module provided in an embodiment of the present invention.
Fig. 9 is the functional block diagram of generation module provided in an embodiment of the present invention.
Figure 10 is the functional block diagram of modification definition module provided in an embodiment of the present invention.
Figure 11 is the functional block diagram of creation module provided in an embodiment of the present invention.
Icon:100- electronic equipments;110- configures generating means;111- package modules;1111- extraction units;1112-
One adding device;112- generation modules;1121- grid system generation units;1122- rendering units;113- changes definition module;
1131- map units;The adding devices of 1132- second;114- creation modules;1141- creating units;1142- call units;
1143- inserts unit;115- modular converters;120- processors;130- memories.
Embodiment
Below in conjunction with accompanying drawing in the embodiment of the present invention, the technical scheme in the embodiment of the present invention is carried out clear, complete
Ground describes, it is clear that described embodiment is only part of the embodiment of the present invention, rather than whole embodiments.Generally exist
The component of the embodiment of the present invention described and illustrated in accompanying drawing can be configured to arrange and design with a variety of herein.Cause
This, the detailed description of the embodiments of the invention to providing in the accompanying drawings is not intended to limit claimed invention below
Scope, but it is merely representative of the selected embodiment of the present invention.Based on embodiments of the invention, those skilled in the art are not doing
The every other embodiment obtained on the premise of going out creative work, belongs to the scope of protection of the invention.
It should be noted that:Similar label and letter represents similar terms in following accompanying drawing, therefore, once a certain Xiang Yi
It is defined, then it further need not be defined and explained in subsequent accompanying drawing in individual accompanying drawing.Meanwhile the present invention's
In description, unless otherwise clearly defined and limited, term " installation ", " setting ", " connection " should be interpreted broadly, for example, can
To be to be fixedly connected or be detachably connected, or it is integrally connected;Can be mechanical connection or electrical connection;Can
It to be to be joined directly together, can also be indirectly connected by intermediary, can be the connection of two element internals.For this area
For those of ordinary skill, the concrete meaning of above-mentioned term in the present invention can be understood with concrete condition.
Referring to Fig. 1, the schematic block diagram for a kind of electronic equipment 100 provided in an embodiment of the present invention.In this reality
Apply in example, the electronic equipment 100 includes configuration generating means 110, processor 120 and memory 130.Wherein, the storage
Direct or indirect electric connection between device 130 and the processor 120, to realize the transmission of data or interaction.The configuration
Generating means 110 include it is at least one can be stored in the memory 130 or be solidificated in the form of software or firmware it is described
Software function module in the operating system of electronic equipment 100.The processor 120 is used to perform to deposit in the memory 130
The executable module of storage, such as the software function module or computer program that the configuration generating means 110 include.
Referring to Fig. 2, it is a kind of configuration generating method applied to above-mentioned electronic equipment 100 provided in an embodiment of the present invention
Flow chart.It should be noted that method provided by the invention is not using Fig. 2 and particular order as described below as limitation.Below
Each step shown in Fig. 2 will be described in detail.
Step S101, it is class template by configuration object encapsulation corresponding with each attribute information in ECharts, the class mould
Plate includes template object corresponding to each configuration object in ECharts.
Referring to Fig. 3, in the present embodiment, step S101 can include two sub-steps of step S1011 and step S1013
Suddenly.
Step S1011, the attribute information for being used to be configured in ECharts is extracted, is obtained according to the attribute information
Corresponding configuration object.
Step S1013, it is class template by the configuration object encapsulation, and is added according to ECharts API and delineation of activities
With the corresponding template object of each configuration object to the class template.
Alternatively, in the present embodiment, the relevant information provided according to ECharts documents extracts can in ECharts
For the attribute information configured.Accordingly, each attribute information has its corresponding configuration object, by configuration object envelope
Fill the DataTemplate class templates for ES6 classes.And according to ECharts API (Application in the class template
Program Interface, application programming interfaces) and delineation of activities, addition template object corresponding with configuration object, such as
RowTpl template objects, panelTpl template objects, into the class template.Wherein, in panelTpl template objects, main bag
Configuration information corresponding to ECharts and the default value of correlation are contained.Respectively match somebody with somebody in this way, then being contained in the class template in ECharts
Put template object corresponding to object.
In the present embodiment, the class that ES6 is encapsulated as in object set will be configured, facilitates and introduced in follow-up development process
And use.Also, ECharts component is carried out by internal division according to delineation of activities, it is convenient subsequently to process by demand.In this way,
Under the follow-up scene for needing to carry out chart packet division (mode of such as multiple lines and multiple rows shows chart), initialization rowTpl it
Afterwards, you can to generate local template, such as panelTpl using respective function derived from the example of class template.By in rowTpl
The function that multiple panelTpl are achieved that the multiple ECharts charts of a line is inserted in object.Similarly, by
Multiple rowTpl templates cans are inserted in the example of DataTemplate classes and realize that multirow shows ECharts.
Step S103, the example of the class template is created, each configuration object in the example generates each configuration object
The modification panel of corresponding attribute information.
Referring to Fig. 4, in the present embodiment, step S103 includes step S1031 and the sub-steps of step S1033 two.
Step S1031, the example of the class template is created, each configuration object in the example is traveled through, generated
ECharts grid system.
Step S1033, the grid system is rendered, generate the modification face of attribute information corresponding to each configuration object
Plate.
In the present embodiment, it is necessary to by the instance objects wash with watercolours after the example of DataTemplate class templates is created
Dye corresponding layout.It should be appreciated that the layout is realized by row and panel, wherein row and panel correspond to grid
The row and column of layout.Alternatively, each configuration object in the example is traveled through, such as searching loop row and panel, with
Generate the grid system of whole chart.The grid system is rendered, generates repairing for attribute information corresponding to each configuration object
Change panel.
In the present embodiment, using the design of grid system design can be made more flexible, to meet more business scenarios.
Due to multiple row can be included in configuration object, and there can also be multiple panel in row, while such data structure is set
The more convenient management of meter and safeguard, on the one hand allow the insertion of data simpler effectively, at the same also allow data traversal and acquisition
Also it is faster.
Step S105, template object corresponding with each attribute information in ECharts is carried out according to the modification panel
Modification definition.
Referring to Fig. 5, in the present embodiment, step S105 includes step S1051 and the sub-steps of step S1053 two.
Step S1051, the template object for the attribute information changed the needs selected in the modification panel, which is modified, to be determined
Justice is simultaneously mapped to corresponding React components.
Step S1053, the React components after mapping are added in the page.
In the present embodiment, the basic of whole editing machine is being rendered according to class template DataTemplate instance objects
After layout, it is necessary to allow editor's device assembly to provide corresponding function with allow user can change and custom-configure object some
Attribute.Alternatively, the template object of attribute information changed the needs selected in the modification panel is modified definition, and is reflected
Corresponding React components are penetrated into, for example, some can be needed the attribute information of user data be mapped to<AutoComplete/>
Component, the attribute information of selection is needed to be mapped to some<Select/>Component.React components after mapping are added to page
In face, so it is achieved that and the function that mode that is unified and concentrating changes ECharts configurations is provided.In this way, user can allow respectively
The options having been defined for voluntarily is filled in, such editing machine just completes the realization of attribute modification function.
In the present embodiment, by above-mentioned setting to follow minimum right principle, i.e., the attribute information changed will only be needed
It is exposed to user.It is supplied to user to change finally by suitable component, can so strengthens the ease for use of whole config editor,
To improve Consumer's Experience.
Step S107, response user's operation, each template object after being defined according to modification creates corresponding with user's operation
Configuration information.
Referring to Fig. 6, in the present embodiment, step S107 includes step S1071, step S1073 and step S1075 tri-
Sub-step.
Step S1071, response user's operation, the instance objects for creating class template are operated according to user.
Step S1073, grasped by calling the establishment function corresponding with user's operation in the class template to obtain with user
Template object corresponding to work.
Step S1075, in the root object for the instance objects that the template object of acquisition is inserted into the class template, to complete
With the corresponding configuration information of user's operation.
In the present embodiment, solution provides a variety of editting functions, such as adds line, add ECharts panels, add
Add configuration object in ECharts etc..Alternatively, when user carry out corresponding clicking operation when, such as click on add line after, compile
The instance objects of a DataTemplate class template can be created first by collecting device, then by calling DataTemplate class templates
In corresponding function obtain corresponding template object, such as by calling getRowTpl (), obtain the bag of an acquiescence
This template object, is then inserted into class template DataTemplate instance objects by the data template object containing row information
In root object, capable establishment is so just completed.
Similarly, can be by calling DataTemplate classes after user clicks on addition ECharts
GetPanelTpl () function obtains the template object of panel configuration item, is finally inserted the example of DataTemplate class templates
The establishment of panel is completed in the root object of object.
Alternatively, in the present embodiment, function derived from DataTemplate class templates includes but is not limited to following several:
getConfigTpl():Return to the template object of whole root configuration information.
getRowTpl():Return to the template object of a line configuration information.
getPanelTpl():Return to a template object for including ECharts information.
getTargetTpl():Return to a template object for including ECharts items configuration informations.
In the present embodiment, the template object of the different configuration informations included using unified class template is easy to concentrate
Introduce and use this class template.And it the template object of configuration information is logically subjected to fractionation with business can improve this class
Generality and versatility, i.e., generate different template objects respectively according to different business demands, can so meet difference
Business demand.
Alternatively, in the present embodiment, the state that ECharts configuration information is stored in React (is used to safeguard
The object of React component internal states) in, it is possible to dynamic, which renders, when user edits every configuration information entirely repaiies
Configuration information after changing, the editting function of so achievable What You See Is What You Get.
Due to React functional characteristic, any modification to State more new capital will redraw renewal of the page, therefore will match somebody with somebody
Confidence breath is stored in React State, once the configuration of ECharts charts is modified, the page will be updated, therefore right
The chart configuration object answered will be regenerated, therefore reach the purpose of What You See Is What You Get.
Step S109, the configuration information is converted into character string, the character string after conversion is preserved.
In the present embodiment, step S109 specifically includes following steps:
The configuration information is converted to by JSON character strings, and the interface for passing through offer by JSON.stringify functions
JSON character strings after conversion are preserved to database.
Alternatively, in the present embodiment, the electronic equipment 100 can be established with back-end server and communicated, and be completed in user
After the establishment and modification of ECharts chart configuration informations, editor's device assembly will pass through the interface that back-end server provides
This configuration information sequence is melted into the number that back-end server is passed to after JSON character strings using JSON.stringify functions
According to storehouse.The purpose for preserving configuration information is so realized, meanwhile, during the ECharts uses of postorder, it is only necessary to preservation
Information carries out acquisition can and realizes rendering for whole chart business.Alternatively, ECharts charts are completed in user and matches somebody with somebody confidence
Also it can choose whether to preserve modification according to the operation of user after the establishment and modification of breath.If user selects to preserve,
Then perform conversion and the conveying flow of configuration information.Without preserving, if the modification to this operates into marketing user's selection
Ruin.
Referring to Fig. 7, it is a kind of functional block diagram for configuring generating means 110 provided in an embodiment of the present invention.It is described
Configuring generating means 110 includes package module 111, generation module 112, modification definition module 113, creation module 114 and turns
Change the mold block 115.
It is class mould that the package module 111, which is used for configuration object encapsulation corresponding with each attribute information in ECharts,
Plate, the class template include template object corresponding to each configuration object in ECharts.Specifically, the package module 111 can be used for
The step S101 shown in Fig. 2 is performed, specific operating method refers to step S101 detailed description.
Alternatively, referring to Fig. 8, in the present embodiment, the package module 111 includes extraction unit 1111 and first
Adding device 1112.
The extraction unit 1111 is used to extract the attribute information for being used for being configured in ECharts, according to the category
Property information acquisition corresponding to configuration object.Specifically, the extraction unit 1111 can be used for performing the step S1011 shown in Fig. 3,
Specific operating method refers to step S1011 detailed description.
It is class template that first adding device 1112, which is used for the configuration object encapsulation, and according to ECharts API
Template object corresponding with each configuration object is added to the class template with delineation of activities.Specifically, first adding device
1112 can be used for performing the step S1013 shown in Fig. 3, and specific operating method refers to step S1013 detailed description.
The generation module 112 is used for the example for creating the class template, each configuration object generation in the example
The modification panel of attribute information corresponding to each configuration object.Specifically, the generation module 112 can be used for performing shown in Fig. 2
Step S103, specific operating method refer to step S103 detailed description.
Alternatively, referring to Fig. 9, in the present embodiment, the generation module 112 includes grid system generation unit 1121
And rendering unit 1122.
The grid system generation unit 1121 is used for the example for creating the class template, to each configuration pair in the example
As being traveled through, ECharts grid system is generated.Specifically, the grid system generation unit 1121 can be used for performing in Fig. 4
Shown step S1031, specific operating method refer to step S1031 detailed description.
The rendering unit 1122 is used to render the grid system, generates attribute letter corresponding to each configuration object
The modification panel of breath.Specifically, the rendering unit 1122 can be used for performing the step S1033 shown in Fig. 4, specific operation side
Method refers to step S1033 detailed description.
The modification definition module 113 is used for according to the modification panel to corresponding with each attribute information in ECharts
Template object modify definition.Specifically, the modification definition module 113 can be used for performing the step S105 shown in Fig. 2,
Specific operating method refers to step S105 detailed description.
Alternatively, referring to Fig. 10, in the present embodiment, the modification definition module 113 include map unit 1131 with
And second adding device 1132.
The map unit 1131 is used for the template object for the attribute information changed the needs selected in the modification panel
Modify and define and be mapped to corresponding React components.Specifically, the map unit 1131 can be used for performing shown in Fig. 5
Step S1051, specific operating method refers to step S1051 detailed description.
Second adding device 1132 is used to the React components after mapping being added in the page.Specifically, this second
Adding device 1132 can be used for performing the step S1053 shown in Fig. 5, and specific operating method refers to the detailed of step S1053
Thin description.
The creation module 114 is used to respond user's operation, and each template object after being defined according to modification creates and user
Configuration information corresponding to operation.Specifically, the creation module 114 can be used for performing the step S107 shown in Fig. 2, specific behaviour
Step S107 detailed description is referred to as method.
Alternatively, Figure 11 is referred to, in the present embodiment, the creation module 114 includes creating unit 1141, calls list
Member 1142 and insertion unit 1143.
The creating unit 1141 is used to respond user's operation, and the instance objects for creating class template are operated according to user.Tool
Body, the creating unit 1141 can be used for performing the step S1071 shown in Fig. 6, and specific operating method refers to step
S1071 detailed description.
The call unit 1142 is used for by calling the establishment function corresponding with user's operation in the class template to obtain
Obtain template object corresponding to configuration corresponding with user's operation.Specifically, the call unit 1142 can be used for performing shown in Fig. 6
Step S1073, specific operating method refers to step S1073 detailed description.
The insertion unit 1143 is used for the root pair that the template object of acquisition is inserted into the instance objects of the class template
As in, to complete and the corresponding configuration information of user's operation.Specifically, the insertion unit 1143 can be used for performing shown in Fig. 6
Step S1075, specific operating method refers to step S1075 detailed description.
The modular converter 115 is used to the configuration information being converted to character string, and the character string after conversion is protected
Deposit.Specifically, the modular converter 115 can be used for performing the step S109 shown in Fig. 2, and specific operating method refers to step
S109 detailed description.
In addition, another preferred embodiment of the present invention also provides a kind of storage medium, computer program is stored thereon with, it is described
Computer program realizes the step of above-mentioned configuration generating method when being performed by processor 120.
In summary, the present invention provides a kind of configuration generating method, device and electronic equipment, by by ECharts
Configuration object encapsulation corresponding with each attribute information is class template, the configuration object generation attribute in the example of the class template
Modification panel corresponding to information.Template object corresponding with each attribute information in ECharts is carried out according to the modification panel
Modification definition.The mode of unification and concentration a kind of is so provided to realize the function of modification ECharts configurations.Repaiied in user
When changing operation, corresponding configuration information is created according to the modification of user operation, after being transferred to after configuration information is serialized
The database of server is held, configuration information is preserved with this.Configuration generation scheme provided by the invention, can be by configuring object
Encapsulation and definition, to realize unitized, the reusable of ECharts configurations, further simplify development process.
In embodiment provided herein, it should be understood that disclosed apparatus and method, can also be by other
Mode realize.Device embodiment described above is only schematical, for example, the flow chart and block diagram in accompanying drawing are shown
Devices in accordance with embodiments of the present invention, architectural framework in the cards, function and the behaviour of method and computer program product
Make.At this point, each square frame in flow chart or block diagram can represent a part for a module, program segment or code, institute
The part for stating module, program segment or code includes one or more executable instructions for being used to realize defined logic function.
It should also be noted that at some as in the implementation replaced, the function of being marked in square frame can also be with different from accompanying drawing
The order marked occurs.For example, two continuous square frames can essentially perform substantially in parallel, they sometimes can also be by
Opposite order performs, and this is depending on involved function.It is also noted that each square frame in block diagram and/or flow chart,
And the combination of the square frame in block diagram and/or flow chart, the special based on hardware of function or action as defined in performing can be used
System realize, or can be realized with the combination of specialized hardware and computer instruction.
It should be noted that herein, term " comprising ", "comprising" or its any other variant are intended to non-row
His property includes, so that process, method, article or equipment including a series of elements not only include those key elements, and
And also include the other element being not expressly set out, or also include for this process, method, article or equipment institute inherently
Key element.In the absence of more restrictions, the key element limited by sentence "including a ...", it is not excluded that including institute
State in process, method, article or the equipment of key element and other identical element also be present.
The preferred embodiments of the present invention are the foregoing is only, are not intended to limit the invention, for the skill of this area
For art personnel, the present invention can have various modifications and variations.Within the spirit and principles of the invention, that is made any repaiies
Change, equivalent substitution, improvement etc., should be included in the scope of the protection.It should be noted that:Similar label and letter exists
Similar terms is represented in following accompanying drawing, therefore, once being defined in a certain Xiang Yi accompanying drawing, is then not required in subsequent accompanying drawing
It is further defined and explained.
The foregoing is only a specific embodiment of the invention, but protection scope of the present invention is not limited thereto, any
Those familiar with the art the invention discloses technical scope in, change or replacement can be readily occurred in, should all be contained
Cover within protection scope of the present invention.Therefore, protection scope of the present invention should be based on the protection scope of the described claims.
Claims (10)
1. a kind of configuration generating method, it is characterised in that methods described includes:
It is class template by configuration object encapsulation corresponding with each attribute information in ECharts, the class template includes ECharts
In template object corresponding to each configuration object;
The example of the class template is created, the attribute corresponding with each each configuration object of configuration object generation in the example is believed
The modification panel of breath;
Template object corresponding with each attribute information in ECharts is modified definition according to the modification panel;
User's operation is responded, each template object after being defined according to modification creates and the corresponding configuration information of user's operation;
The configuration information is converted into character string, the character string after conversion is preserved.
2. configuration generating method according to claim 1, it is characterised in that the example for creating the class template, root
The step of modification panel of attribute information corresponding with each configuration object being generated according to each configuration object in the example, including:
The example of the class template is created, each configuration object in the example is traveled through, generates ECharts grid system
System;
The grid system is rendered, generates the modification panel of attribute information corresponding with each configuration object.
3. configuration generating method according to claim 1, it is characterised in that described according to the modification panel pair
Template object corresponding with each attribute information in ECharts modify definition the step of, including:
The template object for the attribute information changed the needs selected in the modification panel, which is modified, to be defined and is mapped to correspondingly
React components;
React components after mapping are added in the page.
4. configuration generating method according to claim 1, it is characterised in that it is described by ECharts with each attribute information
The step of corresponding configuration object encapsulation is class template, including:
The attribute information for being used to be configured in ECharts is extracted, object is configured according to corresponding to obtaining the attribute information;
It is class template by the configuration object encapsulation, and according to ECharts API and delineation of activities addition and each configuration object pair
The template object answered is to the class template.
5. configuration generating method according to claim 1, it is characterised in that the response user operation, it is fixed according to modification
Each template object after justice creates the step of operating corresponding configuration information with user, including:
User's operation is responded, the instance objects for creating class template are operated according to user;
By calling the establishment function corresponding with user's operation in the class template to obtain and the corresponding template pair of user's operation
As;
The template object of acquisition is inserted into the root object of the instance objects of the class template, it is corresponding with user's operation to complete
Configuration information establishment.
6. configuration generating method according to claim 1, it is characterised in that described that the configuration information is converted into character
String, the step of the character string after conversion is preserved, including:
The configuration information is converted to by JSON character strings by JSON.stringify functions, and will be turned by the interface of offer
JSON character strings after changing are preserved to database.
7. one kind configuration generating means, it is characterised in that described device includes:
Package module, for being class template by configuration object encapsulation corresponding with each attribute information in ECharts, the class mould
Plate includes template object corresponding to each configuration object in ECharts;
Generation module, for creating the example of the class template, the generation of each configuration object and each configuration pair in the example
As the modification panel of corresponding attribute information;
Change definition module, for according to it is described modification panel to template object corresponding with each attribute information in ECharts
Modify definition;
Creation module, for responding user's operation, each template object after being defined according to modification creates corresponding with user's operation
Configuration information;
Modular converter, for the configuration information to be converted into character string, the character string after conversion is preserved.
8. configuration generating means according to claim 7, it is characterised in that the generation module generates including grid system
Unit and rendering unit;
Grid system generation unit, for creating the example of the class template, each configuration object in the example is traveled through,
Generate ECharts grid system;
Rendering unit, for being rendered to the grid system, generate the modification face of attribute information corresponding to each configuration object
Plate.
9. a kind of electronic equipment, it is characterised in that including:
Memory;
Processor;And
Generating means are configured, the configuration generating means are installed in the memory and including one or more by the processing
The software function module that device performs.
10. a kind of computer-readable storage medium, it is characterised in that be stored thereon with computer program, the computer program is located
Reason device realizes the configuration generating method described in claim 1-6 any one when performing.
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 true CN107704239A (en) | 2018-02-16 |
CN107704239B 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) |
Cited By (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108614886A (en) * | 2018-05-03 | 2018-10-02 | 北京搜狐互联网信息服务有限公司 | A kind of generation method and device of subject of Web site |
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 |
CN110989891A (en) * | 2019-12-23 | 2020-04-10 | 深圳市金蝶天燕云计算股份有限公司 | Component deployment method in chart editor, chart editor and related equipment |
CN111124557A (en) * | 2018-10-31 | 2020-05-08 | 北京国双科技有限公司 | Interaction method and device for graph and table |
CN111722844A (en) * | 2020-05-29 | 2020-09-29 | 北京宝兰德软件股份有限公司 | Web-based dynamic rich text component design method and device |
CN112416304A (en) * | 2020-11-23 | 2021-02-26 | 西安西热电站信息技术有限公司 | Method for expanding echarts into html standard component |
Citations (8)
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 |
CN101217630A (en) * | 2008-01-14 | 2008-07-09 | 中兴通讯股份有限公司 | A method of graphic generation of network TV electronic program guidance system template |
US20150089515A1 (en) * | 2013-09-21 | 2015-03-26 | Vayavya Labs Private. Limited | System and method for generating a device driver using an archive of template code |
CN105183466A (en) * | 2015-08-27 | 2015-12-23 | 国云科技股份有限公司 | Encapsulating method for simplifying echarts invocation |
CN105786464A (en) * | 2014-12-23 | 2016-07-20 | 远光软件股份有限公司 | Interface design method and device based on template library |
CN105808237A (en) * | 2016-02-25 | 2016-07-27 | 北京京东尚科信息技术有限公司 | Page rendering method and page rendering system |
CN106250156A (en) * | 2016-08-01 | 2016-12-21 | 腾讯科技(深圳)有限公司 | Constructing method of component and device, component call method and apparatus |
CN106302008A (en) * | 2016-08-05 | 2017-01-04 | 腾讯科技(深圳)有限公司 | Data-updating method and device |
-
2017
- 2017-10-09 CN CN201710930366.2A patent/CN107704239B/en active Active
Patent Citations (8)
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 |
CN101217630A (en) * | 2008-01-14 | 2008-07-09 | 中兴通讯股份有限公司 | A method of graphic generation of network TV electronic program guidance system template |
US20150089515A1 (en) * | 2013-09-21 | 2015-03-26 | Vayavya Labs Private. Limited | System and method for generating a device driver using an archive of template code |
CN105786464A (en) * | 2014-12-23 | 2016-07-20 | 远光软件股份有限公司 | Interface design method and device based on template library |
CN105183466A (en) * | 2015-08-27 | 2015-12-23 | 国云科技股份有限公司 | Encapsulating method for simplifying echarts invocation |
CN105808237A (en) * | 2016-02-25 | 2016-07-27 | 北京京东尚科信息技术有限公司 | Page rendering method and page rendering system |
CN106250156A (en) * | 2016-08-01 | 2016-12-21 | 腾讯科技(深圳)有限公司 | Constructing method of component and device, component call method and apparatus |
CN106302008A (en) * | 2016-08-05 | 2017-01-04 | 腾讯科技(深圳)有限公司 | Data-updating method and device |
Non-Patent Citations (1)
Title |
---|
嗨_等风来: "react中使用Echarts图表", 《简书》 * |
Cited By (11)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108614886A (en) * | 2018-05-03 | 2018-10-02 | 北京搜狐互联网信息服务有限公司 | A kind of generation method and device of subject of Web site |
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 |
CN110989891A (en) * | 2019-12-23 | 2020-04-10 | 深圳市金蝶天燕云计算股份有限公司 | Component deployment method in chart editor, chart editor and related equipment |
CN110989891B (en) * | 2019-12-23 | 2021-12-14 | 深圳市金蝶天燕云计算股份有限公司 | Component deployment method in chart editor, chart editor and related equipment |
CN111722844A (en) * | 2020-05-29 | 2020-09-29 | 北京宝兰德软件股份有限公司 | Web-based dynamic rich text component design method and device |
CN111722844B (en) * | 2020-05-29 | 2024-05-03 | 北京宝兰德软件股份有限公司 | Design method and device of dynamic rich text component based on Web |
CN112416304A (en) * | 2020-11-23 | 2021-02-26 | 西安西热电站信息技术有限公司 | Method for expanding echarts into html standard component |
CN112416304B (en) * | 2020-11-23 | 2022-11-25 | 西安西热电站信息技术有限公司 | Method for expanding echarts into html standard component |
Also Published As
Publication number | Publication date |
---|---|
CN107704239B (en) | 2020-10-16 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN107704239A (en) | Configuration generating method, device and electronic equipment | |
CN111290778B (en) | AI model packaging method, platform and electronic equipment | |
CN104298496B (en) | data analysis type software development framework system | |
CN109829375A (en) | A kind of machine learning method, device, equipment and system | |
CN104484163B (en) | Heterogeneous model conversion method based on unified modeling environment | |
CN104572577B (en) | Mathematical formulae processing method and processing device | |
CN111241349A (en) | Wiring diagram data display method and system based on graph conversion | |
CN113741965A (en) | Method, device and equipment for arranging flow chart and storage medium | |
CN107479866A (en) | The method that open terminal applies data and function are realized based on reconfiguration technique | |
CN106951254A (en) | The method and device that similar traffic functional module is multiplexed in payment system | |
CN114707474A (en) | Report generation method and device, electronic equipment and computer readable storage medium | |
CN114996619A (en) | Page display method and device, computer equipment and storage medium | |
CN104081347A (en) | Graphical representation of an order of operations | |
CN114647409A (en) | Large-screen visualization application creation platform, method, computing device and storage medium | |
US11822896B2 (en) | Contextual diagram-text alignment through machine learning | |
CN117193745A (en) | Application development method and device combining assembly and large language model | |
CN106874000A (en) | Data analysis set-up and generation method based on construction costs computer description language BCL | |
CN115346669A (en) | Medical artificial intelligence reasoning method and system based on low-code programming | |
CN109388398B (en) | Interface generation method and device in virtualization system | |
CN115248881A (en) | Webpage input information rendering method and device, electronic equipment and storage medium | |
CN103810312B (en) | Method and device for the computer-aided design of man-machine interface animated graphics element | |
CN104217018A (en) | Method and device for processing operation data | |
CN109410939A (en) | General data maintaining method based on phonetic order collection | |
CN113806596B (en) | Operation data management method and related device | |
CN113032003B (en) | Development file export method, development file export device, electronic equipment and computer 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 | ||
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 |