cnhis-design-vue 2.1.128 → 2.1.129

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.
Files changed (123) hide show
  1. package/CHANGELOG.md +61 -15
  2. package/es/affix/index.js +8 -8
  3. package/es/age/index.js +10 -10
  4. package/es/alert/index.js +8 -8
  5. package/es/anchor/index.js +8 -8
  6. package/es/auto-complete/index.js +8 -8
  7. package/es/avatar/index.js +8 -8
  8. package/es/back-top/index.js +8 -8
  9. package/es/badge/index.js +8 -8
  10. package/es/base/index.js +8 -8
  11. package/es/big-table/index.js +1629 -338
  12. package/es/big-table/style.css +1 -1
  13. package/es/breadcrumb/index.js +8 -8
  14. package/es/button/index.js +22 -22
  15. package/es/calendar/index.js +8 -8
  16. package/es/captcha/index.js +3 -3
  17. package/es/card/index.js +8 -8
  18. package/es/card-reader-sdk/index.js +57 -23
  19. package/es/carousel/index.js +8 -8
  20. package/es/cascader/index.js +8 -8
  21. package/es/checkbox/index.js +9 -9
  22. package/es/col/index.js +8 -8
  23. package/es/collapse/index.js +8 -8
  24. package/es/color-picker/index.js +1 -1
  25. package/es/comment/index.js +8 -8
  26. package/es/config-provider/index.js +8 -8
  27. package/es/date-picker/index.js +8 -8
  28. package/es/descriptions/index.js +8 -8
  29. package/es/direct/index.js +16 -16
  30. package/es/divider/index.js +8 -8
  31. package/es/drag-layout/index.js +3 -3
  32. package/es/drawer/index.js +8 -8
  33. package/es/dropdown/index.js +8 -8
  34. package/es/editor/index.js +1 -1
  35. package/es/ellipsis/index.js +1 -1
  36. package/es/empty/index.js +8 -8
  37. package/es/fabric-chart/index.js +320 -146
  38. package/es/form/index.js +8 -8
  39. package/es/form-model/index.js +8 -8
  40. package/es/form-table/index.js +698 -697
  41. package/es/full-calendar/index.js +52 -52
  42. package/es/full-calendar/style.css +1 -1
  43. package/es/grid/index.js +0 -1
  44. package/es/index/index.js +1971 -1268
  45. package/es/index/style.css +1 -1
  46. package/es/input/index.js +9 -9
  47. package/es/input-number/index.js +8 -8
  48. package/es/layout/index.js +8 -8
  49. package/es/list/index.js +8 -8
  50. package/es/locale-provider/index.js +8 -8
  51. package/es/map/index.js +9 -9
  52. package/es/mentions/index.js +8 -8
  53. package/es/menu/index.js +8 -8
  54. package/es/message/index.js +8 -8
  55. package/es/multi-chat/index.js +76 -76
  56. package/es/multi-chat-client/index.js +70 -70
  57. package/es/multi-chat-history/index.js +4 -4
  58. package/es/multi-chat-record/index.js +14 -14
  59. package/es/multi-chat-setting/index.js +22 -22
  60. package/es/multi-chat-sip/index.js +1 -1
  61. package/es/notification/index.js +8 -8
  62. package/es/page-header/index.js +8 -8
  63. package/es/pagination/index.js +8 -8
  64. package/es/popconfirm/index.js +8 -8
  65. package/es/popover/index.js +8 -8
  66. package/es/progress/index.js +8 -8
  67. package/es/radio/index.js +9 -9
  68. package/es/rate/index.js +8 -8
  69. package/es/result/index.js +8 -8
  70. package/es/row/index.js +8 -8
  71. package/es/scale-container/index.js +386 -385
  72. package/es/scale-view/index.js +27 -27
  73. package/es/select/index.js +12 -12
  74. package/es/select-label/index.js +11 -11
  75. package/es/select-person/index.js +2 -2
  76. package/es/select-tag/index.js +4 -4
  77. package/es/shortcut-setter/index.js +10 -10
  78. package/es/skeleton/index.js +8 -8
  79. package/es/slider/index.js +8 -8
  80. package/es/slider-tree/index.js +9 -9
  81. package/es/space/index.js +8 -8
  82. package/es/spin/index.js +8 -8
  83. package/es/statistic/index.js +8 -8
  84. package/es/steps/index.js +8 -8
  85. package/es/switch/index.js +8 -8
  86. package/es/table-filter/index.js +518 -230
  87. package/es/table-filter/style.css +1 -1
  88. package/es/tabs/index.js +8 -8
  89. package/es/tag/index.js +9 -9
  90. package/es/time-picker/index.js +8 -8
  91. package/es/timeline/index.js +8 -8
  92. package/es/tooltip/index.js +8 -8
  93. package/es/transfer/index.js +8 -8
  94. package/es/tree/index.js +8 -8
  95. package/es/tree-select/index.js +8 -8
  96. package/es/upload/index.js +8 -8
  97. package/es/verification-code/index.js +2 -2
  98. package/lib/cui.common.js +2088 -1291
  99. package/lib/cui.umd.js +2088 -1291
  100. package/lib/cui.umd.min.js +45 -45
  101. package/package.json +2 -2
  102. package/packages/big-table/index.js +4 -0
  103. package/packages/big-table/src/BigTable.vue +6 -8
  104. package/packages/big-table/src/components/edit-form/edit-component/edit-search/edit-search.vue +81 -7
  105. package/packages/big-table/src/components/edit-form/edit-component/edit-search-more/edit-search-more.vue +63 -7
  106. package/packages/big-table/src/components/edit-form/edit-component/mixins/search.js +21 -0
  107. package/packages/card-reader-sdk/src/cardReaderSDK.js +12 -0
  108. package/packages/fabric-chart/src/fabric-chart/FabricLines.vue +4 -1
  109. package/packages/fabric-chart/src/fabric-chart/FabricPolylines.vue +12 -8
  110. package/packages/fabric-chart/src/fabric-chart/FabricTextGroup.vue +137 -49
  111. package/packages/fabric-chart/src/mixins/drawExtracorporealCirculation.js +2 -6
  112. package/packages/fabric-chart/src/utils/index.js +9 -1
  113. package/packages/full-calendar/src/FullCalendar.vue +16 -11
  114. package/packages/full-calendar/src/components/ListTag.vue +6 -4
  115. package/packages/grid/src/grid.js +2 -3
  116. package/packages/table-filter/src/base-search-com/BaseSearch.vue +24 -4
  117. package/packages/table-filter/src/components/render-widget/enums.js +39 -16
  118. package/packages/table-filter/src/components/render-widget/helpers/presetValToTimestamp.js +245 -31
  119. package/packages/table-filter/src/components/render-widget/index.vue +7 -4
  120. package/packages/table-filter/src/components/render-widget/widgetCfgMaps.js +38 -11
  121. package/packages/table-filter/src/mixins/mixins.js +10 -8
  122. package/packages/table-filter/src/mixins/renderWidget.js +2 -2
  123. package/packages/table-filter/src/quick-search/QuickSearch.vue +26 -4
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cnhis-design-vue",
3
- "version": "2.1.128",
3
+ "version": "2.1.129",
4
4
  "description": "前端业务UI库",
