Commit 01600f89e9b417c9248ee0e151e0173ebdc76dbb

Authored by xp.Huang
2 parents a12d48f8 526287a6

Merge branch 'ft' into 'main_dev'

fix: DEFECT-1405 修复测试数据,输出参数没有显示完全

See merge request yunteng/thingskit-front!739
@@ -67,7 +67,7 @@ export function useAlarmNotify(params: UseAlarmNotifyParams = {}) { @@ -67,7 +67,7 @@ export function useAlarmNotify(params: UseAlarmNotifyParams = {}) {
67 67
68 if (items.length) { 68 if (items.length) {
69 const first = items.at(0)!; 69 const first = items.at(0)!;
70 - const { deviceName, id, severity } = first; 70 + const { deviceName, id, severity, type } = first;
71 71
72 let key: Nullable<string> = `open-notify-${id}`; 72 let key: Nullable<string> = `open-notify-${id}`;
73 73
@@ -82,6 +82,10 @@ export function useAlarmNotify(params: UseAlarmNotifyParams = {}) { @@ -82,6 +82,10 @@ export function useAlarmNotify(params: UseAlarmNotifyParams = {}) {
82 h('span', { style: { marginRight: '5px' } }, '设备:'), 82 h('span', { style: { marginRight: '5px' } }, '设备:'),
83 h('span', {}, `[${deviceName}]`), 83 h('span', {}, `[${deviceName}]`),
84 ]), 84 ]),
  85 + h('div', { style: { marginRight: '5px' } }, [
  86 + h('span', { style: { marginRight: '5px' } }, '告警场景:'),
  87 + h('span', {}, `[${type}]`),
  88 + ]),
85 h('div', { style: { marginTop: '5px' } }, [ 89 h('div', { style: { marginTop: '5px' } }, [
86 h('span', { style: { marginRight: '5px' } }, '告警状态:'), 90 h('span', { style: { marginRight: '5px' } }, '告警状态:'),
87 h(Tag, { color }, () => `${alarmNotifyStatusMean}`), 91 h(Tag, { color }, () => `${alarmNotifyStatusMean}`),
@@ -109,6 +109,15 @@ @@ -109,6 +109,15 @@
109 unref(DeviceStep1Ref)?.resetFields(); 109 unref(DeviceStep1Ref)?.resetFields();
110 unref(DeviceStep2Ref)?.resetFieldsValueAndStatus(); 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 const msg = computed(() => (unref(isUpdate) ? '更新设备成功' : '新增设备成功')); 122 const msg = computed(() => (unref(isUpdate) ? '更新设备成功' : '新增设备成功'));
114 async function handleOk() { 123 async function handleOk() {
@@ -150,6 +159,7 @@ @@ -150,6 +159,7 @@
150 ...DeviceStep1Ref.value?.positionState, 159 ...DeviceStep1Ref.value?.positionState,
151 }, 160 },
152 }; 161 };
  162 + validateNameLength(stepRecord.name);
153 await createOrEditDevice(editData); 163 await createOrEditDevice(editData);
154 } else { 164 } else {
155 const stepRecord = unref(stepState); 165 const stepRecord = unref(stepState);
@@ -178,6 +188,7 @@ @@ -178,6 +188,7 @@
178 : null, 188 : null,
179 }, 189 },
180 }; 190 };
  191 + validateNameLength(stepRecord.name);
181 await createOrEditDevice(createData); 192 await createOrEditDevice(createData);
182 } 193 }
183 createMessage.success(unref(msg)); 194 createMessage.success(unref(msg));
@@ -107,7 +107,6 @@ @@ -107,7 +107,6 @@
107 v-else 107 v-else
108 v-model:value="scriptForm.output" 108 v-model:value="scriptForm.output"
109 placeholder="输出参数为服务端返回的内容" 109 placeholder="输出参数为服务端返回的内容"
110 - :maxlength="255"  
111 /> 110 />
112 </a-form-item> 111 </a-form-item>
113 </a-form> 112 </a-form>
@@ -138,7 +138,7 @@ export const formSchema: FormSchema[] = [ @@ -138,7 +138,7 @@ export const formSchema: FormSchema[] = [
138 component: 'Input', 138 component: 'Input',
139 required: true, 139 required: true,
140 componentProps: { 140 componentProps: {
141 - maxLength: 255, 141 + maxLength: 100,
142 }, 142 },
143 }, 143 },
144 144