eoss-ui 0.6.53 → 0.6.55

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.
Files changed (260) hide show
  1. package/lib/checkbox-group.js +3 -3
  2. package/lib/data-table.js +6 -6
  3. package/lib/eoss-ui.common.js +817 -708
  4. package/lib/flow-list.js +95 -92
  5. package/lib/flow.js +280 -280
  6. package/lib/form.js +4 -4
  7. package/lib/index.js +1 -1
  8. package/lib/input.js +1 -1
  9. package/lib/login.js +3 -3
  10. package/lib/main.js +280 -215
  11. package/lib/menu.js +46 -10
  12. package/lib/qr-code.js +13 -13
  13. package/lib/radio-group.js +3 -3
  14. package/lib/select-ganged.js +1 -1
  15. package/lib/select.js +3 -1
  16. package/lib/selector-panel.js +3 -3
  17. package/lib/steps.js +3 -3
  18. package/lib/theme-chalk/flow.css +1 -1
  19. package/lib/theme-chalk/index.css +1 -1
  20. package/lib/theme-chalk/main.css +1 -1
  21. package/lib/theme-chalk/simplicity.css +1 -1
  22. package/lib/tips.js +3 -3
  23. package/lib/tree.js +3 -3
  24. package/lib/upload.js +20 -17
  25. package/package.json +159 -159
  26. package/packages/.DS_Store +0 -0
  27. package/packages/button/index.js +5 -5
  28. package/packages/button/src/main.vue +418 -418
  29. package/packages/button-group/index.js +5 -5
  30. package/packages/button-group/src/main.vue +298 -298
  31. package/packages/calendar/index.js +5 -5
  32. package/packages/card/index.js +5 -5
  33. package/packages/card/src/main.vue +156 -156
  34. package/packages/cascader/index.js +5 -5
  35. package/packages/cascader/src/main.vue +168 -168
  36. package/packages/checkbox-group/index.js +5 -5
  37. package/packages/checkbox-group/src/main.vue +333 -333
  38. package/packages/clients/index.js +5 -5
  39. package/packages/clients/src/main.vue +144 -144
  40. package/packages/data-table/.DS_Store +0 -0
  41. package/packages/data-table/index.js +5 -5
  42. package/packages/data-table/src/children.vue +39 -39
  43. package/packages/data-table/src/column.vue +989 -989
  44. package/packages/data-table/src/main.vue +1822 -1822
  45. package/packages/data-table/src/sizer.vue +195 -195
  46. package/packages/data-table-form/.DS_Store +0 -0
  47. package/packages/data-table-form/index.js +5 -5
  48. package/packages/data-table-form/src/checkbox.vue +101 -101
  49. package/packages/data-table-form/src/colgroup.vue +17 -17
  50. package/packages/data-table-form/src/main.vue +181 -181
  51. package/packages/data-table-form/src/radio.vue +65 -65
  52. package/packages/data-table-form/src/table.vue +233 -233
  53. package/packages/data-table-form/src/tbody.vue +336 -336
  54. package/packages/data-table-form/src/thead.vue +68 -68
  55. package/packages/date-picker/index.js +5 -5
  56. package/packages/date-picker/src/main.vue +236 -236
  57. package/packages/dialog/index.js +5 -5
  58. package/packages/enable-drag/index.js +5 -5
  59. package/packages/enterprise/index.js +5 -5
  60. package/packages/enterprise/src/main.vue +66 -66
  61. package/packages/error-page/.DS_Store +0 -0
  62. package/packages/error-page/index.js +5 -5
  63. package/packages/error-page/src/main.vue +44 -44
  64. package/packages/flow/.DS_Store +0 -0
  65. package/packages/flow/index.js +5 -5
  66. package/packages/flow/src/component/CommonOpinions.vue +345 -345
  67. package/packages/flow/src/component/CustomPreset.vue +322 -322
  68. package/packages/flow/src/component/FileList.vue +99 -99
  69. package/packages/flow/src/component/Preset.vue +255 -255
  70. package/packages/flow/src/component/SendMsg.vue +229 -229
  71. package/packages/flow/src/component/TimeLimit.vue +190 -190
  72. package/packages/flow/src/component/taskUnionExamine.vue +611 -611
  73. package/packages/flow/src/form.vue +121 -121
  74. package/packages/flow/src/freeStartFlow.vue +2843 -2843
  75. package/packages/flow/src/main.vue +3131 -3131
  76. package/packages/flow/src/processForm.vue +1031 -1031
  77. package/packages/flow/src/processReject.vue +293 -293
  78. package/packages/flow/src/reset.vue +900 -900
  79. package/packages/flow/src/startTaskRead.vue +641 -641
  80. package/packages/flow/src/supervise.vue +138 -138
  81. package/packages/flow/src/table.vue +58 -58
  82. package/packages/flow-group/.DS_Store +0 -0
  83. package/packages/flow-group/index.js +5 -5
  84. package/packages/flow-group/src/main.vue +688 -688
  85. package/packages/flow-list/index.js +5 -5
  86. package/packages/flow-list/src/main.vue +1437 -1434
  87. package/packages/form/.DS_Store +0 -0
  88. package/packages/form/index.js +5 -5
  89. package/packages/form/src/main.vue +3583 -3583
  90. package/packages/form/src/table.vue +1426 -1426
  91. package/packages/handle-user/index.js +5 -5
  92. package/packages/handle-user/src/main.vue +138 -138
  93. package/packages/handler/.DS_Store +0 -0
  94. package/packages/handler/index.js +5 -5
  95. package/packages/handler/src/main.vue +493 -493
  96. package/packages/icon/index.js +5 -5
  97. package/packages/icon/src/main.vue +101 -101
  98. package/packages/icons/index.js +5 -5
  99. package/packages/icons/src/main.vue +81 -81
  100. package/packages/input/index.js +5 -5
  101. package/packages/input/src/main.vue +356 -356
  102. package/packages/input-number/index.js +5 -5
  103. package/packages/input-number/src/main.vue +106 -106
  104. package/packages/label/index.js +5 -5
  105. package/packages/label/src/main.vue +457 -457
  106. package/packages/layout/index.js +5 -5
  107. package/packages/layout/src/item.vue +152 -152
  108. package/packages/layout/src/main.vue +31 -31
  109. package/packages/login/.DS_Store +0 -0
  110. package/packages/login/index.js +5 -5
  111. package/packages/login/src/main.vue +1935 -1935
  112. package/packages/login/src/resetPassword.vue +562 -562
  113. package/packages/main/.DS_Store +0 -0
  114. package/packages/main/index.js +5 -5
  115. package/packages/main/src/.DS_Store +0 -0
  116. package/packages/main/src/default/message.vue +249 -249
  117. package/packages/main/src/default/notice.vue +157 -157
  118. package/packages/main/src/default/userinfo.vue +503 -503
  119. package/packages/main/src/public/online.vue +89 -89
  120. package/packages/main/src/public/search.vue +462 -466
  121. package/packages/main/src/public/settings.vue +221 -221
  122. package/packages/main/src/simplicity/apps.vue +388 -388
  123. package/packages/main/src/simplicity/avatar.vue +82 -82
  124. package/packages/main/src/simplicity/handler.vue +259 -259
  125. package/packages/main/src/simplicity/index.vue +2076 -2064
  126. package/packages/main/src/simplicity/lists.vue +84 -84
  127. package/packages/main/src/simplicity/menu-list.vue +135 -128
  128. package/packages/main/src/simplicity/message.vue +259 -259
  129. package/packages/main/src/simplicity/notice.vue +190 -190
  130. package/packages/main/src/simplicity/router-page.vue +45 -45
  131. package/packages/main/src/simplicity/sub-menu.vue +263 -241
  132. package/packages/main/src/simplicity/user.vue +257 -257
  133. package/packages/main/src/simplicity/userinfo.vue +312 -312
  134. package/packages/menu/index.js +5 -5
  135. package/packages/menu/src/main.vue +580 -536
  136. package/packages/nav/index.js +5 -5
  137. package/packages/nav/src/main.vue +351 -351
  138. package/packages/notify/index.js +5 -5
  139. package/packages/notify/src/main.vue +538 -538
  140. package/packages/page/index.js +5 -5
  141. package/packages/page/src/main.vue +167 -167
  142. package/packages/pagination/index.js +5 -5
  143. package/packages/pagination/src/main.vue +96 -96
  144. package/packages/player/index.js +5 -5
  145. package/packages/player/src/main.vue +194 -194
  146. package/packages/qr-code/index.js +5 -5
  147. package/packages/qr-code/src/main.vue +170 -170
  148. package/packages/radio-group/index.js +6 -6
  149. package/packages/radio-group/src/main.vue +319 -319
  150. package/packages/retrial-auth/.DS_Store +0 -0
  151. package/packages/retrial-auth/index.js +5 -5
  152. package/packages/retrial-auth/src/main.vue +280 -280
  153. package/packages/select/.DS_Store +0 -0
  154. package/packages/select/index.js +5 -5
  155. package/packages/select/src/main.vue +778 -776
  156. package/packages/select-ganged/index.js +5 -5
  157. package/packages/select-ganged/src/main.vue +724 -724
  158. package/packages/selector/.DS_Store +0 -0
  159. package/packages/selector/index.js +5 -5
  160. package/packages/selector/src/main.vue +687 -687
  161. package/packages/selector-panel/.DS_Store +0 -0
  162. package/packages/selector-panel/index.js +5 -5
  163. package/packages/selector-panel/src/main.vue +1027 -1027
  164. package/packages/selector-panel/src/selection.vue +177 -177
  165. package/packages/selector-panel/src/tree.vue +129 -129
  166. package/packages/sizer/.DS_Store +0 -0
  167. package/packages/sizer/index.js +5 -5
  168. package/packages/sizer/src/main.vue +254 -254
  169. package/packages/steps/index.js +5 -5
  170. package/packages/steps/src/main.vue +181 -181
  171. package/packages/switch/index.js +5 -5
  172. package/packages/switch/src/main.vue +154 -154
  173. package/packages/table-form/index.js +5 -5
  174. package/packages/tabs/.DS_Store +0 -0
  175. package/packages/tabs/index.js +5 -5
  176. package/packages/tabs/src/main.vue +788 -788
  177. package/packages/tabs-panel/index.js +5 -5
  178. package/packages/tabs-panel/src/main.vue +29 -29
  179. package/packages/theme-chalk/lib/flow.css +1 -1
  180. package/packages/theme-chalk/lib/index.css +1 -1
  181. package/packages/theme-chalk/lib/main.css +1 -1
  182. package/packages/theme-chalk/lib/simplicity.css +1 -1
  183. package/packages/theme-chalk/src/.DS_Store +0 -0
  184. package/packages/theme-chalk/src/base.scss +260 -260
  185. package/packages/theme-chalk/src/button-group.scss +175 -175
  186. package/packages/theme-chalk/src/button.scss +24 -24
  187. package/packages/theme-chalk/src/calendar.scss +113 -113
  188. package/packages/theme-chalk/src/card.scss +99 -99
  189. package/packages/theme-chalk/src/checkbox-group.scss +8 -8
  190. package/packages/theme-chalk/src/clients.scss +87 -87
  191. package/packages/theme-chalk/src/data-table-form.scss +67 -67
  192. package/packages/theme-chalk/src/data-table.scss +293 -293
  193. package/packages/theme-chalk/src/date-picker.scss +7 -7
  194. package/packages/theme-chalk/src/dialog.scss +77 -77
  195. package/packages/theme-chalk/src/enable-drag.scss +181 -181
  196. package/packages/theme-chalk/src/enterprise.scss +5 -5
  197. package/packages/theme-chalk/src/error-page.scss +18 -18
  198. package/packages/theme-chalk/src/flow-group.scss +110 -110
  199. package/packages/theme-chalk/src/flow-list.scss +36 -36
  200. package/packages/theme-chalk/src/flow.scss +336 -335
  201. package/packages/theme-chalk/src/form.scss +496 -496
  202. package/packages/theme-chalk/src/handle-user.scss +40 -40
  203. package/packages/theme-chalk/src/handler.scss +143 -143
  204. package/packages/theme-chalk/src/icon.scss +1789 -1789
  205. package/packages/theme-chalk/src/icons.scss +99 -99
  206. package/packages/theme-chalk/src/input.scss +9 -9
  207. package/packages/theme-chalk/src/label.scss +24 -24
  208. package/packages/theme-chalk/src/layout.scss +46 -46
  209. package/packages/theme-chalk/src/login.scss +969 -969
  210. package/packages/theme-chalk/src/main.scss +663 -663
  211. package/packages/theme-chalk/src/menu.scss +222 -222
  212. package/packages/theme-chalk/src/mixins/color.scss +117 -117
  213. package/packages/theme-chalk/src/nav.scss +111 -111
  214. package/packages/theme-chalk/src/page.scss +3 -3
  215. package/packages/theme-chalk/src/pagination.scss +29 -29
  216. package/packages/theme-chalk/src/player.scss +9 -9
  217. package/packages/theme-chalk/src/qr-code.scss +17 -17
  218. package/packages/theme-chalk/src/radio-group.scss +9 -9
  219. package/packages/theme-chalk/src/retrial-auth.scss +38 -38
  220. package/packages/theme-chalk/src/select-ganged.scss +8 -8
  221. package/packages/theme-chalk/src/select.scss +8 -8
  222. package/packages/theme-chalk/src/selector-panel.scss +204 -204
  223. package/packages/theme-chalk/src/selector.scss +91 -91
  224. package/packages/theme-chalk/src/simplicity.scss +1343 -1265
  225. package/packages/theme-chalk/src/sizer.scss +36 -36
  226. package/packages/theme-chalk/src/steps.scss +88 -88
  227. package/packages/theme-chalk/src/switch.scss +3 -3
  228. package/packages/theme-chalk/src/table-form.scss +1 -1
  229. package/packages/theme-chalk/src/tabs.scss +87 -87
  230. package/packages/theme-chalk/src/tips.scss +7 -7
  231. package/packages/theme-chalk/src/toolbar.scss +179 -179
  232. package/packages/theme-chalk/src/tree-group.scss +72 -72
  233. package/packages/theme-chalk/src/tree.scss +165 -165
  234. package/packages/theme-chalk/src/upload.scss +168 -168
  235. package/packages/theme-chalk/src/wxlogin.scss +3 -3
  236. package/packages/tips/index.js +5 -5
  237. package/packages/tips/src/main.vue +141 -141
  238. package/packages/toolbar/index.js +5 -5
  239. package/packages/toolbar/src/main.vue +430 -430
  240. package/packages/tree/index.js +5 -5
  241. package/packages/tree/src/main.vue +2 -2
  242. package/packages/tree-group/index.js +5 -5
  243. package/packages/upload/.DS_Store +0 -0
  244. package/packages/upload/index.js +5 -5
  245. package/packages/upload/src/main.vue +1347 -1343
  246. package/packages/upload/src/picture.js +15 -15
  247. package/packages/wujie/index.js +5 -5
  248. package/packages/wujie/src/main.vue +145 -145
  249. package/packages/wxlogin/index.js +5 -5
  250. package/packages/wxlogin/src/main.vue +128 -128
  251. package/src/.DS_Store +0 -0
  252. package/src/config/api.js +281 -281
  253. package/src/config/image.js +2 -2
  254. package/src/index.js +160 -160
  255. package/src/utils/bus.js +3 -3
  256. package/src/utils/date-util.js +312 -312
  257. package/src/utils/http.js +50 -50
  258. package/src/utils/rules.js +18 -18
  259. package/src/utils/store.js +21 -21
  260. package/src/utils/webSocket.js +107 -107
