Преглед на файлове

报警主机添加页面代码提交

jingyuanchao преди 11 месеца
родител
ревизия
e318b4a330
променени са 1 файла, в които са добавени 64 реда и са изтрити 18 реда
  1. 64 18
      src/views/iot/deviceInfo/dialog.addAlarmHost.vue

+ 64 - 18
src/views/iot/deviceInfo/dialog.addAlarmHost.vue

@@ -108,7 +108,14 @@
           <!-- 主机类型 -->
           <el-col :span="12">
             <el-form-item label="主机类型" prop="hostDeviceType" v-show="formData.deviceProduct=='BOSCH_CMS'">
-              <el-input v-model="formData.hostDeviceType" placeholder="请输入主机类型"/>
+              <el-select style="width: 100%" v-model="formData.hostDeviceType" placeholder="请输入主机类型">
+                <el-option
+                  v-for="item in hostDeviceTypeList"
+                  :key="item.id"
+                  :label="item.label"
+                  :value="item.id"
+                />
+              </el-select>
             </el-form-item>
           </el-col>
           <!-- 主机端口 -->
@@ -164,14 +171,11 @@
           </el-col>
 
         </el-form>
-
       </div>
 
       <div slot="footer" class="dialog-footer">
         <el-button type="primary" @click="onSubmit">确 定</el-button>
         <el-button @click="onHide">取 消</el-button>
-        <!--        <el-button type="primary" @click="onSave">保存</el-button>-->
-
       </div>
     </DialogCom>
   </div>
@@ -196,6 +200,19 @@ export default {
       productList: [],
       modelList: [],
       hostConnectList: [],
+      hostDeviceTypeList: [
+        {id:17,label:'ICP_CMS6_CHI_V1_00'},
+        {id:18,label:'AMAX2000'},
+        {id:19,label:'ICP_CMS6_CHI_V1_10'},
+        {id:20,label:'ICP_CMS8_CHI_V1_10'},
+        {id:21,label:'ICP_CMS40_CHI_V1_00'},
+        {id:22,label:'ICP_CMS6_CHI_V1_20'},
+        {id:23,label:'ICP_CMS8_CHI_V1_20'},
+        {id:25,label:'ICP_CMS40_CHI_V2_10'},
+        {id:29,label:'ICP_CMS40_CHI_V2_20'},
+        {id:43,label:'ICP_CMS40_CHI_V2_30'},
+        {id:50,label:'ICP_CMS40_CHI_V2_40'}
+      ],
       formDataRules: {
         deviceName: [{required: true, message: "请输入设备名称"}],
         deviceProduct: [{required: true, message: "请选择产品类型"}],
@@ -210,16 +227,18 @@ export default {
         userName: [{required: true, message: "请输入用户名"}],
         password: [{required: true, message: "请输入密码"}],
         models: [{required: true, message: "请选择产品型号"}],
+        listenAddress: [{required: true, message: "请输入监听地址"}],
+        listenPort: [{required: true, message: "请输入监听端口"}],
+        hostDeviceType: [{required: true, message: "请输入主机类型"}],
+        iotAddress: [{required: true, message: "请输入主机端口"}],
+        deviceMac: [{required: true, message: "请输入MAC地址"}],
+        deviceUserCode: [{required: true, message: "请输入主机操作码"}],
       },
     };
   },
   dicts: [],
   props: {},
-  watch: {
-    'formData.deviceProduct': function(newVal) {
-      this.$forceUpdate();
-    }
-  },
+  watch: {},
 
   created() {
 
@@ -249,6 +268,7 @@ export default {
         deviceUserCode: "",
         iotAddress: "",
         models: "",
+        hostDeviceType: "",
         enable: 0,
         ...other,
       };
@@ -257,7 +277,6 @@ export default {
       if (!id) {
         this.reset(other);
       }
-
     },
     async show(orgId, name, other = {}) {
       this.formData = this.reset(other);
@@ -269,8 +288,6 @@ export default {
       });
       this.isShow = true;
     },
-
-    // 事件
     onHide() {
       this.isShow = false;
       this.formData = this.reset();
@@ -330,8 +347,8 @@ export default {
         this.modelList = models;
         this.formData.models = this.modelList[0];
       }
+      this.productChangeAndInitDta();
     },
-
     validateIp(rule, value, callback) {
       if (!value) {
         return callback(new Error('请输入服务Ip'));
@@ -360,7 +377,6 @@ export default {
       let arr = [ 'InAnter_BM1600NTSmall'];
       return  arr.includes(this.formData.deviceProduct) ;
     },
-
     showUserName(){
       let arr = [
         'DaHuaAlarmHost',
@@ -376,12 +392,42 @@ export default {
         'HikModule',
       ];
       return arr.includes(this.formData.deviceProduct) ;
+    },
+    productChangeAndInitDta(){
+      let deviceProduct = this.formData.deviceProduct;
+      if (deviceProduct === "DaHua" || deviceProduct === "DaHuaAlarmHost"){
+        this.formData.serverPort = "37777";
+        this.formData.userName = "admin";
+        this.formData.password = "admin123";
+      }else if (deviceProduct === "BOSCH_CMS"){
+        this.formData.serverPort = "7700";
+        this.formData.userName = "00001";
+        this.formData.password = "1234";
+        this.formData.hostDeviceType = "50";
+      }else if (deviceProduct === "Hik_DS19A"){
+        this.formData.serverPort = "8000";
+        this.formData.userName = "admin";
+        this.formData.password = "";
+      }else if (deviceProduct === "HoneywellOCX_IPM"){
+        this.formData.serverPort = "8000";
+        this.formData.deviceUserCode = "1234";
+        this.formData.deviceMac = "00-00-00-00-00-00";
+      }else if (deviceProduct === "HikModule"){
+        this.formData.serverPort = "4001";
+        this.formData.deviceUserCode = "1234";
+        this.formData.deviceMac = "00-00-00-00-00-00";
+      }else if (deviceProduct === "FengYe_H402"){
+        this.formData.listenPort = "9100";
+      }else if (deviceProduct === "HengTong_CKWU01C"){
+      this.formData.serverPort = "4001";
+      this.formData.userName = "admin";
+      this.formData.password = "12345678";
+      this.formData.deviceUserCode = "1234"  ;
+      }else if (deviceProduct === "InAnter_BM1600NTSmall"){
+        this.formData.listenPort = "502";
+      }
     }
-
-
-
   },
-
 };
 </script>