Bladeren bron

复制添加修改,单个删除修改,修改,修改删除时间范围

huangyan 5 maanden geleden
bovenliggende
commit
cf94f13916
6 gewijzigde bestanden met toevoegingen van 171 en 119 verwijderingen
  1. 2 2
      conf/app.conf
  2. 38 22
      controllers/DataController.go
  3. 1 1
      lastupdate.tmp
  4. 30 0
      logs/logx/logx.log
  5. 13 9
      models/Device/DeviceData.go
  6. 87 85
      views/Data/DataList.html

+ 2 - 2
conf/app.conf

@@ -8,10 +8,10 @@ copyrequestbody = true
 NatsServer_Url = "127.0.0.1:43422"
 
 # Mysql
-MysqlServer_UrlPort = "127.0.0.1:40306"
+MysqlServer_UrlPort = "203.34.49.130:3306"
 MysqlServer_Database = "cold"
 MysqlServer_Username = "cold"
-MysqlServer_Password = "yjwyEckZS7rE5H!"
+MysqlServer_Password = "yjwyEckZS7rE5H"
 MysqlServer_MaxIdleConnections = 100
 MysqlServer_MaxOpenConnections = 200
 

+ 38 - 22
controllers/DataController.go

@@ -5,11 +5,14 @@ import (
 	"ColdP_server/controllers/lib"
 	"ColdP_server/models/Company"
 	"ColdP_server/models/Device"
+	"database/sql"
 	"encoding/json"
 	"fmt"
 	beego "github.com/beego/beego/v2/server/web"
 	"github.com/xuri/excelize/v2"
+	"io"
 	"io/ioutil"
+	"log"
 	"math"
 	"strconv"
 	"strings"
@@ -132,11 +135,11 @@ func (c *DataController) Device_Sensor_Data_More() {
 	var cnt int64
 	var pageHelper = lib.PageHelper{}
 	pageHelper.List, cnt = Device.Read_DeviceData_By_T_snid_List(T_snid, Time_start, Time_end, page, page_z)
-	page_size := math.Ceil(float64(cnt) / float64(page_z))
+	pageSize := math.Ceil(float64(cnt) / float64(page_z))
 	pageHelper.CurrentPage = page
-	pageHelper.TotalPage = int(page_size)
+	pageHelper.TotalPage = int(pageSize)
 	pageHelper.TotalCount = int(cnt)
-	pageHelper.NextPage = page < int(page_size)
+	pageHelper.NextPage = page < int(pageSize)
 	pageHelper.PreviousPage = page > 1
 
 	c.Data["json"] = lib.JSONS{Code: 200, Msg: "ok!", Data: pageHelper}
@@ -171,46 +174,59 @@ func (c *DataController) Device_Sensor_List_Delete_Time() {
 		c.ServeJSON()
 		return
 	}
-	t_sn := c.GetString("t_sn")
-	t_id := c.GetString("t_id")
-	time_start := c.GetString("time_start")
-	t_end := c.GetString("t_end")
-
-	time := Device.DeleteDeviceDataByTime(t_sn, t_id, time_start, t_end)
-	if len(time) == 0 {
-		c.Data["json"] = lib.JSONS{Code: 200, Msg: "删除成功"}
+	type R_JSONS struct {
+		T_snid     []string `json:"t_sn"`
+		T_id       []string `json:"t_id"`
+		Time_start string   `json:"time_start"`
+		Time_end   string   `json:"time_end"`
+	}
+	all, _ := io.ReadAll(c.Ctx.Request.Body)
+	var r_json R_JSONS
+	err := json.Unmarshal(all, &r_json)
+	if err != nil {
+		return
+	}
+	var rows sql.Result
+	var affected int64
+	for i := 0; i < len(r_json.T_snid); i++ {
+		rows, err = Device.DeleteDeviceDataByTime(r_json.T_snid[i], r_json.T_id[i], r_json.Time_start, r_json.Time_end)
+		affected, _ = rows.RowsAffected()
+		affected += affected
+	}
+	if err == nil {
+		c.Data["json"] = lib.JSONS{Code: 200, Msg: "删除成功", Data: affected}
 		c.ServeJSON()
 	}
-	c.Data["json"] = lib.JSONS{Code: 201, Msg: "删除失败"}
+	c.Data["json"] = lib.JSONS{Code: 201, Msg: "删除失败", Data: affected}
 	c.ServeJSON()
 }
 
 // Device_Sensor_Update /Data/Device_Sensor_List_Update 更新设备数据
 func (c *DataController) Device_Sensor_Update() {
-
 	b_, _ := lib.Verification(c.Ctx.GetCookie("User_tokey"), c.GetString("User_tokey"))
 	if !b_ {
 		c.Data["json"] = lib.JSONS{Code: 201, Msg: "User_tokey Err!"}
 		c.ServeJSON()
 		return
 	}
-
 	T_sn := c.GetString("t_sn")
 	T_id, _ := c.GetInt("t_id")
 	T_t, _ := c.GetFloat("t_t")
 	T_rh, _ := c.GetFloat("t_rh")
 	T_site := c.GetString("t_site")
+	CreateTime := c.GetString("create_time")
 	fieldName := c.GetString("type")
 	val := c.GetString("value")
-
 	data := Device.DeviceData_R{
-		T_sn:   T_sn,
-		T_id:   T_id,
-		T_t:    float32(T_t),
-		T_rh:   float32(T_rh),
-		T_site: T_site,
+		T_sn:        T_sn,
+		T_id:        T_id,
+		T_t:         float32(T_t),
+		T_rh:        float32(T_rh),
+		T_site:      T_site,
+		Create_Time: CreateTime,
 	}
-
+	log.Println(T_sn, T_id, T_t, T_rh, T_site, fieldName, val, "修改值")
+	log.Println(data, "修改值")
 	Device.Update_DeviceSensorData(data, fieldName, val)
 
 	c.Data["json"] = lib.JSONS{
@@ -266,7 +282,7 @@ func (c *DataController) ImportData() {
 	return
 }
 
-// 导出传感器数据列表
+// Device_Sensor_Data_Excel 导出传感器数据列表
 func (c *DataController) Device_Sensor_Data_Excel() {
 	b_, _ := lib.Verification(c.Ctx.GetCookie("User_tokey"), c.GetString("User_tokey"))
 	if !b_ {

+ 1 - 1
lastupdate.tmp

@@ -1 +1 @@
-{"E:\\WebstormProjects\\ColdP_server\\controllers":1726223696532840900}
+{"E:\\WebstormProjects\\ColdP_server\\controllers":1727073730927050000}

+ 30 - 0
logs/logx/logx.log

@@ -105211,3 +105211,33 @@
 2024/09/13 18:35:21.945 [I] [WarningType.go:193]  =========== 初始化报警类型 =========
 2024/09/13 20:13:46.124 [E] [WarningType.go:202]  ColdP_server/models/Warning.Read_WarningType_All_Maps invalid connection
 2024/09/14 09:11:15.627 [I] [WarningType.go:193]  =========== 初始化报警类型 =========
+2024/09/14 10:35:50.356 [I] [WarningType.go:193]  =========== 初始化报警类型 =========
+2024/09/14 10:36:56.346 [I] [WarningType.go:193]  =========== 初始化报警类型 =========
+2024/09/14 10:42:33.850 [I] [WarningType.go:193]  =========== 初始化报警类型 =========
+2024/09/14 10:43:34.561 [I] [WarningType.go:193]  =========== 初始化报警类型 =========
+2024/09/20 11:09:08.981 [I] [WarningType.go:193]  =========== 初始化报警类型 =========
+2024/09/20 11:13:29.861 [I] [WarningType.go:193]  =========== 初始化报警类型 =========
+2024/09/20 11:19:14.619 [I] [WarningType.go:193]  =========== 初始化报警类型 =========
+2024/09/20 11:21:01.785 [I] [WarningType.go:193]  =========== 初始化报警类型 =========
+2024/09/20 11:25:46.641 [I] [WarningType.go:193]  =========== 初始化报警类型 =========
+2024/09/20 11:28:26.176 [I] [WarningType.go:193]  =========== 初始化报警类型 =========
+2024/09/20 11:43:17.615 [I] [WarningType.go:193]  =========== 初始化报警类型 =========
+2024/09/20 12:48:01.040 [E] [WarningType.go:202]  ColdP_server/models/Warning.Read_WarningType_All_Maps dial tcp 127.0.0.1:40306: connectex: No connection could be made because the target machine actively refused it.
+2024/09/23 09:16:10.414 [I] [WarningType.go:193]  =========== 初始化报警类型 =========
+2024/09/23 10:17:41.509 [I] [WarningType.go:193]  =========== 初始化报警类型 =========
+2024/09/23 10:50:29.158 [I] [WarningType.go:193]  =========== 初始化报警类型 =========
+2024/09/23 10:58:52.330 [I] [WarningType.go:193]  =========== 初始化报警类型 =========
+2024/09/23 11:09:41.252 [I] [WarningType.go:193]  =========== 初始化报警类型 =========
+2024/09/23 11:11:22.214 [I] [WarningType.go:193]  =========== 初始化报警类型 =========
+2024/09/23 13:36:49.562 [E] [WarningType.go:202]  ColdP_server/models/Warning.Read_WarningType_All_Maps invalid connection
+2024/09/23 14:03:55.769 [I] [WarningType.go:193]  =========== 初始化报警类型 =========
+2024/09/23 14:21:51.671 [I] [WarningType.go:193]  =========== 初始化报警类型 =========
+2024/09/23 14:22:07.948 [I] [WarningType.go:193]  =========== 初始化报警类型 =========
+2024/09/23 14:27:59.673 [I] [WarningType.go:193]  =========== 初始化报警类型 =========
+2024/09/23 14:33:33.951 [I] [WarningType.go:193]  =========== 初始化报警类型 =========
+2024/09/23 14:37:05.601 [I] [WarningType.go:193]  =========== 初始化报警类型 =========
+2024/09/23 14:39:59.728 [I] [WarningType.go:193]  =========== 初始化报警类型 =========
+2024/09/23 14:40:27.449 [I] [WarningType.go:193]  =========== 初始化报警类型 =========
+2024/09/23 14:40:52.234 [I] [WarningType.go:193]  =========== 初始化报警类型 =========
+2024/09/23 14:41:42.654 [I] [WarningType.go:193]  =========== 初始化报警类型 =========
+2024/09/23 14:53:09.933 [I] [WarningType.go:193]  =========== 初始化报警类型 =========

+ 13 - 9
models/Device/DeviceData.go

@@ -3,6 +3,7 @@ package Device
 import (
 	"ColdP_server/conf"
 	"ColdP_server/controllers/lib"
+	"database/sql"
 	"encoding/json"
 	"fmt"
 	"github.com/astaxie/beego/cache"
@@ -357,21 +358,22 @@ func Read_DeviceData_By_T_snid_List(T_snid string, Time_start_ string, Time_end_
 func DeleteDeviceDataByDeviceDataRList(datas []DeviceData_R) {
 	o := orm.NewOrm()
 	for _, v := range datas {
-		_, err := o.Raw(fmt.Sprintf("delete from z_device_data_%s where t_id = ? and t_t = ? and t_rh = ? and t_site = ? ", v.T_sn), v.T_id, v.T_t, v.T_rh, v.T_site).Exec()
+		_, err := o.Raw(fmt.Sprintf("delete from z_device_data_%s where t_id = ? and t_t = ? and t_rh = ? and t_site = ? and create_time = ?", v.T_sn), v.T_id, v.T_t, v.T_rh, v.T_site, v.Create_Time).Exec()
 		if err != nil {
 			fmt.Println(err.Error())
 		}
 	}
 }
-func DeleteDeviceDataByTime(sn, t_id, time_start, time_end string) string {
+func DeleteDeviceDataByTime(sn, t_id, time_start, time_end string) (sql.Result, error) {
 	o := orm.NewOrm()
-	sprintf := fmt.Sprintf("delete from z_device_data_%s where t_id=%s  and t_time >= `%s` and t_time <= `%s` ", sn, t_id, time_start, time_end)
+	sprintf := fmt.Sprintf("delete from z_device_data_%s where t_id=%s and t_time >= '%s' and t_time <= '%s'", sn, t_id, time_start, time_end)
 	log.Println(sprintf)
-	_, err := o.Raw(sprintf).Exec()
+	count, err := o.Raw(sprintf).Exec()
 	if err != nil {
-		return "删除失败"
+		log.Println(err.Error())
+		return count, err
 	}
-	return ""
+	return count, nil
 }
 
 // ImportDeviceData 批量导入
@@ -507,8 +509,10 @@ func Read_DeviceData_Execl_ISREPEAT(sn, t_time, t_id string) bool {
 // Update_DeviceSensorData 更新设备数据
 func Update_DeviceSensorData(v DeviceData_R, fieldName, val string) {
 	o := orm.NewOrm()
-	sqlStatemt := fmt.Sprintf("update z_device_data_%s set %s = ? where t_id = ? and t_t = ? and t_rh = ? and t_site = ? ", v.T_sn, fieldName)
-	_, err := o.Raw(sqlStatemt, val, v.T_id, v.T_t, v.T_rh, v.T_site).Exec()
+	sqlStatemt := fmt.Sprintf("update z_device_data_%s set %s = ? where t_id = ? and t_t = ? and t_rh = ? and t_site = ? and create_time = ?", v.T_sn, fieldName)
+	log.Println(sqlStatemt)
+	log.Println("创建时间:", v.Create_Time)
+	_, err := o.Raw(sqlStatemt, val, v.T_id, v.T_t, v.T_rh, v.T_site, v.Create_Time).Exec()
 	if err != nil {
 		fmt.Println(err.Error())
 	}
@@ -519,7 +523,7 @@ func Copy_DeviceData(T_sn, T_id string, T_Rh, T_T any, T_Site, CreateTime string
 	T_sp := Read_device_sensor_parameter(T_sn, T_id)
 	o := orm.NewOrm()
 	sprintf := fmt.Sprintf("insert into z_device_data_%s(t_id,t_sp,t_time,t_t,t_rh,t_site,create_time) values (?,?,?,?,?,?,?)", T_sn)
-	log.Println(sprintf)
+	//log.Println(sprintf)
 	_, err := o.Raw(sprintf, T_id, T_sp, CreateTime, T_T, T_Rh, T_Site, CreateTime).Exec()
 	if err != nil {
 		fmt.Println(err.Error())

+ 87 - 85
views/Data/DataList.html

@@ -149,7 +149,8 @@
 
                         <div class="layui-input-inline layui-show-xs-block" style="float: right">
                             <button class="layui-btn layui-btn-normal" id="importData">导入数据</button>
-                            <button class="layui-btn layui-btn-normal" id="exportData" onclick="exportData()">导出数据</button>
+                            <button class="layui-btn layui-btn-normal" id="exportData" onclick="exportData()">导出数据
+                            </button>
                             <button class="layui-btn layui-btn-normal" onclick="F_moban()">导入模板说明</button>
                         </div>
                     </div>
@@ -159,12 +160,13 @@
                         <button class="layui-btn layui-btn-normal" onclick="reverseSelect()">反选</button>
                         <button class="layui-btn layui-btn-normal" onclick="noSelect()">全不选</button>
                         <button class="layui-btn layui-btn-danger" onclick="deleteSelect()">删除</button>
-                        <button class="layui-btn layui-btn-danger" onclick="deleteSelectTime()">删除选择时间范围</button>
+                        <button class="layui-btn layui-btn-danger" onclick="deleteSelectTime()">删除选择时间范围
+                        </button>
                     </div>
                 </div>
 
                 <!-- 传感器数据时间选择 选择 end-->
-                <div class="layui-card-body" >
+                <div class="layui-card-body">
                     <table class="layui-table ">
                         <colgroup>
                             <col width="100">
@@ -194,18 +196,18 @@
                     <!--按钮部分 start-->
                     <div>
                         <span>每页显示:</span>
-                    <select id="perPageSelect">
-                        <option value="10">10条/页</option>
-                        <option value="100">100条/页</option>
-                        <option value="300">300条/页</option>
-                        <option value="500">500条/页</option>
-                        <option value="800">800条/页</option>
-                        <option value="1000">1000条/页</option>
-                        <option value="2000">2000条/页</option>
-                        <option value="3000">3000条/页</option>
-                        <option value="4000">4000条/页</option>
-                        <option value="5000">5000条/页</option>
-                    </select>
+                        <select id="perPageSelect">
+                            <option value="10">10条/页</option>
+                            <option value="100">100条/页</option>
+                            <option value="300">300条/页</option>
+                            <option value="500">500条/页</option>
+                            <option value="800">800条/页</option>
+                            <option value="1000">1000条/页</option>
+                            <option value="2000">2000条/页</option>
+                            <option value="3000">3000条/页</option>
+                            <option value="4000">4000条/页</option>
+                            <option value="5000">5000条/页</option>
+                        </select>
                     </div>
 
                     <!--按钮部分 end-->
@@ -215,7 +217,7 @@
 
                     </div>
 
-<!--                    <input type="number" id="perPageInput" min="1" value="10">-->
+                    <!--                    <input type="number" id="perPageInput" min="1" value="10">-->
 
                     <!--分页部分 end-->
                 </div>
@@ -520,6 +522,7 @@
                 let t = {
                     t_sn: $(e).attr('data-sn'),
                     t_id: Number.parseInt($(e).attr('data-id')),
+                    create_time: ($(e).attr('data-createtime')),
                     t_t: Number.parseFloat($(e).attr('data-tt')),
                     t_rh: Number.parseFloat($(e).attr('data-trh')),
                     t_site: $(e).attr('data-site'),
@@ -551,51 +554,69 @@
             layui.layer.close(index);
         });
     }
-    //删除选择时间范围
-function deleteSelectTime() {
-    // 获取选择的行
-    var Time_start = $("#Time_start").val();
-    var Time_end = $("#Time_end").val();
-    var T_sn = $("#sn_id").val();
-    var split = T_sn.split(",");
-
-    // 构造查询字符串
-    var query = `?t_sn=${encodeURIComponent(split[0])}&t_id=${encodeURIComponent(split[1])}&time_start=${encodeURIComponent(Time_start)}&t_end=${encodeURIComponent(Time_end)}`;
 
-    layui.layer.confirm(`是否删除时间: ${Time_start}-------${Time_end} 的数据`, function (index) {
-        $.ajax({
-            type: "GET",
-            url: `/Data/Device_Sensor_List_Delete_Time${query}`,
-            success: function (res) {
-                console.log(res.Code)
-                if (res.Code === 200) {
-                    layui.layer.msg(`删除数据成功!`);
-                    get_DeviceSensor_data(0);
-                } else {
-                    layui.layer.msg(res.Msg);
-                }
+    //删除选择时间范围
+    function deleteSelectTime() {
+        // 获取选择的行
+        console.log("删除选中事件范围")
+        const Time_start = $("#Time_start").val();
+        const Time_end = $("#Time_end").val();
+        console.log("删除选中事件范围", Time_start, Time_end)
+        let checkboxes = $('.checkboxxx');
+        let querys = {
+            t_sn: [],
+            t_id: [],
+            time_start:Time_start,
+            time_end:Time_end,
+        };
+        checkboxes.each(function () {
+            if ($(this).is(':checked')) {
+                const checkboxValue = $(this).val();
+                const values = checkboxValue.split(',');
+                const sn = values[0];
+                const id = values[1];
+                console.log(sn, id);
+                querys.t_sn.push(sn);
+                querys.t_id.push(id);
             }
         });
-
-        layui.layer.close(index);
-    });
-}
-
-
+        if (querys.length === 0) {
+            layui.layer.msg('没有选中要删除的记录哦!')
+        }else {
+            layui.layer.confirm(`是否删除选中时间: ${Time_start}-------${Time_end} 的数据`, function (index) {
+                $.ajax({
+                    type: "POST",
+                    url: `/Data/Device_Sensor_List_Delete_Time`,
+                    data: JSON.stringify(querys),
+                    contentType: 'application/json;charset=utf-8',
+                    success: function (res) {
+                        console.log(res.Code)
+                        if (res.Code === 200) {
+                            layui.layer.msg(`成功删除 ${res.Data} 条数据`);
+                            get_DeviceSensor_data(0);
+                        } else {
+                            layui.layer.msg(res.Msg);
+                        }
+                    }
+                });
+                layui.layer.close(index);
+            });
+        }
+    }
 
     //删除当前行,当当前行按钮被点击后
     function deleteOne(e) {
         e = $(e).parent().prevAll()
         e = e[e.length - 1]
         e = $(e).children()[0]
-        console.log(e,"==============")
+        console.log(e, "==============")
         let t = {
             t_sn: $(e).attr('data-sn'),
             t_id: Number.parseInt($(e).attr('data-id')),
+            create_time: ($(e).attr('data-createtime')),
             t_t: Number.parseFloat($(e).attr('data-tt')),
             t_rh: Number.parseFloat($(e).attr('data-trh')),
             t_site: $(e).attr('data-site'),
-            User_tokey: $.cookie("User_tokey")
         }
         layui.layer.confirm(`是否删除选中 sn: ${t.t_sn} 1 条记录`, {title: '删除记录'}, function (index) {
             $.ajax({
@@ -644,13 +665,14 @@ function deleteSelectTime() {
         }
 
     }
-    $('#perPageSelect').on('change', function() {
+
+    $('#perPageSelect').on('change', function () {
         let itemsPerPage = $(this).val();
         get_DeviceSensor_data(0, itemsPerPage); // 调用获取数据函数,传入新的每页条数
     });
 
     // 如果是输入框,则可能需要验证用户输入并做相应的处理
-    $('#perPageInput').on('input', function() {
+    $('#perPageInput').on('input', function () {
         let itemsPerPage = parseInt($(this).val());
         if (!isNaN(itemsPerPage)) {
             get_DeviceSensor_data(0, itemsPerPage);
@@ -661,7 +683,7 @@ function deleteSelectTime() {
     });
 
 
-    function get_DeviceSensor_data(page,itemsPerPage) {
+    function get_DeviceSensor_data(page, itemsPerPage) {
 
         if ($("#Time_start").val().length > 0) {
             Time_start = $("#Time_start").val();
@@ -698,7 +720,7 @@ function deleteSelectTime() {
                     $('#DeviceSensor_data').html("")
                     $('#DeviceSensor_data_Pages').html("")
                     $('#DeviceSensor_data_Pages_x').html("")
-                    if (result.Data !=null) {
+                    if (result.Data != null) {
                         DeviceSensor_data = result.Data.list
                     }
                     if (DeviceSensor_data.length == 0) {
@@ -706,7 +728,7 @@ function deleteSelectTime() {
                         return
                     }
                     addDeviceSensorData(result.Data.list)
-                    addDeviceSensorDataPage(result.Data,itemsPerPage)
+                    addDeviceSensorDataPage(result.Data, itemsPerPage)
 
                 } else {
 
@@ -784,7 +806,7 @@ function deleteSelectTime() {
     }
 
     //分页添加
-    function addDeviceSensorDataPage(pageInfo,itemsPerPage) {
+    function addDeviceSensorDataPage(pageInfo, itemsPerPage) {
         let start, end
         start = pageInfo.currentPage - 5 < 1 ? 1 : pageInfo.currentPage - 5
         end = pageInfo.currentPage + 5 > pageInfo.totalPage ? pageInfo.totalPage : pageInfo.currentPage + 5
@@ -843,6 +865,7 @@ function deleteSelectTime() {
             */
         }
     }
+
     // 新增copyAndAdd函数实现复制并添加新行
     function copyAndAdds(button, t_sn, t_id, t_t, t_rh, t_site, create_time) {
         // 准备发送给后端的数据对象
@@ -861,7 +884,7 @@ function deleteSelectTime() {
             type: 'POST',
             contentType: 'application/json',
             data: JSON.stringify(dataToSend),
-            success: function(response) {
+            success: function (response) {
                 console.log("数据提交成功,响应:", response.Data);
 
                 // 假设后端返回了新行ID或者其他需要的数据,这里可以根据需要处理response
@@ -901,13 +924,14 @@ function deleteSelectTime() {
                 // window.location.reload()
                 // 这里可以添加成功后的其他操作,如提示用户、更新界面等
             },
-            error: function(jqXHR, textStatus, errorThrown) {
+            error: function (jqXHR, textStatus, errorThrown) {
                 console.error("数据提交失败:", textStatus, errorThrown);
                 // 处理错误情况,比如提示用户
                 alert("数据提交失败,请重试!");
             }
         });
     }
+
     function showRecord(e) {
         e = $(e).parent().prevAll()
         e = e[e.length - 1]
@@ -957,16 +981,19 @@ function deleteSelectTime() {
         let e = $(even).prevAll()
         console.log(e)
         e = $(e[e.length - 1]).children()[0]
-        console.log(e)
+        // console.log(e)
+
         let t = {
             t_sn: $(e).attr('data-sn'),
             t_id: Number.parseInt($(e).attr('data-id')),
+            create_time: ($(e).attr('data-createtime')),
             t_t: Number.parseFloat($(e).attr('data-tt')),
             t_rh: Number.parseFloat($(e).attr('data-trh')),
             t_site: $(e).attr('data-site'),
         }
+        // console.log(t)
         let type = $(even).attr('data-type')
-        console.log(t)
+        // console.log(t,"============修改值==================")
         let input = $(`<input class="layui-input" type="text" value="${even.innerText}">`)
         input[0].onblur = function () {
             t["type"] = type
@@ -1032,33 +1059,7 @@ function deleteSelectTime() {
             Time_end = ""
         }
         let checkboxes = $('.checkboxxx');
-        // console.log(checkboxs,"==========================")
-        // checkboxs.each(function (index, item) {})
-        // let checkbox = document.getElementById('sn_id');
-        // console.log(checkbox.value)
-        // if (checkbox.checked) {
-        //     $.ajax({
-        //         type: "post",
-        //         url: "/Data/EXportData",
-        //         data: {
-        //             T_snid: checkbox.value,
-        //             Time_start: Time_start,
-        //             Time_end: Time_end,
-        //         },
-        //         success: function (rlt) {
-        //             console.log(rlt)
-        //             if (rlt.Code === 200) {
-        //                 let link = document.createElement('a');
-        //                 link.href = rlt.Data;
-        //                 link.click(); // 触发点击事件以开始下载
-        //                 link.remove();
-        //             }
-        //     }
-        //     })
-        // }else{
-        //     layui.layer.msg("请选择导出项")
-        // }
-        checkboxes.each(function() {
+        checkboxes.each(function () {
             if ($(this).is(':checked')) {
                 var checkboxValue = $(this).val();
                 var values = checkboxValue.split(',');
@@ -1184,11 +1185,12 @@ function deleteSelectTime() {
         });
         return false
     }
+
     function F_moban() {
         layer.open({
             title: '导入模版'
-            ,content: '1、根据模板格式 导入数据 <a href="/static/20240523140020.xlsx" style="color: #1E9FFF">点击下载模版</a><hr>'+
-            '2、导入文件名为 SN编号,如 2024xxxxxxxxxx.xlsx <hr>'
+            , content: '1、导入模板需先导出然后根据导出模板进行填写导入<hr>' +
+                '2、导入文件名为 SN编号,如 2024xxxxxxxxxx.xlsx <hr>'
 
         });
     }