Skip to content

Commit

Permalink
merge-3.9 (#846)
Browse files Browse the repository at this point in the history
* Update @rbv

* feat: trigger when update-fields approve-nodes (#728)

* ** NEED TEST **

* Update metadata-conf.xml

* 3.7-dev

* bump: echarts v5

* COLOR_PALETTES

* be: DlgSpecFields into common

* feat: spec approval-node trigger

* feat: hasUpdateFields for all

* tmp: RobotSopConfig

* Update @rbv

* enh: TriggerByTimerJob 未完成也可重进 (#731)

* enh: TriggerByTimerJob 未完成也可重进

* enh: fileName use#698

* feat: UseDbFullText

* !!!@EnableAsync

---------

Co-authored-by: devezhao <[email protected]>

* feat: chart CNMAP  (#732)

* style: chart in datalist

* feat: CNMAP

* feat: Details auto imports 110 (#733)

* js: $.trim, $.isArray, click-on

* feat: details import auto

* enh: $type, select2

* Add lib react18

* bump lib

* Update lint.yml

---------

Co-authored-by: devezhao <[email protected]>

* Update @rbv

* Enh auto approval (#735)

* rbv: AutoApproval

* console: RBAPI ASSISTANT

* Update @rbv

* print Approval Node

* filter: op=HHH

* feat: AutoApproval

* be: use tags

* be: LastLogsViewer.renderLog

* Feat list3 card 100 (#737)

* style

* datalist conf

* feat: mode3

* mode23 style

* enh: datalist2

* fjs: openModal, getType

* Update @rbv

* bump: react18, jq (#738)

* js: $.trim, $.isArray, click-on

* feat: details import auto

* enh: $type, select2

* Add lib react18

* enh: js

* bump lib

* react18

* cnmap style

* actions

* loadmore style

---------

Co-authored-by: devezhao <[email protected]>

* feat: approval step users (#739)

* feat: approvalLastTime

* feat: approvalStepUsers

* img indicator

* Update @rbv

* be: filter

* submail attach

---------

Co-authored-by: devezhao <[email protected]>

* Notify use sms email (#741)

* feat: EmailDistributor, SmsDistributor

* feat: ApprovalStepNodeName

* isOceanBase

---------

Co-authored-by: devezhao <[email protected]>

* Update @rbv

* Update @rbv

* feat: Auto create task 119 (#742)

feat: CreateTask

feat:SMS/EmailDistributor

* be: save cb

* entity searchbox

* feat: REP

* Chart axis 120 (#743)


* style: CNMAP

* feat: Stack Bar

* feat: showHorizontal

* be

---------

Co-authored-by: devezhao <[email protected]>

* Approval expires 114 (#745)


* feat: expiresAuto

* be: approval copy

* be:entity view by code

* feat: tasks list (#746)

* style: icon of chart

* feat: project list tasks

* be: setEditableFields keep sort Gitee#I9EGJB

* be: executeLazy

* Nd trans (#747)

* enh: getDisksUsed

* be: link entity

* feat: ND trans

* style

* be: filter

* icon: zmdi-filter-list

* style: list badge 12px

* detailImports

* style project

* be: $multipleUploader

* feat: sop (#748)

* be

* be: trans 1>N

* enh: sql ver

* styles

* ps style

* feat: sop

* enh: useExecManual for all

---------

Co-authored-by: devezhao <[email protected]>

* Update forms.html

* Report use cond (#749)

* style

* be: sop

* feat: report useFilter

* field image _captureType

* TSID error

---------

Co-authored-by: devezhao <[email protected]>

* Feat datasync 94 (#750)

* be: ref-search pageSize=20

* feat: date W Gitee#I9I67Z

* style

* feat: bar3

* be: charts style

* feat: DataSyncer spec

* Enh extforms (#752)


* dock style

* enh: trigger edit code

* fix: guide

* trubo

* fix: Add no-rollback-for=RepeatedRecordsException

* 通过》已完成

* be: charts

* enh: .detail-form-table.fullscreen

* fix: Gitee#I9J3UR alibaba/easyexcel#3432

* ExcelClipboardData

* Update README.md

---------

Co-authored-by: devezhao <[email protected]>

* Update @rbv

* Feat excel clipboard data (#753)

* style

* feat: csvdata-rebuild

* enh: DataListCategory (Use tree)

* be: Nval duplicate

* Apidock (#754)

* TsetEntity

* theme color

* be: trigger on update

* rm: LazyWaitDetailsFinished

* apiman

* fix: ApprovalStepNodeName

* Enh charts (#755)

* enh: axis filter

* enh: FunnelChart

* feat: SendNotification email attach

* AutoGenReport

* enh: `_readonly ` for setReadonly

* be 3.7 (#756)


* be: nodeName

* url-safe

* md pdf

* $cleanNumbern

* be: text:关联记录>相关记录

* enh: 级联支持N2N字段

* entity-overview

* Dockerfile


* fix yj

* enh: AutoApproval revoke

* Update @rbv

---------

Co-authored-by: devezhao <[email protected]>

* feat: List cat ref (#757)

* be: DataListCategory

* fix: 审批返回上一步有分支节点时错误

* be: 清理备份错误提示

* oshi

* Be 3.7 2 (#759)

* Update MarkdownUtils.java

* be: filter N2N:User

* apiman pdf

* Be 3.7 3 (#760)

* fix

* be: webcam

* Update field-edit.html

* be

* Be 3.7 4 (#761)

* Update system-cfg.html

* ConcatIdFunction

* Update FieldWriteback.java

* be video

* Update media-capturer.js

* Update DataImportController.java

* lang

* be

* Update DataImportController.java

* Update RebuildWebConfigurer.java

* flatpickr

* Update rb-base.js

* handleChange lazy

* fix chart in datalist

* Update submail.js

* style

* Be 3.7 5 (#762)

* $hex2rgb

* be: checkRefDataFilter

* style: feeds

* style: file-icon

* fix: 记录转换 D>M+D

* be install

* be: tests

* feat: form-formula {NOW}

* fix: 日期短格式区间查询

* _readonly37

---------

Co-authored-by: devezhao <[email protected]>

* Be 3.7 6 (#764)


* form: __LAB_FORMACTION_105, __LAB_FORMACTION_103

* __LAB_MINUTESTEP

* fix: 字段更新清空时支持N2N

* be: Installer.java

* feat:  $dropUpload

* be: file RbPreview

* fix

* mde paste

* be dropUpload

* fix: 不触发 onClientProgress???

* Be 3.7 7 (#765)

* fix: num input

* style: NTEXT keep empty-line

* media-capturer.js

* fix: pdf 预览下载文件名不对

* feat: nform

* Update KnownExceptionConverter.java

* be

* Be 3.7 8 (#766)

* be NFORM

* Update form-design.js

* Update charts.js

* Update FormsManager.java

* Be 3.7 9 (#767)


* feat: speclayout

* feat: Gitee#I9UJ7N

* feat: easyaction

* useCode

* Be 3.7 10 (#768)

* v3.7-hide

* lang

* be: targetEntityMatchFields

* fix:

* _StartEntityTypeCode

* be

* Update README.md

* Feat html5 report tinymce (#777)

* f-3.8

* tinymce

* be: template5

* Update @rbv

* Check inst (#778)

* bump lib

* refactor

* feat: stopPropagation

* flatpickr

* fix: time query

* feat: class color

* be

---------

Co-authored-by: devezhao <[email protected]>

* Be easyaction2 (#781)

* Update @rbv

* open: nform

* Update flatpickr.min.js

* fix: class color

* feat: word 相关项支持

* feat: html5 相关项

* Update report-templates.js

* feat: open: __LAB_MATCHFIELDS

* feat: class code

* feat: ConcatArrayFunction

* Update @rbv

* be

* Update @rbv

* fix

* Update @rbv

* style

* Update @rbv

* Protable width (#784)


* feat: series reset

* col-resize

* feat: user batch

* be: IncreasingVar

* be

* enh:reports (#785)

* feat: report CHECKBOX/CHECKBOX2

* open: _cfParent

* enh: 多选字段显示不要边框

* fix:backspace select2

* enh: query maxlength


* enh: FeedsSchedule relatedRecord

* Update @rbv

* File upload cam (#788)


* enh: _captureType

* bump lib

* style: sop

* enh: Share2 edit

* feat: fp

* Update @rbv

* Fp details (#789)


* enh: CreateFeed feedType

* enh: fp for details

* enh: stopPropagation=quickMode

* enh: html5 recordIdMultiple

* be: admin deep=3

* fix: ApprovalFields2Schema complement

* Custom lang (#790)


* feat: PREV_APPROVER_BACKED

* feat; vertical38

* feat: _ProtectedAdmin

* List group tab (#791)

* feat: advListShowCategory-set


* style

* kill-session (#792)

* be: MultipleSessions

feat: kill-session h5

* Be template5 (#793)

* fix: CVE

* $tagStyle2

* Update rb-forms.append.js

* Charts field filter (#796)

* be

* enh: extform search-filter; HANPINY

* be exportReport

* Update DataReportManager.java

* 变更历史合并显示

* feat: class, ref: code-append

* feat: axis filter

* be: html5 preview

* barcode decode

* Update @rbv

* Enh easyaction (#798)

* enh-easyaction

* enh: ValueConvertFunc

* Update @rbv

* Update FieldPrivileges.java

* enh: excel 列表支持值转换(#SIZE不支持)

* Update EasyExcelGenerator.java

* Update @rbv

* Update @rbv

* be

* rm PrivilegesGuardContextHolder

* Update rb-forms.js

* be: wrapReturn

* 多表单适用新建

---------

Co-authored-by: devezhao <[email protected]>

* Update @rbv

* be:3.8-1 (#799)

* be

* HowtoPointcut

* style

* fix SN

* be-3.8-2 (#800)


* be:weakMode

* feat: calcFormulaBackend

* feat: groupFields

* be: sop

* feat: 修改模版文件

* fix

* style

* Be 3.8 3 (#801)

* be

* NODE MIRROR

* Update @rbv

---------

Co-authored-by: devezhao <[email protected]>

* Be 3.8 4 (#802)

* fix: 通过字段匹配没有 SERIES 字段

* fix: best form-layout

* style

* fix: sop

* MysqldumpBin

* style

* Update application-dev.yml

* Update @rbv

* be-3.8-5 (#803)

* Update ValueConvertFunc.java

* pt fixedWidth

* Update AdvFilterParser.java

* YYY, MMM

* Update @rbv

* be: user-delete cascade

* fix

* RbvMissingController

* ROUND

* be

* be-3.8-6 (#804)

* bugfix

* Update ValueConvertFunc.java

* DECIMAL_ROUNDING, etc

* lang

* Update @rbv

* Be 3.8 7 (#805)


* be

* style

* fix

* fix

* Update @rbv

* Update ValueConvertFunc.java

* Be 3.8 8 (#806)

* base64

* be

* Update @rbv

* fix CVE

* lang

* Be 3.8 9 (#807)

* Update @rbv

* codemirror hints

* be NForms

* feat: _expandLine

* fix 单字段保存取消后仍有脏数据

* fix: 代码丢失???

* Be 3.8 10 (#808)

* be

* enh: 字段匹配支持N级

* enh: 补充自增编号顺序

* feat: FromtJS.Query

* Be 3.8 10 (#809)



* er

* Be 3.8 10 (#810)



* er

* fix: 位置字段数据格式

* be

* Be 3.8 11 (#811)

* Update charts.js

* be:表单回调

* -bosskey-show

* report

* fix

* Update DataListWrapper.java

* open:regRowButton

* be

* Update @rbv

* Be 3.8 12 (#812)

* be

* be

* Update DataExporter.java

* fix fjs

* be

* Update @rbv

* beta1

* Update README.md

* Update media-capturer.js

* Update @rbv

* be: quick-filter

* Update AdvFilterParser.java

* Update rb-datalist.common.js

* feat: 触发器执行日

* Update @rbv

* style

* 允许撤回、撤销审批

* Update MetadataGetting.java

* AutoGenReport

* Update form-design.js

* style:sop

---------

Co-authored-by: devezhao <[email protected]>

* Update ServerStatus.java

* 3.9-dev

* Update @rbv

* Update @rbv

* feat:easy-action-129 (#819)

* be:easyaction

* fix: 审批时:重复记录/弱校验

* fix: LiteForm弱校验

* Update @rbv

* Feat approval his 134 (#821)

* __LAB_ADVFILTER_LIMIT

* v3.9 开始控制,同时主记录修改时不再清空明细(视图中还不能控制)

* feat:触发器指定审批步骤选择名称

* feat: approval his

* Update pom.xml

* Mob scan action (#822)

* feat: easyscan

* initialValue

* feat: categoryFields

* Update @rbv

* Autocreate trigger 137 (#825)

* help-url

* undo 字段匹配后台支持

* rm: easy-scan

* enh: picklist radio

* FieldAggregation替代GroupAggregation

* 字段更新支持自动创建

* Update @rbv

* Be session time (#826)

* be:online users

* Update user-settings.js

* barcode specFormat

* feat: extform noRateLimiter

* feat: chart数字单位

* Detail edit on approval (#828)

* feat: user/dept sort

* feat:contacts

* feat: rebuild.conf

* Update @rbv

* Nav admin (#829)

* subnav-entity

* Update CommandArgs.java

* be: filterpane

* __LAB_ADVFILTER_FSDEEP3

* feat: upload updir

* be: style

* nav DASHBOARD

* feat: AllowCustomChart for dash

* nav: ProtectedAdmin

* __LAB_COMMERCIAL11_NORB

* enh: filterpan for date

* refactor: trans (#831)

* refactor: trans

* remove `previewid`

* feat: followingUpdate

* Dash filter (#832)

* feat: LoginChannel

* style: show-more-pill

* fix: 表单后端回填导入也生效

* be code

* fix: ND

* be

* be: barcode width

* style

* feat: 存在同名字段

* be: charts

* Form advcontrol (#835)

* fix

* fix: ChartBar2

* be

* rm:renderCustomizedFormArea; initialVal:$DETAILS$

* style

* be:3.9a (#836)

* feat: list-stats color

* feat: form extrasAction

* fix: easyaction

* be:3.9b (#837)

* be:AutoGenReport

* fix: task loading

* be: ann popup

* mdi7

* style

* enh: 列表分组:支持文本字段

* enh: 转换多个

* feat: 修改密码重新登陆

* feat: 查看公告未读用户

* enh: 触发器直接执行禁止并发

* rbspkg

* rbsystem install

* tests

* Be 3.9c (#838)

* be isSuperAdmin

* enh: ee:记录转换

* be: easyaction

* be: fjs

* style

---------

Co-authored-by: RB <[email protected]>

* Be 3.9d (#839)

* be: init-sql

* modal aria-hidden="true"

* feat: list def=

* feat: feishu

* fix: @img on word/h5

* fix: @img 相关项

* style

---------

Co-authored-by: RB <[email protected]>

* Be 3.9e (#841)

* fix: 整数单位

* fix: 字段聚合回填N引用;enh:CommonsService#getBaseService

* be:审批完成保留审批步骤字段

* be: ee button

* fix: Share2

* Update @rbv

* be: concacts

* Update contacts.css

* Update @rbv

* Update ChartData.java

* be

---------

Co-authored-by: RB <[email protected]>

* Be 3.9f (#842)

* fix:3级字段显示问题

* Update @rbv

* Update @rbv

* lang

* enh: ee:明细直接新建

* Update @rbv

* fix

* fix: chart flag

* Update transform-design.js

---------

Co-authored-by: RB <[email protected]>

* Update @rbv

* Be 3.9g (#844)

* fix: ClassificationSelector keepModalOpen

* fix: 记录转换预览回填

* fix

* Update GeneralOperatingController.java

* s

* Update @rbv

---------

Co-authored-by: RB <[email protected]>

* Update @rbv

* Be 3.9g (#845)

* fix: ClassificationSelector keepModalOpen

* fix: 记录转换预览回填

* fix

* Update GeneralOperatingController.java

* s

* Update @rbv

* fix

* be

* fix charts

* Update @rbv

* be nav

* Update trigger-design.js

* be

* fix: 触发器按设置的审批步骤来

* beta1

* Update README.md

* Update ApprovalStepService.java

---------

Co-authored-by: RB <[email protected]>

---------

Co-authored-by: devezhao <[email protected]>
  • Loading branch information
getrebuild and devezhao authored Dec 15, 2024
1 parent 4281a27 commit 436c01c
Show file tree
Hide file tree
Showing 222 changed files with 4,714 additions and 1,517 deletions.
5 changes: 5 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,9 @@ module.exports = {
$isTrue: true,
$fieldIsCompatible: true,
$unhideDropdown: true,
RecordSelector: true,
AnyRecordSelector: true,
ReferenceSearcher: true,
AsideTree: true,
$useMap: true,
BaiduMap: true,
Expand Down Expand Up @@ -146,5 +148,8 @@ module.exports = {
$isImage: true,
$dropUpload: true,
$tagStyle2: true,
$clearSelection: true,
DlgTransform: true,
$select2OpenTemplateResult: true,
},
}
2 changes: 1 addition & 1 deletion @rbv
Submodule @rbv updated from 20b87f to 6d1d8a
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,17 @@

> **福利:加入 REBUILD VIP 用户 QQ 交流群 819865721 1013051587 GET 使用技能**
## V3.8 新特性
## V3.9 新特性

本次更新为你带来众多功能增强与优化。

1. [新增] HTML 报表模版
2. [新增] 多表单布局
3. [新增] 明细支持 Excel 粘贴录入
4. [新增] 图片/附件支持摄像头上传模式
5. [新增] 手机版数据列表可导出报表
6. [新增] 多个 FrontJS 函数
7. [新增] 用户支持批量操作
1. [新增] 导出报表触发器
2. [新增] 字段更新、字段聚合支持自动新建记录
3. [新增] 自定义操作(按钮)
4. [新增] 通讯录功能
5. [新增] 图表支持选择主题颜色、显示单位
6. [新增] 可查看记录的所有历史审批
7. [新增] 多个 FrontJS 函数
8. [优化] 20+ 细节/BUG/安全性更新
9. ...

Expand Down
3 changes: 1 addition & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
</parent>
<groupId>com.rebuild</groupId>
<artifactId>rebuild</artifactId>
<version>3.8.6</version>
<version>3.9.0-beta1</version>
<name>rebuild</name>
<description>Building your business-systems freely!</description>
<url>https://getrebuild.com/</url>
Expand Down Expand Up @@ -218,7 +218,6 @@
</exclusion>
</exclusions>
</dependency>
<!-- USE UNDERTOW -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId>
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/com/rebuild/core/Application.java
Original file line number Diff line number Diff line change
Expand Up @@ -74,11 +74,11 @@ public class Application implements ApplicationListener<ApplicationStartedEvent>
/**
* Rebuild Version
*/
public static final String VER = "3.8.6";
public static final String VER = "3.9.0-beta1";
/**
* Rebuild Build [MAJOR]{1}[MINOR]{2}[PATCH]{2}[BUILD]{2}
*/
public static final int BUILD = 3080611;
public static final int BUILD = 3090001;

static {
// Driver for DB
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ private void aesDecrypt(Properties ps) {
String newValue = AES.decryptQuietly(value);
if (newValue == null) {
newValue = StringUtils.EMPTY;
log.warn("Decrypting error (Use blank string) : " + name);
log.warn("Decrypting error (Use blank string) : {}", name);
}
ps.put(name, newValue);
}
Expand Down
89 changes: 68 additions & 21 deletions src/main/java/com/rebuild/core/configuration/NavBuilder.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
import com.rebuild.core.privileges.RoleService;
import com.rebuild.core.privileges.UserHelper;
import com.rebuild.core.privileges.UserService;
import com.rebuild.core.service.dashboard.DashboardManager;
import com.rebuild.core.service.project.ProjectManager;
import com.rebuild.core.support.KVStorage;
import com.rebuild.core.support.License;
Expand Down Expand Up @@ -66,10 +67,11 @@ private NavBuilder() {
// 默认导航
private static final JSONArray NAVS_DEFAULT = JSONUtils.toJSONObjectArray(
NAV_ITEM_PROPS,
new Object[][] {
new Object[] { "chart-donut", "动态", "BUILTIN", NAV_FEEDS },
new Object[] { "shape", "项目", "BUILTIN", NAV_PROJECT },
new Object[] { "folder", "文件", "BUILTIN", NAV_FILEMRG }
new Object[][]{
new Object[]{"chart-donut", "动态", "BUILTIN", NAV_FEEDS},
new Object[]{"folder", "文件", "BUILTIN", NAV_FILEMRG},
new Object[]{"account-box-phone", "通讯录", "BUILTIN", NAV_CONTACT},
new Object[]{"shape", "项目", "BUILTIN", NAV_PROJECT},
});

// 新建项目
Expand Down Expand Up @@ -119,7 +121,7 @@ public JSONArray getUserNav(ID user, String useNav) {

if (config == null) {
JSONArray useDefault = replaceLang(NAVS_DEFAULT);
((JSONObject) useDefault.get(1)).put("sub", buildAvailableProjects(user));
((JSONObject) useDefault.get(3)).put("sub", buildAvailableProjects(user));
return useDefault;
}

Expand All @@ -145,6 +147,8 @@ public JSONArray getUserNav(ID user, String useNav) {
iter.remove();
} else if (NAV_PROJECT.equals(nav.getString("value"))) {
nav.put("sub", buildAvailableProjects(user));
} else if (NAV_DASHBOARD.equals(nav.getString("value"))) {
nav.put("sub", buildAvailableDashboards(user));
}
}

Expand All @@ -168,7 +172,8 @@ private boolean isFilterNavItem(JSONObject item, ID user) {
if ("ENTITY".equalsIgnoreCase(type)) {
if (NAV_PARENT.equals(value)) {
return true;
} else if (NAV_FEEDS.equals(value) || NAV_FILEMRG.equals(value) || NAV_PROJECT.equals(value)) {
} else if (NAV_FEEDS.equals(value) || NAV_FILEMRG.equals(value)
|| NAV_PROJECT.equals(value) || NAV_CONTACT.equals(value) || NAV_DASHBOARD.equals(value)) {
return false;
} else if (!MetadataHelper.containsEntity(value)) {
log.warn("Unknown entity in nav : {}", value);
Expand Down Expand Up @@ -256,6 +261,27 @@ private JSONArray buildAvailableProjects(ID user) {
return navsOfProjects;
}

/**
* 动态获取仪表盘菜单
*
* @param user
* @return
*/
private JSONArray buildAvailableDashboards(ID user) {
JSONArray dashs = (JSONArray) DashboardManager.instance.getAvailable(user, false);
if (dashs == null || dashs.isEmpty()) return JSONUtils.EMPTY_ARRAY;

JSONArray itemsOfNav = new JSONArray();
for (Object d : dashs) {
JSONArray dash = (JSONArray) d;
JSONObject item = JSONUtils.toJSONObject(
NAV_ITEM_PROPS,
new Object[]{"--", dash.getString(4), NAV_DASHBOARD, dash.getString(0)});
itemsOfNav.add(item);
}
return itemsOfNav;
}

/**
* 首次安装添加菜单
*
Expand Down Expand Up @@ -382,25 +408,37 @@ static String renderNavItem(JSONObject item, String activeNav) {
}

} else if (NAV_FEEDS.equals(navName)) {
navName = "nav_entity-FEEDS";
navName = "nav_entity--FEEDS";
navUrl = AppUtils.getContextPath("/feeds/home");

} else if (NAV_FILEMRG.equals(navName)) {
navName = "nav_entity-ATTACHMENT";
navName = "nav_entity--ATTACHMENT";
navUrl = AppUtils.getContextPath("/files/home");

} else if (NAV_CONTACT.equals(navName)) {
navName = "nav_entity--CONTACTS";
navUrl = AppUtils.getContextPath("/contacts/home");

} else if (NAV_PROJECT.equals(navName)) {
navName = "nav_entity-PROJECT";
navName = "nav_entity--PROJECT";
navUrl = AppUtils.getContextPath("/project/search");

} else if (NAV_PROJECT.equals(navType)) {
navName = "nav_project-" + navName;
navUrl = String.format("%s/project/%s/tasks", AppUtils.getContextPath(), navUrl);

} else if (navName.startsWith(NAV_PROJECT)) {
navName = "nav_project--add";
navName = "nav_project-add";
navUrl = AppUtils.getContextPath("/admin/projects");

} else if (NAV_DASHBOARD.equals(navType)) {
navName = "nav_dashboard-" + navName;
navUrl = String.format("%s/dashboard/home?d=%s", AppUtils.getContextPath(), navUrl);

} else if (NAV_DASHBOARD.equals(navName)) {
navName = "nav_dashboard-DASHBOARD";
navUrl = String.format("%s/dashboard/home", AppUtils.getContextPath());

} else {
navEntity = navName;
navName = "nav_entity-" + navName;
Expand All @@ -417,9 +455,6 @@ static String renderNavItem(JSONObject item, String activeNav) {
JSONArray subNavs = null;
if (activeNav != null) {
subNavs = item.getJSONArray("sub");
if (subNavs == null || subNavs.isEmpty()) {
subNavs = null;
}
}

String navItemHtml;
Expand All @@ -429,14 +464,25 @@ static String renderNavItem(JSONObject item, String activeNav) {
String parentClass = " parent";
if (item.getBooleanValue("open")) parentClass += " open";

navItemHtml = String.format(
"<li class=\"%s\" data-entity=\"%s\"><a href=\"%s\" target=\"%s\"><i class=\"icon %s\"></i><span>%s</span></a>",
navName + (subNavs == null ? StringUtils.EMPTY : parentClass),
navEntity == null ? StringUtils.EMPTY : navEntity,
subNavs == null ? navUrl : "###",
isOutUrl ? "_blank" : "_self",
iconClazz,
navText);
// v3.9 No icon
if ("zmdi zmdi---".equals(iconClazz)) {
navItemHtml = String.format(
"<li class=\"%s\" data-entity=\"%s\"><a href=\"%s\" target=\"%s\"><span>%s</span></a>",
navName + (subNavs == null ? StringUtils.EMPTY : parentClass),
navEntity == null ? StringUtils.EMPTY : navEntity,
subNavs == null ? navUrl : "###",
isOutUrl ? "_blank" : "_self",
navText);
} else {
navItemHtml = String.format(
"<li class=\"%s\" data-entity=\"%s\"><a href=\"%s\" target=\"%s\"><i class=\"icon %s\"></i><span>%s</span></a>",
navName + (subNavs == null ? StringUtils.EMPTY : parentClass),
navEntity == null ? StringUtils.EMPTY : navEntity,
subNavs == null ? navUrl : "###",
isOutUrl ? "_blank" : "_self",
iconClazz,
navText);
}
}

StringBuilder navHtml = new StringBuilder(navItemHtml);
Expand All @@ -451,6 +497,7 @@ static String renderNavItem(JSONObject item, String activeNav) {
JSONObject subNav = (JSONObject) o;
subHtml.append(renderNavItem(subNav, null));
}
if (subNavs.isEmpty()) subHtml.append(String.format("<li><a class=\"text-muted\">%s</a></li>", Language.L("暂无可用")));

subHtml.append("</ul></div></li></ul>");
navHtml.append(subHtml);
Expand Down
4 changes: 4 additions & 0 deletions src/main/java/com/rebuild/core/configuration/NavManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ public class NavManager extends BaseLayoutManager {
public static final String NAV_FEEDS = "$FEEDS$";
// 项目
public static final String NAV_PROJECT = "$PROJECT$";
// 通讯录
public static final String NAV_CONTACT = "$CONTACT$";
// 仪表盘
public static final String NAV_DASHBOARD = "$DASHBOARD$";

// 分栏
public static final String NAV_DIVIDER = "$DIVIDER$";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ public JSON getListFields(String entity, ID user) {
/**
* @param entity
* @param user
* @param useSysFlag
* @param useSysFlag 优先使用系统指定的 `SYS XXX` or ID
* @return
*/
public JSON getListFields(String entity, ID user, String useSysFlag) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import com.rebuild.core.configuration.ConfigBean;
import com.rebuild.core.privileges.UserHelper;
import com.rebuild.core.privileges.UserService;
import com.rebuild.utils.JSONUtils;

/**
* 自定义操作按钮
Expand All @@ -22,8 +23,11 @@ public class EasyActionManager extends BaseLayoutManager {

public static final EasyActionManager instance = new EasyActionManager();

private EasyActionManager() {
}
private static final String TYPE_DATALIST = "datalist";
private static final String TYPE_DATAROW = "datarow";
private static final String TYPE_VIEW = "view";

private EasyActionManager() {}

/**
* @param entity
Expand All @@ -34,45 +38,50 @@ public JSON getEasyAction(String entity, ID user) {
ConfigBean cb = getLayout(UserService.SYSTEM_USER, entity, TYPE_EASYACTION, null);
if (cb == null) return null;

JSONArray items;
try {
items = (JSONArray) cb.getJSON("config");
} catch (Exception ignored) {
return null;
}
if (items == null || items.isEmpty()) return null;

JSONArray items4User = new JSONArray();
for (Object item : items) {
JSONObject itemObj = (JSONObject) item;

JSONArray itemsL2 = itemObj.getJSONArray("items");
boolean hasChild = itemsL2 != null && !itemsL2.isEmpty();
if (hasChild) {
JSONArray items4UserL2 = new JSONArray();
for (Object itemL2 : itemsL2) {
JSONObject itemL2Obj = (JSONObject) itemL2;
String shareTo = itemL2Obj.getString("shareTo");
if (UserHelper.isAdmin(user) || isShareTo(shareTo, user)) {
items4UserL2.add(itemL2Obj);
Object config = cb.getJSON("config");
JSONObject configJson;
if (config instanceof JSONArray) configJson = JSONUtils.toJSONObject(TYPE_DATALIST, config);
else configJson = config == null ? null : (JSONObject) config;

if (configJson == null || configJson.isEmpty()) return null;

JSONObject action4User = new JSONObject();
for (String type : configJson.keySet()) {
final JSONArray items = (JSONArray) configJson.get(type);

JSONArray items4User = new JSONArray();
for (Object item : items) {
JSONObject itemObj = (JSONObject) item;

JSONArray itemsL2 = itemObj.getJSONArray("items");
boolean hasChild = itemsL2 != null && !itemsL2.isEmpty();
if (hasChild) {
JSONArray items4UserL2 = new JSONArray();
for (Object itemL2 : itemsL2) {
JSONObject itemL2Obj = (JSONObject) itemL2;
String shareTo = itemL2Obj.getString("shareTo");
if (UserHelper.isAdmin(user) || isShareTo(shareTo, user)) {
items4UserL2.add(itemL2Obj);
}
}
}

// 是否可见由子元素确定
if (!items4UserL2.isEmpty()) {
itemObj.put("items", items4UserL2);
items4User.add(itemObj);
}
// 是否可见由子元素确定
if (!items4UserL2.isEmpty()) {
itemObj.put("items", items4UserL2);
items4User.add(itemObj);
}

} else {
String shareTo = itemObj.getString("shareTo");
if (UserHelper.isAdmin(user) || isShareTo(shareTo, user)) {
items4User.add(itemObj);
} else {
String shareTo = itemObj.getString("shareTo");
if (UserHelper.isAdmin(user) || isShareTo(shareTo, user)) {
items4User.add(itemObj);
}
}
}
}

return items4User;
if (!items4User.isEmpty()) action4User.put(type, items4User);
}
return action4User;
}

/**
Expand Down
Loading

0 comments on commit 436c01c

Please sign in to comment.