This commit is contained in:
于晏彭 2023-03-15 11:00:41 +08:00
parent da6f266b45
commit 2660dbf9e1
8 changed files with 167 additions and 34 deletions

View File

@ -1,16 +1,16 @@
// * 请求响应参数(不包含data)
export interface Result {
export declare interface Result {
code: string;
message: string;
}
// * 请求响应参数(包含data)
export interface ResultData<T = any> extends Result {
export declare interface ResultData<T = any> extends Result {
result: T;
}
// * 分页响应参数
export interface ResPage<T> {
export declare interface ResPage<T> {
result: T[];
pageNo: number;
pageSize: number;
@ -18,35 +18,35 @@ export interface ResPage<T> {
}
// * 分页请求参数
export interface ReqPage {
export declare interface ReqPage {
pageNum: number;
pageSize: number;
}
// * 文件上传模块
export namespace Upload {
export interface ResFileUrl {
export declare namespace Upload {
interface ResFileUrl {
fileUrl: string;
}
}
// * 登录模块
export namespace Login {
export interface ReqLoginForm {
export declare namespace Login {
interface ReqLoginForm {
account: string;
showPassword: string;
}
export interface ResLogin {
interface ResLogin {
token: string;
}
export interface ResAuthButtons {
interface ResAuthButtons {
[key: string]: string[];
}
}
// * 用户管理模块
export namespace User {
export interface ReqUserParams extends ReqPage {
export declare namespace User {
interface ReqUserParams extends ReqPage {
username: string;
gender: number;
idCard: string;
@ -55,7 +55,7 @@ export namespace User {
createTime: string[];
status: number;
}
export interface ResRecords {
interface ResRecords {
createTime: string;
dictCode: string;
dictLabel: string;
@ -66,7 +66,7 @@ export namespace User {
remark: string;
status: string;
}
export interface ResResults {
interface ResResults {
current: string;
hitCount: boolean;
pages: string;
@ -75,7 +75,7 @@ export namespace User {
total: string;
records: ResRecords[];
}
export interface ResUserList {
interface ResUserList {
id: string;
configId: string;
dictCode: string;
@ -86,29 +86,30 @@ export namespace User {
age: number;
};
};
records?: ResRecords[];
idCard: string;
email: string;
address: string;
createTime: string;
status: number;
avatar: string;
records?: ResRecords[];
children?: ResUserList[];
}
export interface ResStatus {
interface ResStatus {
userLabel: string;
userValue: number;
}
export interface ResGender {
interface ResGender {
genderLabel: string;
genderValue: number;
}
export interface ResDepartment {
interface ResDepartment {
id: string;
name: string;
children?: ResDepartment[];
}
export interface ResRole {
interface ResRole {
id: string;
name: string;
children?: ResDepartment[];

View File

@ -1,4 +1,5 @@
import { ResPage, User } from "@/api/interface/index";
// import { ResPage, User } from "@/api/interface/index";
import { ResPage, User } from "@/api/types/common";
import { PORT1 } from "@/api/config/servicePort";
import http from "@/api";

116
src/api/types/common.d.ts vendored Normal file
View File

@ -0,0 +1,116 @@
// * 请求响应参数(不包含data)
export declare interface Result {
code: string;
message: string;
}
// * 请求响应参数(包含data)
export declare interface ResultData<T = any> extends Result {
result: T;
}
// * 分页响应参数
export declare interface ResPage<T> {
result: T[];
pageNo: number;
pageSize: number;
total: number;
}
// * 分页请求参数
export declare interface ReqPage {
pageNum: number;
pageSize: number;
}
// * 文件上传模块
export declare namespace Upload {
interface ResFileUrl {
fileUrl: string;
}
}
// * 登录模块
export declare namespace Login {
interface ReqLoginForm {
account: string;
showPassword: string;
}
interface ResLogin {
token: string;
}
interface ResAuthButtons {
[key: string]: string[];
}
}
// * 用户管理模块
export declare namespace User {
interface ReqUserParams extends ReqPage {
username: string;
gender: number;
idCard: string;
email: string;
address: string;
createTime: string[];
status: number;
}
interface ResRecords {
createTime: string;
dictCode: string;
dictLabel: string;
dictSort: number;
dictType: string;
dictValue: string;
isDefault: string;
remark: string;
status: string;
}
interface ResResults {
current: string;
hitCount: boolean;
pages: string;
searchCount: boolean;
size: string;
total: string;
records: ResRecords[];
}
interface ResUserList {
id: string;
configId: string;
dictCode: string;
username: string;
gender: string;
user: {
detail: {
age: number;
};
};
records?: ResRecords[];
idCard: string;
email: string;
address: string;
createTime: string;
status: number;
avatar: string;
children?: ResUserList[];
}
interface ResStatus {
userLabel: string;
userValue: number;
}
interface ResGender {
genderLabel: string;
genderValue: number;
}
interface ResDepartment {
id: string;
name: string;
children?: ResDepartment[];
}
interface ResRole {
id: string;
name: string;
children?: ResDepartment[];
}
}

0
src/api/types/company/User.d.ts vendored Normal file
View File

2
src/api/types/index.d.ts vendored Normal file
View File

@ -0,0 +1,2 @@
export * from "./company/User";
export * from "./jxj/User";

17
src/api/types/jxj/User.d.ts vendored Normal file
View File

@ -0,0 +1,17 @@
import type { User } from "../common";
export declare namespace jxj_User {
interface ResUserList extends User.ResUserList {
// 解决 dictionary 组件 报错
dictId: number;
dictName: string;
dictCode: number;
dictValue: string;
// 解决 menumanage 组件 报错
moduleId: string | number;
actionId: string | number;
menuId: string | number;
username: string;
}
}

View File

@ -86,7 +86,8 @@
import { ref, reactive } from "vue";
import { ElMessage, ElMessageBox } from "element-plus";
import { useRouter } from "vue-router";
import { User } from "@/api/interface";
// import { User } from "@/api/interface";
import { jxj_User } from "@/api/types";
import { ColumnProps } from "@/components/ProTable/interface";
import { useHandleData } from "@/hooks/useHandleData";
import ProTable from "@/components/ProTable/index.vue";
@ -188,12 +189,6 @@ const columns: ColumnProps[] = [
{
prop: "createTime",
label: "创建时间"
// search: {
// el: "date-picker",
// span: 2,
// props: { type: "datetimerange", valueFormat: "YYYY-MM-DD HH:mm:ss" },
// defaultValue: ["", ""]
// }
},
{ prop: "operation", label: "操作", fixed: "right" }
];
@ -309,13 +304,13 @@ const DiaSubmit = async (form: any) => {
};
//
const deleteAccount = async (params: User.ResUserList) => {
const deleteAccount = async (params: jxj_User.ResUserList) => {
await useHandleData(deleteDictionary, { id: params.dictId }, `删除【${params.dictName}】用户`);
proTable.value.getTableList();
};
//
const DeleteBtn = async (params: User.ResUserList) => {
const DeleteBtn = async (params: jxj_User.ResUserList) => {
await useHandleData(deleteDia, { id: params.dictCode }, `删除【${params.dictValue}】用户`);
proTable.value.getTableList();
};

View File

@ -176,7 +176,8 @@
import { ref, reactive, onMounted } from "vue";
import { ElMessage, ElMessageBox } from "element-plus";
import { useRouter } from "vue-router";
import { User } from "@/api/interface";
// import { User } from "@/api/interface";
import { jxj_User } from "@/api/types";
import { ColumnProps } from "@/components/ProTable/interface";
import { useHandleData } from "@/hooks/useHandleData";
import ProTable from "@/components/ProTable/index.vue";
@ -562,17 +563,17 @@ const onBtnManage = async (row: any) => {
};
//
const deleteAccount = async (params: User.ResUserList) => {
const deleteAccount = async (params: jxj_User.ResUserList) => {
await useHandleData(deleteMunu, { id: params.moduleId }, `删除【${params.username}】用户`);
proTable.value.getTableList();
};
//
const deleteMenu = async (params: User.ResUserList) => {
const deleteMenu = async (params: jxj_User.ResUserList) => {
await useHandleData(deletesysMenu, { menuId: params.menuId }, `删除【${params.username}】用户`);
await menuList({ moduleId: params.moduleId });
};
//
const onBtnDelete = async (params: User.ResUserList) => {
const onBtnDelete = async (params: jxj_User.ResUserList) => {
await useHandleData(deleteAction, { actionId: params.actionId }, `删除【${params.username}】用户`);
getBtnTabList({ menuId: params.menuId });
};