wenhongquan hace 1 año
padre
commit
20e665b82f

+ 2 - 2
ruoyi-admin/src/main/resources/application-dev.yml

@@ -49,9 +49,9 @@ spring:
           driverClassName: com.mysql.cj.jdbc.Driver
           # jdbc 所有参数配置参考 https://lionli.blog.csdn.net/article/details/122018562
           # rewriteBatchedStatements=true 批处理优化 大幅提升批量插入更新删除性能(对数据库有性能损耗 使用批量操作应考虑性能问题)
-          url: jdbc:mysql://${DBHOST:200.200.19.121}:${DBPORT:31000}/iotc?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true
+          url: jdbc:mysql://${DBHOST:60.204.209.152}:${DBPORT:3306}/iotc?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true
           username: ${DBUSER:root}
-          password: ${DBPWD:root}
+          password: ${DBPWD:Liwei199411..}
         # 从库数据源
         slave:
           lazy: true

+ 1 - 1
ruoyi-admin/src/main/resources/application.yml

@@ -269,7 +269,7 @@ management:
       external-file: ./logs/sys-console.log
 
 mqtt:
-  url: ${MQTT_URL:tcp://200.200.19.121:31005}
+  url: ${MQTT_URL:tcp://xt.wenhq.top:8581}
   clientid: iotc_server
   user: ${MQTT_USER:iotc}
   password: ${MQTT_PWD:iotc}

+ 7 - 5
ruoyi-ui-vue3/src/views/device/sensordash/index.vue

@@ -673,8 +673,8 @@ watchEffect(() => {
                 isadd = true;
             }
         })
-        if (isadd) {
-            historytabledata.value.push([moment(data.time).toDate(), data.value]);
+      if (isadd) {
+           historytabledata.value.splice(0, 0, [moment(data.time).valueOf(), data.value])
         }
 
     }
@@ -698,8 +698,8 @@ watchEffect(() => {
             },
             dataZoom: [{
                     type: 'inside',
-                    start: 0,
-                    end: 20
+                    start: 80,
+                    end: 100
                 },
                 {
                     start: 0,
@@ -711,6 +711,7 @@ watchEffect(() => {
               data: historytabledata.value,
                 showSymbol: false,
               type: 'line',
+               connectNulls: false,
             //     lineStyle: {
             // curveness: 0 // 设置曲率为0,使线条不弯曲,即首尾不相连
             //   },
@@ -718,6 +719,7 @@ watchEffect(() => {
                 smooth: true
             }]
         });
+        console.error(historytabledata.value)
         window.addEventListener("resize", () => {
             usedmemoryInstance.resize()
         });
@@ -747,7 +749,7 @@ const doshowhistory = (row) => {
         const { rows, total, page, size } = res;
         isloading.value = false;
         historytabledata.value = rows.map(i => {
-            return [moment(i.createTime).toDate(), i.pointValue]
+            return [moment(i.createTime).valueOf(), i.pointValue]
         });
     })
 }

+ 4 - 4
ruoyi-ui-vue3/vite.config.js

@@ -30,14 +30,14 @@ export default defineConfig(({ mode, command }) => {
       proxy: {
         // https://cn.vitejs.dev/config/#server-proxy
         "/dev-api": {
-          // target: "http://58.252.235.18:8084/iot/prod-api",
-          target: "http://localhost:8989",
+          target: "http://58.252.235.18:8084/iot/prod-api",
+          // target: "http://localhost:8989",
           changeOrigin: true,
           rewrite: (p) => p.replace(/^\/dev-api/, ""),
         },
         "/dev-ws": {
-          // target: "ws://58.252.235.18:8084/iot/prod-api",
-          target: "ws://localhost:8989",
+          target: "ws://58.252.235.18:8084/iot/prod-api",
+          // target: "ws://localhost:8989",
           changeOrigin: true,
           ws: true,
           rewrite: (p) => p.replace(/^\/dev-ws/, ""),