Commit dbca814a authored by 罗超's avatar 罗超

更新下载功能

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