Commit 04e5a2bba9706462244419e1a338e39cb4d58f5c

Authored by fengtao
1 parent cfc9d9f2

perf: 优化报表配置选择设备,超出数量提示信息

... ... @@ -25,6 +25,7 @@
25 25 import SelectAttributes from './SelectAttributes.vue';
26 26 import { TDeviceList, TSelectOption } from '../type';
27 27 import { createPickerSearch } from '/@/utils/pickerSearch';
  28 + import { useMessage } from '/@/hooks/web/useMessage';
28 29
29 30 const props = defineProps({
30 31 selectOptions: {
... ... @@ -37,6 +38,8 @@
37 38 },
38 39 });
39 40
  41 + const { createMessage } = useMessage();
  42 +
40 43 const selectValue = ref([]);
41 44
42 45 const bindDeviceRef = {
... ... @@ -52,7 +55,7 @@
52 55 };
53 56
54 57 const handleDeviceChange = (_, options) => {
55   - if (options.length > selectDeviceMaxCount.value) return;
  58 + if (options.length > selectDeviceMaxCount.value) return createMessage.warn('最大限制选择5个');
56 59 deviceList.value = options;
57 60 };
58 61
... ...