Disclosure of Invention
The method aims at the problems that the existing large-screen system is complex in installation and deployment, long in research and development period, incapable of being configured or difficult to configure, difficult to upgrade and transform and the like. An object of the embodiments of the present application is to provide a method and an apparatus for configuring and displaying a screen page to solve the technical problems mentioned in the above background.
In a first aspect, an embodiment of the present application provides a method for configuring and displaying a screen page, including the following steps:
s1: dividing a screen page into m x n sub-regions, wherein the width of each sub-region is 1/m, and the height of each sub-region is 1/n;
s2: establishing a plurality of independent page components, and acquiring the display form information and the data source information of each page component;
s3: dragging the page components into each sub-area through an html drag and drop API (application program interface) technology, acquiring positioning information of each page component, dragging the width and the height of each page component, acquiring the width and the height information of each page component, and storing the positioning information, the width and the height information, the display form information and the data source information as configuration information of a screen page; and
s4: and configuring and displaying a plurality of page components on the screen page according to the configuration information.
In some embodiments, the page components are developed by vue. js, and the content exposed by the page components is determined by different data sources. Each page component is configured with a respective data source, and each page component is set by adopting the width and the height of each page component to be 100%, so that the specific size of the page component is determined by the layout of the outer layer.
In some embodiments, the presentation form information includes echarts, openlayers maps, plain text, video, and three-dimensional data presentation forms of three. Each page component can independently present various different forms of information on the same screen.
In some embodiments, the positioning information is calculated by the following formula: the top is 1/n x y, the left is 1/m x, wherein the positioning information comprises top and left, y is the number of the sub-regions occupied by the page assembly in the longitudinal direction at the position of the upper left corner of the sub-region and the position of the upper left corner of the screen page, and x is the number of the sub-regions occupied by the page assembly in the transverse direction at the position of the upper left corner of the sub-region and the position of the upper left corner of the screen page. Each page component is in a sub-area at a different position on the screen, and therefore specific positioning information for each component needs to be calculated in order to control the page component more accurately.
In some embodiments, the width and height information is calculated by the following formula: width 1/m s1, height 1/n s2, where width is the width of the page element, height is the height of the page element, s1 is the number of sub-regions occupied by the page element in the lateral direction, and s2 is the number of sub-regions occupied by the page element in the longitudinal direction. The size of each page component after the width and height dragging can be determined according to the width and height information.
In some embodiments, step S4 specifically includes:
s41: implementing the page component through the dynamic component function of Vue.js according to the display form information and the data source information in the configuration information, so that the page component has specific functions; and
s42: and according to the positioning information and the width and height information in the configuration information, the page components are arranged through Css absolute positioning.
And displaying in different forms according to different page components and data sources, so as to restore the page into a complete screen page.
In some embodiments, a File corresponding to a new page component is transmitted through an http module of node. Therefore, the firmware of the page assembly is upgraded in a non-shutdown state, and the problem of difficulty in upgrading and transforming is solved.
In some embodiments, when the data source is a remote data source, step S2 further includes: the data of the remote platform is docked and converted into a uniform format, and an interface is provided for the page assembly; when the data source is a local data source, step S2 further includes: and editing the local data source by adopting html textarea online editing and file input uploading of the json file, and reading the json file by using axios technology to realize the butt joint of the page component and the local data source. Therefore, the configuration of the page component can configure a remote data source and also configure a local data source, and the problem of non-configurability or difficult configuration is solved.
In a second aspect, an embodiment of the present application provides a screen page configuring and displaying apparatus, including:
a dividing module configured to divide the screen page into m × n sub-regions, wherein each sub-region has a width of 1/m and a height of 1/n;
the page component establishing module is configured to establish a plurality of independent page components and acquire the display form information and the data source information of each page component;
the configuration module is configured to drag the page components into the sub-regions through an html drag and drop API technology, acquire positioning information of each page component, perform width and height dragging to acquire width and height information of each page component, and store the positioning information, the width and height information, the display form information and the data source information as configuration information of the screen page; and
a presentation module configured to present the plurality of page components on the screen page according to the configuration information.
In a third aspect, an embodiment of the present application provides an electronic device, including: one or more processors; storage means for storing one or more programs which, when executed by one or more processors, cause the one or more processors to carry out a method as described in any one of the implementations of the first aspect.
In a fourth aspect, the present application provides a computer-readable storage medium, on which a computer program is stored, which, when executed by a processor, implements the method as described in any implementation manner of the first aspect.
The embodiment of the application discloses a method and a device for configuring and displaying a screen page, wherein the screen page is divided into m × n sub-regions, the width of each sub-region is 1/m, and the height of each sub-region is 1/n; establishing a plurality of independent page components, and acquiring the display form information and the data source information of each page component; dragging the page components into each sub-area through an html drag and drop API (application program interface) technology, acquiring positioning information of each page component, dragging the width and the height of each page component, acquiring the width and the height information of each page component, and storing the positioning information, the width and the height information, the display form information and the data source information as configuration information of a screen page; and configuring and displaying the plurality of page components on the screen page according to the configuration information. Finally, integration of software and hardware of the large-screen system is achieved, upgrading of the firmware in a remote non-stop state is achieved, the page assembly can be configured, and the problems that installation and deployment are complex, the research and development period is long and the like are solved.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention clearer, the present invention will be described in further detail with reference to the accompanying drawings, and it is apparent that the described embodiments are only a part of the embodiments of the present invention, not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Fig. 1 illustrates an exemplary device architecture 100 to which the screen page configuring and presenting method or the screen page configuring and presenting device of the embodiments of the present application may be applied.
As shown in fig. 1, the apparatus architecture 100 may include terminal devices 101, 102, 103, a network 104, and a server 105. The network 104 serves as a medium for providing communication links between the terminal devices 101, 102, 103 and the server 105. Network 104 may include various connection types, such as wired, wireless communication links, or fiber optic cables, to name a few.
The user may use the terminal devices 101, 102, 103 to interact with the server 105 via the network 104 to receive or send messages or the like. Various applications, such as data processing type applications, file processing type applications, etc., may be installed on the terminal apparatuses 101, 102, 103.
The terminal apparatuses 101, 102, and 103 may be hardware or software. When the terminal devices 101, 102, 103 are hardware, they may be various electronic devices including, but not limited to, smart phones, tablet computers, laptop portable computers, desktop computers, and the like. When the terminal apparatuses 101, 102, 103 are software, they can be installed in the electronic apparatuses listed above. It may be implemented as multiple pieces of software or software modules (e.g., software or software modules used to provide distributed services) or as a single piece of software or software module. And is not particularly limited herein.
The server 105 may be a server that provides various services, such as a background data processing server that processes files or data uploaded by the terminal devices 101, 102, 103. The background data processing server can process the acquired file or data to generate a processing result.
It should be noted that the screen page configuring and displaying method provided in the embodiment of the present application may be executed by the server 105, or may be executed by the terminal devices 101, 102, and 103, and accordingly, the screen page configuring and displaying apparatus may be disposed in the server 105, or may be disposed in the terminal devices 101, 102, and 103.
It should be understood that the number of terminal devices, networks, and servers in fig. 1 is merely illustrative. There may be any number of terminal devices, networks, and servers, as desired for implementation. In the case where the processed data does not need to be acquired from a remote location, the above device architecture may not include a network, but only a server or a terminal device.
FIG. 2 shows that an embodiment of the present application discloses a screen page configuration and presentation method, which comprises the following steps:
s1: dividing a screen page into m x n sub-regions, wherein the width of each sub-region is 1/m, and the height of each sub-region is 1/n;
s2: establishing a plurality of independent page components, and acquiring the display form information and the data source information of each page component;
s3: dragging the page components into each sub-area through an html drag and drop API (application program interface) technology, acquiring positioning information of each page component, dragging the width and the height of each page component, acquiring the width and the height information of each page component, and storing the positioning information, the width and the height information, the display form information and the data source information as configuration information of a screen page; and
s4: and configuring and displaying a plurality of page components on the screen page according to the configuration information.
In one embodiment, the screen page is divided into 24 × 13 sub-regions in step S1, and each sub-region has a width 1/24 × 100% and a height 1/13 × 100%. In a specific embodiment, an API is dragged to drag a page component into each sub-region through html5, and the page component is dragged in width and height.
In a specific embodiment, the page component is developed by vue. js in step S2, and the content presented by the page component is determined by different data sources. Each page component in the screen page is composed of independent components developed by Vue. The display form information comprises echarts, openlayers maps, plain text, video and three-dimensional data display forms of three. Each page component can independently present various different forms of information on the same screen. In other embodiments, other different types of presentation forms may be included to meet different needs.
In a specific embodiment, the positioning information is calculated in step S3 by the following formula: the top is 1/n x y, the left is 1/m x, wherein the positioning information comprises top and left, y is the number of the sub-regions occupied by the page assembly in the longitudinal direction at the position of the upper left corner of the sub-region and the position of the upper left corner of the screen page, and x is the number of the sub-regions occupied by the page assembly in the transverse direction at the position of the upper left corner of the sub-region and the position of the upper left corner of the screen page. Here, with the upper left corner position of the screen page as a reference point and a coordinate system established, the reference point is set to the X axis in the lateral direction and the reference point is set to the Y axis in the longitudinal direction, while with the upper left corner position of the sub-region of each page component as a calculation point, the number of occupied sub-regions in the X axis direction between the calculation point and the reference point is set to X and the number of occupied sub-regions in the X axis direction between the calculation point and the reference point is set to Y. Each page component is in a sub-area at a different position on the screen, and therefore specific positioning information for each component needs to be calculated in order to control the page component more accurately. In this way, the position of each page component on the screen page can be accurately positioned, and therefore the positioning information can be obtained.
In a specific embodiment, the width and height information is calculated by the following formula: width 1/m s1, height 1/n s2, where width is the width of the page element, height is the height of the page element, s1 is the number of sub-regions occupied by the page element in the lateral direction, and s2 is the number of sub-regions occupied by the page element in the longitudinal direction. The size of each page component after the width and height dragging can be determined according to the width and height information. After a plurality of such configurations, a complete screen page is constructed. Therefore, the overall layout information of the screen page is acquired and stored in a database system or locally. The system stores a plurality of such sets of configurations, each of which may exhibit a set of screen layouts.
In a specific embodiment, as shown in fig. 3, step S4 specifically includes:
s41: implementing the page component through the dynamic component function of Vue.js according to the display form information and the data source information in the configuration information, so that the page component has specific functions; and
s42: and according to the positioning information and the width and height information in the configuration information, the page components are arranged through Css absolute positioning.
In this process, the components are declared by the dynamic component function of vue.js, and layout is performed using Css absolute positioning. Js can define components by using general types, and the component types are dynamically defined at a later stage and are not fixed at an earlier stage. The Css absolute position can generate an element of absolute position, positioned relative to the first parent element outside of the static position. The location of the element is specified by the "left", "top", "right" and "bottom" attributes. Therefore, different forms of display can be carried out according to different page components and data sources, and a complete screen page can be restored.
In a specific embodiment, when a requirement for firmware upgrade exists, under a networking condition, a File corresponding to a new page component can be transmitted through an http module of node. Therefore, the firmware of the page assembly is upgraded in a non-shutdown state, and the problem of difficulty in upgrading and transforming is solved.
In a specific embodiment, a remote data source may be configured or a local data source may be configured in the configuration interface of the component. When the data source is a remote data source, step S2 further includes: data interfacing to the remote platform converts it to a uniform format and provides an interface for the page components. The remote data platform system is a back-end service matched with the large-screen system, has the functions of butting the data of each original platform and providing the data with a uniform format for the large-screen system. When the data source is a local data source, step S2 further includes: and editing the local data source by adopting html textarea online editing and file input uploading of the json file, and reading the json file by using axios technology to realize the butt joint of the page component and the local data source. Therefore, the configuration of the page component can configure a remote data source and also configure a local data source, and the problem of non-configurability or difficult configuration is solved.
With further reference to fig. 4, as an implementation of the method shown in the above-mentioned figures, the present application provides an embodiment of a screen page configuring and presenting apparatus, which corresponds to the embodiment of the method shown in fig. 2, and which is specifically applicable to various electronic devices.
As shown in fig. 4, an embodiment of the present application provides a screen page configuring and presenting apparatus, including:
a dividing module 1 configured to divide the screen page into m × n sub-regions, wherein each sub-region has a width of 1/m and a height of 1/n;
the page component establishing module 2 is configured to establish a plurality of independent page components and acquire the presentation form information and the data source information of each page component;
the configuration module 3 is configured to drag the page components into the sub-regions through an html drag and drop API technology, acquire positioning information of each page component, perform width and height dragging to acquire width and height information of each page component, and store the positioning information, the width and height information, the presentation form information and the data source information as configuration information of the screen page; and
and the presentation module 4 is configured to present the plurality of page components on the screen page according to the configuration information.
The screen page configuring and displaying device provided in the embodiment of the application can be a customized micro-host, and integrates configurable large-screen system software. When the micro-mainframe is deployed, the micro-mainframe is connected with a display screen, so that a screen interface is displayed. By user-defined configuration, the page components of the screen can be randomly combined and the layout can be defined.
In one embodiment, the screen page is divided into 24 × 13 sub-regions in the segmentation module 1, each sub-region having a size of 1/24 × 100% width and 1/13 × 100% height. In a specific embodiment, an API is dragged to drag a page component into each sub-region through html5, and the page component is dragged in width and height.
In a specific embodiment, the page components are developed by vue.js in the page component building module 2, and the contents displayed by the page components are determined by different data sources. Each page component in the screen page is composed of independent components developed by Vue. The display form information comprises echarts, openlayers maps, plain text, video and three-dimensional data display forms of three. Each page component can independently present various different forms of information on the same screen. In other embodiments, other different types of presentation forms may be included to meet different needs.
In a specific embodiment, the positioning information in the configuration module 3 is calculated by the following formula: the top is 1/n x y, the left is 1/m x, wherein the positioning information comprises top and left, y is the number of the sub-regions occupied by the page assembly in the longitudinal direction at the position of the upper left corner of the sub-region and the position of the upper left corner of the screen page, and x is the number of the sub-regions occupied by the page assembly in the transverse direction at the position of the upper left corner of the sub-region and the position of the upper left corner of the screen page. Here, with the upper left corner position of the screen page as a reference point and a coordinate system established, the reference point is set to the X axis in the lateral direction and the reference point is set to the Y axis in the longitudinal direction, while with the upper left corner position of the sub-region of each page component as a calculation point, the number of occupied sub-regions in the X axis direction between the calculation point and the reference point is set to X and the number of occupied sub-regions in the X axis direction between the calculation point and the reference point is set to Y. Each page component is in a sub-area at a different position on the screen, and therefore specific positioning information for each component needs to be calculated in order to control the page component more accurately. In this way, the position of each page component on the screen page can be accurately positioned, and therefore the positioning information can be obtained.
In a specific embodiment, the width and height information is calculated by the following formula: width 1/m s1, height 1/n s2, where width is the width of the page element, height is the height of the page element, s1 is the number of sub-regions occupied by the page element in the lateral direction, and s2 is the number of sub-regions occupied by the page element in the longitudinal direction. The size of each page component after the width and height dragging can be determined according to the width and height information. After a plurality of such configurations, a complete screen page is constructed. Therefore, the overall layout information of the screen page is acquired and stored in a database system or locally. The system stores a plurality of such sets of configurations, each of which may exhibit a set of screen layouts.
In a specific embodiment, as shown in fig. 5, the display module 4 specifically includes:
the functional module 41 is configured to implement the page component through the dynamic component function of vue.js according to the presentation form information and the data source information in the configuration information, so that the page component has a specific function; and
and the layout module 42 is configured to layout the page components through Css absolute positioning according to the positioning information and the width and height information in the configuration information.
In this process, the components are declared by the dynamic component function of vue.js, and layout is performed using Css absolute positioning. Js can define components by using general types, and the component types are dynamically defined at a later stage and are not fixed at an earlier stage. The Css absolute position can generate an element of absolute position, positioned relative to the first parent element outside of the static position. The location of the element is specified by the "left", "top", "right" and "bottom" attributes. Therefore, different forms of display can be carried out according to different page components and data sources, and a complete screen page can be restored.
In a specific embodiment, when a requirement for firmware upgrade exists, under a networking condition, a File corresponding to a new page component can be transmitted through an http module of node. Therefore, the firmware of the page assembly is upgraded in a non-shutdown state, and the problem of difficulty in upgrading and transforming is solved.
In a specific embodiment, a remote data source may be configured or a local data source may be configured in the configuration interface of the component. When the data source is a remote data source, the page component establishing module 2 further includes: data interfacing to the remote platform converts it to a uniform format and provides an interface for the page components. The remote data platform system is a back-end service matched with the large-screen system, has the functions of butting the data of each original platform and providing the data with a uniform format for the large-screen system. When the data source is a local data source, the page component establishing module 2 further includes: and editing the local data source by adopting html textarea online editing and file input uploading of the json file, and reading the json file by using axios technology to realize the butt joint of the page component and the local data source. Therefore, the configuration of the page component can configure a remote data source and also configure a local data source, and the problem of non-configurability or difficult configuration is solved.
In a specific embodiment, a customer service staff can remotely design a screen configuration scheme for a user according to the requirements of the user. And under the networking condition, transmitting the latest configuration information to the micro host in a JSON form through the http module of the node. And after selection, displaying the screen interface, thereby realizing the function of remote assistance.
The embodiment of the application discloses a method and a device for configuring and displaying a screen page, wherein the screen page is divided into m × n sub-regions, the width of each sub-region is 1/m, and the height of each sub-region is 1/n; establishing a plurality of independent page components, and acquiring the display form information and the data source information of each page component; dragging the page components into each sub-area through an html drag and drop API (application program interface) technology, acquiring positioning information of each page component, dragging the width and the height of each page component, acquiring the width and the height information of each page component, and storing the positioning information, the width and the height information, the display form information and the data source information as configuration information of a screen page; and configuring and displaying the plurality of page components on the screen page according to the configuration information. Finally, integration of software and hardware of the large-screen system is achieved, upgrading of the firmware in a remote non-stop state is achieved, the page assembly can be configured, and the problems that installation and deployment are complex, the research and development period is long and the like are solved.
Referring now to fig. 6, a schematic diagram of a computer device 600 suitable for use in implementing an electronic device (e.g., the server or terminal device shown in fig. 1) according to an embodiment of the present application is shown. The electronic device shown in fig. 6 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present application.
As shown in fig. 6, the computer apparatus 600 includes a Central Processing Unit (CPU)601 and a Graphics Processing Unit (GPU)602, which can perform various appropriate actions and processes according to a program stored in a Read Only Memory (ROM)603 or a program loaded from a storage section 609 into a Random Access Memory (RAM) 604. In the RAM 604, various programs and data necessary for the operation of the apparatus 600 are also stored. The CPU 601, GPU602, ROM 603, and RAM 604 are connected to each other via a bus 605. An input/output (I/O) interface 606 is also connected to bus 605.
The following components are connected to the I/O interface 606: an input portion 607 including a keyboard, a mouse, and the like; an output section 608 including a display such as a Liquid Crystal Display (LCD) and a speaker; a storage section 609 including a hard disk and the like; and a communication section 610 including a network interface card such as a LAN card, a modem, or the like. The communication section 610 performs communication processing via a network such as the internet. The driver 611 may also be connected to the I/O interface 606 as needed. A removable medium 612 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is mounted on the drive 611 as necessary, so that a computer program read out therefrom is mounted into the storage section 609 as necessary.
In particular, according to an embodiment of the present disclosure, the processes described above with reference to the flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method illustrated in the flow chart. In such embodiments, the computer program may be downloaded and installed from a network via the communication section 610, and/or installed from the removable media 612. The computer programs, when executed by a Central Processing Unit (CPU)601 and a Graphics Processor (GPU)602, perform the above-described functions defined in the methods of the present application.
It should be noted that the computer readable medium described herein can be a computer readable signal medium or a computer readable medium or any combination of the two. The computer readable medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor device, apparatus, or any combination of the foregoing. More specific examples of the computer readable medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the present application, a computer readable medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution apparatus, device, or apparatus. In this application, however, a computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution apparatus, device, or apparatus. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, fiber optic cable, RF, etc., or any suitable combination of the foregoing.
Computer program code for carrying out operations for aspects of the present application may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, Smalltalk, C + + or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider).
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of apparatus, methods and computer program products according to various embodiments of the present application. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based devices that perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The modules described in the embodiments of the present application may be implemented by software or hardware. The modules described may also be provided in a processor.
As another aspect, the present application also provides a computer-readable medium, which may be contained in the electronic device described in the above embodiments; dividing a screen page into m x n sub-regions, wherein the width of each sub-region is 1/m, and the height of each sub-region is 1/n; establishing a plurality of independent page components, and acquiring the display form information and the data source information of each page component; dragging the page components into each sub-area through an html drag and drop API (application program interface) technology, acquiring positioning information of each page component, dragging the width and the height of each page component, acquiring the width and the height information of each page component, and storing the positioning information, the width and the height information, the display form information and the data source information as configuration information of a screen page; and configuring and displaying the plurality of page components on the screen page according to the configuration information.
The above description is only a preferred embodiment of the application and is illustrative of the principles of the technology employed. It will be appreciated by those skilled in the art that the scope of the invention herein disclosed is not limited to the particular combination of features described above, but also encompasses other arrangements formed by any combination of the above features or their equivalents without departing from the spirit of the invention. For example, the above features may be replaced with (but not limited to) features having similar functions disclosed in the present application.