CN116860244A - Component arrangement method, device, computer equipment and storage medium - Google Patents

Component arrangement method, device, computer equipment and storage medium Download PDF

Info

Publication number
CN116860244A
CN116860244A CN202310785061.2A CN202310785061A CN116860244A CN 116860244 A CN116860244 A CN 116860244A CN 202310785061 A CN202310785061 A CN 202310785061A CN 116860244 A CN116860244 A CN 116860244A
Authority
CN
China
Prior art keywords
component
names
components
arranging
name
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.)
Pending
Application number
CN202310785061.2A
Other languages
Chinese (zh)
Inventor
曾文强
叶松林
陈洋
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Thalys Automobile Co ltd
Original Assignee
Thalys Automobile Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Thalys Automobile Co ltd filed Critical Thalys Automobile Co ltd
Priority to CN202310785061.2A priority Critical patent/CN116860244A/en
Publication of CN116860244A publication Critical patent/CN116860244A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/38Creation or generation of source code for implementing user interfaces
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/34Graphical or visual programming
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management
    • G06F8/71Version control; Configuration management

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Human Computer Interaction (AREA)
  • Computer Security & Cryptography (AREA)
  • Stored Programmes (AREA)

Abstract

The present application relates to the field of software development, and in particular, to a component arrangement method, a device, a computer device, and a storage medium. The method comprises the following steps: acquiring user-defined content input by a user and layout attributes of a component library; obtaining the component names of all the components in the component library according to the layout attribute; and arranging the names of the components according to the custom content, and displaying the corresponding components according to the sequence of the arranged names of the components. The method can arrange the components in the component library according to the demands of users in different service scenes, and compared with the relatively fixed arrangement mode in the prior art, the compatibility and the flexibility are improved.

Description

