当前位置:网站首页>How to use the low code platform of the Internet of things for worksheet management?

How to use the low code platform of the Internet of things for worksheet management?

2022-06-10 20:08:00 InfoQ

The worksheet is AIRIOT One of the main functions of the low code platform of the Internet of things , It is mainly used to customize business forms , Realize data synchronization and business linkage , Can synchronize local and network databases , Realize the synchronization of platform data and third-party system data .AIRIOT Worksheet management is convenient , You can freely create a worksheet according to the actual situation 、 Modify worksheet 、 Make a worksheet picture 、 Data synchronization, etc , The basic functions of the worksheet include basic information settings 、 Data synchronization 、 Screen settings and table definitions .

Worksheet

1  Add sheet
Click the main menu “ Worksheet ”, Open the sheet management page , Pictured  5-1  Shown , The page is a list of worksheets that have been added , Click the corresponding worksheet View button , You can view worksheet records . Click in the upper right corner “+ Add sheet ” Button , Switch to the add sheet page , Pictured  52  Shown , To add a worksheet, just fill in the basic information of the worksheet , Include table name and table title , Both are required .
Table name refers to the name of the worksheet , The table name input format can include Chinese characters 、 The number 、 Special characters 、 Letter . The maximum length of the table name is  256  Characters , exceed  256  After characters , The input box is highlighted , Prompt the user , Prompt text “ Not more than  256  Characters ”, After the user deletes some characters , Highlight and text prompt disappear .
Table title refers to the title displayed when viewing the worksheet , The table title input format can include Chinese characters 、 The number 、 Special characters 、 Letter . The maximum length of the table title is  256  Characters , exceed  256  After characters , The input box is highlighted , Prompt the user , Prompt text “ Not more than  256  Characters ”, After the user deletes some characters , Highlight and text prompt disappear .

null
chart  5-1

null
chart  5-2
Table name and table title are generally filled in according to business functions , Can be consistent , Such as “ Patrol record sheet ”, Recorded patrol information . After filling in the name and title of the table , Click below “ preservation ” Button , Enter the worksheet editing page .

null
Finished editing , Click save , Generate patrol record table .
null
chart  5-3
6.2  Edit the sheet
Click... To the right of the worksheet “ modify ” Icon , Switch to the modify worksheet page , Pictured  5-4  Shown , This page can set all the information of the worksheet , Including basic information 、 Synchronous data 、 Screen settings 、 Table definitions and field rules . single click “ essential information ”、“ Synchronous data ”、“ Screen settings ”、“ The table definition ” or “ Rules of the field ” The corresponding functions can be modified and set .

null
chart  5-4
6.3  Add sheet record
In the worksheet list , single click “ see ” Icon , You can view this worksheet , The method to view the patrol record table is shown in the figure  5-5  Shown .
single click “ see ” After the icon, the page switches to the page of patrol record table , Pictured  5-6  Shown , This page displays the data of the patrol record table in list form . By default, each page displays  15  Data , single click “ each page  15  strip ” Icon can select and customize the number of data displayed on each page .


null
chart  5-5
single click “ export ” Icon to export data , Save in “.xlsx”. single click “ Print ” Icon to print the form . single click “ Show Columns ” The icon can check the field to be displayed .
null
chart  5-6
single click “+ Add patrol record table ” Button , Switch to “ Add patrol record table ” page , Additable  1  Data , The page of adding patrol record table is shown in the figure  5-7  Shown , When you are finished, click “ preservation ” Button , At this time, there are more pages in the patrol record table  1  Data , Pictured  5-8  Shown .
null
chart  5-7

null
chart  5-8
6.4  Data synchronization
AIRIOT  In addition to synchronous reference of field association data between platform worksheets , It can also synchronize local and third-party database data , Support common databases , Include  MySQL、PostgreSQL、SQLite3、Oracle  and  SQLServer  etc. . Let's say  MySQL  As an example, this paper introduces the implementation of worksheet data synchronization .
6.4.1 MySQL  Database foundation
A database organizes data according to a certain data structure 、 Containers for storage and management .MySQL  Is one of the most popular relational database management systems , adopt  MySQL, Database users can easily access various database objects in the database container , Ruzeng 、 Delete 、 Change 、 Check the operations such as , And can easily complete the maintenance of the database , Backup 、 recovery 、 Repair, etc .
Let's say  Windows 10  Systematic  MySQL  Taking database as an example, this paper introduces the function of data synchronization .
This book will not introduce the installation of database , The default user has completed installation  MySQL  database , Create a user and authorize the operation as shown in the figure  59  Shown , common  4  A step .
(1)  Create user : The order is “CREATE USER ' user name ' @ 'IP' IDENTIFIED BY ' password ';”,IP  by % To allow all  IP  Sign in .
(2)  to grant authorization : The command to grant all permissions is “GRANT ALL PRIVILEGES ON *.* TO ' user name ' @ '%' WITH GRANT OPTION;”.
(3)  Refresh the permissions : After updating the permission, you must refresh the permission , The order is “FLUSH PRIVILEGES;”.
(4)  Change password method : The password mode must be changed for remote login , The order is “ALTER USER ' user name ' @ '%' IDENTIFIED WITH MYSQL_NATIVE_PASSWORD BY ' password ';”.
here , Any in the LAN  IP  You can log in to the database through a new user and password , And have all operation permissions .

