Skip to content

Commit 3c548ab

Browse files
authoredApr 9, 2021
feat(*): Continuously optimize code (#441)
re #440
1 parent 5842c05 commit 3c548ab

File tree

21 files changed

+3909
-5873
lines changed

21 files changed

+3909
-5873
lines changed
 

‎.editorconfig

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# editorconfig.org
2+
root = true
3+
4+
[*]
5+
indent_style = space
6+
indent_size = 2
7+
end_of_line = lf
8+
charset = utf-8
9+
trim_trailing_whitespace = true
10+
insert_final_newline = true
11+
12+
[*.md]
13+
trim_trailing_whitespace = false

‎.eslintrc.js

+9
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,19 @@ module.exports = {
2929
'no-use-before-define': 'off',
3030
'no-prototype-builtins': 'off',
3131
'class-methods-use-this': 'off',
32+
'template-curly-spacing': 'off',
3233
'arrow-parens': ['error', 'as-needed'],
3334
'comma-dangle': ['error', 'only-multiline'],
3435
'no-param-reassign': ['error', { props: false }],
3536
'import/no-extraneous-dependencies': ['error', { devDependencies: ['script/**/*.js'] }],
37+
indent: [
38+
'warn',
39+
2,
40+
{
41+
ignoredNodes: ['TemplateLiteral'],
42+
SwitchCase: 1,
43+
},
44+
],
3645
'object-curly-newline': [
3746
'error',
3847
{

‎package-lock.json

+3,813-5,777
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎src/app.vue

-10
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,10 @@
33
</template>
44

55
<script>
6-
import { mapActions } from 'vuex'
7-
86
export default {
9-
data() {
10-
return {
11-
timer: null,
12-
}
13-
},
147
mounted() {
158
document.getElementById('loader').style.display = 'none'
169
},
17-
methods: {
18-
...mapActions(['loginOut']),
19-
},
2010
}
2111
</script>
2212

‎src/assets/style/index.scss

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
@import './realize/reset';
22
@import './realize/animation';
33
@import './realize/transition';
4-
@import './realize/global';
54

65
.lin-container {
76
.el-divider--horizontal {
@@ -20,4 +19,4 @@
2019
.lin-wrap {
2120
padding: 20px;
2221
}
23-
}
22+
}

‎src/assets/style/realize/animation.scss

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
@keyframes fadeIn {
1+
@keyframes fade {
22
from {
33
opacity: 0.1;
44
}

‎src/assets/style/realize/element-variable.scss

+22-22
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ $--font-path: "~element-plus/lib/theme-chalk/fonts";
6565
color: #fff !important;
6666
background: #3963bc !important;
6767
border: 1px solid #3963bc !important;
68-
68+
6969
&:hover,
7070
&:focus {
7171
color: #fff !important;
@@ -384,7 +384,7 @@ thead tr {
384384
width: 4px;
385385
height: 4px;
386386
border-radius: 50%;
387-
border: 1px solid $submenu-title;
387+
border: 1px solid $sub-menu-title;
388388
position: absolute;
389389
left: 45px;
390390
top: 23px;
@@ -460,59 +460,59 @@ thead tr {
460460

461461
.el-submenu.is-active.is-opened {
462462
.el-submenu__title {
463-
color: $submenu-title !important;
464-
background: $menuItem-bg !important;
463+
color: $sub-menu-title !important;
464+
background: $menu-item-bg !important;
465465
height: 50px;
466466

467467
&:hover {
468-
background: $menuItem-hover !important;
468+
background: $menu-item-hover !important;
469469
}
470470

471471
i {
472-
color: $submenu-title;
472+
color: $sub-menu-title;
473473
}
474474
}
475475
}
476476

477477
.is-opened {
478478
.el-submenu__title {
479-
height: $menuItem-height;
479+
height: $menu-item-height;
480480
transition: border-color 0s, background-color 0s, color 0s;
481481
}
482482

483483
.el-menu--inline {
484-
background: $menuItem-bg !important;
484+
background: $menu-item-bg !important;
485485

486486
&:hover {
487-
background-color: $menuItem-hover !important;
487+
background-color: $menu-item-hover !important;
488488
}
489489
}
490490

491491
.el-submenu__title {
492-
background: $menuItem-bg !important;
492+
background: $menu-item-bg !important;
493493

494494
&:hover {
495-
background-color: $menuItem-hover !important;
495+
background-color: $menu-item-hover !important;
496496
}
497497
}
498498

499499
.el-menu-item {
500-
background: $menuItem-bg !important;
500+
background: $menu-item-bg !important;
501501

502502
&:hover {
503-
background-color: $menuItem-hover !important;
503+
background-color: $menu-item-hover !important;
504504
}
505505
}
506506
}
507507

508508
.el-menu-item {
509509
//display: flex;
510510
//align-items: center;
511-
height: $menuItem-height;
511+
height: $menu-item-height;
512512
transition: border-color 0s, background-color 0s, color 0s;
513513

514514
&:hover {
515-
background-color: $menuItem-hover;
515+
background-color: $menu-item-hover;
516516
}
517517
}
518518

@@ -533,14 +533,14 @@ thead tr {
533533

534534
.el-submenu__title {
535535
// display: flex;
536-
height: $menuItem-height;
536+
height: $menu-item-height;
537537
align-items: center;
538538
line-height: 50px;
539539
// padding-left: 17px !important;
540540
box-sizing: border-box;
541541

542542
i {
543-
color: $submenu-title;
543+
color: $sub-menu-title;
544544
}
545545
}
546546

@@ -549,7 +549,7 @@ thead tr {
549549
// margin-left: -2px;
550550
.el-submenu.is-active {
551551
.el-submenu__title {
552-
height: $menuItem-height;
552+
height: $menu-item-height;
553553
background-color: #1d2a60 !important;
554554

555555
i {
@@ -569,7 +569,7 @@ thead tr {
569569

570570
.router-link-active {
571571
.el-menu-item.is-active {
572-
height: $menuItem-height;
572+
height: $menu-item-height;
573573
color: $theme !important;
574574
}
575575
}
@@ -586,7 +586,7 @@ thead tr {
586586

587587
// layout
588588
.el-container.is-vertical {
589-
background: $appmain-background;
589+
background: $app-main-background;
590590
}
591591

592592
.el-aside {
@@ -595,7 +595,7 @@ thead tr {
595595

596596
.el-main {
597597
padding: 0 20px 20px 20px;
598-
background: $appmain-background;
598+
background: $app-main-background;
599599
}
600600

601601
.el-container {
@@ -893,4 +893,4 @@ $typeMap: (primary:#3963BC,
893893
@include e(title) {
894894
color: #333333;
895895
}
896-
}
896+
}

‎src/assets/style/realize/global.scss

-10
This file was deleted.

‎src/assets/style/realize/mixin.scss

+24-12
Original file line numberDiff line numberDiff line change
@@ -2,51 +2,63 @@
22
// 根据不同的屏幕加载背景图片
33
@mixin bi($url, $type: 'png') {
44
background-image: url($url + "@2x." + $type);
5-
@media (-webkit-min-device-pixel-ratio: 2), (min-device-pixel-ratio: 2) {
5+
@media (-webkit-min-device-pixel-ratio: 3), (min-device-pixel-ratio: 3) {
66
background-image: url($url + "@3x." + $type);
77
background-size: cover;
88
}
99
}
1010

11-
//文字超出后以...显示 支持多行
12-
@mixin fn-ellpisis($line: 1) {
13-
display: -webkit-box;
14-
-webkit-box-orient: vertical;
15-
-webkit-line-clamp: $line;
11+
// 文字超出后以...显示
12+
@mixin no-wrap {
13+
text-overflow: ellipsis;
1614
overflow: hidden;
15+
white-space: nowrap;
1716
}
1817

19-
@mixin btn_scale_hover(){
18+
// 扩展小图标按钮的点击区域
19+
@mixin extend-click() {
20+
position: relative;
21+
&:before {
22+
content: '';
23+
position: absolute;
24+
top: -10px;
25+
left: -10px;
26+
right: -10px;
27+
bottom: -10px;
28+
}
29+
}
30+
31+
@mixin btn-scale-hover(){
2032
transition: .4s all;
2133
&:hover{
2234
transform: scale(1.1);
2335
}
2436
}
2537

26-
@mixin bi-saturate_hover($background-color, $value: 20){ // 背景颜色增加饱和度
38+
@mixin bi-saturate-hover($background-color, $value: 20){ // 背景颜色增加饱和度
2739
transition: .6s all;
2840
&:hover{
2941
background-color: saturate($background-color, $value);
3042
}
3143
}
3244

33-
@mixin color-saturate_hover($color, $value: 30){ // 颜色增加饱和度
45+
@mixin color-saturate-hover($color, $value: 30){ // 颜色增加饱和度
3446
transition: .6s all;
3547
&:hover{
3648
color: saturate($color, $value);
3749
}
3850
}
3951

40-
@mixin bi-lighten_hover($background-color, $value: 10){ // 背景颜色变浅。
52+
@mixin bi-lighten-hover($background-color, $value: 10){ // 背景颜色变浅。
4153
transition: .6s all;
4254
&:hover{
4355
background-color: lighten($background-color, $value);
4456
}
4557
}
4658

47-
@mixin bi-opacity_hover($opacity: .8){ // 透明度
59+
@mixin bi-opacity-hover($opacity: .8){ // 透明度
4860
transition: .4s all;
4961
&:hover{
5062
opacity: $opacity;
5163
}
52-
}
64+
}

‎src/assets/style/realize/reset.scss

+1-1
Original file line numberDiff line numberDiff line change
@@ -191,4 +191,4 @@ a:hover {
191191
$--color-primary: #4c76af;
192192
/* 改变 icon 字体路径变量,必需 */
193193
$--font-path: '~element-plus/lib/theme-chalk/fonts';
194-
@import '../../../../node_modules/element-plus/packages/theme-chalk/src/index';
194+
// @import '../../../../node_modules/element-plus/packages/theme-chalk/src/index';

‎src/assets/style/realize/variable.scss

+6-9
Original file line numberDiff line numberDiff line change
@@ -7,23 +7,20 @@ $sidebar-background: #192a5e;
77
$navbar-height: 30px;
88
$navbar-padding: 20px;
99
$header-height: 86px;
10-
$reusetab-height: 40px;
10+
$reuse-tab-height: 40px;
1111

1212
$navbar-background: #BECCD8;
13-
$appmain-background: #F9FAFB;
13+
$app-main-background: #F9FAFB;
1414
$header-background: #EEF4F9;
1515
$right-side-font-color: #666666;
1616
$reuse-tab-item-background: #FFFFFF;
1717

1818
$title-color: #45526b;
1919
$parent-title-color: #3963bc;
20-
2120
$table-border-color: #dee2e6;
2221

2322
/* 菜单 */
24-
$menuItem-hover: #0a1949;
25-
$menuItem-bg: #122150;
26-
$submenu-title: #c4c9d2;
27-
$menuItem-height: 50px;
28-
29-
23+
$menu-item-hover: #0a1949;
24+
$menu-item-bg: #122150;
25+
$sub-menu-title: #c4c9d2;
26+
$menu-item-height: 50px;

‎src/component/base/upload-image/index.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,8 @@ todo: 文件判断使用 serveWorker 优化性能
8686
</template>
8787

8888
<script>
89-
import { getFileType, checkIsAnimated, isEmptyObj, createId } from './utils'
9089
import { post } from '@/lin/plugin/axios'
90+
import { getFileType, checkIsAnimated, isEmptyObj, createId } from './utils'
9191

9292
/**
9393
* 本地图像通过验证后构造的信息对象

‎src/component/layout/menu-tab.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ export default {
6666
6767
.router-link-exact-active,
6868
.router-link-active {
69-
background: $appmain-background;
69+
background: $app-main-background;
7070
color: $theme;
7171
}
7272

‎src/component/layout/reuse-tab.vue

+3-3
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ export default {
223223
width: auto !important;
224224
min-width: 126px;
225225
display: flex;
226-
height: $reusetab-height;
226+
height: $reuse-tab-height;
227227
flex-direction: column;
228228
justify-content: center;
229229
background-color: $reuse-tab-item-background;
@@ -235,7 +235,7 @@ export default {
235235
bottom: 0;
236236
left: 0;
237237
user-select: none;
238-
height: $reusetab-height;
238+
height: $reuse-tab-height;
239239
background: $header-background;
240240
font-size: 14px;
241241
color: #8c98ae;
@@ -246,7 +246,7 @@ export default {
246246
.reuse-tab-item {
247247
box-sizing: border-box;
248248
width: auto;
249-
height: $reusetab-height;
249+
height: $reuse-tab-height;
250250
min-width: 126px;
251251
display: flex;
252252
justify-content: center;

0 commit comments

Comments
 (0)
Please sign in to comment.