Component arrangement method, device, computer equipment and storage medium
Technical Field
The present application relates to the field of software development technologies, and in particular, to a component arrangement method, a device, a computer device, and a storage medium.
Background
With rapid development of software development technology, more and more components are in a component library, and how to quickly and accurately find required components in the component library becomes a key problem for constructing and displaying a user interface.
Currently, component libraries such as Arco-Design are generally classified and arranged according to the types of the respective components, the initials of the component name initials, and the like. The arrangement mode is relatively fixed, a component library needs to be traversed when the required components are found, the flexibility is low, and the problem of low efficiency of finding the components exists.
Disclosure of Invention
Based on the above, a component arrangement method, device, computer equipment and storage medium are provided to improve the phenomenon that the component arrangement mode is relatively fixed in the prior art.
In a first aspect, there is provided a component arrangement method, the method comprising:
acquiring user-defined content input by a user and layout attributes of a component library;
obtaining the component names of all the components in the component library according to the layout attribute;
and arranging the names of the components according to the custom content, and displaying the corresponding components according to the sequence of the arranged names of the components.
With reference to the first aspect, in a first implementation manner of the first aspect, the step of arranging the component names according to the custom content includes:
acquiring arrangement sequence information indicated by the custom content;
traversing the names of the components, and arranging the names of the components according to the matching condition of the traversed names of the components and the arrangement sequence information.
With reference to the first implementation manner of the first aspect, in a second implementation manner of the first aspect, the step of arranging each component name according to a matching condition between the traversed component name and the arrangement order information includes:
judging whether the traversed component name is matched with the arrangement sequence information;
if yes, calculating the matching degree, and arranging the component names according to the matching degree;
if not, traversing the next component name.
With reference to the first aspect, in a third implementation manner of the first aspect, the step of arranging the component names according to the custom content includes:
acquiring arrangement sequence information indicated by the custom content;
traversing each component name according to the arrangement sequence information so as to enable each component name to be arranged according to the arrangement sequence information.
With reference to the third implementation manner of the first aspect, in a fourth implementation manner of the first aspect, the step of traversing each component name according to the arrangement order information includes:
calculating the matching degree of each component name and the arrangement sequence information;
and arranging the names of the components according to the sequence of the matching degree from high to low.
With reference to the first aspect, in a fifth implementation manner of the first aspect, before the step of obtaining the layout attribute of the component library, the method further includes:
acquiring the component names of all components in the component library, and judging whether an initial description text exists in the component names;
if yes, spacing the component name from the initial description text by a preset first symbol;
if not, judging whether an initial description text exists in the next component name;
after judging whether the initial description text exists in all the component names, generating name values according to the component names, wherein in the name array, the component names are spaced by a preset second symbol;
and taking the name array as a layout attribute of the component library.
With reference to the fifth possible implementation manner of the first aspect, in a sixth possible implementation manner of the first aspect, the method further includes:
acquiring a replacement instruction input by a user, wherein the replacement instruction comprises a target component name and a description text to be replaced;
and replacing the initial description text in the component name consistent with the target component name with the description text to be replaced.
In a second aspect, there is provided a component arranging apparatus, the apparatus comprising:
the acquisition unit is used for acquiring the user-defined content input by the user and the layout attribute of the component library;
the preprocessing unit is used for obtaining the component names of all the components in the component library according to the layout attribute;
and the arrangement unit is used for arranging the names of the components according to the custom content and displaying the corresponding components according to the sequence of the arranged names of the components.
In a third aspect, there is provided a computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, the processor implementing the steps of the component arrangement method according to the first aspect or any of the possible embodiments in combination with the first aspect when the computer program is executed.
In a fourth aspect, a computer readable storage medium is provided, on which a computer program is stored, which when being executed by a processor implements the steps of the component arranging method according to the first aspect or any of the possible embodiments in combination with the first aspect.
The component arrangement method, the device, the computer equipment and the storage medium are used for acquiring the user-defined content input by the user and the layout attribute of the component library; obtaining the component names of all the components in the component library according to the layout attribute; and arranging the names of the components according to the self-defined content, and displaying the corresponding components according to the sequence of the arranged names of the components. By the component arrangement method, components in the component library can be arranged according to the requirements of users in different service scenes, and compared with a relatively fixed arrangement mode in the prior art, the compatibility and the flexibility are improved; because the component names are smaller than the memory occupied by the components, compared with the mode of directly traversing and judging the components, the scheme of sequencing the components is realized through the steps, so that the resource consumption can be reduced, and the running speed is higher.
Drawings
FIG. 1 is a diagram of an application environment for a component placement method in one embodiment;
FIG. 2 is a flow diagram of a method of component placement in one embodiment;
FIG. 3 is a block diagram of an arrangement of components in one embodiment;
FIG. 4 is a block diagram of an arrangement of components in one embodiment;
FIG. 5 is a block diagram of an arrangement of components in one embodiment;
fig. 6 is an internal structural diagram of a computer device in one embodiment.
Detailed Description
The present application will be described in further detail with reference to the drawings and examples, in order to make the objects, technical solutions and advantages of the present application more apparent. It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the scope of the application.
It should be noted that, the illustrations provided in the present embodiment merely illustrate the basic concept of the present application by way of illustration, and only the components related to the present application are shown in the drawings and are not drawn according to the number, shape and size of the components in actual implementation, and the form, number and proportion of the components in actual implementation may be arbitrarily changed, and the layout of the components may be more complex.
The structures, proportions, sizes, etc. shown in the drawings attached hereto are for illustration purposes only and are not intended to limit the scope of the application, which is defined by the claims, but rather by the claims.
References in this specification to orientations or positional relationships as "upper", "lower", "left", "right", "intermediate", "longitudinal", "transverse", "horizontal", "inner", "outer", "radial", "circumferential", etc., are based on the orientation or positional relationships shown in the drawings, are also for convenience of description only, and do not indicate or imply that the devices or elements referred to must have a particular orientation, be constructed and operated in a particular orientation, and therefore are not to be construed as limiting the application. Furthermore, the terms "first," "second," and the like, are used for descriptive purposes only and are not to be construed as indicating or implying relative importance.
The component arrangement method provided by the application can be applied to an application environment shown in fig. 1. Wherein the terminal 102 communicates with the server 104 via a network. The user can input the custom content through the terminal 102, and the server 104 obtains the layout attribute of the component library after obtaining the custom content, and obtains the component names of all components in the component library according to the layout attribute; and then ordering the component names according to the self-defined content, and finally displaying the corresponding components according to the ordered sequence of the component names, thereby realizing the arrangement of the components in the component library according to the information indicated by the self-defined content. The terminal 102 may be, but not limited to, various personal computers, notebook computers, smartphones, tablet computers, and portable wearable devices, and the server 104 may be implemented by a stand-alone server or a server cluster composed of a plurality of servers.
In one embodiment, as shown in fig. 2, a component arrangement method is provided, and the method is applied to the server in fig. 1, where the server includes a VUE framework and an Arco-Design component library, and includes the following steps:
s1: acquiring user-defined content input by a user and layout attributes of a component library;
s2: and obtaining the component names of all the components in the component library according to the layout attribute.
Because the users may have different demands in different business scenes, and the relatively fixed arrangement mode is difficult to provide better use experience for the users, the users can input the custom content through the component arrangement method of the application, and the custom arrangement of the components can be realized based on the custom content. For example, the custom content may be "frequency of use", "component memory size", and "components used for XX days/months/years", etc., and is not illustrated here.
The layout attribute of the component library is preconfigured, and specifically includes: acquiring the component names of all components in the component library, and judging whether an initial description text exists in the component names; if yes, spacing the component name from the initial description text by a preset first symbol; if not, judging whether an initial description text exists in the next component name; after judging whether the initial description text exists in all the component names, generating name values according to the component names, wherein in the name array, the component names are spaced by a preset second symbol; and taking the name array as a layout attribute of the component library.
For example, the first symbol may be "," and for purposes of quickly obtaining valid information when traversing the component name later, the initial descriptive text may be placed after the component name, the two are separated by the first symbol ","; the second symbol may be ",". In other embodiments, the first symbol and the second symbol may also take other different forms, as long as the first symbol and the second symbol are different from each other, so that the initial description text after the first symbol is not mistaken for the component name when the first symbol is recognized in the step of obtaining the component name according to the layout attribute.
In particular implementations, the component library may name the layout attribute as a layout attribute, and the VUE framework then obtains the value of the layout attribute, i.e., the layout attribute, through a tips component, where tips is a component in the VUE that can obtain the attribute written by the external component. The tips, after acquiring the layout attribute, identifies the next or previous component name after identifying the second symbol, and then extracts the previous component name after identifying the first symbol, so as to perform subsequent component name sorting.
For the initial description text of the component, the replacement can be performed according to the instruction of the user, namely: acquiring a replacement instruction input by a user, wherein the replacement instruction comprises a target component name and a description text to be replaced; and replacing the initial description text in the component name consistent with the target component name with the description text to be replaced. The VUE framework can realize the replacement of texts through the internal v-if components, so that the phenomenon that the initial description texts cannot be replaced in the existing component library is improved, the flexibility and the compatibility are further improved, and the personalized requirements of users are met.
S3: and arranging the names of the components according to the custom content, and displaying the corresponding components according to the sequence of the arranged names of the components.
In one implementation manner, the step of arranging the component names according to the custom content includes: acquiring arrangement sequence information indicated by the custom content; traversing the names of the components, and arranging the names of the components according to the matching condition of the traversed names of the components and the arrangement sequence information.
Further, according to the matching condition of the traversed component names and the arrangement sequence information, the step of arranging the component names includes: judging whether the traversed component name is matched with the arrangement sequence information; if yes, calculating the matching degree, and arranging the component names according to the matching degree; if not, traversing the next component name.
Taking the custom content of the foregoing example as an example for illustration, if the custom content input by the user is "frequency of use", the VUE framework may traverse each component name through the v-for component therein, determine, through the v-if component, whether the component corresponding to the currently traversed component name is used, if so, calculate the frequency of use of the component in the past time period, and if not, traverse the next component name; when traversing the next component name, according to the comparison condition of the use frequency and the use frequency calculated last time, arranging the corresponding component names in the order from large to small until all the component names are traversed. Preferably, the VUE framework can be set to arrange the components in order from the big to the small frequency by default, and simultaneously can provide a one-key switching button for the user to arrange the components in order from the small to the big frequency, so that the personalized requirement of the user is further met.
Similarly, if the user-defined content input by the user is "component memory size", the VUE framework can traverse each component name through the v-for component in the VUE framework to acquire the memory of the component corresponding to the currently traversed component name; then traversing the next component name, obtaining the memory of the component corresponding to the next component name, comparing the memory with the memory size of the component obtained in the last traversing, judging the memory size conditions of the two components through the v-if component, and sequencing the corresponding component names according to the sequence from large to small of the memory until all the component names are traversed. Preferably, the VUE framework can be set to arrange the components in the order from the large memory to the small memory by default, and simultaneously, a one-key switching button for arranging the components in the order from the small memory to the large memory can be provided for a user, so that different requirements of the user are further met.
In another embodiment, the step of arranging the component names according to the custom content includes: acquiring arrangement sequence information indicated by the custom content; traversing each component name according to the arrangement sequence information so as to enable each component name to be arranged according to the arrangement sequence information.
Further, the step of traversing the component names according to the arrangement sequence information includes: calculating the matching degree of each component name and the arrangement sequence information; and arranging the names of the components according to the sequence of the matching degree from high to low.
Taking the custom content of the foregoing example as an example for illustration, if the custom content input by the user is "frequency of use", the VUE framework may traverse each component name through the v-for component therein, determine, through the v-if component, whether the component corresponding to the currently traversed component name is used, if so, calculate the frequency of use of the component in the past time period, and if not, traverse the next component name; when all the component names are traversed, corresponding use frequencies are obtained, and then the size of each use frequency is judged through the v-if component, so that the component names are arranged according to the order of the use frequencies from large to small. Preferably, the VUE frame can be set to arrange the components in order from the big to the small frequency by default, and simultaneously, a one-key switching button for arranging the components in order from the small to the big frequency can be provided for the user, so that different requirements of the user are further met.
Similarly, if the user-defined content input by the user is "component memory size", the VUE framework can traverse each component name through the v-for component in the VUE framework to acquire the memory of the component corresponding to the currently traversed component name; then traversing the next component name to obtain the memory of the component corresponding to the next component name; and judging the sizes of all the memories through the v-if components until all the component names are traversed to obtain corresponding memories, and arranging the component names according to the sequence from the large memory to the small memory. Preferably, the VUE framework can be set to arrange the components in the order from the large memory to the small memory by default, and simultaneously, a one-key switching button for arranging the components in the order from the small memory to the large memory can be provided for a user, so that different requirements of the user are further met.
In both embodiments, the component names may be arranged, and the components corresponding to the component names may be arranged, and any one may be adopted in the specific implementation, which is not limited to this aspect of the present application. The former embodiment is different from the latter embodiment in that the former embodiment is to arrange component names while traversing the component names, and arrange all component names after traversing all component names; the latter embodiment traverses all component names before ranking the component names.
Similarly, if the user-defined content input by the user is "the used component of XX day/month/year", the steps are similar to those described above, and will not be described here again. The application aims to provide a component ordering method capable of supporting custom ordering, and a mode of displaying corresponding components according to ordered component names by ordering the component names. Therefore, the above-described exemplary contents are only for explanation, and are not intended to limit the application scenario of the component arrangement method of the present application, and the arrangement of components themselves should be considered to be within the scope described in the present specification as long as the arrangement of components is implemented using the component names.
For example, the component library with the pre-configured layout attribute is packaged and named as BasePagination or other names, a user inputs "< base-page: layout = 'value' > { { user-defined content } } -/base-page >" ona page, and besides the original attribute of Arco-Design can be written on the tag, the use of layout attribute is increased, for example: skip to { jump } page, page-size, total { total } piece of data, slot', wherein page is the name of the component used for defining the page number, jump is the name of the component used for skipping, the component uses text and input box of the Arco-Design component library to be combined, the text can be replaced by v-if component to be customized text, total is the name of the component used for displaying the total piece number of data, can be replaced by v-if to be customized text, page-size is the name of the component used for displaying the piece number of data per page, the component uses text and select drop-down selection box of Arco-Design component library to be combined, the text can be replaced by v-if component to be customized text, slot can be communicated with slot provided by VUE, and accordingly the component rendered according to user-defined code is obtained; after the step of the component arrangement method is executed on the command, the components in the component library are arranged according to the component names in the layout; in addition, if a user-defined component is expected to be rendered in the component library, the position named slot can be judged through the v-if component, a slot of a VUE is added, and then the user-defined component is rendered to the position of the slot through the slot.
In summary, through the component arrangement method of the application, the component arrangement method of the user-defined arrangement can be supported according to the demands of users in different service scenes, and compared with the relatively fixed arrangement mode in the prior art, the compatibility and flexibility are improved, and the personalized demands of the users are met as far as possible; and the component names are arranged, the corresponding components are displayed according to the arranged component names, and the arrangement scheme of the components in the component library is realized, so that the resource consumption can be reduced and the running speed is higher compared with the mode of directly traversing and judging the components due to the fact that the component names are smaller than the memory occupied by the components.
It should be understood that, although the steps in the flowchart of fig. 2 are shown in sequence as indicated by the arrows, the steps are not necessarily performed in sequence as indicated by the arrows. The steps are not strictly limited to the order of execution unless explicitly recited herein, and the steps may be executed in other orders. Moreover, at least some of the steps in fig. 2 may include multiple sub-steps or stages that are not necessarily performed at the same time, but may be performed at different times, nor do the order in which the sub-steps or stages are performed necessarily performed in sequence, but may be performed alternately or alternately with at least a portion of the sub-steps or stages of other steps or other steps.
In one embodiment, as shown in fig. 3, there is provided a component arrangement apparatus including:
the acquisition unit is used for acquiring the user-defined content input by the user and the layout attribute of the component library;
the preprocessing unit is used for obtaining the component names of all the components in the component library according to the layout attribute;
and the arrangement unit is used for arranging the names of the components according to the custom content and displaying the corresponding components according to the sequence of the arranged names of the components.
Specifically, the step of arranging the component names by the arranging unit according to the custom content includes: acquiring arrangement sequence information indicated by the custom content; traversing the names of the components, and arranging the names of the components according to the matching condition of the traversed names of the components and the arrangement sequence information.
Specifically, the step of arranging the component names by the arranging unit according to the matching condition of the traversed component names and the arranging sequence information includes: judging whether the traversed component name is matched with the arrangement sequence information; if yes, calculating the matching degree, and arranging the component names according to the matching degree; if not, traversing the next component name.
Specifically, the step of arranging the component names by the arranging unit according to the custom content includes: acquiring arrangement sequence information indicated by the custom content; traversing each component name according to the arrangement sequence information so as to enable each component name to be arranged according to the arrangement sequence information.
Specifically, the step of traversing each component name by the arrangement unit according to the arrangement sequence information includes: calculating the matching degree of each component name and the arrangement sequence information; and arranging the names of the components according to the sequence of the matching degree from high to low.
Preferably, as shown in fig. 4, the apparatus further includes a configuration unit, configured to obtain component names of components in the component library before the step of obtaining layout attributes of the component library, and determine whether there is an initial description text in the component names; if yes, spacing the component name from the initial description text by a preset first symbol; if not, judging whether an initial description text exists in the next component name; after judging whether the initial description text exists in all the component names, generating name values according to the component names, wherein in the name array, the component names are spaced by a preset second symbol; and taking the name array as a layout attribute of the component library.
Still further, as shown in fig. 5, the apparatus further includes a replacing unit, configured to obtain a replacement instruction input by a user, where the replacement instruction includes a target component name and a description text to be replaced; and replacing the initial description text in the component name consistent with the target component name with the description text to be replaced.
For specific limitations of the component arranging apparatus, reference may be made to the above limitations of the component arranging method, and the description thereof will not be repeated here. Each of the modules in the above-described component arrangement apparatus may be implemented in whole or in part by software, hardware, and a combination thereof. The above modules may be embedded in hardware or may be independent of a processor in the computer device, or may be stored in software in a memory in the computer device, so that the processor may call and execute operations corresponding to the above modules.
In one embodiment, a computer device is provided, which may be a server, the internal structure of which may be as shown in fig. 6. The computer device includes a processor, a memory, a network interface, and a database connected by a system bus. Wherein the processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, computer programs, and a database. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage media. The database of the computer device is used to store a component library carrying a wide variety of components. The network interface of the computer device is used for communicating with an external terminal through a network connection. The computer program is executed by a processor to implement a component arrangement method.
It will be appreciated by those skilled in the art that the structure shown in FIG. 6 is merely a block diagram of some of the structures associated with the present inventive arrangements and is not limiting of the computer device to which the present inventive arrangements may be applied, and that a particular computer device may include more or fewer components than shown, or may combine some of the components, or have a different arrangement of components.
In one embodiment, a computer device is provided comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, the processor implementing the steps of when executing the computer program:
acquiring user-defined content input by a user and layout attributes of a component library;
obtaining the component names of all the components in the component library according to the layout attribute;
and arranging the names of the components according to the custom content, and displaying the corresponding components according to the sequence of the arranged names of the components.
In one embodiment, the processor when executing the computer program further performs the steps of:
acquiring arrangement sequence information indicated by the custom content;
traversing the names of the components, and arranging the names of the components according to the matching condition of the traversed names of the components and the arrangement sequence information.
In one embodiment, the processor when executing the computer program further performs the steps of:
judging whether the traversed component name is matched with the arrangement sequence information;
if yes, calculating the matching degree, and arranging the component names according to the matching degree;
if not, traversing the next component name.
In one embodiment, the processor when executing the computer program further performs the steps of:
acquiring arrangement sequence information indicated by the custom content;
traversing each component name according to the arrangement sequence information so as to enable each component name to be arranged according to the arrangement sequence information.
In one embodiment, the processor when executing the computer program further performs the steps of:
calculating the matching degree of each component name and the arrangement sequence information;
and arranging the names of the components according to the sequence of the matching degree from high to low.
In one embodiment, the processor when executing the computer program further performs the steps of:
acquiring the component names of all components in the component library, and judging whether an initial description text exists in the component names;
if yes, spacing the component name from the initial description text by a preset first symbol;
if not, judging whether an initial description text exists in the next component name;
after judging whether the initial description text exists in all the component names, generating name values according to the component names, wherein in the name array, the component names are spaced by a preset second symbol;
and taking the name array as a layout attribute of the component library.
In one embodiment, the processor when executing the computer program further performs the steps of:
acquiring a replacement instruction input by a user, wherein the replacement instruction comprises a target component name and a description text to be replaced;
and replacing the initial description text in the component name consistent with the target component name with the description text to be replaced.
In one embodiment, a computer readable storage medium is provided having a computer program stored thereon, which when executed by a processor, performs the steps of:
acquiring user-defined content input by a user and layout attributes of a component library;
obtaining the component names of all the components in the component library according to the layout attribute;
and arranging the names of the components according to the custom content, and displaying the corresponding components according to the sequence of the arranged names of the components.
In one embodiment, the computer program when executed by the processor further performs the steps of:
acquiring arrangement sequence information indicated by the custom content;
traversing the names of the components, and arranging the names of the components according to the matching condition of the traversed names of the components and the arrangement sequence information.
In one embodiment, the computer program when executed by the processor further performs the steps of:
judging whether the traversed component name is matched with the arrangement sequence information;
if yes, calculating the matching degree, and arranging the component names according to the matching degree;
if not, traversing the next component name.
In one embodiment, the computer program when executed by the processor further performs the steps of:
acquiring arrangement sequence information indicated by the custom content;
traversing each component name according to the arrangement sequence information so as to enable each component name to be arranged according to the arrangement sequence information.
In one embodiment, the computer program when executed by the processor further performs the steps of:
calculating the matching degree of each component name and the arrangement sequence information;
and arranging the names of the components according to the sequence of the matching degree from high to low.
In one embodiment, the computer program when executed by the processor further performs the steps of:
acquiring the component names of all components in the component library, and judging whether an initial description text exists in the component names;
if yes, spacing the component name from the initial description text by a preset first symbol;
if not, judging whether an initial description text exists in the next component name;
after judging whether the initial description text exists in all the component names, generating name values according to the component names, wherein in the name array, the component names are spaced by a preset second symbol;
and taking the name array as a layout attribute of the component library.
In one embodiment, the computer program when executed by the processor further performs the steps of:
acquiring a replacement instruction input by a user, wherein the replacement instruction comprises a target component name and a description text to be replaced;
and replacing the initial description text in the component name consistent with the target component name with the description text to be replaced.
Those skilled in the art will appreciate that implementing all or part of the above described methods may be accomplished by way of a computer program stored on a non-transitory computer readable storage medium, which when executed, may comprise the steps of the embodiments of the methods described above. Any reference to memory, storage, database, or other medium used in embodiments provided herein may include non-volatile and/or volatile memory. The nonvolatile memory can include Read Only Memory (ROM), programmable ROM (PROM), electrically Programmable ROM (EPROM), electrically Erasable Programmable ROM (EEPROM), or flash memory. Volatile memory can include Random Access Memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms such as Static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double Data Rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous Link DRAM (SLDRAM), memory bus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), among others.
The technical features of the above embodiments may be arbitrarily combined, and all possible combinations of the technical features in the above embodiments are not described for brevity of description, however, as long as there is no contradiction between the combinations of the technical features, they should be considered as the scope of the description.
The above examples illustrate only a few embodiments of the application, which are described in detail and are not to be construed as limiting the scope of the application. It should be noted that it will be apparent to those skilled in the art that several variations and modifications can be made without departing from the spirit of the application, which are all within the scope of the application. Accordingly, the scope of protection of the present application is to be determined by the appended claims.

