next-element-vue 0.2.6 → 0.2.9
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 +4 -3
- package/dist/index.js +1076 -120
- package/dist/index.min.js +3 -3
- package/dist/index.umd.js +1063 -117
- package/dist/index.umd.min.js +3 -3
- package/dist/packages/components/crud-table-virtualized/src/index.test.d.ts +2 -2
- package/dist/packages/components/labelimg/index.d.ts +118 -0
- package/dist/packages/components/labelimg/src/config.d.ts +4 -0
- package/dist/packages/components/labelimg/src/hooks/canvas-context-hook.d.ts +59 -0
- package/dist/packages/components/labelimg/src/index.d.ts +69 -0
- package/dist/packages/components/labelimg/src/preview.d.ts +51 -0
- package/dist/packages/components/labelimg/src/widgets/canvas-context.d.ts +34 -0
- package/dist/packages/components/labelimg/src/widgets/contextmenu-label.d.ts +38 -0
- package/dist/packages/components/labelimg/src/widgets/draggable-rect.d.ts +52 -0
- package/dist/packages/components/labelimg/src/widgets/right-label.d.ts +28 -0
- package/dist/packages/components/spin-loading/src/index.d.ts +1 -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 +5 -0
- package/dist/packages/locale/lang/zh-cn.d.ts +5 -0
- package/dist/packages/locale/lang/zh-tw.d.ts +5 -0
- package/package.json +1 -55
package/dist/index.js
CHANGED
|
@@ -2,14 +2,14 @@
|
|
|
2
2
|
/**
|
|
3
3
|
* 作 者:huangteng
|
|
4
4
|
* 邮 箱:htengweb@163.com
|
|
5
|
-
* 当前版本:0.2.
|
|
6
|
-
* 发布日期:2024-06-
|
|
5
|
+
* 当前版本:0.2.9 v
|
|
6
|
+
* 发布日期:2024-06-14
|
|
7
7
|
* 地 址:https://www.npmjs.com/package/next-element-vue
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
|
-
import { getCurrentInstance, inject, ref, computed, unref, isRef, defineComponent, createVNode, Fragment, openBlock, createElementBlock, createElementVNode, reactive, createTextVNode, resolveComponent, Teleport, isVNode, onUnmounted, provide, watch, markRaw, watchEffect, h, onMounted, toRaw, render, nextTick } from "vue";
|
|
10
|
+
import { getCurrentInstance, inject, ref, computed, unref, isRef, defineComponent, createVNode, Fragment, openBlock, createElementBlock, createElementVNode, reactive, createTextVNode, resolveComponent, Teleport, isVNode, onUnmounted, provide, watch, markRaw, watchEffect, h, onMounted, toRaw, render, nextTick, toRef } from "vue";
|
|
11
11
|
|
|
12
|
-
import { localeContextKey as localeContextKey$1, ElMessage, ElTooltip, ElScrollbar, ElDivider, ElColorPicker, ElSwitch, ElDropdown, ElIcon, ElDropdownMenu, ElDropdownItem, ElDrawer, ElMenuItem, ElSubMenu, ElMenu, ElContainer, ElCol, ElFormItem, ElInput, ElSelect, ElOption, ElDatePicker, ElInputNumber, ElForm, ElRow, ElButton, ElTable, ElTableColumn, ElCheckbox, ElMessageBox, ElPagination, ElDialog, ElTag, ElRadioGroup, ElRadio, ElUpload, ElImageViewer, ElImage, ElTreeSelect, ElTimeSelect, ElCheckboxGroup, ElEmpty } from "element-plus";
|
|
12
|
+
import { localeContextKey as localeContextKey$1, ElMessage, ElTooltip, ElScrollbar, ElDivider, ElColorPicker, ElSwitch, ElDropdown, ElIcon, ElDropdownMenu, ElDropdownItem, ElDrawer, ElMenuItem, ElSubMenu, ElMenu, ElContainer, ElCol, ElFormItem, ElInput, ElSelect, ElOption, ElDatePicker, ElInputNumber, ElForm, ElRow, ElButton, ElTable, ElTableColumn, ElCheckbox, ElMessageBox, ElPagination, ElDialog, ElTag, ElRadioGroup, ElRadio, ElUpload, ElImageViewer, ElImage, ElTreeSelect, ElTimeSelect, ElCheckboxGroup, ElEmpty, ElPopconfirm } from "element-plus";
|
|
13
13
|
|
|
14
14
|
import { useDateFormat, useNow, useFullscreen } from "@vueuse/core";
|
|
15
15
|
|
|
@@ -887,6 +887,11 @@ var merge = createAssigner((function(object, source, srcIndex) {
|
|
|
887
887
|
tabsRight: "关闭右侧",
|
|
888
888
|
tabsAll: "关闭全部",
|
|
889
889
|
systemSetting: "系统配置"
|
|
890
|
+
},
|
|
891
|
+
labelimg: {
|
|
892
|
+
saveTxt: "保存中...",
|
|
893
|
+
emptyLabelText: "暂无标签数据",
|
|
894
|
+
confirmDeleteLabel: "确定要删除该标注吗?"
|
|
890
895
|
}
|
|
891
896
|
}
|
|
892
897
|
}, enLocale = {
|
|
@@ -956,6 +961,11 @@ var merge = createAssigner((function(object, source, srcIndex) {
|
|
|
956
961
|
tabsRight: "close right",
|
|
957
962
|
tabsAll: "close all",
|
|
958
963
|
systemSetting: "system setting"
|
|
964
|
+
},
|
|
965
|
+
labelimg: {
|
|
966
|
+
saveTxt: "saving...",
|
|
967
|
+
emptyLabelText: "No label data",
|
|
968
|
+
confirmDeleteLabel: "Are you sure you want to delete this annotation?"
|
|
959
969
|
}
|
|
960
970
|
}
|
|
961
971
|
}, zhtwLocale = {
|
|
@@ -1025,6 +1035,11 @@ var merge = createAssigner((function(object, source, srcIndex) {
|
|
|
1025
1035
|
tabsRight: "關閉右側",
|
|
1026
1036
|
tabsAll: "關閉全部",
|
|
1027
1037
|
systemSetting: "系統配置"
|
|
1038
|
+
},
|
|
1039
|
+
labelimg: {
|
|
1040
|
+
saveTxt: "保存中...",
|
|
1041
|
+
emptyLabelText: "暂无标签数据",
|
|
1042
|
+
confirmDeleteLabel: "确定要删除该标注吗?"
|
|
1028
1043
|
}
|
|
1029
1044
|
}
|
|
1030
1045
|
};
|
|
@@ -1190,7 +1205,7 @@ const {getLightColor: getLightColor$4} = useChangeColor(), nextUseCssVar = (cssv
|
|
|
1190
1205
|
return main;
|
|
1191
1206
|
}, slots_config_headerMenu = "header-menu", slots_config_headerToolsPrefix = "header-tools-prefix", slots_config_headerToolsSuffix = "header-tools-suffix";
|
|
1192
1207
|
|
|
1193
|
-
var defaultConfig$
|
|
1208
|
+
var defaultConfig$4 = {
|
|
1194
1209
|
logo: "",
|
|
1195
1210
|
title: "Next Element Vue",
|
|
1196
1211
|
userName: "Admin",
|
|
@@ -1235,7 +1250,7 @@ var defaultConfig$3 = {
|
|
|
1235
1250
|
}
|
|
1236
1251
|
};
|
|
1237
1252
|
|
|
1238
|
-
const ns$
|
|
1253
|
+
const ns$k = useNamespace("text-ellipsis");
|
|
1239
1254
|
|
|
1240
1255
|
const NextTextEllipsis = withInstall(defineComponent({
|
|
1241
1256
|
name: "NextTextEllipsis",
|
|
@@ -1282,7 +1297,7 @@ const NextTextEllipsis = withInstall(defineComponent({
|
|
|
1282
1297
|
}
|
|
1283
1298
|
};
|
|
1284
1299
|
return () => createVNode(Fragment, null, [ createVNode("div", {
|
|
1285
|
-
class: [ ns$
|
|
1300
|
+
class: [ ns$k.b(), props.class ],
|
|
1286
1301
|
style: setWidth.value,
|
|
1287
1302
|
onMouseenter: onMouseenter
|
|
1288
1303
|
}, [ isTip.value ? createVNode(ElTooltip, {
|
|
@@ -1292,11 +1307,11 @@ const NextTextEllipsis = withInstall(defineComponent({
|
|
|
1292
1307
|
disabled: props.disabled
|
|
1293
1308
|
}, {
|
|
1294
1309
|
default: () => [ createVNode("span", {
|
|
1295
|
-
class: ns$
|
|
1310
|
+
class: ns$k.e("text"),
|
|
1296
1311
|
ref: ellipsisRef
|
|
1297
1312
|
}, [ slots.default ? slots.default() : props.content ]) ]
|
|
1298
1313
|
}) : createVNode("span", {
|
|
1299
|
-
class: ns$
|
|
1314
|
+
class: ns$k.e("text"),
|
|
1300
1315
|
ref: ellipsisRef
|
|
1301
1316
|
}, [ slots.default ? slots.default() : props.content ]) ]) ]);
|
|
1302
1317
|
}
|
|
@@ -1333,7 +1348,31 @@ var LogoView = defineComponent({
|
|
|
1333
1348
|
|
|
1334
1349
|
var arrow_down_default = export_helper_default(arrow_down_vue_vue_type_script_lang_default, [ [ "render", function(_ctx, _cache, $props, $setup, $data, $options) {
|
|
1335
1350
|
return openBlock(), createElementBlock("svg", _hoisted_16, _hoisted_36);
|
|
1336
|
-
} ], [ "__file", "arrow-down.vue" ] ]),
|
|
1351
|
+
} ], [ "__file", "arrow-down.vue" ] ]), arrow_left_vue_vue_type_script_lang_default = {
|
|
1352
|
+
name: "ArrowLeft"
|
|
1353
|
+
}, _hoisted_18 = {
|
|
1354
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1355
|
+
viewBox: "0 0 1024 1024"
|
|
1356
|
+
}, _hoisted_38 = [ createElementVNode("path", {
|
|
1357
|
+
fill: "currentColor",
|
|
1358
|
+
d: "M609.408 149.376 277.76 489.6a32 32 0 0 0 0 44.672l331.648 340.352a29.12 29.12 0 0 0 41.728 0 30.592 30.592 0 0 0 0-42.752L339.264 511.936l311.872-319.872a30.592 30.592 0 0 0 0-42.688 29.12 29.12 0 0 0-41.728 0z"
|
|
1359
|
+
}, null, -1) ];
|
|
1360
|
+
|
|
1361
|
+
var arrow_left_default = export_helper_default(arrow_left_vue_vue_type_script_lang_default, [ [ "render", function(_ctx, _cache, $props, $setup, $data, $options) {
|
|
1362
|
+
return openBlock(), createElementBlock("svg", _hoisted_18, _hoisted_38);
|
|
1363
|
+
} ], [ "__file", "arrow-left.vue" ] ]), arrow_right_vue_vue_type_script_lang_default = {
|
|
1364
|
+
name: "ArrowRight"
|
|
1365
|
+
}, _hoisted_110 = {
|
|
1366
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1367
|
+
viewBox: "0 0 1024 1024"
|
|
1368
|
+
}, _hoisted_310 = [ createElementVNode("path", {
|
|
1369
|
+
fill: "currentColor",
|
|
1370
|
+
d: "M340.864 149.312a30.592 30.592 0 0 0 0 42.752L652.736 512 340.864 831.872a30.592 30.592 0 0 0 0 42.752 29.12 29.12 0 0 0 41.728 0L714.24 534.336a32 32 0 0 0 0-44.672L382.592 149.376a29.12 29.12 0 0 0-41.728 0z"
|
|
1371
|
+
}, null, -1) ];
|
|
1372
|
+
|
|
1373
|
+
var arrow_right_default = export_helper_default(arrow_right_vue_vue_type_script_lang_default, [ [ "render", function(_ctx, _cache, $props, $setup, $data, $options) {
|
|
1374
|
+
return openBlock(), createElementBlock("svg", _hoisted_110, _hoisted_310);
|
|
1375
|
+
} ], [ "__file", "arrow-right.vue" ] ]), arrow_up_vue_vue_type_script_lang_default = {
|
|
1337
1376
|
name: "ArrowUp"
|
|
1338
1377
|
}, _hoisted_112 = {
|
|
1339
1378
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -2644,7 +2683,7 @@ const NextMenuItem = defineComponent({
|
|
|
2644
2683
|
}, null) ]
|
|
2645
2684
|
}))) ]) ]);
|
|
2646
2685
|
}
|
|
2647
|
-
}), ns$
|
|
2686
|
+
}), ns$j = useNamespace("menu");
|
|
2648
2687
|
|
|
2649
2688
|
const NextMenu = withInstall(defineComponent({
|
|
2650
2689
|
name: "NextMenu",
|
|
@@ -2672,13 +2711,13 @@ const NextMenu = withInstall(defineComponent({
|
|
|
2672
2711
|
}
|
|
2673
2712
|
},
|
|
2674
2713
|
setup(props) {
|
|
2675
|
-
provide("ns", ns$
|
|
2714
|
+
provide("ns", ns$j);
|
|
2676
2715
|
const router = getCurrentInstance().appContext.config.globalProperties.$router, currentPath = router.currentRoute?.value.fullPath, activePath = ref(currentPath);
|
|
2677
2716
|
watch((() => router.currentRoute?.value), (to => {
|
|
2678
2717
|
activePath.value = to.fullPath;
|
|
2679
2718
|
}));
|
|
2680
2719
|
return () => createVNode(Fragment, null, [ createVNode(ElMenu, {
|
|
2681
|
-
class: [ ns$
|
|
2720
|
+
class: [ ns$j.b(), props.className ],
|
|
2682
2721
|
style: props.style,
|
|
2683
2722
|
defaultActive: activePath.value,
|
|
2684
2723
|
router: props.router,
|
|
@@ -2686,7 +2725,7 @@ const NextMenu = withInstall(defineComponent({
|
|
|
2686
2725
|
ellipsis: !0
|
|
2687
2726
|
}, {
|
|
2688
2727
|
default: () => [ createVNode(Fragment, null, [ props.menuTree.map((item => item.children?.length ? valueExist(item.meta?.isHide, !1) ? null : createVNode(ElSubMenu, {
|
|
2689
|
-
"popper-class": ns$
|
|
2728
|
+
"popper-class": ns$j.b("popper"),
|
|
2690
2729
|
index: item.path || item.id,
|
|
2691
2730
|
teleported: !0
|
|
2692
2731
|
}, {
|
|
@@ -2697,7 +2736,7 @@ const NextMenu = withInstall(defineComponent({
|
|
|
2697
2736
|
menuData: item.children
|
|
2698
2737
|
}, null)
|
|
2699
2738
|
}) : valueExist(item.meta?.isHide, !1) ? null : createVNode(ElMenuItem, {
|
|
2700
|
-
"popper-class": ns$
|
|
2739
|
+
"popper-class": ns$j.b("popper"),
|
|
2701
2740
|
index: item.path
|
|
2702
2741
|
}, {
|
|
2703
2742
|
default: () => [ createVNode(MenuItemTitle, {
|
|
@@ -2725,20 +2764,20 @@ var Sidebar$2 = defineComponent({
|
|
|
2725
2764
|
}
|
|
2726
2765
|
});
|
|
2727
2766
|
|
|
2728
|
-
const ns$
|
|
2767
|
+
const ns$i = useNamespace("layout-defaults");
|
|
2729
2768
|
|
|
2730
2769
|
var defaults = defineComponent({
|
|
2731
2770
|
props: {},
|
|
2732
|
-
setup: () => (provide("ns", ns$
|
|
2771
|
+
setup: () => (provide("ns", ns$i), {}),
|
|
2733
2772
|
render() {
|
|
2734
2773
|
const slots = this.$slots, _config = inject("options", {}), _emit = inject("__emit__", {});
|
|
2735
2774
|
slots.menu;
|
|
2736
2775
|
const isTabs = ref(!!slots.tabs);
|
|
2737
2776
|
return void 0 === slots.tabs && _config.showTabs && (isTabs.value = !0), createVNode(ElContainer, {
|
|
2738
|
-
class: ns$
|
|
2777
|
+
class: ns$i.b()
|
|
2739
2778
|
}, {
|
|
2740
2779
|
default: () => [ createVNode(Sidebar$2, null, null), createVNode("div", {
|
|
2741
|
-
class: [ ns$
|
|
2780
|
+
class: [ ns$i.b("content") ]
|
|
2742
2781
|
}, [ createVNode(Header$3, null, null), _config.showTabs ? slots.tabs ? slots.tabs?.() : createVNode(NextTabs, {
|
|
2743
2782
|
tabs: _config.tabs,
|
|
2744
2783
|
activeTab: _config.activeTab,
|
|
@@ -2746,7 +2785,7 @@ var defaults = defineComponent({
|
|
|
2746
2785
|
onSelect: (...arg) => _emit("tabsSelect", ...arg),
|
|
2747
2786
|
onClose: (...arg) => _emit("tabsClose", ...arg)
|
|
2748
2787
|
}, null) : null, createVNode("main", {
|
|
2749
|
-
class: [ ns$
|
|
2788
|
+
class: [ ns$i.bf("main"), ns$i.is("layout-tabs", isTabs.value) ]
|
|
2750
2789
|
}, [ slots.default?.() ]) ]) ]
|
|
2751
2790
|
});
|
|
2752
2791
|
}
|
|
@@ -2779,11 +2818,11 @@ var Header$2 = defineComponent({
|
|
|
2779
2818
|
}
|
|
2780
2819
|
});
|
|
2781
2820
|
|
|
2782
|
-
const ns$
|
|
2821
|
+
const ns$h = useNamespace("layout-transverse");
|
|
2783
2822
|
|
|
2784
2823
|
var transverse = defineComponent({
|
|
2785
2824
|
props: {},
|
|
2786
|
-
setup: () => (provide("ns", ns$
|
|
2825
|
+
setup: () => (provide("ns", ns$h), {}),
|
|
2787
2826
|
render() {
|
|
2788
2827
|
const slots = this.$slots, _config = inject("options", {}), _emit = inject("__emit__", {}), __slots_header = {};
|
|
2789
2828
|
slots[slots_config_headerMenu] && (__slots_header[slots_config_headerMenu] = () => slots[slots_config_headerMenu]()),
|
|
@@ -2800,7 +2839,7 @@ var transverse = defineComponent({
|
|
|
2800
2839
|
onSelect: (...arg) => _emit("tabsSelect", ...arg),
|
|
2801
2840
|
onClose: (...arg) => _emit("tabsClose", ...arg)
|
|
2802
2841
|
}, null) : null, createVNode("main", {
|
|
2803
|
-
class: [ ns$
|
|
2842
|
+
class: [ ns$h.b("main"), ns$h.is("layout-tabs", isTabs.value) ]
|
|
2804
2843
|
}, [ slots.default?.() ]) ]);
|
|
2805
2844
|
var s;
|
|
2806
2845
|
}
|
|
@@ -2842,11 +2881,11 @@ var Header$1 = defineComponent({
|
|
|
2842
2881
|
}
|
|
2843
2882
|
});
|
|
2844
2883
|
|
|
2845
|
-
const ns$
|
|
2884
|
+
const ns$g = useNamespace("layout-columns");
|
|
2846
2885
|
|
|
2847
2886
|
var columns = defineComponent({
|
|
2848
2887
|
props: {},
|
|
2849
|
-
setup: () => (provide("ns", ns$
|
|
2888
|
+
setup: () => (provide("ns", ns$g), {}),
|
|
2850
2889
|
render() {
|
|
2851
2890
|
const slots = this.$slots, _config = inject("options", {}), _emit = inject("__emit__", {}), __slots_header = {};
|
|
2852
2891
|
slots[slots_config_headerMenu] && (__slots_header[slots_config_headerMenu] = () => slots[slots_config_headerMenu]()),
|
|
@@ -2854,11 +2893,11 @@ var columns = defineComponent({
|
|
|
2854
2893
|
slots[slots_config_headerToolsSuffix] && (__slots_header[slots_config_headerToolsSuffix] = () => slots[slots_config_headerToolsSuffix]());
|
|
2855
2894
|
const isTabs = ref(!!slots.tabs);
|
|
2856
2895
|
return void 0 === slots.tabs && _config.showTabs && (isTabs.value = !0), createVNode(ElContainer, {
|
|
2857
|
-
class: ns$
|
|
2896
|
+
class: ns$g.b()
|
|
2858
2897
|
}, {
|
|
2859
2898
|
default: () => {
|
|
2860
2899
|
return [ createVNode(Sidebar$1, null, null), createVNode("div", {
|
|
2861
|
-
class: [ ns$
|
|
2900
|
+
class: [ ns$g.b("content") ]
|
|
2862
2901
|
}, [ createVNode(Header$1, null, (s = __slots_header, "function" == typeof s || "[object Object]" === Object.prototype.toString.call(s) && !isVNode(s) ? __slots_header : {
|
|
2863
2902
|
default: () => [ __slots_header ]
|
|
2864
2903
|
})), _config.showTabs ? slots.tabs ? slots.tabs?.() : createVNode(NextTabs, {
|
|
@@ -2868,7 +2907,7 @@ var columns = defineComponent({
|
|
|
2868
2907
|
onSelect: (...arg) => _emit("tabsSelect", ...arg),
|
|
2869
2908
|
onClose: (...arg) => _emit("tabsClose", ...arg)
|
|
2870
2909
|
}, null) : null, createVNode("main", {
|
|
2871
|
-
class: [ ns$
|
|
2910
|
+
class: [ ns$g.bf("main"), ns$g.is("layout-tabs", isTabs.value) ]
|
|
2872
2911
|
}, [ slots.default?.() ]) ]) ];
|
|
2873
2912
|
var s;
|
|
2874
2913
|
}
|
|
@@ -2914,21 +2953,21 @@ var Header = defineComponent({
|
|
|
2914
2953
|
}
|
|
2915
2954
|
});
|
|
2916
2955
|
|
|
2917
|
-
const ns$
|
|
2956
|
+
const ns$f = useNamespace("layout-classic");
|
|
2918
2957
|
|
|
2919
2958
|
var classic = defineComponent({
|
|
2920
2959
|
props: {},
|
|
2921
|
-
setup: () => (provide("ns", ns$
|
|
2922
|
-
ns: ns$
|
|
2960
|
+
setup: () => (provide("ns", ns$f), {
|
|
2961
|
+
ns: ns$f
|
|
2923
2962
|
}),
|
|
2924
2963
|
render() {
|
|
2925
2964
|
const slots = this.$slots, _config = inject("options", {}), _emit = inject("__emit__", {});
|
|
2926
2965
|
slots.menu;
|
|
2927
2966
|
const isTabs = ref(!!slots.tabs);
|
|
2928
2967
|
return void 0 === slots.tabs && _config.showTabs && (isTabs.value = !0), createVNode(Fragment, null, [ createVNode(Header, null, null), createVNode("div", {
|
|
2929
|
-
class: [ ns$
|
|
2968
|
+
class: [ ns$f.b("content"), ns$f.is("layout-tabs", isTabs.value) ]
|
|
2930
2969
|
}, [ createVNode(Sidebar, null, null), createVNode("div", {
|
|
2931
|
-
class: ns$
|
|
2970
|
+
class: ns$f.b("container")
|
|
2932
2971
|
}, [ _config.showTabs ? slots.tabs ? slots.tabs?.() : createVNode(NextTabs, {
|
|
2933
2972
|
tabs: _config.tabs,
|
|
2934
2973
|
activeTab: _config.activeTab,
|
|
@@ -2936,12 +2975,12 @@ var classic = defineComponent({
|
|
|
2936
2975
|
onSelect: (...arg) => _emit("tabsSelect", ...arg),
|
|
2937
2976
|
onClose: (...arg) => _emit("tabsClose", ...arg)
|
|
2938
2977
|
}, null) : null, createVNode("main", {
|
|
2939
|
-
class: [ ns$
|
|
2978
|
+
class: [ ns$f.b("main") ]
|
|
2940
2979
|
}, [ slots.default?.() ]) ]) ]) ]);
|
|
2941
2980
|
}
|
|
2942
2981
|
});
|
|
2943
2982
|
|
|
2944
|
-
const ns$
|
|
2983
|
+
const ns$e = useNamespace("layout"), layouts = {
|
|
2945
2984
|
defaults: markRaw(defaults),
|
|
2946
2985
|
transverse: markRaw(transverse),
|
|
2947
2986
|
columns: markRaw(columns),
|
|
@@ -2968,8 +3007,8 @@ const NextLayout = withInstall(defineComponent({
|
|
|
2968
3007
|
},
|
|
2969
3008
|
emits: [ "changeLanguage", "changeUserDropdown", "changeOptions", "tabsChange", "tabsSelect", "tabsClose" ],
|
|
2970
3009
|
setup(props, {slots: slots, emit: emit}) {
|
|
2971
|
-
const _config = ref(mergeWith(defaultConfig$
|
|
2972
|
-
provide("options", _config.value), provide("__ns__", ns$
|
|
3010
|
+
const _config = ref(mergeWith(defaultConfig$4, props.options, customizerCoverArray));
|
|
3011
|
+
provide("options", _config.value), provide("__ns__", ns$e), provide("__emit__", emit),
|
|
2973
3012
|
provide("__slots__", slots);
|
|
2974
3013
|
const updateOptions = cfg => {
|
|
2975
3014
|
_config.value = mergeWith(_config.value, cfg, customizerCoverArray), updateThemeColorCssVar(_config.value?.setting),
|
|
@@ -2993,15 +3032,15 @@ const NextLayout = withInstall(defineComponent({
|
|
|
2993
3032
|
const _activeSlots = {};
|
|
2994
3033
|
for (const key in slots) Object.prototype.hasOwnProperty.call(slots, key) && (_activeSlots[key] = () => slots[key]?.());
|
|
2995
3034
|
return createVNode("div", {
|
|
2996
|
-
class: [ ns$
|
|
3035
|
+
class: [ ns$e.b(), props.className ],
|
|
2997
3036
|
style: props.style
|
|
2998
3037
|
}, [ h(activeLayout.value, {}, {
|
|
2999
3038
|
..._activeSlots
|
|
3000
3039
|
}) ]);
|
|
3001
3040
|
}
|
|
3002
|
-
})), ns$
|
|
3041
|
+
})), ns$d = useNamespace("tabs");
|
|
3003
3042
|
|
|
3004
|
-
var Element$
|
|
3043
|
+
var Element$8 = defineComponent({
|
|
3005
3044
|
name: "NextTabs",
|
|
3006
3045
|
props: {
|
|
3007
3046
|
activeTab: {
|
|
@@ -3070,12 +3109,12 @@ var Element$7 = defineComponent({
|
|
|
3070
3109
|
tabsView.value.push(activeRoute)), emit("change", activeIndex.value, tabsView.value, "add");
|
|
3071
3110
|
}));
|
|
3072
3111
|
const renderContent = () => createVNode("nav", {
|
|
3073
|
-
class: ns$
|
|
3112
|
+
class: ns$d.b()
|
|
3074
3113
|
}, [ createVNode(ElScrollbar, null, {
|
|
3075
3114
|
default: () => [ createVNode("ul", {
|
|
3076
|
-
class: ns$
|
|
3115
|
+
class: ns$d.b("list")
|
|
3077
3116
|
}, [ tabsView.value.map(((tab, index) => tab ? createVNode("li", {
|
|
3078
|
-
class: [ "tab-item", ns$
|
|
3117
|
+
class: [ "tab-item", ns$d.is("active", activeIndex.value === index) ],
|
|
3079
3118
|
onClick: event => onClickTabItem(event, tab, index)
|
|
3080
3119
|
}, [ createVNode("i", {
|
|
3081
3120
|
class: [ "tab-icon", tab.meta?.icon ]
|
|
@@ -3106,11 +3145,11 @@ var Element$7 = defineComponent({
|
|
|
3106
3145
|
onCommand: onChange
|
|
3107
3146
|
}, {
|
|
3108
3147
|
default: () => createVNode("span", {
|
|
3109
|
-
class: ns$
|
|
3148
|
+
class: ns$d.b("tab-more")
|
|
3110
3149
|
}, [ createVNode("i", {
|
|
3111
|
-
class: [ ns$
|
|
3150
|
+
class: [ ns$d.be("tab-more", "box"), ns$d.be("tab-more", "top") ]
|
|
3112
3151
|
}, null), createVNode("i", {
|
|
3113
|
-
class: [ ns$
|
|
3152
|
+
class: [ ns$d.be("tab-more", "box"), ns$d.be("tab-more", "bottom") ]
|
|
3114
3153
|
}, null) ]),
|
|
3115
3154
|
dropdown: () => createVNode(ElDropdownMenu, null, {
|
|
3116
3155
|
default: () => [ createVNode(ElDropdownItem, {
|
|
@@ -3144,7 +3183,7 @@ var Element$7 = defineComponent({
|
|
|
3144
3183
|
}
|
|
3145
3184
|
});
|
|
3146
3185
|
|
|
3147
|
-
const NextTabs = withInstall(Element$
|
|
3186
|
+
const NextTabs = withInstall(Element$8), ns$c = useNamespace("container");
|
|
3148
3187
|
|
|
3149
3188
|
const NextContainer = withInstall(defineComponent({
|
|
3150
3189
|
name: "NextContainer",
|
|
@@ -3183,22 +3222,26 @@ const NextContainer = withInstall(defineComponent({
|
|
|
3183
3222
|
}), style;
|
|
3184
3223
|
}));
|
|
3185
3224
|
return () => props.scrollbar ? createVNode(ElScrollbar, {
|
|
3186
|
-
class: [ ns$
|
|
3225
|
+
class: [ ns$c.b(), props.className ],
|
|
3187
3226
|
style: props.style
|
|
3188
3227
|
}, {
|
|
3189
3228
|
default: () => [ slots.default?.() ]
|
|
3190
3229
|
}) : createVNode("div", {
|
|
3191
|
-
class: [ ns$
|
|
3230
|
+
class: [ ns$c.b(), props.className ],
|
|
3192
3231
|
style: {
|
|
3193
3232
|
...styles.value,
|
|
3194
3233
|
...props.style
|
|
3195
3234
|
}
|
|
3196
3235
|
}, [ props.card ? createVNode("div", {
|
|
3197
|
-
class: ns$
|
|
3236
|
+
class: ns$c.b("card")
|
|
3198
3237
|
}, [ slots.default?.() ]) : slots.default?.() ]);
|
|
3199
3238
|
}
|
|
3200
3239
|
}));
|
|
3201
3240
|
|
|
3241
|
+
function isEqual(value, other) {
|
|
3242
|
+
return baseIsEqual(value, other);
|
|
3243
|
+
}
|
|
3244
|
+
|
|
3202
3245
|
var defaultPropsConfig = {
|
|
3203
3246
|
className: {
|
|
3204
3247
|
type: String,
|
|
@@ -3268,7 +3311,7 @@ var defaultPropsConfig = {
|
|
|
3268
3311
|
|
|
3269
3312
|
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" ];
|
|
3270
3313
|
|
|
3271
|
-
var defaultConfig$
|
|
3314
|
+
var defaultConfig$3 = {
|
|
3272
3315
|
initLoadData: !0,
|
|
3273
3316
|
defaultContentHeight: 300,
|
|
3274
3317
|
fullscreenchangeContentHeight: !1,
|
|
@@ -3315,9 +3358,9 @@ var defaultConfig$2 = {
|
|
|
3315
3358
|
formColumnMinWidth: 350
|
|
3316
3359
|
};
|
|
3317
3360
|
|
|
3318
|
-
const columnSlotName = prop => "column-" + prop, searchFormSlotName = prop => "search-" + prop, formSlotName = prop => "form-" + prop, ns$
|
|
3361
|
+
const columnSlotName = prop => "column-" + prop, searchFormSlotName = prop => "search-" + prop, formSlotName = prop => "form-" + prop, ns$b = useNamespace("spin-loading");
|
|
3319
3362
|
|
|
3320
|
-
var
|
|
3363
|
+
var NextSpinLoading$1 = defineComponent({
|
|
3321
3364
|
name: "NextSpinLoading",
|
|
3322
3365
|
props: {
|
|
3323
3366
|
className: {
|
|
@@ -3337,32 +3380,36 @@ var SpinLoading = defineComponent({
|
|
|
3337
3380
|
default: ""
|
|
3338
3381
|
}
|
|
3339
3382
|
},
|
|
3340
|
-
setup() {
|
|
3341
|
-
const {t: t} = useLocale();
|
|
3342
|
-
return {
|
|
3343
|
-
|
|
3383
|
+
setup(props, {expose: expose}) {
|
|
3384
|
+
const {t: t} = useLocale(), elementInstance = ref();
|
|
3385
|
+
return expose({
|
|
3386
|
+
elementInstance: elementInstance
|
|
3387
|
+
}), {
|
|
3388
|
+
t: t,
|
|
3389
|
+
elementInstance: elementInstance
|
|
3344
3390
|
};
|
|
3345
3391
|
},
|
|
3346
3392
|
render() {
|
|
3347
3393
|
const _t = this.t, slots = this.$slots, props = this.$props, loadingText = props.tip || _t("next.loading");
|
|
3348
3394
|
return createVNode("div", {
|
|
3349
|
-
|
|
3395
|
+
ref: "elementInstance",
|
|
3396
|
+
class: [ ns$b.b(), props.className ],
|
|
3350
3397
|
style: props.style
|
|
3351
|
-
}, [ props.loading ? createVNode("div", {
|
|
3352
|
-
class: ns$
|
|
3398
|
+
}, [ slots.default?.(), props.loading ? createVNode("div", {
|
|
3399
|
+
class: ns$b.b("mask")
|
|
3353
3400
|
}, [ createVNode("span", {
|
|
3354
|
-
class: ns$
|
|
3401
|
+
class: ns$b.b("mask-dot")
|
|
3355
3402
|
}, [ createVNode("i", {
|
|
3356
|
-
class: ns$
|
|
3403
|
+
class: ns$b.be("mask", "dot-item")
|
|
3357
3404
|
}, null), createVNode("i", {
|
|
3358
|
-
class: ns$
|
|
3405
|
+
class: ns$b.be("mask", "dot-item")
|
|
3359
3406
|
}, null), createVNode("i", {
|
|
3360
|
-
class: ns$
|
|
3407
|
+
class: ns$b.be("mask", "dot-item")
|
|
3361
3408
|
}, null), createVNode("i", {
|
|
3362
|
-
class: ns$
|
|
3409
|
+
class: ns$b.be("mask", "dot-item")
|
|
3363
3410
|
}, null) ]), createVNode("span", {
|
|
3364
|
-
class: ns$
|
|
3365
|
-
}, [ loadingText ]) ]) : null
|
|
3411
|
+
class: ns$b.be("mask", "text")
|
|
3412
|
+
}, [ loadingText ]) ]) : null ]);
|
|
3366
3413
|
}
|
|
3367
3414
|
}), SearchColumn = defineComponent({
|
|
3368
3415
|
name: "SearchColumn",
|
|
@@ -4039,7 +4086,7 @@ var TableColumnOperations = defineComponent({
|
|
|
4039
4086
|
}
|
|
4040
4087
|
});
|
|
4041
4088
|
|
|
4042
|
-
const ns$
|
|
4089
|
+
const ns$a = useNamespace("dialog");
|
|
4043
4090
|
|
|
4044
4091
|
var NextDialog$1 = defineComponent({
|
|
4045
4092
|
name: "NextDialog",
|
|
@@ -4105,7 +4152,7 @@ var NextDialog$1 = defineComponent({
|
|
|
4105
4152
|
return () => createVNode(Fragment, null, [ createVNode(ElDialog, {
|
|
4106
4153
|
modelValue: visible.value,
|
|
4107
4154
|
"onUpdate:modelValue": $event => visible.value = $event,
|
|
4108
|
-
class: ns$
|
|
4155
|
+
class: ns$a.b(),
|
|
4109
4156
|
title: props.title,
|
|
4110
4157
|
appendToBody: props.appendToBody,
|
|
4111
4158
|
"destroy-on-close": !0,
|
|
@@ -4122,12 +4169,12 @@ var NextDialog$1 = defineComponent({
|
|
|
4122
4169
|
}, {
|
|
4123
4170
|
default: () => [ slots.default?.() ],
|
|
4124
4171
|
header: ({close: close, titleId: titleId, titleClass: titleClass}) => createVNode("div", {
|
|
4125
|
-
class: ns$
|
|
4172
|
+
class: ns$a.b("header")
|
|
4126
4173
|
}, [ createVNode("h4", {
|
|
4127
4174
|
id: titleId,
|
|
4128
4175
|
class: titleClass
|
|
4129
4176
|
}, [ props.title ]), createVNode("div", {
|
|
4130
|
-
class: ns$
|
|
4177
|
+
class: ns$a.e("header-right")
|
|
4131
4178
|
}, [ props.fullscreenBtn && createVNode("span", {
|
|
4132
4179
|
class: "icon-fullscreen",
|
|
4133
4180
|
onClick: () => isFullscreen.value = !isFullscreen.value
|
|
@@ -4161,7 +4208,7 @@ const tableSelectConfig = {
|
|
|
4161
4208
|
operations: !1
|
|
4162
4209
|
};
|
|
4163
4210
|
|
|
4164
|
-
var defaultConfig$
|
|
4211
|
+
var defaultConfig$2 = {
|
|
4165
4212
|
size: "default",
|
|
4166
4213
|
colSpan: 8,
|
|
4167
4214
|
labelWidth: "6em",
|
|
@@ -4176,7 +4223,7 @@ var defaultConfig$1 = {
|
|
|
4176
4223
|
resetText: null
|
|
4177
4224
|
};
|
|
4178
4225
|
|
|
4179
|
-
const ns$
|
|
4226
|
+
const ns$9 = useNamespace("form");
|
|
4180
4227
|
|
|
4181
4228
|
var NumberRangePicker = defineComponent({
|
|
4182
4229
|
name: "NumberRangePicker",
|
|
@@ -4216,7 +4263,7 @@ var NumberRangePicker = defineComponent({
|
|
|
4216
4263
|
}));
|
|
4217
4264
|
return () => createVNode(Fragment, null, [ createVNode("div", {
|
|
4218
4265
|
ref: numberRangeRef,
|
|
4219
|
-
class: ns$
|
|
4266
|
+
class: ns$9.e("number-range")
|
|
4220
4267
|
}, [ createVNode(ElInputNumber, {
|
|
4221
4268
|
modelValue: startNumber.value,
|
|
4222
4269
|
"onUpdate:modelValue": $event => startNumber.value = $event,
|
|
@@ -4226,7 +4273,7 @@ var NumberRangePicker = defineComponent({
|
|
|
4226
4273
|
disabled: disabled,
|
|
4227
4274
|
onChange: onChangeStart
|
|
4228
4275
|
}, null), createVNode("span", {
|
|
4229
|
-
class: ns$
|
|
4276
|
+
class: ns$9.em("number-range", "division")
|
|
4230
4277
|
}, [ t("next.date.rangeSeparator") ]), createVNode(ElInputNumber, {
|
|
4231
4278
|
modelValue: endNumber.value,
|
|
4232
4279
|
"onUpdate:modelValue": $event => endNumber.value = $event,
|
|
@@ -4245,7 +4292,7 @@ function _isSlot$3(s) {
|
|
|
4245
4292
|
return "function" == typeof s || "[object Object]" === Object.prototype.toString.call(s) && !isVNode(s);
|
|
4246
4293
|
}
|
|
4247
4294
|
|
|
4248
|
-
const ns$
|
|
4295
|
+
const ns$8 = useNamespace("form"), InputTableSelect = defineComponent({
|
|
4249
4296
|
name: "InputTableSelect",
|
|
4250
4297
|
props: {
|
|
4251
4298
|
modelValue: {
|
|
@@ -4273,7 +4320,7 @@ const ns$6 = useNamespace("form"), InputTableSelect = defineComponent({
|
|
|
4273
4320
|
},
|
|
4274
4321
|
emits: [ "select" ],
|
|
4275
4322
|
setup(props, {emit: emit}) {
|
|
4276
|
-
const {t: t} = useLocale(), _disabled = props.disabled, _column = props.column, _placeholder = _column.placeholder || t("next.form.select") + _column.label, _tableDefaultConfig = deepClone(defaultConfig$
|
|
4323
|
+
const {t: t} = useLocale(), _disabled = props.disabled, _column = props.column, _placeholder = _column.placeholder || t("next.form.select") + _column.label, _tableDefaultConfig = deepClone(defaultConfig$3), _tableSelectConfig = deepClone(tableSelectConfig), _options = merge$1(_tableDefaultConfig, _tableSelectConfig, _column.tableSelect), tableSelectDialog = reactive({
|
|
4277
4324
|
visible: !1,
|
|
4278
4325
|
title: _column.label + t("next.form.tableSelect"),
|
|
4279
4326
|
dialogWidth: _options.dialogWidth
|
|
@@ -4344,18 +4391,18 @@ const ns$6 = useNamespace("form"), InputTableSelect = defineComponent({
|
|
|
4344
4391
|
}, renderContent = () => {
|
|
4345
4392
|
let _slot, _slot2;
|
|
4346
4393
|
return createVNode(Fragment, null, [ createVNode("div", {
|
|
4347
|
-
class: [ "el-input", ns$
|
|
4394
|
+
class: [ "el-input", ns$8.e("input-table"), ns$8.is("disabled", _disabled) ]
|
|
4348
4395
|
}, [ createVNode("div", {
|
|
4349
4396
|
class: "el-input__wrapper"
|
|
4350
4397
|
}, [ tags?.value.length ? createVNode("span", {
|
|
4351
|
-
class: ns$
|
|
4398
|
+
class: ns$8.em("input-table", "value")
|
|
4352
4399
|
}, [ tags.value.map(((tag, index) => createVNode(ElTag, {
|
|
4353
4400
|
closable: !_disabled,
|
|
4354
4401
|
onClose: () => _onCloseTag(0, index)
|
|
4355
4402
|
}, {
|
|
4356
4403
|
default: () => [ tag.label ]
|
|
4357
4404
|
}))), tagsMore?.value?.length ? createVNode(ElTooltip, {
|
|
4358
|
-
"popper-class": ns$
|
|
4405
|
+
"popper-class": ns$8.e("tooltip-tags"),
|
|
4359
4406
|
placement: "bottom",
|
|
4360
4407
|
effect: "light"
|
|
4361
4408
|
}, {
|
|
@@ -4369,10 +4416,10 @@ const ns$6 = useNamespace("form"), InputTableSelect = defineComponent({
|
|
|
4369
4416
|
default: () => [ tag.label ]
|
|
4370
4417
|
})))
|
|
4371
4418
|
}) : null ]) : createVNode("span", {
|
|
4372
|
-
class: ns$
|
|
4419
|
+
class: ns$8.em("input-table", "placeholder")
|
|
4373
4420
|
}, [ _placeholder ]) ]), createVNode(ElButton, {
|
|
4374
4421
|
type: "primary",
|
|
4375
|
-
class: ns$
|
|
4422
|
+
class: ns$8.em("input-table", "append"),
|
|
4376
4423
|
disabled: _disabled,
|
|
4377
4424
|
icon: search_default,
|
|
4378
4425
|
onClick: onClickTableDialog
|
|
@@ -4386,7 +4433,7 @@ const ns$6 = useNamespace("form"), InputTableSelect = defineComponent({
|
|
|
4386
4433
|
onClose: onCloseTableDialog
|
|
4387
4434
|
}, {
|
|
4388
4435
|
default: () => [ createVNode("div", {
|
|
4389
|
-
class: ns$
|
|
4436
|
+
class: ns$8.em("input-table", "content")
|
|
4390
4437
|
}, [ createVNode(ElRadioGroup, {
|
|
4391
4438
|
modelValue: sinleSelection.value
|
|
4392
4439
|
}, {
|
|
@@ -4409,7 +4456,7 @@ const ns$6 = useNamespace("form"), InputTableSelect = defineComponent({
|
|
|
4409
4456
|
}) ]
|
|
4410
4457
|
}) ]
|
|
4411
4458
|
}) ]), createVNode("div", {
|
|
4412
|
-
class: ns$
|
|
4459
|
+
class: ns$8.em("input-table", "footer")
|
|
4413
4460
|
}, [ createVNode(ElButton, {
|
|
4414
4461
|
onClick: onResetTableSelect
|
|
4415
4462
|
}, _isSlot$3(_slot = t("next.form.reset")) ? _slot : {
|
|
@@ -4425,7 +4472,7 @@ const ns$6 = useNamespace("form"), InputTableSelect = defineComponent({
|
|
|
4425
4472
|
};
|
|
4426
4473
|
return () => createVNode(Fragment, null, [ renderContent() ]);
|
|
4427
4474
|
}
|
|
4428
|
-
}), ns$
|
|
4475
|
+
}), ns$7 = useNamespace("form");
|
|
4429
4476
|
|
|
4430
4477
|
var UploadImage = defineComponent({
|
|
4431
4478
|
name: "UploadImage",
|
|
@@ -4474,7 +4521,7 @@ var UploadImage = defineComponent({
|
|
|
4474
4521
|
let urls = [];
|
|
4475
4522
|
return "string" == typeof value ? urls = [ value ] : "[object Array]" === Object.prototype.toString.call(value) && (urls = value),
|
|
4476
4523
|
urls = urls.filter((url => !!url)), urls.length ? createVNode(ElImage, {
|
|
4477
|
-
class: ns$
|
|
4524
|
+
class: ns$7.e("preview-image"),
|
|
4478
4525
|
src: urls[0],
|
|
4479
4526
|
previewSrcList: urls,
|
|
4480
4527
|
"preview-teleported": !0,
|
|
@@ -4489,7 +4536,7 @@ var UploadImage = defineComponent({
|
|
|
4489
4536
|
})
|
|
4490
4537
|
}) : null;
|
|
4491
4538
|
})(), _disabled ? null : createVNode(ElUpload, {
|
|
4492
|
-
class: [ ns$
|
|
4539
|
+
class: [ ns$7.b("upload-image"), props.className ],
|
|
4493
4540
|
style: props.style,
|
|
4494
4541
|
"list-type": props.listType,
|
|
4495
4542
|
"auto-upload": !1,
|
|
@@ -4615,9 +4662,9 @@ var UploadImage = defineComponent({
|
|
|
4615
4662
|
}
|
|
4616
4663
|
});
|
|
4617
4664
|
|
|
4618
|
-
const ns$
|
|
4665
|
+
const ns$6 = useNamespace("form");
|
|
4619
4666
|
|
|
4620
|
-
var Element$
|
|
4667
|
+
var Element$6 = defineComponent({
|
|
4621
4668
|
name: "NextForm",
|
|
4622
4669
|
props: {
|
|
4623
4670
|
options: {
|
|
@@ -4635,7 +4682,7 @@ var Element$5 = defineComponent({
|
|
|
4635
4682
|
},
|
|
4636
4683
|
emits: [ "submit", "close", "reset" ],
|
|
4637
4684
|
setup(props, {slots: slots, emit: emit, expose: expose}) {
|
|
4638
|
-
const _config = deepClone(defaultConfig$
|
|
4685
|
+
const _config = deepClone(defaultConfig$2), 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({});
|
|
4639
4686
|
watch((() => [ props.columns, props.formDatum ]), (() => {
|
|
4640
4687
|
(() => {
|
|
4641
4688
|
const columns = props.columns;
|
|
@@ -4979,7 +5026,7 @@ var Element$5 = defineComponent({
|
|
|
4979
5026
|
let _slot;
|
|
4980
5027
|
return createVNode(ElForm, {
|
|
4981
5028
|
ref: ruleFormRef,
|
|
4982
|
-
class: ns$
|
|
5029
|
+
class: ns$6.b(),
|
|
4983
5030
|
inline: !1,
|
|
4984
5031
|
model: formParams,
|
|
4985
5032
|
size: options.size
|
|
@@ -5000,7 +5047,7 @@ var Element$5 = defineComponent({
|
|
|
5000
5047
|
}, {
|
|
5001
5048
|
label: () => column.label ? createVNode(Fragment, null, [ createVNode(NextTextEllipsis, {
|
|
5002
5049
|
content: t(column.label),
|
|
5003
|
-
class: ns$
|
|
5050
|
+
class: ns$6.e("item-label")
|
|
5004
5051
|
}, null), column.tip ? createVNode(ElTooltip, {
|
|
5005
5052
|
effect: "dark",
|
|
5006
5053
|
content: column.tip,
|
|
@@ -5020,7 +5067,7 @@ var Element$5 = defineComponent({
|
|
|
5020
5067
|
}))), "function" == typeof s || "[object Object]" === Object.prototype.toString.call(s) && !isVNode(s) ? _slot : {
|
|
5021
5068
|
default: () => [ _slot ]
|
|
5022
5069
|
})), _isEditing.value && options.showFooter ? createVNode("div", {
|
|
5023
|
-
class: ns$
|
|
5070
|
+
class: ns$6.e("footer")
|
|
5024
5071
|
}, [ createVNode(ElButton, {
|
|
5025
5072
|
type: "primary",
|
|
5026
5073
|
loading: submitLoading.value,
|
|
@@ -5040,7 +5087,7 @@ var Element$5 = defineComponent({
|
|
|
5040
5087
|
}
|
|
5041
5088
|
});
|
|
5042
5089
|
|
|
5043
|
-
const NextTreeSelect = withInstall(treeSelect), NextForm = withInstall(Element$
|
|
5090
|
+
const NextTreeSelect = withInstall(treeSelect), NextForm = withInstall(Element$6);
|
|
5044
5091
|
|
|
5045
5092
|
var AddEditForm = defineComponent({
|
|
5046
5093
|
name: "AddEditForm",
|
|
@@ -5097,18 +5144,18 @@ function _isSlot(s) {
|
|
|
5097
5144
|
return "function" == typeof s || "[object Object]" === Object.prototype.toString.call(s) && !isVNode(s);
|
|
5098
5145
|
}
|
|
5099
5146
|
|
|
5100
|
-
const ns$
|
|
5147
|
+
const ns$5 = useNamespace("crud-table");
|
|
5101
5148
|
|
|
5102
|
-
var Element$
|
|
5149
|
+
var Element$5 = defineComponent({
|
|
5103
5150
|
name: "NextCrudTable",
|
|
5104
5151
|
props: defaultPropsConfig,
|
|
5105
5152
|
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" ],
|
|
5106
5153
|
setup(props, {emit: emit, slots: slots, expose: expose}) {
|
|
5107
|
-
const _config = deepClone(defaultConfig$
|
|
5154
|
+
const _config = deepClone(defaultConfig$3), _options = computed((() => {
|
|
5108
5155
|
const cfg = unref(props.options);
|
|
5109
5156
|
return merge$1(_config, cfg);
|
|
5110
5157
|
})), options = unref(_options);
|
|
5111
|
-
provide("options", computed((() => _options.value))), provide("ns", ns$
|
|
5158
|
+
provide("options", computed((() => _options.value))), provide("ns", ns$5);
|
|
5112
5159
|
const {t: t} = useLocale(), _columns = ref(options.columns), _searchColumns = ref([]), _formColumns = ref([]), _updateColumnsAll = ops => {
|
|
5113
5160
|
((options, cb) => {
|
|
5114
5161
|
const _columns = reactive(options.columns), _loadDicData = col => {
|
|
@@ -5230,7 +5277,7 @@ var Element$4 = defineComponent({
|
|
|
5230
5277
|
return params;
|
|
5231
5278
|
})()), onConfirmSearch = searchParams => {
|
|
5232
5279
|
const params = deepClone(toRaw(searchParams));
|
|
5233
|
-
|
|
5280
|
+
isEqual(_searchFormParams.value, params) || (props.page.pageIndex = 1, _searchFormParams.value = params),
|
|
5234
5281
|
emit("confirm-search", params);
|
|
5235
5282
|
}, onClearSearch = () => {
|
|
5236
5283
|
emit("clear-search");
|
|
@@ -5349,11 +5396,11 @@ var Element$4 = defineComponent({
|
|
|
5349
5396
|
});
|
|
5350
5397
|
return () => createVNode(Fragment, null, [ createVNode(Fragment, null, [ createVNode("div", {
|
|
5351
5398
|
ref: crudTableRef,
|
|
5352
|
-
class: [ ns$
|
|
5399
|
+
class: [ ns$5.b(), props.className ],
|
|
5353
5400
|
style: props.style
|
|
5354
5401
|
}, [ options.showSearchForm || options.showHeaderMenu ? createVNode("header", {
|
|
5355
5402
|
ref: headerRef,
|
|
5356
|
-
class: ns$
|
|
5403
|
+
class: ns$5.b("header")
|
|
5357
5404
|
}, [ options.showSearchForm && createVNode(HeaderSearch, {
|
|
5358
5405
|
columns: _searchColumns.value,
|
|
5359
5406
|
onZoomResize: updateTableContentHeight,
|
|
@@ -5367,12 +5414,12 @@ var Element$4 = defineComponent({
|
|
|
5367
5414
|
onClickRefresh: onClickRefresh
|
|
5368
5415
|
}, _isSlot(headerMenu_solts) ? headerMenu_solts : {
|
|
5369
5416
|
default: () => [ headerMenu_solts ]
|
|
5370
|
-
}), slots["table-head-tip"]?.() ]) : null, createVNode(
|
|
5417
|
+
}), slots["table-head-tip"]?.() ]) : null, createVNode(NextSpinLoading$1, {
|
|
5371
5418
|
loading: props.loading
|
|
5372
5419
|
}, {
|
|
5373
5420
|
default: () => [ createVNode("div", {
|
|
5374
5421
|
ref: tableRef,
|
|
5375
|
-
class: ns$
|
|
5422
|
+
class: ns$5.b("content")
|
|
5376
5423
|
}, [ createVNode(ElTable, {
|
|
5377
5424
|
data: tableData.value,
|
|
5378
5425
|
height: tableContentHeight.value,
|
|
@@ -5435,7 +5482,7 @@ var Element$4 = defineComponent({
|
|
|
5435
5482
|
}) ]) ]
|
|
5436
5483
|
}), options.isPagination ? createVNode("div", {
|
|
5437
5484
|
ref: footerRef,
|
|
5438
|
-
class: ns$
|
|
5485
|
+
class: ns$5.b("footer")
|
|
5439
5486
|
}, [ createVNode(FooterPagination, {
|
|
5440
5487
|
page: props.page,
|
|
5441
5488
|
onChange: onChangePagination
|
|
@@ -5462,7 +5509,7 @@ var Element$4 = defineComponent({
|
|
|
5462
5509
|
}
|
|
5463
5510
|
});
|
|
5464
5511
|
|
|
5465
|
-
const NextCrudTable = withInstall(Element$
|
|
5512
|
+
const NextCrudTable = withInstall(Element$5);
|
|
5466
5513
|
|
|
5467
5514
|
var propsConfig = {
|
|
5468
5515
|
className: {
|
|
@@ -5493,15 +5540,15 @@ var propsConfig = {
|
|
|
5493
5540
|
total: 0
|
|
5494
5541
|
})
|
|
5495
5542
|
}
|
|
5496
|
-
}, defaultConfig = {};
|
|
5543
|
+
}, defaultConfig$1 = {};
|
|
5497
5544
|
|
|
5498
|
-
const ns$
|
|
5545
|
+
const ns$4 = useNamespace("crud-table-virtualized");
|
|
5499
5546
|
|
|
5500
5547
|
const NextCrudTableVirtualized = withInstall(defineComponent({
|
|
5501
5548
|
name: "NextCrudTableVirtualized",
|
|
5502
5549
|
props: propsConfig,
|
|
5503
5550
|
setup(props, {emit: emit}) {
|
|
5504
|
-
const _config = deepClone(defaultConfig), _options = computed((() => {
|
|
5551
|
+
const _config = deepClone(defaultConfig$1), _options = computed((() => {
|
|
5505
5552
|
const cfg = unref(props.options);
|
|
5506
5553
|
return merge$1(_config, cfg);
|
|
5507
5554
|
})), options = unref(_options);
|
|
@@ -5516,7 +5563,7 @@ const NextCrudTableVirtualized = withInstall(defineComponent({
|
|
|
5516
5563
|
emit("close-add-edit");
|
|
5517
5564
|
};
|
|
5518
5565
|
return () => createVNode(Fragment, null, [ createVNode("div", {
|
|
5519
|
-
class: [ ns$
|
|
5566
|
+
class: [ ns$4.b(), props.className ]
|
|
5520
5567
|
}, [ createVNode(NextSpinLoading, null, null), createVNode(NextDialog, {
|
|
5521
5568
|
modelValue: addEditDialog.visible,
|
|
5522
5569
|
"onUpdate:modelValue": $event => addEditDialog.visible = $event,
|
|
@@ -5527,7 +5574,7 @@ const NextCrudTableVirtualized = withInstall(defineComponent({
|
|
|
5527
5574
|
onClose: onCloseAddEditDialog
|
|
5528
5575
|
}, null) ]) ]);
|
|
5529
5576
|
}
|
|
5530
|
-
})), NextSpinLoading = withInstall(
|
|
5577
|
+
})), NextSpinLoading = withInstall(NextSpinLoading$1), ns$3 = useNamespace("upload");
|
|
5531
5578
|
|
|
5532
5579
|
const NextUpload = withInstall(defineComponent({
|
|
5533
5580
|
name: "NextUpload",
|
|
@@ -5562,7 +5609,7 @@ const NextUpload = withInstall(defineComponent({
|
|
|
5562
5609
|
const slots = this.$slots, props = this.$props, emit = this.$emit, _t = this.t, uploadfilesPreview = ref([]), body = document.getElementsByTagName("body")[0];
|
|
5563
5610
|
let previewImagesContainer = null;
|
|
5564
5611
|
return createVNode(ElUpload, {
|
|
5565
|
-
class: [ ns$
|
|
5612
|
+
class: [ ns$3.b(), props.className ],
|
|
5566
5613
|
style: props.style,
|
|
5567
5614
|
"list-type": props.listType,
|
|
5568
5615
|
"auto-upload": !1,
|
|
@@ -5600,9 +5647,9 @@ const NextUpload = withInstall(defineComponent({
|
|
|
5600
5647
|
})
|
|
5601
5648
|
});
|
|
5602
5649
|
}
|
|
5603
|
-
})), ns = useNamespace("video-player");
|
|
5650
|
+
})), ns$2 = useNamespace("video-player");
|
|
5604
5651
|
|
|
5605
|
-
var Element$
|
|
5652
|
+
var Element$2 = defineComponent({
|
|
5606
5653
|
name: "NextVideoPlayer",
|
|
5607
5654
|
props: {
|
|
5608
5655
|
className: {
|
|
@@ -5675,7 +5722,7 @@ var Element$1 = defineComponent({
|
|
|
5675
5722
|
if (!classNames || !classNames.length) throw new Error("模型类别不能未空!");
|
|
5676
5723
|
container.innerHTML = "", tf.loadGraphModel(modelUrl).then((model => {
|
|
5677
5724
|
const canvas = document.createElement("canvas");
|
|
5678
|
-
canvas.className = ns.b("recongition"), container.appendChild(canvas);
|
|
5725
|
+
canvas.className = ns$2.b("recongition"), container.appendChild(canvas);
|
|
5679
5726
|
const ctx = canvas.getContext("2d"), detect_ctx = document.createElement("canvas").getContext("2d");
|
|
5680
5727
|
video.ontimeupdate = () => {
|
|
5681
5728
|
const {videoWidth: videoWidth, videoHeight: videoHeight, offsetTop: offsetTop, offsetLeft: offsetLeft} = video;
|
|
@@ -5846,19 +5893,926 @@ var Element$1 = defineComponent({
|
|
|
5846
5893
|
});
|
|
5847
5894
|
return () => createVNode(Fragment, null, [ createVNode("div", {
|
|
5848
5895
|
ref: videoBoxRef,
|
|
5849
|
-
class: [ ns.b(), props.className ],
|
|
5896
|
+
class: [ ns$2.b(), props.className ],
|
|
5850
5897
|
style: props.style
|
|
5851
5898
|
}, null) ]);
|
|
5852
5899
|
}
|
|
5853
5900
|
});
|
|
5854
5901
|
|
|
5855
|
-
const NextVideoPlayer = withInstall(Element$
|
|
5902
|
+
const NextVideoPlayer = withInstall(Element$2);
|
|
5856
5903
|
|
|
5857
5904
|
const NextDragResize = withInstall(defineComponent({
|
|
5858
5905
|
name: "NextDragResize",
|
|
5859
5906
|
props: {},
|
|
5860
5907
|
setup: () => () => createVNode(Fragment, null, [ createVNode(Fragment, null, null) ])
|
|
5861
|
-
}))
|
|
5908
|
+
})), colors = [ "#5470c6", "#91cc75", "#fac858", "#ee6666", "#73c0de", "#3ba272", "#fc8452", "#9a60b4", "#ea7ccc" ], convertToLabel = rect => {
|
|
5909
|
+
const label_type = rect.type, x_center = rect.startX + rect.rectWidth / 2, y_center = rect.startY + rect.rectHeight / 2;
|
|
5910
|
+
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)) ];
|
|
5911
|
+
}, canvertToCanvas = (labelData, canvasWidth, canvasHeight) => {
|
|
5912
|
+
const [label_type, x_center, y_center, width, height] = labelData, rectWidth = width * canvasWidth, rectHeight = height * canvasHeight, startX = x_center * canvasWidth - rectWidth / 2, startY = y_center * canvasHeight - rectHeight / 2;
|
|
5913
|
+
return {
|
|
5914
|
+
type: label_type,
|
|
5915
|
+
startX: Math.ceil(startX),
|
|
5916
|
+
startY: Math.ceil(startY),
|
|
5917
|
+
rectWidth: Math.ceil(rectWidth),
|
|
5918
|
+
rectHeight: Math.ceil(rectHeight),
|
|
5919
|
+
canvasWidth: canvasWidth,
|
|
5920
|
+
canvasHeight: canvasHeight
|
|
5921
|
+
};
|
|
5922
|
+
};
|
|
5923
|
+
|
|
5924
|
+
var ContextMenuLabel = defineComponent({
|
|
5925
|
+
props: {
|
|
5926
|
+
labelRect: {
|
|
5927
|
+
type: Object,
|
|
5928
|
+
default: () => ({})
|
|
5929
|
+
},
|
|
5930
|
+
classes: {
|
|
5931
|
+
type: Array,
|
|
5932
|
+
default: () => []
|
|
5933
|
+
},
|
|
5934
|
+
activateRect: {
|
|
5935
|
+
type: Object,
|
|
5936
|
+
default: null
|
|
5937
|
+
}
|
|
5938
|
+
},
|
|
5939
|
+
emits: [ "close", "select", "delete" ],
|
|
5940
|
+
setup(props, {emit: emit}) {
|
|
5941
|
+
const ns = inject("ns", {}), onClose = () => {
|
|
5942
|
+
emit("close");
|
|
5943
|
+
}, onDelete = () => {
|
|
5944
|
+
emit("delete", props.activateRect);
|
|
5945
|
+
}, activateIndex = ref();
|
|
5946
|
+
watch((() => props.activateRect), (() => {
|
|
5947
|
+
const {type: type} = props.activateRect;
|
|
5948
|
+
activateIndex.value = isValueExist(type) ? type : null;
|
|
5949
|
+
}), {
|
|
5950
|
+
deep: !0,
|
|
5951
|
+
immediate: !0
|
|
5952
|
+
});
|
|
5953
|
+
const labelRectWidthHeight = ref({
|
|
5954
|
+
width: 0,
|
|
5955
|
+
height: 0
|
|
5956
|
+
});
|
|
5957
|
+
onMounted((() => {
|
|
5958
|
+
const {clientWidth: clientWidth, clientHeight: clientHeight} = labelMenuRef.value;
|
|
5959
|
+
labelRectWidthHeight.value.width = clientWidth, labelRectWidthHeight.value.height = clientHeight;
|
|
5960
|
+
}));
|
|
5961
|
+
const labelMenuRef = ref(), labelStyleFixed = computed((() => {
|
|
5962
|
+
const {left: left, top: top, canvasHeight: canvasHeight} = props.labelRect, height_diff = top + labelRectWidthHeight.value.height - canvasHeight;
|
|
5963
|
+
let y = top;
|
|
5964
|
+
return height_diff > 0 && (y -= height_diff), {
|
|
5965
|
+
top: y + "px",
|
|
5966
|
+
left: left + "px"
|
|
5967
|
+
};
|
|
5968
|
+
})), renderContent = () => createVNode("div", {
|
|
5969
|
+
ref: labelMenuRef,
|
|
5970
|
+
class: [ ns.b("contextmenu-label") ],
|
|
5971
|
+
style: labelStyleFixed.value
|
|
5972
|
+
}, [ createVNode("div", {
|
|
5973
|
+
class: "label-head"
|
|
5974
|
+
}, [ createVNode("span", {
|
|
5975
|
+
style: "padding-right: 30px"
|
|
5976
|
+
}, [ createTextVNode("标签选择") ]), createVNode(ElIcon, {
|
|
5977
|
+
size: 16,
|
|
5978
|
+
onClick: onClose
|
|
5979
|
+
}, {
|
|
5980
|
+
default: () => [ createVNode(close_default, null, null) ]
|
|
5981
|
+
}) ]), createVNode("ul", {
|
|
5982
|
+
class: "label-main"
|
|
5983
|
+
}, [ props.classes.map(((name, index) => createVNode("li", {
|
|
5984
|
+
key: index,
|
|
5985
|
+
onClick: () => (index => {
|
|
5986
|
+
activateIndex.value = index, emit("select", index);
|
|
5987
|
+
})(index),
|
|
5988
|
+
class: {
|
|
5989
|
+
"activate-label": activateIndex.value === index
|
|
5990
|
+
}
|
|
5991
|
+
}, [ createVNode("span", {
|
|
5992
|
+
style: {
|
|
5993
|
+
"background-color": colors[index % colors.length]
|
|
5994
|
+
},
|
|
5995
|
+
class: "label-line"
|
|
5996
|
+
}, null), createVNode("span", null, [ name ]) ]))) ]), isValueExist(activateIndex.value) ? createVNode("div", {
|
|
5997
|
+
style: "margin: 10px auto 0"
|
|
5998
|
+
}, [ createVNode(ElButton, {
|
|
5999
|
+
icon: delete_default,
|
|
6000
|
+
plain: !0,
|
|
6001
|
+
size: "small",
|
|
6002
|
+
type: "danger",
|
|
6003
|
+
onClick: onDelete
|
|
6004
|
+
}, {
|
|
6005
|
+
default: () => [ createTextVNode("删除标注框") ]
|
|
6006
|
+
}) ]) : null ]);
|
|
6007
|
+
return () => createVNode(Fragment, null, [ renderContent() ]);
|
|
6008
|
+
}
|
|
6009
|
+
});
|
|
6010
|
+
|
|
6011
|
+
const {hexToRgb: hexToRgb} = useChangeColor();
|
|
6012
|
+
|
|
6013
|
+
var DraggableRect = defineComponent({
|
|
6014
|
+
props: {
|
|
6015
|
+
parentEl: {
|
|
6016
|
+
type: Object,
|
|
6017
|
+
default: null
|
|
6018
|
+
},
|
|
6019
|
+
rect: {
|
|
6020
|
+
type: Object,
|
|
6021
|
+
default: () => ({})
|
|
6022
|
+
},
|
|
6023
|
+
color: {
|
|
6024
|
+
type: String,
|
|
6025
|
+
default: null
|
|
6026
|
+
}
|
|
6027
|
+
},
|
|
6028
|
+
emits: [ "draggle-resize", "contextmenu" ],
|
|
6029
|
+
setup(props, {emit: emit}) {
|
|
6030
|
+
const isDraggle = ref(!1), isResizeCorner = ref({
|
|
6031
|
+
topLeft: !1,
|
|
6032
|
+
topCenter: !1,
|
|
6033
|
+
topRight: !1,
|
|
6034
|
+
leftCenter: !1,
|
|
6035
|
+
rightCenter: !1,
|
|
6036
|
+
bottomLeft: !1,
|
|
6037
|
+
bottomCenter: !1,
|
|
6038
|
+
bottomRight: !1
|
|
6039
|
+
}), draggleOffset = ref({
|
|
6040
|
+
diff_x: null,
|
|
6041
|
+
diff_y: null
|
|
6042
|
+
});
|
|
6043
|
+
let parentRect = {};
|
|
6044
|
+
const rect = toRef(props.rect), onMouseup = e => {
|
|
6045
|
+
e.preventDefault(), e.stopPropagation(), isDraggle.value = !1, isResizeCorner.value.topLeft = !1,
|
|
6046
|
+
isResizeCorner.value.topCenter = !1, isResizeCorner.value.topRight = !1, isResizeCorner.value.leftCenter = !1,
|
|
6047
|
+
isResizeCorner.value.rightCenter = !1, isResizeCorner.value.bottomLeft = !1, isResizeCorner.value.bottomCenter = !1,
|
|
6048
|
+
isResizeCorner.value.bottomRight = !1, emit("draggle-resize", rect.value);
|
|
6049
|
+
}, onMousemove = e => {
|
|
6050
|
+
if (isDraggle.value) {
|
|
6051
|
+
const newLeft = e.clientX - parentRect.left - draggleOffset.value.diff_x, newTop = e.clientY - parentRect.top - draggleOffset.value.diff_y;
|
|
6052
|
+
rect.value.startX = Math.max(0, Math.min(newLeft, parentRect.width - rect.value.rectWidth)),
|
|
6053
|
+
rect.value.startY = Math.max(0, Math.min(newTop, parentRect.height - rect.value.rectHeight));
|
|
6054
|
+
}
|
|
6055
|
+
if (isResizeCorner.value.bottomCenter) {
|
|
6056
|
+
let newHeight = e.clientY - parentRect.top - rect.value.startY;
|
|
6057
|
+
newHeight < 30 && (newHeight = 30), newHeight + rect.value.startY > parentRect.height && (newHeight = parentRect.height - rect.value.startY),
|
|
6058
|
+
rect.value.rectHeight = newHeight;
|
|
6059
|
+
}
|
|
6060
|
+
if (isResizeCorner.value.topCenter) {
|
|
6061
|
+
let newTop = e.clientY - parentRect.top, newHeight = rect.value.startY - newTop + rect.value.rectHeight;
|
|
6062
|
+
if (newTop < 0) return;
|
|
6063
|
+
if (newHeight < 30) return;
|
|
6064
|
+
rect.value.rectHeight = newHeight, rect.value.startY = Math.max(0, Math.min(newTop, parentRect.height - rect.value.rectHeight));
|
|
6065
|
+
}
|
|
6066
|
+
if (isResizeCorner.value.leftCenter) {
|
|
6067
|
+
let newLeft = e.clientX - parentRect.left, newWidth = rect.value.startX - newLeft + rect.value.rectWidth;
|
|
6068
|
+
if (newLeft < 0) return;
|
|
6069
|
+
if (newWidth < 30) return;
|
|
6070
|
+
rect.value.startX = Math.max(0, Math.min(newLeft, parentRect.width - rect.value.rectWidth)),
|
|
6071
|
+
rect.value.rectWidth = newWidth;
|
|
6072
|
+
}
|
|
6073
|
+
if (isResizeCorner.value.rightCenter) {
|
|
6074
|
+
let newWidth = e.clientX - parentRect.left - rect.value.startX;
|
|
6075
|
+
newWidth < 30 && (newWidth = 30), newWidth + rect.value.startX > parentRect.width && (newWidth = parentRect.width - rect.value.startX),
|
|
6076
|
+
rect.value.rectWidth = newWidth;
|
|
6077
|
+
}
|
|
6078
|
+
if (isResizeCorner.value.bottomRight) {
|
|
6079
|
+
let newWidth = e.clientX - parentRect.left - rect.value.startX, newHeight = e.clientY - parentRect.top - rect.value.startY;
|
|
6080
|
+
newWidth < 30 && (newWidth = 30), newHeight < 30 && (newHeight = 30), newWidth + rect.value.startX > parentRect.width && (newWidth = parentRect.width - rect.value.startX),
|
|
6081
|
+
newHeight + rect.value.startY > parentRect.height && (newHeight = parentRect.height - rect.value.startY),
|
|
6082
|
+
rect.value.rectWidth = newWidth, rect.value.rectHeight = newHeight;
|
|
6083
|
+
}
|
|
6084
|
+
if (isResizeCorner.value.bottomLeft) {
|
|
6085
|
+
let newLeft = e.clientX - parentRect.left, newWidth = rect.value.startX - newLeft + rect.value.rectWidth, newHeight = e.clientY - parentRect.top - rect.value.startY;
|
|
6086
|
+
if (newLeft < 0) return;
|
|
6087
|
+
if (newWidth < 30) return;
|
|
6088
|
+
newHeight < 30 && (newHeight = 30), newHeight + rect.value.startY > parentRect.height && (newHeight = parentRect.height - rect.value.startY),
|
|
6089
|
+
rect.value.startX = Math.max(0, Math.min(newLeft, parentRect.width - rect.value.rectWidth)),
|
|
6090
|
+
rect.value.rectWidth = newWidth, rect.value.rectHeight = newHeight;
|
|
6091
|
+
}
|
|
6092
|
+
if (isResizeCorner.value.topLeft) {
|
|
6093
|
+
let newTop = e.clientY - parentRect.top, newHeight = rect.value.startY - newTop + rect.value.rectHeight;
|
|
6094
|
+
if (newTop < 0) return;
|
|
6095
|
+
if (newHeight < 30) return;
|
|
6096
|
+
rect.value.rectHeight = newHeight, rect.value.startY = Math.max(0, Math.min(newTop, parentRect.height - rect.value.rectHeight));
|
|
6097
|
+
let newLeft = e.clientX - parentRect.left, newWidth = rect.value.startX - newLeft + rect.value.rectWidth;
|
|
6098
|
+
if (newLeft < 0) return;
|
|
6099
|
+
if (newWidth < 30) return;
|
|
6100
|
+
rect.value.startX = Math.max(0, Math.min(newLeft, parentRect.width - rect.value.rectWidth)),
|
|
6101
|
+
rect.value.rectWidth = newWidth;
|
|
6102
|
+
}
|
|
6103
|
+
if (isResizeCorner.value.topRight) {
|
|
6104
|
+
let newTop = e.clientY - parentRect.top, newHeight = rect.value.startY - newTop + rect.value.rectHeight;
|
|
6105
|
+
if (newTop < 0) return;
|
|
6106
|
+
if (newHeight < 30) return;
|
|
6107
|
+
rect.value.rectHeight = newHeight, rect.value.startY = Math.max(0, Math.min(newTop, parentRect.height - rect.value.rectHeight));
|
|
6108
|
+
let newWidth = e.clientX - parentRect.left - rect.value.startX;
|
|
6109
|
+
newWidth < 30 && (newWidth = 30), newWidth + rect.value.startX > parentRect.width && (newWidth = parentRect.width - rect.value.startX),
|
|
6110
|
+
rect.value.rectWidth = newWidth;
|
|
6111
|
+
}
|
|
6112
|
+
};
|
|
6113
|
+
return onMounted((() => {
|
|
6114
|
+
parentRect = props.parentEl.getBoundingClientRect(), document.addEventListener("mousemove", onMousemove),
|
|
6115
|
+
document.addEventListener("mouseup", onMouseup);
|
|
6116
|
+
})), onUnmounted((() => {
|
|
6117
|
+
document.removeEventListener("mousemove", onMousemove, !1), document.removeEventListener("mouseup", onMouseup, !1);
|
|
6118
|
+
})), {
|
|
6119
|
+
onMousedown: e => {
|
|
6120
|
+
e.preventDefault(), isDraggle.value = !0, draggleOffset.value.diff_x = e.offsetX,
|
|
6121
|
+
draggleOffset.value.diff_y = e.offsetY;
|
|
6122
|
+
},
|
|
6123
|
+
onMouseup: onMouseup,
|
|
6124
|
+
onContextmenu: e => {
|
|
6125
|
+
e.preventDefault(), emit("contextmenu", e, rect.value);
|
|
6126
|
+
},
|
|
6127
|
+
rect: rect,
|
|
6128
|
+
onMousedownDot: (e, corner) => {
|
|
6129
|
+
e.preventDefault(), e.stopPropagation(), isResizeCorner.value[corner] = !0;
|
|
6130
|
+
}
|
|
6131
|
+
};
|
|
6132
|
+
},
|
|
6133
|
+
render() {
|
|
6134
|
+
const _ns = inject("ns", {}), props = this.$props;
|
|
6135
|
+
return createVNode("div", {
|
|
6136
|
+
class: [ _ns.b("draggable-rect") ],
|
|
6137
|
+
style: (() => {
|
|
6138
|
+
const {startX: startX, startY: startY, rectWidth: rectWidth, rectHeight: rectHeight} = this.rect, style = {
|
|
6139
|
+
top: startY + "px",
|
|
6140
|
+
left: startX + "px",
|
|
6141
|
+
width: rectWidth + "px",
|
|
6142
|
+
height: rectHeight + "px"
|
|
6143
|
+
}, color = props.color;
|
|
6144
|
+
if (color) {
|
|
6145
|
+
const rgb_color = hexToRgb(color);
|
|
6146
|
+
rgb_color && (style.backgroundColor = `rgba(${rgb_color[0]},${rgb_color[1]},${rgb_color[2]}, 0.5)`);
|
|
6147
|
+
}
|
|
6148
|
+
return style;
|
|
6149
|
+
})(),
|
|
6150
|
+
onMousedown: this.onMousedown,
|
|
6151
|
+
onMouseup: this.onMouseup,
|
|
6152
|
+
onContextmenu: this.onContextmenu
|
|
6153
|
+
}, [ createVNode("ul", {
|
|
6154
|
+
class: [ _ns.be("draggable-rect", "resize") ]
|
|
6155
|
+
}, [ createVNode("li", {
|
|
6156
|
+
class: "top-left",
|
|
6157
|
+
onMousedown: event => this.onMousedownDot(event, "topLeft")
|
|
6158
|
+
}, null), createVNode("li", {
|
|
6159
|
+
class: "top-center",
|
|
6160
|
+
onMousedown: event => this.onMousedownDot(event, "topCenter")
|
|
6161
|
+
}, null), createVNode("li", {
|
|
6162
|
+
class: "top-right",
|
|
6163
|
+
onMousedown: event => this.onMousedownDot(event, "topRight")
|
|
6164
|
+
}, null), createVNode("li", {
|
|
6165
|
+
class: "left-center",
|
|
6166
|
+
onMousedown: event => this.onMousedownDot(event, "leftCenter")
|
|
6167
|
+
}, null), createVNode("li", {
|
|
6168
|
+
class: "right-center",
|
|
6169
|
+
onMousedown: event => this.onMousedownDot(event, "rightCenter")
|
|
6170
|
+
}, null), createVNode("li", {
|
|
6171
|
+
class: "bottom-left",
|
|
6172
|
+
onMousedown: event => this.onMousedownDot(event, "bottomLeft")
|
|
6173
|
+
}, null), createVNode("li", {
|
|
6174
|
+
class: "bottom-center",
|
|
6175
|
+
onMousedown: event => this.onMousedownDot(event, "bottomCenter")
|
|
6176
|
+
}, null), createVNode("li", {
|
|
6177
|
+
class: "bottom-right",
|
|
6178
|
+
onMousedown: event => this.onMousedownDot(event, "bottomRight")
|
|
6179
|
+
}, null) ]) ]);
|
|
6180
|
+
}
|
|
6181
|
+
}), CanvasContext = defineComponent({
|
|
6182
|
+
name: "NextCanvasContext",
|
|
6183
|
+
props: {
|
|
6184
|
+
classes: {
|
|
6185
|
+
type: Array,
|
|
6186
|
+
default: () => []
|
|
6187
|
+
},
|
|
6188
|
+
contextClientHeight: {
|
|
6189
|
+
type: Number,
|
|
6190
|
+
default: null
|
|
6191
|
+
},
|
|
6192
|
+
rowInfo: {
|
|
6193
|
+
type: Object,
|
|
6194
|
+
default: () => ({})
|
|
6195
|
+
}
|
|
6196
|
+
},
|
|
6197
|
+
emits: [ "change" ],
|
|
6198
|
+
setup(props, {emit: emit, expose: expose}) {
|
|
6199
|
+
const ns = inject("ns", {}), _emit = inject("_emit", null), canvasMainRef = ref(), canvasBaseRef = ref(), canvasRectRef = ref(), labels = ref([]), drawBaseCanvas = ref({}), formatLabelsType = () => {
|
|
6200
|
+
const _labels = deepClone(labels.value);
|
|
6201
|
+
let yolo_label = [];
|
|
6202
|
+
return {
|
|
6203
|
+
rects: _labels.map((rect => {
|
|
6204
|
+
delete rect.typeName;
|
|
6205
|
+
const label_rect = convertToLabel(rect);
|
|
6206
|
+
return yolo_label.push(label_rect.join(" ")), toRaw(rect);
|
|
6207
|
+
})),
|
|
6208
|
+
label_txt: yolo_label.join("\n")
|
|
6209
|
+
};
|
|
6210
|
+
}, loadingImage = ref(!1), renderImageLabel = rowInfo => {
|
|
6211
|
+
labels.value = (rowInfo => rowInfo.labels ? rowInfo.labels.map((rect => {
|
|
6212
|
+
const typeName = props.classes[rect.type];
|
|
6213
|
+
return typeName && (rect.typeName = typeName), rect;
|
|
6214
|
+
})) : [])(rowInfo);
|
|
6215
|
+
const clientHeight = canvasMainRef.value?.clientHeight, ctx = canvasBaseRef.value?.getContext("2d");
|
|
6216
|
+
if (rowInfo?.imageSrc) {
|
|
6217
|
+
const image = new Image;
|
|
6218
|
+
image.src = rowInfo.imageSrc, loadingImage.value = !0, image.onload = () => {
|
|
6219
|
+
loadingImage.value = !1;
|
|
6220
|
+
const {width: width, height: height} = image, canvasHeight = clientHeight, scaleFactor = parseFloat((canvasHeight / height).toFixed(3)), canvasWidth = Math.ceil(width * scaleFactor);
|
|
6221
|
+
((canvasWidth, canvasHeight) => {
|
|
6222
|
+
canvasMainRef.value.style.width = canvasWidth + "px", canvasMainRef.value.style.height = canvasHeight + "px",
|
|
6223
|
+
canvasBaseRef.value.width = canvasWidth, canvasBaseRef.value.height = canvasHeight,
|
|
6224
|
+
canvasBaseRef.value.style.width = canvasWidth + "px", canvasBaseRef.value.style.height = canvasHeight + "px",
|
|
6225
|
+
canvasRectRef.value.width = canvasWidth, canvasRectRef.value.height = canvasHeight,
|
|
6226
|
+
canvasRectRef.value.style.width = canvasWidth + "px", canvasRectRef.value.style.height = canvasHeight + "px";
|
|
6227
|
+
})(canvasWidth, canvasHeight), labels.value = ((labels, canvasHeight) => {
|
|
6228
|
+
let scale_rects = [];
|
|
6229
|
+
for (let i = 0; i < labels.length; i++) {
|
|
6230
|
+
const rect = labels[i], scale = parseFloat((canvasHeight / rect.canvasHeight).toFixed(3));
|
|
6231
|
+
scale && (rect.startX = Math.ceil(rect.startX * scale), rect.startY = Math.ceil(rect.startY * scale),
|
|
6232
|
+
rect.rectWidth = Math.ceil(rect.rectWidth * scale), rect.rectHeight = Math.ceil(rect.rectHeight * scale),
|
|
6233
|
+
rect.canvasWidth = Math.ceil(rect.canvasWidth * scale), rect.canvasHeight = canvasHeight),
|
|
6234
|
+
scale_rects.push(rect);
|
|
6235
|
+
}
|
|
6236
|
+
return scale_rects;
|
|
6237
|
+
})(labels.value, canvasHeight);
|
|
6238
|
+
const {updateLabels: updateLabels, addDrawRect: addDrawRect, hitCanvasLabel: hitCanvasLabel} = (options => {
|
|
6239
|
+
const {ctx: ctx, labels: labels, image: image, canvasWidth: canvasWidth, canvasHeight: canvasHeight} = options, updateLabels = () => {
|
|
6240
|
+
ctx.clearRect(0, 0, canvasWidth, canvasHeight), ctx.drawImage(image, 0, 0, canvasWidth, canvasHeight);
|
|
6241
|
+
for (let i = 0; i < labels.length; i++) {
|
|
6242
|
+
const rect = labels[i], {startX: startX, startY: startY, rectWidth: rectWidth, rectHeight: rectHeight, type: type} = rect, color = colors[type % colors.length];
|
|
6243
|
+
if (ctx.font = "bold 14px serif", ctx.textBaseline = "top", ctx.save(), ctx.strokeStyle = color,
|
|
6244
|
+
ctx.strokeRect(startX, startY, rectWidth, rectHeight), isValueExist(rect.typeName) || isValueExist(rect.type)) {
|
|
6245
|
+
const text = rect.typeName || rect.type;
|
|
6246
|
+
ctx.fillStyle = color, ctx.fillText(text, startX + 6, startY + 6);
|
|
6247
|
+
}
|
|
6248
|
+
ctx.restore();
|
|
6249
|
+
}
|
|
6250
|
+
};
|
|
6251
|
+
return updateLabels(), {
|
|
6252
|
+
updateLabels: updateLabels,
|
|
6253
|
+
addDrawRect: (rect, color = "#f30635") => {
|
|
6254
|
+
const {startX: startX, startY: startY, rectWidth: rectWidth, rectHeight: rectHeight} = rect;
|
|
6255
|
+
ctx.strokeStyle = color, ctx.strokeRect(startX, startY, rectWidth, rectHeight);
|
|
6256
|
+
},
|
|
6257
|
+
hitCanvasLabel: (x, y) => {
|
|
6258
|
+
let hit_rect = null, hit_index = null, color = null;
|
|
6259
|
+
for (let i = 0; i < labels.length; i++) {
|
|
6260
|
+
const rect = labels[i], {type: type, startX: startX, startY: startY, rectWidth: rectWidth, rectHeight: rectHeight} = rect;
|
|
6261
|
+
x >= startX && x <= startX + rectWidth && y >= startY && y <= startY + rectHeight && (hit_rect = rect,
|
|
6262
|
+
hit_index = i, color = colors[type]);
|
|
6263
|
+
}
|
|
6264
|
+
return {
|
|
6265
|
+
hit_rect: hit_rect,
|
|
6266
|
+
hit_index: hit_index,
|
|
6267
|
+
color: color
|
|
6268
|
+
};
|
|
6269
|
+
}
|
|
6270
|
+
};
|
|
6271
|
+
})({
|
|
6272
|
+
canvas: canvasBaseRef.value,
|
|
6273
|
+
ctx: ctx,
|
|
6274
|
+
image: image,
|
|
6275
|
+
canvasWidth: canvasWidth,
|
|
6276
|
+
canvasHeight: canvasHeight,
|
|
6277
|
+
labels: labels.value,
|
|
6278
|
+
scaleFactor: scaleFactor
|
|
6279
|
+
});
|
|
6280
|
+
drawBaseCanvas.value.updateLabels = updateLabels, drawBaseCanvas.value.addDrawRect = addDrawRect,
|
|
6281
|
+
drawBaseCanvas.value.hitCanvasLabel = hitCanvasLabel;
|
|
6282
|
+
const {clearCanvas: clearCanvas} = ((canvas, callback, keyW) => {
|
|
6283
|
+
const canvasWidth = canvas.width, canvasHeight = canvas.height, ctx = canvas?.getContext("2d"), clearCanvas = () => {
|
|
6284
|
+
ctx.clearRect(0, 0, canvasWidth, canvasHeight);
|
|
6285
|
+
};
|
|
6286
|
+
clearCanvas();
|
|
6287
|
+
let startX, startY, endX, endY, isDrawing = !1, isRectDraw = !1, isWKeyPressed = !1;
|
|
6288
|
+
document.addEventListener("keydown", (event => {
|
|
6289
|
+
"KeyW" === event.code && (isWKeyPressed = !0, canvas.style.cursor = "crosshair",
|
|
6290
|
+
canvas.style.zIndex = "11", keyW && keyW());
|
|
6291
|
+
})), document.addEventListener("keyup", (event => {
|
|
6292
|
+
isDrawing || "KeyW" === event.code && (isWKeyPressed = !1, canvas.style.cursor = "unset",
|
|
6293
|
+
canvas.style.zIndex = "0");
|
|
6294
|
+
})), canvas.addEventListener("mousedown", (e => {
|
|
6295
|
+
isWKeyPressed && (isDrawing = !0, startX = e.offsetX, startY = e.offsetY);
|
|
6296
|
+
})), canvas.addEventListener("mousemove", (e => {
|
|
6297
|
+
isDrawing && isWKeyPressed && (isRectDraw = !0, endX = e.offsetX, endY = e.offsetY,
|
|
6298
|
+
drawRect());
|
|
6299
|
+
})), canvas.addEventListener("mouseup", (() => {
|
|
6300
|
+
if (!isRectDraw) return;
|
|
6301
|
+
isDrawing = !1, isWKeyPressed = !1, canvas.style.cursor = "unset", canvas.style.zIndex = "0";
|
|
6302
|
+
const rectWidth = Math.abs(endX - startX), rectHeight = Math.abs(endY - startY);
|
|
6303
|
+
startX > endX && (startX = endX), startY > endY && (startY = endY), callback && callback({
|
|
6304
|
+
startX: startX,
|
|
6305
|
+
startY: startY,
|
|
6306
|
+
rectWidth: rectWidth,
|
|
6307
|
+
rectHeight: rectHeight,
|
|
6308
|
+
canvasWidth: canvasWidth,
|
|
6309
|
+
canvasHeight: canvasHeight
|
|
6310
|
+
}, {
|
|
6311
|
+
endX: endX,
|
|
6312
|
+
endY: endY
|
|
6313
|
+
}), isRectDraw = !1;
|
|
6314
|
+
}));
|
|
6315
|
+
const drawRect = (color = "#f30635") => {
|
|
6316
|
+
clearCanvas(), ctx.strokeStyle = color, ctx.strokeRect(startX, startY, endX - startX, endY - startY);
|
|
6317
|
+
};
|
|
6318
|
+
return {
|
|
6319
|
+
canvas: canvas,
|
|
6320
|
+
ctx: ctx,
|
|
6321
|
+
clearCanvas: clearCanvas,
|
|
6322
|
+
drawRect: drawRect
|
|
6323
|
+
};
|
|
6324
|
+
})(canvasRectRef.value, ((rect, {endX: endX, endY: endY}) => {
|
|
6325
|
+
activate_add_label.value = rect, drawBaseCanvas.value.addDrawRect(rect), updateContextmenuLabelFixed(endX, endY, rect);
|
|
6326
|
+
}), (() => {
|
|
6327
|
+
onCloseDraggableRectFixed();
|
|
6328
|
+
}));
|
|
6329
|
+
drawBaseCanvas.value.clearCanvasRect = clearCanvas;
|
|
6330
|
+
}, image.onerror = () => {
|
|
6331
|
+
loadingImage.value = !1;
|
|
6332
|
+
};
|
|
6333
|
+
}
|
|
6334
|
+
canvasBaseRef.value.addEventListener("contextmenu", (e => {
|
|
6335
|
+
e.preventDefault();
|
|
6336
|
+
const x = e.offsetX, y = e.offsetY, {hit_rect: hit_rect} = drawBaseCanvas.value.hitCanvasLabel(x, y);
|
|
6337
|
+
onCloseContentmenuLabel(), onCloseDraggableRectFixed(), hit_rect && nextTick((() => {
|
|
6338
|
+
updateContextmenuLabelFixed(x, y, hit_rect);
|
|
6339
|
+
}));
|
|
6340
|
+
})), canvasBaseRef.value.addEventListener("click", (e => {
|
|
6341
|
+
const x = e.offsetX, y = e.offsetY, {hit_rect: hit_rect, hit_index: hit_index, color: color} = drawBaseCanvas.value.hitCanvasLabel(x, y);
|
|
6342
|
+
onCloseDraggableRectFixed(), onCloseContentmenuLabel(), hit_rect && nextTick((() => {
|
|
6343
|
+
updateDraggableRectFixed(x, y, hit_rect, hit_index, color);
|
|
6344
|
+
}));
|
|
6345
|
+
}));
|
|
6346
|
+
};
|
|
6347
|
+
onMounted((() => {
|
|
6348
|
+
watch((() => props.rowInfo), (info => {
|
|
6349
|
+
const rowInfo = toRaw(info);
|
|
6350
|
+
renderImageLabel(rowInfo);
|
|
6351
|
+
}), {
|
|
6352
|
+
deep: !0,
|
|
6353
|
+
immediate: !0
|
|
6354
|
+
}), watch((() => props.contextClientHeight), (height => {
|
|
6355
|
+
if (valueExist(height)) {
|
|
6356
|
+
canvasMainRef.value.style.height = height + "px";
|
|
6357
|
+
const rowInfo = toRaw(props.rowInfo);
|
|
6358
|
+
renderImageLabel(rowInfo);
|
|
6359
|
+
}
|
|
6360
|
+
}));
|
|
6361
|
+
}));
|
|
6362
|
+
const contextmenuLabelFixed = ref({
|
|
6363
|
+
show: !1,
|
|
6364
|
+
top: 0,
|
|
6365
|
+
left: 0,
|
|
6366
|
+
activateRect: null
|
|
6367
|
+
}), updateContextmenuLabelFixed = (x, y, rect) => {
|
|
6368
|
+
contextmenuLabelFixed.value.show = !0, contextmenuLabelFixed.value.left = x, contextmenuLabelFixed.value.top = y,
|
|
6369
|
+
contextmenuLabelFixed.value.canvasWidth = canvasBaseRef.value.width, contextmenuLabelFixed.value.canvasHeight = canvasBaseRef.value.height,
|
|
6370
|
+
contextmenuLabelFixed.value.activateRect = rect, activate_add_label.value = rect;
|
|
6371
|
+
}, onCloseContentmenuLabel = () => {
|
|
6372
|
+
contextmenuLabelFixed.value.show = !1, contextmenuLabelFixed.value.top = 0, contextmenuLabelFixed.value.left = 0,
|
|
6373
|
+
contextmenuLabelFixed.value.activateRect = null, activate_add_label.value = null,
|
|
6374
|
+
drawBaseCanvas.value.updateLabels(), drawBaseCanvas.value.clearCanvasRect();
|
|
6375
|
+
}, contextmenuLabelRect = computed((() => {
|
|
6376
|
+
const {top: top, left: left, canvasWidth: canvasWidth, canvasHeight: canvasHeight} = contextmenuLabelFixed.value;
|
|
6377
|
+
return {
|
|
6378
|
+
top: top,
|
|
6379
|
+
left: left,
|
|
6380
|
+
canvasWidth: canvasWidth,
|
|
6381
|
+
canvasHeight: canvasHeight
|
|
6382
|
+
};
|
|
6383
|
+
})), draggableRectFixed = ref({
|
|
6384
|
+
show: !1,
|
|
6385
|
+
top: 0,
|
|
6386
|
+
left: 0,
|
|
6387
|
+
width: 0,
|
|
6388
|
+
height: 0,
|
|
6389
|
+
activateRect: null,
|
|
6390
|
+
activateIndex: null,
|
|
6391
|
+
color: null
|
|
6392
|
+
}), updateDraggableRectFixed = (x, y, rect, index, color) => {
|
|
6393
|
+
draggableRectFixed.value.show = !0, draggableRectFixed.value.top = y, draggableRectFixed.value.left = x,
|
|
6394
|
+
draggableRectFixed.value.width = rect.rectWidth, draggableRectFixed.value.height = rect.rectHeight,
|
|
6395
|
+
draggableRectFixed.value.activateRect = rect, draggableRectFixed.value.activateIndex = index,
|
|
6396
|
+
draggableRectFixed.value.color = color;
|
|
6397
|
+
}, onCloseDraggableRectFixed = () => {
|
|
6398
|
+
draggableRectFixed.value.show = !1, draggableRectFixed.value.top = 0, draggableRectFixed.value.left = 0,
|
|
6399
|
+
draggableRectFixed.value.width = 0, draggableRectFixed.value.height = 0, draggableRectFixed.value.activateRect = null,
|
|
6400
|
+
draggableRectFixed.value.activateIndex = null, draggableRectFixed.value.color = null;
|
|
6401
|
+
}, onDraggleRectResize = rect => {
|
|
6402
|
+
draggableRectFixed.value.activateRect = rect, drawBaseCanvas.value.updateLabels();
|
|
6403
|
+
const i = labels.value.findIndex((o => isEqual(o, rect)));
|
|
6404
|
+
i > -1 && labels.value.splice(i, 1, rect);
|
|
6405
|
+
const {rects: rects, label_txt: label_txt} = formatLabelsType();
|
|
6406
|
+
_emit("change", rects, label_txt), emit("change", rects, label_txt);
|
|
6407
|
+
}, onContextmenuDraggable = (e, rect) => {
|
|
6408
|
+
e.preventDefault();
|
|
6409
|
+
const rect_x = e.offsetX, rect_y = e.offsetY, x = rect_x + rect.startX, y = rect_y + rect.startY;
|
|
6410
|
+
onCloseContentmenuLabel(), nextTick((() => {
|
|
6411
|
+
updateContextmenuLabelFixed(x, y, rect);
|
|
6412
|
+
}));
|
|
6413
|
+
}, activate_add_label = ref(), onSelectLabel = type => {
|
|
6414
|
+
activate_add_label.value.type = type;
|
|
6415
|
+
const typeName = props.classes[type];
|
|
6416
|
+
typeName && (activate_add_label.value.typeName = typeName);
|
|
6417
|
+
const i = labels.value.findIndex((o => isEqual(o, activate_add_label.value)));
|
|
6418
|
+
i > -1 ? labels.value.splice(i, 1, activate_add_label.value) : labels.value.push(activate_add_label.value),
|
|
6419
|
+
onCloseContentmenuLabel();
|
|
6420
|
+
const {rects: rects, label_txt: label_txt} = formatLabelsType();
|
|
6421
|
+
_emit("change", rects, label_txt), emit("change", rects, label_txt);
|
|
6422
|
+
}, onDeleteLabel = rect => {
|
|
6423
|
+
const i = labels.value.findIndex((o => isEqual(o, rect)));
|
|
6424
|
+
labels.value.splice(i, 1), onCloseContentmenuLabel(), onCloseDraggableRectFixed(),
|
|
6425
|
+
drawBaseCanvas.value.updateLabels();
|
|
6426
|
+
const {rects: rects, label_txt: label_txt} = formatLabelsType();
|
|
6427
|
+
_emit("change", rects, label_txt), emit("change", rects, label_txt);
|
|
6428
|
+
};
|
|
6429
|
+
expose({
|
|
6430
|
+
onCloseDraggableRectFixed: onCloseDraggableRectFixed,
|
|
6431
|
+
onCloseContentmenuLabel: onCloseContentmenuLabel,
|
|
6432
|
+
onSelectedLabel: (rect, index) => {
|
|
6433
|
+
onCloseDraggableRectFixed(), nextTick((() => {
|
|
6434
|
+
const {startX: x, startY: y, type: type} = rect;
|
|
6435
|
+
updateDraggableRectFixed(x, y, rect, index, colors[type]);
|
|
6436
|
+
}));
|
|
6437
|
+
},
|
|
6438
|
+
onDeleteLabel: onDeleteLabel
|
|
6439
|
+
});
|
|
6440
|
+
return () => createVNode(Fragment, null, [ createVNode(NextSpinLoading, {
|
|
6441
|
+
loading: loadingImage.value,
|
|
6442
|
+
class: [ ns.b("loading") ]
|
|
6443
|
+
}, {
|
|
6444
|
+
default: () => [ createVNode("div", {
|
|
6445
|
+
ref: canvasMainRef,
|
|
6446
|
+
class: [ ns.b("canvas") ]
|
|
6447
|
+
}, [ createVNode("canvas", {
|
|
6448
|
+
ref: canvasBaseRef,
|
|
6449
|
+
class: [ ns.be("canvas", "context") ]
|
|
6450
|
+
}, null), createVNode("canvas", {
|
|
6451
|
+
ref: canvasRectRef,
|
|
6452
|
+
class: [ ns.be("canvas", "rect") ]
|
|
6453
|
+
}, null), contextmenuLabelFixed.value.show ? createVNode(ContextMenuLabel, {
|
|
6454
|
+
labelRect: contextmenuLabelRect.value,
|
|
6455
|
+
classes: props.classes,
|
|
6456
|
+
activateRect: contextmenuLabelFixed.value.activateRect,
|
|
6457
|
+
onClose: onCloseContentmenuLabel,
|
|
6458
|
+
onSelect: onSelectLabel,
|
|
6459
|
+
onDelete: onDeleteLabel
|
|
6460
|
+
}, null) : null, draggableRectFixed.value.show ? createVNode(DraggableRect, {
|
|
6461
|
+
parentEl: canvasMainRef.value,
|
|
6462
|
+
rect: draggableRectFixed.value.activateRect,
|
|
6463
|
+
color: draggableRectFixed.value.color,
|
|
6464
|
+
onDraggleResize: onDraggleRectResize,
|
|
6465
|
+
onContextmenu: onContextmenuDraggable
|
|
6466
|
+
}, null) : null ]) ]
|
|
6467
|
+
}) ]);
|
|
6468
|
+
}
|
|
6469
|
+
}), RightLabel = defineComponent({
|
|
6470
|
+
props: {
|
|
6471
|
+
classes: {
|
|
6472
|
+
type: Array,
|
|
6473
|
+
default: () => []
|
|
6474
|
+
},
|
|
6475
|
+
labels: {
|
|
6476
|
+
type: Array,
|
|
6477
|
+
default: () => []
|
|
6478
|
+
}
|
|
6479
|
+
},
|
|
6480
|
+
emits: [ "delete", "select" ],
|
|
6481
|
+
setup(props, {emit: emit}) {
|
|
6482
|
+
const {t: t} = useLocale(), ns = inject("ns", {}), labels = ref([]);
|
|
6483
|
+
watch((() => props.labels), (rects => {
|
|
6484
|
+
const _rects = toRaw(rects);
|
|
6485
|
+
labels.value = (labels => labels.length ? labels.map((rect => {
|
|
6486
|
+
const typeName = props.classes[rect.type];
|
|
6487
|
+
return typeName && (rect.typeName = typeName), rect;
|
|
6488
|
+
})) : [])(_rects);
|
|
6489
|
+
}), {
|
|
6490
|
+
deep: !0,
|
|
6491
|
+
immediate: !0
|
|
6492
|
+
});
|
|
6493
|
+
const renderContent = () => createVNode("div", {
|
|
6494
|
+
class: [ ns.b("right") ]
|
|
6495
|
+
}, [ labels.value.length ? createVNode("ul", null, [ labels.value.map(((rect, index) => createVNode("li", {
|
|
6496
|
+
key: index,
|
|
6497
|
+
onClick: () => ((rect, index) => {
|
|
6498
|
+
emit("select", rect, index);
|
|
6499
|
+
})(rect, index)
|
|
6500
|
+
}, [ createVNode("div", null, [ createVNode("span", {
|
|
6501
|
+
style: {
|
|
6502
|
+
"background-color": colors[rect.type]
|
|
6503
|
+
},
|
|
6504
|
+
class: "label-line"
|
|
6505
|
+
}, null), createVNode("span", null, [ rect.typeName ]) ]), createVNode(ElPopconfirm, {
|
|
6506
|
+
title: t("next.labelimg.confirmDeleteLabel"),
|
|
6507
|
+
width: 180,
|
|
6508
|
+
onConfirm: () => (rect => {
|
|
6509
|
+
emit("delete", rect);
|
|
6510
|
+
})(rect)
|
|
6511
|
+
}, {
|
|
6512
|
+
reference: () => createVNode(ElIcon, {
|
|
6513
|
+
size: 16,
|
|
6514
|
+
color: "#ff0000",
|
|
6515
|
+
onClick: event => {
|
|
6516
|
+
event.preventDefault(), event.stopPropagation();
|
|
6517
|
+
}
|
|
6518
|
+
}, {
|
|
6519
|
+
default: () => [ createVNode(delete_default, null, null) ]
|
|
6520
|
+
})
|
|
6521
|
+
}) ]))) ]) : createVNode(ElEmpty, {
|
|
6522
|
+
"image-size": 120,
|
|
6523
|
+
description: t("next.labelimg.emptyLabelText")
|
|
6524
|
+
}, null) ]);
|
|
6525
|
+
return () => createVNode(Fragment, null, [ renderContent() ]);
|
|
6526
|
+
}
|
|
6527
|
+
}), defaultConfig = {
|
|
6528
|
+
mainContentHeight: 600
|
|
6529
|
+
};
|
|
6530
|
+
|
|
6531
|
+
const ns$1 = useNamespace("labelimg");
|
|
6532
|
+
|
|
6533
|
+
var Element = defineComponent({
|
|
6534
|
+
name: "NextLabelimg",
|
|
6535
|
+
props: {
|
|
6536
|
+
className: {
|
|
6537
|
+
type: String,
|
|
6538
|
+
default: ""
|
|
6539
|
+
},
|
|
6540
|
+
style: {
|
|
6541
|
+
type: Object,
|
|
6542
|
+
default: () => ({
|
|
6543
|
+
position: "unset"
|
|
6544
|
+
})
|
|
6545
|
+
},
|
|
6546
|
+
rowKey: {
|
|
6547
|
+
type: String,
|
|
6548
|
+
default: "id"
|
|
6549
|
+
},
|
|
6550
|
+
options: {
|
|
6551
|
+
type: Object,
|
|
6552
|
+
default: () => ({})
|
|
6553
|
+
},
|
|
6554
|
+
classes: {
|
|
6555
|
+
type: Array,
|
|
6556
|
+
default: () => []
|
|
6557
|
+
},
|
|
6558
|
+
data: {
|
|
6559
|
+
type: Array,
|
|
6560
|
+
default: () => []
|
|
6561
|
+
}
|
|
6562
|
+
},
|
|
6563
|
+
emits: [ "change", "save", "prev-click", "next-click" ],
|
|
6564
|
+
setup(props, {emit: emit, slots: slots, expose: expose}) {
|
|
6565
|
+
const {t: t} = useLocale(), _config = deepClone(defaultConfig), _options = computed((() => {
|
|
6566
|
+
const cfg = unref(props.options);
|
|
6567
|
+
return merge$1(_config, cfg);
|
|
6568
|
+
})), options = unref(_options);
|
|
6569
|
+
provide("ns", ns$1), provide("_emit", emit);
|
|
6570
|
+
const activateNodeIndex = ref(0), classes = ref(props.classes), labelImages = ref(deepClone(props.data));
|
|
6571
|
+
watch((() => props.data), (data => {
|
|
6572
|
+
labelImages.value = deepClone(data);
|
|
6573
|
+
}), {
|
|
6574
|
+
deep: !0
|
|
6575
|
+
}), watch((() => props.data.length), (() => {
|
|
6576
|
+
activateNodeIndex.value = 0;
|
|
6577
|
+
})), watch((() => props.classes), (val => {
|
|
6578
|
+
classes.value = val;
|
|
6579
|
+
}), {
|
|
6580
|
+
deep: !0
|
|
6581
|
+
});
|
|
6582
|
+
const currentNode = computed((() => {
|
|
6583
|
+
if (!labelImages.value) return {};
|
|
6584
|
+
const node = labelImages.value[activateNodeIndex.value] || {};
|
|
6585
|
+
return deepClone(node);
|
|
6586
|
+
})), activateNodeLabels = ref(currentNode.value.labels || []);
|
|
6587
|
+
watch((() => currentNode.value), (() => {
|
|
6588
|
+
activateNodeLabels.value = currentNode.value.labels || [];
|
|
6589
|
+
}));
|
|
6590
|
+
const onChangeNodeRect = rects => {
|
|
6591
|
+
currentNode.value.labels = rects, activateNodeLabels.value = rects;
|
|
6592
|
+
}, loading = ref(!1), formatNodeLabels = () => {
|
|
6593
|
+
const node = currentNode.value;
|
|
6594
|
+
let yolo_label = [];
|
|
6595
|
+
return node.labels.forEach((rect => {
|
|
6596
|
+
delete rect.typeName;
|
|
6597
|
+
const label_rect = convertToLabel(rect);
|
|
6598
|
+
yolo_label.push(label_rect.join(" "));
|
|
6599
|
+
})), {
|
|
6600
|
+
node: node,
|
|
6601
|
+
label_txt: yolo_label.join("\n")
|
|
6602
|
+
};
|
|
6603
|
+
}, isChangeNodeLabels = () => isEqual(labelImages.value[activateNodeIndex.value].labels, currentNode.value.labels), switchKeydownAD = e => {
|
|
6604
|
+
const imageLength = labelImages.value.length;
|
|
6605
|
+
"KeyD" === e.code ? (activateNodeIndex.value++, activateNodeIndex.value >= imageLength && (activateNodeIndex.value = 0)) : "KeyA" === e.code && (activateNodeIndex.value--,
|
|
6606
|
+
activateNodeIndex.value < 0 && (activateNodeIndex.value = imageLength - 1));
|
|
6607
|
+
}, onKeydownPrevNext = e => {
|
|
6608
|
+
if (loading.value) return;
|
|
6609
|
+
if (![ "KeyA", "KeyD" ].includes(e.code)) return;
|
|
6610
|
+
loading.value = !0;
|
|
6611
|
+
const {node: node, label_txt: label_txt} = formatNodeLabels();
|
|
6612
|
+
if (canvasContextRef.value.onCloseDraggableRectFixed(), isChangeNodeLabels()) return switchKeydownAD(e),
|
|
6613
|
+
void (loading.value = !1);
|
|
6614
|
+
emit("save", {
|
|
6615
|
+
node: node,
|
|
6616
|
+
label_txt: label_txt
|
|
6617
|
+
}, (imageItem => {
|
|
6618
|
+
labelImages.value[activateNodeIndex.value] = imageItem || node, switchKeydownAD(e),
|
|
6619
|
+
loading.value = !1;
|
|
6620
|
+
}), (() => {
|
|
6621
|
+
loading.value = !1;
|
|
6622
|
+
}));
|
|
6623
|
+
}, onChangeActivateNode = index => {
|
|
6624
|
+
if (loading.value) return;
|
|
6625
|
+
loading.value = !0;
|
|
6626
|
+
const {node: node, label_txt: label_txt} = formatNodeLabels();
|
|
6627
|
+
if (canvasContextRef.value.onCloseDraggableRectFixed(), isChangeNodeLabels()) return activateNodeIndex.value = index,
|
|
6628
|
+
void (loading.value = !1);
|
|
6629
|
+
emit("save", {
|
|
6630
|
+
node: node,
|
|
6631
|
+
label_txt: label_txt
|
|
6632
|
+
}, (imageItem => {
|
|
6633
|
+
labelImages.value[activateNodeIndex.value] = imageItem || node, activateNodeIndex.value = index,
|
|
6634
|
+
loading.value = !1;
|
|
6635
|
+
}), (() => {
|
|
6636
|
+
loading.value = !1;
|
|
6637
|
+
}));
|
|
6638
|
+
}, onPaginationPrev = () => {
|
|
6639
|
+
const imageLength = labelImages.value.length;
|
|
6640
|
+
let i = activateNodeIndex.value - 1;
|
|
6641
|
+
i < 0 && (i = imageLength - 1), onChangeActivateNode(i), emit("prev-click");
|
|
6642
|
+
}, onPaginationNext = () => {
|
|
6643
|
+
const imageLength = labelImages.value.length;
|
|
6644
|
+
let i = activateNodeIndex.value + 1;
|
|
6645
|
+
i >= imageLength && (i = 0), onChangeActivateNode(i), emit("next-click");
|
|
6646
|
+
}, canvasContextRef = ref(), layoutLabelRef = ref(), headerRef = ref(), mainRef = ref(), footerRef = ref(), mainContentHeight = ref(options.mainContentHeight);
|
|
6647
|
+
onMounted((() => {
|
|
6648
|
+
document.addEventListener("keydown", onKeydownPrevNext), elementResize(layoutLabelRef.value, (() => {
|
|
6649
|
+
nextTick((() => {
|
|
6650
|
+
layoutLabelRef.value.style.position = "unset";
|
|
6651
|
+
const contentHeight = (layoutLabelRef.value?.clientHeight || 0) - ((headerRef.value?.clientHeight || 0) + (footerRef.value?.clientHeight || 0));
|
|
6652
|
+
mainContentHeight.value = contentHeight;
|
|
6653
|
+
}));
|
|
6654
|
+
}));
|
|
6655
|
+
})), onUnmounted((() => {
|
|
6656
|
+
document.removeEventListener("keydown", onKeydownPrevNext);
|
|
6657
|
+
}));
|
|
6658
|
+
const onSelectLabelNode = (rect, index) => {
|
|
6659
|
+
canvasContextRef.value.onSelectedLabel(rect, index);
|
|
6660
|
+
}, onDeleteLabelNode = rect => {
|
|
6661
|
+
canvasContextRef.value.onDeleteLabel(rect);
|
|
6662
|
+
};
|
|
6663
|
+
expose({
|
|
6664
|
+
convertToLabel: convertToLabel,
|
|
6665
|
+
canvertToCanvas: canvertToCanvas
|
|
6666
|
+
});
|
|
6667
|
+
return () => createVNode(Fragment, null, [ createVNode("div", {
|
|
6668
|
+
ref: layoutLabelRef,
|
|
6669
|
+
class: [ ns$1.b(), props.className ],
|
|
6670
|
+
style: {
|
|
6671
|
+
...props.style
|
|
6672
|
+
}
|
|
6673
|
+
}, [ createVNode(NextSpinLoading$1, {
|
|
6674
|
+
loading: loading.value,
|
|
6675
|
+
tip: t("next.labelimg.saveTxt"),
|
|
6676
|
+
class: [ ns$1.b("loading") ]
|
|
6677
|
+
}, {
|
|
6678
|
+
default: () => [ createVNode(ElScrollbar, null, {
|
|
6679
|
+
default: () => [ createVNode("header", {
|
|
6680
|
+
ref: headerRef,
|
|
6681
|
+
class: [ ns$1.b("header") ]
|
|
6682
|
+
}, [ slots.header ? slots.header() : createVNode(Fragment, null, [ createVNode("ul", null, null), createVNode("ul", null, null) ]) ]), createVNode("div", {
|
|
6683
|
+
ref: mainRef,
|
|
6684
|
+
class: [ ns$1.b("main") ],
|
|
6685
|
+
style: {
|
|
6686
|
+
height: mainContentHeight.value + "px"
|
|
6687
|
+
}
|
|
6688
|
+
}, [ createVNode("div", {
|
|
6689
|
+
class: [ ns$1.be("main", "content") ]
|
|
6690
|
+
}, [ createVNode(CanvasContext, {
|
|
6691
|
+
ref: canvasContextRef,
|
|
6692
|
+
contextClientHeight: mainContentHeight.value,
|
|
6693
|
+
classes: classes.value,
|
|
6694
|
+
rowInfo: currentNode.value,
|
|
6695
|
+
onChange: onChangeNodeRect
|
|
6696
|
+
}, null) ]), createVNode(RightLabel, {
|
|
6697
|
+
classes: classes.value,
|
|
6698
|
+
labels: activateNodeLabels.value,
|
|
6699
|
+
onDelete: onDeleteLabelNode,
|
|
6700
|
+
onSelect: onSelectLabelNode
|
|
6701
|
+
}, null) ]), createVNode("footer", {
|
|
6702
|
+
ref: footerRef,
|
|
6703
|
+
class: [ ns$1.b("footer") ]
|
|
6704
|
+
}, [ createVNode("div", {
|
|
6705
|
+
class: [ ns$1.be("footer", "left") ]
|
|
6706
|
+
}, [ createVNode(ElIcon, {
|
|
6707
|
+
size: 24,
|
|
6708
|
+
color: "#797979",
|
|
6709
|
+
onClick: onPaginationPrev
|
|
6710
|
+
}, {
|
|
6711
|
+
default: () => [ createVNode(arrow_left_default, null, null) ]
|
|
6712
|
+
}) ]), createVNode("div", {
|
|
6713
|
+
class: [ ns$1.be("footer", "center") ]
|
|
6714
|
+
}, [ createVNode(ElScrollbar, null, {
|
|
6715
|
+
default: () => [ createVNode("ul", {
|
|
6716
|
+
class: [ ns$1.bem("footer", "center", "list") ]
|
|
6717
|
+
}, [ labelImages.value.map(((item, index) => createVNode("li", {
|
|
6718
|
+
key: index,
|
|
6719
|
+
onClick: () => onChangeActivateNode(index),
|
|
6720
|
+
class: {
|
|
6721
|
+
"is-activate": activateNodeIndex.value === index
|
|
6722
|
+
}
|
|
6723
|
+
}, [ createVNode(ElImage, {
|
|
6724
|
+
style: "height: 100%",
|
|
6725
|
+
src: item.imageSrc,
|
|
6726
|
+
"zoom-rate": 1.2,
|
|
6727
|
+
"max-scale": 2,
|
|
6728
|
+
"min-scale": .2,
|
|
6729
|
+
fit: "cover"
|
|
6730
|
+
}, null) ]))) ]) ]
|
|
6731
|
+
}) ]), createVNode("div", {
|
|
6732
|
+
class: [ ns$1.be("footer", "right") ]
|
|
6733
|
+
}, [ createVNode(ElIcon, {
|
|
6734
|
+
size: 24,
|
|
6735
|
+
color: "#797979",
|
|
6736
|
+
onClick: onPaginationNext
|
|
6737
|
+
}, {
|
|
6738
|
+
default: () => [ createVNode(arrow_right_default, null, null) ]
|
|
6739
|
+
}) ]) ]) ]
|
|
6740
|
+
}) ]
|
|
6741
|
+
}) ]) ]);
|
|
6742
|
+
}
|
|
6743
|
+
});
|
|
6744
|
+
|
|
6745
|
+
const ns = useNamespace("labelimg-preview");
|
|
6746
|
+
|
|
6747
|
+
var preview = defineComponent({
|
|
6748
|
+
name: "NextLabelimgPreview",
|
|
6749
|
+
props: {
|
|
6750
|
+
className: {
|
|
6751
|
+
type: String,
|
|
6752
|
+
default: ""
|
|
6753
|
+
},
|
|
6754
|
+
style: {
|
|
6755
|
+
type: Object,
|
|
6756
|
+
default: () => ({})
|
|
6757
|
+
},
|
|
6758
|
+
src: {
|
|
6759
|
+
type: String,
|
|
6760
|
+
default: ""
|
|
6761
|
+
},
|
|
6762
|
+
classes: {
|
|
6763
|
+
type: Array,
|
|
6764
|
+
default: () => []
|
|
6765
|
+
},
|
|
6766
|
+
labels: {
|
|
6767
|
+
type: Array,
|
|
6768
|
+
default: () => []
|
|
6769
|
+
}
|
|
6770
|
+
},
|
|
6771
|
+
setup(props) {
|
|
6772
|
+
const canvasBaseRef = ref(), classes = ref(deepClone(props.classes)), labels = ref(deepClone(props.labels)), renderImageAndLabel = () => {
|
|
6773
|
+
if (props.src) {
|
|
6774
|
+
const ctx = canvasBaseRef.value?.getContext("2d"), image = new Image;
|
|
6775
|
+
image.src = props.src, image.onload = () => {
|
|
6776
|
+
const {width: width, height: height} = image, canvasHeight = height, scaleFactor = canvasHeight / height, canvasWidth = Math.ceil(width * scaleFactor);
|
|
6777
|
+
((canvasWidth, canvasHeight) => {
|
|
6778
|
+
canvasBaseRef.value.width = canvasWidth, canvasBaseRef.value.height = canvasHeight,
|
|
6779
|
+
canvasBaseRef.value.style.width = canvasWidth + "px", canvasBaseRef.value.style.height = canvasHeight + "px";
|
|
6780
|
+
})(canvasWidth, canvasHeight), ctx.clearRect(0, 0, canvasWidth, canvasHeight), ctx.drawImage(image, 0, 0, canvasWidth, canvasHeight);
|
|
6781
|
+
for (let i = 0; i < labels.value.length; i++) {
|
|
6782
|
+
const rect = labels.value[i], {startX: startX, startY: startY, rectWidth: rectWidth, rectHeight: rectHeight, type: type} = rect, color = colors[type % colors.length];
|
|
6783
|
+
if (ctx.font = "bold 14px serif", ctx.textBaseline = "top", ctx.save(), ctx.strokeStyle = color,
|
|
6784
|
+
ctx.strokeRect(startX, startY, rectWidth, rectHeight), !isValueExist(rect.typeName)) {
|
|
6785
|
+
const typeName = classes.value[rect.type];
|
|
6786
|
+
typeName && (rect.typeName = typeName);
|
|
6787
|
+
}
|
|
6788
|
+
if (isValueExist(rect.typeName) || isValueExist(rect.type)) {
|
|
6789
|
+
const text = rect.typeName || rect.type;
|
|
6790
|
+
ctx.fillStyle = color, ctx.fillText(text, startX + 6, startY + 6);
|
|
6791
|
+
}
|
|
6792
|
+
ctx.restore();
|
|
6793
|
+
}
|
|
6794
|
+
};
|
|
6795
|
+
}
|
|
6796
|
+
};
|
|
6797
|
+
onMounted((() => {
|
|
6798
|
+
watch((() => props.src), (() => {
|
|
6799
|
+
renderImageAndLabel();
|
|
6800
|
+
}), {
|
|
6801
|
+
immediate: !0
|
|
6802
|
+
});
|
|
6803
|
+
}));
|
|
6804
|
+
return () => createVNode(Fragment, null, [ createVNode("div", {
|
|
6805
|
+
class: [ ns.b(), props.className ],
|
|
6806
|
+
style: {
|
|
6807
|
+
...props.style
|
|
6808
|
+
}
|
|
6809
|
+
}, [ createVNode("canvas", {
|
|
6810
|
+
ref: canvasBaseRef
|
|
6811
|
+
}, null) ]) ]);
|
|
6812
|
+
}
|
|
6813
|
+
});
|
|
6814
|
+
|
|
6815
|
+
const NextLabelimg = withInstall(Element), NextLabelimgPreview = withInstall(preview);
|
|
5862
6816
|
|
|
5863
6817
|
var components = Object.freeze({
|
|
5864
6818
|
__proto__: null,
|
|
@@ -5868,6 +6822,8 @@ var components = Object.freeze({
|
|
|
5868
6822
|
NextDialog: NextDialog,
|
|
5869
6823
|
NextDragResize: NextDragResize,
|
|
5870
6824
|
NextForm: NextForm,
|
|
6825
|
+
NextLabelimg: NextLabelimg,
|
|
6826
|
+
NextLabelimgPreview: NextLabelimgPreview,
|
|
5871
6827
|
NextLayout: NextLayout,
|
|
5872
6828
|
NextMenu: NextMenu,
|
|
5873
6829
|
NextSpinLoading: NextSpinLoading,
|
|
@@ -5910,7 +6866,7 @@ const zoomDialog = app => {
|
|
|
5910
6866
|
}));
|
|
5911
6867
|
}
|
|
5912
6868
|
});
|
|
5913
|
-
}, version = "0.2.
|
|
6869
|
+
}, version = "0.2.9", install = function(app) {
|
|
5914
6870
|
Object.keys(components).forEach((key => {
|
|
5915
6871
|
const component = components[key];
|
|
5916
6872
|
app.component(component.name, component);
|
|
@@ -5920,8 +6876,8 @@ const zoomDialog = app => {
|
|
|
5920
6876
|
};
|
|
5921
6877
|
|
|
5922
6878
|
var index = {
|
|
5923
|
-
version: "0.2.
|
|
6879
|
+
version: "0.2.9",
|
|
5924
6880
|
install: install
|
|
5925
6881
|
};
|
|
5926
6882
|
|
|
5927
|
-
export { NextContainer, NextCrudTable, NextCrudTableVirtualized, NextDialog, NextDragResize, NextForm, 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 };
|
|
6883
|
+
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 };
|