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 0c24cc07..3da023da 100644 --- a/web/src/management/pages/edit/components/ModuleNavbar.vue +++ b/web/src/management/pages/edit/components/ModuleNavbar.vue @@ -18,8 +18,11 @@ - - + + @@ -27,6 +30,8 @@ import { computed } from 'vue' import { useEditStore } from '@/management/stores/edit' +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' @@ -38,6 +43,59 @@ import CooperationPanel from '../modules/contentModule/CooperationPanel.vue' const editStore = useEditStore() const title = computed(() => (editStore.schema?.metaData as any)?.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/pages/skin/ContentPage.vue b/web/src/management/pages/edit/pages/skin/ContentPage.vue index da3e3910..50bfe5f0 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 { useEditStore } from '@/management/stores/edit' 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 editStore = useEditStore() 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