设备管理和用户管理相关功能页面

This commit is contained in:
zhouyanli
2026-10-30 14:16:09 +08:00
parent febbb83dad
commit 87089fd310
30 changed files with 5429 additions and 233 deletions

111
src/api/appUser/index.ts Normal file
View File

@@ -0,0 +1,111 @@
import type { AppUserBindingVO, AppUserForm, AppUserQuery, AppUserVO } from '@/api/appUser/types';
import type { PageResult } from '@/api/types';
import type { AxiosPromise } from '@/utils/api-types';
import request from '@/utils/request';
/**
* 查询小程序用户列表
* @param query
* @returns {*}
*/
export const listAppUser = (query?: AppUserQuery): AxiosPromise<PageResult<AppUserVO>> => {
return request({
url: '/userManage/appUser/list',
method: 'get',
params: query
});
};
/**
* 查询小程序用户详细
* @param userId
*/
export const getAppUser = (userId: string | number): AxiosPromise<AppUserVO> => {
return request({
url: '/userManage/appUser/' + userId,
method: 'get'
});
};
/**
* 查询小程序用户详情(头部概要信息)
* @param userId
*/
export const getAppUserDetail = (userId: string | number): AxiosPromise<AppUserVO> => {
return request({
url: '/userManage/appUser/detail/' + userId,
method: 'get'
});
};
/**
* 查询用户已绑定的设备列表
* @param userId
*/
export const getAppUserBindings = (userId: string | number): AxiosPromise<PageResult<AppUserBindingVO>> => {
return request({
url: '/userManage/appUser/bindings/' + userId,
method: 'get'
});
};
/**
* 查询用户可绑定的设备列表
* @param userId
*/
export const getBindableDevices = (userId: string | number): AxiosPromise<AppUserBindingVO[]> => {
return request({
url: '/userManage/appUser/bindableDevices/' + userId,
method: 'get'
});
};
/**
* 绑定用户设备
* @param userId
* @param deviceIds
*/
export const bindAppUserDevices = (userId: string | number, deviceIds: Array<string | number>) => {
return request({
url: '/userManage/appUser/bindings/' + userId,
method: 'post',
data: { deviceIds }
});
};
/**
* 新增小程序用户
* @param data
*/
export const addAppUser = (data: AppUserForm) => {
return request({
url: '/userManage/appUser',
method: 'post',
data: data
});
};
/**
* 修改小程序用户
* @param data
*/
export const updateAppUser = (data: AppUserForm) => {
return request({
url: '/userManage/appUser',
method: 'put',
data: data
});
};
/**
* 删除小程序用户
* @param userId
*/
export const delAppUser = (userId: string | number | Array<string | number>) => {
return request({
url: '/userManage/appUser/' + userId,
method: 'delete'
});
};

310
src/api/appUser/types.ts Normal file
View File

@@ -0,0 +1,310 @@
export interface AppUserVO {
/**
* 小程序用户ID
*/
userId: string | number;
/**
* 用户类型(0租客 1房东)
*/
userType: string;
/**
* 手机号
*/
phoneNumber: string;
/**
* 登录密码哈希
*/
passwordHash: string;
/**
* 昵称
*/
nickName: string;
/**
* 实名姓名
*/
realName: string;
/**
* 头像地址
*/
avatarUrl: string;
/**
* 微信OpenID
*/
wxOpenId: string | number;
/**
* 微信UnionID
*/
wxUnionId: string | number;
/**
* 状态(0正常 1停用)
*/
status: string;
/**
* 最后登录时间
*/
lastLoginTime: string;
/**
* 最后登录IP
*/
lastLoginIp: string;
/**
* 房间号(列表展示,后端未返回时前端显示占位)
*/
roomNo?: string;
/**
* 注册时间(详情页展示)
*/
createTime?: string;
/**
* 房间名称(列表展示用)
*/
roomName?: string;
/**
* 最近缴费时间(列表展示,后端未返回时前端显示占位)
*/
lastRechargeTime?: string;
}
/**
* 用户绑定 / 缴费 / 抄表 / 清零记录(后端 /userManage/appUser/bindings/{userId} 返回的行结构)
*/
export interface AppUserBindingVO {
/**
* 记录ID
*/
id: string | number;
/**
* 设备ID
*/
deviceId: string | number;
/**
* 设备名称
*/
deviceName?: string;
/**
* 设备编号
*/
deviceNo?: string;
/**
* 设备类型(0:电表,1:水表)
*/
deviceType?: string;
/**
* 计量单位(0:度,1:吨)
*/
unitName?: string;
/**
* 剩余金额
*/
remainingBalance?: number;
/**
* 当前剩余量
*/
currentQuantity?: number;
/**
* 当前单价
*/
currentUnitPrice?: number;
/**
* 控制状态(0正常,1强制拉闸,2欠费拉闸,3离线)
*/
switchStatus?: string;
/**
* 绑定状态
*/
bindingStatus?: string;
/**
* 绑定时间
*/
boundAt?: string;
/**
* 解绑时间(历史设备用)
*/
unboundAt?: string;
/**
* 订单号(支付记录用)
*/
orderNo?: string;
/**
* 能源类型
*/
energyType?: string;
/**
* 支付方式
*/
paymentMethod?: string;
/**
* 订单状态
*/
orderStatus?: string;
/**
* 充值金额
*/
rechargeAmount?: number;
/**
* 实付金额
*/
actualPaymentAmount?: number;
/**
* 支付时间
*/
paidAt?: string;
/**
* 上次读数
*/
previousReadingValue?: number;
/**
* 本次读数
*/
readingValue?: number;
/**
* 本期用量
*/
usageQuantity?: number;
/**
* 抄表时间
*/
readingTime?: string;
/**
* 清零前读数
*/
beforeReadingValue?: number;
/**
* 清零后读数
*/
afterReadingValue?: number;
/**
* 清零时间
*/
resetTime?: string;
/**
* 备注
*/
remark?: string;
/**
* 房间号
*/
roomNo?: string;
}
export interface AppUserForm extends BaseEntity {
/**
* 小程序用户ID
*/
userId?: string | number;
/**
* 用户类型(0租客 1房东)
*/
userType?: string;
/**
* 手机号
*/
phoneNumber?: string;
/**
* 登录密码哈希
*/
passwordHash?: string;
/**
* 昵称
*/
nickName?: string;
/**
* 实名姓名
*/
realName?: string;
/**
* 头像地址
*/
avatarUrl?: string;
/**
* 微信OpenID
*/
wxOpenId?: string | number;
/**
* 微信UnionID
*/
wxUnionId?: string | number;
/**
* 状态(0正常 1停用)
*/
status?: string;
/**
* 最后登录时间
*/
lastLoginTime?: string;
/**
* 最后登录IP
*/
lastLoginIp?: string;
/**
* 注册时间
*/
createTime?: string;
/**
* 更新时间
*/
updateTime?: string;
}
export interface AppUserQuery extends PageQuery {
/**
* 用户列表关键字(手机号、昵称或姓名)
*/
keyword?: string;
/**
* 用户类型(0租客 1房东)
*/
userType?: string;
/**
* 手机号
*/
phoneNumber?: string;
/**
* 登录密码哈希
*/
passwordHash?: string;
/**
* 昵称
*/
nickName?: string;
/**
* 实名姓名
*/
realName?: string;
/**
* 头像地址
*/
avatarUrl?: string;
/**
* 微信OpenID
*/
wxOpenId?: string | number;
/**
* 微信UnionID
*/
wxUnionId?: string | number;
/**
* 状态(0正常 1停用)
*/
status?: string;
/**
* 最后登录时间
*/
lastLoginTime?: string;
/**
* 最后登录IP
*/
lastLoginIp?: string;
/**
* 注册时间
*/
createTime?: string;
/**
* 更新时间
*/
updateTime?: string;
/**
* 日期范围参数
*/
params?: any;
}

View File

@@ -0,0 +1,123 @@
import type { DeviceForm, DeviceQuery, DeviceVO } from '@/api/deviceManage/device/types';
import type { PageResult } from '@/api/types';
import type { AxiosPromise } from '@/utils/api-types';
import request from '@/utils/request';
/**
* 查询智能水电设备列表
* @param query
* @returns {*}
*/
export const listDevice = (query?: DeviceQuery): AxiosPromise<PageResult<DeviceVO>> => {
return request({
url: '/deviceManage/device/list',
method: 'get',
params: query
});
};
/**
* 查询智能水电设备详细
* @param deviceId
*/
export const getDevice = (deviceId: string | number): AxiosPromise<DeviceVO> => {
return request({
url: '/deviceManage/device/' + deviceId,
method: 'get'
});
};
/**
* 新增智能水电设备
* @param data
*/
export const addDevice = (data: DeviceForm) => {
return request({
url: '/deviceManage/device',
method: 'post',
data: data
});
};
/**
* 修改智能水电设备
* @param data
*/
export const updateDevice = (data: DeviceForm) => {
return request({
url: '/deviceManage/device',
method: 'put',
data: data
});
};
/**
* 批量导入设备(multipart 上传 Excel)
* @param file 导入文件
*/
export const importDeviceData = (file: File) => {
const formData = new FormData();
formData.append('file', file);
return request({
url: '/deviceManage/device/importData',
method: 'post',
data: formData
});
};
/**
* 设备拉闸(强制断电)
* @param deviceId
*/
export const forceOffDevice = (deviceId: string | number) => {
return request({
url: '/deviceManage/device/' + deviceId + '/forceOff',
method: 'post'
});
};
/**
* 设备恢复供电(拉闸后合闸)
* @param deviceId
*/
export const restoreDevice = (deviceId: string | number) => {
return request({
url: '/deviceManage/device/' + deviceId + '/restore',
method: 'post'
});
};
/**
* 设备抄表(下发抄表指令,返回本次读表结果)
* @param deviceId
*/
export const readDevice = (deviceId: string | number) => {
return request({
url: '/deviceManage/device/' + deviceId + '/read',
method: 'post'
});
};
/**
* 设备清零(总用量、剩余用量、剩余金额归零)
* @param deviceId
*/
export const resetDevice = (deviceId: string | number) => {
return request({
url: '/deviceManage/device/' + deviceId + '/reset',
method: 'post'
});
};
/**
* 删除智能水电设备
* @param deviceId
*/
export const delDevice = (deviceId: string | number | Array<string | number>) => {
return request({
url: '/deviceManage/device/' + deviceId,
method: 'delete'
});
};

View File

@@ -0,0 +1,336 @@
export interface DeviceVO {
/**
* 设备ID
*/
deviceId: string | number;
/**
* 所属商户ID
*/
merchantId: string | number;
/**
* 所属商户名称(列表展示用)
*/
merchantName?: string;
/**
* 当前房间ID
*/
roomId: string | number;
/**
* 房间名称(详情页展示,后端未返回时前端回退)
*/
roomName?: string;
/**
* 绑定房东(详情页展示)
*/
landlordName?: string;
/**
* 安装位置(详情页展示)
*/
installAddress?: string;
/**
* 安装位置(后端详情接口返回字段,详情页优先展示)
*/
installLocation?: string;
/**
* 累计用量(详情页展示)
*/
totalQuantity?: number;
/**
* 最近充值时间(详情页展示)
*/
lastRechargeTime?: string;
/**
* 欠费金额(欠费拉闸时展示)
*/
arrearsAmount?: number;
/**
* 欠费天数(欠费拉闸时展示,后端未返回时前端不再兜底计算)
*/
arrearsDays?: number;
/**
* 设备编号
*/
deviceNo: string;
/**
* 设备名称
*/
deviceName: string;
/**
* 设备类型(0:电表,1:水表)
*/
deviceType: string;
/**
* 通讯类型
*/
communicationType: string;
/**
* 计量单位(0:度,1:吨)
*/
unitName: string;
/**
* 设备二维码内容
*/
qrCode: string;
/**
* 剩余金额
*/
remainingBalance: number;
/**
* 当前剩余量或电量
*/
currentQuantity: number;
/**
* 本次抄表读数(抄表弹窗展示)
*/
currentReadingValue?: number;
/**
* 上次抄表读数(抄表弹窗展示)
*/
previousReadingValue?: number;
/**
* 本期用量(抄表弹窗展示,由后端计算返回)
*/
usageQuantity?: number;
/**
* 当前功率
*/
currentPower: number;
/**
* 当前单价
*/
currentUnitPrice: number;
/**
* 控制状态(0正常,1强制拉闸,2欠费拉闸,3离线)
*/
switchStatus: string;
/**
* 在线状态(0离线 1在线)
*/
onlineStatus: boolean;
/**
* 最后在线时间
*/
lastOnlineTime: string;
/**
* 离线时长(后端已格式化,如「2小时30分钟」,离线时展示)
*/
offlineDuration?: string;
/**
* 最后抄表时间
*/
lastReadingTime: string;
/**
* 安装时间
*/
installedAt: string;
/**
* 设备状态(0正常 1禁用 2已删除)
*/
status: boolean;
/**
* 备注
*/
remark: string;
}
export interface DeviceForm extends BaseEntity {
/**
* 设备ID
*/
deviceId?: string | number;
/**
* 所属商户ID
*/
merchantId?: string | number;
/**
* 所属商户名称(列表展示用)
*/
merchantName?: string;
/**
* 当前房间ID
*/
roomId?: string | number;
/**
* 设备编号
*/
deviceNo?: string;
/**
* 设备名称
*/
deviceName?: string;
/**
* 设备类型(0:电表,1:水表)
*/
deviceType?: string;
/**
* 通讯类型
*/
communicationType?: string;
/**
* 计量单位(0:度,1:吨)
*/
unitName?: string;
/**
* 设备二维码内容
*/
qrCode?: string;
/**
* 剩余金额
*/
remainingBalance?: number;
/**
* 当前剩余量或电量
*/
currentQuantity?: number;
/**
* 当前功率
*/
currentPower?: number;
/**
* 当前单价
*/
currentUnitPrice?: number;
/**
* 控制状态(0正常,1强制拉闸,2欠费拉闸,3离线)
*/
switchStatus?: string;
/**
* 在线状态(0离线 1在线)
*/
onlineStatus?: boolean;
/**
* 最后在线时间
*/
lastOnlineTime?: string;
/**
* 最后抄表时间
*/
lastReadingTime?: string;
/**
* 安装时间
*/
installedAt?: string;
/**
* 设备状态(0正常 1禁用 2已删除)
*/
status?: boolean;
/**
* 备注
*/
remark?: string;
/**
* 创建后台账号ID
*/
createBy?: number;
/**
* 创建时间
*/
createTime?: string;
/**
* 更新后台账号ID
*/
updateBy?: number;
/**
* 更新时间
*/
updateTime?: string;
}
export interface DeviceQuery extends PageQuery {
/**
* 所属商户ID
*/
merchantId?: string | number;
/**
* 所属商户名称(列表展示用)
*/
merchantName?: string;
/**
* 当前房间ID
*/
roomId?: string | number;
/**
* 设备编号
*/
deviceNo?: string;
/**
* 设备名称
*/
deviceName?: string;
/**
* 设备类型(0:电表,1:水表)
*/
deviceType?: string;
/**
* 通讯类型
*/
communicationType?: string;
/**
* 计量单位(0:度,1:吨)
*/
unitName?: string;
/**
* 设备二维码内容
*/
qrCode?: string;
/**
* 剩余金额
*/
remainingBalance?: number;
/**
* 当前剩余量或电量
*/
currentQuantity?: number;
/**
* 当前功率
*/
currentPower?: number;
/**
* 当前单价
*/
currentUnitPrice?: number;
/**
* 控制状态(0正常,1强制拉闸,2欠费拉闸,3离线)
*/
switchStatus?: string;
/**
* 在线状态(0离线 1在线)
*/
onlineStatus?: boolean;
/**
* 最后在线时间
*/
lastOnlineTime?: string;
/**
* 最后抄表时间
*/
lastReadingTime?: string;
/**
* 安装时间
*/
installedAt?: string;
/**
* 设备状态(0正常 1禁用 2已删除)
*/
status?: boolean;
/**
* 创建后台账号ID
*/
createBy?: number;
/**
* 创建时间
*/
createTime?: string;
/**
* 更新后台账号ID
*/
updateBy?: number;
/**
* 更新时间
*/
updateTime?: string;
/**
* 日期范围参数
*/
params?: any;
}

View File

@@ -0,0 +1,148 @@
/* 用户详情页各页签共用的列表 / 卡片样式。
在组件 <style scoped> 内 @use 后 @include,样式仍然只作用于当前组件。 */
/* 行式列表:支付记录、历史设备 */
@mixin record-list {
.record-list {
display: flex;
flex-direction: column;
}
.record-date {
margin: 22px 0 12px;
font-size: 15px;
color: var(--el-text-color-regular);
.record-group:first-child & {
margin-top: 0;
}
}
.record-row {
display: flex;
align-items: flex-start;
justify-content: space-between;
gap: 16px;
padding: 14px 18px;
border: 1px solid var(--app-surface-border);
border-radius: 8px;
& + & {
margin-top: 14px;
}
}
.record-title {
font-size: 14px;
color: var(--el-text-color-primary);
}
.record-sub {
margin-top: 8px;
font-size: 13px;
color: var(--el-text-color-regular);
}
.record-side {
flex: 0 0 auto;
text-align: right;
}
.record-amount {
margin-top: 8px;
font-size: 14px;
color: var(--el-text-color-primary);
}
}
/* 支付状态文案配色 */
@mixin record-status {
.record-status {
font-size: 13px;
&.is-success {
color: var(--el-color-success);
}
&.is-failed {
color: var(--el-color-danger);
}
}
}
/* 卡片式列表:抄表记录、清零记录 */
@mixin record-card-list {
.card-list {
display: flex;
flex-direction: column;
gap: 16px;
}
.record-card {
padding: 18px 20px;
border: 1px solid var(--app-surface-border);
border-radius: 8px;
}
.card-room {
font-size: 14px;
color: var(--el-text-color-primary);
}
.card-meta {
margin-top: 6px;
font-size: 13px;
color: var(--el-text-color-regular);
}
.card-metrics {
display: flex;
justify-content: space-between;
gap: 16px;
margin-top: 26px;
/* 首列左侧、末列右侧各留出间距 */
padding: 0 66px;
}
.metric-block {
display: flex;
flex-direction: column;
gap: 8px;
min-width: 0;
}
.card-metrics .metric-label {
font-size: 13px;
font-weight: 700;
color: var(--el-text-color-primary);
}
.card-metrics .metric-value {
font-size: 16px;
font-weight: 600;
color: var(--el-text-color-primary);
&.is-highlight {
color: var(--el-color-primary);
}
}
.card-time {
margin-top: 20px;
font-size: 13px;
text-align: right;
color: var(--el-text-color-regular);
}
}
/* 历史设备的「已解绑」标签 */
@mixin unbound-tag {
.unbound-tag {
display: inline-block;
padding: 2px 10px;
font-size: 12px;
color: var(--el-text-color-secondary);
border: 1px solid var(--app-surface-border);
border-radius: 999px;
}
}

View File

@@ -7,3 +7,8 @@
color: var(--app-accent-strong); color: var(--app-accent-strong);
} }
} }
/* 弹窗提示保留换行:modal.confirm 文案里可用 \n 分行 */
.el-message-box__message {
white-space: pre-line;
}

View File

@@ -82,6 +82,36 @@ export const constantRoutes: RouteRecordRaw[] = [
meta: { title: '个人中心', icon: 'user' } meta: { title: '个人中心', icon: 'user' }
} }
] ]
},
{
// 设备详情:从设备列表跳转,不进侧边栏
path: '/device',
component: Layout,
hidden: true,
redirect: 'noredirect',
children: [
{
path: 'deviceDetail',
component: () => import('@/views/biz/device/detail.vue'),
name: 'DeviceDetail',
meta: { title: '设备详情', activeMenu: '/device/devicelist', noCache: true }
}
]
},
{
// 用户详情:从用户列表跳转,不进侧边栏
path: '/appUser',
component: Layout,
hidden: true,
redirect: 'noredirect',
children: [
{
path: 'detail',
component: () => import('@/views/biz/appUser/detail.vue'),
name: 'AppUserDetail',
meta: { title: '用户详情', activeMenu: '/userManage/appUser', noCache: true }
}
]
} }
]; ];

641
src/types/auto-imports.d.ts vendored Normal file
View File

