修改用户管理详情
This commit is contained in:
@@ -189,6 +189,10 @@ export interface AppUserBindingVO {
|
||||
* 房间号
|
||||
*/
|
||||
roomNo?: string;
|
||||
/**
|
||||
* 安装位置(房间展示用,如「1号楼101室」)
|
||||
*/
|
||||
installLocation?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<el-icon :size="18"><component :is="deviceIcon(device)" /></el-icon>
|
||||
</span>
|
||||
<div class="device-title">
|
||||
<div class="device-room">{{ device.roomNo || '—' }}</div>
|
||||
<div class="device-room">{{ device.installLocation }}</div>
|
||||
<div class="device-no">{{ deviceTypeText(device) }}:{{ valueOrDash(device.deviceNo) }}</div>
|
||||
</div>
|
||||
<el-tag :type="switchStatusTagType(device)" effect="light" round size="small">
|
||||
|
||||
@@ -3,8 +3,11 @@
|
||||
<div v-if="historyDevices.length" class="record-list">
|
||||
<div v-for="item in historyDevices" :key="item.id" class="record-row">
|
||||
<div class="record-main">
|
||||
<div class="record-title">{{ item.deviceText }}</div>
|
||||
<div class="record-sub">{{ item.roomNo }}</div>
|
||||
<!-- 房间 + 设备编号,不再展示设备名称 -->
|
||||
<div class="record-title">
|
||||
<span>{{ item.roomNo }}</span>
|
||||
<span class="record-device-no">{{ item.deviceNo }}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="record-side">
|
||||
<span class="unbound-tag">已解绑</span>
|
||||
@@ -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<AppUserBindingVO[]>([]);
|
||||
const historyDevices = computed<HistoryDeviceItem[]>(() =>
|
||||
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);
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -18,8 +18,11 @@
|
||||
<div v-if="readingRecords.length" class="card-list">
|
||||
<div v-for="record in readingRecords" :key="record.id" class="record-card">
|
||||
<div class="card-head">
|
||||
<div class="card-room">{{ record.roomNo }}</div>
|
||||
<div class="card-meta">{{ record.deviceText }}</div>
|
||||
<!-- 房间 + 设备编号,不再展示设备名称 -->
|
||||
<div class="card-room">
|
||||
<span>{{ record.roomNo }}</span>
|
||||
<span class="card-device-no">{{ record.deviceNo }}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-metrics card-metrics--three">
|
||||
<div class="metric-block">
|
||||
@@ -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<ReadingRecordItem[]>(() =>
|
||||
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;
|
||||
|
||||
@@ -3,8 +3,11 @@
|
||||
<div v-if="resetRecords.length" class="card-list">
|
||||
<div v-for="record in resetRecords" :key="record.id" class="record-card">
|
||||
<div class="card-head">
|
||||
<div class="card-room">{{ record.roomNo }}</div>
|
||||
<div class="card-meta">{{ record.deviceText }}</div>
|
||||
<!-- 房间 + 设备编号,不再展示设备名称 -->
|
||||
<div class="card-room">
|
||||
<span>{{ record.roomNo }}</span>
|
||||
<span class="card-device-no">{{ record.deviceNo }}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-metrics">
|
||||
<div class="metric-block">
|
||||
@@ -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<ResetRecordItem[]>(() =>
|
||||
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);
|
||||
}
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user