33 Commits

Author SHA1 Message Date
FLL
4819f881ed 收费管理
Some checks are pending
Gitea Actions Demo / Explore-Gitea-Actions (push) Waiting to run
2025-06-27 15:55:02 +08:00
FLL
01ddd1174a 综合管理 2025-06-27 15:16:06 +08:00
lxj
ca24234e57 Merge branch 'master' of http://47.109.37.87:3000/by2025/admin-vben5
All checks were successful
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 7m3s
# Conflicts:
#	packages/@core/base/shared/src/constants/dict-enum.ts
2025-06-26 22:03:17 +08:00
lxj
1bc8d02cec 增加人像页面 2025-06-26 22:02:40 +08:00
6f2e0be983 1、单元
All checks were successful
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 7m16s
2、房间
2025-06-26 18:04:51 +08:00
fyy
e06f8861cc Merge branch 'master' of http://47.109.37.87:3000/by2025/admin-vben5
Some checks failed
Gitea Actions Demo / Explore-Gitea-Actions (push) Has been cancelled
2025-06-26 18:03:07 +08:00
fyy
730d8ca6f2 feat: 更新保洁页面 2025-06-26 18:02:43 +08:00
FLL
8ecf6b03aa 小区,建筑,楼层
Some checks failed
Gitea Actions Demo / Explore-Gitea-Actions (push) Has been cancelled
2025-06-26 17:59:00 +08:00
FLL
2b10dc8fa2 Merge branch 'master' of http://47.109.37.87:3000/by2025/admin-vben5
All checks were successful
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 6m0s
# Conflicts:
#	apps/web-antd/vite.config.mts
2025-06-26 09:51:51 +08:00
FLL
8d3f5331a5 产品管理 2025-06-26 09:50:41 +08:00
fyy
f2a90584b2 Merge branch 'master' of http://47.109.37.87:3000/by2025/admin-vben5
All checks were successful
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 6m3s
2025-06-26 09:34:01 +08:00
fyy
b5c47bc3f9 feat: 初始化绿植养护租赁管理页面 2025-06-26 09:33:34 +08:00
0b192801ab 更新 .gitea/workflows/dev.yml
All checks were successful
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 6m55s
2025-06-25 16:37:37 +08:00
de569eb59a cicd
All checks were successful
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 6m47s
2025-06-25 16:25:03 +08:00
97a0417d50 Merge branch 'master' of http://47.109.37.87:3000/by2025/admin-vben5 2025-06-25 16:24:42 +08:00
fyy
7d5817ce33 Merge branch 'master' of http://47.109.37.87:3000/by2025/admin-vben5
Some checks are pending
Gitea Actions Demo / Explore-Gitea-Actions (push) Waiting to run
2025-06-25 16:20:35 +08:00
fyy
027ba5b2a3 Merge branch 'master' of http://47.109.37.87:3000/by2025/admin-vben5 2025-06-25 16:19:55 +08:00
0b31030317 baseUrl 2025-06-25 16:17:15 +08:00
FLL
7371da5f48 2
Some checks failed
Gitea Actions Demo / Explore-Gitea-Actions (push) Failing after 6m25s
2025-06-25 15:04:15 +08:00
FLL
652952e29c 1
Some checks failed
Gitea Actions Demo / Explore-Gitea-Actions (push) Has been cancelled
2025-06-25 14:40:35 +08:00
e1656bf104 Merge branch 'master' of http://47.109.37.87:3000/by2025/admin-vben5
Some checks failed
Gitea Actions Demo / Explore-Gitea-Actions (push) Failing after 6m9s
2025-06-25 11:38:30 +08:00
8d517b3133 资产审批 2025-06-25 11:37:28 +08:00
fyy
234c0f8096 Merge branch 'master' of http://47.109.37.87:3000/by2025/admin-vben5
Some checks failed
Gitea Actions Demo / Explore-Gitea-Actions (push) Failing after 6m9s
2025-06-25 11:18:22 +08:00
fyy
1c3016c44b feat: 新增绿植租赁管理菜单 2025-06-25 11:17:58 +08:00
f620debe43 Merge branch 'master' of http://47.109.37.87:3000/by2025/admin-vben5
Some checks failed
Gitea Actions Demo / Explore-Gitea-Actions (push) Failing after 6m15s
2025-06-25 09:51:31 +08:00
b802ff624b cicd 2025-06-25 09:50:50 +08:00
fae5d7877c 1、资产
Some checks failed
Gitea Actions Demo / Explore-Gitea-Actions (push) Has been cancelled
2025-06-25 09:46:22 +08:00
87331ab607 1、资产管理
Some checks are pending
Gitea Actions Demo / Explore-Gitea-Actions (push) Waiting to run
2025-06-25 09:42:38 +08:00
905fbb5f06 Merge branch 'master' of http://47.109.37.87:3000/by2025/admin-vben5
Some checks failed
Gitea Actions Demo / Explore-Gitea-Actions (push) Failing after 6m15s
2025-06-25 09:28:32 +08:00
15683799673
b2acba4114 增加人像库页面
Some checks failed
Gitea Actions Demo / Explore-Gitea-Actions (push) Failing after 5m48s
2025-06-25 00:37:48 +08:00
15683799673
9c08cca095 增加人像库
增加人像库图片
2025-06-24 23:55:59 +08:00
fyy
85975db5ee Merge branch 'master' of http://47.109.37.87:3000/by2025/admin-vben5
Some checks failed
Gitea Actions Demo / Explore-Gitea-Actions (push) Failing after 7m1s
2025-06-24 16:45:56 +08:00
fyy
a0f5599d92 feat: 设置一个保洁订单可选多个服务 2025-06-24 16:43:49 +08:00
85 changed files with 8729 additions and 509 deletions

View File

@@ -16,7 +16,8 @@ jobs:
- name: Build
run: pnpm build:antd
- name: cp
run: robocopy ./apps/web-antd/dist C:\devtool\nginx-1.28.0\html\web-antd /E
# run: robocopy ./apps/web-antd/dist C:\devtool\nginx-1.28.0\html\propety /E
run: Copy-Item -Path "./apps/web-antd/dist" -Destination "C:\devtool\nginx-1.28.0\html\property" -Recurse -Force -ErrorAction SilentlyContinue

View File

@@ -1,4 +1,4 @@
VITE_BASE=/
VITE_BASE=/property
# 是否开启压缩,可以设置为 none, brotli, gzip
VITE_COMPRESS=gzip

View File

@@ -0,0 +1,65 @@
import type { AssetTypeVO, AssetTypeForm, AssetTypeQuery } from './model';
import type { ID, IDS } from '#/api/common';
import type { PageResult } from '#/api/common';
import { commonExport } from '#/api/helper';
import { requestClient } from '#/api/request';
/**
* 查询资产类型列表
* @param params
* @returns 资产类型列表
*/
export function assetTypeList(params?: AssetTypeQuery) {
return requestClient.get<PageResult<AssetTypeVO>>('/property/assetType/list', { params });
}
export function assetTypeselect() {
return requestClient.get<AssetTypeVO[]>('/property/assetType/list');
}
/**
* 导出资产类型列表
* @param params
* @returns 资产类型列表
*/
export function assetTypeExport(params?: AssetTypeQuery) {
return commonExport('/property/assetType/export', params ?? {});
}
/**
* 查询资产类型详情
* @param id id
* @returns 资产类型详情
*/
export function assetTypeInfo(id: ID) {
return requestClient.get<AssetTypeVO>(`/property/assetType/${id}`);
}
/**
* 新增资产类型
* @param data
* @returns void
*/
export function assetTypeAdd(data: AssetTypeForm) {
return requestClient.postWithMsg<void>('/property/assetType', data);
}
/**
* 更新资产类型
* @param data
* @returns void
*/
export function assetTypeUpdate(data: AssetTypeForm) {
return requestClient.putWithMsg<void>('/property/assetType', data);
}
/**
* 删除资产类型
* @param id id
* @returns void
*/
export function assetTypeRemove(id: ID | IDS) {
return requestClient.deleteWithMsg<void>(`/property/assetType/${id}`);
}

View File

@@ -0,0 +1,64 @@
import type { PageQuery, BaseEntity } from '#/api/common';
export interface AssetTypeVO {
/**
* 主键
*/
id: string | number;
/**
* 分类名称
*/
assetTypeName: string;
/**
* 排序
*/
sort: number;
/**
* 创建时间
*/
createTime: string;
/**
* 创建人
*/
createBy: string;
}
export interface AssetTypeForm extends BaseEntity {
/**
* 主键
*/
id?: string | number;
/**
* 分类名称
*/
assetTypeName?: string;
/**
* 排序
*/
sort?: number;
}
export interface AssetTypeQuery extends PageQuery {
/**
* 分类名称
*/
assetTypeName?: string;
/**
* 排序
*/
sort?: number;
/**
* 日期范围参数
*/
params?: any;
}

View File

@@ -1,8 +1,6 @@
import type { BuildingVO, BuildingForm, BuildingQuery } from './model';
import type { ID, IDS } from '#/api/common';
import type { PageResult } from '#/api/common';
import { commonExport } from '#/api/helper';
import { requestClient } from '#/api/request';

View File

