next-element-vue 0.3.2 → 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 +2 -1
- package/dist/index.js +568 -143
- package/dist/index.min.js +3 -3
- package/dist/index.umd.js +570 -149
- package/dist/index.umd.min.js +3 -3
- 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/index.d.ts +0 -9
- 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/utils/theme.d.ts +1 -0
- package/package.json +1 -1
package/dist/index.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
|
|
|
@@ -566,9 +566,9 @@ function getAllKeys(object) {
|
|
|
566
566
|
}(object, keys, getSymbols$1);
|
|
567
567
|
}
|
|
568
568
|
|
|
569
|
-
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;
|
|
569
|
+
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;
|
|
570
570
|
|
|
571
|
-
(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) {
|
|
571
|
+
(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) {
|
|
572
572
|
var result = baseGetTag(value), Ctor = "[object Object]" == result ? value.constructor : void 0, ctorString = Ctor ? toSource(Ctor) : "";
|
|
573
573
|
if (ctorString) switch (ctorString) {
|
|
574
574
|
case dataViewCtorString:
|
|
@@ -1090,6 +1090,13 @@ function useChangeColor() {
|
|
|
1090
1090
|
for (let i = 0; i < 3; i++) hexs[i] = parseInt(hexs[i], 16);
|
|
1091
1091
|
return hexs;
|
|
1092
1092
|
},
|
|
1093
|
+
hexToRgba: (str, alpha = 1) => {
|
|
1094
|
+
let hexs = "";
|
|
1095
|
+
if (!/^\#?[0-9A-Fa-f]{6}$/.test(str)) return ElMessage.warning("输入错误的hex"), "";
|
|
1096
|
+
hexs = (str = str.replace("#", "")).match(/../g);
|
|
1097
|
+
for (let i = 0; i < 3; i++) hexs[i] = parseInt(hexs[i], 16);
|
|
1098
|
+
return `rgba(${hexs.join(",")},${alpha})`;
|
|
1099
|
+
},
|
|
1093
1100
|
rgbToHex: (r, g, b) => {
|
|
1094
1101
|
let reg = /^\d{1,3}$/;
|
|
1095
1102
|
if (!reg.test(r) || !reg.test(g) || !reg.test(b)) return ElMessage.warning("输入错误的rgb颜色值"),
|
|
@@ -1217,7 +1224,7 @@ const {getLightColor: getLightColor$4} = useChangeColor(), nextUseCssVar = (cssv
|
|
|
1217
1224
|
return main;
|
|
1218
1225
|
}, slots_config_headerMenu = "header-menu", slots_config_headerToolsPrefix = "header-tools-prefix", slots_config_headerToolsSuffix = "header-tools-suffix";
|
|
1219
1226
|
|
|
1220
|
-
var defaultConfig$
|
|
1227
|
+
var defaultConfig$5 = {
|
|
1221
1228
|
logo: "",
|
|
1222
1229
|
title: "Next Element Vue",
|
|
1223
1230
|
userName: "Admin",
|
|
@@ -1265,7 +1272,7 @@ var defaultConfig$4 = {
|
|
|
1265
1272
|
}
|
|
1266
1273
|
};
|
|
1267
1274
|
|
|
1268
|
-
const ns$
|
|
1275
|
+
const ns$l = useNamespace("text-ellipsis");
|
|
1269
1276
|
|
|
1270
1277
|
const NextTextEllipsis = withInstall(defineComponent({
|
|
1271
1278
|
name: "NextTextEllipsis",
|
|
@@ -1312,7 +1319,7 @@ const NextTextEllipsis = withInstall(defineComponent({
|
|
|
1312
1319
|
}
|
|
1313
1320
|
};
|
|
1314
1321
|
return () => createVNode(Fragment, null, [ createVNode("div", {
|
|
1315
|
-
class: [ ns$
|
|
1322
|
+
class: [ ns$l.b(), props.class ],
|
|
1316
1323
|
style: setWidth.value,
|
|
1317
1324
|
onMouseenter: onMouseenter
|
|
1318
1325
|
}, [ isTip.value ? createVNode(ElTooltip, {
|
|
@@ -1322,11 +1329,11 @@ const NextTextEllipsis = withInstall(defineComponent({
|
|
|
1322
1329
|
disabled: props.disabled
|
|
1323
1330
|
}, {
|
|
1324
1331
|
default: () => [ createVNode("span", {
|
|
1325
|
-
class: ns$
|
|
1332
|
+
class: ns$l.e("text"),
|
|
1326
1333
|
ref: ellipsisRef
|
|
1327
1334
|
}, [ slots.default ? slots.default() : props.content ]) ]
|
|
1328
1335
|
}) : createVNode("span", {
|
|
1329
|
-
class: ns$
|
|
1336
|
+
class: ns$l.e("text"),
|
|
1330
1337
|
ref: ellipsisRef
|
|
1331
1338
|
}, [ slots.default ? slots.default() : props.content ]) ]) ]);
|
|
1332
1339
|
}
|
|
@@ -2710,7 +2717,7 @@ const NextMenuItem = defineComponent({
|
|
|
2710
2717
|
}, null) ]
|
|
2711
2718
|
}))) ]) ]);
|
|
2712
2719
|
}
|
|
2713
|
-
}), ns$
|
|
2720
|
+
}), ns$k = useNamespace("menu");
|
|
2714
2721
|
|
|
2715
2722
|
const NextMenu = withInstall(defineComponent({
|
|
2716
2723
|
name: "NextMenu",
|
|
@@ -2738,13 +2745,13 @@ const NextMenu = withInstall(defineComponent({
|
|
|
2738
2745
|
}
|
|
2739
2746
|
},
|
|
2740
2747
|
setup(props) {
|
|
2741
|
-
provide("ns", ns$
|
|
2748
|
+
provide("ns", ns$k);
|
|
2742
2749
|
const router = getCurrentInstance().appContext.config.globalProperties.$router, currentPath = router.currentRoute?.value.fullPath, activePath = ref(currentPath);
|
|
2743
2750
|
watch((() => router.currentRoute?.value), (to => {
|
|
2744
2751
|
activePath.value = to.fullPath;
|
|
2745
2752
|
}));
|
|
2746
2753
|
return () => createVNode(Fragment, null, [ createVNode(ElMenu, {
|
|
2747
|
-
class: [ ns$
|
|
2754
|
+
class: [ ns$k.b(), props.className ],
|
|
2748
2755
|
style: props.style,
|
|
2749
2756
|
defaultActive: activePath.value,
|
|
2750
2757
|
router: props.router,
|
|
@@ -2752,7 +2759,7 @@ const NextMenu = withInstall(defineComponent({
|
|
|
2752
2759
|
ellipsis: !0
|
|
2753
2760
|
}, {
|
|
2754
2761
|
default: () => [ createVNode(Fragment, null, [ props.menuTree.map((item => item.children?.length ? valueExist(item.meta?.isHide, !1) ? null : createVNode(ElSubMenu, {
|
|
2755
|
-
"popper-class": ns$
|
|
2762
|
+
"popper-class": ns$k.b("popper"),
|
|
2756
2763
|
index: item.path || item.id,
|
|
2757
2764
|
teleported: !0
|
|
2758
2765
|
}, {
|
|
@@ -2763,7 +2770,7 @@ const NextMenu = withInstall(defineComponent({
|
|
|
2763
2770
|
menuData: item.children
|
|
2764
2771
|
}, null)
|
|
2765
2772
|
}) : valueExist(item.meta?.isHide, !1) ? null : createVNode(ElMenuItem, {
|
|
2766
|
-
"popper-class": ns$
|
|
2773
|
+
"popper-class": ns$k.b("popper"),
|
|
2767
2774
|
index: item.path
|
|
2768
2775
|
}, {
|
|
2769
2776
|
default: () => [ createVNode(MenuItemTitle, {
|
|
@@ -2791,20 +2798,20 @@ var Sidebar$2 = defineComponent({
|
|
|
2791
2798
|
}
|
|
2792
2799
|
});
|
|
2793
2800
|
|
|
2794
|
-
const ns$
|
|
2801
|
+
const ns$j = useNamespace("layout-defaults");
|
|
2795
2802
|
|
|
2796
2803
|
var defaults = defineComponent({
|
|
2797
2804
|
props: {},
|
|
2798
|
-
setup: () => (provide("ns", ns$
|
|
2805
|
+
setup: () => (provide("ns", ns$j), {}),
|
|
2799
2806
|
render() {
|
|
2800
2807
|
const slots = this.$slots, _config = inject("options", {}), _emit = inject("__emit__", {});
|
|
2801
2808
|
slots.menu;
|
|
2802
2809
|
const isTabs = ref(!!slots.tabs);
|
|
2803
2810
|
return void 0 === slots.tabs && _config.showTabs && (isTabs.value = !0), createVNode(ElContainer, {
|
|
2804
|
-
class: ns$
|
|
2811
|
+
class: ns$j.b()
|
|
2805
2812
|
}, {
|
|
2806
2813
|
default: () => [ createVNode(Sidebar$2, null, null), createVNode("div", {
|
|
2807
|
-
class: [ ns$
|
|
2814
|
+
class: [ ns$j.b("content") ]
|
|
2808
2815
|
}, [ createVNode(Header$3, null, null), _config.showTabs ? slots.tabs ? slots.tabs?.() : createVNode(NextTabs, {
|
|
2809
2816
|
tabs: _config.tabs,
|
|
2810
2817
|
activeTab: _config.activeTab,
|
|
@@ -2812,7 +2819,7 @@ var defaults = defineComponent({
|
|
|
2812
2819
|
onSelect: (...arg) => _emit("tabsSelect", ...arg),
|
|
2813
2820
|
onClose: (...arg) => _emit("tabsClose", ...arg)
|
|
2814
2821
|
}, null) : null, createVNode("main", {
|
|
2815
|
-
class: [ ns$
|
|
2822
|
+
class: [ ns$j.bf("main"), ns$j.is("layout-tabs", isTabs.value) ]
|
|
2816
2823
|
}, [ slots.default?.() ]) ]) ]
|
|
2817
2824
|
});
|
|
2818
2825
|
}
|
|
@@ -2845,11 +2852,11 @@ var Header$2 = defineComponent({
|
|
|
2845
2852
|
}
|
|
2846
2853
|
});
|
|
2847
2854
|
|
|
2848
|
-
const ns$
|
|
2855
|
+
const ns$i = useNamespace("layout-transverse");
|
|
2849
2856
|
|
|
2850
2857
|
var transverse = defineComponent({
|
|
2851
2858
|
props: {},
|
|
2852
|
-
setup: () => (provide("ns", ns$
|
|
2859
|
+
setup: () => (provide("ns", ns$i), {}),
|
|
2853
2860
|
render() {
|
|
2854
2861
|
const slots = this.$slots, _config = inject("options", {}), _emit = inject("__emit__", {}), __slots_header = {};
|
|
2855
2862
|
slots[slots_config_headerMenu] && (__slots_header[slots_config_headerMenu] = () => slots[slots_config_headerMenu]()),
|
|
@@ -2866,7 +2873,7 @@ var transverse = defineComponent({
|
|
|
2866
2873
|
onSelect: (...arg) => _emit("tabsSelect", ...arg),
|
|
2867
2874
|
onClose: (...arg) => _emit("tabsClose", ...arg)
|
|
2868
2875
|
}, null) : null, createVNode("main", {
|
|
2869
|
-
class: [ ns$
|
|
2876
|
+
class: [ ns$i.b("main"), ns$i.is("layout-tabs", isTabs.value) ]
|
|
2870
2877
|
}, [ slots.default?.() ]) ]);
|
|
2871
2878
|
var s;
|
|
2872
2879
|
}
|
|
@@ -2908,11 +2915,11 @@ var Header$1 = defineComponent({
|
|
|
2908
2915
|
}
|
|
2909
2916
|
});
|
|
2910
2917
|
|
|
2911
|
-
const ns$
|
|
2918
|
+
const ns$h = useNamespace("layout-columns");
|
|
2912
2919
|
|
|
2913
2920
|
var columns = defineComponent({
|
|
2914
2921
|
props: {},
|
|
2915
|
-
setup: () => (provide("ns", ns$
|
|
2922
|
+
setup: () => (provide("ns", ns$h), {}),
|
|
2916
2923
|
render() {
|
|
2917
2924
|
const slots = this.$slots, _config = inject("options", {}), _emit = inject("__emit__", {}), __slots_header = {};
|
|
2918
2925
|
slots[slots_config_headerMenu] && (__slots_header[slots_config_headerMenu] = () => slots[slots_config_headerMenu]()),
|
|
@@ -2920,11 +2927,11 @@ var columns = defineComponent({
|
|
|
2920
2927
|
slots[slots_config_headerToolsSuffix] && (__slots_header[slots_config_headerToolsSuffix] = () => slots[slots_config_headerToolsSuffix]());
|
|
2921
2928
|
const isTabs = ref(!!slots.tabs);
|
|
2922
2929
|
return void 0 === slots.tabs && _config.showTabs && (isTabs.value = !0), createVNode(ElContainer, {
|
|
2923
|
-
class: ns$
|
|
2930
|
+
class: ns$h.b()
|
|
2924
2931
|
}, {
|
|
2925
2932
|
default: () => {
|
|
2926
2933
|
return [ createVNode(Sidebar$1, null, null), createVNode("div", {
|
|
2927
|
-
class: [ ns$
|
|
2934
|
+
class: [ ns$h.b("content") ]
|
|
2928
2935
|
}, [ createVNode(Header$1, null, (s = __slots_header, "function" == typeof s || "[object Object]" === Object.prototype.toString.call(s) && !isVNode(s) ? __slots_header : {
|
|
2929
2936
|
default: () => [ __slots_header ]
|
|
2930
2937
|
})), _config.showTabs ? slots.tabs ? slots.tabs?.() : createVNode(NextTabs, {
|
|
@@ -2934,7 +2941,7 @@ var columns = defineComponent({
|
|
|
2934
2941
|
onSelect: (...arg) => _emit("tabsSelect", ...arg),
|
|
2935
2942
|
onClose: (...arg) => _emit("tabsClose", ...arg)
|
|
2936
2943
|
}, null) : null, createVNode("main", {
|
|
2937
|
-
class: [ ns$
|
|
2944
|
+
class: [ ns$h.bf("main"), ns$h.is("layout-tabs", isTabs.value) ]
|
|
2938
2945
|
}, [ slots.default?.() ]) ]) ];
|
|
2939
2946
|
var s;
|
|
2940
2947
|
}
|
|
@@ -2980,21 +2987,21 @@ var Header = defineComponent({
|
|
|
2980
2987
|
}
|
|
2981
2988
|
});
|
|
2982
2989
|
|
|
2983
|
-
const ns$
|
|
2990
|
+
const ns$g = useNamespace("layout-classic");
|
|
2984
2991
|
|
|
2985
2992
|
var classic = defineComponent({
|
|
2986
2993
|
props: {},
|
|
2987
|
-
setup: () => (provide("ns", ns$
|
|
2988
|
-
ns: ns$
|
|
2994
|
+
setup: () => (provide("ns", ns$g), {
|
|
2995
|
+
ns: ns$g
|
|
2989
2996
|
}),
|
|
2990
2997
|
render() {
|
|
2991
2998
|
const slots = this.$slots, _config = inject("options", {}), _emit = inject("__emit__", {});
|
|
2992
2999
|
slots.menu;
|
|
2993
3000
|
const isTabs = ref(!!slots.tabs);
|
|
2994
3001
|
return void 0 === slots.tabs && _config.showTabs && (isTabs.value = !0), createVNode(Fragment, null, [ createVNode(Header, null, null), createVNode("div", {
|
|
2995
|
-
class: [ ns$
|
|
3002
|
+
class: [ ns$g.b("content"), ns$g.is("layout-tabs", isTabs.value) ]
|
|
2996
3003
|
}, [ createVNode(Sidebar, null, null), createVNode("div", {
|
|
2997
|
-
class: ns$
|
|
3004
|
+
class: ns$g.b("container")
|
|
2998
3005
|
}, [ _config.showTabs ? slots.tabs ? slots.tabs?.() : createVNode(NextTabs, {
|
|
2999
3006
|
tabs: _config.tabs,
|
|
3000
3007
|
activeTab: _config.activeTab,
|
|
@@ -3002,12 +3009,12 @@ var classic = defineComponent({
|
|
|
3002
3009
|
onSelect: (...arg) => _emit("tabsSelect", ...arg),
|
|
3003
3010
|
onClose: (...arg) => _emit("tabsClose", ...arg)
|
|
3004
3011
|
}, null) : null, createVNode("main", {
|
|
3005
|
-
class: [ ns$
|
|
3012
|
+
class: [ ns$g.b("main") ]
|
|
3006
3013
|
}, [ slots.default?.() ]) ]) ]) ]);
|
|
3007
3014
|
}
|
|
3008
3015
|
});
|
|
3009
3016
|
|
|
3010
|
-
const ns$
|
|
3017
|
+
const ns$f = useNamespace("layout"), layouts = {
|
|
3011
3018
|
defaults: markRaw(defaults),
|
|
3012
3019
|
transverse: markRaw(transverse),
|
|
3013
3020
|
columns: markRaw(columns),
|
|
@@ -3034,8 +3041,8 @@ const NextLayout = withInstall(defineComponent({
|
|
|
3034
3041
|
},
|
|
3035
3042
|
emits: [ "changeLanguage", "changeUserDropdown", "changeOptions", "tabsChange", "tabsSelect", "tabsClose" ],
|
|
3036
3043
|
setup(props, {slots: slots, emit: emit}) {
|
|
3037
|
-
const _config = ref(mergeWith(defaultConfig$
|
|
3038
|
-
provide("options", _config.value), provide("__ns__", ns$
|
|
3044
|
+
const _config = ref(mergeWith(defaultConfig$5, props.options, customizerCoverArray));
|
|
3045
|
+
provide("options", _config.value), provide("__ns__", ns$f), provide("__emit__", emit),
|
|
3039
3046
|
provide("__slots__", slots);
|
|
3040
3047
|
const updateOptions = cfg => {
|
|
3041
3048
|
_config.value = mergeWith(_config.value, cfg, customizerCoverArray), updateThemeColorCssVar(_config.value?.setting),
|
|
@@ -3059,15 +3066,15 @@ const NextLayout = withInstall(defineComponent({
|
|
|
3059
3066
|
const _activeSlots = {};
|
|
3060
3067
|
for (const key in slots) Object.prototype.hasOwnProperty.call(slots, key) && (_activeSlots[key] = () => slots[key]?.());
|
|
3061
3068
|
return createVNode("div", {
|
|
3062
|
-
class: [ ns$
|
|
3069
|
+
class: [ ns$f.b(), props.className ],
|
|
3063
3070
|
style: props.style
|
|
3064
3071
|
}, [ h(activeLayout.value, {}, {
|
|
3065
3072
|
..._activeSlots
|
|
3066
3073
|
}) ]);
|
|
3067
3074
|
}
|
|
3068
|
-
})), ns$
|
|
3075
|
+
})), ns$e = useNamespace("tabs");
|
|
3069
3076
|
|
|
3070
|
-
var Element$
|
|
3077
|
+
var Element$9 = defineComponent({
|
|
3071
3078
|
name: "NextTabs",
|
|
3072
3079
|
props: {
|
|
3073
3080
|
activeTab: {
|
|
@@ -3136,12 +3143,12 @@ var Element$8 = defineComponent({
|
|
|
3136
3143
|
tabsView.value.push(activeRoute)), emit("change", activeIndex.value, tabsView.value, "add");
|
|
3137
3144
|
}));
|
|
3138
3145
|
const renderContent = () => createVNode("nav", {
|
|
3139
|
-
class: ns$
|
|
3146
|
+
class: ns$e.b()
|
|
3140
3147
|
}, [ createVNode(ElScrollbar, null, {
|
|
3141
3148
|
default: () => [ createVNode("ul", {
|
|
3142
|
-
class: ns$
|
|
3149
|
+
class: ns$e.b("list")
|
|
3143
3150
|
}, [ tabsView.value.map(((tab, index) => tab ? createVNode("li", {
|
|
3144
|
-
class: [ "tab-item", ns$
|
|
3151
|
+
class: [ "tab-item", ns$e.is("active", activeIndex.value === index) ],
|
|
3145
3152
|
onClick: event => onClickTabItem(event, tab, index)
|
|
3146
3153
|
}, [ createVNode("i", {
|
|
3147
3154
|
class: [ "tab-icon", tab.meta?.icon ]
|
|
@@ -3172,11 +3179,11 @@ var Element$8 = defineComponent({
|
|
|
3172
3179
|
onCommand: onChange
|
|
3173
3180
|
}, {
|
|
3174
3181
|
default: () => createVNode("span", {
|
|
3175
|
-
class: ns$
|
|
3182
|
+
class: ns$e.b("tab-more")
|
|
3176
3183
|
}, [ createVNode("i", {
|
|
3177
|
-
class: [ ns$
|
|
3184
|
+
class: [ ns$e.be("tab-more", "box"), ns$e.be("tab-more", "top") ]
|
|
3178
3185
|
}, null), createVNode("i", {
|
|
3179
|
-
class: [ ns$
|
|
3186
|
+
class: [ ns$e.be("tab-more", "box"), ns$e.be("tab-more", "bottom") ]
|
|
3180
3187
|
}, null) ]),
|
|
3181
3188
|
dropdown: () => createVNode(ElDropdownMenu, null, {
|
|
3182
3189
|
default: () => [ createVNode(ElDropdownItem, {
|
|
@@ -3210,7 +3217,7 @@ var Element$8 = defineComponent({
|
|
|
3210
3217
|
}
|
|
3211
3218
|
});
|
|
3212
3219
|
|
|
3213
|
-
const NextTabs = withInstall(Element$
|
|
3220
|
+
const NextTabs = withInstall(Element$9), ns$d = useNamespace("container");
|
|
3214
3221
|
|
|
3215
3222
|
const NextContainer = withInstall(defineComponent({
|
|
3216
3223
|
name: "NextContainer",
|
|
@@ -3249,18 +3256,18 @@ const NextContainer = withInstall(defineComponent({
|
|
|
3249
3256
|
}), style;
|
|
3250
3257
|
}));
|
|
3251
3258
|
return () => props.scrollbar ? createVNode(ElScrollbar, {
|
|
3252
|
-
class: [ ns$
|
|
3259
|
+
class: [ ns$d.b(), props.className ],
|
|
3253
3260
|
style: props.style
|
|
3254
3261
|
}, {
|
|
3255
3262
|
default: () => [ slots.default?.() ]
|
|
3256
3263
|
}) : createVNode("div", {
|
|
3257
|
-
class: [ ns$
|
|
3264
|
+
class: [ ns$d.b(), props.className ],
|
|
3258
3265
|
style: {
|
|
3259
3266
|
...styles.value,
|
|
3260
3267
|
...props.style
|
|
3261
3268
|
}
|
|
3262
3269
|
}, [ props.card ? createVNode("div", {
|
|
3263
|
-
class: ns$
|
|
3270
|
+
class: ns$d.b("card")
|
|
3264
3271
|
}, [ slots.default?.() ]) : slots.default?.() ]);
|
|
3265
3272
|
}
|
|
3266
3273
|
}));
|
|
@@ -3338,7 +3345,7 @@ var defaultPropsConfig = {
|
|
|
3338
3345
|
|
|
3339
3346
|
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" ];
|
|
3340
3347
|
|
|
3341
|
-
var defaultConfig$
|
|
3348
|
+
var defaultConfig$4 = {
|
|
3342
3349
|
initLoadData: !0,
|
|
3343
3350
|
defaultContentHeight: 300,
|
|
3344
3351
|
fullscreenchangeContentHeight: !1,
|
|
@@ -3387,7 +3394,7 @@ var defaultConfig$3 = {
|
|
|
3387
3394
|
formColumnMinWidth: 350
|
|
3388
3395
|
};
|
|
3389
3396
|
|
|
3390
|
-
const columnSlotName = prop => "column-" + prop, searchFormSlotName = prop => "search-" + prop, formSlotName = prop => "form-" + prop, ns$
|
|
3397
|
+
const columnSlotName = prop => "column-" + prop, searchFormSlotName = prop => "search-" + prop, formSlotName = prop => "form-" + prop, ns$c = useNamespace("spin-loading");
|
|
3391
3398
|
|
|
3392
3399
|
var NextSpinLoading$1 = defineComponent({
|
|
3393
3400
|
name: "NextSpinLoading",
|
|
@@ -3422,22 +3429,22 @@ var NextSpinLoading$1 = defineComponent({
|
|
|
3422
3429
|
const _t = this.t, slots = this.$slots, props = this.$props, loadingText = props.tip || _t("next.loading");
|
|
3423
3430
|
return createVNode("div", {
|
|
3424
3431
|
ref: "elementInstance",
|
|
3425
|
-
class: [ ns$
|
|
3432
|
+
class: [ ns$c.b(), props.className ],
|
|
3426
3433
|
style: props.style
|
|
3427
3434
|
}, [ slots.default?.(), props.loading ? createVNode("div", {
|
|
3428
|
-
class: ns$
|
|
3435
|
+
class: ns$c.b("mask")
|
|
3429
3436
|
}, [ createVNode("span", {
|
|
3430
|
-
class: ns$
|
|
3437
|
+
class: ns$c.b("mask-dot")
|
|
3431
3438
|
}, [ createVNode("i", {
|
|
3432
|
-
class: ns$
|
|
3439
|
+
class: ns$c.be("mask", "dot-item")
|
|
3433
3440
|
}, null), createVNode("i", {
|
|
3434
|
-
class: ns$
|
|
3441
|
+
class: ns$c.be("mask", "dot-item")
|
|
3435
3442
|
}, null), createVNode("i", {
|
|
3436
|
-
class: ns$
|
|
3443
|
+
class: ns$c.be("mask", "dot-item")
|
|
3437
3444
|
}, null), createVNode("i", {
|
|
3438
|
-
class: ns$
|
|
3445
|
+
class: ns$c.be("mask", "dot-item")
|
|
3439
3446
|
}, null) ]), createVNode("span", {
|
|
3440
|
-
class: ns$
|
|
3447
|
+
class: ns$c.be("mask", "text")
|
|
3441
3448
|
}, [ loadingText ]) ]) : null ]);
|
|
3442
3449
|
}
|
|
3443
3450
|
}), SearchColumn = defineComponent({
|
|
@@ -4129,7 +4136,7 @@ var TableColumnOperations = defineComponent({
|
|
|
4129
4136
|
}
|
|
4130
4137
|
});
|
|
4131
4138
|
|
|
4132
|
-
const ns$
|
|
4139
|
+
const ns$b = useNamespace("dialog");
|
|
4133
4140
|
|
|
4134
4141
|
var NextDialog$1 = defineComponent({
|
|
4135
4142
|
name: "NextDialog",
|
|
@@ -4158,6 +4165,10 @@ var NextDialog$1 = defineComponent({
|
|
|
4158
4165
|
type: Boolean,
|
|
4159
4166
|
default: !0
|
|
4160
4167
|
},
|
|
4168
|
+
showClose: {
|
|
4169
|
+
type: Boolean,
|
|
4170
|
+
default: !0
|
|
4171
|
+
},
|
|
4161
4172
|
appendToBody: {
|
|
4162
4173
|
type: Boolean,
|
|
4163
4174
|
default: !1
|
|
@@ -4195,7 +4206,7 @@ var NextDialog$1 = defineComponent({
|
|
|
4195
4206
|
return () => createVNode(Fragment, null, [ createVNode(ElDialog, {
|
|
4196
4207
|
modelValue: visible.value,
|
|
4197
4208
|
"onUpdate:modelValue": $event => visible.value = $event,
|
|
4198
|
-
class: ns$
|
|
4209
|
+
class: ns$b.b(),
|
|
4199
4210
|
title: props.title,
|
|
4200
4211
|
appendToBody: props.appendToBody,
|
|
4201
4212
|
"destroy-on-close": !0,
|
|
@@ -4212,18 +4223,18 @@ var NextDialog$1 = defineComponent({
|
|
|
4212
4223
|
}, {
|
|
4213
4224
|
default: () => [ slots.default?.() ],
|
|
4214
4225
|
header: ({close: close, titleId: titleId, titleClass: titleClass}) => createVNode("div", {
|
|
4215
|
-
class: ns$
|
|
4226
|
+
class: ns$b.b("header")
|
|
4216
4227
|
}, [ createVNode("h4", {
|
|
4217
4228
|
id: titleId,
|
|
4218
4229
|
class: titleClass
|
|
4219
4230
|
}, [ props.title ]), createVNode("div", {
|
|
4220
|
-
class: ns$
|
|
4231
|
+
class: ns$b.e("header-right")
|
|
4221
4232
|
}, [ props.fullscreenBtn && createVNode("span", {
|
|
4222
4233
|
class: "icon-fullscreen",
|
|
4223
4234
|
onClick: () => isFullscreen.value = !isFullscreen.value
|
|
4224
4235
|
}, [ createVNode(ElIcon, null, {
|
|
4225
4236
|
default: () => [ createVNode(full_screen_default, null, null) ]
|
|
4226
|
-
}) ]), createVNode("span", {
|
|
4237
|
+
}) ]), props.showClose && createVNode("span", {
|
|
4227
4238
|
class: "icon-close",
|
|
4228
4239
|
onClick: close
|
|
4229
4240
|
}, [ createVNode(ElIcon, {
|
|
@@ -4251,7 +4262,7 @@ const tableSelectConfig = {
|
|
|
4251
4262
|
operations: !1
|
|
4252
4263
|
};
|
|
4253
4264
|
|
|
4254
|
-
var defaultConfig$
|
|
4265
|
+
var defaultConfig$3 = {
|
|
4255
4266
|
size: "default",
|
|
4256
4267
|
colSpan: 8,
|
|
4257
4268
|
labelWidth: "6em",
|
|
@@ -4266,7 +4277,7 @@ var defaultConfig$2 = {
|
|
|
4266
4277
|
resetText: null
|
|
4267
4278
|
};
|
|
4268
4279
|
|
|
4269
|
-
const ns$
|
|
4280
|
+
const ns$a = useNamespace("form");
|
|
4270
4281
|
|
|
4271
4282
|
var NumberRangePicker = defineComponent({
|
|
4272
4283
|
name: "NumberRangePicker",
|
|
@@ -4306,7 +4317,7 @@ var NumberRangePicker = defineComponent({
|
|
|
4306
4317
|
}));
|
|
4307
4318
|
return () => createVNode(Fragment, null, [ createVNode("div", {
|
|
4308
4319
|
ref: numberRangeRef,
|
|
4309
|
-
class: ns$
|
|
4320
|
+
class: ns$a.e("number-range")
|
|
4310
4321
|
}, [ createVNode(ElInputNumber, {
|
|
4311
4322
|
modelValue: startNumber.value,
|
|
4312
4323
|
"onUpdate:modelValue": $event => startNumber.value = $event,
|
|
@@ -4316,7 +4327,7 @@ var NumberRangePicker = defineComponent({
|
|
|
4316
4327
|
disabled: disabled,
|
|
4317
4328
|
onChange: onChangeStart
|
|
4318
4329
|
}, null), createVNode("span", {
|
|
4319
|
-
class: ns$
|
|
4330
|
+
class: ns$a.em("number-range", "division")
|
|
4320
4331
|
}, [ t("next.date.rangeSeparator") ]), createVNode(ElInputNumber, {
|
|
4321
4332
|
modelValue: endNumber.value,
|
|
4322
4333
|
"onUpdate:modelValue": $event => endNumber.value = $event,
|
|
@@ -4335,7 +4346,7 @@ function _isSlot$3(s) {
|
|
|
4335
4346
|
return "function" == typeof s || "[object Object]" === Object.prototype.toString.call(s) && !isVNode(s);
|
|
4336
4347
|
}
|
|
4337
4348
|
|
|
4338
|
-
const ns$
|
|
4349
|
+
const ns$9 = useNamespace("form"), InputTableSelect = defineComponent({
|
|
4339
4350
|
name: "InputTableSelect",
|
|
4340
4351
|
props: {
|
|
4341
4352
|
modelValue: {
|
|
@@ -4363,7 +4374,7 @@ const ns$8 = useNamespace("form"), InputTableSelect = defineComponent({
|
|
|
4363
4374
|
},
|
|
4364
4375
|
emits: [ "select" ],
|
|
4365
4376
|
setup(props, {emit: emit}) {
|
|
4366
|
-
const {t: t} = useLocale(), _disabled = props.disabled, _column = props.column, _placeholder = _column.placeholder || t("next.form.select") + _column.label, _tableDefaultConfig = deepClone(defaultConfig$
|
|
4377
|
+
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 = reactive({
|
|
4367
4378
|
visible: !1,
|
|
4368
4379
|
title: _column.label + t("next.form.tableSelect"),
|
|
4369
4380
|
dialogWidth: _options.dialogWidth
|
|
@@ -4434,18 +4445,18 @@ const ns$8 = useNamespace("form"), InputTableSelect = defineComponent({
|
|
|
4434
4445
|
}, renderContent = () => {
|
|
4435
4446
|
let _slot, _slot2;
|
|
4436
4447
|
return createVNode(Fragment, null, [ createVNode("div", {
|
|
4437
|
-
class: [ "el-input", ns$
|
|
4448
|
+
class: [ "el-input", ns$9.e("input-table"), ns$9.is("disabled", _disabled) ]
|
|
4438
4449
|
}, [ createVNode("div", {
|
|
4439
4450
|
class: "el-input__wrapper"
|
|
4440
4451
|
}, [ tags?.value.length ? createVNode("span", {
|
|
4441
|
-
class: ns$
|
|
4452
|
+
class: ns$9.em("input-table", "value")
|
|
4442
4453
|
}, [ tags.value.map(((tag, index) => createVNode(ElTag, {
|
|
4443
4454
|
closable: !_disabled,
|
|
4444
4455
|
onClose: () => _onCloseTag(0, index)
|
|
4445
4456
|
}, {
|
|
4446
4457
|
default: () => [ tag.label ]
|
|
4447
4458
|
}))), tagsMore?.value?.length ? createVNode(ElTooltip, {
|
|
4448
|
-
"popper-class": ns$
|
|
4459
|
+
"popper-class": ns$9.e("tooltip-tags"),
|
|
4449
4460
|
placement: "bottom",
|
|
4450
4461
|
effect: "light"
|
|
4451
4462
|
}, {
|
|
@@ -4459,10 +4470,10 @@ const ns$8 = useNamespace("form"), InputTableSelect = defineComponent({
|
|
|
4459
4470
|
default: () => [ tag.label ]
|
|
4460
4471
|
})))
|
|
4461
4472
|
}) : null ]) : createVNode("span", {
|
|
4462
|
-
class: ns$
|
|
4473
|
+
class: ns$9.em("input-table", "placeholder")
|
|
4463
4474
|
}, [ _placeholder ]) ]), createVNode(ElButton, {
|
|
4464
4475
|
type: "primary",
|
|
4465
|
-
class: ns$
|
|
4476
|
+
class: ns$9.em("input-table", "append"),
|
|
4466
4477
|
disabled: _disabled,
|
|
4467
4478
|
icon: search_default,
|
|
4468
4479
|
onClick: onClickTableDialog
|
|
@@ -4476,7 +4487,7 @@ const ns$8 = useNamespace("form"), InputTableSelect = defineComponent({
|
|
|
4476
4487
|
onClose: onCloseTableDialog
|
|
4477
4488
|
}, {
|
|
4478
4489
|
default: () => [ createVNode("div", {
|
|
4479
|
-
class: ns$
|
|
4490
|
+
class: ns$9.em("input-table", "content")
|
|
4480
4491
|
}, [ createVNode(ElRadioGroup, {
|
|
4481
4492
|
modelValue: sinleSelection.value
|
|
4482
4493
|
}, {
|
|
@@ -4499,7 +4510,7 @@ const ns$8 = useNamespace("form"), InputTableSelect = defineComponent({
|
|
|
4499
4510
|
}) ]
|
|
4500
4511
|
}) ]
|
|
4501
4512
|
}) ]), createVNode("div", {
|
|
4502
|
-
class: ns$
|
|
4513
|
+
class: ns$9.em("input-table", "footer")
|
|
4503
4514
|
}, [ createVNode(ElButton, {
|
|
4504
4515
|
onClick: onResetTableSelect
|
|
4505
4516
|
}, _isSlot$3(_slot = t("next.form.reset")) ? _slot : {
|
|
@@ -4515,7 +4526,7 @@ const ns$8 = useNamespace("form"), InputTableSelect = defineComponent({
|
|
|
4515
4526
|
};
|
|
4516
4527
|
return () => createVNode(Fragment, null, [ renderContent() ]);
|
|
4517
4528
|
}
|
|
4518
|
-
}), ns$
|
|
4529
|
+
}), ns$8 = useNamespace("form");
|
|
4519
4530
|
|
|
4520
4531
|
var UploadImage = defineComponent({
|
|
4521
4532
|
name: "UploadImage",
|
|
@@ -4572,7 +4583,7 @@ var UploadImage = defineComponent({
|
|
|
4572
4583
|
let urls = [];
|
|
4573
4584
|
return "string" == typeof value ? urls = [ value ] : "[object Array]" === Object.prototype.toString.call(value) && (urls = value),
|
|
4574
4585
|
urls = urls.filter((url => !!url)), urls.length ? createVNode(ElImage, {
|
|
4575
|
-
class: ns$
|
|
4586
|
+
class: ns$8.e("preview-image"),
|
|
4576
4587
|
src: urls[0],
|
|
4577
4588
|
previewSrcList: urls,
|
|
4578
4589
|
"preview-teleported": !0,
|
|
@@ -4587,7 +4598,7 @@ var UploadImage = defineComponent({
|
|
|
4587
4598
|
})
|
|
4588
4599
|
}) : null;
|
|
4589
4600
|
})(), _disabled ? null : createVNode(ElUpload, {
|
|
4590
|
-
class: [ ns$
|
|
4601
|
+
class: [ ns$8.b("upload-image"), props.className ],
|
|
4591
4602
|
style: props.style,
|
|
4592
4603
|
"list-type": props.listType,
|
|
4593
4604
|
multiple: props.multiple,
|
|
@@ -4725,9 +4736,9 @@ function _isSlot$2(s) {
|
|
|
4725
4736
|
return "function" == typeof s || "[object Object]" === Object.prototype.toString.call(s) && !isVNode(s);
|
|
4726
4737
|
}
|
|
4727
4738
|
|
|
4728
|
-
const ns$
|
|
4739
|
+
const ns$7 = useNamespace("form");
|
|
4729
4740
|
|
|
4730
|
-
var Element$
|
|
4741
|
+
var Element$7 = defineComponent({
|
|
4731
4742
|
name: "NextForm",
|
|
4732
4743
|
props: {
|
|
4733
4744
|
options: {
|
|
@@ -4745,7 +4756,7 @@ var Element$6 = defineComponent({
|
|
|
4745
4756
|
},
|
|
4746
4757
|
emits: [ "submit", "close", "reset" ],
|
|
4747
4758
|
setup(props, {slots: slots, emit: emit, expose: expose}) {
|
|
4748
|
-
const _config = deepClone(defaultConfig$
|
|
4759
|
+
const _config = deepClone(defaultConfig$3), options = reactive(merge$1(_config, props.options)), _isEditing = computed((() => "boolean" != typeof options.isEditing || options.isEditing)), {t: t} = useLocale(), colSpan = ref(options.colSpan), formDatum = reactive(props.formDatum) || {}, formParams = reactive(merge$1({}, formDatum)), _formColumns = ref([]), formRules = reactive({});
|
|
4749
4760
|
watch((() => [ props.columns, props.formDatum ]), (() => {
|
|
4750
4761
|
(() => {
|
|
4751
4762
|
const columns = props.columns;
|
|
@@ -5096,7 +5107,7 @@ var Element$6 = defineComponent({
|
|
|
5096
5107
|
let _slot;
|
|
5097
5108
|
return createVNode(ElForm, {
|
|
5098
5109
|
ref: ruleFormRef,
|
|
5099
|
-
class: ns$
|
|
5110
|
+
class: ns$7.b(),
|
|
5100
5111
|
inline: !1,
|
|
5101
5112
|
model: formParams,
|
|
5102
5113
|
size: options.size
|
|
@@ -5116,7 +5127,7 @@ var Element$6 = defineComponent({
|
|
|
5116
5127
|
}, {
|
|
5117
5128
|
label: () => column.label ? createVNode(Fragment, null, [ createVNode(NextTextEllipsis, {
|
|
5118
5129
|
content: t(column.label),
|
|
5119
|
-
class: ns$
|
|
5130
|
+
class: ns$7.e("item-label")
|
|
5120
5131
|
}, null), column.tip ? createVNode(ElTooltip, {
|
|
5121
5132
|
effect: "dark",
|
|
5122
5133
|
content: column.tip,
|
|
@@ -5136,7 +5147,7 @@ var Element$6 = defineComponent({
|
|
|
5136
5147
|
})))) ? _slot : {
|
|
5137
5148
|
default: () => [ _slot ]
|
|
5138
5149
|
}), _isEditing.value && options.showFooter ? createVNode("div", {
|
|
5139
|
-
class: ns$
|
|
5150
|
+
class: ns$7.e("footer")
|
|
5140
5151
|
}, [ createVNode(ElButton, {
|
|
5141
5152
|
type: "primary",
|
|
5142
5153
|
loading: submitLoading.value,
|
|
@@ -5156,7 +5167,7 @@ var Element$6 = defineComponent({
|
|
|
5156
5167
|
}
|
|
5157
5168
|
});
|
|
5158
5169
|
|
|
5159
|
-
const NextTreeSelect = withInstall(treeSelect), NextForm = withInstall(Element$
|
|
5170
|
+
const NextTreeSelect = withInstall(treeSelect), NextForm = withInstall(Element$7);
|
|
5160
5171
|
|
|
5161
5172
|
var AddEditForm = defineComponent({
|
|
5162
5173
|
name: "AddEditForm",
|
|
@@ -5213,18 +5224,18 @@ function _isSlot(s) {
|
|
|
5213
5224
|
return "function" == typeof s || "[object Object]" === Object.prototype.toString.call(s) && !isVNode(s);
|
|
5214
5225
|
}
|
|
5215
5226
|
|
|
5216
|
-
const ns$
|
|
5227
|
+
const ns$6 = useNamespace("crud-table");
|
|
5217
5228
|
|
|
5218
|
-
var Element$
|
|
5229
|
+
var Element$6 = defineComponent({
|
|
5219
5230
|
name: "NextCrudTable",
|
|
5220
5231
|
props: defaultPropsConfig,
|
|
5221
5232
|
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" ],
|
|
5222
5233
|
setup(props, {emit: emit, slots: slots, expose: expose}) {
|
|
5223
|
-
const _config = deepClone(defaultConfig$
|
|
5234
|
+
const _config = deepClone(defaultConfig$4), _options = computed((() => {
|
|
5224
5235
|
const cfg = unref(props.options);
|
|
5225
5236
|
return merge$1(_config, cfg);
|
|
5226
5237
|
})), options = unref(_options);
|
|
5227
|
-
provide("options", computed((() => _options.value))), provide("ns", ns$
|
|
5238
|
+
provide("options", computed((() => _options.value))), provide("ns", ns$6);
|
|
5228
5239
|
const {t: t} = useLocale(), _columns = ref(options.columns), _searchColumns = ref([]), _formColumns = ref([]), _updateColumnsAll = ops => {
|
|
5229
5240
|
((options, cb) => {
|
|
5230
5241
|
const _columns = reactive(options.columns), _loadDicData = col => {
|
|
@@ -5467,11 +5478,11 @@ var Element$5 = defineComponent({
|
|
|
5467
5478
|
});
|
|
5468
5479
|
return () => createVNode(Fragment, null, [ createVNode(Fragment, null, [ createVNode("div", {
|
|
5469
5480
|
ref: crudTableRef,
|
|
5470
|
-
class: [ ns$
|
|
5481
|
+
class: [ ns$6.b(), props.className ],
|
|
5471
5482
|
style: props.style
|
|
5472
5483
|
}, [ options.showSearchForm || options.showHeaderMenu ? createVNode("header", {
|
|
5473
5484
|
ref: headerRef,
|
|
5474
|
-
class: ns$
|
|
5485
|
+
class: ns$6.b("header")
|
|
5475
5486
|
}, [ options.showSearchForm && createVNode(HeaderSearch, {
|
|
5476
5487
|
columns: _searchColumns.value,
|
|
5477
5488
|
onZoomResize: updateTableContentHeight,
|
|
@@ -5490,7 +5501,7 @@ var Element$5 = defineComponent({
|
|
|
5490
5501
|
}, {
|
|
5491
5502
|
default: () => [ createVNode("div", {
|
|
5492
5503
|
ref: tableRef,
|
|
5493
|
-
class: ns$
|
|
5504
|
+
class: ns$6.b("content")
|
|
5494
5505
|
}, [ createVNode(ElTable, {
|
|
5495
5506
|
data: tableData.value,
|
|
5496
5507
|
height: tableContentHeight.value,
|
|
@@ -5553,7 +5564,7 @@ var Element$5 = defineComponent({
|
|
|
5553
5564
|
}) ]) ]
|
|
5554
5565
|
}), options.isPagination ? createVNode("div", {
|
|
5555
5566
|
ref: footerRef,
|
|
5556
|
-
class: ns$
|
|
5567
|
+
class: ns$6.b("footer")
|
|
5557
5568
|
}, [ createVNode(FooterPagination, {
|
|
5558
5569
|
page: props.page,
|
|
5559
5570
|
onChange: onChangePagination
|
|
@@ -5580,7 +5591,7 @@ var Element$5 = defineComponent({
|
|
|
5580
5591
|
}
|
|
5581
5592
|
});
|
|
5582
5593
|
|
|
5583
|
-
const NextCrudTable = withInstall(Element$
|
|
5594
|
+
const NextCrudTable = withInstall(Element$6);
|
|
5584
5595
|
|
|
5585
5596
|
var propsConfig = {
|
|
5586
5597
|
className: {
|
|
@@ -5611,15 +5622,15 @@ var propsConfig = {
|
|
|
5611
5622
|
total: 0
|
|
5612
5623
|
})
|
|
5613
5624
|
}
|
|
5614
|
-
}, defaultConfig$
|
|
5625
|
+
}, defaultConfig$2 = {};
|
|
5615
5626
|
|
|
5616
|
-
const ns$
|
|
5627
|
+
const ns$5 = useNamespace("crud-table-virtualized");
|
|
5617
5628
|
|
|
5618
5629
|
const NextCrudTableVirtualized = withInstall(defineComponent({
|
|
5619
5630
|
name: "NextCrudTableVirtualized",
|
|
5620
5631
|
props: propsConfig,
|
|
5621
5632
|
setup(props, {emit: emit}) {
|
|
5622
|
-
const _config = deepClone(defaultConfig$
|
|
5633
|
+
const _config = deepClone(defaultConfig$2), _options = computed((() => {
|
|
5623
5634
|
const cfg = unref(props.options);
|
|
5624
5635
|
return merge$1(_config, cfg);
|
|
5625
5636
|
})), options = unref(_options);
|
|
@@ -5634,7 +5645,7 @@ const NextCrudTableVirtualized = withInstall(defineComponent({
|
|
|
5634
5645
|
emit("close-add-edit");
|
|
5635
5646
|
};
|
|
5636
5647
|
return () => createVNode(Fragment, null, [ createVNode("div", {
|
|
5637
|
-
class: [ ns$
|
|
5648
|
+
class: [ ns$5.b(), props.className ]
|
|
5638
5649
|
}, [ createVNode(NextSpinLoading, null, null), createVNode(NextDialog, {
|
|
5639
5650
|
modelValue: addEditDialog.visible,
|
|
5640
5651
|
"onUpdate:modelValue": $event => addEditDialog.visible = $event,
|
|
@@ -5645,7 +5656,7 @@ const NextCrudTableVirtualized = withInstall(defineComponent({
|
|
|
5645
5656
|
onClose: onCloseAddEditDialog
|
|
5646
5657
|
}, null) ]) ]);
|
|
5647
5658
|
}
|
|
5648
|
-
})), NextSpinLoading = withInstall(NextSpinLoading$1), ns$
|
|
5659
|
+
})), NextSpinLoading = withInstall(NextSpinLoading$1), ns$4 = useNamespace("upload");
|
|
5649
5660
|
|
|
5650
5661
|
const NextUpload = withInstall(defineComponent({
|
|
5651
5662
|
name: "NextUpload",
|
|
@@ -5680,7 +5691,7 @@ const NextUpload = withInstall(defineComponent({
|
|
|
5680
5691
|
const slots = this.$slots, props = this.$props, emit = this.$emit, _t = this.t, uploadfilesPreview = ref([]), body = document.getElementsByTagName("body")[0];
|
|
5681
5692
|
let previewImagesContainer = null;
|
|
5682
5693
|
return createVNode(ElUpload, {
|
|
5683
|
-
class: [ ns$
|
|
5694
|
+
class: [ ns$4.b(), props.className ],
|
|
5684
5695
|
style: props.style,
|
|
5685
5696
|
"list-type": props.listType,
|
|
5686
5697
|
"auto-upload": !1,
|
|
@@ -5718,9 +5729,9 @@ const NextUpload = withInstall(defineComponent({
|
|
|
5718
5729
|
})
|
|
5719
5730
|
});
|
|
5720
5731
|
}
|
|
5721
|
-
})), ns$
|
|
5732
|
+
})), ns$3 = useNamespace("video-player");
|
|
5722
5733
|
|
|
5723
|
-
var Element$
|
|
5734
|
+
var Element$3 = defineComponent({
|
|
5724
5735
|
name: "NextVideoPlayer",
|
|
5725
5736
|
props: {
|
|
5726
5737
|
className: {
|
|
@@ -5793,7 +5804,7 @@ var Element$2 = defineComponent({
|
|
|
5793
5804
|
if (!classNames || !classNames.length) throw new Error("模型类别不能未空!");
|
|
5794
5805
|
container.innerHTML = "", tf.loadGraphModel(modelUrl).then((model => {
|
|
5795
5806
|
const canvas = document.createElement("canvas");
|
|
5796
|
-
canvas.className = ns$
|
|
5807
|
+
canvas.className = ns$3.b("recongition"), container.appendChild(canvas);
|
|
5797
5808
|
const ctx = canvas.getContext("2d"), detect_ctx = document.createElement("canvas").getContext("2d");
|
|
5798
5809
|
video.ontimeupdate = () => {
|
|
5799
5810
|
const {videoWidth: videoWidth, videoHeight: videoHeight, offsetTop: offsetTop, offsetLeft: offsetLeft} = video;
|
|
@@ -5964,13 +5975,13 @@ var Element$2 = defineComponent({
|
|
|
5964
5975
|
});
|
|
5965
5976
|
return () => createVNode(Fragment, null, [ createVNode("div", {
|
|
5966
5977
|
ref: videoBoxRef,
|
|
5967
|
-
class: [ ns$
|
|
5978
|
+
class: [ ns$3.b(), props.className ],
|
|
5968
5979
|
style: props.style
|
|
5969
5980
|
}, null) ]);
|
|
5970
5981
|
}
|
|
5971
5982
|
});
|
|
5972
5983
|
|
|
5973
|
-
const NextVideoPlayer = withInstall(Element$
|
|
5984
|
+
const NextVideoPlayer = withInstall(Element$3);
|
|
5974
5985
|
|
|
5975
5986
|
const NextDragResize = withInstall(defineComponent({
|
|
5976
5987
|
name: "NextDragResize",
|
|
@@ -6088,7 +6099,7 @@ var ToolHeader = defineComponent({
|
|
|
6088
6099
|
}
|
|
6089
6100
|
});
|
|
6090
6101
|
|
|
6091
|
-
const colors = [ "#5470c6", "#91cc75", "#fac858", "#ee6666", "#73c0de", "#3ba272", "#fc8452", "#9a60b4", "#ea7ccc" ], convertToLabel = rect => {
|
|
6102
|
+
const colors$1 = [ "#5470c6", "#91cc75", "#fac858", "#ee6666", "#73c0de", "#3ba272", "#fc8452", "#9a60b4", "#ea7ccc" ], convertToLabel = rect => {
|
|
6092
6103
|
const label_type = rect.type, x_center = rect.startX + rect.rectWidth / 2, y_center = rect.startY + rect.rectHeight / 2;
|
|
6093
6104
|
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)) ];
|
|
6094
6105
|
}, canvertToCanvas = (labelData, canvasWidth, canvasHeight) => {
|
|
@@ -6173,7 +6184,7 @@ var ContextMenuLabel = defineComponent({
|
|
|
6173
6184
|
}
|
|
6174
6185
|
}, [ createVNode("span", {
|
|
6175
6186
|
style: {
|
|
6176
|
-
"background-color": colors[index % colors.length]
|
|
6187
|
+
"background-color": colors$1[index % colors$1.length]
|
|
6177
6188
|
},
|
|
6178
6189
|
class: "label-line"
|
|
6179
6190
|
}, null), createVNode("span", null, [ name ]) ]))) ]), isValueExist(activateIndex.value) ? createVNode("div", {
|
|
@@ -6361,7 +6372,7 @@ var DraggableRect = defineComponent({
|
|
|
6361
6372
|
onMousedown: event => this.onMousedownDot(event, "bottomRight")
|
|
6362
6373
|
}, null) ]) ]);
|
|
6363
6374
|
}
|
|
6364
|
-
}), CanvasContext = defineComponent({
|
|
6375
|
+
}), CanvasContext$1 = defineComponent({
|
|
6365
6376
|
name: "NextCanvasContext",
|
|
6366
6377
|
props: {
|
|
6367
6378
|
classes: {
|
|
@@ -6427,7 +6438,7 @@ var DraggableRect = defineComponent({
|
|
|
6427
6438
|
const {ctx: ctx, labels: labels, image: image, canvasWidth: canvasWidth, canvasHeight: canvasHeight} = options, updateLabels = () => {
|
|
6428
6439
|
ctx.clearRect(0, 0, canvasWidth, canvasHeight), ctx.drawImage(image, 0, 0, canvasWidth, canvasHeight);
|
|
6429
6440
|
for (let i = 0; i < labels.length; i++) {
|
|
6430
|
-
const rect = labels[i], {startX: startX, startY: startY, rectWidth: rectWidth, rectHeight: rectHeight, type: type} = rect, color = colors[type % colors.length];
|
|
6441
|
+
const rect = labels[i], {startX: startX, startY: startY, rectWidth: rectWidth, rectHeight: rectHeight, type: type} = rect, color = colors$1[type % colors$1.length];
|
|
6431
6442
|
if (ctx.font = "bold 14px serif", ctx.textBaseline = "top", ctx.save(), ctx.strokeStyle = color,
|
|
6432
6443
|
ctx.strokeRect(startX, startY, rectWidth, rectHeight), isValueExist(rect.typeName) || isValueExist(rect.type)) {
|
|
6433
6444
|
const text = rect.typeName || rect.type;
|
|
@@ -6447,7 +6458,7 @@ var DraggableRect = defineComponent({
|
|
|
6447
6458
|
for (let i = 0; i < labels.length; i++) {
|
|
6448
6459
|
const rect = labels[i], {type: type, startX: startX, startY: startY, rectWidth: rectWidth, rectHeight: rectHeight} = rect;
|
|
6449
6460
|
x >= startX && x <= startX + rectWidth && y >= startY && y <= startY + rectHeight && (hit_rect = rect,
|
|
6450
|
-
hit_index = i, color = colors[type]);
|
|
6461
|
+
hit_index = i, color = colors$1[type]);
|
|
6451
6462
|
}
|
|
6452
6463
|
return {
|
|
6453
6464
|
hit_rect: hit_rect,
|
|
@@ -6637,7 +6648,7 @@ var DraggableRect = defineComponent({
|
|
|
6637
6648
|
onCloseContentmenuLabel: onCloseContentmenuLabel,
|
|
6638
6649
|
onSelectedLabel: (rect, index) => {
|
|
6639
6650
|
onCloseDraggableRectFixed(), nextTick((() => {
|
|
6640
|
-
const {startX: x, startY: y, type: type} = rect, color = colors[type];
|
|
6651
|
+
const {startX: x, startY: y, type: type} = rect, color = colors$1[type];
|
|
6641
6652
|
updateDraggableRectFixed(x, y, labels.value[index], index, color);
|
|
6642
6653
|
}));
|
|
6643
6654
|
},
|
|
@@ -6718,7 +6729,7 @@ var DraggableRect = defineComponent({
|
|
|
6718
6729
|
})(rect, index)
|
|
6719
6730
|
}, [ createVNode("div", null, [ createVNode("span", {
|
|
6720
6731
|
style: {
|
|
6721
|
-
"background-color": colors[rect.type]
|
|
6732
|
+
"background-color": colors$1[rect.type]
|
|
6722
6733
|
},
|
|
6723
6734
|
class: "label-line"
|
|
6724
6735
|
}, null), createVNode("span", null, [ rect.typeName ]) ]), createVNode(ElPopconfirm, {
|
|
@@ -6743,13 +6754,13 @@ var DraggableRect = defineComponent({
|
|
|
6743
6754
|
}, null) ]);
|
|
6744
6755
|
return () => createVNode(Fragment, null, [ renderContent() ]);
|
|
6745
6756
|
}
|
|
6746
|
-
}), defaultConfig = {
|
|
6757
|
+
}), defaultConfig$1 = {
|
|
6747
6758
|
minContentHeight: 500
|
|
6748
6759
|
};
|
|
6749
6760
|
|
|
6750
|
-
const ns$
|
|
6761
|
+
const ns$2 = useNamespace("labelimg");
|
|
6751
6762
|
|
|
6752
|
-
var Element = defineComponent({
|
|
6763
|
+
var Element$1 = defineComponent({
|
|
6753
6764
|
name: "NextLabelimg",
|
|
6754
6765
|
props: {
|
|
6755
6766
|
className: {
|
|
@@ -6760,10 +6771,6 @@ var Element = defineComponent({
|
|
|
6760
6771
|
type: Object,
|
|
6761
6772
|
default: () => ({})
|
|
6762
6773
|
},
|
|
6763
|
-
rowKey: {
|
|
6764
|
-
type: String,
|
|
6765
|
-
default: "id"
|
|
6766
|
-
},
|
|
6767
6774
|
options: {
|
|
6768
6775
|
type: Object,
|
|
6769
6776
|
default: () => ({})
|
|
@@ -6779,11 +6786,11 @@ var Element = defineComponent({
|
|
|
6779
6786
|
},
|
|
6780
6787
|
emits: [ "change", "save", "prev-click", "next-click" ],
|
|
6781
6788
|
setup(props, {emit: emit, slots: slots, expose: expose}) {
|
|
6782
|
-
const {t: t} = useLocale(), _config = deepClone(defaultConfig), _options = computed((() => {
|
|
6789
|
+
const {t: t} = useLocale(), _config = deepClone(defaultConfig$1), _options = computed((() => {
|
|
6783
6790
|
const cfg = unref(props.options);
|
|
6784
6791
|
return merge$1(_config, cfg);
|
|
6785
6792
|
})), options = unref(_options);
|
|
6786
|
-
provide("ns", ns$
|
|
6793
|
+
provide("ns", ns$2), provide("_emit", emit);
|
|
6787
6794
|
const activateNodeIndex = ref(0), classes = ref(props.classes), labelImages = ref(deepClone(props.data));
|
|
6788
6795
|
watch((() => props.data), (data => {
|
|
6789
6796
|
labelImages.value = deepClone(data);
|
|
@@ -6817,7 +6824,10 @@ var Element = defineComponent({
|
|
|
6817
6824
|
node: node,
|
|
6818
6825
|
label_txt: yolo_label.join("\n")
|
|
6819
6826
|
};
|
|
6820
|
-
}, isChangeNodeLabels = () =>
|
|
6827
|
+
}, isChangeNodeLabels = () => {
|
|
6828
|
+
const node = labelImages.value[activateNodeIndex.value];
|
|
6829
|
+
return isEqual(toRaw(node.labels).map((rect => convertToLabel(rect))), currentNode.value.labels.map((rect => convertToLabel(rect))));
|
|
6830
|
+
}, switchKeydownAD = e => {
|
|
6821
6831
|
const imageLength = labelImages.value.length;
|
|
6822
6832
|
"KeyD" === e.code ? (activateNodeIndex.value++, activateNodeIndex.value >= imageLength && (activateNodeIndex.value = 0)) : "KeyA" === e.code && (activateNodeIndex.value--,
|
|
6823
6833
|
activateNodeIndex.value < 0 && (activateNodeIndex.value = imageLength - 1));
|
|
@@ -6887,19 +6897,19 @@ var Element = defineComponent({
|
|
|
6887
6897
|
});
|
|
6888
6898
|
const renderContent = () => createVNode("div", {
|
|
6889
6899
|
ref: layoutLabelRef,
|
|
6890
|
-
class: [ ns$
|
|
6900
|
+
class: [ ns$2.b(), props.className, isFullscreen.value ? ns$2.b("fullscreen") : "" ],
|
|
6891
6901
|
style: {
|
|
6892
6902
|
...props.style
|
|
6893
6903
|
}
|
|
6894
6904
|
}, [ createVNode(NextSpinLoading$1, {
|
|
6895
6905
|
loading: loading.value,
|
|
6896
6906
|
tip: t("next.labelimg.saveTxt"),
|
|
6897
|
-
class: [ ns$
|
|
6907
|
+
class: [ ns$2.b("loading") ]
|
|
6898
6908
|
}, {
|
|
6899
6909
|
default: () => [ createVNode(ElScrollbar, null, {
|
|
6900
6910
|
default: () => [ createVNode("header", {
|
|
6901
6911
|
ref: headerRef,
|
|
6902
|
-
class: [ ns$
|
|
6912
|
+
class: [ ns$2.b("header") ]
|
|
6903
6913
|
}, [ slots.header ? slots.header() : createVNode(ToolHeader, {
|
|
6904
6914
|
isFullscreen: isFullscreen.value,
|
|
6905
6915
|
imageIndex: activateNodeIndex.value,
|
|
@@ -6913,16 +6923,16 @@ var Element = defineComponent({
|
|
|
6913
6923
|
}
|
|
6914
6924
|
}, null) ]), createVNode("div", {
|
|
6915
6925
|
ref: mainRef,
|
|
6916
|
-
class: [ ns$
|
|
6926
|
+
class: [ ns$2.b("main") ]
|
|
6917
6927
|
}, [ createVNode(ElScrollbar, {
|
|
6918
|
-
class: [ ns$
|
|
6928
|
+
class: [ ns$2.be("main", "content") ]
|
|
6919
6929
|
}, {
|
|
6920
6930
|
default: () => [ createVNode("div", {
|
|
6921
|
-
class: [ ns$
|
|
6931
|
+
class: [ ns$2.be("main", "content") ],
|
|
6922
6932
|
style: {
|
|
6923
6933
|
height: mainContentHeight.value + "px"
|
|
6924
6934
|
}
|
|
6925
|
-
}, [ createVNode(CanvasContext, {
|
|
6935
|
+
}, [ createVNode(CanvasContext$1, {
|
|
6926
6936
|
ref: canvasContextRef,
|
|
6927
6937
|
contextClientHeight: mainContentHeight.value,
|
|
6928
6938
|
classes: classes.value,
|
|
@@ -6937,9 +6947,9 @@ var Element = defineComponent({
|
|
|
6937
6947
|
onSelect: onSelectLabelNode
|
|
6938
6948
|
}, null) ]), createVNode("footer", {
|
|
6939
6949
|
ref: footerRef,
|
|
6940
|
-
class: [ ns$
|
|
6950
|
+
class: [ ns$2.b("footer") ]
|
|
6941
6951
|
}, [ createVNode("div", {
|
|
6942
|
-
class: [ ns$
|
|
6952
|
+
class: [ ns$2.be("footer", "left") ]
|
|
6943
6953
|
}, [ createVNode(ElIcon, {
|
|
6944
6954
|
size: 24,
|
|
6945
6955
|
color: "#797979",
|
|
@@ -6947,10 +6957,10 @@ var Element = defineComponent({
|
|
|
6947
6957
|
}, {
|
|
6948
6958
|
default: () => [ createVNode(arrow_left_default, null, null) ]
|
|
6949
6959
|
}) ]), createVNode("div", {
|
|
6950
|
-
class: [ ns$
|
|
6960
|
+
class: [ ns$2.be("footer", "center") ]
|
|
6951
6961
|
}, [ createVNode(ElScrollbar, null, {
|
|
6952
6962
|
default: () => [ createVNode("ul", {
|
|
6953
|
-
class: [ ns$
|
|
6963
|
+
class: [ ns$2.bem("footer", "center", "list") ]
|
|
6954
6964
|
}, [ labelImages.value.map(((item, index) => createVNode("li", {
|
|
6955
6965
|
key: index,
|
|
6956
6966
|
onClick: () => onChangeActivateNode(index),
|
|
@@ -6966,7 +6976,7 @@ var Element = defineComponent({
|
|
|
6966
6976
|
fit: "cover"
|
|
6967
6977
|
}, null) ]))) ]) ]
|
|
6968
6978
|
}) ]), createVNode("div", {
|
|
6969
|
-
class: [ ns$
|
|
6979
|
+
class: [ ns$2.be("footer", "right") ]
|
|
6970
6980
|
}, [ createVNode(ElIcon, {
|
|
6971
6981
|
size: 24,
|
|
6972
6982
|
color: "#797979",
|
|
@@ -6980,7 +6990,7 @@ var Element = defineComponent({
|
|
|
6980
6990
|
}
|
|
6981
6991
|
});
|
|
6982
6992
|
|
|
6983
|
-
const ns = useNamespace("labelimg-preview");
|
|
6993
|
+
const ns$1 = useNamespace("labelimg-preview");
|
|
6984
6994
|
|
|
6985
6995
|
var preview = defineComponent({
|
|
6986
6996
|
name: "NextLabelimgPreview",
|
|
@@ -7017,7 +7027,7 @@ var preview = defineComponent({
|
|
|
7017
7027
|
canvasBaseRef.value.style.width = canvasWidth + "px", canvasBaseRef.value.style.height = canvasHeight + "px";
|
|
7018
7028
|
})(canvasWidth, canvasHeight), ctx.clearRect(0, 0, canvasWidth, canvasHeight), ctx.drawImage(image, 0, 0, canvasWidth, canvasHeight);
|
|
7019
7029
|
for (let i = 0; i < labels.value.length; i++) {
|
|
7020
|
-
const rect = labels.value[i], {startX: startX, startY: startY, rectWidth: rectWidth, rectHeight: rectHeight, type: type} = rect, color = colors[type % colors.length];
|
|
7030
|
+
const rect = labels.value[i], {startX: startX, startY: startY, rectWidth: rectWidth, rectHeight: rectHeight, type: type} = rect, color = colors$1[type % colors$1.length];
|
|
7021
7031
|
if (ctx.font = "bold 14px serif", ctx.textBaseline = "top", ctx.save(), ctx.strokeStyle = color,
|
|
7022
7032
|
ctx.strokeRect(startX, startY, rectWidth, rectHeight), !isValueExist(rect.typeName)) {
|
|
7023
7033
|
const typeName = classes.value[rect.type];
|
|
@@ -7040,7 +7050,7 @@ var preview = defineComponent({
|
|
|
7040
7050
|
});
|
|
7041
7051
|
}));
|
|
7042
7052
|
return () => createVNode(Fragment, null, [ createVNode("div", {
|
|
7043
|
-
class: [ ns.b(), props.className ],
|
|
7053
|
+
class: [ ns$1.b(), props.className ],
|
|
7044
7054
|
style: {
|
|
7045
7055
|
...props.style
|
|
7046
7056
|
}
|
|
@@ -7050,7 +7060,421 @@ var preview = defineComponent({
|
|
|
7050
7060
|
}
|
|
7051
7061
|
});
|
|
7052
7062
|
|
|
7053
|
-
const NextLabelimg = withInstall(Element), NextLabelimgPreview = withInstall(preview);
|
|
7063
|
+
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" ];
|
|
7064
|
+
|
|
7065
|
+
class CreatePolygonVertexes {
|
|
7066
|
+
canvas;
|
|
7067
|
+
ctx;
|
|
7068
|
+
vertexes;
|
|
7069
|
+
isDrawing;
|
|
7070
|
+
mouseOffset;
|
|
7071
|
+
vertexesObservers=[];
|
|
7072
|
+
destroyedObservers;
|
|
7073
|
+
constructor(canvas, ctx) {
|
|
7074
|
+
this.canvas = canvas, this.ctx = ctx, this.isDrawing = !1, this.vertexes = [], this.mouseOffset = {
|
|
7075
|
+
x: 0,
|
|
7076
|
+
y: 0
|
|
7077
|
+
}, canvas.addEventListener("click", this.canvasMouseClick.bind(this)), canvas.addEventListener("mousemove", this.canvasMousemove.bind(this)),
|
|
7078
|
+
canvas.addEventListener("dblclick", this.canvasMouseDblclick.bind(this)), this.vertexes = new Proxy(this.vertexes, {
|
|
7079
|
+
set: (target, property, value) => (target[property] = value, this.notifyVertexChangeListeners(),
|
|
7080
|
+
!0)
|
|
7081
|
+
}), this.mouseOffset = new Proxy(this.mouseOffset, {
|
|
7082
|
+
set: (target, property, value) => (target[property] = value, this.notifyVertexChangeListeners(),
|
|
7083
|
+
!0)
|
|
7084
|
+
});
|
|
7085
|
+
}
|
|
7086
|
+
notifyVertexChangeListeners() {
|
|
7087
|
+
this.vertexesObservers.forEach((listener => {
|
|
7088
|
+
listener(this.vertexes, this.mouseOffset);
|
|
7089
|
+
}));
|
|
7090
|
+
}
|
|
7091
|
+
vertexesChangeEventListener(listener) {
|
|
7092
|
+
this.vertexesObservers.push(listener);
|
|
7093
|
+
}
|
|
7094
|
+
notifyDestryedListerers() {
|
|
7095
|
+
this.destroyedObservers(this.vertexes);
|
|
7096
|
+
}
|
|
7097
|
+
onDestroyed(callback) {
|
|
7098
|
+
this.destroyedObservers = callback;
|
|
7099
|
+
}
|
|
7100
|
+
canvasMouseClick(e) {
|
|
7101
|
+
e.stopPropagation(), this.isDrawing = !0, this.mouseOffset.x = e.offsetX, this.mouseOffset.y = e.offsetY,
|
|
7102
|
+
this.vertexes.push([ e.offsetX, e.offsetY ]), this.vertexes = vertexesUnique(this.vertexes);
|
|
7103
|
+
}
|
|
7104
|
+
canvasMousemove(e) {
|
|
7105
|
+
e.stopPropagation(), this.isDrawing && (this.mouseOffset.x = e.offsetX, this.mouseOffset.y = e.offsetY,
|
|
7106
|
+
this.canvas.style.cursor = "crosshair");
|
|
7107
|
+
}
|
|
7108
|
+
canvasMouseDblclick(e) {
|
|
7109
|
+
e.stopPropagation(), this.canvas.style.cursor = "unset", this.mouseOffset.x = e.offsetX,
|
|
7110
|
+
this.mouseOffset.y = e.offsetY, this.vertexes.push([ e.offsetX, e.offsetY ]), this.vertexes = vertexesUnique(this.vertexes),
|
|
7111
|
+
this.notifyDestryedListerers(), this.destroyed();
|
|
7112
|
+
}
|
|
7113
|
+
destroyed() {
|
|
7114
|
+
this.isDrawing = !1, this.vertexes = [], this.vertexesObservers = [], this.canvas.removeEventListener("click", this.canvasMouseClick),
|
|
7115
|
+
this.canvas.removeEventListener("mousemove", this.canvasMousemove), this.canvas.removeEventListener("dblclick", this.canvasMouseDblclick);
|
|
7116
|
+
}
|
|
7117
|
+
}
|
|
7118
|
+
|
|
7119
|
+
class EditPolygonPath {
|
|
7120
|
+
canvas;
|
|
7121
|
+
ctx;
|
|
7122
|
+
vertexes;
|
|
7123
|
+
isEditing;
|
|
7124
|
+
isMoveEditing;
|
|
7125
|
+
canClickEvent;
|
|
7126
|
+
pointVertexIndex;
|
|
7127
|
+
pointCentreIndex;
|
|
7128
|
+
vertexRadius;
|
|
7129
|
+
edgeCentreRadius;
|
|
7130
|
+
observers=[];
|
|
7131
|
+
constructor(canvas, ctx) {
|
|
7132
|
+
this.canvas = canvas, this.ctx = ctx, this.vertexes = [], this.isEditing = !1, this.canClickEvent = !0,
|
|
7133
|
+
this.isMoveEditing = !1, this.pointVertexIndex = -1, this.pointCentreIndex = -1,
|
|
7134
|
+
this.vertexRadius = 8, this.edgeCentreRadius = 5;
|
|
7135
|
+
}
|
|
7136
|
+
drawPolygonPath(vertexes, mouseX, mouseY) {
|
|
7137
|
+
const ctx = this.ctx;
|
|
7138
|
+
if (!vertexes.length) return;
|
|
7139
|
+
ctx.beginPath(), ctx.lineWidth = 3, ctx.strokeStyle = "#5470c6", ctx.fillStyle = hexToRgba("#5470c6", .2),
|
|
7140
|
+
ctx.moveTo(vertexes[0][0], vertexes[0][1]);
|
|
7141
|
+
for (let i = 1; i < vertexes.length; i++) {
|
|
7142
|
+
const [x, y] = vertexes[i];
|
|
7143
|
+
ctx.lineTo(x, y);
|
|
7144
|
+
}
|
|
7145
|
+
isNaN(mouseX) || isNaN(mouseY) || ctx.lineTo(mouseX, mouseY), ctx.closePath(), ctx.stroke(),
|
|
7146
|
+
ctx.fill();
|
|
7147
|
+
}
|
|
7148
|
+
drawPolygonEdgeCentre(vertexes) {
|
|
7149
|
+
const ctx = this.ctx;
|
|
7150
|
+
for (let i = 0; i < vertexes.length; i++) {
|
|
7151
|
+
const [x, y] = vertexes[i];
|
|
7152
|
+
ctx.beginPath(), ctx.fillStyle = "#5470c6", ctx.arc(x, y, this.vertexRadius, 0, 2 * Math.PI),
|
|
7153
|
+
ctx.closePath(), ctx.fill(), ctx.beginPath(), ctx.fillStyle = "#FFFFFF", ctx.arc(x, y, this.vertexRadius - 3, 0, 2 * Math.PI),
|
|
7154
|
+
ctx.closePath(), ctx.fill();
|
|
7155
|
+
}
|
|
7156
|
+
for (let i = 0; i < vertexes.length; i++) {
|
|
7157
|
+
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;
|
|
7158
|
+
ctx.beginPath(), ctx.fillStyle = "#5470c6", ctx.arc(x, y, this.edgeCentreRadius, 0, 2 * Math.PI),
|
|
7159
|
+
ctx.closePath(), ctx.fill();
|
|
7160
|
+
}
|
|
7161
|
+
}
|
|
7162
|
+
drawPolygon(vertexes, mouseOffset) {
|
|
7163
|
+
this.vertexes = vertexes, mouseOffset ? this.drawPolygonPath(vertexes, mouseOffset.x, mouseOffset.y) : (this.drawPolygonPath(vertexes),
|
|
7164
|
+
this.drawPolygonEdgeCentre(vertexes));
|
|
7165
|
+
}
|
|
7166
|
+
pointInVertexes(x, y) {
|
|
7167
|
+
const vertexes = this.vertexes;
|
|
7168
|
+
let aimIndex = null;
|
|
7169
|
+
for (let i = 0; i < vertexes.length; i++) {
|
|
7170
|
+
const [vertex_x, vertex_y] = vertexes[i];
|
|
7171
|
+
if (isPointInCircle(x, y, vertex_x, vertex_y, this.vertexRadius)) {
|
|
7172
|
+
this.canvas.style.cursor = "pointer", aimIndex = i;
|
|
7173
|
+
break;
|
|
7174
|
+
}
|
|
7175
|
+
this.canvas.style.cursor = "unset";
|
|
7176
|
+
}
|
|
7177
|
+
return aimIndex;
|
|
7178
|
+
}
|
|
7179
|
+
pointInEdgeCentre(x, y) {
|
|
7180
|
+
const vertexes = this.vertexes;
|
|
7181
|
+
let aimIndex = null;
|
|
7182
|
+
for (let i = 0; i < vertexes.length; i++) {
|
|
7183
|
+
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;
|
|
7184
|
+
if (isPointInCircle(x, y, vertex_x, vertex_y, this.edgeCentreRadius)) {
|
|
7185
|
+
this.canvas.style.cursor = "pointer", aimIndex = i;
|
|
7186
|
+
break;
|
|
7187
|
+
}
|
|
7188
|
+
this.canvas.style.cursor = "unset";
|
|
7189
|
+
}
|
|
7190
|
+
return aimIndex;
|
|
7191
|
+
}
|
|
7192
|
+
pointInVertexesOrEdgeCentre(x, y) {
|
|
7193
|
+
const vertexes = this.vertexes;
|
|
7194
|
+
for (let i = 0; i < vertexes.length; i++) {
|
|
7195
|
+
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);
|
|
7196
|
+
if (isInVertex || isInEdgeCenter) {
|
|
7197
|
+
this.canvas.style.cursor = "pointer";
|
|
7198
|
+
break;
|
|
7199
|
+
}
|
|
7200
|
+
this.canvas.style.cursor = "unset";
|
|
7201
|
+
}
|
|
7202
|
+
}
|
|
7203
|
+
notifyObservers() {
|
|
7204
|
+
this.observers.forEach((listener => {
|
|
7205
|
+
listener(this.vertexes);
|
|
7206
|
+
}));
|
|
7207
|
+
}
|
|
7208
|
+
updatePolygon(callback) {
|
|
7209
|
+
this.isEditing = !0, this.canvas.addEventListener("mousedown", this.canvasMousedown.bind(this)),
|
|
7210
|
+
this.canvas.addEventListener("mouseup", this.canvasMouseup.bind(this)), this.canvas.addEventListener("click", this.canvasMouseClick.bind(this)),
|
|
7211
|
+
this.canvas.addEventListener("mousemove", this.canvasMousemove.bind(this)), this.observers.push(callback);
|
|
7212
|
+
}
|
|
7213
|
+
canvasMousedown(e) {
|
|
7214
|
+
e.stopPropagation(), e.preventDefault(), this.canClickEvent = !0;
|
|
7215
|
+
const {offsetX: x, offsetY: y} = e;
|
|
7216
|
+
if (this.isEditing) {
|
|
7217
|
+
const vertex_i = this.pointInVertexes(x, y);
|
|
7218
|
+
isValueExist(vertex_i) && (this.isMoveEditing = !0, this.pointVertexIndex = vertex_i,
|
|
7219
|
+
this.vertexes.splice(this.pointVertexIndex, 1, [ x, y ]));
|
|
7220
|
+
const i = this.pointInEdgeCentre(x, y);
|
|
7221
|
+
isValueExist(i) && (this.isMoveEditing = !0, this.pointCentreIndex = i + 1, this.vertexes.splice(this.pointCentreIndex, 0, [ x, y ]));
|
|
7222
|
+
}
|
|
7223
|
+
setTimeout((() => {
|
|
7224
|
+
this.canClickEvent = !1;
|
|
7225
|
+
}), 200);
|
|
7226
|
+
}
|
|
7227
|
+
canvasMouseup(e) {
|
|
7228
|
+
e.stopPropagation(), e.preventDefault();
|
|
7229
|
+
const {offsetX: x, offsetY: y} = e;
|
|
7230
|
+
this.pointVertexIndex > -1 && this.vertexes.splice(this.pointVertexIndex, 1, [ x, y ]),
|
|
7231
|
+
this.pointCentreIndex > -1 && this.vertexes.splice(this.pointCentreIndex, 1, [ x, y ]),
|
|
7232
|
+
this.isMoveEditing = !1, this.pointVertexIndex = -1, this.pointCentreIndex = -1,
|
|
7233
|
+
this.notifyObservers();
|
|
7234
|
+
}
|
|
7235
|
+
canvasMouseClick(e) {
|
|
7236
|
+
e.stopPropagation();
|
|
7237
|
+
const {offsetX: x, offsetY: y} = e;
|
|
7238
|
+
if (this.isEditing && this.canClickEvent) {
|
|
7239
|
+
e.stopImmediatePropagation();
|
|
7240
|
+
const i = this.pointInVertexes(x, y);
|
|
7241
|
+
if (isValueExist(i)) {
|
|
7242
|
+
if (this.vertexes.length <= 3) return;
|
|
7243
|
+
this.vertexes.splice(i, 1), this.drawPolygon(this.vertexes), this.notifyObservers();
|
|
7244
|
+
}
|
|
7245
|
+
}
|
|
7246
|
+
}
|
|
7247
|
+
canvasMousemove(e) {
|
|
7248
|
+
e.stopPropagation();
|
|
7249
|
+
const {offsetX: x, offsetY: y} = e;
|
|
7250
|
+
this.pointInVertexesOrEdgeCentre(x, y), this.isMoveEditing && (this.pointVertexIndex > -1 && this.vertexes.splice(this.pointVertexIndex, 1, [ x, y ]),
|
|
7251
|
+
this.pointCentreIndex > -1 && this.vertexes.splice(this.pointCentreIndex, 1, [ x, y ]),
|
|
7252
|
+
this.notifyObservers());
|
|
7253
|
+
}
|
|
7254
|
+
destroyed() {
|
|
7255
|
+
this.vertexes = [], this.observers = [], this.isEditing = !1, this.canvas.removeEventListener("mousedown", this.canvasMousedown),
|
|
7256
|
+
this.canvas.removeEventListener("mouseup", this.canvasMouseup), this.canvas.removeEventListener("click", this.canvasMouseClick),
|
|
7257
|
+
this.canvas.removeEventListener("mousemove", this.canvasMousemove);
|
|
7258
|
+
}
|
|
7259
|
+
}
|
|
7260
|
+
|
|
7261
|
+
class CreateDrawCanvas {
|
|
7262
|
+
canvas;
|
|
7263
|
+
ctx;
|
|
7264
|
+
image;
|
|
7265
|
+
canvasWidth;
|
|
7266
|
+
canvasHeight;
|
|
7267
|
+
paths;
|
|
7268
|
+
editDrawPolygon;
|
|
7269
|
+
createPolygonVertexes;
|
|
7270
|
+
editVertexes;
|
|
7271
|
+
editPolygonObservers=[];
|
|
7272
|
+
constructor(options) {
|
|
7273
|
+
const {canvas: canvas, ctx: ctx, image: image, canvasWidth: canvasWidth, canvasHeight: canvasHeight, paths: paths} = options;
|
|
7274
|
+
this.canvas = canvas, this.ctx = ctx, this.image = image, this.canvasWidth = canvasWidth,
|
|
7275
|
+
this.canvasHeight = canvasHeight, this.paths = paths || [], this.editVertexes = [],
|
|
7276
|
+
this.render(), this.editDrawPolygon = new EditPolygonPath(canvas, ctx), this.createPolygonVertexes = new CreatePolygonVertexes(canvas, ctx),
|
|
7277
|
+
this.createPolygonVertexes.vertexesChangeEventListener(((vertexes, mouseOffset) => {
|
|
7278
|
+
this.render(), this.editDrawPolygon.drawPolygon(vertexes, mouseOffset), this.editVertexes = vertexes,
|
|
7279
|
+
this.notifyObservers();
|
|
7280
|
+
})), this.createPolygonVertexes.onDestroyed((vertexes => {
|
|
7281
|
+
this.render(), this.editDrawPolygon.drawPolygon(vertexes), this.editDrawPolygon.updatePolygon((vertexes => {
|
|
7282
|
+
this.render(), this.editDrawPolygon.drawPolygon(vertexes), this.editVertexes = vertexes,
|
|
7283
|
+
this.notifyObservers();
|
|
7284
|
+
}));
|
|
7285
|
+
}));
|
|
7286
|
+
}
|
|
7287
|
+
notifyObservers() {
|
|
7288
|
+
this.editPolygonObservers.forEach((listener => {
|
|
7289
|
+
listener(this.editVertexes);
|
|
7290
|
+
}));
|
|
7291
|
+
}
|
|
7292
|
+
updatePolygon(callback) {
|
|
7293
|
+
this.editPolygonObservers.push(callback);
|
|
7294
|
+
}
|
|
7295
|
+
drawPolygons(paths) {
|
|
7296
|
+
const ctx = this.ctx;
|
|
7297
|
+
for (let i = 0; i < paths.length; i++) {
|
|
7298
|
+
const path = paths[i].path;
|
|
7299
|
+
if (!path.length) return;
|
|
7300
|
+
const color = colors[i % colors.length];
|
|
7301
|
+
ctx.beginPath(), ctx.lineWidth = 2, ctx.strokeStyle = color, ctx.fillStyle = hexToRgba(color, .2),
|
|
7302
|
+
ctx.moveTo(path[0][0], path[0][1]);
|
|
7303
|
+
for (let i = 1; i < path.length; i++) {
|
|
7304
|
+
const [x, y] = path[i];
|
|
7305
|
+
ctx.lineTo(x, y);
|
|
7306
|
+
}
|
|
7307
|
+
ctx.closePath(), ctx.stroke(), ctx.fill();
|
|
7308
|
+
}
|
|
7309
|
+
}
|
|
7310
|
+
initCanvas=() => {
|
|
7311
|
+
this.ctx.clearRect(0, 0, this.canvasWidth, this.canvasHeight), this.ctx.drawImage(this.image, 0, 0, this.canvasWidth, this.canvasHeight),
|
|
7312
|
+
this.drawPolygons(this.paths);
|
|
7313
|
+
};
|
|
7314
|
+
render=() => {
|
|
7315
|
+
this.initCanvas();
|
|
7316
|
+
};
|
|
7317
|
+
destroyed() {
|
|
7318
|
+
this.paths = [], this.editDrawPolygon.destroyed(), this.createPolygonVertexes.destroyed();
|
|
7319
|
+
}
|
|
7320
|
+
}
|
|
7321
|
+
|
|
7322
|
+
var CanvasContext = defineComponent({
|
|
7323
|
+
props: {
|
|
7324
|
+
classes: {
|
|
7325
|
+
type: Array,
|
|
7326
|
+
default: () => []
|
|
7327
|
+
},
|
|
7328
|
+
contextClientHeight: {
|
|
7329
|
+
type: Number,
|
|
7330
|
+
default: null
|
|
7331
|
+
},
|
|
7332
|
+
rowInfo: {
|
|
7333
|
+
type: Object,
|
|
7334
|
+
default: () => ({})
|
|
7335
|
+
}
|
|
7336
|
+
},
|
|
7337
|
+
emits: [ "editPolygon" ],
|
|
7338
|
+
setup(props, {emit: emit}) {
|
|
7339
|
+
const ns = inject("ns", {}), canvasMainRef = ref(), canvasBaseRef = ref(), drawCanvas = ref(), loadingImage = ref(!1), renderImageLabel = rowInfo => {
|
|
7340
|
+
const clientHeight = canvasMainRef.value?.clientHeight, ctx = canvasBaseRef.value?.getContext("2d");
|
|
7341
|
+
if (rowInfo?.imageSrc) {
|
|
7342
|
+
const image = new Image;
|
|
7343
|
+
image.src = rowInfo.imageSrc, loadingImage.value = !0, image.onload = () => {
|
|
7344
|
+
loadingImage.value = !1;
|
|
7345
|
+
let {width: width, height: height} = image;
|
|
7346
|
+
if (height > clientHeight) {
|
|
7347
|
+
const scale = height / clientHeight;
|
|
7348
|
+
height = clientHeight, image.style.height = height + "px", width /= scale;
|
|
7349
|
+
}
|
|
7350
|
+
const canvasHeight = height, scaleFactor = parseFloat((canvasHeight / height).toFixed(3)), canvasWidth = Math.ceil(width * scaleFactor);
|
|
7351
|
+
((canvasWidth, canvasHeight) => {
|
|
7352
|
+
canvasMainRef.value.style.width = canvasWidth + "px", canvasMainRef.value.style.height = canvasHeight + "px",
|
|
7353
|
+
canvasBaseRef.value.width = canvasWidth, canvasBaseRef.value.height = canvasHeight,
|
|
7354
|
+
canvasBaseRef.value.style.width = canvasWidth + "px", canvasBaseRef.value.style.height = canvasHeight + "px";
|
|
7355
|
+
})(canvasWidth, canvasHeight), drawCanvas.value = new CreateDrawCanvas({
|
|
7356
|
+
canvas: canvasBaseRef.value,
|
|
7357
|
+
ctx: ctx,
|
|
7358
|
+
image: image,
|
|
7359
|
+
canvasWidth: canvasWidth,
|
|
7360
|
+
canvasHeight: canvasHeight,
|
|
7361
|
+
scaleFactor: scaleFactor,
|
|
7362
|
+
paths: rowInfo.labels
|
|
7363
|
+
}), drawCanvas.value.updatePolygon((vertexes => {
|
|
7364
|
+
emit("editPolygon", {
|
|
7365
|
+
vertexes: vertexes,
|
|
7366
|
+
canvasWidth: canvasWidth,
|
|
7367
|
+
canvasHeight: canvasHeight
|
|
7368
|
+
});
|
|
7369
|
+
}));
|
|
7370
|
+
}, image.onerror = () => {
|
|
7371
|
+
loadingImage.value = !1;
|
|
7372
|
+
};
|
|
7373
|
+
}
|
|
7374
|
+
};
|
|
7375
|
+
onMounted((() => {
|
|
7376
|
+
watch((() => props.rowInfo), (info => {
|
|
7377
|
+
const rowInfo = toRaw(info);
|
|
7378
|
+
renderImageLabel(rowInfo);
|
|
7379
|
+
}), {
|
|
7380
|
+
deep: !0,
|
|
7381
|
+
immediate: !0
|
|
7382
|
+
}), watch((() => props.contextClientHeight), (height => {
|
|
7383
|
+
if (valueExist(height)) {
|
|
7384
|
+
canvasMainRef.value.style.height = height + "px";
|
|
7385
|
+
const rowInfo = toRaw(props.rowInfo);
|
|
7386
|
+
renderImageLabel(rowInfo);
|
|
7387
|
+
}
|
|
7388
|
+
}));
|
|
7389
|
+
}));
|
|
7390
|
+
return () => createVNode(Fragment, null, [ createVNode(NextSpinLoading, {
|
|
7391
|
+
loading: loadingImage.value,
|
|
7392
|
+
class: [ ns.b("loading") ]
|
|
7393
|
+
}, {
|
|
7394
|
+
default: () => [ createVNode("div", {
|
|
7395
|
+
ref: canvasMainRef,
|
|
7396
|
+
class: [ ns.b("canvas") ]
|
|
7397
|
+
}, [ createVNode("canvas", {
|
|
7398
|
+
ref: canvasBaseRef,
|
|
7399
|
+
class: [ ns.be("canvas", "context") ]
|
|
7400
|
+
}, null) ]) ]
|
|
7401
|
+
}) ]);
|
|
7402
|
+
}
|
|
7403
|
+
}), defaultConfig = {
|
|
7404
|
+
minContentHeight: 500
|
|
7405
|
+
};
|
|
7406
|
+
|
|
7407
|
+
const ns = useNamespace("labelme");
|
|
7408
|
+
|
|
7409
|
+
const NextLabelme = withInstall(defineComponent({
|
|
7410
|
+
name: "NextLabelme",
|
|
7411
|
+
props: {
|
|
7412
|
+
className: {
|
|
7413
|
+
type: String,
|
|
7414
|
+
default: ""
|
|
7415
|
+
},
|
|
7416
|
+
style: {
|
|
7417
|
+
type: Object,
|
|
7418
|
+
default: () => ({})
|
|
7419
|
+
},
|
|
7420
|
+
options: {
|
|
7421
|
+
type: Object,
|
|
7422
|
+
default: () => ({})
|
|
7423
|
+
},
|
|
7424
|
+
classes: {
|
|
7425
|
+
type: Array,
|
|
7426
|
+
default: () => []
|
|
7427
|
+
},
|
|
7428
|
+
data: {
|
|
7429
|
+
type: Array,
|
|
7430
|
+
default: () => []
|
|
7431
|
+
}
|
|
7432
|
+
},
|
|
7433
|
+
emits: [ "change", "edit-polygon" ],
|
|
7434
|
+
setup(props, {emit: emit}) {
|
|
7435
|
+
const _config = deepClone(defaultConfig), _options = computed((() => {
|
|
7436
|
+
const cfg = unref(props.options);
|
|
7437
|
+
return merge$1(_config, cfg);
|
|
7438
|
+
})), options = unref(_options);
|
|
7439
|
+
provide("ns", ns), useLocale();
|
|
7440
|
+
const activateNodeIndex = ref(0), classes = ref(props.classes), labelImages = ref(deepClone(props.data));
|
|
7441
|
+
watch((() => props.data), (data => {
|
|
7442
|
+
labelImages.value = deepClone(data);
|
|
7443
|
+
}), {
|
|
7444
|
+
deep: !0
|
|
7445
|
+
}), watch((() => props.data.length), (() => {
|
|
7446
|
+
activateNodeIndex.value = 0;
|
|
7447
|
+
})), watch((() => props.classes), (val => {
|
|
7448
|
+
classes.value = val;
|
|
7449
|
+
}), {
|
|
7450
|
+
deep: !0
|
|
7451
|
+
});
|
|
7452
|
+
const currentNode = computed((() => {
|
|
7453
|
+
if (!labelImages.value) return {};
|
|
7454
|
+
const node = labelImages.value[activateNodeIndex.value] || {};
|
|
7455
|
+
return deepClone(node);
|
|
7456
|
+
})), mainContentHeight = ref(options.minContentHeight), mainRef = ref(), isFullscreen = ref(!1), onEditPlygonChange = plygon => {
|
|
7457
|
+
emit("edit-polygon", plygon);
|
|
7458
|
+
};
|
|
7459
|
+
return () => createVNode(Fragment, null, [ createVNode("div", {
|
|
7460
|
+
class: [ ns.b(), props.className, isFullscreen.value ? ns.b("fullscreen") : "" ],
|
|
7461
|
+
style: {
|
|
7462
|
+
...props.style
|
|
7463
|
+
}
|
|
7464
|
+
}, [ createVNode("div", {
|
|
7465
|
+
ref: mainRef,
|
|
7466
|
+
class: [ ns.b("main") ]
|
|
7467
|
+
}, [ createVNode("div", {
|
|
7468
|
+
class: [ ns.be("main", "content") ],
|
|
7469
|
+
style: {
|
|
7470
|
+
height: mainContentHeight.value + "px"
|
|
7471
|
+
}
|
|
7472
|
+
}, [ createVNode(CanvasContext, {
|
|
7473
|
+
rowInfo: currentNode.value,
|
|
7474
|
+
onEditPolygon: onEditPlygonChange
|
|
7475
|
+
}, null) ]) ]) ]) ]);
|
|
7476
|
+
}
|
|
7477
|
+
}));
|
|
7054
7478
|
|
|
7055
7479
|
var components = Object.freeze({
|
|
7056
7480
|
__proto__: null,
|
|
@@ -7062,6 +7486,7 @@ var components = Object.freeze({
|
|
|
7062
7486
|
NextForm: NextForm,
|
|
7063
7487
|
NextLabelimg: NextLabelimg,
|
|
7064
7488
|
NextLabelimgPreview: NextLabelimgPreview,
|
|
7489
|
+
NextLabelme: NextLabelme,
|
|
7065
7490
|
NextLayout: NextLayout,
|
|
7066
7491
|
NextMenu: NextMenu,
|
|
7067
7492
|
NextSpinLoading: NextSpinLoading,
|
|
@@ -7104,7 +7529,7 @@ const zoomDialog = app => {
|
|
|
7104
7529
|
}));
|
|
7105
7530
|
}
|
|
7106
7531
|
});
|
|
7107
|
-
}, version = "0.3.
|
|
7532
|
+
}, version = "0.3.3", install = function(app) {
|
|
7108
7533
|
Object.keys(components).forEach((key => {
|
|
7109
7534
|
const component = components[key];
|
|
7110
7535
|
app.component(component.name, component);
|
|
@@ -7114,8 +7539,8 @@ const zoomDialog = app => {
|
|
|
7114
7539
|
};
|
|
7115
7540
|
|
|
7116
7541
|
var index = {
|
|
7117
|
-
version: "0.3.
|
|
7542
|
+
version: "0.3.3",
|
|
7118
7543
|
install: install
|
|
7119
7544
|
};
|
|
7120
7545
|
|
|
7121
|
-
export { NextContainer, NextCrudTable, NextCrudTableVirtualized, NextDialog, NextDragResize, NextForm, NextLabelimg, NextLabelimgPreview, NextLayout, NextMenu, NextSpinLoading, NextTabs, NextTextEllipsis, NextTreeSelect, NextUpload, NextVideoPlayer, buildLocaleContext, buildTranslator, index as default, defaultNamespace, install, localeContextKey, localeLang, namespaceContextKey, nextUseCssTheme, nextUseCssVar, translate, updateThemeColor, updateThemeColorCssVar, useDetectVideo, useGetDerivedNamespace, useLanguage, useLocale, useNamespace, version };
|
|
7546
|
+
export { NextContainer, NextCrudTable, NextCrudTableVirtualized, NextDialog, NextDragResize, NextForm, NextLabelimg, NextLabelimgPreview, NextLabelme, NextLayout, NextMenu, NextSpinLoading, NextTabs, NextTextEllipsis, NextTreeSelect, NextUpload, NextVideoPlayer, buildLocaleContext, buildTranslator, index as default, defaultNamespace, install, localeContextKey, localeLang, namespaceContextKey, nextUseCssTheme, nextUseCssVar, translate, updateThemeColor, updateThemeColorCssVar, useDetectVideo, useGetDerivedNamespace, useLanguage, useLocale, useNamespace, version };
|