agilebuilder-ui 1.1.24 → 1.1.25

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 (51) hide show
  1. package/index.html +10 -4
  2. package/lib/{401-4a0b2ff3.js → 401-c1ecc1a9.js} +1 -1
  3. package/lib/{404-675a2b11.js → 404-a507cf9c.js} +1 -1
  4. package/lib/favicon.svg +29 -0
  5. package/lib/{iframe-page-38a9c584.js → iframe-page-32671903.js} +1 -1
  6. package/lib/{index-e23f840f.js → index-ce3ae297.js} +4171 -4174
  7. package/lib/super-ui.css +1 -1
  8. package/lib/super-ui.js +1 -1
  9. package/lib/super-ui.umd.cjs +54 -54
  10. package/lib/{tab-content-iframe-index-e6bc24b5.js → tab-content-iframe-index-55b69efd.js} +1 -1
  11. package/lib/{tab-content-index-5a36eab4.js → tab-content-index-f8882314.js} +1 -1
  12. package/lib/{tache-subprocess-history-59bda1ed.js → tache-subprocess-history-a2d815d2.js} +1 -1
  13. package/package.json +2 -2
  14. package/packages/hamburger/src/hamburger.vue +23 -21
  15. package/packages/super-grid/src/search-form-open.vue +1 -1
  16. package/packages/super-grid/src/super-grid.vue +4 -5
  17. package/packages/svg-icon/src/svg-icon.vue +1 -1
  18. package/public/favicon.svg +29 -0
  19. package/src/store/modules/system.js +4 -3
  20. package/src/styles/_layout-custom-properties.scss +1 -1
  21. package/src/styles/theme/black/index.scss +5 -5
  22. package/src/styles/theme/black/sidebar.scss +25 -26
  23. package/src/styles/theme/blue/index.scss +2 -2
  24. package/src/styles/theme/blue/sidebar.scss +25 -26
  25. package/src/styles/theme/blue2/index.scss +2 -2
  26. package/src/styles/theme/blue2/sidebar.scss +23 -31
  27. package/src/styles/theme/dark-blue/index.scss +2 -2
  28. package/src/styles/theme/dark-blue/sidebar.scss +33 -34
  29. package/src/styles/theme/default.scss +2 -1
  30. package/src/styles/theme/gray/index.scss +2 -2
  31. package/src/styles/theme/gray/sidebar.scss +23 -33
  32. package/src/styles/theme/green/index.scss +2 -2
  33. package/src/styles/theme/green/sidebar.scss +25 -30
  34. package/src/styles/theme/ocean-blue/index.scss +2 -2
  35. package/src/styles/theme/ocean-blue/sidebar.scss +33 -35
  36. package/src/styles/theme/tiffany-blue-mobile/index.scss +2 -2
  37. package/src/styles/theme/tiffany-blue-mobile/sidebar.scss +33 -33
  38. package/src/utils/common-util.js +28 -24
  39. package/src/utils/iframe-communicator.js +10 -10
  40. package/src/views/dsc-component/Sidebar/Item.vue +14 -30
  41. package/src/views/dsc-component/Sidebar/SidebarItem.vue +41 -1
  42. package/src/views/layout/components/AppMain.vue +7 -6
  43. package/src/views/layout/components/Menubar/Item.vue +12 -38
  44. package/src/views/layout/components/Menubar/SidebarItem.vue +41 -3
  45. package/src/views/layout/components/Menubar/index.vue +1 -6
  46. package/src/views/layout/components/Sidebar/Item.vue +5 -28
  47. package/src/views/layout/components/Sidebar/SidebarItem.vue +41 -1
  48. package/src/views/layout/components/Sidebar/index.vue +1 -1
  49. package/src/views/svg-icon/src/svg-icon.vue +1 -1
  50. package/lib/vite.svg +0 -1
  51. package/public/vite.svg +0 -1
