diff --git a/core/core-frontend/src/custom-component/v-query/DynamicTimeFiltering.vue b/core/core-frontend/src/custom-component/v-query/DynamicTimeFiltering.vue
new file mode 100644
index 0000000000..391a6be21f
--- /dev/null
+++ b/core/core-frontend/src/custom-component/v-query/DynamicTimeFiltering.vue
@@ -0,0 +1,145 @@
+
+
+
+
+
diff --git a/core/core-frontend/src/custom-component/v-query/DynamicTimeRange.vue b/core/core-frontend/src/custom-component/v-query/DynamicTimeRange.vue
index 1c30ea34a3..07f4900409 100644
--- a/core/core-frontend/src/custom-component/v-query/DynamicTimeRange.vue
+++ b/core/core-frontend/src/custom-component/v-query/DynamicTimeRange.vue
@@ -1,5 +1,5 @@
+
+
+
+
diff --git a/core/core-frontend/src/custom-component/v-query/QueryConditionConfiguration.vue b/core/core-frontend/src/custom-component/v-query/QueryConditionConfiguration.vue
index bf622cbe69..ea771f4b2a 100644
--- a/core/core-frontend/src/custom-component/v-query/QueryConditionConfiguration.vue
+++ b/core/core-frontend/src/custom-component/v-query/QueryConditionConfiguration.vue
@@ -19,6 +19,7 @@ import DynamicTimeRange from './DynamicTimeRange.vue'
import { getDatasetTree } from '@/api/dataset'
import { Tree } from '@/views/visualized/data/dataset/form/CreatDsGroup.vue'
import draggable from 'vuedraggable'
+import RangeFilterTime from './RangeFilterTime.vue'
const { t } = useI18n()
const dvMainStore = dvMainStoreWithOut()
@@ -120,7 +121,11 @@ const { queryElement } = toRefs(props)
const getDetype = (id, arr) => {
return arr.find(ele => ele.id === id)?.deType
}
-
+const visiblePopover = ref(false)
+const handleVisiblePopover = ev => {
+ ev.stopPropagation()
+ visiblePopover.value = !visiblePopover.value
+}
const showConfiguration = computed(() => {
if (!curComponent.value) return false
if (!curComponent.value.checkedFields?.length) return false
@@ -162,6 +167,7 @@ const handleCheckAllChange = (val: boolean) => {
isIndeterminate.value = false
}
const handleCheckedFieldsChange = (value: string[]) => {
+ handleDialogClick()
const checkedCount = value.length
checkAll.value = checkedCount === fields.value.length
isIndeterminate.value = checkedCount > 0 && checkedCount < fields.value.length
@@ -194,6 +200,7 @@ const setType = () => {
}
const setTypeChange = () => {
+ handleDialogClick()
nextTick(() => {
curComponent.value.field.id = ''
inputCom.value?.displayTypeChange?.()
@@ -496,7 +503,21 @@ const parameterCompletion = () => {
timeNumRange: 0,
relativeToCurrentTypeRange: 'year',
aroundRange: 'f',
- arbitraryTimeRange: new Date()
+ arbitraryTimeRange: new Date(),
+ timeRange: {
+ intervalType: 'none',
+ dynamicWindow: false,
+ maximumSingleQuery: 0,
+ regularOrTrends: 'fixed',
+ regularOrTrendsValue: '',
+ relativeToCurrent: 'custom',
+ timeNum: 0,
+ relativeToCurrentType: 'year',
+ around: 'f',
+ timeNumRange: 0,
+ relativeToCurrentTypeRange: 'year',
+ aroundRange: 'f'
+ }
}
Object.entries(attributes).forEach(([key, val]) => {
!curComponent.value[key] && (curComponent.value[key] = val)
@@ -504,6 +525,7 @@ const parameterCompletion = () => {
}
const handleCondition = item => {
+ handleDialogClick()
if (activeConditionForRename.id) return
activeCondition.value = item.id
curComponent.value = conditions.value.find(ele => ele.id === item.id)
@@ -557,7 +579,9 @@ const showError = computed(() => {
}
return (optionValueSource === 1 && !field.id) || (optionValueSource === 2 && !valueSource.length)
})
-
+const handleDialogClick = () => {
+ visiblePopover.value = false
+}
const relativeToCurrentList = computed(() => {
let list = []
if (!curComponent.value) return list
@@ -682,6 +706,7 @@ const timeGranularityChange = (val: string) => {
}
const timeGranularityMultipleChange = (val: string) => {
+ handleDialogClick()
if (
['yearrange', 'monthrange', 'datetimerange'].indexOf(val) <
['year', 'month', 'date'].indexOf(curComponent.value.relativeToCurrentType)
@@ -797,7 +822,7 @@ defineExpose({
@mousedown.stop
@mousedup.stop
>
-
+
查询条件
@@ -1186,6 +1211,35 @@ defineExpose({
+
+
+
+
+
+
+
+
+
+
+
+ 设置
+
+
+
+
+ 已配置
+
+
@@ -1616,6 +1670,13 @@ defineExpose({
border-radius: 2px;
background: rgba(31, 35, 41, 0.1);
margin-left: 8px;
+
+ &.range-filter-time-flag {
+ display: inline-block;
+ padding: 1px 4px;
+ line-height: 14px;
+ margin-left: 4px;
+ }
}
.flex-align-center {
diff --git a/core/core-frontend/src/custom-component/v-query/RangeFilterTime.vue b/core/core-frontend/src/custom-component/v-query/RangeFilterTime.vue
new file mode 100644
index 0000000000..4d8c91ac42
--- /dev/null
+++ b/core/core-frontend/src/custom-component/v-query/RangeFilterTime.vue
@@ -0,0 +1,486 @@
+
+
+
+
+
设置时间筛选范围
+
+
区间类型
+
+
+
+ {{
+ ele.label
+ }}
+
+
+
+
+
+
{{ regularOrTrendsTitle }}
+
+
+
+ 固定时间
+ 动态时间
+
+
+
+
+
+
+
+
+
开始时间
+
+
+
+
+
+
+
+
+
+
+
+
结束时间
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 单次查询最多
+
+ 月
+
+
+
+
+
+
+
diff --git a/core/core-frontend/src/custom-component/v-query/time-format.ts b/core/core-frontend/src/custom-component/v-query/time-format.ts
index 1705023e75..8d0bee32cd 100644
--- a/core/core-frontend/src/custom-component/v-query/time-format.ts
+++ b/core/core-frontend/src/custom-component/v-query/time-format.ts
@@ -219,8 +219,23 @@ function getDynamicRange({
return selectValue
}
-
+interface TimeRange {
+ intervalType: string
+ dynamicWindow: boolean
+ maximumSingleQuery: number
+ regularOrTrends: string
+ regularOrTrendsValue: string
+ relativeToCurrent: string
+ timeNum: number
+ relativeToCurrentType: string
+ around: string
+ timeNumRange: number
+ relativeToCurrentTypeRange: string
+ aroundRange: string
+ timeGranularityMultiple: string
+}
export {
+ TimeRange,
getThisYear,
getLastYear,
getThisMonth,