imatrix-ui 2.9.45-dw → 2.9.47-dw

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "imatrix-ui",
3
- "version": "2.9.45-dw",
3
+ "version": "2.9.47-dw",
4
4
  "description": "前端组件库:表格、表单、组织结构树等",
5
5
  "main": "lib/super-ui.umd.min.js",
6
6
  "private": false,
@@ -21,6 +21,7 @@
21
21
  @blur="blurEvent($event)"
22
22
  @focus="focus"
23
23
  >
24
+ <el-option v-if="baseProps.multiple !== undefined && baseProps.multiple === true && optionItems && optionItems.length > 0 " :label="$t('superGrid.selectAll')" value="saveAll" />
24
25
  <el-option
25
26
  v-for="item in optionItems"
26
27
  :key="item.value"
@@ -224,6 +225,21 @@ export default {
224
225
  },
225
226
  // 必须有该方法,否则无法给字段赋值
226
227
  inputValue(newValue) {
228
+ if (this.baseProps.multiple !== undefined && this.baseProps.multiple === true && newValue && newValue.indexOf('saveAll') >= 0) {
229
+ // 表示全选时,更新值为下拉选所有选项
230
+ if (newValue.length - 1 >= this.optionItems.length) {
231
+ // 表示需要取消全选
232
+ newValue = []
233
+ } else {
234
+ // 表示需要全选
235
+ const allValues = []
236
+ for (let i = 0; i < this.optionItems.length; i++) {
237
+ const item = this.optionItems[i]
238
+ allValues.push(item[this.valueAttribute])
239
+ }
240
+ newValue = allValues
241
+ }
242
+ }
227
243
  this.$emit('input', newValue)
228
244
  if (newValue === null || newValue === undefined || newValue === '') {
229
245
  this.remoteQueryMethod(newValue)