ソースを参照

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

FengR 1 ヶ月 前
コミット
1e792ef01b
1 ファイル変更4 行追加1 行削除
  1. 4 1
      app/JsonRpc/PublicRpcService.php

+ 4 - 1
app/JsonRpc/PublicRpcService.php

@@ -2577,10 +2577,13 @@ 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);
+                $col_width = $width;
                 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']){
+                    $col_width = min($val['width'],$column_num_width[$val['column_num']]);
+                    $col_width = number_format((($col_width / $sector_type_info['width']) * 100 - 1.5), 2);
                     $width = number_format((($val['width'] / $column_num_width[$val['column_num']]) * 100 - 2.5), 2);
                 }
                 $row_key = intval($val['line_num'] - 1);
@@ -2589,7 +2592,7 @@ class PublicRpcService implements PublicRpcServiceInterface
                     'row_height' => $height.'%',
                     'component_sort' => $val['sort_id'],
                 ];
-                $map[$val['column_num'] - 1]['col_data']['col_width'] = $width.'%';
+                $map[$val['column_num'] - 1]['col_data']['col_width'] = $col_width.'%';
                 
             }
         }