Page layout and db upgrade

This commit is contained in:
devezhao-mac 2019-03-29 02:05:39 +08:00
parent 2ec7567336
commit b8615008ca
10 changed files with 95 additions and 25 deletions

View file

@ -10,5 +10,6 @@
".eclipse/**": true
},
"eslint.autoFixOnSave": true,
"editor.fontSize": 12
"editor.fontSize": 12,
"editor.formatOnSave": true
}

View file

@ -1,6 +1,34 @@
-- Database upgrade scripts for rebuild 1.x
-- Each upgraded starts with `-- #VERSION`
-- #2 for Classification field
create table if not exists `classification` (
`MODIFIED_ON` timestamp not null default '0000-00-00 00:00:00' comment '修改时间',
`DATA_ID` char(20) not null,
`CREATED_BY` char(20) not null comment '创建人',
`NAME` varchar(100) not null,
`DESCRIPTION` varchar(600),
`MODIFIED_BY` char(20) not null comment '修改人',
`IS_DISABLED` char(1) default 'F',
`CREATED_ON` timestamp not null default '0000-00-00 00:00:00' comment '创建时间',
primary key (`DATA_ID`)
)Engine=InnoDB;
create table if not exists `classification_data` (
`ITEM_ID` char(20) not null,
`PARENT` char(20),
`MODIFIED_ON` timestamp not null default '0000-00-00 00:00:00' comment '修改时间',
`CODE` varchar(50),
`DATA_ID` char(20) not null,
`CREATED_BY` char(20) not null comment '创建人',
`NAME` varchar(100) not null,
`FULL_NAME` varchar(200) not null comment '父级fullName+fullName',
`MODIFIED_BY` char(20) not null comment '修改人',
`CREATED_ON` timestamp not null default '0000-00-00 00:00:00' comment '创建时间',
primary key (`ITEM_ID`)
)Engine=InnoDB;
alter table `classification_data`
add index `IX1_classification_data` (`DATA_ID`, `PARENT`, `NAME`, `FULL_NAME`);
-- #1 Add LoginLog table (v1.1)
create table if not exists `login_log` (
`LOGOUT_TIME` timestamp null default '0000-00-00 00:00:00' comment '退出时间',

View file

@ -5,39 +5,49 @@
<%@ include file="/_include/Head.jsp"%>
<title>分类数据编辑</title>
<style type="text/css">
.level-box .col-md-3>ol {
border:2px solid #eee;
padding: 0 5px;
margin-bottom: 15px;
}
.level-boxes .col-md-3{margin-top:15px}
.level-boxes .col-md-3 ol{background-color:#eee;padding:1px 5px;border-radius:3px}
.level-boxes .col-md-3 h5{margin-top:3px}
.level-boxes .col-md-3.off>form,.level-boxes .col-md-3.off>ol{display:none;}
.level-boxes .col-md-3:first-child .turn-on{display:none;}
</style>
</head>
<body>
<div class="rb-wrapper rb-fixed-sidebar rb-collapsible-sidebar rb-collapsible-sidebar-hide-logo rb-color-header">
<jsp:include page="/_include/NavTop.jsp">
<jsp:param value="审计日志" name="pageTitle"/>
<jsp:param value="分类数据编辑" name="pageTitle"/>
</jsp:include>
<jsp:include page="/_include/NavLeftAdmin.jsp">
<jsp:param value="classifications" name="activeNav"/>
</jsp:include>
<div class="rb-content">
<div class="page-head">
<div class="page-head-title">分类数据编辑</div>
<div class="float-left"><div class="page-head-title">分类数据编辑</div></div>
<div class="float-right pt-1">
<button class="btn btn-primary J_save" type="button">保存</button>
</div>
<div class="clearfix"></div>
</div>
<div class="main-content container-fluid pt-1">
<div class="card">
<div class="card-body">
<div class="row level-box">
<div class="row level-boxes">
<div class="col-md-3">
<h5>一级分类</h5>
<ol class="dd-list unset-list">
</ol>
<form>
<div class="float-left"><h5>一级分类</h5></div>
<div class="float-right turn-on">
<div class="switch-button switch-button-xs">
<input type="checkbox" id="trunOn1">
<span><label for="trunOn1" title="启用/禁用"></label></span>
</div>
</div>
<div class="clearfix"></div>
<form class="mt-1">
<div class="input-group input-group-sm">
<input class="form-control J_name" type="text" maxlength="40">
<input class="form-control J_name" type="text" maxlength="50">
<div class="input-group-append"><button class="btn btn-secondary J_confirm" type="submit">添加</button></div>
</div>
</form>
<ol class="dd-list unset-list mt-3"></ol>
</div>
</div>
</div>

View file

@ -18,7 +18,11 @@
</jsp:include>
<div class="rb-content">
<div class="page-head">
<div class="page-head-title">分类数据</div>
<div class="float-left"><div class="page-head-title">分类数据</div></div>
<div class="float-right pt-1">
<button class="btn btn-light J_add" type="button">新建</button>
</div>
<div class="clearfix"></div>
</div>
<div class="main-content container-fluid">
<button class="J_add">添加</button>

View file

@ -54,7 +54,7 @@ $(document).ready(function(){
let forNew = render_entity({ icon: 'plus', entityLabel: '新建实体', comments: '新建一个实体' })
forNew.find('a.card').attr('href', 'javascript:;').click(function(){
if (window.__PageConfig.isSuperAdmin) rb.modal(rb.baseUrl + '/admin/p/entity/entity-new', '新建实体')
if (window.__PageConfig.isSuperAdmin) rb.modal(rb.baseUrl + '/admin/p/entityhub/entity-new', '新建实体')
else rb.hberror('仅超级管理员可新建实体')
})
})

View file

@ -106,7 +106,7 @@ $(document).ready(function(){
})
$('.J_new-field').click(function(){
if (window.__PageConfig.isSuperAdmin) rb.modal('${baseUrl}/admin/p/entity/field-new?entity=${entityName}', '新建字段')
if (window.__PageConfig.isSuperAdmin) rb.modal('${baseUrl}/admin/p/entityhub/field-new?entity=${entityName}', '新建字段')
else rb.hberror('仅超级管理员可新建字段')
})
});

