Ver código fonte

对讲主机 门禁主机 添加页面代码提交

jingyuanchao 11 meses atrás
pai
commit
2cc6a2ce5b

+ 9 - 2
src/api/iot/deviceInfo.js

@@ -63,7 +63,7 @@ export function alarmHostDeviceInfo(id) {
   })
 }
 
-// 新增/编辑报警主机
+// 新增/编辑网络设备
 export function editNetHostDevice(query) {
   return request({
     url: '/iot/deviceInfo/editNetHostDevice',
@@ -71,7 +71,7 @@ export function editNetHostDevice(query) {
     data: query
   })
 }
-// 报警主机详情
+// 网络设备详情
 export function netHostDeviceInfo(id) {
   return request({
     url: '/iot/deviceInfo/netHostDeviceInfo/'+id,
@@ -87,3 +87,10 @@ export function brandList(type) {
     method: 'get',
   })
 }
+// 从主机拉取基础设备
+export function baseDeviceGet() {
+  return request({
+    url: '/iot/deviceInfo/baseDeviceGet',
+    method: 'get',
+  })
+}

+ 5 - 0
src/views/iot/deviceInfo/dialog.addAlarmHost.vue

@@ -466,6 +466,7 @@ export default {
         return;
       }
       this.formData.orgId = data.id;
+      this.orgChange();
     },
     initData() {
       getProductDisplayName('AlarmHost').then((response) => {
@@ -473,6 +474,10 @@ export default {
       })
       this.getConnectHostOrg();
     },
+    orgChange(){
+      this.formData.iotCode = null;
+      this.getConnectHostOrg();
+    },
     getConnectHostOrg() {
       if (!this.formData.orgId) {
         return;

+ 5 - 0
src/views/iot/deviceInfo/dialog.addDoorHost.vue

@@ -238,6 +238,11 @@ export default {
         return;
       }
       this.formData.orgId = data.id;
+      this.orgChange();
+    },
+    orgChange(){
+      this.formData.iotCode = null;
+      this.getConnectHostOrg();
     },
     getConnectHostOrg() {
       if (!this.formData.orgId) {

+ 5 - 0
src/views/iot/deviceInfo/dialog.addDvrHost.vue

@@ -269,6 +269,11 @@ export default {
         return;
       }
       this.formData.orgId = data.id;
+      this.orgChange();
+    },
+    orgChange(){
+      this.formData.iotCode = null;
+      this.getConnectHostOrg();
     },
     async initData() {
       getProductDisplayName('DVS').then((response) => {

+ 5 - 0
src/views/iot/deviceInfo/dialog.addTalkHost.vue

@@ -238,6 +238,11 @@ export default {
         return;
       }
       this.formData.orgId = data.id;
+      this.orgChange();
+    },
+    orgChange(){
+      this.formData.iotCode = null;
+      this.getConnectHostOrg();
     },
     getConnectHostOrg() {
       if (!this.formData.orgId) {

+ 41 - 15
src/views/iot/deviceInfo/index.vue

@@ -48,7 +48,8 @@
               icon="el-icon-search"
               size="mini"
               @click="handleQuery"
-            >搜索</el-button>
+            >搜索
+            </el-button>
           </el-col>
           <el-col :span="1.5">
             <el-button
@@ -61,14 +62,23 @@
           <el-col :span="1.5">
             <el-button
               type="primary"
-              icon="el-icon-refresh"
+              icon="el-icon-plus"
               size="mini"
               @click="addHost"
               v-if="activeName !='fsu'"
             >新增设备
             </el-button>
           </el-col>
-          <right-toolbar :showSearch.sync="showSearch"  @queryTable="getList"></right-toolbar>
+          <el-col :span="1.5">
+            <el-button
+              type="primary"
+              icon="el-icon-refresh"
+              size="mini"
+              @click="baseDeviceGet"
+            >设备获取
+            </el-button>
+          </el-col>
+          <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
         </el-row>
       </div>
       <el-table
@@ -119,6 +129,7 @@
               size="mini"
               type="text"
               icon="el-icon-edit-outline"
+              v-if="activeName !== 'fsu'"
               @click="editDevice(scope.row)"
             >编辑
             </el-button>
@@ -148,11 +159,11 @@ import addAlarmHost from "./dialog.addAlarmHost.vue"
 import addTalkHost from "./dialog.addTalkHost.vue"
 import addDoorHost from "./dialog.addDoorHost.vue"
 import {deptTreeSelect} from "@/api/system/public";
-import {list,} from "@/api/iot/deviceInfo";
+import {baseDeviceGet, list,} from "@/api/iot/deviceInfo";
 
 export default {
   name: "IotDeviceInfo",
-  components: {OrgTree, detailInfoPage, addDvrHost, addAlarmHost,addTalkHost,addDoorHost},
+  components: {OrgTree, detailInfoPage, addDvrHost, addAlarmHost, addTalkHost, addDoorHost},
   data() {
     return {
       checkList: [],
@@ -390,34 +401,49 @@ export default {
     showDetail(row) {
       this.$refs.detailInfo.show(row.id, row.deviceType);
     },
-    editDevice(row,other = {}) {
+    editDevice(row, other = {}) {
       if (this.activeName == 'dvs') {
-        this.$refs.addDvrHostDialog.show(row.id,row.orgId, '监控主机', other = {});
+        this.$refs.addDvrHostDialog.show(row.id, row.orgId, '监控主机', other = {});
       }
       if (this.activeName == 'alarmHost') {
-        this.$refs.addAlarmHostDialog.show(row.id,row.orgId, '报警主机', other = {});
+        this.$refs.addAlarmHostDialog.show(row.id, row.orgId, '报警主机', other = {});
       }
       if (this.activeName == 'talkDevice') {
-        this.$refs.addTalkHostDialog.show(row.id,row.orgId, '对讲主机', other = {});
+        this.$refs.addTalkHostDialog.show(row.id, row.orgId, '对讲主机', other = {});
       }
       if (this.activeName == 'doorDevice') {
-        this.$refs.addDoorHostDialog.show(row.id,row.orgId, '门禁主机', other = {});
+        this.$refs.addDoorHostDialog.show(row.id, row.orgId, '门禁主机', other = {});
       }
     },
     addHost(other = {}) {
       if (this.activeName == 'dvs') {
-        this.$refs.addDvrHostDialog.show(null,this.queryParams.orgId, '监控主机', other = {});
+        this.$refs.addDvrHostDialog.show(null, this.queryParams.orgId, '监控主机', other = {});
       }
       if (this.activeName == 'alarmHost') {
-        this.$refs.addAlarmHostDialog.show(null,this.queryParams.orgId, '报警主机', other = {});
+        this.$refs.addAlarmHostDialog.show(null, this.queryParams.orgId, '报警主机', other = {});
       }
       if (this.activeName == 'talkDevice') {
-        this.$refs.addTalkHostDialog.show(null,this.queryParams.orgId, '对讲主机', other = {});
+        this.$refs.addTalkHostDialog.show(null, this.queryParams.orgId, '对讲主机', other = {});
       }
       if (this.activeName == 'doorDevice') {
-        this.$refs.addDoorHostDialog.show(null,this.queryParams.orgId, '门禁主机', other = {});
+        this.$refs.addDoorHostDialog.show(null, this.queryParams.orgId, '门禁主机', other = {});
       }
-    }
+    },
+    baseDeviceGet() {
+      this.$modal
+        .confirm("此操作将重新获取基础设备信息,是否继续?")
+        .then(function () {
+          console.log("123sss")
+          return baseDeviceGet();
+        })
+        .then(() => {
+          this.$modal.msgSuccess("消息下发成功,等待巡检主机推送!");
+          this.getList();
+        })
+        .catch(() => {
+        });
+    },
+
   },
 };
 </script>