Commit 28767500 authored by zhengke's avatar zhengke

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

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