diff --git a/src/api/appUser/types.ts b/src/api/appUser/types.ts index 17ade8d..f7eba1c 100644 --- a/src/api/appUser/types.ts +++ b/src/api/appUser/types.ts @@ -189,6 +189,10 @@ export interface AppUserBindingVO { * 房间号 */ roomNo?: string; + /** + * 安装位置(房间展示用,如「1号楼101室」) + */ + installLocation?: string; } /** diff --git a/src/views/biz/appUser/components/detail/DeviceTab.vue b/src/views/biz/appUser/components/detail/DeviceTab.vue index 3d70c20..368b0af 100644 --- a/src/views/biz/appUser/components/detail/DeviceTab.vue +++ b/src/views/biz/appUser/components/detail/DeviceTab.vue @@ -6,7 +6,7 @@
-
{{ device.roomNo || '—' }}
+
{{ device.installLocation }}
{{ deviceTypeText(device) }}:{{ valueOrDash(device.deviceNo) }}
diff --git a/src/views/biz/appUser/components/detail/HistoryTab.vue b/src/views/biz/appUser/components/detail/HistoryTab.vue index a7b5511..e025a99 100644 --- a/src/views/biz/appUser/components/detail/HistoryTab.vue +++ b/src/views/biz/appUser/components/detail/HistoryTab.vue @@ -3,8 +3,11 @@
-
{{ item.deviceText }}
-
{{ item.roomNo }}
+ +
+ {{ item.roomNo }} + {{ item.deviceNo }} +
已解绑 @@ -20,7 +23,7 @@ import { getAppUserBindings } from '@/api/appUser'; import type { AppUserBindingVO } from '@/api/appUser/types'; import { useLoading } from '@/hooks/async/useLoading'; -import { deviceLabel, normalizeRecordList, valueOrDash } from './helpers'; +import { normalizeRecordList, valueOrDash } from './helpers'; const props = defineProps<{ userId?: string | number }>(); @@ -28,7 +31,7 @@ const props = defineProps<{ userId?: string | number }>(); interface HistoryDeviceItem { id: string | number; roomNo: string; - deviceText: string; + deviceNo: string; unboundAt: string; } @@ -39,8 +42,8 @@ const records = ref([]); const historyDevices = computed(() => records.value.map(record => ({ id: record.id, - roomNo: String(valueOrDash(record.roomNo)), - deviceText: deviceLabel(record), + roomNo: String(valueOrDash(record.installLocation)), + deviceNo: String(valueOrDash(record.deviceNo)), unboundAt: record.unboundAt || '—' })) ); @@ -76,4 +79,9 @@ onMounted(() => { @include panels.record-list; @include panels.unbound-tag; + +.record-device-no { + margin-left: 8px; + color: var(--el-text-color-regular); +} diff --git a/src/views/biz/appUser/components/detail/ReadingTab.vue b/src/views/biz/appUser/components/detail/ReadingTab.vue index 2d4ea48..ad55f5b 100644 --- a/src/views/biz/appUser/components/detail/ReadingTab.vue +++ b/src/views/biz/appUser/components/detail/ReadingTab.vue @@ -18,8 +18,11 @@
-
{{ record.roomNo }}
-
{{ record.deviceText }}
+ +
+ {{ record.roomNo }} + {{ record.deviceNo }} +
@@ -46,7 +49,7 @@ import { listAppUserReadings } from '@/api/appUser'; import type { AppUserReadingQuery, AppUserReadingVO } from '@/api/appUser/types'; import { useLoading } from '@/hooks/async/useLoading'; -import { deviceLabel, formatReading, normalizeRecordList, quantityUnit, valueOrDash } from './helpers'; +import { formatReading, normalizeRecordList, quantityUnit, valueOrDash } from './helpers'; const props = defineProps<{ userId?: string | number }>(); @@ -54,7 +57,7 @@ const props = defineProps<{ userId?: string | number }>(); interface ReadingRecordItem { id: string | number; roomNo: string; - deviceText: string; + deviceNo: string; previousReading: string; reading: string; usage: string; @@ -71,8 +74,8 @@ const readingRecords = computed(() => const unit = quantityUnit(record); return { id: record.id, - roomNo: String(valueOrDash(record.roomNo)), - deviceText: deviceLabel(record), + roomNo: String(valueOrDash(record.installLocation)), + deviceNo: String(valueOrDash(record.deviceNo)), previousReading: formatReading(record.previousReadingValue, unit), reading: formatReading(record.readingValue, unit), usage: formatReading(record.usageQuantity, unit) @@ -120,6 +123,11 @@ onMounted(() => { @include panels.record-card-list; +.card-device-no { + margin-left: 8px; + color: var(--el-text-color-regular); +} + .reading-toolbar { display: flex; justify-self: start; diff --git a/src/views/biz/appUser/components/detail/ResetTab.vue b/src/views/biz/appUser/components/detail/ResetTab.vue index 5b9768d..58a89e6 100644 --- a/src/views/biz/appUser/components/detail/ResetTab.vue +++ b/src/views/biz/appUser/components/detail/ResetTab.vue @@ -3,8 +3,11 @@
-
{{ record.roomNo }}
-
{{ record.deviceText }}
+ +
+ {{ record.roomNo }} + {{ record.deviceNo }} +
@@ -27,7 +30,7 @@ import { listAppUserResets } from '@/api/appUser'; import type { AppUserResetVO } from '@/api/appUser/types'; import { useLoading } from '@/hooks/async/useLoading'; -import { deviceLabel, formatReading, normalizeRecordList, quantityUnit, valueOrDash } from './helpers'; +import { formatReading, normalizeRecordList, quantityUnit, valueOrDash } from './helpers'; const props = defineProps<{ userId?: string | number }>(); @@ -35,7 +38,7 @@ const props = defineProps<{ userId?: string | number }>(); interface ResetRecordItem { id: string | number; roomNo: string; - deviceText: string; + deviceNo: string; beforeReading: string; afterReading: string; resetTime: string; @@ -50,8 +53,8 @@ const resetRecords = computed(() => const unit = quantityUnit(record); return { id: record.id, - roomNo: String(valueOrDash(record.roomNo)), - deviceText: deviceLabel(record), + roomNo: String(valueOrDash(record.installLocation)), + deviceNo: String(valueOrDash(record.deviceNo)), beforeReading: formatReading(record.beforeReadingValue, unit), afterReading: formatReading(record.afterReadingValue, unit), resetTime: record.resetTime || '—' @@ -89,4 +92,9 @@ onMounted(() => { } @include panels.record-card-list; + +.card-device-no { + margin-left: 8px; + color: var(--el-text-color-regular); +}