@@ -0,0 +1,641 @@
/* eslint-disable */
/* prettier-ignore */
/* oxlint-disable */
/* oxfmt-ignore */
// @ts-nocheck
// noinspection JSUnusedGlobalSymbols
// Generated by unplugin-auto-import
// biome-ignore lint: disable
export {}
declare global {
const EffectScope: typeof import('vue').EffectScope
const ElLoading: typeof import('element-plus/es').ElLoading
const ElMessage: typeof import('element-plus/es').ElMessage
const ElMessageBox: typeof import('element-plus/es').ElMessageBox
const ElNotification: typeof import('element-plus/es').ElNotification
const acceptHMRUpdate: typeof import('pinia').acceptHMRUpdate
const asyncComputed: typeof import('@vueuse/core').asyncComputed
const autoResetRef: typeof import('@vueuse/core').autoResetRef
const computed: typeof import('vue').computed
const computedAsync: typeof import('@vueuse/core').computedAsync
const computedEager: typeof import('@vueuse/core').computedEager
const computedInject: typeof import('@vueuse/core').computedInject
const computedWithControl: typeof import('@vueuse/core').computedWithControl
const controlledComputed: typeof import('@vueuse/core').controlledComputed
const controlledRef: typeof import('@vueuse/core').controlledRef
const createApp: typeof import('vue').createApp
const createDisposableDirective: typeof import('@vueuse/core').createDisposableDirective
const createEventHook: typeof import('@vueuse/core').createEventHook
const createGlobalState: typeof import('@vueuse/core').createGlobalState
const createInjectionState: typeof import('@vueuse/core').createInjectionState
const createPinia: typeof import('pinia').createPinia
const createReactiveFn: typeof import('@vueuse/core').createReactiveFn
const createRef: typeof import('@vueuse/core').createRef
const createReusableTemplate: typeof import('@vueuse/core').createReusableTemplate
const createSharedComposable: typeof import('@vueuse/core').createSharedComposable
const createTemplatePromise: typeof import('@vueuse/core').createTemplatePromise
const createUnrefFn: typeof import('@vueuse/core').createUnrefFn
const customRef: typeof import('vue').customRef
const debouncedRef: typeof import('@vueuse/core').debouncedRef
const debouncedWatch: typeof import('@vueuse/core').debouncedWatch
const defineAsyncComponent: typeof import('vue').defineAsyncComponent
const defineComponent: typeof import('vue').defineComponent
const defineStore: typeof import('pinia').defineStore
const eagerComputed: typeof import('@vueuse/core').eagerComputed
const effectScope: typeof import('vue').effectScope
const extendRef: typeof import('@vueuse/core').extendRef
const getActivePinia: typeof import('pinia').getActivePinia
const getCurrentInstance: typeof import('vue').getCurrentInstance
const getCurrentScope: typeof import('vue').getCurrentScope
const getCurrentWatcher: typeof import('vue').getCurrentWatcher
const h: typeof import('vue').h
const ignorableWatch: typeof import('@vueuse/core').ignorableWatch
const inject: typeof import('vue').inject
const injectLocal: typeof import('@vueuse/core').injectLocal
const isDefined: typeof import('@vueuse/core').isDefined
const isProxy: typeof import('vue').isProxy
const isReactive: typeof import('vue').isReactive
const isReadonly: typeof import('vue').isReadonly
const isRef: typeof import('vue').isRef
const isShallow: typeof import('vue').isShallow
const makeDestructurable: typeof import('@vueuse/core').makeDestructurable
const mapActions: typeof import('pinia').mapActions
const mapGetters: typeof import('pinia').mapGetters
const mapState: typeof import('pinia').mapState
const mapStores: typeof import('pinia').mapStores
const mapWritableState: typeof import('pinia').mapWritableState
const markRaw: typeof import('vue').markRaw
const nextTick: typeof import('vue').nextTick
const onActivated: typeof import('vue').onActivated
const onBeforeMount: typeof import('vue').onBeforeMount
const onBeforeRouteLeave: typeof import('vue-router').onBeforeRouteLeave
const onBeforeRouteUpdate: typeof import('vue-router').onBeforeRouteUpdate
const onBeforeUnmount: typeof import('vue').onBeforeUnmount
const onBeforeUpdate: typeof import('vue').onBeforeUpdate
const onClickOutside: typeof import('@vueuse/core').onClickOutside
const onDeactivated: typeof import('vue').onDeactivated
const onElementRemoval: typeof import('@vueuse/core').onElementRemoval
const onErrorCaptured: typeof import('vue').onErrorCaptured
const onKeyStroke: typeof import('@vueuse/core').onKeyStroke
const onLongPress: typeof import('@vueuse/core').onLongPress
const onMounted: typeof import('vue').onMounted
const onRenderTracked: typeof import('vue').onRenderTracked
const onRenderTriggered: typeof import('vue').onRenderTriggered
const onScopeDispose: typeof import('vue').onScopeDispose
const onServerPrefetch: typeof import('vue').onServerPrefetch
const onStartTyping: typeof import('@vueuse/core').onStartTyping
const onUnmounted: typeof import('vue').onUnmounted
const onUpdated: typeof import('vue').onUpdated
const onWatcherCleanup: typeof import('vue').onWatcherCleanup
const pausableWatch: typeof import('@vueuse/core').pausableWatch
const provide: typeof import('vue').provide
const provideLocal: typeof import('@vueuse/core').provideLocal
const reactify: typeof import('@vueuse/core').reactify
const reactifyObject: typeof import('@vueuse/core').reactifyObject
const reactive: typeof import('vue').reactive
const reactiveComputed: typeof import('@vueuse/core').reactiveComputed
const reactiveOmit: typeof import('@vueuse/core').reactiveOmit
const reactivePick: typeof import('@vueuse/core').reactivePick
const readonly: typeof import('vue').readonly
const ref: typeof import('vue').ref
const refAutoReset: typeof import('@vueuse/core').refAutoReset
const refDebounced: typeof import('@vueuse/core').refDebounced
const refDefault: typeof import('@vueuse/core').refDefault
const refManualReset: typeof import('@vueuse/core').refManualReset
const refThrottled: typeof import('@vueuse/core').refThrottled
const refWithControl: typeof import('@vueuse/core').refWithControl
const resolveComponent: typeof import('vue').resolveComponent
const setActivePinia: typeof import('pinia').setActivePinia
const setMapStoreSuffix: typeof import('pinia').setMapStoreSuffix
const shallowReactive: typeof import('vue').shallowReactive
const shallowReadonly: typeof import('vue').shallowReadonly
const shallowRef: typeof import('vue').shallowRef
const storeToRefs: typeof import('pinia').storeToRefs
const syncRef: typeof import('@vueuse/core').syncRef
const syncRefs: typeof import('@vueuse/core').syncRefs
const templateRef: typeof import('@vueuse/core').templateRef
const throttledRef: typeof import('@vueuse/core').throttledRef
const throttledWatch: typeof import('@vueuse/core').throttledWatch
const toRaw: typeof import('vue').toRaw
const toReactive: typeof import('@vueuse/core').toReactive
const toRef: typeof import('vue').toRef
const toRefs: typeof import('vue').toRefs
const toValue: typeof import('vue').toValue
const triggerRef: typeof import('vue').triggerRef
const tryOnBeforeMount: typeof import('@vueuse/core').tryOnBeforeMount
const tryOnBeforeUnmount: typeof import('@vueuse/core').tryOnBeforeUnmount
const tryOnMounted: typeof import('@vueuse/core').tryOnMounted
const tryOnScopeDispose: typeof import('@vueuse/core').tryOnScopeDispose
const tryOnUnmounted: typeof import('@vueuse/core').tryOnUnmounted
const unref: typeof import('vue').unref
const unrefElement: typeof import('@vueuse/core').unrefElement
const until: typeof import('@vueuse/core').until
const useActiveElement: typeof import('@vueuse/core').useActiveElement
const useAnimate: typeof import('@vueuse/core').useAnimate
const useArrayDifference: typeof import('@vueuse/core').useArrayDifference
const useArrayEvery: typeof import('@vueuse/core').useArrayEvery
const useArrayFilter: typeof import('@vueuse/core').useArrayFilter
const useArrayFind: typeof import('@vueuse/core').useArrayFind
const useArrayFindIndex: typeof import('@vueuse/core').useArrayFindIndex
const useArrayFindLast: typeof import('@vueuse/core').useArrayFindLast
const useArrayIncludes: typeof import('@vueuse/core').useArrayIncludes
const useArrayJoin: typeof import('@vueuse/core').useArrayJoin
const useArrayMap: typeof import('@vueuse/core').useArrayMap
const useArrayReduce: typeof import('@vueuse/core').useArrayReduce
const useArraySome: typeof import('@vueuse/core').useArraySome
const useArrayUnique: typeof import('@vueuse/core').useArrayUnique
const useAsyncQueue: typeof import('@vueuse/core').useAsyncQueue
const useAsyncState: typeof import('@vueuse/core').useAsyncState
const useAttrs: typeof import('vue').useAttrs
const useBase64: typeof import('@vueuse/core').useBase64
const useBattery: typeof import('@vueuse/core').useBattery
const useBluetooth: typeof import('@vueuse/core').useBluetooth
const useBreakpoints: typeof import('@vueuse/core').useBreakpoints
const useBroadcastChannel: typeof import('@vueuse/core').useBroadcastChannel
const useBrowserLocation: typeof import('@vueuse/core').useBrowserLocation
const useCached: typeof import('@vueuse/core').useCached
const useClipboard: typeof import('@vueuse/core').useClipboard
const useClipboardItems: typeof import('@vueuse/core').useClipboardItems
const useCloned: typeof import('@vueuse/core').useCloned
const useColorMode: typeof import('@vueuse/core').useColorMode
const useConfirmDialog: typeof import('@vueuse/core').useConfirmDialog
const useCountdown: typeof import('@vueuse/core').useCountdown
const useCounter: typeof import('@vueuse/core').useCounter
const useCssModule: typeof import('vue').useCssModule
const useCssSupports: typeof import('@vueuse/core').useCssSupports
const useCssVar: typeof import('@vueuse/core').useCssVar
const useCssVars: typeof import('vue').useCssVars
const useCurrentElement: typeof import('@vueuse/core').useCurrentElement
const useCycleList: typeof import('@vueuse/core').useCycleList
const useDark: typeof import('@vueuse/core').useDark
const useDateFormat: typeof import('@vueuse/core').useDateFormat
const useDebounce: typeof import('@vueuse/core').useDebounce
const useDebounceFn: typeof import('@vueuse/core').useDebounceFn
const useDebouncedRefHistory: typeof import('@vueuse/core').useDebouncedRefHistory
const useDeviceMotion: typeof import('@vueuse/core').useDeviceMotion
const useDeviceOrientation: typeof import('@vueuse/core').useDeviceOrientation
const useDevicePixelRatio: typeof import('@vueuse/core').useDevicePixelRatio
const useDevicesList: typeof import('@vueuse/core').useDevicesList
const useDisplayMedia: typeof import('@vueuse/core').useDisplayMedia
const useDocumentVisibility: typeof import('@vueuse/core').useDocumentVisibility
const useDraggable: typeof import('@vueuse/core').useDraggable
const useDropZone: typeof import('@vueuse/core').useDropZone
const useElementBounding: typeof import('@vueuse/core').useElementBounding
const useElementByPoint: typeof import('@vueuse/core').useElementByPoint
const useElementHover: typeof import('@vueuse/core').useElementHover
const useElementOverflow: typeof import('@vueuse/core').useElementOverflow
const useElementSize: typeof import('@vueuse/core').useElementSize
const useElementVisibility: typeof import('@vueuse/core').useElementVisibility
const useEventBus: typeof import('@vueuse/core').useEventBus
const useEventListener: typeof import('@vueuse/core').useEventListener
const useEventSource: typeof import('@vueuse/core').useEventSource
const useEyeDropper: typeof import('@vueuse/core').useEyeDropper
const useFavicon: typeof import('@vueuse/core').useFavicon
const useFetch: typeof import('@vueuse/core').useFetch
const useFileDialog: typeof import('@vueuse/core').useFileDialog
const useFileSystemAccess: typeof import('@vueuse/core').useFileSystemAccess
const useFocus: typeof import('@vueuse/core').useFocus
const useFocusWithin: typeof import('@vueuse/core').useFocusWithin
const useFps: typeof import('@vueuse/core').useFps
const useFullscreen: typeof import('@vueuse/core').useFullscreen
const useGamepad: typeof import('@vueuse/core').useGamepad
const useGeolocation: typeof import('@vueuse/core').useGeolocation
const useId: typeof import('vue').useId
const useIdle: typeof import('@vueuse/core').useIdle
const useImage: typeof import('@vueuse/core').useImage
const useInfiniteScroll: typeof import('@vueuse/core').useInfiniteScroll
const useIntersectionObserver: typeof import('@vueuse/core').useIntersectionObserver
const useInterval: typeof import('@vueuse/core').useInterval
const useIntervalFn: typeof import('@vueuse/core').useIntervalFn
const useKeyModifier: typeof import('@vueuse/core').useKeyModifier
const useLastChanged: typeof import('@vueuse/core').useLastChanged
const useLink: typeof import('vue-router').useLink
const useLocalStorage: typeof import('@vueuse/core').useLocalStorage
const useMagicKeys: typeof import('@vueuse/core').useMagicKeys
const useManualRefHistory: typeof import('@vueuse/core').useManualRefHistory
const useMediaControls: typeof import('@vueuse/core').useMediaControls
const useMediaQuery: typeof import('@vueuse/core').useMediaQuery
const useMemoize: typeof import('@vueuse/core').useMemoize
const useMemory: typeof import('@vueuse/core').useMemory
const useModel: typeof import('vue').useModel
const useMounted: typeof import('@vueuse/core').useMounted
const useMouse: typeof import('@vueuse/core').useMouse
const useMouseInElement: typeof import('@vueuse/core').useMouseInElement
const useMousePressed: typeof import('@vueuse/core').useMousePressed
const useMutationObserver: typeof import('@vueuse/core').useMutationObserver
const useNavigatorLanguage: typeof import('@vueuse/core').useNavigatorLanguage
const useNetwork: typeof import('@vueuse/core').useNetwork
const useNow: typeof import('@vueuse/core').useNow
const useObjectUrl: typeof import('@vueuse/core').useObjectUrl
const useOffsetPagination: typeof import('@vueuse/core').useOffsetPagination
const useOnline: typeof import('@vueuse/core').useOnline
const usePageLeave: typeof import('@vueuse/core').usePageLeave
const useParallax: typeof import('@vueuse/core').useParallax
const useParentElement: typeof import('@vueuse/core').useParentElement
const usePerformanceObserver: typeof import('@vueuse/core').usePerformanceObserver
const usePermission: typeof import('@vueuse/core').usePermission
const usePointer: typeof import('@vueuse/core').usePointer
const usePointerLock: typeof import('@vueuse/core').usePointerLock
const usePointerSwipe: typeof import('@vueuse/core').usePointerSwipe
const usePreferredColorScheme: typeof import('@vueuse/core').usePreferredColorScheme
const usePreferredContrast: typeof import('@vueuse/core').usePreferredContrast
const usePreferredDark: typeof import('@vueuse/core').usePreferredDark
const usePreferredLanguages: typeof import('@vueuse/core').usePreferredLanguages
const usePreferredReducedMotion: typeof import('@vueuse/core').usePreferredReducedMotion
const usePreferredReducedTransparency: typeof import('@vueuse/core').usePreferredReducedTransparency
const usePrevious: typeof import('@vueuse/core').usePrevious
const useRafFn: typeof import('@vueuse/core').useRafFn
const useRefHistory: typeof import('@vueuse/core').useRefHistory
const useResizeObserver: typeof import('@vueuse/core').useResizeObserver
const useRoute: typeof import('vue-router').useRoute
const useRouter: typeof import('vue-router').useRouter
const useSSRWidth: typeof import('@vueuse/core').useSSRWidth
const useScreenOrientation: typeof import('@vueuse/core').useScreenOrientation
const useScreenSafeArea: typeof import('@vueuse/core').useScreenSafeArea
const useScriptTag: typeof import('@vueuse/core').useScriptTag
const useScroll: typeof import('@vueuse/core').useScroll
const useScrollLock: typeof import('@vueuse/core').useScrollLock
const useSessionStorage: typeof import('@vueuse/core').useSessionStorage
const useShare: typeof import('@vueuse/core').useShare
const useSlots: typeof import('vue').useSlots
const useSorted: typeof import('@vueuse/core').useSorted
const useSpeechRecognition: typeof import('@vueuse/core').useSpeechRecognition
const useSpeechSynthesis: typeof import('@vueuse/core').useSpeechSynthesis
const useStepper: typeof import('@vueuse/core').useStepper
const useStorage: typeof import('@vueuse/core').useStorage
const useStorageAsync: typeof import('@vueuse/core').useStorageAsync
const useStyleTag: typeof import('@vueuse/core').useStyleTag
const useSupported: typeof import('@vueuse/core').useSupported
const useSwipe: typeof import('@vueuse/core').useSwipe
const useTemplateRef: typeof import('vue').useTemplateRef
const useTemplateRefsList: typeof import('@vueuse/core').useTemplateRefsList
const useTextDirection: typeof import('@vueuse/core').useTextDirection
const useTextSelection: typeof import('@vueuse/core').useTextSelection
const useTextareaAutosize: typeof import('@vueuse/core').useTextareaAutosize
const useThrottle: typeof import('@vueuse/core').useThrottle
const useThrottleFn: typeof import('@vueuse/core').useThrottleFn
const useThrottledRefHistory: typeof import('@vueuse/core').useThrottledRefHistory
const useTimeAgo: typeof import('@vueuse/core').useTimeAgo
const useTimeAgoIntl: typeof import('@vueuse/core').useTimeAgoIntl
const useTimeout: typeof import('@vueuse/core').useTimeout
const useTimeoutFn: typeof import('@vueuse/core').useTimeoutFn
const useTimeoutPoll: typeof import('@vueuse/core').useTimeoutPoll
const useTimestamp: typeof import('@vueuse/core').useTimestamp
const useTitle: typeof import('@vueuse/core').useTitle
const useToNumber: typeof import('@vueuse/core').useToNumber
const useToString: typeof import('@vueuse/core').useToString
const useToggle: typeof import('@vueuse/core').useToggle
const useTransition: typeof import('@vueuse/core').useTransition
const useUrlSearchParams: typeof import('@vueuse/core').useUrlSearchParams
const useUserMedia: typeof import('@vueuse/core').useUserMedia
const useVModel: typeof import('@vueuse/core').useVModel
const useVModels: typeof import('@vueuse/core').useVModels
const useVibrate: typeof import('@vueuse/core').useVibrate
const useVirtualList: typeof import('@vueuse/core').useVirtualList
const useWakeLock: typeof import('@vueuse/core').useWakeLock
const useWebNotification: typeof import('@vueuse/core').useWebNotification
const useWebSocket: typeof import('@vueuse/core').useWebSocket
const useWebWorker: typeof import('@vueuse/core').useWebWorker
const useWebWorkerFn: typeof import('@vueuse/core').useWebWorkerFn
const useWindowFocus: typeof import('@vueuse/core').useWindowFocus
const useWindowScroll: typeof import('@vueuse/core').useWindowScroll
const useWindowSize: typeof import('@vueuse/core').useWindowSize
const watch: typeof import('vue').watch
const watchArray: typeof import('@vueuse/core').watchArray
const watchAtMost: typeof import('@vueuse/core').watchAtMost
const watchDebounced: typeof import('@vueuse/core').watchDebounced
const watchDeep: typeof import('@vueuse/core').watchDeep
const watchEffect: typeof import('vue').watchEffect
const watchIgnorable: typeof import('@vueuse/core').watchIgnorable
const watchImmediate: typeof import('@vueuse/core').watchImmediate
const watchOnce: typeof import('@vueuse/core').watchOnce
const watchPausable: typeof import('@vueuse/core').watchPausable
const watchPostEffect: typeof import('vue').watchPostEffect
const watchSyncEffect: typeof import('vue').watchSyncEffect
const watchThrottled: typeof import('@vueuse/core').watchThrottled
const watchTriggerable: typeof import('@vueuse/core').watchTriggerable
const watchWithFilter: typeof import('@vueuse/core').watchWithFilter
const whenever: typeof import('@vueuse/core').whenever
}
// for type re-export
declare global {
// @ts-ignore
export type { Component, Slot, Slots, ComponentPublicInstance, ComputedRef, DirectiveBinding, ExtractDefaultPropTypes, ExtractPropTypes, ExtractPublicPropTypes, InjectionKey, PropType, Ref, ShallowRef, MaybeRef, MaybeRefOrGetter, VNode, WritableComputedRef } from 'vue'
import('vue')
}
// for vue template auto import
import { UnwrapRef } from 'vue'
declare module 'vue' {
interface GlobalComponents {}
interface ComponentCustomProperties {
readonly EffectScope: UnwrapRef<typeof import('vue')['EffectScope']>
readonly ElLoading: UnwrapRef<typeof import('element-plus/es')['ElLoading']>
readonly ElMessage: UnwrapRef<typeof import('element-plus/es')['ElMessage']>
readonly ElMessageBox: UnwrapRef<typeof import('element-plus/es')['ElMessageBox']>
readonly ElNotification: UnwrapRef<typeof import('element-plus/es')['ElNotification']>
readonly acceptHMRUpdate: UnwrapRef<typeof import('pinia')['acceptHMRUpdate']>
readonly asyncComputed: UnwrapRef<typeof import('@vueuse/core')['asyncComputed']>
readonly autoResetRef: UnwrapRef<typeof import('@vueuse/core')['autoResetRef']>
readonly computed: UnwrapRef<typeof import('vue')['computed']>
readonly computedAsync: UnwrapRef<typeof import('@vueuse/core')['computedAsync']>
readonly computedEager: UnwrapRef<typeof import('@vueuse/core')['computedEager']>
readonly computedInject: UnwrapRef<typeof import('@vueuse/core')['computedInject']>
readonly computedWithControl: UnwrapRef<typeof import('@vueuse/core')['computedWithControl']>
readonly controlledComputed: UnwrapRef<typeof import('@vueuse/core')['controlledComputed']>
readonly controlledRef: UnwrapRef<typeof import('@vueuse/core')['controlledRef']>
readonly createApp: UnwrapRef<typeof import('vue')['createApp']>
readonly createDisposableDirective: UnwrapRef<typeof import('@vueuse/core')['createDisposableDirective']>
readonly createEventHook: UnwrapRef<typeof import('@vueuse/core')['createEventHook']>
readonly createGlobalState: UnwrapRef<typeof import('@vueuse/core')['createGlobalState']>
readonly createInjectionState: UnwrapRef<typeof import('@vueuse/core')['createInjectionState']>
readonly createPinia: UnwrapRef<typeof import('pinia')['createPinia']>
readonly createReactiveFn: UnwrapRef<typeof import('@vueuse/core')['createReactiveFn']>
readonly createRef: UnwrapRef<typeof import('@vueuse/core')['createRef']>
readonly createReusableTemplate: UnwrapRef<typeof import('@vueuse/core')['createReusableTemplate']>
readonly createSharedComposable: UnwrapRef<typeof import('@vueuse/core')['createSharedComposable']>
readonly createTemplatePromise: UnwrapRef<typeof import('@vueuse/core')['createTemplatePromise']>
readonly createUnrefFn: UnwrapRef<typeof import('@vueuse/core')['createUnrefFn']>
readonly customRef: UnwrapRef<typeof import('vue')['customRef']>
readonly debouncedRef: UnwrapRef<typeof import('@vueuse/core')['debouncedRef']>
readonly debouncedWatch: UnwrapRef<typeof import('@vueuse/core')['debouncedWatch']>
readonly defineAsyncComponent: UnwrapRef<typeof import('vue')['defineAsyncComponent']>
readonly defineComponent: UnwrapRef<typeof import('vue')['defineComponent']>
readonly defineStore: UnwrapRef<typeof import('pinia')['defineStore']>
readonly eagerComputed: UnwrapRef<typeof import('@vueuse/core')['eagerComputed']>
readonly effectScope: UnwrapRef<typeof import('vue')['effectScope']>
readonly extendRef: UnwrapRef<typeof import('@vueuse/core')['extendRef']>
readonly getActivePinia: UnwrapRef<typeof import('pinia')['getActivePinia']>
readonly getCurrentInstance: UnwrapRef<typeof import('vue')['getCurrentInstance']>
readonly getCurrentScope: UnwrapRef<typeof import('vue')['getCurrentScope']>
readonly getCurrentWatcher: UnwrapRef<typeof import('vue')['getCurrentWatcher']>
readonly h: UnwrapRef<typeof import('vue')['h']>
readonly ignorableWatch: UnwrapRef<typeof import('@vueuse/core')['ignorableWatch']>
readonly inject: UnwrapRef<typeof import('vue')['inject']>
readonly injectLocal: UnwrapRef<typeof import('@vueuse/core')['injectLocal']>
readonly isDefined: UnwrapRef<typeof import('@vueuse/core')['isDefined']>
readonly isProxy: UnwrapRef<typeof import('vue')['isProxy']>
readonly isReactive: UnwrapRef<typeof import('vue')['isReactive']>
readonly isReadonly: UnwrapRef<typeof import('vue')['isReadonly']>
readonly isRef: UnwrapRef<typeof import('vue')['isRef']>
readonly isShallow: UnwrapRef<typeof import('vue')['isShallow']>
readonly makeDestructurable: UnwrapRef<typeof import('@vueuse/core')['makeDestructurable']>
readonly mapActions: UnwrapRef<typeof import('pinia')['mapActions']>
readonly mapGetters: UnwrapRef<typeof import('pinia')['mapGetters']>
readonly mapState: UnwrapRef<typeof import('pinia')['mapState']>
readonly mapStores: UnwrapRef<typeof import('pinia')['mapStores']>
readonly mapWritableState: UnwrapRef<typeof import('pinia')['mapWritableState']>
readonly markRaw: UnwrapRef<typeof import('vue')['markRaw']>
readonly nextTick: UnwrapRef<typeof import('vue')['nextTick']>
readonly onActivated: UnwrapRef<typeof import('vue')['onActivated']>
readonly onBeforeMount: UnwrapRef<typeof import('vue')['onBeforeMount']>
readonly onBeforeRouteLeave: UnwrapRef<typeof import('vue-router')['onBeforeRouteLeave']>
readonly onBeforeRouteUpdate: UnwrapRef<typeof import('vue-router')['onBeforeRouteUpdate']>
readonly onBeforeUnmount: UnwrapRef<typeof import('vue')['onBeforeUnmount']>
readonly onBeforeUpdate: UnwrapRef<typeof import('vue')['onBeforeUpdate']>
readonly onClickOutside: UnwrapRef<typeof import('@vueuse/core')['onClickOutside']>
readonly onDeactivated: UnwrapRef<typeof import('vue')['onDeactivated']>
readonly onElementRemoval: UnwrapRef<typeof import('@vueuse/core')['onElementRemoval']>
readonly onErrorCaptured: UnwrapRef<typeof import('vue')['onErrorCaptured']>
readonly onKeyStroke: UnwrapRef<typeof import('@vueuse/core')['onKeyStroke']>
readonly onLongPress: UnwrapRef<typeof import('@vueuse/core')['onLongPress']>
readonly onMounted: UnwrapRef<typeof import('vue')['onMounted']>
readonly onRenderTracked: UnwrapRef<typeof import('vue')['onRenderTracked']>
readonly onRenderTriggered: UnwrapRef<typeof import('vue')['onRenderTriggered']>
readonly onScopeDispose: UnwrapRef<typeof import('vue')['onScopeDispose']>
readonly onServerPrefetch: UnwrapRef<typeof import('vue')['onServerPrefetch']>
readonly onStartTyping: UnwrapRef<typeof import('@vueuse/core')['onStartTyping']>
readonly onUnmounted: UnwrapRef<typeof import('vue')['onUnmounted']>
readonly onUpdated: UnwrapRef<typeof import('vue')['onUpdated']>
readonly onWatcherCleanup: UnwrapRef<typeof import('vue')['onWatcherCleanup']>
readonly pausableWatch: UnwrapRef<typeof import('@vueuse/core')['pausableWatch']>
readonly provide: UnwrapRef<typeof import('vue')['provide']>
readonly provideLocal: UnwrapRef<typeof import('@vueuse/core')['provideLocal']>
readonly reactify: UnwrapRef<typeof import('@vueuse/core')['reactify']>
readonly reactifyObject: UnwrapRef<typeof import('@vueuse/core')['reactifyObject']>
readonly reactive: UnwrapRef<typeof import('vue')['reactive']>
readonly reactiveComputed: UnwrapRef<typeof import('@vueuse/core')['reactiveComputed']>
readonly reactiveOmit: UnwrapRef<typeof import('@vueuse/core')['reactiveOmit']>
readonly reactivePick: UnwrapRef<typeof import('@vueuse/core')['reactivePick']>
readonly readonly: UnwrapRef<typeof import('vue')['readonly']>
readonly ref: UnwrapRef<typeof import('vue')['ref']>
readonly refAutoReset: UnwrapRef<typeof import('@vueuse/core')['refAutoReset']>
readonly refDebounced: UnwrapRef<typeof import('@vueuse/core')['refDebounced']>
readonly refDefault: UnwrapRef<typeof import('@vueuse/core')['refDefault']>
readonly refManualReset: UnwrapRef<typeof import('@vueuse/core')['refManualReset']>
readonly refThrottled: UnwrapRef<typeof import('@vueuse/core')['refThrottled']>
readonly refWithControl: UnwrapRef<typeof import('@vueuse/core')['refWithControl']>
readonly resolveComponent: UnwrapRef<typeof import('vue')['resolveComponent']>
readonly setActivePinia: UnwrapRef<typeof import('pinia')['setActivePinia']>
readonly setMapStoreSuffix: UnwrapRef<typeof import('pinia')['setMapStoreSuffix']>
readonly shallowReactive: UnwrapRef<typeof import('vue')['shallowReactive']>
readonly shallowReadonly: UnwrapRef<typeof import('vue')['shallowReadonly']>
readonly shallowRef: UnwrapRef<typeof import('vue')['shallowRef']>
readonly storeToRefs: UnwrapRef<typeof import('pinia')['storeToRefs']>
readonly syncRef: UnwrapRef<typeof import('@vueuse/core')['syncRef']>
readonly syncRefs: UnwrapRef<typeof import('@vueuse/core')['syncRefs']>
readonly templateRef: UnwrapRef<typeof import('@vueuse/core')['templateRef']>
readonly throttledRef: UnwrapRef<typeof import('@vueuse/core')['throttledRef']>
readonly throttledWatch: UnwrapRef<typeof import('@vueuse/core')['throttledWatch']>
readonly toRaw: UnwrapRef<typeof import('vue')['toRaw']>
readonly toReactive: UnwrapRef<typeof import('@vueuse/core')['toReactive']>
readonly toRef: UnwrapRef<typeof import('vue')['toRef']>
readonly toRefs: UnwrapRef<typeof import('vue')['toRefs']>
readonly toValue: UnwrapRef<typeof import('vue')['toValue']>
readonly triggerRef: UnwrapRef<typeof import('vue')['triggerRef']>
readonly tryOnBeforeMount: UnwrapRef<typeof import('@vueuse/core')['tryOnBeforeMount']>
readonly tryOnBeforeUnmount: UnwrapRef<typeof import('@vueuse/core')['tryOnBeforeUnmount']>
readonly tryOnMounted: UnwrapRef<typeof import('@vueuse/core')['tryOnMounted']>
readonly tryOnScopeDispose: UnwrapRef<typeof import('@vueuse/core')['tryOnScopeDispose']>
readonly tryOnUnmounted: UnwrapRef<typeof import('@vueuse/core')['tryOnUnmounted']>
readonly unref: UnwrapRef<typeof import('vue')['unref']>
readonly unrefElement: UnwrapRef<typeof import('@vueuse/core')['unrefElement']>
readonly until: UnwrapRef<typeof import('@vueuse/core')['until']>
readonly useActiveElement: UnwrapRef<typeof import('@vueuse/core')['useActiveElement']>
readonly useAnimate: UnwrapRef<typeof import('@vueuse/core')['useAnimate']>
readonly useArrayDifference: UnwrapRef<typeof import('@vueuse/core')['useArrayDifference']>
readonly useArrayEvery: UnwrapRef<typeof import('@vueuse/core')['useArrayEvery']>
readonly useArrayFilter: UnwrapRef<typeof import('@vueuse/core')['useArrayFilter']>
readonly useArrayFind: UnwrapRef<typeof import('@vueuse/core')['useArrayFind']>
readonly useArrayFindIndex: UnwrapRef<typeof import('@vueuse/core')['useArrayFindIndex']>
readonly useArrayFindLast: UnwrapRef<typeof import('@vueuse/core')['useArrayFindLast']>
readonly useArrayIncludes: UnwrapRef<typeof import('@vueuse/core')['useArrayIncludes']>
readonly useArrayJoin: UnwrapRef<typeof import('@vueuse/core')['useArrayJoin']>
readonly useArrayMap: UnwrapRef<typeof import('@vueuse/core')['useArrayMap']>
readonly useArrayReduce: UnwrapRef<typeof import('@vueuse/core')['useArrayReduce']>
readonly useArraySome: UnwrapRef<typeof import('@vueuse/core')['useArraySome']>
readonly useArrayUnique: UnwrapRef<typeof import('@vueuse/core')['useArrayUnique']>
readonly useAsyncQueue: UnwrapRef<typeof import('@vueuse/core')['useAsyncQueue']>
readonly useAsyncState: UnwrapRef<typeof import('@vueuse/core')['useAsyncState']>
readonly useAttrs: UnwrapRef<typeof import('vue')['useAttrs']>
readonly useBase64: UnwrapRef<typeof import('@vueuse/core')['useBase64']>
readonly useBattery: UnwrapRef<typeof import('@vueuse/core')['useBattery']>
readonly useBluetooth: UnwrapRef<typeof import('@vueuse/core')['useBluetooth']>
readonly useBreakpoints: UnwrapRef<typeof import('@vueuse/core')['useBreakpoints']>
readonly useBroadcastChannel: UnwrapRef<typeof import('@vueuse/core')['useBroadcastChannel']>
readonly useBrowserLocation: UnwrapRef<typeof import('@vueuse/core')['useBrowserLocation']>
readonly useCached: UnwrapRef<typeof import('@vueuse/core')['useCached']>
readonly useClipboard: UnwrapRef<typeof import('@vueuse/core')['useClipboard']>
readonly useClipboardItems: UnwrapRef<typeof import('@vueuse/core')['useClipboardItems']>
readonly useCloned: UnwrapRef<typeof import('@vueuse/core')['useCloned']>
readonly useColorMode: UnwrapRef<typeof import('@vueuse/core')['useColorMode']>
readonly useConfirmDialog: UnwrapRef<typeof import('@vueuse/core')['useConfirmDialog']>
readonly useCountdown: UnwrapRef<typeof import('@vueuse/core')['useCountdown']>
readonly useCounter: UnwrapRef<typeof import('@vueuse/core')['useCounter']>
readonly useCssModule: UnwrapRef<typeof import('vue')['useCssModule']>
readonly useCssSupports: UnwrapRef<typeof import('@vueuse/core')['useCssSupports']>
readonly useCssVar: UnwrapRef<typeof import('@vueuse/core')['useCssVar']>
readonly useCssVars: UnwrapRef<typeof import('vue')['useCssVars']>
readonly useCurrentElement: UnwrapRef<typeof import('@vueuse/core')['useCurrentElement']>
readonly useCycleList: UnwrapRef<typeof import('@vueuse/core')['useCycleList']>
readonly useDark: UnwrapRef<typeof import('@vueuse/core')['useDark']>
readonly useDateFormat: UnwrapRef<typeof import('@vueuse/core')['useDateFormat']>
readonly useDebounce: UnwrapRef<typeof import('@vueuse/core')['useDebounce']>
readonly useDebounceFn: UnwrapRef<typeof import('@vueuse/core')['useDebounceFn']>
readonly useDebouncedRefHistory: UnwrapRef<typeof import('@vueuse/core')['useDebouncedRefHistory']>
readonly useDeviceMotion: UnwrapRef<typeof import('@vueuse/core')['useDeviceMotion']>
readonly useDeviceOrientation: UnwrapRef<typeof import('@vueuse/core')['useDeviceOrientation']>
readonly useDevicePixelRatio: UnwrapRef<typeof import('@vueuse/core')['useDevicePixelRatio']>
readonly useDevicesList: UnwrapRef<typeof import('@vueuse/core')['useDevicesList']>
readonly useDisplayMedia: UnwrapRef<typeof import('@vueuse/core')['useDisplayMedia']>
readonly useDocumentVisibility: UnwrapRef<typeof import('@vueuse/core')['useDocumentVisibility']>
readonly useDraggable: UnwrapRef<typeof import('@vueuse/core')['useDraggable']>
readonly useDropZone: UnwrapRef<typeof import('@vueuse/core')['useDropZone']>
readonly useElementBounding: UnwrapRef<typeof import('@vueuse/core')['useElementBounding']>
readonly useElementByPoint: UnwrapRef<typeof import('@vueuse/core')['useElementByPoint']>
readonly useElementHover: UnwrapRef<typeof import('@vueuse/core')['useElementHover']>
readonly useElementOverflow: UnwrapRef<typeof import('@vueuse/core')['useElementOverflow']>
readonly useElementSize: UnwrapRef<typeof import('@vueuse/core')['useElementSize']>
readonly useElementVisibility: UnwrapRef<typeof import('@vueuse/core')['useElementVisibility']>
readonly useEventBus: UnwrapRef<typeof import('@vueuse/core')['useEventBus']>
readonly useEventListener: UnwrapRef<typeof import('@vueuse/core')['useEventListener']>
readonly useEventSource: UnwrapRef<typeof import('@vueuse/core')['useEventSource']>
readonly useEyeDropper: UnwrapRef<typeof import('@vueuse/core')['useEyeDropper']>
readonly useFavicon: UnwrapRef<typeof import('@vueuse/core')['useFavicon']>
readonly useFetch: UnwrapRef<typeof import('@vueuse/core')['useFetch']>
readonly useFileDialog: UnwrapRef<typeof import('@vueuse/core')['useFileDialog']>
readonly useFileSystemAccess: UnwrapRef<typeof import('@vueuse/core')['useFileSystemAccess']>
readonly useFocus: UnwrapRef<typeof import('@vueuse/core')['useFocus']>
readonly useFocusWithin: UnwrapRef<typeof import('@vueuse/core')['useFocusWithin']>
readonly useFps: UnwrapRef<typeof import('@vueuse/core')['useFps']>
readonly useFullscreen: UnwrapRef<typeof import('@vueuse/core')['useFullscreen']>
readonly useGamepad: UnwrapRef<typeof import('@vueuse/core')['useGamepad']>
readonly useGeolocation: UnwrapRef<typeof import('@vueuse/core')['useGeolocation']>
readonly useId: UnwrapRef<typeof import('vue')['useId']>
readonly useIdle: UnwrapRef<typeof import('@vueuse/core')['useIdle']>
readonly useImage: UnwrapRef<typeof import('@vueuse/core')['useImage']>
readonly useInfiniteScroll: UnwrapRef<typeof import('@vueuse/core')['useInfiniteScroll']>
readonly useIntersectionObserver: UnwrapRef<typeof import('@vueuse/core')['useIntersectionObserver']>
readonly useInterval: UnwrapRef<typeof import('@vueuse/core')['useInterval']>
readonly useIntervalFn: UnwrapRef<typeof import('@vueuse/core')['useIntervalFn']>
readonly useKeyModifier: UnwrapRef<typeof import('@vueuse/core')['useKeyModifier']>
readonly useLastChanged: UnwrapRef<typeof import('@vueuse/core')['useLastChanged']>
readonly useLink: UnwrapRef<typeof import('vue-router')['useLink']>
readonly useLocalStorage: UnwrapRef<typeof import('@vueuse/core')['useLocalStorage']>
readonly useMagicKeys: UnwrapRef<typeof import('@vueuse/core')['useMagicKeys']>
readonly useManualRefHistory: UnwrapRef<typeof import('@vueuse/core')['useManualRefHistory']>
readonly useMediaControls: UnwrapRef<typeof import('@vueuse/core')['useMediaControls']>
readonly useMediaQuery: UnwrapRef<typeof import('@vueuse/core')['useMediaQuery']>
readonly useMemoize: UnwrapRef<typeof import('@vueuse/core')['useMemoize']>
readonly useMemory: UnwrapRef<typeof import('@vueuse/core')['useMemory']>
readonly useModel: UnwrapRef<typeof import('vue')['useModel']>
readonly useMounted: UnwrapRef<typeof import('@vueuse/core')['useMounted']>
readonly useMouse: UnwrapRef<typeof import('@vueuse/core')['useMouse']>
readonly useMouseInElement: UnwrapRef<typeof import('@vueuse/core')['useMouseInElement']>
readonly useMousePressed: UnwrapRef<typeof import('@vueuse/core')['useMousePressed']>
readonly useMutationObserver: UnwrapRef<typeof import('@vueuse/core')['useMutationObserver']>
readonly useNavigatorLanguage: UnwrapRef<typeof import('@vueuse/core')['useNavigatorLanguage']>
readonly useNetwork: UnwrapRef<typeof import('@vueuse/core')['useNetwork']>
readonly useNow: UnwrapRef<typeof import('@vueuse/core')['useNow']>
readonly useObjectUrl: UnwrapRef<typeof import('@vueuse/core')['useObjectUrl']>
readonly useOffsetPagination: UnwrapRef<typeof import('@vueuse/core')['useOffsetPagination']>
readonly useOnline: UnwrapRef<typeof import('@vueuse/core')['useOnline']>
readonly usePageLeave: UnwrapRef<typeof import('@vueuse/core')['usePageLeave']>
readonly useParallax: UnwrapRef<typeof import('@vueuse/core')['useParallax']>
readonly useParentElement: UnwrapRef<typeof import('@vueuse/core')['useParentElement']>
readonly usePerformanceObserver: UnwrapRef<typeof import('@vueuse/core')['usePerformanceObserver']>
readonly usePermission: UnwrapRef<typeof import('@vueuse/core')['usePermission']>
readonly usePointer: UnwrapRef<typeof import('@vueuse/core')['usePointer']>
readonly usePointerLock: UnwrapRef<typeof import('@vueuse/core')['usePointerLock']>
readonly usePointerSwipe: UnwrapRef<typeof import('@vueuse/core')['usePointerSwipe']>
readonly usePreferredColorScheme: UnwrapRef<typeof import('@vueuse/core')['usePreferredColorScheme']>
readonly usePreferredContrast: UnwrapRef<typeof import('@vueuse/core')['usePreferredContrast']>
readonly usePreferredDark: UnwrapRef<typeof import('@vueuse/core')['usePreferredDark']>
readonly usePreferredLanguages: UnwrapRef<typeof import('@vueuse/core')['usePreferredLanguages']>
readonly usePreferredReducedMotion: UnwrapRef<typeof import('@vueuse/core')['usePreferredReducedMotion']>
readonly usePreferredReducedTransparency: UnwrapRef<typeof import('@vueuse/core')['usePreferredReducedTransparency']>
readonly usePrevious: UnwrapRef<typeof import('@vueuse/core')['usePrevious']>
readonly useRafFn: UnwrapRef<typeof import('@vueuse/core')['useRafFn']>
readonly useRefHistory: UnwrapRef<typeof import('@vueuse/core')['useRefHistory']>
readonly useResizeObserver: UnwrapRef<typeof import('@vueuse/core')['useResizeObserver']>
readonly useRoute: UnwrapRef<typeof import('vue-router')['useRoute']>
readonly useRouter: UnwrapRef<typeof import('vue-router')['useRouter']>
readonly useSSRWidth: UnwrapRef<typeof import('@vueuse/core')['useSSRWidth']>
readonly useScreenOrientation: UnwrapRef<typeof import('@vueuse/core')['useScreenOrientation']>
readonly useScreenSafeArea: UnwrapRef<typeof import('@vueuse/core')['useScreenSafeArea']>
readonly useScriptTag: UnwrapRef<typeof import('@vueuse/core')['useScriptTag']>
readonly useScroll: UnwrapRef<typeof import('@vueuse/core')['useScroll']>
readonly useScrollLock: UnwrapRef<typeof import('@vueuse/core')['useScrollLock']>
readonly useSessionStorage: UnwrapRef<typeof import('@vueuse/core')['useSessionStorage']>
readonly useShare: UnwrapRef<typeof import('@vueuse/core')['useShare']>
readonly useSlots: UnwrapRef<typeof import('vue')['useSlots']>
readonly useSorted: UnwrapRef<typeof import('@vueuse/core')['useSorted']>
readonly useSpeechRecognition: UnwrapRef<typeof import('@vueuse/core')['useSpeechRecognition']>
readonly useSpeechSynthesis: UnwrapRef<typeof import('@vueuse/core')['useSpeechSynthesis']>
readonly useStepper: UnwrapRef<typeof import('@vueuse/core')['useStepper']>
readonly useStorage: UnwrapRef<typeof import('@vueuse/core')['useStorage']>
readonly useStorageAsync: UnwrapRef<typeof import('@vueuse/core')['useStorageAsync']>
readonly useStyleTag: UnwrapRef<typeof import('@vueuse/core')['useStyleTag']>
readonly useSupported: UnwrapRef<typeof import('@vueuse/core')['useSupported']>
readonly useSwipe: UnwrapRef<typeof import('@vueuse/core')['useSwipe']>
readonly useTemplateRef: UnwrapRef<typeof import('vue')['useTemplateRef']>
readonly useTemplateRefsList: UnwrapRef<typeof import('@vueuse/core')['useTemplateRefsList']>
readonly useTextDirection: UnwrapRef<typeof import('@vueuse/core')['useTextDirection']>
readonly useTextSelection: UnwrapRef<typeof import('@vueuse/core')['useTextSelection']>
readonly useTextareaAutosize: UnwrapRef<typeof import('@vueuse/core')['useTextareaAutosize']>
readonly useThrottle: UnwrapRef<typeof import('@vueuse/core')['useThrottle']>
readonly useThrottleFn: UnwrapRef<typeof import('@vueuse/core')['useThrottleFn']>
readonly useThrottledRefHistory: UnwrapRef<typeof import('@vueuse/core')['useThrottledRefHistory']>
readonly useTimeAgo: UnwrapRef<typeof import('@vueuse/core')['useTimeAgo']>
readonly useTimeAgoIntl: UnwrapRef<typeof import('@vueuse/core')['useTimeAgoIntl']>
readonly useTimeout: UnwrapRef<typeof import('@vueuse/core')['useTimeout']>
readonly useTimeoutFn: UnwrapRef<typeof import('@vueuse/core')['useTimeoutFn']>
readonly useTimeoutPoll: UnwrapRef<typeof import('@vueuse/core')['useTimeoutPoll']>
readonly useTimestamp: UnwrapRef<typeof import('@vueuse/core')['useTimestamp']>
readonly useTitle: UnwrapRef<typeof import('@vueuse/core')['useTitle']>
readonly useToNumber: UnwrapRef<typeof import('@vueuse/core')['useToNumber']>
readonly useToString: UnwrapRef<typeof import('@vueuse/core')['useToString']>
readonly useToggle: UnwrapRef<typeof import('@vueuse/core')['useToggle']>
readonly useTransition: UnwrapRef<typeof import('@vueuse/core')['useTransition']>
readonly useUrlSearchParams: UnwrapRef<typeof import('@vueuse/core')['useUrlSearchParams']>
readonly useUserMedia: UnwrapRef<typeof import('@vueuse/core')['useUserMedia']>
readonly useVModel: UnwrapRef<typeof import('@vueuse/core')['useVModel']>
readonly useVModels: UnwrapRef<typeof import('@vueuse/core')['useVModels']>
readonly useVibrate: UnwrapRef<typeof import('@vueuse/core')['useVibrate']>
readonly useVirtualList: UnwrapRef<typeof import('@vueuse/core')['useVirtualList']>
readonly useWakeLock: UnwrapRef<typeof import('@vueuse/core')['useWakeLock']>
readonly useWebNotification: UnwrapRef<typeof import('@vueuse/core')['useWebNotification']>
readonly useWebSocket: UnwrapRef<typeof import('@vueuse/core')['useWebSocket']>
readonly useWebWorker: UnwrapRef<typeof import('@vueuse/core')['useWebWorker']>
readonly useWebWorkerFn: UnwrapRef<typeof import('@vueuse/core')['useWebWorkerFn']>
readonly useWindowFocus: UnwrapRef<typeof import('@vueuse/core')['useWindowFocus']>
readonly useWindowScroll: UnwrapRef<typeof import('@vueuse/core')['useWindowScroll']>
readonly useWindowSize: UnwrapRef<typeof import('@vueuse/core')['useWindowSize']>
readonly watch: UnwrapRef<typeof import('vue')['watch']>
readonly watchArray: UnwrapRef<typeof import('@vueuse/core')['watchArray']>
readonly watchAtMost: UnwrapRef<typeof import('@vueuse/core')['watchAtMost']>
readonly watchDebounced: UnwrapRef<typeof import('@vueuse/core')['watchDebounced']>
readonly watchDeep: UnwrapRef<typeof import('@vueuse/core')['watchDeep']>
readonly watchEffect: UnwrapRef<typeof import('vue')['watchEffect']>
readonly watchIgnorable: UnwrapRef<typeof import('@vueuse/core')['watchIgnorable']>
readonly watchImmediate: UnwrapRef<typeof import('@vueuse/core')['watchImmediate']>
readonly watchOnce: UnwrapRef<typeof import('@vueuse/core')['watchOnce']>
readonly watchPausable: UnwrapRef<typeof import('@vueuse/core')['watchPausable']>
readonly watchPostEffect: UnwrapRef<typeof import('vue')['watchPostEffect']>
readonly watchSyncEffect: UnwrapRef<typeof import('vue')['watchSyncEffect']>
readonly watchThrottled: UnwrapRef<typeof import('@vueuse/core')['watchThrottled']>
readonly watchTriggerable: UnwrapRef<typeof import('@vueuse/core')['watchTriggerable']>
readonly watchWithFilter: UnwrapRef<typeof import('@vueuse/core')['watchWithFilter']>
readonly whenever: UnwrapRef<typeof import('@vueuse/core')['whenever']>
}
}

