修改各模块ts接口规范
This commit is contained in:
@ -186,9 +186,9 @@ springdoc:
|
||||
api-docs:
|
||||
# 是否开启接口文档
|
||||
enabled: true
|
||||
# swagger-ui:
|
||||
# # 持久化认证数据
|
||||
# persistAuthorization: true
|
||||
# swagger-ui:
|
||||
# # 持久化认证数据
|
||||
# persistAuthorization: true
|
||||
info:
|
||||
# 标题
|
||||
title: '标题:${ruoyi.name}多租户管理系统_接口文档'
|
||||
@ -210,15 +210,19 @@ springdoc:
|
||||
name: ${sa-token.token-name}
|
||||
#这里定义了两个分组,可定义多个,也可以不定义
|
||||
group-configs:
|
||||
- group: 1.演示模块
|
||||
packages-to-scan: org.dromara.demo
|
||||
- group: 2.通用模块
|
||||
- group: 1.通用模块
|
||||
packages-to-scan: org.dromara.web
|
||||
- group: 3.系统模块
|
||||
- group: 2.系统模块
|
||||
packages-to-scan: org.dromara.system
|
||||
- group: 4.代码生成模块
|
||||
- group: 3.项目模块
|
||||
packages-to-scan: org.dromara.project
|
||||
- group: 4.材料模块
|
||||
packages-to-scan: org.dromara.materials
|
||||
- group: 5.机械模块
|
||||
packages-to-scan: org.dromara.machinery
|
||||
- group: 6.代码生成模块
|
||||
packages-to-scan: org.dromara.generator
|
||||
- group: 5.工作流模块
|
||||
- group: 7.工作流模块
|
||||
packages-to-scan: org.dromara.workflow
|
||||
|
||||
# 防止XSS攻击
|
||||
|
@ -45,9 +45,8 @@ public class BusUserProjectRelevancyController extends BaseController {
|
||||
private final IBusUserProjectRelevancyService userProjectRelevancyService;
|
||||
|
||||
/**
|
||||
* 查询系统用户与项目关联列表
|
||||
* 查询用户与项目关联列表
|
||||
*/
|
||||
@Tag(name = "查询用户与项目关联列表")
|
||||
@SaCheckPermission("project:projectRelevancy:list")
|
||||
@GetMapping("/list")
|
||||
public R<Page<BusUserProjectRelevancyVo>> list(UserProjectRelevancyQueryReq req) {
|
||||
@ -57,7 +56,6 @@ public class BusUserProjectRelevancyController extends BaseController {
|
||||
/**
|
||||
* 查询登录用户与项目关联列表
|
||||
*/
|
||||
@Tag(name = "查询登录用户与项目关联列表")
|
||||
@SaCheckPermission("project:projectRelevancy:list")
|
||||
@GetMapping("/login/list")
|
||||
public R<List<LoginUserProjectRelevancyResp>> listByLoginUser() {
|
||||
@ -68,7 +66,6 @@ public class BusUserProjectRelevancyController extends BaseController {
|
||||
/**
|
||||
* 查询登录用户与项目关联分页
|
||||
*/
|
||||
@Tag(name = "查询登录用户与项目关联分页")
|
||||
@SaCheckPermission("project:projectRelevancy:list")
|
||||
@GetMapping("/login/page")
|
||||
public R<Page<BusUserProjectRelevancyVo>> pageByLoginUser(UserProjectRelevancyQueryReq req) {
|
||||
@ -77,9 +74,8 @@ public class BusUserProjectRelevancyController extends BaseController {
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出系统用户与项目关联列表
|
||||
* 导出用户与项目关联列表
|
||||
*/
|
||||
@Tag(name = "导出用户与项目关联列表")
|
||||
@SaCheckPermission("project:projectRelevancy:export")
|
||||
@Log(title = "系统用户与项目关联", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
@ -89,11 +85,10 @@ public class BusUserProjectRelevancyController extends BaseController {
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取系统用户与项目关联详细信息
|
||||
* 获取用户与项目关联详细信息
|
||||
*
|
||||
* @param id 主键
|
||||
*/
|
||||
@Tag(name = "获取用户与项目关联详细信息")
|
||||
@SaCheckPermission("project:projectRelevancy:query")
|
||||
@GetMapping("/{id}")
|
||||
public R<BusUserProjectRelevancyVo> getInfo(@NotNull(message = "主键不能为空")
|
||||
@ -102,9 +97,8 @@ public class BusUserProjectRelevancyController extends BaseController {
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增系统用户与项目关联
|
||||
* 新增用户与项目关联
|
||||
*/
|
||||
@Tag(name = "新增用户与项目关联")
|
||||
@SaCheckPermission("project:projectRelevancy:add")
|
||||
@Log(title = "系统用户与项目关联", businessType = BusinessType.INSERT)
|
||||
@RepeatSubmit()
|
||||
@ -114,9 +108,8 @@ public class BusUserProjectRelevancyController extends BaseController {
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增系统用户与项目列表关联
|
||||
* 新增用户与项目列表关联
|
||||
*/
|
||||
@Tag(name = "新增用户与项目列表关联")
|
||||
@SaCheckPermission("project:projectRelevancy:add")
|
||||
@Log(title = "系统用户与项目关联", businessType = BusinessType.INSERT)
|
||||
@RepeatSubmit()
|
||||
@ -127,9 +120,8 @@ public class BusUserProjectRelevancyController extends BaseController {
|
||||
}
|
||||
|
||||
/**
|
||||
* 移除系统用户与项目列表关联
|
||||
* 移除用户与项目列表关联
|
||||
*/
|
||||
@Tag(name = "移除用户与项目列表关联")
|
||||
@SaCheckPermission("project:projectRelevancy:remove")
|
||||
@Log(title = "系统用户与项目关联", businessType = BusinessType.INSERT)
|
||||
@RepeatSubmit()
|
||||
@ -152,9 +144,8 @@ public class BusUserProjectRelevancyController extends BaseController {
|
||||
|
||||
|
||||
/**
|
||||
* 修改系统用户与项目关联
|
||||
* 修改用户与项目关联
|
||||
*/
|
||||
@Tag(name = "修改用户与项目关联")
|
||||
@SaCheckPermission("project:projectRelevancy:edit")
|
||||
@Log(title = "系统用户与项目关联", businessType = BusinessType.UPDATE)
|
||||
@RepeatSubmit()
|
||||
@ -164,11 +155,10 @@ public class BusUserProjectRelevancyController extends BaseController {
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除系统用户与项目关联
|
||||
* 删除用户与项目关联
|
||||
*
|
||||
* @param ids 主键串
|
||||
*/
|
||||
@Tag(name = "删除用户与项目关联")
|
||||
@SaCheckPermission("project:projectRelevancy:remove")
|
||||
@Log(title = "系统用户与项目关联", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
|
@ -1,6 +1,6 @@
|
||||
import request from '@/utils/request';
|
||||
import { AxiosPromise } from 'axios';
|
||||
import { MachineryVO, MachineryForm, MachineryQuery } from '@/api/machinery/machinery/types';
|
||||
import { MachineryForm, MachineryQuery, MachineryVO, PageMachinery } from '@/api/machinery/machinery/types';
|
||||
|
||||
/**
|
||||
* 查询机械列表
|
||||
@ -8,7 +8,7 @@ import { MachineryVO, MachineryForm, MachineryQuery } from '@/api/machinery/mach
|
||||
* @returns {*}
|
||||
*/
|
||||
|
||||
export const listMachinery = (query?: MachineryQuery): AxiosPromise<MachineryVO[]> => {
|
||||
export const listMachinery = (query?: MachineryQuery): AxiosPromise<PageMachinery> => {
|
||||
return request({
|
||||
url: '/machinery/machinery/list',
|
||||
method: 'get',
|
||||
@ -31,7 +31,7 @@ export const getMachinery = (id: string | number): AxiosPromise<MachineryVO> =>
|
||||
* 新增机械
|
||||
* @param data
|
||||
*/
|
||||
export const addMachinery = (data: MachineryForm) => {
|
||||
export const addMachinery = (data: MachineryForm): AxiosPromise<string | number> => {
|
||||
return request({
|
||||
url: '/machinery/machinery',
|
||||
method: 'post',
|
||||
|
@ -33,7 +33,6 @@ export interface MachineryVO {
|
||||
* 备注
|
||||
*/
|
||||
remark: string;
|
||||
|
||||
}
|
||||
|
||||
export interface MachineryForm extends BaseEntity {
|
||||
@ -71,11 +70,9 @@ export interface MachineryForm extends BaseEntity {
|
||||
* 备注
|
||||
*/
|
||||
remark?: string;
|
||||
|
||||
}
|
||||
|
||||
export interface MachineryQuery extends PageQuery {
|
||||
|
||||
export interface MachineryQuery extends PageRequest {
|
||||
/**
|
||||
* 机械名称
|
||||
*/
|
||||
@ -101,11 +98,17 @@ export interface MachineryQuery extends PageQuery {
|
||||
*/
|
||||
principal?: string;
|
||||
|
||||
/**
|
||||
* 日期范围参数
|
||||
*/
|
||||
params?: any;
|
||||
/**
|
||||
* 备注
|
||||
*/1
|
||||
remark?: string;
|
||||
|
||||
/**
|
||||
* 日期范围参数
|
||||
*/
|
||||
params?: any;
|
||||
}
|
||||
|
||||
|
||||
|
||||
export interface PageMachinery extends PageResponse {
|
||||
records?: MachineryVO[];
|
||||
}
|
||||
|
@ -1,6 +1,6 @@
|
||||
import request from '@/utils/request';
|
||||
import { AxiosPromise } from 'axios';
|
||||
import { MachineryDetailVO, MachineryDetailForm, MachineryDetailQuery } from '@/api/machinery/machineryDetail/types';
|
||||
import { MachineryDetailForm, MachineryDetailQuery, MachineryDetailVO, PageMachineryDetail } from '@/api/machinery/machineryDetail/types';
|
||||
|
||||
/**
|
||||
* 查询机械详情列表
|
||||
@ -8,7 +8,7 @@ import { MachineryDetailVO, MachineryDetailForm, MachineryDetailQuery } from '@/
|
||||
* @returns {*}
|
||||
*/
|
||||
|
||||
export const listMachineryDetail = (query?: MachineryDetailQuery): AxiosPromise<MachineryDetailVO[]> => {
|
||||
export const listMachineryDetail = (query?: MachineryDetailQuery): AxiosPromise<PageMachineryDetail> => {
|
||||
return request({
|
||||
url: '/machinery/machineryDetail/list',
|
||||
method: 'get',
|
||||
@ -31,7 +31,7 @@ export const getMachineryDetail = (id: string | number): AxiosPromise<MachineryD
|
||||
* 新增机械详情
|
||||
* @param data
|
||||
*/
|
||||
export const addMachineryDetail = (data: MachineryDetailForm) => {
|
||||
export const addMachineryDetail = (data: MachineryDetailForm): AxiosPromise<string | number> => {
|
||||
return request({
|
||||
url: '/machinery/machineryDetail',
|
||||
method: 'post',
|
||||
|
@ -148,3 +148,7 @@ export interface MachineryDetailQuery extends PageRequest {
|
||||
*/
|
||||
params?: any;
|
||||
}
|
||||
|
||||
export interface PageMachineryDetail extends PageResponse {
|
||||
records?: MachineryDetailVO[];
|
||||
}
|
||||
|
@ -1,6 +1,6 @@
|
||||
import request from '@/utils/request';
|
||||
import { AxiosPromise } from 'axios';
|
||||
import { CompanyVO, CompanyForm, CompanyQuery } from '@/api/materials/company/types';
|
||||
import { CompanyForm, CompanyQuery, CompanyVO, PageCompany } from '@/api/materials/company/types';
|
||||
|
||||
/**
|
||||
* 查询公司列表
|
||||
@ -8,7 +8,7 @@ import { CompanyVO, CompanyForm, CompanyQuery } from '@/api/materials/company/ty
|
||||
* @returns {*}
|
||||
*/
|
||||
|
||||
export const listCompany = (query?: CompanyQuery): AxiosPromise<CompanyVO[]> => {
|
||||
export const listCompany = (query?: CompanyQuery): AxiosPromise<PageCompany> => {
|
||||
return request({
|
||||
url: '/materials/company/list',
|
||||
method: 'get',
|
||||
@ -31,7 +31,7 @@ export const getCompany = (id: string | number): AxiosPromise<CompanyVO> => {
|
||||
* 新增公司
|
||||
* @param data
|
||||
*/
|
||||
export const addCompany = (data: CompanyForm) => {
|
||||
export const addCompany = (data: CompanyForm): AxiosPromise<string | number> => {
|
||||
return request({
|
||||
url: '/materials/company',
|
||||
method: 'post',
|
||||
|
@ -88,3 +88,7 @@ export interface CompanyQuery extends PageRequest {
|
||||
*/
|
||||
params?: any;
|
||||
}
|
||||
|
||||
export interface PageCompany extends PageResponse {
|
||||
records?: CompanyVO[];
|
||||
}
|
||||
|
@ -1,14 +1,13 @@
|
||||
import request from '@/utils/request';
|
||||
import { AxiosPromise } from 'axios';
|
||||
import { MaterialsVO, MaterialsForm, MaterialsQuery } from '@/api/materials/materials/types';
|
||||
import { MaterialsForm, MaterialsQuery, MaterialsVO, PageMaterials } from '@/api/materials/materials/types';
|
||||
|
||||
/**
|
||||
* 查询材料名称列表
|
||||
* @param query
|
||||
* @returns {*}
|
||||
*/
|
||||
|
||||
export const listMaterials = (query?: MaterialsQuery): AxiosPromise<MaterialsVO[]> => {
|
||||
export const listMaterials = (query?: MaterialsQuery): AxiosPromise<PageMaterials> => {
|
||||
return request({
|
||||
url: '/materials/materials/list',
|
||||
method: 'get',
|
||||
@ -31,7 +30,7 @@ export const getMaterials = (id: string | number): AxiosPromise<MaterialsVO> =>
|
||||
* 新增材料名称
|
||||
* @param data
|
||||
*/
|
||||
export const addMaterials = (data: MaterialsForm) => {
|
||||
export const addMaterials = (data: MaterialsForm): AxiosPromise<string | number> => {
|
||||
return request({
|
||||
url: '/materials/materials',
|
||||
method: 'post',
|
||||
|
@ -1,3 +1,5 @@
|
||||
import { CompanyVO } from '@/api/materials/company/types';
|
||||
|
||||
export interface MaterialsVO {
|
||||
/**
|
||||
* 主键id
|
||||
@ -14,6 +16,11 @@ export interface MaterialsVO {
|
||||
*/
|
||||
companyId: string | number;
|
||||
|
||||
/**
|
||||
* 公司信息
|
||||
*/
|
||||
companyVo: CompanyVO;
|
||||
|
||||
/**
|
||||
* 项目id
|
||||
*/
|
||||
@ -283,3 +290,7 @@ export interface MaterialsQuery extends PageRequest {
|
||||
*/
|
||||
params?: any;
|
||||
}
|
||||
|
||||
export interface PageMaterials extends PageResponse {
|
||||
records?: MaterialsVO[];
|
||||
}
|
||||
|
@ -1,6 +1,11 @@
|
||||
import request from '@/utils/request';
|
||||
import { AxiosPromise } from 'axios';
|
||||
import { MaterialsInventoryVO, MaterialsInventoryForm, MaterialsInventoryQuery } from '@/api/materials/materialsInventory/types';
|
||||
import {
|
||||
MaterialsInventoryForm,
|
||||
MaterialsInventoryQuery,
|
||||
MaterialsInventoryVO,
|
||||
PageMaterialsInventory
|
||||
} from '@/api/materials/materialsInventory/types';
|
||||
|
||||
/**
|
||||
* 查询材料出/入库列表
|
||||
@ -8,7 +13,7 @@ import { MaterialsInventoryVO, MaterialsInventoryForm, MaterialsInventoryQuery }
|
||||
* @returns {*}
|
||||
*/
|
||||
|
||||
export const listMaterialsInventory = (query?: MaterialsInventoryQuery): AxiosPromise<MaterialsInventoryVO[]> => {
|
||||
export const listMaterialsInventory = (query?: MaterialsInventoryQuery): AxiosPromise<PageMaterialsInventory> => {
|
||||
return request({
|
||||
url: '/materials/materialsInventory/list',
|
||||
method: 'get',
|
||||
@ -31,7 +36,7 @@ export const getMaterialsInventory = (id: string | number): AxiosPromise<Materia
|
||||
* 新增材料出/入库
|
||||
* @param data
|
||||
*/
|
||||
export const addMaterialsInventory = (data: MaterialsInventoryForm) => {
|
||||
export const addMaterialsInventory = (data: MaterialsInventoryForm): AxiosPromise<string | number> => {
|
||||
return request({
|
||||
url: '/materials/materialsInventory',
|
||||
method: 'post',
|
||||
|
@ -11,6 +11,11 @@ export interface MaterialsInventoryVO {
|
||||
*/
|
||||
materialsId: string | number;
|
||||
|
||||
/**
|
||||
* 材料信息
|
||||
*/
|
||||
materialsVo: MaterialsVO;
|
||||
|
||||
/**
|
||||
* 项目id
|
||||
*/
|
||||
@ -65,11 +70,6 @@ export interface MaterialsInventoryVO {
|
||||
* 备注
|
||||
*/
|
||||
remark: string;
|
||||
|
||||
/**
|
||||
* 材料封装
|
||||
*/
|
||||
materialsVo: MaterialsVO;
|
||||
}
|
||||
|
||||
export interface MaterialsInventoryForm extends BaseEntity {
|
||||
@ -205,3 +205,7 @@ export interface MaterialsInventoryQuery extends PageRequest {
|
||||
*/
|
||||
params?: any;
|
||||
}
|
||||
|
||||
export interface PageMaterialsInventory extends PageResponse {
|
||||
records?: MaterialsInventoryVO[];
|
||||
}
|
||||
|
@ -1,6 +1,6 @@
|
||||
import request from '@/utils/request';
|
||||
import { AxiosPromise } from 'axios';
|
||||
import { ConstructionUserVO, ConstructionUserForm, ConstructionUserQuery } from '@/api/project/constructionUser/types';
|
||||
import { ConstructionUserVO, ConstructionUserForm, ConstructionUserQuery, PageConstructionUser } from '@/api/project/constructionUser/types';
|
||||
|
||||
/**
|
||||
* 查询施工人员列表
|
||||
@ -8,7 +8,7 @@ import { ConstructionUserVO, ConstructionUserForm, ConstructionUserQuery } from
|
||||
* @returns {*}
|
||||
*/
|
||||
|
||||
export const listConstructionUser = (query?: ConstructionUserQuery): AxiosPromise<ConstructionUserVO[]> => {
|
||||
export const listConstructionUser = (query?: ConstructionUserQuery): AxiosPromise<PageConstructionUser> => {
|
||||
return request({
|
||||
url: '/project/constructionUser/list',
|
||||
method: 'get',
|
||||
@ -31,7 +31,7 @@ export const getConstructionUser = (id: string | number): AxiosPromise<Construct
|
||||
* 新增施工人员
|
||||
* @param data
|
||||
*/
|
||||
export const addConstructionUser = (data: ConstructionUserForm) => {
|
||||
export const addConstructionUser = (data: ConstructionUserForm): AxiosPromise<string | number> => {
|
||||
return request({
|
||||
url: '/project/constructionUser',
|
||||
method: 'post',
|
||||
|
@ -430,3 +430,7 @@ export interface ConstructionUserQuery extends PageRequest {
|
||||
*/
|
||||
params?: any;
|
||||
}
|
||||
|
||||
export interface PageConstructionUser extends PageResponse {
|
||||
records?: ConstructionUserVO[];
|
||||
}
|
||||
|
@ -1,6 +1,6 @@
|
||||
import request from '@/utils/request';
|
||||
import { AxiosPromise } from 'axios';
|
||||
import { ContractorVO, ContractorForm, ContractorQuery } from '@/api/project/contractor/types';
|
||||
import { ContractorForm, ContractorQuery, ContractorVO, PageContractor } from '@/api/project/contractor/types';
|
||||
|
||||
/**
|
||||
* 查询分包单位列表
|
||||
@ -8,7 +8,7 @@ import { ContractorVO, ContractorForm, ContractorQuery } from '@/api/project/con
|
||||
* @returns {*}
|
||||
*/
|
||||
|
||||
export const listContractor = (query?: ContractorQuery): AxiosPromise<ContractorVO[]> => {
|
||||
export const listContractor = (query?: ContractorQuery): AxiosPromise<PageContractor> => {
|
||||
return request({
|
||||
url: '/project/contractor/list',
|
||||
method: 'get',
|
||||
@ -31,7 +31,7 @@ export const getContractor = (id: string | number): AxiosPromise<ContractorVO> =
|
||||
* 新增分包单位
|
||||
* @param data
|
||||
*/
|
||||
export const addContractor = (data: ContractorForm) => {
|
||||
export const addContractor = (data: ContractorForm): AxiosPromise<string | number> => {
|
||||
return request({
|
||||
url: '/project/contractor',
|
||||
method: 'post',
|
||||
|
@ -103,3 +103,7 @@ export interface ContractorQuery extends PageRequest {
|
||||
*/
|
||||
params?: any;
|
||||
}
|
||||
|
||||
export interface PageContractor extends PageResponse {
|
||||
records?: ContractorVO[];
|
||||
}
|
||||
|
@ -1,6 +1,6 @@
|
||||
import request from '@/utils/request';
|
||||
import { AxiosPromise } from 'axios';
|
||||
import { ProjectVO, ProjectForm, ProjectQuery } from '@/api/project/project/types';
|
||||
import { PageProjectVo, ProjectForm, ProjectQuery, ProjectVO } from '@/api/project/project/types';
|
||||
|
||||
/**
|
||||
* 查询项目列表
|
||||
@ -8,7 +8,7 @@ import { ProjectVO, ProjectForm, ProjectQuery } from '@/api/project/project/type
|
||||
* @returns {*}
|
||||
*/
|
||||
|
||||
export const listProject = (query?: ProjectQuery): AxiosPromise<ProjectVO[]> => {
|
||||
export const listProject = (query?: ProjectQuery): AxiosPromise<PageProjectVo> => {
|
||||
return request({
|
||||
url: '/project/project/list',
|
||||
method: 'get',
|
||||
@ -31,7 +31,7 @@ export const getProject = (id: string | number): AxiosPromise<ProjectVO> => {
|
||||
* 新增项目
|
||||
* @param data
|
||||
*/
|
||||
export const addProject = (data: ProjectForm) => {
|
||||
export const addProject = (data: ProjectForm): AxiosPromise<string | number> => {
|
||||
return request({
|
||||
url: '/project/project',
|
||||
method: 'post',
|
||||
|
@ -328,3 +328,7 @@ export interface ProjectQuery extends PageRequest {
|
||||
*/
|
||||
params?: any;
|
||||
}
|
||||
|
||||
export interface PageProjectVo extends PageResponse {
|
||||
records?: ProjectVO[];
|
||||
}
|
||||
|
@ -1,6 +1,6 @@
|
||||
import request from '@/utils/request';
|
||||
import { AxiosPromise } from 'axios';
|
||||
import { ProjectRelevancyVO, ProjectRelevancyForm, ProjectRelevancyQuery } from '@/api/project/projectRelevancy/types';
|
||||
import { PageProjectRelevancy, ProjectRelevancyForm, ProjectRelevancyQuery, ProjectRelevancyVO } from '@/api/project/projectRelevancy/types';
|
||||
|
||||
/**
|
||||
* 查询系统用户与项目关联列表
|
||||
@ -8,7 +8,7 @@ import { ProjectRelevancyVO, ProjectRelevancyForm, ProjectRelevancyQuery } from
|
||||
* @returns {*}
|
||||
*/
|
||||
|
||||
export const listProjectRelevancy = (query?: ProjectRelevancyQuery): AxiosPromise<ProjectRelevancyVO[]> => {
|
||||
export const listProjectRelevancy = (query?: ProjectRelevancyQuery): AxiosPromise<PageProjectRelevancy> => {
|
||||
return request({
|
||||
url: '/project/projectRelevancy/login/page',
|
||||
method: 'get',
|
||||
@ -31,7 +31,7 @@ export const getProjectRelevancy = (id: string | number): AxiosPromise<ProjectRe
|
||||
* 新增系统用户与项目关联
|
||||
* @param data
|
||||
*/
|
||||
export const addProjectRelevancy = (data: ProjectRelevancyForm) => {
|
||||
export const addProjectRelevancy = (data: ProjectRelevancyForm): AxiosPromise<string | number> => {
|
||||
return request({
|
||||
url: '/project/projectRelevancy',
|
||||
method: 'post',
|
||||
@ -70,7 +70,7 @@ export const delProjectRelevancy = (id: string | number | Array<string | number>
|
||||
* 获取用户已关联的项目列表
|
||||
* @param params { userId: number }
|
||||
*/
|
||||
export function listUserProjects(params: { userId: number }) {
|
||||
export function listUserProjects(params: { userId: number | string }) {
|
||||
return request({
|
||||
url: '/project/projectRelevancy/list',
|
||||
method: 'get',
|
||||
@ -82,7 +82,7 @@ export function listUserProjects(params: { userId: number }) {
|
||||
* 添加项目关联
|
||||
* @param data { userId: number; projectIds: number[] }
|
||||
*/
|
||||
export function addNewProjectRelevancy(data: { userId: number; projectIds: number[] }) {
|
||||
export function addNewProjectRelevancy(data: { userId: number | string; projectIdList: number[] }) {
|
||||
return request({
|
||||
url: '/project/projectRelevancy/add/project/list',
|
||||
method: 'post',
|
||||
@ -94,7 +94,7 @@ export function addNewProjectRelevancy(data: { userId: number; projectIds: numbe
|
||||
* 移除项目关联
|
||||
* @param data { userId: number; projectIds: number[] }
|
||||
*/
|
||||
export function removeNewProjectRelevancy(data: { userId: number; projectIds: number[] }) {
|
||||
export function removeNewProjectRelevancy(data: { userId: number | string; projectIdList: number[] }) {
|
||||
return request({
|
||||
url: '/project/projectRelevancy/remove/project/list',
|
||||
method: 'delete',
|
||||
|
@ -1,3 +1,5 @@
|
||||
import { ProjectVO } from '@/api/project/project/types';
|
||||
|
||||
export interface ProjectRelevancyVO {
|
||||
/**
|
||||
* 主键ID
|
||||
@ -15,10 +17,9 @@ export interface ProjectRelevancyVO {
|
||||
projectId: string | number;
|
||||
|
||||
/**
|
||||
* 删除时间
|
||||
* 项目详情
|
||||
*/
|
||||
deletedAt: string;
|
||||
|
||||
project: ProjectVO;
|
||||
}
|
||||
|
||||
export interface ProjectRelevancyForm extends BaseEntity {
|
||||
@ -41,11 +42,9 @@ export interface ProjectRelevancyForm extends BaseEntity {
|
||||
* 删除时间
|
||||
*/
|
||||
deletedAt?: string;
|
||||
|
||||
}
|
||||
|
||||
export interface ProjectRelevancyQuery extends PageQuery {
|
||||
|
||||
export interface ProjectRelevancyQuery extends PageRequest {
|
||||
/**
|
||||
* 用户ID
|
||||
*/
|
||||
@ -61,11 +60,12 @@ export interface ProjectRelevancyQuery extends PageQuery {
|
||||
*/
|
||||
deletedAt?: string;
|
||||
|
||||
/**
|
||||
* 日期范围参数
|
||||
*/
|
||||
params?: any;
|
||||
/**
|
||||
* 日期范围参数
|
||||
*/
|
||||
params?: any;
|
||||
}
|
||||
|
||||
|
||||
|
||||
export interface PageProjectRelevancy extends PageResponse {
|
||||
records?: ProjectRelevancyVO[];
|
||||
}
|
||||
|
@ -1,6 +1,6 @@
|
||||
import request from '@/utils/request';
|
||||
import { AxiosPromise } from 'axios';
|
||||
import { ProjectTeamVO, ProjectTeamForm, ProjectTeamQuery } from '@/api/project/projectTeam/types';
|
||||
import { PageProjectTeam, ProjectTeamForm, ProjectTeamQuery, ProjectTeamVO } from '@/api/project/projectTeam/types';
|
||||
|
||||
/**
|
||||
* 查询项目班组列表
|
||||
@ -8,7 +8,7 @@ import { ProjectTeamVO, ProjectTeamForm, ProjectTeamQuery } from '@/api/project/
|
||||
* @returns {*}
|
||||
*/
|
||||
|
||||
export const listProjectTeam = (query?: ProjectTeamQuery): AxiosPromise<ProjectTeamVO[]> => {
|
||||
export const listProjectTeam = (query?: ProjectTeamQuery): AxiosPromise<PageProjectTeam> => {
|
||||
return request({
|
||||
url: '/project/projectTeam/list',
|
||||
method: 'get',
|
||||
@ -31,7 +31,7 @@ export const getProjectTeam = (id: string | number): AxiosPromise<ProjectTeamVO>
|
||||
* 新增项目班组
|
||||
* @param data
|
||||
*/
|
||||
export const addProjectTeam = (data: ProjectTeamForm) => {
|
||||
export const addProjectTeam = (data: ProjectTeamForm): AxiosPromise<string | number> => {
|
||||
return request({
|
||||
url: '/project/projectTeam',
|
||||
method: 'post',
|
||||
|
@ -73,3 +73,7 @@ export interface ProjectTeamQuery extends PageRequest {
|
||||
*/
|
||||
params?: any;
|
||||
}
|
||||
|
||||
export interface PageProjectTeam extends PageResponse {
|
||||
records?: ProjectTeamVO[];
|
||||
}
|
||||
|
@ -1,6 +1,6 @@
|
||||
import request from '@/utils/request';
|
||||
import { AxiosPromise } from 'axios';
|
||||
import { ProjectTeamMemberVO, ProjectTeamMemberForm, ProjectTeamMemberQuery } from '@/api/project/projectTeamMember/types';
|
||||
import { PageProjectTeamMember, ProjectTeamMemberForm, ProjectTeamMemberQuery, ProjectTeamMemberVO } from '@/api/project/projectTeamMember/types';
|
||||
|
||||
/**
|
||||
* 查询项目班组下的成员列表
|
||||
@ -8,7 +8,7 @@ import { ProjectTeamMemberVO, ProjectTeamMemberForm, ProjectTeamMemberQuery } fr
|
||||
* @returns {*}
|
||||
*/
|
||||
|
||||
export const listProjectTeamMember = (query?: ProjectTeamMemberQuery): AxiosPromise<ProjectTeamMemberVO[]> => {
|
||||
export const listProjectTeamMember = (query?: ProjectTeamMemberQuery): AxiosPromise<PageProjectTeamMember> => {
|
||||
return request({
|
||||
url: '/project/projectTeamMember/list',
|
||||
method: 'get',
|
||||
@ -31,7 +31,7 @@ export const getProjectTeamMember = (id: string | number): AxiosPromise<ProjectT
|
||||
* 新增项目班组下的成员
|
||||
* @param data
|
||||
*/
|
||||
export const addProjectTeamMember = (data: ProjectTeamMemberForm) => {
|
||||
export const addProjectTeamMember = (data: ProjectTeamMemberForm): AxiosPromise<string | number> => {
|
||||
return request({
|
||||
url: '/project/projectTeamMember',
|
||||
method: 'post',
|
||||
|
@ -93,3 +93,7 @@ export interface ProjectTeamMemberQuery extends PageRequest {
|
||||
*/
|
||||
params?: any;
|
||||
}
|
||||
|
||||
export interface PageProjectTeamMember extends PageResponse {
|
||||
records?: ProjectTeamMemberVO[];
|
||||
}
|
||||
|
@ -1,8 +1,8 @@
|
||||
import {DeptTreeVO, DeptVO} from './../dept/types';
|
||||
import { DeptTreeVO } from './../dept/types';
|
||||
import { RoleVO } from '@/api/system/role/types';
|
||||
import request from '@/utils/request';
|
||||
import { AxiosPromise } from 'axios';
|
||||
import { UserForm, UserQuery, UserVO, UserInfoVO } from './types';
|
||||
import { UserForm, UserInfoVO, UserQuery, UserVO } from './types';
|
||||
import { parseStrEmpty } from '@/utils/ruoyi';
|
||||
|
||||
/**
|
||||
|
9
plus-ui/src/types/global.d.ts
vendored
9
plus-ui/src/types/global.d.ts
vendored
@ -1,4 +1,4 @@
|
||||
import type { PropType as VuePropType, ComponentInternalInstance as ComponentInstance } from 'vue';
|
||||
import type { ComponentInternalInstance as ComponentInstance } from 'vue';
|
||||
import { LanguageEnum } from '@/enums/LanguageEnum';
|
||||
|
||||
declare global {
|
||||
@ -98,6 +98,13 @@ declare global {
|
||||
sortOrder: string;
|
||||
}
|
||||
|
||||
declare interface PageResponse {
|
||||
total?: number;
|
||||
size?: number;
|
||||
current?: number;
|
||||
pages?: number;
|
||||
}
|
||||
|
||||
declare interface LayoutSetting {
|
||||
/**
|
||||
* 是否显示顶部导航
|
||||
|
@ -75,7 +75,7 @@
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize" @pagination="getList" />
|
||||
<pagination v-show="total > 0" :total="total" v-model:page="queryParams.current" v-model:limit="queryParams.pageSize" @pagination="getList" />
|
||||
</el-card>
|
||||
<!-- 添加或修改机械对话框 -->
|
||||
<el-dialog :title="dialog.title" v-model="dialog.visible" width="500px" append-to-body>
|
||||
@ -150,8 +150,10 @@ const initFormData: MachineryForm = {
|
||||
const data = reactive<PageData<MachineryForm, MachineryQuery>>({
|
||||
form: { ...initFormData },
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
current: 1,
|
||||
pageSize: 10,
|
||||
sortField: 'createTime',
|
||||
sortOrder: 'descend',
|
||||
machineryName: undefined,
|
||||
machineryNumber: undefined,
|
||||
projectId: currentProject.value.id,
|
||||
@ -189,7 +191,7 @@ const reset = () => {
|
||||
|
||||
/** 搜索按钮操作 */
|
||||
const handleQuery = () => {
|
||||
queryParams.value.pageNum = 1;
|
||||
queryParams.value.current = 1;
|
||||
getList();
|
||||
};
|
||||
|
||||
|
@ -135,6 +135,8 @@ const data = reactive<PageData<CompanyForm, CompanyQuery>>({
|
||||
queryParams: {
|
||||
current: 1,
|
||||
pageSize: 10,
|
||||
sortField: 'createTime',
|
||||
sortOrder: 'descend',
|
||||
companyName: undefined,
|
||||
projectId: currentProject.value.id,
|
||||
status: undefined,
|
||||
@ -171,7 +173,7 @@ const reset = () => {
|
||||
|
||||
/** 搜索按钮操作 */
|
||||
const handleQuery = () => {
|
||||
queryParams.value.pageNum = 1;
|
||||
queryParams.value.current = 1;
|
||||
getList();
|
||||
};
|
||||
|
||||
|
@ -193,7 +193,6 @@ const initFormData: MaterialsForm = {
|
||||
materialsName: undefined,
|
||||
companyId: undefined,
|
||||
projectId: currentProject.value.id,
|
||||
companyVo: undefined,
|
||||
typeSpecificationName: undefined,
|
||||
typeSpecificationUrl: undefined,
|
||||
certificateConformityName: undefined,
|
||||
@ -215,10 +214,11 @@ const data = reactive<PageData<MaterialsForm, MaterialsQuery>>({
|
||||
queryParams: {
|
||||
current: 1,
|
||||
pageSize: 10,
|
||||
sortField: 'createTime',
|
||||
sortOrder: 'descend',
|
||||
materialsName: undefined,
|
||||
companyId: undefined,
|
||||
projectId: currentProject.value.id,
|
||||
companyVo: undefined,
|
||||
typeSpecificationName: undefined,
|
||||
typeSpecificationUrl: undefined,
|
||||
certificateConformityName: undefined,
|
||||
@ -250,7 +250,7 @@ const getList = async () => {
|
||||
materialsList.value = res.data.records;
|
||||
total.value = res.data.total;
|
||||
const companyMap = new Map();
|
||||
res.data.records.forEach((record) => {
|
||||
res.data.records.forEach((record: MaterialsVO) => {
|
||||
const { id, companyName } = record.companyVo;
|
||||
if (!companyMap.has(id)) {
|
||||
companyMap.set(id, { id, companyName });
|
||||
|
@ -326,7 +326,7 @@ const getContractorList = async () => {
|
||||
loading.value = false;
|
||||
};
|
||||
|
||||
const projectTeamOpt = ref();
|
||||
const projectTeamOpt = ref([]);
|
||||
|
||||
/** 查询当前项目下的班组列表 */
|
||||
const getProjectTeamList = async () => {
|
||||
|
@ -143,6 +143,8 @@ const data = reactive<PageData<ContractorForm, ContractorQuery>>({
|
||||
queryParams: {
|
||||
current: 1,
|
||||
pageSize: 10,
|
||||
sortField: 'createTime',
|
||||
sortOrder: 'descend',
|
||||
name: undefined,
|
||||
principal: undefined,
|
||||
principalPhone: undefined,
|
||||
|
@ -10,15 +10,16 @@
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { ref, onMounted, defineProps, watch } from 'vue';
|
||||
import { defineProps, onMounted, ref, watch } from 'vue';
|
||||
import { listProject } from '@/api/project/project';
|
||||
import { listUserProjects, addNewProjectRelevancy, removeNewProjectRelevancy } from '@/api/project/projectRelevancy';
|
||||
import { addNewProjectRelevancy, listUserProjects, removeNewProjectRelevancy } from '@/api/project/projectRelevancy';
|
||||
import { ProjectRelevancyVO } from '@/api/project/projectRelevancy/types';
|
||||
|
||||
// **从父组件接收 `userId`**
|
||||
const props = defineProps<{ userId: number }>();
|
||||
const props = defineProps<{ userId: number | string }>();
|
||||
|
||||
// **所有项目列表**
|
||||
const allProjects = ref<{ key: number; label: string }[]>([]);
|
||||
const allProjects = ref<{ key: number | string; label: string }[]>([]);
|
||||
|
||||
// **已关联的项目 ID 列表**
|
||||
const selectedProjects = ref<number[]>([]);
|
||||
@ -41,9 +42,7 @@ const getUserProjects = async () => {
|
||||
const res = await listUserProjects({ userId: props.userId });
|
||||
|
||||
// 修改这里,使用 res.records 而不是 res.rows
|
||||
selectedProjects.value = Array.isArray(res.data.records)
|
||||
? res.data.records.map((item) => item.projectId)
|
||||
: [];
|
||||
selectedProjects.value = Array.isArray(res.data.records) ? res.data.records.map((item: ProjectRelevancyVO) => item.projectId) : [];
|
||||
|
||||
console.log('已加载用户关联项目:', selectedProjects.value);
|
||||
} catch (error) {
|
||||
@ -64,7 +63,7 @@ watch(
|
||||
);
|
||||
|
||||
// **处理穿梭框变更**
|
||||
const handleTransferChange = async (newValue: number[], direction: 'left' | 'right', movedKeys: number[]) => {
|
||||
const handleTransferChange = async (_: number[], direction: 'left' | 'right', movedKeys: number[]) => {
|
||||
try {
|
||||
if (direction === 'right') {
|
||||
// **添加关联**
|
||||
|
@ -26,20 +26,20 @@
|
||||
<template #header>
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button type="primary" plain icon="Plus" @click="handleAdd" v-hasPermi="['project:projectRelevancy:add']">新增</el-button>
|
||||
<el-button type="primary" plain icon="Plus" @click="handleAdd" v-hasPermi="['project:projectRelevancy:add']">新增 </el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="success" plain icon="Edit" :disabled="single" @click="handleUpdate()" v-hasPermi="['project:projectRelevancy:edit']"
|
||||
>修改</el-button
|
||||
>
|
||||
>修改
|
||||
</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="danger" plain icon="Delete" :disabled="multiple" @click="handleDelete()" v-hasPermi="['project:projectRelevancy:remove']"
|
||||
>删除</el-button
|
||||
>
|
||||
>删除
|
||||
</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="warning" plain icon="Download" @click="handleExport" v-hasPermi="['project:projectRelevancy:export']">导出</el-button>
|
||||
<el-button type="warning" plain icon="Download" @click="handleExport" v-hasPermi="['project:projectRelevancy:export']">导出 </el-button>
|
||||
</el-col>
|
||||
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
@ -82,7 +82,7 @@
|
||||
<shuttle-frame :userId="selectedUserId" @close="shuttleVisible = false" />
|
||||
</el-dialog>
|
||||
|
||||
<pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize" @pagination="getList" />
|
||||
<pagination v-show="total > 0" :total="total" v-model:page="queryParams.current" v-model:limit="queryParams.pageSize" @pagination="getList" />
|
||||
</el-card>
|
||||
|
||||
<!-- 添加或修改系统用户与项目关联对话框 -->
|
||||
@ -124,11 +124,13 @@
|
||||
</template>
|
||||
|
||||
<script setup name="ProjectRelevancy" lang="ts">
|
||||
import { listProjectRelevancy, delProjectRelevancy, addProjectRelevancy, updateProjectRelevancy } from '@/api/project/projectRelevancy';
|
||||
import { addProjectRelevancy, delProjectRelevancy, listProjectRelevancy, updateProjectRelevancy } from '@/api/project/projectRelevancy';
|
||||
import { listProject } from '@/api/project/project';
|
||||
import { listUser } from '@/api/system/user';
|
||||
import { ProjectRelevancyVO, ProjectRelevancyQuery, ProjectRelevancyForm } from '@/api/project/projectRelevancy/types';
|
||||
import { ProjectRelevancyForm, ProjectRelevancyQuery, ProjectRelevancyVO } from '@/api/project/projectRelevancy/types';
|
||||
import ShuttleFrame from './component/ShuttleFrame.vue';
|
||||
import { UserVO } from '@/api/system/user/types';
|
||||
|
||||
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
||||
|
||||
const projectRelevancyList = ref<ProjectRelevancyVO[]>([]);
|
||||
@ -157,8 +159,10 @@ const initFormData: ProjectRelevancyForm = {
|
||||
const data = reactive<PageData<ProjectRelevancyForm, ProjectRelevancyQuery>>({
|
||||
form: { ...initFormData },
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
current: 1,
|
||||
pageSize: 10,
|
||||
sortField: 'createTime',
|
||||
sortOrder: 'descend',
|
||||
userId: undefined,
|
||||
projectId: undefined,
|
||||
deletedAt: undefined,
|
||||
@ -196,7 +200,7 @@ const reset = () => {
|
||||
|
||||
/** 搜索按钮操作 */
|
||||
const handleQuery = () => {
|
||||
queryParams.value.pageNum = 1;
|
||||
queryParams.value.current = 1;
|
||||
getList();
|
||||
};
|
||||
|
||||
@ -221,7 +225,7 @@ const handleAdd = () => {
|
||||
};
|
||||
|
||||
const shuttleVisible = ref(false);
|
||||
const selectedUserId = ref<number>();
|
||||
const selectedUserId = ref<string | number>();
|
||||
|
||||
const handleUpdate = (row?: ProjectRelevancyVO) => {
|
||||
const currentRow = row || projectRelevancyList.value.find((item) => item.id === ids.value[0]);
|
||||
@ -276,7 +280,7 @@ const selectedProject = ref<any | null>(null);
|
||||
const getProjectList = async () => {
|
||||
try {
|
||||
const res = await listProject();
|
||||
const projectListData = res.records;
|
||||
const projectListData = res.data.records;
|
||||
projectList.value = projectListData;
|
||||
|
||||
// 将项目详情存入 Map
|
||||
@ -301,11 +305,14 @@ const onProjectChange = (projectId: string) => {
|
||||
|
||||
//获取新增用户列表方法
|
||||
|
||||
const userList = ref<{ label: string; value: string }[]>([]);
|
||||
const userList = ref<{ userId: string | number; nickName: string }[]>([]);
|
||||
const getUserList = async () => {
|
||||
try {
|
||||
const response = await listUser({});
|
||||
userList.value = response.rows.map((user: any) => ({
|
||||
const response = await listUser({
|
||||
pageNum: 1,
|
||||
pageSize: 100
|
||||
});
|
||||
userList.value = response.rows.map((user: UserVO) => ({
|
||||
userId: user.userId,
|
||||
nickName: user.nickName
|
||||
}));
|
||||
|
Reference in New Issue
Block a user