@lambo-design/pro-layout 1.0.0-beta.45 → 1.0.0-beta.451

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 (40) hide show
  1. package/package.json +11 -4
  2. package/src/components/pro-layout-header/index.vue +220 -0
  3. package/src/components/pro-layout-header/pro-layout-logo/index.vue +206 -0
  4. package/src/components/pro-layout-header/pro-layout-nav/components/pro-layout-nav-slide-menu.vue +399 -0
  5. package/src/components/pro-layout-header/pro-layout-nav/index-slide.vue +226 -0
  6. package/src/components/pro-layout-header/pro-layout-nav/index.vue +565 -0
  7. package/src/components/pro-layout-header/pro-layout-slogan/index.vue +40 -0
  8. package/src/components/pro-layout-header/pro-layout-tools/components/pro-layout-tools-quick-collect.vue +79 -0
  9. package/src/components/pro-layout-header/pro-layout-tools/components/pro-layout-tools-quick-document.vue +116 -0
  10. package/src/components/pro-layout-header/pro-layout-tools/components/pro-layout-tools-quick-fullscreen.vue +144 -0
  11. package/src/components/pro-layout-header/pro-layout-tools/components/pro-layout-tools-quick-icons.vue +99 -0
  12. package/src/components/pro-layout-header/pro-layout-tools/components/pro-layout-tools-quick-intl.vue +110 -0
  13. package/src/components/pro-layout-header/pro-layout-tools/components/pro-layout-tools-quick-notice.vue +133 -0
  14. package/src/components/pro-layout-header/pro-layout-tools/components/pro-layout-tools-quick-search.vue +305 -0
  15. package/src/components/pro-layout-header/pro-layout-tools/components/pro-layout-tools-quick-todo.vue +145 -0
  16. package/src/components/pro-layout-header/pro-layout-tools/components/pro-layout-tools-user.vue +64 -0
  17. package/src/components/pro-layout-header/pro-layout-tools/index.vue +38 -0
  18. package/src/components/pro-layout-header/pro-layout-trigger/index.vue +84 -0
  19. package/src/components/{pro-layout-sider-collapsed-menu.vue → pro-layout-sider/components/pro-layout-sider-collapsed-menu.vue} +30 -11
  20. package/src/components/{pro-layout-sider-icon.vue → pro-layout-sider/components/pro-layout-sider-icon.vue} +2 -2
  21. package/src/components/pro-layout-sider/components/pro-layout-sider-menu-item.vue +137 -0
  22. package/src/components/pro-layout-sider/components/pro-layout-sider-other-menu.vue +140 -0
  23. package/src/components/pro-layout-sider/components/pro-layout-sider-search.vue +345 -0
  24. package/src/components/pro-layout-sider/index.vue +477 -0
  25. package/src/components/{pro-layout-tabs.vue → pro-layout-tabs/index.vue} +118 -23
  26. package/src/index.vue +306 -40
  27. package/src/styles/color.less +267 -0
  28. package/src/styles/images/xiaoxitongzhi.png +0 -0
  29. package/src/styles/other-menu.less +63 -111
  30. package/src/utils/menuItem.js +10 -0
  31. package/src/utils/sider.js +16 -1
  32. package/src/components/pro-layout-header.vue +0 -52
  33. package/src/components/pro-layout-logo.vue +0 -79
  34. package/src/components/pro-layout-nav.vue +0 -150
  35. package/src/components/pro-layout-other-menu.vue +0 -138
  36. package/src/components/pro-layout-sider-menu-item.vue +0 -37
  37. package/src/components/pro-layout-sider.vue +0 -240
  38. package/src/components/pro-layout-tools-user.vue +0 -84
  39. package/src/components/pro-layout-tools.vue +0 -21
  40. package/src/components/pro-layout-trigger.vue +0 -48