102
src/types/components.d.ts vendored Normal file
View File

@@ -0,0 +1,102 @@
/* eslint-disable */
// @ts-nocheck
// biome-ignore lint: disable
// oxlint-disable
// ------
// Generated by unplugin-vue-components
// Read more: https://github.com/vuejs/core/pull/3399
export {}
/* prettier-ignore */
declare module 'vue' {
export interface GlobalComponents {
ApprovalButton: typeof import('./../components/Process/approvalButton.vue')['default']
ApprovalRecord: typeof import('./../components/Process/approvalRecord.vue')['default']
Breadcrumb: typeof import('./../components/Breadcrumb/index.vue')['default']
DictTag: typeof import('./../components/DictTag/index.vue')['default']
Editor: typeof import('./../components/Editor/index.vue')['default']
ElAvatar: typeof import('element-plus/es')['ElAvatar']
ElBadge: typeof import('element-plus/es')['ElBadge']
ElBreadcrumb: typeof import('element-plus/es')['ElBreadcrumb']
ElBreadcrumbItem: typeof import('element-plus/es')['ElBreadcrumbItem']
ElButton: typeof import('element-plus/es')['ElButton']
ElCard: typeof import('element-plus/es')['ElCard']
ElCheckbox: typeof import('element-plus/es')['ElCheckbox']
ElCheckboxGroup: typeof import('element-plus/es')['ElCheckboxGroup']
ElCol: typeof import('element-plus/es')['ElCol']
ElColorPicker: typeof import('element-plus/es')['ElColorPicker']
ElConfigProvider: typeof import('element-plus/es')['ElConfigProvider']
ElDatePicker: typeof import('element-plus/es')['ElDatePicker']
ElDescriptions: typeof import('element-plus/es')['ElDescriptions']
ElDescriptionsItem: typeof import('element-plus/es')['ElDescriptionsItem']
ElDialog: typeof import('element-plus/es')['ElDialog']
ElDivider: typeof import('element-plus/es')['ElDivider']
ElDrawer: typeof import('element-plus/es')['ElDrawer']
ElDropdown: typeof import('element-plus/es')['ElDropdown']
ElDropdownItem: typeof import('element-plus/es')['ElDropdownItem']
ElDropdownMenu: typeof import('element-plus/es')['ElDropdownMenu']
ElEmpty: typeof import('element-plus/es')['ElEmpty']
ElForm: typeof import('element-plus/es')['ElForm']
ElFormItem: typeof import('element-plus/es')['ElFormItem']
ElIcon: typeof import('element-plus/es')['ElIcon']
ElImage: typeof import('element-plus/es')['ElImage']
ElInput: typeof import('element-plus/es')['ElInput']
ElInputNumber: typeof import('element-plus/es')['ElInputNumber']
ElLink: typeof import('element-plus/es')['ElLink']
ElMenu: typeof import('element-plus/es')['ElMenu']
ElMenuItem: typeof import('element-plus/es')['ElMenuItem']
ElOption: typeof import('element-plus/es')['ElOption']
ElPagination: typeof import('element-plus/es')['ElPagination']
ElPopover: typeof import('element-plus/es')['ElPopover']
ElRadio: typeof import('element-plus/es')['ElRadio']
ElRadioGroup: typeof import('element-plus/es')['ElRadioGroup']
ElRow: typeof import('element-plus/es')['ElRow']
ElScrollbar: typeof import('element-plus/es')['ElScrollbar']
ElSelect: typeof import('element-plus/es')['ElSelect']
ElSlider: typeof import('element-plus/es')['ElSlider']
ElSubMenu: typeof import('element-plus/es')['ElSubMenu']
ElSwitch: typeof import('element-plus/es')['ElSwitch']
ElTable: typeof import('element-plus/es')['ElTable']
ElTableColumn: typeof import('element-plus/es')['ElTableColumn']
ElTabPane: typeof import('element-plus/es')['ElTabPane']
ElTabs: typeof import('element-plus/es')['ElTabs']
ElTag: typeof import('element-plus/es')['ElTag']
ElText: typeof import('element-plus/es')['ElText']
ElTooltip: typeof import('element-plus/es')['ElTooltip']
ElTree: typeof import('element-plus/es')['ElTree']
ElTreeSelect: typeof import('element-plus/es')['ElTreeSelect']
ElTreeV2: typeof import('element-plus/es')['ElTreeV2']
ElUpload: typeof import('element-plus/es')['ElUpload']
FileUpload: typeof import('./../components/FileUpload/index.vue')['default']
FlowChart: typeof import('./../components/Process/flowChart.vue')['default']
FlowChartImg: typeof import('./../components/Process/flowChartImg.vue')['default']
Hamburger: typeof import('./../components/Hamburger/index.vue')['default']
IconSelect: typeof import('./../components/IconSelect/index.vue')['default']
IFrame: typeof import('./../components/iFrame/index.vue')['default']
ImagePreview: typeof import('./../components/ImagePreview/index.vue')['default']
ImageUpload: typeof import('./../components/ImageUpload/index.vue')['default']
LangSelect: typeof import('./../components/LangSelect/index.vue')['default']
MessageType: typeof import('./../components/Process/MessageType.vue')['default']
Pagination: typeof import('./../components/Pagination/index.vue')['default']
ParentView: typeof import('./../components/ParentView/index.vue')['default']
ProcessMeddle: typeof import('./../components/Process/processMeddle.vue')['default']
RightToolbar: typeof import('./../components/RightToolbar/index.vue')['default']
RoleSelect: typeof import('./../components/RoleSelect/index.vue')['default']
RouterLink: typeof import('vue-router')['RouterLink']
RouterView: typeof import('vue-router')['RouterView']
RuoYiDoc: typeof import('./../components/RuoYiDoc/index.vue')['default']
RuoYiGit: typeof import('./../components/RuoYiGit/index.vue')['default']
Screenfull: typeof import('./../components/Screenfull/index.vue')['default']
SizeSelect: typeof import('./../components/SizeSelect/index.vue')['default']
SubmitVerify: typeof import('./../components/Process/submitVerify.vue')['default']
SvgIcon: typeof import('./../components/SvgIcon/index.vue')['default']
TopNav: typeof import('./../components/TopNav/index.vue')['default']
TreePanel: typeof import('./../components/TreePanel/index.vue')['default']
UserNameDisplay: typeof import('./../components/Process/UserNameDisplay.vue')['default']
UserSelect: typeof import('./../components/UserSelect/index.vue')['default']
}
export interface GlobalDirectives {
vLoading: typeof import('element-plus/es')['ElLoadingDirective']
}
}

