From f6abc8c724eed706487b7616bc6c816e5db5c939 Mon Sep 17 00:00:00 2001
From: czt <czt18638530771@163.com>
Date: 星期二, 09 十二月 2025 20:13:48 +0800
Subject: [PATCH] 数量检测页面提交

---
 fzzy-igdss-web/src/main/resources/static/security/quantity.js |  144 ++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 144 insertions(+), 0 deletions(-)

diff --git a/fzzy-igdss-web/src/main/resources/static/security/quantity.js b/fzzy-igdss-web/src/main/resources/static/security/quantity.js
new file mode 100644
index 0000000..856ddd3
--- /dev/null
+++ b/fzzy-igdss-web/src/main/resources/static/security/quantity.js
@@ -0,0 +1,144 @@
+var layer;
+var form;
+var curCamera;
+
+layui.use(['layer'], function () {
+    form = layui.form;
+    layer = layui.layer;
+
+    // 璋冭壊鏉垮垏鎹簨浠�
+    document.querySelectorAll('.palette-item').forEach(item => {
+        item.addEventListener('click', function() {
+            document.querySelectorAll('.palette-item').forEach(i => {
+                i.classList.remove('active');
+            });
+            this.classList.add('active');
+            const paletteName = this.textContent.trim();
+            layer.msg(`宸插垏鎹㈣嚦${paletteName}璋冭壊鏉縛, {icon: 1, time: 1000});
+        });
+    });
+
+
+    //閫夋嫨鎽勫儚澶村悗瑙﹀彂鐨勪簨浠�
+    const cameraSelect = document.getElementById('select-camera');
+    cameraSelect.addEventListener('change', function() {
+        const selectedCamera = this.value;
+        //console.log("--------------"+selectedCamera);
+        video(selectedCamera);
+
+        // 鏇存柊娓╁害璧板娍鍥�
+        // updateEchartsTemp(selectedCamera);
+    });
+
+
+    // 鍒濆鍖朎Charts娓╁害璧板娍鍥�
+    initEchartsTemp();
+
+});
+
+/**
+ * 瑙嗛鎾斁
+ * @param selectId
+ */
+function video(selectId) {
+    //浠庡垪琛ㄤ腑鑾峰彇鎽勫儚澶翠俊鎭�
+    curCamera = listCamera.find(camera => camera.id === selectId);
+    if (!curCamera) { layer.msg('娌℃湁鑾峰彇鍒板綋鍓嶆憚鍍忓ご淇℃伅鈥︹��', {icon: 1, time: 1200});}
+
+
+}
+
+/**
+ * 鏇存柊娓╁害璧板娍鍥�
+ * @param selectId
+ */
+function updateEchartsTemp(selectId) {
+    var data = {
+        cameraId: selectId
+    };
+    $.ajax({
+        type: 'POST',
+        url: "/security/infrared/chart-data",
+        dataType: 'JSON',
+        contentType: "application/json;charset=UTF-8",
+        data: JSON.stringify(data),
+        success: function (result) {
+            //layer.msg("淇℃伅鏇存柊瀹屾垚锛侊紒");
+        },
+        error: function (result) {
+           // layer.msg(result.msg);
+        }
+    });
+}
+
+// 鍒濆鍖朎Charts娓╁害璧板娍鍥�
+function initEchartsTemp() {
+    // 鍒濆鍖朎Charts娓╁害璧板娍鍥�
+    var temperatureChartDom = document.getElementById('temperatureChart');
+    var temperatureChart = echarts.init(temperatureChartDom);
+
+    // 鍥捐〃閰嶇疆椤�
+    var option = {
+        tooltip: {
+            trigger: 'axis',
+            axisPointer: {
+                type: 'cross',
+                label: {
+                    backgroundColor: '#6a7985'
+                }
+            }
+        },
+        legend: {
+            data: ['鏁伴噺 (KG)'],
+            top: 0
+        },
+        grid: {
+            left: '3%',
+            right: '4%',
+            bottom: '3%',
+            containLabel: true
+        },
+        xAxis: [
+            {
+                type: 'category',
+                boundaryGap: false,
+                data: ['12-01', '12-02', '12-03', '12-04', '12-05', '12-06', '12-07']
+            }
+        ],
+        yAxis: [
+            {
+                type: 'value',
+                name: '鏁伴噺 (KG)',
+                min: 0,
+                max: 3000000,
+                axisLabel: {
+                    formatter: '{value} KG'
+                }
+            }
+        ],
+        series: [
+            {
+                name: '鏁伴噺 (KG)',
+                type: 'line',
+                smooth: true,
+                lineStyle: {
+                    width: 2,
+                    color: '#0f3460'
+                },
+                areaStyle: {
+                    color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
+                        { offset: 0, color: 'rgba(15, 52, 96, 0.3)' },
+                        { offset: 1, color: 'rgba(15, 52, 96, 0.05)' }
+                    ])
+                },
+                data: [2560000, 2510000, 2540000, 2530000, 2490000, 2610000, 2570000]
+            }
+        ]
+    };
+    // 娓叉煋鍥捐〃
+    option && temperatureChart.setOption(option);
+    // 绐楀彛澶у皬鍙樺寲鏃惰皟鏁村浘琛ㄥぇ灏�
+    window.addEventListener('resize', function() {
+        temperatureChart.resize();
+    });
+}
\ No newline at end of file

--
Gitblit v1.9.3