Browse Source

Merge branch 'system-integration' of http://39.106.8.246:3003/web/ibms into system-integration

zhulizhen1111 4 years ago
parent
commit
bcb5d45ced

+ 6 - 6
config/dev.env.js

@@ -4,14 +4,14 @@ const prodEnv = require('./prod.env')
 
 module.exports = merge(prodEnv, {
   NODE_ENV: '"development"',
-  // BASE_URL: '"http://172.16.44.215"', //测试iframe地址
-  // SSO_SERVER: '"http://172.16.44.235:8081"', //测试环境
+  BASE_URL: '"http://172.16.44.215"', //测试iframe地址
+  SSO_SERVER: '"http://172.16.44.235:8081"', //测试环境
   // BASE_URL: '"http://192.168.20.236"', //(新)测试iframe地址
   // SSO_SERVER: '"http://192.168.20.236:8086"', //(新)测试环境
-  // MQTT_SERVICE: '"ws://172.16.42.210:61614/stomp/"' //MQ测试环境地址
-  SSO_SERVER: '"http://sso.sagacloud.cn"',  //正式环境
-  BASE_URL: '"http://mbi.sagacloud.cn"', //线上iframe地址
-  MQTT_SERVICE: '"ws://adm.sagacloud.cn/stomp/"' //MQ正式环境地址
+  MQTT_SERVICE: '"ws://172.16.42.210:61614/stomp/"' //MQ测试环境地址
+  // SSO_SERVER: '"http://sso.sagacloud.cn"',  //正式环境
+  // BASE_URL: '"http://mbi.sagacloud.cn"', //线上iframe地址
+  // MQTT_SERVICE: '"ws://adm.sagacloud.cn/stomp/"' //MQ正式环境地址
 })
 
 

+ 189 - 189
config/index.js