Claims (10)

1. A method of arranging components, comprising:
acquiring user-defined content input by a user and layout attributes of a component library;
obtaining the component names of all the components in the component library according to the layout attribute;
and arranging the names of the components according to the custom content, and displaying the corresponding components according to the sequence of the arranged names of the components.
2. The component arranging method according to claim 1, wherein the step of arranging the names of the respective components according to the custom content comprises:
acquiring arrangement sequence information indicated by the custom content;
traversing the names of the components, and arranging the names of the components according to the matching condition of the traversed names of the components and the arrangement sequence information.
3. The component arranging method according to claim 2, wherein the step of arranging the respective component names according to the matching condition of the traversed component names and the arrangement order information comprises:
judging whether the traversed component name is matched with the arrangement sequence information;
if yes, calculating the matching degree, and arranging the component names according to the matching degree;
if not, traversing the next component name.
4. The component arranging method according to claim 1, wherein the step of arranging the names of the respective components according to the custom content comprises:
acquiring arrangement sequence information indicated by the custom content;
traversing each component name according to the arrangement sequence information so as to enable each component name to be arranged according to the arrangement sequence information.
5. The component arranging method according to claim 4, wherein the step of traversing the respective component names according to the arrangement order information comprises:
calculating the matching degree of each component name and the arrangement sequence information;
and arranging the names of the components according to the sequence of the matching degree from high to low.
6. The component arrangement method according to claim 1, wherein before the step of acquiring the layout attribute of the component library, the method further comprises:
acquiring the component names of all components in the component library, and judging whether an initial description text exists in the component names;
if yes, spacing the component name from the initial description text by a preset first symbol;
if not, judging whether an initial description text exists in the next component name;
after judging whether the initial description text exists in all the component names, generating name values according to the component names, wherein in the name array, the component names are spaced by a preset second symbol;
and taking the name array as a layout attribute of the component library.
7. The component arrangement method according to claim 6, characterized in that the method further comprises:
acquiring a replacement instruction input by a user, wherein the replacement instruction comprises a target component name and a description text to be replaced;
and replacing the initial description text in the component name consistent with the target component name with the description text to be replaced.
8. A component arranging apparatus, characterized in that the apparatus comprises:
the acquisition unit is used for acquiring the user-defined content input by the user and the layout attribute of the component library;
the preprocessing unit is used for obtaining the component names of all the components in the component library according to the layout attribute;
and the arrangement unit is used for arranging the names of the components according to the custom content and displaying the corresponding components according to the sequence of the arranged names of the components.
9. A computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, characterized in that the processor implements the steps of the component arrangement method of any one of claims 1 to 7 when the computer program is executed.
10. A computer-readable storage medium, on which a computer program is stored, characterized in that the computer program, when being executed by a processor, implements the steps of the component arrangement method of any one of claims 1 to 7.
CN202310785061.2A 2023-06-29 2023-06-29 Component arrangement method, device, computer equipment and storage medium Pending CN116860244A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310785061.2A CN116860244A (en) 2023-06-29 2023-06-29 Component arrangement method, device, computer equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310785061.2A CN116860244A (en) 2023-06-29 2023-06-29 Component arrangement method, device, computer equipment and storage medium

