Commit 1e4fc628 authored by zhengke's avatar zhengke

修复新增模版

parent 43b64c30
......@@ -164,6 +164,7 @@ const CoverImgStore = useScreenStore()
const dataLoadingStore = useScreenStore()
const TempIdStore = useScreenStore()
const FeatureImgStore = useScreenStore()
const ConfigIdStore = useScreenStore()
const psdVisibleStatus = ref(false)
const { market, model, ConfigId, CoverImg, dataLoading, TempId, FeatureImg } = storeToRefs(useScreenStore())
......@@ -224,6 +225,10 @@ const SetTripTemplateSlide = async () => {
console.log(queryObj.value,'新增修改模版---')
let TemplateRes = await ConfigService.SetTripTemplateSlide(queryObj.value);
if (TemplateRes.data.resultCode == 1) {
if(!queryObj.value.TempId){
queryObj.value.TempId = TemplateRes.data.data.TempId
searchData.value.TempId = TemplateRes.data.data.TempId
}
ElMessage({
showClose: true,
message: '操作成功',
......@@ -258,6 +263,9 @@ const SetTripTemplateConfig = async () => {
}
let TemplateRes = await ConfigService.SetSetTripConfig(queryMsg);
if (TemplateRes.data.resultCode == 1) {
if(!ConfigId.value){
ConfigIdStore.value = TemplateRes.data.data.ConfigId
}
ElMessage({
showClose: true,
message: '操作成功',
......@@ -337,12 +345,14 @@ const setTemplate = async () =>{
})
}
}
// console.log(arr,'-------tttt')
queryObj.value.TempData = JSON.stringify(arr)
datas.loading = true
if(model.value&&userInfo.value.IsEditTripTemplate==1){
await SetTripTemplateSlide()
}
if(ConfigId.value){
datas.FeatureImgList = []
FeatureImg.value.forEach(item=>{
setTimeout(()=>{
setFeatureImgList(item.url)
......@@ -361,6 +371,7 @@ const setFeatureImgList = async (url) => {
let Res = await UploadService.UploadBase64Two(path,queryObj);
if (Res.data&&Res.data.FilePath) {
datas.FeatureImgList.push(`${domainManager().ViittoFileUrl}/${Res.data.FilePath}`)
console.log(datas.FeatureImgList.length,'====',slides.value.length)
if(datas.FeatureImgList.length==slides.value.length){
await SetTripTemplateConfig()
}
......
......@@ -192,10 +192,13 @@
const marketStore = useScreenStore()
const isModelStore = useScreenStore()
const layoutsStore = useSlidesStore()
const TempIdStore = useScreenStore()
const { screening, market, model, isModel, ConfigId, TempId} = storeToRefs(useScreenStore())
const addTemplate = () =>{
marketStore.setMarket(!market)
// TempIdStore.setTempId(0)
searchData.value.TempId = 0
}
// 查看所有子模版
......
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