vue2-client 1.4.60 → 1.4.62

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/CHANGELOG.md CHANGED
@@ -1,8 +1,11 @@
1
1
  # Change Log
2
2
  > 所有关于本项目的变化都在该文档里。
3
3
 
4
- **1.4.60 -2022-11-29 @苗艳强**
4
+ **1.4.60 - 1.4.61 -2022-11-29 @苗艳强**
5
5
  - 新增树形选择框
6
+ - 修复查询方式默认选择问题
7
+ - 修复固定集合编辑错误问题
8
+ - 树形选择框支持模糊查询
6
9
 
7
10
  **1.4.58 - 1.4.59 -2022-11-29 @江超**
8
11
  - 修复一些小问题
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vue2-client",
3
- "version": "1.4.60",
3
+ "version": "1.4.62",
4
4
  "private": false,
5
5
  "scripts": {
6
6
  "serve": "vue-cli-service serve",
@@ -358,7 +358,7 @@ export default {
358
358
  columnItem.lazyLoad = 'false'
359
359
  }
360
360
  // 下拉框数据源兼容处理
361
- if ((columnItem.formType === 'select' || columnItem.formType === 'cascader') && columnItem.selectKey) {
361
+ if ((columnItem.formType === 'select' || columnItem.formType === 'cascader' || columnItem.formType === 'treeSelect') && columnItem.selectKey) {
362
362
  // 数据源为logic
363
363
  if (columnItem.selectKey.toString().startsWith('logic@')) {
364
364
  columnItem.selectType = 'logic'
@@ -678,8 +678,8 @@ export default {
678
678
  if (['FilesId', 'Images'].includes(this.item.key)) { this.item.key = '' }
679
679
  this.resetDataMode()
680
680
  // 表单查询方式有预选项时
681
- if (this.queryTypeV.length === 1) {
682
- this.item.queryType = this.queryTypeV[0].value
681
+ if (this.queryTypeV.length) {
682
+ this.item.queryType = this.queryTypeV[0].key
683
683
  }
684
684
  }
685
685
  },
@@ -716,6 +716,10 @@ export default {
716
716
  if (!this.selectDataShow) {
717
717
  this.delKey(this.item, 'selectType', 'selectKey', 'lazyLoad', 'selectKeyName')
718
718
  }
719
+ // 删除空的关联外键字段
720
+ if (!this.item.selectKeyName) {
721
+ delete this.item.selectKeyName
722
+ }
719
723
  // 默认插槽就先删除
720
724
  if (this.item.slot && (this.item.slot.type === 'default' || !this.item.slot.type)) { delete this.item.slot }
721
725
  // 根据数据模式处理数据
@@ -313,15 +313,17 @@
313
313
  :xxl="xxl">
314
314
  <a-form-model-item :ref="attr.model" :label="attr.name" :prop="attr.model">
315
315
  <a-tree-select
316
- v-model="form[attr.model]"
316
+ v-model="treeSelectValue"
317
317
  :disabled="disabled"
318
318
  :tree-data="getTreeData()"
319
- :tree-checkable="mode === '查询'"
319
+ :tree-checkable="mode === '查询' && attr.queryType !== 'RIGHT_LIKE'"
320
320
  :placeholder="'请选择' + attr.name"
321
321
  :dropdown-style="{ maxHeight: '400px' }"
322
322
  tree-node-filter-prop="label"
323
+ :show-checked-strategy="attr.queryType === 'RIGHT_LIKE' ? 'SHOW_ALL' : undefined"
323
324
  allow-clear
324
- class="tree-select">
325
+ class="tree-select"
326
+ @change="onTreeSelectChange">
325
327
  </a-tree-select>
326
328
  </a-form-model-item>
327
329
  </x-form-col>
@@ -360,7 +362,9 @@ export default {
360
362
  searchResult: '',
361
363
  yearShowOne: false,
362
364
  // moment
363
- moment
365
+ moment,
366
+ // 树形选择框选中值
367
+ treeSelectValue: undefined
364
368
  }
365
369
  },
366
370
  props: {
@@ -504,6 +508,20 @@ export default {
504
508
  this.setParentSelectable(item.children)
505
509
  }
506
510
  })
511
+ },
512
+ // 选中树节点
513
+ onTreeSelectChange (value, label, extra) {
514
+ if (this.attr.queryType === 'RIGHT_LIKE') {
515
+ // 获取可用于模糊查询的组织机构字符串
516
+ let node = extra.triggerNode.$parent
517
+ while (node && node.label) {
518
+ label = node.label + '.' + label
519
+ node = node.$parent
520
+ }
521
+ this.form[this.attr.model] = label
522
+ } else {
523
+ this.form[this.attr.model] = value
524
+ }
507
525
  }
508
526
  }
509
527
  }
@@ -207,7 +207,7 @@ module.exports = {
207
207
  {
208
208
  label: '右模糊[right like]',
209
209
  key: 'RIGHT_LIKE',
210
- match: ['input']
210
+ match: ['input', 'treeSelect']
211
211
  },
212
212
  {
213
213
  label: '大于[>]',