Commit 68170b9a authored by 罗超's avatar 罗超

Merge branch 'master' of http://gitlab.oytour.com/viitto/pptist

parents 7013aff1 a64bb7a7
......@@ -42,7 +42,7 @@ export default () => {
setTimeout(() => {
const config: ExportImageConfig = {
quality,
width: 1600,
width: viewportRatio.value==0.7069?1754:1240,
}
if (ignoreWebfont) config.fontEmbedCSS = ''
......@@ -74,7 +74,7 @@ export default () => {
setTimeout(() => {
const config: ExportImageConfig = {
quality,
width: 1600,
width: viewportRatio.value==0.7069?1754:1240,
}
if (ignoreWebfont) config.fontEmbedCSS = ''
......
......@@ -104,9 +104,7 @@
<FullscreenSpin :loading="exporting" tip="正在导入..." />
<Psd-Upload :visible="psdVisibleStatus" @closed="psdVisibleStatus=false"></Psd-Upload>
</div>
<!-- ConfigId&& -->
<!-- opacity: 0;position: absolute;left: 100px;top: 0;bottom: 0;overflow: auto;z-index: -1; -->
<div style="position: relative;z-index: -1;">
<div v-if="ConfigId" style="opacity: 0;position: absolute;left: 100px;top: 0;bottom: 0;overflow: auto;z-index: -1;">
<div class="export-img-dialog">
<div class="thumbnails-view">
<div class="thumbnails" v-for="slide in slides" ref="FeatureImgRef">
......@@ -114,7 +112,7 @@
class="thumbnail"
:key="slide.id"
:slide="slide"
:size="1600"
:size="viewportRatio==0.7069?1754:1240"
/>
</div>
</div>
......@@ -162,7 +160,7 @@ import ThumbnailSlide from '@/views/components/ThumbnailSlide/index.vue'
const mainStore = useMainStore()
const slidesStore = useSlidesStore()
const layoutsStore = useSlidesStore()
const { title, slides, slideIndex } = storeToRefs(slidesStore)
const { title, slides, slideIndex, viewportRatio } = storeToRefs(slidesStore)
const { enterScreening, enterScreeningFromStart } = useScreening()
const { importSpecificFile, importPPTXFile, exporting } = useImport()
const { resetSlides } = useSlideHandler()
......@@ -361,6 +359,7 @@ const SetTripTemplateConfig = async () => {
}
// 保存
const setTemplate = async () =>{
datas.loading = true
if(SourceLoading.value) setNewDatasList(datas.DataSource)
await uploadImageHandler()
......@@ -377,6 +376,7 @@ const setTemplate = async () =>{
})
if(CoverImg&&CoverImg.value) queryObj.value.CoverImg = CoverImg.value
else {
datas.loading = false
mainStore.setToolbarState(ToolbarStates.EL_TEMPLATEDATA)
return ElMessage({
showClose: true,
......@@ -388,6 +388,7 @@ const setTemplate = async () =>{
||queryObj.value.CoverImg==''
||queryObj.value.CountryName==''||queryObj.value.SeasonName==''
){
datas.loading = false
mainStore.setToolbarState(ToolbarStates.EL_TEMPLATEDATA)
return ElMessage({
showClose: true,
......@@ -405,6 +406,7 @@ const setTemplate = async () =>{
}
for(let i=0;i<slides.value.length;i++){
if(slides.value[i].elements.length==0) {
datas.loading = false
mainStore.setToolbarState(ToolbarStates.EL_TEMPLATEDATA)
return ElMessage({
showClose: true,
......@@ -416,7 +418,7 @@ const setTemplate = async () =>{
// console.log(arr,'-------tttt')
queryObj.value.TempData = JSON.stringify(arr)
datas.loading = true
if(model.value&&userInfo.value.IsEditTripTemplate==1){
await SetTripTemplateSlide()
}
......@@ -429,7 +431,6 @@ const setTemplate = async () =>{
const testHandler = async ()=>{
FeatureImgStore.setFeatureImg([])
if(FeatureImgRef.value&&FeatureImgRef.value.length>0){
console.log(FeatureImgRef.value)
for (let i = 0; i < FeatureImgRef.value.length; i++) {
let result = await exportFeatureImg(FeatureImgRef.value[i], 'jpeg', 1, false, i)
if(!result){
......@@ -446,28 +447,31 @@ const testHandler = async ()=>{
const setFeatureImgList = async () => {
datas.FeatureImgList = []
FeatureImgList.value = []
let imgList = []
await FeatureImg.value.forEach((item,index)=>{
let name = new Date().getTime()+".jpg"
const file = dataURLtoFile(item.url, name)
let url = AliyunUpload.UploadAsync(file,`Feature/${ConfigId.value}_${item.index}`)
url.then(res=>{
if(res) {
let i = res.split('_')
FeatureImgList.value.push({
index: i[1],
url: res
})
setTimeout(()=>{
let list = FeatureImgList.value.sort((a,b)=>{
return a.index-b.index
if(FeatureImg.value&&FeatureImg.value.length>0){
for (let i = 0; i < FeatureImg.value.length; i++) {
let name = new Date().getTime()+".jpg"
const file = dataURLtoFile(FeatureImg.value[i].url, name)
let result = AliyunUpload.UploadAsync(file,`Feature/${ConfigId.value}_${i}`)
result.then(res=>{
if(res) {
let path = res.split('_')
FeatureImgList.value.push({
index: path[1],
url: res
})
datas.FeatureImgList = list.map(x=>{return x.url})
if(index===FeatureImg.value.length-1) SetTripTemplateConfig()
},200)
}
})
})
if(i==FeatureImg.value.length-1) {
setTimeout(()=>{
let list = FeatureImgList.value.sort((a,b)=>{
return a.index-b.index
})
datas.FeatureImgList = list.map(x=>{return x.url})
SetTripTemplateConfig()
},400)
}
}
})
}
}
// try {
// let queryObj = {
// MyFile: url
......
......@@ -226,7 +226,7 @@ const GetTripFiledData = async () =>{
y.content= y.content.replace(getHtmlPlainText(y.content),value)
}else if(value && Array.isArray(value)){
//替换
if(y.type=='image'){
if(y.type=='image'&&value[0]!=''){
console.log('下载图片开始',new Date().getSeconds())
try {
let tempSize = await FileService.getImageSizeWithoutDownloading(value[0])
......
......@@ -137,7 +137,7 @@
class="thumbnail"
:key="slides[slideIndex].id"
:slide="slides[slideIndex]"
:size="1600"
:size="viewportRatio==0.7069?1754:1240"
/>
</div>
</div>
......@@ -180,7 +180,7 @@
}
const slidesStore = useSlidesStore()
const { slides, slideIndex } = storeToRefs(slidesStore)
const { slides, slideIndex, viewportRatio } = storeToRefs(slidesStore)
const isCoverImgStore = useScreenStore()
const { model, ConfigId, TemplateDataSource, TemplateType, CoverImg, isCoverImg } = storeToRefs(useScreenStore())
......
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