eoss-ui 0.5.81-beta8 → 0.5.81-beta9

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.
@@ -1,70 +1,20 @@
1
1
  <template>
2
- <el-scrollbar :class="{ 'is-fold': fold }">
3
- <template v-for="(item, index) in data">
4
- <el-popover
5
- v-if="
6
- (item.children && item.children.length) ||
7
- (item.fourthTabs, item.fourthTabs.length)
8
- "
9
- placement="right"
10
- trigger="hover"
11
- popper-class="es-simplicity-menus-sub"
12
- :width="width"
13
- @show="handleShow"
14
- @hide="handleHide"
15
- >
16
- <template slot-scope="{ parent }">
17
- <menu-list
18
- ref="menus"
19
- :parent="parent"
20
- :active="active"
21
- :popover="show"
22
- :data="[...(item.children || []), ...(item.fourthTabs || [])]"
23
- :menuIcon="menuIcon"
24
- :color="color"
25
- :backgroundColor="backgroundColor"
26
- :width="width"
27
- @command="handleClick"
28
- ></menu-list>
29
- </template>
30
- <div
31
- slot="reference"
32
- class="es-simplicity-menus-item"
33
- :key="item.id"
34
- :class="{ 'is-active': defaultActive === item.id, 'is-fold': fold }"
35
- :title="fold ? item.text || item.name : ''"
36
- >
37
- <template v-if="fold">
38
- <el-badge is-dot :hidden="!item.tips">
39
- <es-icon
40
- class="es-simplicity_apps-icon"
41
- :style="setStyle(index)"
42
- :contents="item.icons || item.icon || menuIcon"
43
- ></es-icon>
44
- </el-badge>
45
- </template>
46
- <template v-else>
47
- <es-icon
48
- class="es-simplicity_apps-icon"
49
- :style="setStyle(index)"
50
- :contents="item.icons || item.icon || menuIcon"
51
- ></es-icon>
52
- <div class="es-simplicity-menus-tips" v-if="item.tips">
53
- {{ item.tips > 99 ? '99+' : item.tips }}
54
- </div>
55
- </template>
56
- <div class="es-simplicity_apps-text" v-show="!fold">
57
- {{ item.text || item.name }}
58
- </div>
59
- </div>
60
- </el-popover>
2
+ <el-scrollbar class="es-simplicity-menus-scrollbar">
3
+ <div
4
+ class="es-simplicity-menus-lists"
5
+ :class="{ 'is-fold': fold }"
6
+ @mouseleave="handleOut(true)"
7
+ @mouseenter="handleOut(false)"
8
+ >
61
9
  <div
62
- v-else
10
+ v-for="(item, index) in data"
63
11
  class="es-simplicity-menus-item"
64
12
  :key="item.id"
65
- :class="{ 'is-active': defaultActive === item.id, 'is-fold': fold }"
13
+ :class="{ 'is-fold': fold }"
66
14
  :title="fold ? item.text || item.name : ''"
67
15
  @click="handleClick(item)"
16
+ @mouseenter="handleEnter(item)"
17
+ @mouseleave="handleLeave(item)"
68
18
  >
69
19
  <template v-if="fold">
70
20
  <el-badge is-dot :hidden="!item.tips">
@@ -89,7 +39,7 @@
89
39
  {{ item.text || item.name }}
90
40
  </div>
91
41
  </div>
92
- </template>
42
+ </div>
93
43
  </el-scrollbar>
94
44
  </template>
95
45
 
@@ -158,20 +108,17 @@ export default {
158
108
  util.win.location.href = res.url;
159
109
  return;
160
110
  }
111
+ this.$emit('command', res);
161
112
  }
162
- this.$emit('command', res);
163
113
  },
164
- handleShow() {
165
- this.show = true;
166
- if (this.parent) {
167
- this.parent.changeContinue(true);
168
- }
114
+ handleEnter(res) {
115
+ this.$emit('menter', res);
169
116
  },
170
- handleHide() {
171
- if (this.parent) {
172
- this.parent.changeContinue(false);
173
- //this.parent.hidePopper();
174
- }
117
+ handleLeave(res) {
118
+ this.$emit('mleave', res);
119
+ },
120
+ handleOut(res) {
121
+ this.$emit('mout', res);
175
122
  }
176
123
  }
177
124
  };
@@ -29,7 +29,6 @@
29
29
  ></i>