@@ -10,197 +10,197 @@ module.exports = {
     assetsSubDirectory: 'static',
     assetsPublicPath: '/',
 
-    proxyTable: {//正式环境
-      '/admin': {
-        target: 'http://mbi.sagacloud.cn:8080',
-        changeOrigin: true,
-        pathRewrite: {
-          "^/admin": "/"
-        }
-      },
-      '/api': {
-        target: 'http://mbi.sagacloud.cn:8080',
-        changeOrigin: true,
-        pathRewrite: {
-          "^/api": "/"
-        }
-      },
-      '/data-platform-3': {
-        // 目标 API 地址
-        target: 'http://api.sagacloud.cn/',
-        // 如果要代理 websockets
-        ws: true,
-        // 将主机标头的原点更改为目标URL
-        changeOrigin: false
-      },
-      '/business-space': {
-        // 目标 API 地址
-        target: 'http://api.sagacloud.cn',
-        changeOrigin: true,
-        pathRewrite: {
-          "^/business-space": "/dp-auxiliary/business-space/"
-        }
-      },
-      '/pointconfig': {
-        // 目标 API 地址
-        target: 'http://mbi.sagacloud.cn:8080/',
-        // 如果要代理 websockets
-        ws: true,
-        // 将主机标头的原点更改为目标URL
-        changeOrigin: false
-      },
-      '/venders-dp': {
-        // 目标 API 地址
-        target: 'http://api.sagacloud.cn',
-        changeOrigin: true,
-        pathRewrite: {
-          "^/venders-dp": "/dp-auxiliary/venders-dp/"
-        }
-      },
-      '/venders': {
-        // 目标 API 地址
-        target: 'http://api.sagacloud.cn',
-        changeOrigin: true,
-        pathRewrite: {
-          "^/venders": "/dp-auxiliary/venders/"
-        }
-      },
-      '/ScanBuilding': {
-        // 目标 API 地址
-        target: 'http://mbi.sagacloud.cn:8080/',
-        // 如果要代理 websockets
-        ws: true,
-        // 将主机标头的原点更改为目标URL
-        changeOrigin: false
-      },
-      '/scanbuilding-2': {
-        // 目标 API 地址
-        target: 'http://mbi.sagacloud.cn:8080/',
-        // 如果要代理 websockets
-        ws: true,
-        // 将主机标头的原点更改为目标URL
-        changeOrigin: false
-      },
-      '/image-service': {
-        // 目标 API 地址
-        target: 'http://api.sagacloud.cn',
-        changeOrigin: true,
-        pathRewrite: {
-          "^/image-service": "/dp-auxiliary/image-service/"
-        }
-      },
-      '/modelapi': {
-        target: 'http://mbi.sagacloud.cn:8080',
-        changeOrigin: true,
-        pathRewrite: {
-          "^/modelapi": "/revit-algorithm/"
-        }
-      },
-      '/schedulerapi': {
-        target: 'http://mbi.sagacloud.cn:8080',
-        changeOrigin: true,
-        pathRewrite: {
-            "^/schedulerapi": "/scheduler/"
-        }
-      },
-    },
-
-    // proxyTable: {
-    //     '/admin': {
-    //         target: 'http://172.16.44.235:8080',
-    //         changeOrigin: true,
-    //         pathRewrite: {
-    //             "^/admin": "/"
-    //         }
-    //     },
-    //     '/api': {
-    //         target: 'http://172.16.44.235:8080',
-    //         changeOrigin: true,
-    //         pathRewrite: {
-    //             "^/api": "/"
-    //         }
-    //     },
-    //     '/data-platform-3': {
-    //         // 目标 API 地址
-    //         target: 'http://172.16.42.210:8080/',
-    //         // 如果要代理 websockets
-    //         ws: true,
-    //         // 将主机标头的原点更改为目标URL
-    //         changeOrigin: false
-    //     },
-    //     '/business-space': {
-    //         // 目标 API 地址
-    //         target: 'http://172.16.42.210:8080/',
-    //         // 如果要代理 websockets
-    //         ws: true,
-    //         // 将主机标头的原点更改为目标URL
-    //         changeOrigin: false
-    //     },
-    //     '/pointconfig': {
-    //         // 目标 API 地址
-    //         target: 'http://172.16.44.235:8080/',
-    //         // 如果要代理 websockets
-    //         ws: true,
-    //         // 将主机标头的原点更改为目标URL
-    //         changeOrigin: false
-    //     },
-    //     '/venders-dp': {
-    //         // 目标 API 地址
-    //         target: 'http://172.16.42.210:8080/',
-    //         // 如果要代理 websockets
-    //         ws: true,
-    //         // 将主机标头的原点更改为目标URL
-    //         changeOrigin: false
-    //     },
-    //     '/venders': {
-    //         // 目标 API 地址
-    //         target: 'http://172.16.42.210:8080/',
-    //         // 如果要代理 websockets
-    //         ws: true,
-    //         // 将主机标头的原点更改为目标URL
-    //         changeOrigin: false
-    //     },
-    //     '/ScanBuilding': {
-    //         // 目标 API 地址
-    //         target: 'http://172.16.44.235:8080/',
-    //         // 如果要代理 websockets
-    //         ws: true,
-    //         // 将主机标头的原点更改为目标URL
-    //         changeOrigin: false
-    //     },
-    // '/scanbuilding-2': {
-    //   // 目标 API 地址
-    //   target: 'http://mbi.sagacloud.cn:8080/',
-    //   // 如果要代理 websockets
-    //   ws: true,
-    //   // 将主机标头的原点更改为目标URL
-    //   changeOrigin: false
-    // },
-    //     '/image-service': {
-    //         // 目标 API 地址
-    //         target: 'http://172.16.42.210:8080/',
-    //         // 如果要代理 websockets
-    //         ws: true,
-    //         // 将主机标头的原点更改为目标URL
-    //         changeOrigin: false
-    //     },
-    //     '/modelapi': {
-    //         target: 'http://172.16.42.210:8082',
-    //         // target: 'http://192.168.20.218:8082',//景灏
-    //         changeOrigin: true,
-    //         pathRewrite: {
-    //             "^/modelapi": "/"
-    //         }
-    //     },
-    //     '/schedulerapi': {
-    //       target: 'http://172.16.42.210:8081',
-    //       changeOrigin: true,
-    //       pathRewrite: {
-    //           "^/schedulerapi": "/"
-    //       }
-    //     },
+    // proxyTable: {//正式环境
+    //   '/admin': {
+    //     target: 'http://mbi.sagacloud.cn:8080',
+    //     changeOrigin: true,
+    //     pathRewrite: {
+    //       "^/admin": "/"
+    //     }
+    //   },
+    //   '/api': {
+    //     target: 'http://mbi.sagacloud.cn:8080',
+    //     changeOrigin: true,
+    //     pathRewrite: {
+    //       "^/api": "/"
+    //     }
+    //   },
+    //   '/data-platform-3': {
+    //     // 目标 API 地址
+    //     target: 'http://api.sagacloud.cn/',
+    //     // 如果要代理 websockets
+    //     ws: true,
+    //     // 将主机标头的原点更改为目标URL
+    //     changeOrigin: false
+    //   },
+    //   '/business-space': {
+    //     // 目标 API 地址
+    //     target: 'http://api.sagacloud.cn',
+    //     changeOrigin: true,
+    //     pathRewrite: {
+    //       "^/business-space": "/dp-auxiliary/business-space/"
+    //     }
+    //   },
+    //   '/pointconfig': {
+    //     // 目标 API 地址
+    //     target: 'http://mbi.sagacloud.cn:8080/',
+    //     // 如果要代理 websockets
+    //     ws: true,
+    //     // 将主机标头的原点更改为目标URL
+    //     changeOrigin: false
+    //   },
+    //   '/venders-dp': {
+    //     // 目标 API 地址
+    //     target: 'http://api.sagacloud.cn',
+    //     changeOrigin: true,
+    //     pathRewrite: {
+    //       "^/venders-dp": "/dp-auxiliary/venders-dp/"
+    //     }
+    //   },
+    //   '/venders': {
+    //     // 目标 API 地址
+    //     target: 'http://api.sagacloud.cn',
+    //     changeOrigin: true,
+    //     pathRewrite: {
+    //       "^/venders": "/dp-auxiliary/venders/"
+    //     }
+    //   },
+    //   '/ScanBuilding': {
+    //     // 目标 API 地址
+    //     target: 'http://mbi.sagacloud.cn:8080/',
+    //     // 如果要代理 websockets
+    //     ws: true,
+    //     // 将主机标头的原点更改为目标URL
+    //     changeOrigin: false
+    //   },
+    //   '/scanbuilding-2': {
+    //     // 目标 API 地址
+    //     target: 'http://mbi.sagacloud.cn:8080/',
+    //     // 如果要代理 websockets
+    //     ws: true,
+    //     // 将主机标头的原点更改为目标URL
+    //     changeOrigin: false
+    //   },
+    //   '/image-service': {
+    //     // 目标 API 地址
+    //     target: 'http://api.sagacloud.cn',
+    //     changeOrigin: true,
+    //     pathRewrite: {
+    //       "^/image-service": "/dp-auxiliary/image-service/"
+    //     }
+    //   },
+    //   '/modelapi': {
+    //     target: 'http://mbi.sagacloud.cn:8080',
+    //     changeOrigin: true,
+    //     pathRewrite: {
+    //       "^/modelapi": "/revit-algorithm/"
+    //     }
+    //   },
+    //   '/schedulerapi': {
+    //     target: 'http://mbi.sagacloud.cn:8080',
+    //     changeOrigin: true,
+    //     pathRewrite: {
+    //         "^/schedulerapi": "/scheduler/"
+    //     }
+    //   },
     // },
 
+    proxyTable: {
+        '/admin': {
+            target: 'http://172.16.44.235:8080',
+            changeOrigin: true,
+            pathRewrite: {
+                "^/admin": "/"
+            }
+        },
+        '/api': {
+            target: 'http://172.16.44.235:8080',
+            changeOrigin: true,
+            pathRewrite: {
+                "^/api": "/"
+            }
+        },
+        '/data-platform-3': {
+            // 目标 API 地址
+            target: 'http://172.16.42.210:8080/',
+            // 如果要代理 websockets
+            ws: true,
+            // 将主机标头的原点更改为目标URL
+            changeOrigin: false
+        },
+        '/business-space': {
+            // 目标 API 地址
+            target: 'http://172.16.42.210:8080/',
+            // 如果要代理 websockets
+            ws: true,
+            // 将主机标头的原点更改为目标URL
+            changeOrigin: false
+        },
+        '/pointconfig': {
+            // 目标 API 地址
+            target: 'http://172.16.44.235:8080/',
+            // 如果要代理 websockets
+            ws: true,
+            // 将主机标头的原点更改为目标URL
+            changeOrigin: false
+        },
+        '/venders-dp': {
+            // 目标 API 地址
+            target: 'http://172.16.42.210:8080/',
+            // 如果要代理 websockets
+            ws: true,
+            // 将主机标头的原点更改为目标URL
+            changeOrigin: false
+        },
+        '/venders': {
+            // 目标 API 地址
+            target: 'http://172.16.42.210:8080/',
+            // 如果要代理 websockets
+            ws: true,
+            // 将主机标头的原点更改为目标URL
+            changeOrigin: false
+        },
+        '/ScanBuilding': {
+            // 目标 API 地址
+            target: 'http://172.16.44.235:8080/',
+            // 如果要代理 websockets
+            ws: true,
+            // 将主机标头的原点更改为目标URL
+            changeOrigin: false
+        },
+    '/scanbuilding-2': {
+      // 目标 API 地址
+      target: 'http://mbi.sagacloud.cn:8080/',
+      // 如果要代理 websockets
+      ws: true,
+      // 将主机标头的原点更改为目标URL
+      changeOrigin: false
+    },
+        '/image-service': {
+            // 目标 API 地址
+            target: 'http://172.16.42.210:8080/',
+            // 如果要代理 websockets
+            ws: true,
+            // 将主机标头的原点更改为目标URL
+            changeOrigin: false
+        },
+        '/modelapi': {
+            target: 'http://172.16.42.210:8082',
+            // target: 'http://192.168.20.218:8082',//景灏
+            changeOrigin: true,
+            pathRewrite: {
+                "^/modelapi": "/"
+            }
+        },
+        '/schedulerapi': {
+          target: 'http://172.16.42.210:8081',
+          changeOrigin: true,
+          pathRewrite: {
+              "^/schedulerapi": "/"
+          }
+        },
+    },
+
     // Various Dev Server settings
     host: '0.0.0.0', // can be overwritten by process.env.HOST
     port: 28080, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined

+ 18 - 9
src/components/config_point/ip_input.vue

@@ -1,14 +1,23 @@
 <template>
     <ul class="ipAdress">
-        <template v-for="(item,index) in ipAdress">
-            <li class="saga-border bg-write" :key="index">
-                <input type="text" @input="checkIpVal(item,index)" @keyup="turnIpPOS(item,index,$event)" v-model="item.value" ref="ipInput" @blur="setDefaultVal(item)">
-            </li>
-            <span v-if="!!value && index == 3" v-show="ProtocolType != 'opc'">:</span>
-            <li v-if="!!value && index == 3" v-show="ProtocolType != 'opc'" class="saga-border bg-write">
-                <input type="text" @input="checkIpVal(value[0],4)" @keyup="turnIpPOS(value[0],4,$event)" v-model="value[0].value" ref="ipInput" @blur="setDefaultVal(value)">
-            </li>
-        </template>
+<!--        <template v-for="(item,index) in ipAdress">-->
+<!--            <li class="saga-border bg-write" :key="index">-->
+<!--                <input type="text" @input="checkIpVal(item,index)" @keyup="turnIpPOS(item,index,$event)" v-model="item.value" ref="ipInput" @blur="setDefaultVal(item)">-->
+<!--            </li>-->
+<!--            <span v-if="!!value && index == 3" v-show="ProtocolType != 'opc'">:</span>-->
+<!--            <li v-if="!!value && index == 3" v-show="ProtocolType != 'opc'" class="saga-border bg-write">-->
+<!--                <input type="text" @input="checkIpVal(value[0],4)" @keyup="turnIpPOS(value[0],4,$event)" v-model="value[0].value" ref="ipInput" @blur="setDefaultVal(value)">-->
+<!--            </li>-->
+<!--        </template>-->
+      <template v-for="(item,index) in ipAdress">
+        <li class="saga-border bg-write" :key="index">
+          <input type="text" @input="checkIpVal(item,index)" @keyup="turnIpPOS(item,index,$event)" v-model="item.value" ref="ipInput" @blur="setDefaultVal(item)">
+        </li>
+        <span v-if="!!value && index == 3">:</span>
+        <li v-if="!!value && index == 3" class="saga-border bg-write">
+          <input type="text" @input="checkIpVal(value[0],4)" @keyup="turnIpPOS(value[0],4,$event)" v-model="value[0].value" ref="ipInput" @blur="setDefaultVal(value)">
+        </li>
+      </template>
     </ul>
 </template>
 <script>

+ 69 - 0
src/components/config_point/toolLibrary/detailDialog.vue

@@ -0,0 +1,69 @@
+<template>
+  <el-dialog :title="object.val" :visible.sync="dialogTableVisible" width="70%">
+    <el-table :data="gridData" border :header-cell-style="{background:'#F3F4F7'}">
+      <el-table-column type="index" label="序号" align="center" width="50"></el-table-column>
+      <el-table-column property="name" label="名称" show-overflow-tooltip align="center"></el-table-column>
+      <el-table-column property="address" label="软件" align="center" width="80">
+        <template slot-scope="scope">
+          <el-button type="text" @click="handleDown(scope.$index,scope.row)">下载</el-button>
+        </template>
+      </el-table-column>
+      <el-table-column property="date" label="特殊说明" align="center"></el-table-column>
+      <el-table-column property="name" label="适用厂家" align="center"></el-table-column>
+      <el-table-column property="address" label="使用说明" align="center" width="80">
+        <template slot-scope="scope">
+          <el-button type="text" @click="handleDown(scope.$index,scope.row)">下载</el-button>
+        </template>
+      </el-table-column>
+      <el-table-column property="address" label="配置示例" align="center" width="80">
+        <template slot-scope="scope">
+          <el-button type="text" @click="handleDown(scope.$index,scope.row)">下载</el-button>
+        </template>
+      </el-table-column>
+
+    </el-table>
+  </el-dialog>
+</template>
+
+<script>
+  export default {
+    name: "settingDialog",
+    data() {
+      return {
+        gridData: [{
+          date: '2016-05-02',
+          name: '王小虎',
+          address: '上海市普陀区金沙江路 1518 弄'
+        }, {
+          date: '2016-05-04',
+          name: '王小虎',
+          address: '上海市普陀区金沙江路 1518 弄'
+        }, {
+          date: '2016-05-01',
+          name: '王小虎',
+          address: '上海市普陀区金沙江路 1518 弄'
+        }, {
+          date: '2016-05-03',
+          name: '王小虎',
+          address: '上海市普陀区金沙江路 1518 弄'
+        }],
+        dialogTableVisible: false,
+        object: {}
+      };
+    },
+    methods: {
+      show(val) {
+        this.dialogTableVisible = true
+        this.object = val
+      },
+      handleDown(index, row) {
+
+      },
+
+    }
+  }
+</script>
+
+<style scoped>
+
+</style>

+ 192 - 0
src/components/config_point/toolLibrary/settingDialog.vue

@@ -0,0 +1,192 @@
+<template>
+  <el-dialog title="配置集成工具库" :visible.sync="dialogTableVisible" width="70%">
+    <el-button type="default" style="margin-bottom: 20px" @click="handleEdit">添加协议</el-button>
+    <el-table :data="gridData" border :header-cell-style="{background:'#F3F4F7'}">
+      <el-table-column type="index" label="序号" align="center" width="50"></el-table-column>
+      <el-table-column property="name" label="协议类型" show-overflow-tooltip align="center"></el-table-column>
+      <el-table-column property="name" label="名称" show-overflow-tooltip align="center"></el-table-column>
+      <el-table-column property="address" label="软件" align="center" width="80">
+        <template slot-scope="scope">
+          <el-button type="text" @click="handleDown(scope.$index,scope.row)">下载</el-button>
+        </template>
+      </el-table-column>
+      <el-table-column property="date" label="特殊说明" align="center"></el-table-column>
+      <el-table-column property="name" label="适用厂家" align="center"></el-table-column>
+      <el-table-column property="address" label="使用说明" align="center" width="80">
+        <template slot-scope="scope">
+          <el-button type="text" @click="handleDown(scope.$index,scope.row)">下载</el-button>
+        </template>
+      </el-table-column>
+      <el-table-column property="address" label="配置示例" align="center" width="80">
+        <template slot-scope="scope">
+          <el-button type="text" @click="handleDown(scope.$index,scope.row)">下载</el-button>
+        </template>
+      </el-table-column>
+      <el-table-column property="address" label="操作" align="center">
+        <template slot-scope="scope">
+          <el-button @click="handleEdit(scope.$index, scope.row)">编辑
+          </el-button>
+          <el-button type="danger" @click="handleDelete(scope.$index, scope.row)">删除
+          </el-button>
+        </template>
+      </el-table-column>
+    </el-table>
+    <el-dialog
+      width="40%"
+      :title="title"
+      :visible.sync="innerVisible"
+      append-to-body>
+      <el-form :model="form">
+        <el-form-item label="协议类型">
+          <el-select v-model="form.ProtocolType" filterable @change="handleChangeProtocolType"
+                     placeholder="请选择">
+            <el-option v-for="item in options" :key="item.value" :label="item.label"
+                       :value="item.value"></el-option>
+          </el-select>
+        </el-form-item>
+        <el-form-item label="协议名称">
+          <el-input v-model="form.name" autocomplete="off" placeholder="请输入协议名称,必须唯一" style="width: 220px"/>
+        </el-form-item>
+        <el-form-item label="上传软件版本">
+          <upload-files
+            v-model="form.copyright"
+            :readOnly="false"
+            :isShow="1"
+            :keys-arr="[]"
+            :show-file-list="false"
+            @change="changeItem"/>
+        </el-form-item>
+        <el-form-item label="特殊说明">
+          <el-input type="textarea" v-model="form.data1" :autosize="{ minRows: 4, maxRows: 4}" style="width: 220px"/>
+        </el-form-item>
+        <el-form-item label="适用厂家">
+          <el-input type="textarea" v-model="form.data2" :autosize="{ minRows: 4, maxRows: 4}" style="width: 220px"/>
+        </el-form-item>
+        <el-form-item label="使用说明">
+          <upload-files
+            v-model="form.see"
+            :readOnly="false"
+            :isShow="1"
+            :keys-arr="[]"
+            :show-file-list="false"
+            @change="changeItem"/>
+        </el-form-item>
+        <el-form-item label="配置实例">
+          <upload-files
+            v-model="form.new"
+            :readOnly="false"
+            :isShow="1"
+            :keys-arr="[]"
+            :show-file-list="false"
+            @change="changeItem"/>
+        </el-form-item>
+      </el-form>
+      <div slot="footer" class="dialog-footer">
+        <el-button @click="innerVisible = false">取 消</el-button>
+        <el-button type="primary">保 存</el-button>
+      </div>
+    </el-dialog>
+  </el-dialog>
+</template>
+
+<script>
+  import uploadFiles from "@/components/business_space/lib/uploadFiles";
+
+  export default {
+    name: "",
+    components: {uploadFiles},
+    data() {
+      return {
+        gridData: [{
+          date: '2016-05-02',
+          name: '王小虎',
+          address: '上海市普陀区金沙江路 1518 弄'
+        }, {
+          date: '2016-05-04',
+          name: '王小虎',
+          address: '上海市普陀区金沙江路 1518 弄'
+        }, {
+          date: '2016-05-01',
+          name: '王小虎',
+          address: '上海市普陀区金沙江路 1518 弄'
+        }, {
+          date: '2016-05-03',
+          name: '王小虎',
+          address: '上海市普陀区金沙江路 1518 弄'
+        }],
+        dialogTableVisible: false,
+        innerVisible: false,
+        title: '',
+        form: {
+          name: '',
+          ProtocolType: '',
+          copyright: '',
+          data1: '',
+          data2: '',
+          see: '',
+          new: ''
+        },
+        options: [
+          {
+            value: 'modbus-tcp',
+            label: 'Modbus TCP'
+          }, {
+            value: 'bacnet-ip',
+            label: 'BACNet IP'
+          }, {
+            value: 'opc',
+            label: 'OPC'
+          }, {
+            value: 'knx',
+            label: 'KNX'
+          }, {
+            value: 'mqtt',
+            label: 'MQTT'
+          }, {
+            value: 'amqp',
+            label: 'AMQP'
+          }, {
+            value: 'lora',
+            label: 'LoRa'
+          }, {
+            value: 'ems-collect',
+            label: 'ems-collect'
+          }, {
+            value: 'common',
+            label: '其他'
+          }],
+      };
+    },
+    methods: {
+      show() {
+        this.dialogTableVisible = true
+
+      },
+      handleDown(index, row) {
+
+      },
+      handleEdit(index, row) {
+        this.innerVisible = true
+        if (row) {
+          this.title = '编辑协议'
+        } else {
+          this.title = '添加协议'
+
+        }
+      },
+      handleDelete(index, row) {
+
+      },
+      handleChangeProtocolType(val) {
+
+      },
+      changeItem(val) {
+
+      }
+    }
+  }
+</script>
+
+<style scoped>
+
+</style>

+ 2 - 4
src/components/point/report/historyChart.vue

@@ -9,9 +9,7 @@
       </el-select>
     </div>
     <!-- 图表 -->
-    <div class="chart-area" ref="chart">
-
-    </div>
+    <div class="chart-area" ref="chart"></div>
   </div>
 </template>
 
@@ -186,4 +184,4 @@ export default {
 .chart-area {
   height: 450px;
 }
-</style>
+</style>

+ 22 - 23
src/components/point/report/tabFunNumOverview.vue

@@ -23,8 +23,8 @@
         <el-table-column prop='MeterFunc' label='表号-功能号' show-overflow-tooltip min-width="100" header-align='left'></el-table-column>
         <el-table-column prop='Data.Data' label='查看分精度' show-overflow-tooltip min-width="90" header-align='center' align='center'>
           <template slot-scope="scope">
-            <el-button style="padding:7px 15px;" @click="handleDrawer(scope.row, 0)"><i class="el-icon-s-data" style="font-size:15px;"></i>
-            </el-button>
+            <el-button style="padding:7px 15px;font-size:15px;" @click="handleDrawer(scope.row, 0)">
+              <i class="el-icon-s-data"/></el-button>
           </template>
         </el-table-column>
         <el-table-column prop='Data.Time' label='对应值 - 获取时间' show-overflow-tooltip min-width="270" header-align='center' align='center'
@@ -81,26 +81,25 @@
 </template>
 
 <script>
-import { Message } from 'element-ui';
-import {
-  getTabFunNumOverview
-} from '@/api/scan/request'
-import historyChart from './historyChart'
-import dataSource from './dataSource'
-import objectInstance from './objectInstance'
-import addTabFunNum from './addTabFunNum'
-import lStorage from '@/utils/localStorage'
-export default {
-  data() {
-    return {
-      //表格头样式
-      headerStyle: {
-        backgroundColor: '#e1e4e5',
-        color: '#2b2b2b',
-        lineHeight: '30px'
-      },
-      // allTableData: [],//所有表格数据
-      tableData: [],
+  import {Message} from 'element-ui';
+  import {getTabFunNumOverview} from '@/api/scan/request'
+  import historyChart from './historyChart'
+  import dataSource from './dataSource'
+  import objectInstance from './objectInstance'
+  import addTabFunNum from './addTabFunNum'
+  import lStorage from '@/utils/localStorage'
+
+  export default {
+    data() {
+      return {
+        //表格头样式
+        headerStyle: {
+          backgroundColor: '#e1e4e5',
+          color: '#2b2b2b',
+          lineHeight: '30px'
+        },
+        // allTableData: [],//所有表格数据
+        tableData: [],
       pageSizes: [10, 20, 50, 100],
       pageSize: 50,
       currentPage: 1,
@@ -252,4 +251,4 @@ export default {
 /deep/ .el-drawer__header>:first-child:focus{
   outline: none;
 }
-</style>
+</style>

+ 333 - 323
src/data/menus.js

@@ -1,326 +1,336 @@
 export default [
 	/******************** 平台管理 ***************************/
-	{
-		path: '/platform',
-		name: '平台管理',
-		disabled: true,
-	},
-	// 项目管理
-	{
-		path: '/platform/project',
-		name: '项目管理',
-		icon: 'icon-project-o'
-	},
-	// 人员管理
-	{
-		path: '/platform/user',
-		name: '人员管理',
-		icon: 'icon-renyuanguanli',
-		opts: [{
-			name: '查看',
-			basic: true,
-			permission: 'system:user:query'
-		}]
-	},
-	// 角色管理
-	{
-		path: '/platform/role',
-		name: '角色管理',
-		icon: 'icon-jiaoseguanli',
-		opts: [{
-			name: '查看',
-			basic: true,
-			permission: 'system:role:query'
-		}]
-	},
-	/******************** 前期准备 ***************************/
-	{
-		path: '/ready',
-		name: '前期准备',
-		disabled: true,
-	},
-	// 建筑楼层管理
-	{
-		path: '/ready/buildfloor',
-		name: '建筑楼层管理',
-		icon: 'icon-jianzhu'
-	},
-	// 需采集的信息点
-	{
-		path: '/ready/collectsetting',
-		name: '需采集的信息点',
-		icon: 'icon-xinxi'
-	},
-	// 扫楼App用户管理
-	{
-		path: '/ready/appuser',
-		name: '扫楼App用户管理',
-		icon: 'icon-app4'
-	},
-	/******************** 信息收集 ***************************/
-	{
-		path: '/information',
-		name: '信息收集',
-		disabled: true,
-	},
-	// 模型管理
-	{
-		path: '/model',
-		name: '模型管理',
-		icon: 'icon-moxing___',
-		children: [{
-			path: '/model/file',
-			name: '模型文件管理',
-			icon: '',
-			opts: [{
-				name: '查看',
-				basic: true,
-				permission: 'system:role:query'
-			}]
-		}, {
-			path: '/model/report',
-			name: '模型质量报告',
-			icon: '',
-			opts: [{
-				name: '查看',
-				basic: true,
-				permission: 'system:role:query'
-			}]
-		}]
-	},
-	// 系统集成
-	{
-		path: '/point',
-		name: '系统集成',
-		icon: 'icon-xitong',
-		children: [{
-			path: '/point/pointsetting',
-			name: '子系统点位接入',
-			icon: '',
-			opts: [{
-				name: '查看',
-				basic: true,
-				permission: 'system:role:query'
-			}]
-		}, {
-			path: '/point/dynamicdata',
-			name: '配置动参从点位取值',
-			icon: '',
-			opts: [{
-				name: '查看',
-				basic: true,
-				permission: 'system:role:query'
-			}]
-		},
-		// {
-		// 	path: '/point/objectdata',
-		// 	name: '配置动参从对象取值',
-		// 	icon: '',
-		// 	opts: [{
-		// 		name: '查看',
-		// 		basic: true,
-		// 		permission: 'system:role:query'
-		// 	}]
-		// },
-		{
-			path: '/point/report',
-			name: '系统集成成果管理',
-			icon: '',
-			opts: [{
-				name: '查看',
-				basic: true,
-				permission: 'system:role:query'
-			}]
-		}]
-	},
-	// 扫楼作业
-	{
-		path: '/floor',
-		name: '扫楼作业',
-		icon: 'icon-shanglou',
-		children: [{
-			path: '/floor/task',
-			name: '现场任务管理',
-			icon: '',
-			opts: [{
-				name: '查看',
-				basic: true,
-				permission: 'system:role:query'
-			}]
-		},{
-			path: '/floor/data',
-			name: '现场数据整理',
-			icon: '',
-			children: [ {
-				path: '/floor/data',
-				name: '信息点整理',
-				icon: '',
-				opts: [{
-					name: '查看',
-					basic: true,
-					permission: 'system:role:query'
-				}]
-			},
-			{
-				path: '/floor/plan',
-				name: '位置标签整理',
-				icon: '',
-				opts: [{
-					name: '查看',
-					basic: true,
-					permission: 'system:role:query'
-				}]
-			}]
-		}, {
-			path: '/floor/abnormalprop',
-			name: '扫楼报告',
-			icon: '',
-			opts: [{
-				name: '查看',
-				basic: true,
-				permission: 'system:role:query'
-			}]
-		}, {
-			path: '/floor/log',
-			name: '扫楼日志查看',
-			icon: '',
-			opts: [{
-				name: '查看',
-				basic: true,
-				permission: 'system:role:query'
-			}]
-		}]
-	},
-	// 台账管理
-	{
-		path: '/ledger',
-		name: '台账管理',
-		icon: 'icon-taizhangzhangbushezhi',
-		children: [{
-			path: '/ledger/facility',
-			name: '设备台账',
-			icon: '',
-			opts: [{
-				name: '查看',
-				basic: true,
-				permission: 'system:role:query'
-			}]
-		}, {
-			path: '/ledger/property',
-			name: '资产台账',
-			icon: '',
-			opts: [{
-				name: '查看',
-				basic: true,
-				permission: 'system:role:query'
-			}]
-		}, {
-			path: '/ledger/list',
-			name: '系统台账',
-			icon: '',
-			opts: [{
-				name: '查看',
-				basic: true,
-				permission: 'system:role:query'
-			}]
-		}, {
-			path: '/ledger/spacelist',
-			name: '业务空间台账',
-			icon: '',
-			opts: [{
-				name: '查看',
-				basic: true,
-				permission: 'system:role:query'
-			}]
-		}, {
-				path: '/ledger/cenotelist',
-				name: '竖井台账',
-				icon: '',
-				opts: [{
-					name: '查看',
-					basic: true,
-					permission: 'system:role:query'
-				}]
-		},{
-			path: '/ledger/rentlist',
-			name: '租户台账',
-			icon: '',
-			opts: [{
-				name: '查看',
-				basic: true,
-				permission: 'system:role:query'
-			}]
-		}, {
-			path: '/ledger/datareport',
-			name: '数据质量报告',
-			icon: '',
-			opts: [{
-				name: '查看',
-				basic: true,
-				permission: 'system:role:query'
-			}]
-		}]
-	},
-	/******************** 关系维护并计算 ***************************/
-	{
-		path: '/relation',
-		name: '关系维护并计算',
-		disabled: true,
-	},
-	// 关系维护
-	// {
-	// 	path: '/relation/maintain',
-	// 	name: '关系维护',
-	// 	icon: 'icon-guanxi',
-	// 	opts: [{
-	// 		name: '查看',
-	// 		basic: true,
-	// 		permission: 'system:user:query'
-	// 	}]
-	// },
-	// 全部关系总览
-	{
-		path: '/relation/overview',
-		name: '全部关系总览',
-		icon: 'icon-jiqixuexi-',
-		opts: [{
-			name: '查看',
-			basic: true,
-			permission: 'system:role:query'
-		}]
-	},
-	/******************** 数据项目化交付 ***************************/
-	{
-		path: '/deliver',
-		name: '数据项目化交付',
-		disabled: true,
-	},
-	// 项目数据转换
-	{
-		path: '/relation/data',
-		name: '项目数据转换',
-		icon: 'icon-view',
-		opts: [{
-			name: '查看',
-			basic: true,
-			permission: 'system:role:query'
-		}]
-	},
-	/******************** 通用字典 ***************************/
-	// {
-	// 	path: '/dictionaries',
-	// 	name: '通用字典',
-	// 	disabled: true,
-	// },
-	// // 厂家库
-	// {
-	// 	path: '/manufactor/supplier',
-	// 	name: '厂家库',
-	// 	icon: '',
-	// 	opts: [{
-	// 		name: '查看',
-	// 		basic: true,
-	// 		permission: 'system:role:query'
-	// 	}]
-	// }
+  {
+    path: '/platform',
+    name: '平台管理',
+    disabled: true,
+  },
+// 项目管理
+  {
+    path: '/platform/project',
+    name: '项目管理',
+    icon: 'icon-project-o'
+  },
+// 人员管理
+  {
+    path: '/platform/user',
+    name: '人员管理',
+    icon: 'icon-renyuanguanli',
+    opts: [{
+      name: '查看',
+      basic: true,
+      permission: 'system:user:query'
+    }]
+  },
+// 角色管理
+  {
+    path: '/platform/role',
+    name: '角色管理',
+    icon: 'icon-jiaoseguanli',
+    opts: [{
+      name: '查看',
+      basic: true,
+      permission: 'system:role:query'
+    }]
+  },
+  /******************** 前期准备 ***************************/
+  {
+    path: '/ready',
+    name: '前期准备',
+    disabled: true,
+  },
+// 建筑楼层管理
+  {
+    path: '/ready/buildfloor',
+    name: '建筑楼层管理',
+    icon: 'icon-jianzhu'
+  },
+// 需采集的信息点
+  {
+    path: '/ready/collectsetting',
+    name: '需采集的信息点',
+    icon: 'icon-xinxi'
+  },
+// 扫楼App用户管理
+  {
+    path: '/ready/appuser',
+    name: '扫楼App用户管理',
+    icon: 'icon-app4'
+  },
+  /******************** 信息收集 ***************************/
+  {
+    path: '/information',
+    name: '信息收集',
+    disabled: true,
+  },
+// 模型管理
+  {
+    path: '/model',
+    name: '模型管理',
+    icon: 'icon-moxing___',
+    children: [{
+      path: '/model/file',
+      name: '模型文件管理',
+      icon: '',
+      opts: [{
+        name: '查看',
+        basic: true,
+        permission: 'system:role:query'
+      }]
+    }, {
+      path: '/model/report',
+      name: '模型质量报告',
+      icon: '',
+      opts: [{
+        name: '查看',
+        basic: true,
+        permission: 'system:role:query'
+      }]
+    }]
+  },
+// 系统集成
+  {
+    path: '/point',
+    name: '系统集成',
+    icon: 'icon-xitong',
+    children: [{
+      path: '/point/pointsetting',
+      name: '子系统点位接入',
+      icon: '',
+      opts: [{
+        name: '查看',
+        basic: true,
+        permission: 'system:role:query'
+      }]
+    }, {
+      path: '/point/dynamicdata',
+      name: '配置动参从点位取值',
+      icon: '',
+      opts: [{
+        name: '查看',
+        basic: true,
+        permission: 'system:role:query'
+      }]
+    },
+      // {
+      // 	path: '/point/objectdata',
+      // 	name: '配置动参从对象取值',
+      // 	icon: '',
+      // 	opts: [{
+      // 		name: '查看',
+      // 		basic: true,
+      // 		permission: 'system:role:query'
+      // 	}]
+      // },
+      {
+        path: '/point/report',
+        name: '系统集成监测',
+        icon: '',
+        opts: [{
+          name: '查看',
+          basic: true,
+          permission: 'system:role:query'
+        }]
+      }, {
+        path: '/point/tool',
+        name: '系统工具库',
+        icon: '',
+        opts: [{
+          name: '查看',
+          basic: true,
+          permission: 'system:role:query'
+        }]
+      }
+    ]
+  },
+// 扫楼作业
+  {
+    path: '/floor',
+    name: '扫楼作业',
+    icon: 'icon-shanglou',
+    children: [{
+      path: '/floor/task',
+      name: '现场任务管理',
+      icon: '',
+      opts: [{
+        name: '查看',
+        basic: true,
+        permission: 'system:role:query'
+      }]
+    }, {
+      path: '/floor/data',
+      name: '现场数据整理',
+      icon: '',
+      children: [{
+        path: '/floor/data',
+        name: '信息点整理',
+        icon: '',
+        opts: [{
+          name: '查看',
+          basic: true,
+          permission: 'system:role:query'
+        }]
+      },
+        {
+          path: '/floor/plan',
+          name: '位置标签整理',
+          icon: '',
+          opts: [{
+            name: '查看',
+            basic: true,
+            permission: 'system:role:query'
+          }]
+        }]
+    }, {
+      path: '/floor/abnormalprop',
+      name: '扫楼报告',
+      icon: '',
+      opts: [{
+        name: '查看',
+        basic: true,
+        permission: 'system:role:query'
+      }]
+    }, {
+      path: '/floor/log',
+      name: '扫楼日志查看',
+      icon: '',
+      opts: [{
+        name: '查看',
+        basic: true,
+        permission: 'system:role:query'
+      }]
+    }]
+  },
+// 台账管理
+  {
+    path: '/ledger',
+    name: '台账管理',
+    icon: 'icon-taizhangzhangbushezhi',
+    children: [{
+      path: '/ledger/facility',
+      name: '设备台账',
+      icon: '',
+      opts: [{
+        name: '查看',
+        basic: true,
+        permission: 'system:role:query'
+      }]
+    }, {
+      path: '/ledger/property',
+      name: '资产台账',
+      icon: '',
+      opts: [{
+        name: '查看',
+        basic: true,
+        permission: 'system:role:query'
+      }]
+    }, {
+      path: '/ledger/list',
+      name: '系统台账',
+      icon: '',
+      opts: [{
+        name: '查看',
+        basic: true,
+        permission: 'system:role:query'
+      }]
+    }, {
+      path: '/ledger/spacelist',
+      name: '业务空间台账',
+      icon: '',
+      opts: [{
+        name: '查看',
+        basic: true,
+        permission: 'system:role:query'
+      }]
+    }, {
+      path: '/ledger/cenotelist',
+      name: '竖井台账',
+      icon: '',
+      opts: [{
+        name: '查看',
+        basic: true,
+        permission: 'system:role:query'
+      }]
+    }, {
+      path: '/ledger/rentlist',
+      name: '租户台账',
+      icon: '',
+      opts: [{
+        name: '查看',
+        basic: true,
+        permission: 'system:role:query'
+      }]
+    }, {
+      path: '/ledger/datareport',
+      name: '数据质量报告',
+      icon: '',
+      opts: [{
+        name: '查看',
+        basic: true,
+        permission: 'system:role:query'
+      }]
+    }]
+  },
+  /******************** 关系维护并计算 ***************************/
+  {
+    path: '/relation',
+    name: '关系维护并计算',
+    disabled: true,
+  },
+// 关系维护
+// {
+// 	path: '/relation/maintain',
+// 	name: '关系维护',
+// 	icon: 'icon-guanxi',
+// 	opts: [{
+// 		name: '查看',
+// 		basic: true,
+// 		permission: 'system:user:query'
+// 	}]
+// },
+// 全部关系总览
+  {
+    path: '/relation/overview',
+    name: '全部关系总览',
+    icon: 'icon-jiqixuexi-',
+    opts: [{
+      name: '查看',
+      basic: true,
+      permission: 'system:role:query'
+    }]
+  },
+  /******************** 数据项目化交付 ***************************/
+  {
+    path: '/deliver',
+    name: '数据项目化交付',
+    disabled: true,
+  },
+// 项目数据转换
+  {
+    path: '/relation/data',
+    name: '项目数据转换',
+    icon: 'icon-view',
+    opts: [{
+      name: '查看',
+      basic: true,
+      permission: 'system:role:query'
+    }]
+  },
+  /******************** 通用字典 ***************************/
+// {
+// 	path: '/dictionaries',
+// 	name: '通用字典',
+// 	disabled: true,
+// },
+// // 厂家库
+// {
+// 	path: '/manufactor/supplier',
+// 	name: '厂家库',
+// 	icon: '',
+// 	opts: [{
+// 		name: '查看',
+// 		basic: true,
+// 		permission: 'system:role:query'
+// 	}]
+// }
 ]

File diff suppressed because it is too large
+ 780 - 560
src/router/system.js


+ 312 - 0
src/views/point/config_point/edit_origin/dialog.vue

@@ -0,0 +1,312 @@
+<template>
+  <el-dialog :visible.sync="dialogVisible" :title="title" class="edit-origin-dialog">
+    <el-form style="width:400px;" :model="formData" class="dcenter" label-width="120px">
+      <!--                <el-form-item label="">-->
+      <!--                    <el-input v-model="formData.Name" placeholder="请输入数据源名称"></el-input>-->
+      <!--                </el-form-item>-->
+      <el-form-item label="接口名称">
+        <el-input v-model="formData.Name" placeholder="请输入接口名称"></el-input>
+      </el-form-item>
+      <!--            <el-input type="textarea" class="edit-textarea dcenter block" v-model="formData.Description" placeholder="请维护数据源说明"></el-input>-->
+      <el-form-item label="协议类型">
+        <el-select v-model="formData.ProtocolType" filterable @change="handleChangeProtocolType"
+                   placeholder="请选择">
+          <el-option v-for="item in options" :key="item.value" :label="item.label"
+                     :value="item.value"></el-option>
+        </el-select>
+      </el-form-item>
+      <el-form-item label="json格式" v-if="formData.ProtocolType == 'common'">
+        <el-input type="textarea" :autosize="{ minRows: 4, maxRows: 4}" v-model="ProtocolInfo"
+                  placeholder="请输入json格式数据"></el-input>
+      </el-form-item>
+      <!--                <el-form-item label="主机IP地址" v-if="formData.ProtocolType != 'common'">-->
+      <!--                    <ip-input :ip="formData.ProtocolInfo.Ip" :port="formData.ProtocolInfo.Port" :ProtocolType="formData.ProtocolType" @change="changeItem" @deletePort="deletePort"></ip-input>-->
+      <!--                </el-form-item>  -->
+      <el-form-item label="通讯地址/端口" v-if="formData.ProtocolType != 'common'">
+        <ip-input :ip="formData.ProtocolInfo.Ip" :port="formData.ProtocolInfo.Port"
+                  :ProtocolType="formData.ProtocolType" @change="changeItem" @deletePort="deletePort"></ip-input>
+      </el-form-item>
+      <template v-if="formData.ProtocolType =='ems-collect'">
+        <el-form-item label="TCP/UDP">
+          <el-select placeholder="请选择" v-model="tcpOptions">
+            <el-option v-for="item in tcpList" :key="item.value" :label="item.label" :value="item.value"/>
+          </el-select>
+        </el-form-item>
+        <el-form-item label="线程数">
+          <el-select placeholder="请选择" v-model="threadOptions">
+            <el-option v-for="item in threadList" :key="item.value" :label="item.label" :value="item.value"/>
+          </el-select>
+        </el-form-item>
+        <el-form-item label="HBase库名">
+          <el-input/>
+        </el-form-item>
+        <el-form-item label="zookeeper">
+          <el-input/>
+        </el-form-item>
+      </template>
+      <template
+        v-if="formData.ProtocolType == 'opc' ||formData.ProtocolType == 'mqtt' || formData.ProtocolType == 'amqp'  ">
+        <el-form-item label="用户名">
+          <el-input v-model="formData.ProtocolInfo.User"></el-input>
+        </el-form-item>
+        <el-form-item label="密码">
+          <el-input v-model="formData.ProtocolInfo.Password"></el-input>
+        </el-form-item>
+      </template>
+      <el-form-item label="ProgId" v-if="formData.ProtocolType == 'opc'">
+        <el-input v-model="formData.ProtocolInfo.ProgId"></el-input>
+      </el-form-item>
+
+      <el-form-item label="采集间隔(s)" v-if="formData.ProtocolType != 'ems-collect'">
+        <el-input-number v-model="formData.CollectInterval" controls-position="right" :min="10"></el-input-number>
+      </el-form-item>
+      <el-form-item label="通讯模式" v-if="formData.ProtocolType != 'common'  && formData.ProtocolType != 'ems-collect' ">
+        <el-select filterable>
+          <el-option></el-option>
+        </el-select>
+      </el-form-item>
+      <el-form-item label="网络类型">
+        <el-select v-model="formData.wangluo" filterable @change="handleChangeNetType" placeholder="请选择">
+          <el-option v-for="item in netOptons" :key="item.value" :label="item.label"
+                     :value="item.value"></el-option>
+        </el-select>
+      </el-form-item>
+
+      <el-form-item label="描述">
+        <el-input type="textarea" v-model="formData.Description" :autosize="{ minRows: 4, maxRows: 4}"
+                  placeholder="请输入描述内容,200个字以内"></el-input>
+      </el-form-item>
+      <el-form-item>
+        <el-button :disabled="formData.wangluo =='jianjie'?true:false">测试</el-button>
+        <el-button @click="dialogVisible = false">取消</el-button>
+        <el-button type="primary">保存</el-button>
+      </el-form-item>
+      <el-form-item label="测试日志">
+        <el-input type="textarea" v-model="formData.ceshi" :autosize="{ minRows: 4, maxRows: 4}"
+                  disabled></el-input>
+      </el-form-item>
+
+
+    </el-form>
+
+  </el-dialog>
+</template>
+
+<script>
+  import ipInput from "@/components/config_point/ip_input"
+  // import bread from "components/common/bread_crumb"
+  import tools from "@/utils/tools"
+  import {createDataSource, queryDataSource, updateDataSource} from "@/fetch/point_http"
+  import {mapGetters} from "vuex";
+
+  export default {
+    computed: {
+      ...mapGetters("layout", [
+        "projectId"
+      ])
+    },
+    data() {
+      return {
+        dialogVisible: false,
+        title: '',
+        formData: {
+          ProtocolType: "", //协议类型
+          ProtocolStandarded: true,
+          Name: "",
+          ProtocolInfo: {
+            Ip: "", //ip
+            Port: "", //端口号,有些协议类型没有该信息
+            User: "", //用户名
+            Password: "", //密码
+            ProgId: "", //progId
+          },
+          Description: "",
+          CollectInterval: 10
+        },
+        ProtocolInfo: "",//自定义协议信息
+        options: [
+          {
+            value: 'modbus-tcp',
+            label: 'Modbus TCP'
+          }, {
+            value: 'bacnet-ip',
+            label: 'BACNet IP'
+          }, {
+            value: 'opc',
+            label: 'OPC'
+          }, {
+            value: 'knx',
+          label: 'KNX'
+        }, {
+          value: 'mqtt',
+          label: 'MQTT'
+        }, {
+          value: 'amqp',
+          label: 'AMQP'
+        }, {
+          value: 'lora',
+          label: 'LoRa'
+        }, {
+          value: 'ems-collect',
+          label: 'ems-collect'
+        }, {
+          value: 'common',
+          label: '其他'
+        }],
+        netOptons: [
+          {
+            value: 'zhilian',
+            label: '直连'
+          }, {
+            value: 'jianjie',
+            label: '间接'
+          },
+        ],
+        tcpList: [
+          {value: 1, label: 'TCP'},
+          {value: 0, label: 'UDP'}
+        ],
+        threadList: [
+          {value: 1, label: 1},
+          {value: 2, label: 2},
+          {value: 4, label: 4},
+          {value: 8, label: 8}
+        ],
+        threadOptions: '', //临时存储
+        tcpOptions: '',//临时存储
+      }
+    },
+    components: {
+      ipInput,
+    },
+
+    methods: {
+      openDialog(obj) {
+        this.dialogVisible = true
+        this.title = obj ? '编辑数据源' : '添加数据源'
+        this.getDataSouse(obj)
+
+      },
+      changeItem(ip, port) {
+        this.formData.ProtocolInfo.Ip = ip
+        this.formData.ProtocolInfo.Port = port
+      },
+      handleChangeProtocolType(val) {//切换协议类型
+        switch (val) {
+          case 'modbus-tcp':
+          case 'bacnet-ip':
+          case 'knx':
+          case 'lora':
+            break
+          case 'opc' :
+            break
+          case 'mqtt':
+          case 'amqp':
+            break
+          case 'ems-collect':
+            break
+          case 'common':
+            this.formData.ProtocolStandarded = false
+            break
+
+        }
+
+      },
+      handleChangeNetType(val) { //网络类型
+        console.log(val)
+
+      },
+      getDataSouse(item) {
+        this.formData = {}
+        let param = {
+          Filters: {
+            Id: item.Id
+          },
+          "PageNumber": 1,
+          "PageSize": 50,
+          "Projection": []
+        }
+        queryDataSource(param, res => {
+
+          let data = res.Content[0]
+          data.ProtocolType = data.ProtocolType == '其他' ? 'common' : data.ProtocolType
+          this.formData = data
+          if (!this.formData.ProtocolInfo) {
+            //信息点为空时
+            this.formData.ProtocolInfo = {
+              "Ip": "", //ip
+              "Port": "",
+              "User": "", //用户名
+              "Password": "", //密码
+              "ProgId": "", //progId
+            }
+          } else {
+            //有信息点时
+            this.ProtocolInfo = JSON.stringify(data.ProtocolInfo)
+            debugger
+          }
+          this.handleChangeProtocolType(data.ProtocolType)
+        })
+      },
+      btnClick() {
+        console.log(this.formData, "form")
+        let param = tools.deepCopy(this.formData)
+        tools.delObjKey(param, "CreateTime")
+        tools.delObjKey(param, "LastUpdate")
+        if (param.ProtocolType == 'common') {
+          try {
+            let ProtocolInfo = JSON.parse(this.ProtocolInfo)
+            param.ProtocolInfo = ProtocolInfo
+          } catch (err) {
+            this.$message.error("属性详情格式错误!")
+            return false
+          }
+        }
+        if (!!this.id) {
+          console.log(param.ProtocolInfo.Port)
+          if (param.ProtocolInfo.hasOwnProperty("Port") && param.ProtocolInfo.Port == "") {
+            delete param.ProtocolType.Port
+          }
+          updateDataSource({
+            Content: [param],
+            Projection: []
+          }, res => {
+            console.log(res, 'res')
+            this.$router.push({
+              path: '/point/pointsetting'
+            })
+            this.$message.success("更新成功!")
+          })
+        } else {
+          // param.ProjectId = this.projectId
+          console.log(param, "param")
+          createDataSource(param, res => {
+            console.log(res)
+            this.$router.push({
+              path: '/point/pointsetting'
+            })
+            this.$message.success("创建成功!")
+          })
+        }
+      },
+      deletePort() {
+        this.formData.ProtocolInfo.Port = ""
+      }
+    },
+    watch: {
+      projectId() {
+        this.$router.push({
+          path: '/point/pointsetting'
+        })
+      }
+    }
+  }
+</script>
+
+<style scoped lang="less">
+  .edit-origin-dialog {
+    /deep/ .el-select > .el-input {
+      width: 282px;
+    }
+  }
+</style>

+ 239 - 157
src/views/point/config_point/edit_origin/index.vue

@@ -6,107 +6,151 @@
             <el-button class="btn" @click="btnClick">{{ id? '保存修改': '新建'}}</el-button>
         </div>
         <div class="content-view">
-            <el-form label-width="10px" style="width:400px;" :model="formData" class="dcenter">
-                <el-form-item label="">
-                    <el-input v-model="formData.Name" placeholder="请输入数据源名称"></el-input>
-                </el-form-item>
-            </el-form>
-            <el-input type="textarea" class="edit-textarea dcenter block" v-model="formData.Description" placeholder="请维护数据源说明"></el-input>
-            <el-form label-width="120px" style="width:400px;" :model="formData" class="dcenter">
-                <el-form-item label="协议类型">
-                    <el-select v-model="formData.ProtocolType" filterable @change="handleChangeProtocolType" placeholder="请选择">
-                        <el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value"></el-option>
-                    </el-select>
-                </el-form-item>
-                <el-form-item label="主机IP地址" v-if="formData.ProtocolType != 'common'">
-                    <ip-input :ip="formData.ProtocolInfo.Ip" :port="formData.ProtocolInfo.Port" :ProtocolType="formData.ProtocolType" @change="changeItem" @deletePort="deletePort"></ip-input>
-                </el-form-item>
-                <el-form-item label="用户名/密码" v-if="(passWordArr.indexOf(formData.ProtocolType) > -1)">
-                    <el-input v-model="formData.ProtocolInfo.User" style="display:inline-block;width:100px;"></el-input>/
-                    <el-input v-model="formData.ProtocolInfo.Password" style="display:inline-block;width:100px;"></el-input>
-                </el-form-item>
-                <el-form-item label="ProgId" v-if="formData.ProtocolType == 'opc'">
-                    <el-input v-model="formData.ProtocolInfo.ProgId" style="display:inline-block;width:100px;"></el-input>
-                </el-form-item>
-                <el-form-item label="属性详情" v-if="formData.ProtocolType == 'common'">
-                    <el-input type="textarea" :autosize="{ minRows: 8, maxRows: 8}" v-model="ProtocolInfo"  placeholder="请输入json格式数据" style="display:inline-block;width:400px;"> </el-input>
-                </el-form-item>
-                <el-form-item label="采集间隔时间">
-                    <el-input-number v-model="formData.CollectInterval" controls-position="right" @change="handleChange" :min="10"></el-input-number>&nbsp;&nbsp;s
-                </el-form-item>
+          <el-form style="width:400px;" :model="formData" class="dcenter" label-width="120px">
+            <!--                <el-form-item label="">-->
+            <!--                    <el-input v-model="formData.Name" placeholder="请输入数据源名称"></el-input>-->
+            <!--                </el-form-item>-->
+            <el-form-item label="接口名称">
+              <el-input v-model="formData.Name" placeholder="请输入接口名称"></el-input>
+            </el-form-item>
+            <!--            <el-input type="textarea" class="edit-textarea dcenter block" v-model="formData.Description" placeholder="请维护数据源说明"></el-input>-->
+            <el-form-item label="协议类型">
+              <el-select v-model="formData.ProtocolType" filterable @change="handleChangeProtocolType"
+                         placeholder="请选择">
+                <el-option v-for="item in options" :key="item.value" :label="item.label"
+                           :value="item.value"></el-option>
+              </el-select>
+            </el-form-item>
+            <!--                <el-form-item label="主机IP地址" v-if="formData.ProtocolType != 'common'">-->
+            <!--                    <ip-input :ip="formData.ProtocolInfo.Ip" :port="formData.ProtocolInfo.Port" :ProtocolType="formData.ProtocolType" @change="changeItem" @deletePort="deletePort"></ip-input>-->
+            <!--                </el-form-item>  -->
+            <el-form-item label="通讯地址/端口" v-if="formData.ProtocolType != 'common'">
+              <ip-input :ip="formData.ProtocolInfo.Ip" :port="formData.ProtocolInfo.Port"
+                        :ProtocolType="formData.ProtocolType" @change="changeItem" @deletePort="deletePort"></ip-input>
+            </el-form-item>
+            <el-form-item label="采集间隔(s)" v-if="formData.ProtocolType != 'ems-collect'">
+              <el-input-number v-model="formData.CollectInterval" controls-position="right" :min="10"></el-input-number>
+            </el-form-item>
+            <el-form-item label="通讯模式"
+                          v-if="formData.ProtocolType != 'common'  && formData.ProtocolType != 'ems-collect' ">
+              <el-select filterable>
+                <el-option></el-option>
+              </el-select>
+            </el-form-item>
+            <el-form-item label="网络类型">
+              <el-select v-model="formData.wangluo" filterable @change="handleChangeNetType" placeholder="请选择">
+                <el-option v-for="item in netOptons" :key="item.value" :label="item.label"
+                           :value="item.value"></el-option>
+              </el-select>
+            </el-form-item>
+            <el-form-item label="描述">
+              <el-input type="textarea" v-model="formData.Description" :autosize="{ minRows: 4, maxRows: 4}"
+                        placeholder="请输入描述内容,200个字以内"></el-input>
+            </el-form-item>
+            <el-form-item>
+              <el-button :disabled="formData.wangluo =='jianjie'?true:false">测试</el-button>
+              <el-button>取消</el-button>
+              <el-button type="primary">保存</el-button>
+            </el-form-item>
+            <el-form-item label="测试日志">
+              <el-input type="textarea" v-model="formData.ceshi" :autosize="{ minRows: 4, maxRows: 4}"
+                        disabled></el-input>
+            </el-form-item>
+            <el-form-item label="用户名/密码" v-if="(passWordArr.indexOf(formData.ProtocolType) > -1)">
+              <el-input v-model="formData.ProtocolInfo.User" style="display:inline-block;width:100px;"></el-input>
+              /
+              <el-input v-model="formData.ProtocolInfo.Password" style="display:inline-block;width:100px;"></el-input>
+            </el-form-item>
+            <el-form-item label="ProgId" v-if="formData.ProtocolType == 'opc'">
+              <el-input v-model="formData.ProtocolInfo.ProgId" style="display:inline-block;width:100px;"></el-input>
+            </el-form-item>
+            <el-form-item label="属性详情" v-if="formData.ProtocolType == 'common'">
+              <el-input type="textarea" :autosize="{ minRows: 8, maxRows: 8}" v-model="ProtocolInfo"
+                        placeholder="请输入json格式数据" style="display:inline-block;width:400px;"></el-input>
+            </el-form-item>
+
             </el-form>
         </div>
     </div>
 </template>
 <script>
-    import ipInput from "@/components/config_point/ip_input"
-    // import bread from "components/common/bread_crumb"
-    import tools from "@/utils/tools"
-    import {
-        queryDataSource,
-        updateDataSource,
-        createDataSource
-    } from "@/fetch/point_http"
-    import {
-        mapGetters,
-        mapActions
-    } from "vuex";
-    export default {
-        computed: {
-            ...mapGetters("layout", [
-                "projectId"
-            ])
-        },
-        data() {
-            return {
-                passWordArr: ['mqtt', 'amqp', 'opc'],
-                formData: {
-                    ProtocolType: "", //协议类型
-                    ProtocolStandarded: true,
-                    Name: "",
-                    ProtocolInfo: {
-                        Ip: "", //ip
-                        Port: "", //端口号,有些协议类型没有该信息
-                        User: "", //用户名
-                        Password: "", //密码
-                        ProgId: "", //progId
-                    },
-                    Description: "",
-                    CollectInterval: 10
-                },
-                ProtocolInfo:"",//自定义协议信息
-                options: [{
-                    value: 'modbus-tcp',
-                    label: 'Modbus TCP'
-                }, {
-                    value: 'bacnet-ip',
-                    label: 'BACNet IP'
-                }, {
-                    value: 'opc',
-                    label: 'OPC'
-                }, {
-                    value: 'knx',
-                    label: 'KNX'
-                }, {
-                    value: 'mqtt',
-                    label: 'MQTT'
-                }, {
-                    value: 'amqp',
-                    label: 'AMQP'
-                }, {
-                    value: 'common',
-                    label: '其他'
-                }],
-                id: this.$route.query.key
-            }
+  import ipInput from "@/components/config_point/ip_input"
+  // import bread from "components/common/bread_crumb"
+  import tools from "@/utils/tools"
+  import {createDataSource, queryDataSource, updateDataSource} from "@/fetch/point_http"
+  import {mapGetters} from "vuex";
+
+  export default {
+    computed: {
+      ...mapGetters("layout", [
+        "projectId"
+      ])
+    },
+    data() {
+      return {
+        passWordArr: ['mqtt', 'amqp', 'opc'],
+        formData: {
+          ProtocolType: "", //协议类型
+          ProtocolStandarded: true,
+          Name: "",
+          ProtocolInfo: {
+            Ip: "", //ip
+            Port: "", //端口号,有些协议类型没有该信息
+            User: "", //用户名
+            Password: "", //密码
+            ProgId: "", //progId
+          },
+          Description: "",
+          CollectInterval: 10
         },
-        components: {
-            ipInput,
-            // bread
-        },
-        created() {
-            this.$store.dispatch('setBreadcrumb', [{
-                label: '系统集成',
+        ProtocolInfo: "",//自定义协议信息
+        options: [{
+          value: 'modbus-tcp',
+          label: 'Modbus TCP'
+        }, {
+          value: 'bacnet-ip',
+          label: 'BACNet IP'
+        }, {
+          value: 'opc',
+          label: 'OPC'
+        }, {
+          value: 'knx',
+          label: 'KNX'
+        }, {
+          value: 'mqtt',
+          label: 'MQTT'
+        }, {
+          value: 'amqp',
+          label: 'AMQP'
+        }, {
+          value: 'lora',
+          label: 'LoRa'
+        }, {
+          value: 'ems-collect',
+          label: 'ems-collect'
+        }, {
+          value: 'common',
+          label: '其他'
+        }],
+        netOptons: [
+          {
+            value: 'zhilian',
+            label: '直连'
+          }, {
+            value: 'jianjie',
+            label: '间接'
+          },
+        ],
+        id: this.$route.query.key
+      }
+    },
+    components: {
+      ipInput,
+      // bread
+    },
+    created() {
+      this.$store.dispatch('setBreadcrumb', [{
+        label: '系统集成',
                 path: '/point/pointsetting'
             }, {
                 label: '子系统点位接入',
@@ -121,46 +165,72 @@
             }
         },
         methods: {
-            changeItem(ip, port) {
-                this.formData.ProtocolInfo.Ip = ip
-                this.formData.ProtocolInfo.Port = port
-            },
-            handleChangeProtocolType(val){//切换协议类型
-                if(val == 'common'){
-                    this.formData.ProtocolStandarded = false
-                } else {
-                    this.formData.ProtocolStandarded = true
-                }
-            },
-            getDataSouse() {
-                let param = {
-                    Filters: {
-                        Id: this.id
-                    },
-                    "PageNumber": 1,
-                    "PageSize": 50,
-                    "Projection": []
+          changeItem(ip, port) {
+            this.formData.ProtocolInfo.Ip = ip
+            this.formData.ProtocolInfo.Port = port
+          },
+          handleChangeProtocolType(val) {//切换协议类型
+            switch (val) {
+              case 'modbus-tcp':
+              case 'bacnet-ip':
+              case 'knx':
+              case 'lora':
+                break
+              case 'opc' :
+                break
+              case 'mqtt':
+              case 'amqp':
+                break
+              case 'ems-collect':
+                break
+              case 'common':
+                this.formData.ProtocolStandarded = false
+                break
+
+            }
+            // if (val == 'common') {
+            //   this.formData.ProtocolStandarded = false
+            // } else {
+            //   this.formData.ProtocolStandarded = true
+            // }
+          },
+          handleChangeNetType(val) { //网络类型
+            console.log(val)
+
+          },
+          getDataSouse() {
+            debugger
+            let param = {
+              Filters: {
+                Id: this.id
+              },
+              "PageNumber": 1,
+              "PageSize": 50,
+              "Projection": []
+            }
+            queryDataSource(param, res => {
+              let data = res.Content[0]
+              if (!data.ProtocolInfo) {
+                //信息点为空时
+                data.ProtocolInfo = {
+                  "Ip": "", //ip
+                  "Port": "",
+                  "User": "", //用户名
+                  "Password": "", //密码
+                  "ProgId": "", //progId
                 }
-                queryDataSource(param, res => {
-                    let data = res.Content[0]
-                    if (!data.ProtocolInfo) {
-                        //信息点为空时
-                        data.ProtocolInfo = {
-                            "Ip": "", //ip
-                            "Port": "",
-                            "User": "", //用户名
-                            "Password": "", //密码
-                            "ProgId": "", //progId
-                        }
-                    } else {
-                        //有信息点时
-                        this.ProtocolInfo = JSON.stringify(data.ProtocolInfo)
-                    }
-                    this.formData = data
-                    console.log(this.formData, "formData")
-                })
-            },
-            btnClick() {
+              } else {
+                //有信息点时
+                this.ProtocolInfo = JSON.stringify(data.ProtocolInfo)
+              }
+              this.formData = data
+
+              data.ProtocolType = data.ProtocolType == '其他' ? 'common':data.ProtocolType
+              this.handleChangeProtocolType( data.ProtocolType)
+              console.log(this.formData, "formData")
+            })
+          },
+          btnClick() {
                 console.log(this.formData, "form")
                 let param = tools.deepCopy(this.formData)
                 tools.delObjKey(param, "CreateTime")
@@ -205,36 +275,48 @@
                 this.formData.ProtocolInfo.Port = ""
             }
         },
-        watch: {
-            projectId(){
-                this.$router.push({
-                    path: '/point/pointsetting'
-                })
-            }
-        }
+    watch: {
+      projectId() {
+        this.$router.push({
+          path: '/point/pointsetting'
+        })
+      }
     }
+  }
 </script>
 <style lang="scss">
-    .margin-view {
-        height: 60px;
-    }
-    .btn-view {
-        overflow: hidden;
-        .btn {
-            float: right;
-            margin-right: 40px;
-        }
+  .margin-view {
+    height: 60px;
+  }
+
+  .btn-view {
+    overflow: hidden;
+
+    .btn {
+      float: right;
+      margin-right: 40px;
     }
+  }
     .content-view {
         width: 928px;
         margin: auto;
-        .edit-textarea {
-            margin: 8px 0 22px 0;
-            height: 117px;
-            textarea {
-                height: 100%;
-                background-color: #EEFAFF;
-            }
+
+      .edit-textarea {
+        margin: 8px 0 22px 0;
+        height: 117px;
+
+        textarea {
+          height: 100%;
+          background-color: #EEFAFF;
         }
+      }
+    }
+</style>
+<style lang="less" scoped>
+  .content-view {
+
+    /deep/ .el-select > .el-input {
+      width: 282px;
     }
+  }
 </style>

+ 240 - 0
src/views/point/config_point/edit_origin/index1.vue

@@ -0,0 +1,240 @@
+<template>
+    <div>
+        <!-- <bread></bread> -->
+        <div class="margin-view"></div>
+        <div class="btn-view">
+            <el-button class="btn" @click="btnClick">{{ id? '保存修改': '新建'}}</el-button>
+        </div>
+        <div class="content-view">
+            <el-form label-width="10px" style="width:400px;" :model="formData" class="dcenter">
+                <el-form-item label="">
+                    <el-input v-model="formData.Name" placeholder="请输入数据源名称"></el-input>
+                </el-form-item>
+            </el-form>
+            <el-input type="textarea" class="edit-textarea dcenter block" v-model="formData.Description" placeholder="请维护数据源说明"></el-input>
+            <el-form label-width="120px" style="width:400px;" :model="formData" class="dcenter">
+                <el-form-item label="协议类型">
+                    <el-select v-model="formData.ProtocolType" filterable @change="handleChangeProtocolType" placeholder="请选择">
+                        <el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value"></el-option>
+                    </el-select>
+                </el-form-item>
+                <el-form-item label="主机IP地址" v-if="formData.ProtocolType != 'common'">
+                    <ip-input :ip="formData.ProtocolInfo.Ip" :port="formData.ProtocolInfo.Port" :ProtocolType="formData.ProtocolType" @change="changeItem" @deletePort="deletePort"></ip-input>
+                </el-form-item>
+                <el-form-item label="用户名/密码" v-if="(passWordArr.indexOf(formData.ProtocolType) > -1)">
+                    <el-input v-model="formData.ProtocolInfo.User" style="display:inline-block;width:100px;"></el-input>/
+                    <el-input v-model="formData.ProtocolInfo.Password" style="display:inline-block;width:100px;"></el-input>
+                </el-form-item>
+                <el-form-item label="ProgId" v-if="formData.ProtocolType == 'opc'">
+                    <el-input v-model="formData.ProtocolInfo.ProgId" style="display:inline-block;width:100px;"></el-input>
+                </el-form-item>
+                <el-form-item label="属性详情" v-if="formData.ProtocolType == 'common'">
+                    <el-input type="textarea" :autosize="{ minRows: 8, maxRows: 8}" v-model="ProtocolInfo"  placeholder="请输入json格式数据" style="display:inline-block;width:400px;"> </el-input>
+                </el-form-item>
+                <el-form-item label="采集间隔时间">
+                    <el-input-number v-model="formData.CollectInterval" controls-position="right" @change="handleChange" :min="10"></el-input-number>&nbsp;&nbsp;s
+                </el-form-item>
+            </el-form>
+        </div>
+    </div>
+</template>
+<script>
+    import ipInput from "@/components/config_point/ip_input"
+    // import bread from "components/common/bread_crumb"
+    import tools from "@/utils/tools"
+    import {
+        queryDataSource,
+        updateDataSource,
+        createDataSource
+    } from "@/fetch/point_http"
+    import {
+        mapGetters,
+        mapActions
+    } from "vuex";
+    export default {
+        computed: {
+            ...mapGetters("layout", [
+                "projectId"
+            ])
+        },
+        data() {
+            return {
+                passWordArr: ['mqtt', 'amqp', 'opc'],
+                formData: {
+                    ProtocolType: "", //协议类型
+                    ProtocolStandarded: true,
+                    Name: "",
+                    ProtocolInfo: {
+                        Ip: "", //ip
+                        Port: "", //端口号,有些协议类型没有该信息
+                        User: "", //用户名
+                        Password: "", //密码
+                        ProgId: "", //progId
+                    },
+                    Description: "",
+                    CollectInterval: 10
+                },
+                ProtocolInfo:"",//自定义协议信息
+                options: [{
+                    value: 'modbus-tcp',
+                    label: 'Modbus TCP'
+                }, {
+                    value: 'bacnet-ip',
+                    label: 'BACNet IP'
+                }, {
+                    value: 'opc',
+                    label: 'OPC'
+                }, {
+                    value: 'knx',
+                    label: 'KNX'
+                }, {
+                    value: 'mqtt',
+                    label: 'MQTT'
+                }, {
+                    value: 'amqp',
+                    label: 'AMQP'
+                }, {
+                    value: 'common',
+                    label: '其他'
+                }],
+                id: this.$route.query.key
+            }
+        },
+        components: {
+            ipInput,
+            // bread
+        },
+        created() {
+            this.$store.dispatch('setBreadcrumb', [{
+                label: '系统集成',
+                path: '/point/pointsetting'
+            }, {
+                label: '子系统点位接入',
+                path: '/point/pointsetting'
+            }, {
+                label: this.id ? '编辑数据源' : '添加数据源'
+            }])
+        },
+        mounted() {
+            if (!!this.id) {
+                this.getDataSouse()
+            }
+        },
+        methods: {
+            changeItem(ip, port) {
+                this.formData.ProtocolInfo.Ip = ip
+                this.formData.ProtocolInfo.Port = port
+            },
+            handleChangeProtocolType(val){//切换协议类型
+                if(val == 'common'){
+                    this.formData.ProtocolStandarded = false
+                } else {
+                    this.formData.ProtocolStandarded = true
+                }
+            },
+            getDataSouse() {
+                let param = {
+                    Filters: {
+                        Id: this.id
+                    },
+                    "PageNumber": 1,
+                    "PageSize": 50,
+                    "Projection": []
+                }
+                queryDataSource(param, res => {
+                    let data = res.Content[0]
+                    if (!data.ProtocolInfo) {
+                        //信息点为空时
+                        data.ProtocolInfo = {
+                            "Ip": "", //ip
+                            "Port": "",
+                            "User": "", //用户名
+                            "Password": "", //密码
+                            "ProgId": "", //progId
+                        }
+                    } else {
+                        //有信息点时
+                        this.ProtocolInfo = JSON.stringify(data.ProtocolInfo)
+                    }
+                    this.formData = data
+                    console.log(this.formData, "formData")
+                })
+            },
+            btnClick() {
+                console.log(this.formData, "form")
+                let param = tools.deepCopy(this.formData)
+                tools.delObjKey(param, "CreateTime")
+                tools.delObjKey(param, "LastUpdate")
+                if(param.ProtocolType == 'common'){
+                    try{
+                        let ProtocolInfo = JSON.parse(this.ProtocolInfo)
+                        param.ProtocolInfo = ProtocolInfo
+                    } catch (err) {
+                        this.$message.error("属性详情格式错误!")
+                        return false
+                    }
+                }
+                if (!!this.id) {
+                    console.log(param.ProtocolInfo.Port)
+                    if (param.ProtocolInfo.hasOwnProperty("Port") && param.ProtocolInfo.Port == "") {
+                        delete param.ProtocolType.Port
+                    }
+                    updateDataSource({
+                        Content: [param],
+                        Projection: []
+                    }, res => {
+                        console.log(res, 'res')
+                        this.$router.push({
+                            path: '/point/pointsetting'
+                        })
+                        this.$message.success("更新成功!")
+                    })
+                } else {
+                    // param.ProjectId = this.projectId
+                    console.log(param, "param")
+                    createDataSource(param, res => {
+                        console.log(res)
+                        this.$router.push({
+                            path: '/point/pointsetting'
+                        })
+                        this.$message.success("创建成功!")
+                    })
+                }
+            },
+            deletePort() {
+                this.formData.ProtocolInfo.Port = ""
+            }
+        },
+        watch: {
+            projectId(){
+                this.$router.push({
+                    path: '/point/pointsetting'
+                })
+            }
+        }
+    }
+</script>
+<style lang="scss">
+    .margin-view {
+        height: 60px;
+    }
+    .btn-view {
+        overflow: hidden;
+        .btn {
+            float: right;
+            margin-right: 40px;
+        }
+    }
+    .content-view {
+        width: 928px;
+        margin: auto;
+        .edit-textarea {
+            margin: 8px 0 22px 0;
+            height: 117px;
+            textarea {
+                height: 100%;
+                background-color: #EEFAFF;
+            }
+        }
+    }
+</style>

+ 79 - 64
src/views/point/config_point/index.vue

@@ -1,63 +1,66 @@
 <template>
-    <div class="saga-config-point">
-        <div style="line-height:34px;padding-left:10px">
-            <span style="display:inline-block;height: 35px;line-height:34px;">此项目包括<i style="color:#409EFF;">{{list.length}}</i>个数据源</span>
-            <div style="float:right;height:34px;line-height:34px;padding-bottom: 1px;">
-                <!-- <el-button @click="sameData">同步配置文件到云端</el-button> -->
-                <el-button style="width:140px;" @click="addItem">添加数据源</el-button>
-            </div>
-        </div>
-        <div class="saga-origin-list" v-loading="isLoading">
-            <!-- <el-scrollbar> -->
-                <div class="disIne border-hover saga-list-item margin5" v-for="(item,index) in list" :key="index">
-                    <data-origin :id="'origin' + index" :renderData="item">
-                        <div class="center">
-                            <el-button @click="maintenance(item)" type="text">维护点位</el-button>
-                            <el-button @click="goEdit(item)" type="text">编辑数据源</el-button>
-                        </div>
-                    </data-origin>
-                </div>
-                <div v-if="!list.length" class="center" style="margin-top: 260px;">
-                    <i class="icon-wushuju iconfont"></i>
-                    暂无数据
-                </div>
-                <!-- <div class="disIne saga-list-item margin5 center pointer" @click="addItem">
-                    <i class="add-icon margin50">+</i>
-                </div> -->
-            <!-- </el-scrollbar> -->
-        </div>
+  <div class="saga-config-point">
+    <div style="line-height:34px;padding-left:10px">
+      <span style="display:inline-block;height: 35px;line-height:34px;">此项目包括<i
+        style="color:#409EFF;">{{list.length}}</i>个数据源</span>
+      <div style="float:right;height:34px;line-height:34px;padding-bottom: 1px;">
+        <!-- <el-button @click="sameData">同步配置文件到云端</el-button> -->
+        <el-button style="width:140px;" @click="addItem">添加数据源</el-button>
+      </div>
     </div>
+    <div class="saga-origin-list" v-loading="isLoading">
+      <!-- <el-scrollbar> -->
+      <div class="disIne border-hover saga-list-item margin5" v-for="(item,index) in list" :key="index">
+        <data-origin :id="'origin' + index" :renderData="item">
+          <div class="center">
+            <el-button @click="maintenance(item)" type="text">编辑点位</el-button>
+            <el-button @click="goEdit(item)" type="text">编辑数据源</el-button>
+            <el-button @click="del(item)" type="text">删除</el-button>
+          </div>
+        </data-origin>
+      </div>
+      <div v-if="!list.length" class="center" style="margin-top: 260px;">
+        <i class="icon-wushuju iconfont"></i>
+        暂无数据
+      </div>
+      <!-- <div class="disIne saga-list-item margin5 center pointer" @click="addItem">
+          <i class="add-icon margin50">+</i>
+      </div> -->
+      <!-- </el-scrollbar> -->
+    </div>
+    <dataSourceDialog ref="dialog"></dataSourceDialog>
+  </div>
 </template>
 <script>
-    import "@/assets/scss/point/point_config/common.scss"
-    import "@/assets/scss/point/point_config/reset.scss"
-    import dataOrigin from "@/components/config_point/data_origin"
-    import {
-        mapGetters,
-        mapActions
-    } from "vuex";
-    import { queryDataSourceCount,synchronizeProj } from "@/fetch/point_http"
-    export default {
-        components: {
-            dataOrigin
-        },
-        data() {
-            return {
-                projectName: "项目名称",
-                list: [],
-                isLoading: false
-            }
-        },
-        computed: {
-            ...mapGetters("layout", [
-                "projectId"
-            ])
-        },
-        created() {},
-        mounted() {
-            console.log(this.projectId)
-            this.getList()
-        },
+  import "@/assets/scss/point/point_config/common.scss"
+  import "@/assets/scss/point/point_config/reset.scss"
+  import dataOrigin from "@/components/config_point/data_origin"
+  import {mapGetters} from "vuex";
+  import {queryDataSourceCount, synchronizeProj} from "@/fetch/point_http"
+  import dataSourceDialog from "./edit_origin/dialog";
+
+  export default {
+    components: {
+      dataOrigin, dataSourceDialog
+    },
+    data() {
+      return {
+        projectName: "项目名称",
+        list: [],
+        isLoading: false
+      }
+    },
+    computed: {
+      ...mapGetters("layout", [
+        "projectId"
+      ])
+    },
+    created() {
+    },
+    mounted() {
+      console.log(this.projectId)
+      this.getList()
+    },
         methods: {
             //同步数据
             sameData(){
@@ -83,14 +86,26 @@
                 })
             },
             goEdit(item) {
-                console.log(item)
-                this.$router.push({
-                    path: "editDataSouce",
-                    query: {
-                        key: item.Id
-                    }
-                })
+              console.log(item)
+              this.$refs.dialog.openDialog(item)
+              // this.$router.push({
+              //     path: "editDataSouce",
+              //     query: {
+              //         key: item.Id
+              //     }
+              // })
             },
+          del(item) {
+            this.$confirm('删除后无法恢复,所有点位将丢失,是否需要删除', '提示', {
+              confirmButtonText: '确定',
+              cancelButtonText: '取消',
+              type: 'warning'
+            }).then(() => {
+              this.$message.success('删除成功')
+            }).catch(() => {
+              this.$message.info('已取消删除')
+            })
+          },
             maintenance(item) {
                 console.log(item)
                 this.$store.commit("project/set_datasource", item.Id);
@@ -123,7 +138,7 @@
         .saga-origin-list {
             flex: 1;
             // display: flex;
-            // flex-wrap: wrap;  
+            // flex-wrap: wrap;
             // justify-content: space-around;
             .saga-list-item {
                 background-color: #fff;

+ 67 - 0
src/views/point/toolLibrary/index.vue

@@ -0,0 +1,67 @@
+<template>
+  <div class="tool-library">
+    <div class="tool-library-header">
+      <h4>软件工具</h4>
+      <el-button class="btn" type="text" @click="createTools">配置集成工具库</el-button>
+    </div>
+    <div class="tool-library-content">
+      <el-button type="text" v-for="item in list" class="btn" @click="detailItem(item)">{{item.val}}</el-button>
+    </div>
+    <detailDialog ref="detailObject"/>
+    <settingDialog ref="setting"/>
+  </div>
+</template>
+
+<script>
+  import detailDialog from "@/components/config_point/toolLibrary/detailDialog";
+  import settingDialog from "@/components/config_point/toolLibrary/settingDialog";
+
+  export default {
+    data() {
+      return {
+        list: [
+          {val: 'OPC'}, {val: 'webservice'}, {val: 'MQTT'}, {val: 'transfor'}, {val: 'BACNet IP'}
+        ]
+      }
+    },
+    components: {detailDialog, settingDialog},
+    methods: {
+      detailItem(item) {
+        this.$refs.detailObject.show(item)
+      },
+      createTools() {
+        this.$refs.setting.show()
+      }
+    }
+  }
+</script>
+
+<style scoped lang="less">
+  .tool-library {
+    .tool-library-header {
+      overflow: hidden;
+
+      h4 {
+        display: inline-block;
+      }
+
+      .btn {
+        float: right;
+      }
+    }
+
+    .tool-library-content {
+      width: 90%;
+      margin: 20px auto;
+      background: rgba(247, 247, 247, 1);
+      border-radius: 5px;
+      padding: 20px 0;
+
+      .btn {
+        width: 20%;
+        text-align: center;
+        font-size: 20px;
+      }
+    }
+  }
+</style>