diff --git a/mayfly_go_web/package.json b/mayfly_go_web/package.json index 2adec422..64dfe508 100644 --- a/mayfly_go_web/package.json +++ b/mayfly_go_web/package.json @@ -18,7 +18,7 @@ "crypto-js": "^4.2.0", "dayjs": "^1.11.13", "echarts": "^5.5.1", - "element-plus": "^2.8.5", + "element-plus": "^2.8.6", "js-base64": "^3.7.7", "jsencrypt": "^3.3.2", "lodash": "^4.17.21", @@ -57,7 +57,7 @@ "eslint": "^8.35.0", "eslint-plugin-vue": "^9.28.0", "prettier": "^3.2.5", - "sass": "^1.79.5", + "sass": "^1.80.3", "typescript": "^5.6.3", "vite": "^5.4.9", "vue-eslint-parser": "^9.4.3" diff --git a/mayfly_go_web/src/common/openApi.ts b/mayfly_go_web/src/common/openApi.ts index ac376b10..3295d195 100644 --- a/mayfly_go_web/src/common/openApi.ts +++ b/mayfly_go_web/src/common/openApi.ts @@ -14,4 +14,5 @@ export default { oauth2Callback: (params: any) => request.get('/auth/oauth2/callback', params), getLdapEnabled: () => request.get('/auth/ldap/enabled'), ldapLogin: (param: any) => request.post('/auth/ldap/login', param), + getFileDetail: (keys: string[]) => request.get(`/sys/files/detail/${keys.join(',')}`), }; diff --git a/mayfly_go_web/src/common/request.ts b/mayfly_go_web/src/common/request.ts index 6eadc092..a18fe704 100755 --- a/mayfly_go_web/src/common/request.ts +++ b/mayfly_go_web/src/common/request.ts @@ -209,6 +209,36 @@ export function joinClientParams(): string { return `token=${getToken()}&clientId=${getClientId()}`; } +/** + * 获取文件url地址 + * @param key 文件key + * @returns 文件url + */ +export function getFileUrl(key: string) { + return `${baseUrl}/sys/files/${key}`; +} + +/** + * 获取系统文件上传url + * @param key 文件key + * @returns 文件上传url + */ +export function getUploadFileUrl(key: string = '') { + return `${baseUrl}/sys/files/upload?token=${getToken()}&fileKey=${key}`; +} + +/** + * 下载文件 + * @param key 文件key + */ +export function downloadFile(key: string) { + const a = document.createElement('a'); + a.setAttribute('href', `${getFileUrl(key)}`); + a.setAttribute('target', '_blank'); + a.click(); + a.remove(); +} + function parseResult(result: Result) { if (result.code === ResultEnum.SUCCESS) { return result.data; diff --git a/mayfly_go_web/src/components/file/FileInfo.vue b/mayfly_go_web/src/components/file/FileInfo.vue new file mode 100644 index 00000000..71cb48d4 --- /dev/null +++ b/mayfly_go_web/src/components/file/FileInfo.vue @@ -0,0 +1,60 @@ + + + + + + {{ fileDetail.filename }} + + + + + diff --git a/mayfly_go_web/src/theme/base.scss b/mayfly_go_web/src/theme/base.scss index 62bc3fc2..744573f2 100644 --- a/mayfly_go_web/src/theme/base.scss +++ b/mayfly_go_web/src/theme/base.scss @@ -1 +1 @@ -@import 'common/transition.scss'; +@use 'common/transition.scss'; \ No newline at end of file diff --git a/mayfly_go_web/src/theme/element.scss b/mayfly_go_web/src/theme/element.scss index 17b39858..73a7fee8 100644 --- a/mayfly_go_web/src/theme/element.scss +++ b/mayfly_go_web/src/theme/element.scss @@ -1,4 +1,4 @@ -@import 'mixins/index.scss'; +@use 'mixins/index' as mixins; /* Button 按钮 ------------------------------- */ @@ -97,7 +97,7 @@ .el-sub-menu .iconfont, .el-menu-item .fa, .el-sub-menu .fa { - @include generalIcon; + @include mixins.generalIcon; } // 水平菜单、横向菜单高亮 背景色,鼠标 hover 时,有子级菜单的背景色 diff --git a/mayfly_go_web/src/theme/index.scss b/mayfly_go_web/src/theme/index.scss index ec6c0168..5193085a 100644 --- a/mayfly_go_web/src/theme/index.scss +++ b/mayfly_go_web/src/theme/index.scss @@ -1,8 +1,8 @@ -@import './app.scss'; -@import './base.scss'; -@import './other.scss'; -@import './element.scss'; -@import './media/media.scss'; -@import './waves.scss'; -@import './dark.scss'; -@import './iconSelector.scss'; \ No newline at end of file +@use './app.scss'; +@use './base.scss'; +@use './other.scss'; +@use './element.scss'; +@use './media/media.scss'; +@use './waves.scss'; +@use './dark.scss'; +@use './iconSelector.scss'; \ No newline at end of file diff --git a/mayfly_go_web/src/theme/media/chart.scss b/mayfly_go_web/src/theme/media/chart.scss index 8485e39c..c9814168 100644 --- a/mayfly_go_web/src/theme/media/chart.scss +++ b/mayfly_go_web/src/theme/media/chart.scss @@ -1,94 +1,109 @@ -@import './index.scss'; +@use './index.scss' as index; /* 页面宽度小于768px ------------------------------- */ -@media screen and (max-width: $sm) { - .big-data-down-left { - width: 100% !important; - flex-direction: unset !important; - flex-wrap: wrap; - .flex-warp-item { - min-height: 196.24px; - padding: 0 7.5px 15px 15px !important; - .flex-warp-item-box { - border: none !important; - border-bottom: 1px solid #ebeef5 !important; - } - } - } - .big-data-down-center { - width: 100% !important; - .big-data-down-center-one, - .big-data-down-center-two { - min-height: 196.24px; - padding-left: 15px !important; - .big-data-down-center-one-content { - border: none !important; - border-bottom: 1px solid #ebeef5 !important; - } - .flex-warp-item-box { - @extend .big-data-down-center-one-content; - } - } - } - .big-data-down-right { - .flex-warp-item { - .flex-warp-item-box { - border: none !important; - border-bottom: 1px solid #ebeef5 !important; - } - &:nth-of-type(2) { - padding-left: 15px !important; - } - &:last-of-type { - .flex-warp-item-box { - border: none !important; - } - } - } - } +@media screen and (max-width: index.$sm) { + .big-data-down-left { + width: 100% !important; + flex-direction: unset !important; + flex-wrap: wrap; + + .flex-warp-item { + min-height: 196.24px; + padding: 0 7.5px 15px 15px !important; + + .flex-warp-item-box { + border: none !important; + border-bottom: 1px solid #ebeef5 !important; + } + } + } + + .big-data-down-center { + width: 100% !important; + + .big-data-down-center-one, + .big-data-down-center-two { + min-height: 196.24px; + padding-left: 15px !important; + + .big-data-down-center-one-content { + border: none !important; + border-bottom: 1px solid #ebeef5 !important; + } + + .flex-warp-item-box { + @extend .big-data-down-center-one-content; + } + } + } + + .big-data-down-right { + .flex-warp-item { + .flex-warp-item-box { + border: none !important; + border-bottom: 1px solid #ebeef5 !important; + } + + &:nth-of-type(2) { + padding-left: 15px !important; + } + + &:last-of-type { + .flex-warp-item-box { + border: none !important; + } + } + } + } } /* 页面宽度大于768px小于1200px ------------------------------- */ -@media screen and (min-width: $sm) and (max-width: $lg) { - .chart-warp-bottom { - .big-data-down-left { - width: 50% !important; - } - .big-data-down-center { - width: 50% !important; - } - .big-data-down-right { - .flex-warp-item { - width: 50% !important; - &:nth-of-type(2) { - padding-left: 7.5px !important; - } - } - } - } +@media screen and (min-width: index.$sm) and (max-width: index.$lg) { + .chart-warp-bottom { + .big-data-down-left { + width: 50% !important; + } + + .big-data-down-center { + width: 50% !important; + } + + .big-data-down-right { + .flex-warp-item { + width: 50% !important; + + &:nth-of-type(2) { + padding-left: 7.5px !important; + } + } + } + } } /* 页面宽度小于1200px ------------------------------- */ -@media screen and (max-width: $lg) { - .chart-warp-top { - .up-left { - display: none; - } - } - .chart-warp-bottom { - overflow-y: auto !important; - flex-wrap: wrap; - .big-data-down-right { - width: 100% !important; - flex-direction: unset !important; - flex-wrap: wrap; - .flex-warp-item { - min-height: 196.24px; - padding: 0 7.5px 15px 15px !important; - } - } - } -} +@media screen and (max-width: index.$lg) { + .chart-warp-top { + .up-left { + display: none; + } + } + + .chart-warp-bottom { + overflow-y: auto !important; + flex-wrap: wrap; + + .big-data-down-right { + width: 100% !important; + flex-direction: unset !important; + flex-wrap: wrap; + + .flex-warp-item { + min-height: 196.24px; + padding: 0 7.5px 15px 15px !important; + } + } + } +} \ No newline at end of file diff --git a/mayfly_go_web/src/theme/media/cityLinkage.scss b/mayfly_go_web/src/theme/media/cityLinkage.scss index 1394156e..10f3e7dc 100644 --- a/mayfly_go_web/src/theme/media/cityLinkage.scss +++ b/mayfly_go_web/src/theme/media/cityLinkage.scss @@ -1,10 +1,10 @@ -@import './index.scss'; +@use './index.scss' as index; /* 页面宽度小于576px ------------------------------- */ -@media screen and (max-width: $xs) { - .el-cascader__dropdown.el-popper { - overflow: auto; - max-width: 100%; - } -} +@media screen and (max-width: index.$xs) { + .el-cascader__dropdown.el-popper { + overflow: auto; + max-width: 100%; + } +} \ No newline at end of file diff --git a/mayfly_go_web/src/theme/media/dialog.scss b/mayfly_go_web/src/theme/media/dialog.scss index 023ccae0..257c8c8c 100644 --- a/mayfly_go_web/src/theme/media/dialog.scss +++ b/mayfly_go_web/src/theme/media/dialog.scss @@ -1,12 +1,13 @@ -@import './index.scss'; +@use './index.scss'; /* 页面宽度小于800px ------------------------------- */ @media screen and (max-width: 800px) { - .el-dialog { - width: 90% !important; - } - .el-dialog.is-fullscreen { - width: 100% !important; - } -} + .el-dialog { + width: 90% !important; + } + + .el-dialog.is-fullscreen { + width: 100% !important; + } +} \ No newline at end of file diff --git a/mayfly_go_web/src/theme/media/error.scss b/mayfly_go_web/src/theme/media/error.scss index 727b7c41..35cc36b4 100644 --- a/mayfly_go_web/src/theme/media/error.scss +++ b/mayfly_go_web/src/theme/media/error.scss @@ -1,35 +1,38 @@ -@import './index.scss'; +@use './index.scss' as index; /* 页面宽度小于768px ------------------------------- */ -@media screen and (max-width: $sm) { - .error { - .error-flex { - flex-direction: column-reverse !important; - height: auto !important; - width: 100% !important; - } - .right, - .left { - flex: unset !important; - display: flex !important; - } - .left-item { - margin: auto !important; - } - .right img { - max-width: 450px !important; - @extend .left-item; - } - } +@media screen and (max-width: index.$sm) { + .error { + .error-flex { + flex-direction: column-reverse !important; + height: auto !important; + width: 100% !important; + } + + .right, + .left { + flex: unset !important; + display: flex !important; + } + + .left-item { + margin: auto !important; + } + + .right img { + max-width: 450px !important; + @extend .left-item; + } + } } /* 页面宽度大于768px小于992px ------------------------------- */ -@media screen and (min-width: $sm) and (max-width: $md) { - .error { - .error-flex { - padding-left: 30px !important; - } - } -} +@media screen and (min-width: index.$sm) and (max-width: index.$md) { + .error { + .error-flex { + padding-left: 30px !important; + } + } +} \ No newline at end of file diff --git a/mayfly_go_web/src/theme/media/form.scss b/mayfly_go_web/src/theme/media/form.scss index 7078e10a..7f4b23ca 100644 --- a/mayfly_go_web/src/theme/media/form.scss +++ b/mayfly_go_web/src/theme/media/form.scss @@ -1,13 +1,14 @@ -@import './index.scss'; +@use './index.scss' as index; /* 页面宽度小于576px ------------------------------- */ -@media screen and (max-width: $xs) { - .el-form-item__label { - width: 100% !important; - text-align: left !important; - } - .el-form-item__content { - margin-left: 0 !important; - } -} +@media screen and (max-width: index.$xs) { + .el-form-item__label { + width: 100% !important; + text-align: left !important; + } + + .el-form-item__content { + margin-left: 0 !important; + } +} \ No newline at end of file diff --git a/mayfly_go_web/src/theme/media/home.scss b/mayfly_go_web/src/theme/media/home.scss index 5005279f..a746468e 100644 --- a/mayfly_go_web/src/theme/media/home.scss +++ b/mayfly_go_web/src/theme/media/home.scss @@ -1,10 +1,11 @@ -@import './index.scss'; +@use './index.scss' as index; /* 页面宽度小于768px ------------------------------- */ -@media screen and (max-width: $sm) { - .home-warning-media, - .home-dynamic-media { - margin-top: 15px; - } -} +@media screen and (max-width: index.$sm) { + + .home-warning-media, + .home-dynamic-media { + margin-top: 15px; + } +} \ No newline at end of file diff --git a/mayfly_go_web/src/theme/media/layout.scss b/mayfly_go_web/src/theme/media/layout.scss index 77cbec0c..066335a8 100644 --- a/mayfly_go_web/src/theme/media/layout.scss +++ b/mayfly_go_web/src/theme/media/layout.scss @@ -1,55 +1,61 @@ -@import './index.scss'; +@use './index.scss' as index; /* 页面宽度小于576px ------------------------------- */ -@media screen and (max-width: $xs) { - // MessageBox 弹框 - .el-message-box { - width: 80% !important; - } +@media screen and (max-width: index.$xs) { + + // MessageBox 弹框 + .el-message-box { + width: 80% !important; + } } /* 页面宽度小于768px ------------------------------- */ -@media screen and (max-width: $sm) { - // Breadcrumb 面包屑 - .layout-navbars-breadcrumb-hide { - display: none; - } - // 外链视图 - .layout-view-link { - a { - max-width: 80%; - text-align: center; - } - } - // 菜单搜索 - .layout-search-dialog { - .el-autocomplete { - width: 80% !important; - } - } +@media screen and (max-width: index.$sm) { + + // Breadcrumb 面包屑 + .layout-navbars-breadcrumb-hide { + display: none; + } + + // 外链视图 + .layout-view-link { + a { + max-width: 80%; + text-align: center; + } + } + + // 菜单搜索 + .layout-search-dialog { + .el-autocomplete { + width: 80% !important; + } + } } /* 页面宽度小于1000px ------------------------------- */ @media screen and (max-width: 1000px) { - // 布局配置 - .layout-drawer-content-flex { - position: relative; - &::after { - content: '手机版不支持切换布局'; - position: absolute; - top: 0; - right: 0; - bottom: 0; - left: 0; - z-index: 1; - text-align: center; - height: 140px; - line-height: 140px; - background: rgba(255, 255, 255, 0.9); - color: #666666; - } - } -} + + // 布局配置 + .layout-drawer-content-flex { + position: relative; + + &::after { + content: '手机版不支持切换布局'; + position: absolute; + top: 0; + right: 0; + bottom: 0; + left: 0; + z-index: 1; + text-align: center; + height: 140px; + line-height: 140px; + background: rgba(255, 255, 255, 0.9); + color: #666666; + } + } +} \ No newline at end of file diff --git a/mayfly_go_web/src/theme/media/login.scss b/mayfly_go_web/src/theme/media/login.scss index abd727dc..bda1d8a9 100644 --- a/mayfly_go_web/src/theme/media/login.scss +++ b/mayfly_go_web/src/theme/media/login.scss @@ -1,21 +1,23 @@ -@import './index.scss'; +@use './index.scss' as index; /* 页面宽度小于576px ------------------------------- */ -@media screen and (max-width: $xs) { - .login-container { - .login-content { - width: 90% !important; - padding: 20px 0 !important; - } - .login-content-form-btn { - width: 100% !important; - padding: 12px 0 !important; - } - .login-copyright { - .login-copyright-msg { - white-space: unset !important; - } - } - } -} +@media screen and (max-width: index.$xs) { + .login-container { + .login-content { + width: 90% !important; + padding: 20px 0 !important; + } + + .login-content-form-btn { + width: 100% !important; + padding: 12px 0 !important; + } + + .login-copyright { + .login-copyright-msg { + white-space: unset !important; + } + } + } +} \ No newline at end of file diff --git a/mayfly_go_web/src/theme/media/media.scss b/mayfly_go_web/src/theme/media/media.scss index c470d5c8..dbdb4199 100644 --- a/mayfly_go_web/src/theme/media/media.scss +++ b/mayfly_go_web/src/theme/media/media.scss @@ -1,12 +1,12 @@ -@import './login.scss'; -@import './error.scss'; -@import './layout.scss'; -@import './personal.scss'; -@import './tagsView.scss'; -@import './home.scss'; -@import './chart.scss'; -@import './form.scss'; -@import './scrollbar.scss'; -@import './pagination.scss'; -@import './dialog.scss'; -@import './cityLinkage.scss'; +@use './login.scss'; +@use './error.scss'; +@use './layout.scss'; +@use './personal.scss'; +@use './tagsView.scss'; +@use './home.scss'; +@use './chart.scss'; +@use './form.scss'; +@use './scrollbar.scss'; +@use './pagination.scss'; +@use './dialog.scss'; +@use './cityLinkage.scss'; \ No newline at end of file diff --git a/mayfly_go_web/src/theme/media/pagination.scss b/mayfly_go_web/src/theme/media/pagination.scss index 400ebaaf..684099f8 100644 --- a/mayfly_go_web/src/theme/media/pagination.scss +++ b/mayfly_go_web/src/theme/media/pagination.scss @@ -1,15 +1,16 @@ -@import './index.scss'; +@use './index.scss' as index; /* 页面宽度小于576px ------------------------------- */ -@media screen and (max-width: $xs) { - .el-pager, - .el-pagination__jump { - display: none !important; - } +@media screen and (max-width: index.$xs) { + + .el-pager, + .el-pagination__jump { + display: none !important; + } } // 默认居中对齐 .el-pagination { - text-align: center !important; -} + text-align: center !important; +} \ No newline at end of file diff --git a/mayfly_go_web/src/theme/media/personal.scss b/mayfly_go_web/src/theme/media/personal.scss index 7ec0d4ab..84043d82 100644 --- a/mayfly_go_web/src/theme/media/personal.scss +++ b/mayfly_go_web/src/theme/media/personal.scss @@ -1,16 +1,18 @@ -@import './index.scss'; +@use './index.scss' as index; /* 页面宽度小于768px ------------------------------- */ -@media screen and (max-width: $sm) { - .personal-info { - padding-left: 0 !important; - margin-top: 15px; - } - .personal-recommend-col { - margin-bottom: 15px; - &:last-of-type { - margin-bottom: 0; - } - } -} +@media screen and (max-width: index.$sm) { + .personal-info { + padding-left: 0 !important; + margin-top: 15px; + } + + .personal-recommend-col { + margin-bottom: 15px; + + &:last-of-type { + margin-bottom: 0; + } + } +} \ No newline at end of file diff --git a/mayfly_go_web/src/theme/media/scrollbar.scss b/mayfly_go_web/src/theme/media/scrollbar.scss index cbba0434..7476d60c 100644 --- a/mayfly_go_web/src/theme/media/scrollbar.scss +++ b/mayfly_go_web/src/theme/media/scrollbar.scss @@ -1,56 +1,66 @@ -@import './index.scss'; +@use './index.scss' as index; /* 页面宽度小于768px ------------------------------- */ -@media screen and (max-width: $sm) { - // 滚动条的宽度 - ::-webkit-scrollbar { - width: 3px !important; - height: 3px !important; - } - ::-webkit-scrollbar-track-piece { - background-color: var(--bg-main-color); - } - // 滚动条的设置 - ::-webkit-scrollbar-thumb { - background-color: rgba(144, 147, 153, 0.3); - background-clip: padding-box; - min-height: 28px; - border-radius: 5px; - transition: 0.3s background-color; - } - ::-webkit-scrollbar-thumb:hover { - background-color: rgba(144, 147, 153, 0.5); - } - // element plus scrollbar - .el-scrollbar__bar.is-vertical { - width: 2px !important; - } - .el-scrollbar__bar.is-horizontal { - height: 2px !important; - } +@media screen and (max-width: index.$sm) { + + // 滚动条的宽度 + ::-webkit-scrollbar { + width: 3px !important; + height: 3px !important; + } + + ::-webkit-scrollbar-track-piece { + background-color: var(--bg-main-color); + } + + // 滚动条的设置 + ::-webkit-scrollbar-thumb { + background-color: rgba(144, 147, 153, 0.3); + background-clip: padding-box; + min-height: 28px; + border-radius: 5px; + transition: 0.3s background-color; + } + + ::-webkit-scrollbar-thumb:hover { + background-color: rgba(144, 147, 153, 0.5); + } + + // element plus scrollbar + .el-scrollbar__bar.is-vertical { + width: 2px !important; + } + + .el-scrollbar__bar.is-horizontal { + height: 2px !important; + } } /* 页面宽度大于768px ------------------------------- */ @media screen and (min-width: 769px) { - // 滚动条的宽度 - ::-webkit-scrollbar { - width: 7px; - height: 7px; - } - ::-webkit-scrollbar-track-piece { - background-color: var(--bg-main-color); - } - // 滚动条的设置 - ::-webkit-scrollbar-thumb { - background-color: rgba(144, 147, 153, 0.3); - background-clip: padding-box; - min-height: 28px; - border-radius: 5px; - transition: 0.3s background-color; - } - ::-webkit-scrollbar-thumb:hover { - background-color: rgba(144, 147, 153, 0.5); - } + + // 滚动条的宽度 + ::-webkit-scrollbar { + width: 7px; + height: 7px; + } + + ::-webkit-scrollbar-track-piece { + background-color: var(--bg-main-color); + } + + // 滚动条的设置 + ::-webkit-scrollbar-thumb { + background-color: rgba(144, 147, 153, 0.3); + background-clip: padding-box; + min-height: 28px; + border-radius: 5px; + transition: 0.3s background-color; + } + + ::-webkit-scrollbar-thumb:hover { + background-color: rgba(144, 147, 153, 0.5); + } } \ No newline at end of file diff --git a/mayfly_go_web/src/theme/media/tagsView.scss b/mayfly_go_web/src/theme/media/tagsView.scss index b71674ef..67afbe5f 100644 --- a/mayfly_go_web/src/theme/media/tagsView.scss +++ b/mayfly_go_web/src/theme/media/tagsView.scss @@ -1,11 +1,11 @@ -@import './index.scss'; +@use './index.scss' as index; /* 页面宽度小于768px ------------------------------- */ -@media screen and (max-width: $sm) { - .tags-view-form { - .tags-view-form-col { - margin-bottom: 20px; - } - } -} +@media screen and (max-width: index.$sm) { + .tags-view-form { + .tags-view-form-col { + margin-bottom: 20px; + } + } +} \ No newline at end of file diff --git a/mayfly_go_web/src/theme/mixins/index.scss b/mayfly_go_web/src/theme/mixins/index.scss index c06599a3..4d6ef642 100644 --- a/mayfly_go_web/src/theme/mixins/index.scss +++ b/mayfly_go_web/src/theme/mixins/index.scss @@ -1,32 +1,32 @@ /* 第三方图标字体间距/大小设置 ------------------------------- */ @mixin generalIcon { - font-size: 14px !important; - display: inline-block; - vertical-align: middle; - margin-right: 5px; - width: 24px; - text-align: center; - justify-content: center; + font-size: 14px !important; + display: inline-block; + vertical-align: middle; + margin-right: 5px; + width: 24px; + text-align: center; + justify-content: center; } /* 文本不换行 ------------------------------- */ @mixin text-no-wrap() { - text-overflow: ellipsis; - overflow: hidden; - white-space: nowrap; + text-overflow: ellipsis; + overflow: hidden; + white-space: nowrap; } /* 多行文本溢出 ------------------------------- */ @mixin text-ellipsis($line: 2) { - overflow: hidden; - word-break: break-all; - text-overflow: ellipsis; - display: -webkit-box; - -webkit-line-clamp: $line; - -webkit-box-orient: vertical; + overflow: hidden; + word-break: break-all; + text-overflow: ellipsis; + display: -webkit-box; + -webkit-line-clamp: $line; + -webkit-box-orient: vertical; } /* 滚动条(页面未使用) div 中使用: @@ -35,22 +35,26 @@ // @include scrollBar; // } @mixin scrollBar { - // 滚动条凹槽的颜色,还可以设置边框属性 - &::-webkit-scrollbar-track-piece { - background-color: #f8f8f8; - } - // 滚动条的宽度 - &::-webkit-scrollbar { - width: 9px; - height: 9px; - } - // 滚动条的设置 - &::-webkit-scrollbar-thumb { - background-color: #dddddd; - background-clip: padding-box; - min-height: 28px; - } - &::-webkit-scrollbar-thumb:hover { - background-color: #bbb; - } + + // 滚动条凹槽的颜色,还可以设置边框属性 + &::-webkit-scrollbar-track-piece { + background-color: #f8f8f8; + } + + // 滚动条的宽度 + &::-webkit-scrollbar { + width: 9px; + height: 9px; + } + + // 滚动条的设置 + &::-webkit-scrollbar-thumb { + background-color: #dddddd; + background-clip: padding-box; + min-height: 28px; + } + + &::-webkit-scrollbar-thumb:hover { + background-color: #bbb; + } } \ No newline at end of file diff --git a/mayfly_go_web/src/theme/other.scss b/mayfly_go_web/src/theme/other.scss index 9e8e950d..05fb26ee 100644 --- a/mayfly_go_web/src/theme/other.scss +++ b/mayfly_go_web/src/theme/other.scss @@ -1,28 +1,31 @@ /* wangeditor富文本编辑器 ------------------------------- */ .w-e-toolbar { - border: 1px solid #ebeef5 !important; - border-bottom: 1px solid #ebeef5 !important; - border-top-left-radius: 3px; - border-top-right-radius: 3px; - z-index: 2 !important; + border: 1px solid #ebeef5 !important; + border-bottom: 1px solid #ebeef5 !important; + border-top-left-radius: 3px; + border-top-right-radius: 3px; + z-index: 2 !important; } + .w-e-text-container { - border: 1px solid #ebeef5 !important; - border-top: none !important; - border-bottom-left-radius: 3px; - border-bottom-right-radius: 3px; - z-index: 1 !important; + border: 1px solid #ebeef5 !important; + border-top: none !important; + border-bottom-left-radius: 3px; + border-bottom-right-radius: 3px; + z-index: 1 !important; } /* web端自定义截屏 ------------------------------- */ #screenShotContainer { - z-index: 9998 !important; + z-index: 9998 !important; } + #toolPanel { - height: 42px !important; + height: 42px !important; } + #optionPanel { - height: 37px !important; -} + height: 37px !important; +} \ No newline at end of file diff --git a/mayfly_go_web/src/views/home/Home.vue b/mayfly_go_web/src/views/home/Home.vue index 88522beb..9ab75cca 100644 --- a/mayfly_go_web/src/views/home/Home.vue +++ b/mayfly_go_web/src/views/home/Home.vue @@ -1,621 +1,644 @@ - - - - - - - - - - - - - - {{ currentTime }},{{ userInfo.name }},生活变的再糟糕,也不妨碍我变得更好! - - - - - 用户名: - {{ userInfo.username }} - - - 角色: - {{ roleInfo }} - - - - - - - 上次登录IP: - {{ userInfo.lastLoginIp }} - - - 上次登录时间: - {{ formatDate(userInfo.lastLoginTime) }} - - - - - - - - + + + + + + + + + + + + + + {{ currentTime }},{{ userInfo.name }},生活变的再糟糕,也不妨碍我变得更好! + + + + + 用户名: + {{ userInfo.username }} + + + 角色: + {{ roleInfo }} + + + + + + + 上次登录IP: + {{ userInfo.lastLoginIp }} + + + 上次登录时间: + {{ formatDate(userInfo.lastLoginTime) }} + + + + + + + + - - - - - 消息通知 - 更多 - - - - - {{ `[${getMsgTypeDesc(v.type)}] ${v.msg}` }} - - - - - - + + + + + 消息通知 + 更多 + + + + + {{ `[${getMsgTypeDesc(v.type)}] ${v.msg}` }} + + + + + + - - - - - - - + + + + + + + {{ state.machine.num }} + + + + + + + + + {{ formatDate(scope.row.createTime) }} + + + + + + + + + + + + + + + + + + + + + + + + + {{ state.db.num }} + + + + + + + + + {{ formatDate(scope.row.createTime) }} + + + + + + + + + + + + + + + + + + + + + + + + + + + {{ state.redis.num }} + + + + + + + + + {{ formatDate(scope.row.createTime) }} + + + + + + + + + + + + + + + + + + + + + + + + + {{ state.mongo.num }} + + + + + + + + + {{ formatDate(scope.row.createTime) }} + + + + + + + + + + + + + + + + + + + + + + + + {{ getMsgTypeDesc(scope.row.type) }} + + + + + + {{ formatDate(scope.row.createTime) }} + + + + + - {{ state.machine.num }} - - - - - - - - {{ formatDate(scope.row.createTime) }} - - - - - - - - - - - - - - - - - - - - - - - - - {{ state.db.num }} - - - - - - - - - {{ formatDate(scope.row.createTime) }} - - - - - - - - - - - - - - - - - - - - - - - - - - - {{ state.redis.num }} - - - - - - - - - {{ formatDate(scope.row.createTime) }} - - - - - - - - - - - - - - - - - - - - - - - - - {{ state.mongo.num }} - - - - - - - - - {{ formatDate(scope.row.createTime) }} - - - - - - - - - - - - - - - - - - - - - - - - {{ getMsgTypeDesc(scope.row.type) }} - - - - - - {{ formatDate(scope.row.createTime) }} - - - - - - - - + + diff --git a/mayfly_go_web/src/views/login/component/AccountLogin.vue b/mayfly_go_web/src/views/login/component/AccountLogin.vue index 68c5722c..2939219b 100644 --- a/mayfly_go_web/src/views/login/component/AccountLogin.vue +++ b/mayfly_go_web/src/views/login/component/AccountLogin.vue @@ -144,6 +144,7 @@ import { personApi } from '@/views/personal/api'; import { AccountUsernamePattern } from '@/common/pattern'; import { getToken } from '@/common/utils/storage'; import { useThemeConfig } from '@/store/themeConfig'; +import { getFileUrl } from '@/common/request'; const rules = { username: [{ required: true, message: '请输入用户名', trigger: 'blur' }], @@ -347,26 +348,34 @@ const updateUserInfo = async () => { } }; -const loginResDeal = (loginRes: any) => { +const loginResDeal = async (loginRes: any) => { state.loginRes = loginRes; // 用户信息 const userInfos = { name: loginRes.name, username: loginRes.username, - // 头像 - photo: letterAvatar(loginRes.username), time: new Date().getTime(), lastLoginTime: loginRes.lastLoginTime, lastLoginIp: loginRes.lastLoginIp, + photo: '', }; + const avatarFileKey = `avatar_${loginRes.username}`; + const avatarFileDetail = await openApi.getFileDetail([avatarFileKey]); + // 说明存在头像文件 + if (avatarFileDetail.length > 0) { + userInfos.photo = getFileUrl(avatarFileKey); + } else { + userInfos.photo = letterAvatar(loginRes.username); + } + // 存储用户信息到浏览器缓存 saveUser(userInfos); // 1、请注意执行顺序(存储用户信息到vuex) useUserInfo().setUserInfo(userInfos); const token = loginRes.token; - // 如果不需要 otp校验,则该token即为accessToken,否则为otp校验token + // 如果不需要otp校验,则该token即为accessToken,否则为otp校验token if (loginRes.otp == -1) { signInSuccess(token, loginRes.refresh_token); return; diff --git a/mayfly_go_web/src/views/ops/db/DbList.vue b/mayfly_go_web/src/views/ops/db/DbList.vue index 486d24f9..7d0e3bbc 100644 --- a/mayfly_go_web/src/views/ops/db/DbList.vue +++ b/mayfly_go_web/src/views/ops/db/DbList.vue @@ -81,7 +81,7 @@ 导出 - @@ -98,7 +98,7 @@ v-if="actionBtns[perms.restoreDb] && supportAction('restoreDb', data.type)" > 恢复任务 - + --> diff --git a/mayfly_go_web/src/views/ops/db/DbTransferFile.vue b/mayfly_go_web/src/views/ops/db/DbTransferFile.vue index 322e90a1..b55b9ede 100644 --- a/mayfly_go_web/src/views/ops/db/DbTransferFile.vue +++ b/mayfly_go_web/src/views/ops/db/DbTransferFile.vue @@ -1,6 +1,6 @@ - + 删除 + + + + @@ -32,37 +36,16 @@ - - - 执行中 - 成功 - 失败 - - - 执行 - 重命名 - 下载 + 执行 日志 - - - - - - - - - - 取 消 - 确 定 - - - @@ -100,10 +83,10 @@ import { TableColumn } from '@/components/pagetable'; import { ElMessage, ElMessageBox } from 'element-plus'; import { hasPerms } from '@/components/auth/auth'; import TerminalLog from '@/components/terminal/TerminalLog.vue'; -import config from '@/common/config'; -import { joinClientParams } from '@/common/request'; import DbSelectTree from '@/views/ops/db/component/DbSelectTree.vue'; import { getClientId } from '@/common/utils/storage'; +import FileInfo from '@/components/file/FileInfo.vue'; +import { DbTransferFileStatusEnum } from './enums'; const props = defineProps({ data: { type: [Object], @@ -116,22 +99,21 @@ const props = defineProps({ const dialogVisible = defineModel('visible', { default: false }); const columns = ref([ - TableColumn.new('fileName', '文件名').setMinWidth(150), - TableColumn.new('createTime', '创建时间').setMinWidth(180).isTime(), + TableColumn.new('fileKey', '文件').setMinWidth(280).isSlot(), + TableColumn.new('createTime', '执行时间').setMinWidth(180).isTime(), TableColumn.new('fileDbType', 'sql语言').setMinWidth(90).isSlot(), - TableColumn.new('status', '状态').isSlot(), + TableColumn.new('status', '状态').typeTag(DbTransferFileStatusEnum), ]); const perms = { del: 'db:transfer:files:del', down: 'db:transfer:files:down', - rename: 'db:transfer:files:rename', run: 'db:transfer:files:run', }; -const actionBtns = hasPerms([perms.del, perms.down, perms.rename, perms.run]); +const actionBtns = hasPerms([perms.del, perms.down, perms.run]); -const actionWidth = ((actionBtns[perms.rename] ? 1 : 0) + (actionBtns[perms.down] ? 1 : 0) + (actionBtns[perms.run] ? 1 : 0) + 1) * 55; +const actionWidth = ((actionBtns[perms.run] ? 1 : 0) + 1) * 55; const actionColumn = TableColumn.new('action', '操作').isSlot().setMinWidth(actionWidth).fixedRight().alignCenter(); @@ -141,7 +123,6 @@ onMounted(async () => { } }); -const renameFormRef: any = ref(null); const runFormRef: any = ref(null); const state = reactive({ @@ -210,31 +191,6 @@ const state = reactive({ } }, }, - renameDialog: { - visible: false, - title: '文件重命名', - renameForm: { - id: 0, - fileName: '', - }, - loading: false, - cancel: function () { - state.renameDialog.visible = false; - state.renameDialog.renameForm = { id: 0, fileName: '' }; - }, - btnOk: function () { - renameFormRef.value.validate(async (valid: boolean) => { - if (!valid) { - ElMessage.error('请正确填写信息'); - return false; - } - await dbApi.dbTransferFileRename.request(state.renameDialog.renameForm); - ElMessage.success('保存成功'); - state.renameDialog.cancel(); - await search(); - }); - }, - }, selectionData: [], // 选中的数据 tableData: [], }); @@ -262,18 +218,6 @@ const del = async function () { } }; -const down = function (data: any) { - const a = document.createElement('a'); - a.setAttribute('target', '_blank'); - a.setAttribute('href', `${config.baseApiUrl}/dbTransfer/files/down/${data.fileUuid}?${joinClientParams()}`); - a.click(); - a.remove(); -}; -const rename = function (data: any) { - state.renameDialog.visible = true; - const { id, fileName } = data; - state.renameDialog.renameForm = { id, fileName }; -}; const openLog = function (data: any) { state.logsDialog.logId = data.logId; state.logsDialog.visible = true; diff --git a/mayfly_go_web/src/views/ops/db/api.ts b/mayfly_go_web/src/views/ops/db/api.ts index 24d55bfb..dcce5e46 100644 --- a/mayfly_go_web/src/views/ops/db/api.ts +++ b/mayfly_go_web/src/views/ops/db/api.ts @@ -1,5 +1,5 @@ import Api from '@/common/Api'; -import {AesEncrypt} from '@/common/crypto'; +import { AesEncrypt } from '@/common/crypto'; export const dbApi = { // 获取权限列表 @@ -80,7 +80,6 @@ export const dbApi = { dbTransferTaskLogs: Api.newGet('/dbTransfer/{taskId}/logs'), dbTransferFileList: Api.newGet('/dbTransfer/files/{taskId}'), dbTransferFileDel: Api.newPost('/dbTransfer/files/del/{fileId}'), - dbTransferFileRename: Api.newPost('/dbTransfer/files/rename'), dbTransferFileRun: Api.newPost('/dbTransfer/files/run'), dbTransferFileDown: Api.newGet('/dbTransfer/files/down/{fileUuid}'), }; diff --git a/mayfly_go_web/src/views/ops/db/component/table/DbTableOp.vue b/mayfly_go_web/src/views/ops/db/component/table/DbTableOp.vue index db369d0d..29107745 100644 --- a/mayfly_go_web/src/views/ops/db/component/table/DbTableOp.vue +++ b/mayfly_go_web/src/views/ops/db/component/table/DbTableOp.vue @@ -160,7 +160,7 @@ const props = defineProps({ //定义事件 const emit = defineEmits(['update:visible', 'cancel', 'val-change', 'submit-sql']); -let dbDialect = computed(() => getDbDialect(props.dbType!, props.version)); +let dbDialect: any = computed(() => getDbDialect(props.dbType!, props.version)); type ColName = { prop: string; diff --git a/mayfly_go_web/src/views/ops/db/enums.ts b/mayfly_go_web/src/views/ops/db/enums.ts index 8b89c739..44baff19 100644 --- a/mayfly_go_web/src/views/ops/db/enums.ts +++ b/mayfly_go_web/src/views/ops/db/enums.ts @@ -43,3 +43,9 @@ export const DbTransferRunningStateEnum = { Fail: EnumValue.of(-1, '失败').setTagType('danger'), Stop: EnumValue.of(-2, '手动终止').setTagType('warning'), }; + +export const DbTransferFileStatusEnum = { + Running: EnumValue.of(1, '执行中').setTagType('primary'), + Success: EnumValue.of(2, '成功').setTagType('success'), + Fail: EnumValue.of(-1, '失败').setTagType('danger'), +}; diff --git a/mayfly_go_web/src/views/ops/machine/MachineRec.vue b/mayfly_go_web/src/views/ops/machine/MachineRec.vue index d5e2f9c8..460a6f08 100644 --- a/mayfly_go_web/src/views/ops/machine/MachineRec.vue +++ b/mayfly_go_web/src/views/ops/machine/MachineRec.vue @@ -10,6 +10,10 @@ @open="getTermOps()" > + + + + 回放 命令 @@ -49,6 +53,8 @@ import 'asciinema-player/dist/bundle/asciinema-player.css'; import PageTable from '@/components/pagetable/PageTable.vue'; import { TableColumn } from '@/components/pagetable'; import { formatDate } from '@/common/utils/format'; +import { getFileUrl } from '@/common/request'; +import FileInfo from '@/components/file/FileInfo.vue'; const props = defineProps({ visible: { type: Boolean }, @@ -62,7 +68,7 @@ const columns = [ TableColumn.new('creator', '操作者').setMinWidth(120), TableColumn.new('createTime', '开始时间').isTime().setMinWidth(150), TableColumn.new('endTime', '结束时间').isTime().setMinWidth(150), - TableColumn.new('recordFilePath', '文件路径').setMinWidth(200), + TableColumn.new('fileKey', '文件').isSlot(), TableColumn.new('action', '操作').isSlot().setMinWidth(120).fixedRight().alignCenter(), ]; @@ -109,14 +115,9 @@ const playRec = async (rec: any) => { player.dispose(); } rec.playRecLoding = true; - const content = await machineApi.termOpRec.request({ - recId: rec.id, - id: rec.machineId, - }); - state.playerDialogVisible = true; nextTick(() => { - player = AsciinemaPlayer.create(`data:text/plain;base64,${content}`, playerRef.value, { + player = AsciinemaPlayer.create(getFileUrl(rec.fileKey), playerRef.value, { autoPlay: true, speed: 1.0, idleTimeLimit: 2, diff --git a/mayfly_go_web/src/views/ops/machine/api.ts b/mayfly_go_web/src/views/ops/machine/api.ts index 35b6627e..4fd7e626 100644 --- a/mayfly_go_web/src/views/ops/machine/api.ts +++ b/mayfly_go_web/src/views/ops/machine/api.ts @@ -47,8 +47,6 @@ export const machineApi = { delConf: Api.newDelete('/machines/{machineId}/files/{id}'), // 机器终端操作记录列表 termOpRecs: Api.newGet('/machines/{machineId}/term-recs'), - // 机器终端操作记录详情 - termOpRec: Api.newGet('/machines/{id}/term-recs/{recId}'), }; export const cronJobApi = { diff --git a/mayfly_go_web/src/views/personal/index.vue b/mayfly_go_web/src/views/personal/index.vue index 2337a753..4b1f9abd 100644 --- a/mayfly_go_web/src/views/personal/index.vue +++ b/mayfly_go_web/src/views/personal/index.vue @@ -118,7 +118,7 @@ const unbindOAuth2 = async () => {