feat(app): 初始化项目配置和页面结构
- 添加 .dockerignore 和 .env.example 配置文件 - 添加 .gitignore 忽略规则配置 - 创建服务端代理API路由(_file、_modules、_server) - 集成 Ant Design Vue 组件库并配置SSR样式提取 - 定义API响应类型封装 - 创建基础布局组件(blank、console) - 实现应用中心页面和组件(AppsCenter) - 添加文章列表测试页面 - 配置控制台导航菜单结构 - 实现控制台头部组件 - 创建联系页面表单
This commit is contained in:
126
app/api/credit/creditUser/index.ts
Normal file
126
app/api/credit/creditUser/index.ts
Normal file
@@ -0,0 +1,126 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { CreditUser, CreditUserParam } from './model';
|
||||
|
||||
/**
|
||||
* 分页查询招投标信息表
|
||||
*/
|
||||
export async function pageCreditUser(params: CreditUserParam) {
|
||||
const res = await request.get<ApiResult<PageResult<CreditUser>>>(
|
||||
'/credit/credit-user/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询招投标信息表列表
|
||||
*/
|
||||
export async function listCreditUser(params?: CreditUserParam) {
|
||||
const res = await request.get<ApiResult<CreditUser[]>>(
|
||||
'/credit/credit-user',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加招投标信息表
|
||||
*/
|
||||
export async function addCreditUser(data: CreditUser) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
'/credit/credit-user',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改招投标信息表
|
||||
*/
|
||||
export async function updateCreditUser(data: CreditUser) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
'/credit/credit-user',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除招投标信息表
|
||||
*/
|
||||
export async function removeCreditUser(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
'/credit/credit-user/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除招投标信息表
|
||||
*/
|
||||
export async function removeBatchCreditUser(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
'/credit/credit-user/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询招投标信息表
|
||||
*/
|
||||
export async function getCreditUser(id: number) {
|
||||
const res = await request.get<ApiResult<CreditUser>>(
|
||||
'/credit/credit-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 importCreditUsers(file: File) {
|
||||
const formData = new FormData();
|
||||
formData.append('file', file);
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
'/credit/credit-user/import',
|
||||
formData,
|
||||
{
|
||||
headers: {
|
||||
'Content-Type': 'multipart/form-data'
|
||||
}
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
67
app/api/credit/creditUser/model/index.ts
Normal file
67
app/api/credit/creditUser/model/index.ts
Normal file
@@ -0,0 +1,67 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 招投标信息表
|
||||
*/
|
||||
export interface CreditUser {
|
||||
// ID
|
||||
id?: number;
|
||||
// 客户名称
|
||||
name?: string;
|
||||
// 唯一标识
|
||||
code?: string;
|
||||
// 类型, 0普通用户, 1招投标
|
||||
type?: number;
|
||||
// 企业角色
|
||||
role?: string;
|
||||
// 上级id, 0是顶级
|
||||
parentId?: number;
|
||||
// 信息类型
|
||||
infoType?: string;
|
||||
// 所在国家
|
||||
country?: string;
|
||||
// 所在省份
|
||||
province?: string;
|
||||
// 所在城市
|
||||
city?: string;
|
||||
// 所在辖区
|
||||
region?: string;
|
||||
// 街道地址
|
||||
address?: string;
|
||||
// 招采单位名称
|
||||
procurementName?: string;
|
||||
// 中标单位名称
|
||||
winningName?: string;
|
||||
// 中标单位名称
|
||||
winningPrice?: string;
|
||||
// 发布日期
|
||||
releaseDate?: string;
|
||||
// 备注
|
||||
comments?: string;
|
||||
// 是否推荐
|
||||
recommend?: number;
|
||||
// 到期时间
|
||||
expirationTime?: string;
|
||||
// 排序(数字越小越靠前)
|
||||
sortNumber?: number;
|
||||
// 状态, 0正常, 1冻结
|
||||
status?: number;
|
||||
// 是否删除, 0否, 1是
|
||||
deleted?: number;
|
||||
// 用户ID
|
||||
userId?: number;
|
||||
// 租户id
|
||||
tenantId?: number;
|
||||
// 创建时间
|
||||
createTime?: string;
|
||||
// 修改时间
|
||||
updateTime?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 招投标信息表搜索条件
|
||||
*/
|
||||
export interface CreditUserParam extends PageParam {
|
||||
id?: number;
|
||||
keywords?: string;
|
||||
}
|
||||
Reference in New Issue
Block a user