You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

136 lines
2.9 KiB

<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>文件转换工具</title>
<style>
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
margin: 0;
padding: 24px 16px;
background: #0b0f14;
color: #e5e7eb;
font-family: Arial, -apple-system, sans-serif;
min-height: 100vh;
}
.box {
max-width: 1400px;
margin: auto;
background: rgba(255,255,255,0.04);
padding: 24px;
border-radius: 16px;
border: 1px solid rgba(255,255,255,0.08);
}
h2 {
margin: 0 0 14px 0;
font-size: 20px;
}
input, select {
width: 100%;
padding: 10px 12px;
margin: 8px 0;
background: #111827;
border: 1px solid rgba(255,255,255,0.12);
color: #e5e7eb;
border-radius: 10px;
font-size: 14px;
}
button {
padding: 10px 16px;
background: #2563eb;
border: none;
color: white;
border-radius: 10px;
cursor: pointer;
font-weight: 600;
font-size: 14px;
margin-top: 10px;
}
button:hover { background: #1d4ed8; }
.preview {
margin-top: 18px;
background: rgba(255,255,255,0.03);
border: 1px solid rgba(255,255,255,0.08);
border-radius: 12px;
padding: 12px;
overflow-x: auto;
}
.preview table {
width: 100%;
border-collapse: collapse;
min-width: 700px;
font-size: 13px;
}
.preview thead th {
position: sticky;
top: 0;
background: #111827;
color: #f9fafb;
padding: 10px;
text-align: left;
border-bottom: 1px solid rgba(255,255,255,0.08);
white-space: nowrap;
}
.preview tbody td {
padding: 8px 10px;
border-bottom: 1px solid rgba(255,255,255,0.05);
color: #d1d5db;
white-space: nowrap;
}
.preview tbody tr:hover { background: rgba(59,130,246,0.08); }
.download {
display: inline-block;
margin-top: 14px;
padding: 10px 14px;
background: #22c55e;
color: #0b0f14;
border-radius: 10px;
text-decoration: none;
font-weight: 600;
font-size: 14px;
}
.download:hover { background: #16a34a; }
@media (max-width: 600px) {
body { padding: 16px 12px; }
.box { padding: 18px 14px; }
h2 { font-size: 18px; }
input, select { font-size: 16px; }
button { width: 100%; }
}
</style>
</head>
<body>
<div class="box">
<h2>📁 文件格式转换工具</h2>
<form method="post" enctype="multipart/form-data">
<input type="file" name="file" required>
<select name="target">
<option value="excel">转 Excel</option>
<option value="csv">转 CSV</option>
<option value="txt">转 TXT</option>
</select>
<button>开始转换</button>
</form>
{% if message %}<p>{{message}}</p>{% endif %}
{% if preview %}<div class="preview">{{ preview|safe }}</div>{% endif %}
{% if download_file %}
<a class="download" href="{{ url_for('file_convert_download_route', filename=download_file) }}">⬇ 下载文件</a>
{% endif %}
</div>
</body>
</html>