CN107992458B - Table rule generation method and device, storage medium and electronic equipment - Google Patents
Table rule generation method and device, storage medium and electronic equipment Download PDFInfo
- Publication number
- CN107992458B CN107992458B CN201610950698.2A CN201610950698A CN107992458B CN 107992458 B CN107992458 B CN 107992458B CN 201610950698 A CN201610950698 A CN 201610950698A CN 107992458 B CN107992458 B CN 107992458B
- Authority
- CN
- China
- Prior art keywords
- rule
- preset
- editing
- input data
- target
- 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
Links
- 238000000034 method Methods 0.000 title claims abstract description 102
- 238000000547 structure data Methods 0.000 claims abstract description 74
- 238000012545 processing Methods 0.000 claims description 31
- 230000015654 memory Effects 0.000 claims description 17
- 230000008569 process Effects 0.000 claims description 14
- 238000004590 computer program Methods 0.000 claims 2
- 238000005516 engineering process Methods 0.000 abstract description 9
- 230000008859 change Effects 0.000 description 19
- 238000010586 diagram Methods 0.000 description 18
- 230000006870 function Effects 0.000 description 15
- 238000011161 development Methods 0.000 description 9
- 230000000694 effects Effects 0.000 description 8
- 230000005540 biological transmission Effects 0.000 description 6
- 230000001960 triggered effect Effects 0.000 description 6
- 230000006399 behavior Effects 0.000 description 5
- 238000007373 indentation Methods 0.000 description 4
- 230000008878 coupling Effects 0.000 description 3
- 238000010168 coupling process Methods 0.000 description 3
- 238000005859 coupling reaction Methods 0.000 description 3
- 230000003287 optical effect Effects 0.000 description 3
- 238000004891 communication Methods 0.000 description 2
- 238000005034 decoration Methods 0.000 description 2
- 238000012986 modification Methods 0.000 description 2
- 230000004048 modification Effects 0.000 description 2
- 238000013499 data model Methods 0.000 description 1
- 238000013461 design Methods 0.000 description 1
- 238000001514 detection method Methods 0.000 description 1
- 230000002452 interceptive effect Effects 0.000 description 1
- 238000010295 mobile communication Methods 0.000 description 1
- 238000012800 visualization Methods 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F40/00—Handling natural language data
- G06F40/10—Text processing
- G06F40/166—Editing, e.g. inserting or deleting
- G06F40/177—Editing, e.g. inserting or deleting of tables; using ruled lines
- G06F40/18—Editing, e.g. inserting or deleting of tables; using ruled lines of spreadsheets
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F40/00—Handling natural language data
- G06F40/10—Text processing
- G06F40/12—Use of codes for handling textual entities
- G06F40/14—Tree-structured documents
-
- 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
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- General Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Computational Linguistics (AREA)
- General Health & Medical Sciences (AREA)
- Health & Medical Sciences (AREA)
- Audiology, Speech & Language Pathology (AREA)
- Artificial Intelligence (AREA)
- Software Systems (AREA)
- User Interface Of Digital Computer (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
The invention discloses a table rule generation method and device, a storage medium and electronic equipment. The method comprises the following steps: acquiring first input data for displaying a target form, wherein the target form is a form to be generated marked by a preset language; determining a preset form rule corresponding to the first input data, wherein the preset form rule is used for determining first display data to be displayed of the target form and first structure data used for determining a first logic structure of the target form according to the first input data; displaying a first rule editing area according to the first display data and the first structure data; editing the preset table rule through the first rule editing area to obtain a target table rule used for determining second display data to be displayed of the target table and second structure data used for determining a second logic structure of the target table; and displaying the target table generated by the target table rule in a first preset area. The invention solves the technical problem of low generation efficiency of the table rule in the related technology.
Description
Technical Field
The present invention relates to the field of data processing, and in particular, to a method and an apparatus for generating table rules, a storage medium, and an electronic device.
Background
Currently, in the generation of table rules, the table rules may be written by manual writing, for example, a hypertext Markup Language (HTML) table is written by hand. However, the generation logic process of manually writing a form is complicated, and when the generation rule changes during the process of writing the generation rule of the form, the generation result of the form also changes, so that a user cannot immediately check the change of the generation result of the form due to the change of the rule, cannot immediately adjust the form rule according to the generation result of the form, and the generation efficiency of the form rule is low.
In the prior art, a scheme for drawing a table by means of a visualization tool exists, but at present, only a fixed table can be generated, different tables cannot be dynamically generated according to different input data, and the flexibility of generating a table rule is lacked. When other table rules than fixed tables need to be generated, the generation rules need to be written by hand, resulting in inefficient generation of table rules.
In view of the above-mentioned problem of low efficiency of generating table rules in the related art, no effective solution has been proposed at present.
Disclosure of Invention
The embodiment of the invention provides a method and a device for generating a table rule, a storage medium and electronic equipment, which are used for at least solving the technical problem of low generation efficiency of the table rule in the related technology.
According to an aspect of an embodiment of the present invention, a method for generating a table rule is provided. The generation method of the table rule comprises the following steps: acquiring first input data for displaying a target form, wherein the target form is a form to be generated marked by a preset language; determining a preset form rule corresponding to the first input data, wherein the preset form rule is used for determining first display data to be displayed of the target form and first structure data used for determining a first logic structure of the target form according to the first input data; displaying a first rule editing area according to the first display data and the first structure data; editing the preset table rule through the first rule editing area to obtain a target table rule used for determining second display data to be displayed of the target table and second structure data used for determining a second logic structure of the target table; and displaying the target table generated by the target table rule in a first preset area.
According to another aspect of the embodiment of the invention, an editing device for table rules is further provided. The table rule editing device comprises: the device comprises an acquisition unit, a display unit and a display unit, wherein the acquisition unit is used for acquiring first input data for displaying a target form, and the target form is a form to be generated marked by a preset language; the determining unit is used for determining a preset table rule corresponding to the first input data, wherein the preset table rule is used for determining first display data to be displayed of the target table and first structure data used for determining a first logic structure of the target table according to the first input data; the first display unit is used for displaying a first rule editing area according to the first display data and the first structure data; the editing unit is used for editing the preset table rule through the first rule editing area to obtain a target table rule used for determining second display data to be displayed of the target table and second structure data used for determining a second logic structure of the target table; the second display unit is used for displaying the target table generated through the target table rule in the first preset area, wherein the target table rule is used for determining second display data to be displayed of the target table and second structure data used for determining a second logic structure of the target table.
In the embodiment of the invention, first input data for displaying a target table is acquired, wherein the target table is a table to be generated through a preset language mark; determining a preset form rule corresponding to the first input data, wherein the preset form rule is used for determining first display data to be displayed of the target form and first structure data used for determining a first logic structure of the target form according to the first input data; displaying a first rule editing area according to the first display data and the first structure data; editing the preset table rule through the first rule editing area to obtain a target table rule used for determining second display data to be displayed of the target table and second structure data used for determining a second logic structure of the target table; the target table generated through the target table rule is displayed in the first preset area, so that the purpose of editing the table rule is achieved, the technical effect of improving the generation efficiency of the table rule is achieved, and the technical problem of low generation efficiency of the table rule in the related technology is solved.
Drawings
The accompanying drawings, which are included to provide a further understanding of the invention and are incorporated in and constitute a part of this application, illustrate embodiment(s) of the invention and together with the description serve to explain the invention without limiting the invention. In the drawings:
FIG. 1 is a diagram of a hardware environment for a method of generating a table rule according to an embodiment of the invention;
FIG. 2 is a flow chart of a method of generating a table rule according to an embodiment of the invention;
FIG. 3 is a flow diagram of a method of obtaining first input data for presenting a target form, in accordance with an embodiment of the present invention;
FIG. 4 is a flow chart of another method for obtaining first input data for presenting a target form according to an embodiment of the present invention;
FIG. 5 is a flow chart of another method of generating table rules according to an embodiment of the invention;
FIG. 6 is a flow chart of another method of generating table rules according to an embodiment of the invention;
FIG. 7 is a flow chart of a method of determining preset table rules corresponding to first input data in accordance with an embodiment of the present invention;
FIG. 8 is a flowchart of a method for editing pre-set table rules through a first rule editing area according to an embodiment of the invention;
FIG. 9 is a flow chart of another method of generating table rules according to an embodiment of the invention;
FIG. 10 is a flow chart of another method of generating table rules according to an embodiment of the invention;
FIG. 11 is a flow chart of another method of generating table rules according to an embodiment of the invention;
FIG. 12 is a flow chart of another method of generating table rules according to an embodiment of the invention;
FIG. 13 is a schematic diagram of a form editing tool according to an embodiment of the present invention;
FIG. 14 is a diagram of a table row column rule editor, in accordance with an embodiment of the present invention;
FIG. 15 is a table effect diagram generated according to table rules according to an embodiment of the present invention;
FIG. 16 is a diagram of an apparatus for editing table rules, according to an embodiment of the present invention;
FIG. 17 is a schematic diagram of another apparatus for editing table rules, according to an embodiment of the invention;
FIG. 18 is a schematic diagram of another apparatus for editing table rules, according to an embodiment of the invention; and
fig. 19 is a block diagram of a terminal according to an embodiment of the present invention.
Detailed Description
In order to make the technical solutions of the present invention better understood, 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. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
It should be noted that the terms "first," "second," and the like in the description and claims of the present invention and in the drawings described above are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the invention described herein are capable of operation in sequences other than those illustrated or described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
Example 1
According to an embodiment of the present invention, an embodiment of a method for generating a table rule is provided.
Alternatively, in the present embodiment, the above table rule generation method may be applied to a hardware environment formed by the server 102 and the terminal 104 as shown in fig. 1. Fig. 1 is a schematic diagram of a hardware environment of a table rule generation method according to an embodiment of the present invention. As shown in fig. 1, a server 102 is connected to a terminal 104 via a network including, but not limited to: the terminal 104 is not limited to a PC, a mobile phone, a tablet computer, etc. in a wide area network, a metropolitan area network, or a local area network. The table rule generating method according to the embodiment of the present invention may be executed by the server 102, the terminal 104, or both the server 102 and the terminal 104. The terminal 104 may execute the method for generating the table rule according to the embodiment of the present invention by a client installed thereon.
Fig. 2 is a flowchart of a table rule generation method according to an embodiment of the present invention. As shown in fig. 2, the table rule generating method may include the following steps:
step S202, first input data used for displaying the target table is obtained.
In the technical solution provided by step S202 of the present invention, first input data for displaying a target form is obtained, where the target form is a form to be generated through a preset language tag.
The target table is a table to be generated, and is a table marked by a preset language, for example, a table marked by a hypertext markup language, that is, the target table is an HTML table. Or a table marked by an Extensible Markup Language (XML), that is, the target table is an XML table. The method comprises the steps of obtaining first input data for displaying a target form, wherein the first input data are original input data in the process of generating a form rule of the target form, and displaying the editing effect of the form rule of the target form through the first input data, wherein the first input data can be derived from different project data. The first input data of the input may be selected in an input data selection area of a main area of the form editing tool. The first input data can be selectively input through different paths, and a data file pre-stored in a local disk can be acquired as the first input data, for example, the first input data is selected locally by automatically pulling up an operating system resource manager through a tag function of a file type. Optionally, a data file to which the first input data belongs is selected in an input data selection area of the form editing tool, when an operation instruction for selecting a local file is received, a data file selection event of the form editing tool is triggered, a background of the form editing tool monitors a scheme name of the currently selected data file through the data file selection event, and the data file is selected from a directory where the form editing tool belongs according to the scheme name of the data file to obtain the first input data of the target form. When the data file stored in the local disk does not meet the requirement for generating the target table, the data can be acquired from the remote server to serve as the first input data, for example, the first input data can be automatically downloaded through the server according to the link address of the first input data, and then the first input data is enriched.
In step S204, a preset table rule corresponding to the first input data is determined.
In the technical solution provided by step S204 of the present invention, a preset form rule corresponding to the first input data is determined, where the preset form rule is used to determine, according to the first input data, first display data to be displayed in the target form and first structure data used to determine the first logical structure of the target form.
The table rule, i.e., the table generation rule, is the logic that selects the partial data required for the target table presentation from the first input data and sets the target table structure. The preset form rule is used for determining first display data to be displayed of the target form and first structure data used for determining a first logic structure of the target form according to first input data, and is a pre-established form rule corresponding to the first input data, different first input data correspond to different preset form rules, for example, data used for displaying an olympic item corresponds to a form rule expressing olympic characteristics, and the preset form rule can be hundreds. After first input data for displaying the target form are acquired, a preset form rule corresponding to the first input data is determined.
Optionally, the preset form rule is selected in a rule scheme selection area of the form editing tool. When an operation instruction for selecting the preset form rule is received, a rule selection event is triggered, the background server monitors the scheme name of the currently selected preset form rule through the rule selection event, and a file is selected from the preset directory according to the scheme name of the preset form rule to serve as the preset form rule corresponding to the first input data.
Step S206, displaying a first rule editing area according to the first display data and the first structure data.
In the technical solution provided by step S206 of the present invention, the first rule editing area is displayed according to the first display data and the first structure data.
After determining the preset form rule corresponding to the first input data, displaying a first rule editing area according to the first display data and the first structure data, wherein the first rule editing area is a current form rule editing area and comprises first form data used for representing the first display data and the first structure data, and a currently generated form can be determined according to the first form data. Optionally, the preset table rule may be edited through the first rule editing area, for example, deleting and inserting operations.
The first rule editing area adopts Cell types to represent the cells, and the Cell types comprise Cell content, occupied row number, occupied column number and whether the Cell content is the head 4 attributes. When the Table is represented by a Table class, the Table can be regarded as a two-dimensional array, and the Cell list is an item of the two-dimensional array. When the cell list content is considered as a row of a table, the table is created row by row, that is, each item of the two-dimensional array represents a row of the table; when the cell list contents are considered to be created by column, the table is created by column, i.e., each entry of the two-dimensional array represents a column of the table.
Step S208, the preset form rule is edited through the first rule editing area, so as to obtain a target form rule for determining second display data to be displayed of the target form and second structure data for determining a second logic structure of the target form.
In the technical solution provided by step S208 of the present invention, the preset table rule is edited by the first rule editing area, so as to obtain the target table rule for determining the second display data to be displayed in the target table and the second structure data for determining the second logical structure of the target table.
After the first rule editing area is displayed according to the first display data and the first structure data, the preset form rule is edited through the first rule editing area, the code editing area is popped up by receiving a touch instruction of a preset position of the first rule editing area, and the preset form rule is edited through the code editing area to obtain a target form rule used for determining second display data to be displayed of a target form and second structure data used for determining a second logic structure of the target form.
Step S210, displaying the target table generated by the target table rule in the first preset area.
In the technical solution provided by step S210 of the present invention, the target table generated by the target table rule is displayed in the first preset area.
After editing the preset form rule through the first rule editing area, editing may be performed for the first input data, and also for the preset form rule corresponding to the first input data.
Through the steps S202 to S210, by acquiring first input data for displaying a target form, where the target form is a form to be generated marked by a preset language; determining a preset form rule corresponding to the first input data, wherein the preset form rule is used for determining first display data to be displayed of the target form and first structure data used for determining a first logic structure of the target form according to the first input data; displaying a first rule editing area according to the first display data and the first structure data; editing the preset table rule through the first rule editing area to obtain a target table rule used for determining second display data to be displayed of the target table and second structure data used for determining a second logic structure of the target table; the target table generated through the target table rule is displayed in the first preset area, so that the technical problem of low generation efficiency of the table rule in the related technology can be solved, and the technical effect of improving the generation efficiency of the table rule is achieved.
As an alternative embodiment, in step S202, acquiring the first input data for displaying the target form includes: the first input data are loaded from the server according to the link address corresponding to the first input data, and the condition that only fixed table rules can be generated is avoided, so that the generation efficiency of the table rules is improved.
FIG. 3 is a flowchart of a method for obtaining first input data for presenting a target form according to an embodiment of the present invention. As shown in fig. 3, the method for obtaining the first input data for displaying the target form includes the following steps:
in step S301, a first acquisition instruction for acquiring first input data from a server is received.
In the technical solution provided by step S301 above of the present invention, a first obtaining instruction for obtaining first input data from a server is received.
And starting a table rule editing tool, and acquiring first input data for displaying the target table after the table rule editing tool is started. The first input data may be obtained in a variety of ways, optionally by a server. The method includes receiving a first obtaining instruction for obtaining first input data from a server, for example, selecting a menu for receiving an instruction of obtaining a link address of the first form data from the server from a pull-down menu of a form editing tool, or receiving a touch signal through a preset area of a form rule editing tool to obtain the first obtaining instruction.
Step S302, a link address corresponding to the first input data is acquired according to the first acquisition instruction.
In the technical solution provided by step S302 of the present invention, a link address corresponding to the first input data is obtained according to the first obtaining instruction, where the link address is a location on the server where the first input data is stored.
The link address corresponding to the first input data may be a location where the first input data is directly obtained from the server, or may also be a link address stored on the server and used for obtaining a website corresponding to the first table data, and optionally, the link address is a Uniform Resource Locator (URL) of the first table data. After receiving a first acquisition instruction for acquiring first form data from a server, acquiring a link address corresponding to first input data according to the first acquisition instruction. Optionally, the embodiment obtains the link address corresponding to the first table data according to the first obtaining instruction by using an Asynchronous Javascript And XML (Asynchronous Javascript And XML, abbreviated as AJAX) technology, where AJAX is a web page development technology for the creative interactive web page application, And Javascript is a programming language that implements the ECMA-262 standard, which is not described herein again.
Alternatively, the link address stored in advance locally is acquired after a menu for receiving an instruction to acquire a link of the first input data from the server is selected through a pull-down menu of the form editing tool, or the link address directly input by the user may be received in a preset area of the form editing tool.
Step S303 loads the first input data from the server according to the link address.
In the technical solution provided by step S303 of the present invention, the first input data is loaded from the server according to the link address.
After the link address corresponding to the first input data is acquired according to the first acquisition instruction, an acquisition request for requesting acquisition of the first input data from the server is sent to the server according to the link address, and the server receives the acquisition request and responds to the acquisition request to obtain the first input data. After the server responds to the acquisition request, the first input data is loaded from the server, and the acquisition of the first input data for generating the target form is further realized. And the generation rule is edited on the basis of the first table data, so that the table generation efficiency is improved.
Optionally, when the target user inputs the link address corresponding to the first input data in the preset area of the form editing tool, the first input data is automatically downloaded from the server, and the form generation efficiency is improved.
The embodiment obtains the first input data from the server by receiving a first obtaining instruction; acquiring a link address corresponding to the first input data according to the first acquisition instruction, wherein the link address is a position on the server where the first input data is stored; and loading the first input data from the server according to the link address, thereby achieving the purpose of acquiring the first input data for displaying the target form.
As an alternative embodiment, in step S202, acquiring the first input data for displaying the target form includes: and acquiring the first preset file from the local according to the identification information of the first preset file, and loading the first input data.
Fig. 4 is a flowchart of another method for obtaining first input data for showing a target form according to an embodiment of the present invention. As shown in fig. 4, the method for obtaining the first input data for displaying the target form includes the following steps:
step S401, receiving a second obtaining instruction for obtaining the first input data from the local of the client.
In the technical solution provided by step S401 of the present invention, a second obtaining instruction for obtaining the first input data from the local of the client is received.
The form editing tool is started, and after the form editing tool is started, first input data used for generating the target form is acquired. The first input data may be obtained in various ways, and optionally, the first form data is obtained locally from the client, that is, the first input data is obtained through a file in a local disk. For example, a menu for receiving an instruction to locally acquire the first input data is selected from a pull-down menu of the form editing tool, or a touch signal is received through a preset area of the form editing tool to acquire the first acquisition instruction.
Step S402, acquiring the identification information of the first preset file according to the second acquisition instruction.
In the technical solution provided by step S402 of the present invention, the identification information of the first preset file is obtained according to the second obtaining instruction, where the first preset file includes the first input data.
The first preset file is a locally stored data file and includes first input data of a generation rule used for generating the target table. And after receiving a second acquisition instruction for acquiring the first Input data from the local, acquiring an Input tag function of a File (File) type of an HTML language of the first preset File in the local disk. Or receiving a storage path or name of the first preset file selected and input by the user in a preset area of the form editing tool, and acquiring the identification information of the first preset file.
Step S403, obtain a first preset file from local according to the identification information, and load first input data.
In the technical solution provided by step S403 of the present invention, a first preset file is obtained from the local according to the identification information, and the first input data is loaded.
After the identification information of the first preset file is acquired according to the second acquisition instruction, the resource manager of the operating system is automatically pulled up to select the first preset file, and the first input data in the first preset file is loaded, so that the purpose of acquiring the first input data for generating the target table is achieved. And the rules are generated by editing on the basis of the first input data, so that the table editing efficiency is improved.
The embodiment obtains the first input data from the local of the client by receiving a second obtaining instruction; acquiring identification information of a first preset file according to a second acquisition instruction, wherein the first preset file comprises first input data; and acquiring the first preset file from the local according to the identification information, and loading the first input data, thereby realizing the purpose of acquiring the first input data for displaying the target form.
As an alternative embodiment, after the first input data is loaded, the format of the first input data is processed, and the formatted first input data is displayed in the second preset area.
Fig. 5 is a flowchart of another table rule generation method according to an embodiment of the present invention. As shown in fig. 5, the method for generating the table rule further includes the following steps:
step S501, the format of the first input data is processed to obtain second input data.
In the technical solution provided in step S501 of the present invention, the format of the first input data is processed to obtain the second input data.
After the first input data is loaded, the format of the first input data may be processed by matching key components of the first input data with a preset expression, for example, matching key components of a lightweight text data exchange language (JavaScript Object Notation, JSON for short) data structure such as curly brackets, keys, and commas with a regular expression, and adding formats such as line change and indentation to different components of the first input data to obtain second input data.
Step S502, displaying the second input data in a second preset area.
In the technical solution provided by step S502 of the present invention, the second input data is displayed in the second preset area.
After the format of the first input data is processed to obtain second input data, the second input data is displayed in a second preset area, namely, the format of the first input data is processed and then previewed in an input data previewing area, so that the readability of the data is enhanced, developers can easily check the second input data, and the state of the input data in the generating process of the form rule can be known in time.
In the embodiment, after the first input data is loaded, the format of the first input data is processed to obtain second input data; and the second input data is displayed in the second preset area, so that the efficiency of generating the table rule is improved.
As an alternative embodiment, after determining a preset table rule corresponding to the first input data, displaying, in a third preset area, first output data obtained by processing a format of the first display data; after the preset table rule is edited through the first rule editing area to obtain a target table rule used for determining second display data to be displayed of the target table and second structure data used for determining a second logic structure of the target table, the first output data is updated in a third preset area to be second output data obtained by processing the format of the second display data.
Fig. 6 is a flowchart of another table rule generation method according to an embodiment of the present invention. As shown in fig. 6, the method for generating the table rule further includes the following steps:
step S601, processing the format of the first display data to obtain first output data.
In the technical solution provided in step S601 of the present invention, the format of the first display data is processed to obtain first output data.
After first input data used for displaying a target table is obtained, a preset table rule corresponding to the first input data is determined, first display data to be displayed of the target table is determined according to the preset table rule, the format of the first display data can be processed by matching key components of the first display data with a preset expression, for example, matching key components of a JSON data structure such as curly brackets, keys and commas with a regular expression, and formats such as line feed, indentation and the like are added to different components of the first display data, so that first output data are obtained.
Step S602, displaying the first output data in a third preset area.
In the technical solution provided by step S602 of the present invention, the first output data is displayed in a third preset area.
After the format of the first display data is processed to obtain the first output data, the first output data is displayed in a third preset area, namely, the format of the first display data is processed and then previewed in an output data previewing area, so that the readability of the data is enhanced, developers can easily check the first output data, and the state of the output data in the generation process of the form rule can be known in time.
Step S603, processing the format of the second display data to obtain second output data.
In the technical solution provided in step S603 of the present invention, the format of the second display data is processed to obtain second output data.
After the preset table rule is edited through the first rule editing area to obtain a target table rule used for determining second display data to be displayed of the target table and second structure data used for determining a second logic structure of the target table, the second display data to be displayed of the target table is determined according to the target table rule, the format of the second display data can be processed by adopting a preset expression to match key components of the second display data, for example, a regular expression to match key components of a JSON data structure such as braces, keys and commas, and formats such as line change and indentation are added to different components of the second display data to obtain second output data.
In step S604, the first output data is updated to the second output data in the third predetermined area.
In the technical solution provided by step S604 of the present invention, the first output data is updated to be the second output data in the third preset area.
After the format of the second display data is processed to obtain the second output data, the first output data is updated to be the second output data in the third preset area, namely, the preview is performed in the output data preview area after the format of the second display data is processed, so that the readability of the data is enhanced, developers can easily check the second output data, timely know the state of the output data in the generation process of the form rule, timely check the change of the result caused by the change of the form rule, timely correct the form rule, and improve the efficiency of writing the form rule.
In the embodiment, after the preset table rule corresponding to the first input data is determined, the format of the first display data is processed to obtain first output data; displaying the first output data in a third preset area; after the preset table rule is edited through the first rule editing area to obtain a target table rule used for determining second display data to be displayed of the target table and second structure data used for determining a second logic structure of the target table, the method further includes: processing the format of the second display data to obtain second output data; and the first output data is updated to be the second output data in the third preset area, so that the efficiency of writing the table rule is improved.
As an alternative embodiment, the step S204, determining the preset table rule corresponding to the first input data includes: and increasing a selection instruction for selecting the preset table rule, searching a second preset file corresponding to the rule name from the preset directory, and acquiring the preset table rule from the second preset file.
Fig. 7 is a flowchart of a method of determining a preset form rule corresponding to first input data according to an embodiment of the present invention. As shown in fig. 7, the method of determining the preset form rule corresponding to the first input data includes the steps of:
in step S701, a selection instruction for selecting a preset form rule is received.
In the technical solution provided by step S701 of the present invention, a selection instruction for selecting a preset table rule is received.
The preset form rule is a pre-established form rule corresponding to different first input data. After first input data for showing the target table are acquired, a selection instruction for selecting a preset table rule is received. The user can select a preset form rule in the form rule scheme selection area, a menu change event is triggered at the moment, and the background can monitor the behavior of the user selecting the menu through a preset function, for example, the behavior of the user selecting the menu is monitored through an addEventListener function.
Step S702, detecting the rule name of the preset table rule according to the selection instruction.
In the technical solution provided by step S702 of the present invention, the rule name of the preset table rule is detected according to the selection instruction.
After receiving a selection instruction for selecting the preset form rule, the rule name of the preset form rule is detected according to the selection instruction. Optionally, after the behavior of the user selection menu is monitored through the addEventListener function, the scheme name of the table rule currently selected by the user can be further detected through the function.
Step S703, a second preset file corresponding to the rule name is searched from the preset directory.
In the above step S703 of the present invention, in the provided technical solution, a second preset file corresponding to the rule name is searched from a preset directory, where the second preset file includes a preset table rule.
After detecting the rule name of the preset table rule according to the selection instruction, an index.js file, which is a second preset file corresponding to the rule name found from the preset directory, may be found from a subdirectory under the directory where the table rule editor is located and having the same name as the preset table rule name.
Step S704, in a case that the second preset file is found, obtaining a preset table rule from the second preset file.
In the technical solution provided in step S704 of the present invention, when the second preset file is found, the preset table rule is obtained from the second preset file.
Js file may be used as a preset table rule in case that the second preset file is found.
The embodiment is realized by receiving a selection instruction for selecting a preset table rule; detecting a rule name of a preset table rule according to a selection instruction; searching a second preset file corresponding to the rule name from the preset directory, wherein the second preset file comprises a preset table rule; and under the condition that the second preset file is found, the preset form rule is obtained from the second preset file, so that the aim of determining the preset form rule corresponding to the first input data is fulfilled.
As an alternative embodiment, in step S208, the editing the preset table rule through the first rule editing area to obtain the target table rule for determining the second display data to be displayed in the target table and the second structure data for determining the second logical structure of the target table includes: displaying a second rule editing area according to a first editing instruction, namely a first editing instruction, received by the first rule editing area and used for editing a preset table rule; receiving a second editing instruction through a second rule editing area; and editing the preset rule codes according to the second editing instruction to obtain the target table rule.
Fig. 8 is a flowchart of a method for editing a preset form rule through a first rule editing area according to an embodiment of the present invention. As shown in fig. 8, the method for editing the preset table rule through the first rule editing area includes the following steps:
in step S801, a first editing instruction for editing a preset form rule is received through a first rule editing area.
In the technical solution provided by step S801 described above, a first editing instruction for editing the preset form rule is received through the first rule editing area.
And displaying a first rule editing area according to the first display data and the first structure data, wherein the first rule editing area comprises buttons which can be touched when the preset table rule is edited, such as an 'insert' button, a 'delete' button, a button for editing a cell and the like. After the first rule editing area is displayed according to the first display data and the first structure data, a user can click a button on the first rule editing area to generate a first editing instruction for editing the preset table rule, so that the first editing instruction is received through the first rule editing area.
Step S802, displaying a second rule editing area according to the first editing instruction.
In the technical solution provided by step S802 of the present invention, a second rule editing area is displayed according to the first editing instruction, wherein the second rule editing area displays a preset rule code corresponding to a preset table rule.
Js binds the rule of a row or column to the button of the first rule edit area using the MVVM framework vue. The MVVM framework is a design mode of binding a data model and a graph area. After receiving a first editing instruction for editing a preset table rule through a first rule editing area, displaying a second rule editing area according to the first editing instruction, where the second rule editing area is an interface for displaying and editing a preset rule code corresponding to the preset table rule, that is, displaying and editing a code corresponding to a touched button in the first rule editing area, for example, displaying a row or a column of rule codes corresponding to cells of a table in the first rule editing area. Optionally, if the table corresponding to the preset rule is a table created according to rows, a rule of one row is clicked to edit the cell, and if the table corresponding to the preset rule is a table created according to columns, a rule of one column is clicked to edit the cell.
In step S803, a second editing instruction is received through the second rule editing area.
In the technical solution provided by step S803 of the present invention, a second editing instruction is received through the second rule editing area.
After the second rule edit area is displayed according to the first edit instruction, the user can input an input signal for starting editing of the preset form rule through the second rule edit area, and input an edit code, so that the second rule edit area receives the second edit instruction.
Step S804, editing the preset rule code according to the second editing instruction to obtain the target table rule.
In the technical solution provided by step S804 of the present invention, the preset rule code is edited according to the second editing instruction, so as to obtain the target table rule.
After receiving the second editing instruction through the second rule editing area, editing the preset rule code according to the second editing instruction, editing the row code of the preset rule code according to the second editing instruction to obtain the row rule of the target table rule, and editing the column code of the preset rule code according to the second editing instruction to obtain the column rule of the target table. After the preset rule code is edited according to the second editing instruction, receiving an instruction for indicating that the preset rule code is edited according to the second editing instruction, for example, receiving a submit instruction through a "submit" button on the second rule editing area, generating a target form rule, checking the correctness of the target form rule, and if the target form rule is correct, saving the target form rule.
The embodiment receives a first editing instruction for editing the preset table rule through a first rule editing area; displaying a second rule editing area according to the first editing instruction, wherein the second rule editing area displays preset rule codes corresponding to preset table rules; receiving a second editing instruction through a second rule editing area; and editing the preset rule code according to the second editing instruction to obtain the target table rule, so that the purpose of editing the preset table rule by the first rule editing area to obtain the target table rule is realized, and the generation efficiency of the table rule is improved.
As an alternative embodiment, the first rule editing area displays first table data used for representing the first display data and the first structure data, and in step S804, the preset rule code is edited according to the second editing instruction to obtain the target table rule, and then the first table data is updated in the first rule editing area to be second table data used for representing the second display data and the second structure data.
The first rule editing area displays first table data for representing first display data and first structure data, for example, the first table data includes cell contents, occupied row numbers, occupied column numbers, and whether the first table data is the top 4 attributes. Optionally, the Cell is represented by a Cell class in the Table rule editor in this embodiment, the Cell list is formed by placing a plurality of Cell class instances in an array, the Table is formed by placing a plurality of Cell lists in an array, and the Table can be represented by a Table class. When the cell list content is regarded as a row of the table, the table is created according to the row, namely each item of the two-dimensional array represents one row of the table; when the cell list contents are considered to be created by column, the table is said to be created by column, i.e., each entry of the two-dimensional array represents a column of the table. After the preset rule code is edited according to the second editing instruction to obtain the target table rule, the first table data comprises cell contents, occupied line numbers, occupied column numbers and whether the first 4 attributes are changed along with the change of the preset rule to obtain second table data, and the first table data is updated in the first rule editing area to be the second table data used for representing second display data and second structure data, so that the data or the structure of the target table can be updated and displayed along with the change of the table rule, a user can know the generation process of the table rule in time, and the generation efficiency of the table rule is improved.
As an alternative embodiment, the step S801 of receiving a first editing instruction for editing the preset table rule through the first rule editing area includes: receiving a line editing instruction for editing a preset line rule through a first rule editing area; or receiving a column editing instruction for editing a preset column rule through a first rule editing area, wherein the preset row rule is used for determining a first row attribute of the target table, the preset column rule is used for determining a first column attribute of the target table, and the preset table rule comprises a preset row rule and a preset column rule; step S804, editing the preset rule code according to the second editing instruction, and obtaining the target table rule includes: editing the preset line rule codes according to the second editing instruction to obtain target line rules, wherein the preset rule codes comprise preset line rule codes, and the target line rules are used for determining second line attributes of the target table; or editing the preset column rule codes according to the second editing instruction to obtain the target column rule, wherein the preset rule codes comprise preset column rule codes, and the target column rule is used for determining the second column attribute of the target table.
The preset table rules include preset row rules for determining a first row attribute of the target table and preset column rules for determining a first column attribute of the target table. When the content of the cell list is regarded as a row of the table, the table is created according to the row, a rule of one row is edited by clicking the cell of the first rule editing area, and a row editing instruction for editing a preset row rule is received through the first rule editing area. When the cell list content is regarded as being created according to columns, the table is created according to columns, the cell editing of the first rule editing area is clicked to edit the rules of one column, and a column editing instruction for editing the preset column rules is received through the first rule editing area, so that the first editing instruction for editing the preset table rules is received through the first rule editing area. The preset rule codes comprise preset line rule codes and preset column rule codes, and after a second editing instruction is received through a second rule editing area, the preset line rule codes are edited according to the second editing instruction to obtain line rule codes for determining a second line attribute of the target table; or editing the preset column rule codes according to the second editing instruction to obtain column rule codes for determining the second column attribute of the target table, and finally, finishing and confirming the editing of the preset rule codes to obtain the target table rule, so that the purpose of editing the preset rule codes according to the second editing instruction to obtain the target table rule is achieved.
As an alternative embodiment, after the target table is displayed in the first preset area, a third rule editing area is displayed according to a third editing instruction for editing preset table rules received in the first preset area, and the third editing instruction is received through the third rule editing area; and editing the preset rule codes according to the third editing instruction to obtain the target table rule.
Fig. 9 is a flowchart of another table rule generation method according to an embodiment of the present invention. As shown in fig. 9, the method for generating the table rule further includes the following steps:
in step S901, a third editing instruction for editing the preset table rule is received through the first preset area.
In the technical solution provided by step S901 above, a third editing instruction for editing the preset table rule is received through the first preset area.
This embodiment employs a MVVM framework bi-directional binding function. After the target table is displayed in the first preset area, the table rule is reversely adjusted through the target table so as to further optimize the table rule. A third editing instruction for editing the preset form rule may be received through the first preset area. That is, the user clicks a certain cell of the target table displayed in the first preset area to generate a third editing instruction.
Step S902, displaying a third rule editing area according to the third editing instruction.
In the technical solution provided by step S902 of the present invention, a third rule editing area is displayed according to a third editing instruction, where the third rule editing area displays a preset rule code corresponding to a preset table rule.
After a third editing instruction for editing the preset form rule is received through the first preset area, the third rule editing area is displayed according to the third editing instruction, that is, a user clicks one cell of the target form displayed in the first preset area to generate a third editing instruction, and an editing interface for editing the preset form rule code is popped up. Optionally, the third rule editing area of this embodiment is the same as the second rule editing area described above, and shows the rule codes of the row or the column where the cells of the target table are located.
In step S903, a third editing instruction is received through the third rule editing area.
In the technical solution provided in step S903 above, a third editing instruction is received through a third rule editing area.
After the third rule edit area is displayed according to the second edit instruction, the user can input an input signal to start editing the preset form rule through the third rule edit area, and input an edit code, so that the third rule edit area receives the third edit instruction.
And step S904, editing the preset rule code according to the third editing instruction to obtain the target table rule.
In the technical solution provided by step S904 of the present invention, the preset rule code is edited according to the third editing instruction, so as to obtain the target table rule.
After receiving the third editing instruction through the third rule editing area, editing the preset rule code according to the third editing instruction, editing the line code of the preset rule code according to the third editing instruction to obtain the line rule of the target table rule, and editing the column code of the preset rule code according to the third editing instruction to obtain the column rule of the target table. After the preset rule code is edited according to the third editing instruction, receiving an instruction for indicating that the preset rule code is edited according to the third editing instruction, for example, receiving a submit instruction through a "submit" button on the third rule editing area, generating a target form rule, checking the correctness of the target form rule, and if the target form rule is correct, saving the target form rule.
The embodiment receives a third editing instruction for editing the preset table rule through the first preset area after the target table is displayed in the first preset area; displaying a third rule editing area according to a third editing instruction, wherein the third rule editing area displays preset rule codes corresponding to preset table rules; receiving a third editing instruction through a third rule editing area; and editing the preset rule codes according to the third editing instruction to obtain the target table rule, so that the purpose of editing the table rule is realized, and the generation efficiency of the table rule is improved.
As an alternative embodiment, after the preset table rule is edited to obtain the target table rule, the target table rule is saved under the condition that the target table rule is judged to meet the preset condition.
Fig. 10 is a flowchart of another table rule generation method according to an embodiment of the present invention. As shown in fig. 10, the method for generating the table rule further includes the following steps:
step S1001, determine whether the target table rule meets a preset condition.
In the technical solution provided in step S1001 above, it is determined whether the target table rule meets a preset condition.
After the preset form rule is edited to obtain the target form rule, an instruction for indicating that the preset form rule is edited is received, for example, after the preset form rule code is edited through the second rule editing area and the third rule editing area, a "submit" button is clicked, and then the inside of the form rule editor adopts an esprima library to analyze whether the syntax of the target form rule code is wrong.
Step S1002, a target table rule is saved.
In the technical solution provided by step S1002 of the present invention, if it is determined that the target table rule meets the preset condition, the target table rule is saved. Optionally, in the case that the syntax of the target table rule code is analyzed by the esprima library without error, the target table rule is saved, that is, the table configuration is saved, a background is notified to update the table rule file, and simultaneously the target table displayed in the first preset area, the second output data displayed in the second preset area, and the second table data displayed in the first rule editing area are all updated along with the target table rule.
In the embodiment, each time the tool initializes or updates the Table rule, the parsing logic of the Table is triggered, and if the instance of the Table class is parsed, the instance of the Table class is bound to the interface through the MVVM, so that the Table displayed on the interface changes with the change of input data, differs with the difference of the selection of the preset Table rule, and differs with the difference of the logic of editing the preset Table rule code, which greatly facilitates the developer to write the Table generation rule, and improves the efficiency of editing the Table rule.
In the embodiment, after the preset table rule is edited to obtain the target table rule, whether the target table rule meets the preset condition is judged; if the target table rule is judged to accord with the preset condition, the target table rule is stored, so that the table rule is updated, and the table rule editing efficiency is improved.
Example 2
The technical solution of the present invention will be described below with reference to preferred embodiments. Specifically, a table rule generation method of an HTML table is described.
Fig. 11 is a flowchart of another table rule generation method according to an embodiment of the present invention. As shown in fig. 11, the method for generating the table rule includes the following steps:
in step S1101, the HTML form rule development tool is started.
The HTML form rule development tool of this embodiment is an HTML form rule editor.
In step S1102, it is determined whether the input data is from a file.
This embodiment supports multiple ways of obtaining input data for presenting a target form. After the HTML form rule development tool is launched, it is determined whether the input data to be acquired is from a file. If the input data is judged to be from the file, step S1103 is performed, and if the input data is judged not to be from the file, step 1104 is performed.
Step S1103 selects a file from the local disk.
After determining whether the input data is from a file, if the input data is determined to be from a file, selecting a file from the local disk. Optionally, through the File type input tag function of the HTML language, the HTML form rule development tool can automatically pull up the operating system resource manager to select a File from the local disk. After selecting a file from within the local disk, step S1105 is performed.
In step S1104, a link address of the input data is acquired.
After determining whether the input data is from a file, if the input data is determined not to be from a file, the input data may be obtained from a remote Web server, and optionally, the user may fill in or select a link address within an input box of the HTML form rule development tool using Ajax techniques to obtain the data from the remote Web server.
Step S1105, automatically loads input data.
After selecting the file from the local disk, loading input data of an HTML table rule development tool according to the file selected from the local disk; and automatically downloading the input data at the link address of the acquired input data.
In step S1106, click the configuration area, and obtain a row or a column of table rules in the popped editor.
After the input data is automatically loaded, the configuration area, that is, the first rule editing area in the above-described embodiment is clicked, and the user fills in the form rule of one row or one column in the popped-up editor, thereby acquiring the form rule of one row or one column. The editor is also the second rule editing area in the above embodiment. When the table is a table created by rows, a row rule code of the table rule is filled in the editor, and when the table is a table created by columns, a column rule code of the table rule is filled in the editor.
In step S1107, it is determined whether the table rule is correct.
After a row or a column of table rules are obtained in the popped editor, whether the table rules are correct or not is judged, and an esprima library can be adopted to analyze whether the rule code syntax is wrong or not. If the table rule is judged to be correct, step S1108 is executed, and if the table rule is judged to be incorrect, step S1106 is executed, the configuration area is continuously clicked, and the table rule of one row or one column is acquired in the popped editor.
In step S1108, the table rule is saved.
After judging whether the form rule is correct or not, if so, updating the rule file through an HTML (hypertext markup language) form rule development tool background, further storing the form rule, and completing the configuration of the form rule.
According to the embodiment, whether the input data come from the file is judged by starting an HTML form rule development tool, if the input data come from the file is judged, the file is selected from a local disk, if the input data do not come from the file is judged, a link address of the input data is obtained, the input data are automatically loaded, a configuration area is clicked, a row or column of form rules are obtained in a popped-up editor, whether the form rules are correct is judged, the form rules are saved under the condition that the form rules are correct, and the generation efficiency of the form rules is improved.
Fig. 12 is a flowchart of another table rule generation method according to an embodiment of the present invention. As shown in fig. 12, the method for generating the table rule includes the following steps:
in step S1201, after the target form rule is generated, the input data is newly acquired.
Step S1202, determining the Table rule of the Table type example, binding the rule of the row or the column to the button of the interface through the MVVM, and editing the Table rule.
In step S1203, an HTML table is generated according to the edited table rule.
According to the embodiment, the input data is obtained again after the target Table rule is generated, the Table rule of the Table type example is determined, the rules of the rows or the columns are bound to the buttons of the interface through the MVVM, the Table rule is edited, and the HTML Table is generated according to the edited Table rule, so that the problems that the logic process of manually writing the HTML Table to generate the HTML Table is complicated, the result change caused by rule change cannot be checked in time in the process of writing the rule, and the efficiency is low are solved. The embodiment is preferably designed aiming at the HTML form, and can conveniently assist a developer to write the HTML form generation rule, so that the function of dynamically generating different forms according to different input data is achieved.
It should be noted that, the above embodiment adopts an HTML table as a preferred implementation method of the embodiment of the present invention, and is not limited to that the table is only an HTML table, and any table that can verify the generation efficiency of the table rule is within the protection scope of the present invention, and details thereof are not repeated here.
Example 3
The application environment of the embodiment of the present invention may refer to the application environment in the above embodiments, but is not described herein again. The embodiment of the invention provides an optional specific application for implementing the table rule generation method.
FIG. 13 is a diagram of a form editing tool according to an embodiment of the present invention. As shown in fig. 13, the form editing tool of this embodiment includes an input data selection area, an input data preview area, a form rule scheme selection area, a current form rule editing area, a form preview area, and an output data preview area.
The following are an input data selection area, an input data preview area, a form rule scheme selection area, a current form rule edit area, a form preview area and an output data preview area, respectively.
(1) Input data selection area
The input data selection area has an input data acquisition function, and the input data is used for displaying a target table, specifically, a source of data required by displaying the target table is selected according to a preset rule, and the source of the data can be JSON data. This embodiment supports the use of files in the local disk and data from a remote Web server as input data. The file type input tag function of HTML language is used for obtaining local disk data, so that a form editing tool can automatically pull up an operating system resource manager to select a file, wherein the file is a JSON file; the Ajax technology is used for obtaining the remote Web server data, input data can be automatically downloaded when a user fills a link in an input box, and the input data can be obtained through a URL (uniform resource locator) of the input data.
(2) Input data preview area
After the input data are obtained, the format of the input data is processed, a regular expression can be used for matching key components of a JSON data structure, such as curly brackets, keys, values, commas and the like, after the input data are obtained, formats such as line feed, indentation and the like are added to different components of the data, the input data are previewed, and developers can check the input data in time.
(3) Table rule scheme selection field
After the input data is acquired, a preset form rule corresponding to the input data is acquired. The preset form rule is used for selecting the part of data required by the target form display from the input data and setting the form structure. The different first input data correspond to different preset table rules, for example, the data for showing the olympic games correspond to table rules expressing olympic games, which may be hundreds of types. After the input data for displaying the target form is acquired, the preset form rule corresponding to the input data is determined. Optionally, a selection instruction for selecting a preset table rule is received. The user can select a preset form rule in the form rule scheme selection area, a menu change event is triggered at the moment, and the background can monitor the behavior of the user selecting the menu through a preset function, for example, the behavior of the user selecting the menu is monitored through an addEventListener function. And detecting the name of the table rule scheme currently selected by the user through the function, and searching an ex.json file as input data and an index.js as a table generation rule from a subdirectory under the directory where the tool is located and having the same name as the name of the table rule scheme.
(4) Current form rule edit section
After the input data are acquired and the preset form rule is determined, first display data for determining a first logic structure of the target form to be displayed according to the first input data and first structure data for determining the first logic structure of the target form are determined, and a current rule editing area is displayed according to the first display data and the first structure data, wherein the current rule editing area comprises form data for representing the first display data and the first structure data, an 'inserting' button for inserting operation and a 'deleting' button for deleting operation.
The table editing tool uses Cell types to represent cells, and the Cell types comprise Cell contents, occupied row numbers, occupied column numbers and whether the Cell contents are 4 attributes of a header. The Cell list is formed by putting a plurality of Cell type examples into an array, a Table is formed by putting a plurality of Cell type examples into an array, the Table is represented by adopting a Table type, the Table can be regarded as a two-dimensional array at the moment, and the Cell list is an item of the two-dimensional array. When the cell list content is regarded as a row of the table, the table is created by the row, namely each item of the two-dimensional array represents one row of the table; when the cell list contents are considered to be created by column, the table is created by column, i.e., each entry of the two-dimensional array represents a column of the table.
Optionally, the table data used for representing the first presentation data and the first structure data is displayed in the current table rule edit area, and includes, from top to bottom, from left to right: [ { html: "stage", rowSpan:3} ], used for indicating that the number of rows of "stage" in the table cell is 3, and the number of columns is 1; { html: "ball holding", colSpan:2} ], which is used for indicating that the number of lines of the "ball holding" in the table unit is 1 and the number of columns is 2; [ { html: "number of held balls", rowSpan:2} ], the number of lines used to represent the "number of held balls" in the table cell is 2, and the number of columns is 1; [ { html: "time", rowSpan:2} ], the number of rows used to represent "time" in the table cell is 2, and the number of columns is 1; [ { html: "goal/loss of goal", colSpan:8} ], which is used for indicating that the number of lines of the "goal/loss of goal" in the table unit is 1, and the number of columns is 8; [ { html: "shot by shot", colSpan:2} ], which is used for indicating that the row number of the "shot by shot" in the table unit is 1 and the column number is 2; { html: "goal" } for indicating the number of rows of "stage" in the table cell is 1, and the number of columns is 1; { html: "loss" } for indicating that the number of rows and columns of "loss" in a table cell is 1; [ { html: "attack gate", colSpan:2} ], which is used for indicating that the number of rows of the "attack gate" in the table unit is 1 and the number of columns is 2; { html: "goal" } for indicating that the number of rows and columns of "goal" in the table cell is 1; { html: "loss" } for indicating that the number of rows and columns of "loss" in a table cell is 1; [ { html: "free sphere", colSpan:2} ], which is used for indicating that the number of rows of the "free sphere" in the table unit is 1 and the number of columns is 2; { html: "goal" } for indicating that the number of rows and columns of "goal" in the table cell is 1; { html: "loss" } for indicating that the number of rows and columns of "loss" in a table cell is 1; [ { html: "5 m shoot", colSpan:2} ], which is used for indicating that the row number of the "5 m shoot" in the table unit is 1, and the column number is 2; { html: "goal" } for indicating that the number of rows and columns of "goal" in the table cell is 1; { html: "loss" } for indicating that the number of rows and columns of "loss" in a table cell is 1; [ { html: "cornephere", rowSpan:3} ], for indicating the "cornephere" in the table cell, the number of rows is 3 and the number of columns is 1.
(5) Form preview area for input data output according to current rule
And corresponding to the data of the cells of the table displayed in the current table rule editing area, the input data is output according to the current rule in the table preview area, the table preview area outputs the table according to the input data and the currently selected preset table rule, and the final effect of the table is obtained. The cell "stage", "number of held balls", "time", "goal/lost ball", "shot with how many times", "goal", "shot", "free ball", "goal", "shot", "5 m shot", "goal", "shot", and "corner ball" correspond to the table data displayed in the current table rule edit area. And other data are selected from the input data according to preset table rules.
(6) Output data preview area
After a preset table rule corresponding to the input data is determined, processing the format of the first display data to obtain first output data; displaying the output data in the first output data preview area; after the preset table rule is edited through the current table rule editing area to obtain a target table rule used for determining second display data to be displayed of a target table and second structure data used for determining a second logic structure of the target table, processing the format of the second display data to obtain second output data; and updating the first output data into second output data in the output data preview area.
(7) Table rule editor area
Js, the user clicks a button of the current form rule edit area or enters a certain cell of the form in the form preview area, where the input data is output according to the current rule, and the interface shown in fig. 14 pops up. FIG. 14 is a diagram of a table row and column rule editor, according to an embodiment of the invention. As shown in fig. 14, the rule codes of the row or the column of the cell are shown (the table created by the row, the rule of the row is edited by clicking the cell, the table created by the column, and the rule of the column is edited by clicking the cell), and the rule codes of the row or the column of the cell are edited, so that the preset table rule is edited. After the rule codes edited by the preset form rules are finished, clicking 'submission' on a rule editing interface, analyzing whether the rule codes are wrong or not by adopting an esprima library in a form editing tool, if the rule codes are wrong, informing a tool background to update the rule files, and simultaneously updating the data or the structures of three areas, namely an output data preview area, a current form rule editing area and a form preview area of which the input data are output according to the current rules according to the latest rules.
And when the tool initializes or a user updates the rule, the form analysis logic is triggered, the analysis result is a Table type instance, and the instance is bound to the interface through the MVVM, so that the form of the interface can change along with the change of the data, and the writing of the form generation rule by a developer is greatly facilitated.
Fig. 15 is a diagram illustrating the effect of a table generated according to the table rule according to the embodiment of the present invention. As shown in fig. 15, the table editing tool uses Cell classes to represent cells inside, and such classes include Cell contents, occupied row number, occupied column number, and whether the Cell contents are the top 4 attributes. Putting a plurality of Cell type instances into an array forms a Cell list, and when a plurality of Cell types are put into an array, a Table is formed and is represented by a Table type. The game data statistical table of sports items is generated according to the generation method of the table rule, the table displays the information in the game process of China to Japan, including the information of each game, athletes, scores and the like, and the table can be changed according to the change of the table rule or the change of the input data or simultaneously according to the change of the table rule and the change of the input data, so that the table generation efficiency is improved.
It should be noted that, for simplicity of description, the above-mentioned method embodiments are described as a series of acts or combination of acts, but those skilled in the art will recognize that the present invention is not limited by the order of acts, as some steps may occur in other orders or concurrently in accordance with the invention. Further, those skilled in the art should also appreciate that the embodiments described in the specification are preferred embodiments and that the acts and modules referred to are not necessarily required by the invention.
Through the above description of the embodiments, those skilled in the art can clearly understand that the method according to the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but the former is a better implementation mode in many cases. Based on such understanding, the technical solutions of the present invention may be embodied in the form of a software product, which is stored in a storage medium (e.g., ROM/RAM, magnetic disk, optical disk) and includes instructions for enabling a terminal device (e.g., a mobile phone, a computer, a server, or a network device) to execute the method according to the embodiments of the present invention.
Example 4
According to the embodiment of the invention, the invention further provides a table rule editing device for implementing the table rule generating method. Fig. 16 is a schematic diagram of an apparatus for editing table rules according to an embodiment of the present invention. As shown in fig. 16, the table rule editing device may include: the device comprises an acquisition unit 10, a determination unit 20, a first display unit 30, an editing unit 40 and a second display unit 50.
The obtaining unit 10 is configured to obtain first input data for displaying a target table, where the target table is a table to be generated through a preset language tag.
The determining unit 20 is configured to determine a preset form rule corresponding to the first input data, where the preset form rule is used to determine, according to the first input data, first display data to be displayed in the target form and first structure data used to determine a first logical structure of the target form.
The first display unit 30 is configured to display the first rule editing area according to the first display data and the first structure data.
The editing unit 40 is configured to edit the preset table rule through the first rule editing area, so as to obtain a target table rule used for determining second display data to be displayed in the target table and second structure data used for determining a second logic structure of the target table.
The second display unit 50 is configured to display, in the first preset area, the target table generated by the target table rule, where the target table rule is used to determine second display data to be displayed by the target table and second structure data used to determine a second logical structure of the target table.
It should be noted that the obtaining unit 10 in this embodiment may be configured to execute step S202 in embodiment 1 of this application, the determining unit 20 in this embodiment may be configured to execute step S204 in embodiment 1 of this application, the first displaying unit 30 in this embodiment may be configured to execute step S206 in embodiment 1 of this application, the editing unit 40 in this embodiment may be configured to execute step S208 in embodiment 1 of this application, and the second displaying unit 50 in this embodiment may be configured to execute step S210 in embodiment 1 of this application.
Fig. 17 is a schematic diagram of another table rule editing apparatus according to an embodiment of the present invention. As shown in fig. 17, the table rule editing device may include: the device comprises an acquisition unit 10, a determination unit 20, a first display unit 30, an editing unit 40 and a second display unit 50. Wherein, the obtaining unit 10 includes: a first receiving module 11, a first obtaining module 12 and a first loading module 13.
The first receiving module 11 is configured to receive a first obtaining instruction for obtaining first input data from a server.
The first obtaining module 12 is configured to obtain a link address corresponding to the first input data according to the first obtaining instruction, where the link address is a location on the server where the first input data is stored.
A first loading module 13, configured to load the first input data from the server according to the link address.
Fig. 18 is a schematic diagram of another table rule editing apparatus according to an embodiment of the present invention. As shown in fig. 18, the table rule editing device may include: the device comprises an acquisition unit 10, a determination unit 20, a first display unit 30, an editing unit 40 and a second display unit 50. Wherein, the obtaining unit 10 includes: a second receiving module 14, a second obtaining module 15 and a second loading module 16.
The second receiving module 14 is configured to receive a second obtaining instruction for obtaining the first input data from the local of the client.
The second obtaining module 15 is configured to obtain identification information of a first preset file according to a second obtaining instruction, where the first preset file includes first input data.
And the second loading module 16 is configured to obtain the first preset file from the local according to the identification information, and load the first input data.
Optionally, the apparatus for editing table rules in the above embodiment further includes: the processing unit is used for processing the format of the first input data after the first input data is loaded to obtain second input data; and the third display unit is used for displaying the second input data in a second preset area.
Optionally, the apparatus for editing table rules further includes: the device comprises a first processing unit, a fourth display unit, a second processing unit and a first updating unit. The first processing unit is used for processing the format of the first display data after determining a preset table rule corresponding to the first input data to obtain first output data; the fourth display unit is used for displaying the first output data in a third preset area; the second processing unit is used for editing the preset table rule through the first rule editing area to obtain a target table rule used for determining second display data to be displayed of the target table and second structure data used for determining a second logic structure of the target table, and then processing the format of the second display data to obtain second output data; the first updating unit is used for updating the first output data into second output data in a third preset area.
Optionally, the determining unit 20 includes: the device comprises a third receiving module, a searching module and a third obtaining module. The third receiving module is used for receiving a selection instruction for selecting the preset table rule; the detection module is used for detecting the rule name of the preset table rule according to the selection instruction; the searching module is used for searching a second preset file corresponding to the rule name from the preset directory, wherein the second preset file comprises a preset table rule; and the third obtaining module is used for obtaining the preset table rule from the second preset file under the condition that the second preset file is found.
Optionally, the editing unit 40 includes: the device comprises a fourth receiving module, a display module, a fifth receiving module and an editing module. The fourth receiving module is used for receiving a first editing instruction for editing the preset table rule through the first rule editing area; the display module is used for displaying a second rule editing area according to the first editing instruction, wherein the second rule editing area displays preset rule codes corresponding to the preset table rules; the fifth receiving module is used for receiving a second editing instruction through the second rule editing area; and the editing module is used for editing the preset rule codes according to the second editing instruction to obtain the target table rule.
Optionally, the first rule editing area displays first table data used for representing the first display data and the first structure data, and after editing the preset rule code according to the second editing instruction to obtain the target table rule, the table rule editing apparatus further includes: and the second updating unit is used for updating the first table data in the first rule editing area into second table data used for representing second display data and second structure data.
Optionally, the fourth receiving module is configured to receive, through the first rule editing area, a line editing instruction for editing a preset line rule; or receiving a column editing instruction for editing a preset column rule through the first rule editing area, wherein the preset row rule is used for determining a first row attribute of the target table, the preset column rule is used for determining a first column attribute of the target table, and the preset table rule comprises a preset row rule and a preset column rule. The editing module is used for editing the preset line rule codes according to the second editing instruction to obtain target line rules, wherein the preset line rule codes comprise preset line rule codes, and the target line rules are used for determining second line attributes of the target table; or editing the preset column rule codes according to the second editing instruction to obtain the target column rule, wherein the preset rule codes comprise preset column rule codes, and the target column rule is used for determining the second column attribute of the target table.
Optionally, the apparatus for editing table rules further includes: the device comprises a first receiving unit, a fifth display unit, a second receiving unit and a first editing unit. The first receiving unit is used for receiving a third editing instruction for editing the preset table rule through the first preset area after the target table is displayed in the first preset area; the fifth display unit is used for displaying a third rule editing area according to a third editing instruction, wherein the third rule editing area displays preset rule codes corresponding to the preset table rules; a second receiving unit configured to receive a third editing instruction through a third rule editing area; and the first editing unit is used for editing the preset rule codes according to the third editing instruction to obtain the target table rule.
The apparatus for editing table rules further comprises: a judging unit and a storing unit. The device comprises a judging unit, a processing unit and a processing unit, wherein the judging unit is used for judging whether a target table rule accords with a preset condition after the preset table rule is edited to obtain the target table rule; and the storage unit is used for storing the target table rule when the target table rule is judged to accord with the preset condition.
The embodiment acquires first input data for displaying a target form marked by a preset language, by an acquisition unit 10, the target form being a to-be-generated form, determines a preset form rule corresponding to the first input data by a determination unit 20, wherein the preset form rule is used for determining first display data to be displayed of the target form and first structure data for determining a first logical structure of the target form according to the first input data, displays a first rule editing area according to the first display data and the first structure data by a first display unit 30, edits the preset form rule by a first rule editing area by an editing unit 40 to obtain a target form rule for determining second display data to be displayed of the target form and second structure data for determining a second logical structure of the target form, displays the target form generated by the target form rule in the first preset area by a second display unit 50, the target table rule is used for determining second display data to be displayed of the target table and second structure data used for determining a second logic structure of the target table, and the purpose of generating the table rule is achieved, so that the technical effect of improving the generation efficiency of the table rule is achieved, and the technical problem of low generation efficiency of the table rule in the related technology is solved.
It should be noted here that the above units and modules are the same as the examples and application scenarios realized by the corresponding steps, but are not limited to the disclosure of the above embodiment 1. It should be noted that the modules described above as a part of the apparatus may be operated in a hardware environment as shown in fig. 1, and may be implemented by software, or may be implemented by hardware, where the hardware environment includes a network environment.
Example 5
According to the embodiment of the invention, the invention also provides a server or a terminal for implementing the table rule generating method.
Fig. 19 is a block diagram of a terminal according to an embodiment of the present invention. As shown in fig. 19, the terminal may include: one or more processors 191 (only one of which is shown), a memory 193, and a transmission device 195. As shown in fig. 19, the terminal may further include an input-output device 197.
The memory 193 may be used to store software programs and modules, such as program instructions/modules corresponding to the method and apparatus for generating table rules in the embodiment of the present invention, and the processor 191 executes various functional applications and data processing by running the software programs and modules stored in the memory 193, that is, implements the above-mentioned method for generating table rules. The memory 193 may include high speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 193 may further include memory located remotely from the processor 191, which may be connected to the terminal through a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The transmission device 195 is used for receiving or transmitting data via a network, and may also be used for data transmission between a processor and a memory. Examples of the network may include a wired network and a wireless network. In one example, the transmission device 195 includes a Network adapter (NIC) that can be connected to a router via a Network cable and other Network devices to communicate with the internet or a local area Network. In one example, the transmission device 195 is a Radio Frequency (RF) module, which is used to communicate with the internet in a wireless manner.
Among them, the memory 193 is used to store, in particular, an application program.
The processor 191 may invoke an application stored in the memory 193 through the transmission device 195 to perform the following steps:
acquiring first input data for displaying a target form, wherein the target form is a form to be generated marked by a preset language;
determining a preset form rule corresponding to the first input data, wherein the preset form rule is used for determining first display data to be displayed of the target form and first structure data used for determining a first logic structure of the target form according to the first input data;
displaying a first rule editing area according to the first display data and the first structure data;
editing the preset table rule through the first rule editing area to obtain a target table rule used for determining second display data to be displayed of the target table and second structure data used for determining a second logic structure of the target table;
and displaying the target table generated by the target table rule in a first preset area.
The processor 191 is further configured to perform the following steps: receiving a first acquisition instruction for acquiring first input data from a server; acquiring a link address corresponding to the first input data according to the first acquisition instruction, wherein the link address is a position on the server where the first input data is stored; the first input data is loaded from the server according to the link address.
The processor 191 is further configured to perform the following steps: receiving a second acquisition instruction for acquiring the first input data from the local of the client; acquiring identification information of a first preset file according to a second acquisition instruction, wherein the first preset file comprises first input data; and acquiring a first preset file from the local according to the identification information, and loading first input data.
The processor 191 is further configured to perform the following steps: after the first input data are loaded, processing the format of the first input data to obtain second input data; and displaying the second input data in a second preset area.
The processor 191 is further configured to perform the following steps: after a preset table rule corresponding to the first input data is determined, processing the format of the first display data to obtain first output data; displaying the first output data in a third preset area; after the preset table rule is edited through the first rule editing area to obtain a target table rule used for determining second display data to be displayed of a target table and second structure data used for determining a second logic structure of the target table, processing the format of the second display data to obtain second output data; and updating the first output data into second output data in a third preset area.
The processor 191 is further configured to perform the following steps: receiving a selection instruction for selecting a preset table rule; detecting a rule name of a preset table rule according to a selection instruction; searching a second preset file corresponding to the rule name from the preset directory, wherein the second preset file comprises a preset table rule; and under the condition that the second preset file is found, acquiring a preset table rule from the second preset file.
The processor 191 is further configured to perform the following steps: receiving a first editing instruction for editing a preset table rule through a first rule editing area; displaying a second rule editing area according to the first editing instruction, wherein the second rule editing area displays preset rule codes corresponding to preset table rules; receiving a second editing instruction through a second rule editing area; and editing the preset rule codes according to the second editing instruction to obtain the target table rule.
The processor 191 is further configured to perform the following steps: and after the preset rule code is edited according to the second editing instruction to obtain the target table rule, the first table data is updated to be second table data used for representing second display data and second structure data in the first rule editing area.
The processor 191 is further configured to perform the following steps: receiving a line editing instruction for editing a preset line rule through a first rule editing area; or receiving a column editing instruction for editing a preset column rule through a first rule editing area, wherein the preset row rule is used for determining a first row attribute of the target table, the preset column rule is used for determining a first column attribute of the target table, and the preset table rule comprises a preset row rule and a preset column rule; editing the preset line rule codes according to the second editing instruction to obtain target line rules, wherein the preset rule codes comprise preset line rule codes, and the target line rules are used for determining second line attributes of the target table; or editing the preset column rule codes according to the second editing instruction to obtain the target column rule, wherein the preset rule codes comprise preset column rule codes, and the target column rule is used for determining the second column attribute of the target table.
The processor 191 is further configured to perform the following steps: after the target table is displayed in the first preset area, receiving a third editing instruction for editing the preset table rule through the first preset area; displaying a third rule editing area according to a third editing instruction, wherein the third rule editing area displays preset rule codes corresponding to preset table rules; receiving a third editing instruction through a third rule editing area; and editing the preset rule codes according to the third editing instruction to obtain the target table rule.
The processor 191 is further configured to perform the following steps: after the preset table rule is edited to obtain a target table rule, judging whether the target table rule meets a preset condition or not; and if the target table rule is judged to accord with the preset condition, storing the target table rule.
The embodiment of the invention provides a table rule generation method. The method comprises the steps of obtaining first input data used for displaying a target table, wherein the target table is a table to be generated and marked by a preset language; determining a preset form rule corresponding to the first input data, wherein the preset form rule is used for determining first display data to be displayed of the target form and first structure data used for determining a first logic structure of the target form according to the first input data; displaying a first rule editing area according to the first display data and the first structure data; editing the preset table rule through the first rule editing area to obtain a target table rule used for determining second display data to be displayed of the target table and second structure data used for determining a second logic structure of the target table; the target table generated by the target table rule is displayed in the first preset area, so that the aim of generating the table rule is fulfilled, the technical effect of improving the generation efficiency of the table rule is achieved, and the technical problem of low generation efficiency of the table rule in the related technology is solved.
Optionally, the specific examples in this embodiment may refer to the examples described in the above embodiments, and this embodiment is not described herein again.
It can be understood by those skilled in the art that the structure shown in fig. 19 is only an illustration, and the terminal may be a terminal device such as a smart phone (e.g., an Android phone, an iOS phone, etc.), a tablet computer, a palm computer, and a Mobile Internet Device (MID), a PAD, etc. Fig. 18 is a diagram illustrating a structure of the electronic device. For example, the terminal may also include more or fewer components (e.g., network interfaces, display devices, etc.) than shown in FIG. 19, or have a different configuration than shown in FIG. 19.
Those skilled in the art will appreciate that all or part of the steps in the methods of the above embodiments may be implemented by a program instructing hardware associated with the terminal device, where the program may be stored in a computer-readable storage medium, and the storage medium may include: flash disks, Read-Only memories (ROMs), Random Access Memories (RAMs), magnetic or optical disks, and the like.
Example 6
The embodiment of the invention also provides a storage medium. Alternatively, in this embodiment, the storage medium may be a program code for executing the method for generating the table rule.
Optionally, in this embodiment, the storage medium may be located on at least one of a plurality of network devices in a network shown in the above embodiment.
Optionally, in this embodiment, the storage medium is configured to store program code for performing the following steps:
acquiring first input data for displaying a target form, wherein the target form is a form to be generated marked by a preset language;
determining a preset form rule corresponding to the first input data, wherein the preset form rule is used for determining first display data to be displayed of the target form and first structure data used for determining a first logic structure of the target form according to the first input data;
displaying a first rule editing area according to the first display data and the first structure data;
editing the preset table rule through the first rule editing area to obtain a target table rule used for determining second display data to be displayed of the target table and second structure data used for determining a second logic structure of the target table;
and displaying the target table generated by the target table rule in a first preset area.
Optionally, the storage medium is further arranged to store program code for performing the steps of: receiving a first acquisition instruction for acquiring first input data from a server; acquiring a link address corresponding to the first input data according to the first acquisition instruction, wherein the link address is a position on the server where the first input data is stored; the first input data is loaded from the server according to the link address.
Optionally, the storage medium is further arranged to store program code for performing the steps of: receiving a second acquisition instruction for acquiring the first input data from the local of the client; acquiring identification information of a first preset file according to a second acquisition instruction, wherein the first preset file comprises first input data; and acquiring a first preset file from the local according to the identification information, and loading first input data.
Optionally, the storage medium is further arranged to store program code for performing the steps of: after the first input data are loaded, processing the format of the first input data to obtain second input data; and displaying the second input data in a second preset area.
Optionally, the storage medium is further arranged to store program code for performing the steps of: after a preset table rule corresponding to the first input data is determined, processing the format of the first display data to obtain first output data; displaying the first output data in a third preset area; after the preset table rule is edited through the first rule editing area to obtain a target table rule used for determining second display data to be displayed of a target table and second structure data used for determining a second logic structure of the target table, processing the format of the second display data to obtain second output data; and updating the first output data into second output data in a third preset area.
Optionally, the storage medium is further arranged to store program code for performing the steps of: receiving a selection instruction for selecting a preset table rule; detecting a rule name of a preset table rule according to a selection instruction; searching a second preset file corresponding to the rule name from the preset directory, wherein the second preset file comprises a preset table rule; and under the condition that the second preset file is found, acquiring a preset table rule from the second preset file.
Optionally, the storage medium is further arranged to store program code for performing the steps of: receiving a first editing instruction for editing a preset table rule through a first rule editing area; displaying a second rule editing area according to the first editing instruction, wherein the second rule editing area displays preset rule codes corresponding to preset table rules; receiving a second editing instruction through a second rule editing area; and editing the preset rule codes according to the second editing instruction to obtain the target table rule.
Optionally, the storage medium is further arranged to store program code for performing the steps of: and after the preset rule code is edited according to the second editing instruction to obtain the target table rule, the first table data is updated to be second table data used for representing second display data and second structure data in the first rule editing area.
Optionally, the storage medium is further arranged to store program code for performing the steps of: receiving a line editing instruction for editing a preset line rule through a first rule editing area; or receiving a column editing instruction for editing a preset column rule through a first rule editing area, wherein the preset row rule is used for determining a first row attribute of the target table, the preset column rule is used for determining a first column attribute of the target table, and the preset table rule comprises a preset row rule and a preset column rule; editing the preset line rule codes according to the second editing instruction to obtain target line rules, wherein the preset rule codes comprise preset line rule codes, and the target line rules are used for determining second line attributes of the target table; or editing the preset column rule codes according to the second editing instruction to obtain the target column rule, wherein the preset rule codes comprise preset column rule codes, and the target column rule is used for determining the second column attribute of the target table.
Optionally, the storage medium is further arranged to store program code for performing the steps of: after the target table is displayed in the first preset area, receiving a third editing instruction for editing the preset table rule through the first preset area; displaying a third rule editing area according to a third editing instruction, wherein the third rule editing area displays preset rule codes corresponding to preset table rules; receiving a third editing instruction through a third rule editing area; and editing the preset rule codes according to the third editing instruction to obtain the target table rule.
Optionally, the specific examples in this embodiment may refer to the examples described in the above embodiments, and this embodiment is not described herein again.
Optionally, in this embodiment, the storage medium may include, but is not limited to: a U-disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a removable hard disk, a magnetic or optical disk, and other various media capable of storing program codes.
The above-mentioned serial numbers of the embodiments of the present invention are merely for description and do not represent the merits of the embodiments.
The integrated unit in the above embodiments, if implemented in the form of a software functional unit and sold or used as a separate product, may be stored in the above computer-readable storage medium. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for causing one or more computer devices (which may be personal computers, servers, network devices, etc.) to execute all or part of the steps of the method according to the embodiments of the present invention.
In the above embodiments of the present invention, the descriptions of the respective embodiments have respective emphasis, and for parts that are not described in detail in a certain embodiment, reference may be made to related descriptions of other embodiments.
In the several embodiments provided in the present application, it should be understood that the disclosed client may be implemented in other manners. The above-described embodiments of the apparatus are merely illustrative, and for example, the division of the units is only one type of division of logical functions, and there may be other divisions when actually implemented, for example, a plurality of units or components may be combined or may be integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, units or modules, and may be in an electrical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The foregoing is only a preferred embodiment of the present invention, and it should be noted that, for those skilled in the art, various modifications and decorations can be made without departing from the principle of the present invention, and these modifications and decorations should also be regarded as the protection scope of the present invention.
Claims (17)
1. A method for generating a table rule, comprising:
acquiring first input data for displaying a target table, wherein the target table is a table to be generated through a preset language mark, and the first input data is a code in the process of generating a table rule of the target table;
determining a preset form rule corresponding to the first input data, wherein the preset form rule is used for determining first display data to be displayed of the target form and first structure data used for determining a first logic structure of the target form according to the first input data;
displaying a first rule editing area according to the first display data and the first structure data;
editing the preset table rule through the first rule editing area to obtain a target table rule used for determining second display data to be displayed of the target table and second structure data used for determining a second logic structure of the target table;
and displaying the target table generated by the target table rule in a first preset area.
2. The method of claim 1, wherein obtaining first input data for the target form presentation comprises:
receiving a first acquisition instruction for acquiring the first input data from a server;
acquiring a link address corresponding to the first input data according to the first acquisition instruction, wherein the link address is a position on the server where the first input data is stored;
and loading the first input data from the server according to the link address.
3. The method of claim 1, wherein obtaining first input data for the target form presentation comprises:
receiving a second acquisition instruction for acquiring the first input data from the local of the client;
acquiring identification information of a first preset file according to the second acquisition instruction, wherein the first preset file comprises the first input data;
and acquiring the first preset file from the local according to the identification information, and loading the first input data.
4. The method of claim 2 or 3, wherein after loading the first input data, the method further comprises:
processing the format of the first input data to obtain second input data;
and displaying the second input data in a second preset area.
5. The method of claim 1,
after determining the preset form rule corresponding to the first input data, the method further comprises: processing the format of the first display data to obtain first output data; displaying the first output data in a third preset area;
after the preset form rule is edited through the first rule editing area to obtain a target form rule used for determining second display data to be displayed of the target form and second structure data used for determining a second logic structure of the target form, the method further includes: processing the format of the second display data to obtain second output data; and updating the first output data into the second output data in the third preset area.
6. The method of claim 1, wherein determining a preset form rule corresponding to the first input data comprises:
receiving a selection instruction for selecting the preset table rule;
detecting a rule name of the preset table rule according to the selection instruction;
searching a second preset file corresponding to the rule name from a preset directory, wherein the second preset file comprises the preset table rule;
and under the condition that the second preset file is found, acquiring the preset table rule from the second preset file.
7. The method of claim 1, wherein editing the preset form rule through the first rule editing area to obtain the target form rule comprises:
receiving a first editing instruction for editing the preset table rule through the first rule editing area;
displaying a second rule editing area according to the first editing instruction, wherein the second rule editing area displays a preset rule code corresponding to the preset table rule;
receiving a second editing instruction through the second rule editing area;
and editing the preset rule code according to the second editing instruction to obtain the target table rule.
8. The method according to claim 7, wherein the first rule editing area displays first table data representing the first presentation data and the first structure data, and after the preset rule code is edited according to the second editing instruction to obtain the target table rule, the method further comprises: updating the first table data in the first rule edit area to second table data representing the second presentation data and the second structure data.
9. The method of claim 7,
receiving, by the first rule editing area, a first editing instruction for editing the preset form rule includes: receiving a line editing instruction for editing a preset line rule through the first rule editing area; or receiving a column editing instruction for editing a preset column rule through the first rule editing area, wherein the preset row rule is used for determining a first row attribute of the target table, the preset column rule is used for determining a first column attribute of the target table, and the preset table rule comprises the preset row rule and the preset column rule;
editing the preset rule code according to the second editing instruction, and obtaining the target table rule comprises: editing a preset line rule code according to the second editing instruction to obtain a target line rule, wherein the preset line rule code comprises the preset line rule code, and the target line rule is used for determining a second line attribute of the target table; or editing a preset column rule code according to the second editing instruction to obtain a target column rule, wherein the preset rule code comprises the preset column rule code, and the target column rule is used for determining a second column attribute of the target table.
10. The method of claim 1, wherein after the first preset area displays the target table, the method further comprises:
receiving a third editing instruction for editing the preset table rule through the first preset area;
displaying a third rule editing area according to the third editing instruction, wherein the third rule editing area displays a preset rule code corresponding to the preset table rule;
receiving a third editing instruction through the third rule editing area;
and editing the preset rule code according to the third editing instruction to obtain the target table rule.
11. The method of claim 1, wherein after the preset table rule is edited to obtain the target table rule, the method further comprises:
judging whether the target table rule meets a preset condition or not;
and if the target table rule is judged to accord with the preset condition, storing the target table rule.
12. An apparatus for editing a table rule, comprising:
the device comprises an acquisition unit, a display unit and a display unit, wherein the acquisition unit is used for acquiring first input data for displaying a target form, the target form is a form to be generated marked by a preset language, and the first input data is a code in the process of generating a form rule of the target form;
the determining unit is used for determining a preset table rule corresponding to the first input data, wherein the preset table rule is used for determining first display data to be displayed of the target table and first structure data used for determining a first logic structure of the target table according to the first input data;
the first display unit is used for displaying a first rule editing area according to the first display data and the first structure data;
the editing unit is used for editing the preset table rule through the first rule editing area to obtain a target table rule;
the second display unit is used for displaying the target table generated by the target table rule in a first preset area, wherein the target table rule is used for determining second display data to be displayed of the target table and second structure data used for determining a second logic structure of the target table.
13. The apparatus of claim 12, wherein the obtaining unit comprises:
the first receiving module is used for receiving a first acquisition instruction for acquiring the first input data from the server;
a first obtaining module, configured to obtain a link address corresponding to the first input data according to the first obtaining instruction, where the link address is a location where the first input data is stored on the server;
a first loading module, configured to load the first input data from the server according to the link address.
14. The apparatus of claim 12, wherein the obtaining unit comprises:
the second receiving module is used for receiving a second acquisition instruction for acquiring the first input data from the local of the client;
a second obtaining module, configured to obtain identification information of a first preset file according to the second obtaining instruction, where the first preset file includes the first input data;
and the second loading module is used for acquiring the first preset file from the local according to the identification information and loading the first input data.
15. The apparatus of claim 13 or 14, further comprising:
the processing unit is used for processing the format of the first input data after the first input data is loaded to obtain second input data;
and the third display unit is used for displaying the second input data in a second preset area.
16. An electronic device comprising a memory and a processor, characterized in that the memory has stored therein a computer program, the processor being arranged to execute the method as claimed in any one of claims 1 to 11 by means of the computer program.
17. A computer-readable storage medium, comprising a stored program, wherein the program is operative to perform the method of any of claims 1 to 11.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201610950698.2A CN107992458B (en) | 2016-10-26 | 2016-10-26 | Table rule generation method and device, storage medium and electronic equipment |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201610950698.2A CN107992458B (en) | 2016-10-26 | 2016-10-26 | Table rule generation method and device, storage medium and electronic equipment |
Publications (2)
Publication Number | Publication Date |
---|---|
CN107992458A CN107992458A (en) | 2018-05-04 |
CN107992458B true CN107992458B (en) | 2021-03-26 |
Family
ID=62029445
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201610950698.2A Active CN107992458B (en) | 2016-10-26 | 2016-10-26 | Table rule generation method and device, storage medium and electronic equipment |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN107992458B (en) |
Families Citing this family (15)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109445958B (en) * | 2018-09-30 | 2022-04-22 | 联想(北京)有限公司 | Data editing method, electronic device and storage medium |
CN110990162A (en) * | 2018-09-30 | 2020-04-10 | 北京国双科技有限公司 | Data shuttling processing method and device |
CN109582941A (en) * | 2018-11-29 | 2019-04-05 | 杭州迪普科技股份有限公司 | A kind of list data display methods, device, equipment and storage medium |
CN109634490B (en) * | 2018-12-14 | 2020-05-12 | 北京字节跳动网络技术有限公司 | List display method, device, equipment and storage medium |
CN110032694A (en) * | 2019-03-04 | 2019-07-19 | 北京立思辰安科技术有限公司 | Form of general use control implementation method suitable for network auditing system |
CN110619116A (en) * | 2019-08-30 | 2019-12-27 | 深圳壹账通智能科技有限公司 | Data processing method, device, terminal and storage medium |
CN110569469B (en) * | 2019-09-06 | 2022-02-01 | 四川长虹电器股份有限公司 | Method for dynamically generating HTML (hypertext markup language) form based on data configuration |
CN110826305A (en) * | 2019-10-14 | 2020-02-21 | 北京字节跳动网络技术有限公司 | Data processing method and device for online form, terminal and server |
CN111191162B (en) * | 2019-11-05 | 2024-05-17 | 腾讯科技(深圳)有限公司 | Data processing method and device |
CN112784552B (en) * | 2020-06-05 | 2023-10-27 | 珠海金山办公软件有限公司 | Table editing method and apparatus |
CN111538750A (en) * | 2020-06-24 | 2020-08-14 | 深圳壹账通智能科技有限公司 | Information restoration method and device, computer system and readable storage medium |
CN112214978A (en) * | 2020-10-10 | 2021-01-12 | 金蝶云科技有限公司 | Data processing method and related equipment |
CN113779943B (en) * | 2021-01-12 | 2024-10-18 | 北京沃东天骏信息技术有限公司 | Form generation method, form generation device, storage medium and electronic equipment |
CN113448566B (en) * | 2021-06-09 | 2024-03-19 | 心医国际数字医疗系统(大连)有限公司 | A form logic configuration method and device |
CN113900532A (en) * | 2021-10-12 | 2022-01-07 | 北京顶象技术有限公司 | Code input method, device, equipment and storage medium |
Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101308490A (en) * | 2008-04-28 | 2008-11-19 | 北京航空航天大学 | A method and platform for generating dynamic reports |
CN102043769A (en) * | 2010-12-27 | 2011-05-04 | 畅捷通软件有限公司 | Method and device for editing documents |
Family Cites Families (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP5496853B2 (en) * | 2010-10-29 | 2014-05-21 | インターナショナル・ビジネス・マシーンズ・コーポレーション | Method for generating rules for classifying structured documents, and computer program and computer for the same |
-
2016
- 2016-10-26 CN CN201610950698.2A patent/CN107992458B/en active Active
Patent Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101308490A (en) * | 2008-04-28 | 2008-11-19 | 北京航空航天大学 | A method and platform for generating dynamic reports |
CN102043769A (en) * | 2010-12-27 | 2011-05-04 | 畅捷通软件有限公司 | Method and device for editing documents |
Also Published As
Publication number | Publication date |
---|---|
CN107992458A (en) | 2018-05-04 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN107992458B (en) | Table rule generation method and device, storage medium and electronic equipment | |
US10810365B2 (en) | Workflow system and method for creating, distributing and publishing content | |
CN108228861B (en) | Method and system for performing feature engineering for machine learning | |
CN107729475B (en) | Webpage element acquisition method, device, terminal and computer-readable storage medium | |
US20130019189A1 (en) | Augmented editing of an online document | |
US20130024441A1 (en) | Configuring web crawler to extract web page information | |
CN106844635B (en) | Method and device for editing elements in webpage | |
US10908928B2 (en) | Rules-based workflow messaging | |
CN109597954A (en) | Data item methods of exhibiting, calculates equipment and medium at device | |
US20120017161A1 (en) | System and method for user interface | |
CN103597469A (en) | Live browser tooling in an integrated development environment | |
US9092572B2 (en) | Development life cycle management tool for set-top box widgets | |
US20160292143A1 (en) | System and method for automated online wizard generation | |
KR20150085716A (en) | Setup Method for Web Scraping Data Extraction | |
CN110941779A (en) | Page loading method and device, storage medium and electronic equipment | |
KR101797573B1 (en) | Web based spreadsheets service providing apparatus and method | |
CN112825038A (en) | Visual page making method based on general component language specification and related product | |
US20140101533A1 (en) | Lossless application of new information architecture to existing websites, web pages, and online content | |
CN114201615B (en) | Scientific research data change review method and server based on data snapshot | |
US20150113045A1 (en) | Data processing system, server, client, and program for managing data | |
US8813002B2 (en) | Circuit board design support program, design support method, and design support apparatus | |
CN113934959B (en) | Program preview method and device, computer equipment and storage medium | |
CN110929100B (en) | Method and device for acquiring value taking path, storage medium and electronic equipment | |
JP2019101889A (en) | Test execution device and program | |
CN118468836A (en) | Method, device and system for generating double-header table |
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 |