next-element-vue 0.3.1 → 0.3.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.css +3 -2
- package/dist/index.js +634 -172
- package/dist/index.min.js +3 -3
- package/dist/index.umd.js +636 -178
- package/dist/index.umd.min.js +3 -3
- package/dist/packages/components/crud-table/src/config.d.ts +3 -0
- package/dist/packages/components/crud-table-virtualized/src/index.test.d.ts +2 -2
- package/dist/packages/components/dialog/index.d.ts +9 -0
- package/dist/packages/components/dialog/src/index.d.ts +9 -0
- package/dist/packages/components/labelimg/index.d.ts +0 -9
- package/dist/packages/components/labelimg/src/hooks/canvas-context-hook.d.ts +1 -0
- package/dist/packages/components/labelimg/src/index.d.ts +0 -9
- package/dist/packages/components/labelimg/src/widgets/tool-header.d.ts +18 -0
- package/dist/packages/components/labelme/index.d.ts +54 -0
- package/dist/packages/components/labelme/src/config.d.ts +4 -0
- package/dist/packages/components/labelme/src/hooks/canvas-content.d.ts +40 -0
- package/dist/packages/components/labelme/src/index.d.ts +54 -0
- package/dist/packages/components/labelme/src/widgets/canvas-context.d.ts +34 -0
- package/dist/packages/components.d.ts +1 -0
- package/dist/packages/hooks/use-locale/index.d.ts +1 -0
- package/dist/packages/utils/theme.d.ts +1 -0
- package/package.json +1 -1
package/dist/index.umd.js
CHANGED
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
/**
|
|
3
3
|
* 作 者:huangteng
|
|
4
4
|
* 邮 箱:htengweb@163.com
|
|
5
|
-
* 当前版本:0.3.
|
|
6
|
-
* 发布日期:2024-
|
|
5
|
+
* 当前版本:0.3.3 v
|
|
6
|
+
* 发布日期:2024-07-23
|
|
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:
|
|
@@ -988,6 +988,14 @@
|
|
|
988
988
|
for (let i = 0; i < 3; i++) hexs[i] = parseInt(hexs[i], 16);
|
|
989
989
|
return hexs;
|
|
990
990
|
},
|
|
991
|
+
hexToRgba: (str, alpha = 1) => {
|
|
992
|
+
let hexs = "";
|
|
993
|
+
if (!/^\#?[0-9A-Fa-f]{6}$/.test(str)) return elementPlus.ElMessage.warning("输入错误的hex"),
|
|
994
|
+
"";
|
|
995
|
+
hexs = (str = str.replace("#", "")).match(/../g);
|
|
996
|
+
for (let i = 0; i < 3; i++) hexs[i] = parseInt(hexs[i], 16);
|
|
997
|
+
return `rgba(${hexs.join(",")},${alpha})`;
|
|
998
|
+
},
|
|
991
999
|
rgbToHex: (r, g, b) => {
|
|
992
1000
|
let reg = /^\d{1,3}$/;
|
|
993
1001
|
if (!reg.test(r) || !reg.test(g) || !reg.test(b)) return elementPlus.ElMessage.warning("输入错误的rgb颜色值"),
|
|
@@ -1082,7 +1090,7 @@
|
|
|
1082
1090
|
}, extra) for (const [key, comp] of Object.entries(extra)) main[key] = comp;
|
|
1083
1091
|
return main;
|
|
1084
1092
|
}, slots_config_headerMenu = "header-menu", slots_config_headerToolsPrefix = "header-tools-prefix", slots_config_headerToolsSuffix = "header-tools-suffix";
|
|
1085
|
-
var defaultConfig$
|
|
1093
|
+
var defaultConfig$5 = {
|
|
1086
1094
|
logo: "",
|
|
1087
1095
|
title: "Next Element Vue",
|
|
1088
1096
|
userName: "Admin",
|
|
@@ -1129,7 +1137,7 @@
|
|
|
1129
1137
|
isDark: !1
|
|
1130
1138
|
}
|
|
1131
1139
|
};
|
|
1132
|
-
const ns$
|
|
1140
|
+
const ns$l = useNamespace("text-ellipsis");
|
|
1133
1141
|
const NextTextEllipsis = withInstall(vue.defineComponent({
|
|
1134
1142
|
name: "NextTextEllipsis",
|
|
1135
1143
|
props: {
|
|
@@ -1175,7 +1183,7 @@
|
|
|
1175
1183
|
}
|
|
1176
1184
|
};
|
|
1177
1185
|
return () => vue.createVNode(vue.Fragment, null, [ vue.createVNode("div", {
|
|
1178
|
-
class: [ ns$
|
|
1186
|
+
class: [ ns$l.b(), props.class ],
|
|
1179
1187
|
style: setWidth.value,
|
|
1180
1188
|
onMouseenter: onMouseenter
|
|
1181
1189
|
}, [ isTip.value ? vue.createVNode(elementPlus.ElTooltip, {
|
|
@@ -1185,11 +1193,11 @@
|
|
|
1185
1193
|
disabled: props.disabled
|
|
1186
1194
|
}, {
|
|
1187
1195
|
default: () => [ vue.createVNode("span", {
|
|
1188
|
-
class: ns$
|
|
1196
|
+
class: ns$l.e("text"),
|
|
1189
1197
|
ref: ellipsisRef
|
|
1190
1198
|
}, [ slots.default ? slots.default() : props.content ]) ]
|
|
1191
1199
|
}) : vue.createVNode("span", {
|
|
1192
|
-
class: ns$
|
|
1200
|
+
class: ns$l.e("text"),
|
|
1193
1201
|
ref: ellipsisRef
|
|
1194
1202
|
}, [ slots.default ? slots.default() : props.content ]) ]) ]);
|
|
1195
1203
|
}
|
|
@@ -2524,7 +2532,7 @@
|
|
|
2524
2532
|
}, null) ]
|
|
2525
2533
|
}))) ]) ]);
|
|
2526
2534
|
}
|
|
2527
|
-
}), ns$
|
|
2535
|
+
}), ns$k = useNamespace("menu");
|
|
2528
2536
|
const NextMenu = withInstall(vue.defineComponent({
|
|
2529
2537
|
name: "NextMenu",
|
|
2530
2538
|
props: {
|
|
@@ -2551,13 +2559,13 @@
|
|
|
2551
2559
|
}
|
|
2552
2560
|
},
|
|
2553
2561
|
setup(props) {
|
|
2554
|
-
vue.provide("ns", ns$
|
|
2562
|
+
vue.provide("ns", ns$k);
|
|
2555
2563
|
const router = vue.getCurrentInstance().appContext.config.globalProperties.$router, currentPath = router.currentRoute?.value.fullPath, activePath = vue.ref(currentPath);
|
|
2556
2564
|
vue.watch((() => router.currentRoute?.value), (to => {
|
|
2557
2565
|
activePath.value = to.fullPath;
|
|
2558
2566
|
}));
|
|
2559
2567
|
return () => vue.createVNode(vue.Fragment, null, [ vue.createVNode(elementPlus.ElMenu, {
|
|
2560
|
-
class: [ ns$
|
|
2568
|
+
class: [ ns$k.b(), props.className ],
|
|
2561
2569
|
style: props.style,
|
|
2562
2570
|
defaultActive: activePath.value,
|
|
2563
2571
|
router: props.router,
|
|
@@ -2565,7 +2573,7 @@
|
|
|
2565
2573
|
ellipsis: !0
|
|
2566
2574
|
}, {
|
|
2567
2575
|
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$
|
|
2576
|
+
"popper-class": ns$k.b("popper"),
|
|
2569
2577
|
index: item.path || item.id,
|
|
2570
2578
|
teleported: !0
|
|
2571
2579
|
}, {
|
|
@@ -2576,7 +2584,7 @@
|
|
|
2576
2584
|
menuData: item.children
|
|
2577
2585
|
}, null)
|
|
2578
2586
|
}) : valueExist(item.meta?.isHide, !1) ? null : vue.createVNode(elementPlus.ElMenuItem, {
|
|
2579
|
-
"popper-class": ns$
|
|
2587
|
+
"popper-class": ns$k.b("popper"),
|
|
2580
2588
|
index: item.path
|
|
2581
2589
|
}, {
|
|
2582
2590
|
default: () => [ vue.createVNode(MenuItemTitle, {
|
|
@@ -2602,19 +2610,19 @@
|
|
|
2602
2610
|
}) ]);
|
|
2603
2611
|
}
|
|
2604
2612
|
});
|
|
2605
|
-
const ns$
|
|
2613
|
+
const ns$j = useNamespace("layout-defaults");
|
|
2606
2614
|
var defaults = vue.defineComponent({
|
|
2607
2615
|
props: {},
|
|
2608
|
-
setup: () => (vue.provide("ns", ns$
|
|
2616
|
+
setup: () => (vue.provide("ns", ns$j), {}),
|
|
2609
2617
|
render() {
|
|
2610
2618
|
const slots = this.$slots, _config = vue.inject("options", {}), _emit = vue.inject("__emit__", {});
|
|
2611
2619
|
slots.menu;
|
|
2612
2620
|
const isTabs = vue.ref(!!slots.tabs);
|
|
2613
2621
|
return void 0 === slots.tabs && _config.showTabs && (isTabs.value = !0), vue.createVNode(elementPlus.ElContainer, {
|
|
2614
|
-
class: ns$
|
|
2622
|
+
class: ns$j.b()
|
|
2615
2623
|
}, {
|
|
2616
2624
|
default: () => [ vue.createVNode(Sidebar$2, null, null), vue.createVNode("div", {
|
|
2617
|
-
class: [ ns$
|
|
2625
|
+
class: [ ns$j.b("content") ]
|
|
2618
2626
|
}, [ vue.createVNode(Header$3, null, null), _config.showTabs ? slots.tabs ? slots.tabs?.() : vue.createVNode(NextTabs, {
|
|
2619
2627
|
tabs: _config.tabs,
|
|
2620
2628
|
activeTab: _config.activeTab,
|
|
@@ -2622,7 +2630,7 @@
|
|
|
2622
2630
|
onSelect: (...arg) => _emit("tabsSelect", ...arg),
|
|
2623
2631
|
onClose: (...arg) => _emit("tabsClose", ...arg)
|
|
2624
2632
|
}, null) : null, vue.createVNode("main", {
|
|
2625
|
-
class: [ ns$
|
|
2633
|
+
class: [ ns$j.bf("main"), ns$j.is("layout-tabs", isTabs.value) ]
|
|
2626
2634
|
}, [ slots.default?.() ]) ]) ]
|
|
2627
2635
|
});
|
|
2628
2636
|
}
|
|
@@ -2652,10 +2660,10 @@
|
|
|
2652
2660
|
}) ]) ]) ]);
|
|
2653
2661
|
}
|
|
2654
2662
|
});
|
|
2655
|
-
const ns$
|
|
2663
|
+
const ns$i = useNamespace("layout-transverse");
|
|
2656
2664
|
var transverse = vue.defineComponent({
|
|
2657
2665
|
props: {},
|
|
2658
|
-
setup: () => (vue.provide("ns", ns$
|
|
2666
|
+
setup: () => (vue.provide("ns", ns$i), {}),
|
|
2659
2667
|
render() {
|
|
2660
2668
|
const slots = this.$slots, _config = vue.inject("options", {}), _emit = vue.inject("__emit__", {}), __slots_header = {};
|
|
2661
2669
|
slots[slots_config_headerMenu] && (__slots_header[slots_config_headerMenu] = () => slots[slots_config_headerMenu]()),
|
|
@@ -2672,7 +2680,7 @@
|
|
|
2672
2680
|
onSelect: (...arg) => _emit("tabsSelect", ...arg),
|
|
2673
2681
|
onClose: (...arg) => _emit("tabsClose", ...arg)
|
|
2674
2682
|
}, null) : null, vue.createVNode("main", {
|
|
2675
|
-
class: [ ns$
|
|
2683
|
+
class: [ ns$i.b("main"), ns$i.is("layout-tabs", isTabs.value) ]
|
|
2676
2684
|
}, [ slots.default?.() ]) ]);
|
|
2677
2685
|
var s;
|
|
2678
2686
|
}
|
|
@@ -2711,10 +2719,10 @@
|
|
|
2711
2719
|
}, null) ]);
|
|
2712
2720
|
}
|
|
2713
2721
|
});
|
|
2714
|
-
const ns$
|
|
2722
|
+
const ns$h = useNamespace("layout-columns");
|
|
2715
2723
|
var columns = vue.defineComponent({
|
|
2716
2724
|
props: {},
|
|
2717
|
-
setup: () => (vue.provide("ns", ns$
|
|
2725
|
+
setup: () => (vue.provide("ns", ns$h), {}),
|
|
2718
2726
|
render() {
|
|
2719
2727
|
const slots = this.$slots, _config = vue.inject("options", {}), _emit = vue.inject("__emit__", {}), __slots_header = {};
|
|
2720
2728
|
slots[slots_config_headerMenu] && (__slots_header[slots_config_headerMenu] = () => slots[slots_config_headerMenu]()),
|
|
@@ -2722,11 +2730,11 @@
|
|
|
2722
2730
|
slots[slots_config_headerToolsSuffix] && (__slots_header[slots_config_headerToolsSuffix] = () => slots[slots_config_headerToolsSuffix]());
|
|
2723
2731
|
const isTabs = vue.ref(!!slots.tabs);
|
|
2724
2732
|
return void 0 === slots.tabs && _config.showTabs && (isTabs.value = !0), vue.createVNode(elementPlus.ElContainer, {
|
|
2725
|
-
class: ns$
|
|
2733
|
+
class: ns$h.b()
|
|
2726
2734
|
}, {
|
|
2727
2735
|
default: () => {
|
|
2728
2736
|
return [ vue.createVNode(Sidebar$1, null, null), vue.createVNode("div", {
|
|
2729
|
-
class: [ ns$
|
|
2737
|
+
class: [ ns$h.b("content") ]
|
|
2730
2738
|
}, [ vue.createVNode(Header$1, null, (s = __slots_header, "function" == typeof s || "[object Object]" === Object.prototype.toString.call(s) && !vue.isVNode(s) ? __slots_header : {
|
|
2731
2739
|
default: () => [ __slots_header ]
|
|
2732
2740
|
})), _config.showTabs ? slots.tabs ? slots.tabs?.() : vue.createVNode(NextTabs, {
|
|
@@ -2736,7 +2744,7 @@
|
|
|
2736
2744
|
onSelect: (...arg) => _emit("tabsSelect", ...arg),
|
|
2737
2745
|
onClose: (...arg) => _emit("tabsClose", ...arg)
|
|
2738
2746
|
}, null) : null, vue.createVNode("main", {
|
|
2739
|
-
class: [ ns$
|
|
2747
|
+
class: [ ns$h.bf("main"), ns$h.is("layout-tabs", isTabs.value) ]
|
|
2740
2748
|
}, [ slots.default?.() ]) ]) ];
|
|
2741
2749
|
var s;
|
|
2742
2750
|
}
|
|
@@ -2779,20 +2787,20 @@
|
|
|
2779
2787
|
}) ]);
|
|
2780
2788
|
}
|
|
2781
2789
|
});
|
|
2782
|
-
const ns$
|
|
2790
|
+
const ns$g = useNamespace("layout-classic");
|
|
2783
2791
|
var classic = vue.defineComponent({
|
|
2784
2792
|
props: {},
|
|
2785
|
-
setup: () => (vue.provide("ns", ns$
|
|
2786
|
-
ns: ns$
|
|
2793
|
+
setup: () => (vue.provide("ns", ns$g), {
|
|
2794
|
+
ns: ns$g
|
|
2787
2795
|
}),
|
|
2788
2796
|
render() {
|
|
2789
2797
|
const slots = this.$slots, _config = vue.inject("options", {}), _emit = vue.inject("__emit__", {});
|
|
2790
2798
|
slots.menu;
|
|
2791
2799
|
const isTabs = vue.ref(!!slots.tabs);
|
|
2792
2800
|
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$
|
|
2801
|
+
class: [ ns$g.b("content"), ns$g.is("layout-tabs", isTabs.value) ]
|
|
2794
2802
|
}, [ vue.createVNode(Sidebar, null, null), vue.createVNode("div", {
|
|
2795
|
-
class: ns$
|
|
2803
|
+
class: ns$g.b("container")
|
|
2796
2804
|
}, [ _config.showTabs ? slots.tabs ? slots.tabs?.() : vue.createVNode(NextTabs, {
|
|
2797
2805
|
tabs: _config.tabs,
|
|
2798
2806
|
activeTab: _config.activeTab,
|
|
@@ -2800,11 +2808,11 @@
|
|
|
2800
2808
|
onSelect: (...arg) => _emit("tabsSelect", ...arg),
|
|
2801
2809
|
onClose: (...arg) => _emit("tabsClose", ...arg)
|
|
2802
2810
|
}, null) : null, vue.createVNode("main", {
|
|
2803
|
-
class: [ ns$
|
|
2811
|
+
class: [ ns$g.b("main") ]
|
|
2804
2812
|
}, [ slots.default?.() ]) ]) ]) ]);
|
|
2805
2813
|
}
|
|
2806
2814
|
});
|
|
2807
|
-
const ns$
|
|
2815
|
+
const ns$f = useNamespace("layout"), layouts = {
|
|
2808
2816
|
defaults: vue.markRaw(defaults),
|
|
2809
2817
|
transverse: vue.markRaw(transverse),
|
|
2810
2818
|
columns: vue.markRaw(columns),
|
|
@@ -2830,8 +2838,8 @@
|
|
|
2830
2838
|
},
|
|
2831
2839
|
emits: [ "changeLanguage", "changeUserDropdown", "changeOptions", "tabsChange", "tabsSelect", "tabsClose" ],
|
|
2832
2840
|
setup(props, {slots: slots, emit: emit}) {
|
|
2833
|
-
const _config = vue.ref(mergeWith(defaultConfig$
|
|
2834
|
-
vue.provide("options", _config.value), vue.provide("__ns__", ns$
|
|
2841
|
+
const _config = vue.ref(mergeWith(defaultConfig$5, props.options, customizerCoverArray));
|
|
2842
|
+
vue.provide("options", _config.value), vue.provide("__ns__", ns$f), vue.provide("__emit__", emit),
|
|
2835
2843
|
vue.provide("__slots__", slots);
|
|
2836
2844
|
const updateOptions = cfg => {
|
|
2837
2845
|
_config.value = mergeWith(_config.value, cfg, customizerCoverArray), updateThemeColorCssVar(_config.value?.setting),
|
|
@@ -2855,14 +2863,14 @@
|
|
|
2855
2863
|
const _activeSlots = {};
|
|
2856
2864
|
for (const key in slots) Object.prototype.hasOwnProperty.call(slots, key) && (_activeSlots[key] = () => slots[key]?.());
|
|
2857
2865
|
return vue.createVNode("div", {
|
|
2858
|
-
class: [ ns$
|
|
2866
|
+
class: [ ns$f.b(), props.className ],
|
|
2859
2867
|
style: props.style
|
|
2860
2868
|
}, [ vue.h(activeLayout.value, {}, {
|
|
2861
2869
|
..._activeSlots
|
|
2862
2870
|
}) ]);
|
|
2863
2871
|
}
|
|
2864
|
-
})), ns$
|
|
2865
|
-
var Element$
|
|
2872
|
+
})), ns$e = useNamespace("tabs");
|
|
2873
|
+
var Element$9 = vue.defineComponent({
|
|
2866
2874
|
name: "NextTabs",
|
|
2867
2875
|
props: {
|
|
2868
2876
|
activeTab: {
|
|
@@ -2931,12 +2939,12 @@
|
|
|
2931
2939
|
tabsView.value.push(activeRoute)), emit("change", activeIndex.value, tabsView.value, "add");
|
|
2932
2940
|
}));
|
|
2933
2941
|
const renderContent = () => vue.createVNode("nav", {
|
|
2934
|
-
class: ns$
|
|
2942
|
+
class: ns$e.b()
|
|
2935
2943
|
}, [ vue.createVNode(elementPlus.ElScrollbar, null, {
|
|
2936
2944
|
default: () => [ vue.createVNode("ul", {
|
|
2937
|
-
class: ns$
|
|
2945
|
+
class: ns$e.b("list")
|
|
2938
2946
|
}, [ tabsView.value.map(((tab, index) => tab ? vue.createVNode("li", {
|
|
2939
|
-
class: [ "tab-item", ns$
|
|
2947
|
+
class: [ "tab-item", ns$e.is("active", activeIndex.value === index) ],
|
|
2940
2948
|
onClick: event => onClickTabItem(event, tab, index)
|
|
2941
2949
|
}, [ vue.createVNode("i", {
|
|
2942
2950
|
class: [ "tab-icon", tab.meta?.icon ]
|
|
@@ -2967,11 +2975,11 @@
|
|
|
2967
2975
|
onCommand: onChange
|
|
2968
2976
|
}, {
|
|
2969
2977
|
default: () => vue.createVNode("span", {
|
|
2970
|
-
class: ns$
|
|
2978
|
+
class: ns$e.b("tab-more")
|
|
2971
2979
|
}, [ vue.createVNode("i", {
|
|
2972
|
-
class: [ ns$
|
|
2980
|
+
class: [ ns$e.be("tab-more", "box"), ns$e.be("tab-more", "top") ]
|
|
2973
2981
|
}, null), vue.createVNode("i", {
|
|
2974
|
-
class: [ ns$
|
|
2982
|
+
class: [ ns$e.be("tab-more", "box"), ns$e.be("tab-more", "bottom") ]
|
|
2975
2983
|
}, null) ]),
|
|
2976
2984
|
dropdown: () => vue.createVNode(elementPlus.ElDropdownMenu, null, {
|
|
2977
2985
|
default: () => [ vue.createVNode(elementPlus.ElDropdownItem, {
|
|
@@ -3004,7 +3012,7 @@
|
|
|
3004
3012
|
return () => vue.createVNode(vue.Fragment, null, [ renderContent() ]);
|
|
3005
3013
|
}
|
|
3006
3014
|
});
|
|
3007
|
-
const NextTabs = withInstall(Element$
|
|
3015
|
+
const NextTabs = withInstall(Element$9), ns$d = useNamespace("container");
|
|
3008
3016
|
const NextContainer = withInstall(vue.defineComponent({
|
|
3009
3017
|
name: "NextContainer",
|
|
3010
3018
|
props: {
|
|
@@ -3042,18 +3050,18 @@
|
|
|
3042
3050
|
}), style;
|
|
3043
3051
|
}));
|
|
3044
3052
|
return () => props.scrollbar ? vue.createVNode(elementPlus.ElScrollbar, {
|
|
3045
|
-
class: [ ns$
|
|
3053
|
+
class: [ ns$d.b(), props.className ],
|
|
3046
3054
|
style: props.style
|
|
3047
3055
|
}, {
|
|
3048
3056
|
default: () => [ slots.default?.() ]
|
|
3049
3057
|
}) : vue.createVNode("div", {
|
|
3050
|
-
class: [ ns$
|
|
3058
|
+
class: [ ns$d.b(), props.className ],
|
|
3051
3059
|
style: {
|
|
3052
3060
|
...styles.value,
|
|
3053
3061
|
...props.style
|
|
3054
3062
|
}
|
|
3055
3063
|
}, [ props.card ? vue.createVNode("div", {
|
|
3056
|
-
class: ns$
|
|
3064
|
+
class: ns$d.b("card")
|
|
3057
3065
|
}, [ slots.default?.() ]) : slots.default?.() ]);
|
|
3058
3066
|
}
|
|
3059
3067
|
}));
|
|
@@ -3127,7 +3135,7 @@
|
|
|
3127
3135
|
}
|
|
3128
3136
|
};
|
|
3129
3137
|
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$
|
|
3138
|
+
var defaultConfig$4 = {
|
|
3131
3139
|
initLoadData: !0,
|
|
3132
3140
|
defaultContentHeight: 300,
|
|
3133
3141
|
fullscreenchangeContentHeight: !1,
|
|
@@ -3159,6 +3167,8 @@
|
|
|
3159
3167
|
settingBtn: !0,
|
|
3160
3168
|
operations: !0,
|
|
3161
3169
|
operationsWidth: 260,
|
|
3170
|
+
operationsHeaderAlign: "center",
|
|
3171
|
+
operationsColumnAlign: "center",
|
|
3162
3172
|
operationsBtnPlain: !1,
|
|
3163
3173
|
operationsBtnText: !0,
|
|
3164
3174
|
operationsBtnSize: "small",
|
|
@@ -3173,7 +3183,7 @@
|
|
|
3173
3183
|
formSpan: 12,
|
|
3174
3184
|
formColumnMinWidth: 350
|
|
3175
3185
|
};
|
|
3176
|
-
const columnSlotName = prop => "column-" + prop, searchFormSlotName = prop => "search-" + prop, formSlotName = prop => "form-" + prop, ns$
|
|
3186
|
+
const columnSlotName = prop => "column-" + prop, searchFormSlotName = prop => "search-" + prop, formSlotName = prop => "form-" + prop, ns$c = useNamespace("spin-loading");
|
|
3177
3187
|
var NextSpinLoading$1 = vue.defineComponent({
|
|
3178
3188
|
name: "NextSpinLoading",
|
|
3179
3189
|
props: {
|
|
@@ -3207,22 +3217,22 @@
|
|
|
3207
3217
|
const _t = this.t, slots = this.$slots, props = this.$props, loadingText = props.tip || _t("next.loading");
|
|
3208
3218
|
return vue.createVNode("div", {
|
|
3209
3219
|
ref: "elementInstance",
|
|
3210
|
-
class: [ ns$
|
|
3220
|
+
class: [ ns$c.b(), props.className ],
|
|
3211
3221
|
style: props.style
|
|
3212
3222
|
}, [ slots.default?.(), props.loading ? vue.createVNode("div", {
|
|
3213
|
-
class: ns$
|
|
3223
|
+
class: ns$c.b("mask")
|
|
3214
3224
|
}, [ vue.createVNode("span", {
|
|
3215
|
-
class: ns$
|
|
3225
|
+
class: ns$c.b("mask-dot")
|
|
3216
3226
|
}, [ vue.createVNode("i", {
|
|
3217
|
-
class: ns$
|
|
3227
|
+
class: ns$c.be("mask", "dot-item")
|
|
3218
3228
|
}, null), vue.createVNode("i", {
|
|
3219
|
-
class: ns$
|
|
3229
|
+
class: ns$c.be("mask", "dot-item")
|
|
3220
3230
|
}, null), vue.createVNode("i", {
|
|
3221
|
-
class: ns$
|
|
3231
|
+
class: ns$c.be("mask", "dot-item")
|
|
3222
3232
|
}, null), vue.createVNode("i", {
|
|
3223
|
-
class: ns$
|
|
3233
|
+
class: ns$c.be("mask", "dot-item")
|
|
3224
3234
|
}, null) ]), vue.createVNode("span", {
|
|
3225
|
-
class: ns$
|
|
3235
|
+
class: ns$c.be("mask", "text")
|
|
3226
3236
|
}, [ loadingText ]) ]) : null ]);
|
|
3227
3237
|
}
|
|
3228
3238
|
}), SearchColumn = vue.defineComponent({
|
|
@@ -3752,7 +3762,9 @@
|
|
|
3752
3762
|
}, mergeDicData = loopDicData(columnOption.dicData);
|
|
3753
3763
|
return vue.createVNode("span", null, [ _formatterColumnValue(row[columnOption.prop], mergeDicData) ]);
|
|
3754
3764
|
}
|
|
3755
|
-
return null
|
|
3765
|
+
return columnOption.cellUnit ? vue.createVNode(vue.Fragment, null, [ vue.createVNode("span", null, [ row[columnOption.prop] ]), vue.createVNode("em", {
|
|
3766
|
+
class: "cell-unit"
|
|
3767
|
+
}, [ columnOption.cellUnit ]) ]) : null;
|
|
3756
3768
|
};
|
|
3757
3769
|
return () => vue.createVNode(vue.Fragment, null, [ !columnOption.hide && vue.createVNode(elementPlus.ElTableColumn, {
|
|
3758
3770
|
prop: columnOption.prop,
|
|
@@ -3783,8 +3795,8 @@
|
|
|
3783
3795
|
fixed: "right",
|
|
3784
3796
|
label: t("next.table.operation"),
|
|
3785
3797
|
width: options.operationsWidth,
|
|
3786
|
-
headerAlign: options.headerAlign,
|
|
3787
|
-
align: options.cellAlign
|
|
3798
|
+
headerAlign: valueExist(options.operationsHeaderAlign, options.headerAlign),
|
|
3799
|
+
align: valueExist(options.operationsColumnAlign, options.cellAlign)
|
|
3788
3800
|
}, {
|
|
3789
3801
|
default: scoped => vue.createVNode(vue.Fragment, null, [ slots["operation-column-prefix"]?.(scoped, {
|
|
3790
3802
|
text: btnText,
|
|
@@ -3907,7 +3919,7 @@
|
|
|
3907
3919
|
}, null) ]);
|
|
3908
3920
|
}
|
|
3909
3921
|
});
|
|
3910
|
-
const ns$
|
|
3922
|
+
const ns$b = useNamespace("dialog");
|
|
3911
3923
|
var NextDialog$1 = vue.defineComponent({
|
|
3912
3924
|
name: "NextDialog",
|
|
3913
3925
|
props: {
|
|
@@ -3935,6 +3947,10 @@
|
|
|
3935
3947
|
type: Boolean,
|
|
3936
3948
|
default: !0
|
|
3937
3949
|
},
|
|
3950
|
+
showClose: {
|
|
3951
|
+
type: Boolean,
|
|
3952
|
+
default: !0
|
|
3953
|
+
},
|
|
3938
3954
|
appendToBody: {
|
|
3939
3955
|
type: Boolean,
|
|
3940
3956
|
default: !1
|
|
@@ -3972,7 +3988,7 @@
|
|
|
3972
3988
|
return () => vue.createVNode(vue.Fragment, null, [ vue.createVNode(elementPlus.ElDialog, {
|
|
3973
3989
|
modelValue: visible.value,
|
|
3974
3990
|
"onUpdate:modelValue": $event => visible.value = $event,
|
|
3975
|
-
class: ns$
|
|
3991
|
+
class: ns$b.b(),
|
|
3976
3992
|
title: props.title,
|
|
3977
3993
|
appendToBody: props.appendToBody,
|
|
3978
3994
|
"destroy-on-close": !0,
|
|
@@ -3989,18 +4005,18 @@
|
|
|
3989
4005
|
}, {
|
|
3990
4006
|
default: () => [ slots.default?.() ],
|
|
3991
4007
|
header: ({close: close, titleId: titleId, titleClass: titleClass}) => vue.createVNode("div", {
|
|
3992
|
-
class: ns$
|
|
4008
|
+
class: ns$b.b("header")
|
|
3993
4009
|
}, [ vue.createVNode("h4", {
|
|
3994
4010
|
id: titleId,
|
|
3995
4011
|
class: titleClass
|
|
3996
4012
|
}, [ props.title ]), vue.createVNode("div", {
|
|
3997
|
-
class: ns$
|
|
4013
|
+
class: ns$b.e("header-right")
|
|
3998
4014
|
}, [ props.fullscreenBtn && vue.createVNode("span", {
|
|
3999
4015
|
class: "icon-fullscreen",
|
|
4000
4016
|
onClick: () => isFullscreen.value = !isFullscreen.value
|
|
4001
4017
|
}, [ vue.createVNode(elementPlus.ElIcon, null, {
|
|
4002
4018
|
default: () => [ vue.createVNode(full_screen_default, null, null) ]
|
|
4003
|
-
}) ]), vue.createVNode("span", {
|
|
4019
|
+
}) ]), props.showClose && vue.createVNode("span", {
|
|
4004
4020
|
class: "icon-close",
|
|
4005
4021
|
onClick: close
|
|
4006
4022
|
}, [ vue.createVNode(elementPlus.ElIcon, {
|
|
@@ -4026,7 +4042,7 @@
|
|
|
4026
4042
|
settingBtn: !0,
|
|
4027
4043
|
operations: !1
|
|
4028
4044
|
};
|
|
4029
|
-
var defaultConfig$
|
|
4045
|
+
var defaultConfig$3 = {
|
|
4030
4046
|
size: "default",
|
|
4031
4047
|
colSpan: 8,
|
|
4032
4048
|
labelWidth: "6em",
|
|
@@ -4040,7 +4056,7 @@
|
|
|
4040
4056
|
submitText: null,
|
|
4041
4057
|
resetText: null
|
|
4042
4058
|
};
|
|
4043
|
-
const ns$
|
|
4059
|
+
const ns$a = useNamespace("form");
|
|
4044
4060
|
var NumberRangePicker = vue.defineComponent({
|
|
4045
4061
|
name: "NumberRangePicker",
|
|
4046
4062
|
props: {
|
|
@@ -4079,7 +4095,7 @@
|
|
|
4079
4095
|
}));
|
|
4080
4096
|
return () => vue.createVNode(vue.Fragment, null, [ vue.createVNode("div", {
|
|
4081
4097
|
ref: numberRangeRef,
|
|
4082
|
-
class: ns$
|
|
4098
|
+
class: ns$a.e("number-range")
|
|
4083
4099
|
}, [ vue.createVNode(elementPlus.ElInputNumber, {
|
|
4084
4100
|
modelValue: startNumber.value,
|
|
4085
4101
|
"onUpdate:modelValue": $event => startNumber.value = $event,
|
|
@@ -4089,7 +4105,7 @@
|
|
|
4089
4105
|
disabled: disabled,
|
|
4090
4106
|
onChange: onChangeStart
|
|
4091
4107
|
}, null), vue.createVNode("span", {
|
|
4092
|
-
class: ns$
|
|
4108
|
+
class: ns$a.em("number-range", "division")
|
|
4093
4109
|
}, [ t("next.date.rangeSeparator") ]), vue.createVNode(elementPlus.ElInputNumber, {
|
|
4094
4110
|
modelValue: endNumber.value,
|
|
4095
4111
|
"onUpdate:modelValue": $event => endNumber.value = $event,
|
|
@@ -4105,7 +4121,7 @@
|
|
|
4105
4121
|
function _isSlot$3(s) {
|
|
4106
4122
|
return "function" == typeof s || "[object Object]" === Object.prototype.toString.call(s) && !vue.isVNode(s);
|
|
4107
4123
|
}
|
|
4108
|
-
const ns$
|
|
4124
|
+
const ns$9 = useNamespace("form"), InputTableSelect = vue.defineComponent({
|
|
4109
4125
|
name: "InputTableSelect",
|
|
4110
4126
|
props: {
|
|
4111
4127
|
modelValue: {
|
|
@@ -4133,7 +4149,7 @@
|
|
|
4133
4149
|
},
|
|
4134
4150
|
emits: [ "select" ],
|
|
4135
4151
|
setup(props, {emit: emit}) {
|
|
4136
|
-
const {t: t} = useLocale(), _disabled = props.disabled, _column = props.column, _placeholder = _column.placeholder || t("next.form.select") + _column.label, _tableDefaultConfig = deepClone(defaultConfig$
|
|
4152
|
+
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({
|
|
4137
4153
|
visible: !1,
|
|
4138
4154
|
title: _column.label + t("next.form.tableSelect"),
|
|
4139
4155
|
dialogWidth: _options.dialogWidth
|
|
@@ -4204,18 +4220,18 @@
|
|
|
4204
4220
|
}, renderContent = () => {
|
|
4205
4221
|
let _slot, _slot2;
|
|
4206
4222
|
return vue.createVNode(vue.Fragment, null, [ vue.createVNode("div", {
|
|
4207
|
-
class: [ "el-input", ns$
|
|
4223
|
+
class: [ "el-input", ns$9.e("input-table"), ns$9.is("disabled", _disabled) ]
|
|
4208
4224
|
}, [ vue.createVNode("div", {
|
|
4209
4225
|
class: "el-input__wrapper"
|
|
4210
4226
|
}, [ tags?.value.length ? vue.createVNode("span", {
|
|
4211
|
-
class: ns$
|
|
4227
|
+
class: ns$9.em("input-table", "value")
|
|
4212
4228
|
}, [ tags.value.map(((tag, index) => vue.createVNode(elementPlus.ElTag, {
|
|
4213
4229
|
closable: !_disabled,
|
|
4214
4230
|
onClose: () => _onCloseTag(0, index)
|
|
4215
4231
|
}, {
|
|
4216
4232
|
default: () => [ tag.label ]
|
|
4217
4233
|
}))), tagsMore?.value?.length ? vue.createVNode(elementPlus.ElTooltip, {
|
|
4218
|
-
"popper-class": ns$
|
|
4234
|
+
"popper-class": ns$9.e("tooltip-tags"),
|
|
4219
4235
|
placement: "bottom",
|
|
4220
4236
|
effect: "light"
|
|
4221
4237
|
}, {
|
|
@@ -4229,10 +4245,10 @@
|
|
|
4229
4245
|
default: () => [ tag.label ]
|
|
4230
4246
|
})))
|
|
4231
4247
|
}) : null ]) : vue.createVNode("span", {
|
|
4232
|
-
class: ns$
|
|
4248
|
+
class: ns$9.em("input-table", "placeholder")
|
|
4233
4249
|
}, [ _placeholder ]) ]), vue.createVNode(elementPlus.ElButton, {
|
|
4234
4250
|
type: "primary",
|
|
4235
|
-
class: ns$
|
|
4251
|
+
class: ns$9.em("input-table", "append"),
|
|
4236
4252
|
disabled: _disabled,
|
|
4237
4253
|
icon: search_default,
|
|
4238
4254
|
onClick: onClickTableDialog
|
|
@@ -4246,7 +4262,7 @@
|
|
|
4246
4262
|
onClose: onCloseTableDialog
|
|
4247
4263
|
}, {
|
|
4248
4264
|
default: () => [ vue.createVNode("div", {
|
|
4249
|
-
class: ns$
|
|
4265
|
+
class: ns$9.em("input-table", "content")
|
|
4250
4266
|
}, [ vue.createVNode(elementPlus.ElRadioGroup, {
|
|
4251
4267
|
modelValue: sinleSelection.value
|
|
4252
4268
|
}, {
|
|
@@ -4269,7 +4285,7 @@
|
|
|
4269
4285
|
}) ]
|
|
4270
4286
|
}) ]
|
|
4271
4287
|
}) ]), vue.createVNode("div", {
|
|
4272
|
-
class: ns$
|
|
4288
|
+
class: ns$9.em("input-table", "footer")
|
|
4273
4289
|
}, [ vue.createVNode(elementPlus.ElButton, {
|
|
4274
4290
|
onClick: onResetTableSelect
|
|
4275
4291
|
}, _isSlot$3(_slot = t("next.form.reset")) ? _slot : {
|
|
@@ -4285,7 +4301,7 @@
|
|
|
4285
4301
|
};
|
|
4286
4302
|
return () => vue.createVNode(vue.Fragment, null, [ renderContent() ]);
|
|
4287
4303
|
}
|
|
4288
|
-
}), ns$
|
|
4304
|
+
}), ns$8 = useNamespace("form");
|
|
4289
4305
|
var UploadImage = vue.defineComponent({
|
|
4290
4306
|
name: "UploadImage",
|
|
4291
4307
|
props: {
|
|
@@ -4341,7 +4357,7 @@
|
|
|
4341
4357
|
let urls = [];
|
|
4342
4358
|
return "string" == typeof value ? urls = [ value ] : "[object Array]" === Object.prototype.toString.call(value) && (urls = value),
|
|
4343
4359
|
urls = urls.filter((url => !!url)), urls.length ? vue.createVNode(elementPlus.ElImage, {
|
|
4344
|
-
class: ns$
|
|
4360
|
+
class: ns$8.e("preview-image"),
|
|
4345
4361
|
src: urls[0],
|
|
4346
4362
|
previewSrcList: urls,
|
|
4347
4363
|
"preview-teleported": !0,
|
|
@@ -4356,7 +4372,7 @@
|
|
|
4356
4372
|
})
|
|
4357
4373
|
}) : null;
|
|
4358
4374
|
})(), _disabled ? null : vue.createVNode(elementPlus.ElUpload, {
|
|
4359
|
-
class: [ ns$
|
|
4375
|
+
class: [ ns$8.b("upload-image"), props.className ],
|
|
4360
4376
|
style: props.style,
|
|
4361
4377
|
"list-type": props.listType,
|
|
4362
4378
|
multiple: props.multiple,
|
|
@@ -4492,8 +4508,8 @@
|
|
|
4492
4508
|
function _isSlot$2(s) {
|
|
4493
4509
|
return "function" == typeof s || "[object Object]" === Object.prototype.toString.call(s) && !vue.isVNode(s);
|
|
4494
4510
|
}
|
|
4495
|
-
const ns$
|
|
4496
|
-
var Element$
|
|
4511
|
+
const ns$7 = useNamespace("form");
|
|
4512
|
+
var Element$7 = vue.defineComponent({
|
|
4497
4513
|
name: "NextForm",
|
|
4498
4514
|
props: {
|
|
4499
4515
|
options: {
|
|
@@ -4511,7 +4527,7 @@
|
|
|
4511
4527
|
},
|
|
4512
4528
|
emits: [ "submit", "close", "reset" ],
|
|
4513
4529
|
setup(props, {slots: slots, emit: emit, expose: expose}) {
|
|
4514
|
-
const _config = deepClone(defaultConfig$
|
|
4530
|
+
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({});
|
|
4515
4531
|
vue.watch((() => [ props.columns, props.formDatum ]), (() => {
|
|
4516
4532
|
(() => {
|
|
4517
4533
|
const columns = props.columns;
|
|
@@ -4862,7 +4878,7 @@
|
|
|
4862
4878
|
let _slot;
|
|
4863
4879
|
return vue.createVNode(elementPlus.ElForm, {
|
|
4864
4880
|
ref: ruleFormRef,
|
|
4865
|
-
class: ns$
|
|
4881
|
+
class: ns$7.b(),
|
|
4866
4882
|
inline: !1,
|
|
4867
4883
|
model: formParams,
|
|
4868
4884
|
size: options.size
|
|
@@ -4882,7 +4898,7 @@
|
|
|
4882
4898
|
}, {
|
|
4883
4899
|
label: () => column.label ? vue.createVNode(vue.Fragment, null, [ vue.createVNode(NextTextEllipsis, {
|
|
4884
4900
|
content: t(column.label),
|
|
4885
|
-
class: ns$
|
|
4901
|
+
class: ns$7.e("item-label")
|
|
4886
4902
|
}, null), column.tip ? vue.createVNode(elementPlus.ElTooltip, {
|
|
4887
4903
|
effect: "dark",
|
|
4888
4904
|
content: column.tip,
|
|
@@ -4902,7 +4918,7 @@
|
|
|
4902
4918
|
})))) ? _slot : {
|
|
4903
4919
|
default: () => [ _slot ]
|
|
4904
4920
|
}), _isEditing.value && options.showFooter ? vue.createVNode("div", {
|
|
4905
|
-
class: ns$
|
|
4921
|
+
class: ns$7.e("footer")
|
|
4906
4922
|
}, [ vue.createVNode(elementPlus.ElButton, {
|
|
4907
4923
|
type: "primary",
|
|
4908
4924
|
loading: submitLoading.value,
|
|
@@ -4921,7 +4937,7 @@
|
|
|
4921
4937
|
};
|
|
4922
4938
|
}
|
|
4923
4939
|
});
|
|
4924
|
-
const NextTreeSelect = withInstall(treeSelect), NextForm = withInstall(Element$
|
|
4940
|
+
const NextTreeSelect = withInstall(treeSelect), NextForm = withInstall(Element$7);
|
|
4925
4941
|
var AddEditForm = vue.defineComponent({
|
|
4926
4942
|
name: "AddEditForm",
|
|
4927
4943
|
props: {
|
|
@@ -4975,17 +4991,17 @@
|
|
|
4975
4991
|
function _isSlot(s) {
|
|
4976
4992
|
return "function" == typeof s || "[object Object]" === Object.prototype.toString.call(s) && !vue.isVNode(s);
|
|
4977
4993
|
}
|
|
4978
|
-
const ns$
|
|
4979
|
-
var Element$
|
|
4994
|
+
const ns$6 = useNamespace("crud-table");
|
|
4995
|
+
var Element$6 = vue.defineComponent({
|
|
4980
4996
|
name: "NextCrudTable",
|
|
4981
4997
|
props: defaultPropsConfig,
|
|
4982
4998
|
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" ],
|
|
4983
4999
|
setup(props, {emit: emit, slots: slots, expose: expose}) {
|
|
4984
|
-
const _config = deepClone(defaultConfig$
|
|
5000
|
+
const _config = deepClone(defaultConfig$4), _options = vue.computed((() => {
|
|
4985
5001
|
const cfg = vue.unref(props.options);
|
|
4986
5002
|
return merge$1(_config, cfg);
|
|
4987
5003
|
})), options = vue.unref(_options);
|
|
4988
|
-
vue.provide("options", vue.computed((() => _options.value))), vue.provide("ns", ns$
|
|
5004
|
+
vue.provide("options", vue.computed((() => _options.value))), vue.provide("ns", ns$6);
|
|
4989
5005
|
const {t: t} = useLocale(), _columns = vue.ref(options.columns), _searchColumns = vue.ref([]), _formColumns = vue.ref([]), _updateColumnsAll = ops => {
|
|
4990
5006
|
((options, cb) => {
|
|
4991
5007
|
const _columns = vue.reactive(options.columns), _loadDicData = col => {
|
|
@@ -5223,15 +5239,16 @@
|
|
|
5223
5239
|
getFormExpose: () => addEditFormRef.value?.getFormExpose(),
|
|
5224
5240
|
updateColumns: ops => {
|
|
5225
5241
|
_updateColumnsAll(ops);
|
|
5226
|
-
}
|
|
5242
|
+
},
|
|
5243
|
+
getSearchFormParams: () => _searchFormParams.value
|
|
5227
5244
|
});
|
|
5228
5245
|
return () => vue.createVNode(vue.Fragment, null, [ vue.createVNode(vue.Fragment, null, [ vue.createVNode("div", {
|
|
5229
5246
|
ref: crudTableRef,
|
|
5230
|
-
class: [ ns$
|
|
5247
|
+
class: [ ns$6.b(), props.className ],
|
|
5231
5248
|
style: props.style
|
|
5232
5249
|
}, [ options.showSearchForm || options.showHeaderMenu ? vue.createVNode("header", {
|
|
5233
5250
|
ref: headerRef,
|
|
5234
|
-
class: ns$
|
|
5251
|
+
class: ns$6.b("header")
|
|
5235
5252
|
}, [ options.showSearchForm && vue.createVNode(HeaderSearch, {
|
|
5236
5253
|
columns: _searchColumns.value,
|
|
5237
5254
|
onZoomResize: updateTableContentHeight,
|
|
@@ -5250,7 +5267,7 @@
|
|
|
5250
5267
|
}, {
|
|
5251
5268
|
default: () => [ vue.createVNode("div", {
|
|
5252
5269
|
ref: tableRef,
|
|
5253
|
-
class: ns$
|
|
5270
|
+
class: ns$6.b("content")
|
|
5254
5271
|
}, [ vue.createVNode(elementPlus.ElTable, {
|
|
5255
5272
|
data: tableData.value,
|
|
5256
5273
|
height: tableContentHeight.value,
|
|
@@ -5313,7 +5330,7 @@
|
|
|
5313
5330
|
}) ]) ]
|
|
5314
5331
|
}), options.isPagination ? vue.createVNode("div", {
|
|
5315
5332
|
ref: footerRef,
|
|
5316
|
-
class: ns$
|
|
5333
|
+
class: ns$6.b("footer")
|
|
5317
5334
|
}, [ vue.createVNode(FooterPagination, {
|
|
5318
5335
|
page: props.page,
|
|
5319
5336
|
onChange: onChangePagination
|
|
@@ -5339,7 +5356,7 @@
|
|
|
5339
5356
|
}) ]) ]) ]);
|
|
5340
5357
|
}
|
|
5341
5358
|
});
|
|
5342
|
-
const NextCrudTable = withInstall(Element$
|
|
5359
|
+
const NextCrudTable = withInstall(Element$6);
|
|
5343
5360
|
var propsConfig = {
|
|
5344
5361
|
className: {
|
|
5345
5362
|
type: String,
|
|
@@ -5369,13 +5386,13 @@
|
|
|
5369
5386
|
total: 0
|
|
5370
5387
|
})
|
|
5371
5388
|
}
|
|
5372
|
-
}, defaultConfig$
|
|
5373
|
-
const ns$
|
|
5389
|
+
}, defaultConfig$2 = {};
|
|
5390
|
+
const ns$5 = useNamespace("crud-table-virtualized");
|
|
5374
5391
|
const NextCrudTableVirtualized = withInstall(vue.defineComponent({
|
|
5375
5392
|
name: "NextCrudTableVirtualized",
|
|
5376
5393
|
props: propsConfig,
|
|
5377
5394
|
setup(props, {emit: emit}) {
|
|
5378
|
-
const _config = deepClone(defaultConfig$
|
|
5395
|
+
const _config = deepClone(defaultConfig$2), _options = vue.computed((() => {
|
|
5379
5396
|
const cfg = vue.unref(props.options);
|
|
5380
5397
|
return merge$1(_config, cfg);
|
|
5381
5398
|
})), options = vue.unref(_options);
|
|
@@ -5390,7 +5407,7 @@
|
|
|
5390
5407
|
emit("close-add-edit");
|
|
5391
5408
|
};
|
|
5392
5409
|
return () => vue.createVNode(vue.Fragment, null, [ vue.createVNode("div", {
|
|
5393
|
-
class: [ ns$
|
|
5410
|
+
class: [ ns$5.b(), props.className ]
|
|
5394
5411
|
}, [ vue.createVNode(NextSpinLoading, null, null), vue.createVNode(NextDialog, {
|
|
5395
5412
|
modelValue: addEditDialog.visible,
|
|
5396
5413
|
"onUpdate:modelValue": $event => addEditDialog.visible = $event,
|
|
@@ -5401,7 +5418,7 @@
|
|
|
5401
5418
|
onClose: onCloseAddEditDialog
|
|
5402
5419
|
}, null) ]) ]);
|
|
5403
5420
|
}
|
|
5404
|
-
})), NextSpinLoading = withInstall(NextSpinLoading$1), ns$
|
|
5421
|
+
})), NextSpinLoading = withInstall(NextSpinLoading$1), ns$4 = useNamespace("upload");
|
|
5405
5422
|
const NextUpload = withInstall(vue.defineComponent({
|
|
5406
5423
|
name: "NextUpload",
|
|
5407
5424
|
props: {
|
|
@@ -5435,7 +5452,7 @@
|
|
|
5435
5452
|
const slots = this.$slots, props = this.$props, emit = this.$emit, _t = this.t, uploadfilesPreview = vue.ref([]), body = document.getElementsByTagName("body")[0];
|
|
5436
5453
|
let previewImagesContainer = null;
|
|
5437
5454
|
return vue.createVNode(elementPlus.ElUpload, {
|
|
5438
|
-
class: [ ns$
|
|
5455
|
+
class: [ ns$4.b(), props.className ],
|
|
5439
5456
|
style: props.style,
|
|
5440
5457
|
"list-type": props.listType,
|
|
5441
5458
|
"auto-upload": !1,
|
|
@@ -5473,8 +5490,8 @@
|
|
|
5473
5490
|
})
|
|
5474
5491
|
});
|
|
5475
5492
|
}
|
|
5476
|
-
})), ns$
|
|
5477
|
-
var Element$
|
|
5493
|
+
})), ns$3 = useNamespace("video-player");
|
|
5494
|
+
var Element$3 = vue.defineComponent({
|
|
5478
5495
|
name: "NextVideoPlayer",
|
|
5479
5496
|
props: {
|
|
5480
5497
|
className: {
|
|
@@ -5547,7 +5564,7 @@
|
|
|
5547
5564
|
if (!classNames || !classNames.length) throw new Error("模型类别不能未空!");
|
|
5548
5565
|
container.innerHTML = "", tf__namespace.loadGraphModel(modelUrl).then((model => {
|
|
5549
5566
|
const canvas = document.createElement("canvas");
|
|
5550
|
-
canvas.className = ns$
|
|
5567
|
+
canvas.className = ns$3.b("recongition"), container.appendChild(canvas);
|
|
5551
5568
|
const ctx = canvas.getContext("2d"), detect_ctx = document.createElement("canvas").getContext("2d");
|
|
5552
5569
|
video.ontimeupdate = () => {
|
|
5553
5570
|
const {videoWidth: videoWidth, videoHeight: videoHeight, offsetTop: offsetTop, offsetLeft: offsetLeft} = video;
|
|
@@ -5718,12 +5735,12 @@
|
|
|
5718
5735
|
});
|
|
5719
5736
|
return () => vue.createVNode(vue.Fragment, null, [ vue.createVNode("div", {
|
|
5720
5737
|
ref: videoBoxRef,
|
|
5721
|
-
class: [ ns$
|
|
5738
|
+
class: [ ns$3.b(), props.className ],
|
|
5722
5739
|
style: props.style
|
|
5723
5740
|
}, null) ]);
|
|
5724
5741
|
}
|
|
5725
5742
|
});
|
|
5726
|
-
const NextVideoPlayer = withInstall(Element$
|
|
5743
|
+
const NextVideoPlayer = withInstall(Element$3);
|
|
5727
5744
|
const NextDragResize = withInstall(vue.defineComponent({
|
|
5728
5745
|
name: "NextDragResize",
|
|
5729
5746
|
props: {},
|
|
@@ -5734,6 +5751,14 @@
|
|
|
5734
5751
|
isFullscreen: {
|
|
5735
5752
|
type: Boolean,
|
|
5736
5753
|
default: !1
|
|
5754
|
+
},
|
|
5755
|
+
imageIndex: {
|
|
5756
|
+
type: Number,
|
|
5757
|
+
default: 0
|
|
5758
|
+
},
|
|
5759
|
+
imageLength: {
|
|
5760
|
+
type: Number,
|
|
5761
|
+
default: 0
|
|
5737
5762
|
}
|
|
5738
5763
|
},
|
|
5739
5764
|
emits: [ "fullscreen", "save" ],
|
|
@@ -5744,6 +5769,7 @@
|
|
|
5744
5769
|
return () => vue.createVNode(vue.Fragment, null, [ vue.createVNode(vue.Fragment, null, [ vue.createVNode("ul", {
|
|
5745
5770
|
class: [ _ns.be("header", "tool") ]
|
|
5746
5771
|
}, [ vue.createVNode("li", {
|
|
5772
|
+
class: "hover",
|
|
5747
5773
|
onClick: () => emit("save")
|
|
5748
5774
|
}, [ vue.createVNode("svg", {
|
|
5749
5775
|
t: "1719034799379",
|
|
@@ -5764,8 +5790,11 @@
|
|
|
5764
5790
|
style: "padding-left: 3px"
|
|
5765
5791
|
}, [ t("next.labelimg.saveLabel") ]) ]) ]), vue.createVNode("ul", {
|
|
5766
5792
|
class: [ _ns.be("header", "tool") ]
|
|
5767
|
-
}, [ vue.createVNode("li", {
|
|
5768
|
-
style: "
|
|
5793
|
+
}, [ props.imageLength ? vue.createVNode("li", null, [ vue.createVNode("span", null, [ vue.createTextVNode("第 "), props.imageIndex + 1, vue.createTextVNode(" 张") ]), vue.createVNode("em", {
|
|
5794
|
+
style: "padding: 0 5px;"
|
|
5795
|
+
}, [ vue.createTextVNode("/") ]), vue.createVNode("span", null, [ vue.createTextVNode("共 "), props.imageLength, vue.createTextVNode(" 张") ]) ]) : null, vue.createVNode("li", {
|
|
5796
|
+
style: "margin-right: 30px;",
|
|
5797
|
+
class: "hover"
|
|
5769
5798
|
}, [ vue.createVNode(elementPlus.ElPopover, {
|
|
5770
5799
|
trigger: "hover",
|
|
5771
5800
|
placement: "bottom",
|
|
@@ -5784,6 +5813,7 @@
|
|
|
5784
5813
|
style: "font-size: 12px;white-space: nowrap;"
|
|
5785
5814
|
}, [ vue.createVNode("li", null, [ vue.createVNode("span", null, [ vue.createTextVNode("W:") ]), vue.createVNode("span", null, [ vue.createTextVNode("鼠标移入图片中,长按W键,鼠标按下左键,移动鼠标开始绘制,鼠标抬起结束绘制") ]) ]), 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键进入下一张图片进行标注") ]) ]) ])
|
|
5786
5815
|
}) ]), props.isFullscreen ? vue.createVNode("li", {
|
|
5816
|
+
class: "hover",
|
|
5787
5817
|
onClick: () => switchFillscreen(!1)
|
|
5788
5818
|
}, [ vue.createVNode(elementPlus.ElTooltip, {
|
|
5789
5819
|
placement: "top",
|
|
@@ -5803,6 +5833,7 @@
|
|
|
5803
5833
|
"p-id": "5389"
|
|
5804
5834
|
}, null) ]) ]
|
|
5805
5835
|
}) ]) : vue.createVNode("li", {
|
|
5836
|
+
class: "hover",
|
|
5806
5837
|
onClick: () => switchFillscreen(!0)
|
|
5807
5838
|
}, [ vue.createVNode(elementPlus.ElTooltip, {
|
|
5808
5839
|
placement: "top",
|
|
@@ -5824,7 +5855,7 @@
|
|
|
5824
5855
|
}) ]) ]) ]) ]);
|
|
5825
5856
|
}
|
|
5826
5857
|
});
|
|
5827
|
-
const colors = [ "#5470c6", "#91cc75", "#fac858", "#ee6666", "#73c0de", "#3ba272", "#fc8452", "#9a60b4", "#ea7ccc" ], convertToLabel = rect => {
|
|
5858
|
+
const colors$1 = [ "#5470c6", "#91cc75", "#fac858", "#ee6666", "#73c0de", "#3ba272", "#fc8452", "#9a60b4", "#ea7ccc" ], convertToLabel = rect => {
|
|
5828
5859
|
const label_type = rect.type, x_center = rect.startX + rect.rectWidth / 2, y_center = rect.startY + rect.rectHeight / 2;
|
|
5829
5860
|
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)) ];
|
|
5830
5861
|
}, canvertToCanvas = (labelData, canvasWidth, canvasHeight) => {
|
|
@@ -5908,7 +5939,7 @@
|
|
|
5908
5939
|
}
|
|
5909
5940
|
}, [ vue.createVNode("span", {
|
|
5910
5941
|
style: {
|
|
5911
|
-
"background-color": colors[index % colors.length]
|
|
5942
|
+
"background-color": colors$1[index % colors$1.length]
|
|
5912
5943
|
},
|
|
5913
5944
|
class: "label-line"
|
|
5914
5945
|
}, null), vue.createVNode("span", null, [ name ]) ]))) ]), isValueExist(activateIndex.value) ? vue.createVNode("div", {
|
|
@@ -6030,7 +6061,7 @@
|
|
|
6030
6061
|
parentRect = props.parentEl.getBoundingClientRect(), document.addEventListener("mousemove", onMousemove),
|
|
6031
6062
|
document.addEventListener("mouseup", onMouseup);
|
|
6032
6063
|
})), vue.onUnmounted((() => {
|
|
6033
|
-
document.removeEventListener("mousemove", onMousemove
|
|
6064
|
+
document.removeEventListener("mousemove", onMousemove), document.removeEventListener("mouseup", onMouseup);
|
|
6034
6065
|
})), {
|
|
6035
6066
|
onMousedown: e => {
|
|
6036
6067
|
e.preventDefault(), isDraggle.value = !0, draggleOffset.value.diff_x = e.offsetX,
|
|
@@ -6038,7 +6069,7 @@
|
|
|
6038
6069
|
},
|
|
6039
6070
|
onMouseup: onMouseup,
|
|
6040
6071
|
onContextmenu: e => {
|
|
6041
|
-
e.preventDefault(), emit("contextmenu", e, rect.value);
|
|
6072
|
+
e.preventDefault(), e.preventDefault(), emit("contextmenu", e, rect.value);
|
|
6042
6073
|
},
|
|
6043
6074
|
rect: rect,
|
|
6044
6075
|
onMousedownDot: (e, corner) => {
|
|
@@ -6094,7 +6125,7 @@
|
|
|
6094
6125
|
onMousedown: event => this.onMousedownDot(event, "bottomRight")
|
|
6095
6126
|
}, null) ]) ]);
|
|
6096
6127
|
}
|
|
6097
|
-
}), CanvasContext = vue.defineComponent({
|
|
6128
|
+
}), CanvasContext$1 = vue.defineComponent({
|
|
6098
6129
|
name: "NextCanvasContext",
|
|
6099
6130
|
props: {
|
|
6100
6131
|
classes: {
|
|
@@ -6160,7 +6191,7 @@
|
|
|
6160
6191
|
const {ctx: ctx, labels: labels, image: image, canvasWidth: canvasWidth, canvasHeight: canvasHeight} = options, updateLabels = () => {
|
|
6161
6192
|
ctx.clearRect(0, 0, canvasWidth, canvasHeight), ctx.drawImage(image, 0, 0, canvasWidth, canvasHeight);
|
|
6162
6193
|
for (let i = 0; i < labels.length; i++) {
|
|
6163
|
-
const rect = labels[i], {startX: startX, startY: startY, rectWidth: rectWidth, rectHeight: rectHeight, type: type} = rect, color = colors[type % colors.length];
|
|
6194
|
+
const rect = labels[i], {startX: startX, startY: startY, rectWidth: rectWidth, rectHeight: rectHeight, type: type} = rect, color = colors$1[type % colors$1.length];
|
|
6164
6195
|
if (ctx.font = "bold 14px serif", ctx.textBaseline = "top", ctx.save(), ctx.strokeStyle = color,
|
|
6165
6196
|
ctx.strokeRect(startX, startY, rectWidth, rectHeight), isValueExist(rect.typeName) || isValueExist(rect.type)) {
|
|
6166
6197
|
const text = rect.typeName || rect.type;
|
|
@@ -6180,7 +6211,7 @@
|
|
|
6180
6211
|
for (let i = 0; i < labels.length; i++) {
|
|
6181
6212
|
const rect = labels[i], {type: type, startX: startX, startY: startY, rectWidth: rectWidth, rectHeight: rectHeight} = rect;
|
|
6182
6213
|
x >= startX && x <= startX + rectWidth && y >= startY && y <= startY + rectHeight && (hit_rect = rect,
|
|
6183
|
-
hit_index = i, color = colors[type]);
|
|
6214
|
+
hit_index = i, color = colors$1[type]);
|
|
6184
6215
|
}
|
|
6185
6216
|
return {
|
|
6186
6217
|
hit_rect: hit_rect,
|
|
@@ -6200,26 +6231,13 @@
|
|
|
6200
6231
|
});
|
|
6201
6232
|
drawBaseCanvas.value.updateLabels = updateLabels, drawBaseCanvas.value.addDrawRect = addDrawRect,
|
|
6202
6233
|
drawBaseCanvas.value.hitCanvasLabel = hitCanvasLabel;
|
|
6203
|
-
const {clearCanvas: clearCanvas} = ((canvas, callback, keyW) => {
|
|
6234
|
+
const {clearCanvas: clearCanvas, removeEventAll: removeEventAll} = ((canvas, callback, keyW) => {
|
|
6204
6235
|
const canvasWidth = canvas.width, canvasHeight = canvas.height, ctx = canvas?.getContext("2d"), clearCanvas = () => {
|
|
6205
6236
|
ctx.clearRect(0, 0, canvasWidth, canvasHeight);
|
|
6206
6237
|
};
|
|
6207
6238
|
clearCanvas();
|
|
6208
6239
|
let startX, startY, endX, endY, isDrawing = !1, isRectDraw = !1, isWKeyPressed = !1;
|
|
6209
|
-
|
|
6210
|
-
"KeyW" === event.code && (isWKeyPressed = !0, canvas.style.cursor = "crosshair",
|
|
6211
|
-
canvas.style.zIndex = "11", keyW && keyW());
|
|
6212
|
-
})), document.addEventListener("keyup", (event => {
|
|
6213
|
-
isDrawing || "KeyW" === event.code && (isWKeyPressed = !1, canvas.style.cursor = "unset",
|
|
6214
|
-
canvas.style.zIndex = "0");
|
|
6215
|
-
})), canvas.addEventListener("mousedown", (e => {
|
|
6216
|
-
isWKeyPressed && (isDrawing = !0, startX = e.offsetX, startY = e.offsetY);
|
|
6217
|
-
})), canvas.addEventListener("mousemove", (e => {
|
|
6218
|
-
isDrawing && isWKeyPressed && (isRectDraw = !0, endX = e.offsetX, endY = e.offsetY,
|
|
6219
|
-
drawRect());
|
|
6220
|
-
})), canvas.addEventListener("mouseup", (() => {
|
|
6221
|
-
if (!isRectDraw) return;
|
|
6222
|
-
isDrawing = !1, isWKeyPressed = !1, canvas.style.cursor = "unset", canvas.style.zIndex = "0";
|
|
6240
|
+
const drawRectDone = () => {
|
|
6223
6241
|
const rectWidth = Math.abs(endX - startX), rectHeight = Math.abs(endY - startY);
|
|
6224
6242
|
startX > endX && (startX = endX), startY > endY && (startY = endY), callback && callback({
|
|
6225
6243
|
startX: startX,
|
|
@@ -6231,8 +6249,30 @@
|
|
|
6231
6249
|
}, {
|
|
6232
6250
|
endX: endX,
|
|
6233
6251
|
endY: endY
|
|
6234
|
-
})
|
|
6235
|
-
}
|
|
6252
|
+
});
|
|
6253
|
+
}, documentKeydown = event => {
|
|
6254
|
+
"KeyW" === event.code && (isWKeyPressed = !0, canvas.style.cursor = "crosshair",
|
|
6255
|
+
canvas.style.zIndex = "11", keyW && keyW());
|
|
6256
|
+
}, documentKeyup = event => {
|
|
6257
|
+
isDrawing || "KeyW" === event.code && (isWKeyPressed = !1, canvas.style.cursor = "unset",
|
|
6258
|
+
canvas.style.zIndex = "0");
|
|
6259
|
+
}, documentMouseup = () => {
|
|
6260
|
+
isRectDraw && (isDrawing = !1, isWKeyPressed = !1, canvas.style.cursor = "unset",
|
|
6261
|
+
canvas.style.zIndex = "0", drawRectDone(), isRectDraw = !1);
|
|
6262
|
+
};
|
|
6263
|
+
document.addEventListener("keydown", documentKeydown), document.addEventListener("keyup", documentKeyup),
|
|
6264
|
+
document.addEventListener("mouseup", documentMouseup);
|
|
6265
|
+
const canvasMousedown = e => {
|
|
6266
|
+
isWKeyPressed && (isDrawing = !0, startX = e.offsetX, startY = e.offsetY);
|
|
6267
|
+
}, canvasMousemove = e => {
|
|
6268
|
+
isDrawing && isWKeyPressed && (isRectDraw = !0, endX = e.offsetX, endY = e.offsetY,
|
|
6269
|
+
drawRect());
|
|
6270
|
+
}, canvasMouseup = e => {
|
|
6271
|
+
e.stopPropagation(), isRectDraw && (isDrawing = !1, isWKeyPressed = !1, canvas.style.cursor = "unset",
|
|
6272
|
+
canvas.style.zIndex = "0", drawRectDone(), isRectDraw = !1);
|
|
6273
|
+
};
|
|
6274
|
+
canvas.addEventListener("mousedown", canvasMousedown), canvas.addEventListener("mousemove", canvasMousemove),
|
|
6275
|
+
canvas.addEventListener("mouseup", canvasMouseup);
|
|
6236
6276
|
const drawRect = (color = "#f30635") => {
|
|
6237
6277
|
clearCanvas(), ctx.strokeStyle = color, ctx.strokeRect(startX, startY, endX - startX, endY - startY);
|
|
6238
6278
|
};
|
|
@@ -6240,14 +6280,19 @@
|
|
|
6240
6280
|
canvas: canvas,
|
|
6241
6281
|
ctx: ctx,
|
|
6242
6282
|
clearCanvas: clearCanvas,
|
|
6243
|
-
drawRect: drawRect
|
|
6283
|
+
drawRect: drawRect,
|
|
6284
|
+
removeEventAll: () => {
|
|
6285
|
+
document.removeEventListener("mousedown", documentKeydown), document.removeEventListener("keyup", documentKeyup),
|
|
6286
|
+
document.removeEventListener("mouseup", documentMouseup), canvas.removeEventListener("mousedown", canvasMousedown),
|
|
6287
|
+
canvas.removeEventListener("mousemove", canvasMousemove), canvas.removeEventListener("mouseup", canvasMouseup);
|
|
6288
|
+
}
|
|
6244
6289
|
};
|
|
6245
6290
|
})(canvasRectRef.value, ((rect, {endX: endX, endY: endY}) => {
|
|
6246
6291
|
activate_add_label.value = rect, drawBaseCanvas.value.addDrawRect(rect), updateContextmenuLabelFixed(endX, endY, rect);
|
|
6247
6292
|
}), (() => {
|
|
6248
6293
|
onCloseDraggableRectFixed();
|
|
6249
6294
|
}));
|
|
6250
|
-
drawBaseCanvas.value.clearCanvasRect = clearCanvas;
|
|
6295
|
+
drawBaseCanvas.value.clearCanvasRect = clearCanvas, drawBaseCanvas.value.removeEventAll = removeEventAll;
|
|
6251
6296
|
}, image.onerror = () => {
|
|
6252
6297
|
loadingImage.value = !1;
|
|
6253
6298
|
};
|
|
@@ -6279,6 +6324,8 @@
|
|
|
6279
6324
|
renderImageLabel(rowInfo);
|
|
6280
6325
|
}
|
|
6281
6326
|
}));
|
|
6327
|
+
})), vue.onUnmounted((() => {
|
|
6328
|
+
drawBaseCanvas.value.removeEventAll();
|
|
6282
6329
|
}));
|
|
6283
6330
|
const contextmenuLabelFixed = vue.ref({
|
|
6284
6331
|
show: !1,
|
|
@@ -6354,8 +6401,8 @@
|
|
|
6354
6401
|
onCloseContentmenuLabel: onCloseContentmenuLabel,
|
|
6355
6402
|
onSelectedLabel: (rect, index) => {
|
|
6356
6403
|
onCloseDraggableRectFixed(), vue.nextTick((() => {
|
|
6357
|
-
const {startX: x, startY: y, type: type} = rect;
|
|
6358
|
-
updateDraggableRectFixed(x, y,
|
|
6404
|
+
const {startX: x, startY: y, type: type} = rect, color = colors$1[type];
|
|
6405
|
+
updateDraggableRectFixed(x, y, labels.value[index], index, color);
|
|
6359
6406
|
}));
|
|
6360
6407
|
},
|
|
6361
6408
|
onDeleteLabel: onDeleteLabel,
|
|
@@ -6435,12 +6482,12 @@
|
|
|
6435
6482
|
})(rect, index)
|
|
6436
6483
|
}, [ vue.createVNode("div", null, [ vue.createVNode("span", {
|
|
6437
6484
|
style: {
|
|
6438
|
-
"background-color": colors[rect.type]
|
|
6485
|
+
"background-color": colors$1[rect.type]
|
|
6439
6486
|
},
|
|
6440
6487
|
class: "label-line"
|
|
6441
6488
|
}, null), vue.createVNode("span", null, [ rect.typeName ]) ]), vue.createVNode(elementPlus.ElPopconfirm, {
|
|
6442
6489
|
title: t("next.labelimg.confirmDeleteLabel"),
|
|
6443
|
-
width:
|
|
6490
|
+
width: 200,
|
|
6444
6491
|
onConfirm: () => (rect => {
|
|
6445
6492
|
emit("delete", rect);
|
|
6446
6493
|
})(rect)
|
|
@@ -6460,11 +6507,11 @@
|
|
|
6460
6507
|
}, null) ]);
|
|
6461
6508
|
return () => vue.createVNode(vue.Fragment, null, [ renderContent() ]);
|
|
6462
6509
|
}
|
|
6463
|
-
}), defaultConfig = {
|
|
6510
|
+
}), defaultConfig$1 = {
|
|
6464
6511
|
minContentHeight: 500
|
|
6465
6512
|
};
|
|
6466
|
-
const ns$
|
|
6467
|
-
var Element = vue.defineComponent({
|
|
6513
|
+
const ns$2 = useNamespace("labelimg");
|
|
6514
|
+
var Element$1 = vue.defineComponent({
|
|
6468
6515
|
name: "NextLabelimg",
|
|
6469
6516
|
props: {
|
|
6470
6517
|
className: {
|
|
@@ -6475,10 +6522,6 @@
|
|
|
6475
6522
|
type: Object,
|
|
6476
6523
|
default: () => ({})
|
|
6477
6524
|
},
|
|
6478
|
-
rowKey: {
|
|
6479
|
-
type: String,
|
|
6480
|
-
default: "id"
|
|
6481
|
-
},
|
|
6482
6525
|
options: {
|
|
6483
6526
|
type: Object,
|
|
6484
6527
|
default: () => ({})
|
|
@@ -6494,11 +6537,11 @@
|
|
|
6494
6537
|
},
|
|
6495
6538
|
emits: [ "change", "save", "prev-click", "next-click" ],
|
|
6496
6539
|
setup(props, {emit: emit, slots: slots, expose: expose}) {
|
|
6497
|
-
const {t: t} = useLocale(), _config = deepClone(defaultConfig), _options = vue.computed((() => {
|
|
6540
|
+
const {t: t} = useLocale(), _config = deepClone(defaultConfig$1), _options = vue.computed((() => {
|
|
6498
6541
|
const cfg = vue.unref(props.options);
|
|
6499
6542
|
return merge$1(_config, cfg);
|
|
6500
6543
|
})), options = vue.unref(_options);
|
|
6501
|
-
vue.provide("ns", ns$
|
|
6544
|
+
vue.provide("ns", ns$2), vue.provide("_emit", emit);
|
|
6502
6545
|
const activateNodeIndex = vue.ref(0), classes = vue.ref(props.classes), labelImages = vue.ref(deepClone(props.data));
|
|
6503
6546
|
vue.watch((() => props.data), (data => {
|
|
6504
6547
|
labelImages.value = deepClone(data);
|
|
@@ -6532,7 +6575,10 @@
|
|
|
6532
6575
|
node: node,
|
|
6533
6576
|
label_txt: yolo_label.join("\n")
|
|
6534
6577
|
};
|
|
6535
|
-
}, isChangeNodeLabels = () =>
|
|
6578
|
+
}, isChangeNodeLabels = () => {
|
|
6579
|
+
const node = labelImages.value[activateNodeIndex.value];
|
|
6580
|
+
return isEqual(vue.toRaw(node.labels).map((rect => convertToLabel(rect))), currentNode.value.labels.map((rect => convertToLabel(rect))));
|
|
6581
|
+
}, switchKeydownAD = e => {
|
|
6536
6582
|
const imageLength = labelImages.value.length;
|
|
6537
6583
|
"KeyD" === e.code ? (activateNodeIndex.value++, activateNodeIndex.value >= imageLength && (activateNodeIndex.value = 0)) : "KeyA" === e.code && (activateNodeIndex.value--,
|
|
6538
6584
|
activateNodeIndex.value < 0 && (activateNodeIndex.value = imageLength - 1));
|
|
@@ -6602,21 +6648,23 @@
|
|
|
6602
6648
|
});
|
|
6603
6649
|
const renderContent = () => vue.createVNode("div", {
|
|
6604
6650
|
ref: layoutLabelRef,
|
|
6605
|
-
class: [ ns$
|
|
6651
|
+
class: [ ns$2.b(), props.className, isFullscreen.value ? ns$2.b("fullscreen") : "" ],
|
|
6606
6652
|
style: {
|
|
6607
6653
|
...props.style
|
|
6608
6654
|
}
|
|
6609
6655
|
}, [ vue.createVNode(NextSpinLoading$1, {
|
|
6610
6656
|
loading: loading.value,
|
|
6611
6657
|
tip: t("next.labelimg.saveTxt"),
|
|
6612
|
-
class: [ ns$
|
|
6658
|
+
class: [ ns$2.b("loading") ]
|
|
6613
6659
|
}, {
|
|
6614
6660
|
default: () => [ vue.createVNode(elementPlus.ElScrollbar, null, {
|
|
6615
6661
|
default: () => [ vue.createVNode("header", {
|
|
6616
6662
|
ref: headerRef,
|
|
6617
|
-
class: [ ns$
|
|
6663
|
+
class: [ ns$2.b("header") ]
|
|
6618
6664
|
}, [ slots.header ? slots.header() : vue.createVNode(ToolHeader, {
|
|
6619
6665
|
isFullscreen: isFullscreen.value,
|
|
6666
|
+
imageIndex: activateNodeIndex.value,
|
|
6667
|
+
imageLength: labelImages.value.length,
|
|
6620
6668
|
onFullscreen: onSwitchFillscreen,
|
|
6621
6669
|
onSave: () => {
|
|
6622
6670
|
onChangeActivateNode(activateNodeIndex.value) || elementPlus.ElMessage({
|
|
@@ -6626,16 +6674,16 @@
|
|
|
6626
6674
|
}
|
|
6627
6675
|
}, null) ]), vue.createVNode("div", {
|
|
6628
6676
|
ref: mainRef,
|
|
6629
|
-
class: [ ns$
|
|
6677
|
+
class: [ ns$2.b("main") ]
|
|
6630
6678
|
}, [ vue.createVNode(elementPlus.ElScrollbar, {
|
|
6631
|
-
class: [ ns$
|
|
6679
|
+
class: [ ns$2.be("main", "content") ]
|
|
6632
6680
|
}, {
|
|
6633
6681
|
default: () => [ vue.createVNode("div", {
|
|
6634
|
-
class: [ ns$
|
|
6682
|
+
class: [ ns$2.be("main", "content") ],
|
|
6635
6683
|
style: {
|
|
6636
6684
|
height: mainContentHeight.value + "px"
|
|
6637
6685
|
}
|
|
6638
|
-
}, [ vue.createVNode(CanvasContext, {
|
|
6686
|
+
}, [ vue.createVNode(CanvasContext$1, {
|
|
6639
6687
|
ref: canvasContextRef,
|
|
6640
6688
|
contextClientHeight: mainContentHeight.value,
|
|
6641
6689
|
classes: classes.value,
|
|
@@ -6650,9 +6698,9 @@
|
|
|
6650
6698
|
onSelect: onSelectLabelNode
|
|
6651
6699
|
}, null) ]), vue.createVNode("footer", {
|
|
6652
6700
|
ref: footerRef,
|
|
6653
|
-
class: [ ns$
|
|
6701
|
+
class: [ ns$2.b("footer") ]
|
|
6654
6702
|
}, [ vue.createVNode("div", {
|
|
6655
|
-
class: [ ns$
|
|
6703
|
+
class: [ ns$2.be("footer", "left") ]
|
|
6656
6704
|
}, [ vue.createVNode(elementPlus.ElIcon, {
|
|
6657
6705
|
size: 24,
|
|
6658
6706
|
color: "#797979",
|
|
@@ -6660,10 +6708,10 @@
|
|
|
6660
6708
|
}, {
|
|
6661
6709
|
default: () => [ vue.createVNode(arrow_left_default, null, null) ]
|
|
6662
6710
|
}) ]), vue.createVNode("div", {
|
|
6663
|
-
class: [ ns$
|
|
6711
|
+
class: [ ns$2.be("footer", "center") ]
|
|
6664
6712
|
}, [ vue.createVNode(elementPlus.ElScrollbar, null, {
|
|
6665
6713
|
default: () => [ vue.createVNode("ul", {
|
|
6666
|
-
class: [ ns$
|
|
6714
|
+
class: [ ns$2.bem("footer", "center", "list") ]
|
|
6667
6715
|
}, [ labelImages.value.map(((item, index) => vue.createVNode("li", {
|
|
6668
6716
|
key: index,
|
|
6669
6717
|
onClick: () => onChangeActivateNode(index),
|
|
@@ -6679,7 +6727,7 @@
|
|
|
6679
6727
|
fit: "cover"
|
|
6680
6728
|
}, null) ]))) ]) ]
|
|
6681
6729
|
}) ]), vue.createVNode("div", {
|
|
6682
|
-
class: [ ns$
|
|
6730
|
+
class: [ ns$2.be("footer", "right") ]
|
|
6683
6731
|
}, [ vue.createVNode(elementPlus.ElIcon, {
|
|
6684
6732
|
size: 24,
|
|
6685
6733
|
color: "#797979",
|
|
@@ -6692,7 +6740,7 @@
|
|
|
6692
6740
|
return () => vue.createVNode(vue.Fragment, null, [ renderContent() ]);
|
|
6693
6741
|
}
|
|
6694
6742
|
});
|
|
6695
|
-
const ns = useNamespace("labelimg-preview");
|
|
6743
|
+
const ns$1 = useNamespace("labelimg-preview");
|
|
6696
6744
|
var preview = vue.defineComponent({
|
|
6697
6745
|
name: "NextLabelimgPreview",
|
|
6698
6746
|
props: {
|
|
@@ -6728,7 +6776,7 @@
|
|
|
6728
6776
|
canvasBaseRef.value.style.width = canvasWidth + "px", canvasBaseRef.value.style.height = canvasHeight + "px";
|
|
6729
6777
|
})(canvasWidth, canvasHeight), ctx.clearRect(0, 0, canvasWidth, canvasHeight), ctx.drawImage(image, 0, 0, canvasWidth, canvasHeight);
|
|
6730
6778
|
for (let i = 0; i < labels.value.length; i++) {
|
|
6731
|
-
const rect = labels.value[i], {startX: startX, startY: startY, rectWidth: rectWidth, rectHeight: rectHeight, type: type} = rect, color = colors[type % colors.length];
|
|
6779
|
+
const rect = labels.value[i], {startX: startX, startY: startY, rectWidth: rectWidth, rectHeight: rectHeight, type: type} = rect, color = colors$1[type % colors$1.length];
|
|
6732
6780
|
if (ctx.font = "bold 14px serif", ctx.textBaseline = "top", ctx.save(), ctx.strokeStyle = color,
|
|
6733
6781
|
ctx.strokeRect(startX, startY, rectWidth, rectHeight), !isValueExist(rect.typeName)) {
|
|
6734
6782
|
const typeName = classes.value[rect.type];
|
|
@@ -6751,7 +6799,7 @@
|
|
|
6751
6799
|
});
|
|
6752
6800
|
}));
|
|
6753
6801
|
return () => vue.createVNode(vue.Fragment, null, [ vue.createVNode("div", {
|
|
6754
|
-
class: [ ns.b(), props.className ],
|
|
6802
|
+
class: [ ns$1.b(), props.className ],
|
|
6755
6803
|
style: {
|
|
6756
6804
|
...props.style
|
|
6757
6805
|
}
|
|
@@ -6760,7 +6808,415 @@
|
|
|
6760
6808
|
}, null) ]) ]);
|
|
6761
6809
|
}
|
|
6762
6810
|
});
|
|
6763
|
-
const NextLabelimg = withInstall(Element), NextLabelimgPreview = withInstall(preview);
|
|
6811
|
+
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" ];
|
|
6812
|
+
class CreatePolygonVertexes {
|
|
6813
|
+
canvas;
|
|
6814
|
+
ctx;
|
|
6815
|
+
vertexes;
|
|
6816
|
+
isDrawing;
|
|
6817
|
+
mouseOffset;
|
|
6818
|
+
vertexesObservers=[];
|
|
6819
|
+
destroyedObservers;
|
|
6820
|
+
constructor(canvas, ctx) {
|
|
6821
|
+
this.canvas = canvas, this.ctx = ctx, this.isDrawing = !1, this.vertexes = [], this.mouseOffset = {
|
|
6822
|
+
x: 0,
|
|
6823
|
+
y: 0
|
|
6824
|
+
}, canvas.addEventListener("click", this.canvasMouseClick.bind(this)), canvas.addEventListener("mousemove", this.canvasMousemove.bind(this)),
|
|
6825
|
+
canvas.addEventListener("dblclick", this.canvasMouseDblclick.bind(this)), this.vertexes = new Proxy(this.vertexes, {
|
|
6826
|
+
set: (target, property, value) => (target[property] = value, this.notifyVertexChangeListeners(),
|
|
6827
|
+
!0)
|
|
6828
|
+
}), this.mouseOffset = new Proxy(this.mouseOffset, {
|
|
6829
|
+
set: (target, property, value) => (target[property] = value, this.notifyVertexChangeListeners(),
|
|
6830
|
+
!0)
|
|
6831
|
+
});
|
|
6832
|
+
}
|
|
6833
|
+
notifyVertexChangeListeners() {
|
|
6834
|
+
this.vertexesObservers.forEach((listener => {
|
|
6835
|
+
listener(this.vertexes, this.mouseOffset);
|
|
6836
|
+
}));
|
|
6837
|
+
}
|
|
6838
|
+
vertexesChangeEventListener(listener) {
|
|
6839
|
+
this.vertexesObservers.push(listener);
|
|
6840
|
+
}
|
|
6841
|
+
notifyDestryedListerers() {
|
|
6842
|
+
this.destroyedObservers(this.vertexes);
|
|
6843
|
+
}
|
|
6844
|
+
onDestroyed(callback) {
|
|
6845
|
+
this.destroyedObservers = callback;
|
|
6846
|
+
}
|
|
6847
|
+
canvasMouseClick(e) {
|
|
6848
|
+
e.stopPropagation(), this.isDrawing = !0, this.mouseOffset.x = e.offsetX, this.mouseOffset.y = e.offsetY,
|
|
6849
|
+
this.vertexes.push([ e.offsetX, e.offsetY ]), this.vertexes = vertexesUnique(this.vertexes);
|
|
6850
|
+
}
|
|
6851
|
+
canvasMousemove(e) {
|
|
6852
|
+
e.stopPropagation(), this.isDrawing && (this.mouseOffset.x = e.offsetX, this.mouseOffset.y = e.offsetY,
|
|
6853
|
+
this.canvas.style.cursor = "crosshair");
|
|
6854
|
+
}
|
|
6855
|
+
canvasMouseDblclick(e) {
|
|
6856
|
+
e.stopPropagation(), this.canvas.style.cursor = "unset", this.mouseOffset.x = e.offsetX,
|
|
6857
|
+
this.mouseOffset.y = e.offsetY, this.vertexes.push([ e.offsetX, e.offsetY ]), this.vertexes = vertexesUnique(this.vertexes),
|
|
6858
|
+
this.notifyDestryedListerers(), this.destroyed();
|
|
6859
|
+
}
|
|
6860
|
+
destroyed() {
|
|
6861
|
+
this.isDrawing = !1, this.vertexes = [], this.vertexesObservers = [], this.canvas.removeEventListener("click", this.canvasMouseClick),
|
|
6862
|
+
this.canvas.removeEventListener("mousemove", this.canvasMousemove), this.canvas.removeEventListener("dblclick", this.canvasMouseDblclick);
|
|
6863
|
+
}
|
|
6864
|
+
}
|
|
6865
|
+
class EditPolygonPath {
|
|
6866
|
+
canvas;
|
|
6867
|
+
ctx;
|
|
6868
|
+
vertexes;
|
|
6869
|
+
isEditing;
|
|
6870
|
+
isMoveEditing;
|
|
6871
|
+
canClickEvent;
|
|
6872
|
+
pointVertexIndex;
|
|
6873
|
+
pointCentreIndex;
|
|
6874
|
+
vertexRadius;
|
|
6875
|
+
edgeCentreRadius;
|
|
6876
|
+
observers=[];
|
|
6877
|
+
constructor(canvas, ctx) {
|
|
6878
|
+
this.canvas = canvas, this.ctx = ctx, this.vertexes = [], this.isEditing = !1, this.canClickEvent = !0,
|
|
6879
|
+
this.isMoveEditing = !1, this.pointVertexIndex = -1, this.pointCentreIndex = -1,
|
|
6880
|
+
this.vertexRadius = 8, this.edgeCentreRadius = 5;
|
|
6881
|
+
}
|
|
6882
|
+
drawPolygonPath(vertexes, mouseX, mouseY) {
|
|
6883
|
+
const ctx = this.ctx;
|
|
6884
|
+
if (!vertexes.length) return;
|
|
6885
|
+
ctx.beginPath(), ctx.lineWidth = 3, ctx.strokeStyle = "#5470c6", ctx.fillStyle = hexToRgba("#5470c6", .2),
|
|
6886
|
+
ctx.moveTo(vertexes[0][0], vertexes[0][1]);
|
|
6887
|
+
for (let i = 1; i < vertexes.length; i++) {
|
|
6888
|
+
const [x, y] = vertexes[i];
|
|
6889
|
+
ctx.lineTo(x, y);
|
|
6890
|
+
}
|
|
6891
|
+
isNaN(mouseX) || isNaN(mouseY) || ctx.lineTo(mouseX, mouseY), ctx.closePath(), ctx.stroke(),
|
|
6892
|
+
ctx.fill();
|
|
6893
|
+
}
|
|
6894
|
+
drawPolygonEdgeCentre(vertexes) {
|
|
6895
|
+
const ctx = this.ctx;
|
|
6896
|
+
for (let i = 0; i < vertexes.length; i++) {
|
|
6897
|
+
const [x, y] = vertexes[i];
|
|
6898
|
+
ctx.beginPath(), ctx.fillStyle = "#5470c6", ctx.arc(x, y, this.vertexRadius, 0, 2 * Math.PI),
|
|
6899
|
+
ctx.closePath(), ctx.fill(), ctx.beginPath(), ctx.fillStyle = "#FFFFFF", ctx.arc(x, y, this.vertexRadius - 3, 0, 2 * Math.PI),
|
|
6900
|
+
ctx.closePath(), ctx.fill();
|
|
6901
|
+
}
|
|
6902
|
+
for (let i = 0; i < vertexes.length; i++) {
|
|
6903
|
+
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;
|
|
6904
|
+
ctx.beginPath(), ctx.fillStyle = "#5470c6", ctx.arc(x, y, this.edgeCentreRadius, 0, 2 * Math.PI),
|
|
6905
|
+
ctx.closePath(), ctx.fill();
|
|
6906
|
+
}
|
|
6907
|
+
}
|
|
6908
|
+
drawPolygon(vertexes, mouseOffset) {
|
|
6909
|
+
this.vertexes = vertexes, mouseOffset ? this.drawPolygonPath(vertexes, mouseOffset.x, mouseOffset.y) : (this.drawPolygonPath(vertexes),
|
|
6910
|
+
this.drawPolygonEdgeCentre(vertexes));
|
|
6911
|
+
}
|
|
6912
|
+
pointInVertexes(x, y) {
|
|
6913
|
+
const vertexes = this.vertexes;
|
|
6914
|
+
let aimIndex = null;
|
|
6915
|
+
for (let i = 0; i < vertexes.length; i++) {
|
|
6916
|
+
const [vertex_x, vertex_y] = vertexes[i];
|
|
6917
|
+
if (isPointInCircle(x, y, vertex_x, vertex_y, this.vertexRadius)) {
|
|
6918
|
+
this.canvas.style.cursor = "pointer", aimIndex = i;
|
|
6919
|
+
break;
|
|
6920
|
+
}
|
|
6921
|
+
this.canvas.style.cursor = "unset";
|
|
6922
|
+
}
|
|
6923
|
+
return aimIndex;
|
|
6924
|
+
}
|
|
6925
|
+
pointInEdgeCentre(x, y) {
|
|
6926
|
+
const vertexes = this.vertexes;
|
|
6927
|
+
let aimIndex = null;
|
|
6928
|
+
for (let i = 0; i < vertexes.length; i++) {
|
|
6929
|
+
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;
|
|
6930
|
+
if (isPointInCircle(x, y, vertex_x, vertex_y, this.edgeCentreRadius)) {
|
|
6931
|
+
this.canvas.style.cursor = "pointer", aimIndex = i;
|
|
6932
|
+
break;
|
|
6933
|
+
}
|
|
6934
|
+
this.canvas.style.cursor = "unset";
|
|
6935
|
+
}
|
|
6936
|
+
return aimIndex;
|
|
6937
|
+
}
|
|
6938
|
+
pointInVertexesOrEdgeCentre(x, y) {
|
|
6939
|
+
const vertexes = this.vertexes;
|
|
6940
|
+
for (let i = 0; i < vertexes.length; i++) {
|
|
6941
|
+
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);
|
|
6942
|
+
if (isInVertex || isInEdgeCenter) {
|
|
6943
|
+
this.canvas.style.cursor = "pointer";
|
|
6944
|
+
break;
|
|
6945
|
+
}
|
|
6946
|
+
this.canvas.style.cursor = "unset";
|
|
6947
|
+
}
|
|
6948
|
+
}
|
|
6949
|
+
notifyObservers() {
|
|
6950
|
+
this.observers.forEach((listener => {
|
|
6951
|
+
listener(this.vertexes);
|
|
6952
|
+
}));
|
|
6953
|
+
}
|
|
6954
|
+
updatePolygon(callback) {
|
|
6955
|
+
this.isEditing = !0, this.canvas.addEventListener("mousedown", this.canvasMousedown.bind(this)),
|
|
6956
|
+
this.canvas.addEventListener("mouseup", this.canvasMouseup.bind(this)), this.canvas.addEventListener("click", this.canvasMouseClick.bind(this)),
|
|
6957
|
+
this.canvas.addEventListener("mousemove", this.canvasMousemove.bind(this)), this.observers.push(callback);
|
|
6958
|
+
}
|
|
6959
|
+
canvasMousedown(e) {
|
|
6960
|
+
e.stopPropagation(), e.preventDefault(), this.canClickEvent = !0;
|
|
6961
|
+
const {offsetX: x, offsetY: y} = e;
|
|
6962
|
+
if (this.isEditing) {
|
|
6963
|
+
const vertex_i = this.pointInVertexes(x, y);
|
|
6964
|
+
isValueExist(vertex_i) && (this.isMoveEditing = !0, this.pointVertexIndex = vertex_i,
|
|
6965
|
+
this.vertexes.splice(this.pointVertexIndex, 1, [ x, y ]));
|
|
6966
|
+
const i = this.pointInEdgeCentre(x, y);
|
|
6967
|
+
isValueExist(i) && (this.isMoveEditing = !0, this.pointCentreIndex = i + 1, this.vertexes.splice(this.pointCentreIndex, 0, [ x, y ]));
|
|
6968
|
+
}
|
|
6969
|
+
setTimeout((() => {
|
|
6970
|
+
this.canClickEvent = !1;
|
|
6971
|
+
}), 200);
|
|
6972
|
+
}
|
|
6973
|
+
canvasMouseup(e) {
|
|
6974
|
+
e.stopPropagation(), e.preventDefault();
|
|
6975
|
+
const {offsetX: x, offsetY: y} = e;
|
|
6976
|
+
this.pointVertexIndex > -1 && this.vertexes.splice(this.pointVertexIndex, 1, [ x, y ]),
|
|
6977
|
+
this.pointCentreIndex > -1 && this.vertexes.splice(this.pointCentreIndex, 1, [ x, y ]),
|
|
6978
|
+
this.isMoveEditing = !1, this.pointVertexIndex = -1, this.pointCentreIndex = -1,
|
|
6979
|
+
this.notifyObservers();
|
|
6980
|
+
}
|
|
6981
|
+
canvasMouseClick(e) {
|
|
6982
|
+
e.stopPropagation();
|
|
6983
|
+
const {offsetX: x, offsetY: y} = e;
|
|
6984
|
+
if (this.isEditing && this.canClickEvent) {
|
|
6985
|
+
e.stopImmediatePropagation();
|
|
6986
|
+
const i = this.pointInVertexes(x, y);
|
|
6987
|
+
if (isValueExist(i)) {
|
|
6988
|
+
if (this.vertexes.length <= 3) return;
|
|
6989
|
+
this.vertexes.splice(i, 1), this.drawPolygon(this.vertexes), this.notifyObservers();
|
|
6990
|
+
}
|
|
6991
|
+
}
|
|
6992
|
+
}
|
|
6993
|
+
canvasMousemove(e) {
|
|
6994
|
+
e.stopPropagation();
|
|
6995
|
+
const {offsetX: x, offsetY: y} = e;
|
|
6996
|
+
this.pointInVertexesOrEdgeCentre(x, y), this.isMoveEditing && (this.pointVertexIndex > -1 && this.vertexes.splice(this.pointVertexIndex, 1, [ x, y ]),
|
|
6997
|
+
this.pointCentreIndex > -1 && this.vertexes.splice(this.pointCentreIndex, 1, [ x, y ]),
|
|
6998
|
+
this.notifyObservers());
|
|
6999
|
+
}
|
|
7000
|
+
destroyed() {
|
|
7001
|
+
this.vertexes = [], this.observers = [], this.isEditing = !1, this.canvas.removeEventListener("mousedown", this.canvasMousedown),
|
|
7002
|
+
this.canvas.removeEventListener("mouseup", this.canvasMouseup), this.canvas.removeEventListener("click", this.canvasMouseClick),
|
|
7003
|
+
this.canvas.removeEventListener("mousemove", this.canvasMousemove);
|
|
7004
|
+
}
|
|
7005
|
+
}
|
|
7006
|
+
class CreateDrawCanvas {
|
|
7007
|
+
canvas;
|
|
7008
|
+
ctx;
|
|
7009
|
+
image;
|
|
7010
|
+
canvasWidth;
|
|
7011
|
+
canvasHeight;
|
|
7012
|
+
paths;
|
|
7013
|
+
editDrawPolygon;
|
|
7014
|
+
createPolygonVertexes;
|
|
7015
|
+
editVertexes;
|
|
7016
|
+
editPolygonObservers=[];
|
|
7017
|
+
constructor(options) {
|
|
7018
|
+
const {canvas: canvas, ctx: ctx, image: image, canvasWidth: canvasWidth, canvasHeight: canvasHeight, paths: paths} = options;
|
|
7019
|
+
this.canvas = canvas, this.ctx = ctx, this.image = image, this.canvasWidth = canvasWidth,
|
|
7020
|
+
this.canvasHeight = canvasHeight, this.paths = paths || [], this.editVertexes = [],
|
|
7021
|
+
this.render(), this.editDrawPolygon = new EditPolygonPath(canvas, ctx), this.createPolygonVertexes = new CreatePolygonVertexes(canvas, ctx),
|
|
7022
|
+
this.createPolygonVertexes.vertexesChangeEventListener(((vertexes, mouseOffset) => {
|
|
7023
|
+
this.render(), this.editDrawPolygon.drawPolygon(vertexes, mouseOffset), this.editVertexes = vertexes,
|
|
7024
|
+
this.notifyObservers();
|
|
7025
|
+
})), this.createPolygonVertexes.onDestroyed((vertexes => {
|
|
7026
|
+
this.render(), this.editDrawPolygon.drawPolygon(vertexes), this.editDrawPolygon.updatePolygon((vertexes => {
|
|
7027
|
+
this.render(), this.editDrawPolygon.drawPolygon(vertexes), this.editVertexes = vertexes,
|
|
7028
|
+
this.notifyObservers();
|
|
7029
|
+
}));
|
|
7030
|
+
}));
|
|
7031
|
+
}
|
|
7032
|
+
notifyObservers() {
|
|
7033
|
+
this.editPolygonObservers.forEach((listener => {
|
|
7034
|
+
listener(this.editVertexes);
|
|
7035
|
+
}));
|
|
7036
|
+
}
|
|
7037
|
+
updatePolygon(callback) {
|
|
7038
|
+
this.editPolygonObservers.push(callback);
|
|
7039
|
+
}
|
|
7040
|
+
drawPolygons(paths) {
|
|
7041
|
+
const ctx = this.ctx;
|
|
7042
|
+
for (let i = 0; i < paths.length; i++) {
|
|
7043
|
+
const path = paths[i].path;
|
|
7044
|
+
if (!path.length) return;
|
|
7045
|
+
const color = colors[i % colors.length];
|
|
7046
|
+
ctx.beginPath(), ctx.lineWidth = 2, ctx.strokeStyle = color, ctx.fillStyle = hexToRgba(color, .2),
|
|
7047
|
+
ctx.moveTo(path[0][0], path[0][1]);
|
|
7048
|
+
for (let i = 1; i < path.length; i++) {
|
|
7049
|
+
const [x, y] = path[i];
|
|
7050
|
+
ctx.lineTo(x, y);
|
|
7051
|
+
}
|
|
7052
|
+
ctx.closePath(), ctx.stroke(), ctx.fill();
|
|
7053
|
+
}
|
|
7054
|
+
}
|
|
7055
|
+
initCanvas=() => {
|
|
7056
|
+
this.ctx.clearRect(0, 0, this.canvasWidth, this.canvasHeight), this.ctx.drawImage(this.image, 0, 0, this.canvasWidth, this.canvasHeight),
|
|
7057
|
+
this.drawPolygons(this.paths);
|
|
7058
|
+
};
|
|
7059
|
+
render=() => {
|
|
7060
|
+
this.initCanvas();
|
|
7061
|
+
};
|
|
7062
|
+
destroyed() {
|
|
7063
|
+
this.paths = [], this.editDrawPolygon.destroyed(), this.createPolygonVertexes.destroyed();
|
|
7064
|
+
}
|
|
7065
|
+
}
|
|
7066
|
+
var CanvasContext = vue.defineComponent({
|
|
7067
|
+
props: {
|
|
7068
|
+
classes: {
|
|
7069
|
+
type: Array,
|
|
7070
|
+
default: () => []
|
|
7071
|
+
},
|
|
7072
|
+
contextClientHeight: {
|
|
7073
|
+
type: Number,
|
|
7074
|
+
default: null
|
|
7075
|
+
},
|
|
7076
|
+
rowInfo: {
|
|
7077
|
+
type: Object,
|
|
7078
|
+
default: () => ({})
|
|
7079
|
+
}
|
|
7080
|
+
},
|
|
7081
|
+
emits: [ "editPolygon" ],
|
|
7082
|
+
setup(props, {emit: emit}) {
|
|
7083
|
+
const ns = vue.inject("ns", {}), canvasMainRef = vue.ref(), canvasBaseRef = vue.ref(), drawCanvas = vue.ref(), loadingImage = vue.ref(!1), renderImageLabel = rowInfo => {
|
|
7084
|
+
const clientHeight = canvasMainRef.value?.clientHeight, ctx = canvasBaseRef.value?.getContext("2d");
|
|
7085
|
+
if (rowInfo?.imageSrc) {
|
|
7086
|
+
const image = new Image;
|
|
7087
|
+
image.src = rowInfo.imageSrc, loadingImage.value = !0, image.onload = () => {
|
|
7088
|
+
loadingImage.value = !1;
|
|
7089
|
+
let {width: width, height: height} = image;
|
|
7090
|
+
if (height > clientHeight) {
|
|
7091
|
+
const scale = height / clientHeight;
|
|
7092
|
+
height = clientHeight, image.style.height = height + "px", width /= scale;
|
|
7093
|
+
}
|
|
7094
|
+
const canvasHeight = height, scaleFactor = parseFloat((canvasHeight / height).toFixed(3)), canvasWidth = Math.ceil(width * scaleFactor);
|
|
7095
|
+
((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
|
+
})(canvasWidth, canvasHeight), drawCanvas.value = new CreateDrawCanvas({
|
|
7100
|
+
canvas: canvasBaseRef.value,
|
|
7101
|
+
ctx: ctx,
|
|
7102
|
+
image: image,
|
|
7103
|
+
canvasWidth: canvasWidth,
|
|
7104
|
+
canvasHeight: canvasHeight,
|
|
7105
|
+
scaleFactor: scaleFactor,
|
|
7106
|
+
paths: rowInfo.labels
|
|
7107
|
+
}), drawCanvas.value.updatePolygon((vertexes => {
|
|
7108
|
+
emit("editPolygon", {
|
|
7109
|
+
vertexes: vertexes,
|
|
7110
|
+
canvasWidth: canvasWidth,
|
|
7111
|
+
canvasHeight: canvasHeight
|
|
7112
|
+
});
|
|
7113
|
+
}));
|
|
7114
|
+
}, image.onerror = () => {
|
|
7115
|
+
loadingImage.value = !1;
|
|
7116
|
+
};
|
|
7117
|
+
}
|
|
7118
|
+
};
|
|
7119
|
+
vue.onMounted((() => {
|
|
7120
|
+
vue.watch((() => props.rowInfo), (info => {
|
|
7121
|
+
const rowInfo = vue.toRaw(info);
|
|
7122
|
+
renderImageLabel(rowInfo);
|
|
7123
|
+
}), {
|
|
7124
|
+
deep: !0,
|
|
7125
|
+
immediate: !0
|
|
7126
|
+
}), vue.watch((() => props.contextClientHeight), (height => {
|
|
7127
|
+
if (valueExist(height)) {
|
|
7128
|
+
canvasMainRef.value.style.height = height + "px";
|
|
7129
|
+
const rowInfo = vue.toRaw(props.rowInfo);
|
|
7130
|
+
renderImageLabel(rowInfo);
|
|
7131
|
+
}
|
|
7132
|
+
}));
|
|
7133
|
+
}));
|
|
7134
|
+
return () => vue.createVNode(vue.Fragment, null, [ vue.createVNode(NextSpinLoading, {
|
|
7135
|
+
loading: loadingImage.value,
|
|
7136
|
+
class: [ ns.b("loading") ]
|
|
7137
|
+
}, {
|
|
7138
|
+
default: () => [ vue.createVNode("div", {
|
|
7139
|
+
ref: canvasMainRef,
|
|
7140
|
+
class: [ ns.b("canvas") ]
|
|
7141
|
+
}, [ vue.createVNode("canvas", {
|
|
7142
|
+
ref: canvasBaseRef,
|
|
7143
|
+
class: [ ns.be("canvas", "context") ]
|
|
7144
|
+
}, null) ]) ]
|
|
7145
|
+
}) ]);
|
|
7146
|
+
}
|
|
7147
|
+
}), defaultConfig = {
|
|
7148
|
+
minContentHeight: 500
|
|
7149
|
+
};
|
|
7150
|
+
const ns = useNamespace("labelme");
|
|
7151
|
+
const NextLabelme = withInstall(vue.defineComponent({
|
|
7152
|
+
name: "NextLabelme",
|
|
7153
|
+
props: {
|
|
7154
|
+
className: {
|
|
7155
|
+
type: String,
|
|
7156
|
+
default: ""
|
|
7157
|
+
},
|
|
7158
|
+
style: {
|
|
7159
|
+
type: Object,
|
|
7160
|
+
default: () => ({})
|
|
7161
|
+
},
|
|
7162
|
+
options: {
|
|
7163
|
+
type: Object,
|
|
7164
|
+
default: () => ({})
|
|
7165
|
+
},
|
|
7166
|
+
classes: {
|
|
7167
|
+
type: Array,
|
|
7168
|
+
default: () => []
|
|
7169
|
+
},
|
|
7170
|
+
data: {
|
|
7171
|
+
type: Array,
|
|
7172
|
+
default: () => []
|
|
7173
|
+
}
|
|
7174
|
+
},
|
|
7175
|
+
emits: [ "change", "edit-polygon" ],
|
|
7176
|
+
setup(props, {emit: emit}) {
|
|
7177
|
+
const _config = deepClone(defaultConfig), _options = vue.computed((() => {
|
|
7178
|
+
const cfg = vue.unref(props.options);
|
|
7179
|
+
return merge$1(_config, cfg);
|
|
7180
|
+
})), options = vue.unref(_options);
|
|
7181
|
+
vue.provide("ns", ns), useLocale();
|
|
7182
|
+
const activateNodeIndex = vue.ref(0), classes = vue.ref(props.classes), labelImages = vue.ref(deepClone(props.data));
|
|
7183
|
+
vue.watch((() => props.data), (data => {
|
|
7184
|
+
labelImages.value = deepClone(data);
|
|
7185
|
+
}), {
|
|
7186
|
+
deep: !0
|
|
7187
|
+
}), vue.watch((() => props.data.length), (() => {
|
|
7188
|
+
activateNodeIndex.value = 0;
|
|
7189
|
+
})), vue.watch((() => props.classes), (val => {
|
|
7190
|
+
classes.value = val;
|
|
7191
|
+
}), {
|
|
7192
|
+
deep: !0
|
|
7193
|
+
});
|
|
7194
|
+
const currentNode = vue.computed((() => {
|
|
7195
|
+
if (!labelImages.value) return {};
|
|
7196
|
+
const node = labelImages.value[activateNodeIndex.value] || {};
|
|
7197
|
+
return deepClone(node);
|
|
7198
|
+
})), mainContentHeight = vue.ref(options.minContentHeight), mainRef = vue.ref(), isFullscreen = vue.ref(!1), onEditPlygonChange = plygon => {
|
|
7199
|
+
emit("edit-polygon", plygon);
|
|
7200
|
+
};
|
|
7201
|
+
return () => vue.createVNode(vue.Fragment, null, [ vue.createVNode("div", {
|
|
7202
|
+
class: [ ns.b(), props.className, isFullscreen.value ? ns.b("fullscreen") : "" ],
|
|
7203
|
+
style: {
|
|
7204
|
+
...props.style
|
|
7205
|
+
}
|
|
7206
|
+
}, [ vue.createVNode("div", {
|
|
7207
|
+
ref: mainRef,
|
|
7208
|
+
class: [ ns.b("main") ]
|
|
7209
|
+
}, [ vue.createVNode("div", {
|
|
7210
|
+
class: [ ns.be("main", "content") ],
|
|
7211
|
+
style: {
|
|
7212
|
+
height: mainContentHeight.value + "px"
|
|
7213
|
+
}
|
|
7214
|
+
}, [ vue.createVNode(CanvasContext, {
|
|
7215
|
+
rowInfo: currentNode.value,
|
|
7216
|
+
onEditPolygon: onEditPlygonChange
|
|
7217
|
+
}, null) ]) ]) ]) ]);
|
|
7218
|
+
}
|
|
7219
|
+
}));
|
|
6764
7220
|
var components = Object.freeze({
|
|
6765
7221
|
__proto__: null,
|
|
6766
7222
|
NextContainer: NextContainer,
|
|
@@ -6771,6 +7227,7 @@
|
|
|
6771
7227
|
NextForm: NextForm,
|
|
6772
7228
|
NextLabelimg: NextLabelimg,
|
|
6773
7229
|
NextLabelimgPreview: NextLabelimgPreview,
|
|
7230
|
+
NextLabelme: NextLabelme,
|
|
6774
7231
|
NextLayout: NextLayout,
|
|
6775
7232
|
NextMenu: NextMenu,
|
|
6776
7233
|
NextSpinLoading: NextSpinLoading,
|
|
@@ -6821,19 +7278,20 @@
|
|
|
6821
7278
|
})(app);
|
|
6822
7279
|
};
|
|
6823
7280
|
var index = {
|
|
6824
|
-
version: "0.3.
|
|
7281
|
+
version: "0.3.3",
|
|
6825
7282
|
install: install
|
|
6826
7283
|
};
|
|
6827
7284
|
exports.NextContainer = NextContainer, exports.NextCrudTable = NextCrudTable, exports.NextCrudTableVirtualized = NextCrudTableVirtualized,
|
|
6828
7285
|
exports.NextDialog = NextDialog, exports.NextDragResize = NextDragResize, exports.NextForm = NextForm,
|
|
6829
7286
|
exports.NextLabelimg = NextLabelimg, exports.NextLabelimgPreview = NextLabelimgPreview,
|
|
6830
|
-
exports.
|
|
6831
|
-
exports.
|
|
6832
|
-
exports.
|
|
6833
|
-
exports.
|
|
6834
|
-
exports.
|
|
6835
|
-
exports.
|
|
6836
|
-
exports.
|
|
7287
|
+
exports.NextLabelme = NextLabelme, exports.NextLayout = NextLayout, exports.NextMenu = NextMenu,
|
|
7288
|
+
exports.NextSpinLoading = NextSpinLoading, exports.NextTabs = NextTabs, exports.NextTextEllipsis = NextTextEllipsis,
|
|
7289
|
+
exports.NextTreeSelect = NextTreeSelect, exports.NextUpload = NextUpload, exports.NextVideoPlayer = NextVideoPlayer,
|
|
7290
|
+
exports.buildLocaleContext = buildLocaleContext, exports.buildTranslator = buildTranslator,
|
|
7291
|
+
exports.default = index, exports.defaultNamespace = "next", exports.install = install,
|
|
7292
|
+
exports.localeContextKey = localeContextKey, exports.localeLang = localeLang, exports.namespaceContextKey = namespaceContextKey,
|
|
7293
|
+
exports.nextUseCssTheme = nextUseCssTheme, exports.nextUseCssVar = nextUseCssVar,
|
|
7294
|
+
exports.translate = translate, exports.updateThemeColor = color => {
|
|
6837
7295
|
color && nextUseCssTheme("--el-color-primary", color);
|
|
6838
7296
|
}, exports.updateThemeColorCssVar = updateThemeColorCssVar, exports.useDetectVideo = () => ({
|
|
6839
7297
|
detectVideoFrameImage: ({container: container, video: video, modelUrl: modelUrl, classNames: classNames, classInput: classInput = []}, success, error) => modelUrl ? classNames ? void tf__namespace.loadGraphModel(modelUrl).then((model => {
|
|
@@ -6867,7 +7325,7 @@
|
|
|
6867
7325
|
}), exports.useGetDerivedNamespace = useGetDerivedNamespace, exports.useLanguage = (locale, lang) => {
|
|
6868
7326
|
const localeRef = vue.isRef(locale) ? locale : vue.ref(locale), nextLang = localeLang[lang] || localeLang["zh-cn"];
|
|
6869
7327
|
localeRef.value.name = lang, localeRef.value.next = nextLang.next;
|
|
6870
|
-
}, exports.useLocale = useLocale, exports.useNamespace = useNamespace, exports.version = "0.3.
|
|
7328
|
+
}, exports.useLocale = useLocale, exports.useNamespace = useNamespace, exports.version = "0.3.3",
|
|
6871
7329
|
Object.defineProperty(exports, "__esModule", {
|
|
6872
7330
|
value: !0
|
|
6873
7331
|
});
|