null
chart  5-9
Navicat Premium  Is a database management tool , Users can connect to... Simultaneously with a single program  MySQL、SQLite、Oracle、MariaDB、Mssql、 And  PostgreSQL  database , Make it easier to manage different types of databases . Use of this book  Navicat Premium  Database management .Navicat Premium  Simple installation , Installation will not be introduced in this book .
(1)  Linked database : open  Navicat Premium  Software , single click “ file ”à“ make new connection ”à“MySQL…” The new connection interface pops up , Pictured 5-10 Shown . When you are finished filling in the information, click “ Test connection ” Button , eject “ Successful connection ” Tips . single click “ Successful connection ” Prompt “ determine ” Button , Return to the new connection interface , Click... At the bottom of the interface “ determine ” Button , Exit the new connection interface , here Navicat Premium The connected database is displayed on the left side of the main interface , The database connection is successful . The database has not been opened at this time ( The icon is gray ), Double click the connected database , The database can be opened ( The icon is green ).

null
chart  5-10
(2)  New database : Select the open database , Step by step “ Right click ”à single click “ New database ”, Open the new database interface , Pictured  5-11  Shown , When you are finished filling in the information, click “ determine ” Button , Exit the new database interface , return  Navicat Premium  main interface , Pictured  5-12  Shown . stay  ceshi2  Add more databases  ceshi, You can create a new table 、 Inquire about 、 increase 、 Delete 、 check 、 Change the operation , In this example, a new table , Table,  user, Yes  id  and  name  Two fields .

null
chart  5-11

null
chart  5-12
(3)  insert data : Click the bottom left corner of the interface “+” Icon , Pluggable data , Pictured  5-13  Shown , After filling in the information of each field , single click “√” Icon , Complete the data insertion . When creating a new database and table , All character sets are “utf8”, The character rules are “utf8_general_ci”, Before entering Chinese characters , Otherwise, an error will be reported when inputting Chinese characters .

null
chart  5-13
(4)  Query data : Click... According to the steps “ Inquire about ”à single click “ New query ”à Input “ Instructions ”à single click “ function ” Data can be queried , The query results are displayed at the bottom of the interface , Pictured  5-14  Shown .

null
chart  5-14
6.4  Data synchronization
1.  Add sheet
Add a new “ user ” Worksheet , Used to synchronize  MySQL  User information in the database .
(1)  essential information
“ user ” The basic information of the worksheet is shown in the figure  5-15  Shown , The name of the table is “ user ”, The title of the table is “ user ”.

null
chart  5-15
(2)  The controls in the table definition are the same as those in the property setting page in system model management , For details, see the explanation of the control on the property setting page in system model management .

(3)  Synchronous data
The configuration of synchronization data is shown in the figure  5-18  Shown .
1)  Relationship library name : The relationship library name is drop-down list , Options include  MYSQL、POSTGRE、SQLITE3、ORACLE  and  SQLSERVER, They correspond to each other  MySQL、PostgreSQL、SQLite3、Oracle  and  SQLServer  Five databases . Choose here  MYSQL.
2)  User name and password : The user name and password are the user name and password of the database to be synchronized .
3) IP  Address :IP  The address is the address of the database to be synchronized  IP  Address .
4)  port : The port is the port to synchronize the database , Generally, the default port for database installation is  3306.
5)  Database name : The database name is the name of the database to be synchronized .
6) SQL  sentence : Used to obtain data in the database , use  SELECT  sentence , Follow the corresponding database specifications ,MySQL  The recommended format in is “SELECT  Field  1, Field  2,……, Field n FROM ` Table name ` WHERE  Field 1 > '{{ Field 1}}' ORDER BY  Field 1 ASC LIMIT 3”. among “` Table name `” Inverted single quotation marks at both ends ,“'{{ Field 1}}'” Single quotation marks at both ends ,“ORDER BY  Field 1 ASC” Indicates by field 1 Get... In ascending order ,“DESC” For the descending order ,“LIMIT 3” Is the maximum number of data pieces obtained at one time . In this case “SELECT number,name FROM `usr` WHERE  number> '{{number}}' ORDER BY number ASC LIMIT 3”, From usr Table acquisition number and name Two fields , The rule is number Greater than AIRIOT in number Get at most... At one time 3 Data , Data press number Ascending sort .
7)  Acquisition cycle : The acquisition cycle is the time interval of synchronous data , Unit is  s, Here for  10s.
8)  Column set : Column set and  SQL  Sentence correspondence , Used to set acquisition rules , The column set configuration is shown in the figure  5-4  Shown . Name “number” And  SQL  Statement and table definition ( chart  5-19)  Serial number in “key” Agreement .
9)  Detect links : Used to detect whether the database is successfully linked , single click “ Detect database links ” Button , Pop up link result prompt , Success for , Otherwise, the link fails , user name 、 password 、IP  Wrong settings such as address will lead to link failure .

