cnhis-design-vue 2.1.65 → 2.1.68

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 (107) hide show
  1. package/CHANGELOG.md +53 -20
  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 +244 -164
  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/carousel/index.js +8 -8
  19. package/es/cascader/index.js +8 -8
  20. package/es/checkbox/index.js +9 -9
  21. package/es/col/index.js +8 -8
  22. package/es/collapse/index.js +8 -8
  23. package/es/color-picker/index.js +1 -1
  24. package/es/comment/index.js +8 -8
  25. package/es/config-provider/index.js +8 -8
  26. package/es/date-picker/index.js +8 -8
  27. package/es/descriptions/index.js +8 -8
  28. package/es/divider/index.js +8 -8
  29. package/es/drag-layout/index.js +3 -3
  30. package/es/drawer/index.js +8 -8
  31. package/es/dropdown/index.js +8 -8
  32. package/es/editor/index.js +1 -1
  33. package/es/ellipsis/index.js +1 -1
  34. package/es/empty/index.js +8 -8
  35. package/es/fabric-chart/index.js +368 -353
  36. package/es/form/index.js +8 -8
  37. package/es/form-model/index.js +8 -8
  38. package/es/form-table/index.js +66 -66
  39. package/es/index/index.js +1022 -931
  40. package/es/index/style.css +1 -1
  41. package/es/input/index.js +9 -9
  42. package/es/input-number/index.js +8 -8
  43. package/es/layout/index.js +8 -8
  44. package/es/list/index.js +8 -8
  45. package/es/locale-provider/index.js +8 -8
  46. package/es/map/index.js +9 -9
  47. package/es/mentions/index.js +8 -8
  48. package/es/menu/index.js +8 -8
  49. package/es/message/index.js +8 -8
  50. package/es/multi-chat/index.js +76 -76
  51. package/es/multi-chat-client/index.js +70 -70
  52. package/es/multi-chat-history/index.js +4 -4
  53. package/es/multi-chat-record/index.js +14 -14
  54. package/es/multi-chat-setting/index.js +22 -22
  55. package/es/multi-chat-sip/index.js +1 -1
  56. package/es/notification/index.js +8 -8
  57. package/es/page-header/index.js +8 -8
  58. package/es/pagination/index.js +8 -8
  59. package/es/popconfirm/index.js +8 -8
  60. package/es/popover/index.js +8 -8
  61. package/es/progress/index.js +8 -8
  62. package/es/radio/index.js +9 -9
  63. package/es/rate/index.js +8 -8
  64. package/es/result/index.js +8 -8
  65. package/es/row/index.js +8 -8
  66. package/es/scale-container/index.js +1 -1
  67. package/es/scale-view/index.js +56 -54
  68. package/es/scale-view/style.css +1 -1
  69. package/es/select/index.js +12 -12
  70. package/es/select-label/index.js +11 -11
  71. package/es/select-person/index.js +2 -2
  72. package/es/shortcut-setter/index.js +10 -10
  73. package/es/skeleton/index.js +8 -8
  74. package/es/slider/index.js +8 -8
  75. package/es/space/index.js +8 -8
  76. package/es/spin/index.js +8 -8
  77. package/es/statistic/index.js +8 -8
  78. package/es/steps/index.js +8 -8
  79. package/es/switch/index.js +8 -8
  80. package/es/table-filter/index.js +113 -119
  81. package/es/table-filter/style.css +1 -1
  82. package/es/tabs/index.js +8 -8
  83. package/es/tag/index.js +9 -9
  84. package/es/time-picker/index.js +8 -8
  85. package/es/timeline/index.js +8 -8
  86. package/es/tooltip/index.js +8 -8
  87. package/es/transfer/index.js +8 -8
  88. package/es/tree/index.js +8 -8
  89. package/es/tree-select/index.js +8 -8
  90. package/es/upload/index.js +8 -8
  91. package/es/verification-code/index.js +2 -2
  92. package/lib/cui.common.js +1514 -18633
  93. package/lib/cui.umd.js +1514 -18633
  94. package/lib/cui.umd.min.js +147 -155
  95. package/package.json +1 -1
  96. package/packages/big-table/src/BigTable.vue +23 -4
  97. package/packages/big-table/src/assets/style/table-base.less +2 -1
  98. package/packages/big-table/src/components/AutoLayoutButton.vue +59 -31
  99. package/packages/big-table/src/utils/eventBroadcast.js +24 -0
  100. package/packages/fabric-chart/src/fabric-chart/FabricLines.vue +128 -110
  101. package/packages/fabric-chart/src/fabric-chart/FabricPolylines.vue +27 -20
  102. package/packages/fabric-chart/src/fabric-chart/FabricTextGroup.vue +9 -8
  103. package/packages/fabric-chart/src/mixins/eventCommon.js +4 -4
  104. package/packages/fabric-chart/src/mixins/fabricCommon.js +8 -22
  105. package/packages/scale-view/formitem/r-choice.vue +87 -67
  106. package/packages/table-filter/src/base-search-com/BaseSearch.vue +6 -6
  107. package/packages/table-filter/src/quick-search/QuickSearch.vue +4 -4
@@ -295,7 +295,7 @@ var es_promise_finally = __webpack_require__("a79d");
295
295
  // EXTERNAL MODULE: external "core-js/modules/es.function.name.js"
296
296
  var es_function_name_js_ = __webpack_require__("db0a");
297
297
 
298
- // CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"4bfccfd0-vue-loader-template"}!./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./packages/fabric-chart/src/FabricChart.vue?vue&type=template&id=3a1ac827&scoped=true&
298
+ // CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"a62a2cd6-vue-loader-template"}!./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./packages/fabric-chart/src/FabricChart.vue?vue&type=template&id=3a1ac827&scoped=true&
299
299
  var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:"c-fabric-chart",style:({ width: _vm.canvasWidth })},[(_vm.rendercanvas)?_c('fabric-canvas',_vm._b({ref:"canvasEle",attrs:{"templateData":_vm.templateData}},'fabric-canvas',_vm.$attrs,false),[(_vm.hasXScalevalue)?_c('fabric-text-group',_vm._g({attrs:{"templateData":_vm.templateData}},_vm.$listeners)):_vm._e(),_c('fabric-grid'),(_vm.hasTable)?_c('fabric-scale-value',{attrs:{"templateData":_vm.templateData}}):_vm._e(),(_vm.hasTopTable)?_c('fabric-lines',_vm._g({ref:"lines",attrs:{"linesObj":_vm.templateData.top}},_vm.$listeners)):_vm._e(),(_vm.hasTable)?_c('fabric-polylines',_vm._g({ref:"polylines",attrs:{"polyline":_vm.polylines,"other":_vm.templateData.left.other || {}},on:{"pointOperation":_vm.pointOperation}},_vm.$listeners)):_vm._e()],1):_vm._e()],1)}
300
300
  var staticRenderFns = []
301
301
 
@@ -308,7 +308,7 @@ var objectSpread2 = __webpack_require__("5530");
308
308
  // EXTERNAL MODULE: ./src/core/create.js
309
309
  var create = __webpack_require__("8aef");
310
310
 
311
- // CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"4bfccfd0-vue-loader-template"}!./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./packages/fabric-chart/src/fabric-chart/FabricCanvas.vue?vue&type=template&id=98d2aa36&
311
+ // CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"a62a2cd6-vue-loader-template"}!./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./packages/fabric-chart/src/fabric-chart/FabricCanvas.vue?vue&type=template&id=98d2aa36&
312
312
  var FabricCanvasvue_type_template_id_98d2aa36_render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',[_c('canvas',{attrs:{"id":_vm.id}}),_vm._t("default")],2)}
313
313
  var FabricCanvasvue_type_template_id_98d2aa36_staticRenderFns = []
314
314
 
@@ -897,12 +897,12 @@ var component = Object(componentNormalizer["a" /* default */])(
897
897
  )
898
898
 
899
899
  /* harmony default export */ var FabricCanvas = (component.exports);
900
- // CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"4bfccfd0-vue-loader-template"}!./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./packages/fabric-chart/src/fabric-chart/FabricPolylines.vue?vue&type=template&id=47f12750&
901
- var FabricPolylinesvue_type_template_id_47f12750_render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:"poly-line"},[_c('MouseRightClick',{directives:[{name:"show",rawName:"v-show",value:(_vm.isRightVisible),expression:"isRightVisible"}],attrs:{"getContainer":_vm.getContainer,"nodeList":_vm.rightClickNode,"rightPos":_vm.rightPos},on:{"nodeClick":_vm.handleRightClick,"closeRight":function($event){_vm.isRightVisible = false}}}),_c('DropPopup',{directives:[{name:"show",rawName:"v-show",value:(_vm.isDropVisible),expression:"isDropVisible"}],attrs:{"val":_vm.dropVal,"dropPos":_vm.dropPos}})],1)}
902
- var FabricPolylinesvue_type_template_id_47f12750_staticRenderFns = []
900
+ // CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"a62a2cd6-vue-loader-template"}!./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./packages/fabric-chart/src/fabric-chart/FabricPolylines.vue?vue&type=template&id=4cbf471a&
901
+ var FabricPolylinesvue_type_template_id_4cbf471a_render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:"poly-line"},[_c('MouseRightClick',{directives:[{name:"show",rawName:"v-show",value:(_vm.isRightVisible),expression:"isRightVisible"}],attrs:{"getContainer":_vm.getContainer,"nodeList":_vm.rightClickNode,"rightPos":_vm.rightPos},on:{"nodeClick":_vm.handleRightClick,"closeRight":function($event){_vm.isRightVisible = false}}}),_c('DropPopup',{directives:[{name:"show",rawName:"v-show",value:(_vm.isDropVisible),expression:"isDropVisible"}],attrs:{"val":_vm.dropVal,"dropPos":_vm.dropPos}})],1)}
902
+ var FabricPolylinesvue_type_template_id_4cbf471a_staticRenderFns = []
903
903
 
904
904
 
905
- // CONCATENATED MODULE: ./packages/fabric-chart/src/fabric-chart/FabricPolylines.vue?vue&type=template&id=47f12750&
905
+ // CONCATENATED MODULE: ./packages/fabric-chart/src/fabric-chart/FabricPolylines.vue?vue&type=template&id=4cbf471a&
906
906
 
907
907
  // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js
908
908
  var asyncToGenerator = __webpack_require__("1da1");
@@ -994,18 +994,6 @@ var es_object_freeze_js_ = __webpack_require__("030b");
994
994
  }
995
995
  },