View File

@@ -0,0 +1,237 @@
<template>
<el-dialog v-model="open" title="绑定设备" width="440px" append-to-body class="bind-device-dialog">
<el-input v-model="keyword" class="bind-search" placeholder="请输入设备编号/名称搜索" clearable>
<template #prefix><el-icon><Search /></el-icon></template>
</el-input>
<div v-loading="loading" class="bind-list">
<div
v-for="device in filteredDevices"
:key="String(device.deviceId)"
class="bind-row"
:class="{ 'is-selected': isSelected(device) }"
@click="selectDevice(device)"
>
<el-radio
:model-value="selectedDeviceId"
:value="String(device.deviceId)"
class="bind-radio"
@click.stop
@change="selectDevice(device)"
/>
<span class="bind-icon">
<el-icon :size="16"><component :is="deviceIcon(device)" /></el-icon>
</span>
<div class="bind-info">
<div class="bind-room">{{ device.roomNo || '—' }}</div>
<div class="bind-meta">{{ deviceTypeText(device) }}·{{ device.deviceNo || '—' }}</div>
</div>
<!-- 接口只返回可绑定设备,列表内均为未绑定 -->
<span class="bind-tag">未绑定</span>
</div>
<el-empty v-if="!loading && !filteredDevices.length" description="暂无可绑定设备" :image-size="72" />
</div>
<template #footer>
<div class="bind-footer">
<el-button @click="open = false">取 消</el-button>
<el-button type="primary" :loading="submitting" :disabled="!selectedDeviceId" @click="handleConfirm">确定绑定</el-button>
</div>
</template>
</el-dialog>
</template>
<script setup name="BindDeviceDialog" lang="ts">
import { bindAppUserDevices, getBindableDevices } from '@/api/appUser';
import { AppUserBindingVO } from '@/api/appUser/types';
import { useLoading } from '@/hooks/async/useLoading';
import modal from '@/plugins/modal';
import { getDeviceTypeLabel, useDeviceTypeDict } from '../../device/constants';
const emit = defineEmits<{
success: [];
}>();
const open = ref(false);
const keyword = ref('');
/** 当前查看的用户ID,打开弹窗时由父组件传入 */
const userId = ref<string | number>('');
const deviceList = ref<AppUserBindingVO[]>([]);
/** 单选的设备ID */
const selectedDeviceId = ref('');
const submitting = ref(false);
const { loading, withLoading } = useLoading(false);
const deviceTypeDict = useDeviceTypeDict();
/** 本地按设备编号 / 名称 / 房间过滤 */
const filteredDevices = computed(() => {
const kw = keyword.value.trim();
if (!kw) return deviceList.value;
return deviceList.value.filter(device =>
[device.deviceNo, device.deviceName, device.roomNo].some(field => String(field ?? '').includes(kw))
);
});
/** 电表、水表分别用不同图标,其余统一用采集器图标 */
const deviceIcon = (device: AppUserBindingVO) => {
if (String(device.deviceType) === '0') return 'Lightning';
if (String(device.deviceType) === '1') return 'Drizzling';
return 'Monitor';
};
const deviceTypeText = (device: AppUserBindingVO) => getDeviceTypeLabel(deviceTypeDict.value, device.deviceType);
const isSelected = (device: AppUserBindingVO) => selectedDeviceId.value === String(device.deviceId);
/** 单选:再次点击同一行保持选中 */
const selectDevice = (device: AppUserBindingVO) => {
selectedDeviceId.value = String(device.deviceId);
};
/** 兼容后端返回数组 / 分页对象 */
const normalizeDevices = (data: unknown): AppUserBindingVO[] => {
if (Array.isArray(data)) return data as AppUserBindingVO[];
if (data && typeof data === 'object') {
const record = data as Record<string, any>;
if (Array.isArray(record.rows)) return record.rows;
if (Array.isArray(record.list)) return record.list;
if (Array.isArray(record.records)) return record.records;
}
return [];
};
/** 加载可绑定设备:GET /userManage/appUser/bindableDevices/{userId} */
const loadDevices = async () => {
if (!userId.value) {
deviceList.value = [];
return;
}
await withLoading(async () => {
try {
const res = await getBindableDevices(userId.value);
deviceList.value = normalizeDevices(res.data);
} catch {
// 请求层已统一提示错误,这里只需保证弹窗可用
deviceList.value = [];
}
});
};
/** 打开绑定弹窗 */
const openDialog = async (currentUserId: string | number) => {
userId.value = currentUserId;
keyword.value = '';
selectedDeviceId.value = '';
open.value = true;
await loadDevices();
};
/** 绑定选中设备:POST /userManage/appUser/bindings/{userId} */
const handleConfirm = async () => {
if (!selectedDeviceId.value) return;
submitting.value = true;
try {
await bindAppUserDevices(userId.value, [selectedDeviceId.value]);
modal.msgSuccess('绑定成功');
open.value = false;
emit('success');
} finally {
submitting.value = false;
}
};
defineExpose({
openDialog
});
</script>
<style lang="scss" scoped>
.bind-search {
margin-bottom: 16px;
}
.bind-list {
display: flex;
flex-direction: column;
gap: 12px;
min-height: 120px;
}
.bind-row {
display: flex;
align-items: center;
gap: 12px;
padding: 12px 14px;
cursor: pointer;
border: 1px solid var(--app-surface-border);
border-radius: 8px;
transition:
border-color 0.2s,
background-color 0.2s;
&:hover {
border-color: var(--el-color-primary-light-5);
}
&.is-selected {
background: var(--app-accent-soft);
border-color: var(--el-color-primary-light-3);
}
}
.bind-radio {
flex: 0 0 auto;
height: auto;
margin-right: 0;
/* 单选只留圆点,文字由右侧信息展示 */
:deep(.el-radio__label) {
display: none;
}
}
.bind-icon {
display: inline-flex;
align-items: center;
justify-content: center;
flex: 0 0 34px;
width: 34px;
height: 34px;
color: var(--el-color-primary);
background: var(--app-accent-soft);
border-radius: 8px;
}
.bind-info {
flex: 1 1 auto;
min-width: 0;
}
.bind-room {
font-size: 15px;
font-weight: 600;
color: var(--el-text-color-primary);
}
.bind-meta {
margin-top: 4px;
font-size: 12px;
color: var(--el-text-color-secondary);
}
.bind-tag {
flex: 0 0 auto;
padding: 2px 12px;
font-size: 12px;
color: var(--el-text-color-regular);
border: 1px solid var(--app-surface-border);
border-radius: 999px;
}
.bind-footer {
display: flex;
justify-content: center;
gap: 12px;
}
</style>

View File

@@ -0,0 +1,158 @@
<template>
<div v-if="devices.length" class="device-grid">
<div v-for="device in devices" :key="String(device.deviceId)" class="device-card">
<div class="device-head">
<span class="device-icon">
<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-no">{{ deviceTypeText(device) }}:{{ valueOrDash(device.deviceNo) }}</div>
</div>
<el-tag :type="switchStatusTagType(device)" effect="light" round size="small">
{{ getSwitchStatusLabel(device.switchStatus) }}
</el-tag>
</div>
<div class="device-metrics">
<div class="metric">
<span class="metric-label">剩余量</span>
<span class="metric-value">{{ formatQuantity(device) }}</span>
</div>
<div class="metric">
<span class="metric-label">单价</span>
<span class="metric-value">{{ formatPrice(device) }}</span>
</div>
</div>
<div class="device-actions">
<el-button link type="danger" @click="emit('unbind', device)">解绑设备</el-button>
</div>
</div>
</div>
<el-empty v-else description="暂无绑定设备" />
</template>
<script setup name="DeviceTab" lang="ts">
import type { AppUserBindingVO } from '@/api/appUser/types';
import { getDeviceTypeLabel, getSwitchStatusLabel, getSwitchStatusOption, useDeviceTypeDict } from '../../../device/constants';
import { deviceIcon, formatPrice, formatQuantity, valueOrDash } from './helpers';
defineProps<{
/** 已绑定设备列表 */
devices: AppUserBindingVO[];
}>();
const emit = defineEmits<{
/** 解绑设备(由父组件统一处理) */
unbind: [device: AppUserBindingVO];
}>();
const deviceTypeDict = useDeviceTypeDict();
/** 设备类型文案,字典未加载时回退原始值 */
const deviceTypeText = (device: AppUserBindingVO) => getDeviceTypeLabel(deviceTypeDict.value, device.deviceType);
/** 控制状态标签配色 */
const switchStatusTagType = (device: AppUserBindingVO) => {
return (getSwitchStatusOption(device.switchStatus)?.elTagType as 'success' | 'danger' | 'warning' | 'info' | 'primary') || 'info';
};
</script>
<style lang="scss" scoped>
.device-grid {
display: flex;
flex-wrap: wrap;
gap: 24px;
}
.device-card {
display: flex;
flex-direction: column;
width: 384px;
max-width: 100%;
padding: 18px 20px 12px;
border: 1px solid var(--app-surface-border);
border-radius: 10px;
}
.device-head {
display: flex;
align-items: flex-start;
gap: 10px;
}
.device-icon {
display: inline-flex;
align-items: center;
justify-content: center;
flex: 0 0 34px;
width: 34px;
height: 34px;
color: var(--el-color-primary);
background: var(--app-accent-soft);
border-radius: 8px;
}
.device-title {
flex: 1 1 auto;
min-width: 0;
}
.device-room {
font-size: 15px;
font-weight: 700;
color: var(--el-text-color-primary);
}
.device-no {
margin-top: 4px;
font-size: 12px;
color: var(--el-text-color-secondary);
}
.device-metrics {
display: grid;
grid-template-columns: repeat(2, minmax(0, 1fr));
gap: 12px;
margin-top: 20px;
}
.metric {
display: flex;
flex-direction: column;
gap: 6px;
}
.metric-label {
font-size: 13px;
font-weight: 700;
color: var(--el-text-color-primary);
}
.metric-value {
font-size: 14px;
color: var(--el-text-color-regular);
}
.device-actions {
display: flex;
justify-content: flex-end;
margin-top: 10px;
/* 全局给表格里的 link 按钮加了底色,这里只保留纯文字 */
:deep(.el-button.is-link) {
width: auto !important;
min-width: auto !important;
height: auto !important;
padding: 0 !important;
background: transparent !important;
}
}
@media (max-width: 960px) {
.device-card {
width: 100%;
}
}
</style>

View File

@@ -0,0 +1,42 @@
<template>
<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>
<div class="record-side">
<span class="unbound-tag">已解绑</span>
<div class="record-amount">解绑时间:{{ item.unboundAt }}</div>
</div>
</div>
</div>
<el-empty v-else description="暂无历史设备" />
</template>
<script setup name="HistoryTab" lang="ts">
/** 历史设备行 */
interface HistoryDeviceItem {
id: string | number;
roomNo: string;
deviceText: string;
unboundAt: string;
}
/** TODO: 历史设备接口待接入,先用演示数据占位 */
const historyDevices = ref<HistoryDeviceItem[]>([
{
id: 1,
roomNo: '101室',
deviceText: '蓝牙水表 · NO20260101',
unboundAt: '2026年9月18日 09:03:12'
}
]);
</script>
<style lang="scss" scoped>
@use '@/assets/styles/components/detail-panels' as panels;
@include panels.record-list;
@include panels.unbound-tag;
</style>

View File

@@ -0,0 +1,86 @@
<template>
<div v-if="paymentGroups.length" class="record-list">
<div v-for="group in paymentGroups" :key="group.date" class="record-group">
<div class="record-date">{{ group.date }}</div>
<div v-for="record in group.records" :key="record.id" class="record-row">
<div class="record-main">
<div class="record-title">{{ record.deviceText }}</div>
<div class="record-sub">{{ record.typeText }}</div>
</div>
<div class="record-side">
<div class="record-status" :class="record.success ? 'is-success' : 'is-failed'">{{ record.statusText }}</div>
<div class="record-amount">¥{{ record.amount }}</div>
</div>
</div>
</div>
</div>
<el-empty v-else description="暂无支付记录" />
</template>
<script setup name="PaymentTab" lang="ts">
import { formatDate } from './helpers';
/** 支付记录行 */
interface PaymentRecordItem {
id: string | number;
deviceText: string;
typeText: string;
statusText: string;
success: boolean;
amount: number;
paidAt: string;
}
/** TODO: 支付记录接口待接入,先用演示数据占位 */
const paymentRecords = ref<PaymentRecordItem[]>([
{
id: 1,
deviceText: '蓝牙电表 · NO20260101',
typeText: '电费充值',
statusText: '支付成功',
success: true,
amount: 200,
paidAt: '2026-09-21 11:02:52'
},
{
id: 2,
deviceText: '蓝牙水表 · NO20260101',
typeText: '水费充值',
statusText: '支付失败',
success: false,
amount: 200,
paidAt: '2026-09-21 10:31:08'
},
{
id: 3,
deviceText: '蓝牙电表 · NO20260101',
typeText: '电费充值',
statusText: '支付成功',
success: true,
amount: 200,
paidAt: '2026-09-21 09:12:40'
}
]);
/** 支付记录按日期分组 */
const paymentGroups = computed(() => {
const groups: Array<{ date: string; records: PaymentRecordItem[] }> = [];
paymentRecords.value.forEach(record => {
const date = formatDate(record.paidAt);
const group = groups.find(item => item.date === date);
if (group) {
group.records.push(record);
} else {
groups.push({ date, records: [record] });
}
});
return groups;
});
</script>
<style lang="scss" scoped>
@use '@/assets/styles/components/detail-panels' as panels;
@include panels.record-list;
@include panels.record-status;
</style>

View File

@@ -0,0 +1,116 @@
<template>
<div class="reading-panel">
<!-- 抄表记录按日期区间筛选 -->
<div class="reading-toolbar">
<span class="reading-toolbar__label">抄表时间</span>
<el-date-picker
v-model="readingDateRange"
type="daterange"
value-format="YYYY-MM-DD"
range-separator="-"
start-placeholder="开始日期"
end-placeholder="结束日期"
clearable
class="reading-date-picker"
/>
</div>
<div v-if="filteredReadingRecords.length" class="card-list">
<div v-for="record in filteredReadingRecords" :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>
<div class="card-metrics card-metrics--three">
<div class="metric-block">
<span class="metric-label">起始读数</span>
<span class="metric-value">{{ record.previousReading }}{{ record.unit }}</span>
</div>
<div class="metric-block">
<span class="metric-label">截止读数</span>
<span class="metric-value is-highlight">{{ record.reading }}{{ record.unit }}</span>
</div>
<div class="metric-block">
<span class="metric-label">区间用量</span>
<span class="metric-value">{{ record.usage }}{{ record.unit }}</span>
</div>
</div>
</div>
</div>
<el-empty v-else :description="readingDateRange?.length ? '该时间段内暂无抄表记录' : '暂无抄表记录'" />
</div>
</template>
<script setup name="ReadingTab" lang="ts">
/** 抄表记录行 */
interface ReadingRecordItem {
id: string | number;
roomNo: string;
deviceText: string;
previousReading: number;
reading: number;
usage: number;
unit: string;
readingTime: string;
}
/** TODO: 抄表记录接口待接入,先用演示数据占位 */
const readingRecords = ref<ReadingRecordItem[]>([
{
id: 1,
roomNo: '101室',
deviceText: '蓝牙电表 · NO20260101',
previousReading: 1234,
reading: 1250,
usage: 16,
unit: '度',
readingTime: '2026-09-21 11:02:52'
},
{
id: 2,
roomNo: '101室',
deviceText: '蓝牙水表 · NO20260101',
previousReading: 156,
reading: 168.6,
usage: 12.6,
unit: '吨',
readingTime: '2026-09-18 09:03:12'
}
]);
/** 抄表记录时间筛选区间(YYYY-MM-DD),为空表示不筛选 */
const readingDateRange = ref<[string, string] | null>(null);
/** 抄表记录按所选时间区间过滤,接口接入后改为传 startTime / endTime 到后端 */
const filteredReadingRecords = computed(() => {
const [start, end] = readingDateRange.value || [];
if (!start || !end) return readingRecords.value;
return readingRecords.value.filter(record => {
const day = String(record.readingTime || '').slice(0, 10);
return !!day && day >= start && day <= end;
});
});
</script>
<style lang="scss" scoped>
@use '@/assets/styles/components/detail-panels' as panels;
@include panels.record-card-list;
.reading-toolbar {
display: flex;
justify-self: start;
align-items: center;
gap: 10px;
margin-bottom: 16px;
}
.reading-toolbar__label {
font-size: 13px;
color: var(--el-text-color-regular);
}
.reading-date-picker {
width: 260px;
}
</style>

View File

@@ -0,0 +1,54 @@
<template>
<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>
<div class="card-metrics">
<div class="metric-block">
<span class="metric-label">清零前读数</span>
<span class="metric-value">{{ record.beforeReading }}{{ record.unit }}</span>
</div>
<div class="metric-block">
<span class="metric-label">清零后读数</span>
<span class="metric-value is-highlight">{{ record.afterReading }}{{ record.unit }}</span>
</div>
</div>
<div class="card-time">清零时间:{{ record.resetTime }}</div>
</div>
</div>
<el-empty v-else description="暂无清零记录" />
</template>
<script setup name="ResetTab" lang="ts">
/** 清零记录行 */
interface ResetRecordItem {
id: string | number;
roomNo: string;
deviceText: string;
beforeReading: number;
afterReading: number;
unit: string;
resetTime: string;
}
/** TODO: 清零记录接口待接入,先用演示数据占位 */
const resetRecords = ref<ResetRecordItem[]>([
{
id: 1,
roomNo: '101室',
deviceText: '蓝牙电表 · NO20260101',
beforeReading: 1234,
afterReading: 0,
unit: '度',
resetTime: '2026年9月21日 11:20:45'
}
]);
</script>
<style lang="scss" scoped>
@use '@/assets/styles/components/detail-panels' as panels;
@include panels.record-card-list;
</style>

View File

@@ -0,0 +1,102 @@
<template>
<el-card shadow="hover" class="summary-card">
<div class="summary-row">
<div class="summary-identity">
<el-avatar :size="48" :src="user.avatarUrl" class="user-avatar">{{ avatarText }}</el-avatar>
<div class="identity-text">
<div class="identity-name">{{ userName }}</div>
<div class="identity-line">用户ID:{{ user.userId }}</div>
<div class="identity-line">注册时间:{{ formatDate(user.createTime) }}</div>
</div>
</div>
<div class="summary-group">
<div class="summary-line">手机号:{{ user.phoneNumber || '—' }}</div>
<div class="summary-line">房间号:{{ user.roomNo || user.roomName || '—' }}</div>
</div>
<div class="summary-group">
<div class="summary-line">绑定设备:{{ deviceCountText }}</div>
<div class="summary-line">最近缴费:{{ user.lastRechargeTime || '—' }}</div>
</div>
</div>
</el-card>
</template>
<script setup name="UserSummaryCard" lang="ts">
import type { AppUserVO } from '@/api/appUser/types';
import { formatDate } from './helpers';
const props = defineProps<{
/** 用户概要信息 */
user: Partial<AppUserVO>;
/** 已绑定设备数量 */
deviceCount: number;
}>();
/** 姓名优先昵称,其次实名姓名 */
const userName = computed(() => props.user.nickName || props.user.realName || '—');
/** 无头像时用姓名首字兜底 */
const avatarText = computed(() => (userName.value === '—' ? 'U' : userName.value.slice(0, 1)));
const deviceCountText = computed(() => (props.deviceCount ? `${props.deviceCount}台` : '0台'));
</script>
<style lang="scss" scoped>
.summary-card {
:deep(.el-card__body) {
padding: 22px 26px;
}
}
.summary-row {
display: grid;
grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr) minmax(0, 1fr);
gap: 24px;
align-items: center;
}
.summary-identity {
display: flex;
align-items: center;
gap: 14px;
min-width: 0;
}
.user-avatar {
flex: 0 0 48px;
color: #fff;
background: #b9dcff;
}
.identity-name {
font-size: 20px;
font-weight: 700;
color: var(--el-text-color-primary);
}
.identity-line {
margin-top: 4px;
font-size: 13px;
color: var(--el-text-color-regular);
}
.summary-group {
display: flex;
flex-direction: column;
gap: 10px;
min-width: 0;
}
.summary-line {
font-size: 13px;
color: var(--el-text-color-regular);
word-break: break-all;
}
@media (max-width: 960px) {
.summary-row {
grid-template-columns: minmax(0, 1fr);
gap: 18px;
}
}
</style>

View File

@@ -0,0 +1,33 @@
import type { AppUserBindingVO } from '@/api/appUser/types';
/** 空值统一显示占位符 */
export const valueOrDash = (value?: string | number | null) => (value === undefined || value === null || value === '' ? '—' : value);
/** 日期展示成「2026年9月21日」 */
export const formatDate = (value?: string) => {
if (!value) return '—';
const matched = String(value).match(/^(\d{4})-(\d{1,2})-(\d{1,2})/);
return matched ? `${matched[1]}年${Number(matched[2])}月${Number(matched[3])}日` : String(value);
};
/** 计量单位:电表按度、水表按吨,优先后端 unitName */
export const quantityUnit = (device: AppUserBindingVO) => {
if (String(device.unitName) === '0') return '度';
if (String(device.unitName) === '1') return '吨';
return String(device.deviceType) === '1' ? '吨' : '度';
};
export const formatQuantity = (device: AppUserBindingVO) =>
device.currentQuantity === undefined || device.currentQuantity === null ? '—' : `${device.currentQuantity}${quantityUnit(device)}`;
export const formatPrice = (device: AppUserBindingVO) =>
device.currentUnitPrice === undefined || device.currentUnitPrice === null
? '—'
: `${device.currentUnitPrice}元/${quantityUnit(device)}`;
/** 电表、水表分别用不同图标,其余统一用采集器图标 */
export const deviceIcon = (device: AppUserBindingVO) => {
if (String(device.deviceType) === '0') return 'Lightning';
if (String(device.deviceType) === '1') return 'Drizzling';
return 'Monitor';
};

View File

