next-element-vue 0.3.2 → 0.3.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.css +2 -1
- package/dist/index.js +850 -146
- package/dist/index.min.js +3 -3
- package/dist/index.umd.js +851 -152
- 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 +57 -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 +57 -0
- package/dist/packages/components/labelme/src/widgets/canvas-context.d.ts +34 -0
- package/dist/packages/components/labelme/src/widgets/header-tool.d.ts +35 -0
- package/dist/packages/components.d.ts +1 -0
- package/dist/packages/hooks/use-locale/index.d.ts +3 -0
- package/dist/packages/locale/lang/en.d.ts +6 -0
- package/dist/packages/locale/lang/zh-cn.d.ts +6 -0
- package/dist/packages/locale/lang/zh-tw.d.ts +3 -0
- package/dist/packages/utils/theme.d.ts +1 -0
- package/package.json +2 -2
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.4 v
|
|
6
|
+
* 发布日期:2024-08-10
|
|
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:
|
|
@@ -896,6 +896,12 @@ var merge = createAssigner((function(object, source, srcIndex) {
|
|
|
896
896
|
saveLabel: "保存当前标注",
|
|
897
897
|
instructions: "使用说明",
|
|
898
898
|
labelNoUpdate: "暂无标签数据更新"
|
|
899
|
+
},
|
|
900
|
+
labelme: {
|
|
901
|
+
saveLabel: "保存",
|
|
902
|
+
createPolygon: "创建多边形",
|
|
903
|
+
editPolygon: "编辑多边形",
|
|
904
|
+
deletePolyton: "删除多边形"
|
|
899
905
|
}
|
|
900
906
|
}
|
|
901
907
|
}, enLocale = {
|
|
@@ -974,6 +980,12 @@ var merge = createAssigner((function(object, source, srcIndex) {
|
|
|
974
980
|
saveLabel: "save label",
|
|
975
981
|
instructions: "instructions",
|
|
976
982
|
labelNoUpdate: "No label data update"
|
|
983
|
+
},
|
|
984
|
+
labelme: {
|
|
985
|
+
saveLabel: "saving...",
|
|
986
|
+
createPolygon: "create polygon",
|
|
987
|
+
editPolygon: "edit polygon",
|
|
988
|
+
deletePolyton: "delete polygon"
|
|
977
989
|
}
|
|
978
990
|
}
|
|
979
991
|
}, zhtwLocale = {
|
|
@@ -1052,6 +1064,9 @@ var merge = createAssigner((function(object, source, srcIndex) {
|
|
|
1052
1064
|
saveLabel: "保存当前标注",
|
|
1053
1065
|
instructions: "使用说明",
|
|
1054
1066
|
labelNoUpdate: "暂无标签数据更新"
|
|
1067
|
+
},
|
|
1068
|
+
labelme: {
|
|
1069
|
+
saveLabel: "保存"
|
|
1055
1070
|
}
|
|
1056
1071
|
}
|
|
1057
1072
|
};
|
|
@@ -1090,6 +1105,13 @@ function useChangeColor() {
|
|
|
1090
1105
|
for (let i = 0; i < 3; i++) hexs[i] = parseInt(hexs[i], 16);
|
|
1091
1106
|
return hexs;
|
|
1092
1107
|
},
|
|
1108
|
+
hexToRgba: (str, alpha = 1) => {
|
|
1109
|
+
let hexs = "";
|
|
1110
|
+
if (!/^\#?[0-9A-Fa-f]{6}$/.test(str)) return ElMessage.warning("输入错误的hex"), "";
|
|
1111
|
+
hexs = (str = str.replace("#", "")).match(/../g);
|
|
1112
|
+
for (let i = 0; i < 3; i++) hexs[i] = parseInt(hexs[i], 16);
|
|
1113
|
+
return `rgba(${hexs.join(",")},${alpha})`;
|
|
1114
|
+
},
|
|
1093
1115
|
rgbToHex: (r, g, b) => {
|
|
1094
1116
|
let reg = /^\d{1,3}$/;
|
|
1095
1117
|
if (!reg.test(r) || !reg.test(g) || !reg.test(b)) return ElMessage.warning("输入错误的rgb颜色值"),
|
|
@@ -1217,7 +1239,7 @@ const {getLightColor: getLightColor$4} = useChangeColor(), nextUseCssVar = (cssv
|
|
|
1217
1239
|
return main;
|
|
1218
1240
|
}, slots_config_headerMenu = "header-menu", slots_config_headerToolsPrefix = "header-tools-prefix", slots_config_headerToolsSuffix = "header-tools-suffix";
|
|
1219
1241
|
|
|
1220
|
-
var defaultConfig$
|
|
1242
|
+
var defaultConfig$5 = {
|
|
1221
1243
|
logo: "",
|
|
1222
1244
|
title: "Next Element Vue",
|
|
1223
1245
|
userName: "Admin",
|
|
@@ -1265,7 +1287,7 @@ var defaultConfig$4 = {
|
|
|
1265
1287
|
}
|
|
1266
1288
|
};
|
|
1267
1289
|
|
|
1268
|
-
const ns$
|
|
1290
|
+
const ns$l = useNamespace("text-ellipsis");
|
|
1269
1291
|
|
|
1270
1292
|
const NextTextEllipsis = withInstall(defineComponent({
|
|
1271
1293
|
name: "NextTextEllipsis",
|
|
@@ -1312,7 +1334,7 @@ const NextTextEllipsis = withInstall(defineComponent({
|
|
|
1312
1334
|
}
|
|
1313
1335
|
};
|
|
1314
1336
|
return () => createVNode(Fragment, null, [ createVNode("div", {
|
|
1315
|
-
class: [ ns$
|
|
1337
|
+
class: [ ns$l.b(), props.class ],
|
|
1316
1338
|
style: setWidth.value,
|
|
1317
1339
|
onMouseenter: onMouseenter
|
|
1318
1340
|
}, [ isTip.value ? createVNode(ElTooltip, {
|
|
@@ -1322,11 +1344,11 @@ const NextTextEllipsis = withInstall(defineComponent({
|
|
|
1322
1344
|
disabled: props.disabled
|
|
1323
1345
|
}, {
|
|
1324
1346
|
default: () => [ createVNode("span", {
|
|
1325
|
-
class: ns$
|
|
1347
|
+
class: ns$l.e("text"),
|
|
1326
1348
|
ref: ellipsisRef
|
|
1327
1349
|
}, [ slots.default ? slots.default() : props.content ]) ]
|
|
1328
1350
|
}) : createVNode("span", {
|
|
1329
|
-
class: ns$
|
|
1351
|
+
class: ns$l.e("text"),
|
|
1330
1352
|
ref: ellipsisRef
|
|
1331
1353
|
}, [ slots.default ? slots.default() : props.content ]) ]) ]);
|
|
1332
1354
|
}
|
|
@@ -2710,7 +2732,7 @@ const NextMenuItem = defineComponent({
|
|
|
2710
2732
|
}, null) ]
|
|
2711
2733
|
}))) ]) ]);
|
|
2712
2734
|
}
|
|
2713
|
-
}), ns$
|
|
2735
|
+
}), ns$k = useNamespace("menu");
|
|
2714
2736
|
|
|
2715
2737
|
const NextMenu = withInstall(defineComponent({
|
|
2716
2738
|
name: "NextMenu",
|
|
@@ -2738,13 +2760,13 @@ const NextMenu = withInstall(defineComponent({
|
|
|
2738
2760
|
}
|
|
2739
2761
|
},
|
|
2740
2762
|
setup(props) {
|
|
2741
|
-
provide("ns", ns$
|
|
2763
|
+
provide("ns", ns$k);
|
|
2742
2764
|
const router = getCurrentInstance().appContext.config.globalProperties.$router, currentPath = router.currentRoute?.value.fullPath, activePath = ref(currentPath);
|
|
2743
2765
|
watch((() => router.currentRoute?.value), (to => {
|
|
2744
2766
|
activePath.value = to.fullPath;
|
|
2745
2767
|
}));
|
|
2746
2768
|
return () => createVNode(Fragment, null, [ createVNode(ElMenu, {
|
|
2747
|
-
class: [ ns$
|
|
2769
|
+
class: [ ns$k.b(), props.className ],
|
|
2748
2770
|
style: props.style,
|
|
2749
2771
|
defaultActive: activePath.value,
|
|
2750
2772
|
router: props.router,
|
|
@@ -2752,7 +2774,7 @@ const NextMenu = withInstall(defineComponent({
|
|
|
2752
2774
|
ellipsis: !0
|
|
2753
2775
|
}, {
|
|
2754
2776
|
default: () => [ createVNode(Fragment, null, [ props.menuTree.map((item => item.children?.length ? valueExist(item.meta?.isHide, !1) ? null : createVNode(ElSubMenu, {
|
|
2755
|
-
"popper-class": ns$
|
|
2777
|
+
"popper-class": ns$k.b("popper"),
|
|
2756
2778
|
index: item.path || item.id,
|
|
2757
2779
|
teleported: !0
|
|
2758
2780
|
}, {
|
|
@@ -2763,7 +2785,7 @@ const NextMenu = withInstall(defineComponent({
|
|
|
2763
2785
|
menuData: item.children
|
|
2764
2786
|
}, null)
|
|
2765
2787
|
}) : valueExist(item.meta?.isHide, !1) ? null : createVNode(ElMenuItem, {
|
|
2766
|
-
"popper-class": ns$
|
|
2788
|
+
"popper-class": ns$k.b("popper"),
|
|
2767
2789
|
index: item.path
|
|
2768
2790
|
}, {
|
|
2769
2791
|
default: () => [ createVNode(MenuItemTitle, {
|
|
@@ -2791,20 +2813,20 @@ var Sidebar$2 = defineComponent({
|
|
|
2791
2813
|
}
|
|
2792
2814
|
});
|
|
2793
2815
|
|
|
2794
|
-
const ns$
|
|
2816
|
+
const ns$j = useNamespace("layout-defaults");
|
|
2795
2817
|
|
|
2796
2818
|
var defaults = defineComponent({
|
|
2797
2819
|
props: {},
|
|
2798
|
-
setup: () => (provide("ns", ns$
|
|
2820
|
+
setup: () => (provide("ns", ns$j), {}),
|
|
2799
2821
|
render() {
|
|
2800
2822
|
const slots = this.$slots, _config = inject("options", {}), _emit = inject("__emit__", {});
|
|
2801
2823
|
slots.menu;
|
|
2802
2824
|
const isTabs = ref(!!slots.tabs);
|
|
2803
2825
|
return void 0 === slots.tabs && _config.showTabs && (isTabs.value = !0), createVNode(ElContainer, {
|
|
2804
|
-
class: ns$
|
|
2826
|
+
class: ns$j.b()
|
|
2805
2827
|
}, {
|
|
2806
2828
|
default: () => [ createVNode(Sidebar$2, null, null), createVNode("div", {
|
|
2807
|
-
class: [ ns$
|
|
2829
|
+
class: [ ns$j.b("content") ]
|
|
2808
2830
|
}, [ createVNode(Header$3, null, null), _config.showTabs ? slots.tabs ? slots.tabs?.() : createVNode(NextTabs, {
|
|
2809
2831
|
tabs: _config.tabs,
|
|
2810
2832
|
activeTab: _config.activeTab,
|
|
@@ -2812,7 +2834,7 @@ var defaults = defineComponent({
|
|
|
2812
2834
|
onSelect: (...arg) => _emit("tabsSelect", ...arg),
|
|
2813
2835
|
onClose: (...arg) => _emit("tabsClose", ...arg)
|
|
2814
2836
|
}, null) : null, createVNode("main", {
|
|
2815
|
-
class: [ ns$
|
|
2837
|
+
class: [ ns$j.bf("main"), ns$j.is("layout-tabs", isTabs.value) ]
|
|
2816
2838
|
}, [ slots.default?.() ]) ]) ]
|
|
2817
2839
|
});
|
|
2818
2840
|
}
|
|
@@ -2845,11 +2867,11 @@ var Header$2 = defineComponent({
|
|
|
2845
2867
|
}
|
|
2846
2868
|
});
|
|
2847
2869
|
|
|
2848
|
-
const ns$
|
|
2870
|
+
const ns$i = useNamespace("layout-transverse");
|
|
2849
2871
|
|
|
2850
2872
|
var transverse = defineComponent({
|
|
2851
2873
|
props: {},
|
|
2852
|
-
setup: () => (provide("ns", ns$
|
|
2874
|
+
setup: () => (provide("ns", ns$i), {}),
|
|
2853
2875
|
render() {
|
|
2854
2876
|
const slots = this.$slots, _config = inject("options", {}), _emit = inject("__emit__", {}), __slots_header = {};
|
|
2855
2877
|
slots[slots_config_headerMenu] && (__slots_header[slots_config_headerMenu] = () => slots[slots_config_headerMenu]()),
|
|
@@ -2866,7 +2888,7 @@ var transverse = defineComponent({
|
|
|
2866
2888
|
onSelect: (...arg) => _emit("tabsSelect", ...arg),
|
|
2867
2889
|
onClose: (...arg) => _emit("tabsClose", ...arg)
|
|
2868
2890
|
}, null) : null, createVNode("main", {
|
|
2869
|
-
class: [ ns$
|
|
2891
|
+
class: [ ns$i.b("main"), ns$i.is("layout-tabs", isTabs.value) ]
|
|
2870
2892
|
}, [ slots.default?.() ]) ]);
|
|
2871
2893
|
var s;
|
|
2872
2894
|
}
|
|
@@ -2908,11 +2930,11 @@ var Header$1 = defineComponent({
|
|
|
2908
2930
|
}
|
|
2909
2931
|
});
|
|
2910
2932
|
|
|
2911
|
-
const ns$
|
|
2933
|
+
const ns$h = useNamespace("layout-columns");
|
|
2912
2934
|
|
|
2913
2935
|
var columns = defineComponent({
|
|
2914
2936
|
props: {},
|
|
2915
|
-
setup: () => (provide("ns", ns$
|
|
2937
|
+
setup: () => (provide("ns", ns$h), {}),
|
|
2916
2938
|
render() {
|
|
2917
2939
|
const slots = this.$slots, _config = inject("options", {}), _emit = inject("__emit__", {}), __slots_header = {};
|
|
2918
2940
|
slots[slots_config_headerMenu] && (__slots_header[slots_config_headerMenu] = () => slots[slots_config_headerMenu]()),
|
|
@@ -2920,11 +2942,11 @@ var columns = defineComponent({
|
|
|
2920
2942
|
slots[slots_config_headerToolsSuffix] && (__slots_header[slots_config_headerToolsSuffix] = () => slots[slots_config_headerToolsSuffix]());
|
|
2921
2943
|
const isTabs = ref(!!slots.tabs);
|
|
2922
2944
|
return void 0 === slots.tabs && _config.showTabs && (isTabs.value = !0), createVNode(ElContainer, {
|
|
2923
|
-
class: ns$
|
|
2945
|
+
class: ns$h.b()
|
|
2924
2946
|
}, {
|
|
2925
2947
|
default: () => {
|
|
2926
2948
|
return [ createVNode(Sidebar$1, null, null), createVNode("div", {
|
|
2927
|
-
class: [ ns$
|
|
2949
|
+
class: [ ns$h.b("content") ]
|
|
2928
2950
|
}, [ createVNode(Header$1, null, (s = __slots_header, "function" == typeof s || "[object Object]" === Object.prototype.toString.call(s) && !isVNode(s) ? __slots_header : {
|
|
2929
2951
|
default: () => [ __slots_header ]
|
|
2930
2952
|
})), _config.showTabs ? slots.tabs ? slots.tabs?.() : createVNode(NextTabs, {
|
|
@@ -2934,7 +2956,7 @@ var columns = defineComponent({
|
|
|
2934
2956
|
onSelect: (...arg) => _emit("tabsSelect", ...arg),
|
|
2935
2957
|
onClose: (...arg) => _emit("tabsClose", ...arg)
|
|
2936
2958
|
}, null) : null, createVNode("main", {
|
|
2937
|
-
class: [ ns$
|
|
2959
|
+
class: [ ns$h.bf("main"), ns$h.is("layout-tabs", isTabs.value) ]
|
|
2938
2960
|
}, [ slots.default?.() ]) ]) ];
|
|
2939
2961
|
var s;
|
|
2940
2962
|
}
|
|
@@ -2980,21 +3002,21 @@ var Header = defineComponent({
|
|
|
2980
3002
|
}
|
|
2981
3003
|
});
|
|
2982
3004
|
|
|
2983
|
-
const ns$
|
|
3005
|
+
const ns$g = useNamespace("layout-classic");
|
|
2984
3006
|
|
|
2985
3007
|
var classic = defineComponent({
|
|
2986
3008
|
props: {},
|
|
2987
|
-
setup: () => (provide("ns", ns$
|
|
2988
|
-
ns: ns$
|
|
3009
|
+
setup: () => (provide("ns", ns$g), {
|
|
3010
|
+
ns: ns$g
|
|
2989
3011
|
}),
|
|
2990
3012
|
render() {
|
|
2991
3013
|
const slots = this.$slots, _config = inject("options", {}), _emit = inject("__emit__", {});
|
|
2992
3014
|
slots.menu;
|
|
2993
3015
|
const isTabs = ref(!!slots.tabs);
|
|
2994
3016
|
return void 0 === slots.tabs && _config.showTabs && (isTabs.value = !0), createVNode(Fragment, null, [ createVNode(Header, null, null), createVNode("div", {
|
|
2995
|
-
class: [ ns$
|
|
3017
|
+
class: [ ns$g.b("content"), ns$g.is("layout-tabs", isTabs.value) ]
|
|
2996
3018
|
}, [ createVNode(Sidebar, null, null), createVNode("div", {
|
|
2997
|
-
class: ns$
|
|
3019
|
+
class: ns$g.b("container")
|
|
2998
3020
|
}, [ _config.showTabs ? slots.tabs ? slots.tabs?.() : createVNode(NextTabs, {
|
|
2999
3021
|
tabs: _config.tabs,
|
|
3000
3022
|
activeTab: _config.activeTab,
|
|
@@ -3002,12 +3024,12 @@ var classic = defineComponent({
|
|
|
3002
3024
|
onSelect: (...arg) => _emit("tabsSelect", ...arg),
|
|
3003
3025
|
onClose: (...arg) => _emit("tabsClose", ...arg)
|
|
3004
3026
|
}, null) : null, createVNode("main", {
|
|
3005
|
-
class: [ ns$
|
|
3027
|
+
class: [ ns$g.b("main") ]
|
|
3006
3028
|
}, [ slots.default?.() ]) ]) ]) ]);
|
|
3007
3029
|
}
|
|
3008
3030
|
});
|
|
3009
3031
|
|
|
3010
|
-
const ns$
|
|
3032
|
+
const ns$f = useNamespace("layout"), layouts = {
|
|
3011
3033
|
defaults: markRaw(defaults),
|
|
3012
3034
|
transverse: markRaw(transverse),
|
|
3013
3035
|
columns: markRaw(columns),
|
|
@@ -3034,8 +3056,8 @@ const NextLayout = withInstall(defineComponent({
|
|
|
3034
3056
|
},
|
|
3035
3057
|
emits: [ "changeLanguage", "changeUserDropdown", "changeOptions", "tabsChange", "tabsSelect", "tabsClose" ],
|
|
3036
3058
|
setup(props, {slots: slots, emit: emit}) {
|
|
3037
|
-
const _config = ref(mergeWith(defaultConfig$
|
|
3038
|
-
provide("options", _config.value), provide("__ns__", ns$
|
|
3059
|
+
const _config = ref(mergeWith(defaultConfig$5, props.options, customizerCoverArray));
|
|
3060
|
+
provide("options", _config.value), provide("__ns__", ns$f), provide("__emit__", emit),
|
|
3039
3061
|
provide("__slots__", slots);
|
|
3040
3062
|
const updateOptions = cfg => {
|
|
3041
3063
|
_config.value = mergeWith(_config.value, cfg, customizerCoverArray), updateThemeColorCssVar(_config.value?.setting),
|
|
@@ -3059,15 +3081,15 @@ const NextLayout = withInstall(defineComponent({
|
|
|
3059
3081
|
const _activeSlots = {};
|
|
3060
3082
|
for (const key in slots) Object.prototype.hasOwnProperty.call(slots, key) && (_activeSlots[key] = () => slots[key]?.());
|
|
3061
3083
|
return createVNode("div", {
|
|
3062
|
-
class: [ ns$
|
|
3084
|
+
class: [ ns$f.b(), props.className ],
|
|
3063
3085
|
style: props.style
|
|
3064
3086
|
}, [ h(activeLayout.value, {}, {
|
|
3065
3087
|
..._activeSlots
|
|
3066
3088
|
}) ]);
|
|
3067
3089
|
}
|
|
3068
|
-
})), ns$
|
|
3090
|
+
})), ns$e = useNamespace("tabs");
|
|
3069
3091
|
|
|
3070
|
-
var Element$
|
|
3092
|
+
var Element$9 = defineComponent({
|
|
3071
3093
|
name: "NextTabs",
|
|
3072
3094
|
props: {
|
|
3073
3095
|
activeTab: {
|
|
@@ -3136,12 +3158,12 @@ var Element$8 = defineComponent({
|
|
|
3136
3158
|
tabsView.value.push(activeRoute)), emit("change", activeIndex.value, tabsView.value, "add");
|
|
3137
3159
|
}));
|
|
3138
3160
|
const renderContent = () => createVNode("nav", {
|
|
3139
|
-
class: ns$
|
|
3161
|
+
class: ns$e.b()
|
|
3140
3162
|
}, [ createVNode(ElScrollbar, null, {
|
|
3141
3163
|
default: () => [ createVNode("ul", {
|
|
3142
|
-
class: ns$
|
|
3164
|
+
class: ns$e.b("list")
|
|
3143
3165
|
}, [ tabsView.value.map(((tab, index) => tab ? createVNode("li", {
|
|
3144
|
-
class: [ "tab-item", ns$
|
|
3166
|
+
class: [ "tab-item", ns$e.is("active", activeIndex.value === index) ],
|
|
3145
3167
|
onClick: event => onClickTabItem(event, tab, index)
|
|
3146
3168
|
}, [ createVNode("i", {
|
|
3147
3169
|
class: [ "tab-icon", tab.meta?.icon ]
|
|
@@ -3172,11 +3194,11 @@ var Element$8 = defineComponent({
|
|
|
3172
3194
|
onCommand: onChange
|
|
3173
3195
|
}, {
|
|
3174
3196
|
default: () => createVNode("span", {
|
|
3175
|
-
class: ns$
|
|
3197
|
+
class: ns$e.b("tab-more")
|
|
3176
3198
|
}, [ createVNode("i", {
|
|
3177
|
-
class: [ ns$
|
|
3199
|
+
class: [ ns$e.be("tab-more", "box"), ns$e.be("tab-more", "top") ]
|
|
3178
3200
|
}, null), createVNode("i", {
|
|
3179
|
-
class: [ ns$
|
|
3201
|
+
class: [ ns$e.be("tab-more", "box"), ns$e.be("tab-more", "bottom") ]
|
|
3180
3202
|
}, null) ]),
|
|
3181
3203
|
dropdown: () => createVNode(ElDropdownMenu, null, {
|
|
3182
3204
|
default: () => [ createVNode(ElDropdownItem, {
|
|
@@ -3210,7 +3232,7 @@ var Element$8 = defineComponent({
|
|
|
3210
3232
|
}
|
|
3211
3233
|
});
|
|
3212
3234
|
|
|
3213
|
-
const NextTabs = withInstall(Element$
|
|
3235
|
+
const NextTabs = withInstall(Element$9), ns$d = useNamespace("container");
|
|
3214
3236
|
|
|
3215
3237
|
const NextContainer = withInstall(defineComponent({
|
|
3216
3238
|
name: "NextContainer",
|
|
@@ -3249,18 +3271,18 @@ const NextContainer = withInstall(defineComponent({
|
|
|
3249
3271
|
}), style;
|
|
3250
3272
|
}));
|
|
3251
3273
|
return () => props.scrollbar ? createVNode(ElScrollbar, {
|
|
3252
|
-
class: [ ns$
|
|
3274
|
+
class: [ ns$d.b(), props.className ],
|
|
3253
3275
|
style: props.style
|
|
3254
3276
|
}, {
|
|
3255
3277
|
default: () => [ slots.default?.() ]
|
|
3256
3278
|
}) : createVNode("div", {
|
|
3257
|
-
class: [ ns$
|
|
3279
|
+
class: [ ns$d.b(), props.className ],
|
|
3258
3280
|
style: {
|
|
3259
3281
|
...styles.value,
|
|
3260
3282
|
...props.style
|
|
3261
3283
|
}
|
|
3262
3284
|
}, [ props.card ? createVNode("div", {
|
|
3263
|
-
class: ns$
|
|
3285
|
+
class: ns$d.b("card")
|
|
3264
3286
|
}, [ slots.default?.() ]) : slots.default?.() ]);
|
|
3265
3287
|
}
|
|
3266
3288
|
}));
|
|
@@ -3338,7 +3360,7 @@ var defaultPropsConfig = {
|
|
|
3338
3360
|
|
|
3339
3361
|
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
3362
|
|
|
3341
|
-
var defaultConfig$
|
|
3363
|
+
var defaultConfig$4 = {
|
|
3342
3364
|
initLoadData: !0,
|
|
3343
3365
|
defaultContentHeight: 300,
|
|
3344
3366
|
fullscreenchangeContentHeight: !1,
|
|
@@ -3387,7 +3409,7 @@ var defaultConfig$3 = {
|
|
|
3387
3409
|
formColumnMinWidth: 350
|
|
3388
3410
|
};
|
|
3389
3411
|
|
|
3390
|
-
const columnSlotName = prop => "column-" + prop, searchFormSlotName = prop => "search-" + prop, formSlotName = prop => "form-" + prop, ns$
|
|
3412
|
+
const columnSlotName = prop => "column-" + prop, searchFormSlotName = prop => "search-" + prop, formSlotName = prop => "form-" + prop, ns$c = useNamespace("spin-loading");
|
|
3391
3413
|
|
|
3392
3414
|
var NextSpinLoading$1 = defineComponent({
|
|
3393
3415
|
name: "NextSpinLoading",
|
|
@@ -3422,22 +3444,22 @@ var NextSpinLoading$1 = defineComponent({
|
|
|
3422
3444
|
const _t = this.t, slots = this.$slots, props = this.$props, loadingText = props.tip || _t("next.loading");
|
|
3423
3445
|
return createVNode("div", {
|
|
3424
3446
|
ref: "elementInstance",
|
|
3425
|
-
class: [ ns$
|
|
3447
|
+
class: [ ns$c.b(), props.className ],
|
|
3426
3448
|
style: props.style
|
|
3427
3449
|
}, [ slots.default?.(), props.loading ? createVNode("div", {
|
|
3428
|
-
class: ns$
|
|
3450
|
+
class: ns$c.b("mask")
|
|
3429
3451
|
}, [ createVNode("span", {
|
|
3430
|
-
class: ns$
|
|
3452
|
+
class: ns$c.b("mask-dot")
|
|
3431
3453
|
}, [ createVNode("i", {
|
|
3432
|
-
class: ns$
|
|
3454
|
+
class: ns$c.be("mask", "dot-item")
|
|
3433
3455
|
}, null), createVNode("i", {
|
|
3434
|
-
class: ns$
|
|
3456
|
+
class: ns$c.be("mask", "dot-item")
|
|
3435
3457
|
}, null), createVNode("i", {
|
|
3436
|
-
class: ns$
|
|
3458
|
+
class: ns$c.be("mask", "dot-item")
|
|
3437
3459
|
}, null), createVNode("i", {
|
|
3438
|
-
class: ns$
|
|
3460
|
+
class: ns$c.be("mask", "dot-item")
|
|
3439
3461
|
}, null) ]), createVNode("span", {
|
|
3440
|
-
class: ns$
|
|
3462
|
+
class: ns$c.be("mask", "text")
|
|
3441
3463
|
}, [ loadingText ]) ]) : null ]);
|
|
3442
3464
|
}
|
|
3443
3465
|
}), SearchColumn = defineComponent({
|
|
@@ -3494,7 +3516,7 @@ var NextSpinLoading$1 = defineComponent({
|
|
|
3494
3516
|
return start.setTime(start.getTime() - 94608e6), [ start, end ];
|
|
3495
3517
|
}
|
|
3496
3518
|
} ], _onChangeNumberRange = (value, key) => {
|
|
3497
|
-
formParams
|
|
3519
|
+
formParams[key] = value;
|
|
3498
3520
|
}, renderColItemContent = col => {
|
|
3499
3521
|
const _disabled = valueExist(col.searchDisabled, col.disabled, !1);
|
|
3500
3522
|
if (slots[searchFormSlotName(col.prop)]) return slots[searchFormSlotName(col.prop)]({
|
|
@@ -3525,7 +3547,7 @@ var NextSpinLoading$1 = defineComponent({
|
|
|
3525
3547
|
placeholder: placeholder,
|
|
3526
3548
|
onInput: e => ((val, key) => {
|
|
3527
3549
|
const value = val.replace(/\D/g, "");
|
|
3528
|
-
formParams
|
|
3550
|
+
formParams[key] = value;
|
|
3529
3551
|
})(e, col.prop)
|
|
3530
3552
|
}, {
|
|
3531
3553
|
prefix: col.prefix ? () => col.prefix(formParams, col) : null,
|
|
@@ -3546,7 +3568,7 @@ var NextSpinLoading$1 = defineComponent({
|
|
|
3546
3568
|
let value = val;
|
|
3547
3569
|
value = value.replace(/[^0-9\.]/g, ""), value = value.replace(/^\./, "0."), value = value.replace(/\.{2,}/g, "."),
|
|
3548
3570
|
value = value.replace(".", "DUMMY"), value = value.replace(/\./g, ""), value = value.replace("DUMMY", "."),
|
|
3549
|
-
formParams
|
|
3571
|
+
formParams[key] = value;
|
|
3550
3572
|
})(e, col.prop)
|
|
3551
3573
|
}, {
|
|
3552
3574
|
prefix: col.prefix ? () => col.prefix(formParams, col) : null,
|
|
@@ -4129,7 +4151,7 @@ var TableColumnOperations = defineComponent({
|
|
|
4129
4151
|
}
|
|
4130
4152
|
});
|
|
4131
4153
|
|
|
4132
|
-
const ns$
|
|
4154
|
+
const ns$b = useNamespace("dialog");
|
|
4133
4155
|
|
|
4134
4156
|
var NextDialog$1 = defineComponent({
|
|
4135
4157
|
name: "NextDialog",
|
|
@@ -4158,6 +4180,10 @@ var NextDialog$1 = defineComponent({
|
|
|
4158
4180
|
type: Boolean,
|
|
4159
4181
|
default: !0
|
|
4160
4182
|
},
|
|
4183
|
+
showClose: {
|
|
4184
|
+
type: Boolean,
|
|
4185
|
+
default: !0
|
|
4186
|
+
},
|
|
4161
4187
|
appendToBody: {
|
|
4162
4188
|
type: Boolean,
|
|
4163
4189
|
default: !1
|
|
@@ -4195,7 +4221,7 @@ var NextDialog$1 = defineComponent({
|
|
|
4195
4221
|
return () => createVNode(Fragment, null, [ createVNode(ElDialog, {
|
|
4196
4222
|
modelValue: visible.value,
|
|
4197
4223
|
"onUpdate:modelValue": $event => visible.value = $event,
|
|
4198
|
-
class: ns$
|
|
4224
|
+
class: ns$b.b(),
|
|
4199
4225
|
title: props.title,
|
|
4200
4226
|
appendToBody: props.appendToBody,
|
|
4201
4227
|
"destroy-on-close": !0,
|
|
@@ -4212,18 +4238,18 @@ var NextDialog$1 = defineComponent({
|
|
|
4212
4238
|
}, {
|
|
4213
4239
|
default: () => [ slots.default?.() ],
|
|
4214
4240
|
header: ({close: close, titleId: titleId, titleClass: titleClass}) => createVNode("div", {
|
|
4215
|
-
class: ns$
|
|
4241
|
+
class: ns$b.b("header")
|
|
4216
4242
|
}, [ createVNode("h4", {
|
|
4217
4243
|
id: titleId,
|
|
4218
4244
|
class: titleClass
|
|
4219
4245
|
}, [ props.title ]), createVNode("div", {
|
|
4220
|
-
class: ns$
|
|
4246
|
+
class: ns$b.e("header-right")
|
|
4221
4247
|
}, [ props.fullscreenBtn && createVNode("span", {
|
|
4222
4248
|
class: "icon-fullscreen",
|
|
4223
4249
|
onClick: () => isFullscreen.value = !isFullscreen.value
|
|
4224
4250
|
}, [ createVNode(ElIcon, null, {
|
|
4225
4251
|
default: () => [ createVNode(full_screen_default, null, null) ]
|
|
4226
|
-
}) ]), createVNode("span", {
|
|
4252
|
+
}) ]), props.showClose && createVNode("span", {
|
|
4227
4253
|
class: "icon-close",
|
|
4228
4254
|
onClick: close
|
|
4229
4255
|
}, [ createVNode(ElIcon, {
|
|
@@ -4251,7 +4277,7 @@ const tableSelectConfig = {
|
|
|
4251
4277
|
operations: !1
|
|
4252
4278
|
};
|
|
4253
4279
|
|
|
4254
|
-
var defaultConfig$
|
|
4280
|
+
var defaultConfig$3 = {
|
|
4255
4281
|
size: "default",
|
|
4256
4282
|
colSpan: 8,
|
|
4257
4283
|
labelWidth: "6em",
|
|
@@ -4266,7 +4292,7 @@ var defaultConfig$2 = {
|
|
|
4266
4292
|
resetText: null
|
|
4267
4293
|
};
|
|
4268
4294
|
|
|
4269
|
-
const ns$
|
|
4295
|
+
const ns$a = useNamespace("form");
|
|
4270
4296
|
|
|
4271
4297
|
var NumberRangePicker = defineComponent({
|
|
4272
4298
|
name: "NumberRangePicker",
|
|
@@ -4306,7 +4332,7 @@ var NumberRangePicker = defineComponent({
|
|
|
4306
4332
|
}));
|
|
4307
4333
|
return () => createVNode(Fragment, null, [ createVNode("div", {
|
|
4308
4334
|
ref: numberRangeRef,
|
|
4309
|
-
class: ns$
|
|
4335
|
+
class: ns$a.e("number-range")
|
|
4310
4336
|
}, [ createVNode(ElInputNumber, {
|
|
4311
4337
|
modelValue: startNumber.value,
|
|
4312
4338
|
"onUpdate:modelValue": $event => startNumber.value = $event,
|
|
@@ -4316,7 +4342,7 @@ var NumberRangePicker = defineComponent({
|
|
|
4316
4342
|
disabled: disabled,
|
|
4317
4343
|
onChange: onChangeStart
|
|
4318
4344
|
}, null), createVNode("span", {
|
|
4319
|
-
class: ns$
|
|
4345
|
+
class: ns$a.em("number-range", "division")
|
|
4320
4346
|
}, [ t("next.date.rangeSeparator") ]), createVNode(ElInputNumber, {
|
|
4321
4347
|
modelValue: endNumber.value,
|
|
4322
4348
|
"onUpdate:modelValue": $event => endNumber.value = $event,
|
|
@@ -4335,7 +4361,7 @@ function _isSlot$3(s) {
|
|
|
4335
4361
|
return "function" == typeof s || "[object Object]" === Object.prototype.toString.call(s) && !isVNode(s);
|
|
4336
4362
|
}
|
|
4337
4363
|
|
|
4338
|
-
const ns$
|
|
4364
|
+
const ns$9 = useNamespace("form"), InputTableSelect = defineComponent({
|
|
4339
4365
|
name: "InputTableSelect",
|
|
4340
4366
|
props: {
|
|
4341
4367
|
modelValue: {
|
|
@@ -4363,7 +4389,7 @@ const ns$8 = useNamespace("form"), InputTableSelect = defineComponent({
|
|
|
4363
4389
|
},
|
|
4364
4390
|
emits: [ "select" ],
|
|
4365
4391
|
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$
|
|
4392
|
+
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
4393
|
visible: !1,
|
|
4368
4394
|
title: _column.label + t("next.form.tableSelect"),
|
|
4369
4395
|
dialogWidth: _options.dialogWidth
|
|
@@ -4434,18 +4460,18 @@ const ns$8 = useNamespace("form"), InputTableSelect = defineComponent({
|
|
|
4434
4460
|
}, renderContent = () => {
|
|
4435
4461
|
let _slot, _slot2;
|
|
4436
4462
|
return createVNode(Fragment, null, [ createVNode("div", {
|
|
4437
|
-
class: [ "el-input", ns$
|
|
4463
|
+
class: [ "el-input", ns$9.e("input-table"), ns$9.is("disabled", _disabled) ]
|
|
4438
4464
|
}, [ createVNode("div", {
|
|
4439
4465
|
class: "el-input__wrapper"
|
|
4440
4466
|
}, [ tags?.value.length ? createVNode("span", {
|
|
4441
|
-
class: ns$
|
|
4467
|
+
class: ns$9.em("input-table", "value")
|
|
4442
4468
|
}, [ tags.value.map(((tag, index) => createVNode(ElTag, {
|
|
4443
4469
|
closable: !_disabled,
|
|
4444
4470
|
onClose: () => _onCloseTag(0, index)
|
|
4445
4471
|
}, {
|
|
4446
4472
|
default: () => [ tag.label ]
|
|
4447
4473
|
}))), tagsMore?.value?.length ? createVNode(ElTooltip, {
|
|
4448
|
-
"popper-class": ns$
|
|
4474
|
+
"popper-class": ns$9.e("tooltip-tags"),
|
|
4449
4475
|
placement: "bottom",
|
|
4450
4476
|
effect: "light"
|
|
4451
4477
|
}, {
|
|
@@ -4459,10 +4485,10 @@ const ns$8 = useNamespace("form"), InputTableSelect = defineComponent({
|
|
|
4459
4485
|
default: () => [ tag.label ]
|
|
4460
4486
|
})))
|
|
4461
4487
|
}) : null ]) : createVNode("span", {
|
|
4462
|
-
class: ns$
|
|
4488
|
+
class: ns$9.em("input-table", "placeholder")
|
|
4463
4489
|
}, [ _placeholder ]) ]), createVNode(ElButton, {
|
|
4464
4490
|
type: "primary",
|
|
4465
|
-
class: ns$
|
|
4491
|
+
class: ns$9.em("input-table", "append"),
|
|
4466
4492
|
disabled: _disabled,
|
|
4467
4493
|
icon: search_default,
|
|
4468
4494
|
onClick: onClickTableDialog
|
|
@@ -4476,7 +4502,7 @@ const ns$8 = useNamespace("form"), InputTableSelect = defineComponent({
|
|
|
4476
4502
|
onClose: onCloseTableDialog
|
|
4477
4503
|
}, {
|
|
4478
4504
|
default: () => [ createVNode("div", {
|
|
4479
|
-
class: ns$
|
|
4505
|
+
class: ns$9.em("input-table", "content")
|
|
4480
4506
|
}, [ createVNode(ElRadioGroup, {
|
|
4481
4507
|
modelValue: sinleSelection.value
|
|
4482
4508
|
}, {
|
|
@@ -4499,7 +4525,7 @@ const ns$8 = useNamespace("form"), InputTableSelect = defineComponent({
|
|
|
4499
4525
|
}) ]
|
|
4500
4526
|
}) ]
|
|
4501
4527
|
}) ]), createVNode("div", {
|
|
4502
|
-
class: ns$
|
|
4528
|
+
class: ns$9.em("input-table", "footer")
|
|
4503
4529
|
}, [ createVNode(ElButton, {
|
|
4504
4530
|
onClick: onResetTableSelect
|
|
4505
4531
|
}, _isSlot$3(_slot = t("next.form.reset")) ? _slot : {
|
|
@@ -4515,7 +4541,7 @@ const ns$8 = useNamespace("form"), InputTableSelect = defineComponent({
|
|
|
4515
4541
|
};
|
|
4516
4542
|
return () => createVNode(Fragment, null, [ renderContent() ]);
|
|
4517
4543
|
}
|
|
4518
|
-
}), ns$
|
|
4544
|
+
}), ns$8 = useNamespace("form");
|
|
4519
4545
|
|
|
4520
4546
|
var UploadImage = defineComponent({
|
|
4521
4547
|
name: "UploadImage",
|
|
@@ -4572,7 +4598,7 @@ var UploadImage = defineComponent({
|
|
|
4572
4598
|
let urls = [];
|
|
4573
4599
|
return "string" == typeof value ? urls = [ value ] : "[object Array]" === Object.prototype.toString.call(value) && (urls = value),
|
|
4574
4600
|
urls = urls.filter((url => !!url)), urls.length ? createVNode(ElImage, {
|
|
4575
|
-
class: ns$
|
|
4601
|
+
class: ns$8.e("preview-image"),
|
|
4576
4602
|
src: urls[0],
|
|
4577
4603
|
previewSrcList: urls,
|
|
4578
4604
|
"preview-teleported": !0,
|
|
@@ -4587,7 +4613,7 @@ var UploadImage = defineComponent({
|
|
|
4587
4613
|
})
|
|
4588
4614
|
}) : null;
|
|
4589
4615
|
})(), _disabled ? null : createVNode(ElUpload, {
|
|
4590
|
-
class: [ ns$
|
|
4616
|
+
class: [ ns$8.b("upload-image"), props.className ],
|
|
4591
4617
|
style: props.style,
|
|
4592
4618
|
"list-type": props.listType,
|
|
4593
4619
|
multiple: props.multiple,
|
|
@@ -4725,9 +4751,9 @@ function _isSlot$2(s) {
|
|
|
4725
4751
|
return "function" == typeof s || "[object Object]" === Object.prototype.toString.call(s) && !isVNode(s);
|
|
4726
4752
|
}
|
|
4727
4753
|
|
|
4728
|
-
const ns$
|
|
4754
|
+
const ns$7 = useNamespace("form");
|
|
4729
4755
|
|
|
4730
|
-
var Element$
|
|
4756
|
+
var Element$7 = defineComponent({
|
|
4731
4757
|
name: "NextForm",
|
|
4732
4758
|
props: {
|
|
4733
4759
|
options: {
|
|
@@ -4745,7 +4771,7 @@ var Element$6 = defineComponent({
|
|
|
4745
4771
|
},
|
|
4746
4772
|
emits: [ "submit", "close", "reset" ],
|
|
4747
4773
|
setup(props, {slots: slots, emit: emit, expose: expose}) {
|
|
4748
|
-
const _config = deepClone(defaultConfig$
|
|
4774
|
+
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
4775
|
watch((() => [ props.columns, props.formDatum ]), (() => {
|
|
4750
4776
|
(() => {
|
|
4751
4777
|
const columns = props.columns;
|
|
@@ -5096,7 +5122,7 @@ var Element$6 = defineComponent({
|
|
|
5096
5122
|
let _slot;
|
|
5097
5123
|
return createVNode(ElForm, {
|
|
5098
5124
|
ref: ruleFormRef,
|
|
5099
|
-
class: ns$
|
|
5125
|
+
class: ns$7.b(),
|
|
5100
5126
|
inline: !1,
|
|
5101
5127
|
model: formParams,
|
|
5102
5128
|
size: options.size
|
|
@@ -5116,7 +5142,7 @@ var Element$6 = defineComponent({
|
|
|
5116
5142
|
}, {
|
|
5117
5143
|
label: () => column.label ? createVNode(Fragment, null, [ createVNode(NextTextEllipsis, {
|
|
5118
5144
|
content: t(column.label),
|
|
5119
|
-
class: ns$
|
|
5145
|
+
class: ns$7.e("item-label")
|
|
5120
5146
|
}, null), column.tip ? createVNode(ElTooltip, {
|
|
5121
5147
|
effect: "dark",
|
|
5122
5148
|
content: column.tip,
|
|
@@ -5136,7 +5162,7 @@ var Element$6 = defineComponent({
|
|
|
5136
5162
|
})))) ? _slot : {
|
|
5137
5163
|
default: () => [ _slot ]
|
|
5138
5164
|
}), _isEditing.value && options.showFooter ? createVNode("div", {
|
|
5139
|
-
class: ns$
|
|
5165
|
+
class: ns$7.e("footer")
|
|
5140
5166
|
}, [ createVNode(ElButton, {
|
|
5141
5167
|
type: "primary",
|
|
5142
5168
|
loading: submitLoading.value,
|
|
@@ -5156,7 +5182,7 @@ var Element$6 = defineComponent({
|
|
|
5156
5182
|
}
|
|
5157
5183
|
});
|
|
5158
5184
|
|
|
5159
|
-
const NextTreeSelect = withInstall(treeSelect), NextForm = withInstall(Element$
|
|
5185
|
+
const NextTreeSelect = withInstall(treeSelect), NextForm = withInstall(Element$7);
|
|
5160
5186
|
|
|
5161
5187
|
var AddEditForm = defineComponent({
|
|
5162
5188
|
name: "AddEditForm",
|
|
@@ -5213,18 +5239,18 @@ function _isSlot(s) {
|
|
|
5213
5239
|
return "function" == typeof s || "[object Object]" === Object.prototype.toString.call(s) && !isVNode(s);
|
|
5214
5240
|
}
|
|
5215
5241
|
|
|
5216
|
-
const ns$
|
|
5242
|
+
const ns$6 = useNamespace("crud-table");
|
|
5217
5243
|
|
|
5218
|
-
var Element$
|
|
5244
|
+
var Element$6 = defineComponent({
|
|
5219
5245
|
name: "NextCrudTable",
|
|
5220
5246
|
props: defaultPropsConfig,
|
|
5221
5247
|
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
5248
|
setup(props, {emit: emit, slots: slots, expose: expose}) {
|
|
5223
|
-
const _config = deepClone(defaultConfig$
|
|
5249
|
+
const _config = deepClone(defaultConfig$4), _options = computed((() => {
|
|
5224
5250
|
const cfg = unref(props.options);
|
|
5225
5251
|
return merge$1(_config, cfg);
|
|
5226
5252
|
})), options = unref(_options);
|
|
5227
|
-
provide("options", computed((() => _options.value))), provide("ns", ns$
|
|
5253
|
+
provide("options", computed((() => _options.value))), provide("ns", ns$6);
|
|
5228
5254
|
const {t: t} = useLocale(), _columns = ref(options.columns), _searchColumns = ref([]), _formColumns = ref([]), _updateColumnsAll = ops => {
|
|
5229
5255
|
((options, cb) => {
|
|
5230
5256
|
const _columns = reactive(options.columns), _loadDicData = col => {
|
|
@@ -5467,11 +5493,11 @@ var Element$5 = defineComponent({
|
|
|
5467
5493
|
});
|
|
5468
5494
|
return () => createVNode(Fragment, null, [ createVNode(Fragment, null, [ createVNode("div", {
|
|
5469
5495
|
ref: crudTableRef,
|
|
5470
|
-
class: [ ns$
|
|
5496
|
+
class: [ ns$6.b(), props.className ],
|
|
5471
5497
|
style: props.style
|
|
5472
5498
|
}, [ options.showSearchForm || options.showHeaderMenu ? createVNode("header", {
|
|
5473
5499
|
ref: headerRef,
|
|
5474
|
-
class: ns$
|
|
5500
|
+
class: ns$6.b("header")
|
|
5475
5501
|
}, [ options.showSearchForm && createVNode(HeaderSearch, {
|
|
5476
5502
|
columns: _searchColumns.value,
|
|
5477
5503
|
onZoomResize: updateTableContentHeight,
|
|
@@ -5490,7 +5516,7 @@ var Element$5 = defineComponent({
|
|
|
5490
5516
|
}, {
|
|
5491
5517
|
default: () => [ createVNode("div", {
|
|
5492
5518
|
ref: tableRef,
|
|
5493
|
-
class: ns$
|
|
5519
|
+
class: ns$6.b("content")
|
|
5494
5520
|
}, [ createVNode(ElTable, {
|
|
5495
5521
|
data: tableData.value,
|
|
5496
5522
|
height: tableContentHeight.value,
|
|
@@ -5553,7 +5579,7 @@ var Element$5 = defineComponent({
|
|
|
5553
5579
|
}) ]) ]
|
|
5554
5580
|
}), options.isPagination ? createVNode("div", {
|
|
5555
5581
|
ref: footerRef,
|
|
5556
|
-
class: ns$
|
|
5582
|
+
class: ns$6.b("footer")
|
|
5557
5583
|
}, [ createVNode(FooterPagination, {
|
|
5558
5584
|
page: props.page,
|
|
5559
5585
|
onChange: onChangePagination
|
|
@@ -5580,7 +5606,7 @@ var Element$5 = defineComponent({
|
|
|
5580
5606
|
}
|
|
5581
5607
|
});
|
|
5582
5608
|
|
|
5583
|
-
const NextCrudTable = withInstall(Element$
|
|
5609
|
+
const NextCrudTable = withInstall(Element$6);
|
|
5584
5610
|
|
|
5585
5611
|
var propsConfig = {
|
|
5586
5612
|
className: {
|
|
@@ -5611,15 +5637,15 @@ var propsConfig = {
|
|
|
5611
5637
|
total: 0
|
|
5612
5638
|
})
|
|
5613
5639
|
}
|
|
5614
|
-
}, defaultConfig$
|
|
5640
|
+
}, defaultConfig$2 = {};
|
|
5615
5641
|
|
|
5616
|
-
const ns$
|
|
5642
|
+
const ns$5 = useNamespace("crud-table-virtualized");
|
|
5617
5643
|
|
|
5618
5644
|
const NextCrudTableVirtualized = withInstall(defineComponent({
|
|
5619
5645
|
name: "NextCrudTableVirtualized",
|
|
5620
5646
|
props: propsConfig,
|
|
5621
5647
|
setup(props, {emit: emit}) {
|
|
5622
|
-
const _config = deepClone(defaultConfig$
|
|
5648
|
+
const _config = deepClone(defaultConfig$2), _options = computed((() => {
|
|
5623
5649
|
const cfg = unref(props.options);
|
|
5624
5650
|
return merge$1(_config, cfg);
|
|
5625
5651
|
})), options = unref(_options);
|
|
@@ -5634,7 +5660,7 @@ const NextCrudTableVirtualized = withInstall(defineComponent({
|
|
|
5634
5660
|
emit("close-add-edit");
|
|
5635
5661
|
};
|
|
5636
5662
|
return () => createVNode(Fragment, null, [ createVNode("div", {
|
|
5637
|
-
class: [ ns$
|
|
5663
|
+
class: [ ns$5.b(), props.className ]
|
|
5638
5664
|
}, [ createVNode(NextSpinLoading, null, null), createVNode(NextDialog, {
|
|
5639
5665
|
modelValue: addEditDialog.visible,
|
|
5640
5666
|
"onUpdate:modelValue": $event => addEditDialog.visible = $event,
|
|
@@ -5645,7 +5671,7 @@ const NextCrudTableVirtualized = withInstall(defineComponent({
|
|
|
5645
5671
|
onClose: onCloseAddEditDialog
|
|
5646
5672
|
}, null) ]) ]);
|
|
5647
5673
|
}
|
|
5648
|
-
})), NextSpinLoading = withInstall(NextSpinLoading$1), ns$
|
|
5674
|
+
})), NextSpinLoading = withInstall(NextSpinLoading$1), ns$4 = useNamespace("upload");
|
|
5649
5675
|
|
|
5650
5676
|
const NextUpload = withInstall(defineComponent({
|
|
5651
5677
|
name: "NextUpload",
|
|
@@ -5680,7 +5706,7 @@ const NextUpload = withInstall(defineComponent({
|
|
|
5680
5706
|
const slots = this.$slots, props = this.$props, emit = this.$emit, _t = this.t, uploadfilesPreview = ref([]), body = document.getElementsByTagName("body")[0];
|
|
5681
5707
|
let previewImagesContainer = null;
|
|
5682
5708
|
return createVNode(ElUpload, {
|
|
5683
|
-
class: [ ns$
|
|
5709
|
+
class: [ ns$4.b(), props.className ],
|
|
5684
5710
|
style: props.style,
|
|
5685
5711
|
"list-type": props.listType,
|
|
5686
5712
|
"auto-upload": !1,
|
|
@@ -5718,9 +5744,9 @@ const NextUpload = withInstall(defineComponent({
|
|
|
5718
5744
|
})
|
|
5719
5745
|
});
|
|
5720
5746
|
}
|
|
5721
|
-
})), ns$
|
|
5747
|
+
})), ns$3 = useNamespace("video-player");
|
|
5722
5748
|
|
|
5723
|
-
var Element$
|
|
5749
|
+
var Element$3 = defineComponent({
|
|
5724
5750
|
name: "NextVideoPlayer",
|
|
5725
5751
|
props: {
|
|
5726
5752
|
className: {
|
|
@@ -5793,7 +5819,7 @@ var Element$2 = defineComponent({
|
|
|
5793
5819
|
if (!classNames || !classNames.length) throw new Error("模型类别不能未空!");
|
|
5794
5820
|
container.innerHTML = "", tf.loadGraphModel(modelUrl).then((model => {
|
|
5795
5821
|
const canvas = document.createElement("canvas");
|
|
5796
|
-
canvas.className = ns$
|
|
5822
|
+
canvas.className = ns$3.b("recongition"), container.appendChild(canvas);
|
|
5797
5823
|
const ctx = canvas.getContext("2d"), detect_ctx = document.createElement("canvas").getContext("2d");
|
|
5798
5824
|
video.ontimeupdate = () => {
|
|
5799
5825
|
const {videoWidth: videoWidth, videoHeight: videoHeight, offsetTop: offsetTop, offsetLeft: offsetLeft} = video;
|
|
@@ -5964,13 +5990,13 @@ var Element$2 = defineComponent({
|
|
|
5964
5990
|
});
|
|
5965
5991
|
return () => createVNode(Fragment, null, [ createVNode("div", {
|
|
5966
5992
|
ref: videoBoxRef,
|
|
5967
|
-
class: [ ns$
|
|
5993
|
+
class: [ ns$3.b(), props.className ],
|
|
5968
5994
|
style: props.style
|
|
5969
5995
|
}, null) ]);
|
|
5970
5996
|
}
|
|
5971
5997
|
});
|
|
5972
5998
|
|
|
5973
|
-
const NextVideoPlayer = withInstall(Element$
|
|
5999
|
+
const NextVideoPlayer = withInstall(Element$3);
|
|
5974
6000
|
|
|
5975
6001
|
const NextDragResize = withInstall(defineComponent({
|
|
5976
6002
|
name: "NextDragResize",
|
|
@@ -6088,7 +6114,7 @@ var ToolHeader = defineComponent({
|
|
|
6088
6114
|
}
|
|
6089
6115
|
});
|
|
6090
6116
|
|
|
6091
|
-
const colors = [ "#5470c6", "#91cc75", "#fac858", "#ee6666", "#73c0de", "#3ba272", "#fc8452", "#9a60b4", "#ea7ccc" ], convertToLabel = rect => {
|
|
6117
|
+
const colors$1 = [ "#5470c6", "#91cc75", "#fac858", "#ee6666", "#73c0de", "#3ba272", "#fc8452", "#9a60b4", "#ea7ccc" ], convertToLabel = rect => {
|
|
6092
6118
|
const label_type = rect.type, x_center = rect.startX + rect.rectWidth / 2, y_center = rect.startY + rect.rectHeight / 2;
|
|
6093
6119
|
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
6120
|
}, canvertToCanvas = (labelData, canvasWidth, canvasHeight) => {
|
|
@@ -6173,7 +6199,7 @@ var ContextMenuLabel = defineComponent({
|
|
|
6173
6199
|
}
|
|
6174
6200
|
}, [ createVNode("span", {
|
|
6175
6201
|
style: {
|
|
6176
|
-
"background-color": colors[index % colors.length]
|
|
6202
|
+
"background-color": colors$1[index % colors$1.length]
|
|
6177
6203
|
},
|
|
6178
6204
|
class: "label-line"
|
|
6179
6205
|
}, null), createVNode("span", null, [ name ]) ]))) ]), isValueExist(activateIndex.value) ? createVNode("div", {
|
|
@@ -6361,7 +6387,7 @@ var DraggableRect = defineComponent({
|
|
|
6361
6387
|
onMousedown: event => this.onMousedownDot(event, "bottomRight")
|
|
6362
6388
|
}, null) ]) ]);
|
|
6363
6389
|
}
|
|
6364
|
-
}), CanvasContext = defineComponent({
|
|
6390
|
+
}), CanvasContext$1 = defineComponent({
|
|
6365
6391
|
name: "NextCanvasContext",
|
|
6366
6392
|
props: {
|
|
6367
6393
|
classes: {
|
|
@@ -6427,7 +6453,7 @@ var DraggableRect = defineComponent({
|
|
|
6427
6453
|
const {ctx: ctx, labels: labels, image: image, canvasWidth: canvasWidth, canvasHeight: canvasHeight} = options, updateLabels = () => {
|
|
6428
6454
|
ctx.clearRect(0, 0, canvasWidth, canvasHeight), ctx.drawImage(image, 0, 0, canvasWidth, canvasHeight);
|
|
6429
6455
|
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];
|
|
6456
|
+
const rect = labels[i], {startX: startX, startY: startY, rectWidth: rectWidth, rectHeight: rectHeight, type: type} = rect, color = colors$1[type % colors$1.length];
|
|
6431
6457
|
if (ctx.font = "bold 14px serif", ctx.textBaseline = "top", ctx.save(), ctx.strokeStyle = color,
|
|
6432
6458
|
ctx.strokeRect(startX, startY, rectWidth, rectHeight), isValueExist(rect.typeName) || isValueExist(rect.type)) {
|
|
6433
6459
|
const text = rect.typeName || rect.type;
|
|
@@ -6447,7 +6473,7 @@ var DraggableRect = defineComponent({
|
|
|
6447
6473
|
for (let i = 0; i < labels.length; i++) {
|
|
6448
6474
|
const rect = labels[i], {type: type, startX: startX, startY: startY, rectWidth: rectWidth, rectHeight: rectHeight} = rect;
|
|
6449
6475
|
x >= startX && x <= startX + rectWidth && y >= startY && y <= startY + rectHeight && (hit_rect = rect,
|
|
6450
|
-
hit_index = i, color = colors[type]);
|
|
6476
|
+
hit_index = i, color = colors$1[type]);
|
|
6451
6477
|
}
|
|
6452
6478
|
return {
|
|
6453
6479
|
hit_rect: hit_rect,
|
|
@@ -6637,7 +6663,7 @@ var DraggableRect = defineComponent({
|
|
|
6637
6663
|
onCloseContentmenuLabel: onCloseContentmenuLabel,
|
|
6638
6664
|
onSelectedLabel: (rect, index) => {
|
|
6639
6665
|
onCloseDraggableRectFixed(), nextTick((() => {
|
|
6640
|
-
const {startX: x, startY: y, type: type} = rect, color = colors[type];
|
|
6666
|
+
const {startX: x, startY: y, type: type} = rect, color = colors$1[type];
|
|
6641
6667
|
updateDraggableRectFixed(x, y, labels.value[index], index, color);
|
|
6642
6668
|
}));
|
|
6643
6669
|
},
|
|
@@ -6718,7 +6744,7 @@ var DraggableRect = defineComponent({
|
|
|
6718
6744
|
})(rect, index)
|
|
6719
6745
|
}, [ createVNode("div", null, [ createVNode("span", {
|
|
6720
6746
|
style: {
|
|
6721
|
-
"background-color": colors[rect.type]
|
|
6747
|
+
"background-color": colors$1[rect.type]
|
|
6722
6748
|
},
|
|
6723
6749
|
class: "label-line"
|
|
6724
6750
|
}, null), createVNode("span", null, [ rect.typeName ]) ]), createVNode(ElPopconfirm, {
|
|
@@ -6743,13 +6769,13 @@ var DraggableRect = defineComponent({
|
|
|
6743
6769
|
}, null) ]);
|
|
6744
6770
|
return () => createVNode(Fragment, null, [ renderContent() ]);
|
|
6745
6771
|
}
|
|
6746
|
-
}), defaultConfig = {
|
|
6772
|
+
}), defaultConfig$1 = {
|
|
6747
6773
|
minContentHeight: 500
|
|
6748
6774
|
};
|
|
6749
6775
|
|
|
6750
|
-
const ns$
|
|
6776
|
+
const ns$2 = useNamespace("labelimg");
|
|
6751
6777
|
|
|
6752
|
-
var Element = defineComponent({
|
|
6778
|
+
var Element$1 = defineComponent({
|
|
6753
6779
|
name: "NextLabelimg",
|
|
6754
6780
|
props: {
|
|
6755
6781
|
className: {
|
|
@@ -6760,10 +6786,6 @@ var Element = defineComponent({
|
|
|
6760
6786
|
type: Object,
|
|
6761
6787
|
default: () => ({})
|
|
6762
6788
|
},
|
|
6763
|
-
rowKey: {
|
|
6764
|
-
type: String,
|
|
6765
|
-
default: "id"
|
|
6766
|
-
},
|
|
6767
6789
|
options: {
|
|
6768
6790
|
type: Object,
|
|
6769
6791
|
default: () => ({})
|
|
@@ -6779,11 +6801,11 @@ var Element = defineComponent({
|
|
|
6779
6801
|
},
|
|
6780
6802
|
emits: [ "change", "save", "prev-click", "next-click" ],
|
|
6781
6803
|
setup(props, {emit: emit, slots: slots, expose: expose}) {
|
|
6782
|
-
const {t: t} = useLocale(), _config = deepClone(defaultConfig), _options = computed((() => {
|
|
6804
|
+
const {t: t} = useLocale(), _config = deepClone(defaultConfig$1), _options = computed((() => {
|
|
6783
6805
|
const cfg = unref(props.options);
|
|
6784
6806
|
return merge$1(_config, cfg);
|
|
6785
6807
|
})), options = unref(_options);
|
|
6786
|
-
provide("ns", ns$
|
|
6808
|
+
provide("ns", ns$2), provide("_emit", emit);
|
|
6787
6809
|
const activateNodeIndex = ref(0), classes = ref(props.classes), labelImages = ref(deepClone(props.data));
|
|
6788
6810
|
watch((() => props.data), (data => {
|
|
6789
6811
|
labelImages.value = deepClone(data);
|
|
@@ -6817,7 +6839,10 @@ var Element = defineComponent({
|
|
|
6817
6839
|
node: node,
|
|
6818
6840
|
label_txt: yolo_label.join("\n")
|
|
6819
6841
|
};
|
|
6820
|
-
}, isChangeNodeLabels = () =>
|
|
6842
|
+
}, isChangeNodeLabels = () => {
|
|
6843
|
+
const node = labelImages.value[activateNodeIndex.value];
|
|
6844
|
+
return isEqual(toRaw(node.labels).map((rect => convertToLabel(rect))), currentNode.value.labels.map((rect => convertToLabel(rect))));
|
|
6845
|
+
}, switchKeydownAD = e => {
|
|
6821
6846
|
const imageLength = labelImages.value.length;
|
|
6822
6847
|
"KeyD" === e.code ? (activateNodeIndex.value++, activateNodeIndex.value >= imageLength && (activateNodeIndex.value = 0)) : "KeyA" === e.code && (activateNodeIndex.value--,
|
|
6823
6848
|
activateNodeIndex.value < 0 && (activateNodeIndex.value = imageLength - 1));
|
|
@@ -6887,19 +6912,19 @@ var Element = defineComponent({
|
|
|
6887
6912
|
});
|
|
6888
6913
|
const renderContent = () => createVNode("div", {
|
|
6889
6914
|
ref: layoutLabelRef,
|
|
6890
|
-
class: [ ns$
|
|
6915
|
+
class: [ ns$2.b(), props.className, isFullscreen.value ? ns$2.b("fullscreen") : "" ],
|
|
6891
6916
|
style: {
|
|
6892
6917
|
...props.style
|
|
6893
6918
|
}
|
|
6894
6919
|
}, [ createVNode(NextSpinLoading$1, {
|
|
6895
6920
|
loading: loading.value,
|
|
6896
6921
|
tip: t("next.labelimg.saveTxt"),
|
|
6897
|
-
class: [ ns$
|
|
6922
|
+
class: [ ns$2.b("loading") ]
|
|
6898
6923
|
}, {
|
|
6899
6924
|
default: () => [ createVNode(ElScrollbar, null, {
|
|
6900
6925
|
default: () => [ createVNode("header", {
|
|
6901
6926
|
ref: headerRef,
|
|
6902
|
-
class: [ ns$
|
|
6927
|
+
class: [ ns$2.b("header") ]
|
|
6903
6928
|
}, [ slots.header ? slots.header() : createVNode(ToolHeader, {
|
|
6904
6929
|
isFullscreen: isFullscreen.value,
|
|
6905
6930
|
imageIndex: activateNodeIndex.value,
|
|
@@ -6913,16 +6938,16 @@ var Element = defineComponent({
|
|
|
6913
6938
|
}
|
|
6914
6939
|
}, null) ]), createVNode("div", {
|
|
6915
6940
|
ref: mainRef,
|
|
6916
|
-
class: [ ns$
|
|
6941
|
+
class: [ ns$2.b("main") ]
|
|
6917
6942
|
}, [ createVNode(ElScrollbar, {
|
|
6918
|
-
class: [ ns$
|
|
6943
|
+
class: [ ns$2.be("main", "content") ]
|
|
6919
6944
|
}, {
|
|
6920
6945
|
default: () => [ createVNode("div", {
|
|
6921
|
-
class: [ ns$
|
|
6946
|
+
class: [ ns$2.be("main", "content") ],
|
|
6922
6947
|
style: {
|
|
6923
6948
|
height: mainContentHeight.value + "px"
|
|
6924
6949
|
}
|
|
6925
|
-
}, [ createVNode(CanvasContext, {
|
|
6950
|
+
}, [ createVNode(CanvasContext$1, {
|
|
6926
6951
|
ref: canvasContextRef,
|
|
6927
6952
|
contextClientHeight: mainContentHeight.value,
|
|
6928
6953
|
classes: classes.value,
|
|
@@ -6937,9 +6962,9 @@ var Element = defineComponent({
|
|
|
6937
6962
|
onSelect: onSelectLabelNode
|
|
6938
6963
|
}, null) ]), createVNode("footer", {
|
|
6939
6964
|
ref: footerRef,
|
|
6940
|
-
class: [ ns$
|
|
6965
|
+
class: [ ns$2.b("footer") ]
|
|
6941
6966
|
}, [ createVNode("div", {
|
|
6942
|
-
class: [ ns$
|
|
6967
|
+
class: [ ns$2.be("footer", "left") ]
|
|
6943
6968
|
}, [ createVNode(ElIcon, {
|
|
6944
6969
|
size: 24,
|
|
6945
6970
|
color: "#797979",
|
|
@@ -6947,10 +6972,10 @@ var Element = defineComponent({
|
|
|
6947
6972
|
}, {
|
|
6948
6973
|
default: () => [ createVNode(arrow_left_default, null, null) ]
|
|
6949
6974
|
}) ]), createVNode("div", {
|
|
6950
|
-
class: [ ns$
|
|
6975
|
+
class: [ ns$2.be("footer", "center") ]
|
|
6951
6976
|
}, [ createVNode(ElScrollbar, null, {
|
|
6952
6977
|
default: () => [ createVNode("ul", {
|
|
6953
|
-
class: [ ns$
|
|
6978
|
+
class: [ ns$2.bem("footer", "center", "list") ]
|
|
6954
6979
|
}, [ labelImages.value.map(((item, index) => createVNode("li", {
|
|
6955
6980
|
key: index,
|
|
6956
6981
|
onClick: () => onChangeActivateNode(index),
|
|
@@ -6966,7 +6991,7 @@ var Element = defineComponent({
|
|
|
6966
6991
|
fit: "cover"
|
|
6967
6992
|
}, null) ]))) ]) ]
|
|
6968
6993
|
}) ]), createVNode("div", {
|
|
6969
|
-
class: [ ns$
|
|
6994
|
+
class: [ ns$2.be("footer", "right") ]
|
|
6970
6995
|
}, [ createVNode(ElIcon, {
|
|
6971
6996
|
size: 24,
|
|
6972
6997
|
color: "#797979",
|
|
@@ -6980,7 +7005,7 @@ var Element = defineComponent({
|
|
|
6980
7005
|
}
|
|
6981
7006
|
});
|
|
6982
7007
|
|
|
6983
|
-
const ns = useNamespace("labelimg-preview");
|
|
7008
|
+
const ns$1 = useNamespace("labelimg-preview");
|
|
6984
7009
|
|
|
6985
7010
|
var preview = defineComponent({
|
|
6986
7011
|
name: "NextLabelimgPreview",
|
|
@@ -7017,7 +7042,7 @@ var preview = defineComponent({
|
|
|
7017
7042
|
canvasBaseRef.value.style.width = canvasWidth + "px", canvasBaseRef.value.style.height = canvasHeight + "px";
|
|
7018
7043
|
})(canvasWidth, canvasHeight), ctx.clearRect(0, 0, canvasWidth, canvasHeight), ctx.drawImage(image, 0, 0, canvasWidth, canvasHeight);
|
|
7019
7044
|
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];
|
|
7045
|
+
const rect = labels.value[i], {startX: startX, startY: startY, rectWidth: rectWidth, rectHeight: rectHeight, type: type} = rect, color = colors$1[type % colors$1.length];
|
|
7021
7046
|
if (ctx.font = "bold 14px serif", ctx.textBaseline = "top", ctx.save(), ctx.strokeStyle = color,
|
|
7022
7047
|
ctx.strokeRect(startX, startY, rectWidth, rectHeight), !isValueExist(rect.typeName)) {
|
|
7023
7048
|
const typeName = classes.value[rect.type];
|
|
@@ -7040,7 +7065,7 @@ var preview = defineComponent({
|
|
|
7040
7065
|
});
|
|
7041
7066
|
}));
|
|
7042
7067
|
return () => createVNode(Fragment, null, [ createVNode("div", {
|
|
7043
|
-
class: [ ns.b(), props.className ],
|
|
7068
|
+
class: [ ns$1.b(), props.className ],
|
|
7044
7069
|
style: {
|
|
7045
7070
|
...props.style
|
|
7046
7071
|
}
|
|
@@ -7050,7 +7075,685 @@ var preview = defineComponent({
|
|
|
7050
7075
|
}
|
|
7051
7076
|
});
|
|
7052
7077
|
|
|
7053
|
-
const NextLabelimg = withInstall(Element), NextLabelimgPreview = withInstall(preview);
|
|
7078
|
+
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" ];
|
|
7079
|
+
|
|
7080
|
+
class CreatePolygonVertexes {
|
|
7081
|
+
canvas;
|
|
7082
|
+
ctx;
|
|
7083
|
+
vertexes;
|
|
7084
|
+
isDrawing;
|
|
7085
|
+
mouseOffset;
|
|
7086
|
+
vertexesObservers=[];
|
|
7087
|
+
destroyedObservers;
|
|
7088
|
+
constructor(canvas, ctx) {
|
|
7089
|
+
this.canvas = canvas, this.ctx = ctx, this.isDrawing = !1, this.vertexes = [], this.mouseOffset = {
|
|
7090
|
+
x: 0,
|
|
7091
|
+
y: 0
|
|
7092
|
+
}, canvas.addEventListener("click", this.canvasMouseClick.bind(this)), canvas.addEventListener("mousemove", this.canvasMousemove.bind(this)),
|
|
7093
|
+
canvas.addEventListener("dblclick", this.canvasMouseDblclick.bind(this)), this.vertexes = new Proxy(this.vertexes, {
|
|
7094
|
+
set: (target, property, value) => (target[property] = value, this.notifyVertexChangeListeners(),
|
|
7095
|
+
!0)
|
|
7096
|
+
}), this.mouseOffset = new Proxy(this.mouseOffset, {
|
|
7097
|
+
set: (target, property, value) => (target[property] = value, this.notifyVertexChangeListeners(),
|
|
7098
|
+
!0)
|
|
7099
|
+
});
|
|
7100
|
+
}
|
|
7101
|
+
notifyVertexChangeListeners() {
|
|
7102
|
+
this.vertexesObservers.forEach((listener => {
|
|
7103
|
+
listener(this.vertexes, this.mouseOffset);
|
|
7104
|
+
}));
|
|
7105
|
+
}
|
|
7106
|
+
vertexesChangeEventListener(listener) {
|
|
7107
|
+
this.vertexesObservers.push(listener);
|
|
7108
|
+
}
|
|
7109
|
+
notifyDestryedListerers() {
|
|
7110
|
+
this.destroyedObservers(this.vertexes);
|
|
7111
|
+
}
|
|
7112
|
+
onDestroyed(callback) {
|
|
7113
|
+
this.destroyedObservers = callback;
|
|
7114
|
+
}
|
|
7115
|
+
canvasMouseClick(e) {
|
|
7116
|
+
e.stopPropagation(), this.isDrawing = !0, this.mouseOffset.x = e.offsetX, this.mouseOffset.y = e.offsetY,
|
|
7117
|
+
this.vertexes.push([ e.offsetX, e.offsetY ]), this.vertexes = vertexesUnique(this.vertexes);
|
|
7118
|
+
}
|
|
7119
|
+
canvasMousemove(e) {
|
|
7120
|
+
e.stopPropagation(), this.isDrawing && (this.mouseOffset.x = e.offsetX, this.mouseOffset.y = e.offsetY,
|
|
7121
|
+
this.canvas.style.cursor = "crosshair");
|
|
7122
|
+
}
|
|
7123
|
+
canvasMouseDblclick(e) {
|
|
7124
|
+
e.stopPropagation(), this.isDrawing && (this.canvas.style.cursor = "unset", this.mouseOffset.x = e.offsetX,
|
|
7125
|
+
this.mouseOffset.y = e.offsetY, this.vertexes.push([ e.offsetX, e.offsetY ]), this.vertexes = vertexesUnique(this.vertexes)),
|
|
7126
|
+
this.notifyDestryedListerers(), this.destroyed();
|
|
7127
|
+
}
|
|
7128
|
+
destroyed() {
|
|
7129
|
+
this.isDrawing = !1, this.vertexes = [], this.vertexesObservers = [], this.destroyedObservers = () => {
|
|
7130
|
+
this.canvas.removeEventListener("click", this.canvasMouseClick);
|
|
7131
|
+
}, this.canvas.removeEventListener("mousemove", this.canvasMousemove), this.canvas.removeEventListener("dblclick", this.canvasMouseDblclick);
|
|
7132
|
+
}
|
|
7133
|
+
}
|
|
7134
|
+
|
|
7135
|
+
class EditPolygonPath {
|
|
7136
|
+
canvas;
|
|
7137
|
+
ctx;
|
|
7138
|
+
vertexes;
|
|
7139
|
+
isEditing;
|
|
7140
|
+
isMoveEditing;
|
|
7141
|
+
canClickEvent;
|
|
7142
|
+
pointVertexIndex;
|
|
7143
|
+
pointCentreIndex;
|
|
7144
|
+
vertexRadius;
|
|
7145
|
+
edgeCentreRadius;
|
|
7146
|
+
observers=[];
|
|
7147
|
+
constructor(canvas, ctx) {
|
|
7148
|
+
this.canvas = canvas, this.ctx = ctx, this.vertexes = [], this.isEditing = !1, this.canClickEvent = !0,
|
|
7149
|
+
this.isMoveEditing = !1, this.pointVertexIndex = -1, this.pointCentreIndex = -1,
|
|
7150
|
+
this.vertexRadius = 8, this.edgeCentreRadius = 5;
|
|
7151
|
+
}
|
|
7152
|
+
drawPolygonPath(vertexes, mouseX, mouseY) {
|
|
7153
|
+
const ctx = this.ctx;
|
|
7154
|
+
if (!vertexes.length) return;
|
|
7155
|
+
ctx.beginPath(), ctx.lineWidth = 3, ctx.strokeStyle = "#5470c6", ctx.fillStyle = hexToRgba("#5470c6", .2),
|
|
7156
|
+
ctx.moveTo(vertexes[0][0], vertexes[0][1]);
|
|
7157
|
+
for (let i = 1; i < vertexes.length; i++) {
|
|
7158
|
+
const [x, y] = vertexes[i];
|
|
7159
|
+
ctx.lineTo(x, y);
|
|
7160
|
+
}
|
|
7161
|
+
isNaN(mouseX) || isNaN(mouseY) || ctx.lineTo(mouseX, mouseY), ctx.closePath(), ctx.stroke(),
|
|
7162
|
+
ctx.fill();
|
|
7163
|
+
}
|
|
7164
|
+
drawPolygonEdgeCentre(vertexes) {
|
|
7165
|
+
const ctx = this.ctx;
|
|
7166
|
+
for (let i = 0; i < vertexes.length; i++) {
|
|
7167
|
+
const [x, y] = vertexes[i];
|
|
7168
|
+
ctx.beginPath(), ctx.fillStyle = "#5470c6", ctx.arc(x, y, this.vertexRadius, 0, 2 * Math.PI),
|
|
7169
|
+
ctx.closePath(), ctx.fill(), ctx.beginPath(), ctx.fillStyle = "#FFFFFF", ctx.arc(x, y, this.vertexRadius - 3, 0, 2 * Math.PI),
|
|
7170
|
+
ctx.closePath(), ctx.fill();
|
|
7171
|
+
}
|
|
7172
|
+
for (let i = 0; i < vertexes.length; i++) {
|
|
7173
|
+
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;
|
|
7174
|
+
ctx.beginPath(), ctx.fillStyle = "#5470c6", ctx.arc(x, y, this.edgeCentreRadius, 0, 2 * Math.PI),
|
|
7175
|
+
ctx.closePath(), ctx.fill();
|
|
7176
|
+
}
|
|
7177
|
+
}
|
|
7178
|
+
drawPolygon(vertexes, mouseOffset) {
|
|
7179
|
+
this.vertexes = vertexes, mouseOffset ? this.drawPolygonPath(vertexes, mouseOffset.x, mouseOffset.y) : (this.drawPolygonPath(vertexes),
|
|
7180
|
+
this.drawPolygonEdgeCentre(vertexes));
|
|
7181
|
+
}
|
|
7182
|
+
pointInVertexes(x, y) {
|
|
7183
|
+
const vertexes = this.vertexes;
|
|
7184
|
+
let aimIndex = null;
|
|
7185
|
+
for (let i = 0; i < vertexes.length; i++) {
|
|
7186
|
+
const [vertex_x, vertex_y] = vertexes[i];
|
|
7187
|
+
if (isPointInCircle(x, y, vertex_x, vertex_y, this.vertexRadius)) {
|
|
7188
|
+
this.canvas.style.cursor = "pointer", aimIndex = i;
|
|
7189
|
+
break;
|
|
7190
|
+
}
|
|
7191
|
+
this.canvas.style.cursor = "unset";
|
|
7192
|
+
}
|
|
7193
|
+
return aimIndex;
|
|
7194
|
+
}
|
|
7195
|
+
pointInEdgeCentre(x, y) {
|
|
7196
|
+
const vertexes = this.vertexes;
|
|
7197
|
+
let aimIndex = null;
|
|
7198
|
+
for (let i = 0; i < vertexes.length; i++) {
|
|
7199
|
+
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;
|
|
7200
|
+
if (isPointInCircle(x, y, vertex_x, vertex_y, this.edgeCentreRadius)) {
|
|
7201
|
+
this.canvas.style.cursor = "pointer", aimIndex = i;
|
|
7202
|
+
break;
|
|
7203
|
+
}
|
|
7204
|
+
this.canvas.style.cursor = "unset";
|
|
7205
|
+
}
|
|
7206
|
+
return aimIndex;
|
|
7207
|
+
}
|
|
7208
|
+
pointInVertexesOrEdgeCentre(x, y) {
|
|
7209
|
+
const vertexes = this.vertexes;
|
|
7210
|
+
for (let i = 0; i < vertexes.length; i++) {
|
|
7211
|
+
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);
|
|
7212
|
+
if (isInVertex || isInEdgeCenter) {
|
|
7213
|
+
this.canvas.style.cursor = "pointer";
|
|
7214
|
+
break;
|
|
7215
|
+
}
|
|
7216
|
+
this.canvas.style.cursor = "unset";
|
|
7217
|
+
}
|
|
7218
|
+
}
|
|
7219
|
+
notifyObservers() {
|
|
7220
|
+
this.observers.forEach((listener => {
|
|
7221
|
+
listener(this.vertexes);
|
|
7222
|
+
}));
|
|
7223
|
+
}
|
|
7224
|
+
updatePolygon(callback) {
|
|
7225
|
+
this.isEditing = !0, this.canvas.addEventListener("mousedown", this.canvasMousedown.bind(this)),
|
|
7226
|
+
this.canvas.addEventListener("mouseup", this.canvasMouseup.bind(this)), this.canvas.addEventListener("click", this.canvasMouseClick.bind(this)),
|
|
7227
|
+
this.canvas.addEventListener("mousemove", this.canvasMousemove.bind(this)), this.observers.push(callback);
|
|
7228
|
+
}
|
|
7229
|
+
canvasMousedown(e) {
|
|
7230
|
+
e.stopPropagation(), e.preventDefault(), this.canClickEvent = !0;
|
|
7231
|
+
const {offsetX: x, offsetY: y} = e, vertex_i = this.pointInVertexes(x, y);
|
|
7232
|
+
isValueExist(vertex_i) && (this.isMoveEditing = !0, this.pointVertexIndex = vertex_i,
|
|
7233
|
+
this.vertexes.splice(this.pointVertexIndex, 1, [ x, y ]));
|
|
7234
|
+
const i = this.pointInEdgeCentre(x, y);
|
|
7235
|
+
isValueExist(i) && (this.isMoveEditing = !0, this.pointCentreIndex = i + 1, this.vertexes.splice(this.pointCentreIndex, 0, [ x, y ])),
|
|
7236
|
+
setTimeout((() => {
|
|
7237
|
+
this.canClickEvent = !1;
|
|
7238
|
+
}), 200);
|
|
7239
|
+
}
|
|
7240
|
+
canvasMouseup(e) {
|
|
7241
|
+
e.stopPropagation(), e.preventDefault();
|
|
7242
|
+
const {offsetX: x, offsetY: y} = e;
|
|
7243
|
+
this.pointVertexIndex > -1 && this.vertexes.splice(this.pointVertexIndex, 1, [ x, y ]),
|
|
7244
|
+
this.pointCentreIndex > -1 && this.vertexes.splice(this.pointCentreIndex, 1, [ x, y ]),
|
|
7245
|
+
this.isMoveEditing = !1, this.pointVertexIndex = -1, this.pointCentreIndex = -1,
|
|
7246
|
+
this.notifyObservers();
|
|
7247
|
+
}
|
|
7248
|
+
canvasMouseClick(e) {
|
|
7249
|
+
e.stopPropagation();
|
|
7250
|
+
const {offsetX: x, offsetY: y} = e;
|
|
7251
|
+
if (this.canClickEvent) {
|
|
7252
|
+
const i = this.pointInVertexes(x, y);
|
|
7253
|
+
if (isValueExist(i)) {
|
|
7254
|
+
if (this.vertexes.length <= 3) return;
|
|
7255
|
+
this.vertexes.splice(i, 1), this.drawPolygon(this.vertexes), this.notifyObservers();
|
|
7256
|
+
}
|
|
7257
|
+
}
|
|
7258
|
+
}
|
|
7259
|
+
canvasMousemove(e) {
|
|
7260
|
+
e.stopPropagation();
|
|
7261
|
+
const {offsetX: x, offsetY: y} = e;
|
|
7262
|
+
this.pointInVertexesOrEdgeCentre(x, y), this.isMoveEditing && (this.pointVertexIndex > -1 && this.vertexes.splice(this.pointVertexIndex, 1, [ x, y ]),
|
|
7263
|
+
this.pointCentreIndex > -1 && this.vertexes.splice(this.pointCentreIndex, 1, [ x, y ]),
|
|
7264
|
+
this.notifyObservers());
|
|
7265
|
+
}
|
|
7266
|
+
destroyed() {
|
|
7267
|
+
this.vertexes = [], this.observers = [], this.isEditing = !1, this.canvas.removeEventListener("mousedown", this.canvasMousedown),
|
|
7268
|
+
this.canvas.removeEventListener("mouseup", this.canvasMouseup), this.canvas.removeEventListener("click", this.canvasMouseClick),
|
|
7269
|
+
this.canvas.removeEventListener("mousemove", this.canvasMousemove);
|
|
7270
|
+
}
|
|
7271
|
+
}
|
|
7272
|
+
|
|
7273
|
+
class CreateDrawCanvas {
|
|
7274
|
+
canvas;
|
|
7275
|
+
ctx;
|
|
7276
|
+
image;
|
|
7277
|
+
canvasWidth;
|
|
7278
|
+
canvasHeight;
|
|
7279
|
+
paths;
|
|
7280
|
+
editDrawPolygon;
|
|
7281
|
+
createPolygonVertexes;
|
|
7282
|
+
editVertexes;
|
|
7283
|
+
editPolygonObservers=[];
|
|
7284
|
+
constructor(options) {
|
|
7285
|
+
const {canvas: canvas, ctx: ctx, image: image, canvasWidth: canvasWidth, canvasHeight: canvasHeight, paths: paths} = options;
|
|
7286
|
+
this.canvas = canvas, this.ctx = ctx, this.image = image, this.canvasWidth = canvasWidth,
|
|
7287
|
+
this.canvasHeight = canvasHeight, this.paths = paths || [], this.editVertexes = [],
|
|
7288
|
+
this.render(), this.createPolygonVertexes = new CreatePolygonVertexes(canvas, ctx),
|
|
7289
|
+
this.editDrawPolygon = new EditPolygonPath(canvas, ctx), this.createPolygonVertexes.vertexesChangeEventListener(((vertexes, mouseOffset) => {
|
|
7290
|
+
this.render(), this.editDrawPolygon.drawPolygon(vertexes, mouseOffset), this.editVertexes = vertexes,
|
|
7291
|
+
this.notifyObservers();
|
|
7292
|
+
})), this.createPolygonVertexes.onDestroyed((vertexes => {
|
|
7293
|
+
this.render(), this.editDrawPolygon.drawPolygon(vertexes), this.editDrawPolygon.updatePolygon((vertexes => {
|
|
7294
|
+
this.render(), this.editDrawPolygon.drawPolygon(vertexes), this.editVertexes = vertexes,
|
|
7295
|
+
this.notifyObservers();
|
|
7296
|
+
}));
|
|
7297
|
+
}));
|
|
7298
|
+
}
|
|
7299
|
+
notifyObservers() {
|
|
7300
|
+
this.editPolygonObservers.forEach((listener => {
|
|
7301
|
+
listener(this.editVertexes);
|
|
7302
|
+
}));
|
|
7303
|
+
}
|
|
7304
|
+
updatePolygon(callback) {
|
|
7305
|
+
this.editPolygonObservers.push(callback);
|
|
7306
|
+
}
|
|
7307
|
+
drawPolygons(paths) {
|
|
7308
|
+
const ctx = this.ctx;
|
|
7309
|
+
for (let i = 0; i < paths.length; i++) {
|
|
7310
|
+
const path = paths[i].path;
|
|
7311
|
+
if (!path.length) return;
|
|
7312
|
+
const color = colors[i % colors.length];
|
|
7313
|
+
ctx.beginPath(), ctx.lineWidth = 2, ctx.strokeStyle = color, ctx.fillStyle = hexToRgba(color, .2),
|
|
7314
|
+
ctx.moveTo(path[0][0], path[0][1]);
|
|
7315
|
+
for (let i = 1; i < path.length; i++) {
|
|
7316
|
+
const [x, y] = path[i];
|
|
7317
|
+
ctx.lineTo(x, y);
|
|
7318
|
+
}
|
|
7319
|
+
ctx.closePath(), ctx.stroke(), ctx.fill();
|
|
7320
|
+
}
|
|
7321
|
+
}
|
|
7322
|
+
initCanvas=() => {
|
|
7323
|
+
this.ctx.clearRect(0, 0, this.canvasWidth, this.canvasHeight), this.ctx.drawImage(this.image, 0, 0, this.canvasWidth, this.canvasHeight),
|
|
7324
|
+
this.drawPolygons(this.paths);
|
|
7325
|
+
};
|
|
7326
|
+
render=() => {
|
|
7327
|
+
this.initCanvas();
|
|
7328
|
+
};
|
|
7329
|
+
destroyed() {
|
|
7330
|
+
this.paths = [], this.editDrawPolygon.destroyed(), this.createPolygonVertexes.destroyed();
|
|
7331
|
+
}
|
|
7332
|
+
}
|
|
7333
|
+
|
|
7334
|
+
var CanvasContext = defineComponent({
|
|
7335
|
+
props: {
|
|
7336
|
+
classes: {
|
|
7337
|
+
type: Array,
|
|
7338
|
+
default: () => []
|
|
7339
|
+
},
|
|
7340
|
+
contextClientHeight: {
|
|
7341
|
+
type: Number,
|
|
7342
|
+
default: null
|
|
7343
|
+
},
|
|
7344
|
+
rowInfo: {
|
|
7345
|
+
type: Object,
|
|
7346
|
+
default: () => ({})
|
|
7347
|
+
}
|
|
7348
|
+
},
|
|
7349
|
+
emits: [ "editPolygon" ],
|
|
7350
|
+
setup(props, {emit: emit, expose: expose}) {
|
|
7351
|
+
const ns = inject("ns", {}), canvasMainRef = ref(), canvasBaseRef = ref(), drawCanvas = ref(), setContainerWidthHeight = (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
|
+
}, loadingImage = ref(!1), renderImageLabel = rowInfo => {
|
|
7356
|
+
const clientHeight = canvasMainRef.value?.clientHeight, ctx = canvasBaseRef.value?.getContext("2d");
|
|
7357
|
+
if (rowInfo?.imageSrc) {
|
|
7358
|
+
const image = new Image;
|
|
7359
|
+
image.src = rowInfo.imageSrc, loadingImage.value = !0, image.onload = () => {
|
|
7360
|
+
loadingImage.value = !1;
|
|
7361
|
+
let {width: width, height: height} = image;
|
|
7362
|
+
if (height > clientHeight) {
|
|
7363
|
+
const scale = height / clientHeight;
|
|
7364
|
+
height = clientHeight, image.style.height = height + "px", width /= scale;
|
|
7365
|
+
}
|
|
7366
|
+
const canvasHeight = height, scaleFactor = parseFloat((canvasHeight / height).toFixed(3)), canvasWidth = Math.ceil(width * scaleFactor);
|
|
7367
|
+
setContainerWidthHeight(canvasWidth, canvasHeight), drawCanvas.value = new CreateDrawCanvas({
|
|
7368
|
+
canvas: canvasBaseRef.value,
|
|
7369
|
+
ctx: ctx,
|
|
7370
|
+
image: image,
|
|
7371
|
+
canvasWidth: canvasWidth,
|
|
7372
|
+
canvasHeight: canvasHeight,
|
|
7373
|
+
scaleFactor: scaleFactor,
|
|
7374
|
+
paths: rowInfo.labels
|
|
7375
|
+
}), drawCanvas.value.updatePolygon((vertexes => {
|
|
7376
|
+
emit("editPolygon", {
|
|
7377
|
+
vertexes: vertexes,
|
|
7378
|
+
canvasWidth: canvasWidth,
|
|
7379
|
+
canvasHeight: canvasHeight
|
|
7380
|
+
});
|
|
7381
|
+
}));
|
|
7382
|
+
}, image.onerror = () => {
|
|
7383
|
+
loadingImage.value = !1;
|
|
7384
|
+
};
|
|
7385
|
+
}
|
|
7386
|
+
};
|
|
7387
|
+
onMounted((() => {
|
|
7388
|
+
watch((() => props.rowInfo), (info => {
|
|
7389
|
+
const rowInfo = toRaw(info);
|
|
7390
|
+
renderImageLabel(rowInfo);
|
|
7391
|
+
}), {
|
|
7392
|
+
deep: !0,
|
|
7393
|
+
immediate: !0
|
|
7394
|
+
}), watch((() => props.contextClientHeight), (height => {
|
|
7395
|
+
if (valueExist(height)) {
|
|
7396
|
+
canvasMainRef.value.style.height = height + "px";
|
|
7397
|
+
const rowInfo = toRaw(props.rowInfo);
|
|
7398
|
+
renderImageLabel(rowInfo);
|
|
7399
|
+
}
|
|
7400
|
+
}));
|
|
7401
|
+
}));
|
|
7402
|
+
return expose({
|
|
7403
|
+
rerenderImage: () => {
|
|
7404
|
+
setContainerWidthHeight(0, 0), nextTick((() => {
|
|
7405
|
+
const rowInfo = toRaw(props.rowInfo);
|
|
7406
|
+
renderImageLabel(rowInfo);
|
|
7407
|
+
}));
|
|
7408
|
+
}
|
|
7409
|
+
}), () => createVNode(Fragment, null, [ createVNode(NextSpinLoading, {
|
|
7410
|
+
loading: loadingImage.value,
|
|
7411
|
+
class: [ ns.b("loading") ],
|
|
7412
|
+
style: {
|
|
7413
|
+
height: "100%"
|
|
7414
|
+
}
|
|
7415
|
+
}, {
|
|
7416
|
+
default: () => [ createVNode("div", {
|
|
7417
|
+
ref: canvasMainRef,
|
|
7418
|
+
class: [ ns.b("canvas") ]
|
|
7419
|
+
}, [ createVNode("canvas", {
|
|
7420
|
+
ref: canvasBaseRef,
|
|
7421
|
+
class: [ ns.be("canvas", "context") ]
|
|
7422
|
+
}, null) ]) ]
|
|
7423
|
+
}) ]);
|
|
7424
|
+
}
|
|
7425
|
+
}), HeaderTool = defineComponent({
|
|
7426
|
+
props: {
|
|
7427
|
+
isFullscreen: {
|
|
7428
|
+
type: Boolean,
|
|
7429
|
+
default: !1
|
|
7430
|
+
},
|
|
7431
|
+
imageIndex: {
|
|
7432
|
+
type: Number,
|
|
7433
|
+
default: 0
|
|
7434
|
+
},
|
|
7435
|
+
imageLength: {
|
|
7436
|
+
type: Number,
|
|
7437
|
+
default: 0
|
|
7438
|
+
}
|
|
7439
|
+
},
|
|
7440
|
+
emits: [ "fullscreen", "save" ],
|
|
7441
|
+
setup(props, {emit: emit}) {
|
|
7442
|
+
const _ns = inject("ns", {}), {t: t} = useLocale(), switchFillscreen = val => {
|
|
7443
|
+
emit("fullscreen", val);
|
|
7444
|
+
};
|
|
7445
|
+
return () => createVNode(Fragment, null, [ createVNode(Fragment, null, [ createVNode("ul", {
|
|
7446
|
+
class: [ _ns.be("header", "tool") ]
|
|
7447
|
+
}, [ createVNode("li", {
|
|
7448
|
+
class: "tool-item",
|
|
7449
|
+
onClick: () => emit("save")
|
|
7450
|
+
}, [ createVNode("svg", {
|
|
7451
|
+
t: "1719034799379",
|
|
7452
|
+
class: "icon",
|
|
7453
|
+
viewBox: "0 0 1024 1024",
|
|
7454
|
+
version: "1.1",
|
|
7455
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
7456
|
+
"p-id": "4272",
|
|
7457
|
+
width: "18",
|
|
7458
|
+
height: "18"
|
|
7459
|
+
}, [ createVNode("path", {
|
|
7460
|
+
d: "M831.4 252.2L711.5 132.4c-10.3-10.3-24.2-16.1-38.8-16.1h-450c-23.3 0-42.2 18.9-42.2 42.2v709.4c0 23.3 18.9 42.2 42.2 42.2h582.6c23.3 0 42.2-18.9 42.2-42.2V291c-0.1-14.5-5.8-28.5-16.1-38.8zM619.6 159v159.8c0 4-3.3 7.3-7.3 7.3H387.2c-4 0-7.3-3.3-7.3-7.3V159h239.7z m67.7 708.4H340.8v-292c0-3.9 3.2-7.1 7.1-7.1h332.4c3.9 0 7.1 3.2 7.1 7.1v292z m117.4 0H730v-292c0-27.5-22.3-49.8-49.8-49.8H347.8c-27.5 0-49.8 22.3-49.8 49.8v292h-74.7V159.1h113.9v159.8c0 27.6 22.4 50.1 50.1 50.1h225.1c27.6 0 50.1-22.4 50.1-50.1V159h10.4c3.2 0 6.3 1.3 8.6 3.6l119.9 119.9c2.3 2.3 3.6 5.3 3.6 8.6l-0.3 576.3z",
|
|
7461
|
+
"p-id": "4273"
|
|
7462
|
+
}, null), createVNode("path", {
|
|
7463
|
+
d: "M536 196.3h42.7v87.2H536zM368.7 641.2h220.7v42.7H368.7zM368.7 744h170.9v42.7H368.7z",
|
|
7464
|
+
"p-id": "4274"
|
|
7465
|
+
}, null) ]), createVNode("p", {
|
|
7466
|
+
class: "label-text"
|
|
7467
|
+
}, [ t("next.labelme.saveLabel") ]) ]), createVNode("li", {
|
|
7468
|
+
class: "tool-item"
|
|
7469
|
+
}, [ createVNode("svg", {
|
|
7470
|
+
t: "1721826305513",
|
|
7471
|
+
class: "icon",
|
|
7472
|
+
viewBox: "0 0 1025 1024",
|
|
7473
|
+
version: "1.1",
|
|
7474
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
7475
|
+
"p-id": "6215",
|
|
7476
|
+
width: "18",
|
|
7477
|
+
height: "18"
|
|
7478
|
+
}, [ createVNode("path", {
|
|
7479
|
+
d: "M358.5 1021.5c-52.93 0-96-43.07-96-96 0-13.12 2.6-25.84 7.74-37.81l0.12-0.27-141.99-184.66-0.34 0.11a95.806 95.806 0 0 1-29.53 4.64c-52.93 0-96-43.07-96-96s43.07-96 96-96c7.56 0 15.09 0.89 22.41 2.64l0.36 0.09 213.67-370.08-0.16-0.25c-9.34-15.12-14.28-32.54-14.28-50.39 0-52.93 43.07-96 96-96 40.36 0 76.66 25.5 90.34 63.46l0.09 0.26 300.27 61.72 0.19-0.26c18.01-25.16 47.21-40.18 78.11-40.18 52.93 0 96 43.07 96 96 0 36.49-20.26 69.36-52.88 85.79l-0.31 0.16 41.76 393.5 0.25 0.12a96.184 96.184 0 0 1 39.11 34.79c9.85 15.41 15.06 33.27 15.06 51.65 0 52.93-43.07 96-96 96-31.18 0-60.53-15.24-78.52-40.76l-0.22-0.31-396.7 138.78-0.05 0.29c-8.2 45.76-47.94 78.97-94.5 78.97z m0-192c34.03 0 64.82 17.44 82.36 46.66l0.21 0.35L832.93 739.4l0.03-0.32c3.81-39.11 31.82-72.49 69.7-83.05l0.41-0.11-40.34-380.14-0.34-0.08c-39.73-9.82-68.86-43.81-72.49-84.56l-0.03-0.37-283.9-58.36-0.15 0.39c-7 17.7-19.01 32.81-34.72 43.69-16.08 11.13-34.96 17.02-54.59 17.02-9.75 0-19.37-1.46-28.59-4.33l-0.38-0.12L176.19 555.1l0.19 0.26c11.86 16.42 18.12 35.83 18.12 56.14 0 17.74-4.88 35.06-14.11 50.11l-0.18 0.29 136.28 177.25 0.37-0.18c13.04-6.28 27.05-9.47 41.64-9.47z",
|
|
7480
|
+
"p-id": "6216"
|
|
7481
|
+
}, null), createVNode("path", {
|
|
7482
|
+
d: "M416.5 2c40.15 0 76.26 25.37 89.87 63.13l0.19 0.53 0.55 0.11 299.68 61.6 0.64 0.13 0.38-0.53c8.66-12.1 20.19-22.15 33.34-29.06C854.71 90.77 870.06 87 885.5 87c52.66 0 95.5 42.84 95.5 95.5 0 18.03-5.05 35.58-14.6 50.77a95.81 95.81 0 0 1-38 34.57l-0.62 0.31 0.07 0.69 41.7 392.88 0.06 0.55 0.5 0.24c15.91 7.71 29.36 19.68 38.91 34.61 9.8 15.33 14.98 33.09 14.98 51.38 0 52.66-42.84 95.5-95.5 95.5-31.02 0-60.22-15.16-78.11-40.55l-0.43-0.62-0.71 0.25-396.09 138.59-0.55 0.19-0.1 0.57c-3.9 21.77-15.4 41.67-32.39 56.03-17.2 14.54-39.08 22.54-61.62 22.54-52.66 0-95.5-42.84-95.5-95.5 0-13.05 2.59-25.71 7.7-37.61l0.23-0.54-0.36-0.46-141.59-184.16-0.43-0.56-0.67 0.22A95.43 95.43 0 0 1 98.5 707C45.84 707 3 664.16 3 611.5S45.84 516 98.5 516c7.52 0 15.01 0.88 22.29 2.62l0.73 0.17 0.37-0.65 213.33-369.5 0.3-0.52-0.31-0.51c-9.29-15.04-14.2-32.37-14.2-50.12C321 44.84 363.84 2 416.5 2m0 191c-9.7 0-19.27-1.45-28.44-4.31l-0.76-0.24-0.4 0.69-210.98 365.43-0.32 0.56 0.38 0.52C187.77 571.99 194 591.3 194 611.5c0 17.64-4.85 34.88-14.03 49.85l-0.36 0.59 0.42 0.55 135.82 176.65 0.5 0.64 0.73-0.35c12.97-6.26 26.91-9.43 41.42-9.43 16.79 0 33.3 4.42 47.75 12.78a96.095 96.095 0 0 1 34.18 33.63l0.42 0.7 0.77-0.27 391.17-136.87 0.6-0.21 0.06-0.64c1.88-19.33 9.53-37.41 22.11-52.28 12.44-14.71 28.77-25.2 47.22-30.35l0.82-0.23-0.09-0.84-40.26-379.37-0.07-0.7-0.68-0.17c-39.52-9.77-68.5-43.58-72.11-84.12l-0.07-0.74-0.73-0.15-283.12-58.2-0.82-0.17-0.31 0.78c-6.96 17.61-18.91 32.64-34.54 43.46-15.99 11.11-34.77 16.96-54.3 16.96m0-192C363.2 1 320 44.2 320 97.5c0 18.58 5.26 35.93 14.35 50.65l-213.33 369.5A96.669 96.669 0 0 0 98.5 515C45.2 515 2 558.2 2 611.5S45.2 708 98.5 708a96.5 96.5 0 0 0 29.69-4.66l141.59 184.15c-5 11.66-7.78 24.51-7.78 38.01 0 53.3 43.2 96.5 96.5 96.5 47.46 0 86.91-34.25 94.99-79.39l396.08-138.59C867.04 828.81 895.88 845 928.5 845c53.3 0 96.5-43.2 96.5-96.5 0-38.22-22.23-71.26-54.46-86.88l-41.7-392.88C960.37 252.86 982 220.21 982 182.5c0-53.3-43.2-96.5-96.5-96.5-32.37 0-61.01 15.94-78.51 40.39l-299.68-61.6C493.91 27.59 458.31 1 416.5 1z m0 193c40.77 0 75.63-25.28 89.77-61.03l283.12 58.2c3.69 41.4 33.52 75.27 72.87 85l40.26 379.37c-37.74 10.53-66.15 43.41-70.06 83.49L441.29 875.9c-16.87-28.1-47.63-46.9-82.79-46.9-15 0-29.2 3.42-41.86 9.53L180.82 661.88c8.99-14.66 14.18-31.91 14.18-50.38 0-21.07-6.76-40.56-18.22-56.43l210.98-365.42c9.08 2.83 18.73 4.35 28.74 4.35z",
|
|
7483
|
+
"p-id": "6217"
|
|
7484
|
+
}, null) ]), createVNode("p", {
|
|
7485
|
+
class: "label-text"
|
|
7486
|
+
}, [ t("next.labelme.createPolygon") ]) ]), createVNode("li", {
|
|
7487
|
+
class: "tool-item"
|
|
7488
|
+
}, [ createVNode("svg", {
|
|
7489
|
+
t: "1721826424613",
|
|
7490
|
+
class: "icon",
|
|
7491
|
+
viewBox: "0 0 1024 1024",
|
|
7492
|
+
version: "1.1",
|
|
7493
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
7494
|
+
"p-id": "7356",
|
|
7495
|
+
width: "18",
|
|
7496
|
+
height: "18"
|
|
7497
|
+
}, [ createVNode("path", {
|
|
7498
|
+
d: "M102.4 870.4v51.2h102.4v51.2H51.2v-102.4h51.2z m870.4-51.2v153.6h-102.4v-51.2h51.2v-102.4h51.2zM409.6 921.6v51.2H358.4v-51.2h51.2z m102.4 0v51.2H460.8v-51.2h51.2z m102.4 0v51.2h-51.2v-51.2h51.2z m102.4 0v51.2h-51.2v-51.2h51.2z m102.4 0v51.2h-51.2v-51.2h51.2zM307.2 921.6v51.2H256v-51.2h51.2z m204.8-742.4a51.2 51.2 0 0 1 51.0464 55.0912l118.8352 68.608a102.4 102.4 0 1 1 96.1536 157.3888v155.136a51.2 51.2 0 1 1-51.6096 80.0256L556.3392 793.6a51.2 51.2 0 1 1-88.7296 0.0512l-169.984-98.2016A51.1488 51.1488 0 0 1 204.8 665.6a51.2 51.2 0 0 1 41.1136-50.176V408.576a51.2 51.2 0 1 1 51.712-79.9744l163.3792-94.3616L460.8 230.4a51.2 51.2 0 0 1 45.2096-50.8416zM102.4 768v51.2H51.2v-51.2h51.2z m870.4-51.2v51.2h-51.2v-51.2h51.2zM297.0624 412.8768l0.1024 222.208 1.024 1.536L486.4 745.2672v-188.928a51.2 51.2 0 0 1-25.2416-38.4L460.8 512v-0.8704L297.0624 412.8768z m399.0528 18.432L563.2 511.1808 563.2 512a51.2 51.2 0 0 1-25.5488 44.3392l-0.0512 188.8768 188.2624-108.6976 0.9216-1.28V452.096a102.6048 102.6048 0 0 1-30.6688-20.7872zM102.4 665.6v51.2H51.2v-51.2h51.2z m870.4-51.2v51.2h-51.2v-51.2h51.2zM102.4 563.2v51.2H51.2v-51.2h51.2z m870.4-51.2v51.2h-51.2v-51.2h51.2zM102.4 460.8v51.2H51.2V460.8h51.2z m387.584-184.1664L326.6048 370.8928l160.6144 96.256a50.8416 50.8416 0 0 1 18.7904-5.9904L512 460.8c9.0112 0 17.5104 2.3552 24.832 6.4l132.9664-79.7184a102.4 102.4 0 0 1-4.0448-34.7648l-131.7888-76.032a50.9952 50.9952 0 0 1-43.9808 0zM972.8 409.6v51.2h-51.2V409.6h51.2zM102.4 358.4v51.2H51.2V358.4h51.2z m870.4-51.2v51.2h-51.2V307.2h51.2zM102.4 256v51.2H51.2V256h51.2z m870.4-51.2v51.2h-51.2V204.8h51.2zM153.6 51.2v51.2H102.4v102.4H51.2V51.2h102.4z m819.2 0v102.4h-51.2V102.4h-102.4V51.2h153.6z m-409.6 0v51.2h-51.2V51.2h51.2z m102.4 0v51.2h-51.2V51.2h51.2z m102.4 0v51.2h-51.2V51.2h51.2zM256 51.2v51.2H204.8V51.2h51.2z m102.4 0v51.2H307.2V51.2h51.2z m102.4 0v51.2H409.6V51.2h51.2z",
|
|
7499
|
+
"p-id": "7357"
|
|
7500
|
+
}, null) ]), createVNode("p", {
|
|
7501
|
+
class: "label-text"
|
|
7502
|
+
}, [ t("next.labelme.editPolygon") ]) ]), createVNode("li", {
|
|
7503
|
+
class: "tool-item"
|
|
7504
|
+
}, [ createVNode("svg", {
|
|
7505
|
+
t: "1721826579655",
|
|
7506
|
+
class: "icon",
|
|
7507
|
+
viewBox: "0 0 1024 1024",
|
|
7508
|
+
version: "1.1",
|
|
7509
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
7510
|
+
"p-id": "10996",
|
|
7511
|
+
width: "18",
|
|
7512
|
+
height: "18"
|
|
7513
|
+
}, [ createVNode("path", {
|
|
7514
|
+
d: "M847.743 223.953H640.639c-3.132-68.921-60.177-124.029-129.858-124.029s-126.726 55.108-129.858 124.029H173.256c-17.673 0-32 14.327-32 32s14.327 32 32 32h674.487c17.673 0 32-14.327 32-32s-14.327-32-32-32z m-336.962-60.03c34.379 0 62.689 26.426 65.718 60.029H445.064c3.029-33.603 31.338-60.029 65.717-60.029zM767.743 351.79c-17.673 0-32 14.327-32 32v478.173H288.256V383.79c0-17.673-14.327-32-32-32s-32 14.327-32 32v510.173c0 17.673 14.327 32 32 32h511.487c17.673 0 32-14.327 32-32V383.79c0-17.673-14.327-32-32-32z",
|
|
7515
|
+
"p-id": "10997"
|
|
7516
|
+
}, null), createVNode("path", {
|
|
7517
|
+
d: "M449.306 732.802V448.208c0-17.673-14.327-32-32-32s-32 14.327-32 32v284.593c0 17.673 14.327 32 32 32s32-14.326 32-31.999z m191.534 0V448.208c0-17.673-14.327-32-32-32s-32 14.327-32 32v284.593c0 17.673 14.327 32 32 32s32-14.326 32-31.999z",
|
|
7518
|
+
"p-id": "10998"
|
|
7519
|
+
}, null) ]), createVNode("p", {
|
|
7520
|
+
class: "label-text"
|
|
7521
|
+
}, [ t("next.labelme.deletePolyton") ]) ]) ]), createVNode("ul", {
|
|
7522
|
+
class: [ _ns.be("header", "tool") ]
|
|
7523
|
+
}, [ props.imageLength ? createVNode("li", null, [ createVNode("span", null, [ createTextVNode("第 "), props.imageIndex + 1, createTextVNode(" 张") ]), createVNode("em", {
|
|
7524
|
+
style: "padding: 0 5px;"
|
|
7525
|
+
}, [ createTextVNode("/") ]), createVNode("span", null, [ createTextVNode("共 "), props.imageLength, createTextVNode(" 张") ]) ]) : null, createVNode("li", {
|
|
7526
|
+
style: "margin-right: 30px;",
|
|
7527
|
+
class: "tool-item"
|
|
7528
|
+
}, [ createVNode(ElPopover, {
|
|
7529
|
+
trigger: "hover",
|
|
7530
|
+
placement: "bottom",
|
|
7531
|
+
width: "none"
|
|
7532
|
+
}, {
|
|
7533
|
+
reference: () => createVNode("div", {
|
|
7534
|
+
class: "flex-center"
|
|
7535
|
+
}, [ createVNode("span", {
|
|
7536
|
+
style: "padding-right: 3px"
|
|
7537
|
+
}, [ t("next.labelimg.instructions") ]), createVNode(ElIcon, {
|
|
7538
|
+
size: 14
|
|
7539
|
+
}, {
|
|
7540
|
+
default: () => [ createVNode(warning_default, null, null) ]
|
|
7541
|
+
}) ]),
|
|
7542
|
+
default: () => createVNode("ul", {
|
|
7543
|
+
style: "font-size: 12px;white-space: nowrap;"
|
|
7544
|
+
}, [ createVNode("li", null, [ createVNode("span", null, [ createTextVNode("A:") ]), createVNode("span", null, [ createTextVNode("A键进入上一张图片进行标注") ]) ]), createVNode("li", null, [ createVNode("span", null, [ createTextVNode("D:") ]), createVNode("span", null, [ createTextVNode("D键进入下一张图片进行标注") ]) ]) ])
|
|
7545
|
+
}) ]), props.isFullscreen ? createVNode("li", {
|
|
7546
|
+
class: "tool-item",
|
|
7547
|
+
onClick: () => switchFillscreen(!1)
|
|
7548
|
+
}, [ createVNode(ElTooltip, {
|
|
7549
|
+
placement: "top",
|
|
7550
|
+
content: "取消全屏"
|
|
7551
|
+
}, {
|
|
7552
|
+
default: () => [ createVNode("svg", {
|
|
7553
|
+
t: "1719035442027",
|
|
7554
|
+
class: "icon",
|
|
7555
|
+
viewBox: "0 0 1024 1024",
|
|
7556
|
+
version: "1.1",
|
|
7557
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
7558
|
+
"p-id": "5388",
|
|
7559
|
+
width: "18",
|
|
7560
|
+
height: "18"
|
|
7561
|
+
}, [ createVNode("path", {
|
|
7562
|
+
d: "M354.133333 682.666667H256v-42.666667h170.666667v170.666667H384v-98.133334L243.2 853.333333l-29.866667-29.866666L354.133333 682.666667z m358.4 0l140.8 140.8-29.866666 29.866666-140.8-140.8V810.666667h-42.666667v-170.666667h170.666667v42.666667h-98.133334zM354.133333 384L213.333333 243.2l29.866667-29.866667L384 354.133333V256h42.666667v170.666667H256V384h98.133333z m358.4 0H810.666667v42.666667h-170.666667V256h42.666667v98.133333L823.466667 213.333333l29.866666 29.866667L712.533333 384z",
|
|
7563
|
+
"p-id": "5389"
|
|
7564
|
+
}, null) ]) ]
|
|
7565
|
+
}) ]) : createVNode("li", {
|
|
7566
|
+
class: "tool-item",
|
|
7567
|
+
onClick: () => switchFillscreen(!0)
|
|
7568
|
+
}, [ createVNode(ElTooltip, {
|
|
7569
|
+
placement: "top",
|
|
7570
|
+
content: "全屏"
|
|
7571
|
+
}, {
|
|
7572
|
+
default: () => [ createVNode("svg", {
|
|
7573
|
+
t: "1719035375323",
|
|
7574
|
+
class: "icon",
|
|
7575
|
+
viewBox: "0 0 1024 1024",
|
|
7576
|
+
version: "1.1",
|
|
7577
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
7578
|
+
"p-id": "5241",
|
|
7579
|
+
width: "18",
|
|
7580
|
+
height: "18"
|
|
7581
|
+
}, [ createVNode("path", {
|
|
7582
|
+
d: "M285.866667 810.666667H384v42.666666H213.333333v-170.666666h42.666667v98.133333l128-128 29.866667 29.866667-128 128z m494.933333 0l-128-128 29.866667-29.866667 128 128V682.666667h42.666666v170.666666h-170.666666v-42.666666h98.133333zM285.866667 256l128 128-29.866667 29.866667-128-128V384H213.333333V213.333333h170.666667v42.666667H285.866667z m494.933333 0H682.666667V213.333333h170.666666v170.666667h-42.666666V285.866667l-128 128-29.866667-29.866667 128-128z",
|
|
7583
|
+
"p-id": "5242"
|
|
7584
|
+
}, null) ]) ]
|
|
7585
|
+
}) ]) ]) ]) ]);
|
|
7586
|
+
}
|
|
7587
|
+
}), defaultConfig = {
|
|
7588
|
+
minContentHeight: 500
|
|
7589
|
+
};
|
|
7590
|
+
|
|
7591
|
+
const ns = useNamespace("labelme");
|
|
7592
|
+
|
|
7593
|
+
var Element = defineComponent({
|
|
7594
|
+
name: "NextLabelme",
|
|
7595
|
+
props: {
|
|
7596
|
+
className: {
|
|
7597
|
+
type: String,
|
|
7598
|
+
default: ""
|
|
7599
|
+
},
|
|
7600
|
+
style: {
|
|
7601
|
+
type: Object,
|
|
7602
|
+
default: () => ({})
|
|
7603
|
+
},
|
|
7604
|
+
options: {
|
|
7605
|
+
type: Object,
|
|
7606
|
+
default: () => ({})
|
|
7607
|
+
},
|
|
7608
|
+
classes: {
|
|
7609
|
+
type: Array,
|
|
7610
|
+
default: () => []
|
|
7611
|
+
},
|
|
7612
|
+
data: {
|
|
7613
|
+
type: Array,
|
|
7614
|
+
default: () => []
|
|
7615
|
+
}
|
|
7616
|
+
},
|
|
7617
|
+
emits: [ "change", "save", "edit-polygon", "prev-click", "next-click" ],
|
|
7618
|
+
setup(props, {emit: emit, slots: slots}) {
|
|
7619
|
+
const _config = deepClone(defaultConfig), _options = computed((() => {
|
|
7620
|
+
const cfg = unref(props.options);
|
|
7621
|
+
return merge$1(_config, cfg);
|
|
7622
|
+
})), options = unref(_options);
|
|
7623
|
+
provide("ns", ns);
|
|
7624
|
+
const {t: t} = useLocale(), activateNodeIndex = ref(0), classes = ref(props.classes), labelImages = ref(deepClone(props.data));
|
|
7625
|
+
watch((() => props.data), (data => {
|
|
7626
|
+
labelImages.value = deepClone(data);
|
|
7627
|
+
}), {
|
|
7628
|
+
deep: !0
|
|
7629
|
+
}), watch((() => props.data.length), (() => {
|
|
7630
|
+
activateNodeIndex.value = 0;
|
|
7631
|
+
})), watch((() => props.classes), (val => {
|
|
7632
|
+
classes.value = val;
|
|
7633
|
+
}), {
|
|
7634
|
+
deep: !0
|
|
7635
|
+
});
|
|
7636
|
+
const currentNode = computed((() => {
|
|
7637
|
+
if (!labelImages.value) return {};
|
|
7638
|
+
const node = labelImages.value[activateNodeIndex.value] || {};
|
|
7639
|
+
return deepClone(node);
|
|
7640
|
+
})), loading = ref(!1), mainContentHeight = ref(options.minContentHeight), canvasContextRef = ref(), layoutLabelRef = ref(), headerRef = ref(), mainRef = ref(), footerRef = ref(), updateMainContentHeight = () => {
|
|
7641
|
+
nextTick((() => {
|
|
7642
|
+
const contentHeight = (layoutLabelRef.value?.clientHeight || 0) - ((headerRef.value?.clientHeight || 0) + (footerRef.value?.clientHeight || 0));
|
|
7643
|
+
mainContentHeight.value = contentHeight;
|
|
7644
|
+
}));
|
|
7645
|
+
};
|
|
7646
|
+
onMounted((() => {
|
|
7647
|
+
document.addEventListener("keydown", onKeydownPrevNext), elementResize(layoutLabelRef.value.parentElement, (() => {
|
|
7648
|
+
updateMainContentHeight();
|
|
7649
|
+
})), window.addEventListener("resize", updateMainContentHeight);
|
|
7650
|
+
})), onUnmounted((() => {
|
|
7651
|
+
document.removeEventListener("keydown", onKeydownPrevNext), window.removeEventListener("resize", updateMainContentHeight);
|
|
7652
|
+
}));
|
|
7653
|
+
const onKeydownPrevNext = () => {}, onPaginationPrev = () => {
|
|
7654
|
+
const imageLength = labelImages.value.length;
|
|
7655
|
+
let i = activateNodeIndex.value - 1;
|
|
7656
|
+
i < 0 && (i = imageLength - 1), onChangeActivateNode(i), emit("prev-click");
|
|
7657
|
+
}, onPaginationNext = () => {
|
|
7658
|
+
const imageLength = labelImages.value.length;
|
|
7659
|
+
let i = activateNodeIndex.value + 1;
|
|
7660
|
+
i >= imageLength && (i = 0), onChangeActivateNode(i), emit("next-click");
|
|
7661
|
+
}, onChangeActivateNode = index => {
|
|
7662
|
+
if (loading.value) return;
|
|
7663
|
+
loading.value = !0;
|
|
7664
|
+
const node = currentNode.value;
|
|
7665
|
+
emit("save", {
|
|
7666
|
+
node: node
|
|
7667
|
+
}, (imageItem => {
|
|
7668
|
+
labelImages.value[activateNodeIndex.value] = imageItem || node, activateNodeIndex.value = index,
|
|
7669
|
+
loading.value = !1;
|
|
7670
|
+
}), (() => {
|
|
7671
|
+
loading.value = !1;
|
|
7672
|
+
}));
|
|
7673
|
+
}, isFullscreen = ref(!1), onSwitchFillscreen = val => {
|
|
7674
|
+
isFullscreen.value = val, updateMainContentHeight(), nextTick((() => {
|
|
7675
|
+
canvasContextRef.value.rerenderImage();
|
|
7676
|
+
}));
|
|
7677
|
+
}, onEditPlygonChange = plygon => {
|
|
7678
|
+
emit("edit-polygon", plygon);
|
|
7679
|
+
};
|
|
7680
|
+
return () => createVNode(Fragment, null, [ createVNode("div", {
|
|
7681
|
+
ref: layoutLabelRef,
|
|
7682
|
+
class: [ ns.b(), props.className, isFullscreen.value ? ns.b("fullscreen") : "" ],
|
|
7683
|
+
style: {
|
|
7684
|
+
...props.style
|
|
7685
|
+
}
|
|
7686
|
+
}, [ createVNode(NextSpinLoading, {
|
|
7687
|
+
loading: loading.value,
|
|
7688
|
+
tip: t("next.labelimg.saveTxt"),
|
|
7689
|
+
class: [ ns.b("loading") ]
|
|
7690
|
+
}, {
|
|
7691
|
+
default: () => [ createVNode(ElScrollbar, null, {
|
|
7692
|
+
default: () => [ createVNode("header", {
|
|
7693
|
+
ref: headerRef,
|
|
7694
|
+
class: [ ns.b("header") ]
|
|
7695
|
+
}, [ slots.header ? slots.header() : createVNode(HeaderTool, {
|
|
7696
|
+
isFullscreen: isFullscreen.value,
|
|
7697
|
+
imageIndex: activateNodeIndex.value,
|
|
7698
|
+
imageLength: labelImages.value.length,
|
|
7699
|
+
onFullscreen: onSwitchFillscreen
|
|
7700
|
+
}, null) ]), createVNode("div", {
|
|
7701
|
+
ref: mainRef,
|
|
7702
|
+
class: [ ns.b("main") ]
|
|
7703
|
+
}, [ createVNode("div", {
|
|
7704
|
+
class: [ ns.be("main", "content") ],
|
|
7705
|
+
style: {
|
|
7706
|
+
height: mainContentHeight.value + "px"
|
|
7707
|
+
}
|
|
7708
|
+
}, [ createVNode(CanvasContext, {
|
|
7709
|
+
ref: canvasContextRef,
|
|
7710
|
+
rowInfo: currentNode.value,
|
|
7711
|
+
onEditPolygon: onEditPlygonChange
|
|
7712
|
+
}, null) ]) ]), createVNode("footer", {
|
|
7713
|
+
ref: footerRef,
|
|
7714
|
+
class: [ ns.b("footer") ]
|
|
7715
|
+
}, [ createVNode("div", {
|
|
7716
|
+
class: [ ns.be("footer", "left") ]
|
|
7717
|
+
}, [ createVNode(ElIcon, {
|
|
7718
|
+
size: 24,
|
|
7719
|
+
color: "#797979",
|
|
7720
|
+
onClick: onPaginationPrev
|
|
7721
|
+
}, {
|
|
7722
|
+
default: () => [ createVNode(arrow_left_default, null, null) ]
|
|
7723
|
+
}) ]), createVNode("div", {
|
|
7724
|
+
class: [ ns.be("footer", "center") ]
|
|
7725
|
+
}, [ createVNode(ElScrollbar, null, {
|
|
7726
|
+
default: () => [ createVNode("ul", {
|
|
7727
|
+
class: [ ns.bem("footer", "center", "list") ]
|
|
7728
|
+
}, [ labelImages.value.map(((item, index) => createVNode("li", {
|
|
7729
|
+
key: index,
|
|
7730
|
+
onClick: () => onChangeActivateNode(index),
|
|
7731
|
+
class: {
|
|
7732
|
+
"is-activate": activateNodeIndex.value === index
|
|
7733
|
+
}
|
|
7734
|
+
}, [ createVNode(ElImage, {
|
|
7735
|
+
style: "height: 100%",
|
|
7736
|
+
src: item.imageSrc,
|
|
7737
|
+
"zoom-rate": 1.2,
|
|
7738
|
+
"max-scale": 2,
|
|
7739
|
+
"min-scale": .2,
|
|
7740
|
+
fit: "cover"
|
|
7741
|
+
}, null) ]))) ]) ]
|
|
7742
|
+
}) ]), createVNode("div", {
|
|
7743
|
+
class: [ ns.be("footer", "right") ]
|
|
7744
|
+
}, [ createVNode(ElIcon, {
|
|
7745
|
+
size: 24,
|
|
7746
|
+
color: "#797979",
|
|
7747
|
+
onClick: onPaginationNext
|
|
7748
|
+
}, {
|
|
7749
|
+
default: () => [ createVNode(arrow_right_default, null, null) ]
|
|
7750
|
+
}) ]) ]) ]
|
|
7751
|
+
}) ]
|
|
7752
|
+
}) ]) ]);
|
|
7753
|
+
}
|
|
7754
|
+
});
|
|
7755
|
+
|
|
7756
|
+
const NextLabelme = withInstall(Element);
|
|
7054
7757
|
|
|
7055
7758
|
var components = Object.freeze({
|
|
7056
7759
|
__proto__: null,
|
|
@@ -7062,6 +7765,7 @@ var components = Object.freeze({
|
|
|
7062
7765
|
NextForm: NextForm,
|
|
7063
7766
|
NextLabelimg: NextLabelimg,
|
|
7064
7767
|
NextLabelimgPreview: NextLabelimgPreview,
|
|
7768
|
+
NextLabelme: NextLabelme,
|
|
7065
7769
|
NextLayout: NextLayout,
|
|
7066
7770
|
NextMenu: NextMenu,
|
|
7067
7771
|
NextSpinLoading: NextSpinLoading,
|
|
@@ -7104,7 +7808,7 @@ const zoomDialog = app => {
|
|
|
7104
7808
|
}));
|
|
7105
7809
|
}
|
|
7106
7810
|
});
|
|
7107
|
-
}, version = "0.3.
|
|
7811
|
+
}, version = "0.3.4", install = function(app) {
|
|
7108
7812
|
Object.keys(components).forEach((key => {
|
|
7109
7813
|
const component = components[key];
|
|
7110
7814
|
app.component(component.name, component);
|
|
@@ -7114,8 +7818,8 @@ const zoomDialog = app => {
|
|
|
7114
7818
|
};
|
|
7115
7819
|
|
|
7116
7820
|
var index = {
|
|
7117
|
-
version: "0.3.
|
|
7821
|
+
version: "0.3.4",
|
|
7118
7822
|
install: install
|
|
7119
7823
|
};
|
|
7120
7824
|
|
|
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 };
|
|
7825
|
+
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 };
|