@@ -7,7 +7,7 @@
7
7
  .main-container {
8
8
  height: 100%;
9
9
  transition: margin-left .28s;
10
- margin-left: 224px;
10
+ margin-left: var(--admin-layout-left-menu-expand, 224px);
11
11
  // padding-left: 24px;
12
12
  position: relative;
13
13
  background: #F8F9FA;
@@ -16,7 +16,7 @@
16
16
  // 侧边栏
17
17
  .sidebar-container {
18
18
  transition: width 0.28s;
19
- width: 224px !important;
19
+ width: var(--admin-layout-left-menu-expand, 224px) !important;
20
20
  height: 100%;
21
21
  position: fixed;
22
22
  top: 0;
@@ -32,6 +32,18 @@
32
32
  color: rgba(0, 13, 31, 0.85);
33
33
  background: #FFF;
34
34
  box-shadow: 0px 2px 8px 0px rgba(164, 178, 201, 0.4);
35
+
36
+ & {
37
+ display: flex;
38
+ flex-direction: column;
39
+
40
+ & > .el-scrollbar {
41
+ flex: 1 1 auto;
42
+ .el-menu {
43
+ margin-top: 5px;
44
+ }
45
+ }
46
+ }
35
47
 
36
48
  //reset element-ui css
37
49
  .horizontal-collapse-transition {
@@ -45,10 +57,6 @@
45
57
  .scrollbar-wrapper {
46
58
  overflow-x: hidden !important;
47
59
 
48
- .el-scrollbar__view {
49
- height: calc(100vh - 70px);
50
- }
51
-
52
60
  .system-item {
53
61
  padding-left: 10px;
54
62
  font-size: medium;
@@ -59,15 +67,12 @@
59
67
  }
60
68
 
61
69
  .hamburger-container {
62
- position: absolute;
63
- bottom: 0px;
64
70
  width: 100%;
65
71
  line-height: 48px;
66
72
  height: 48px;
67
73
  background: #FFFFFF;
68
74
  box-shadow: 0px 1px 8px 0px #00000019;
69
75
  border: 1px solid #EAEAEA;
70
- padding: 0 24px;
71
76
  }
72
77
 
73
78
  .is-horizontal {
@@ -80,15 +85,10 @@
80
85
  overflow: hidden;
81
86
  }
82
87
 
83
- .svg-icon {
84
- margin-right: 16px;
85
- }
86
-
87
88
  .el-menu {
88
89
  border: none;
89
90
  height: 100%;
90
91
  width: 100% !important;
91
- margin-top: 5px;
92
92
  background-color: #FFF;
93
93
  color: #000D1F;
94
94
  font-weight: 400;
@@ -96,6 +96,7 @@
96
96
 
97
97
 
98
98
  .el-menu-item {
99
+ position: relative;
99
100
  height: 46px;
100
101
  color: #525A6C;
101
102
  line-height: 46px;
@@ -108,7 +109,15 @@
108
109
  letter-spacing: 0px;
109
110
  text-align: left;
110
111
  box-sizing: border-box;
111
- border-left: 4px solid #1A6BF3
112
+ &::after {
113
+ content: " ";
114
+ position: absolute;
115
+ left: 0;
116
+ top: 0;
117
+ bottom: 0;
118
+ width: 4px;
119
+ background-color: #1A6BF3;
120
+ }
112
121
  }
113
122
 
114
123
  .el-submenu__title {
@@ -120,20 +129,18 @@
120
129
 
121
130
  .hideSidebar {
122
131
  .sidebar-container {
123
- width: 54px !important;
132
+ width: var(--admin-layout-left-menu-collapse, 54px) !important;
133
+ .smb-sidebar-menu-item {
134
+ .smb-sidebar-menu-item-icon {
135
+ & ~ * {
136
+ display: none !important;
137
+ }
138
+ }
139
+ }
124
140
  }
125
141
 
126
142
  .main-container {
127
- margin-left: 54px;
128
- }
129
-
130
- .submenu-title-noDropdown {
131
- padding-left: 20px !important;
132
- position: relative;
133
-
134
- .el-tooltip {
135
- padding: 0 20px !important;
136
- }
143
+ margin-left: var(--admin-layout-left-menu-collapse, 54px);
137
144
  }
138
145
 
139
146
  .el-submenu {
@@ -251,13 +258,6 @@
251
258
  text-align: left;
252
259
  }
253
260
 
254
- .el-menu--vertical {
255
- & > .el-menu {
256
- .svg-icon {
257
- margin-right: 16px;
258
- }
259
- }
260
- }
261
261
  .router-link-active >.is-active{
262
262
  color: $--menu-dont-color;
263
263
  }
@@ -127,32 +127,36 @@ export function getLoginUrl() {
127
127
  } else {
128
128
  systemPath = null
129
129
  }
130
- getPortalFrontendUrl()
131
- .then((portalUrl) => {
132
- let loginUrl = portalUrl + '#/login'
133
- if (systemPath) {
134
- loginUrl = loginUrl + '?systemPath=' + systemPath
135
- }
136
- if (routerPath) {
137
- if (loginUrl.indexOf('?') > 0) {
138
- loginUrl = loginUrl + '&routerPath=' + routerPath
139
- } else {
140
- loginUrl = loginUrl + '?routerPath=' + routerPath
141
- }
130
+ const buildLoginUrl = (portalUrl = '') => {
131
+ let loginUrl = portalUrl + '#/login'
132
+ if (systemPath) {
133
+ loginUrl = loginUrl + '?systemPath=' + systemPath
134
+ }
135
+ if (routerPath) {
136
+ if (loginUrl.indexOf('?') > 0) {
137
+ loginUrl = loginUrl + '&routerPath=' + routerPath
138
+ } else {
139
+ loginUrl = loginUrl + '?routerPath=' + routerPath
142
140
  }
143
- if (param) {
144
- if (loginUrl.indexOf('?') > 0) {
145
- loginUrl = loginUrl + '&' + param
146
- } else {
147
- loginUrl = loginUrl + '?' + param
148
- }
141
+ }
142
+ if (param) {
143
+ if (loginUrl.indexOf('?') > 0) {
144
+ loginUrl = loginUrl + '&' + param
145
+ } else {
146
+ loginUrl = loginUrl + '?' + param
149
147
  }
150
- loginUrl = replacePrefix(loginUrl)
151
- resolve(loginUrl)
152
- })
153
- .catch((error) => {
154
- reject(error)
155
- })
148
+ }
149
+ return replacePrefix(loginUrl)
150
+ }
151
+ if (import.meta.env.DEV) {
152
+ resolve(buildLoginUrl())
153
+ } else {
154
+ getPortalFrontendUrl()
155
+ .then((portalUrl) => resolve(buildLoginUrl(portalUrl)))
156
+ .catch((error) => {
157
+ reject(error)
158
+ })
159
+ }
156
160
  })
157
161
  }
158
162
 
@@ -93,17 +93,17 @@ import store from '../store';
93
93
 
94
94
  // 处理iframe准备就绪
95
95
  handleIframeReady(iframeWindow, origin) {
96
- if (this.pendingIframes.has(iframeWindow)) {
97
- const { resolve } = this.pendingIframes.get(iframeWindow);
96
+ if (this.pendingIframes?.has(iframeWindow)) {
97
+ const { resolve } = this.pendingIframes?.get(iframeWindow);
98
98
  this.registerIframe(iframeWindow, origin);
99
99
  resolve(iframeWindow);
100
- this.pendingIframes.delete(iframeWindow);
100
+ this.pendingIframes?.delete?.(iframeWindow);
101
101
  }
102
102
  }
103
103
 
104
104
  // 注册iframe
105
105
  registerIframe(iframeWindow, origin) {
106
- this.iframeRegistry.set(iframeWindow, origin);
106
+ this.iframeRegistry?.set(iframeWindow, origin);
107
107
  this.sendStateTo(iframeWindow, origin);
108
108
  }
109
109
 
@@ -126,7 +126,7 @@ import store from '../store';
126
126
  // 广播状态到所有已注册的iframe和父窗口
127
127
  broadcastState() {
128
128
  // 发送给子iframe
129
- this.iframeRegistry.forEach((origin, iframeWindow) => {
129
+ this.iframeRegistry?.forEach?.((origin, iframeWindow) => {
130
130
  this.sendStateTo(iframeWindow, origin);
131
131
  });
132
132
 
@@ -150,12 +150,12 @@ import store from '../store';
150
150
  iframe.onload = () => {
151
151
  try {
152
152
  // 存储为待处理iframe,等待IFRAME_READY消息
153
- this.pendingIframes.set(iframe.contentWindow, { resolve, reject });
153
+ this.pendingIframes?.set(iframe.contentWindow, { resolve, reject });
154
154
 
155
155
  // 设置超时拒绝
156
156
  setTimeout(() => {
157
- if (this.pendingIframes.has(iframe.contentWindow)) {
158
- this.pendingIframes.delete(iframe.contentWindow);
157
+ if (this.pendingIframes?.has(iframe.contentWindow)) {
158
+ this.pendingIframes?.delete?.(iframe.contentWindow);
159
159
  reject(new Error('Iframe ready timeout'));
160
160
  }
161
161
  }, 5000);
@@ -189,8 +189,8 @@ import store from '../store';
189
189
 
190
190
  // 清理连接
191
191
  cleanupConnection(targetWindow) {
192
- this.iframeRegistry.delete(targetWindow);
193
- this.pendingIframes.delete(targetWindow);
192
+ this.iframeRegistry?.delete?.(targetWindow);
193
+ this.pendingIframes?.delete?.(targetWindow);
194
194
  }
195
195
 
196
196
  // 销毁实例
@@ -25,57 +25,41 @@ export default defineComponent ({
25
25
  },
26
26
  render(props) {
27
27
  const { title, hasChildren, isRoot } = props
28
- let icon = props.icon
28
+ const icon = props.icon
29
29
  const vnodes = []
30
+ let iconsData = [h(SvgIcon,{'icon-class': 'meun_post' })]
30
31
  if (icon) {
31
32
  if (icon.indexOf('fa-') === 0) {
32
- // 表示以“fa-”开头,使用font-awesome中的图标
33
- icon = 'fa ' + icon
34
- vnodes.push(h('div', {style: {display: 'flex'}}, [h('i', {class: icon, style: {marginRight: '16px'}})]))
35
- // vnodes.push(<div style='display: inline-block;overflow:hidden;'><i class={icon}/></div>)
33
+ iconsData = [h('i',{class: 'fa ' + icon})]
36
34
  } else if (icon.indexOf('svg-') === 0) {
37
- icon = icon.substring(icon.indexOf('svg-') + 4)
38
- vnodes.push(h('div', {style: {display: 'flex'}}, [h(SvgIcon, {'icon-class': icon})]))
39
- // vnodes.push(<div style='display: inline-block;overflow:hidden;'><svg-icon icon-class={icon}/></div>)
35
+ iconsData = [h(SvgIcon,{'icon-class': icon.substring(icon.indexOf('svg-') + 4)})]
40
36
  } else {
41
- icon += ' svg-icon'
42
- vnodes.push(h('div', {style: {display: 'flex'}}, [h('i', {class: icon, style: {marginRight: '16px'}})]))
43
- // vnodes.push(<div style='display: inline-block;overflow:hidden;'><i class={icon} /></div>)
37
+ iconsData = [h('i',{class: icon + ' svg-icon'})]
44
38
  }
45
39
  }
40
+ vnodes.push(h('div', {class: ["smb-sidebar-menu-item-icon"]},iconsData))
46
41
  if (title) {
47
- let width = '130px'
48
- if (hasChildren) {
49
- // 当是父菜单时,为了使后面的三角能显示出来,需要将宽度设小点
50
- // width = '100px'
51
- // boe 反应左侧菜单栏无法展示全部文字,调整
52
- width = '130px'
53
- }
54
42
  if (isRoot) {
55
43
  // 是否是根目录,没有子菜单时
56
- vnodes.push(h('div', {style:{display:'inline-block'}},
44
+ vnodes.push(h('div', {class: ["smb-sidebar-menu-item-title"] },
57
45
  [h('div',{
58
- title:title,
59
- style:{display:'inline-block',width:width,overflow:'hidden','text-overflow':'ellipsis','white-space':'nowrap','word-break':'keep-all'}
46
+ title:title
60
47
  }, title)])
61
48
  )
62
- // vnodes.push(<div style='display: inline-block'>
63
- // <div title={title} style={'display: inline-block;width:' + width + ';overflow:hidden;text-overflow:ellipsis;white-space:nowrap;word-break:keep-all;'}>{(title)}</div>
64
- // </div>)
65
49
  } else {
66
50
  // 有子菜单时
67
- vnodes.push(h('div', {style:{display:'inline-block'}},
51
+ vnodes.push(h('div', {class: ["smb-sidebar-menu-item-title"] },
68
52
  [h('div',{
69
- title:title,
70
- style:{display:'inline-block',width:width,overflow:'hidden','text-overflow':'ellipsis','white-space':'nowrap','word-break':'keep-all'}
53
+ title:title
71
54
  }, title)])
72
55
  )
73
- // vnodes.push(<div slot='title' style='display: inline-block'>
74
- // <div title={title} style={'display: inline-block;width:' + width + ';overflow:hidden;text-overflow:ellipsis;white-space:nowrap;word-break:keep-all;'}>{(title)}</div>
75
- // </div>)
76
56
  }
77
57
  }
78
58
  return vnodes
79
59
  }
80
60
  })
81
61
  </script>
62
+
63
+ <style lang="scss" scoped>
64
+
65
+ </style>
@@ -4,6 +4,7 @@
4
4
  <app-link :to="toPath(item)" @click="clickMenu(toPath(item))">
5
5
  <el-menu-item
6
6
  :index="resolvePath(item.code, item.path, item.pageType, item.newPage)"
7
+ class="smb-sidebar-menu-item"
7
8
  :class="{ 'submenu-title-noDropdown': !isNest }"
8
9
  >
9
10
  <item :icon="item.iconName" :title="getI18nName(item)" :is-root="true" />
@@ -17,6 +18,7 @@
17
18
  :show-timeout="0"
18
19
  :hide-timeout="50"
19
20
  popper-class="sidebar-container-popper"
21
+ class="smb-sidebar-menu-item"
20
22
  >
21
23
  <template v-slot:title>
22
24
  <item
@@ -34,7 +36,7 @@
34
36
  class="nest-menu"
35
37
  />
36
38
  <app-link v-else :to="toPath(child)" @click="clickMenu(toPath(child))">
37
- <el-menu-item :index="resolvePath(child.code, child.path, child.pageType, child.newPage)">
39
+ <el-menu-item :index="resolvePath(child.code, child.path, child.pageType, child.newPage)" class="smb-sidebar-menu-item">
38
40
  <item :icon="child.iconName" :title="getI18nName(child)" />
39
41
  </el-menu-item>
40
42
  </app-link>
@@ -186,3 +188,41 @@ export default {
186
188
  }
187
189
  }
188
190
  </script>
191
+
192
+ <style lang="scss" scoped>
193
+ .smb-sidebar-menu-item {
194
+ position: relative;
195
+ &.el-menu-item, &.el-sub-menu {
196
+ padding: 0 !important;
197
+ &:not(:has(> .el-tooltip__trigger)) {
198
+ display: flex;
199
+ flex-direction: row;
200
+ }
201
+ }
202
+ & > :deep(.el-tooltip__trigger) {
203
+ display: flex;
204
+ flex-direction: row;
205
+ padding: 0 !important;
206
+ }
207
+ :deep(.smb-sidebar-menu-item-icon) {
208
+ display: flex;
209
+ align-items: center;
210
+ justify-content: center;
211
+ width: var(--admin-layout-left-menu-collapse, 54px);
212
+ }
213
+ :deep(.smb-sidebar-menu-item-title) {
214
+ flex: 0 0 calc(100% - var(--admin-layout-left-menu-collapse, 54px) - 35px);
215
+ overflow: hidden;
216
+ white-space: nowrap;
217
+ overflow: hidden;
218
+ text-overflow: ellipsis;
219
+ & > div {
220
+ overflow: hidden;
221
+ white-space: nowrap;
222
+ overflow: hidden;
223
+ text-overflow: ellipsis;
224
+ }
225
+ }
226
+ }
227
+ </style>
228
+
@@ -32,14 +32,15 @@ export default {
32
32
 
33
33
  <style lang="scss" scoped>
34
34
  .app-main ::v-deep{
35
- padding: var(--app-main-padding, 20px);
36
- height: calc(100vh - (var(--app-main-padding, 20px) * 2));
35
+ padding: var(--app-main-padding, 15px);
36
+ height: calc(100vh - (var(--app-main-padding, 15px) * 2));
37
37
  position: relative;
38
38
  overflow: hidden;
39
-
40
- & > .app-container:not(:has( > .three-column-layout, > .el-container)) {
41
- max-height: calc(100vh - (var(--app-main-padding, 20px) * 2));
42
- height: calc(100vh - (var(--app-main-padding, 20px) * 2));
39
+ // :not(:has( > .three-column-layout, > .el-container))
40
+ & > .app-container {
41
+ max-height: calc(100vh - (var(--app-main-padding, 15px) * 2));
42
+ height: calc(100vh - (var(--app-main-padding, 15px) * 2));
43
+ overflow: auto;
43
44
  }
44
45
  }
45
46
  </style>
@@ -33,67 +33,41 @@ export default defineComponent ({
33
33
  },
34
34
  render(props) {
35
35
  const { title, hasChildren, isRoot,code, backlogTotal } = props
36
- let icon = props.icon
36
+ const icon = props.icon
37
37
  const vnodes = []
38
+ let iconsData = [h(SvgIcon,{'icon-class': 'meun_post' })]
38
39
  if (icon) {
39
40
  if (icon.indexOf('fa-') === 0) {
40
- // 表示以“fa-”开头,使用font-awesome中的图标
41
- icon = 'fa ' + icon
42
- vnodes.push(h('div', {style:{display:'inline-block'}},[h('i',{class:icon})]))
43
- // vnodes.push(<div style='display: inline-block;'><i class={icon}/></div>)
41
+ iconsData = [h('i',{class: 'fa ' + icon})]
44
42
  } else if (icon.indexOf('svg-') === 0) {
45
- icon = icon.substring(icon.indexOf('svg-') + 4)
46
- vnodes.push(h('div', {style:{display:'inline-block'}},[h(SvgIcon,{'icon-class':icon})]))
47
- // vnodes.push(<div style='display: inline-block;'><svg-icon icon-class={icon}/></div>)
43
+ iconsData = [h(SvgIcon,{'icon-class': icon.substring(icon.indexOf('svg-') + 4)})]
48
44
  } else {
49
- icon += ' svg-icon'
50
- vnodes.push(h('div', {style:{display:'inline-block'}},[h('i',{class:icon})]))
51
- // vnodes.push(<div style='display: inline-block;'><i class={icon} /></div>)
45
+ iconsData = [h('i',{class: icon + ' svg-icon'})]
52
46
  }
53
47
  }
54
-
48
+ vnodes.push(h('div', {class: ["smb-sidebar-menu-item-icon"]},iconsData))
55
49
  if (title) {
56
- let width = '130px'
57
- if (hasChildren) {
58
- // 当是父菜单时,为了使后面的三角能显示出来,需要将宽度设小点
59
- width = '100px'
60
- }
61
50
  if (isRoot) {
62
51
  // 是否是根目录,没有子菜单时
63
- vnodes.push(h('div', {style:{display:'inline-block',}},
52
+ vnodes.push(h('div', {class: ["smb-sidebar-menu-item-title"]},
64
53
  [h('div',{
65
- title:title,
66
- style:{display:'inline-block',width:width,overflow:'hidden','text-overflow':'ellipsis','white-space':'nowrap','word-break':'keep-all'}
54
+ title:title
67
55
  }, title)])
68
56
  )
69
- // vnodes.push(<div style='display: inline-block'>
70
- // <div title={title} style={'display: inline-block;width:' + width + ';overflow:hidden;text-overflow:ellipsis;white-space:nowrap;word-break:keep-all;'}>{(title)}</div>
71
- // </div>)
72
57
  }else if (code === 'undoneTask') {
73
58
  // 有子菜单时
74
- vnodes.push(h('div', {style:{display:'inline-block'}},
59
+ vnodes.push(h('div', {class: ["smb-sidebar-menu-item-title"]},
75
60
  [h('div',{
76
- title:title,
77
- style:{display:'inline-block',width:width,overflow:'hidden','text-overflow':'ellipsis','white-space':'nowrap','word-break':'keep-all'}
61
+ title:title
78
62
  }, [h(ElBadge,{value:backlogTotal,style:{display:'inline'}},title)])])
79
63
  )
80
- // vnodes.push(<div slot='title' style='display: inline-block'>
81
- // <div title={title} style={'display: inline-block;width:' + width + ';overflow:hidden;text-overflow:ellipsis;white-space:nowrap;word-break:keep-all;'}>
82
- // {(title)}
83
- // <el-badge value={backlogTotal}></el-badge>
84
- // </div>
85
- // </div>)
86
64
  } else {
87
65
  // 有子菜单时
88
- vnodes.push(h('div', {style:{display:'inline-block'}},
66
+ vnodes.push(h('div', {class: ["smb-sidebar-menu-item-title"]},
89
67
  [h('div',{
90
- title:title,
91
- style:{display:'inline-block',width:width,overflow:'hidden','text-overflow':'ellipsis','white-space':'nowrap','word-break':'keep-all'}
68
+ title:title
92
69
  }, title)])
93
70
  )
94
- // vnodes.push(<div slot='title' style='display: inline-block'>
95
- // <div title={title} style={'display: inline-block;width:' + width + ';overflow:hidden;text-overflow:ellipsis;white-space:nowrap;word-break:keep-all;'}>{(title)}</div>
96
- // </div>)
97
71
  }
98
72
  }
99
73
  return vnodes
@@ -4,6 +4,7 @@
4
4
  <app-link :to="toPath(item)" @click="clickMenu(toPath(item))">
5
5
  <el-menu-item
6
6
  :index="item.code + '~~' + item.i18nValue"
7
+ class="smb-sidebar-menu-item"
7
8
  :class="{ 'submenu-title-noDropdown': !isNest }"
8
9
  >
9
10
  <item
@@ -15,7 +16,7 @@
15
16
  </app-link>
16
17
  </template>
17
18
 
18
- <el-sub-menu v-else :index="item.code + '~~' + item.i18nValue">
19
+ <el-sub-menu v-else :index="item.code + '~~' + item.i18nValue" class="smb-sidebar-menu-item">
19
20
  <template v-slot:title>
20
21
  <item
21
22
  :icon="item.iconName"
@@ -30,10 +31,10 @@
30
31
  v-if="child.children && child.children.length > 0"
31
32
  :is-nest="true"
32
33
  :item="child"
33
- class="nest-menu"
34
+ class="nest-menu smb-sidebar-menu-item"
34
35
  />
35
36
  <app-link :key="child.code" v-else :to="toPath(child)" @click="clickMenu(toPath(child))">
36
- <el-menu-item :index="child.code + '~~' + child.i18nValue">
37
+ <el-menu-item :index="child.code + '~~' + child.i18nValue" class="smb-sidebar-menu-item">
37
38
  <item :backlog-total="backlogTotal" :code="child.code" :icon="child.iconName" :title="getI18nName(child)" />
38
39
  </el-menu-item>
39
40
  </app-link>
@@ -249,3 +250,40 @@ export default {
249
250
  },
250
251
  };
251
252
  </script>
253
+
254
+ <style lang="scss" scoped>
255
+ .smb-sidebar-menu-item {
256
+ position: relative;
257
+ &.el-menu-item, &.el-sub-menu {
258
+ padding: 0 !important;
259
+ &:not(:has(> .el-tooltip__trigger)) {
260
+ display: flex;
261
+ flex-direction: row;
262
+ }
263
+ }
264
+ & > :deep(.el-tooltip__trigger) {
265
+ display: flex;
266
+ flex-direction: row;
267
+ padding: 0 !important;
268
+ }
269
+ :deep(.smb-sidebar-menu-item-icon) {
270
+ display: flex;
271
+ align-items: center;
272
+ justify-content: center;
273
+ width: var(--admin-layout-left-menu-collapse, 54px);
274
+ }
275
+ :deep(.smb-sidebar-menu-item-title) {
276
+ flex: 0 0 calc(100% - var(--admin-layout-left-menu-collapse, 54px) - 35px);
277
+ overflow: hidden;
278
+ white-space: nowrap;
279
+ overflow: hidden;
280
+ text-overflow: ellipsis;
281
+ & > div {
282
+ overflow: hidden;
283
+ white-space: nowrap;
284
+ overflow: hidden;
285
+ text-overflow: ellipsis;
286
+ }
287
+ }
288
+ }
289
+ </style>
@@ -11,7 +11,7 @@
11
11
  <el-menu-item
12
12
  v-if="systemName"
13
13
  :title="systemName"
14
- class="system-item"
14
+ class="system-item smb-sidebar-menu-item"
15
15
  disabled
16
16
  index="1"
17
17
  style="padding-left: 10px"
@@ -253,8 +253,3 @@ export default {
253
253
  },
254
254
  }
255
255
  </script>
256
- <style>
257
- .aa{
258
- background-color: red;
259
- }
260
- </style>
@@ -9,43 +9,20 @@ export default function render(_props, _context) {
9
9
  }
10
10
  const { icon, title, hasChildren } = context.props
11
11
  const vnodes = []
12
+ let iconsData = <svg-icon icon-class={ icon || 'meun_post'} />
12
13
 
13
- if (icon) {
14
- vnodes.push(
15
- <div style="display: inline-block;">
16
- <svg-icon icon-class={icon} />
17
- </div>
18
- )
19
- }
14
+ vnodes.push(<div class="smb-sidebar-menu-item-icon">{ iconsData }</div>)
20
15
 
21
16
  if (title) {
22
- let width = '130px'
23
- if (hasChildren) {
24
- // 当是父菜单时,为了使后面的三角能显示出来,需要将宽度设小点
25
- width = '100px'
26
- }
27
- const className = window.$vueApp.config.globalProperties.className
28
- if (className && className === 'blue2') {
29
- // blue2样式的左侧菜单宽度为240px
30
- width = '230px'
31
- if (hasChildren) {
32
- // 当是父菜单时,为了使后面的三角能显示出来,需要将宽度设小点
33
- width = '200px'
34
- }
35
- }
36
17
  vnodes.push(
37
- <div slot="title" style="display: inline-block">
18
+ <template slot="title">
38
19
  <div
39
20
  title={title}
40
- style={
41
- 'display: inline-block;width:' +
42
- width +
43
- ';overflow:hidden;text-overflow:ellipsis;white-space:nowrap;word-break:keep-all;'
44
- }
21
+ class="smb-sidebar-menu-item-title"
45
22
  >
46
23
  {title}
47
24
  </div>
48
- </div>
25
+ </template>
49
26
  )
50
27
  }
51
28
  return vnodes