|
@@ -152,7 +152,7 @@ const props = defineProps({
|
|
|
},
|
|
|
// 多时间轴选中背景颜色
|
|
|
multiSegmentActiveColor: {
|
|
|
- type: String
|
|
|
+ type: String,
|
|
|
},
|
|
|
// 是否允许切换分辨率
|
|
|
enableZoom: {
|
|
@@ -207,7 +207,7 @@ const props = defineProps({
|
|
|
// 是否是手机端
|
|
|
isMobile: {
|
|
|
type: Boolean,
|
|
|
- default: true
|
|
|
+ default: false
|
|
|
},
|
|
|
// 鼠标按下和松开的距离小于该值认为是点击事件
|
|
|
maxClickDistance: {
|
|
@@ -534,7 +534,7 @@ const drawTimeSegments = (callback, path) => {
|
|
|
let heightEndRatio = item.endRatio === undefined ? 0.9 : item.endRatio
|
|
|
if (props.roundWidthTimeSegments) {
|
|
|
x = Math.round(x)
|
|
|
- w = Math.round(w)
|
|
|
+ w = Math.round(w) + 1
|
|
|
}
|
|
|
// 避免时间段小于1px绘制不出来
|
|
|
w = Math.max(1, w)
|
|
@@ -579,9 +579,7 @@ const onMousedown = (e) => {
|
|
|
// 按下事件
|
|
|
const onPointerdown = (e) => {
|
|
|
let pos = getClientOffset(e)
|
|
|
- if (!props.isMobile) {
|
|
|
- e.target.style.cursor = 'grabbing'
|
|
|
- }
|
|
|
+ e.target.style.cursor = 'grabbing'
|
|
|
defaultData.mousedownX = pos[0]
|
|
|
defaultData.mousedownY = pos[1]
|
|
|
defaultData.mousedown = true
|
|
@@ -610,9 +608,7 @@ let onMouseup = (e) => {
|
|
|
// 松开事件
|
|
|
const onPointerup = (e) => {
|
|
|
// 触发click事件
|
|
|
- if (!props.isMobile) {
|
|
|
- e.target.style.cursor = 'pointer'
|
|
|
- }
|
|
|
+ e.target.style.cursor = 'pointer'
|
|
|
let pos = getClientOffset(e)
|
|
|
const reset = () => {
|
|
|
defaultData.mousedown = false
|
|
@@ -738,6 +734,7 @@ const onMouseweel = (event) => {
|
|
|
let e = window.event || event
|
|
|
let delta = Math.max(-1, Math.min(1, e.wheelDelta || -e.detail))
|
|
|
if (delta < 0) {
|
|
|
+ if(defaultData.currentZoomIndex === 9) return
|
|
|
if (defaultData.currentZoomIndex + 1 >= ZOOM.length - 1) {
|
|
|
defaultData.currentZoomIndex = ZOOM.length - 1
|
|
|
} else {
|