|
|
@@ -1,12 +1,12 @@
|
|
|
<template>
|
|
|
<basic-container>
|
|
|
<avue-crud :option="option" :table-loading="loading" :data="data" :page="page" :permission="permissionList"
|
|
|
- :before-open="beforeOpen" v-model="form" ref="crud" @row-update="rowUpdate" @row-save="rowSave" @row-del="rowDel"
|
|
|
- @search-change="searchChange" @search-reset="searchReset" @selection-change="selectionChange" @current-change="currentChange"
|
|
|
- @size-change="sizeChange" @refresh-change="refreshChange" @on-load="onLoad">
|
|
|
+ :before-open="beforeOpen" v-model="form" ref="crud" @row-update="rowUpdate" @row-save="rowSave" @row-del="rowDel"
|
|
|
+ @search-change="searchChange" @search-reset="searchReset" @selection-change="selectionChange" @current-change="currentChange"
|
|
|
+ @size-change="sizeChange" @refresh-change="refreshChange" @on-load="onLoad">
|
|
|
<template slot="menuLeft">
|
|
|
<el-button type="danger" size="small" icon="el-icon-delete" plain v-if="permission.videoclouddevice_delete"
|
|
|
- @click="handleDelete">删 除
|
|
|
+ @click="handleDelete">删 除
|
|
|
</el-button>
|
|
|
<el-button type="success" icon="el-icon-paperclip" size="small" @click="showDeviceBindBatch()">批量绑定</el-button>
|
|
|
</template>
|
|
|
@@ -18,10 +18,12 @@
|
|
|
操作<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-video-camera" type="text" @click.native="showVideo(scope.row)">查看监控</el-dropdown-item>
|
|
|
+ <!-- <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-video-camera" type="text" @click.native="syncDevice(scope.row.accountName, scope.row.deviceNum)">同步设备状态</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-paperclip" type="text" @click.native="syncVideoUrl(scope.row.accountName, scope.row.deviceNum)">同步播放地址</el-dropdown-item>
|
|
|
+ <el-dropdown-item icon="el-icon-video-camera" type="text" @click.native="showVideo(scope.row)">查看监控</el-dropdown-item>
|
|
|
</el-dropdown-menu>
|
|
|
|
|
|
</el-dropdown>
|
|
|
@@ -29,10 +31,14 @@
|
|
|
<!--<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="scope">
|
|
|
+ <el-tag v-if="scope.row.isOnline == 1" type="success">在线</el-tag>
|
|
|
+ <el-tag v-else type="info">离线</el-tag>
|
|
|
+ </template>
|
|
|
|
|
|
</avue-crud>
|
|
|
|
|
|
- <!-- 小区列表-->
|
|
|
+ <!-- 区域列表-->
|
|
|
<el-dialog :modal-append-to-body="false" append-to-body :visible.sync="bindVisible" title="设备绑定" center width="20%">
|
|
|
<div style="text-align: center;">
|
|
|
<!-- <el-select v-model="selectValue" filterable placeholder="请选择">
|
|
|
@@ -49,7 +55,7 @@
|
|
|
</el-dialog>
|
|
|
|
|
|
<el-dialog :modal-append-to-body="false" append-to-body :visible.sync="bindBatchVisible" title="设备批量绑定" center
|
|
|
- width="50%">
|
|
|
+ width="50%">
|
|
|
<div style="text-align: center;">
|
|
|
<avue-form v-model="bindBatchForm" :option="bindOption" @submit="bindBatchDevice">
|
|
|
|
|
|
@@ -66,9 +72,9 @@
|
|
|
|
|
|
<el-dialog :modal-append-to-body="false" append-to-body :visible.sync="videoVisible" title="视频监控" center width="50%">
|
|
|
<div>
|
|
|
- <div align="center">{{video.name}}</div>
|
|
|
- <video :id="videoId" controls="true" width="100%" height="100%">
|
|
|
- </video>
|
|
|
+ <div align="center">{{video.name}}</div>
|
|
|
+ <video :id="videoId" id="videoId" controls="true" width="100%" height="100%">
|
|
|
+ </video>
|
|
|
</div>
|
|
|
</el-dialog>
|
|
|
<el-dialog :modal-append-tobody="false" append-to-body :visible.sync="editVisiable" title="编辑" width="60%">
|
|
|
@@ -89,7 +95,9 @@
|
|
|
update,
|
|
|
remove,
|
|
|
updateVideoDevice,
|
|
|
- bindResidentialBatch
|
|
|
+ bindResidentialBatch,
|
|
|
+ getVideoUrl,
|
|
|
+ syncByDevice
|
|
|
} from "../../api/smartapplication/videoclouddevice.js";
|
|
|
import {
|
|
|
mapGetters
|
|
|
@@ -97,6 +105,7 @@
|
|
|
import {
|
|
|
getAllList
|
|
|
} from "@/api/community/residential";
|
|
|
+ import {syncByAccount} from "../../api/smartapplication/videocloudaccount";
|
|
|
|
|
|
export default {
|
|
|
data() {
|
|
|
@@ -133,27 +142,16 @@
|
|
|
labelWidth: 150,
|
|
|
border: true,
|
|
|
index: true,
|
|
|
- viewBtn: false,
|
|
|
- editBtn: false,
|
|
|
- delBtn: true,
|
|
|
+ delBtn: false,
|
|
|
+ addBtn: false,
|
|
|
+ viewBtn: true,
|
|
|
selection: true,
|
|
|
dialogClickModal: false,
|
|
|
- column: [{
|
|
|
- label: "设备编号",
|
|
|
- prop: "deviceId",
|
|
|
- hide: true,
|
|
|
- span: 12,
|
|
|
- rules: [{
|
|
|
- required: true,
|
|
|
- message: "请输入设备编号",
|
|
|
- trigger: "blur"
|
|
|
- }]
|
|
|
- },
|
|
|
+ column: [
|
|
|
{
|
|
|
label: "设备名称",
|
|
|
prop: "deviceName",
|
|
|
search: true,
|
|
|
- span: 12,
|
|
|
rules: [{
|
|
|
required: true,
|
|
|
message: "请输入设备名称",
|
|
|
@@ -163,421 +161,164 @@
|
|
|
{
|
|
|
label: "设备号",
|
|
|
prop: "deviceNum",
|
|
|
- span: 12,
|
|
|
- rules: [{
|
|
|
- required: true,
|
|
|
- message: "请输入设备号",
|
|
|
- trigger: "blur"
|
|
|
- }]
|
|
|
- },
|
|
|
- {
|
|
|
- label: "设备密码",
|
|
|
- prop: "devicePassword",
|
|
|
- span: 12,
|
|
|
- hide: true,
|
|
|
- rules: [{
|
|
|
- required: true,
|
|
|
- message: "请输入设备密码",
|
|
|
- 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",
|
|
|
- span: 12,
|
|
|
- hide: true,
|
|
|
- rules: [{
|
|
|
- required: true,
|
|
|
- message: "请输入型号",
|
|
|
- trigger: "blur"
|
|
|
- }]
|
|
|
- },
|
|
|
- {
|
|
|
- // label: "协议类型(1:GB28181,2:ONVIF)",
|
|
|
- label: "协议类型",
|
|
|
- prop: "protocolType",
|
|
|
- span: 12,
|
|
|
- hide: true,
|
|
|
- rules: [{
|
|
|
- required: true,
|
|
|
- message: "请输入协议类型(1:GB28181,2:ONVIF)",
|
|
|
- trigger: "blur"
|
|
|
- }]
|
|
|
+ width: 180
|
|
|
},
|
|
|
{
|
|
|
label: "是否在线",
|
|
|
prop: "isOnline",
|
|
|
- span: 12,
|
|
|
dataType: "number",
|
|
|
type: "select",
|
|
|
+ slot: true,
|
|
|
+ align: "center",
|
|
|
search: true,
|
|
|
+ width: 90,
|
|
|
dicUrl: "/api/blade-system/dict-biz/dictionary?code=online_or_offline",
|
|
|
props: {
|
|
|
label: 'dictValue',
|
|
|
value: 'dictKey'
|
|
|
},
|
|
|
- rules: [{
|
|
|
- required: true,
|
|
|
- message: "请输入是否在线(0:不在线,1:在线)",
|
|
|
- trigger: "blur"
|
|
|
- }]
|
|
|
- },
|
|
|
- {
|
|
|
- // label: "是否支持云存储(0:不支持,1:支持)",
|
|
|
- label: "是否支持云存储",
|
|
|
- prop: "isSupportCloudStorage",
|
|
|
- span: 12,
|
|
|
- hide: true,
|
|
|
- rules: [{
|
|
|
- required: true,
|
|
|
- message: "请输入是否支持云存储(0:不支持,1:支持)",
|
|
|
- trigger: "blur"
|
|
|
- }]
|
|
|
},
|
|
|
{
|
|
|
- // label: "是否支持本地存储(0:不支持,1:支持)",
|
|
|
- label: "是否支持本地存储",
|
|
|
- prop: "isSupportLocalStorage",
|
|
|
- span: 12,
|
|
|
- hide: true,
|
|
|
- rules: [{
|
|
|
- required: true,
|
|
|
- message: "请输入是否支持本地存储(0:不支持,1:支持)",
|
|
|
- trigger: "blur"
|
|
|
- }]
|
|
|
- },
|
|
|
- {
|
|
|
- label: "是否支持云台",
|
|
|
- prop: "isSupportPtz",
|
|
|
- span: 12,
|
|
|
- dataType: "number",
|
|
|
- type: "select",
|
|
|
- dicUrl: "/api/blade-system/dict-biz/dictionary?code=is_support",
|
|
|
+ label: "所属园区",
|
|
|
+ prop: "agencyId",
|
|
|
+ type: 'select',
|
|
|
+ hide:true,
|
|
|
+ editDisplay: false,
|
|
|
+ addDisplya: false,
|
|
|
+ width: 150,
|
|
|
+ overHidden: true,
|
|
|
+ search: true,
|
|
|
+ remote: true,
|
|
|
+ dicFlag :false,
|
|
|
+ // slot: true,
|
|
|
+ dicUrl: "/api/agency/agency/select?size=500&agencyName={{key}}",
|
|
|
+ cascaderItem: ['residentialId'],
|
|
|
props: {
|
|
|
- label: 'dictValue',
|
|
|
- value: 'dictKey'
|
|
|
+ label: 'agencyName',
|
|
|
+ value: 'id'
|
|
|
},
|
|
|
rules: [{
|
|
|
required: true,
|
|
|
- message: "请输入是否支持云台(0:不支持,1:支持)",
|
|
|
- trigger: "blur"
|
|
|
- }]
|
|
|
- },
|
|
|
- {
|
|
|
- // label: "是否支持移动侦测(0:不支持,1:支持)",
|
|
|
- label: "是否支持移动侦测",
|
|
|
- prop: "isSupportMotionDetection",
|
|
|
- span: 12,
|
|
|
- hide: true,
|
|
|
- rules: [{
|
|
|
- required: true,
|
|
|
- message: "请输入是否支持移动侦测(0:不支持,1:支持)",
|
|
|
+ message: "请输入所属园区",
|
|
|
trigger: "blur"
|
|
|
}]
|
|
|
},
|
|
|
{
|
|
|
- // label: "是否支持手动报警(0:不支持,1:支持)",
|
|
|
- label: "是否支持手动报警",
|
|
|
- prop: "isSupportManualAlarm",
|
|
|
- span: 12,
|
|
|
- hide: true,
|
|
|
- rules: [{
|
|
|
- required: true,
|
|
|
- message: "请输入是否支持手动报警(0:不支持,1:支持)",
|
|
|
- trigger: "blur"
|
|
|
- }]
|
|
|
- },
|
|
|
- {
|
|
|
- // label: "是否支持外部开关报警(0:不支持,1:支持)",
|
|
|
- label: "是否支持外部开关报警",
|
|
|
- prop: "isSupportExternalAlarmSwitch",
|
|
|
- span: 12,
|
|
|
- hide: true,
|
|
|
- rules: [{
|
|
|
- required: true,
|
|
|
- message: "请输入是否支持外部开关报警(0:不支持,1:支持)",
|
|
|
- trigger: "blur"
|
|
|
- }]
|
|
|
+ label: "所属园区",
|
|
|
+ prop: "agencyName",
|
|
|
+ hide: false,
|
|
|
+ viewDisplay: true,
|
|
|
},
|
|
|
{
|
|
|
- // label: "设备是否有反转倒置能力(0:否,1:是)",
|
|
|
- label: "设备是否有反转倒置能力",
|
|
|
- prop: "isHaveInversion",
|
|
|
- span: 12,
|
|
|
+ label: "所属区域",
|
|
|
+ prop: "residentialId",
|
|
|
+ type: 'select',
|
|
|
hide: true,
|
|
|
- rules: [{
|
|
|
- required: true,
|
|
|
- message: "请输入设备是否有反转倒置能力(0:否,1:是)",
|
|
|
- trigger: "blur"
|
|
|
- }]
|
|
|
- },
|
|
|
- {
|
|
|
- label: "云存储类别",
|
|
|
- prop: "cloudStorageType",
|
|
|
- span: 12,
|
|
|
- type: "select",
|
|
|
- dataType: "number",
|
|
|
- dicUrl: "/api/blade-system/dict-biz/dictionary?code=cloud_storage_type",
|
|
|
+ editDisplay: false,
|
|
|
+ addDisplay: false,
|
|
|
+ width: 150,
|
|
|
+ overHidden: true,
|
|
|
+ search: true,
|
|
|
+ dicFlag :false,
|
|
|
+ cascaderItem: ['buildingId'],
|
|
|
+ dicUrl: "/api/community/residential/select?agencyId={{key}}",
|
|
|
props: {
|
|
|
- label: 'dictValue',
|
|
|
- value: 'dictKey'
|
|
|
+ label: 'name',
|
|
|
+ value: 'id'
|
|
|
},
|
|
|
rules: [{
|
|
|
required: true,
|
|
|
- message: "请输入云存储类别(0:无云存储,1:电信分布式存储,2:21cn存储)",
|
|
|
- trigger: "blur"
|
|
|
- }]
|
|
|
- },
|
|
|
- {
|
|
|
- label: "云存储配置id",
|
|
|
- prop: "cloudStorageConfId",
|
|
|
- span: 12,
|
|
|
- hide: true,
|
|
|
- rules: [{
|
|
|
- required: true,
|
|
|
- message: "请输入云存储配置id",
|
|
|
- trigger: "blur"
|
|
|
- }]
|
|
|
- },
|
|
|
- {
|
|
|
- // label: "视频流获取方式(0:主动推流,1:主动拉取流)",
|
|
|
- label: "视频流获取方式",
|
|
|
- prop: "streamType",
|
|
|
- span: 12,
|
|
|
- hide: true,
|
|
|
- rules: [{
|
|
|
- required: true,
|
|
|
- message: "请输入视频流获取方式(0:主动推流,1:主动拉取流)",
|
|
|
- trigger: "blur"
|
|
|
- }]
|
|
|
- },
|
|
|
- {
|
|
|
- label: "设备地址",
|
|
|
- prop: "address",
|
|
|
- span: 12,
|
|
|
- hide: true,
|
|
|
- rules: [{
|
|
|
- required: true,
|
|
|
- message: "请输入设备地址",
|
|
|
- trigger: "blur"
|
|
|
- }]
|
|
|
- },
|
|
|
- {
|
|
|
- // label: "是否拥有者(0:否,1:是)",
|
|
|
- label: "是否拥有者",
|
|
|
- prop: "isOwner",
|
|
|
- span: 12,
|
|
|
- hide: true,
|
|
|
- rules: [{
|
|
|
- required: true,
|
|
|
- message: "请输入是否拥有者(0:否,1:是)",
|
|
|
- trigger: "blur"
|
|
|
- }]
|
|
|
- },
|
|
|
- {
|
|
|
- label: "所属NVR的编号",
|
|
|
- prop: "parentNvrNum",
|
|
|
- span: 12,
|
|
|
- hide: true,
|
|
|
- rules: [{
|
|
|
- required: true,
|
|
|
- message: "请输入所属NVR的编号",
|
|
|
- trigger: "blur"
|
|
|
- }]
|
|
|
- },
|
|
|
- {
|
|
|
- // label: "告警状态(0:正常;1:告警)",
|
|
|
- label: "告警状态",
|
|
|
- prop: "alarmStatus",
|
|
|
- span: 12,
|
|
|
- hide: true,
|
|
|
- rules: [{
|
|
|
- required: true,
|
|
|
- message: "请输入告警状态(0:正常;1:告警)",
|
|
|
+ message: "请输入所属区域",
|
|
|
trigger: "blur"
|
|
|
}]
|
|
|
},
|
|
|
{
|
|
|
- label: "经度",
|
|
|
- prop: "longitude",
|
|
|
- span: 12,
|
|
|
- rules: [{
|
|
|
- required: true,
|
|
|
- message: "请输入经度",
|
|
|
- trigger: "blur"
|
|
|
- }]
|
|
|
+ label: "所属区域",
|
|
|
+ prop: "residentialName",
|
|
|
+ hide: false,
|
|
|
+ viewDisplay: true,
|
|
|
},
|
|
|
{
|
|
|
- label: "纬度",
|
|
|
- prop: "latitude",
|
|
|
- span: 12,
|
|
|
- rules: [{
|
|
|
- required: true,
|
|
|
- message: "请输入纬度",
|
|
|
- trigger: "blur"
|
|
|
- }]
|
|
|
- },
|
|
|
- {
|
|
|
- label: "维护人员信息",
|
|
|
- prop: "maintainer",
|
|
|
- span: 12,
|
|
|
- hide: true,
|
|
|
- rules: [{
|
|
|
- required: true,
|
|
|
- message: "请输入维护人员信息",
|
|
|
- trigger: "blur"
|
|
|
- }]
|
|
|
- },
|
|
|
- {
|
|
|
- label: "是否封存,true封存",
|
|
|
- prop: "block",
|
|
|
- span: 12,
|
|
|
- hide: true,
|
|
|
- rules: [{
|
|
|
- required: true,
|
|
|
- message: "请输入是否封存,true封存",
|
|
|
- trigger: "blur"
|
|
|
- }]
|
|
|
- },
|
|
|
- {
|
|
|
- label: "封存时间",
|
|
|
- prop: "blockTime",
|
|
|
- span: 12,
|
|
|
- hide: true,
|
|
|
- rules: [{
|
|
|
- required: true,
|
|
|
- message: "请输入封存时间",
|
|
|
- trigger: "blur"
|
|
|
- }]
|
|
|
- },
|
|
|
- {
|
|
|
- label: "路由器id",
|
|
|
- prop: "routeId",
|
|
|
- span: 12,
|
|
|
- hide: true,
|
|
|
- rules: [{
|
|
|
- required: true,
|
|
|
- message: "请输入路由器id",
|
|
|
- trigger: "blur"
|
|
|
- }]
|
|
|
- },
|
|
|
- {
|
|
|
- // label: "摄像头类型 G:枪机 D:球机",
|
|
|
- label: "摄像头类型",
|
|
|
- prop: "equipType",
|
|
|
- span: 12,
|
|
|
- hide: true,
|
|
|
- rules: [{
|
|
|
- required: true,
|
|
|
- message: "请输入摄像头类型 G:枪机 D:球机",
|
|
|
- trigger: "blur"
|
|
|
- }]
|
|
|
- },
|
|
|
- {
|
|
|
- label: "设备最后状态更新时间",
|
|
|
- prop: "updateStateTimeString",
|
|
|
- span: 12,
|
|
|
- hide: true,
|
|
|
- rules: [{
|
|
|
- required: true,
|
|
|
- message: "请输入设备最后状态更新时间",
|
|
|
- trigger: "blur"
|
|
|
- }]
|
|
|
- },
|
|
|
- {
|
|
|
- label: "设备监控位id",
|
|
|
- prop: "districtId",
|
|
|
- span: 12,
|
|
|
+ label: "所属楼栋",
|
|
|
+ prop: "buildingId",
|
|
|
+ type: 'select',
|
|
|
hide: true,
|
|
|
+ editDisplay: false,
|
|
|
+ addDisplay: false,
|
|
|
+ width: 150,
|
|
|
+ overHidden: true,
|
|
|
+ search: true,
|
|
|
+ dicFlag :false,
|
|
|
+ dicUrl: "/api/building/building/select?residentialId={{key}}",
|
|
|
+ props: {
|
|
|
+ label: 'name',
|
|
|
+ value: 'id'
|
|
|
+ },
|
|
|
rules: [{
|
|
|
required: true,
|
|
|
- message: "请输入设备监控位id",
|
|
|
+ message: "请输入所属区域",
|
|
|
trigger: "blur"
|
|
|
}]
|
|
|
},
|
|
|
{
|
|
|
- // label: "存储位置(通过该字段快速查询,所有的子节点)机构树位置",
|
|
|
- label: "存储位置",
|
|
|
- prop: "orgPosition",
|
|
|
- span: 12,
|
|
|
- hide: true,
|
|
|
- rules: [{
|
|
|
- required: true,
|
|
|
- message: "请输入存储位置(通过该字段快速查询,所有的子节点)机构树位置",
|
|
|
- trigger: "blur"
|
|
|
- }]
|
|
|
+ label: "所属楼栋",
|
|
|
+ prop: "buildingName",
|
|
|
+ hide: false,
|
|
|
+ viewDisplay: true,
|
|
|
},
|
|
|
{
|
|
|
label: "rtsp视频播放地址",
|
|
|
prop: "rtspUrl",
|
|
|
- span: 12,
|
|
|
- hide: true,
|
|
|
- rules: [{
|
|
|
- required: true,
|
|
|
- message: "请输入rtsp视频播放地址",
|
|
|
- trigger: "blur"
|
|
|
- }]
|
|
|
},
|
|
|
{
|
|
|
- label: "http-flv视频播放地址",
|
|
|
- prop: "httpFlvUrl",
|
|
|
- span: 12,
|
|
|
- hide: true,
|
|
|
+ label: "安装位置",
|
|
|
+ prop: "address",
|
|
|
rules: [{
|
|
|
- required: true,
|
|
|
- message: "请输入http-flv视频播放地址",
|
|
|
+ required: false,
|
|
|
+ message: "请输入安装位置",
|
|
|
trigger: "blur"
|
|
|
}]
|
|
|
},
|
|
|
+ ]
|
|
|
+ },
|
|
|
+ bindOption: {
|
|
|
+ column: [
|
|
|
{
|
|
|
- label: "所属账户",
|
|
|
- prop: "accountName",
|
|
|
- span: 12,
|
|
|
- hide: true,
|
|
|
+ label: "所属园区",
|
|
|
+ prop: "agencyId",
|
|
|
+ type: 'select',
|
|
|
+ span:24,
|
|
|
+ overHidden: true,
|
|
|
+ search: true,
|
|
|
+ remote: true,
|
|
|
+ dicUrl: "/api/agency/agency/select?agencyName={{key}}",
|
|
|
+ cascaderItem: ['residentialId'],
|
|
|
+ props: {
|
|
|
+ label: 'agencyName',
|
|
|
+ value: 'id'
|
|
|
+ },
|
|
|
rules: [{
|
|
|
required: true,
|
|
|
- message: "请输入所属账户",
|
|
|
+ message: "请输入所属园区",
|
|
|
trigger: "blur"
|
|
|
}]
|
|
|
},
|
|
|
- ]
|
|
|
- },
|
|
|
- bindOption: {
|
|
|
- column: [{
|
|
|
- label: "所属小区",
|
|
|
+ {
|
|
|
+ label: "所属区域",
|
|
|
prop: "residentialId",
|
|
|
search: true,
|
|
|
span:24,
|
|
|
cascaderItem: ['buildingId'],
|
|
|
type: "select",
|
|
|
remote: true,
|
|
|
-
|
|
|
- dicUrl: "/api/community/residential/select?name={{key}}",
|
|
|
+ dicUrl: "/api/building/residential/select?agencyId={{key}}",
|
|
|
props: {
|
|
|
label: "name",
|
|
|
value: "id"
|
|
|
},
|
|
|
rules: [{
|
|
|
required: true,
|
|
|
- message: "请选择所属小区",
|
|
|
+ message: "请选择所属区域",
|
|
|
trigger: "blur"
|
|
|
}]
|
|
|
},
|
|
|
@@ -597,260 +338,285 @@
|
|
|
value: "id"
|
|
|
},
|
|
|
|
|
|
- }]
|
|
|
+ }]
|
|
|
|
|
|
- },
|
|
|
- data: []
|
|
|
+ },
|
|
|
+ data: []
|
|
|
+ };
|
|
|
+ },
|
|
|
+ computed: {
|
|
|
+ ...mapGetters(["permission"]),
|
|
|
+ permissionList() {
|
|
|
+ return {
|
|
|
+ addBtn: this.vaildData(this.permission.videoclouddevice_add, false),
|
|
|
+ viewBtn: this.vaildData(this.permission.videoclouddevice_view, false),
|
|
|
+ delBtn: this.vaildData(this.permission.videoclouddevice_delete, false),
|
|
|
+ editBtn: this.vaildData(this.permission.videoclouddevice_edit, false)
|
|
|
};
|
|
|
},
|
|
|
- computed: {
|
|
|
- ...mapGetters(["permission"]),
|
|
|
- permissionList() {
|
|
|
- return {
|
|
|
- addBtn: this.vaildData(this.permission.videoclouddevice_add, false),
|
|
|
- viewBtn: this.vaildData(this.permission.videoclouddevice_view, false),
|
|
|
- delBtn: this.vaildData(this.permission.videoclouddevice_delete, false),
|
|
|
- editBtn: this.vaildData(this.permission.videoclouddevice_edit, false)
|
|
|
- };
|
|
|
- },
|
|
|
- ids() {
|
|
|
- let ids = [];
|
|
|
- this.selectionList.forEach(ele => {
|
|
|
- ids.push(ele.id);
|
|
|
- });
|
|
|
- return ids.join(",");
|
|
|
- }
|
|
|
- },
|
|
|
- methods: {
|
|
|
- showVideo(row) {
|
|
|
- // this.video.url = "http://139.9.103.171/live?port=1935&app=myapp&stream=" + row.id;
|
|
|
- this.video.url = "ws://36.103.228.148:8888/live/" + row.id + ".flv";
|
|
|
- this.video.name = row.deviceName;
|
|
|
- this.videoVisible = true;
|
|
|
- this.$nextTick(() => {
|
|
|
- try {
|
|
|
- let videoElement = document.getElementById('videoId');
|
|
|
- let flvPlayer = flvjs.createPlayer({
|
|
|
- type: 'flv',
|
|
|
- url: this.video.url
|
|
|
- });
|
|
|
- flvPlayer.on(flvjs.Events.ERROR, (errType, errDetail) => {
|
|
|
- // errType是 NetworkError时,对应errDetail有:Exception、HttpStatusCodeInvalid、ConnectingTimeout、EarlyEof、UnrecoverableEarlyEof
|
|
|
- // errType是 MediaError时,对应errDetail是MediaMSEError
|
|
|
- });
|
|
|
- flvPlayer.on(flvjs.Events.MEDIA_SOURCE_CLOSE || flvjs.Events.MEDIA_SOURCE_ENDED, () => {})
|
|
|
- flvPlayer.attachMediaElement(videoElement);
|
|
|
- flvPlayer.load();
|
|
|
- flvPlayer.play();
|
|
|
- } catch (e) {
|
|
|
- console.log(e);
|
|
|
- }
|
|
|
- })
|
|
|
- },
|
|
|
- showDeviceBindBatch() {
|
|
|
- if (this.selectionList.length === 0) {
|
|
|
- this.$message.warning("请选择至少一条数据");
|
|
|
- return;
|
|
|
- }
|
|
|
- if (this.residentialList.length == 0) {
|
|
|
- // 请求获取小区列表
|
|
|
- getAllList().then(res => {
|
|
|
- this.residentialList = res.data.data;
|
|
|
- this.selectValue = "";
|
|
|
- this.bindBatchVisible = true;
|
|
|
- })
|
|
|
- } else {
|
|
|
- this.selectValue = ""
|
|
|
- this.bindBatchVisible = true;
|
|
|
- }
|
|
|
- // this.form = row;
|
|
|
- },
|
|
|
- showDeviceBind(row) {
|
|
|
-
|
|
|
- if (this.residentialList.length == 0) {
|
|
|
- // 请求获取小区列表
|
|
|
- getAllList().then(res => {
|
|
|
- this.residentialList = res.data.data;
|
|
|
- this.selectValue = ""
|
|
|
- this.bindVisible = true;
|
|
|
- })
|
|
|
- } else {
|
|
|
- this.selectValue = ""
|
|
|
- this.bindVisible = true;
|
|
|
- }
|
|
|
- this.bindForm = row;
|
|
|
- },
|
|
|
- bindBatchDevice(loading,done) {
|
|
|
- // if (this.selectValue == "") {
|
|
|
- // this.$message.warning("请选择所属小区");
|
|
|
- // return;
|
|
|
- // }
|
|
|
- //保存
|
|
|
- debugger
|
|
|
- bindResidentialBatch(this.ids, this.bindBatchForm.residentialId,this.bindBatchForm.buildingId).then(() => {
|
|
|
- // debugger
|
|
|
- this.bindBatchVisible = false;
|
|
|
- this.bindBatchForm = {};
|
|
|
- this.onLoad(this.page);
|
|
|
-
|
|
|
- this.$message({
|
|
|
- type: "success",
|
|
|
- message: "操作成功!"
|
|
|
- });
|
|
|
- done();
|
|
|
- }, error => {
|
|
|
- loading();
|
|
|
- console.log(error);
|
|
|
+ ids() {
|
|
|
+ let ids = [];
|
|
|
+ this.selectionList.forEach(ele => {
|
|
|
+ ids.push(ele.id);
|
|
|
+ });
|
|
|
+ return ids.join(",");
|
|
|
+ }
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ syncDevice(accountName, deviceNum){
|
|
|
+ syncByDevice(accountName, deviceNum).then(res => {
|
|
|
+ if (res.data.success) {
|
|
|
+ this.$message({
|
|
|
+ type: "success",
|
|
|
+ message: res.data.msg
|
|
|
});
|
|
|
- },
|
|
|
- bindDevice(loading,done) {
|
|
|
- // this.form.residentialId = this.selectValue;
|
|
|
- //保存
|
|
|
- updateVideoDevice(this.bindForm).then(() => {
|
|
|
- this.onLoad(this.page);
|
|
|
- this.bindVisible = false;
|
|
|
- this.$message({
|
|
|
- type: "success",
|
|
|
- message: "操作成功!"
|
|
|
- });
|
|
|
- done();
|
|
|
- }, error => {
|
|
|
- loading();
|
|
|
- console.log(error);
|
|
|
+ this.onLoad(this.page);
|
|
|
+ } else {
|
|
|
+ this.$message({
|
|
|
+ type: "error",
|
|
|
+ message: res.data.msg
|
|
|
});
|
|
|
- },
|
|
|
- rowSave(row, done, loading) {
|
|
|
- add(row).then(() => {
|
|
|
- this.onLoad(this.page);
|
|
|
- this.$message({
|
|
|
- type: "success",
|
|
|
- message: "操作成功!"
|
|
|
- });
|
|
|
- done();
|
|
|
- }, error => {
|
|
|
- loading();
|
|
|
- window.console.log(error);
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ showVideo(row) {
|
|
|
+ // this.video.url = "http://139.9.103.171/live?port=1935&app=myapp&stream=" + row.id;
|
|
|
+ this.video.url = "ws://36.103.228.148:8866/live?url=" + row.rtspUrl + "&&&ffmpeg=true";;
|
|
|
+ this.video.name = row.deviceName;
|
|
|
+ this.videoVisible = true;
|
|
|
+ this.$nextTick(() => {
|
|
|
+ try {
|
|
|
+ let videoElement = document.getElementById('videoId');
|
|
|
+ let flvPlayer = flvjs.createPlayer({
|
|
|
+ type: 'flv',
|
|
|
+ url: this.video.url
|
|
|
});
|
|
|
- },
|
|
|
- rowUpdate(row, index, done, loading) {
|
|
|
- update(row).then(() => {
|
|
|
- this.onLoad(this.page);
|
|
|
- this.$message({
|
|
|
- type: "success",
|
|
|
- message: "操作成功!"
|
|
|
- });
|
|
|
- done();
|
|
|
- }, error => {
|
|
|
- loading();
|
|
|
- console.log(error);
|
|
|
+ flvPlayer.on(flvjs.Events.ERROR, (errType, errDetail) => {
|
|
|
+ // errType是 NetworkError时,对应errDetail有:Exception、HttpStatusCodeInvalid、ConnectingTimeout、EarlyEof、UnrecoverableEarlyEof
|
|
|
+ // errType是 MediaError时,对应errDetail是MediaMSEError
|
|
|
});
|
|
|
- },
|
|
|
- rowDel(row) {
|
|
|
- this.$confirm("确定将选择数据删除?", {
|
|
|
- confirmButtonText: "确定",
|
|
|
- cancelButtonText: "取消",
|
|
|
- type: "warning"
|
|
|
- })
|
|
|
- .then(() => {
|
|
|
- return remove(row.id);
|
|
|
- })
|
|
|
- .then(() => {
|
|
|
- this.onLoad(this.page);
|
|
|
- this.$message({
|
|
|
- type: "success",
|
|
|
- message: "操作成功!"
|
|
|
- });
|
|
|
- });
|
|
|
- },
|
|
|
- handleDelete() {
|
|
|
- if (this.selectionList.length === 0) {
|
|
|
- this.$message.warning("请选择至少一条数据");
|
|
|
- return;
|
|
|
- }
|
|
|
- this.$confirm("确定将选择数据删除?", {
|
|
|
- confirmButtonText: "确定",
|
|
|
- cancelButtonText: "取消",
|
|
|
- type: "warning"
|
|
|
- })
|
|
|
- .then(() => {
|
|
|
- return remove(this.ids);
|
|
|
- })
|
|
|
- .then(() => {
|
|
|
- this.onLoad(this.page);
|
|
|
- this.$message({
|
|
|
- type: "success",
|
|
|
- message: "操作成功!"
|
|
|
- });
|
|
|
- this.$refs.crud.toggleSelection();
|
|
|
- });
|
|
|
- },
|
|
|
- beforeOpen(done, type) {
|
|
|
- if (["edit", "view"].includes(type)) {
|
|
|
- getDetail(this.form.id).then(res => {
|
|
|
- this.form = res.data.data;
|
|
|
- });
|
|
|
- }
|
|
|
- done();
|
|
|
- },
|
|
|
- searchReset() {
|
|
|
- this.query = {};
|
|
|
+ flvPlayer.on(flvjs.Events.MEDIA_SOURCE_CLOSE || flvjs.Events.MEDIA_SOURCE_ENDED, () => {})
|
|
|
+ flvPlayer.attachMediaElement(videoElement);
|
|
|
+ flvPlayer.load();
|
|
|
+ flvPlayer.play();
|
|
|
+ } catch (e) {
|
|
|
+ console.log(e);
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ showDeviceBindBatch() {
|
|
|
+ if (this.selectionList.length === 0) {
|
|
|
+ this.$message.warning("请选择至少一条数据");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if (this.residentialList.length == 0) {
|
|
|
+ // 请求获取区域列表
|
|
|
+ getAllList().then(res => {
|
|
|
+ this.residentialList = res.data.data;
|
|
|
+ this.selectValue = "";
|
|
|
+ this.bindBatchVisible = true;
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ this.selectValue = ""
|
|
|
+ this.bindBatchVisible = true;
|
|
|
+ }
|
|
|
+ // this.form = row;
|
|
|
+ },
|
|
|
+ showDeviceBind(row) {
|
|
|
+
|
|
|
+ if (this.residentialList.length == 0) {
|
|
|
+ // 请求获取区域列表
|
|
|
+ getAllList().then(res => {
|
|
|
+ this.residentialList = res.data.data;
|
|
|
+ this.selectValue = ""
|
|
|
+ this.bindVisible = true;
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ this.selectValue = ""
|
|
|
+ this.bindVisible = true;
|
|
|
+ }
|
|
|
+ this.bindForm = row;
|
|
|
+ },
|
|
|
+ syncVideoUrl(accountName, deviceNum){
|
|
|
+ getVideoUrl(accountName, deviceNum).then(res =>{
|
|
|
+ this.$message({
|
|
|
+ type: "success",
|
|
|
+ message: res.data.msg
|
|
|
+ });
|
|
|
+ this.onLoad(this.page);
|
|
|
+ })
|
|
|
+ },
|
|
|
+ bindBatchDevice(loading,done) {
|
|
|
+ // if (this.selectValue == "") {
|
|
|
+ // this.$message.warning("请选择所属区域");
|
|
|
+ // return;
|
|
|
+ // }
|
|
|
+ //保存
|
|
|
+ bindResidentialBatch(this.ids, this.bindBatchForm.residentialId,this.bindBatchForm.buildingId).then(() => {
|
|
|
+ // debugger
|
|
|
+ this.bindBatchVisible = false;
|
|
|
+ this.bindBatchForm = {};
|
|
|
+ this.onLoad(this.page);
|
|
|
+
|
|
|
+ this.$message({
|
|
|
+ type: "success",
|
|
|
+ message: "操作成功!"
|
|
|
+ });
|
|
|
+ done();
|
|
|
+ }, error => {
|
|
|
+ loading();
|
|
|
+ console.log(error);
|
|
|
+ });
|
|
|
+ },
|
|
|
+ bindDevice(loading,done) {
|
|
|
+ // this.form.residentialId = this.selectValue;
|
|
|
+ //保存
|
|
|
+ updateVideoDevice(this.bindForm).then(() => {
|
|
|
+ this.onLoad(this.page);
|
|
|
+ this.bindVisible = false;
|
|
|
+ this.$message({
|
|
|
+ type: "success",
|
|
|
+ message: "操作成功!"
|
|
|
+ });
|
|
|
+ done();
|
|
|
+ }, error => {
|
|
|
+ loading();
|
|
|
+ console.log(error);
|
|
|
+ });
|
|
|
+ },
|
|
|
+ rowSave(row, done, loading) {
|
|
|
+ add(row).then(() => {
|
|
|
+ this.onLoad(this.page);
|
|
|
+ this.$message({
|
|
|
+ type: "success",
|
|
|
+ message: "操作成功!"
|
|
|
+ });
|
|
|
+ done();
|
|
|
+ }, error => {
|
|
|
+ loading();
|
|
|
+ window.console.log(error);
|
|
|
+ });
|
|
|
+ },
|
|
|
+ rowUpdate(row, index, done, loading) {
|
|
|
+ update(row).then(() => {
|
|
|
+ this.onLoad(this.page);
|
|
|
+ this.$message({
|
|
|
+ type: "success",
|
|
|
+ message: "操作成功!"
|
|
|
+ });
|
|
|
+ done();
|
|
|
+ }, error => {
|
|
|
+ loading();
|
|
|
+ console.log(error);
|
|
|
+ });
|
|
|
+ },
|
|
|
+ rowDel(row) {
|
|
|
+ this.$confirm("确定将选择数据删除?", {
|
|
|
+ confirmButtonText: "确定",
|
|
|
+ cancelButtonText: "取消",
|
|
|
+ type: "warning"
|
|
|
+ })
|
|
|
+ .then(() => {
|
|
|
+ return remove(row.id);
|
|
|
+ })
|
|
|
+ .then(() => {
|
|
|
this.onLoad(this.page);
|
|
|
- },
|
|
|
- searchChange(params, done) {
|
|
|
- this.query = params;
|
|
|
- this.page.currentPage = 1;
|
|
|
- this.onLoad(this.page, params);
|
|
|
- done();
|
|
|
- },
|
|
|
- selectionChange(list) {
|
|
|
- this.selectionList = list;
|
|
|
- },
|
|
|
- selectionClear() {
|
|
|
- this.selectionList = [];
|
|
|
- this.$refs.crud.toggleSelection();
|
|
|
- },
|
|
|
- currentChange(currentPage) {
|
|
|
- this.page.currentPage = currentPage;
|
|
|
- },
|
|
|
- sizeChange(pageSize) {
|
|
|
- this.page.pageSize = pageSize;
|
|
|
- },
|
|
|
- refreshChange() {
|
|
|
- this.onLoad(this.page, this.query);
|
|
|
- },
|
|
|
- edit(row) {
|
|
|
- this.editForm = row;
|
|
|
- this.editVisiable = true;
|
|
|
- },
|
|
|
- view(row) {
|
|
|
- this.detailForm = row;
|
|
|
- this.detailVisible = true;
|
|
|
- },
|
|
|
- submitVideoclouddevice(row,done,loading) {
|
|
|
- update(row).then(() => {
|
|
|
- this.onLoad(this.page);
|
|
|
- this.$message({
|
|
|
- type: "success",
|
|
|
- message: "操作成功!"
|
|
|
- });
|
|
|
- done();
|
|
|
- }, error => {
|
|
|
- loading();
|
|
|
- console.log(error);
|
|
|
+ this.$message({
|
|
|
+ type: "success",
|
|
|
+ message: "操作成功!"
|
|
|
});
|
|
|
- },
|
|
|
- onLoad(page, params = {}) {
|
|
|
- this.loading = true;
|
|
|
- getList(page.currentPage, page.pageSize, Object.assign(params, this.query)).then(res => {
|
|
|
- const data = res.data.data;
|
|
|
- this.page.total = data.total;
|
|
|
- this.data = data.records;
|
|
|
- this.loading = false;
|
|
|
- this.selectionClear();
|
|
|
+ });
|
|
|
+ },
|
|
|
+ handleDelete() {
|
|
|
+ if (this.selectionList.length === 0) {
|
|
|
+ this.$message.warning("请选择至少一条数据");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ this.$confirm("确定将选择数据删除?", {
|
|
|
+ confirmButtonText: "确定",
|
|
|
+ cancelButtonText: "取消",
|
|
|
+ type: "warning"
|
|
|
+ })
|
|
|
+ .then(() => {
|
|
|
+ return remove(this.ids);
|
|
|
+ })
|
|
|
+ .then(() => {
|
|
|
+ this.onLoad(this.page);
|
|
|
+ this.$message({
|
|
|
+ type: "success",
|
|
|
+ message: "操作成功!"
|
|
|
});
|
|
|
- }
|
|
|
+ this.$refs.crud.toggleSelection();
|
|
|
+ });
|
|
|
+ },
|
|
|
+ beforeOpen(done, type) {
|
|
|
+ if (["edit", "view"].includes(type)) {
|
|
|
+ getDetail(this.form.id).then(res => {
|
|
|
+ this.form = res.data.data;
|
|
|
+ });
|
|
|
}
|
|
|
- };
|
|
|
+ done();
|
|
|
+ },
|
|
|
+ searchReset() {
|
|
|
+ this.query = {};
|
|
|
+ this.onLoad(this.page);
|
|
|
+ },
|
|
|
+ searchChange(params, done) {
|
|
|
+ this.query = params;
|
|
|
+ this.page.currentPage = 1;
|
|
|
+ this.onLoad(this.page, params);
|
|
|
+ done();
|
|
|
+ },
|
|
|
+ selectionChange(list) {
|
|
|
+ this.selectionList = list;
|
|
|
+ },
|
|
|
+ selectionClear() {
|
|
|
+ this.selectionList = [];
|
|
|
+ this.$refs.crud.toggleSelection();
|
|
|
+ },
|
|
|
+ currentChange(currentPage) {
|
|
|
+ this.page.currentPage = currentPage;
|
|
|
+ },
|
|
|
+ sizeChange(pageSize) {
|
|
|
+ this.page.pageSize = pageSize;
|
|
|
+ },
|
|
|
+ refreshChange() {
|
|
|
+ this.onLoad(this.page, this.query);
|
|
|
+ },
|
|
|
+ edit(row) {
|
|
|
+ this.editForm = row;
|
|
|
+ this.editVisiable = true;
|
|
|
+ },
|
|
|
+ view(row) {
|
|
|
+ this.detailForm = row;
|
|
|
+ this.detailVisible = true;
|
|
|
+ },
|
|
|
+ submitVideoclouddevice(row,done,loading) {
|
|
|
+ update(row).then(() => {
|
|
|
+ this.onLoad(this.page);
|
|
|
+ this.$message({
|
|
|
+ type: "success",
|
|
|
+ message: "操作成功!"
|
|
|
+ });
|
|
|
+ done();
|
|
|
+ this.editVisiable = false;
|
|
|
+ }, error => {
|
|
|
+ loading();
|
|
|
+ console.log(error);
|
|
|
+ });
|
|
|
+ },
|
|
|
+ onLoad(page, params = {}) {
|
|
|
+ this.loading = true;
|
|
|
+ getList(page.currentPage, page.pageSize, Object.assign(params, this.query)).then(res => {
|
|
|
+ const data = res.data.data;
|
|
|
+ this.page.total = data.total;
|
|
|
+ this.data = data.records;
|
|
|
+ this.loading = false;
|
|
|
+ this.selectionClear();
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }
|
|
|
+ };
|
|
|
</script>
|
|
|
|
|
|
<style>
|