1.dao包定义dao类(定义@mapper注解)
2.entity包中定义实体类(BaseEntity没有的属性定义@Override)
3.enums枚举定义
4.services包定义(@services注解)
5.controller包定义类(@controller注解:处理http请求 -- @Autowaired:自动装配 -- @RequestMapper跳转页面路径)
6.webapp---WEB-INF.view -- 包名
1>list页面:
页面增加
var active = {
add: function () {
layer.open({
type: 2
, title: '添加'
, content: '/maintenance/bulletin/form'
, shade:0.8
, area: ['90%', '80%']
, btn: ['确定', '取消']
, yes: function (index, layero) {
var iframeWindow = window['layui-layer-iframe' + index]
, submitID = 'LAY-bulletin-submit'
, submit = layero.find('iframe').contents().find('#' + submitID);
//监听提交
iframeWindow.layui.form.on('submit(' + submitID + ')', function (data) {
var field = data.field;
alert(JSON.stringify(data))
// console.log(field) //在js页面查看值
// return false; //停止任何事
admin.req({
url: '/maintenance/bulletin/edit'
, type: 'post'
, data: field
, success: function (result) {
layer.msg(result.msg, {time: 2000, icon: 6});
table.reload('LAY-bulletin-table-list');
}, error: function (ex) {
layer.alert(ex);
}
});
layer.close(index);
});
submit.trigger('click');
}
});
},
reset: function () {
$('.layui-form input').val('');
$('.layui-form .layui-inline:last button:first').click();
}
};
$('.layui-btn.layuiadmin-btn-bulletin').on('click', function () {
var type = $(this).data('type');
active[type] ? active[type].call(this) : '';
});
js文件