@@ -0,0 +1,345 @@
1
+ <template>
2
+ <div class="search-fast-con" :class="tabsHeight != 46 ? 'custom-tabs' : ''">
3
+ <div class="search-fast-con-side" >
4
+ <div class="sideInput" @click="handleSideClick">
5
+ <Input v-if="searchType === 0" v-model="searchText" clearable :placeholder="t('pro-layout.side.search-menu')" font-size="8px"
6
+ @on-change="handleInput" :border="false" @on-blur="searchSideModal = false">
7
+ <template #prefix>
8
+ <Icon type="ios-search" size="16"/>
9
+ </template>
10
+ </Input>
11
+ </div>
12
+ </div>
13
+ <Modal v-model="searchSideModal" class="search-fast-con-side-modal" :class="[defaultClass,tabsHeight != 46 ? 'custom-tabs' : '']"
14
+ footer-hide :closable="false" :mask="false"
15
+ scrollable width="255px">
16
+ <div v-if="spinShow" style="height: 300px;font-size: 19px;">
17
+ <Spin size="large" :show="spinShow">
18
+ <Icon type="ios-loading" size=18 class="search-spin-icon-load"></Icon>
19
+ <div>{{ t('pro-layout.side.search-loading') }}</div>
20
+ </Spin>
21
+ </div>
22
+ <div v-else class="search-content">
23
+ <div v-for="(item,index) in menuData" :key="index" >
24
+ <div class="menu-side-style" @click="handleSelect(item)" @mouseenter="handleMouseEnter(index)" @mouseleave="handleMouseLeave(index)">
25
+ <div :style="getScrollingStyle(item.label)" class="text" :class="{ 'scrolling': isHovered[index] && shouldScroll(item.label) }">
26
+ <Icon :type="item.icon" style="margin-left: 10.6px;min-width: 14px" size="14"></Icon>
27
+ <span style="margin-left: 9.5px">{{ item.label }}</span>
28
+ </div>
29
+ </div>
30
+ </div>
31
+ <div v-if="menuData.length === 0">
32
+ <span class="no-result">{{ t('pro-layout.side.search-no-data') }}</span>
33
+ </div>
34
+ </div>
35
+ </Modal>
36
+ </div>
37
+ </template>
38
+ <script>
39
+ import Bus from "@lambo-design/shared/utils/bus";
40
+ import {deepCopy} from "@lambo-design/shared/utils/assist";
41
+ import {getThemeVarByKey} from "@lambo-design/shared/utils/theme";
42
+ import {getAllElements} from "@lambo-design/shared/utils/platform"
43
+ import Locale from "@lambo-design/core/src/mixins/locale";
44
+
45
+ export default {
46
+ name: "FastSearch",
47
+ mixins: [Locale],
48
+ props: {
49
+ searchType: '',
50
+ menuList: {
51
+ type: Array,
52
+ default: () => []
53
+ },
54
+ },
55
+ data () {
56
+ return {
57
+ searchText:'',
58
+ appId:'',
59
+ option: [],
60
+ menuData:[],
61
+ noticeData:[],
62
+ isHovered: [],
63
+ select:'',
64
+ searchTopModal:false,
65
+ searchSideModal:false,
66
+ showSearchIcon:true,
67
+ maxWidth: 190,
68
+ spinShow:false,
69
+ systemInfo: {},
70
+ originMenuList: [],
71
+ searchMenuList: [],
72
+ tabsHeight: 46
73
+ }
74
+ },
75
+ computed:{
76
+ defaultClass(){
77
+ if (this.systemInfo && this.systemInfo.layoutSize) {
78
+ let layoutSize = this.systemInfo.layoutSize;
79
+ if (layoutSize == 'default') {
80
+ return 'large';
81
+ } else {
82
+ return '';
83
+ }
84
+ }
85
+ return '';
86
+ }
87
+ },
88
+ watch:{
89
+ treeMenuList(){
90
+ this.filterMenu();
91
+ },
92
+ originMenuList(){
93
+ this.filterMenu();
94
+ }
95
+ },
96
+ methods:{
97
+ initListener(){
98
+ Bus.$on('system-info',(data)=>{
99
+ this.initSystemInfo(data)
100
+ })
101
+ Bus.$on('menu-list',(data)=>{
102
+ this.initMenu(data)
103
+ });
104
+ Bus.$on('tree-menu-list',(data)=>{
105
+ this.initTreeMenu(data);
106
+ })
107
+ },
108
+ destroyListener(){
109
+ Bus.$off('system-info')
110
+ Bus.$off('menu-list')
111
+ Bus.$off('tree-menu-list')
112
+ },
113
+ initSystemInfo(data){
114
+ this.systemInfo = deepCopy(data)
115
+ },
116
+ initMenu(data){
117
+ this.originMenuList = deepCopy(data);
118
+ },
119
+ initTreeMenu(data){
120
+ this.treeMenuList = deepCopy(data);
121
+ },
122
+ filterMenu(){
123
+ let result = []
124
+ getAllElements(this.treeMenuList,result)
125
+ this.searchMenuList = this.originMenuList.filter(menuItem => menuItem.type === 2 && menuItem.permissionId && result.includes(menuItem.permissionId))
126
+ .map(menuItem => {
127
+ // 检查menuItem对象的icon属性是否为'icon'或'1'
128
+ if (!menuItem.icon) {
129
+ // 如果是,则修改icon属性为'ios-folder-open-outline'
130
+ menuItem.icon = 'ios-folder-open-outline';
131
+ }
132
+ return menuItem;
133
+ });
134
+ },
135
+ handleSelect(item){
136
+ this.$emit('select-menu', item.name,item)
137
+ this.searchSideModal = false
138
+ },
139
+ handleInput() {
140
+ // 使用 filter 方法找到所有匹配的菜单项
141
+ const regex = new RegExp(this.searchText, "i");
142
+ this.menuData = this.searchMenuList.filter(menuItem => {
143
+ return menuItem.label.match(regex);
144
+ });
145
+ },
146
+ handleSideClick(){
147
+ this.searchSideModal = true
148
+ this.handleInput()
149
+ },
150
+ handleMouseEnter(index) {
151
+ this.$set(this.isHovered, index, true); // 将当前菜单项设置为被悬停状态
152
+ },
153
+ handleMouseLeave(index) {
154
+ this.$set(this.isHovered, index, false); // 将当前菜单项设置为非悬停状态
155
+ },
156
+ shouldScroll(text) {
157
+ const span = document.createElement("span");
158
+ span.style.fontSize = "15px"; // 根据实际情况设置字体大小
159
+ span.textContent = text;
160
+ document.body.appendChild(span);
161
+ const shouldScroll = span.offsetWidth > this.maxWidth;
162
+ document.body.removeChild(span);
163
+ return shouldScroll;
164
+ },
165
+ getScrollingStyle(text) {
166
+ const span = document.createElement("span");
167
+ span.style.fontSize = "15px"; // 根据实际情况设置字体大小
168
+ span.textContent = text;
169
+ document.body.appendChild(span);
170
+ let scrollDistance = span.offsetWidth - this.maxWidth;
171
+ document.body.removeChild(span);
172
+ if (scrollDistance > 0) {
173
+ scrollDistance += 15
174
+ return {
175
+ "--scroll-distance": `-${scrollDistance}px`,
176
+ };
177
+ }
178
+ else{
179
+ return{
180
+ "--scroll-duration": `0s`,
181
+ }
182
+ }
183
+ },
184
+ loadingCustomStyle(){
185
+ let themeKey = localStorage.getItem("theme") ? localStorage.getItem("theme") : "default"
186
+ let tabsHeight = getThemeVarByKey(themeKey,'--layout-tabs-height');
187
+ if (tabsHeight) {
188
+ this.tabsHeight = tabsHeight;
189
+ }
190
+ }
191
+ },
192
+ created(){
193
+ this.initListener();
194
+ this.loadingCustomStyle();
195
+ },
196
+ beforeDestroy(){
197
+ this.destroyListener();
198
+ }
199
+ }
200
+ </script>
201
+
202
+ <style lang="less" scoped>
203
+ @import "@lambo-design/core/src/styles/default.less";
204
+ .search-fast-con{
205
+ width: 100%;
206
+ position: absolute;
207
+ top: 0px;
208
+ z-index: 1000;
209
+ .search-fast-con-side{
210
+ width: 100%;
211
+ .sideInput{
212
+ width: 100%;
213
+ padding: 3px 0 4px 0;
214
+ transform: translateX(-14px);
215
+ /deep/.ivu-icon{
216
+ height: 40px;
217
+ line-height: 40px;
218
+ font-weight: 400;
219
+ }
220
+ }
221
+ /deep/.ivu-input{
222
+ font-size: 14px;
223
+ width: 100%;
224
+ height: 40px;
225
+ font-weight: 400;
226
+ border: none;
227
+ text-align:left; /* 确保文本默认左对齐 */
228
+ padding-left: 62px;
229
+ &::placeholder{
230
+ font-size: 14px;
231
+ font-weight: 400;
232
+ }
233
+ }
234
+ /deep/.ivu-icon-ios-search:before {
235
+ margin-right: -54px; /* 向右移动10像素 */
236
+ line-height: 1.6
237
+ }
238
+ }
239
+ &.custom-tabs{
240
+ .search-fast-con-side{
241
+ .sideInput {
242
+ height: 30px;
243
+ /deep/.ivu-icon{
244
+ height: 36px;
245
+ line-height: 36px;
246
+ }
247
+ }
248
+ /deep/.ivu-input{
249
+ height: 36px;
250
+ }
251
+ }
252
+ }
253
+ }
254
+ .search-fast-con-side-modal {
255
+ .search-spin-icon-load{
256
+ animation: ani-search-spin 1s linear infinite;
257
+ }
258
+ .search-content {
259
+ padding-left: 10px;
260
+ padding-top: 8px;
261
+ height: 270px;
262
+ width: 211px;
263
+ margin-left: -13px;
264
+ overflow-x: hidden;
265
+ overflow-y: auto;
266
+ -ms-overflow-style: none; /* Internet Explorer 10+ */
267
+ scrollbar-width: none; /* Firefox */
268
+ &::-webkit-scrollbar {
269
+ display: none; /* Chrome, Safari 和 Opera */
270
+ }
271
+ .menu-side-style{
272
+ font-size: 14px;
273
+ font-weight: 400;
274
+ width: 200px;
275
+ margin-bottom: 8px;
276
+ padding: 2px 0px;
277
+ white-space: nowrap;
278
+ text-overflow: ellipsis;
279
+ cursor: pointer;
280
+ .text {
281
+ display: inline-block;
282
+ &.scrolling {
283
+ animation: scrollText linear infinite;
284
+ animation-duration: 2s; /* 调整滚动速度和持续时间 */
285
+ }
286
+ }
287
+ &:hover {
288
+ overflow: visible;
289
+ cursor: pointer;
290
+ .text {
291
+ animation-play-state: running;
292
+ }
293
+ }
294
+ }
295
+ .no-result{
296
+ display: flex;
297
+ justify-content: center;
298
+ align-items: center;
299
+ font-size: var(--font-size-base,@_font-size-base);
300
+ }
301
+ }
302
+ }
303
+
304
+ </style>
305
+ <style lang="less">
306
+ @import "@lambo-design/core/src/styles/default.less";
307
+ .search-fast-con-side-modal {
308
+ .ivu-modal{
309
+ margin-left: 0px;
310
+ margin-top: 14px;
311
+ .ivu-modal-content{
312
+ width: 220px;
313
+ margin-top: -18px;
314
+ height: 270px;
315
+ .ivu-modal-body{
316
+ padding: 0px 16px 16px 16px;
317
+ }
318
+ }
319
+ }
320
+ &.large{
321
+ .ivu-modal {
322
+ margin-left : 0px;
323
+ margin-top : 28px;
324
+ }
325
+ }
326
+ &.custom-tabs{
327
+ .ivu-modal {
328
+ margin-top : 5px;
329
+ }
330
+ }
331
+ }
332
+ @keyframes scrollText {
333
+ 0% {
334
+ transform: translateX(0);
335
+ }
336
+ 100% {
337
+ transform: translateX(var(--scroll-distance, 0)); /* 调整滚动的距离 */
338
+ }
339
+ }
340
+ @keyframes ani-search-spin {
341
+ from { transform: rotate(0deg);}
342
+ 50% { transform: rotate(180deg);}
343
+ to { transform: rotate(360deg);}
344
+ }
345
+ </style>