next-element-vue 0.3.2 → 0.3.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.umd.js CHANGED
@@ -2,8 +2,8 @@
2
2
  /**
3
3
  * 作  者:huangteng
4
4
  * 邮  箱:htengweb@163.com
5
- * 当前版本:0.3.2 v
6
- * 发布日期:2024-06-27
5
+ * 当前版本:0.3.4 v
6
+ * 发布日期:2024-08-10
7
7
  * 地  址:https://www.npmjs.com/package/next-element-vue
8
8
  */
9
9
 
@@ -491,8 +491,8 @@
491
491
  }(result, symbolsFunc(object));
492
492
  }(object, keys, getSymbols$1);
493
493
  }
494
- var DataView = getNative(root, "DataView"), Promise$1 = getNative(root, "Promise"), Set = getNative(root, "Set"), dataViewCtorString = toSource(DataView), mapCtorString = toSource(Map$1), promiseCtorString = toSource(Promise$1), setCtorString = toSource(Set), weakMapCtorString = toSource(WeakMap), getTag = baseGetTag;
495
- (DataView && "[object DataView]" != getTag(new DataView(new ArrayBuffer(1))) || Map$1 && "[object Map]" != getTag(new Map$1) || Promise$1 && "[object Promise]" != getTag(Promise$1.resolve()) || Set && "[object Set]" != getTag(new Set) || WeakMap && "[object WeakMap]" != getTag(new WeakMap)) && (getTag = function(value) {
494
+ var DataView = getNative(root, "DataView"), Promise$1 = getNative(root, "Promise"), Set$1 = getNative(root, "Set"), dataViewCtorString = toSource(DataView), mapCtorString = toSource(Map$1), promiseCtorString = toSource(Promise$1), setCtorString = toSource(Set$1), weakMapCtorString = toSource(WeakMap), getTag = baseGetTag;
495
+ (DataView && "[object DataView]" != getTag(new DataView(new ArrayBuffer(1))) || Map$1 && "[object Map]" != getTag(new Map$1) || Promise$1 && "[object Promise]" != getTag(Promise$1.resolve()) || Set$1 && "[object Set]" != getTag(new Set$1) || WeakMap && "[object WeakMap]" != getTag(new WeakMap)) && (getTag = function(value) {
496
496
  var result = baseGetTag(value), Ctor = "[object Object]" == result ? value.constructor : void 0, ctorString = Ctor ? toSource(Ctor) : "";
497
497
  if (ctorString) switch (ctorString) {
498
498
  case dataViewCtorString:
@@ -798,6 +798,12 @@
798
798
  saveLabel: "保存当前标注",
799
799
  instructions: "使用说明",
800
800
  labelNoUpdate: "暂无标签数据更新"
801
+ },
802
+ labelme: {
803
+ saveLabel: "保存",
804
+ createPolygon: "创建多边形",
805
+ editPolygon: "编辑多边形",
806
+ deletePolyton: "删除多边形"
801
807
  }
802
808
  }
803
809
  }, enLocale = {
@@ -876,6 +882,12 @@
876
882
  saveLabel: "save label",
877
883
  instructions: "instructions",
878
884
  labelNoUpdate: "No label data update"
885
+ },
886
+ labelme: {
887
+ saveLabel: "saving...",
888
+ createPolygon: "create polygon",
889
+ editPolygon: "edit polygon",
890
+ deletePolyton: "delete polygon"
879
891
  }
880
892
  }
881
893
  }, zhtwLocale = {
@@ -954,6 +966,9 @@
954
966
  saveLabel: "保存当前标注",
955
967
  instructions: "使用说明",
956
968
  labelNoUpdate: "暂无标签数据更新"
969
+ },
970
+ labelme: {
971
+ saveLabel: "保存"
957
972
  }
958
973
  }
959
974
  };
@@ -988,6 +1003,14 @@
988
1003
  for (let i = 0; i < 3; i++) hexs[i] = parseInt(hexs[i], 16);
989
1004
  return hexs;
990
1005
  },
1006
+ hexToRgba: (str, alpha = 1) => {
1007
+ let hexs = "";
1008
+ if (!/^\#?[0-9A-Fa-f]{6}$/.test(str)) return elementPlus.ElMessage.warning("输入错误的hex"),
1009
+ "";
1010
+ hexs = (str = str.replace("#", "")).match(/../g);
1011
+ for (let i = 0; i < 3; i++) hexs[i] = parseInt(hexs[i], 16);
1012
+ return `rgba(${hexs.join(",")},${alpha})`;
1013
+ },
991
1014
  rgbToHex: (r, g, b) => {
992
1015
  let reg = /^\d{1,3}$/;
993
1016
  if (!reg.test(r) || !reg.test(g) || !reg.test(b)) return elementPlus.ElMessage.warning("输入错误的rgb颜色值"),
@@ -1082,7 +1105,7 @@
1082
1105
  }, extra) for (const [key, comp] of Object.entries(extra)) main[key] = comp;
1083
1106
  return main;
1084
1107
  }, slots_config_headerMenu = "header-menu", slots_config_headerToolsPrefix = "header-tools-prefix", slots_config_headerToolsSuffix = "header-tools-suffix";
1085
- var defaultConfig$4 = {
1108
+ var defaultConfig$5 = {
1086
1109
  logo: "",
1087
1110
  title: "Next Element Vue",
1088
1111
  userName: "Admin",
@@ -1129,7 +1152,7 @@
1129
1152
  isDark: !1
1130
1153
  }
1131
1154
  };
1132
- const ns$k = useNamespace("text-ellipsis");
1155
+ const ns$l = useNamespace("text-ellipsis");
1133
1156
  const NextTextEllipsis = withInstall(vue.defineComponent({
1134
1157
  name: "NextTextEllipsis",
1135
1158
  props: {
@@ -1175,7 +1198,7 @@
1175
1198
  }
1176
1199
  };
1177
1200
  return () => vue.createVNode(vue.Fragment, null, [ vue.createVNode("div", {
1178
- class: [ ns$k.b(), props.class ],
1201
+ class: [ ns$l.b(), props.class ],
1179
1202
  style: setWidth.value,
1180
1203
  onMouseenter: onMouseenter
1181
1204
  }, [ isTip.value ? vue.createVNode(elementPlus.ElTooltip, {
@@ -1185,11 +1208,11 @@
1185
1208
  disabled: props.disabled
1186
1209
  }, {
1187
1210
  default: () => [ vue.createVNode("span", {
1188
- class: ns$k.e("text"),
1211
+ class: ns$l.e("text"),
1189
1212
  ref: ellipsisRef
1190
1213
  }, [ slots.default ? slots.default() : props.content ]) ]
1191
1214
  }) : vue.createVNode("span", {
1192
- class: ns$k.e("text"),
1215
+ class: ns$l.e("text"),
1193
1216
  ref: ellipsisRef
1194
1217
  }, [ slots.default ? slots.default() : props.content ]) ]) ]);
1195
1218
  }
@@ -2524,7 +2547,7 @@
2524
2547
  }, null) ]
2525
2548
  }))) ]) ]);
2526
2549
  }
2527
- }), ns$j = useNamespace("menu");
2550
+ }), ns$k = useNamespace("menu");
2528
2551
  const NextMenu = withInstall(vue.defineComponent({
2529
2552
  name: "NextMenu",
2530
2553
  props: {
@@ -2551,13 +2574,13 @@
2551
2574
  }
2552
2575
  },
2553
2576
  setup(props) {
2554
- vue.provide("ns", ns$j);
2577
+ vue.provide("ns", ns$k);
2555
2578
  const router = vue.getCurrentInstance().appContext.config.globalProperties.$router, currentPath = router.currentRoute?.value.fullPath, activePath = vue.ref(currentPath);
2556
2579
  vue.watch((() => router.currentRoute?.value), (to => {
2557
2580
  activePath.value = to.fullPath;
2558
2581
  }));
2559
2582
  return () => vue.createVNode(vue.Fragment, null, [ vue.createVNode(elementPlus.ElMenu, {
2560
- class: [ ns$j.b(), props.className ],
2583
+ class: [ ns$k.b(), props.className ],
2561
2584
  style: props.style,
2562
2585
  defaultActive: activePath.value,
2563
2586
  router: props.router,
@@ -2565,7 +2588,7 @@
2565
2588
  ellipsis: !0
2566
2589
  }, {
2567
2590
  default: () => [ vue.createVNode(vue.Fragment, null, [ props.menuTree.map((item => item.children?.length ? valueExist(item.meta?.isHide, !1) ? null : vue.createVNode(elementPlus.ElSubMenu, {
2568
- "popper-class": ns$j.b("popper"),
2591
+ "popper-class": ns$k.b("popper"),
2569
2592
  index: item.path || item.id,
2570
2593
  teleported: !0
2571
2594
  }, {
@@ -2576,7 +2599,7 @@
2576
2599
  menuData: item.children
2577
2600
  }, null)
2578
2601
  }) : valueExist(item.meta?.isHide, !1) ? null : vue.createVNode(elementPlus.ElMenuItem, {
2579
- "popper-class": ns$j.b("popper"),
2602
+ "popper-class": ns$k.b("popper"),
2580
2603
  index: item.path
2581
2604
  }, {
2582
2605
  default: () => [ vue.createVNode(MenuItemTitle, {
@@ -2602,19 +2625,19 @@
2602
2625
  }) ]);
2603
2626
  }
2604
2627
  });
2605
- const ns$i = useNamespace("layout-defaults");
2628
+ const ns$j = useNamespace("layout-defaults");
2606
2629
  var defaults = vue.defineComponent({
2607
2630
  props: {},
2608
- setup: () => (vue.provide("ns", ns$i), {}),
2631
+ setup: () => (vue.provide("ns", ns$j), {}),
2609
2632
  render() {
2610
2633
  const slots = this.$slots, _config = vue.inject("options", {}), _emit = vue.inject("__emit__", {});
2611
2634
  slots.menu;
2612
2635
  const isTabs = vue.ref(!!slots.tabs);
2613
2636
  return void 0 === slots.tabs && _config.showTabs && (isTabs.value = !0), vue.createVNode(elementPlus.ElContainer, {
2614
- class: ns$i.b()
2637
+ class: ns$j.b()
2615
2638
  }, {
2616
2639
  default: () => [ vue.createVNode(Sidebar$2, null, null), vue.createVNode("div", {
2617
- class: [ ns$i.b("content") ]
2640
+ class: [ ns$j.b("content") ]
2618
2641
  }, [ vue.createVNode(Header$3, null, null), _config.showTabs ? slots.tabs ? slots.tabs?.() : vue.createVNode(NextTabs, {
2619
2642
  tabs: _config.tabs,
2620
2643
  activeTab: _config.activeTab,
@@ -2622,7 +2645,7 @@
2622
2645
  onSelect: (...arg) => _emit("tabsSelect", ...arg),
2623
2646
  onClose: (...arg) => _emit("tabsClose", ...arg)
2624
2647
  }, null) : null, vue.createVNode("main", {
2625
- class: [ ns$i.bf("main"), ns$i.is("layout-tabs", isTabs.value) ]
2648
+ class: [ ns$j.bf("main"), ns$j.is("layout-tabs", isTabs.value) ]
2626
2649
  }, [ slots.default?.() ]) ]) ]
2627
2650
  });
2628
2651
  }
@@ -2652,10 +2675,10 @@
2652
2675
  }) ]) ]) ]);
2653
2676
  }
2654
2677
  });
2655
- const ns$h = useNamespace("layout-transverse");
2678
+ const ns$i = useNamespace("layout-transverse");
2656
2679
  var transverse = vue.defineComponent({
2657
2680
  props: {},
2658
- setup: () => (vue.provide("ns", ns$h), {}),
2681
+ setup: () => (vue.provide("ns", ns$i), {}),
2659
2682
  render() {
2660
2683
  const slots = this.$slots, _config = vue.inject("options", {}), _emit = vue.inject("__emit__", {}), __slots_header = {};
2661
2684
  slots[slots_config_headerMenu] && (__slots_header[slots_config_headerMenu] = () => slots[slots_config_headerMenu]()),
@@ -2672,7 +2695,7 @@
2672
2695
  onSelect: (...arg) => _emit("tabsSelect", ...arg),
2673
2696
  onClose: (...arg) => _emit("tabsClose", ...arg)
2674
2697
  }, null) : null, vue.createVNode("main", {
2675
- class: [ ns$h.b("main"), ns$h.is("layout-tabs", isTabs.value) ]
2698
+ class: [ ns$i.b("main"), ns$i.is("layout-tabs", isTabs.value) ]
2676
2699
  }, [ slots.default?.() ]) ]);
2677
2700
  var s;
2678
2701
  }
@@ -2711,10 +2734,10 @@
2711
2734
  }, null) ]);
2712
2735
  }
2713
2736
  });
2714
- const ns$g = useNamespace("layout-columns");
2737
+ const ns$h = useNamespace("layout-columns");
2715
2738
  var columns = vue.defineComponent({
2716
2739
  props: {},
2717
- setup: () => (vue.provide("ns", ns$g), {}),
2740
+ setup: () => (vue.provide("ns", ns$h), {}),
2718
2741
  render() {
2719
2742
  const slots = this.$slots, _config = vue.inject("options", {}), _emit = vue.inject("__emit__", {}), __slots_header = {};
2720
2743
  slots[slots_config_headerMenu] && (__slots_header[slots_config_headerMenu] = () => slots[slots_config_headerMenu]()),
@@ -2722,11 +2745,11 @@
2722
2745
  slots[slots_config_headerToolsSuffix] && (__slots_header[slots_config_headerToolsSuffix] = () => slots[slots_config_headerToolsSuffix]());
2723
2746
  const isTabs = vue.ref(!!slots.tabs);
2724
2747
  return void 0 === slots.tabs && _config.showTabs && (isTabs.value = !0), vue.createVNode(elementPlus.ElContainer, {
2725
- class: ns$g.b()
2748
+ class: ns$h.b()
2726
2749
  }, {
2727
2750
  default: () => {
2728
2751
  return [ vue.createVNode(Sidebar$1, null, null), vue.createVNode("div", {
2729
- class: [ ns$g.b("content") ]
2752
+ class: [ ns$h.b("content") ]
2730
2753
  }, [ vue.createVNode(Header$1, null, (s = __slots_header, "function" == typeof s || "[object Object]" === Object.prototype.toString.call(s) && !vue.isVNode(s) ? __slots_header : {
2731
2754
  default: () => [ __slots_header ]
2732
2755
  })), _config.showTabs ? slots.tabs ? slots.tabs?.() : vue.createVNode(NextTabs, {
@@ -2736,7 +2759,7 @@
2736
2759
  onSelect: (...arg) => _emit("tabsSelect", ...arg),
2737
2760
  onClose: (...arg) => _emit("tabsClose", ...arg)
2738
2761
  }, null) : null, vue.createVNode("main", {
2739
- class: [ ns$g.bf("main"), ns$g.is("layout-tabs", isTabs.value) ]
2762
+ class: [ ns$h.bf("main"), ns$h.is("layout-tabs", isTabs.value) ]
2740
2763
  }, [ slots.default?.() ]) ]) ];
2741
2764
  var s;
2742
2765
  }
@@ -2779,20 +2802,20 @@
2779
2802
  }) ]);
2780
2803
  }
