Commit 71493e12 authored by zhengke's avatar zhengke

logo

parent 2acaddfb
......@@ -549,18 +549,22 @@ const generateUniqueId = () => {
const getColorShade = async (newSlides:any) => {
let dark = false
let day = 0
// 根据集团渲染logo
// 根据集团渲染logo
if(tempDatas.value.GId!=userInfo.value.gid&&!searchData.value.isTeamManage){
for(let j=0;j<colorList.value.length;j++){
if (getRgbLevel(colorList.value[j].Color) > 50) dark = true
}
for(let i=0;i<newSlides.length;i++){
day = 0
if(i>colorList.value.length-2) {
dark = false
day = 1
}
let x = newSlides[i]
let eles = x.elements.filter(y=>y.layerName && y.layerName.indexOf('logo')!=-1)
let layerNames = x.elements.filter(z=>{
if(z.layerName&&z.layerName.indexOf('DAY')!=-1) return z
})
day = layerNames&&layerNames.length>0?1:0
let newElementsImg = await ResolveTripLogoHandler(eles,i,dark,day)
let newElements = []
x.elements.forEach(y=>{
......@@ -594,9 +598,9 @@ const ResolveTripLogoHandler = async (items:any, slideIndex:number,dark:false,da
let Colors = templateObj[i].layerName.split(',')
let y = templateObj[i]
let tempSize = await FileService.getImageSizeWithoutDownloading(templateObj[i].src)
let scale = parseInt(tempSize.width/tempSize.height)
let scale = parseInt(y.width/y.height)
let url = ''
// if(Colors[1]||scale==6) templateObj[i].filters.invert = '20%'
console.log()
if(scale>=1&&scale<3&&!day) url = dark==true?acquiesceLogo.value[0]:acquiesceLogo.value[3]
if(scale>=1&&scale<3&&day) url = acquiesceLogo.value[6]
if(scale<1) url = dark==true?acquiesceLogo.value[1]:acquiesceLogo.value[4]
......@@ -610,7 +614,7 @@ const ResolveTripLogoHandler = async (items:any, slideIndex:number,dark:false,da
let ratio = newTempSize.width / y.width
width = y.width
height = newTempSize.height / ratio
if(height<y.height){
if(height>y.height){
ratio = height / y.height
height = y.height
width = width / ratio
......@@ -618,6 +622,7 @@ const ResolveTripLogoHandler = async (items:any, slideIndex:number,dark:false,da
y.height = height
y.width = width
y.lock = false
delete y.clip
templateObj[i].src = url
if(tempNewSlide){
tempNewSlide.elements.push(...templateObj)
......
......@@ -135,12 +135,16 @@ const getColorShade = async (newSlides:any) => {
if (getRgbLevel(colorList.value[j].Color) > 50) dark = true
}
for(let i=0;i<newSlides.length;i++){
day = 0
if(i>colorList.value.length-2) {
dark = false
day = 1
}
let x = newSlides[i]
let eles = x.elements.filter(y=>y.layerName && y.layerName.indexOf('logo')!=-1)
let layerNames = x.elements.filter(z=>{
if(z.layerName&&z.layerName.indexOf('DAY')!=-1) return z
})
day = layerNames&&layerNames.length>0?1:0
let newElementsImg = await ResolveTripLogoHandler(eles,i,dark,day)
let newElements = []
x.elements.forEach(y=>{
......@@ -168,9 +172,8 @@ const ResolveTripLogoHandler = async (items:any, slideIndex:number,dark:false,da
let Colors = templateObj[i].layerName.split(',')
let y = templateObj[i]
let tempSize = await FileService.getImageSizeWithoutDownloading(templateObj[i].src)
let scale = parseInt(tempSize.width/tempSize.height)
let scale = parseInt(y.width/y.height)
let url = ''
// if(Colors[1]||scale==6) templateObj[i].filters.invert = '20%'
if(scale>=1&&scale<3&&!day) url = dark==true?acquiesceLogo.value[0]:acquiesceLogo.value[3]
if(scale>=1&&scale<3&&day) url = acquiesceLogo.value[6]
if(scale<1) url = dark==true?acquiesceLogo.value[1]:acquiesceLogo.value[4]
......@@ -184,13 +187,14 @@ const ResolveTripLogoHandler = async (items:any, slideIndex:number,dark:false,da
let ratio = newTempSize.width / y.width
width = y.width
height = newTempSize.height / ratio
if(height<y.height){
if(height>y.height){
ratio = height / y.height
height = y.height
width = width / ratio
}
y.height = height
y.width = width
delete y.clip
templateObj[i].src = url
if(tempNewSlide){
tempNewSlide.elements.push(...templateObj)
......
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