@lambo-design/pro-layout 1.0.0-beta.42 → 1.0.0-beta.44

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,6 +1,6 @@
1
1
  {
2
2
  "name": "@lambo-design/pro-layout",
3
- "version": "1.0.0-beta.42",
3
+ "version": "1.0.0-beta.44",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "author": "lambo",
@@ -10,8 +10,8 @@
10
10
  "registry": "https://registry.npmjs.org/"
11
11
  },
12
12
  "devDependencies": {
13
- "@lambo-design/core": "^4.7.1-beta.56",
14
- "@lambo-design/shared": "^1.0.0-beta.41"
13
+ "@lambo-design/shared": "^1.0.0-beta.43",
14
+ "@lambo-design/core": "^4.7.1-beta.60"
15
15
  },
16
16
  "scripts": {}
17
17
  }
@@ -0,0 +1,138 @@
1
+ <template>
2
+ <div :class="classes">
3
+ <div class="other-menu-item" @click="onChange('history')">
4
+ <Tooltip :disabled="!collapsed" content="历史" placement="right" transfer>
5
+ <div>
6
+ <Icon class="other-menu-icon" type="md-time"/>
7
+ <span class="other-menu-title"> 历史</span>
8
+ </div>
9
+ </Tooltip>
10
+ </div>
11
+ <div class="other-menu-item" @click="onChange('collect')">
12
+ <Tooltip :disabled="!collapsed" content="收藏" placement="right" transfer>
13
+ <div>
14
+ <Icon class="other-menu-icon" type="md-star-outline"/>
15
+ <span class="other-menu-title"> 收藏</span>
16
+ </div>
17
+
18
+ </Tooltip>
19
+ </div>
20
+ <Drawer v-model="drawer.model"
21
+ :class-name="drawerClasses"
22
+ :closable="false"
23
+ :mask-style="{backgroundColor: 'unset'}"
24
+ :scrollable="true"
25
+ :title="drawer.title"
26
+ placement="left"
27
+ >
28
+ <div v-if="drawer.type=='history'" class="other-menu-history">
29
+ <div v-for="item in list" class="other-menu-history-item">
30
+ <div class="content" @click="handleClick(item)">
31
+ <common-icon :type="item.icon"></common-icon>
32
+ <span> {{ item.label }}</span>
33
+ </div>
34
+ <div class="delete">
35
+ <common-icon type="ios-close" @click.native="handleHistoryDelete(item)"></common-icon>
36
+ </div>
37
+ </div>
38
+ </div>
39
+ <div v-if="drawer.type=='collect'" class="other-menu-collect">
40
+ <div v-for="item in list" class="other-menu-collect-item" @click="handleClick(item)">
41
+ <div class="content">
42
+ <Tooltip :content="item.label" :delay="1000">
43
+ <common-icon :size="40" :type="item.icon"></common-icon>
44
+ </Tooltip>
45
+ </div>
46
+ <div class="delete">
47
+ <common-icon type="ios-close" @click.native.stop="handleCollectDelete(item)"></common-icon>
48
+ </div>
49
+ </div>
50
+ </div>
51
+ </Drawer>
52
+ </div>
53
+ </template>
54
+
55
+ <script>
56
+ import ajax from 'lambo-design/packages/utils/ajax'
57
+ import config from "@/config/config";
58
+ import CommonIcon from "_c/common-icon";
59
+
60
+ export default {
61
+ name: "other-menu",
62
+ components: {CommonIcon},
63
+ props: {
64
+ collapsed: {
65
+ type: Boolean
66
+ },
67
+ },
68
+ data() {
69
+ return {
70
+ drawer: {
71
+ model: false,
72
+ url: '',
73
+ title: '',
74
+ type: '',
75
+ },
76
+ list: []
77
+ }
78
+ },
79
+ computed: {
80
+ classes() {
81
+ let classes = ["other-menu"]
82
+ return this.collapsed ? ["other-menu-collapsed", ...classes] : [...classes]
83
+ },
84
+ drawerClasses() {
85
+ return this.collapsed ? "other-menu-drawer-wrap-collapsed" : "other-menu-drawer-wrap"
86
+ }
87
+ },
88
+ methods: {
89
+ onChange(value) {
90
+ if (value == 'history') {
91
+ this.drawer.title = '历史菜单'
92
+ this.drawer.url = '/manage/upmsMenuHistory/list'
93
+
94
+ } else {
95
+ this.drawer.title = '收藏菜单'
96
+ this.drawer.url = '/manage/upmsMenuCollect/list'
97
+ }
98
+ this.getList()
99
+ this.drawer.type = value
100
+ this.drawer.model = !this.drawer.model
101
+ },
102
+ getList() {
103
+ this.list = []
104
+ ajax.get(config.upmsServerContext + this.drawer.url).then(resp => {
105
+ if (resp.data.code == 1) {
106
+ this.list = resp.data.data
107
+ if (this.drawer.type == 'collect') {
108
+ this.$store.commit('setCollectMenuList', this.list)
109
+ }
110
+ }
111
+ })
112
+ },
113
+ handleClick(item) {
114
+ this.$emit('on-select', item.name)
115
+ this.drawer.model = false
116
+ },
117
+ handleHistoryDelete(item) {
118
+ ajax.get(config.upmsServerContext + "/manage/upmsMenuHistory/delete/" + item.historyId).then(resp => {
119
+ if (resp.data.code == 1) {
120
+ this.getList()
121
+ }
122
+ })
123
+ },
124
+ handleCollectDelete(item) {
125
+ ajax.get(config.upmsServerContext + "/manage/upmsMenuCollect/delete/" + item.collectId).then(resp => {
126
+ if (resp.data.code == 1) {
127
+ this.getList()
128
+ }
129
+ })
130
+ }
131
+ }
132
+ }
133
+ </script>
134
+
135
+
136
+ <style lang="less">
137
+ @import '../styles/other-menu.less';
138
+ </style>
@@ -0,0 +1,159 @@
1
+ .other-menu {
2
+ width: 100%;
3
+ border-top: 3px solid #000000;
4
+ position: absolute;
5
+ bottom: 0;
6
+ z-index: 1000;
7
+ background: #061629;
8
+
9
+ &.other-menu-collapsed {
10
+ .other-menu-item {
11
+ border-top: 2px solid #000000;
12
+ width: 100%;
13
+
14
+ &:hover {
15
+ color: #ffffff;
16
+ background: #061629;
17
+ }
18
+
19
+ .ivu-tooltip {
20
+ width: 100%;
21
+
22
+ .ivu-tooltip-rel {
23
+ width: 100%;
24
+ }
25
+
26
+ .ivu-tooltip-popper .ivu-tooltip-content {
27
+ .ivu-tooltip-arrow {
28
+ border-right-color: #fff;
29
+ }
30
+
31
+ .ivu-tooltip-inner {
32
+ background: #fff;
33
+ color: #495060;
34
+ }
35
+ }
36
+ }
37
+
38
+ .other-menu-icon {
39
+ font-size: 20px;
40
+ }
41
+
42
+ .other-menu-title {
43
+ display: none;
44
+ }
45
+ }
46
+
47
+ }
48
+
49
+
50
+ .other-menu-item {
51
+ color: #F0F0F0;
52
+ text-align: center;
53
+ line-height: 50px;
54
+ height: 50px;
55
+ width: 100px;
56
+ display: inline-block;
57
+ border-right: 2px solid #000000;
58
+ cursor: pointer;
59
+ border-radius: 3px;
60
+
61
+ &:hover {
62
+ color: #ffffff;
63
+ background: @primary-color;
64
+ }
65
+
66
+ }
67
+ }
68
+
69
+
70
+ .other-menu-drawer-wrap {
71
+
72
+
73
+ .ivu-drawer {
74
+ left: 256px;
75
+ height: calc(100% - 110px);
76
+ bottom: 0;
77
+ top: auto;
78
+
79
+ .other-menu-history {
80
+
81
+ .other-menu-history-item {
82
+ width: 100%;
83
+ height: 35px;
84
+ line-height: 35px;
85
+ position: relative;
86
+
87
+ .delete {
88
+ display: none;
89
+ position: absolute;
90
+ right: 15px;
91
+ top: 0px;
92
+ cursor: pointer;
93
+ }
94
+
95
+ &:hover {
96
+ .content {
97
+ cursor: pointer;
98
+ height: 38px;
99
+ font-weight: bold;
100
+ color: @primary-color;
101
+ }
102
+
103
+ .delete {
104
+ display: inline;
105
+ }
106
+ }
107
+ }
108
+ }
109
+
110
+ .other-menu-collect {
111
+ .other-menu-collect-item {
112
+ display: inline-block;
113
+ margin: 8px;
114
+ position: relative;
115
+
116
+ .delete {
117
+ display: none;
118
+ position: absolute;
119
+ right: -5px;
120
+ top: -5px;
121
+ z-index: 100;
122
+ cursor: pointer;
123
+ }
124
+
125
+ &:hover {
126
+ .content {
127
+ cursor: pointer;
128
+ color: @primary-color;
129
+
130
+ .ivu-tooltip {
131
+ .ivu-tooltip-rel {
132
+ .ivu-icon {
133
+ font-size: 43px;
134
+ }
135
+ }
136
+ }
137
+ }
138
+
139
+ .delete {
140
+ display: inline;
141
+ }
142
+ }
143
+
144
+ }
145
+
146
+ }
147
+ }
148
+
149
+
150
+ }
151
+
152
+ .other-menu-drawer-wrap-collapsed {
153
+ .ivu-drawer {
154
+ left: 65px;
155
+ height: calc(100% - 110px);
156
+ bottom: 0;
157
+ top: auto;
158
+ }
159
+ }