瀏覽代碼

协议管理bug

钞小赢 2 年之前
父節點
當前提交
b903be9786

+ 2 - 2
.env

@@ -2,12 +2,12 @@
2 2
 
3 3
 # 页面 title 前缀
4 4
 VUE_APP_TITLE=物联网平台
5
-# let pubUrl=window.location.href
5
+
6 6
 # 网络请求公用地址
7 7
 VUE_APP_API=/api/
8 8
 # 测试
9 9
 #  VUE_APP_API=http://101.36.160.140:31005/smart-grp-basic
10
-# VUE_APP_API=pubUrl+"smart-grp-basic"
10
+
11 11
 # //正式
12 12
 # VUE_APP_API=http://23.99.21.201:59887/smart-grp-basic
13 13
 

+ 2 - 1
src/api/modules/paramManage/agreement.api.js

@@ -22,7 +22,8 @@ export default ({
22 22
   //协议列表-详情
23 23
   agreementDetail(id) {
24 24
     return request({
25
-      url: `/remote-params/getByIdList/${id}`,
25
+      // url: `/remote-params/getByIdList/${id}`,
26
+      url: `/remote-params/getById/${id}`,
26 27
       method: 'get',
27 28
     })
28 29
   },

+ 6 - 6
src/views/demo/equipmentManage/equipmentInfo/index.vue

@@ -663,11 +663,11 @@ export default {
663 663
     connect() {
664 664
       let options = {
665 665
         //本地
666
-        // username: "admin",
667
-        // password: "public",
666
+        username: "admin",
667
+        password: "public",
668 668
         //测试
669
-           username: "admin",
670
-        password: "admin@123",
669
+        //    username: "admin",
670
+        // password: "admin@123",
671 671
         //生产
672 672
         // username: "admin",
673 673
         // password: "admin@2Ld&DDrsk",
@@ -677,9 +677,9 @@ export default {
677 677
         connectTimeout: 4000,
678 678
       };
679 679
       //本地开发环境
680
-      // this.client = mqtt.connect("ws://192.168.50.169:8083/mqtt", options);
680
+      this.client = mqtt.connect("ws://192.168.50.169:8083/mqtt", options);
681 681
       //测试环境
682
-       this.client = mqtt.connect('ws://172.16.0.5:8083/mqtt',options);
682
+      //  this.client = mqtt.connect('ws://172.16.0.5:8083/mqtt',options);
683 683
       //正式环境
684 684
       // this.client = mqtt.connect('ws://10.105.101.61:8083/mqtt',options);
685 685
       this.client.on("connect", (e) => {

+ 17 - 5
src/views/demo/parameManagement/agreement/addDialog.vue

@@ -14,7 +14,7 @@
14 14
       >
15 15
         <el-form-item label="协议类型:" prop="protocolType">
16 16
           <el-select v-model="addForm.protocolType" placeholder="请选择">
17
-            <el-option v-for="(item,index) in xyArr" :key="index" :label="item.enumName" :value="item.enumName"></el-option>
17
+            <el-option v-for="(item,index) in xyArr" :key="item.enumCode" :label="item.enumName" :value="item.enumCode"></el-option>
18 18
           </el-select>
19 19
         </el-form-item>
20 20
         <el-form-item label="协议链接:" prop="protocolTopic">
@@ -56,6 +56,10 @@ import log from "@/libs/util.log";
56 56
 export default {
57 57
   props: {
58 58
     dialogTitle: "",
59
+     row:{
60
+      type:Object,
61
+      require:true
62
+     }
59 63
   },
60 64
   data() {
61 65
     return {
@@ -78,6 +82,7 @@ export default {
78 82
   },
79 83
   created() {
80 84
     this.getXyArr()
85
+
81 86
   },
82 87
   methods: {
83 88
     getXyArr() {
@@ -93,6 +98,7 @@ export default {
93 98
         .dataDic(data)
94 99
         .then((res) => {
95 100
           if (res.code == 200) {
101
+         
96 102
             this.xyArr = res.data[0].children;
97 103
           }
98 104
         })
@@ -107,6 +113,7 @@ export default {
107 113
     },
108 114
     //获取编辑数据
109 115
     getEditRow(row) {
116
+     
110 117
       this.addForm = JSON.parse(JSON.stringify(row));
111 118
     },
112 119
     //新建产品提交
@@ -114,10 +121,12 @@ export default {
114 121
       this.$refs[formName].validate((valid) => {
115 122
         if (valid) {
116 123
           let params = JSON.parse(JSON.stringify(this.addForm));
117
-          let arr=this.xyArr.filter(item=>{
118
-            return item.enumName==params.protocolType
119
-          })
120
-          params.protocolType=arr[0].enumCode
124
+           params.buildUser=localStorage.getItem("userName")
125
+          //  console.log(this.xyArr,"this.xyArr")
126
+          // let arr=this.xyArr.filter(item=>{
127
+          //   return item.enumName==params.protocolType
128
+          // })
129
+          // params.protocolType=arr[0].enumCode
121 130
           if (this.dialogTitle == "新建协议") {
122 131
             params.id = "";
123 132
             // params.orgCode=localStorage.getItem("orgCode")
@@ -132,6 +141,8 @@ export default {
132 141
               }
133 142
             });
134 143
           } else {
144
+            
145
+            
135 146
             api.agreementSave(params).then((res) => {
136 147
               if (res.code == 200) {
137 148
                 this.$message.success("编辑成功");
@@ -149,6 +160,7 @@ export default {
149 160
       });
150 161
     },
151 162
   },
163
+
152 164
 };
153 165
 </script>
154 166
 <style lang="scss" scoped>

+ 18 - 2
src/views/demo/parameManagement/agreement/index.vue

@@ -129,6 +129,7 @@ export default {
129 129
     components: { addDialog },
130 130
   data() {
131 131
     return {
132
+   
132 133
       editRow: {},
133 134
       addForm: {},
134 135
       dialogFormVisible: false,
@@ -161,12 +162,27 @@ export default {
161 162
     };
162 163
   },
163 164
   methods: {
165
+ 
166
+ 
164 167
     //编辑
165 168
     edit(row) {
166 169
       this.$refs.addDialog.dialogFormVisible = true;
167 170
       this.dialogTitle = "编辑协议";
168
-      this.editRow = row;
169
-      this.$refs.addDialog.getEditRow(row);
171
+         //编辑数据回显
172
+      api.agreementDetail(row.id)
173
+      .then(res=>{
174
+        if(res.code==200){
175
+       
176
+        this.editRow = res.data;
177
+        this.$refs.addDialog.getEditRow(this.editRow);
178
+        }
179
+        
180
+      })
181
+      .catch(err=>{
182
+        console.log(err)
183
+      })
184
+     
185
+ 
170 186
     },
171 187
     //删除
172 188
     del(row) {

+ 6 - 6
src/views/demo/productManage/productInfo/realTime/index.vue

@@ -164,11 +164,11 @@ export default {
164 164
     connect() {
165 165
       let options = {
166 166
         //本地
167
-        // username: "admin",
168
-        // password: "public",
169
-        //测试
170 167
         username: "admin",
171
-        password: "admin@123",
168
+        password: "public",
169
+        //测试
170
+        // username: "admin",
171
+        // password: "admin@123",
172 172
         //生产
173 173
         // username: "admin",
174 174
         // password: "admin@2Ld&DDrsk",
@@ -178,9 +178,9 @@ export default {
178 178
         connectTimeout: 4000,
179 179
       };
180 180
       //本地开发环境
181
-      // this.client = mqtt.connect("ws://192.168.50.169:8083/mqtt", options);
181
+      this.client = mqtt.connect("ws://192.168.50.169:8083/mqtt", options);
182 182
       //测试环境
183
-      this.client = mqtt.connect('ws://172.16.0.5:8083/mqtt',options);
183
+      // this.client = mqtt.connect('ws://172.16.0.5:8083/mqtt',options);
184 184
       //正式环境
185 185
       // this.client = mqtt.connect('ws://10.105.101.61:8083/mqtt',options);
186 186
       this.client.on("connect", (e) => {

+ 6 - 6
src/views/system/visualized/index.vue

@@ -442,11 +442,11 @@ export default {
442 442
     connect() {
443 443
       let options = {
444 444
         //本地
445
-        // username: "admin",
446
-        // password: "public",
447
-        //测试
448 445
         username: "admin",
449
-        password: "admin@123",
446
+        password: "public",
447
+        //测试
448
+        // username: "admin",
449
+        // password: "admin@123",
450 450
         //生产
451 451
         // username: "admin",
452 452
         // password: "admin@2Ld&DDrsk",
@@ -456,9 +456,9 @@ export default {
456 456
         connectTimeout: 4000,
457 457
       };
458 458
       //本地开发环境
459
-      // this.client = mqtt.connect("ws://192.168.50.169:8083/mqtt", options);
459
+      this.client = mqtt.connect("ws://192.168.50.169:8083/mqtt", options);
460 460
       //测试环境
461
-      this.client = mqtt.connect('ws://172.16.0.5:8083/mqtt',options);
461
+      // this.client = mqtt.connect('ws://172.16.0.5:8083/mqtt',options);
462 462
       //正式环境
463 463
       // this.client = mqtt.connect('ws://10.105.101.61:8083/mqtt',options);
464 464
       this.client.on("connect", (e) => {

+ 1 - 1
vue.config.js

@@ -32,7 +32,7 @@ const pages = undefined
32 32
 //   index: './src/main.js',
33 33
 //   subpage: './src/subpage.js'
34 34
 // }
35
-// console.log(VUE_APP_API,"url...")
35
+
36 36
 
37 37
 module.exports = {
38 38
   // 根据你的实际情况更改这里