智感-弹窗关闭按钮增加单击事件
parent
e57d9e51d4
commit
493d5b6cde
|
|
@ -1,6 +1,6 @@
|
||||||
<template>
|
<template>
|
||||||
<div class="ModalFrameClose">
|
<div class="ModalFrameClose">
|
||||||
<n-button text>
|
<n-button text @click="clickBtn">
|
||||||
<Button :w="w" :h="h" :dataStyle="option.dataStyle" />
|
<Button :w="w" :h="h" :dataStyle="option.dataStyle" />
|
||||||
</n-button>
|
</n-button>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -12,8 +12,10 @@
|
||||||
import { icon } from '@/plugins';
|
import { icon } from '@/plugins';
|
||||||
import { useChartEditStore } from '@/store/modules/chartEditStore/chartEditStore';
|
import { useChartEditStore } from '@/store/modules/chartEditStore/chartEditStore';
|
||||||
import { useChartDataFetch } from '@/hooks';
|
import { useChartDataFetch } from '@/hooks';
|
||||||
|
import { eventHandlerHook } from '@/hooks/eventHandler.hook';
|
||||||
import Button from './svg/button.vue';
|
import Button from './svg/button.vue';
|
||||||
|
|
||||||
|
const chartEditStore = useChartEditStore();
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
chartConfig: {
|
chartConfig: {
|
||||||
type: Object as PropType<CreateComponentType>,
|
type: Object as PropType<CreateComponentType>,
|
||||||
|
|
@ -22,10 +24,25 @@
|
||||||
});
|
});
|
||||||
|
|
||||||
const { w, h } = toRefs(props.chartConfig.attr);
|
const { w, h } = toRefs(props.chartConfig.attr);
|
||||||
|
|
||||||
const option = reactive({
|
const option = reactive({
|
||||||
dataStyle: props.chartConfig.option.dataStyle,
|
dataStyle: props.chartConfig.option.dataStyle,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// 单击交互
|
||||||
|
const clickElementItem = ref([]);
|
||||||
|
|
||||||
|
const list = props.chartConfig.events.interactConfigEvents;
|
||||||
|
for (let i = 0; i < list.length; i++) {
|
||||||
|
if (list[i].type == 'click') {
|
||||||
|
for (let j = 0; j < list[i].movementList.length; j++) {
|
||||||
|
clickElementItem.value.push(list[i].movementList[j]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const clickBtn = () => {
|
||||||
|
eventHandlerHook(chartEditStore.getComponentList, clickElementItem.value);
|
||||||
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue