Explorar el Código

1、住户编辑新增优化

wenxgdev hace 4 años
padre
commit
23062c36da

+ 1 - 1
src/api/device/videocloudaccount.js

@@ -58,7 +58,7 @@ export const vcLogin = (row) => {
 
 export const syncByAccount = (params) => {
   return request({
-    url: '/api/cyzh-device/videoclouddevice/syncByAccount',
+    url: '/api/cyzh-smart-device/videoclouddevice/syncByAccount',
     method: 'post',
     params:{
       ...params

+ 9 - 0
src/api/device/videoclouddevice.js

@@ -118,3 +118,12 @@ export const convertStop = (convertKey) => {
   })
 }
 
+//刷新设备信息
+export const sync = (row) => {
+  return request({
+    url: '/api/cyzh-smart-device/videoclouddevice/syncByDevice',
+    method: 'post',
+    data: row
+  })
+}
+

+ 2 - 2
src/config/env.js

@@ -11,10 +11,10 @@ if (env.NODE_ENV === 'development') {
     zlmHttpUrl = '192.168.1.218:8088';
 } else if (env.NODE_ENV === 'production') {
     baseUrl = ``; //生产环境地址
-    zlmHttpUrl = '192.168.0.246:8888';
+    zlmHttpUrl = '36.103.228.148:8888';
 } else if (env.NODE_ENV === 'test') {
     baseUrl = ``; //测试环境地址
-    zlmHttpUrl = '192.168.0.246:8888';
+    zlmHttpUrl = '36.103.228.148:8888'
 }
 export {
     zlmHttpUrl,

+ 19 - 4
src/views/device/videodevice/videocloud/videocloudaccount.vue

@@ -35,9 +35,9 @@
               更多<i class="el-icon-arrow-down el-icon--right"></i>
             </span>
             <el-dropdown-menu slot="dropdown">
-              <el-dropdown-item v-if="permission.vcaccount_login" type="text" @click.native="vcLogin(scope.row.accountName, scope.row.pwd)">登录</el-dropdown-item>
+              <el-dropdown-item v-if="permission.vcaccount_login" type="text" @click.native="vcLogin(scope.row.accountName, scope.row.pwd, scope.row.appKey)">登录</el-dropdown-item>
               <el-dropdown-item v-if="permission.vcaccount_sync" type="text" @click.native="syncDevices(scope.row.accountName)">同步设备</el-dropdown-item>
-              <el-dropdown-item v-if="permission.vcaccount_delete" type="text" @click.native="delete(scope.row)">删除</el-dropdown-item>
+              <el-dropdown-item v-if="permission.vcaccount_delete" type="text" @click.native="rowDel(scope.row)">删除</el-dropdown-item>
             </el-dropdown-menu>
 
           </el-dropdown>
@@ -99,6 +99,18 @@
               hide: true,
               viewDisplay: false,
             },
+            {
+              label: "appKey",
+              prop: "appKey",
+              width: 140,
+              rules: [{
+                required: true,
+                message: "请输入appKey",
+                trigger: "blur"
+              }],
+              hide: true,
+              viewDisplay: false,
+            },
             {
               label: "城市名称",
               prop: "cityName",
@@ -202,8 +214,8 @@
       }
     },
     methods: {
-      vcLogin(accountName){
-        let body = {"accountName": accountName, "pwd": pwd}
+      vcLogin(accountName, pwd, appKey){
+        let body = {"accountName": accountName, "pwd": pwd, "appKey": appKey}
         vcLogin(body).then(res => {
           if (res.data.success) {
             this.$message({
@@ -234,6 +246,9 @@
           }
         })
       },
+      delete(id){
+        remove(id)
+      },
       rowSave(row, done, loading) {
         add(row).then(() => {
           this.onLoad(this.page);

+ 88 - 78
src/views/device/videodevice/videocloud/videoclouddevice.vue

@@ -11,22 +11,21 @@
         <el-button type="success" icon="el-icon-paperclip" size="small" @click="showDeviceBindBatch()">批量绑定</el-button>
       </template>
 
-      <template slot="menu" slot-scope="scope">
+      <template slot="menu" slot-scope="{row}">
           <el-button-group>
-            <el-button size="mini" icon="el-icon-video-play" type="success" v-if="permission.vcdevice_play && scope.row.enable == 1" @click="play(scope.row)">播放</el-button>
-            <el-button size="mini" icon="el-icon-close" type="danger" v-if="permission.vcdevice_stop && scope.row.enable == 1" @click="stop(scope.row)">停用</el-button>
-            <el-button size="mini" icon="el-icon-check" type="primary" :loading="startBtnLoading" v-if="permission.vcdevice_start && scope.row.enable != 1" @click="start(scope.row)">获取视频</el-button>
+            <el-button size="mini" icon="el-icon-refresh" plain v-if="permission.vcdevice_sync" @click="rowSync(row, row.$index)">刷新</el-button>
+            <el-button size="mini" icon="el-icon-video-play" type="success" v-if="permission.vcdevice_play && row.enable == 1" @click="play(row)">播放</el-button>
+            <el-button size="mini" icon="el-icon-close" type="danger" v-if="permission.vcdevice_stop && row.enable == 1" @click="stop(row)">停用</el-button>
+            <el-button size="mini" icon="el-icon-check" type="primary" :loading="startBtnLoading" v-if="permission.vcdevice_start && row.enable != 1 && row.isOnline == 1" @click="start(row)">获取视频</el-button>
             <el-button size="mini">
               <el-dropdown>
             <span>
               更多<i class="el-icon-arrow-down el-icon--right"></i>
             </span>
                 <el-dropdown-menu slot="dropdown">
-                  <el-dropdown-item icon="el-icon-view" type="text" @click.native="view(scope.row)">查看</el-dropdown-item>
-                  <!--<el-dropdown-item icon="el-icon-edit" type="text" @click.native="edit(scope.row)">编辑</el-dropdown-item>-->
-                  <el-dropdown-item icon="el-icon-delete" type="text" @click.native="delete(scope.row)">删除</el-dropdown-item>
-                  <!--<el-dropdown-item icon="el-icon-video-camera" type="text" @click.native="showVideo(scope.row)">查看监控</el-dropdown-item>-->
-                  <el-dropdown-item icon="el-icon-paperclip" type="text" @click.native="showDeviceBind(scope.row)">{{!scope.row.residentialId ? '设备绑定' : '设备改绑'}}</el-dropdown-item>
+                  <el-dropdown-item icon="el-icon-view" type="text" @click.native="view(row)">查看</el-dropdown-item>
+                  <el-dropdown-item icon="el-icon-delete" type="text" @click.native="rowDel(row)">删除</el-dropdown-item>
+                  <el-dropdown-item icon="el-icon-paperclip" type="text" @click.native="showDeviceBind(row)">{{!row.residentialId ? '设备绑定' : '设备改绑'}}</el-dropdown-item>
                 </el-dropdown-menu>
 
               </el-dropdown>
@@ -36,6 +35,10 @@
         <!--<el-button icon="el-icon-paperclip" type="text" @click="showDeviceBind(scope.row)">{{!scope.row.residentialId ? '设备绑定' : '设备改绑'}}</el-button>-->
         <!--<el-button icon="el-icon-video-camera" type="text" @click="showVideo(scope.row)">查看监控</el-button>-->
       </template>
+      <template slot="isOnline" slot-scope="{row}">
+        <el-tag v-if="row.isOnline == 1" type="success">在线</el-tag>
+        <el-tag v-else type="info">离线</el-tag>
+      </template>
 
     </avue-crud>
 
@@ -99,7 +102,8 @@ import {
   remove,
   start,
   stop,
-  play
+  play,
+  sync
 } from "../../../../api/device/videoclouddevice.js";
 import {
   mapGetters
@@ -139,7 +143,7 @@ export default {
 
       option: {
         menu: true,
-        menuWidth:300,
+        menuWidth:320,
         height: 'auto',
         calcHeight: 30,
         tip: false,
@@ -182,6 +186,7 @@ export default {
             label: "设备号",
             prop: "deviceNum",
             span: 12,
+            search: true,
             rules: [{
               required: true,
               message: "请输入设备号",
@@ -199,24 +204,6 @@ export default {
               trigger: "blur"
             }]
           },
-          {
-            label: "设备类型",
-            prop: "deviceType",
-            span: 12,
-            search: true,
-            dataType: "number",
-            type: "select",
-            dicUrl: "/api/blade-system/dict-biz/dictionary?code=video_device_type",
-            props: {
-              label: 'dictValue',
-              value: 'dictKey'
-            },
-            rules: [{
-              required: true,
-              message: "请输入设备类型(132:IPC;111:DVR;118:NVR,114:解码器)",
-              trigger: "blur"
-            }]
-          },
           {
             label: "型号",
             prop: "modelSequence",
@@ -243,7 +230,9 @@ export default {
           {
             label: "是否在线",
             prop: "isOnline",
-            span: 12,
+            slot: true,
+            width: 100,
+            align: "center",
             dataType: "number",
             type: "select",
             search: true,
@@ -314,7 +303,7 @@ export default {
               trigger: "blur"
             }]
           },
-          {
+          /*{
             label: "是否支持云台",
             prop: "isSupportPtz",
             span: 12,
@@ -340,7 +329,7 @@ export default {
               message: "请输入是否支持云台(0:不支持,1:支持)",
               trigger: "blur"
             }]
-          },
+          },*/
           {
             // label: "是否支持移动侦测(0:不支持,1:支持)",
             label: "是否支持移动侦测",
@@ -433,23 +422,23 @@ export default {
               trigger: "blur"
             }]
           },
-          {
-            label: "云存储类别",
-            prop: "cloudStorageType",
-            span: 12,
-            type: "select",
-            dataType: "number",
-            dicUrl: "/api/blade-system/dict-biz/dictionary?code=cloud_storage_type",
-            props: {
-              label: 'dictValue',
-              value: 'dictKey'
-            },
-            rules: [{
-              required: true,
-              message: "请输入云存储类别(0:无云存储,1:电信分布式存储,2:21cn存储)",
-              trigger: "blur"
-            }]
-          },
+          // {
+          //   label: "云存储类别",
+          //   prop: "cloudStorageType",
+          //   span: 12,
+          //   type: "select",
+          //   dataType: "number",
+          //   dicUrl: "/api/blade-system/dict-biz/dictionary?code=cloud_storage_type",
+          //   props: {
+          //     label: 'dictValue',
+          //     value: 'dictKey'
+          //   },
+          //   rules: [{
+          //     required: true,
+          //     message: "请输入云存储类别(0:无云存储,1:电信分布式存储,2:21cn存储)",
+          //     trigger: "blur"
+          //   }]
+          // },
           {
             label: "云存储配置id",
             prop: "cloudStorageConfId",
@@ -711,10 +700,11 @@ export default {
             }]
           },
           {
-            label: "所属账户",
+            label: "视频云账号",
             prop: "accountName",
+            search: true,
+            searchLabelWidth: 100,
             span: 12,
-            hide: true,
             rules: [{
               required: true,
               message: "请输入所属账户",
@@ -895,6 +885,7 @@ export default {
             dataType: "number",
             type: "select",
             search: true,
+            slot: true,
             dicData:[
               {
                 label:'在线',
@@ -962,33 +953,33 @@ export default {
               trigger: "blur"
             }]
           },
-          {
-            label: "是否支持云台",
-            prop: "isSupportPtz",
-            span: 12,
-            dataType: "number",
-            type: "select",
-            dicData:[
-              {
-                label:'支持',
-                value:1
-              },
-              {
-                label:'不支持',
-                value:0
-              }
-            ],
-            // dicUrl: "/api/blade-system/dict-biz/dictionary?code=is_support",
-            // props: {
-            //   label: 'dictValue',
-            //   value: 'dictKey'
-            // },
-            rules: [{
-              required: true,
-              message: "请输入是否支持云台(0:不支持,1:支持)",
-              trigger: "blur"
-            }]
-          },
+          // {
+          //   label: "是否支持云台",
+          //   prop: "isSupportPtz",
+          //   span: 12,
+          //   dataType: "number",
+          //   type: "select",
+          //   dicData:[
+          //     {
+          //       label:'支持',
+          //       value:1
+          //     },
+          //     {
+          //       label:'不支持',
+          //       value:0
+          //     }
+          //   ],
+          //   // dicUrl: "/api/blade-system/dict-biz/dictionary?code=is_support",
+          //   // props: {
+          //   //   label: 'dictValue',
+          //   //   value: 'dictKey'
+          //   // },
+          //   rules: [{
+          //     required: true,
+          //     message: "请输入是否支持云台(0:不支持,1:支持)",
+          //     trigger: "blur"
+          //   }]
+          // },
           {
             // label: "是否支持移动侦测(0:不支持,1:支持)",
             label: "是否支持移动侦测",
@@ -1457,6 +1448,25 @@ export default {
     }
   },
   methods: {
+    //同步设备
+    rowSync(row, index){
+      let that = this;
+      sync(row).then(res => {
+        if(res.data.success){
+          let result = res.data.data;
+          that.$set(that.data, index, result)
+          that.$message({
+            type: "success",
+            message: res.data.msg
+          });
+        }else{
+          that.$message({
+            type: "fail",
+            message: res.data.msg
+          });
+        }
+      })
+    },
     //获取视频并开启
     start(row){
       let that = this;

+ 10 - 9
src/views/person/basicinfo.vue

@@ -229,7 +229,8 @@
               cascaderItem: ['residentialId'],
               type: "select",
               // remote: true,
-              dicUrl: "/api/cyzh-community/agency/list?size=9999",
+              // dicData: [],
+              dicUrl: "/api/cyzh-community/agency/list?size=500",
               dicFormatter:(res)=>{
                 return res.data.records;//返回字典的层级结构
               },
@@ -254,15 +255,15 @@
             {
               label: "所属小区",
               prop: "residentialId",
+              dataType:'number',
               type: "select",
               search: true,
               cascaderItem: ['buildingId'],
-              dicUrl: "/api/cyzh-community/residential/list?agencyId={{key}}",
+              dicUrl: "/api/cyzh-community/residential/list?agencyId={{key}}&size=500",
               dicFormatter:(res)=>{
                 return res.data.records;//返回字典的层级结构
               },
-              // dicFlag: false,
-              filterable: true,
+              // filterable: true,
               props: {
                 label: "name",
                 value: "id"
@@ -288,7 +289,7 @@
               // slot:true,
               search: true,
               cascaderItem: ['unitId'],
-              dicUrl: "/api/cyzh-community/building/list?residentialId={{key}}",
+              dicUrl: "/api/cyzh-community/building/list?residentialId={{key}}&size=500",
               dicFormatter:(res)=>{
                 return res.data.records;//返回字典的层级结构
               },
@@ -319,12 +320,12 @@
               // slot:true,
               search: true,
               cascaderItem: ['floorId'],
-              dicUrl: "/api/cyzh-community/unit/list?buildingId={{key}}",
+              dicUrl: "/api/cyzh-community/unit/list?buildingId={{key}}&size=500",
               dicFormatter:(res)=>{
                 return res.data.records;//返回字典的层级结构
               },
               // dicFlag: false,
-              filterable: true,
+              // filterable: true,
               props: {
                 label: "name",
                 value: "id"
@@ -350,7 +351,7 @@
               // slot:true,
               search: true,
               cascaderItem: ['roomId'],
-              dicUrl: "/api/cyzh-community/floor/list?unitId={{key}}",
+              dicUrl: "/api/cyzh-community/floor/list?unitId={{key}}&size=100",
               dicFormatter:(res)=>{
                 return res.data.records;//返回字典的层级结构
               },
@@ -380,7 +381,7 @@
               type: "select",
               // slot:true,
               search: true,
-              dicUrl: "/api/cyzh-community/room/list?floorId={{key}}",
+              dicUrl: "/api/cyzh-community/room/list?floorId={{key}}&size=500&current=1",
               dicFormatter:(res)=>{
                 return res.data.records;//返回字典的层级结构
               },

+ 8 - 4
src/views/person/serveruser.vue

@@ -102,7 +102,8 @@
                 required: true,
                 message: "请输入省",
                 trigger: "blur"
-              }]
+              }],
+              hide: true
             },
             {
               label: "市",
@@ -119,7 +120,8 @@
                 required: true,
                 message: "请输入市",
                 trigger: "blur"
-              }]
+              }],
+              hide: true
             },
             {
               label: "区",
@@ -135,7 +137,8 @@
                 required: true,
                 message: "请输入区",
                 trigger: "blur"
-              }]
+              }],
+              hide: true
             },
             {
               label: "籍贯",
@@ -216,8 +219,9 @@
             {
               label: "备注",
               prop: "remark",
+              type: "textarea",
               rules: [{
-                required: true,
+                required: false,
                 message: "请输入备注",
                 trigger: "blur"
               }]