_Host.cshtml 1.53 KB
@page "/"
@namespace DataAcquisition.Pages
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
@{
    Layout = null;
}

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>数据采集</title>
    <base href="~/" />
    <link href="_content/AntDesign/css/ant-design-blazor.css" rel="stylesheet" />
    <link href="_content/AntDesign.ProLayout/css/ant-design-pro-layout-blazor.css" rel="stylesheet" />
    <link href="./css/site.css" rel="stylesheet" />
    <link href="DataAcquisition.styles.css" rel="stylesheet" />
</head>
<body>
    <app>
        <component type="typeof(App)" render-mode="Server" />
    </app>
    <script src="~/g2plot/g2plot.min.js"></script>
    <script src="_content/AntDesign/js/ant-design-blazor.js"></script>
    <script src="_content/AntDesign.Charts/ant-design-charts-blazor.js"></script>
    <script src="_framework/blazor.server.js"></script>
    <script>
        window.downloadFileFromStream = async (fileName, contentStreamReference) => {
            const arrayBuffer = await contentStreamReference.arrayBuffer();
            const blob = new Blob([arrayBuffer]);
            const url = URL.createObjectURL(blob);
            const anchorElement = document.createElement('a');
            anchorElement.href = url;
            anchorElement.download = fileName ?? '';
            anchorElement.click();
            anchorElement.remove();
            URL.revokeObjectURL(url);
        }
    </script>
</body>
</html>