修改用户管理详情
This commit is contained in:
@@ -189,6 +189,10 @@ export interface AppUserBindingVO {
|
|||||||
* 房间号
|
* 房间号
|
||||||
*/
|
*/
|
||||||
roomNo?: string;
|
roomNo?: string;
|
||||||
|
/**
|
||||||
|
* 安装位置(房间展示用,如「1号楼101室」)
|
||||||
|
*/
|
||||||
|
installLocation?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
<el-icon :size="18"><component :is="deviceIcon(device)" /></el-icon>
|
<el-icon :size="18"><component :is="deviceIcon(device)" /></el-icon>
|
||||||
</span>
|
</span>
|
||||||
<div class="device-title">
|
<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 class="device-no">{{ deviceTypeText(device) }}:{{ valueOrDash(device.deviceNo) }}</div>
|
||||||
</div>
|
</div>
|
||||||
<el-tag :type="switchStatusTagType(device)" effect="light" round size="small">
|
<el-tag :type="switchStatusTagType(device)" effect="light" round size="small">
|
||||||
|
|||||||
@@ -3,8 +3,11 @@
|
|||||||
<div v-if="historyDevices.length" class="record-list">
|
<div v-if="historyDevices.length" class="record-list">
|
||||||
<div v-for="item in historyDevices" :key="item.id" class="record-row">
|
<div v-for="item in historyDevices" :key="item.id" class="record-row">
|
||||||
<div class="record-main">
|
<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>
|
||||||
<div class="record-side">
|
<div class="record-side">
|
||||||
<span class="unbound-tag">已解绑</span>
|
<span class="unbound-tag">已解绑</span>
|
||||||
@@ -20,7 +23,7 @@
|
|||||||
import { getAppUserBindings } from '@/api/appUser';
|
import { getAppUserBindings } from '@/api/appUser';
|
||||||
import type { AppUserBindingVO } from '@/api/appUser/types';
|
import type { AppUserBindingVO } from '@/api/appUser/types';
|
||||||
import { useLoading } from '@/hooks/async/useLoading';
|
import { useLoading } from '@/hooks/async/useLoading';
|
||||||
import { deviceLabel, normalizeRecordList, valueOrDash } from './helpers';
|
import { normalizeRecordList, valueOrDash } from './helpers';
|
||||||
|
|
||||||
const props = defineProps<{ userId?: string | number }>();
|
const props = defineProps<{ userId?: string | number }>();
|
||||||
|
|
||||||
@@ -28,7 +31,7 @@ const props = defineProps<{ userId?: string | number }>();
|
|||||||
interface HistoryDeviceItem {
|
interface HistoryDeviceItem {
|
||||||
id: string | number;
|
id: string | number;
|
||||||
roomNo: string;
|
roomNo: string;
|
||||||
deviceText: string;
|
deviceNo: string;
|
||||||
unboundAt: string;
|
unboundAt: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -39,8 +42,8 @@ const records = ref<AppUserBindingVO[]>([]);
|
|||||||
const historyDevices = computed<HistoryDeviceItem[]>(() =>
|
const historyDevices = computed<HistoryDeviceItem[]>(() =>
|
||||||
records.value.map(record => ({
|
records.value.map(record => ({
|
||||||
id: record.id,
|
id: record.id,
|
||||||
roomNo: String(valueOrDash(record.roomNo)),
|
roomNo: String(valueOrDash(record.installLocation)),
|
||||||
deviceText: deviceLabel(record),
|
deviceNo: String(valueOrDash(record.deviceNo)),
|
||||||
unboundAt: record.unboundAt || '—'
|
unboundAt: record.unboundAt || '—'
|
||||||
}))
|
}))
|
||||||
);
|
);
|
||||||
@@ -76,4 +79,9 @@ onMounted(() => {
|
|||||||
|
|
||||||
@include panels.record-list;
|
@include panels.record-list;
|
||||||
@include panels.unbound-tag;
|
@include panels.unbound-tag;
|
||||||
|
|
||||||
|
.record-device-no {
|
||||||
|
margin-left: 8px;
|
||||||
|
color: var(--el-text-color-regular);
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -18,8 +18,11 @@
|
|||||||
<div v-if="readingRecords.length" class="card-list">
|
<div v-if="readingRecords.length" class="card-list">
|
||||||
<div v-for="record in readingRecords" :key="record.id" class="record-card">
|
<div v-for="record in readingRecords" :key="record.id" class="record-card">
|
||||||
<div class="card-head">
|
<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>
|
||||||
<div class="card-metrics card-metrics--three">
|
<div class="card-metrics card-metrics--three">
|
||||||
<div class="metric-block">
|
<div class="metric-block">
|
||||||
@@ -46,7 +49,7 @@
|
|||||||
import { listAppUserReadings } from '@/api/appUser';
|
import { listAppUserReadings } from '@/api/appUser';
|
||||||
import type { AppUserReadingQuery, AppUserReadingVO } from '@/api/appUser/types';
|
import type { AppUserReadingQuery, AppUserReadingVO } from '@/api/appUser/types';
|
||||||
import { useLoading } from '@/hooks/async/useLoading';
|
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 }>();
|
const props = defineProps<{ userId?: string | number }>();
|
||||||
|
|
||||||
@@ -54,7 +57,7 @@ const props = defineProps<{ userId?: string | number }>();
|
|||||||
interface ReadingRecordItem {
|
interface ReadingRecordItem {
|
||||||
id: string | number;
|
id: string | number;
|
||||||
roomNo: string;
|
roomNo: string;
|
||||||
deviceText: string;
|
deviceNo: string;
|
||||||
previousReading: string;
|
previousReading: string;
|
||||||
reading: string;
|
reading: string;
|
||||||
usage: string;
|
usage: string;
|
||||||
@@ -71,8 +74,8 @@ const readingRecords = computed<ReadingRecordItem[]>(() =>
|
|||||||
const unit = quantityUnit(record);
|
const unit = quantityUnit(record);
|
||||||
return {
|
return {
|
||||||
id: record.id,
|
id: record.id,
|
||||||
roomNo: String(valueOrDash(record.roomNo)),
|
roomNo: String(valueOrDash(record.installLocation)),
|
||||||
deviceText: deviceLabel(record),
|
deviceNo: String(valueOrDash(record.deviceNo)),
|
||||||
previousReading: formatReading(record.previousReadingValue, unit),
|
previousReading: formatReading(record.previousReadingValue, unit),
|
||||||
reading: formatReading(record.readingValue, unit),
|
reading: formatReading(record.readingValue, unit),
|
||||||
usage: formatReading(record.usageQuantity, unit)
|
usage: formatReading(record.usageQuantity, unit)
|
||||||
@@ -120,6 +123,11 @@ onMounted(() => {
|
|||||||
|
|
||||||
@include panels.record-card-list;
|
@include panels.record-card-list;
|
||||||
|
|
||||||
|
.card-device-no {
|
||||||
|
margin-left: 8px;
|
||||||
|
color: var(--el-text-color-regular);
|
||||||
|
}
|
||||||
|
|
||||||
.reading-toolbar {
|
.reading-toolbar {
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-self: start;
|
justify-self: start;
|
||||||
|
|||||||
@@ -3,8 +3,11 @@
|
|||||||
<div v-if="resetRecords.length" class="card-list">
|
<div v-if="resetRecords.length" class="card-list">
|
||||||
<div v-for="record in resetRecords" :key="record.id" class="record-card">
|
<div v-for="record in resetRecords" :key="record.id" class="record-card">
|
||||||
<div class="card-head">
|
<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>
|
||||||
<div class="card-metrics">
|
<div class="card-metrics">
|
||||||
<div class="metric-block">
|
<div class="metric-block">
|
||||||
@@ -27,7 +30,7 @@
|
|||||||
import { listAppUserResets } from '@/api/appUser';
|
import { listAppUserResets } from '@/api/appUser';
|
||||||
import type { AppUserResetVO } from '@/api/appUser/types';
|
import type { AppUserResetVO } from '@/api/appUser/types';
|
||||||
import { useLoading } from '@/hooks/async/useLoading';
|
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 }>();
|
const props = defineProps<{ userId?: string | number }>();
|
||||||
|
|
||||||
@@ -35,7 +38,7 @@ const props = defineProps<{ userId?: string | number }>();
|
|||||||
interface ResetRecordItem {
|
interface ResetRecordItem {
|
||||||
id: string | number;
|
id: string | number;
|
||||||
roomNo: string;
|
roomNo: string;
|
||||||
deviceText: string;
|
deviceNo: string;
|
||||||
beforeReading: string;
|
beforeReading: string;
|
||||||
afterReading: string;
|
afterReading: string;
|
||||||
resetTime: string;
|
resetTime: string;
|
||||||
@@ -50,8 +53,8 @@ const resetRecords = computed<ResetRecordItem[]>(() =>
|
|||||||
const unit = quantityUnit(record);
|
const unit = quantityUnit(record);
|
||||||
return {
|
return {
|
||||||
id: record.id,
|
id: record.id,
|
||||||
roomNo: String(valueOrDash(record.roomNo)),
|
roomNo: String(valueOrDash(record.installLocation)),
|
||||||
deviceText: deviceLabel(record),
|
deviceNo: String(valueOrDash(record.deviceNo)),
|
||||||
beforeReading: formatReading(record.beforeReadingValue, unit),
|
beforeReading: formatReading(record.beforeReadingValue, unit),
|
||||||
afterReading: formatReading(record.afterReadingValue, unit),
|
afterReading: formatReading(record.afterReadingValue, unit),
|
||||||
resetTime: record.resetTime || '—'
|
resetTime: record.resetTime || '—'
|
||||||
@@ -89,4 +92,9 @@ onMounted(() => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@include panels.record-card-list;
|
@include panels.record-card-list;
|
||||||
|
|
||||||
|
.card-device-no {
|
||||||
|
margin-left: 8px;
|
||||||
|
color: var(--el-text-color-regular);
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
Reference in New Issue
Block a user