mirror of
https://gitee.com/dromara/go-view.git
synced 2026-04-23 00:00:12 +08:00
perf: 优化 ctrl 监听
This commit is contained in:
@@ -142,11 +142,7 @@ const optionsHandle = (
|
||||
// 点击
|
||||
const clickHandle = (e: MouseEvent) => {
|
||||
// 按下左键 + CTRL
|
||||
if (
|
||||
window.$KeyboardActive?.has(WinKeyboard.CTRL_SOURCE_KEY) ||
|
||||
window.$KeyboardActive?.has(MacKeyboard.CTRL_SOURCE_KEY)
|
||||
)
|
||||
return
|
||||
if (window.$KeyboardActive?.ctrl) return
|
||||
// 判断左右键
|
||||
expend.value = !expend.value
|
||||
mousedownHandle(e, props.componentGroupData)
|
||||
@@ -157,11 +153,7 @@ const groupMousedownHandle = (e: MouseEvent) => {
|
||||
onClickOutSide()
|
||||
// 若此时按下了 CTRL, 表示多选
|
||||
const id = props.componentGroupData.id
|
||||
if (
|
||||
e.buttons === MouseEventButton.LEFT &&
|
||||
(window.$KeyboardActive?.has(WinKeyboard.CTRL_SOURCE_KEY) ||
|
||||
window.$KeyboardActive?.has(MacKeyboard.CTRL_SOURCE_KEY))
|
||||
) {
|
||||
if (e.buttons === MouseEventButton.LEFT && window.$KeyboardActive?.ctrl) {
|
||||
// 若已选中,则去除
|
||||
if (chartEditStore.targetChart.selectId.includes(id)) {
|
||||
const exList = chartEditStore.targetChart.selectId.filter(e => e !== id)
|
||||
|
||||
@@ -166,11 +166,7 @@ const mousedownHandle = (e: MouseEvent, item: CreateComponentType) => {
|
||||
onClickOutSide()
|
||||
// 若此时按下了 CTRL, 表示多选
|
||||
const id = item.id
|
||||
if (
|
||||
e.buttons === MouseEventButton.LEFT &&
|
||||
(window.$KeyboardActive?.has(WinKeyboard.CTRL_SOURCE_KEY) ||
|
||||
window.$KeyboardActive?.has(MacKeyboard.CTRL_SOURCE_KEY))
|
||||
) {
|
||||
if (e.buttons === MouseEventButton.LEFT && window.$KeyboardActive?.ctrl) {
|
||||
// 若已选中,则去除
|
||||
if (chartEditStore.targetChart.selectId.includes(id)) {
|
||||
const exList = chartEditStore.targetChart.selectId.filter(e => e !== id)
|
||||
@@ -198,7 +194,6 @@ const changeLayerType = (value: LayerModeEnum) => {
|
||||
layerMode.value = value
|
||||
chartLayoutStore.setItem(ChartLayoutStoreEnum.LAYER_TYPE, value)
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
|
||||
Reference in New Issue
Block a user