From 2db2de1f37f8d5113cf1bed7d469c8ecb7f0e2b2 Mon Sep 17 00:00:00 2001 From: ruibaby Date: Thu, 12 Dec 2019 13:14:40 +0800 Subject: [PATCH] feat: performance optimization. --- src/api/static.js | 14 +++ src/components/global.less | 73 +++++++++++- src/views/attachment/AttachmentList.vue | 1 - src/views/exception/ExceptionPage.vue | 50 -------- src/views/interface/MenuList.vue | 2 +- src/views/interface/ThemeEdit.vue | 12 +- src/views/interface/ThemeList.vue | 2 +- src/views/post/CategoryList.vue | 2 +- src/views/post/PostEdit.vue | 2 +- src/views/post/PostList.vue | 2 +- src/views/post/TagList.vue | 2 +- src/views/sheet/SheetEdit.vue | 2 +- src/views/sheet/SheetList.vue | 2 +- src/views/sheet/internal/JournalList.vue | 2 +- src/views/sheet/internal/LinkList.vue | 2 +- src/views/sheet/internal/PhotoList.vue | 49 ++------ src/views/system/About.vue | 2 +- src/views/system/OptionForm.vue | 2 +- src/views/system/ToolList.vue | 2 +- .../system/developer/DeveloperOptions.vue | 12 +- .../developer/tabs/ApplicationConfig.vue | 9 -- .../system/developer/tabs/RuntimeLogs.vue | 9 -- .../system/developer/tabs/StaticStorage.vue | 107 ++++++++++++++++++ src/views/user/Profile.vue | 85 +++++++------- 24 files changed, 261 insertions(+), 186 deletions(-) create mode 100644 src/api/static.js create mode 100644 src/views/system/developer/tabs/StaticStorage.vue diff --git a/src/api/static.js b/src/api/static.js new file mode 100644 index 000000000..d031466e7 --- /dev/null +++ b/src/api/static.js @@ -0,0 +1,14 @@ +import service from '@/utils/service' + +const baseUrl = '/api/admin/statics' + +const staticApi = {} + +staticApi.list = () => { + return service({ + url: baseUrl, + method: 'get' + }) +} + +export default staticApi diff --git a/src/components/global.less b/src/components/global.less index 3772764a8..202da809e 100644 --- a/src/components/global.less +++ b/src/components/global.less @@ -513,7 +513,7 @@ body { } -.ant-table-thead > tr > th{ +.ant-table-thead>tr>th { background: #fff !important; } @@ -596,6 +596,7 @@ body { p { margin-top: 1rem; margin-bottom: 0; + img { width: 100%; } @@ -719,13 +720,14 @@ body { float: left; } -.attach-thumb { +.attach-thumb,.photo-thumb { width: 100%; padding-bottom: 56%; } .attach-item, -.attach-thumb { +.attach-thumb, +.photo-thumb { margin: 0 auto; position: relative; overflow: hidden; @@ -788,4 +790,69 @@ body { li { overflow: hidden; } +} + +.exception { + min-height: 500px; + height: 80%; + align-items: center; + text-align: center; + margin-top: 150px; + + .img { + display: inline-block; + padding-right: 52px; + zoom: 1; + + img { + height: 360px; + max-width: 430px; + } + } + + .content { + display: inline-block; + flex: auto; + + h1 { + color: #434e59; + font-size: 72px; + font-weight: 600; + line-height: 72px; + margin-bottom: 24px; + } + + .desc { + color: rgba(0, 0, 0, 0.45); + font-size: 20px; + line-height: 28px; + margin-bottom: 16px; + } + } +} + +.mobile { + .exception { + margin-top: 30px; + + .img { + padding-right: unset; + + img { + height: 40%; + max-width: 80%; + } + } + } +} + +.vue-codemirror-wrap { + .CodeMirror { + height: 560px; + } + + .CodeMirror-gutters { + border-right: 1px solid #fff3f3; + background-color: #ffffff; + } } \ No newline at end of file diff --git a/src/views/attachment/AttachmentList.vue b/src/views/attachment/AttachmentList.vue index d04479a42..e645b3e41 100644 --- a/src/views/attachment/AttachmentList.vue +++ b/src/views/attachment/AttachmentList.vue @@ -7,7 +7,6 @@ > - - diff --git a/src/views/interface/MenuList.vue b/src/views/interface/MenuList.vue index c34728db1..611f117ee 100644 --- a/src/views/interface/MenuList.vue +++ b/src/views/interface/MenuList.vue @@ -1,5 +1,5 @@