当前位置:网站首页>Modify the list page on the basis of jeecg boot code generation (combined with customized components)
Modify the list page on the basis of jeecg boot code generation (combined with customized components)
2022-07-06 06:25:00 【Hanyue Zhuge crossbow】
First on the renderings :
1、 Create an interface on the back end , Get tree nodes . After passing the test .
2、 Create front-end components
Two method All codes of are :
methods: {
onLoadData(selectedNode) {
let that = this
let pid = 0
if (selectedNode != null) {
pid = selectedNode.dataRef.id
}
let params = new Object()
params.pid = pid
return new Promise(resolve => {
getAction("/jeecg-product/dict.device_catalog/dictDeviceCatalog/queryByPid", params).then(function(res) {
res.forEach(function(catalog){
let node = new Object()
node.key = catalog.id
node.title = catalog.deviceCatalog
node.isLeaf = (catalog.hasChild == 1?false:true);
node.id = catalog.id
node.pid = params.pid
node.icon = "gold"
node.children=[]
debugger
if(selectedNode != null){
node.path = selectedNode.dataRef.title + "-" + node.title
}
else{
node.path = node.title
}
if(selectedNode == null){
that.treeData.push(node)
}
else{
selectedNode.dataRef.children.push(node)
}
// that.allTreeNodes.push(node)
})
})
resolve();
})
},
onSelectNode(nodeId, e){
let param = new Object();
param.node = e.node.dataRef
param.id = e.node.dataRef.key
param.path = e.node.dataRef.path
param.title = e.node.dataRef.title
this.$emit("SelectNode",param)
}
},
It should be noted that ant-design-vue in , The nodes of the tree control are only key,title,children,isleaf Mandatory ( namely : Based on these attributes, a tree is generated ), It can be used through dataRef Get the corresponding self built node object .
Custom component events :
3、 front end vue call
边栏推荐
- Simulation volume leetcode [general] 1414 The minimum number of Fibonacci numbers with a sum of K
- [postman] test script writing and assertion details
- [postman] dynamic variable (also known as mock function)
- B - The Suspects
- 模拟卷Leetcode【普通】1091. 二进制矩阵中的最短路径
- G - Supermarket
- [postman] collections configuration running process
- 模拟卷Leetcode【普通】1219. 黄金矿工
- MySQL is sorted alphabetically
- Construction and integration of Zipkin and sleuth for call chain monitoring
猜你喜欢
Private cloud disk deployment
在JEECG-boot代码生成的基础上修改list页面(结合自定义的组件)
Engineering organisms containing artificial metalloenzymes perform unnatural biosynthesis
MySQL之基础知识
LeetCode 729. My schedule I
Delete the variables added to watch1 in keil MDK
Full link voltage measurement: building three models
Coordinatorlayout+nestedscrollview+recyclerview pull up the bottom display is incomplete
LeetCode 732. My schedule III
Luogu p2089 roast chicken
随机推荐
模拟卷Leetcode【普通】1143. 最长公共子序列
Win10 cannot operate (delete, cut) files
JWT-JSON WEB TOKEN
Avtiviti创建表时报错:Error getting a new connection. Cause: org.apache.commons.dbcp.SQLNestedException
selenium源码通读·9 |DesiredCapabilities类分析
Simulation volume leetcode [general] 1314 Matrix area and
LeetCode 1200. Minimum absolute difference
[C language] qsort function
Selenium source code read through · 9 | desiredcapabilities class analysis
黑猫带你学eMMC协议第10篇:eMMC读写操作详解(read & write)
[postman] dynamic variable (also known as mock function)
LeetCode 731. My schedule II
Pat (Grade B) 2022 summer exam
Oscp raven2 target penetration process
还在为如何编写Web自动化测试用例而烦恼嘛?资深测试工程师手把手教你Selenium 测试用例编写
Basic knowledge of MySQL
[API interface tool] Introduction to postman interface
mysql按照首字母排序
LeetCode 1200. 最小绝对差
模拟卷Leetcode【普通】1296. 划分数组为连续数字的集合