@lambo-design/pro-layout 1.0.0-beta.202 → 1.0.0-beta.203

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,17 +1,17 @@
1
- {
2
- "name": "@lambo-design/pro-layout",
3
- "version": "1.0.0-beta.202",
4
- "description": "",
5
- "main": "index.js",
6
- "scripts": {},
7
- "author": "lambo",
8
- "license": "ISC",
9
- "publishConfig": {
10
- "access": "public",
11
- "registry": "https://registry.npmjs.org/"
12
- },
13
- "devDependencies": {
14
- "@lambo-design/core": "workspace:^",
15
- "@lambo-design/shared": "workspace:^"
16
- }
17
- }
1
+ {
2
+ "name": "@lambo-design/pro-layout",
3
+ "version": "1.0.0-beta.203",
4
+ "description": "",
5
+ "main": "index.js",
6
+ "author": "lambo",
7
+ "license": "ISC",
8
+ "publishConfig": {
9
+ "access": "public",
10
+ "registry": "https://registry.npmjs.org/"
11
+ },
12
+ "devDependencies": {
13
+ "@lambo-design/shared": "^1.0.0-beta.114",
14
+ "@lambo-design/core": "^4.7.1-beta.118"
15
+ },
16
+ "scripts": {}
17
+ }
@@ -12,18 +12,6 @@
12
12
  <div class="tools-box">
13
13
  <LamboProTools></LamboProTools>
14
14
  </div>
15
- <!--<div class="search-box" v-if="isShowSearch === '1'" >-->
16
- <!-- <FastSearch-->
17
- <!-- style="margin-right: 10px"-->
18
- <!-- :searchType="1"-->
19
- <!-- @on-select="handleSelect"-->
20
- <!-- ></FastSearch>-->
21
- <!-- </div>-->
22
- <!-- <Menu ref="menu"-->
23
- <!-- :active-name="activeName"-->
24
- <!-- :open-names="openedNames"-->
25
- <!-- @on-select="handleSelect">-->
26
- <!-- </Menu>-->
27
15
  </div>
28
16
  </template>
29
17
 
@@ -20,7 +20,6 @@
20
20
  <script>
21
21
  import Bus from '@lambo-design/shared/utils/bus'
22
22
  import { deepCopy } from '@lambo-design/shared/utils/assist'
23
- import config from '@lambo-design/shared/config/config'
24
23
 
25
24
  export default {
26
25
  name: 'pro-layout-',
@@ -26,7 +26,7 @@
26
26
  placement="left"
27
27
  >
28
28
  <div v-if="drawer.type=='history'" class="other-menu-history">
29
- <div v-for="(item,index) in list" :key="index" class="other-menu-history-item">
29
+ <div v-for="(item,index) in historyMenuList" :key="index" class="other-menu-history-item">
30
30
  <div class="content" @click="handleClick(item)">
31
31
  <Icon :type="item.icon"></Icon>
32
32
  <span> {{ item.label }}</span>
@@ -37,7 +37,7 @@
37
37
  </div>
38
38
  </div>
39
39
  <div v-if="drawer.type=='collect'" class="other-menu-collect">
40
- <div v-for="(item,index) in list" :key="index" class="other-menu-collect-item" @click="handleClick(item)">
40
+ <div v-for="(item,index) in collectMenuList" :key="index" class="other-menu-collect-item" @click="handleClick(item)">
41
41
  <div class="content" @click="handleClick(item)">
42
42
  <Icon :type="item.icon"></Icon>
43
43
  <span> {{ item.label }}</span>
@@ -52,9 +52,7 @@
52
52
  </template>
53
53
 
54
54
  <script>
55
- import ajax from '@lambo-design/shared/utils/ajax';
56
- import config from "@lambo-design/shared/config/config";
57
-
55
+ import Bus from "@lambo-design/shared/utils/bus";
58
56
 
59
57
  export default {
60
58
  name: "other-menu",
@@ -63,21 +61,17 @@ export default {
63
61
  collapsed: {
64
62
  type: Boolean,
65
63
  default:false
66
- },
67
- serverContext: {
68
- type: String,
69
- default: () => config.upmsServerContext // 设置默认值
70
64
  }
71
65
  },
72
66
  data() {
73
67
  return {
68
+ historyMenuList: [],
69
+ collectMenuList: [],
74
70
  drawer: {
75
71
  model: false,
76
- url: '',
77
72
  title: '',
78
73
  type: '',
79
- },
80
- list: []
74
+ }
81
75
  }
82
76
  },
83
77
  computed: {
@@ -90,47 +84,49 @@ export default {
90
84
  }
91
85
  },
92
86
  methods: {
87
+ initListener(){
88
+ Bus.$on('history-menu-list',(data)=>{
89
+ this.initHistory(data)
90
+ });
91
+ Bus.$on('collect-menu-list', (data)=> {
92
+ this.initCollect(data)
93
+ })
94
+ },
95
+ destroyListener(){
96
+ Bus.$off('history-menu-list')
97
+ Bus.$off('collect-menu-list')
98
+ },
99
+ initHistory(historyMenuList){
100
+ this.historyMenuList = historyMenuList;
101
+ },
102
+ initCollect(collectMenuList){
103
+ this.collectMenuList = collectMenuList;
104
+ },
93
105
  onChange(value) {
94
106
  if (value == 'history') {
95
107
  this.drawer.title = '历史菜单'
96
- this.drawer.url = '/manage/upmsMenuHistory/listByLimit'
97
108
  } else {
98
109
  this.drawer.title = '收藏菜单'
99
- this.drawer.url = '/manage/upmsMenuCollect/list'
100
110
  }
101
- this.getList()
102
111
  this.drawer.type = value
103
112
  this.drawer.model = !this.drawer.model
104
113
  },
105
- getList() {
106
- this.list = []
107
- ajax.get(this.serverContext + this.drawer.url).then(resp => {
108
- if (resp.data.code == 1) {
109
- this.list = resp.data.data
110
- if (this.drawer.type == 'collect') {
111
- this.$store.commit('setCollectMenuList', this.list)
112
- }
113
- }
114
- })
115
- },
116
114
  handleClick(item) {
117
- this.$emit('on-select', item.name)
118
115
  this.drawer.model = false
116
+ this.$emit('menu-click', item.name)
119
117
  },
120
118
  handleHistoryDelete(item) {
121
- ajax.get(this.serverContext + "/manage/upmsMenuHistory/delete/" + item.historyId).then(resp => {
122
- if (resp.data.code == 1) {
123
- this.getList()
124
- }
125
- })
119
+ Bus.$emit('delete-history-menu',item)
126
120
  },
127
121
  handleCollectDelete(item) {
128
- ajax.get(this.serverContext + "/manage/upmsMenuCollect/delete/" + item.collectId).then(resp => {
129
- if (resp.data.code == 1) {
130
- this.getList()
131
- }
132
- })
122
+ Bus.$emit('delete-collect-menu',item)
133
123
  }
124
+ },
125
+ created(){
126
+ this.initListener();
127
+ },
128
+ beforeDestroy(){
129
+ this.destroyListener();
134
130
  }
135
131
  }
