qdt-admin-layout 1.1.7 → 1.1.9

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "qdt-admin-layout",
3
- "version": "1.1.7",
3
+ "version": "1.1.9",
4
4
  "description": "基于element-ui的后台管理layout的管家婆改版",
5
5
  "main": "src/index.js",
6
6
  "module": "dist/esm/index.js",
@@ -14,7 +14,6 @@
14
14
  "url": ""
15
15
  },
16
16
  "bugs": {
17
- "url": ""
18
17
  },
19
18
  "scripts": {
20
19
  "serve": "vue-cli-service serve",
@@ -0,0 +1,34 @@
1
+ const days = ['天', '一', '二', '三', '四', '五', '六']; // 星期数组
2
+ let icnow = new Date(); // 初始化时间
3
+ let interval; // 定义全局定时器,用于清除定时器
4
+ export default {
5
+ data() {
6
+ return {
7
+ year_: icnow.getFullYear(),
8
+ month_: icnow.getMonth() + 1,
9
+ date_: icnow.getDate(),
10
+ day_: days[icnow.getDay() - 1],
11
+ time_: icnow.toTimeString().substring(0, 8)
12
+ }
13
+ },
14
+ created() {
15
+ let that = this;
16
+ interval = setInterval(() => {
17
+ let icnow = new Date();
18
+ that.year_ = icnow.getFullYear();
19
+ that.month_ = icnow.getMonth() + 1;
20
+ that.date_ = icnow.getDate();
21
+ that.day_ = days[icnow.getDay()];
22
+ that.time_ = icnow.toTimeString().substring(0, 8);
23
+ }, 1000)
24
+ },
25
+ computed: {
26
+ // 当前时间
27
+ newTime() {
28
+ return this.year_ + '年' + this.month_ + '月' + this.date_ + '日 星期' + this.day_ + ' ' + this.time_;
29
+ }
30
+ },
31
+ beforeDestroy() {
32
+ clearInterval(interval);
33
+ }
34
+ }
@@ -5,15 +5,15 @@
5
5
 
6
6
  //TODO header会在head-menu渲染后再次渲染,初步排查是head-menu中的activeMenu改变所致
7
7
  import { appGetters, headerGetters, headerMutations } from "../../store";
8
- import Logo from "../../component/Logo";
9
8
  import Hamburger from "../../component/Hamburger";
10
9
  import HorizontalResizableMenu from "../../component/HorizontalResizableMenu";
11
10
  import { refreshPage } from "../../helper";
12
11
  import { isEmpty } from "../../util";
12
+ import dateTime from "./dateTime";
13
13
 
14
14
  export default {
15
15
  name: "Header",
16
-
16
+ mixins: [dateTime],
17
17
  computed: {
18
18
  // 左侧logo
19
19
  defaultLogo() {
@@ -60,11 +60,33 @@ export default {
60
60
  },
61
61
  // 右侧下拉菜单
62
62
  defaultUserDropdown() {
63
- const { logout = {}, message = {}, userinfo = {} } = headerMutations;
63
+ const {
64
+ logout = {},
65
+ message = {},
66
+ userinfo = {},
67
+ dowload = {},
68
+ } = headerMutations;
64
69
  const { username } = headerGetters;
65
70
 
66
71
  return (
67
72
  <div class="user-dropdown-reference">
73
+ <span class="username time">{this.newTime}</span>
74
+ <span class="username shu">|</span>
75
+ <i
76
+ style="color:#333"
77
+ class="el-icon-download header-icon"
78
+ on-click={dowload}
79
+ />
80
+ <span class="username">下载</span>
81
+ <span class="username shu">|</span>
82
+
83
+ <i
84
+ style="color:#333"
85
+ class="el-icon-bell header-icon"
86
+ on-click={message}
87
+ />
88
+ <span class="username">消息中心</span>
89
+ <span class="username shu">|</span>
68
90
  <span on-click={userinfo}>
69
91
  <el-avatar
70
92
  size={28}
@@ -77,13 +99,6 @@ export default {
77
99
  {username}
78
100
  </span>
79
101
  )}
80
-
81
- <span class="username shu">|</span>
82
- <i
83
- style="color:#333"
84
- class="el-icon-bell header-icon"
85
- on-click={message}
86
- />
87
102
  <span class="username shu">|</span>
88
103
  <span class="username exit" on-click={logout}>
89
104
  退出
@@ -25,7 +25,7 @@
25
25
 
26
26
  .header-icon {
27
27
  font-size: 18px;
28
- padding: 0 7px;
28
+ padding: 0;
29
29
  }
30
30
 
31
31
  .header-item {
@@ -55,13 +55,16 @@
55
55
  height: 100%;
56
56
 
57
57
  .username {
58
- font-size: 14px;
59
- color: #333;
58
+ font-size: 15px;
59
+ color: #666;
60
60
  padding: 0 7px;
61
61
  }
62
+ .time {
63
+ letter-spacing: 2px;
64
+ }
62
65
  .shu {
63
66
  padding: 0 13px;
64
- font-size: 14px;
67
+ font-size: 15px;
65
68
  }
66
69
  .exit {
67
70
  padding-left: 7px;
@@ -97,7 +97,7 @@ export default {
97
97
  return (
98
98
  icon && (
99
99
  <i
100
- style="font-size:20px;vertical-align: middle;line-height:44px"
100
+ style="font-size:28px;vertical-align: middle;line-height:44px"
101
101
  class={`menu-icon ${icon}`}
102
102
  />
103
103
  )
@@ -126,7 +126,7 @@ export default {
126
126
  <div>
127
127
  <div>
128
128
  {this.renderMenuIcon(h, menu, depth)}
129
- <span style="margin-left:8px;vertical-align: middle;font-size:15px;letter-spacing: 3px;">
129
+ <span style="margin-left:8px;vertical-align: middle;font-size:18px;letter-spacing: 3px;">
130
130
  {menu.meta.title}
131
131
  </span>
132
132
  </div>
@@ -152,9 +152,9 @@ export default {
152
152
  >
153
153
  <template slot="title">
154
154
  {depth == 1 && (
155
- <div style="height:100%">
155
+ <div style="height:100%;line-height:44.1px">
156
156
  {this.renderMenuIcon(h, menu, depth)}
157
- <span style="margin-left:8px;vertical-align: middle;font-size:15px">
157
+ <span style="margin-left:8px;vertical-align: middle;font-size:18px;letter-spacing: 3px;">
158
158
  {menu.meta.title}
159
159
  </span>
160
160
  </div>