完成合同管理模块和公共参数模块
This commit is contained in:
@@ -34,7 +34,7 @@ export interface Category {
|
||||
key?: number;
|
||||
//
|
||||
merchantCode?: string;
|
||||
value?: number;
|
||||
value?: any;
|
||||
// 子菜单
|
||||
children?: Category[];
|
||||
}
|
||||
@@ -44,7 +44,8 @@ export interface Category {
|
||||
*/
|
||||
export interface CategoryParam extends PageParam {
|
||||
title?: string;
|
||||
categoryId?: string;
|
||||
categoryId?: number;
|
||||
parentId?: number;
|
||||
// 商户编号
|
||||
merchantCode?: string;
|
||||
}
|
||||
|
||||
@@ -39,6 +39,7 @@ export interface TowerModel {
|
||||
//
|
||||
merchantCode?: string;
|
||||
value?: number;
|
||||
index?: number;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
106
src/api/tower/param/place/index.ts
Normal file
106
src/api/tower/param/place/index.ts
Normal file
@@ -0,0 +1,106 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { TowerPlace, TowerPlaceParam } from './model';
|
||||
|
||||
/**
|
||||
* 分页查询检查/保养部位
|
||||
*/
|
||||
export async function pageTowerPlace(params: TowerPlaceParam) {
|
||||
const res = await request.get<ApiResult<PageResult<TowerPlace>>>(
|
||||
'/tower/tower-place/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询检查/保养部位列表
|
||||
*/
|
||||
export async function listTowerPlace(params?: TowerPlaceParam) {
|
||||
const res = await request.get<ApiResult<TowerPlace[]>>('/tower/tower-place', {
|
||||
params
|
||||
});
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加检查/保养部位
|
||||
*/
|
||||
export async function addTowerPlace(data: TowerPlace) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
'/tower/tower-place',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改检查/保养部位
|
||||
*/
|
||||
export async function updateTowerPlace(data: TowerPlace) {
|
||||
const res = await request.put<ApiResult<unknown>>('/tower/tower-place', data);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除检查/保养部位
|
||||
*/
|
||||
export async function removeTowerPlace(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
'/tower/tower-place/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除检查/保养部位
|
||||
*/
|
||||
export async function removeBatchTowerPlace(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
'/tower/tower-place/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 检查IP是否存在
|
||||
*/
|
||||
export async function checkExistence(
|
||||
field: string,
|
||||
value: string,
|
||||
id?: number
|
||||
) {
|
||||
const res = await request.get<ApiResult<unknown>>(
|
||||
'/tower/tower-place/existence',
|
||||
{
|
||||
params: { field, value, id }
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
53
src/api/tower/param/place/model/index.ts
Normal file
53
src/api/tower/param/place/model/index.ts
Normal file
@@ -0,0 +1,53 @@
|
||||
import type { PageParam } from '@/api';
|
||||
import { TowerPlaceStandard } from '@/api/tower/param/standard/model';
|
||||
|
||||
/**
|
||||
* 检查/保养部位
|
||||
*/
|
||||
export interface TowerPlace {
|
||||
// 参数ID
|
||||
placeId?: number;
|
||||
// 部位编码
|
||||
placeCode?: string;
|
||||
// 设备类型
|
||||
equipmentType?: string;
|
||||
// 部位名称
|
||||
name?: string;
|
||||
// 检查标准
|
||||
standard?: TowerPlaceStandard[];
|
||||
// 部位类型
|
||||
type?: string;
|
||||
// 推送目标系统
|
||||
pushSystem?: string;
|
||||
// 其它项目对应值
|
||||
other_param?: string;
|
||||
// 附件
|
||||
files?: string;
|
||||
// 是否默认显示
|
||||
isShow?: boolean;
|
||||
// 用户ID
|
||||
userId?: string;
|
||||
// 排序
|
||||
sortNumber?: number;
|
||||
// 备注
|
||||
comments?: string;
|
||||
// 状态
|
||||
status?: number;
|
||||
// 创建时间
|
||||
createTime?: string;
|
||||
// 更新时间
|
||||
updateTime?: string;
|
||||
//
|
||||
key?: number;
|
||||
value?: number;
|
||||
index?: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* 搜索条件
|
||||
*/
|
||||
export interface TowerPlaceParam extends PageParam {
|
||||
name?: string;
|
||||
placeCode?: string;
|
||||
equipmentType?: string;
|
||||
}
|
||||
112
src/api/tower/param/safety/index.ts
Normal file
112
src/api/tower/param/safety/index.ts
Normal file
@@ -0,0 +1,112 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { TowerSafety, TowerSafetyParam } from './model';
|
||||
|
||||
/**
|
||||
* 分页查询安全巡检部位
|
||||
*/
|
||||
export async function pageTowerSafety(params: TowerSafetyParam) {
|
||||
const res = await request.get<ApiResult<PageResult<TowerSafety>>>(
|
||||
'/tower/tower-safety/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询安全巡检部位列表
|
||||
*/
|
||||
export async function listTowerSafety(params?: TowerSafetyParam) {
|
||||
const res = await request.get<ApiResult<TowerSafety[]>>(
|
||||
'/tower/tower-safety',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加安全巡检部位
|
||||
*/
|
||||
export async function addTowerSafety(data: TowerSafety) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
'/tower/tower-safety',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改安全巡检部位
|
||||
*/
|
||||
export async function updateTowerSafety(data: TowerSafety) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
'/tower/tower-safety',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除安全巡检部位
|
||||
*/
|
||||
export async function removeTowerSafety(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
'/tower/tower-safety/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除安全巡检部位
|
||||
*/
|
||||
export async function removeBatchTowerSafety(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
'/tower/tower-safety/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 检查IP是否存在
|
||||
*/
|
||||
export async function checkExistence(
|
||||
field: string,
|
||||
value: string,
|
||||
id?: number
|
||||
) {
|
||||
const res = await request.get<ApiResult<unknown>>(
|
||||
'/tower/tower-safety/existence',
|
||||
{
|
||||
params: { field, value, id }
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
52
src/api/tower/param/safety/model/index.ts
Normal file
52
src/api/tower/param/safety/model/index.ts
Normal file
@@ -0,0 +1,52 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 安全巡检部位
|
||||
*/
|
||||
export interface TowerSafety {
|
||||
// 参数ID
|
||||
placeSafetyId?: number;
|
||||
// 部位编码
|
||||
placeCode?: string;
|
||||
// 设备类型
|
||||
equipmentType?: string;
|
||||
// 部位名称
|
||||
name?: string;
|
||||
// 检查标准
|
||||
checkStandard?: string;
|
||||
// 部位类型
|
||||
type?: string;
|
||||
// 推送目标系统
|
||||
pushSystem?: string;
|
||||
// 其它项目对应值
|
||||
other_param?: string;
|
||||
// 附件
|
||||
files?: string;
|
||||
// 是否默认显示
|
||||
isShow?: boolean;
|
||||
// 用户ID
|
||||
userId?: string;
|
||||
// 排序
|
||||
sortNumber?: number;
|
||||
// 备注
|
||||
comments?: string;
|
||||
// 状态
|
||||
status?: number;
|
||||
// 创建时间
|
||||
createTime?: string;
|
||||
// 更新时间
|
||||
updateTime?: string;
|
||||
//
|
||||
key?: number;
|
||||
value?: number;
|
||||
index?: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* 型号分类搜索条件
|
||||
*/
|
||||
export interface TowerSafetyParam extends PageParam {
|
||||
name?: string;
|
||||
placeCode?: string;
|
||||
equipmentType?: string;
|
||||
}
|
||||
114
src/api/tower/param/standard/index.ts
Normal file
114
src/api/tower/param/standard/index.ts
Normal file
@@ -0,0 +1,114 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { TowerPlaceStandard, TowerPlaceStandardParam } from './model';
|
||||
|
||||
/**
|
||||
* 分页查询检查标准
|
||||
*/
|
||||
export async function pageTowerPlaceStandard(params: TowerPlaceStandardParam) {
|
||||
const res = await request.get<ApiResult<PageResult<TowerPlaceStandard>>>(
|
||||
'/tower/tower-place-standard/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询检查标准列表
|
||||
*/
|
||||
export async function listTowerPlaceStandard(params?: TowerPlaceStandardParam) {
|
||||
const res = await request.get<ApiResult<TowerPlaceStandard[]>>(
|
||||
'/tower/tower-place-standard',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加检查标准
|
||||
*/
|
||||
export async function addTowerPlaceStandard(data: TowerPlaceStandard) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
'/tower/tower-place-standard',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改检查标准
|
||||
*/
|
||||
export async function updateTowerPlaceStandard(data: TowerPlaceStandard) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
'/tower/tower-place-standard',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除检查标准
|
||||
*/
|
||||
export async function removeTowerPlaceStandard(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
'/tower/tower-place-standard/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除检查标准
|
||||
*/
|
||||
export async function removeBatchTowerPlaceStandard(
|
||||
data: (number | undefined)[]
|
||||
) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
'/tower/tower-place-standard/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 检查IP是否存在
|
||||
*/
|
||||
export async function checkExistence(
|
||||
field: string,
|
||||
value: string,
|
||||
id?: number
|
||||
) {
|
||||
const res = await request.get<ApiResult<unknown>>(
|
||||
'/tower/tower-place-standard/existence',
|
||||
{
|
||||
params: { field, value, id }
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
22
src/api/tower/param/standard/model/index.ts
Normal file
22
src/api/tower/param/standard/model/index.ts
Normal file
@@ -0,0 +1,22 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 检查标准
|
||||
*/
|
||||
export interface TowerPlaceStandard {
|
||||
id?: number;
|
||||
// 关联部位ID
|
||||
placeId?: number;
|
||||
// 检查标准
|
||||
standard?: string;
|
||||
// 附件
|
||||
files?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 搜索条件
|
||||
*/
|
||||
export interface TowerPlaceStandardParam extends PageParam {
|
||||
id?: number;
|
||||
placeId?: number;
|
||||
}
|
||||
@@ -1,8 +1,22 @@
|
||||
import type { PageParam } from '@/api';
|
||||
import { ProjectOrder } from "@/api/tower/project/order/model";
|
||||
import { ProjectPlace } from "@/api/tower/project/place/model";
|
||||
|
||||
interface FileItem {
|
||||
uid: number;
|
||||
name?: string;
|
||||
status?: string;
|
||||
response?: Response;
|
||||
thumbUrl?: string;
|
||||
downloadUrl?: string;
|
||||
url: string;
|
||||
}
|
||||
|
||||
export interface Project {
|
||||
projectId?: number;
|
||||
projectName?: string;
|
||||
projectImage?: string;
|
||||
files?: FileItem[];
|
||||
companyName?: string;
|
||||
customerName?: string;
|
||||
projectRegion?: string;
|
||||
@@ -24,6 +38,8 @@ export interface Project {
|
||||
userId?: number;
|
||||
comments?: string;
|
||||
sortNumber?: number;
|
||||
orders?: ProjectOrder[];
|
||||
places?: ProjectPlace[];
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
128
src/api/tower/project/order/index.ts
Normal file
128
src/api/tower/project/order/index.ts
Normal file
@@ -0,0 +1,128 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type {
|
||||
ProjectOrder,
|
||||
ProjectOrderParam
|
||||
} from '@/api/tower/project/order/model/index';
|
||||
|
||||
/**
|
||||
* 分页查询合同预定设备清单
|
||||
*/
|
||||
export async function pageProjectOrder(params: ProjectOrderParam) {
|
||||
const res = await request.get<ApiResult<PageResult<ProjectOrder>>>(
|
||||
'/tower/tower-project-order/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询合同预定设备清单列表
|
||||
*/
|
||||
export async function listProjectOrder(params?: ProjectOrderParam) {
|
||||
const res = await request.get<ApiResult<ProjectOrder[]>>(
|
||||
'/tower/tower-project-order',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询合同预定设备清单
|
||||
*/
|
||||
export async function getProjectOrder(id: number) {
|
||||
const res = await request.get<ApiResult<ProjectOrder>>(
|
||||
'/tower/tower-project-order/' + id
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加合同预定设备清单
|
||||
*/
|
||||
export async function addProjectOrder(data: ProjectOrder) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
'/tower/tower-project-order',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改合同预定设备清单
|
||||
*/
|
||||
export async function updateProjectOrder(data: ProjectOrder) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
'/tower/tower-project-order',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除合同预定设备清单
|
||||
*/
|
||||
export async function removeProjectOrder(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
'/tower/tower-project-order/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除合同预定设备清单
|
||||
*/
|
||||
export async function removeBatchProjectOrder(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
'/tower/tower-project-order/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 检查IP是否存在
|
||||
*/
|
||||
export async function checkExistence(
|
||||
field: string,
|
||||
value: string,
|
||||
id?: number
|
||||
) {
|
||||
const res = await request.get<ApiResult<unknown>>(
|
||||
'/tower/tower-project-order/existence',
|
||||
{
|
||||
params: { field, value, id }
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
46
src/api/tower/project/order/model/index.ts
Normal file
46
src/api/tower/project/order/model/index.ts
Normal file
@@ -0,0 +1,46 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 合同预定设备清单
|
||||
*/
|
||||
export interface ProjectOrder {
|
||||
// 合同预定设备清单id
|
||||
projectOrderId?: number;
|
||||
equipmentName?: string;
|
||||
equipmentModel?: string;
|
||||
equipmentNum?: number;
|
||||
key?: string;
|
||||
unit?: string;
|
||||
startTime?: string;
|
||||
endTime?: string;
|
||||
year?: string;
|
||||
documenter?: string;
|
||||
userId?: number;
|
||||
username?: string;
|
||||
nickname?: string;
|
||||
avatar?: string;
|
||||
email?: string;
|
||||
phone?: string;
|
||||
projectId?: number;
|
||||
comments?: string;
|
||||
status?: string;
|
||||
createTime?: string;
|
||||
isEdit?: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
* 合同预定设备清单搜索条件
|
||||
*/
|
||||
export interface ProjectOrderParam extends PageParam {
|
||||
projectOrderId?: number;
|
||||
userId?: number;
|
||||
projectId?: number;
|
||||
}
|
||||
|
||||
export interface UserItem {
|
||||
key: string;
|
||||
isEdit?: boolean;
|
||||
number?: string;
|
||||
name?: string;
|
||||
department?: string;
|
||||
}
|
||||
128
src/api/tower/project/place/index.ts
Normal file
128
src/api/tower/project/place/index.ts
Normal file
@@ -0,0 +1,128 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type {
|
||||
ProjectPlace,
|
||||
ProjectPlaceParam
|
||||
} from '@/api/tower/project/place/model/index';
|
||||
|
||||
/**
|
||||
* 分页查询检查/保养部位配置
|
||||
*/
|
||||
export async function pageProjectPlace(params: ProjectPlaceParam) {
|
||||
const res = await request.get<ApiResult<PageResult<ProjectPlace>>>(
|
||||
'/tower/tower-project-place/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询检查/保养部位配置列表
|
||||
*/
|
||||
export async function listProjectPlace(params?: ProjectPlaceParam) {
|
||||
const res = await request.get<ApiResult<ProjectPlace[]>>(
|
||||
'/tower/tower-project-place',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询检查/保养部位配置
|
||||
*/
|
||||
export async function getProjectPlace(id: number) {
|
||||
const res = await request.get<ApiResult<ProjectPlace>>(
|
||||
'/tower/tower-project-place/' + id
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加检查/保养部位配置
|
||||
*/
|
||||
export async function addProjectPlace(data: ProjectPlace) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
'/tower/tower-project-place',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改检查/保养部位配置
|
||||
*/
|
||||
export async function updateProjectPlace(data: ProjectPlace) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
'/tower/tower-project-place',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除检查/保养部位配置
|
||||
*/
|
||||
export async function removeProjectPlace(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
'/tower/tower-project-place/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除检查/保养部位配置
|
||||
*/
|
||||
export async function removeBatchProjectPlace(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
'/tower/tower-project-place/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 检查IP是否存在
|
||||
*/
|
||||
export async function checkExistence(
|
||||
field: string,
|
||||
value: string,
|
||||
id?: number
|
||||
) {
|
||||
const res = await request.get<ApiResult<unknown>>(
|
||||
'/tower/tower-project-place/existence',
|
||||
{
|
||||
params: { field, value, id }
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
23
src/api/tower/project/place/model/index.ts
Normal file
23
src/api/tower/project/place/model/index.ts
Normal file
@@ -0,0 +1,23 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 检查/保养部位配置
|
||||
*/
|
||||
export interface ProjectPlace {
|
||||
id?: number;
|
||||
projectId?: number;
|
||||
placeId?: number;
|
||||
comments?: string;
|
||||
status?: string;
|
||||
createTime?: string;
|
||||
isEdit?: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
* 搜索条件
|
||||
*/
|
||||
export interface ProjectPlaceParam extends PageParam {
|
||||
id?: number;
|
||||
placeId?: number;
|
||||
projectId?: number;
|
||||
}
|
||||
128
src/api/tower/project/user/index.ts
Normal file
128
src/api/tower/project/user/index.ts
Normal file
@@ -0,0 +1,128 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type {
|
||||
ProjectUser,
|
||||
ProjectUserParam
|
||||
} from '@/api/tower/project/user/model/index';
|
||||
|
||||
/**
|
||||
* 分页查询项目成员
|
||||
*/
|
||||
export async function pageProjectUser(params: ProjectUserParam) {
|
||||
const res = await request.get<ApiResult<PageResult<ProjectUser>>>(
|
||||
'/tower/tower-project-user/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询项目成员列表
|
||||
*/
|
||||
export async function listProjectUser(params?: ProjectUserParam) {
|
||||
const res = await request.get<ApiResult<ProjectUser[]>>(
|
||||
'/tower/tower-project-user',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询项目成员
|
||||
*/
|
||||
export async function getProjectUser(id: number) {
|
||||
const res = await request.get<ApiResult<ProjectUser>>(
|
||||
'/tower/tower-project-user/' + id
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加项目成员
|
||||
*/
|
||||
export async function addProjectUser(data: ProjectUser) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
'/tower/tower-project-user',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改项目成员
|
||||
*/
|
||||
export async function updateProjectUser(data: ProjectUser) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
'/tower/tower-project-user',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除项目成员
|
||||
*/
|
||||
export async function removeProjectUser(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
'/tower/tower-project-user/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除项目成员
|
||||
*/
|
||||
export async function removeBatchProjectUser(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
'/tower/tower-project-user/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 检查IP是否存在
|
||||
*/
|
||||
export async function checkExistence(
|
||||
field: string,
|
||||
value: string,
|
||||
id?: number
|
||||
) {
|
||||
const res = await request.get<ApiResult<unknown>>(
|
||||
'/tower/tower-project-user/existence',
|
||||
{
|
||||
params: { field, value, id }
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
35
src/api/tower/project/user/model/index.ts
Normal file
35
src/api/tower/project/user/model/index.ts
Normal file
@@ -0,0 +1,35 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 项目成员
|
||||
*/
|
||||
export interface ProjectUser {
|
||||
// 项目成员id
|
||||
id?: number;
|
||||
role?: number;
|
||||
userId?: number;
|
||||
username?: string;
|
||||
nickname?: string;
|
||||
avatar?: string;
|
||||
email?: string;
|
||||
phone?: string;
|
||||
projectId?: number;
|
||||
status?: string;
|
||||
createTime?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 项目成员搜索条件
|
||||
*/
|
||||
export interface ProjectUserParam extends PageParam {
|
||||
userId?: number;
|
||||
projectId?: number;
|
||||
}
|
||||
|
||||
export interface UserItem {
|
||||
key: string;
|
||||
isEdit?: boolean;
|
||||
number?: string;
|
||||
name?: string;
|
||||
department?: string;
|
||||
}
|
||||
Reference in New Issue
Block a user