diff --git a/src/api/calibration/invoiceApplication/index.ts b/src/api/calibration/invoiceApplication/index.ts index 1ae6c97..80c7edc 100644 --- a/src/api/calibration/invoiceApplication/index.ts +++ b/src/api/calibration/invoiceApplication/index.ts @@ -30,8 +30,8 @@ export const FinanceIssueInvoice = (data: any) => { // 开票分页查询 export const FinanceIssueDetail = (data: any) => { const formData = new FormData(); - formData.append("page", data.page); - formData.append("per_page", data.per_page); + formData.append("page", data.pageNum); + formData.append("per_page", data.pageSize); return request({ url: `${AUTH_BASE_URL}/finance/issue-Detail`, method: "post", diff --git a/src/store/modules/user-store.ts b/src/store/modules/user-store.ts index 9e7476d..038bd0a 100644 --- a/src/store/modules/user-store.ts +++ b/src/store/modules/user-store.ts @@ -8,7 +8,7 @@ import { usePermissionStoreHook } from "@/store/modules/permission-store"; import { useDictStoreHook } from "@/store/modules/dict-store"; import { useTagsViewStore } from "@/store"; import { cleanupWebSocket } from "@/plugins/websocket"; -import { userLogin } from "@/api/calibration/login"; +import { UserGetInfo, userLogin } from "@/api/calibration/login"; export const useUserStore = defineStore("user", () => { // 用户信息 @@ -32,7 +32,7 @@ export const useUserStore = defineStore("user", () => { AuthStorage.setTokens(accessToken, refreshToken, rememberMe.value); userLogin(LoginFormData) .then(() => { - console.log("login success"); + getUserInfo(LoginFormData.username); resolve(); }) .catch((error) => { @@ -50,16 +50,16 @@ export const useUserStore = defineStore("user", () => { * * @returns {UserInfo} 用户信息 */ - function getUserInfo() { + function getUserInfo(username: string) { return new Promise((resolve, reject) => { - UserAPI.getInfo() - .then((data) => { - if (!data) { + UserGetInfo(username) + .then((res: any) => { + if (!res) { reject("Verification failed, please Login again."); return; } - Object.assign(userInfo.value, { ...data }); - resolve(data); + setUserInfo(res.data); + resolve(res); }) .catch((error) => { reject(error); @@ -67,6 +67,9 @@ export const useUserStore = defineStore("user", () => { }); } + const setUserInfo = (info: any) => { + userInfo.value = info; + }; /** * 登出 */ @@ -148,6 +151,7 @@ export const useUserStore = defineStore("user", () => { rememberMe, isLoggedIn: () => !!AuthStorage.getAccessToken(), getUserInfo, + setUserInfo, login, logout, resetAllState, diff --git a/src/utils/functionDialogBox/index.ts b/src/utils/functionDialogBox/index.ts new file mode 100644 index 0000000..2a05457 --- /dev/null +++ b/src/utils/functionDialogBox/index.ts @@ -0,0 +1,81 @@ +import { ElButton, ElDialog } from "element-plus"; +import { Component, DefineComponent } from "vue"; +import { h, createApp } from "vue"; + +// 定义模态框属性接口 +interface ModalProps { + title?: string; + width?: string | number; + ok?: (result: any) => void; + cancel?: () => void; + [key: string]: any; // 允许其他 Element Plus Dialog 属性 +} + +interface DialogInstance { + unmount: () => void; +} + +// 函数式弹窗组件 +export const functionDialogBox = ( + component: Component | DefineComponent | null, + props: Record, + modalProps: ModalProps +): DialogInstance => { + const open = ref(true); + const formRef = ref(); + const dialog = () => + h( + ElDialog, + { + ...modalProps, + modelValue: open.value, + onOpen() {}, + onClosed() { + app.unmount(); + document.body.removeChild(div); + }, + }, + { + default: () => h(component || h("div"), { ref: formRef, ...props }), + footer: () => [ + h( + ElButton, + { + type: "primary", + async onClick() { + await formRef.value?.submit?.(); + const awd = formRef.value?.getForm?.(); + modalProps?.ok?.(awd); + unmount(); + }, + }, + () => "确定" + ), + h( + ElButton, + { + onClick() { + modalProps?.cancel?.(); + unmount(); + }, + }, + () => "取消" + ), + ], + } + ); + + const app = createApp(dialog); + + const div = document.createElement("div"); + document.body.appendChild(div); + app.mount(div); + + function unmount() { + open.value = false; + } + + return { + unmount, + }; +}; diff --git a/src/utils/request.ts b/src/utils/request.ts index 0c6373b..6b4d816 100644 --- a/src/utils/request.ts +++ b/src/utils/request.ts @@ -23,7 +23,7 @@ const generateRandomToken = () => { */ const httpRequest = axios.create({ baseURL: import.meta.env.VITE_APP_BASE_API, - timeout: 50000, + timeout: 500000, headers: { "Content-Type": "application/json;charset=utf-8" }, paramsSerializer: (params) => qs.stringify(params), }); diff --git a/src/views/calibration/invoiceApplication/index.vue b/src/views/calibration/invoiceApplication/index.vue index 8586592..2f73af4 100644 --- a/src/views/calibration/invoiceApplication/index.vue +++ b/src/views/calibration/invoiceApplication/index.vue @@ -1,994 +1,491 @@ - - - - diff --git a/src/views/calibration/onboardingRegistration/components/DepartmentSelectionForm.vue b/src/views/calibration/onboardingRegistration/components/DepartmentSelectionForm.vue new file mode 100644 index 0000000..0362d3e --- /dev/null +++ b/src/views/calibration/onboardingRegistration/components/DepartmentSelectionForm.vue @@ -0,0 +1,47 @@ + + + + + diff --git a/src/views/calibration/onboardingRegistration/components/DeptTree.vue b/src/views/calibration/onboardingRegistration/components/DeptTree.vue deleted file mode 100644 index caa9061..0000000 --- a/src/views/calibration/onboardingRegistration/components/DeptTree.vue +++ /dev/null @@ -1,83 +0,0 @@ - - - - diff --git a/src/views/calibration/onboardingRegistration/components/UserImport.vue b/src/views/calibration/onboardingRegistration/components/UserImport.vue deleted file mode 100644 index 0f00f9e..0000000 --- a/src/views/calibration/onboardingRegistration/components/UserImport.vue +++ /dev/null @@ -1,198 +0,0 @@ - - - diff --git a/src/views/calibration/onboardingRegistration/index.vue b/src/views/calibration/onboardingRegistration/index.vue index 8586592..9815540 100644 --- a/src/views/calibration/onboardingRegistration/index.vue +++ b/src/views/calibration/onboardingRegistration/index.vue @@ -1,213 +1,103 @@ - - - - diff --git a/src/views/calibration/personnelManagement/index.vue b/src/views/calibration/personnelManagement/index.vue index 00fa666..006bf14 100644 --- a/src/views/calibration/personnelManagement/index.vue +++ b/src/views/calibration/personnelManagement/index.vue @@ -460,7 +460,7 @@ const loading = ref(false); // 弹窗状态 const dialog = reactive({ visible: false, - title: "新增用户", + title: "新增人员", }); // 表单数据 @@ -698,7 +698,7 @@ async function handleOpenDialog(data?: any): Promise { // 编辑:加载用户数据 if (data?.id) { - dialog.title = "修改用户"; + dialog.title = "修改人员"; try { const data1 = deepCloneByJSON(data); data1.academic = parseJsonToArray(data1.academic); @@ -713,7 +713,7 @@ async function handleOpenDialog(data?: any): Promise { } } else { // 新增:设置默认值 - dialog.title = "新增用户"; + dialog.title = "新增人员"; } }