提交 | 用户 | 时间
|
71e81e
|
1 |
package cn.stylefeng.guns.modular.form.controller; |
懒 |
2 |
|
|
3 |
import cn.stylefeng.guns.base.pojo.page.LayuiPageFactory; |
|
4 |
import cn.stylefeng.guns.base.pojo.page.LayuiPageInfo; |
|
5 |
import cn.stylefeng.guns.modular.form.entity.EgForm; |
|
6 |
import cn.stylefeng.guns.modular.form.model.EgFormParam; |
|
7 |
import cn.stylefeng.roses.core.base.controller.BaseController; |
|
8 |
import cn.stylefeng.roses.kernel.model.response.ResponseData; |
|
9 |
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
|
10 |
import org.springframework.stereotype.Controller; |
|
11 |
import org.springframework.web.bind.annotation.RequestMapping; |
|
12 |
import org.springframework.web.bind.annotation.ResponseBody; |
|
13 |
|
|
14 |
import java.util.ArrayList; |
|
15 |
|
|
16 |
|
|
17 |
/** |
|
18 |
* Guns复杂表单的示例控制器 |
|
19 |
* |
|
20 |
* @author stylefeng |
|
21 |
* @Date 2019-02-18 21:37:43 |
|
22 |
*/ |
|
23 |
@Controller |
|
24 |
@RequestMapping("/egForm") |
|
25 |
public class EgFormController extends BaseController { |
|
26 |
|
|
27 |
private String PREFIX = "/form"; |
|
28 |
|
|
29 |
/** |
|
30 |
* 跳转到主页面 |
|
31 |
* |
|
32 |
* @author stylefeng |
|
33 |
* @Date 2019-02-18 |
|
34 |
*/ |
|
35 |
@RequestMapping("") |
|
36 |
public String index() { |
|
37 |
return PREFIX + "/egForm.html"; |
|
38 |
} |
|
39 |
|
|
40 |
/** |
|
41 |
* 新增页面 |
|
42 |
* |
|
43 |
* @author stylefeng |
|
44 |
* @Date 2019-02-18 |
|
45 |
*/ |
|
46 |
@RequestMapping("/add") |
|
47 |
public String add() { |
|
48 |
return PREFIX + "/egForm_add.html"; |
|
49 |
} |
|
50 |
|
|
51 |
/** |
|
52 |
* 新增接口 |
|
53 |
* |
|
54 |
* @author stylefeng |
|
55 |
* @Date 2019-02-18 |
|
56 |
*/ |
|
57 |
@RequestMapping("/addItem") |
|
58 |
@ResponseBody |
|
59 |
public ResponseData addItem(EgFormParam egFormParam) { |
|
60 |
System.out.println(egFormParam); |
|
61 |
return ResponseData.success(); |
|
62 |
} |
|
63 |
|
|
64 |
/** |
|
65 |
* 删除接口 |
|
66 |
* |
|
67 |
* @author stylefeng |
|
68 |
* @Date 2019-02-18 |
|
69 |
*/ |
|
70 |
@RequestMapping("/delete") |
|
71 |
@ResponseBody |
|
72 |
public ResponseData delete(EgFormParam egFormParam) { |
|
73 |
System.out.println(egFormParam); |
|
74 |
return ResponseData.success(); |
|
75 |
} |
|
76 |
|
|
77 |
/** |
|
78 |
* 查询列表 |
|
79 |
* |
|
80 |
* @author stylefeng |
|
81 |
* @Date 2019-02-18 |
|
82 |
*/ |
|
83 |
@ResponseBody |
|
84 |
@RequestMapping("/list") |
|
85 |
public LayuiPageInfo list(EgFormParam egFormParam) { |
|
86 |
|
|
87 |
ArrayList<EgForm> records = new ArrayList<>(); |
|
88 |
EgForm egForm = new EgForm(); |
|
89 |
egForm.setName("高级表单"); |
|
90 |
egForm.setSingleTime("2019-03-27 14:16:03"); |
|
91 |
egForm.setBetweenTime("2019-02-07 - 2019-03-14"); |
|
92 |
egForm.setFenzuSelect("fenzuSelect"); |
|
93 |
egForm.setFormId(111L); |
|
94 |
egForm.setLongText("xxxxxx"); |
|
95 |
egForm.setSex("M"); |
|
96 |
egForm.setSimpleSelect("111"); |
|
97 |
egForm.setMultiSelectHidden("shiro,mybatis-puls"); |
|
98 |
|
|
99 |
records.add(egForm); |
|
100 |
records.add(egForm); |
|
101 |
|
|
102 |
Page<EgForm> egFormPage = new Page<>(); |
|
103 |
egFormPage.setSize(10); |
|
104 |
egFormPage.setTotal(2); |
|
105 |
egFormPage.setRecords(records); |
|
106 |
|
|
107 |
return LayuiPageFactory.createPageInfo(egFormPage); |
|
108 |
} |
|
109 |
|
|
110 |
} |
|
111 |
|
|
112 |
|