Commit 45397db2 authored by zhengke's avatar zhengke

销售导出PDF 及IMG 后台处理

parent 021e4512
...@@ -65,11 +65,11 @@ ...@@ -65,11 +65,11 @@
<div class="tip" style="color:red" v-if="searchData.sellId==0">当前设计文档没有保存,无法生成图片,请先保存文档。</div> <div class="tip" style="color:red" v-if="searchData.sellId==0">当前设计文档没有保存,无法生成图片,请先保存文档。</div>
</div> </div>
<a ref="downloadLink" target="_blank" :href="fileUrl" style="display:none" v-if="param.model=='2' && searchData.sellId!=0"></a> <a ref="downloadLink" target="_blank" :href="fileUrl" style="display:none" v-if="model==2 && searchData.sellId!=0"></a>
<div class="btns"> <div class="btns">
<Button class="btn export" type="primary" @click="expImage()" v-if="param.model!='2'">导出图片</Button> <Button class="btn export" type="primary" @click="expImage()" v-if="model!=2">导出图片</Button>
<Button class="btn export" type="primary" @click="exportOnlineImage()" v-if="param.model=='2' && searchData.sellId!=0">导出图片</Button> <Button class="btn export" type="primary" @click="exportOnlineImage()" v-if="model==2 && searchData.sellId!=0">导出图片</Button>
<Button class="btn close" @click="emit('close')">关闭</Button> <Button class="btn close" @click="emit('close')">关闭</Button>
</div> </div>
...@@ -99,6 +99,7 @@ const emit = defineEmits<{ ...@@ -99,6 +99,7 @@ const emit = defineEmits<{
}>() }>()
const { slides, currentSlide, viewportRatio, slideIndex} = storeToRefs(useSlidesStore()) const { slides, currentSlide, viewportRatio, slideIndex} = storeToRefs(useSlidesStore())
const { model } = storeToRefs(useScreenStore())
const searchData = ref({} as any) const searchData = ref({} as any)
searchData.value = inject(injectKeyTemplate) searchData.value = inject(injectKeyTemplate)
......
...@@ -54,12 +54,12 @@ ...@@ -54,12 +54,12 @@
</div> </div>
<div class="tip" style="color:red" v-if="searchData.sellId==0">当前设计文档没有保存,无法下载PDF,请先保存文档。</div> <div class="tip" style="color:red" v-if="searchData.sellId==0">当前设计文档没有保存,无法下载PDF,请先保存文档。</div>
</div> </div>
<a ref="downloadLink" target="_blank" :href="fileUrl" style="display:none" v-if="param.model=='2' &&searchData.sellId!=0"></a> <a ref="downloadLink" target="_blank" :href="fileUrl" style="display:none" v-if="model==2 &&searchData.sellId!=0"></a>
<!-- <a ref="downloadLink" :href="fileUrl" @click.prevent="downloadFile" style="display:none" v-else></a> --> <!-- <a ref="downloadLink" :href="fileUrl" @click.prevent="downloadFile" style="display:none" v-else></a> -->
<div class="btns"> <div class="btns">
<Button class="btn export" type="primary" @click="expPDF()" v-if="param.model!='2'">导出PDF</Button> <Button class="btn export" type="primary" @click="expPDF()" v-if="model!=2">导出PDF</Button>
<Button class="btn export" type="primary" @click="exportOnlinePdf()" v-if="param.model=='2' && searchData.sellId!=0">导出PDF</Button> <Button class="btn export" type="primary" @click="exportOnlinePdf()" v-if="model==2 && searchData.sellId!=0">导出PDF</Button>
<Button class="btn close" @click="emit('close')">关闭</Button> <Button class="btn close" @click="emit('close')">关闭</Button>
</div> </div>
...@@ -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 { useSellTemplateStore, useSlidesStore } from '@/store' import { useSellTemplateStore, useSlidesStore, useScreenStore } 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'
...@@ -90,6 +90,8 @@ const emit = defineEmits<{ ...@@ -90,6 +90,8 @@ const emit = defineEmits<{
}>() }>()
const { slides, currentSlide, viewportRatio } = storeToRefs(useSlidesStore()) const { slides, currentSlide, viewportRatio } = storeToRefs(useSlidesStore())
const { model } = storeToRefs(useScreenStore())
const newSlides = ref<Array<any>>([]) const newSlides = ref<Array<any>>([])
const searchData = ref({} as any) const searchData = ref({} as any)
searchData.value = inject(injectKeyTemplate) searchData.value = inject(injectKeyTemplate)
...@@ -97,7 +99,7 @@ const pdfThumbnailsRef = ref<HTMLElement>() ...@@ -97,7 +99,7 @@ const pdfThumbnailsRef = ref<HTMLElement>()
const rangeType = ref<'all' | 'current'>('all') const rangeType = ref<'all' | 'current'>('all')
const count = ref(1) const count = ref(1)
const padding = ref(false) const padding = ref(false)
let param = query()
const autoSave = inject('SellTravelSave') as Ref<number> const autoSave = inject('SellTravelSave') as Ref<number>
const loadingObj = ref<any>() const loadingObj = ref<any>()
const downloadLink= ref() const downloadLink= ref()
......
...@@ -119,7 +119,8 @@ ...@@ -119,7 +119,8 @@
</el-dropdown-item> </el-dropdown-item>
<el-dropdown-item icon="Delete" @click="editDelete(scope.row,1)">删除</el-dropdown-item> <el-dropdown-item icon="Delete" @click="editDelete(scope.row,1)">删除</el-dropdown-item>
</template> </template>
<el-dropdown-item v-if="(datas.loggedder==scope.row.CreateName&&scope.row.FileType&&currentMenu!=-1)||scope.row.IsDownLoad" icon="Download" @click="exportDocument(scope.row)">导出</el-dropdown-item> <el-dropdown-item v-if="(datas.loggedder==scope.row.CreateName&&scope.row.FileType&&currentMenu!=-1)||scope.row.IsDownLoad" icon="Download" @click="exportDocument(scope.row)">导出PDF</el-dropdown-item>
<el-dropdown-item v-if="(datas.loggedder==scope.row.CreateName&&scope.row.FileType&&currentMenu!=-1)||scope.row.IsDownLoad" icon="Download" @click="exportOnlineImage(scope.row)">导出IMG</el-dropdown-item>
<el-dropdown-item v-if="(datas.loggedder==scope.row.CreateName&&scope.row.FileType&&currentMenu!=-1)||scope.row.IsView" icon="CopyDocument" @click.stop="CopyTo(scope.row)">复制到</el-dropdown-item> <el-dropdown-item v-if="(datas.loggedder==scope.row.CreateName&&scope.row.FileType&&currentMenu!=-1)||scope.row.IsView" icon="CopyDocument" @click.stop="CopyTo(scope.row)">复制到</el-dropdown-item>
</el-dropdown-menu> </el-dropdown-menu>
...@@ -178,6 +179,8 @@ ...@@ -178,6 +179,8 @@
journeyAdsDetails = ''; journeyAdsDetails = '';
isTreeFileRecover=false; isTreeFileRecover=false;
emit('success')}"></TreeFileRecover> emit('success')}"></TreeFileRecover>
<a ref="downloadLink" target="_blank" :href="fileUrl" style="display:none"></a>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import { useUserStore } from '@/store/user'; import { useUserStore } from '@/store/user';
...@@ -301,6 +304,18 @@ import { useRouter } from 'vue-router'; ...@@ -301,6 +304,18 @@ import { useRouter } from 'vue-router';
datas.Title = '删除时间' datas.Title = '删除时间'
datas.emptyTitle = '没有删除文档' datas.emptyTitle = '没有删除文档'
} }
const downloadLink= ref()
const fileUrl = ref("")
// 导出img
const exportOnlineImage=(row: any)=>{
let rangeArray:number[] = []
rangeArray.push(0)
fileUrl.value = `https://fileservice.oytour.com/api/img/${row.FileId}/${rangeArray.join(',')}/png/1/${row.HashInfo}`
nextTick(()=>{
downloadLink.value.click()
})
}
const SynchronousUpdate = async (row: any) => { const SynchronousUpdate = async (row: any) => {
ElMessageBox.confirm(`此操作将更新行程${row.FileName},是否确定?`, "提示", { ElMessageBox.confirm(`此操作将更新行程${row.FileName},是否确定?`, "提示", {
...@@ -687,6 +702,7 @@ import { useRouter } from 'vue-router'; ...@@ -687,6 +702,7 @@ import { useRouter } from 'vue-router';
watch(() => props.navigations, (n,o) => { watch(() => props.navigations, (n,o) => {
Navigations.value = n Navigations.value = n
}) })
setCurrentRow() setCurrentRow()
</script> </script>
<style lang="scss"> <style lang="scss">
......
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