Skip to content

Commit

Permalink
fix: form-select 全选数据重复
Browse files Browse the repository at this point in the history
  • Loading branch information
getda authored Jan 7, 2024
1 parent 0e6b7e0 commit eecbe2e
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/components/ma-form/formItem/form-select.vue
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@
<script setup>
import { ref, inject, onMounted, nextTick, watch } from 'vue'
import MaFormItem from './form-item.vue'
import { get, isUndefined, set, xor, isObject } from 'lodash'
import { get, isUndefined, set, xor, isObject, indexOf } from 'lodash'
import { maEvent } from '../js/formItemMixin.js'
import { handlerCascader, loadDict } from '../js/networkRequest.js'

Expand Down Expand Up @@ -130,7 +130,9 @@ const handleSelectAll = (status) => {
}
if (status) {
dictList.value[dictIndex].map(item=>{
value.value.push(item.value)
if(indexOf(value.value, item.value) === -1) {
value.value.push(item.value)
}
})
} else {
value.value = []
Expand Down

0 comments on commit eecbe2e

Please sign in to comment.