996
996
  methods: {
997
- // 根据x轴坐标获取对应的时间点
998
- // getXValue(left) {
999
- // const { xScaleList, xScaleCell, originX } = this.propItems;
1000
- // const minScale = Math.min(...xScaleList);
1001
- // const time = minScale + (left - originX) / xScaleCell;
1002
- // let d = new Date(time);
1003
- // const month = `00${d.getMonth() + 1}`.slice(-2);
1004
- // const day = `00${d.getDate()}`.slice(-2);
1005
- // const hours = `00${d.getHours()}`.slice(-2);
1006
- // const minute = `00${d.getMinutes()}`.slice(-2);
1007
- // return `${d.getFullYear()}-${month}-${day} ${hours}:${minute}`;
1008
- // },
1009
997
  getXValue: function getXValue(left) {
1010
998
  var _this$propItems = this.propItems,
1011
999
  xScaleCellList = _this$propItems.xScaleCellList,
@@ -1059,17 +1047,22 @@ var es_object_freeze_js_ = __webpack_require__("030b");
1059
1047
  !~index && (index = xScaleCellList.length);
1060
1048
  var obj = xScaleCellList[index - 1];
1061
1049
  return obj.x + (time - obj.time) / obj.xScaleTime;
1062
- } // // 根据时间戳计算x轴坐标
1063
- // cumputedX(value) {
1064
- // if (!value) {
1065
- // return '';
1066
- // }
1067
- // const { xScaleList, xScaleCell, originX } = this.propItems;
1068
- // const time = new Date(value).getTime();
1069
- // const minScale = Math.min(...xScaleList);
1070
- // return originX + (time - minScale) * xScaleCell;
1071
- // },
1072
-
1050
+ },
1051
+ isGridLimit: function isGridLimit(x, y) {
1052
+ var _this$propItems3 = this.propItems,
1053
+ originX = _this$propItems3.originX,
1054
+ originY = _this$propItems3.originY,
1055
+ endX = _this$propItems3.endX,
1056
+ endY = _this$propItems3.endY;
1057
+ return x >= originX && x <= endX && y >= originY && y <= endY;
1058
+ },
1059
+ isTopTreeAndGridLimit: function isTopTreeAndGridLimit(x, y) {
1060
+ var _this$propItems4 = this.propItems,
1061
+ endX = _this$propItems4.endX,
1062
+ endYTop = _this$propItems4.endYTop,
1063
+ originYTop = _this$propItems4.originYTop;
1064
+ return x >= 0 && x <= endX && y >= originYTop && y <= endYTop;
1065
+ }
1073
1066
  }
1074
1067
  });
1075
1068
  // EXTERNAL MODULE: external "core-js/modules/es.number.is-finite.js"
@@ -1444,7 +1437,8 @@ var type_isObject = function isObject(obj) {
1444
1437
  y: 0
1445
1438
  },
1446
1439
  dropTimer: null,
1447
- isRightVisible: false
1440
+ isRightVisible: false,
1441
+ isAddEventListenerContextmenu: false
1448
1442
  };
1449
1443
  },
1450
1444
  watch: {
@@ -1536,18 +1530,12 @@ var type_isObject = function isObject(obj) {
1536
1530
  var x = event.offsetX;
1537
1531
  var y = event.offsetY;
1538
1532
 
1539
- var _this$$propItems = this.$propItems(),
1540
- originX = _this$$propItems.originX,
1541
- originY = _this$$propItems.originY,
1542
- endX = _this$$propItems.endX,
1543
- endY = _this$$propItems.endY;
1544
-
1545
- if (!(x < originX || x > endX || y < originY || y > endY)) {
1533
+ if (this.isGridLimit(x, y)) {
1546
1534
  this._active = {
1547
1535
  left: x,
1548
1536
  top: y
1549
1537
  };
1550
- this.openRightModal(this.activeEvent);
1538
+ this.openRightModal();
1551
1539
  }
1552
1540
 
1553
1541
  return false;
@@ -1574,7 +1562,7 @@ var type_isObject = function isObject(obj) {
1574
1562
  }
1575
1563
  }
1576
1564
  });
1577
- // CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"4bfccfd0-vue-loader-template"}!./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./packages/fabric-chart/src/components/MouseRightClick.vue?vue&type=template&id=25d4407a&scoped=true&
1565
+ // CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"a62a2cd6-vue-loader-template"}!./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./packages/fabric-chart/src/components/MouseRightClick.vue?vue&type=template&id=25d4407a&scoped=true&
1578
1566
  var MouseRightClickvue_type_template_id_25d4407a_scoped_true_render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:"c-mouse-right-menu-popup c-animation-in",style:(_vm.dialogStyle)},[_c('div',{staticClass:"c-mouse-right-menu"},_vm._l((_vm.nodeList),function(item,index){return _c('div',{key:index,staticClass:"c-mouse-menu-item",on:{"click":function($event){return _vm.handleNodeClick(item)}}},[_c('span',[_vm._v(_vm._s(item.name))])])}),0)])}
1579
1567
  var MouseRightClickvue_type_template_id_25d4407a_scoped_true_staticRenderFns = []
1580
1568
 
@@ -1682,7 +1670,7 @@ var MouseRightClick_component = Object(componentNormalizer["a" /* default */])(
1682
1670
  )
1683
1671
 
1684
1672
  /* harmony default export */ var MouseRightClick = (MouseRightClick_component.exports);
1685
- // CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"4bfccfd0-vue-loader-template"}!./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./packages/fabric-chart/src/components/DropPopup.vue?vue&type=template&id=c4db0ace&scoped=true&
1673
+ // CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"a62a2cd6-vue-loader-template"}!./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./packages/fabric-chart/src/components/DropPopup.vue?vue&type=template&id=c4db0ace&scoped=true&
1686
1674
  var DropPopupvue_type_template_id_c4db0ace_scoped_true_render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:"c-drop-popup",style:(_vm.dialogStyle)},[_c('div',{staticClass:"c-drop-popup-list"},[_c('span',[_vm._v(_vm._s(_vm.val.title))]),_vm._l((_vm.val.list),function(item){return _c('span',{key:item.id},[_vm._v(" "+_vm._s(((item.name) + ": " + (item.value)))+" ")])})],2)])}
1687
1675
  var DropPopupvue_type_template_id_c4db0ace_scoped_true_staticRenderFns = []
1688
1676
 
