Commit 01600f89e9b417c9248ee0e151e0173ebdc76dbb
Merge branch 'ft' into 'main_dev'
fix: DEFECT-1405 修复测试数据,输出参数没有显示完全 See merge request yunteng/thingskit-front!739
Showing
4 changed files
with
17 additions
and
3 deletions
| ... | ... | @@ -67,7 +67,7 @@ export function useAlarmNotify(params: UseAlarmNotifyParams = {}) { |
| 67 | 67 | |
| 68 | 68 | if (items.length) { |
| 69 | 69 | const first = items.at(0)!; |
| 70 | - const { deviceName, id, severity } = first; | |
| 70 | + const { deviceName, id, severity, type } = first; | |
| 71 | 71 | |
| 72 | 72 | let key: Nullable<string> = `open-notify-${id}`; |
| 73 | 73 | |
| ... | ... | @@ -82,6 +82,10 @@ export function useAlarmNotify(params: UseAlarmNotifyParams = {}) { |
| 82 | 82 | h('span', { style: { marginRight: '5px' } }, '设备:'), |
| 83 | 83 | h('span', {}, `[${deviceName}]`), |
| 84 | 84 | ]), |
| 85 | + h('div', { style: { marginRight: '5px' } }, [ | |
| 86 | + h('span', { style: { marginRight: '5px' } }, '告警场景:'), | |
| 87 | + h('span', {}, `[${type}]`), | |
| 88 | + ]), | |
| 85 | 89 | h('div', { style: { marginTop: '5px' } }, [ |
| 86 | 90 | h('span', { style: { marginRight: '5px' } }, '告警状态:'), |
| 87 | 91 | h(Tag, { color }, () => `${alarmNotifyStatusMean}`), | ... | ... |
| ... | ... | @@ -109,6 +109,15 @@ |
| 109 | 109 | unref(DeviceStep1Ref)?.resetFields(); |
| 110 | 110 | unref(DeviceStep2Ref)?.resetFieldsValueAndStatus(); |
| 111 | 111 | } |
| 112 | + //验证设备名称不能超过255长度 | |
| 113 | + const MAX_NAME_LENGTH = 255; | |
| 114 | + const validateNameLength = (name: string) => { | |
| 115 | + if (String(name).length > MAX_NAME_LENGTH) { | |
| 116 | + const errorText = `设备名称长度不能超过${MAX_NAME_LENGTH}`; | |
| 117 | + createMessage.error(errorText); | |
| 118 | + throw Error(errorText); | |
| 119 | + } | |
| 120 | + }; | |
| 112 | 121 | // 提交 |
| 113 | 122 | const msg = computed(() => (unref(isUpdate) ? '更新设备成功' : '新增设备成功')); |
| 114 | 123 | async function handleOk() { |
| ... | ... | @@ -150,6 +159,7 @@ |
| 150 | 159 | ...DeviceStep1Ref.value?.positionState, |
| 151 | 160 | }, |
| 152 | 161 | }; |
| 162 | + validateNameLength(stepRecord.name); | |
| 153 | 163 | await createOrEditDevice(editData); |
| 154 | 164 | } else { |
| 155 | 165 | const stepRecord = unref(stepState); |
| ... | ... | @@ -178,6 +188,7 @@ |
| 178 | 188 | : null, |
| 179 | 189 | }, |
| 180 | 190 | }; |
| 191 | + validateNameLength(stepRecord.name); | |
| 181 | 192 | await createOrEditDevice(createData); |
| 182 | 193 | } |
| 183 | 194 | createMessage.success(unref(msg)); | ... | ... |