@@ -2,7 +2,7 @@ import type { PageQuery, BaseEntity } from '#/api/common';
export interface BuildingVO {
/**
*
*
*/
id: string | number;
@@ -135,7 +135,7 @@ export interface BuildingVO {
export interface BuildingForm extends BaseEntity {
/**
*
*
*/
id?: string | number;
@@ -397,3 +397,136 @@ export interface BuildingQuery extends PageQuery {
*/
params?: any;
}
export interface Building extends BaseEntity {
/**
* 园区编码
*/
communityCode?: string;
/**
* 建筑编码
*/
buildingCode?: string;
/**
* 建筑名称
*/
buildingName?: string;
/**
* 省
*/
province?: string;
/**
* 市
*/
city?: string;
/**
* 区
*/
district?: string;
/**
* 地址
*/
addr?: string;
/**
* 经度
*/
lon?: string;
/**
* 维度
*/
lat?: string;
/**
* 产权性质(1:自持2承租3自持+承租,4政府免费使用)
*/
cqxz?: number;
/**
* 不动产编号
*/
bdcbh?: string;
/**
* 产权编号
*/
cqbh?: string;
/**
* 图地编号
*/
tdbh?: string;
/**
* 建筑面积
*/
jzmj?: number;
/**
* 产权面积
*/
cqmj?: number;
/**
* 可租面积
*/
kzmj?: number;
/**
* 自用面积
*/
zymj?: number;
/**
* 配套面积
*/
ptmj?: number;
/**
* 车位面积
*/
cwmj?: number;
/**
* 标准层高
*/
bzcg?: number;
/**
* 排序字段
*/
sort?: number;
/**
* 组织编码
*/
orgCode?: string;
/**
* 数据状态1有效0无效
*/
dataState?: number;
/**
* 修改时间
*/
modifyTime?: string;
/**
* 搜索值
*/
searchValue?: string;
/**
* 日期范围参数
*/
params?: any;
}

View File

@@ -296,10 +296,10 @@ export interface BuildingQuery extends PageQuery {
*/
cqbh?: string;
/**
* 日期范围参数
*/
params?: any;
/**
* 日期范围参数
*/
params?: any;
}

View File

@@ -0,0 +1,59 @@
import type { OrderChargeVO, OrderChargeForm, OrderChargeQuery } from './model';
import type { ID, IDS } from '#/api/common';
import type { PageResult } from '#/api/common';
import { commonExport } from '#/api/helper';
import { requestClient } from '#/api/request';
/**
* 查询绿植租赁-订单收费列表
* @param params
* @returns 绿植租赁-订单收费列表
*/
export function orderChargeList(params?: OrderChargeQuery) {
return requestClient.get<PageResult<OrderChargeVO>>('/system/orderCharge/list', { params });
}
/**
* 导出绿植租赁-订单收费列表
* @param params
* @returns 绿植租赁-订单收费列表
*/
export function orderChargeExport(params?: OrderChargeQuery) {
return commonExport('/system/orderCharge/export', params ?? {});
}
/**
* 查询绿植租赁-订单收费详情
* @param id id
* @returns 绿植租赁-订单收费详情
*/
export function orderChargeInfo(id: ID) {
return requestClient.get<OrderChargeVO>(`/system/orderCharge/${id}`);
}
/**
* 新增绿植租赁-订单收费
* @param data
* @returns void
*/
export function orderChargeAdd(data: OrderChargeForm) {
return requestClient.postWithMsg<void>('/system/orderCharge', data);
}
/**
* 更新绿植租赁-订单收费
* @param data
* @returns void
*/
export function orderChargeUpdate(data: OrderChargeForm) {
return requestClient.putWithMsg<void>('/system/orderCharge', data);
}
/**
* 删除绿植租赁-订单收费
* @param id id
* @returns void
*/
export function orderChargeRemove(id: ID | IDS) {
return requestClient.deleteWithMsg<void>(`/system/orderCharge/${id}`);
}

View File

@@ -0,0 +1,204 @@
import type { PageQuery, BaseEntity } from '#/api/common';
export interface OrderChargeVO {
/**
* 主键
*/
id: string | number;
/**
* 订单id
*/
orderId: string | number;
/**
* 租赁人id系统用户
*/
userId: string | number;
/**
* 租赁人名称
*/
userName: string;
/**
* 租金
*/
rent: number;
/**
* 押金
*/
deposit: number;
/**
* 违约金
*/
penalty: number;
/**
* 总金额
*/
totalAmount: number;
/**
* 收费日期
*/
chargeDate: string;
/**
* 支付方式
*/
paymentMethod: number;
/**
* 开票状态
*/
invoiceStatus: number;
/**
* 发票类型
*/
invoiceType: number;
/**
* 收费状态
*/
chargeStatus: number;
}
export interface OrderChargeForm extends BaseEntity {
/**
* 主键
*/
id?: string | number;
/**
* 订单id
*/
orderId?: string | number;
/**
* 租赁人id系统用户
*/
userId?: string | number;
/**
* 租赁人名称
*/
userName?: string;
/**
* 租金
*/
rent?: number;
/**
* 押金
*/
deposit?: number;
/**
* 违约金
*/
penalty?: number;
/**
* 总金额
*/
totalAmount?: number;
/**
* 收费日期
*/
chargeDate?: string;
/**
* 支付方式
*/
paymentMethod?: number;
/**
* 开票状态
*/
invoiceStatus?: number;
/**
* 发票类型
*/
invoiceType?: number;
/**
* 收费状态
*/
chargeStatus?: number;
}
export interface OrderChargeQuery extends PageQuery {
/**
* 订单id
*/
orderId?: string | number;
/**
* 租赁人id系统用户
*/
userId?: string | number;
/**
* 租赁人名称
*/
userName?: string;
/**
* 租金
*/
rent?: number;
/**
* 押金
*/
deposit?: number;
/**
* 违约金
*/
penalty?: number;
/**
* 总金额
*/
totalAmount?: number;
/**
* 收费日期
*/
chargeDate?: string;
/**
* 支付方式
*/
paymentMethod?: number;
/**
* 开票状态
*/
invoiceStatus?: number;
/**
* 发票类型
*/
invoiceType?: number;
/**
* 收费状态
*/
chargeStatus?: number;
/**
* 日期范围参数
*/
params?: any;
}

View File

@@ -1,8 +1,6 @@
import type { CommunityVO, CommunityForm, CommunityQuery } from './model';
import type { ID, IDS } from '#/api/common';
import type { PageResult } from '#/api/common';
import { commonExport } from '#/api/helper';
import { requestClient } from '#/api/request';

View File

@@ -217,3 +217,75 @@ export interface CommunityQuery extends PageQuery {
*/
params?: any;
}
export interface Community extends BaseEntity {
/**
* 社区名称
*/
communityName?: string;
/**
* 社区编码
*/
communityCode?: string;
/**
* 社区类型 1园区2小区
*/
communityType?: number;
/**
* 省
*/
province?: string;
/**
* 市
*/
city?: string;
/**
* 区
*/
district?: string;
/**
* 地址
*/
addr?: string;
/**
* 经度
*/
lon?: string;
/**
* 维度
*/
lat?: string;
/**
* 小图图片
*/
img?: string;
/**
* 组织编码
*/
orgCode?: string;
/**
* 数据状态1有效0无效
*/
dataState?: number;
/**
* 修改时间
*/
modifyTime?: string;
/**
* 日期范围参数
*/
params?: any;
}

View File

@@ -1,8 +1,6 @@
import type { FloorVO, FloorForm, FloorQuery } from './model';
import type { ID, IDS } from '#/api/common';
import type { PageResult } from '#/api/common';
import { commonExport } from '#/api/helper';
import { requestClient } from '#/api/request';

View File

@@ -0,0 +1,59 @@
import type { PropertyVO, PropertyForm, PropertyQuery } from './model';
import type { ID, IDS } from '#/api/common';
import type { PageResult } from '#/api/common';
import { commonExport } from '#/api/helper';
import { requestClient } from '#/api/request';
/**
* 查询绿植租赁-绿植产品列表
* @param params
* @returns 绿植租赁-绿植产品列表
*/
export function plantsProductList(params?: PropertyQuery) {
return requestClient.get<PageResult<PropertyVO>>('/property/plantsProduct/list', { params });
}
/**
* 导出绿植租赁-绿植产品列表
* @param params
* @returns 绿植租赁-绿植产品列表
*/
export function plantsProductExport(params?: PropertyQuery) {
return commonExport('/property/plantsProduct/export', params ?? {});
}
/**
* 查询绿植租赁-绿植产品详情
* @param id id
* @returns 绿植租赁-绿植产品详情
*/
export function plantsProductInfo(id: ID) {
return requestClient.get<PropertyVO>(`/property/plantsProduct/${id}`);
}
/**
* 新增绿植租赁-绿植产品
* @param data
* @returns void
*/
export function plantsProductAdd(data: PropertyForm) {
return requestClient.postWithMsg<void>('/property/plantsProduct', data);
}
/**
* 更新绿植租赁-绿植产品
* @param data
* @returns void
*/
export function plantsProductUpdate(data: PropertyForm) {
return requestClient.putWithMsg<void>('/property/plantsProduct', data);
}
/**
* 删除绿植租赁-绿植产品
* @param id id
* @returns void
*/
export function plantsProductRemove(id: ID | IDS) {
return requestClient.deleteWithMsg<void>(`/property/plantsProduct/${id}`);
}

View File

@@ -0,0 +1,211 @@
import type { PageQuery, BaseEntity } from '#/api/common';
export interface PropertyVO {
/**
* 主键
*/
id: string | number;
/**
* 产品编号
*/
plantCode: string;
/**
* 产品名称
*/
plantName: string;
/**
* 产品分类
*/
plantType: number;
/**
* 产品图片
*/
imgPath: string;
/**
* 规格
*/
specification: string;
/**
* 租金
*/
rent: number;
/**
* 库存数量
*/
inventory: number;
/**
* 状态0下架 1上架
*/
state: number;
/**
* 备注
*/
remark: string;
}
export interface PropertyForm extends BaseEntity {
/**
* 主键
*/
id?: string | number;
/**
* 产品编号
*/
plantCode?: string;
/**
* 产品名称
*/
plantName?: string;
/**
* 产品分类
*/
plantType?: number;
/**
* 产品图片
*/
imgPath?: string;
/**
* 规格
*/
specification?: string;
/**
* 租金
*/
rent?: number;
/**
* 库存数量
*/
inventory?: number;
/**
* 状态0下架 1上架
*/
state?: number;
/**
* 备注
*/
remark?: string;
}
export interface PropertyQuery extends PageQuery {
/**
* 产品编号
*/
plantCode?: string;
/**
* 产品名称
*/
plantName?: string;
/**
* 产品分类
*/
plantType?: number;
/**
* 产品图片
*/
imgPath?: string;
/**
* 规格
*/
specification?: string;
/**
* 租金
*/
rent?: number;
/**
* 库存数量
*/
inventory?: number;
/**
* 状态0下架 1上架
*/
state?: number;
/**
* 日期范围参数
*/
params?: any;
}
export interface plantsProduct extends BaseEntity {
/**
* 主键
*/
id?: string | number;
/**
* 产品编号
*/
plantCode?: string;
/**
* 产品名称
*/
plantName?: string;
/**
* 产品分类
*/
plantType?: number;
/**
* 产品图片
*/
imgPath?: string;
/**
* 规格
*/
specification?: string;
/**
* 租金
*/
rent?: number;
/**
* 库存数量
*/
inventory?: number;
/**
* 状态0下架 1上架
*/
state?: number;
/**
* 备注
*/
remark?: string;
/**
* 日期范围参数
*/
params?: any;
}

View File

@@ -0,0 +1,61 @@
import type { RentalOrderVO, RentalOrderForm, RentalOrderQuery } from './model';
import type { ID, IDS } from '#/api/common';
import type { PageResult } from '#/api/common';
import { commonExport } from '#/api/helper';
import { requestClient } from '#/api/request';
/**
* 查询绿植租赁-订单管理列表
* @param params
* @returns 绿植租赁-订单管理列表
*/
export function rentalOrderList(params?: RentalOrderQuery) {
return requestClient.get<PageResult<RentalOrderVO>>('/property/rentalOrder/list', { params });
}
/**
* 导出绿植租赁-订单管理列表
* @param params
* @returns 绿植租赁-订单管理列表
*/
export function rentalOrderExport(params?: RentalOrderQuery) {
return commonExport('/property/rentalOrder/export', params ?? {});
}
/**
* 查询绿植租赁-订单管理详情
* @param id id
* @returns 绿植租赁-订单管理详情
*/
export function rentalOrderInfo(id: ID) {
return requestClient.get<RentalOrderVO>(`/property/rentalOrder/${id}`);
}
/**
* 新增绿植租赁-订单管理
* @param data
* @returns void
*/
export function rentalOrderAdd(data: RentalOrderForm) {
return requestClient.postWithMsg<void>('/property/rentalOrder', data);
}
/**
* 更新绿植租赁-订单管理
* @param data
* @returns void
*/
export function rentalOrderUpdate(data: RentalOrderForm) {
return requestClient.putWithMsg<void>('/property/rentalOrder', data);
}
/**
* 删除绿植租赁-订单管理
* @param id id
* @returns void
*/
export function rentalOrderRemove(id: ID | IDS) {
return requestClient.deleteWithMsg<void>(`/property/rentalOrder/${id}`);
}

View File

@@ -0,0 +1,249 @@
import type { PageQuery, BaseEntity } from '#/api/common';
export interface RentalOrderVO {
/**
* 主键
*/
id: string | number;
/**
* 订单号
*/
orderNo: string;
/**
* 客户名称
*/
customerName: string;
/**
* 客户类型
*/
customerType: number;
/**
* 租赁周期
*/
rentalPeriod: number;
/**
* 租赁开始时间
*/
startTime: string;
/**
* 租赁结束时间
*/
endTime: string;
/**
* 应付总额
*/
totalAmount: number;
/**
* 租赁方式
*/
rentalType: number;
/**
* 租赁方案id
*/
planId: string | number;
/**
* 绿植产品id
*/
productId: string | number;
/**
* 租赁产品数量
*/
productNum: number;
/**
* 支付状态
*/
paymentStatus: number;
/**
* 是否续租
*/
isRelet: number;
/**
* 合同状态
*/
contractStatus: number;
/**
* 签署时间
*/
signTime: string;
}
export interface RentalOrderForm extends BaseEntity {
/**
* 主键
*/
id?: string | number;
/**
* 订单号
*/
orderNo?: string;
/**
* 客户名称
*/
customerName?: string;
/**
* 客户类型
*/
customerType?: number;
/**
* 租赁周期
*/
rentalPeriod?: number;
/**
* 租赁开始时间
*/
startTime?: string;
/**
* 租赁结束时间
*/
endTime?: string;
/**
* 应付总额
*/
totalAmount?: number;
/**
* 租赁方式
*/
rentalType?: number;
/**
* 租赁方案id
*/
planId?: string | number;
/**
* 绿植产品id
*/
productId?: string | number;
/**
* 租赁产品数量
*/
productNum?: number;
/**
* 支付状态
*/
paymentStatus?: number;
/**
* 是否续租
*/
isRelet?: number;
/**
* 合同状态
*/
contractStatus?: number;
/**
* 签署时间
*/
signTime?: string;
}
export interface RentalOrderQuery extends PageQuery {
/**
* 订单号
*/
orderNo?: string;
/**
* 客户名称
*/
customerName?: string;
/**
* 客户类型
*/
customerType?: number;
/**
* 租赁周期
*/
rentalPeriod?: number;
/**
* 租赁开始时间
*/
startTime?: string;
/**
* 租赁结束时间
*/
endTime?: string;
/**
* 应付总额
*/
totalAmount?: number;
/**
* 租赁方式
*/
rentalType?: number;
/**
* 租赁方案id
*/
planId?: string | number;
/**
* 绿植产品id
*/
productId?: string | number;
/**
* 租赁产品数量
*/
productNum?: number;
/**
* 支付状态
*/
paymentStatus?: number;
/**
* 是否续租
*/
isRelet?: number;
/**
* 合同状态
*/
contractStatus?: number;
/**
* 签署时间
*/
signTime?: string;
/**
* 日期范围参数
*/
params?: any;
}

View File

@@ -0,0 +1,61 @@
import type { RentalPlanVO, RentalPlanForm, RentalPlanQuery } from './model';
import type { ID, IDS } from '#/api/common';
import type { PageResult } from '#/api/common';
import { commonExport } from '#/api/helper';
import { requestClient } from '#/api/request';
/**
* 查询绿植租赁-租赁方案列表
* @param params
* @returns 绿植租赁-租赁方案列表
*/
export function rentalPlanList(params?: RentalPlanQuery) {
return requestClient.get<PageResult<RentalPlanVO>>('/property/rentalPlan/list', { params });
}
/**
* 导出绿植租赁-租赁方案列表
* @param params
* @returns 绿植租赁-租赁方案列表
*/
export function rentalPlanExport(params?: RentalPlanQuery) {
return commonExport('/property/rentalPlan/export', params ?? {});
}
/**
* 查询绿植租赁-租赁方案详情
* @param id id
* @returns 绿植租赁-租赁方案详情
*/
export function rentalPlanInfo(id: ID) {
return requestClient.get<RentalPlanVO>(`/property/rentalPlan/${id}`);
}
/**
* 新增绿植租赁-租赁方案
* @param data
* @returns void
*/
export function rentalPlanAdd(data: RentalPlanForm) {
return requestClient.postWithMsg<void>('/property/rentalPlan', data);
}
/**
* 更新绿植租赁-租赁方案
* @param data
* @returns void
*/
export function rentalPlanUpdate(data: RentalPlanForm) {
return requestClient.putWithMsg<void>('/property/rentalPlan', data);
}
/**
* 删除绿植租赁-租赁方案
* @param id id
* @returns void
*/
export function rentalPlanRemove(id: ID | IDS) {
return requestClient.deleteWithMsg<void>(`/property/rentalPlan/${id}`);
}

View File

@@ -0,0 +1,114 @@
import type { PageQuery, BaseEntity } from '#/api/common';
export interface RentalPlanVO {
/**
* 主键
*/
id: string | number;
/**
* 方案名称
*/
planName: string;
/**
* 租赁周期
*/
rentalPeriod: number;
/**
* 适用场景
*/
scene: string;
/**
* 价格
*/
price: number;
/**
* 状态
*/
state: number;
/**
* 备注
*/
remarks: string;
}
export interface RentalPlanForm extends BaseEntity {
/**
* 主键
*/
id?: string | number;
/**
* 方案名称
*/
planName?: string;
/**
* 租赁周期
*/
rentalPeriod?: number;
/**
* 适用场景
*/
scene?: string;
/**
* 价格
*/
price?: number;
/**
* 状态
*/
state?: number;
/**
* 备注
*/
remarks?: string;
}
export interface RentalPlanQuery extends PageQuery {
/**
* 方案名称
*/
planName?: string;
/**
* 租赁周期
*/
rentalPeriod?: number;
/**
* 适用场景
*/
scene?: string;
/**
* 价格
*/
price?: number;
/**
* 状态
*/
state?: number;
/**
* 备注
*/
remarks?: string;
/**
* 日期范围参数
*/
params?: any;
}

View File

@@ -0,0 +1,59 @@
import type { RoomVO, RoomForm, RoomQuery } from './model';
import type { ID, IDS } from '#/api/common';
import type { PageResult } from '#/api/common';
import { commonExport } from '#/api/helper';
import { requestClient } from '#/api/request';
/**
* 查询房间信息列表
* @param params
* @returns 房间信息列表
*/
export function roomList(params?: RoomQuery) {
return requestClient.get<PageResult<RoomVO>>('/property/room/list', { params });
}
/**
* 导出房间信息列表
* @param params
* @returns 房间信息列表
*/
export function roomExport(params?: RoomQuery) {
return commonExport('/property/room/export', params ?? {});
}
/**
* 查询房间信息详情
* @param id id
* @returns 房间信息详情
*/
export function roomInfo(id: ID) {
return requestClient.get<RoomVO>(`/property/room/${id}`);
}
/**
* 新增房间信息
* @param data
* @returns void
*/
export function roomAdd(data: RoomForm) {
return requestClient.postWithMsg<void>('/property/room', data);
}
/**
* 更新房间信息
* @param data
* @returns void
*/
export function roomUpdate(data: RoomForm) {
return requestClient.putWithMsg<void>('/property/room', data);
}
/**
* 删除房间信息
* @param id id
* @returns void
*/
export function roomRemove(id: ID | IDS) {
return requestClient.deleteWithMsg<void>(`/property/room/${id}`);
}

View File

@@ -0,0 +1,159 @@
import type { PageQuery, BaseEntity } from '#/api/common';
export interface RoomVO {
/**
* 主键
*/
id: string | number;
/**
* 所属楼层ID
*/
floorCode: string;
/**
* 房间编码
*/
roomCode: string;
/**
* 房间号(如101,202)
*/
roomNumber: string;
/**
* 房间类型('住宅','商铺','办公室','设备间','公共区域')
*/
roomType: number;
/**
* 面积(平方米)
*/
area: number;
/**
* 户型(如2室1厅1卫)
*/
layout: string;
/**
* 朝向('东','南','西','北','东南','东北','西南','西北')
*/
orientation: number;
/**
* 是否可售
*/
isForSale: number;
/**
* 状态('空置','已售','已租','自用'
*/
status: number;
}
export interface RoomForm extends BaseEntity {
/**
* 主键
*/
id?: string | number;
/**
* 所属楼层ID
*/
floorCode?: string;
/**
* 房间编码
*/
roomCode?: string;
/**
* 房间号(如101,202)
*/
roomNumber?: string;
/**
* 房间类型('住宅','商铺','办公室','设备间','公共区域')
*/
roomType?: number;
/**
* 面积(平方米)
*/
area?: number;
/**
* 户型(如2室1厅1卫)
*/
layout?: string;
/**
* 朝向('东','南','西','北','东南','东北','西南','西北')
*/
orientation?: number;
/**
* 是否可售
*/
isForSale?: number;
/**
* 状态('空置','已售','已租','自用'
*/
status?: number;
}
export interface RoomQuery extends PageQuery {
/**
* 所属楼层ID
*/
floorCode?: string;
/**
* 房间编码
*/
roomCode?: string;
/**
* 房间号(如101,202)
*/
roomNumber?: string;
/**
* 房间类型('住宅','商铺','办公室','设备间','公共区域')
*/
roomType?: number;
/**
* 面积(平方米)
*/
area?: number;
/**
* 户型(如2室1厅1卫)
*/
layout?: string;
/**
* 朝向('东','南','西','北','东南','东北','西南','西北')
*/
orientation?: number;
/**
* 是否可售
*/
isForSale?: number;
/**
* 状态('空置','已售','已租','自用'
*/
status?: number;
/**
* 日期范围参数
*/
params?: any;
}

View File

@@ -0,0 +1,61 @@
import type { UnitVO, UnitForm, UnitQuery } from './model';
import type { ID, IDS } from '#/api/common';
import type { PageResult } from '#/api/common';
import { commonExport } from '#/api/helper';
import { requestClient } from '#/api/request';
/**
* 查询单元列表
* @param params
* @returns 单元列表
*/
export function unitList(params?: UnitQuery) {
return requestClient.get<PageResult<UnitVO>>('/property/unit/list', { params });
}
/**
* 导出单元列表
* @param params
* @returns 单元列表
*/
export function unitExport(params?: UnitQuery) {
return commonExport('/property/unit/export', params ?? {});
}
/**
* 查询单元详情
* @param id id
* @returns 单元详情
*/
export function unitInfo(id: ID) {
return requestClient.get<UnitVO>(`/property/unit/${id}`);
}
/**
* 新增单元
* @param data
* @returns void
*/
export function unitAdd(data: UnitForm) {
return requestClient.postWithMsg<void>('/property/unit', data);
}
/**
* 更新单元
* @param data
* @returns void
*/
export function unitUpdate(data: UnitForm) {
return requestClient.putWithMsg<void>('/property/unit', data);
}
/**
* 删除单元
* @param id id
* @returns void
*/
export function unitRemove(id: ID | IDS) {
return requestClient.deleteWithMsg<void>(`/property/unit/${id}`);
}

View File

@@ -0,0 +1,114 @@
import type { PageQuery, BaseEntity } from '#/api/common';
export interface UnitVO {
/**
* 主键id
*/
id: string | number;
/**
* 建筑名称
*/
buildingCode: string;
/**
* 单元编码
*/
unitCode: string;
/**
* 单元名称
*/
unitName: string;
/**
* 单元层数
*/
floorCount: number;
/**
* 单元户数
*/
householdCount: number;
/**
* 楼梯数量
*/
stairCount: number;
}
export interface UnitForm extends BaseEntity {
/**
* 主键id
*/
id?: string | number;
/**
* 建筑名称
*/
buildingCode?: string;
/**
* 单元编码
*/
unitCode?: string;
/**
* 单元名称
*/
unitName?: string;
/**
* 单元层数
*/
floorCount?: number;
/**
* 单元户数
*/
householdCount?: number;
/**
* 楼梯数量
*/
stairCount?: number;
}
export interface UnitQuery extends PageQuery {
/**
* 建筑名称
*/
buildingCode?: string;
/**
* 单元编码
*/
unitCode?: string;
/**
* 单元名称
*/
unitName?: string;
/**
* 单元层数
*/
floorCount?: number;
/**
* 单元户数
*/
householdCount?: number;
/**
* 楼梯数量
*/
stairCount?: number;
/**
* 日期范围参数
*/
params?: any;
}

View File

@@ -0,0 +1,69 @@
import type {
AccessControlDeviceForm,
AccessControlDeviceQuery,
AccessControlDeviceVO,
} from './model';
import type { ID, IDS, PageResult } from '#/api/common';
import { commonExport } from '#/api/helper';
import { requestClient } from '#/api/request';
/**
* 查询门禁设备列表
* @param params
* @returns 门禁设备列表
*/
export function accessControlDeviceList(params?: AccessControlDeviceQuery) {
return requestClient.get<PageResult<AccessControlDeviceVO>>(
'/sis/accessControlDevice/list',
{ params },
);
}
/**
* 导出门禁设备列表
* @param params
* @returns 门禁设备列表
*/
export function accessControlDeviceExport(params?: AccessControlDeviceQuery) {
return commonExport('/sis/accessControlDevice/export', params ?? {});
}
/**
* 查询门禁设备详情
* @param id id
* @returns 门禁设备详情
*/
export function accessControlDeviceInfo(id: ID) {
return requestClient.get<AccessControlDeviceVO>(
`/sis/accessControlDevice/${id}`,
);
}
/**
* 新增门禁设备
* @param data
* @returns void
*/
export function accessControlDeviceAdd(data: AccessControlDeviceForm) {
return requestClient.postWithMsg<void>('/sis/accessControlDevice', data);
}
/**
* 更新门禁设备
* @param data
* @returns void
*/
export function accessControlDeviceUpdate(data: AccessControlDeviceForm) {
return requestClient.putWithMsg<void>('/sis/accessControlDevice', data);
}
/**
* 删除门禁设备
* @param id id
* @returns void
*/
export function accessControlDeviceRemove(id: ID | IDS) {
return requestClient.deleteWithMsg<void>(`/sis/accessControlDevice/${id}`);
}

View File

@@ -0,0 +1,202 @@
import type { BaseEntity, PageQuery } from '#/api/common';
export interface AccessControlDeviceVO {
/**
* 主键id
*/
id: number | string;
/**
* 设备编码
*/
eqpNo: string;
/**
* 设备名称
*/
eqpName: string;
/**
* 厂商编码
*/
factoryNo: string;
/**
* 设备类型
*/
eqpType: number;
/**
* 接入类型(1: 平台接入2:设备接入)
*/
accessType: number;
/**
* 设备ip
*/
eqpIp: string;
/**
* 设备端口
*/
eqpPort: number;
/**
* 设备账号
*/
eqpAccount: string;
/**
* 设备密码
*/
eqpPwd: string;
/**
* 创建人id
*/
createById: number | string;
/**
* 更新人id
*/
updateById: number | string;
/**
* 搜索值
*/
searchValue: string;
}
export interface AccessControlDeviceForm extends BaseEntity {
/**
* 主键id
*/
id?: number | string;
/**
* 设备编码
*/
eqpNo?: string;
/**
* 设备名称
*/
eqpName?: string;
/**
* 厂商编码
*/
factoryNo?: string;
/**
* 设备类型
*/
eqpType?: number;
/**
* 接入类型(1: 平台接入2:设备接入)
*/
accessType?: number;
/**
* 设备ip
*/
eqpIp?: string;
/**
* 设备端口
*/
eqpPort?: number;
/**
* 设备账号
*/
eqpAccount?: string;
/**
* 设备密码
*/
eqpPwd?: string;
/**
* 创建人id
*/
createById?: number | string;
/**
* 更新人id
*/
updateById?: number | string;
/**
* 搜索值
*/
searchValue?: string;
}
export interface AccessControlDeviceQuery extends PageQuery {
/**
* 设备编码
*/
eqpNo?: string;
/**
* 设备名称
*/
eqpName?: string;
/**
* 厂商编码
*/
factoryNo?: string;
/**
* 设备类型
*/
eqpType?: number;
/**
* 接入类型(1: 平台接入2:设备接入)
*/
accessType?: number;
/**
* 设备ip
*/
eqpIp?: string;
/**
* 设备端口
*/
eqpPort?: number;
/**
* 设备账号
*/
eqpAccount?: string;
/**
* 设备密码
*/
eqpPwd?: string;
/**
* 创建人id
*/
createById?: number | string;
/**
* 更新人id
*/
updateById?: number | string;
/**
* 搜索值
*/
searchValue?: string;
/**
* 日期范围参数
*/
params?: any;
}

View File

@@ -0,0 +1,62 @@
import type { DevicePointForm, DevicePointQuery, DevicePointVO } from './model';
import type { ID, IDS, PageResult } from '#/api/common';
import { commonExport } from '#/api/helper';
import { requestClient } from '#/api/request';
/**
* 查询宇视设备点位(通道)列表
* @param params
* @returns 宇视设备点位(通道)列表
*/
export function devicePointList(params?: DevicePointQuery) {
return requestClient.get<PageResult<DevicePointVO>>('/sis/devicePoint/list', {
params,
});
}
/**
* 导出宇视设备点位(通道)列表
* @param params
* @returns 宇视设备点位(通道)列表
*/
export function devicePointExport(params?: DevicePointQuery) {
return commonExport('/sis/devicePoint/export', params ?? {});
}
/**
* 查询宇视设备点位(通道)详情
* @param id id
* @returns 宇视设备点位(通道)详情
*/
export function devicePointInfo(id: ID) {
return requestClient.get<DevicePointVO>(`/sis/devicePoint/${id}`);
}
/**
* 新增宇视设备点位(通道)
* @param data
* @returns void
*/
export function devicePointAdd(data: DevicePointForm) {
return requestClient.postWithMsg<void>('/sis/devicePoint', data);
}
/**
* 更新宇视设备点位(通道)
* @param data
* @returns void
*/
export function devicePointUpdate(data: DevicePointForm) {
return requestClient.putWithMsg<void>('/sis/devicePoint', data);
}
/**
* 删除宇视设备点位(通道)
* @param id id
* @returns void
*/
export function devicePointRemove(id: ID | IDS) {
return requestClient.deleteWithMsg<void>(`/sis/devicePoint/${id}`);
}

View File

@@ -0,0 +1,259 @@
import type { BaseEntity, PageQuery } from '#/api/common';
export interface DevicePointVO {
/**
* 主键id
*/
id: number | string;
/**
* 设备编码
*/
eqpCode: string;
/**
* 视频协议 1onvif 2
rtsp
*/
video: number | string;
/**
* 传输协议(AIBOX 需要,一
体机不需要) 1: tcp 2:
udp
*/
transportType: number;
/**
* 点位名称
*/
channelName: string;
/**
* rtsp 地址(当视频协议为
rtsp 时,该字段必填)
*/
rtspAddr: string;
/**
* 点位名称
*/
ip: string;
/**
* 端口
*/
port: number;
/**
* 通道相机账号
*/
username: string;
/**
* 相机密码
*/
pwd: string;
/**
* onvif 设备码流添加方
1主码流 2自定
义码流
*/
videoType: number | string;
/**
* 码流 id当选择自定义码
流时,该字段必填,值为
获取设备码流信息接口返
回的码流 id
*/
videoId: number | string;
/**
* 创建人id
*/
createById: number | string;
/**
* 更新人id
*/
updateById: number | string;
/**
* 搜索值
*/
searchValue: string;
}
export interface DevicePointForm extends BaseEntity {
/**
* 主键id
*/
id?: number | string;
/**
* 设备编码
*/
eqpCode?: string;
/**
* 视频协议 1onvif 2
rtsp
*/
video?: number | string;
/**
* 传输协议(AIBOX 需要,一
体机不需要) 1: tcp 2:
udp
*/
transportType?: number;
/**
* 点位名称
*/
channelName?: string;
/**
* rtsp 地址(当视频协议为
rtsp 时,该字段必填)
*/
rtspAddr?: string;
/**
* 点位名称
*/
ip?: string;
/**
* 端口
*/
port?: number;
/**
* 通道相机账号
*/
username?: string;
/**
* 相机密码
*/
pwd?: string;
/**
* onvif 设备码流添加方
1主码流 2自定
义码流
*/
videoType?: number | string;
/**
* 码流 id当选择自定义码
流时,该字段必填,值为
获取设备码流信息接口返
回的码流 id
*/
videoId?: number | string;
/**
* 创建人id
*/
createById?: number | string;
/**
* 更新人id
*/
updateById?: number | string;
/**
* 搜索值
*/
searchValue?: string;
}
export interface DevicePointQuery extends PageQuery {
/**
* 设备编码
*/
eqpCode?: string;
/**
* 视频协议 1onvif 2
rtsp
*/
video?: number | string;
/**
* 传输协议(AIBOX 需要,一
体机不需要) 1: tcp 2:
udp
*/
transportType?: number;
/**
* 点位名称
*/
channelName?: string;
/**
* rtsp 地址(当视频协议为
rtsp 时,该字段必填)
*/
rtspAddr?: string;
/**
* 点位名称
*/
ip?: string;
/**
* 端口
*/
port?: number;
/**
* 通道相机账号
*/
username?: string;
/**
* 相机密码
*/
pwd?: string;
/**
* onvif 设备码流添加方
1主码流 2自定
义码流
*/
videoType?: number | string;
/**
* 码流 id当选择自定义码
流时,该字段必填,值为
获取设备码流信息接口返
回的码流 id
*/
videoId?: number | string;
/**
* 创建人id
*/
createById?: number | string;
/**
* 更新人id
*/
updateById?: number | string;
/**
* 搜索值
*/
searchValue?: string;
/**
* 日期范围参数
*/
params?: any;
}

View File

@@ -0,0 +1,61 @@
import type { PersonLibVO, PersonLibForm, PersonLibQuery } from './model';
import type { ID, IDS } from '#/api/common';
import type { PageResult } from '#/api/common';
import { commonExport } from '#/api/helper';
import { requestClient } from '#/api/request';
/**
* 查询人像库列表
* @param params
* @returns 人像库列表
*/
export function personLibList(params?: PersonLibQuery) {
return requestClient.get<PageResult<PersonLibVO>>('/sis/personLib/list', { params });
}
/**
* 导出人像库列表
* @param params
* @returns 人像库列表
*/
export function personLibExport(params?: PersonLibQuery) {
return commonExport('/sis/personLib/export', params ?? {});
}
/**
* 查询人像库详情
* @param id id
* @returns 人像库详情
*/
export function personLibInfo(id: ID) {
return requestClient.get<PersonLibVO>(`/sis/personLib/${id}`);
}
/**
* 新增人像库
* @param data
* @returns void
*/
export function personLibAdd(data: PersonLibForm) {
return requestClient.postWithMsg<void>('/sis/personLib', data);
}
/**
* 更新人像库
* @param data
* @returns void
*/
export function personLibUpdate(data: PersonLibForm) {
return requestClient.putWithMsg<void>('/sis/personLib', data);
}
/**
* 删除人像库
* @param id id
* @returns void
*/
export function personLibRemove(id: ID | IDS) {
return requestClient.deleteWithMsg<void>(`/sis/personLib/${id}`);
}

View File

@@ -0,0 +1,144 @@
import type { PageQuery, BaseEntity } from '#/api/common';
export interface PersonLibVO {
/**
* 主键id
*/
id: string | number;
/**
* 人员库编码
*/
libCode: string;
/**
* 人员库名称
*/
libName: string;
/**
* 人员库描述
*/
libDesc: string;
/**
* 库类型1人员库2工服库
*/
libType: number;
/**
* 库的业务类型 1: 门禁库2: 黑名单库
*/
busiType: number;
/**
* 创建人id
*/
createById: string | number;
/**
* 更新人id
*/
updateById: string | number;
/**
* 搜索值
*/
searchValue: string;
}
export interface PersonLibForm extends BaseEntity {
/**
* 主键id
*/
id?: string | number;
/**
* 人员库编码
*/
libCode?: string;
/**
* 人员库名称
*/
libName?: string;
/**
* 人员库描述
*/
libDesc?: string;
/**
* 库类型1人员库2工服库
*/
libType?: number;
/**
* 库的业务类型 1: 门禁库2: 黑名单库
*/
busiType?: number;
/**
* 创建人id
*/
createById?: string | number;
/**
* 更新人id
*/
updateById?: string | number;
/**
* 搜索值
*/
searchValue?: string;
}
export interface PersonLibQuery extends PageQuery {
/**
* 人员库编码
*/
libCode?: string;
/**
* 人员库名称
*/
libName?: string;
/**
* 人员库描述
*/
libDesc?: string;
/**
* 库类型1人员库2工服库
*/
libType?: number;
/**
* 库的业务类型 1: 门禁库2: 黑名单库
*/
busiType?: number;
/**
* 创建人id
*/
createById?: string | number;
/**
* 更新人id
*/
updateById?: string | number;
/**
* 搜索值
*/
searchValue?: string;
/**
* 日期范围参数
*/
params?: any;
}

View File

@@ -0,0 +1,61 @@
import type { PersonLibImgVO, PersonLibImgForm, PersonLibImgQuery } from './model';
import type { ID, IDS } from '#/api/common';
import type { PageResult } from '#/api/common';
import { commonExport } from '#/api/helper';
import { requestClient } from '#/api/request';
/**
* 查询人像信息列表
* @param params
* @returns 人像信息列表
*/
export function personLibImgList(params?: PersonLibImgQuery) {
return requestClient.get<PageResult<PersonLibImgVO>>('/sis/personLibImg/list', { params });
}
/**
* 导出人像信息列表
* @param params
* @returns 人像信息列表
*/
export function personLibImgExport(params?: PersonLibImgQuery) {
return commonExport('/sis/personLibImg/export', params ?? {});
}
/**
* 查询人像信息详情
* @param id id
* @returns 人像信息详情
*/
export function personLibImgInfo(id: ID) {
return requestClient.get<PersonLibImgVO>(`/sis/personLibImg/${id}`);
}
/**
* 新增人像信息
* @param data
* @returns void
*/
export function personLibImgAdd(data: PersonLibImgForm) {
return requestClient.postWithMsg<void>('/sis/personLibImg', data);
}
/**
* 更新人像信息
* @param data
* @returns void
*/
export function personLibImgUpdate(data: PersonLibImgForm) {
return requestClient.putWithMsg<void>('/sis/personLibImg', data);
}
/**
* 删除人像信息
* @param id id
* @returns void
*/
export function personLibImgRemove(id: ID | IDS) {
return requestClient.deleteWithMsg<void>(`/sis/personLibImg/${id}`);
}

View File

@@ -0,0 +1,196 @@
import type { BaseEntity, PageQuery } from '#/api/common';
export interface PersonLibImgVO {
/**
* 主键id
*/
id: number | string;
/**
* 人员库编码
*/
libCode: string;
/**
* 人像名称
*/
imgName: string;
/**
* 图片编码
*/
imgCode: string;
/**
* 图片的存储地址
*/
imgUrl: string;
/**
* 性别 1
2女 99未说明
*/
sex: number;
/**
* 邮箱
*/
email: string;
/**
* 联系方式
*/
tel: string;
/**
* 证件类型
1身份证 2护照
3行驶证 99其它
*/
certificateType: number;
/**
* 证件号码
*/
certificateNo: string;
/**
* 出生日期
*/
birthDate: string;
/**
* 搜索值
*/
searchValue: string;
}
export interface PersonLibImgForm extends BaseEntity {
/**
* 主键id
*/
id?: number | string;
/**
* 人员库编码
*/
libCode?: string;
/**
* 人像名称
*/
imgName?: string;
/**
* 图片编码
*/
imgCode?: string;
/**
* 图片的存储地址
*/
imgUrl?: string;
/**
* 性别 1
2女 99未说明
*/
sex?: number;
/**
* 邮箱
*/
email?: string;
/**
* 联系方式
*/
tel?: string;
/**
* 证件类型
1身份证 2护照
3行驶证 99其它
*/
certificateType?: number;
/**
* 证件号码
*/
certificateNo?: string;
/**
* 出生日期
*/
birthDate?: string;
/**
* 搜索值
*/
searchValue?: string;
}
export interface PersonLibImgQuery extends PageQuery {
/**
* 人员库编码
*/
libCode?: string;
/**
* 人像名称
*/
imgName?: string;
/**
* 图片编码
*/
imgCode?: string;
/**
* 图片的存储地址
*/
imgUrl?: string;
/**
* 性别 1
2女 99未说明
*/
sex?: number;
/**
* 邮箱
*/
email?: string;
/**
* 联系方式
*/
tel?: string;
/**
* 证件类型
1身份证 2护照
3行驶证 99其它
*/
certificateType?: number;
/**
* 证件号码
*/
certificateNo?: string;
/**
* 出生日期
*/
birthDate?: string;
/**
* 搜索值
*/
searchValue?: string;
/**
* 日期范围参数
*/
params?: any;
}

View File

@@ -1,5 +1,8 @@
import type { FormSchemaGetter } from '#/adapter/form';
import type { VxeGridProps } from '#/adapter/vxe-table';
import { renderDict } from "#/utils/render";
import { DictEnum } from '@vben/constants';
export const querySchema: FormSchemaGetter = () => [
@@ -59,12 +62,12 @@ export const columns: VxeGridProps['columns'] = [
field: 'id',
},
{
title: '资产id',
field: 'assetId',
title: '资产',
field: 'assetName',
},
{
title: '领用人id',
field: 'userId',
title: '领用人',
field: 'userName',
},
{
title: '数量',
@@ -73,10 +76,15 @@ export const columns: VxeGridProps['columns'] = [
{
title: '状态',
field: 'state',
slots: {
default: ({ row }) => {
return renderDict(row.state, DictEnum.WY_ZCSHZT);
},
},
},
{
title: '审批人id',
field: 'acceptanceUserId',
title: '审批人',
field: 'acceptanceUserName',
},
{
title: '审批时间',

View File

@@ -0,0 +1,101 @@
<script setup lang="ts">
import { computed, ref } from 'vue';
import { useVbenModal } from '@vben/common-ui';
import { $t } from '@vben/locales';
import { cloneDeep } from '@vben/utils';
import { useVbenForm } from '#/adapter/form';
import { assetTypeAdd, assetTypeInfo, assetTypeUpdate } from '#/api/property/assetManage/assetType';
import { defaultFormValueGetter, useBeforeCloseDiff } from '#/utils/popup';
import { modalSchema } from './data';
const emit = defineEmits<{ reload: [] }>();
const isUpdate = ref(false);
const title = computed(() => {
return isUpdate.value ? $t('pages.common.edit') : $t('pages.common.add');
});
const [BasicForm, formApi] = useVbenForm({
commonConfig: {
// 默认占满两列
formItemClass: 'col-span-2',
// 默认label宽度 px
labelWidth: 80,
// 通用配置项 会影响到所有表单项
componentProps: {
class: 'w-full',
}
},
schema: modalSchema(),
showDefaultActions: false,
wrapperClass: 'grid-cols-2',
});
const { onBeforeClose, markInitialized, resetInitialized } = useBeforeCloseDiff(
{
initializedGetter: defaultFormValueGetter(formApi),
currentGetter: defaultFormValueGetter(formApi),
},
);
const [BasicModal, modalApi] = useVbenModal({
// 在这里更改宽度
class: 'w-[550px]',
fullscreenButton: false,
onBeforeClose,
onClosed: handleClosed,
onConfirm: handleConfirm,
onOpenChange: async (isOpen) => {
if (!isOpen) {
return null;
}
modalApi.modalLoading(true);
const { id } = modalApi.getData() as { id?: number | string };
isUpdate.value = !!id;
if (isUpdate.value && id) {
const record = await assetTypeInfo(id);
await formApi.setValues(record);
}
await markInitialized();
modalApi.modalLoading(false);
},
});
async function handleConfirm() {
try {
modalApi.lock(true);
const { valid } = await formApi.validate();
if (!valid) {
return;
}
// getValues获取为一个readonly的对象 需要修改必须先深拷贝一次
const data = cloneDeep(await formApi.getValues());
await (isUpdate.value ? assetTypeUpdate(data) : assetTypeAdd(data));
resetInitialized();
emit('reload');
modalApi.close();
} catch (error) {
console.error(error);
} finally {
modalApi.lock(false);
}
}
async function handleClosed() {
await formApi.resetForm();
resetInitialized();
}
</script>
<template>
<BasicModal :title="title">
<BasicForm />
</BasicModal>
</template>

View File

@@ -0,0 +1,65 @@
import type { FormSchemaGetter } from '#/adapter/form';
import type { VxeGridProps } from '#/adapter/vxe-table';
export const querySchema: FormSchemaGetter = () => [
{
component: 'Input',
fieldName: 'assetTypeName',
label: '分类名称',
},
];
export const columns: VxeGridProps['columns'] = [
{ type: 'checkbox', width: 60 },
{
title: '序号',
field: 'id',
slots: {
default: ({rowIndex}) => {
return (rowIndex+1).toString()
}
}
},
{
title: '分类名称',
field: 'assetTypeName',
},
{
title: '排序',
field: 'sort',
},
{
title: '创建时间',
field: 'createTime',
},
{
field: 'action',
fixed: 'right',
slots: { default: 'action' },
title: '操作',
width: 180,
},
];
export const modalSchema: FormSchemaGetter = () => [
{
label: '主键',
fieldName: 'id',
component: 'Input',
dependencies: {
show: () => false,
triggerFields: [''],
},
},
{
label: '分类名称',
fieldName: 'assetTypeName',
component: 'Input',
rules:'required'
},
{
label: '排序',
fieldName: 'sort',
component: 'InputNumber',
},
];

View File

@@ -0,0 +1,166 @@
<script setup lang="ts">
import { Page, useVbenModal, type VbenFormProps } from '@vben/common-ui';
import { getVxePopupContainer } from '@vben/utils';
import { Modal, Popconfirm, Space } from 'ant-design-vue';
import {
useVbenVxeGrid,
vxeCheckboxChecked,
type VxeGridProps
} from '#/adapter/vxe-table';
import {
assetTypeExport,
assetTypeList,
assetTypeRemove,
} from '#/api/property/assetManage/assetType';
import type { AssetTypeForm } from '#/api/property/assetManage/assetType/model';
import { commonDownloadExcel } from '#/utils/file/download';
import assetTypeModal from './assetType-modal.vue';
import { columns, querySchema } from './data';
const formOptions: VbenFormProps = {
commonConfig: {
labelWidth: 80,
componentProps: {
allowClear: true,
},
},
schema: querySchema(),
wrapperClass: 'grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4',
};
const gridOptions: VxeGridProps = {
checkboxConfig: {
// 高亮
highlight: true,
// 翻页时保留选中状态
reserve: true,
// 点击行选中
// trigger: 'row',
},
columns,
height: 'auto',
keepSource: true,
pagerConfig: {},
proxyConfig: {
ajax: {
query: async ({ page }, formValues = {}) => {
return await assetTypeList({
pageNum: page.currentPage,
pageSize: page.pageSize,
...formValues,
});
},
},
},
rowConfig: {
keyField: 'id',
},
// 表格全局唯一表示 保存列配置需要用到
id: 'property-assetType-index'
};
const [BasicTable, tableApi] = useVbenVxeGrid({
formOptions,
gridOptions,
});
const [AssetTypeModal, modalApi] = useVbenModal({
connectedComponent: assetTypeModal,
});
function handleAdd() {
modalApi.setData({});
modalApi.open();
}
async function handleEdit(row: Required<AssetTypeForm>) {
modalApi.setData({ id: row.id });
modalApi.open();
}
async function handleDelete(row: Required<AssetTypeForm>) {
await assetTypeRemove(row.id);
await tableApi.query();
}
function handleMultiDelete() {
const rows = tableApi.grid.getCheckboxRecords();
const ids = rows.map((row: Required<AssetTypeForm>) => row.id);
Modal.confirm({
title: '提示',
okType: 'danger',
content: `确认删除选中的${ids.length}条记录吗?`,
onOk: async () => {
await assetTypeRemove(ids);
await tableApi.query();
},
});
}
function handleDownloadExcel() {
commonDownloadExcel(assetTypeExport, '资产类型数据', tableApi.formApi.form.values, {
fieldMappingTime: formOptions.fieldMappingTime,
});
}
</script>
<template>
<Page :auto-content-height="true">
<BasicTable table-title="资产类型列表">
<template #toolbar-tools>
<Space>
<a-button
v-access:code="['property:assetType:export']"
@click="handleDownloadExcel"
>
{{ $t('pages.common.export') }}
</a-button>
<a-button
:disabled="!vxeCheckboxChecked(tableApi)"
danger
type="primary"
v-access:code="['property:assetType:remove']"
@click="handleMultiDelete">
{{ $t('pages.common.delete') }}
</a-button>
<a-button
type="primary"
v-access:code="['property:assetType:add']"
@click="handleAdd"
>
{{ $t('pages.common.add') }}
</a-button>
</Space>
</template>
<template #action="{ row }">
<Space>
<ghost-button
v-access:code="['property:assetType:edit']"
@click.stop="handleEdit(row)"
>
{{ $t('pages.common.edit') }}
</ghost-button>
<Popconfirm
:get-popup-container="getVxePopupContainer"
placement="left"
title="确认删除?"
@confirm="handleDelete(row)"
>
<ghost-button
danger
v-access:code="['property:assetType:remove']"
@click.stop=""
>
{{ $t('pages.common.delete') }}
</ghost-button>
</Popconfirm>
</Space>
</template>
</BasicTable>
<AssetTypeModal @reload="tableApi.query()" />
</Page>
</template>

View File

@@ -0,0 +1,102 @@
<script setup lang="ts">
import type {Building} from '#/api/property/building/model';
import {shallowRef} from 'vue';
import {useVbenModal} from '@vben/common-ui';
import {Descriptions, DescriptionsItem} from 'ant-design-vue';
import {buildingInfo} from '#/api/property/building';
import {renderDict} from "#/utils/render";
const [BasicModal, modalApi] = useVbenModal({
onOpenChange: handleOpenChange,
onClosed() {
buildingDetail.value = null;
},
});
const buildingDetail = shallowRef<null | Building>(null);
async function handleOpenChange(open: boolean) {
if (!open) {
return null;
}
modalApi.modalLoading(true);
const {id} = modalApi.getData() as { id: number | string };
const response = await buildingInfo(id);
buildingDetail.value = response;
modalApi.modalLoading(false);
}
</script>
<template>
<BasicModal :footer="false" :fullscreen-button="false" title="建筑管理信息" class="w-[70%]">
<Descriptions v-if="buildingDetail" size="small" :column="2" bordered :labelStyle="{width:'100px'}">
<DescriptionsItem label="小区/园区">
{{ buildingDetail.communityCode }}
</DescriptionsItem>
<DescriptionsItem label="建筑名称">
{{ buildingDetail.buildingName }}
</DescriptionsItem>
<DescriptionsItem label="建筑编码">
{{ buildingDetail.buildingCode }}
</DescriptionsItem>
<DescriptionsItem label="省">
{{ buildingDetail.province }}
</DescriptionsItem>
<DescriptionsItem label="市">
{{ buildingDetail.city }}
</DescriptionsItem>
<DescriptionsItem label="区">
{{ buildingDetail.district }}
</DescriptionsItem>
<DescriptionsItem label="地址">
{{ buildingDetail.addr }}
</DescriptionsItem>
<DescriptionsItem label="经度">
{{ buildingDetail.lon }}
</DescriptionsItem>
<DescriptionsItem label="维度">
{{ buildingDetail.lat }}
</DescriptionsItem>
<DescriptionsItem label="产权性质" v-if="buildingDetail.cqxz!=null">
<component
:is="renderDict(buildingDetail.cqxz,'wy_cqxz')"
/>
</DescriptionsItem>
<DescriptionsItem label="不动产编号">
{{ buildingDetail.bdcbh }}
</DescriptionsItem>
<DescriptionsItem label="产权编号">
{{ buildingDetail.cqbh }}
</DescriptionsItem>
<DescriptionsItem label="土地编号">
{{ buildingDetail.tdbh }}
</DescriptionsItem>
<DescriptionsItem label="建筑面积">
{{ buildingDetail.jzmj }}
</DescriptionsItem>
<DescriptionsItem label="产权面积">
{{ buildingDetail.cqmj }}
</DescriptionsItem>
<DescriptionsItem label="可租面积">
{{ buildingDetail.kzmj }}
</DescriptionsItem>
<DescriptionsItem label="自用面积">
{{ buildingDetail.zymj }}
</DescriptionsItem>
<DescriptionsItem label="配套面积">
{{ buildingDetail.ptmj }}
</DescriptionsItem>
<DescriptionsItem label="车位面积">
{{ buildingDetail.cwmj }}
</DescriptionsItem>
<DescriptionsItem label="标准层高">
{{ buildingDetail.bzcg }}
</DescriptionsItem>
<DescriptionsItem label="组织编码">
{{ buildingDetail.orgCode }}
</DescriptionsItem>
<DescriptionsItem label="修改时间">
{{ buildingDetail.modifyTime }}
</DescriptionsItem>
</Descriptions>
</BasicModal>
</template>

View File

@@ -1,30 +1,24 @@
<script setup lang="ts">
import { computed, ref } from 'vue';
import { useVbenModal } from '@vben/common-ui';
import { $t } from '@vben/locales';
import { cloneDeep } from '@vben/utils';
import { useVbenForm } from '#/adapter/form';
import { buildingAdd, buildingInfo, buildingUpdate } from '#/api/property/building';
import { defaultFormValueGetter, useBeforeCloseDiff } from '#/utils/popup';
import { modalSchema } from './data';
const emit = defineEmits<{ reload: [] }>();
const isUpdate = ref(false);
const title = computed(() => {
return isUpdate.value ? $t('pages.common.edit') : $t('pages.common.add');
});
const [BasicForm, formApi] = useVbenForm({
commonConfig: {
// 默认占满两列
formItemClass: 'col-span-2',
// 默认label宽度 px
labelWidth: 80,
// 通用配置项 会影响到所有表单项
componentProps: {
class: 'w-full',
}
@@ -42,7 +36,6 @@ const { onBeforeClose, markInitialized, resetInitialized } = useBeforeCloseDiff(
);
const [BasicModal, modalApi] = useVbenModal({
// 在这里更改宽度
class: 'w-[550px]',
fullscreenButton: false,
onBeforeClose,
@@ -53,16 +46,13 @@ const [BasicModal, modalApi] = useVbenModal({
return null;
}
modalApi.modalLoading(true);
const { id } = modalApi.getData() as { id?: number | string };
isUpdate.value = !!id;
if (isUpdate.value && id) {
const record = await buildingInfo(id);
await formApi.setValues(record);
}
await markInitialized();
modalApi.modalLoading(false);
},
});
@@ -74,7 +64,6 @@ async function handleConfirm() {
if (!valid) {
return;
}
// getValues获取为一个readonly的对象 需要修改必须先深拷贝一次
const data = cloneDeep(await formApi.getValues());
await (isUpdate.value ? buildingUpdate(data) : buildingAdd(data));
resetInitialized();

View File

@@ -1,6 +1,5 @@
import type { FormSchemaGetter } from '#/adapter/form';
import type { VxeGridProps } from '#/adapter/vxe-table';
import { getDictOptions } from '#/utils/dict';
import { renderDict } from '#/utils/render';
@@ -8,12 +7,7 @@ export const querySchema: FormSchemaGetter = () => [
{
component: 'Input',
fieldName: 'communityCode',
label: '园区编码',
},
{
component: 'Input',
fieldName: 'buildingCode',
label: '建筑编码',
label: '小区/园区',
},
{
component: 'Input',
@@ -22,175 +16,56 @@ export const querySchema: FormSchemaGetter = () => [
},
{
component: 'Input',
fieldName: 'province',
label: '',
},
{
component: 'Input',
fieldName: 'city',
label: '市',
},
{
component: 'Input',
fieldName: 'district',
label: '区',
},
{
component: 'Input',
fieldName: 'addr',
label: '地址',
},
{
component: 'Input',
fieldName: 'lon',
label: '经度',
},
{
component: 'Input',
fieldName: 'lat',
label: '维度',
fieldName: 'buildingCode',
label: '建筑编码',
},
{
component: 'Select',
componentProps: {
// 可选从DictEnum中获取 DictEnum.WY_CQXZ 便于维护
options: getDictOptions('wy_cqxz'),
},
fieldName: 'cqxz',
label: '产权性质(1:自持2承租3自持+承租,4政府免费使用)',
},
{
component: 'Input',
fieldName: 'bdcbh',
label: '不动产编号',
},
{
component: 'Input',
fieldName: 'cqbh',
label: '产权编号',
},
{
component: 'Input',
fieldName: 'tdbh',
label: '图地编号',
},
{
component: 'Input',
fieldName: 'jzmj',
label: '建筑面积',
},
{
component: 'Input',
fieldName: 'cqmj',
label: '产权面积',
},
{
component: 'Input',
fieldName: 'kzmj',
label: '可租面积',
},
{
component: 'Input',
fieldName: 'zymj',
label: '自用面积',
},
{
component: 'Input',
fieldName: 'ptmj',
label: '配套面积',
},
{
component: 'Input',
fieldName: 'cwmj',
label: '车位面积',
},
{
component: 'Input',
fieldName: 'bzcg',
label: '标准层高',
},
{
component: 'Input',
fieldName: 'sort',
label: '排序字段',
},
{
component: 'Input',
fieldName: 'orgCode',
label: '组织编码',
},
{
component: 'Input',
fieldName: 'dataState',
label: '数据状态1有效0无效',
},
{
component: 'DatePicker',
componentProps: {
showTime: true,
format: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'YYYY-MM-DD HH:mm:ss',
},
fieldName: 'modifyTime',
label: '修改时间',
},
{
component: 'Input',
fieldName: 'searchValue',
label: '搜索值',
label: '产权性质',
},
];
// 需要使用i18n注意这里要改成getter形式 否则切换语言不会刷新
// export const columns: () => VxeGridProps['columns'] = () => [
export const columns: VxeGridProps['columns'] = [
{ type: 'checkbox', width: 60 },
{
title: '',
title: '序号',
field: 'id',
slots: {
default: ({ rowIndex }) => {
return (rowIndex + 1).toString();
},
},
},
{
title: '园区编码',
title: '小区/园区',
field: 'communityCode',
},
{
title: '建筑编码',
field: 'buildingCode',
width: 'auto'
},
{
title: '建筑名称',
field: 'buildingName',
width: 'auto'
},
{
title: '',
field: 'province',
},
{
title: '市',
field: 'city',
},
{
title: '区',
field: 'district',
title: '建筑编码',
field: 'buildingCode',
width: 'auto'
},
{
title: '地址',
field: 'addr',
width: 'auto'
},
{
title: '经度',
field: 'lon',
},
{
title: '维度',
field: 'lat',
},
{
title: '产权性质(1:自持2承租3自持+承租,4政府免费使用)',
title: '产权性质',
field: 'cqxz',
width: 'auto',
slots: {
default: ({ row }) => {
// 可选从DictEnum中获取 DictEnum.WY_CQXZ 便于维护
return renderDict(row.cqxz, 'wy_cqxz');
},
},
@@ -198,62 +73,57 @@ export const columns: VxeGridProps['columns'] = [
{
title: '不动产编号',
field: 'bdcbh',
width: 'auto'
},
{
title: '产权编号',
field: 'cqbh',
width: 'auto'
},
{
title: '地编号',
title: '地编号',
field: 'tdbh',
width: 'auto'
},
{
title: '建筑面积',
field: 'jzmj',
width: 'auto'
},
{
title: '产权面积',
field: 'cqmj',
width: 'auto'
},
{
title: '可租面积',
field: 'kzmj',
width: 'auto'
},
{
title: '自用面积',
field: 'zymj',
width: 'auto'
},
{
title: '配套面积',
field: 'ptmj',
width: 'auto'
},
{
title: '车位面积',
field: 'cwmj',
width: 'auto'
},
{
title: '标准层高',
field: 'bzcg',
},
{
title: '排序字段',
field: 'sort',
},
{
title: '组织编码',
field: 'orgCode',
},
{
title: '数据状态1有效0无效',
field: 'dataState',
width: 'auto'
},
{
title: '修改时间',
field: 'modifyTime',
},
{
title: '搜索值',
field: 'searchValue',
width: 'auto'
},
{
field: 'action',
@@ -275,23 +145,23 @@ export const modalSchema: FormSchemaGetter = () => [
},
},
{
label: '园区编码',
label: '小区/园区',
fieldName: 'communityCode',
component: 'Input',
rules: 'required',
},
{
label: '建筑编码',
fieldName: 'buildingCode',
component: 'Input',
rules: 'required',
},
{
label: '建筑名称',
fieldName: 'buildingName',
component: 'Input',
rules: 'required',
},
{
label: '建筑编码',
fieldName: 'buildingCode',
component: 'Input',
rules: 'required',
},
{
label: '省',
fieldName: 'province',
@@ -329,11 +199,10 @@ export const modalSchema: FormSchemaGetter = () => [
rules: 'required',
},
{
label: '产权性质(1:自持2承租3自持+承租,4政府免费使用)',
label: '产权性质',
fieldName: 'cqxz',
component: 'Select',
componentProps: {
// 可选从DictEnum中获取 DictEnum.WY_CQXZ 便于维护
options: getDictOptions('wy_cqxz'),
},
rules: 'selectRequired',
@@ -351,7 +220,7 @@ export const modalSchema: FormSchemaGetter = () => [
rules: 'required',
},
{
label: '地编号',
label: '地编号',
fieldName: 'tdbh',
component: 'Input',
rules: 'required',
@@ -402,31 +271,5 @@ export const modalSchema: FormSchemaGetter = () => [
label: '排序字段',
fieldName: 'sort',
component: 'Input',
},
{
label: '组织编码',
fieldName: 'orgCode',
component: 'Input',
rules: 'required',
},
{
label: '数据状态1有效0无效',
fieldName: 'dataState',
component: 'Input',
},
{
label: '修改时间',
fieldName: 'modifyTime',
component: 'DatePicker',
componentProps: {
showTime: true,
format: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'YYYY-MM-DD HH:mm:ss',
},
},
{
label: '搜索值',
fieldName: 'searchValue',
component: 'Input',
},
}
];

View File

@@ -1,20 +1,12 @@
<script setup lang="ts">
import type { Recordable } from '@vben/types';
import { ref } from 'vue';
import { Page, useVbenModal, type VbenFormProps } from '@vben/common-ui';
import { getVxePopupContainer } from '@vben/utils';
import { Modal, Popconfirm, Space } from 'ant-design-vue';
import dayjs from 'dayjs';
import {
import {
useVbenVxeGrid,
vxeCheckboxChecked,
type VxeGridProps
type VxeGridProps
} from '#/adapter/vxe-table';
import {
buildingExport,
buildingList,
@@ -22,8 +14,8 @@ import {
} from '#/api/property/building';
import type { BuildingForm } from '#/api/property/building/model';
import { commonDownloadExcel } from '#/utils/file/download';
import buildingModal from './building-modal.vue';
import buildingDetail from './building-detail.vue';
import { columns, querySchema } from './data';
const formOptions: VbenFormProps = {
@@ -35,28 +27,13 @@ const formOptions: VbenFormProps = {
},
schema: querySchema(),
wrapperClass: 'grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4',
// 处理区间选择器RangePicker时间格式 将一个字段映射为两个字段 搜索/导出会用到
// 不需要直接删除
// fieldMappingTime: [
// [
// 'createTime',
// ['params[beginTime]', 'params[endTime]'],
// ['YYYY-MM-DD 00:00:00', 'YYYY-MM-DD 23:59:59'],
// ],
// ],
};
const gridOptions: VxeGridProps = {
checkboxConfig: {
// 高亮
highlight: true,
// 翻页时保留选中状态
reserve: true,
// 点击行选中
// trigger: 'row',
},
// 需要使用i18n注意这里要改成getter形式 否则切换语言不会刷新
// columns: columns(),
columns,
height: 'auto',
keepSource: true,
@@ -75,7 +52,6 @@ const gridOptions: VxeGridProps = {
rowConfig: {
keyField: 'id',
},
// 表格全局唯一表示 保存列配置需要用到
id: 'property-building-index'
};
@@ -88,6 +64,15 @@ const [BuildingModal, modalApi] = useVbenModal({
connectedComponent: buildingModal,
});
const [buildingDetailModal, buildingDetailApi] = useVbenModal({
connectedComponent: buildingDetail,
});
async function handleInfo(row: Required<BuildingForm>) {
buildingDetailApi.setData({ id: row.id });
buildingDetailApi.open();
}
function handleAdd() {
modalApi.setData({});
modalApi.open();
@@ -138,8 +123,8 @@ function handleDownloadExcel() {
<a-button
:disabled="!vxeCheckboxChecked(tableApi)"
danger
type="primary"
v-access:code="['property:building:remove']"
type="primary"
v-access:code="['property:building:remove']"
@click="handleMultiDelete">
{{ $t('pages.common.delete') }}
</a-button>
@@ -154,6 +139,11 @@ function handleDownloadExcel() {
</template>
<template #action="{ row }">
<Space>
<ghost-button
@click.stop="handleInfo(row)"
>
{{ $t('pages.common.info') }}
</ghost-button>
<ghost-button
v-access:code="['property:building:edit']"
@click.stop="handleEdit(row)"
@@ -178,5 +168,6 @@ function handleDownloadExcel() {
</template>
</BasicTable>
<BuildingModal @reload="tableApi.query()" />
<buildingDetailModal/>
</Page>
</template>

View File

@@ -0,0 +1,232 @@
<script setup lang="ts">
import { computed, ref } from 'vue';
import { useVbenModal } from '@vben/common-ui';
import { $t } from '@vben/locales';
import { cloneDeep } from '@vben/utils';
import { useVbenForm } from '#/adapter/form';
import { cleanList } from '#/api/property/clean';
import { defaultFormValueGetter, useBeforeCloseDiff } from '#/utils/popup';
const emit = defineEmits<{ reload: [data: any] }>();
const isUpdate = ref(false);
const title = computed(() => {
return isUpdate.value ? $t('pages.common.edit') : $t('pages.common.add');
});
// 缓存清洁服务数据
let cleanListData: any[] = [];
const detailSchema = [
{
label: '劳务名称',
fieldName: 'name',
component: 'ApiSelect',
componentProps: {
api: async () => {
const res = await cleanList({stater:1});
cleanListData = res.rows || [];
return res;
},
resultField: 'rows',
labelField: 'name',
valueField: 'id',
onChange: async (value: string) => {
// 找到选中的服务数据
const selectedService = cleanListData.find(item => item.id === value);
if (selectedService) {
// 自动填充其他字段
await formApi.setValues({
measure: selectedService.measure,
method: selectedService.method,
peices: selectedService.peices,
frequency: selectedService.frequency,
standard: selectedService.standard,
remark: selectedService.remark,
stater: selectedService.stater,
});
}
},
},
rules: 'required',
},
{
label: '保洁面积',
fieldName: 'area',
component: 'InputNumber',
rules: 'required',
componentProps: {
onChange: async (value: number) => {
const formValues = await formApi.getValues();
if (formValues.peices && value) {
await formApi.setValues({
sumPeices: Number((formValues.peices * value).toFixed(2)),
});
}
},
},
},
{
label: '计量单位',
fieldName: 'measure',
component: 'Input',
componentProps: {
disabled: true,
},
rules: 'required',
},
{
label: '计算方式',
fieldName: 'method',
component: 'Input',
componentProps: {
disabled: true,
},
rules: 'required',
},
{
label: '申报单价含税(元)',
fieldName: 'peices',
component: 'InputNumber',
componentProps: {
disabled: true,
},
rules: 'required',
},
{
label: '保洁频率',
fieldName: 'frequency',
component: 'Input',
componentProps: {
disabled: true,
},
rules: 'required',
},
{
label: '保洁标准',
fieldName: 'standard',
component: 'Input',
componentProps: {
disabled: true,
},
rules: 'required',
},
{
label: '备注',
fieldName: 'remark',
component: 'Input',
componentProps: {
disabled: true,
},
},
{
label: '状态',
fieldName: 'stater',
component: 'Select',
componentProps: {
disabled: true,
options: [
{ label: '上架', value: 1 },
{ label: '下架', value: 0 },
],
},
rules: 'required',
},
{
label: '合计费用',
fieldName: 'sumPeices',
component: 'InputNumber',
componentProps: {
disabled: true,
},
},
];
const [BasicForm, formApi] = useVbenForm({
commonConfig: {
labelWidth: 120,
componentProps: {
class: 'w-full',
},
},
schema: detailSchema,
showDefaultActions: false,
});
const { onBeforeClose, markInitialized, resetInitialized } = useBeforeCloseDiff(
{
initializedGetter: defaultFormValueGetter(formApi),
currentGetter: defaultFormValueGetter(formApi),
},
);
const [BasicModal, modalApi] = useVbenModal({
onBeforeClose,
onClosed: handleClosed,
onConfirm: handleConfirm,
onOpenChange: async (isOpen) => {
if (!isOpen) {
return null;
}
modalApi.modalLoading(true);
const { id } = modalApi.getData() as { id?: number | string };
isUpdate.value = !!id;
if (isUpdate.value && id) {
// TODO: 获取详情数据
}
await markInitialized();
modalApi.modalLoading(false);
},
});
async function handleConfirm() {
try {
modalApi.lock(true);
const { valid } = await formApi.validate();
if (!valid) {
return;
}
const data = cloneDeep(await formApi.getValues());
// 获取选中的服务名称
const selectedService = cleanListData.find(item => item.id === data.name);
if (selectedService) {
data.name = selectedService.name;
data.id = selectedService.id
}
console.log(data);
handleClosed()
await markInitialized();
emit('reload', data);
modalApi.close();
} catch (error) {
console.error(error);
} finally {
modalApi.lock(false);
}
}
async function handleClosed() {
await formApi.resetForm();
resetInitialized();
}
</script>
<template>
<BasicModal :title="title">
<BasicForm />
</BasicModal>
</template>
<style scoped>
/* 使用 :deep() 穿透 scoped 样式,影响子组件 */
:deep(.ant-input[disabled]),
:deep(.ant-input-number-disabled .ant-input-number-input),
:deep(.ant-select-disabled .ant-select-selection-item) {
/* 设置一个更深的颜色,可以自己调整 */
color: rgba(0, 0, 0, 0.65) !important;
/* 有些浏览器需要这个来覆盖默认颜色 */
-webkit-text-fill-color: rgba(0, 0, 0, 0.65) !important;
}
</style>

View File

@@ -12,11 +12,19 @@ import type { CleanVO } from '#/api/property/clean/model';
import { clean_orderAdd, clean_orderInfo, clean_orderUpdate } from '#/api/property/clean_order';
import { defaultFormValueGetter, useBeforeCloseDiff } from '#/utils/popup';
import { resident_unitList } from '#/api/property/resident/unit';
import { useVbenVxeGrid } from '#/adapter/vxe-table';
import type { VxeGridProps } from '#/adapter/vxe-table';
import cleanDetailModal from './clean-detail-modal.vue';
import { Table, Button } from 'ant-design-vue';
import { modalSchema } from './data';
const emit = defineEmits<{ reload: [] }>();
const totalSumPeices = computed(() => {
return detailTable.value
.reduce((total: number, item: any) => total + (Number(item.sumPeices) || 0), 0)
.toFixed(2);
});
const emit = defineEmits<{ reload: [] }>();
const isUpdate = ref(false);
const title = computed(() => {
return isUpdate.value ? $t('pages.common.edit') : $t('pages.common.add');
@@ -99,8 +107,9 @@ const [BasicModal, modalApi] = useVbenModal({
const { id } = modalApi.getData() as { id?: number | string };
isUpdate.value = !!id;
if (isUpdate.value && id) {
const record = await clean_orderInfo(id);
const record:any = await clean_orderInfo(id);
if (record.starTime) record.starTime = dayjs(record.starTime);
if (record.endTime) record.endTime = dayjs(record.endTime);
editUnitId.value = record.unitId || '';
@@ -112,6 +121,134 @@ const [BasicModal, modalApi] = useVbenModal({
},
});
// 添加订单详情表格配置
const detailGridOptions: VxeGridProps = {
height: '300px',
columns: [
{
title: '序号',
field: 'index',
width: 'auto',
slots: {
default: ({ rowIndex }) => {
return (rowIndex + 1).toString();
},
},
},
{
title: '劳务名称',
field: 'name',
width: 'auto',
},
{
title: '计量单位',
field: 'measure',
width: 'auto',
},
{
title: '计算方式',
field: 'method',
width: 'auto',
},
{
title: '申报单价含税(元)',
field: 'peices',
width: 'auto',
},
{
title: '保洁频率',
field: 'frequency',
width: 'auto',
},
{
title: '保洁标准',
field: 'standard',
width: 'auto',
},
{
title: '备注',
field: 'remark',
width: 'auto',
},
{
title: '状态',
field: 'stater',
width: 'auto',
slots: {
default: ({ row }) => row.stater === 1 ? '启用' : '禁用',
},
},
{
title: '保洁面积',
field: 'area',
width: 'auto',
},
{
title: '合计费用',
field: 'sumPeices',
width: 'auto',
},
{
field: 'action',
fixed: 'right',
slots: { default: 'action' },
title: '操作',
width: 'auto',
},
],
data: [],
};
const detailColumns = [
{ title: '序号', key: 'index', width: 'auto'},
{ title: '劳务名称', dataIndex: 'name', key: 'name', width: 'auto' },
{ title: '计量单位', dataIndex: 'measure', key: 'measure', width: 'auto' },
{ title: '计算方式', dataIndex: 'method', key: 'method', width: 'auto' },
{ title: '申报单价含税(元)', dataIndex: 'peices', key: 'peices' , width: 'auto'},
{ title: '保洁频率', dataIndex: 'frequency', key: 'frequency' , width: 'auto'},
{ title: '保洁标准', dataIndex: 'standard', key: 'standard' , width: 'auto'},
{ title: '备注', dataIndex: 'remark', key: 'remark' , width: 'auto'},
{
title: '状态',
dataIndex: 'stater',
key: 'stater',
width: 'auto',
customRender: ({ value }: { value: number }) => (value === 1 ? '启用' : '禁用')
},
{ title: '保洁面积', dataIndex: 'area', key: 'area', width: 'auto' },
{ title: '合计费用', dataIndex: 'sumPeices', key: 'sumPeices', width: 'auto' },
{
title: '操作',
key: 'action',
fixed: 'right' as const,
width: 'auto',
},
]
const [DetailTable, detailTableApi] = useVbenVxeGrid({
gridOptions: detailGridOptions,
});
const detailTable = ref<any>([])
const [CleanDetailModal, detailModalApi] = useVbenModal({
connectedComponent: cleanDetailModal,
});
function handleAddDetail() {
detailModalApi.setData({});
detailModalApi.open();
}
function handleDetailReload(data: any) {
detailTable.value.push(data)
}
function handleDeleteDetail(record: any,index: number) {
console.log(record,index);
detailTable.value.splice(index,1)
}
async function handleConfirm() {
try {
modalApi.lock(true);
@@ -120,15 +257,13 @@ async function handleConfirm() {
return;
}
const data = cloneDeep(await formApi.getValues());
console.log(data);
console.log(data);
// 单位数据缓存
if (unitListData.length === 0) {
const res = await resident_unitList();
unitListData = res.rows || [];
}
// 劳务数据缓存 cleanListData 已有
// 查找label
const unitObj = unitListData.find(item => item.id === data.unit);
const cleanObj = cleanListData.find(item => item.id === data.name);
@@ -138,9 +273,9 @@ console.log(data);
data.unitId = unitObj ? unitObj.id : (isUpdate.value ? editUnitId.value : '');
data.cleanId = cleanObj ? cleanObj.id : (isUpdate.value ? editCleanId.value : '');
// 如不需要原字段可删除
// delete data.unit;
// delete data.name;
// 组装 cleanIds
data.cleanIds = detailTable.value.map((item: any) => item.id);
data.details = detailTable.value;
await (isUpdate.value ? clean_orderUpdate(data) : clean_orderAdd(data));
resetInitialized();
@@ -160,8 +295,54 @@ async function handleClosed() {
</script>
<template>
<BasicModal :title="title">
<BasicModal :title="title" >
<BasicForm />
<!-- 添加订单详情部分 -->
<div class="mt-4">
<div class="flex items-center justify-between mb-2">
<h3 class="text-lg font-medium">添加保洁订单详情</h3>
<a-button type="primary" @click="handleAddDetail">
{{ $t('pages.common.add') }}
</a-button>
</div>
<Table :dataSource="detailTable" :columns="detailColumns" :pagination="false" >
<template #bodyCell="{ column, index,record }">
<template v-if="column.key === 'index'">
{{ index + 1 }}
</template>
<template v-else-if="column.key === 'action'">
<Button danger @click="handleDeleteDetail(record,index)">删除</Button>
</template>
</template>
</Table>
<div>费用合计{{ totalSumPeices }}</div>
</div>
<CleanDetailModal @reload="handleDetailReload" />
</BasicModal>
</template>
<style scoped>
.mt-4 {
margin-top: 1rem;
}
.mb-2 {
margin-bottom: 0.5rem;
}
.flex {
display: flex;
}
.items-center {
align-items: center;
}
.justify-between {
justify-content: space-between;
}
.text-lg {
font-size: 1.125rem;
line-height: 1.75rem;
}
.font-medium {
font-weight: 500;
}
</style>

View File

@@ -39,10 +39,10 @@ export const querySchema: FormSchemaGetter = () => [
// 需要使用i18n注意这里要改成getter形式 否则切换语言不会刷新
// export const columns: () => VxeGridProps['columns'] = () => [
export const columns: VxeGridProps['columns'] = [
{ type: 'checkbox', width: 60 },
{
title: '序号',
field: 'id',
width:'60',
slots: {
default: ({ rowIndex }) => {
return (rowIndex + 1).toString();
@@ -52,26 +52,32 @@ export const columns: VxeGridProps['columns'] = [
{
title: '服务地址',
field: 'location',
width: 'auto',
},
{
title: '服务面积(㎡)',
field: 'area',
width: 'auto',
},
{
title: '劳务名称',
field: 'name',
width: 'auto',
},
{
title: '申报单价含税(元)',
field: 'prices',
width: 'auto',
},
{
title: '合计费用',
field: 'sumPeices',
width: 'auto',
},
{
title: '支付状态',
field: 'payState',
width: 'auto',
slots: {
default: ({ row }) => row.stater === 1 ? '已支付' : '待支付',
},
@@ -79,22 +85,30 @@ export const columns: VxeGridProps['columns'] = [
{
title: '服务开始时间',
field: 'starTime',
width: 'auto',
},
{
title: '服务结束时间',
field: 'endTime',
width: 'auto',
},
{
title: '申请单位',
field: 'unit',
width: 'auto',
},
{
title: '申请人',
field: 'persion',
width: 'auto',
},
{
title: '联系电话',
field: 'phone',
width: 'auto',
},
// {
// title: '提交时间',
@@ -105,7 +119,6 @@ export const columns: VxeGridProps['columns'] = [
fixed: 'right',
slots: { default: 'action' },
title: '操作',
width: 180,
},
];
@@ -131,28 +144,28 @@ export const modalSchema: FormSchemaGetter = () => [
component: 'Input',
rules: 'required',
},
{
label: '劳务名称',
fieldName: 'name',
component: 'ApiSelect',
componentProps: {
api: cleanList,
resultField: 'rows',
labelField: 'name',
valueField: 'id',
},
rules: 'required',
},
{
label: '服务单价',
fieldName: 'prices',
component: 'Input',
rules: 'required',
componentProps: {
placeholder: '',
disabled: true,
},
},
// {
// label: '劳务名称',
// fieldName: 'name',
// component: 'ApiSelect',
// componentProps: {
// api: cleanList,
// resultField: 'rows',
// labelField: 'name',
// valueField: 'id',
// },
// rules: 'required',
// },
// {
// label: '服务单价',
// fieldName: 'prices',
// component: 'Input',
// rules: 'required',
// componentProps: {
// placeholder: '',
// disabled: true,
// },
// },
// {
// label: '保洁频率',
// fieldName: 'frequency',

View File

@@ -31,11 +31,9 @@ export const querySchema: FormSchemaGetter = () => [
// 需要使用i18n注意这里要改成getter形式 否则切换语言不会刷新
// export const columns: () => VxeGridProps['columns'] = () => [
export const columns: VxeGridProps['columns'] = [
{ type: 'checkbox', width: 60 },
{
title: '序号',
field: 'id',
width: 60,
slots: {
default: ({ rowIndex }) => {
return (rowIndex + 1).toString();
@@ -45,22 +43,27 @@ export const columns: VxeGridProps['columns'] = [
{
title: '劳务名称',
field: 'name',
width:'120'
},
{
title: '计量单位',
field: 'measure',
width:'120'
},
{
title: '计算方式',
field: 'method',
width:'120'
},
{
title: '申报单价含税(元)',
field: 'peices',
width: 'auto',
},
{
title: '保洁频率',
field: 'frequency',
width:'120'
},
// {
// title: '保洁内容',
@@ -69,14 +72,17 @@ export const columns: VxeGridProps['columns'] = [
{
title: '保洁标准',
field: 'standard',
width:'200'
},
{
title: '备注',
field: 'remark',
width:'200'
},
{
title: '状态',
field: 'stater',
width:'120',
slots: {
default: ({ row }) => row.stater === 1 ? '上架' : '下架',
},
@@ -90,7 +96,7 @@ export const columns: VxeGridProps['columns'] = [
fixed: 'right',
slots: { default: 'action' },
title: '操作',
width: 180,
width: 'auto',
},
];
@@ -127,6 +133,7 @@ export const modalSchema: FormSchemaGetter = () => [
fieldName: 'peices',
component: 'Input',
rules: 'required',
width: 300,
},
{
label: '保洁频率',

View File

@@ -0,0 +1,73 @@
<script setup lang="ts">
import type {Community} from '#/api/property/community/model';
import {shallowRef} from 'vue';
import {useVbenModal} from '@vben/common-ui';
import {Descriptions, DescriptionsItem} from 'ant-design-vue';
import {communityInfo} from '#/api/property/community';
import {renderDict} from "#/utils/render";
const [BasicModal, modalApi] = useVbenModal({
onOpenChange: handleOpenChange,
onClosed() {
communityDetail.value = null;
},
});
const communityDetail = shallowRef<null | Community>(null);
async function handleOpenChange(open: boolean) {
if (!open) {
return null;
}
modalApi.modalLoading(true);
const {id} = modalApi.getData() as { id: number | string };
const response = await communityInfo(id);
communityDetail.value = response;
modalApi.modalLoading(false);
}
</script>
<template>
<BasicModal :footer="false" :fullscreen-button="false" title="小区管理信息" class="w-[70%]">
<Descriptions v-if="communityDetail" size="small" :column="2" bordered :labelStyle="{width:'100px'}">
<DescriptionsItem label="小区名称">
{{ communityDetail.communityName }}
</DescriptionsItem>
<DescriptionsItem label="小区编码">
{{ communityDetail.communityCode }}
</DescriptionsItem>
<DescriptionsItem label="小区类型" v-if="communityDetail.communityType!=null">
<component
:is="renderDict(communityDetail.communityType,'wy_sqlx')"
/>
</DescriptionsItem>
<DescriptionsItem label="省">
{{ communityDetail.province }}
</DescriptionsItem>
<DescriptionsItem label="市">
{{ communityDetail.city }}
</DescriptionsItem>
<DescriptionsItem label="区">
{{ communityDetail.district }}
</DescriptionsItem>
<DescriptionsItem label="地址">
{{ communityDetail.addr }}
</DescriptionsItem>
<DescriptionsItem label="经度">
{{ communityDetail.lon }}
</DescriptionsItem>
<DescriptionsItem label="维度">
{{ communityDetail.lat }}
</DescriptionsItem>
<DescriptionsItem label="小图图片">
{{ communityDetail.img }}
</DescriptionsItem>
<DescriptionsItem label="组织编码">
{{ communityDetail.orgCode }}
</DescriptionsItem>
<DescriptionsItem label="修改时间">
{{ communityDetail.modifyTime }}
</DescriptionsItem>
</Descriptions>
</BasicModal>
</template>

View File

@@ -1,30 +1,24 @@
<script setup lang="ts">
import { computed, ref } from 'vue';
import { useVbenModal } from '@vben/common-ui';
import { $t } from '@vben/locales';
import { cloneDeep } from '@vben/utils';
import { useVbenForm } from '#/adapter/form';
import { communityAdd, communityInfo, communityUpdate } from '#/api/property/community';
import { defaultFormValueGetter, useBeforeCloseDiff } from '#/utils/popup';
import { modalSchema } from './data';
const emit = defineEmits<{ reload: [] }>();
const isUpdate = ref(false);
const title = computed(() => {
return isUpdate.value ? $t('pages.common.edit') : $t('pages.common.add');
});
const [BasicForm, formApi] = useVbenForm({
commonConfig: {
// 默认占满两列
formItemClass: 'col-span-2',
// 默认label宽度 px
labelWidth: 80,
// 通用配置项 会影响到所有表单项
componentProps: {
class: 'w-full',
}
@@ -42,7 +36,6 @@ const { onBeforeClose, markInitialized, resetInitialized } = useBeforeCloseDiff(
);
const [BasicModal, modalApi] = useVbenModal({
// 在这里更改宽度
class: 'w-[550px]',
fullscreenButton: false,
onBeforeClose,
@@ -53,16 +46,13 @@ const [BasicModal, modalApi] = useVbenModal({
return null;
}
modalApi.modalLoading(true);
const { id } = modalApi.getData() as { id?: number | string };
isUpdate.value = !!id;
if (isUpdate.value && id) {
const record = await communityInfo(id);
await formApi.setValues(record);
}
await markInitialized();
modalApi.modalLoading(false);
},
});
@@ -74,7 +64,6 @@ async function handleConfirm() {
if (!valid) {
return;
}
// getValues获取为一个readonly的对象 需要修改必须先深拷贝一次
const data = cloneDeep(await formApi.getValues());
await (isUpdate.value ? communityUpdate(data) : communityAdd(data));
resetInitialized();

View File

@@ -1,6 +1,5 @@
import type { FormSchemaGetter } from '#/adapter/form';
import type { VxeGridProps } from '#/adapter/vxe-table';
import { getDictOptions } from '#/utils/dict';
import { renderDict } from '#/utils/render';
@@ -8,101 +7,47 @@ export const querySchema: FormSchemaGetter = () => [
{
component: 'Input',
fieldName: 'communityName',
label: '区名称',
label: '区名称',
},
{
component: 'Input',
fieldName: 'communityCode',
label: '区编码',
label: '区编码',
},
{
component: 'Select',
componentProps: {
// 可选从DictEnum中获取 DictEnum.WY_SQLX 便于维护
options: getDictOptions('wy_sqlx'),
},
fieldName: 'communityType',
label: '区类型 1园区2小区',
},
{
component: 'Input',
fieldName: 'province',
label: '省',
},
{
component: 'Input',
fieldName: 'city',
label: '市',
},
{
component: 'Input',
fieldName: 'district',
label: '区',
},
{
component: 'Input',
fieldName: 'addr',
label: '地址',
},
{
component: 'Input',
fieldName: 'lon',
label: '经度',
},
{
component: 'Input',
fieldName: 'lat',
label: '维度',
},
{
component: 'Input',
fieldName: 'img',
label: '小图图片',
},
{
component: 'Input',
fieldName: 'orgCode',
label: '组织编码',
},
{
component: 'Input',
fieldName: 'dataState',
label: '数据状态1有效0无效',
},
{
component: 'DatePicker',
componentProps: {
showTime: true,
format: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'YYYY-MM-DD HH:mm:ss',
},
fieldName: 'modifyTime',
label: '修改时间',
},
label: '区类型',
}
];
// 需要使用i18n注意这里要改成getter形式 否则切换语言不会刷新
// export const columns: () => VxeGridProps['columns'] = () => [
export const columns: VxeGridProps['columns'] = [
{ type: 'checkbox', width: 60 },
{
title: '主键',
title: '序号',
field: 'id',
slots: {
default: ({ rowIndex }) => {
return (rowIndex + 1).toString();
},
},
},
{
title: '区名称',
title: '区名称',
field: 'communityName',
},
{
title: '区编码',
title: '区编码',
field: 'communityCode',
},
{
title: '区类型 1园区2小区',
title: '区类型',
field: 'communityType',
slots: {
default: ({ row }) => {
// 可选从DictEnum中获取 DictEnum.WY_SQLX 便于维护
return renderDict(row.communityType, 'wy_sqlx');
},
},
@@ -135,14 +80,6 @@ export const columns: VxeGridProps['columns'] = [
title: '小图图片',
field: 'img',
},
{
title: '组织编码',
field: 'orgCode',
},
{
title: '数据状态1有效0无效',
field: 'dataState',
},
{
title: '修改时间',
field: 'modifyTime',
@@ -167,23 +104,22 @@ export const modalSchema: FormSchemaGetter = () => [
},
},
{
label: '区名称',
label: '区名称',
fieldName: 'communityName',
component: 'Input',
rules: 'required',
},
{
label: '区编码',
label: '区编码',
fieldName: 'communityCode',
component: 'Input',
rules: 'required',
},
{
label: '区类型 1园区2小区',
label: '区类型',
fieldName: 'communityType',
component: 'Select',
componentProps: {
// 可选从DictEnum中获取 DictEnum.WY_SQLX 便于维护
options: getDictOptions('wy_sqlx'),
},
rules: 'selectRequired',
@@ -229,30 +165,6 @@ export const modalSchema: FormSchemaGetter = () => [
fieldName: 'img',
component: 'ImageUpload',
componentProps: {
// accept: 'image/*', // 可选拓展名或者mime类型 ,拼接
// maxCount: 1, // 最大上传文件数 默认为1 为1会绑定为string而非string[]类型
},
},
{
label: '组织编码',
fieldName: 'orgCode',
component: 'Input',
rules: 'required',
},
{
label: '数据状态1有效0无效',
fieldName: 'dataState',
component: 'Input',
rules: 'required',
},
{
label: '修改时间',
fieldName: 'modifyTime',
component: 'DatePicker',
componentProps: {
showTime: true,
format: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'YYYY-MM-DD HH:mm:ss',
},
},
}
];

View File

@@ -1,20 +1,12 @@
<script setup lang="ts">
import type { Recordable } from '@vben/types';
import { ref } from 'vue';
import { Page, useVbenModal, type VbenFormProps } from '@vben/common-ui';
import { getVxePopupContainer } from '@vben/utils';
import { Modal, Popconfirm, Space } from 'ant-design-vue';
import dayjs from 'dayjs';
import {
import {
useVbenVxeGrid,
vxeCheckboxChecked,
type VxeGridProps
type VxeGridProps
} from '#/adapter/vxe-table';
import {
communityExport,
communityList,
@@ -22,9 +14,10 @@ import {
} from '#/api/property/community';
import type { CommunityForm } from '#/api/property/community/model';
import { commonDownloadExcel } from '#/utils/file/download';
import communityModal from './community-modal.vue';
import { columns, querySchema } from './data';
import communityDetail from "#/views/property/community/community-detail.vue";
import type {BuildingForm} from "#/api/property/building/model";
const formOptions: VbenFormProps = {
commonConfig: {
@@ -35,28 +28,13 @@ const formOptions: VbenFormProps = {
},
schema: querySchema(),
wrapperClass: 'grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4',
// 处理区间选择器RangePicker时间格式 将一个字段映射为两个字段 搜索/导出会用到
// 不需要直接删除
// fieldMappingTime: [
// [
// 'createTime',
// ['params[beginTime]', 'params[endTime]'],
// ['YYYY-MM-DD 00:00:00', 'YYYY-MM-DD 23:59:59'],
// ],
// ],
};
const gridOptions: VxeGridProps = {
checkboxConfig: {
// 高亮
highlight: true,
// 翻页时保留选中状态
reserve: true,
// 点击行选中
// trigger: 'row',
},
// 需要使用i18n注意这里要改成getter形式 否则切换语言不会刷新
// columns: columns(),
columns,
height: 'auto',
keepSource: true,
@@ -75,7 +53,6 @@ const gridOptions: VxeGridProps = {
rowConfig: {
keyField: 'id',
},
// 表格全局唯一表示 保存列配置需要用到
id: 'property-community-index'
};
@@ -88,6 +65,15 @@ const [CommunityModal, modalApi] = useVbenModal({
connectedComponent: communityModal,
});
const [communityDetailModal, communityDetailApi] = useVbenModal({
connectedComponent: communityDetail,
});
async function handleInfo(row: Required<CommunityForm>) {
communityDetailApi.setData({ id: row.id });
communityDetailApi.open();
}
function handleAdd() {
modalApi.setData({});
modalApi.open();
@@ -138,8 +124,8 @@ function handleDownloadExcel() {
<a-button
:disabled="!vxeCheckboxChecked(tableApi)"
danger
type="primary"
v-access:code="['property:community:remove']"
type="primary"
v-access:code="['property:community:remove']"
@click="handleMultiDelete">
{{ $t('pages.common.delete') }}
</a-button>
@@ -154,6 +140,11 @@ function handleDownloadExcel() {
</template>
<template #action="{ row }">
<Space>
<ghost-button
@click.stop="handleInfo(row)"
>
{{ $t('pages.common.info') }}
</ghost-button>
<ghost-button
v-access:code="['property:community:edit']"
@click.stop="handleEdit(row)"
@@ -178,5 +169,6 @@ function handleDownloadExcel() {
</template>
</BasicTable>
<CommunityModal @reload="tableApi.query()" />
<communityDetailModal/>
</Page>
</template>

View File

@@ -1,12 +1,11 @@
import type { FormSchemaGetter } from '#/adapter/form';
import type { VxeGridProps } from '#/adapter/vxe-table';
export const querySchema: FormSchemaGetter = () => [
{
component: 'Input',
fieldName: 'communityCode',
label: '社区编码',
label: '小区/园区',
},
{
component: 'Input',
@@ -15,32 +14,34 @@ export const querySchema: FormSchemaGetter = () => [
},
{
component: 'Input',
fieldName: 'floorCode',
label: '楼层编码',
fieldName: 'floorName',
label: '楼层名称',
},
{
component: 'Input',
fieldName: 'floorName',
label: '楼层数名称',
fieldName: 'floorCode',
label: '楼层编码',
},
{
component: 'Input',
fieldName: 'orgCode',
label: '组织编码',
},
{
component: 'Input',
fieldName: 'dataState',
label: '数据状态1有效0无效',
},
];
// 需要使用i18n注意这里要改成getter形式 否则切换语言不会刷新
// export const columns: () => VxeGridProps['columns'] = () => [
export const columns: VxeGridProps['columns'] = [
{ type: 'checkbox', width: 60 },
{
title: '社区编码',
title: '序号',
field: 'id',
slots: {
default: ({ rowIndex }) => {
return (rowIndex + 1).toString();
},
},
},
{
title: '小区/园区',
field: 'communityCode',
},
{
@@ -48,12 +49,12 @@ export const columns: VxeGridProps['columns'] = [
field: 'buildingCode',
},
{
title: '楼层编码',
field: 'floorCode',
title: '楼层名称',
field: 'floorName',
},
{
title: '楼层数名称',
field: 'floorName',
title: '楼层编码',
field: 'floorCode',
},
{
title: '组织编码',
@@ -79,7 +80,7 @@ export const modalSchema: FormSchemaGetter = () => [
},
},
{
label: '社区编码',
label: '小区/园区',
fieldName: 'communityCode',
component: 'Input',
rules: 'required',
@@ -91,17 +92,23 @@ export const modalSchema: FormSchemaGetter = () => [
rules: 'required',
},
{
label: '楼层编码',
fieldName: 'floorCode',
label: '单元名称',
fieldName: 'buildingCode',
component: 'Input',
rules: 'required',
},
{
label: '楼层名称',
label: '楼层名称',
fieldName: 'floorName',
component: 'Input',
rules: 'required',
},
{
label: '楼层编码',
fieldName: 'floorCode',
component: 'Input',
rules: 'required',
},
{
label: '组织编码',
fieldName: 'orgCode',

View File

@@ -1,30 +1,24 @@
<script setup lang="ts">
import { computed, ref } from 'vue';
import { useVbenModal } from '@vben/common-ui';
import { $t } from '@vben/locales';
import { cloneDeep } from '@vben/utils';
import { useVbenForm } from '#/adapter/form';
import { floorAdd, floorInfo, floorUpdate } from '#/api/property/floor';
import { defaultFormValueGetter, useBeforeCloseDiff } from '#/utils/popup';
import { modalSchema } from './data';
const emit = defineEmits<{ reload: [] }>();
const isUpdate = ref(false);
const title = computed(() => {
return isUpdate.value ? $t('pages.common.edit') : $t('pages.common.add');
});
const [BasicForm, formApi] = useVbenForm({
commonConfig: {
// 默认占满两列
formItemClass: 'col-span-2',
// 默认label宽度 px
labelWidth: 80,
// 通用配置项 会影响到所有表单项
componentProps: {
class: 'w-full',
}
@@ -42,7 +36,6 @@ const { onBeforeClose, markInitialized, resetInitialized } = useBeforeCloseDiff(
);
const [BasicModal, modalApi] = useVbenModal({
// 在这里更改宽度
class: 'w-[550px]',
fullscreenButton: false,
onBeforeClose,
@@ -53,16 +46,13 @@ const [BasicModal, modalApi] = useVbenModal({
return null;
}
modalApi.modalLoading(true);
const { id } = modalApi.getData() as { id?: number | string };
isUpdate.value = !!id;
if (isUpdate.value && id) {
const record = await floorInfo(id);
await formApi.setValues(record);
}
await markInitialized();
modalApi.modalLoading(false);
},
});
@@ -74,7 +64,6 @@ async function handleConfirm() {
if (!valid) {
return;
}
// getValues获取为一个readonly的对象 需要修改必须先深拷贝一次
const data = cloneDeep(await formApi.getValues());
await (isUpdate.value ? floorUpdate(data) : floorAdd(data));
resetInitialized();

View File

@@ -7,7 +7,6 @@ import {
vxeCheckboxChecked,
type VxeGridProps
} from '#/adapter/vxe-table';
import {
floorExport,
floorList,
@@ -15,7 +14,6 @@ import {
} from '#/api/property/floor';
import type { FloorForm } from '#/api/property/floor/model';
import { commonDownloadExcel } from '#/utils/file/download';
import floorModal from './floor-modal.vue';
import { columns, querySchema } from './data';
@@ -28,28 +26,13 @@ const formOptions: VbenFormProps = {
},
schema: querySchema(),
wrapperClass: 'grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4',
// 处理区间选择器RangePicker时间格式 将一个字段映射为两个字段 搜索/导出会用到
// 不需要直接删除
// fieldMappingTime: [
// [
// 'createTime',
// ['params[beginTime]', 'params[endTime]'],
// ['YYYY-MM-DD 00:00:00', 'YYYY-MM-DD 23:59:59'],
// ],
// ],
};
const gridOptions: VxeGridProps = {
checkboxConfig: {
// 高亮
highlight: true,
// 翻页时保留选中状态
reserve: true,
// 点击行选中
// trigger: 'row',
},
// 需要使用i18n注意这里要改成getter形式 否则切换语言不会刷新
// columns: columns(),
columns,
height: 'auto',
keepSource: true,
@@ -68,7 +51,6 @@ const gridOptions: VxeGridProps = {
rowConfig: {
keyField: 'id',
},
// 表格全局唯一表示 保存列配置需要用到
id: 'property-floor-index'
};

View File

@@ -0,0 +1,257 @@
import type { FormSchemaGetter } from '#/adapter/form';
import type { VxeGridProps } from '#/adapter/vxe-table';
import { getDictOptions } from '#/utils/dict';
import { renderDict } from '#/utils/render';
export const querySchema: FormSchemaGetter = () => [
{
component: 'Input',
fieldName: 'orderId',
label: '订单id',
},
{
component: 'Input',
fieldName: 'userId',
label: '租赁人id',
},
{
component: 'Input',
fieldName: 'userName',
label: '租赁人名称',
},
{
component: 'Input',
fieldName: 'rent',
label: '租金',
},
{
component: 'Input',
fieldName: 'deposit',
label: '押金',
},
{
component: 'Input',
fieldName: 'penalty',
label: '违约金',
},
{
component: 'Input',
fieldName: 'totalAmount',
label: '总金额',
},
{
component: 'DatePicker',
componentProps: {
showTime: true,
format: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'YYYY-MM-DD HH:mm:ss',
},
fieldName: 'chargeDate',
label: '收费日期',
},
{
component: 'Select',
componentProps: {
options: getDictOptions('pro_payment_method'),
},
fieldName: 'paymentMethod',
label: '支付方式',
},
{
component: 'Select',
componentProps: {
options: getDictOptions('pro_invoice_status'),
},
fieldName: 'invoiceStatus',
label: '开票状态',
},
{
component: 'Input',
fieldName: 'invoiceType',
label: '发票类型',
},
{
component: 'Select',
componentProps: {
options: getDictOptions('pro_charging_status'),
},
fieldName: 'chargeStatus',
label: '收费状态',
},
];
export const columns: VxeGridProps['columns'] = [
{ type: 'checkbox', width: 60 },
{
title: '主键',
field: 'id',
},
{
title: '订单id',
field: 'orderId',
},
{
title: '租赁人id',
field: 'userId',
},
{
title: '租赁人名称',
field: 'userName',
},
{
title: '租金',
field: 'rent',
},
{
title: '押金',
field: 'deposit',
},
{
title: '违约金',
field: 'penalty',
},
{
title: '总金额',
field: 'totalAmount',
},
{
title: '收费日期',
field: 'chargeDate',
},
{
title: '支付方式',
field: 'paymentMethod',
slots: {
default: ({ row }) => {
return renderDict(row.paymentMethod, 'pro_payment_method');
},
},
},
{
title: '开票状态',
field: 'invoiceStatus',
slots: {
default: ({ row }) => {
return renderDict(row.invoiceStatus, 'pro_invoice_status');
},
},
},
{
title: '发票类型',
field: 'invoiceType',
},
{
title: '收费状态',
field: 'chargeStatus',
slots: {
default: ({ row }) => {
return renderDict(row.chargeStatus, 'pro_charging_status');
},
},
},
{
field: 'action',
fixed: 'right',
slots: { default: 'action' },
title: '操作',
width: 180,
},
];
export const modalSchema: FormSchemaGetter = () => [
{
label: '主键',
fieldName: 'id',
component: 'Input',
dependencies: {
show: () => false,
triggerFields: [''],
},
},
{
label: '订单id',
fieldName: 'orderId',
component: 'Input',
rules: 'required',
},
{
label: '租赁人id',
fieldName: 'userId',
component: 'Input',
rules: 'required',
},
{
label: '租赁人名称',
fieldName: 'userName',
component: 'Input',
rules: 'required',
},
{
label: '租金',
fieldName: 'rent',
component: 'Input',
rules: 'required',
},
{
label: '押金',
fieldName: 'deposit',
component: 'Input',
rules: 'required',
},
{
label: '违约金',
fieldName: 'penalty',
component: 'Input',
rules: 'required',
},
{
label: '总金额',
fieldName: 'totalAmount',
component: 'Input',
rules: 'required',
},
{
label: '收费日期',
fieldName: 'chargeDate',
component: 'DatePicker',
componentProps: {
showTime: true,
format: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'YYYY-MM-DD HH:mm:ss',
},
rules: 'required',
},
{
label: '支付方式',
fieldName: 'paymentMethod',
component: 'Select',
componentProps: {
options: getDictOptions('pro_payment_method'),
},
rules: 'selectRequired',
},
{
label: '开票状态',
fieldName: 'invoiceStatus',
component: 'Select',
componentProps: {
options: getDictOptions('pro_invoice_status'),
},
rules: 'selectRequired',
},
{
label: '发票类型',
fieldName: 'invoiceType',
component: 'Input',
rules: 'required',
},
{
label: '收费状态',
fieldName: 'chargeStatus',
component: 'Select',
componentProps: {
options: getDictOptions('pro_charging_status'),
},
rules: 'selectRequired',
},
];

View File

@@ -0,0 +1,157 @@
<script setup lang="ts">
import { Page, useVbenModal, type VbenFormProps } from '@vben/common-ui';
import { getVxePopupContainer } from '@vben/utils';
import { Modal, Popconfirm, Space } from 'ant-design-vue';
import {
useVbenVxeGrid,
vxeCheckboxChecked,
type VxeGridProps
} from '#/adapter/vxe-table';
import {
orderChargeExport,
orderChargeList,
orderChargeRemove,
} from '#/api/property/chargeManagement';
import type { OrderChargeForm } from '#/api/property/chargeManagement/model';
import { commonDownloadExcel } from '#/utils/file/download';
import orderChargeModal from './orderCharge-modal.vue';
import { columns, querySchema } from './data';
const formOptions: VbenFormProps = {
commonConfig: {
labelWidth: 80,
componentProps: {
allowClear: true,
},
},
schema: querySchema(),
wrapperClass: 'grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4',
};
const gridOptions: VxeGridProps = {
checkboxConfig: {
highlight: true,
reserve: true,
},
columns,
height: 'auto',
keepSource: true,
pagerConfig: {},
proxyConfig: {
ajax: {
query: async ({ page }, formValues = {}) => {
return await orderChargeList({
pageNum: page.currentPage,
pageSize: page.pageSize,
...formValues,
});
},
},
},
rowConfig: {
keyField: 'id',
},
id: 'system-orderCharge-index'
};
const [BasicTable, tableApi] = useVbenVxeGrid({
formOptions,
gridOptions,
});
const [OrderChargeModal, modalApi] = useVbenModal({
connectedComponent: orderChargeModal,
});
function handleAdd() {
modalApi.setData({});
modalApi.open();
}
async function handleEdit(row: Required<OrderChargeForm>) {
modalApi.setData({ id: row.id });
modalApi.open();
}
async function handleDelete(row: Required<OrderChargeForm>) {
await orderChargeRemove(row.id);
await tableApi.query();
}
function handleMultiDelete() {
const rows = tableApi.grid.getCheckboxRecords();
const ids = rows.map((row: Required<OrderChargeForm>) => row.id);
Modal.confirm({
title: '提示',
okType: 'danger',
content: `确认删除选中的${ids.length}条记录吗?`,
onOk: async () => {
await orderChargeRemove(ids);
await tableApi.query();
},
});
}
function handleDownloadExcel() {
commonDownloadExcel(orderChargeExport, '绿植租赁-订单收费数据', tableApi.formApi.form.values, {
fieldMappingTime: formOptions.fieldMappingTime,
});
}
</script>
<template>
<Page :auto-content-height="true">
<BasicTable table-title="绿植租赁-订单收费列表">
<template #toolbar-tools>
<Space>
<a-button
v-access:code="['system:orderCharge:export']"
@click="handleDownloadExcel"
>
{{ $t('pages.common.export') }}
</a-button>
<a-button
:disabled="!vxeCheckboxChecked(tableApi)"
danger
type="primary"
v-access:code="['system:orderCharge:remove']"
@click="handleMultiDelete">
{{ $t('pages.common.delete') }}
</a-button>
<a-button
type="primary"
v-access:code="['system:orderCharge:add']"
@click="handleAdd"
>
{{ $t('pages.common.add') }}
</a-button>
</Space>
</template>
<template #action="{ row }">
<Space>
<ghost-button
v-access:code="['system:orderCharge:edit']"
@click.stop="handleEdit(row)"
>
{{ $t('pages.common.edit') }}
</ghost-button>
<Popconfirm
:get-popup-container="getVxePopupContainer"
placement="left"
title="确认删除?"
@confirm="handleDelete(row)"
>
<ghost-button
danger
v-access:code="['system:orderCharge:remove']"
@click.stop=""
>
{{ $t('pages.common.delete') }}
</ghost-button>
</Popconfirm>
</Space>
</template>
</BasicTable>
<OrderChargeModal @reload="tableApi.query()" />
</Page>
</template>

View File

@@ -0,0 +1,90 @@
<script setup lang="ts">
import { computed, ref } from 'vue';
import { useVbenModal } from '@vben/common-ui';
import { $t } from '@vben/locales';
import { cloneDeep } from '@vben/utils';
import { useVbenForm } from '#/adapter/form';
import { orderChargeAdd, orderChargeInfo, orderChargeUpdate } from '#/api/property/chargeManagement';
import { defaultFormValueGetter, useBeforeCloseDiff } from '#/utils/popup';
import { modalSchema } from './data';
const emit = defineEmits<{ reload: [] }>();
const isUpdate = ref(false);
const title = computed(() => {
return isUpdate.value ? $t('pages.common.edit') : $t('pages.common.add');
});
const [BasicForm, formApi] = useVbenForm({
commonConfig: {
formItemClass: 'col-span-2',
labelWidth: 80,
componentProps: {
class: 'w-full',
}
},
schema: modalSchema(),
showDefaultActions: false,
wrapperClass: 'grid-cols-2',
});
const { onBeforeClose, markInitialized, resetInitialized } = useBeforeCloseDiff(
{
initializedGetter: defaultFormValueGetter(formApi),
currentGetter: defaultFormValueGetter(formApi),
},
);
const [BasicModal, modalApi] = useVbenModal({
class: 'w-[550px]',
fullscreenButton: false,
onBeforeClose,
onClosed: handleClosed,
onConfirm: handleConfirm,
onOpenChange: async (isOpen) => {
if (!isOpen) {
return null;
}
modalApi.modalLoading(true);
const { id } = modalApi.getData() as { id?: number | string };
isUpdate.value = !!id;
if (isUpdate.value && id) {
const record = await orderChargeInfo(id);
await formApi.setValues(record);
}
await markInitialized();
modalApi.modalLoading(false);
},
});
async function handleConfirm() {
try {
modalApi.lock(true);
const { valid } = await formApi.validate();
if (!valid) {
return;
}
const data = cloneDeep(await formApi.getValues());
await (isUpdate.value ? orderChargeUpdate(data) : orderChargeAdd(data));
resetInitialized();
emit('reload');
modalApi.close();
} catch (error) {
console.error(error);
} finally {
modalApi.lock(false);
}
}
async function handleClosed() {
await formApi.resetForm();
resetInitialized();
}
</script>
<template>
<BasicModal :title="title">
<BasicForm />
</BasicModal>
</template>

View File

@@ -0,0 +1,5 @@
<template>
<div>
养护管理
</div>
</template>

View File

@@ -0,0 +1,146 @@
import type { FormSchemaGetter } from '#/adapter/form';
import type { VxeGridProps } from '#/adapter/vxe-table';
import { getDictOptions } from '#/utils/dict';
import { renderDict } from '#/utils/render';
export const querySchema: FormSchemaGetter = () => [
{
component: 'Input',
fieldName: 'planName',
label: '方案名称',
},
{
component: 'Select',
fieldName: 'rentalPeriod',
label: '租赁周期',
componentProps: {
options:[
{ label: '月', value: 0 },
{ label: '季度', value: 1 },
{ label: '年', value: 2 },
]
},
},
{
component: 'Select',
componentProps: {
// 可选从DictEnum中获取 DictEnum.WY_KG 便于维护
options: getDictOptions('wy_kg'),
},
fieldName: 'state',
label: '状态',
},
];
// 需要使用i18n注意这里要改成getter形式 否则切换语言不会刷新
// export const columns: () => VxeGridProps['columns'] = () => [
export const columns: VxeGridProps['columns'] = [
{
title: '序号',
field: 'id',
},
{
title: '方案名称',
field: 'planName',
},
{
title: '租赁周期',
field: 'rentalPeriod',
},
{
title: '适用场景',
field: 'scene',
},
{
title: '植物组合包',
field: 'scene',
},
{
title: '基础服务项',
field: 'scene',
},
{
title: '价格',
field: 'price',
},
{
title: '状态',
field: 'state',
slots: {
default: ({ row }) => {
// 可选从DictEnum中获取 DictEnum.WY_KG 便于维护
return renderDict(row.state, 'wy_kg');
},
},
},
{
title: '备注',
field: 'remarks',
},
{
field: 'action',
fixed: 'right',
slots: { default: 'action' },
title: '操作',
width: 180,
},
];
export const modalSchema: FormSchemaGetter = () => [
{
label: '方案名称',
fieldName: 'planName',
component: 'Input',
rules: 'required',
},
{
label: '租赁周期',
fieldName: 'rentalPeriod',
component: 'Select',
rules: 'required',
componentProps: {
options:[
{ label: '月', value: 0 },
{ label: '季度', value: 1 },
{ label: '年', value: 2 },
]
},
},
{
label: '适用场景',
fieldName: 'scene',
component: 'Input',
rules: 'required',
},
{
label: '价格体系',
fieldName: 'price',
component: 'Input',
},
{
label: '基础服务项',
fieldName: 'price',
component: 'Select',
},
{
label: '优惠活动',
fieldName: 'price',
component: 'Input',
},
{
label: '状态',
fieldName: 'state',
component: 'Select',
componentProps: {
// 可选从DictEnum中获取 DictEnum.WY_KG 便于维护
options: getDictOptions('wy_kg'),
},
rules: 'selectRequired',
},
{
label: '备注',
fieldName: 'remarks',
component: 'Input',
},
];

View File

@@ -0,0 +1,182 @@
<script setup lang="ts">
import type { Recordable } from '@vben/types';
import { ref } from 'vue';
import { Page, useVbenModal, type VbenFormProps } from '@vben/common-ui';
import { getVxePopupContainer } from '@vben/utils';
import { Modal, Popconfirm, Space } from 'ant-design-vue';
import dayjs from 'dayjs';
import {
useVbenVxeGrid,
vxeCheckboxChecked,
type VxeGridProps
} from '#/adapter/vxe-table';
import {
rentalPlanExport,
rentalPlanList,
rentalPlanRemove,
} from '#/api/property/rentalPlan';
import type { RentalPlanForm } from '#/api/property/rentalPlan/model';
import { commonDownloadExcel } from '#/utils/file/download';
import rentalPlanModal from './rentalPlan-modal.vue';
import { columns, querySchema } from './data';
const formOptions: VbenFormProps = {
commonConfig: {
labelWidth: 80,
componentProps: {
allowClear: true,
},
},
schema: querySchema(),
wrapperClass: 'grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4',
// 处理区间选择器RangePicker时间格式 将一个字段映射为两个字段 搜索/导出会用到
// 不需要直接删除
// fieldMappingTime: [
// [
// 'createTime',
// ['params[beginTime]', 'params[endTime]'],
// ['YYYY-MM-DD 00:00:00', 'YYYY-MM-DD 23:59:59'],
// ],
// ],
};
const gridOptions: VxeGridProps = {
checkboxConfig: {
// 高亮
highlight: true,
// 翻页时保留选中状态
reserve: true,
// 点击行选中
// trigger: 'row',
},
// 需要使用i18n注意这里要改成getter形式 否则切换语言不会刷新
// columns: columns(),
columns,
height: 'auto',
keepSource: true,
pagerConfig: {},
proxyConfig: {
ajax: {
query: async ({ page }, formValues = {}) => {
return await rentalPlanList({
pageNum: page.currentPage,
pageSize: page.pageSize,
...formValues,
});
},
},
},
rowConfig: {
keyField: 'id',
},
// 表格全局唯一表示 保存列配置需要用到
id: 'property-rentalPlan-index'
};
const [BasicTable, tableApi] = useVbenVxeGrid({
formOptions,
gridOptions,
});
const [RentalPlanModal, modalApi] = useVbenModal({
connectedComponent: rentalPlanModal,
});
function handleAdd() {
modalApi.setData({});
modalApi.open();
}
async function handleEdit(row: Required<RentalPlanForm>) {
modalApi.setData({ id: row.id });
modalApi.open();
}
async function handleDelete(row: Required<RentalPlanForm>) {
await rentalPlanRemove(row.id);
await tableApi.query();
}
function handleMultiDelete() {
const rows = tableApi.grid.getCheckboxRecords();
const ids = rows.map((row: Required<RentalPlanForm>) => row.id);
Modal.confirm({
title: '提示',
okType: 'danger',
content: `确认删除选中的${ids.length}条记录吗?`,
onOk: async () => {
await rentalPlanRemove(ids);
await tableApi.query();
},
});
}
function handleDownloadExcel() {
commonDownloadExcel(rentalPlanExport, '绿植租赁-租赁方案数据', tableApi.formApi.form.values, {
fieldMappingTime: formOptions.fieldMappingTime,
});
}
</script>
<template>
<Page :auto-content-height="true">
<BasicTable table-title="绿植租赁-租赁方案列表">
<template #toolbar-tools>
<Space>
<a-button
v-access:code="['property:rentalPlan:export']"
@click="handleDownloadExcel"
>
{{ $t('pages.common.export') }}
</a-button>
<a-button
:disabled="!vxeCheckboxChecked(tableApi)"
danger
type="primary"
v-access:code="['property:rentalPlan:remove']"
@click="handleMultiDelete">
{{ $t('pages.common.delete') }}
</a-button>
<a-button
type="primary"
v-access:code="['property:rentalPlan:add']"
@click="handleAdd"
>
{{ $t('pages.common.add') }}
</a-button>
</Space>
</template>
<template #action="{ row }">
<Space>
<ghost-button
v-access:code="['property:rentalPlan:edit']"
@click.stop="handleEdit(row)"
>
{{ $t('pages.common.edit') }}
</ghost-button>
<Popconfirm
:get-popup-container="getVxePopupContainer"
placement="left"
title="确认删除?"
@confirm="handleDelete(row)"
>
<ghost-button
danger
v-access:code="['property:rentalPlan:remove']"
@click.stop=""
>
{{ $t('pages.common.delete') }}
</ghost-button>
</Popconfirm>
</Space>
</template>
</BasicTable>
<RentalPlanModal @reload="tableApi.query()" />
</Page>
</template>

View File

@@ -0,0 +1,101 @@
<script setup lang="ts">
import { computed, ref } from 'vue';
import { useVbenModal } from '@vben/common-ui';
import { $t } from '@vben/locales';
import { cloneDeep } from '@vben/utils';
import { useVbenForm } from '#/adapter/form';
import { rentalPlanAdd, rentalPlanInfo, rentalPlanUpdate } from '#/api/property/rentalPlan';
import { defaultFormValueGetter, useBeforeCloseDiff } from '#/utils/popup';
import { modalSchema } from './data';
const emit = defineEmits<{ reload: [] }>();
const isUpdate = ref(false);
const title = computed(() => {
return isUpdate.value ? $t('pages.common.edit') : $t('pages.common.add');
});
const [BasicForm, formApi] = useVbenForm({
commonConfig: {
// 默认占满两列
formItemClass: 'col-span-2',
// 默认label宽度 px
labelWidth: 80,
// 通用配置项 会影响到所有表单项
componentProps: {
class: 'w-full',
}
},
schema: modalSchema(),
showDefaultActions: false,
wrapperClass: 'grid-cols-2',
});
const { onBeforeClose, markInitialized, resetInitialized } = useBeforeCloseDiff(
{
initializedGetter: defaultFormValueGetter(formApi),
currentGetter: defaultFormValueGetter(formApi),
},
);
const [BasicModal, modalApi] = useVbenModal({
// 在这里更改宽度
class: 'w-[550px]',
fullscreenButton: false,
onBeforeClose,
onClosed: handleClosed,
onConfirm: handleConfirm,
onOpenChange: async (isOpen) => {
if (!isOpen) {
return null;
}
modalApi.modalLoading(true);
const { id } = modalApi.getData() as { id?: number | string };
isUpdate.value = !!id;
if (isUpdate.value && id) {
const record = await rentalPlanInfo(id);
await formApi.setValues(record);
}
await markInitialized();
modalApi.modalLoading(false);
},
});
async function handleConfirm() {
try {
modalApi.lock(true);
const { valid } = await formApi.validate();
if (!valid) {
return;
}
// getValues获取为一个readonly的对象 需要修改必须先深拷贝一次
const data = cloneDeep(await formApi.getValues());
await (isUpdate.value ? rentalPlanUpdate(data) : rentalPlanAdd(data));
resetInitialized();
emit('reload');
modalApi.close();
} catch (error) {
console.error(error);
} finally {
modalApi.lock(false);
}
}
async function handleClosed() {
await formApi.resetForm();
resetInitialized();
}
</script>
<template>
<BasicModal :title="title">
<BasicForm />
</BasicModal>
</template>

View File

@@ -0,0 +1,241 @@
import type { FormSchemaGetter } from '#/adapter/form';
import type { VxeGridProps } from '#/adapter/vxe-table';
import {getDictOptions} from "#/utils/dict";
export const querySchema: FormSchemaGetter = () => [
{
component: 'Input',
fieldName: 'orderNo',
label: '订单编号',
},
{
component: 'Input',
fieldName: 'customerName',
label: '客户名称',
},
{
component: 'Select',
componentProps: {
},
fieldName: 'customerType',
label: '客户类型',
},
{
component: 'Select',
componentProps: {
options:getDictOptions('wy_zlfs')
},
fieldName: 'rentalType',
label: '租赁方式',
},
{
component: 'Select',
componentProps: {
options:getDictOptions('pro_charging_status')
},
fieldName: 'paymentStatus',
label: '支付状态',
},
];
export const columns: VxeGridProps['columns'] = [
{ type: 'checkbox', width: 60 },
{
title: '订单号',
field: 'id',
},
{
title: '订单号',
field: 'orderNo',
},
{
title: '客户名称',
field: 'customerName',
},
{
title: '客户类型',
field: 'customerType',
},
{
title: '租赁周期',
field: 'rentalPeriod',
},
{
title: '租赁开始时间',
field: 'startTime',
},
{
title: '租赁结束时间',
field: 'endTime',
},
{
title: '应付总额',
field: 'totalAmount',
},
{
title: '租赁方式',
field: 'rentalType',
},
{
title: '租赁方案id',
field: 'planId',
},
{
title: '绿植产品id',
field: 'productId',
},
{
title: '租赁产品数量',
field: 'productNum',
},
{
title: '支付状态',
field: 'paymentStatus',
},
{
title: '是否续租',
field: 'isRelet',
},
{
title: '合同状态',
field: 'contractStatus',
},
{
title: '签署时间',
field: 'signTime',
},
{
field: 'action',
fixed: 'right',
slots: { default: 'action' },
title: '操作',
width: 180,
},
];
export const modalSchema: FormSchemaGetter = () => [
{
label: '主键',
fieldName: 'id',
component: 'Input',
dependencies: {
show: () => false,
triggerFields: [''],
},
},
{
label: '订单号',
fieldName: 'orderNo',
component: 'Input',
rules: 'required',
},
{
label: '客户名称',
fieldName: 'customerName',
component: 'Input',
rules: 'required',
},
{
label: '客户类型',
fieldName: 'customerType',
component: 'Select',
componentProps: {
},
rules: 'selectRequired',
},
{
label: '租赁周期',
fieldName: 'rentalPeriod',
component: 'Select',
componentProps: {
},
rules: 'selectRequired',
},
{
label: '租赁开始时间',
fieldName: 'startTime',
component: 'DatePicker',
componentProps: {
showTime: true,
format: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'YYYY-MM-DD HH:mm:ss',
},
rules: 'required',
},
{
label: '租赁结束时间',
fieldName: 'endTime',
component: 'DatePicker',
componentProps: {
showTime: true,
format: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'YYYY-MM-DD HH:mm:ss',
},
rules: 'required',
},
{
label: '应付总额',
fieldName: 'totalAmount',
component: 'Input',
rules: 'required',
},
{
label: '租赁方式',
fieldName: 'rentalType',
component: 'Select',
componentProps: {
},
rules: 'selectRequired',
},
{
label: '租赁方案id',
fieldName: 'planId',
component: 'Input',
},
{
label: '绿植产品id',
fieldName: 'productId',
component: 'Input',
},
{
label: '租赁产品数量',
fieldName: 'productNum',
component: 'Input',
},
{
label: '支付状态',
fieldName: 'paymentStatus',
component: 'Select',
componentProps: {
},
rules: 'selectRequired',
},
{
label: '是否续租',
fieldName: 'isRelet',
component: 'RadioGroup',
componentProps: {
buttonStyle: 'solid',
optionType: 'button',
},
},
{
label: '合同状态',
fieldName: 'contractStatus',
component: 'Select',
componentProps: {
},
},
{
label: '签署时间',
fieldName: 'signTime',
component: 'DatePicker',
componentProps: {
showTime: true,
format: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'YYYY-MM-DD HH:mm:ss',
},
},
];

View File

@@ -0,0 +1,178 @@
<script setup lang="ts">
import { Page, useVbenModal, type VbenFormProps } from '@vben/common-ui';
import { getVxePopupContainer } from '@vben/utils';
import { Modal, Popconfirm, Space } from 'ant-design-vue';
import {
useVbenVxeGrid,
vxeCheckboxChecked,
type VxeGridProps
} from '#/adapter/vxe-table';
import {
rentalOrderExport,
rentalOrderList,
rentalOrderRemove,
} from '#/api/property/rentalOrder';
import type { RentalOrderForm } from '#/api/property/rentalOrder/model';
import { commonDownloadExcel } from '#/utils/file/download';
import rentalOrderModal from './rentalOrder-modal.vue';
import { columns, querySchema } from './data';
const formOptions: VbenFormProps = {
commonConfig: {
labelWidth: 80,
componentProps: {
allowClear: true,
},
},
schema: querySchema(),
wrapperClass: 'grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4',
// 处理区间选择器RangePicker时间格式 将一个字段映射为两个字段 搜索/导出会用到
// 不需要直接删除
// fieldMappingTime: [
// [
// 'createTime',
// ['params[beginTime]', 'params[endTime]'],
// ['YYYY-MM-DD 00:00:00', 'YYYY-MM-DD 23:59:59'],
// ],
// ],
};
const gridOptions: VxeGridProps = {
checkboxConfig: {
// 高亮
highlight: true,
// 翻页时保留选中状态
reserve: true,
// 点击行选中
// trigger: 'row',
},
// 需要使用i18n注意这里要改成getter形式 否则切换语言不会刷新
// columns: columns(),
columns,
height: 'auto',
keepSource: true,
pagerConfig: {},
proxyConfig: {
ajax: {
query: async ({ page }, formValues = {}) => {
return await rentalOrderList({
pageNum: page.currentPage,
pageSize: page.pageSize,
...formValues,
});
},
},
},
rowConfig: {
keyField: 'id',
},
// 表格全局唯一表示 保存列配置需要用到
id: 'property-rentalOrder-index'
};
const [BasicTable, tableApi] = useVbenVxeGrid({
formOptions,
gridOptions,
});
const [RentalOrderModal, modalApi] = useVbenModal({
connectedComponent: rentalOrderModal,
});
function handleAdd() {
modalApi.setData({});
modalApi.open();
}
async function handleEdit(row: Required<RentalOrderForm>) {
modalApi.setData({ id: row.id });
modalApi.open();
}
async function handleDelete(row: Required<RentalOrderForm>) {
await rentalOrderRemove(row.id);
await tableApi.query();
}
function handleMultiDelete() {
const rows = tableApi.grid.getCheckboxRecords();
const ids = rows.map((row: Required<RentalOrderForm>) => row.id);
Modal.confirm({
title: '提示',
okType: 'danger',
content: `确认删除选中的${ids.length}条记录吗?`,
onOk: async () => {
await rentalOrderRemove(ids);
await tableApi.query();
},
});
}
function handleDownloadExcel() {
commonDownloadExcel(rentalOrderExport, '绿植租赁-订单管理数据', tableApi.formApi.form.values, {
fieldMappingTime: formOptions.fieldMappingTime,
});
}
</script>
<template>
<Page :auto-content-height="true">
<BasicTable table-title="绿植租赁-订单管理列表">
<template #toolbar-tools>
<Space>
<a-button
v-access:code="['property:rentalOrder:export']"
@click="handleDownloadExcel"
>
{{ $t('pages.common.export') }}
</a-button>
<a-button
:disabled="!vxeCheckboxChecked(tableApi)"
danger
type="primary"
v-access:code="['property:rentalOrder:remove']"
@click="handleMultiDelete">
{{ $t('pages.common.delete') }}
</a-button>
<a-button
type="primary"
v-access:code="['property:rentalOrder:add']"
@click="handleAdd"
>
{{ $t('pages.common.add') }}
</a-button>
</Space>
</template>
<template #action="{ row }">
<Space>
<ghost-button
v-access:code="['property:rentalOrder:edit']"
@click.stop="handleEdit(row)"
>
{{ $t('pages.common.edit') }}
</ghost-button>
<Popconfirm
:get-popup-container="getVxePopupContainer"
placement="left"
title="确认删除?"
@confirm="handleDelete(row)"
>
<ghost-button
danger
v-access:code="['property:rentalOrder:remove']"
@click.stop=""
>
{{ $t('pages.common.delete') }}
</ghost-button>
</Popconfirm>
</Space>
</template>
</BasicTable>
<RentalOrderModal @reload="tableApi.query()" />
</Page>
</template>

View File

@@ -0,0 +1,101 @@
<script setup lang="ts">
import { computed, ref } from 'vue';
import { useVbenModal } from '@vben/common-ui';
import { $t } from '@vben/locales';
import { cloneDeep } from '@vben/utils';
import { useVbenForm } from '#/adapter/form';
import { rentalOrderAdd, rentalOrderInfo, rentalOrderUpdate } from '#/api/property/rentalOrder';
import { defaultFormValueGetter, useBeforeCloseDiff } from '#/utils/popup';
import { modalSchema } from './data';
const emit = defineEmits<{ reload: [] }>();
const isUpdate = ref(false);
const title = computed(() => {
return isUpdate.value ? $t('pages.common.edit') : $t('pages.common.add');
});
const [BasicForm, formApi] = useVbenForm({
commonConfig: {
// 默认占满两列
formItemClass: 'col-span-2',
// 默认label宽度 px
labelWidth: 80,
// 通用配置项 会影响到所有表单项
componentProps: {
class: 'w-full',
}
},
schema: modalSchema(),
showDefaultActions: false,
wrapperClass: 'grid-cols-2',
});
const { onBeforeClose, markInitialized, resetInitialized } = useBeforeCloseDiff(
{
initializedGetter: defaultFormValueGetter(formApi),
currentGetter: defaultFormValueGetter(formApi),
},
);
const [BasicModal, modalApi] = useVbenModal({
// 在这里更改宽度
class: 'w-[550px]',
fullscreenButton: false,
onBeforeClose,
onClosed: handleClosed,
onConfirm: handleConfirm,
onOpenChange: async (isOpen) => {
if (!isOpen) {
return null;
}
modalApi.modalLoading(true);
const { id } = modalApi.getData() as { id?: number | string };
isUpdate.value = !!id;
if (isUpdate.value && id) {
const record = await rentalOrderInfo(id);
await formApi.setValues(record);
}
await markInitialized();
modalApi.modalLoading(false);
},
});
async function handleConfirm() {
try {
modalApi.lock(true);
const { valid } = await formApi.validate();
if (!valid) {
return;
}
// getValues获取为一个readonly的对象 需要修改必须先深拷贝一次
const data = cloneDeep(await formApi.getValues());
await (isUpdate.value ? rentalOrderUpdate(data) : rentalOrderAdd(data));
resetInitialized();
emit('reload');
modalApi.close();
} catch (error) {
console.error(error);
} finally {
modalApi.lock(false);
}
}
async function handleClosed() {
await formApi.resetForm();
resetInitialized();
}
</script>
<template>
<BasicModal :title="title">
<BasicForm />
</BasicModal>
</template>

View File

@@ -0,0 +1,160 @@
import type { FormSchemaGetter } from '#/adapter/form';
import type { VxeGridProps } from '#/adapter/vxe-table';
import { getDictOptions } from '#/utils/dict';
import { renderDict } from '#/utils/render';
export const querySchema: FormSchemaGetter = () => [
{
component: 'Input',
fieldName: 'plantName',
label: '产品名称',
},
{
component: 'Input',
fieldName: 'specification',
label: '规格',
},
{
component: 'Select',
componentProps: {
options: getDictOptions('product_management_status'),
},
fieldName: 'state',
label: '状态',
},
];
export const columns: VxeGridProps['columns'] = [
{ type: 'checkbox', width: 60 },
{
title: '序号',
field: 'id',
slots: {
default: ({ rowIndex }) => {
return (rowIndex + 1).toString();
},
},
},
{
title: '产品编号',
field: 'plantCode',
},
{
title: '产品名称',
field: 'plantName',
},
{
title: '产品分类',
field: 'plantType',
},
{
title: '图片',
field: 'imgPath',
},
{
title: '规格',
field: 'specification',
},
{
title: '租金',
field: 'rent',
},
{
title: '库存数量',
field: 'inventory',
},
{
title: '状态',
field: 'state',
slots: {
default: ({ row }) => {
return renderDict(row.state, 'product_management_status');
},
},
},
{
title: '备注',
field: 'remark',
},
{
title: '创建时间',
field: 'createTime',
},
{
field: 'action',
fixed: 'right',
slots: { default: 'action' },
title: '操作',
width: 180,
},
];
export const modalSchema: FormSchemaGetter = () => [
{
label: '主键',
fieldName: 'id',
component: 'Input',
dependencies: {
show: () => false,
triggerFields: [''],
},
},
{
label: '产品编号',
fieldName: 'plantCode',
component: 'Input',
rules: 'required',
},
{
label: '产品名称',
fieldName: 'plantName',
component: 'Input',
rules: 'required',
},
{
label: '产品分类',
fieldName: 'plantType',
component: 'Select',
componentProps: {
options: getDictOptions('pro_product_classification'),
},
rules: 'required',
},
{
label: '图片',
fieldName: 'imgPath',
component: 'Input',
},
{
label: '规格',
fieldName: 'specification',
component: 'Input',
rules: 'required',
},
{
label: '租金',
fieldName: 'rent',
component: 'Input',
rules: 'required',
},
{
label: '库存数量',
fieldName: 'inventory',
component: 'Input',
rules: 'required',
},
{
label: '状态',
fieldName: 'state',
component: 'Select',
componentProps: {
options: getDictOptions('product_management_status'),
},
rules: 'selectRequired',
},
{
label: '备注',
fieldName: 'remark',
component: 'Input',
},
];

View File

@@ -0,0 +1,173 @@
<script setup lang="ts">
import { Page, useVbenModal, type VbenFormProps } from '@vben/common-ui';
import { getVxePopupContainer } from '@vben/utils';
import { Modal, Popconfirm, Space } from 'ant-design-vue';
import {
useVbenVxeGrid,
vxeCheckboxChecked,
type VxeGridProps
} from '#/adapter/vxe-table';
import {
plantsProductExport,
plantsProductList,
plantsProductRemove,
} from '#/api/property/productManagement';
import type { PropertyForm } from '#/api/property/productManagement/model';
import { commonDownloadExcel } from '#/utils/file/download';
import PlantsProductModal from './plantsProduct-modal.vue';
import PlantsProductDetail from './plantsProduct-detail.vue';
import { columns, querySchema } from './data';
const formOptions: VbenFormProps = {
commonConfig: {
labelWidth: 80,
componentProps: {
allowClear: true,
},
},
schema: querySchema(),
wrapperClass: 'grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4',
};
const gridOptions: VxeGridProps = {
checkboxConfig: {
highlight: true,
reserve: true,
},
columns,
height: 'auto',
keepSource: true,
pagerConfig: {},
proxyConfig: {
ajax: {
query: async ({ page }, formValues = {}) => {
return await plantsProductList({
pageNum: page.currentPage,
pageSize: page.pageSize,
...formValues,
});
},
},
},
rowConfig: {
keyField: 'id',
},
id: 'property-property-index'
};
const [BasicTable, tableApi] = useVbenVxeGrid({
formOptions,
gridOptions,
});
const [PlantsProduct, modalApi] = useVbenModal({
connectedComponent: PlantsProductModal,
});
const [PlantsProductDetailModal, PlantsProductDetailApi] = useVbenModal({
connectedComponent: PlantsProductDetail,
});
async function handleInfo(row: Required<PropertyForm>) {
PlantsProductDetailApi.setData({ id: row.id });
PlantsProductDetailApi.open();
}
function handleAdd() {
modalApi.setData({});
modalApi.open();
}
async function handleEdit(row: Required<PropertyForm>) {
modalApi.setData({ id: row.id });
modalApi.open();
}
async function handleDelete(row: Required<PropertyForm>) {
await plantsProductRemove(row.id);
await tableApi.query();
}
function handleMultiDelete() {
const rows = tableApi.grid.getCheckboxRecords();
const ids = rows.map((row: Required<PropertyForm>) => row.id);
Modal.confirm({
title: '提示',
okType: 'danger',
content: `确认删除选中的${ids.length}条记录吗?`,
onOk: async () => {
await plantsProductRemove(ids);
await tableApi.query();
},
});
}
function handleDownloadExcel() {
commonDownloadExcel(plantsProductExport, '绿植租赁-绿植产品数据', tableApi.formApi.form.values, {
fieldMappingTime: formOptions.fieldMappingTime,
});
}
</script>
<template>
<Page :auto-content-height="true">
<BasicTable table-title="绿植租赁-绿植产品列表">
<template #toolbar-tools>
<Space>
<a-button
v-access:code="['property:property:export']"
@click="handleDownloadExcel"
>
{{ $t('pages.common.export') }}
</a-button>
<a-button
:disabled="!vxeCheckboxChecked(tableApi)"
danger
type="primary"
v-access:code="['property:property:remove']"
@click="handleMultiDelete">
{{ $t('pages.common.delete') }}
</a-button>
<a-button
type="primary"
v-access:code="['property:property:add']"
@click="handleAdd"
>
{{ $t('pages.common.add') }}
</a-button>
</Space>
</template>
<template #action="{ row }">
<Space>
<ghost-button
@click.stop="handleInfo(row)"
>
{{ $t('pages.common.info') }}
</ghost-button>
<ghost-button
v-access:code="['property:property:edit']"
@click.stop="handleEdit(row)"
>
{{ $t('pages.common.edit') }}
</ghost-button>
<Popconfirm
:get-popup-container="getVxePopupContainer"
placement="left"
title="确认删除?"
@confirm="handleDelete(row)"
>
<ghost-button
danger
v-access:code="['property:property:remove']"
@click.stop=""
>
{{ $t('pages.common.delete') }}
</ghost-button>
</Popconfirm>
</Space>
</template>
</BasicTable>
<PlantsProduct @reload="tableApi.query()" />
<PlantsProductDetailModal/>
</Page>
</template>

View File

@@ -0,0 +1,69 @@
<script setup lang="ts">
import type {plantsProduct} from '#/api/property/productManagement/model';
import {shallowRef} from 'vue';
import {useVbenModal} from '@vben/common-ui';
import {Descriptions, DescriptionsItem} from 'ant-design-vue';
import {visitorManagementInfo} from '#/api/property/visitorManagement';
import {renderDict} from "#/utils/render";
const [BasicModal, modalApi] = useVbenModal({
onOpenChange: handleOpenChange,
onClosed() {
plantsProductDetail.value = null;
},
});
const plantsProductDetail = shallowRef<null | plantsProduct>(null);
async function handleOpenChange(open: boolean) {
if (!open) {
return null;
}
modalApi.modalLoading(true);
const {id} = modalApi.getData() as { id: number | string };
const response = await visitorManagementInfo(id);
plantsProductDetail.value = response;
modalApi.modalLoading(false);
}
</script>
<template>
<BasicModal :footer="false" :fullscreen-button="false" title="产品管理信息" class="w-[70%]">
<Descriptions v-if="plantsProductDetail" size="small" :column="2" bordered :labelStyle="{width:'100px'}">
<DescriptionsItem label="产品编号">
{{ plantsProductDetail.plantCode }}
</DescriptionsItem>
<DescriptionsItem label="产品名称">
{{ plantsProductDetail.plantName }}
</DescriptionsItem>
<DescriptionsItem label="产品分类" v-if="plantsProductDetail.plantType!=null">
<component
:is="renderDict(plantsProductDetail.plantType,'pro_product_classification')"
/>
</DescriptionsItem>
<DescriptionsItem label="图片">
{{ plantsProductDetail.imgPath }}
</DescriptionsItem>
<DescriptionsItem label="规格">
{{ plantsProductDetail.specification }}
</DescriptionsItem>
<DescriptionsItem label="租金">
{{ plantsProductDetail.rent }}
</DescriptionsItem>
<DescriptionsItem label="库存数量">
{{ plantsProductDetail.inventory }}
</DescriptionsItem>
<DescriptionsItem label="状态" v-if="plantsProductDetail.state!=null">
<component
:is="renderDict(plantsProductDetail.state,'product_management_status')"
/>
</DescriptionsItem>
<DescriptionsItem label="备注">
{{ plantsProductDetail.remark }}
</DescriptionsItem>
<DescriptionsItem label="创建时间">
{{ plantsProductDetail.createTime }}
</DescriptionsItem>
</Descriptions>
</BasicModal>
</template>

View File

@@ -0,0 +1,90 @@
<script setup lang="ts">
import { computed, ref } from 'vue';
import { useVbenModal } from '@vben/common-ui';
import { $t } from '@vben/locales';
import { cloneDeep } from '@vben/utils';
import { useVbenForm } from '#/adapter/form';
import { plantsProductAdd, plantsProductInfo, plantsProductUpdate } from '#/api/property/productManagement';
import { defaultFormValueGetter, useBeforeCloseDiff } from '#/utils/popup';
import { modalSchema } from './data';
const emit = defineEmits<{ reload: [] }>();
const isUpdate = ref(false);
const title = computed(() => {
return isUpdate.value ? $t('pages.common.edit') : $t('pages.common.add');
});
const [BasicForm, formApi] = useVbenForm({
commonConfig: {
formItemClass: 'col-span-2',
labelWidth: 80,
componentProps: {
class: 'w-full',
}
},
schema: modalSchema(),
showDefaultActions: false,
wrapperClass: 'grid-cols-2',
});
const { onBeforeClose, markInitialized, resetInitialized } = useBeforeCloseDiff(
{
initializedGetter: defaultFormValueGetter(formApi),
currentGetter: defaultFormValueGetter(formApi),
},
);
const [BasicModal, modalApi] = useVbenModal({
class: 'w-[550px]',
fullscreenButton: false,
onBeforeClose,
onClosed: handleClosed,
onConfirm: handleConfirm,
onOpenChange: async (isOpen) => {
if (!isOpen) {
return null;
}
modalApi.modalLoading(true);
const { id } = modalApi.getData() as { id?: number | string };
isUpdate.value = !!id;
if (isUpdate.value && id) {
const record = await plantsProductInfo(id);
await formApi.setValues(record);
}
await markInitialized();
modalApi.modalLoading(false);
},
});
async function handleConfirm() {
try {
modalApi.lock(true);
const { valid } = await formApi.validate();
if (!valid) {
return;
}
const data = cloneDeep(await formApi.getValues());
await (isUpdate.value ? plantsProductUpdate(data) : plantsProductAdd(data));
resetInitialized();
emit('reload');
modalApi.close();
} catch (error) {
console.error(error);
} finally {
modalApi.lock(false);
}
}
async function handleClosed() {
await formApi.resetForm();
resetInitialized();
}
</script>
<template>
<BasicModal :title="title">
<BasicForm />
</BasicModal>
</template>

View File

@@ -0,0 +1,293 @@
<script setup lang="ts">
import { Button } from 'ant-design-vue';
import { ref, onMounted } from 'vue';
import { EchartsUI, useEcharts, type EchartsUIType } from '@vben/plugins/echarts';
const orderLineRef = ref<EchartsUIType>();
const leasePieRef = ref<EchartsUIType>();
const customerTypesBarRef = ref<EchartsUIType>();
const customerRenewalLineRef = ref<EchartsUIType>();
const conservationTasksBarRef = ref<EchartsUIType>();
const maintenanceQualityScoresPeiRef = ref<EchartsUIType>();
const { renderEcharts } = useEcharts(orderLineRef);
const { renderEcharts: renderLeasePie } = useEcharts(leasePieRef);
const {renderEcharts: renderCustomerTypesBar} = useEcharts(customerTypesBarRef);
const {renderEcharts: renderCustomerRenewalLine} = useEcharts(customerRenewalLineRef);
const {renderEcharts: renderConservationTasksBar} = useEcharts(conservationTasksBarRef);
const {renderEcharts: renderMaintenanceQualityScoresPei} = useEcharts(maintenanceQualityScoresPeiRef);
onMounted(() => {
renderEcharts({
title: { text: '订单数量趋势' },
tooltip: { trigger: 'axis' },
xAxis: {
type: 'category',
data: ['1月', '2月', '3月', '4月', '5月', '6月'],
boundaryGap: false,
},
yAxis: { type: 'value' },
series: [
{
name: '订单数',
type: 'line',
data: [120, 132, 101, 134, 90, 230],
smooth: true,
},
],
});
renderLeasePie({
title: { text: '租赁金额分布', left: 'center' },
tooltip: { trigger: 'item' },
legend: { orient: 'vertical', left: 'left' },
series: [
{
name: '金额',
type: 'pie',
radius: '60%',
center: ['50%', '50%'],
data: [
{ value: 1048, name: '办公楼' },
{ value: 735, name: '商场' },
{ value: 580, name: '酒店' },
{ value: 484, name: '医院' },
{ value: 300, name: '其他' },
],
emphasis: {
itemStyle: {
shadowBlur: 10,
shadowOffsetX: 0,
shadowColor: 'rgba(0, 0, 0, 0.5)',
},
},
label: {
formatter: '{b}: {c} ({d}%)',
show: true,
},
},
],
});
renderCustomerTypesBar({
title: { text: '客户类型分配' },
tooltip: { trigger: 'axis' },
xAxis: {
type: 'category',
data: ['1月', '2月', '3月', '4月', '5月', '6月'],
boundaryGap: false,
},
yAxis: { type: 'value' },
series: [
{
name: '订单数',
type: 'bar',
data: [120, 132, 101, 134, 90, 230],
},
],
});
renderCustomerRenewalLine({
title: { text: '客户续租率趋势' },
tooltip: { trigger: 'axis' },
xAxis: {
type: 'category',
data: ['1月', '2月', '3月', '4月', '5月', '6月'],
boundaryGap: false,
},
yAxis: { type: 'value' },
series: [
{
name: '订单数',
type: 'line',
data: [120, 132, 101, 134, 90, 230],
smooth: true,
},
],
});
renderConservationTasksBar({
title: { text: '养护任务完成情况' },
tooltip: {
trigger: 'axis',
axisPointer: { type: 'shadow' }
},
legend: {
data: ['计划任务数', '已完成数', '完成率']
},
xAxis: [
{
type: 'category',
data: ['朝阳区', '海淀区', '西城区', '东城区']
}
],
yAxis: [
{
type: 'value',
name: '任务数',
min: 0,
max: 200,
position: 'left'
},
{
type: 'value',
name: '完成率',
min: 0,
max: 100,
position: 'right',
axisLabel: {
formatter: '{value}%'
}
}
],
series: [
{
name: '计划任务数',
type: 'bar',
data: [156, 140, 130, 120]
},
{
name: '已完成数',
type: 'bar',
data: [152, 135, 125, 110]
},
{
name: '完成率',
type: 'line',
yAxisIndex: 1,
data: [97.4, 96.4, 96.2, 91.7]
}
]
});
renderMaintenanceQualityScoresPei({
title: { text: '养护质量评分分布', left: 'center' },
tooltip: {
trigger: 'item',
formatter: '{b} : {d}%'
},
legend: {
orient: 'horizontal',
left: 'center',
bottom: 10,
data: ['一星', '两星', '三星', '四星', '五星']
},
series: [
{
name: '评分',
type: 'pie',
radius: '60%',
center: ['50%', '50%'],
data: [
{ value: 12.43, name: '一星' },
{ value: 12.26, name: '两星' },
{ value: 16.87, name: '三星' },
{ value: 25.75, name: '四星' },
{ value: 32.68, name: '五星' }
],
label: {
formatter: '{b} {d}%',
show: true
}
}
]
});
});
</script>
<template>
<div class="main">
<div class="box">
<div class="title">
<div class="title-text">绿植租赁业务统计报表</div>
<div class="title-operate">
<div class="export">
<Button size="large" style="background-color: #22C55E; color: #fff;">导出数据</Button>
</div>
</div>
</div>
<div class="content">
<div class="row">
</div>
<div class="row-first">
<div class="item1">
<EchartsUI ref="orderLineRef" height="350px" width="100%" style="background:#fff;border-radius:8px;" />
</div>
<div class="item2">
<EchartsUI ref="leasePieRef" height="350px" width="100%" style="background:#fff;border-radius:8px;" />
</div>
</div>
<div class="row-second">
<div class="item1">
<EchartsUI ref="customerTypesBarRef" height="350px" width="100%" style="background:#fff;border-radius:8px;" />
</div>
<div class="item2">
<EchartsUI ref="customerRenewalLineRef" height="350px" width="100%" style="background:#fff;border-radius:8px;" />
</div>
</div>
<div class="row-third">
<EchartsUI ref="conservationTasksBarRef" height="100%" width="100%" style="background:#fff;border-radius:8px;" />
</div>
<div class="row-fouth">
<EchartsUI ref="maintenanceQualityScoresPeiRef" height="100%" width="100%" style="background:#fff;border-radius:8px;" />
</div>
</div>
</div>
</div>
</template>
<style lang="scss" scoped>
.main {
width: 100%;
.box{
margin: 40px;
height: 100%;
.title{
display: flex;
justify-content: space-between;
.title-text{
font-size: 25px;
font-weight: bold;
}
.title-operate{
display: flex;
.calendar{
}
.export{
margin-left: 20px;
}
}
}
.content{
flex:1;
padding: 10px;
background-color: #962020;
height: 100%;
.row{
display: flex;
justify-content: space-between;
}
.row-first{
display: flex;
justify-content: space-between;
height: 400px;
}
.row-second{
display: flex;
justify-content: space-between;
height: 400px;
}
.row-third{
height: 400px;
margin-bottom: 50px;
}
.row-fouth{
height: 400px;
}
.item1{
width: 45%;
height: 100%;
}
.item2{
width: 50%;
height: 100%;
}
}
}
}
</style>

View File

@@ -0,0 +1,195 @@
import type {FormSchemaGetter} from '#/adapter/form';
import type {VxeGridProps} from '#/adapter/vxe-table';
import {getDictOptions} from "#/utils/dict";
export const querySchema: FormSchemaGetter = () => [
{
component: 'Select',
fieldName: 'floorCode',
label: '所属社区',
},
{
component: 'Select',
fieldName: 'floorCode1',
label: '所属建筑',
},
{
component: 'Select',
fieldName: 'floorCode2',
label: '所属单元',
},
{
component: 'Select',
fieldName: 'floorCode3',
label: '所属楼层',
},
{
component: 'Input',
fieldName: 'roomNumber',
label: '房间号',
},
{
component: 'Input',
fieldName: 'roomCode',
label: '房间编码',
},
{
component: 'Select',
componentProps: {
options: getDictOptions('room_type'),
},
fieldName: 'roomType',
label: '房间类型',
},
{
component: 'Select',
componentProps: {
options: getDictOptions('wy_fjzt'),
},
fieldName: 'status',
label: '房间状态',
},
];
export const columns: VxeGridProps['columns'] = [
{ type: 'checkbox', width: 60 },
{
title: '序号',
field: 'id',
slots: {
default: ({ rowIndex }) => {
return (rowIndex + 1).toString();
},
},
},
{
title: '所属楼层',
field: 'floorCode',
},
{
title: '房间编码',
field: 'roomCode',
},
{
title: '房间号',
field: 'roomNumber',
},
{
title: '房间类型',
field: 'roomType',
},
{
title: '面积(㎡)',
field: 'area',
},
{
title: '户型',
field: 'layout',
},
{
title: '朝向',
field: 'orientation',
},
{
title: '是否可售',
field: 'isForSale',
},
{
title: '房间状态',
field: 'status',
},
{
field: 'action',
fixed: 'right',
slots: { default: 'action' },
title: '操作',
width: 180,
},
];
export const modalSchema: FormSchemaGetter = () => [
{
label: '主键',
fieldName: 'id',
component: 'Input',
dependencies: {
show: () => false,
triggerFields: [''],
},
},
{
label: '所属社区',
fieldName: 'floorCode',
component: 'Input',
rules: 'required',
},
{
label: '所属建筑',
fieldName: 'floorCode',
component: 'Input',
rules: 'required',
},
{
label: '所属单元',
fieldName: 'floorCode',
component: 'Input',
rules: 'required',
},
{
label: '所属楼层',
fieldName: 'floorCode',
component: 'Input',
rules: 'required',
},
{
label: '房间号',
fieldName: 'roomNumber',
component: 'Input',
rules: 'required',
},
{
label: '房间编码',
fieldName: 'roomCode',
component: 'Input',
rules: 'required',
},
{
label: '房间类型',
fieldName: 'roomType',
component: 'Select',
componentProps: {
options: getDictOptions('room_type'),
},
},
{
label: '面积(㎡)',
fieldName: 'area',
component: 'Input',
},
{
label: '户型',
fieldName: 'layout',
component: 'Input',
},
{
label: '朝向',
fieldName: 'orientation',
component: 'Select',
componentProps: {
options: getDictOptions('direction_towards'),
},
},
{
label: '是否可售',
fieldName: 'isForSale',
component: 'Select',
},
{
label: '房间状态',
fieldName: 'status',
component: 'Select',
componentProps: {
options: getDictOptions('wy_fjzt'),
},
},
];

View File

@@ -0,0 +1,157 @@
<script setup lang="ts">
import { Page, useVbenModal, type VbenFormProps } from '@vben/common-ui';
import { getVxePopupContainer } from '@vben/utils';
import { Modal, Popconfirm, Space } from 'ant-design-vue';
import {
useVbenVxeGrid,
vxeCheckboxChecked,
type VxeGridProps
} from '#/adapter/vxe-table';
import {
roomExport,
roomList,
roomRemove,
} from '#/api/property/room';
import type { RoomForm } from '#/api/property/room/model';
import { commonDownloadExcel } from '#/utils/file/download';
import roomModal from './room-modal.vue';
import { columns, querySchema } from './data';
const formOptions: VbenFormProps = {
commonConfig: {
labelWidth: 80,
componentProps: {
allowClear: true,
},
},
schema: querySchema(),
wrapperClass: 'grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4',
};
const gridOptions: VxeGridProps = {
checkboxConfig: {
highlight: true,
reserve: true,
},
columns,
height: 'auto',
keepSource: true,
pagerConfig: {},
proxyConfig: {
ajax: {
query: async ({ page }, formValues = {}) => {
return await roomList({
pageNum: page.currentPage,
pageSize: page.pageSize,
...formValues,
});
},
},
},
rowConfig: {
keyField: 'id',
},
id: 'property-room-index'
};
const [BasicTable, tableApi] = useVbenVxeGrid({
formOptions,
gridOptions,
});
const [RoomModal, modalApi] = useVbenModal({
connectedComponent: roomModal,
});
function handleAdd() {
modalApi.setData({});
modalApi.open();
}
async function handleEdit(row: Required<RoomForm>) {
modalApi.setData({ id: row.id });
modalApi.open();
}
async function handleDelete(row: Required<RoomForm>) {
await roomRemove(row.id);
await tableApi.query();
}
function handleMultiDelete() {
const rows = tableApi.grid.getCheckboxRecords();
const ids = rows.map((row: Required<RoomForm>) => row.id);
Modal.confirm({
title: '提示',
okType: 'danger',
content: `确认删除选中的${ids.length}条记录吗?`,
onOk: async () => {
await roomRemove(ids);
await tableApi.query();
},
});
}
function handleDownloadExcel() {
commonDownloadExcel(roomExport, '房间信息数据', tableApi.formApi.form.values, {
fieldMappingTime: formOptions.fieldMappingTime,
});
}
</script>
<template>
<Page :auto-content-height="true">
<BasicTable table-title="房间信息列表">
<template #toolbar-tools>
<Space>
<a-button
v-access:code="['property:room:export']"
@click="handleDownloadExcel"
>
{{ $t('pages.common.export') }}
</a-button>
<a-button
:disabled="!vxeCheckboxChecked(tableApi)"
danger
type="primary"
v-access:code="['property:room:remove']"
@click="handleMultiDelete">
{{ $t('pages.common.delete') }}
</a-button>
<a-button
type="primary"
v-access:code="['property:room:add']"
@click="handleAdd"
>
{{ $t('pages.common.add') }}
</a-button>
</Space>
</template>
<template #action="{ row }">
<Space>
<ghost-button
v-access:code="['property:room:edit']"
@click.stop="handleEdit(row)"
>
{{ $t('pages.common.edit') }}
</ghost-button>
<Popconfirm
:get-popup-container="getVxePopupContainer"
placement="left"
title="确认删除?"
@confirm="handleDelete(row)"
>
<ghost-button
danger
v-access:code="['property:room:remove']"
@click.stop=""
>
{{ $t('pages.common.delete') }}
</ghost-button>
</Popconfirm>
</Space>
</template>
</BasicTable>
<RoomModal @reload="tableApi.query()" />
</Page>
</template>

View File

@@ -0,0 +1,90 @@
<script setup lang="ts">
import { computed, ref } from 'vue';
import { useVbenModal } from '@vben/common-ui';
import { $t } from '@vben/locales';
import { cloneDeep } from '@vben/utils';
import { useVbenForm } from '#/adapter/form';
import { roomAdd, roomInfo, roomUpdate } from '#/api/property/room';
import { defaultFormValueGetter, useBeforeCloseDiff } from '#/utils/popup';
import { modalSchema } from './data';
const emit = defineEmits<{ reload: [] }>();
const isUpdate = ref(false);
const title = computed(() => {
return isUpdate.value ? $t('pages.common.edit') : $t('pages.common.add');
});
const [BasicForm, formApi] = useVbenForm({
commonConfig: {
formItemClass: 'col-span-2',
labelWidth: 80,
componentProps: {
class: 'w-full',
}
},
schema: modalSchema(),
showDefaultActions: false,
wrapperClass: 'grid-cols-2',
});
const { onBeforeClose, markInitialized, resetInitialized } = useBeforeCloseDiff(
{
initializedGetter: defaultFormValueGetter(formApi),
currentGetter: defaultFormValueGetter(formApi),
},
);
const [BasicModal, modalApi] = useVbenModal({
class: 'w-[550px]',
fullscreenButton: false,
onBeforeClose,
onClosed: handleClosed,
onConfirm: handleConfirm,
onOpenChange: async (isOpen) => {
if (!isOpen) {
return null;
}
modalApi.modalLoading(true);
const { id } = modalApi.getData() as { id?: number | string };
isUpdate.value = !!id;
if (isUpdate.value && id) {
const record = await roomInfo(id);
await formApi.setValues(record);
}
await markInitialized();
modalApi.modalLoading(false);
},
});
async function handleConfirm() {
try {
modalApi.lock(true);
const { valid } = await formApi.validate();
if (!valid) {
return;
}
const data = cloneDeep(await formApi.getValues());
await (isUpdate.value ? roomUpdate(data) : roomAdd(data));
resetInitialized();
emit('reload');
modalApi.close();
} catch (error) {
console.error(error);
} finally {
modalApi.lock(false);
}
}
async function handleClosed() {
await formApi.resetForm();
resetInitialized();
}
</script>
<template>
<BasicModal :title="title">
<BasicForm />
</BasicModal>
</template>

View File

@@ -0,0 +1,118 @@
import type { FormSchemaGetter } from '#/adapter/form';
import type { VxeGridProps } from '#/adapter/vxe-table';
export const querySchema: FormSchemaGetter = () => [
{
component: 'Input',
fieldName: 'buildingCode',
label: '建筑名称',
},
{
component: 'Input',
fieldName: 'unitCode',
label: '单元编码',
},
{
component: 'Input',
fieldName: 'unitName',
label: '单元名称',
},
{
component: 'Input',
fieldName: 'floorCount',
label: '单元层数',
},
{
component: 'Input',
fieldName: 'householdCount',
label: '单元户数',
},
{
component: 'Input',
fieldName: 'stairCount',
label: '楼梯数量',
},
];
// 需要使用i18n注意这里要改成getter形式 否则切换语言不会刷新
// export const columns: () => VxeGridProps['columns'] = () => [
export const columns: VxeGridProps['columns'] = [
{ type: 'checkbox', width: 60 },
{
title: '建筑名称',
field: 'buildingCode',
},
{
title: '单元编码',
field: 'unitCode',
},
{
title: '单元名称',
field: 'unitName',
},
{
title: '单元层数',
field: 'floorCount',
},
{
title: '单元户数',
field: 'householdCount',
},
{
title: '楼梯数量',
field: 'stairCount',
},
{
field: 'action',
fixed: 'right',
slots: { default: 'action' },
title: '操作',
width: 180,
},
];
export const modalSchema: FormSchemaGetter = () => [
{
label: '主键id',
fieldName: 'id',
component: 'Input',
dependencies: {
show: () => false,
triggerFields: [''],
},
},
{
label: '建筑名称',
fieldName: 'buildingCode',
component: 'Input',
rules: 'required',
},
{
label: '单元编码',
fieldName: 'unitCode',
component: 'Input',
rules: 'required',
},
{
label: '单元名称',
fieldName: 'unitName',
component: 'Input',
rules: 'required',
},
{
label: '单元层数',
fieldName: 'floorCount',
component: 'Input',
},
{
label: '单元户数',
fieldName: 'householdCount',
component: 'Input',
},
{
label: '楼梯数量',
fieldName: 'stairCount',
component: 'Input',
},
];

View File

@@ -0,0 +1,182 @@
<script setup lang="ts">
import type { Recordable } from '@vben/types';
import { ref } from 'vue';
import { Page, useVbenModal, type VbenFormProps } from '@vben/common-ui';
import { getVxePopupContainer } from '@vben/utils';
import { Modal, Popconfirm, Space } from 'ant-design-vue';
import dayjs from 'dayjs';
import {
useVbenVxeGrid,
vxeCheckboxChecked,
type VxeGridProps
} from '#/adapter/vxe-table';
import {
unitExport,
unitList,
unitRemove,
} from '#/api/property/unit';
import type { UnitForm } from '#/api/property/unit/model';
import { commonDownloadExcel } from '#/utils/file/download';
import unitModal from './unit-modal.vue';
import { columns, querySchema } from './data';
const formOptions: VbenFormProps = {
commonConfig: {
labelWidth: 80,
componentProps: {
allowClear: true,
},
},
schema: querySchema(),
wrapperClass: 'grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4',
// 处理区间选择器RangePicker时间格式 将一个字段映射为两个字段 搜索/导出会用到
// 不需要直接删除
// fieldMappingTime: [
// [
// 'createTime',
// ['params[beginTime]', 'params[endTime]'],
// ['YYYY-MM-DD 00:00:00', 'YYYY-MM-DD 23:59:59'],
// ],
// ],
};
const gridOptions: VxeGridProps = {
checkboxConfig: {
// 高亮
highlight: true,
// 翻页时保留选中状态
reserve: true,
// 点击行选中
// trigger: 'row',
},
// 需要使用i18n注意这里要改成getter形式 否则切换语言不会刷新
// columns: columns(),
columns,
height: 'auto',
keepSource: true,
pagerConfig: {},
proxyConfig: {
ajax: {
query: async ({ page }, formValues = {}) => {
return await unitList({
pageNum: page.currentPage,
pageSize: page.pageSize,
...formValues,
});
},
},
},
rowConfig: {
keyField: 'id',
},
// 表格全局唯一表示 保存列配置需要用到
id: 'property-unit-index'
};
const [BasicTable, tableApi] = useVbenVxeGrid({
formOptions,
gridOptions,
});
const [UnitModal, modalApi] = useVbenModal({
connectedComponent: unitModal,
});
function handleAdd() {
modalApi.setData({});
modalApi.open();
}
async function handleEdit(row: Required<UnitForm>) {
modalApi.setData({ id: row.id });
modalApi.open();
}
async function handleDelete(row: Required<UnitForm>) {
await unitRemove(row.id);
await tableApi.query();
}
function handleMultiDelete() {
const rows = tableApi.grid.getCheckboxRecords();
const ids = rows.map((row: Required<UnitForm>) => row.id);
Modal.confirm({
title: '提示',
okType: 'danger',
content: `确认删除选中的${ids.length}条记录吗?`,
onOk: async () => {
await unitRemove(ids);
await tableApi.query();
},
});
}
function handleDownloadExcel() {
commonDownloadExcel(unitExport, '单元数据', tableApi.formApi.form.values, {
fieldMappingTime: formOptions.fieldMappingTime,
});
}
</script>
<template>
<Page :auto-content-height="true">
<BasicTable table-title="单元列表">
<template #toolbar-tools>
<Space>
<a-button
v-access:code="['property:unit:export']"
@click="handleDownloadExcel"
>
{{ $t('pages.common.export') }}
</a-button>
<a-button
:disabled="!vxeCheckboxChecked(tableApi)"
danger
type="primary"
v-access:code="['property:unit:remove']"
@click="handleMultiDelete">
{{ $t('pages.common.delete') }}
</a-button>
<a-button
type="primary"
v-access:code="['property:unit:add']"
@click="handleAdd"
>
{{ $t('pages.common.add') }}
</a-button>
</Space>
</template>
<template #action="{ row }">
<Space>
<ghost-button
v-access:code="['property:unit:edit']"
@click.stop="handleEdit(row)"
>
{{ $t('pages.common.edit') }}
</ghost-button>
<Popconfirm
:get-popup-container="getVxePopupContainer"
placement="left"
title="确认删除?"
@confirm="handleDelete(row)"
>
<ghost-button
danger
v-access:code="['property:unit:remove']"
@click.stop=""
>
{{ $t('pages.common.delete') }}
</ghost-button>
</Popconfirm>
</Space>
</template>
</BasicTable>
<UnitModal @reload="tableApi.query()" />
</Page>
</template>

View File

@@ -0,0 +1,101 @@
<script setup lang="ts">
import { computed, ref } from 'vue';
import { useVbenModal } from '@vben/common-ui';
import { $t } from '@vben/locales';
import { cloneDeep } from '@vben/utils';
import { useVbenForm } from '#/adapter/form';
import { unitAdd, unitInfo, unitUpdate } from '#/api/property/unit';
import { defaultFormValueGetter, useBeforeCloseDiff } from '#/utils/popup';
import { modalSchema } from './data';
const emit = defineEmits<{ reload: [] }>();
const isUpdate = ref(false);
const title = computed(() => {
return isUpdate.value ? $t('pages.common.edit') : $t('pages.common.add');
});
const [BasicForm, formApi] = useVbenForm({
commonConfig: {
// 默认占满两列
formItemClass: 'col-span-2',
// 默认label宽度 px
labelWidth: 80,
// 通用配置项 会影响到所有表单项
componentProps: {
class: 'w-full',
}
},
schema: modalSchema(),
showDefaultActions: false,
wrapperClass: 'grid-cols-2',
});
const { onBeforeClose, markInitialized, resetInitialized } = useBeforeCloseDiff(
{
initializedGetter: defaultFormValueGetter(formApi),
currentGetter: defaultFormValueGetter(formApi),
},
);
const [BasicModal, modalApi] = useVbenModal({
// 在这里更改宽度
class: 'w-[550px]',
fullscreenButton: false,
onBeforeClose,
onClosed: handleClosed,
onConfirm: handleConfirm,
onOpenChange: async (isOpen) => {
if (!isOpen) {
return null;
}
modalApi.modalLoading(true);
const { id } = modalApi.getData() as { id?: number | string };
isUpdate.value = !!id;
if (isUpdate.value && id) {
const record = await unitInfo(id);
await formApi.setValues(record);
}
await markInitialized();
modalApi.modalLoading(false);
},
});
async function handleConfirm() {
try {
modalApi.lock(true);
const { valid } = await formApi.validate();
if (!valid) {
return;
}
// getValues获取为一个readonly的对象 需要修改必须先深拷贝一次
const data = cloneDeep(await formApi.getValues());
await (isUpdate.value ? unitUpdate(data) : unitAdd(data));
resetInitialized();
emit('reload');
modalApi.close();
} catch (error) {
console.error(error);
} finally {
modalApi.lock(false);
}
}
async function handleClosed() {
await formApi.resetForm();
resetInitialized();
}
</script>
<template>
<BasicModal :title="title">
<BasicForm />
</BasicModal>
</template>

View File

@@ -9,10 +9,10 @@ import { getVxePopupContainer } from '@vben/utils';
import { Modal, Popconfirm, Space } from 'ant-design-vue';
import dayjs from 'dayjs';
import {
import {
useVbenVxeGrid,
vxeCheckboxChecked,
type VxeGridProps
type VxeGridProps
} from '#/adapter/vxe-table';
import {
@@ -35,15 +35,6 @@ const formOptions: VbenFormProps = {
},
schema: querySchema(),
wrapperClass: 'grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4',
// 处理区间选择器RangePicker时间格式 将一个字段映射为两个字段 搜索/导出会用到
// 不需要直接删除
// fieldMappingTime: [
// [
// 'createTime',
// ['params[beginTime]', 'params[endTime]'],
// ['YYYY-MM-DD 00:00:00', 'YYYY-MM-DD 23:59:59'],
// ],
// ],
};
const gridOptions: VxeGridProps = {
@@ -55,7 +46,6 @@ const gridOptions: VxeGridProps = {
// 点击行选中
// trigger: 'row',
},
// 需要使用i18n注意这里要改成getter形式 否则切换语言不会刷新
// columns: columns(),
columns,
height: 'auto',
@@ -138,8 +128,8 @@ function handleDownloadExcel() {
<a-button
:disabled="!vxeCheckboxChecked(tableApi)"
danger
type="primary"
v-access:code="['property:visitorManagement:remove']"
type="primary"
v-access:code="['property:visitorManagement:remove']"
@click="handleMultiDelete">
{{ $t('pages.common.delete') }}
</a-button>

View File

@@ -0,0 +1,106 @@
<script setup lang="ts">
import { computed, ref } from 'vue';
import { useVbenModal } from '@vben/common-ui';
import { $t } from '@vben/locales';
import { cloneDeep } from '@vben/utils';
import { useVbenForm } from '#/adapter/form';
import {
accessControlDeviceAdd,
accessControlDeviceInfo,
accessControlDeviceUpdate,
} from '#/api/sis/accessControlDevice';
import { defaultFormValueGetter, useBeforeCloseDiff } from '#/utils/popup';
import { modalSchema } from './data';
const emit = defineEmits<{ reload: [] }>();
const isUpdate = ref(false);
const title = computed(() => {
return isUpdate.value ? $t('pages.common.edit') : $t('pages.common.add');
});
const [BasicForm, formApi] = useVbenForm({
commonConfig: {
// 默认占满两列
formItemClass: 'col-span-1',
// 默认label宽度 px
labelWidth: 80,
// 通用配置项 会影响到所有表单项
componentProps: {
class: 'w-full',
},
},
schema: modalSchema(),
showDefaultActions: false,
wrapperClass: 'grid-cols-2',
});
const { onBeforeClose, markInitialized, resetInitialized } = useBeforeCloseDiff(
{
initializedGetter: defaultFormValueGetter(formApi),
currentGetter: defaultFormValueGetter(formApi),
},
);
const [BasicModal, modalApi] = useVbenModal({
// 在这里更改宽度
class: 'w-[60%]',
fullscreenButton: false,
onBeforeClose,
onClosed: handleClosed,
onConfirm: handleConfirm,
onOpenChange: async (isOpen) => {
if (!isOpen) {
return null;
}
modalApi.modalLoading(true);
const { id } = modalApi.getData() as { id?: number | string };
isUpdate.value = !!id;
if (isUpdate.value && id) {
const record = await accessControlDeviceInfo(id);
await formApi.setValues(record);
}
await markInitialized();
modalApi.modalLoading(false);
},
});
async function handleConfirm() {
try {
modalApi.lock(true);
const { valid } = await formApi.validate();
if (!valid) {
return;
}
// getValues获取为一个readonly的对象 需要修改必须先深拷贝一次
const data = cloneDeep(await formApi.getValues());
await (isUpdate.value
? accessControlDeviceUpdate(data)
: accessControlDeviceAdd(data));
resetInitialized();
emit('reload');
modalApi.close();
} catch (error) {
console.error(error);
} finally {
modalApi.lock(false);
}
}
async function handleClosed() {
await formApi.resetForm();
resetInitialized();
}
</script>
<template>
<BasicModal :title="title">
<BasicForm />
</BasicModal>
</template>

View File

@@ -0,0 +1,108 @@
import type { FormSchemaGetter } from '#/adapter/form';
import type { VxeGridProps } from '#/adapter/vxe-table';
import { DictEnum } from '@vben/constants';
import { getPopupContainer } from '@vben/utils';
import { getDictOptions } from '#/utils/dict';
export const querySchema: FormSchemaGetter = () => [
{
component: 'Input',
fieldName: 'eqpName',
label: '设备名称',
},
{
component: 'Select',
componentProps: {
getPopupContainer,
options: getDictOptions(DictEnum.SIS_ACCESS_CONTROL_DEVICE_TYPE),
},
fieldName: 'factoryNo',
label: '设备厂商',
},
];
// 需要使用i18n注意这里要改成getter形式 否则切换语言不会刷新
// export const columns: () => VxeGridProps['columns'] = () => [
export const columns: VxeGridProps['columns'] = [
{ type: 'checkbox', width: 60 },
{
title: '设备编码',
field: 'eqpNo',
},
{
title: '设备名称',
field: 'eqpName',
},
{
title: '设备厂商',
field: 'factoryName',
},
{
title: '设备ip',
field: 'eqpIp',
},
{
title: '设备端口',
field: 'eqpPort',
},
{
title: '设备账号',
field: 'eqpAccount',
},
{
title: '设备密码',
field: 'eqpPwd',
},
{
field: 'action',
fixed: 'right',
slots: { default: 'action' },
title: '操作',
width: 180,
},
];
export const modalSchema: FormSchemaGetter = () => [
{
label: '设备名称',
fieldName: 'eqpName',
component: 'Input',
rules: 'required',
},
{
label: '设备厂商',
fieldName: 'factoryNo',
component: 'Select',
componentProps: {
getPopupContainer,
options: getDictOptions(DictEnum.SIS_ACCESS_CONTROL_DEVICE_TYPE),
},
},
{
label: '设备ip',
fieldName: 'eqpIp',
component: 'Input',
rules: 'required',
},
{
label: '设备端口',
fieldName: 'eqpPort',
component: 'Input',
rules: 'required',
},
{
label: '设备账号',
fieldName: 'eqpAccount',
component: 'Input',
rules: 'required',
},
{
label: '设备密码',
fieldName: 'eqpPwd',
component: 'Input',
rules: 'required',
},
];

View File

@@ -0,0 +1,182 @@
<script setup lang="ts">
import type { VbenFormProps } from '@vben/common-ui';
import type { VxeGridProps } from '#/adapter/vxe-table';
import type { AccessControlDeviceForm } from '#/api/sis/accessControlDevice/model';
import { Page, useVbenModal } from '@vben/common-ui';
import { getVxePopupContainer } from '@vben/utils';
import { Modal, Popconfirm, Space } from 'ant-design-vue';
import { useVbenVxeGrid, vxeCheckboxChecked } from '#/adapter/vxe-table';
import {
accessControlDeviceExport,
accessControlDeviceList,
accessControlDeviceRemove,
} from '#/api/sis/accessControlDevice';
import { commonDownloadExcel } from '#/utils/file/download';
import accessControlDeviceModal from './accessControlDevice-modal.vue';
import { columns, querySchema } from './data';
const formOptions: VbenFormProps = {
commonConfig: {
labelWidth: 80,
componentProps: {
allowClear: true,
},
},
schema: querySchema(),
wrapperClass: 'grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4',
// 处理区间选择器RangePicker时间格式 将一个字段映射为两个字段 搜索/导出会用到
// 不需要直接删除
// fieldMappingTime: [
// [
// 'createTime',
// ['params[beginTime]', 'params[endTime]'],
// ['YYYY-MM-DD 00:00:00', 'YYYY-MM-DD 23:59:59'],
// ],
// ],
};
const gridOptions: VxeGridProps = {
checkboxConfig: {
// 高亮
highlight: true,
// 翻页时保留选中状态
reserve: true,
// 点击行选中
// trigger: 'row',
},
// 需要使用i18n注意这里要改成getter形式 否则切换语言不会刷新
// columns: columns(),
columns,
height: 'auto',
keepSource: true,
pagerConfig: {},
proxyConfig: {
ajax: {
query: async ({ page }, formValues = {}) => {
return await accessControlDeviceList({
pageNum: page.currentPage,
pageSize: page.pageSize,
...formValues,
});
},
},
},
rowConfig: {
keyField: 'id',
},
// 表格全局唯一表示 保存列配置需要用到
id: 'sis-accessControlDevice-index',
};
const [BasicTable, tableApi] = useVbenVxeGrid({
formOptions,
gridOptions,
});
const [AccessControlDeviceModal, modalApi] = useVbenModal({
connectedComponent: accessControlDeviceModal,
});
function handleAdd() {
modalApi.setData({});
modalApi.open();
}
async function handleEdit(row: Required<AccessControlDeviceForm>) {
modalApi.setData({ id: row.id });
modalApi.open();
}
async function handleDelete(row: Required<AccessControlDeviceForm>) {
await accessControlDeviceRemove(row.id);
await tableApi.query();
}
function handleMultiDelete() {
const rows = tableApi.grid.getCheckboxRecords();
const ids = rows.map((row: Required<AccessControlDeviceForm>) => row.id);
Modal.confirm({
title: '提示',
okType: 'danger',
content: `确认删除选中的${ids.length}条记录吗?`,
onOk: async () => {
await accessControlDeviceRemove(ids);
await tableApi.query();
},
});
}
function handleDownloadExcel() {
commonDownloadExcel(
accessControlDeviceExport,
'门禁设备数据',
tableApi.formApi.form.values,
{
fieldMappingTime: formOptions.fieldMappingTime,
},
);
}
</script>
<template>
<Page :auto-content-height="true">
<BasicTable table-title="门禁设备列表">
<template #toolbar-tools>
<Space>
<a-button
v-access:code="['sis:accessControlDevice:export']"
@click="handleDownloadExcel"
>
{{ $t('pages.common.export') }}
</a-button>
<a-button
:disabled="!vxeCheckboxChecked(tableApi)"
danger
type="primary"
v-access:code="['sis:accessControlDevice:remove']"
@click="handleMultiDelete"
>
{{ $t('pages.common.delete') }}
</a-button>
<a-button
type="primary"
v-access:code="['sis:accessControlDevice:add']"
@click="handleAdd"
>
{{ $t('pages.common.add') }}
</a-button>
</Space>
</template>
<template #action="{ row }">
<Space>
<ghost-button
v-access:code="['sis:accessControlDevice:edit']"
@click.stop="handleEdit(row)"
>
{{ $t('pages.common.edit') }}
</ghost-button>
<Popconfirm
:get-popup-container="getVxePopupContainer"
placement="left"
title="确认删除?"
@confirm="handleDelete(row)"
>
<ghost-button
danger
v-access:code="['sis:accessControlDevice:remove']"
@click.stop=""
>
{{ $t('pages.common.delete') }}
</ghost-button>
</Popconfirm>
</Space>
</template>
</BasicTable>
<AccessControlDeviceModal @reload="tableApi.query()" />
</Page>
</template>

View File

@@ -0,0 +1,236 @@
import type { FormSchemaGetter } from '#/adapter/form';
import type { VxeGridProps } from '#/adapter/vxe-table';
export const querySchema: FormSchemaGetter = () => [
{
component: 'Input',
fieldName: 'eqpCode',
label: '设备编码',
},
{
component: 'Input',
fieldName: 'video',
label: '视频协议',
},
{
component: 'Select',
componentProps: {},
fieldName: 'transportType',
label: '传输协议',
},
{
component: 'Input',
fieldName: 'channelName',
label: '点位名称',
},
{
component: 'Input',
fieldName: 'rtspAddr',
label: 'rtsp 地址',
},
{
component: 'Input',
fieldName: 'ip',
label: '点位名称',
},
{
component: 'Input',
fieldName: 'port',
label: '端口',
},
{
component: 'Input',
fieldName: 'username',
label: '通道相机账号',
},
{
component: 'Input',
fieldName: 'pwd',
label: '相机密码',
},
{
component: 'Select',
componentProps: {},
fieldName: 'videoType',
label: '码流',
},
{
component: 'Input',
fieldName: 'videoId',
label: '码流id',
},
{
component: 'Input',
fieldName: 'createById',
label: '创建人id',
},
{
component: 'Input',
fieldName: 'updateById',
label: '更新人id',
},
{
component: 'Input',
fieldName: 'searchValue',
label: '搜索值',
},
];
// 需要使用i18n注意这里要改成getter形式 否则切换语言不会刷新
// export const columns: () => VxeGridProps['columns'] = () => [
export const columns: VxeGridProps['columns'] = [
{ type: 'checkbox', width: 60 },
{
title: '主键id',
field: 'id',
},
{
title: '设备编码',
field: 'eqpCode',
},
{
title: '视频协议',
},
{
title: '传输协议',
field: 'transportType',
},
{
title: '点位名称',
field: 'channelName',
},
{
title: 'rtsp 地址',
field: 'rtspAddr',
},
{
title: '点位名称',
field: 'ip',
},
{
title: '端口',
field: 'port',
},
{
title: '通道相机账号',
field: 'username',
},
{
title: '相机密码',
field: 'pwd',
},
{
title: '设备码流',
field: 'videoType',
},
{
title: '码流id',
field: 'videoId',
},
{
title: '创建人id',
field: 'createById',
},
{
title: '更新人id',
field: 'updateById',
},
{
title: '搜索值',
field: 'searchValue',
},
{
field: 'action',
fixed: 'right',
slots: {
default: 'action',
},
title: '操作',
width: 180,
},
];
export const modalSchema: FormSchemaGetter = () => [
{
label: '主键id',
fieldName: 'id',
component: 'Input',
dependencies: {
show: () => false,
triggerFields: [''],
},
},
{
label: '设备编码',
fieldName: 'eqpCode',
component: 'Input',
rules: 'required',
},
{
label: '视频协议',
fieldName: 'video',
component: 'Input',
},
{
label: '传输协议',
fieldName: 'transportType',
component: 'Select',
componentProps: {},
},
{
label: '点位名称',
fieldName: 'channelName',
component: 'Input',
},
{
label: 'rtsp 地址',
fieldName: 'rtspAddr',
component: 'Input',
},
{
label: '点位名称',
fieldName: 'ip',
component: 'Input',
},
{
label: '端口',
fieldName: 'port',
component: 'Input',
},
{
label: '通道相机账号',
fieldName: 'username',
component: 'Input',
},
{
label: '相机密码',
fieldName: 'pwd',
component: 'Input',
},
{
label: '设备码流',
fieldName: 'videoType',
component: 'Select',
componentProps: {},
},
{
label: '码流id',
fieldName: 'videoId',
component: 'Input',
},
{
label: '创建人id',
fieldName: 'createById',
component: 'Input',
},
{
label: '更新人id',
fieldName: 'updateById',
component: 'Input',
},
{
label: '搜索值',
fieldName: 'searchValue',
component: 'Input',
},
];

View File

@@ -0,0 +1,104 @@
<script setup lang="ts">
import { computed, ref } from 'vue';
import { useVbenModal } from '@vben/common-ui';
import { $t } from '@vben/locales';
import { cloneDeep } from '@vben/utils';
import { useVbenForm } from '#/adapter/form';
import {
devicePointAdd,
devicePointInfo,
devicePointUpdate,
} from '#/api/sis/devicePoint';
import { defaultFormValueGetter, useBeforeCloseDiff } from '#/utils/popup';
import { modalSchema } from './data';
const emit = defineEmits<{ reload: [] }>();
const isUpdate = ref(false);
const title = computed(() => {
return isUpdate.value ? $t('pages.common.edit') : $t('pages.common.add');
});
const [BasicForm, formApi] = useVbenForm({
commonConfig: {
// 默认占满两列
formItemClass: 'col-span-2',
// 默认label宽度 px
labelWidth: 80,
// 通用配置项 会影响到所有表单项
componentProps: {
class: 'w-full',
},
},
schema: modalSchema(),
showDefaultActions: false,
wrapperClass: 'grid-cols-2',
});
const { onBeforeClose, markInitialized, resetInitialized } = useBeforeCloseDiff(
{
initializedGetter: defaultFormValueGetter(formApi),
currentGetter: defaultFormValueGetter(formApi),
},
);
const [BasicModal, modalApi] = useVbenModal({
// 在这里更改宽度
class: 'w-[550px]',
fullscreenButton: false,
onBeforeClose,
onClosed: handleClosed,
onConfirm: handleConfirm,
onOpenChange: async (isOpen) => {
if (!isOpen) {
return null;
}
modalApi.modalLoading(true);
const { id } = modalApi.getData() as { id?: number | string };
isUpdate.value = !!id;
if (isUpdate.value && id) {
const record = await devicePointInfo(id);
await formApi.setValues(record);
}
await markInitialized();
modalApi.modalLoading(false);
},
});
async function handleConfirm() {
try {
modalApi.lock(true);
const { valid } = await formApi.validate();
if (!valid) {
return;
}
// getValues获取为一个readonly的对象 需要修改必须先深拷贝一次
const data = cloneDeep(await formApi.getValues());
await (isUpdate.value ? devicePointUpdate(data) : devicePointAdd(data));
resetInitialized();
emit('reload');
modalApi.close();
} catch (error) {
console.error(error);
} finally {
modalApi.lock(false);
}
}
async function handleClosed() {
await formApi.resetForm();
resetInitialized();
}
</script>
<template>
<BasicModal :title="title">
<BasicForm />
</BasicModal>
</template>

View File

@@ -0,0 +1,182 @@
<script setup lang="ts">
import type { VbenFormProps } from '@vben/common-ui';
import type { VxeGridProps } from '#/adapter/vxe-table';
import type { DevicePointForm } from '#/api/sis/devicePoint/model';
import { Page, useVbenModal } from '@vben/common-ui';
import { getVxePopupContainer } from '@vben/utils';
import { Modal, Popconfirm, Space } from 'ant-design-vue';
import { useVbenVxeGrid, vxeCheckboxChecked } from '#/adapter/vxe-table';
import {
devicePointExport,
devicePointList,
devicePointRemove,
} from '#/api/sis/devicePoint';
import { commonDownloadExcel } from '#/utils/file/download';
import { columns, querySchema } from './data';
import devicePointModal from './devicePoint-modal.vue';
const formOptions: VbenFormProps = {
commonConfig: {
labelWidth: 80,
componentProps: {
allowClear: true,
},
},
schema: querySchema(),
wrapperClass: 'grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4',
// 处理区间选择器RangePicker时间格式 将一个字段映射为两个字段 搜索/导出会用到
// 不需要直接删除
// fieldMappingTime: [
// [
// 'createTime',
// ['params[beginTime]', 'params[endTime]'],
// ['YYYY-MM-DD 00:00:00', 'YYYY-MM-DD 23:59:59'],
// ],
// ],
};
const gridOptions: VxeGridProps = {
checkboxConfig: {
// 高亮
highlight: true,
// 翻页时保留选中状态
reserve: true,
// 点击行选中
// trigger: 'row',
},
// 需要使用i18n注意这里要改成getter形式 否则切换语言不会刷新
// columns: columns(),
columns,
height: 'auto',
keepSource: true,
pagerConfig: {},
proxyConfig: {
ajax: {
query: async ({ page }, formValues = {}) => {
return await devicePointList({
pageNum: page.currentPage,
pageSize: page.pageSize,
...formValues,
});
},
},
},
rowConfig: {
keyField: 'id',
},
// 表格全局唯一表示 保存列配置需要用到
id: 'sis-devicePoint-index',
};
const [BasicTable, tableApi] = useVbenVxeGrid({
formOptions,
gridOptions,
});
const [DevicePointModal, modalApi] = useVbenModal({
connectedComponent: devicePointModal,
});
function handleAdd() {
modalApi.setData({});
modalApi.open();
}
async function handleEdit(row: Required<DevicePointForm>) {
modalApi.setData({ id: row.id });
modalApi.open();
}
async function handleDelete(row: Required<DevicePointForm>) {
await devicePointRemove(row.id);
await tableApi.query();
}
function handleMultiDelete() {
const rows = tableApi.grid.getCheckboxRecords();
const ids = rows.map((row: Required<DevicePointForm>) => row.id);
Modal.confirm({
title: '提示',
okType: 'danger',
content: `确认删除选中的${ids.length}条记录吗?`,
onOk: async () => {
await devicePointRemove(ids);
await tableApi.query();
},
});
}
function handleDownloadExcel() {
commonDownloadExcel(
devicePointExport,
'宇视设备点位(通道)数据',
tableApi.formApi.form.values,
{
fieldMappingTime: formOptions.fieldMappingTime,
},
);
}
</script>
<template>
<Page :auto-content-height="true">
<BasicTable table-title="宇视设备点位(通道)列表">
<template #toolbar-tools>
<Space>
<a-button
v-access:code="['sis:devicePoint:export']"
@click="handleDownloadExcel"
>
{{ $t('pages.common.export') }}
</a-button>
<a-button
:disabled="!vxeCheckboxChecked(tableApi)"
danger
type="primary"
v-access:code="['sis:devicePoint:remove']"
@click="handleMultiDelete"
>
{{ $t('pages.common.delete') }}
</a-button>
<a-button
type="primary"
v-access:code="['sis:devicePoint:add']"
@click="handleAdd"
>
{{ $t('pages.common.add') }}
</a-button>
</Space>
</template>
<template #action="{ row }">
<Space>
<ghost-button
v-access:code="['sis:devicePoint:edit']"
@click.stop="handleEdit(row)"
>
{{ $t('pages.common.edit') }}
</ghost-button>
<Popconfirm
:get-popup-container="getVxePopupContainer"
placement="left"
title="确认删除?"
@confirm="handleDelete(row)"
>
<ghost-button
danger
v-access:code="['sis:devicePoint:remove']"
@click.stop=""
>
{{ $t('pages.common.delete') }}
</ghost-button>
</Popconfirm>
</Space>
</template>
</BasicTable>
<DevicePointModal @reload="tableApi.query()" />
</Page>
</template>

View File

@@ -0,0 +1,88 @@
import type { FormSchemaGetter } from '#/adapter/form';
import type { VxeGridProps } from '#/adapter/vxe-table';
import { DictEnum } from '@vben/constants';
import { getPopupContainer } from '@vben/utils';
import { getDictOptions } from '#/utils/dict';
export const querySchema: FormSchemaGetter = () => [
{
component: 'Input',
fieldName: 'libName',
label: '人员库名称',
},
{
component: 'Select',
componentProps: {
getPopupContainer,
options: getDictOptions(DictEnum.SIS_LIB_TYPE),
},
fieldName: 'libType',
label: '库类型',
},
];
// 需要使用i18n注意这里要改成getter形式 否则切换语言不会刷新
// export const columns: () => VxeGridProps['columns'] = () => [
export const columns: VxeGridProps['columns'] = [
{ type: 'checkbox', width: 60 },
{
title: '人员库编码',
field: 'libCode',
},
{
title: '人员库名称',
field: 'libName',
},
{
title: '人员库描述',
field: 'libDesc',
},
{
title: '库类型',
field: 'libType',
},
/* {
title: '业务类型',
field: 'busiType',
},*/
{
field: 'action',
fixed: 'right',
slots: { default: 'action' },
title: '操作',
width: 180,
},
];
export const modalSchema: FormSchemaGetter = () => [
{
label: '人员库名称',
fieldName: 'libName',
component: 'Input',
rules: 'required',
},
{
label: '人员库描述',
fieldName: 'libDesc',
component: 'Input',
},
{
label: '库类型',
fieldName: 'libType',
component: 'Select',
componentProps: {
getPopupContainer,
options: getDictOptions(DictEnum.SIS_LIB_TYPE),
},
},
/* {
label: '业务类型',
fieldName: 'busiType',
component: 'Select',
componentProps: {},
},*/
];

View File

@@ -0,0 +1,182 @@
<script setup lang="ts">
import type { VbenFormProps } from '@vben/common-ui';
import type { VxeGridProps } from '#/adapter/vxe-table';
import type { PersonLibForm } from '#/api/sis/personLib/model';
import { Page, useVbenModal } from '@vben/common-ui';
import { getVxePopupContainer } from '@vben/utils';
import { Modal, Popconfirm, Space } from 'ant-design-vue';
import { useVbenVxeGrid, vxeCheckboxChecked } from '#/adapter/vxe-table';
import {
personLibExport,
personLibList,
personLibRemove,
} from '#/api/sis/personLib';
import { commonDownloadExcel } from '#/utils/file/download';
import { columns, querySchema } from './data';
import personLibModal from './personLib-modal.vue';
const formOptions: VbenFormProps = {
commonConfig: {
labelWidth: 80,
componentProps: {
allowClear: true,
},
},
schema: querySchema(),
wrapperClass: 'grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4',
// 处理区间选择器RangePicker时间格式 将一个字段映射为两个字段 搜索/导出会用到
// 不需要直接删除
// fieldMappingTime: [
// [
// 'createTime',
// ['params[beginTime]', 'params[endTime]'],
// ['YYYY-MM-DD 00:00:00', 'YYYY-MM-DD 23:59:59'],
// ],
// ],
};
const gridOptions: VxeGridProps = {
checkboxConfig: {
// 高亮
highlight: true,
// 翻页时保留选中状态
reserve: true,
// 点击行选中
// trigger: 'row',
},
// 需要使用i18n注意这里要改成getter形式 否则切换语言不会刷新
// columns: columns(),
columns,
height: 'auto',
keepSource: true,
pagerConfig: {},
proxyConfig: {
ajax: {
query: async ({ page }, formValues = {}) => {
return await personLibList({
pageNum: page.currentPage,
pageSize: page.pageSize,
...formValues,
});
},
},
},
rowConfig: {
keyField: 'id',
},
// 表格全局唯一表示 保存列配置需要用到
id: 'sis-personLib-index',
};
const [BasicTable, tableApi] = useVbenVxeGrid({
formOptions,
gridOptions,
});
const [PersonLibModal, modalApi] = useVbenModal({
connectedComponent: personLibModal,
});
function handleAdd() {
modalApi.setData({});
modalApi.open();
}
async function handleEdit(row: Required<PersonLibForm>) {
modalApi.setData({ id: row.id });
modalApi.open();
}
async function handleDelete(row: Required<PersonLibForm>) {
await personLibRemove(row.id);
await tableApi.query();
}
function handleMultiDelete() {
const rows = tableApi.grid.getCheckboxRecords();
const ids = rows.map((row: Required<PersonLibForm>) => row.id);
Modal.confirm({
title: '提示',
okType: 'danger',
content: `确认删除选中的${ids.length}条记录吗?`,
onOk: async () => {
await personLibRemove(ids);
await tableApi.query();
},
});
}
function handleDownloadExcel() {
commonDownloadExcel(
personLibExport,
'人像库数据',
tableApi.formApi.form.values,
{
fieldMappingTime: formOptions.fieldMappingTime,
},
);
}
</script>
<template>
<Page :auto-content-height="true">
<BasicTable table-title="人像库列表">
<template #toolbar-tools>
<Space>
<a-button
v-access:code="['sis:personLib:export']"
@click="handleDownloadExcel"
>
{{ $t('pages.common.export') }}
</a-button>
<a-button
:disabled="!vxeCheckboxChecked(tableApi)"
danger
type="primary"
v-access:code="['sis:personLib:remove']"
@click="handleMultiDelete"
>
{{ $t('pages.common.delete') }}
</a-button>
<a-button
type="primary"
v-access:code="['sis:personLib:add']"
@click="handleAdd"
>
{{ $t('pages.common.add') }}
</a-button>
</Space>
</template>
<template #action="{ row }">
<Space>
<ghost-button
v-access:code="['sis:personLib:edit']"
@click.stop="handleEdit(row)"
>
{{ $t('pages.common.edit') }}
</ghost-button>
<Popconfirm
:get-popup-container="getVxePopupContainer"
placement="left"
title="确认删除?"
@confirm="handleDelete(row)"
>
<ghost-button
danger
v-access:code="['sis:personLib:remove']"
@click.stop=""
>
{{ $t('pages.common.delete') }}
</ghost-button>
</Popconfirm>
</Space>
</template>
</BasicTable>
<PersonLibModal @reload="tableApi.query()" />
</Page>
</template>

View File

@@ -0,0 +1,101 @@
<script setup lang="ts">
import { computed, ref } from 'vue';
import { useVbenModal } from '@vben/common-ui';
import { $t } from '@vben/locales';
import { cloneDeep } from '@vben/utils';
import { useVbenForm } from '#/adapter/form';
import { personLibAdd, personLibInfo, personLibUpdate } from '#/api/sis/personLib';
import { defaultFormValueGetter, useBeforeCloseDiff } from '#/utils/popup';
import { modalSchema } from './data';
const emit = defineEmits<{ reload: [] }>();
const isUpdate = ref(false);
const title = computed(() => {
return isUpdate.value ? $t('pages.common.edit') : $t('pages.common.add');
});
const [BasicForm, formApi] = useVbenForm({
commonConfig: {
// 默认占满两列
formItemClass: 'col-span-2',
// 默认label宽度 px
labelWidth: 80,
// 通用配置项 会影响到所有表单项
componentProps: {
class: 'w-full',
}
},
schema: modalSchema(),
showDefaultActions: false,
wrapperClass: 'grid-cols-2',
});
const { onBeforeClose, markInitialized, resetInitialized } = useBeforeCloseDiff(
{
initializedGetter: defaultFormValueGetter(formApi),
currentGetter: defaultFormValueGetter(formApi),
},
);
const [BasicModal, modalApi] = useVbenModal({
// 在这里更改宽度
class: 'w-[550px]',
fullscreenButton: false,
onBeforeClose,
onClosed: handleClosed,
onConfirm: handleConfirm,
onOpenChange: async (isOpen) => {
if (!isOpen) {
return null;
}
modalApi.modalLoading(true);
const { id } = modalApi.getData() as { id?: number | string };
isUpdate.value = !!id;
if (isUpdate.value && id) {
const record = await personLibInfo(id);
await formApi.setValues(record);
}
await markInitialized();
modalApi.modalLoading(false);
},
});
async function handleConfirm() {
try {
modalApi.lock(true);
const { valid } = await formApi.validate();
if (!valid) {
return;
}
// getValues获取为一个readonly的对象 需要修改必须先深拷贝一次
const data = cloneDeep(await formApi.getValues());
await (isUpdate.value ? personLibUpdate(data) : personLibAdd(data));
resetInitialized();
emit('reload');
modalApi.close();
} catch (error) {
console.error(error);
} finally {
modalApi.lock(false);
}
}
async function handleClosed() {
await formApi.resetForm();
resetInitialized();
}
</script>
<template>
<BasicModal :title="title">
<BasicForm />
</BasicModal>
</template>

View File

@@ -0,0 +1,127 @@
import type { FormSchemaGetter } from '#/adapter/form';
import type { VxeGridProps } from '#/adapter/vxe-table';
import { DictEnum } from '@vben/constants';
import { getPopupContainer } from '@vben/utils';
import { getDictOptions } from '#/utils/dict';
export const querySchema: FormSchemaGetter = () => [
{
component: 'Input',
fieldName: 'imgName',
label: '人像名称',
},
{
component: 'Select',
componentProps: {
getPopupContainer,
options: getDictOptions(DictEnum.SYS_USER_SEX),
},
fieldName: 'sex',
label: '性别',
},
];
// 需要使用i18n注意这里要改成getter形式 否则切换语言不会刷新
// export const columns: () => VxeGridProps['columns'] = () => [
export const columns: VxeGridProps['columns'] = [
{ type: 'checkbox', width: 60 },
{
title: '人员库编码',
field: 'libCode',
},
{
title: '人像名称',
field: 'imgName',
},
{
title: '性别',
field: 'sex',
},
{
title: '邮箱',
field: 'email',
},
{
title: '联系方式',
field: 'tel',
},
{
title: '证件类型',
field: 'certificateType',
},
{
title: '证件号码',
field: 'certificateNo',
},
{
title: '出生日期',
field: 'birthDate',
},
{
field: 'action',
fixed: 'right',
slots: { default: 'action' },
title: '操作',
width: 180,
},
];
export const modalSchema: FormSchemaGetter = () => [
{
label: '人像名称',
fieldName: 'imgName',
component: 'Input',
rules: 'required',
},
{
label: '性别',
fieldName: 'sex',
component: 'Select',
componentProps: {
getPopupContainer,
options: getDictOptions(DictEnum.SYS_USER_SEX),
},
},
{
label: '邮箱',
fieldName: 'email',
component: 'Input',
},
{
label: '联系方式',
fieldName: 'tel',
component: 'Input',
},
{
label: '证件类型',
fieldName: 'certificateType',
component: 'Select',
componentProps: {
getPopupContainer,
options: getDictOptions(DictEnum.SYS_CERTIFICATE_TYPE),
},
},
{
label: '证件号码',
fieldName: 'certificateNo',
component: 'Input',
},
{
label: '出生日期',
fieldName: 'birthDate',
component: 'Input',
},
{
label: '人像图片',
fieldName: 'img',
component: 'ImageUpload',
componentProps: {
// accept: 'image/*', // 可选拓展名或者mime类型 ,拼接
maxCount: 1, // 最大上传文件数 默认为1 为1会绑定为string而非string[]类型
},
formItemClass: 'col-span-2',
},
];

View File

@@ -0,0 +1,182 @@
<script setup lang="ts">
import type { VbenFormProps } from '@vben/common-ui';
import type { VxeGridProps } from '#/adapter/vxe-table';
import type { PersonLibImgForm } from '#/api/sis/personLibImg/model';
import { Page, useVbenModal } from '@vben/common-ui';
import { getVxePopupContainer } from '@vben/utils';
import { Modal, Popconfirm, Space } from 'ant-design-vue';
import { useVbenVxeGrid, vxeCheckboxChecked } from '#/adapter/vxe-table';
import {
personLibImgExport,
personLibImgList,
personLibImgRemove,
} from '#/api/sis/personLibImg';
import { commonDownloadExcel } from '#/utils/file/download';
import { columns, querySchema } from './data';
import personLibImgModal from './personLibImg-modal.vue';
const formOptions: VbenFormProps = {
commonConfig: {
labelWidth: 80,
componentProps: {
allowClear: true,
},
},
schema: querySchema(),
wrapperClass: 'grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4',
// 处理区间选择器RangePicker时间格式 将一个字段映射为两个字段 搜索/导出会用到
// 不需要直接删除
// fieldMappingTime: [
// [
// 'createTime',
// ['params[beginTime]', 'params[endTime]'],
// ['YYYY-MM-DD 00:00:00', 'YYYY-MM-DD 23:59:59'],
// ],
// ],
};
const gridOptions: VxeGridProps = {
checkboxConfig: {
// 高亮
highlight: true,
// 翻页时保留选中状态
reserve: true,
// 点击行选中
// trigger: 'row',
},
// 需要使用i18n注意这里要改成getter形式 否则切换语言不会刷新
// columns: columns(),
columns,
height: 'auto',
keepSource: true,
pagerConfig: {},
proxyConfig: {
ajax: {
query: async ({ page }, formValues = {}) => {
return await personLibImgList({
pageNum: page.currentPage,
pageSize: page.pageSize,
...formValues,
});
},
},
},
rowConfig: {
keyField: 'id',
},
// 表格全局唯一表示 保存列配置需要用到
id: 'system-personLibImg-index',
};
const [BasicTable, tableApi] = useVbenVxeGrid({
formOptions,
gridOptions,
});
const [PersonLibImgModal, modalApi] = useVbenModal({
connectedComponent: personLibImgModal,
});
function handleAdd() {
modalApi.setData({});
modalApi.open();
}
async function handleEdit(row: Required<PersonLibImgForm>) {
modalApi.setData({ id: row.id });
modalApi.open();
}
async function handleDelete(row: Required<PersonLibImgForm>) {
await personLibImgRemove(row.id);
await tableApi.query();
}
function handleMultiDelete() {
const rows = tableApi.grid.getCheckboxRecords();
const ids = rows.map((row: Required<PersonLibImgForm>) => row.id);
Modal.confirm({
title: '提示',
okType: 'danger',
content: `确认删除选中的${ids.length}条记录吗?`,
onOk: async () => {
await personLibImgRemove(ids);
await tableApi.query();
},
});
}
function handleDownloadExcel() {
commonDownloadExcel(
personLibImgExport,
'人像信息数据',
tableApi.formApi.form.values,
{
fieldMappingTime: formOptions.fieldMappingTime,
},
);
}
</script>
<template>
<Page :auto-content-height="true">
<BasicTable table-title="人像信息列表">
<template #toolbar-tools>
<Space>
<a-button
v-access:code="['system:personLibImg:export']"
@click="handleDownloadExcel"
>
{{ $t('pages.common.export') }}
</a-button>
<a-button
:disabled="!vxeCheckboxChecked(tableApi)"
danger
type="primary"
v-access:code="['system:personLibImg:remove']"
@click="handleMultiDelete"
>
{{ $t('pages.common.delete') }}
</a-button>
<a-button
type="primary"
v-access:code="['system:personLibImg:add']"
@click="handleAdd"
>
{{ $t('pages.common.add') }}
</a-button>
</Space>
</template>
<template #action="{ row }">
<Space>
<ghost-button
v-access:code="['system:personLibImg:edit']"
@click.stop="handleEdit(row)"
>
{{ $t('pages.common.edit') }}
</ghost-button>
<Popconfirm
:get-popup-container="getVxePopupContainer"
placement="left"
title="确认删除?"
@confirm="handleDelete(row)"
>
<ghost-button
danger
v-access:code="['system:personLibImg:remove']"
@click.stop=""
>
{{ $t('pages.common.delete') }}
</ghost-button>
</Popconfirm>
</Space>
</template>
</BasicTable>
<PersonLibImgModal @reload="tableApi.query()" />
</Page>
</template>

View File

@@ -0,0 +1,104 @@
<script setup lang="ts">
import { computed, ref } from 'vue';
import { useVbenModal } from '@vben/common-ui';
import { $t } from '@vben/locales';
import { cloneDeep } from '@vben/utils';
import { useVbenForm } from '#/adapter/form';
import {
personLibImgAdd,
personLibImgInfo,
personLibImgUpdate,
} from '#/api/sis/personLibImg';
import { defaultFormValueGetter, useBeforeCloseDiff } from '#/utils/popup';
import { modalSchema } from './data';
const emit = defineEmits<{ reload: [] }>();
const isUpdate = ref(false);
const title = computed(() => {
return isUpdate.value ? $t('pages.common.edit') : $t('pages.common.add');
});
const [BasicForm, formApi] = useVbenForm({
commonConfig: {
// 默认占满两列
formItemClass: 'col-span-1',
// 默认label宽度 px
labelWidth: 80,
// 通用配置项 会影响到所有表单项
componentProps: {
class: 'w-full',
},
},
schema: modalSchema(),
showDefaultActions: false,
wrapperClass: 'grid-cols-2',
});
const { onBeforeClose, markInitialized, resetInitialized } = useBeforeCloseDiff(
{
initializedGetter: defaultFormValueGetter(formApi),
currentGetter: defaultFormValueGetter(formApi),
},
);
const [BasicModal, modalApi] = useVbenModal({
// 在这里更改宽度
class: 'w-[700px]',
fullscreenButton: false,
onBeforeClose,
onClosed: handleClosed,
onConfirm: handleConfirm,
onOpenChange: async (isOpen) => {
if (!isOpen) {
return null;
}
modalApi.modalLoading(true);
const { id } = modalApi.getData() as { id?: number | string };
isUpdate.value = !!id;
if (isUpdate.value && id) {
const record = await personLibImgInfo(id);
await formApi.setValues(record);
}
await markInitialized();
modalApi.modalLoading(false);
},
});
async function handleConfirm() {
try {
modalApi.lock(true);
const { valid } = await formApi.validate();
if (!valid) {
return;
}
// getValues获取为一个readonly的对象 需要修改必须先深拷贝一次
const data = cloneDeep(await formApi.getValues());
await (isUpdate.value ? personLibImgUpdate(data) : personLibImgAdd(data));
resetInitialized();
emit('reload');
modalApi.close();
} catch (error) {
console.error(error);
} finally {
modalApi.lock(false);
}
}
async function handleClosed() {
await formApi.resetForm();
resetInitialized();
}
</script>
<template>
<BasicModal :title="title">
<BasicForm />
</BasicModal>
</template>

View File

@@ -28,7 +28,8 @@ export default defineConfig(async () => {
rewrite: (path) => path.replace(/^\/api/, ''),
// mock代理目标地址
// target: 'http://by.missmoc.top:3010/',
target: 'http://127.0.0.1:8080/',
// target: 'http://127.0.0.1:8080/',
target: 'http://47.109.37.87:3010',
ws: true,
},
},

View File

@@ -10,10 +10,15 @@ export const DictEnum = {
SYS_SHOW_HIDE: 'sys_show_hide', // 显示状态
SYS_USER_SEX: 'sys_user_sex', // 性别
SYS_YES_NO: 'sys_yes_no', // 是否
SYS_CERTIFICATE_TYPE: 'sys_certificate_type', // 证件类型
WF_BUSINESS_STATUS: 'wf_business_status', // 业务状态
WF_FORM_TYPE: 'wf_form_type', // 表单类型
WF_TASK_STATUS: 'wf_task_status', // 任务状态
WY_SF: 'wy_sf',
SIS_ACCESS_CONTROL_DEVICE_TYPE: 'sis_access_control_device_type',
SIS_LIB_TYPE: 'sis_lib_type',
WY_ZCSHZT: 'wy_zcshzt',
} as const;
export type DictEnumKey = keyof typeof DictEnum;