doway-coms 2.0.2 → 2.0.3

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": "doway-coms",
3
- "version": "2.0.2",
3
+ "version": "2.0.3",
4
4
  "description": "doway组件库",
5
5
  "author": "dowaysoft",
6
6
  "main": "packages/index.js",
@@ -281,6 +281,30 @@
281
281
  />
282
282
  </div>
283
283
  </template>
284
+ <template #treeSelect_edit="scope">
285
+ <div class="interceptor-class">
286
+ <BaseTreeSelect
287
+ v-model="scope.row[scope.column.property]"
288
+ :field="scope.column.property"
289
+ :formRow="formRow"
290
+ :edit="scope.column.params.controlEdit === true"
291
+ :showLabel="false"
292
+ :row="scope.row"
293
+ class="inner-cell-control"
294
+ :api="scope.column.params.api"
295
+ :columns="scope.column.params.columns"
296
+ :allowClear="scope.column.params.allowClear"
297
+ :linkedField="scope.column.params.linkedField"
298
+ :showSearch="scope.column.params.showSearch"
299
+ :linkedTitle="scope.column.params.linkedTitle"
300
+ :method="scope.column.params.method"
301
+ @selectChanged="cellValueChange(scope)"
302
+ :replaceFields="scope.column.params.replaceFields"
303
+ @preSearch="(searchInfo) => preSearch(searchInfo, scope)"
304
+ >
305
+ </BaseTreeSelect>
306
+ </div>
307
+ </template>
284
308
 
285
309
  <template #expandContent="{ row, column, $table }">
286
310
  <slot name="expandContent" :item="{ row, column, $table }"></slot>
@@ -1654,6 +1678,10 @@ export default {
1654
1678
  case controlType.pulldown:
1655
1679
  tempAutoFocus = '.inner-cell-control>input'
1656
1680
  break
1681
+ case controlType.treeSelect:
1682
+ tempAutoFocus = '.ant-select-dropdown-search-input'
1683
+ tempAutoSelect = false
1684
+ break
1657
1685
  case controlType.date:
1658
1686
  tempAutoFocus = '.ant-calendar-picker-input'
1659
1687
  break
@@ -1700,7 +1728,19 @@ export default {
1700
1728
  colParams['isMultiSelect'] = originCol.isMultiSelect
1701
1729
  colParams['contrasts'] = originCol.contrasts || []
1702
1730
  colParams['controlEdit'] = true
1703
- colParams['allowAutoClear']=originCol.allowAutoClear
1731
+ colParams['allowAutoClear'] = originCol.allowAutoClear
1732
+ }
1733
+ if (originCol.controlType === controlType.treeSelect) {
1734
+ colParams['api'] = originCol.api
1735
+ colParams['columns'] = originCol.columns
1736
+ colParams['controlEdit'] = true
1737
+ colParams['allowClear'] = originCol.allowClear
1738
+ colParams['linkedField'] = originCol.linkedField
1739
+ colParams['showSearch'] = originCol.showSearch
1740
+ colParams['linkedTitle'] = originCol.linkedTitle
1741
+ colParams['method'] = originCol.method
1742
+ colParams['replaceFields'] = originCol.replaceFields
1743
+ colParams['field'] = originCol.field
1704
1744
  }
1705
1745
  if (originCol.controlType === controlType.text) {
1706
1746
  colParams['controlEdit'] = true
@@ -1739,6 +1779,10 @@ export default {
1739
1779
  colParams['filterControlType'] = originCol.filterControlType
1740
1780
  filterTypeName = `${originCol.filterControlType}_filter`
1741
1781
  }
1782
+ if (originCol.controlType === controlType.treeSelect) {
1783
+ filterTypeName = 'text_filter'
1784
+ }
1785
+
1742
1786
  //网格筛选
1743
1787
  colInfo['filters'] = [
1744
1788
  {
@@ -13,12 +13,7 @@
13
13
  <img src="../../styles/icon/help.png" alt="" style="width: 14px" />
14
14
  </Tooltip>
15
15
  </div>
16
- <div
17
- :class="{
18
- 'd-control': showLabel === true,
19
- 'd-grid-control': showLabel === false,
20
- }"
21
- >
16
+ <div class="d-control">
22
17
  <ValidationProvider
23
18
  v-if="edit === true"
24
19
  :name="label"
@@ -29,14 +24,13 @@
29
24
  ref="treeSelectView"
30
25
  v-model="currentValue"
31
26
  :treeData="treeData"
32
- tree-data-simple-mode
33
27
  :showSearch="showSearch"
34
28
  :replaceFields="replaceFields"
35
29
  :dropdownMatchSelectWidth="dropdownMatchSelectWidth"
36
30
  :treeDefaultExpandAll="treeDefaultExpandAll"
37
31
  :treeDefaultExpandedKeys="treeDefaultExpandedKeys"
38
32
  @change="changeData"
39
- :size="size"
33
+ size="small"
40
34
  :allowClear="allowClear"
41
35
  @focus="searchData"
42
36
  @select="selectData"
@@ -47,7 +41,7 @@
47
41
  }"
48
42
  treeNodeFilterProp="title"
49
43
  :style="{
50
- width: width + 'px',
44
+ width: '100%',
51
45
  }"
52
46
  :placeholder="placeholder"
53
47
  ></TreeSelect>
@@ -294,7 +288,6 @@ export default {
294
288
  * 查询数据
295
289
  */
296
290
  searchData() {
297
- console.log(this.$refs.treeSelectView)
298
291
  let tempExp = {
299
292
  operator: 'or',
300
293
  expressions: [],
@@ -371,11 +364,13 @@ export default {
371
364
  // this.row[this.field] = node.title
372
365
  this.$set(this.row, this.linkedField, value)
373
366
  this.$set(this.row, this.field, node.title)
367
+ this.$emit('selectChanged', this.row)
374
368
  },
375
369
  changeData(value) {
376
370
  if (!value) {
377
371
  this.$set(this.row, this.linkedField, '')
378
372
  this.$set(this.row, this.field, '')
373
+ this.$emit('selectChanged', this.row)
379
374
  }
380
375
  },
381
376
  },
package/packages/index.js CHANGED
@@ -78,7 +78,8 @@ const popupInterceptor = (params) => {
78
78
  parentElement.className.indexOf('ant-calendar') > -1 ||
79
79
  parentElement.className.indexOf('ant-select-dropdown-menu-item') > -1 ||
80
80
  parentElement.className.indexOf('interceptor-class') > -1 ||
81
- parentElement.className.indexOf('ant-time-picker-panel') > -1)
81
+ parentElement.className.indexOf('ant-time-picker-panel') > -1 ||
82
+ parentElement.className.indexOf('ant-select-dropdown') > -1)
82
83
  ) {
83
84
  //定义网格弹出框不能对焦问题
84
85
  return false