diff --git a/server/package.json b/server/package.json index f6aade83..b4acf6d2 100644 --- a/server/package.json +++ b/server/package.json @@ -61,8 +61,8 @@ "@types/node": "^20.3.1", "@types/node-forge": "^1.3.11", "@types/supertest": "^2.0.12", - "@typescript-eslint/eslint-plugin": "^6.0.0", - "@typescript-eslint/parser": "^6.0.0", + "@typescript-eslint/eslint-plugin": "^7.16.0", + "@typescript-eslint/parser": "^7.16.0", "cross-env": "^7.0.3", "eslint": "^8.42.0", "eslint-config-prettier": "^9.0.0", @@ -76,7 +76,7 @@ "ts-loader": "^9.4.3", "ts-node": "^10.9.1", "tsconfig-paths": "^4.2.0", - "typescript": "^5.1.3" + "typescript": "^5.5.3" }, "jest": { "moduleFileExtensions": [ diff --git a/server/src/modules/survey/template/surveyTemplate/templateBase.json b/server/src/modules/survey/template/surveyTemplate/templateBase.json index 56574dcc..754c3110 100644 --- a/server/src/modules/survey/template/surveyTemplate/templateBase.json +++ b/server/src/modules/survey/template/surveyTemplate/templateBase.json @@ -1,55 +1,55 @@ { - "bannerConf": { - "titleConfig": { - "mainTitle": "

欢迎填写问卷

为了给您提供更好的服务,希望您能抽出几分钟时间,将您的感受和建议告诉我们,期待您的参与!

", - "subTitle": "" - }, - "bannerConfig": { - "bgImage": "/imgs/skin/17e06b7604a007e1d3e1453b9ddadc3c.webp", - "videoLink": "", - "postImg": "" - } + "bannerConf": { + "titleConfig": { + "mainTitle": "

欢迎填写问卷

为了给您提供更好的服务,希望您能抽出几分钟时间,将您的感受和建议告诉我们,期待您的参与!

", + "subTitle": "" }, - "submitConf": { - "submitTitle": "提交", - "confirmAgain": { - "is_again": true, - "again_text": "确认要提交吗?" - }, - "msgContent": { - "msg_200": "提交成功", - "msg_9001": "您来晚了,感谢支持问卷~", - "msg_9002": "请勿多次提交!", - "msg_9003": "您来晚了,已经满额!", - "msg_9004": "提交失败!" - } - }, - "bottomConf": { - "logoImage": "/imgs/Logo.webp", - "logoImageWidth": "60%" - }, - "baseConf": { - "begTime": "2024-01-01 00:00:00", - "endTime": "2034-01-01 00:00:00", - "tLimit": 0, - "language": "chinese", - "answerBegTime": "00:00:00", - "answerEndTime": "23:59:59" - }, - "skinConf": { - "skinColor": "#4a4c5b", - "inputBgColor": "#ffffff", - "backgroundConf": { - "color": "#fff" - }, - "themeConf": { - "color": "#ffa600" - }, - "contentConf": { - "opacity": 100 - } - }, - "logicConf": { - "showLogicConf": [] + "bannerConfig": { + "bgImage": "/imgs/skin/17e06b7604a007e1d3e1453b9ddadc3c.webp", + "videoLink": "", + "postImg": "" } + }, + "submitConf": { + "submitTitle": "提交", + "confirmAgain": { + "is_again": true, + "again_text": "确认要提交吗?" + }, + "msgContent": { + "msg_200": "提交成功", + "msg_9001": "您来晚了,感谢支持问卷~", + "msg_9002": "请勿多次提交!", + "msg_9003": "您来晚了,已经满额!", + "msg_9004": "提交失败!" + } + }, + "bottomConf": { + "logoImage": "/imgs/Logo.webp", + "logoImageWidth": "60%" + }, + "baseConf": { + "begTime": "2024-01-01 00:00:00", + "endTime": "2034-01-01 00:00:00", + "tLimit": 0, + "language": "chinese", + "answerBegTime": "00:00:00", + "answerEndTime": "23:59:59" + }, + "skinConf": { + "skinColor": "#4a4c5b", + "inputBgColor": "#ffffff", + "backgroundConf": { + "color": "#ffffff" + }, + "themeConf": { + "color": "#ffa600" + }, + "contentConf": { + "opacity": 100 + } + }, + "logicConf": { + "showLogicConf": [] } +} diff --git a/server/src/modules/survey/utils/index.ts b/server/src/modules/survey/utils/index.ts index c8e426ee..0baee98e 100644 --- a/server/src/modules/survey/utils/index.ts +++ b/server/src/modules/survey/utils/index.ts @@ -33,7 +33,9 @@ export function getListHeadByDataList(dataList) { let othersCode; const radioType = ['radio-star', 'radio-nps']; if (radioType.includes(question.type)) { - const rangeConfigKeys = question.rangeConfig ? Object.keys(question.rangeConfig) : []; + const rangeConfigKeys = question.rangeConfig + ? Object.keys(question.rangeConfig) + : []; if (rangeConfigKeys.length > 0) { othersCode = [{ code: `${question.field}_custom`, option: '填写理由' }]; } diff --git a/server/src/modules/workspace/_test/workspace.controller.spec.ts b/server/src/modules/workspace/_test/workspace.controller.spec.ts index 23c393d9..e34409fb 100644 --- a/server/src/modules/workspace/_test/workspace.controller.spec.ts +++ b/server/src/modules/workspace/_test/workspace.controller.spec.ts @@ -154,10 +154,12 @@ describe('WorkspaceController', () => { count: workspaces.length, }); - jest.spyOn(userService, 'getUserListByIds').mockResolvedValue([]); - const result = await controller.findAll(req, {curPage:1,pageSize:10}); + const result = await controller.findAll(req, { + curPage: 1, + pageSize: 10, + }); expect(result.code).toEqual(200); expect(workspaceMemberService.findAllByUserId).toHaveBeenCalledWith({ @@ -167,7 +169,7 @@ describe('WorkspaceController', () => { workspaceIdList: memberList.map((item) => item.workspaceId), page: 1, limit: 10, - name: undefined + name: undefined, }); }); }); diff --git a/server/src/modules/workspace/services/workspace.service.ts b/server/src/modules/workspace/services/workspace.service.ts index 4607cb1f..7ceeec6d 100644 --- a/server/src/modules/workspace/services/workspace.service.ts +++ b/server/src/modules/workspace/services/workspace.service.ts @@ -102,6 +102,9 @@ export class WorkspaceService { where: query, skip, take: limit, + order: { + createDate: -1, + }, }); return { list: data, count }; } 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/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 } +)