askin há 2 anos atrás
pai
commit
427d3f04ce
52 ficheiros alterados com 242 adições e 829 exclusões
  1. 1 1
      sources/client/vrv-moblie/config/api.js
  2. 4 3
      sources/client/vrv-moblie/pages/login/login.vue
  3. 8 8
      sources/client/vrv-moblie/pages/operator/operator.vue
  4. 1 1
      sources/client/vrv-moblie/unpackage/dist/dev/.sourcemap/mp-weixin/common/main.js.map
  5. 1 1
      sources/client/vrv-moblie/unpackage/dist/dev/.sourcemap/mp-weixin/common/vendor.js.map
  6. 1 1
      sources/client/vrv-moblie/unpackage/dist/dev/.sourcemap/mp-weixin/components/best-gauge/best-gauge.js.map
  7. 1 1
      sources/client/vrv-moblie/unpackage/dist/dev/.sourcemap/mp-weixin/pages/alarm/alarm.js.map
  8. 1 1
      sources/client/vrv-moblie/unpackage/dist/dev/.sourcemap/mp-weixin/pages/alarmRecord/alarmRecord.js.map
  9. 1 1
      sources/client/vrv-moblie/unpackage/dist/dev/.sourcemap/mp-weixin/pages/dataCurve/dataCurve.js.map
  10. 1 1
      sources/client/vrv-moblie/unpackage/dist/dev/.sourcemap/mp-weixin/pages/device/device.js.map
  11. 1 1
      sources/client/vrv-moblie/unpackage/dist/dev/.sourcemap/mp-weixin/pages/device/deviceInfo/deviceInfo.js.map
  12. 1 1
      sources/client/vrv-moblie/unpackage/dist/dev/.sourcemap/mp-weixin/pages/login/login.js.map
  13. 1 1
      sources/client/vrv-moblie/unpackage/dist/dev/.sourcemap/mp-weixin/pages/maintenanceRecord/maintenanceRecord.js.map
  14. 1 1
      sources/client/vrv-moblie/unpackage/dist/dev/.sourcemap/mp-weixin/pages/operator/operator.js.map
  15. 1 1
      sources/client/vrv-moblie/unpackage/dist/dev/.sourcemap/mp-weixin/pages/operator/operatorInfo/operatorInfo.js.map
  16. 1 1
      sources/client/vrv-moblie/unpackage/dist/dev/.sourcemap/mp-weixin/pages/operatorLog/operatorLog.js.map
  17. 1 1
      sources/client/vrv-moblie/unpackage/dist/dev/.sourcemap/mp-weixin/pages/parameterSetting/parameterSetting.js.map
  18. 1 1
      sources/client/vrv-moblie/unpackage/dist/dev/.sourcemap/mp-weixin/pages/power/power.js.map
  19. 1 1
      sources/client/vrv-moblie/unpackage/dist/dev/.sourcemap/mp-weixin/pages/project/project.js.map
  20. 1 1
      sources/client/vrv-moblie/unpackage/dist/dev/.sourcemap/mp-weixin/pages/project/projectEdit/projectEdit.js.map
  21. 1 1
      sources/client/vrv-moblie/unpackage/dist/dev/.sourcemap/mp-weixin/pages/project/projectInfo/projectInfo.js.map
  22. 1 1
      sources/client/vrv-moblie/unpackage/dist/dev/.sourcemap/mp-weixin/pages/rolePower/rolePower.js.map
  23. 1 1
      sources/client/vrv-moblie/unpackage/dist/dev/.sourcemap/mp-weixin/pages/roleShowPower/roleShowPower.js.map
  24. 1 1
      sources/client/vrv-moblie/unpackage/dist/dev/.sourcemap/mp-weixin/pages/runningState/runningState.js.map
  25. 1 1
      sources/client/vrv-moblie/unpackage/dist/dev/.sourcemap/mp-weixin/pages/staticProject/staticProject.js.map
  26. 1 1
      sources/client/vrv-moblie/unpackage/dist/dev/.sourcemap/mp-weixin/pages/systemParameter/systemParameter.js.map
  27. 1 1
      sources/client/vrv-moblie/unpackage/dist/dev/.sourcemap/mp-weixin/pages/systemSet/systemSet.js.map
  28. 1 1
      sources/client/vrv-moblie/unpackage/dist/dev/.sourcemap/mp-weixin/pages/user/user.js.map
  29. 1 1
      sources/client/vrv-moblie/unpackage/dist/dev/.sourcemap/mp-weixin/uni_modules/uni-popup/components/uni-popup-dialog/uni-popup-dialog.js.map
  30. 1 1
      sources/client/vrv-moblie/unpackage/dist/dev/.sourcemap/mp-weixin/uni_modules/uni-popup/components/uni-popup/uni-popup.js.map
  31. 14 0
      sources/client/vrv-moblie/unpackage/dist/dev/mp-weixin/.gitignore
  32. 1 1
      sources/client/vrv-moblie/unpackage/dist/dev/mp-weixin/common/vendor.js
  33. 4 3
      sources/client/vrv-moblie/unpackage/dist/dev/mp-weixin/pages/login/login.js
  34. 6 6
      sources/client/vrv-moblie/unpackage/dist/dev/mp-weixin/pages/operator/operator.js
  35. 1 18
      sources/client/vrv-moblie/unpackage/dist/dev/mp-weixin/project.config.json
  36. 0 13
      sources/client/vrv-moblie/unpackage/dist/dev/mp-weixin/project.private.config.json
  37. 11 1
      sources/client/vrv-platform/src/config/api.js
  38. 33 32
      sources/client/vrv-platform/src/main.js
  39. 2 1
      sources/client/vrv-platform/src/views/login/login.vue
  40. 1 1
      sources/client/vrv-platform/vue.config.js
  41. 1 1
      sources/server/vrv/run/application.pid
  42. 9 22
      sources/server/vrv/vrv-platform/src/main/java/com/kuyuntech/vrv/platform/readJson/Test.java
  43. 0 22
      sources/server/vrv/vrv-core-api/src/main/java/com/kuyuntech/vrv/coreapi/bean/mqtt/MyMessage.java
  44. 105 106
      sources/server/vrv/vrv-platform/src/main/java/com/kuyuntech/vrv/platform/configuration/core/MqttConfiguration.java
  45. 14 8
      sources/server/vrv/vrv-platform/src/main/java/com/kuyuntech/vrv/platform/controller/auth/AuthController.java
  46. 0 5
      sources/server/vrv/vrv-platform/src/main/java/com/kuyuntech/vrv/platform/controller/core/DeviceParamController.java
  47. 0 25
      sources/server/vrv/vrv-platform/src/main/java/com/kuyuntech/vrv/platform/controller/mqtt/MqttController.java
  48. 0 40
      sources/server/vrv/vrv-platform/src/main/java/com/kuyuntech/vrv/platform/readJson/readDeviceParams.java
  49. 0 17
      sources/server/vrv/vrv-platform/src/main/java/com/kuyuntech/vrv/platform/util/core/CompareParamValue.java
  50. 0 47
      sources/server/vrv/vrv-platform/src/main/java/com/kuyuntech/vrv/platform/util/core/FileUtils.java
  51. 0 116
      sources/server/vrv/vrv-platform/src/main/resources/static/device-params.json
  52. 0 305
      sources/server/vrv/vrv-platform/src/main/resources/static/project.html

