From dea5523a35a224e0c569d6063d9850d9e8044ad7 Mon Sep 17 00:00:00 2001 From: zhf <1204297681@qq.com> Date: Fri, 27 Dec 2024 21:32:11 +0800 Subject: [PATCH 1/2] =?UTF-8?q?feat:=20=E4=BF=AE=E6=94=B9=E5=80=BC?= =?UTF-8?q?=E8=A7=84=E5=88=99=E8=AE=BE=E8=AE=A1=E7=94=BB=E5=B8=83=E8=BF=9E?= =?UTF-8?q?=E7=BA=BF=E7=9A=84=E8=AE=A1=E7=AE=97=E8=A7=84=E5=88=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../value-rule-design-content.controller.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/packages/valuerule-design/src/panel-items/value-rule-design-content/value-rule-design-content.controller.ts b/packages/valuerule-design/src/panel-items/value-rule-design-content/value-rule-design-content.controller.ts index 5d5e57d3..79dd7818 100644 --- a/packages/valuerule-design/src/panel-items/value-rule-design-content/value-rule-design-content.controller.ts +++ b/packages/valuerule-design/src/panel-items/value-rule-design-content/value-rule-design-content.controller.ts @@ -302,7 +302,12 @@ export class ValueRuleDesignContentController extends PanelItemController { connecting: { allowBlank: false, allowEdge: false, - router: 'manhattan', + router: { + name: 'manhattan', + args: { + snapToGrid: false, + }, + }, }, interacting: false, }); -- Gitee From 79e6a85c1eca5e82ae044b6ea37f5e1fe73e30a3 Mon Sep 17 00:00:00 2001 From: zhf <1204297681@qq.com> Date: Fri, 27 Dec 2024 21:46:29 +0800 Subject: [PATCH 2/2] =?UTF-8?q?fix:=20=E4=BF=AE=E6=94=B9=E9=9D=A2=E6=9D=BF?= =?UTF-8?q?=E9=A1=B9=E9=80=BB=E8=BE=91=E6=8E=92=E5=BA=8F=E4=B8=8D=E6=AD=A3?= =?UTF-8?q?=E7=A1=AE=E5=BC=82=E5=B8=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pspanel-item-logic.service.ts | 33 +++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/packages/panel-design/src/service/pspanel-item-logic/pspanel-item-logic.service.ts b/packages/panel-design/src/service/pspanel-item-logic/pspanel-item-logic.service.ts index 282b20a7..695a29fe 100644 --- a/packages/panel-design/src/service/pspanel-item-logic/pspanel-item-logic.service.ts +++ b/packages/panel-design/src/service/pspanel-item-logic/pspanel-item-logic.service.ts @@ -1,6 +1,7 @@ import { DEService, IDataEntity } from '@ibiz-template/runtime'; import { IHttpResponse } from '@ibiz-template/core'; import { IAppDataEntity, ICodeItem } from '@ibiz/model-core'; +import { generateOrderValue } from 'qx-util'; import { PSPanelItemLogic } from '../../entity'; const ValueOPs: IData = { @@ -65,9 +66,41 @@ export class PSPanelItemLogicService extends DEService { this.beforeUpdate(context, params); } } + if (params && id === 'create') { + await this.fillDefault(context, params); + } return super.exec(id, context, params, params2, header); } + /** + * 填充默认值 + * + * @author zhanghengfeng + * @date 2024-12-27 21:12:12 + * @protected + * @param {IContext} context + * @param {(IData | IData[])} params + * @return {*} {Promise} + */ + protected async fillDefault( + context: IContext, + params: IData | IData[], + ): Promise { + const res = await this.fetchDefault(context); + if (res && res.ok && Array.isArray(res.data)) { + const orderValue = Math.max( + ...res.data.map(item => item.ordervalue || 0), + 0, + ); + const items = Array.isArray(params) ? params : [params]; + items.forEach((item, i) => { + if (item.ordervalue == null) { + item.ordervalue = orderValue + generateOrderValue(i); + } + }); + } + } + /** * 更新之前 * -- Gitee