diff --git a/AGENTS.md b/AGENTS.md index 8e55362a..08ec6bc2 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -56,20 +56,23 @@ ## 6. 新模块目录约定 ```text -src/api//index.ts # API 对象;类型少可同文件,多则拆 types.ts +src/api/.ts # 类型少时单文件(API 对象 + interface) +src/api//index.ts # API 对象;类型多时拆 types.ts src/api//types.ts src/views///index.vue -src/views///config/ # 可选:search/content/add/edit/options -src/components// # 模块私有可复用组件 +src/views///config/ # 可选:search/content/add/edit/options +src/views///components/ # 可选:页面私有组件与类型 +src/components// # 跨页面复用才提升到这里 src/composables/use.ts # 新 composable 直接引用,不并入上游 index.ts src/enums/.ts # 新枚举独立文件,不并入上游 enums/index.ts src/constants/.ts ``` - 目录 kebab-case(`app-manager`、`save-flow`),组件 PascalCase(`DeviceSnDetail`)。 -- 页面私有组件/类型留在页面目录;跨页面复用才提升到 `src/components//`。 +- 业务 API 一律放 `src/api/`,**不要放进上游的 `src/api/system/`**(会被上游同步覆盖或覆盖上游 `user`/`role` 等模块)。 +- 页面私有组件/类型留在页面目录的 `components/`;跨页面复用才提升到 `src/components//`。 - 业务类型不放 `src/types/`;通用工具可在 `src/utils/` 新建独立文件,禁止修改上游已有工具文件;业务状态不放上游 `src/stores/*`。 -- 现有范例:`src/views/update/`、`src/views/devices/`、`src/views/app-manager/`、`src/components/DeviceSn/`。 +- 现有范例:`src/views/update/`、`src/views/devices/`、`src/views/app-manager/`、`src/views/devices/sn/components/`。 ## 7. API 层规范 @@ -88,6 +91,7 @@ export const XxxAPI = { ``` - 分页统一用 `@/api/common` 的 `PageQuery` / `PageResult`。 +- 一个模块下有多组业务类型时按域拆文件(如 `src/api/device/types.ts` 与 `src/api/device/appIcon.types.ts`),不要混放在一个 `types.ts`。 - 错误提示由拦截器统一弹出;页面 `catch` 只做善后(关 loading、关弹窗、回滚状态),不要重复 `ElMessage.error`。 - 轮询/探测请求用 `silentErrorStatuses` 静默指定状态码。 - 免鉴权请求用 `anonymous: true` 或 `headers: { Authorization: "no-auth" }`(类型见 `types/axios.d.ts`)。 diff --git a/src/api/system/developer/index.ts b/src/api/developer/index.ts similarity index 100% rename from src/api/system/developer/index.ts rename to src/api/developer/index.ts diff --git a/src/api/system/developer/types.ts b/src/api/developer/types.ts similarity index 100% rename from src/api/system/developer/types.ts rename to src/api/developer/types.ts diff --git a/src/api/device/appIcon.ts b/src/api/device/appIcon.ts index 66a3363d..df4acff8 100644 --- a/src/api/device/appIcon.ts +++ b/src/api/device/appIcon.ts @@ -1,6 +1,6 @@ import request from "@/utils/request"; import type { PageResult } from "@/api/common"; -import type { AppIconQuery, AppIconVO } from "./types"; +import type { AppIconQuery, AppIconVO } from "./appIcon.types"; const APP_ICON_BASE_URL = "/api/v1/app-icons"; diff --git a/src/api/device/appIcon.types.ts b/src/api/device/appIcon.types.ts new file mode 100644 index 00000000..c7b63efd --- /dev/null +++ b/src/api/device/appIcon.types.ts @@ -0,0 +1,33 @@ +import type { PageQuery } from "@/api/common"; + +/** 应用图标分页查询参数 */ +export interface AppIconQuery extends PageQuery { + /** 应用包名(可选,不传则返回全部) */ + packageName?: string; +} + +/** 应用图标VO */ +export interface AppIconVO { + /** 主键ID */ + id?: number; + /** 应用包名 */ + packageName?: string; + /** 应用名称 */ + appName?: string; + /** 图标访问地址 */ + iconUrl?: string; + /** 图标文件MD5 */ + iconMd5?: string; + /** 版本号(同包名内自增) */ + version?: number; + /** 状态(1当前生效 0历史版本) */ + status?: number; + /** 是否锁定(0未锁定 1已锁定) */ + locked?: number; + /** 图标来源(device/admin) */ + source?: string; + /** 创建时间 */ + createTime?: string; + /** 更新时间 */ + updateTime?: string; +} diff --git a/src/api/system/device/index.ts b/src/api/device/index.ts similarity index 100% rename from src/api/system/device/index.ts rename to src/api/device/index.ts diff --git a/src/api/device/types.ts b/src/api/device/types.ts index c7b63efd..022514c4 100644 --- a/src/api/device/types.ts +++ b/src/api/device/types.ts @@ -1,33 +1,508 @@ +/** + * Device 用户类型定义 + */ + import type { PageQuery } from "@/api/common"; -/** 应用图标分页查询参数 */ -export interface AppIconQuery extends PageQuery { - /** 应用包名(可选,不传则返回全部) */ - packageName?: string; +/** 登录用户信息 */ +export interface DeviceInfo { + /** 用户ID */ + userId?: string; + /** 用户名 */ + username?: string; + /** 用户昵称 */ + nickname?: string; + /** 头像URL */ + avatar?: string; + /** 租户切换权限(true 可切换租户) */ + canSwitchTenant?: boolean; + /** 角色集合 */ + roles: string[]; + /** 权限集合 */ + perms: string[]; } -/** 应用图标VO */ -export interface AppIconVO { - /** 主键ID */ +/** 用户分页查询参数 */ +export interface DeviceQueryParams extends PageQuery { + /** 搜索关键字 */ + keywords?: string; + /** 用户状态 */ + status?: number; + /** 部门ID */ + deptId?: string; + /** 创建时间 */ + createTime?: [string, string]; +} + +/** 设备分页对象 */ +export interface DeviceItem { + /** 设备ID */ + id: string; + /** 设备序列号 */ + serialno?: string; + /** 设备型号 */ + snModel?: string; + /** 设备名 */ + snName?: string; + /** 设备绑定手机 */ + snMobile?: string; + /** 推送ID */ + pushId?: string; + /** 设备状态(1:启用;0:禁用) */ + status?: number; + /** 在线状态(1:在线;0:离线) */ + online?: number; + /** 最后心跳时间 */ + lastHeartbeatTime?: string; + /** 激活时间 */ + activateTime?: string; + /** 创建时间 */ + createTime?: Date; +} + +/** 设备在线状态视图对象 */ +export interface DeviceOnlineVO { + /** 设备序列号 */ + serialno?: string; + /** 在线状态(1:在线;0:离线) */ + online?: number; + /** 最后心跳时间 */ + lastHeartbeatTime?: string; + /** 设备 IP */ + ip?: string; + /** 屏幕状态(1:亮屏;0:熄屏;null:未知) */ + screenState?: number; +} + +/** 设备最后心跳视图对象(来自 TDengine) */ +export interface DeviceHeartbeatVO { + /** 设备序列号 */ + sn?: string; + /** 最后心跳时间 */ + lastTime?: string; + /** 在线状态(1:在线;0:离线) */ + online?: number; + /** 设备 IP */ + ip?: string; + /** 信号强度 */ + rssi?: string; + /** 屏幕是否亮起(1:亮屏;0:熄屏) */ + screenOn?: number; +} + +/** 设备表单对象 */ +export interface DeviceForm { + /** 设备ID */ + id?: string; + /** 设备序列号 */ + serialno?: string; + /** 设备名称 */ + snName?: string; + /** 设备型号 */ + snModel?: string; + /** 设备手机号 */ + snMobile?: string; + /** 设备在线状态(1:在线;0:离线) */ + online?: number; + /** 设备IMEI */ + snImei?: string; + /** 所属部门 */ + department?: string; + /** 分组 */ + group?: string; + /** 设备类型 */ + deviceType?: string; + /** 设备来源 */ + source?: string; + /** 激活时间 */ + activationTime?: string; + /** 最后上线时间 */ + lastOnline?: string; + /** 角色ID集合 */ + roleIds?: number[]; + /** 设备状态(1:正常;0:禁用) */ + status?: number; +} + +/** 个人中心用户信息 */ +export interface DeviceProfileDetail { + /** 用户ID */ + id?: string; + /** 用户名 */ + Devicename?: string; + /** 用户昵称 */ + nickname?: string; + /** 头像URL */ + avatar?: string; + /** 性别 */ + gender?: number; + /** 手机号 */ + mobile?: string; + /** 邮箱 */ + email?: string; + /** 部门名称 */ + deptName?: string; + /** 角色名称 */ + roleNames?: string; + /** 创建时间 */ + createTime?: Date; +} + +/** 个人中心用户信息表单 */ +export interface DeviceProfileForm { + /** 用户昵称 */ + nickname?: string; + /** 头像URL */ + avatar?: string; + /** 性别 */ + gender?: number; +} + +/** 修改密码表单 */ +export interface DevicePasswordChangeForm { + /** 原密码 */ + oldPassword?: string; + /** 新密码 */ + newPassword?: string; + /** 确认新密码 */ + confirmPassword?: string; +} + +/** 密码校验表单 */ +export interface DevicePasswordVerifyForm { + /** 当前密码 */ + password?: string; +} + +/** 修改手机表单 */ +export interface DeviceMobileUpdateForm { + /** 手机号 */ + mobile?: string; + /** 验证码 */ + code?: string; + /** 当前密码 */ + password?: string; +} + +/** 修改邮箱表单 */ +export interface DeviceEmailUpdateForm { + /** 邮箱 */ + email?: string; + /** 验证码 */ + code?: string; + /** 当前密码 */ + 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; + pushId?: 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; +} + +// ===================== 设备应用信息 ===================== + +/** 设备已安装应用信息 */ +export interface ApkInstallInfo { + /** 包名 */ packageName?: string; /** 应用名称 */ appName?: string; - /** 图标访问地址 */ + /** 版本名称 */ + versionName?: string; + /** 版本号 */ + versionCode?: number; + /** 安装时间 */ + installTime?: Date | string; + /** 最后更新时间 */ + lastUpdateTime?: Date | string; + /** Apk文件大小 */ + apkSize?: number; + /** App数据占用空间 */ + dataSize?: number; + /** App缓存占用空间 */ + cacheSize?: number; + /** apk MD5 */ + md5?: string; + /** 是否为系统应用 */ + systemApp?: boolean; + /** 应用图标访问地址 */ iconUrl?: string; - /** 图标文件MD5 */ - iconMd5?: string; - /** 版本号(同包名内自增) */ - version?: number; - /** 状态(1当前生效 0历史版本) */ - status?: number; - /** 是否锁定(0未锁定 1已锁定) */ - locked?: number; - /** 图标来源(device/admin) */ - source?: string; - /** 创建时间 */ - createTime?: string; - /** 更新时间 */ - updateTime?: string; +} + +// ===================== 设备定位信息 ===================== + +/** 设备定位信息 */ +export interface DeviceLocationInfo { + /** 设备序列号 */ + sn?: string; + /** 国家 */ + country?: string; + /** 国家代码 */ + countryCode?: string; + /** 省 */ + province?: string; + /** 市 */ + city?: string; + /** 城市代码 */ + cityCode?: string; + /** 区/县 */ + district?: string; + /** 街道 */ + street?: string; + /** 门牌号 */ + streetNumber?: string; + /** 详细地址 */ + address?: string; + /** 区域编码 */ + adCode?: string; + /** 镇 */ + town?: string; + /** 镇级行政区划编码 */ + townCode?: string; + /** 位置描述 */ + locationDescribe?: string; + /** 经度 */ + longitude?: string; + /** 纬度 */ + latitude?: string; + /** 定位失败原因,成功时为 '-' */ + mapError?: string; + /** 上次定位成功时间 */ + lastSuccessfulTime?: string; +} + +/** 设备截图信息 */ +export interface DeviceScreenshot { + /** 截图ID */ + id?: number; + /** 设备序列号 */ + sn?: string; + /** 文件名称 */ + fileName?: string; + /** 文件大小(字节) */ + fileSize?: number; + /** 可访问的图片URL */ + url?: string; + /** 上传时间 */ + uploadTime?: string; +} + +// ===================== 设备策略信息 ===================== + +/** 设备策略信息 */ +export interface DevicePolicyInfo { + /** 策略ID */ + id?: number; + /** 设备序列号 */ + serialno?: string; + /** USB偏好设置(0关闭 1开启) */ + usbData?: number; + /** 时间设置管控(0关闭 1开启) */ + timeSetting?: number; + /** 存储卡(0关闭 1开启) */ + storageCard?: number; + /** 恢复出厂(0关闭 1开启) */ + factoryReset?: number; + /** WiFi热点开关(0关闭 1开启) */ + wifiHotspot?: number; + /** 蓝牙开关(0关闭 1开启) */ + bluetoothSwitch?: number; + /** 壁纸功能(0关闭 1开启) */ + wallpaper?: number; + /** 通知栏显示(0关闭 1开启) */ + notificationBar?: number; + /** 状态栏下拉开关(0关闭 1开启) */ + statusBarPullDown?: number; + /** 系统导航条显示(0关闭 1开启) */ + systemNavBarShow?: number; + /** 系统导航栏设置(0关闭 1开启) */ + systemNavBarSetting?: number; + /** 导航条选项(0关闭 1开启) */ + navBarOptions?: number; + /** 蓝牙功能开关(0关闭 1开启) */ + bluetoothFunction?: number; + /** OTA升级管控(0关闭 1开启) */ + otaUpgrade?: number; + /** 应用安装开关(0关闭 1开启) */ + appInstall?: number; + /** 自动旋转(0关闭 1开启) */ + autoRotate?: number; + /** 自动亮度(0关闭 1开启) */ + autoBrightness?: number; + /** 护眼模式(0关闭 1开启) */ + eyeProtection?: number; + /** 深色模式(0关闭 1开启) */ + darkMode?: number; +} + +/** 设备策略单独设置请求 */ +export interface DevicePolicyToggleForm { + /** 策略字段名(如 usbData、appInstall) */ + field: string; + /** 开关值(0关闭 1开启) */ + value: number; } diff --git a/src/api/system/device/types.ts b/src/api/system/device/types.ts deleted file mode 100644 index 022514c4..00000000 --- a/src/api/system/device/types.ts +++ /dev/null @@ -1,508 +0,0 @@ -/** - * Device 用户类型定义 - */ - -import type { PageQuery } from "@/api/common"; - -/** 登录用户信息 */ -export interface DeviceInfo { - /** 用户ID */ - userId?: string; - /** 用户名 */ - username?: string; - /** 用户昵称 */ - nickname?: string; - /** 头像URL */ - avatar?: string; - /** 租户切换权限(true 可切换租户) */ - canSwitchTenant?: boolean; - /** 角色集合 */ - roles: string[]; - /** 权限集合 */ - perms: string[]; -} - -/** 用户分页查询参数 */ -export interface DeviceQueryParams extends PageQuery { - /** 搜索关键字 */ - keywords?: string; - /** 用户状态 */ - status?: number; - /** 部门ID */ - deptId?: string; - /** 创建时间 */ - createTime?: [string, string]; -} - -/** 设备分页对象 */ -export interface DeviceItem { - /** 设备ID */ - id: string; - /** 设备序列号 */ - serialno?: string; - /** 设备型号 */ - snModel?: string; - /** 设备名 */ - snName?: string; - /** 设备绑定手机 */ - snMobile?: string; - /** 推送ID */ - pushId?: string; - /** 设备状态(1:启用;0:禁用) */ - status?: number; - /** 在线状态(1:在线;0:离线) */ - online?: number; - /** 最后心跳时间 */ - lastHeartbeatTime?: string; - /** 激活时间 */ - activateTime?: string; - /** 创建时间 */ - createTime?: Date; -} - -/** 设备在线状态视图对象 */ -export interface DeviceOnlineVO { - /** 设备序列号 */ - serialno?: string; - /** 在线状态(1:在线;0:离线) */ - online?: number; - /** 最后心跳时间 */ - lastHeartbeatTime?: string; - /** 设备 IP */ - ip?: string; - /** 屏幕状态(1:亮屏;0:熄屏;null:未知) */ - screenState?: number; -} - -/** 设备最后心跳视图对象(来自 TDengine) */ -export interface DeviceHeartbeatVO { - /** 设备序列号 */ - sn?: string; - /** 最后心跳时间 */ - lastTime?: string; - /** 在线状态(1:在线;0:离线) */ - online?: number; - /** 设备 IP */ - ip?: string; - /** 信号强度 */ - rssi?: string; - /** 屏幕是否亮起(1:亮屏;0:熄屏) */ - screenOn?: number; -} - -/** 设备表单对象 */ -export interface DeviceForm { - /** 设备ID */ - id?: string; - /** 设备序列号 */ - serialno?: string; - /** 设备名称 */ - snName?: string; - /** 设备型号 */ - snModel?: string; - /** 设备手机号 */ - snMobile?: string; - /** 设备在线状态(1:在线;0:离线) */ - online?: number; - /** 设备IMEI */ - snImei?: string; - /** 所属部门 */ - department?: string; - /** 分组 */ - group?: string; - /** 设备类型 */ - deviceType?: string; - /** 设备来源 */ - source?: string; - /** 激活时间 */ - activationTime?: string; - /** 最后上线时间 */ - lastOnline?: string; - /** 角色ID集合 */ - roleIds?: number[]; - /** 设备状态(1:正常;0:禁用) */ - status?: number; -} - -/** 个人中心用户信息 */ -export interface DeviceProfileDetail { - /** 用户ID */ - id?: string; - /** 用户名 */ - Devicename?: string; - /** 用户昵称 */ - nickname?: string; - /** 头像URL */ - avatar?: string; - /** 性别 */ - gender?: number; - /** 手机号 */ - mobile?: string; - /** 邮箱 */ - email?: string; - /** 部门名称 */ - deptName?: string; - /** 角色名称 */ - roleNames?: string; - /** 创建时间 */ - createTime?: Date; -} - -/** 个人中心用户信息表单 */ -export interface DeviceProfileForm { - /** 用户昵称 */ - nickname?: string; - /** 头像URL */ - avatar?: string; - /** 性别 */ - gender?: number; -} - -/** 修改密码表单 */ -export interface DevicePasswordChangeForm { - /** 原密码 */ - oldPassword?: string; - /** 新密码 */ - newPassword?: string; - /** 确认新密码 */ - confirmPassword?: string; -} - -/** 密码校验表单 */ -export interface DevicePasswordVerifyForm { - /** 当前密码 */ - password?: string; -} - -/** 修改手机表单 */ -export interface DeviceMobileUpdateForm { - /** 手机号 */ - mobile?: string; - /** 验证码 */ - code?: string; - /** 当前密码 */ - password?: string; -} - -/** 修改邮箱表单 */ -export interface DeviceEmailUpdateForm { - /** 邮箱 */ - email?: string; - /** 验证码 */ - code?: string; - /** 当前密码 */ - 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; - pushId?: 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; -} - -// ===================== 设备应用信息 ===================== - -/** 设备已安装应用信息 */ -export interface ApkInstallInfo { - /** 包名 */ - packageName?: string; - /** 应用名称 */ - appName?: string; - /** 版本名称 */ - versionName?: string; - /** 版本号 */ - versionCode?: number; - /** 安装时间 */ - installTime?: Date | string; - /** 最后更新时间 */ - lastUpdateTime?: Date | string; - /** Apk文件大小 */ - apkSize?: number; - /** App数据占用空间 */ - dataSize?: number; - /** App缓存占用空间 */ - cacheSize?: number; - /** apk MD5 */ - md5?: string; - /** 是否为系统应用 */ - systemApp?: boolean; - /** 应用图标访问地址 */ - iconUrl?: string; -} - -// ===================== 设备定位信息 ===================== - -/** 设备定位信息 */ -export interface DeviceLocationInfo { - /** 设备序列号 */ - sn?: string; - /** 国家 */ - country?: string; - /** 国家代码 */ - countryCode?: string; - /** 省 */ - province?: string; - /** 市 */ - city?: string; - /** 城市代码 */ - cityCode?: string; - /** 区/县 */ - district?: string; - /** 街道 */ - street?: string; - /** 门牌号 */ - streetNumber?: string; - /** 详细地址 */ - address?: string; - /** 区域编码 */ - adCode?: string; - /** 镇 */ - town?: string; - /** 镇级行政区划编码 */ - townCode?: string; - /** 位置描述 */ - locationDescribe?: string; - /** 经度 */ - longitude?: string; - /** 纬度 */ - latitude?: string; - /** 定位失败原因,成功时为 '-' */ - mapError?: string; - /** 上次定位成功时间 */ - lastSuccessfulTime?: string; -} - -/** 设备截图信息 */ -export interface DeviceScreenshot { - /** 截图ID */ - id?: number; - /** 设备序列号 */ - sn?: string; - /** 文件名称 */ - fileName?: string; - /** 文件大小(字节) */ - fileSize?: number; - /** 可访问的图片URL */ - url?: string; - /** 上传时间 */ - uploadTime?: string; -} - -// ===================== 设备策略信息 ===================== - -/** 设备策略信息 */ -export interface DevicePolicyInfo { - /** 策略ID */ - id?: number; - /** 设备序列号 */ - serialno?: string; - /** USB偏好设置(0关闭 1开启) */ - usbData?: number; - /** 时间设置管控(0关闭 1开启) */ - timeSetting?: number; - /** 存储卡(0关闭 1开启) */ - storageCard?: number; - /** 恢复出厂(0关闭 1开启) */ - factoryReset?: number; - /** WiFi热点开关(0关闭 1开启) */ - wifiHotspot?: number; - /** 蓝牙开关(0关闭 1开启) */ - bluetoothSwitch?: number; - /** 壁纸功能(0关闭 1开启) */ - wallpaper?: number; - /** 通知栏显示(0关闭 1开启) */ - notificationBar?: number; - /** 状态栏下拉开关(0关闭 1开启) */ - statusBarPullDown?: number; - /** 系统导航条显示(0关闭 1开启) */ - systemNavBarShow?: number; - /** 系统导航栏设置(0关闭 1开启) */ - systemNavBarSetting?: number; - /** 导航条选项(0关闭 1开启) */ - navBarOptions?: number; - /** 蓝牙功能开关(0关闭 1开启) */ - bluetoothFunction?: number; - /** OTA升级管控(0关闭 1开启) */ - otaUpgrade?: number; - /** 应用安装开关(0关闭 1开启) */ - appInstall?: number; - /** 自动旋转(0关闭 1开启) */ - autoRotate?: number; - /** 自动亮度(0关闭 1开启) */ - autoBrightness?: number; - /** 护眼模式(0关闭 1开启) */ - eyeProtection?: number; - /** 深色模式(0关闭 1开启) */ - darkMode?: number; -} - -/** 设备策略单独设置请求 */ -export interface DevicePolicyToggleForm { - /** 策略字段名(如 usbData、appInstall) */ - field: string; - /** 开关值(0关闭 1开启) */ - value: number; -} diff --git a/src/views/devices/app-icon/index.vue b/src/views/devices/app-icon/index.vue index 1e404884..42ac3201 100644 --- a/src/views/devices/app-icon/index.vue +++ b/src/views/devices/app-icon/index.vue @@ -235,7 +235,7 @@ import { import { usePageTable } from "@/composables"; import AppIconAPI from "@/api/device/appIcon"; -import type { AppIconQuery, AppIconVO } from "@/api/device/types"; +import type { AppIconQuery, AppIconVO } from "@/api/device/appIcon.types"; import { withBase } from "@/utils/asset-url"; defineOptions({ diff --git a/src/views/devices/developer/index.vue b/src/views/devices/developer/index.vue index 999a5c34..08ed477b 100644 --- a/src/views/devices/developer/index.vue +++ b/src/views/devices/developer/index.vue @@ -177,8 +177,8 @@ import { ElMessage, ElMessageBox, type FormInstance, type FormRules } from "element-plus"; import { Refresh, FullScreen } from "@element-plus/icons-vue"; -import DeveloperAPI from "@/api/system/developer"; -import type { DeveloperItem, DeveloperForm, DeveloperQueryParams } from "@/api/system/developer"; +import DeveloperAPI from "@/api/developer"; +import type { DeveloperItem, DeveloperForm, DeveloperQueryParams } from "@/api/developer"; import { usePageTable } from "@/composables"; import { hasPerm } from "@/utils/permission"; diff --git a/src/components/DeviceSn/DevicePageContent.vue b/src/views/devices/sn/components/DevicePageContent.vue similarity index 100% rename from src/components/DeviceSn/DevicePageContent.vue rename to src/views/devices/sn/components/DevicePageContent.vue diff --git a/src/components/DeviceSn/DevicePageModal.vue b/src/views/devices/sn/components/DevicePageModal.vue similarity index 100% rename from src/components/DeviceSn/DevicePageModal.vue rename to src/views/devices/sn/components/DevicePageModal.vue diff --git a/src/components/DeviceSn/DevicePageSearch.vue b/src/views/devices/sn/components/DevicePageSearch.vue similarity index 99% rename from src/components/DeviceSn/DevicePageSearch.vue rename to src/views/devices/sn/components/DevicePageSearch.vue index 1cdb4610..54af4542 100644 --- a/src/components/DeviceSn/DevicePageSearch.vue +++ b/src/views/devices/sn/components/DevicePageSearch.vue @@ -107,7 +107,7 @@ const isExpandable = ref(props.searchConfig?.isExpandable ?? true); const isExpand = ref(false); // 表单项展示数量,若可展开,超出展示数量的表单项隐藏 const showNumber = computed(() => - isExpandable.value ? (props.searchConfig?.showNumber ?? 3) : formItems.length + isExpandable.value ? (props.searchConfig?.showNumber ?? 3) : formItems.length, ); // 卡片组件自定义属性(阴影、自定义边距样式等) const cardAttrs = computed(() => { @@ -121,7 +121,7 @@ const formAttrs = computed(() => { const isGrid = computed(() => props.searchConfig?.grid ? "grid grid-cols-1 md:grid-cols-2 xl:grid-cols-3 2xl:grid-cols-4 3xl:grid-cols-5 4xl:grid-cols-6 gap-5" - : "flex flex-wrap gap-x-8 gap-y-4" + : "flex flex-wrap gap-x-8 gap-y-4", ); // 获取tooltip提示框属性 diff --git a/src/components/DeviceSn/DeviceSnDetail.vue b/src/views/devices/sn/components/DeviceSnDetail.vue similarity index 99% rename from src/components/DeviceSn/DeviceSnDetail.vue rename to src/views/devices/sn/components/DeviceSnDetail.vue index f1b679cc..391c3fe2 100644 --- a/src/components/DeviceSn/DeviceSnDetail.vue +++ b/src/views/devices/sn/components/DeviceSnDetail.vue @@ -791,7 +791,7 @@