Map Timeframe: fix not mask.style error.

This commit is contained in:
chiayin
2023-10-31 16:06:00 +08:00
parent 9d7f390343
commit 19c536a4f2
2 changed files with 6 additions and 10 deletions

View File

@@ -38,6 +38,7 @@ import 'chartjs-adapter-date-fns';
import getMoment from 'moment'; import getMoment from 'moment';
export default{ export default{
props:['selectValue'],
setup() { setup() {
const allMapDataStore = AllMapDataStore(); const allMapDataStore = AllMapDataStore();
const { filterTimeframe, selectTimeFrame } = storeToRefs(allMapDataStore); const { filterTimeframe, selectTimeFrame } = storeToRefs(allMapDataStore);
@@ -142,8 +143,10 @@ export default{
resizeMask(chart) { resizeMask(chart) {
let from = (this.selectArea[0] * 0.01) / (this.selectRange * 0.01); let from = (this.selectArea[0] * 0.01) / (this.selectRange * 0.01);
let to = (this.selectArea[1] * 0.01) / (this.selectRange * 0.01); let to = (this.selectArea[1] * 0.01) / (this.selectRange * 0.01);
if(this.selectValue[0] === 'Timeframes') {
this.resizeLeftMask(chart, from); this.resizeLeftMask(chart, from);
this.resizeRightMask(chart, to); this.resizeRightMask(chart, to);
}
}, },
resizeLeftMask(chart, from) { resizeLeftMask(chart, from) {
const canvas = document.getElementById("chartCanvasId"); const canvas = document.getElementById("chartCanvasId");
@@ -306,12 +309,5 @@ export default{
this.endTime = this.startMaxDate; this.endTime = this.startMaxDate;
this.timeFrameStartEnd; this.timeFrameStartEnd;
}, },
beforeUnmount() {
this.selectArea = [0, this.selectRange];
this.resizeMask(this.chart);
this.startTime = new Date(getMoment(this.filterTimeframe.x_axis.min).format());
this.endTime = new Date(getMoment(this.filterTimeframe.x_axis.max).format());
this.timeFrameStartEnd;
}
} }
</script> </script>

View File

@@ -89,7 +89,7 @@
<!-- title: Trace --> <!-- title: Trace -->
<Trace v-if="selectValue[0] === 'Trace'" ref="filterTraceView"></Trace> <Trace v-if="selectValue[0] === 'Trace'" ref="filterTraceView"></Trace>
<!-- title: Timeframes --> <!-- title: Timeframes -->
<Timeframes v-if="selectValue[0] === 'Timeframes'"></Timeframes> <Timeframes v-if="selectValue[0] === 'Timeframes'" :selectValue="selectValue"></Timeframes>
</div> </div>
<!-- Button --> <!-- Button -->