19 |
20 |
21 |
22 |
23 |
29 |
30 |
31 |
37 |
38 |
44 |
45 |
46 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
74 |
75 |
103 |
104 |
105 |
--------------------------------------------------------------------------------
/src/main/resources/static/page/car/editCar.js:
--------------------------------------------------------------------------------
1 | layui.use(['form','layer','layedit','laydate','upload'],function(){
2 | var form = layui.form
3 | layer = parent.layer === undefined ? layui.layer : top.layer,
4 | laypage = layui.laypage,
5 | upload = layui.upload,
6 | layedit = layui.layedit,
7 | laydate = layui.laydate,
8 | $ = layui.jquery;
9 |
10 | //用于同步编辑器内容到textarea
11 | layedit.sync(editIndex);
12 |
13 |
14 | //格式化时间
15 | function filterTime(val){
16 | if(val < 10){
17 | return "0" + val;
18 | }else{
19 | return val;
20 | }
21 | }
22 |
23 | //创建一个编辑器
24 | var editIndex = layedit.build('news_content',{
25 | height : 535,
26 | uploadImage : {
27 | url : "../../json/newsImg.json"
28 | }
29 | });
30 |
31 |
32 |
33 | })
--------------------------------------------------------------------------------
/src/main/resources/static/page/doc/addressDoc.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
三级联动使用文档--layui后台管理模板 2.0
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 | address模块是封装的一个省市区三级联动的功能,可以和form、layer等模块一样通过模块化引入进行使用。唯一的不同就是模块的存放路径和使用时的配置。下面将对此区别进行详细的描述。
18 |
19 |
20 | 模块加载名称:address
21 |
22 |
25 |
语法:layui.address()
26 |
27 | layui.use('address', function(){
28 | var layui.address();
29 | });
30 |
31 |
上面说过,模块相对页面的存放路径不同,使用时也需要进行不同的配置。如果页面和此模块属于同级关系,则不用进行任何配置,直接引入即可使用。如果它们不属于同级关系,则需要通过查找address.js文件相对xx.js文件的相对路径进行配置,如:address.js文件与a文件夹属于同级,而a文件夹中包含b文件夹,b文件夹中包含xx.js,通过xx.js引入address模块则进行下面的配置
32 |
33 | layui.config({
34 | base : "../../js/" //如果a文件夹中直接就是xx.js文件,则为“../js/”
35 | }).extend({
36 | "address" : "address"
37 | })
38 |
39 |
42 |
下面是HTML数据格式,其中select的name值和lay-filter值是固定不可改变的,因为模块中是通过查找对应name的select进行的赋值,通过form.on("select(filter)")执行选择的方法,所以这两个值是不可以随意更改的。如果需要改变请将模块源码中对应的值一同修改。另外需要注意的是“市”、“区/县”的select需要添加一个disabled属性,主要是为了避免在没有选择省份的情况下先选择市、区造成错误。
43 |
44 | //省份select
45 | <select name="province" lay-filter="province">
46 | <option value="">请选择省</option>
47 | </select>
48 | //市select
49 | <select name="city" lay-filter="city" disabled>
50 | <option value="">请选择市</option>
51 | </select>
52 | //区/县select
53 | <select name="area" lay-filter="area" disabled>
54 | <option value="">请选择县/区</option>
55 | </select>
56 |
57 |
60 |
其中code为地区id,用于给option赋值;name为地区名称,用于设置option的text;childs为当前区域的下级地区。
61 |
62 | [{
63 | "code": "11",
64 | "name": "北京市",
65 | "childs": [{
66 | "code": "1101",
67 | "name": "市辖区",
68 | "childs": [{
69 | "code": "110101",
70 | "name": "东城区"
71 | }]
72 | }]
73 | }]
74 |
75 |
76 |
83 |
84 |
--------------------------------------------------------------------------------
/src/main/resources/static/page/doc/navDoc.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
三级菜单使用文档--layui后台管理模板 2.0
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 | 其实本模版中的三级菜单的展示方式和实际开发中的做法是不一样的,下面将说一下本模版中的做法
18 |
19 |
22 |
在实际的开发中,无论是顶部菜单还是左侧菜单都应该是通过接口获取的。首先获取顶部菜单,然后点击顶级菜单通过传参再次访问接口来获取二级、三级菜单。
23 |
26 |
由于顶部菜单是大分类,不会有太多,所以在本模版中是直接写死的,代码如下【具体请看index.html第25-36行】:
27 |
28 | <dd data-menu="seraphApi"><a href="javascript:;"><i class="layui-icon" data-icon=""></i><cite>使用文档</cite></a></dd>
29 | 请注意这里面的“data-menu”属性,此属性值需要和json中的字段名对应以便能够进行通过此属性查找对应的子菜单
30 |
31 |
然后通过index.js中的代码进行循环渲染,就成了当前大家看到的这个样子了,js代码如下【具体请看index.js中的第18-38行】:
32 |
33 | function getData(json){
34 | $.get("接口路径",function(data){
35 | if(json == "contentManagement"){ //此处即实际开发中传递的参数
36 | dataStr = data.contentManagement; //获取到当前顶级菜单下的子菜单渲染到左侧
37 | tab.render();
38 | }
39 | })
40 | }
41 |
42 |
43 | 如果不动大框架的前提下,请严格按照菜单数据格式返回数据,菜单数据格式请参考:bodyTab模块去看看菜单数据格式
44 |
45 |
46 |
47 |
65 |
66 |
--------------------------------------------------------------------------------
/src/main/resources/static/page/flight/addFlight.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
考勤列表
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
64 |
65 |
75 |
76 |
101 |
102 |
103 |
--------------------------------------------------------------------------------
/src/main/resources/static/page/flight/editFlight.js:
--------------------------------------------------------------------------------
1 | layui.use(['form','layer','layedit','laydate','upload'],function(){
2 | var form = layui.form
3 | layer = parent.layer === undefined ? layui.layer : top.layer,
4 | laypage = layui.laypage,
5 | upload = layui.upload,
6 | layedit = layui.layedit,
7 | laydate = layui.laydate,
8 | $ = layui.jquery;
9 |
10 | //用于同步编辑器内容到textarea
11 | layedit.sync(editIndex);
12 |
13 |
14 | //格式化时间
15 | function filterTime(val){
16 | if(val < 10){
17 | return "0" + val;
18 | }else{
19 | return val;
20 | }
21 | }
22 |
23 |
24 | //创建一个编辑器
25 | var editIndex = layedit.build('news_content',{
26 | height : 535,
27 | uploadImage : {
28 | url : "../../json/newsImg.json"
29 | }
30 | });
31 |
32 |
33 |
34 | })
--------------------------------------------------------------------------------
/src/main/resources/static/page/flight/flightList.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
47 |
48 |
49 |
50 |
--------------------------------------------------------------------------------
/src/main/resources/static/page/flight/flightList.js:
--------------------------------------------------------------------------------
1 | layui.use(['form','layer','laydate','table','laytpl'],function(){
2 | var form = layui.form,
3 | layer = parent.layer === undefined ? layui.layer : top.layer,
4 | $ = layui.jquery,
5 | laydate = layui.laydate,
6 | laytpl = layui.laytpl,
7 | table = layui.table;
8 |
9 | //新闻列表
10 | var tableIns = table.render({
11 | elem: '#flightList',
12 | url : '/findAllFlight',
13 | cellMinWidth : 95,
14 | page : true,
15 | height : "full-100",
16 | limit : 20,
17 | limits:[10,15,20,25],
18 | id : "flightListTable",
19 | cols:[[
20 | {type: 'checkbox', fixed:'left', },
21 | {type:'numbers',title:'序号'},
22 | {field: 'flightId', title: 'ID', width:80, align:"center"},
23 | {field: 'flightPrice', title: '价格',width:80,align:"center"},
24 | {field: 'flightSeats', title: '座位数',align:'center'},
25 | {field: 'flightFromCity', title: '出发地',align:'center'},
26 | {field: 'flightToCity', title: '目的地',width:120, align:'center'},
27 | {title: '操作', templet:'#flightOperate',width:120,fixed:"right",align:"center"}
28 | ]]
29 | });
30 |
31 | function addFlight(){
32 | var index = layui.layer.open({
33 | title : "添加航班",
34 | type : 2,
35 | content : "addFlight.html",
36 | })
37 | layui.layer.full(index);
38 | //改变窗口大小时,重置弹窗的宽高,防止超出可视区域(如F12调出debug的操作)
39 | $(window).on("resize",function(){
40 | layui.layer.full(index);
41 | })
42 | }
43 |
44 |
45 | $(".addFlight_btn").click(function(){
46 | addFlight();
47 | })
48 |
49 |
50 | //编辑机票
51 | function editFlight(edit){
52 | var index = layui.layer.open({
53 | title : "编辑",
54 | type : 2,
55 | content : "editFlight.html",
56 | success : function(layero, index){
57 | var body = layui.layer.getChildFrame('body', index);
58 | if(edit){
59 | body.find(".flightId").val(edit.flightId);
60 | body.find(".flightPrice").val(edit.flightPrice);
61 | body.find(".flightSeats").val(edit.flightSeats);
62 | body.find(".flightFromCity").val(edit.flightFromCity);
63 | body.find(".flightToCity").val(edit.flightToCity);
64 |
65 | form.render();
66 | }
67 | setTimeout(function(){
68 | layui.layer.tips('点击此处返回机票列表', '.layui-layer-setwin .layui-layer-close', {
69 | tips: 3
70 | });
71 | },500)
72 | }
73 | })
74 | layui.layer.full(index);
75 | //改变窗口大小时,重置弹窗的宽高,防止超出可视区域(如F12调出debug的操作)
76 | $(window).on("resize",function(){
77 | layui.layer.full(index);
78 | })
79 | }
80 |
81 | //列表操作
82 | table.on('tool(flightList)', function(obj){
83 | var layEvent = obj.event,
84 | data = obj.data;
85 |
86 | if(layEvent === 'edit'){ //编辑
87 |
88 | editFlight(data);
89 |
90 | } else if(layEvent === 'del'){ //删除
91 | layer.confirm('确定删除此机票?',{icon:3, title:'提示信息'},function(index){
92 | $.post("/deleteFlightById",{
93 | id : data.flightId //将需要删除的newsId作为参数传入
94 | },function(data){
95 | // tableIns.reload();
96 | layer.close(index);
97 | layer.msg("权限不够!");
98 |
99 | })
100 | });
101 | } else if(layEvent === 'look'){ //预览
102 | layer.alert("此功能需要前台展示,实际开发中传入对应的必要参数进行文章内容页面访问")
103 | }
104 | });
105 |
106 |
107 | })
--------------------------------------------------------------------------------
/src/main/resources/static/page/hotel/addHotel.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
考勤列表
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
64 |
65 |
75 |
76 |
101 |
102 |
103 |
--------------------------------------------------------------------------------
/src/main/resources/static/page/hotel/editHotel.js:
--------------------------------------------------------------------------------
1 | layui.use(['form','layer','layedit','laydate','upload'],function(){
2 | var form = layui.form
3 | layer = parent.layer === undefined ? layui.layer : top.layer,
4 | laypage = layui.laypage,
5 | upload = layui.upload,
6 | layedit = layui.layedit,
7 | laydate = layui.laydate,
8 | $ = layui.jquery;
9 |
10 | //用于同步编辑器内容到textarea
11 | layedit.sync(editIndex);
12 |
13 |
14 | //格式化时间
15 | function filterTime(val){
16 | if(val < 10){
17 | return "0" + val;
18 | }else{
19 | return val;
20 | }
21 | }
22 |
23 | //预览
24 | form.on("submit(look)",function(){
25 | layer.alert("此功能需要前台展示,实际开发中传入对应的必要参数进行文章内容页面访问");
26 | return false;
27 | })
28 |
29 | //创建一个编辑器
30 | var editIndex = layedit.build('news_content',{
31 | height : 535,
32 | uploadImage : {
33 | url : "../../json/newsImg.json"
34 | }
35 | });
36 |
37 |
38 |
39 |
40 | })
--------------------------------------------------------------------------------
/src/main/resources/static/page/hotel/hotelList.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
47 |
48 |
49 |
50 |
--------------------------------------------------------------------------------
/src/main/resources/static/page/hotel/hotelList.js:
--------------------------------------------------------------------------------
1 | layui.use(['form','layer','laydate','table','laytpl'],function(){
2 | var form = layui.form,
3 | layer = parent.layer === undefined ? layui.layer : top.layer,
4 | $ = layui.jquery,
5 | laydate = layui.laydate,
6 | laytpl = layui.laytpl,
7 | table = layui.table;
8 |
9 | //新闻列表
10 | var tableIns = table.render({
11 | elem: '#hotelList',
12 | url : '/findAllHotel',
13 | cellMinWidth : 95,
14 | page : true,
15 | height : "full-100",
16 | limit : 20,
17 | limits:[10,15,20,25],
18 | id : "hotelListTable",
19 | cols:[[
20 | {type: 'checkbox', fixed:'left', },
21 | {type:'numbers',title:'序号'},
22 | {field: 'hotelId', title: 'ID', width:80, align:"center"},
23 | {field: 'hotelName', title: '酒店名',width:80,align:"center"},
24 | {field: 'hotelPrice', title: '价格',align:'center'},
25 | {field: 'hotelLocation', title: '地址',align:'center'},
26 | {field: 'hotelRooms', title: '房间数',width:120, align:'center'},
27 | {title: '操作', templet:'#hotelOperate',width:120,fixed:"right",align:"center"}
28 | ]]
29 | });
30 |
31 |
32 | //编辑机票
33 | function editHotel(edit){
34 | var index = layui.layer.open({
35 | title : "编辑",
36 | type : 2,
37 | content : "editHotel.html",
38 | success : function(layero, index){
39 | var body = layui.layer.getChildFrame('body', index);
40 | if(edit){
41 | body.find(".hotelId").val(edit.hotelId);
42 | body.find(".hotelName").val(edit.hotelName);
43 | body.find(".hotelPrice").val(edit.hotelPrice);
44 | body.find(".hotelLocation").val(edit.hotelLocation);
45 | body.find(".hotelRooms").val(edit.hotelRooms);
46 |
47 | form.render();
48 | }
49 | setTimeout(function(){
50 | layui.layer.tips('点击此处返回酒店列表', '.layui-layer-setwin .layui-layer-close', {
51 | tips: 3
52 | });
53 | },500)
54 | }
55 | })
56 | layui.layer.full(index);
57 | //改变窗口大小时,重置弹窗的宽高,防止超出可视区域(如F12调出debug的操作)
58 | $(window).on("resize",function(){
59 | layui.layer.full(index);
60 | })
61 | }
62 |
63 | //添加酒店
64 | function addHotel(){
65 | var index = layui.layer.open({
66 | title : "添加酒店",
67 | type : 2,
68 | content : "addHotel.html",
69 | })
70 | layui.layer.full(index);
71 | //改变窗口大小时,重置弹窗的宽高,防止超出可视区域(如F12调出debug的操作)
72 | $(window).on("resize",function(){
73 | layui.layer.full(index);
74 | })
75 | }
76 |
77 |
78 | $(".addHotel_btn").click(function(){
79 | addHotel();
80 | })
81 |
82 | //列表操作
83 | table.on('tool(hotelList)', function(obj){
84 | var layEvent = obj.event,
85 | data = obj.data;
86 |
87 | if(layEvent === 'edit'){ //编辑
88 |
89 | editHotel(data);
90 |
91 | } else if(layEvent === 'del'){ //删除
92 | layer.confirm('确定删除此酒店?',{icon:3, title:'提示信息'},function(index){
93 | $.post("/deleteHotelById",{
94 | id : data.hotelId //将需要删除的newsId作为参数传入
95 | },function(data){
96 | // tableIns.reload();
97 | layer.close(index);
98 | layer.msg("权限不够!");
99 |
100 | })
101 | });
102 | } else if(layEvent === 'look'){ //预览
103 | layer.alert("此功能需要前台展示,实际开发中传入对应的必要参数进行文章内容页面访问")
104 | }
105 | });
106 |
107 |
108 | })
--------------------------------------------------------------------------------
/src/main/resources/static/page/login/login.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
登录--旅游管理系统
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 | 旅游后台管理系统
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
47 |
48 |
49 |
50 |
51 |
52 |
--------------------------------------------------------------------------------
/src/main/resources/static/page/login/login.js:
--------------------------------------------------------------------------------
1 | layui.use(['form','layer','jquery'],function(){
2 | var form = layui.form,
3 | layer = parent.layer === undefined ? layui.layer : top.layer
4 | $ = layui.jquery;
5 |
6 | $(".loginBody .seraph").click(function(){
7 | layer.msg("这只是做个样式,至于功能,你见过哪个后台能这样登录的?还是老老实实的找管理员去注册吧",{
8 | time:5000
9 | });
10 | })
11 |
12 | //登录按钮
13 | form.on("submit(login)",function(data){
14 | $(this).text("登录中...").attr("disabled","disabled").addClass("layui-disabled");
15 |
16 | $.ajax({
17 | type: "POST",
18 | url: "/login",
19 | data: data.field,
20 | success: function(msg){
21 | if(msg.msg=="success"){
22 | localStorage.setItem("admin",data.field.userName);
23 | location.href="/index.html";
24 | layer.msg("登录成功!")
25 | }else{
26 | $(".login").text("登录")
27 | $(".login").removeAttr("disabled");
28 | $(".login").removeClass("layui-disabled");
29 |
30 | layer.msg("密码错误!")
31 | }
32 | }
33 | });
34 |
35 |
36 | })
37 |
38 | //表单输入效果
39 | $(".loginBody .input-item").click(function(e){
40 | e.stopPropagation();
41 | $(this).addClass("layui-input-focus").find(".layui-input").focus();
42 | })
43 | $(".loginBody .layui-form-item .layui-input").focus(function(){
44 | $(this).parent().addClass("layui-input-focus");
45 | })
46 | $(".loginBody .layui-form-item .layui-input").blur(function(){
47 | $(this).parent().removeClass("layui-input-focus");
48 | if($(this).val() != ''){
49 | $(this).parent().addClass("layui-input-active");
50 | }else{
51 | $(this).parent().removeClass("layui-input-active");
52 | }
53 | })
54 | })
55 |
--------------------------------------------------------------------------------
/src/main/resources/static/page/main.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
首页--layui后台管理模板 2.0
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
系统基本参数
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 | 当前版本 |
32 | |
33 |
34 |
35 | 开发作者 |
36 | |
37 |
38 |
39 | 网站首页 |
40 | |
41 |
42 |
43 | 技术栈 |
44 | |
45 |
46 |
47 | 数据库版本 |
48 | |
49 |
50 |
51 |
52 | 当前用户权限 |
53 | |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
--------------------------------------------------------------------------------
/src/main/resources/static/page/message/addMessage.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
考勤列表
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
29 |
30 |
36 |
37 |
38 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
69 |
70 |
95 |
96 |
97 |
--------------------------------------------------------------------------------
/src/main/resources/static/page/message/editMessage.js:
--------------------------------------------------------------------------------
1 | layui.use(['form','layer','layedit','laydate','upload'],function(){
2 | var form = layui.form
3 | layer = parent.layer === undefined ? layui.layer : top.layer,
4 | laypage = layui.laypage,
5 | upload = layui.upload,
6 | layedit = layui.layedit,
7 | laydate = layui.laydate,
8 | $ = layui.jquery;
9 |
10 | //用于同步编辑器内容到textarea
11 | layedit.sync(editIndex);
12 |
13 | //上传缩略图
14 | upload.render({
15 | elem: '.thumbBox',
16 | url: '../../json/userface.json',
17 | method : "get", //此处是为了演示之用,实际使用中请将此删除,默认用post方式提交
18 | done: function(res, index, upload){
19 | var num = parseInt(4*Math.random()); //生成0-4的随机数,随机显示一个头像信息
20 | $('.thumbImg').attr('src',res.data[num].src);
21 | $('.thumbBox').css("background","#fff");
22 | }
23 | });
24 |
25 | //格式化时间
26 | function filterTime(val){
27 | if(val < 10){
28 | return "0" + val;
29 | }else{
30 | return val;
31 | }
32 | }
33 | //定时发布
34 | var time = new Date();
35 | var submitTime = time.getFullYear()+'-'+filterTime(time.getMonth()+1)+'-'+filterTime(time.getDate())+' '+filterTime(time.getHours())+':'+filterTime(time.getMinutes())+':'+filterTime(time.getSeconds());
36 | laydate.render({
37 | elem: '#release',
38 | type: 'datetime',
39 | trigger : "click",
40 | done : function(value, date, endDate){
41 | submitTime = value;
42 | }
43 | });
44 | form.on("radio(release)",function(data){
45 | if(data.elem.title == "定时发布"){
46 | $(".releaseDate").removeClass("layui-hide");
47 | $(".releaseDate #release").attr("lay-verify","required");
48 | }else{
49 | $(".releaseDate").addClass("layui-hide");
50 | $(".releaseDate #release").removeAttr("lay-verify");
51 | submitTime = time.getFullYear()+'-'+(time.getMonth()+1)+'-'+time.getDate()+' '+time.getHours()+':'+time.getMinutes()+':'+time.getSeconds();
52 | }
53 | });
54 |
55 | form.verify({
56 | newsName : function(val){
57 | if(val == ''){
58 | return "文章标题不能为空";
59 | }
60 | },
61 | content : function(val){
62 | if(val == ''){
63 | return "文章内容不能为空";
64 | }
65 | }
66 | })
67 | form.on("submit(addNews)",function(data){
68 | //截取文章内容中的一部分文字放入文章摘要
69 | var abstract = layedit.getText(editIndex).substring(0,50);
70 | //弹出loading
71 | var index = top.layer.msg('数据提交中,请稍候',{icon: 16,time:false,shade:0.8});
72 | // 实际使用时的提交信息
73 | // $.post("上传路径",{
74 | // newsName : $(".newsName").val(), //文章标题
75 | // abstract : $(".abstract").val(), //文章摘要
76 | // content : layedit.getContent(editIndex).split('
')[0], //文章内容
77 | // newsImg : $(".thumbImg").attr("src"), //缩略图
78 | // classify : '1', //文章分类
79 | // newsStatus : $('.newsStatus select').val(), //发布状态
80 | // newsTime : submitTime, //发布时间
81 | // newsTop : data.filed.newsTop == "on" ? "checked" : "", //是否置顶
82 | // },function(res){
83 | //
84 | // })
85 | setTimeout(function(){
86 | top.layer.close(index);
87 | top.layer.msg("文章添加成功!");
88 | layer.closeAll("iframe");
89 | //刷新父页面
90 | parent.location.reload();
91 | },500);
92 | return false;
93 | })
94 |
95 | //预览
96 | form.on("submit(look)",function(){
97 | layer.alert("此功能需要前台展示,实际开发中传入对应的必要参数进行文章内容页面访问");
98 | return false;
99 | })
100 |
101 | //创建一个编辑器
102 | var editIndex = layedit.build('news_content',{
103 | height : 535,
104 | uploadImage : {
105 | url : "../../json/newsImg.json"
106 | }
107 | });
108 |
109 | })
--------------------------------------------------------------------------------
/src/main/resources/static/page/message/messageList.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
搜索
26 |
27 |
28 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
45 |
46 |
47 |
48 |
49 |
--------------------------------------------------------------------------------
/src/main/resources/static/page/scenery/addScenery.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
考勤列表
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
29 |
30 |
36 |
37 |
43 |
44 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
75 |
76 |
101 |
102 |
103 |
--------------------------------------------------------------------------------
/src/main/resources/static/page/scenery/editScenery.js:
--------------------------------------------------------------------------------
1 | layui.use(['form','layer','layedit','laydate','upload'],function(){
2 | var form = layui.form
3 | layer = parent.layer === undefined ? layui.layer : top.layer,
4 | laypage = layui.laypage,
5 | upload = layui.upload,
6 | layedit = layui.layedit,
7 | laydate = layui.laydate,
8 | $ = layui.jquery;
9 |
10 | //用于同步编辑器内容到textarea
11 | layedit.sync(editIndex);
12 |
13 |
14 | //格式化时间
15 | function filterTime(val){
16 | if(val < 10){
17 | return "0" + val;
18 | }else{
19 | return val;
20 | }
21 | }
22 |
23 | //预览
24 | form.on("submit(look)",function(){
25 | layer.alert("此功能需要前台展示,实际开发中传入对应的必要参数进行文章内容页面访问");
26 | return false;
27 | })
28 |
29 | //创建一个编辑器
30 | var editIndex = layedit.build('news_content',{
31 | height : 535,
32 | uploadImage : {
33 | url : "../../json/newsImg.json"
34 | }
35 | });
36 |
37 |
38 |
39 |
40 | })
--------------------------------------------------------------------------------
/src/main/resources/static/page/scenery/sceneryList.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
搜索
27 |
28 |
29 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
43 |
44 |
45 |
46 |
47 |
--------------------------------------------------------------------------------
/src/main/resources/static/page/scenery/sceneryList.js:
--------------------------------------------------------------------------------
1 | layui.use(['form','layer','laydate','table','laytpl'],function(){
2 | var form = layui.form,
3 | layer = parent.layer === undefined ? layui.layer : top.layer,
4 | $ = layui.jquery,
5 | laydate = layui.laydate,
6 | laytpl = layui.laytpl,
7 | table = layui.table;
8 |
9 | //新闻列表
10 | var tableIns = table.render({
11 | elem: '#sceneryList',
12 | url : '/findAll',
13 | cellMinWidth : 95,
14 | page : true,
15 | height : "full-100",
16 | limit : 20,
17 | limits:[10,15,20,25],
18 | id : "sceneryListTable",
19 | cols:[[
20 | {type: 'checkbox', fixed:'left', },
21 | {type:'numbers',title:'序号'},
22 | {field: 'sceneryId', title: 'ID', width:80, align:"center"},
23 | {field: 'sceneryCity', title: '城市',width:80,align:"center"},
24 | {field: 'sceneryTitle', title: '标题',align:'center'},
25 | {field: 'sceneryIntroduce', title: '介绍',align:'center',hide:true},
26 | {field: 'sceneryPrice', title: '价格',width:120, align:'center'},
27 | {field: 'sceneryRoute', title: '路线', align:'center'},
28 | {title: '操作', templet:'#sceneryOperate',width:120,fixed:"right",align:"center"}
29 | ]]
30 | });
31 |
32 | //添加景点
33 | function addScenery(){
34 | var index = layui.layer.open({
35 | title : "添加景点",
36 | type : 2,
37 | content : "addScenery.html",
38 | })
39 | layui.layer.full(index);
40 | //改变窗口大小时,重置弹窗的宽高,防止超出可视区域(如F12调出debug的操作)
41 | $(window).on("resize",function(){
42 | layui.layer.full(index);
43 | })
44 | }
45 |
46 |
47 | $(".addScenery_btn").click(function(){
48 | addScenery();
49 | })
50 |
51 |
52 | //编辑景点
53 | function editScenery(edit){
54 | var index = layui.layer.open({
55 | title : "编辑",
56 | type : 2,
57 | content : "editScenery.html",
58 | success : function(layero, index){
59 | var body = layui.layer.getChildFrame('body', index);
60 | if(edit){
61 | body.find(".sceneryId").val(edit.sceneryId);
62 | body.find(".sceneryCity").val(edit.sceneryCity);
63 | body.find(".sceneryTitle").val(edit.sceneryTitle);
64 | body.find(".sceneryPrice").val(edit.sceneryPrice);
65 | body.find(".sceneryRoute").val(edit.sceneryRoute);
66 | body.find(".sceneryIntroduce").val(edit.sceneryIntroduce);
67 |
68 | form.render();
69 | }
70 | setTimeout(function(){
71 | layui.layer.tips('点击此处返回景点列表', '.layui-layer-setwin .layui-layer-close', {
72 | tips: 3
73 | });
74 | },500)
75 | }
76 | })
77 | layui.layer.full(index);
78 | //改变窗口大小时,重置弹窗的宽高,防止超出可视区域(如F12调出debug的操作)
79 | $(window).on("resize",function(){
80 | layui.layer.full(index);
81 | })
82 | }
83 |
84 | //列表操作
85 | table.on('tool(sceneryList)', function(obj){
86 | var layEvent = obj.event,
87 | data = obj.data;
88 |
89 | if(layEvent === 'edit'){ //编辑
90 |
91 | editScenery(data);
92 |
93 | } else if(layEvent === 'del'){ //删除
94 | layer.confirm('确定删除此景点?',{icon:3, title:'提示信息'},function(index){
95 | $.post("/deleteSceneryById",{
96 | id : data.sceneryId //将需要删除的newsId作为参数传入
97 | },function(data){
98 | // tableIns.reload();
99 | layer.close(index);
100 | layer.msg("权限不够!");
101 |
102 | })
103 | });
104 | } else if(layEvent === 'look'){ //预览
105 | layer.alert("此功能需要前台展示,实际开发中传入对应的必要参数进行文章内容页面访问")
106 | }
107 | });
108 |
109 |
110 | })
--------------------------------------------------------------------------------
/src/main/resources/static/page/user/addUser.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
考勤列表
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
31 |
32 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
63 |
64 |
92 |
93 |
94 |
--------------------------------------------------------------------------------
/src/main/resources/static/page/user/editUser.js:
--------------------------------------------------------------------------------
1 | layui.use(['form','layer','layedit','laydate','upload'],function(){
2 | var form = layui.form
3 | layer = parent.layer === undefined ? layui.layer : top.layer,
4 | laypage = layui.laypage,
5 | upload = layui.upload,
6 | layedit = layui.layedit,
7 | laydate = layui.laydate,
8 | $ = layui.jquery;
9 |
10 | //用于同步编辑器内容到textarea
11 | layedit.sync(editIndex);
12 |
13 | //上传缩略图
14 | upload.render({
15 | elem: '.thumbBox',
16 | url: '../../json/userface.json',
17 | method : "get", //此处是为了演示之用,实际使用中请将此删除,默认用post方式提交
18 | done: function(res, index, upload){
19 | var num = parseInt(4*Math.random()); //生成0-4的随机数,随机显示一个头像信息
20 | $('.thumbImg').attr('src',res.data[num].src);
21 | $('.thumbBox').css("background","#fff");
22 | }
23 | });
24 |
25 | //格式化时间
26 | function filterTime(val){
27 | if(val < 10){
28 | return "0" + val;
29 | }else{
30 | return val;
31 | }
32 | }
33 | //定时发布
34 | var time = new Date();
35 | var submitTime = time.getFullYear()+'-'+filterTime(time.getMonth()+1)+'-'+filterTime(time.getDate())+' '+filterTime(time.getHours())+':'+filterTime(time.getMinutes())+':'+filterTime(time.getSeconds());
36 | laydate.render({
37 | elem: '#release',
38 | type: 'datetime',
39 | trigger : "click",
40 | done : function(value, date, endDate){
41 | submitTime = value;
42 | }
43 | });
44 |
45 |
46 |
47 | //预览
48 | form.on("submit(look)",function(){
49 | layer.alert("此功能需要前台展示,实际开发中传入对应的必要参数进行文章内容页面访问");
50 | return false;
51 | })
52 |
53 | //创建一个编辑器
54 | var editIndex = layedit.build('news_content',{
55 | height : 535,
56 | uploadImage : {
57 | url : "../../json/newsImg.json"
58 | }
59 | });
60 |
61 | })
--------------------------------------------------------------------------------
/src/main/resources/static/page/user/userEdit.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
考勤列表
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
30 |
31 |
32 |
38 |
39 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
70 |
71 |
98 |
99 |
100 |
--------------------------------------------------------------------------------
/src/main/resources/static/page/user/userList.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
layui后台管理模板 2.0
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
搜索
26 |
27 |
28 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
44 |
45 |
46 |
47 |
48 |
--------------------------------------------------------------------------------
/src/test/java/com/test/tourism/TourismApplicationTests.java:
--------------------------------------------------------------------------------
1 | package com.test.tourism;
2 |
3 | import org.junit.jupiter.api.Test;
4 | import org.springframework.beans.factory.annotation.Autowired;
5 | import org.springframework.boot.test.context.SpringBootTest;
6 |
7 | import javax.sql.DataSource;
8 | import java.sql.SQLException;
9 |
10 | @SpringBootTest
11 | class TourismApplicationTests {
12 |
13 | @Autowired
14 | DataSource dataSource;
15 |
16 | @Test
17 | void contextLoads() throws SQLException {
18 | System.out.println(dataSource.getClass());
19 | System.out.println(dataSource.getConnection());
20 | }
21 |
22 | }
23 |
--------------------------------------------------------------------------------
/截屏2020-01-14下午8.21.33.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kangyuxin/tourism/bc892f8ad3cd241951e7e9510be39ee61c5a4941/截屏2020-01-14下午8.21.33.png
--------------------------------------------------------------------------------
/截屏2020-01-14下午8.29.45.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kangyuxin/tourism/bc892f8ad3cd241951e7e9510be39ee61c5a4941/截屏2020-01-14下午8.29.45.png
--------------------------------------------------------------------------------
/截屏2020-02-28下午2.24.23.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kangyuxin/tourism/bc892f8ad3cd241951e7e9510be39ee61c5a4941/截屏2020-02-28下午2.24.23.png
--------------------------------------------------------------------------------
/截屏2020-02-28下午2.29.44.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kangyuxin/tourism/bc892f8ad3cd241951e7e9510be39ee61c5a4941/截屏2020-02-28下午2.29.44.png
--------------------------------------------------------------------------------