null
chart  5-18

null
chart  5-19
When the configuration is complete , single click “ preservation ” Button , Return to the worksheet page , And prompt “ Save sheet succeeded ”, If the setting is correct , The data in the database will be synchronized to “ user ” Worksheet , After synchronizing the data “ user ” The worksheet view page is shown in the figure  5-20  Shown , There is  2  Data , It is the data synchronized from the database .

null
chart  5-20
In the database  user  Of  usr  Add... To the table  2  Data , Pictured  5-21  Shown . Refresh “ user ” Worksheet view page , After refresh “ user ” The worksheet view page is shown in the figure  72  Shown ,usr  The newly added data in the table has been synchronized to the worksheet .

null
chart  5-21

null
chart  5-22
4.3  Record permissions
Table record permission can be set to view the current worksheet record 、 Add and manage permissions , Pictured 5-23 Shown :

null
chart  5-23
A. View permissions
a. Make all records public : Records are open to those within their authority , As long as the person who has the permission to view worksheet records can see all records ;
b. Individual only : Personnel within the permission can only view the records created by themselves ;
c. Only the personnel of the same department : The personnel within the permission can view the records created by themselves and the personnel of the same department ;
d. Only the personnel of the same department and sub department : People within their authority can view their own 、 Records created by personnel in the same department and its sub departments ;
e. Only users in the same role : Personnel within the permission can view the records created by themselves and those in the same role ;
f. Specific department personnel : The personnel of the selected department within the permission can view the records created by each other ;
g. People in specific roles : The personnel of the selected role within the permission can view the records created by each other ;
B. Add permissions

null
chart  5-24
a. Make all records public : Records are open to those within their authority , Anyone who has permission to add worksheet records can add records ;
b. Specific users : Specific users can add records of the current worksheet ;
c. Specific department personnel : Specific department personnel can add records of the current worksheet ;
d. People in specific roles : People in specific roles can add records of the current worksheet ;
C. Administrative authority

null
chart  5-25
notes : The management permission is limited by the viewing permission, and the maximum operable range is ;
a. Make all records public : Records are open to those within their authority , As long as there are worksheet records to edit 、 The person who deletes the permission can operate on all records that can be seen ;
b. Individual only : Only persons within permission can edit 、 Delete the record you created ;
c. Only the personnel of the same department : Personnel within the permission can edit 、 Delete the records created by yourself and the personnel of the same department ;
d. Only the personnel of the same department and sub department : Personnel within the permission can edit 、 Delete yourself 、 Records created by personnel in the same department and its sub departments ;
e. Only users in the same role : Personnel within the permission can edit 、 Delete the records created by yourself and those in the same role ;
f. Specific department personnel : The personnel of the selected department within the permission can edit 、 Delete records created by each other ;
g. People in specific roles : The person with the selected role within the permission can edit 、 Delete records created by each other ;
4.4  Worksheet screen
1.  Add sheet screen
Worksheet screen is used to set the screen of the worksheet , single click “ Screen settings ” Open the screen setting page , Pictured  5-26  Shown , single click “+” Icon add screen , eject “ Add sheet screen ” Dialog box , Pictured  5-27  Shown , It has “*” Is required .

null
chart  5-26

null
chart  5-27
(1)  Screen name
Screen name is required , It is recommended to match the name of the worksheet .
(2)  Picture Directory
The picture directory is a drop-down list , Not required , After adding a directory in the picture management , The corresponding directory appears in the drop-down list .
(3)  The view type
When the type is selected , The created screen can replace the current type page of the work record , Add view allows users to add views , Edit view allows you to edit the view , View view only allows users to view , The details view allows the user to view details .
(4)  thumbnail
Thumbnail after uploading pictures , The screen will be displayed in the form of thumbnail on the screen setting page .
(5) Picture template
All created pictures in the picture template are available for selection
add to “ user ” After the worksheet screen , The screen setting page is shown in the figure 5-28  Shown .

null
chart  5-28
2.  Worksheet screen editing 、 See screen editing for functions such as viewing and deleting
4.5 The table definition
The table definition operation is consistent with the model management configuration attribute operation , See model management attribute configuration for details
4.6 Rules of the field
Field rules include interaction rules and error prompts . Interaction rules are used to verify record entry , Show or hide some fields when conditions are met , The specific operation is , Click Add Rule and name , Set the trigger condition and the execution action when the trigger condition is met , for example , When the text contains “ System ” Hide the text when the field . As shown in the figure  5-29:

null
chart  5-29

Error prompt refers to the verification of record entry through error prompt . When the conditions are met , Make an error prompt . for example , When text contains numbers , Text prompt at the bottom of the control or pop-up window at the top for three seconds “1234”. As shown in the figure  5-30:

null
chart  5-30​
原网站

版权声明
本文为[InfoQ]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/161/202206101859150579.html