CN-773: 曲线图支持框选缩放

This commit is contained in:
刘洪洪
2022-11-09 17:23:31 +08:00
parent e355eb31cd
commit 39edceb0dd
5 changed files with 126 additions and 6 deletions

View File

@@ -76,7 +76,7 @@
</template>
<script>
import { ref, computed } from 'vue'
import { ref, computed, watch, reactive } from 'vue'
import { storageKey } from '@/utils/constants'
import { getMillisecond, timestampToList } from '@/utils/date-util'
import { useStore } from 'vuex'
@@ -157,6 +157,21 @@ export default {
// refs
const newDatePicker = ref(null)
// echarts框选时间范围
const rangeEchartsData = reactive({
value: computed(() => store.state.panel.rangeEchartsData)
})
watch(() => rangeEchartsData.value, (newVal, oldVal) => {
if (newVal) {
myStartTime.value = getMillisecond(newVal.startTime)
myEndTime.value = getMillisecond(newVal.endTime)
isCustom.value = true
dateRangeValue.value = -1
returnValue()
}
})
// methods
/**
* 打开/关闭时间面板
@@ -256,6 +271,7 @@ export default {
myEndTime,
dropdownFlag,
utcStr,
rangeEchartsData,
address,
dateRangeArr,
dateRangeValue,