Bläddra i källkod

Merge branch 'master' of http://116.63.33.55/git/read_opc

ws 1 år sedan
förälder
incheckning
ba2218158a
25 ändrade filer med 773 tillägg och 928 borttagningar
  1. 17 0
      PrintServer/src/main/java/com/jd/printserver/controller/PrintServerController.java
  2. 10 0
      PrintServer/src/main/java/com/jd/printserver/javafx/entity/PrintParam.java
  3. 31 9
      PrintServer/src/main/java/com/jd/printserver/utils/PrintUtils.java
  4. 9 0
      chuanyi_client2/src/api/printConfig.js
  5. 4 2
      chuanyi_client2/src/utils/print.js
  6. 39 13
      chuanyi_client2/src/views/print_config/index.vue
  7. 5 0
      cqcy-ei/cqcy-ei-common/src/main/java/com/example/opc_common/entity/PrintConfig.java
  8. 19 29
      cqcy-ei/cqcy-ei-da/src/main/java/com/example/opc_da/service/impl/ReportTableServiceImpl.java
  9. 5 4
      cqcy-ei/cqcy-ei-da/src/main/resources/mapper/PrintDao.xml
  10. 1 1
      cqcy-ei/cqcy-ei-da/src/main/resources/static/app/index.html
  11. 0 0
      cqcy-ei/cqcy-ei-da/src/main/resources/static/app/static/js/index.aba819c1.js
  12. 0 0
      cqcy-ei/cqcy-ei-da/src/main/resources/static/app/static/js/pages-homePage-index.754b6b9c.js
  13. 0 0
      cqcy-ei/cqcy-ei-da/src/main/resources/static/app/static/js/pages-homePage-index.a262bd76.js
  14. 283 0
      cqcy-ei/cqcy-ei-da/src/main/resources/static/app/static/webview/bar-wv.html
  15. 3 4
      cqcy-ei/cqcy-ei-da/src/main/resources/static/app/static/webview/dataItem-wv.html
  16. 36 16
      cqcy-ei/cqcy-ei-da/src/main/resources/static/app/static/webview/line-wv.html
  17. 247 0
      cqcy-ei/cqcy-ei-da/src/main/resources/static/app/static/webview/pie-wv.html
  18. 2 2
      cqcy-ei/cqcy-ei-da/src/main/resources/static/app/static/webview/report-wv.html
  19. 0 791
      cqcy-ei/cqcy-ei-da/src/main/resources/static/app/static/webview/report-wv1.html
  20. 39 36
      reado-app/pages/homePage/index.vue
  21. 2 2
      reado-app/static/webview/bar-wv.html
  22. 3 4
      reado-app/static/webview/dataItem-wv.html
  23. 15 12
      reado-app/static/webview/line-wv.html
  24. 1 1
      reado-app/static/webview/pie-wv.html
  25. 2 2
      reado-app/static/webview/report-wv.html

+ 17 - 0
PrintServer/src/main/java/com/jd/printserver/controller/PrintServerController.java

@@ -26,7 +26,9 @@ import org.springframework.beans.factory.annotation.Value;
 import org.springframework.web.bind.annotation.*;
 import org.springframework.web.multipart.MultipartFile;
 
+import javax.print.PrintService;
 import javax.servlet.http.HttpServletRequest;
+import java.awt.print.PrinterJob;
 import java.io.File;
 import java.io.IOException;
 import java.util.*;
@@ -98,6 +100,21 @@ public class PrintServerController extends BaseController {
     }
 
     /**
+     * 查询打印机名称的列表
+     * @return 名称列表
+     */
+    @RequestMapping(value = "/getPrintName")
+    @CrossOrigin
+    public AjaxResult getPrintName(){
+        List<String> list = new ArrayList<>();
+        for (PrintService ps : PrinterJob.lookupPrintServices()) {
+            String printName = ps.toString();
+            list.add(printName);
+        }
+        return success(list);
+    }
+
+    /**
      *
      * @param request 获取客户端IP
      * @param excelUrl 报表地址。使用id时,excelUrl无效。id或excelUrl必须有一项必填

+ 10 - 0
PrintServer/src/main/java/com/jd/printserver/javafx/entity/PrintParam.java

@@ -15,6 +15,12 @@ public class PrintParam {
 
     /**
      * (print)
+     * 打印机名称
+     */
+    private String printName = "";
+
+    /**
+     * (print)
      * 打印方向  0 自动(停用) 1 横向 2 纵向
      */
     private Integer orientation = 1;
