diff --git a/src/api/business/deviceData/ring/index.ts b/src/api/business/deviceData/ring/index.ts new file mode 100644 index 0000000..39087ee --- /dev/null +++ b/src/api/business/deviceData/ring/index.ts @@ -0,0 +1,17 @@ +import request from '@/utils/request'; +import { AxiosPromise } from 'axios'; +import { RingVO, RingQuery } from '@/api/business/deviceData/ring/types'; + +/** + * 查询设备数据采集(指环)列表 + * @param query + * @returns {*} + */ + +export const listRing = (query?: RingQuery): AxiosPromise => { + return request({ + url: '/business/deviceData/page', + method: 'post', + data: query + }); +}; diff --git a/src/api/business/deviceData/ring/types.ts b/src/api/business/deviceData/ring/types.ts new file mode 100644 index 0000000..ea31858 --- /dev/null +++ b/src/api/business/deviceData/ring/types.ts @@ -0,0 +1,29 @@ +export interface RingVO { + email: string; + deviceId: string; + deviceMode: string; + activationTime: string; + heartRate: number; + bodyTemp: number; + bloodOxygen: number; + collectTime: string; +} + +export interface RingForm extends BaseEntity {} + +export interface RingQuery extends PageQuery { + /** + * 设备类型 + */ + deviceType: string; + + /** + * 用户邮箱 + */ + email?: string; + + /** + * 激活时间 + */ + collectTimeRange?: string[]; +} diff --git a/src/api/business/userDevice/index.ts b/src/api/business/userDevice/index.ts new file mode 100644 index 0000000..fd92ce9 --- /dev/null +++ b/src/api/business/userDevice/index.ts @@ -0,0 +1,17 @@ +import request from '@/utils/request'; +import { AxiosPromise } from 'axios'; +import { UserDeviceVO, UserDeviceQuery } from '@/api/business/userDevice/types'; + +/** + * 查询用户设备列表 + * @param query + * @returns {*} + */ + +export const listUserDevice = (query?: UserDeviceQuery): AxiosPromise => { + return request({ + url: '/business/userDevice/page', + method: 'get', + params: query + }); +}; diff --git a/src/api/business/userDevice/types.ts b/src/api/business/userDevice/types.ts new file mode 100644 index 0000000..a1bfe46 --- /dev/null +++ b/src/api/business/userDevice/types.ts @@ -0,0 +1,61 @@ +export interface UserDeviceVO { + /** + * 用户邮箱 + */ + email: string; + + /** + * 用户设备id + */ + deviceId: string; + + /** + * 设备类型 + */ + deviceType: string; + + /** + * 设备名称 + */ + deviceName: string; + + /** + * 设备当前模式 + */ + deviceMode: string; + + /** + * 设备状态 + */ + deviceStatus: string; + + /** + * 激活时间 + */ + activationTime: string; + +} + +export interface UserDeviceForm extends BaseEntity { +} + +export interface UserDeviceQuery extends PageQuery { + + /** + * 用户邮箱 + */ + email?: string; + + /** + * 设备状态 + */ + deviceStatus?: string; + + /** + * 激活时间 + */ + activationTime?: string; +} + + + diff --git a/src/api/system/dict/data/types.ts b/src/api/system/dict/data/types.ts index e4abb9b..8706508 100644 --- a/src/api/system/dict/data/types.ts +++ b/src/api/system/dict/data/types.ts @@ -10,6 +10,7 @@ export interface DictDataVO extends BaseEntity { dictValue: string; cssClass: string; listClass: ElTagType; + effect: ElTagEffect; dictSort: number; remark: string; } @@ -21,6 +22,7 @@ export interface DictDataForm { dictValue: string; cssClass: string; listClass: ElTagType; + effect: ElTagEffect; dictSort: number; remark: string; } diff --git a/src/components/DictTag/index.vue b/src/components/DictTag/index.vue index ad326c2..ade2026 100644 --- a/src/components/DictTag/index.vue +++ b/src/components/DictTag/index.vue @@ -25,6 +25,7 @@ : 'primary' " :class="item.elTagClass" + :effect="item.effect ? item.effect : 'light'" > {{ item.label + ' ' }} diff --git a/src/types/element.d.ts b/src/types/element.d.ts index ae6ecfc..084a123 100644 --- a/src/types/element.d.ts +++ b/src/types/element.d.ts @@ -1,6 +1,7 @@ import type * as ep from 'element-plus'; declare global { declare type ElTagType = 'primary' | 'success' | 'info' | 'warning' | 'danger'; + declare type ElTagEffect = 'light' | 'dark' | 'plain'; declare type ElFormInstance = ep.FormInstance; declare type ElTableInstance = ep.TableInstance; declare type ElUploadInstance = ep.UploadInstance; diff --git a/src/types/global.d.ts b/src/types/global.d.ts index 17476a3..e6f90c4 100644 --- a/src/types/global.d.ts +++ b/src/types/global.d.ts @@ -63,6 +63,7 @@ declare global { value: string; elTagType?: ElTagType; elTagClass?: string; + effect?: string; } declare interface BaseEntity { diff --git a/src/utils/dict.ts b/src/utils/dict.ts index 0575072..48a1c8c 100644 --- a/src/utils/dict.ts +++ b/src/utils/dict.ts @@ -16,7 +16,7 @@ export const useDict = (...args: string[]): { [key: string]: DictDataOption[] } } else { await getDicts(dictType).then((resp) => { res.value[dictType] = resp.data.map( - (p): DictDataOption => ({ label: p.dictLabel, value: p.dictValue, elTagType: p.listClass, elTagClass: p.cssClass }) + (p): DictDataOption => ({ label: p.dictLabel, value: p.dictValue, elTagType: p.listClass, elTagClass: p.cssClass, effect: p.effect}) ); useDictStore().setDict(dictType, res.value[dictType]); }); diff --git a/src/views/business/deviceData/ring/index.vue b/src/views/business/deviceData/ring/index.vue new file mode 100644 index 0000000..f037862 --- /dev/null +++ b/src/views/business/deviceData/ring/index.vue @@ -0,0 +1,173 @@ + + + + diff --git a/src/views/business/userDevice/index.vue b/src/views/business/userDevice/index.vue new file mode 100644 index 0000000..c49661a --- /dev/null +++ b/src/views/business/userDevice/index.vue @@ -0,0 +1,150 @@ + + + diff --git a/src/views/system/dict/data.vue b/src/views/system/dict/data.vue index 33c7fc8..bdee6eb 100644 --- a/src/views/system/dict/data.vue +++ b/src/views/system/dict/data.vue @@ -49,16 +49,8 @@ @@ -111,6 +103,16 @@ > + + + + + @@ -164,12 +166,20 @@ const listClassOptions = ref>([ { value: 'danger', label: '危险' } ]); +// 数据标签主题 +const effectOptions = ref>([ + { value: "light", label: "亮色" }, + { value: "dark", label: "暗色" }, + { value: "plain", label: "扁平" }, +]); + const initFormData: DictDataForm = { dictCode: undefined, dictLabel: '', dictValue: '', cssClass: '', listClass: 'primary', + effect: 'light', dictSort: 0, remark: '' }; diff --git a/tsconfig.json b/tsconfig.json index e4bf3ac..c89f569 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -22,7 +22,7 @@ "compilerOptions": { "types": ["element-plus/global"] }, - "types": ["vite/client"], + "types": ["vite/client", "element-plus/global"], "skipLibCheck": true, "removeComments": true, // 允许默认导入