Browse Source

声波设备

master
wangxingyuan 7 months ago
parent
commit
901daa404d
16 changed files with 2837 additions and 1127 deletions
  1. +3
    -1
      .env.development
  2. +4
    -1
      .env.production
  3. +3
    -0
      package.json
  4. +2
    -2
      public/static/music_list.html
  5. +383
    -376
      public/static/quniaoShenBo.html
  6. +2
    -2
      public/static/quniaosss.html
  7. +8
    -0
      src/api/quniao/deviceOption.js
  8. +123
    -1
      src/api/quniao/soundWave.js
  9. BIN
      src/assets/1.mp4
  10. +68
    -0
      src/components/FlvPlayer/index.vue
  11. +51
    -36
      src/utils/request.js
  12. +2
    -1
      src/views/login.vue
  13. +758
    -632
      src/views/quniao/device/index.vue
  14. +84
    -0
      src/views/quniao/soundWave/index copy.vue
  15. +1332
    -70
      src/views/quniao/soundWave/index.vue
  16. +14
    -5
      vue.config.js

+ 3
- 1
.env.development View File

@ -5,7 +5,9 @@ VUE_APP_TITLE = 智能驱鸟系统
ENV = 'development'
# 若依管理系统/开发环境
VUE_APP_BASE_API = 'http://192.168.1.70:8082'
VUE_APP_BASE_API = 'http://192.168.1.108:8081'
# 后台管理系统/开发环境摄像头
VUE_APP_CAMERA_API = 'http://192.168.1.108:9000'
# 路由懒加载
VUE_CLI_BABEL_TRANSPILE_MODULES = true

+ 4
- 1
.env.production View File

@ -5,4 +5,7 @@ VUE_APP_TITLE = 智能驱鸟系统
ENV = 'production'
# 若依管理系统/生产环境
VUE_APP_BASE_API = 'http://192.168.1.235:8081'
# VUE_APP_BASE_API = 'http://192.168.1.235:8081'
VUE_APP_BASE_API = 'http://192.168.1.108:8081'
# # 若依管理系统/生产环境摄像头
VUE_APP_CAMERA_API = 'http://192.168.1.108:9000'

+ 3
- 0
package.json View File

@ -37,18 +37,21 @@
},
"dependencies": {
"@riophae/vue-treeselect": "0.4.0",
"@svgdotjs/svg.js": "^3.2.4",
"axios": "0.24.0",
"clipboard": "2.0.8",
"core-js": "3.25.2",
"echarts": "4.9.0",
"element-ui": "2.15.10",
"file-saver": "2.0.5",
"flv.js": "^1.6.2",
"fuse.js": "6.4.3",
"highlight.js": "9.18.5",
"js-beautify": "1.13.0",
"js-cookie": "3.0.1",
"jsencrypt": "3.0.0-rc.1",
"nprogress": "0.2.0",
"panzoom": "^9.4.3",
"quill": "1.3.7",
"screenfull": "5.0.2",
"sortablejs": "1.10.2",


+ 2
- 2
public/static/music_list.html View File

@ -120,8 +120,8 @@
</div>
</body>
<script type="text/javascript">
// let URL='http://localhost:8081';
let URL='http://192.168.1.235:8081';
let URL='http://localhost:8081';
// let URL='http://192.168.1.235:8081';
var device_address = ''
// <!-- 获取曲目列表 -->
function selectBridSongList(address) {


+ 383
- 376
public/static/quniaoShenBo.html
File diff suppressed because it is too large
View File


+ 2
- 2
public/static/quniaosss.html View File

@ -127,9 +127,9 @@
</body>
<script>
// let URLS='http://192.168.1.62:8081'; //测试环境
// let URLS='http://localhost:8081';
let URLS='http://localhost:8081';
// let URLS=localStorage.getItem('localHost');
let URLS='http://192.168.1.235:8081';
// let URLS='http://192.168.1.235:8081';
function initChart(result1,result2,dataZoomEnd){
let myChart = echarts.init(document.getElementById('main'));


+ 8
- 0
src/api/quniao/deviceOption.js View File

@ -77,3 +77,11 @@ export function musicListReq(data){
data:data
})
}
// 添加
export function addDeviceTask(data){
return request({
url: `/api/brid/addDeviceTask`,
method: 'post',
data:data
})
}

+ 123
- 1
src/api/quniao/soundWave.js View File

@ -1,7 +1,129 @@
import request from '@/utils/request'
export function oneKeyReq(data){
export function oneKeyReq(data) {
return request({
url: `/api/brid/OneClickStop?linkShow=${data}`,
method: 'post',
})
}
// 云台控制
export function control(data) {
return request({
url: `/api/brid/control`,
method: 'post',
data: data
})
}
// 请求后台获取摄像头的通道号
export function cameraList(data) {
return request({
url: `/api/brid/cameraList`,
method: 'post',
data: {}
})
}
// 请求后台获取摄像头的nvrip
export function nvrList(data) {
return request({
url: `/api/brid/nvrList`,
method: 'post',
data: {}
})
}
// 获取巡视路线
export function patrolList(data) {
return request({
url: `/api/brid/patrolList`,
method: 'post',
data: {}
})
}
//巡航路线的开始和停止功能
export function turnType(data, turnType) {
return request({
url: `/api/brid/${turnType}`,
method: 'post',
data: data
})
}
//请求巡视路线的详情
export function patrolPositionList(data) {
return request({
url: `/api/brid/patrolPositionList`,
method: 'post',
data: data
})
}
// 新增巡视路线内预置点
export function addPatrolPosition(data) {
return request({
url: `/api/brid/addPatrolPosition`,
method: 'post',
data: data
})
}
// 删除巡视路线
export function delPatrolPositionVelocity(data) {
return request({
url: `/api/brid/delPatrolPositionVelocity`,
method: 'post',
data: data
})
}
// 巡视任务查询
export function patrolTaskList(data) {
return request({
url: `/api/brid/patrolTaskList`,
method: 'post',
// data: data
})
}
// 删除巡视任务
export function delPatrolTask(data) {
return request({
url: `/api/brid/delPatrolTask`,
method: 'post',
data: data
})
}
// 新增巡视任务
export function addPatrolTask(data) {
return request({
url: `/api/brid/addPatrolTask`,
method: 'post',
data: data
})
}
// 初始化预置位
export function positionList(data) {
return request({
url: `/api/brid/positionList?cameraCode=${data}`,
method: 'post',
// data: data
})
}
// 设置、跳转、清除预置位
export function Preset(url, data) {
return request({
url: `/api/brid/${url}`,
method: 'post',
data: data
})
}
// 初始化可见光视频
export function visibleList(data) {
return request({
baseUrl: 'VUE_APP_CAMERA_API',
url: `/api/push/getPlayUrl?app=1&stream=1&mediaServerId=zlmediakit-local`,
method: 'get',
// data: data
})
}
// 获取视频登录
export function videoLogin(data) {
return request({
baseUrl: 'VUE_APP_CAMERA_API',
url: `/api/user/login?username=admin&password=7be97225a5011b868f3b6015c69198d5`,
method: 'get',
// data: data
})
}

BIN
src/assets/1.mp4 View File


+ 68
- 0
src/components/FlvPlayer/index.vue View File

@ -0,0 +1,68 @@
<template>
<div class="flv-player-container">
<video ref="videoElement" autoplay muted controls></video>
</div>
</template>
<script>
import flvjs from "flv.js";
export default {
name: "FlvPlayer",
props: {
src: {
type: String,
required: true,
default: "",
},
},
mounted() {
this.initFlvPlayer();
},
methods: {
initFlvPlayer() {
const videoElement = this.$refs.videoElement;
if (flvjs.isSupported()) {
const flvPlayer = flvjs.createPlayer({
type: "flv",
url: this.src,
isLive: true, //
cors: true,
hasAudio: true,
hasVideo: true,
enableWorker: true,
autoCleanupSourceBuffer: true,
});
flvPlayer.attachMediaElement(videoElement);
flvPlayer.load();
flvPlayer.play().catch((err) => {
console.error("播放失败:", err);
});
// player this 便
this.flvPlayer = flvPlayer;
} else {
console.error("当前浏览器不支持 FLV 播放");
}
},
},
beforeDestroy() {
if (this.flvPlayer) {
this.flvPlayer.destroy();
}
},
};
</script>
<style scoped>
.flv-player-container {
width: 100%;
height: 90%;
}
video {
width: 100%;
height: 100%;
object-fit: cover;
}
</style>

+ 51
- 36
src/utils/request.js View File

@ -22,21 +22,36 @@ const service = axios.create({
// request拦截器
service.interceptors.request.use(config => {
if (config.baseUrl == "VUE_APP_CAMERA_API") {
config.baseURL = process.env.VUE_APP_CAMERA_API
} else {
config.baseURL = process.env.VUE_APP_BASE_API
}
// 是否需要设置 token
const isToken = (config.headers || {}).isToken === false
// 是否需要防止数据重复提交
const isRepeatSubmit = (config.headers || {}).repeatSubmit === false
const isRepeatSubmit = (config.headers || {}).repeatSubmit === false;
// console.log(getToken(), !isToken, '张三')
if (getToken() && !isToken) {
config.headers['Authorization'] = 'Bearer ' + getToken() // 让每个请求携带自定义token 请根据实际情况自行修改
}
// if (config.baseUrl == "VUE_APP_CAMERA_API") {
// config.headers['Authorization'] = 'Bearer ' + getToken() // 让每个请求携带自定义token
// console.log(getToken(), "张三")
// }
// get请求映射params参数
if (config.method === 'get' && config.params) {
if (config.method == 'get' && config.params) {
console.log(111)
let url = config.url + '?' + tansParams(config.params);
url = url.slice(0, -1);
config.params = {};
config.url = url;
}
if (!isRepeatSubmit && (config.method === 'post' || config.method === 'put')) {
// console.log(config,process.env.VUE_APP_BASE_API,process.env.VUE_APP_CAMERA_API)
const requestObj = {
url: config.url,
data: typeof config.data === 'object' ? JSON.stringify(config.data) : config.data,
@ -61,28 +76,28 @@ service.interceptors.request.use(config => {
}
return config
}, error => {
console.log(error)
Promise.reject(error)
console.log(error)
Promise.reject(error)
})
// 响应拦截器
service.interceptors.response.use(res => {
// 未设置状态码则默认成功状态
const code = res.data.code || 200;
// 获取错误信息
const msg = errorCode[code] || res.data.msg || errorCode['default']
// 二进制数据则直接返回
if(res.request.responseType === 'blob' || res.request.responseType === 'arraybuffer'){
return res.data
}
if (code === 401) {
if (!isRelogin.show) {
isRelogin.show = true;
MessageBox.confirm('登录状态已过期,您可以继续留在该页面,或者重新登录', '系统提示', {
confirmButtonText: '重新登录',
cancelButtonText: '取消',
type: 'warning'
}
// 未设置状态码则默认成功状态
const code = res.data.code || 200;
// 获取错误信息
const msg = errorCode[code] || res.data.msg || errorCode['default']
// 二进制数据则直接返回
if (res.request.responseType === 'blob' || res.request.responseType === 'arraybuffer') {
return res.data
}
if (code === 401) {
if (!isRelogin.show) {
isRelogin.show = true;
MessageBox.confirm('登录状态已过期,您可以继续留在该页面,或者重新登录', '系统提示', {
confirmButtonText: '重新登录',
cancelButtonText: '取消',
type: 'warning'
}
).then(() => {
isRelogin.show = false;
store.dispatch('LogOut').then(() => {
@ -92,22 +107,22 @@ service.interceptors.response.use(res => {
isRelogin.show = false;
});
}
return Promise.reject('无效的会话,或者会话已过期,请重新登录。')
} else if (code === 500) {
Message({
message: msg,
type: 'error'
})
return Promise.reject(new Error(msg))
} else if (code !== 200) {
Notification.error({
title: msg
})
return Promise.reject('error')
} else {
return res.data
}
},
return Promise.reject('无效的会话,或者会话已过期,请重新登录。')
} else if (code === 500) {
Message({
message: msg,
type: 'error'
})
return Promise.reject(new Error(msg))
} else if (code !== 200) {
Notification.error({
title: msg
})
return Promise.reject('error')
} else {
return res.data
}
},
error => {
console.log('err' + error)
let { message } = error;


+ 2
- 1
src/views/login.vue View File

@ -110,7 +110,8 @@ export default {
},
beforeCreate(){
//
localStorage.setItem('localHost','http://192.168.1.235:8081')
// localStorage.setItem('localHost','http://192.168.1.235:8081')
localStorage.setItem('localHost','http://192.168.1.108:8081')
},
methods: {
getCode() {


+ 758
- 632
src/views/quniao/device/index.vue
File diff suppressed because it is too large
View File


+ 84
- 0
src/views/quniao/soundWave/index copy.vue View File

@ -0,0 +1,84 @@
<template>
<div class="quniaoApp">
<iframe class="iframe" ref="iframe" :src="src" scrolling="yes"></iframe>
</div>
</template>
<script>
import { MessageBox } from "element-ui";
import {oneKeyReq} from '@/api/quniao/soundWave';
import { Message } from 'element-ui';
export default{
data(){
return{
src:'/static/quniaoShenBo.html'
}
},
methods:{
//iframe
postMessageFromIframe(message){
console.log(message.data)
if(message.data==1){
MessageBox.confirm("确认关闭?")
.then(() => {
oneKeyReq(message.data).then((res)=>{
console.log(res)
if(res.code==200){
this.handleIframeLoad(res,message.data)
Message({
message:'关闭成功',
type:'success'
})
}
})
})
.catch(() => {});
}else if(message.data==0){
MessageBox.confirm("确认开启?")
.then(() => {
oneKeyReq(message.data).then((res)=>{
console.log(res)
if(res.code==200){
this.handleIframeLoad(res,message.data)
Message({
message:'开启成功',
type:'success'
})
}
})
})
.catch(() => {});
}
},
//iframe
handleIframeLoad(data,type) {
let iframeWindow = this.$refs.iframe.contentWindow;
let result={
type,
data
}
iframeWindow.postMessage(result, '*');
},
},
mounted(){
//iframemessage
window.addEventListener('message', this.postMessageFromIframe);
},
beforeDestroy(){
//iframemessage
window.removeEventListener('message',this.postMessageFromIframe);
}
}
</script>
<style scoped>
.quniaoApp{
}
.iframe{
width: 100%;
height: 100%;
border: none;
}
</style>

+ 1332
- 70
src/views/quniao/soundWave/index.vue
File diff suppressed because it is too large
View File


+ 14
- 5
vue.config.js View File

@ -35,12 +35,21 @@ module.exports = {
proxy: {
// detail: https://cli.vuejs.org/config/#devserver-proxy
[process.env.VUE_APP_BASE_API]: {
target: `http://192.168.1.70:8082`,
target: `http://192.168.1.108:8081`,
changeOrigin: true,
pathRewrite: {
['^' + process.env.VUE_APP_BASE_API]: ''
}
}
},
// 摄像头
[process.env.VUE_APP_CAMERA_API]: {
target: `http://192.168.1.108:9000`,
changeOrigin: true,
pathRewrite: {
// [`^${process.env.VUE_APP_CAMERA_API}`]: ''
['^' + process.env.VUE_APP_CAMERA_API]: ''
}
},
},
disableHostCheck: true
},
@ -97,7 +106,7 @@ module.exports = {
.plugin('ScriptExtHtmlWebpackPlugin')
.after('html')
.use('script-ext-html-webpack-plugin', [{
// `runtime` must same as runtimeChunk name. default is `runtime`
// `runtime` must same as runtimeChunk name. default is `runtime`
inline: /runtime\..*\.js$/
}])
.end()
@ -127,8 +136,8 @@ module.exports = {
})
config.optimization.runtimeChunk('single'),
{
from: path.resolve(__dirname, './public/robots.txt'), //防爬虫文件
to: './' //到根目录下
from: path.resolve(__dirname, './public/robots.txt'), //防爬虫文件
to: './' //到根目录下
}
}
)


Loading…
Cancel
Save