136
132
  </script>
@@ -138,5 +134,4 @@ export default {
138
134
 
139
135
  <style lang="less">
140
136
  @import '../styles/other-menu.less';
141
- @import "@lambo-design/core/src/styles/default.less";
142
137
  </style>
@@ -33,7 +33,7 @@
33
33
  </template>
34
34
  </Menu>
35
35
 
36
- <ProLayoutOtherMenu :collapsed="collapsed" @on-select="selectHandle" :server-context="serverContext"></ProLayoutOtherMenu>
36
+ <ProLayoutOtherMenu :collapsed="collapsed"></ProLayoutOtherMenu>
37
37
  <FastSearch
38
38
  v-show="!collapsed"
39
39
  style="margin-right: 35px; margin-left: 1px; padding-top: 1px"
package/src/index.vue CHANGED
@@ -11,7 +11,7 @@
11
11
  :width="220"
12
12
  :collapsed-width="64"
13
13
  v-model="collapsed">
14
- <LamboProLayoutSider ref="sider" @on-select="handleSelect" :server-context="serverContext"></LamboProLayoutSider>
14
+ <LamboProLayoutSider ref="sider"></LamboProLayoutSider>
15
15
  </i-sider>
16
16
  <i-content class="pro-layout-content">
17
17
  <i-layout class="pro-layout-content-layout">
@@ -75,6 +75,14 @@ export default {
75
75
  type: Array,
76
76
  default: () => []
77
77
  },
78
+ historyMenuList: {
79
+ type: Array,
80
+ default: () => []
81
+ },
82
+ collectMenuList: {
83
+ type: Array,
84
+ default: () => []
85
+ },
78
86
  homeRouter: {
79
87
  type: Object,
80
88
  default: () => {
@@ -102,12 +110,14 @@ export default {
102
110
  },
103
111
  computed: {
104
112
  allData(){
105
- const { systemInfo, userInfo, navList, menuList, homeRouter} = this;
113
+ const { systemInfo, userInfo, navList, menuList, historyMenuList, collectMenuList, homeRouter} = this;
106
114
  return {
107
115
  systemInfo,
108
116
  userInfo,
109
117
  navList,
110
118
  menuList,
119
+ historyMenuList,
120
+ collectMenuList,
111
121
  homeRouter
112
122
  }
113
123
  },
@@ -155,7 +165,12 @@ export default {
155
165
  Bus.$on('tag-list',(data,current)=>{
156
166
  this.changeTabs(data,current)
157
167
  });
158
-
168
+ Bus.$on('delete-history-menu',(data) => {
169
+ this.deleteHistoryMenu(data)
170
+ })
171
+ Bus.$on('delete-collect-menu',(data) => {
172
+ this.deleteCollectMenu(data)
173
+ })
159
174
  },
160
175
  destroyListener(){
161
176
  Bus.$off('trigger-change')
@@ -163,6 +178,8 @@ export default {
163
178
  Bus.$off('user-action')
164
179
  Bus.$off('menu-click')
165
180
  Bus.$off('tag-list')
181
+ Bus.$off('delete-history-menu')
182
+ Bus.$off('delete-collect-menu')
166
183
  },
167
184
  initEmit(){
168
185
  //在这里改this.menuList
@@ -179,7 +196,9 @@ export default {
179
196
  item.uri = '/' + item.uri;
180
197
  }
181
198
  });
182
- Bus.$emit('menu-list',this.menuList)
199
+ Bus.$emit('menu-list',this.menuList);
200
+ Bus.$emit('history-menu-list',this.historyMenuList);
201
+ Bus.$emit('collect-menu-list',this.collectMenuList);
183
202
  },
184
203
  initTags(){
185
204
  let tagList = getTagNavListFromLocalstorage(config.routerBase + '-tagNavList');
@@ -213,10 +232,6 @@ export default {
213
232
  item = res[0];
214
233
  }
215
234
  }
216
- // if (item && item.uri === '') {
217
- // console.log('menuClick item uri is empty')
218
- // return;
219
- // }
220
235
  if (!isOpenBlank(item)) {
221
236
  sessionStorage.setItem('activeName',name);
222
237
  }
@@ -254,6 +269,12 @@ export default {
254
269
 
255
270
  Bus.$emit('tag-list', tagList, name)
256
271
  }
272
+ },
273
+ deleteHistoryMenu(data){
274
+ this.$emit('delete-history-menu',data);
275
+ },
276
+ deleteCollectMenu(data){
277
+ this.$emit('delete-collect-menu',data);
257
278
  }
258
279
  },
259
280
  mounted(){
@@ -1,19 +1,11 @@
1
- //@import "@lambo-design/core/src/styles/default.less";
2
- @import "@lambo-design/shared/config/themes/blue/blue.less";
3
- @import "@lambo-design/shared/config/themes/default/default.less";
4
- @import "@lambo-design/shared/config/themes/gold/gold.less";
5
- @import "@lambo-design/shared/config/themes/atrovirens/atrovirens.less";
6
- @import "@lambo-design/shared/config/themes/eap/eap.less";
7
- @import "@lambo-design/shared/config/themes/lime/lime.less";
8
- @import "@lambo-design/shared/config/themes/orange/orange.less";
9
- @import "@lambo-design/shared/config/themes/red/red.less";
1
+ @import "@lambo-design/core/src/styles/default.less";
10
2
  .other-menu {
11
3
  width: 99%;
12
4
  // border-top: 3px solid @_layout-sider-background;
13
5
  position: absolute;
14
6
  bottom: 0;
15
7
  z-index: 1000;
16
- background: var(--menu-dark-active-bg ,@menu-dark-active-bg);
8
+ background: var(--menu-dark-active-bg ,@_menu-dark-active-bg);
17
9
 
18
10
 
19
11
 
@@ -59,8 +51,7 @@
59
51
 
60
52
 
61
53
  .other-menu-item {
62
- color: var(--menu-dark-subsidiary-color, rgba(255, 255, 255, 0.7));
63
- //color: #F0F0F0;
54
+ color: var(--menu-dark-subsidiary-color, @_menu-dark-subsidiary-color);
64
55
  text-align: center;
65
56
  line-height: 50px;
66
57
  height: 48.6px;
@@ -71,7 +62,7 @@
71
62
 
72
63
  &:hover {
73
64
  color: #ffffff;
74
- background: var(--primary-color,@primary-color);
65
+ background: var(--primary-color,@_primary-color);
75
66
  }
76
67
 
77
68
  }
@@ -108,7 +99,7 @@
108
99
  cursor: pointer;
109
100
  height: 38px;
110
101
  font-weight: bold;
111
- color: var(--primary-color,@primary-color);
102
+ color: var(--primary-color,@_primary-color);
112
103
  }
113
104
 
114
105
  .delete {
@@ -139,7 +130,7 @@
139
130
  &:hover {
140
131
  .content {
141
132
  cursor: pointer;
142
- color: var(--primary-color,@primary-color);
133
+ color: var(--primary-color,@_primary-color);
143
134
 
144
135
  .ivu-tooltip {
145
136
  .ivu-tooltip-rel {