From 968576b665ae4a5aec6c025a11758db6e0d2914c Mon Sep 17 00:00:00 2001 From: dayou <853094838@qq.com> Date: Fri, 22 Mar 2024 17:51:32 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E7=9A=AE=E8=82=A4=E8=AE=BE=E7=BD=AE=20?= =?UTF-8?q?(#78)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../modules/survey/template/banner/index.json | 109 +++++------ .../surveyTemplate/survey/normal.json | 4 - .../template/surveyTemplate/survey/nps.json | 4 - .../surveyTemplate/survey/register.json | 4 - .../template/surveyTemplate/survey/vote.json | 4 - .../template/surveyTemplate/templateBase.json | 11 +- .../config/setterConfig/bannerConfig.js | 82 ++++----- .../config/setterConfig/logoConfig.js | 10 +- .../config/setterConfig/skinConfig.js | 46 +++++ web/src/management/config/skinPresets.js | 7 + .../questionModule => }/components/logo.vue | 9 +- .../components/mainTitle.vue | 12 +- .../components/materialGroup.vue | 0 .../components/questionWrapper.vue | 6 +- .../components/setterField.vue | 0 .../questionModule => }/components/submit.vue | 4 +- web/src/management/pages/edit/index.vue | 1 - .../edit/modules/generalModule/pageNav.vue | 31 ++-- .../questionModule/components/bannerList.vue | 77 -------- .../modules/questionModule/previewPanel.vue | 40 +++-- .../modules/questionModule/setterPanel.vue | 14 +- .../components/banner.vue | 4 +- .../settingModule/components/overTime.vue | 3 +- .../settingModule/components/success.vue | 3 +- .../settingModule/config/baseFormConfig.js | 6 +- .../catalogPanel.vue} | 43 +++-- .../previewPanel.vue} | 35 ++-- .../setterPanel.vue} | 6 +- .../settingModule/skin/catalogPanel.vue | 170 ++++++++++++++++++ .../settingModule/skin/previewPanel.vue | 169 +++++++++++++++++ .../settingModule/skin/setterPanel.vue | 119 ++++++++++++ .../pages/edit/pages/skin/content.vue | 32 ++++ .../pages/edit/pages/skin/index.vue | 68 +++++++ .../{resultConfig.vue => skin/result.vue} | 8 +- web/src/management/router/index.js | 31 +++- web/src/management/store/edit/actions.js | 3 + web/src/management/store/edit/mutations.js | 7 +- web/src/management/store/edit/state.js | 11 +- web/src/management/styles/icon.scss | 11 +- web/src/management/styles/skin.scss | 12 ++ web/src/management/styles/variable.scss | 35 ++++ .../questions/common/css/default.scss | 25 +-- .../questions/common/css/radioStar.scss | 1 + .../AdvancedConfig/OptionConfig.vue | 2 +- .../components/Options/OptionEdit.vue | 2 +- .../components/Options/OptionEditBar.vue | 2 +- .../questions/components/Progress.vue | 1 + .../materials/setters/widgets/ColorPicker.vue | 31 ++++ .../materials/setters/widgets/FormItem.vue | 13 +- .../setters/widgets/InputPercent.vue | 11 +- .../setters/widgets/SliderSetter.vue | 37 ++++ web/src/render/App.vue | 36 +++- web/src/render/components/header.vue | 43 +---- web/src/render/components/logo.vue | 1 - web/src/render/components/mainTitle.vue | 68 +++++++ web/src/render/components/submit.vue | 5 +- web/src/render/pages/errorPage.vue | 28 ++- web/src/render/pages/index.vue | 40 ++++- web/src/render/pages/successPage.vue | 26 ++- 59 files changed, 1218 insertions(+), 405 deletions(-) create mode 100644 web/src/management/config/setterConfig/skinConfig.js create mode 100644 web/src/management/config/skinPresets.js rename web/src/management/pages/edit/{modules/questionModule => }/components/logo.vue (89%) rename web/src/management/pages/edit/{modules/questionModule => }/components/mainTitle.vue (83%) rename web/src/management/pages/edit/{modules/questionModule => }/components/materialGroup.vue (100%) rename web/src/management/pages/edit/{modules/questionModule => }/components/questionWrapper.vue (99%) rename web/src/management/pages/edit/{modules/questionModule => }/components/setterField.vue (100%) rename web/src/management/pages/edit/{modules/questionModule => }/components/submit.vue (90%) delete mode 100644 web/src/management/pages/edit/modules/questionModule/components/bannerList.vue rename web/src/management/pages/edit/modules/{questionModule => settingModule}/components/banner.vue (95%) rename web/src/management/pages/edit/modules/settingModule/{resultCatalog.vue => result/catalogPanel.vue} (65%) rename web/src/management/pages/edit/modules/settingModule/{resultPreview.vue => result/previewPanel.vue} (61%) rename web/src/management/pages/edit/modules/settingModule/{resultSetter.vue => result/setterPanel.vue} (97%) create mode 100644 web/src/management/pages/edit/modules/settingModule/skin/catalogPanel.vue create mode 100644 web/src/management/pages/edit/modules/settingModule/skin/previewPanel.vue create mode 100644 web/src/management/pages/edit/modules/settingModule/skin/setterPanel.vue create mode 100644 web/src/management/pages/edit/pages/skin/content.vue create mode 100644 web/src/management/pages/edit/pages/skin/index.vue rename web/src/management/pages/edit/pages/{resultConfig.vue => skin/result.vue} (56%) create mode 100644 web/src/management/styles/skin.scss create mode 100644 web/src/materials/setters/widgets/ColorPicker.vue create mode 100644 web/src/materials/setters/widgets/SliderSetter.vue create mode 100644 web/src/render/components/mainTitle.vue diff --git a/server/src/modules/survey/template/banner/index.json b/server/src/modules/survey/template/banner/index.json index 80a8f056..e1cd290d 100644 --- a/server/src/modules/survey/template/banner/index.json +++ b/server/src/modules/survey/template/banner/index.json @@ -1,12 +1,64 @@ { "temp": { "key": "default", - "name": "默认分类", + "name": "全部", "list": [{ "src": "/imgs/skin/17e06b7604a007e1d3e1453b9ddadc3c.webp", "title": "1" }] -}, + }, + "scenery": { + "key": "scenery", + "name": "风景", + "list": [{ + "src": "/imgs/skin/SyiLRcukyE1558430525760.webp", + "title": "1" + }, { + "src": "/imgs/skin/sqYig4AcWr1558430525663.webp", + "title": "2" + }, { + "src": "/imgs/skin/ElNeqJT2I21558430526165.webp", + "title": "3" + }, { + "src": "/imgs/skin/CxQkSU6AY21558430526163.webp", + "title": "4" + }, { + "src": "/imgs/skin/VTUwbp6vY61558430527320.webp", + "title": "5" + }, { + "src": "/imgs/skin/SHs0K703Yn1558430527218.webp", + "title": "6" + }, { + "src": "/imgs/skin/oVTedX9V4s1558430527671.webp", + "title": "7" + }] + }, + "business": { + "key": "business", + "name": "商务", + "list": [{ + "src": "/imgs/skin/3ABKqvDaVn1558514860472.webp", + "title": "1" + }, { + "src": "/imgs/skin/OewuaQmWoq1558514860285.webp", + "title": "2" + }, { + "src": "/imgs/skin/HuVqqtbFjs1558514860570.webp", + "title": "3" + }, { + "src": "/imgs/skin/icSlqsr0uZ1558514860875.webp", + "title": "4" + }, { + "src": "/imgs/skin/Qu9rg33wmq1558514861015.webp", + "title": "5" + }, { + "src": "/imgs/skin/145gBCRtNP1558514861211.webp", + "title": "6" + }, { + "src": "/imgs/skin/ykWLFV0QWj1558514861444.webp", + "title": "7" + }] + }, "activity": { "key": "activity", "name": "节日", @@ -41,32 +93,6 @@ "title": "7" }] }, - "scenery": { - "key": "scenery", - "name": "风景", - "list": [{ - "src": "/imgs/skin/SyiLRcukyE1558430525760.webp", - "title": "1" - }, { - "src": "/imgs/skin/sqYig4AcWr1558430525663.webp", - "title": "2" - }, { - "src": "/imgs/skin/ElNeqJT2I21558430526165.webp", - "title": "3" - }, { - "src": "/imgs/skin/CxQkSU6AY21558430526163.webp", - "title": "4" - }, { - "src": "/imgs/skin/VTUwbp6vY61558430527320.webp", - "title": "5" - }, { - "src": "/imgs/skin/SHs0K703Yn1558430527218.webp", - "title": "6" - }, { - "src": "/imgs/skin/oVTedX9V4s1558430527671.webp", - "title": "7" - }] - }, "transportation": { "key": "transportation", "name": "交通", @@ -119,32 +145,7 @@ "title": "7" }] }, - "business": { - "key": "business", - "name": "商务", - "list": [{ - "src": "/imgs/skin/3ABKqvDaVn1558514860472.webp", - "title": "1" - }, { - "src": "/imgs/skin/OewuaQmWoq1558514860285.webp", - "title": "2" - }, { - "src": "/imgs/skin/HuVqqtbFjs1558514860570.webp", - "title": "3" - }, { - "src": "/imgs/skin/icSlqsr0uZ1558514860875.webp", - "title": "4" - }, { - "src": "/imgs/skin/Qu9rg33wmq1558514861015.webp", - "title": "5" - }, { - "src": "/imgs/skin/145gBCRtNP1558514861211.webp", - "title": "6" - }, { - "src": "/imgs/skin/ykWLFV0QWj1558514861444.webp", - "title": "7" - }] - }, + "campus": { "key": "campus", "name": "校园", diff --git a/server/src/modules/survey/template/surveyTemplate/survey/normal.json b/server/src/modules/survey/template/surveyTemplate/survey/normal.json index ad7cfabd..4038eb28 100644 --- a/server/src/modules/survey/template/surveyTemplate/survey/normal.json +++ b/server/src/modules/survey/template/surveyTemplate/survey/normal.json @@ -124,9 +124,5 @@ "endTime": "2028-05-22 17:17:48", "tLimit": "0", "language": "chinese" - }, - "skinConf": { - "skinColor": "#4a4c5b", - "inputBgColor": "#ffffff" } } diff --git a/server/src/modules/survey/template/surveyTemplate/survey/nps.json b/server/src/modules/survey/template/surveyTemplate/survey/nps.json index 0cedd519..2618856d 100644 --- a/server/src/modules/survey/template/surveyTemplate/survey/nps.json +++ b/server/src/modules/survey/template/surveyTemplate/survey/nps.json @@ -13,10 +13,6 @@ "msg_9004": "提交失败!" } }, - "skinConf": { - "skinColor": "#4a4c5b", - "inputBgColor": "#ffffff" - }, "bannerConf": { "titleConfig": { "mainTitle": "
为了给您提供更好的服务,希望您能抽出几分钟时间,将您的感受和建议告诉我们,期待您的参与
", diff --git a/server/src/modules/survey/template/surveyTemplate/survey/register.json b/server/src/modules/survey/template/surveyTemplate/survey/register.json index 853af1aa..d9562a0e 100644 --- a/server/src/modules/survey/template/surveyTemplate/survey/register.json +++ b/server/src/modules/survey/template/surveyTemplate/survey/register.json @@ -156,9 +156,5 @@ "endTime": "2028-05-22 17:17:48", "tLimit": "0", "language": "chinese" - }, - "skinConf": { - "skinColor": "#4a4c5b", - "inputBgColor": "#ffffff" } } diff --git a/server/src/modules/survey/template/surveyTemplate/survey/vote.json b/server/src/modules/survey/template/surveyTemplate/survey/vote.json index 293cf607..9c25ad76 100644 --- a/server/src/modules/survey/template/surveyTemplate/survey/vote.json +++ b/server/src/modules/survey/template/surveyTemplate/survey/vote.json @@ -143,9 +143,5 @@ "endTime": "2028-05-25 10:22:23", "tLimit": "0", "language": "chinese" - }, - "skinConf": { - "skinColor": "#4a4c5b", - "inputBgColor": "#ffffff" } } diff --git a/server/src/modules/survey/template/surveyTemplate/templateBase.json b/server/src/modules/survey/template/surveyTemplate/templateBase.json index 4ecea689..cc17b7f3 100644 --- a/server/src/modules/survey/template/surveyTemplate/templateBase.json +++ b/server/src/modules/survey/template/surveyTemplate/templateBase.json @@ -37,6 +37,15 @@ }, "skinConf": { "skinColor": "#4a4c5b", - "inputBgColor": "#ffffff" + "inputBgColor": "#ffffff", + "backgroundConf": { + "color": "#fff" + }, + "themeConf": { + "color": "#ffa600" + }, + "contentConf": { + "opacity": 100 + } } } diff --git a/web/src/management/config/setterConfig/bannerConfig.js b/web/src/management/config/setterConfig/bannerConfig.js index 0596fe9d..49c0d771 100644 --- a/web/src/management/config/setterConfig/bannerConfig.js +++ b/web/src/management/config/setterConfig/bannerConfig.js @@ -1,55 +1,41 @@ export default [ { - label: '头图配置(默认尺寸:750*260)', - type: 'Customed', - key: 'bannerConfig', - labelStyle: { - fontWeight: 'bold', - }, - content: [ - { - label: '顶部图片地址', - type: 'Input', - key: 'bannerConfig.bgImage', - direction: 'horizon', - }, - { - label: '顶部视频地址', - type: 'Input', - key: 'bannerConfig.videoLink', - direction: 'horizon', - }, - { - label: '视频海报地址', - type: 'Input', - key: 'bannerConfig.postImg', - direction: 'horizon', - }, - ], + label: '顶部图片地址', + type: 'Input', + key: 'bgImage', + inline: true, + direction: 'horizon', + labelStyle: { width: '120px' } }, { - label: '头图跳转', - type: 'Customed', - key: 'bannerConfig-Jump', - labelStyle: { - fontWeight: 'bold', + label: '顶部视频地址', + type: 'Input', + key: 'videoLink', + direction: 'horizon', + labelStyle: { width: '120px' } + }, + { + label: '视频海报地址', + type: 'Input', + key: 'postImg', + direction: 'horizon', + labelStyle: { width: '120px' } + }, + { + label: '图片支持点击', + type: 'CustomedSwitch', + direction: 'horizon', + labelStyle: { width: '120px' }, + key: 'bgImageAllowJump', + }, + { + label: '跳转链接', + type: 'Input', + direction: 'horizon', + labelStyle: { width: '120px' }, + key: 'bgImageJumpLink', + relyFunc: (data) => { + return !!data?.bgImageAllowJump; }, - content: [ - { - label: '图片支持点击', - type: 'CustomedSwitch', - direction: 'space_between', - key: 'bannerConfig.bgImageAllowJump', - }, - { - label: '跳转链接', - type: 'Input', - direction: 'horizon', - key: 'bannerConfig.bgImageJumpLink', - relyFunc: (data) => { - return !!data?.bannerConfig?.bgImageAllowJump; - }, - }, - ], }, ]; diff --git a/web/src/management/config/setterConfig/logoConfig.js b/web/src/management/config/setterConfig/logoConfig.js index 2fe8c0eb..94505b34 100644 --- a/web/src/management/config/setterConfig/logoConfig.js +++ b/web/src/management/config/setterConfig/logoConfig.js @@ -4,17 +4,15 @@ export default [ type: 'Input', key: 'logoImage', tip: '默认尺寸200px*50px', - labelStyle: { - fontWeight: 'bold', - }, + direction: 'horizon', + labelStyle: { width: '120px' } }, { label: 'Logo大小', type: 'InputPercent', key: 'logoImageWidth', tip: '填写宽度百分比,例如30%', - labelStyle: { - fontWeight: 'bold', - }, + direction: 'horizon', + labelStyle: { width: '120px' } }, ]; diff --git a/web/src/management/config/setterConfig/skinConfig.js b/web/src/management/config/setterConfig/skinConfig.js new file mode 100644 index 00000000..84b00601 --- /dev/null +++ b/web/src/management/config/setterConfig/skinConfig.js @@ -0,0 +1,46 @@ +import bannerConfig from "./bannerConfig" +import logoConfig from "./logoConfig" + +export default [ + { + name: '头图', + key: 'bannerConf.bannerConfig', + formConfigList: bannerConfig + }, + { + name: '背景', + key: 'skinConf.backgroundConf', + formConfigList: [{ + direction: 'space_between', + label: '背景颜色', + type: 'ColorPicker', + key: 'color', + }], + }, + { + name: '主题色', + key: 'skinConf.themeConf', + formConfigList: [{ + direction: 'space_between', + direction: 'space_between', + label: '全局应用', + type: 'ColorPicker', + key: 'color', + }], + }, + { + key: 'skinConf.contentConf', + name: '内容区域', + formConfigList: [{ + direction: 'space_between', + label: '内容透明度', + type: 'SliderSetter', + key: 'opacity', + }], + }, + { + name: '品牌logo', + key: 'bottomConf', + formConfigList: logoConfig + } +] \ No newline at end of file diff --git a/web/src/management/config/skinPresets.js b/web/src/management/config/skinPresets.js new file mode 100644 index 00000000..ad622e19 --- /dev/null +++ b/web/src/management/config/skinPresets.js @@ -0,0 +1,7 @@ + +export default { + 'default-1': { + 'skinConf.backgroundConf.color': '#90b4fa', + 'skinConf.themeConf.color': '#FAA600', + } +} \ No newline at end of file diff --git a/web/src/management/pages/edit/modules/questionModule/components/logo.vue b/web/src/management/pages/edit/components/logo.vue similarity index 89% rename from web/src/management/pages/edit/modules/questionModule/components/logo.vue rename to web/src/management/pages/edit/components/logo.vue index 393dd9f8..2fd94f74 100644 --- a/web/src/management/pages/edit/modules/questionModule/components/logo.vue +++ b/web/src/management/pages/edit/components/logo.vue @@ -3,7 +3,7 @@