2781
2804
  });
2782
- const ns$f = useNamespace("layout-classic");
2805
+ const ns$g = useNamespace("layout-classic");
2783
2806
  var classic = vue.defineComponent({
2784
2807
  props: {},
2785
- setup: () => (vue.provide("ns", ns$f), {
2786
- ns: ns$f
2808
+ setup: () => (vue.provide("ns", ns$g), {
2809
+ ns: ns$g
2787
2810
  }),
2788
2811
  render() {
2789
2812
  const slots = this.$slots, _config = vue.inject("options", {}), _emit = vue.inject("__emit__", {});
2790
2813
  slots.menu;
2791
2814
  const isTabs = vue.ref(!!slots.tabs);
2792
2815
  return void 0 === slots.tabs && _config.showTabs && (isTabs.value = !0), vue.createVNode(vue.Fragment, null, [ vue.createVNode(Header, null, null), vue.createVNode("div", {
2793
- class: [ ns$f.b("content"), ns$f.is("layout-tabs", isTabs.value) ]
2816
+ class: [ ns$g.b("content"), ns$g.is("layout-tabs", isTabs.value) ]
2794
2817
  }, [ vue.createVNode(Sidebar, null, null), vue.createVNode("div", {
2795
- class: ns$f.b("container")
2818
+ class: ns$g.b("container")
2796
2819
  }, [ _config.showTabs ? slots.tabs ? slots.tabs?.() : vue.createVNode(NextTabs, {
2797
2820
  tabs: _config.tabs,
2798
2821
  activeTab: _config.activeTab,
@@ -2800,11 +2823,11 @@
2800
2823
  onSelect: (...arg) => _emit("tabsSelect", ...arg),
2801
2824
  onClose: (...arg) => _emit("tabsClose", ...arg)
2802
2825
  }, null) : null, vue.createVNode("main", {
2803
- class: [ ns$f.b("main") ]
2826
+ class: [ ns$g.b("main") ]
2804
2827
  }, [ slots.default?.() ]) ]) ]) ]);
2805
2828
  }
2806
2829
  });
2807
- const ns$e = useNamespace("layout"), layouts = {
2830
+ const ns$f = useNamespace("layout"), layouts = {
2808
2831
  defaults: vue.markRaw(defaults),
2809
2832
  transverse: vue.markRaw(transverse),
2810
2833
  columns: vue.markRaw(columns),
@@ -2830,8 +2853,8 @@
2830
2853
  },
2831
2854
  emits: [ "changeLanguage", "changeUserDropdown", "changeOptions", "tabsChange", "tabsSelect", "tabsClose" ],
2832
2855
  setup(props, {slots: slots, emit: emit}) {
2833
- const _config = vue.ref(mergeWith(defaultConfig$4, props.options, customizerCoverArray));
2834
- vue.provide("options", _config.value), vue.provide("__ns__", ns$e), vue.provide("__emit__", emit),
2856
+ const _config = vue.ref(mergeWith(defaultConfig$5, props.options, customizerCoverArray));
2857
+ vue.provide("options", _config.value), vue.provide("__ns__", ns$f), vue.provide("__emit__", emit),
2835
2858
  vue.provide("__slots__", slots);
2836
2859
  const updateOptions = cfg => {
2837
2860
  _config.value = mergeWith(_config.value, cfg, customizerCoverArray), updateThemeColorCssVar(_config.value?.setting),
@@ -2855,14 +2878,14 @@
2855
2878
  const _activeSlots = {};
2856
2879
  for (const key in slots) Object.prototype.hasOwnProperty.call(slots, key) && (_activeSlots[key] = () => slots[key]?.());
2857
2880
  return vue.createVNode("div", {
2858
- class: [ ns$e.b(), props.className ],
2881
+ class: [ ns$f.b(), props.className ],
2859
2882
  style: props.style
2860
2883
  }, [ vue.h(activeLayout.value, {}, {
2861
2884
  ..._activeSlots
2862
2885
  }) ]);
2863
2886
  }
2864
- })), ns$d = useNamespace("tabs");
2865
- var Element$8 = vue.defineComponent({
2887
+ })), ns$e = useNamespace("tabs");
2888
+ var Element$9 = vue.defineComponent({
2866
2889
  name: "NextTabs",
2867
2890
  props: {
2868
2891
  activeTab: {
@@ -2931,12 +2954,12 @@
2931
2954
  tabsView.value.push(activeRoute)), emit("change", activeIndex.value, tabsView.value, "add");
2932
2955
  }));
