Commit c1105ebeba4a1a4a89aad539885d0dbe53da5e82

Authored by fengwotao
1 parent 10ca76d7

fix: 修改报表配置设备数限制5个

@@ -45,11 +45,14 @@ @@ -45,11 +45,14 @@
45 45
46 const deviceList: Ref<TDeviceList[]> = ref([]); 46 const deviceList: Ref<TDeviceList[]> = ref([]);
47 47
  48 + const selectDeviceMaxCount = ref(5); // 限制设备数为5
  49 +
48 const getSelectAttributes = () => { 50 const getSelectAttributes = () => {
49 return unref(bindDeviceRef.deviceAttrRef)?.map((item: any) => item.emitChange()); 51 return unref(bindDeviceRef.deviceAttrRef)?.map((item: any) => item.emitChange());
50 }; 52 };
51 53
52 const handleDeviceChange = (_, options) => { 54 const handleDeviceChange = (_, options) => {
  55 + if (options.length > selectDeviceMaxCount.value) return;
53 deviceList.value = options; 56 deviceList.value = options;
54 }; 57 };
55 58