From dc7275aeee7e5a6643d55687363588c29efe08bf Mon Sep 17 00:00:00 2001 From: dayou <853094838@qq.com> Date: Fri, 14 Jun 2024 18:54:11 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=8A=BD=E7=A6=BB=E9=A2=98=E5=9E=8B?= =?UTF-8?q?=E6=9E=9A=E4=B8=BE=20(#272)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat: 抽离题型枚举 * fix: 投放的链接加时间戳去掉ifream缓存 * feat: serve端的node engines --- server/package.json | 4 ++ web/src/common/typeEnum.ts | 50 +++++++++++++++++++ .../logicModule/components/ConditionView.vue | 4 +- .../questionModule/components/TypeList.vue | 6 +-- .../pages/list/components/BaseList.vue | 2 +- .../pages/list/components/SpaceModify.vue | 1 - .../management/pages/publish/PublishPage.vue | 2 +- .../utils/{constant.js => constant.ts} | 9 ++-- web/src/management/utils/index.js | 3 +- .../questions/common/config/tagList.js | 15 ------ .../EditOptions/Options/OptionEditBar.vue | 3 +- .../TitleModules/TitleContent/index.jsx | 4 +- .../questions/widgets/VoteModule/index.jsx | 4 +- .../materials/setters/widgets/InputNumber.vue | 4 +- web/src/render/adapter/formValue.js | 3 +- web/src/render/adapter/question.js | 4 +- web/src/render/adapter/rules.js | 11 ++-- web/src/render/components/QuestionWrapper.vue | 7 +-- web/src/render/constant/index.js | 14 ------ 19 files changed, 88 insertions(+), 62 deletions(-) create mode 100644 web/src/common/typeEnum.ts rename web/src/management/utils/{constant.js => constant.ts} (52%) delete mode 100644 web/src/materials/questions/common/config/tagList.js delete mode 100644 web/src/render/constant/index.js diff --git a/server/package.json b/server/package.json index 44164d74..f6aade83 100644 --- a/server/package.json +++ b/server/package.json @@ -97,5 +97,9 @@ "moduleNameMapper": { "^src/(.*)$": "/$1" } + }, + "engines": { + "node": ">=18.0.0", + "npm": ">=8.6.0" } } diff --git a/web/src/common/typeEnum.ts b/web/src/common/typeEnum.ts new file mode 100644 index 00000000..755e6f24 --- /dev/null +++ b/web/src/common/typeEnum.ts @@ -0,0 +1,50 @@ +// 题型枚举 +export enum QUESTION_TYPE { + TEXT = 'text', + TEXTAREA = 'textarea', + RADIO = 'radio', + CHECKBOX = 'checkbox', + BINARY_CHOICE = 'binary-choice', + RADIO_STAR = 'radio-star', + RADIO_NPS = 'radio-nps', + VOTE = 'vote', +} + +// 题目类型标签映射对象 +export const typeTagLabels: Record = { + [QUESTION_TYPE.TEXT]: '单行输入框', + [QUESTION_TYPE.TEXTAREA]: '多行输入框', + [QUESTION_TYPE.RADIO]: '单选', + [QUESTION_TYPE.CHECKBOX]: '多选', + [QUESTION_TYPE.BINARY_CHOICE]: '判断', + [QUESTION_TYPE.RADIO_STAR]: '评分', + [QUESTION_TYPE.RADIO_NPS]: 'NPS评分', + [QUESTION_TYPE.VOTE]: '投票' +} + +// 输入类题型 +export const INPUT = [ + QUESTION_TYPE.TEXT, + QUESTION_TYPE.TEXTAREA +] + +// 选择类题型分类 +export const NORMAL_CHOICES = [ + QUESTION_TYPE.RADIO, + QUESTION_TYPE.CHECKBOX +] + +// 选择类题型分类 +export const CHOICES = [ + QUESTION_TYPE.RADIO, + QUESTION_TYPE.CHECKBOX, + QUESTION_TYPE.BINARY_CHOICE, + QUESTION_TYPE.VOTE +] + +// 评分题题型分类 +export const RATES = [ + QUESTION_TYPE.RADIO_STAR, + QUESTION_TYPE.RADIO_NPS +] + diff --git a/web/src/management/pages/edit/modules/logicModule/components/ConditionView.vue b/web/src/management/pages/edit/modules/logicModule/components/ConditionView.vue index b1bef149..639e3d74 100644 --- a/web/src/management/pages/edit/modules/logicModule/components/ConditionView.vue +++ b/web/src/management/pages/edit/modules/logicModule/components/ConditionView.vue @@ -65,7 +65,7 @@