From 4a785953a5069d2e653b47e7bf1dfbaa137ed426 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A6=96=E5=A7=90?= <2981176548@qq.com> Date: Thu, 18 Apr 2024 16:05:01 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=A1=E6=81=AF=E6=A8=A1=E5=9D=97=E5=AE=8C?= =?UTF-8?q?=E6=88=90=EF=BC=8C=E5=AE=A1=E6=89=B9=E5=81=87=E7=95=8C=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- auto-imports.d.ts | 2 - components.d.ts | 4 + src/api/examine.js | 57 ++++ src/api/message.js | 20 +- src/layout/components/Navbar.vue | 3 +- src/router/index.ts | 78 +++-- src/store/modules/user.ts | 2 + src/utils/request.js | 4 +- src/views/error-log/index.vue | 333 ++++++++++++--------- src/views/excel/export-excel.vue | 221 +++++++------- src/views/excel/merge-header.vue | 106 ------- src/views/excel/select-excel.vue | 493 ++++++++++++++++++++++++------- src/views/excel/upload-excel.vue | 292 +++++++++++++++--- src/views/login/index.vue | 4 +- 14 files changed, 1067 insertions(+), 552 deletions(-) create mode 100644 src/api/examine.js delete mode 100644 src/views/excel/merge-header.vue diff --git a/auto-imports.d.ts b/auto-imports.d.ts index 07b6235..8139ac9 100644 --- a/auto-imports.d.ts +++ b/auto-imports.d.ts @@ -2,6 +2,4 @@ export {} declare global { const ElMessage: typeof import('element-plus/es')['ElMessage'] - const ElMessageBox: typeof import('element-plus/es')['ElMessageBox'] - const ElNotification: typeof import('element-plus/es')['ElNotification'] } diff --git a/components.d.ts b/components.d.ts index 6de8fe2..4da0c1e 100644 --- a/components.d.ts +++ b/components.d.ts @@ -36,6 +36,7 @@ declare module '@vue/runtime-core' { ElMenuItem: typeof import('element-plus/es')['ElMenuItem'] ElOption: typeof import('element-plus/es')['ElOption'] ElPagination: typeof import('element-plus/es')['ElPagination'] + ElPopconfirm: typeof import('element-plus/es')['ElPopconfirm'] ElProgress: typeof import('element-plus/es')['ElProgress'] ElRadio: typeof import('element-plus/es')['ElRadio'] ElRadioGroup: typeof import('element-plus/es')['ElRadioGroup'] @@ -75,4 +76,7 @@ declare module '@vue/runtime-core' { UploadExcel: typeof import('./src/components/UploadExcel/index.vue')['default'] VueCountTo: typeof import('./src/components/vue-count-to/vue-countTo.vue')['default'] } + export interface ComponentCustomProperties { + vLoading: typeof import('element-plus/es')['ElLoadingDirective'] + } } diff --git a/src/api/examine.js b/src/api/examine.js new file mode 100644 index 0000000..e06f4c8 --- /dev/null +++ b/src/api/examine.js @@ -0,0 +1,57 @@ +import request from '../utils/request'; +function getCurrentTimestamp() { + return new Date().getTime(); +} + + +// 提交申请 +export function ReviewAdd(data, token) { + return request({ + url: '/review/add', + method: 'post', + params: data, + headers: { + 'Authorization':'Bearer '+token, + 'Timestamp':getCurrentTimestamp() + } + }); +} +// 获取我的审核列表 +export function GetMyReview(data, token) { + return request({ + url: '/review/getMyReview', + method: 'get', + params: data, + headers: { + 'Authorization':'Bearer '+token, + 'Timestamp':getCurrentTimestamp() + } + }); +} + +//修改审核状态 +// id result +export function UpdateReviewResult(data, token) { + return request({ + url: '/review/updateReviewResult', + method: 'get', + params: data, + headers: { + 'Authorization':'Bearer '+token, + 'Timestamp':getCurrentTimestamp() + } + }); +} + +//获取审核记录 +export function ReviewRecords(data, token) { + return request({ + url: '/review/getReviewRecords', + method: 'get', + params: data, + headers: { + 'Authorization':'Bearer '+token, + 'Timestamp':getCurrentTimestamp() + } + }); +} \ No newline at end of file diff --git a/src/api/message.js b/src/api/message.js index b06a0a6..4d5aacc 100644 --- a/src/api/message.js +++ b/src/api/message.js @@ -1,15 +1,29 @@ +import request from '../utils/request'; function getCurrentTimestamp() { return new Date().getTime(); } -export function login(data) { +export function messageGet(data, token) { return request({ url: '/message/get', - method: 'post', - data, + method: 'get', + params: data, headers: { + 'Authorization':'Bearer '+token, 'Timestamp':getCurrentTimestamp() } }); +} + +export function messageDelete(data, token) { + return request({ + url: '/message/delete', + method: 'delete', + params: data, + headers: { + 'Authorization':'Bearer '+token, + 'Timestamp':getCurrentTimestamp() + } + }) } \ No newline at end of file diff --git a/src/layout/components/Navbar.vue b/src/layout/components/Navbar.vue index 88c2bf4..576b838 100644 --- a/src/layout/components/Navbar.vue +++ b/src/layout/components/Navbar.vue @@ -89,8 +89,9 @@ export default defineComponent({ async logout() { console.log('5989569898') // store.user().login() - // await store.user().logout(); + // await store.user().logoutBug(); await store.user().logout(); + // await store.user().logoutTest(); this.$router.push(`/login?redirect=${this.$route.fullPath}`); } } diff --git a/src/router/index.ts b/src/router/index.ts index 3e8bd0d..d1a2439 100644 --- a/src/router/index.ts +++ b/src/router/index.ts @@ -163,7 +163,7 @@ export const asyncRoutes:RouteRecordRaw[] = [ alwaysShow: true, // will always show the root menu title: '个人项目', icon: 'nested', - roles: ['admin', 'teacher_user'] + roles: ['admin', 'teacher_user', 'principle', 'developer', 'console'] }, children: [ { @@ -171,21 +171,21 @@ export const asyncRoutes:RouteRecordRaw[] = [ path: 'charge', component: () => import('@/views/personal/project/charge.vue'), name: 'Charge', - meta: { title: '我负责的', icon: 'user', affix: true } + meta: { title: '我负责的', icon: 'user', affix: true, role: ['console'] } }, { // 我管理的 path: 'manage', component: () => import('@/views/personal/project/manage.vue'), name: 'Manage', - meta: { title: '我管理的', icon: 'user', affix: true } + meta: { title: '我管理的', icon: 'user', affix: true, role: ['principle', 'developer', 'console'] } }, { // 我参与的 path: 'participate', component: () => import('@/views/personal/project/participate.vue'), name: 'Participate', - meta: { title: '我参与的', icon: 'user', affix: true } + meta: { title: '我参与的', icon: 'user', affix: true, role: ['principle', 'developer', 'console'] } }, @@ -253,7 +253,7 @@ export const asyncRoutes:RouteRecordRaw[] = [ path: 'd', component: () => import('@/views/tab/index.vue'), name: 'Tab', - meta: { title: '日报', icon: 'tab' } + meta: { title: '日报', icon: 'tab', role: ['principle', 'developer', 'console'] } } ] }, @@ -291,47 +291,41 @@ export const asyncRoutes:RouteRecordRaw[] = [ path: 'ms', component: () => import('@/views/error-log/index.vue'), name: 'ErrorLog', - meta: { title: '信息', icon: 'bug' } + meta: { title: '信息', icon: 'bug', role: ['principle', 'developer', 'console'] } } ] }, - // { - // path: '/excel', - // component: Layout, - // redirect: '/excel/export-excel', - // name: 'Excel', - // meta: { - // title: 'Excel', - // icon: 'excel' - // }, - // children: [ - // { - // path: 'export-excel', - // component: () => import('@/views/excel/export-excel.vue'), - // name: 'ExportExcel', - // meta: { title: 'Export Excel' } - // }, - // { - // path: 'export-selected-excel', - // component: () => import('@/views/excel/select-excel.vue'), - // name: 'SelectExcel', - // meta: { title: 'Export Selected' } - // }, - // { - // path: 'export-merge-header', - // component: () => import('@/views/excel/merge-header.vue'), - // name: 'MergeHeader', - // meta: { title: 'Merge Header' } - // }, - // { - // path: 'upload-excel', - // component: () => import('@/views/excel/upload-excel.vue'), - // name: 'UploadExcel', - // meta: { title: 'Upload Excel' } - // } - // ] - // }, + { + path: '/excel', + component: Layout, + redirect: '/excel/export-excel', + name: 'Excel', + meta: { + title: '申请和审批', + icon: 'excel' + }, + children: [ + { + path: 'export-excel', + component: () => import('@/views/excel/export-excel.vue'), + name: 'ExportExcel', + meta: { title: '提交申请' } + }, + { + path: 'export-selected-excel', + component: () => import('@/views/excel/select-excel.vue'), + name: 'SelectExcel', + meta: { title: '我的审批' } + }, + { + path: 'export-update-excel', + component: () => import('@/views/excel/upload-excel.vue'), + name: 'MergeHeader', + meta: { title: '记录查询' } + } + ] + }, // { // path: '/zip', diff --git a/src/store/modules/user.ts b/src/store/modules/user.ts index 7d2e77d..c33b99a 100644 --- a/src/store/modules/user.ts +++ b/src/store/modules/user.ts @@ -131,6 +131,7 @@ export default defineStore({ }); }, + //logoutBug: 只删除后端的token,不删除浏览器的token logoutBug():Promise { console.log("token",this.token) return new Promise((resolve, reject) => { @@ -148,6 +149,7 @@ export default defineStore({ }); }, + //logoutTest: 只删除浏览器的token,后端不删除 logoutTest(): void { removeToken(); console.log("removeTokenTestSuccess"); diff --git a/src/utils/request.js b/src/utils/request.js index 16fa54b..7afa1a7 100644 --- a/src/utils/request.js +++ b/src/utils/request.js @@ -15,9 +15,9 @@ const service = axios.create({ // request interceptor service.interceptors.request.use( + config => { // do something before request is sent - if (store.user().token) { // let each request carry token // ['X-Token'] is a custom headers key @@ -48,7 +48,7 @@ service.interceptors.response.use( response => { const res = response.data; // console.log("removeToken:",removeToken()) - console.log('999999',res) + console.log('999999',response) if (res.code === 40103) { store.user().logoutTest(); console.log("返回登录成功") diff --git a/src/views/error-log/index.vue b/src/views/error-log/index.vue index 26e7ae0..03ca7e3 100644 --- a/src/views/error-log/index.vue +++ b/src/views/error-log/index.vue @@ -6,41 +6,21 @@ 消息
-
- 时间 - -
- - - - - - - - - - - - - - - - - +
+ 时间 + +
- 查询 - 重置 + 查询 + 重置
@@ -49,44 +29,53 @@
历史记录 + 总数:{{messageData.total}}
-
-
-
- {{row.name}} +
+
+
+ + {{row.senderName}} {{ row.text }} + +
+
+ {{ formatDateTime(row.createdAt) }} +
+
+ Delete + + + 是否确认删除此条信息? + + +
-
-
{{ row.createdAt }}
-
-
- Delete - - -是否确认删除此条信息? - - - -
+ + + + + + + @@ -95,66 +84,86 @@ +.selectedContent{ + margin-left: 35vw; + margin-top:5vh +} +.selectedChild{ + margin-left: 7.7vw; +} + \ No newline at end of file diff --git a/src/views/excel/merge-header.vue b/src/views/excel/merge-header.vue deleted file mode 100644 index 2e0eb53..0000000 --- a/src/views/excel/merge-header.vue +++ /dev/null @@ -1,106 +0,0 @@ - - - diff --git a/src/views/excel/select-excel.vue b/src/views/excel/select-excel.vue index ffb457e..5e74aa9 100644 --- a/src/views/excel/select-excel.vue +++ b/src/views/excel/select-excel.vue @@ -1,113 +1,396 @@ - + + \ No newline at end of file diff --git a/src/views/excel/upload-excel.vue b/src/views/excel/upload-excel.vue index fc15d6d..3b7ced0 100644 --- a/src/views/excel/upload-excel.vue +++ b/src/views/excel/upload-excel.vue @@ -1,43 +1,267 @@ - + + \ No newline at end of file diff --git a/src/views/login/index.vue b/src/views/login/index.vue index 7f54039..9e33c0e 100644 --- a/src/views/login/index.vue +++ b/src/views/login/index.vue @@ -113,8 +113,8 @@ export default defineComponent({ }; return { loginForm: { - username: 'teacher_user', - password: '123456' + username: 'principal_user', + password: 'jsl_nbxt' }, loginRules: { username: [{ required: true, trigger: 'blur', validator: validateUsername }],