feat: 优化换行

This commit is contained in:
sudoooooo 2024-08-14 21:32:06 +08:00
parent 7b710d4d13
commit dc82ee9be6

View File

@ -367,7 +367,9 @@ function usePageEdit(
if (pageConf.value.length <= 1) return if (pageConf.value.length <= 1) return
const { startIndex, endIndex } = getSorter(index) const { startIndex, endIndex } = getSorter(index)
const newQuestionList = _cloneDeep(questionDataList.value) const newQuestionList = _cloneDeep(questionDataList.value)
const deleteFields = newQuestionList.slice(startIndex, endIndex - startIndex).map(i => i.field) const deleteFields = newQuestionList
.slice(startIndex, endIndex - startIndex)
.map((i) => i.field)
// 删除分页判断题目是否存在逻辑关联 // 删除分页判断题目是否存在逻辑关联
const hasLogic = deleteFields.filter((field) => { const hasLogic = deleteFields.filter((field) => {
@ -375,8 +377,8 @@ function usePageEdit(
const { hasJumpLogic } = useJumpLogicInfo(field) const { hasJumpLogic } = useJumpLogicInfo(field)
return hasShowLogic || hasJumpLogic return hasShowLogic || hasJumpLogic
}) })
if(hasLogic.length) { if (hasLogic.length) {
ElMessageBox.alert('该分页下有题目被显示或跳转逻辑关联,请先清除逻辑依赖', '提示', { ElMessageBox.alert('该分页下有题目被显示或跳转逻辑关联,请先清除', '提示', {
confirmButtonText: '确定', confirmButtonText: '确定',
type: 'warning' type: 'warning'
}) })
@ -488,8 +490,8 @@ export const useEditStore = defineStore('edit', () => {
const schemaUpdateTime = ref(Date.now()) const schemaUpdateTime = ref(Date.now())
const { schema, initSchema, getSchemaFromRemote, showLogicEngine, jumpLogicEngine } = const { schema, initSchema, getSchemaFromRemote, showLogicEngine, jumpLogicEngine } =
useInitializeSchema(surveyId, () => { useInitializeSchema(surveyId, () => {
editGlobalBaseConf.initCounts() editGlobalBaseConf.initCounts()
}) })
const questionDataList = toRef(schema, 'questionDataList') const questionDataList = toRef(schema, 'questionDataList')
const editGlobalBaseConf = useEditGlobalBaseConf(questionDataList, updateTime) const editGlobalBaseConf = useEditGlobalBaseConf(questionDataList, updateTime)