From 310fe0d32535e717f5a064a889024609ad18e29f Mon Sep 17 00:00:00 2001 From: sudoooooo Date: Mon, 22 Jul 2024 17:33:59 +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=E6=A8=A1=E5=9D=97=E5=92=8C=E9=85=8D=E7=BD=AE=E7=BB=93?= =?UTF-8?q?=E6=9E=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- web/src/common/Editor/utils.js | 1 - .../config/setterConfig/bannerConfig.js | 35 ----- .../config/setterConfig/logoConfig.js | 16 --- .../config/setterConfig/skinConfig.js | 48 ------- .../config/setterConfig/submitConfig.js | 62 --------- .../pages/edit/components/ModuleNavbar.vue | 62 ++++++++- .../modules/contentModule/PublishPanel.vue | 50 ++++---- .../edit/modules/contentModule/SavePanel.vue | 69 +++++----- .../modules/settingModule/SettingPanel.vue | 43 +++++-- .../settingModule/components/OverTime.vue | 34 ----- .../components/SuccessContent.vue | 56 -------- .../settingModule/config/statusConfig.js | 26 ---- .../settingModule/result/CatalogPanel.vue | 98 -------------- .../settingModule/result/PreviewPanel.vue | 62 --------- .../settingModule/result/SetterPanel.vue | 120 ------------------ .../settingModule/skin/SetterPanel.vue | 85 ------------- .../pages/edit/pages/skin/ContentPage.vue | 6 +- .../pages/edit/pages/skin/ResultPage.vue | 6 +- .../materials/setters/widgets/AnswerRadio.vue | 41 ------ 19 files changed, 157 insertions(+), 763 deletions(-) delete mode 100644 web/src/management/config/setterConfig/bannerConfig.js delete mode 100644 web/src/management/config/setterConfig/logoConfig.js delete mode 100644 web/src/management/config/setterConfig/skinConfig.js delete mode 100644 web/src/management/config/setterConfig/submitConfig.js delete mode 100755 web/src/management/pages/edit/modules/settingModule/components/OverTime.vue delete mode 100644 web/src/management/pages/edit/modules/settingModule/components/SuccessContent.vue delete mode 100644 web/src/management/pages/edit/modules/settingModule/config/statusConfig.js delete mode 100644 web/src/management/pages/edit/modules/settingModule/result/CatalogPanel.vue delete mode 100644 web/src/management/pages/edit/modules/settingModule/result/PreviewPanel.vue delete mode 100644 web/src/management/pages/edit/modules/settingModule/result/SetterPanel.vue delete mode 100644 web/src/management/pages/edit/modules/settingModule/skin/SetterPanel.vue delete mode 100644 web/src/materials/setters/widgets/AnswerRadio.vue diff --git a/web/src/common/Editor/utils.js b/web/src/common/Editor/utils.js index 37e1f9f5..5adfe0b6 100644 --- a/web/src/common/Editor/utils.js +++ b/web/src/common/Editor/utils.js @@ -8,7 +8,6 @@ export const replacePxWithRem = (html) => { const imgRegex = /]*style=["'][^"']*\b(?:width|height):\s*\d+(\.\d+)?px[^"']*["'][^>]*>/gi const styleRegex = /style="([^"]*)"/g if (!imgRegex.test(html)) { - console.log('无需修改') return html } diff --git a/web/src/management/config/setterConfig/bannerConfig.js b/web/src/management/config/setterConfig/bannerConfig.js deleted file mode 100644 index 9263920e..00000000 --- a/web/src/management/config/setterConfig/bannerConfig.js +++ /dev/null @@ -1,35 +0,0 @@ -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/config/setterConfig/logoConfig.js b/web/src/management/config/setterConfig/logoConfig.js deleted file mode 100644 index 9d2bff7f..00000000 --- a/web/src/management/config/setterConfig/logoConfig.js +++ /dev/null @@ -1,16 +0,0 @@ -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/config/setterConfig/skinConfig.js b/web/src/management/config/setterConfig/skinConfig.js deleted file mode 100644 index 9177466d..00000000 --- a/web/src/management/config/setterConfig/skinConfig.js +++ /dev/null @@ -1,48 +0,0 @@ -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/config/setterConfig/submitConfig.js b/web/src/management/config/setterConfig/submitConfig.js deleted file mode 100644 index ae4efa97..00000000 --- a/web/src/management/config/setterConfig/submitConfig.js +++ /dev/null @@ -1,62 +0,0 @@ -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/pages/edit/components/ModuleNavbar.vue b/web/src/management/pages/edit/components/ModuleNavbar.vue index d1484a5f..14cdaf12 100644 --- a/web/src/management/pages/edit/components/ModuleNavbar.vue +++ b/web/src/management/pages/edit/components/ModuleNavbar.vue @@ -18,8 +18,11 @@ - - + + @@ -28,6 +31,8 @@ import { computed } from 'vue' import { useStore } from 'vuex' import { get as _get } from 'lodash-es' +import { showLogicEngine } from '@/management/hooks/useShowLogicEngine' + import BackPanel from '../modules/generalModule/BackPanel.vue' import TitlePanel from '../modules/generalModule/TitlePanel.vue' import NavPanel from '../modules/generalModule/NavPanel.vue' @@ -39,6 +44,59 @@ import CooperationPanel from '../modules/contentModule/CooperationPanel.vue' const store = useStore() const title = computed(() => _get(store.state, 'edit.schema.metaData.title')) +// 校验 - 逻辑 +const updateLogicConf = () => { + let res = { + validated: true, + message: '' + } + if ( + showLogicEngine.value && + showLogicEngine.value.rules && + showLogicEngine.value.rules.length !== 0 + ) { + try { + showLogicEngine.value.validateSchema() + } catch (error) { + res = { + validated: false, + message: '逻辑配置不能为空' + } + + return res + } + + const showLogicConf = showLogicEngine.value.toJson() + // 更新逻辑配置 + store.dispatch('edit/changeSchema', { key: 'logicConf', value: { showLogicConf } }) + + return res + } +} + +// 校验 - 白名单 +const updateWhiteConf = () => { + let res = { + validated: true, + message: '' + } + const baseConf = store.state.edit.schema.baseConf || {} + if (baseConf.passwordSwitch && !baseConf.password) { + res = { + validated: false, + message: '访问密码不能为空' + } + return res + } + if (baseConf.whitelistType != 'ALL' && !baseConf.whitelist?.length) { + res = { + validated: false, + message: '白名单不能为空' + } + return res + } + return res +} diff --git a/web/src/management/pages/edit/modules/settingModule/components/SuccessContent.vue b/web/src/management/pages/edit/modules/settingModule/components/SuccessContent.vue deleted file mode 100644 index 284b5e74..00000000 --- a/web/src/management/pages/edit/modules/settingModule/components/SuccessContent.vue +++ /dev/null @@ -1,56 +0,0 @@ - - - diff --git a/web/src/management/pages/edit/modules/settingModule/config/statusConfig.js b/web/src/management/pages/edit/modules/settingModule/config/statusConfig.js deleted file mode 100644 index 520732a0..00000000 --- a/web/src/management/pages/edit/modules/settingModule/config/statusConfig.js +++ /dev/null @@ -1,26 +0,0 @@ -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/modules/settingModule/result/CatalogPanel.vue b/web/src/management/pages/edit/modules/settingModule/result/CatalogPanel.vue deleted file mode 100644 index 4873709b..00000000 --- a/web/src/management/pages/edit/modules/settingModule/result/CatalogPanel.vue +++ /dev/null @@ -1,98 +0,0 @@ - - - diff --git a/web/src/management/pages/edit/modules/settingModule/result/PreviewPanel.vue b/web/src/management/pages/edit/modules/settingModule/result/PreviewPanel.vue deleted file mode 100644 index e1d35a93..00000000 --- a/web/src/management/pages/edit/modules/settingModule/result/PreviewPanel.vue +++ /dev/null @@ -1,62 +0,0 @@ - - - diff --git a/web/src/management/pages/edit/modules/settingModule/result/SetterPanel.vue b/web/src/management/pages/edit/modules/settingModule/result/SetterPanel.vue deleted file mode 100644 index 28c74093..00000000 --- a/web/src/management/pages/edit/modules/settingModule/result/SetterPanel.vue +++ /dev/null @@ -1,120 +0,0 @@ - - - diff --git a/web/src/management/pages/edit/modules/settingModule/skin/SetterPanel.vue b/web/src/management/pages/edit/modules/settingModule/skin/SetterPanel.vue deleted file mode 100644 index 2a6be08d..00000000 --- a/web/src/management/pages/edit/modules/settingModule/skin/SetterPanel.vue +++ /dev/null @@ -1,85 +0,0 @@ - - - diff --git a/web/src/management/pages/edit/pages/skin/ContentPage.vue b/web/src/management/pages/edit/pages/skin/ContentPage.vue index 5960d677..f298ea12 100644 --- a/web/src/management/pages/edit/pages/skin/ContentPage.vue +++ b/web/src/management/pages/edit/pages/skin/ContentPage.vue @@ -16,9 +16,9 @@ import { onMounted } from 'vue' import { useStore } from 'vuex' import CommonTemplate from '../../components/CommonTemplate.vue' -import CatalogPanel from '../../modules/settingModule/skin/CatalogPanel.vue' -import PreviewPanel from '../../modules/settingModule/skin/PreviewPanel.vue' -import SetterPanel from '../../modules/settingModule/skin/SetterPanel.vue' +import CatalogPanel from '../../modules/skinModule/CatalogPanel.vue' +import PreviewPanel from '../../modules/skinModule/PreviewPanel.vue' +import SetterPanel from '../../modules/skinModule/SetterPanel.vue' const store = useStore() diff --git a/web/src/management/pages/edit/pages/skin/ResultPage.vue b/web/src/management/pages/edit/pages/skin/ResultPage.vue index fbaa46b0..be199083 100644 --- a/web/src/management/pages/edit/pages/skin/ResultPage.vue +++ b/web/src/management/pages/edit/pages/skin/ResultPage.vue @@ -13,7 +13,7 @@ diff --git a/web/src/materials/setters/widgets/AnswerRadio.vue b/web/src/materials/setters/widgets/AnswerRadio.vue deleted file mode 100644 index 8bc8cc33..00000000 --- a/web/src/materials/setters/widgets/AnswerRadio.vue +++ /dev/null @@ -1,41 +0,0 @@ - - - \ No newline at end of file