Skip to content

Commit

Permalink
Merge pull request #96 from getda/main
Browse files Browse the repository at this point in the history
fix: form-select 全选数据重复
  • Loading branch information
zds-s authored Jan 19, 2024
2 parents 82780f9 + eecbe2e commit 577973a
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 577973a

Please sign in to comment.