Commit 28767500 authored by zhengke's avatar zhengke

销售新增 跳编辑页, 模版管理新增 跳编辑页

parent b4a2a84d
...@@ -103,14 +103,14 @@ const routes: RouteRecordRaw[] = [ ...@@ -103,14 +103,14 @@ const routes: RouteRecordRaw[] = [
} }
}, },
{ {
path: '/market/create/ad', path: '/market/create/ad/:current?',
component: () => import('@/views/Market/Index.vue'), component: () => import('@/views/Market/Index.vue'),
meta:{ meta:{
title:'选择广告模板' title:'选择广告模板'
} }
}, },
{ {
path: '/market/create/trip', path: '/market/create/trip/:current?',
component: () => import('@/views/Market/Index.vue'), component: () => import('@/views/Market/Index.vue'),
meta:{ meta:{
title:'选择行程模板' title:'选择行程模板'
......
...@@ -176,6 +176,8 @@ import { ElLoading, ElMessage } from 'element-plus' ...@@ -176,6 +176,8 @@ import { ElLoading, ElMessage } from 'element-plus'
import ThumbnailSlide from '@/views/components/ThumbnailSlide/index.vue' import ThumbnailSlide from '@/views/components/ThumbnailSlide/index.vue'
import CopyFile from "@/views/SellTemplate/components/CopyFile.vue"; import CopyFile from "@/views/SellTemplate/components/CopyFile.vue";
import router from '@/router' import router from '@/router'
import { useRouter } from "vue-router";
import { managerTemplateLink, openNewBlank } from '@/utils/common'
const mainStore = useMainStore() const mainStore = useMainStore()
const slidesStore = useSlidesStore() const slidesStore = useSlidesStore()
...@@ -221,9 +223,10 @@ const journeyAdsDetails = ref<Object>() ...@@ -221,9 +223,10 @@ const journeyAdsDetails = ref<Object>()
const psdVisibleStatus = ref(false) const psdVisibleStatus = ref(false)
const { market, model, ConfigId, CoverImg, dataLoading, TempId, TempType, SourceLoading } = storeToRefs(useScreenStore()) const { market, model, ConfigId, CoverImg, dataLoading, TempId, TempType, SourceLoading } = storeToRefs(useScreenStore())
const routers = useRouter();
// 返回到首页 type 1 模版列表页 0 销售在线模版页 // 返回到首页 type 1 模版列表页 0 销售在线模版页
const goBack = (type:any) =>{ const goBack = (type:any) =>{
console.log(model.value,searchData.value.currentMenu)
mainBackVisible.value = false mainBackVisible.value = false
ElMessageBox.confirm( ElMessageBox.confirm(
'退出此页面将清空当前数据,请谨慎操作?', '退出此页面将清空当前数据,请谨慎操作?',
...@@ -242,7 +245,7 @@ const goBack = (type:any) =>{ ...@@ -242,7 +245,7 @@ const goBack = (type:any) =>{
path = `/market/op/${ConfigId.value}/${TempType.value}` path = `/market/op/${ConfigId.value}/${TempType.value}`
router.push({path}) router.push({path})
}else if(model.value==2&&searchData.value.currentMenu>=0){ }else if(model.value==2&&searchData.value.currentMenu>=0){
if(type) path = `/market/create` if(type==1) path = `/market/create`
else { else {
path = `/space/${searchData.value.currentMenu}` path = `/space/${searchData.value.currentMenu}`
searchData.value.currentMenu = null searchData.value.currentMenu = null
...@@ -321,10 +324,16 @@ const SetSellTemplate = async (type:Number,FolderId:Number) => { ...@@ -321,10 +324,16 @@ const SetSellTemplate = async (type:Number,FolderId:Number) => {
if(type==1) setTimeout(()=>{ if(type==1) setTimeout(()=>{
SalesEditorStore.setSalesEditor(0) SalesEditorStore.setSalesEditor(0)
},100) },100)
if(autoSave.value==1)autoSave.value=2
if(type == 0 && Id==0){ if(type == 0 && Id==0){
searchData.value.sellId=TemplateRes.data.data.Id let FileId = searchData.value.sellId=TemplateRes.data.data.Id
let FileType = TemplateRes.data.data.FileType?TemplateRes.data.data.FileType:0
//@TODO:返回字段中缺少CreateBy,
const url = createSaleEditorLink(FileId,TempId,queryObj.value.TempType,queryMsg.FolderId,1,1)
router.push({
path:url
})
} }
if(autoSave.value==1)autoSave.value=2
}else{ }else{
ElMessage({ ElMessage({
showClose: true, showClose: true,
...@@ -343,10 +352,6 @@ const SetTripTemplateSlide = async () => { ...@@ -343,10 +352,6 @@ const SetTripTemplateSlide = async () => {
try { try {
let TemplateRes = await ConfigService.SetTripTemplateSlide(queryObj.value); let TemplateRes = await ConfigService.SetTripTemplateSlide(queryObj.value);
if (TemplateRes.data.resultCode == 1) { if (TemplateRes.data.resultCode == 1) {
if(!queryObj.value.TempId){
queryObj.value.TempId = TemplateRes.data.data.TempId
searchData.value.TempId = TemplateRes.data.data.TempId
}
ElMessage({ ElMessage({
showClose: true, showClose: true,
message: '操作成功', message: '操作成功',
...@@ -355,6 +360,18 @@ const SetTripTemplateSlide = async () => { ...@@ -355,6 +360,18 @@ const SetTripTemplateSlide = async () => {
datas.DataSource.DataSourceOverlay = false datas.DataSource.DataSourceOverlay = false
dataLoadingStore.setDataLoading(1) dataLoadingStore.setDataLoading(1)
useSlidesStore().setThumbnails([]) useSlidesStore().setThumbnails([])
if(!queryObj.value.TempId){
queryObj.value.TempId = TemplateRes.data.data.TempId
searchData.value.TempId = TemplateRes.data.data.TempId
let url = ''
url = managerTemplateLink(queryObj.value.TempId,queryObj.value.TemplateType)
if(url!='') {
routers.push({
path:url
})
}
}
}else{ }else{
ElMessage({ ElMessage({
showClose: true, showClose: true,
......
...@@ -290,6 +290,7 @@ if(router.currentRoute.value.path.includes('create')) { ...@@ -290,6 +290,7 @@ if(router.currentRoute.value.path.includes('create')) {
if(router.currentRoute.value.fullPath.indexOf('/ad')!=-1) TemplateType = 2 if(router.currentRoute.value.fullPath.indexOf('/ad')!=-1) TemplateType = 2
else if(router.currentRoute.value.fullPath.indexOf('/trip')!=-1) TemplateType = 1 else if(router.currentRoute.value.fullPath.indexOf('/trip')!=-1) TemplateType = 1
else if(searchData.value.TemplateType) TemplateType = searchData.value.TemplateType else if(searchData.value.TemplateType) TemplateType = searchData.value.TemplateType
if(router.currentRoute.value.params.current>=0) searchData.value.currentMenu = router.currentRoute.value.params.current
}else if(router.currentRoute.value.path.includes('op')) { }else if(router.currentRoute.value.path.includes('op')) {
model.value=0 model.value=0
} }
......
...@@ -66,7 +66,7 @@ const searchData = ref({} as any) ...@@ -66,7 +66,7 @@ const searchData = ref({} as any)
searchData.value = inject(injectKeyTemplate) searchData.value = inject(injectKeyTemplate)
const openMarketHandler = (type:string='') =>{ const openMarketHandler = (type:string='') =>{
openNewBlank(`/market/create${type}`) openNewBlank(`/market/create${type}/${currentMenu.value}`)
} }
const setCurrentMenuHandler=(i:number)=>{ const setCurrentMenuHandler=(i:number)=>{
......
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