View file

@ -1,9 +1,32 @@
/* eslint-disable no-undef */
$(document).ready(function () {
let boxTmpl = $('.level-box>.col-md-3')
init_levelbox(boxTmpl)
let tmplBox = $('.level-boxes>.col-md-3')
init_levelbox(tmplBox)
init_levelbox($(tmplBox.clone(false)).appendTo('.level-boxes'), 2)
init_levelbox($(tmplBox.clone(false)).appendTo('.level-boxes'), 3)
init_levelbox($(tmplBox.clone(false)).appendTo('.level-boxes'), 4)
})
var init_levelbox = function (box) {
const LNAME = { 1: '一级分类', 2: '二级分类', 3: '三级分类', 4: '四级分类' }
let init_levelbox = function (box, level) {
box.attr('data-level', level || 1)
if (level > 1) {
box.addClass('off')
box.find('h5').text(LNAME[level])
let newFor = 'trunOn' + level
box.find('.turn-on label').attr('for', newFor)
box.find('.turn-on input').attr('id', newFor).change(function () {
let chk = $(this).prop('checked') === true
for (let i = 2; i <= level; i++) {
let $box = $('.level-boxes>div[data-level=' + i + ']')
if (chk) $box.removeClass('off')
else $box.addClass('off')
}
})
}
box.find('.dd-list').sortable({
placeholder: 'dd-placeholder',
handle: '.dd-handle',
@ -23,4 +46,5 @@ var init_levelbox = function (box) {
// Over sortable.js
render_unset_after = function (item, data) {
item.off('click')
$('<div class="dd3-action"><a><i class="zmdi zmdi-edit"></i></a><a><i class="zmdi zmdi-close"></i></a></div>').appendTo(item)
}

View file

@ -80,7 +80,7 @@ $(document).ready(function () {
})
$('.J_picklist-edit').click(function () {
rb.modal(`${rb.baseUrl}/admin/p/entity/picklist-config?entity=${wpc.entityName}&field=${wpc.fieldName}`, '配置列表选项')
rb.modal(`${rb.baseUrl}/admin/p/entityhub/picklist-config?entity=${wpc.entityName}&field=${wpc.fieldName}`, '配置列表选项')
})
} else if (dt === 'SERIES' || wpc.fieldBuildin === true) {
$('#fieldNullable, #fieldUpdatable').attr('disabled', true)

View file

@ -47,9 +47,12 @@
</div>
</div>
</div>
<div class="splash-footer text-muted">
<span>&copy; 2019 <a href="https://getrebuild.com/" target="_blank">REBUILD</a></span>
<div class="dev-show" style="font-size:11px">Built on <%=ServerListener.getStartupTime()%> (<%=Application.VER%>)</div>
<div class="splash-footer">
<div class="mb-1">还没有账号? <a href="signup">立即注册</a></div>
<div class="text-muted">
<span>&copy; 2019 <a class="text-muted" href="https://getrebuild.com/" target="_blank">REBUILD</a></span>
<div class="dev-show" style="font-size:11px">Built on <%=ServerListener.getStartupTime()%> (<%=Application.VER%>)</div>
</div>
</div>
</div>
</div>

View file

@ -23,7 +23,7 @@
<input class="form-control" id="passwd" type="password" placeholder="登录密码">
</div>
<div class="form-group login-submit">
<button class="btn btn-primary btn-xl J_login-btn" disabled="disabled">未开放注册</button>
<button class="btn btn-primary btn-xl J_login-btn" disabled="disabled">自助注册未开放</button>
</div>
</div>
</div>