From 346a51978870b236724701515ef3604413ba4d93 Mon Sep 17 00:00:00 2001 From: houhoz Date: Wed, 6 Dec 2023 14:23:01 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=95=B0=E6=8D=AE=E7=BB=9F=E8=AE=A1?= =?UTF-8?q?=E5=88=97=E8=A1=A8=E5=A2=9E=E5=8A=A0=E7=AD=94=E9=A2=98=E8=80=97?= =?UTF-8?q?=E6=97=B6=E3=80=81=E6=8F=90=E4=BA=A4=E6=97=B6=E9=97=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../surveyManage/service/surveyService.ts | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/server/src/apps/surveyManage/service/surveyService.ts b/server/src/apps/surveyManage/service/surveyService.ts index 3cc4a675..f0674cba 100644 --- a/server/src/apps/surveyManage/service/surveyService.ts +++ b/server/src/apps/surveyManage/service/surveyService.ts @@ -127,7 +127,7 @@ class SurveyService { } getListHeadByDataList(dataList) { - return dataList.map(surveyItem => { + const listHead = dataList.map(surveyItem => { let othersCode; if(surveyItem.type === 'radio-star') { const rangeConfigKeys = Object.keys(surveyItem.rangeConfig) @@ -151,6 +151,17 @@ class SurveyService { othersCode } }) + listHead.push({ + field: 'difTime', + title: '答题耗时(秒)', + type: 'text', + }) + listHead.push({ + field: 'createDate', + title: '提交时间', + type: 'text', + }) + return listHead } async data(condition: { userData:UserType,surveyId: string, pageNum: number, pageSize: number, isShowSecret: boolean }) { @@ -203,7 +214,11 @@ class SurveyService { data[itemKey] = getText(data[itemKey]) } } - return data + return { + ...data, + difTime: (surveySubmitResList.difTime / 1000).toFixed(2), + createDate: moment(surveySubmitResList.createDate).format("YYYY-MM-DD HH:mm:ss") + } }) const total = await surveySubmit.countDocuments({ pageId: condition.surveyId }); return {