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
Some checks are pending
Gitea Actions Demo / Explore-Gitea-Actions (push) Waiting to run
This commit is contained in:
@@ -0,0 +1,61 @@
|
||||
import type { InspectionItemVO, InspectionItemForm, InspectionItemQuery } 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 inspectionItemList(params?: InspectionItemQuery) {
|
||||
return requestClient.get<PageResult<InspectionItemVO>>('/property/inspectionItem/list', { params });
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出巡检项目列表
|
||||
* @param params
|
||||
* @returns 巡检项目列表
|
||||
*/
|
||||
export function inspectionItemExport(params?: InspectionItemQuery) {
|
||||
return commonExport('/property/inspectionItem/export', params ?? {});
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询巡检项目详情
|
||||
* @param id id
|
||||
* @returns 巡检项目详情
|
||||
*/
|
||||
export function inspectionItemInfo(id: ID) {
|
||||
return requestClient.get<InspectionItemVO>(`/property/inspectionItem/${id}`);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增巡检项目
|
||||
* @param data
|
||||
* @returns void
|
||||
*/
|
||||
export function inspectionItemAdd(data: InspectionItemForm) {
|
||||
return requestClient.postWithMsg<void>('/property/inspectionItem', data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新巡检项目
|
||||
* @param data
|
||||
* @returns void
|
||||
*/
|
||||
export function inspectionItemUpdate(data: InspectionItemForm) {
|
||||
return requestClient.putWithMsg<void>('/property/inspectionItem', data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除巡检项目
|
||||
* @param id id
|
||||
* @returns void
|
||||
*/
|
||||
export function inspectionItemRemove(id: ID | IDS) {
|
||||
return requestClient.deleteWithMsg<void>(`/property/inspectionItem/${id}`);
|
||||
}
|
49
apps/web-antd/src/api/property/inspectionManagement/inspectionItem/model.d.ts
vendored
Normal file
49
apps/web-antd/src/api/property/inspectionManagement/inspectionItem/model.d.ts
vendored
Normal file
@@ -0,0 +1,49 @@
|
||||
import type { PageQuery, BaseEntity } from '#/api/common';
|
||||
|
||||
export interface InspectionItemVO {
|
||||
/**
|
||||
* 主键id
|
||||
*/
|
||||
id: string | number;
|
||||
|
||||
/**
|
||||
* 项目名称
|
||||
*/
|
||||
itemName: string;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
remark: string;
|
||||
|
||||
}
|
||||
|
||||
export interface InspectionItemForm extends BaseEntity {
|
||||
/**
|
||||
* 主键id
|
||||
*/
|
||||
id?: string | number;
|
||||
|
||||
/**
|
||||
* 项目名称
|
||||
*/
|
||||
itemName?: string;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
remark?: string;
|
||||
|
||||
}
|
||||
|
||||
export interface InspectionItemQuery extends PageQuery {
|
||||
/**
|
||||
* 项目名称
|
||||
*/
|
||||
itemName?: string;
|
||||
|
||||
/**
|
||||
* 日期范围参数
|
||||
*/
|
||||
params?: any;
|
||||
}
|
@@ -0,0 +1,61 @@
|
||||
import type { InspectionPlanVO, InspectionPlanForm, InspectionPlanQuery } 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 inspectionPlanList(params?: InspectionPlanQuery) {
|
||||
return requestClient.get<PageResult<InspectionPlanVO>>('/property/inspectionPlan/list', { params });
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出巡检计划列表
|
||||
* @param params
|
||||
* @returns 巡检计划列表
|
||||
*/
|
||||
export function inspectionPlanExport(params?: InspectionPlanQuery) {
|
||||
return commonExport('/property/inspectionPlan/export', params ?? {});
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询巡检计划详情
|
||||
* @param id id
|
||||
* @returns 巡检计划详情
|
||||
*/
|
||||
export function inspectionPlanInfo(id: ID) {
|
||||
return requestClient.get<InspectionPlanVO>(`/property/inspectionPlan/${id}`);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增巡检计划
|
||||
* @param data
|
||||
* @returns void
|
||||
*/
|
||||
export function inspectionPlanAdd(data: InspectionPlanForm) {
|
||||
return requestClient.postWithMsg<void>('/property/inspectionPlan', data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新巡检计划
|
||||
* @param data
|
||||
* @returns void
|
||||
*/
|
||||
export function inspectionPlanUpdate(data: InspectionPlanForm) {
|
||||
return requestClient.putWithMsg<void>('/property/inspectionPlan', data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除巡检计划
|
||||
* @param id id
|
||||
* @returns void
|
||||
*/
|
||||
export function inspectionPlanRemove(id: ID | IDS) {
|
||||
return requestClient.deleteWithMsg<void>(`/property/inspectionPlan/${id}`);
|
||||
}
|
199
apps/web-antd/src/api/property/inspectionManagement/inspectionPlan/model.d.ts
vendored
Normal file
199
apps/web-antd/src/api/property/inspectionManagement/inspectionPlan/model.d.ts
vendored
Normal file
@@ -0,0 +1,199 @@
|
||||
import type { PageQuery, BaseEntity } from '#/api/common';
|
||||
|
||||
export interface InspectionPlanVO {
|
||||
/**
|
||||
* 主键id
|
||||
*/
|
||||
id: string | number;
|
||||
|
||||
/**
|
||||
* 巡检计划名称
|
||||
*/
|
||||
planName: string;
|
||||
|
||||
/**
|
||||
* 巡检路线id
|
||||
*/
|
||||
inspectionRouteId: string | number;
|
||||
|
||||
/**
|
||||
* 巡检周期
|
||||
*/
|
||||
inspectionPlanPeriod: number;
|
||||
|
||||
/**
|
||||
* 任务提前分组
|
||||
*/
|
||||
beforeTime: number;
|
||||
|
||||
/**
|
||||
* 开始日期
|
||||
*/
|
||||
startDate: string;
|
||||
|
||||
/**
|
||||
* 结束日期
|
||||
*/
|
||||
endDate: string;
|
||||
|
||||
/**
|
||||
* 开始时间
|
||||
*/
|
||||
startTime: string;
|
||||
|
||||
/**
|
||||
* 结束时间
|
||||
*/
|
||||
endTime: string;
|
||||
|
||||
/**
|
||||
* 签到方式(0现场定位,1现场定位)
|
||||
*/
|
||||
signType: number;
|
||||
|
||||
/**
|
||||
* 允许补检(0允许1不允许)
|
||||
*/
|
||||
canReexamine: number;
|
||||
|
||||
/**
|
||||
* 选择员工
|
||||
*/
|
||||
userId: string | number;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
remark: string;
|
||||
|
||||
}
|
||||
|
||||
export interface InspectionPlanForm extends BaseEntity {
|
||||
/**
|
||||
* 主键id
|
||||
*/
|
||||
id?: string | number;
|
||||
|
||||
/**
|
||||
* 巡检计划名称
|
||||
*/
|
||||
planName?: string;
|
||||
|
||||
/**
|
||||
* 巡检路线id
|
||||
*/
|
||||
inspectionRouteId?: string | number;
|
||||
|
||||
/**
|
||||
* 巡检周期
|
||||
*/
|
||||
inspectionPlanPeriod?: number;
|
||||
|
||||
/**
|
||||
* 任务提前分组
|
||||
*/
|
||||
beforeTime?: number;
|
||||
|
||||
/**
|
||||
* 开始日期
|
||||
*/
|
||||
startDate?: string;
|
||||
|
||||
/**
|
||||
* 结束日期
|
||||
*/
|
||||
endDate?: string;
|
||||
|
||||
/**
|
||||
* 开始时间
|
||||
*/
|
||||
startTime?: string;
|
||||
|
||||
/**
|
||||
* 结束时间
|
||||
*/
|
||||
endTime?: string;
|
||||
|
||||
/**
|
||||
* 签到方式(0现场定位,1现场定位)
|
||||
*/
|
||||
signType?: number;
|
||||
|
||||
/**
|
||||
* 允许补检(0允许1不允许)
|
||||
*/
|
||||
canReexamine?: number;
|
||||
|
||||
/**
|
||||
* 选择员工
|
||||
*/
|
||||
userId?: string | number;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
remark?: string;
|
||||
|
||||
}
|
||||
|
||||
export interface InspectionPlanQuery extends PageQuery {
|
||||
/**
|
||||
* 巡检计划名称
|
||||
*/
|
||||
planName?: string;
|
||||
|
||||
/**
|
||||
* 巡检路线id
|
||||
*/
|
||||
inspectionRouteId?: string | number;
|
||||
|
||||
/**
|
||||
* 巡检周期
|
||||
*/
|
||||
inspectionPlanPeriod?: number;
|
||||
|
||||
/**
|
||||
* 任务提前分组
|
||||
*/
|
||||
beforeTime?: number;
|
||||
|
||||
/**
|
||||
* 开始日期
|
||||
*/
|
||||
startDate?: string;
|
||||
|
||||
/**
|
||||
* 结束日期
|
||||
*/
|
||||
endDate?: string;
|
||||
|
||||
/**
|
||||
* 开始时间
|
||||
*/
|
||||
startTime?: string;
|
||||
|
||||
/**
|
||||
* 结束时间
|
||||
*/
|
||||
endTime?: string;
|
||||
|
||||
/**
|
||||
* 签到方式(0现场定位,1现场定位)
|
||||
*/
|
||||
signType?: number;
|
||||
|
||||
/**
|
||||
* 允许补检(0允许1不允许)
|
||||
*/
|
||||
canReexamine?: number;
|
||||
|
||||
/**
|
||||
* 选择员工
|
||||
*/
|
||||
userId?: string | number;
|
||||
|
||||
/**
|
||||
* 日期范围参数
|
||||
*/
|
||||
params?: any;
|
||||
}
|
@@ -0,0 +1,61 @@
|
||||
import type { InspectionPointVO, InspectionPointForm, InspectionPointQuery } 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 inspectionPointList(params?: InspectionPointQuery) {
|
||||
return requestClient.get<PageResult<InspectionPointVO>>('/property/inspectionPoint/list', { params });
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出巡检点列表
|
||||
* @param params
|
||||
* @returns 巡检点列表
|
||||
*/
|
||||
export function inspectionPointExport(params?: InspectionPointQuery) {
|
||||
return commonExport('/property/inspectionPoint/export', params ?? {});
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询巡检点详情
|
||||
* @param id id
|
||||
* @returns 巡检点详情
|
||||
*/
|
||||
export function inspectionPointInfo(id: ID) {
|
||||
return requestClient.get<InspectionPointVO>(`/property/inspectionPoint/${id}`);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增巡检点
|
||||
* @param data
|
||||
* @returns void
|
||||
*/
|
||||
export function inspectionPointAdd(data: InspectionPointForm) {
|
||||
return requestClient.postWithMsg<void>('/property/inspectionPoint', data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新巡检点
|
||||
* @param data
|
||||
* @returns void
|
||||
*/
|
||||
export function inspectionPointUpdate(data: InspectionPointForm) {
|
||||
return requestClient.putWithMsg<void>('/property/inspectionPoint', data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除巡检点
|
||||
* @param id id
|
||||
* @returns void
|
||||
*/
|
||||
export function inspectionPointRemove(id: ID | IDS) {
|
||||
return requestClient.deleteWithMsg<void>(`/property/inspectionPoint/${id}`);
|
||||
}
|
139
apps/web-antd/src/api/property/inspectionManagement/inspectionPoint/model.d.ts
vendored
Normal file
139
apps/web-antd/src/api/property/inspectionManagement/inspectionPoint/model.d.ts
vendored
Normal file
@@ -0,0 +1,139 @@
|
||||
import type { PageQuery, BaseEntity } from '#/api/common';
|
||||
|
||||
export interface InspectionPointVO {
|
||||
/**
|
||||
* 主键id
|
||||
*/
|
||||
id: string | number;
|
||||
|
||||
/**
|
||||
* 巡检项目id
|
||||
*/
|
||||
itemId: string | number;
|
||||
|
||||
/**
|
||||
* 巡检点名称
|
||||
*/
|
||||
pointName: string;
|
||||
|
||||
/**
|
||||
* 巡检点类型
|
||||
*/
|
||||
pointType: number;
|
||||
|
||||
/**
|
||||
* nfc编码
|
||||
*/
|
||||
nfcCode: string;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
remark: string;
|
||||
|
||||
/**
|
||||
* 创建人id
|
||||
*/
|
||||
createById: string | number;
|
||||
|
||||
/**
|
||||
* 更新人id
|
||||
*/
|
||||
updateById: string | number;
|
||||
|
||||
/**
|
||||
* 搜索值
|
||||
*/
|
||||
searchValue: string;
|
||||
|
||||
}
|
||||
|
||||
export interface InspectionPointForm extends BaseEntity {
|
||||
/**
|
||||
* 主键id
|
||||
*/
|
||||
id?: string | number;
|
||||
|
||||
/**
|
||||
* 巡检项目id
|
||||
*/
|
||||
itemId?: string | number;
|
||||
|
||||
/**
|
||||
* 巡检点名称
|
||||
*/
|
||||
pointName?: string;
|
||||
|
||||
/**
|
||||
* 巡检点类型
|
||||
*/
|
||||
pointType?: number;
|
||||
|
||||
/**
|
||||
* nfc编码
|
||||
*/
|
||||
nfcCode?: string;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
remark?: string;
|
||||
|
||||
/**
|
||||
* 创建人id
|
||||
*/
|
||||
createById?: string | number;
|
||||
|
||||
/**
|
||||
* 更新人id
|
||||
*/
|
||||
updateById?: string | number;
|
||||
|
||||
/**
|
||||
* 搜索值
|
||||
*/
|
||||
searchValue?: string;
|
||||
|
||||
}
|
||||
|
||||
export interface InspectionPointQuery extends PageQuery {
|
||||
/**
|
||||
* 巡检项目id
|
||||
*/
|
||||
itemId?: string | number;
|
||||
|
||||
/**
|
||||
* 巡检点名称
|
||||
*/
|
||||
pointName?: string;
|
||||
|
||||
/**
|
||||
* 巡检点类型
|
||||
*/
|
||||
pointType?: number;
|
||||
|
||||
/**
|
||||
* nfc编码
|
||||
*/
|
||||
nfcCode?: string;
|
||||
|
||||
/**
|
||||
* 创建人id
|
||||
*/
|
||||
createById?: string | number;
|
||||
|
||||
/**
|
||||
* 更新人id
|
||||
*/
|
||||
updateById?: string | number;
|
||||
|
||||
/**
|
||||
* 搜索值
|
||||
*/
|
||||
searchValue?: string;
|
||||
|
||||
/**
|
||||
* 日期范围参数
|
||||
*/
|
||||
params?: any;
|
||||
}
|
@@ -0,0 +1,61 @@
|
||||
import type { InspectionRouteVO, InspectionRouteForm, InspectionRouteQuery } 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 inspectionRouteList(params?: InspectionRouteQuery) {
|
||||
return requestClient.get<PageResult<InspectionRouteVO>>('/property/inspectionRoute/list', { params });
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出巡检路线列表
|
||||
* @param params
|
||||
* @returns 巡检路线列表
|
||||
*/
|
||||
export function inspectionRouteExport(params?: InspectionRouteQuery) {
|
||||
return commonExport('/property/inspectionRoute/export', params ?? {});
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询巡检路线详情
|
||||
* @param id id
|
||||
* @returns 巡检路线详情
|
||||
*/
|
||||
export function inspectionRouteInfo(id: ID) {
|
||||
return requestClient.get<InspectionRouteVO>(`/property/inspectionRoute/${id}`);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增巡检路线
|
||||
* @param data
|
||||
* @returns void
|
||||
*/
|
||||
export function inspectionRouteAdd(data: InspectionRouteForm) {
|
||||
return requestClient.postWithMsg<void>('/property/inspectionRoute', data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新巡检路线
|
||||
* @param data
|
||||
* @returns void
|
||||
*/
|
||||
export function inspectionRouteUpdate(data: InspectionRouteForm) {
|
||||
return requestClient.putWithMsg<void>('/property/inspectionRoute', data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除巡检路线
|
||||
* @param id id
|
||||
* @returns void
|
||||
*/
|
||||
export function inspectionRouteRemove(id: ID | IDS) {
|
||||
return requestClient.deleteWithMsg<void>(`/property/inspectionRoute/${id}`);
|
||||
}
|
49
apps/web-antd/src/api/property/inspectionManagement/inspectionRoute/model.d.ts
vendored
Normal file
49
apps/web-antd/src/api/property/inspectionManagement/inspectionRoute/model.d.ts
vendored
Normal file
@@ -0,0 +1,49 @@
|
||||
import type { PageQuery, BaseEntity } from '#/api/common';
|
||||
|
||||
export interface InspectionRouteVO {
|
||||
/**
|
||||
* 主键id
|
||||
*/
|
||||
id: string | number;
|
||||
|
||||
/**
|
||||
* 路线名称
|
||||
*/
|
||||
routeName: string;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
remark: string;
|
||||
|
||||
}
|
||||
|
||||
export interface InspectionRouteForm extends BaseEntity {
|
||||
/**
|
||||
* 主键id
|
||||
*/
|
||||
id?: string | number;
|
||||
|
||||
/**
|
||||
* 路线名称
|
||||
*/
|
||||
routeName?: string;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
remark?: string;
|
||||
|
||||
}
|
||||
|
||||
export interface InspectionRouteQuery extends PageQuery {
|
||||
/**
|
||||
* 路线名称
|
||||
*/
|
||||
routeName?: string;
|
||||
|
||||
/**
|
||||
* 日期范围参数
|
||||
*/
|
||||
params?: any;
|
||||
}
|
@@ -0,0 +1,61 @@
|
||||
import type { InspectionTaskVO, InspectionTaskForm, InspectionTaskQuery } 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 inspectionTaskList(params?: InspectionTaskQuery) {
|
||||
return requestClient.get<PageResult<InspectionTaskVO>>('/property/inspectionTask/list', { params });
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出巡检任务列表
|
||||
* @param params
|
||||
* @returns 巡检任务列表
|
||||
*/
|
||||
export function inspectionTaskExport(params?: InspectionTaskQuery) {
|
||||
return commonExport('/property/inspectionTask/export', params ?? {});
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询巡检任务详情
|
||||
* @param id id
|
||||
* @returns 巡检任务详情
|
||||
*/
|
||||
export function inspectionTaskInfo(id: ID) {
|
||||
return requestClient.get<InspectionTaskVO>(`/property/inspectionTask/${id}`);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增巡检任务
|
||||
* @param data
|
||||
* @returns void
|
||||
*/
|
||||
export function inspectionTaskAdd(data: InspectionTaskForm) {
|
||||
return requestClient.postWithMsg<void>('/property/inspectionTask', data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新巡检任务
|
||||
* @param data
|
||||
* @returns void
|
||||
*/
|
||||
export function inspectionTaskUpdate(data: InspectionTaskForm) {
|
||||
return requestClient.putWithMsg<void>('/property/inspectionTask', data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除巡检任务
|
||||
* @param id id
|
||||
* @returns void
|
||||
*/
|
||||
export function inspectionTaskRemove(id: ID | IDS) {
|
||||
return requestClient.deleteWithMsg<void>(`/property/inspectionTask/${id}`);
|
||||
}
|
169
apps/web-antd/src/api/property/inspectionManagement/inspectionTask/model.d.ts
vendored
Normal file
169
apps/web-antd/src/api/property/inspectionManagement/inspectionTask/model.d.ts
vendored
Normal file
@@ -0,0 +1,169 @@
|
||||
import type { PageQuery, BaseEntity } from '#/api/common';
|
||||
|
||||
export interface InspectionTaskVO {
|
||||
/**
|
||||
* 主键id
|
||||
*/
|
||||
id: string | number;
|
||||
|
||||
/**
|
||||
* 巡检计划id
|
||||
*/
|
||||
inspectionPlanId: string | number;
|
||||
|
||||
/**
|
||||
* 实际巡检时间
|
||||
*/
|
||||
actInsTime: string;
|
||||
|
||||
/**
|
||||
* 当前巡检人
|
||||
*/
|
||||
actUserId: string | number;
|
||||
|
||||
/**
|
||||
* 巡检方式
|
||||
*/
|
||||
taskType: string;
|
||||
|
||||
/**
|
||||
* 转移描述
|
||||
*/
|
||||
transferDesc: string;
|
||||
|
||||
/**
|
||||
* 巡检状态
|
||||
*/
|
||||
status: string;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
remark: string;
|
||||
|
||||
/**
|
||||
* 创建人id
|
||||
*/
|
||||
createById: string | number;
|
||||
|
||||
/**
|
||||
* 更新人id
|
||||
*/
|
||||
updateById: string | number;
|
||||
|
||||
/**
|
||||
* 搜索值
|
||||
*/
|
||||
searchValue: string;
|
||||
|
||||
}
|
||||
|
||||
export interface InspectionTaskForm extends BaseEntity {
|
||||
/**
|
||||
* 主键id
|
||||
*/
|
||||
id?: string | number;
|
||||
|
||||
/**
|
||||
* 巡检计划id
|
||||
*/
|
||||
inspectionPlanId?: string | number;
|
||||
|
||||
/**
|
||||
* 实际巡检时间
|
||||
*/
|
||||
actInsTime?: string;
|
||||
|
||||
/**
|
||||
* 当前巡检人
|
||||
*/
|
||||
actUserId?: string | number;
|
||||
|
||||
/**
|
||||
* 巡检方式
|
||||
*/
|
||||
taskType?: string;
|
||||
|
||||
/**
|
||||
* 转移描述
|
||||
*/
|
||||
transferDesc?: string;
|
||||
|
||||
/**
|
||||
* 巡检状态
|
||||
*/
|
||||
status?: string;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
remark?: string;
|
||||
|
||||
/**
|
||||
* 创建人id
|
||||
*/
|
||||
createById?: string | number;
|
||||
|
||||
/**
|
||||
* 更新人id
|
||||
*/
|
||||
updateById?: string | number;
|
||||
|
||||
/**
|
||||
* 搜索值
|
||||
*/
|
||||
searchValue?: string;
|
||||
|
||||
}
|
||||
|
||||
export interface InspectionTaskQuery extends PageQuery {
|
||||
/**
|
||||
* 巡检计划id
|
||||
*/
|
||||
inspectionPlanId?: string | number;
|
||||
|
||||
/**
|
||||
* 实际巡检时间
|
||||
*/
|
||||
actInsTime?: string;
|
||||
|
||||
/**
|
||||
* 当前巡检人
|
||||
*/
|
||||
actUserId?: string | number;
|
||||
|
||||
/**
|
||||
* 巡检方式
|
||||
*/
|
||||
taskType?: string;
|
||||
|
||||
/**
|
||||
* 转移描述
|
||||
*/
|
||||
transferDesc?: string;
|
||||
|
||||
/**
|
||||
* 巡检状态
|
||||
*/
|
||||
status?: string;
|
||||
|
||||
/**
|
||||
* 创建人id
|
||||
*/
|
||||
createById?: string | number;
|
||||
|
||||
/**
|
||||
* 更新人id
|
||||
*/
|
||||
updateById?: string | number;
|
||||
|
||||
/**
|
||||
* 搜索值
|
||||
*/
|
||||
searchValue?: string;
|
||||
|
||||
/**
|
||||
* 日期范围参数
|
||||
*/
|
||||
params?: any;
|
||||
}
|
61
apps/web-antd/src/api/sis/elevatorInfo/index.ts
Normal file
61
apps/web-antd/src/api/sis/elevatorInfo/index.ts
Normal file
@@ -0,0 +1,61 @@
|
||||
import type { ElevatorInfoVO, ElevatorInfoForm, ElevatorInfoQuery } 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 elevatorInfoList(params?: ElevatorInfoQuery) {
|
||||
return requestClient.get<PageResult<ElevatorInfoVO>>('/sis/elevatorInfo/list', { params });
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出电梯基本信息列表
|
||||
* @param params
|
||||
* @returns 电梯基本信息列表
|
||||
*/
|
||||
export function elevatorInfoExport(params?: ElevatorInfoQuery) {
|
||||
return commonExport('/sis/elevatorInfo/export', params ?? {});
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询电梯基本信息详情
|
||||
* @param elevatorId id
|
||||
* @returns 电梯基本信息详情
|
||||
*/
|
||||
export function elevatorInfoInfo(elevatorId: ID) {
|
||||
return requestClient.get<ElevatorInfoVO>(`/sis/elevatorInfo/${elevatorId}`);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增电梯基本信息
|
||||
* @param data
|
||||
* @returns void
|
||||
*/
|
||||
export function elevatorInfoAdd(data: ElevatorInfoForm) {
|
||||
return requestClient.postWithMsg<void>('/sis/elevatorInfo', data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新电梯基本信息
|
||||
* @param data
|
||||
* @returns void
|
||||
*/
|
||||
export function elevatorInfoUpdate(data: ElevatorInfoForm) {
|
||||
return requestClient.putWithMsg<void>('/sis/elevatorInfo', data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除电梯基本信息
|
||||
* @param elevatorId id
|
||||
* @returns void
|
||||
*/
|
||||
export function elevatorInfoRemove(elevatorId: ID | IDS) {
|
||||
return requestClient.deleteWithMsg<void>(`/sis/elevatorInfo/${elevatorId}`);
|
||||
}
|
294
apps/web-antd/src/api/sis/elevatorInfo/model.d.ts
vendored
Normal file
294
apps/web-antd/src/api/sis/elevatorInfo/model.d.ts
vendored
Normal file
@@ -0,0 +1,294 @@
|
||||
import type { PageQuery, BaseEntity } from '#/api/common';
|
||||
|
||||
export interface ElevatorInfoVO {
|
||||
/**
|
||||
*
|
||||
*/
|
||||
elevatorId: string | number;
|
||||
|
||||
/**
|
||||
* 电梯编号
|
||||
*/
|
||||
elevatorCode: string;
|
||||
|
||||
/**
|
||||
* 电梯名称
|
||||
*/
|
||||
elevatorName: string;
|
||||
|
||||
/**
|
||||
* 安装位置
|
||||
*/
|
||||
location: string;
|
||||
|
||||
/**
|
||||
* 品牌
|
||||
*/
|
||||
brand: string;
|
||||
|
||||
/**
|
||||
* 型号
|
||||
*/
|
||||
model: string;
|
||||
|
||||
/**
|
||||
* 生产日期
|
||||
*/
|
||||
manufactureDate: string;
|
||||
|
||||
/**
|
||||
* 安装日期
|
||||
*/
|
||||
installationDate: string;
|
||||
|
||||
/**
|
||||
* 最大载重(kg)
|
||||
*/
|
||||
maxLoad: number;
|
||||
|
||||
/**
|
||||
* 服务楼层数
|
||||
*/
|
||||
floorsServed: number;
|
||||
|
||||
/**
|
||||
* 维保公司
|
||||
*/
|
||||
maintenanceCompany: string;
|
||||
|
||||
/**
|
||||
* 维保电话
|
||||
*/
|
||||
maintenancePhone: string;
|
||||
|
||||
/**
|
||||
* 上次年检日期
|
||||
*/
|
||||
lastInspectionDate: string;
|
||||
|
||||
/**
|
||||
* 下次年检日期
|
||||
*/
|
||||
nextInspectionDate: string;
|
||||
|
||||
/**
|
||||
* 梯控厂商
|
||||
*/
|
||||
controlFactory: string;
|
||||
|
||||
/**
|
||||
* 梯控设备ip
|
||||
*/
|
||||
controlIp: string;
|
||||
|
||||
/**
|
||||
* 梯控设备编码
|
||||
*/
|
||||
controlPort: number;
|
||||
|
||||
/**
|
||||
* 梯控设备登录账号
|
||||
*/
|
||||
controlAccount: string;
|
||||
|
||||
/**
|
||||
* 梯控设备登录密码
|
||||
*/
|
||||
controlPwd: string;
|
||||
|
||||
}
|
||||
|
||||
export interface ElevatorInfoForm extends BaseEntity {
|
||||
/**
|
||||
*
|
||||
*/
|
||||
elevatorId?: string | number;
|
||||
|
||||
/**
|
||||
* 电梯编号
|
||||
*/
|
||||
elevatorCode?: string;
|
||||
|
||||
/**
|
||||
* 电梯名称
|
||||
*/
|
||||
elevatorName?: string;
|
||||
|
||||
/**
|
||||
* 安装位置
|
||||
*/
|
||||
location?: string;
|
||||
|
||||
/**
|
||||
* 品牌
|
||||
*/
|
||||
brand?: string;
|
||||
|
||||
/**
|
||||
* 型号
|
||||
*/
|
||||
model?: string;
|
||||
|
||||
/**
|
||||
* 生产日期
|
||||
*/
|
||||
manufactureDate?: string;
|
||||
|
||||
/**
|
||||
* 安装日期
|
||||
*/
|
||||
installationDate?: string;
|
||||
|
||||
/**
|
||||
* 最大载重(kg)
|
||||
*/
|
||||
maxLoad?: number;
|
||||
|
||||
/**
|
||||
* 服务楼层数
|
||||
*/
|
||||
floorsServed?: number;
|
||||
|
||||
/**
|
||||
* 维保公司
|
||||
*/
|
||||
maintenanceCompany?: string;
|
||||
|
||||
/**
|
||||
* 维保电话
|
||||
*/
|
||||
maintenancePhone?: string;
|
||||
|
||||
/**
|
||||
* 上次年检日期
|
||||
*/
|
||||
lastInspectionDate?: string;
|
||||
|
||||
/**
|
||||
* 下次年检日期
|
||||
*/
|
||||
nextInspectionDate?: string;
|
||||
|
||||
/**
|
||||
* 梯控厂商
|
||||
*/
|
||||
controlFactory?: string;
|
||||
|
||||
/**
|
||||
* 梯控设备ip
|
||||
*/
|
||||
controlIp?: string;
|
||||
|
||||
/**
|
||||
* 梯控设备编码
|
||||
*/
|
||||
controlPort?: number;
|
||||
|
||||
/**
|
||||
* 梯控设备登录账号
|
||||
*/
|
||||
controlAccount?: string;
|
||||
|
||||
/**
|
||||
* 梯控设备登录密码
|
||||
*/
|
||||
controlPwd?: string;
|
||||
|
||||
}
|
||||
|
||||
export interface ElevatorInfoQuery extends PageQuery {
|
||||
/**
|
||||
* 电梯编号
|
||||
*/
|
||||
elevatorCode?: string;
|
||||
|
||||
/**
|
||||
* 电梯名称
|
||||
*/
|
||||
elevatorName?: string;
|
||||
|
||||
/**
|
||||
* 安装位置
|
||||
*/
|
||||
location?: string;
|
||||
|
||||
/**
|
||||
* 品牌
|
||||
*/
|
||||
brand?: string;
|
||||
|
||||
/**
|
||||
* 型号
|
||||
*/
|
||||
model?: string;
|
||||
|
||||
/**
|
||||
* 生产日期
|
||||
*/
|
||||
manufactureDate?: string;
|
||||
|
||||
/**
|
||||
* 安装日期
|
||||
*/
|
||||
installationDate?: string;
|
||||
|
||||
/**
|
||||
* 最大载重(kg)
|
||||
*/
|
||||
maxLoad?: number;
|
||||
|
||||
/**
|
||||
* 服务楼层数
|
||||
*/
|
||||
floorsServed?: number;
|
||||
|
||||
/**
|
||||
* 维保公司
|
||||
*/
|
||||
maintenanceCompany?: string;
|
||||
|
||||
/**
|
||||
* 维保电话
|
||||
*/
|
||||
maintenancePhone?: string;
|
||||
|
||||
/**
|
||||
* 上次年检日期
|
||||
*/
|
||||
lastInspectionDate?: string;
|
||||
|
||||
/**
|
||||
* 下次年检日期
|
||||
*/
|
||||
nextInspectionDate?: string;
|
||||
|
||||
/**
|
||||
* 梯控厂商
|
||||
*/
|
||||
controlFactory?: string;
|
||||
|
||||
/**
|
||||
* 梯控设备ip
|
||||
*/
|
||||
controlIp?: string;
|
||||
|
||||
/**
|
||||
* 梯控设备编码
|
||||
*/
|
||||
controlPort?: number;
|
||||
|
||||
/**
|
||||
* 梯控设备登录账号
|
||||
*/
|
||||
controlAccount?: string;
|
||||
|
||||
/**
|
||||
* 梯控设备登录密码
|
||||
*/
|
||||
controlPwd?: string;
|
||||
|
||||
/**
|
||||
* 日期范围参数
|
||||
*/
|
||||
params?: any;
|
||||
}
|
@@ -4,6 +4,8 @@ import {renderDict} from "#/utils/render";
|
||||
import {getDictOptions} from "#/utils/dict";
|
||||
import {h} from "vue";
|
||||
import {Rate} from "ant-design-vue";
|
||||
import type {Dayjs} from "dayjs";
|
||||
import dayjs from "dayjs";
|
||||
|
||||
|
||||
export const querySchema: FormSchemaGetter = () => [
|
||||
@@ -39,6 +41,11 @@ export const columns: VxeGridProps['columns'] = [
|
||||
field: 'orderName',
|
||||
minWidth: 180,
|
||||
},
|
||||
{
|
||||
title: '工单类型',
|
||||
field: 'typeName',
|
||||
minWidth: 150,
|
||||
},
|
||||
{
|
||||
title: '派单时间',
|
||||
field: 'dispatchTime',
|
||||
@@ -73,8 +80,8 @@ export const columns: VxeGridProps['columns'] = [
|
||||
title: '评价',
|
||||
field: 'serviceEvalua',
|
||||
width: 180,
|
||||
slots:{
|
||||
default: ({ row }) => {
|
||||
slots: {
|
||||
default: ({row}) => {
|
||||
return h(Rate, {
|
||||
value: row.serviceEvalua || 0,
|
||||
disabled: true,
|
||||
@@ -143,6 +150,7 @@ export const modalSchema: FormSchemaGetter = () => [
|
||||
showTime: true,
|
||||
format: 'YYYY-MM-DD HH:mm:ss',
|
||||
valueFormat: 'YYYY-MM-DD HH:mm:ss',
|
||||
disabledDate: disabledDate
|
||||
},
|
||||
rules: 'selectRequired',
|
||||
},
|
||||
@@ -208,3 +216,6 @@ export const modalSchema: FormSchemaGetter = () => [
|
||||
rules: 'selectRequired',
|
||||
},
|
||||
];
|
||||
const disabledDate = (current: Dayjs) => {
|
||||
return current && current < dayjs().endOf('day');
|
||||
};
|
||||
|
@@ -35,6 +35,14 @@ const formOptions: VbenFormProps = {
|
||||
},
|
||||
schema: querySchema(),
|
||||
wrapperClass: 'grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4',
|
||||
handleReset: async () => {
|
||||
ordersType.value = '0';
|
||||
const { formApi, reload } = tableApi;
|
||||
await formApi.resetForm();
|
||||
const formValues = formApi.form.values;
|
||||
formApi.setLatestSubmissionValues(formValues);
|
||||
await reload(formValues);
|
||||
},
|
||||
};
|
||||
|
||||
const gridOptions: VxeGridProps = {
|
||||
@@ -53,6 +61,7 @@ const gridOptions: VxeGridProps = {
|
||||
proxyConfig: {
|
||||
ajax: {
|
||||
query: async ({page}, formValues = {}) => {
|
||||
formValues.type = ordersType.value=='0'?undefined:ordersType.value;
|
||||
return await workOrdersList({
|
||||
pageNum: page.currentPage,
|
||||
pageSize: page.pageSize,
|
||||
@@ -85,7 +94,7 @@ function handleAdd() {
|
||||
modalApi.setData({});
|
||||
modalApi.open();
|
||||
}
|
||||
function handleInfo(row) {
|
||||
function handleInfo(row:any) {
|
||||
detailApi.setData({id:row.id});
|
||||
detailApi.open();
|
||||
}
|
||||
@@ -139,21 +148,14 @@ async function queryOrderType() {
|
||||
onMounted(async () => {
|
||||
await queryOrderType()
|
||||
});
|
||||
|
||||
async function changeOrdersType(val: string) {
|
||||
await tableApi.formApi.setValues({
|
||||
type: val === '0' ? undefined : val, // '0' 表示全部工单,传 undefined 或清除该字段
|
||||
});
|
||||
console.log(tableApi.formApi.getValues(),'==================')
|
||||
await tableApi.query()
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<Page :auto-content-height="true">
|
||||
<BasicTable table-title="工单处理列表">
|
||||
<BasicTable table-title="工单处理列表" class="order-work-left-radio">
|
||||
<template #table-title>
|
||||
<RadioGroup v-model:value="ordersType" button-style="solid" @change="changeOrdersType">
|
||||
<RadioGroup v-model:value="ordersType" button-style="solid"
|
||||
@change="() => tableApi.reload()">
|
||||
<RadioButton v-for="item in ordersTypeList"
|
||||
:value="item.value">{{ item.label }}
|
||||
</RadioButton>
|
||||
@@ -219,3 +221,18 @@ async function changeOrdersType(val: string) {
|
||||
<WorkOrdersDetail/>
|
||||
</Page>
|
||||
</template>
|
||||
<style lang="scss" scoped>
|
||||
:where(.css-dev-only-do-not-override-aza1th).ant-radio-group {
|
||||
white-space: nowrap;
|
||||
overflow-y: hidden;
|
||||
margin-right: 10px;
|
||||
}
|
||||
|
||||
</style>
|
||||
<style lang="scss">
|
||||
.order-work-left-radio{
|
||||
.vxe-toolbar .vxe-buttons--wrapper, .vxe-toolbar .vxe-tools--wrapper {
|
||||
max-width: 70% !important;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
@@ -24,7 +24,7 @@ const [BasicModal, modalApi] = useVbenModal({
|
||||
});
|
||||
|
||||
const orderDetail = shallowRef<null | WorkOrdersVO>(null);
|
||||
|
||||
const handleRecords=ref<any[]>([])
|
||||
async function handleOpenChange(open: boolean) {
|
||||
if (!open) {
|
||||
return null;
|
||||
@@ -34,6 +34,13 @@ async function handleOpenChange(open: boolean) {
|
||||
const {id} = modalApi.getData() as { id: number | string };
|
||||
// 赋值
|
||||
orderDetail.value = await workOrdersInfo(id);
|
||||
if(orderDetail.value){
|
||||
handleRecords.value=[
|
||||
{type:orderDetail.value.typeName,time:orderDetail.value.compleTime,personName:orderDetail.value.handlerText},
|
||||
{type:'跟进',time:orderDetail.value.dispatchTime,personName:orderDetail.value.initiatorNameText},
|
||||
{type:'创建工单',time:orderDetail.value.createTime,personName:orderDetail.value.initiatorNameText},
|
||||
]
|
||||
}
|
||||
|
||||
modalApi.modalLoading(false);
|
||||
}
|
||||
@@ -52,18 +59,16 @@ async function handleOpenChange(open: boolean) {
|
||||
{{ orderDetail.orderName }}
|
||||
</DescriptionsItem>
|
||||
<DescriptionsItem label="工单类型">
|
||||
<component
|
||||
:is="renderDict(orderDetail.customerType,'wy_khlx')"
|
||||
/>
|
||||
{{orderDetail.typeName}}
|
||||
</DescriptionsItem>
|
||||
<DescriptionsItem label="发起人">
|
||||
{{ orderDetail.rentalPeriod }}
|
||||
{{ orderDetail.initiatorNameText+'-'+orderDetail.initiatorPhone}}
|
||||
</DescriptionsItem>
|
||||
<DescriptionsItem label="派单时间">
|
||||
{{ orderDetail.dispatchTime }}
|
||||
</DescriptionsItem>
|
||||
<DescriptionsItem label="处理人">
|
||||
{{ orderDetail.totalAmount + "元" }}
|
||||
{{ orderDetail.handlerText }}
|
||||
</DescriptionsItem>
|
||||
<DescriptionsItem label="具体位置" :span="2">
|
||||
{{ orderDetail.location }}
|
||||
@@ -74,7 +79,7 @@ async function handleOpenChange(open: boolean) {
|
||||
<DescriptionsItem label="完成时间">
|
||||
{{ orderDetail.compleTime }}
|
||||
</DescriptionsItem>
|
||||
<DescriptionsItem label="评价">
|
||||
<DescriptionsItem label="服务评价">
|
||||
<Rate :value="orderDetail.serviceEvalua" disabled/>
|
||||
</DescriptionsItem>
|
||||
<DescriptionsItem label="是否超时">
|
||||
@@ -86,11 +91,11 @@ async function handleOpenChange(open: boolean) {
|
||||
<Divider orientation="left" orientation-margin="0px">
|
||||
处理记录
|
||||
</Divider>
|
||||
<Timeline>
|
||||
<TimelineItem>
|
||||
<p>类型:</p>
|
||||
<p>时间:</p>
|
||||
<p>处理人:</p>
|
||||
<Timeline v-if="handleRecords.length">
|
||||
<TimelineItem v-for="item in handleRecords">
|
||||
<p>类型:{{item.type}}</p>
|
||||
<p>时间:{{item.time}}</p>
|
||||
<p>处理人:{{item.personName}}</p>
|
||||
</TimelineItem>
|
||||
</Timeline>
|
||||
</div>
|
||||
|
@@ -98,7 +98,7 @@ export const modalSchema: FormSchemaGetter = () => [
|
||||
},
|
||||
{
|
||||
label: '完成时效(小时)',
|
||||
fieldName: 'isTransfers',
|
||||
fieldName: 'completionNumber',
|
||||
component: 'Input',
|
||||
rules: 'required',
|
||||
},
|
||||
|
@@ -41,11 +41,6 @@ async function handleOpenChange(open: boolean) {
|
||||
:is="renderDict(workOrdersTypeInfoDetail.operationMode,'pro_operation_pattern')"
|
||||
/>
|
||||
</DescriptionsItem>
|
||||
<DescriptionsItem label="运作模式" v-if="workOrdersTypeInfoDetail.operationMode!=null">
|
||||
<component
|
||||
:is="renderDict(workOrdersTypeInfoDetail.operationMode,'pro_operation_pattern')"
|
||||
/>
|
||||
</DescriptionsItem>
|
||||
<DescriptionsItem label="排序值">
|
||||
{{ workOrdersTypeInfoDetail.sort }}
|
||||
</DescriptionsItem>
|
||||
|
@@ -189,6 +189,6 @@ export const modalSchema: FormSchemaGetter = () => [
|
||||
{
|
||||
label: '备注',
|
||||
fieldName: 'remark',
|
||||
component: 'Input',
|
||||
component: 'Textarea',
|
||||
},
|
||||
];
|
||||
|
@@ -120,6 +120,7 @@ export const modalSchema: FormSchemaGetter = () => [
|
||||
label: '价格体系',
|
||||
fieldName: 'price',
|
||||
component: 'Input',
|
||||
rules: 'required',
|
||||
},
|
||||
{
|
||||
label: '状态',
|
||||
@@ -134,6 +135,6 @@ export const modalSchema: FormSchemaGetter = () => [
|
||||
{
|
||||
label: '备注',
|
||||
fieldName: 'remarks',
|
||||
component: 'Input',
|
||||
component: 'Textarea',
|
||||
},
|
||||
];
|
||||
|
@@ -0,0 +1,68 @@
|
||||
import type { FormSchemaGetter } from '#/adapter/form';
|
||||
import type { VxeGridProps } from '#/adapter/vxe-table';
|
||||
|
||||
|
||||
export const querySchema: FormSchemaGetter = () => [
|
||||
{
|
||||
component: 'Input',
|
||||
fieldName: 'id',
|
||||
label: '编号',
|
||||
},
|
||||
{
|
||||
component: 'Input',
|
||||
fieldName: 'itemName',
|
||||
label: '巡检项目',
|
||||
},
|
||||
];
|
||||
|
||||
// 需要使用i18n注意这里要改成getter形式 否则切换语言不会刷新
|
||||
// export const columns: () => VxeGridProps['columns'] = () => [
|
||||
export const columns: VxeGridProps['columns'] = [
|
||||
{ type: 'checkbox', width: 60 },
|
||||
{
|
||||
title: '编号',
|
||||
field: 'id',
|
||||
},
|
||||
{
|
||||
title: '巡检项目',
|
||||
field: 'itemName',
|
||||
},
|
||||
{
|
||||
title: '创建时间',
|
||||
field: 'createTime',
|
||||
},
|
||||
{
|
||||
title: '备注',
|
||||
field: 'remark',
|
||||
},
|
||||
{
|
||||
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: 'itemName',
|
||||
component: 'Input',
|
||||
rules: 'required',
|
||||
},
|
||||
{
|
||||
label: '备注',
|
||||
fieldName: 'remark',
|
||||
component: 'Textarea',
|
||||
},
|
||||
];
|
@@ -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 {
|
||||
inspectionItemExport,
|
||||
inspectionItemList,
|
||||
inspectionItemRemove,
|
||||
} from '#/api/property/inspectionManagement/inspectionItem';
|
||||
import type { InspectionItemForm } from '#/api/property/inspectionManagement/inspectionItem/model';
|
||||
import { commonDownloadExcel } from '#/utils/file/download';
|
||||
|
||||
import inspectionItemModal from './inspectionItem-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 inspectionItemList({
|
||||
pageNum: page.currentPage,
|
||||
pageSize: page.pageSize,
|
||||
...formValues,
|
||||
});
|
||||
},
|
||||
},
|
||||
},
|
||||
rowConfig: {
|
||||
keyField: 'id',
|
||||
},
|
||||
// 表格全局唯一表示 保存列配置需要用到
|
||||
id: 'property-inspectionItem-index'
|
||||
};
|
||||
|
||||
const [BasicTable, tableApi] = useVbenVxeGrid({
|
||||
formOptions,
|
||||
gridOptions,
|
||||
});
|
||||
|
||||
const [InspectionItemModal, modalApi] = useVbenModal({
|
||||
connectedComponent: inspectionItemModal,
|
||||
});
|
||||
|
||||
function handleAdd() {
|
||||
modalApi.setData({});
|
||||
modalApi.open();
|
||||
}
|
||||
|
||||
async function handleEdit(row: Required<InspectionItemForm>) {
|
||||
modalApi.setData({ id: row.id });
|
||||
modalApi.open();
|
||||
}
|
||||
|
||||
async function handleDelete(row: Required<InspectionItemForm>) {
|
||||
await inspectionItemRemove(row.id);
|
||||
await tableApi.query();
|
||||
}
|
||||
|
||||
function handleMultiDelete() {
|
||||
const rows = tableApi.grid.getCheckboxRecords();
|
||||
const ids = rows.map((row: Required<InspectionItemForm>) => row.id);
|
||||
Modal.confirm({
|
||||
title: '提示',
|
||||
okType: 'danger',
|
||||
content: `确认删除选中的${ids.length}条记录吗?`,
|
||||
onOk: async () => {
|
||||
await inspectionItemRemove(ids);
|
||||
await tableApi.query();
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
function handleDownloadExcel() {
|
||||
commonDownloadExcel(inspectionItemExport, '巡检项目数据', 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:inspectionItem:export']"
|
||||
@click="handleDownloadExcel"
|
||||
>
|
||||
{{ $t('pages.common.export') }}
|
||||
</a-button>
|
||||
<a-button
|
||||
:disabled="!vxeCheckboxChecked(tableApi)"
|
||||
danger
|
||||
type="primary"
|
||||
v-access:code="['property:inspectionItem:remove']"
|
||||
@click="handleMultiDelete">
|
||||
{{ $t('pages.common.delete') }}
|
||||
</a-button>
|
||||
<a-button
|
||||
type="primary"
|
||||
v-access:code="['property:inspectionItem:add']"
|
||||
@click="handleAdd"
|
||||
>
|
||||
{{ $t('pages.common.add') }}
|
||||
</a-button>
|
||||
</Space>
|
||||
</template>
|
||||
<template #action="{ row }">
|
||||
<Space>
|
||||
<ghost-button
|
||||
v-access:code="['property:inspectionItem: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:inspectionItem:remove']"
|
||||
@click.stop=""
|
||||
>
|
||||
{{ $t('pages.common.delete') }}
|
||||
</ghost-button>
|
||||
</Popconfirm>
|
||||
</Space>
|
||||
</template>
|
||||
</BasicTable>
|
||||
<InspectionItemModal @reload="tableApi.query()" />
|
||||
</Page>
|
||||
</template>
|
@@ -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 { inspectionItemAdd, inspectionItemInfo, inspectionItemUpdate } from '#/api/property/inspectionManagement/inspectionItem';
|
||||
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 inspectionItemInfo(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 ? inspectionItemUpdate(data) : inspectionItemAdd(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>
|
||||
|
@@ -0,0 +1,220 @@
|
||||
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',
|
||||
componentProps: {
|
||||
options: getDictOptions('wy_xjzq'),
|
||||
},
|
||||
fieldName: 'inspectionPlanPeriod',
|
||||
label: '巡检周期',
|
||||
},
|
||||
{
|
||||
component: 'Select',
|
||||
componentProps: {
|
||||
options: getDictOptions('wy_xjqdfs'),
|
||||
},
|
||||
fieldName: 'signType',
|
||||
label: '签到方式',
|
||||
},
|
||||
];
|
||||
|
||||
export const columns: VxeGridProps['columns'] = [
|
||||
{type: 'checkbox', width: 60},
|
||||
{
|
||||
title: '主键id',
|
||||
field: 'id',
|
||||
},
|
||||
{
|
||||
title: '巡检计划名称',
|
||||
field: 'planName',
|
||||
},
|
||||
{
|
||||
title: '巡检路线',
|
||||
field: 'inspectionRouteId',
|
||||
},
|
||||
{
|
||||
title: '巡检周期',
|
||||
field: 'inspectionPlanPeriod',
|
||||
slots: {
|
||||
default: ({ row }) => {
|
||||
return renderDict(row.inspectionPlanPeriod, 'wy_xjzq');
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '任务提前分组',
|
||||
field: 'beforeTime',
|
||||
},
|
||||
{
|
||||
title: '开始日期',
|
||||
field: 'startDate',
|
||||
},
|
||||
{
|
||||
title: '结束日期',
|
||||
field: 'endDate',
|
||||
},
|
||||
{
|
||||
title: '开始时间',
|
||||
field: 'startTime',
|
||||
},
|
||||
{
|
||||
title: '结束时间',
|
||||
field: 'endTime',
|
||||
},
|
||||
{
|
||||
title: '签到方式',
|
||||
field: 'signType',
|
||||
slots: {
|
||||
default: ({ row }) => {
|
||||
return renderDict(row.signType, 'wy_xjqdfs');
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '是否允许补检',
|
||||
field: 'canReexamine',
|
||||
slots: {
|
||||
default: ({ row }) => {
|
||||
return renderDict(row.canReexamine, 'wy_sf');
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '选择员工',
|
||||
field: 'userId',
|
||||
},
|
||||
{
|
||||
title: '备注',
|
||||
field: 'remark',
|
||||
},
|
||||
{
|
||||
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: 'planName',
|
||||
component: 'Input',
|
||||
rules: 'required',
|
||||
},
|
||||
{
|
||||
label: '巡检路线',
|
||||
fieldName: 'inspectionRouteId',
|
||||
component: 'Input',
|
||||
rules: 'required',
|
||||
},
|
||||
{
|
||||
label: '巡检周期',
|
||||
fieldName: 'inspectionPlanPeriod',
|
||||
component: 'Input',
|
||||
rules: 'required',
|
||||
componentProps: {
|
||||
options: getDictOptions('wy_xjzq'),
|
||||
},
|
||||
},
|
||||
{
|
||||
label: '任务提前分组',
|
||||
fieldName: 'beforeTime',
|
||||
component: 'Input',
|
||||
rules: 'required',
|
||||
},
|
||||
{
|
||||
label: '开始日期',
|
||||
fieldName: 'startDate',
|
||||
component: 'DatePicker',
|
||||
componentProps: {
|
||||
showTime: true,
|
||||
format: 'YYYY-MM-DD HH:mm:ss',
|
||||
valueFormat: 'YYYY-MM-DD HH:mm:ss',
|
||||
},
|
||||
rules: 'required',
|
||||
},
|
||||
{
|
||||
label: '结束日期',
|
||||
fieldName: 'endDate',
|
||||
component: 'DatePicker',
|
||||
componentProps: {
|
||||
showTime: true,
|
||||
format: 'YYYY-MM-DD HH:mm:ss',
|
||||
valueFormat: 'YYYY-MM-DD HH:mm:ss',
|
||||
},
|
||||
rules: 'required',
|
||||
},
|
||||
{
|
||||
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: 'signType',
|
||||
component: 'Select',
|
||||
componentProps: {
|
||||
options: getDictOptions('wy_xjqdfs'),
|
||||
},
|
||||
rules: 'selectRequired',
|
||||
},
|
||||
{
|
||||
label: '允许补检',
|
||||
fieldName: 'canReexamine',
|
||||
component: 'Select',
|
||||
componentProps: {
|
||||
options: getDictOptions('wy_sf'),
|
||||
},
|
||||
rules: 'selectRequired',
|
||||
},
|
||||
{
|
||||
label: '选择员工',
|
||||
fieldName: 'userId',
|
||||
component: 'Input',
|
||||
rules: 'required',
|
||||
},
|
||||
{
|
||||
label: '备注',
|
||||
fieldName: 'remark',
|
||||
component: 'Input',
|
||||
},
|
||||
];
|
@@ -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 {
|
||||
inspectionPlanExport,
|
||||
inspectionPlanList,
|
||||
inspectionPlanRemove,
|
||||
} from '#/api/property/inspectionManagement/inspectionPlan';
|
||||
import type { InspectionPlanForm } from '#/api/property/inspectionManagement/inspectionPlan/model';
|
||||
import { commonDownloadExcel } from '#/utils/file/download';
|
||||
|
||||
import inspectionPlanModal from './inspectionPlan-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 inspectionPlanList({
|
||||
pageNum: page.currentPage,
|
||||
pageSize: page.pageSize,
|
||||
...formValues,
|
||||
});
|
||||
},
|
||||
},
|
||||
},
|
||||
rowConfig: {
|
||||
keyField: 'id',
|
||||
},
|
||||
// 表格全局唯一表示 保存列配置需要用到
|
||||
id: 'property-inspectionPlan-index'
|
||||
};
|
||||
|
||||
const [BasicTable, tableApi] = useVbenVxeGrid({
|
||||
formOptions,
|
||||
gridOptions,
|
||||
});
|
||||
|
||||
const [InspectionPlanModal, modalApi] = useVbenModal({
|
||||
connectedComponent: inspectionPlanModal,
|
||||
});
|
||||
|
||||
function handleAdd() {
|
||||
modalApi.setData({});
|
||||
modalApi.open();
|
||||
}
|
||||
|
||||
async function handleEdit(row: Required<InspectionPlanForm>) {
|
||||
modalApi.setData({ id: row.id });
|
||||
modalApi.open();
|
||||
}
|
||||
|
||||
async function handleDelete(row: Required<InspectionPlanForm>) {
|
||||
await inspectionPlanRemove(row.id);
|
||||
await tableApi.query();
|
||||
}
|
||||
|
||||
function handleMultiDelete() {
|
||||
const rows = tableApi.grid.getCheckboxRecords();
|
||||
const ids = rows.map((row: Required<InspectionPlanForm>) => row.id);
|
||||
Modal.confirm({
|
||||
title: '提示',
|
||||
okType: 'danger',
|
||||
content: `确认删除选中的${ids.length}条记录吗?`,
|
||||
onOk: async () => {
|
||||
await inspectionPlanRemove(ids);
|
||||
await tableApi.query();
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
function handleDownloadExcel() {
|
||||
commonDownloadExcel(inspectionPlanExport, '巡检计划数据', 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:inspectionPlan:export']"
|
||||
@click="handleDownloadExcel"
|
||||
>
|
||||
{{ $t('pages.common.export') }}
|
||||
</a-button>
|
||||
<a-button
|
||||
:disabled="!vxeCheckboxChecked(tableApi)"
|
||||
danger
|
||||
type="primary"
|
||||
v-access:code="['property:inspectionPlan:remove']"
|
||||
@click="handleMultiDelete">
|
||||
{{ $t('pages.common.delete') }}
|
||||
</a-button>
|
||||
<a-button
|
||||
type="primary"
|
||||
v-access:code="['property:inspectionPlan:add']"
|
||||
@click="handleAdd"
|
||||
>
|
||||
{{ $t('pages.common.add') }}
|
||||
</a-button>
|
||||
</Space>
|
||||
</template>
|
||||
<template #action="{ row }">
|
||||
<Space>
|
||||
<ghost-button
|
||||
v-access:code="['property:inspectionPlan: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:inspectionPlan:remove']"
|
||||
@click.stop=""
|
||||
>
|
||||
{{ $t('pages.common.delete') }}
|
||||
</ghost-button>
|
||||
</Popconfirm>
|
||||
</Space>
|
||||
</template>
|
||||
</BasicTable>
|
||||
<InspectionPlanModal @reload="tableApi.query()" />
|
||||
</Page>
|
||||
</template>
|
@@ -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 { inspectionPlanAdd, inspectionPlanInfo, inspectionPlanUpdate } from '#/api/property/inspectionManagement/inspectionPlan';
|
||||
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 inspectionPlanInfo(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 ? inspectionPlanUpdate(data) : inspectionPlanAdd(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>
|
||||
|
@@ -0,0 +1,149 @@
|
||||
import type { FormSchemaGetter } from '#/adapter/form';
|
||||
import type { VxeGridProps } from '#/adapter/vxe-table';
|
||||
|
||||
|
||||
export const querySchema: FormSchemaGetter = () => [
|
||||
{
|
||||
component: 'Input',
|
||||
fieldName: 'itemId',
|
||||
label: '巡检项目id',
|
||||
},
|
||||
{
|
||||
component: 'Input',
|
||||
fieldName: 'pointName',
|
||||
label: '巡检点名称',
|
||||
},
|
||||
{
|
||||
component: 'Select',
|
||||
componentProps: {
|
||||
},
|
||||
fieldName: 'pointType',
|
||||
label: '巡检点类型',
|
||||
},
|
||||
{
|
||||
component: 'Input',
|
||||
fieldName: 'nfcCode',
|
||||
label: 'nfc编码',
|
||||
},
|
||||
{
|
||||
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: '巡检项目id',
|
||||
field: 'itemId',
|
||||
},
|
||||
{
|
||||
title: '巡检点名称',
|
||||
field: 'pointName',
|
||||
},
|
||||
{
|
||||
title: '巡检点类型',
|
||||
field: 'pointType',
|
||||
},
|
||||
{
|
||||
title: 'nfc编码',
|
||||
field: 'nfcCode',
|
||||
},
|
||||
{
|
||||
title: '备注',
|
||||
field: 'remark',
|
||||
},
|
||||
{
|
||||
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: '巡检项目id',
|
||||
fieldName: 'itemId',
|
||||
component: 'Input',
|
||||
rules: 'required',
|
||||
},
|
||||
{
|
||||
label: '巡检点名称',
|
||||
fieldName: 'pointName',
|
||||
component: 'Input',
|
||||
rules: 'required',
|
||||
},
|
||||
{
|
||||
label: '巡检点类型',
|
||||
fieldName: 'pointType',
|
||||
component: 'Select',
|
||||
componentProps: {
|
||||
},
|
||||
rules: 'selectRequired',
|
||||
},
|
||||
{
|
||||
label: 'nfc编码',
|
||||
fieldName: 'nfcCode',
|
||||
component: 'Input',
|
||||
},
|
||||
{
|
||||
label: '备注',
|
||||
fieldName: 'remark',
|
||||
component: 'Textarea',
|
||||
},
|
||||
{
|
||||
label: '创建人id',
|
||||
fieldName: 'createById',
|
||||
component: 'Input',
|
||||
},
|
||||
{
|
||||
label: '更新人id',
|
||||
fieldName: 'updateById',
|
||||
component: 'Input',
|
||||
},
|
||||
{
|
||||
label: '搜索值',
|
||||
fieldName: 'searchValue',
|
||||
component: 'Input',
|
||||
},
|
||||
];
|
@@ -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 {
|
||||
inspectionPointExport,
|
||||
inspectionPointList,
|
||||
inspectionPointRemove,
|
||||
} from '#/api/property/inspectionManagement/inspectionPoint';
|
||||
import type { InspectionPointForm } from '#/api/property/inspectionManagement/inspectionPoint/model';
|
||||
import { commonDownloadExcel } from '#/utils/file/download';
|
||||
|
||||
import inspectionPointModal from './inspectionPoint-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 inspectionPointList({
|
||||
pageNum: page.currentPage,
|
||||
pageSize: page.pageSize,
|
||||
...formValues,
|
||||
});
|
||||
},
|
||||
},
|
||||
},
|
||||
rowConfig: {
|
||||
keyField: 'id',
|
||||
},
|
||||
// 表格全局唯一表示 保存列配置需要用到
|
||||
id: 'property-inspectionPoint-index'
|
||||
};
|
||||
|
||||
const [BasicTable, tableApi] = useVbenVxeGrid({
|
||||
formOptions,
|
||||
gridOptions,
|
||||
});
|
||||
|
||||
const [InspectionPointModal, modalApi] = useVbenModal({
|
||||
connectedComponent: inspectionPointModal,
|
||||
});
|
||||
|
||||
function handleAdd() {
|
||||
modalApi.setData({});
|
||||
modalApi.open();
|
||||
}
|
||||
|
||||
async function handleEdit(row: Required<InspectionPointForm>) {
|
||||
modalApi.setData({ id: row.id });
|
||||
modalApi.open();
|
||||
}
|
||||
|
||||
async function handleDelete(row: Required<InspectionPointForm>) {
|
||||
await inspectionPointRemove(row.id);
|
||||
await tableApi.query();
|
||||
}
|
||||
|
||||
function handleMultiDelete() {
|
||||
const rows = tableApi.grid.getCheckboxRecords();
|
||||
const ids = rows.map((row: Required<InspectionPointForm>) => row.id);
|
||||
Modal.confirm({
|
||||
title: '提示',
|
||||
okType: 'danger',
|
||||
content: `确认删除选中的${ids.length}条记录吗?`,
|
||||
onOk: async () => {
|
||||
await inspectionPointRemove(ids);
|
||||
await tableApi.query();
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
function handleDownloadExcel() {
|
||||
commonDownloadExcel(inspectionPointExport, '巡检点数据', 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:inspectionPoint:export']"
|
||||
@click="handleDownloadExcel"
|
||||
>
|
||||
{{ $t('pages.common.export') }}
|
||||
</a-button>
|
||||
<a-button
|
||||
:disabled="!vxeCheckboxChecked(tableApi)"
|
||||
danger
|
||||
type="primary"
|
||||
v-access:code="['property:inspectionPoint:remove']"
|
||||
@click="handleMultiDelete">
|
||||
{{ $t('pages.common.delete') }}
|
||||
</a-button>
|
||||
<a-button
|
||||
type="primary"
|
||||
v-access:code="['property:inspectionPoint:add']"
|
||||
@click="handleAdd"
|
||||
>
|
||||
{{ $t('pages.common.add') }}
|
||||
</a-button>
|
||||
</Space>
|
||||
</template>
|
||||
<template #action="{ row }">
|
||||
<Space>
|
||||
<ghost-button
|
||||
v-access:code="['property:inspectionPoint: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:inspectionPoint:remove']"
|
||||
@click.stop=""
|
||||
>
|
||||
{{ $t('pages.common.delete') }}
|
||||
</ghost-button>
|
||||
</Popconfirm>
|
||||
</Space>
|
||||
</template>
|
||||
</BasicTable>
|
||||
<InspectionPointModal @reload="tableApi.query()" />
|
||||
</Page>
|
||||
</template>
|
@@ -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 { inspectionPointAdd, inspectionPointInfo, inspectionPointUpdate } from '#/api/property/inspectionManagement/inspectionPoint';
|
||||
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 inspectionPointInfo(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 ? inspectionPointUpdate(data) : inspectionPointAdd(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>
|
||||
|
@@ -0,0 +1,59 @@
|
||||
import type { FormSchemaGetter } from '#/adapter/form';
|
||||
import type { VxeGridProps } from '#/adapter/vxe-table';
|
||||
|
||||
|
||||
export const querySchema: FormSchemaGetter = () => [
|
||||
{
|
||||
component: 'Input',
|
||||
fieldName: 'routeName',
|
||||
label: '路线名称',
|
||||
},
|
||||
];
|
||||
|
||||
// 需要使用i18n注意这里要改成getter形式 否则切换语言不会刷新
|
||||
// export const columns: () => VxeGridProps['columns'] = () => [
|
||||
export const columns: VxeGridProps['columns'] = [
|
||||
{ type: 'checkbox', width: 60 },
|
||||
{
|
||||
title: '主键id',
|
||||
field: 'id',
|
||||
},
|
||||
{
|
||||
title: '路线名称',
|
||||
field: 'routeName',
|
||||
},
|
||||
{
|
||||
title: '备注',
|
||||
field: 'remark',
|
||||
},
|
||||
{
|
||||
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: 'routeName',
|
||||
component: 'Input',
|
||||
rules: 'required',
|
||||
},
|
||||
{
|
||||
label: '备注',
|
||||
fieldName: 'remark',
|
||||
component: 'Input',
|
||||
},
|
||||
];
|
@@ -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 {
|
||||
inspectionRouteExport,
|
||||
inspectionRouteList,
|
||||
inspectionRouteRemove,
|
||||
} from '#/api/property/inspectionManagement/inspectionRoute';
|
||||
import type { InspectionRouteForm } from '#/api/property/inspectionManagement/inspectionRoute/model';
|
||||
import { commonDownloadExcel } from '#/utils/file/download';
|
||||
|
||||
import inspectionRouteModal from './inspectionRoute-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 inspectionRouteList({
|
||||
pageNum: page.currentPage,
|
||||
pageSize: page.pageSize,
|
||||
...formValues,
|
||||
});
|
||||
},
|
||||
},
|
||||
},
|
||||
rowConfig: {
|
||||
keyField: 'id',
|
||||
},
|
||||
// 表格全局唯一表示 保存列配置需要用到
|
||||
id: 'property-inspectionRoute-index'
|
||||
};
|
||||
|
||||
const [BasicTable, tableApi] = useVbenVxeGrid({
|
||||
formOptions,
|
||||
gridOptions,
|
||||
});
|
||||
|
||||
const [InspectionRouteModal, modalApi] = useVbenModal({
|
||||
connectedComponent: inspectionRouteModal,
|
||||
});
|
||||
|
||||
function handleAdd() {
|
||||
modalApi.setData({});
|
||||
modalApi.open();
|
||||
}
|
||||
|
||||
async function handleEdit(row: Required<InspectionRouteForm>) {
|
||||
modalApi.setData({ id: row.id });
|
||||
modalApi.open();
|
||||
}
|
||||
|
||||
async function handleDelete(row: Required<InspectionRouteForm>) {
|
||||
await inspectionRouteRemove(row.id);
|
||||
await tableApi.query();
|
||||
}
|
||||
|
||||
function handleMultiDelete() {
|
||||
const rows = tableApi.grid.getCheckboxRecords();
|
||||
const ids = rows.map((row: Required<InspectionRouteForm>) => row.id);
|
||||
Modal.confirm({
|
||||
title: '提示',
|
||||
okType: 'danger',
|
||||
content: `确认删除选中的${ids.length}条记录吗?`,
|
||||
onOk: async () => {
|
||||
await inspectionRouteRemove(ids);
|
||||
await tableApi.query();
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
function handleDownloadExcel() {
|
||||
commonDownloadExcel(inspectionRouteExport, '巡检路线数据', 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:inspectionRoute:export']"
|
||||
@click="handleDownloadExcel"
|
||||
>
|
||||
{{ $t('pages.common.export') }}
|
||||
</a-button>
|
||||
<a-button
|
||||
:disabled="!vxeCheckboxChecked(tableApi)"
|
||||
danger
|
||||
type="primary"
|
||||
v-access:code="['property:inspectionRoute:remove']"
|
||||
@click="handleMultiDelete">
|
||||
{{ $t('pages.common.delete') }}
|
||||
</a-button>
|
||||
<a-button
|
||||
type="primary"
|
||||
v-access:code="['property:inspectionRoute:add']"
|
||||
@click="handleAdd"
|
||||
>
|
||||
{{ $t('pages.common.add') }}
|
||||
</a-button>
|
||||
</Space>
|
||||
</template>
|
||||
<template #action="{ row }">
|
||||
<Space>
|
||||
<ghost-button
|
||||
v-access:code="['property:inspectionRoute: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:inspectionRoute:remove']"
|
||||
@click.stop=""
|
||||
>
|
||||
{{ $t('pages.common.delete') }}
|
||||
</ghost-button>
|
||||
</Popconfirm>
|
||||
</Space>
|
||||
</template>
|
||||
</BasicTable>
|
||||
<InspectionRouteModal @reload="tableApi.query()" />
|
||||
</Page>
|
||||
</template>
|
@@ -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 { inspectionRouteAdd, inspectionRouteInfo, inspectionRouteUpdate } from '#/api/property/inspectionManagement/inspectionRoute';
|
||||
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 inspectionRouteInfo(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 ? inspectionRouteUpdate(data) : inspectionRouteAdd(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>
|
||||
|
@@ -0,0 +1,192 @@
|
||||
import type { FormSchemaGetter } from '#/adapter/form';
|
||||
import type { VxeGridProps } from '#/adapter/vxe-table';
|
||||
|
||||
|
||||
export const querySchema: FormSchemaGetter = () => [
|
||||
{
|
||||
component: 'Input',
|
||||
fieldName: 'inspectionPlanId',
|
||||
label: '巡检计划id',
|
||||
},
|
||||
{
|
||||
component: 'DatePicker',
|
||||
componentProps: {
|
||||
showTime: true,
|
||||
format: 'YYYY-MM-DD HH:mm:ss',
|
||||
valueFormat: 'YYYY-MM-DD HH:mm:ss',
|
||||
},
|
||||
fieldName: 'actInsTime',
|
||||
label: '实际巡检时间',
|
||||
},
|
||||
{
|
||||
component: 'Input',
|
||||
fieldName: 'actUserId',
|
||||
label: '当前巡检人',
|
||||
},
|
||||
{
|
||||
component: 'Select',
|
||||
componentProps: {
|
||||
},
|
||||
fieldName: 'taskType',
|
||||
label: '巡检方式',
|
||||
},
|
||||
{
|
||||
component: 'Textarea',
|
||||
fieldName: 'transferDesc',
|
||||
label: '转移描述',
|
||||
},
|
||||
{
|
||||
component: 'RadioGroup',
|
||||
componentProps: {
|
||||
buttonStyle: 'solid',
|
||||
optionType: 'button',
|
||||
},
|
||||
fieldName: 'status',
|
||||
label: '巡检状态',
|
||||
},
|
||||
{
|
||||
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: '巡检计划id',
|
||||
field: 'inspectionPlanId',
|
||||
},
|
||||
{
|
||||
title: '实际巡检时间',
|
||||
field: 'actInsTime',
|
||||
},
|
||||
{
|
||||
title: '当前巡检人',
|
||||
field: 'actUserId',
|
||||
},
|
||||
{
|
||||
title: '巡检方式',
|
||||
field: 'taskType',
|
||||
},
|
||||
{
|
||||
title: '转移描述',
|
||||
field: 'transferDesc',
|
||||
},
|
||||
{
|
||||
title: '巡检状态',
|
||||
field: 'status',
|
||||
},
|
||||
{
|
||||
title: '备注',
|
||||
field: 'remark',
|
||||
},
|
||||
{
|
||||
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: '巡检计划id',
|
||||
fieldName: 'inspectionPlanId',
|
||||
component: 'Input',
|
||||
},
|
||||
{
|
||||
label: '实际巡检时间',
|
||||
fieldName: 'actInsTime',
|
||||
component: 'DatePicker',
|
||||
componentProps: {
|
||||
showTime: true,
|
||||
format: 'YYYY-MM-DD HH:mm:ss',
|
||||
valueFormat: 'YYYY-MM-DD HH:mm:ss',
|
||||
},
|
||||
},
|
||||
{
|
||||
label: '当前巡检人',
|
||||
fieldName: 'actUserId',
|
||||
component: 'Input',
|
||||
},
|
||||
{
|
||||
label: '巡检方式',
|
||||
fieldName: 'taskType',
|
||||
component: 'Select',
|
||||
componentProps: {
|
||||
},
|
||||
},
|
||||
{
|
||||
label: '转移描述',
|
||||
fieldName: 'transferDesc',
|
||||
component: 'Textarea',
|
||||
},
|
||||
{
|
||||
label: '巡检状态',
|
||||
fieldName: 'status',
|
||||
component: 'RadioGroup',
|
||||
componentProps: {
|
||||
buttonStyle: 'solid',
|
||||
optionType: 'button',
|
||||
},
|
||||
},
|
||||
{
|
||||
label: '备注',
|
||||
fieldName: 'remark',
|
||||
component: 'Input',
|
||||
},
|
||||
{
|
||||
label: '创建人id',
|
||||
fieldName: 'createById',
|
||||
component: 'Input',
|
||||
},
|
||||
{
|
||||
label: '更新人id',
|
||||
fieldName: 'updateById',
|
||||
component: 'Input',
|
||||
},
|
||||
{
|
||||
label: '搜索值',
|
||||
fieldName: 'searchValue',
|
||||
component: 'Input',
|
||||
},
|
||||
];
|
@@ -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 {
|
||||
inspectionTaskExport,
|
||||
inspectionTaskList,
|
||||
inspectionTaskRemove,
|
||||
} from '#/api/property/inspectionManagement/inspectionTask';
|
||||
import type { InspectionTaskForm } from '#/api/property/inspectionManagement/inspectionTask/model';
|
||||
import { commonDownloadExcel } from '#/utils/file/download';
|
||||
|
||||
import inspectionTaskModal from './inspectionTask-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 inspectionTaskList({
|
||||
pageNum: page.currentPage,
|
||||
pageSize: page.pageSize,
|
||||
...formValues,
|
||||
});
|
||||
},
|
||||
},
|
||||
},
|
||||
rowConfig: {
|
||||
keyField: 'id',
|
||||
},
|
||||
// 表格全局唯一表示 保存列配置需要用到
|
||||
id: 'property-inspectionTask-index'
|
||||
};
|
||||
|
||||
const [BasicTable, tableApi] = useVbenVxeGrid({
|
||||
formOptions,
|
||||
gridOptions,
|
||||
});
|
||||
|
||||
const [InspectionTaskModal, modalApi] = useVbenModal({
|
||||
connectedComponent: inspectionTaskModal,
|
||||
});
|
||||
|
||||
function handleAdd() {
|
||||
modalApi.setData({});
|
||||
modalApi.open();
|
||||
}
|
||||
|
||||
async function handleEdit(row: Required<InspectionTaskForm>) {
|
||||
modalApi.setData({ id: row.id });
|
||||
modalApi.open();
|
||||
}
|
||||
|
||||
async function handleDelete(row: Required<InspectionTaskForm>) {
|
||||
await inspectionTaskRemove(row.id);
|
||||
await tableApi.query();
|
||||
}
|
||||
|
||||
function handleMultiDelete() {
|
||||
const rows = tableApi.grid.getCheckboxRecords();
|
||||
const ids = rows.map((row: Required<InspectionTaskForm>) => row.id);
|
||||
Modal.confirm({
|
||||
title: '提示',
|
||||
okType: 'danger',
|
||||
content: `确认删除选中的${ids.length}条记录吗?`,
|
||||
onOk: async () => {
|
||||
await inspectionTaskRemove(ids);
|
||||
await tableApi.query();
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
function handleDownloadExcel() {
|
||||
commonDownloadExcel(inspectionTaskExport, '巡检任务数据', 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:inspectionTask:export']"
|
||||
@click="handleDownloadExcel"
|
||||
>
|
||||
{{ $t('pages.common.export') }}
|
||||
</a-button>
|
||||
<a-button
|
||||
:disabled="!vxeCheckboxChecked(tableApi)"
|
||||
danger
|
||||
type="primary"
|
||||
v-access:code="['property:inspectionTask:remove']"
|
||||
@click="handleMultiDelete">
|
||||
{{ $t('pages.common.delete') }}
|
||||
</a-button>
|
||||
<a-button
|
||||
type="primary"
|
||||
v-access:code="['property:inspectionTask:add']"
|
||||
@click="handleAdd"
|
||||
>
|
||||
{{ $t('pages.common.add') }}
|
||||
</a-button>
|
||||
</Space>
|
||||
</template>
|
||||
<template #action="{ row }">
|
||||
<Space>
|
||||
<ghost-button
|
||||
v-access:code="['property:inspectionTask: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:inspectionTask:remove']"
|
||||
@click.stop=""
|
||||
>
|
||||
{{ $t('pages.common.delete') }}
|
||||
</ghost-button>
|
||||
</Popconfirm>
|
||||
</Space>
|
||||
</template>
|
||||
</BasicTable>
|
||||
<InspectionTaskModal @reload="tableApi.query()" />
|
||||
</Page>
|
||||
</template>
|
@@ -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 { inspectionTaskAdd, inspectionTaskInfo, inspectionTaskUpdate } from '#/api/property/inspectionManagement/inspectionTask';
|
||||
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 inspectionTaskInfo(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 ? inspectionTaskUpdate(data) : inspectionTaskAdd(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>
|
||||
|
@@ -118,6 +118,7 @@ async function queryAddServices() {
|
||||
unit: item.unit,
|
||||
quantity: 0
|
||||
}))
|
||||
console.log(res,addServiceList.value);
|
||||
}
|
||||
|
||||
async function queryPersonData() {
|
||||
|
@@ -4,8 +4,6 @@
|
||||
<a-form
|
||||
:model="formState"
|
||||
layout="inline"
|
||||
@finish="onFinish"
|
||||
@finishFailed="onFinishFailed"
|
||||
class="form-box"
|
||||
>
|
||||
<a-form-item label="会议日期">
|
||||
@@ -80,6 +78,7 @@ const formState = reactive<FormState>({
|
||||
});
|
||||
const simpleImage = Empty.PRESENTED_IMAGE_SIMPLE;
|
||||
|
||||
const meetingList = ref<MeetVO[]>([])
|
||||
async function handleSearch() {
|
||||
let hours = '';
|
||||
if (formState.openHours && formState.openHours.length) {
|
||||
@@ -107,15 +106,6 @@ function handleAdd(id:string) {
|
||||
modalApi.setData({id});
|
||||
modalApi.open();
|
||||
}
|
||||
|
||||
const onFinish = (values: any) => {
|
||||
console.log('Success:', values);
|
||||
};
|
||||
const onFinishFailed = (errorInfo: any) => {
|
||||
console.log('Failed:', errorInfo);
|
||||
};
|
||||
|
||||
const meetingList = ref<MeetVO[]>([])
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
|
231
apps/web-antd/src/views/sis/elevatorInfo/data.ts
Normal file
231
apps/web-antd/src/views/sis/elevatorInfo/data.ts
Normal file
@@ -0,0 +1,231 @@
|
||||
import type { FormSchemaGetter } from '#/adapter/form';
|
||||
import type { VxeGridProps } from '#/adapter/vxe-table';
|
||||
|
||||
export const querySchema: FormSchemaGetter = () => [
|
||||
{
|
||||
component: 'Input',
|
||||
fieldName: 'elevatorCode',
|
||||
label: '电梯编号',
|
||||
},
|
||||
{
|
||||
component: 'Input',
|
||||
fieldName: 'elevatorName',
|
||||
label: '电梯名称',
|
||||
},
|
||||
];
|
||||
|
||||
// 需要使用i18n注意这里要改成getter形式 否则切换语言不会刷新
|
||||
// export const columns: () => VxeGridProps['columns'] = () => [
|
||||
export const columns: VxeGridProps['columns'] = [
|
||||
{ type: 'checkbox', width: 60 },
|
||||
{
|
||||
title: '电梯编号',
|
||||
field: 'elevatorCode',
|
||||
},
|
||||
{
|
||||
title: '电梯名称',
|
||||
field: 'elevatorName',
|
||||
},
|
||||
{
|
||||
title: '安装位置',
|
||||
field: 'location',
|
||||
},
|
||||
{
|
||||
title: '品牌',
|
||||
field: 'brand',
|
||||
},
|
||||
{
|
||||
title: '型号',
|
||||
field: 'model',
|
||||
},
|
||||
{
|
||||
title: '生产日期',
|
||||
field: 'manufactureDate',
|
||||
},
|
||||
{
|
||||
title: '安装日期',
|
||||
field: 'installationDate',
|
||||
},
|
||||
{
|
||||
title: '最大载重(kg)',
|
||||
field: 'maxLoad',
|
||||
},
|
||||
{
|
||||
title: '服务楼层数',
|
||||
field: 'floorsServed',
|
||||
},
|
||||
{
|
||||
title: '维保公司',
|
||||
field: 'maintenanceCompany',
|
||||
},
|
||||
/*{
|
||||
title: '维保电话',
|
||||
field: 'maintenancePhone',
|
||||
},
|
||||
{
|
||||
title: '上次年检日期',
|
||||
field: 'lastInspectionDate',
|
||||
},
|
||||
{
|
||||
title: '下次年检日期',
|
||||
field: 'nextInspectionDate',
|
||||
},*/
|
||||
{
|
||||
title: '梯控厂商',
|
||||
field: 'controlFactory',
|
||||
},
|
||||
{
|
||||
title: '梯控ip',
|
||||
field: 'controlIp',
|
||||
},
|
||||
{
|
||||
title: '梯控端口',
|
||||
field: 'controlPort',
|
||||
},
|
||||
{
|
||||
title: '梯控账号',
|
||||
field: 'controlAccount',
|
||||
},
|
||||
{
|
||||
title: '梯控密码',
|
||||
field: 'controlPwd',
|
||||
},
|
||||
{
|
||||
field: 'action',
|
||||
fixed: 'right',
|
||||
slots: { default: 'action' },
|
||||
title: '操作',
|
||||
width: 180,
|
||||
},
|
||||
];
|
||||
|
||||
export const modalSchema: FormSchemaGetter = () => [
|
||||
{
|
||||
label: '',
|
||||
fieldName: 'elevatorId',
|
||||
component: 'Input',
|
||||
dependencies: {
|
||||
show: () => false,
|
||||
triggerFields: [''],
|
||||
},
|
||||
},
|
||||
{
|
||||
label: '电梯名称',
|
||||
fieldName: 'elevatorName',
|
||||
component: 'Input',
|
||||
rules: 'required',
|
||||
},
|
||||
{
|
||||
component: 'TreeSelect',
|
||||
fieldName: 'unitId',
|
||||
defaultValue: undefined,
|
||||
label: '社区建筑',
|
||||
rules: 'selectRequired',
|
||||
},
|
||||
{
|
||||
label: '安装位置',
|
||||
fieldName: 'location',
|
||||
component: 'Input',
|
||||
rules: 'required',
|
||||
},
|
||||
{
|
||||
label: '品牌',
|
||||
fieldName: 'brand',
|
||||
component: 'Input',
|
||||
},
|
||||
{
|
||||
label: '型号',
|
||||
fieldName: 'model',
|
||||
component: 'Input',
|
||||
},
|
||||
{
|
||||
label: '生产日期',
|
||||
fieldName: 'manufactureDate',
|
||||
component: 'DatePicker',
|
||||
componentProps: {
|
||||
showTime: true,
|
||||
format: 'YYYY-MM-DD HH:mm:ss',
|
||||
valueFormat: 'YYYY-MM-DD HH:mm:ss',
|
||||
},
|
||||
},
|
||||
{
|
||||
label: '安装日期',
|
||||
fieldName: 'installationDate',
|
||||
component: 'DatePicker',
|
||||
componentProps: {
|
||||
showTime: true,
|
||||
format: 'YYYY-MM-DD HH:mm:ss',
|
||||
valueFormat: 'YYYY-MM-DD HH:mm:ss',
|
||||
},
|
||||
},
|
||||
{
|
||||
label: '最大载重(kg)',
|
||||
fieldName: 'maxLoad',
|
||||
component: 'Input',
|
||||
},
|
||||
{
|
||||
label: '服务楼层数',
|
||||
fieldName: 'floorsServed',
|
||||
component: 'Input',
|
||||
},
|
||||
{
|
||||
label: '维保公司',
|
||||
fieldName: 'maintenanceCompany',
|
||||
component: 'Input',
|
||||
},
|
||||
/* {
|
||||
label: '维保电话',
|
||||
fieldName: 'maintenancePhone',
|
||||
component: 'Input',
|
||||
},
|
||||
{
|
||||
label: '上次年检日期',
|
||||
fieldName: 'lastInspectionDate',
|
||||
component: 'DatePicker',
|
||||
componentProps: {
|
||||
showTime: true,
|
||||
format: 'YYYY-MM-DD HH:mm:ss',
|
||||
valueFormat: 'YYYY-MM-DD HH:mm:ss',
|
||||
},
|
||||
},
|
||||
{
|
||||
label: '下次年检日期',
|
||||
fieldName: 'nextInspectionDate',
|
||||
component: 'DatePicker',
|
||||
componentProps: {
|
||||
showTime: true,
|
||||
format: 'YYYY-MM-DD HH:mm:ss',
|
||||
valueFormat: 'YYYY-MM-DD HH:mm:ss',
|
||||
},
|
||||
},*/
|
||||
{
|
||||
label: '梯控厂商',
|
||||
fieldName: 'controlFactory',
|
||||
component: 'Input',
|
||||
rules: 'required',
|
||||
},
|
||||
{
|
||||
label: '梯控ip',
|
||||
fieldName: 'controlIp',
|
||||
component: 'Input',
|
||||
rules: 'required',
|
||||
},
|
||||
{
|
||||
label: '梯控端口',
|
||||
fieldName: 'controlPort',
|
||||
component: 'Input',
|
||||
rules: 'required',
|
||||
},
|
||||
{
|
||||
label: '梯控账号',
|
||||
fieldName: 'controlAccount',
|
||||
component: 'Input',
|
||||
rules: 'required',
|
||||
},
|
||||
{
|
||||
label: '梯控密码',
|
||||
fieldName: 'controlPwd',
|
||||
component: 'Input',
|
||||
rules: 'required',
|
||||
},
|
||||
];
|
142
apps/web-antd/src/views/sis/elevatorInfo/elevatorInfo-modal.vue
Normal file
142
apps/web-antd/src/views/sis/elevatorInfo/elevatorInfo-modal.vue
Normal file
@@ -0,0 +1,142 @@
|
||||
<script setup lang="ts">
|
||||
import { computed, ref } from 'vue';
|
||||
|
||||
import { useVbenModal } from '@vben/common-ui';
|
||||
import { $t } from '@vben/locales';
|
||||
import { cloneDeep, getPopupContainer, handleNode } from '@vben/utils';
|
||||
|
||||
import { useVbenForm } from '#/adapter/form';
|
||||
import { elevatorInfoAdd, elevatorInfoInfo, elevatorInfoUpdate } from '#/api/sis/elevatorInfo';
|
||||
import { defaultFormValueGetter, useBeforeCloseDiff } from '#/utils/popup';
|
||||
|
||||
import { modalSchema } from './data';
|
||||
import { communityTree } from '#/api/property/community';
|
||||
|
||||
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: 100,
|
||||
// 通用配置项 会影响到所有表单项
|
||||
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);
|
||||
setupCommunitySelect()
|
||||
const { id } = modalApi.getData() as { id?: number | string };
|
||||
isUpdate.value = !!id;
|
||||
|
||||
if (isUpdate.value && id) {
|
||||
const record = await elevatorInfoInfo(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 ? elevatorInfoUpdate(data) : elevatorInfoAdd(data));
|
||||
resetInitialized();
|
||||
emit('reload');
|
||||
modalApi.close();
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
} finally {
|
||||
modalApi.lock(false);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 初始化城市
|
||||
*/
|
||||
async function setupCommunitySelect() {
|
||||
const areaList = await communityTree(3);
|
||||
// 选中后显示在输入框的值 即父节点 / 子节点
|
||||
// addFullName(areaList, 'areaName', ' / ');
|
||||
const splitStr = '/';
|
||||
handleNode(areaList, 'label', splitStr, function (node: any) {
|
||||
if (node.level != 3) {
|
||||
node.disabled = true;
|
||||
}
|
||||
});
|
||||
formApi.updateSchema([
|
||||
{
|
||||
componentProps: () => ({
|
||||
class: 'w-full',
|
||||
fieldNames: {
|
||||
key: 'id',
|
||||
label: 'label',
|
||||
value: 'code',
|
||||
children: 'children',
|
||||
},
|
||||
getPopupContainer,
|
||||
placeholder: '请选择建筑',
|
||||
showSearch: true,
|
||||
treeData: areaList,
|
||||
treeDefaultExpandAll: true,
|
||||
treeLine: { showLeafIcon: false },
|
||||
// 筛选的字段
|
||||
treeNodeFilterProp: 'label',
|
||||
// 选中后显示在输入框的值
|
||||
treeNodeLabelProp: 'fullName',
|
||||
}),
|
||||
fieldName: 'unitId',
|
||||
},
|
||||
]);
|
||||
}
|
||||
|
||||
|
||||
async function handleClosed() {
|
||||
await formApi.resetForm();
|
||||
resetInitialized();
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<BasicModal :title="title">
|
||||
<BasicForm />
|
||||
</BasicModal>
|
||||
</template>
|
||||
|
182
apps/web-antd/src/views/sis/elevatorInfo/index.vue
Normal file
182
apps/web-antd/src/views/sis/elevatorInfo/index.vue
Normal 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 {
|
||||
elevatorInfoExport,
|
||||
elevatorInfoList,
|
||||
elevatorInfoRemove,
|
||||
} from '#/api/sis/elevatorInfo';
|
||||
import type { ElevatorInfoForm } from '#/api/sis/elevatorInfo/model';
|
||||
import { commonDownloadExcel } from '#/utils/file/download';
|
||||
|
||||
import elevatorInfoModal from './elevatorInfo-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 elevatorInfoList({
|
||||
pageNum: page.currentPage,
|
||||
pageSize: page.pageSize,
|
||||
...formValues,
|
||||
});
|
||||
},
|
||||
},
|
||||
},
|
||||
rowConfig: {
|
||||
keyField: 'elevatorId',
|
||||
},
|
||||
// 表格全局唯一表示 保存列配置需要用到
|
||||
id: 'sis-elevatorInfo-index'
|
||||
};
|
||||
|
||||
const [BasicTable, tableApi] = useVbenVxeGrid({
|
||||
formOptions,
|
||||
gridOptions,
|
||||
});
|
||||
|
||||
const [ElevatorInfoModal, modalApi] = useVbenModal({
|
||||
connectedComponent: elevatorInfoModal,
|
||||
});
|
||||
|
||||
function handleAdd() {
|
||||
modalApi.setData({});
|
||||
modalApi.open();
|
||||
}
|
||||
|
||||
async function handleEdit(row: Required<ElevatorInfoForm>) {
|
||||
modalApi.setData({ id: row.elevatorId });
|
||||
modalApi.open();
|
||||
}
|
||||
|
||||
async function handleDelete(row: Required<ElevatorInfoForm>) {
|
||||
await elevatorInfoRemove(row.elevatorId);
|
||||
await tableApi.query();
|
||||
}
|
||||
|
||||
function handleMultiDelete() {
|
||||
const rows = tableApi.grid.getCheckboxRecords();
|
||||
const ids = rows.map((row: Required<ElevatorInfoForm>) => row.elevatorId);
|
||||
Modal.confirm({
|
||||
title: '提示',
|
||||
okType: 'danger',
|
||||
content: `确认删除选中的${ids.length}条记录吗?`,
|
||||
onOk: async () => {
|
||||
await elevatorInfoRemove(ids);
|
||||
await tableApi.query();
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
function handleDownloadExcel() {
|
||||
commonDownloadExcel(elevatorInfoExport, '电梯基本信息数据', 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:elevatorInfo:export']"
|
||||
@click="handleDownloadExcel"
|
||||
>
|
||||
{{ $t('pages.common.export') }}
|
||||
</a-button>
|
||||
<a-button
|
||||
:disabled="!vxeCheckboxChecked(tableApi)"
|
||||
danger
|
||||
type="primary"
|
||||
v-access:code="['sis:elevatorInfo:remove']"
|
||||
@click="handleMultiDelete">
|
||||
{{ $t('pages.common.delete') }}
|
||||
</a-button>
|
||||
<a-button
|
||||
type="primary"
|
||||
v-access:code="['sis:elevatorInfo:add']"
|
||||
@click="handleAdd"
|
||||
>
|
||||
{{ $t('pages.common.add') }}
|
||||
</a-button>
|
||||
</Space>
|
||||
</template>
|
||||
<template #action="{ row }">
|
||||
<Space>
|
||||
<ghost-button
|
||||
v-access:code="['sis:elevatorInfo: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:elevatorInfo:remove']"
|
||||
@click.stop=""
|
||||
>
|
||||
{{ $t('pages.common.delete') }}
|
||||
</ghost-button>
|
||||
</Popconfirm>
|
||||
</Space>
|
||||
</template>
|
||||
</BasicTable>
|
||||
<ElevatorInfoModal @reload="tableApi.query()" />
|
||||
</Page>
|
||||
</template>
|
@@ -1,5 +1,4 @@
|
||||
import { defineConfig } from '@vben/vite-config';
|
||||
import path from 'path';
|
||||
|
||||
// 自行取消注释来启用按需导入功能
|
||||
// import { AntDesignVueResolver } from 'unplugin-vue-components/resolvers';
|
||||
|
Reference in New Issue
Block a user