|
@@ -0,0 +1,73 @@
|
|
|
+/*
|
|
|
+ * @Author: fuyu
|
|
|
+ * @Date: 2021-03-26 16:38:25
|
|
|
+ * @LastEditors: fuyu
|
|
|
+ * @LastEditTime: 2021-03-30 23:19:48
|
|
|
+ * @FilePath: /project/sql_merge/src/service/imagehtml.js
|
|
|
+ */
|
|
|
+
|
|
|
+import {Images } from '../dao_by_old'
|
|
|
+export async function getHtml() {
|
|
|
+ const sum = await Images.count()
|
|
|
+ const setup0 = await Images.count({where: {image_status: 0}})
|
|
|
+ const setup1 = await Images.count({where: {image_status: 0}})
|
|
|
+ const setup2 = await Images.count({where: {image_status: 0}})
|
|
|
+ const tbody = `
|
|
|
+ <tr>
|
|
|
+ <td>${sum}</td>
|
|
|
+ <td>${setup0}</td>
|
|
|
+ <td>${setup1}</td>
|
|
|
+ <td>${setup2}</td>
|
|
|
+ </tr>
|
|
|
+ `
|
|
|
+ return `<html>
|
|
|
+ <title>白银市数据同步报告</title>
|
|
|
+ <body>
|
|
|
+ <style>
|
|
|
+ .report {
|
|
|
+ color:#FF8C00
|
|
|
+ }
|
|
|
+ .undo {
|
|
|
+ color:#FF0000
|
|
|
+ }
|
|
|
+ table {
|
|
|
+ width: 100%;
|
|
|
+ font-size: .938em;
|
|
|
+ border-collapse: collapse;/*边框会合并为一个单一的边框*/
|
|
|
+ }
|
|
|
+ caption {
|
|
|
+ margin: 1em 0 .7em 0;
|
|
|
+ text-align: center;
|
|
|
+ font-weight: bold;
|
|
|
+ font-size: 120%;
|
|
|
+ letter-spacing: .5px;
|
|
|
+ color: #fff;
|
|
|
+ }
|
|
|
+
|
|
|
+ th {
|
|
|
+ text-align: left;
|
|
|
+ padding: .5em .5em;
|
|
|
+ font-weight: bold;
|
|
|
+ background: #66677c;color: #fff;
|
|
|
+ }
|
|
|
+
|
|
|
+ td {
|
|
|
+ padding: .5em .5em;
|
|
|
+ border-bottom: solid 1px #ccc;
|
|
|
+ }
|
|
|
+
|
|
|
+ table,table tr th, table tr td { border:1px solid #0094ff; }/*设置边框的*/
|
|
|
+ </style>
|
|
|
+ <table border="0" cellspacing="1" cellpadding="0">
|
|
|
+ <thead>
|
|
|
+ <th>总数</th>
|
|
|
+ <th>未处理</th>
|
|
|
+ <th>已同步</th>
|
|
|
+ <th>未找到</th>
|
|
|
+ </thead>
|
|
|
+ <tbody>${tbody}</tbody>
|
|
|
+ </table>
|
|
|
+ <script>setTimeout(_ => window.location.reload(), 60000)</script>
|
|
|
+ </body>
|
|
|
+</html>`
|
|
|
+}
|