shaun-sheep 4 years ago
parent
commit
521eaa24e1
2 changed files with 46 additions and 47 deletions
  1. 9 9
      config/prod.env.js
  2. 37 38
      src/views/point/config_point/edit_origin/dialog.vue

+ 9 - 9
config/prod.env.js

@@ -1,12 +1,12 @@
 'use strict'
 module.exports = {
-    NODE_ENV: '"production"',
-   // 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测试环境地址
-    BASE_URL: '"http://mbi.sagacloud.cn"', //线上iframe地址
-    SSO_SERVER: '"http://sso.sagacloud.cn"',  //正式环境
-     MQTT_SERVICE: '"ws://adm.sagacloud.cn/stomp/"' //MQ正式环境地址
+  NODE_ENV: '"production"',
+  // 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测试环境地址
+  BASE_URL: '"http://mbi.sagacloud.cn"', //线上iframe地址
+  SSO_SERVER: '"http://sso.sagacloud.cn"',  //正式环境
+   MQTT_SERVICE: '"ws://adm.sagacloud.cn/stomp/"' //MQ正式环境地址
 }

+ 37 - 38
src/views/point/config_point/edit_origin/dialog.vue

@@ -22,17 +22,36 @@
         <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 == 'opc'">
+      <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>
-        <el-form-item label="ProgId">
-          <el-input v-model="formData.ProtocolInfo.ProgId"></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>
@@ -61,14 +80,6 @@
         <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>
@@ -96,7 +107,6 @@
       return {
         dialogVisible: false,
         title: '',
-        passWordArr: ['mqtt', 'amqp', 'opc'],
         formData: {
           ProtocolType: "", //协议类型
           ProtocolStandarded: true,
@@ -149,30 +159,24 @@
             label: '间接'
           },
         ],
-        // id: this.$route.query.key
+        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,
-      // bread
     },
-    // created() {
-    //   this.$store.dispatch('setBreadcrumb', [{
-    //     label: '系统集成',
-    //     path: '/point/pointsetting'
-    //   }, {
-    //     label: '子系统点位接入',
-    //     path: '/point/pointsetting'
-    //   }, {
-    //     label: this.id ? '编辑数据源' : '添加数据源'
-    //   }])
-    // },
-    // mounted() {
-    //   console.log(this.id)
-    //   if (!!this.id) {
-    //     this.getDataSouse()
-    //   }
-    // },
+
     methods: {
       openDialog(obj) {
         this.dialogVisible = true
@@ -203,11 +207,7 @@
             break
 
         }
-        // if (val == 'common') {
-        //   this.formData.ProtocolStandarded = false
-        // } else {
-        //   this.formData.ProtocolStandarded = true
-        // }
+
       },
       handleChangeNetType(val) { //网络类型
         console.log(val)
@@ -230,7 +230,6 @@
           this.formData = data
           if (!this.formData.ProtocolInfo) {
             //信息点为空时
-
             this.formData.ProtocolInfo = {
               "Ip": "", //ip
               "Port": "",