@@ -0,0 +1,239 @@
<template>
<div class="p-2 app-container userManage-appUser-detail-page">
<div class="detail-header">
<el-button link class="back-button" title="返回" @click="goBack">
<el-icon :size="18"><ArrowLeft /></el-icon>
</el-button>
<h2 class="detail-title">用户详情</h2>
</div>
<div v-loading="loading" class="detail-body">
<template v-if="user.userId != null">
<!-- 概要信息 -->
<UserSummaryCard :user="user" :device-count="devices.length" />
<!-- 页签 + 内容 -->
<el-card shadow="hover" class="tab-card">
<div class="tab-bar">
<div class="tab-list">
<button
v-for="tab in tabs"
:key="tab.value"
type="button"
class="tab-item"
:class="{ 'is-active': activeTab === tab.value }"
@click="activeTab = tab.value"
>
{{ tab.label }}
</button>
</div>
<!-- 已同时绑定水电表后不再允许继续绑定 -->
<el-tooltip v-if="activeTab === 'device'" :disabled="!bindDisabled" content="该用户已绑定水电表" placement="top">
<span>
<el-button type="primary" :disabled="bindDisabled" @click="handleBindDevice">绑定设备</el-button>
</span>
</el-tooltip>
</div>
<div class="tab-content">
<DeviceTab v-if="activeTab === 'device'" :devices="devices" @unbind="handleUnbindDevice" />
<PaymentTab v-else-if="activeTab === 'payment'" />
<ReadingTab v-else-if="activeTab === 'reading'" />
<ResetTab v-else-if="activeTab === 'reset'" />
<HistoryTab v-else-if="activeTab === 'history'" />
<el-empty v-else :description="`暂无${currentTabLabel}`" />
</div>
</el-card>
</template>
<el-empty v-else-if="!loading" description="未找到用户信息" />
</div>
<div class="detail-footer">
<el-button icon="ArrowLeft" @click="goBack">返 回</el-button>
</div>
<!-- 绑定设备弹窗 -->
<BindDeviceDialog ref="bindDeviceRef" @success="getDetail" />
</div>
</template>
<script setup name="AppUserDetail" lang="ts">
import { useRoute, useRouter } from 'vue-router';
import { getAppUserBindings, getAppUserDetail } from '@/api/appUser';
import { AppUserBindingVO, AppUserVO } from '@/api/appUser/types';
import { useLoading } from '@/hooks/async/useLoading';
import modal from '@/plugins/modal';
import BindDeviceDialog from './components/BindDeviceDialog.vue';
import DeviceTab from './components/detail/DeviceTab.vue';
import HistoryTab from './components/detail/HistoryTab.vue';
import PaymentTab from './components/detail/PaymentTab.vue';
import ReadingTab from './components/detail/ReadingTab.vue';
import ResetTab from './components/detail/ResetTab.vue';
import UserSummaryCard from './components/detail/UserSummaryCard.vue';
const route = useRoute();
const router = useRouter();
const { loading, withLoading } = useLoading(true);
const user = ref<Partial<AppUserVO>>({});
/** 已绑定设备:GET /userManage/appUser/bindings/{userId} */
const devices = ref<AppUserBindingVO[]>([]);
const bindDeviceRef = ref<InstanceType<typeof BindDeviceDialog>>();
const tabs = [
{ label: '绑定设备', value: 'device' },
{ label: '支付记录', value: 'payment' },
{ label: '抄表记录', value: 'reading' },
{ label: '清零记录', value: 'reset' },
{ label: '历史设备', value: 'history' }
];
const activeTab = ref('device');
const currentTabLabel = computed(() => tabs.find(item => item.value === activeTab.value)?.label || '');
/** 已绑定电表(deviceType=0)/ 水表(deviceType=1) */
const hasElectricMeter = computed(() => devices.value.some(device => String(device.deviceType) === '0'));
const hasWaterMeter = computed(() => devices.value.some(device => String(device.deviceType) === '1'));
/** 水电表都已绑定时,绑定设备按钮置灰 */
const bindDisabled = computed(() => hasElectricMeter.value && hasWaterMeter.value);
/** 返回上一页(用户列表) */
const goBack = () => {
router.back();
};
/** 打开绑定设备弹窗 */
const handleBindDevice = () => {
const userId = route.query.userId as string | undefined;
if (!userId) {
modal.msgError('缺少用户ID,请从用户列表进入');
return;
}
bindDeviceRef.value?.openDialog(userId);
};
/** TODO: 解绑设备接口待后端提供,先占位提示 */
const handleUnbindDevice = (device: AppUserBindingVO) => {
modal.msgWarning(`解绑设备「${device.deviceNo || device.deviceId}」的接口待接入`);
};
/** 绑定列表兼容后端返回:数组 / 分页对象 / 单个对象 */
const normalizeDevices = (data: unknown): AppUserBindingVO[] => {
if (Array.isArray(data)) return data as AppUserBindingVO[];
if (data && typeof data === 'object') {
const record = data as Record<string, any>;
if (Array.isArray(record.rows)) return record.rows;
if (Array.isArray(record.list)) return record.list;
if (Array.isArray(record.records)) return record.records;
if (record.deviceId != null) return [record as AppUserBindingVO];
}
return [];
};
/** 查询用户详情 */
const getDetail = async () => {
const userId = route.query.userId as string | undefined;
if (!userId) {
modal.msgError('缺少用户ID,请从用户列表进入');
loading.value = false;
return;
}
await withLoading(async () => {
// 头部概要信息 + 已绑定设备:GET /userManage/appUser/detail/{userId}、/bindings/{userId}
const [detailRes, bindingRes] = await Promise.allSettled([getAppUserDetail(userId), getAppUserBindings(userId)]);
if (detailRes.status === 'fulfilled') {
user.value = detailRes.value.data || {};
}
devices.value = bindingRes.status === 'fulfilled' ? normalizeDevices(bindingRes.value.data) : [];
});
};
onMounted(() => {
getDetail();
});
</script>
<style lang="scss" scoped>
.detail-header {
display: flex;
align-items: center;
gap: 4px;
padding: 2px 4px;
}
.back-button {
color: var(--el-text-color-primary);
:deep(.el-icon) {
font-weight: 700;
}
}
.detail-title {
margin: 0;
font-size: 18px;
font-weight: 700;
color: var(--el-text-color-primary);
}
.detail-body {
display: flex;
flex-direction: column;
gap: 16px;
margin-top: 12px;
}
.detail-footer {
display: flex;
justify-content: center;
padding: 18px 0 8px;
}
/* ---------- 页签 ---------- */
.tab-card {
:deep(.el-card__body) {
padding: 0 26px 22px;
}
}
.tab-bar {
display: flex;
align-items: center;
justify-content: space-between;
gap: 16px;
padding: 18px 0 16px;
border-bottom: 1px solid var(--app-surface-border);
}
.tab-list {
display: flex;
flex-wrap: wrap;
gap: 34px;
}
.tab-item {
padding: 0;
font-size: 15px;
font-weight: 600;
color: var(--el-text-color-primary);
cursor: pointer;
background: none;
border: 0;
&:hover {
color: var(--el-color-primary);
}
&.is-active {
color: var(--el-color-primary);
}
}
.tab-content {
padding-top: 22px;
}
@media (max-width: 960px) {
.tab-list {
gap: 20px;
}
}
</style>

View File

@@ -0,0 +1,210 @@
<template>
<div class="p-2 page-shell userManage-appUser-page">
<div class="search-wrap">
<el-card shadow="hover" class="search-panel" :class="{ 'is-collapsed': !showSearch }">
<template #header>
<div class="panel-heading search-panel-toggle" @click.stop="showSearch = !showSearch">
<div><h3>筛选条件</h3></div>
</div>
</template>
<el-form ref="queryFormRef" :model="queryParams" :inline="true" class="query-form">
<el-form-item label="手机号" prop="phoneNumber">
<el-input v-model="queryParams.phoneNumber" placeholder="请输入手机号" clearable @keyup.enter="handleQuery" />
</el-form-item>
<el-form-item label="姓名" prop="keyword">
<el-input v-model="queryParams.keyword" placeholder="请输入姓名或昵称" clearable @keyup.enter="handleQuery" />
</el-form-item>
<el-form-item label="状态" prop="status">
<el-select v-model="queryParams.status" placeholder="请选择状态" clearable>
<el-option v-for="dict in ur_app_user_status" :key="dict.value" :label="dict.label" :value="dict.value" />
</el-select>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
</el-form-item>
</el-form>
</el-card>
</div>
<el-card shadow="hover" class="table-panel">
<template #header>
<div class="toolbar-shell">
<div class="table-heading">
<h3>用户列表</h3>
</div>
<div class="toolbar-actions">
<el-button type="danger" plain icon="Delete" :disabled="multiple" @click="handleDelete()" v-hasPermi="['userManage:appUser:remove']">删除</el-button>
<right-toolbar v-model:show-search="showSearch" :search="false" @query-table="getList"></right-toolbar>
</div>
</div>
</template>
<el-table v-loading="loading" border class="data-table" :data="appUserList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="用户ID" align="center" prop="userId" />
<el-table-column label="用户姓名" align="center" show-overflow-tooltip>
<template #default="scope">{{ scope.row.nickName}}</template>
</el-table-column>
<el-table-column label="手机号" align="center" prop="phoneNumber" />
<el-table-column label="房间号" align="center" show-overflow-tooltip>
<template #default="scope">{{ scope.row.roomNo}}</template>
</el-table-column>
<el-table-column label="最近缴费" align="center" >
<template #default="scope">{{ scope.row.recentRechargeAmount }}</template>
</el-table-column>
<el-table-column label="绑定设备数" align="center" >
<!-- 后端暂未返回绑定设备数,先占位 -->
<template #default="scope">{{ scope.row.bindingDeviceCount }}</template>
</el-table-column>
<el-table-column label="状态" align="center" prop="status" width="100">
<template #default="scope">
<dict-tag :options="ur_app_user_status" :value="scope.row.status" />
</template>
</el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="190">
<template #default="scope">
<div class="table-actions">
<el-button link type="primary" @click="handleView(scope.row)">详情</el-button>
<!-- 正常显示停用,停用显示启用 -->
<el-button
v-if="scope.row.status === '0'"
link
type="warning"
@click="handleToggleStatus(scope.row)"
v-hasPermi="['userManage:appUser:edit']"
>
停用
</el-button>
<el-button v-else link type="success" @click="handleToggleStatus(scope.row)" v-hasPermi="['userManage:appUser:edit']">
启用
</el-button>
<el-button link type="danger" @click="handleDelete(scope.row)" v-hasPermi="['userManage:appUser:remove']">删除</el-button>
</div>
</template>
</el-table-column>
</el-table>
<pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize" @pagination="getList" />
</el-card>
</div>
</template>
<script setup name="AppUser" lang="ts">
import { delAppUser, listAppUser, updateAppUser } from '@/api/appUser';
import { AppUserForm, AppUserQuery, AppUserVO } from '@/api/appUser/types';
import { useLoading } from '@/hooks/async/useLoading';
import { useSearchReset } from '@/hooks/form/useSearchReset';
import { useSearchToggle } from '@/hooks/form/useSearchToggle';
import { useTableSelection } from '@/hooks/table/useTableSelection';
import modal from '@/plugins/modal';
import { useDict } from '@/utils/dict';
import { useRouter } from 'vue-router';
/** 用户状态字典(后端 ur_app_user_status 维护) */
const { ur_app_user_status } = toRefs<any>(useDict('ur_app_user_status'));
const router = useRouter();
const appUserList = ref<AppUserVO[]>([]);
const { loading, withLoading } = useLoading(true);
const { showSearch } = useSearchToggle();
const total = ref(0);
const queryFormRef = ref<ElFormInstance>();
const queryParams = ref<AppUserQuery>({
pageNum: 1,
pageSize: 10,
phoneNumber: undefined,
// 后端 keyword 同时匹配手机号、昵称、实名姓名
keyword: undefined,
status: undefined
});
const { ids, multiple, handleSelectionChange } = useTableSelection<AppUserVO>(item => item.userId);
/** 查询小程序用户列表 */
const getList = async () => {
await withLoading(async () => {
const res = await listAppUser(queryParams.value);
appUserList.value = res.data?.rows;
total.value = res.data?.total;
});
};
/** 搜索按钮操作 */
const handleQuery = () => {
queryParams.value.pageNum = 1;
getList();
};
const { resetQuery } = useSearchReset({
queryFormRef,
queryParams,
pageNumKey: 'pageNum',
pageSizeKey: 'pageSize',
initialPageSize: 10,
afterReset: () => {
handleQuery();
}
});
/** 详情按钮操作:跳转到用户详情页 */
const handleView = (row: Partial<AppUserVO>) => {
router.push({ path: '/appUser/detail', query: { userId: String(row.userId) } });
};
/** 启用 / 停用:正常(0) → 停用(1),停用(1) → 正常(0) */
const handleToggleStatus = async (row: Partial<AppUserVO>) => {
const nextStatus = row.status === '0' ? '1' : '0';
const actionText = nextStatus === '0' ? '启用' : '停用';
await modal.confirm(`是否确认${actionText}用户"${row.nickName || row.phoneNumber || row.userId}"?`);
await updateAppUser({ userId: row.userId, status: nextStatus } as AppUserForm);
modal.msgSuccess(`${actionText}成功`);
await getList();
};
/** 删除按钮操作 */
const handleDelete = async (row?: Partial<AppUserVO>) => {
const _userIds = row?.userId || ids.value;
await modal.confirm('是否确认删除小程序用户编号为"' + _userIds + '"的数据项?');
await delAppUser(_userIds);
modal.msgSuccess('删除成功');
await getList();
};
onMounted(() => {
getList();
});
</script>
<style lang="scss" scoped>
/*
* 全局 _search-panel.scss 给 .data-table 里的 link 按钮加了 28x28 的圆角底色(带 !important),
* 操作列是纯文字按钮,这里用同等优先级覆盖掉底色与固定尺寸
*/
.table-actions {
display: flex;
flex-wrap: wrap;
align-items: center;
justify-content: center;
gap: 4px 10px;
:deep(.el-button.is-link) {
width: auto !important;
min-width: auto !important;
height: auto !important;
padding: 0 !important;
border-radius: 0 !important;
background: transparent !important;
font-size: 13px;
font-weight: 500;
}
:deep(.el-button.is-link + .el-button.is-link) {
margin-left: 0 !important;
}
}
</style>

View File

@@ -0,0 +1,122 @@
<template>
<el-dialog v-model="open" :title="title" width="500px" append-to-body @closed="resetForm">
<el-form ref="formRef" :model="form" :rules="rules" label-width="80px">
<el-form-item label="设备编号" prop="deviceNo">
<el-input v-model="form.deviceNo" :disabled="isEdit" placeholder="请输入设备编号" />
</el-form-item>
<el-form-item label="设备名称" prop="deviceName">
<el-input v-model="form.deviceName" placeholder="请输入设备名称" />
</el-form-item>
<el-form-item label="设备类型" prop="deviceType">
<el-select v-model="form.deviceType" placeholder="请选择设备类型">
<el-option v-for="item in deviceTypeDict" :key="item.value" :label="item.label" :value="item.value" />
</el-select>
</el-form-item>
</el-form>
<template #footer>
<div class="dialog-footer">
<el-button :loading="buttonLoading" type="primary" @click="submitForm">确 定</el-button>
<el-button @click="open = false">取 消</el-button>
</div>
</template>
</el-dialog>
</template>
<script setup name="DeviceFormDialog" lang="ts">
import { addDevice, getDevice, updateDevice } from '@/api/deviceManage/device';
import { DeviceForm } from '@/api/deviceManage/device/types';
import modal from '@/plugins/modal';
import { useDeviceTypeDict } from '../constants';
const emit = defineEmits<{
success: [];
}>();
/** 设备类型字典(后端 ur_device_type 维护,只有电表/水表) */
const deviceTypeDict = useDeviceTypeDict();
const open = ref(false);
const title = ref('添加智能水电设备');
const buttonLoading = ref(false);
const formRef = ref<ElFormInstance>();
const initFormData: DeviceForm = {
deviceId: undefined,
merchantId: undefined,
roomId: undefined,
deviceNo: undefined,
deviceName: undefined,
deviceType: undefined,
communicationType: undefined,
unitName: undefined,
qrCode: undefined,
remainingBalance: undefined,
currentQuantity: undefined,
currentPower: undefined,
currentUnitPrice: undefined,
switchStatus: undefined,
onlineStatus: undefined,
lastOnlineTime: undefined,
lastReadingTime: undefined,
installedAt: undefined,
status: undefined,
remark: undefined,
createBy: undefined,
createTime: undefined,
updateBy: undefined,
updateTime: undefined
};
const form = ref<DeviceForm>({ ...initFormData });
const rules: ElFormRules = {
deviceNo: [{ required: true, message: '设备编号不能为空', trigger: 'blur' }],
deviceName: [{ required: true, message: '设备名称不能为空', trigger: 'blur' }],
deviceType: [{ required: true, message: '设备类型不能为空', trigger: 'change' }]
};
/** 编辑(表单里已有 deviceId)时设备编号不允许修改 */
const isEdit = computed(() => form.value.deviceId != null);
const resetForm = () => {
form.value = { ...initFormData };
formRef.value?.clearValidate();
};
/** 打开弹窗:传 deviceId 为编辑,不传为新增 */
const openDialog = async (deviceId?: string | number) => {
resetForm();
if (deviceId == null) {
title.value = '添加智能水电设备';
open.value = true;
return;
}
title.value = '修改智能水电设备';
open.value = true;
const res = await getDevice(deviceId);
Object.assign(form.value, res.data);
};
const submitForm = () => {
formRef.value?.validate(async (valid: boolean) => {
if (!valid) return;
buttonLoading.value = true;
try {
if (form.value.deviceId) {
await updateDevice(form.value);
} else {
await addDevice(form.value);
}
modal.msgSuccess('操作成功');
open.value = false;
emit('success');
} finally {
buttonLoading.value = false;
}
});
};
defineExpose({
openDialog
});
</script>

View File

@@ -0,0 +1,123 @@
<template>
<el-dialog v-model="open" title="抄表" width="450px" append-to-body>
<div v-loading="loading" class="meter-reading">
<div class="meter-reading-grid">
<div class="meter-reading-item">
<span class="meter-reading-label">当前读数</span>
<span class="meter-reading-value">{{ formatReading(data.currentReadingValue) }}</span>
</div>
<div class="meter-reading-item">
<span class="meter-reading-label">上次读数</span>
<span class="meter-reading-value">{{ formatReading(data.previousReadingValue) }}</span>
</div>
<div class="meter-reading-item">
<span class="meter-reading-label">本期用量</span>
<span class="meter-reading-value is-highlight">{{ formatReading(usageQuantity) }}</span>
</div>
<div class="meter-reading-item">
<span class="meter-reading-label">抄表时间</span>
<span class="meter-reading-value">{{ data.lastReadingTime || '—' }}</span>
</div>
</div>
</div>
<template #footer>
<el-button type="primary" class="meter-reading-close" @click="open = false">关 闭</el-button>
</template>
</el-dialog>
</template>
<script setup name="MeterReadingDialog" lang="ts">
import { getDevice, readDevice } from '@/api/deviceManage/device';
import { DeviceVO } from '@/api/deviceManage/device/types';
const emit = defineEmits<{
success: [];
}>();
const open = ref(false);
const loading = ref(false);
const data = ref<Partial<DeviceVO>>({});
/** 本期用量由后端返回(usageQuantity),前端不再自行相减 */
const usageQuantity = computed(() => data.value.usageQuantity);
/** 读数单位:电表按度、水表按吨,优先后端 unitName(0度、1吨) */
const readingUnit = computed(() => {
if (String(data.value.unitName) === '0') return '度';
if (String(data.value.unitName) === '1') return '吨';
return String(data.value.deviceType) === '1' ? '吨' : '度';
});
/** 读数格式化,保留一位小数 */
const formatReading = (value?: number | null) => {
if (value === undefined || value === null || Number.isNaN(Number(value))) return '—';
return `${Number(value).toFixed(1)}${readingUnit.value}`;
};
/**
* 打开抄表弹窗:先用行数据占位,再下发抄表指令(POST /deviceManage/device/{deviceId}/read),
* 指令成功后重新拉详情,展示最新的当前读数、上次读数、本期用量与抄表时间
*/
const openDialog = async (row: Partial<DeviceVO>) => {
const deviceId = row.deviceId as string | number;
data.value = { ...row };
open.value = true;
loading.value = true;
try {
const readRes = await readDevice(deviceId);
// 抄表接口若直接返回读数则用返回值,否则回查设备详情
const readData = readRes?.data as Partial<DeviceVO> | null;
const hasReading =
readData != null &&
(readData.currentReadingValue != null || readData.previousReadingValue != null || readData.usageQuantity != null);
data.value = hasReading ? readData! : (await getDevice(deviceId)).data || {};
} finally {
loading.value = false;
// 抄表指令已下发,列表的读数/用量可能变化,无论成功失败都通知父组件刷新
emit('success');
}
};
defineExpose({
openDialog
});
</script>
<style lang="scss" scoped>
.meter-reading-grid {
display: grid;
grid-template-columns: repeat(2, minmax(0, 1fr));
row-gap: 28px;
column-gap: 24px;
padding: 8px 4px 12px;
}
.meter-reading-item {
display: flex;
flex-direction: column;
gap: 8px;
text-align: center;
min-width: 0;
}
.meter-reading-label {
font-size: 15px;
font-weight: 700;
color: var(--el-text-color-primary);
}
.meter-reading-value {
font-size: 16px;
font-weight: 600;
color: var(--el-text-color-primary);
word-break: break-all;
&.is-highlight {
color: var(--el-color-primary);
}
}
.meter-reading-close {
width: 100%;
}
</style>

View File

@@ -0,0 +1,47 @@
import { toRefs, type Ref } from 'vue';
import { useDict } from '@/utils/dict';
/**
* 设备模块字典:设备类型走后端字典管理(ur_device_type,字典项只有电表/水表),
* 控制状态后端字典尚未建立,先用本地兜底选项;列表页与详情页共用这里的定义。
*/
export const DEVICE_TYPE_DICT = 'ur_device_type';
/** 设备类型字典(字典未加载时为空数组,类型列会回显原始值) */
export const useDeviceTypeDict = () => {
return toRefs<any>(useDict(DEVICE_TYPE_DICT))[DEVICE_TYPE_DICT] as Ref<DictDataOption[]>;
};
/** 控制状态(0正常,1强制拉闸,2欠费拉闸,3离线) */
export const switchStatusOptions: DictDataOption[] = [
{ label: '正常', value: '0', elTagType: 'success' },
{ label: '强制拉闸', value: '1', elTagType: 'danger' },
{ label: '欠费拉闸', value: '2', elTagType: 'warning' },
{ label: '离线', value: '3', elTagType: 'info' }
];
/** 只有电表、水表支持清零/抄表/拉闸 */
export const METER_TYPES = ['0', '1'];
/** 已拉闸的状态:强制拉闸、欠费拉闸 */
export const CUT_OFF_STATUS = ['1', '2'];
/** 是否水表:deviceType 为 1 表示水表,0 为电表 */
export const isWaterMeter = (deviceType?: string) => String(deviceType) === '1';
/** 恢复文案:水表叫恢复供水,电表叫恢复供电(拉闸动作水电统一叫拉闸) */
export const getRestoreLabel = (deviceType?: string) => (isWaterMeter(deviceType) ? '恢复供水' : '恢复供电');
/** 设备类型文案:字典里找不到时回显原始值 */
export const getDeviceTypeLabel = (options: DictDataOption[], value?: string) => {
return options.find(item => item.value === String(value))?.label || (value ? String(value) : '—');
};
/** 控制状态选项 */
export const getSwitchStatusOption = (value?: string) => switchStatusOptions.find(item => item.value === String(value));
/** 控制状态文案 */
export const getSwitchStatusLabel = (value?: string) => getSwitchStatusOption(value)?.label || '—';
/** 控制状态配色 */
export const getSwitchStatusClass = (value?: string) => `switch-status--${getSwitchStatusOption(value)?.elTagType || 'info'}`;

View File

