lw-cdp-ui 1.4.35 → 1.4.36
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/dist/components/lwCronSelect/index.vue +82 -80
- package/dist/components/lwLayout/components/tags.vue +73 -66
- package/dist/lw-cdp-ui.esm.js +2808 -2786
- package/dist/lw-cdp-ui.umd.js +16 -16
- package/dist/style.css +1 -1
- package/package.json +1 -1
|
@@ -1,86 +1,66 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<el-input v-model="showInput"
|
|
3
|
-
placeholder="CRON">
|
|
4
|
-
|
|
2
|
+
<el-input v-model="showInput" placeholder="CRON">
|
|
5
3
|
<template #append>
|
|
6
|
-
<el-popover placement="top"
|
|
7
|
-
:width="380"
|
|
8
|
-
:visible="visible"
|
|
9
|
-
trigger="click">
|
|
4
|
+
<el-popover placement="top" :width="380" :visible="visible" trigger="click">
|
|
10
5
|
<template #reference>
|
|
11
6
|
<el-button @click="visible = true">选择</el-button>
|
|
12
7
|
</template>
|
|
13
8
|
<div class="select-model">
|
|
14
|
-
<el-select
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
<el-option label="每月"
|
|
21
|
-
|
|
22
|
-
<el-option label="每周"
|
|
23
|
-
:value="5" />
|
|
9
|
+
<el-select
|
|
10
|
+
v-model="setData.curType"
|
|
11
|
+
placeholder="选择类型"
|
|
12
|
+
@change="changeInt"
|
|
13
|
+
style="margin-right: 5px; min-width: 80px; width: 80px">
|
|
14
|
+
<el-option label="每天" :value="3" />
|
|
15
|
+
<el-option label="每月" :value="4" />
|
|
16
|
+
<el-option label="每周" :value="5" />
|
|
24
17
|
</el-select>
|
|
25
18
|
|
|
26
|
-
<el-select
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
<el-option
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
19
|
+
<el-select
|
|
20
|
+
v-if="setData.curType === 4"
|
|
21
|
+
v-model="setData.day"
|
|
22
|
+
multiple
|
|
23
|
+
allow-clear
|
|
24
|
+
placeholder="日期"
|
|
25
|
+
@change="changeDay"
|
|
26
|
+
:max-tag-count="1"
|
|
27
|
+
style="margin-right: 5px; min-width: 120px">
|
|
28
|
+
<el-option label="最后一天" value="L" />
|
|
29
|
+
<el-option
|
|
30
|
+
v-for="item in 31"
|
|
31
|
+
:key="item"
|
|
32
|
+
:label="item"
|
|
33
|
+
:value="item"
|
|
34
|
+
:disabled="setData.day.indexOf('L') !== -1" />
|
|
41
35
|
</el-select>
|
|
42
36
|
|
|
43
|
-
<el-select
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
<el-option label="
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
<el-option label="
|
|
58
|
-
|
|
59
|
-
:disabled="setData.weeks.indexOf('?') !== -1" />
|
|
60
|
-
<el-option label="周三"
|
|
61
|
-
value="4"
|
|
62
|
-
:disabled="setData.weeks.indexOf('?') !== -1" />
|
|
63
|
-
<el-option label="周四"
|
|
64
|
-
value="5"
|
|
65
|
-
:disabled="setData.weeks.indexOf('?') !== -1" />
|
|
66
|
-
<el-option label="周五"
|
|
67
|
-
value="6"
|
|
68
|
-
:disabled="setData.weeks.indexOf('?') !== -1" />
|
|
69
|
-
<el-option label="周六"
|
|
70
|
-
value="7"
|
|
71
|
-
:disabled="setData.weeks.indexOf('?') !== -1" />
|
|
37
|
+
<el-select
|
|
38
|
+
v-if="setData.curType === 5"
|
|
39
|
+
v-model="setData.weeks"
|
|
40
|
+
multiple
|
|
41
|
+
allow-clear
|
|
42
|
+
placeholder="星期"
|
|
43
|
+
@change="changeWeeks"
|
|
44
|
+
:max-tag-count="1"
|
|
45
|
+
style="margin-right: 5px; min-width: 120px">
|
|
46
|
+
<el-option label="周日" value="1" :disabled="setData.weeks.indexOf('?') !== -1" />
|
|
47
|
+
<el-option label="周一" value="2" :disabled="setData.weeks.indexOf('?') !== -1" />
|
|
48
|
+
<el-option label="周二" value="3" :disabled="setData.weeks.indexOf('?') !== -1" />
|
|
49
|
+
<el-option label="周三" value="4" :disabled="setData.weeks.indexOf('?') !== -1" />
|
|
50
|
+
<el-option label="周四" value="5" :disabled="setData.weeks.indexOf('?') !== -1" />
|
|
51
|
+
<el-option label="周五" value="6" :disabled="setData.weeks.indexOf('?') !== -1" />
|
|
52
|
+
<el-option label="周六" value="7" :disabled="setData.weeks.indexOf('?') !== -1" />
|
|
72
53
|
</el-select>
|
|
73
54
|
|
|
74
|
-
<el-time-picker
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
55
|
+
<el-time-picker
|
|
56
|
+
v-model="setData.timeData"
|
|
57
|
+
placeholder="时分秒"
|
|
58
|
+
value-format="HH:mm:ss"
|
|
59
|
+
style="min-width: 100px" />
|
|
79
60
|
</div>
|
|
80
|
-
<div style="margin-top: 10px; text-align: right
|
|
61
|
+
<div style="margin-top: 10px; text-align: right">
|
|
81
62
|
<el-button @click="visible = false">取消</el-button>
|
|
82
|
-
<el-button type="primary"
|
|
83
|
-
@click="changeOk">确定</el-button>
|
|
63
|
+
<el-button type="primary" @click="changeOk">确定</el-button>
|
|
84
64
|
</div>
|
|
85
65
|
</el-popover>
|
|
86
66
|
</template>
|
|
@@ -88,7 +68,7 @@
|
|
|
88
68
|
</template>
|
|
89
69
|
|
|
90
70
|
<script>
|
|
91
|
-
import { ref, computed } from 'vue'
|
|
71
|
+
import { ref, computed, watch } from 'vue'
|
|
92
72
|
|
|
93
73
|
export default {
|
|
94
74
|
name: 'lwCronSelect',
|
|
@@ -139,13 +119,35 @@ export default {
|
|
|
139
119
|
|
|
140
120
|
// 初始化setData对象,用于内部数据管理
|
|
141
121
|
const setData = ref({
|
|
142
|
-
curType:
|
|
143
|
-
day:
|
|
144
|
-
month:
|
|
145
|
-
weeks:
|
|
146
|
-
timeData:
|
|
122
|
+
curType: 3,
|
|
123
|
+
day: [],
|
|
124
|
+
month: [],
|
|
125
|
+
weeks: [],
|
|
126
|
+
timeData: ''
|
|
147
127
|
})
|
|
148
128
|
|
|
129
|
+
watch(
|
|
130
|
+
() => visible.value,
|
|
131
|
+
(val) => {
|
|
132
|
+
if (val) {
|
|
133
|
+
const values = props.modelValue ? props.modelValue.split(' ') : ['*', '*', '*', '*', '*', '?']
|
|
134
|
+
|
|
135
|
+
const hasDay = values[3] !== '*' && values[3] !== '?'
|
|
136
|
+
const hasWeek = values[5] !== '*' && values[5] !== '?'
|
|
137
|
+
|
|
138
|
+
const curType = hasDay ? 4 : hasWeek ? 5 : 3
|
|
139
|
+
|
|
140
|
+
setData.value = {
|
|
141
|
+
curType,
|
|
142
|
+
day: hasDay ? values[3].split(',') : [],
|
|
143
|
+
month: values[4] === '*' ? [] : values[4].split(','),
|
|
144
|
+
weeks: hasWeek ? values[5].split(',') : [],
|
|
145
|
+
timeData: values[0] === '*' ? '' : `${values[2]}:${values[1]}:${values[0]}`
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
)
|
|
150
|
+
|
|
149
151
|
/**
|
|
150
152
|
* 处理日期选择
|
|
151
153
|
* @param {string} val - 选择的日期值
|
|
@@ -179,9 +181,9 @@ export default {
|
|
|
179
181
|
*/
|
|
180
182
|
const changeOk = () => {
|
|
181
183
|
const time = setData.value.timeData ? setData.value.timeData.split(':') : ['*', '*', '*']
|
|
182
|
-
dataList.value[0] = time[2] ===
|
|
183
|
-
dataList.value[1] = time[1] ===
|
|
184
|
-
dataList.value[2] = time[0] ===
|
|
184
|
+
dataList.value[0] = time[2] === '*' ? time[2] : parseInt(time[2], 10).toString()
|
|
185
|
+
dataList.value[1] = time[1] === '*' ? time[1] : parseInt(time[1], 10).toString()
|
|
186
|
+
dataList.value[2] = time[0] === '*' ? time[0] : parseInt(time[0], 10).toString()
|
|
185
187
|
|
|
186
188
|
dataList.value[3] = setData.value.day.length > 0 ? setData.value.day.toString() : '*'
|
|
187
189
|
dataList.value[4] = setData.value.month.length > 0 ? setData.value.month.toString() : '*'
|
|
@@ -212,7 +214,7 @@ export default {
|
|
|
212
214
|
}
|
|
213
215
|
</script>
|
|
214
216
|
<style lang="scss" scoped>
|
|
215
|
-
.select-model{
|
|
217
|
+
.select-model {
|
|
216
218
|
display: flex;
|
|
217
219
|
}
|
|
218
|
-
</style>
|
|
220
|
+
</style>
|
|
@@ -4,14 +4,20 @@
|
|
|
4
4
|
<div v-if="iconVisible" class="scroll-arrow left" @click="scrollLeft">
|
|
5
5
|
<el-icon><el-icon-arrow-left /></el-icon>
|
|
6
6
|
</div>
|
|
7
|
-
<draggable
|
|
7
|
+
<draggable
|
|
8
|
+
v-model="$store.state.viewTags.viewTags"
|
|
9
|
+
@change="changeTages"
|
|
10
|
+
class="context-menu-list"
|
|
11
|
+
ref="tags"
|
|
8
12
|
itemKey="name">
|
|
9
13
|
<template #item="{ element: tag, index }" keyName="tag">
|
|
10
|
-
<li
|
|
14
|
+
<li
|
|
15
|
+
v-bind:key="tag"
|
|
16
|
+
:class="[isActive(tag) ? 'active' : '', tag.meta.affix ? 'affix' : '']"
|
|
11
17
|
@contextmenu.prevent="openContextMenu($event, tag)">
|
|
12
18
|
<router-link :to="tag">
|
|
13
19
|
<span>{{ getIdName(tag) }}</span>
|
|
14
|
-
<el-icon v-if="!tag.meta.affix" @click.prevent.stop=
|
|
20
|
+
<el-icon v-if="!tag.meta.affix" @click.prevent.stop="closeSelectedTag(tag)"><el-icon-close /></el-icon>
|
|
15
21
|
</router-link>
|
|
16
22
|
</li>
|
|
17
23
|
</template>
|
|
@@ -24,16 +30,20 @@
|
|
|
24
30
|
|
|
25
31
|
<transition name="el-zoom-in-top">
|
|
26
32
|
<ul v-if="contextMenuVisible" :style="{ left: left + 'px', top: top + 'px' }" class="contextmenu" id="contextmenu">
|
|
27
|
-
<li @click="refreshTab()"
|
|
28
|
-
|
|
33
|
+
<li @click="refreshTab()">
|
|
34
|
+
<el-icon><el-icon-refresh /></el-icon>刷新
|
|
35
|
+
</li>
|
|
36
|
+
<hr />
|
|
29
37
|
<li @click="closeTabs()" :class="contextMenuItem.meta.affix ? 'disabled' : ''">
|
|
30
38
|
<el-icon><el-icon-close /></el-icon>关闭标签
|
|
31
39
|
</li>
|
|
32
40
|
<li @click="closeOtherTabs()">
|
|
33
41
|
<el-icon><el-icon-folder-delete /></el-icon>关闭其他标签
|
|
34
42
|
</li>
|
|
35
|
-
<hr
|
|
36
|
-
<li v-if="isOpenTour" @click="openTour()"
|
|
43
|
+
<hr />
|
|
44
|
+
<li v-if="isOpenTour" @click="openTour()">
|
|
45
|
+
<el-icon><el-icon-finished /></el-icon>显示页面指引
|
|
46
|
+
</li>
|
|
37
47
|
<li @click="openWindow()">
|
|
38
48
|
<el-icon><el-icon-copy-document /></el-icon>在新的窗口中打开
|
|
39
49
|
</li>
|
|
@@ -45,7 +55,7 @@
|
|
|
45
55
|
import draggable from 'vuedraggable'
|
|
46
56
|
|
|
47
57
|
export default {
|
|
48
|
-
name:
|
|
58
|
+
name: 'tags',
|
|
49
59
|
components: {
|
|
50
60
|
draggable
|
|
51
61
|
},
|
|
@@ -89,23 +99,22 @@ export default {
|
|
|
89
99
|
}
|
|
90
100
|
},
|
|
91
101
|
$route(e) {
|
|
92
|
-
this.addViewTags(e)
|
|
102
|
+
this.addViewTags(e)
|
|
93
103
|
},
|
|
94
104
|
contextMenuVisible(value) {
|
|
95
|
-
var _this = this
|
|
105
|
+
var _this = this
|
|
96
106
|
var cm = function (e) {
|
|
97
|
-
let sp = document.getElementById(
|
|
107
|
+
let sp = document.getElementById('contextmenu')
|
|
98
108
|
if (sp && !sp.contains(e.target)) {
|
|
99
109
|
_this.closeMenu()
|
|
100
110
|
}
|
|
101
111
|
}
|
|
102
112
|
if (value) {
|
|
103
|
-
document.body.addEventListener('click', e => cm(e))
|
|
113
|
+
document.body.addEventListener('click', (e) => cm(e))
|
|
104
114
|
} else {
|
|
105
|
-
document.body.removeEventListener('click', e => cm(e))
|
|
115
|
+
document.body.removeEventListener('click', (e) => cm(e))
|
|
106
116
|
}
|
|
107
|
-
}
|
|
108
|
-
|
|
117
|
+
}
|
|
109
118
|
},
|
|
110
119
|
created() {
|
|
111
120
|
this.init()
|
|
@@ -117,7 +126,6 @@ export default {
|
|
|
117
126
|
this.changeLeftRight()
|
|
118
127
|
})
|
|
119
128
|
|
|
120
|
-
|
|
121
129
|
// 判断是否有指引组件
|
|
122
130
|
this.$bus.$on(`lwTourOpen`, (val) => {
|
|
123
131
|
this.isOpenTour = val
|
|
@@ -131,16 +139,14 @@ export default {
|
|
|
131
139
|
init() {
|
|
132
140
|
let tags = this.$tool.data.get('RouteTags') || []
|
|
133
141
|
if (tags.length > 0) {
|
|
134
|
-
|
|
135
142
|
tags.forEach((tag, index) => {
|
|
136
|
-
var isRoute = this.treeFind(this.menu, node => node.path == tag.path)
|
|
143
|
+
var isRoute = this.treeFind(this.menu, (node) => node.path == tag.path)
|
|
137
144
|
if (isRoute) {
|
|
138
145
|
this.addViewTags(tag)
|
|
139
146
|
}
|
|
140
147
|
})
|
|
141
148
|
}
|
|
142
149
|
this.addViewTags(this.$route)
|
|
143
|
-
|
|
144
150
|
},
|
|
145
151
|
//查找树
|
|
146
152
|
treeFind(tree, func) {
|
|
@@ -162,8 +168,8 @@ export default {
|
|
|
162
168
|
if (route.name && !route.meta.fullpage) {
|
|
163
169
|
delete route.redirectedFrom
|
|
164
170
|
route = { ...route, matched: [] }
|
|
165
|
-
this.$store.commit(
|
|
166
|
-
this.$store.commit(
|
|
171
|
+
this.$store.commit('pushViewTags', route)
|
|
172
|
+
this.$store.commit('pushKeepLive', route.name)
|
|
167
173
|
this.$tool.data.set('RouteTags', this.$store.state.viewTags.viewTags)
|
|
168
174
|
}
|
|
169
175
|
|
|
@@ -172,10 +178,10 @@ export default {
|
|
|
172
178
|
changeLeftRight() {
|
|
173
179
|
//判断标签容器是否出现滚动条
|
|
174
180
|
this.$nextTick(() => {
|
|
175
|
-
const tags = document.querySelector(
|
|
181
|
+
const tags = document.querySelector('.context-menu-list')
|
|
176
182
|
if (tags && tags.scrollWidth > tags.clientWidth) {
|
|
177
183
|
//确保当前标签在可视范围内
|
|
178
|
-
let targetTag = tags.querySelector(
|
|
184
|
+
let targetTag = tags.querySelector('.active')
|
|
179
185
|
targetTag.scrollIntoView()
|
|
180
186
|
//显示提示
|
|
181
187
|
if (!this.tipDisplayed) {
|
|
@@ -207,9 +213,9 @@ export default {
|
|
|
207
213
|
return false
|
|
208
214
|
}
|
|
209
215
|
|
|
210
|
-
this.$store.commit(
|
|
211
|
-
this.$store.commit(
|
|
212
|
-
this.$store.commit(
|
|
216
|
+
this.$store.commit('removeViewTags', tag)
|
|
217
|
+
this.$store.commit('removeIframeList', tag)
|
|
218
|
+
this.$store.commit('removeKeepLive', tag.name)
|
|
213
219
|
this.$tool.data.set('RouteTags', this.$store.state.viewTags.viewTags)
|
|
214
220
|
if (autoPushLatestView && this.isActive(tag)) {
|
|
215
221
|
const latestView = this.tagList.slice(-1)[0]
|
|
@@ -224,28 +230,28 @@ export default {
|
|
|
224
230
|
},
|
|
225
231
|
//tag右键
|
|
226
232
|
openContextMenu(e, tag) {
|
|
227
|
-
this.contextMenuItem = tag
|
|
228
|
-
this.contextMenuVisible = true
|
|
229
|
-
this.left = e.clientX + 1
|
|
230
|
-
this.top = e.clientY + 1
|
|
233
|
+
this.contextMenuItem = tag
|
|
234
|
+
this.contextMenuVisible = true
|
|
235
|
+
this.left = e.clientX + 1
|
|
236
|
+
this.top = e.clientY + 1
|
|
231
237
|
|
|
232
238
|
//FIX 右键菜单边缘化位置处理
|
|
233
239
|
this.$nextTick(() => {
|
|
234
|
-
let sp = document.getElementById(
|
|
240
|
+
let sp = document.getElementById('contextmenu')
|
|
235
241
|
if (document.body.offsetWidth - e.clientX < sp.offsetWidth) {
|
|
236
|
-
this.left = document.body.offsetWidth - sp.offsetWidth + 1
|
|
237
|
-
this.top = e.clientY + 1
|
|
242
|
+
this.left = document.body.offsetWidth - sp.offsetWidth + 1
|
|
243
|
+
this.top = e.clientY + 1
|
|
238
244
|
}
|
|
239
245
|
})
|
|
240
246
|
},
|
|
241
247
|
//关闭右键菜单
|
|
242
248
|
closeMenu() {
|
|
243
|
-
this.contextMenuItem = null
|
|
249
|
+
this.contextMenuItem = null
|
|
244
250
|
this.contextMenuVisible = false
|
|
245
251
|
},
|
|
246
252
|
//TAB 刷新
|
|
247
253
|
refreshTab() {
|
|
248
|
-
var nowTag = this.contextMenuItem
|
|
254
|
+
var nowTag = this.contextMenuItem
|
|
249
255
|
this.contextMenuVisible = false
|
|
250
256
|
//判断是否当前路由,否的话跳转
|
|
251
257
|
if (this.$route.fullPath != nowTag.fullPath) {
|
|
@@ -254,17 +260,17 @@ export default {
|
|
|
254
260
|
query: nowTag.query
|
|
255
261
|
})
|
|
256
262
|
}
|
|
257
|
-
this.$store.commit(
|
|
258
|
-
this.$store.commit(
|
|
259
|
-
this.$store.commit(
|
|
263
|
+
this.$store.commit('refreshIframe', nowTag)
|
|
264
|
+
this.$store.commit('removeKeepLive', nowTag.name)
|
|
265
|
+
this.$store.commit('setRouteShow', true)
|
|
260
266
|
this.$nextTick(() => {
|
|
261
|
-
this.$store.commit(
|
|
262
|
-
this.$store.commit(
|
|
267
|
+
this.$store.commit('pushKeepLive', nowTag.name)
|
|
268
|
+
this.$store.commit('setRouteShow', false)
|
|
263
269
|
})
|
|
264
270
|
},
|
|
265
271
|
//TAB 关闭
|
|
266
272
|
closeTabs() {
|
|
267
|
-
var nowTag = this.contextMenuItem
|
|
273
|
+
var nowTag = this.contextMenuItem
|
|
268
274
|
if (!nowTag.meta.affix) {
|
|
269
275
|
this.closeSelectedTag(nowTag)
|
|
270
276
|
this.contextMenuVisible = false
|
|
@@ -272,7 +278,7 @@ export default {
|
|
|
272
278
|
},
|
|
273
279
|
//TAB 关闭其他
|
|
274
280
|
closeOtherTabs() {
|
|
275
|
-
var nowTag = this.contextMenuItem
|
|
281
|
+
var nowTag = this.contextMenuItem
|
|
276
282
|
//判断是否当前路由,否的话跳转
|
|
277
283
|
if (this.$route.fullPath != nowTag.fullPath) {
|
|
278
284
|
this.$router.push({
|
|
@@ -280,9 +286,9 @@ export default {
|
|
|
280
286
|
query: nowTag.query
|
|
281
287
|
})
|
|
282
288
|
}
|
|
283
|
-
var tags = [...this.tagList]
|
|
284
|
-
tags.forEach(tag => {
|
|
285
|
-
if (tag.meta && tag.meta.affix || nowTag.fullPath == tag.fullPath) {
|
|
289
|
+
var tags = [...this.tagList]
|
|
290
|
+
tags.forEach((tag) => {
|
|
291
|
+
if ((tag.meta && tag.meta.affix) || nowTag.fullPath == tag.fullPath) {
|
|
286
292
|
return true
|
|
287
293
|
} else {
|
|
288
294
|
this.closeSelectedTag(tag, false)
|
|
@@ -297,7 +303,7 @@ export default {
|
|
|
297
303
|
},
|
|
298
304
|
//TAB 最大化
|
|
299
305
|
maximize() {
|
|
300
|
-
var nowTag = this.contextMenuItem
|
|
306
|
+
var nowTag = this.contextMenuItem
|
|
301
307
|
this.contextMenuVisible = false
|
|
302
308
|
//判断是否当前路由,否的话跳转
|
|
303
309
|
if (this.$route.fullPath != nowTag.fullPath) {
|
|
@@ -310,31 +316,34 @@ export default {
|
|
|
310
316
|
},
|
|
311
317
|
//新窗口打开
|
|
312
318
|
openWindow() {
|
|
313
|
-
var nowTag = this.contextMenuItem
|
|
314
|
-
var url = nowTag.href || '/'
|
|
319
|
+
var nowTag = this.contextMenuItem
|
|
320
|
+
var url = nowTag.href || '/'
|
|
315
321
|
if (!nowTag.meta.affix) {
|
|
316
322
|
this.closeSelectedTag(nowTag)
|
|
317
323
|
}
|
|
318
|
-
window.open(url)
|
|
324
|
+
window.open(url)
|
|
319
325
|
this.contextMenuVisible = false
|
|
320
326
|
},
|
|
321
327
|
//横向滚动
|
|
322
328
|
scrollInit() {
|
|
323
329
|
const scrollDiv = document.querySelector('.context-menu-list')
|
|
324
|
-
if (!scrollDiv) {
|
|
325
|
-
|
|
330
|
+
if (!scrollDiv) {
|
|
331
|
+
return false
|
|
332
|
+
}
|
|
333
|
+
scrollDiv.addEventListener('mousewheel', handler, false) ||
|
|
334
|
+
scrollDiv.addEventListener('DOMMouseScroll', handler, false)
|
|
326
335
|
function handler(event) {
|
|
327
|
-
const detail = event.wheelDelta || event.detail
|
|
336
|
+
const detail = event.wheelDelta || event.detail
|
|
328
337
|
//火狐上滚键值-3 下滚键值3,其他内核上滚键值120 下滚键值-120
|
|
329
|
-
const moveForwardStep = 1
|
|
330
|
-
const moveBackStep = -1
|
|
331
|
-
let step = 0
|
|
332
|
-
if (detail == 3 || detail < 0 && detail != -3) {
|
|
333
|
-
step = moveForwardStep * 50
|
|
338
|
+
const moveForwardStep = 1
|
|
339
|
+
const moveBackStep = -1
|
|
340
|
+
let step = 0
|
|
341
|
+
if (detail == 3 || (detail < 0 && detail != -3)) {
|
|
342
|
+
step = moveForwardStep * 50
|
|
334
343
|
} else {
|
|
335
|
-
step = moveBackStep * 50
|
|
344
|
+
step = moveBackStep * 50
|
|
336
345
|
}
|
|
337
|
-
scrollDiv.scrollLeft += step
|
|
346
|
+
scrollDiv.scrollLeft += step
|
|
338
347
|
}
|
|
339
348
|
},
|
|
340
349
|
hideTip() {
|
|
@@ -356,32 +365,30 @@ export default {
|
|
|
356
365
|
} else {
|
|
357
366
|
return `${tag.meta.title}:${tag.query.id}`
|
|
358
367
|
}
|
|
359
|
-
|
|
360
368
|
} else {
|
|
361
369
|
return tag.meta.title
|
|
362
370
|
}
|
|
363
|
-
|
|
364
371
|
},
|
|
365
372
|
// 左滚动
|
|
366
373
|
scrollLeft() {
|
|
367
|
-
this.scroll(-200)
|
|
374
|
+
this.scroll(-200)
|
|
368
375
|
},
|
|
369
376
|
|
|
370
377
|
// 右滚动
|
|
371
378
|
scrollRight() {
|
|
372
|
-
this.scroll(200)
|
|
379
|
+
this.scroll(200)
|
|
373
380
|
},
|
|
374
381
|
|
|
375
382
|
// 执行滚动
|
|
376
383
|
scroll(offset) {
|
|
377
|
-
const container = document.querySelector('.context-menu-list')
|
|
384
|
+
const container = document.querySelector('.context-menu-list')
|
|
378
385
|
if (container) {
|
|
379
386
|
container.scrollBy({
|
|
380
387
|
left: offset,
|
|
381
388
|
behavior: 'smooth'
|
|
382
|
-
})
|
|
389
|
+
})
|
|
383
390
|
}
|
|
384
|
-
}
|
|
391
|
+
}
|
|
385
392
|
}
|
|
386
393
|
}
|
|
387
394
|
</script>
|