Merge remote-tracking branch 'origin/wvp-28181-2.0' into map

# Conflicts:
#	src/main/java/com/genersoft/iot/vmp/gb28181/event/subscribe/SubscribeListenerForPlatform.java
This commit is contained in:
648540858
2022-04-15 09:37:33 +08:00
39 changed files with 1024 additions and 340 deletions

View File

@@ -57,7 +57,7 @@
<el-table-column label="操作" width="450" align="center" fixed="right">
<template slot-scope="scope">
<el-button size="mini" :loading="scope.row.loading" v-if="scope.row.online!=0" icon="el-icon-refresh" @click="refDevice(scope.row)">刷新</el-button>
<el-button size="mini" v-if="scope.row.online!=0" icon="el-icon-refresh" @click="refDevice(scope.row)" @mouseover="getTooltipContent(scope.row.deviceId)">刷新</el-button>
<el-button-group>
<el-button size="mini" icon="el-icon-video-camera-solid" v-bind:disabled="scope.row.online==0" type="primary" @click="showChannelList(scope.row)">通道</el-button>
<el-button size="mini" icon="el-icon-location" v-bind:disabled="scope.row.online==0" type="primary" @click="showDevicePosition(scope.row)">定位</el-button>
@@ -78,6 +78,7 @@
:total="total">
</el-pagination>
<deviceEdit ref="deviceEdit" ></deviceEdit>
<syncChannelProgress ref="syncChannelProgress" ></syncChannelProgress>
</el-main>
</el-container>
</div>
@@ -86,11 +87,13 @@
<script>
import uiHeader from './UiHeader.vue'
import deviceEdit from './dialog/deviceEdit.vue'
import syncChannelProgress from './dialog/SyncChannelProgress.vue'
export default {
name: 'app',
components: {
uiHeader,
deviceEdit
deviceEdit,
syncChannelProgress,
},
data() {
return {
@@ -104,7 +107,7 @@
currentPage:1,
count:15,
total:0,
getDeviceListLoading: false
getDeviceListLoading: false,
};
},
computed: {
@@ -117,8 +120,6 @@
});
this.currentDeviceChannelsLenth = channels.length;
}
console.log("数据:" + JSON.stringify(channels));
return channels;
}
},
@@ -153,13 +154,11 @@
count: that.count
}
}).then(function (res) {
console.log(res);
console.log(res.data.list);
that.total = res.data.total;
that.deviceList = res.data.list;
that.getDeviceListLoading = false;
}).catch(function (error) {
console.log(error);
console.error(error);
that.getDeviceListLoading = false;
});
@@ -182,7 +181,7 @@
}).then((res)=>{
this.getDeviceList();
}).catch((error) =>{
console.log(error);
console.error(error);
});
}).catch(() => {
@@ -191,11 +190,9 @@
},
showChannelList: function(row) {
console.log(JSON.stringify(row))
this.$router.push(`/channelList/${row.deviceId}/0/15/1`);
},
showDevicePosition: function(row) {
console.log(JSON.stringify(row))
this.$router.push(`/devicePosition/${row.deviceId}/0/15/1`);
},
@@ -203,12 +200,11 @@
//刷新设备信息
refDevice: function(itemData) {
console.log("刷新对应设备:" + itemData.deviceId);
var that = this;
that.$set(itemData,"loading", true);
let that = this;
this.$axios({
method: 'post',
url: '/api/device/query/devices/' + itemData.deviceId + '/sync'
}).then(function(res) {
}).then((res) => {
console.log("刷新设备结果:"+JSON.stringify(res));
if (res.data.code !==0) {
that.$message({
@@ -217,24 +213,44 @@
type: 'error'
});
}else{
that.$message({
showClose: true,
message: res.data.msg,
type: 'success'
});
// that.$message({
// showClose: true,
// message: res.data.msg,
// type: 'success'
// });
this.$refs.syncChannelProgress.openDialog(itemData.deviceId)
}
that.initData()
that.$set(itemData,"loading", true);
}).catch(function(e) {
}).catch((e) => {
console.error(e)
that.$message({
showClose: true,
message: e,
type: 'error'
});
that.$set(itemData,"loading", true);
});
},
getTooltipContent: async function (deviceId){
let result = "";
await this.$axios({
method: 'get',
async: false,
url:`/api/device/query/${deviceId}/sync_status/`,
}).then((res) => {
if (res.data.code == 0) {
if (res.data.data.errorMsg !== null) {
result = res.data.data.errorMsg
} else if (res.data.msg !== null) {
result = res.data.msg
} else {
result = `同步中...[${res.data.data.current}/${res.data.data.total}]`;
}
}
})
return result;
},
//通知设备上传媒体流
sendDevicePush: function(itemData) {
// let deviceId = this.currentDevice.deviceId;
@@ -251,7 +267,6 @@
// });
},
transportChange: function (row) {
console.log(row);
console.log(`修改传输方式为 ${row.streamMode}${row.deviceId} `);
let that = this;
this.$axios({
@@ -263,7 +278,6 @@
});
},
edit: function (row) {
console.log(row);
this.$refs.deviceEdit.openDialog(row, ()=>{
this.$refs.deviceEdit.close();
this.$message({

View File

@@ -0,0 +1,102 @@
<template>
<div id="SyncChannelProgress" v-loading="isLoging">
<el-dialog
width="240px"
top="13%"
:append-to-body="true"
:close-on-click-modal="false"
:visible.sync="showDialog"
:destroy-on-close="true"
:show-close="true"
@close="close()"
style="text-align: center">
<el-progress type="circle" :percentage="percentage" :status="syncStatus"></el-progress>
<div style="text-align: center">
{{msg}}
</div>
</el-dialog>
</div>
</template>
<script>
export default {
name: "SyncChannelProgress",
computed: {},
props: ['platformId'],
created() {},
data() {
return {
syncStatus: null,
percentage: 0,
total: 0,
current: 0,
showDialog: false,
isLoging: false,
syncFlag: false,
deviceId: null,
timmer: null,
msg: "正在同步",
};
},
methods: {
openDialog: function (deviceId) {
console.log("deviceId: " + deviceId)
this.deviceId = deviceId;
this.showDialog = true;
this.msg = "";
this.percentage= 0;
this.total= 0;
this.current= 0;
this.syncFlag= false;
this.syncStatus = null;
this.getProgress()
},
getProgress(){
this.$axios({
method: 'get',
url:`/api/device/query/${this.deviceId}/sync_status/`,
}).then((res) => {
if (res.data.code == 0) {
if (!this.syncFlag) {
this.syncFlag = true;
}
if (res.data.data == null) {
this.syncStatus = "success"
this.percentage = 100;
this.msg = '同步成功';
}else if (res.data.data.total == 0){
this.msg = `等待同步中`;
this.timmer = setTimeout(this.getProgress, 300)
}else if (res.data.data.errorMsg !== null ){
this.msg = res.data.data.errorMsg;
this.syncStatus = "exception"
}else {
this.total = res.data.data.total;
this.current = res.data.data.current;
this.percentage = Math.floor(Number(res.data.data.current)/Number(res.data.data.total)* 10000)/100;
this.msg = `同步中...[${res.data.data.current}/${res.data.data.total}]`;
this.timmer = setTimeout(this.getProgress, 300)
}
}else {
if (this.syncFlag) {
this.syncStatus = "success"
this.percentage = 100;
this.msg = '同步成功';
}else {
this.syncStatus = "error"
this.msg = res.data.msg;
}
}
}).catch((error) =>{
console.log(error);
this.syncStatus = "error"
this.msg = error.response.data.msg;
});
},
close: function (){
window.clearTimeout(this.timmer)
}
},
};
</script>