diff --git a/.eslintrc.js b/.eslintrc.js index 999f8f53a..477d4b9be 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -110,5 +110,6 @@ module.exports = { $isTrue: true, $fieldIsCompatible: true, $unhideDropdown: true, + AnyRecordSelector: true, }, } diff --git a/src/main/java/com/rebuild/web/project/ProjectTaskController.java b/src/main/java/com/rebuild/web/project/ProjectTaskController.java index c46f21dc3..f903db5ec 100644 --- a/src/main/java/com/rebuild/web/project/ProjectTaskController.java +++ b/src/main/java/com/rebuild/web/project/ProjectTaskController.java @@ -19,6 +19,7 @@ import com.rebuild.core.privileges.UserHelper; import com.rebuild.core.service.project.ProjectHelper; import com.rebuild.core.service.project.ProjectManager; import com.rebuild.core.service.query.AdvFilterParser; +import com.rebuild.core.support.general.FieldValueHelper; import com.rebuild.core.support.i18n.I18nUtils; import com.rebuild.utils.JSONUtils; import com.rebuild.web.BaseController; @@ -146,7 +147,7 @@ public class ProjectTaskController extends BaseController { @GetMapping("tasks/details") public JSON taskDetails(@IdParam(name = "task") ID taskId) { Object[] task = Application.createQueryNoFilter( - "select " + BASE_FIELDS + ",projectId,description,attachments from ProjectTask where taskId = ?") + "select " + BASE_FIELDS + ",projectId,description,attachments,relatedRecord from ProjectTask where taskId = ?") .setParameter(1, taskId) .unique(); JSONObject details = formatTask(task, true); @@ -157,6 +158,14 @@ public class ProjectTaskController extends BaseController { String attachments = (String) task[13]; details.put("attachments", JSON.parseArray(attachments)); + // 相关记录 + ID relatedRecord = (ID) task[14]; + if (relatedRecord != null) { + details.put("relatedRecord", relatedRecord); + String text = FieldValueHelper.getLabelNotry(relatedRecord); + details.put("relatedRecordData", FieldValueHelper.wrapMixValue(relatedRecord, text)); + } + return details; } diff --git a/src/main/resources/i18n/language.en.json b/src/main/resources/i18n/language.en.json index 571b63633..8bfaafcb5 100644 --- a/src/main/resources/i18n/language.en.json +++ b/src/main/resources/i18n/language.en.json @@ -202,8 +202,7 @@ "DeleteSomeConfirm": "Confirm to delete this {0}?", "RemoveSomeConfirm": "Confirm to remove this {0}?", "DeleteCasTips": "Delete associated records at the same time", - "ClickViewReleated": "Click to view related record", - "ReleatedRecord": "Related record", + "ClickViewReleated": "Click to view record", "NotAllow": "Not Allow", "Allow": "Allow", "AllowSome": "Allow {0}", diff --git a/src/main/resources/i18n/language.zh_CN.json b/src/main/resources/i18n/language.zh_CN.json index 82e84cebb..aaa2da02d 100644 --- a/src/main/resources/i18n/language.zh_CN.json +++ b/src/main/resources/i18n/language.zh_CN.json @@ -202,8 +202,7 @@ "DeleteSomeConfirm": "确认删除此{0}?", "RemoveSomeConfirm": "确认移除此{0}?", "DeleteCasTips": "同时删除关联记录", - "ClickViewReleated": "点击查看相关记录", - "ReleatedRecord": "相关记录", + "ClickViewReleated": "点击查看记录", "NotAllow": "不允许", "Allow": "允许", "AllowSome": "允许{0}", diff --git a/src/main/resources/i18n/language.zh_TW.json b/src/main/resources/i18n/language.zh_TW.json index 0086be37a..704f9f4d5 100644 --- a/src/main/resources/i18n/language.zh_TW.json +++ b/src/main/resources/i18n/language.zh_TW.json @@ -202,8 +202,7 @@ "DeleteSomeConfirm": "確認删除此{0}?", "RemoveSomeConfirm": "確認移除此{0}?", "DeleteCasTips": "同時删除關聯記錄", - "ClickViewReleated": "點擊查看相關記錄", - "ReleatedRecord": "相關記錄", + "ClickViewReleated": "點擊查看記錄", "NotAllow": "不允許", "Allow": "允許", "AllowSome": "允許{0}", diff --git a/src/main/resources/metadata-conf.xml b/src/main/resources/metadata-conf.xml index f32845e54..9f8bd2a03 100644 --- a/src/main/resources/metadata-conf.xml +++ b/src/main/resources/metadata-conf.xml @@ -451,9 +451,11 @@ + + diff --git a/src/main/resources/scripts/db-init.sql b/src/main/resources/scripts/db-init.sql index 6bcc037ba..bb24e508b 100644 --- a/src/main/resources/scripts/db-init.sql +++ b/src/main/resources/scripts/db-init.sql @@ -646,6 +646,7 @@ create table if not exists `project_task` ( `DESCRIPTION` text(32767) comment '备注', `ATTACHMENTS` varchar(700) comment '附件', `PARENT_TASK_ID` char(20) comment '父级任务', + `RELATED_RECORD` char(20) comment '相关业务记录', `SEQ` int(11) default '0' comment '排序 (小到大)', `MODIFIED_ON` timestamp not null default current_timestamp comment '修改时间', `MODIFIED_BY` char(20) not null comment '修改人', @@ -653,7 +654,8 @@ create table if not exists `project_task` ( `CREATED_ON` timestamp not null default current_timestamp comment '创建时间', primary key (`TASK_ID`), index IX0_project_task (`PROJECT_ID`, `PROJECT_PLAN_ID`, `SEQ`), - index IX1_project_task (`PROJECT_ID`, `TASK_NUMBER`, `TASK_NAME`, `STATUS`) + index IX1_project_task (`PROJECT_ID`, `TASK_NUMBER`, `TASK_NAME`, `STATUS`), + index IX2_project_task (`RELATED_RECORD`, `PROJECT_ID`) )Engine=InnoDB; -- ************ Entity [ProjectTaskRelation] DDL ************ @@ -765,4 +767,4 @@ insert into `classification` (`DATA_ID`, `NAME`, `DESCRIPTION`, `OPEN_LEVEL`, `I -- DB Version (see `db-upgrade.sql`) insert into `system_config` (`CONFIG_ID`, `ITEM`, `VALUE`) - values ('021-9000000000000001', 'DBVer', 34); + values ('021-9000000000000001', 'DBVer', 35); diff --git a/src/main/resources/scripts/db-upgrade.sql b/src/main/resources/scripts/db-upgrade.sql index 1bfb12bd9..161d1c8e0 100644 --- a/src/main/resources/scripts/db-upgrade.sql +++ b/src/main/resources/scripts/db-upgrade.sql @@ -1,6 +1,11 @@ -- Database upgrade scripts for rebuild 1.x and 2.x -- Each upgraded starts with `-- #VERSION` +-- #35 (v2.3) +alter table `project_task` + add column `RELATED_RECORD` char(20) comment '相关业务记录', + add index IX92_project_task (`RELATED_RECORD`, `PROJECT_ID`); + -- #34 (v2.2) alter table `revision_history` add column `IP_ADDR` varchar(100) comment 'IP地址'; diff --git a/src/main/resources/web/assets/css/dashboard.css b/src/main/resources/web/assets/css/dashboard.css index 2adc17688..651bf7090 100644 --- a/src/main/resources/web/assets/css/dashboard.css +++ b/src/main/resources/web/assets/css/dashboard.css @@ -127,7 +127,7 @@ See LICENSE and COMMERCIAL in the project root for license information. position: absolute; top: 0; right: 0; - padding-top: 9px; + padding-top: 8px; padding-left: 6px; display: none; text-align: left; diff --git a/src/main/resources/web/assets/css/feeds.css b/src/main/resources/web/assets/css/feeds.css index 4a25d6099..280c8cebf 100644 --- a/src/main/resources/web/assets/css/feeds.css +++ b/src/main/resources/web/assets/css/feeds.css @@ -569,19 +569,8 @@ See LICENSE and COMMERCIAL in the project root for license information. border-top-right-radius: 0; } -.feed-options.related .related-record { - width: 295px; -} - -@media (max-width: 1280px) { - .feed-options.related .related-record { - width: 245px; - } -} - -/* in edit */ -.modal-body .feed-options.related .related-record { - width: 250px; +.feed-options.related { + padding-right: 16px; } .rich-content > .appends { diff --git a/src/main/resources/web/assets/css/project-tasks.css b/src/main/resources/web/assets/css/project-tasks.css index ca4f2997f..a36d42c97 100644 --- a/src/main/resources/web/assets/css/project-tasks.css +++ b/src/main/resources/web/assets/css/project-tasks.css @@ -24,7 +24,7 @@ See LICENSE and COMMERCIAL in the project root for license information. position: absolute; top: 0; right: 0; - padding-top: 9px; + padding-top: 8px; padding-left: 6px; display: none; text-align: left; @@ -62,12 +62,12 @@ See LICENSE and COMMERCIAL in the project root for license information. } #plan-boxes .plan-box-wrapper { - flex: 0 0 300px; + flex: 0 0 320px; margin: 0; } #plan-boxes .plan-box-wrapper .plan-box { - width: 275px; + width: 295px; } .plan-box .plan-header .plan-title { diff --git a/src/main/resources/web/assets/css/rb-page.css b/src/main/resources/web/assets/css/rb-page.css index 1f500bb6f..31564f53c 100644 --- a/src/main/resources/web/assets/css/rb-page.css +++ b/src/main/resources/web/assets/css/rb-page.css @@ -2170,6 +2170,14 @@ form.simple { font-size: 18px !important; } +.fs-19 { + font-size: 19px !important; +} + +.fs-20 { + font-size: 20px !important; +} + .danger-hover:hover { color: #ea4335 !important; } diff --git a/src/main/resources/web/assets/js/feeds/feeds-post.js b/src/main/resources/web/assets/js/feeds/feeds-post.js index 8bf72d2e9..ca3783bdb 100644 --- a/src/main/resources/web/assets/js/feeds/feeds-post.js +++ b/src/main/resources/web/assets/js/feeds/feeds-post.js @@ -212,7 +212,16 @@ class FeedsEditor extends React.Component { {this.state.type === 4 && (this._scheduleOptions = c)} initValue={this.state.contentMore} contentMore={this.state.contentMore} />} - {(this.state.type === 2 || this.state.type === 4) && (this._selectRelated = c)} initValue={this.state.relatedRecord} />} + {(this.state.type === 2 || this.state.type === 4) && ( +
+
+
{$L('RelatedRecord')}
+
+ (this._selectRelated = c)} initValue={this.state.relatedRecord} /> +
+
+
+ )} {this.state.type === 3 && (this._announcementOptions = c)} initValue={this.state.contentMore} />} {((this.state.images || []).length > 0 || (this.state.files || []).length > 0) && (
@@ -408,104 +417,6 @@ class SelectGroup extends React.Component { } } -// ~ 选择相关记录 -class SelectRelated extends React.Component { - state = { ...this.props } - - render() { - return ( -
-
-
{$L('ReleatedRecord')}
-
- - - - -