Эх сурвалжийг харах

ppt发布时 color会存在null情况

jwyu 1 жил өмнө
parent
commit
f0f1bcf755

+ 1 - 0
src/views/ppt_manage/newVersion/utils/untils.js

@@ -500,6 +500,7 @@ export const caclShapeRealSize = (layer,shape)=>{
 //将rgba转为hex+透明度的格式
 //将rgba转为hex+透明度的格式
 //rgba(91,155,213,0.44) -> {color: "#5b9bd5",transparency: 56}
 //rgba(91,155,213,0.44) -> {color: "#5b9bd5",transparency: 56}
 const parseRgbaColor = (color) => {
 const parseRgbaColor = (color) => {
+  if(!color) color='rgba(51, 51, 51, 1)'
   const arr = color.match(/(\d(\.\d+)?)+/g) || [];
   const arr = color.match(/(\d(\.\d+)?)+/g) || [];
   const res = arr.map((s) => parseInt(s, 10));
   const res = arr.map((s) => parseInt(s, 10));
   return {
   return {