fix:修改时序图缩放键为shift
This commit is contained in:
4
nezha-fronted/package-lock.json
generated
4
nezha-fronted/package-lock.json
generated
@@ -14340,7 +14340,7 @@
|
||||
},
|
||||
"node-sass": {
|
||||
"version": "4.14.1",
|
||||
"resolved": "https://registry.npmmirror.com/node-sass/-/node-sass-4.14.1.tgz",
|
||||
"resolved": "https://registry.npmjs.org/node-sass/-/node-sass-4.14.1.tgz",
|
||||
"integrity": "sha512-sjCuOlvGyCJS40R8BscF5vhVlQjNN069NtQ1gSxyK1u9iqvn6tf7O1R4GNowVZfiZUCRt5MmMs1xd+4V/7Yr0g==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
@@ -20727,7 +20727,7 @@
|
||||
},
|
||||
"webpack-bundle-analyzer": {
|
||||
"version": "2.13.1",
|
||||
"resolved": "https://registry.npmmirror.com/webpack-bundle-analyzer/-/webpack-bundle-analyzer-2.13.1.tgz",
|
||||
"resolved": "https://registry.npmjs.org/webpack-bundle-analyzer/-/webpack-bundle-analyzer-2.13.1.tgz",
|
||||
"integrity": "sha512-rwxyfecTAxoarCC9VlHlIpfQCmmJ/qWD5bpbjkof+7HrNhTNZIwZITxN6CdlYL2axGmwNUQ+tFgcSOiNXMf/sQ==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
|
||||
@@ -274,7 +274,7 @@ export default {
|
||||
this.tooltip.activeIndex = undefined
|
||||
})
|
||||
|
||||
// 修复echarts bug(dataZoom设置为inside 未按住ctrl 页面无法滚动)
|
||||
// 修复echarts bug(dataZoom设置为inside 未按住shift 页面无法滚动)
|
||||
// 监听按键按下事件
|
||||
document.addEventListener('keydown', this.keydown)
|
||||
// 监听按键松开事件
|
||||
@@ -286,9 +286,9 @@ export default {
|
||||
},
|
||||
keydown (event) {
|
||||
// 监听按键按下事件
|
||||
// 判断是否按下了Ctrl键
|
||||
if (event.ctrlKey) {
|
||||
// 如果按下了Ctrl键,则启用Echarts的dataZoom功能
|
||||
// 判断是否按下了shift键
|
||||
if (event.shiftKey) {
|
||||
// 如果按下了shift键,则启用Echarts的dataZoom功能
|
||||
getChart(this.chartId).setOption({
|
||||
dataZoom: [{
|
||||
disabled: false
|
||||
@@ -298,9 +298,9 @@ export default {
|
||||
},
|
||||
keyup (event) {
|
||||
// 监听按键松开事件
|
||||
// 判断是否释放了Ctrl键
|
||||
if (!event.ctrlKey) {
|
||||
// 如果释放了Ctrl键,则禁用Echarts的dataZoom功能
|
||||
// 判断是否释放了shift键
|
||||
if (!event.shiftKey) {
|
||||
// 如果释放了shift键,则禁用Echarts的dataZoom功能
|
||||
getChart(this.chartId).setOption({
|
||||
dataZoom: [{
|
||||
disabled: true
|
||||
|
||||
@@ -52,7 +52,7 @@ export const chartTimeSeriesLineOption = {
|
||||
{
|
||||
disabled: true,
|
||||
type: 'inside',
|
||||
zoomOnMouseWheel: 'ctrl'
|
||||
zoomOnMouseWheel: 'shift'
|
||||
}
|
||||
],
|
||||
color: initColor(),
|
||||
|
||||
Reference in New Issue
Block a user