30
30
  </div>
31
31
  <menu-list
32
- ref="menus"
33
32
  :active="active"
34
33
  :data="menus"
35
34
  :menuIcon="menuIcon"
@@ -37,9 +36,57 @@
37
36
  :backgroundColor="backgroundColor"
38
37
  :fold="fold"
39
38
  :width="size"
39
+ @menter="
40
+ (res) => {
41
+ this.getData(res, 0, true);
42
+ }
43
+ "
44
+ @mleave="
45
+ (res) => {
46
+ this.getData(res, 0, false);
47
+ }
48
+ "
49
+ @hover="handleHover"
40
50
  @command="handleCommand"
41
51
  ></menu-list>
42
52
  </div>
53
+ <div
54
+ class="es-simplicity-menus-view"
55
+ @mouseleave="handleLeave"
56
+ @mouseenter="handleEnter"
57
+ v-show="subMenus.length"
58
+ >
59
+ <div
60
+ class="es-simplicity-menus-box"
61
+ v-for="(item, index) in subMenus"
62
+ :key="item.id"
63
+ >
64
+ <div class="es-simplicity-menus-title">
65
+ <span class="es-simplicity-menus-title-text">{{
66
+ item.name || item.text || item.title
67
+ }}</span>
68
+ </div>
69
+ <menu-list
70
+ :active="active"
71
+ :data="[...item.children, ...item.fourthTabs]"
72
+ :menuIcon="menuIcon"
73
+ :color="color"
74
+ :backgroundColor="backgroundColor"
75
+ :width="size"
76
+ @menter="
77
+ (res) => {
78
+ getData(res, index + 1, true);
79
+ }
80
+ "
81
+ @mleave="
82
+ (res) => {
83
+ getData(res, index + 1, false);
84
+ }
85
+ "
86
+ @command="handleCommand"
87
+ ></menu-list>
88
+ </div>
89
+ </div>
43
90
  </div>
44
91
  </el-drawer>
45
92
  </template>
@@ -93,7 +140,9 @@ export default {
93
140
  return {
94
141
  fold: false,
95
142
  width: this.size,
96
- subMenus: []
143
+ subMenus: [],
144
+ isEnter: false,
145
+ timer: null
97
146
  };
98
147
  },
99
148
  computed: {
@@ -124,11 +173,44 @@ export default {
124
173
  this.$emit('update:fold', res);
125
174
  },
126
175
  handleCommand(res) {
176
+ console.log(res);
127
177
  this.$emit('command', res);
128
178
  },
179
+ getData(res, n, is) {
180
+ this.isEnter = is;
181
+ if (is) {
182
+ this.subMenus.splice(n);
183
+ let { children, fourthTabs } = res;
184
+ if (
185
+ (children && children.length) ||
186
+ (fourthTabs && fourthTabs.length)
187
+ ) {
188
+ this.subMenus = this.subMenus.concat(res);
189
+ }
190
+ } else {
191
+ if (n == 0) {
192
+ clearTimeout(this.timer);
193
+ this.timer = setTimeout(() => {
194
+ if (res && !this.isEnter) {
195
+ this.subMenus = [];
196
+ }
197
+ }, 200);
198
+ }
199
+ }
200
+ },
201
+ handleHover(res) {
202
+ this.isEnter = res;
203
+ //if(this)
204
+ },
129
205
  clearSubmenu() {
130
206
  this.$refs.menus.clearActive();
131
207
  this.subMenus = [];
208
+ },
209
+ handleLeave() {
210
+ this.subMenus = [];
211
+ },
212
+ handleEnter() {
213
+ this.isEnter = true;
132
214
  }
133
215
  }
134
216
  };
@@ -42,7 +42,11 @@
42
42
  </div>
43
43
  <div class="es-simplicity-notice-type" v-if="userScanBindImgUrl">
44
44
  <div class="es-simplicity-notice-title">微信公众号:</div>
45
- <img class="es-simplicity-qrcode" @click="getQrcode" :src="qrcode" />
45
+ <el-image
46
+ class="es-simplicity-qrcode"
47
+ @click="getQrcode"
48
+ :src="qrcode"
49
+ ></el-image>
46
50
  </div>
47
51
  <div class="es-simplicity-notice-type">
48
52
  <div class="es-simplicity-notice-title">接收消息类型:</div>