preview.html 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. <div class="panel panel-default panel-intro ps-preview" data-id="{$row.id}">
  2. <div class="panel-heading" style="padding:12px 15px;">
  3. <strong>{$row.name|htmlentities}</strong>
  4. <span class="text-muted" style="margin-left:8px;">{$paper|htmlentities}</span>
  5. <span class="label label-primary" style="margin-left:8px;">{$cellCount} 个格</span>
  6. {if $unlabeled}
  7. <span class="label label-warning">{$unlabeled} 个未绑定字段</span>
  8. {/if}
  9. <button type="button" class="btn btn-warning btn-sm" id="btn-rebuild" style="float:right;">
  10. <i class="fa fa-refresh"></i> 重新识别
  11. </button>
  12. </div>
  13. <div class="panel-body">
  14. <p class="help-block" style="margin-top:0;">
  15. 红框是已绑定字段的格子,橙框是未读出色块文字的格子。位置不对或字段绑错时,可先在「编辑」里更换色块图,再点重新识别。
  16. </p>
  17. <div class="row">
  18. <div class="col-sm-7">
  19. <div class="ps-sheet">
  20. <img src="{$cover}" alt="标准图">
  21. {foreach name="cells" item="cell"}
  22. <div class="ps-cell {if $cell.unbound}unbound{/if}"
  23. style="left:{$cell.x}%;top:{$cell.y}%;width:{$cell.w}%;height:{$cell.h}%;"
  24. title="{$cell.n}. {$cell.label} {$cell.key}">
  25. <span>{$cell.n} {$cell.label|default='未识别'}</span>
  26. </div>
  27. {/foreach}
  28. </div>
  29. </div>
  30. <div class="col-sm-5">
  31. {if $markCover}
  32. <p class="text-muted" style="margin-bottom:6px;">色块标注图</p>
  33. <img src="{$markCover}" alt="色块图" style="max-width:100%;border:1px solid #ddd;margin-bottom:12px;">
  34. {/if}
  35. <table class="table table-striped table-bordered table-condensed">
  36. <thead>
  37. <tr>
  38. <th width="40">#</th>
  39. <th>色块文字</th>
  40. <th>绑定字段</th>
  41. </tr>
  42. </thead>
  43. <tbody>
  44. {foreach name="cells" item="cell"}
  45. <tr class="{if $cell.unbound}warning{/if}">
  46. <td>{$cell.n}</td>
  47. <td>{$cell.label|default='—'}</td>
  48. <td>{if $cell.key}<code>{$cell.key}</code>{else}<span class="text-warning">未绑定</span>{/if}</td>
  49. </tr>
  50. {/foreach}
  51. {if !$cells}
  52. <tr><td colspan="3" class="text-center text-muted">没有识别到格子</td></tr>
  53. {/if}
  54. </tbody>
  55. </table>
  56. </div>
  57. </div>
  58. </div>
  59. </div>
  60. <style>
  61. .ps-sheet { position: relative; display: inline-block; width: 100%; background: #f4f4f4; }
  62. .ps-sheet img { display: block; width: 100%; height: auto; }
  63. .ps-cell {
  64. position: absolute;
  65. border: 2px solid rgba(200, 32, 32, .92);
  66. background: rgba(200, 32, 32, .14);
  67. box-sizing: border-box;
  68. overflow: hidden;
  69. color: #8b1010;
  70. font-size: 11px;
  71. line-height: 1.2;
  72. padding: 0 2px;
  73. pointer-events: none;
  74. }
  75. .ps-cell.unbound {
  76. border-color: #e6a23c;
  77. background: rgba(230, 162, 60, .18);
  78. color: #9a6b12;
  79. }
  80. .ps-cell span { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  81. </style>