diff --git a/src/main/java/com/rebuild/server/bizz/privileges/SecurityManager.java b/src/main/java/com/rebuild/server/bizz/privileges/SecurityManager.java index ec4ec9391..8f5392a24 100644 --- a/src/main/java/com/rebuild/server/bizz/privileges/SecurityManager.java +++ b/src/main/java/com/rebuild/server/bizz/privileges/SecurityManager.java @@ -28,7 +28,6 @@ import cn.devezhao.bizz.privileges.Privileges; import cn.devezhao.bizz.privileges.impl.BizzDepthEntry; import cn.devezhao.bizz.privileges.impl.BizzPermission; import cn.devezhao.bizz.security.member.Role; -import cn.devezhao.bizz.security.member.User; import cn.devezhao.persist4j.engine.ID; /** @@ -71,8 +70,14 @@ public class SecurityManager { * @return */ public Privileges getPrivileges(ID user, int entity) { - Role role = USER_STORE.getUser(user).getOwningRole(); - return role.getPrivileges(entity); + User u = USER_STORE.getUser(user); + if (!u.isActive()) { + return Privileges.NONE; + } + if (u.isAdmin()) { + return Privileges.ROOT; + } + return u.getOwningRole().getPrivileges(entity); } /** diff --git a/src/main/webapp/assets/css/rb-page.css b/src/main/webapp/assets/css/rb-page.css index 73b8172c4..66eae547f 100644 --- a/src/main/webapp/assets/css/rb-page.css +++ b/src/main/webapp/assets/css/rb-page.css @@ -483,6 +483,7 @@ a { .data-list .table thead th>div { color: #555; position: relative; + text-overflow: ellipsis; } .data-list .table thead th>div>i { @@ -493,7 +494,7 @@ a { } .data-list .table thead th>div>i.split { - width: 6px; + width: 8px; border-right: 2px dotted #aaa; cursor: e-resize; } diff --git a/src/main/webapp/assets/js/rb-base.js b/src/main/webapp/assets/js/rb-base.js index abd933f6e..58af5984c 100644 --- a/src/main/webapp/assets/js/rb-base.js +++ b/src/main/webapp/assets/js/rb-base.js @@ -183,8 +183,23 @@ const $regex = { }; const $encode = function(s) { - return encodeURIComponent(s); + return encodeURIComponent(s) } const $decode = function(s) { - return decodeURIComponent(s); + return decodeURIComponent(s) +} + +const $storage = { + get(key){ + if (window.localStorage) return localStorage.getItem(key) + else return $.cookie(key) + }, + set(key, val){ + if (window.localStorage) localStorage.setItem(key, val) + else $.cookie(key, val, { expires:365 }) + }, + remove(key){ + if (window.localStorage) localStorage.removeItem(key) + else $.removeCookie(key) + } } \ No newline at end of file diff --git a/src/main/webapp/assets/js/rb-list.jsx b/src/main/webapp/assets/js/rb-list.jsx index c3d1e4c96..cd68613e6 100644 --- a/src/main/webapp/assets/js/rb-list.jsx +++ b/src/main/webapp/assets/js/rb-list.jsx @@ -2,7 +2,17 @@ class RbList extends React.Component { constructor(props) { super(props) + + this.__sortFieldKey = 'SortField-' + this.props.config.entity + this.__columnWidthKey = 'ColumnWidth-' + this.props.config.entity + '.' + + let sort = ($storage.get(this.__sortFieldKey) || ':').split(':') let fields = props.config.fields + for (let i = 0; i < fields.length; i++){ + let cw = $storage.get(this.__columnWidthKey + fields[i].field) + if (!!cw && ~~cw > 40) fields[i].width = ~~cw + if (sort[0] == fields[i].field) fields[i].sort = sort[1] + } props.config.fields = null this.state = { ...props, fields: fields, rowData: [], noData: false, checkedAll: false, pageNo: 1, pageSize: 20 } @@ -31,7 +41,7 @@ class RbList extends React.Component { let columnWidth = (item.width || that.__defaultColumnWidth) + 'px' let styles = { width: columnWidth } let sortClazz = item.sort || '' - return (