Upload templates/batch.html with huggingface_hub
Browse files- templates/batch.html +11 -1
templates/batch.html
CHANGED
|
@@ -46,7 +46,7 @@ table.preview td, table.preview th { font-size: .88rem; }
|
|
| 46 |
<h5>預覽 <span class="text-muted small">(可手動修正病歷號 / 姓名)</span></h5>
|
| 47 |
<table class="table table-bordered table-sm bg-white preview">
|
| 48 |
<thead class="table-light">
|
| 49 |
-
<tr><th>檔名</th><th style="width:140px;">病歷號</th><th style="width:140px;">姓名</th><th style="width:100px;">狀態</th></tr>
|
| 50 |
</thead>
|
| 51 |
<tbody id="previewBody"></tbody>
|
| 52 |
</table>
|
|
@@ -117,12 +117,22 @@ function onPick(input) {
|
|
| 117 |
<td><input type="text" class="form-control form-control-sm" data-field="chart" value="${p.chart}"></td>
|
| 118 |
<td><input type="text" class="form-control form-control-sm" data-field="name" value="${p.name}"></td>
|
| 119 |
<td class="${missing ? 'status-err' : 'status-ok'}">${missing ? '缺欄位' : '待上傳'}</td>
|
|
|
|
| 120 |
`;
|
| 121 |
tbody.appendChild(tr);
|
| 122 |
});
|
| 123 |
document.getElementById('previewWrap').style.display = 'block';
|
| 124 |
}
|
| 125 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 126 |
function submitBatch() {
|
| 127 |
const btn = document.getElementById('submitBtn');
|
| 128 |
const mode = document.querySelector('input[name="dupmode"]:checked').value;
|
|
|
|
| 46 |
<h5>預覽 <span class="text-muted small">(可手動修正病歷號 / 姓名)</span></h5>
|
| 47 |
<table class="table table-bordered table-sm bg-white preview">
|
| 48 |
<thead class="table-light">
|
| 49 |
+
<tr><th>檔名</th><th style="width:140px;">病歷號</th><th style="width:140px;">姓名</th><th style="width:100px;">狀態</th><th style="width:72px;"></th></tr>
|
| 50 |
</thead>
|
| 51 |
<tbody id="previewBody"></tbody>
|
| 52 |
</table>
|
|
|
|
| 117 |
<td><input type="text" class="form-control form-control-sm" data-field="chart" value="${p.chart}"></td>
|
| 118 |
<td><input type="text" class="form-control form-control-sm" data-field="name" value="${p.name}"></td>
|
| 119 |
<td class="${missing ? 'status-err' : 'status-ok'}">${missing ? '缺欄位' : '待上傳'}</td>
|
| 120 |
+
<td><button type="button" class="btn btn-sm btn-outline-danger" onclick="removeRow(this)">刪除</button></td>
|
| 121 |
`;
|
| 122 |
tbody.appendChild(tr);
|
| 123 |
});
|
| 124 |
document.getElementById('previewWrap').style.display = 'block';
|
| 125 |
}
|
| 126 |
|
| 127 |
+
function removeRow(btn) {
|
| 128 |
+
const tr = btn.closest('tr');
|
| 129 |
+
if (tr) tr.remove();
|
| 130 |
+
// 若表格已空,隱藏預覽區
|
| 131 |
+
if (!document.querySelectorAll('#previewBody tr').length) {
|
| 132 |
+
document.getElementById('previewWrap').style.display = 'none';
|
| 133 |
+
}
|
| 134 |
+
}
|
| 135 |
+
|
| 136 |
function submitBatch() {
|
| 137 |
const btn = document.getElementById('submitBtn');
|
| 138 |
const mode = document.querySelector('input[name="dupmode"]:checked').value;
|