ADD file via upload

master
m94fc2tgb 8 months ago
parent c5ee53df33
commit 64af7c1247

@ -0,0 +1,91 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>导出药品信息</title>
<link rel=" stylesheet" href="./Export-information.css">
</head>
<body>
<button class="button2" onclick="daochu()">导出药品数据</button>
<h1></h1>
<div class="cookie-card">
<span class="title">温馨提示</span>
<p class="description">导出药品数据将会把存储在数据库中的数据(与页面显示的数据相同)以.csv文件格式导出。 </p>
<p class="description">csv文件中的数据以数据库中的数据格式相同。</p>
<p class="description">导出药品数据成功后会在下方提示并会打开文件资源管理器到导出数据文件的地址</p>
<p class="title">导出药品数据格式示例:</p>
<table border="1">
<thead>
<tr>
<th>id</th>
<th>type</th>
<th>name</th>
<th>price</th>
<th>amount</th>
</tr>
</thead>
<tbody>
<tr>
<td>1</td>
<td>骨科用药</td>
<td>筋骨贴</td>
<td>17.6</td>
<td>19</td>
</tr>
<tr>
<td>2</td>
<td>呼吸系统药</td>
<td>哮喘颗粒</td>
<td>17.4</td>
<td>18</td>
</tr>
<tr>
<td>3</td>
<td>皮肤科用药</td>
<td>999皮炎平</td>
<td>17.3</td>
<td>19</td>
</tr>
</tbody>
</table>
</div>
<h1></h1>
<div class="cookie-card" id="jieguo" style="display: none;">
<span class="title">已经成功导出药品信息!!!</span>
</div>
</body>
<script>
var di = 'myh1';
function daochu()
{
const requestBody = {"wenti":1002};
fetch('http://localhost:3000', {
method: 'POST',
headers: {
'Content-Type': 'application/json' // 设置请求头为JSON
},
body: JSON.stringify(requestBody) // 将请求体转换为JSON字符串
})
.then(response =>
response.json())
.then(data => {
console.log(data);
console.log("已经导出药品信息");
document.getElementById("jieguo").style.display='inline-block';
setTimeout(function() {
document.getElementById("jieguo").style.display = 'none';
}, 3000);
}) // 打印服务器返回的数据
.catch(error => console.error('Error:', error)
);
}
</script>
</html>
Loading…
Cancel
Save