+ 1 - 1
sources/client/vrv-moblie/config/api.js

@@ -1,5 +1,5 @@
 //路径
-const root = "http://127.0.0.1:9999";
+const root = "http://localhost:9999";
 
 //接口auth
 const api = {

+ 4 - 3
sources/client/vrv-moblie/pages/login/login.vue

@@ -1,7 +1,5 @@
 <template>
 	<view>
-		<!-- 	<view class="head"></view>
- -->
 		<view class="img">
 			<image src="../../static/登录/bg@2x.png" class="image"></image>
 
@@ -124,7 +122,10 @@
 
 					uni.setStorage({
 							key: 'realname',
-							data: res.data.data.userBean.realname
+							data: res.data.data.userBean.realname,
+							success:function(){
+								console.log("用户信息存储成功");
+							}
 						}),
 
 						uni.switchTab({

+ 8 - 8
sources/client/vrv-moblie/pages/operator/operator.vue

@@ -26,15 +26,15 @@
 				key: 'realname',
 				success: function(res) {
 					console.log(res.data);
-					this.realname = res.data
+		
+					console.log("用户已登录,跳转到首页");
+				},
+				fail:function(){
+					uni.navigateTo({
+						url: '/pages/login/login',
+					});
 					
-					if (this.realname == '') {
-						uni.navigateTo({
-							url: '/pages/login/login',
-						});
-						
-						console.log("未找到用户,请登录");
-					}
+					console.log("未找到用户,请登录");
 				}
 			})
 

Diff do ficheiro suprimidas por serem muito extensas
+ 1 - 1
sources/client/vrv-moblie/unpackage/dist/dev/.sourcemap/mp-weixin/common/main.js.map


Diff do ficheiro suprimidas por serem muito extensas
+ 1 - 1
sources/client/vrv-moblie/unpackage/dist/dev/.sourcemap/mp-weixin/common/vendor.js.map


Diff do ficheiro suprimidas por serem muito extensas
+ 1 - 1
sources/client/vrv-moblie/unpackage/dist/dev/.sourcemap/mp-weixin/components/best-gauge/best-gauge.js.map


Diff do ficheiro suprimidas por serem muito extensas
+ 1 - 1
sources/client/vrv-moblie/unpackage/dist/dev/.sourcemap/mp-weixin/pages/alarm/alarm.js.map


Diff do ficheiro suprimidas por serem muito extensas
+ 1 - 1
sources/client/vrv-moblie/unpackage/dist/dev/.sourcemap/mp-weixin/pages/alarmRecord/alarmRecord.js.map


Diff do ficheiro suprimidas por serem muito extensas
+ 1 - 1
sources/client/vrv-moblie/unpackage/dist/dev/.sourcemap/mp-weixin/pages/dataCurve/dataCurve.js.map


Diff do ficheiro suprimidas por serem muito extensas
+ 1 - 1
sources/client/vrv-moblie/unpackage/dist/dev/.sourcemap/mp-weixin/pages/device/device.js.map


Diff do ficheiro suprimidas por serem muito extensas
+ 1 - 1
sources/client/vrv-moblie/unpackage/dist/dev/.sourcemap/mp-weixin/pages/device/deviceInfo/deviceInfo.js.map


Diff do ficheiro suprimidas por serem muito extensas
+ 1 - 1
sources/client/vrv-moblie/unpackage/dist/dev/.sourcemap/mp-weixin/pages/login/login.js.map


Diff do ficheiro suprimidas por serem muito extensas
+ 1 - 1
sources/client/vrv-moblie/unpackage/dist/dev/.sourcemap/mp-weixin/pages/maintenanceRecord/maintenanceRecord.js.map


Diff do ficheiro suprimidas por serem muito extensas
+ 1 - 1
sources/client/vrv-moblie/unpackage/dist/dev/.sourcemap/mp-weixin/pages/operator/operator.js.map


Diff do ficheiro suprimidas por serem muito extensas
+ 1 - 1
sources/client/vrv-moblie/unpackage/dist/dev/.sourcemap/mp-weixin/pages/operator/operatorInfo/operatorInfo.js.map


Diff do ficheiro suprimidas por serem muito extensas
+ 1 - 1
sources/client/vrv-moblie/unpackage/dist/dev/.sourcemap/mp-weixin/pages/operatorLog/operatorLog.js.map


Diff do ficheiro suprimidas por serem muito extensas
+ 1 - 1
sources/client/vrv-moblie/unpackage/dist/dev/.sourcemap/mp-weixin/pages/parameterSetting/parameterSetting.js.map


Diff do ficheiro suprimidas por serem muito extensas
+ 1 - 1
sources/client/vrv-moblie/unpackage/dist/dev/.sourcemap/mp-weixin/pages/power/power.js.map


Diff do ficheiro suprimidas por serem muito extensas
+ 1 - 1
sources/client/vrv-moblie/unpackage/dist/dev/.sourcemap/mp-weixin/pages/project/project.js.map


Diff do ficheiro suprimidas por serem muito extensas
+ 1 - 1
sources/client/vrv-moblie/unpackage/dist/dev/.sourcemap/mp-weixin/pages/project/projectEdit/projectEdit.js.map


Diff do ficheiro suprimidas por serem muito extensas
+ 1 - 1
sources/client/vrv-moblie/unpackage/dist/dev/.sourcemap/mp-weixin/pages/project/projectInfo/projectInfo.js.map


Diff do ficheiro suprimidas por serem muito extensas
+ 1 - 1
sources/client/vrv-moblie/unpackage/dist/dev/.sourcemap/mp-weixin/pages/rolePower/rolePower.js.map


Diff do ficheiro suprimidas por serem muito extensas
+ 1 - 1
sources/client/vrv-moblie/unpackage/dist/dev/.sourcemap/mp-weixin/pages/roleShowPower/roleShowPower.js.map


Diff do ficheiro suprimidas por serem muito extensas
+ 1 - 1
sources/client/vrv-moblie/unpackage/dist/dev/.sourcemap/mp-weixin/pages/runningState/runningState.js.map


Diff do ficheiro suprimidas por serem muito extensas
+ 1 - 1
sources/client/vrv-moblie/unpackage/dist/dev/.sourcemap/mp-weixin/pages/staticProject/staticProject.js.map


Diff do ficheiro suprimidas por serem muito extensas
+ 1 - 1
sources/client/vrv-moblie/unpackage/dist/dev/.sourcemap/mp-weixin/pages/systemParameter/systemParameter.js.map


Diff do ficheiro suprimidas por serem muito extensas
+ 1 - 1
sources/client/vrv-moblie/unpackage/dist/dev/.sourcemap/mp-weixin/pages/systemSet/systemSet.js.map


Diff do ficheiro suprimidas por serem muito extensas
+ 1 - 1
sources/client/vrv-moblie/unpackage/dist/dev/.sourcemap/mp-weixin/pages/user/user.js.map


Diff do ficheiro suprimidas por serem muito extensas
+ 1 - 1
sources/client/vrv-moblie/unpackage/dist/dev/.sourcemap/mp-weixin/uni_modules/uni-popup/components/uni-popup-dialog/uni-popup-dialog.js.map


Diff do ficheiro suprimidas por serem muito extensas
+ 1 - 1
sources/client/vrv-moblie/unpackage/dist/dev/.sourcemap/mp-weixin/uni_modules/uni-popup/components/uni-popup/uni-popup.js.map


+ 14 - 0
sources/client/vrv-moblie/unpackage/dist/dev/mp-weixin/.gitignore

@@ -0,0 +1,14 @@
+# Windows
+[Dd]esktop.ini
+Thumbs.db
+$RECYCLE.BIN/
+
+# macOS
+.DS_Store
+.fseventsd
+.Spotlight-V100
+.TemporaryItems
+.Trashes
+
+# Node.js
+node_modules/

+ 1 - 1
sources/client/vrv-moblie/unpackage/dist/dev/mp-weixin/common/vendor.js

@@ -2679,7 +2679,7 @@ http;exports.default = _default;
 
 "use strict";
 Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0; //路径
-var root = "http://127.0.0.1:9999";
+var root = "http://localhost:9999";
 
 //接口auth
 var api = {

+ 4 - 3
sources/client/vrv-moblie/unpackage/dist/dev/mp-weixin/pages/login/login.js

@@ -196,8 +196,6 @@ __webpack_require__.r(__webpack_exports__);
 //
 //
 //
-//
-//
 var _default =
 {
   data: function data() {
@@ -258,7 +256,10 @@ var _default =
 
                   uni.setStorage({
                     key: 'realname',
-                    data: res.data.data.userBean.realname }),
+                    data: res.data.data.userBean.realname,
+                    success: function success() {
+                      console.log("用户信息存储成功");
+                    } }),
 
 
                   uni.switchTab({

+ 6 - 6
sources/client/vrv-moblie/unpackage/dist/dev/mp-weixin/pages/operator/operator.js

@@ -170,15 +170,15 @@ var _default =
       key: 'realname',
       success: function success(res) {
         console.log(res.data);
-        this.realname = res.data;
 
-        if (this.realname == '') {
-          uni.navigateTo({
-            url: '/pages/login/login' });
+        console.log("用户已登录,跳转到首页");
+      },
+      fail: function fail() {
+        uni.navigateTo({
+          url: '/pages/login/login' });
 
 
-          console.log("未找到用户,请登录");
-        }
+        console.log("未找到用户,请登录");
       } });
 
 

+ 1 - 18
sources/client/vrv-moblie/unpackage/dist/dev/mp-weixin/project.config.json

@@ -19,24 +19,7 @@
     "libVersion": "2.26.0",
     "appid": "wx95c3daeeb44f85f6",
     "projectname": "vrv-platform",
-    "condition": {
-        "search": {
-            "current": -1,
-            "list": []
-        },
-        "conversation": {
-            "current": -1,
-            "list": []
-        },
-        "game": {
-            "current": -1,
-            "list": []
-        },
-        "miniprogram": {
-            "current": -1,
-            "list": []
-        }
-    },
+    "condition": {},
     "editorSetting": {
         "tabIndent": "insertSpaces",
         "tabSize": 4

+ 0 - 13
sources/client/vrv-moblie/unpackage/dist/dev/mp-weixin/project.private.config.json

@@ -3,18 +3,5 @@
     "projectname": "vrv-platform",
     "setting": {
         "compileHotReLoad": true
-    },
-    "condition": {
-        "miniprogram": {
-            "list": [
-                {
-                    "name": "",
-                    "pathName": "pages/parameterSetting/parameterSetting",
-                    "query": "",
-                    "launchMode": "default",
-                    "scene": null
-                }
-            ]
-        }
     }
 }

+ 11 - 1
sources/client/vrv-platform/src/config/api.js

@@ -1,5 +1,15 @@
 //路径
-const root = "http://127.0.0.1:9999";
+// const root = "http://127.0.0.1:9999";
+
+const domain = window.location.host + "/api";
+
+// 端口
+const port = null;
+
+const path = "";
+
+// 路径
+const root = window.location.protocol + "//" + domain + (port ? ":" + port : "") + path;
 
 //接口auth
 const api = {

+ 33 - 32
sources/client/vrv-platform/src/main.js

@@ -23,49 +23,50 @@ import api from './config/api'
 
 import moment from 'moment'
 
+axios.defaults.withCredentials = true;
 Vue.prototype.$moment = moment;
 Vue.prototype.$api = api;
 Vue.prototype.$http = axios;
 Vue.prototype.$qs = qs;
 Vue.prototype.$echarts = echarts
 
-axios.defaults.withCredentials = true;
+
 
 Vue.config.productionTip = false
 
 
 //http响应拦截器
-// Vue.prototype.$http.interceptors.response.use(resp => {
-//
-//
-//   //如果未授权,则跳转至授权页面
-//   if(resp.data.status === 401){
-//
-//     if(sessionStorage.getItem("login-user-info") != null){
-//       Message.warning("30分钟未操作自动退出登录");
-//     }
-//
-//     sessionStorage.removeItem("login-user-info");
-//
-//
-//
-//
-//     router.push("/login");
-//
-//
-//   }
-//
-//   //如果未授权,则跳转至授权页面
-//   if(resp.data.status === 403){
-//     router.push("/no-permission");
-//   }
-//
-//   return resp;
-//
-// }, error => {
-//   console.log(error);
-//   return Promise.reject(error)
-// });
+/*Vue.prototype.$http.interceptors.response.use(resp => {
+
+
+  //如果未授权,则跳转至授权页面
+  if(resp.data.status === 401){
+
+    if(sessionStorage.getItem("login-user-info") != null){
+      Message.warning("30分钟未操作自动退出登录");
+    }
+
+    sessionStorage.removeItem("login-user-info");
+
+
+
+
+    router.push("/login");
+
+
+  }
+
+  //如果未授权,则跳转至授权页面
+  if(resp.data.status === 403){
+    router.push("/no-permission");
+  }
+
+  return resp;
+
+}, error => {
+  console.log(error);
+  return Promise.reject(error)
+});*/
 
 
 //路由拦截器

+ 2 - 1
sources/client/vrv-platform/src/views/login/login.vue

@@ -100,7 +100,8 @@ export default {
           account: this.form.account,
           password: this.form.password,
           verifyCode: this.form.verifyCode,
-        }
+        },
+        withCredentials:true
       }).then((resp) => {
         if (resp.data.status === 200) {
           vm.$message({

+ 1 - 1
sources/client/vrv-platform/vue.config.js

@@ -9,7 +9,7 @@ module.exports = {
         port: 8081,
         proxy: {
             '/api': {
-              target: 'http://127.0.0.1:5030',
+              target: 'http://127.0.0.1:9999',
                 changeOrigin: true,
                 ws: true,
                 pathRewrite: {

+ 1 - 1
sources/server/vrv/run/application.pid

@@ -1 +1 @@
-16084
+18384

+ 9 - 22
sources/server/vrv/vrv-platform/src/main/java/com/kuyuntech/vrv/platform/readJson/Test.java

@@ -1,24 +1,11 @@
-package com.kuyuntech.vrv.platform.readJson;
+package com.kuyuntech.vrv.coreapi.bean.mqtt;
 
-
-import java.util.ArrayList;
 import java.util.HashMap;
+import java.util.List;
 
-public class Test {
-
-
+public class DeviceParam {
     private String deviceId;
-    private int deviceState;
-
-    private HashMap<String, String> deviceData;
-
-    public HashMap<String, String> getDeviceData() {
-        return deviceData;
-    }
-
-    public void setDeviceData(HashMap<String, String> deviceData) {
-        this.deviceData = deviceData;
-    }
+    private HashMap<String,String> deviceData;
 
     public String getDeviceId() {
         return deviceId;
@@ -28,11 +15,11 @@ public class Test {
         this.deviceId = deviceId;
     }
 
-    public int getDeviceState() {
-        return deviceState;
+    public HashMap<String, String> getDeviceData() {
+        return deviceData;
     }
 
-    public void setDeviceState(int deviceState) {
-        this.deviceState = deviceState;
+    public void setDeviceData(HashMap<String, String> deviceData) {
+        this.deviceData = deviceData;
     }
-}
+}

+ 0 - 22
sources/server/vrv/vrv-core-api/src/main/java/com/kuyuntech/vrv/coreapi/bean/mqtt/MyMessage.java

@@ -1,22 +0,0 @@
-package com.kuyuntech.vrv.coreapi.bean.mqtt;
-
-public class MyMessage {
-    private String topic;
-    private String content;
-
-    public String getTopic() {
-        return topic;
-    }
-
-    public void setTopic(String topic) {
-        this.topic = topic;
-    }
-
-    public String getContent() {
-        return content;
-    }
-
-    public void setContent(String content) {
-        this.content = content;
-    }
-}

+ 105 - 106
sources/server/vrv/vrv-platform/src/main/java/com/kuyuntech/vrv/platform/configuration/core/MqttConfiguration.java

@@ -2,9 +2,8 @@ package com.kuyuntech.vrv.platform.configuration.core;
 
 import com.alibaba.fastjson.JSONObject;
 import com.kuyuntech.vrv.coreapi.bean.core.DeviceParamBean;
+import com.kuyuntech.vrv.coreapi.bean.mqtt.DeviceParam;
 import com.kuyuntech.vrv.coreapi.service.core.DeviceParamService;
-import com.kuyuntech.vrv.platform.readJson.Test;
-import com.kuyuntech.vrv.platform.util.core.CompareParamValue;
 import org.eclipse.paho.client.mqttv3.MqttConnectOptions;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.context.annotation.Bean;
@@ -66,7 +65,7 @@ public class MqttConfiguration {
     @Bean
     public MessageProducer inbound() {
         // Paho客户端消息驱动通道适配器,主要用来订阅主题
-        MqttPahoMessageDrivenChannelAdapter adapter = new MqttPahoMessageDrivenChannelAdapter("consumerClient-paho",
+        MqttPahoMessageDrivenChannelAdapter adapter = new MqttPahoMessageDrivenChannelAdapter("askin-paho",
                 mqttClientFactory(), "mqtt/335102012203A500/data", "mqtt/335102012203A500/cmd", "battery", "+/sensor");
         adapter.setCompletionTimeout(5000);
 
@@ -107,7 +106,7 @@ public class MqttConfiguration {
                 String devices = jsonObject.getString("devices");
 
                 //取里面
-                List<Test> list = JSONObject.parseArray(devices, Test.class);
+                List<DeviceParam> list = JSONObject.parseArray(devices, DeviceParam.class);
 
                 //CK1
                 String deviceId = list.get(0).getDeviceId();
@@ -124,137 +123,137 @@ public class MqttConfiguration {
                 //先将数据存入redis,检验所有数据,如果出现数据改变,就执行update更新数据库,并更新redis
 
                 //用长度做判断
-                Long size = redisTemplate.opsForHash().size("paramKeyValue");
-                Long size2 = redisTemplate.opsForHash().size("paramKeyValueCK2");
-                System.out.println(size);
-                System.out.println(size2);
-
-                if (size == 0) {
-                    //遍历CK1数据
-                    for (Map.Entry<String, String> entry : deviceData.entrySet()) {
-
-                        String name = entry.getKey();
-                        String value = entry.getValue();
-
-                        //存入hash
-                        redisTemplate.opsForHash().put("paramKeyValue", name, value);
-
-                        System.out.println("CK1存入redis成功!");
-                    }
-                }
-
-                if (size2 == 0) {
-                    //遍历CK2数据
-                    for (Map.Entry<String, String> entry : deviceData2.entrySet()) {
-
-                        String name = entry.getKey();
-                        String value = entry.getValue();
-
-                        //存入hash
-                        redisTemplate.opsForHash().put("paramKeyValueCK2", name, value);
-
-                        System.out.println("CK2存入redis成功!");
-                    }
-                }
+//                Long size = redisTemplate.opsForHash().size("paramKeyValue");
+//                Long size2 = redisTemplate.opsForHash().size("paramKeyValueCK2");
+//                System.out.println(size);
+//                System.out.println(size2);
+
+//                if (size == 0) {
+//                    //遍历CK1数据
+//                    for (Map.Entry<String, String> entry : deviceData.entrySet()) {
+//
+//                        String name = entry.getKey();
+//                        String value = entry.getValue();
+//
+//                        //存入hash
+//                        redisTemplate.opsForHash().put("paramKeyValue", name, value);
+//
+//                        System.out.println("CK1存入redis成功!");
+//                    }
+//                }
+//
+//                if (size2 == 0) {
+//                    //遍历CK2数据
+//                    for (Map.Entry<String, String> entry : deviceData2.entrySet()) {
+//
+//                        String name = entry.getKey();
+//                        String value = entry.getValue();
+//
+//                        //存入hash
+//                        redisTemplate.opsForHash().put("paramKeyValueCK2", name, value);
+//
+//                        System.out.println("CK2存入redis成功!");
+//                    }
+//                }
 
                 //遍历redis中hash的每一个键值对和mqtt传过来的数据进行比较
 
                 //获取paramKeyValue键值对
-                HashMap<String, String> paramKeyValue = (HashMap<String, String>) redisTemplate.opsForHash().entries("paramKeyValue");
-                HashMap<String, String> paramKeyValueCK2 = (HashMap<String, String>) redisTemplate.opsForHash().entries("paramKeyValueCK2");
+//                HashMap<String, String> paramKeyValue = (HashMap<String, String>) redisTemplate.opsForHash().entries("paramKeyValue");
+//                HashMap<String, String> paramKeyValueCK2 = (HashMap<String, String>) redisTemplate.opsForHash().entries("paramKeyValueCK2");
 
-                System.out.println("----------------------------");
-                System.out.println(deviceData);
-                System.out.println(paramKeyValue);
-                System.out.println("----------------------------");
-                System.out.println(deviceData2);
-                System.out.println(paramKeyValueCK2);
-                System.out.println("----------------------------");
+//                System.out.println("----------------------------");
+//                System.out.println(deviceData);
+//                System.out.println(paramKeyValue);
+//                System.out.println("----------------------------");
+//                System.out.println(deviceData2);
+//                System.out.println(paramKeyValueCK2);
+//                System.out.println("----------------------------");
 
-                boolean result = CompareParamValue.CompareParamValue(paramKeyValue, deviceData);
-                boolean result2 = CompareParamValue.CompareParamValue(paramKeyValueCK2, deviceData2);
+//                boolean result = CompareParamValue.CompareParamValue(paramKeyValue, deviceData);
+//                boolean result2 = CompareParamValue.CompareParamValue(paramKeyValueCK2, deviceData2);
 
-                System.out.println("CK1比较的结果:" + result);
-                System.out.println("CK2比较的结果:" + result2);
+//                System.out.println("CK1比较的结果:" + result);
+//                System.out.println("CK2比较的结果:" + result2);
 
                 //如果不相等,清除缓存,重新加入,并更新数据库
-                if (result == false) {
-                    //清除redis缓存
-                    redisTemplate.delete("paramKeyValue");
+//                if (result == false) {
+                //清除redis缓存
+//                    redisTemplate.delete("paramKeyValue");
 
-                    //重新存入redis
-                    for (Map.Entry<String, String> entry : deviceData.entrySet()) {
+                //重新存入redis
+//                    for (Map.Entry<String, String> entry : deviceData.entrySet()) {
+//
+//                        String name = entry.getKey();
+//                        String value = entry.getValue();
+//
+//                        //存入hash
+//                        redisTemplate.opsForHash().put("paramKeyValue", name, value);
+//
+//                        System.out.println("重新存入redis成功!");
+//                    }
 
-                        String name = entry.getKey();
-                        String value = entry.getValue();
+                long id = 199;
 
-                        //存入hash
-                        redisTemplate.opsForHash().put("paramKeyValue", name, value);
+                //更新数据库
+                for (Map.Entry<String, String> entry : deviceData.entrySet()) {
+                    DeviceParamBean deviceParamBean = new DeviceParamBean();
 
-                        System.out.println("重新存入redis成功!");
-                    }
-
-                    long id = 199;
-
-                    //更新数据库
-                    for (Map.Entry<String, String> entry : deviceData.entrySet()) {
-                        DeviceParamBean deviceParamBean = new DeviceParamBean();
+                    deviceParamBean.setSn(deviceId);
 
-                        deviceParamBean.setSn(deviceId);
+                    String name = entry.getKey();
+                    String value = entry.getValue();
 
-                        String name = entry.getKey();
-                        String value = entry.getValue();
 
+                    deviceParamBean.setId(id);
 
-                        deviceParamBean.setId(id);
+                    id = id + 1;
 
-                        id = id + 1;
+                    deviceParamBean.setName(name);
+                    deviceParamBean.setValue(value);
 
-                        deviceParamBean.setName(name);
-                        deviceParamBean.setValue(value);
+                    deviceParamBean = this.deviceParamService.updateParam(deviceParamBean);
 
-                        deviceParamBean = this.deviceParamService.updateParam(deviceParamBean);
+                    System.out.println("id为:" + id  + "-- 更新后的数据:" + deviceParamBean);
 
-                        System.out.println("id为:" + id + "-- 更新后的数据:" + deviceParamBean);
-
-                    }
                 }
+//                }
 
                 //如果不相等,清除缓存,重新加入,并更新数据库
-                if (result2 == false) {
-                    //清除redis缓存
-                    redisTemplate.delete("paramKeyValueCK2");
-
-                    //重新存入redis
-                    for (Map.Entry<String, String> entry : deviceData2.entrySet()) {
-
-                        String name = entry.getKey();
-                        String value = entry.getValue();
-
-                        //存入hash
-                        redisTemplate.opsForHash().put("paramKeyValueCK2", name, value);
-
-                        System.out.println("重新存入redis成功!");
+//                if (result2 == false) {
+                //清除redis缓存
+//                    redisTemplate.delete("paramKeyValueCK2");
+
+                //重新存入redis
+//                    for (Map.Entry<String, String> entry : deviceData2.entrySet()) {
+//
+//                        String name = entry.getKey();
+//                        String value = entry.getValue();
+//
+//                        //存入hash
+//                        redisTemplate.opsForHash().put("paramKeyValueCK2", name, value);
+//
+//                        System.out.println("重新存入redis成功!");
+//                    }
+
+                //更新数据库
+                for (Map.Entry<String, String> entry : deviceData2.entrySet()) {
+                    DeviceParamBean deviceParamBean = new DeviceParamBean();
+                    deviceParamBean.setSn(deviceId2);
+
+                    for (long i = 298; i < 300; i++) {
+                        deviceParamBean.setId(i);
                     }
 
-                    //更新数据库
-                    for (Map.Entry<String, String> entry : deviceData2.entrySet()) {
-                        DeviceParamBean deviceParamBean = new DeviceParamBean();
-                        deviceParamBean.setSn(deviceId2);
+                    String name = entry.getKey();
+                    String value = entry.getValue();
 
-                        for (long i = 298; i < 300; i++) {
-                            deviceParamBean.setId(i);
-                        }
+                    deviceParamBean.setName(name);
+                    deviceParamBean.setValue(value);
 
-                        String name = entry.getKey();
-                        String value = entry.getValue();
-
-                        deviceParamBean.setName(name);
-                        deviceParamBean.setValue(value);
-
-                        deviceParamBean = this.deviceParamService.updateParam(deviceParamBean);
-                    }
+                    deviceParamBean = this.deviceParamService.updateParam(deviceParamBean);
                 }
+//                }
             }
 
         };

+ 14 - 8
sources/server/vrv/vrv-platform/src/main/java/com/kuyuntech/vrv/platform/controller/auth/AuthController.java

@@ -3,6 +3,7 @@ package com.kuyuntech.vrv.platform.controller.auth;
 
 import com.kuyuntech.vrv.coreapi.bean.core.UserBean;
 import com.kuyuntech.vrv.coreapi.bean.core.VerifyCodeBean;
+import com.kuyuntech.vrv.coreapi.constant.core.LoginSession;
 import com.kuyuntech.vrv.coreapi.constant.core.VerifyCodeStatus;
 import com.kuyuntech.vrv.coreapi.constant.core.VerifyCodeType;
 import com.kuyuntech.vrv.coreapi.service.core.AuthService;
@@ -71,10 +72,12 @@ public class AuthController {
                 .type(VerifyCodeType.IMG).verified(VerifyCodeStatus.UN_VERIFY).expireTime(verifyCodeExpireTime).verifyCode(verifyCode).build());
 
         //存入redis
-        redisTemplate.opsForValue().set("verifyCodeBean", verifyCodeBean);
+//        redisTemplate.opsForValue().set("verifyCodeBean", verifyCodeBean);
 
-        response.setContentType("application/force-download");
-        response.setHeader("Content-Disposition", "attachment; filename=" + URLEncoder.encode(verifyCode, "UTF-8"));
+        //存入session
+        request.getSession().setAttribute(LoginSession.VERIFY_CODE, verifyCodeBean);
+
+        response.setHeader("verifyCode", verifyCodeBean.getCode());
 
         ValidateCodeGenerator.outputImage(width != null ? width : 300, height != null ? height : 100, response.getOutputStream(), verifyCode);
 
@@ -83,11 +86,14 @@ public class AuthController {
     @RequestMapping
     public Object login(UserBean userBean, HttpServletRequest request) {
 
+        System.out.println(request.getSession().getAttribute(LoginSession.VERIFY_CODE));
         //校验验证码是否正确
         if (this.verifyCodeCheck) {
 
+            VerifyCodeBean verifyCodeBean = (VerifyCodeBean) request.getSession().getAttribute(LoginSession.VERIFY_CODE);
+
             //获取redis中的验证码对象
-            VerifyCodeBean verifyCodeBean = (VerifyCodeBean) redisTemplate.opsForValue().get("verifyCodeBean");
+//            VerifyCodeBean verifyCodeBean = (VerifyCodeBean) redisTemplate.opsForValue().get("verifyCodeBean");
 
             if (verifyCodeBean == null) {
                 return ParamErrorResultBuilder.newBuilder().paramError("verifyCode", "没有获取到验证码").build();
@@ -118,16 +124,16 @@ public class AuthController {
         //验证账号和密码
         userBean = this.authService.login(userBean);
 
-
         if (userBean == null) {
             return ResponseBean.serverError("账号或密码错误");
         }
 
         //删除redis中的验证码对象
-        redisTemplate.delete("verifyCodeBean");
+        request.getSession().removeAttribute(LoginSession.VERIFY_CODE);
+//        redisTemplate.delete("verifyCodeBean");
 
-        //将登录用户村热redis
-        redisTemplate.opsForValue().set("userBean", userBean);
+        //将登录用户存入redis
+//        redisTemplate.opsForValue().set("userBean", userBean);
 
         return ResponseBean.success("登录成功").addData("userBean", userBean);
     }

+ 0 - 5
sources/server/vrv/vrv-platform/src/main/java/com/kuyuntech/vrv/platform/controller/core/DeviceParamController.java

@@ -1,12 +1,8 @@
 package com.kuyuntech.vrv.platform.controller.core;
 
-import com.alibaba.fastjson.JSON;
-import com.alibaba.fastjson.JSONObject;
 import com.kuyuntech.vrv.coreapi.bean.core.DeviceParamBean;
 import com.kuyuntech.vrv.coreapi.service.core.DeviceParamService;
 import com.kuyuntech.vrv.platform.configuration.core.MqttGateway;
-import com.kuyuntech.vrv.platform.readJson.Test;
-import com.kuyuntech.vrv.platform.util.core.FileUtils;
 import com.wbspool.fastboot.core.common.bean.PagerBean;
 import com.wbspool.fastboot.core.common.bean.ResponseBean;
 import com.wbspool.fastboot.core.common.builder.MapBuilder;
@@ -23,7 +19,6 @@ import org.springframework.web.bind.annotation.RestController;
 
 import javax.annotation.Resource;
 import java.util.ArrayList;
-import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 

+ 0 - 25
sources/server/vrv/vrv-platform/src/main/java/com/kuyuntech/vrv/platform/controller/mqtt/MqttController.java

@@ -1,25 +0,0 @@
-package com.kuyuntech.vrv.platform.controller.mqtt;
-
-import com.kuyuntech.vrv.coreapi.bean.mqtt.MyMessage;
-import com.kuyuntech.vrv.platform.configuration.core.MqttGateway;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RestController;
-
-import javax.annotation.Resource;
-
-
-@RestController
-public class MqttController {
-
-    @Resource
-    private MqttGateway mqttGateway;
-
-    @PostMapping("/send")
-    public String send(@RequestBody MyMessage myMessage) {
-        // 发送消息到指定主题
-        mqttGateway.sendToMqtt(myMessage.getTopic(), 1, myMessage.getContent());
-        return "send topic: " + myMessage.getTopic()+ ", message : " + myMessage.getContent();
-    }
-
-}

+ 0 - 40
sources/server/vrv/vrv-platform/src/main/java/com/kuyuntech/vrv/platform/readJson/readDeviceParams.java

@@ -1,40 +0,0 @@
-package com.kuyuntech.vrv.platform.readJson;
-
-import com.alibaba.fastjson.JSONObject;
-import com.kuyuntech.vrv.platform.util.core.FileUtils;
-
-import java.io.IOException;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-public class readDeviceParams {
-    public static void main(String[] args) throws IOException {
-        String dataFromJsonFile = FileUtils.getDataFromJsonFile("C:\\Users\\askin\\IdeaProjects\\airconditioner\\sources\\server\\vrv\\vrv-platform\\src\\main\\resources\\static\\device-params.json");
-//        System.out.println(dataFromJsonFile);
-
-        JSONObject jsonObject = JSONObject.parseObject(dataFromJsonFile);
-
-        String devices = jsonObject.getString("devices");
-//        System.out.println(devices);
-
-
-//取里面的state
-        List<Test> list = JSONObject.parseArray(devices, Test.class);
-        String deviceId = list.get(0).getDeviceId();
-        int deviceState = list.get(0).getDeviceState();
-        HashMap<String, String> deviceData = list.get(0).getDeviceData();
-        System.out.println(deviceData);
-
-        System.out.println(deviceId + "::" + deviceState);
-
-        for (Map.Entry<String, String> entry : deviceData.entrySet()) {
-            String name = entry.getKey();
-            String value = entry.getValue();
-
-            System.out.println(name + "------" + value);
-        }
-
-
-    }
-}

+ 0 - 17
sources/server/vrv/vrv-platform/src/main/java/com/kuyuntech/vrv/platform/util/core/CompareParamValue.java

@@ -1,17 +0,0 @@
-package com.kuyuntech.vrv.platform.util.core;
-
-import java.util.HashMap;
-
-public class CompareParamValue {
-    public static boolean CompareParamValue(HashMap<String, String> paramKeyValue, HashMap<String, String> deviceData) {
-
-        if (paramKeyValue == null || deviceData == null) {
-            return false;
-        }
-
-        boolean equals = paramKeyValue.equals(deviceData);
-
-        return equals;
-
-    }
-}

+ 0 - 47
sources/server/vrv/vrv-platform/src/main/java/com/kuyuntech/vrv/platform/util/core/FileUtils.java

@@ -1,47 +0,0 @@
-package com.kuyuntech.vrv.platform.util.core;
-
-import java.io.*;
-import java.nio.charset.StandardCharsets;
-
-/**
- * @Description 文件工具类
- * @ClassName FileUtils
- */
-public class FileUtils {
-    /**
-     * 从json文件中读取数据
-     *
-     * @param jsonFilePath
-     * @return
-     */
-    public static String getDataFromJsonFile(String jsonFilePath) {
-        StringBuilder jsonString = new StringBuilder();
-        File file = new File(jsonFilePath);
-
-        if (file.exists()) {
-            BufferedReader bufferedReader = null;
-
-            try {
-                bufferedReader = new BufferedReader(new InputStreamReader(new FileInputStream(file), StandardCharsets.UTF_8));
-                char[] chars = new char[8192];
-                int length;
-                while ((length = bufferedReader.read(chars)) != -1) {
-                    String temp = new String(chars, 0, length);
-                    jsonString.append(temp);
-                }
-            } catch (IOException e) {
-                System.out.println("=====获取数据异常=====" + e);
-            } finally {
-                if (null != bufferedReader) {
-                    try {
-                        bufferedReader.close();
-                    } catch (IOException ex) {
-                        System.out.println("=======获取数据时,关闭流异常=======" + ex);
-                    }
-                }
-            }
-        }
-        return jsonString.toString();
-    }
-}
-

+ 0 - 116
sources/server/vrv/vrv-platform/src/main/resources/static/device-params.json

@@ -1,116 +0,0 @@
-{
-  "version": "5.0",
-  "devices": [
-    {
-      "deviceId": "CK1",
-      "deviceState": 1,
-      "deviceData": {
-        "WD_1": 28.42,
-        "SD_1": 51.21,
-        "WD_SD": 26,
-        "SD_SD": 58,
-        "WD1_XZ": 0,
-        "SD1_XZ": 0,
-        "ZL_P": -7,
-        "ZL_I": 1,
-        "CS_P": -7,
-        "CS_I": 1,
-        "JR_P": -7,
-        "JR_I": 1,
-        "JS_P": -7,
-        "JS_I": 1,
-        "RSF_SDKD": 0,
-        "LSF_SDKD": 0,
-        "JSF_SDKD": 0,
-        "LSF": 21.7,
-        "RSF": 21.7,
-        "JSF": 0,
-        "HSL_SD": 12.2,
-        "HSL": 12.43,
-        "QF_YSBJ": 2,
-        "JZ_YSTZ": 2,
-        "SFJ_YSQD": 2,
-        "PFJ_YSQD": 2,
-        "QD_XQ": 2,
-        "QD_S": 0,
-        "QD_F": 0,
-        "TZ_XQ": 6,
-        "TZ_S": 59,
-        "TZ_F": 59,
-        "YJDJR_SZXZ": 0,
-        "FLZJ_SDQD": 0,
-        "FLZJ_SZXZ": 0,
-        "PFJ_SDQD": 0,
-        "PFJ_SZXZ": 0,
-        "SFJ_SDQD": 0,
-        "SFJ_SZXZ": 0,
-        "PFF_SDQD": 0,
-        "PFF_SZXZ": 0,
-        "SFF_SDQD": 0,
-        "SFF_SZXZ": 0,
-        "GZ_FW": 0,
-        "DS_QT": 0,
-        "JZ_KGJ": 0,
-        "JZ_XZ": 0,
-        "MS_XZ": 0,
-        "DX_XZ": 0,
-        "WS_YXXZ": 0,
-        "HF_CC": 0,
-        "JSF_SZXZ": 0,
-        "LSF_SZXZ": 0,
-        "RSF_SZXZ": 0,
-        "SJDJR_SDQD": 0,
-        "SJDJR_SZXZ": 0,
-        "EJDJR_SDQD": 0,
-        "EJDJR_SZXZ": 0,
-        "YJDJR_SDQD": 0,
-        "JZ_JT": 0,
-        "QFYC_BJ": 0,
-        "GW_BJ": 0,
-        "FLZJ_GZ": 0,
-        "PFJ_GZ": 0,
-        "SFJ_GZ": 0,
-        "LWDS_ZX": 0,
-        "LWDS_CX": 0,
-        "SD_DBJ": 0,
-        "SD_GBJ": 0,
-        "WD_DBJ": 0,
-        "WD_GBJ": 0,
-        "FLZJ_QT": 0,
-        "PFF_KGKZ": 0,
-        "SFF_KGKZ": 0,
-        "SJDJR_QT": 0,
-        "EJDJR_QT": 0,
-        "YJDJR_QT": 0,
-        "PFJ_QT": 0,
-        "SFJ_QT": 0,
-        "JZ_GZ": 0,
-        "JZ_YX": 0,
-        "WD_2": 0,
-        "SD_2": 0,
-        "SFJ_PLSD": 0,
-        "PFJ_PLSD": 0,
-        "SFJ_PLFH": 22.36,
-        "PFJ_PLFH": 22.35,
-        "SFJ_PLSX": 100,
-        "SFJ_PLXX": 0,
-        "PFJ_PLSX": 100,
-        "PFJ_PLXX": 0,
-        "WDBJ_SX": 25,
-        "WDBJ_XX": 21,
-        "SDBJ_SX": 65,
-        "SDBJ_XX": 45,
-        "SFJ_PLXZ": 0,
-        "PFJ_PLXZ": 0
-      }
-    },
-    {
-      "deviceId": "CK2",
-      "deviceState": 0,
-      "deviceData": {
-        "WD_1": "bad",
-        "SD_1": "bad"
-      }
-    }
-  ]
-}

+ 0 - 305
sources/server/vrv/vrv-platform/src/main/resources/static/project.html

@@ -1,305 +0,0 @@
-<!DOCTYPE html>
-<html lang="en">
-<head>
-    <meta charset="UTF-8">
-
-    <!-- 引入样式 -->
-    <link rel="stylesheet" href="https://unpkg.com/element-ui/lib/theme-chalk/index.css">
-
-    <title>项目管理</title>
-</head>
-<body>
-<div id="project">
-    <el-main>
-        <el-form :inline="true" :model="searchFormData">
-            <el-form-item label="项目名称">
-                <el-input placeholder="项目名称" size="small" v-model="searchFormData.name"></el-input>
-            </el-form-item>
-            <el-form-item label="省份">
-                <el-input placeholder="省份" size="small" v-model="searchFormData.province"></el-input>
-            </el-form-item>
-            <el-form-item label="城市">
-                <el-input placeholder="城市" size="small" v-model="searchFormData.city"></el-input>
-            </el-form-item>
-
-            <el-form-item>
-                <el-button type="primary" size="small" @click="search(searchFormData)">搜索</el-button>
-            </el-form-item>
-
-            <el-form-item>
-                <el-button type="primary" size="small" @click="showAdd">新增</el-button>
-            </el-form-item>
-
-
-            <el-dialog title="项目" :visible.sync="dialogFormVisible">
-                <el-form label-position="left" :model="formData">
-                    <el-form-item label="栏目名称">
-                        <el-input v-model="formData.name"></el-input>
-                    </el-form-item>
-                    <el-form-item label="项目省份">
-                        <el-input v-model="formData.province"></el-input>
-                    </el-form-item>
-                    <el-form-item label="项目城市">
-                        <el-input v-model="formData.city"></el-input>
-                    </el-form-item>
-                    <el-form-item label="客户名称">
-                        <el-input v-model="formData.customer"></el-input>
-                    </el-form-item>
-                    <el-form-item label="客户电话">
-                        <el-input v-model="formData.customerTel"></el-input>
-                    </el-form-item>
-                </el-form>
-
-                <div slot="footer" class="dialog-footer">
-                    <el-button @click="cancel()">取 消</el-button>
-                    <el-button type="primary" @click="addOrEditMehtond()">确 定</el-button>
-                </div>
-            </el-dialog>
-
-        </el-form>
-
-
-        <el-table :data="tableData">
-
-            <el-table-column prop="name" label="项目名称"></el-table-column>
-            <el-table-column prop="customer" label="客户名称"></el-table-column>
-            <el-table-column prop="customerTel" label="客户电话"></el-table-column>
-            <el-table-column prop="province" label="项目省份"></el-table-column>
-            <el-table-column prop="city" label="项目城市"></el-table-column>
-
-            <el-table-column label="操作">
-                <template slot-scope="scope">
-                    <el-button type="primary" size="small" @click="showEdit(scope.row)">修改</el-button>
-                    <el-button type="danger" size="small" @click="del(scope.row)">删除</el-button>
-                </template>
-            </el-table-column>
-
-        </el-table>
-
-        <el-pagination
-                background
-                layout="prev, pager, next"
-                :page-size="pager.pageSize"
-                :current-page="pager.pageIndex"
-                :total="pager.itemCount"
-                @current-change="handleCurrentChange"
-        >
-        </el-pagination>
-
-    </el-main>
-</div>
-
-
-<script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
-<!-- 引入组件库 -->
-<script src="https://unpkg.com/element-ui/lib/index.js"></script>
-<script src="https://unpkg.com/axios/dist/axios.min.js"></script>
-
-<script>
-    new Vue({
-        el: '#project',
-        data() {
-            return {
-
-                addOrEdit: 1,
-
-                dialogFormVisible: false,
-
-                pager: {
-                    pageSize: 2,
-                    pageIndex: 1,
-                    itemCount: 0,
-                },
-
-                tableData:
-                    [{
-                        name: '1',
-                        customer: '1',
-                        customerTel: '1',
-                        province: '1',
-                        city: '1',
-                        code: '',
-                        valid: '',
-                    }],
-                formData: {
-                    name: '1',
-                    customer: '1',
-                    customerTel: '1',
-                    province: '1',
-                    city: '1',
-                    code: '',
-                    valid: '',
-                },
-                searchFormData:
-                    {
-                        name: '',
-                        province: '',
-                        city: ''
-                    }
-            }
-        },
-
-        created: function () {
-            this.loadData();
-        },
-
-        methods: {
-            //切换页码
-            handleCurrentChange(index) {
-                this.loadData(index)
-            },
-
-            loadData(index) {
-                var vm = this;
-                axios.get('http://localhost:8088/project/list', {
-                    params: {
-                        pageSize: 3,
-                        pageIndex: index ? index : 1,
-                        name: this.searchFormData.name,
-                        province: this.searchFormData.province,
-                        city: this.searchFormData.city,
-                    }
-                })
-                    .then((response) => {
-                        // vm.paper = response.data.data.paper;
-                        //console.log(response.data.data);
-
-                        vm.pager = response.data.data.pager
-
-                        vm.tableData = response.data.data.projects;
-                    })
-            },
-            search(searchFormData) {
-                //console.log(this.searchFormData)
-                this.loadData();
-            },
-            showAdd() {
-                this.dialogFormVisible = true;
-
-                this.formData.name = '';
-                this.formData.province = '';
-                this.formData.city = '';
-                this.formData.customer = '';
-                this.formData.customerTel = '';
-                this.addOrEdit = 1
-            },
-
-            showEdit(row) {
-
-                console.log(row)
-
-                this.dialogFormVisible = true;
-
-                this.formData = row
-
-                this.addOrEdit = 2
-            },
-
-
-            addOrEditMehtond() {
-                if (this.addOrEdit == 2) {
-                    axios.get('http://localhost:8088/project/update', {
-                        params: {
-                            code: this.formData.code,
-                            name: this.formData.name,
-                            province: this.formData.province,
-                            city: this.formData.city,
-                            customer: this.formData.customer,
-                            customerTel: this.formData.customerTel,
-                        }
-                    })
-                        .then((response) => {
-                            console.log(response)
-
-                            if (response.data.status == 200) {
-
-                                this.$message({
-                                    type: 'success',
-                                    showClose: true,
-                                    message: response.data.desc
-                                })
-                            }
-
-                            this.dialogFormVisible = false;
-
-                            this.loadData();
-
-                        })
-                        .catch(() => {
-                        });
-                }
-
-                if (this.addOrEdit == 1) {
-                    axios.get('http://localhost:8088/project/add', {
-                        params: {
-                            name: this.formData.name,
-                            province: this.formData.province,
-                            city: this.formData.city,
-                            customer: this.formData.customer,
-                            customerTel: this.formData.customerTel
-                        }
-                    })
-                        .then((response) => {
-                            if (response.data.status == 200) {
-
-                                this.dialogFormVisible = false;
-
-                                this.$message({
-                                    type: 'success',
-                                    showClose: true,
-                                    message: response.data.desc
-                                })
-
-                                this.loadData();
-                            }
-                        })
-                }
-            },
-
-            del(row) {
-                this.$confirm('确认删除', '提示', {
-                    type: 'warning'
-                }).then(() => {
-                    axios.get('http://localhost:8088/project/delete', {
-                        params: {
-                            code: row.code,
-                        }
-                    })
-                        .then((response) => {
-                            console.log(response)
-                            if (response.data.status == 200) {
-                                this.$message({
-                                    type: 'success',
-                                    showClose: true,
-                                    message: response.data.desc
-                                })
-
-                            }
-                            this.loadData();
-                        })
-                })
-                    .catch(() => {
-                        this.$message({
-                            type: 'info',
-                            showClose: true,
-                            message: '取消删除'
-                        })
-                    });
-            },
-            cancel() {
-                this.$message({
-                    message: '操作取消',
-                    showClose: true,
-                    type: 'info'
-                });
-
-                this.dialogFormVisible = false;
-
-            },
-        }
-
-    })
-
-</script>
-</body>
-</html>