@@ -1,241 +1,263 @@
1
- <template>
2
- <el-drawer
3
- class="es-simplicity-subMenus"
4
- direction="ltr"
5
- modal-class="es-simplicity-apps-modal"
6
- size="auto"
7
- :modal-append-to-body="false"
8
- :close-on-press-escape="false"
9
- :modal="false"
10
- :with-header="false"
11
- :wrapperClosable="false"
12
- :visible.sync="show"
13
- >
14
- <div
15
- class="es-simplicity-menus"
16
- :class="{ 'es-simplicity-menus-plus': mode == 'plus' }"
17
- >
18
- <div class="es-simplicity-menus-box" :style="{ width: width + 'px' }">
19
- <div class="es-simplicity-menus-title">
20
- <span class="es-simplicity-menus-title-text" v-if="!fold">{{
21
- title || text
22
- }}</span>
23
- <i
24
- class="es-icon-shouqicaidan es-simplicity-menus-title-icon"
25
- v-show="!fold"
26
- @click="handleFold(true)"
27
- ></i>
28
- <i
29
- class="es-icon-shouqicaidan-right es-simplicity-menus-title-icon"
30
- v-show="fold"
31
- @click="handleFold(false)"
32
- ></i>
33
- </div>
34
- <menu-list
35
- :active="actives[0]"
36
- :data="menus"
37
- :menuIcon="menuIcon"
38
- :color="color"
39
- :backgroundColor="backgroundColor"
40
- :fold="fold"
41
- :width="size"
42
- @menter="
43
- (res) => {
44
- this.getData(res, 0, true);
45
- }
46
- "
47
- @mleave="
48
- (res) => {
49
- this.getData(res, 0, false);
50
- }
51
- "
52
- @hover="handleHover"
53
- @command="handleCommand"
54
- ></menu-list>
55
- </div>
56
- <div
57
- class="es-simplicity-menus-view"
58
- @mouseleave="handleLeave"
59
- @mouseenter="handleEnter"
60
- v-show="subMenus.length"
61
- >
62
- <div
63
- class="es-simplicity-menus-box"
64
- v-for="(item, index) in subMenus"
65
- :key="item.id"
66
- >
67
- <div class="es-simplicity-menus-title">
68
- <span class="es-simplicity-menus-title-text">{{
69
- item.name || item.text || item.title
70
- }}</span>
71
- </div>
72
- <menu-list
73
- :active="actives[index + 1]"
74
- :data="[...item.children, ...item.fourthTabs]"
75
- :menuIcon="menuIcon"
76
- :color="color"
77
- :backgroundColor="backgroundColor"
78
- :width="size"
79
- @menter="
80
- (res) => {
81
- getData(res, index + 1, true);
82
- }
83
- "
84
- @mleave="
85
- (res) => {
86
- getData(res, index + 1, false);
87
- }
88
- "
89
- @command="handleCommand"
90
- ></menu-list>
91
- </div>
92
- </div>
93
- </div>
94
- </el-drawer>
95
- </template>
96
-
97
- <script>
98
- import MenuList from './menu-list.vue';
99
- export default {
100
- name: 'SubMenu',
101
- components: { MenuList },
102
- props: {
103
- mode: String,
104
- title: String,
105
- active: String,
106
- closed: Boolean,
107
- color: {
108
- type: [String, Array],
109
- default: '#fff'
110
- },
111
- backgroundColor: {
112
- type: [String, Array],
113
- default() {
114
- return [
115
- '#FF9C52',
116
- '#2591F7',
117
- '#17C27B',
118
- '#1265D7',
119
- '#FFC724',
120
- '#E34D59'
121
- ];
122
- }
123
- },
124
- size: {
125
- type: Number,
126
- default: 220
127
- },
128
- visible: Boolean,
129
- text: String,
130
- menuIcon: String,
131
- children: {
132
- type: Array,
133
- default() {
134
- return [];
135
- }
136
- },
137
- fourthTabs: {
138
- type: Array,
139
- default() {
140
- return [];
141
- }
142
- }
143
- },
144
- data() {
145
- return {
146
- fold: this.closed,
147
- width: this.size,
148
- subMenus: [],
149
- isEnter: false,
150
- timer: null,
151
- actives: []
152
- };
153
- },
154
- computed: {
155
- menus() {
156
- return [...this.children, ...this.fourthTabs];
157
- },
158
- show: {
159
- get() {
160
- return this.visible;
161
- },
162
- set(val) {
163
- this.$emit('update:visible', val);
164
- return val;
165
- }
166
- }
167
- },
168
- watch: {
169
- closed(val) {
170
- this.fold = val;
171
- if (val) {
172
- this.width = 48;
173
- } else {
174
- this.width = this.size;
175
- }
176
- }
177
- },
178
- created() {},
179
- mounted() {},
180
- methods: {
181
- handleFold(res) {
182
- this.fold = res;
183
- if (res) {
184
- this.width = 48;
185
- } else {
186
- this.width = this.size;
187
- }
188
- this.$emit('update:closed', res);
189
- },
190
- handleCommand(res) {
191
- this.$emit('command', res);
192
- },
193
- getData(res, n, is) {
194
- this.isEnter = is;
195
- if (is) {
196
- this.actives.splice(n);
197
- if (this.actives[n]) {
198
- this.actives[n] = res.id;
199
- } else {
200
- this.actives.push(res.id);
201
- }
202
- this.subMenus.splice(n);
203
- let { children, fourthTabs } = res;
204
- if (
205
- (children && children.length) ||
206
- (fourthTabs && fourthTabs.length)
207
- ) {
208
- this.subMenus = this.subMenus.concat(res);
209
- }
210
- } else {
211
- if (n == 0) {
212
- clearTimeout(this.timer);
213
- this.timer = setTimeout(() => {
214
- if (res && !this.isEnter) {
215
- this.subMenus = [];
216
- this.actives = [];
217
- }
218
- }, 300);
219
- }
220
- }
221
- },
222
- handleHover(res) {
223
- this.isEnter = res;
224
- //if(this)
225
- },
226
- clearSubmenu() {
227
- this.$refs.menus.clearActive();
228
- this.subMenus = [];
229
- },
230
- handleLeave() {
231
- this.subMenus = [];
232
- this.actives = [];
233
- },
234
- handleEnter() {
235
- this.isEnter = true;
236
- }
237
- }
238
- };
239
- </script>
240
-
241
- <style lang="scss" scoped></style>
1
+ <template>
2
+ <el-drawer
3
+ class="es-simplicity-subMenus"
4
+ direction="ltr"
5
+ modal-class="es-simplicity-apps-modal"
6
+ size="auto"
7
+ :modal-append-to-body="false"
8
+ :close-on-press-escape="false"
9
+ :modal="false"
10
+ :with-header="false"
11
+ :wrapperClosable="false"
12
+ :visible.sync="show"
13
+ >
14
+ <div
15
+ class="es-simplicity-menus"
16
+ :class="{ 'es-simplicity-menus-plus': mode == 'plus' }"
17
+ >
18
+ <div class="es-simplicity-menus-box" :style="{ width: width + 'px' }">
19
+ <div class="es-simplicity-menus-title">
20
+ <span class="es-simplicity-menus-title-text" v-if="!fold">{{
21
+ title || text
22
+ }}</span>
23
+ <i
24
+ class="es-icon-shouqicaidan es-simplicity-menus-title-icon"
25
+ v-show="!fold"
26
+ @click="handleFold(true)"
27
+ ></i>
28
+ <i
29
+ class="es-icon-shouqicaidan-right es-simplicity-menus-title-icon"
30
+ v-show="fold"
31
+ @click="handleFold(false)"
32
+ ></i>
33
+ </div>
34
+ <div v-if="collapse" class="es-simplicity-menus-scrollbar">
35
+ <es-menu
36
+ popperClass="es-simplicity_menus"
37
+ :menu-class="
38
+ fold
39
+ ? 'es-simplicity_menus es-simplicity_menus-fold'
40
+ : 'es-simplicity_menus'
41
+ "
42
+ :data="menus"
43
+ :menuIcon="menuIcon"
44
+ :color="color"
45
+ :backgroundColor="backgroundColor"
46
+ :show-title="false"
47
+ :collapse="fold"
48
+ @select="handleSelect"
49
+ ></es-menu>
50
+ </div>
51
+ <menu-list
52
+ v-else
53
+ :active="actives[0]"
54
+ :data="menus"
55
+ :menuIcon="menuIcon"
56
+ :color="color"
57
+ :backgroundColor="backgroundColor"
58
+ :fold="fold"
59
+ :width="size"
60
+ @menter="
61
+ (res) => {
62
+ this.getData(res, 0, true);
63
+ }
64
+ "
65
+ @mleave="
66
+ (res) => {
67
+ this.getData(res, 0, false);
68
+ }
69
+ "
70
+ @hover="handleHover"
71
+ @command="handleCommand"
72
+ ></menu-list>
73
+ </div>
74
+ <div
75
+ class="es-simplicity-menus-view"
76
+ @mouseleave="handleLeave"
77
+ @mouseenter="handleEnter"
78
+ v-show="subMenus.length"
79
+ >
80
+ <div
81
+ class="es-simplicity-menus-box"
82
+ v-for="(item, index) in subMenus"
83
+ :key="item.id"
84
+ >
85
+ <div class="es-simplicity-menus-title">
86
+ <span class="es-simplicity-menus-title-text">{{
87
+ item.name || item.text || item.title
88
+ }}</span>
89
+ </div>
90
+ <menu-list
91
+ :active="actives[index + 1]"
92
+ :data="[...item.children, ...item.fourthTabs]"
93
+ :menuIcon="menuIcon"
94
+ :color="color"
95
+ :backgroundColor="backgroundColor"
96
+ :width="size"
97
+ @menter="
98
+ (res) => {
99
+ getData(res, index + 1, true);
100
+ }
101
+ "
102
+ @mleave="
103
+ (res) => {
104
+ getData(res, index + 1, false);
105
+ }
106
+ "
107
+ @command="handleCommand"
108
+ ></menu-list>
109
+ </div>
110
+ </div>
111
+ </div>
112
+ </el-drawer>
113
+ </template>
114
+
115
+ <script>
116
+ import MenuList from './menu-list.vue';
117
+ export default {
118
+ name: 'SubMenu',
119
+ components: { MenuList },
120
+ props: {
121
+ mode: String,
122
+ collapse: Boolean,
123
+ title: String,
124
+ active: String,
125
+ closed: Boolean,
126
+ color: {
127
+ type: [String, Array],
128
+ default: '#fff'
129
+ },
130
+ backgroundColor: {
131
+ type: [String, Array],
132
+ default() {
133
+ return [
134
+ '#FF9C52',
135
+ '#2591F7',
136
+ '#17C27B',
137
+ '#1265D7',
138
+ '#FFC724',
139
+ '#E34D59'
140
+ ];
141
+ }
142
+ },
143
+ size: {
144
+ type: Number,
145
+ default: 220
146
+ },
147
+ visible: Boolean,
148
+ text: String,
149
+ menuIcon: String,
150
+ children: {
151
+ type: Array,
152
+ default() {
153
+ return [];
154
+ }
155
+ },
156
+ fourthTabs: {
157
+ type: Array,
158
+ default() {
159
+ return [];
160
+ }
161
+ }
162
+ },
163
+ data() {
164
+ return {
165
+ fold: this.closed,
166
+ width: this.size,
167
+ subMenus: [],
168
+ isEnter: false,
169
+ timer: null,
170
+ actives: []
171
+ };
172
+ },
173
+ computed: {
174
+ menus() {
175
+ return [...this.children, ...this.fourthTabs];
176
+ },
177
+ show: {
178
+ get() {
179
+ return this.visible;
180
+ },
181
+ set(val) {
182
+ this.$emit('update:visible', val);
183
+ return val;
184
+ }
185
+ }
186
+ },
187
+ watch: {
188
+ closed(val) {
189
+ this.fold = val;
190
+ if (val) {
191
+ this.width = 48;
192
+ } else {
193
+ this.width = this.size;
194
+ }
195
+ }
196
+ },
197
+ created() {},
198
+ mounted() {},
199
+ methods: {
200
+ handleFold(res) {
201
+ this.fold = res;
202
+ if (res) {
203
+ this.width = 48;
204
+ } else {
205
+ this.width = this.size;
206
+ }
207
+ this.$emit('update:closed', res);
208
+ },
209
+ handleCommand(res) {
210
+ this.$emit('command', res);
211
+ },
212
+ handleSelect(res) {
213
+ this.$emit('command', res.node);
214
+ },
215
+ getData(res, n, is) {
216
+ this.isEnter = is;
217
+ if (is) {
218
+ this.actives.splice(n);
219
+ if (this.actives[n]) {
220
+ this.actives[n] = res.id;
221
+ } else {
222
+ this.actives.push(res.id);
223
+ }
224
+ this.subMenus.splice(n);
225
+ let { children, fourthTabs } = res;
226
+ if (
227
+ (children && children.length) ||
228
+ (fourthTabs && fourthTabs.length)
229
+ ) {
230
+ this.subMenus = this.subMenus.concat(res);
231
+ }
232
+ } else {
233
+ if (n == 0) {
234
+ clearTimeout(this.timer);
235
+ this.timer = setTimeout(() => {
236
+ if (res && !this.isEnter) {
237
+ this.subMenus = [];
238
+ this.actives = [];
239
+ }
240
+ }, 300);
241
+ }
242
+ }
243
+ },
244
+ handleHover(res) {
245
+ this.isEnter = res;
246
+ //if(this)
247
+ },
248
+ clearSubmenu() {
249
+ this.$refs.menus.clearActive();
250
+ this.subMenus = [];
251
+ },
252
+ handleLeave() {
253
+ this.subMenus = [];
254
+ this.actives = [];
255
+ },
256
+ handleEnter() {
257
+ this.isEnter = true;
258
+ }
259
+ }
260
+ };
261
+ </script>
262
+
263
+ <style lang="scss" scoped></style>