From fa6431a7b8233e8157684b4653fc1a7ff77d8f62 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A4=9C=E7=AC=99=E6=AD=8C?= <2277317060@qq.com> Date: Wed, 18 Oct 2023 15:19:43 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=AF=BC=E5=87=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/static/board/board.js | 14 ++- .../resources/templates/board/board1.html | 88 ++++++++++++++++--- 2 files changed, 86 insertions(+), 16 deletions(-) diff --git a/haiwei-admin/src/main/resources/static/board/board.js b/haiwei-admin/src/main/resources/static/board/board.js index 5026735..cfb9844 100644 --- a/haiwei-admin/src/main/resources/static/board/board.js +++ b/haiwei-admin/src/main/resources/static/board/board.js @@ -64,7 +64,7 @@ $(() => { }) let chart1 = (el, data) => { - let xData = Object.keys(data[0]).filter(e => e !== 'time') + let xData = Object.keys(data?.[0]||{})?.filter(e => e !== 'time') || [] let series = xData.map(e => { return { name: e, @@ -73,7 +73,7 @@ let chart1 = (el, data) => { symbol: "circle", symbolSize: 5, showSymbol: false, - data: data.map(val => val[e]), + data: data?.map(val => val[e]) || [], } }) let chart = echarts.init(el); @@ -86,6 +86,16 @@ let chart1 = (el, data) => { }, }, }, + toolbox: { + show: true, + feature: { + dataZoom: {show:false}, + dataView: { show:false }, + magicType: { show:false }, + restore: {show:false}, + saveAsImage: {} + } + }, legend: { icon: "rect", itemWidth: 14, diff --git a/haiwei-admin/src/main/resources/templates/board/board1.html b/haiwei-admin/src/main/resources/templates/board/board1.html index 8c1729b..07434dc 100644 --- a/haiwei-admin/src/main/resources/templates/board/board1.html +++ b/haiwei-admin/src/main/resources/templates/board/board1.html @@ -4,6 +4,8 @@ + + @@ -123,11 +125,38 @@ }) }) } + const derive = () =>{ + let canvasNode = $("#chart1 div canvas")[0] + console.log(canvasNode) + let canvasURL = canvasNode.toDataURL("image/png"); + let link = document.createElement("a"); + link.setAttribute("href", canvasURL); + link.setAttribute("download", "picture.png"); + link.click(); + } + const derive2 = () => { + let params = {} + if ($('#startTime2').val()) { + params.beginTime = new Date($('#startTime2').val()) + } + if ($('#endTime2').val()) { + params.endTime = new Date($('#endTime2').val()) + } + if ($('#name').val()) { + params.name = $('#name').val() + } + if ($('#type').val()) { + params.type = $('#type').val() + } + $.post(ctx + 'broad/home/exportParamList', params, (e) => { + window.location.href = ctx + "common/download?fileName=" + encodeURI(e.msg) + "&delete=" + true; + }) + }
首页
60型脱水机
- +
视频展示
文档归档
设备介绍
@@ -185,14 +214,15 @@
起止时间: - + type="text"> - - +  搜索 -  导出 +  导出
@@ -205,25 +235,25 @@
客户名称: - +
实验胶种: - +
起止时间: - + type="text"> - - + type="text">
 搜索 -  导出 +  导出
@@ -238,10 +268,40 @@ +