当前位置:网站首页>Address bar parameter transmission of list page based on jeecg-boot
Address bar parameter transmission of list page based on jeecg-boot
2022-07-06 06:25:00 【Hanyue Zhuge crossbow】
Pre knowledge :
1、 What is address bar parameter passing ? What is the format of address bar parameter transmission (? Variable 1= value 1& Variable 2= value 2……)
2、 If you pass JavaScript Get address bar parameters ( There are various solutions on the Internet )
My method ( Put it in util.js in ):
export function getUrlParam(name){
var reg = new RegExp("(^|&)"+ name +"=([^&]*)(&|$)");
var r = window.location.search.substr(1).match(reg);
if (r!=null) return decodeURI(r[2]); return '';
}
3、 Yes jeecg Of mixin Understanding ( Look at the code , See the development documents )
The main implementation :
1、 Build a general method to obtain address bar parameters
Because the address bar parameter acquisition is a very common method , So find it on the Internet js After obtaining the solution for the address bar parameters , You can add it to jeecg-boot Of :src/utils/util.js in
/**
* Get the specified parameters from the address bar
* @param {*} name
*/
export function getUrlParam(name){
var reg = new RegExp("(^|&)"+ name +"=([^&]*)(&|$)");
var r = window.location.search.substr(1).match(reg);
if (r!=null) return decodeURI(r[2]); return '';
}
2、JEECG-BOOT Understanding of code in
The key :src/mixins/JeecgListMixin.js
(1) Blend in coverage : This mixin.js yes jeecg To simplify front-end operations , Many general codes are packaged . meanwhile ,jeecg-boot It also provides us with an interface that can be mixed ,
In the picture above disableMixinCreated It is the judgment variable mixed with coverage
(2) Conditional generation
In the picture above queryParam It is based on the filter conditions to be built by the entity , The method in the figure above is loadData(arg) In the called , as follows :
(3) Data acquisition
Jeecg-boot Yes axios Further encapsulation , Here is getAction, There's another. postAction etc. , Execute different types of requests separately , Just call it directly in the process of use , The specific code is in :src/api/manage.js( Not detailed here , Because there is no need to modify )
getAction,postActon And so on are often used when we write code , So here you can see jeecg Official call code , Convenient for subsequent self simulation .
3、list Page coding
Understand section 2 After the principle of step , In the 1 On the basis of step, we can implement it very simply list Transfer and configuration of page parameters :
(1) stay list Page data Some settings :disableMixinCreated:true
(2) stay created Partial get parameters , And call mixin Code
Be careful :(1) If in list The page is not configured disableMixinCreated:true, Then the code will not be mixed with coverage ,list The request will be loaded twice .
(2) If the first 2 I can't understand the steps , No problem , Let's first 1 Step code into util.js in , Then according to the 3 The step method is directly in list Just write code in the page .
边栏推荐
- Redis core technology and basic architecture of actual combat: what does a key value database contain?
- Mise en œuvre d’une fonction complexe d’ajout, de suppression et de modification basée sur jeecg - boot
- Transfert des paramètres de la barre d'adresse de la page de liste basée sur jeecg - boot
- Private cloud disk deployment
- 模拟卷Leetcode【普通】1414. 和为 K 的最少斐波那契数字数目
- Simulation volume leetcode [general] 1405 Longest happy string
- Py06 字典 映射 字典嵌套 键不存在测试 键排序
- Past and present lives of QR code and sorting out six test points
- PHP uses redis to implement distributed locks
- 数据库-当前读与快照读
猜你喜欢
F - true liars (category and search set +dp)
E - food chain
Data type of MySQL
Properties file
Error getting a new connection Cause: org. apache. commons. dbcp. SQLNestedException
LeetCode 732. My schedule III
Luogu p2089 roast chicken
在JEECG-boot代码生成的基础上修改list页面(结合自定义的组件)
Selenium source code read through · 9 | desiredcapabilities class analysis
Private cloud disk deployment
随机推荐
LeetCode 739. Daily temperature
Private cloud disk deployment
Apple has open source, but what about it?
自定义指定路由上的Gateway过滤器工厂
职场进阶指南:大厂人必看书籍推荐
模拟卷Leetcode【普通】1314. 矩阵区域和
模拟卷Leetcode【普通】1143. 最长公共子序列
Customize the gateway filter factory on the specified route
The pit encountered by keil over the years
Remember the implementation of a relatively complex addition, deletion and modification function based on jeecg-boot
Database - current read and snapshot read
Isam2 operation process
LeetCode 732. My schedule III
这些年用Keil遇到的坑
Data type of MySQL
E - 食物链
Technology sharing | common interface protocol analysis
浅谈专项测试之弱网络测试
JDBC Requset 对应内容及功能介绍
Thoughts on data security (Reprint)