A form enumeration field synchronization method, device, medium and product
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- INSPUR GENERSOFT CO LTD
- Filing Date
- 2025-05-30
- Publication Date
- 2026-08-07
AI Technical Summary
然而,对于枚举项的更新,可以是对枚举项进行增删、对一个或多个枚举项的禁用属性做变更、调整其中部分或全部枚举项的顺序等,也可以同时进行以上更新操作中的至少两种,现有枚举字段的更新通常是将当前枚举字段及其属性全部替换为新的,但是,对于枚举项较多的枚举字段而言,新旧枚举项之间存在大量重复,如果直接替换,会造成不必要的计算资源浪费,而且,对于新增枚举项,如果不是用户所需要的,直接替换后还需重新进行禁用属性设置,造成用户体验不佳
[0024]以上一个或多个技术方案中,客户端响应于表单打开操作后即自服务器获取最新表单schema,通过新旧schema比对确定需要更新的枚举项,进而针对性的执行更新操作,避免了不必要的计算资源浪费,同时提高了同步效率。
Smart Images

Figure CN120632235B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of electronic form technology, and in particular relates to a method, device, medium and product for synchronizing form enumeration fields. Background Technology
[0002] The statements in this section are merely background information related to the present invention and do not necessarily constitute prior art.
[0003] When developing web forms using low-code or no-code methods, different entity type fields are created based on data requirements, and then these entity fields are bound using controls of specified types in the form designer. After the form is created, data synchronization is required when modifying information within the entities. In addition to the name of the enumeration field itself, changes to its enumeration items also require change detection and information synchronization. However, updating enumeration items can involve adding or deleting items, changing the disabled attributes of one or more enumeration items, adjusting the order of some or all enumeration items, or performing at least two of these update operations simultaneously. Updating existing enumeration fields typically involves replacing the current enumeration field and its attributes with the new ones. However, for enumeration fields with many items, there is significant duplication between the old and new items. Direct replacement would result in unnecessary waste of computational resources. Furthermore, for newly added enumeration items that are not needed by the user, direct replacement would require re-setting the disabled attributes, leading to a poor user experience. Summary of the Invention
[0004] To overcome the shortcomings of the prior art, this invention provides a method, device, medium, and product for synchronizing form enumeration fields. When a front-end web form is opened, the enumeration items that need to be updated can be identified through comparison, and then the synchronization operation can be performed in a targeted manner, avoiding unnecessary waste of computing resources.
[0005] To achieve the above objectives, a first aspect of the present invention provides a method for synchronizing form enumeration fields, applied to a client, comprising the following steps:
[0006] In response to a form open operation, retrieve the latest form schema from the server;
[0007] Compare the current form schema with the latest form schema. If there are changes to the enumeration fields, determine the enumeration items to be synchronized in the enumeration fields and their synchronization information. The synchronization information is order change and / or disable attribute change.
[0008] Perform the enumeration field synchronization operation based on the enumeration items to be synchronized and their synchronization information.
[0009] In some embodiments, the enumeration items to be synchronized and their synchronization information in the enumeration field are determined according to the synchronization type, wherein the synchronization type is distinguished based on the size relationship between the current enumeration item and the number of enumeration items to be synchronized;
[0010] If the number of current enumeration items is the same as the number of the latest enumeration items, enumeration items with order changes and / or disabled attribute changes will be enumeration items to be synchronized.
[0011] The synchronization type is when the current number of enumeration items is less than the latest number of enumeration items, the newly added enumeration items and the enumeration items that have order changes and / or disabled attribute changes among the enumeration items that are the same between the two are regarded as enumeration items to be synchronized.
[0012] The synchronization type is such that when the current number of enumeration items is greater than the number of the latest enumeration items, all the latest enumeration items are treated as enumeration items to be synchronized.
[0013] In some embodiments, after determining the enumeration items to be synchronized and their synchronization information in the enumeration field according to the synchronization type, a change object array is generated. The change object array includes the synchronization type, the enumeration field to be synchronized, the order index value of the enumeration items to be synchronized in the enumeration field to be synchronized, and the disabled attribute; the enumeration field synchronization operation is performed according to the change object array.
[0014] In some embodiments, performing an enumeration field synchronization operation based on the changed object array includes: obtaining the synchronization type, performing sequential changes on some or all enumeration items of the enumeration field, and / or disabling attribute changes.
[0015] In some embodiments, the synchronization type is such that when the current number of enumeration items is less than the number of enumeration items to be synchronized, the newly added enumeration items in the enumeration items to be synchronized are synchronized to the properties of the enumeration field control.
[0016] In some embodiments, after performing the enumeration field synchronization operation, the form interface rendering and refresh operation are also performed; before performing the form interface rendering and refresh operation, it is determined whether the user has performed a selected control operation. If so, after performing the form interface rendering and refresh operation, the action of simulating clicking the control is performed.
[0017] A second aspect of the present invention provides a method for synchronizing form enumeration fields, applied to a server, the server being connected to the aforementioned client, the method comprising the following steps:
[0018] In response to a request to change the attribute of an enumerated field in an entity, a value object is created;
[0019] Synchronize the modified enumeration field information to the value object;
[0020] Synchronize the modified enumeration field information self-value object to the form schema.
[0021] A third aspect of the present invention provides an electronic device including a processor and a memory, wherein the memory stores computer instructions that, when executed by the processor, cause the electronic device to perform the method described thereon.
[0022] A fourth aspect of the present invention provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the method.
[0023] A fifth aspect of the present invention provides a computer program product comprising a computer program that, when executed by a processor, implements the method described herein.
[0024] In one or more of the above technical solutions, the client obtains the latest form schema from the server after responding to the form open operation, determines the enumeration items that need to be updated by comparing the old and new schemas, and then performs the update operation accordingly, avoiding unnecessary waste of computing resources and improving synchronization efficiency.
[0025] Specifically, by dividing the number of new and old enumeration items into different synchronization types, and then distinguishing between synchronizing some enumeration items or synchronizing all enumeration items, the synchronization efficiency can be improved while ensuring the correctness of information synchronization. Attached Figure Description
[0026] The accompanying drawings, which form part of this invention, are used to provide a further understanding of the invention. The illustrative embodiments of the invention and their descriptions are used to explain the invention and do not constitute an improper limitation of the invention.
[0027] Figure 1 This is an overall flowchart of the form enumeration field synchronization method in one or more embodiments of the present invention;
[0028] Figure 2 This is a schematic diagram illustrating how the synchronization strategy is determined based on the synchronization type for a form enumeration field in one or more embodiments of the present invention. Detailed Implementation
[0029] Embodiments of this application will now be described in more detail with reference to the accompanying drawings. While some embodiments of this application are shown in the drawings, it should be understood that this application can be implemented in various forms and should not be construed as limited to the embodiments set forth herein. Rather, these embodiments are provided to provide a more thorough and complete understanding of this application. It should be understood that the drawings and embodiments of this application are for illustrative purposes only and are not intended to limit the scope of protection of this application.
[0030] In the description of the embodiments of this application, the term "comprising" and similar terms should be understood as open inclusion, that is, "including but not limited to". The term "based on" should be understood as "at least partially based on".
[0031] Low-code platforms offer a rich set of pre-defined components (such as text boxes, dropdown lists, radio buttons, checkboxes, etc.), allowing developers to directly modify form layouts and field attributes through a visual interface. If the order of form fields needs to be adjusted or the display method of a field needs to be modified, simple drag-and-drop or attribute configuration in the design interface is sufficient, without rewriting code. Specifically, developers select the required field components (such as text boxes, dropdown lists, date pickers, etc.) from the low-code platform's component library and drag them into the form layout. They then set attributes for each field, such as field name, data type, whether it is required, and default value. Finally, they bind the form fields to the data source (such as a database table, API interface, etc.) by selecting the data source and field mapping relationship. Common field component types include text fields, enumeration fields, and date / time fields. Enumeration fields are used to store a predefined, finite set of values, often called enumeration items, used to support single-selection or multiple-selection functionality. For example, the enumeration field "Gender" could have values including "Male" and "Female".
[0032] As described in the background section, enumeration fields are updated in various ways. Directly replacing all enumeration items may impair synchronization efficiency and waste computational resources due to the replacement of numerous duplicate items. Furthermore, if new enumeration items are added, it cannot be guaranteed that these new items are what the user needs, impacting user experience. To address these issues, one or more embodiments of the present invention provide a method for synchronizing form enumeration fields, such as... Figure 1 As shown, it includes the following steps:
[0033] S101: The server responds to the attribute change request of the enumerated field in the entity and creates a value object;
[0034] S102: Synchronize the modified enumeration field information to the value object;
[0035] S103: Synchronize the modified enumeration field information self-value object to the form schema.
[0036] S104: In response to a form open operation, the client retrieves the latest form schema from the server;
[0037] S105: Compare the current form schema with the latest form schema. If there are changes to the enumeration fields, determine the enumeration items to be synchronized in the enumeration fields and their synchronization information. The synchronization information is order change and / or disable attribute change.
[0038] The server uses value objects as a synchronization bridge, which can effectively avoid data inconsistencies between actual changes and system records, ensuring that the front-end form can accurately display the latest enumeration field information.
[0039] When synchronizing enumeration fields, the client first determines the enumeration items to be synchronized by comparison, and then synchronizes them in a targeted manner, rather than replacing them all indiscriminately, which improves synchronization efficiency and thus improves user experience.
[0040] In step S101, the attribute changes include adding or deleting enumeration items, changing the order of enumeration items, or disabling attributes. In response to a user saving an attribute change to an enumeration field in an entity, an attribute change request is generated, triggering the creation of a Value Object (VO). This triggering synchronization mechanism ensures that the enumeration items in the form's enumeration fields reflect backend changes in real time, guaranteeing the real-time nature of form updates.
[0041] In steps S102 and S103, the latest enumeration field information is synchronized to the form schema via a value object. The value object acts as an intermediary layer, accurately transmitting data changes and avoiding data inconsistency issues. Specifically, when an enumeration field's attribute changes, creating a value object (VO) and fully synchronizing the changed enumeration field information to the value object ensures that the data in the value object remains consistent with the latest state of the enumeration field. Further synchronizing the changed enumeration field information from the value object to the form schema (form definition) ensures that the enumeration field options displayed in the form are consistent with the definitions in the backend database or business logic. Furthermore, using a value object to encapsulate the enumeration field's change information decouples the enumeration field's change logic from the form's display logic. Changes to the enumeration field do not directly affect the form's implementation; instead, they are transmitted through the value object as an intermediary layer. In step S104, the client responds to the form (form designer) open operation by obtaining the latest form schema from the server. That is, the latest form schema is obtained every time the user opens the form to determine whether it needs to be updated, thus avoiding any impact on the user's operation of the form.
[0042] In step S105, the current form schema is compared with the latest form schema. If there is a change in the enumeration field, the synchronization type for the enumeration field is first determined, and then the synchronization strategy is determined. Based on the synchronization strategy, the enumeration items to be synchronized and their synchronization information in the enumeration field are determined.
[0043] It's important to note that enumeration fields, as a primary field type, have enumeration items closely related to data in the database. Therefore, the editing functionality of enumeration field attributes needs to be limited to ensure data consistency and the stability of business logic. For example, if an enumeration item is deleted, and a corresponding data record already exists in the database, this will lead to data inconsistency. For instance, an order status field might have enumeration items such as "Order Placed," "Shipped," and "Completed." If the "Shipped" status is deleted, all order records in the database with the "Shipped" status will not be displayed or processed correctly. In some cases, deleting an enumeration item may lead to the accidental deletion or incorrect reading of related data. For example, if the low-code platform does not perform data migration or compatibility processing when deleting an enumeration item, it may directly delete data records related to that enumeration item, or cause queries to fail, resulting in data loss. Furthermore, if some enumeration items are deleted, and subsequent user-submitted forms contain values of deleted enumeration items, the system will fail validation. If the enumeration field has dependencies on other fields or business modules, it will also affect normal business processes. Based on this, in some embodiments, the client restricts the user's editing operations on enumeration items, does not allow deletion operations on enumeration items, and disables the operation instead of deleting the enumeration item if it is not needed.
[0044] By replacing deletion with disabling operations, changes to enumeration items are restricted, allowing only additions, changes in order, or changes to their disabled status. Based on this, changes in quantity can be used to differentiate between different synchronization strategies. For example, if the current number of enumeration items is the same as the latest number, it means only order changes or disabled attribute changes are possible. If the current number of enumeration items is less than the latest number and equal to it, it means the server has added a new enumeration item, and other enumeration items may have undergone order changes or disabled attribute changes. If the current number of enumeration items is greater than the latest number, it means the developer has added other prohibited enumeration items. Therefore, by comparing the number of enumeration items, the synchronization type can be quickly identified, and the corresponding synchronization operation can be executed.
[0045] As a specific implementation method, such as Figure 2 As shown, synchronization types are distinguished based on the relationship between the number of current enumeration items and the number of the latest enumeration items. These synchronization types include: the current enumeration item and the latest enumeration item have the same number of items; the current enumeration item is less than the latest enumeration item; and the current enumeration item is greater than the latest enumeration item. For simplicity, these are referred to as the first, second, and third synchronization types, respectively. The synchronization strategies are as follows:
[0046] (1) First type of synchronization: The number of current enumeration items is the same as the number of latest enumeration items.
[0047] When the number of enumeration items remains unchanged, synchronization only involves the order of the enumeration items and the disabled attributes of the enumeration items. Therefore, enumeration items whose order has changed and / or whose disabled attributes have changed are designated as enumeration items to be synchronized. Understandably, during synchronization, only the corresponding order changes and / or disabled attribute changes are performed on the enumeration items to be synchronized.
[0048] (2) Second type of synchronization: The current number of enumeration items is less than the latest number of enumeration items.
[0049] When the number of new enumeration items is greater than or equal to the number of old enumeration items in the form schema record, the enumeration item information recorded in the form is filtered from the new enumeration item data to identify whether the enumeration items recorded in the form have undergone changes in order or disabled attributes in the new enumeration item data. That is, newly added enumeration items, as well as enumeration items with changes in order and / or disabled attributes among the same enumeration items, are designated as enumeration items to be synchronized. As an example, old enumeration items can be filtered from the new enumeration items; during subsequent replacement, only the filtered data will replace the node information in the form's metadata. Understandably, during synchronization, after making the corresponding order changes and / or disabled attribute changes for the enumeration items to be synchronized, new enumeration items are added.
[0050] (3) Third type of synchronization: The current number of enumeration items is greater than the latest number of enumeration items.
[0051] If the number of old enumeration items in the form records exceeds the number of new enumeration items, then the old form data is reset, and the new enumeration item data completely replaces the old enumeration item data. That is, all the newest enumeration items are treated as enumeration items to be synchronized, and a complete replacement is performed.
[0052] If we follow the operational approach of the first and second types of synchronization, for the third type of synchronization, we need to first identify the enumeration items that have been illegally added by the user in the current enumeration items, and then identify whether there are any changes in the order and / or changes in the disabled attributes of the remaining enumeration items. Understandably, the above process of identifying illegally added enumeration items requires multiple loop comparisons, which wastes computing resources. Therefore, all the latest enumeration items are taken as enumeration items to be synchronized and all are replaced.
[0053] Furthermore, other enumeration items may have changed order or disabled attributes. In such cases, following the above approach, it is necessary to first delete any newly added enumeration items on the client-side and any existing enumeration items with changed order or disabled attributes.
[0054] When determining the enumeration items to be synchronized and their synchronization information in the enumeration field according to the synchronization type, the enumeration field name, synchronization type and synchronization information are stored to obtain a change object array. The change object array includes the synchronization type, the synchronization enumeration field, the order index value of the enumeration items to be synchronized in the synchronization enumeration field and the disabled attribute; the enumeration field synchronization operation is performed according to the change object array.
[0055] The following table shows an example of changing the structure of an object array:
[0056] Example of changing the structure of an object array
[0057] diffType Synchronization type schemaField schema node information viewmodelField viewmodel node information componentsField component node information
[0058] By iterating through the array, different synchronization operations are performed based on the synchronization type recorded for each object. Specifically, the synchronization operations for different synchronization types are as follows:
[0059] (1) If the synchronization type is the first type or the second type, the change object array only includes the synchronization information of the enumeration items to be synchronized. According to the sequential index value of the enumeration items to be synchronized, the corresponding enumeration items are synchronized in sequence. As an example, the current and new enumeration items of the education field include high school and below, junior college, bachelor's degree, master's degree, and doctoral degree. Assuming that the server has changed the disabled attribute of the doctoral field, the generated change object array is: [first type of synchronization, education field (field to be synchronized), 5 (sequential index value of the enumeration items to be synchronized), disabled (disabled attribute change value)].
[0060] (2) If the synchronization type is the third type, the changed object array includes the synchronization information of all new enumeration items. When performing synchronization, first delete all current enumeration items of the enumeration field, and then synchronize the corresponding enumeration items in sequence according to the order index value of the enumeration items to be synchronized.
[0061] Based on this, the synchronization method can provide different synchronization strategies for various update scenarios of enumeration fields, making the update efficiency higher. At the same time, since the synchronization is based on the changes made on the server, if there are non-compliant enumeration items added by the client user in the form, they will be automatically cleared when synchronization is triggered.
[0062] Understandably, after synchronizing the form schema, the view model and component are synchronized sequentially, transferring the synchronized node information from the schema to the view model and component nodes. At this point, the order and disabled status of the enumeration items displayed in the enumeration item editor of the bound enumeration field control will be consistent with the settings in the entity.
[0063] For the second type of synchronization, when a new enumeration item is added to an enumeration field in an entity, since it cannot be determined whether the new enumeration item is needed by the user, it is not directly synchronized to the form. Therefore, the newly added enumeration item in the latest enumeration items is synchronized to the properties of the enumeration field control, and its disabled property is set to disabled. Users can add the enumeration item in the enumeration field editor by selecting the control properties bound to the enumeration field in the form designer. Specifically, the enumeration field editor will display enumeration items other than those already existing in the form metadata. Users can add them by checking the boxes to ensure that form operation problems are not caused by the absence of the enumeration item in the newly added entity.
[0064] Once synchronization is complete, the form designer will trigger a synchronization success message and simultaneously trigger an event to refresh and re-render the form interface.
[0065] Since synchronous operations take a certain amount of time, the user may have already performed operations such as selecting controls before the interface rendering and refresh are executed. In order to ensure the continuity of user operations and not affect user operations, it is determined whether the user has performed a control selection operation before the form interface rendering and refresh operations are executed. If so, the simulated click action of the control is executed after the form interface rendering and refresh operations are executed.
[0066] In one or more of the above technical solutions, encapsulating changes to enumeration fields through value objects and achieving automatic synchronization simplifies system maintenance. Developers only need to focus on the definition of enumeration fields without worrying about form schema synchronization issues, enabling them to respond more flexibly to changes in business requirements. Changes to enumeration fields can be quickly reflected in the form without requiring extensive code modifications or redeployment. The enumeration field options seen by users in the form are always up-to-date, avoiding user confusion or errors caused by data inconsistencies. This is especially practical for systems that require frequent adjustments to business logic (such as product categorization in e-commerce systems).
[0067] Based on the above method, one or more embodiments of the present invention also provide an electronic device that can be used to implement the form enumeration field synchronization method in the above embodiments. The electronic device includes one or more processors, one or more memories coupled to the processors, and a communication module coupled to the processors.
[0068] The memory may include one or more non-volatile memories and one or more volatile memories. Examples of non-volatile memories include, but are not limited to, at least one of the following: read-only memory (ROM), erasable programmable read-only memory (EPROM), flash memory, hard disk, compact disc (CD), digital video disc (DVD), or other magnetic and / or optical storage. Examples of volatile memories include, but are not limited to, at least one of the following: random access memory (RAM), or other volatile memories that do not persist during the duration of a power outage. The computer program may be stored in the ROM. When the processor executes the computer program, it implements the above-described form enumeration field synchronization method.
[0069] For example, the electronic device serves as a client for developers, and when the processor executes the computer program, it implements the following method steps: in response to a form open operation, it obtains the latest form schema from the server; it compares the current form schema with the latest form schema, and if there are changes to enumeration fields, it determines the enumeration items to be synchronized in the enumeration fields and their synchronization information, wherein the synchronization information is an order change and / or a disabled attribute change; and it performs an enumeration field synchronization operation based on the enumeration items to be synchronized and their synchronization information.
[0070] Specifically, the synchronization type determines the enumeration items to be synchronized and their synchronization information in the enumeration field. The synchronization type is distinguished based on the relationship between the number of current enumeration items and the number of enumeration items to be synchronized: if the number of current enumeration items and the number of the latest enumeration items to be synchronized are the same, enumeration items with order changes and / or disabled attribute changes are taken as enumeration items to be synchronized; if the synchronization type is that the number of current enumeration items is less than the number of the latest enumeration items to be synchronized, newly added enumeration items and enumeration items with order changes and / or disabled attribute changes among the enumeration items that are the same between the two are taken as enumeration items to be synchronized; if the synchronization type is that the number of current enumeration items is greater than the number of the latest enumeration items to be synchronized, all the latest enumeration items to be synchronized are taken as enumeration items to be synchronized.
[0071] After determining the enumeration items to be synchronized and their synchronization information in the enumeration field according to the synchronization type, a change object array is generated. The change object array includes the synchronization type, the enumeration field to be synchronized, the sequential index value of the enumeration item to be synchronized in the enumeration field to be synchronized, and the disabled attribute; the enumeration field synchronization operation is performed according to the change object array.
[0072] Performing enumeration field synchronization operations based on the array of changed objects includes: obtaining the synchronization type, performing sequential changes and / or disabling attribute changes on some or all of the enumeration items of the enumeration field.
[0073] The synchronization type is such that when the current number of enumeration items is less than the number of enumeration items to be synchronized, the newly added enumeration items in the enumeration items to be synchronized are synchronized to the properties of the enumeration field control.
[0074] After performing the enumeration field synchronization operation, the form interface rendering and refresh operation are also performed. Before performing the form interface rendering and refresh operation, it is determined whether the user has performed a selected control operation. If so, after performing the form interface rendering and refresh operation, the action of simulating clicking the control is performed.
[0075] For example, the electronic device serves as a server, the server is connected to a client, and when the processor executes the computer program, it implements the following method steps: in response to an attribute change request for an enumeration field in an entity, a value object is created; the changed enumeration field information is fully synchronized to the value object; and the changed enumeration field information is synchronized from the value object to the form schema.
[0076] In some embodiments, the program may be tangibly contained in a computer-readable medium, which may include a device (such as in memory) or other storage device accessible by the device. The program may be loaded from the computer-readable medium into RAM for execution. The computer-readable medium may include any type of tangible non-volatile memory, such as ROM, EPROM, flash memory, hard disk, where a computer program is stored that, when executed by a processor, implements the above-described form enumeration field synchronization method.
[0077] In the above embodiments, implementation can be achieved entirely or partially through software, hardware, firmware, or any combination thereof. When implemented using software, it can be implemented entirely or partially in the form of a computer program product. The computer program product includes one or more computer instructions. When these computer program instructions are loaded and executed on a server or terminal, they generate all or part of the processes or functions described in the embodiments of this application. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., coaxial cable, fiber optic cable, digital subscriber line) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium accessible to the server or terminal, or a data storage device such as a server or data center that integrates one or more available media. The available medium can be a magnetic medium (e.g., floppy disk, hard disk, and magnetic tape), an optical medium (e.g., digital video disk (DVD), etc.), or a semiconductor medium (e.g., solid-state drive).
[0078] Furthermore, although the operations are described in a specific order, this should be understood as requiring that such operations be performed in the specific order shown or in sequential order, or requiring that all illustrated operations be performed to achieve the desired result. In certain environments, multitasking and parallel processing may be advantageous. Similarly, although several specific implementation details are included in the above discussion, these should not be construed as limiting the scope of this application. Certain features described in the context of individual embodiments may also be implemented in combination in a single implementation. Conversely, various features described in the context of a single implementation may also be implemented individually or in any suitable sub-combination in multiple implementations.
[0079] Although the subject matter has been described using language specific to structural features and / or methodological logic, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or actions described above. Rather, the specific features and actions described above are merely illustrative examples of implementing the claims.
Claims
1. A method for synchronizing form enumeration fields, applied to a client, characterized in that: Includes the following steps: In response to a form open operation, retrieve the latest form schema from the server; Compare the current form schema with the latest form schema. If there are changes to the enumeration fields, determine the enumeration items to be synchronized in the enumeration fields and their synchronization information. The synchronization information is order change and / or disable attribute change. Perform synchronization operations on the enumerated fields based on the enumerated items to be synchronized and their synchronization information; Specifically, the enumeration items to be synchronized and their synchronization information in the enumeration field are determined according to the synchronization type, and the synchronization type is distinguished according to the size relationship between the current enumeration items and the number of enumeration items to be synchronized; The synchronization type is when the number of current enumeration items is the same as the number of the latest enumeration items, enumeration items with order changes and / or disabled attribute changes are used as enumeration items to be synchronized; The synchronization type is when the current number of enumeration items is less than the latest number of enumeration items, the newly added enumeration items and the enumeration items that have order changes and / or disabled attribute changes among the enumeration items that are the same between the two are regarded as enumeration items to be synchronized. The synchronization type is such that when the current number of enumeration items is greater than the number of the latest enumeration items, all the latest enumeration items are treated as enumeration items to be synchronized.
2. The method for synchronizing form enumeration fields as described in claim 1, characterized in that, After determining the enumeration items to be synchronized and their synchronization information in the enumeration field according to the synchronization type, a change object array is generated. The change object array includes the synchronization type, the enumeration field to be synchronized, the sequential index value of the enumeration item to be synchronized in the enumeration field to be synchronized, and the disabled attribute; the enumeration field synchronization operation is performed according to the change object array.
3. The method for synchronizing form enumeration fields as described in claim 2, characterized in that, Performing enumeration field synchronization operations based on the array of changed objects includes: obtaining the synchronization type, performing sequential changes and / or disabling attribute changes on some or all of the enumeration items of the enumeration field.
4. The method for synchronizing form enumeration fields as described in claim 1, characterized in that, The synchronization type is such that when the current number of enumeration items is less than the latest number of enumeration items, the newly added enumeration items in the enumeration items to be synchronized are synchronized to the properties of the enumeration field control.
5. The method for synchronizing form enumeration fields as described in claim 1, characterized in that, After performing the enumeration field synchronization operation, the form interface rendering and refresh operation are also performed. Before performing the form interface rendering and refresh operation, it is determined whether the user has performed a selected control operation. If so, after performing the form interface rendering and refresh operation, the action of simulating clicking the control is performed.
6. A method for synchronizing form enumeration fields, applied to a server, wherein the server is connected to a client, and the client is configured to execute the method as described in any one of claims 1-5, characterized in that... The method includes the following steps: In response to a request to change the attribute of an enumerated field in an entity, a value object is created; Synchronize the modified enumeration field information to the value object; Synchronize the modified enumeration field information self-value object to the form schema.
7. An electronic device comprising a processor and a memory, wherein the memory stores computer instructions, characterized in that, When the computer instructions are executed by the processor, the electronic device performs the method of any one of claims 1 to 6.
8. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the program is executed by the processor, it implements the method according to any one of claims 1 to 6.
9. A computer program product, the computer program product comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the method as described in any one of claims 1 to 6.
Citation Information
Patent Citations
Exchange of syncronization data and metadata
CN101809561A
Method and device for web form data updating, equipment and storage medium
CN111191163A