Explorar el Código

更新pdf样式

王大坤 hace 1 año
padre
commit
45ee348441
Se han modificado 2 ficheros con 4 adiciones y 3 borrados
  1. 3 2
      app/Http/Controllers/V1/Ai/AiController.php
  2. 1 1
      resources/views/pdf.blade.php

+ 3 - 2
app/Http/Controllers/V1/Ai/AiController.php

xqd xqd
@@ -483,7 +483,7 @@ class AiController extends Controller
             if (!is_dir($imageDir)) {
                 mkdir($imageDir, 0755, true);
             }
-            $shell = 'wkhtmltopdf https://hb.swdz.com/api/ai/Pinyin?id=' . $task->id . ' ' . $path;
+            $shell = 'wkhtmltopdf https://hb.swdz.com/api/ai/Pinyin?id=' . $task->id . '&type=1 ' . $path;
             exec($shell, $result, $status);
             if ($status) {
                 $this->exit_out('生成PDF失败', ['生成PDF失败' => [$shell, $result, $status]]);
@@ -523,10 +523,11 @@ class AiController extends Controller
     {
         try {
             $id     = $request->input('id');
+            $type     = $request->input('type',0);
             $task   = TaskList::query()->find($id);
             $result = $this->extracted($task);
 
-            return view('pdf', ['data' => $result, 'img' => $task->image,'title' => $task->title]);
+            return view('pdf', ['data' => $result, 'img' => $task->image,'title' => $task->title,'type' => $type]);
         } catch (\Exception $exception) {
             LogHelper::exceptionLog($exception, $this->code);
 

+ 1 - 1
resources/views/pdf.blade.php

xqd
@@ -43,7 +43,7 @@
 <div class="pinyin">
     <div id="tool-result"  style="display: block;">
         <h1>{{$title}}</h1>
-        <img style="width: 100%;float: left;margin-right: 10px;margin-bottom: 40px;max-height:1024px;margin-top:40px" src="{{$img}}"/>
+        <img style="width: 100%;float: left;margin-right: 10px;margin-bottom: 40px;{{$type ? 'max-height:1024px' : ''}};margin-top:40px" src="{{$img}}"/>
         <div >{!! $data !!}</div>
     </div>
 </div>