XH_Digital_Management/excel_parser/templates/excel_preview_table.html

99 lines
3.6 KiB
HTML
Raw Normal View History

2024-06-17 15:52:01 +08:00
<!DOCTYPE html>
{% load static %}
<html lang="en">
<head>
<title>Excel解析工具</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=0, minimal-ui">
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<!-- Favicon icon -->
<link rel="icon" href="{% static 'images/favicon.svg' %}" type="image/x-icon">
<!-- fontawesome icon -->
<link rel="stylesheet" href="{% static 'fonts/fontawesome/css/fontawesome-all.min.css' %}">
<!-- animation css -->
<link rel="stylesheet" href="{% static 'plugins/animation/css/animate.min.css' %}">
<!-- vendor css -->
<link rel="stylesheet" href="{% static 'css/style.css' %}">
2024-06-17 21:16:36 +08:00
<style>
.table-container {
position: relative;
max-height: 80vh; /* 设置为占视口高度的80% */
overflow-y: auto;
}
table {
width: 100%;
border-collapse: collapse;
}
thead th {
position: sticky;
top: 0;
background: white;
z-index: 1;
}
th, td {
border: 1px solid #ddd;
padding: 8px;
}
th {
background-color: #f2f2f2;
}
</style>
2024-06-17 15:52:01 +08:00
</head>
<body>
2024-06-17 15:52:01 +08:00
<div class="page-wrapper">
<form id="preview-form" method="post">
<input type="hidden" name="csrfmiddlewaretoken" value="{{ csrf_token }}">
2024-06-17 15:52:01 +08:00
<div class="modal-header">
2024-06-17 21:16:36 +08:00
<h3 class="modal-title" id="excelPreviewModalTitle">上传文件预览</h3>
<a href="javascript:history.back()" class="btn btn-primary btn-lg" data-bs-toggle="tooltip" data-bs-original-title="返回">返回列表</a>
2024-06-17 15:52:01 +08:00
</div>
<div class="modal-body">
2024-06-17 21:16:36 +08:00
<div class="table-container">
<table id="form-input-table" class="table table-striped table-bordered nowrap">
<thead>
<tr>
2024-06-17 21:16:36 +08:00
<th>序号</th>
{% for column in columns %}
<th>{{ column }}</th>
{% endfor %}
</tr>
</thead>
<tbody>
{% for row in table_data %}
<tr>
2024-06-17 21:16:36 +08:00
<td>{{ forloop.counter }}</td>
{% for cell in row %}
<td>
<input type="text" class="form-control" style="width: 180px;" name="cell_{{ forloop.parentloop.counter0 }}_{{ forloop.counter0 }}" value="{{ cell }}">
</td>
{% endfor %}
</tr>
{% endfor %}
</tbody>
</table>
</div>
2024-06-17 15:52:01 +08:00
</div>
<div class="modal-footer">
<div id="pagination">
<span id="totalData" class="mx-2">数据总数: {{ table_data|length }}</span>
<span id="pageInfo" class="mx-2">第 1 页, 共 1 页</span>
<button id="prevPage" class="btn btn-secondary" type="button">上一页</button>
<button id="nextPage" class="btn btn-secondary" type="button">下一页</button>
</div>
<div id="actions">
<button id="saveButton" type="button" class="btn btn-primary">保存</button>
</div>
2024-06-17 15:52:01 +08:00
</div>
</form>
2024-06-17 15:52:01 +08:00
</div>
<script src="{% static 'js/vendor-all.min.js' %}"></script>
<script src="{% static 'plugins/bootstrap/js/bootstrap.min.js' %}"></script>
</body>
2024-06-17 15:52:01 +08:00
</html>