diff --git a/src/api/debugCenter/debugCenter.ts b/src/api/debugCenter/debugCenter.ts
new file mode 100644
index 0000000..52be9ec
--- /dev/null
+++ b/src/api/debugCenter/debugCenter.ts
@@ -0,0 +1,77 @@
+import request from '@/utils/request';
+
+//获取列表数据
+function getDevice(queryParams){
+ return request({
+ url: '/api/device/debug/list',
+ method: 'get',
+ params: queryParams
+ })
+}
+
+//上传文件
+function uploadFile(formData){
+ return request({
+ url: '/api/device/debug/addFile',
+ method: 'post',
+ data: formData
+ })
+}
+
+//修改操作视频
+function addVideo(formData){
+ return request({
+ url: '/api/device/debug/addVideo',
+ method: 'post',
+ data: formData
+ })
+}
+
+
+//修改单个数据的多个文件
+function updateItem(formData){
+
+ return request({
+ url: '/api/device/debug/editDebug',
+ method: 'post',
+ data: formData
+ })
+ //开发时假装成功
+ // return new Promise((resolve,reject)=>{
+ // resolve({
+ // code:200,
+ // msg:"操作成功"
+ // });
+ // });
+}
+//批量上传开机画面
+function uploadBoot(formData){
+ return request({
+ url: '/api/device/debug/addLogo',
+ method: 'post',
+ data: formData
+ })
+ //开发时假装成功
+ // return new Promise((resolve, reject) => {
+ // //开机画面
+ // resolve({ code: 200, msg: '操作成功' });
+ // });
+}
+
+function getDeviceInfoById(id){
+
+ return request({
+ url: '/api/device/debug/detail/'+id,
+ method: 'get'
+ })
+}
+
+
+export default{
+ getDevice:getDevice,
+ uploadFile:uploadFile,
+ addVideo:addVideo,
+ updateItem:updateItem,
+ uploadBoot:uploadBoot,
+ getDeviceInfoById:getDeviceInfoById
+}
\ No newline at end of file
diff --git a/src/utils/common.ts b/src/utils/common.ts
index e7ce7d7..431f653 100644
--- a/src/utils/common.ts
+++ b/src/utils/common.ts
@@ -1,3 +1,4 @@
+//日期格式化
function DateFormat(date, format) {
if (!date) {
return '';
@@ -39,7 +40,7 @@ function DateFormat(date, format) {
return formatMap[match];
});
}
-
+//日期加减
function DateAdd(datePart, number, date) {
// 创建日期的副本,避免修改原日期对象
const newDate = new Date(date.getTime());
@@ -71,7 +72,47 @@ function DateAdd(datePart, number, date) {
return newDate;
}
+//将字节转换成0.53kb 10.13MB 1GB这样的友好单位
+function formatBytes(bytes, decimals = 2) {
+ // 处理0字节的情况
+ if (bytes === 0) return '0 B';
+
+ // 定义单位和换算比例
+ const k = 1024;
+ const dm = decimals < 0 ? 0 : decimals;
+ const sizes = ['B', 'KB', 'MB', 'GB', 'TB'];
+
+ // 计算最合适的单位
+ const i = Math.floor(Math.log(bytes) / Math.log(k));
+
+ // 格式化并返回结果
+ return parseFloat((bytes / Math.pow(k, i)).toFixed(dm)) + ' ' + sizes[i];
+}
+
+//数组某个字段取唯一值
+function getUniqueValues(dataSource, field) {
+ if(!field){
+ return [];
+ }
+ // 使用Set来存储唯一值,因为Set会自动去重
+ const uniqueValues = new Set();
+
+ // 遍历数据源
+ for (const item of dataSource) {
+ // 检查对象是否包含指定字段
+ if (item.hasOwnProperty(field)) {
+ uniqueValues.add(item[field]);
+ }
+ }
+
+ // 将Set转换为数组并返回
+ return Array.from(uniqueValues);
+}
+
+
export default{
DateFormat:DateFormat,
-DateAdd:DateAdd
+DateAdd:DateAdd,
+formatBytes:formatBytes,
+getUniqueValues:getUniqueValues
}
\ No newline at end of file
diff --git a/src/utils/coordinate-transform.ts b/src/utils/coordinate-transform.ts
new file mode 100644
index 0000000..8a85009
--- /dev/null
+++ b/src/utils/coordinate-transform.ts
@@ -0,0 +1,211 @@
+/**
+ * 坐标系转换工具
+ * WGS84(地球坐标系)与 GCJ02(火星坐标系)相互转换
+ */
+
+// 地标转国测常量
+const X_PI = (3.14159265358979324 * 3000.0) / 180.0;
+const PI = 3.1415926535897932384626;
+const A = 6378245.0; // 卫星椭球坐标投影到平面地图坐标系的投影因子
+const EE = 0.00669342162296594323; // 椭球的偏心率
+
+/**
+ * 坐标点类型定义
+ */
+export interface CoordinatePoint {
+ lng: number; // 经度
+ lat: number; // 纬度
+}
+
+/**
+ * 判断是否在国内,在中国国内的经纬度才需要做偏移
+ * @param lng 经度
+ * @param lat 纬度
+ * @returns 是否在国外
+ */
+function outOfChina(lng: number, lat: number): boolean {
+ return (
+ lng < 72.004 ||
+ lng > 137.8347 ||
+ lat < 0.8293 ||
+ lat > 55.8271
+ );
+}
+
+/**
+ * 转化经度
+ * @param lng 经度
+ * @param lat 纬度
+ * @returns 转换后的经度偏移量
+ */
+function transformLng(lng: number, lat: number): number {
+ let ret =
+ 300.0 +
+ lng +
+ 2.0 * lat +
+ 0.1 * lng * lng +
+ 0.1 * lng * lat +
+ 0.1 * Math.sqrt(Math.abs(lng));
+
+ ret +=
+ ((20.0 * Math.sin(6.0 * lng * PI) +
+ 20.0 * Math.sin(2.0 * lng * PI)) *
+ 2.0) /
+ 3.0;
+
+ ret +=
+ ((20.0 * Math.sin(lng * PI) +
+ 40.0 * Math.sin((lng / 3.0) * PI)) *
+ 2.0) /
+ 3.0;
+
+ ret +=
+ ((150.0 * Math.sin((lng / 12.0) * PI) +
+ 300.0 * Math.sin((lng / 30.0) * PI)) *
+ 2.0) /
+ 3.0;
+
+ return ret;
+}
+
+/**
+ * 转化纬度
+ * @param lng 经度
+ * @param lat 纬度
+ * @returns 转换后的纬度偏移量
+ */
+function transformLat(lng: number, lat: number): number {
+ let ret =
+ -100.0 +
+ 2.0 * lng +
+ 3.0 * lat +
+ 0.2 * lat * lat +
+ 0.1 * lng * lat +
+ 0.2 * Math.sqrt(Math.abs(lng));
+
+ ret +=
+ ((20.0 * Math.sin(6.0 * lng * PI) +
+ 20.0 * Math.sin(2.0 * lng * PI)) *
+ 2.0) /
+ 3.0;
+
+ ret +=
+ ((20.0 * Math.sin(lat * PI) +
+ 40.0 * Math.sin((lat / 3.0) * PI)) *
+ 2.0) /
+ 3.0;
+
+ ret +=
+ ((160.0 * Math.sin((lat / 12.0) * PI) +
+ 320 * Math.sin((lat * PI) / 30.0)) *
+ 2.0) /
+ 3.0;
+
+ return ret;
+}
+
+/**
+ * WGS84坐标系转GCJ02坐标系(地球坐标系转火星坐标系)
+ * @param lng 经度
+ * @param lat 纬度
+ * @returns 转换后的坐标 [经度, 纬度]
+ */
+export function wgs84ToGcj02(lng: number, lat: number): [number, number] {
+ if (outOfChina(lng, lat)) {
+ return [lng, lat];
+ }
+
+ const dlat = transformLat(lng - 105.0, lat - 35.0);
+ const dlng = transformLng(lng - 105.0, lat - 35.0);
+ const radlat = (lat / 180.0) * PI;
+ let magic = Math.sin(radlat);
+ magic = 1 - EE * magic * magic;
+ const sqrtmagic = Math.sqrt(magic);
+
+ const transformedLat =
+ (dlat * 180.0) /
+ (((A * (1 - EE)) / (magic * sqrtmagic)) * PI);
+ const transformedLng =
+ (dlng * 180.0) / ((A / sqrtmagic) * Math.cos(radlat) * PI);
+
+ const mglat = lat + transformedLat;
+ const mglng = lng + transformedLng;
+
+ return [mglng, mglat];
+}
+
+/**
+ * GCJ02坐标系转WGS84坐标系(火星坐标系转地球坐标系)
+ * @param lng 经度
+ * @param lat 纬度
+ * @returns 转换后的坐标 [经度, 纬度]
+ */
+export function gcj02ToWgs84(lng: number, lat: number): [number, number] {
+ if (outOfChina(lng, lat)) {
+ return [lng, lat];
+ }
+
+ const dlat = transformLat(lng - 105.0, lat - 35.0);
+ const dlng = transformLng(lng - 105.0, lat - 35.0);
+ const radlat = (lat / 180.0) * PI;
+ let magic = Math.sin(radlat);
+ magic = 1 - EE * magic * magic;
+ const sqrtmagic = Math.sqrt(magic);
+
+ const transformedLat = (dlat * 180.0) / ((A * (1 - EE)) / (magic * sqrtmagic) * PI);
+ const transformedLng = (dlng * 180.0) / (A / sqrtmagic * Math.cos(radlat) * PI);
+
+ const mglat = lat + transformedLat;
+ const mglng = lng + transformedLng;
+
+ return [lng * 2 - mglng, lat * 2 - mglat];
+}
+
+/**
+ * 对象形式的坐标转换 - WGS84转GCJ02
+ * @param point 坐标点对象 {lng: 经度, lat: 纬度}
+ * @returns 转换后的坐标点对象
+ */
+export function wgs84ToGcj02Point(point: CoordinatePoint): CoordinatePoint {
+ const [lng, lat] = wgs84ToGcj02(point.lng, point.lat);
+ return { lng, lat };
+}
+
+/**
+ * 对象形式的坐标转换 - GCJ02转WGS84
+ * @param point 坐标点对象 {lng: 经度, lat: 纬度}
+ * @returns 转换后的坐标点对象
+ */
+export function gcj02ToWgs84Point(point: CoordinatePoint): CoordinatePoint {
+ const [lng, lat] = gcj02ToWgs84(point.lng, point.lat);
+ return { lng, lat };
+}
+
+/**
+ * 批量转换坐标点 - WGS84转GCJ02
+ * @param points 坐标点数组
+ * @returns 转换后的坐标点数组
+ */
+export function batchWgs84ToGcj02(points: CoordinatePoint[]): CoordinatePoint[] {
+ return points.map(point => wgs84ToGcj02Point(point));
+}
+
+/**
+ * 批量转换坐标点 - GCJ02转WGS84
+ * @param points 坐标点数组
+ * @returns 转换后的坐标点数组
+ */
+export function batchGcj02ToWgs84(points: CoordinatePoint[]): CoordinatePoint[] {
+ return points.map(point => gcj02ToWgs84Point(point));
+}
+
+// 默认导出
+export default {
+ wgs84ToGcj02,
+ gcj02ToWgs84,
+ wgs84ToGcj02Point,
+ gcj02ToWgs84Point,
+ batchWgs84ToGcj02,
+ batchGcj02ToWgs84,
+ outOfChina
+};
diff --git a/src/utils/index.ts b/src/utils/index.ts
index 2b0aad5..0a5fea0 100644
--- a/src/utils/index.ts
+++ b/src/utils/index.ts
@@ -316,3 +316,15 @@ export const removeClass = (ele: HTMLElement, cls: string) => {
export const isExternal = (path: string) => {
return /^(https?:|http?:|mailto:|tel:)/.test(path);
};
+
+// 导出坐标系转换工具
+export { default as coordinateTransform } from './coordinate-transform';
+export type { CoordinatePoint } from './coordinate-transform';
+export {
+ wgs84ToGcj02,
+ gcj02ToWgs84,
+ wgs84ToGcj02Point,
+ gcj02ToWgs84Point,
+ batchWgs84ToGcj02,
+ batchGcj02ToWgs84
+} from './coordinate-transform';
\ No newline at end of file
diff --git a/src/views/debugCenter/debugPanel/index.vue b/src/views/debugCenter/debugPanel/index.vue
new file mode 100644
index 0000000..cb18422
--- /dev/null
+++ b/src/views/debugCenter/debugPanel/index.vue
@@ -0,0 +1,1010 @@
+
+
+
+
+
+
+
+
+