Commit c283675271453d133eb3a73feb0e3fccf8a4dbb3
1 parent
86d40b53
fix:DEFECT-1175 and 1176 报表配置刚开始为聚合数据,然后再点击编辑,选择聚合条件少了计数, and 编辑时,求和显示为count了
Showing
1 changed file
with
10 additions
and
4 deletions
| ... | ... | @@ -41,7 +41,7 @@ |
| 41 | 41 | </BasicDrawer> |
| 42 | 42 | </template> |
| 43 | 43 | <script lang="ts" setup> |
| 44 | - import { ref, computed, unref, reactive, watch, Ref } from 'vue'; | |
| 44 | + import { ref, computed, unref, reactive, watch, Ref, nextTick } from 'vue'; | |
| 45 | 45 | import { BasicForm, useForm } from '/@/components/Form'; |
| 46 | 46 | import { formSchema, organizationId } from './config.data'; |
| 47 | 47 | import { BasicDrawer, useDrawerInner } from '/@/components/Drawer'; |
| ... | ... | @@ -198,6 +198,7 @@ |
| 198 | 198 | const isViewDetail = ref(false); |
| 199 | 199 | |
| 200 | 200 | const [registerDrawer, { setDrawerProps, closeDrawer }] = useDrawerInner(async (data) => { |
| 201 | + await nextTick(); | |
| 201 | 202 | await resetFields(); |
| 202 | 203 | setDrawerProps({ confirmLoading: false }); |
| 203 | 204 | isUpdate.value = !!data?.isUpdate; |
| ... | ... | @@ -222,6 +223,10 @@ |
| 222 | 223 | await setFieldsValue(editResData.data); |
| 223 | 224 | //回显嵌套数据 |
| 224 | 225 | await setFieldsValue({ |
| 226 | + dateGroupGap: | |
| 227 | + editResData.data.queryCondition?.queryMode === 1 | |
| 228 | + ? editResData.data.queryCondition?.interval | |
| 229 | + : null, | |
| 225 | 230 | agg: editResData.data.queryCondition?.agg, |
| 226 | 231 | interval: editResData.data.queryCondition?.interval, |
| 227 | 232 | limit: editResData.data.queryCondition?.limit, |
| ... | ... | @@ -266,6 +271,7 @@ |
| 266 | 271 | { label: '最大值', value: AggregateDataEnum.MAX }, |
| 267 | 272 | { label: '平均值', value: AggregateDataEnum.AVG }, |
| 268 | 273 | { label: '求和', value: AggregateDataEnum.SUM }, |
| 274 | + { label: '计数', value: AggregateDataEnum.COUNT }, | |
| 269 | 275 | { label: '空', value: AggregateDataEnum.NONE }, |
| 270 | 276 | ]; |
| 271 | 277 | const updateSchemaAgg = (options: {}) => { |
| ... | ... | @@ -276,8 +282,8 @@ |
| 276 | 282 | }, |
| 277 | 283 | }); |
| 278 | 284 | }; |
| 279 | - if (editResData.data.dataType == 1) updateSchemaAgg(dataCompareOpions.slice(0, 4)); | |
| 280 | - else updateSchemaAgg(dataCompareOpions.slice(4, 5)); | |
| 285 | + if (editResData.data.dataType == 1) updateSchemaAgg(dataCompareOpions.slice(0, 5)); | |
| 286 | + else updateSchemaAgg(dataCompareOpions.slice(5, 6)); | |
| 281 | 287 | //回显执行方式和查询周期 |
| 282 | 288 | const dataQueryOpions = [ |
| 283 | 289 | { label: '固定周期', value: QueryWay.LATEST }, |
| ... | ... | @@ -442,7 +448,7 @@ |
| 442 | 448 | } |
| 443 | 449 | queryCondition = { |
| 444 | 450 | agg: values.agg, |
| 445 | - interval: values.interval, | |
| 451 | + interval: values?.queryMode === 'latest' ? values.interval : values.dateGroupGap, | |
| 446 | 452 | limit: values.limit, |
| 447 | 453 | ...{ |
| 448 | 454 | startTs: startTs.value, | ... | ... |