完成:安全维保管理模块
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
export interface Security {
|
||||
type: number;
|
||||
securityId?: number;
|
||||
projectName?: string;
|
||||
projectId?: number;
|
||||
@@ -13,6 +14,10 @@ export interface Security {
|
||||
city?: string;
|
||||
region?: string;
|
||||
address?: string;
|
||||
problem?: string;
|
||||
processingMethod?: string;
|
||||
files?: string;
|
||||
replaceAccessories?: number;
|
||||
status?: number;
|
||||
userId?: number;
|
||||
comments?: string;
|
||||
|
||||
105
src/api/tower/security2/index.ts
Normal file
105
src/api/tower/security2/index.ts
Normal file
@@ -0,0 +1,105 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { Security, SecurityParam } from '@/api/tower/security/model';
|
||||
/**
|
||||
* 分页查询仓库
|
||||
*/
|
||||
export async function pageSecurity(params: SecurityParam) {
|
||||
const res = await request.get<ApiResult<PageResult<Security>>>(
|
||||
'/tower/tower-security/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询仓库列表
|
||||
*/
|
||||
export async function listSecurity(params?: SecurityParam) {
|
||||
const res = await request.get<ApiResult<Security[]>>(
|
||||
'/tower/tower-security',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加仓库
|
||||
*/
|
||||
export async function addSecurity(data: Security) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
'/tower/tower-security',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改仓库
|
||||
*/
|
||||
export async function updateSecurity(data: Security) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
'/tower/tower-security',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 绑定仓库
|
||||
*/
|
||||
export async function bindSecurity(data: Security) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
'/tower/tower-security/bind',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除仓库
|
||||
*/
|
||||
export async function removeSecurity(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
'/tower/tower-security/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除仓库
|
||||
*/
|
||||
export async function removeBatchSecurity(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
'/tower/tower-security/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
31
src/api/tower/security2/model/index.ts
Normal file
31
src/api/tower/security2/model/index.ts
Normal file
@@ -0,0 +1,31 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
export interface Security {
|
||||
securityId?: number;
|
||||
projectName?: string;
|
||||
projectId?: number;
|
||||
securityCode?: string;
|
||||
regionName?: string;
|
||||
longitude?: string;
|
||||
latitude?: string;
|
||||
country?: string;
|
||||
province?: string;
|
||||
city?: string;
|
||||
region?: string;
|
||||
address?: string;
|
||||
status?: number;
|
||||
userId?: number;
|
||||
comments?: string;
|
||||
sortNumber?: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* 搜索条件
|
||||
*/
|
||||
export interface SecurityParam extends PageParam {
|
||||
securityId?: number;
|
||||
projectId?: number;
|
||||
projectName?: string;
|
||||
status?: number;
|
||||
keywords?: string;
|
||||
}
|
||||
Reference in New Issue
Block a user