From f070b02da9a1ba5a98234cadcd38da7031d06610 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88?= <2960252003@qq.com> Date: Wed, 17 Apr 2024 11:23:49 +0800 Subject: [PATCH] =?UTF-8?q?=E9=A6=96=E9=A1=B5=E7=9A=84=E7=BB=9F=E8=AE=A1?= =?UTF-8?q?=E5=9B=BE=E5=92=8C=E7=A5=A8=E6=8D=AE=E7=9A=84=E7=8A=B6=E6=80=81?= =?UTF-8?q?=E5=88=86=E6=A0=87=E7=AD=BE=E5=B1=95=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config/vite.config.dev.ts | 4 +- index.html | 5 +- package.json | 9 +- src/api/interceptor.ts | 4 +- src/api/role.ts | 9 +- src/api/ticket.ts | 10 +- src/api/user.ts | 14 +- src/components/footer/index.vue | 18 +- src/components/navbar/index.vue | 8 +- src/config/settings.json | 2 +- src/image/票据服务.png | Bin 0 -> 3112 bytes src/router/routes/modules/system.ts | 2 +- src/router/routes/modules/ticket.ts | 2 +- src/router/routes/modules/user.ts | 2 +- src/store/modules/role/index.ts | 4 +- src/store/modules/ticket/index.ts | 11 +- src/store/modules/user/index.ts | 15 +- src/types/global.ts | 2 + src/utils/excel.ts | 69 + .../workplace/components/data-panel.vue | 284 +- src/views/dashboard/workplace/locale/en-US.ts | 2 + src/views/dashboard/workplace/locale/zh-CN.ts | 2 + src/views/login/components/login-form.vue | 130 +- src/views/login/index.vue | 102 +- src/views/login/locale/en-US.ts | 6 +- src/views/login/locale/zh-CN.ts | 22 +- .../system/dept/components/dept-edit.vue | 14 +- src/views/system/dept/index.vue | 63 +- src/views/system/dept/locale/en-US.ts | 6 +- src/views/system/dept/locale/zh-CN.ts | 11 +- .../system/role/components/role-edit.vue | 15 +- src/views/system/role/index.vue | 124 +- src/views/system/role/locale/en-US.ts | 8 + src/views/system/role/locale/zh-CN.ts | 8 + .../system/user/components/user-edit.vue | 87 +- src/views/system/user/index.vue | 103 +- src/views/system/user/locale/en-US.ts | 4 + src/views/system/user/locale/zh-CN.ts | 9 +- .../ticket/manage/components/form-edit.vue | 101 +- .../ticket/manage/components/ticket-edit.vue | 126 +- src/views/ticket/manage/index.vue | 248 +- src/views/ticket/manage/locale/en-US.ts | 35 +- src/views/ticket/manage/locale/zh-CN.ts | 36 +- .../setting/components/password-reset.vue | 4 +- .../user/setting/components/user-panel.vue | 2 +- yarn.lock | 12304 ++++++++-------- 46 files changed, 7371 insertions(+), 6675 deletions(-) create mode 100644 src/image/票据服务.png create mode 100644 src/utils/excel.ts diff --git a/config/vite.config.dev.ts b/config/vite.config.dev.ts index 6e3a086..75f7f76 100644 --- a/config/vite.config.dev.ts +++ b/config/vite.config.dev.ts @@ -13,8 +13,8 @@ export default mergeConfig( }, proxy: { '/api': { - target: 'http://59.110.238.182:8081', - // target: 'http://192.168.3.158:8081', + target: 'http://106.53.179.133:8081', + // target: 'http://192.168.243.246:8081', // target: 'http://localhost:5173', changeOrigin: true, }, diff --git a/index.html b/index.html index 3eeb81f..a8bba25 100644 --- a/index.html +++ b/index.html @@ -3,10 +3,9 @@ - + - 中山学院学习平台 + 票据管理系统 diff --git a/package.json b/package.json index 67786de..a86716a 100644 --- a/package.json +++ b/package.json @@ -13,10 +13,7 @@ "type:check": "vue-tsc --noEmit --skipLibCheck", "lint-staged": "npx lint-staged", "prepare": "husky install", - "start": "npm run dev" - - }, "lint-staged": { "*.{js,ts,jsx,tsx}": [ @@ -40,6 +37,8 @@ "axios": "^0.24.0", "dayjs": "^1.11.5", "echarts": "^5.4.0", + "exceljs": "^4.4.0", + "file-saver": "^2.0.5", "lodash": "^4.17.21", "mitt": "^3.0.0", "nprogress": "^0.2.0", @@ -50,12 +49,14 @@ "vue": "^3.2.40", "vue-echarts": "^6.2.3", "vue-i18n": "^9.2.2", - "vue-router": "^4.0.14" + "vue-router": "^4.0.14", + "xlsx": "^0.18.5" }, "devDependencies": { "@arco-plugins/vite-vue": "^1.4.5", "@commitlint/cli": "^17.1.2", "@commitlint/config-conventional": "^17.1.0", + "@types/file-saver": "^2.0.7", "@types/lodash": "^4.14.186", "@types/mockjs": "^1.0.7", "@types/nprogress": "^0.2.0", diff --git a/src/api/interceptor.ts b/src/api/interceptor.ts index 360865f..b9f43c9 100644 --- a/src/api/interceptor.ts +++ b/src/api/interceptor.ts @@ -75,10 +75,12 @@ axios.interceptors.response.use( const { response } = error; console.log('error', error); - if (response.status === '401') { + if (response.status === 401) { + router.push({ name: 'login', }); + } else { Message.error({ diff --git a/src/api/role.ts b/src/api/role.ts index 9681312..1587fc2 100644 --- a/src/api/role.ts +++ b/src/api/role.ts @@ -18,8 +18,13 @@ export interface RoleListRecord extends RoleRecord { } // 查询所有的角色列表、 -export function queryRoleList() { - return axios.get('/api/rest/role'); +export function queryRoleList(data: any) { + // return axios.get('/api/rest/role',data); + return axios({ + url: '/api/rest/role', // 路径 + method: 'get', + params: data, // 参数 + }) } // 切换启用状态 diff --git a/src/api/ticket.ts b/src/api/ticket.ts index d22ebec..d470181 100644 --- a/src/api/ticket.ts +++ b/src/api/ticket.ts @@ -7,7 +7,7 @@ export interface TicketCreateRecord { type: string; contactEmail: string; companyName: string; - attachId: string; + attachId: []; auditorId: string; submit: boolean; userId: undefined; @@ -15,6 +15,9 @@ export interface TicketCreateRecord { } export interface TicketRecord extends TicketCreateRecord { +auditor: any; +createTime(createTime: any): unknown; +deptName: any; value: any; id: undefined; status: string @@ -83,3 +86,8 @@ export function home(data: any){ params: data, // 参数 }); } + +// 首页统计图 +export function chart(){ + return axios.get('/api/rest/bill/trend') +} \ No newline at end of file diff --git a/src/api/user.ts b/src/api/user.ts index c2b13be..5e532d5 100644 --- a/src/api/user.ts +++ b/src/api/user.ts @@ -29,6 +29,8 @@ export interface PasswordReSetModel { // 添加用户数据 export interface CreateRecord { +value: any; +code: any; username: string; nickName: string; @@ -107,10 +109,15 @@ export function resetPassword(data: PasswordReSetModel) { } // 注册用户 -export function create(data: CreateRecord) { +export function register(data: CreateRecord) { return axios.post('/api/rest/user/register', data); } +// 新建用户 +export function create(data: CreateRecord) { + return axios.post('/api/rest/user', data); +} + // 模糊查询用户列表 export function queryUserList(params: any) { return axios({ @@ -158,6 +165,11 @@ export function deptAudit(id: string,roleId:string){ }); } +// 获取验证码 +export function code(data: string){ + return axios.get(`/api/rest/user/send-email?email=${data}`); +} + export function switchRole(roleId: number) { return axios.patch(`/api/user/self/switch-role/${roleId}`); } diff --git a/src/components/footer/index.vue b/src/components/footer/index.vue index 9a250cc..9ba905a 100644 --- a/src/components/footer/index.vue +++ b/src/components/footer/index.vue @@ -1,16 +1,16 @@ diff --git a/src/components/navbar/index.vue b/src/components/navbar/index.vue index cc2c7ae..70ca45e 100644 --- a/src/components/navbar/index.vue +++ b/src/components/navbar/index.vue @@ -2,10 +2,7 @@