next-element-vue 0.2.8 → 0.3.0
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 +2 -2
- package/dist/index.js +555 -244
- package/dist/index.min.js +3 -3
- package/dist/index.umd.js +556 -250
- package/dist/index.umd.min.js +3 -3
- package/dist/packages/components/crud-table/src/config.d.ts +1 -0
- package/dist/packages/components/crud-table-virtualized/src/index.test.d.ts +2 -2
- package/dist/packages/components/form/src/config.d.ts +2 -0
- package/dist/packages/components/form/src/widgets/upload-image.d.ts +20 -1
- package/dist/packages/components/labelimg/index.d.ts +84 -10
- package/dist/packages/components/labelimg/src/config.d.ts +4 -0
- package/dist/packages/components/labelimg/src/hooks/canvas-context-hook.d.ts +8 -1
- package/dist/packages/components/labelimg/src/index.d.ts +35 -10
- package/dist/packages/components/labelimg/src/preview.d.ts +51 -0
- package/dist/packages/components/labelimg/src/widgets/canvas-context.d.ts +13 -2
- package/dist/packages/components/labelimg/src/widgets/draggable-rect.d.ts +9 -0
- package/dist/packages/components/labelimg/src/widgets/right-label.d.ts +28 -0
- package/dist/packages/components/spin-loading/index.d.ts +1 -0
- package/dist/packages/components/spin-loading/src/index.d.ts +1 -0
- package/dist/packages/hooks/use-locale/index.d.ts +3 -0
- package/dist/packages/locale/lang/en.d.ts +3 -0
- package/dist/packages/locale/lang/zh-cn.d.ts +3 -0
- package/dist/packages/locale/lang/zh-tw.d.ts +3 -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.
|
|
6
|
-
* 发布日期:2024-06-
|
|
5
|
+
* 当前版本:0.3.0 v
|
|
6
|
+
* 发布日期:2024-06-16
|
|
7
7
|
* 地 址:https://www.npmjs.com/package/next-element-vue
|
|
8
8
|
*/
|
|
9
9
|
|
|
@@ -756,7 +756,8 @@
|
|
|
756
756
|
cancelDelete: "取消删除操作",
|
|
757
757
|
confirmButtonText: "确 定",
|
|
758
758
|
cancelButtonText: "取 消"
|
|
759
|
-
}
|
|
759
|
+
},
|
|
760
|
+
uploadfileExceed: "上传文件数量超出限制范围"
|
|
760
761
|
},
|
|
761
762
|
form: {
|
|
762
763
|
input: "请输入",
|
|
@@ -791,7 +792,9 @@
|
|
|
791
792
|
systemSetting: "系统配置"
|
|
792
793
|
},
|
|
793
794
|
labelimg: {
|
|
794
|
-
saveTxt: "保存中..."
|
|
795
|
+
saveTxt: "保存中...",
|
|
796
|
+
emptyLabelText: "暂无标签数据",
|
|
797
|
+
confirmDeleteLabel: "确定要删除该标注吗?"
|
|
795
798
|
}
|
|
796
799
|
}
|
|
797
800
|
}, enLocale = {
|
|
@@ -828,7 +831,8 @@
|
|
|
828
831
|
cancelDelete: "Cancel delete",
|
|
829
832
|
confirmButtonText: "OK",
|
|
830
833
|
cancelButtonText: "Cancel"
|
|
831
|
-
}
|
|
834
|
+
},
|
|
835
|
+
uploadfileExceed: "The number of uploaded files exceeds the limit"
|
|
832
836
|
},
|
|
833
837
|
form: {
|
|
834
838
|
input: "please input ",
|
|
@@ -863,7 +867,9 @@
|
|
|
863
867
|
systemSetting: "system setting"
|
|
864
868
|
},
|
|
865
869
|
labelimg: {
|
|
866
|
-
saveTxt: "saving..."
|
|
870
|
+
saveTxt: "saving...",
|
|
871
|
+
emptyLabelText: "No label data",
|
|
872
|
+
confirmDeleteLabel: "Are you sure you want to delete this annotation?"
|
|
867
873
|
}
|
|
868
874
|
}
|
|
869
875
|
}, zhtwLocale = {
|
|
@@ -900,7 +906,8 @@
|
|
|
900
906
|
cancelDelete: "取消删除操作",
|
|
901
907
|
confirmButtonText: "確 定",
|
|
902
908
|
cancelButtonText: "取 消"
|
|
903
|
-
}
|
|
909
|
+
},
|
|
910
|
+
uploadfileExceed: "上传文件数量超出限制范围"
|
|
904
911
|
},
|
|
905
912
|
form: {
|
|
906
913
|
input: "請輸入",
|
|
@@ -935,7 +942,9 @@
|
|
|
935
942
|
systemSetting: "系統配置"
|
|
936
943
|
},
|
|
937
944
|
labelimg: {
|
|
938
|
-
saveTxt: "保存中..."
|
|
945
|
+
saveTxt: "保存中...",
|
|
946
|
+
emptyLabelText: "暂无标签数据",
|
|
947
|
+
confirmDeleteLabel: "确定要删除该标注吗?"
|
|
939
948
|
}
|
|
940
949
|
}
|
|
941
950
|
};
|
|
@@ -1064,7 +1073,7 @@
|
|
|
1064
1073
|
}, extra) for (const [key, comp] of Object.entries(extra)) main[key] = comp;
|
|
1065
1074
|
return main;
|
|
1066
1075
|
}, slots_config_headerMenu = "header-menu", slots_config_headerToolsPrefix = "header-tools-prefix", slots_config_headerToolsSuffix = "header-tools-suffix";
|
|
1067
|
-
var defaultConfig$
|
|
1076
|
+
var defaultConfig$4 = {
|
|
1068
1077
|
logo: "",
|
|
1069
1078
|
title: "Next Element Vue",
|
|
1070
1079
|
userName: "Admin",
|
|
@@ -1108,7 +1117,7 @@
|
|
|
1108
1117
|
isDark: !1
|
|
1109
1118
|
}
|
|
1110
1119
|
};
|
|
1111
|
-
const ns$
|
|
1120
|
+
const ns$k = useNamespace("text-ellipsis");
|
|
1112
1121
|
const NextTextEllipsis = withInstall(vue.defineComponent({
|
|
1113
1122
|
name: "NextTextEllipsis",
|
|
1114
1123
|
props: {
|
|
@@ -1154,7 +1163,7 @@
|
|
|
1154
1163
|
}
|
|
1155
1164
|
};
|
|
1156
1165
|
return () => vue.createVNode(vue.Fragment, null, [ vue.createVNode("div", {
|
|
1157
|
-
class: [ ns$
|
|
1166
|
+
class: [ ns$k.b(), props.class ],
|
|
1158
1167
|
style: setWidth.value,
|
|
1159
1168
|
onMouseenter: onMouseenter
|
|
1160
1169
|
}, [ isTip.value ? vue.createVNode(elementPlus.ElTooltip, {
|
|
@@ -1164,11 +1173,11 @@
|
|
|
1164
1173
|
disabled: props.disabled
|
|
1165
1174
|
}, {
|
|
1166
1175
|
default: () => [ vue.createVNode("span", {
|
|
1167
|
-
class: ns$
|
|
1176
|
+
class: ns$k.e("text"),
|
|
1168
1177
|
ref: ellipsisRef
|
|
1169
1178
|
}, [ slots.default ? slots.default() : props.content ]) ]
|
|
1170
1179
|
}) : vue.createVNode("span", {
|
|
1171
|
-
class: ns$
|
|
1180
|
+
class: ns$k.e("text"),
|
|
1172
1181
|
ref: ellipsisRef
|
|
1173
1182
|
}, [ slots.default ? slots.default() : props.content ]) ]) ]);
|
|
1174
1183
|
}
|
|
@@ -2491,7 +2500,7 @@
|
|
|
2491
2500
|
}, null) ]
|
|
2492
2501
|
}))) ]) ]);
|
|
2493
2502
|
}
|
|
2494
|
-
}), ns$
|
|
2503
|
+
}), ns$j = useNamespace("menu");
|
|
2495
2504
|
const NextMenu = withInstall(vue.defineComponent({
|
|
2496
2505
|
name: "NextMenu",
|
|
2497
2506
|
props: {
|
|
@@ -2518,13 +2527,13 @@
|
|
|
2518
2527
|
}
|
|
2519
2528
|
},
|
|
2520
2529
|
setup(props) {
|
|
2521
|
-
vue.provide("ns", ns$
|
|
2530
|
+
vue.provide("ns", ns$j);
|
|
2522
2531
|
const router = vue.getCurrentInstance().appContext.config.globalProperties.$router, currentPath = router.currentRoute?.value.fullPath, activePath = vue.ref(currentPath);
|
|
2523
2532
|
vue.watch((() => router.currentRoute?.value), (to => {
|
|
2524
2533
|
activePath.value = to.fullPath;
|
|
2525
2534
|
}));
|
|
2526
2535
|
return () => vue.createVNode(vue.Fragment, null, [ vue.createVNode(elementPlus.ElMenu, {
|
|
2527
|
-
class: [ ns$
|
|
2536
|
+
class: [ ns$j.b(), props.className ],
|
|
2528
2537
|
style: props.style,
|
|
2529
2538
|
defaultActive: activePath.value,
|
|
2530
2539
|
router: props.router,
|
|
@@ -2532,7 +2541,7 @@
|
|
|
2532
2541
|
ellipsis: !0
|
|
2533
2542
|
}, {
|
|
2534
2543
|
default: () => [ vue.createVNode(vue.Fragment, null, [ props.menuTree.map((item => item.children?.length ? valueExist(item.meta?.isHide, !1) ? null : vue.createVNode(elementPlus.ElSubMenu, {
|
|
2535
|
-
"popper-class": ns$
|
|
2544
|
+
"popper-class": ns$j.b("popper"),
|
|
2536
2545
|
index: item.path || item.id,
|
|
2537
2546
|
teleported: !0
|
|
2538
2547
|
}, {
|
|
@@ -2543,7 +2552,7 @@
|
|
|
2543
2552
|
menuData: item.children
|
|
2544
2553
|
}, null)
|
|
2545
2554
|
}) : valueExist(item.meta?.isHide, !1) ? null : vue.createVNode(elementPlus.ElMenuItem, {
|
|
2546
|
-
"popper-class": ns$
|
|
2555
|
+
"popper-class": ns$j.b("popper"),
|
|
2547
2556
|
index: item.path
|
|
2548
2557
|
}, {
|
|
2549
2558
|
default: () => [ vue.createVNode(MenuItemTitle, {
|
|
@@ -2569,19 +2578,19 @@
|
|
|
2569
2578
|
}) ]);
|
|
2570
2579
|
}
|
|
2571
2580
|
});
|
|
2572
|
-
const ns$
|
|
2581
|
+
const ns$i = useNamespace("layout-defaults");
|
|
2573
2582
|
var defaults = vue.defineComponent({
|
|
2574
2583
|
props: {},
|
|
2575
|
-
setup: () => (vue.provide("ns", ns$
|
|
2584
|
+
setup: () => (vue.provide("ns", ns$i), {}),
|
|
2576
2585
|
render() {
|
|
2577
2586
|
const slots = this.$slots, _config = vue.inject("options", {}), _emit = vue.inject("__emit__", {});
|
|
2578
2587
|
slots.menu;
|
|
2579
2588
|
const isTabs = vue.ref(!!slots.tabs);
|
|
2580
2589
|
return void 0 === slots.tabs && _config.showTabs && (isTabs.value = !0), vue.createVNode(elementPlus.ElContainer, {
|
|
2581
|
-
class: ns$
|
|
2590
|
+
class: ns$i.b()
|
|
2582
2591
|
}, {
|
|
2583
2592
|
default: () => [ vue.createVNode(Sidebar$2, null, null), vue.createVNode("div", {
|
|
2584
|
-
class: [ ns$
|
|
2593
|
+
class: [ ns$i.b("content") ]
|
|
2585
2594
|
}, [ vue.createVNode(Header$3, null, null), _config.showTabs ? slots.tabs ? slots.tabs?.() : vue.createVNode(NextTabs, {
|
|
2586
2595
|
tabs: _config.tabs,
|
|
2587
2596
|
activeTab: _config.activeTab,
|
|
@@ -2589,7 +2598,7 @@
|
|
|
2589
2598
|
onSelect: (...arg) => _emit("tabsSelect", ...arg),
|
|
2590
2599
|
onClose: (...arg) => _emit("tabsClose", ...arg)
|
|
2591
2600
|
}, null) : null, vue.createVNode("main", {
|
|
2592
|
-
class: [ ns$
|
|
2601
|
+
class: [ ns$i.bf("main"), ns$i.is("layout-tabs", isTabs.value) ]
|
|
2593
2602
|
}, [ slots.default?.() ]) ]) ]
|
|
2594
2603
|
});
|
|
2595
2604
|
}
|
|
@@ -2619,10 +2628,10 @@
|
|
|
2619
2628
|
}) ]) ]) ]);
|
|
2620
2629
|
}
|
|
2621
2630
|
});
|
|
2622
|
-
const ns$
|
|
2631
|
+
const ns$h = useNamespace("layout-transverse");
|
|
2623
2632
|
var transverse = vue.defineComponent({
|
|
2624
2633
|
props: {},
|
|
2625
|
-
setup: () => (vue.provide("ns", ns$
|
|
2634
|
+
setup: () => (vue.provide("ns", ns$h), {}),
|
|
2626
2635
|
render() {
|
|
2627
2636
|
const slots = this.$slots, _config = vue.inject("options", {}), _emit = vue.inject("__emit__", {}), __slots_header = {};
|
|
2628
2637
|
slots[slots_config_headerMenu] && (__slots_header[slots_config_headerMenu] = () => slots[slots_config_headerMenu]()),
|
|
@@ -2639,7 +2648,7 @@
|
|
|
2639
2648
|
onSelect: (...arg) => _emit("tabsSelect", ...arg),
|
|
2640
2649
|
onClose: (...arg) => _emit("tabsClose", ...arg)
|
|
2641
2650
|
}, null) : null, vue.createVNode("main", {
|
|
2642
|
-
class: [ ns$
|
|
2651
|
+
class: [ ns$h.b("main"), ns$h.is("layout-tabs", isTabs.value) ]
|
|
2643
2652
|
}, [ slots.default?.() ]) ]);
|
|
2644
2653
|
var s;
|
|
2645
2654
|
}
|
|
@@ -2678,10 +2687,10 @@
|
|
|
2678
2687
|
}, null) ]);
|
|
2679
2688
|
}
|
|
2680
2689
|
});
|
|
2681
|
-
const ns$
|
|
2690
|
+
const ns$g = useNamespace("layout-columns");
|
|
2682
2691
|
var columns = vue.defineComponent({
|
|
2683
2692
|
props: {},
|
|
2684
|
-
setup: () => (vue.provide("ns", ns$
|
|
2693
|
+
setup: () => (vue.provide("ns", ns$g), {}),
|
|
2685
2694
|
render() {
|
|
2686
2695
|
const slots = this.$slots, _config = vue.inject("options", {}), _emit = vue.inject("__emit__", {}), __slots_header = {};
|
|
2687
2696
|
slots[slots_config_headerMenu] && (__slots_header[slots_config_headerMenu] = () => slots[slots_config_headerMenu]()),
|
|
@@ -2689,11 +2698,11 @@
|
|
|
2689
2698
|
slots[slots_config_headerToolsSuffix] && (__slots_header[slots_config_headerToolsSuffix] = () => slots[slots_config_headerToolsSuffix]());
|
|
2690
2699
|
const isTabs = vue.ref(!!slots.tabs);
|
|
2691
2700
|
return void 0 === slots.tabs && _config.showTabs && (isTabs.value = !0), vue.createVNode(elementPlus.ElContainer, {
|
|
2692
|
-
class: ns$
|
|
2701
|
+
class: ns$g.b()
|
|
2693
2702
|
}, {
|
|
2694
2703
|
default: () => {
|
|
2695
2704
|
return [ vue.createVNode(Sidebar$1, null, null), vue.createVNode("div", {
|
|
2696
|
-
class: [ ns$
|
|
2705
|
+
class: [ ns$g.b("content") ]
|
|
2697
2706
|
}, [ vue.createVNode(Header$1, null, (s = __slots_header, "function" == typeof s || "[object Object]" === Object.prototype.toString.call(s) && !vue.isVNode(s) ? __slots_header : {
|
|
2698
2707
|
default: () => [ __slots_header ]
|
|
2699
2708
|
})), _config.showTabs ? slots.tabs ? slots.tabs?.() : vue.createVNode(NextTabs, {
|
|
@@ -2703,7 +2712,7 @@
|
|
|
2703
2712
|
onSelect: (...arg) => _emit("tabsSelect", ...arg),
|
|
2704
2713
|
onClose: (...arg) => _emit("tabsClose", ...arg)
|
|
2705
2714
|
}, null) : null, vue.createVNode("main", {
|
|
2706
|
-
class: [ ns$
|
|
2715
|
+
class: [ ns$g.bf("main"), ns$g.is("layout-tabs", isTabs.value) ]
|
|
2707
2716
|
}, [ slots.default?.() ]) ]) ];
|
|
2708
2717
|
var s;
|
|
2709
2718
|
}
|
|
@@ -2746,20 +2755,20 @@
|
|
|
2746
2755
|
}) ]);
|
|
2747
2756
|
}
|
|
2748
2757
|
});
|
|
2749
|
-
const ns$
|
|
2758
|
+
const ns$f = useNamespace("layout-classic");
|
|
2750
2759
|
var classic = vue.defineComponent({
|
|
2751
2760
|
props: {},
|
|
2752
|
-
setup: () => (vue.provide("ns", ns$
|
|
2753
|
-
ns: ns$
|
|
2761
|
+
setup: () => (vue.provide("ns", ns$f), {
|
|
2762
|
+
ns: ns$f
|
|
2754
2763
|
}),
|
|
2755
2764
|
render() {
|
|
2756
2765
|
const slots = this.$slots, _config = vue.inject("options", {}), _emit = vue.inject("__emit__", {});
|
|
2757
2766
|
slots.menu;
|
|
2758
2767
|
const isTabs = vue.ref(!!slots.tabs);
|
|
2759
2768
|
return void 0 === slots.tabs && _config.showTabs && (isTabs.value = !0), vue.createVNode(vue.Fragment, null, [ vue.createVNode(Header, null, null), vue.createVNode("div", {
|
|
2760
|
-
class: [ ns$
|
|
2769
|
+
class: [ ns$f.b("content"), ns$f.is("layout-tabs", isTabs.value) ]
|
|
2761
2770
|
}, [ vue.createVNode(Sidebar, null, null), vue.createVNode("div", {
|
|
2762
|
-
class: ns$
|
|
2771
|
+
class: ns$f.b("container")
|
|
2763
2772
|
}, [ _config.showTabs ? slots.tabs ? slots.tabs?.() : vue.createVNode(NextTabs, {
|
|
2764
2773
|
tabs: _config.tabs,
|
|
2765
2774
|
activeTab: _config.activeTab,
|
|
@@ -2767,11 +2776,11 @@
|
|
|
2767
2776
|
onSelect: (...arg) => _emit("tabsSelect", ...arg),
|
|
2768
2777
|
onClose: (...arg) => _emit("tabsClose", ...arg)
|
|
2769
2778
|
}, null) : null, vue.createVNode("main", {
|
|
2770
|
-
class: [ ns$
|
|
2779
|
+
class: [ ns$f.b("main") ]
|
|
2771
2780
|
}, [ slots.default?.() ]) ]) ]) ]);
|
|
2772
2781
|
}
|
|
2773
2782
|
});
|
|
2774
|
-
const ns$
|
|
2783
|
+
const ns$e = useNamespace("layout"), layouts = {
|
|
2775
2784
|
defaults: vue.markRaw(defaults),
|
|
2776
2785
|
transverse: vue.markRaw(transverse),
|
|
2777
2786
|
columns: vue.markRaw(columns),
|
|
@@ -2797,8 +2806,8 @@
|
|
|
2797
2806
|
},
|
|
2798
2807
|
emits: [ "changeLanguage", "changeUserDropdown", "changeOptions", "tabsChange", "tabsSelect", "tabsClose" ],
|
|
2799
2808
|
setup(props, {slots: slots, emit: emit}) {
|
|
2800
|
-
const _config = vue.ref(mergeWith(defaultConfig$
|
|
2801
|
-
vue.provide("options", _config.value), vue.provide("__ns__", ns$
|
|
2809
|
+
const _config = vue.ref(mergeWith(defaultConfig$4, props.options, customizerCoverArray));
|
|
2810
|
+
vue.provide("options", _config.value), vue.provide("__ns__", ns$e), vue.provide("__emit__", emit),
|
|
2802
2811
|
vue.provide("__slots__", slots);
|
|
2803
2812
|
const updateOptions = cfg => {
|
|
2804
2813
|
_config.value = mergeWith(_config.value, cfg, customizerCoverArray), updateThemeColorCssVar(_config.value?.setting),
|
|
@@ -2822,13 +2831,13 @@
|
|
|
2822
2831
|
const _activeSlots = {};
|
|
2823
2832
|
for (const key in slots) Object.prototype.hasOwnProperty.call(slots, key) && (_activeSlots[key] = () => slots[key]?.());
|
|
2824
2833
|
return vue.createVNode("div", {
|
|
2825
|
-
class: [ ns$
|
|
2834
|
+
class: [ ns$e.b(), props.className ],
|
|
2826
2835
|
style: props.style
|
|
2827
2836
|
}, [ vue.h(activeLayout.value, {}, {
|
|
2828
2837
|
..._activeSlots
|
|
2829
2838
|
}) ]);
|
|
2830
2839
|
}
|
|
2831
|
-
})), ns$
|
|
2840
|
+
})), ns$d = useNamespace("tabs");
|
|
2832
2841
|
var Element$8 = vue.defineComponent({
|
|
2833
2842
|
name: "NextTabs",
|
|
2834
2843
|
props: {
|
|
@@ -2898,12 +2907,12 @@
|
|
|
2898
2907
|
tabsView.value.push(activeRoute)), emit("change", activeIndex.value, tabsView.value, "add");
|
|
2899
2908
|
}));
|
|
2900
2909
|
const renderContent = () => vue.createVNode("nav", {
|
|
2901
|
-
class: ns$
|
|
2910
|
+
class: ns$d.b()
|
|
2902
2911
|
}, [ vue.createVNode(elementPlus.ElScrollbar, null, {
|
|
2903
2912
|
default: () => [ vue.createVNode("ul", {
|
|
2904
|
-
class: ns$
|
|
2913
|
+
class: ns$d.b("list")
|
|
2905
2914
|
}, [ tabsView.value.map(((tab, index) => tab ? vue.createVNode("li", {
|
|
2906
|
-
class: [ "tab-item", ns$
|
|
2915
|
+
class: [ "tab-item", ns$d.is("active", activeIndex.value === index) ],
|
|
2907
2916
|
onClick: event => onClickTabItem(event, tab, index)
|
|
2908
2917
|
}, [ vue.createVNode("i", {
|
|
2909
2918
|
class: [ "tab-icon", tab.meta?.icon ]
|
|
@@ -2934,11 +2943,11 @@
|
|
|
2934
2943
|
onCommand: onChange
|
|
2935
2944
|
}, {
|
|
2936
2945
|
default: () => vue.createVNode("span", {
|
|
2937
|
-
class: ns$
|
|
2946
|
+
class: ns$d.b("tab-more")
|
|
2938
2947
|
}, [ vue.createVNode("i", {
|
|
2939
|
-
class: [ ns$
|
|
2948
|
+
class: [ ns$d.be("tab-more", "box"), ns$d.be("tab-more", "top") ]
|
|
2940
2949
|
}, null), vue.createVNode("i", {
|
|
2941
|
-
class: [ ns$
|
|
2950
|
+
class: [ ns$d.be("tab-more", "box"), ns$d.be("tab-more", "bottom") ]
|
|
2942
2951
|
}, null) ]),
|
|
2943
2952
|
dropdown: () => vue.createVNode(elementPlus.ElDropdownMenu, null, {
|
|
2944
2953
|
default: () => [ vue.createVNode(elementPlus.ElDropdownItem, {
|
|
@@ -2971,7 +2980,7 @@
|
|
|
2971
2980
|
return () => vue.createVNode(vue.Fragment, null, [ renderContent() ]);
|
|
2972
2981
|
}
|
|
2973
2982
|
});
|
|
2974
|
-
const NextTabs = withInstall(Element$8), ns$
|
|
2983
|
+
const NextTabs = withInstall(Element$8), ns$c = useNamespace("container");
|
|
2975
2984
|
const NextContainer = withInstall(vue.defineComponent({
|
|
2976
2985
|
name: "NextContainer",
|
|
2977
2986
|
props: {
|
|
@@ -3009,18 +3018,18 @@
|
|
|
3009
3018
|
}), style;
|
|
3010
3019
|
}));
|
|
3011
3020
|
return () => props.scrollbar ? vue.createVNode(elementPlus.ElScrollbar, {
|
|
3012
|
-
class: [ ns$
|
|
3021
|
+
class: [ ns$c.b(), props.className ],
|
|
3013
3022
|
style: props.style
|
|
3014
3023
|
}, {
|
|
3015
3024
|
default: () => [ slots.default?.() ]
|
|
3016
3025
|
}) : vue.createVNode("div", {
|
|
3017
|
-
class: [ ns$
|
|
3026
|
+
class: [ ns$c.b(), props.className ],
|
|
3018
3027
|
style: {
|
|
3019
3028
|
...styles.value,
|
|
3020
3029
|
...props.style
|
|
3021
3030
|
}
|
|
3022
3031
|
}, [ props.card ? vue.createVNode("div", {
|
|
3023
|
-
class: ns$
|
|
3032
|
+
class: ns$c.b("card")
|
|
3024
3033
|
}, [ slots.default?.() ]) : slots.default?.() ]);
|
|
3025
3034
|
}
|
|
3026
3035
|
}));
|
|
@@ -3094,7 +3103,7 @@
|
|
|
3094
3103
|
}
|
|
3095
3104
|
};
|
|
3096
3105
|
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" ];
|
|
3097
|
-
var defaultConfig$
|
|
3106
|
+
var defaultConfig$3 = {
|
|
3098
3107
|
initLoadData: !0,
|
|
3099
3108
|
defaultContentHeight: 300,
|
|
3100
3109
|
fullscreenchangeContentHeight: !1,
|
|
@@ -3140,7 +3149,7 @@
|
|
|
3140
3149
|
formSpan: 12,
|
|
3141
3150
|
formColumnMinWidth: 350
|
|
3142
3151
|
};
|
|
3143
|
-
const columnSlotName = prop => "column-" + prop, searchFormSlotName = prop => "search-" + prop, formSlotName = prop => "form-" + prop, ns$
|
|
3152
|
+
const columnSlotName = prop => "column-" + prop, searchFormSlotName = prop => "search-" + prop, formSlotName = prop => "form-" + prop, ns$b = useNamespace("spin-loading");
|
|
3144
3153
|
var NextSpinLoading$1 = vue.defineComponent({
|
|
3145
3154
|
name: "NextSpinLoading",
|
|
3146
3155
|
props: {
|
|
@@ -3161,31 +3170,35 @@
|
|
|
3161
3170
|
default: ""
|
|
3162
3171
|
}
|
|
3163
3172
|
},
|
|
3164
|
-
setup() {
|
|
3165
|
-
const {t: t} = useLocale();
|
|
3166
|
-
return {
|
|
3167
|
-
|
|
3173
|
+
setup(props, {expose: expose}) {
|
|
3174
|
+
const {t: t} = useLocale(), elementInstance = vue.ref();
|
|
3175
|
+
return expose({
|
|
3176
|
+
elementInstance: elementInstance
|
|
3177
|
+
}), {
|
|
3178
|
+
t: t,
|
|
3179
|
+
elementInstance: elementInstance
|
|
3168
3180
|
};
|
|
3169
3181
|
},
|
|
3170
3182
|
render() {
|
|
3171
3183
|
const _t = this.t, slots = this.$slots, props = this.$props, loadingText = props.tip || _t("next.loading");
|
|
3172
3184
|
return vue.createVNode("div", {
|
|
3173
|
-
|
|
3185
|
+
ref: "elementInstance",
|
|
3186
|
+
class: [ ns$b.b(), props.className ],
|
|
3174
3187
|
style: props.style
|
|
3175
3188
|
}, [ slots.default?.(), props.loading ? vue.createVNode("div", {
|
|
3176
|
-
class: ns$
|
|
3189
|
+
class: ns$b.b("mask")
|
|
3177
3190
|
}, [ vue.createVNode("span", {
|
|
3178
|
-
class: ns$
|
|
3191
|
+
class: ns$b.b("mask-dot")
|
|
3179
3192
|
}, [ vue.createVNode("i", {
|
|
3180
|
-
class: ns$
|
|
3193
|
+
class: ns$b.be("mask", "dot-item")
|
|
3181
3194
|
}, null), vue.createVNode("i", {
|
|
3182
|
-
class: ns$
|
|
3195
|
+
class: ns$b.be("mask", "dot-item")
|
|
3183
3196
|
}, null), vue.createVNode("i", {
|
|
3184
|
-
class: ns$
|
|
3197
|
+
class: ns$b.be("mask", "dot-item")
|
|
3185
3198
|
}, null), vue.createVNode("i", {
|
|
3186
|
-
class: ns$
|
|
3199
|
+
class: ns$b.be("mask", "dot-item")
|
|
3187
3200
|
}, null) ]), vue.createVNode("span", {
|
|
3188
|
-
class: ns$
|
|
3201
|
+
class: ns$b.be("mask", "text")
|
|
3189
3202
|
}, [ loadingText ]) ]) : null ]);
|
|
3190
3203
|
}
|
|
3191
3204
|
}), SearchColumn = vue.defineComponent({
|
|
@@ -3598,8 +3611,11 @@
|
|
|
3598
3611
|
class: ns.b("header-menu")
|
|
3599
3612
|
}, [ vue.createVNode("div", {
|
|
3600
3613
|
class: ns.b("header-menu-left")
|
|
3601
|
-
}, [ this.$slots["menu-left-prefix"]?.(
|
|
3614
|
+
}, [ this.$slots["menu-left-prefix"]?.({
|
|
3615
|
+
size: options.size
|
|
3616
|
+
}), options.addBtn && vue.createVNode(elementPlus.ElButton, {
|
|
3602
3617
|
type: "primary",
|
|
3618
|
+
size: options.size,
|
|
3603
3619
|
onClick: () => {
|
|
3604
3620
|
this.$emit("clickAdd");
|
|
3605
3621
|
}
|
|
@@ -3610,6 +3626,7 @@
|
|
|
3610
3626
|
default: () => t("next.table.add")
|
|
3611
3627
|
}), options.batchDelBtn && vue.createVNode(elementPlus.ElButton, {
|
|
3612
3628
|
type: "danger",
|
|
3629
|
+
size: options.size,
|
|
3613
3630
|
disabled: !multipleSelectionLength.value,
|
|
3614
3631
|
onClick: () => {
|
|
3615
3632
|
const selection = vue.unref(vue.toRaw(multipleSelection.value.map((row => vue.toRaw(row)))));
|
|
@@ -3633,10 +3650,15 @@
|
|
|
3633
3650
|
default: () => [ vue.createVNode(delete_default, null, null) ]
|
|
3634
3651
|
}),
|
|
3635
3652
|
default: () => t("next.table.batchDelete")
|
|
3636
|
-
}), this.$slots["menu-left-suffix"]?.(
|
|
3653
|
+
}), this.$slots["menu-left-suffix"]?.({
|
|
3654
|
+
size: options.size
|
|
3655
|
+
}) ]), vue.createVNode("div", {
|
|
3637
3656
|
class: ns.b("header-menu-right")
|
|
3638
|
-
}, [ this.$slots["menu-right-prefix"]?.(
|
|
3657
|
+
}, [ this.$slots["menu-right-prefix"]?.({
|
|
3658
|
+
size: options.size
|
|
3659
|
+
}), options.refreshBtn && vue.createVNode(elementPlus.ElButton, {
|
|
3639
3660
|
circle: !0,
|
|
3661
|
+
size: options.size,
|
|
3640
3662
|
onClick: () => {
|
|
3641
3663
|
this.$emit("clickRefresh");
|
|
3642
3664
|
}
|
|
@@ -3646,6 +3668,7 @@
|
|
|
3646
3668
|
})
|
|
3647
3669
|
}), options.settingBtn && vue.createVNode(elementPlus.ElButton, {
|
|
3648
3670
|
circle: !0,
|
|
3671
|
+
size: options.size,
|
|
3649
3672
|
onClick: () => {
|
|
3650
3673
|
drawerSettingRef.value.visible = !0;
|
|
3651
3674
|
}
|
|
@@ -3653,7 +3676,9 @@
|
|
|
3653
3676
|
icon: () => vue.createVNode(elementPlus.ElIcon, null, {
|
|
3654
3677
|
default: () => [ vue.createVNode(tools_default, null, null) ]
|
|
3655
3678
|
})
|
|
3656
|
-
}), this.$slots["menu-right-suffix"]?.(
|
|
3679
|
+
}), this.$slots["menu-right-suffix"]?.({
|
|
3680
|
+
size: options.size
|
|
3681
|
+
}) ]), vue.createVNode(DrawerSetting, {
|
|
3657
3682
|
ref: drawerSettingRef
|
|
3658
3683
|
}, null) ]);
|
|
3659
3684
|
}
|
|
@@ -3858,7 +3883,7 @@
|
|
|
3858
3883
|
}, null) ]);
|
|
3859
3884
|
}
|
|
3860
3885
|
});
|
|
3861
|
-
const ns$
|
|
3886
|
+
const ns$a = useNamespace("dialog");
|
|
3862
3887
|
var NextDialog$1 = vue.defineComponent({
|
|
3863
3888
|
name: "NextDialog",
|
|
3864
3889
|
props: {
|
|
@@ -3923,7 +3948,7 @@
|
|
|
3923
3948
|
return () => vue.createVNode(vue.Fragment, null, [ vue.createVNode(elementPlus.ElDialog, {
|
|
3924
3949
|
modelValue: visible.value,
|
|
3925
3950
|
"onUpdate:modelValue": $event => visible.value = $event,
|
|
3926
|
-
class: ns$
|
|
3951
|
+
class: ns$a.b(),
|
|
3927
3952
|
title: props.title,
|
|
3928
3953
|
appendToBody: props.appendToBody,
|
|
3929
3954
|
"destroy-on-close": !0,
|
|
@@ -3940,12 +3965,12 @@
|
|
|
3940
3965
|
}, {
|
|
3941
3966
|
default: () => [ slots.default?.() ],
|
|
3942
3967
|
header: ({close: close, titleId: titleId, titleClass: titleClass}) => vue.createVNode("div", {
|
|
3943
|
-
class: ns$
|
|
3968
|
+
class: ns$a.b("header")
|
|
3944
3969
|
}, [ vue.createVNode("h4", {
|
|
3945
3970
|
id: titleId,
|
|
3946
3971
|
class: titleClass
|
|
3947
3972
|
}, [ props.title ]), vue.createVNode("div", {
|
|
3948
|
-
class: ns$
|
|
3973
|
+
class: ns$a.e("header-right")
|
|
3949
3974
|
}, [ props.fullscreenBtn && vue.createVNode("span", {
|
|
3950
3975
|
class: "icon-fullscreen",
|
|
3951
3976
|
onClick: () => isFullscreen.value = !isFullscreen.value
|
|
@@ -3977,7 +4002,7 @@
|
|
|
3977
4002
|
settingBtn: !0,
|
|
3978
4003
|
operations: !1
|
|
3979
4004
|
};
|
|
3980
|
-
var defaultConfig$
|
|
4005
|
+
var defaultConfig$2 = {
|
|
3981
4006
|
size: "default",
|
|
3982
4007
|
colSpan: 8,
|
|
3983
4008
|
labelWidth: "6em",
|
|
@@ -3991,7 +4016,7 @@
|
|
|
3991
4016
|
submitText: null,
|
|
3992
4017
|
resetText: null
|
|
3993
4018
|
};
|
|
3994
|
-
const ns$
|
|
4019
|
+
const ns$9 = useNamespace("form");
|
|
3995
4020
|
var NumberRangePicker = vue.defineComponent({
|
|
3996
4021
|
name: "NumberRangePicker",
|
|
3997
4022
|
props: {
|
|
@@ -4030,7 +4055,7 @@
|
|
|
4030
4055
|
}));
|
|
4031
4056
|
return () => vue.createVNode(vue.Fragment, null, [ vue.createVNode("div", {
|
|
4032
4057
|
ref: numberRangeRef,
|
|
4033
|
-
class: ns$
|
|
4058
|
+
class: ns$9.e("number-range")
|
|
4034
4059
|
}, [ vue.createVNode(elementPlus.ElInputNumber, {
|
|
4035
4060
|
modelValue: startNumber.value,
|
|
4036
4061
|
"onUpdate:modelValue": $event => startNumber.value = $event,
|
|
@@ -4040,7 +4065,7 @@
|
|
|
4040
4065
|
disabled: disabled,
|
|
4041
4066
|
onChange: onChangeStart
|
|
4042
4067
|
}, null), vue.createVNode("span", {
|
|
4043
|
-
class: ns$
|
|
4068
|
+
class: ns$9.em("number-range", "division")
|
|
4044
4069
|
}, [ t("next.date.rangeSeparator") ]), vue.createVNode(elementPlus.ElInputNumber, {
|
|
4045
4070
|
modelValue: endNumber.value,
|
|
4046
4071
|
"onUpdate:modelValue": $event => endNumber.value = $event,
|
|
@@ -4056,7 +4081,7 @@
|
|
|
4056
4081
|
function _isSlot$3(s) {
|
|
4057
4082
|
return "function" == typeof s || "[object Object]" === Object.prototype.toString.call(s) && !vue.isVNode(s);
|
|
4058
4083
|
}
|
|
4059
|
-
const ns$
|
|
4084
|
+
const ns$8 = useNamespace("form"), InputTableSelect = vue.defineComponent({
|
|
4060
4085
|
name: "InputTableSelect",
|
|
4061
4086
|
props: {
|
|
4062
4087
|
modelValue: {
|
|
@@ -4084,7 +4109,7 @@
|
|
|
4084
4109
|
},
|
|
4085
4110
|
emits: [ "select" ],
|
|
4086
4111
|
setup(props, {emit: emit}) {
|
|
4087
|
-
const {t: t} = useLocale(), _disabled = props.disabled, _column = props.column, _placeholder = _column.placeholder || t("next.form.select") + _column.label, _tableDefaultConfig = deepClone(defaultConfig$
|
|
4112
|
+
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({
|
|
4088
4113
|
visible: !1,
|
|
4089
4114
|
title: _column.label + t("next.form.tableSelect"),
|
|
4090
4115
|
dialogWidth: _options.dialogWidth
|
|
@@ -4155,18 +4180,18 @@
|
|
|
4155
4180
|
}, renderContent = () => {
|
|
4156
4181
|
let _slot, _slot2;
|
|
4157
4182
|
return vue.createVNode(vue.Fragment, null, [ vue.createVNode("div", {
|
|
4158
|
-
class: [ "el-input", ns$
|
|
4183
|
+
class: [ "el-input", ns$8.e("input-table"), ns$8.is("disabled", _disabled) ]
|
|
4159
4184
|
}, [ vue.createVNode("div", {
|
|
4160
4185
|
class: "el-input__wrapper"
|
|
4161
4186
|
}, [ tags?.value.length ? vue.createVNode("span", {
|
|
4162
|
-
class: ns$
|
|
4187
|
+
class: ns$8.em("input-table", "value")
|
|
4163
4188
|
}, [ tags.value.map(((tag, index) => vue.createVNode(elementPlus.ElTag, {
|
|
4164
4189
|
closable: !_disabled,
|
|
4165
4190
|
onClose: () => _onCloseTag(0, index)
|
|
4166
4191
|
}, {
|
|
4167
4192
|
default: () => [ tag.label ]
|
|
4168
4193
|
}))), tagsMore?.value?.length ? vue.createVNode(elementPlus.ElTooltip, {
|
|
4169
|
-
"popper-class": ns$
|
|
4194
|
+
"popper-class": ns$8.e("tooltip-tags"),
|
|
4170
4195
|
placement: "bottom",
|
|
4171
4196
|
effect: "light"
|
|
4172
4197
|
}, {
|
|
@@ -4180,10 +4205,10 @@
|
|
|
4180
4205
|
default: () => [ tag.label ]
|
|
4181
4206
|
})))
|
|
4182
4207
|
}) : null ]) : vue.createVNode("span", {
|
|
4183
|
-
class: ns$
|
|
4208
|
+
class: ns$8.em("input-table", "placeholder")
|
|
4184
4209
|
}, [ _placeholder ]) ]), vue.createVNode(elementPlus.ElButton, {
|
|
4185
4210
|
type: "primary",
|
|
4186
|
-
class: ns$
|
|
4211
|
+
class: ns$8.em("input-table", "append"),
|
|
4187
4212
|
disabled: _disabled,
|
|
4188
4213
|
icon: search_default,
|
|
4189
4214
|
onClick: onClickTableDialog
|
|
@@ -4197,7 +4222,7 @@
|
|
|
4197
4222
|
onClose: onCloseTableDialog
|
|
4198
4223
|
}, {
|
|
4199
4224
|
default: () => [ vue.createVNode("div", {
|
|
4200
|
-
class: ns$
|
|
4225
|
+
class: ns$8.em("input-table", "content")
|
|
4201
4226
|
}, [ vue.createVNode(elementPlus.ElRadioGroup, {
|
|
4202
4227
|
modelValue: sinleSelection.value
|
|
4203
4228
|
}, {
|
|
@@ -4220,7 +4245,7 @@
|
|
|
4220
4245
|
}) ]
|
|
4221
4246
|
}) ]
|
|
4222
4247
|
}) ]), vue.createVNode("div", {
|
|
4223
|
-
class: ns$
|
|
4248
|
+
class: ns$8.em("input-table", "footer")
|
|
4224
4249
|
}, [ vue.createVNode(elementPlus.ElButton, {
|
|
4225
4250
|
onClick: onResetTableSelect
|
|
4226
4251
|
}, _isSlot$3(_slot = t("next.form.reset")) ? _slot : {
|
|
@@ -4236,7 +4261,7 @@
|
|
|
4236
4261
|
};
|
|
4237
4262
|
return () => vue.createVNode(vue.Fragment, null, [ renderContent() ]);
|
|
4238
4263
|
}
|
|
4239
|
-
}), ns$
|
|
4264
|
+
}), ns$7 = useNamespace("form");
|
|
4240
4265
|
var UploadImage = vue.defineComponent({
|
|
4241
4266
|
name: "UploadImage",
|
|
4242
4267
|
props: {
|
|
@@ -4261,12 +4286,20 @@
|
|
|
4261
4286
|
values: [ "text", "picture", "picture-card" ],
|
|
4262
4287
|
default: "picture-card"
|
|
4263
4288
|
},
|
|
4289
|
+
multiple: {
|
|
4290
|
+
type: Boolean,
|
|
4291
|
+
default: !1
|
|
4292
|
+
},
|
|
4293
|
+
limit: {
|
|
4294
|
+
type: Number,
|
|
4295
|
+
default: 1
|
|
4296
|
+
},
|
|
4264
4297
|
accept: {
|
|
4265
4298
|
type: String,
|
|
4266
4299
|
default: "image/*"
|
|
4267
4300
|
}
|
|
4268
4301
|
},
|
|
4269
|
-
emits: [ "change" ],
|
|
4302
|
+
emits: [ "change", "exceed" ],
|
|
4270
4303
|
setup(props) {
|
|
4271
4304
|
const {appContext: appContext} = vue.getCurrentInstance(), {t: t} = useLocale();
|
|
4272
4305
|
return {
|
|
@@ -4284,7 +4317,7 @@
|
|
|
4284
4317
|
let urls = [];
|
|
4285
4318
|
return "string" == typeof value ? urls = [ value ] : "[object Array]" === Object.prototype.toString.call(value) && (urls = value),
|
|
4286
4319
|
urls = urls.filter((url => !!url)), urls.length ? vue.createVNode(elementPlus.ElImage, {
|
|
4287
|
-
class: ns$
|
|
4320
|
+
class: ns$7.e("preview-image"),
|
|
4288
4321
|
src: urls[0],
|
|
4289
4322
|
previewSrcList: urls,
|
|
4290
4323
|
"preview-teleported": !0,
|
|
@@ -4299,9 +4332,11 @@
|
|
|
4299
4332
|
})
|
|
4300
4333
|
}) : null;
|
|
4301
4334
|
})(), _disabled ? null : vue.createVNode(elementPlus.ElUpload, {
|
|
4302
|
-
class: [ ns$
|
|
4335
|
+
class: [ ns$7.b("upload-image"), props.className ],
|
|
4303
4336
|
style: props.style,
|
|
4304
4337
|
"list-type": props.listType,
|
|
4338
|
+
multiple: props.multiple,
|
|
4339
|
+
limit: props.limit,
|
|
4305
4340
|
"auto-upload": !1,
|
|
4306
4341
|
"on-preview": uploadFile => {
|
|
4307
4342
|
const body = document.getElementsByTagName("body")[0], initial = uploadfilesPreview.value.findIndex((file => file.url === uploadFile.url)) || 0;
|
|
@@ -4320,8 +4355,14 @@
|
|
|
4320
4355
|
});
|
|
4321
4356
|
previewImagesContainer.appContext = this.appContext, vue.render(previewComponent, previewImagesContainer);
|
|
4322
4357
|
},
|
|
4323
|
-
|
|
4358
|
+
"on-change": (uploadfile, uploadfiles) => {
|
|
4324
4359
|
uploadfilesPreview.value = uploadfiles, emit("change", uploadfile, uploadfiles);
|
|
4360
|
+
},
|
|
4361
|
+
"on-exceed": (uploadfile, uploadfiles) => {
|
|
4362
|
+
elementPlus.ElMessage({
|
|
4363
|
+
type: "info",
|
|
4364
|
+
message: _t("next.table.uploadfileExceed")
|
|
4365
|
+
}), emit("exceed", uploadfile, uploadfiles);
|
|
4325
4366
|
}
|
|
4326
4367
|
}, {
|
|
4327
4368
|
trigger: () => slots.default ? slots.default() : "picture-card" === props.listType ? vue.createVNode(elementPlus.ElIcon, null, {
|
|
@@ -4424,7 +4465,10 @@
|
|
|
4424
4465
|
}, null) ]);
|
|
4425
4466
|
}
|
|
4426
4467
|
});
|
|
4427
|
-
|
|
4468
|
+
function _isSlot$2(s) {
|
|
4469
|
+
return "function" == typeof s || "[object Object]" === Object.prototype.toString.call(s) && !vue.isVNode(s);
|
|
4470
|
+
}
|
|
4471
|
+
const ns$6 = useNamespace("form");
|
|
4428
4472
|
var Element$6 = vue.defineComponent({
|
|
4429
4473
|
name: "NextForm",
|
|
4430
4474
|
props: {
|
|
@@ -4443,7 +4487,7 @@
|
|
|
4443
4487
|
},
|
|
4444
4488
|
emits: [ "submit", "close", "reset" ],
|
|
4445
4489
|
setup(props, {slots: slots, emit: emit, expose: expose}) {
|
|
4446
|
-
const _config = deepClone(defaultConfig$
|
|
4490
|
+
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({});
|
|
4447
4491
|
vue.watch((() => [ props.columns, props.formDatum ]), (() => {
|
|
4448
4492
|
(() => {
|
|
4449
4493
|
const columns = props.columns;
|
|
@@ -4466,17 +4510,17 @@
|
|
|
4466
4510
|
deep: !0,
|
|
4467
4511
|
immediate: !0
|
|
4468
4512
|
});
|
|
4469
|
-
const formColumns = arrayObjNoRepeat(_formColumns.value, "prop");
|
|
4513
|
+
const formColumns = arrayObjNoRepeat(_formColumns.value, "prop"), spanResizeLoading = vue.ref(!1);
|
|
4470
4514
|
vue.onMounted((() => {
|
|
4471
4515
|
const formEl = ruleFormRef.value?.$el;
|
|
4472
4516
|
let timer = null;
|
|
4473
4517
|
elementResize(formEl, (el => {
|
|
4474
|
-
null !== timer
|
|
4518
|
+
null !== timer ? clearTimeout(timer) : spanResizeLoading.value = !0, timer = setTimeout((() => {
|
|
4475
4519
|
colSpan.value = ((el, minWidth = 350) => {
|
|
4476
4520
|
const el_width = el.clientWidth;
|
|
4477
4521
|
let span = Math.floor(el_width / minWidth);
|
|
4478
4522
|
return span > 4 && (span = 4), Math.ceil(24 / span);
|
|
4479
|
-
})(el, options.columnMinWidth), clearTimeout(timer);
|
|
4523
|
+
})(el, options.columnMinWidth), spanResizeLoading.value = !1, clearTimeout(timer);
|
|
4480
4524
|
}), 200);
|
|
4481
4525
|
}));
|
|
4482
4526
|
}));
|
|
@@ -4767,7 +4811,10 @@
|
|
|
4767
4811
|
modelValue: formParams[col.prop],
|
|
4768
4812
|
"onUpdate:modelValue": $event => formParams[col.prop] = $event,
|
|
4769
4813
|
disabled: col.disabled,
|
|
4770
|
-
|
|
4814
|
+
multiple: col.multiple,
|
|
4815
|
+
limit: col.limit,
|
|
4816
|
+
onChange: (...arg) => col.onChange?.(...arg, col, formParams, formColumns),
|
|
4817
|
+
onExceed: (...arg) => col.onExceed?.(...arg, col, formParams, formColumns)
|
|
4771
4818
|
}, null) : "treeSelect" === col.type ? vue.createVNode(treeSelect, {
|
|
4772
4819
|
modelValue: formParams[col.prop],
|
|
4773
4820
|
"onUpdate:modelValue": $event => formParams[col.prop] = $event,
|
|
@@ -4783,19 +4830,22 @@
|
|
|
4783
4830
|
getFormInstance: () => ruleFormRef.value,
|
|
4784
4831
|
getFormParams: () => vue.toRaw(formParams)
|
|
4785
4832
|
});
|
|
4786
|
-
|
|
4787
|
-
let
|
|
4788
|
-
return vue.createVNode(
|
|
4789
|
-
|
|
4790
|
-
|
|
4791
|
-
|
|
4792
|
-
|
|
4793
|
-
|
|
4794
|
-
|
|
4795
|
-
|
|
4796
|
-
|
|
4833
|
+
return () => {
|
|
4834
|
+
let _slot2;
|
|
4835
|
+
return vue.createVNode(NextSpinLoading, {
|
|
4836
|
+
loading: spanResizeLoading.value
|
|
4837
|
+
}, _isSlot$2(_slot2 = (() => {
|
|
4838
|
+
let _slot;
|
|
4839
|
+
return vue.createVNode(elementPlus.ElForm, {
|
|
4840
|
+
ref: ruleFormRef,
|
|
4841
|
+
class: ns$6.b(),
|
|
4842
|
+
inline: !1,
|
|
4843
|
+
model: formParams,
|
|
4844
|
+
size: options.size
|
|
4845
|
+
}, {
|
|
4846
|
+
default: () => [ vue.createVNode(elementPlus.ElRow, {
|
|
4797
4847
|
gutter: 20
|
|
4798
|
-
}, (
|
|
4848
|
+
}, _isSlot$2(_slot = formColumns.map((column => !column.hide && vue.createVNode(elementPlus.ElCol, {
|
|
4799
4849
|
span: valueExist(column.span, colSpan.value)
|
|
4800
4850
|
}, {
|
|
4801
4851
|
default: () => [ vue.createVNode(elementPlus.ElFormItem, {
|
|
@@ -4808,7 +4858,7 @@
|
|
|
4808
4858
|
}, {
|
|
4809
4859
|
label: () => column.label ? vue.createVNode(vue.Fragment, null, [ vue.createVNode(NextTextEllipsis, {
|
|
4810
4860
|
content: t(column.label),
|
|
4811
|
-
class: ns$
|
|
4861
|
+
class: ns$6.e("item-label")
|
|
4812
4862
|
}, null), column.tip ? vue.createVNode(elementPlus.ElTooltip, {
|
|
4813
4863
|
effect: "dark",
|
|
4814
4864
|
content: column.tip,
|
|
@@ -4825,10 +4875,10 @@
|
|
|
4825
4875
|
}) : null ]) : null,
|
|
4826
4876
|
default: () => renderFormItem(column)
|
|
4827
4877
|
}) ]
|
|
4828
|
-
})))
|
|
4878
|
+
})))) ? _slot : {
|
|
4829
4879
|
default: () => [ _slot ]
|
|
4830
|
-
})
|
|
4831
|
-
class: ns$
|
|
4880
|
+
}), _isEditing.value && options.showFooter ? vue.createVNode("div", {
|
|
4881
|
+
class: ns$6.e("footer")
|
|
4832
4882
|
}, [ vue.createVNode(elementPlus.ElButton, {
|
|
4833
4883
|
type: "primary",
|
|
4834
4884
|
loading: submitLoading.value,
|
|
@@ -4839,12 +4889,12 @@
|
|
|
4839
4889
|
onClick: onResetForm
|
|
4840
4890
|
}, {
|
|
4841
4891
|
default: () => [ t(options.resetText) || t("next.form.reset") ]
|
|
4842
|
-
}) : null ]) : null ]
|
|
4843
|
-
|
|
4844
|
-
|
|
4892
|
+
}) : null ]) : null ]
|
|
4893
|
+
});
|
|
4894
|
+
})()) ? _slot2 : {
|
|
4895
|
+
default: () => [ _slot2 ]
|
|
4845
4896
|
});
|
|
4846
4897
|
};
|
|
4847
|
-
return () => vue.createVNode(vue.Fragment, null, [ renderContent() ]);
|
|
4848
4898
|
}
|
|
4849
4899
|
});
|
|
4850
4900
|
const NextTreeSelect = withInstall(treeSelect), NextForm = withInstall(Element$6);
|
|
@@ -4901,17 +4951,17 @@
|
|
|
4901
4951
|
function _isSlot(s) {
|
|
4902
4952
|
return "function" == typeof s || "[object Object]" === Object.prototype.toString.call(s) && !vue.isVNode(s);
|
|
4903
4953
|
}
|
|
4904
|
-
const ns$
|
|
4954
|
+
const ns$5 = useNamespace("crud-table");
|
|
4905
4955
|
var Element$5 = vue.defineComponent({
|
|
4906
4956
|
name: "NextCrudTable",
|
|
4907
4957
|
props: defaultPropsConfig,
|
|
4908
4958
|
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" ],
|
|
4909
4959
|
setup(props, {emit: emit, slots: slots, expose: expose}) {
|
|
4910
|
-
const _config = deepClone(defaultConfig$
|
|
4960
|
+
const _config = deepClone(defaultConfig$3), _options = vue.computed((() => {
|
|
4911
4961
|
const cfg = vue.unref(props.options);
|
|
4912
4962
|
return merge$1(_config, cfg);
|
|
4913
4963
|
})), options = vue.unref(_options);
|
|
4914
|
-
vue.provide("options", vue.computed((() => _options.value))), vue.provide("ns", ns$
|
|
4964
|
+
vue.provide("options", vue.computed((() => _options.value))), vue.provide("ns", ns$5);
|
|
4915
4965
|
const {t: t} = useLocale(), _columns = vue.ref(options.columns), _searchColumns = vue.ref([]), _formColumns = vue.ref([]), _updateColumnsAll = ops => {
|
|
4916
4966
|
((options, cb) => {
|
|
4917
4967
|
const _columns = vue.reactive(options.columns), _loadDicData = col => {
|
|
@@ -4946,6 +4996,7 @@
|
|
|
4946
4996
|
rules: valueExist(col.formRules, col.rules, null),
|
|
4947
4997
|
span: valueExist(col.formSpan, col.span, null),
|
|
4948
4998
|
multiple: valueExist(col.formMultiple, col.multiple, !1),
|
|
4999
|
+
limit: valueExist(col.formLimit, col.limit, 1),
|
|
4949
5000
|
dicData: valueExist(col.formDicData, col.dicData, []),
|
|
4950
5001
|
loadDicData: valueExist(col.formLoadDicData, col.loadDicData, null),
|
|
4951
5002
|
onChange: valueExist(col.onChangeForm, col.onChange, null),
|
|
@@ -5152,11 +5203,11 @@
|
|
|
5152
5203
|
});
|
|
5153
5204
|
return () => vue.createVNode(vue.Fragment, null, [ vue.createVNode(vue.Fragment, null, [ vue.createVNode("div", {
|
|
5154
5205
|
ref: crudTableRef,
|
|
5155
|
-
class: [ ns$
|
|
5206
|
+
class: [ ns$5.b(), props.className ],
|
|
5156
5207
|
style: props.style
|
|
5157
5208
|
}, [ options.showSearchForm || options.showHeaderMenu ? vue.createVNode("header", {
|
|
5158
5209
|
ref: headerRef,
|
|
5159
|
-
class: ns$
|
|
5210
|
+
class: ns$5.b("header")
|
|
5160
5211
|
}, [ options.showSearchForm && vue.createVNode(HeaderSearch, {
|
|
5161
5212
|
columns: _searchColumns.value,
|
|
5162
5213
|
onZoomResize: updateTableContentHeight,
|
|
@@ -5175,7 +5226,7 @@
|
|
|
5175
5226
|
}, {
|
|
5176
5227
|
default: () => [ vue.createVNode("div", {
|
|
5177
5228
|
ref: tableRef,
|
|
5178
|
-
class: ns$
|
|
5229
|
+
class: ns$5.b("content")
|
|
5179
5230
|
}, [ vue.createVNode(elementPlus.ElTable, {
|
|
5180
5231
|
data: tableData.value,
|
|
5181
5232
|
height: tableContentHeight.value,
|
|
@@ -5238,7 +5289,7 @@
|
|
|
5238
5289
|
}) ]) ]
|
|
5239
5290
|
}), options.isPagination ? vue.createVNode("div", {
|
|
5240
5291
|
ref: footerRef,
|
|
5241
|
-
class: ns$
|
|
5292
|
+
class: ns$5.b("footer")
|
|
5242
5293
|
}, [ vue.createVNode(FooterPagination, {
|
|
5243
5294
|
page: props.page,
|
|
5244
5295
|
onChange: onChangePagination
|
|
@@ -5294,13 +5345,13 @@
|
|
|
5294
5345
|
total: 0
|
|
5295
5346
|
})
|
|
5296
5347
|
}
|
|
5297
|
-
}, defaultConfig = {};
|
|
5298
|
-
const ns$
|
|
5348
|
+
}, defaultConfig$1 = {};
|
|
5349
|
+
const ns$4 = useNamespace("crud-table-virtualized");
|
|
5299
5350
|
const NextCrudTableVirtualized = withInstall(vue.defineComponent({
|
|
5300
5351
|
name: "NextCrudTableVirtualized",
|
|
5301
5352
|
props: propsConfig,
|
|
5302
5353
|
setup(props, {emit: emit}) {
|
|
5303
|
-
const _config = deepClone(defaultConfig), _options = vue.computed((() => {
|
|
5354
|
+
const _config = deepClone(defaultConfig$1), _options = vue.computed((() => {
|
|
5304
5355
|
const cfg = vue.unref(props.options);
|
|
5305
5356
|
return merge$1(_config, cfg);
|
|
5306
5357
|
})), options = vue.unref(_options);
|
|
@@ -5315,7 +5366,7 @@
|
|
|
5315
5366
|
emit("close-add-edit");
|
|
5316
5367
|
};
|
|
5317
5368
|
return () => vue.createVNode(vue.Fragment, null, [ vue.createVNode("div", {
|
|
5318
|
-
class: [ ns$
|
|
5369
|
+
class: [ ns$4.b(), props.className ]
|
|
5319
5370
|
}, [ vue.createVNode(NextSpinLoading, null, null), vue.createVNode(NextDialog, {
|
|
5320
5371
|
modelValue: addEditDialog.visible,
|
|
5321
5372
|
"onUpdate:modelValue": $event => addEditDialog.visible = $event,
|
|
@@ -5326,7 +5377,7 @@
|
|
|
5326
5377
|
onClose: onCloseAddEditDialog
|
|
5327
5378
|
}, null) ]) ]);
|
|
5328
5379
|
}
|
|
5329
|
-
})), NextSpinLoading = withInstall(NextSpinLoading$1), ns$
|
|
5380
|
+
})), NextSpinLoading = withInstall(NextSpinLoading$1), ns$3 = useNamespace("upload");
|
|
5330
5381
|
const NextUpload = withInstall(vue.defineComponent({
|
|
5331
5382
|
name: "NextUpload",
|
|
5332
5383
|
props: {
|
|
@@ -5360,7 +5411,7 @@
|
|
|
5360
5411
|
const slots = this.$slots, props = this.$props, emit = this.$emit, _t = this.t, uploadfilesPreview = vue.ref([]), body = document.getElementsByTagName("body")[0];
|
|
5361
5412
|
let previewImagesContainer = null;
|
|
5362
5413
|
return vue.createVNode(elementPlus.ElUpload, {
|
|
5363
|
-
class: [ ns$
|
|
5414
|
+
class: [ ns$3.b(), props.className ],
|
|
5364
5415
|
style: props.style,
|
|
5365
5416
|
"list-type": props.listType,
|
|
5366
5417
|
"auto-upload": !1,
|
|
@@ -5398,7 +5449,7 @@
|
|
|
5398
5449
|
})
|
|
5399
5450
|
});
|
|
5400
5451
|
}
|
|
5401
|
-
})), ns$
|
|
5452
|
+
})), ns$2 = useNamespace("video-player");
|
|
5402
5453
|
var Element$2 = vue.defineComponent({
|
|
5403
5454
|
name: "NextVideoPlayer",
|
|
5404
5455
|
props: {
|
|
@@ -5472,7 +5523,7 @@
|
|
|
5472
5523
|
if (!classNames || !classNames.length) throw new Error("模型类别不能未空!");
|
|
5473
5524
|
container.innerHTML = "", tf__namespace.loadGraphModel(modelUrl).then((model => {
|
|
5474
5525
|
const canvas = document.createElement("canvas");
|
|
5475
|
-
canvas.className = ns$
|
|
5526
|
+
canvas.className = ns$2.b("recongition"), container.appendChild(canvas);
|
|
5476
5527
|
const ctx = canvas.getContext("2d"), detect_ctx = document.createElement("canvas").getContext("2d");
|
|
5477
5528
|
video.ontimeupdate = () => {
|
|
5478
5529
|
const {videoWidth: videoWidth, videoHeight: videoHeight, offsetTop: offsetTop, offsetLeft: offsetLeft} = video;
|
|
@@ -5643,7 +5694,7 @@
|
|
|
5643
5694
|
});
|
|
5644
5695
|
return () => vue.createVNode(vue.Fragment, null, [ vue.createVNode("div", {
|
|
5645
5696
|
ref: videoBoxRef,
|
|
5646
|
-
class: [ ns$
|
|
5697
|
+
class: [ ns$2.b(), props.className ],
|
|
5647
5698
|
style: props.style
|
|
5648
5699
|
}, null) ]);
|
|
5649
5700
|
}
|
|
@@ -5737,7 +5788,7 @@
|
|
|
5737
5788
|
}
|
|
5738
5789
|
}, [ vue.createVNode("span", {
|
|
5739
5790
|
style: {
|
|
5740
|
-
"background-color": colors[index]
|
|
5791
|
+
"background-color": colors[index % colors.length]
|
|
5741
5792
|
},
|
|
5742
5793
|
class: "label-line"
|
|
5743
5794
|
}, null), vue.createVNode("span", null, [ name ]) ]))) ]), isValueExist(activateIndex.value) ? vue.createVNode("div", {
|
|
@@ -5753,7 +5804,9 @@
|
|
|
5753
5804
|
}) ]) : null ]);
|
|
5754
5805
|
return () => vue.createVNode(vue.Fragment, null, [ renderContent() ]);
|
|
5755
5806
|
}
|
|
5756
|
-
})
|
|
5807
|
+
});
|
|
5808
|
+
const {hexToRgb: hexToRgb} = useChangeColor();
|
|
5809
|
+
var DraggableRect = vue.defineComponent({
|
|
5757
5810
|
props: {
|
|
5758
5811
|
parentEl: {
|
|
5759
5812
|
type: Object,
|
|
@@ -5762,6 +5815,10 @@
|
|
|
5762
5815
|
rect: {
|
|
5763
5816
|
type: Object,
|
|
5764
5817
|
default: () => ({})
|
|
5818
|
+
},
|
|
5819
|
+
color: {
|
|
5820
|
+
type: String,
|
|
5821
|
+
default: null
|
|
5765
5822
|
}
|
|
5766
5823
|
},
|
|
5767
5824
|
emits: [ "draggle-resize", "contextmenu" ],
|
|
@@ -5870,17 +5927,21 @@
|
|
|
5870
5927
|
};
|
|
5871
5928
|
},
|
|
5872
5929
|
render() {
|
|
5873
|
-
const _ns = vue.inject("ns", {});
|
|
5930
|
+
const _ns = vue.inject("ns", {}), props = this.$props;
|
|
5874
5931
|
return vue.createVNode("div", {
|
|
5875
5932
|
class: [ _ns.b("draggable-rect") ],
|
|
5876
5933
|
style: (() => {
|
|
5877
|
-
const {startX: startX, startY: startY, rectWidth: rectWidth, rectHeight: rectHeight} = this.rect
|
|
5878
|
-
return {
|
|
5934
|
+
const {startX: startX, startY: startY, rectWidth: rectWidth, rectHeight: rectHeight} = this.rect, style = {
|
|
5879
5935
|
top: startY + "px",
|
|
5880
5936
|
left: startX + "px",
|
|
5881
5937
|
width: rectWidth + "px",
|
|
5882
5938
|
height: rectHeight + "px"
|
|
5883
|
-
};
|
|
5939
|
+
}, color = props.color;
|
|
5940
|
+
if (color) {
|
|
5941
|
+
const rgb_color = hexToRgb(color);
|
|
5942
|
+
rgb_color && (style.backgroundColor = `rgba(${rgb_color[0]},${rgb_color[1]},${rgb_color[2]}, 0.5)`);
|
|
5943
|
+
}
|
|
5944
|
+
return style;
|
|
5884
5945
|
})(),
|
|
5885
5946
|
onMousedown: this.onMousedown,
|
|
5886
5947
|
onMouseup: this.onMouseup,
|
|
@@ -5920,13 +5981,18 @@
|
|
|
5920
5981
|
type: Array,
|
|
5921
5982
|
default: () => []
|
|
5922
5983
|
},
|
|
5984
|
+
contextClientHeight: {
|
|
5985
|
+
type: Number,
|
|
5986
|
+
default: null
|
|
5987
|
+
},
|
|
5923
5988
|
rowInfo: {
|
|
5924
5989
|
type: Object,
|
|
5925
5990
|
default: () => ({})
|
|
5926
5991
|
}
|
|
5927
5992
|
},
|
|
5928
|
-
|
|
5929
|
-
|
|
5993
|
+
emits: [ "change" ],
|
|
5994
|
+
setup(props, {emit: emit, expose: expose}) {
|
|
5995
|
+
const ns = vue.inject("ns", {}), _emit = vue.inject("_emit", null), canvasMainRef = vue.ref(), canvasBaseRef = vue.ref(), canvasRectRef = vue.ref(), labels = vue.ref([]), drawBaseCanvas = vue.ref({}), formatLabelsType = () => {
|
|
5930
5996
|
const _labels = deepClone(labels.value);
|
|
5931
5997
|
let yolo_label = [];
|
|
5932
5998
|
return {
|
|
@@ -5937,7 +6003,7 @@
|
|
|
5937
6003
|
})),
|
|
5938
6004
|
label_txt: yolo_label.join("\n")
|
|
5939
6005
|
};
|
|
5940
|
-
},
|
|
6006
|
+
}, loadingImage = vue.ref(!1), renderImageLabel = rowInfo => {
|
|
5941
6007
|
labels.value = (rowInfo => rowInfo.labels ? rowInfo.labels.map((rect => {
|
|
5942
6008
|
const typeName = props.classes[rect.type];
|
|
5943
6009
|
return typeName && (rect.typeName = typeName), rect;
|
|
@@ -5945,15 +6011,26 @@
|
|
|
5945
6011
|
const clientHeight = canvasMainRef.value?.clientHeight, ctx = canvasBaseRef.value?.getContext("2d");
|
|
5946
6012
|
if (rowInfo?.imageSrc) {
|
|
5947
6013
|
const image = new Image;
|
|
5948
|
-
image.src = rowInfo.imageSrc, image.onload = () => {
|
|
5949
|
-
|
|
6014
|
+
image.src = rowInfo.imageSrc, loadingImage.value = !0, image.onload = () => {
|
|
6015
|
+
loadingImage.value = !1;
|
|
6016
|
+
const {width: width, height: height} = image, canvasHeight = clientHeight, scaleFactor = parseFloat((canvasHeight / height).toFixed(3)), canvasWidth = Math.ceil(width * scaleFactor);
|
|
5950
6017
|
((canvasWidth, canvasHeight) => {
|
|
5951
6018
|
canvasMainRef.value.style.width = canvasWidth + "px", canvasMainRef.value.style.height = canvasHeight + "px",
|
|
5952
6019
|
canvasBaseRef.value.width = canvasWidth, canvasBaseRef.value.height = canvasHeight,
|
|
5953
6020
|
canvasBaseRef.value.style.width = canvasWidth + "px", canvasBaseRef.value.style.height = canvasHeight + "px",
|
|
5954
6021
|
canvasRectRef.value.width = canvasWidth, canvasRectRef.value.height = canvasHeight,
|
|
5955
6022
|
canvasRectRef.value.style.width = canvasWidth + "px", canvasRectRef.value.style.height = canvasHeight + "px";
|
|
5956
|
-
})(canvasWidth, canvasHeight)
|
|
6023
|
+
})(canvasWidth, canvasHeight), labels.value = ((labels, canvasHeight) => {
|
|
6024
|
+
let scale_rects = [];
|
|
6025
|
+
for (let i = 0; i < labels.length; i++) {
|
|
6026
|
+
const rect = labels[i], scale = parseFloat((canvasHeight / rect.canvasHeight).toFixed(3));
|
|
6027
|
+
scale && (rect.startX = Math.ceil(rect.startX * scale), rect.startY = Math.ceil(rect.startY * scale),
|
|
6028
|
+
rect.rectWidth = Math.ceil(rect.rectWidth * scale), rect.rectHeight = Math.ceil(rect.rectHeight * scale),
|
|
6029
|
+
rect.canvasWidth = Math.ceil(rect.canvasWidth * scale), rect.canvasHeight = canvasHeight),
|
|
6030
|
+
scale_rects.push(rect);
|
|
6031
|
+
}
|
|
6032
|
+
return scale_rects;
|
|
6033
|
+
})(labels.value, canvasHeight);
|
|
5957
6034
|
const {updateLabels: updateLabels, addDrawRect: addDrawRect, hitCanvasLabel: hitCanvasLabel} = (options => {
|
|
5958
6035
|
const {ctx: ctx, labels: labels, image: image, canvasWidth: canvasWidth, canvasHeight: canvasHeight} = options, updateLabels = () => {
|
|
5959
6036
|
ctx.clearRect(0, 0, canvasWidth, canvasHeight), ctx.drawImage(image, 0, 0, canvasWidth, canvasHeight);
|
|
@@ -5974,15 +6051,16 @@
|
|
|
5974
6051
|
ctx.strokeStyle = color, ctx.strokeRect(startX, startY, rectWidth, rectHeight);
|
|
5975
6052
|
},
|
|
5976
6053
|
hitCanvasLabel: (x, y) => {
|
|
5977
|
-
let hit_rect = null, hit_index = null;
|
|
6054
|
+
let hit_rect = null, hit_index = null, color = null;
|
|
5978
6055
|
for (let i = 0; i < labels.length; i++) {
|
|
5979
|
-
const rect = labels[i], {startX: startX, startY: startY, rectWidth: rectWidth, rectHeight: rectHeight} = rect;
|
|
6056
|
+
const rect = labels[i], {type: type, startX: startX, startY: startY, rectWidth: rectWidth, rectHeight: rectHeight} = rect;
|
|
5980
6057
|
x >= startX && x <= startX + rectWidth && y >= startY && y <= startY + rectHeight && (hit_rect = rect,
|
|
5981
|
-
hit_index = i);
|
|
6058
|
+
hit_index = i, color = colors[type]);
|
|
5982
6059
|
}
|
|
5983
6060
|
return {
|
|
5984
6061
|
hit_rect: hit_rect,
|
|
5985
|
-
hit_index: hit_index
|
|
6062
|
+
hit_index: hit_index,
|
|
6063
|
+
color: color
|
|
5986
6064
|
};
|
|
5987
6065
|
}
|
|
5988
6066
|
};
|
|
@@ -5992,20 +6070,23 @@
|
|
|
5992
6070
|
image: image,
|
|
5993
6071
|
canvasWidth: canvasWidth,
|
|
5994
6072
|
canvasHeight: canvasHeight,
|
|
5995
|
-
labels: labels.value
|
|
6073
|
+
labels: labels.value,
|
|
6074
|
+
scaleFactor: scaleFactor
|
|
5996
6075
|
});
|
|
5997
6076
|
drawBaseCanvas.value.updateLabels = updateLabels, drawBaseCanvas.value.addDrawRect = addDrawRect,
|
|
5998
6077
|
drawBaseCanvas.value.hitCanvasLabel = hitCanvasLabel;
|
|
5999
|
-
const {clearCanvas: clearCanvas} = ((canvas, callback) => {
|
|
6078
|
+
const {clearCanvas: clearCanvas} = ((canvas, callback, keyW) => {
|
|
6000
6079
|
const canvasWidth = canvas.width, canvasHeight = canvas.height, ctx = canvas?.getContext("2d"), clearCanvas = () => {
|
|
6001
6080
|
ctx.clearRect(0, 0, canvasWidth, canvasHeight);
|
|
6002
6081
|
};
|
|
6003
6082
|
clearCanvas();
|
|
6004
6083
|
let startX, startY, endX, endY, isDrawing = !1, isRectDraw = !1, isWKeyPressed = !1;
|
|
6005
6084
|
document.addEventListener("keydown", (event => {
|
|
6006
|
-
"
|
|
6085
|
+
"KeyW" === event.code && (isWKeyPressed = !0, canvas.style.cursor = "crosshair",
|
|
6086
|
+
canvas.style.zIndex = "11", keyW && keyW());
|
|
6007
6087
|
})), document.addEventListener("keyup", (event => {
|
|
6008
|
-
"
|
|
6088
|
+
isDrawing || "KeyW" === event.code && (isWKeyPressed = !1, canvas.style.cursor = "unset",
|
|
6089
|
+
canvas.style.zIndex = "0");
|
|
6009
6090
|
})), canvas.addEventListener("mousedown", (e => {
|
|
6010
6091
|
isWKeyPressed && (isDrawing = !0, startX = e.offsetX, startY = e.offsetY);
|
|
6011
6092
|
})), canvas.addEventListener("mousemove", (e => {
|
|
@@ -6013,7 +6094,7 @@
|
|
|
6013
6094
|
drawRect());
|
|
6014
6095
|
})), canvas.addEventListener("mouseup", (() => {
|
|
6015
6096
|
if (!isRectDraw) return;
|
|
6016
|
-
isDrawing = !1, isWKeyPressed = !1;
|
|
6097
|
+
isDrawing = !1, isWKeyPressed = !1, canvas.style.cursor = "unset", canvas.style.zIndex = "0";
|
|
6017
6098
|
const rectWidth = Math.abs(endX - startX), rectHeight = Math.abs(endY - startY);
|
|
6018
6099
|
startX > endX && (startX = endX), startY > endY && (startY = endY), callback && callback({
|
|
6019
6100
|
startX: startX,
|
|
@@ -6038,8 +6119,12 @@
|
|
|
6038
6119
|
};
|
|
6039
6120
|
})(canvasRectRef.value, ((rect, {endX: endX, endY: endY}) => {
|
|
6040
6121
|
activate_add_label.value = rect, drawBaseCanvas.value.addDrawRect(rect), updateContextmenuLabelFixed(endX, endY, rect);
|
|
6122
|
+
}), (() => {
|
|
6123
|
+
onCloseDraggableRectFixed();
|
|
6041
6124
|
}));
|
|
6042
6125
|
drawBaseCanvas.value.clearCanvasRect = clearCanvas;
|
|
6126
|
+
}, image.onerror = () => {
|
|
6127
|
+
loadingImage.value = !1;
|
|
6043
6128
|
};
|
|
6044
6129
|
}
|
|
6045
6130
|
canvasBaseRef.value.addEventListener("contextmenu", (e => {
|
|
@@ -6049,9 +6134,9 @@
|
|
|
6049
6134
|
updateContextmenuLabelFixed(x, y, hit_rect);
|
|
6050
6135
|
}));
|
|
6051
6136
|
})), canvasBaseRef.value.addEventListener("click", (e => {
|
|
6052
|
-
const x = e.offsetX, y = e.offsetY, {hit_rect: hit_rect, hit_index: hit_index} = drawBaseCanvas.value.hitCanvasLabel(x, y);
|
|
6137
|
+
const x = e.offsetX, y = e.offsetY, {hit_rect: hit_rect, hit_index: hit_index, color: color} = drawBaseCanvas.value.hitCanvasLabel(x, y);
|
|
6053
6138
|
onCloseDraggableRectFixed(), onCloseContentmenuLabel(), hit_rect && vue.nextTick((() => {
|
|
6054
|
-
updateDraggableRectFixed(x, y, hit_rect, hit_index);
|
|
6139
|
+
updateDraggableRectFixed(x, y, hit_rect, hit_index, color);
|
|
6055
6140
|
}));
|
|
6056
6141
|
}));
|
|
6057
6142
|
};
|
|
@@ -6062,7 +6147,13 @@
|
|
|
6062
6147
|
}), {
|
|
6063
6148
|
deep: !0,
|
|
6064
6149
|
immediate: !0
|
|
6065
|
-
})
|
|
6150
|
+
}), vue.watch((() => props.contextClientHeight), (height => {
|
|
6151
|
+
if (valueExist(height)) {
|
|
6152
|
+
canvasMainRef.value.style.height = height + "px";
|
|
6153
|
+
const rowInfo = vue.toRaw(props.rowInfo);
|
|
6154
|
+
renderImageLabel(rowInfo);
|
|
6155
|
+
}
|
|
6156
|
+
}));
|
|
6066
6157
|
}));
|
|
6067
6158
|
const contextmenuLabelFixed = vue.ref({
|
|
6068
6159
|
show: !1,
|
|
@@ -6092,21 +6183,23 @@
|
|
|
6092
6183
|
width: 0,
|
|
6093
6184
|
height: 0,
|
|
6094
6185
|
activateRect: null,
|
|
6095
|
-
activateIndex: null
|
|
6096
|
-
|
|
6186
|
+
activateIndex: null,
|
|
6187
|
+
color: null
|
|
6188
|
+
}), updateDraggableRectFixed = (x, y, rect, index, color) => {
|
|
6097
6189
|
draggableRectFixed.value.show = !0, draggableRectFixed.value.top = y, draggableRectFixed.value.left = x,
|
|
6098
6190
|
draggableRectFixed.value.width = rect.rectWidth, draggableRectFixed.value.height = rect.rectHeight,
|
|
6099
|
-
draggableRectFixed.value.activateRect = rect, draggableRectFixed.value.activateIndex = index
|
|
6191
|
+
draggableRectFixed.value.activateRect = rect, draggableRectFixed.value.activateIndex = index,
|
|
6192
|
+
draggableRectFixed.value.color = color;
|
|
6100
6193
|
}, onCloseDraggableRectFixed = () => {
|
|
6101
6194
|
draggableRectFixed.value.show = !1, draggableRectFixed.value.top = 0, draggableRectFixed.value.left = 0,
|
|
6102
6195
|
draggableRectFixed.value.width = 0, draggableRectFixed.value.height = 0, draggableRectFixed.value.activateRect = null,
|
|
6103
|
-
draggableRectFixed.value.activateIndex = null;
|
|
6196
|
+
draggableRectFixed.value.activateIndex = null, draggableRectFixed.value.color = null;
|
|
6104
6197
|
}, onDraggleRectResize = rect => {
|
|
6105
6198
|
draggableRectFixed.value.activateRect = rect, drawBaseCanvas.value.updateLabels();
|
|
6106
6199
|
const i = labels.value.findIndex((o => isEqual(o, rect)));
|
|
6107
6200
|
i > -1 && labels.value.splice(i, 1, rect);
|
|
6108
6201
|
const {rects: rects, label_txt: label_txt} = formatLabelsType();
|
|
6109
|
-
_emit("change", rects, label_txt);
|
|
6202
|
+
_emit("change", rects, label_txt), emit("change", rects, label_txt);
|
|
6110
6203
|
}, onContextmenuDraggable = (e, rect) => {
|
|
6111
6204
|
e.preventDefault();
|
|
6112
6205
|
const rect_x = e.offsetX, rect_y = e.offsetY, x = rect_x + rect.startX, y = rect_y + rect.startY;
|
|
@@ -6121,39 +6214,116 @@
|
|
|
6121
6214
|
i > -1 ? labels.value.splice(i, 1, activate_add_label.value) : labels.value.push(activate_add_label.value),
|
|
6122
6215
|
onCloseContentmenuLabel();
|
|
6123
6216
|
const {rects: rects, label_txt: label_txt} = formatLabelsType();
|
|
6124
|
-
_emit("change", rects, label_txt);
|
|
6217
|
+
_emit("change", rects, label_txt), emit("change", rects, label_txt);
|
|
6125
6218
|
}, onDeleteLabel = rect => {
|
|
6126
6219
|
const i = labels.value.findIndex((o => isEqual(o, rect)));
|
|
6127
6220
|
labels.value.splice(i, 1), onCloseContentmenuLabel(), onCloseDraggableRectFixed(),
|
|
6128
6221
|
drawBaseCanvas.value.updateLabels();
|
|
6129
6222
|
const {rects: rects, label_txt: label_txt} = formatLabelsType();
|
|
6130
|
-
_emit("change", rects, label_txt);
|
|
6223
|
+
_emit("change", rects, label_txt), emit("change", rects, label_txt);
|
|
6131
6224
|
};
|
|
6132
|
-
|
|
6133
|
-
|
|
6134
|
-
|
|
6135
|
-
|
|
6136
|
-
|
|
6137
|
-
|
|
6138
|
-
|
|
6139
|
-
|
|
6140
|
-
|
|
6141
|
-
|
|
6142
|
-
|
|
6143
|
-
|
|
6144
|
-
|
|
6145
|
-
|
|
6146
|
-
|
|
6147
|
-
|
|
6148
|
-
|
|
6149
|
-
|
|
6150
|
-
|
|
6151
|
-
|
|
6152
|
-
|
|
6153
|
-
|
|
6225
|
+
expose({
|
|
6226
|
+
onCloseDraggableRectFixed: onCloseDraggableRectFixed,
|
|
6227
|
+
onCloseContentmenuLabel: onCloseContentmenuLabel,
|
|
6228
|
+
onSelectedLabel: (rect, index) => {
|
|
6229
|
+
onCloseDraggableRectFixed(), vue.nextTick((() => {
|
|
6230
|
+
const {startX: x, startY: y, type: type} = rect;
|
|
6231
|
+
updateDraggableRectFixed(x, y, rect, index, colors[type]);
|
|
6232
|
+
}));
|
|
6233
|
+
},
|
|
6234
|
+
onDeleteLabel: onDeleteLabel
|
|
6235
|
+
});
|
|
6236
|
+
return () => vue.createVNode(vue.Fragment, null, [ vue.createVNode(NextSpinLoading, {
|
|
6237
|
+
loading: loadingImage.value,
|
|
6238
|
+
class: [ ns.b("loading") ]
|
|
6239
|
+
}, {
|
|
6240
|
+
default: () => [ vue.createVNode("div", {
|
|
6241
|
+
ref: canvasMainRef,
|
|
6242
|
+
class: [ ns.b("canvas") ]
|
|
6243
|
+
}, [ vue.createVNode("canvas", {
|
|
6244
|
+
ref: canvasBaseRef,
|
|
6245
|
+
class: [ ns.be("canvas", "context") ]
|
|
6246
|
+
}, null), vue.createVNode("canvas", {
|
|
6247
|
+
ref: canvasRectRef,
|
|
6248
|
+
class: [ ns.be("canvas", "rect") ]
|
|
6249
|
+
}, null), contextmenuLabelFixed.value.show ? vue.createVNode(ContextMenuLabel, {
|
|
6250
|
+
labelRect: contextmenuLabelRect.value,
|
|
6251
|
+
classes: props.classes,
|
|
6252
|
+
activateRect: contextmenuLabelFixed.value.activateRect,
|
|
6253
|
+
onClose: onCloseContentmenuLabel,
|
|
6254
|
+
onSelect: onSelectLabel,
|
|
6255
|
+
onDelete: onDeleteLabel
|
|
6256
|
+
}, null) : null, draggableRectFixed.value.show ? vue.createVNode(DraggableRect, {
|
|
6257
|
+
parentEl: canvasMainRef.value,
|
|
6258
|
+
rect: draggableRectFixed.value.activateRect,
|
|
6259
|
+
color: draggableRectFixed.value.color,
|
|
6260
|
+
onDraggleResize: onDraggleRectResize,
|
|
6261
|
+
onContextmenu: onContextmenuDraggable
|
|
6262
|
+
}, null) : null ]) ]
|
|
6263
|
+
}) ]);
|
|
6154
6264
|
}
|
|
6155
|
-
})
|
|
6156
|
-
|
|
6265
|
+
}), RightLabel = vue.defineComponent({
|
|
6266
|
+
props: {
|
|
6267
|
+
classes: {
|
|
6268
|
+
type: Array,
|
|
6269
|
+
default: () => []
|
|
6270
|
+
},
|
|
6271
|
+
labels: {
|
|
6272
|
+
type: Array,
|
|
6273
|
+
default: () => []
|
|
6274
|
+
}
|
|
6275
|
+
},
|
|
6276
|
+
emits: [ "delete", "select" ],
|
|
6277
|
+
setup(props, {emit: emit}) {
|
|
6278
|
+
const {t: t} = useLocale(), ns = vue.inject("ns", {}), labels = vue.ref([]);
|
|
6279
|
+
vue.watch((() => props.labels), (rects => {
|
|
6280
|
+
const _rects = vue.toRaw(rects);
|
|
6281
|
+
labels.value = (labels => labels.length ? labels.map((rect => {
|
|
6282
|
+
const typeName = props.classes[rect.type];
|
|
6283
|
+
return typeName && (rect.typeName = typeName), rect;
|
|
6284
|
+
})) : [])(_rects);
|
|
6285
|
+
}), {
|
|
6286
|
+
deep: !0,
|
|
6287
|
+
immediate: !0
|
|
6288
|
+
});
|
|
6289
|
+
const renderContent = () => vue.createVNode("div", {
|
|
6290
|
+
class: [ ns.b("right") ]
|
|
6291
|
+
}, [ labels.value.length ? vue.createVNode("ul", null, [ labels.value.map(((rect, index) => vue.createVNode("li", {
|
|
6292
|
+
key: index,
|
|
6293
|
+
onClick: () => ((rect, index) => {
|
|
6294
|
+
emit("select", rect, index);
|
|
6295
|
+
})(rect, index)
|
|
6296
|
+
}, [ vue.createVNode("div", null, [ vue.createVNode("span", {
|
|
6297
|
+
style: {
|
|
6298
|
+
"background-color": colors[rect.type]
|
|
6299
|
+
},
|
|
6300
|
+
class: "label-line"
|
|
6301
|
+
}, null), vue.createVNode("span", null, [ rect.typeName ]) ]), vue.createVNode(elementPlus.ElPopconfirm, {
|
|
6302
|
+
title: t("next.labelimg.confirmDeleteLabel"),
|
|
6303
|
+
width: 180,
|
|
6304
|
+
onConfirm: () => (rect => {
|
|
6305
|
+
emit("delete", rect);
|
|
6306
|
+
})(rect)
|
|
6307
|
+
}, {
|
|
6308
|
+
reference: () => vue.createVNode(elementPlus.ElIcon, {
|
|
6309
|
+
size: 16,
|
|
6310
|
+
color: "#ff0000",
|
|
6311
|
+
onClick: event => {
|
|
6312
|
+
event.preventDefault(), event.stopPropagation();
|
|
6313
|
+
}
|
|
6314
|
+
}, {
|
|
6315
|
+
default: () => [ vue.createVNode(delete_default, null, null) ]
|
|
6316
|
+
})
|
|
6317
|
+
}) ]))) ]) : vue.createVNode(elementPlus.ElEmpty, {
|
|
6318
|
+
"image-size": 120,
|
|
6319
|
+
description: t("next.labelimg.emptyLabelText")
|
|
6320
|
+
}, null) ]);
|
|
6321
|
+
return () => vue.createVNode(vue.Fragment, null, [ renderContent() ]);
|
|
6322
|
+
}
|
|
6323
|
+
}), defaultConfig = {
|
|
6324
|
+
mainContentHeight: 600
|
|
6325
|
+
};
|
|
6326
|
+
const ns$1 = useNamespace("labelimg");
|
|
6157
6327
|
var Element = vue.defineComponent({
|
|
6158
6328
|
name: "NextLabelimg",
|
|
6159
6329
|
props: {
|
|
@@ -6163,25 +6333,58 @@
|
|
|
6163
6333
|
},
|
|
6164
6334
|
style: {
|
|
6165
6335
|
type: Object,
|
|
6166
|
-
default: () => ({
|
|
6336
|
+
default: () => ({
|
|
6337
|
+
position: "unset"
|
|
6338
|
+
})
|
|
6339
|
+
},
|
|
6340
|
+
rowKey: {
|
|
6341
|
+
type: String,
|
|
6342
|
+
default: "id"
|
|
6167
6343
|
},
|
|
6168
6344
|
options: {
|
|
6169
6345
|
type: Object,
|
|
6170
|
-
default: () => ({
|
|
6171
|
-
|
|
6172
|
-
|
|
6173
|
-
|
|
6346
|
+
default: () => ({})
|
|
6347
|
+
},
|
|
6348
|
+
classes: {
|
|
6349
|
+
type: Array,
|
|
6350
|
+
default: () => []
|
|
6351
|
+
},
|
|
6352
|
+
data: {
|
|
6353
|
+
type: Array,
|
|
6354
|
+
default: () => []
|
|
6174
6355
|
}
|
|
6175
6356
|
},
|
|
6176
6357
|
emits: [ "change", "save", "prev-click", "next-click" ],
|
|
6177
6358
|
setup(props, {emit: emit, slots: slots, expose: expose}) {
|
|
6178
|
-
const {t: t} = useLocale()
|
|
6179
|
-
|
|
6180
|
-
|
|
6181
|
-
|
|
6182
|
-
|
|
6183
|
-
|
|
6184
|
-
|
|
6359
|
+
const {t: t} = useLocale(), _config = deepClone(defaultConfig), _options = vue.computed((() => {
|
|
6360
|
+
const cfg = vue.unref(props.options);
|
|
6361
|
+
return merge$1(_config, cfg);
|
|
6362
|
+
})), options = vue.unref(_options);
|
|
6363
|
+
vue.provide("ns", ns$1), vue.provide("_emit", emit);
|
|
6364
|
+
const activateNodeIndex = vue.ref(0), classes = vue.ref(props.classes), labelImages = vue.ref(deepClone(props.data));
|
|
6365
|
+
vue.watch((() => props.data), (data => {
|
|
6366
|
+
labelImages.value = deepClone(data);
|
|
6367
|
+
}), {
|
|
6368
|
+
deep: !0
|
|
6369
|
+
}), vue.watch((() => props.data.length), (() => {
|
|
6370
|
+
activateNodeIndex.value = 0;
|
|
6371
|
+
})), vue.watch((() => props.classes), (val => {
|
|
6372
|
+
classes.value = val;
|
|
6373
|
+
}), {
|
|
6374
|
+
deep: !0
|
|
6375
|
+
});
|
|
6376
|
+
const currentNode = vue.computed((() => {
|
|
6377
|
+
if (!labelImages.value) return {};
|
|
6378
|
+
const node = labelImages.value[activateNodeIndex.value] || {};
|
|
6379
|
+
return deepClone(node);
|
|
6380
|
+
})), activateNodeLabels = vue.ref(currentNode.value.labels || []);
|
|
6381
|
+
vue.watch((() => currentNode.value), (() => {
|
|
6382
|
+
activateNodeLabels.value = currentNode.value.labels || [];
|
|
6383
|
+
}));
|
|
6384
|
+
const onChangeNodeRect = rects => {
|
|
6385
|
+
currentNode.value.labels = rects, activateNodeLabels.value = rects;
|
|
6386
|
+
}, loading = vue.ref(!1), formatNodeLabels = () => {
|
|
6387
|
+
const node = currentNode.value;
|
|
6185
6388
|
let yolo_label = [];
|
|
6186
6389
|
return node.labels.forEach((rect => {
|
|
6187
6390
|
delete rect.typeName;
|
|
@@ -6191,89 +6394,123 @@
|
|
|
6191
6394
|
node: node,
|
|
6192
6395
|
label_txt: yolo_label.join("\n")
|
|
6193
6396
|
};
|
|
6397
|
+
}, isChangeNodeLabels = () => isEqual(labelImages.value[activateNodeIndex.value].labels, currentNode.value.labels), switchKeydownAD = e => {
|
|
6398
|
+
const imageLength = labelImages.value.length;
|
|
6399
|
+
"KeyD" === e.code ? (activateNodeIndex.value++, activateNodeIndex.value >= imageLength && (activateNodeIndex.value = 0)) : "KeyA" === e.code && (activateNodeIndex.value--,
|
|
6400
|
+
activateNodeIndex.value < 0 && (activateNodeIndex.value = imageLength - 1));
|
|
6194
6401
|
}, onKeydownPrevNext = e => {
|
|
6195
6402
|
if (loading.value) return;
|
|
6196
6403
|
if (![ "KeyA", "KeyD" ].includes(e.code)) return;
|
|
6197
6404
|
loading.value = !0;
|
|
6198
6405
|
const {node: node, label_txt: label_txt} = formatNodeLabels();
|
|
6406
|
+
if (canvasContextRef.value.onCloseDraggableRectFixed(), isChangeNodeLabels()) return switchKeydownAD(e),
|
|
6407
|
+
void (loading.value = !1);
|
|
6199
6408
|
emit("save", {
|
|
6200
6409
|
node: node,
|
|
6201
6410
|
label_txt: label_txt
|
|
6202
|
-
}, (
|
|
6203
|
-
|
|
6204
|
-
|
|
6411
|
+
}, (imageItem => {
|
|
6412
|
+
labelImages.value[activateNodeIndex.value] = imageItem || node, switchKeydownAD(e),
|
|
6413
|
+
loading.value = !1;
|
|
6414
|
+
}), (() => {
|
|
6415
|
+
loading.value = !1;
|
|
6416
|
+
}));
|
|
6417
|
+
}, onChangeActivateNode = index => {
|
|
6418
|
+
if (loading.value) return;
|
|
6419
|
+
loading.value = !0;
|
|
6420
|
+
const {node: node, label_txt: label_txt} = formatNodeLabels();
|
|
6421
|
+
if (canvasContextRef.value.onCloseDraggableRectFixed(), isChangeNodeLabels()) return activateNodeIndex.value = index,
|
|
6422
|
+
void (loading.value = !1);
|
|
6423
|
+
emit("save", {
|
|
6424
|
+
node: node,
|
|
6425
|
+
label_txt: label_txt
|
|
6426
|
+
}, (imageItem => {
|
|
6427
|
+
labelImages.value[activateNodeIndex.value] = imageItem || node, activateNodeIndex.value = index,
|
|
6428
|
+
loading.value = !1;
|
|
6205
6429
|
}), (() => {
|
|
6206
6430
|
loading.value = !1;
|
|
6207
6431
|
}));
|
|
6208
6432
|
}, onPaginationPrev = () => {
|
|
6209
|
-
|
|
6433
|
+
const imageLength = labelImages.value.length;
|
|
6434
|
+
let i = activateNodeIndex.value - 1;
|
|
6435
|
+
i < 0 && (i = imageLength - 1), onChangeActivateNode(i), emit("prev-click");
|
|
6210
6436
|
}, onPaginationNext = () => {
|
|
6211
|
-
|
|
6212
|
-
|
|
6437
|
+
const imageLength = labelImages.value.length;
|
|
6438
|
+
let i = activateNodeIndex.value + 1;
|
|
6439
|
+
i >= imageLength && (i = 0), onChangeActivateNode(i), emit("next-click");
|
|
6440
|
+
}, canvasContextRef = vue.ref(), layoutLabelRef = vue.ref(), headerRef = vue.ref(), mainRef = vue.ref(), footerRef = vue.ref(), mainContentHeight = vue.ref(options.mainContentHeight);
|
|
6213
6441
|
vue.onMounted((() => {
|
|
6214
|
-
document.addEventListener("keydown", onKeydownPrevNext), elementResize(
|
|
6442
|
+
document.addEventListener("keydown", onKeydownPrevNext), elementResize(layoutLabelRef.value, (() => {
|
|
6215
6443
|
vue.nextTick((() => {
|
|
6216
|
-
|
|
6444
|
+
layoutLabelRef.value.style.position = "unset";
|
|
6445
|
+
const contentHeight = (layoutLabelRef.value?.clientHeight || 0) - ((headerRef.value?.clientHeight || 0) + (footerRef.value?.clientHeight || 0));
|
|
6217
6446
|
mainContentHeight.value = contentHeight;
|
|
6218
6447
|
}));
|
|
6219
6448
|
}));
|
|
6220
6449
|
})), vue.onUnmounted((() => {
|
|
6221
6450
|
document.removeEventListener("keydown", onKeydownPrevNext);
|
|
6222
|
-
}))
|
|
6451
|
+
}));
|
|
6452
|
+
const onSelectLabelNode = (rect, index) => {
|
|
6453
|
+
canvasContextRef.value.onSelectedLabel(rect, index);
|
|
6454
|
+
}, onDeleteLabelNode = rect => {
|
|
6455
|
+
canvasContextRef.value.onDeleteLabel(rect);
|
|
6456
|
+
};
|
|
6457
|
+
expose({
|
|
6223
6458
|
convertToLabel: convertToLabel,
|
|
6224
6459
|
canvertToCanvas: canvertToCanvas
|
|
6225
6460
|
});
|
|
6226
|
-
|
|
6227
|
-
ref:
|
|
6228
|
-
class: [ ns.b(), props.className ],
|
|
6461
|
+
return () => vue.createVNode(vue.Fragment, null, [ vue.createVNode("div", {
|
|
6462
|
+
ref: layoutLabelRef,
|
|
6463
|
+
class: [ ns$1.b(), props.className ],
|
|
6229
6464
|
style: {
|
|
6230
6465
|
...props.style
|
|
6231
6466
|
}
|
|
6232
6467
|
}, [ vue.createVNode(NextSpinLoading$1, {
|
|
6233
6468
|
loading: loading.value,
|
|
6234
6469
|
tip: t("next.labelimg.saveTxt"),
|
|
6235
|
-
class: [ ns.b("loading") ]
|
|
6470
|
+
class: [ ns$1.b("loading") ]
|
|
6236
6471
|
}, {
|
|
6237
6472
|
default: () => [ vue.createVNode(elementPlus.ElScrollbar, null, {
|
|
6238
6473
|
default: () => [ vue.createVNode("header", {
|
|
6239
6474
|
ref: headerRef,
|
|
6240
|
-
class: [ ns.b("header") ]
|
|
6475
|
+
class: [ ns$1.b("header") ]
|
|
6241
6476
|
}, [ slots.header ? slots.header() : vue.createVNode(vue.Fragment, null, [ vue.createVNode("ul", null, null), vue.createVNode("ul", null, null) ]) ]), vue.createVNode("div", {
|
|
6242
6477
|
ref: mainRef,
|
|
6243
|
-
class: [ ns.b("main") ]
|
|
6478
|
+
class: [ ns$1.b("main") ],
|
|
6479
|
+
style: {
|
|
6480
|
+
height: mainContentHeight.value + "px"
|
|
6481
|
+
}
|
|
6482
|
+
}, [ vue.createVNode("div", {
|
|
6483
|
+
class: [ ns$1.be("main", "content") ]
|
|
6244
6484
|
}, [ vue.createVNode(CanvasContext, {
|
|
6245
|
-
|
|
6246
|
-
|
|
6485
|
+
ref: canvasContextRef,
|
|
6486
|
+
contextClientHeight: mainContentHeight.value,
|
|
6487
|
+
classes: classes.value,
|
|
6488
|
+
rowInfo: currentNode.value,
|
|
6489
|
+
onChange: onChangeNodeRect
|
|
6490
|
+
}, null) ]), vue.createVNode(RightLabel, {
|
|
6491
|
+
classes: classes.value,
|
|
6492
|
+
labels: activateNodeLabels.value,
|
|
6493
|
+
onDelete: onDeleteLabelNode,
|
|
6494
|
+
onSelect: onSelectLabelNode
|
|
6247
6495
|
}, null) ]), vue.createVNode("footer", {
|
|
6248
6496
|
ref: footerRef,
|
|
6249
|
-
class: [ ns.b("footer") ]
|
|
6497
|
+
class: [ ns$1.b("footer") ]
|
|
6250
6498
|
}, [ vue.createVNode("div", {
|
|
6251
|
-
class: [ ns.be("footer", "left") ]
|
|
6499
|
+
class: [ ns$1.be("footer", "left") ]
|
|
6252
6500
|
}, [ vue.createVNode(elementPlus.ElIcon, {
|
|
6253
6501
|
size: 24,
|
|
6502
|
+
color: "#797979",
|
|
6254
6503
|
onClick: onPaginationPrev
|
|
6255
6504
|
}, {
|
|
6256
6505
|
default: () => [ vue.createVNode(arrow_left_default, null, null) ]
|
|
6257
6506
|
}) ]), vue.createVNode("div", {
|
|
6258
|
-
class: [ ns.be("footer", "center") ]
|
|
6507
|
+
class: [ ns$1.be("footer", "center") ]
|
|
6259
6508
|
}, [ vue.createVNode(elementPlus.ElScrollbar, null, {
|
|
6260
6509
|
default: () => [ vue.createVNode("ul", {
|
|
6261
|
-
class: [ ns.bem("footer", "center", "list") ]
|
|
6262
|
-
}, [
|
|
6510
|
+
class: [ ns$1.bem("footer", "center", "list") ]
|
|
6511
|
+
}, [ labelImages.value.map(((item, index) => vue.createVNode("li", {
|
|
6263
6512
|
key: index,
|
|
6264
|
-
onClick: () => (index
|
|
6265
|
-
if (loading.value) return;
|
|
6266
|
-
loading.value = !0;
|
|
6267
|
-
const {node: node, label_txt: label_txt} = formatNodeLabels();
|
|
6268
|
-
emit("save", {
|
|
6269
|
-
node: node,
|
|
6270
|
-
label_txt: label_txt
|
|
6271
|
-
}, (() => {
|
|
6272
|
-
activateNodeIndex.value = index, loading.value = !1;
|
|
6273
|
-
}), (() => {
|
|
6274
|
-
loading.value = !1;
|
|
6275
|
-
}));
|
|
6276
|
-
})(index),
|
|
6513
|
+
onClick: () => onChangeActivateNode(index),
|
|
6277
6514
|
class: {
|
|
6278
6515
|
"is-activate": activateNodeIndex.value === index
|
|
6279
6516
|
}
|
|
@@ -6286,19 +6523,87 @@
|
|
|
6286
6523
|
fit: "cover"
|
|
6287
6524
|
}, null) ]))) ]) ]
|
|
6288
6525
|
}) ]), vue.createVNode("div", {
|
|
6289
|
-
class: [ ns.be("footer", "right") ]
|
|
6526
|
+
class: [ ns$1.be("footer", "right") ]
|
|
6290
6527
|
}, [ vue.createVNode(elementPlus.ElIcon, {
|
|
6291
6528
|
size: 24,
|
|
6529
|
+
color: "#797979",
|
|
6292
6530
|
onClick: onPaginationNext
|
|
6293
6531
|
}, {
|
|
6294
6532
|
default: () => [ vue.createVNode(arrow_right_default, null, null) ]
|
|
6295
6533
|
}) ]) ]) ]
|
|
6296
6534
|
}) ]
|
|
6297
|
-
}) ]);
|
|
6298
|
-
|
|
6535
|
+
}) ]) ]);
|
|
6536
|
+
}
|
|
6537
|
+
});
|
|
6538
|
+
const ns = useNamespace("labelimg-preview");
|
|
6539
|
+
var preview = vue.defineComponent({
|
|
6540
|
+
name: "NextLabelimgPreview",
|
|
6541
|
+
props: {
|
|
6542
|
+
className: {
|
|
6543
|
+
type: String,
|
|
6544
|
+
default: ""
|
|
6545
|
+
},
|
|
6546
|
+
style: {
|
|
6547
|
+
type: Object,
|
|
6548
|
+
default: () => ({})
|
|
6549
|
+
},
|
|
6550
|
+
src: {
|
|
6551
|
+
type: String,
|
|
6552
|
+
default: ""
|
|
6553
|
+
},
|
|
6554
|
+
classes: {
|
|
6555
|
+
type: Array,
|
|
6556
|
+
default: () => []
|
|
6557
|
+
},
|
|
6558
|
+
labels: {
|
|
6559
|
+
type: Array,
|
|
6560
|
+
default: () => []
|
|
6561
|
+
}
|
|
6562
|
+
},
|
|
6563
|
+
setup(props) {
|
|
6564
|
+
const canvasBaseRef = vue.ref(), classes = vue.ref(deepClone(props.classes)), labels = vue.ref(deepClone(props.labels)), renderImageAndLabel = () => {
|
|
6565
|
+
if (props.src) {
|
|
6566
|
+
const ctx = canvasBaseRef.value?.getContext("2d"), image = new Image;
|
|
6567
|
+
image.src = props.src, image.onload = () => {
|
|
6568
|
+
const {width: width, height: height} = image, canvasHeight = height, scaleFactor = canvasHeight / height, canvasWidth = Math.ceil(width * scaleFactor);
|
|
6569
|
+
((canvasWidth, canvasHeight) => {
|
|
6570
|
+
canvasBaseRef.value.width = canvasWidth, canvasBaseRef.value.height = canvasHeight,
|
|
6571
|
+
canvasBaseRef.value.style.width = canvasWidth + "px", canvasBaseRef.value.style.height = canvasHeight + "px";
|
|
6572
|
+
})(canvasWidth, canvasHeight), ctx.clearRect(0, 0, canvasWidth, canvasHeight), ctx.drawImage(image, 0, 0, canvasWidth, canvasHeight);
|
|
6573
|
+
for (let i = 0; i < labels.value.length; i++) {
|
|
6574
|
+
const rect = labels.value[i], {startX: startX, startY: startY, rectWidth: rectWidth, rectHeight: rectHeight, type: type} = rect, color = colors[type % colors.length];
|
|
6575
|
+
if (ctx.font = "bold 14px serif", ctx.textBaseline = "top", ctx.save(), ctx.strokeStyle = color,
|
|
6576
|
+
ctx.strokeRect(startX, startY, rectWidth, rectHeight), !isValueExist(rect.typeName)) {
|
|
6577
|
+
const typeName = classes.value[rect.type];
|
|
6578
|
+
typeName && (rect.typeName = typeName);
|
|
6579
|
+
}
|
|
6580
|
+
if (isValueExist(rect.typeName) || isValueExist(rect.type)) {
|
|
6581
|
+
const text = rect.typeName || rect.type;
|
|
6582
|
+
ctx.fillStyle = color, ctx.fillText(text, startX + 6, startY + 6);
|
|
6583
|
+
}
|
|
6584
|
+
ctx.restore();
|
|
6585
|
+
}
|
|
6586
|
+
};
|
|
6587
|
+
}
|
|
6588
|
+
};
|
|
6589
|
+
vue.onMounted((() => {
|
|
6590
|
+
vue.watch((() => props.src), (() => {
|
|
6591
|
+
renderImageAndLabel();
|
|
6592
|
+
}), {
|
|
6593
|
+
immediate: !0
|
|
6594
|
+
});
|
|
6595
|
+
}));
|
|
6596
|
+
return () => vue.createVNode(vue.Fragment, null, [ vue.createVNode("div", {
|
|
6597
|
+
class: [ ns.b(), props.className ],
|
|
6598
|
+
style: {
|
|
6599
|
+
...props.style
|
|
6600
|
+
}
|
|
6601
|
+
}, [ vue.createVNode("canvas", {
|
|
6602
|
+
ref: canvasBaseRef
|
|
6603
|
+
}, null) ]) ]);
|
|
6299
6604
|
}
|
|
6300
6605
|
});
|
|
6301
|
-
const NextLabelimg = withInstall(Element);
|
|
6606
|
+
const NextLabelimg = withInstall(Element), NextLabelimgPreview = withInstall(preview);
|
|
6302
6607
|
var components = Object.freeze({
|
|
6303
6608
|
__proto__: null,
|
|
6304
6609
|
NextContainer: NextContainer,
|
|
@@ -6308,6 +6613,7 @@
|
|
|
6308
6613
|
NextDragResize: NextDragResize,
|
|
6309
6614
|
NextForm: NextForm,
|
|
6310
6615
|
NextLabelimg: NextLabelimg,
|
|
6616
|
+
NextLabelimgPreview: NextLabelimgPreview,
|
|
6311
6617
|
NextLayout: NextLayout,
|
|
6312
6618
|
NextMenu: NextMenu,
|
|
6313
6619
|
NextSpinLoading: NextSpinLoading,
|
|
@@ -6358,19 +6664,19 @@
|
|
|
6358
6664
|
})(app);
|
|
6359
6665
|
};
|
|
6360
6666
|
var index = {
|
|
6361
|
-
version: "0.
|
|
6667
|
+
version: "0.3.0",
|
|
6362
6668
|
install: install
|
|
6363
6669
|
};
|
|
6364
6670
|
exports.NextContainer = NextContainer, exports.NextCrudTable = NextCrudTable, exports.NextCrudTableVirtualized = NextCrudTableVirtualized,
|
|
6365
6671
|
exports.NextDialog = NextDialog, exports.NextDragResize = NextDragResize, exports.NextForm = NextForm,
|
|
6366
|
-
exports.NextLabelimg = NextLabelimg, exports.
|
|
6367
|
-
exports.
|
|
6368
|
-
exports.
|
|
6369
|
-
exports.
|
|
6370
|
-
exports.
|
|
6371
|
-
exports.
|
|
6372
|
-
exports.
|
|
6373
|
-
exports.translate = translate, exports.updateThemeColor = color => {
|
|
6672
|
+
exports.NextLabelimg = NextLabelimg, exports.NextLabelimgPreview = NextLabelimgPreview,
|
|
6673
|
+
exports.NextLayout = NextLayout, exports.NextMenu = NextMenu, exports.NextSpinLoading = NextSpinLoading,
|
|
6674
|
+
exports.NextTabs = NextTabs, exports.NextTextEllipsis = NextTextEllipsis, exports.NextTreeSelect = NextTreeSelect,
|
|
6675
|
+
exports.NextUpload = NextUpload, exports.NextVideoPlayer = NextVideoPlayer, exports.buildLocaleContext = buildLocaleContext,
|
|
6676
|
+
exports.buildTranslator = buildTranslator, exports.default = index, exports.defaultNamespace = "next",
|
|
6677
|
+
exports.install = install, exports.localeContextKey = localeContextKey, exports.localeLang = localeLang,
|
|
6678
|
+
exports.namespaceContextKey = namespaceContextKey, exports.nextUseCssTheme = nextUseCssTheme,
|
|
6679
|
+
exports.nextUseCssVar = nextUseCssVar, exports.translate = translate, exports.updateThemeColor = color => {
|
|
6374
6680
|
color && nextUseCssTheme("--el-color-primary", color);
|
|
6375
6681
|
}, exports.updateThemeColorCssVar = updateThemeColorCssVar, exports.useDetectVideo = () => ({
|
|
6376
6682
|
detectVideoFrameImage: ({container: container, video: video, modelUrl: modelUrl, classNames: classNames, classInput: classInput = []}, success, error) => modelUrl ? classNames ? void tf__namespace.loadGraphModel(modelUrl).then((model => {
|
|
@@ -6404,7 +6710,7 @@
|
|
|
6404
6710
|
}), exports.useGetDerivedNamespace = useGetDerivedNamespace, exports.useLanguage = (locale, lang) => {
|
|
6405
6711
|
const localeRef = vue.isRef(locale) ? locale : vue.ref(locale), nextLang = localeLang[lang] || localeLang["zh-cn"];
|
|
6406
6712
|
localeRef.value.name = lang, localeRef.value.next = nextLang.next;
|
|
6407
|
-
}, exports.useLocale = useLocale, exports.useNamespace = useNamespace, exports.version = "0.
|
|
6713
|
+
}, exports.useLocale = useLocale, exports.useNamespace = useNamespace, exports.version = "0.3.0",
|
|
6408
6714
|
Object.defineProperty(exports, "__esModule", {
|
|
6409
6715
|
value: !0
|
|
6410
6716
|
});
|