refactor(device): 重构设备详情页,按面板拆分信息并接入新接口
- 新增设备基本信息、硬件信息、网络信息、安全信息、其他信息独立接口和类型定义 - 将设备详情页从单接口加载改为分面板(el-collapse)独立请求和展示 - 优化数据展示,使用 formatText/formatBool 处理空值和布尔值 - 移除旧的 deviceDeveloper 接口 - 更新 getPage 和 getFormData 接口路径
This commit is contained in:
@@ -10,6 +10,11 @@ import type {
|
||||
DevicePasswordVerifyForm,
|
||||
DeviceMobileUpdateForm,
|
||||
DeviceEmailUpdateForm,
|
||||
DeviceBasicInfo,
|
||||
DeviceHardwareInfo,
|
||||
DeviceNetworkInfo,
|
||||
DeviceOtherInfo,
|
||||
DeviceSecurityInfo,
|
||||
} from "./types";
|
||||
|
||||
import type { ExcelResult, PageResult, OptionItem } from "@/api/common";
|
||||
@@ -36,21 +41,22 @@ const DeviceAPI = {
|
||||
*/
|
||||
getPage(queryParams: DeviceQueryParams) {
|
||||
return request<any, PageResult<DeviceItem>>({
|
||||
url: `${DEVICE_BASE_URL}`,
|
||||
url: `${DEVICE_BASE_URL}/page`,
|
||||
method: "get",
|
||||
params: queryParams,
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* 获取设备表单详情
|
||||
* 获取设备头部信息(设备主表详情)
|
||||
* 对应后端 GET /{sn}/detail (getSnBindInfo)
|
||||
*
|
||||
* @param sn 设备SN
|
||||
* @returns 设备表单详情
|
||||
* @returns 设备头部信息(含在线状态、IMEI、所有者、部门等)
|
||||
*/
|
||||
getFormData(sn: string) {
|
||||
return request<any, DeviceForm>({
|
||||
url: `${DEVICE_BASE_URL}/${sn}/info`,
|
||||
url: `${DEVICE_BASE_URL}/${sn}/detail`,
|
||||
method: "get",
|
||||
});
|
||||
},
|
||||
@@ -308,15 +314,45 @@ const DeviceAPI = {
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* 推送开发者模式指令到设备
|
||||
* @param sn 设备SN号
|
||||
*/
|
||||
deviceDeveloper(sn: string) {
|
||||
return request({
|
||||
url: `${DEVICE_BASE_URL}/developer`,
|
||||
method: "post",
|
||||
params: { sn },
|
||||
// ===================== 设备系统信息(分面板独立接口) =====================
|
||||
|
||||
/** 设备基本信息 */
|
||||
getBasicInfo(serialno: string) {
|
||||
return request<any, DeviceBasicInfo>({
|
||||
url: `${DEVICE_BASE_URL}/${serialno}/basic_info`,
|
||||
method: "get",
|
||||
});
|
||||
},
|
||||
|
||||
/** 设备硬件信息 */
|
||||
getHardwareInfo(serialno: string) {
|
||||
return request<any, DeviceHardwareInfo>({
|
||||
url: `${DEVICE_BASE_URL}/${serialno}/hardware_info`,
|
||||
method: "get",
|
||||
});
|
||||
},
|
||||
|
||||
/** 设备网络信息 */
|
||||
getNetworkInfo(serialno: string) {
|
||||
return request<any, DeviceNetworkInfo>({
|
||||
url: `${DEVICE_BASE_URL}/${serialno}/network_info`,
|
||||
method: "get",
|
||||
});
|
||||
},
|
||||
|
||||
/** 设备安全信息 */
|
||||
getSecurityInfo(serialno: string) {
|
||||
return request<any, DeviceSecurityInfo>({
|
||||
url: `${DEVICE_BASE_URL}/${serialno}/security_info`,
|
||||
method: "get",
|
||||
});
|
||||
},
|
||||
|
||||
/** 设备其他信息 */
|
||||
getOtherInfo(serialno: string) {
|
||||
return request<any, DeviceOtherInfo>({
|
||||
url: `${DEVICE_BASE_URL}/${serialno}/other_info`,
|
||||
method: "get",
|
||||
});
|
||||
},
|
||||
};
|
||||
|
||||
@@ -161,3 +161,171 @@ export interface DeviceEmailUpdateForm {
|
||||
/** 当前密码 */
|
||||
password?: string;
|
||||
}
|
||||
|
||||
// ===================== 设备系统信息(分面板) =====================
|
||||
|
||||
/** 设备基本信息 */
|
||||
export interface DeviceBasicInfo {
|
||||
id?: number;
|
||||
serialno?: string;
|
||||
deviceName?: string;
|
||||
deviceBrand?: string;
|
||||
deviceModel?: string;
|
||||
deviceBoard?: string;
|
||||
deviceManufacturer?: string;
|
||||
hardware?: string;
|
||||
host?: string;
|
||||
androidVersion?: string;
|
||||
androidApi?: number;
|
||||
androidId?: string;
|
||||
buildId?: string;
|
||||
buildDisplayId?: string;
|
||||
buildFingerprint?: string;
|
||||
buildType?: string;
|
||||
buildUser?: string;
|
||||
buildHost?: string;
|
||||
buildTags?: string;
|
||||
buildTime?: string;
|
||||
language?: string;
|
||||
timezone?: string;
|
||||
bootTime?: string;
|
||||
screenResolution?: string;
|
||||
screenDensity?: number;
|
||||
kernelVersion?: string;
|
||||
romVersion?: string;
|
||||
// ===================== 补充基本信息字段 =====================
|
||||
productName?: string;
|
||||
productModel?: string;
|
||||
productDevice?: string;
|
||||
boardPlatform?: string;
|
||||
deviceType?: string;
|
||||
isTablet?: number;
|
||||
releaseVersion?: string;
|
||||
displayVersion?: string;
|
||||
bootloader?: string;
|
||||
basebandVersion?: string;
|
||||
radioVersion?: string;
|
||||
screenSize?: string;
|
||||
screenInch?: number;
|
||||
refreshRate?: number;
|
||||
osType?: string;
|
||||
osVersion?: string;
|
||||
firmwareVersion?: string;
|
||||
}
|
||||
|
||||
/** 设备硬件信息 */
|
||||
export interface DeviceHardwareInfo {
|
||||
id?: number;
|
||||
serialno?: string;
|
||||
cpuAbi?: string;
|
||||
cpuAbi2?: string;
|
||||
cpuMin?: string;
|
||||
cpuModel?: string;
|
||||
cpuCores?: number;
|
||||
cpuMaxFreq?: string;
|
||||
cpuMinFreq?: string;
|
||||
totalRam?: string;
|
||||
availableRam?: string;
|
||||
internalStorage?: string;
|
||||
availableStorage?: string;
|
||||
externalStorage?: string;
|
||||
batteryCapacity?: string;
|
||||
batteryLevel?: number;
|
||||
batteryStatus?: string;
|
||||
batteryHealth?: string;
|
||||
batteryTemp?: string;
|
||||
batteryVoltage?: string;
|
||||
batteryTechnology?: string;
|
||||
gpuRenderer?: string;
|
||||
gpuVendor?: string;
|
||||
gpuVersion?: string;
|
||||
sensors?: string;
|
||||
supportAbi?: string;
|
||||
supportAbi64?: string;
|
||||
}
|
||||
|
||||
/** 设备网络信息 */
|
||||
export interface DeviceNetworkInfo {
|
||||
id?: number;
|
||||
serialno?: string;
|
||||
networkType?: string;
|
||||
networkSubtype?: string;
|
||||
isConnected?: number;
|
||||
wifiSsid?: string;
|
||||
wifiBssid?: string;
|
||||
wifiIp?: string;
|
||||
wifiMac?: string;
|
||||
wifiGateway?: string;
|
||||
wifiNetmask?: string;
|
||||
wifiDns?: string;
|
||||
wifiRssi?: number;
|
||||
wifiSpeed?: string;
|
||||
mobileIp?: string;
|
||||
mobileMac?: string;
|
||||
mobileImei?: string;
|
||||
mobileImsi?: string;
|
||||
mobileOperator?: string;
|
||||
mobileSimSerial?: string;
|
||||
mobileNetworkType?: string;
|
||||
bluetoothMac?: string;
|
||||
bluetoothName?: string;
|
||||
isVpn?: number;
|
||||
isProxy?: number;
|
||||
proxyHost?: string;
|
||||
proxyPort?: string;
|
||||
}
|
||||
|
||||
/** 设备安全信息 */
|
||||
export interface DeviceSecurityInfo {
|
||||
id?: number;
|
||||
serialno?: string;
|
||||
isRoot?: number;
|
||||
isJailbreak?: number;
|
||||
rootStatus?: number;
|
||||
hasSuBinary?: number;
|
||||
hasBusybox?: number;
|
||||
isEmulator?: number;
|
||||
isDebuggable?: number;
|
||||
isUsbDebug?: number;
|
||||
isUnknownSources?: number;
|
||||
isVerifyApps?: number;
|
||||
isEncrypted?: number;
|
||||
lockScreenType?: string;
|
||||
hasPassword?: number;
|
||||
passwordType?: string;
|
||||
securityPatch?: string;
|
||||
googlePlayProtect?: number;
|
||||
adbStatus?: number;
|
||||
isVpnActive?: number;
|
||||
isDeviceOwner?: number;
|
||||
androidVersion?: string;
|
||||
kernelVersion?: string;
|
||||
}
|
||||
|
||||
/** 设备其他信息 */
|
||||
export interface DeviceOtherInfo {
|
||||
id?: number;
|
||||
serialno?: string;
|
||||
appVersion?: string;
|
||||
appVersionCode?: number;
|
||||
installTime?: string;
|
||||
updateTimeApp?: string;
|
||||
packageName?: string;
|
||||
channel?: string;
|
||||
deviceId?: string;
|
||||
gaid?: string;
|
||||
oaid?: string;
|
||||
phoneNumber?: string;
|
||||
iccid?: string;
|
||||
imsi?: string;
|
||||
cameraInfo?: string;
|
||||
sensorCount?: number;
|
||||
appListMd5?: string;
|
||||
isCharging?: number;
|
||||
chargingType?: string;
|
||||
temperature?: string;
|
||||
freeStorage?: string;
|
||||
totalStorage?: string;
|
||||
freeRam?: string;
|
||||
totalRam?: string;
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user