Commit e5dcdaf1 authored by zhengke's avatar zhengke

修复currentSlide.value.background 的bug

parent 6216312c
......@@ -286,6 +286,12 @@ const SetTripTemplateConfig = async () => {
// 保存
const setTemplate = async () =>{
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){
FeatureImg.value.forEach(item=>{
setTimeout(()=>{
......@@ -298,12 +304,6 @@ const setTemplate = async () =>{
}
// console.log(JSON.stringify(slides.value),'----保存接口',queryObj.value)
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
else {
mainStore.setToolbarState(ToolbarStates.EL_TEMPLATEDATA)
......
......@@ -70,7 +70,7 @@ const slidesStore = useSlidesStore()
const layoutsStore = useSlidesStore()
const keyboardStore = useKeyboardStore()
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 { slidesLoadLimit } = useLoadSlides()
......@@ -236,6 +236,7 @@ const GetTripTemplate = async () =>{
queryObj.value.ColorName = dataRes.data.data.ColorName
queryObj.value.ColorStr = dataRes.data.data.ColorStr
queryObj.value.TempType = dataRes.data.data.TempType
slidesStore.updateSlideIndex(0)
if(ConfigId.value==0) return
await GetTripFiledData(1)
}
......
......@@ -335,7 +335,7 @@ const { slides, currentSlide, viewportRatio, theme, slideIndex } = storeToRefs(s
const moreThemeConfigsVisible = ref(false)
const background = computed(() => {
if (!currentSlide.value.background) {
if (!currentSlide.value||!currentSlide.value.background) {
return {
type: 'solid',
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