2933
2956
  const renderContent = () => vue.createVNode("nav", {
2934
- class: ns$d.b()
2957
+ class: ns$e.b()
2935
2958
  }, [ vue.createVNode(elementPlus.ElScrollbar, null, {
2936
2959
  default: () => [ vue.createVNode("ul", {
2937
- class: ns$d.b("list")
2960
+ class: ns$e.b("list")
2938
2961
  }, [ tabsView.value.map(((tab, index) => tab ? vue.createVNode("li", {
2939
- class: [ "tab-item", ns$d.is("active", activeIndex.value === index) ],
2962
+ class: [ "tab-item", ns$e.is("active", activeIndex.value === index) ],
2940
2963
  onClick: event => onClickTabItem(event, tab, index)
2941
2964
  }, [ vue.createVNode("i", {
2942
2965
  class: [ "tab-icon", tab.meta?.icon ]
@@ -2967,11 +2990,11 @@
2967
2990
  onCommand: onChange
2968
2991
  }, {
2969
2992
  default: () => vue.createVNode("span", {
2970
- class: ns$d.b("tab-more")
2993
+ class: ns$e.b("tab-more")
2971
2994
  }, [ vue.createVNode("i", {
2972
- class: [ ns$d.be("tab-more", "box"), ns$d.be("tab-more", "top") ]
2995
+ class: [ ns$e.be("tab-more", "box"), ns$e.be("tab-more", "top") ]
2973
2996
  }, null), vue.createVNode("i", {
2974
- class: [ ns$d.be("tab-more", "box"), ns$d.be("tab-more", "bottom") ]
2997
+ class: [ ns$e.be("tab-more", "box"), ns$e.be("tab-more", "bottom") ]
2975
2998
  }, null) ]),
2976
2999
  dropdown: () => vue.createVNode(elementPlus.ElDropdownMenu, null, {
2977
3000
  default: () => [ vue.createVNode(elementPlus.ElDropdownItem, {
@@ -3004,7 +3027,7 @@
3004
3027
  return () => vue.createVNode(vue.Fragment, null, [ renderContent() ]);
3005
3028
  }
3006
3029
  });
3007
- const NextTabs = withInstall(Element$8), ns$c = useNamespace("container");
3030
+ const NextTabs = withInstall(Element$9), ns$d = useNamespace("container");
3008
3031
  const NextContainer = withInstall(vue.defineComponent({
3009
3032
  name: "NextContainer",
3010
3033
  props: {
@@ -3042,18 +3065,18 @@
3042
3065
  }), style;
3043
3066
  }));
3044
3067
  return () => props.scrollbar ? vue.createVNode(elementPlus.ElScrollbar, {
3045
- class: [ ns$c.b(), props.className ],
3068
+ class: [ ns$d.b(), props.className ],
3046
3069
  style: props.style
3047
3070
  }, {
3048
3071
  default: () => [ slots.default?.() ]
3049
3072
  }) : vue.createVNode("div", {
3050
- class: [ ns$c.b(), props.className ],
3073
+ class: [ ns$d.b(), props.className ],
3051
3074
  style: {
3052
3075
  ...styles.value,
3053
3076
  ...props.style
3054
3077
  }
3055
3078
  }, [ props.card ? vue.createVNode("div", {
3056
- class: ns$c.b("card")
3079
+ class: ns$d.b("card")
3057
3080
  }, [ slots.default?.() ]) : slots.default?.() ]);
3058
3081
  }
3059
3082
  }));
@@ -3127,7 +3150,7 @@
3127
3150
  }
3128
3151
  };
3129
3152
  const header_menu_slots_key = [ "menu-left-prefix", "menu-left-suffix", "menu-right-prefix", "menu-right-suffix" ], operation_column_slots_key = [ "operation-column-prefix", "operation-column-suffix" ];
3130
- var defaultConfig$3 = {
3153
+ var defaultConfig$4 = {
3131
3154
  initLoadData: !0,
3132
3155
  defaultContentHeight: 300,
3133
3156
  fullscreenchangeContentHeight: !1,
@@ -3175,7 +3198,7 @@
3175
3198
  formSpan: 12,
3176
3199
  formColumnMinWidth: 350
3177
3200
  };
3178
- const columnSlotName = prop => "column-" + prop, searchFormSlotName = prop => "search-" + prop, formSlotName = prop => "form-" + prop, ns$b = useNamespace("spin-loading");
3201
+ const columnSlotName = prop => "column-" + prop, searchFormSlotName = prop => "search-" + prop, formSlotName = prop => "form-" + prop, ns$c = useNamespace("spin-loading");
3179
3202
  var NextSpinLoading$1 = vue.defineComponent({
3180
3203
  name: "NextSpinLoading",
3181
3204
  props: {
@@ -3209,22 +3232,22 @@
3209
3232
  const _t = this.t, slots = this.$slots, props = this.$props, loadingText = props.tip || _t("next.loading");
3210
3233
  return vue.createVNode("div", {
3211
3234
  ref: "elementInstance",
3212
- class: [ ns$b.b(), props.className ],
3235
+ class: [ ns$c.b(), props.className ],
3213
3236
  style: props.style
3214
3237
  }, [ slots.default?.(), props.loading ? vue.createVNode("div", {
3215
- class: ns$b.b("mask")
3238
+ class: ns$c.b("mask")
3216
3239
  }, [ vue.createVNode("span", {
3217
- class: ns$b.b("mask-dot")
3240
+ class: ns$c.b("mask-dot")
3218
3241
  }, [ vue.createVNode("i", {
3219
- class: ns$b.be("mask", "dot-item")
3242
+ class: ns$c.be("mask", "dot-item")
3220
3243
  }, null), vue.createVNode("i", {
3221
- class: ns$b.be("mask", "dot-item")
3244
+ class: ns$c.be("mask", "dot-item")
3222
3245
  }, null), vue.createVNode("i", {
3223
- class: ns$b.be("mask", "dot-item")
3246
+ class: ns$c.be("mask", "dot-item")
3224
3247
  }, null), vue.createVNode("i", {
3225
- class: ns$b.be("mask", "dot-item")
3248
+ class: ns$c.be("mask", "dot-item")
3226
3249
  }, null) ]), vue.createVNode("span", {
3227
- class: ns$b.be("mask", "text")
3250
+ class: ns$c.be("mask", "text")
3228
3251
  }, [ loadingText ]) ]) : null ]);
3229
3252
  }
3230
3253
  }), SearchColumn = vue.defineComponent({
@@ -3281,7 +3304,7 @@
3281
3304
  return start.setTime(start.getTime() - 94608e6), [ start, end ];
3282
3305
  }
3283
3306
  } ], _onChangeNumberRange = (value, key) => {
3284
- formParams.value[key] = value;
3307
+ formParams[key] = value;
3285
3308
  }, renderColItemContent = col => {
3286
3309
  const _disabled = valueExist(col.searchDisabled, col.disabled, !1);
3287
3310
  if (slots[searchFormSlotName(col.prop)]) return slots[searchFormSlotName(col.prop)]({
@@ -3312,7 +3335,7 @@
3312
3335
  placeholder: placeholder,
3313
3336
  onInput: e => ((val, key) => {
3314
3337
  const value = val.replace(/\D/g, "");
3315
- formParams.value[key] = value;
3338
+ formParams[key] = value;
3316
3339
  })(e, col.prop)
3317
3340
  }, {
3318
3341
  prefix: col.prefix ? () => col.prefix(formParams, col) : null,
@@ -3333,7 +3356,7 @@
3333
3356
  let value = val;
3334
3357
  value = value.replace(/[^0-9\.]/g, ""), value = value.replace(/^\./, "0."), value = value.replace(/\.{2,}/g, "."),
3335
3358
  value = value.replace(".", "DUMMY"), value = value.replace(/\./g, ""), value = value.replace("DUMMY", "."),
3336
- formParams.value[key] = value;
3359
+ formParams[key] = value;
3337
3360
  })(e, col.prop)
3338
3361
  }, {
3339
3362
  prefix: col.prefix ? () => col.prefix(formParams, col) : null,
@@ -3911,7 +3934,7 @@
3911
3934
  }, null) ]);
3912
3935
  }
3913
3936
  });
3914
- const ns$a = useNamespace("dialog");
3937
+ const ns$b = useNamespace("dialog");
3915
3938
  var NextDialog$1 = vue.defineComponent({
3916
3939
  name: "NextDialog",
3917
3940
  props: {
@@ -3939,6 +3962,10 @@
3939
3962
  type: Boolean,
3940
3963
  default: !0
3941
3964
  },
3965
+ showClose: {
3966
+ type: Boolean,
3967
+ default: !0
3968
+ },
3942
3969
  appendToBody: {
3943
3970
  type: Boolean,
3944
3971
  default: !1
@@ -3976,7 +4003,7 @@
3976
4003
  return () => vue.createVNode(vue.Fragment, null, [ vue.createVNode(elementPlus.ElDialog, {
3977
4004
  modelValue: visible.value,
3978
4005
  "onUpdate:modelValue": $event => visible.value = $event,
3979
- class: ns$a.b(),
4006
+ class: ns$b.b(),
3980
4007
  title: props.title,
3981
4008
  appendToBody: props.appendToBody,
3982
4009
  "destroy-on-close": !0,
@@ -3993,18 +4020,18 @@
3993
4020
  }, {
3994
4021
  default: () => [ slots.default?.() ],
3995
4022
  header: ({close: close, titleId: titleId, titleClass: titleClass}) => vue.createVNode("div", {
3996
- class: ns$a.b("header")
4023
+ class: ns$b.b("header")
3997
4024
  }, [ vue.createVNode("h4", {
3998
4025
  id: titleId,
3999
4026
  class: titleClass
4000
4027
  }, [ props.title ]), vue.createVNode("div", {
4001
- class: ns$a.e("header-right")
4028
+ class: ns$b.e("header-right")
4002
4029
  }, [ props.fullscreenBtn && vue.createVNode("span", {
4003
4030
  class: "icon-fullscreen",
4004
4031
  onClick: () => isFullscreen.value = !isFullscreen.value
4005
4032
  }, [ vue.createVNode(elementPlus.ElIcon, null, {
4006
4033
  default: () => [ vue.createVNode(full_screen_default, null, null) ]
4007
- }) ]), vue.createVNode("span", {
4034
+ }) ]), props.showClose && vue.createVNode("span", {
4008
4035
  class: "icon-close",
4009
4036
  onClick: close
4010
4037
  }, [ vue.createVNode(elementPlus.ElIcon, {
@@ -4030,7 +4057,7 @@
4030
4057
  settingBtn: !0,
4031
4058
  operations: !1
4032
4059
  };
4033
- var defaultConfig$2 = {
4060
+ var defaultConfig$3 = {
4034
4061
  size: "default",
4035
4062
  colSpan: 8,
4036
4063
  labelWidth: "6em",
@@ -4044,7 +4071,7 @@
4044
4071
  submitText: null,
4045
4072
  resetText: null
4046
4073
  };
4047
- const ns$9 = useNamespace("form");
4074
+ const ns$a = useNamespace("form");
4048
4075
  var NumberRangePicker = vue.defineComponent({
4049
4076
  name: "NumberRangePicker",
4050
4077
  props: {
@@ -4083,7 +4110,7 @@
4083
4110
  }));
4084
4111
  return () => vue.createVNode(vue.Fragment, null, [ vue.createVNode("div", {
4085
4112
  ref: numberRangeRef,
4086
- class: ns$9.e("number-range")
4113
+ class: ns$a.e("number-range")
4087
4114
  }, [ vue.createVNode(elementPlus.ElInputNumber, {
4088
4115
  modelValue: startNumber.value,
4089
4116
  "onUpdate:modelValue": $event => startNumber.value = $event,
@@ -4093,7 +4120,7 @@
4093
4120
  disabled: disabled,
4094
4121
  onChange: onChangeStart
4095
4122
  }, null), vue.createVNode("span", {
4096
- class: ns$9.em("number-range", "division")
4123
+ class: ns$a.em("number-range", "division")
4097
4124
  }, [ t("next.date.rangeSeparator") ]), vue.createVNode(elementPlus.ElInputNumber, {
4098
4125
  modelValue: endNumber.value,
4099
4126
  "onUpdate:modelValue": $event => endNumber.value = $event,
@@ -4109,7 +4136,7 @@
4109
4136
  function _isSlot$3(s) {
4110
4137
  return "function" == typeof s || "[object Object]" === Object.prototype.toString.call(s) && !vue.isVNode(s);
4111
4138
  }
4112
- const ns$8 = useNamespace("form"), InputTableSelect = vue.defineComponent({
4139
+ const ns$9 = useNamespace("form"), InputTableSelect = vue.defineComponent({
4113
4140
  name: "InputTableSelect",
4114
4141
  props: {
4115
4142
  modelValue: {
@@ -4137,7 +4164,7 @@
4137
4164
  },
4138
4165
  emits: [ "select" ],
4139
4166
  setup(props, {emit: emit}) {
4140
- const {t: t} = useLocale(), _disabled = props.disabled, _column = props.column, _placeholder = _column.placeholder || t("next.form.select") + _column.label, _tableDefaultConfig = deepClone(defaultConfig$3), _tableSelectConfig = deepClone(tableSelectConfig), _options = merge$1(_tableDefaultConfig, _tableSelectConfig, _column.tableSelect), tableSelectDialog = vue.reactive({
4167
+ const {t: t} = useLocale(), _disabled = props.disabled, _column = props.column, _placeholder = _column.placeholder || t("next.form.select") + _column.label, _tableDefaultConfig = deepClone(defaultConfig$4), _tableSelectConfig = deepClone(tableSelectConfig), _options = merge$1(_tableDefaultConfig, _tableSelectConfig, _column.tableSelect), tableSelectDialog = vue.reactive({
4141
4168
  visible: !1,
4142
4169
  title: _column.label + t("next.form.tableSelect"),
4143
4170
  dialogWidth: _options.dialogWidth
@@ -4208,18 +4235,18 @@
4208
4235
  }, renderContent = () => {
4209
4236
  let _slot, _slot2;
4210
4237
  return vue.createVNode(vue.Fragment, null, [ vue.createVNode("div", {
4211
- class: [ "el-input", ns$8.e("input-table"), ns$8.is("disabled", _disabled) ]
4238
+ class: [ "el-input", ns$9.e("input-table"), ns$9.is("disabled", _disabled) ]
4212
4239
  }, [ vue.createVNode("div", {
4213
4240
  class: "el-input__wrapper"
4214
4241
  }, [ tags?.value.length ? vue.createVNode("span", {
4215
- class: ns$8.em("input-table", "value")
4242
+ class: ns$9.em("input-table", "value")
4216
4243
  }, [ tags.value.map(((tag, index) => vue.createVNode(elementPlus.ElTag, {
4217
4244
  closable: !_disabled,
4218
4245
  onClose: () => _onCloseTag(0, index)
4219
4246
  }, {
4220
4247
  default: () => [ tag.label ]
4221
4248
  }))), tagsMore?.value?.length ? vue.createVNode(elementPlus.ElTooltip, {
4222
- "popper-class": ns$8.e("tooltip-tags"),
4249
+ "popper-class": ns$9.e("tooltip-tags"),
4223
4250
  placement: "bottom",
4224
4251
  effect: "light"
4225
4252
  }, {
@@ -4233,10 +4260,10 @@
4233
4260
  default: () => [ tag.label ]
4234
4261
  })))
4235
4262
  }) : null ]) : vue.createVNode("span", {
4236
- class: ns$8.em("input-table", "placeholder")
4263
+ class: ns$9.em("input-table", "placeholder")
4237
4264
  }, [ _placeholder ]) ]), vue.createVNode(elementPlus.ElButton, {
4238
4265
  type: "primary",
4239
- class: ns$8.em("input-table", "append"),
4266
+ class: ns$9.em("input-table", "append"),
4240
4267
  disabled: _disabled,
4241
4268
  icon: search_default,
4242
4269
  onClick: onClickTableDialog
@@ -4250,7 +4277,7 @@
4250
4277
  onClose: onCloseTableDialog
4251
4278
  }, {
4252
4279
  default: () => [ vue.createVNode("div", {
4253
- class: ns$8.em("input-table", "content")
4280
+ class: ns$9.em("input-table", "content")
4254
4281
  }, [ vue.createVNode(elementPlus.ElRadioGroup, {
4255
4282
  modelValue: sinleSelection.value
4256
4283
  }, {
@@ -4273,7 +4300,7 @@
4273
4300
  }) ]
4274
4301
  }) ]
4275
4302
  }) ]), vue.createVNode("div", {
4276
- class: ns$8.em("input-table", "footer")
4303
+ class: ns$9.em("input-table", "footer")
4277
4304
  }, [ vue.createVNode(elementPlus.ElButton, {
4278
4305
  onClick: onResetTableSelect
4279
4306
  }, _isSlot$3(_slot = t("next.form.reset")) ? _slot : {
@@ -4289,7 +4316,7 @@
4289
4316
  };
4290
4317
  return () => vue.createVNode(vue.Fragment, null, [ renderContent() ]);
4291
4318
  }
4292
- }), ns$7 = useNamespace("form");
4319
+ }), ns$8 = useNamespace("form");
4293
4320
  var UploadImage = vue.defineComponent({
4294
4321
  name: "UploadImage",
4295
4322
  props: {
@@ -4345,7 +4372,7 @@
4345
4372
  let urls = [];
4346
4373
  return "string" == typeof value ? urls = [ value ] : "[object Array]" === Object.prototype.toString.call(value) && (urls = value),
4347
4374
  urls = urls.filter((url => !!url)), urls.length ? vue.createVNode(elementPlus.ElImage, {
4348
- class: ns$7.e("preview-image"),
4375
+ class: ns$8.e("preview-image"),
4349
4376
  src: urls[0],
4350
4377
  previewSrcList: urls,
4351
4378
  "preview-teleported": !0,
@@ -4360,7 +4387,7 @@
4360
4387
  })
4361
4388
  }) : null;
4362
4389
  })(), _disabled ? null : vue.createVNode(elementPlus.ElUpload, {
4363
- class: [ ns$7.b("upload-image"), props.className ],
4390
+ class: [ ns$8.b("upload-image"), props.className ],
4364
4391
  style: props.style,
4365
4392
  "list-type": props.listType,
4366
4393
  multiple: props.multiple,
@@ -4496,8 +4523,8 @@
4496
4523
  function _isSlot$2(s) {
4497
4524
  return "function" == typeof s || "[object Object]" === Object.prototype.toString.call(s) && !vue.isVNode(s);
4498
4525
  }
4499
- const ns$6 = useNamespace("form");
4500
- var Element$6 = vue.defineComponent({
4526
+ const ns$7 = useNamespace("form");
4527
+ var Element$7 = vue.defineComponent({
4501
4528
  name: "NextForm",
4502
4529
  props: {
4503
4530
  options: {
@@ -4515,7 +4542,7 @@
4515
4542
  },
4516
4543
  emits: [ "submit", "close", "reset" ],
4517
4544
  setup(props, {slots: slots, emit: emit, expose: expose}) {
4518
- const _config = deepClone(defaultConfig$2), options = vue.reactive(merge$1(_config, props.options)), _isEditing = vue.computed((() => "boolean" != typeof options.isEditing || options.isEditing)), {t: t} = useLocale(), colSpan = vue.ref(options.colSpan), formDatum = vue.reactive(props.formDatum) || {}, formParams = vue.reactive(merge$1({}, formDatum)), _formColumns = vue.ref([]), formRules = vue.reactive({});
4545
+ const _config = deepClone(defaultConfig$3), options = vue.reactive(merge$1(_config, props.options)), _isEditing = vue.computed((() => "boolean" != typeof options.isEditing || options.isEditing)), {t: t} = useLocale(), colSpan = vue.ref(options.colSpan), formDatum = vue.reactive(props.formDatum) || {}, formParams = vue.reactive(merge$1({}, formDatum)), _formColumns = vue.ref([]), formRules = vue.reactive({});
4519
4546
  vue.watch((() => [ props.columns, props.formDatum ]), (() => {
4520
4547
  (() => {
4521
4548
  const columns = props.columns;
@@ -4866,7 +4893,7 @@
4866
4893
  let _slot;
4867
4894
  return vue.createVNode(elementPlus.ElForm, {
4868
4895
  ref: ruleFormRef,
4869
- class: ns$6.b(),
4896
+ class: ns$7.b(),
4870
4897
  inline: !1,
4871
4898
  model: formParams,
4872
4899
  size: options.size
@@ -4886,7 +4913,7 @@
4886
4913
  }, {
4887
4914
  label: () => column.label ? vue.createVNode(vue.Fragment, null, [ vue.createVNode(NextTextEllipsis, {
4888
4915
  content: t(column.label),
4889
- class: ns$6.e("item-label")
4916
+ class: ns$7.e("item-label")
4890
4917
  }, null), column.tip ? vue.createVNode(elementPlus.ElTooltip, {
4891
4918
  effect: "dark",
4892
4919
  content: column.tip,
@@ -4906,7 +4933,7 @@
4906
4933
  })))) ? _slot : {
4907
4934
  default: () => [ _slot ]
4908
4935
  }), _isEditing.value && options.showFooter ? vue.createVNode("div", {
4909
- class: ns$6.e("footer")
4936
+ class: ns$7.e("footer")
4910
4937
  }, [ vue.createVNode(elementPlus.ElButton, {
4911
4938
  type: "primary",
4912
4939
  loading: submitLoading.value,
@@ -4925,7 +4952,7 @@
4925
4952
  };
4926
4953
  }
4927
4954
  });
4928
- const NextTreeSelect = withInstall(treeSelect), NextForm = withInstall(Element$6);
4955
+ const NextTreeSelect = withInstall(treeSelect), NextForm = withInstall(Element$7);
4929
4956
  var AddEditForm = vue.defineComponent({
4930
4957
  name: "AddEditForm",
4931
4958
  props: {
@@ -4979,17 +5006,17 @@
4979
5006
  function _isSlot(s) {
4980
5007
  return "function" == typeof s || "[object Object]" === Object.prototype.toString.call(s) && !vue.isVNode(s);
4981
5008
  }
4982
- const ns$5 = useNamespace("crud-table");
4983
- var Element$5 = vue.defineComponent({
5009
+ const ns$6 = useNamespace("crud-table");
5010
+ var Element$6 = vue.defineComponent({
4984
5011
  name: "NextCrudTable",
4985
5012
  props: defaultPropsConfig,
4986
5013
  emits: [ "confirm-search", "clear-search", "change-pagination", "selection-change", "row-click", "row-contextmenu", "row-dblclick", "cell-click", "cell-dblclick", "cell-contextmenu", "cell-mouse-enter", "cell-mouse-leave", "expand-change", "click-add-edit", "close-add-edit", "view-add-edit", "delete-rows", "delete-row", "submit-form" ],
4987
5014
  setup(props, {emit: emit, slots: slots, expose: expose}) {
4988
- const _config = deepClone(defaultConfig$3), _options = vue.computed((() => {
5015
+ const _config = deepClone(defaultConfig$4), _options = vue.computed((() => {
4989
5016
  const cfg = vue.unref(props.options);
4990
5017
  return merge$1(_config, cfg);
4991
5018
  })), options = vue.unref(_options);
4992
- vue.provide("options", vue.computed((() => _options.value))), vue.provide("ns", ns$5);
5019
+ vue.provide("options", vue.computed((() => _options.value))), vue.provide("ns", ns$6);
4993
5020
  const {t: t} = useLocale(), _columns = vue.ref(options.columns), _searchColumns = vue.ref([]), _formColumns = vue.ref([]), _updateColumnsAll = ops => {
4994
5021
  ((options, cb) => {
4995
5022
  const _columns = vue.reactive(options.columns), _loadDicData = col => {
@@ -5232,11 +5259,11 @@
5232
5259
  });
5233
5260
  return () => vue.createVNode(vue.Fragment, null, [ vue.createVNode(vue.Fragment, null, [ vue.createVNode("div", {
5234
5261
  ref: crudTableRef,
5235
- class: [ ns$5.b(), props.className ],
5262
+ class: [ ns$6.b(), props.className ],
5236
5263
  style: props.style
5237
5264
  }, [ options.showSearchForm || options.showHeaderMenu ? vue.createVNode("header", {
5238
5265
  ref: headerRef,
5239
- class: ns$5.b("header")
5266
+ class: ns$6.b("header")
5240
5267
  }, [ options.showSearchForm && vue.createVNode(HeaderSearch, {
5241
5268
  columns: _searchColumns.value,
5242
5269
  onZoomResize: updateTableContentHeight,
@@ -5255,7 +5282,7 @@
5255
5282
  }, {
5256
5283
  default: () => [ vue.createVNode("div", {
5257
5284
  ref: tableRef,
5258
- class: ns$5.b("content")
5285
+ class: ns$6.b("content")
5259
5286
  }, [ vue.createVNode(elementPlus.ElTable, {
5260
5287
  data: tableData.value,
5261
5288
  height: tableContentHeight.value,
@@ -5318,7 +5345,7 @@
5318
5345
  }) ]) ]
5319
5346
  }), options.isPagination ? vue.createVNode("div", {
5320
5347
  ref: footerRef,
5321
- class: ns$5.b("footer")
5348
+ class: ns$6.b("footer")
5322
5349
  }, [ vue.createVNode(FooterPagination, {
5323
5350
  page: props.page,
5324
5351
  onChange: onChangePagination
@@ -5344,7 +5371,7 @@
5344
5371
  }) ]) ]) ]);
5345
5372
  }
5346
5373
  });
5347
- const NextCrudTable = withInstall(Element$5);
5374
+ const NextCrudTable = withInstall(Element$6);
5348
5375
  var propsConfig = {
5349
5376
  className: {
5350
5377
  type: String,
@@ -5374,13 +5401,13 @@
5374
5401
  total: 0
5375
5402
  })
5376
5403
  }
5377
- }, defaultConfig$1 = {};
5378
- const ns$4 = useNamespace("crud-table-virtualized");
5404
+ }, defaultConfig$2 = {};
5405
+ const ns$5 = useNamespace("crud-table-virtualized");
5379
5406
  const NextCrudTableVirtualized = withInstall(vue.defineComponent({
5380
5407
  name: "NextCrudTableVirtualized",
5381
5408
  props: propsConfig,
5382
5409
  setup(props, {emit: emit}) {
5383
- const _config = deepClone(defaultConfig$1), _options = vue.computed((() => {
5410
+ const _config = deepClone(defaultConfig$2), _options = vue.computed((() => {
5384
5411
  const cfg = vue.unref(props.options);
5385
5412
  return merge$1(_config, cfg);
5386
5413
  })), options = vue.unref(_options);
@@ -5395,7 +5422,7 @@
5395
5422
  emit("close-add-edit");
5396
5423
  };
5397
5424
  return () => vue.createVNode(vue.Fragment, null, [ vue.createVNode("div", {
5398
- class: [ ns$4.b(), props.className ]
5425
+ class: [ ns$5.b(), props.className ]
5399
5426
  }, [ vue.createVNode(NextSpinLoading, null, null), vue.createVNode(NextDialog, {
5400
5427
  modelValue: addEditDialog.visible,
5401
5428
  "onUpdate:modelValue": $event => addEditDialog.visible = $event,
@@ -5406,7 +5433,7 @@
5406
5433
  onClose: onCloseAddEditDialog
5407
5434
  }, null) ]) ]);
5408
5435
  }
5409
- })), NextSpinLoading = withInstall(NextSpinLoading$1), ns$3 = useNamespace("upload");
5436
+ })), NextSpinLoading = withInstall(NextSpinLoading$1), ns$4 = useNamespace("upload");
5410
5437
  const NextUpload = withInstall(vue.defineComponent({
5411
5438
  name: "NextUpload",
5412
5439
  props: {
@@ -5440,7 +5467,7 @@
5440
5467
  const slots = this.$slots, props = this.$props, emit = this.$emit, _t = this.t, uploadfilesPreview = vue.ref([]), body = document.getElementsByTagName("body")[0];
5441
5468
  let previewImagesContainer = null;
5442
5469
  return vue.createVNode(elementPlus.ElUpload, {
5443
- class: [ ns$3.b(), props.className ],
5470
+ class: [ ns$4.b(), props.className ],
5444
5471
  style: props.style,
5445
5472
  "list-type": props.listType,
5446
5473
  "auto-upload": !1,
@@ -5478,8 +5505,8 @@
5478
5505
  })
5479
5506
  });
5480
5507
  }
5481
- })), ns$2 = useNamespace("video-player");
5482
- var Element$2 = vue.defineComponent({
5508
+ })), ns$3 = useNamespace("video-player");
5509
+ var Element$3 = vue.defineComponent({
5483
5510
  name: "NextVideoPlayer",
5484
5511
  props: {
5485
5512
  className: {
@@ -5552,7 +5579,7 @@
5552
5579
  if (!classNames || !classNames.length) throw new Error("模型类别不能未空!");
5553
5580
  container.innerHTML = "", tf__namespace.loadGraphModel(modelUrl).then((model => {
5554
5581
  const canvas = document.createElement("canvas");
5555
- canvas.className = ns$2.b("recongition"), container.appendChild(canvas);
5582
+ canvas.className = ns$3.b("recongition"), container.appendChild(canvas);
5556
5583
  const ctx = canvas.getContext("2d"), detect_ctx = document.createElement("canvas").getContext("2d");
5557
5584
  video.ontimeupdate = () => {
5558
5585
  const {videoWidth: videoWidth, videoHeight: videoHeight, offsetTop: offsetTop, offsetLeft: offsetLeft} = video;
@@ -5723,12 +5750,12 @@
5723
5750
  });
5724
5751
  return () => vue.createVNode(vue.Fragment, null, [ vue.createVNode("div", {
5725
5752
  ref: videoBoxRef,
5726
- class: [ ns$2.b(), props.className ],
5753
+ class: [ ns$3.b(), props.className ],
5727
5754
  style: props.style
5728
5755
  }, null) ]);
5729
5756
  }
5730
5757
  });
5731
- const NextVideoPlayer = withInstall(Element$2);
5758
+ const NextVideoPlayer = withInstall(Element$3);
5732
5759
  const NextDragResize = withInstall(vue.defineComponent({
5733
5760
  name: "NextDragResize",
5734
5761
  props: {},
@@ -5843,7 +5870,7 @@
5843
5870
  }) ]) ]) ]) ]);
5844
5871
  }
5845
5872
  });
5846
- const colors = [ "#5470c6", "#91cc75", "#fac858", "#ee6666", "#73c0de", "#3ba272", "#fc8452", "#9a60b4", "#ea7ccc" ], convertToLabel = rect => {
5873
+ const colors$1 = [ "#5470c6", "#91cc75", "#fac858", "#ee6666", "#73c0de", "#3ba272", "#fc8452", "#9a60b4", "#ea7ccc" ], convertToLabel = rect => {
5847
5874
  const label_type = rect.type, x_center = rect.startX + rect.rectWidth / 2, y_center = rect.startY + rect.rectHeight / 2;
5848
5875
  return [ label_type, parseFloat((x_center / rect.canvasWidth).toFixed(6)), parseFloat((y_center / rect.canvasHeight).toFixed(6)), parseFloat((rect.rectWidth / rect.canvasWidth).toFixed(6)), parseFloat((rect.rectHeight / rect.canvasHeight).toFixed(6)) ];
5849
5876
  }, canvertToCanvas = (labelData, canvasWidth, canvasHeight) => {
@@ -5927,7 +5954,7 @@
5927
5954
  }
5928
5955
  }, [ vue.createVNode("span", {
5929
5956
  style: {
5930
- "background-color": colors[index % colors.length]
5957
+ "background-color": colors$1[index % colors$1.length]
5931
5958
  },
5932
5959
  class: "label-line"
5933
5960
  }, null), vue.createVNode("span", null, [ name ]) ]))) ]), isValueExist(activateIndex.value) ? vue.createVNode("div", {
@@ -6113,7 +6140,7 @@
6113
6140
  onMousedown: event => this.onMousedownDot(event, "bottomRight")
6114
6141
  }, null) ]) ]);
6115
6142
  }
6116
- }), CanvasContext = vue.defineComponent({
6143
+ }), CanvasContext$1 = vue.defineComponent({
6117
6144
  name: "NextCanvasContext",
6118
6145
  props: {
6119
6146
  classes: {
@@ -6179,7 +6206,7 @@
6179
6206
  const {ctx: ctx, labels: labels, image: image, canvasWidth: canvasWidth, canvasHeight: canvasHeight} = options, updateLabels = () => {
6180
6207
  ctx.clearRect(0, 0, canvasWidth, canvasHeight), ctx.drawImage(image, 0, 0, canvasWidth, canvasHeight);
6181
6208
  for (let i = 0; i < labels.length; i++) {
6182
- const rect = labels[i], {startX: startX, startY: startY, rectWidth: rectWidth, rectHeight: rectHeight, type: type} = rect, color = colors[type % colors.length];
6209
+ const rect = labels[i], {startX: startX, startY: startY, rectWidth: rectWidth, rectHeight: rectHeight, type: type} = rect, color = colors$1[type % colors$1.length];
6183
6210
  if (ctx.font = "bold 14px serif", ctx.textBaseline = "top", ctx.save(), ctx.strokeStyle = color,
6184
6211
  ctx.strokeRect(startX, startY, rectWidth, rectHeight), isValueExist(rect.typeName) || isValueExist(rect.type)) {
6185
6212
  const text = rect.typeName || rect.type;
@@ -6199,7 +6226,7 @@
6199
6226
  for (let i = 0; i < labels.length; i++) {
6200
6227
  const rect = labels[i], {type: type, startX: startX, startY: startY, rectWidth: rectWidth, rectHeight: rectHeight} = rect;
6201
6228
  x >= startX && x <= startX + rectWidth && y >= startY && y <= startY + rectHeight && (hit_rect = rect,
6202
- hit_index = i, color = colors[type]);
6229
+ hit_index = i, color = colors$1[type]);
6203
6230
  }
6204
6231
  return {
6205
6232
  hit_rect: hit_rect,
@@ -6389,7 +6416,7 @@
6389
6416
  onCloseContentmenuLabel: onCloseContentmenuLabel,
6390
6417
  onSelectedLabel: (rect, index) => {
6391
6418
  onCloseDraggableRectFixed(), vue.nextTick((() => {
6392
- const {startX: x, startY: y, type: type} = rect, color = colors[type];
6419
+ const {startX: x, startY: y, type: type} = rect, color = colors$1[type];
6393
6420
  updateDraggableRectFixed(x, y, labels.value[index], index, color);
6394
6421
  }));
6395
6422
  },
@@ -6470,7 +6497,7 @@
6470
6497
  })(rect, index)
6471
6498
  }, [ vue.createVNode("div", null, [ vue.createVNode("span", {
6472
6499
  style: {
6473
- "background-color": colors[rect.type]
6500
+ "background-color": colors$1[rect.type]
6474
6501
  },
6475
6502
  class: "label-line"
6476
6503
  }, null), vue.createVNode("span", null, [ rect.typeName ]) ]), vue.createVNode(elementPlus.ElPopconfirm, {
@@ -6495,11 +6522,11 @@
6495
6522
  }, null) ]);
6496
6523
  return () => vue.createVNode(vue.Fragment, null, [ renderContent() ]);
6497
6524
  }
6498
- }), defaultConfig = {
6525
+ }), defaultConfig$1 = {
6499
6526
  minContentHeight: 500
6500
6527
  };
6501
- const ns$1 = useNamespace("labelimg");
6502
- var Element = vue.defineComponent({
6528
+ const ns$2 = useNamespace("labelimg");
6529
+ var Element$1 = vue.defineComponent({
6503
6530
  name: "NextLabelimg",
6504
6531
  props: {
6505
6532
  className: {
@@ -6510,10 +6537,6 @@
6510
6537
  type: Object,
6511
6538
  default: () => ({})
6512
6539
  },
6513
- rowKey: {
6514
- type: String,
6515
- default: "id"
6516
- },
6517
6540
  options: {
6518
6541
  type: Object,
6519
6542
  default: () => ({})
@@ -6529,11 +6552,11 @@
6529
6552
  },
6530
6553
  emits: [ "change", "save", "prev-click", "next-click" ],
6531
6554
  setup(props, {emit: emit, slots: slots, expose: expose}) {
6532
- const {t: t} = useLocale(), _config = deepClone(defaultConfig), _options = vue.computed((() => {
6555
+ const {t: t} = useLocale(), _config = deepClone(defaultConfig$1), _options = vue.computed((() => {
6533
6556
  const cfg = vue.unref(props.options);
6534
6557
  return merge$1(_config, cfg);
6535
6558
  })), options = vue.unref(_options);
6536
- vue.provide("ns", ns$1), vue.provide("_emit", emit);
6559
+ vue.provide("ns", ns$2), vue.provide("_emit", emit);
6537
6560
  const activateNodeIndex = vue.ref(0), classes = vue.ref(props.classes), labelImages = vue.ref(deepClone(props.data));
6538
6561
  vue.watch((() => props.data), (data => {
6539
6562
  labelImages.value = deepClone(data);
@@ -6567,7 +6590,10 @@
6567
6590
  node: node,
6568
6591
  label_txt: yolo_label.join("\n")
6569
6592
  };
6570
- }, isChangeNodeLabels = () => isEqual(labelImages.value[activateNodeIndex.value].labels, currentNode.value.labels), switchKeydownAD = e => {
6593
+ }, isChangeNodeLabels = () => {
6594
+ const node = labelImages.value[activateNodeIndex.value];
6595
+ return isEqual(vue.toRaw(node.labels).map((rect => convertToLabel(rect))), currentNode.value.labels.map((rect => convertToLabel(rect))));
6596
+ }, switchKeydownAD = e => {
6571
6597
  const imageLength = labelImages.value.length;
6572
6598
  "KeyD" === e.code ? (activateNodeIndex.value++, activateNodeIndex.value >= imageLength && (activateNodeIndex.value = 0)) : "KeyA" === e.code && (activateNodeIndex.value--,
6573
6599
  activateNodeIndex.value < 0 && (activateNodeIndex.value = imageLength - 1));
@@ -6637,19 +6663,19 @@
6637
6663
  });
6638
6664
  const renderContent = () => vue.createVNode("div", {
6639
6665
  ref: layoutLabelRef,
6640
- class: [ ns$1.b(), props.className, isFullscreen.value ? ns$1.b("fullscreen") : "" ],
6666
+ class: [ ns$2.b(), props.className, isFullscreen.value ? ns$2.b("fullscreen") : "" ],
6641
6667
  style: {
6642
6668
  ...props.style
6643
6669
  }
6644
6670
  }, [ vue.createVNode(NextSpinLoading$1, {
6645
6671
  loading: loading.value,
6646
6672
  tip: t("next.labelimg.saveTxt"),
6647
- class: [ ns$1.b("loading") ]
6673
+ class: [ ns$2.b("loading") ]
6648
6674
  }, {
6649
6675
  default: () => [ vue.createVNode(elementPlus.ElScrollbar, null, {
6650
6676
  default: () => [ vue.createVNode("header", {
6651
6677
  ref: headerRef,
6652
- class: [ ns$1.b("header") ]
6678
+ class: [ ns$2.b("header") ]
6653
6679
  }, [ slots.header ? slots.header() : vue.createVNode(ToolHeader, {
6654
6680
  isFullscreen: isFullscreen.value,
6655
6681
  imageIndex: activateNodeIndex.value,
@@ -6663,16 +6689,16 @@
6663
6689
  }
6664
6690
  }, null) ]), vue.createVNode("div", {
6665
6691
  ref: mainRef,
6666
- class: [ ns$1.b("main") ]
6692
+ class: [ ns$2.b("main") ]
6667
6693
  }, [ vue.createVNode(elementPlus.ElScrollbar, {
6668
- class: [ ns$1.be("main", "content") ]
6694
+ class: [ ns$2.be("main", "content") ]
6669
6695
  }, {
6670
6696
  default: () => [ vue.createVNode("div", {
6671
- class: [ ns$1.be("main", "content") ],
6697
+ class: [ ns$2.be("main", "content") ],
6672
6698
  style: {
6673
6699
  height: mainContentHeight.value + "px"
6674
6700
  }
6675
- }, [ vue.createVNode(CanvasContext, {
6701
+ }, [ vue.createVNode(CanvasContext$1, {
6676
6702
  ref: canvasContextRef,
6677
6703
  contextClientHeight: mainContentHeight.value,
6678
6704
  classes: classes.value,
@@ -6687,9 +6713,9 @@
6687
6713
  onSelect: onSelectLabelNode
6688
6714
  }, null) ]), vue.createVNode("footer", {
6689
6715
  ref: footerRef,
6690
- class: [ ns$1.b("footer") ]
6716
+ class: [ ns$2.b("footer") ]
6691
6717
  }, [ vue.createVNode("div", {
6692
- class: [ ns$1.be("footer", "left") ]
6718
+ class: [ ns$2.be("footer", "left") ]
6693
6719
  }, [ vue.createVNode(elementPlus.ElIcon, {
6694
6720
  size: 24,
6695
6721
  color: "#797979",
@@ -6697,10 +6723,10 @@
6697
6723
  }, {
6698
6724
  default: () => [ vue.createVNode(arrow_left_default, null, null) ]
6699
6725
  }) ]), vue.createVNode("div", {
6700
- class: [ ns$1.be("footer", "center") ]
6726
+ class: [ ns$2.be("footer", "center") ]
6701
6727
  }, [ vue.createVNode(elementPlus.ElScrollbar, null, {
6702
6728
  default: () => [ vue.createVNode("ul", {
6703
- class: [ ns$1.bem("footer", "center", "list") ]
6729
+ class: [ ns$2.bem("footer", "center", "list") ]
6704
6730
  }, [ labelImages.value.map(((item, index) => vue.createVNode("li", {
6705
6731
  key: index,
6706
6732
  onClick: () => onChangeActivateNode(index),
@@ -6716,7 +6742,7 @@
6716
6742
  fit: "cover"
6717
6743
  }, null) ]))) ]) ]
6718
6744
  }) ]), vue.createVNode("div", {
6719
- class: [ ns$1.be("footer", "right") ]
6745
+ class: [ ns$2.be("footer", "right") ]
6720
6746
  }, [ vue.createVNode(elementPlus.ElIcon, {
6721
6747
  size: 24,
6722
6748
  color: "#797979",
@@ -6729,7 +6755,7 @@
6729
6755
  return () => vue.createVNode(vue.Fragment, null, [ renderContent() ]);
6730
6756
  }
6731
6757
  });
6732
- const ns = useNamespace("labelimg-preview");
6758
+ const ns$1 = useNamespace("labelimg-preview");
6733
6759
  var preview = vue.defineComponent({
6734
6760
  name: "NextLabelimgPreview",
6735
6761
  props: {
@@ -6765,7 +6791,7 @@
6765
6791
  canvasBaseRef.value.style.width = canvasWidth + "px", canvasBaseRef.value.style.height = canvasHeight + "px";
6766
6792
  })(canvasWidth, canvasHeight), ctx.clearRect(0, 0, canvasWidth, canvasHeight), ctx.drawImage(image, 0, 0, canvasWidth, canvasHeight);
6767
6793
  for (let i = 0; i < labels.value.length; i++) {
6768
- const rect = labels.value[i], {startX: startX, startY: startY, rectWidth: rectWidth, rectHeight: rectHeight, type: type} = rect, color = colors[type % colors.length];
6794
+ const rect = labels.value[i], {startX: startX, startY: startY, rectWidth: rectWidth, rectHeight: rectHeight, type: type} = rect, color = colors$1[type % colors$1.length];
6769
6795
  if (ctx.font = "bold 14px serif", ctx.textBaseline = "top", ctx.save(), ctx.strokeStyle = color,
6770
6796
  ctx.strokeRect(startX, startY, rectWidth, rectHeight), !isValueExist(rect.typeName)) {
6771
6797
  const typeName = classes.value[rect.type];
@@ -6788,7 +6814,7 @@
6788
6814
  });
6789
6815
  }));
6790
6816
  return () => vue.createVNode(vue.Fragment, null, [ vue.createVNode("div", {
6791
- class: [ ns.b(), props.className ],
6817
+ class: [ ns$1.b(), props.className ],
6792
6818
  style: {
6793
6819
  ...props.style
6794
6820
  }
@@ -6797,7 +6823,678 @@
6797
6823
  }, null) ]) ]);
6798
6824
  }
6799
6825
  });
6800
- const NextLabelimg = withInstall(Element), NextLabelimgPreview = withInstall(preview);
6826
+ const NextLabelimg = withInstall(Element$1), NextLabelimgPreview = withInstall(preview), isPointInCircle = (mouseX, mouseY, circleX, circleY, radius) => Math.sqrt(Math.pow(mouseX - circleX, 2) + Math.pow(mouseY - circleY, 2)) < radius, vertexesUnique = vertexes => Array.from(new Set(vertexes.map((item => JSON.stringify(item))))).map((item => JSON.parse(item))), {hexToRgba: hexToRgba} = useChangeColor(), colors = [ "#91cc75", "#fac858", "#ee6666", "#73c0de", "#3ba272", "#fc8452", "#9a60b4", "#ea7ccc" ];
6827
+ class CreatePolygonVertexes {
6828
+ canvas;
6829
+ ctx;
6830
+ vertexes;
6831
+ isDrawing;
6832
+ mouseOffset;
6833
+ vertexesObservers=[];
6834
+ destroyedObservers;
6835
+ constructor(canvas, ctx) {
6836
+ this.canvas = canvas, this.ctx = ctx, this.isDrawing = !1, this.vertexes = [], this.mouseOffset = {
6837
+ x: 0,
6838
+ y: 0
6839
+ }, canvas.addEventListener("click", this.canvasMouseClick.bind(this)), canvas.addEventListener("mousemove", this.canvasMousemove.bind(this)),
6840
+ canvas.addEventListener("dblclick", this.canvasMouseDblclick.bind(this)), this.vertexes = new Proxy(this.vertexes, {
6841
+ set: (target, property, value) => (target[property] = value, this.notifyVertexChangeListeners(),
6842
+ !0)
6843
+ }), this.mouseOffset = new Proxy(this.mouseOffset, {
6844
+ set: (target, property, value) => (target[property] = value, this.notifyVertexChangeListeners(),
6845
+ !0)
6846
+ });
6847
+ }
6848
+ notifyVertexChangeListeners() {
6849
+ this.vertexesObservers.forEach((listener => {
6850
+ listener(this.vertexes, this.mouseOffset);
6851
+ }));
6852
+ }
6853
+ vertexesChangeEventListener(listener) {
6854
+ this.vertexesObservers.push(listener);
6855
+ }
6856
+ notifyDestryedListerers() {
6857
+ this.destroyedObservers(this.vertexes);
6858
+ }
6859
+ onDestroyed(callback) {
6860
+ this.destroyedObservers = callback;
6861
+ }
6862
+ canvasMouseClick(e) {
6863
+ e.stopPropagation(), this.isDrawing = !0, this.mouseOffset.x = e.offsetX, this.mouseOffset.y = e.offsetY,
6864
+ this.vertexes.push([ e.offsetX, e.offsetY ]), this.vertexes = vertexesUnique(this.vertexes);
6865
+ }
6866
+ canvasMousemove(e) {
6867
+ e.stopPropagation(), this.isDrawing && (this.mouseOffset.x = e.offsetX, this.mouseOffset.y = e.offsetY,
6868
+ this.canvas.style.cursor = "crosshair");
6869
+ }
6870
+ canvasMouseDblclick(e) {
6871
+ e.stopPropagation(), this.isDrawing && (this.canvas.style.cursor = "unset", this.mouseOffset.x = e.offsetX,
6872
+ this.mouseOffset.y = e.offsetY, this.vertexes.push([ e.offsetX, e.offsetY ]), this.vertexes = vertexesUnique(this.vertexes)),
6873
+ this.notifyDestryedListerers(), this.destroyed();
6874
+ }
6875
+ destroyed() {
6876
+ this.isDrawing = !1, this.vertexes = [], this.vertexesObservers = [], this.destroyedObservers = () => {
6877
+ this.canvas.removeEventListener("click", this.canvasMouseClick);
6878
+ }, this.canvas.removeEventListener("mousemove", this.canvasMousemove), this.canvas.removeEventListener("dblclick", this.canvasMouseDblclick);
6879
+ }
6880
+ }
6881
+ class EditPolygonPath {
6882
+ canvas;
6883
+ ctx;
6884
+ vertexes;
6885
+ isEditing;
6886
+ isMoveEditing;
6887
+ canClickEvent;
6888
+ pointVertexIndex;
6889
+ pointCentreIndex;
6890
+ vertexRadius;
6891
+ edgeCentreRadius;
6892
+ observers=[];
6893
+ constructor(canvas, ctx) {
6894
+ this.canvas = canvas, this.ctx = ctx, this.vertexes = [], this.isEditing = !1, this.canClickEvent = !0,
6895
+ this.isMoveEditing = !1, this.pointVertexIndex = -1, this.pointCentreIndex = -1,
6896
+ this.vertexRadius = 8, this.edgeCentreRadius = 5;
6897
+ }
6898
+ drawPolygonPath(vertexes, mouseX, mouseY) {
6899
+ const ctx = this.ctx;
6900
+ if (!vertexes.length) return;
6901
+ ctx.beginPath(), ctx.lineWidth = 3, ctx.strokeStyle = "#5470c6", ctx.fillStyle = hexToRgba("#5470c6", .2),
6902
+ ctx.moveTo(vertexes[0][0], vertexes[0][1]);
6903
+ for (let i = 1; i < vertexes.length; i++) {
6904
+ const [x, y] = vertexes[i];
6905
+ ctx.lineTo(x, y);
6906
+ }
6907
+ isNaN(mouseX) || isNaN(mouseY) || ctx.lineTo(mouseX, mouseY), ctx.closePath(), ctx.stroke(),
6908
+ ctx.fill();
6909
+ }
6910
+ drawPolygonEdgeCentre(vertexes) {
6911
+ const ctx = this.ctx;
6912
+ for (let i = 0; i < vertexes.length; i++) {
6913
+ const [x, y] = vertexes[i];
6914
+ ctx.beginPath(), ctx.fillStyle = "#5470c6", ctx.arc(x, y, this.vertexRadius, 0, 2 * Math.PI),
6915
+ ctx.closePath(), ctx.fill(), ctx.beginPath(), ctx.fillStyle = "#FFFFFF", ctx.arc(x, y, this.vertexRadius - 3, 0, 2 * Math.PI),
6916
+ ctx.closePath(), ctx.fill();
6917
+ }
6918
+ for (let i = 0; i < vertexes.length; i++) {
6919
+ const start = vertexes[i % vertexes.length], end = vertexes[(i + 1) % vertexes.length], x = start[0] + (end[0] - start[0]) / 2, y = start[1] + (end[1] - start[1]) / 2;
6920
+ ctx.beginPath(), ctx.fillStyle = "#5470c6", ctx.arc(x, y, this.edgeCentreRadius, 0, 2 * Math.PI),
6921
+ ctx.closePath(), ctx.fill();
6922
+ }
6923
+ }
6924
+ drawPolygon(vertexes, mouseOffset) {
6925
+ this.vertexes = vertexes, mouseOffset ? this.drawPolygonPath(vertexes, mouseOffset.x, mouseOffset.y) : (this.drawPolygonPath(vertexes),
6926
+ this.drawPolygonEdgeCentre(vertexes));
6927
+ }
6928
+ pointInVertexes(x, y) {
6929
+ const vertexes = this.vertexes;
6930
+ let aimIndex = null;
6931
+ for (let i = 0; i < vertexes.length; i++) {
6932
+ const [vertex_x, vertex_y] = vertexes[i];
6933
+ if (isPointInCircle(x, y, vertex_x, vertex_y, this.vertexRadius)) {
6934
+ this.canvas.style.cursor = "pointer", aimIndex = i;
6935
+ break;
6936
+ }
6937
+ this.canvas.style.cursor = "unset";
6938
+ }
6939
+ return aimIndex;
6940
+ }
6941
+ pointInEdgeCentre(x, y) {
6942
+ const vertexes = this.vertexes;
6943
+ let aimIndex = null;
6944
+ for (let i = 0; i < vertexes.length; i++) {
6945
+ const start = vertexes[i % vertexes.length], end = vertexes[(i + 1) % vertexes.length], vertex_x = start[0] + (end[0] - start[0]) / 2, vertex_y = start[1] + (end[1] - start[1]) / 2;
6946
+ if (isPointInCircle(x, y, vertex_x, vertex_y, this.edgeCentreRadius)) {
6947
+ this.canvas.style.cursor = "pointer", aimIndex = i;
6948
+ break;
6949
+ }
6950
+ this.canvas.style.cursor = "unset";
6951
+ }
6952
+ return aimIndex;
6953
+ }
6954
+ pointInVertexesOrEdgeCentre(x, y) {
6955
+ const vertexes = this.vertexes;
6956
+ for (let i = 0; i < vertexes.length; i++) {
6957
+ const [vertex_x, vertex_y] = vertexes[i], isInVertex = isPointInCircle(x, y, vertex_x, vertex_y, this.vertexRadius), start = vertexes[i % vertexes.length], end = vertexes[(i + 1) % vertexes.length], edge_center_x = start[0] + (end[0] - start[0]) / 2, edge_center_y = start[1] + (end[1] - start[1]) / 2, isInEdgeCenter = isPointInCircle(x, y, edge_center_x, edge_center_y, this.edgeCentreRadius);
6958
+ if (isInVertex || isInEdgeCenter) {
6959
+ this.canvas.style.cursor = "pointer";
6960
+ break;
6961
+ }
6962
+ this.canvas.style.cursor = "unset";
6963
+ }
6964
+ }
6965
+ notifyObservers() {
6966
+ this.observers.forEach((listener => {
6967
+ listener(this.vertexes);
6968
+ }));
6969
+ }
6970
+ updatePolygon(callback) {
6971
+ this.isEditing = !0, this.canvas.addEventListener("mousedown", this.canvasMousedown.bind(this)),
6972
+ this.canvas.addEventListener("mouseup", this.canvasMouseup.bind(this)), this.canvas.addEventListener("click", this.canvasMouseClick.bind(this)),
6973
+ this.canvas.addEventListener("mousemove", this.canvasMousemove.bind(this)), this.observers.push(callback);
6974
+ }
6975
+ canvasMousedown(e) {
6976
+ e.stopPropagation(), e.preventDefault(), this.canClickEvent = !0;
6977
+ const {offsetX: x, offsetY: y} = e, vertex_i = this.pointInVertexes(x, y);
6978
+ isValueExist(vertex_i) && (this.isMoveEditing = !0, this.pointVertexIndex = vertex_i,
6979
+ this.vertexes.splice(this.pointVertexIndex, 1, [ x, y ]));
6980
+ const i = this.pointInEdgeCentre(x, y);
6981
+ isValueExist(i) && (this.isMoveEditing = !0, this.pointCentreIndex = i + 1, this.vertexes.splice(this.pointCentreIndex, 0, [ x, y ])),
6982
+ setTimeout((() => {
6983
+ this.canClickEvent = !1;
6984
+ }), 200);
6985
+ }
6986
+ canvasMouseup(e) {
6987
+ e.stopPropagation(), e.preventDefault();
6988
+ const {offsetX: x, offsetY: y} = e;
6989
+ this.pointVertexIndex > -1 && this.vertexes.splice(this.pointVertexIndex, 1, [ x, y ]),
6990
+ this.pointCentreIndex > -1 && this.vertexes.splice(this.pointCentreIndex, 1, [ x, y ]),
6991
+ this.isMoveEditing = !1, this.pointVertexIndex = -1, this.pointCentreIndex = -1,
6992
+ this.notifyObservers();
6993
+ }
6994
+ canvasMouseClick(e) {
6995
+ e.stopPropagation();
6996
+ const {offsetX: x, offsetY: y} = e;
6997
+ if (this.canClickEvent) {
6998
+ const i = this.pointInVertexes(x, y);
6999
+ if (isValueExist(i)) {
7000
+ if (this.vertexes.length <= 3) return;
7001
+ this.vertexes.splice(i, 1), this.drawPolygon(this.vertexes), this.notifyObservers();
7002
+ }
7003
+ }
7004
+ }
7005
+ canvasMousemove(e) {
7006
+ e.stopPropagation();
7007
+ const {offsetX: x, offsetY: y} = e;
7008
+ this.pointInVertexesOrEdgeCentre(x, y), this.isMoveEditing && (this.pointVertexIndex > -1 && this.vertexes.splice(this.pointVertexIndex, 1, [ x, y ]),
7009
+ this.pointCentreIndex > -1 && this.vertexes.splice(this.pointCentreIndex, 1, [ x, y ]),
7010
+ this.notifyObservers());
7011
+ }
7012
+ destroyed() {
7013
+ this.vertexes = [], this.observers = [], this.isEditing = !1, this.canvas.removeEventListener("mousedown", this.canvasMousedown),
7014
+ this.canvas.removeEventListener("mouseup", this.canvasMouseup), this.canvas.removeEventListener("click", this.canvasMouseClick),
7015
+ this.canvas.removeEventListener("mousemove", this.canvasMousemove);
7016
+ }
7017
+ }
7018
+ class CreateDrawCanvas {
7019
+ canvas;
7020
+ ctx;
7021
+ image;
7022
+ canvasWidth;
7023
+ canvasHeight;
7024
+ paths;
7025
+ editDrawPolygon;
7026
+ createPolygonVertexes;
7027
+ editVertexes;
7028
+ editPolygonObservers=[];
7029
+ constructor(options) {
7030
+ const {canvas: canvas, ctx: ctx, image: image, canvasWidth: canvasWidth, canvasHeight: canvasHeight, paths: paths} = options;
7031
+ this.canvas = canvas, this.ctx = ctx, this.image = image, this.canvasWidth = canvasWidth,
7032
+ this.canvasHeight = canvasHeight, this.paths = paths || [], this.editVertexes = [],
7033
+ this.render(), this.createPolygonVertexes = new CreatePolygonVertexes(canvas, ctx),
7034
+ this.editDrawPolygon = new EditPolygonPath(canvas, ctx), this.createPolygonVertexes.vertexesChangeEventListener(((vertexes, mouseOffset) => {
7035
+ this.render(), this.editDrawPolygon.drawPolygon(vertexes, mouseOffset), this.editVertexes = vertexes,
7036
+ this.notifyObservers();
7037
+ })), this.createPolygonVertexes.onDestroyed((vertexes => {
7038
+ this.render(), this.editDrawPolygon.drawPolygon(vertexes), this.editDrawPolygon.updatePolygon((vertexes => {
7039
+ this.render(), this.editDrawPolygon.drawPolygon(vertexes), this.editVertexes = vertexes,
7040
+ this.notifyObservers();
7041
+ }));
7042
+ }));
7043
+ }
7044
+ notifyObservers() {
7045
+ this.editPolygonObservers.forEach((listener => {
7046
+ listener(this.editVertexes);
7047
+ }));
7048
+ }
7049
+ updatePolygon(callback) {
7050
+ this.editPolygonObservers.push(callback);
7051
+ }
7052
+ drawPolygons(paths) {
7053
+ const ctx = this.ctx;
7054
+ for (let i = 0; i < paths.length; i++) {
7055
+ const path = paths[i].path;
7056
+ if (!path.length) return;
7057
+ const color = colors[i % colors.length];
7058
+ ctx.beginPath(), ctx.lineWidth = 2, ctx.strokeStyle = color, ctx.fillStyle = hexToRgba(color, .2),
7059
+ ctx.moveTo(path[0][0], path[0][1]);
7060
+ for (let i = 1; i < path.length; i++) {
7061
+ const [x, y] = path[i];
7062
+ ctx.lineTo(x, y);
7063
+ }
7064
+ ctx.closePath(), ctx.stroke(), ctx.fill();
7065
+ }
7066
+ }
7067
+ initCanvas=() => {
7068
+ this.ctx.clearRect(0, 0, this.canvasWidth, this.canvasHeight), this.ctx.drawImage(this.image, 0, 0, this.canvasWidth, this.canvasHeight),
7069
+ this.drawPolygons(this.paths);
7070
+ };
7071
+ render=() => {
7072
+ this.initCanvas();
7073
+ };
7074
+ destroyed() {
7075
+ this.paths = [], this.editDrawPolygon.destroyed(), this.createPolygonVertexes.destroyed();
7076
+ }
7077
+ }
7078
+ var CanvasContext = vue.defineComponent({
7079
+ props: {
7080
+ classes: {
7081
+ type: Array,
7082
+ default: () => []
7083
+ },
7084
+ contextClientHeight: {
7085
+ type: Number,
7086
+ default: null
7087
+ },
7088
+ rowInfo: {
7089
+ type: Object,
7090
+ default: () => ({})
7091
+ }
7092
+ },
7093
+ emits: [ "editPolygon" ],
7094
+ setup(props, {emit: emit, expose: expose}) {
7095
+ const ns = vue.inject("ns", {}), canvasMainRef = vue.ref(), canvasBaseRef = vue.ref(), drawCanvas = vue.ref(), setContainerWidthHeight = (canvasWidth, canvasHeight) => {
7096
+ canvasMainRef.value.style.width = canvasWidth + "px", canvasMainRef.value.style.height = canvasHeight + "px",
7097
+ canvasBaseRef.value.width = canvasWidth, canvasBaseRef.value.height = canvasHeight,
7098
+ canvasBaseRef.value.style.width = canvasWidth + "px", canvasBaseRef.value.style.height = canvasHeight + "px";
7099
+ }, loadingImage = vue.ref(!1), renderImageLabel = rowInfo => {
7100
+ const clientHeight = canvasMainRef.value?.clientHeight, ctx = canvasBaseRef.value?.getContext("2d");
7101
+ if (rowInfo?.imageSrc) {
7102
+ const image = new Image;
7103
+ image.src = rowInfo.imageSrc, loadingImage.value = !0, image.onload = () => {
7104
+ loadingImage.value = !1;
7105
+ let {width: width, height: height} = image;
7106
+ if (height > clientHeight) {
7107
+ const scale = height / clientHeight;
7108
+ height = clientHeight, image.style.height = height + "px", width /= scale;
7109
+ }
7110
+ const canvasHeight = height, scaleFactor = parseFloat((canvasHeight / height).toFixed(3)), canvasWidth = Math.ceil(width * scaleFactor);
7111
+ setContainerWidthHeight(canvasWidth, canvasHeight), drawCanvas.value = new CreateDrawCanvas({
7112
+ canvas: canvasBaseRef.value,
7113
+ ctx: ctx,
7114
+ image: image,
7115
+ canvasWidth: canvasWidth,
7116
+ canvasHeight: canvasHeight,
7117
+ scaleFactor: scaleFactor,
7118
+ paths: rowInfo.labels
7119
+ }), drawCanvas.value.updatePolygon((vertexes => {
7120
+ emit("editPolygon", {
7121
+ vertexes: vertexes,
7122
+ canvasWidth: canvasWidth,
7123
+ canvasHeight: canvasHeight
7124
+ });
7125
+ }));
7126
+ }, image.onerror = () => {
7127
+ loadingImage.value = !1;
7128
+ };
7129
+ }
7130
+ };
7131
+ vue.onMounted((() => {
7132
+ vue.watch((() => props.rowInfo), (info => {
7133
+ const rowInfo = vue.toRaw(info);
7134
+ renderImageLabel(rowInfo);
7135
+ }), {
7136
+ deep: !0,
7137
+ immediate: !0
7138
+ }), vue.watch((() => props.contextClientHeight), (height => {
7139
+ if (valueExist(height)) {
7140
+ canvasMainRef.value.style.height = height + "px";
7141
+ const rowInfo = vue.toRaw(props.rowInfo);
7142
+ renderImageLabel(rowInfo);
7143
+ }
7144
+ }));
7145
+ }));
7146
+ return expose({
7147
+ rerenderImage: () => {
7148
+ setContainerWidthHeight(0, 0), vue.nextTick((() => {
7149
+ const rowInfo = vue.toRaw(props.rowInfo);
7150
+ renderImageLabel(rowInfo);
7151
+ }));
7152
+ }
7153
+ }), () => vue.createVNode(vue.Fragment, null, [ vue.createVNode(NextSpinLoading, {
7154
+ loading: loadingImage.value,
7155
+ class: [ ns.b("loading") ],
7156
+ style: {
7157
+ height: "100%"
7158
+ }
7159
+ }, {
7160
+ default: () => [ vue.createVNode("div", {
7161
+ ref: canvasMainRef,
7162
+ class: [ ns.b("canvas") ]
7163
+ }, [ vue.createVNode("canvas", {
7164
+ ref: canvasBaseRef,
7165
+ class: [ ns.be("canvas", "context") ]
7166
+ }, null) ]) ]
7167
+ }) ]);
7168
+ }
7169
+ }), HeaderTool = vue.defineComponent({
7170
+ props: {
7171
+ isFullscreen: {
7172
+ type: Boolean,
7173
+ default: !1
7174
+ },
7175
+ imageIndex: {
7176
+ type: Number,
7177
+ default: 0
7178
+ },
7179
+ imageLength: {
7180
+ type: Number,
7181
+ default: 0
7182
+ }
7183
+ },
7184
+ emits: [ "fullscreen", "save" ],
7185
+ setup(props, {emit: emit}) {
7186
+ const _ns = vue.inject("ns", {}), {t: t} = useLocale(), switchFillscreen = val => {
7187
+ emit("fullscreen", val);
7188
+ };
7189
+ return () => vue.createVNode(vue.Fragment, null, [ vue.createVNode(vue.Fragment, null, [ vue.createVNode("ul", {
7190
+ class: [ _ns.be("header", "tool") ]
7191
+ }, [ vue.createVNode("li", {
7192
+ class: "tool-item",
7193
+ onClick: () => emit("save")
7194
+ }, [ vue.createVNode("svg", {
7195
+ t: "1719034799379",
7196
+ class: "icon",
7197
+ viewBox: "0 0 1024 1024",
7198
+ version: "1.1",
7199
+ xmlns: "http://www.w3.org/2000/svg",
7200
+ "p-id": "4272",
7201
+ width: "18",
7202
+ height: "18"
7203
+ }, [ vue.createVNode("path", {
7204
+ d: "M831.4 252.2L711.5 132.4c-10.3-10.3-24.2-16.1-38.8-16.1h-450c-23.3 0-42.2 18.9-42.2 42.2v709.4c0 23.3 18.9 42.2 42.2 42.2h582.6c23.3 0 42.2-18.9 42.2-42.2V291c-0.1-14.5-5.8-28.5-16.1-38.8zM619.6 159v159.8c0 4-3.3 7.3-7.3 7.3H387.2c-4 0-7.3-3.3-7.3-7.3V159h239.7z m67.7 708.4H340.8v-292c0-3.9 3.2-7.1 7.1-7.1h332.4c3.9 0 7.1 3.2 7.1 7.1v292z m117.4 0H730v-292c0-27.5-22.3-49.8-49.8-49.8H347.8c-27.5 0-49.8 22.3-49.8 49.8v292h-74.7V159.1h113.9v159.8c0 27.6 22.4 50.1 50.1 50.1h225.1c27.6 0 50.1-22.4 50.1-50.1V159h10.4c3.2 0 6.3 1.3 8.6 3.6l119.9 119.9c2.3 2.3 3.6 5.3 3.6 8.6l-0.3 576.3z",
7205
+ "p-id": "4273"
7206
+ }, null), vue.createVNode("path", {
7207
+ d: "M536 196.3h42.7v87.2H536zM368.7 641.2h220.7v42.7H368.7zM368.7 744h170.9v42.7H368.7z",
7208
+ "p-id": "4274"
7209
+ }, null) ]), vue.createVNode("p", {
7210
+ class: "label-text"
7211
+ }, [ t("next.labelme.saveLabel") ]) ]), vue.createVNode("li", {
7212
+ class: "tool-item"
7213
+ }, [ vue.createVNode("svg", {
7214
+ t: "1721826305513",
7215
+ class: "icon",
7216
+ viewBox: "0 0 1025 1024",
7217
+ version: "1.1",
7218
+ xmlns: "http://www.w3.org/2000/svg",
7219
+ "p-id": "6215",
7220
+ width: "18",
7221
+ height: "18"
7222
+ }, [ vue.createVNode("path", {
7223
+ d: "M358.5 1021.5c-52.93 0-96-43.07-96-96 0-13.12 2.6-25.84 7.74-37.81l0.12-0.27-141.99-184.66-0.34 0.11a95.806 95.806 0 0 1-29.53 4.64c-52.93 0-96-43.07-96-96s43.07-96 96-96c7.56 0 15.09 0.89 22.41 2.64l0.36 0.09 213.67-370.08-0.16-0.25c-9.34-15.12-14.28-32.54-14.28-50.39 0-52.93 43.07-96 96-96 40.36 0 76.66 25.5 90.34 63.46l0.09 0.26 300.27 61.72 0.19-0.26c18.01-25.16 47.21-40.18 78.11-40.18 52.93 0 96 43.07 96 96 0 36.49-20.26 69.36-52.88 85.79l-0.31 0.16 41.76 393.5 0.25 0.12a96.184 96.184 0 0 1 39.11 34.79c9.85 15.41 15.06 33.27 15.06 51.65 0 52.93-43.07 96-96 96-31.18 0-60.53-15.24-78.52-40.76l-0.22-0.31-396.7 138.78-0.05 0.29c-8.2 45.76-47.94 78.97-94.5 78.97z m0-192c34.03 0 64.82 17.44 82.36 46.66l0.21 0.35L832.93 739.4l0.03-0.32c3.81-39.11 31.82-72.49 69.7-83.05l0.41-0.11-40.34-380.14-0.34-0.08c-39.73-9.82-68.86-43.81-72.49-84.56l-0.03-0.37-283.9-58.36-0.15 0.39c-7 17.7-19.01 32.81-34.72 43.69-16.08 11.13-34.96 17.02-54.59 17.02-9.75 0-19.37-1.46-28.59-4.33l-0.38-0.12L176.19 555.1l0.19 0.26c11.86 16.42 18.12 35.83 18.12 56.14 0 17.74-4.88 35.06-14.11 50.11l-0.18 0.29 136.28 177.25 0.37-0.18c13.04-6.28 27.05-9.47 41.64-9.47z",
7224
+ "p-id": "6216"
7225
+ }, null), vue.createVNode("path", {
7226
+ d: "M416.5 2c40.15 0 76.26 25.37 89.87 63.13l0.19 0.53 0.55 0.11 299.68 61.6 0.64 0.13 0.38-0.53c8.66-12.1 20.19-22.15 33.34-29.06C854.71 90.77 870.06 87 885.5 87c52.66 0 95.5 42.84 95.5 95.5 0 18.03-5.05 35.58-14.6 50.77a95.81 95.81 0 0 1-38 34.57l-0.62 0.31 0.07 0.69 41.7 392.88 0.06 0.55 0.5 0.24c15.91 7.71 29.36 19.68 38.91 34.61 9.8 15.33 14.98 33.09 14.98 51.38 0 52.66-42.84 95.5-95.5 95.5-31.02 0-60.22-15.16-78.11-40.55l-0.43-0.62-0.71 0.25-396.09 138.59-0.55 0.19-0.1 0.57c-3.9 21.77-15.4 41.67-32.39 56.03-17.2 14.54-39.08 22.54-61.62 22.54-52.66 0-95.5-42.84-95.5-95.5 0-13.05 2.59-25.71 7.7-37.61l0.23-0.54-0.36-0.46-141.59-184.16-0.43-0.56-0.67 0.22A95.43 95.43 0 0 1 98.5 707C45.84 707 3 664.16 3 611.5S45.84 516 98.5 516c7.52 0 15.01 0.88 22.29 2.62l0.73 0.17 0.37-0.65 213.33-369.5 0.3-0.52-0.31-0.51c-9.29-15.04-14.2-32.37-14.2-50.12C321 44.84 363.84 2 416.5 2m0 191c-9.7 0-19.27-1.45-28.44-4.31l-0.76-0.24-0.4 0.69-210.98 365.43-0.32 0.56 0.38 0.52C187.77 571.99 194 591.3 194 611.5c0 17.64-4.85 34.88-14.03 49.85l-0.36 0.59 0.42 0.55 135.82 176.65 0.5 0.64 0.73-0.35c12.97-6.26 26.91-9.43 41.42-9.43 16.79 0 33.3 4.42 47.75 12.78a96.095 96.095 0 0 1 34.18 33.63l0.42 0.7 0.77-0.27 391.17-136.87 0.6-0.21 0.06-0.64c1.88-19.33 9.53-37.41 22.11-52.28 12.44-14.71 28.77-25.2 47.22-30.35l0.82-0.23-0.09-0.84-40.26-379.37-0.07-0.7-0.68-0.17c-39.52-9.77-68.5-43.58-72.11-84.12l-0.07-0.74-0.73-0.15-283.12-58.2-0.82-0.17-0.31 0.78c-6.96 17.61-18.91 32.64-34.54 43.46-15.99 11.11-34.77 16.96-54.3 16.96m0-192C363.2 1 320 44.2 320 97.5c0 18.58 5.26 35.93 14.35 50.65l-213.33 369.5A96.669 96.669 0 0 0 98.5 515C45.2 515 2 558.2 2 611.5S45.2 708 98.5 708a96.5 96.5 0 0 0 29.69-4.66l141.59 184.15c-5 11.66-7.78 24.51-7.78 38.01 0 53.3 43.2 96.5 96.5 96.5 47.46 0 86.91-34.25 94.99-79.39l396.08-138.59C867.04 828.81 895.88 845 928.5 845c53.3 0 96.5-43.2 96.5-96.5 0-38.22-22.23-71.26-54.46-86.88l-41.7-392.88C960.37 252.86 982 220.21 982 182.5c0-53.3-43.2-96.5-96.5-96.5-32.37 0-61.01 15.94-78.51 40.39l-299.68-61.6C493.91 27.59 458.31 1 416.5 1z m0 193c40.77 0 75.63-25.28 89.77-61.03l283.12 58.2c3.69 41.4 33.52 75.27 72.87 85l40.26 379.37c-37.74 10.53-66.15 43.41-70.06 83.49L441.29 875.9c-16.87-28.1-47.63-46.9-82.79-46.9-15 0-29.2 3.42-41.86 9.53L180.82 661.88c8.99-14.66 14.18-31.91 14.18-50.38 0-21.07-6.76-40.56-18.22-56.43l210.98-365.42c9.08 2.83 18.73 4.35 28.74 4.35z",
7227
+ "p-id": "6217"
7228
+ }, null) ]), vue.createVNode("p", {
7229
+ class: "label-text"
7230
+ }, [ t("next.labelme.createPolygon") ]) ]), vue.createVNode("li", {
7231
+ class: "tool-item"
7232
+ }, [ vue.createVNode("svg", {
7233
+ t: "1721826424613",
7234
+ class: "icon",
7235
+ viewBox: "0 0 1024 1024",
7236
+ version: "1.1",
7237
+ xmlns: "http://www.w3.org/2000/svg",
7238
+ "p-id": "7356",
7239
+ width: "18",
7240
+ height: "18"
7241
+ }, [ vue.createVNode("path", {
7242
+ d: "M102.4 870.4v51.2h102.4v51.2H51.2v-102.4h51.2z m870.4-51.2v153.6h-102.4v-51.2h51.2v-102.4h51.2zM409.6 921.6v51.2H358.4v-51.2h51.2z m102.4 0v51.2H460.8v-51.2h51.2z m102.4 0v51.2h-51.2v-51.2h51.2z m102.4 0v51.2h-51.2v-51.2h51.2z m102.4 0v51.2h-51.2v-51.2h51.2zM307.2 921.6v51.2H256v-51.2h51.2z m204.8-742.4a51.2 51.2 0 0 1 51.0464 55.0912l118.8352 68.608a102.4 102.4 0 1 1 96.1536 157.3888v155.136a51.2 51.2 0 1 1-51.6096 80.0256L556.3392 793.6a51.2 51.2 0 1 1-88.7296 0.0512l-169.984-98.2016A51.1488 51.1488 0 0 1 204.8 665.6a51.2 51.2 0 0 1 41.1136-50.176V408.576a51.2 51.2 0 1 1 51.712-79.9744l163.3792-94.3616L460.8 230.4a51.2 51.2 0 0 1 45.2096-50.8416zM102.4 768v51.2H51.2v-51.2h51.2z m870.4-51.2v51.2h-51.2v-51.2h51.2zM297.0624 412.8768l0.1024 222.208 1.024 1.536L486.4 745.2672v-188.928a51.2 51.2 0 0 1-25.2416-38.4L460.8 512v-0.8704L297.0624 412.8768z m399.0528 18.432L563.2 511.1808 563.2 512a51.2 51.2 0 0 1-25.5488 44.3392l-0.0512 188.8768 188.2624-108.6976 0.9216-1.28V452.096a102.6048 102.6048 0 0 1-30.6688-20.7872zM102.4 665.6v51.2H51.2v-51.2h51.2z m870.4-51.2v51.2h-51.2v-51.2h51.2zM102.4 563.2v51.2H51.2v-51.2h51.2z m870.4-51.2v51.2h-51.2v-51.2h51.2zM102.4 460.8v51.2H51.2V460.8h51.2z m387.584-184.1664L326.6048 370.8928l160.6144 96.256a50.8416 50.8416 0 0 1 18.7904-5.9904L512 460.8c9.0112 0 17.5104 2.3552 24.832 6.4l132.9664-79.7184a102.4 102.4 0 0 1-4.0448-34.7648l-131.7888-76.032a50.9952 50.9952 0 0 1-43.9808 0zM972.8 409.6v51.2h-51.2V409.6h51.2zM102.4 358.4v51.2H51.2V358.4h51.2z m870.4-51.2v51.2h-51.2V307.2h51.2zM102.4 256v51.2H51.2V256h51.2z m870.4-51.2v51.2h-51.2V204.8h51.2zM153.6 51.2v51.2H102.4v102.4H51.2V51.2h102.4z m819.2 0v102.4h-51.2V102.4h-102.4V51.2h153.6z m-409.6 0v51.2h-51.2V51.2h51.2z m102.4 0v51.2h-51.2V51.2h51.2z m102.4 0v51.2h-51.2V51.2h51.2zM256 51.2v51.2H204.8V51.2h51.2z m102.4 0v51.2H307.2V51.2h51.2z m102.4 0v51.2H409.6V51.2h51.2z",
7243
+ "p-id": "7357"
7244
+ }, null) ]), vue.createVNode("p", {
7245
+ class: "label-text"
7246
+ }, [ t("next.labelme.editPolygon") ]) ]), vue.createVNode("li", {
7247
+ class: "tool-item"
7248
+ }, [ vue.createVNode("svg", {
7249
+ t: "1721826579655",
7250
+ class: "icon",
7251
+ viewBox: "0 0 1024 1024",
7252
+ version: "1.1",
7253
+ xmlns: "http://www.w3.org/2000/svg",
7254
+ "p-id": "10996",
7255
+ width: "18",
7256
+ height: "18"
7257
+ }, [ vue.createVNode("path", {
7258
+ d: "M847.743 223.953H640.639c-3.132-68.921-60.177-124.029-129.858-124.029s-126.726 55.108-129.858 124.029H173.256c-17.673 0-32 14.327-32 32s14.327 32 32 32h674.487c17.673 0 32-14.327 32-32s-14.327-32-32-32z m-336.962-60.03c34.379 0 62.689 26.426 65.718 60.029H445.064c3.029-33.603 31.338-60.029 65.717-60.029zM767.743 351.79c-17.673 0-32 14.327-32 32v478.173H288.256V383.79c0-17.673-14.327-32-32-32s-32 14.327-32 32v510.173c0 17.673 14.327 32 32 32h511.487c17.673 0 32-14.327 32-32V383.79c0-17.673-14.327-32-32-32z",
7259
+ "p-id": "10997"
7260
+ }, null), vue.createVNode("path", {
7261
+ d: "M449.306 732.802V448.208c0-17.673-14.327-32-32-32s-32 14.327-32 32v284.593c0 17.673 14.327 32 32 32s32-14.326 32-31.999z m191.534 0V448.208c0-17.673-14.327-32-32-32s-32 14.327-32 32v284.593c0 17.673 14.327 32 32 32s32-14.326 32-31.999z",
7262
+ "p-id": "10998"
7263
+ }, null) ]), vue.createVNode("p", {
7264
+ class: "label-text"
7265
+ }, [ t("next.labelme.deletePolyton") ]) ]) ]), vue.createVNode("ul", {
7266
+ class: [ _ns.be("header", "tool") ]
7267
+ }, [ props.imageLength ? vue.createVNode("li", null, [ vue.createVNode("span", null, [ vue.createTextVNode("第 "), props.imageIndex + 1, vue.createTextVNode(" 张") ]), vue.createVNode("em", {
7268
+ style: "padding: 0 5px;"
7269
+ }, [ vue.createTextVNode("/") ]), vue.createVNode("span", null, [ vue.createTextVNode("共 "), props.imageLength, vue.createTextVNode(" 张") ]) ]) : null, vue.createVNode("li", {
7270
+ style: "margin-right: 30px;",
7271
+ class: "tool-item"
7272
+ }, [ vue.createVNode(elementPlus.ElPopover, {
7273
+ trigger: "hover",
7274
+ placement: "bottom",
7275
+ width: "none"
7276
+ }, {
7277
+ reference: () => vue.createVNode("div", {
7278
+ class: "flex-center"
7279
+ }, [ vue.createVNode("span", {
7280
+ style: "padding-right: 3px"
7281
+ }, [ t("next.labelimg.instructions") ]), vue.createVNode(elementPlus.ElIcon, {
7282
+ size: 14
7283
+ }, {
7284
+ default: () => [ vue.createVNode(warning_default, null, null) ]
7285
+ }) ]),
7286
+ default: () => vue.createVNode("ul", {
7287
+ style: "font-size: 12px;white-space: nowrap;"
7288
+ }, [ vue.createVNode("li", null, [ vue.createVNode("span", null, [ vue.createTextVNode("A:") ]), vue.createVNode("span", null, [ vue.createTextVNode("A键进入上一张图片进行标注") ]) ]), vue.createVNode("li", null, [ vue.createVNode("span", null, [ vue.createTextVNode("D:") ]), vue.createVNode("span", null, [ vue.createTextVNode("D键进入下一张图片进行标注") ]) ]) ])
7289
+ }) ]), props.isFullscreen ? vue.createVNode("li", {
7290
+ class: "tool-item",
7291
+ onClick: () => switchFillscreen(!1)
7292
+ }, [ vue.createVNode(elementPlus.ElTooltip, {
7293
+ placement: "top",
7294
+ content: "取消全屏"
7295
+ }, {
7296
+ default: () => [ vue.createVNode("svg", {
7297
+ t: "1719035442027",
7298
+ class: "icon",
7299
+ viewBox: "0 0 1024 1024",
7300
+ version: "1.1",
7301
+ xmlns: "http://www.w3.org/2000/svg",
7302
+ "p-id": "5388",
7303
+ width: "18",
7304
+ height: "18"
7305
+ }, [ vue.createVNode("path", {
7306
+ d: "M354.133333 682.666667H256v-42.666667h170.666667v170.666667H384v-98.133334L243.2 853.333333l-29.866667-29.866666L354.133333 682.666667z m358.4 0l140.8 140.8-29.866666 29.866666-140.8-140.8V810.666667h-42.666667v-170.666667h170.666667v42.666667h-98.133334zM354.133333 384L213.333333 243.2l29.866667-29.866667L384 354.133333V256h42.666667v170.666667H256V384h98.133333z m358.4 0H810.666667v42.666667h-170.666667V256h42.666667v98.133333L823.466667 213.333333l29.866666 29.866667L712.533333 384z",
7307
+ "p-id": "5389"
7308
+ }, null) ]) ]
7309
+ }) ]) : vue.createVNode("li", {
7310
+ class: "tool-item",
7311
+ onClick: () => switchFillscreen(!0)
7312
+ }, [ vue.createVNode(elementPlus.ElTooltip, {
7313
+ placement: "top",
7314
+ content: "全屏"
7315
+ }, {
7316
+ default: () => [ vue.createVNode("svg", {
7317
+ t: "1719035375323",
7318
+ class: "icon",
7319
+ viewBox: "0 0 1024 1024",
7320
+ version: "1.1",
7321
+ xmlns: "http://www.w3.org/2000/svg",
7322
+ "p-id": "5241",
7323
+ width: "18",
7324
+ height: "18"
7325
+ }, [ vue.createVNode("path", {
7326
+ d: "M285.866667 810.666667H384v42.666666H213.333333v-170.666666h42.666667v98.133333l128-128 29.866667 29.866667-128 128z m494.933333 0l-128-128 29.866667-29.866667 128 128V682.666667h42.666666v170.666666h-170.666666v-42.666666h98.133333zM285.866667 256l128 128-29.866667 29.866667-128-128V384H213.333333V213.333333h170.666667v42.666667H285.866667z m494.933333 0H682.666667V213.333333h170.666666v170.666667h-42.666666V285.866667l-128 128-29.866667-29.866667 128-128z",
7327
+ "p-id": "5242"
7328
+ }, null) ]) ]
7329
+ }) ]) ]) ]) ]);
7330
+ }
7331
+ }), defaultConfig = {
7332
+ minContentHeight: 500
7333
+ };
7334
+ const ns = useNamespace("labelme");
7335
+ var Element = vue.defineComponent({
7336
+ name: "NextLabelme",
7337
+ props: {
7338
+ className: {
7339
+ type: String,
7340
+ default: ""
7341
+ },
7342
+ style: {
7343
+ type: Object,
7344
+ default: () => ({})
7345
+ },
7346
+ options: {
7347
+ type: Object,
7348
+ default: () => ({})
7349
+ },
7350
+ classes: {
7351
+ type: Array,
7352
+ default: () => []
7353
+ },
7354
+ data: {
7355
+ type: Array,
7356
+ default: () => []
7357
+ }
7358
+ },
7359
+ emits: [ "change", "save", "edit-polygon", "prev-click", "next-click" ],
7360
+ setup(props, {emit: emit, slots: slots}) {
7361
+ const _config = deepClone(defaultConfig), _options = vue.computed((() => {
7362
+ const cfg = vue.unref(props.options);
7363
+ return merge$1(_config, cfg);
7364
+ })), options = vue.unref(_options);
7365
+ vue.provide("ns", ns);
7366
+ const {t: t} = useLocale(), activateNodeIndex = vue.ref(0), classes = vue.ref(props.classes), labelImages = vue.ref(deepClone(props.data));
7367
+ vue.watch((() => props.data), (data => {
7368
+ labelImages.value = deepClone(data);
7369
+ }), {
7370
+ deep: !0
7371
+ }), vue.watch((() => props.data.length), (() => {
7372
+ activateNodeIndex.value = 0;
7373
+ })), vue.watch((() => props.classes), (val => {
7374
+ classes.value = val;
7375
+ }), {
7376
+ deep: !0
7377
+ });
7378
+ const currentNode = vue.computed((() => {
7379
+ if (!labelImages.value) return {};
7380
+ const node = labelImages.value[activateNodeIndex.value] || {};
7381
+ return deepClone(node);
7382
+ })), loading = vue.ref(!1), mainContentHeight = vue.ref(options.minContentHeight), canvasContextRef = vue.ref(), layoutLabelRef = vue.ref(), headerRef = vue.ref(), mainRef = vue.ref(), footerRef = vue.ref(), updateMainContentHeight = () => {
7383
+ vue.nextTick((() => {
7384
+ const contentHeight = (layoutLabelRef.value?.clientHeight || 0) - ((headerRef.value?.clientHeight || 0) + (footerRef.value?.clientHeight || 0));
7385
+ mainContentHeight.value = contentHeight;
7386
+ }));
7387
+ };
7388
+ vue.onMounted((() => {
7389
+ document.addEventListener("keydown", onKeydownPrevNext), elementResize(layoutLabelRef.value.parentElement, (() => {
7390
+ updateMainContentHeight();
7391
+ })), window.addEventListener("resize", updateMainContentHeight);
7392
+ })), vue.onUnmounted((() => {
7393
+ document.removeEventListener("keydown", onKeydownPrevNext), window.removeEventListener("resize", updateMainContentHeight);
7394
+ }));
7395
+ const onKeydownPrevNext = () => {}, onPaginationPrev = () => {
7396
+ const imageLength = labelImages.value.length;
7397
+ let i = activateNodeIndex.value - 1;
7398
+ i < 0 && (i = imageLength - 1), onChangeActivateNode(i), emit("prev-click");
7399
+ }, onPaginationNext = () => {
7400
+ const imageLength = labelImages.value.length;
7401
+ let i = activateNodeIndex.value + 1;
7402
+ i >= imageLength && (i = 0), onChangeActivateNode(i), emit("next-click");
7403
+ }, onChangeActivateNode = index => {
7404
+ if (loading.value) return;
7405
+ loading.value = !0;
7406
+ const node = currentNode.value;
7407
+ emit("save", {
7408
+ node: node
7409
+ }, (imageItem => {
7410
+ labelImages.value[activateNodeIndex.value] = imageItem || node, activateNodeIndex.value = index,
7411
+ loading.value = !1;
7412
+ }), (() => {
7413
+ loading.value = !1;
7414
+ }));
7415
+ }, isFullscreen = vue.ref(!1), onSwitchFillscreen = val => {
7416
+ isFullscreen.value = val, updateMainContentHeight(), vue.nextTick((() => {
7417
+ canvasContextRef.value.rerenderImage();
7418
+ }));
7419
+ }, onEditPlygonChange = plygon => {
7420
+ emit("edit-polygon", plygon);
7421
+ };
7422
+ return () => vue.createVNode(vue.Fragment, null, [ vue.createVNode("div", {
7423
+ ref: layoutLabelRef,
7424
+ class: [ ns.b(), props.className, isFullscreen.value ? ns.b("fullscreen") : "" ],
7425
+ style: {
7426
+ ...props.style
7427
+ }
7428
+ }, [ vue.createVNode(NextSpinLoading, {
7429
+ loading: loading.value,
7430
+ tip: t("next.labelimg.saveTxt"),
7431
+ class: [ ns.b("loading") ]
7432
+ }, {
7433
+ default: () => [ vue.createVNode(elementPlus.ElScrollbar, null, {
7434
+ default: () => [ vue.createVNode("header", {
7435
+ ref: headerRef,
7436
+ class: [ ns.b("header") ]
7437
+ }, [ slots.header ? slots.header() : vue.createVNode(HeaderTool, {
7438
+ isFullscreen: isFullscreen.value,
7439
+ imageIndex: activateNodeIndex.value,
7440
+ imageLength: labelImages.value.length,
7441
+ onFullscreen: onSwitchFillscreen
7442
+ }, null) ]), vue.createVNode("div", {
7443
+ ref: mainRef,
7444
+ class: [ ns.b("main") ]
7445
+ }, [ vue.createVNode("div", {
7446
+ class: [ ns.be("main", "content") ],
7447
+ style: {
7448
+ height: mainContentHeight.value + "px"
7449
+ }
7450
+ }, [ vue.createVNode(CanvasContext, {
7451
+ ref: canvasContextRef,
7452
+ rowInfo: currentNode.value,
7453
+ onEditPolygon: onEditPlygonChange
7454
+ }, null) ]) ]), vue.createVNode("footer", {
7455
+ ref: footerRef,
7456
+ class: [ ns.b("footer") ]
7457
+ }, [ vue.createVNode("div", {
7458
+ class: [ ns.be("footer", "left") ]
7459
+ }, [ vue.createVNode(elementPlus.ElIcon, {
7460
+ size: 24,
7461
+ color: "#797979",
7462
+ onClick: onPaginationPrev
7463
+ }, {
7464
+ default: () => [ vue.createVNode(arrow_left_default, null, null) ]
7465
+ }) ]), vue.createVNode("div", {
7466
+ class: [ ns.be("footer", "center") ]
7467
+ }, [ vue.createVNode(elementPlus.ElScrollbar, null, {
7468
+ default: () => [ vue.createVNode("ul", {
7469
+ class: [ ns.bem("footer", "center", "list") ]
7470
+ }, [ labelImages.value.map(((item, index) => vue.createVNode("li", {
7471
+ key: index,
7472
+ onClick: () => onChangeActivateNode(index),
7473
+ class: {
7474
+ "is-activate": activateNodeIndex.value === index
7475
+ }
7476
+ }, [ vue.createVNode(elementPlus.ElImage, {
7477
+ style: "height: 100%",
7478
+ src: item.imageSrc,
7479
+ "zoom-rate": 1.2,
7480
+ "max-scale": 2,
7481
+ "min-scale": .2,
7482
+ fit: "cover"
7483
+ }, null) ]))) ]) ]
7484
+ }) ]), vue.createVNode("div", {
7485
+ class: [ ns.be("footer", "right") ]
7486
+ }, [ vue.createVNode(elementPlus.ElIcon, {
7487
+ size: 24,
7488
+ color: "#797979",
7489
+ onClick: onPaginationNext
7490
+ }, {
7491
+ default: () => [ vue.createVNode(arrow_right_default, null, null) ]
7492
+ }) ]) ]) ]
7493
+ }) ]
7494
+ }) ]) ]);
7495
+ }
7496
+ });
7497
+ const NextLabelme = withInstall(Element);
6801
7498
  var components = Object.freeze({
6802
7499
  __proto__: null,
6803
7500
  NextContainer: NextContainer,
@@ -6808,6 +7505,7 @@
6808
7505
  NextForm: NextForm,
6809
7506
  NextLabelimg: NextLabelimg,
6810
7507
  NextLabelimgPreview: NextLabelimgPreview,
7508
+ NextLabelme: NextLabelme,
6811
7509
  NextLayout: NextLayout,
6812
7510
  NextMenu: NextMenu,
6813
7511
  NextSpinLoading: NextSpinLoading,
@@ -6858,19 +7556,20 @@
6858
7556
  })(app);
6859
7557
  };
6860
7558
  var index = {
6861
- version: "0.3.2",
7559
+ version: "0.3.4",
6862
7560
  install: install
6863
7561
  };
6864
7562
  exports.NextContainer = NextContainer, exports.NextCrudTable = NextCrudTable, exports.NextCrudTableVirtualized = NextCrudTableVirtualized,
6865
7563
  exports.NextDialog = NextDialog, exports.NextDragResize = NextDragResize, exports.NextForm = NextForm,
6866
7564
  exports.NextLabelimg = NextLabelimg, exports.NextLabelimgPreview = NextLabelimgPreview,
6867
- exports.NextLayout = NextLayout, exports.NextMenu = NextMenu, exports.NextSpinLoading = NextSpinLoading,
6868
- exports.NextTabs = NextTabs, exports.NextTextEllipsis = NextTextEllipsis, exports.NextTreeSelect = NextTreeSelect,
6869
- exports.NextUpload = NextUpload, exports.NextVideoPlayer = NextVideoPlayer, exports.buildLocaleContext = buildLocaleContext,
6870
- exports.buildTranslator = buildTranslator, exports.default = index, exports.defaultNamespace = "next",
6871
- exports.install = install, exports.localeContextKey = localeContextKey, exports.localeLang = localeLang,
6872
- exports.namespaceContextKey = namespaceContextKey, exports.nextUseCssTheme = nextUseCssTheme,
6873
- exports.nextUseCssVar = nextUseCssVar, exports.translate = translate, exports.updateThemeColor = color => {
7565
+ exports.NextLabelme = NextLabelme, exports.NextLayout = NextLayout, exports.NextMenu = NextMenu,
7566
+ exports.NextSpinLoading = NextSpinLoading, exports.NextTabs = NextTabs, exports.NextTextEllipsis = NextTextEllipsis,
7567
+ exports.NextTreeSelect = NextTreeSelect, exports.NextUpload = NextUpload, exports.NextVideoPlayer = NextVideoPlayer,
7568
+ exports.buildLocaleContext = buildLocaleContext, exports.buildTranslator = buildTranslator,
7569
+ exports.default = index, exports.defaultNamespace = "next", exports.install = install,
7570
+ exports.localeContextKey = localeContextKey, exports.localeLang = localeLang, exports.namespaceContextKey = namespaceContextKey,
7571
+ exports.nextUseCssTheme = nextUseCssTheme, exports.nextUseCssVar = nextUseCssVar,
7572
+ exports.translate = translate, exports.updateThemeColor = color => {
6874
7573
  color && nextUseCssTheme("--el-color-primary", color);
6875
7574
  }, exports.updateThemeColorCssVar = updateThemeColorCssVar, exports.useDetectVideo = () => ({
6876
7575
  detectVideoFrameImage: ({container: container, video: video, modelUrl: modelUrl, classNames: classNames, classInput: classInput = []}, success, error) => modelUrl ? classNames ? void tf__namespace.loadGraphModel(modelUrl).then((model => {
@@ -6904,7 +7603,7 @@
6904
7603
  }), exports.useGetDerivedNamespace = useGetDerivedNamespace, exports.useLanguage = (locale, lang) => {
6905
7604
  const localeRef = vue.isRef(locale) ? locale : vue.ref(locale), nextLang = localeLang[lang] || localeLang["zh-cn"];
6906
7605
  localeRef.value.name = lang, localeRef.value.next = nextLang.next;
6907
- }, exports.useLocale = useLocale, exports.useNamespace = useNamespace, exports.version = "0.3.2",
7606
+ }, exports.useLocale = useLocale, exports.useNamespace = useNamespace, exports.version = "0.3.4",
6908
7607
  Object.defineProperty(exports, "__esModule", {
6909
7608
  value: !0
6910
7609
  });