Skip to content

Commit 6610f31

Browse files
committed
feat: 演示实例
1 parent a40c031 commit 6610f31

87 files changed

Lines changed: 26398 additions & 22 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
package com.ruoyi.web.controller.demo.controller;
2+
3+
import org.springframework.stereotype.Controller;
4+
import org.springframework.web.bind.annotation.GetMapping;
5+
import org.springframework.web.bind.annotation.RequestMapping;
6+
7+
/**
8+
* 模态窗口
9+
*
10+
* @author ruoyi
11+
*/
12+
@Controller
13+
@RequestMapping("/demo/modal")
14+
public class DemoDialogController {
15+
private String prefix = "demo/modal";
16+
17+
/**
18+
* 模态窗口
19+
*/
20+
@GetMapping("/dialog")
21+
public String dialog() {
22+
return prefix + "/dialog";
23+
}
24+
25+
/**
26+
* 弹层组件
27+
*/
28+
@GetMapping("/layer")
29+
public String layer() {
30+
return prefix + "/layer";
31+
}
32+
33+
/**
34+
* 表单
35+
*/
36+
@GetMapping("/form")
37+
public String form() {
38+
return prefix + "/form";
39+
}
40+
41+
/**
42+
* 表格
43+
*/
44+
@GetMapping("/table")
45+
public String table() {
46+
return prefix + "/table";
47+
}
48+
49+
/**
50+
* 表格check
51+
*/
52+
@GetMapping("/check")
53+
public String check() {
54+
return prefix + "/table/check";
55+
}
56+
57+
/**
58+
* 表格radio
59+
*/
60+
@GetMapping("/radio")
61+
public String radio() {
62+
return prefix + "/table/radio";
63+
}
64+
65+
/**
66+
* 表格回传父窗体
67+
*/
68+
@GetMapping("/parent")
69+
public String parent() {
70+
return prefix + "/table/parent";
71+
}
72+
}
Lines changed: 195 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,195 @@
1+
package com.ruoyi.web.controller.demo.controller;
2+
3+
import com.ruoyi.common.base.AjaxResult;
4+
import lombok.Data;
5+
import org.springframework.stereotype.Controller;
6+
import org.springframework.web.bind.annotation.GetMapping;
7+
import org.springframework.web.bind.annotation.RequestMapping;
8+
import org.springframework.web.bind.annotation.ResponseBody;
9+
10+
import java.util.ArrayList;
11+
import java.util.List;
12+
13+
/**
14+
* 表单相关
15+
*
16+
* @author ruoyi
17+
*/
18+
@Controller
19+
@RequestMapping("/demo/form")
20+
public class DemoFormController {
21+
private String prefix = "demo/form";
22+
23+
private final static List<UserFormModel> USERS = new ArrayList<>();
24+
25+
static {
26+
USERS.add(new UserFormModel(1, "1000001", "测试1", "15888888888"));
27+
USERS.add(new UserFormModel(2, "1000002", "测试2", "15666666666"));
28+
USERS.add(new UserFormModel(3, "1000003", "测试3", "15666666666"));
29+
USERS.add(new UserFormModel(4, "1000004", "测试4", "15666666666"));
30+
USERS.add(new UserFormModel(5, "1000005", "测试5", "15666666666"));
31+
}
32+
33+
/**
34+
* 按钮页
35+
*/
36+
@GetMapping("/button")
37+
public String button() {
38+
return prefix + "/button";
39+
}
40+
41+
/**
42+
* 下拉框
43+
*/
44+
@GetMapping("/select")
45+
public String select() {
46+
return prefix + "/select";
47+
}
48+
49+
/**
50+
* 表单校验
51+
*/
52+
@GetMapping("/validate")
53+
public String validate() {
54+
return prefix + "/validate";
55+
}
56+
57+
/**
58+
* 功能扩展(包含文件上传)
59+
*/
60+
@GetMapping("/jasny")
61+
public String jasny() {
62+
return prefix + "/jasny";
63+
}
64+
65+
/**
66+
* 拖动排序
67+
*/
68+
@GetMapping("/sortable")
69+
public String sortable() {
70+
return prefix + "/sortable";
71+
}
72+
73+
/**
74+
* 选项卡 & 面板
75+
*/
76+
@GetMapping("/tabs_panels")
77+
public String tabs_panels() {
78+
return prefix + "/tabs_panels";
79+
}
80+
81+
/**
82+
* 栅格
83+
*/
84+
@GetMapping("/grid")
85+
public String grid() {
86+
return prefix + "/grid";
87+
}
88+
89+
/**
90+
* 表单向导
91+
*/
92+
@GetMapping("/wizard")
93+
public String wizard() {
94+
return prefix + "/wizard";
95+
}
96+
97+
/**
98+
* 文件上传
99+
*/
100+
@GetMapping("/upload")
101+
public String upload() {
102+
return prefix + "/upload";
103+
}
104+
105+
/**
106+
* 日期和时间页
107+
*/
108+
@GetMapping("/datetime")
109+
public String datetime() {
110+
return prefix + "/datetime";
111+
}
112+
113+
/**
114+
* 左右互选组件
115+
*/
116+
@GetMapping("/duallistbox")
117+
public String duallistbox() {
118+
return prefix + "/duallistbox";
119+
}
120+
121+
/**
122+
* 基本表单
123+
*/
124+
@GetMapping("/basic")
125+
public String basic() {
126+
return prefix + "/basic";
127+
}
128+
129+
/**
130+
* 搜索自动补全
131+
*/
132+
@GetMapping("/autocomplete")
133+
public String autocomplete() {
134+
return prefix + "/autocomplete";
135+
}
136+
137+
/**
138+
* 获取用户数据
139+
*/
140+
@GetMapping("/userModel")
141+
@ResponseBody
142+
public AjaxResult userModel() {
143+
AjaxResult ajax = new AjaxResult();
144+
145+
ajax.put("code", 200);
146+
ajax.put("value", USERS);
147+
return ajax;
148+
}
149+
150+
/**
151+
* 获取数据集合
152+
*/
153+
@GetMapping("/collection")
154+
@ResponseBody
155+
public AjaxResult collection() {
156+
String[] array = {"ruoyi 1", "ruoyi 2", "ruoyi 3", "ruoyi 4", "ruoyi 5"};
157+
AjaxResult ajax = new AjaxResult();
158+
ajax.put("value", array);
159+
return ajax;
160+
}
161+
}
162+
163+
@Data
164+
class UserFormModel {
165+
/**
166+
* 用户ID
167+
*/
168+
private int userId;
169+
170+
/**
171+
* 用户编号
172+
*/
173+
private String userCode;
174+
175+
/**
176+
* 用户姓名
177+
*/
178+
private String userName;
179+
180+
/**
181+
* 用户手机
182+
*/
183+
private String userPhone;
184+
185+
public UserFormModel() {
186+
187+
}
188+
189+
public UserFormModel(int userId, String userCode, String userName, String userPhone) {
190+
this.userId = userId;
191+
this.userCode = userCode;
192+
this.userName = userName;
193+
this.userPhone = userPhone;
194+
}
195+
}
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
package com.ruoyi.web.controller.demo.controller;
2+
3+
import org.springframework.stereotype.Controller;
4+
import org.springframework.web.bind.annotation.GetMapping;
5+
import org.springframework.web.bind.annotation.RequestMapping;
6+
7+
/**
8+
* 图标相关
9+
*
10+
* @author ruoyi
11+
*/
12+
@Controller
13+
@RequestMapping("/demo/icon")
14+
public class DemoIconController {
15+
private String prefix = "demo/icon";
16+
17+
/**
18+
* FontAwesome图标
19+
*/
20+
@GetMapping("/fontawesome")
21+
public String fontAwesome() {
22+
return prefix + "/fontawesome";
23+
}
24+
25+
/**
26+
* Glyphicons图标
27+
*/
28+
@GetMapping("/glyphicons")
29+
public String glyphicons() {
30+
return prefix + "/glyphicons";
31+
}
32+
}

0 commit comments

Comments
 (0)