@@ -121,6 +127,10 @@ public class PrintParam {
 
     public void setNullToDefault(){
         PrintParam defaultPrintParam = new PrintParam();
+        if(StrUtil.isEmpty(this.printName)){
+            this.printName = defaultPrintParam.getPrintName();
+        }
+
         if(StrUtil.isEmpty(this.jobName)){
             this.jobName = defaultPrintParam.getJobName();
         }

+ 31 - 9
PrintServer/src/main/java/com/jd/printserver/utils/PrintUtils.java

@@ -133,20 +133,42 @@ public class PrintUtils {
 
             PrinterJob printJob = PrinterJob.getPrinterJob();
             printJob.setJobName(printParam.getJobName());
-            //默认打印机
-            PrintService printService = PrintServiceLookup.lookupDefaultPrintService();
+//            //默认打印机
+//            PrintService printService = PrintServiceLookup.lookupDefaultPrintService();
+//
+//            if (printService != null) {
+//                try {
+//                    printJob.setPrintService(printService);
+//                } catch (PrinterException e) {
+//                    log.error("打印失败,打印机不可用,请检查");
+//                    return false;
+//                }
+//            } else {
+//                log.error("打印失败,未找到打印机,请检查");
+//                return false;
+//            }
 
-            if (printService != null) {
-                try {
-                    printJob.setPrintService(printService);
-                } catch (PrinterException e) {
-                    log.error("打印失败,打印机不可用,请检查");
-                    return false;
+            // 遍历所有打印机的名称
+            boolean isChoose = false;
+            for (PrintService printService : PrinterJob.lookupPrintServices()) {
+                String psName = printService.toString();
+                // 选用指定打印机
+                if (psName.equals(printParam.getPrintName())) {
+                    isChoose = true;
+                    try {
+                        printJob.setPrintService(printService);
+                    } catch (PrinterException e) {
+                        log.error("打印失败,打印机不可用,请检查");
+                        return false;
+                    }
+                    break;
                 }
-            } else {
+            }
+            if(!isChoose){
                 log.error("打印失败,未找到打印机,请检查");
                 return false;
             }
+
             // 设置纸张及缩放
             // ACTUAL_SIZE 以100%比例打印图像
             // SHRINK_TO_FIT 如果需要,缩小图像以适应页面

+ 9 - 0
chuanyi_client2/src/api/printConfig.js

@@ -1,5 +1,14 @@
 import request from "@/utils/request";
 
+//查询打印机
+export function getPrint() {
+  return request({
+      url: 'http://localhost:8084/api/getPrintName',
+      // url: 'http://192.168.0.11:8084/api/getPrintName',
+      method: 'get'
+  })
+}
+
 /** 查询所有打印配置 */
 export function getAllPrintConfig(params) {
   return request({

+ 4 - 2
chuanyi_client2/src/utils/print.js

@@ -22,12 +22,14 @@ export function print(id) {
       printApi(query).then((res) => {
         if (res.code === 200) {
           Message({
-            message: res.msg,
+            message: '打印成功',
             type: "success",
           });
         }
         downloadLoadingInstance.close();
-      });
+      }).catch(err=>{
+        downloadLoadingInstance.close();
+      })
     }
   });
 }

+ 39 - 13
chuanyi_client2/src/views/print_config/index.vue

@@ -32,6 +32,8 @@
         :header-cell-style="{ background: '#E8E8E8' }"
         style="width: 100%"
       >
+        <el-table-column align="center" label="打印机" prop="printName">
+        </el-table-column>
         <el-table-column align="center" label="作业名称" prop="jobName">
         </el-table-column>
         <el-table-column align="center" label="打印方向" prop="orientation">
@@ -91,7 +93,7 @@
               size="mini"
               @click="handleDelete(scope.$index, scope.row)"
               type="text"
-              style="color:red"
+              style="color: red"
               icon="el-icon-delete"
               >删除</el-button
             >
@@ -129,16 +131,32 @@
         :rules="dataModelRules"
         label-width="110px"
       >
-        <el-form-item label="作业名称" prop="jobName">
+      <el-row>
+        <el-col :span="12">
+          <el-form-item label="打印机" prop="printName">
+          <el-select
+            v-model="dataModelForm.printName"
+            placeholder="请选择打印机"
+            style="width: 250px"
+            :disabled="isDisable"
+          >
+            <el-option v-for="item in printNameData" :label="item" :value="item"> </el-option>
+          </el-select>
+        </el-form-item>
+        </el-col>
+        <el-col :span="12">
+          <el-form-item label="作业名称" prop="jobName">
           <el-input
             v-model="dataModelForm.jobName"
-            placeholder="请输入名称"
+            placeholder="请输入作业名称"
             maxlength="20"
             style="width: 250px"
             :disabled="isDisable"
           ></el-input>
         </el-form-item>
-        <el-row>
+      </el-col>
+      </el-row>
+      <el-row>
           <el-col :span="12">
             <el-form-item label="打印方向" prop="orientation">
               <el-select
@@ -435,6 +453,7 @@ import {
   getPrintConfigById,
   updatePrintConfigById,
   delPrintConfigById,
+  getPrint
 } from "@/api/printConfig";
 
 export default {
@@ -489,6 +508,9 @@ export default {
         fitToPages: 1,
       },
       dataModelRules: {
+        printName:[
+          { required: true, message: "请选择打印配置", trigger: "change" },
+        ],
         jobName: [
           { required: true, message: "请输入作业名称", trigger: "blur" },
         ],
@@ -538,22 +560,27 @@ export default {
         page: 1,
         limit: 10,
       },
+      // 详情禁用
       isDisable: false,
+      // 打印机集合
+      printNameData:[]
     };
   },
   watch: {},
   beforeDestroy() {},
   created() {
-    this.getAllPrintConfig();
+    this.getPrint()
   },
   methods: {
-    sortChange({ prop, order }) {
-      this.tableData.sort(customCompare(prop, order));
-    },
-    extractNumbers(expr) {
-      const regex = /\d+/g;
-      const numbers = expr.match(regex);
-      return numbers ? numbers.map(Number) : [];
+    /** 获取打印机 */
+    getPrint(){
+      getPrint().then(res=>{
+        console.log(res)
+        if(res.code===200){
+          this.printNameData=res.data
+        }
+        this.getAllPrintConfig();
+      })
     },
     /** 新增打印配置 */
     handleAdd() {
@@ -625,7 +652,6 @@ export default {
     /** 获取所有打印配置 */
     getAllPrintConfig() {
       getAllPrintConfig(this.queryParams).then((res) => {
-        console.log(res);
         if (res.code === 200) {
           this.tableData = res.data.printConfigList;
           this.tableTotal = res.data.count;

+ 5 - 0
cqcy-ei/cqcy-ei-common/src/main/java/com/example/opc_common/entity/PrintConfig.java

@@ -19,6 +19,11 @@ public class PrintConfig {
     private String jobName = "EI Auto Print Job";
 
     /**
+     * 打印机名称
+     */
+    private String printName = "";
+
+    /**
      * 打印方向  0 自动 1 横向 2 纵向
      */
     private Integer orientation = 0;

+ 19 - 29
cqcy-ei/cqcy-ei-da/src/main/java/com/example/opc_da/service/impl/ReportTableServiceImpl.java

@@ -289,13 +289,29 @@ public class ReportTableServiceImpl implements ReportTableService {
         if (Blank.isEmpty(reportTableType)) {
             return Result.no(ResultEnum.REQUEST_WRONGPARAMS.getRespCode(), "报表类型不存在");
         }
+        //如果是手动报表
         if (reportTableType.equals(ConstantStr.MANUAL_REPORT)) {
             return Result.ok(reportTableTask.getManualReport(reportTable));
+            //如果是自动报表主表
         } else if (reportTableType.equals(ConstantStr.AUTOMATIC_REPORT)) {
             return Result.ok(reportTableTask.getAutoReport(reportTable));
+            //如果是自动报表子表
+        } else if (reportTableType.equals(ConstantStr.AUTOMATIC_GENERATE_REPORT)) {
+            reportTable.setReportTableItemList(reportTableDao.getTableItemListById(id));
+            reportTable.setReportChartList(reportTableDao.getReportChartList(id));
+            reportTable.setUserGroupList(reportTableDao.getTableUserGroup(id));
+            return Result.ok(reportTable);
+            //如果是事件驱动报表主表
         } else if (reportTableType.equals(ConstantStr.EVENT_DRIVEN_REPORT)) {
             String chTableId = reportTableDao.getEventChTableId(id);
             reportTable.setReportTableItemList(reportTableDao.getTableItemListById(chTableId));
+            //如果是事件驱动报表子表
+        } else if (reportTableType.equals(ConstantStr.EVENT_GENERATE_REPORT)) {
+            reportTable.setReportTableItemList(reportTableDao.getTableItemListById(id));
+            reportTable.setReportChartList(reportTableDao.getReportChartList(id));
+            reportTable.setUserGroupList(reportTableDao.getTableUserGroup(id));
+            return Result.ok(reportTable);
+            //如果是设备报表主表
         } else if (reportTableType.equals(ConstantStr.DEVICE_REPORT)) {
             Integer tableTemplateId = reportTable.getTableTemplateId();
             Object o = redisUtil.get(ConstantStr.TABLE_ID + tableTemplateId);
@@ -327,36 +343,10 @@ public class ReportTableServiceImpl implements ReportTableService {
             }
             String chTableId = reportTableDao.getEventChTableId(id);
             reportTable.setReportTableItemList(reportTableDao.getTableItemListById(chTableId));
+            ///如果是设备报表子表
         } else if (reportTableType.equals(ConstantStr.DEVICE_GENERATE_REPORT)) {
             List<ReportTableItem> reportTableItemList1 = reportTableDao.getTableItemListById(id);
-            if (Blank.isNotEmpty(reportTableItemList1)) {
-                reportTable.setReportTableItemList(reportTableItemList1);
-                return Result.ok(reportTable);
-            }
-            Integer tableTemplateId = reportTable.getTableTemplateId();
-            List<TableTemplateTableItem> tttItemList = reportTableDao.getTttiByTemplateId(tableTemplateId);
-            List<ReportTableItem> reportTableItemList = new ArrayList<>();
-            if (Blank.isNotEmpty(tttItemList)) {
-                for (TableTemplateTableItem tttItem : tttItemList) {
-                    Integer timeItemType = tttItem.getTimeItemType();
-                    if (Blank.isNotEmpty(timeItemType)) {
-                        if (tttItem.getTimeItemType().equals(ConstantStr.END_TIME_ITEM) || timeItemType.equals(ConstantStr.START_TIME_ITEM)) {
-                            ReportTableItem reportTableItem =
-                                    (ReportTableItem) redisUtil.get(tableTemplateId + ConstantStr.REPORT_TABLE_ITEM + tttItem.getItemReadName() + timeItemType);
-                            if (Blank.isNotEmpty(reportTableItem)) {
-                                reportTableItemList.add(reportTableItem);
-                            }
-                        }
-                    } else {
-                        ReportTableItem reportTableItem =
-                                (ReportTableItem) redisUtil.get(tableTemplateId + ConstantStr.REPORT_TABLE_ITEM + tttItem.getItemReadName());
-                        if (Blank.isNotEmpty(reportTableItem)) {
-                            reportTableItemList.add(reportTableItem);
-                        }
-                    }
-                }
-            }
-            reportTable.setReportTableItemList(reportTableItemList);
+            reportTable.setReportTableItemList(reportTableItemList1);
             return Result.ok(reportTable);
         } else {
             reportTable.setReportTableItemList(reportTableDao.getTableItemListById(id));
@@ -456,7 +446,7 @@ public class ReportTableServiceImpl implements ReportTableService {
         //删除相应子报表的表格数据项信息
         reportTableDao.delRtiByRtIdList(idList);
         //获取子报表所有统计图id
-        List<Integer> rcIdList=reportTableDao.getRcIdList(idList);
+        List<Integer> rcIdList = reportTableDao.getRcIdList(idList);
         //删除相应子报表的统计图
         reportTableDao.delRcByRtIdList(idList);
         //通过统计图id删除相应的数据项信息

+ 5 - 4
cqcy-ei/cqcy-ei-da/src/main/resources/mapper/PrintDao.xml

@@ -9,7 +9,7 @@
 
     <sql id="printConfig">
         id
-        ,job_name,orientation,copies,page_type, width,height,margin_left,margin_top,margin_right,margin_bottom,
+        ,print_name,job_name,orientation,copies,page_type, width,height,margin_left,margin_top,margin_right,margin_bottom,
         unit,sides,chromaticity,fit_to_pages,scale,page_range,page_range_start,page_range_end,print_area,print_area_value,create_time
     </sql>
 
@@ -20,11 +20,11 @@
     </insert>
 
     <insert id="addPrintConfig">
-        insert into t_print_config (job_name, orientation, copies, page_type, width, height, margin_left, margin_top,
+        insert into t_print_config (print_name,job_name, orientation, copies, page_type, width, height, margin_left, margin_top,
                                     margin_right, margin_bottom,
                                     unit, sides, chromaticity, fit_to_pages, scale, page_range, page_range_start,
                                     page_range_end, print_area, print_area_value, create_time)
-            value (#{jobName},#{orientation},#{copies},#{pageType},#{width},#{height},#{marginLeft},#{marginTop},
+            value (#{printName},#{jobName},#{orientation},#{copies},#{pageType},#{width},#{height},#{marginLeft},#{marginTop},
             #{marginRight},#{marginBottom},#{unit},#{sides},#{chromaticity},#{fitToPages},#{scale},#{pageRange},
             #{pageRangeStart},#{pageRangeEnd},#{printArea},#{printAreaValue},now())
     </insert>
@@ -46,7 +46,8 @@
 
     <update id="updatePrintConfig">
         update t_print_config
-        set job_name=#{jobName},
+        set print_name=#{printName},
+            job_name=#{jobName},
             orientation=#{orientation},
             page_type=#{pageType},
             width=#{width},

+ 1 - 1
cqcy-ei/cqcy-ei-da/src/main/resources/static/app/index.html

@@ -2,4 +2,4 @@
 				.supports('top: constant(a)'))
 			document.write(
 				'<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0' +
-				(coverSupport ? ', viewport-fit=cover' : '') + '" />')</script><link rel=stylesheet href=./static/index.63b34199.css></head><body><noscript><strong>Please enable JavaScript to continue.</strong></noscript><div id=app></div><script src=./static/js/chunk-vendors.35954aaa.js></script><script src=./static/js/index.49edf258.js></script></body></html>
+				(coverSupport ? ', viewport-fit=cover' : '') + '" />')</script><link rel=stylesheet href=./static/index.63b34199.css></head><body><noscript><strong>Please enable JavaScript to continue.</strong></noscript><div id=app></div><script src=./static/js/chunk-vendors.35954aaa.js></script><script src=./static/js/index.aba819c1.js></script></body></html>

Filskillnaden har hållts tillbaka eftersom den är för stor
+ 0 - 0
cqcy-ei/cqcy-ei-da/src/main/resources/static/app/static/js/index.aba819c1.js


Filskillnaden har hållts tillbaka eftersom den är för stor
+ 0 - 0
cqcy-ei/cqcy-ei-da/src/main/resources/static/app/static/js/pages-homePage-index.754b6b9c.js


Filskillnaden har hållts tillbaka eftersom den är för stor
+ 0 - 0
cqcy-ei/cqcy-ei-da/src/main/resources/static/app/static/js/pages-homePage-index.a262bd76.js


+ 283 - 0
cqcy-ei/cqcy-ei-da/src/main/resources/static/app/static/webview/bar-wv.html

@@ -0,0 +1,283 @@
+<!DOCTYPE html>
+<html lang="en">
+
+	<head>
+		<meta charset="UTF-8">
+		<meta http-equiv="X-UA-Compatible" content="IE=edge">
+		<meta name="viewport" content="width=device-width, initial-scale=1.0">
+		<title>Document</title>
+		<style>
+			html{
+				height:100%
+			}
+			body{
+				height:100%;
+				margin:0
+			}
+		</style>
+	</head>
+
+	<body>
+		<div id="main" style="width:100%;height:85%;margin:auto"></div>
+
+		<script src="./echarts.min.js"></script>
+		<script type="text/javascript" src="../luckysheet/dist/plugins/js/uni-webview-js0.0.3_index.js"></script>
+		<script src="../jquery.min.js"></script>
+
+		<script>
+			function GetQueryString(name) {
+				var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
+				var r = window.location.search.substr(1).match(reg); //获取url中"?"符后的字符串并正则匹配
+				var context = "";
+				if (r != null)
+					context = decodeURIComponent(r[2]);
+				reg = null;
+				r = null;
+				return context == null || context == "" || context == "undefined" ? "" : context;
+			}
+
+			function nowDate() {
+				var date = new Date();
+				var sign2 = ":";
+				var year = date.getFullYear() // 年
+				var month = date.getMonth() + 1; // 月
+				var day = date.getDate(); // 日
+				var hour = date.getHours(); // 时
+				var minutes = date.getMinutes(); // 分
+				var seconds = date.getSeconds() //秒
+				var weekArr = ['星期一', '星期二', '星期三', '星期四', '星期五', '星期六', '星期天'];
+				var week = weekArr[date.getDay()];
+				// 给一位数的数据前面加 “0”
+				if (month >= 1 && month <= 9) {
+					month = "0" + month;
+				}
+				if (day >= 0 && day <= 9) {
+					day = "0" + day;
+				}
+				if (hour >= 0 && hour <= 9) {
+					hour = "0" + hour;
+				}
+				if (minutes >= 0 && minutes <= 9) {
+					minutes = "0" + minutes;
+				}
+				if (seconds >= 0 && seconds <= 9) {
+					seconds = "0" + seconds;
+				}
+				return year + "-" + month + "-" + day + " " + hour + sign2 + minutes + sign2 + seconds;
+			}
+		</script>
+
+		<script>
+			var option = {
+				title: {
+					text:'',
+					textStyle:{
+						color:'#666666',
+						 fontWeight:'normal',
+						 fontSize:'14'
+					}
+				},
+				xAxis: {
+					type: 'category',
+					data: [],
+					axisLabel: {
+						formatter: function(value) {
+							return value.substring(11, 19) + "\n" + value.substring(0, 10).split('-').join('')
+						}
+					}
+				},
+				yAxis: {
+					type: 'value'
+				},
+				legend: {
+					type: 'scroll',
+					top: 30
+				},
+				tooltip: {
+					trigger: 'axis',
+					axisPointer: {
+						type: 'cross',
+						lineStyle: {
+							type: 'dashed'
+						},
+						label: {
+							show: false
+						}
+					},
+					backgroundColor: 'rgba(255,255,255,0.1)', //通过设置rgba调节背景颜色与透明度
+					position: 'inside',
+					formatter: function(params) {
+						let result = ''
+						for (let i in params) {
+							let value = '--'
+							if (params[i].data !== null) {
+								value = params[i].data
+							}
+							result += '<br>' + params[i].seriesName + ':' +
+								value
+						}
+						return result
+					}
+				},
+				dataZoom: [{
+						type: 'inside',
+						start: 90,
+						end: 100
+					},
+					{
+						type: 'slider',
+						show: true,
+						start: 90,
+						end: 100,
+						bottom: 10
+					}
+				],
+				series: []
+			};
+		</script>
+
+		<script>
+			document.addEventListener('UniAppJSBridgeReady', function() {
+				uni.getEnv(function(res) {
+					const id = GetQueryString('id')
+					const startTime = GetQueryString('startTime')
+					const endTime = nowDate()
+					const token = window.localStorage.getItem('C_TOKEN')
+					var echartsData
+					let chartParams = {
+						id: id
+					}
+					$.ajax({
+						url: "",
+						type: 'GET',
+						beforeSend: function(xhr) {
+							// this.url =
+							// 	`http://192.168.0.41:8081/chart/getChartById?id=${id}&startTime=${startTime}&endTime=${endTime}`
+							this.url = window.location.origin +
+								`/chart/getChartById?id=${id}&startTime=${startTime}&endTime=${endTime}` 
+							xhr.setRequestHeader("Authorization", "Bearer " +
+								token);
+							xhr.setRequestHeader("token", token);
+						},
+						success: function(res) {
+							if (res.code === 200) {
+								option.title.text = res.data.chartName
+
+								echartsData = res.data.chartItemList
+
+								getServerData(echartsData)
+
+								getEmit(res)
+							}
+						}
+					})
+
+					function initEcharts() {
+						var chart = echarts.init(document.getElementById('main'));
+						chart.setOption(option)
+					}
+
+					function getServerData(echartsData) {
+						const chartData = echartsData
+						const timeData = chartData[0].valueTimeList
+
+						const series = chartData.map(item => {
+							return {
+								name: item.describe ? item.describe : item.itemName,
+								data: item.valueList,
+								type: 'bar'
+							}
+						})
+						var chart = echarts.init(document.getElementById('main'));
+						var lastOption = chart.getOption();
+						if (lastOption != undefined) {
+							option.dataZoom[0].start = lastOption.dataZoom[0].start
+							option.dataZoom[0].end = lastOption.dataZoom[0].end
+							option.dataZoom[1].start = lastOption.dataZoom[1].start
+							option.dataZoom[1].end = lastOption.dataZoom[1].end
+						}
+
+						option.xAxis.data = timeData
+						option.series = series
+						initEcharts()
+					}
+
+					function getEmit(res) {
+						const {
+							bucketType,
+							bucketValue
+						} = res.data
+						var time = null
+						switch (bucketType) {
+							case 0:
+								time = 86400000 * bucketValue
+
+								break;
+							case 1:
+								time = 3600000 * bucketValue
+
+								break;
+							case 2:
+								time = 60000 * bucketValue
+
+								break;
+							case 3:
+								time = 1000 * bucketValue
+
+								break;
+						}
+						var lineTime = setInterval(() => {
+							const currentTime = nowDate();
+							var lastTime = localStorage.getItem(id + 'sTime');
+							localStorage.setItem(id + 'sTime', currentTime)
+							$.ajax({
+								url: "",
+								type: 'GET',
+								beforeSend: function(xhr) {
+									// this.url =
+									// 	`http://192.168.0.41:8081/chart/getChartById?id=${id}&startTime=${lastTime}&endTime=${currentTime}`
+									this.url=window.location.origin+"/chart/getChartById?id="+id+"&startTime="+lastTime+"&endTime="+currentTime
+									xhr.setRequestHeader("Authorization", "Bearer " +
+										token);
+									xhr.setRequestHeader("token", token);
+								},
+								success: function(res) {
+									if (res.code === 200) {
+										let chartItemList = res.data.chartItemList;
+										chartItemList.forEach((item, index) => {
+											if (item.itemId === echartsData[
+													index].itemId) {
+												if (item.valueList.length !== 0) {
+													//执行将新数据添加进去,旧数据去除一个
+													echartsData[index].valueList =
+														echartsData[index].valueList
+														.concat(item.valueList)
+													echartsData[
+															index]
+														.valueList.splice(0, item
+															.valueList.length)
+													echartsData[index]
+														.valueTimeList = echartsData[
+															index]
+														.valueTimeList.concat(item
+															.valueTimeList)
+													echartsData[
+															index]
+														.valueTimeList.splice(0,
+															item
+															.valueTimeList.length)
+												}
+											}
+										})
+										getServerData(echartsData)
+									}
+								}
+							})
+						}, time)
+					}
+				})
+			})
+		</script>
+	</body>
+
+</html>

+ 3 - 4
cqcy-ei/cqcy-ei-da/src/main/resources/static/app/static/webview/dataItem-wv.html

@@ -102,8 +102,8 @@
 						url: '',
 						type: 'GET',
 						beforeSend: function(xhr) {
-							this.url =
-								// `http://192.168.0.41:8081/itemGroup/itemDataQuery?id=${id}&startTime=${startTime}&endTime=${endTime}&valueType=${valueType}`
+							// this.url =
+							// 	`http://192.168.0.41:8081/itemGroup/itemDataQuery?id=${id}&startTime=${startTime}&endTime=${endTime}&valueType=${valueType}`
 							this.url = window.location.origin +
 								`/itemGroup/itemDataQuery?id=${id}&startTime=${startTime}&endTime=${endTime}&valueType=${valueType}` 
 							xhr.setRequestHeader("Authorization", "Bearer " +
@@ -111,7 +111,6 @@
 							xhr.setRequestHeader("token", token);
 						},
 						success: (res) => {
-							console.log(res)
 							if (res.code === 200) {
 								const {
 									valueList,
@@ -135,7 +134,7 @@
 									option.dataZoom[1].start = lastOption.dataZoom[1].start
 									option.dataZoom[1].end = lastOption.dataZoom[1].end
 								}
-console.log(option)
+
 								chart.setOption(option)
 							}
 						}

+ 36 - 16
cqcy-ei/cqcy-ei-da/src/main/resources/static/app/static/webview/line-wv.html

@@ -6,10 +6,20 @@
 		<meta http-equiv="X-UA-Compatible" content="IE=edge">
 		<meta name="viewport" content="width=device-width, initial-scale=1.0">
 		<title>Document</title>
+		<style>
+			html {
+				height: 100%
+			}
+
+			body {
+				height: 100%;
+				margin: 0
+			}
+		</style>
 	</head>
 
 	<body>
-		<div id="main" style="width:100%;height:300px;margin:auto"></div>
+		<div id="main" style="width:100%;height:85%;margin:auto"></div>
 
 		<script src="./echarts.min.js"></script>
 		<script type="text/javascript" src="../luckysheet/dist/plugins/js/uni-webview-js0.0.3_index.js"></script>
@@ -60,6 +70,14 @@
 
 		<script>
 			var option = {
+				title: {
+					text: '',
+					textStyle: {
+						color: '#666666',
+						fontWeight: 'normal',
+						fontSize: '14'
+					}
+				},
 				xAxis: {
 					type: 'category',
 					data: [],
@@ -74,7 +92,7 @@
 				},
 				legend: {
 					type: 'scroll',
-					top: 10
+					top: 30
 				},
 				tooltip: {
 					trigger: 'axis',
@@ -87,7 +105,7 @@
 							show: false
 						}
 					},
-					backgroundColor:'rgba(255,255,255,0.1)',//通过设置rgba调节背景颜色与透明度
+					backgroundColor: 'rgba(255,255,255,0.1)', //通过设置rgba调节背景颜色与透明度
 					position: 'inside',
 					formatter: function(params) {
 						let result = ''
@@ -137,13 +155,15 @@
 							// this.url =
 							// 	`http://192.168.0.41:8081/chart/getChartById?id=${id}&startTime=${startTime}&endTime=${endTime}`
 							this.url = window.location.origin +
-								`/chart/getChartById?id=${id}&startTime=${startTime}&endTime=${endTime}` 
+								`/chart/getChartById?id=${id}&startTime=${startTime}&endTime=${endTime}`
 							xhr.setRequestHeader("Authorization", "Bearer " +
 								token);
 							xhr.setRequestHeader("token", token);
 						},
 						success: function(res) {
 							if (res.code === 200) {
+								option.title.text = res.data.chartName
+
 								echartsData = res.data.chartItemList
 
 								getServerData(echartsData)
@@ -170,14 +190,14 @@
 							}
 						})
 						var chart = echarts.init(document.getElementById('main'));
-						var lastOption=chart.getOption();
-						if(lastOption!=undefined){
-							option.dataZoom[0].start=lastOption.dataZoom[0].start
-							option.dataZoom[0].end=lastOption.dataZoom[0].end
-							option.dataZoom[1].start=lastOption.dataZoom[1].start
-							option.dataZoom[1].end=lastOption.dataZoom[1].end
+						var lastOption = chart.getOption();
+						if (lastOption != undefined) {
+							option.dataZoom[0].start = lastOption.dataZoom[0].start
+							option.dataZoom[0].end = lastOption.dataZoom[0].end
+							option.dataZoom[1].start = lastOption.dataZoom[1].start
+							option.dataZoom[1].end = lastOption.dataZoom[1].end
 						}
-						
+
 						option.xAxis.data = timeData
 						option.series = series
 						initEcharts()
@@ -209,17 +229,17 @@
 						}
 						var lineTime = setInterval(() => {
 							const currentTime = nowDate();
-							var lastTime = localStorage.getItem(id+'sTime');
-							localStorage.setItem(id+'sTime', currentTime)
+							var lastTime = localStorage.getItem(id + 'sTime');
+							localStorage.setItem(id + 'sTime', currentTime)
 							$.ajax({
 								url: "",
 								type: 'GET',
 								beforeSend: function(xhr) {
 									// this.url =
 									// 	`http://192.168.0.41:8081/chart/getChartById?id=${id}&startTime=${lastTime}&endTime=${currentTime}`
-									this.url=window.location.origin+"/chart/getChartById?id="+id+"&startTime="+lastTime+"&endTime="+currentTime
-									// this.url = window.location.origin +
-									// 	`/chart/getChartById?id=${id}&startTime=${startTime}&endTime=${endTime}` 
+									this.url = window.location.origin +
+										"/chart/getChartById?id=" + id + "&startTime=" +
+										lastTime + "&endTime=" + currentTime
 									xhr.setRequestHeader("Authorization", "Bearer " +
 										token);
 									xhr.setRequestHeader("token", token);

+ 247 - 0
cqcy-ei/cqcy-ei-da/src/main/resources/static/app/static/webview/pie-wv.html

@@ -0,0 +1,247 @@
+<!DOCTYPE html>
+<html lang="en">
+
+	<head>
+		<meta charset="UTF-8">
+		<meta http-equiv="X-UA-Compatible" content="IE=edge">
+		<meta name="viewport" content="width=device-width, initial-scale=1.0">
+		<title>Document</title>
+		<style>
+			html {
+				height: 100%
+			}
+
+			body {
+				height: 100%;
+				margin: 0
+			}
+		</style>
+	</head>
+
+	<body>
+		<div id="main" style="width:100%;height:85%;margin:auto"></div>
+
+		<script src="./echarts.min.js"></script>
+		<script type="text/javascript" src="../luckysheet/dist/plugins/js/uni-webview-js0.0.3_index.js"></script>
+		<script src="../jquery.min.js"></script>
+
+		<script>
+			function GetQueryString(name) {
+				var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
+				var r = window.location.search.substr(1).match(reg); //获取url中"?"符后的字符串并正则匹配
+				var context = "";
+				if (r != null)
+					context = decodeURIComponent(r[2]);
+				reg = null;
+				r = null;
+				return context == null || context == "" || context == "undefined" ? "" : context;
+			}
+
+			function nowDate() {
+				var date = new Date();
+				var sign2 = ":";
+				var year = date.getFullYear() // 年
+				var month = date.getMonth() + 1; // 月
+				var day = date.getDate(); // 日
+				var hour = date.getHours(); // 时
+				var minutes = date.getMinutes(); // 分
+				var seconds = date.getSeconds() //秒
+				var weekArr = ['星期一', '星期二', '星期三', '星期四', '星期五', '星期六', '星期天'];
+				var week = weekArr[date.getDay()];
+				// 给一位数的数据前面加 “0”
+				if (month >= 1 && month <= 9) {
+					month = "0" + month;
+				}
+				if (day >= 0 && day <= 9) {
+					day = "0" + day;
+				}
+				if (hour >= 0 && hour <= 9) {
+					hour = "0" + hour;
+				}
+				if (minutes >= 0 && minutes <= 9) {
+					minutes = "0" + minutes;
+				}
+				if (seconds >= 0 && seconds <= 9) {
+					seconds = "0" + seconds;
+				}
+				return year + "-" + month + "-" + day + " " + hour + sign2 + minutes + sign2 + seconds;
+			}
+		</script>
+
+		<script>
+			var option = {
+				title: {
+					text: '',
+					textStyle: {
+						color: '#666666',
+						fontWeight: 'normal',
+						fontSize: '14'
+					}
+				},
+				legend: {
+					type: 'scroll',
+					orient: 'vertical',
+					left: 'left',
+					top: 20
+				},
+				tooltip: {
+					trigger: 'item'
+				},
+				series: []
+			};
+		</script>
+
+		<script>
+			document.addEventListener('UniAppJSBridgeReady', function() {
+				uni.getEnv(function(res) {
+					const id = GetQueryString('id')
+					const startTime = GetQueryString('startTime')
+					const endTime = nowDate()
+					const token = window.localStorage.getItem('C_TOKEN')
+					var echartsData
+					let chartParams = {
+						id: id
+					}
+					$.ajax({
+						url: "",
+						type: 'GET',
+						beforeSend: function(xhr) {
+							// this.url =
+							// 	`http://192.168.0.41:8081/chart/getChartById?id=${id}&startTime=${startTime}&endTime=${endTime}`
+							this.url = window.location.origin +
+								`/chart/getChartById?id=${id}&startTime=${startTime}&endTime=${endTime}`
+							xhr.setRequestHeader("Authorization", "Bearer " +
+								token);
+							xhr.setRequestHeader("token", token);
+						},
+						success: function(res) {
+							if (res.code === 200) {
+								option.title.text = res.data.chartName
+
+								echartsData = res.data.chartItemList
+
+								getServerData(echartsData)
+
+								getEmit(res)
+							}
+						}
+					})
+
+					function initEcharts() {
+						var chart = echarts.init(document.getElementById('main'));
+						chart.setOption(option)
+					}
+
+					function getServerData(echartsData) {
+						const chartData = echartsData[0]
+						chartData.valueTimeList = chartData.valueTimeList.map(item => {
+							return item.substring(0, 19)
+						})
+
+						const {
+							valueList,
+							valueTimeList
+						} = chartData
+						let data = valueTimeList.map((item, i) => {
+							return {
+								name: item,
+								value: valueList[i]
+							}
+						})
+
+						option.series = [{
+							'type': 'pie',
+							radius: '55%',
+							label: {
+								show: false
+							},
+							data: data,
+							center: ['70%', '50%']
+						}]
+
+						var chart = echarts.init(document.getElementById('main'));
+
+						initEcharts()
+					}
+
+					function getEmit(res) {
+						const {
+							bucketType,
+							bucketValue
+						} = res.data
+						var time = null
+						switch (bucketType) {
+							case 0:
+								time = 86400000 * bucketValue
+
+								break;
+							case 1:
+								time = 3600000 * bucketValue
+
+								break;
+							case 2:
+								time = 60000 * bucketValue
+
+								break;
+							case 3:
+								time = 1000 * bucketValue
+
+								break;
+						}
+						var lineTime = setInterval(() => {
+							const currentTime = nowDate();
+							var lastTime = localStorage.getItem(id + 'sTime');
+							localStorage.setItem(id + 'sTime', currentTime)
+							$.ajax({
+								url: "",
+								type: 'GET',
+								beforeSend: function(xhr) {
+									// this.url =
+									// 	`http://192.168.0.41:8081/chart/getChartById?id=${id}&startTime=${lastTime}&endTime=${currentTime}`
+									this.url = window.location.origin +
+										"/chart/getChartById?id=" + id + "&startTime=" +
+										lastTime + "&endTime=" + currentTime
+									xhr.setRequestHeader("Authorization", "Bearer " +
+										token);
+									xhr.setRequestHeader("token", token);
+								},
+								success: function(res) {
+									if (res.code === 200) {
+										let chartItemList = res.data.chartItemList;
+										chartItemList.forEach((item, index) => {
+											if (item.itemId === echartsData[
+													index].itemId) {
+												if (item.valueList.length !== 0) {
+													//执行将新数据添加进去,旧数据去除一个
+													echartsData[index].valueList =
+														echartsData[index].valueList
+														.concat(item.valueList)
+													echartsData[
+															index]
+														.valueList.splice(0, item
+															.valueList.length)
+													echartsData[index]
+														.valueTimeList = echartsData[
+															index]
+														.valueTimeList.concat(item
+															.valueTimeList)
+													echartsData[
+															index]
+														.valueTimeList.splice(0,
+															item
+															.valueTimeList.length)
+												}
+											}
+										})
+										getServerData(echartsData)
+									}
+								}
+							})
+						}, time)
+					}
+				})
+			})
+		</script>
+	</body>
+
+</html>

+ 2 - 2
cqcy-ei/cqcy-ei-da/src/main/resources/static/app/static/webview/report-wv.html

@@ -159,7 +159,7 @@
 						const baseUrl = window.location.origin
 						axios.defaults.baseURL = baseUrl
 						var reportTableName
-						axios.get('http://192.168.0.40:8081/reportTable/getReportTableById?id=' + id)
+						axios.get('/reportTable/getReportTableById?id=' + id)
 							.then(res => {
 								console.log(res, 'res');
 								const data = res.data
@@ -777,7 +777,7 @@
 											'count'
 										]
 									},
-									url: `${baseUrl}/reportTable/getAutoChReportTable`,
+									url: baseUrl+'/reportTable/getAutoChReportTable',
 									headers: {
 										token: token
 									},

+ 0 - 791
cqcy-ei/cqcy-ei-da/src/main/resources/static/app/static/webview/report-wv1.html

@@ -1,791 +0,0 @@
-<!DOCTYPE html>
-<html lang="zh">
-	<head>
-		<meta charset="UTF-8">
-		<meta http-equiv="X-UA-Compatible" content="IE=edge">
-		<meta name="viewport" content="width=device-width, initial-scale=1.0">
-		<title>Document</title>
-		<link rel='stylesheet' href='../luckysheet/dist/plugins/plugins.css' />
-		<link rel='stylesheet' href='../luckysheet/dist/plugins/css/pluginsCss.css' />
-		<link rel='stylesheet' href='../luckysheet/dist/css/luckysheet.css' />
-		<link rel='stylesheet' href='../luckysheet/dist/assets/iconfont/iconfont.css' />
-		<link rel="stylesheet" href="../dist/css/layui.css">
-		<style>
-			.la-btn {
-				position: absolute;
-				left: 50%;
-				bottom: 35px;
-				transform: translate(-50%);
-				padding: 0 2%;
-			}
-
-			.btn {
-				width: 100%;
-			}
-
-			.layui-laypage-em {
-				background-color: #1e9fff !important;
-			}
-
-			.model {
-				width: 100%;
-				height: 100%;
-				background: rgba(0, 0, 0, 0.3);
-				position: fixed;
-				z-index: 9999;
-			}
-
-			.table-box {
-				width: 300px;
-				height: 300px;
-				background: #ffffff;
-				margin: auto;
-				position: absolute;
-				top: 0;
-				left: 0;
-				right: 0;
-				bottom: 0;
-				padding: 10px;
-				overflow-y: auto;
-			}
-
-			.head {
-				display: flex;
-				justify-content: flex-end;
-				font-size: 20px;
-				font-weight: bold;
-				color: #000000;
-			}
-
-			.cel {
-				cursor: pointer;
-			}
-
-			#table {
-				width: 100%;
-				margin-top: 20px;
-				font-size: 18px;
-			}
-
-			#table tr {
-				width: 100%;
-				height: 30px;
-			}
-
-			#table td {
-				border-bottom: 1px solid #000000;
-				border-top: 1px solid #000000;
-				padding: 5px;
-			}
-
-			.layui-layer-title {
-				text-align: center;
-				font-size: 16px;
-				padding: 0 81px;
-			}
-
-			.layui-layer {
-				top: 70 !important;
-			}
-		</style>
-	</head>
-	<body>
-		<div id="luckysheet" style="margin:0px;padding:0px;position:absolute;width:100%;height:90%;left: 0px;top: 0px;">
-		</div>
-
-		<table id="demo" lay-filter="test"></table>
-		<!-- <div class="model" style="display: none;">
-			<div class="table-box">
-				<div class="head"> -->
-		<!-- <div>运行记录</div> -->
-		<!-- 		<div class="cel">×</div>
-				</div>
-				<table id="table">
-					<tr>
-						<th>
-							运行内容
-						</th>
-					</tr>
-				</table>
-			</div>
-		</div> -->
-
-		<div class="la-btn">
-			<button id="recordBtn" type="button" class="layui-btn layui-btn-normal layui-btn-sm btn">运行记录</button>
-		</div>
-
-		<script src="../jquery.min.js"></script>
-		<script src="../dist/layui.js"></script>
-
-		<script src="../luckysheet/dist/luckysheet.umd.js"></script>
-		<script src="../luckysheet/dist/plugins/js/plugin.js"></script>
-
-
-
-		<script src="./echarts.js"></script>
-		<script src="./cqcyCode.js"></script>
-		<script src="./canvertChart.js"></script>
-
-		<!-- uni 的 SDK -->
-		<script src="./wvIP.js"></script>
-
-		<script src="./plugins/axios.min.js"></script>
-
-		<script type="text/javascript" src="../luckysheet/dist/plugins/js/uni-webview-js0.0.3_index.js"></script>
-
-		<script src="./plugins/excelopput.js"></script>
-		<script src="./plugins/exceljs.min.js"></script>
-
-		<script>
-			$(function() {
-				document.addEventListener('UniAppJSBridgeReady', function() {
-					uni.getEnv(function(res) {
-						console.log('当前环境:' + JSON.stringify(res));
-						window.sessionName = 'device_report_index'
-						sessionStorage.removeItem(window.sessionName)
-						const id = window.location.search.split('?id=')[1]
-
-						const baseUrl = "http://192.168.0.40:8081"
-						// const baseUrl = window.location.origin
-						axios.defaults.baseURL = baseUrl
-						var reportTableName
-						axios.get('/reportTable/getReportTableById?id=' + id).then(res => {
-							console.log(res, 'res');
-							const data = res.data
-							if (data.code === 200) {
-								// 报表数据
-								let tableData = JSON.parse(data.data.reportTableData)
-								
-								let option = tableData.option
-								// 基础数据项值
-								let baseItem = tableData.baseItem
-								// 数据项
-								let reportTableItemList = data.data.reportTableItemList
-								let reportChartList = data.data.reportChartList
-								// 报表类型
-								let reportTableType = data.data.reportTableType
-								//报表名
-								reportTableName = data.data.reportTableName
-
-								let luckysheetOption = {
-									container: 'luckysheet', // 设定 DOM 容器的 id
-									title: '报表模板', // 设定表格名称
-									lang: 'zh', // 设定表格语言
-									showinfobar: false, // 是否显示顶部信息栏
-									showtoolbar: false, // 是否显示工具栏
-									showtoolbarConfig: {
-										paintFormat: true, //格式刷
-										moreFormats: true, // 单元格格式
-										font: true, // 字体
-										fontSize: true, // 字号大小
-										bold: true, // 粗体 (Ctrl+B)
-										italic: true, // 斜体 (Ctrl+I)
-										strikethrough: true, // 删除线 (Alt+Shift+5)
-										underline: true, // 下划线 (Alt+Shift+6)
-										textColor: true, // 文本颜色
-										fillColor: true, // 单元格颜色
-										border: true, // 边框
-										mergeCell: true, // 合并单元格
-										horizontalAlignMode: true, // 水平对齐方式
-										verticalAlignMode: true, // 垂直对齐方式
-										function: true, // 公式
-										// image: true
-										// chart: true
-									},
-									showsheetbar: false, // 是否显示底部 sheet 页按钮
-									sheetFormulaBar: false, // 是否显示公式
-									row: 120, // 是否显示底部 sheet 页按钮
-									data: [{
-										"name": "统计报表", //工作表名称
-									}],
-									cellRightClickConfig: { // 自定义配置单元格右击菜单
-										copy: true, // 复制
-										copyAs: false, // 复制为
-										paste: true, // 粘贴
-										insertRow: true, // 插入行
-										insertColumn: true, // 插入列
-										deleteRow: true, // 删除选中行
-										deleteColumn: true, // 删除选中列
-										deleteCell: false, // 删除单元格
-										hideRow: false, // 隐藏选中行和显示选中行
-										hideColumn: false, // 隐藏选中列和显示选中列
-										rowHeight: true, // 行高
-										columnWidth: true, // 列宽
-										clear: false, // 清除内容
-										matrix: false, // 矩阵操作选区
-										sort: false, // 排序选区
-										filter: false, // 筛选选区
-										chart: true, // 图表生成
-										image: false, // 插入图片
-										link: false, // 插入链接
-										data: false, // 数据验证
-										cellFormat: false // 设置单元格格式
-									},
-									plugins: ['chart']
-								}
-
-								if (!option) {
-									option = JSON.parse(JSON.stringify(luckysheetOption))
-								}
-								option.data = tableData.data
-								// 设置工作表保护
-								option.data[0].config.authority = {
-									sheet: 1, // 如果为 1 或 true,则该工作表受到保护;如果为 0 或 false,则该工作表不受保护。
-									hintText: '该工作表受到保护,无法操作', // 弹窗提示的文字
-								}
-
-								// 关闭右键菜单
-								option.cellRightClickConfig.chart = false
-								option.cellRightClickConfig.columnWidth = false
-								option.cellRightClickConfig.rowHeight = false
-								option.cellRightClickConfig.deleteColumn = false
-								option.cellRightClickConfig.deleteRow = false
-								option.cellRightClickConfig.insertColumn = false
-								option.cellRightClickConfig.insertRow = false
-								// 关闭工具栏
-								option.showtoolbar = false
-								option.enableAddRow = false
-								option.showtoolbarConfig = {
-									bold: false,
-									border: false,
-									fillColor: false,
-									font: false,
-									fontSize: false,
-									function: false,
-									horizontalAlignMode: false,
-									italic: false,
-									mergeCell: false,
-									moreFormats: false,
-									paintFormat: false,
-									strikethrough: false,
-									textColor: false,
-									underline: false,
-									verticalAlignMode: false
-								}
-								// 钩子函数
-								option.hook = {
-									workbookCreateAfter() {
-										// 图表操作
-										for (let i in reportChartList) {
-											insertEChartInfo(reportChartList[i])
-										}
-										// 绘制基础数据项
-										drawBaseInfo(baseItem)
-										// 绘制数据值
-										drawTableData(reportTableItemList,
-											reportTableType, data.data)
-										luckysheet.setRangeShow('BH1')
-										convertChart(tableData)
-										printExcel()
-									}
-								}
-								luckysheet.create(option)
-							} else {
-
-							}
-						})
-
-						function printExcel() {
-							let currentSelected = luckysheet.getRange()
-							luckysheet.hideGridLines()
-							// 如果当前选中区只是一个单元格,则认为选取无效。
-							if (currentSelected[0] != null &&
-								(currentSelected[0].row[1] - currentSelected[0].row[0] >= 1 ||
-									currentSelected[0].column[1] - currentSelected[0].column[0] >= 1)) {
-								// 生成base64图片
-								//let imgSrc = luckysheet.getScreenshot();
-								setTimeout(() => {
-									luckysheet.getScreenshotNew((imgSrc) => {
-										console.info('printImg', imgSrc)
-										// top.document.write(`<img src='${imgSrc}'/>`)
-										luckysheet.showGridLines();
-									})
-								}, 200)
-							} else {
-								// 获取打印区域的行列
-								let RowColumn = getPrintSheetArea();
-								// 因需要打印左边的边框,需重新设置第一列
-								//RowColumn.column[0] = 0;
-								// 进行选区操作 
-								luckysheet.setRangeShow(RowColumn);
-								const cellData = handelCell(luckysheet.getAllSheets()[0].celldata)
-								let {
-									minR,
-									maxR,
-									minC,
-									maxC
-								} = cellData
-								luckysheet.setRangeShow({
-									row: [0, maxR],
-									column: [0, maxC]
-								});
-								// let imgSrc = luckysheet.getScreenshot(); // 生成base64图片
-								// console.log(imgSrc);
-								setTimeout(() => {
-									luckysheet.getScreenshotNew((imgSrc) => {
-										console.info('printImg', imgSrc)
-										let arr = [imgSrc]
-										exportSheetExcel(luckysheet.getAllSheets()[0],
-											arr, reportTableName)
-										// top.document.write(`<img src='${imgSrc}'/>`)
-										luckysheet.showGridLines();
-									})
-								}, 800)
-							}
-						}
-
-
-						function handelCell(data) {
-							let minR = data[0].r
-							let maxR = data[data.length - 1].r
-							let minC = data[0].c
-							let cData = data.map(item => {
-								return item.c
-							})
-							let maxC = cData.sort(function(a, b) {
-								return b - a;
-							})[0];
-							return {
-								minR,
-								maxR,
-								minC,
-								maxC
-							}
-						}
-
-
-						function getPrintSheetArea() {
-							const sheetData = luckysheet.getSheetData();
-							let objRowColumn = {
-								row: [0, 0], //行
-								column: [0, 0], //列
-							};
-							// * item是行、index是行索引、it是一行里的一格、itemIndex是这一格在这一行里的列索引
-							sheetData.forEach((item, index) => {
-								//行数
-								item.forEach((it, itemIndex) => {
-									if (it !== null && it.v) {
-										// console.log(index, it)
-										if (objRowColumn.row[1] < index) {
-											objRowColumn.row[1] = index; //row第二位
-										}
-										if (objRowColumn.column[1] < itemIndex) {
-											objRowColumn.column[1] =
-												itemIndex; //column第二位
-										}
-									}
-								});
-							});
-							return objRowColumn;
-						}
-
-						/** 绘制表格数据 */
-						function drawTableData(tableItemList, type, tableInfo) {
-							if (!tableItemList || tableItemList.length == 0) {
-								updateLocalExcelContent()
-								return
-							}
-							// 事件驱动报表
-							if (type == 2 || type == 4) {
-								tableItemList.forEach((tableItem, i) => {
-									if (i == 0) {
-										let valueTimeList = tableItem.valueTimeList ? tableItem
-											.valueTimeList.split(',') : []
-										valueTimeList = withDateFormatLength(valueTimeList)
-										let xAxis = tableItem.xaxis
-										let yAxis = tableItem.yaxis - 1
-										if (valueTimeList.length == 0) {
-											luckysheet.setCellValue(xAxis, yAxis, '')
-										} else {
-											valueTimeList.forEach((v, j) => {
-												luckysheet.setCellValue(xAxis + j, yAxis,
-													v)
-											})
-										}
-									}
-									let valueList = tableItem.valueList ? tableItem.valueList
-										.split(',') : []
-									let xAxis = tableItem.xaxis
-									let yAxis = tableItem.yaxis
-									if (valueList.length == 0) {
-										luckysheet.setCellValue(xAxis, yAxis, '')
-									} else {
-										valueList.forEach((v, j) => {
-											luckysheet.setCellValue(xAxis + j, yAxis,
-												v)
-										})
-									}
-								})
-								updateLocalExcelContent()
-								return
-							}
-							// 设备报表
-							if (type == 5 || type == 6) {
-								tableItemList.forEach((tableItem, i) => {
-									let standby = tableItem.standby ? JSON.parse(tableItem
-										.standby) : {}
-									let dataIndex = standby.index != null ? standby.index : -1
-									let valueList = tableItem.valueList ? tableItem.valueList
-										.split(',') : []
-									let xAxis = tableItem.xaxis
-									let yAxis = tableItem.yaxis
-									// 序号、时间处理
-									if (tableItem.timeItemType == 0) { // 序号、开始时间
-										let valueIndexList = tableItem.valueIndexList ? tableItem
-											.valueIndexList.split(',') : []
-										deviceReportUpdateData('${index}', valueIndexList, false)
-										let valueTimeList = tableItem.valueTimeList ? tableItem
-											.valueTimeList.split(',') : []
-										valueTimeList = withDateFormatLength(valueTimeList)
-										deviceReportUpdateData('${startTime}', valueTimeList,
-											false)
-									}
-									if (tableItem.timeItemType == 1) { // 结束时间
-										let valueTimeList = tableItem.valueTimeList ? tableItem
-											.valueTimeList.split(',') : []
-										valueTimeList = withDateFormatLength(valueTimeList)
-										deviceReportUpdateData('${stopTime}', valueTimeList,
-											tableInfo.isGenCountTime == 1)
-									}
-									if (valueList.length == 0) {
-										luckysheet.setCellValue(xAxis, yAxis, '')
-									} else {
-										valueList.forEach((v, j) => {
-											luckysheet.setCellValue(xAxis + j, yAxis, v)
-										})
-									}
-								})
-								updateLocalExcelContent()
-								return
-							}
-							// 其余报表信息
-							tableItemList.forEach((tableItem, i) => {
-								// let standby = tableItem.standby ? JSON.parse(tableItem.standby) :
-								// {}
-								// let dataIndex = standby.index != null ? standby.index : -1
-								let valueList = tableItem.valueList ? tableItem.valueList.split(
-									',') : []
-								// let val = (dataIndex == -1 || (dataIndex + 1) > valueList
-								// 		.length) ?
-								// 	cqcyCode['invalidData'] : valueList[dataIndex]
-								let xAxis = tableItem.xaxis
-								let yAxis = tableItem.yaxis
-								if (valueList.length == 0) {
-									luckysheet.setCellValue(xAxis, yAxis, '')
-								} else {
-									valueList.forEach((v, j) => {
-										luckysheet.setCellValue(xAxis + j, yAxis, v)
-									})
-								}
-							})
-							updateLocalExcelContent()
-						}
-
-						/** 设备报表时间特殊处理 */
-						function deviceReportUpdateData(field, dataList, hasCalc) {
-							let indexPos = sessionStorage.getItem(window.sessionName)
-							if (indexPos) {
-								let pos = indexPos.split(',')
-								if (field == '${index}') {
-									let yAxis = parseInt(pos[0])
-									let xAxis = parseInt(pos[1])
-									dataList.forEach((v, j) => {
-										luckysheet.setCellValue(yAxis + j, xAxis, j + 1)
-									})
-								} else if (field == '${startTime}') {
-									let yAxis = parseInt(pos[0])
-									let xAxis = parseInt(pos[1]) + 1
-									dataList.forEach((v, j) => {
-										luckysheet.setCellValue(yAxis + j, xAxis, v)
-									})
-								} else if (field == '${stopTime}') {
-									let yAxis = parseInt(pos[0])
-									let xAxis = parseInt(pos[1]) + 2
-									dataList.forEach((v, j) => {
-										luckysheet.setCellValue(yAxis + j, xAxis, v)
-										if (hasCalc) {
-											let startDate = luckysheet.getCellValue(yAxis + j,
-												xAxis - 1)
-											let minutes = calculateMinutes(startDate, v)
-											luckysheet.setCellValue(yAxis + j, xAxis + 1,
-												minutes)
-										}
-									})
-								}
-								return
-							}
-							let option = luckysheet.getAllSheets()[0]
-							option.celldata.map(item => {
-								if (item.v.v) {
-									item.v.v = String(item.v.v).trim()
-									// 替换${xxx}内部数据
-									if (item.v.v.match(/\${([^}]+)}/g)) {
-										if (item.v.v.indexOf(field) > -1) {
-											let yAxis = item.r
-											let xAxis = item.c
-											if (field == '${index}') {
-												sessionStorage.setItem(window.sessionName,
-													yAxis + ',' + xAxis)
-												dataList.forEach((v, j) => {
-													luckysheet.setCellValue(yAxis + j,
-														xAxis, j + 1)
-												})
-											} else {
-												dataList.forEach((v, j) => {
-													luckysheet.setCellValue(yAxis + j,
-														xAxis, v)
-													if (hasCalc) {
-														let startDate = luckysheet
-															.getCellValue(yAxis + j,
-																xAxis - 1)
-														let minutes = calculateMinutes(
-															startDate, v)
-														luckysheet.setCellValue(yAxis +
-															j, xAxis + 1, minutes)
-													}
-												})
-											}
-										}
-									}
-								}
-							})
-						}
-
-						/** 删除不合理数据值 */
-						function updateLocalExcelContent() {
-							let option = luckysheet.getAllSheets()[0]
-							option.celldata.map(item => {
-								if (item.v.v) {
-									item.v.v = String(item.v.v).trim()
-									// 替换${xxx}内部数据
-									if (item.v.v.match(/\${([^}]+)}/g)) {
-										luckysheet.setCellValue(item.r, item.c, '')
-									}
-								}
-							})
-						}
-
-						/** 计算分钟数 */
-						function calculateMinutes(time1, time2) {
-							// 将时间字符串转换为Date对象
-							let date1 = new Date(time1);
-							let date2 = new Date(time2);
-							// 计算时间差(以毫秒为单位)
-							let diffInMilliseconds = Math.abs(date2.getTime() - date1.getTime());
-							// 将时间差转换为分钟
-							let minutes = Math.floor(diffInMilliseconds / 1000 / 60);
-							return minutes;
-						}
-
-						/** 绘制基础数据项布局信息 */
-						function drawBaseInfo(baseData) {
-							if (!baseData) return
-							let option = luckysheet.getAllSheets()[0]
-							option.celldata.map(item => {
-								if (item.v.v) {
-									item.v.v = String(item.v.v).trim()
-									if (item.v.v.match(/\${([^}]+)}/g)) { // 替换${xxx}内部数据
-										if (item.v.v.indexOf('${currDate}') > -1) {
-											let val = item.v.v
-											val = val.replace('${currDate}', baseData.currDate)
-											luckysheet.setCellValue(item.r, item.c, val)
-										}
-										if (item.v.v.indexOf('${currDateTime}') > -1) {
-											let val = item.v.v
-											val = val.replace('${currDateTime}', baseData
-												.currDateTime)
-											luckysheet.setCellValue(item.r, item.c, val)
-										}
-										if (item.v.v.indexOf('${userName}') > -1) {
-											let val = item.v.v
-											val = val.replace('${userName}', baseData.userName)
-											luckysheet.setCellValue(item.r, item.c, val)
-										}
-										if (item.v.v.indexOf('${winUserName}') > -1) {
-											let val = item.v.v
-											val = val.replace('${winUserName}', baseData
-												.winUserName)
-											luckysheet.setCellValue(item.r, item.c, val)
-										}
-									}
-								}
-							})
-						}
-
-						function withDateFormatLength(listDate) {
-							if (!listDate || listDate.length == 0) {
-								return []
-							}
-							let arr = []
-							listDate.forEach((date) => {
-								arr.push(date.substring(0, 19))
-							})
-							return arr
-						}
-
-						/** 向 Excel 插入图表 */
-						function insertEChartInfo(chart) {
-							let _self = this
-							let info = JSON.parse(chart.standby)
-							let reportChartItemList = chart.reportChartItemList
-							let chartType = chart.chartType
-							// 系列
-							let series = info.option.series
-							for (let i in series) {
-								let temp = series[i]
-								temp.data = []
-								for (let j in reportChartItemList) {
-									let _name = reportChartItemList[j].describe ?
-										reportChartItemList[j].describe : reportChartItemList[j]
-										.itemName
-									if (chartType == 'pie') {
-										info.option.legend = null
-										info.option.tooltip = {
-											trigger: 'item',
-											formatter: '{b0}<br /> <b>{c0}</b>'
-										}
-										temp.name = _name
-										let names = reportChartItemList[i].valueTimeList ?
-											reportChartItemList[i].valueTimeList.split(',') : [];
-										names = withDateFormatLength(names);
-										let vals = reportChartItemList[i].valueList ?
-											reportChartItemList[i].valueList.split(',') : [];
-										names.forEach((name, j) => {
-											temp.data.push({
-												'name': name,
-												'value': vals[j]
-											})
-										})
-									} else {
-										let _t = []
-										let t = reportChartItemList[i].valueList ?
-											reportChartItemList[i].valueList.split(',') : []
-										t.forEach((temp) => {
-											_t.push(parseFloat(temp))
-										})
-										temp.data = _t
-									}
-								}
-							}
-							if (chartType != 'pie') {
-								// x 轴
-								let xAxis = info.option.xAxis
-								let legend = info.option.legend
-								// xAxis.data = []
-								legend.data = []
-								let axisLabel = {};
-								axisLabel.rotate = 20;
-								xAxis.axisLabel = axisLabel
-								let times = (reportChartItemList[0].valueTimeList) ? reportChartItemList[
-									0].valueTimeList.split(",") : []
-								xAxis.data = (reportChartItemList && reportChartItemList.length > 0) ?
-									withDateFormatLength(times) : []
-								// xAxis.data = xAxis.data.slice(0, 7)
-								for (let i in reportChartItemList) {
-									let name = reportChartItemList[i].describe ? reportChartItemList[i]
-										.describe : reportChartItemList[i].itemName
-									// xAxis.data.push(name)
-									legend.data.push(name)
-								}
-							}
-							setTimeout(() => {
-								const sheet = luckysheet.getLuckysheetfile()[0]
-								let optionData = sheet.data
-								try {
-									let flag = false
-									insertLuckysheetEChart({
-										selector: '#luckysheet',
-										info,
-										sheet,
-										optionData,
-										echarts,
-										luckysheet,
-										$,
-										_self,
-										flag
-									})
-								} catch (e) {
-									console.log(999, e == 'echarts is not defined')
-									console.error(e)
-								}
-							}, 200)
-						}
-
-						$('#recordBtn').on('click', () => {
-							$('.model').show()
-							const token = window.localStorage.getItem('C_TOKEN')
-
-							layui.use('table', function() {
-								var table = layui.table;
-								var layer = layui.layer;
-
-								layer.open({
-									type: 1,
-									title: '运行记录',
-									content: $('#demo'),
-									offset: ['30px', '45px'],
-									end: function() {
-										$('#demo').hide();
-										$('.layui-table-view').hide()
-									},
-									cancel: function(index, layero) {
-										$('.layui-layer-content')
-											.hide()
-									}
-								});
-								var tableReload = table.render({
-									elem: '#demo',
-									width: 300,
-									page: {
-										elem: '#demo',
-										layout: ['prev', 'page', 'next',
-											'count'
-										]
-									},
-									url: `${baseUrl}/reportTable/getAutoChReportTable`,
-									headers: {
-										token: token
-									},
-									where: {
-										autoTableId: id
-									},
-									text: {
-										none: '暂无数据' //默认:无数据。
-									},
-									cols: [
-										[{
-											field: 'reportTableName',
-											title: null,
-											width: 300
-										}]
-									],
-									parseData: function(res) {
-										return {
-											"code": 0,
-											"msg": res.msg,
-											"count": res.data.count,
-											"data": res.data
-												.reportTableList
-										};
-									}
-								});
-
-								//触发行单击事件
-								table.on('row(test)', function(obj) {
-									const id = obj.data.id
-									const title = obj.data
-										.reportTableName
-									uni.navigateTo({
-										url: `/pages/reportForm/report-detail/recordDetail?id=${id}&title=${title}`
-									})
-								});
-								$('th').hide()
-							});
-						})
-					});
-				});
-			})
-		</script>
-
-	</body>
-</html>

+ 39 - 36
reado-app/pages/homePage/index.vue

@@ -59,7 +59,6 @@
 		},
 		data() {
 			return {
-				reportTableList: [],
 				queryParams: {
 					page: 1,
 					limit: 999
@@ -158,51 +157,55 @@
 						const {
 							reportTableList
 						} = data.data
-						this.reportTableList = reportTableList.reverse()
-
 						let array = []
-						for (let i = 0; i < this.reportTableList.length; i++) {
-							array.push(this.getChartData(this.reportTableList[i].id))
+						for (let i = 0; i < reportTableList.length; i++) {
+							array.push({
+								id: reportTableList[i].id,
+								chartType: reportTableList[i].chartType
+							})
 						}
 						Promise.all(array).then((res) => {
 							res.map((item, index) => {
-								const {
-									data
-								} = item
-								if (data.chartType === 'line') {
-									data.src =
-										`/static/webview/line-wv.html?id=${data.id}&startTime=${this.startTime}`
-								} else if (data.chartType === 'bar') {
-									data.src =
-										`/static/webview/bar-wv.html?id=${data.id}&startTime=${this.startTime}`
-								} else if (data.chartType === 'pie') {
-									data.src =
-										`/static/webview/pie-wv.html?id=${data.id}&startTime=${this.startTime}`
+								if (item.chartType === 'line') {
+									item.src =
+										`/static/webview/line-wv.html?id=${item.id}&startTime=${this.startTime}`
+								} else if (item.chartType === 'bar') {
+									item.src =
+										`/static/webview/bar-wv.html?id=${item.id}&startTime=${this.startTime}`
+								} else if (item.chartType === 'pie') {
+									item.src =
+										`/static/webview/pie-wv.html?id=${item.id}&startTime=${this.startTime}`
 								}
-								data.top = (index + 1) * 160 + index * 800 + 'rpx'
-								this.echartsData.push(data)
+								item.top = (index + 1) * 160 + index * 800 + 'rpx'
+
+								uni.setStorage({
+									key: item.id + 'sTime',
+									data: nowDate()
+								})
+
+								this.echartsData.push(item)
 							})
 						})
 					}
 				})
 			},
-			getChartData(id) {
-				let chartParams = {
-					id: id,
-					startTime: this.startTime,
-					endTime: nowDate()
-				}
-				uni.setStorage({
-					key: id + 'sTime',
-					data: chartParams.endTime
-				})
-				return new Promise((resolve, reject) => {
-					uni.$http.get('/chart/getChartById', chartParams).then((res) => {
-						const data = res.data
-						resolve(data)
-					})
-				})
-			},
+			// getChartData(id) {
+			// 	let chartParams = {
+			// 		id: id,
+			// 		startTime: this.startTime,
+			// 		endTime: nowDate()
+			// 	}
+			// 	uni.setStorage({
+			// 		key: id + 'sTime',
+			// 		data: chartParams.endTime
+			// 	})
+			// 	return new Promise((resolve, reject) => {
+			// 		uni.$http.get('/chart/getChartById', chartParams).then((res) => {
+			// 			const data = res.data
+			// 			resolve(data)
+			// 		})
+			// 	})
+			// },
 			change(i) {
 				this.choiceTime === i ? this.choiceTime = -1 : this.choiceTime = i
 				this.choiceChildTime = -1

+ 2 - 2
reado-app/static/webview/bar-wv.html

@@ -185,7 +185,7 @@
 							return {
 								name: item.describe ? item.describe : item.itemName,
 								data: item.valueList,
-								type: 'line'
+								type: 'bar'
 							}
 						})
 						var chart = echarts.init(document.getElementById('main'));
@@ -236,7 +236,7 @@
 								beforeSend: function(xhr) {
 									// this.url =
 									// 	`http://192.168.0.41:8081/chart/getChartById?id=${id}&startTime=${lastTime}&endTime=${currentTime}`
-									this.url="http://"+window.location.origin+"/chart/getChartById?id="+id+"&startTime="+lastTime+"&endTime="+currentTime
+									this.url=window.location.origin+"/chart/getChartById?id="+id+"&startTime="+lastTime+"&endTime="+currentTime
 									xhr.setRequestHeader("Authorization", "Bearer " +
 										token);
 									xhr.setRequestHeader("token", token);

+ 3 - 4
reado-app/static/webview/dataItem-wv.html

@@ -102,8 +102,8 @@
 						url: '',
 						type: 'GET',
 						beforeSend: function(xhr) {
-							this.url =
-								// `http://192.168.0.41:8081/itemGroup/itemDataQuery?id=${id}&startTime=${startTime}&endTime=${endTime}&valueType=${valueType}`
+							// this.url =
+							// 	`http://192.168.0.41:8081/itemGroup/itemDataQuery?id=${id}&startTime=${startTime}&endTime=${endTime}&valueType=${valueType}`
 							this.url = window.location.origin +
 								`/itemGroup/itemDataQuery?id=${id}&startTime=${startTime}&endTime=${endTime}&valueType=${valueType}` 
 							xhr.setRequestHeader("Authorization", "Bearer " +
@@ -111,7 +111,6 @@
 							xhr.setRequestHeader("token", token);
 						},
 						success: (res) => {
-							console.log(res)
 							if (res.code === 200) {
 								const {
 									valueList,
@@ -135,7 +134,7 @@
 									option.dataZoom[1].start = lastOption.dataZoom[1].start
 									option.dataZoom[1].end = lastOption.dataZoom[1].end
 								}
-console.log(option)
+
 								chart.setOption(option)
 							}
 						}

+ 15 - 12
reado-app/static/webview/line-wv.html

@@ -7,12 +7,13 @@
 		<meta name="viewport" content="width=device-width, initial-scale=1.0">
 		<title>Document</title>
 		<style>
-			html{
-				height:100%
+			html {
+				height: 100%
 			}
-			body{
-				height:100%;
-				margin:0
+
+			body {
+				height: 100%;
+				margin: 0
 			}
 		</style>
 	</head>
@@ -70,11 +71,11 @@
 		<script>
 			var option = {
 				title: {
-					text:'',
-					textStyle:{
-						color:'#666666',
-						 fontWeight:'normal',
-						 fontSize:'14'
+					text: '',
+					textStyle: {
+						color: '#666666',
+						fontWeight: 'normal',
+						fontSize: '14'
 					}
 				},
 				xAxis: {
@@ -154,7 +155,7 @@
 							// this.url =
 							// 	`http://192.168.0.41:8081/chart/getChartById?id=${id}&startTime=${startTime}&endTime=${endTime}`
 							this.url = window.location.origin +
-								`/chart/getChartById?id=${id}&startTime=${startTime}&endTime=${endTime}` 
+								`/chart/getChartById?id=${id}&startTime=${startTime}&endTime=${endTime}`
 							xhr.setRequestHeader("Authorization", "Bearer " +
 								token);
 							xhr.setRequestHeader("token", token);
@@ -236,7 +237,9 @@
 								beforeSend: function(xhr) {
 									// this.url =
 									// 	`http://192.168.0.41:8081/chart/getChartById?id=${id}&startTime=${lastTime}&endTime=${currentTime}`
-									this.url=window.location.origin+"/chart/getChartById?id="+id+"&startTime="+lastTime+"&endTime="+currentTime
+									this.url = window.location.origin +
+										"/chart/getChartById?id=" + id + "&startTime=" +
+										lastTime + "&endTime=" + currentTime
 									xhr.setRequestHeader("Authorization", "Bearer " +
 										token);
 									xhr.setRequestHeader("token", token);

+ 1 - 1
reado-app/static/webview/pie-wv.html

@@ -198,7 +198,7 @@
 								beforeSend: function(xhr) {
 									// this.url =
 									// 	`http://192.168.0.41:8081/chart/getChartById?id=${id}&startTime=${lastTime}&endTime=${currentTime}`
-									this.url = "http://" + window.location.origin +
+									this.url = window.location.origin +
 										"/chart/getChartById?id=" + id + "&startTime=" +
 										lastTime + "&endTime=" + currentTime
 									xhr.setRequestHeader("Authorization", "Bearer " +

+ 2 - 2
reado-app/static/webview/report-wv.html

@@ -159,7 +159,7 @@
 						const baseUrl = window.location.origin
 						axios.defaults.baseURL = baseUrl
 						var reportTableName
-						axios.get('http://192.168.0.40:8081/reportTable/getReportTableById?id=' + id)
+						axios.get('/reportTable/getReportTableById?id=' + id)
 							.then(res => {
 								console.log(res, 'res');
 								const data = res.data
@@ -777,7 +777,7 @@
 											'count'
 										]
 									},
-									url: `${baseUrl}/reportTable/getAutoChReportTable`,
+									url: baseUrl+'/reportTable/getAutoChReportTable',
 									headers: {
 										token: token
 									},

Vissa filer visades inte eftersom för många filer har ändrats