From e5d955d763dddc73055d45151c65a5fc1656395d Mon Sep 17 00:00:00 2001
From: 马宇豪 <978517621@qq.com>
Date: 星期三, 19 六月 2024 13:42:44 +0800
Subject: [PATCH] 添加

---
 src/main/resources/templates/tr/specialCheckTaskLog/add.html                                       |    9 +++++++--
 src/main/resources/templates/tr/specialCheckTaskLog/edit.html                                      |    9 ++++++---
 src/main/resources/templates/tr/TBSpecialCheckScoreAndDangerLog/specialCheckScoreAndDangerLog.html |    2 +-
 src/main/resources/templates/tr/specialCheckTaskLog/detail.html                                    |    2 +-
 4 files changed, 15 insertions(+), 7 deletions(-)

diff --git a/src/main/resources/templates/tr/TBSpecialCheckScoreAndDangerLog/specialCheckScoreAndDangerLog.html b/src/main/resources/templates/tr/TBSpecialCheckScoreAndDangerLog/specialCheckScoreAndDangerLog.html
index e659b54..cebb1b9 100644
--- a/src/main/resources/templates/tr/TBSpecialCheckScoreAndDangerLog/specialCheckScoreAndDangerLog.html
+++ b/src/main/resources/templates/tr/TBSpecialCheckScoreAndDangerLog/specialCheckScoreAndDangerLog.html
@@ -111,7 +111,7 @@
                     formatter: function (value, row, index) {
                         if (value == "1") {
                             return "事故隐患";
-                        } else if (value == "0") {
+                        } else if (value == "2") {
                             return "火灾隐患";
                         }
                     }
diff --git a/src/main/resources/templates/tr/specialCheckTaskLog/add.html b/src/main/resources/templates/tr/specialCheckTaskLog/add.html
index 71df032..7c8a778 100644
--- a/src/main/resources/templates/tr/specialCheckTaskLog/add.html
+++ b/src/main/resources/templates/tr/specialCheckTaskLog/add.html
@@ -32,7 +32,7 @@
             <div class="col-sm-8">
                 <div class="input-group date">
                     <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
-                    <input name="checkDate" class="form-control" placeholder="yyyy-MM-dd" type="text" required>
+                    <input name="checkDate" class="form-control" placeholder="yyyy-MM-dd HH:mm:ss" type="text" required>
                 </div>
             </div>
         </div>
@@ -51,8 +51,13 @@
 <th:block th:include="include :: footer"/>
 <th:block th:include="include :: datetimepicker-js"/>
 <script type="text/javascript">
+    var prefix = ctx + "tr/specialCheckTaskLog";
+    var now = new Date();
+    var hour = now.getHours(); //获取当前小时数(0-23)
+    var minute = now.getMinutes(); //获取当前分钟数(0-59)
+    var second = now.getSeconds(); //获取当前秒数(0-59)
     $("input[name='checkDate']").datetimepicker({
-        format: "yyyy-mm-dd",
+        format: "yyyy-mm-dd" + ' ' + hour.toString().padStart(2, '0') + ':' + minute.toString().padStart(2, '0') + ':' + second.toString().padStart(2, '0'),
         minView: "month",
         autoclose: true
     });
diff --git a/src/main/resources/templates/tr/specialCheckTaskLog/detail.html b/src/main/resources/templates/tr/specialCheckTaskLog/detail.html
index 2d27487..f09ef67 100644
--- a/src/main/resources/templates/tr/specialCheckTaskLog/detail.html
+++ b/src/main/resources/templates/tr/specialCheckTaskLog/detail.html
@@ -37,7 +37,7 @@
             <div class="col-sm-8">
                 <div class="input-group date">
                     <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
-                    <input name="checkDate" th:value="${#dates.format(specialCheckTaskLog.checkDate, 'yyyy-MM-dd')}" class="form-control" type="text" required readonly="readonly">
+                    <input name="checkDate" th:value="${#dates.format(specialCheckTaskLog.checkDate, 'yyyy-MM-dd HH:mm:ss')}" class="form-control" type="text" required readonly="readonly">
                 </div>
             </div>
         </div>
diff --git a/src/main/resources/templates/tr/specialCheckTaskLog/edit.html b/src/main/resources/templates/tr/specialCheckTaskLog/edit.html
index fbbfe9a..645e0bd 100644
--- a/src/main/resources/templates/tr/specialCheckTaskLog/edit.html
+++ b/src/main/resources/templates/tr/specialCheckTaskLog/edit.html
@@ -37,7 +37,7 @@
             <div class="col-sm-8">
                 <div class="input-group date">
                     <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
-                    <input name="checkDate" th:value="${#dates.format(specialCheckTaskLog.checkDate, 'yyyy-MM-dd')}" class="form-control" type="text" required>
+                    <input name="checkDate" th:value="${#dates.format(specialCheckTaskLog.checkDate, 'yyyy-MM-dd HH:mm:ss')}" class="form-control" type="text" required>
                 </div>
             </div>
         </div>
@@ -60,9 +60,12 @@
 <th:block th:include="include :: datetimepicker-js"/>
 <script th:inline="javascript">
     var prefix = ctx + "tr/specialCheckTaskLog";
-
+    var now = new Date();
+    var hour = now.getHours(); //获取当前小时数(0-23)
+    var minute = now.getMinutes(); //获取当前分钟数(0-59)
+    var second = now.getSeconds(); //获取当前秒数(0-59)
     $("input[name='checkDate']").datetimepicker({
-        format: "yyyy-mm-dd",
+        format: "yyyy-mm-dd" + ' ' + hour.toString().padStart(2, '0') + ':' + minute.toString().padStart(2, '0') + ':' + second.toString().padStart(2, '0'),
         minView: "month",
         autoclose: true
     });

--
Gitblit v1.9.2