Commit ec080c8c04dbf33dbc2f786faa29899549af8b7c
1 parent
948d1987
fix:DEFECT-621 DEFECT-622 DEFECT-613 修复时间段显示为一样的时间 设备未填入属性提示修改 编辑报表配置,先设置自定义周期,再…
…编辑为固定周期,时间周期和间隔时间回显为0,并且可以编辑成功
Showing
2 changed files
with
31 additions
and
1 deletions
| ... | ... | @@ -13,6 +13,7 @@ |
| 13 | 13 | <BasicForm @register="registerForm"> |
| 14 | 14 | <template #devices="{ model, field }"> |
| 15 | 15 | <p style="display: none">{{ field }}</p> |
| 16 | + <p>{{ queryModeFunc(model['queryMode']) }}</p> | |
| 16 | 17 | <p>{{ orgFunc(model['organizationId']) }}</p> |
| 17 | 18 | <Select |
| 18 | 19 | placeholder="请选择设备" |
| ... | ... | @@ -81,9 +82,23 @@ |
| 81 | 82 | let editResData: any = reactive({}); |
| 82 | 83 | const editDeviceAttr: any = ref([]); |
| 83 | 84 | const orgFuncId = ref(''); |
| 85 | + const queryModeStr = ref(''); | |
| 84 | 86 | const orgFunc = (e) => { |
| 85 | 87 | orgFuncId.value = e; |
| 86 | 88 | }; |
| 89 | + const queryModeFunc = (e) => { | |
| 90 | + queryModeStr.value = e; | |
| 91 | + }; | |
| 92 | + watch( | |
| 93 | + () => queryModeStr.value, | |
| 94 | + (newValue: string) => { | |
| 95 | + if (newValue == 'latest') { | |
| 96 | + setFieldsValue({ startTs: 1000 }); | |
| 97 | + setFieldsValue({ interval: 1000 }); | |
| 98 | + } else { | |
| 99 | + } | |
| 100 | + } | |
| 101 | + ); | |
| 87 | 102 | watch( |
| 88 | 103 | () => orgFuncId.value, |
| 89 | 104 | async (newValue: string) => { |
| ... | ... | @@ -335,15 +350,25 @@ |
| 335 | 350 | const values = await validate(); |
| 336 | 351 | if (!values) return; |
| 337 | 352 | getFormValueFunc(); |
| 353 | + let hasAttr = false; | |
| 338 | 354 | if (!unref(isUpdate)) { |
| 339 | 355 | if (getAttrDevice.value.length === 0) { |
| 340 | 356 | return createMessage.error('请选择设备及其属性'); |
| 357 | + } else { | |
| 358 | + getAttrDevice.value.forEach((f: any) => { | |
| 359 | + if (f.attributes == undefined) hasAttr = true; | |
| 360 | + }); | |
| 341 | 361 | } |
| 342 | 362 | } else { |
| 343 | 363 | if (getAttrDevice.value.length === 0) { |
| 344 | 364 | return createMessage.error('请选择设备及其属性'); |
| 365 | + } else { | |
| 366 | + getAttrDevice.value.forEach((f: any) => { | |
| 367 | + if (f.attributes == undefined) hasAttr = true; | |
| 368 | + }); | |
| 345 | 369 | } |
| 346 | 370 | } |
| 371 | + if (hasAttr) return createMessage.error('请选择设备属性'); | |
| 347 | 372 | if (values.executeWay == 0) { |
| 348 | 373 | executeContent = null; |
| 349 | 374 | } else { |
| ... | ... | @@ -368,6 +393,11 @@ |
| 368 | 393 | }, |
| 369 | 394 | queryMode: values?.queryMode === 'latest' ? 0 : 1, |
| 370 | 395 | }; |
| 396 | + if (queryCondition.queryMode === 1) { | |
| 397 | + if (queryCondition.startTs == queryCondition.endTs) { | |
| 398 | + return createMessage.error('自定义周期时间不能选择一样'); | |
| 399 | + } | |
| 400 | + } | |
| 371 | 401 | |
| 372 | 402 | delete values.devices; |
| 373 | 403 | delete values.agg; | ... | ... |
| ... | ... | @@ -407,13 +407,13 @@ export const formSchema: QFormSchema[] = [ |
| 407 | 407 | componentProps({ formActionType }) { |
| 408 | 408 | const { setFieldsValue } = formActionType; |
| 409 | 409 | return { |
| 410 | - getPopupContainer: () => document.body, | |
| 411 | 410 | placeholder: '请选择查询周期', |
| 412 | 411 | options: [ |
| 413 | 412 | { label: '固定周期', value: QueryWay.LATEST }, |
| 414 | 413 | { label: '自定义周期', value: QueryWay.TIME_PERIOD }, |
| 415 | 414 | ], |
| 416 | 415 | onChange(value) { |
| 416 | + console.log(value) | |
| 417 | 417 | value === QueryWay.LATEST |
| 418 | 418 | ? setFieldsValue({ |
| 419 | 419 | [SchemaFiled.DATE_RANGE]: [], | ... | ... |