5
5
  "keyword": "cnhis-design-vue vue cnhis",
6
6
  "homepage": "http://dv.cnhis.com/",
@@ -114,4 +114,4 @@
114
114
  "commit-msg": "commitlint -E HUSKY_GIT_PARAMS"
115
115
  }
116
116
  }
117
- }
117
+ }
@@ -1,6 +1,10 @@
1
1
  // 导入组件
2
+ import Vue from 'vue';
2
3
  import BigTable from './src/BigTable.vue';
3
4
  import Fieldset from './src/Fieldset.vue';
5
+ import Ellipsis from '../ellipsis';
6
+
7
+ Vue.use(Ellipsis);
4
8
 
5
9
  // 为组件提供 install 安装方法,供按需引入
6
10
  BigTable.install = function(Vue) {
@@ -2143,13 +2143,11 @@ export default create({
2143
2143
  let forbiddenBatchSelect = !this.checkMethod(data);
2144
2144
  // 如果该行禁止批量多选,则选择/取消单行 并触发单击事件
2145
2145
  if (this.selectType == 'checkbox' && forbiddenBatchSelect) {
2146
- /* 存在问题注释的代码
2147
- 选中“禁用”行,会把之前的选中数据清空
2148
- table?.setAllCheckboxRow(false);
2149
- */
2150
- const value = this.getRowClassName({ row }) == 'single--checked' ? [] : [row];
2146
+ // 选中“禁用”行,需要清空其它选择数据, 并且再次点击不要取消选中
2147
+ table?.setAllCheckboxRow(false);
2148
+ const value = [row];
2151
2149
  this.$set(this, 'checkedRows', value);
2152
- this.pubCheckChange(value);
2150
+ this.pubCheckChange(value, { forbiddenBatchSelect });
2153
2151
  this.$emit('handlerClickRow', row, rowIndex, { source, column, trigger });
2154
2152
  return;
2155
2153
  }
@@ -2493,13 +2491,13 @@ export default create({
2493
2491
 
2494
2492
  this.setCurrentCheckedLength();
2495
2493
  },
2496
- pubCheckChange(rows = []) {
2494
+ pubCheckChange(rows = [], config = {}) {
2497
2495
  this.treeTableLength = rows.filter(item => {
2498
2496
  let isGroupRow = vexutils.has(item, GROUP_TITLE_KEY);
2499
2497
  return !isGroupRow;
2500
2498
  }).length;
2501
2499
  this.visibleTreeCheck = rows.length > 1;
2502
- this.$emit('selectionChange', rows);
2500
+ this.$emit('selectionChange', rows, config);
2503
2501
  },
2504
2502
  setCurrentPageRowChecked() {
2505
2503
  let table = this.$refs.xGrid;
@@ -3,7 +3,7 @@
3
3
  <a-select
4
4
  v-model="item.useFormValue"
5
5
  :ref="'search-' + item.val_key"
6
- :dropdownMatchSelectWidth="(item.elem_width || 6) > 11"
6
+ :dropdownMatchSelectWidth="true"
7
7
  class="formItem-select editItem-search"
8
8
  :placeholder="item.placeholder || '请输入关键字'"
9
9
  :autoFocus="false"
@@ -16,10 +16,12 @@
16
16
  @dropdownVisibleChange="handlerDropdownVisibleChange($event, item)"
17
17
  @select="handleSearchSelect($event, item, 'select')"
18
18
  @change="handleSearchSelect($event, item)"
19
- :dropdownClassName="selectIsOpen ? 'form-default-select' : 'hide-select-drop'"
19
+ :dropdownClassName="selectIsOpen ? 'form-default-select edit-table-default-select' : 'hide-select-drop edit-table-default-select'"
20
20
  :notFoundContent="fetching ? undefined : '暂无数据'"
21
21
  :dropdownStyle="{
22
- maxWidth: optionsMaxWidth
22
+ maxWidth: optionsMaxWidth,
23
+ background: 'transparent',
24
+ 'box-shadow': 'none'
23
25
  }"
24
26
  optionLabelProp="label"
25
27
  >
@@ -31,7 +33,7 @@
31
33
  :label="hanlderGetSearchLabel(item, v)"
32
34
  :disabled="k === 0 && item.wordbook.render_key && item.wordbook.render_key.length > 1"
33
35
  >
34
- <div
36
+ <!-- <div
35
37
  :class="{
36
38
  'title-line': k === 0 && item.wordbook.render_key && item.wordbook.render_key.length > 1
37
39
  }"
@@ -40,17 +42,64 @@
40
42
  >
41
43
  <span style="flex: 1;" v-for="(v1, k1) in v['showLabel'].split('≌')" :key="k1" class="select-content-item">{{ v1 }}</span>
42
44
  </div>
43
- <span v-else>{{ v[item.wordbook.value_key] }}</span>
45
+ <span v-else>{{ v[item.wordbook.value_key] }}</span> -->
44
46
  </a-select-option>
47
+ <scale-container
48
+ slot="dropdownRender"
49
+ :class="`search-menu-${item.val_key}`"
50
+ slot-scope="menu"
51
+ style="background: #fff; box-shadow: 0 2px 8px rgb(0 0 0 / 15%);"
52
+ @mousedown.native="e => e.preventDefault()"
53
+ :minW="optionsMaxWidthNew || 160"
54
+ :minH="45"
55
+ :defaultMaxH="300"
56
+ >
57
+ <a-spin
58
+ v-if="fetching"
59
+ class="loading-wrapper"
60
+ :spinning="fetching"
61
+ :tip="`${$t('1.1.7.14')}...`"
62
+ />
63
+ <div
64
+ v-else
65
+ style="display: flex; flex-direction: column; max-height: inherit; height: 100%;"
66
+ >
67
+ <SelectOptions
68
+ style="flex: 1; overflow: hidden;"
69
+ :rows="optionRows"
70
+ :freeAddItem="freeAddItem"
71
+ :fields="fieldListConfig"
72
+ :wordbook="item.wordbook"
73
+ :context="menu && menu.context"
74
+ />
75
+ <!-- <slot v-if="curOptions && curOptions.length">
76
+ <select-pages
77
+ v-if="!isnoPages"
78
+ style="flex-shrink: 0;"
79
+ :searchPageConfig="searchPageConfig"
80
+ :handleSearchChangePage="handleSearchChangePage"
81
+ />
82
+ </slot> -->
83
+ </div>
84
+ </scale-container>
45
85
  </a-select>
46
86
  </div>
47
87
  </template>
48
88
  <script>
49
89
  import itemDefault from '../mixins/item-default';
50
90
  import search from '../mixins/search';
91
+ import { Select, Spin } from 'ant-design-vue';
92
+ import SelectOptions from '@/component/select-options';
93
+ import ScaleContainer from '~/scale-container/src/ScaleContainer';
51
94
  export default {
52
95
  name: 'editSearch',
53
- components: {},
96
+ components: {
97
+ [Select.name]: Select,
98
+ [Select.Option.name]: Select.Option,
99
+ [Spin.name]: Spin,
100
+ SelectOptions,
101
+ ScaleContainer
102
+ },
54
103
  props: {
55
104
  item: Object
56
105
  },
@@ -79,4 +128,29 @@ export default {
79
128
  methods: {}
80
129
  };
81
130
  </script>
82
- <style lang="less" scoped></style>
131
+ <style lang="less" scoped>
132
+ .loading-wrapper {
133
+ height: 100%;
134
+ min-height: 100px;
135
+ display: flex;
136
+ justify-content: center;
137
+ align-items: center;
138
+ flex-direction: column;
139
+ }
140
+ </style>
141
+
142
+ <style lang="less">
143
+ .edit-table-default-select {
144
+ .title-line {
145
+ font-weight: 700;
146
+ color: #000;
147
+ font-size: 14px;
148
+ }
149
+ .select-content-item {
150
+ padding: 0 5px;
151
+ }
152
+ .ant-select-dropdown-menu-item-selected {
153
+ color: #5585f5;
154
+ }
155
+ }
156
+ </style>
@@ -4,8 +4,8 @@
4
4
  ref="form_a_select"
5
5
  :showArrow="true"
6
6
  class="formItem-select formItem-select-multiple formItem-search-more"
7
- :dropdownMatchSelectWidth="(item.elem_width || 6) > 11"
8
- :dropdownClassName="selectIsOpen ? 'form-default-select' : 'hide-select-drop'"
7
+ :dropdownMatchSelectWidth="true"
8
+ :dropdownClassName="selectIsOpen ? 'form-default-select edit-table-default-select-more' : 'hide-select-drop edit-table-default-select-more'"
9
9
  :disabled="item.is_edit == 0"
10
10
  :defaultActiveFirstOption="true"
11
11
  mode="multiple"
@@ -22,7 +22,9 @@
22
22
  @change="searchMoreOnChange($event, item)"
23
23
  :notFoundContent="fetching ? undefined : '暂无数据'"
24
24
  :dropdownStyle="{
25
- maxWidth: optionsMaxWidth
25
+ maxWidth: optionsMaxWidth,
26
+ background: 'transparent',
27
+ 'box-shadow': 'none'
26
28
  }"
27
29
  optionLabelProp="label"
28
30
  >
@@ -34,8 +36,7 @@
34
36
  :label="hanlderGetSearchLabel(item, v)"
35
37
  :disabled="k === 0 && item.wordbook.render_key && item.wordbook.render_key.length > 1"
36
38
  >
37
- <!-- {{ v["showLabel"] || v[item.wordbook.value_key] }} -->
38
- <div
39
+ <!-- <div
39
40
  :class="{
40
41
  'title-line': k === 0 && item.wordbook.render_key && item.wordbook.render_key.length > 1
41
42
  }"
@@ -44,16 +45,56 @@
44
45
  >
45
46
  <span style="flex: 1;" v-for="(v1, k1) in v['showLabel'].split('≌')" :key="k1">{{ v1 }}</span>
46
47
  </div>
47
- <span v-else>{{ v[item.wordbook.value_key] }}</span>
48
+ <span v-else>{{ v[item.wordbook.value_key] }}</span> -->
48
49
  </a-select-option>
50
+ <scale-container
51
+ slot="dropdownRender"
52
+ :class="`search-menu-${item.val_key}`"
53
+ slot-scope="menu"
54
+ style="background: #fff; box-shadow: 0 2px 8px rgb(0 0 0 / 15%);"
55
+ @mousedown.native="e => e.preventDefault()"
56
+ :minW="optionsMaxWidthNew ||160"
57
+ :minH="45"
58
+ :defaultMaxH="300"
59
+ >
60
+ <a-spin
61
+ v-if="fetching"
62
+ class="loading-wrapper"
63
+ :spinning="fetching"
64
+ :tip="`${$t('1.1.7.14')}...`"
65
+ />
66
+ <div
67
+ v-else
68
+ style="display: flex; flex-direction: column; max-height: inherit; height: 100%;"
69
+ >
70
+ <SelectOptions
71
+ style="flex: 1; overflow: hidden;"
72
+ :rows="optionRows"
73
+ :freeAddItem="freeAddItem"
74
+ :fields="fieldListConfig"
75
+ :wordbook="item.wordbook"
76
+ :context="menu && menu.context"
77
+ separate="-"
78
+ />
79
+ </div>
80
+ </scale-container>
49
81
  </a-select>
50
82
  </template>
51
83
  <script>
52
84
  import itemDefault from '../mixins/item-default';
53
85
  import search from '../mixins/search';
86
+ import { Select, Spin } from 'ant-design-vue';
87
+ import SelectOptions from '@/component/select-options';
88
+ import ScaleContainer from '~/scale-container/src/ScaleContainer';
54
89
  export default {
55
90
  name: 'editSearchMore',
56
- components: {},
91
+ components: {
92
+ [Select.name]: Select,
93
+ [Select.Option.name]: Select.Option,
94
+ [Spin.name]: Spin,
95
+ SelectOptions,
96
+ ScaleContainer
97
+ },
57
98
  props: {
58
99
  item: Object
59
100
  },
@@ -92,4 +133,19 @@ export default {
92
133
  top: 50%;
93
134
  }
94
135
  }
136
+ .loading-wrapper {
137
+ height: 100%;
138
+ min-height: 100px;
139
+ display: flex;
140
+ justify-content: center;
141
+ align-items: center;
142
+ flex-direction: column;
143
+ }
144
+ </style>
145
+ <style lang="less">
146
+ .edit-table-default-select-more {
147
+ .ant-select-dropdown-menu-item-selected {
148
+ color: #5585f5;
149
+ }
150
+ }
95
151
  </style>
@@ -31,8 +31,10 @@ export default {
31
31
  page: 1, // 当前页
32
32
  total: 1 // 总页数
33
33
  },
34
+ fieldListConfig: [],
34
35
 
35
36
  optionsMaxWidth: '100%',
37
+ optionsMaxWidthNew: 160,
36
38
 
37
39
  cacheReqOptionsParams: '',
38
40
 
@@ -56,6 +58,23 @@ export default {
56
58
  formType() {
57
59
  const { formType } = this.mainForm || {};
58
60
  return formType || {};
61
+ },
62
+ selectIsOpen() {
63
+ const { html_type, show_type } = this.item;
64
+ if (['SEARCH_MORE', 'SEARCH'].includes(html_type)) {
65
+ return !['pop', 'dialog'].includes(show_type);
66
+ }
67
+ return true;
68
+ },
69
+ isnoPages() {
70
+ const { searchPageConfig } = this;
71
+ return searchPageConfig.page <= 1 && !searchPageConfig.hasNextPage;
72
+ },
73
+ freeAddItem() {
74
+ return this.curOptions.find(v => v.is_free_entry_input__add);
75
+ },
76
+ optionRows() {
77
+ return this.curOptions.filter((v, i) => !(i === 0 && this.item.wordbook.render_key && this.item.wordbook.render_key.length > 1) && !v.is_free_entry_input__add);
59
78
  }
60
79
  },
61
80
  mounted() {
@@ -436,6 +455,7 @@ export default {
436
455
  if (!data) return [];
437
456
  this.searchAddObj[`${itemData.val_key}_${itemData.name}`] = true;
438
457
  let { rows, fieldList, page, total } = data.map;
458
+ this.fieldListConfig = fieldList;
439
459
  this.searchPageConfig = Object.assign(this.searchPageConfig, {
440
460
  page,
441
461
  total,
@@ -921,6 +941,7 @@ export default {
921
941
 
922
942
  res = parseInt(res, 10);
923
943
  this.optionsMaxWidth = `${res}px`;
944
+ this.optionsMaxWidthNew = res || 160;
924
945
  });
925
946
  },
926
947
 
@@ -101,6 +101,18 @@ export default class CardReaderSDK {
101
101
  return this.readHealthCardDialog.show(options);
102
102
  }
103
103
 
104
+ async getCardType() {
105
+ await this.checkLoading();
106
+
107
+ const requestParams = this.createParams(TRANS_CMD.CARD_TYPE_READ, {
108
+ transsystem: '10',
109
+ transtype: 'IDCARD',
110
+ interfaceid: '0'
111
+ });
112
+
113
+ return this.checkResCodeAndLoading(this.insurance.getInsuranceInfoPromise(requestParams));
114
+ }
115
+
104
116
  async generalRequest(params = {}) {
105
117
  await this.checkLoading();
106
118
  const requestParams = this.createParams(TRANS_CMD.NS_GETPERSONALINFO, {}, params);
@@ -265,7 +265,10 @@ export default {
265
265
  const [preItem0] = lineList[j + 1];
266
266
  if (preItem0) {
267
267
  const preStartMinute = new Date(preItem0).getTime();
268
- if (preStartMinute > minMinute && preStartMinute <= maxMinute) rightLimit.x2 = this.computedX(preItem0);
268
+ if (preStartMinute > minMinute && preStartMinute <= maxMinute) {
269
+ rightLimit.x2 = this.computedX(preItem0);
270
+ if (!x2) leftLimit.x2 = rightLimit.x2;
271
+ }
269
272
  }
270
273
  }
271
274
 
@@ -14,6 +14,7 @@ import MouseRightClick from '../components/MouseRightClick';
14
14
  import DropPopup from '../components/DropPopup';
15
15
  import defaultVaule from '../const/defaultVaule';
16
16
  import Bus from '../utils/bus';
17
+ import { nearlyEqual } from '../utils';
17
18
 
18
19
  /**
19
20
  * @description: 递归遍历节点,设置颜色属性
@@ -609,7 +610,7 @@ export default {
609
610
  * @param {polylineIndex} 当前折线 index
610
611
  */
611
612
  drawPolyline(polyline, polylineIndex, polylineType, polylineTypeId) {
612
- const { originY, endY } = this.propItems;
613
+ const { originY, endY, xCellWidth, table } = this.propItems;
613
614
  const { list = [], critical = {}, diffValue = {} } = polyline;
614
615
 
615
616
  const pointList = [];
@@ -648,7 +649,10 @@ export default {
648
649
  let line;
649
650
  let point;
650
651
  let previousLine;
651
- line = points && nextPoint && !linePoints.data?.breakpoint ? this.drawLine([...points, ...nextPoint], { polylineIndex, polylineTypeId, lineIndex: index, ...lineAttr }) : null;
652
+ line =
653
+ !points || !nextPoint || linePoints.data?.breakpoint || (table.breakpoint && nextPoint[0] - points[0] > xCellWidth)
654
+ ? null
655
+ : this.drawLine([...points, ...nextPoint], { polylineIndex, polylineTypeId, lineIndex: index, ...lineAttr });
652
656
  previousLine = lineList[index - 1];
653
657
  const pointOthers = { polylineTypeId, polylineIndex, pointIndex: index, ...pointAttr, lineAttr };
654
658
  if (points) {
@@ -876,8 +880,8 @@ export default {
876
880
  for (let i = 0, len = this.addPointList.length; i < len; i++) {
877
881
  const currentPoint = this.addPointList[i];
878
882
  const prevPoint = this.addPointList[i - 1] || { left: point.prePoint?.left ?? originLeft, top: point.prePoint?.top ?? originTop };
879
- const currentPointObj = this.addPointObjList.find(obj => obj.left === currentPoint.left);
880
- if (currentPointObj?.line1?.x1 !== prevPoint.left) {
883
+ const currentPointObj = this.addPointObjList.find(obj => nearlyEqual(obj.left, currentPoint.left));
884
+ if (!nearlyEqual(currentPointObj?.line1?.x1, prevPoint.left)) {
881
885
  currentPointObj?.line1?.set({
882
886
  x1: prevPoint.left,
883
887
  y1: prevPoint.top,
@@ -897,7 +901,7 @@ export default {
897
901
  if (k > 0) {
898
902
  const curLeft = originLeft + this.spaceWidth * k;
899
903
  // 判断this.addPointList中的left是否包含curLeft,不包含就说明是漏了
900
- const hasPoint = this.addPointList.some(p => Math.abs(p.left - curLeft) <= 0.001);
904
+ const hasPoint = this.addPointList.some(p => nearlyEqual(p.left, curLeft));
901
905
  // const hasPoint = this.addPointList.some(v => v.left == curLeft);
902
906
  if (!hasPoint) {
903
907
  let index;
@@ -940,7 +944,7 @@ export default {
940
944
  const currentLeft = left;
941
945
 
942
946
  const startLength = this.addPointList.length;
943
- const n = 6; // 拖动范围,在需要增加节点的刻度左右吸入的范围值
947
+ const n = Math.min(this.spaceWidth / 2, 6); // 拖动范围,在需要增加节点的刻度左右吸入的范围值
944
948
  const residue = (left - originLeft) % this.spaceWidth;
945
949
 
946
950
  const condition = residue > 0 && (residue > this.spaceWidth - n || residue < n);
@@ -961,7 +965,7 @@ export default {
961
965
  // point.line1 && this.removePolyline(point.line1.id);
962
966
  setPointLineColor(point, 'transparent', conditionHasLine2);
963
967
  this.addPointList.length == 0 && this.clonePoint(point, [point.line1 ? point.line1.x1 : originLeft, point.line1 ? point.line1.y1 : originTop, originLeft, originTop]);
964
- if (this.addPointList.every(v => v.left !== left)) {
968
+ if (this.addPointList.every(v => !nearlyEqual(v.left, left))) {
965
969
  // const points1 = i === 1 ? [originLeft, originTop] : point.prePoints;
966
970
  const points1 = this.addPointList.length == 0 ? [originLeft, originTop] : point.prePoints;
967
971
  if (points1) {
@@ -973,7 +977,7 @@ export default {
973
977
  data.left = left;
974
978
  data.top = top;
975
979
  // 避免重复添加
976
- if (this.addPointObjList.every(o => o.left !== left)) {
980
+ if (this.addPointObjList.every(o => !nearlyEqual(o.left, left))) {
977
981
  this.addPointList.push(data);
978
982
  this.clonePoint(point, [...points1, left, top]);
979
983
  }