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/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 @@
+
+
+
+
+
+
+
+
+