mirror of
https://github.com/getrebuild/rebuild.git
synced 2025-02-21 04:44:45 +08:00
配置项
This commit is contained in:
parent
873f5c28e7
commit
78029a2461
42 changed files with 457 additions and 225 deletions
55
src/main/java/com/rebuild/server/bizz/UserHelper.java
Normal file
55
src/main/java/com/rebuild/server/bizz/UserHelper.java
Normal file
|
@ -0,0 +1,55 @@
|
|||
/*
|
||||
rebuild - Building your system freely.
|
||||
Copyright (C) 2018 devezhao <zhaofang123@gmail.com>
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.rebuild.server.bizz;
|
||||
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
|
||||
import com.rebuild.server.ServerListener;
|
||||
import com.rebuild.server.bizz.privileges.User;
|
||||
import com.rebuild.server.helper.SystemProps;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author devezhao
|
||||
* @since 10/14/2018
|
||||
*/
|
||||
public class UserHelper {
|
||||
|
||||
/**
|
||||
* 显示名
|
||||
* @param user
|
||||
* @return
|
||||
*/
|
||||
public static String getShowName(User user) {
|
||||
return StringUtils.defaultIfBlank(user.getFullName(), user.getName());
|
||||
}
|
||||
|
||||
/**
|
||||
* 头像地址
|
||||
* @param user
|
||||
* @return
|
||||
*/
|
||||
public static String getAvatarUrl(User user) {
|
||||
String url = user.getAvatarUrl();
|
||||
if (StringUtils.isBlank(url)) {
|
||||
return ServerListener.getContextPath() + "/assets/img/afo.png";
|
||||
}
|
||||
return SystemProps.getStorageUrl() + url + "?imageView2/2/w/100/interlace/1/q/100";
|
||||
}
|
||||
}
|
|
@ -42,7 +42,7 @@ public class User extends cn.devezhao.bizz.security.member.User {
|
|||
super(userId, loginName, disabled);
|
||||
this.email = email;
|
||||
this.fullName = fullName;
|
||||
this.avatarUrl = avatarUrl;
|
||||
this.avatarUrl = "/assets/img/afo.png";
|
||||
}
|
||||
|
||||
public String getEmail() {
|
||||
|
|
|
@ -43,7 +43,7 @@ import cn.devezhao.persist4j.metadata.BaseMeta;
|
|||
* @author zhaofang123@gmail.com
|
||||
* @since 08/13/2018
|
||||
*/
|
||||
public class AccessibleMeta implements BaseMeta {
|
||||
public class EasyMeta implements BaseMeta {
|
||||
private static final long serialVersionUID = -6463919098111506968L;
|
||||
|
||||
public static final Set<String> BUILTIN_ENTITY = new HashSet<>();
|
||||
|
@ -72,7 +72,7 @@ public class AccessibleMeta implements BaseMeta {
|
|||
|
||||
private BaseMeta baseMeta;
|
||||
|
||||
public AccessibleMeta(BaseMeta baseMeta) {
|
||||
public EasyMeta(BaseMeta baseMeta) {
|
||||
this.baseMeta = baseMeta;
|
||||
}
|
||||
|
||||
|
@ -264,7 +264,7 @@ public class AccessibleMeta implements BaseMeta {
|
|||
* @return
|
||||
*/
|
||||
public static DisplayType getDisplayType(Field field) {
|
||||
return new AccessibleMeta(field).getDisplayType();
|
||||
return new EasyMeta(field).getDisplayType();
|
||||
}
|
||||
|
||||
/**
|
|
@ -39,7 +39,7 @@ public class AesPreferencesConfigurer extends PreferencesPlaceholderConfigurer {
|
|||
|
||||
private Properties propsHold = null;
|
||||
|
||||
protected void afterLoad(Properties props) {
|
||||
private void afterLoad(Properties props) {
|
||||
String kpass = AES.getPassKey();
|
||||
for (Object key : props.keySet()) {
|
||||
if (key.toString().contains(".aes")) {
|
||||
|
@ -50,10 +50,12 @@ public class AesPreferencesConfigurer extends PreferencesPlaceholderConfigurer {
|
|||
}
|
||||
|
||||
/**
|
||||
* 获取配置项
|
||||
*
|
||||
* @param key
|
||||
* @return
|
||||
*/
|
||||
public String getItem(String key) {
|
||||
return propsHold.getProperty(key);
|
||||
public String item(String name) {
|
||||
return propsHold.getProperty(name);
|
||||
}
|
||||
}
|
|
@ -16,13 +16,15 @@ You should have received a copy of the GNU General Public License
|
|||
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.rebuild.utils;
|
||||
package com.rebuild.server.helper;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.net.URL;
|
||||
|
||||
import org.apache.commons.io.FileUtils;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
|
||||
import com.qiniu.common.Zone;
|
||||
import com.qiniu.http.Response;
|
||||
|
@ -35,27 +37,35 @@ import cn.devezhao.commons.CalendarUtils;
|
|||
import cn.devezhao.commons.http4.HttpClientEx;
|
||||
|
||||
/**
|
||||
* 七牛云存储
|
||||
*
|
||||
* @author zhaofang123@gmail.com
|
||||
* @since 05/19/2018
|
||||
*/
|
||||
public class QiniuCloud {
|
||||
|
||||
private static final String ACCESS_KEY = "YCSTYJijko0gEoj84qx5NZjbshg2VzU7GE1l9FDe";
|
||||
private static final String SECRET_KEY = "u1keXSO5otlajgiOGyF0QRWhFIQfVDi1D5-yEXv4";
|
||||
private static final Log LOG = LogFactory.getLog(QiniuCloud.class);
|
||||
|
||||
private static final Auth AUTH = Auth.create(ACCESS_KEY, SECRET_KEY);
|
||||
private static final String BUCKET_NAME = "rb-cdn";
|
||||
private final UploadManager UPLOAD_MANAGER = new UploadManager(new Configuration(Zone.autoZone()));
|
||||
|
||||
private static final UploadManager UPLOAD_MANAGER = new UploadManager(new Configuration(Zone.autoZone()));
|
||||
private Auth auth;
|
||||
private String bucketName;
|
||||
|
||||
private QiniuCloud() {
|
||||
init();
|
||||
}
|
||||
|
||||
/**
|
||||
* 上传 Token
|
||||
*
|
||||
* @return
|
||||
* 初始化
|
||||
*/
|
||||
public static String getUpToken() {
|
||||
return AUTH.uploadToken(BUCKET_NAME);
|
||||
synchronized public void init() {
|
||||
String[] account = SystemProps.getStorageAccount();
|
||||
if (account != null) {
|
||||
this.auth = Auth.create(account[0], account[1]);
|
||||
this.bucketName = account[2];
|
||||
} else {
|
||||
LOG.error("云存储账户未配置,文件上传功能不可用");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -65,26 +75,34 @@ public class QiniuCloud {
|
|||
* @return
|
||||
* @throws IOException
|
||||
*/
|
||||
public static String upload(File file) throws IOException {
|
||||
public String upload(File file) throws IOException {
|
||||
if (auth == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
String key = String.format("rebuild/%s/%s",
|
||||
CalendarUtils.getPlainDateFormat().format(CalendarUtils.now()), file.getName());
|
||||
Response resp = UPLOAD_MANAGER.put(file, key, getUpToken());
|
||||
System.out.println(resp.bodyString());
|
||||
return key;
|
||||
Response resp = UPLOAD_MANAGER.put(file, key, auth.uploadToken(bucketName));
|
||||
if (resp.isOK()) {
|
||||
return key;
|
||||
} else {
|
||||
LOG.error("文件上传失败 : " + resp);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 文件上传
|
||||
* 从 URL 上传文件
|
||||
*
|
||||
* @param url
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
public static String upload(URL url) throws Exception {
|
||||
File tmp = AppUtils.getFileOfTemp("temp-" + System.currentTimeMillis());
|
||||
public String upload(URL url) throws Exception {
|
||||
File tmp = SystemProps.getFileOfTemp("temp-" + System.currentTimeMillis());
|
||||
boolean success = download(url, tmp);
|
||||
if (!success) {
|
||||
throw new RebuildException("无法读取源文件:" + url);
|
||||
throw new RebuildException("无法从 URL 读取文件 : " + url);
|
||||
}
|
||||
try {
|
||||
return upload(tmp);
|
||||
|
@ -101,9 +119,19 @@ public class QiniuCloud {
|
|||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
public static boolean download(URL url, File dest) throws Exception {
|
||||
byte[] bs = HttpClientEx.instance().readBinary(url.toString(), 30 * 1000);
|
||||
public boolean download(URL url, File dest) throws Exception {
|
||||
byte[] bs = HttpClientEx.instance().readBinary(url.toString(), 60 * 1000);
|
||||
FileUtils.writeByteArrayToFile(dest, bs);
|
||||
return true;
|
||||
}
|
||||
|
||||
// --
|
||||
|
||||
private static final QiniuCloud INSTANCE = new QiniuCloud();
|
||||
/**
|
||||
* @return
|
||||
*/
|
||||
public static QiniuCloud instance() {
|
||||
return INSTANCE;
|
||||
}
|
||||
}
|
60
src/main/java/com/rebuild/server/helper/SystemProps.java
Normal file
60
src/main/java/com/rebuild/server/helper/SystemProps.java
Normal file
|
@ -0,0 +1,60 @@
|
|||
/*
|
||||
rebuild - Building your system freely.
|
||||
Copyright (C) 2018 devezhao <zhaofang123@gmail.com>
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.rebuild.server.helper;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
import org.apache.commons.io.FileUtils;
|
||||
|
||||
/**
|
||||
* 系统配置
|
||||
*
|
||||
* @author devezhao
|
||||
* @since 10/14/2018
|
||||
*/
|
||||
public class SystemProps {
|
||||
|
||||
/**
|
||||
* @param file
|
||||
* @return
|
||||
*/
|
||||
public static File getFileOfTemp(String file) {
|
||||
return new File(FileUtils.getTempDirectory(), file);
|
||||
}
|
||||
|
||||
/**
|
||||
* 云存储地址
|
||||
* @return
|
||||
*/
|
||||
public static String getStorageUrl() {
|
||||
return "http://rb-cdn.errorpage.cn/";
|
||||
}
|
||||
|
||||
/**
|
||||
* 云存储账号
|
||||
* @return
|
||||
*/
|
||||
public static String[] getStorageAccount() {
|
||||
return new String[] {
|
||||
"YCSTYJijko0gEoj84qx5NZjbshg2VzU7GE1l9FDe",
|
||||
"u1keXSO5otlajgiOGyF0QRWhFIQfVDi1D5-yEXv4",
|
||||
"rb-cdn"
|
||||
};
|
||||
}
|
||||
}
|
|
@ -29,7 +29,7 @@ import org.apache.commons.logging.LogFactory;
|
|||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.rebuild.server.entityhub.AccessibleMeta;
|
||||
import com.rebuild.server.entityhub.EasyMeta;
|
||||
import com.rebuild.server.metadata.EntityHelper;
|
||||
import com.rebuild.server.metadata.MetadataHelper;
|
||||
|
||||
|
@ -66,7 +66,7 @@ public class DataListManager extends LayoutManager {
|
|||
if (entityMeta.containsField(EntityHelper.createdBy)) {
|
||||
columnList.add(warpColumn(entityMeta.getField(EntityHelper.createdBy)));
|
||||
}
|
||||
if (entityMeta.containsField(EntityHelper.createdOn)) {
|
||||
if (!nameField.getName().equals(EntityHelper.createdOn) && entityMeta.containsField(EntityHelper.createdOn)) {
|
||||
columnList.add(warpColumn(entityMeta.getField(EntityHelper.createdOn)));
|
||||
}
|
||||
} else {
|
||||
|
@ -99,7 +99,7 @@ public class DataListManager extends LayoutManager {
|
|||
* @return
|
||||
*/
|
||||
public static Map<String, Object> warpColumn(Field field) {
|
||||
AccessibleMeta easyMeta = new AccessibleMeta(field);
|
||||
EasyMeta easyMeta = new EasyMeta(field);
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
map.put("field", easyMeta.getName());
|
||||
map.put("label", easyMeta.getLabel());
|
||||
|
|
|
@ -23,7 +23,7 @@ import java.text.DecimalFormat;
|
|||
import org.apache.commons.lang.StringUtils;
|
||||
import org.springframework.util.Assert;
|
||||
|
||||
import com.rebuild.server.entityhub.AccessibleMeta;
|
||||
import com.rebuild.server.entityhub.EasyMeta;
|
||||
import com.rebuild.server.entityhub.DisplayType;
|
||||
import com.rebuild.server.metadata.MetadataHelper;
|
||||
|
||||
|
@ -44,7 +44,7 @@ public class FieldValueWrapper {
|
|||
* @param field
|
||||
* @return
|
||||
*/
|
||||
public static Object wrapFieldValue(Object value, AccessibleMeta field) {
|
||||
public static Object wrapFieldValue(Object value, EasyMeta field) {
|
||||
if (value == null || StringUtils.isBlank(value.toString())) {
|
||||
return StringUtils.EMPTY;
|
||||
}
|
||||
|
@ -81,7 +81,7 @@ public class FieldValueWrapper {
|
|||
* @param field
|
||||
* @return
|
||||
*/
|
||||
public static String wrapDate(Object date, AccessibleMeta field) {
|
||||
public static String wrapDate(Object date, EasyMeta field) {
|
||||
String format = field.getFieldExtConfig().getString("dateFormat");
|
||||
format = StringUtils.defaultIfEmpty(format, field.getDisplayType().getDefaultFormat());
|
||||
Assert.notNull(format, "No format : " + field.getBaseMeta());
|
||||
|
@ -93,7 +93,7 @@ public class FieldValueWrapper {
|
|||
* @param field
|
||||
* @return
|
||||
*/
|
||||
public static String wrapDatetime(Object date, AccessibleMeta field) {
|
||||
public static String wrapDatetime(Object date, EasyMeta field) {
|
||||
String format = field.getFieldExtConfig().getString("datetimeFormat");
|
||||
format = StringUtils.defaultIfEmpty(format, field.getDisplayType().getDefaultFormat());
|
||||
Assert.notNull(format, "No format : " + field.getBaseMeta());
|
||||
|
@ -105,7 +105,7 @@ public class FieldValueWrapper {
|
|||
* @param field
|
||||
* @return
|
||||
*/
|
||||
public static String wrapNumber(Object number, AccessibleMeta field) {
|
||||
public static String wrapNumber(Object number, EasyMeta field) {
|
||||
String format = field.getFieldExtConfig().getString("numberFormat");
|
||||
format = StringUtils.defaultIfEmpty(format, field.getDisplayType().getDefaultFormat());
|
||||
Assert.notNull(format, "No format : " + field.getBaseMeta());
|
||||
|
@ -117,7 +117,7 @@ public class FieldValueWrapper {
|
|||
* @param field
|
||||
* @return
|
||||
*/
|
||||
public static String wrapDecimal(Object decimal, AccessibleMeta field) {
|
||||
public static String wrapDecimal(Object decimal, EasyMeta field) {
|
||||
String format = field.getFieldExtConfig().getString("decimalFormat");
|
||||
format = StringUtils.defaultIfEmpty(format, field.getDisplayType().getDefaultFormat());
|
||||
Assert.notNull(format, "No format : " + field.getBaseMeta());
|
||||
|
@ -129,7 +129,7 @@ public class FieldValueWrapper {
|
|||
* @param field
|
||||
* @return
|
||||
*/
|
||||
public static Object wrapReference(Object reference, AccessibleMeta field) {
|
||||
public static Object wrapReference(Object reference, EasyMeta field) {
|
||||
|
||||
// TODO 名称字段
|
||||
|
||||
|
@ -152,7 +152,7 @@ public class FieldValueWrapper {
|
|||
* @param field
|
||||
* @return
|
||||
*/
|
||||
public static String wrapBool(Object bool, AccessibleMeta field) {
|
||||
public static String wrapBool(Object bool, EasyMeta field) {
|
||||
return ((Boolean) bool) ? "是" : "否";
|
||||
}
|
||||
|
||||
|
@ -161,7 +161,7 @@ public class FieldValueWrapper {
|
|||
* @param field
|
||||
* @return
|
||||
*/
|
||||
public static String wrapSimple(Object simple, AccessibleMeta field) {
|
||||
public static String wrapSimple(Object simple, EasyMeta field) {
|
||||
return simple.toString().trim();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -30,8 +30,8 @@ import com.alibaba.fastjson.JSONArray;
|
|||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.rebuild.server.Application;
|
||||
import com.rebuild.server.bizz.privileges.User;
|
||||
import com.rebuild.server.entityhub.AccessibleMeta;
|
||||
import com.rebuild.server.entityhub.DisplayType;
|
||||
import com.rebuild.server.entityhub.EasyMeta;
|
||||
import com.rebuild.server.metadata.EntityHelper;
|
||||
import com.rebuild.server.metadata.MetadataHelper;
|
||||
|
||||
|
@ -137,10 +137,10 @@ public class FormManager extends LayoutManager {
|
|||
}
|
||||
|
||||
Field fieldMeta = entityMeta.getField(fieldName);
|
||||
AccessibleMeta easyField = new AccessibleMeta(fieldMeta);
|
||||
EasyMeta easyField = new EasyMeta(fieldMeta);
|
||||
el.put("label", easyField.getLabel());
|
||||
String dt = easyField.getDisplayType(false);
|
||||
el.put("type", dt);
|
||||
DisplayType dt = easyField.getDisplayType();
|
||||
el.put("type", dt.name());
|
||||
el.put("nullable", fieldMeta.isNullable());
|
||||
el.put("readonly", false);
|
||||
if (record != null && !fieldMeta.isUpdatable()) {
|
||||
|
@ -156,32 +156,34 @@ public class FormManager extends LayoutManager {
|
|||
|
||||
// 不同类型的特殊处理
|
||||
|
||||
if (DisplayType.PICKLIST.name().equals(dt)) {
|
||||
JSONArray picklist = PickListManager.getPickList(fieldMeta);
|
||||
el.put("options", picklist);
|
||||
if (dt == DisplayType.PICKLIST) {
|
||||
JSONArray options = PickListManager.getPickList(fieldMeta);
|
||||
el.put("options", options);
|
||||
}
|
||||
else if (DisplayType.DATETIME.name().equals(dt)) {
|
||||
else if (dt == DisplayType.DATETIME) {
|
||||
if (!el.containsKey("datetimeFormat")) {
|
||||
el.put("datetimeFormat", "yyyy-MM-dd HH:mm:ss");
|
||||
}
|
||||
}
|
||||
else if (DisplayType.DATE.name().equals(dt)) {
|
||||
else if (dt == DisplayType.DATE) {
|
||||
if (!el.containsKey("dateFormat")) {
|
||||
el.put("dateFormat", "yyyy-MM-dd");
|
||||
}
|
||||
}
|
||||
|
||||
// 编辑记录 & 填充值
|
||||
// 编辑/视图
|
||||
if (record != null) {
|
||||
Object value = wrapFieldValue(record, easyField);
|
||||
Object value = wrapFieldValue(record, easyField, onView);
|
||||
if (value != null) {
|
||||
if (!onView && easyField.getDisplayType() == DisplayType.BOOL) {
|
||||
if (dt == DisplayType.BOOL && !onView) {
|
||||
value = value.toString().equals("是") ? "T" : "F";
|
||||
} else {
|
||||
el.put("value", value);
|
||||
}
|
||||
}
|
||||
|
||||
el.put("value", value);
|
||||
} else {
|
||||
}
|
||||
// 新建记录
|
||||
else {
|
||||
if (easyField.isBuiltin()) {
|
||||
el.put("readonly", true);
|
||||
if (fieldName.equals(EntityHelper.createdOn) || fieldName.equals(EntityHelper.modifiedOn)) {
|
||||
|
@ -195,6 +197,17 @@ public class FormManager extends LayoutManager {
|
|||
|
||||
// TODO 默认值
|
||||
|
||||
if (dt == DisplayType.PICKLIST) {
|
||||
JSONArray options = el.getJSONArray("options");
|
||||
for (Object o : options) {
|
||||
JSONObject opt = (JSONObject) o;
|
||||
if (opt.getBooleanValue("default")) {
|
||||
el.put("value", opt.getString("id"));
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
return config;
|
||||
|
@ -224,9 +237,12 @@ public class FormManager extends LayoutManager {
|
|||
}
|
||||
|
||||
Field fieldMeta = entity.getField(field);
|
||||
|
||||
// PICKLIST and REFERENCE
|
||||
if (fieldMeta.getType() == FieldType.REFERENCE) {
|
||||
ajql.append('&').append(field).append(',');
|
||||
}
|
||||
|
||||
ajql.append(field).append(',');
|
||||
}
|
||||
ajql.deleteCharAt(ajql.length() - 1);
|
||||
|
@ -240,16 +256,16 @@ public class FormManager extends LayoutManager {
|
|||
/**
|
||||
* @param record
|
||||
* @param field
|
||||
* @param readonly
|
||||
* @param onView
|
||||
* @return
|
||||
*/
|
||||
protected static Object wrapFieldValue(Record record, AccessibleMeta field) {
|
||||
protected static Object wrapFieldValue(Record record, EasyMeta field, boolean onView) {
|
||||
String fieldName = field.getName();
|
||||
if (record.hasValue(fieldName)) {
|
||||
Object value = record.getObjectValue(fieldName);
|
||||
if (field.getDisplayType() == DisplayType.PICKLIST) {
|
||||
ID pickValue = (ID) value;
|
||||
return pickValue.getLabel();
|
||||
return onView ? pickValue.getLabel() : pickValue.toLiteral();
|
||||
}
|
||||
else if (value instanceof ID) {
|
||||
ID idValue = (ID) value;
|
||||
|
|
|
@ -22,7 +22,7 @@ import java.util.ArrayList;
|
|||
import java.util.List;
|
||||
|
||||
import com.rebuild.server.entityhub.DisplayType;
|
||||
import com.rebuild.server.entityhub.AccessibleMeta;
|
||||
import com.rebuild.server.entityhub.EasyMeta;
|
||||
|
||||
import cn.devezhao.persist4j.Entity;
|
||||
import cn.devezhao.persist4j.Field;
|
||||
|
@ -34,7 +34,7 @@ import cn.devezhao.persist4j.metadata.BaseMeta;
|
|||
*
|
||||
* @author devezhao
|
||||
* @since 09/30/2018
|
||||
* @see AccessibleMeta
|
||||
* @see EasyMeta
|
||||
*/
|
||||
public class PortalMetaSorter {
|
||||
|
||||
|
@ -56,7 +56,7 @@ public class PortalMetaSorter {
|
|||
List<Entity> list = new ArrayList<>();
|
||||
for (Entity entity : entities) {
|
||||
int ec = entity.getEntityCode();
|
||||
if (AccessibleMeta.isBuiltin(entity)
|
||||
if (EasyMeta.isBuiltin(entity)
|
||||
|| (!fromAdmin && (ec == EntityHelper.User || ec == EntityHelper.Department || ec == EntityHelper.Role))) {
|
||||
} else {
|
||||
list.add(entity);
|
||||
|
@ -102,7 +102,7 @@ public class PortalMetaSorter {
|
|||
|
||||
List<Field> list = new ArrayList<>();
|
||||
for (Field field : fields) {
|
||||
DisplayType dtThat = AccessibleMeta.getDisplayType(field);
|
||||
DisplayType dtThat = EasyMeta.getDisplayType(field);
|
||||
for (DisplayType dt : dtAllowed) {
|
||||
if (dtThat == dt) {
|
||||
list.add(field);
|
||||
|
|
|
@ -27,7 +27,7 @@ import com.alibaba.fastjson.JSON;
|
|||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.rebuild.server.Application;
|
||||
import com.rebuild.server.entityhub.AccessibleMeta;
|
||||
import com.rebuild.server.entityhub.EasyMeta;
|
||||
import com.rebuild.server.metadata.MetadataHelper;
|
||||
|
||||
import cn.devezhao.persist4j.Entity;
|
||||
|
@ -71,7 +71,7 @@ public class AdvFilterManager {
|
|||
continue;
|
||||
}
|
||||
|
||||
String label = AccessibleMeta.getLabel(metaEntity.getField(field));
|
||||
String label = EasyMeta.getLabel(metaEntity.getField(field));
|
||||
item.put("label", label);
|
||||
}
|
||||
raw[1] = config;
|
||||
|
|
|
@ -28,7 +28,7 @@ import org.apache.commons.lang.math.NumberUtils;
|
|||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.rebuild.server.entityhub.DisplayType;
|
||||
import com.rebuild.server.entityhub.AccessibleMeta;
|
||||
import com.rebuild.server.entityhub.EasyMeta;
|
||||
|
||||
import cn.devezhao.persist4j.Entity;
|
||||
import cn.devezhao.persist4j.Field;
|
||||
|
@ -92,7 +92,7 @@ public class AdvFilterParser {
|
|||
}
|
||||
|
||||
Field metaField = rootEntity.getField(field);
|
||||
if (AccessibleMeta.getDisplayType(metaField) == DisplayType.PICKLIST) {
|
||||
if (EasyMeta.getDisplayType(metaField) == DisplayType.PICKLIST) {
|
||||
field = '&' + field;
|
||||
}
|
||||
|
||||
|
|
|
@ -18,12 +18,10 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|||
|
||||
package com.rebuild.utils;
|
||||
|
||||
import java.io.File;
|
||||
import java.nio.file.AccessDeniedException;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import org.apache.commons.io.FileUtils;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
|
@ -119,12 +117,4 @@ public class AppUtils {
|
|||
return ex.getLocalizedMessage();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param fileName
|
||||
* @return
|
||||
*/
|
||||
public static File getFileOfTemp(String fileName) {
|
||||
return new File(FileUtils.getTempDirectory(), fileName);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -23,7 +23,7 @@ import javax.servlet.http.HttpServletRequest;
|
|||
import org.springframework.web.servlet.ModelAndView;
|
||||
|
||||
import com.rebuild.server.ServerListener;
|
||||
import com.rebuild.server.entityhub.AccessibleMeta;
|
||||
import com.rebuild.server.entityhub.EasyMeta;
|
||||
import com.rebuild.server.metadata.MetadataHelper;
|
||||
import com.rebuild.utils.AppUtils;
|
||||
|
||||
|
@ -69,7 +69,7 @@ public abstract class PageControll {
|
|||
throw new InvalidRequestException("无效实体 : " + entity);
|
||||
}
|
||||
|
||||
AccessibleMeta entityMeta = new AccessibleMeta(MetadataHelper.getEntity(entity));
|
||||
EasyMeta entityMeta = new EasyMeta(MetadataHelper.getEntity(entity));
|
||||
mv.getModel().put("entityName", entityMeta.getName());
|
||||
mv.getModel().put("entityLabel", entityMeta.getLabel());
|
||||
mv.getModel().put("entityIcon", entityMeta.getIcon());
|
||||
|
|
|
@ -25,16 +25,22 @@ import org.springframework.web.servlet.ModelAndView;
|
|||
import com.rebuild.web.BaseControll;
|
||||
|
||||
/**
|
||||
* 系统配置
|
||||
*
|
||||
* @author zhaofang123@gmail.com
|
||||
* @since 09/20/2018
|
||||
*/
|
||||
@Controller
|
||||
@RequestMapping("/admin/")
|
||||
public class SystemSettings extends BaseControll {
|
||||
public class SystemConfigurerContoll extends BaseControll {
|
||||
|
||||
@RequestMapping("systems")
|
||||
public ModelAndView pageSettings() {
|
||||
return createModelAndView("/admin/system-settings.jsp");
|
||||
public ModelAndView pageSystems() {
|
||||
return createModelAndView("/admin/system-props.jsp");
|
||||
}
|
||||
|
||||
@RequestMapping("system/storage")
|
||||
public ModelAndView pageStorage() {
|
||||
return createModelAndView("/admin/storage-qiniu.jsp");
|
||||
}
|
||||
}
|
|
@ -34,7 +34,7 @@ import com.alibaba.fastjson.JSON;
|
|||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.rebuild.server.Application;
|
||||
import com.rebuild.server.bizz.RoleService;
|
||||
import com.rebuild.server.entityhub.AccessibleMeta;
|
||||
import com.rebuild.server.entityhub.EasyMeta;
|
||||
import com.rebuild.server.metadata.EntityHelper;
|
||||
import com.rebuild.server.metadata.PortalMetaSorter;
|
||||
import com.rebuild.utils.JSONUtils;
|
||||
|
@ -77,7 +77,7 @@ public class RolePrivilegesControll extends BaseControll {
|
|||
List<String[]> entities = new ArrayList<>();
|
||||
for (Entity e : PortalMetaSorter.sortEntities(true)) {
|
||||
if (EntityHelper.hasPrivilegesField(e)) {
|
||||
entities.add(new String[] { e.getName(), AccessibleMeta.getLabel(e) });
|
||||
entities.add(new String[] { e.getName(), EasyMeta.getLabel(e) });
|
||||
}
|
||||
}
|
||||
mv.getModel().put("Entities", entities);
|
||||
|
|
|
@ -35,7 +35,7 @@ import org.springframework.web.servlet.ModelAndView;
|
|||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.rebuild.server.Application;
|
||||
import com.rebuild.server.entityhub.AccessibleMeta;
|
||||
import com.rebuild.server.entityhub.EasyMeta;
|
||||
import com.rebuild.server.entityhub.Entity2Schema;
|
||||
import com.rebuild.server.metadata.EntityHelper;
|
||||
import com.rebuild.server.metadata.MetadataHelper;
|
||||
|
@ -71,7 +71,7 @@ public class MetaEntityControll extends BaseControll {
|
|||
public void listEntity(HttpServletRequest request, HttpServletResponse response) throws IOException {
|
||||
List<Map<String, Object>> ret = new ArrayList<>();
|
||||
for (Entity entity : MetadataHelper.getEntities()) {
|
||||
AccessibleMeta easyMeta = new AccessibleMeta(entity);
|
||||
EasyMeta easyMeta = new EasyMeta(entity);
|
||||
if (easyMeta.isBuiltin()) {
|
||||
continue;
|
||||
}
|
||||
|
@ -117,9 +117,9 @@ public class MetaEntityControll extends BaseControll {
|
|||
* @param entity
|
||||
* @return
|
||||
*/
|
||||
protected static AccessibleMeta setEntityBase(ModelAndView mv, String entity) {
|
||||
protected static EasyMeta setEntityBase(ModelAndView mv, String entity) {
|
||||
Entity e = MetadataHelper.getEntity(entity);
|
||||
AccessibleMeta entityMeta = new AccessibleMeta(e);
|
||||
EasyMeta entityMeta = new EasyMeta(e);
|
||||
mv.getModel().put("entityMetaId", entityMeta.getMetaId());
|
||||
mv.getModel().put("entityName", entityMeta.getName());
|
||||
mv.getModel().put("entityLabel", entityMeta.getLabel());
|
||||
|
|
|
@ -35,7 +35,7 @@ import org.springframework.web.servlet.ModelAndView;
|
|||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.rebuild.server.Application;
|
||||
import com.rebuild.server.entityhub.AccessibleMeta;
|
||||
import com.rebuild.server.entityhub.EasyMeta;
|
||||
import com.rebuild.server.entityhub.DisplayType;
|
||||
import com.rebuild.server.entityhub.Field2Schema;
|
||||
import com.rebuild.server.metadata.EntityHelper;
|
||||
|
@ -77,7 +77,7 @@ public class MetaFieldControll extends BaseControll {
|
|||
|
||||
List<Map<String, Object>> ret = new ArrayList<>();
|
||||
for (Field field : entity.getFields()) {
|
||||
AccessibleMeta easyMeta = new AccessibleMeta(field);
|
||||
EasyMeta easyMeta = new EasyMeta(field);
|
||||
if (field.getType() == FieldType.PRIMARY) {
|
||||
continue;
|
||||
}
|
||||
|
@ -100,10 +100,10 @@ public class MetaFieldControll extends BaseControll {
|
|||
@RequestMapping("{entity}/field/{field}")
|
||||
public ModelAndView pageEntityFields(@PathVariable String entity, @PathVariable String field, HttpServletRequest request) throws IOException {
|
||||
ModelAndView mv = createModelAndView("/admin/entity/field-edit.jsp");
|
||||
AccessibleMeta easyMeta = MetaEntityControll.setEntityBase(mv, entity);
|
||||
EasyMeta easyMeta = MetaEntityControll.setEntityBase(mv, entity);
|
||||
|
||||
Field fieldMeta = ((Entity) easyMeta.getBaseMeta()).getField(field);
|
||||
AccessibleMeta fieldEasyMeta = new AccessibleMeta(fieldMeta);
|
||||
EasyMeta fieldEasyMeta = new EasyMeta(fieldMeta);
|
||||
|
||||
mv.getModel().put("fieldMetaId", fieldEasyMeta.isBuiltin() ? null : fieldEasyMeta.getMetaId());
|
||||
mv.getModel().put("fieldName", fieldEasyMeta.getName());
|
||||
|
@ -118,7 +118,7 @@ public class MetaFieldControll extends BaseControll {
|
|||
if (ft == FieldType.REFERENCE) {
|
||||
Entity refentity = fieldMeta.getReferenceEntities()[0];
|
||||
mv.getModel().put("fieldRefentity", refentity.getName());
|
||||
mv.getModel().put("fieldRefentityLabel", new AccessibleMeta(refentity).getLabel());
|
||||
mv.getModel().put("fieldRefentityLabel", new EasyMeta(refentity).getLabel());
|
||||
} else {
|
||||
mv.getModel().put("fieldExtConfig", fieldEasyMeta.getFieldExtConfig());
|
||||
}
|
||||
|
|
|
@ -30,7 +30,7 @@ import javax.servlet.http.HttpServletResponse;
|
|||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
|
||||
import com.rebuild.server.entityhub.AccessibleMeta;
|
||||
import com.rebuild.server.entityhub.EasyMeta;
|
||||
import com.rebuild.server.metadata.MetadataHelper;
|
||||
import com.rebuild.server.metadata.PortalMetaSorter;
|
||||
import com.rebuild.web.BaseControll;
|
||||
|
@ -52,7 +52,7 @@ public class MetadataGet extends BaseControll {
|
|||
List<Map<String, String>> list = new ArrayList<>();
|
||||
for (Entity e : PortalMetaSorter.sortEntities()) {
|
||||
Map<String, String> map = new HashMap<>();
|
||||
AccessibleMeta easy = new AccessibleMeta(e);
|
||||
EasyMeta easy = new EasyMeta(e);
|
||||
map.put("name", e.getName());
|
||||
map.put("label", easy.getLabel());
|
||||
map.put("icon", easy.getIcon());
|
||||
|
@ -70,7 +70,7 @@ public class MetadataGet extends BaseControll {
|
|||
for (Field e : PortalMetaSorter.sortFields(entityBase)) {
|
||||
Map<String, String> map = new HashMap<>();
|
||||
map.put("name", e.getName());
|
||||
map.put("label", AccessibleMeta.getLabel(e));
|
||||
map.put("label", EasyMeta.getLabel(e));
|
||||
list.add(map);
|
||||
}
|
||||
writeSuccess(response, list);
|
||||
|
|
|
@ -36,7 +36,7 @@ import com.alibaba.fastjson.JSON;
|
|||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.rebuild.server.Application;
|
||||
import com.rebuild.server.entityhub.DisplayType;
|
||||
import com.rebuild.server.entityhub.AccessibleMeta;
|
||||
import com.rebuild.server.entityhub.EasyMeta;
|
||||
import com.rebuild.server.helper.manager.DataListManager;
|
||||
import com.rebuild.server.metadata.EntityHelper;
|
||||
import com.rebuild.server.metadata.MetadataHelper;
|
||||
|
@ -102,7 +102,7 @@ public class AdvFilterControll extends BaseControll {
|
|||
|
||||
List<Map<String, Object>> fieldList = new ArrayList<>();
|
||||
for (Field field : entityMeta.getFields()) {
|
||||
DisplayType dt = AccessibleMeta.getDisplayType(field);
|
||||
DisplayType dt = EasyMeta.getDisplayType(field);
|
||||
if (dt == DisplayType.TEXT || dt == DisplayType.URL || dt == DisplayType.EMAIL || dt == DisplayType.PHONE || dt == DisplayType.PICKLIST) {
|
||||
fieldList.add(DataListManager.warpColumn(field));
|
||||
}
|
||||
|
|
|
@ -27,7 +27,7 @@ import org.apache.commons.logging.LogFactory;
|
|||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.rebuild.server.Application;
|
||||
import com.rebuild.server.entityhub.AccessibleMeta;
|
||||
import com.rebuild.server.entityhub.EasyMeta;
|
||||
import com.rebuild.server.helper.manager.FieldValueWrapper;
|
||||
import com.rebuild.server.metadata.MetadataHelper;
|
||||
|
||||
|
@ -89,7 +89,7 @@ public class DataWrapper extends FieldValueWrapper {
|
|||
} else if (field.getType() == FieldType.PRIMARY) { // Last index always
|
||||
row[i] = readReferenceNamed((ID) row[i], namedVal);
|
||||
} else {
|
||||
row[i] = wrapFieldValue(row[i], new AccessibleMeta(field));
|
||||
row[i] = wrapFieldValue(row[i], new EasyMeta(field));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -123,8 +123,8 @@ public class DataWrapper extends FieldValueWrapper {
|
|||
namedVal = named[0];
|
||||
}
|
||||
|
||||
namedVal = wrapFieldValue(namedVal, new AccessibleMeta(nameField));
|
||||
String[] meta = new String[] { entity.getName(), new AccessibleMeta(entity).getIcon() };
|
||||
namedVal = wrapFieldValue(namedVal, new EasyMeta(nameField));
|
||||
String[] meta = new String[] { entity.getName(), new EasyMeta(entity).getIcon() };
|
||||
return new Object[] { idVal.toLiteral(), namedVal, meta };
|
||||
}
|
||||
}
|
||||
|
|
|
@ -28,7 +28,7 @@ import org.apache.commons.lang.math.NumberUtils;
|
|||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.rebuild.server.entityhub.DisplayType;
|
||||
import com.rebuild.server.entityhub.AccessibleMeta;
|
||||
import com.rebuild.server.entityhub.EasyMeta;
|
||||
import com.rebuild.server.metadata.EntityHelper;
|
||||
import com.rebuild.server.metadata.MetadataHelper;
|
||||
import com.rebuild.server.query.AdvFilterParser;
|
||||
|
@ -111,7 +111,7 @@ public class JSONQueryParser {
|
|||
|
||||
StringBuffer sqlBase = new StringBuffer("select ");
|
||||
for (Field field : fieldList) {
|
||||
if (AccessibleMeta.getDisplayType(field) == DisplayType.PICKLIST) {
|
||||
if (EasyMeta.getDisplayType(field) == DisplayType.PICKLIST) {
|
||||
sqlBase.append('&');
|
||||
}
|
||||
sqlBase.append(field.getName()).append(',');
|
||||
|
|
|
@ -36,8 +36,9 @@ import org.apache.commons.fileupload.servlet.ServletFileUpload;
|
|||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
|
||||
import com.rebuild.server.helper.QiniuCloud;
|
||||
import com.rebuild.server.helper.SystemProps;
|
||||
import com.rebuild.utils.AppUtils;
|
||||
import com.rebuild.utils.QiniuCloud;
|
||||
|
||||
import cn.devezhao.commons.CalendarUtils;
|
||||
import cn.devezhao.commons.web.ServletUtils;
|
||||
|
@ -69,12 +70,12 @@ public class FileUploader extends HttpServlet {
|
|||
}
|
||||
uploadName = CalendarUtils.getDateFormat("hhMMssSSS").format(CalendarUtils.now()) + "__" + uploadName;
|
||||
|
||||
File temp = AppUtils.getFileOfTemp(uploadName);
|
||||
File temp = SystemProps.getFileOfTemp(uploadName);
|
||||
item.write(temp);
|
||||
|
||||
String cloud = req.getParameter("cloud");
|
||||
if ("true".equals(cloud) || "auto".equals(cloud)) {
|
||||
uploadName = QiniuCloud.upload(temp);
|
||||
uploadName = QiniuCloud.instance().upload(temp);
|
||||
if (temp.exists()) {
|
||||
temp.delete();
|
||||
}
|
||||
|
@ -101,7 +102,7 @@ public class FileUploader extends HttpServlet {
|
|||
@Override
|
||||
public void init(ServletConfig config) throws ServletException {
|
||||
super.init(config);
|
||||
File track = AppUtils.getFileOfTemp("track");
|
||||
File track = SystemProps.getFileOfTemp("track");
|
||||
if (!track.exists() || !track.isDirectory()) {
|
||||
boolean mked = track.mkdir();
|
||||
if (!mked) {
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
|
||||
<%@ page import="com.rebuild.server.helper.SystemProps"%>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
||||
<link rel="stylesheet" type="text/css" href="${baseUrl}/assets/lib/material-design-iconic-font.min.css">
|
||||
|
@ -11,9 +12,9 @@
|
|||
<link rel="stylesheet" type="text/css" href="${baseUrl}/assets/css/rb-base.css">
|
||||
<link rel="stylesheet" type="text/css" href="${baseUrl}/assets/css/rb-page.css">
|
||||
<script>
|
||||
var rb = rb = {}
|
||||
var rb = rb || {}
|
||||
rb.baseUrl = '${baseUrl}'
|
||||
rb.storageUrl = 'http://rb-cdn.errorpage.cn/'
|
||||
rb.storageUrl = '<%=SystemProps.getStorageUrl()%>'
|
||||
</script>
|
||||
<!--[if IE]>
|
||||
<script src="https://as.alipayobjects.com/g/component/??es6-shim/0.35.1/es6-sham.min.js,es6-shim/0.35.1/es6-shim.min.js"></script>
|
||||
|
|
|
@ -8,7 +8,8 @@
|
|||
<div class="left-sidebar-content">
|
||||
<ul class="sidebar-elements">
|
||||
<li class="divider">通用</li>
|
||||
<li class="<%="systems".equals(activeNav) ? "active" : ""%>" id="nav_systems"><a href="${baseUrl}/admin/systems"><i class="icon zmdi zmdi-settings"></i><span>通用配置</span></a></li>
|
||||
<li class="<%="systems".equals(activeNav) ? "active" : ""%>" id="nav_systems"><a href="${baseUrl}/admin/systems"><i class="icon zmdi zmdi-settings"></i><span>系统信息</span></a></li>
|
||||
<li class="<%="system-storage".equals(activeNav) ? "active" : ""%>" id="nav_system-storage"><a href="${baseUrl}/admin/system/storage"><i class="icon zmdi zmdi-cloud-upload"></i><span>云存储配置</span></a></li>
|
||||
<li class="divider">实体</li>
|
||||
<li class="<%="entities".equals(activeNav) ? "active" : ""%>" id="nav_entities"><a href="${baseUrl}/admin/entities"><i class="icon zmdi zmdi-widgets"></i><span>实体管理</span></a></li>
|
||||
<li class="divider">用户</li>
|
||||
|
|
|
@ -1,4 +1,12 @@
|
|||
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
|
||||
<%@ page import="com.rebuild.utils.AppUtils"%>
|
||||
<%@ page import="com.rebuild.server.Application"%>
|
||||
<%@ page import="com.rebuild.server.bizz.privileges.User"%>
|
||||
<%@ page import="com.rebuild.server.bizz.UserHelper"%>
|
||||
<%
|
||||
final User currentUser = Application.getUserStore().getUser(AppUtils.getRequestUser(request));
|
||||
final String showName = UserHelper.getShowName(currentUser);
|
||||
%>
|
||||
<nav class="navbar navbar-expand fixed-top rb-top-header">
|
||||
<div class="container-fluid">
|
||||
<div class="rb-navbar-header">
|
||||
|
@ -8,13 +16,16 @@
|
|||
<div class="rb-right-navbar">
|
||||
<ul class="nav navbar-nav float-right rb-user-nav">
|
||||
<li class="nav-item dropdown">
|
||||
<a class="nav-link dropdown-toggle" href="${baseUrl}/my/profile" data-toggle="dropdown"><img src="${baseUrl}/assets/img/avatar.png" alt="Avatar"><span class="user-name">admin</span></a>
|
||||
<a class="nav-link dropdown-toggle" href="${baseUrl}/me/profile" data-toggle="dropdown">
|
||||
<img src="<%=UserHelper.getAvatarUrl(currentUser)%>" alt="Avatar">
|
||||
<span class="user-name"><%=showName%></span>
|
||||
</a>
|
||||
<div class="dropdown-menu">
|
||||
<div class="user-info">
|
||||
<div class="user-name">admin</div>
|
||||
<div class="user-id">hello@getrebuild.com</div>
|
||||
<div class="user-name"><%=showName%></div>
|
||||
<div class="user-id"><%=currentUser.getEmail()%></div>
|
||||
</div>
|
||||
<a class="dropdown-item" href="${baseUrl}/me/profile"><span class="icon zmdi zmdi-face"></span>个人信息</a>
|
||||
<a class="dropdown-item" href="${baseUrl}/me/profile"><span class="icon zmdi zmdi-account-box"></span>个人设置</a>
|
||||
<a class="dropdown-item" href="${baseUrl}/user/logout"><span class="icon zmdi zmdi-power"></span>退出</a>
|
||||
</div>
|
||||
</li>
|
||||
|
@ -22,10 +33,10 @@
|
|||
<div class="page-title"><span><%=request.getParameter("pageTitle")%></span></div>
|
||||
<ul class="nav navbar-nav float-right rb-icons-nav">
|
||||
<li class="nav-item dropdown">
|
||||
<a class="nav-link rb-toggle-right-sidebar" href="${baseUrl}/admin/systems" title="系统设置"><span class="icon zmdi zmdi-settings"></span></a>
|
||||
<a class="nav-link" href="${baseUrl}/admin/systems" title="系统设置"><span class="icon zmdi zmdi-settings"></span></a>
|
||||
</li>
|
||||
<li class="nav-item dropdown">
|
||||
<a class="nav-link dropdown-toggle" href="${baseUrl}/app/messages" title="消息中心"><span class="icon zmdi zmdi-notifications"></span></a>
|
||||
<a class="nav-link" href="${baseUrl}/app/messages" title="消息中心"><span class="icon zmdi zmdi-notifications"></span></a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
|
|
@ -1,4 +1,12 @@
|
|||
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
|
||||
<%@ page import="com.rebuild.utils.AppUtils"%>
|
||||
<%@ page import="com.rebuild.server.Application"%>
|
||||
<%@ page import="com.rebuild.server.bizz.privileges.User"%>
|
||||
<%@ page import="com.rebuild.server.bizz.UserHelper"%>
|
||||
<%
|
||||
final User currentUser = Application.getUserStore().getUser(AppUtils.getRequestUser(request));
|
||||
final String showName = UserHelper.getShowName(currentUser);
|
||||
%>
|
||||
<nav class="navbar navbar-expand fixed-top rb-top-header">
|
||||
<div class="container-fluid">
|
||||
<div class="rb-navbar-header">
|
||||
|
@ -7,13 +15,16 @@
|
|||
<div class="rb-right-navbar">
|
||||
<ul class="nav navbar-nav float-right rb-user-nav">
|
||||
<li class="nav-item dropdown">
|
||||
<a class="nav-link dropdown-toggle" href="${baseUrl}/me/profile" data-toggle="dropdown"><img src="${baseUrl}/assets/img/avatar.png" alt="Avatar"><span class="user-name">admin</span></a>
|
||||
<a class="nav-link dropdown-toggle" href="${baseUrl}/me/profile" data-toggle="dropdown">
|
||||
<img src="<%=UserHelper.getAvatarUrl(currentUser)%>" alt="Avatar">
|
||||
<span class="user-name"><%=showName%></span>
|
||||
</a>
|
||||
<div class="dropdown-menu">
|
||||
<div class="user-info">
|
||||
<div class="user-name">admin</div>
|
||||
<div class="user-id">hello@getrebuild.com</div>
|
||||
<div class="user-name"><%=showName%></div>
|
||||
<div class="user-id"><%=currentUser.getEmail()%></div>
|
||||
</div>
|
||||
<a class="dropdown-item" href="${baseUrl}/me/profile"><span class="icon zmdi zmdi-face"></span>个人信息</a>
|
||||
<a class="dropdown-item" href="${baseUrl}/me/profile"><span class="icon zmdi zmdi-account-box"></span>个人设置</a>
|
||||
<a class="dropdown-item" href="${baseUrl}/user/logout"><span class="icon zmdi zmdi-power"></span>退出</a>
|
||||
</div>
|
||||
</li>
|
|
@ -34,8 +34,9 @@
|
|||
<div class="col-12 col-sm-6">
|
||||
<div class="dataTables_filter">
|
||||
<div class="input-group input-search">
|
||||
<input class="form-control rounded J_search-text" placeholder="搜索 ..." type="text">
|
||||
<input class="form-control rounded-left J_search-text" placeholder="搜索 ..." type="text">
|
||||
<span class="input-group-btn"><button class="btn btn-secondary J_search-btn" type="button"><i class="icon zmdi zmdi-search"></i></button></span>
|
||||
<span class="input-group-btn plus"><button class="btn btn-secondary J_qfields" type="button" title="设置查询字段"><i class="icon zmdi zmdi-playlist-plus"></i></button></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -93,6 +94,8 @@ $(document).ready(function(){
|
|||
else columnsModal = rb.modal(rb.baseUrl + '/page/general-entity/show-columns?entity=Department', '设置列显示')
|
||||
})
|
||||
|
||||
QuickFilter.init('.input-search', 'Department')
|
||||
|
||||
loadDeptTree()
|
||||
})
|
||||
const loadDeptTree = function(){
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
.R3{background-image:url(${baseUrl}/assets/img/role/role_3.gif)}
|
||||
.R4{background-image:url(${baseUrl}/assets/img/role/role_4.gif)}
|
||||
.table-priv.table{table-layout:fixed;border:0 none;border-bottom:1px solid #dee2e6;}
|
||||
.table-priv.table td, .table-priv.table th{padding:9px;vertical-align:middle;line-height:1}
|
||||
.table-priv.table td, .table-priv.table th{padding:9px 6px;vertical-align:middle;line-height:1}
|
||||
.table-priv.table th{border-top:0 none;font-weight:normal;color:#777}
|
||||
.table-priv.table th a:hover, .table-priv.table .name a:hover{opacity:0.8}
|
||||
.legend{border:1px solid #dee2e6;border-radius:3px;display:inline-block;padding:9px 15px;}
|
||||
|
@ -54,13 +54,13 @@
|
|||
<table class="table table-priv">
|
||||
<thead>
|
||||
<tr>
|
||||
<th width="25%">实体</th>
|
||||
<th class="text-center"><a data-action="C">新建</a></th>
|
||||
<th class="text-center"><a data-action="R">读取</a></th>
|
||||
<th class="text-center"><a data-action="U">修改</a></th>
|
||||
<th class="text-center"><a data-action="D">删除</a></th>
|
||||
<th class="text-center"><a data-action="A">分派</a></th>
|
||||
<th class="text-center"><a data-action="S">共享</a></th>
|
||||
<th width="25%">业务实体</th>
|
||||
<th class="text-center unselect"><a data-action="C">新建</a></th>
|
||||
<th class="text-center unselect"><a data-action="R">读取</a></th>
|
||||
<th class="text-center unselect"><a data-action="U">修改</a></th>
|
||||
<th class="text-center unselect"><a data-action="D">删除</a></th>
|
||||
<th class="text-center unselect"><a data-action="A">分派</a></th>
|
||||
<th class="text-center unselect"><a data-action="S">共享</a></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
@ -101,8 +101,8 @@
|
|||
<table class="table table-priv">
|
||||
<thead>
|
||||
<tr>
|
||||
<th width="25%">权限项</th>
|
||||
<th class="text-center"><a data-action="Z">允许</a></th>
|
||||
<th width="25%">权限项目</th>
|
||||
<th class="text-center"><span data-action="Z">允许</span></th>
|
||||
<th>前置条件</th>
|
||||
<th></th>
|
||||
<th></th>
|
||||
|
@ -194,11 +194,6 @@ $(document).ready(function(){
|
|||
$('#priv-zero tbody .priv').click(function(){
|
||||
clickPriv($(this), 'Z')
|
||||
})
|
||||
// 批量操作
|
||||
$('#priv-zero thead th>a').click(function(){
|
||||
let privAll = $('#priv-zero tbody .priv')
|
||||
clickPriv(privAll, 'Z')
|
||||
})
|
||||
|
||||
})
|
||||
const clickPriv = function(elements, action) {
|
||||
|
@ -269,7 +264,7 @@ const updatePrivileges = function() {
|
|||
let priv = { entity: privEntity, zero: privZero }
|
||||
console.log(JSON.stringify(priv))
|
||||
$.post(rb.baseUrl + '/admin/bizuser/privileges-update?role=' + currentRoleId, JSON.stringify(priv), function(){
|
||||
rb.notice('权限保存成功', 'success')
|
||||
rb.notice('保存成功', 'success')
|
||||
})
|
||||
}
|
||||
</script>
|
||||
|
|
|
@ -34,8 +34,9 @@
|
|||
<div class="col-12 col-sm-6">
|
||||
<div class="dataTables_filter">
|
||||
<div class="input-group input-search">
|
||||
<input class="form-control rounded J_search-text" placeholder="搜索 ..." type="text">
|
||||
<input class="form-control rounded-left J_search-text" placeholder="搜索 ..." type="text">
|
||||
<span class="input-group-btn"><button class="btn btn-secondary J_search-btn" type="button"><i class="icon zmdi zmdi-search"></i></button></span>
|
||||
<span class="input-group-btn plus"><button class="btn btn-secondary J_qfields" type="button" title="设置查询字段"><i class="icon zmdi zmdi-playlist-plus"></i></button></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -104,6 +105,8 @@ $(document).ready(function(){
|
|||
else columnsModal = rb.modal('${baseUrl}/page/general-entity/show-columns?entity=User', '设置列显示')
|
||||
})
|
||||
|
||||
QuickFilter.init('.input-search', 'User')
|
||||
|
||||
loadDeptTree()
|
||||
})
|
||||
var formPostType = 1
|
||||
|
|
|
@ -6,12 +6,12 @@
|
|||
<title>实体管理</title>
|
||||
<style type="text/css">
|
||||
.card.entity:hover{background-color:rgba(255,255,255,.7)}
|
||||
.card.entity .card-body{padding:12px 15px;color:#333;}
|
||||
.card.entity .card-body{padding:12px 20px;color:#333;}
|
||||
.card.entity .icon{font-size:32px;color:#4285f4;}
|
||||
.card.entity .card-body .float-left{width:30px;text-align:center;}
|
||||
.card.entity span{margin-top:2px;display:block;}
|
||||
.card.entity p{margin:0}
|
||||
.title{margin-left:42px}
|
||||
.title{margin-left:45px}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
|
@ -60,7 +60,7 @@ $(document).ready(function(){
|
|||
tmp.find('.icon').addClass('zmdi-plus')
|
||||
tmp.click(function(){
|
||||
if (newEntityModal) newEntityModal.show()
|
||||
else newEntityModal = rb.modal(rb.baseUrl + '/admin/page/entity/entity-new', '新建实体')
|
||||
else newEntityModal = rb.modal(rb.baseUrl + '/admin/page/entity/entity-new', '新建实体', { destroyOnHide: false })
|
||||
})
|
||||
})
|
||||
})
|
||||
|
|
|
@ -9,9 +9,7 @@
|
|||
</head>
|
||||
<body>
|
||||
<div class="rb-wrapper rb-nosidebar-left rb-color-header">
|
||||
<jsp:include page="/_include/NavTopOnlyHeader.jsp">
|
||||
<jsp:param value="" name="pageTitle"/>
|
||||
</jsp:include>
|
||||
<jsp:include page="/_include/NavTopHeader.jsp" />
|
||||
<div class="rb-content">
|
||||
<div class="main-content container-fluid">
|
||||
<div class="splash-container">
|
||||
|
@ -20,12 +18,14 @@
|
|||
<h4>需要验证你的管理员身份</h4>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<form>
|
||||
<div class="form-group">
|
||||
<input class="form-control" id="admin-passwd" type="password" placeholder="输入登录密码" autocomplete="off">
|
||||
</div>
|
||||
<div class="form-group login-submit">
|
||||
<button class="btn btn-primary btn-xl J_verify-btn">验证</button>
|
||||
<button class="btn btn-primary btn-xl J_verify-btn" type="submit">验证</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<div class="splash-footer">
|
||||
|
@ -46,6 +46,7 @@ $(document).ready(function(){
|
|||
if (res.error_code == 0) location.replace(nexturl)
|
||||
else rb.notice(res.error_msg)
|
||||
})
|
||||
return false
|
||||
})
|
||||
})
|
||||
</script>
|
||||
|
|
27
src/main/webapp/admin/storage-qiniu.jsp
Normal file
27
src/main/webapp/admin/storage-qiniu.jsp
Normal file
|
@ -0,0 +1,27 @@
|
|||
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<%@ include file="/_include/Head.jsp"%>
|
||||
<title>云存储配置</title>
|
||||
<style type="text/css">
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="rb-wrapper rb-fixed-sidebar rb-collapsible-sidebar rb-collapsible-sidebar-hide-logo">
|
||||
<jsp:include page="/_include/NavTop.jsp">
|
||||
<jsp:param value="云存储配置" name="pageTitle"/>
|
||||
</jsp:include>
|
||||
<jsp:include page="/_include/NavLeftAdmin.jsp">
|
||||
<jsp:param value="system-storage" name="activeNav"/>
|
||||
</jsp:include>
|
||||
<div class="rb-content">
|
||||
<div class="main-content container-fluid">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<%@ include file="/_include/Foot.jsp"%>
|
||||
<script type="text/javascript">
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -3,14 +3,14 @@
|
|||
<html>
|
||||
<head>
|
||||
<%@ include file="/_include/Head.jsp"%>
|
||||
<title>通用配置</title>
|
||||
<title>系统信息</title>
|
||||
<style type="text/css">
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="rb-wrapper rb-fixed-sidebar rb-collapsible-sidebar rb-collapsible-sidebar-hide-logo">
|
||||
<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="systems" name="activeNav"/>
|
|
@ -11480,8 +11480,8 @@ canvas {
|
|||
}
|
||||
|
||||
.rb-user-nav>li.dropdown>a img {
|
||||
max-width: 32px;
|
||||
max-height: 32px;
|
||||
width: 32px;
|
||||
height: 32px;
|
||||
border-radius: 50%
|
||||
}
|
||||
|
||||
|
@ -11544,7 +11544,7 @@ canvas {
|
|||
|
||||
.rb-user-nav>li.dropdown .dropdown-menu .user-info .user-name {
|
||||
display: block;
|
||||
font-size: 1.462rem;
|
||||
font-size: 1.2rem;
|
||||
line-height: 22px;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
|
|
|
@ -29,6 +29,10 @@
|
|||
color: #0d5bdd !important;
|
||||
}
|
||||
|
||||
.navbar-nav .dropdown > .nav-link:hover>.icon, .bottom-widget > a:hover>.icon {
|
||||
opacity: 0.8;
|
||||
}
|
||||
|
||||
.input-search,
|
||||
.input-search input {
|
||||
width: 240px;
|
||||
|
@ -154,6 +158,11 @@ body.dialog .main-content {
|
|||
margin-left: 5px;
|
||||
}
|
||||
|
||||
.dialog-footer > .float-left > .custom-control {
|
||||
margin:0;
|
||||
margin-top:6px
|
||||
}
|
||||
|
||||
body.dialog .main-content .footer,
|
||||
.rbform .footer {
|
||||
padding-bottom: 6px;
|
||||
|
@ -187,7 +196,7 @@ a {
|
|||
|
||||
.form-control-plaintext {
|
||||
font-size: 1rem;
|
||||
padding: 7px 0;
|
||||
padding: 8px 0;
|
||||
}
|
||||
|
||||
/* for Form page */
|
||||
|
|
|
@ -1,61 +1,3 @@
|
|||
// 简单过滤器
|
||||
const SimpleFilter = {
|
||||
init(el, entity) {
|
||||
this.root = $(el)
|
||||
this.entity = entity
|
||||
|
||||
this.initEvent()
|
||||
this.loadFilter()
|
||||
},
|
||||
initEvent() {
|
||||
let that = this
|
||||
let btn = this.root.find('.J_search-btn').click(function(){
|
||||
let val = $val(that.root.find('.J_search-text'))
|
||||
that.fireFilter(val)
|
||||
})
|
||||
this.root.find('.J_search-text').keydown(function(event){
|
||||
if (event.which == 13) btn.trigger('click')
|
||||
})
|
||||
this.root.find('.J_qfields').click(function(event){
|
||||
that.showQFieldsModal()
|
||||
})
|
||||
},
|
||||
|
||||
loadFilter() {
|
||||
let that = this
|
||||
$.get(`${rb.baseUrl}/app/${this.entity}/advfilter/simple`, function(res){
|
||||
that.filterExp = res.data || { items: [] }
|
||||
let qFields = []
|
||||
that.filterExp.items.forEach(function(item){
|
||||
qFields.push(item.label)
|
||||
})
|
||||
that.root.find('.J_search-text').attr('placeholder', '搜索 ' + qFields.join('/'))
|
||||
})
|
||||
},
|
||||
fireFilter(val) {
|
||||
if (!this.filterExp || this.filterExp.items.length == 0){
|
||||
rb.notice('请先设置查询字段')
|
||||
let that = this
|
||||
$setTimeout(function(){
|
||||
that.showQFieldsModal()
|
||||
}, 1500)
|
||||
return
|
||||
}
|
||||
|
||||
this.filterExp.values = { 1: val }
|
||||
if (window.rbList) rbList.search(this.filterExp)
|
||||
else console.log('No rbList - ' + this.filterExp)
|
||||
},
|
||||
|
||||
showQFieldsModal() {
|
||||
if (this.qfieldsModal) this.qfieldsModal.show()
|
||||
else this.qfieldsModal = rb.modal(`${rb.baseUrl}/page/general-entity/query-fields?entity=${this.entity}`, '设置查询字段')
|
||||
},
|
||||
hideQFieldsModal() {
|
||||
if (this.qfieldsModal) this.qfieldsModal.hide()
|
||||
}
|
||||
};
|
||||
|
||||
// ~~ 高级过滤器
|
||||
class AdvFilter extends React.Component {
|
||||
constructor(props) {
|
||||
|
|
|
@ -144,7 +144,7 @@ class RbForm extends React.Component {
|
|||
}
|
||||
|
||||
_data.metadata = { entity: this.state.entity, id: this.state.id }
|
||||
if (RbForm.postBefore(data) == false) {
|
||||
if (RbForm.postBefore(_data) == false) {
|
||||
return
|
||||
}
|
||||
|
||||
|
@ -539,14 +539,6 @@ class RbFormFile extends RbFormElement {
|
|||
class RbFormPickList extends RbFormElement {
|
||||
constructor(props) {
|
||||
super(props)
|
||||
|
||||
let options = props.options
|
||||
for (let i = 0; i < options.length; i++){
|
||||
if (options[i]['default'] === true) {
|
||||
this.state.value = options[i]['id']
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
renderElement() {
|
||||
return (
|
||||
|
@ -565,10 +557,16 @@ class RbFormPickList extends RbFormElement {
|
|||
placeholder: '选择' + that.props.label,
|
||||
allowClear: true,
|
||||
}).on('change.select2', function(e){
|
||||
let value = e.target.value
|
||||
that.handleChange({ target:{ value:value } }, true)
|
||||
let opt = e.target.value
|
||||
that.handleChange({ target:{ value: opt } }, true)
|
||||
})
|
||||
$setTimeout(function() { select2.trigger("change") }, 100)
|
||||
|
||||
let val = this.state.value
|
||||
$setTimeout(function() {
|
||||
if (!!val) {
|
||||
}
|
||||
select2.trigger("change")
|
||||
}, 100)
|
||||
}
|
||||
componentWillUnmount() {
|
||||
$(this.refs['field-value']).select2('destroy')
|
||||
|
|
|
@ -311,3 +311,61 @@ rb.RbList = function(props, target) {
|
|||
rb.RbListPagination = function(props, target) {
|
||||
return renderRbcomp(<RbListPagination {...props} />, target || 'pagination')
|
||||
}
|
||||
|
||||
// 简单过滤器
|
||||
const QuickFilter = {
|
||||
init(el, entity) {
|
||||
this.root = $(el)
|
||||
this.entity = entity
|
||||
|
||||
this.initEvent()
|
||||
this.loadFilter()
|
||||
},
|
||||
initEvent() {
|
||||
let that = this
|
||||
let btn = this.root.find('.J_search-btn').click(function(){
|
||||
let val = $val(that.root.find('.J_search-text'))
|
||||
that.fireFilter(val)
|
||||
})
|
||||
this.root.find('.J_search-text').keydown(function(event){
|
||||
if (event.which == 13) btn.trigger('click')
|
||||
})
|
||||
this.root.find('.J_qfields').click(function(event){
|
||||
that.showQFieldsModal()
|
||||
})
|
||||
},
|
||||
|
||||
loadFilter() {
|
||||
let that = this
|
||||
$.get(`${rb.baseUrl}/app/${this.entity}/advfilter/simple`, function(res){
|
||||
that.filterExp = res.data || { items: [] }
|
||||
let qFields = []
|
||||
that.filterExp.items.forEach(function(item){
|
||||
qFields.push(item.label)
|
||||
})
|
||||
that.root.find('.J_search-text').attr('placeholder', '搜索 ' + qFields.join('/'))
|
||||
})
|
||||
},
|
||||
fireFilter(val) {
|
||||
if (!this.filterExp || this.filterExp.items.length == 0){
|
||||
rb.notice('请先设置查询字段')
|
||||
let that = this
|
||||
$setTimeout(function(){
|
||||
that.showQFieldsModal()
|
||||
}, 1500)
|
||||
return
|
||||
}
|
||||
|
||||
this.filterExp.values = { 1: val }
|
||||
if (window.rbList) rbList.search(this.filterExp)
|
||||
else console.log('No rbList - ' + this.filterExp)
|
||||
},
|
||||
|
||||
showQFieldsModal() {
|
||||
if (this.qfieldsModal) this.qfieldsModal.show()
|
||||
else this.qfieldsModal = rb.modal(`${rb.baseUrl}/page/general-entity/quick-fields?entity=${this.entity}`, '设置查询字段')
|
||||
},
|
||||
hideQFieldsModal() {
|
||||
if (this.qfieldsModal) this.qfieldsModal.hide()
|
||||
}
|
||||
};
|
|
@ -32,8 +32,14 @@
|
|||
</div>
|
||||
</div>
|
||||
<div class="dialog-footer">
|
||||
<div class="float-left">
|
||||
<label class="custom-control custom-checkbox custom-control-inline">
|
||||
<input class="custom-control-input" type="checkbox" id="applyFor" value="ALL" checked="checked">
|
||||
<span class="custom-control-label">应用到全部用户</span>
|
||||
</label>
|
||||
</div>
|
||||
<button class="btn btn-primary J_save" type="button">保存</button>
|
||||
<button class="btn btn-secondary" onclick="parent.SimpleFilter.hideQFieldsModal()" type="button">取消</button>
|
||||
<button class="btn btn-secondary" onclick="parent.QuickFilter.hideQFieldsModal()" type="button">取消</button>
|
||||
</div>
|
||||
</div>
|
||||
<%@ include file="/_include/Foot.jsp"%>
|
||||
|
@ -71,8 +77,10 @@ $(document).ready(function(){
|
|||
$.post(rb.baseUrl + '/app/' + entity + '/list-advfilter?cfgid=' + cfgid, JSON.stringify(config), function(res){
|
||||
btn.button('reset')
|
||||
if (res.error_code == 0){
|
||||
parent.SimpleFilter.loadFilter();
|
||||
parent.SimpleFilter.hideQFieldsModal();
|
||||
if (parent.QuickFilter) {
|
||||
parent.QuickFilter.loadFilter();
|
||||
parent.QuickFilter.hideQFieldsModal();
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
|
@ -134,7 +134,7 @@ $(document).ready(function(){
|
|||
else columnsModal = rb.modal('${baseUrl}/page/general-entity/show-columns?entity=${entityName}', '设置列显示')
|
||||
})
|
||||
|
||||
SimpleFilter.init('.input-search', '${entityName}');
|
||||
QuickFilter.init('.input-search', '${entityName}');
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
|
|
|
@ -24,6 +24,12 @@
|
|||
</div>
|
||||
</div>
|
||||
<div class="dialog-footer">
|
||||
<div class="float-left">
|
||||
<label class="custom-control custom-checkbox custom-control-inline">
|
||||
<input class="custom-control-input" type="checkbox" id="applyFor" value="ALL" checked="checked">
|
||||
<span class="custom-control-label">应用到全部用户</span>
|
||||
</label>
|
||||
</div>
|
||||
<button class="btn btn-primary J_save" type="button">保存</button>
|
||||
<button class="btn btn-secondary" onclick="parent.columnsModal.hide()" type="button">取消</button>
|
||||
</div>
|
||||
|
|
Loading…
Reference in a new issue