Showing
1 changed file
with
8 additions
and
1 deletions
@@ -9,6 +9,7 @@ | @@ -9,6 +9,7 @@ | ||
9 | :disabled="disabled" | 9 | :disabled="disabled" |
10 | mode="multiple" | 10 | mode="multiple" |
11 | labelInValue | 11 | labelInValue |
12 | + :max-tag-count="selectDeviceMaxCount" | ||
12 | /> | 13 | /> |
13 | <template v-for="(item, index) in deviceList" :key="item.value"> | 14 | <template v-for="(item, index) in deviceList" :key="item.value"> |
14 | <SelectAttributes | 15 | <SelectAttributes |
@@ -25,6 +26,7 @@ | @@ -25,6 +26,7 @@ | ||
25 | import SelectAttributes from './SelectAttributes.vue'; | 26 | import SelectAttributes from './SelectAttributes.vue'; |
26 | import { TDeviceList, TSelectOption } from '../type'; | 27 | import { TDeviceList, TSelectOption } from '../type'; |
27 | import { createPickerSearch } from '/@/utils/pickerSearch'; | 28 | import { createPickerSearch } from '/@/utils/pickerSearch'; |
29 | + import { useMessage } from '/@/hooks/web/useMessage'; | ||
28 | 30 | ||
29 | const props = defineProps({ | 31 | const props = defineProps({ |
30 | selectOptions: { | 32 | selectOptions: { |
@@ -37,6 +39,8 @@ | @@ -37,6 +39,8 @@ | ||
37 | }, | 39 | }, |
38 | }); | 40 | }); |
39 | 41 | ||
42 | + const { createMessage } = useMessage(); | ||
43 | + | ||
40 | const selectValue = ref([]); | 44 | const selectValue = ref([]); |
41 | 45 | ||
42 | const bindDeviceRef = { | 46 | const bindDeviceRef = { |
@@ -52,7 +56,10 @@ | @@ -52,7 +56,10 @@ | ||
52 | }; | 56 | }; |
53 | 57 | ||
54 | const handleDeviceChange = (_, options) => { | 58 | const handleDeviceChange = (_, options) => { |
55 | - if (options.length > selectDeviceMaxCount.value) return; | 59 | + if (options.length > selectDeviceMaxCount.value) { |
60 | + createMessage.warn(`限制选择设备数为${selectDeviceMaxCount.value}`); | ||
61 | + return; | ||
62 | + } | ||
56 | deviceList.value = options; | 63 | deviceList.value = options; |
57 | }; | 64 | }; |
58 | 65 |