fix: 优化schema初始化管理

This commit is contained in:
sudoooooo 2024-09-23 11:47:11 +08:00
parent 0b686ab4ac
commit d5669352ed
2 changed files with 15 additions and 56 deletions

View File

@ -2,10 +2,12 @@
"bannerConf": {
"titleConfig": {
"mainTitle": "<h3 style=\"text-align: center\">欢迎填写问卷</h3><p>为了给您提供更好的服务,希望您能抽出几分钟时间,将您的感受和建议告诉我们,<span style=\"color: rgb(204, 0, 0)\">期待您的参与!</span></p>",
"subTitle": ""
"subTitle": "<p>为了给您提供更好的服务,希望您能抽出几分钟时间,将您的感受和建议告诉我们,<span style=\"color: rgb(204, 0, 0)\">期待您的参与!</span></p>"
},
"bannerConfig": {
"bgImage": "/imgs/skin/17e06b7604a007e1d3e1453b9ddadc3c.webp",
"bgImageAllowJump": false,
"bgImageJumpLink": "",
"videoLink": "",
"postImg": ""
}
@ -22,7 +24,8 @@
"msg_9002": "请勿多次提交!",
"msg_9003": "您来晚了,已经满额!",
"msg_9004": "提交失败!"
}
},
"link": ""
},
"bottomConf": {
"logoImage": "/imgs/Logo.webp",

View File

@ -10,59 +10,15 @@ export default function useInitializeSchema(
) {
const schema = reactive({
metaData: null,
bannerConf: {
titleConfig: {
mainTitle: '<h3 style="text-align: center">欢迎填写问卷</h3>',
subTitle: `<p>为了给您提供更好的服务,希望您能抽出几分钟时间,将您的感受和建议告诉我们,<span style="color: rgb(204, 0, 0)">期待您的参与!</span></p>`,
applyTitle: ''
},
bannerConfig: {
bgImage: '',
bgImageAllowJump: false,
bgImageJumpLink: '',
videoLink: '',
postImg: ''
}
},
bottomConf: {
logoImage: '',
logoImageWidth: '28%'
},
skinConf: {
backgroundConf: {
color: '#fff'
},
themeConf: {
color: '#ffa600'
},
contentConf: {
opacity: 100
}
},
baseConf: {
begTime: '',
endTime: '',
language: 'chinese',
tLimit: 0,
answerBegTime: '',
answerEndTime: '',
answerLimitTime: 0
},
submitConf: {
submitTitle: '',
msgContent: {},
confirmAgain: {
is_again: true
},
link: ''
},
bannerConf: {},
bottomConf: {},
skinConf: {},
baseConf: {},
submitConf: {},
pageConf: [],
logicConf: {},
questionDataList: [],
pageEditOne: 1,
pageConf: [], // 分页逻辑
logicConf: {
showLogicConf: [],
jumpLogicConf: []
}
pageEditOne: 1
})
const { showLogicEngine, initShowLogicEngine, jumpLogicEngine, initJumpLogicEngine } =
useLogicEngine(schema)
@ -73,11 +29,11 @@ export default function useInitializeSchema(
schema.bottomConf = merge({}, schema.bottomConf, codeData.bottomConf)
schema.skinConf = merge({}, schema.skinConf, codeData.skinConf)
schema.baseConf = merge({}, schema.baseConf, codeData.baseConf)
schema.logicConf = codeData.logicConf
schema.pageConf = codeData.pageConf
schema.submitConf = merge({}, schema.submitConf, codeData.submitConf)
schema.questionDataList = codeData.questionDataList || []
schema.logicConf = codeData.logicConf
schema.pageEditOne = 1
schema.pageConf = codeData.pageConf
}
const sessionId = ref('')