当前位置:网站首页>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
边栏推荐
- D - How Many Answers Are Wrong
- 模拟卷Leetcode【普通】1414. 和为 K 的最少斐波那契数字数目
- [Tera term] black cat takes you to learn TTL script -- serial port automation skill in embedded development
- Black cat takes you to learn UFS protocol Chapter 18: how UFS configures logical units (Lu Management)
- An article was uncovered to test the truth of outsourcing companies
- org.activiti.bpmn.exceptions.XMLException: cvc-complex-type.2.4.a: 发现了以元素 ‘outgoing‘ 开头的无效内容
- Redis core technology and basic architecture of actual combat: what does a key value database contain?
- JWT-JSON WEB TOKEN
- [no app push general test plan
- MFC关于长字符串unsigned char与CString转换及显示问题
猜你喜欢
Mise en œuvre d’une fonction complexe d’ajout, de suppression et de modification basée sur jeecg - boot
LeetCode 732. My schedule III
【无App Push 通用测试方案
[web security] nodejs prototype chain pollution analysis
在uni-app中使用腾讯视频插件播放视频
Database - current read and snapshot read
Redis 核心技术与实战之 基本架构:一个键值数据库包含什么?
Postman核心功能解析-参数化和测试报告
使用Nacos管理配置
LeetCode 731. My schedule II
随机推荐
LeetCode 731. My schedule II
F - true liars (category and search set +dp)
B - The Suspects
JWT-JSON WEB TOKEN
测试周期被压缩?教你9个方法去应对
Private cloud disk deployment
Summary of anomaly detection methods
Esp32 esp-idf watchdog twdt
The whole process realizes the single sign on function and the solution of "canceltoken" of undefined when the request is canceled
RestTemplate、Feign实现Token传递
黑猫带你学UFS协议第4篇:UFS协议栈详解
Qt:无法定位程序输入点XXXXX于动态链接库。
Simulation volume leetcode [general] 1091 The shortest path in binary matrix
Manage configuration using Nacos
这些年用Keil遇到的坑
[postman] collections - run the imported data file of the configuration
Black cat takes you to learn UFS protocol Chapter 4: detailed explanation of UFS protocol stack
数据库隔离级别
PHP uses redis to implement distributed locks
Simulation volume leetcode [general] 1314 Matrix area and