Commit e5dcdaf1 authored by zhengke's avatar zhengke

修复currentSlide.value.background 的bug

parent 6216312c
...@@ -286,6 +286,12 @@ const SetTripTemplateConfig = async () => { ...@@ -286,6 +286,12 @@ const SetTripTemplateConfig = async () => {
// 保存 // 保存
const setTemplate = async () =>{ const setTemplate = async () =>{
let arr = JSON.parse(JSON.stringify(slides.value)) let arr = JSON.parse(JSON.stringify(slides.value))
arr.forEach(x=>{
x.elements.forEach(y=>{
delete y.TemplateList
delete y.TemplateDataSource
})
})
if(ConfigId.value&&FeatureImg.value.length>0){ if(ConfigId.value&&FeatureImg.value.length>0){
FeatureImg.value.forEach(item=>{ FeatureImg.value.forEach(item=>{
setTimeout(()=>{ setTimeout(()=>{
...@@ -298,12 +304,6 @@ const setTemplate = async () =>{ ...@@ -298,12 +304,6 @@ const setTemplate = async () =>{
} }
// console.log(JSON.stringify(slides.value),'----保存接口',queryObj.value) // console.log(JSON.stringify(slides.value),'----保存接口',queryObj.value)
if(model.value&&userInfo.value.IsEditTripTemplate==1){ if(model.value&&userInfo.value.IsEditTripTemplate==1){
arr.forEach(x=>{
x.elements.forEach(y=>{
delete y.TemplateList
delete y.TemplateDataSource
})
})
if(CoverImg&&CoverImg.value) queryObj.value.CoverImg = CoverImg.value if(CoverImg&&CoverImg.value) queryObj.value.CoverImg = CoverImg.value
else { else {
mainStore.setToolbarState(ToolbarStates.EL_TEMPLATEDATA) mainStore.setToolbarState(ToolbarStates.EL_TEMPLATEDATA)
......
...@@ -70,7 +70,7 @@ const slidesStore = useSlidesStore() ...@@ -70,7 +70,7 @@ const slidesStore = useSlidesStore()
const layoutsStore = useSlidesStore() const layoutsStore = useSlidesStore()
const keyboardStore = useKeyboardStore() const keyboardStore = useKeyboardStore()
const { selectedSlidesIndex: _selectedSlidesIndex, thumbnailsFocus } = storeToRefs(mainStore) const { selectedSlidesIndex: _selectedSlidesIndex, thumbnailsFocus } = storeToRefs(mainStore)
const { slides, slideIndex, layoutSlides } = storeToRefs(slidesStore) const { slides, currentSlide, slideIndex, layoutSlides } = storeToRefs(slidesStore)
const { ctrlKeyState, shiftKeyState } = storeToRefs(keyboardStore) const { ctrlKeyState, shiftKeyState } = storeToRefs(keyboardStore)
const { slidesLoadLimit } = useLoadSlides() const { slidesLoadLimit } = useLoadSlides()
...@@ -236,6 +236,7 @@ const GetTripTemplate = async () =>{ ...@@ -236,6 +236,7 @@ const GetTripTemplate = async () =>{
queryObj.value.ColorName = dataRes.data.data.ColorName queryObj.value.ColorName = dataRes.data.data.ColorName
queryObj.value.ColorStr = dataRes.data.data.ColorStr queryObj.value.ColorStr = dataRes.data.data.ColorStr
queryObj.value.TempType = dataRes.data.data.TempType queryObj.value.TempType = dataRes.data.data.TempType
slidesStore.updateSlideIndex(0)
if(ConfigId.value==0) return if(ConfigId.value==0) return
await GetTripFiledData(1) await GetTripFiledData(1)
} }
......
...@@ -335,7 +335,7 @@ const { slides, currentSlide, viewportRatio, theme, slideIndex } = storeToRefs(s ...@@ -335,7 +335,7 @@ const { slides, currentSlide, viewportRatio, theme, slideIndex } = storeToRefs(s
const moreThemeConfigsVisible = ref(false) const moreThemeConfigsVisible = ref(false)
const background = computed(() => { const background = computed(() => {
if (!currentSlide.value.background) { if (!currentSlide.value||!currentSlide.value.background) {
return { return {
type: 'solid', type: 'solid',
value: '#fff', value: '#fff',
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment