How does the front end of the Jeecg association table connect to the interface

The agile development framework used by our company is jeecg. This framework only needs to configure the form on his interface to generate a series of additions, deletions, and changes. However, there are business needs recently, and I need to perform related table operations, and I also have a mobile project I want to connect to this interface, so I need to know how to connect the generated interface and how to pass parameters?

I won’t elaborate on how to operate the association table here, because I don’t understand it very well, anyway, it’s a little troublesome. Then you go to the background to send a network request to see how to add and change.

Entering the topic, we can see through the network request that he needs the main table fields, and the attached table is made into a list. When he automatically generates it, there will be a page package, which will be more intuitive from there.

Use ajax to send a request and edit the data object:

$(".pay").click(function() {
    
    
			var data = {
    
    };
			data['userOpenId'] = openid;
			data['receiverName'] = addressInfo.reciverName;
			data['province'] = addressInfo.province;
			data['city'] = addressInfo.city;
			data['district'] = addressInfo.district;
			data['road'] = addressInfo.road;
			data['address'] = addressInfo.address;
			data['paymentMethod'] = '微信支付';
			data['orderMoney'] = totalAllPrice;
			data['paymentMoney'] = totalAllPrice;  			//支付金额为总价金额,等后面再改!!!!!!!!!!
			data['orderStatus'] = 2;

			for (var i = 0; i < shopInfo.length; i++) {
    
    
				data['wxOrderDetailList[' + i + '].productId'] = shopInfo[i].id;
				data['wxOrderDetailList[' + i + '].productName'] = shopInfo[i].productName;
				data['wxOrderDetailList[' + i + '].productNum'] = shopInfo[i].productNum;
				data['wxOrderDetailList[' + i + '].productPrice'] = shopInfo[i].productPrice;
			}
			
			console.log(data);
			$.ajax({
    
    
				url: 'rest/wxOrderMasterController.do?doAdd',
				type: 'POST',
				dataType: "json",
				data: data,
				success:function(){
    
    
						console.log("提交成功!");
				}
			});
		})

This problem has troubled me for a long time. The objects in the main table are easy to upload, but how can the objects in the attached table be traversed and uploaded?
Scheduled network request parameters
And you can see that it must be traversed by the front end and passed to the back end. What I was thinking at the time was really smashing my head. I looked for a lot of older brothers before I solved it.

Make a publicity

Technical exchange group, provide free automatic opening package for tools such as jerbrant series idea webstorm.
Technical exchange sharing ②group: 272712006
technical exchange sharing ③group: 1093476453
bilibili learning tutorial address: https://space.bilibili.com/439411741/video
简书 address : Https://www.jianshu.com/p/133af2e4fe3f

Guess you like

Origin blog.csdn.net/Curtisjia/article/details/106179173