@@ -0,0 +1,310 @@
<template>
<div class="p-2 app-container deviceManage-device-detail-page">
<div class="detail-header">
<el-button link class="back-button" title="返回" @click="goBack">
<el-icon :size="18"><ArrowLeft /></el-icon>
</el-button>
<h2 class="detail-title">设备详情</h2>
</div>
<el-card shadow="hover" class="detail-card" v-loading="loading">
<template v-if="device.deviceId != null">
<div class="detail-banner">
<div class="device-avatar">
<el-icon :size="30"><component :is="deviceIcon" /></el-icon>
</div>
<div class="banner-text">
<div class="banner-title">{{ bannerTitle }}</div>
<div class="banner-meta">
设备编号:{{ valueOrDash(device.deviceNo) }} / 类型:{{ getDeviceTypeLabel(deviceTypeDict, device.deviceType) }} / 所属商户:{{ merchantText }}
</div>
</div>
</div>
<section class="detail-section">
<h3 class="section-title">基本信息</h3>
<div class="detail-grid">
<div class="detail-item">
<span class="detail-label">设备名称</span>
<span class="detail-value">{{ valueOrDash(device.deviceName) }}</span>
</div>
<div class="detail-item">
<span class="detail-label">设备状态</span>
<el-tag :type="switchStatusTagType" effect="light" round size="small">
{{ getSwitchStatusLabel(device.switchStatus) }}
</el-tag>
</div>
<div class="detail-item">
<span class="detail-label">设备类型</span>
<span class="detail-value">{{ getDeviceTypeLabel(deviceTypeDict, device.deviceType) }}</span>
</div>
<div class="detail-item">
<span class="detail-label">绑定房东</span>
<span class="detail-value">{{ landlordText }}</span>
</div>
<div class="detail-item">
<span class="detail-label">设备编号</span>
<span class="detail-value">{{ valueOrDash(device.deviceNo) }}</span>
</div>
<div class="detail-item">
<span class="detail-label">安装位置</span>
<span class="detail-value">{{ installText }}</span>
</div>
</div>
</section>
<section class="detail-section">
<h3 class="section-title">用量金额</h3>
<div class="detail-grid">
<div class="detail-item">
<span class="detail-label">{{ totalLabel }}</span>
<span class="detail-value">{{ formatQuantity(device.totalQuantity) }}</span>
</div>
<div class="detail-item">
<span class="detail-label">当前单价</span>
<span class="detail-value">{{ formatPrice(device.currentUnitPrice) }}</span>
</div>
<div class="detail-item">
<span class="detail-label">剩余用量</span>
<span class="detail-value">{{ formatQuantity(device.currentQuantity) }}</span>
</div>
<div class="detail-item">
<span class="detail-label">最近充值</span>
<span class="detail-value">{{ valueOrDash(device.lastRechargeTime) }}</span>
</div>
<div class="detail-item">
<span class="detail-label">剩余金额</span>
<span class="detail-value">{{ formatAmount(device.remainingBalance) }}</span>
</div>
</div>
</section>
<section v-if="isOffline" class="detail-section detail-section--panel is-offline">
<h3 class="section-title">离线信息</h3>
<div class="detail-grid">
<div class="detail-item">
<span class="detail-label">最后在线时间</span>
<span class="detail-value">{{ valueOrDash(device.lastOnlineTime) }}</span>
</div>
<div class="detail-item">
<span class="detail-label">离线时长</span>
<span class="detail-value">{{ valueOrDash(device.offlineDuration) }}</span>
</div>
</div>
</section>
</template>
<el-empty v-else-if="!loading" description="未找到设备信息" />
</el-card>
<div class="detail-footer">
<el-button icon="ArrowLeft" @click="goBack">返 回</el-button>
</div>
</div>
</template>
<script setup name="DeviceDetail" lang="ts">
import { useRoute, useRouter } from 'vue-router';
import { getDevice } from '@/api/deviceManage/device';
import { DeviceVO } from '@/api/deviceManage/device/types';
import { useLoading } from '@/hooks/async/useLoading';
import modal from '@/plugins/modal';
import { getDeviceTypeLabel, getSwitchStatusLabel, getSwitchStatusOption, useDeviceTypeDict } from './constants';
const route = useRoute();
const router = useRouter();
const { loading, withLoading } = useLoading(true);
const device = ref<Partial<DeviceVO>>({});
/** 设备类型字典(后端 ur_device_type 维护,只有电表/水表) */
const deviceTypeDict = useDeviceTypeDict();
/** 电表、水表分别用不同图标,其余统一用采集器图标 */
const deviceIcon = computed(() => {
if (String(device.value.deviceType) === '0') return 'Lightning';
if (String(device.value.deviceType) === '1') return 'Drizzling';
return 'Monitor';
});
const merchantText = computed(() => device.value.merchantName || device.value.merchantId || '—');
const landlordText = computed(() => device.value.landlordName || '—');
const installText = computed(() => device.value.installLocation || '—');
/** 顶部横幅标题:优先房间名,没有则退到安装位置、设备名称 */
const bannerTitle = computed(() => device.value.roomName || device.value.installAddress || device.value.deviceName || '—');
/** 控制状态标签配色 */
const switchStatusTagType = computed(() => {
const tagType = getSwitchStatusOption(device.value.switchStatus)?.elTagType as 'success' | 'danger' | 'warning' | 'info' | 'primary';
return tagType || 'info';
});
/** 计量单位:电表按度、水表按吨,优先后端 unitName(0度、1吨) */
const quantityUnit = computed(() => {
if (String(device.value.unitName) === '0') return '度';
if (String(device.value.unitName) === '1') return '吨';
return String(device.value.deviceType) === '1' ? '吨' : '度';
});
const totalLabel = computed(() => (quantityUnit.value === '吨' ? '总用水量' : '总电量'));
/** 设备离线:展示最后在线时间与离线时长 */
const isOffline = computed(() => String(device.value.switchStatus) === '3');
const valueOrDash = (value?: string | number | null) => (value === undefined || value === null || value === '' ? '—' : value);
const formatQuantity = (value?: number | null) =>
value === undefined || value === null ? '—' : `${value}${quantityUnit.value}`;
const formatPrice = (value?: number | null) =>
value === undefined || value === null ? '—' : `${value} 元/${quantityUnit.value}`;
const formatAmount = (value?: number | null) => (value === undefined || value === null ? '—' : `${value} 元`);
/** 返回上一页(设备列表) */
const goBack = () => {
router.back();
};
/** 查询设备详情 */
const getDetail = async () => {
const deviceId = route.query.deviceId as string | undefined;
if (!deviceId) {
modal.msgError('缺少设备ID,请从设备列表进入');
loading.value = false;
return;
}
await withLoading(async () => {
const res = await getDevice(deviceId);
device.value = res.data || {};
});
};
onMounted(() => {
getDetail();
});
</script>
<style lang="scss" scoped>
@use '@/assets/styles/components/page-shell' as pageShell;
.detail-header {
display: flex;
align-items: center;
gap: 4px;
padding: 2px 4px;
}
.back-button {
color: var(--el-text-color-primary);
:deep(.el-icon) {
font-weight: 700;
}
}
.detail-title {
margin: 0;
font-size: 18px;
font-weight: 700;
color: var(--el-text-color-primary);
}
.detail-banner {
display: flex;
align-items: center;
gap: 16px;
padding: 18px 20px;
border-radius: 12px;
background: linear-gradient(90deg, #eaf1ff 0%, #f5f9ff 100%);
}
.device-avatar {
display: flex;
flex: 0 0 56px;
align-items: center;
justify-content: center;
width: 56px;
height: 56px;
border-radius: 12px;
background: #356dff;
color: #fff;
}
.banner-title {
font-size: 18px;
font-weight: 700;
color: var(--el-text-color-primary);
}
.banner-meta {
margin-top: 6px;
font-size: 12px;
color: var(--el-text-color-secondary);
}
.detail-section {
margin-top: 28px;
}
/* 离线提示区块用浅底色区分,便于一眼看到异常信息 */
.detail-section--panel {
padding: 16px 20px;
border-radius: 12px;
.section-title {
margin-bottom: 14px;
font-size: 15px;
}
&.is-offline {
background: var(--el-fill-color-light);
}
}
.detail-footer {
display: flex;
justify-content: center;
padding: 4px 0 8px;
}
.section-title {
margin: 0 0 18px;
font-size: 16px;
font-weight: 700;
color: var(--el-text-color-primary);
}
.detail-grid {
display: grid;
grid-template-columns: repeat(2, minmax(0, 1fr));
row-gap: 20px;
column-gap: 32px;
}
.detail-item {
display: flex;
align-items: center;
gap: 8px;
min-width: 0;
font-size: 14px;
}
.detail-label {
flex: 0 0 auto;
font-weight: 700;
color: var(--el-text-color-primary);
&::after {
content: ':';
}
}
.detail-value {
color: var(--el-text-color-regular);
word-break: break-all;
}
@media (max-width: 768px) {
.detail-grid {
grid-template-columns: minmax(0, 1fr);
}
}
</style>

View File

@@ -0,0 +1,425 @@
<template>
<div class="p-2 app-container deviceManage-device-page">
<div class="search-wrap">
<el-card shadow="hover" class="search-panel" :class="{ 'is-collapsed': !showSearch }">
<template #header>
<div class="panel-heading search-panel-toggle" @click.stop="showSearch = !showSearch">
<div><h3>筛选条件</h3></div>
</div>
</template>
<el-form ref="queryFormRef" :model="queryParams" :inline="true" class="query-form">
<el-form-item label="设备编号" prop="deviceNo">
<el-input v-model="queryParams.deviceNo" placeholder="请输入设备编号" clearable @keyup.enter="handleQuery" />
</el-form-item>
<el-form-item label="设备名称" prop="deviceName">
<el-input v-model="queryParams.deviceName" placeholder="请输入设备名称" clearable @keyup.enter="handleQuery" />
</el-form-item>
<el-form-item label="设备类型" prop="deviceType">
<el-select v-model="queryParams.deviceType" placeholder="全部类型" clearable>
<el-option v-for="item in deviceTypeDict" :key="item.value" :label="item.label" :value="item.value" />
</el-select>
</el-form-item>
<el-form-item label="状态" prop="switchStatus">
<el-select v-model="queryParams.switchStatus" placeholder="全部状态" clearable>
<el-option v-for="item in switchStatusOptions" :key="item.value" :label="item.label" :value="item.value" />
</el-select>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
</el-form-item>
</el-form>
</el-card>
</div>
<el-card shadow="hover" class="table-panel">
<template #header>
<div class="toolbar-shell">
<div class="table-heading">
<h3>设备列表</h3>
</div>
<div class="toolbar-actions">
<el-button type="primary" plain icon="Plus" @click="handleAdd" v-hasPermi="['deviceManage:device:add']">添加设备</el-button>
<el-button type="info" plain icon="Document" @click="handleImportTemplate" v-hasPermi="['deviceManage:device:import']">下载导入模板</el-button>
<el-button type="success" plain icon="Upload" @click="handleImport" v-hasPermi="['deviceManage:device:import']">批量导入</el-button>
<el-button type="warning" plain icon="Download" @click="handleExport" v-hasPermi="['deviceManage:device:export']">批量导出</el-button>
<!-- <el-button type="danger" plain icon="Delete" :disabled="multiple" @click="handleDelete()" v-hasPermi="['deviceManage:device:remove']">删除</el-button> -->
<right-toolbar v-model:show-search="showSearch" :search="false" @query-table="getList"></right-toolbar>
</div>
</div>
</template>
<el-table v-loading="loading" border class="data-table" :data="deviceList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="设备编号" align="center" prop="deviceNo" min-width="140" show-overflow-tooltip />
<el-table-column label="设备名称" align="center" prop="deviceName" min-width="140" show-overflow-tooltip />
<el-table-column label="设备类型" align="center" min-width="100">
<template #default="scope">{{ getDeviceTypeLabel(deviceTypeDict, scope.row.deviceType) }}</template>
</el-table-column>
<el-table-column label="所属商户" align="center" min-width="130" show-overflow-tooltip>
<template #default="scope">{{ scope.row.merchantName || scope.row.merchantId || '—' }}</template>
</el-table-column>
<el-table-column label="剩余金额" align="center" min-width="110">
<template #default="scope">
<span v-if="scope.row.remainingBalance == null" class="text-muted">—</span>
<span v-else class="amount-text">{{ scope.row.remainingBalance }}</span>
</template>
</el-table-column>
<el-table-column label="状态" align="center" min-width="110">
<template #default="scope">
<span class="switch-status" :class="getSwitchStatusClass(scope.row.switchStatus)">
{{ getSwitchStatusLabel(scope.row.switchStatus) }}
</span>
</template>
</el-table-column>
<el-table-column label="单价" align="center" prop="currentUnitPrice" min-width="90" />
<el-table-column label="操作" align="center" width="270" fixed="right">
<template #default="scope">
<div class="table-actions">
<el-button link type="primary" @click="handleView(scope.row)">详情</el-button>
<el-button link type="primary" @click="handleUpdate(scope.row)" v-hasPermi="['deviceManage:device:edit']">编辑</el-button>
<!-- 离线设备只保留详情/编辑;清零、抄表、拉闸仅电表/水表支持 -->
<template v-if="canControl(scope.row)">
<el-button link type="primary" @click="handleClear(scope.row)">清零</el-button>
<el-button link type="primary" @click="handleReadMeter(scope.row)">抄表</el-button>
<!-- 已拉闸(强制/欠费)只显示恢复,正常状态才显示拉闸;水表恢复用供水措辞 -->
<el-button v-if="isCutOff(scope.row)" link type="success" @click="handleSwitch(scope.row)">
{{ getRestoreLabel(scope.row.deviceType) }}
</el-button>
<el-button v-else link type="warning" @click="handleSwitch(scope.row)">拉闸</el-button>
</template>
<!-- <el-button link type="danger" @click="handleDelete(scope.row)" v-hasPermi="['deviceManage:device:remove']">删除</el-button> -->
</div>
</template>
</el-table-column>
</el-table>
<pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize" @pagination="getList" />
</el-card>
<!-- 添加或修改智能水电设备对话框 -->
<DeviceFormDialog ref="deviceFormRef" @success="getList" />
<!-- 抄表对话框 -->
<MeterReadingDialog ref="meterReadingRef" @success="getList" />
<!-- 设备导入对话框:POST /deviceManage/device/importData -->
<el-dialog v-model="upload.open" :title="upload.title" width="420px" append-to-body>
<el-upload
ref="uploadRef"
:limit="1"
accept=".xlsx, .xls"
:disabled="upload.isUploading"
:http-request="uploadFile"
:auto-upload="false"
drag
>
<el-icon class="el-icon--upload">
<UploadFilled />
</el-icon>
<div class="el-upload__text">
将文件拖到此处,或
<em>点击上传</em>
</div>
<template #tip>
<div class="el-upload__tip text-center">仅允许导入 xls、xlsx 格式文件。</div>
</template>
</el-upload>
<template #footer>
<div class="dialog-footer">
<el-button type="primary" @click="submitFileForm">确 定</el-button>
<el-button @click="upload.open = false">取 消</el-button>
</div>
</template>
</el-dialog>
</div>
</template>
<script setup name="Device" lang="ts">
import {
delDevice,
forceOffDevice,
importDeviceData,
listDevice,
resetDevice,
restoreDevice
} from '@/api/deviceManage/device';
import { DeviceQuery, DeviceVO } from '@/api/deviceManage/device/types';
import { useLoading } from '@/hooks/async/useLoading';
import { useSearchReset } from '@/hooks/form/useSearchReset';
import { useSearchToggle } from '@/hooks/form/useSearchToggle';
import { useTableSelection } from '@/hooks/table/useTableSelection';
import modal from '@/plugins/modal';
import { download as requestDownload } from '@/utils/request';
import { useRouter } from 'vue-router';
import DeviceFormDialog from './components/DeviceFormDialog.vue';
import MeterReadingDialog from './components/MeterReadingDialog.vue';
import {
CUT_OFF_STATUS,
METER_TYPES,
getDeviceTypeLabel,
getRestoreLabel,
getSwitchStatusClass,
getSwitchStatusLabel,
isWaterMeter,
switchStatusOptions,
useDeviceTypeDict
} from './constants';
const router = useRouter();
/** 设备类型字典(后端 ur_device_type 维护,只有电表/水表) */
const deviceTypeDict = useDeviceTypeDict();
const deviceList = ref<DeviceVO[]>([]);
const { loading, withLoading } = useLoading(true);
const { showSearch } = useSearchToggle();
const total = ref(0);
const queryFormRef = ref<ElFormInstance>();
const deviceFormRef = ref<InstanceType<typeof DeviceFormDialog>>();
const meterReadingRef = ref<InstanceType<typeof MeterReadingDialog>>();
const uploadRef = ref<ElUploadInstance>();
/** 设备导入弹窗状态(上传请求见 importDeviceData) */
const upload = reactive({
open: false,
title: '',
isUploading: false
});
const queryParams = ref<DeviceQuery>({
pageNum: 1,
pageSize: 10,
merchantId: undefined,
roomId: undefined,
deviceNo: undefined,
deviceName: undefined,
deviceType: undefined,
communicationType: undefined,
unitName: undefined,
qrCode: undefined,
remainingBalance: undefined,
currentQuantity: undefined,
currentPower: undefined,
currentUnitPrice: undefined,
switchStatus: undefined,
onlineStatus: undefined,
status: undefined,
createBy: undefined,
updateBy: undefined
});
const { ids, multiple, handleSelectionChange } = useTableSelection<DeviceVO>(item => item.deviceId);
/** 是否支持清零/抄表/拉闸:仅电表、水表,且设备不在离线状态 */
const canControl = (row: Partial<DeviceVO>) => {
return METER_TYPES.includes(String(row.deviceType)) && String(row.switchStatus) !== '3';
};
/** 是否处于拉闸状态,拉闸后操作列为“恢复供电” */
const isCutOff = (row: Partial<DeviceVO>) => CUT_OFF_STATUS.includes(String(row.switchStatus));
/** 查询智能水电设备列表 */
const getList = async () => {
await withLoading(async () => {
const res = await listDevice(queryParams.value);
deviceList.value = res.data?.rows;
total.value = res.data?.total;
});
};
/** 搜索按钮操作 */
const handleQuery = () => {
queryParams.value.pageNum = 1;
getList();
};
const { resetQuery } = useSearchReset({
queryFormRef,
queryParams,
pageNumKey: 'pageNum',
pageSizeKey: 'pageSize',
initialPageSize: 10,
afterReset: () => {
handleQuery();
}
});
/** 新增按钮操作 */
const handleAdd = () => {
deviceFormRef.value?.openDialog();
};
/** 修改按钮操作 */
const handleUpdate = (row?: Partial<DeviceVO>) => {
const deviceId = row?.deviceId || ids.value[0];
deviceFormRef.value?.openDialog(deviceId);
};
/** 详情按钮操作:跳转到设备详情页 */
const handleView = (row: Partial<DeviceVO>) => {
router.push({ path: '/device/deviceDetail', query: { deviceId: String(row.deviceId) } });
};
/** 删除按钮操作 */
const handleDelete = async (row?: Partial<DeviceVO>) => {
const deviceIds = row?.deviceId || ids.value;
await modal.confirm('是否确认删除智能水电设备编号为"' + deviceIds + '"的数据项?');
await delDevice(deviceIds);
modal.msgSuccess('删除成功');
await getList();
};
/** 导出按钮操作 */
const handleExport = () => {
requestDownload(
'deviceManage/device/export',
{
...queryParams.value
},
`device_${new Date().getTime()}.xlsx`
);
};
/** 清零按钮操作 */
const handleClear = async (row: Partial<DeviceVO>) => {
const quantityText = isWaterMeter(row.deviceType) ? '总用水量和剩余水量' : '总电量和剩余电量';
await modal.confirm(`是否确认清零设备"${row.deviceName || row.deviceNo}"的余额/用量?\n清零后${quantityText}将归零,此操作不可撤销`);
// 清零走独立接口:POST /deviceManage/device/{deviceId}/reset
await resetDevice(row.deviceId as string | number);
modal.msgSuccess('清零成功');
await getList();
};
/** 抄表按钮操作:打开抄表弹窗 */
const handleReadMeter = (row: Partial<DeviceVO>) => {
meterReadingRef.value?.openDialog(row);
};
/** 拉闸 / 恢复按钮操作:水表说供水,电表说供电 */
const handleSwitch = async (row: Partial<DeviceVO>) => {
const deviceLabel = row.deviceName || row.deviceNo;
// 已拉闸的设备走恢复接口:POST /deviceManage/device/{deviceId}/restore
if (isCutOff(row)) {
const restoreLabel = getRestoreLabel(row.deviceType);
await modal.confirm(`是否确认对设备"${deviceLabel}"执行${restoreLabel}?\n${restoreLabel}后用户可以正常使用`);
await restoreDevice(row.deviceId as string | number);
modal.msgSuccess(`${restoreLabel}成功`);
await getList();
return;
}
const cutOffHint = `拉闸后该设备将停止${isWaterMeter(row.deviceType) ? '供水' : '供电'}`;
await modal.confirm(`是否确认对设备"${deviceLabel}"执行拉闸?\n${cutOffHint},用户无法正常使用。恢复需要管理员手动操作`);
await forceOffDevice(row.deviceId as string | number);
modal.msgSuccess('拉闸成功');
await getList();
};
/** 导入按钮操作 */
const handleImport = () => {
upload.title = '设备导入';
upload.open = true;
};
/** 下载导入模板(POST /deviceManage/device/importTemplate) */
const handleImportTemplate = () => {
requestDownload('deviceManage/device/importTemplate', {}, `设备导入模板.xlsx`);
};
/** 后端导入结果可能带 html 换行,转成纯文本再弹窗 */
const formatImportResultMessage = (message: unknown) => {
return String(message ?? '')
.replace(/<br\s*\/?>/gi, '\n')
.replace(/&nbsp;/gi, ' ')
.replace(/<[^>]+>/g, '');
};
/** 自定义上传:走统一 axios 实例(自动带 token,失败由拦截器提示) */
const uploadFile = async (options: { file: File }) => {
upload.isUploading = true;
try {
const res: any = await importDeviceData(options.file);
upload.open = false;
uploadRef.value?.clearFiles();
ElMessageBox.alert(formatImportResultMessage(res?.msg), '导入结果', {
customClass: 'import-result-box'
});
getList();
} finally {
upload.isUploading = false;
}
};
/** 提交上传文件 */
const submitFileForm = () => {
uploadRef.value?.submit();
};
onMounted(() => {
getList();
});
</script>
<style lang="scss" scoped>
@use '@/assets/styles/components/page-shell' as pageShell;
@include pageShell.table-crud-page;
.data-table {
/* 操作列用文字按钮,覆盖 pageShell 默认的 32x32 图标按钮样式 */
:deep(.table-actions) {
display: flex;
flex-wrap: wrap;
align-items: center;
justify-content: center;
gap: 4px 10px;
}
/* 全局 _search-panel.scss 给 .data-table 内的 link 按钮加了 28x28 圆角底色且带 !important,
这里必须同样用 !important 才能覆盖成纯文字按钮 */
:deep(.table-actions .el-button.is-link) {
width: auto !important;
min-width: auto !important;
height: auto !important;
padding: 0 !important;
border-radius: 0 !important;
background: transparent !important;
font-size: 13px;
font-weight: 500;
}
:deep(.table-actions .el-button.is-link + .el-button.is-link) {
margin-left: 0 !important;
}
.amount-text {
color: var(--el-color-primary);
font-variant-numeric: tabular-nums;
}
.text-muted {
color: var(--el-text-color-placeholder);
}
.switch-status {
font-size: 13px;
font-weight: 500;
}
.switch-status--success {
color: var(--el-color-success);
}
.switch-status--danger {
color: var(--el-color-danger);
}
.switch-status--warning {
color: var(--el-color-warning);
}
.switch-status--info {
color: var(--el-text-color-secondary);
}
}
</style>

View File

@@ -0,0 +1,189 @@
<template>
<div class="p-2 app-container help-user-index-page">
<div class="search-wrap">
<el-card shadow="hover" class="search-panel" :class="{ 'is-collapsed': !showSearch }">
<template #header>
<div class="panel-heading search-panel-toggle" @click.stop="showSearch = !showSearch">
<div>
<span class="panel-kicker">Search Filters</span>
<h3>筛选条件</h3>
</div>
</div>
</template>
<el-form ref="queryFormRef" :model="queryParams" :inline="true" class="query-form">
<el-form-item label="帮助标题" prop="title">
<el-input v-model="queryParams.title" placeholder="请输入帮助标题" clearable @keyup.enter="handleQuery" />
</el-form-item>
<el-form-item label="分类" prop="category">
<el-select v-model="queryParams.category" placeholder="请选择分类" clearable>
<el-option v-for="item in categoryOptions" :key="item.value" :label="item.label" :value="item.value" />
</el-select>
</el-form-item>
<el-form-item label="状态" prop="status">
<el-select v-model="queryParams.status" placeholder="请选择状态" clearable>
<el-option v-for="item in statusOptions" :key="item.value" :label="item.label" :value="item.value" />
</el-select>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
</el-form-item>
</el-form>
</el-card>
</div>
<el-card shadow="hover" class="table-panel">
<template #header>
<div class="toolbar-shell">
<div class="table-heading">
<span class="panel-kicker">Help Dataset</span>
<h3>用户帮助</h3>
<p>共 {{ total }} 条记录,支持按分类和状态筛选。</p>
</div>
<div class="toolbar-actions">
<!-- 帮助模块的接口与菜单尚未建立,权限标识待后端约定后再补 v-hasPermi -->
<el-button type="primary" plain icon="Plus" @click="notImplemented">新增</el-button>
<el-button type="success" plain icon="Edit" :disabled="single" @click="notImplemented">修改</el-button>
<el-button type="danger" plain icon="Delete" :disabled="multiple" @click="notImplemented">删除</el-button>
<right-toolbar v-model:show-search="showSearch" :search="false" @query-table="getList"></right-toolbar>
</div>
</div>
</template>
<el-table v-loading="loading" :data="helpList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="50" align="center" />
<el-table-column label="帮助标题" prop="title" align="center" min-width="220" show-overflow-tooltip />
<el-table-column label="分类" prop="category" align="center" width="120">
<template #default="scope">
<dict-tag :options="categoryOptions" :value="scope.row.category" />
</template>
</el-table-column>
<el-table-column label="排序" prop="sortNo" align="center" width="90" />
<el-table-column label="状态" prop="status" align="center" width="100">
<template #default="scope">
<dict-tag :options="statusOptions" :value="scope.row.status" />
</template>
</el-table-column>
<el-table-column label="更新时间" prop="updateTime" align="center" width="170" />
<el-table-column label="备注" prop="remark" align="center" min-width="140" show-overflow-tooltip />
<el-table-column label="操作" align="center" width="150" fixed="right">
<template #default>
<el-tooltip content="详情" placement="top">
<el-button link type="primary" icon="View" @click="notImplemented"></el-button>
</el-tooltip>
<el-tooltip content="修改" placement="top">
<el-button link type="primary" icon="Edit" @click="notImplemented"></el-button>
</el-tooltip>
<el-tooltip content="删除" placement="top">
<el-button link type="primary" icon="Delete" @click="notImplemented"></el-button>
</el-tooltip>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total > 0"
v-model:page="queryParams.pageNum"
v-model:limit="queryParams.pageSize"
:total="total"
@pagination="getList"
/>
</el-card>
</div>
</template>
<script setup name="HelpUser" lang="ts">
import { useLoading } from '@/hooks/async/useLoading';
import { useSearchReset } from '@/hooks/form/useSearchReset';
import { useSearchToggle } from '@/hooks/form/useSearchToggle';
import { useTableSelection } from '@/hooks/table/useTableSelection';
import modal from '@/plugins/modal';
/** 用户帮助(面向住户端的说明文档) */
interface HelpVO {
/** 帮助ID */
helpId?: string;
/** 帮助标题 */
title?: string;
/** 分类(1充值说明 2故障报修 3水费电价 4其他) */
category?: string;
/** 排序 */
sortNo?: number;
/** 状态(0发布 1停用) */
status?: string;
/** 更新时间 */
updateTime?: string;
/** 备注 */
remark?: string;
}
interface HelpQuery extends PageQuery {
title?: string;
category?: string;
status?: string;
}
// 帮助字典后端尚未建立,先用本地兜底选项
const categoryOptions: DictDataOption[] = [
{ label: '充值说明', value: '1', elTagType: 'primary' },
{ label: '故障报修', value: '2', elTagType: 'warning' },
{ label: '水费电价', value: '3', elTagType: 'success' },
{ label: '其他', value: '4', elTagType: 'info' }
];
const statusOptions: DictDataOption[] = [
{ label: '发布', value: '0', elTagType: 'success' },
{ label: '停用', value: '1', elTagType: 'danger' }
];
const helpList = ref<HelpVO[]>([]);
const total = ref(0);
const queryFormRef = ref<ElFormInstance>();
const { showSearch } = useSearchToggle();
const { loading, withLoading } = useLoading(true);
const { single, multiple, handleSelectionChange } = useTableSelection<HelpVO>(item => item.helpId);
const queryParams = ref<HelpQuery>({
pageNum: 1,
pageSize: 10,
title: '',
category: '',
status: ''
});
/** 查询用户帮助列表 */
const getList = async () => {
// TODO: 帮助接口就绪后替换为真实请求,例如 listHelp(queryParams.value) 取 res.data.rows / res.data.total
await withLoading(async () => {
helpList.value = [];
total.value = 0;
});
};
/** 搜索按钮操作 */
const handleQuery = () => {
queryParams.value.pageNum = 1;
getList();
};
const { resetQuery } = useSearchReset({
queryFormRef,
queryParams,
pageNumKey: 'pageNum',
afterReset: () => {
handleQuery();
}
});
/** 尚未接入的写操作统一提示,避免静默失败 */
const notImplemented = () => modal.msgWarning('帮助接口待接入,暂不支持该操作');
onMounted(() => {
getList();
});
</script>
<style lang="scss" scoped>
@use '@/assets/styles/components/page-shell' as pageShell;
@include pageShell.table-crud-page;
</style>

View File

@@ -0,0 +1,189 @@
<template>
<div class="p-2 app-container income-index-page">
<div class="search-wrap">
<el-card shadow="hover" class="search-panel" :class="{ 'is-collapsed': !showSearch }">
<template #header>
<div class="panel-heading search-panel-toggle" @click.stop="showSearch = !showSearch">
<div>
<span class="panel-kicker">Search Filters</span>
<h3>筛选条件</h3>
</div>
</div>
</template>
<el-form ref="queryFormRef" :model="queryParams" :inline="true" class="query-form">
<el-form-item label="充值流水号" prop="orderNo">
<el-input v-model="queryParams.orderNo" placeholder="请输入充值流水号" clearable @keyup.enter="handleQuery" />
</el-form-item>
<el-form-item label="商户名称" prop="merchantName">
<el-input v-model="queryParams.merchantName" placeholder="请输入商户名称" clearable @keyup.enter="handleQuery" />
</el-form-item>
<el-form-item label="支付方式" prop="payType">
<el-select v-model="queryParams.payType" placeholder="请选择支付方式" clearable>
<el-option v-for="item in payTypeOptions" :key="item.value" :label="item.label" :value="item.value" />
</el-select>
</el-form-item>
<el-form-item label="收入时间" style="width: 308px">
<el-date-picker
v-model="dateRangeIncomeTime"
value-format="YYYY-MM-DD HH:mm:ss"
type="daterange"
range-separator="-"
start-placeholder="开始日期"
end-placeholder="结束日期"
:default-time="[new Date(2000, 1, 1, 0, 0, 0), new Date(2000, 1, 1, 23, 59, 59)]"
></el-date-picker>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
</el-form-item>
</el-form>
</el-card>
</div>
<el-card shadow="hover" class="table-panel">
<template #header>
<div class="toolbar-shell">
<div class="table-heading">
<span class="panel-kicker">Income Dataset</span>
<h3>收入明细</h3>
<p>共 {{ total }} 条记录,支持按商户、支付方式和收入时间筛选。</p>
</div>
<div class="toolbar-actions">
<!-- 收入模块的接口与菜单尚未建立,权限标识待后端约定后再补 v-hasPermi -->
<el-button type="primary" plain icon="Download" @click="notImplemented">导出</el-button>
<right-toolbar v-model:show-search="showSearch" :search="false" @query-table="getList"></right-toolbar>
</div>
</div>
</template>
<el-table v-loading="loading" :data="incomeList">
<el-table-column label="充值流水号" prop="orderNo" align="center" min-width="180" show-overflow-tooltip />
<el-table-column label="商户名称" prop="merchantName" align="center" min-width="140" show-overflow-tooltip />
<el-table-column label="设备编号" prop="deviceNo" align="center" min-width="140" show-overflow-tooltip />
<el-table-column label="用户名称" prop="userName" align="center" min-width="120" show-overflow-tooltip />
<el-table-column label="充值金额(元)" prop="amount" align="center" width="130" />
<el-table-column label="支付方式" prop="payType" align="center" width="110">
<template #default="scope">
<dict-tag :options="payTypeOptions" :value="scope.row.payType" />
</template>
</el-table-column>
<el-table-column label="收入时间" prop="incomeTime" align="center" width="170" />
<el-table-column label="备注" prop="remark" align="center" min-width="140" show-overflow-tooltip />
</el-table>
<pagination
v-show="total > 0"
v-model:page="queryParams.pageNum"
v-model:limit="queryParams.pageSize"
:total="total"
@pagination="getList"
/>
</el-card>
</div>
</template>
<script setup name="Income" lang="ts">
import { useLoading } from '@/hooks/async/useLoading';
import { useDateRangeQuery } from '@/hooks/form/useDateRangeQuery';
import { useSearchReset } from '@/hooks/form/useSearchReset';
import { useSearchToggle } from '@/hooks/form/useSearchToggle';
import modal from '@/plugins/modal';
/** 充值收入流水明细(只读台账) */
interface IncomeVO {
/** 收入ID */
incomeId?: string;
/** 充值流水号 */
orderNo?: string;
/** 商户名称 */
merchantName?: string;
/** 设备编号 */
deviceNo?: string;
/** 用户名称 */
userName?: string;
/** 充值金额(元) */
amount?: number;
/** 支付方式(1微信 2支付宝 3现金 4余额) */
payType?: string;
/** 收入时间 */
incomeTime?: string;
/** 备注 */
remark?: string;
}
interface IncomeQuery extends PageQuery {
orderNo?: string;
merchantName?: string;
payType?: string;
}
// 支付方式字典后端尚未建立,先用本地兜底选项
const payTypeOptions: DictDataOption[] = [
{ label: '微信', value: '1', elTagType: 'success' },
{ label: '支付宝', value: '2', elTagType: 'primary' },
{ label: '现金', value: '3', elTagType: 'warning' },
{ label: '余额', value: '4', elTagType: 'info' }
];
const incomeList = ref<IncomeVO[]>([]);
const total = ref(0);
const queryFormRef = ref<ElFormInstance>();
const { showSearch } = useSearchToggle();
const { loading, withLoading } = useLoading(true);
const {
dateRange: dateRangeIncomeTime,
applyDateRange: applyIncomeTimeDateRange,
resetDateRange: resetIncomeTimeDateRange
} = useDateRangeQuery('IncomeTime');
const queryParams = ref<IncomeQuery>({
pageNum: 1,
pageSize: 10,
orderNo: '',
merchantName: '',
payType: ''
});
/** 查询收入明细列表 */
const getList = async () => {
// 把「收入时间」区间写进 queryParams.params(beginIncomeTime / endIncomeTime)
applyIncomeTimeDateRange(queryParams.value);
await withLoading(async () => {
// TODO: 收入接口就绪后替换为真实请求,例如 listIncome(queryParams.value) 取 res.data.rows / res.data.total
incomeList.value = [];
total.value = 0;
});
};
/** 搜索按钮操作 */
const handleQuery = () => {
queryParams.value.pageNum = 1;
getList();
};
const { resetQuery } = useSearchReset({
queryFormRef,
queryParams,
pageNumKey: 'pageNum',
resetExtras: () => {
resetIncomeTimeDateRange();
},
afterReset: () => {
handleQuery();
}
});
/** 尚未接入的写操作统一提示,避免静默失败 */
const notImplemented = () => modal.msgWarning('收入接口待接入,暂不支持该操作');
onMounted(() => {
getList();
});
</script>
<style lang="scss" scoped>
@use '@/assets/styles/components/page-shell' as pageShell;
@include pageShell.table-crud-page;
</style>

View File

@@ -0,0 +1,191 @@
<template>
<div class="p-2 app-container merchant-index-page">
<div class="search-wrap">
<el-card shadow="hover" class="search-panel" :class="{ 'is-collapsed': !showSearch }">
<template #header>
<div class="panel-heading search-panel-toggle" @click.stop="showSearch = !showSearch">
<div>
<span class="panel-kicker">Search Filters</span>
<h3>筛选条件</h3>
</div>
</div>
</template>
<el-form ref="queryFormRef" :model="queryParams" :inline="true" class="query-form">
<el-form-item label="商户名称" prop="merchantName">
<el-input v-model="queryParams.merchantName" placeholder="请输入商户名称" clearable @keyup.enter="handleQuery" />
</el-form-item>
<el-form-item label="联系人" prop="contactName">
<el-input v-model="queryParams.contactName" placeholder="请输入联系人" clearable @keyup.enter="handleQuery" />
</el-form-item>
<el-form-item label="联系电话" prop="contactPhone">
<el-input v-model="queryParams.contactPhone" placeholder="请输入联系电话" clearable @keyup.enter="handleQuery" />
</el-form-item>
<el-form-item label="状态" prop="status">
<el-select v-model="queryParams.status" placeholder="请选择状态" clearable>
<el-option v-for="item in statusOptions" :key="item.value" :label="item.label" :value="item.value" />
</el-select>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
</el-form-item>
</el-form>
</el-card>
</div>
<el-card shadow="hover" class="table-panel">
<template #header>
<div class="toolbar-shell">
<div class="table-heading">
<span class="panel-kicker">Merchant Dataset</span>
<h3>商户列表</h3>
<p>共 {{ total }} 条记录,支持按联系人和状态筛选。</p>
</div>
<div class="toolbar-actions">
<!-- 商户模块的接口与菜单尚未建立,权限标识待后端约定后再补 v-hasPermi -->
<el-button type="primary" plain icon="Plus" @click="notImplemented">新增</el-button>
<el-button type="success" plain icon="Edit" :disabled="single" @click="notImplemented">修改</el-button>
<el-button type="danger" plain icon="Delete" :disabled="multiple" @click="notImplemented">删除</el-button>
<right-toolbar v-model:show-search="showSearch" :search="false" @query-table="getList"></right-toolbar>
</div>
</div>
</template>
<el-table v-loading="loading" :data="merchantList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="50" align="center" />
<el-table-column label="商户编号" prop="merchantNo" align="center" min-width="140" show-overflow-tooltip />
<el-table-column label="商户名称" prop="merchantName" align="center" min-width="160" show-overflow-tooltip />
<el-table-column label="联系人" prop="contactName" align="center" width="120" />
<el-table-column label="联系电话" prop="contactPhone" align="center" width="130" />
<el-table-column label="设备数量" prop="deviceCount" align="center" width="100" />
<el-table-column label="用户数量" prop="userCount" align="center" width="100" />
<el-table-column label="状态" prop="status" align="center" width="100">
<template #default="scope">
<dict-tag :options="statusOptions" :value="scope.row.status" />
</template>
</el-table-column>
<el-table-column label="创建时间" prop="createTime" align="center" width="170" />
<el-table-column label="备注" prop="remark" align="center" min-width="140" show-overflow-tooltip />
<el-table-column label="操作" align="center" width="150" fixed="right">
<template #default>
<el-tooltip content="详情" placement="top">
<el-button link type="primary" icon="View" @click="notImplemented"></el-button>
</el-tooltip>
<el-tooltip content="修改" placement="top">
<el-button link type="primary" icon="Edit" @click="notImplemented"></el-button>
</el-tooltip>
<el-tooltip content="删除" placement="top">
<el-button link type="primary" icon="Delete" @click="notImplemented"></el-button>
</el-tooltip>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total > 0"
v-model:page="queryParams.pageNum"
v-model:limit="queryParams.pageSize"
:total="total"
@pagination="getList"
/>
</el-card>
</div>
</template>
<script setup name="Merchant" lang="ts">
import { useLoading } from '@/hooks/async/useLoading';
import { useSearchReset } from '@/hooks/form/useSearchReset';
import { useSearchToggle } from '@/hooks/form/useSearchToggle';
import { useTableSelection } from '@/hooks/table/useTableSelection';
import modal from '@/plugins/modal';
/** 多商户(物业/房东等经营主体) */
interface MerchantVO {
/** 商户ID */
merchantId?: string;
/** 商户编号 */
merchantNo?: string;
/** 商户名称 */
merchantName?: string;
/** 联系人 */
contactName?: string;
/** 联系电话 */
contactPhone?: string;
/** 名下设备数量 */
deviceCount?: number;
/** 名下用户数量 */
userCount?: number;
/** 状态(0正常 1停用) */
status?: string;
/** 创建时间 */
createTime?: string;
/** 备注 */
remark?: string;
}
interface MerchantQuery extends PageQuery {
merchantName?: string;
contactName?: string;
contactPhone?: string;
status?: string;
}
// 商户状态字典后端尚未建立,先用本地兜底选项
const statusOptions: DictDataOption[] = [
{ label: '正常', value: '0', elTagType: 'success' },
{ label: '停用', value: '1', elTagType: 'danger' }
];
const merchantList = ref<MerchantVO[]>([]);
const total = ref(0);
const queryFormRef = ref<ElFormInstance>();
const { showSearch } = useSearchToggle();
const { loading, withLoading } = useLoading(true);
const { single, multiple, handleSelectionChange } = useTableSelection<MerchantVO>(item => item.merchantId);
const queryParams = ref<MerchantQuery>({
pageNum: 1,
pageSize: 10,
merchantName: '',
contactName: '',
contactPhone: '',
status: ''
});
/** 查询商户列表 */
const getList = async () => {
// TODO: 商户接口就绪后替换为真实请求,例如 listMerchant(queryParams.value) 取 res.data.rows / res.data.total
await withLoading(async () => {
merchantList.value = [];
total.value = 0;
});
};
/** 搜索按钮操作 */
const handleQuery = () => {
queryParams.value.pageNum = 1;
getList();
};
const { resetQuery } = useSearchReset({
queryFormRef,
queryParams,
pageNumKey: 'pageNum',
afterReset: () => {
handleQuery();
}
});
/** 尚未接入的写操作统一提示,避免静默失败 */
const notImplemented = () => modal.msgWarning('商户接口待接入,暂不支持该操作');
onMounted(() => {
getList();
});
</script>
<style lang="scss" scoped>
@use '@/assets/styles/components/page-shell' as pageShell;
@include pageShell.table-crud-page;
</style>

View File

@@ -0,0 +1,212 @@
<template>
<div class="p-2 app-container withdrawal-index-page">
<div class="search-wrap">
<el-card shadow="hover" class="search-panel" :class="{ 'is-collapsed': !showSearch }">
<template #header>
<div class="panel-heading search-panel-toggle" @click.stop="showSearch = !showSearch">
<div>
<span class="panel-kicker">Search Filters</span>
<h3>筛选条件</h3>
</div>
</div>
</template>
<el-form ref="queryFormRef" :model="queryParams" :inline="true" class="query-form">
<el-form-item label="提现单号" prop="orderNo">
<el-input v-model="queryParams.orderNo" placeholder="请输入提现单号" clearable @keyup.enter="handleQuery" />
</el-form-item>
<el-form-item label="商户名称" prop="merchantName">
<el-input v-model="queryParams.merchantName" placeholder="请输入商户名称" clearable @keyup.enter="handleQuery" />
</el-form-item>
<el-form-item label="审核状态" prop="auditStatus">
<el-select v-model="queryParams.auditStatus" placeholder="请选择审核状态" clearable>
<el-option v-for="item in auditStatusOptions" :key="item.value" :label="item.label" :value="item.value" />
</el-select>
</el-form-item>
<el-form-item label="申请时间" style="width: 308px">
<el-date-picker
v-model="dateRangeApplyTime"
value-format="YYYY-MM-DD HH:mm:ss"
type="daterange"
range-separator="-"
start-placeholder="开始日期"
end-placeholder="结束日期"
:default-time="[new Date(2000, 1, 1, 0, 0, 0), new Date(2000, 1, 1, 23, 59, 59)]"
></el-date-picker>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
</el-form-item>
</el-form>
</el-card>
</div>
<el-card shadow="hover" class="table-panel">
<template #header>
<div class="toolbar-shell">
<div class="table-heading">
<span class="panel-kicker">Withdrawal Dataset</span>
<h3>提现审核</h3>
<p>共 {{ total }} 条记录,支持按商户、审核状态和申请时间筛选。</p>
</div>
<div class="toolbar-actions">
<!-- 提现模块的接口与菜单尚未建立,权限标识待后端约定后再补 v-hasPermi -->
<el-button type="primary" plain icon="Check" :disabled="multiple" @click="notImplemented">批量审核</el-button>
<el-button type="warning" plain icon="Download" @click="notImplemented">导出</el-button>
<right-toolbar v-model:show-search="showSearch" :search="false" @query-table="getList"></right-toolbar>
</div>
</div>
</template>
<el-table v-loading="loading" :data="withdrawalList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="50" align="center" />
<el-table-column label="提现单号" prop="orderNo" align="center" min-width="180" show-overflow-tooltip />
<el-table-column label="商户名称" prop="merchantName" align="center" min-width="140" show-overflow-tooltip />
<el-table-column label="提现金额(元)" prop="amount" align="center" width="130" />
<el-table-column label="手续费(元)" prop="fee" align="center" width="110" />
<el-table-column label="到账金额(元)" prop="actualAmount" align="center" width="130" />
<el-table-column label="收款账户" prop="account" align="center" min-width="160" show-overflow-tooltip />
<el-table-column label="审核状态" prop="auditStatus" align="center" width="110">
<template #default="scope">
<dict-tag :options="auditStatusOptions" :value="scope.row.auditStatus" />
</template>
</el-table-column>
<el-table-column label="申请时间" prop="applyTime" align="center" width="170" />
<el-table-column label="审核时间" prop="auditTime" align="center" width="170" />
<el-table-column label="备注" prop="remark" align="center" min-width="140" show-overflow-tooltip />
<el-table-column label="操作" align="center" width="180" fixed="right">
<template #default="scope">
<el-tooltip content="详情" placement="top">
<el-button link type="primary" icon="View" @click="notImplemented"></el-button>
</el-tooltip>
<el-tooltip content="审核通过" placement="top">
<el-button link type="success" icon="Check" :disabled="scope.row.auditStatus !== '0'" @click="notImplemented"></el-button>
</el-tooltip>
<el-tooltip content="驳回" placement="top">
<el-button link type="danger" icon="Close" :disabled="scope.row.auditStatus !== '0'" @click="notImplemented"></el-button>
</el-tooltip>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total > 0"
v-model:page="queryParams.pageNum"
v-model:limit="queryParams.pageSize"
:total="total"
@pagination="getList"
/>
</el-card>
</div>
</template>
<script setup name="Withdrawal" lang="ts">
import { useLoading } from '@/hooks/async/useLoading';
import { useDateRangeQuery } from '@/hooks/form/useDateRangeQuery';
import { useSearchReset } from '@/hooks/form/useSearchReset';
import { useSearchToggle } from '@/hooks/form/useSearchToggle';
import { useTableSelection } from '@/hooks/table/useTableSelection';
import modal from '@/plugins/modal';
/** 商户提现申请(审核台账) */
interface WithdrawalVO {
/** 提现ID */
withdrawalId?: string;
/** 提现单号 */
orderNo?: string;
/** 商户名称 */
merchantName?: string;
/** 提现金额(元) */
amount?: number;
/** 手续费(元) */
fee?: number;
/** 到账金额(元) */
actualAmount?: number;
/** 收款账户 */
account?: string;
/** 审核状态(0待审核 1已通过 2已驳回 3已打款) */
auditStatus?: string;
/** 申请时间 */
applyTime?: string;
/** 审核时间 */
auditTime?: string;
/** 备注 */
remark?: string;
}
interface WithdrawalQuery extends PageQuery {
orderNo?: string;
merchantName?: string;
auditStatus?: string;
}
// 审核状态字典后端尚未建立,先用本地兜底选项
const auditStatusOptions: DictDataOption[] = [
{ label: '待审核', value: '0', elTagType: 'warning' },
{ label: '已通过', value: '1', elTagType: 'success' },
{ label: '已驳回', value: '2', elTagType: 'danger' },
{ label: '已打款', value: '3', elTagType: 'primary' }
];
const withdrawalList = ref<WithdrawalVO[]>([]);
const total = ref(0);
const queryFormRef = ref<ElFormInstance>();
const { showSearch } = useSearchToggle();
const { loading, withLoading } = useLoading(true);
const { multiple, handleSelectionChange } = useTableSelection<WithdrawalVO>(item => item.withdrawalId);
const {
dateRange: dateRangeApplyTime,
applyDateRange: applyApplyTimeDateRange,
resetDateRange: resetApplyTimeDateRange
} = useDateRangeQuery('ApplyTime');
const queryParams = ref<WithdrawalQuery>({
pageNum: 1,
pageSize: 10,
orderNo: '',
merchantName: '',
auditStatus: ''
});
/** 查询提现申请列表 */
const getList = async () => {
// 把「申请时间」区间写进 queryParams.params(beginApplyTime / endApplyTime)
applyApplyTimeDateRange(queryParams.value);
await withLoading(async () => {
// TODO: 提现接口就绪后替换为真实请求,例如 listWithdrawal(queryParams.value) 取 res.data.rows / res.data.total
withdrawalList.value = [];
total.value = 0;
});
};
/** 搜索按钮操作 */
const handleQuery = () => {
queryParams.value.pageNum = 1;
getList();
};
const { resetQuery } = useSearchReset({
queryFormRef,
queryParams,
pageNumKey: 'pageNum',
resetExtras: () => {
resetApplyTimeDateRange();
},
afterReset: () => {
handleQuery();
}
});
/** 尚未接入的写操作统一提示,避免静默失败 */
const notImplemented = () => modal.msgWarning('提现接口待接入,暂不支持该操作');
onMounted(() => {
getList();
});
</script>
<style lang="scss" scoped>
@use '@/assets/styles/components/page-shell' as pageShell;
@include pageShell.table-crud-page;
</style>

View File

@@ -1,106 +1,105 @@
<template> <template>
<div class="login"> <div class="login">
<div class="login-shell"> <!-- 左侧品牌区 -->
<el-form ref="loginRef" :model="loginForm" :rules="loginRules" class="login-form"> <section class="login-brand">
<div class="title-box"> <header class="brand-head">
<div> <span class="brand-mark">
<p class="eyebrow">Workspace Sign In</p> <el-icon :size="26"><Drizzling /></el-icon>
<h3 class="title">{{ title }}</h3> </span>
<p class="subtitle">使用当前账号体系登录到业务工作台。</p> <span class="brand-name">{{ title }}</span>
</header>
<div class="brand-copy">
<p class="brand-eyebrow">智慧计量 · 在线充值缴费 · 数据管控</p>
<h1 class="brand-headline">一体化水电缴费与计量管理后台</h1>
<p class="brand-desc">
面向物业、园区、公寓与宿舍场景,提供远程抄表、账单生成、在线缴费、欠费管控与用电用水量分析的一站式解决方案。
</p>
</div> </div>
<lang-select /> </section>
<!-- 右侧登录区 -->
<section class="login-panel">
<el-form
ref="loginRef"
:model="loginForm"
:rules="loginRules"
label-position="top"
hide-required-asterisk
class="login-form"
@submit.prevent
>
<div class="form-head">
<h2 class="form-title">管理员登录</h2>
<p class="form-subtitle">请输入您的管理员账号和密码登录系统</p>
</div> </div>
<el-form-item prop="username"> <el-form-item prop="username" label="管理员账号">
<el-input <el-input v-model="loginForm.username" size="large" autocomplete="username">
v-model="loginForm.username"
type="text"
size="large"
auto-complete="off"
:placeholder="$t('login.username')"
>
<template #prefix><svg-icon icon-class="user" class="el-input__icon input-icon" /></template> <template #prefix><svg-icon icon-class="user" class="el-input__icon input-icon" /></template>
</el-input> </el-input>
</el-form-item> </el-form-item>
<el-form-item prop="password"> <el-form-item prop="password" label="登录密码">
<el-input <el-input
v-model="loginForm.password" v-model="loginForm.password"
type="password" type="password"
size="large" size="large"
auto-complete="off" show-password
:placeholder="$t('login.password')" autocomplete="current-password"
@keyup.enter="handleLogin" @keyup.enter="handleLogin"
> >
<template #prefix><svg-icon icon-class="password" class="el-input__icon input-icon" /></template> <template #prefix><svg-icon icon-class="password" class="el-input__icon input-icon" /></template>
</el-input> </el-input>
</el-form-item> </el-form-item>
<el-form-item v-if="captchaEnabled" prop="code" class="captcha-row"> <el-form-item v-if="captchaEnabled" prop="code" label="验证码" class="captcha-row">
<el-input <el-input v-model="loginForm.code" size="large" autocomplete="off" @keyup.enter="handleLogin">
v-model="loginForm.code"
size="large"
auto-complete="off"
:placeholder="$t('login.code')"
@keyup.enter="handleLogin"
>
<template #prefix><svg-icon icon-class="validCode" class="el-input__icon input-icon" /></template> <template #prefix><svg-icon icon-class="validCode" class="el-input__icon input-icon" /></template>
</el-input> </el-input>
<div class="login-code"> <div class="login-code">
<img :src="codeUrl" class="login-code-img" @click="getCode" /> <img :src="codeUrl" class="login-code-img" alt="验证码" @click="getCode" />
</div> </div>
</el-form-item> </el-form-item>
<div class="form-meta"> <div class="form-meta">
<el-checkbox v-model="loginForm.rememberMe">{{ $t('login.rememberPassword') }}</el-checkbox> <el-checkbox v-model="loginForm.rememberMe">记住账号</el-checkbox>
<router-link v-if="register" class="link-type" :to="'/register'"> <router-link v-if="register" class="link-type" :to="'/register'">立即注册</router-link>
{{ $t('login.switchRegisterPage') }}
</router-link>
</div> </div>
<!-- <div class="social-panel">
<span class="social-label">第三方登录</span>
<div class="social-actions">
<el-button circle :title="$t('login.social.wechat')" @click="doSocialLogin('wechat')">
<svg-icon icon-class="wechat" />
</el-button>
<el-button circle :title="$t('login.social.maxkey')" @click="doSocialLogin('maxkey')">
<svg-icon icon-class="maxkey" />
</el-button>
<el-button circle :title="$t('login.social.topiam')" @click="doSocialLogin('topiam')">
<svg-icon icon-class="topiam" />
</el-button>
<el-button circle :title="$t('login.social.gitee')" @click="doSocialLogin('gitee')">
<svg-icon icon-class="gitee" />
</el-button>
<el-button circle :title="$t('login.social.github')" @click="doSocialLogin('github')">
<svg-icon icon-class="github" />
</el-button>
</div>
</div> -->
<el-form-item class="submit-row"> <el-form-item class="submit-row">
<el-button :loading="loading" size="large" type="primary" class="submit-button" @click.prevent="handleLogin"> <el-button :loading="loading" size="large" type="primary" class="submit-button" @click.prevent="handleLogin">
<span v-if="!loading">{{ $t('login.login') }}</span> <span v-if="!loading">登 录</span>
<span v-else>{{ $t('login.logging') }}</span> <span v-else>登 录 中...</span>
</el-button> </el-button>
</el-form-item> </el-form-item>
</el-form>
</div>
<div class="el-login-footer"> <div class="security">
<span>Copyright © 2018-{{ currentYear }} 疯狂的狮子Li All Rights Reserved.</span> <p class="security-label">安全提示</p>
<div class="security-card">
<p class="security-title">
<el-icon :size="16"><CircleCheckFilled /></el-icon>
<span>安全登录须知</span>
</p>
<ul class="security-list">
<li>仅限授权管理员登录,禁止共享账号</li>
<li>连续 5 次密码错误,账号将被锁定 30 分钟</li>
<li>长时间无操作将自动退出登录</li>
</ul>
</div> </div>
</div> </div>
</el-form>
<p class="login-footer">Copyright © 2018-{{ currentYear }} 疯狂的狮子Li All Rights Reserved.</p>
</section>
</div>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import { to } from 'await-to-js'; import { to } from 'await-to-js';
import { useI18n } from 'vue-i18n'; import { useI18n } from 'vue-i18n';
import { getCodeImg } from '@/api/login'; import { getCodeImg } from '@/api/login';
import { authRouterUrl } from '@/api/system/social/auth';
import { LoginData } from '@/api/types'; import { LoginData } from '@/api/types';
import { HttpStatus } from '@/enums/RespEnum';
import { useUserStore } from '@/store/modules/user'; import { useUserStore } from '@/store/modules/user';
const title = import.meta.env.VITE_APP_TITLE; const title = import.meta.env.VITE_APP_TITLE;
@@ -201,23 +200,13 @@ const getLoginData = () => {
const rememberMe = localStorage.getItem('rememberMe'); const rememberMe = localStorage.getItem('rememberMe');
localStorage.removeItem('password'); localStorage.removeItem('password');
loginForm.value = { loginForm.value = {
// 仅回填勾选“记住密码”时保存的用户名,密码一律不回填 // 仅回填勾选“记住账号”时保存的用户名,密码一律不回填
username: username === null ? '' : username, username: username === null ? '' : username,
password: '', password: '',
rememberMe: rememberMe === 'true' rememberMe: rememberMe === 'true'
} as LoginData; } as LoginData;
}; };
const doSocialLogin = (type: string) => {
authRouterUrl(type).then((res: any) => {
if (res.code === HttpStatus.SUCCESS) {
window.location.href = res.data;
} else {
ElMessage.error(res.msg);
}
});
};
onMounted(() => { onMounted(() => {
getCode(); getCode();
getLoginData(); getLoginData();
@@ -226,94 +215,192 @@ onMounted(() => {
<style lang="scss" scoped> <style lang="scss" scoped>
.login { .login {
min-height: 100%;
display: flex; display: flex;
align-items: center; min-height: 100vh;
justify-content: center; background: var(--app-surface-bg);
padding: 40px 24px 88px; color: var(--app-text-title);
background:
radial-gradient(circle at 12% 12%, rgba(53, 109, 255, 0.22), transparent 24%),
radial-gradient(circle at 88% 18%, rgba(14, 165, 233, 0.18), transparent 24%),
linear-gradient(135deg, #071120 0%, #0f1b33 42%, #15345f 100%);
} }
.login-shell { /* ---------- 左侧品牌区 ---------- */
width: min(1180px, 100%); .login-brand {
display: grid; position: relative;
grid-template-columns: minmax(0, 440px); display: flex;
flex: 0 0 46%;
flex-direction: column;
max-width: 820px;
padding: 44px 56px 56px;
overflow: hidden;
color: #fff;
background: linear-gradient(160deg, #123a56 0%, #0f3350 46%, #0a2740 100%);
/* 右上角柔光,避免大面积纯色显得死板 */
&::after {
position: absolute;
top: -160px;
right: -140px;
width: 460px;
height: 460px;
content: '';
pointer-events: none;
background: radial-gradient(circle, rgba(96, 165, 250, 0.28), transparent 66%);
}
}
.brand-head {
position: relative;
z-index: 1;
display: flex;
align-items: center;
gap: 14px;
}
.brand-mark {
display: inline-flex;
align-items: center;
justify-content: center; justify-content: center;
gap: 26px; width: 46px;
align-items: stretch; height: 46px;
color: #cfe2ff;
background: rgba(255, 255, 255, 0.12);
border: 1px solid rgba(255, 255, 255, 0.2);
border-radius: 12px;
}
.brand-name {
font-size: 22px;
font-weight: 700;
letter-spacing: 0.02em;
}
.brand-copy {
position: relative;
z-index: 1;
max-width: 520px;
margin-top: clamp(64px, 15vh, 150px);
}
.brand-eyebrow {
margin: 0 0 18px;
font-size: 13px;
font-weight: 700;
letter-spacing: 0.08em;
color: #a9c6e8;
}
.brand-headline {
margin: 0 0 20px;
font-size: clamp(26px, 2.6vw, 34px);
font-weight: 700;
line-height: 1.32;
letter-spacing: 0.01em;
}
.brand-desc {
margin: 0;
font-size: 14px;
line-height: 1.9;
color: rgba(226, 238, 250, 0.72);
}
/* ---------- 右侧登录区 ---------- */
.login-panel {
display: flex;
flex: 1 1 auto;
flex-direction: column;
align-items: center;
justify-content: center;
gap: 24px;
padding: 48px 32px;
background: var(--app-surface-bg);
} }
.login-form { .login-form {
width: 100%; width: 100%;
border-radius: 28px; max-width: 460px;
border: 1px solid rgba(255, 255, 255, 0.14);
box-shadow: 0 30px 80px rgba(2, 8, 23, 0.32);
backdrop-filter: blur(18px);
padding: 34px 30px 26px;
z-index: 1;
background: var(--app-surface-bg);
} }
.title-box { .form-head {
display: flex; margin-bottom: 26px;
align-items: flex-start;
justify-content: space-between;
gap: 12px;
margin-bottom: 28px;
.eyebrow {
margin: 0 0 8px;
color: var(--app-accent-strong);
font-size: 12px;
font-weight: 700;
letter-spacing: 0.08em;
text-transform: uppercase;
} }
.title { .form-title {
margin: 0; margin: 0;
color: var(--app-text-title); font-size: 26px;
font-weight: 700; font-weight: 700;
font-size: 30px; letter-spacing: -0.01em;
letter-spacing: -0.03em; color: var(--app-text-title);
} }
.subtitle { .form-subtitle {
margin: 8px 0 0; margin: 10px 0 0;
color: var(--app-text-muted); font-size: 13px;
font-size: 14px;
line-height: 1.7; line-height: 1.7;
}
:deep(.lang-select--style) {
line-height: 0;
color: var(--app-text-muted); color: var(--app-text-muted);
padding: 10px;
border-radius: 14px;
background: var(--app-elevated-soft-bg);
border: 1px solid var(--app-surface-border);
}
} }
.login-form .el-input { .login-form :deep(.el-form-item) {
height: 48px; margin-bottom: 20px;
} }
.login-form .input-icon { .login-form :deep(.el-form-item__label) {
height: 46px; padding: 0 0 8px;
width: 14px; font-size: 13px;
margin-left: 0; font-weight: 600;
line-height: 1.4;
color: var(--app-text-title);
} }
.captcha-row { .login-form :deep(.el-input__wrapper) {
:deep(.el-form-item__content) { min-height: 48px;
padding: 0 14px;
background-color: var(--app-surface-bg);
border-radius: 10px;
box-shadow: 0 0 0 1px var(--app-surface-border) inset;
}
.login-form :deep(.el-input__wrapper:hover) {
box-shadow: 0 0 0 1px rgba(64, 158, 255, 0.45) inset;
}
.login-form :deep(.el-input__wrapper.is-focus) {
box-shadow:
0 0 0 1px rgba(64, 158, 255, 0.6) inset,
0 0 0 4px rgba(64, 158, 255, 0.1);
}
.login-form :deep(.input-icon) {
width: 16px;
height: 16px;
margin-right: 8px;
color: var(--app-text-muted);
fill: currentcolor;
}
/* 聚焦时图标跟随主色,弱化输入框里的黑白图标感 */
.login-form :deep(.el-input__wrapper.is-focus) .input-icon {
fill: var(--app-accent-strong);
}
.captcha-row :deep(.el-form-item__content) {
display: grid; display: grid;
grid-template-columns: minmax(0, 1fr) 122px; grid-template-columns: minmax(0, 1fr) 124px;
gap: 12px; gap: 12px;
} }
.login-code {
height: 48px;
overflow: hidden;
background: var(--app-surface-bg);
border: 1px solid var(--app-surface-border);
border-radius: 10px;
img {
display: block;
width: 100%;
height: 100%;
object-fit: cover;
cursor: pointer;
}
} }
.form-meta { .form-meta {
@@ -321,32 +408,11 @@ onMounted(() => {
align-items: center; align-items: center;
justify-content: space-between; justify-content: space-between;
gap: 12px; gap: 12px;
margin: -2px 0 18px; margin: -4px 0 22px;
} }
.social-panel { .login-form :deep(.el-checkbox__label) {
display: flex;
align-items: center;
justify-content: space-between;
gap: 16px;
padding: 14px 16px;
margin-bottom: 22px;
border-radius: 20px;
background: var(--app-elevated-soft-bg);
border: 1px solid var(--app-surface-border);
}
.social-label {
color: var(--app-text-muted); color: var(--app-text-muted);
font-size: 13px;
font-weight: 600;
}
.social-actions {
display: flex;
flex-wrap: wrap;
justify-content: flex-end;
gap: 8px;
} }
.submit-row { .submit-row {
@@ -355,97 +421,137 @@ onMounted(() => {
.submit-button { .submit-button {
width: 100%; width: 100%;
height: 50px; height: 48px;
border-radius: 16px; font-size: 15px;
box-shadow: 0 18px 34px rgba(53, 109, 255, 0.22); font-weight: 600;
letter-spacing: 0.12em;
border-radius: 10px;
box-shadow: 0 14px 28px rgba(64, 158, 255, 0.22);
} }
.login-form :deep(.el-input__wrapper) { /* ---------- 安全提示 ---------- */
min-height: 48px; .security {
background-color: var(--el-bg-color); margin-top: 34px;
border-radius: 16px;
box-shadow: 0 0 0 1px var(--app-surface-border) inset;
} }
.login-form :deep(.el-input__wrapper.is-focus) { .security-label {
box-shadow: margin: 0 0 14px;
0 0 0 1px rgba(53, 109, 255, 0.24) inset, font-size: 13px;
0 0 0 4px rgba(53, 109, 255, 0.12); text-align: center;
}
.login-form :deep(.el-checkbox__label) {
color: var(--app-text-muted); color: var(--app-text-muted);
} }
.login-form :deep(.el-button.is-circle) { .security-card {
background: var(--app-elevated-soft-bg); padding: 16px 18px;
border: 1px solid var(--app-surface-border); background: var(--app-accent-soft);
color: var(--app-text-muted); border-radius: 10px;
} }
.login-form :deep(.el-button.is-circle:hover) { .security-title {
background: rgba(53, 109, 255, 0.12); display: flex;
border-color: rgba(53, 109, 255, 0.2); align-items: center;
gap: 6px;
margin: 0 0 12px;
font-size: 13px;
font-weight: 700;
color: var(--app-accent-strong); color: var(--app-accent-strong);
} }
.login-code { .security-list {
height: 48px; margin: 0;
box-sizing: border-box; padding: 0;
border-radius: 16px; list-style: none;
overflow: hidden;
background: var(--el-bg-color);
border: 1px solid var(--app-surface-border);
img { li {
cursor: pointer; position: relative;
vertical-align: middle; padding-left: 16px;
display: block; margin-bottom: 8px;
width: 100%; font-size: 13px;
height: 100%; line-height: 1.6;
object-fit: cover; color: var(--app-accent-strong);
&::before {
position: absolute;
top: 8px;
left: 2px;
width: 5px;
height: 5px;
content: '';
background: currentcolor;
border-radius: 50%;
}
&:last-child {
margin-bottom: 0;
}
} }
} }
.el-login-footer { .login-footer {
height: 40px; margin: 0;
line-height: 40px;
position: fixed;
bottom: 0;
width: 100%;
text-align: center;
color: rgba(226, 232, 240, 0.68);
font-size: 12px; font-size: 12px;
letter-spacing: 0.08em; text-align: center;
color: var(--app-text-muted);
letter-spacing: 0.04em;
} }
.login-code-img { /* 矮屏笔记本(约 1366×768 及以下)压缩纵向留白,避免表单溢出首屏 */
height: 48px; @media (max-height: 740px) and (min-width: 961px) {
padding-left: 0; .login-panel {
padding: 28px 32px;
gap: 16px;
} }
.form-head {
margin-bottom: 20px;
}
.login-form :deep(.el-form-item) {
margin-bottom: 16px;
}
.security {
margin-top: 24px;
}
.brand-copy {
margin-top: clamp(40px, 8vh, 90px);
}
}
/* ---------- 响应式:窄屏下品牌区收成顶部条 ---------- */
@media (max-width: 960px) { @media (max-width: 960px) {
.login { .login {
padding: 24px 14px 80px; flex-direction: column;
}
.login-brand {
flex: 0 0 auto;
max-width: none;
padding: 24px 24px 28px;
}
.brand-copy {
margin-top: 24px;
}
.brand-headline {
font-size: 22px;
}
.brand-desc {
display: none;
}
.login-panel {
justify-content: flex-start;
padding: 32px 20px 40px;
} }
} }
@media (max-width: 640px) { @media (max-width: 640px) {
.login-form { .brand-name {
padding: 26px 18px 20px; font-size: 18px;
}
.title-box {
flex-direction: column;
}
.social-panel {
flex-direction: column;
align-items: flex-start;
}
.social-actions {
justify-content: flex-start;
} }
.captcha-row :deep(.el-form-item__content) { .captcha-row :deep(.el-form-item__content) {

View File

@@ -0,0 +1,199 @@
<template>
<div class="p-2 app-container service-phone-index-page">
<div class="search-wrap">
<el-card shadow="hover" class="search-panel" :class="{ 'is-collapsed': !showSearch }">
<template #header>
<div class="panel-heading search-panel-toggle" @click.stop="showSearch = !showSearch">
<div>
<span class="panel-kicker">Search Filters</span>
<h3>筛选条件</h3>
</div>
</div>
</template>
<el-form ref="queryFormRef" :model="queryParams" :inline="true" class="query-form">
<el-form-item label="名称" prop="name">
<el-input v-model="queryParams.name" placeholder="请输入名称" clearable @keyup.enter="handleQuery" />
</el-form-item>
<el-form-item label="电话" prop="phone">
<el-input v-model="queryParams.phone" placeholder="请输入电话" clearable @keyup.enter="handleQuery" />
</el-form-item>
<el-form-item label="类型" prop="phoneType">
<el-select v-model="queryParams.phoneType" placeholder="请选择类型" clearable>
<el-option v-for="item in phoneTypeOptions" :key="item.value" :label="item.label" :value="item.value" />
</el-select>
</el-form-item>
<el-form-item label="状态" prop="status">
<el-select v-model="queryParams.status" placeholder="请选择状态" clearable>
<el-option v-for="item in statusOptions" :key="item.value" :label="item.label" :value="item.value" />
</el-select>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
</el-form-item>
</el-form>
</el-card>
</div>
<el-card shadow="hover" class="table-panel">
<template #header>
<div class="toolbar-shell">
<div class="table-heading">
<span class="panel-kicker">Service Phone Dataset</span>
<h3>电话管理</h3>
<p>共 {{ total }} 条记录,用于维护住户端展示的客服/报修电话。</p>
</div>
<div class="toolbar-actions">
<!-- 电话模块的接口与菜单尚未建立,权限标识待后端约定后再补 v-hasPermi -->
<el-button type="primary" plain icon="Plus" @click="notImplemented">新增</el-button>
<el-button type="success" plain icon="Edit" :disabled="single" @click="notImplemented">修改</el-button>
<el-button type="danger" plain icon="Delete" :disabled="multiple" @click="notImplemented">删除</el-button>
<right-toolbar v-model:show-search="showSearch" :search="false" @query-table="getList"></right-toolbar>
</div>
</div>
</template>
<el-table v-loading="loading" :data="phoneList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="50" align="center" />
<el-table-column label="名称" prop="name" align="center" min-width="160" show-overflow-tooltip />
<el-table-column label="电话" prop="phone" align="center" width="150" />
<el-table-column label="类型" prop="phoneType" align="center" width="110">
<template #default="scope">
<dict-tag :options="phoneTypeOptions" :value="scope.row.phoneType" />
</template>
</el-table-column>
<el-table-column label="服务时间" prop="serviceTime" align="center" min-width="160" show-overflow-tooltip />
<el-table-column label="排序" prop="sortNo" align="center" width="90" />
<el-table-column label="状态" prop="status" align="center" width="100">
<template #default="scope">
<dict-tag :options="statusOptions" :value="scope.row.status" />
</template>
</el-table-column>
<el-table-column label="创建时间" prop="createTime" align="center" width="170" />
<el-table-column label="备注" prop="remark" align="center" min-width="140" show-overflow-tooltip />
<el-table-column label="操作" align="center" width="150" fixed="right">
<template #default>
<el-tooltip content="详情" placement="top">
<el-button link type="primary" icon="View" @click="notImplemented"></el-button>
</el-tooltip>
<el-tooltip content="修改" placement="top">
<el-button link type="primary" icon="Edit" @click="notImplemented"></el-button>
</el-tooltip>
<el-tooltip content="删除" placement="top">
<el-button link type="primary" icon="Delete" @click="notImplemented"></el-button>
</el-tooltip>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total > 0"
v-model:page="queryParams.pageNum"
v-model:limit="queryParams.pageSize"
:total="total"
@pagination="getList"
/>
</el-card>
</div>
</template>
<script setup name="ServicePhone" lang="ts">
import { useLoading } from '@/hooks/async/useLoading';
import { useSearchReset } from '@/hooks/form/useSearchReset';
import { useSearchToggle } from '@/hooks/form/useSearchToggle';
import { useTableSelection } from '@/hooks/table/useTableSelection';
import modal from '@/plugins/modal';
/** 客服/报修电话(住户端展示) */
interface ServicePhoneVO {
/** 电话ID */
phoneId?: string;
/** 名称 */
name?: string;
/** 电话 */
phone?: string;
/** 类型(1客服 2报修 3投诉) */
phoneType?: string;
/** 服务时间 */
serviceTime?: string;
/** 排序 */
sortNo?: number;
/** 状态(0正常 1停用) */
status?: string;
/** 创建时间 */
createTime?: string;
/** 备注 */
remark?: string;
}
interface ServicePhoneQuery extends PageQuery {
name?: string;
phone?: string;
phoneType?: string;
status?: string;
}
// 电话字典后端尚未建立,先用本地兜底选项
const phoneTypeOptions: DictDataOption[] = [
{ label: '客服', value: '1', elTagType: 'primary' },
{ label: '报修', value: '2', elTagType: 'warning' },
{ label: '投诉', value: '3', elTagType: 'danger' }
];
const statusOptions: DictDataOption[] = [
{ label: '正常', value: '0', elTagType: 'success' },
{ label: '停用', value: '1', elTagType: 'danger' }
];
const phoneList = ref<ServicePhoneVO[]>([]);
const total = ref(0);
const queryFormRef = ref<ElFormInstance>();
const { showSearch } = useSearchToggle();
const { loading, withLoading } = useLoading(true);
const { single, multiple, handleSelectionChange } = useTableSelection<ServicePhoneVO>(item => item.phoneId);
const queryParams = ref<ServicePhoneQuery>({
pageNum: 1,
pageSize: 10,
name: '',
phone: '',
phoneType: '',
status: ''
});
/** 查询电话列表 */
const getList = async () => {
// TODO: 电话接口就绪后替换为真实请求,例如 listServicePhone(queryParams.value) 取 res.data.rows / res.data.total
await withLoading(async () => {
phoneList.value = [];
total.value = 0;
});
};
/** 搜索按钮操作 */
const handleQuery = () => {
queryParams.value.pageNum = 1;
getList();
};
const { resetQuery } = useSearchReset({
queryFormRef,
queryParams,
pageNumKey: 'pageNum',
afterReset: () => {
handleQuery();
}
});
/** 尚未接入的写操作统一提示,避免静默失败 */
const notImplemented = () => modal.msgWarning('电话接口待接入,暂不支持该操作');
onMounted(() => {
getList();
});
</script>
<style lang="scss" scoped>
@use '@/assets/styles/components/page-shell' as pageShell;
@include pageShell.table-crud-page;
</style>