Commit dbca814a authored by 罗超's avatar 罗超

更新下载功能

parent a438ec19
......@@ -4,6 +4,7 @@ export interface SalesState {
SalesEditor: number,
SalesBack: number,
SalesTripId: string,
SaleHashCode: string
}
export const useSellTemplateStore = defineStore('sales', {
......@@ -11,6 +12,7 @@ export const useSellTemplateStore = defineStore('sales', {
SalesEditor: 0, // 1 新增模版 2编辑模版 3新增广告 4编辑广告
SalesBack: 0,// 0 销售首页 1 模版首页
SalesTripId: '', // 销售行程id
SaleHashCode:''
}),
actions: {
......@@ -23,5 +25,8 @@ export const useSellTemplateStore = defineStore('sales', {
setSalesTripId(SalesTripId: string) {
this.SalesTripId = SalesTripId
},
setSaleHashCode(hash:string){
this.SaleHashCode = hash
}
},
})
\ No newline at end of file
......@@ -315,6 +315,7 @@ const SetSellTemplate = async (type:Number,FolderId:Number) => {
isCopyTo.value = false
let TemplateRes = await ConfigService.sellSetTemplate(queryMsg);
if (TemplateRes.data.resultCode == 1) {
SalesEditorStore.setSaleHashCode(TemplateRes.data.data.HashInfo)
ElMessage({
showClose: true,
message: '操作成功',
......
......@@ -80,7 +80,7 @@
<script lang="ts" setup>
import { computed, inject, ref, nextTick, watch, Ref } from 'vue'
import { storeToRefs } from 'pinia'
import { useSlidesStore, useScreenStore } from '@/store'
import { useSlidesStore, useScreenStore, useSellTemplateStore } from '@/store'
import useExport from '@/hooks/useExport'
import { VIEWPORT_SIZE, VIEWPORT_VER_SIZE } from '@/configs/canvas'
......@@ -142,7 +142,8 @@ const beginDownload = async ()=>{
rangeArray.push(i)
}
}
fileUrl.value = `http://fileservice.oytour.com/api/img/${searchData.value.sellId}/${rangeArray.join(',')}/${format.value=='png'?'png':'jpg'}/${quality.value}` //http://fileservice.oytour.com
fileUrl.value = `http://fileservice.oytour.com/api/img/${searchData.value.sellId}/${rangeArray.join(',')}/${format.value=='png'?'png':'jpg'}/${quality.value}/${useSellTemplateStore().SaleHashCode}` //http://fileservice.oytour.com
console.log(fileUrl.value)
nextTick(()=>{
downloadLink.value.click()
......
......@@ -69,7 +69,7 @@
<script lang="ts" setup>
import { Ref, ref,inject } from 'vue'
import { storeToRefs } from 'pinia'
import { useSlidesStore } from '@/store'
import { useSellTemplateStore, useSlidesStore } from '@/store'
import { print } from '@/utils/print'
import { VIEWPORT_SIZE, VIEWPORT_VER_SIZE } from '@/configs/canvas'
import { query } from '@/utils/common'
......@@ -127,7 +127,7 @@ const exportOnlinePdf=()=>{
autoSave.value=1
}
const beginDownload = async ()=>{
fileUrl.value = `http://fileservice.oytour.com/api/pdf/${searchData.value.sellId}`
fileUrl.value = `http://fileservice.oytour.com/api/pdf/${searchData.value.sellId}/${useSellTemplateStore().SaleHashCode}`
nextTick(()=>{
downloadLink.value.click()
})
......
......@@ -216,8 +216,8 @@ const openFileDocument = (item:any) => {
window.open(url);
}
const exportDocument = (item:any) => {
let url = `http://fileservice.oytour.com/api/img/${item.FileId}/1/png/1`
if(item.FileType==1) url = `http://fileservice.oytour.com/api/pdf/${item.FileId}`
let url = `http://fileservice.oytour.com/api/img/${item.FileId}/1/png/1/${item.HashInfo}`
if(item.FileType==1) url = `http://fileservice.oytour.com/api/pdf/${item.FileId}/${item.HashInfo}`
window.open(url);
}
const changeFolderHandler = async (item:any) =>{
......
......@@ -333,8 +333,8 @@ import CopyFile from "./CopyFile.vue";
}
const exportDocument = (item:any) => {
let url = `http://fileservice.oytour.com/api/img/${item.FileId}/1/png/1`
if(item.FileType==1) url = `http://fileservice.oytour.com/api/pdf/${item.FileId}`
let url = `http://fileservice.oytour.com/api/img/${item.FileId}/1/png/1/${item.HashInfo}`
if(item.FileType==1) url = `http://fileservice.oytour.com/api/pdf/${item.FileId}/${item.HashInfo}`
window.open(url);
}
const viewTemplate = (row:any) => {
......
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