Publications (1)

Publication Number Publication Date
CN116860244A true CN116860244A (en) 2023-10-10

Family

ID=88220909

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310785061.2A Pending CN116860244A (en) 2023-06-29 2023-06-29 Component arrangement method, device, computer equipment and storage medium

Country Status (1)

Country Link
CN (1) CN116860244A (en)

Similar Documents

Publication Publication Date Title
CN109901834B (en) Document page generation method, device, computer equipment and storage medium
CN108874926A (en) Mass data inquiry method, device, computer equipment and storage medium
US10152539B2 (en) Webpage searching method and browser
CN111596911B (en) Method, device, computer equipment and storage medium for generating control
CN111191079B (en) Document content acquisition method, device, equipment and storage medium
CN112486828A (en) Test case generation method and device, computer equipment and storage medium
CN105740219A (en) Report self-defining method and device
CN109542962B (en) Data processing method, data processing device, computer equipment and storage medium
CN116860244A (en) Component arrangement method, device, computer equipment and storage medium
CN110647350A (en) Interface document generation method and device, computer equipment and storage medium
CN109857759B (en) Concurrent data processing method and device, computer equipment and storage medium
CN110321405B (en) Model matching method, model matching device, computer-readable storage medium and computer equipment
CN112417020A (en) Method and device for realizing service expansion, computer equipment and storage medium
CN112835886A (en) Data table field adding method and device
CN113934384B (en) Data rendering method, device, computer equipment and storage medium
CN115878929A (en) Webpage rendering method and device
CN114327435A (en) Technical document generation method and device and computer readable storage medium
CN116700777A (en) Service data acquisition method and device, storage medium and electronic equipment
CN117193924A (en) Page display method and device and computer equipment
CN117612192A (en) Electronic drawing information identification method, system, electronic equipment and storage medium
CN117369895A (en) Shortcut generation method, shortcut generation device, computer equipment and storage medium
CN112612563A (en) Page test data generation method and device and computer equipment
CN118245160A (en) Tab label updating method, device, computer equipment and storage medium
CN117056228A (en) Page loading test method and device, computer equipment and storage medium
CN115221222A (en) Receipt processing method and device, computer equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination