zyh
This commit is contained in:
parent
0d9ea4ee39
commit
f57cb28924
|
|
@ -0,0 +1,10 @@
|
|||
import request from '@/utils/request'
|
||||
|
||||
// 获取品牌
|
||||
export function loadBrand (limit) {
|
||||
return request({
|
||||
// url: 'brand',
|
||||
url: `brand?limit=${limit}`,
|
||||
method: 'GET'
|
||||
})
|
||||
}
|
||||
|
|
@ -0,0 +1,10 @@
|
|||
import request from '@/utils/request'
|
||||
|
||||
// 获取品牌
|
||||
export function loadBrand (limit) {
|
||||
return request({
|
||||
// url: 'brand',
|
||||
url: `https://img2020.cnblogs.com/blog/2600859/202110/2600859-20211025144758994-1769294655.png`,
|
||||
method: 'GET'
|
||||
})
|
||||
}
|
||||
|
|
@ -0,0 +1,10 @@
|
|||
import request from '@/utils/request'
|
||||
|
||||
// 获取品牌
|
||||
export function loadBrand (limit) {
|
||||
return request({
|
||||
// url: 'brand',
|
||||
url: `https://st0.dancf.com/market-operations/market/side/1693884270949.png?x-oss-process=image/resize,w_260/sharpen,80/interlace,1,image/format,webp`,
|
||||
method: 'GET'
|
||||
})
|
||||
}
|
||||
|
|
@ -0,0 +1,10 @@
|
|||
import request from '@/utils/request'
|
||||
|
||||
// 获取品牌
|
||||
export function loadBrand (limit) {
|
||||
return request({
|
||||
// url: 'brand',
|
||||
url: `https://st0.dancf.com/market-operations/market/side/169388420949.png?x-oss-process=image/resize,w_260/sharpen,80/interlace,1,image/format,webp`,
|
||||
method: 'GET'
|
||||
})
|
||||
}
|
||||
|
|
@ -0,0 +1,10 @@
|
|||
import request from '@/utils/request'
|
||||
|
||||
// 获取品牌
|
||||
export function loadBrand (limit) {
|
||||
return request({
|
||||
// url: 'brand',
|
||||
url: `https://st0.dancf.com/market-operations/market/side/1693880949.png?x-oss-process=image/resize,w_260/sharpen,80/interlace,1,image/format,webp`,
|
||||
method: 'GET'
|
||||
})
|
||||
}
|
||||
|
|
@ -0,0 +1,10 @@
|
|||
import request from '@/utils/request'
|
||||
|
||||
// 获取品牌
|
||||
export function loadBrand (limit) {
|
||||
return request({
|
||||
// url: 'brand',
|
||||
url: `https://st0.dancf.com/market-operations/market/side/169388420949.png?x-oss-process=image/resize,w_260/sharpen,80/interlace,1,image/format,webp`,
|
||||
method: 'GET'
|
||||
})
|
||||
}
|
||||
|
|
@ -0,0 +1,10 @@
|
|||
import request from '@/utils/request'
|
||||
|
||||
// 获取品牌
|
||||
export function loadBrand (limit) {
|
||||
return request({
|
||||
// url: 'brand',
|
||||
url: `https://img2020.cnblogs.com/blog/2600859/202110/2600859-20211025144758994-1769294655.png`,
|
||||
method: 'GET'
|
||||
})
|
||||
}
|
||||
|
|
@ -0,0 +1,10 @@
|
|||
import request from '@/utils/request'
|
||||
|
||||
//
|
||||
export function loadBrand (limit) {
|
||||
return request({
|
||||
// url: 'brand',
|
||||
url: `brand?limit=${limit}`,
|
||||
method: 'GET'
|
||||
})
|
||||
}
|
||||
|
|
@ -0,0 +1,39 @@
|
|||
/* 封装axios用于发送请求 */
|
||||
import axios from 'axios'
|
||||
|
||||
/*
|
||||
(1)request 相当于 Axios 的实例对象
|
||||
(2)为什么要有request,而不是直接用axios
|
||||
* 项目开发中,有可能会有两个基地址
|
||||
* 不同的接口配置不同(有的要token,有的不要token)
|
||||
*/
|
||||
const request = axios.create({
|
||||
baseURL: '/home/', // 设置基地址,博主这个请求跨域了因此我设置了代理服务器,因此基地址才这么短
|
||||
timeout: 5000 // 请求超时:当5s没有响应就会结束请求
|
||||
})
|
||||
|
||||
// 添加请求拦截器,一下内容是axios的拦截器,可以不用写
|
||||
request.interceptors.request.use(
|
||||
function (config) {
|
||||
// 在发送请求之前做些什么
|
||||
return config
|
||||
},
|
||||
function (error) {
|
||||
// 对请求错误做些什么
|
||||
return Promise.reject(error)
|
||||
}
|
||||
)
|
||||
|
||||
// 添加响应拦截器
|
||||
request.interceptors.response.use(
|
||||
function (response) {
|
||||
// 对响应数据做点什么
|
||||
return response.data
|
||||
},
|
||||
function (error) {
|
||||
// 对响应错误做点什么
|
||||
return Promise.reject(error)
|
||||
}
|
||||
)
|
||||
|
||||
export default request
|
||||
|
|
@ -0,0 +1,33 @@
|
|||
/* 封装axios用于发送请求 */
|
||||
import axios from 'axios'
|
||||
|
||||
const request = axios.create({
|
||||
baseURL: '', // 设置基地址,博主这个请求跨域了因此我设置了代理服务器,因此基地址才这么短
|
||||
timeout: 5000 // 请求超时:当5s没有响应就会结束请求
|
||||
})
|
||||
|
||||
// 添加请求拦截器,一下内容是axios的拦截器,可以不用写
|
||||
request.interceptors.request.use(
|
||||
function (config) {
|
||||
// 在发送请求之前做些什么
|
||||
return config
|
||||
},
|
||||
function (error) {
|
||||
// 对请求错误做些什么
|
||||
return Promise.reject(error)
|
||||
}
|
||||
)
|
||||
|
||||
// 添加响应拦截器
|
||||
request.interceptors.response.use(
|
||||
function (response) {
|
||||
// 对响应数据做点什么
|
||||
return response.data
|
||||
},
|
||||
function (error) {
|
||||
// 对响应错误做点什么
|
||||
return Promise.reject(error)
|
||||
}
|
||||
)
|
||||
|
||||
export default request
|
||||
|
|
@ -0,0 +1,35 @@
|
|||
/* 封装axios用于发送请求 */
|
||||
import axios from 'axios'
|
||||
|
||||
const request = axios.create({
|
||||
baseURL: '', // 设置基地址,博主这个请求跨域了因此我设置了代理服务器,因此基地址才这么短
|
||||
timeout: 5000 // 请求超时:当5s没有响应就会结束请求
|
||||
})
|
||||
|
||||
// 添加请求拦截器,一下内容是axios的拦截器,可以不用写
|
||||
request.interceptors.request.use(
|
||||
function (config) {
|
||||
// 在发送请求之前做些什么
|
||||
return config
|
||||
},
|
||||
function (error) {
|
||||
// 对请求错误做些什么
|
||||
return Promise.reject(error)
|
||||
}
|
||||
)
|
||||
|
||||
// 添加响应拦截器
|
||||
request.interceptors.response.use(
|
||||
function (response) {
|
||||
// 对响应数据做点什么
|
||||
return response.data
|
||||
},
|
||||
function (error) {
|
||||
// 对响应错误做点什么
|
||||
console.log(error);
|
||||
|
||||
return Promise.reject(error)
|
||||
}
|
||||
)
|
||||
|
||||
export default request
|
||||
|
|
@ -0,0 +1,34 @@
|
|||
/* 封装axios用于发送请求 */
|
||||
import axios from 'axios'
|
||||
|
||||
const request = axios.create({
|
||||
baseURL: '', // 设置基地址,博主这个请求跨域了因此我设置了代理服务器,因此基地址才这么短
|
||||
timeout: 5000 // 请求超时:当5s没有响应就会结束请求
|
||||
})
|
||||
|
||||
// 添加请求拦截器,一下内容是axios的拦截器,可以不用写
|
||||
request.interceptors.request.use(
|
||||
function (config) {
|
||||
// 在发送请求之前做些什么
|
||||
return config
|
||||
},
|
||||
function (error) {
|
||||
// 对请求错误做些什么
|
||||
return Promise.reject(error)
|
||||
}
|
||||
)
|
||||
|
||||
// 添加响应拦截器
|
||||
request.interceptors.response.use(
|
||||
function (response) {
|
||||
// 对响应数据做点什么
|
||||
return response.data
|
||||
},
|
||||
function (error) {
|
||||
// 对响应错误做点什么
|
||||
console.log(error);
|
||||
return Promise.reject(error)
|
||||
}
|
||||
)
|
||||
|
||||
export default request
|
||||
|
|
@ -0,0 +1,76 @@
|
|||
/* 封装axios用于发送请求 */
|
||||
import axios from 'axios'
|
||||
import { Message } from 'element-ui'; // 请确保你的项目中已经安装了 Element UI
|
||||
const request = axios.create({
|
||||
baseURL: '', // 设置基地址,博主这个请求跨域了因此我设置了代理服务器,因此基地址才这么短
|
||||
timeout: 5000 // 请求超时:当5s没有响应就会结束请求
|
||||
})
|
||||
|
||||
// 添加请求拦截器,一下内容是axios的拦截器,可以不用写
|
||||
request.interceptors.request.use(
|
||||
function (config) {
|
||||
// 在发送请求之前做些什么
|
||||
return config
|
||||
},
|
||||
function (error) {
|
||||
// 对请求错误做些什么
|
||||
return Promise.reject(error)
|
||||
}
|
||||
)
|
||||
|
||||
// 添加响应拦截器
|
||||
request.interceptors.response.use(
|
||||
function (response) {
|
||||
// 对响应数据做点什么
|
||||
return response.data
|
||||
},
|
||||
function (error) {
|
||||
// 对响应错误做点什么
|
||||
console.log(error);
|
||||
return Promise.reject(error)
|
||||
}
|
||||
)
|
||||
|
||||
export default request
|
||||
|
||||
|
||||
|
||||
// axios.js
|
||||
const instance = axios.create({
|
||||
baseURL: 'https://api.example.com', // 设置你的API基础URL
|
||||
});
|
||||
|
||||
// 添加一个响应拦截器
|
||||
instance.interceptors.response.use(
|
||||
(response) => {
|
||||
// 如果请求成功,直接返回响应数据
|
||||
return response.data;
|
||||
},
|
||||
(error) => {
|
||||
// 如果请求失败,处理错误信息
|
||||
if (error.response) {
|
||||
// 请求已发出,但服务器响应状态码不在 2xx 范围内
|
||||
console.error('Error status:', error.response.status);
|
||||
console.error('Error data:', error.response.data);
|
||||
console.error('Error headers:', error.response.headers);
|
||||
|
||||
// 提示错误信息
|
||||
Message.error(`请求错误:${error.response.status}`);
|
||||
} else if (error.request) {
|
||||
// 请求被发出但未收到响应
|
||||
console.error('No response received:', error.request);
|
||||
|
||||
// 提示错误信息
|
||||
Message.error('网络错误,请稍后重试');
|
||||
} else {
|
||||
// 设置请求时发生了一些错误
|
||||
console.error('Error:', error.message);
|
||||
|
||||
// 提示错误信息
|
||||
Message.error('请求失败,请稍后重试');
|
||||
}
|
||||
// 返回一个带有错误信息的 Promise 对象
|
||||
return Promise.reject(error);
|
||||
}
|
||||
);
|
||||
|
||||
|
|
@ -0,0 +1,54 @@
|
|||
/* 封装axios用于发送请求 */
|
||||
import axios from 'axios'
|
||||
import { Message } from 'element-ui'; // 请确保你的项目中已经安装了 Element UI
|
||||
const request = axios.create({
|
||||
baseURL: '', // 设置基地址,博主这个请求跨域了因此我设置了代理服务器,因此基地址才这么短
|
||||
timeout: 5000 // 请求超时:当5s没有响应就会结束请求
|
||||
})
|
||||
|
||||
// 添加请求拦截器,一下内容是axios的拦截器,可以不用写
|
||||
request.interceptors.request.use(
|
||||
function (config) {
|
||||
// 在发送请求之前做些什么
|
||||
return config
|
||||
},
|
||||
function (error) {
|
||||
// 对请求错误做些什么
|
||||
return Promise.reject(error)
|
||||
}
|
||||
)
|
||||
|
||||
// 添加响应拦截器
|
||||
request.interceptors.response.use(
|
||||
function (response) {
|
||||
// 对响应数据做点什么
|
||||
return response.data
|
||||
},
|
||||
function (error) {
|
||||
// 对响应错误做点什么
|
||||
if (error.response) {
|
||||
// 请求已发出,但服务器响应状态码不在 2xx 范围内
|
||||
console.error('Error status:', error.response.status);
|
||||
console.error('Error data:', error.response.data);
|
||||
console.error('Error headers:', error.response.headers);
|
||||
|
||||
// 提示错误信息
|
||||
Message.error(`请求错误:${error.response.status}`);
|
||||
} else if (error.request) {
|
||||
// 请求被发出但未收到响应
|
||||
console.error('No response received:', error.request);
|
||||
|
||||
// 提示错误信息
|
||||
Message.error('网络错误,请稍后重试');
|
||||
} else {
|
||||
// 设置请求时发生了一些错误
|
||||
console.error('Error:', error.message);
|
||||
|
||||
// 提示错误信息
|
||||
Message.error('请求失败,请稍后重试');
|
||||
}
|
||||
return Promise.reject(error)
|
||||
}
|
||||
)
|
||||
|
||||
export default request
|
||||
|
|
@ -0,0 +1,54 @@
|
|||
/* 封装axios用于发送请求 */
|
||||
import axios from "axios";
|
||||
import { Message } from "element-ui"; // 请确保你的项目中已经安装了 Element UI
|
||||
const request = axios.create({
|
||||
baseURL: "", // 设置基地址,博主这个请求跨域了因此我设置了代理服务器,因此基地址才这么短
|
||||
timeout: 5000, // 请求超时:当5s没有响应就会结束请求
|
||||
});
|
||||
|
||||
// 添加请求拦截器,一下内容是axios的拦截器,可以不用写
|
||||
request.interceptors.request.use(
|
||||
function (config) {
|
||||
// 在发送请求之前做些什么
|
||||
return config;
|
||||
},
|
||||
function (error) {
|
||||
// 对请求错误做些什么
|
||||
return Promise.reject(error);
|
||||
}
|
||||
);
|
||||
|
||||
// 添加响应拦截器
|
||||
request.interceptors.response.use(
|
||||
function (response) {
|
||||
// 对响应数据做点什么
|
||||
return response.data;
|
||||
},
|
||||
function (error) {
|
||||
// 对响应错误做点什么
|
||||
if (error.response) {
|
||||
// 请求已发出,但服务器响应状态码不在 2xx 范围内
|
||||
console.error("Error status:", error.response.status);
|
||||
console.error("Error data:", error.response.data);
|
||||
console.error("Error headers:", error.response.headers);
|
||||
|
||||
// 提示错误信息
|
||||
Message.error(`请求错误:${error.response.status}`);
|
||||
} else if (error.request) {
|
||||
// 请求被发出但未收到响应
|
||||
console.error("No response received:", error.request);
|
||||
|
||||
// 提示错误信息
|
||||
Message.error("网络错误,请稍后重试");
|
||||
} else {
|
||||
// 设置请求时发生了一些错误
|
||||
console.error("Error:", error.message);
|
||||
|
||||
// 提示错误信息
|
||||
Message.error("请求失败,请稍后重试");
|
||||
}
|
||||
return Promise.reject(error);
|
||||
}
|
||||
);
|
||||
|
||||
export default request;
|
||||
|
|
@ -0,0 +1,54 @@
|
|||
/* 封装axios用于发送请求 */
|
||||
import axios from "axios";
|
||||
import { Message } from "element-ui"; // 请确保你的项目中已经安装了 Element UI
|
||||
const request = axios.create({
|
||||
baseURL: "", // 设置基地址,博主这个请求跨域了因此我设置了代理服务器,因此基地址才这么短
|
||||
timeout: 5000, // 请求超时:当5s没有响应就会结束请求
|
||||
});
|
||||
|
||||
// 添加请求拦截器,一下内容是axios的拦截器,可以不用写
|
||||
request.interceptors.request.use(
|
||||
function (config) {
|
||||
// 在发送请求之前做些什么
|
||||
return config;
|
||||
},
|
||||
function (error) {
|
||||
// 对请求错误做些什么
|
||||
return Promise.reject(error);
|
||||
}
|
||||
);
|
||||
|
||||
// 添加响应拦截器
|
||||
request.interceptors.response.use(
|
||||
function (response) {
|
||||
// 对响应数据做点什么
|
||||
return response.data;
|
||||
},
|
||||
function (error) {
|
||||
// 对响应错误做点什么
|
||||
if (error.response) {
|
||||
// 请求已发出,但服务器响应状态码不在 2xx 范围内
|
||||
console.error("Error status:", error.response.status);
|
||||
console.error("Error data:", error.response.data);
|
||||
console.error("Error headers:", error.response.headers);
|
||||
|
||||
// 提示错误信息
|
||||
Message.error(`请求错误:${error.response.status}`);
|
||||
} else if (error.request) {
|
||||
// 请求被发出但未收到响应
|
||||
console.error("No response received:", error.request);
|
||||
|
||||
// 提示错误信息
|
||||
Message.error("网络错误,请稍后重试");
|
||||
} else {
|
||||
// 设置请求时发生了一些错误
|
||||
console.error("Error:", error.message);
|
||||
|
||||
// 提示错误信息
|
||||
Message.error("请求失败,请稍后重试");
|
||||
}
|
||||
return Promise.reject(error);
|
||||
}
|
||||
);
|
||||
|
||||
export default request;
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
|
@ -8,6 +8,7 @@
|
|||
"name": "shuinichang",
|
||||
"version": "0.1.0",
|
||||
"dependencies": {
|
||||
"axios": "^1.6.2",
|
||||
"core-js": "^3.8.3",
|
||||
"echarts": "^5.4.3",
|
||||
"echarts-gl": "^2.0.9",
|
||||
|
|
@ -4325,6 +4326,11 @@
|
|||
"babel-runtime": "6.x"
|
||||
}
|
||||
},
|
||||
"node_modules/asynckit": {
|
||||
"version": "0.4.0",
|
||||
"resolved": "https://registry.npmmirror.com/asynckit/-/asynckit-0.4.0.tgz",
|
||||
"integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q=="
|
||||
},
|
||||
"node_modules/at-least-node": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmmirror.com/at-least-node/-/at-least-node-1.0.0.tgz",
|
||||
|
|
@ -4366,6 +4372,16 @@
|
|||
"node": ">= 0.4"
|
||||
}
|
||||
},
|
||||
"node_modules/axios": {
|
||||
"version": "1.6.2",
|
||||
"resolved": "https://registry.npmmirror.com/axios/-/axios-1.6.2.tgz",
|
||||
"integrity": "sha512-7i24Ri4pmDRfJTR7LDBhsOTtcm+9kjX5WiY1X3wIisx6G9So3pfMkEiU7emUBe46oceVImccTEM3k6C5dbVW8A==",
|
||||
"dependencies": {
|
||||
"follow-redirects": "^1.15.0",
|
||||
"form-data": "^4.0.0",
|
||||
"proxy-from-env": "^1.1.0"
|
||||
}
|
||||
},
|
||||
"node_modules/babel-helper-vue-jsx-merge-props": {
|
||||
"version": "2.0.3",
|
||||
"resolved": "https://registry.npmjs.org/babel-helper-vue-jsx-merge-props/-/babel-helper-vue-jsx-merge-props-2.0.3.tgz",
|
||||
|
|
@ -4998,6 +5014,17 @@
|
|||
"integrity": "sha512-IfEDxwoWIjkeXL1eXcDiow4UbKjhLdq6/EuSVR9GMN7KVH3r9gQ83e73hsz1Nd1T3ijd5xv1wcWRYO+D6kCI2w==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/combined-stream": {
|
||||
"version": "1.0.8",
|
||||
"resolved": "https://registry.npmmirror.com/combined-stream/-/combined-stream-1.0.8.tgz",
|
||||
"integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==",
|
||||
"dependencies": {
|
||||
"delayed-stream": "~1.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.8"
|
||||
}
|
||||
},
|
||||
"node_modules/commander": {
|
||||
"version": "8.3.0",
|
||||
"resolved": "https://registry.npmmirror.com/commander/-/commander-8.3.0.tgz",
|
||||
|
|
@ -5859,6 +5886,14 @@
|
|||
"resolved": "https://registry.npmjs.org/defined/-/defined-0.0.0.tgz",
|
||||
"integrity": "sha512-zpqiCT8bODLu3QSmLLic8xJnYWBFjOSu/fBCm189oAiTtPq/PSanNACKZDS7kgSyCJY7P+IcODzlIogBK/9RBg=="
|
||||
},
|
||||
"node_modules/delayed-stream": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmmirror.com/delayed-stream/-/delayed-stream-1.0.0.tgz",
|
||||
"integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==",
|
||||
"engines": {
|
||||
"node": ">=0.4.0"
|
||||
}
|
||||
},
|
||||
"node_modules/depd": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmmirror.com/depd/-/depd-2.0.0.tgz",
|
||||
|
|
@ -6656,7 +6691,6 @@
|
|||
"version": "1.15.3",
|
||||
"resolved": "https://registry.npmmirror.com/follow-redirects/-/follow-redirects-1.15.3.tgz",
|
||||
"integrity": "sha512-1VzOtuEM8pC9SFU1E+8KfTjZyMztRsgEfwQl44z8A25uy13jSzTj6dyK2Df52iV0vgHCfBwLhDWevLn95w5v6Q==",
|
||||
"dev": true,
|
||||
"engines": {
|
||||
"node": ">=4.0"
|
||||
},
|
||||
|
|
@ -6675,6 +6709,19 @@
|
|||
"is-callable": "^1.1.3"
|
||||
}
|
||||
},
|
||||
"node_modules/form-data": {
|
||||
"version": "4.0.0",
|
||||
"resolved": "https://registry.npmmirror.com/form-data/-/form-data-4.0.0.tgz",
|
||||
"integrity": "sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==",
|
||||
"dependencies": {
|
||||
"asynckit": "^0.4.0",
|
||||
"combined-stream": "^1.0.8",
|
||||
"mime-types": "^2.1.12"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 6"
|
||||
}
|
||||
},
|
||||
"node_modules/forwarded": {
|
||||
"version": "0.2.0",
|
||||
"resolved": "https://registry.npmmirror.com/forwarded/-/forwarded-0.2.0.tgz",
|
||||
|
|
@ -8488,7 +8535,6 @@
|
|||
"version": "1.52.0",
|
||||
"resolved": "https://registry.npmmirror.com/mime-db/-/mime-db-1.52.0.tgz",
|
||||
"integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==",
|
||||
"dev": true,
|
||||
"engines": {
|
||||
"node": ">= 0.6"
|
||||
}
|
||||
|
|
@ -8497,7 +8543,6 @@
|
|||
"version": "2.1.35",
|
||||
"resolved": "https://registry.npmmirror.com/mime-types/-/mime-types-2.1.35.tgz",
|
||||
"integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"mime-db": "1.52.0"
|
||||
},
|
||||
|
|
@ -10606,6 +10651,11 @@
|
|||
"node": ">= 0.10"
|
||||
}
|
||||
},
|
||||
"node_modules/proxy-from-env": {
|
||||
"version": "1.1.0",
|
||||
"resolved": "https://registry.npmmirror.com/proxy-from-env/-/proxy-from-env-1.1.0.tgz",
|
||||
"integrity": "sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg=="
|
||||
},
|
||||
"node_modules/prr": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmmirror.com/prr/-/prr-1.0.1.tgz",
|
||||
|
|
@ -16319,6 +16369,11 @@
|
|||
"babel-runtime": "6.x"
|
||||
}
|
||||
},
|
||||
"asynckit": {
|
||||
"version": "0.4.0",
|
||||
"resolved": "https://registry.npmmirror.com/asynckit/-/asynckit-0.4.0.tgz",
|
||||
"integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q=="
|
||||
},
|
||||
"at-least-node": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmmirror.com/at-least-node/-/at-least-node-1.0.0.tgz",
|
||||
|
|
@ -16345,6 +16400,16 @@
|
|||
"integrity": "sha512-DMD0KiN46eipeziST1LPP/STfDU0sufISXmjSgvVsoU2tqxctQeASejWcfNtxYKqETM1UxQ8sp2OrSBWpHY6sw==",
|
||||
"dev": true
|
||||
},
|
||||
"axios": {
|
||||
"version": "1.6.2",
|
||||
"resolved": "https://registry.npmmirror.com/axios/-/axios-1.6.2.tgz",
|
||||
"integrity": "sha512-7i24Ri4pmDRfJTR7LDBhsOTtcm+9kjX5WiY1X3wIisx6G9So3pfMkEiU7emUBe46oceVImccTEM3k6C5dbVW8A==",
|
||||
"requires": {
|
||||
"follow-redirects": "^1.15.0",
|
||||
"form-data": "^4.0.0",
|
||||
"proxy-from-env": "^1.1.0"
|
||||
}
|
||||
},
|
||||
"babel-helper-vue-jsx-merge-props": {
|
||||
"version": "2.0.3",
|
||||
"resolved": "https://registry.npmjs.org/babel-helper-vue-jsx-merge-props/-/babel-helper-vue-jsx-merge-props-2.0.3.tgz",
|
||||
|
|
@ -16874,6 +16939,14 @@
|
|||
"integrity": "sha512-IfEDxwoWIjkeXL1eXcDiow4UbKjhLdq6/EuSVR9GMN7KVH3r9gQ83e73hsz1Nd1T3ijd5xv1wcWRYO+D6kCI2w==",
|
||||
"dev": true
|
||||
},
|
||||
"combined-stream": {
|
||||
"version": "1.0.8",
|
||||
"resolved": "https://registry.npmmirror.com/combined-stream/-/combined-stream-1.0.8.tgz",
|
||||
"integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==",
|
||||
"requires": {
|
||||
"delayed-stream": "~1.0.0"
|
||||
}
|
||||
},
|
||||
"commander": {
|
||||
"version": "8.3.0",
|
||||
"resolved": "https://registry.npmmirror.com/commander/-/commander-8.3.0.tgz",
|
||||
|
|
@ -17500,6 +17573,11 @@
|
|||
"resolved": "https://registry.npmjs.org/defined/-/defined-0.0.0.tgz",
|
||||
"integrity": "sha512-zpqiCT8bODLu3QSmLLic8xJnYWBFjOSu/fBCm189oAiTtPq/PSanNACKZDS7kgSyCJY7P+IcODzlIogBK/9RBg=="
|
||||
},
|
||||
"delayed-stream": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmmirror.com/delayed-stream/-/delayed-stream-1.0.0.tgz",
|
||||
"integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ=="
|
||||
},
|
||||
"depd": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmmirror.com/depd/-/depd-2.0.0.tgz",
|
||||
|
|
@ -18189,8 +18267,7 @@
|
|||
"follow-redirects": {
|
||||
"version": "1.15.3",
|
||||
"resolved": "https://registry.npmmirror.com/follow-redirects/-/follow-redirects-1.15.3.tgz",
|
||||
"integrity": "sha512-1VzOtuEM8pC9SFU1E+8KfTjZyMztRsgEfwQl44z8A25uy13jSzTj6dyK2Df52iV0vgHCfBwLhDWevLn95w5v6Q==",
|
||||
"dev": true
|
||||
"integrity": "sha512-1VzOtuEM8pC9SFU1E+8KfTjZyMztRsgEfwQl44z8A25uy13jSzTj6dyK2Df52iV0vgHCfBwLhDWevLn95w5v6Q=="
|
||||
},
|
||||
"for-each": {
|
||||
"version": "0.3.3",
|
||||
|
|
@ -18201,6 +18278,16 @@
|
|||
"is-callable": "^1.1.3"
|
||||
}
|
||||
},
|
||||
"form-data": {
|
||||
"version": "4.0.0",
|
||||
"resolved": "https://registry.npmmirror.com/form-data/-/form-data-4.0.0.tgz",
|
||||
"integrity": "sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==",
|
||||
"requires": {
|
||||
"asynckit": "^0.4.0",
|
||||
"combined-stream": "^1.0.8",
|
||||
"mime-types": "^2.1.12"
|
||||
}
|
||||
},
|
||||
"forwarded": {
|
||||
"version": "0.2.0",
|
||||
"resolved": "https://registry.npmmirror.com/forwarded/-/forwarded-0.2.0.tgz",
|
||||
|
|
@ -19648,14 +19735,12 @@
|
|||
"mime-db": {
|
||||
"version": "1.52.0",
|
||||
"resolved": "https://registry.npmmirror.com/mime-db/-/mime-db-1.52.0.tgz",
|
||||
"integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==",
|
||||
"dev": true
|
||||
"integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg=="
|
||||
},
|
||||
"mime-types": {
|
||||
"version": "2.1.35",
|
||||
"resolved": "https://registry.npmmirror.com/mime-types/-/mime-types-2.1.35.tgz",
|
||||
"integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"mime-db": "1.52.0"
|
||||
}
|
||||
|
|
@ -21026,6 +21111,11 @@
|
|||
}
|
||||
}
|
||||
},
|
||||
"proxy-from-env": {
|
||||
"version": "1.1.0",
|
||||
"resolved": "https://registry.npmmirror.com/proxy-from-env/-/proxy-from-env-1.1.0.tgz",
|
||||
"integrity": "sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg=="
|
||||
},
|
||||
"prr": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmmirror.com/prr/-/prr-1.0.1.tgz",
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@
|
|||
"build": "vue-cli-service build"
|
||||
},
|
||||
"dependencies": {
|
||||
"axios": "^1.6.2",
|
||||
"core-js": "^3.8.3",
|
||||
"echarts": "^5.4.3",
|
||||
"echarts-gl": "^2.0.9",
|
||||
|
|
|
|||
|
|
@ -0,0 +1,309 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>preview_demo</title>
|
||||
</head>
|
||||
<style>
|
||||
html, body {
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
}
|
||||
.playWnd {
|
||||
margin: 30px 0 0 400px;
|
||||
width: 1000px; /*播放容器的宽和高设定*/
|
||||
height: 600px;
|
||||
border: 1px solid red;
|
||||
}
|
||||
.operate {
|
||||
margin-top: 24px;
|
||||
}
|
||||
.operate::after {
|
||||
content: '';
|
||||
display: block;
|
||||
clear: both;
|
||||
}
|
||||
.module {
|
||||
float: left;
|
||||
width: 340px;
|
||||
/*min-height: 320px;*/
|
||||
margin-left: 16px;
|
||||
padding: 16px 8px;
|
||||
box-sizing: border-box;
|
||||
border: 1px solid #e5e5e5;
|
||||
}
|
||||
.module .item {
|
||||
margin-bottom: 4px;
|
||||
}
|
||||
.module input[type="text"] {
|
||||
box-sizing: border-box;
|
||||
display: inline-block;
|
||||
vertical-align: middle;
|
||||
margin-left: 0;
|
||||
width: 150px;
|
||||
min-height: 20px;
|
||||
}
|
||||
.module .btn {
|
||||
min-width: 80px;
|
||||
min-height: 24px;
|
||||
margin-top: 100px;
|
||||
margin-left: 80px;
|
||||
}
|
||||
</style>
|
||||
|
||||
<body>
|
||||
<!--预览界面-->
|
||||
<div id="operate" class="operate">
|
||||
<div class="module">
|
||||
<div class="item"><span class="label">监控点编号:</span><input id="cameraIndexCode" type="text" value=""></div>
|
||||
<div class="item" style="margin-top: 20px;margin-left: -20px;">
|
||||
|
||||
<button style="width:20px;padding:0;margin:0;" id="startPreview" class="btn">预览</button>
|
||||
|
||||
<button style="width:90px;padding:0;margin:0;" id="stopAllPreview" class="btn">停止全部预览</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!--视频窗口展示-->
|
||||
<div id="playWnd" class="playWnd" style="left: 109px; top: 133px;"></div>
|
||||
</body>
|
||||
|
||||
<!--三个必要的js文件引入-->
|
||||
<script src="jquery-1.12.4.min.js"></script>
|
||||
<script src="jsencrypt.min.js"></script> <!-- 用于RSA加密 -->
|
||||
<script src="web-control_1.2.5.min.js"></script> <!-- 用于前端与插件交互 -->
|
||||
|
||||
<script type="text/javascript">
|
||||
|
||||
//页面加载时创建播放实例初始化
|
||||
$(window).load(function () {
|
||||
initPlugin();
|
||||
});
|
||||
|
||||
//声明公用变量
|
||||
var initCount = 0;
|
||||
var pubKey = '';
|
||||
|
||||
// 创建播放实例
|
||||
function initPlugin () {
|
||||
oWebControl = new WebControl({
|
||||
szPluginContainer: "playWnd", // 指定容器id
|
||||
iServicePortStart: 15900, // 指定起止端口号,建议使用该值
|
||||
iServicePortEnd: 15900,
|
||||
szClassId:"23BF3B0A-2C56-4D97-9C03-0CB103AA8F11", // 用于IE10使用ActiveX的clsid
|
||||
cbConnectSuccess: function () { // 创建WebControl实例成功
|
||||
oWebControl.JS_StartService("window", { // WebControl实例创建成功后需要启动服务
|
||||
dllPath: "./VideoPluginConnect.dll" // 值"./VideoPluginConnect.dll"写死
|
||||
}).then(function () { // 启动插件服务成功
|
||||
oWebControl.JS_SetWindowControlCallback({ // 设置消息回调
|
||||
cbIntegrationCallBack: cbIntegrationCallBack
|
||||
});
|
||||
|
||||
oWebControl.JS_CreateWnd("playWnd", 1000, 600).then(function () { //JS_CreateWnd创建视频播放窗口,宽高可设定
|
||||
init(); // 创建播放实例成功后初始化
|
||||
});
|
||||
}, function () { // 启动插件服务失败
|
||||
});
|
||||
},
|
||||
cbConnectError: function () { // 创建WebControl实例失败
|
||||
oWebControl = null;
|
||||
$("#playWnd").html("插件未启动,正在尝试启动,请稍候...");
|
||||
WebControl.JS_WakeUp("VideoWebPlugin://"); // 程序未启动时执行error函数,采用wakeup来启动程序
|
||||
initCount ++;
|
||||
if (initCount < 3) {
|
||||
setTimeout(function () {
|
||||
initPlugin();
|
||||
}, 3000)
|
||||
} else {
|
||||
$("#playWnd").html("插件启动失败,请检查插件是否安装!");
|
||||
}
|
||||
},
|
||||
cbConnectClose: function (bNormalClose) {
|
||||
// 异常断开:bNormalClose = false
|
||||
// JS_Disconnect正常断开:bNormalClose = true
|
||||
console.log("cbConnectClose");
|
||||
oWebControl = null;
|
||||
$("#playWnd").html("插件未启动,正在尝试启动,请稍候...");
|
||||
WebControl.JS_WakeUp("VideoWebPlugin://");
|
||||
initCount ++;
|
||||
if (initCount < 3) {
|
||||
setTimeout(function () {
|
||||
initPlugin();
|
||||
}, 3000)
|
||||
} else {
|
||||
$("#playWnd").html("插件启动失败,请检查插件是否安装!");
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// 设置窗口控制回调
|
||||
function setCallbacks() {
|
||||
oWebControl.JS_SetWindowControlCallback({
|
||||
cbIntegrationCallBack: cbIntegrationCallBack
|
||||
});
|
||||
}
|
||||
|
||||
// 推送消息
|
||||
function cbIntegrationCallBack(oData) {
|
||||
showCBInfo(JSON.stringify(oData.responseMsg));
|
||||
}
|
||||
|
||||
//初始化
|
||||
function init()
|
||||
{
|
||||
getPubKey(function () {
|
||||
|
||||
////////////////////////////////// 请自行修改以下变量值 ////////////////////////////////////
|
||||
var appkey = "28730366"; //综合安防管理平台提供的appkey,必填
|
||||
var secret = setEncrypt("HSZkCJpSJ7gSUYrO6wVi"); //综合安防管理平台提供的secret,必填
|
||||
var ip = "10.19.132.75"; //综合安防管理平台IP地址,必填
|
||||
var playMode = 0; //初始播放模式:0-预览,1-回放
|
||||
var port = 443; //综合安防管理平台端口,若启用HTTPS协议,默认443
|
||||
var snapDir = "D:\\SnapDir"; //抓图存储路径
|
||||
var videoDir = "D:\\VideoDir"; //紧急录像或录像剪辑存储路径
|
||||
var layout = "1x1"; //playMode指定模式的布局
|
||||
var enableHTTPS = 1; //是否启用HTTPS协议与综合安防管理平台交互,这里总是填1
|
||||
var encryptedFields = 'secret'; //加密字段,默认加密领域为secret
|
||||
var showToolbar = 1; //是否显示工具栏,0-不显示,非0-显示
|
||||
var showSmart = 1; //是否显示智能信息(如配置移动侦测后画面上的线框),0-不显示,非0-显示
|
||||
var buttonIDs = "0,16,256,257,258,259,260,512,513,514,515,516,517,768,769"; //自定义工具条按钮
|
||||
////////////////////////////////// 请自行修改以上变量值 ////////////////////////////////////
|
||||
|
||||
oWebControl.JS_RequestInterface({
|
||||
funcName: "init",
|
||||
argument: JSON.stringify({
|
||||
appkey: appkey, //API网关提供的appkey
|
||||
secret: secret, //API网关提供的secret
|
||||
ip: ip, //API网关IP地址
|
||||
playMode: playMode, //播放模式(决定显示预览还是回放界面)
|
||||
port: port, //端口
|
||||
snapDir: snapDir, //抓图存储路径
|
||||
videoDir: videoDir, //紧急录像或录像剪辑存储路径
|
||||
layout: layout, //布局
|
||||
enableHTTPS: enableHTTPS, //是否启用HTTPS协议
|
||||
encryptedFields: encryptedFields, //加密字段
|
||||
showToolbar: showToolbar, //是否显示工具栏
|
||||
showSmart: showSmart, //是否显示智能信息
|
||||
buttonIDs: buttonIDs //自定义工具条按钮
|
||||
})
|
||||
}).then(function (oData) {
|
||||
oWebControl.JS_Resize(1000, 600); // 初始化后resize一次,规避firefox下首次显示窗口后插件窗口未与DIV窗口重合问题
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
//获取公钥
|
||||
function getPubKey (callback) {
|
||||
oWebControl.JS_RequestInterface({
|
||||
funcName: "getRSAPubKey",
|
||||
argument: JSON.stringify({
|
||||
keyLength: 1024
|
||||
})
|
||||
}).then(function (oData) {
|
||||
console.log(oData);
|
||||
if (oData.responseMsg.data) {
|
||||
pubKey = oData.responseMsg.data;
|
||||
callback()
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
//RSA加密
|
||||
function setEncrypt (value) {
|
||||
var encrypt = new JSEncrypt();
|
||||
encrypt.setPublicKey(pubKey);
|
||||
return encrypt.encrypt(value);
|
||||
}
|
||||
|
||||
// 监听resize事件,使插件窗口尺寸跟随DIV窗口变化
|
||||
$(window).resize(function () {
|
||||
if (oWebControl != null) {
|
||||
oWebControl.JS_Resize(1000, 600);
|
||||
setWndCover();
|
||||
}
|
||||
});
|
||||
|
||||
// 监听滚动条scroll事件,使插件窗口跟随浏览器滚动而移动
|
||||
$(window).scroll(function () {
|
||||
if (oWebControl != null) {
|
||||
oWebControl.JS_Resize(1000, 600);
|
||||
setWndCover();
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
// 设置窗口裁剪,当因滚动条滚动导致窗口需要被遮住的情况下需要JS_CuttingPartWindow部分窗口
|
||||
function setWndCover() {
|
||||
var iWidth = $(window).width();
|
||||
var iHeight = $(window).height();
|
||||
var oDivRect = $("#playWnd").get(0).getBoundingClientRect();
|
||||
|
||||
var iCoverLeft = (oDivRect.left < 0) ? Math.abs(oDivRect.left): 0;
|
||||
var iCoverTop = (oDivRect.top < 0) ? Math.abs(oDivRect.top): 0;
|
||||
var iCoverRight = (oDivRect.right - iWidth > 0) ? Math.round(oDivRect.right - iWidth) : 0;
|
||||
var iCoverBottom = (oDivRect.bottom - iHeight > 0) ? Math.round(oDivRect.bottom - iHeight) : 0;
|
||||
|
||||
iCoverLeft = (iCoverLeft > 1000) ? 1000 : iCoverLeft;
|
||||
iCoverTop = (iCoverTop > 600) ? 600 : iCoverTop;
|
||||
iCoverRight = (iCoverRight > 1000) ? 1000 : iCoverRight;
|
||||
iCoverBottom = (iCoverBottom > 600) ? 600 : iCoverBottom;
|
||||
|
||||
oWebControl.JS_RepairPartWindow(0, 0, 1001, 600); // 多1个像素点防止还原后边界缺失一个像素条
|
||||
if (iCoverLeft != 0) {
|
||||
oWebControl.JS_CuttingPartWindow(0, 0, iCoverLeft, 600);
|
||||
}
|
||||
if (iCoverTop != 0) {
|
||||
oWebControl.JS_CuttingPartWindow(0, 0, 1001, iCoverTop); // 多剪掉一个像素条,防止出现剪掉一部分窗口后出现一个像素条
|
||||
}
|
||||
if (iCoverRight != 0) {
|
||||
oWebControl.JS_CuttingPartWindow(1000 - iCoverRight, 0, iCoverRight, 600);
|
||||
}
|
||||
if (iCoverBottom != 0) {
|
||||
oWebControl.JS_CuttingPartWindow(0, 600 - iCoverBottom, 1000, iCoverBottom);
|
||||
}
|
||||
}
|
||||
|
||||
//视频预览功能
|
||||
$("#startPreview").click(function () {
|
||||
var cameraIndexCode = $("#cameraIndexCode").val(); //获取输入的监控点编号值,必填
|
||||
var streamMode = 0; //主子码流标识:0-主码流,1-子码流
|
||||
var transMode = 1; //传输协议:0-UDP,1-TCP
|
||||
var gpuMode = 0; //是否启用GPU硬解,0-不启用,1-启用
|
||||
var wndId = -1; //播放窗口序号(在2x2以上布局下可指定播放窗口)
|
||||
|
||||
cameraIndexCode = cameraIndexCode.replace(/(^\s*)/g, "");
|
||||
cameraIndexCode = cameraIndexCode.replace(/(\s*$)/g, "");
|
||||
|
||||
oWebControl.JS_RequestInterface({
|
||||
funcName: "startPreview",
|
||||
argument: JSON.stringify({
|
||||
cameraIndexCode:cameraIndexCode, //监控点编号
|
||||
streamMode: streamMode, //主子码流标识
|
||||
transMode: transMode, //传输协议
|
||||
gpuMode: gpuMode, //是否开启GPU硬解
|
||||
wndId:wndId //可指定播放窗口
|
||||
})
|
||||
})
|
||||
});
|
||||
|
||||
//停止全部预览
|
||||
$("#stopAllPreview").click(function () {
|
||||
oWebControl.JS_RequestInterface({
|
||||
funcName: "stopAllPreview"
|
||||
});
|
||||
});
|
||||
|
||||
// 标签关闭
|
||||
$(window).unload(function () {
|
||||
if (oWebControl != null){
|
||||
oWebControl.JS_HideWnd(); // 先让窗口隐藏,规避可能的插件窗口滞后于浏览器消失问题
|
||||
oWebControl.JS_Disconnect().then(function(){ // 断开与插件服务连接成功
|
||||
},
|
||||
function() { // 断开与插件服务连接失败
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
</script>
|
||||
</html>
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Binary file not shown.
|
|
@ -0,0 +1,10 @@
|
|||
import request from '@/utils/request'
|
||||
|
||||
//
|
||||
export function loadBrand (limit) {
|
||||
return request({
|
||||
// url: 'brand',
|
||||
url: `brand?limit=${limit}`,
|
||||
method: 'GET'
|
||||
})
|
||||
}
|
||||
|
|
@ -0,0 +1,54 @@
|
|||
/* 封装axios用于发送请求 */
|
||||
import axios from "axios";
|
||||
import { Message } from "element-ui"; // 请确保你的项目中已经安装了 Element UI
|
||||
const request = axios.create({
|
||||
baseURL: "", // 设置基地址,博主这个请求跨域了因此我设置了代理服务器,因此基地址才这么短
|
||||
timeout: 5000, // 请求超时:当5s没有响应就会结束请求
|
||||
});
|
||||
|
||||
// 添加请求拦截器,一下内容是axios的拦截器,可以不用写
|
||||
request.interceptors.request.use(
|
||||
function (config) {
|
||||
// 在发送请求之前做些什么
|
||||
return config;
|
||||
},
|
||||
function (error) {
|
||||
// 对请求错误做些什么
|
||||
return Promise.reject(error);
|
||||
}
|
||||
);
|
||||
|
||||
// 添加响应拦截器
|
||||
request.interceptors.response.use(
|
||||
function (response) {
|
||||
// 对响应数据做点什么
|
||||
return response.data;
|
||||
},
|
||||
function (error) {
|
||||
// 对响应错误做点什么
|
||||
if (error.response) {
|
||||
// 请求已发出,但服务器响应状态码不在 2xx 范围内
|
||||
console.error("Error status:", error.response.status);
|
||||
console.error("Error data:", error.response.data);
|
||||
console.error("Error headers:", error.response.headers);
|
||||
|
||||
// 提示错误信息
|
||||
Message.error(`请求错误:${error.response.status}`);
|
||||
} else if (error.request) {
|
||||
// 请求被发出但未收到响应
|
||||
console.error("No response received:", error.request);
|
||||
|
||||
// 提示错误信息
|
||||
Message.error("网络错误,请稍后重试");
|
||||
} else {
|
||||
// 设置请求时发生了一些错误
|
||||
console.error("Error:", error.message);
|
||||
|
||||
// 提示错误信息
|
||||
Message.error("请求失败,请稍后重试");
|
||||
}
|
||||
return Promise.reject(error);
|
||||
}
|
||||
);
|
||||
|
||||
export default request;
|
||||
|
|
@ -774,6 +774,9 @@ export default {
|
|||
// console.log("JSON received" + json);
|
||||
// })
|
||||
// }
|
||||
},
|
||||
created(){
|
||||
|
||||
},
|
||||
mounted() {
|
||||
var chartDom = document.getElementById("main");
|
||||
|
|
|
|||
|
|
@ -356,7 +356,8 @@ export default {
|
|||
}
|
||||
});
|
||||
}
|
||||
var seriesOption = [{
|
||||
var seriesOption = [
|
||||
{
|
||||
name: '',
|
||||
type: 'pie',
|
||||
clockWise: false,
|
||||
|
|
@ -392,20 +393,91 @@ export default {
|
|||
}
|
||||
},
|
||||
data: data
|
||||
}];
|
||||
},
|
||||
{
|
||||
type: "pie",
|
||||
radius: ["43%", "45%"],
|
||||
center: ["36%", "56%"],
|
||||
animation: false,
|
||||
hoverAnimation: false,
|
||||
data: [
|
||||
{
|
||||
value: 100,
|
||||
},
|
||||
],
|
||||
label: {
|
||||
show: false,
|
||||
// 这里需要进行修改
|
||||
// formatter: function (params) {
|
||||
// return params.chartData1.name + "/n" + params.chartData1.value + "kw"
|
||||
// }
|
||||
},
|
||||
labelLine: {
|
||||
//label线的长度
|
||||
show: true, //数据标签引导线
|
||||
showAbove: true,
|
||||
length: 40,
|
||||
length2: 20,
|
||||
lineStyle: { cap: "round" },
|
||||
},
|
||||
itemStyle: {
|
||||
normal: {
|
||||
color: "#3BC5EF",
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "",
|
||||
type: "pie",
|
||||
startAngle: 90,
|
||||
radius: "36%",
|
||||
animation: false,
|
||||
hoverAnimation: false,
|
||||
center: ["36%", "56%"],
|
||||
itemStyle: {
|
||||
normal: {
|
||||
labelLine: {
|
||||
show: false,
|
||||
},
|
||||
color: new echarts.graphic.RadialGradient(0.5, 0.5, 1, [
|
||||
{
|
||||
offset: 1,
|
||||
color: "rgba(50,171,241, 0)",
|
||||
},
|
||||
{
|
||||
offset: 0.5,
|
||||
color: "rgba(50,171,241, .4)",
|
||||
},
|
||||
{
|
||||
offset: 0,
|
||||
color: "rgba(55,70,130, 0)",
|
||||
},
|
||||
]),
|
||||
shadowBlur: 60,
|
||||
},
|
||||
},
|
||||
data: [
|
||||
{
|
||||
value: 100,
|
||||
},
|
||||
],
|
||||
},
|
||||
];
|
||||
let option = {
|
||||
// backgroundColor: '#0A2E5D',
|
||||
// backgroundColor:"transparent",
|
||||
color: color,
|
||||
title: {
|
||||
text: '系统耗能',
|
||||
top: '52%',
|
||||
text: '系统\n耗能',
|
||||
top: '47%',
|
||||
textAlign: "center",
|
||||
left: "36%",
|
||||
left: "35.5%",
|
||||
textStyle: {
|
||||
color: '#fff',
|
||||
fontSize: 32,
|
||||
fontWeight: '400'
|
||||
fontWeight: '400',
|
||||
lineHeight:40,
|
||||
align:"center"
|
||||
}
|
||||
},
|
||||
graphic: {
|
||||
|
|
|
|||
|
|
@ -776,6 +776,74 @@ export default {
|
|||
},
|
||||
data: data,
|
||||
},
|
||||
{
|
||||
type: "pie",
|
||||
radius: ["46%", "48%"],
|
||||
center: ["36%", "50%"],
|
||||
animation: false,
|
||||
hoverAnimation: false,
|
||||
data: [
|
||||
{
|
||||
value: 100,
|
||||
},
|
||||
],
|
||||
label: {
|
||||
show: false,
|
||||
// 这里需要进行修改
|
||||
// formatter: function (params) {
|
||||
// return params.chartData1.name + "/n" + params.chartData1.value + "kw"
|
||||
// }
|
||||
},
|
||||
labelLine: {
|
||||
//label线的长度
|
||||
show: true, //数据标签引导线
|
||||
showAbove: true,
|
||||
length: 40,
|
||||
length2: 20,
|
||||
lineStyle: { cap: "round" },
|
||||
},
|
||||
itemStyle: {
|
||||
normal: {
|
||||
color: "#3BC5EF",
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "",
|
||||
type: "pie",
|
||||
startAngle: 90,
|
||||
radius: "40%",
|
||||
animation: false,
|
||||
hoverAnimation: false,
|
||||
center: ["36%", "50%"],
|
||||
itemStyle: {
|
||||
normal: {
|
||||
labelLine: {
|
||||
show: false,
|
||||
},
|
||||
color: new echarts.graphic.RadialGradient(0.5, 0.5, 1, [
|
||||
{
|
||||
offset: 1,
|
||||
color: "rgba(50,171,241, 0)",
|
||||
},
|
||||
{
|
||||
offset: 0.5,
|
||||
color: "rgba(50,171,241, .4)",
|
||||
},
|
||||
{
|
||||
offset: 0,
|
||||
color: "rgba(55,70,130, 0)",
|
||||
},
|
||||
]),
|
||||
shadowBlur: 60,
|
||||
},
|
||||
},
|
||||
data: [
|
||||
{
|
||||
value: 100,
|
||||
},
|
||||
],
|
||||
},
|
||||
];
|
||||
let option = {
|
||||
// backgroundColor: '#0A2E5D',
|
||||
|
|
|
|||
|
|
@ -151,6 +151,7 @@
|
|||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import * as echarts from "echarts";
|
||||
import "../../assets/CSS/tzcglsl.css";
|
||||
export default {
|
||||
data() {
|
||||
|
|
@ -622,7 +623,8 @@ export default {
|
|||
}
|
||||
});
|
||||
}
|
||||
var seriesOption = [{
|
||||
var seriesOption = [
|
||||
{
|
||||
name: '',
|
||||
type: 'pie',
|
||||
clockWise: false,
|
||||
|
|
@ -685,7 +687,72 @@ export default {
|
|||
}
|
||||
},
|
||||
data: data
|
||||
}];
|
||||
},
|
||||
{
|
||||
type: "pie",
|
||||
radius: ["43%", "45%"],
|
||||
center: ["36%", "56%"],
|
||||
animation: false,
|
||||
hoverAnimation: false,
|
||||
data: [
|
||||
{
|
||||
value: 100,
|
||||
},
|
||||
],
|
||||
label: {
|
||||
show: false,
|
||||
},
|
||||
labelLine: {
|
||||
//label线的长度
|
||||
show: true, //数据标签引导线
|
||||
showAbove: true,
|
||||
length: 40,
|
||||
length2: 20,
|
||||
lineStyle: { cap: "round" },
|
||||
},
|
||||
itemStyle: {
|
||||
normal: {
|
||||
color: "#3BC5EF",
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "",
|
||||
type: "pie",
|
||||
startAngle: 90,
|
||||
radius: "36%",
|
||||
animation: false,
|
||||
hoverAnimation: false,
|
||||
center: ["36%", "56%"],
|
||||
itemStyle: {
|
||||
normal: {
|
||||
labelLine: {
|
||||
show: false,
|
||||
},
|
||||
color: new echarts.graphic.RadialGradient(0.5, 0.5, 1, [
|
||||
{
|
||||
offset: 1,
|
||||
color: "rgba(50,171,241, 0)",
|
||||
},
|
||||
{
|
||||
offset: 0.5,
|
||||
color: "rgba(50,171,241, .4)",
|
||||
},
|
||||
{
|
||||
offset: 0,
|
||||
color: "rgba(55,70,130, 0)",
|
||||
},
|
||||
]),
|
||||
shadowBlur: 60,
|
||||
},
|
||||
},
|
||||
data: [
|
||||
{
|
||||
value: 100,
|
||||
},
|
||||
],
|
||||
}
|
||||
];
|
||||
let option = {
|
||||
// backgroundColor: '#0A2E5D',
|
||||
color: color,
|
||||
|
|
@ -723,7 +790,6 @@ export default {
|
|||
icon: "rect",
|
||||
orient: '',
|
||||
x: 'right',
|
||||
// selectedMode: 'single',
|
||||
data: [
|
||||
{
|
||||
name: '1号生产线',
|
||||
|
|
@ -737,6 +803,7 @@ export default {
|
|||
name: '3号生产线',
|
||||
value: "13.68"
|
||||
}],
|
||||
itemGap: 200,
|
||||
left: 760,
|
||||
bottom: 120,
|
||||
align: 'left',
|
||||
|
|
|
|||
Loading…
Reference in New Issue