当前位置:网站首页>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 .
边栏推荐
- Remember the implementation of a relatively complex addition, deletion and modification function based on jeecg-boot
- Digital triangle model acwing 1015 Picking flowers
- Esp32 esp-idf watchdog twdt
- 模拟卷Leetcode【普通】1405. 最长快乐字符串
- [API interface tool] Introduction to postman interface
- 一文揭开,测试外包公司的真 相
- JDBC requset corresponding content and function introduction
- Is the test cycle compressed? Teach you 9 ways to deal with it
- 基於JEECG-BOOT的list頁面的地址欄參數傳遞
- D - How Many Answers Are Wrong
猜你喜欢

浅谈专项测试之弱网络测试

把el-tree选中的数组转换为数组对象

Error getting a new connection Cause: org. apache. commons. dbcp. SQLNestedException

MySQL之基础知识

F - True Liars (种类并查集+DP)

Avtiviti创建表时报错:Error getting a new connection. Cause: org.apache.commons.dbcp.SQLNestedException

记一个基于JEECG-BOOT的比较复杂的增删改功能的实现

Construction and integration of Zipkin and sleuth for call chain monitoring
![[wechat applet] build a development tool environment](/img/f6/51f97b1c927337b34c5b3a4207abb4.png)
[wechat applet] build a development tool environment

Detailed explanation of P problem, NP problem, NPC problem and NP hard problem
随机推荐
Play video with Tencent video plug-in in uni app
Simulation volume leetcode [general] 1405 Longest happy string
Redis 核心技术与实战之 基本架构:一个键值数据库包含什么?
测试周期被压缩?教你9个方法去应对
Aike AI frontier promotion (2.13)
Esp32 esp-idf watchdog twdt
Simulation volume leetcode [general] 1249 Remove invalid parentheses
Coordinatorlayout+nestedscrollview+recyclerview pull up the bottom display is incomplete
Engineering organisms containing artificial metalloenzymes perform unnatural biosynthesis
Construction and integration of Zipkin and sleuth for call chain monitoring
黑猫带你学UFS协议第18篇:UFS如何配置逻辑单元(LU Management)
模拟卷Leetcode【普通】1219. 黄金矿工
Delete the variables added to watch1 in keil MDK
Black cat takes you to learn UFS Protocol Part 8: UFS initialization (boot operation)
Database isolation level
数据库隔离级别
Remember the implementation of a relatively complex addition, deletion and modification function based on jeecg-boot
Simulation volume leetcode [general] 1091 The shortest path in binary matrix
Drug disease association prediction based on multi-scale heterogeneous network topology information and multiple attributes
LeetCode 739. Daily temperature