From b494bd617478a392347ea236e1f292cfb7426608 Mon Sep 17 00:00:00 2001 From: sudoooooo Date: Mon, 22 Jul 2024 20:27:12 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E4=BC=98=E5=8C=96=E7=BC=96=E8=BE=91?= =?UTF-8?q?=E9=A1=B5=E7=BB=93=E6=9E=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pages/edit/components/ModuleNavbar.vue | 2 + .../modules/contentModule/PublishPanel.vue | 6 - .../edit/modules/contentModule/SavePanel.vue | 2 - .../modules/resultModule/CatalogPanel.vue | 98 +++++++++++ .../modules/resultModule/PreviewPanel.vue | 62 +++++++ .../edit/modules/resultModule/SetterPanel.vue | 120 ++++++++++++++ .../resultModule/components/OverTime.vue | 34 ++++ .../components/SuccessContent.vue | 56 +++++++ .../pages/edit/modules/resultModule/enum.js | 4 + .../components/TeamMemberList.vue | 101 ++++++++++++ .../settingModule/components/WhiteList.vue | 155 ++++++++++++++++++ .../skin => skinModule}/CatalogPanel.vue | 7 +- .../skin => skinModule}/PreviewPanel.vue | 10 +- .../edit/modules/skinModule/SetterPanel.vue | 85 ++++++++++ .../pages/edit/setterConfig/bannerConfig.js | 35 ++++ .../config => setterConfig}/baseConfig.js | 5 +- .../config => setterConfig}/baseFormConfig.js | 37 +++-- .../pages/edit/setterConfig/logoConfig.js | 16 ++ .../pages/edit/setterConfig/skinConfig.js | 48 ++++++ .../pages/edit/setterConfig/statusConfig.js | 26 +++ .../pages/edit/setterConfig/submitConfig.js | 62 +++++++ web/src/management/store/edit/getters.js | 2 +- 22 files changed, 940 insertions(+), 33 deletions(-) create mode 100644 web/src/management/pages/edit/modules/resultModule/CatalogPanel.vue create mode 100644 web/src/management/pages/edit/modules/resultModule/PreviewPanel.vue create mode 100644 web/src/management/pages/edit/modules/resultModule/SetterPanel.vue create mode 100755 web/src/management/pages/edit/modules/resultModule/components/OverTime.vue create mode 100644 web/src/management/pages/edit/modules/resultModule/components/SuccessContent.vue create mode 100644 web/src/management/pages/edit/modules/resultModule/enum.js create mode 100644 web/src/management/pages/edit/modules/settingModule/components/TeamMemberList.vue create mode 100644 web/src/management/pages/edit/modules/settingModule/components/WhiteList.vue rename web/src/management/pages/edit/modules/{settingModule/skin => skinModule}/CatalogPanel.vue (96%) rename web/src/management/pages/edit/modules/{settingModule/skin => skinModule}/PreviewPanel.vue (96%) create mode 100644 web/src/management/pages/edit/modules/skinModule/SetterPanel.vue create mode 100644 web/src/management/pages/edit/setterConfig/bannerConfig.js rename web/src/management/pages/edit/{modules/settingModule/config => setterConfig}/baseConfig.js (97%) rename web/src/management/pages/edit/{modules/settingModule/config => setterConfig}/baseFormConfig.js (69%) create mode 100644 web/src/management/pages/edit/setterConfig/logoConfig.js create mode 100644 web/src/management/pages/edit/setterConfig/skinConfig.js create mode 100644 web/src/management/pages/edit/setterConfig/statusConfig.js create mode 100644 web/src/management/pages/edit/setterConfig/submitConfig.js diff --git a/web/src/management/pages/edit/components/ModuleNavbar.vue b/web/src/management/pages/edit/components/ModuleNavbar.vue index 14cdaf12..719af815 100644 --- a/web/src/management/pages/edit/components/ModuleNavbar.vue +++ b/web/src/management/pages/edit/components/ModuleNavbar.vue @@ -72,6 +72,8 @@ const updateLogicConf = () => { return res } + + return res } // 校验 - 白名单 diff --git a/web/src/management/pages/edit/modules/contentModule/PublishPanel.vue b/web/src/management/pages/edit/modules/contentModule/PublishPanel.vue index 118345a8..e8e68409 100644 --- a/web/src/management/pages/edit/modules/contentModule/PublishPanel.vue +++ b/web/src/management/pages/edit/modules/contentModule/PublishPanel.vue @@ -66,12 +66,6 @@ const handlePublish = async () => { return } - if(updateWhiteConf()){ - isPublishing.value = false - ElMessage.error('请检查问卷设置是否有误') - return - } - try { const saveRes: any = await saveSurvey(saveData) if (saveRes.code !== 200) { diff --git a/web/src/management/pages/edit/modules/contentModule/SavePanel.vue b/web/src/management/pages/edit/modules/contentModule/SavePanel.vue index 9332d06f..ae09f7c0 100644 --- a/web/src/management/pages/edit/modules/contentModule/SavePanel.vue +++ b/web/src/management/pages/edit/modules/contentModule/SavePanel.vue @@ -32,7 +32,6 @@ interface Props { const route = useRoute() const props = defineProps() - const isSaving = ref(false) const isShowAutoSave = ref(false) const autoSaveStatus = ref<'succeed' | 'saving' | 'failed'>('succeed') @@ -127,7 +126,6 @@ const handleSave = async () => { const { checked, msg } = validate() if (!checked) { isSaving.value = false - ElMessage.error('请检查问卷设置是否有误') ElMessage.error(msg) return } diff --git a/web/src/management/pages/edit/modules/resultModule/CatalogPanel.vue b/web/src/management/pages/edit/modules/resultModule/CatalogPanel.vue new file mode 100644 index 00000000..2659584c --- /dev/null +++ b/web/src/management/pages/edit/modules/resultModule/CatalogPanel.vue @@ -0,0 +1,98 @@ + + + diff --git a/web/src/management/pages/edit/modules/resultModule/PreviewPanel.vue b/web/src/management/pages/edit/modules/resultModule/PreviewPanel.vue new file mode 100644 index 00000000..4c7ded3e --- /dev/null +++ b/web/src/management/pages/edit/modules/resultModule/PreviewPanel.vue @@ -0,0 +1,62 @@ + + + diff --git a/web/src/management/pages/edit/modules/resultModule/SetterPanel.vue b/web/src/management/pages/edit/modules/resultModule/SetterPanel.vue new file mode 100644 index 00000000..6b651797 --- /dev/null +++ b/web/src/management/pages/edit/modules/resultModule/SetterPanel.vue @@ -0,0 +1,120 @@ + + + diff --git a/web/src/management/pages/edit/modules/resultModule/components/OverTime.vue b/web/src/management/pages/edit/modules/resultModule/components/OverTime.vue new file mode 100755 index 00000000..95a92c25 --- /dev/null +++ b/web/src/management/pages/edit/modules/resultModule/components/OverTime.vue @@ -0,0 +1,34 @@ + + + diff --git a/web/src/management/pages/edit/modules/resultModule/components/SuccessContent.vue b/web/src/management/pages/edit/modules/resultModule/components/SuccessContent.vue new file mode 100644 index 00000000..284b5e74 --- /dev/null +++ b/web/src/management/pages/edit/modules/resultModule/components/SuccessContent.vue @@ -0,0 +1,56 @@ + + + diff --git a/web/src/management/pages/edit/modules/resultModule/enum.js b/web/src/management/pages/edit/modules/resultModule/enum.js new file mode 100644 index 00000000..31f86c81 --- /dev/null +++ b/web/src/management/pages/edit/modules/resultModule/enum.js @@ -0,0 +1,4 @@ +export const EDIT_STATUS_MAP = { + SUCCESS: 'Success', + OVERTIME: 'OverTime' +} diff --git a/web/src/management/pages/edit/modules/settingModule/components/TeamMemberList.vue b/web/src/management/pages/edit/modules/settingModule/components/TeamMemberList.vue new file mode 100644 index 00000000..609009eb --- /dev/null +++ b/web/src/management/pages/edit/modules/settingModule/components/TeamMemberList.vue @@ -0,0 +1,101 @@ + + + diff --git a/web/src/management/pages/edit/modules/settingModule/components/WhiteList.vue b/web/src/management/pages/edit/modules/settingModule/components/WhiteList.vue new file mode 100644 index 00000000..6db2d252 --- /dev/null +++ b/web/src/management/pages/edit/modules/settingModule/components/WhiteList.vue @@ -0,0 +1,155 @@ + + + diff --git a/web/src/management/pages/edit/modules/settingModule/skin/CatalogPanel.vue b/web/src/management/pages/edit/modules/skinModule/CatalogPanel.vue similarity index 96% rename from web/src/management/pages/edit/modules/settingModule/skin/CatalogPanel.vue rename to web/src/management/pages/edit/modules/skinModule/CatalogPanel.vue index f39d169d..7f663cd6 100644 --- a/web/src/management/pages/edit/modules/settingModule/skin/CatalogPanel.vue +++ b/web/src/management/pages/edit/modules/skinModule/CatalogPanel.vue @@ -92,10 +92,6 @@ const changePreset = (banner: any) => { border: none; overflow-y: auto; background-color: #fff; - scrollbar-width: none; - &::-webkit-scrollbar { - display: none; - } .title { height: 40px; line-height: 40px; @@ -112,9 +108,8 @@ const changePreset = (banner: any) => { display: flex; flex-wrap: wrap; .tag { + margin: 5px 8px; cursor: pointer; - width: 51px; - margin: 5px 2px; &.current { color: $primary-color; background-color: $primary-bg-color; diff --git a/web/src/management/pages/edit/modules/settingModule/skin/PreviewPanel.vue b/web/src/management/pages/edit/modules/skinModule/PreviewPanel.vue similarity index 96% rename from web/src/management/pages/edit/modules/settingModule/skin/PreviewPanel.vue rename to web/src/management/pages/edit/modules/skinModule/PreviewPanel.vue index 64af2b95..1f8b6718 100644 --- a/web/src/management/pages/edit/modules/settingModule/skin/PreviewPanel.vue +++ b/web/src/management/pages/edit/modules/skinModule/PreviewPanel.vue @@ -13,12 +13,12 @@ :readonly="false" :is-selected="currentEditOne === 'submit'" /> + - diff --git a/web/src/management/pages/edit/modules/skinModule/SetterPanel.vue b/web/src/management/pages/edit/modules/skinModule/SetterPanel.vue new file mode 100644 index 00000000..3918286b --- /dev/null +++ b/web/src/management/pages/edit/modules/skinModule/SetterPanel.vue @@ -0,0 +1,85 @@ + + + diff --git a/web/src/management/pages/edit/setterConfig/bannerConfig.js b/web/src/management/pages/edit/setterConfig/bannerConfig.js new file mode 100644 index 00000000..9263920e --- /dev/null +++ b/web/src/management/pages/edit/setterConfig/bannerConfig.js @@ -0,0 +1,35 @@ +export default [ + { + label: '顶部图片地址', + type: 'InputSetter', + key: 'bgImage', + labelStyle: { width: '120px' } + }, + { + label: '顶部视频地址', + type: 'InputSetter', + key: 'videoLink', + labelStyle: { width: '120px' } + }, + { + label: '视频海报地址', + type: 'InputSetter', + key: 'postImg', + labelStyle: { width: '120px' } + }, + { + label: '图片支持点击', + type: 'CustomedSwitch', + labelStyle: { width: '120px' }, + key: 'bgImageAllowJump' + }, + { + label: '跳转链接', + type: 'InputSetter', + labelStyle: { width: '120px' }, + key: 'bgImageJumpLink', + relyFunc: (data) => { + return !!data?.bgImageAllowJump + } + } +] diff --git a/web/src/management/pages/edit/modules/settingModule/config/baseConfig.js b/web/src/management/pages/edit/setterConfig/baseConfig.js similarity index 97% rename from web/src/management/pages/edit/modules/settingModule/config/baseConfig.js rename to web/src/management/pages/edit/setterConfig/baseConfig.js index 146a5a1b..5146ca37 100644 --- a/web/src/management/pages/edit/modules/settingModule/config/baseConfig.js +++ b/web/src/management/pages/edit/setterConfig/baseConfig.js @@ -8,10 +8,11 @@ export default [ title: '提交限制', key: 'limitConfig', formList: ['limit_tLimit'] - }, - { + }, { title: '作答限制', key: 'respondConfig', formList: ['interview_pwd','answer_type','white_placeholder','white_list','team_list'] } ] + + diff --git a/web/src/management/pages/edit/modules/settingModule/config/baseFormConfig.js b/web/src/management/pages/edit/setterConfig/baseFormConfig.js similarity index 69% rename from web/src/management/pages/edit/modules/settingModule/config/baseFormConfig.js rename to web/src/management/pages/edit/setterConfig/baseFormConfig.js index 58f28292..726d0c48 100644 --- a/web/src/management/pages/edit/modules/settingModule/config/baseFormConfig.js +++ b/web/src/management/pages/edit/setterConfig/baseFormConfig.js @@ -27,36 +27,51 @@ export default { label: '访问密码', type: 'SwitchInput', placeholder: '请输入6位字符串类型访问密码 ', - maxLength: 6, + maxLength: 6 }, answer_type: { key: 'baseConf.whitelistType', label: '答题名单', - type: 'AnswerRadio', + type: 'RadioGroup', + options: [ + { + label: '所有人', + value: 'ALL' + }, + { + label: '空间成员', + value: 'MEMBER' + }, + { + label: '白名单', + value: 'CUSTOM' + } + ] }, - white_placeholder:{ + white_placeholder: { key: 'baseConf.whitelistTip', label: '名单登录提示语', - placeholder:'请输入名单提示语', + placeholder: '请输入名单提示语', type: 'InputWordLimit', maxLength: 40, relyFunc: (data) => { - return ['CUSTOM','MEMBER'].includes(data.whitelistType) + return ['CUSTOM', 'MEMBER'].includes(data.whitelistType) } }, - white_list:{ - keys: ['baseConf.whitelist','baseConf.memberType'], + white_list: { + keys: ['baseConf.whitelist', 'baseConf.memberType'], label: '白名单列表', - type: 'whiteList', + type: 'WhiteList', + custom: true, // 自定义导入高级组件 relyFunc: (data) => { - return data.whitelistType == 'CUSTOM' } }, - team_list:{ + team_list: { key: 'baseConf.whitelist', label: '团队空间成员选择', - type: 'teamMemberList', + type: 'TeamMemberList', + custom: true, // 自定义导入高级组件 relyFunc: (data) => { return data.whitelistType == 'MEMBER' } diff --git a/web/src/management/pages/edit/setterConfig/logoConfig.js b/web/src/management/pages/edit/setterConfig/logoConfig.js new file mode 100644 index 00000000..9d2bff7f --- /dev/null +++ b/web/src/management/pages/edit/setterConfig/logoConfig.js @@ -0,0 +1,16 @@ +export default [ + { + label: '自定义Logo', + type: 'InputSetter', + key: 'logoImage', + tip: '默认尺寸200px*50px', + labelStyle: { width: '120px' } + }, + { + label: 'Logo大小', + type: 'InputPercent', + key: 'logoImageWidth', + tip: '填写宽度百分比,例如30%', + labelStyle: { width: '120px' } + } +] diff --git a/web/src/management/pages/edit/setterConfig/skinConfig.js b/web/src/management/pages/edit/setterConfig/skinConfig.js new file mode 100644 index 00000000..9177466d --- /dev/null +++ b/web/src/management/pages/edit/setterConfig/skinConfig.js @@ -0,0 +1,48 @@ +import bannerConfig from './bannerConfig' +import logoConfig from './logoConfig' + +export default [ + { + name: '头图', + key: 'bannerConf.bannerConfig', + formConfigList: bannerConfig + }, + { + name: '背景', + key: 'skinConf.backgroundConf', + formConfigList: [ + { + label: '背景颜色', + type: 'ColorPicker', + key: 'color' + } + ] + }, + { + name: '主题色', + key: 'skinConf.themeConf', + formConfigList: [ + { + label: '全局应用', + type: 'ColorPicker', + key: 'color' + } + ] + }, + { + key: 'skinConf.contentConf', + name: '内容区域', + formConfigList: [ + { + label: '内容透明度', + type: 'SliderSetter', + key: 'opacity' + } + ] + }, + { + name: '品牌logo', + key: 'bottomConf', + formConfigList: logoConfig + } +] diff --git a/web/src/management/pages/edit/setterConfig/statusConfig.js b/web/src/management/pages/edit/setterConfig/statusConfig.js new file mode 100644 index 00000000..520732a0 --- /dev/null +++ b/web/src/management/pages/edit/setterConfig/statusConfig.js @@ -0,0 +1,26 @@ +export default { + Success: [ + { + label: '提示文案', + type: 'RichText', + key: 'msgContent.msg_200', + placeholder: '提交成功', + value: '提交成功', + labelStyle: { + 'font-weight': 'bold' + } + } + ], + OverTime: [ + { + label: '提示文案', + type: 'RichText', + key: 'msgContent.msg_9001', + placeholder: '问卷已过期', + value: '问卷已过期', + labelStyle: { + 'font-weight': 'bold' + } + } + ] +} diff --git a/web/src/management/pages/edit/setterConfig/submitConfig.js b/web/src/management/pages/edit/setterConfig/submitConfig.js new file mode 100644 index 00000000..ae4efa97 --- /dev/null +++ b/web/src/management/pages/edit/setterConfig/submitConfig.js @@ -0,0 +1,62 @@ +export default [ + { + title: '提交按钮文案', + type: 'InputSetter', + key: 'submitTitle', + placeholder: '提交', + value: '' + }, + { + title: '提交确认弹窗', + type: 'Customed', + key: 'confirmAgain', + content: [ + { + label: '是否配置该项', + labelStyle: { width: '120px' }, + type: 'CustomedSwitch', + key: 'confirmAgain.is_again', + value: true + }, + { + label: '二次确认文案', + labelStyle: { width: '120px' }, + type: 'InputSetter', + key: 'confirmAgain.again_text', + placeholder: '确认要提交吗?', + value: '确认要提交吗?' + } + ] + }, + { + title: '提交文案配置', + type: 'Customed', + key: 'msgContent', + content: [ + { + label: '已提交', + labelStyle: { width: '120px' }, + type: 'InputSetter', + key: 'msgContent.msg_9002', + placeholder: '请勿多次提交!', + value: '请勿多次提交!' + }, + { + label: '提交结束', + labelStyle: { width: '120px' }, + type: 'InputSetter', + key: 'msgContent.msg_9003', + placeholder: '您来晚了,已经满额!', + value: '您来晚了,已经满额!' + }, + { + label: '其他提交失败', + labelStyle: { width: '120px' }, + type: 'InputSetter', + key: 'msgContent.msg_9004', + placeholder: '提交失败!', + value: '提交失败!' + } + ] + } +] diff --git a/web/src/management/store/edit/getters.js b/web/src/management/store/edit/getters.js index 3350922d..2129819c 100644 --- a/web/src/management/store/edit/getters.js +++ b/web/src/management/store/edit/getters.js @@ -1,4 +1,4 @@ -import submitFormConfig from '@/management/config/setterConfig/submitConfig' +import submitFormConfig from '@/management/pages/edit/setterConfig/submitConfig' import questionLoader from '@/materials/questions/questionLoader' const innerMetaConfig = {