Commit d018f60a408a9ecfd1b530087992ad891d134df5
1 parent
439305f2
fix: DEFECT-578 reset form is invalid && close modal not clean echarts instance
Showing
2 changed files
with
6 additions
and
3 deletions
| ... | ... | @@ -107,7 +107,7 @@ export const defaultSchemas: FormSchema[] = [ |
| 107 | 107 | field: SchemaFiled.AGG, |
| 108 | 108 | label: '数据聚合功能', |
| 109 | 109 | component: 'Select', |
| 110 | - defaultValue: AggregateDataEnum.NONE, | |
| 110 | + // defaultValue: AggregateDataEnum.NONE, | |
| 111 | 111 | componentProps: { |
| 112 | 112 | getPopupContainer: () => document.body, |
| 113 | 113 | options: [ |
| ... | ... | @@ -144,7 +144,7 @@ export const defaultSchemas: FormSchema[] = [ |
| 144 | 144 | field: SchemaFiled.LIMIT, |
| 145 | 145 | label: '最大值', |
| 146 | 146 | component: 'InputNumber', |
| 147 | - defaultValue: 7, | |
| 147 | + // defaultValue: 7, | |
| 148 | 148 | ifShow({ values }) { |
| 149 | 149 | return values[SchemaFiled.AGG] === AggregateDataEnum.NONE; |
| 150 | 150 | }, | ... | ... |
| ... | ... | @@ -108,7 +108,7 @@ |
| 108 | 108 | const wrapRef = ref<HTMLDivElement | null>(null); |
| 109 | 109 | const chartRef = ref<HTMLDivElement | null>(null); |
| 110 | 110 | const deviceAttrs = ref<string[]>([]); |
| 111 | - const { setOptions } = useECharts(chartRef as Ref<HTMLDivElement>); | |
| 111 | + const { setOptions, getInstance } = useECharts(chartRef as Ref<HTMLDivElement>); | |
| 112 | 112 | const isNull = ref(true); |
| 113 | 113 | const { toPromise } = useScript({ src: BAI_DU_MAP_URL }); |
| 114 | 114 | const [registerDetailDrawer, { openDrawer }] = useDrawer(); |
| ... | ... | @@ -299,6 +299,8 @@ |
| 299 | 299 | |
| 300 | 300 | method.setFieldsValue({ |
| 301 | 301 | [SchemaFiled.START_TS]: 1 * 24 * 60 * 60 * 1000, |
| 302 | + [SchemaFiled.LIMIT]: 7, | |
| 303 | + [SchemaFiled.AGG]: AggregateDataEnum.NONE, | |
| 302 | 304 | }); |
| 303 | 305 | |
| 304 | 306 | if (!hasDeviceAttr()) return; |
| ... | ... | @@ -361,6 +363,7 @@ |
| 361 | 363 | [SchemaFiled.LIMIT]: 7, |
| 362 | 364 | [SchemaFiled.AGG]: AggregateDataEnum.NONE, |
| 363 | 365 | }); |
| 366 | + getInstance()?.clear(); | |
| 364 | 367 | }; |
| 365 | 368 | |
| 366 | 369 | onMounted(() => { | ... | ... |