WO2024087909A1 - Attribute linkage rule-based page data processing method, and medium - Google Patents
Attribute linkage rule-based page data processing method, and medium Download PDFInfo
- Publication number
- WO2024087909A1 WO2024087909A1 PCT/CN2023/117832 CN2023117832W WO2024087909A1 WO 2024087909 A1 WO2024087909 A1 WO 2024087909A1 CN 2023117832 W CN2023117832 W CN 2023117832W WO 2024087909 A1 WO2024087909 A1 WO 2024087909A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- attribute
- linkage
- value
- rule
- data processing
- 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.)
- Ceased
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/20—Software design
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/30—Creation or generation of source code
- G06F8/38—Creation or generation of source code for implementing user interfaces
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/46—Multiprogramming arrangements
Definitions
- the present invention belongs to the technical field of rule engine application, and in particular relates to a page data processing method and medium based on attribute linkage rules.
- Front-end development is no longer scattered throughout the entire system architecture as in the past, but tends to be an engineering, modular and systematic development method.
- user needs are usually abstracted into metadata information such as objects, attributes, dictionaries, etc., and the flexible display of the user interface is achieved through metadata configuration.
- this method has the following defects: when the user needs to process the values of multiple attributes on the interface or execute a piece of operation logic, the corresponding code needs to be customized for development, and even some additional pages need to be made to adapt to user needs, which leads to complex code logic, a large number of pages and cumbersome data processing.
- the purpose of the present invention is to provide a page data processing method and medium based on attribute linkage rules, so as to solve the problems of complex code logic, large number of pages and cumbersome data processing in the front-end page development in the prior art.
- a first aspect provides a page data processing method based on attribute linkage rules, comprising:
- the action type of the subordinate attribute is determined according to the attribute linkage rule, and the data processing rule of the subordinate attribute is determined according to the action type, including:
- the mapping relationship between the value range of the primary attribute and the value range of the secondary attribute is obtained, so as to substitute the mapping relationship into the rendering API method to render the page data;
- the calculation rules defined in the calculation logic of the slave attribute are obtained so that the calculation rules are substituted into the rendering API method to render the page data.
- the method before detecting the user's assignment operation on the primary attribute, the method further includes:
- the basic form information includes the form type and form template path, and the initialization message includes the basic form attributes and attribute linkage rule table;
- a form instance is created to enter page initialization, and the initialization message of the dynamic component is obtained through the basic form information, including:
- a basic page is rendered according to the basic attributes of the form, including:
- the method further includes:
- the assignment information is passed back to the parent component through the listening event through the callback function, so that the parent component can judge whether the current value of the main attribute meets the preset requirements.
- the executable attribute linkage rule is triggered by the default value and the current value is the default value, the value of the local variable is considered to be true or false, otherwise the value of the local variable is considered to be undefined;
- the data processing rules from the attributes are substituted into the rendering API method to render the page data, including:
- the linkage logic includes value linkage logic, dictionary range value logic, text logic, attribute write-back logic and object write-back logic.
- the value linkage logic includes changing the Boolean value of the subcomponent attribute to the value of the local variable, wherein an undefined value is converted to a true process;
- the dictionary range value logic includes reading the dictionary range data of the dictionary configuration table and putting it into the global cache. If there is no dictionary list and the configuration dictionary exists, the first value of the dictionary is taken. If the dictionary list exists and the configuration dictionary data exists, the dictionary list is filtered as the configuration value. If the currently selected dictionary paper is in the filtered dictionary list, the current display value of the subordinate attribute is not changed, otherwise it is left blank.
- the text logic includes terminating execution if the value of the local variable is false, otherwise executing the corresponding text operation function and placing the execution result into the display value of another specified subcomponent;
- the attribute write-back logic includes: if the query pop-up window result exists, then process it according to the result data type and merge it into the form data;
- the object write-back logic includes: traversing the form data, converting the matching fields according to the configuration rules and incorporating them into the pop-up query conditions.
- the second aspect provides a page data processing device based on attribute linkage rules according to the first aspect, comprising:
- the data change acquisition module is used to detect the user's assignment operation on the main attribute and determine whether the main attribute has an executable attribute linkage rule. If so, the data change of the main attribute is obtained;
- the data processing rule determination module is used to obtain the corresponding subordinate attribute list according to the main attribute and its data change, determine the action type of the subordinate attribute according to the attribute linkage rule, and determine the data processing rule of the subordinate attribute according to the action type, wherein the action type includes value linkage;
- the page data rendering module is used to match the rendering API according to the action type, substitute the data processing rules from the attributes into the rendering API method to render the page data, and display the data rendering results on the user interface.
- a third aspect provides a storage medium having instructions stored thereon.
- the instructions are executed on a computer, a page data processing method based on attribute linkage rules as described in any possible design of the first aspect is executed.
- the present invention has the following beneficial effects:
- the present invention detects the user's assignment operation on the main attribute, and determines whether the main attribute has an executable attribute linkage rule. If so, the data change of the main attribute is obtained; the corresponding subordinate attribute list is obtained according to the main attribute and its data change, the action type of the subordinate attribute is determined according to the attribute linkage rule, and the data processing rule of the subordinate attribute is determined according to the action type, wherein the action type includes value linkage; the rendering API is matched according to the action type, and the data processing rule of the subordinate attribute is substituted into the rendering API method to render the page data, and the data rendering result is displayed in the user interface.
- the traditional page development mode of user interface + metadata is broken, and a new page development mode based on user interface + rule adaptation + metadata is provided.
- the interface data relationship and data processing method are encapsulated by pre-setting attribute linkage rules, and the unified management of page data rules is realized, the complexity of page code logic is reduced, and the number of pages is reduced; when the user's operation on the interface is detected, the page data is automatically processed based on the data processing method defined by the attribute linkage rule, and the problem of page data processing flexibility is further solved on the basis of realizing flexible display of page attributes.
- FIG1 is a flow chart of a method for processing page data based on attribute linkage rules in an embodiment of the present invention
- FIG2 is a simplified flow chart of a page data processing method based on attribute linkage rules in an embodiment of the present invention
- FIG3 is a logical diagram of an attribute linkage page in an embodiment of the present invention.
- FIG4 is a schematic diagram of a basic page in an embodiment of the present invention.
- FIG5 is a schematic diagram of value linkage filling in an embodiment of the present invention.
- FIG6 is a schematic diagram of the value linkage effect in an embodiment of the present invention.
- FIG7 is a schematic diagram of attribute operation in an embodiment of the present invention.
- FIG8 is a schematic diagram of attribute operation effects in an embodiment of the present invention.
- FIG9 is a schematic diagram of an assembly linkage method according to an embodiment of the present invention.
- FIG10 is a schematic diagram of an assembly effect in an embodiment of the present invention.
- FIG. 11 is a schematic diagram of a calculation linkage method in an embodiment of the present invention.
- FIG12 is a schematic diagram of an associated control writing back to a lower level in an embodiment of the present invention.
- FIG. 13 is a schematic diagram of an associated control write-back form in an embodiment of the present invention.
- an embodiment of the present application provides a page data processing method based on attribute linkage rules.
- the method separates business decisions from application code and uses a predefined rule model to write business decisions, thereby breaking the traditional user interface + metadata page development model and providing a new page development model based on user interface + rule adaptation + metadata.
- the interface data relationship and data processing method are encapsulated by pre-setting attribute linkage rules to achieve unified management of page data rules, reduce the complexity of page code logic, and reduce the number of pages; when a user operation on the interface is detected, the page data is automatically processed based on the data processing method defined by the attribute linkage rule, which further solves the problem of page data processing flexibility on the basis of realizing flexible display of page attributes.
- the embodiments of the present application model interface data processing through multiple dimensions such as user data (including dictionary values, strings, numbers and foreign key references, etc.), data processing actions (including data linkage, data calculation, state changes and API calls, etc.) and data processing scope (master-slave linkage and group linkage, etc.), and at the same time introduce a rule processing module to monitor user operations on the interface based on the rules, execute the data processing method defined by the rules, and finally reflect the data processing results on the interface.
- user data including dictionary values, strings, numbers and foreign key references, etc.
- data processing actions including data linkage, data calculation, state changes and API calls, etc.
- data processing scope master-slave linkage and group linkage, etc.
- the attribute linkage rules in the embodiment of the present application refer to: usually a page is composed of multiple attributes, each attribute has specific characteristics, and needs to be described by different controls.
- the attribute/component linkage mainly refers to the data change mode in which when the main attribute/component (the object on which the user performs business operations) changes (value or status), the slave attribute/component or attribute group/component group changes synchronously, which has a domino-like chain effect.
- Step 1 Scenario abstraction, that is, analyzing the common page data processing process from the user scenario, and finding out the manifestation of the one-way influence between the main attribute and the subordinate attribute in the data processing process.
- Scenario abstraction that is, analyzing the common page data processing process from the user scenario, and finding out the manifestation of the one-way influence between the main attribute and the subordinate attribute in the data processing process.
- the influence relationship between the main and subordinate attributes/attribute groups is mainly divided into four categories, including:
- the embodiment of the present application shows attribute linkage rules and rule descriptions corresponding to different business scenarios.
- Step 2 Group definition, further structure the result of scene abstraction, define the range of the list of subordinate attributes affected by the change of the main attribute, and conduct rule modeling for the group relationship in the abstract result based on comprehensive consideration of the combination with the metadata model and the extensibility of the rule table itself.
- the methods for defining group relationships can include:
- an embodiment of the present application shows a preferred attribute rule linkage table for explaining the scope of the subordinate attribute list affected by the change of the main attribute.
- Step 3 Action definition, further deconstruct the result of scene abstraction, define the possible impact of changes in the main attribute on the subordinate attribute, model the rules based on the action type obtained by analysis, and consider the requirements of later scalability, set a dictionary description for the action type to facilitate flexible expansion.
- the action type definition method may include: the rule type s_attr_act in Table 2 is a typical field for describing several types of main attributes affecting subordinate attributes, and the specific dictionary value of the typical field is described as follows:
- Step 4 Relationship definition, further deconstruct the result of scene abstraction, and define the specific expression of the influence of changes in the main attribute on the content of the subordinate attribute.
- the subordinate attribute needs to change its value range according to the value range of the main attribute, or the subordinate attribute needs to change its attribute state according to the change of the main attribute, etc.
- the above-mentioned value range and attribute state are the specific expressions of the influence content.
- the main ways of relationship definition can be:
- the action types of the main attribute affecting the subordinate attribute are classified into: one is the influence of the custom value range, the value linkage mentioned above, mapped to the action type in Table 3, that is, the action type corresponding to the dictionary value 0; the other is the influence on the data based on established rules, such as the logical operation mentioned above, mapped to the action type in Table 3, that is, the graying corresponding to the dictionary value 1, the required field corresponding to the dictionary value 2, the assembly corresponding to the dictionary value 3, the calculation corresponding to the dictionary value 4, and the JS code corresponding to the dictionary value 5.
- the relationship definition also includes the definition of the logical operation relationship and the value linkage relationship.
- the logical operation relationship can be defined in the following way: when the "s_attr_act rule type" field in Table 2 is not equal to the value linkage, it is defined by the "s_attr_rule rule action" in Table 2; the value linkage relationship can be defined in the following way: when the "s_attr_act rule type” field in Table 2 is equal to the value linkage, it is defined by the mapping relationship between the primary and secondary attribute value ranges defined in Table 4.
- FIG. 1 to FIG. 3 it is a flow chart of the method provided in the embodiment of the present application, and the method is implemented by steps S1 to S3 but is not limited to:
- Step S1 Detect the user's assignment operation on the main attribute and determine whether the main attribute has an executable attribute linkage rule. If yes, then obtain the data change of the main attribute;
- a form contains multiple components, each component contains properties and methods, wherein the property linkage rules of one or more properties are preset and bound, so that when the property value or state changes, that is, after the user operates the property value on the interface, it is necessary to determine whether the property has a preset property linkage rule, so as to enter the subsequent step of automatic data processing based on the property linkage rule.
- the method further includes:
- Step S01. Create a form instance to enter page initialization, and obtain the initialization message of the dynamic component through the basic form information, wherein the basic form information includes the form type and the form template path, and the initialization message includes the basic form attributes and the attribute linkage rule table;
- the form uses VUE+Element-UI as the basis to build the main application, realize the dynamically configurable basic form, and the mutual linkage of each element component in the form, based on the initialization message of the dynamic component provided by the backend, the message describes in detail all the fields of each attribute, and renders the overall form attributes, the type of each attribute, the attribute verification rules and the attribute linkage rules.
- Table 5 one of the form attribute field tables in the embodiment of the present application is shown as follows:
- one of the optional attribute field types in the embodiment of the present application is:
- Input text box Based on the el-input method, it distinguishes between normal text input TextEditor, number input, password input PasswordEditor, etc.;
- Drop-down selection box based on el-select, distinguishes between single-select drop-down ChooseDictionary and multiple-select drop-down ChooseMultipleDictionary, and the initialization data contains the drop-down dictionary selection;
- Date selection box based on el-time-picker/el-date-picker method, distinguishes between time selection ChooseDateTime and date selection ChooseDate;
- the associated object selector, ChooseRelation is based on the el-input method and uses the click event showRelationFun (display relationship function) bound to the el-icon-search icon.
- a custom associated object query component nested in the el-dialog pops up and selects an object before filling it back into the el-input input box of the current form.
- an optional attribute verification rule in the embodiment of the present application can be to bind each attribute rule to the rules of the el-form form through the tool class util.parseValidators, and verify it through the validate event when submitting the form. Specifically, it includes the following verification items:
- attribute verification rules can only meet the simple rules of a single form attribute when initializing the interface. On this basis, the aforementioned attribute linkage rules are applied to realize the specific attribute linkage function.
- a form instance is created to enter page initialization, and an initialization message of a dynamic component is obtained through basic form information, specifically including:
- Step S02. Rendering a basic page according to the basic attributes of the form, using the attribute linkage rule table as a global variable of the form, and setting a linkage function corresponding to each linkage rule;
- the backend database is configured with executable attribute linkage rules
- the backend will read the executable rule list and bind it to the form as a global variable of the form when the template is loaded, and build the linkage function of the corresponding rule into the form component.
- rendering a basic page according to the basic attributes of the form includes:
- Step S03 Setting a monitoring event in each subcomponent of the form so that each subcomponent can detect the user's assignment operation on the main attribute based on the monitoring event.
- the various sub-components of the form in the embodiment of the present application are generated by calling the form drawing drawView method during the form creation phase according to the form type and form properties defined in the template, and the form data is passed unidirectionally from the parent component to the child component to set the properties and display values of the sub-component.
- the method further includes:
- the assignment information is passed back to the parent component through the listening event through the callback function, so that the parent component can judge whether the current value of the main attribute meets the preset requirements.
- the executable attribute linkage rule is triggered by the default value and the current value is the default value, the value of the local variable is considered to be true or false, otherwise the value of the local variable is considered to be undefined;
- Step S2 Obtain the corresponding subordinate attribute list according to the main attribute and its data change, determine the action type of the subordinate attribute according to the attribute linkage rule, and determine the data processing rule of the subordinate attribute according to the action type, wherein the action type includes value linkage;
- step S2 the action type of the subordinate attribute is determined according to the attribute linkage rule, and the data processing rule of the subordinate attribute is determined according to the action type, including:
- the mapping relationship between the value range of the primary attribute and the value range of the secondary attribute is obtained, so as to substitute the mapping relationship into the rendering API method to render the page data;
- the calculation rules defined in the calculation logic of the slave attribute are obtained so that the calculation rules are substituted into the rendering API method to render the page data.
- Step S3. Match the rendering API according to the action type, substitute the data processing rules of the slave attribute into the rendering API method to render the page data, and display the data rendering result on the user interface.
- step S3 the data processing rules of the slave attributes are substituted into the rendering API method to render the page data, including:
- the linkage logic includes value linkage logic, dictionary range value logic, text logic, attribute write-back logic and object write-back logic.
- the value linkage logic includes changing the Boolean value of the subcomponent attribute to the value of the local variable, wherein the undefined value is converted to true processing;
- the dictionary range value logic includes reading the dictionary range data of the dictionary configuration table and putting it into the global cache. If there is no dictionary list and the configuration dictionary exists, the first value of the dictionary is taken. If the dictionary list exists and the configuration dictionary data exists, the dictionary list is filtered as the configuration value. If the currently selected dictionary paper is in the filtered dictionary list, the current display value of the subordinate attribute is not changed, otherwise it is left blank.
- the text logic includes terminating execution if the value of the local variable is false, otherwise executing the corresponding text operation function and placing the execution result into the display value of another specified subcomponent;
- the attribute write-back logic includes: if the query pop-up window result exists, then process it according to the result data type and merge it into the form data;
- the object write-back logic includes: traversing the form data, converting the matching fields according to the configuration rules and incorporating them into the pop-up query conditions.
- the embodiment of the present application detects the user's assignment operation on the main attribute, and determines whether the main attribute has an executable attribute linkage rule. If so, the data change of the main attribute is obtained; the corresponding subordinate attribute list is obtained according to the main attribute and its data change, the action type of the subordinate attribute is determined according to the attribute linkage rule, and the data processing rule of the subordinate attribute is determined according to the action type, wherein the action type includes value linkage; the rendering API is matched according to the action type, and the data processing rule of the subordinate attribute is substituted into the rendering API method to render the page data, and the data rendering result is displayed in the user interface.
- the traditional page development mode of user interface + metadata is broken, and a new page development mode based on user interface + rule adaptation + metadata is provided.
- the interface data relationship and data processing method are encapsulated by pre-setting attribute linkage rules, and the unified management of page data rules is realized, the complexity of page code logic is reduced, and the number of pages is reduced; when the user's operation on the interface is detected, the page data is automatically processed based on the data processing method defined by the attribute linkage rule, and the problem of page data processing flexibility is further solved on the basis of realizing flexible display of page attributes.
- Example of value linkage The use of attribute linkage rules needs to be configured in Table 2 and Table 4.
- the specified rule_no changes the value range of s_attr_val (subordinate attribute) according to the value of m_attr_val (primary attribute value).
- the linkage effect is shown in the figure.
- Figure 6 when setting the linkage, when the primary attribute takes the specified value, when the subordinate attribute dictionary value range changes, it is automatically set to the first item of the new dictionary range (only filtering), and the original dictionary range is restored when it is not triggered; when setting the default value, when setting m_attr_val (primary attribute value) to null (empty), the default dictionary range of the template will be modified. If the subordinate attribute is not a character, the first s_attr_val (subordinate attribute value) will be filled in as the default value (can be cleared).
- attribute operations include attribute switches, common configurations, suffix buttons, and other configurations.
- the main attribute is a dictionary and multiple values correspond to the same operation, // can be used to concatenate the main attribute value.
- Assembly (multi-attribute) example The assembly rules are shown in Figure 9, and the assembly effect can be seen in Figure 10. It should be noted that the applicable conditions for assembly are that all attributes that need to be assembled need to be configured in the form, and it is recommended to use the back-end assembly logic; the assembly order is to sort from small to large according to ruleNo outside the area, and the backfill value of the dictionary or the input box text can be assembled (when the m_attr_val field is not empty, the non-compliant value will not be assembled); when the assembly method is to add a new assembly rule code (written in the calculationFormulas.js file of the generateFrom component on the front end), set the s_act_rule field to the method name of the new assembly rule code.
- Example of associative control writing back to the lower level As shown in Figure 12, its applicable condition is that both the primary and secondary attributes are configured as associative controls, the attributes brought out are non-association relationships (attributes without @), and then the association relationship configured in the secondary attribute query template is filled in s_act_rule; the write-back order is that if the association relationship pop-up window itself has a trigger field that will increase its own attributes, and the field name is the same as the secondary attribute field to be backfilled, the backfilled value covers the initial value brought in by the trigger field, for example: after selecting the device (M), the device (R) to which the port (S) belongs is written back, and after selecting the owned device (M), the owned device (R) in the owned board (S) is written back.
- association control writeback form An example of the association control writeback form is shown in Figure 13. Its applicable condition is that the main attribute is configured as an association control, and the attribute brought out must be an association relationship (attribute with @), and then fill in the association relationship configured in the main attribute query template in s_act_rule. Its special application scenario is that the installation location brings out the station and the latitude of the station, and the upper BTS brings out the base station identification according to the network type (multiple-select dictionary field). When automatically clearing, when the main attribute is cleared, the subordinate attribute will be cleared as well.
- the applicable components of the above-mentioned attribute linkage examples include but are not limited to the generateForm component and its upper-level components such as generateGroupForm and parseView; the conditional judgment adopted is that when the main attribute value (m_attr_val) is null (empty), any text triggers the rule by default, and when there is a value, it is identified as a fixed value (the fixed value will be ignored when it does not match) to trigger the rule; the rule judgment adopted is that a main attribute can be associated with multiple sub-attributes, and only when the main attribute + subordinate attribute + rule action + rule template are the same, they are judged as the same type of rules; the rule loading method adopted is spec_id to support the configuration of the main category of equipment. If there is a sub-category specification, the detailed category specification takes precedence (the detailed category replaces the main category).
- the second aspect provides a page data processing device based on attribute linkage rules according to the first aspect, comprising:
- the data change acquisition module is used to detect the user's assignment operation on the main attribute and determine whether the main attribute has an executable attribute linkage rule. If so, the data change of the main attribute is obtained;
- the data processing rule determination module is used to obtain the corresponding subordinate attribute list according to the main attribute and its data change, determine the action type of the subordinate attribute according to the attribute linkage rule, and determine the data processing rule of the subordinate attribute according to the action type, wherein the action type includes value linkage;
- the page data rendering module is used to match the rendering API according to the action type, substitute the data processing rules from the attributes into the rendering API method to render the page data, and display the data rendering results on the user interface.
- the present invention provides a computer-readable storage medium having instructions stored thereon. When the instructions are run on a computer, the method described in any possible design of the first aspect is executed.
- the computer-readable storage medium refers to a carrier for storing data, which may include but is not limited to floppy disks, CDs, hard disks, flash memories, USB flash drives and/or memory sticks, etc.
- the computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices.
Landscapes
- Engineering & Computer Science (AREA)
- Software Systems (AREA)
- Theoretical Computer Science (AREA)
- General Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Human Computer Interaction (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
Description
本发明属于规则引擎应用技术领域,具体涉及一种基于属性联动规则的页面数据处理方法和介质。The present invention belongs to the technical field of rule engine application, and in particular relates to a page data processing method and medium based on attribute linkage rules.
随着业务和技术的发展,前端功能越来越复杂,技术栈也越来越丰富,前端开发不再像以往那样零散地分布在整个系统架构当中,而是趋向于工程化、模块化和系统化的开发方式。现有技术中,用户需求通常被抽象为对象、属性、字典等元数据信息,通过元数据配置的方式实现用户界面的灵活展示,但这种方式存在如下缺陷:当用户需要对界面上多个属性的值进行数据处理或执行一段运算逻辑时,需要定制对应的代码进行开发,甚至需要额外制作一些页面以适配用户需求,从而导致代码逻辑复杂、页面数量较多以及数据处理繁琐。With the development of business and technology, front-end functions are becoming more and more complex, and the technology stack is becoming richer and richer. Front-end development is no longer scattered throughout the entire system architecture as in the past, but tends to be an engineering, modular and systematic development method. In the existing technology, user needs are usually abstracted into metadata information such as objects, attributes, dictionaries, etc., and the flexible display of the user interface is achieved through metadata configuration. However, this method has the following defects: when the user needs to process the values of multiple attributes on the interface or execute a piece of operation logic, the corresponding code needs to be customized for development, and even some additional pages need to be made to adapt to user needs, which leads to complex code logic, a large number of pages and cumbersome data processing.
发明内容Summary of the invention
本发明的目的是提供一种基于属性联动规则的页面数据处理方法和介质,用以解决现有技术中的前端页面开发存在代码逻辑复杂、页面数量较多以及数据处理繁琐的问题。The purpose of the present invention is to provide a page data processing method and medium based on attribute linkage rules, so as to solve the problems of complex code logic, large number of pages and cumbersome data processing in the front-end page development in the prior art.
为了实现上述目的,本发明采用以下技术方案:In order to achieve the above object, the present invention adopts the following technical solutions:
第一方面提供一种基于属性联动规则的页面数据处理方法,包括:A first aspect provides a page data processing method based on attribute linkage rules, comprising:
检测用户对主属性的赋值操作,并判断该主属性是否有可执行的属性联动规则,若是,则获取该主属性的数据变化情况;Detect the user's assignment operation on the main attribute, and determine whether the main attribute has an executable attribute linkage rule. If so, obtain the data change of the main attribute;
根据主属性及其数据变化情况获取对应的从属性列表,根据属性联动规则确定从属性的动作类型,并根据动作类型确定从属性的数据处理规则,其中,动作类型包括取值联动;Obtain the corresponding subordinate attribute list according to the main attribute and its data change, determine the action type of the subordinate attribute according to the attribute linkage rule, and determine the data processing rule of the subordinate attribute according to the action type, wherein the action type includes value linkage;
根据动作类型匹配渲染API,将从属性的数据处理规则代入到渲染API方法中进行页面数据渲染,并将数据渲染结果在用户界面进行展示。Match the rendering API according to the action type, substitute the data processing rules from the attributes into the rendering API method to render the page data, and display the data rendering results in the user interface.
在一种可能的设计中,根据属性联动规则确定从属性的动作类型,并根据动作类型确定从属性的数据处理规则,包括:In a possible design, the action type of the subordinate attribute is determined according to the attribute linkage rule, and the data processing rule of the subordinate attribute is determined according to the action type, including:
根据属性联动规则表中从属性动作类型的字典值,确定字典值所对应的动作类型;According to the dictionary value of the attribute action type in the attribute linkage rule table, determine the action type corresponding to the dictionary value;
若动作类型为取值联动,则获取主属性的取值范围与从属性的取值范围之间的映射关系,以便将映射关系代入到渲染API方法中进行页面数据渲染;If the action type is value linkage, the mapping relationship between the value range of the primary attribute and the value range of the secondary attribute is obtained, so as to substitute the mapping relationship into the rendering API method to render the page data;
若动作类型为非取值联动,则获取从属性的计算逻辑中定义的计算规则,以便将计算规则代入到渲染API方法中进行页面数据渲染。If the action type is non-value linkage, the calculation rules defined in the calculation logic of the slave attribute are obtained so that the calculation rules are substituted into the rendering API method to render the page data.
在一种可能的设计中,在检测用户对主属性的赋值操作之前,所述方法还包括: In a possible design, before detecting the user's assignment operation on the primary attribute, the method further includes:
创建表单实例进入页面初始化,通过表单基础信息获取动态组件的初始化报文,其中,表单基础信息包含表单类型和表单模板路径,初始化报文包括表单基础属性和属性联动规则表;Create a form instance to enter page initialization, and obtain the initialization message of the dynamic component through the basic form information. The basic form information includes the form type and form template path, and the initialization message includes the basic form attributes and attribute linkage rule table;
根据表单基础属性渲染得到基础页面,将所述属性联动规则表作为表单的全局变量,并设置每一联动规则对应的联动函数;Rendering a basic page according to the basic attributes of the form, using the attribute linkage rule table as a global variable of the form, and setting a linkage function corresponding to each linkage rule;
在表单的各子组件中设置监听事件,以便各子组件基于监听事件检测用户对主属性的赋值操作。Set a listening event in each subcomponent of the form so that each subcomponent can detect the user's assignment operation on the main attribute based on the listening event.
在一种可能的设计中,创建表单实例进入页面初始化,通过表单基础信息获取动态组件的初始化报文,包括:In a possible design, a form instance is created to enter page initialization, and the initialization message of the dynamic component is obtained through the basic form information, including:
调用VUE模板的created方法创建实例,并调用intipage方法进入页面初始化;Call the created method of the VUE template to create an instance, and call the intipage method to enter the page initialization;
通过表单类型metaClassName和表单模板类型viewConfigName向后端请求报文,以便后端根据报文请求生成jason格式的初始化报文;Request a message to the backend through the form type metaClassName and the form template type viewConfigName, so that the backend can generate an initialization message in jason format according to the message request;
接收后端返回的初始化报文,其中,初始化报文包含表单基础属性formGroups和属性联动规则表attrRules。Receive the initialization message returned by the backend, where the initialization message contains the form basic attributes formGroups and the attribute linkage rule table attrRules.
在一种可能的设计中,根据所述表单基础属性渲染得到基础页面,包括:In a possible design, a basic page is rendered according to the basic attributes of the form, including:
调用parseForm方法将表单基础属性formGroups转化为Element-UI库的基础表单识别对象,渲染得到基础页面。Call the parseForm method to convert the basic form attributes formGroups into the basic form identification object of the Element-UI library, and render the basic page.
在一种可能的设计中,在判断该主属性是否有可执行的属性联动规则之后,所述方法还包括:In a possible design, after determining whether the main attribute has an executable attribute linkage rule, the method further includes:
当子组件的监听事件监听到父组件的数据变化时,通过监听事件将赋值信息通过回调函数回传至父组件中,以便父组件对主属性的当前值是否符合预设要求进行判断。When the child component's listening event listens to the data change of the parent component, the assignment information is passed back to the parent component through the listening event through the callback function, so that the parent component can judge whether the current value of the main attribute meets the preset requirements.
在一种可能的设计中,对主属性的当前值是否符合预设要求进行判断,包括:In a possible design, whether the current value of the primary attribute meets the preset requirements is judged, including:
若表单当前需要执行且触发的主属性存在可执行的属性联动规则和联动函数,则在联动函数中设置局部变量,并进一步判断可执行的属性联动规则是否为默认值触发且当前值为默认值;If the form currently needs to execute and the triggered main attribute has executable attribute linkage rules and linkage functions, then set local variables in the linkage function, and further determine whether the executable attribute linkage rule is triggered by the default value and the current value is the default value;
若可执行的属性联动规则为默认值触发且当前值为默认值,则认为局部变量的值为真或假,否则认为局部变量的值为未定义值;If the executable attribute linkage rule is triggered by the default value and the current value is the default value, the value of the local variable is considered to be true or false, otherwise the value of the local variable is considered to be undefined;
若可执行的属性联动规则配置了额外判断规则,且当前值符合额外判断规则,则认为局部变量的值为真,否则为假。If the executable attribute linkage rule is configured with additional judgment rules, and the current value meets the additional judgment rules, the value of the local variable is considered true, otherwise it is false.
在一种可能的设计中,将从属性的数据处理规则代入到渲染API方法中进行页面数据渲染,包括:In a possible design, the data processing rules from the attributes are substituted into the rendering API method to render the page data, including:
根据从属性的数据处理规则确定对应的联动逻辑,并在渲染API方法中调用对应的联动逻辑进行页面数据渲染,其中,联动逻辑包括取值联动逻辑、字典范围取值逻辑、文本逻辑、属性回写逻辑和对象回写逻辑。Determine the corresponding linkage logic according to the data processing rules of the slave attributes, and call the corresponding linkage logic in the rendering API method to render the page data. The linkage logic includes value linkage logic, dictionary range value logic, text logic, attribute write-back logic and object write-back logic.
在一种可能的设计中,所述取值联动逻辑包括子组件属性的布尔值变更为局部变量的值,其中未定义值转化为真处理;In a possible design, the value linkage logic includes changing the Boolean value of the subcomponent attribute to the value of the local variable, wherein an undefined value is converted to a true process;
所述字典范围取值逻辑包括读取字典配置表的字典范围数据并放入全局缓存,若无字典列表且配置字典存在则取字典的第一个值,若字典列表存在且配置字典数据存在,则将字典列表筛选为配置值,若当前选中的字典纸在筛选后的字典列表中,则不改变从属性当前的显示值,否则置空;The dictionary range value logic includes reading the dictionary range data of the dictionary configuration table and putting it into the global cache. If there is no dictionary list and the configuration dictionary exists, the first value of the dictionary is taken. If the dictionary list exists and the configuration dictionary data exists, the dictionary list is filtered as the configuration value. If the currently selected dictionary paper is in the filtered dictionary list, the current display value of the subordinate attribute is not changed, otherwise it is left blank.
所述文本逻辑包括若局部变量的值为假则结束执行,否则执行对应的文本操作函数,并将执行结果放入指定的另一子组件的显示值;The text logic includes terminating execution if the value of the local variable is false, otherwise executing the corresponding text operation function and placing the execution result into the display value of another specified subcomponent;
所述属性回写逻辑包括:若查询弹窗的结果存在,则根据结果数据类型处理后并入表单数据;The attribute write-back logic includes: if the query pop-up window result exists, then process it according to the result data type and merge it into the form data;
所述对象回写逻辑包括:遍历表单数据,将符合的字段根据配置规则转换后并入弹窗查询条件。The object write-back logic includes: traversing the form data, converting the matching fields according to the configuration rules and incorporating them into the pop-up query conditions.
第二方面提供第一方面提供一种基于属性联动规则的页面数据处理装置,包括:The second aspect provides a page data processing device based on attribute linkage rules according to the first aspect, comprising:
数据变化获取模块,用于检测用户对主属性的赋值操作,并判断该主属性是否有可执行的属性联动规则,若是,则获取该主属性的数据变化情况;The data change acquisition module is used to detect the user's assignment operation on the main attribute and determine whether the main attribute has an executable attribute linkage rule. If so, the data change of the main attribute is obtained;
数据处理规则确定模块,用于根据主属性及其数据变化情况获取对应的从属性列表,根据属性联动规则确定从属性的动作类型,并根据动作类型确定从属性的数据处理规则,其中,动作类型包括取值联动;The data processing rule determination module is used to obtain the corresponding subordinate attribute list according to the main attribute and its data change, determine the action type of the subordinate attribute according to the attribute linkage rule, and determine the data processing rule of the subordinate attribute according to the action type, wherein the action type includes value linkage;
页面数据渲染模块,用于根据动作类型匹配渲染API,将从属性的数据处理规则代入到渲染API方法中进行页面数据渲染,并将数据渲染结果在用户界面进行展示。The page data rendering module is used to match the rendering API according to the action type, substitute the data processing rules from the attributes into the rendering API method to render the page data, and display the data rendering results on the user interface.
第三方面提供一种存储介质,所述存储介质上存储有指令,当所述指令在计算机上运行时,执行如第一方面任意一种可能的设计中所述的基于属性联动规则的页面数据处理方法。A third aspect provides a storage medium having instructions stored thereon. When the instructions are executed on a computer, a page data processing method based on attribute linkage rules as described in any possible design of the first aspect is executed.
本发明相较于现有技术的有益效果为:Compared with the prior art, the present invention has the following beneficial effects:
本发明通过检测用户对主属性的赋值操作,并判断该主属性是否有可执行的属性联动规则,若是,则获取该主属性的数据变化情况;根据主属性及其数据变化情况获取对应的从属性列表,根据属性联动规则确定从属性的动作类型,并根据动作类型确定从属性的数据处理规则,其中,动作类型包括取值联动;根据动作类型匹配渲染API,将从属性的数据处理规则代入到渲染API方法中进行页面数据渲染,并将数据渲染结果在用户界面进行展示。从而打破了传统的用户界面+元数据的页面开发模式,提供了基于用户界面+规则适配+元数据的新型页面开发模式,通过预先设置属性联动规则对界面数据关系和数据处理方式进行封装,实现页面数据规则的统一管理,降低了页面代码逻辑的复杂度,并减少了页面数量;当检测到用户对界面的操作时,基于属性联动规则所定义的数据处理方法自动对页面数据进行处理,在实现页面属性灵活展示的基础上,进一步解决了页面数据的处理灵活性问题。The present invention detects the user's assignment operation on the main attribute, and determines whether the main attribute has an executable attribute linkage rule. If so, the data change of the main attribute is obtained; the corresponding subordinate attribute list is obtained according to the main attribute and its data change, the action type of the subordinate attribute is determined according to the attribute linkage rule, and the data processing rule of the subordinate attribute is determined according to the action type, wherein the action type includes value linkage; the rendering API is matched according to the action type, and the data processing rule of the subordinate attribute is substituted into the rendering API method to render the page data, and the data rendering result is displayed in the user interface. Thus, the traditional page development mode of user interface + metadata is broken, and a new page development mode based on user interface + rule adaptation + metadata is provided. The interface data relationship and data processing method are encapsulated by pre-setting attribute linkage rules, and the unified management of page data rules is realized, the complexity of page code logic is reduced, and the number of pages is reduced; when the user's operation on the interface is detected, the page data is automatically processed based on the data processing method defined by the attribute linkage rule, and the problem of page data processing flexibility is further solved on the basis of realizing flexible display of page attributes.
图1为本发明实施例中的基于属性联动规则的页面数据处理方法的流程图;FIG1 is a flow chart of a method for processing page data based on attribute linkage rules in an embodiment of the present invention;
图2为本发明实施例中的基于属性联动规则的页面数据处理方法的简化流程图;FIG2 is a simplified flow chart of a page data processing method based on attribute linkage rules in an embodiment of the present invention;
图3为本发明实施例中的属性联动页面逻辑示意图;FIG3 is a logical diagram of an attribute linkage page in an embodiment of the present invention;
图4为本发明实施例中的基础页面示意图;FIG4 is a schematic diagram of a basic page in an embodiment of the present invention;
图5为本发明实施例中的取值联动填写示意图;FIG5 is a schematic diagram of value linkage filling in an embodiment of the present invention;
图6为本发明实施例中的取值联动效果示意图;FIG6 is a schematic diagram of the value linkage effect in an embodiment of the present invention;
图7为本发明实施例中的属性操作示意图;FIG7 is a schematic diagram of attribute operation in an embodiment of the present invention;
图8为本发明实施例中的属性操作效果示意图;FIG8 is a schematic diagram of attribute operation effects in an embodiment of the present invention;
图9为本发明实施例的拼装联动方式示意图;FIG9 is a schematic diagram of an assembly linkage method according to an embodiment of the present invention;
图10为本发明实施例中的拼装效果示意图;FIG10 is a schematic diagram of an assembly effect in an embodiment of the present invention;
图11为本发明实施例中的计算联动方式示意图FIG. 11 is a schematic diagram of a calculation linkage method in an embodiment of the present invention.
图12为本发明实施例中的关联控件回写下级示意图;FIG12 is a schematic diagram of an associated control writing back to a lower level in an embodiment of the present invention;
图13为本发明实施例中的关联控件回写表单示意图。FIG. 13 is a schematic diagram of an associated control write-back form in an embodiment of the present invention.
为了更清楚地说明本发明实施例或现有技术中的技术方案,下面将结合附图和实施例或现有技术的描述对本发明作简单地介绍,显而易见地,下面关于附图结构的描述仅仅是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。在此需要说明的是,对于这些实施例方式的说明用于帮助理解本发明,但并不构成对本发明的限定。In order to more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the present invention will be briefly introduced below in combination with the drawings and the description of the embodiments or the prior art. Obviously, the following description of the structure of the drawings is only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work. It should be noted that the description of these embodiments is used to help understand the present invention, but does not constitute a limitation of the present invention.
实施例Example
为了解决现有技术中前端页面开发存在代码逻辑复杂、页面数量较多以及数据处理繁琐的问题,本申请实施例提供了一种基于属性联动规则的页面数据处理方法,该方法将业务决策从应用程序代码中分离出来,并使用预定义的规则模型编写业务决策,从而打破了传统的用户界面+元数据的页面开发模式,提供了基于用户界面+规则适配+元数据的新型页面开发模式,通过预先设置属性联动规则对界面数据关系和数据处理方式进行封装,实现页面数据规则的统一管理,降低了页面代码逻辑的复杂度,并减少了页面数量;当检测到用户对界面的操作时,基于属性联动规则所定义的数据处理方法自动对页面数据进行处理,在实现页面属性灵活展示的基础上,进一步解决了页面数据的处理灵活性问题。 In order to solve the problems of complex code logic, large number of pages and cumbersome data processing in the front-end page development in the prior art, an embodiment of the present application provides a page data processing method based on attribute linkage rules. The method separates business decisions from application code and uses a predefined rule model to write business decisions, thereby breaking the traditional user interface + metadata page development model and providing a new page development model based on user interface + rule adaptation + metadata. The interface data relationship and data processing method are encapsulated by pre-setting attribute linkage rules to achieve unified management of page data rules, reduce the complexity of page code logic, and reduce the number of pages; when a user operation on the interface is detected, the page data is automatically processed based on the data processing method defined by the attribute linkage rule, which further solves the problem of page data processing flexibility on the basis of realizing flexible display of page attributes.
值得注意的是,在对基于属性联动规则的页面数据处理方法进行说明之前,首先需要对本申请实施例中的属性联动规则的构建过程进行详细说明,具体如下:It is worth noting that before describing the page data processing method based on the attribute linkage rule, it is first necessary to describe in detail the construction process of the attribute linkage rule in the embodiment of the present application, as follows:
为了实现对界面数据处理规则的可视化能力和配置能力,本申请实施例通过对用户数据(包括字典值、字符串、数值和外键引用等)、数据处理动作(包括数据联动、数据计算、状态变更和API调用等)和数据处理范围(主从联动和群组联动等)等多个维度对界面数据处理进行建模,同时引入规则处理模块,基于规则监听用户对界面的操作,并执行规则所定义的数据处理方法,最终将数据处理结果反映在界面上。In order to achieve the visualization and configuration capabilities of interface data processing rules, the embodiments of the present application model interface data processing through multiple dimensions such as user data (including dictionary values, strings, numbers and foreign key references, etc.), data processing actions (including data linkage, data calculation, state changes and API calls, etc.) and data processing scope (master-slave linkage and group linkage, etc.), and at the same time introduce a rule processing module to monitor user operations on the interface based on the rules, execute the data processing method defined by the rules, and finally reflect the data processing results on the interface.
其中,本申请实施例中的属性联动规则是指:通常一个页面由多个属性组成,每个属性都有具体的特征,需要用不同的控件进行描述,属性/组件联动主要是指当主属性/组件(用户进行业务操作的对象)发生改变时(值或者状态),从属性/组件或者属性组/组件组同步发生改变的多米诺骨牌式连锁影响的数据变更模式。Among them, the attribute linkage rules in the embodiment of the present application refer to: usually a page is composed of multiple attributes, each attribute has specific characteristics, and needs to be described by different controls. The attribute/component linkage mainly refers to the data change mode in which when the main attribute/component (the object on which the user performs business operations) changes (value or status), the slave attribute/component or attribute group/component group changes synchronously, which has a domino-like chain effect.
其中,为了建立本申请实施例中的属性联动规则,具体需要以下多个步骤:In order to establish the attribute linkage rules in the embodiment of the present application, the following steps are specifically required:
步骤一:场景抽象,即从用户场景中分析常见的页面数据处理过程,并找出数据处理过程中的主属性和从属性之间单向影响的表现形式。具体的,从业务场景的应用分析可知,主从属性/属性组之间的影响关系主要分为四大类,包括:Step 1: Scenario abstraction, that is, analyzing the common page data processing process from the user scenario, and finding out the manifestation of the one-way influence between the main attribute and the subordinate attribute in the data processing process. Specifically, from the application analysis of business scenarios, it can be seen that the influence relationship between the main and subordinate attributes/attribute groups is mainly divided into four categories, including:
1)取值联动:即主属性值变化,从属性取值随预配置结果变化;1) Value linkage: when the primary attribute value changes, the secondary attribute value changes with the pre-configured result;
2)渲染联动:即主属性值变化,从属性渲染状态随之变化;2) Rendering linkage: when the value of the main attribute changes, the rendering state of the subordinate attribute changes accordingly;
3)计算联动:即主属性值变化,从属性取值随计算公式变化;3) Calculation linkage: when the primary attribute value changes, the secondary attribute value changes with the calculation formula;
4)规则联动:即主属性值变化,从属性取值随API逻辑变化。4) Rule linkage: When the primary attribute value changes, the secondary attribute value changes with the API logic.
为了便于理解,如表1所示,本申请实施例示出了不同的业务场景所对应的属性联动规则及规则说明。For ease of understanding, as shown in Table 1, the embodiment of the present application shows attribute linkage rules and rule descriptions corresponding to different business scenarios.
表1不同业务场景适用的联动规则说明表
Table 1 Description of linkage rules applicable to different business scenarios
步骤二:群组定义,将场景抽象的结果进一步结构,定义主属性变化所影响的从属性列表的范围,在综合考虑与元数据模型的结合以及规则表本身扩展性的基础上,对抽象结果中的群组关系进行规则建模。具体的,对于群组关系定义的方式可以包括:Step 2: Group definition, further structure the result of scene abstraction, define the range of the list of subordinate attributes affected by the change of the main attribute, and conduct rule modeling for the group relationship in the abstract result based on comprehensive consideration of the combination with the metadata model and the extensibility of the rule table itself. Specifically, the methods for defining group relationships can include:
1)设置规格IDspec_id,用于适配元数据模型,并与元数据定义的属性描述进行关联映射;1) Setting the specification IDspec_id to adapt the metadata model and associate it with the attribute description defined by the metadata;
2)设置主属性名m_attr_name,用于描述主属性和描述联动规则的监听范围;2) Set the main attribute name m_attr_name to describe the main attribute and the monitoring scope of the linkage rule;
3)设置从属性名s_attr_name,用于描述从属性和主属性变化的影响范围,其中,当一个主属性影响多个从属性时,可分多个规则进行描述。3) Set the subordinate attribute name s_attr_name to describe the scope of influence of changes in subordinate attributes and main attributes. When a main attribute affects multiple subordinate attributes, it can be described by multiple rules.
为了便于理解,如表2所示,本申请实施例示出了一种优选的属性规则联动表,用于对定义主属性变化所影响的从属性列表的范围进行说明。For ease of understanding, as shown in Table 2, an embodiment of the present application shows a preferred attribute rule linkage table for explaining the scope of the subordinate attribute list affected by the change of the main attribute.
表2 X_RULE_ATTR_RELA规则属性联动表
Table 2 X_RULE_ATTR_RELA rule attribute linkage table
步骤三:动作定义,将场景抽象的结果进一步解构,定义主属性变化对从属性可能产生的影响方式,基于分析得到的动作类型进行规则建模,并考虑后期扩展性的要求,对动作类型设置字典描述以便于灵活扩展。具体的,对于动作类型定义的方式可以包括:表2中的规则类型s_attr_act为字典型字段,用于描述主属性影响从属性的几种类型,对字典型字段具体的字典值进行描述如下:Step 3: Action definition, further deconstruct the result of scene abstraction, define the possible impact of changes in the main attribute on the subordinate attribute, model the rules based on the action type obtained by analysis, and consider the requirements of later scalability, set a dictionary description for the action type to facilitate flexible expansion. Specifically, the action type definition method may include: the rule type s_attr_act in Table 2 is a typical field for describing several types of main attributes affecting subordinate attributes, and the specific dictionary value of the typical field is described as follows:
表3主从属性影响类型定义表
Table 3 Definition table of master-slave attribute influence type
步骤四:关系定义,将场景抽象的结果进一步解构,定义主属性变化对从属性影响内容的具体表达方式。例如:从属性需要根据主属性的取值范围改变自身的取值范围,或者从属性需要根据主属性的变化改变自身的属性状态等,上述所述的取值范围和属性状态即为影响内容的具体表达方式。具体的,关系定义的主要方式可以为: Step 4: Relationship definition, further deconstruct the result of scene abstraction, and define the specific expression of the influence of changes in the main attribute on the content of the subordinate attribute. For example: the subordinate attribute needs to change its value range according to the value range of the main attribute, or the subordinate attribute needs to change its attribute state according to the change of the main attribute, etc. The above-mentioned value range and attribute state are the specific expressions of the influence content. Specifically, the main ways of relationship definition can be:
1)对主属性影响从属性的动作类型进行分类,一类为自定义取值范围的影响,前文所述的取值联动,映射到表3中的动作类型,即为字典值0对应的动作类型;另一类为基于既定规则对数据进行影响,如前文所述的逻辑运算,映射到表3中的动作类型,即为字典值1对应的置灰、字典值2对应的必填、字典值3对应的拼装、字典值4对应的计算和字典值5对应的JS代码等。1) The action types of the main attribute affecting the subordinate attribute are classified into: one is the influence of the custom value range, the value linkage mentioned above, mapped to the action type in Table 3, that is, the action type corresponding to the dictionary value 0; the other is the influence on the data based on established rules, such as the logical operation mentioned above, mapped to the action type in Table 3, that is, the graying corresponding to the dictionary value 1, the required field corresponding to the dictionary value 2, the assembly corresponding to the dictionary value 3, the calculation corresponding to the dictionary value 4, and the JS code corresponding to the dictionary value 5.
2)将表2中的“规则动作s_attr_rule”字段定义为影响内容的具体表达方式,例如:当动作类型X_RULE_ATTR_RELA.s_attr_act)=【拼装】时,则影响内容的具体表达方式(X_RULE_ATTR_RELA.s_attr_rule)=“[属性A]||[属性B]||‘测试’”这样的字符串,是指当主属性变化时,从属性的值变成“【主属性A】拼装上【从属性B】在拼装上一个文本串【测试】”。又例如:当动作类型(X_RULE_ATTR_RELA.s_attr_act)=【计算】时,则影响内容的具体表达方式(X_RULE_ATTR_RELA.s_attr_rule)=“[属性A]+[属性B]*[属性C]+1”这样的字符串,是指主属性变化时,从属性的值变成“【主属性A的值】加上【从属性B的值】乘以【另一个属性C的值】加上1”。2) The "Rule Action s_attr_rule" field in Table 2 is defined as a specific expression that affects the content. For example, when the action type (X_RULE_ATTR_RELA.s_attr_act) = [Assemble], the specific expression that affects the content (X_RULE_ATTR_RELA.s_attr_rule) = a string such as "[Attribute A]||[Attribute B]||'Test'", which means that when the main attribute changes, the value of the subordinate attribute becomes "[Main attribute A] assembled with [Subordinate attribute B] assembled with a text string [Test]". For another example, when the action type (X_RULE_ATTR_RELA.s_attr_act) = [Calculation], the specific expression that affects the content (X_RULE_ATTR_RELA.s_attr_rule) = a string of "[attribute A]+[attribute B]*[attribute C]+1", which means that when the main attribute changes, the value of the subordinate attribute becomes "[the value of the main attribute A] plus [the value of the subordinate attribute B] multiplied by [the value of another attribute C] plus 1".
此外,关系定义还包括逻辑运算关系定义和取值联动关系定义。其中,逻辑运算关系定义的方式可以是:当表2中的“s_attr_act规则类型”字段不等于取值联动时,通过表2中的“s_attr_rule规则动作”来定义;其中,取值联动关系的定义方式可以是:当表2中的s_attr_act规则类型”字段等于取值联动时,通过表4中定义的主从属性取值范围之间的映射关系来进行定义。In addition, the relationship definition also includes the definition of the logical operation relationship and the value linkage relationship. The logical operation relationship can be defined in the following way: when the "s_attr_act rule type" field in Table 2 is not equal to the value linkage, it is defined by the "s_attr_rule rule action" in Table 2; the value linkage relationship can be defined in the following way: when the "s_attr_act rule type" field in Table 2 is equal to the value linkage, it is defined by the mapping relationship between the primary and secondary attribute value ranges defined in Table 4.
表4 X_Main_Slave_Rela字典取值表
Table 4 X_Main_Slave_Rela dictionary value table
基于上述对属性联动规则的预先设置过程的详细描述,下面将对本申请实施例提供的基于属性联动规则的页面数据处理方法进行详细说明。Based on the above detailed description of the pre-setting process of the attribute linkage rule, the page data processing method based on the attribute linkage rule provided in the embodiment of the present application will be described in detail below.
如图1-图3所示,是本申请实施例提供的方法的流程图,所述方法包括但不限于由步骤S1~S3实现:As shown in FIG. 1 to FIG. 3, it is a flow chart of the method provided in the embodiment of the present application, and the method is implemented by steps S1 to S3 but is not limited to:
步骤S1.检测用户对主属性的赋值操作,并判断该主属性是否有可执行的属性联动规则, 若是,则获取该主属性的数据变化情况;Step S1. Detect the user's assignment operation on the main attribute and determine whether the main attribute has an executable attribute linkage rule. If yes, then obtain the data change of the main attribute;
其中,需要说明的是,一个表单包含多个组件,每个组件包含属性和方法,其中通过对一个或多个属性的属性联动规则进行预设和绑定,使得在属性值或状态发生变化时,即用户在界面上对属性值进行操作后,需要判断该属性是否有预设的属性联动规则,以便进入后续的基于属性联动规则进行数据自动处理的步骤。It should be noted that a form contains multiple components, each component contains properties and methods, wherein the property linkage rules of one or more properties are preset and bound, so that when the property value or state changes, that is, after the user operates the property value on the interface, it is necessary to determine whether the property has a preset property linkage rule, so as to enter the subsequent step of automatic data processing based on the property linkage rule.
在步骤S1之前,所述方法还包括:Before step S1, the method further includes:
步骤S01.创建表单实例进入页面初始化,通过表单基础信息获取动态组件的初始化报文,其中,表单基础信息包含表单类型和表单模板路径,初始化报文包括表单基础属性和属性联动规则表;Step S01. Create a form instance to enter page initialization, and obtain the initialization message of the dynamic component through the basic form information, wherein the basic form information includes the form type and the form template path, and the initialization message includes the basic form attributes and the attribute linkage rule table;
其中,表单采用VUE+Element-UI为基础构建主体应用,实现可动态配置的基础表单,以及表单内各元素组件的相互联动,基于后端提供的动态组件的初始化报文,报文内详细描述每个属性的所有字段,渲染得到整体表单属性、各属性的类型、属性校验规则以及属性联动规则。其中,如表5所示,示出了本申请实施例中其中一种表单属性字段表,如下:Among them, the form uses VUE+Element-UI as the basis to build the main application, realize the dynamically configurable basic form, and the mutual linkage of each element component in the form, based on the initialization message of the dynamic component provided by the backend, the message describes in detail all the fields of each attribute, and renders the overall form attributes, the type of each attribute, the attribute verification rules and the attribute linkage rules. Among them, as shown in Table 5, one of the form attribute field tables in the embodiment of the present application is shown as follows:
表5表单属性字段表
Table 5 Form attribute field table
其中,本申请实施例中其中一种可选的属性字段类型为:Among them, one of the optional attribute field types in the embodiment of the present application is:
1)输入文本框:基于el-input方法,并区分普通文本输入TextEditor、数字输入、密码输入PasswordEditor等; 1) Input text box: Based on the el-input method, it distinguishes between normal text input TextEditor, number input, password input PasswordEditor, etc.;
2)下拉选择框,基于el-select,并区分单选下拉ChooseDictionary、多选下拉ChooseMultipleDictionary,初始化数据中包含下拉字典选择;2) Drop-down selection box, based on el-select, distinguishes between single-select drop-down ChooseDictionary and multiple-select drop-down ChooseMultipleDictionary, and the initialization data contains the drop-down dictionary selection;
3)日期选择框,基于el-time-picker/el-date-picker方法,区分时间选择ChooseDateTime和日期选择ChooseDate;3) Date selection box, based on el-time-picker/el-date-picker method, distinguishes between time selection ChooseDateTime and date selection ChooseDate;
4)关联对象选择器,ChooseRelation基于el-input方法,利用el-icon-search图标绑定的点击事件showRelationFun(显示关系功能),根据初始化参数配置,弹出el-dialog内嵌套的自定义关联对象查询组件,选中一个对象后回填到当前表单的el-input输入框。4) The associated object selector, ChooseRelation, is based on the el-input method and uses the click event showRelationFun (display relationship function) bound to the el-icon-search icon. According to the initialization parameter configuration, a custom associated object query component nested in the el-dialog pops up and selects an object before filling it back into the el-input input box of the current form.
其中,本申请实施例中一种可选的属性校验规则可以是将各属性规则通过工具类util.parseValidators绑定到el-form表单的rules(规则)上,提交表单时通过validate事件进行校验。具体包括如下校验项:Among them, an optional attribute verification rule in the embodiment of the present application can be to bind each attribute rule to the rules of the el-form form through the tool class util.parseValidators, and verify it through the validate event when submitting the form. Specifically, it includes the following verification items:
1)字段必填校验RequiredValidator,绑定校验属性必填项required;1) Field required validation RequiredValidator, binding validation attribute required;
2)数据范围校验RangeValidator,绑定校验属性最大max/小min值;2) Data range validation RangeValidator, binding validation attribute maximum max/min value;
3)数据长度校验LengthValidator,转化为文本长度正则表达式校验;3) Data length check LengthValidator, converted into text length regular expression check;
4)正则匹配校验RegExpValidator,绑定校验属性正则表达式pattern。4) Regular matching validation RegExpValidator, bind validation attribute regular expression pattern.
其中,值得注意的是,属性校验规则只能满足初始化界面时候,单一表单属性的简单规则。在此基础上,应用前述的属性联动规则来实现具体的属性联动功能。It is worth noting that the attribute verification rules can only meet the simple rules of a single form attribute when initializing the interface. On this basis, the aforementioned attribute linkage rules are applied to realize the specific attribute linkage function.
在一种具体的实施方式中,创建表单实例进入页面初始化,通过表单基础信息获取动态组件的初始化报文,具体包括:In a specific implementation, a form instance is created to enter page initialization, and an initialization message of a dynamic component is obtained through basic form information, specifically including:
调用VUE模板的created方法创建实例,并调用intipage方法进入页面初始化;Call the created method of the VUE template to create an instance, and call the intipage method to enter the page initialization;
通过表单类型metaClassName和表单模板类型viewConfigName向后端请求报文,以便后端根据报文请求生成jason格式的初始化报文;Request a message to the backend through the form type metaClassName and the form template type viewConfigName, so that the backend can generate an initialization message in jason format according to the message request;
接收后端返回的初始化报文,其中,初始化报文包含表单基础属性formGroups和属性联动规则表attrRules。Receive the initialization message returned by the backend, where the initialization message contains the form basic attributes formGroups and the attribute linkage rule table attrRules.
步骤S02.根据表单基础属性渲染得到基础页面,将所述属性联动规则表作为表单的全局变量,并设置每一联动规则对应的联动函数;Step S02. Rendering a basic page according to the basic attributes of the form, using the attribute linkage rule table as a global variable of the form, and setting a linkage function corresponding to each linkage rule;
具体的,若后端的数据库配置了可执行的属性联动规则,则后端在模板加载的同时会读取可执行的规则列表并绑定到表单中作为表单的全局变量,并在表单组件内置对应规则的联动函数。Specifically, if the backend database is configured with executable attribute linkage rules, the backend will read the executable rule list and bind it to the form as a global variable of the form when the template is loaded, and build the linkage function of the corresponding rule into the form component.
如图4所示,在一种具体的实施方式中,根据所述表单基础属性渲染得到基础页面,包括:As shown in FIG. 4 , in a specific implementation manner, rendering a basic page according to the basic attributes of the form includes:
调用parseForm方法将表单基础属性formGroups转化为Element-UI库的基础表单识别对象,渲染得到基础页面。 Call the parseForm method to convert the basic form attributes formGroups into the basic form identification object of the Element-UI library, and render the basic page.
步骤S03.在表单的各子组件中设置监听事件,以便各子组件基于监听事件检测用户对主属性的赋值操作。Step S03: Setting a monitoring event in each subcomponent of the form so that each subcomponent can detect the user's assignment operation on the main attribute based on the monitoring event.
其中,需要说明的是,本申请实施例中表单的各个子组件是在表单创建阶段调用绘制表单drawView方法根据模板定义的表单类型及表单属性来生成的,且表单的数据通过父组件向子组件单向传递来设置子组件的属性和显示值。It should be noted that the various sub-components of the form in the embodiment of the present application are generated by calling the form drawing drawView method during the form creation phase according to the form type and form properties defined in the template, and the form data is passed unidirectionally from the parent component to the child component to set the properties and display values of the sub-component.
在一种可能的设计中,在判断该主属性是否有可执行的属性联动规则之后,所述方法还包括:In a possible design, after determining whether the main attribute has an executable attribute linkage rule, the method further includes:
当子组件的监听事件监听到父组件的数据变化时,通过监听事件将赋值信息通过回调函数回传至父组件中,以便父组件对主属性的当前值是否符合预设要求进行判断。When the child component's listening event listens to the data change of the parent component, the assignment information is passed back to the parent component through the listening event through the callback function, so that the parent component can judge whether the current value of the main attribute meets the preset requirements.
在一种可能的设计中,对主属性的当前值是否符合预设要求进行判断,包括:In a possible design, whether the current value of the primary attribute meets the preset requirements is judged, including:
若表单当前需要执行且触发的主属性存在可执行的属性联动规则和联动函数,则在联动函数中设置局部变量,并进一步判断可执行的属性联动规则是否为默认值触发且当前值为默认值;If the form currently needs to execute and the triggered main attribute has executable attribute linkage rules and linkage functions, then set local variables in the linkage function, and further determine whether the executable attribute linkage rule is triggered by the default value and the current value is the default value;
若可执行的属性联动规则为默认值触发且当前值为默认值,则认为局部变量的值为真或假,否则认为局部变量的值为未定义值;If the executable attribute linkage rule is triggered by the default value and the current value is the default value, the value of the local variable is considered to be true or false, otherwise the value of the local variable is considered to be undefined;
若可执行的属性联动规则配置了额外判断规则,且当前值符合额外判断规则,则认为局部变量的值为真,否则为假。If the executable attribute linkage rule is configured with additional judgment rules, and the current value meets the additional judgment rules, the value of the local variable is considered true, otherwise it is false.
步骤S2.根据主属性及其数据变化情况获取对应的从属性列表,根据属性联动规则确定从属性的动作类型,并根据动作类型确定从属性的数据处理规则,其中,动作类型包括取值联动;Step S2. Obtain the corresponding subordinate attribute list according to the main attribute and its data change, determine the action type of the subordinate attribute according to the attribute linkage rule, and determine the data processing rule of the subordinate attribute according to the action type, wherein the action type includes value linkage;
在步骤S2一种具体的实施方式中,根据属性联动规则确定从属性的动作类型,并根据动作类型确定从属性的数据处理规则,包括:In a specific implementation of step S2, the action type of the subordinate attribute is determined according to the attribute linkage rule, and the data processing rule of the subordinate attribute is determined according to the action type, including:
根据属性联动规则表中从属性动作类型的字典值,确定字典值所对应的动作类型;According to the dictionary value of the attribute action type in the attribute linkage rule table, determine the action type corresponding to the dictionary value;
若动作类型为取值联动,则获取主属性的取值范围与从属性的取值范围之间的映射关系,以便将映射关系代入到渲染API方法中进行页面数据渲染;If the action type is value linkage, the mapping relationship between the value range of the primary attribute and the value range of the secondary attribute is obtained, so as to substitute the mapping relationship into the rendering API method to render the page data;
若动作类型为非取值联动,则获取从属性的计算逻辑中定义的计算规则,以便将计算规则代入到渲染API方法中进行页面数据渲染。If the action type is non-value linkage, the calculation rules defined in the calculation logic of the slave attribute are obtained so that the calculation rules are substituted into the rendering API method to render the page data.
步骤S3.根据动作类型匹配渲染API,将从属性的数据处理规则代入到渲染API方法中进行页面数据渲染,并将数据渲染结果在用户界面进行展示。Step S3. Match the rendering API according to the action type, substitute the data processing rules of the slave attribute into the rendering API method to render the page data, and display the data rendering result on the user interface.
在步骤S3一种具体的实施方式中,将从属性的数据处理规则代入到渲染API方法中进行页面数据渲染,包括:In a specific implementation of step S3, the data processing rules of the slave attributes are substituted into the rendering API method to render the page data, including:
根据从属性的数据处理规则确定对应的联动逻辑,并在渲染API方法中调用对应的联动逻辑进行页面数据渲染,其中,联动逻辑包括取值联动逻辑、字典范围取值逻辑、文本逻辑、属性回写逻辑和对象回写逻辑。Determine the corresponding linkage logic according to the data processing rules of the slave attributes, and call the corresponding linkage logic in the rendering API method to render the page data. The linkage logic includes value linkage logic, dictionary range value logic, text logic, attribute write-back logic and object write-back logic.
具体的,所述取值联动逻辑包括子组件属性的布尔值变更为局部变量的值,其中未定义值转化为真处理;Specifically, the value linkage logic includes changing the Boolean value of the subcomponent attribute to the value of the local variable, wherein the undefined value is converted to true processing;
所述字典范围取值逻辑包括读取字典配置表的字典范围数据并放入全局缓存,若无字典列表且配置字典存在则取字典的第一个值,若字典列表存在且配置字典数据存在,则将字典列表筛选为配置值,若当前选中的字典纸在筛选后的字典列表中,则不改变从属性当前的显示值,否则置空;The dictionary range value logic includes reading the dictionary range data of the dictionary configuration table and putting it into the global cache. If there is no dictionary list and the configuration dictionary exists, the first value of the dictionary is taken. If the dictionary list exists and the configuration dictionary data exists, the dictionary list is filtered as the configuration value. If the currently selected dictionary paper is in the filtered dictionary list, the current display value of the subordinate attribute is not changed, otherwise it is left blank.
所述文本逻辑包括若局部变量的值为假则结束执行,否则执行对应的文本操作函数,并将执行结果放入指定的另一子组件的显示值;The text logic includes terminating execution if the value of the local variable is false, otherwise executing the corresponding text operation function and placing the execution result into the display value of another specified subcomponent;
所述属性回写逻辑包括:若查询弹窗的结果存在,则根据结果数据类型处理后并入表单数据;The attribute write-back logic includes: if the query pop-up window result exists, then process it according to the result data type and merge it into the form data;
所述对象回写逻辑包括:遍历表单数据,将符合的字段根据配置规则转换后并入弹窗查询条件。The object write-back logic includes: traversing the form data, converting the matching fields according to the configuration rules and incorporating them into the pop-up query conditions.
基于上述公开的内容,本申请实施例通过检测用户对主属性的赋值操作,并判断该主属性是否有可执行的属性联动规则,若是,则获取该主属性的数据变化情况;根据主属性及其数据变化情况获取对应的从属性列表,根据属性联动规则确定从属性的动作类型,并根据动作类型确定从属性的数据处理规则,其中,动作类型包括取值联动;根据动作类型匹配渲染API,将从属性的数据处理规则代入到渲染API方法中进行页面数据渲染,并将数据渲染结果在用户界面进行展示。从而打破了传统的用户界面+元数据的页面开发模式,提供了基于用户界面+规则适配+元数据的新型页面开发模式,通过预先设置属性联动规则对界面数据关系和数据处理方式进行封装,实现页面数据规则的统一管理,降低了页面代码逻辑的复杂度,并减少了页面数量;当检测到用户对界面的操作时,基于属性联动规则所定义的数据处理方法自动对页面数据进行处理,在实现页面属性灵活展示的基础上,进一步解决了页面数据的处理灵活性问题。Based on the above disclosed content, the embodiment of the present application detects the user's assignment operation on the main attribute, and determines whether the main attribute has an executable attribute linkage rule. If so, the data change of the main attribute is obtained; the corresponding subordinate attribute list is obtained according to the main attribute and its data change, the action type of the subordinate attribute is determined according to the attribute linkage rule, and the data processing rule of the subordinate attribute is determined according to the action type, wherein the action type includes value linkage; the rendering API is matched according to the action type, and the data processing rule of the subordinate attribute is substituted into the rendering API method to render the page data, and the data rendering result is displayed in the user interface. Thus, the traditional page development mode of user interface + metadata is broken, and a new page development mode based on user interface + rule adaptation + metadata is provided. The interface data relationship and data processing method are encapsulated by pre-setting attribute linkage rules, and the unified management of page data rules is realized, the complexity of page code logic is reduced, and the number of pages is reduced; when the user's operation on the interface is detected, the page data is automatically processed based on the data processing method defined by the attribute linkage rule, and the problem of page data processing flexibility is further solved on the basis of realizing flexible display of page attributes.
为了对本申请实施例的具体应用效果进行说明,以下给出具体的属性联动应用例对本申请实施例中的基于属性联动规则的页面数据处理方法做进一步的验证,具体如下:In order to illustrate the specific application effect of the embodiment of the present application, a specific attribute linkage application example is given below to further verify the page data processing method based on attribute linkage rules in the embodiment of the present application, as follows:
取值联动示例:属性联动规则的使用需要在表2和表4中进行配置,例如图5所示,指定的rule_no根据m_attr_val(主属性值)的值改变了s_attr_val(从属性)的取值范围,取得的联动效果如图所示,由图6中可以看出,在进行联动设置时,主属性取指定值时从属性字典值范围发生变化时自动设置为新的字典范围的第一项(仅过滤),不触发时恢复原字典范围;在进行默认值设置时,当设置m_attr_val(主属性值)为null(空)时会修改模板的默认字典范围,若从属性不是字典型会将首个s_attr_val(从属性值)作为默认值填入(可以被清除)。Example of value linkage: The use of attribute linkage rules needs to be configured in Table 2 and Table 4. For example, as shown in Figure 5, the specified rule_no changes the value range of s_attr_val (subordinate attribute) according to the value of m_attr_val (primary attribute value). The linkage effect is shown in the figure. As can be seen from Figure 6, when setting the linkage, when the primary attribute takes the specified value, when the subordinate attribute dictionary value range changes, it is automatically set to the first item of the new dictionary range (only filtering), and the original dictionary range is restored when it is not triggered; when setting the default value, when setting m_attr_val (primary attribute value) to null (empty), the default dictionary range of the template will be modified. If the subordinate attribute is not a character, the first s_attr_val (subordinate attribute value) will be filled in as the default value (can be cleared).
属性操作示例:如图7和图8所示,属性操作包括属性开关、常用配置、后缀按钮和其他配置。其中,属性开关操作时在s_act_rule(规则动作)字段写入要操作的属性【属性=true/false】并用&符拼接,省略等号时默认该属性=true(符合主属性条件时);常用配置包括required【必填】、disabled【禁用】、readonly【只读】、pDisabled【禁用查询关系】等参数的true/false修改操作;后缀按钮中增加了输入框后缀按钮的显示及图标配置【suffixIcon=el-icon-edit】,按钮方法使用回调函数根据prop调用自己的方法;其他配置包括其他原生输入的type值也可以进行开关配置,主属性为字典且多个值对应同一操作时可以使用//拼接主属性值。Example of attribute operation: As shown in Figures 7 and 8, attribute operations include attribute switches, common configurations, suffix buttons, and other configurations. When the attribute switch operation is performed, the attribute to be operated is written in the s_act_rule (rule action) field [attribute = true/false] and concatenated with the & symbol. When the equal sign is omitted, the attribute is assumed to be true (when the main attribute condition is met); common configurations include true/false modification operations of parameters such as required, disabled, readonly, and pDisabled; the display and icon configuration of the input box suffix button [suffixIcon = el-icon-edit] is added to the suffix button, and the button method uses a callback function to call its own method according to prop; other configurations include other native input type values that can also be configured for switches. When the main attribute is a dictionary and multiple values correspond to the same operation, // can be used to concatenate the main attribute value.
拼装(多属性)示例:拼装规则如图9所示,由图10可看出拼装的效果展示,其中,需要说明的是,拼装的适用条件为所有需要拼接的属性都需要配置在表单中推荐使用后端拼接逻辑;拼装顺序为区域以外根据ruleNo由小到大进行排序,可以拼接字典的回填值或输入框文本(m_attr_val字段非空时,不符合的值不会进行拼接);拼装方法为新增拼接规则代码时(写在前端generateFrom组件的calculationFormulas.js文件内),将s_act_rule字段设置为新增拼接规则代码的方法名。Assembly (multi-attribute) example: The assembly rules are shown in Figure 9, and the assembly effect can be seen in Figure 10. It should be noted that the applicable conditions for assembly are that all attributes that need to be assembled need to be configured in the form, and it is recommended to use the back-end assembly logic; the assembly order is to sort from small to large according to ruleNo outside the area, and the backfill value of the dictionary or the input box text can be assembled (when the m_attr_val field is not empty, the non-compliant value will not be assembled); when the assembly method is to add a new assembly rule code (written in the calculationFormulas.js file of the generateFrom component on the front end), set the s_act_rule field to the method name of the new assembly rule code.
计算(多属性)示例:计算规则如图11所示,其中,计算的适用条件为所有需要计算的属性都需要配置在表单中(计算数字时忽略非数,也适用于读取主属性已输入的数量来改变从属性值);计算方法为新增计算规则代码时(写在前端generateForm组件的calculationFormulas.js文件内),然后修改s_act_rule字段为计算规则代码的方法名;例如:天线下倾角合计=机械下倾角+电下倾角_FDD1.8G+电下倾角_NR3.5G+电下倾角_800M+电下倾角_2.1G+内置下倾角。Calculation (multi-attribute) example: The calculation rules are shown in Figure 11, where the applicable conditions for the calculation are that all attributes that need to be calculated need to be configured in the form (ignore non-numbers when calculating numbers, and also apply to reading the number of inputs of the main attribute to change the value of the subordinate attribute); the calculation method is to add a new calculation rule code (written in the calculationFormulas.js file of the generateForm component on the front end), and then modify the s_act_rule field to the method name of the calculation rule code; for example: Total antenna downtilt angle = mechanical downtilt angle + electrical downtilt angle_FDD1.8G + electrical downtilt angle_NR3.5G + electrical downtilt angle_800M + electrical downtilt angle_2.1G + built-in downtilt angle.
关联控件回写下级示例:如图12所示,其适用条件为主从属性都配置为关联控件,带出的属性为非关联关系(不带@的属性),然后在s_act_rule填入从属性查询模板中配置的关联关系;其回写顺序为若关联关系弹窗本身有会增加自身属性的trigger字段,且字段名与被回填的从属性字段相同时,回填值覆盖trigger字段带入的初值,例如:选择设备(M)后回写端口(S)的所属设备(R)、选择所属设备(M)后回写所属板卡(S)中的所属设备(R)。Example of associative control writing back to the lower level: As shown in Figure 12, its applicable condition is that both the primary and secondary attributes are configured as associative controls, the attributes brought out are non-association relationships (attributes without @), and then the association relationship configured in the secondary attribute query template is filled in s_act_rule; the write-back order is that if the association relationship pop-up window itself has a trigger field that will increase its own attributes, and the field name is the same as the secondary attribute field to be backfilled, the backfilled value covers the initial value brought in by the trigger field, for example: after selecting the device (M), the device (R) to which the port (S) belongs is written back, and after selecting the owned device (M), the owned device (R) in the owned board (S) is written back.
关联控件回写表单示例,如图13所示,其适用条件为主属性配置为关联控件,带出的属性需为关联关系(带@的属性),然后在s_act_rule填入主属性查询模板中配置的关联关系。其应用的特殊场景为安装位置带出局站及局站的纬度,上属BTS根据网络类型(多选字典字段)取值带出基站标识。在自动清除时,主属性被清除时会连带清除带出从属性。An example of the association control writeback form is shown in Figure 13. Its applicable condition is that the main attribute is configured as an association control, and the attribute brought out must be an association relationship (attribute with @), and then fill in the association relationship configured in the main attribute query template in s_act_rule. Its special application scenario is that the installation location brings out the station and the latitude of the station, and the upper BTS brings out the base station identification according to the network type (multiple-select dictionary field). When automatically clearing, when the main attribute is cleared, the subordinate attribute will be cleared as well.
其中,需要说明的是,上述各属性联动示例的适用组件包括但不限于generateForm组件及上级的generateGroupForm、parseView等上级组件;采用的条件判断为主属性值(m_attr_val)为null(空)时默认任意文本触发规则,有值时识别为固定值(固定值不匹配时会被忽略)触发规则;采用的规则判断为一个主属性可以关联多个子属性,只有主属性+从属性+规则动作+规则模板相同时才判断为同种规则;采用的规则加载方式为spec_id支持设备大类配置,如果子类规格有则细类规格优先(细类替换大类)。Among them, it should be noted that the applicable components of the above-mentioned attribute linkage examples include but are not limited to the generateForm component and its upper-level components such as generateGroupForm and parseView; the conditional judgment adopted is that when the main attribute value (m_attr_val) is null (empty), any text triggers the rule by default, and when there is a value, it is identified as a fixed value (the fixed value will be ignored when it does not match) to trigger the rule; the rule judgment adopted is that a main attribute can be associated with multiple sub-attributes, and only when the main attribute + subordinate attribute + rule action + rule template are the same, they are judged as the same type of rules; the rule loading method adopted is spec_id to support the configuration of the main category of equipment. If there is a sub-category specification, the detailed category specification takes precedence (the detailed category replaces the main category).
第二方面提供第一方面提供一种基于属性联动规则的页面数据处理装置,包括:The second aspect provides a page data processing device based on attribute linkage rules according to the first aspect, comprising:
数据变化获取模块,用于检测用户对主属性的赋值操作,并判断该主属性是否有可执行的属性联动规则,若是,则获取该主属性的数据变化情况;The data change acquisition module is used to detect the user's assignment operation on the main attribute and determine whether the main attribute has an executable attribute linkage rule. If so, the data change of the main attribute is obtained;
数据处理规则确定模块,用于根据主属性及其数据变化情况获取对应的从属性列表,根据属性联动规则确定从属性的动作类型,并根据动作类型确定从属性的数据处理规则,其中,动作类型包括取值联动;The data processing rule determination module is used to obtain the corresponding subordinate attribute list according to the main attribute and its data change, determine the action type of the subordinate attribute according to the attribute linkage rule, and determine the data processing rule of the subordinate attribute according to the action type, wherein the action type includes value linkage;
页面数据渲染模块,用于根据动作类型匹配渲染API,将从属性的数据处理规则代入到渲染API方法中进行页面数据渲染,并将数据渲染结果在用户界面进行展示。The page data rendering module is used to match the rendering API according to the action type, substitute the data processing rules from the attributes into the rendering API method to render the page data, and display the data rendering results on the user interface.
本实施例第二方面提供的前述装置的工作过程、工作细节和技术效果,可以参见如上第一方面或第一方面中任意一种可能设计所述的方法,于此不再赘述。The working process, working details and technical effects of the aforementioned device provided in the second aspect of this embodiment can be referred to the method described in the first aspect or any possible design of the first aspect, and will not be repeated here.
第三方面,本发明提供一种计算机可读存储介质,所述计算机可读存储介质上存储有指令,当所述指令在计算机上运行时,执行如第一方面任意一种可能的设计中所述的方法。In a third aspect, the present invention provides a computer-readable storage medium having instructions stored thereon. When the instructions are run on a computer, the method described in any possible design of the first aspect is executed.
其中,所述计算机可读存储介质是指存储数据的载体,可以但不限于包括软盘、光盘、硬盘、闪存、优盘和/或记忆棒(Memory Stick)等,所述计算机可以是通用计算机、专用计算机、计算机网络、或者其他可编程装置。The computer-readable storage medium refers to a carrier for storing data, which may include but is not limited to floppy disks, CDs, hard disks, flash memories, USB flash drives and/or memory sticks, etc. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices.
本实施例第三方面提供的前述计算机可读存储介质的工作过程、工作细节和技术效果,可以参见如上第一方面或第一方面中任意一种可能设计所述的方法,于此不再赘述。The working process, working details and technical effects of the aforementioned computer-readable storage medium provided in the third aspect of this embodiment can be referred to the method described in the first aspect or any possible design of the first aspect, and will not be repeated here.
最后应说明的是:以上所述仅为本发明的优选实施例而已,并不用于限制本发明的保护范围。凡在本发明的精神和原则之内,所作的任何修改、等同替换、改进等,均应包含在本发明的保护范围之内。 Finally, it should be noted that the above description is only a preferred embodiment of the present invention and is not intended to limit the protection scope of the present invention. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.
Claims (10)
Applications Claiming Priority (2)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202211330067.2A CN115686457A (en) | 2022-10-27 | 2022-10-27 | A page data processing method and medium based on attribute linkage rules |
| CN202211330067.2 | 2022-10-27 |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| WO2024087909A1 true WO2024087909A1 (en) | 2024-05-02 |
Family
ID=85046870
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| PCT/CN2023/117832 Ceased WO2024087909A1 (en) | 2022-10-27 | 2023-09-08 | Attribute linkage rule-based page data processing method, and medium |
Country Status (2)
| Country | Link |
|---|---|
| CN (1) | CN115686457A (en) |
| WO (1) | WO2024087909A1 (en) |
Cited By (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN118245032A (en) * | 2024-05-30 | 2024-06-25 | 浩鲸云计算科技股份有限公司 | Attribute linkage engine method and system for customer relationship management |
| CN118860357A (en) * | 2024-09-26 | 2024-10-29 | 浪潮通用软件有限公司 | A low-code property editor registration method |
| CN120723279A (en) * | 2025-09-01 | 2025-09-30 | 浪潮通用软件有限公司 | Method, system, device and medium for automatically updating interface controls based on data source differences |
Families Citing this family (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN115686457A (en) * | 2022-10-27 | 2023-02-03 | 中通服软件科技有限公司 | A page data processing method and medium based on attribute linkage rules |
| CN117215585B (en) * | 2023-11-09 | 2024-03-08 | 浪潮通用软件有限公司 | Visual description and dynamic control method and device for interface component attribute |
| CN118276875B (en) * | 2024-05-31 | 2024-08-09 | 欢乐互娱(上海)科技股份有限公司 | Dynamic form linkage configuration method and system |
Citations (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN112416349A (en) * | 2020-12-08 | 2021-02-26 | 携程计算机技术(上海)有限公司 | Form page generation method, system, equipment and storage medium |
| CN112506494A (en) * | 2020-11-02 | 2021-03-16 | 福建亿能达信息技术股份有限公司 | Method, device, equipment and medium for realizing extensible dynamic component based on VUE (virtual user Equipment) |
| CN114266233A (en) * | 2021-11-29 | 2022-04-01 | 中国联合网络通信集团有限公司 | Form generation method, device, equipment and medium |
| CN115686457A (en) * | 2022-10-27 | 2023-02-03 | 中通服软件科技有限公司 | A page data processing method and medium based on attribute linkage rules |
Family Cites Families (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN110020376A (en) * | 2017-12-28 | 2019-07-16 | 北京京东尚科信息技术有限公司 | Data linkage method and system |
| CN110008449B (en) * | 2018-01-04 | 2023-07-07 | 北大医疗信息技术有限公司 | Form control linkage method, form control linkage device, computer equipment and readable storage medium |
-
2022
- 2022-10-27 CN CN202211330067.2A patent/CN115686457A/en active Pending
-
2023
- 2023-09-08 WO PCT/CN2023/117832 patent/WO2024087909A1/en not_active Ceased
Patent Citations (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN112506494A (en) * | 2020-11-02 | 2021-03-16 | 福建亿能达信息技术股份有限公司 | Method, device, equipment and medium for realizing extensible dynamic component based on VUE (virtual user Equipment) |
| CN112416349A (en) * | 2020-12-08 | 2021-02-26 | 携程计算机技术(上海)有限公司 | Form page generation method, system, equipment and storage medium |
| CN114266233A (en) * | 2021-11-29 | 2022-04-01 | 中国联合网络通信集团有限公司 | Form generation method, device, equipment and medium |
| CN115686457A (en) * | 2022-10-27 | 2023-02-03 | 中通服软件科技有限公司 | A page data processing method and medium based on attribute linkage rules |
Cited By (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN118245032A (en) * | 2024-05-30 | 2024-06-25 | 浩鲸云计算科技股份有限公司 | Attribute linkage engine method and system for customer relationship management |
| CN118860357A (en) * | 2024-09-26 | 2024-10-29 | 浪潮通用软件有限公司 | A low-code property editor registration method |
| CN120723279A (en) * | 2025-09-01 | 2025-09-30 | 浪潮通用软件有限公司 | Method, system, device and medium for automatically updating interface controls based on data source differences |
Also Published As
| Publication number | Publication date |
|---|---|
| CN115686457A (en) | 2023-02-03 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| WO2024087909A1 (en) | Attribute linkage rule-based page data processing method, and medium | |
| US7620644B2 (en) | Reentrant database object wizard | |
| JP6479079B2 (en) | Extension activation for related documents | |
| US20190392023A1 (en) | Inheritance of rules across hierarchical levels | |
| US9910641B2 (en) | Generation of application behaviors | |
| CN108027721B (en) | Techniques for configuring a general program using controls | |
| CN107480369A (en) | Classification shows DRC design, operating method in a kind of PCB design | |
| CN112948264A (en) | Test task execution method, device, system, storage medium and electronic device | |
| CN111159301A (en) | Data creating method, device, equipment and storage medium based on intelligent contract | |
| KR20060093004A (en) | System and method for providing a visual representation of a computing system | |
| CN116048731A (en) | Code processing method, device, electronic device and storage medium | |
| CN115629763A (en) | Target code generation method and NPU instruction display method and device | |
| KR20220112977A (en) | System and method for user interface management of AUTOSAR setting tool | |
| CN118778944A (en) | A digital, low-code platform | |
| CN117873874A (en) | Interface element positioning method, system, medium and electronic equipment | |
| WO2019169720A1 (en) | Automatic test assertion method and apparatus, and computer device and storage medium | |
| KR20230062243A (en) | Apparatus for extracting work process using log data and method thereof | |
| US10761719B2 (en) | User interface code generation based on free-hand input | |
| CN119690421A (en) | User interface business component design method, device, terminal and medium | |
| CN121145288A (en) | A data management method, apparatus and electronic device | |
| CN115455876A (en) | Method for debugging logic system design and electronic equipment | |
| CN114491500A (en) | Data authority control method and device and readable storage medium | |
| CN115391186A (en) | Testing method, system, device and storage medium of page component | |
| CN120910376A (en) | Webpage generation method, webpage generation device, electronic equipment and medium | |
| CN114817161A (en) | Copying and pasting method and computing device |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| 121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 23881490 Country of ref document: EP Kind code of ref document: A1 |
|
| NENP | Non-entry into the national phase |
Ref country code: DE |
|
| 32PN | Ep: public notification in the ep bulletin as address of the adressee cannot be established |
Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205 DATED 17/09/2025) |