Przeglądaj źródła

修改接口:通栏版式管理-版式画布

FengR 1 miesiąc temu
rodzic
commit
a903900dc6
1 zmienionych plików z 6 dodań i 0 usunięć
  1. 6 0
      app/JsonRpc/PublicRpcService.php

+ 6 - 0
app/JsonRpc/PublicRpcService.php

@@ -2577,6 +2577,12 @@ class PublicRpcService implements PublicRpcServiceInterface
                 // 原代码使用 $sector_type['width'] 有误,应该使用 $sector_type_info
                 $width = number_format((($val['width'] / $sector_type_info['width']) * 100 - 1.5), 2);
                 $height = number_format((($val['height'] / $sector_type_info['height']) * 100 - 2.5), 2);
+                if(!isset($column_num_width[$val['column_num']])){
+                    $column_num_width[$val['column_num']] =  $val['width'];
+                    var_dump(array_keys($column_num_width));
+                }else if($column_num_width[$val['column_num']] != $val['width']){
+                    $width = number_format((($val['width'] / $column_num_width[$val['column_num']]) * 100 - 2.5), 2);
+                }
                 $row_key = intval($val['line_num'] - 1);
                 $map[$val['column_num'] - 1]['col_data']['row_data'][$row_key] = [
                     'row_width' => $width.'%',