qdt-admin-layout 1.0.0 → 1.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,22 +1,21 @@
1
- # el-admin-layout
2
-
3
- 这是一个基于`element-ui`的后台管理layout组件,需要配合`vue2`、`vue-router3`使用。
1
+ # qdt-admin-layout
4
2
 
3
+ 签到通定制版
5
4
 
6
5
  ## 功能特性
7
6
 
8
- - flex布局、有限的移动端适配
7
+ - flex 布局、有限的移动端适配
9
8
  - 仿`ant-design-pro`的三种导航
10
9
  - 多页签
11
10
  - 侧边栏和顶栏的深色\亮色主题
12
11
  - 侧边栏可搜索
13
12
  - 路由和菜单分离
14
13
  - 支持各种页面缓存(不支持嵌套路由)
15
- - 支持iframe、外链
14
+ - 支持 iframe、外链
16
15
  - 数据外部可控,满足大部分定制化需求
17
16
 
18
17
  ## 安装
19
18
 
20
19
  ```
21
- npm i el-admin-layout -S
20
+ npm i qdt-admin-layout -S
22
21
  ```
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "qdt-admin-layout",
3
- "version": "1.0.0",
4
- "description": "基于element-ui的后台管理layout",
3
+ "version": "1.0.4",
4
+ "description": "基于element-ui的后台管理layout的管家婆改版",
5
5
  "main": "src/index.js",
6
6
  "module": "dist/esm/index.js",
7
7
  "jsdelivr": "dist/index.umd.min.js",
@@ -88,16 +88,18 @@ export default {
88
88
  on-mouseleave={() => this.handleMouseleave(true)}
89
89
  on-focus={(e) => this.handleMouseenter(e, 100)}
90
90
  >
91
- {this.$slots.default.map((item) => {
92
- return (
93
- <ul
94
- style="display:inline-block;width:200px"
95
- class={this.popupMenuClass}
96
- >
97
- {item}
98
- </ul>
99
- );
100
- })}
91
+ <div class="menu-display">
92
+ {this.$slots.default.map((item) => {
93
+ return (
94
+ <ul
95
+ style="display:inline-block;width:200px;vertical-align: top;margin:0;"
96
+ class={this.popupMenuClass}
97
+ >
98
+ {item}
99
+ </ul>
100
+ );
101
+ })}
102
+ </div>
101
103
  </div>
102
104
  </transition>
103
105
  ) : (
@@ -21,7 +21,7 @@ export default {
21
21
 
22
22
  computed: {
23
23
  isLeftRight() {
24
- return appGetters.struct === 'left-right'
24
+ return appGetters.struct === 'top-bottom'
25
25
  },
26
26
  renderAside() {
27
27
  return appGetters.isMobile || ['aside', 'mix'].includes(appGetters.navMode)
@@ -28,11 +28,11 @@
28
28
  // 左右结构
29
29
  &.left-right {
30
30
  > header {
31
- grid-column-start: 2;
31
+ grid-column-start: 1;
32
32
  }
33
33
 
34
34
  > aside {
35
- grid-row-start: 1;
35
+ grid-row-start: 2;
36
36
 
37
37
  // 左右结构时,侧边栏z-index需大于顶栏
38
38
  // 上下结构时,侧边栏z-index需小于顶栏
@@ -94,7 +94,7 @@ export default {
94
94
  if (slot) return slot(h, { menu, depth });
95
95
 
96
96
  const icon = menu.meta.icon;
97
- return icon && <i style="margin-top:-18px" class={`menu-icon ${icon}`} />;
97
+ return icon && <i class={`menu-icon ${icon}`} />;
98
98
  },
99
99
  // 渲染菜单内容
100
100
  renderMenuContent(h, menu, depth) {
@@ -122,28 +122,25 @@ export default {
122
122
  const noContent =
123
123
  depth === 1 && this.collapse && this.mode === "vertical";
124
124
  return (
125
- <div key="index">
126
- <SubMenu
127
- key={fullPath}
128
- index={fullPath}
129
- inline-indent={this.inlineIndent}
130
- popper-class={this.themeClass}
131
- popper-append-to-body
132
- >
133
- <template slot="title">
134
- {depth == 1 && (
135
- <div>
136
- {this.renderMenuIcon(h, menu, depth)}
137
- <div style="margin-top:-24px;font-size:14px;margin-left:-2px">
138
- {menu.meta.title}
139
- </div>
140
- </div>
141
- )}
142
- {!noContent && this.renderMenuContent(h, menu, depth)}
143
- </template>
144
- {children}
145
- </SubMenu>
146
- </div>
125
+ <SubMenu
126
+ key={fullPath}
127
+ index={fullPath}
128
+ inline-indent={this.inlineIndent}
129
+ popper-class={this.themeClass}
130
+ popper-append-to-body
131
+ >
132
+ <template slot="title">
133
+ {depth == 1 && (
134
+ <div style="padding: 10% 0;">
135
+ {this.renderMenuIcon(h, menu, depth)}
136
+ <div>{menu.meta.title}</div>
137
+ </div>
138
+ )}
139
+
140
+ {!noContent && this.renderMenuContent(h, menu, depth)}
141
+ </template>
142
+ {children}
143
+ </SubMenu>
147
144
  );
148
145
  },
149
146
  // 渲染有子级且需要显示父级的菜单
@@ -156,8 +153,13 @@ export default {
156
153
  });
157
154
  data.push(
158
155
  <div>
159
- <div class="popover-menu__title">
160
- {this.renderMenuContent(h, x, depth)}
156
+ <div
157
+ style="font-weight:800;color:black"
158
+ class="popover-menu__title"
159
+ >
160
+ <div class="title-boder">
161
+ {this.renderMenuContent(h, x, depth)}
162
+ </div>
161
163
  </div>
162
164
  <div class="el-menu el-menu--inline">{childrens}</div>
163
165
  </div>
@@ -170,15 +172,13 @@ export default {
170
172
  return menus.map((menu) => {
171
173
  let children = [];
172
174
  //弹出菜单显示父级信息;
173
- if (this.collapse && this.showParentOnCollapse) {
174
- // 这里认为父级的深度应该+1
175
- children = this.renderChildrenWithParentMenu(
176
- h,
177
- menu,
178
- children,
179
- depth + 1
180
- );
181
- }
175
+ // 这里认为父级的深度应该+1
176
+ children = this.renderChildrenWithParentMenu(
177
+ h,
178
+ menu,
179
+ children,
180
+ depth + 1
181
+ );
182
182
  // 一级菜单
183
183
  return this.renderSubMenu(h, menu, children, depth);
184
184
  });
@@ -1,16 +1,28 @@
1
+ .menu-display {
2
+ margin-left: 5px;
3
+ ul {
4
+ border-left: 1px solid rgb(228, 231, 237);
5
+ }
6
+ ul:first-child {
7
+ border: none;
8
+ }
9
+ }
10
+ .title-boder {
11
+ height: 38px;
12
+ border-bottom: 1px solid rgb(228, 231, 237);
13
+ }
14
+
15
+ .el-menu--collapse .el-submenu {
16
+ height: 88px !important;
17
+ }
18
+
1
19
  .el-menu {
2
20
  width: 100%;
3
- border: none !important;
4
21
 
5
22
  // 菜单图标
6
23
  .menu-icon {
7
24
  color: inherit;
8
25
  font-size: 38px;
9
-
10
- // 与菜单内容的间隔
11
- & + * {
12
- margin-left: $menu-icon-text-gap;
13
- }
14
26
  }
15
27
 
16
28
  // 子级菜单激活时,父级同样高亮
@@ -52,19 +64,29 @@
52
64
  //菜单hover时,左侧图标放大(弹出菜单的父级不放大)
53
65
  .el-menu-item:not(.popover-menu__title),
54
66
  .el-submenu__title {
55
- > .menu-icon,
56
- > .el-tooltip > .menu-icon {
67
+ .menu-icon {
57
68
  transition: transform 0.1s;
58
69
  }
59
70
 
60
71
  &:hover {
61
- > .menu-icon,
62
- > .el-tooltip > .menu-icon {
72
+ .menu-icon {
63
73
  transform: scale(1.2);
64
74
  }
65
75
  }
66
76
  }
67
77
 
78
+ .el-menu--popup {
79
+ .popover-menu__title {
80
+ height: 40px !important;
81
+ line-height: 40px !important;
82
+ border: none;
83
+ }
84
+ .el-menu-item {
85
+ height: 40px !important;
86
+ line-height: 40px !important;
87
+ }
88
+ }
89
+
68
90
  .el-menu-item,
69
91
  .el-submenu__title {
70
92
  text-overflow: ellipsis;
@@ -100,7 +122,7 @@
100
122
  // 折叠时
101
123
  &.el-menu--collapse {
102
124
  .el-submenu__title {
103
- padding-right: $menu-padding;
125
+ padding: 5% 0 !important;
104
126
  }
105
127
 
106
128
  // 使用过渡动画会用span标签包裹,导致原始使用'>'选择器失效
@@ -125,8 +147,8 @@
125
147
  // 顶级节点的高度以及hover时的下边框
126
148
  > .el-menu-item,
127
149
  > .el-submenu > .el-submenu__title {
128
- height: $header-height;
129
- line-height: $header-height;
150
+ height: 40px;
151
+ line-height: 40px;
130
152
 
131
153
  &:hover {
132
154
  border-bottom: 2px solid $--color-primary;
@@ -26,7 +26,7 @@
26
26
  // 子级菜单的背景颜色和内阴影
27
27
  .el-menu--inline {
28
28
  background-color: $sub-menu-background-dark;
29
- box-shadow: inset 0 2px 8px darken($sub-menu-background-dark, 10%)
29
+ // box-shadow: inset 0 2px 8px darken($sub-menu-background-dark, 10%)
30
30
  }
31
31
  }
32
32
 
@@ -1,9 +1,8 @@
1
1
  .collapse {
2
2
  .el-submenu__title {
3
+ text-align: center;
3
4
  height: 100%;
4
- padding-top: 15px;
5
- padding-left: 25px;
6
- padding-right: 23px;
5
+ line-height: normal !important;
7
6
  }
8
7
  }
9
8
 
@@ -13,7 +12,7 @@
13
12
  // 菜单的文字以及hover颜色
14
13
  .el-menu-item,
15
14
  .el-submenu__title {
16
- color: $menu-text-color-light;
15
+ color: rgb(109, 110, 110);
17
16
  &:hover {
18
17
  color: #f56d45;
19
18
  }
@@ -21,7 +20,7 @@
21
20
 
22
21
  // 设置了显示弹出菜单的父级
23
22
  .el-menu--popup .popover-menu__title {
24
- color: $menu-text-color-light;
23
+ color: rgb(109, 110, 110);
25
24
  border-bottom-color: $--border-color-light;
26
25
  }
27
26
 
@@ -71,7 +70,7 @@
71
70
  // 菜单的文字以及hover颜色
72
71
  .el-menu-item,
73
72
  .el-submenu__title {
74
- color: $menu-text-color-light;
73
+ color: rgb(109, 110, 110);
75
74
 
76
75
  &:hover {
77
76
  color: $menu-text-hover-color-light;
package/src/store/app.js CHANGED
@@ -31,10 +31,10 @@ const state = {
31
31
  loadingMenu: false,
32
32
 
33
33
  // 分层结构,上下('top-bottom')、左右('left-right')
34
- struct: 'left-right',
34
+ struct: 'top-bottom',
35
35
 
36
36
  // 导航模式,'aside'、'head'、'mix'
37
- navMode: 'mix',
37
+ navMode: 'aside',
38
38
 
39
39
  // 自定义渲染logo,(h, {img, title, props}) => VNode | VNode[]
40
40
  logoSlot: undefined