From f6270d78eb4426d4bcd254adf66426b1e0fa8024 Mon Sep 17 00:00:00 2001 From: luojunhui <2807466517@qq.com> Date: Fri, 22 Aug 2025 16:05:36 +0800 Subject: [PATCH] =?UTF-8?q?=E5=95=86=E5=9F=8E=E7=9A=84=E4=B8=80=E9=83=A8?= =?UTF-8?q?=E5=88=86bug=E5=A4=84=E7=90=86=EF=BC=8C=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E6=A0=B8=E6=9B=B4=E6=96=B0=E8=BF=87=E4=BA=86=EF=BC=8C=E5=8E=BB?= =?UTF-8?q?=E6=8E=89=E5=8E=9F=E6=9C=AC=E4=B8=B4=E6=97=B6=E5=A4=84=E7=90=86?= =?UTF-8?q?=E7=9A=84=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/executor/open/mallTemplate/pages/index.tsx | 15 +++++++++++++++ src/executor/tools/task/index.tsx | 17 ++++++++++------- src/ts/core/work/index.ts | 6 +++--- src/ts/core/work/instance.ts | 1 + 4 files changed, 29 insertions(+), 10 deletions(-) diff --git a/src/executor/open/mallTemplate/pages/index.tsx b/src/executor/open/mallTemplate/pages/index.tsx index 0ff49c1df..4ee3a789d 100644 --- a/src/executor/open/mallTemplate/pages/index.tsx +++ b/src/executor/open/mallTemplate/pages/index.tsx @@ -689,6 +689,21 @@ const Provider: React.FC = ({ current, form, renderBody }) => { }); console.log(result); for (let item of result.data) { + // 如果tfields对应的fields本身存在,那tfield的值应与fields本身相同 + const keyMap: { [key: string]: string } = { + 'belongId': 'TbelongId', + 'count': 'Tcount', + 'icons': 'Ticons', + 'price': 'Tprice', + 'remark': 'Tremark', + 'title': 'Ttitle' + }; + + for (const key in item) { + if (keyMap[key] && item[key] !== undefined && item[key] !== null && item[key] !== '') { + item[keyMap[key]] = item[key]; + } + } item = removeTPrefix(item); } const coll = current.directory.resource.genColl('-clicks-count'); diff --git a/src/executor/tools/task/index.tsx b/src/executor/tools/task/index.tsx index bac8044cf..d8a69d9f0 100644 --- a/src/executor/tools/task/index.tsx +++ b/src/executor/tools/task/index.tsx @@ -101,13 +101,16 @@ const TaskContent: React.FC = ({ current, finished }) => { var target = orgCtrl.targets.find( (item) => item.id == current.instance!.defineShareId, ); - const svc = new WorkFormService( - target ?? current.belong, - current.instanceData, - false, - ); - svc.init(); - return svc; + if (target) { + const svc = new WorkFormService( + target ?? current.belong, + current.instanceData, + false, + ); + svc.init(); + return svc; + } + }); const _loadMembers = async (task: schema.XWorkTask): Promise => { diff --git a/src/ts/core/work/index.ts b/src/ts/core/work/index.ts index e0ce5b116..32eb89e81 100644 --- a/src/ts/core/work/index.ts +++ b/src/ts/core/work/index.ts @@ -500,9 +500,9 @@ export class Work extends Version implements IWork { data.fields[form.id] = await form.loadFields(); await form.correctAttributes(); //TODO:内置属性 暂时使用老版本,数据核更新后删除以下判断 - if (form.attributes.find((a) => a.options && a.options.isNative) != undefined) { - data.isNew = false; - } + // if (form.attributes.find((a) => a.options && a.options.isNative) != undefined) { + // data.isNew = false; + // } const matchedForm = pdata?.forms?.find( (f) => f.primaryId && f.primaryId === form.metadata?.primaryId, ); diff --git a/src/ts/core/work/instance.ts b/src/ts/core/work/instance.ts index 9148d2cd8..8031b792c 100644 --- a/src/ts/core/work/instance.ts +++ b/src/ts/core/work/instance.ts @@ -75,6 +75,7 @@ export class Instance implements IInstance { } } } + this._dataLoaded = true; } return this.data; -- Gitee