فهرست منبع

fix: 修复设备功能执行时对布尔参数的判断

yanglzh 1 سال پیش
والد
کامیت
2f7fb7ed6b
1فایلهای تغییر یافته به همراه3 افزوده شده و 1 حذف شده
  1. 3 1
      src/views/iot/device/instance/component/function.vue

+ 3 - 1
src/views/iot/device/instance/component/function.vue

@@ -69,7 +69,9 @@ function getData() {
 function run(row: IListItem) {
 	row.result = ''
 
-	const notValid = row.inputs.some((item) => !item.value)
+	// 如果是布尔类型,不需要校验,其他类型不能为空
+	const notValid = row.inputs.some((item) => item.value === null || item.value === '' || item.value === undefined)
+	
 	if (notValid) return ElMessage.info('请输入完整参数')
 
 	const params: any = {}