From 5a8fab4e4b9278e864d98e649536d83c3173c965 Mon Sep 17 00:00:00 2001 From: sudoooooo Date: Wed, 10 Jul 2024 15:30:39 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E4=BC=98=E5=8C=96=E5=BC=95=E5=85=A5?= =?UTF-8?q?=E3=80=81lint=20&=20format?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- web/src/common/logicEngine/ruleConf.ts | 2 +- web/src/common/typeEnum.ts | 20 ++------ web/src/management/api/space.ts | 2 +- web/src/management/components/LeftMenu.vue | 28 +++++----- web/src/management/router/index.ts | 51 ++++++++++++------- web/src/management/store/index.js | 2 +- web/src/management/stores/edit.ts | 31 +++++------ web/src/management/stores/surveyList.ts | 5 +- web/src/management/stores/user.js | 8 ++- web/src/management/stores/workSpace.ts | 4 +- web/src/management/utils/index.js | 13 ++--- web/src/management/utils/types/workSpace.ts | 2 +- .../questions/QuestionContainerB/index.jsx | 14 +---- .../widgets/BinaryChoiceModule/meta.js | 30 +++++------ .../questions/widgets/CheckboxModule/meta.js | 28 +++++----- .../questions/widgets/NpsModule/style.scss | 2 +- .../questions/widgets/RadioModule/meta.js | 34 ++++++------- .../questions/widgets/StarModule/meta.js | 4 +- .../questions/widgets/VoteModule/meta.js | 28 +++++----- web/src/render/adapter/rules.js | 4 +- web/src/render/components/QuestionWrapper.vue | 6 ++- web/src/render/main.js | 2 - web/src/render/pages/EmptyPage.vue | 4 +- web/src/render/pages/IndexPage.vue | 13 ++--- web/src/render/pages/RenderPage.vue | 4 +- web/src/render/store/actions.js | 7 +-- web/src/render/stores/survey.js | 14 ++--- 27 files changed, 174 insertions(+), 188 deletions(-) diff --git a/web/src/common/logicEngine/ruleConf.ts b/web/src/common/logicEngine/ruleConf.ts index 4f979283..bcf27c3a 100644 --- a/web/src/common/logicEngine/ruleConf.ts +++ b/web/src/common/logicEngine/ruleConf.ts @@ -1,4 +1,4 @@ -// 静态数据 +// test:静态数据,实际业务里无用 export const ruleConf = [ { conditions: [ diff --git a/web/src/common/typeEnum.ts b/web/src/common/typeEnum.ts index 755e6f24..14087a02 100644 --- a/web/src/common/typeEnum.ts +++ b/web/src/common/typeEnum.ts @@ -7,7 +7,7 @@ export enum QUESTION_TYPE { BINARY_CHOICE = 'binary-choice', RADIO_STAR = 'radio-star', RADIO_NPS = 'radio-nps', - VOTE = 'vote', + VOTE = 'vote' } // 题目类型标签映射对象 @@ -23,19 +23,13 @@ export const typeTagLabels: Record = { } // 输入类题型 -export const INPUT = [ - QUESTION_TYPE.TEXT, - QUESTION_TYPE.TEXTAREA -] +export const INPUT = [QUESTION_TYPE.TEXT, QUESTION_TYPE.TEXTAREA] // 选择类题型分类 -export const NORMAL_CHOICES = [ - QUESTION_TYPE.RADIO, - QUESTION_TYPE.CHECKBOX -] +export const NORMAL_CHOICES = [QUESTION_TYPE.RADIO, QUESTION_TYPE.CHECKBOX] // 选择类题型分类 -export const CHOICES = [ +export const CHOICES = [ QUESTION_TYPE.RADIO, QUESTION_TYPE.CHECKBOX, QUESTION_TYPE.BINARY_CHOICE, @@ -43,8 +37,4 @@ export const CHOICES = [ ] // 评分题题型分类 -export const RATES = [ - QUESTION_TYPE.RADIO_STAR, - QUESTION_TYPE.RADIO_NPS -] - +export const RATES = [QUESTION_TYPE.RADIO_STAR, QUESTION_TYPE.RADIO_NPS] diff --git a/web/src/management/api/space.ts b/web/src/management/api/space.ts index b0aadda9..b0277276 100644 --- a/web/src/management/api/space.ts +++ b/web/src/management/api/space.ts @@ -71,4 +71,4 @@ export const getCollaboratorPermissions = (surveyId: string) => { surveyId } }) -} \ No newline at end of file +} diff --git a/web/src/management/components/LeftMenu.vue b/web/src/management/components/LeftMenu.vue index e9dc05ab..f60668a4 100644 --- a/web/src/management/components/LeftMenu.vue +++ b/web/src/management/components/LeftMenu.vue @@ -58,18 +58,22 @@ const tabArr = [ } ] const tabs = ref([]) -watch(() => store.state.cooperPermissions, (newVal) => { - tabs.value = [] - // 如果有问卷管理权限,则加入问卷编辑和投放菜单 - if (newVal.includes(SurveyPermissions.SurveyManage)) { - tabs.value.push(tabArr[0]) - tabs.value.push(tabArr[1]) - } - // 如果有数据分析权限,则加入数据分析菜单 - if (newVal.includes(SurveyPermissions.DataManage)) { - tabs.value.push(tabArr[2]) - } -}, { immediate: true }) +watch( + () => store.state.cooperPermissions, + (newVal) => { + tabs.value = [] + // 如果有问卷管理权限,则加入问卷编辑和投放菜单 + if (newVal.includes(SurveyPermissions.SurveyManage)) { + tabs.value.push(tabArr[0]) + tabs.value.push(tabArr[1]) + } + // 如果有数据分析权限,则加入数据分析菜单 + if (newVal.includes(SurveyPermissions.DataManage)) { + tabs.value.push(tabArr[2]) + } + }, + { immediate: true } +)