@@ -1991,17 +1979,11 @@ var rightClickNodeConnect = [{
1991
1979
  x = _event$pointer.x,
1992
1980
  y = _event$pointer.y;
1993
1981
 
1994
- var _this4$$propItems = _this4.$propItems(),
1995
- originX = _this4$$propItems.originX,
1996
- originY = _this4$$propItems.originY,
1997
- endX = _this4$$propItems.endX,
1998
- endY = _this4$$propItems.endY;
1999
-
2000
- if (!(x < originX || x > endX || y < originY || y > endY)) {
1982
+ if (_this4.isGridLimit(x, y)) {
2001
1983
  _this4.activeEvent = event;
2002
- document.querySelector('.upper-canvas').addEventListener('contextmenu', _this4.addEventListenerContextmenu, true);
2003
- } // this.willUpdateLine = line;
2004
-
1984
+ !_this4.isAddEventListenerContextmenu && document.querySelector('.upper-canvas').addEventListener('contextmenu', _this4.addEventListenerContextmenu, true);
1985
+ _this4.isAddEventListenerContextmenu = true;
1986
+ }
2005
1987
  } // 左键松开鼠标-批量删除
2006
1988
 
2007
1989
 
@@ -2462,7 +2444,7 @@ var rightClickNodeConnect = [{
2462
2444
  };
2463
2445
 
2464
2446
  var isDraw = function isDraw(isMaxOrMin, maxOrMin) {
2465
- return isMaxOrMin && (!(maxOrMin !== null && maxOrMin !== void 0 && maxOrMin.flickerable) || attr !== 'critical');
2447
+ return isMaxOrMin && !(maxOrMin !== null && maxOrMin !== void 0 && maxOrMin.flickerable);
2466
2448
  };
2467
2449
 
2468
2450
  if (isDraw(isMax, max)) {
@@ -2503,7 +2485,9 @@ var rightClickNodeConnect = [{
2503
2485
  _polyline$list = polyline.list,
2504
2486
  list = _polyline$list === void 0 ? [] : _polyline$list,
2505
2487
  _polyline$critical = polyline.critical,
2506
- critical = _polyline$critical === void 0 ? {} : _polyline$critical;
2488
+ critical = _polyline$critical === void 0 ? {} : _polyline$critical,
2489
+ _polyline$diffValue = polyline.diffValue,
2490
+ diffValue = _polyline$diffValue === void 0 ? {} : _polyline$diffValue;
2507
2491
  this._iconClassName = polyline.type === 'img' && pointAttr.iconClassName ? pointAttr.iconClassName : '';
2508
2492
  var pointList = [];
2509
2493
  var lineList = [];
@@ -2620,29 +2604,48 @@ var rightClickNodeConnect = [{
2620
2604
  (_this11$canvas = _this11.canvas).add.apply(_this11$canvas, Object(toConsumableArray["a" /* default */])(lineList).concat(Object(toConsumableArray["a" /* default */])(res))); // 缓存需要闪烁的节点
2621
2605
 
2622
2606
 
2623
- var max = critical.max,
2624
- min = critical.min;
2607
+ setFlickerablePoints.call(_this11, critical);
2608
+ setFlickerablePoints.call(_this11, diffValue);
2625
2609
 
2626
- if (max !== null && max !== void 0 && max.flickerable || min !== null && min !== void 0 && min.flickerable) {
2627
- var maxVal = max === null || max === void 0 ? void 0 : max.value;
2628
- var minVal = min === null || min === void 0 ? void 0 : min.value;
2610
+ function setFlickerablePoints(diffObj) {
2611
+ var _this12 = this;
2629
2612
 
2630
- if (maxVal && max !== null && max !== void 0 && max.flickerable) {
2631
- var _this11$flickerablePo;
2613
+ var max = diffObj.max,
2614
+ min = diffObj.min;
2632
2615
 
2633
- (_this11$flickerablePo = _this11.flickerablePoints).push.apply(_this11$flickerablePo, Object(toConsumableArray["a" /* default */])(res.filter(function (point) {
2634
- return +point.__value >= +maxVal;
2635
- })));
2636
- }
2616
+ if (max !== null && max !== void 0 && max.flickerable || min !== null && min !== void 0 && min.flickerable) {
2617
+ var maxVal = max === null || max === void 0 ? void 0 : max.value;
2618
+ var minVal = min === null || min === void 0 ? void 0 : min.value;
2637
2619
 
2638
- if (minVal && min !== null && min !== void 0 && min.flickerable) {
2639
- var _this11$flickerablePo2;
2620
+ if (maxVal && max !== null && max !== void 0 && max.flickerable) {
2621
+ var _this$flickerablePoin;
2640
2622
 
2641
- (_this11$flickerablePo2 = _this11.flickerablePoints).push.apply(_this11$flickerablePo2, Object(toConsumableArray["a" /* default */])(res.filter(function (point) {
2642
- return +point.__value <= +minVal;
2643
- })));
2623
+ (_this$flickerablePoin = this.flickerablePoints).push.apply(_this$flickerablePoin, Object(toConsumableArray["a" /* default */])(res.filter(function (point) {
2624
+ return +point.__value >= +maxVal;
2625
+ }).filter(function (point) {
2626
+ return !_this12.flickerablePoints.some(function (_point) {
2627
+ return isSamePoint(point, _point);
2628
+ });
2629
+ })));
2630
+ }
2631
+
2632
+ if (minVal && min !== null && min !== void 0 && min.flickerable) {
2633
+ var _this$flickerablePoin2;
2634
+
2635
+ (_this$flickerablePoin2 = this.flickerablePoints).push.apply(_this$flickerablePoin2, Object(toConsumableArray["a" /* default */])(res.filter(function (point) {
2636
+ return +point.__value <= +minVal;
2637
+ }).filter(function (point) {
2638
+ return !_this12.flickerablePoints.some(function (_point) {
2639
+ return isSamePoint(point, _point);
2640
+ });
2641
+ })));
2642
+ }
2644
2643
  }
2645
2644
  }
2645
+
2646
+ function isSamePoint(point, _point) {
2647
+ return point.polylineTypeId == _point.polylineTypeId && point.polylineIndex === _point.polylineIndex && point.pointIndex === _point.pointIndex;
2648
+ }
2646
2649
  });
2647
2650
  var params = {
2648
2651
  polyline: polyline,
@@ -2677,7 +2680,7 @@ var rightClickNodeConnect = [{
2677
2680
  * @param {others} 参数 polylineIndex | pointIndex | ...polyline.pointAttr
2678
2681
  */
2679
2682
  drawPoint: function drawPoint(left, top, line1, line2, type, others, isInit) {
2680
- var _this12 = this;
2683
+ var _this13 = this;
2681
2684
 
2682
2685
  return Object(asyncToGenerator["a" /* default */])( /*#__PURE__*/regeneratorRuntime.mark(function _callee2() {
2683
2686
  var pointId, ele, point;
@@ -2686,7 +2689,7 @@ var rightClickNodeConnect = [{
2686
2689
  switch (_context2.prev = _context2.next) {
2687
2690
  case 0:
2688
2691
  pointId = "".concat(others.polylineTypeId, "_").concat(others.polylineIndex, "_").concat(others.pointIndex, "_polylinePoint_").concat(new Date().getTime());
2689
- _context2.t0 = _this12._iconClassName;
2692
+ _context2.t0 = _this13._iconClassName;
2690
2693
 
2691
2694
  if (!_context2.t0) {
2692
2695
  _context2.next = 6;
@@ -2694,7 +2697,7 @@ var rightClickNodeConnect = [{
2694
2697
  }
2695
2698
 
2696
2699
  _context2.next = 5;
2697
- return _this12.createImage(_this12._iconClassName, others);
2700
+ return _this13.createImage(_this13._iconClassName, others);
2698
2701
 
2699
2702
  case 5:
2700
2703
  _context2.t0 = _context2.sent;
@@ -2702,12 +2705,12 @@ var rightClickNodeConnect = [{
2702
2705
  case 6:
2703
2706
  ele = _context2.t0;
2704
2707
  _context2.next = 9;
2705
- return _this12.createPoint(type, Object(objectSpread2["a" /* default */])(Object(objectSpread2["a" /* default */])(Object(objectSpread2["a" /* default */])({
2708
+ return _this13.createPoint(type, Object(objectSpread2["a" /* default */])(Object(objectSpread2["a" /* default */])(Object(objectSpread2["a" /* default */])({
2706
2709
  id: pointId,
2707
2710
  left: left,
2708
2711
  top: top,
2709
2712
  ele: ele || ''
2710
- }, defaultVaule.pointStyle), others), !_this12.eventStyle.evented ? {
2713
+ }, defaultVaule.pointStyle), others), !_this13.eventStyle.evented ? {
2711
2714
  lockMovementX: true,
2712
2715
  lockMovementY: true
2713
2716
  } : {}));
@@ -2718,33 +2721,33 @@ var rightClickNodeConnect = [{
2718
2721
  line1 && (point.line1 = line1);
2719
2722
  line2 && (point.line2 = line2);
2720
2723
  point.on('mouseover', function () {
2721
- _this12.showDrapPopup(point);
2724
+ _this13.showDrapPopup(point);
2722
2725
 
2723
- _this12.pointToFront(point);
2726
+ _this13.pointToFront(point);
2724
2727
  });
2725
2728
  point.on('mouseout', function () {
2726
- _this12.isDropVisible = false;
2729
+ _this13.isDropVisible = false;
2727
2730
  }); // 折线点移动中 实时更新相关联的线的坐标
2728
2731
 
2729
- if (_this12.eventStyle.evented) {
2732
+ if (_this13.eventStyle.evented) {
2730
2733
  point.on('moving', function () {
2731
- _this12.pointMoveLimit(point, false);
2734
+ _this13.pointMoveLimit(point, false);
2732
2735
 
2733
- _this12.pointMoveUpdateLine(point);
2736
+ _this13.pointMoveUpdateLine(point);
2734
2737
 
2735
- _this12.addPoint(point); // this.canvas.renderAll();
2738
+ _this13.addPoint(point); // this.canvas.renderAll();
2736
2739
 
2737
2740
 
2738
- _this12.showDrapPopup(point);
2741
+ _this13.showDrapPopup(point);
2739
2742
  }); // 折线点停止拖拽后 更新polyline中对应的坐标
2740
2743
 
2741
2744
  point.on('moved', function () {
2742
2745
  if (point && point.id.includes('_polylinePoint_')) {
2743
- _this12.isDropVisible = false;
2746
+ _this13.isDropVisible = false;
2744
2747
 
2745
- _this12.setEmitFunction(point);
2748
+ _this13.setEmitFunction(point);
2746
2749
 
2747
- _this12.addPointObjList = [];
2750
+ _this13.addPointObjList = [];
2748
2751
  }
2749
2752
  });
2750
2753
  point.on('mouseup', function (event) {
@@ -2753,13 +2756,13 @@ var rightClickNodeConnect = [{
2753
2756
 
2754
2757
  if (button == 1 && isClick) {
2755
2758
  // 可配置批量删除当前项目上的点了
2756
- _this12.currentDelPoint = point;
2759
+ _this13.currentDelPoint = point;
2757
2760
  }
2758
2761
  });
2759
2762
  } // 超出表格最高或最低值则需要触发pointChange事件并且不能更新视图,否则连接节点判断不会成功
2760
2763
 
2761
2764
 
2762
- isInit && _this12.setEmitFunction(point, isInit);
2765
+ isInit && _this13.setEmitFunction(point, isInit);
2763
2766
  return _context2.abrupt("return", point);
2764
2767
 
2765
2768
  case 18:
@@ -2772,7 +2775,7 @@ var rightClickNodeConnect = [{
2772
2775
  },
2773
2776
  // 拖动停止后 设置回调触发方法
2774
2777
  setEmitFunction: function setEmitFunction(point) {
2775
- var _this13 = this;
2778
+ var _this14 = this;
2776
2779
 
2777
2780
  var isInit = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
2778
2781
  var operable = this.propItems.operable;
@@ -2810,7 +2813,7 @@ var rightClickNodeConnect = [{
2810
2813
  } else {
2811
2814
  this.$nextTick(function () {
2812
2815
  // 拖动新增节点时默认所有节点可删除
2813
- _this13.currentDelPoint = null;
2816
+ _this14.currentDelPoint = null;
2814
2817
  });
2815
2818
  var lastPoint = this.addPointList[this.addPointList.length - 1];
2816
2819
  var position = this.polyline[point.polylineTypeId].position;
@@ -2838,7 +2841,7 @@ var rightClickNodeConnect = [{
2838
2841
  this.addPointList.forEach(function (v) {
2839
2842
  return Object.assign(v, {
2840
2843
  isConcat: true,
2841
- concatIndex: _this13._concatIndex
2844
+ concatIndex: _this14._concatIndex
2842
2845
  });
2843
2846
  });
2844
2847
  } else if (point.line2 || point.nextPoint && lastPoint.left >= point.nextPoint.left) {
@@ -2876,7 +2879,7 @@ var rightClickNodeConnect = [{
2876
2879
  },
2877
2880
  // 纠正线段坐标
2878
2881
  setLinePatch: function setLinePatch(point) {
2879
- var _this14 = this;
2882
+ var _this15 = this;
2880
2883
 
2881
2884
  var originLeft = point.originLeft,
2882
2885
  originTop = point.originTop;
@@ -2884,13 +2887,13 @@ var rightClickNodeConnect = [{
2884
2887
  var _loop = function _loop(i, len) {
2885
2888
  var _point$prePoint$left, _point$prePoint, _point$prePoint$top, _point$prePoint2, _currentPointObj$line;
2886
2889
 
2887
- var currentPoint = _this14.addPointList[i];
2888
- var prevPoint = _this14.addPointList[i - 1] || {
2890
+ var currentPoint = _this15.addPointList[i];
2891
+ var prevPoint = _this15.addPointList[i - 1] || {
2889
2892
  left: (_point$prePoint$left = (_point$prePoint = point.prePoint) === null || _point$prePoint === void 0 ? void 0 : _point$prePoint.left) !== null && _point$prePoint$left !== void 0 ? _point$prePoint$left : originLeft,
2890
2893
  top: (_point$prePoint$top = (_point$prePoint2 = point.prePoint) === null || _point$prePoint2 === void 0 ? void 0 : _point$prePoint2.top) !== null && _point$prePoint$top !== void 0 ? _point$prePoint$top : originTop
2891
2894
  };
2892
2895
 
2893
- var currentPointObj = _this14.addPointObjList.find(function (obj) {
2896
+ var currentPointObj = _this15.addPointObjList.find(function (obj) {
2894
2897
  return obj.left === currentPoint.left;
2895
2898
  });
2896
2899
 
@@ -2911,7 +2914,7 @@ var rightClickNodeConnect = [{
2911
2914
  // 检查批量新增拖动过程中是否存在漏点的情况
2912
2915
  checkPoints: function checkPoints(point) {
2913
2916
  var _this$addPointList2,
2914
- _this15 = this;
2917
+ _this16 = this;
2915
2918
 
2916
2919
  var originLeft = point.originLeft,
2917
2920
  originTop = point.originTop,
@@ -2925,9 +2928,9 @@ var rightClickNodeConnect = [{
2925
2928
  for (var k = 0; k <= PointLens; k++) {
2926
2929
  if (k > 0) {
2927
2930
  (function () {
2928
- var curLeft = originLeft + _this15.spaceWidth * k; // 判断this.addPointList中的left是否包含curLeft,不包含就说明是漏了
2931
+ var curLeft = originLeft + _this16.spaceWidth * k; // 判断this.addPointList中的left是否包含curLeft,不包含就说明是漏了
2929
2932
 
2930
- var hasPoint = _this15.addPointList.some(function (p) {
2933
+ var hasPoint = _this16.addPointList.some(function (p) {
2931
2934
  return Math.abs(p.left - curLeft) <= 0.001;
2932
2935
  }); // const hasPoint = this.addPointList.some(v => v.left == curLeft);
2933
2936
 
@@ -2935,7 +2938,7 @@ var rightClickNodeConnect = [{
2935
2938
  if (!hasPoint) {
2936
2939
  var index;
2937
2940
 
2938
- var pointObj = _this15.addPointList.find(function (v, i) {
2941
+ var pointObj = _this16.addPointList.find(function (v, i) {
2939
2942
  if (v.left > curLeft) {
2940
2943
  index = i;
2941
2944
  }
@@ -2945,20 +2948,20 @@ var rightClickNodeConnect = [{
2945
2948
 
2946
2949
  if (pointObj) {
2947
2950
  var cloneObj = JSON.parse(JSON.stringify(pointObj));
2948
- var prePoint = _this15.addPointList[index - 1] || {
2951
+ var prePoint = _this16.addPointList[index - 1] || {
2949
2952
  left: originLeft,
2950
2953
  top: originTop
2951
2954
  };
2952
- var len = ~~((pointObj.left - (curLeft - _this15.spaceWidth)) / _this15.spaceWidth);
2955
+ var len = ~~((pointObj.left - (curLeft - _this16.spaceWidth)) / _this16.spaceWidth);
2953
2956
  var spaceHeight = (pointObj.top - prePoint.top) / len;
2954
2957
  cloneObj.top = prePoint.top + spaceHeight;
2955
- cloneObj.value.time = _this15.getXValue(curLeft);
2956
- cloneObj.value.value = _this15.getYValue(position, cloneObj.top);
2958
+ cloneObj.value.time = _this16.getXValue(curLeft);
2959
+ cloneObj.value.value = _this16.getYValue(position, cloneObj.top);
2957
2960
  cloneObj.left = curLeft;
2958
2961
 
2959
- _this15.addPointList.splice(index, 0, cloneObj);
2962
+ _this16.addPointList.splice(index, 0, cloneObj);
2960
2963
 
2961
- _this15.clonePoint(point, [prePoint.left, prePoint.top, cloneObj.left, cloneObj.top]);
2964
+ _this16.clonePoint(point, [prePoint.left, prePoint.top, cloneObj.left, cloneObj.top]);
2962
2965
  }
2963
2966
  }
2964
2967
  })();
@@ -3134,7 +3137,7 @@ var rightClickNodeConnect = [{
3134
3137
  }
3135
3138
  },
3136
3139
  clonePoint: function clonePoint(point, points) {
3137
- var _this16 = this;
3140
+ var _this17 = this;
3138
3141
 
3139
3142
  var evented, selectable, lineIndex, polylineIndex, lineAttr, polylineTypeId;
3140
3143
  evented = selectable = false;
@@ -3158,7 +3161,7 @@ var rightClickNodeConnect = [{
3158
3161
  clonedObj.hasControls = clonedObj.hasBorders = false;
3159
3162
  point.prePoints = [point.left, point.top];
3160
3163
 
3161
- var line = _this16.drawLine(Object(toConsumableArray["a" /* default */])(points), Object(objectSpread2["a" /* default */])(Object(objectSpread2["a" /* default */])({
3164
+ var line = _this17.drawLine(Object(toConsumableArray["a" /* default */])(points), Object(objectSpread2["a" /* default */])(Object(objectSpread2["a" /* default */])({
3162
3165
  evented: evented,
3163
3166
  selectable: selectable
3164
3167
  }, lineAttr), {}, {
@@ -3169,13 +3172,13 @@ var rightClickNodeConnect = [{
3169
3172
 
3170
3173
  clonedObj.line1 = line;
3171
3174
 
3172
- _this16.canvas.sendBackwards(line);
3175
+ _this17.canvas.sendBackwards(line);
3173
3176
 
3174
3177
  clonedObj.bringForward();
3175
3178
 
3176
- _this16.canvas.add(clonedObj);
3179
+ _this17.canvas.add(clonedObj);
3177
3180
 
3178
- _this16.addPointObjList.push(clonedObj); // resolve(clonedObj);
3181
+ _this17.addPointObjList.push(clonedObj); // resolve(clonedObj);
3179
3182
 
3180
3183
  }); // });
3181
3184
  },
@@ -3292,22 +3295,27 @@ var rightClickNodeConnect = [{
3292
3295
  }
3293
3296
  },
3294
3297
  // 打开右键菜单
3295
- openRightModal: function openRightModal(event) {
3296
- var _this17 = this;
3298
+ openRightModal: function openRightModal() {
3299
+ var _this18 = this;
3297
3300
 
3301
+ var _this$activeEvent$e = this.activeEvent.e,
3302
+ clientX = _this$activeEvent$e.clientX,
3303
+ pageX = _this$activeEvent$e.pageX,
3304
+ clientY = _this$activeEvent$e.clientY,
3305
+ pageY = _this$activeEvent$e.pageY;
3298
3306
  this.rightPos = {
3299
- clientX: event.e.clientX || event.e.pageX,
3300
- clientY: event.e.clientY || event.e.pageY
3307
+ clientX: clientX !== null && clientX !== void 0 ? clientX : pageX,
3308
+ clientY: clientY !== null && clientY !== void 0 ? clientY : pageY
3301
3309
  };
3302
3310
  this.isRightVisible = false;
3303
- var target = event.target;
3304
- var id = target ? target.id : '';
3311
+ var target = this.activeEvent.target;
3312
+ var id = (target === null || target === void 0 ? void 0 : target.id) || '';
3305
3313
  this.$nextTick(function () {
3306
3314
  if (id && id.includes('_polylinePoint_')) {
3307
- _this17._currentPoint = target;
3315
+ _this18._currentPoint = target;
3308
3316
  var nodeConnect = [];
3309
3317
 
3310
- if (_this17.propItems.operable.connect) {
3318
+ if (_this18.propItems.operable.connect) {
3311
3319
  if (!target.line2 && target.nextPoint) {
3312
3320
  nodeConnect = rightClickNodeConnect.slice(0, 1);
3313
3321
  }
@@ -3321,13 +3329,13 @@ var rightClickNodeConnect = [{
3321
3329
  }
3322
3330
  }
3323
3331
 
3324
- _this17.rightClickNode = Object.freeze(rightClickNode.slice(0, 1).concat(nodeConnect).concat(rightClickNode.slice(-1)));
3325
- _this17.isRightVisible = true;
3332
+ _this18.rightClickNode = Object.freeze(rightClickNode.slice(0, 1).concat(nodeConnect).concat(rightClickNode.slice(-1)));
3333
+ _this18.isRightVisible = true;
3326
3334
  } else if (!id) {
3327
- var operable = _this17.propItems.operable;
3328
- _this17._currentPoint = null;
3329
- _this17.rightClickNode = Object.freeze(operable.set ? rightClickNode.slice(0, 2) : rightClickNode.slice(0, 1));
3330
- _this17.isRightVisible = true;
3335
+ var operable = _this18.propItems.operable;
3336
+ _this18._currentPoint = null;
3337
+ _this18.rightClickNode = Object.freeze(operable.set ? rightClickNode.slice(0, 2) : rightClickNode.slice(0, 1));
3338
+ _this18.isRightVisible = true;
3331
3339
  }
3332
3340
  });
3333
3341
  },
@@ -3395,16 +3403,16 @@ var rightClickNodeConnect = [{
3395
3403
  // 将当条线段以及点层级置顶
3396
3404
  // 线段不能先置顶,会挡住其他线段上的点
3397
3405
  pointToFront: function pointToFront(point) {
3398
- var _this18 = this;
3406
+ var _this19 = this;
3399
3407
 
3400
3408
  this.canvas.forEachObject(function (obj) {
3401
- if (_this18.isOnePolyLine(obj, point.polylineTypeId, point.polylineIndex)) {
3402
- _this18.canvas.bringToFront(obj);
3409
+ if (_this19.isOnePolyLine(obj, point.polylineTypeId, point.polylineIndex)) {
3410
+ _this19.canvas.bringToFront(obj);
3403
3411
  }
3404
3412
  });
3405
3413
  },
3406
3414
  removePolyline: function removePolyline(id, left, position, polylineIndex) {
3407
- var _this19 = this;
3415
+ var _this20 = this;
3408
3416
 
3409
3417
  // 根据id或者idClone删除
3410
3418
  if (id) {
@@ -3413,9 +3421,9 @@ var rightClickNodeConnect = [{
3413
3421
  if (pointId === 'idClone') {
3414
3422
  this.addPointObjList.forEach(function (obj) {
3415
3423
  if (obj.left >= left) {
3416
- _this19.canvas.remove(obj);
3424
+ _this20.canvas.remove(obj);
3417
3425
 
3418
- obj.line1 && _this19.canvas.remove(obj.line1);
3426
+ obj.line1 && _this20.canvas.remove(obj.line1);
3419
3427
  }
3420
3428
  });
3421
3429
  this.addPointObjList = this.addPointObjList.filter(function (obj) {
@@ -3429,9 +3437,9 @@ var rightClickNodeConnect = [{
3429
3437
  if (point && point.length > 0) {
3430
3438
  point.forEach(function (v) {
3431
3439
  if (!left) {
3432
- _this19.canvas.remove(v);
3440
+ _this20.canvas.remove(v);
3433
3441
 
3434
- v.line1 && _this19.canvas.remove(v.line1);
3442
+ v.line1 && _this20.canvas.remove(v.line1);
3435
3443
  }
3436
3444
  });
3437
3445
  }
@@ -3446,12 +3454,12 @@ var rightClickNodeConnect = [{
3446
3454
  return v.position === position;
3447
3455
  });
3448
3456
  this.canvas.forEachObject(function (obj) {
3449
- if (_this19.isOnePolyLine(obj, polylineTypeId, polylineIndex)) {
3450
- obj.text && _this19.canvas.remove(obj.text);
3451
- obj.line1 && _this19.canvas.remove(obj.line1);
3452
- obj.line2 && _this19.canvas.remove(obj.line2);
3457
+ if (_this20.isOnePolyLine(obj, polylineTypeId, polylineIndex)) {
3458
+ obj.text && _this20.canvas.remove(obj.text);
3459
+ obj.line1 && _this20.canvas.remove(obj.line1);
3460
+ obj.line2 && _this20.canvas.remove(obj.line2);
3453
3461
 
3454
- _this19.canvas.remove(obj);
3462
+ _this20.canvas.remove(obj);
3455
3463
  }
3456
3464
  });
3457
3465
  return;
@@ -3460,9 +3468,9 @@ var rightClickNodeConnect = [{
3460
3468
 
3461
3469
  this.canvas.forEachObject(function (obj) {
3462
3470
  if (obj.id && /_polyline(Point|Line)_/.test(obj.id) && !obj.id.includes('isTitle')) {
3463
- obj.text && _this19.canvas.remove(obj.text);
3471
+ obj.text && _this20.canvas.remove(obj.text);
3464
3472
 
3465
- _this19.canvas.remove(obj);
3473
+ _this20.canvas.remove(obj);
3466
3474
  }
3467
3475
  });
3468
3476
  },
@@ -3473,7 +3481,7 @@ var rightClickNodeConnect = [{
3473
3481
  }
3474
3482
  },
3475
3483
  repaintPolyline: function repaintPolyline(position, dadaIndex) {
3476
- var _this20 = this;
3484
+ var _this21 = this;
3477
3485
 
3478
3486
  if (arguments.length < 2) {
3479
3487
  if (this.polyline.length) {
@@ -3483,7 +3491,7 @@ var rightClickNodeConnect = [{
3483
3491
  this.polylinePointList = [];
3484
3492
  this.flickerablePoints = [];
3485
3493
  this.polyline.forEach(function (polylineType, polylineTypeId) {
3486
- _this20.createPolyline(polylineType, polylineTypeId);
3494
+ _this21.createPolyline(polylineType, polylineTypeId);
3487
3495
  });
3488
3496
  this.removeTitle();
3489
3497
  this.drawPolylineTitle();
@@ -3513,8 +3521,8 @@ var rightClickNodeConnect = [{
3513
3521
 
3514
3522
  var FabricPolylines_component = Object(componentNormalizer["a" /* default */])(
3515
3523
  fabric_chart_FabricPolylinesvue_type_script_lang_js_,
3516
- FabricPolylinesvue_type_template_id_47f12750_render,
3517
- FabricPolylinesvue_type_template_id_47f12750_staticRenderFns,
3524
+ FabricPolylinesvue_type_template_id_4cbf471a_render,
3525
+ FabricPolylinesvue_type_template_id_4cbf471a_staticRenderFns,
3518
3526
  false,
3519
3527
  null,
3520
3528
  null,
@@ -3620,12 +3628,12 @@ var FabricGrid_component = Object(componentNormalizer["a" /* default */])(
3620
3628
  )
3621
3629
 
3622
3630
  /* harmony default export */ var FabricGrid = (FabricGrid_component.exports);
3623
- // CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"4bfccfd0-vue-loader-template"}!./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./packages/fabric-chart/src/fabric-chart/FabricTextGroup.vue?vue&type=template&id=66ab25fc&
3624
- var FabricTextGroupvue_type_template_id_66ab25fc_render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:"text-group"},[_c('MouseRightClick',{directives:[{name:"show",rawName:"v-show",value:(_vm.isRightVisible),expression:"isRightVisible"}],attrs:{"getContainer":_vm.getContainer,"nodeList":_vm.rightClickNode,"rightPos":_vm.rightPos},on:{"nodeClick":_vm.handleRightClick,"closeRight":function($event){_vm.isRightVisible = false}}}),_c('DropPopup',{directives:[{name:"show",rawName:"v-show",value:(_vm.isDropVisible),expression:"isDropVisible"}],attrs:{"val":_vm.dropVal,"dropPos":_vm.dropPos}})],1)}
3625
- var FabricTextGroupvue_type_template_id_66ab25fc_staticRenderFns = []
3631
+ // CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"a62a2cd6-vue-loader-template"}!./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./packages/fabric-chart/src/fabric-chart/FabricTextGroup.vue?vue&type=template&id=5b0e77b0&
3632
+ var FabricTextGroupvue_type_template_id_5b0e77b0_render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:"text-group"},[_c('MouseRightClick',{directives:[{name:"show",rawName:"v-show",value:(_vm.isRightVisible),expression:"isRightVisible"}],attrs:{"getContainer":_vm.getContainer,"nodeList":_vm.rightClickNode,"rightPos":_vm.rightPos},on:{"nodeClick":_vm.handleRightClick,"closeRight":function($event){_vm.isRightVisible = false}}}),_c('DropPopup',{directives:[{name:"show",rawName:"v-show",value:(_vm.isDropVisible),expression:"isDropVisible"}],attrs:{"val":_vm.dropVal,"dropPos":_vm.dropPos}})],1)}
3633
+ var FabricTextGroupvue_type_template_id_5b0e77b0_staticRenderFns = []
3626
3634
 
3627
3635
 
3628
- // CONCATENATED MODULE: ./packages/fabric-chart/src/fabric-chart/FabricTextGroup.vue?vue&type=template&id=66ab25fc&
3636
+ // CONCATENATED MODULE: ./packages/fabric-chart/src/fabric-chart/FabricTextGroup.vue?vue&type=template&id=5b0e77b0&
3629
3637
 
3630
3638
  // EXTERNAL MODULE: external "core-js/modules/es.array.sort.js"
3631
3639
  var es_array_sort_js_ = __webpack_require__("4c07");
@@ -3796,30 +3804,30 @@ var getTopTotalList = function getTopTotalList(tree, topTotalList) {
3796
3804
  x = _event$pointer.x,
3797
3805
  y = _event$pointer.y;
3798
3806
 
3799
- var _this2$$propItems = _this2.$propItems(),
3800
- originX = _this2$$propItems.originX,
3801
- originY = _this2$$propItems.originY,
3802
- endX = _this2$$propItems.endX,
3803
- endY = _this2$$propItems.endY;
3804
-
3805
- if (!(x < originX || x > endX || y < originY || y > endY)) {
3807
+ if (_this2.isGridLimit(x, y)) {
3806
3808
  _this2.activeEvent = event;
3807
- document.querySelector('.upper-canvas').addEventListener('contextmenu', _this2.addEventListenerContextmenu, true);
3809
+ !_this2.isAddEventListenerContextmenu && document.querySelector('.upper-canvas').addEventListener('contextmenu', _this2.addEventListenerContextmenu, true);
3810
+ _this2.isAddEventListenerContextmenu = true;
3808
3811
  }
3809
3812
  }
3810
3813
  });
3811
3814
  },
3812
3815
  // 打开右键菜单
3813
- openRightModal: function openRightModal(event) {
3816
+ openRightModal: function openRightModal() {
3814
3817
  var _this3 = this;
3815
3818
 
3819
+ var _this$activeEvent$e = this.activeEvent.e,
3820
+ clientX = _this$activeEvent$e.clientX,
3821
+ pageX = _this$activeEvent$e.pageX,
3822
+ clientY = _this$activeEvent$e.clientY,
3823
+ pageY = _this$activeEvent$e.pageY;
3816
3824
  this.rightPos = {
3817
- clientX: event.e.clientX || event.e.pageX,
3818
- clientY: event.e.clientY || event.e.pageY
3825
+ clientX: clientX !== null && clientX !== void 0 ? clientX : pageX,
3826
+ clientY: clientY !== null && clientY !== void 0 ? clientY : pageY
3819
3827
  };
3820
3828
  this.isRightVisible = false;
3821
- var target = event.target;
3822
- var id = target ? target.id : '';
3829
+ var target = this.activeEvent.target;
3830
+ var id = (target === null || target === void 0 ? void 0 : target.id) || '';
3823
3831
  this.$nextTick(function () {
3824
3832
  if (id && id.includes('_other')) {
3825
3833
  _this3._currentPoint = target || '';
@@ -4552,8 +4560,8 @@ var getTopTotalList = function getTopTotalList(tree, topTotalList) {
4552
4560
 
4553
4561
  var FabricTextGroup_component = Object(componentNormalizer["a" /* default */])(
4554
4562
  fabric_chart_FabricTextGroupvue_type_script_lang_js_,
4555
- FabricTextGroupvue_type_template_id_66ab25fc_render,
4556
- FabricTextGroupvue_type_template_id_66ab25fc_staticRenderFns,
4563
+ FabricTextGroupvue_type_template_id_5b0e77b0_render,
4564
+ FabricTextGroupvue_type_template_id_5b0e77b0_staticRenderFns,
4557
4565
  false,
4558
4566
  null,
4559
4567
  null,
@@ -4562,14 +4570,14 @@ var FabricTextGroup_component = Object(componentNormalizer["a" /* default */])(
4562
4570
  )
4563
4571
 
4564
4572
  /* harmony default export */ var FabricTextGroup = (FabricTextGroup_component.exports);
4565
- // CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"4bfccfd0-vue-loader-template"}!./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./packages/fabric-chart/src/fabric-chart/FabricScaleValue.vue?vue&type=template&id=2fb04f40&
4573
+ // CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"a62a2cd6-vue-loader-template"}!./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./packages/fabric-chart/src/fabric-chart/FabricScaleValue.vue?vue&type=template&id=2fb04f40&
4566
4574
  var FabricScaleValuevue_type_template_id_2fb04f40_render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return (_vm.templateData.top.xScalevalue.popupTop)?_c('TimeScaleValue',{attrs:{"times":_vm.timeList,"templateData":_vm.templateData}}):_vm._e()}
4567
4575
  var FabricScaleValuevue_type_template_id_2fb04f40_staticRenderFns = []
4568
4576
 
4569
4577
 
4570
4578
  // CONCATENATED MODULE: ./packages/fabric-chart/src/fabric-chart/FabricScaleValue.vue?vue&type=template&id=2fb04f40&
4571
4579
 
4572
- // CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"4bfccfd0-vue-loader-template"}!./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./packages/fabric-chart/src/components/TimeScaleValue.vue?vue&type=template&id=3b20fb44&scoped=true&
4580
+ // CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"a62a2cd6-vue-loader-template"}!./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./packages/fabric-chart/src/components/TimeScaleValue.vue?vue&type=template&id=3b20fb44&scoped=true&
4573
4581
  var TimeScaleValuevue_type_template_id_3b20fb44_scoped_true_render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{directives:[{name:"show",rawName:"v-show",value:(_vm.isShow),expression:"isShow"}],staticClass:"c-time-scalevalue",style:({ '--left': _vm.popupStyle.left, '--top': _vm.popupStyle.top, '--height': _vm.popupStyle.height, '--width': _vm.popupStyle.width })},_vm._l((_vm.times),function(item,index){return _c('span',{directives:[{name:"show",rawName:"v-show",value:(index % 2 == 0),expression:"index % 2 == 0"}],key:item.left,staticClass:"c-time-scalevalue-list",style:({ left: ((item.left - item.width / 2) + "px"), '--font-size': _vm.popupStyle.fontSize })},[_vm._v(" "+_vm._s(item.time)+" ")])}),0)}
4574
4582
  var TimeScaleValuevue_type_template_id_3b20fb44_scoped_true_staticRenderFns = []
4575
4583
 
@@ -4936,12 +4944,12 @@ var FabricScaleValue_component = Object(componentNormalizer["a" /* default */])(
4936
4944
  )
4937
4945
 
4938
4946
  /* harmony default export */ var FabricScaleValue = (FabricScaleValue_component.exports);
4939
- // CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"4bfccfd0-vue-loader-template"}!./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./packages/fabric-chart/src/fabric-chart/FabricLines.vue?vue&type=template&id=a683fbc4&
4940
- var FabricLinesvue_type_template_id_a683fbc4_render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:"line"},[_c('MouseRightClick',{directives:[{name:"show",rawName:"v-show",value:(_vm.isRightVisible),expression:"isRightVisible"}],attrs:{"getContainer":_vm.getContainer,"nodeList":_vm.rightClickNode,"rightPos":_vm.rightPos},on:{"nodeClick":_vm.handleRightClick,"closeRight":function($event){_vm.isRightVisible = false}}}),_c('DropPopup',{directives:[{name:"show",rawName:"v-show",value:(_vm.isDropVisible),expression:"isDropVisible"}],attrs:{"val":_vm.dropVal,"dropPos":_vm.dropPos}})],1)}
4941
- var FabricLinesvue_type_template_id_a683fbc4_staticRenderFns = []
4947
+ // CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"a62a2cd6-vue-loader-template"}!./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./packages/fabric-chart/src/fabric-chart/FabricLines.vue?vue&type=template&id=e835fd06&
4948
+ var FabricLinesvue_type_template_id_e835fd06_render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:"line"},[_c('MouseRightClick',{directives:[{name:"show",rawName:"v-show",value:(_vm.isRightVisible),expression:"isRightVisible"}],attrs:{"getContainer":_vm.getContainer,"nodeList":_vm.rightClickNode,"rightPos":_vm.rightPos},on:{"nodeClick":_vm.handleRightClick,"closeRight":function($event){_vm.isRightVisible = false}}}),_c('DropPopup',{directives:[{name:"show",rawName:"v-show",value:(_vm.isDropVisible),expression:"isDropVisible"}],attrs:{"val":_vm.dropVal,"dropPos":_vm.dropPos}})],1)}
4949
+ var FabricLinesvue_type_template_id_e835fd06_staticRenderFns = []
4942
4950
 
4943
4951
 
4944
- // CONCATENATED MODULE: ./packages/fabric-chart/src/fabric-chart/FabricLines.vue?vue&type=template&id=a683fbc4&
4952
+ // CONCATENATED MODULE: ./packages/fabric-chart/src/fabric-chart/FabricLines.vue?vue&type=template&id=e835fd06&
4945
4953
 
4946
4954
  // CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./packages/fabric-chart/src/fabric-chart/FabricLines.vue?vue&type=script&lang=js&
4947
4955
 
@@ -5044,15 +5052,10 @@ var FabricLinesvue_type_script_lang_js_rightClickNode = [{
5044
5052
  x = _event$pointer.x,
5045
5053
  y = _event$pointer.y;
5046
5054
 
5047
- var _this$$propItems = _this.$propItems(),
5048
- originX = _this$$propItems.originX,
5049
- endX = _this$$propItems.endX,
5050
- endYTop = _this$$propItems.endYTop,
5051
- originYTop = _this$$propItems.originYTop;
5052
-
5053
- if (!(x < 0 || x > endX || y < originYTop || y > endYTop)) {
5055
+ if (_this.isTopTreeAndGridLimit(x, y)) {
5054
5056
  _this.activeEvent = event;
5055
- document.querySelector('.upper-canvas').addEventListener('contextmenu', _this.addEventListenerContextmenu, true);
5057
+ !_this.isAddEventListenerContextmenu && document.querySelector('.upper-canvas').addEventListener('contextmenu', _this.addEventListenerContextmenu, true);
5058
+ _this.isAddEventListenerContextmenu = true;
5056
5059
  }
5057
5060
  }
5058
5061
  });
@@ -5076,39 +5079,38 @@ var FabricLinesvue_type_script_lang_js_rightClickNode = [{
5076
5079
  */
5077
5080
  addEventListenerContextmenu: function addEventListenerContextmenu(event) {
5078
5081
  event.preventDefault();
5079
- var x = event.offsetX;
5080
- var y = event.offsetY;
5081
-
5082
- var _this$$propItems2 = this.$propItems(),
5083
- originX = _this$$propItems2.originX,
5084
- endX = _this$$propItems2.endX,
5085
- endYTop = _this$$propItems2.endYTop,
5086
- originYTop = _this$$propItems2.originYTop;
5082
+ var offsetX = event.offsetX,
5083
+ offsetY = event.offsetY;
5087
5084
 
5088
- if (!(x < 0 || x > endX || y < originYTop || y > endYTop)) {
5089
- this.openRightModal(this.activeEvent);
5085
+ if (this.isTopTreeAndGridLimit(offsetX, offsetY)) {
5086
+ this.openRightModal();
5090
5087
  }
5091
5088
 
5092
5089
  return false;
5093
5090
  },
5094
5091
  // 打开右键菜单
5095
- openRightModal: function openRightModal(event) {
5092
+ openRightModal: function openRightModal() {
5096
5093
  var _this2 = this;
5097
5094
 
5095
+ var _this$activeEvent$e = this.activeEvent.e,
5096
+ clientX = _this$activeEvent$e.clientX,
5097
+ pageX = _this$activeEvent$e.pageX,
5098
+ clientY = _this$activeEvent$e.clientY,
5099
+ pageY = _this$activeEvent$e.pageY;
5098
5100
  this.rightPos = {
5099
- clientX: event.e.clientX || event.e.pageX,
5100
- clientY: event.e.clientY || event.e.pageY
5101
+ clientX: clientX !== null && clientX !== void 0 ? clientX : pageX,
5102
+ clientY: clientY !== null && clientY !== void 0 ? clientY : pageY
5101
5103
  };
5102
5104
  this.isRightVisible = false;
5103
- var target = event.target;
5104
- var id = target ? target.id : '';
5105
+ var target = this.activeEvent.target;
5106
+ var id = (target === null || target === void 0 ? void 0 : target.id) || '';
5105
5107
  this.$nextTick(function () {
5106
5108
  if (id && id.includes('_lineGroup_')) {
5107
5109
  _this2._currentPoint = target || '';
5108
5110
  _this2.rightClickNode = Object.freeze(FabricLinesvue_type_script_lang_js_rightClickNode.slice());
5109
5111
  _this2.isRightVisible = true;
5110
5112
  } else {
5111
- _this2.doContextmenuEvent(event.pointer);
5113
+ _this2.doContextmenuEvent(_this2.activeEvent.pointer);
5112
5114
  }
5113
5115
  });
5114
5116
  },
@@ -5116,8 +5118,8 @@ var FabricLinesvue_type_script_lang_js_rightClickNode = [{
5116
5118
  var x = pointer.x,
5117
5119
  y = pointer.y;
5118
5120
 
5119
- var _this$$propItems3 = this.$propItems(),
5120
- treeList = _this$$propItems3.treeList;
5121
+ var _this$$propItems = this.$propItems(),
5122
+ treeList = _this$$propItems.treeList;
5121
5123
 
5122
5124
  var _treeList = vexutils_default.a.clone(treeList, true);
5123
5125
 
@@ -5193,7 +5195,7 @@ var FabricLinesvue_type_script_lang_js_rightClickNode = [{
5193
5195
  return Object(asyncToGenerator["a" /* default */])( /*#__PURE__*/regeneratorRuntime.mark(function _callee() {
5194
5196
  var _this5$canvas;
5195
5197
 
5196
- var lineList, _this5$propItems, originX, endX, xScaleList, yCellHeightTop, originYTop, spaceHeight, minMinute, maxMinute, lineItemList, y1, y2, textArr, textList, j, len, item, startMinute, endMinute, x1, x2, textObj, textContent, isContinue, leftLine, centerLine, centerRect, rightLine, textTop, textLimitRight, text, _lineList, leftLimit, _lineList2, preItem0, preItem1, preEndMinute, preStartMinute, rightLimt, _lineList3, _preItem, _preStartMinute;
5198
+ var lineList, _this5$propItems, originX, endX, xScaleList, yCellHeightTop, originYTop, spaceHeight, minMinute, maxMinute, lineItemList, y1, y2, textArr, textList, j, len, item, startMinute, endMinute, x1, x2, textObj, textContent, isContinue, leftLine, centerLine, centerRect, rightLine, leftLimit, rightLimit, _lineList, preItem0, preItem1, preEndMinute, preStartMinute, _lineList2, _preItem, _preStartMinute, textTop, text, commonOptions;
5197
5199
 
5198
5200
  return regeneratorRuntime.wrap(function _callee$(_context) {
5199
5201
  while (1) {
@@ -5214,7 +5216,7 @@ var FabricLinesvue_type_script_lang_js_rightClickNode = [{
5214
5216
 
5215
5217
  case 11:
5216
5218
  if (!(j < len)) {
5217
- _context.next = 57;
5219
+ _context.next = 53;
5218
5220
  break;
5219
5221
  }
5220
5222
 
@@ -5329,97 +5331,100 @@ var FabricLinesvue_type_script_lang_js_rightClickNode = [{
5329
5331
  lineItemList.push(rightLine);
5330
5332
 
5331
5333
  case 40:
5332
- // 文字内容
5333
- textTop = x2 ? (y1 + y2) / 2 : y1 + yCellHeightTop / 2;
5334
- textLimitRight = void 0;
5335
- text = endMinute === '' && leftLine || item[1] && !(x1 === originX && x2 === originX) && !(x1 === endX && x2 === endX) ? _this5.drawLineText(textArr.concat([textContent]), textTop, i, j, centerLine, leftLine, x1, x2) : null; // 文字内容居右侧竖线且超出当前线段右边界则移除
5336
-
5337
- if (text) {
5338
- textLimitRight = (_lineList = lineList[j + 1]) !== null && _lineList !== void 0 && _lineList[0] && _this5.cumputedX(lineList[j + 1][0]) <= endX ? _this5.cumputedX(lineList[j + 1][0]) : endX;
5339
-
5340
- if (text.originX === 'left' && text.left + text.width + 2 >= textLimitRight) {
5341
- textLimitRight !== endX && textArr.push(textContent);
5342
-
5343
- _this5.canvas.remove(text);
5344
-
5345
- text = null;
5346
- } else {
5347
- textArr = [];
5348
-
5349
- _this5.hoverEvent(text, {
5350
- textObj: textObj,
5351
- startTime: item[0],
5352
- endTime: item[1]
5353
- });
5354
-
5355
- textList.push(text);
5356
- }
5357
- } // 设置拖动限制值
5358
-
5359
-
5360
- leftLimit = {};
5361
- leftLimit.x2 = x2 ? x2 : endX;
5362
- leftLimit.x1 = originX;
5334
+ // 设置拖动限制值
5335
+ leftLimit = {
5336
+ x1: originX,
5337
+ x2: x2 ? x2 : endX
5338
+ };
5339
+ rightLimit = {
5340
+ x1: x2 ? x1 : originX,
5341
+ x2: endX
5342
+ };
5363
5343
 
5364
5344
  if (lineList[j - 1]) {
5365
- _lineList2 = Object(slicedToArray["a" /* default */])(lineList[j - 1], 2), preItem0 = _lineList2[0], preItem1 = _lineList2[1];
5345
+ _lineList = Object(slicedToArray["a" /* default */])(lineList[j - 1], 2), preItem0 = _lineList[0], preItem1 = _lineList[1];
5366
5346
 
5367
5347
  if (preItem1) {
5368
5348
  preEndMinute = new Date(preItem1).getTime();
5369
- if (preEndMinute >= minMinute && preEndMinute < maxMinute) leftLimit.x1 = _this5.cumputedX(preItem1);
5349
+
5350
+ if (preEndMinute >= minMinute && preEndMinute < maxMinute) {
5351
+ leftLimit.x1 = _this5.cumputedX(preItem1);
5352
+ if (!x2) rightLimit.x1 = leftLimit.x1;
5353
+ }
5370
5354
  } else {
5371
5355
  preStartMinute = new Date(preItem0).getTime();
5372
- if (preStartMinute >= minMinute && preStartMinute < maxMinute) leftLimit.x1 = _this5.cumputedX(preItem0);
5356
+
5357
+ if (preStartMinute >= minMinute && preStartMinute < maxMinute) {
5358
+ leftLimit.x1 = _this5.cumputedX(preItem0);
5359
+ if (!x2) rightLimit.x1 = leftLimit.x1;
5360
+ }
5373
5361
  }
5374
5362
  }
5375
5363
 
5376
- rightLimt = {};
5377
- rightLimt.x1 = x2 ? x1 : originX;
5378
- rightLimt.x2 = endX;
5379
-
5380
5364
  if (lineList[j + 1]) {
5381
- _lineList3 = Object(slicedToArray["a" /* default */])(lineList[j + 1], 1), _preItem = _lineList3[0];
5365
+ _lineList2 = Object(slicedToArray["a" /* default */])(lineList[j + 1], 1), _preItem = _lineList2[0];
5382
5366
 
5383
5367
  if (_preItem) {
5384
5368
  _preStartMinute = new Date(_preItem).getTime();
5385
- if (_preStartMinute > minMinute && _preStartMinute <= maxMinute) rightLimt.x2 = _this5.cumputedX(_preItem);
5369
+ if (_preStartMinute > minMinute && _preStartMinute <= maxMinute) rightLimit.x2 = _this5.cumputedX(_preItem);
5386
5370
  }
5371
+ } // 文字内容
5372
+
5373
+
5374
+ textTop = x2 ? (y1 + y2) / 2 : y1 + yCellHeightTop / 2;
5375
+ text = endMinute === '' && leftLine || item[1] && !(x1 === originX && x2 === originX) && !(x1 === endX && x2 === endX) ? _this5.drawLineText(textArr.concat([textContent]), textTop, i, j, x1, x2, {
5376
+ leftLimit: leftLimit,
5377
+ rightLimit: rightLimit,
5378
+ y2: y2
5379
+ }) : null; // 文字内容居右侧竖线且超出当前线段右边界则移除
5380
+
5381
+ if (text) {
5382
+ textArr = [];
5383
+
5384
+ _this5.hoverEvent(text, {
5385
+ textObj: textObj,
5386
+ startTime: item[0],
5387
+ endTime: item[1]
5388
+ });
5389
+
5390
+ textList.push(text);
5387
5391
  }
5388
5392
 
5389
- _this5.lineEvent({
5390
- line: leftLine,
5391
- line1: centerLine,
5393
+ commonOptions = {
5394
+ __range: [x1, x2],
5395
+ __baseY: y2,
5396
+ centerLine: centerLine,
5392
5397
  text: text,
5393
5398
  textObj: textObj,
5394
- limitX: leftLimit,
5399
+ leftLimit: leftLimit,
5400
+ rightLimit: rightLimit,
5395
5401
  startTime: item[0],
5396
- endTime: item[1],
5397
- preText: textList[text ? textList.length - 2 : textList.length - 1] || null,
5398
- textLimitRight: textLimitRight
5399
- });
5402
+ endTime: item[1]
5403
+ };
5404
+
5405
+ _this5.lineEvent(Object(objectSpread2["a" /* default */])({
5406
+ __position: 'left',
5407
+ line: leftLine,
5408
+ limitX: leftLimit,
5409
+ preText: textList[text ? textList.length - 2 : textList.length - 1] || null
5410
+ }, commonOptions));
5400
5411
 
5401
- _this5.lineEvent({
5412
+ _this5.lineEvent(Object(objectSpread2["a" /* default */])({
5413
+ __position: 'right',
5402
5414
  line: rightLine,
5403
- line2: centerLine,
5404
- text: text,
5405
- textObj: textObj,
5406
- limitX: rightLimt,
5407
- startTime: item[0],
5408
- endTime: item[1],
5409
- preText: null,
5410
- textLimitRight: rightLimt.x2
5411
- });
5415
+ limitX: rightLimit,
5416
+ preText: null
5417
+ }, commonOptions));
5412
5418
 
5413
- case 54:
5419
+ case 50:
5414
5420
  j++;
5415
5421
  _context.next = 11;
5416
5422
  break;
5417
5423
 
5418
- case 57:
5419
- (_this5$canvas = _this5.canvas).add.apply(_this5$canvas, lineItemList.concat(textList)); // this.canvas.requestRenderAll();
5420
-
5424
+ case 53:
5425
+ (_this5$canvas = _this5.canvas).add.apply(_this5$canvas, lineItemList.concat(textList));
5421
5426
 
5422
- case 58:
5427
+ case 54:
5423
5428
  case "end":
5424
5429
  return _context.stop();
5425
5430
  }
@@ -5427,15 +5432,10 @@ var FabricLinesvue_type_script_lang_js_rightClickNode = [{
5427
5432
  }, _callee);
5428
5433
  }))();
5429
5434
  },
5430
- drawLineText: function drawLineText(textArr, top, i, j, centerLine, leftLine, x1, x2) {
5431
- var _leftLine$width;
5432
-
5433
- // const value = textArr.map(v => {
5434
- // const channel = v.channel ? `(${v.channel})` : '';
5435
- // const consistence = v.consistence ? `(${v.consistence})` : '';
5436
- // const total = v.total ? `(${v.total})` : '';
5437
- // return `${v.currentSpeed || ''}${channel}${consistence}${total}`
5438
- // }).join('—');
5435
+ drawLineText: function drawLineText(textArr, top, i, j, x1, x2, _ref2) {
5436
+ var leftLimit = _ref2.leftLimit,
5437
+ rightLimit = _ref2.rightLimit,
5438
+ y2 = _ref2.y2;
5439
5439
  var value = textArr.filter(function (v) {
5440
5440
  return v !== '';
5441
5441
  }).join('—');
@@ -5452,17 +5452,63 @@ var FabricLinesvue_type_script_lang_js_rightClickNode = [{
5452
5452
  rowIndex: i,
5453
5453
  colIndex: j
5454
5454
  }, this.linesObj.dataTextStyle || {}));
5455
- var limitWidth = text.width + 2; // 横线小于text文字的宽度则text显示在右侧
5456
-
5457
- var originX = !centerLine || x2 && x2 - x1 <= limitWidth ? 'left' : 'center';
5458
- var left = x2 && x2 - x1 > limitWidth ? (x1 + x2) / 2 : this.textMarginLeft + (x2 && x2 - x1 <= limitWidth ? x2 : x1 + ((_leftLine$width = leftLine === null || leftLine === void 0 ? void 0 : leftLine.width) !== null && _leftLine$width !== void 0 ? _leftLine$width : 0) / 3);
5459
- text.set({
5460
- originX: originX,
5461
- left: left
5462
- });
5455
+ this.setTextPosition(text, top, x1, x2, leftLimit, rightLimit, y2);
5463
5456
  text.hasControls = text.hasBorders = false;
5464
5457
  return text;
5465
5458
  },
5459
+ setTextPosition: function setTextPosition(text, top, x1, x2, leftLimit, rightLimit, baseY) {
5460
+ var _ref3;
5461
+
5462
+ var textWidth = text.width + 2; // 横线小于text文字的宽度则text显示在右侧
5463
+
5464
+ var centerLineWidth = (_ref3 = (x2 || x1) - x1) !== null && _ref3 !== void 0 ? _ref3 : 0;
5465
+ var rightWidth = rightLimit.x2 - leftLimit.x2 || rightLimit.x2 - x1 || 0;
5466
+ var leftWidth = rightLimit.x1 - leftLimit.x1 || x1 - leftLimit.x1 || 0;
5467
+ var changeOptions = {
5468
+ originX: 'center',
5469
+ left: x1 + centerLineWidth / 2,
5470
+ top: top,
5471
+ scaleX: 1,
5472
+ scaleY: 1,
5473
+ originY: 'center',
5474
+ backgroundColor: '#fff',
5475
+ textLimit: {
5476
+ x1: x1,
5477
+ x2: x2 || x1
5478
+ }
5479
+ };
5480
+
5481
+ if (centerLineWidth >= textWidth) {// console.log('正常显示的文本')
5482
+ } else if (textWidth <= rightWidth) {
5483
+ changeOptions.originX = 'left';
5484
+ changeOptions.left = (x2 ? x2 : x1 + 3) + this.textMarginLeft;
5485
+ changeOptions.backgroundColor = 'transparent';
5486
+ changeOptions.textLimit.x2 = changeOptions.left + text.width;
5487
+ } else if (textWidth <= leftWidth) {
5488
+ changeOptions.originX = 'right';
5489
+ changeOptions.left = x1 - 3 - this.textMarginLeft;
5490
+ changeOptions.backgroundColor = 'transparent';
5491
+ changeOptions.textLimit.x1 = changeOptions.left - text.width;
5492
+ } else {
5493
+ changeOptions.scaleX = 0.75;
5494
+ changeOptions.scaleY = 0.75;
5495
+ changeOptions.originY = 'bottom';
5496
+ changeOptions.top = baseY + 1.5;
5497
+ changeOptions.backgroundColor = 'transparent';
5498
+
5499
+ if (leftLimit.x1 == this.propItems.originX) {
5500
+ changeOptions.originX = 'left';
5501
+ changeOptions.left = leftLimit.x1 + this.textMarginLeft;
5502
+ }
5503
+
5504
+ if (rightLimit.x2 == this.propItems.endX) {
5505
+ changeOptions.originX = 'right';
5506
+ changeOptions.left = rightLimit.x2 - this.textMarginLeft;
5507
+ }
5508
+ }
5509
+
5510
+ text.setCoords().set(changeOptions);
5511
+ },
5466
5512
 
5467
5513
  /**
5468
5514
  * @description: 画-|-样式的组
@@ -5477,7 +5523,7 @@ var FabricLinesvue_type_script_lang_js_rightClickNode = [{
5477
5523
  var _this6 = this;
5478
5524
 
5479
5525
  return Object(asyncToGenerator["a" /* default */])( /*#__PURE__*/regeneratorRuntime.mark(function _callee2() {
5480
- var id, point, left, position, customIcon, isContinue, line, common, _this6$linesObj$dataL, dataLineStyle, _customIcon, rect;
5526
+ var id, point, left, position, customIcon, isContinue, halfH, line, common, _this6$linesObj$dataL, dataLineStyle, _customIcon, rect;
5481
5527
 
5482
5528
  return regeneratorRuntime.wrap(function _callee2$(_context2) {
5483
5529
  while (1) {
@@ -5485,12 +5531,13 @@ var FabricLinesvue_type_script_lang_js_rightClickNode = [{
5485
5531
  case 0:
5486
5532
  id = '_lineGroup_' + Date.now();
5487
5533
  position = others.position, customIcon = others.customIcon, isContinue = others.isContinue;
5534
+ halfH = (y2 - y1) / 2;
5488
5535
 
5489
5536
  if (position === 'left') {
5490
- point = [x1, y1, x1, y2];
5537
+ point = [x1, y1, x1, y2 - halfH + 1];
5491
5538
  left = x1 - _this6.propItems.xCellWidth / 2;
5492
5539
  } else {
5493
- point = [x2, y1, x2, y2];
5540
+ point = [x2, y1, x2, y2 - halfH + 1];
5494
5541
  left = x2 - _this6.propItems.xCellWidth / 2;
5495
5542
  }
5496
5543
 
@@ -5501,37 +5548,37 @@ var FabricLinesvue_type_script_lang_js_rightClickNode = [{
5501
5548
  _this6$linesObj$dataL = _this6.linesObj.dataLineStyle, dataLineStyle = _this6$linesObj$dataL === void 0 ? {} : _this6$linesObj$dataL;
5502
5549
 
5503
5550
  if (!customIcon) {
5504
- _context2.next = 12;
5551
+ _context2.next = 13;
5505
5552
  break;
5506
5553
  }
5507
5554
 
5508
5555
  _customIcon = _this6.linesObj.customIcon || {
5509
5556
  type: 'circle'
5510
5557
  };
5511
- _context2.next = 9;
5558
+ _context2.next = 10;
5512
5559
  return _this6.createPoint(_customIcon.type, Object(objectSpread2["a" /* default */])(Object(objectSpread2["a" /* default */])(Object(objectSpread2["a" /* default */])(Object(objectSpread2["a" /* default */])({
5513
5560
  left: x1,
5514
- top: y1 + (y2 - y1) / 2,
5561
+ top: y1 + halfH,
5515
5562
  originY: 'center'
5516
5563
  }, dataLineStyle), dataLineStyle.stroke ? {
5517
5564
  fill: dataLineStyle.stroke
5518
5565
  } : {}), _customIcon.style || {}), common));
5519
5566
 
5520
- case 9:
5567
+ case 10:
5521
5568
  line = _context2.sent;
5522
- _context2.next = 20;
5569
+ _context2.next = 21;
5523
5570
  break;
5524
5571
 
5525
- case 12:
5572
+ case 13:
5526
5573
  if (!isContinue) {
5527
- _context2.next = 18;
5574
+ _context2.next = 19;
5528
5575
  break;
5529
5576
  }
5530
5577
 
5531
- _context2.next = 15;
5578
+ _context2.next = 16;
5532
5579
  return _this6.createArrow(Object(objectSpread2["a" /* default */])(Object(objectSpread2["a" /* default */])({
5533
5580
  left: x2,
5534
- top: y1 + (y2 - y1) / 2 - 3.5,
5581
+ top: y1 + halfH - 3.5,
5535
5582
  originY: 'bottom',
5536
5583
  originX: 'right',
5537
5584
  fill: 'transparent',
@@ -5540,18 +5587,18 @@ var FabricLinesvue_type_script_lang_js_rightClickNode = [{
5540
5587
  angle: 270
5541
5588
  }, dataLineStyle), common));
5542
5589
 
5543
- case 15:
5590
+ case 16:
5544
5591
  _context2.t0 = _context2.sent;
5545
- _context2.next = 19;
5592
+ _context2.next = 20;
5546
5593
  break;
5547
5594
 
5548
- case 18:
5595
+ case 19:
5549
5596
  _context2.t0 = _this6.drawLine(point, Object(objectSpread2["a" /* default */])(Object(objectSpread2["a" /* default */])({}, dataLineStyle), common));
5550
5597
 
5551
- case 19:
5598
+ case 20:
5552
5599
  line = _context2.t0;
5553
5600
 
5554
- case 20:
5601
+ case 21:
5555
5602
  rect = new _this6.fabric.Rect({
5556
5603
  width: _this6.propItems.xCellWidth,
5557
5604
  height: y2 - y1,
@@ -5575,7 +5622,7 @@ var FabricLinesvue_type_script_lang_js_rightClickNode = [{
5575
5622
 
5576
5623
  })));
5577
5624
 
5578
- case 22:
5625
+ case 23:
5579
5626
  case "end":
5580
5627
  return _context2.stop();
5581
5628
  }
@@ -5603,24 +5650,30 @@ var FabricLinesvue_type_script_lang_js_rightClickNode = [{
5603
5650
  var _this8 = this;
5604
5651
 
5605
5652
  var line = attr.line,
5606
- line1 = attr.line1,
5607
- line2 = attr.line2,
5653
+ centerLine = attr.centerLine,
5608
5654
  text = attr.text,
5609
5655
  textObj = attr.textObj,
5656
+ leftLimit = attr.leftLimit,
5657
+ rightLimit = attr.rightLimit,
5610
5658
  limitX = attr.limitX,
5611
5659
  startTime = attr.startTime,
5612
5660
  endTime = attr.endTime,
5613
5661
  preText = attr.preText,
5614
- textLimitRight = attr.textLimitRight;
5662
+ __position = attr.__position,
5663
+ __range = attr.__range,
5664
+ __baseY = attr.__baseY;
5615
5665
 
5616
5666
  if (line) {
5617
5667
  line.hasControls = line.hasBorders = false;
5618
- line1 && (line.line1 = line1);
5619
- line2 && (line.line2 = line2);
5668
+ centerLine && (line.centerLine = centerLine);
5620
5669
  text && (line.text = text);
5621
5670
  line.limitX = limitX;
5622
5671
  preText && (line.preText = preText);
5623
- textLimitRight && (line.textLimitRight = textLimitRight);
5672
+ line.leftLimit = leftLimit;
5673
+ line.rightLimit = rightLimit;
5674
+ line.__position = __position;
5675
+ line.__range = __range;
5676
+ line.__baseY = __baseY;
5624
5677
  this.hoverEvent(line, {
5625
5678
  textObj: textObj,
5626
5679
  startTime: startTime,
@@ -5630,8 +5683,6 @@ var FabricLinesvue_type_script_lang_js_rightClickNode = [{
5630
5683
  line.on('moving', function () {
5631
5684
  _this8.lineMoveLimit(line);
5632
5685
 
5633
- _this8.lineMoveUpdateLine(line);
5634
-
5635
5686
  _this8.textUpdatePositionX(line); // this.canvas.renderAll();
5636
5687
 
5637
5688
 
@@ -5789,65 +5840,29 @@ var FabricLinesvue_type_script_lang_js_rightClickNode = [{
5789
5840
  if (line.left > line.limitX.x2) {
5790
5841
  line.set('left', line.limitX.x2);
5791
5842
  }
5792
- },
5793
- lineMoveUpdateLine: function lineMoveUpdateLine(line) {
5794
- if (line.line1) {
5795
- line.line1.setCoords().set({
5796
- x1: line.left
5797
- });
5798
- }
5799
5843
 
5800
- if (line.line2) {
5801
- line.line2.setCoords().set({
5844
+ if (line.centerLine) {
5845
+ var options = line.__position === 'left' ? {
5846
+ x1: line.left
5847
+ } : {
5802
5848
  x2: line.left
5803
- });
5849
+ };
5850
+ line.centerLine.setCoords().set(options);
5804
5851
  }
5805
5852
  },
5806
5853
  textUpdatePositionX: function textUpdatePositionX(line) {
5807
5854
  var text = line.text || null;
5808
5855
 
5809
5856
  if (text) {
5810
- // 如果line2存在说明当前拖动的是右边手柄,line1存在则是左边手柄,都不存在说明不存在中间线
5811
- var centerLine = line.line1 || line.line2 || null;
5812
- var left = line.left;
5813
-
5814
- var _limitWidth = text.width + 2;
5815
-
5816
- var originX = text.originX;
5817
- var v;
5818
-
5819
- if ((centerLine === null || centerLine === void 0 ? void 0 : centerLine.x2) - (centerLine === null || centerLine === void 0 ? void 0 : centerLine.x1) > _limitWidth) {
5820
- v = left + centerLine.width / 2 * (line.line2 ? -1 : 1);
5821
- originX = 'center';
5822
- } else {
5823
- v = this.textMarginLeft + (centerLine ? centerLine.x2 : left + 3);
5824
- originX = 'left'; // 移动到最右边界时候文字超出当前线段可拖动的右边界的情况
5825
-
5826
- if (line.textLimitRight && v + _limitWidth > line.textLimitRight) {
5827
- v = this.propItems.endX + 100; // 此值随便设置,只要达到隐藏效果即可
5828
- }
5829
- }
5830
-
5831
- text.setCoords();
5832
- text.set({
5833
- left: v,
5834
- originX: originX
5835
- });
5836
- } // 拖动左侧竖线时需要更改上一线段文字的位置,以防止文字被遮挡
5837
-
5838
-
5839
- var preText = line.preText || null;
5840
- if (!preText) return;
5841
- var limitWidth = preText.width + 2;
5842
-
5843
- if (preText.originX === 'left' && preText.left + limitWidth > line.left) {
5844
- var _v = this.propItems.endX + 100; // 此值随便设置,只要达到隐藏效果即可
5845
-
5846
-
5847
- preText.setCoords();
5848
- preText.set({
5849
- left: _v
5850
- });
5857
+ var __baseY = line.__baseY,
5858
+ __range = line.__range,
5859
+ leftLimit = line.leftLimit,
5860
+ rightLimit = line.rightLimit,
5861
+ __position = line.__position;
5862
+ var x1 = __position === 'left' ? line.left : __range[0];
5863
+ var x2 = __position === 'right' ? line.left : __range[1];
5864
+ var top = __baseY - this.propItems.yCellHeightTop / 2;
5865
+ this.setTextPosition(text, top, x1, x2, leftLimit, rightLimit, __baseY);
5851
5866
  }
5852
5867
  },
5853
5868
  repaintLine: function repaintLine() {
@@ -5873,8 +5888,8 @@ var FabricLinesvue_type_script_lang_js_rightClickNode = [{
5873
5888
 
5874
5889
  var FabricLines_component = Object(componentNormalizer["a" /* default */])(
5875
5890
  fabric_chart_FabricLinesvue_type_script_lang_js_,
5876
- FabricLinesvue_type_template_id_a683fbc4_render,
5877
- FabricLinesvue_type_template_id_a683fbc4_staticRenderFns,
5891
+ FabricLinesvue_type_template_id_e835fd06_render,
5892
+ FabricLinesvue_type_template_id_e835fd06_staticRenderFns,
5878
5893
  false,
5879
5894
  null,
5880
5895
  null,