next-element-vue 0.2.8 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.css +2 -2
- package/dist/index.js +555 -244
- package/dist/index.min.js +3 -3
- package/dist/index.umd.js +556 -250
- package/dist/index.umd.min.js +3 -3
- package/dist/packages/components/crud-table/src/config.d.ts +1 -0
- package/dist/packages/components/crud-table-virtualized/src/index.test.d.ts +2 -2
- package/dist/packages/components/form/src/config.d.ts +2 -0
- package/dist/packages/components/form/src/widgets/upload-image.d.ts +20 -1
- package/dist/packages/components/labelimg/index.d.ts +84 -10
- package/dist/packages/components/labelimg/src/config.d.ts +4 -0
- package/dist/packages/components/labelimg/src/hooks/canvas-context-hook.d.ts +8 -1
- package/dist/packages/components/labelimg/src/index.d.ts +35 -10
- package/dist/packages/components/labelimg/src/preview.d.ts +51 -0
- package/dist/packages/components/labelimg/src/widgets/canvas-context.d.ts +13 -2
- package/dist/packages/components/labelimg/src/widgets/draggable-rect.d.ts +9 -0
- package/dist/packages/components/labelimg/src/widgets/right-label.d.ts +28 -0
- package/dist/packages/components/spin-loading/index.d.ts +1 -0
- package/dist/packages/components/spin-loading/src/index.d.ts +1 -0
- package/dist/packages/hooks/use-locale/index.d.ts +3 -0
- package/dist/packages/locale/lang/en.d.ts +3 -0
- package/dist/packages/locale/lang/zh-cn.d.ts +3 -0
- package/dist/packages/locale/lang/zh-tw.d.ts +3 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -2,14 +2,14 @@
|
|
|
2
2
|
/**
|
|
3
3
|
* 作 者:huangteng
|
|
4
4
|
* 邮 箱:htengweb@163.com
|
|
5
|
-
* 当前版本:0.
|
|
6
|
-
* 发布日期:2024-06-
|
|
5
|
+
* 当前版本:0.3.0 v
|
|
6
|
+
* 发布日期:2024-06-16
|
|
7
7
|
* 地 址:https://www.npmjs.com/package/next-element-vue
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
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
|
|
|
@@ -854,7 +854,8 @@ var merge = createAssigner((function(object, source, srcIndex) {
|
|
|
854
854
|
cancelDelete: "取消删除操作",
|
|
855
855
|
confirmButtonText: "确 定",
|
|
856
856
|
cancelButtonText: "取 消"
|
|
857
|
-
}
|
|
857
|
+
},
|
|
858
|
+
uploadfileExceed: "上传文件数量超出限制范围"
|
|
858
859
|
},
|
|
859
860
|
form: {
|
|
860
861
|
input: "请输入",
|
|
@@ -889,7 +890,9 @@ var merge = createAssigner((function(object, source, srcIndex) {
|
|
|
889
890
|
systemSetting: "系统配置"
|
|
890
891
|
},
|
|
891
892
|
labelimg: {
|
|
892
|
-
saveTxt: "保存中..."
|
|
893
|
+
saveTxt: "保存中...",
|
|
894
|
+
emptyLabelText: "暂无标签数据",
|
|
895
|
+
confirmDeleteLabel: "确定要删除该标注吗?"
|
|
893
896
|
}
|
|
894
897
|
}
|
|
895
898
|
}, enLocale = {
|
|
@@ -926,7 +929,8 @@ var merge = createAssigner((function(object, source, srcIndex) {
|
|
|
926
929
|
cancelDelete: "Cancel delete",
|
|
927
930
|
confirmButtonText: "OK",
|
|
928
931
|
cancelButtonText: "Cancel"
|
|
929
|
-
}
|
|
932
|
+
},
|
|
933
|
+
uploadfileExceed: "The number of uploaded files exceeds the limit"
|
|
930
934
|
},
|
|
931
935
|
form: {
|
|
932
936
|
input: "please input ",
|
|
@@ -961,7 +965,9 @@ var merge = createAssigner((function(object, source, srcIndex) {
|
|
|
961
965
|
systemSetting: "system setting"
|
|
962
966
|
},
|
|
963
967
|
labelimg: {
|
|
964
|
-
saveTxt: "saving..."
|
|
968
|
+
saveTxt: "saving...",
|
|
969
|
+
emptyLabelText: "No label data",
|
|
970
|
+
confirmDeleteLabel: "Are you sure you want to delete this annotation?"
|
|
965
971
|
}
|
|
966
972
|
}
|
|
967
973
|
}, zhtwLocale = {
|
|
@@ -998,7 +1004,8 @@ var merge = createAssigner((function(object, source, srcIndex) {
|
|
|
998
1004
|
cancelDelete: "取消删除操作",
|
|
999
1005
|
confirmButtonText: "確 定",
|
|
1000
1006
|
cancelButtonText: "取 消"
|
|
1001
|
-
}
|
|
1007
|
+
},
|
|
1008
|
+
uploadfileExceed: "上传文件数量超出限制范围"
|
|
1002
1009
|
},
|
|
1003
1010
|
form: {
|
|
1004
1011
|
input: "請輸入",
|
|
@@ -1033,7 +1040,9 @@ var merge = createAssigner((function(object, source, srcIndex) {
|
|
|
1033
1040
|
systemSetting: "系統配置"
|
|
1034
1041
|
},
|
|
1035
1042
|
labelimg: {
|
|
1036
|
-
saveTxt: "保存中..."
|
|
1043
|
+
saveTxt: "保存中...",
|
|
1044
|
+
emptyLabelText: "暂无标签数据",
|
|
1045
|
+
confirmDeleteLabel: "确定要删除该标注吗?"
|
|
1037
1046
|
}
|
|
1038
1047
|
}
|
|
1039
1048
|
};
|
|
@@ -1199,7 +1208,7 @@ const {getLightColor: getLightColor$4} = useChangeColor(), nextUseCssVar = (cssv
|
|
|
1199
1208
|
return main;
|
|
1200
1209
|
}, slots_config_headerMenu = "header-menu", slots_config_headerToolsPrefix = "header-tools-prefix", slots_config_headerToolsSuffix = "header-tools-suffix";
|
|
1201
1210
|
|
|
1202
|
-
var defaultConfig$
|
|
1211
|
+
var defaultConfig$4 = {
|
|
1203
1212
|
logo: "",
|
|
1204
1213
|
title: "Next Element Vue",
|
|
1205
1214
|
userName: "Admin",
|
|
@@ -1244,7 +1253,7 @@ var defaultConfig$3 = {
|
|
|
1244
1253
|
}
|
|
1245
1254
|
};
|
|
1246
1255
|
|
|
1247
|
-
const ns$
|
|
1256
|
+
const ns$k = useNamespace("text-ellipsis");
|
|
1248
1257
|
|
|
1249
1258
|
const NextTextEllipsis = withInstall(defineComponent({
|
|
1250
1259
|
name: "NextTextEllipsis",
|
|
@@ -1291,7 +1300,7 @@ const NextTextEllipsis = withInstall(defineComponent({
|
|
|
1291
1300
|
}
|
|
1292
1301
|
};
|
|
1293
1302
|
return () => createVNode(Fragment, null, [ createVNode("div", {
|
|
1294
|
-
class: [ ns$
|
|
1303
|
+
class: [ ns$k.b(), props.class ],
|
|
1295
1304
|
style: setWidth.value,
|
|
1296
1305
|
onMouseenter: onMouseenter
|
|
1297
1306
|
}, [ isTip.value ? createVNode(ElTooltip, {
|
|
@@ -1301,11 +1310,11 @@ const NextTextEllipsis = withInstall(defineComponent({
|
|
|
1301
1310
|
disabled: props.disabled
|
|
1302
1311
|
}, {
|
|
1303
1312
|
default: () => [ createVNode("span", {
|
|
1304
|
-
class: ns$
|
|
1313
|
+
class: ns$k.e("text"),
|
|
1305
1314
|
ref: ellipsisRef
|
|
1306
1315
|
}, [ slots.default ? slots.default() : props.content ]) ]
|
|
1307
1316
|
}) : createVNode("span", {
|
|
1308
|
-
class: ns$
|
|
1317
|
+
class: ns$k.e("text"),
|
|
1309
1318
|
ref: ellipsisRef
|
|
1310
1319
|
}, [ slots.default ? slots.default() : props.content ]) ]) ]);
|
|
1311
1320
|
}
|
|
@@ -2677,7 +2686,7 @@ const NextMenuItem = defineComponent({
|
|
|
2677
2686
|
}, null) ]
|
|
2678
2687
|
}))) ]) ]);
|
|
2679
2688
|
}
|
|
2680
|
-
}), ns$
|
|
2689
|
+
}), ns$j = useNamespace("menu");
|
|
2681
2690
|
|
|
2682
2691
|
const NextMenu = withInstall(defineComponent({
|
|
2683
2692
|
name: "NextMenu",
|
|
@@ -2705,13 +2714,13 @@ const NextMenu = withInstall(defineComponent({
|
|
|
2705
2714
|
}
|
|
2706
2715
|
},
|
|
2707
2716
|
setup(props) {
|
|
2708
|
-
provide("ns", ns$
|
|
2717
|
+
provide("ns", ns$j);
|
|
2709
2718
|
const router = getCurrentInstance().appContext.config.globalProperties.$router, currentPath = router.currentRoute?.value.fullPath, activePath = ref(currentPath);
|
|
2710
2719
|
watch((() => router.currentRoute?.value), (to => {
|
|
2711
2720
|
activePath.value = to.fullPath;
|
|
2712
2721
|
}));
|
|
2713
2722
|
return () => createVNode(Fragment, null, [ createVNode(ElMenu, {
|
|
2714
|
-
class: [ ns$
|
|
2723
|
+
class: [ ns$j.b(), props.className ],
|
|
2715
2724
|
style: props.style,
|
|
2716
2725
|
defaultActive: activePath.value,
|
|
2717
2726
|
router: props.router,
|
|
@@ -2719,7 +2728,7 @@ const NextMenu = withInstall(defineComponent({
|
|
|
2719
2728
|
ellipsis: !0
|
|
2720
2729
|
}, {
|
|
2721
2730
|
default: () => [ createVNode(Fragment, null, [ props.menuTree.map((item => item.children?.length ? valueExist(item.meta?.isHide, !1) ? null : createVNode(ElSubMenu, {
|
|
2722
|
-
"popper-class": ns$
|
|
2731
|
+
"popper-class": ns$j.b("popper"),
|
|
2723
2732
|
index: item.path || item.id,
|
|
2724
2733
|
teleported: !0
|
|
2725
2734
|
}, {
|
|
@@ -2730,7 +2739,7 @@ const NextMenu = withInstall(defineComponent({
|
|
|
2730
2739
|
menuData: item.children
|
|
2731
2740
|
}, null)
|
|
2732
2741
|
}) : valueExist(item.meta?.isHide, !1) ? null : createVNode(ElMenuItem, {
|
|
2733
|
-
"popper-class": ns$
|
|
2742
|
+
"popper-class": ns$j.b("popper"),
|
|
2734
2743
|
index: item.path
|
|
2735
2744
|
}, {
|
|
2736
2745
|
default: () => [ createVNode(MenuItemTitle, {
|
|
@@ -2758,20 +2767,20 @@ var Sidebar$2 = defineComponent({
|
|
|
2758
2767
|
}
|
|
2759
2768
|
});
|
|
2760
2769
|
|
|
2761
|
-
const ns$
|
|
2770
|
+
const ns$i = useNamespace("layout-defaults");
|
|
2762
2771
|
|
|
2763
2772
|
var defaults = defineComponent({
|
|
2764
2773
|
props: {},
|
|
2765
|
-
setup: () => (provide("ns", ns$
|
|
2774
|
+
setup: () => (provide("ns", ns$i), {}),
|
|
2766
2775
|
render() {
|
|
2767
2776
|
const slots = this.$slots, _config = inject("options", {}), _emit = inject("__emit__", {});
|
|
2768
2777
|
slots.menu;
|
|
2769
2778
|
const isTabs = ref(!!slots.tabs);
|
|
2770
2779
|
return void 0 === slots.tabs && _config.showTabs && (isTabs.value = !0), createVNode(ElContainer, {
|
|
2771
|
-
class: ns$
|
|
2780
|
+
class: ns$i.b()
|
|
2772
2781
|
}, {
|
|
2773
2782
|
default: () => [ createVNode(Sidebar$2, null, null), createVNode("div", {
|
|
2774
|
-
class: [ ns$
|
|
2783
|
+
class: [ ns$i.b("content") ]
|
|
2775
2784
|
}, [ createVNode(Header$3, null, null), _config.showTabs ? slots.tabs ? slots.tabs?.() : createVNode(NextTabs, {
|
|
2776
2785
|
tabs: _config.tabs,
|
|
2777
2786
|
activeTab: _config.activeTab,
|
|
@@ -2779,7 +2788,7 @@ var defaults = defineComponent({
|
|
|
2779
2788
|
onSelect: (...arg) => _emit("tabsSelect", ...arg),
|
|
2780
2789
|
onClose: (...arg) => _emit("tabsClose", ...arg)
|
|
2781
2790
|
}, null) : null, createVNode("main", {
|
|
2782
|
-
class: [ ns$
|
|
2791
|
+
class: [ ns$i.bf("main"), ns$i.is("layout-tabs", isTabs.value) ]
|
|
2783
2792
|
}, [ slots.default?.() ]) ]) ]
|
|
2784
2793
|
});
|
|
2785
2794
|
}
|
|
@@ -2812,11 +2821,11 @@ var Header$2 = defineComponent({
|
|
|
2812
2821
|
}
|
|
2813
2822
|
});
|
|
2814
2823
|
|
|
2815
|
-
const ns$
|
|
2824
|
+
const ns$h = useNamespace("layout-transverse");
|
|
2816
2825
|
|
|
2817
2826
|
var transverse = defineComponent({
|
|
2818
2827
|
props: {},
|
|
2819
|
-
setup: () => (provide("ns", ns$
|
|
2828
|
+
setup: () => (provide("ns", ns$h), {}),
|
|
2820
2829
|
render() {
|
|
2821
2830
|
const slots = this.$slots, _config = inject("options", {}), _emit = inject("__emit__", {}), __slots_header = {};
|
|
2822
2831
|
slots[slots_config_headerMenu] && (__slots_header[slots_config_headerMenu] = () => slots[slots_config_headerMenu]()),
|
|
@@ -2833,7 +2842,7 @@ var transverse = defineComponent({
|
|
|
2833
2842
|
onSelect: (...arg) => _emit("tabsSelect", ...arg),
|
|
2834
2843
|
onClose: (...arg) => _emit("tabsClose", ...arg)
|
|
2835
2844
|
}, null) : null, createVNode("main", {
|
|
2836
|
-
class: [ ns$
|
|
2845
|
+
class: [ ns$h.b("main"), ns$h.is("layout-tabs", isTabs.value) ]
|
|
2837
2846
|
}, [ slots.default?.() ]) ]);
|
|
2838
2847
|
var s;
|
|
2839
2848
|
}
|
|
@@ -2875,11 +2884,11 @@ var Header$1 = defineComponent({
|
|
|
2875
2884
|
}
|
|
2876
2885
|
});
|
|
2877
2886
|
|
|
2878
|
-
const ns$
|
|
2887
|
+
const ns$g = useNamespace("layout-columns");
|
|
2879
2888
|
|
|
2880
2889
|
var columns = defineComponent({
|
|
2881
2890
|
props: {},
|
|
2882
|
-
setup: () => (provide("ns", ns$
|
|
2891
|
+
setup: () => (provide("ns", ns$g), {}),
|
|
2883
2892
|
render() {
|
|
2884
2893
|
const slots = this.$slots, _config = inject("options", {}), _emit = inject("__emit__", {}), __slots_header = {};
|
|
2885
2894
|
slots[slots_config_headerMenu] && (__slots_header[slots_config_headerMenu] = () => slots[slots_config_headerMenu]()),
|
|
@@ -2887,11 +2896,11 @@ var columns = defineComponent({
|
|
|
2887
2896
|
slots[slots_config_headerToolsSuffix] && (__slots_header[slots_config_headerToolsSuffix] = () => slots[slots_config_headerToolsSuffix]());
|
|
2888
2897
|
const isTabs = ref(!!slots.tabs);
|
|
2889
2898
|
return void 0 === slots.tabs && _config.showTabs && (isTabs.value = !0), createVNode(ElContainer, {
|
|
2890
|
-
class: ns$
|
|
2899
|
+
class: ns$g.b()
|
|
2891
2900
|
}, {
|
|
2892
2901
|
default: () => {
|
|
2893
2902
|
return [ createVNode(Sidebar$1, null, null), createVNode("div", {
|
|
2894
|
-
class: [ ns$
|
|
2903
|
+
class: [ ns$g.b("content") ]
|
|
2895
2904
|
}, [ createVNode(Header$1, null, (s = __slots_header, "function" == typeof s || "[object Object]" === Object.prototype.toString.call(s) && !isVNode(s) ? __slots_header : {
|
|
2896
2905
|
default: () => [ __slots_header ]
|
|
2897
2906
|
})), _config.showTabs ? slots.tabs ? slots.tabs?.() : createVNode(NextTabs, {
|
|
@@ -2901,7 +2910,7 @@ var columns = defineComponent({
|
|
|
2901
2910
|
onSelect: (...arg) => _emit("tabsSelect", ...arg),
|
|
2902
2911
|
onClose: (...arg) => _emit("tabsClose", ...arg)
|
|
2903
2912
|
}, null) : null, createVNode("main", {
|
|
2904
|
-
class: [ ns$
|
|
2913
|
+
class: [ ns$g.bf("main"), ns$g.is("layout-tabs", isTabs.value) ]
|
|
2905
2914
|
}, [ slots.default?.() ]) ]) ];
|
|
2906
2915
|
var s;
|
|
2907
2916
|
}
|
|
@@ -2947,21 +2956,21 @@ var Header = defineComponent({
|
|
|
2947
2956
|
}
|
|
2948
2957
|
});
|
|
2949
2958
|
|
|
2950
|
-
const ns$
|
|
2959
|
+
const ns$f = useNamespace("layout-classic");
|
|
2951
2960
|
|
|
2952
2961
|
var classic = defineComponent({
|
|
2953
2962
|
props: {},
|
|
2954
|
-
setup: () => (provide("ns", ns$
|
|
2955
|
-
ns: ns$
|
|
2963
|
+
setup: () => (provide("ns", ns$f), {
|
|
2964
|
+
ns: ns$f
|
|
2956
2965
|
}),
|
|
2957
2966
|
render() {
|
|
2958
2967
|
const slots = this.$slots, _config = inject("options", {}), _emit = inject("__emit__", {});
|
|
2959
2968
|
slots.menu;
|
|
2960
2969
|
const isTabs = ref(!!slots.tabs);
|
|
2961
2970
|
return void 0 === slots.tabs && _config.showTabs && (isTabs.value = !0), createVNode(Fragment, null, [ createVNode(Header, null, null), createVNode("div", {
|
|
2962
|
-
class: [ ns$
|
|
2971
|
+
class: [ ns$f.b("content"), ns$f.is("layout-tabs", isTabs.value) ]
|
|
2963
2972
|
}, [ createVNode(Sidebar, null, null), createVNode("div", {
|
|
2964
|
-
class: ns$
|
|
2973
|
+
class: ns$f.b("container")
|
|
2965
2974
|
}, [ _config.showTabs ? slots.tabs ? slots.tabs?.() : createVNode(NextTabs, {
|
|
2966
2975
|
tabs: _config.tabs,
|
|
2967
2976
|
activeTab: _config.activeTab,
|
|
@@ -2969,12 +2978,12 @@ var classic = defineComponent({
|
|
|
2969
2978
|
onSelect: (...arg) => _emit("tabsSelect", ...arg),
|
|
2970
2979
|
onClose: (...arg) => _emit("tabsClose", ...arg)
|
|
2971
2980
|
}, null) : null, createVNode("main", {
|
|
2972
|
-
class: [ ns$
|
|
2981
|
+
class: [ ns$f.b("main") ]
|
|
2973
2982
|
}, [ slots.default?.() ]) ]) ]) ]);
|
|
2974
2983
|
}
|
|
2975
2984
|
});
|
|
2976
2985
|
|
|
2977
|
-
const ns$
|
|
2986
|
+
const ns$e = useNamespace("layout"), layouts = {
|
|
2978
2987
|
defaults: markRaw(defaults),
|
|
2979
2988
|
transverse: markRaw(transverse),
|
|
2980
2989
|
columns: markRaw(columns),
|
|
@@ -3001,8 +3010,8 @@ const NextLayout = withInstall(defineComponent({
|
|
|
3001
3010
|
},
|
|
3002
3011
|
emits: [ "changeLanguage", "changeUserDropdown", "changeOptions", "tabsChange", "tabsSelect", "tabsClose" ],
|
|
3003
3012
|
setup(props, {slots: slots, emit: emit}) {
|
|
3004
|
-
const _config = ref(mergeWith(defaultConfig$
|
|
3005
|
-
provide("options", _config.value), provide("__ns__", ns$
|
|
3013
|
+
const _config = ref(mergeWith(defaultConfig$4, props.options, customizerCoverArray));
|
|
3014
|
+
provide("options", _config.value), provide("__ns__", ns$e), provide("__emit__", emit),
|
|
3006
3015
|
provide("__slots__", slots);
|
|
3007
3016
|
const updateOptions = cfg => {
|
|
3008
3017
|
_config.value = mergeWith(_config.value, cfg, customizerCoverArray), updateThemeColorCssVar(_config.value?.setting),
|
|
@@ -3026,13 +3035,13 @@ const NextLayout = withInstall(defineComponent({
|
|
|
3026
3035
|
const _activeSlots = {};
|
|
3027
3036
|
for (const key in slots) Object.prototype.hasOwnProperty.call(slots, key) && (_activeSlots[key] = () => slots[key]?.());
|
|
3028
3037
|
return createVNode("div", {
|
|
3029
|
-
class: [ ns$
|
|
3038
|
+
class: [ ns$e.b(), props.className ],
|
|
3030
3039
|
style: props.style
|
|
3031
3040
|
}, [ h(activeLayout.value, {}, {
|
|
3032
3041
|
..._activeSlots
|
|
3033
3042
|
}) ]);
|
|
3034
3043
|
}
|
|
3035
|
-
})), ns$
|
|
3044
|
+
})), ns$d = useNamespace("tabs");
|
|
3036
3045
|
|
|
3037
3046
|
var Element$8 = defineComponent({
|
|
3038
3047
|
name: "NextTabs",
|
|
@@ -3103,12 +3112,12 @@ var Element$8 = defineComponent({
|
|
|
3103
3112
|
tabsView.value.push(activeRoute)), emit("change", activeIndex.value, tabsView.value, "add");
|
|
3104
3113
|
}));
|
|
3105
3114
|
const renderContent = () => createVNode("nav", {
|
|
3106
|
-
class: ns$
|
|
3115
|
+
class: ns$d.b()
|
|
3107
3116
|
}, [ createVNode(ElScrollbar, null, {
|
|
3108
3117
|
default: () => [ createVNode("ul", {
|
|
3109
|
-
class: ns$
|
|
3118
|
+
class: ns$d.b("list")
|
|
3110
3119
|
}, [ tabsView.value.map(((tab, index) => tab ? createVNode("li", {
|
|
3111
|
-
class: [ "tab-item", ns$
|
|
3120
|
+
class: [ "tab-item", ns$d.is("active", activeIndex.value === index) ],
|
|
3112
3121
|
onClick: event => onClickTabItem(event, tab, index)
|
|
3113
3122
|
}, [ createVNode("i", {
|
|
3114
3123
|
class: [ "tab-icon", tab.meta?.icon ]
|
|
@@ -3139,11 +3148,11 @@ var Element$8 = defineComponent({
|
|
|
3139
3148
|
onCommand: onChange
|
|
3140
3149
|
}, {
|
|
3141
3150
|
default: () => createVNode("span", {
|
|
3142
|
-
class: ns$
|
|
3151
|
+
class: ns$d.b("tab-more")
|
|
3143
3152
|
}, [ createVNode("i", {
|
|
3144
|
-
class: [ ns$
|
|
3153
|
+
class: [ ns$d.be("tab-more", "box"), ns$d.be("tab-more", "top") ]
|
|
3145
3154
|
}, null), createVNode("i", {
|
|
3146
|
-
class: [ ns$
|
|
3155
|
+
class: [ ns$d.be("tab-more", "box"), ns$d.be("tab-more", "bottom") ]
|
|
3147
3156
|
}, null) ]),
|
|
3148
3157
|
dropdown: () => createVNode(ElDropdownMenu, null, {
|
|
3149
3158
|
default: () => [ createVNode(ElDropdownItem, {
|
|
@@ -3177,7 +3186,7 @@ var Element$8 = defineComponent({
|
|
|
3177
3186
|
}
|
|
3178
3187
|
});
|
|
3179
3188
|
|
|
3180
|
-
const NextTabs = withInstall(Element$8), ns$
|
|
3189
|
+
const NextTabs = withInstall(Element$8), ns$c = useNamespace("container");
|
|
3181
3190
|
|
|
3182
3191
|
const NextContainer = withInstall(defineComponent({
|
|
3183
3192
|
name: "NextContainer",
|
|
@@ -3216,18 +3225,18 @@ const NextContainer = withInstall(defineComponent({
|
|
|
3216
3225
|
}), style;
|
|
3217
3226
|
}));
|
|
3218
3227
|
return () => props.scrollbar ? createVNode(ElScrollbar, {
|
|
3219
|
-
class: [ ns$
|
|
3228
|
+
class: [ ns$c.b(), props.className ],
|
|
3220
3229
|
style: props.style
|
|
3221
3230
|
}, {
|
|
3222
3231
|
default: () => [ slots.default?.() ]
|
|
3223
3232
|
}) : createVNode("div", {
|
|
3224
|
-
class: [ ns$
|
|
3233
|
+
class: [ ns$c.b(), props.className ],
|
|
3225
3234
|
style: {
|
|
3226
3235
|
...styles.value,
|
|
3227
3236
|
...props.style
|
|
3228
3237
|
}
|
|
3229
3238
|
}, [ props.card ? createVNode("div", {
|
|
3230
|
-
class: ns$
|
|
3239
|
+
class: ns$c.b("card")
|
|
3231
3240
|
}, [ slots.default?.() ]) : slots.default?.() ]);
|
|
3232
3241
|
}
|
|
3233
3242
|
}));
|
|
@@ -3305,7 +3314,7 @@ var defaultPropsConfig = {
|
|
|
3305
3314
|
|
|
3306
3315
|
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" ];
|
|
3307
3316
|
|
|
3308
|
-
var defaultConfig$
|
|
3317
|
+
var defaultConfig$3 = {
|
|
3309
3318
|
initLoadData: !0,
|
|
3310
3319
|
defaultContentHeight: 300,
|
|
3311
3320
|
fullscreenchangeContentHeight: !1,
|
|
@@ -3352,7 +3361,7 @@ var defaultConfig$2 = {
|
|
|
3352
3361
|
formColumnMinWidth: 350
|
|
3353
3362
|
};
|
|
3354
3363
|
|
|
3355
|
-
const columnSlotName = prop => "column-" + prop, searchFormSlotName = prop => "search-" + prop, formSlotName = prop => "form-" + prop, ns$
|
|
3364
|
+
const columnSlotName = prop => "column-" + prop, searchFormSlotName = prop => "search-" + prop, formSlotName = prop => "form-" + prop, ns$b = useNamespace("spin-loading");
|
|
3356
3365
|
|
|
3357
3366
|
var NextSpinLoading$1 = defineComponent({
|
|
3358
3367
|
name: "NextSpinLoading",
|
|
@@ -3374,31 +3383,35 @@ var NextSpinLoading$1 = defineComponent({
|
|
|
3374
3383
|
default: ""
|
|
3375
3384
|
}
|
|
3376
3385
|
},
|
|
3377
|
-
setup() {
|
|
3378
|
-
const {t: t} = useLocale();
|
|
3379
|
-
return {
|
|
3380
|
-
|
|
3386
|
+
setup(props, {expose: expose}) {
|
|
3387
|
+
const {t: t} = useLocale(), elementInstance = ref();
|
|
3388
|
+
return expose({
|
|
3389
|
+
elementInstance: elementInstance
|
|
3390
|
+
}), {
|
|
3391
|
+
t: t,
|
|
3392
|
+
elementInstance: elementInstance
|
|
3381
3393
|
};
|
|
3382
3394
|
},
|
|
3383
3395
|
render() {
|
|
3384
3396
|
const _t = this.t, slots = this.$slots, props = this.$props, loadingText = props.tip || _t("next.loading");
|
|
3385
3397
|
return createVNode("div", {
|
|
3386
|
-
|
|
3398
|
+
ref: "elementInstance",
|
|
3399
|
+
class: [ ns$b.b(), props.className ],
|
|
3387
3400
|
style: props.style
|
|
3388
3401
|
}, [ slots.default?.(), props.loading ? createVNode("div", {
|
|
3389
|
-
class: ns$
|
|
3402
|
+
class: ns$b.b("mask")
|
|
3390
3403
|
}, [ createVNode("span", {
|
|
3391
|
-
class: ns$
|
|
3404
|
+
class: ns$b.b("mask-dot")
|
|
3392
3405
|
}, [ createVNode("i", {
|
|
3393
|
-
class: ns$
|
|
3406
|
+
class: ns$b.be("mask", "dot-item")
|
|
3394
3407
|
}, null), createVNode("i", {
|
|
3395
|
-
class: ns$
|
|
3408
|
+
class: ns$b.be("mask", "dot-item")
|
|
3396
3409
|
}, null), createVNode("i", {
|
|
3397
|
-
class: ns$
|
|
3410
|
+
class: ns$b.be("mask", "dot-item")
|
|
3398
3411
|
}, null), createVNode("i", {
|
|
3399
|
-
class: ns$
|
|
3412
|
+
class: ns$b.be("mask", "dot-item")
|
|
3400
3413
|
}, null) ]), createVNode("span", {
|
|
3401
|
-
class: ns$
|
|
3414
|
+
class: ns$b.be("mask", "text")
|
|
3402
3415
|
}, [ loadingText ]) ]) : null ]);
|
|
3403
3416
|
}
|
|
3404
3417
|
}), SearchColumn = defineComponent({
|
|
@@ -3813,8 +3826,11 @@ var HeaderSearch = defineComponent({
|
|
|
3813
3826
|
class: ns.b("header-menu")
|
|
3814
3827
|
}, [ createVNode("div", {
|
|
3815
3828
|
class: ns.b("header-menu-left")
|
|
3816
|
-
}, [ this.$slots["menu-left-prefix"]?.(
|
|
3829
|
+
}, [ this.$slots["menu-left-prefix"]?.({
|
|
3830
|
+
size: options.size
|
|
3831
|
+
}), options.addBtn && createVNode(ElButton, {
|
|
3817
3832
|
type: "primary",
|
|
3833
|
+
size: options.size,
|
|
3818
3834
|
onClick: () => {
|
|
3819
3835
|
this.$emit("clickAdd");
|
|
3820
3836
|
}
|
|
@@ -3825,6 +3841,7 @@ var HeaderSearch = defineComponent({
|
|
|
3825
3841
|
default: () => t("next.table.add")
|
|
3826
3842
|
}), options.batchDelBtn && createVNode(ElButton, {
|
|
3827
3843
|
type: "danger",
|
|
3844
|
+
size: options.size,
|
|
3828
3845
|
disabled: !multipleSelectionLength.value,
|
|
3829
3846
|
onClick: () => {
|
|
3830
3847
|
const selection = unref(toRaw(multipleSelection.value.map((row => toRaw(row)))));
|
|
@@ -3848,10 +3865,15 @@ var HeaderSearch = defineComponent({
|
|
|
3848
3865
|
default: () => [ createVNode(delete_default, null, null) ]
|
|
3849
3866
|
}),
|
|
3850
3867
|
default: () => t("next.table.batchDelete")
|
|
3851
|
-
}), this.$slots["menu-left-suffix"]?.(
|
|
3868
|
+
}), this.$slots["menu-left-suffix"]?.({
|
|
3869
|
+
size: options.size
|
|
3870
|
+
}) ]), createVNode("div", {
|
|
3852
3871
|
class: ns.b("header-menu-right")
|
|
3853
|
-
}, [ this.$slots["menu-right-prefix"]?.(
|
|
3872
|
+
}, [ this.$slots["menu-right-prefix"]?.({
|
|
3873
|
+
size: options.size
|
|
3874
|
+
}), options.refreshBtn && createVNode(ElButton, {
|
|
3854
3875
|
circle: !0,
|
|
3876
|
+
size: options.size,
|
|
3855
3877
|
onClick: () => {
|
|
3856
3878
|
this.$emit("clickRefresh");
|
|
3857
3879
|
}
|
|
@@ -3861,6 +3883,7 @@ var HeaderSearch = defineComponent({
|
|
|
3861
3883
|
})
|
|
3862
3884
|
}), options.settingBtn && createVNode(ElButton, {
|
|
3863
3885
|
circle: !0,
|
|
3886
|
+
size: options.size,
|
|
3864
3887
|
onClick: () => {
|
|
3865
3888
|
drawerSettingRef.value.visible = !0;
|
|
3866
3889
|
}
|
|
@@ -3868,7 +3891,9 @@ var HeaderSearch = defineComponent({
|
|
|
3868
3891
|
icon: () => createVNode(ElIcon, null, {
|
|
3869
3892
|
default: () => [ createVNode(tools_default, null, null) ]
|
|
3870
3893
|
})
|
|
3871
|
-
}), this.$slots["menu-right-suffix"]?.(
|
|
3894
|
+
}), this.$slots["menu-right-suffix"]?.({
|
|
3895
|
+
size: options.size
|
|
3896
|
+
}) ]), createVNode(DrawerSetting, {
|
|
3872
3897
|
ref: drawerSettingRef
|
|
3873
3898
|
}, null) ]);
|
|
3874
3899
|
}
|
|
@@ -4076,7 +4101,7 @@ var TableColumnOperations = defineComponent({
|
|
|
4076
4101
|
}
|
|
4077
4102
|
});
|
|
4078
4103
|
|
|
4079
|
-
const ns$
|
|
4104
|
+
const ns$a = useNamespace("dialog");
|
|
4080
4105
|
|
|
4081
4106
|
var NextDialog$1 = defineComponent({
|
|
4082
4107
|
name: "NextDialog",
|
|
@@ -4142,7 +4167,7 @@ var NextDialog$1 = defineComponent({
|
|
|
4142
4167
|
return () => createVNode(Fragment, null, [ createVNode(ElDialog, {
|
|
4143
4168
|
modelValue: visible.value,
|
|
4144
4169
|
"onUpdate:modelValue": $event => visible.value = $event,
|
|
4145
|
-
class: ns$
|
|
4170
|
+
class: ns$a.b(),
|
|
4146
4171
|
title: props.title,
|
|
4147
4172
|
appendToBody: props.appendToBody,
|
|
4148
4173
|
"destroy-on-close": !0,
|
|
@@ -4159,12 +4184,12 @@ var NextDialog$1 = defineComponent({
|
|
|
4159
4184
|
}, {
|
|
4160
4185
|
default: () => [ slots.default?.() ],
|
|
4161
4186
|
header: ({close: close, titleId: titleId, titleClass: titleClass}) => createVNode("div", {
|
|
4162
|
-
class: ns$
|
|
4187
|
+
class: ns$a.b("header")
|
|
4163
4188
|
}, [ createVNode("h4", {
|
|
4164
4189
|
id: titleId,
|
|
4165
4190
|
class: titleClass
|
|
4166
4191
|
}, [ props.title ]), createVNode("div", {
|
|
4167
|
-
class: ns$
|
|
4192
|
+
class: ns$a.e("header-right")
|
|
4168
4193
|
}, [ props.fullscreenBtn && createVNode("span", {
|
|
4169
4194
|
class: "icon-fullscreen",
|
|
4170
4195
|
onClick: () => isFullscreen.value = !isFullscreen.value
|
|
@@ -4198,7 +4223,7 @@ const tableSelectConfig = {
|
|
|
4198
4223
|
operations: !1
|
|
4199
4224
|
};
|
|
4200
4225
|
|
|
4201
|
-
var defaultConfig$
|
|
4226
|
+
var defaultConfig$2 = {
|
|
4202
4227
|
size: "default",
|
|
4203
4228
|
colSpan: 8,
|
|
4204
4229
|
labelWidth: "6em",
|
|
@@ -4213,7 +4238,7 @@ var defaultConfig$1 = {
|
|
|
4213
4238
|
resetText: null
|
|
4214
4239
|
};
|
|
4215
4240
|
|
|
4216
|
-
const ns$
|
|
4241
|
+
const ns$9 = useNamespace("form");
|
|
4217
4242
|
|
|
4218
4243
|
var NumberRangePicker = defineComponent({
|
|
4219
4244
|
name: "NumberRangePicker",
|
|
@@ -4253,7 +4278,7 @@ var NumberRangePicker = defineComponent({
|
|
|
4253
4278
|
}));
|
|
4254
4279
|
return () => createVNode(Fragment, null, [ createVNode("div", {
|
|
4255
4280
|
ref: numberRangeRef,
|
|
4256
|
-
class: ns$
|
|
4281
|
+
class: ns$9.e("number-range")
|
|
4257
4282
|
}, [ createVNode(ElInputNumber, {
|
|
4258
4283
|
modelValue: startNumber.value,
|
|
4259
4284
|
"onUpdate:modelValue": $event => startNumber.value = $event,
|
|
@@ -4263,7 +4288,7 @@ var NumberRangePicker = defineComponent({
|
|
|
4263
4288
|
disabled: disabled,
|
|
4264
4289
|
onChange: onChangeStart
|
|
4265
4290
|
}, null), createVNode("span", {
|
|
4266
|
-
class: ns$
|
|
4291
|
+
class: ns$9.em("number-range", "division")
|
|
4267
4292
|
}, [ t("next.date.rangeSeparator") ]), createVNode(ElInputNumber, {
|
|
4268
4293
|
modelValue: endNumber.value,
|
|
4269
4294
|
"onUpdate:modelValue": $event => endNumber.value = $event,
|
|
@@ -4282,7 +4307,7 @@ function _isSlot$3(s) {
|
|
|
4282
4307
|
return "function" == typeof s || "[object Object]" === Object.prototype.toString.call(s) && !isVNode(s);
|
|
4283
4308
|
}
|
|
4284
4309
|
|
|
4285
|
-
const ns$
|
|
4310
|
+
const ns$8 = useNamespace("form"), InputTableSelect = defineComponent({
|
|
4286
4311
|
name: "InputTableSelect",
|
|
4287
4312
|
props: {
|
|
4288
4313
|
modelValue: {
|
|
@@ -4310,7 +4335,7 @@ const ns$7 = useNamespace("form"), InputTableSelect = defineComponent({
|
|
|
4310
4335
|
},
|
|
4311
4336
|
emits: [ "select" ],
|
|
4312
4337
|
setup(props, {emit: emit}) {
|
|
4313
|
-
const {t: t} = useLocale(), _disabled = props.disabled, _column = props.column, _placeholder = _column.placeholder || t("next.form.select") + _column.label, _tableDefaultConfig = deepClone(defaultConfig$
|
|
4338
|
+
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({
|
|
4314
4339
|
visible: !1,
|
|
4315
4340
|
title: _column.label + t("next.form.tableSelect"),
|
|
4316
4341
|
dialogWidth: _options.dialogWidth
|
|
@@ -4381,18 +4406,18 @@ const ns$7 = useNamespace("form"), InputTableSelect = defineComponent({
|
|
|
4381
4406
|
}, renderContent = () => {
|
|
4382
4407
|
let _slot, _slot2;
|
|
4383
4408
|
return createVNode(Fragment, null, [ createVNode("div", {
|
|
4384
|
-
class: [ "el-input", ns$
|
|
4409
|
+
class: [ "el-input", ns$8.e("input-table"), ns$8.is("disabled", _disabled) ]
|
|
4385
4410
|
}, [ createVNode("div", {
|
|
4386
4411
|
class: "el-input__wrapper"
|
|
4387
4412
|
}, [ tags?.value.length ? createVNode("span", {
|
|
4388
|
-
class: ns$
|
|
4413
|
+
class: ns$8.em("input-table", "value")
|
|
4389
4414
|
}, [ tags.value.map(((tag, index) => createVNode(ElTag, {
|
|
4390
4415
|
closable: !_disabled,
|
|
4391
4416
|
onClose: () => _onCloseTag(0, index)
|
|
4392
4417
|
}, {
|
|
4393
4418
|
default: () => [ tag.label ]
|
|
4394
4419
|
}))), tagsMore?.value?.length ? createVNode(ElTooltip, {
|
|
4395
|
-
"popper-class": ns$
|
|
4420
|
+
"popper-class": ns$8.e("tooltip-tags"),
|
|
4396
4421
|
placement: "bottom",
|
|
4397
4422
|
effect: "light"
|
|
4398
4423
|
}, {
|
|
@@ -4406,10 +4431,10 @@ const ns$7 = useNamespace("form"), InputTableSelect = defineComponent({
|
|
|
4406
4431
|
default: () => [ tag.label ]
|
|
4407
4432
|
})))
|
|
4408
4433
|
}) : null ]) : createVNode("span", {
|
|
4409
|
-
class: ns$
|
|
4434
|
+
class: ns$8.em("input-table", "placeholder")
|
|
4410
4435
|
}, [ _placeholder ]) ]), createVNode(ElButton, {
|
|
4411
4436
|
type: "primary",
|
|
4412
|
-
class: ns$
|
|
4437
|
+
class: ns$8.em("input-table", "append"),
|
|
4413
4438
|
disabled: _disabled,
|
|
4414
4439
|
icon: search_default,
|
|
4415
4440
|
onClick: onClickTableDialog
|
|
@@ -4423,7 +4448,7 @@ const ns$7 = useNamespace("form"), InputTableSelect = defineComponent({
|
|
|
4423
4448
|
onClose: onCloseTableDialog
|
|
4424
4449
|
}, {
|
|
4425
4450
|
default: () => [ createVNode("div", {
|
|
4426
|
-
class: ns$
|
|
4451
|
+
class: ns$8.em("input-table", "content")
|
|
4427
4452
|
}, [ createVNode(ElRadioGroup, {
|
|
4428
4453
|
modelValue: sinleSelection.value
|
|
4429
4454
|
}, {
|
|
@@ -4446,7 +4471,7 @@ const ns$7 = useNamespace("form"), InputTableSelect = defineComponent({
|
|
|
4446
4471
|
}) ]
|
|
4447
4472
|
}) ]
|
|
4448
4473
|
}) ]), createVNode("div", {
|
|
4449
|
-
class: ns$
|
|
4474
|
+
class: ns$8.em("input-table", "footer")
|
|
4450
4475
|
}, [ createVNode(ElButton, {
|
|
4451
4476
|
onClick: onResetTableSelect
|
|
4452
4477
|
}, _isSlot$3(_slot = t("next.form.reset")) ? _slot : {
|
|
@@ -4462,7 +4487,7 @@ const ns$7 = useNamespace("form"), InputTableSelect = defineComponent({
|
|
|
4462
4487
|
};
|
|
4463
4488
|
return () => createVNode(Fragment, null, [ renderContent() ]);
|
|
4464
4489
|
}
|
|
4465
|
-
}), ns$
|
|
4490
|
+
}), ns$7 = useNamespace("form");
|
|
4466
4491
|
|
|
4467
4492
|
var UploadImage = defineComponent({
|
|
4468
4493
|
name: "UploadImage",
|
|
@@ -4488,12 +4513,20 @@ var UploadImage = defineComponent({
|
|
|
4488
4513
|
values: [ "text", "picture", "picture-card" ],
|
|
4489
4514
|
default: "picture-card"
|
|
4490
4515
|
},
|
|
4516
|
+
multiple: {
|
|
4517
|
+
type: Boolean,
|
|
4518
|
+
default: !1
|
|
4519
|
+
},
|
|
4520
|
+
limit: {
|
|
4521
|
+
type: Number,
|
|
4522
|
+
default: 1
|
|
4523
|
+
},
|
|
4491
4524
|
accept: {
|
|
4492
4525
|
type: String,
|
|
4493
4526
|
default: "image/*"
|
|
4494
4527
|
}
|
|
4495
4528
|
},
|
|
4496
|
-
emits: [ "change" ],
|
|
4529
|
+
emits: [ "change", "exceed" ],
|
|
4497
4530
|
setup(props) {
|
|
4498
4531
|
const {appContext: appContext} = getCurrentInstance(), {t: t} = useLocale();
|
|
4499
4532
|
return {
|
|
@@ -4511,7 +4544,7 @@ var UploadImage = defineComponent({
|
|
|
4511
4544
|
let urls = [];
|
|
4512
4545
|
return "string" == typeof value ? urls = [ value ] : "[object Array]" === Object.prototype.toString.call(value) && (urls = value),
|
|
4513
4546
|
urls = urls.filter((url => !!url)), urls.length ? createVNode(ElImage, {
|
|
4514
|
-
class: ns$
|
|
4547
|
+
class: ns$7.e("preview-image"),
|
|
4515
4548
|
src: urls[0],
|
|
4516
4549
|
previewSrcList: urls,
|
|
4517
4550
|
"preview-teleported": !0,
|
|
@@ -4526,9 +4559,11 @@ var UploadImage = defineComponent({
|
|
|
4526
4559
|
})
|
|
4527
4560
|
}) : null;
|
|
4528
4561
|
})(), _disabled ? null : createVNode(ElUpload, {
|
|
4529
|
-
class: [ ns$
|
|
4562
|
+
class: [ ns$7.b("upload-image"), props.className ],
|
|
4530
4563
|
style: props.style,
|
|
4531
4564
|
"list-type": props.listType,
|
|
4565
|
+
multiple: props.multiple,
|
|
4566
|
+
limit: props.limit,
|
|
4532
4567
|
"auto-upload": !1,
|
|
4533
4568
|
"on-preview": uploadFile => {
|
|
4534
4569
|
const body = document.getElementsByTagName("body")[0], initial = uploadfilesPreview.value.findIndex((file => file.url === uploadFile.url)) || 0;
|
|
@@ -4547,8 +4582,14 @@ var UploadImage = defineComponent({
|
|
|
4547
4582
|
});
|
|
4548
4583
|
previewImagesContainer.appContext = this.appContext, render(previewComponent, previewImagesContainer);
|
|
4549
4584
|
},
|
|
4550
|
-
|
|
4585
|
+
"on-change": (uploadfile, uploadfiles) => {
|
|
4551
4586
|
uploadfilesPreview.value = uploadfiles, emit("change", uploadfile, uploadfiles);
|
|
4587
|
+
},
|
|
4588
|
+
"on-exceed": (uploadfile, uploadfiles) => {
|
|
4589
|
+
ElMessage({
|
|
4590
|
+
type: "info",
|
|
4591
|
+
message: _t("next.table.uploadfileExceed")
|
|
4592
|
+
}), emit("exceed", uploadfile, uploadfiles);
|
|
4552
4593
|
}
|
|
4553
4594
|
}, {
|
|
4554
4595
|
trigger: () => slots.default ? slots.default() : "picture-card" === props.listType ? createVNode(ElIcon, null, {
|
|
@@ -4652,7 +4693,11 @@ var UploadImage = defineComponent({
|
|
|
4652
4693
|
}
|
|
4653
4694
|
});
|
|
4654
4695
|
|
|
4655
|
-
|
|
4696
|
+
function _isSlot$2(s) {
|
|
4697
|
+
return "function" == typeof s || "[object Object]" === Object.prototype.toString.call(s) && !isVNode(s);
|
|
4698
|
+
}
|
|
4699
|
+
|
|
4700
|
+
const ns$6 = useNamespace("form");
|
|
4656
4701
|
|
|
4657
4702
|
var Element$6 = defineComponent({
|
|
4658
4703
|
name: "NextForm",
|
|
@@ -4672,7 +4717,7 @@ var Element$6 = defineComponent({
|
|
|
4672
4717
|
},
|
|
4673
4718
|
emits: [ "submit", "close", "reset" ],
|
|
4674
4719
|
setup(props, {slots: slots, emit: emit, expose: expose}) {
|
|
4675
|
-
const _config = deepClone(defaultConfig$
|
|
4720
|
+
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({});
|
|
4676
4721
|
watch((() => [ props.columns, props.formDatum ]), (() => {
|
|
4677
4722
|
(() => {
|
|
4678
4723
|
const columns = props.columns;
|
|
@@ -4695,17 +4740,17 @@ var Element$6 = defineComponent({
|
|
|
4695
4740
|
deep: !0,
|
|
4696
4741
|
immediate: !0
|
|
4697
4742
|
});
|
|
4698
|
-
const formColumns = arrayObjNoRepeat(_formColumns.value, "prop");
|
|
4743
|
+
const formColumns = arrayObjNoRepeat(_formColumns.value, "prop"), spanResizeLoading = ref(!1);
|
|
4699
4744
|
onMounted((() => {
|
|
4700
4745
|
const formEl = ruleFormRef.value?.$el;
|
|
4701
4746
|
let timer = null;
|
|
4702
4747
|
elementResize(formEl, (el => {
|
|
4703
|
-
null !== timer
|
|
4748
|
+
null !== timer ? clearTimeout(timer) : spanResizeLoading.value = !0, timer = setTimeout((() => {
|
|
4704
4749
|
colSpan.value = ((el, minWidth = 350) => {
|
|
4705
4750
|
const el_width = el.clientWidth;
|
|
4706
4751
|
let span = Math.floor(el_width / minWidth);
|
|
4707
4752
|
return span > 4 && (span = 4), Math.ceil(24 / span);
|
|
4708
|
-
})(el, options.columnMinWidth), clearTimeout(timer);
|
|
4753
|
+
})(el, options.columnMinWidth), spanResizeLoading.value = !1, clearTimeout(timer);
|
|
4709
4754
|
}), 200);
|
|
4710
4755
|
}));
|
|
4711
4756
|
}));
|
|
@@ -4996,7 +5041,10 @@ var Element$6 = defineComponent({
|
|
|
4996
5041
|
modelValue: formParams[col.prop],
|
|
4997
5042
|
"onUpdate:modelValue": $event => formParams[col.prop] = $event,
|
|
4998
5043
|
disabled: col.disabled,
|
|
4999
|
-
|
|
5044
|
+
multiple: col.multiple,
|
|
5045
|
+
limit: col.limit,
|
|
5046
|
+
onChange: (...arg) => col.onChange?.(...arg, col, formParams, formColumns),
|
|
5047
|
+
onExceed: (...arg) => col.onExceed?.(...arg, col, formParams, formColumns)
|
|
5000
5048
|
}, null) : "treeSelect" === col.type ? createVNode(treeSelect, {
|
|
5001
5049
|
modelValue: formParams[col.prop],
|
|
5002
5050
|
"onUpdate:modelValue": $event => formParams[col.prop] = $event,
|
|
@@ -5012,19 +5060,22 @@ var Element$6 = defineComponent({
|
|
|
5012
5060
|
getFormInstance: () => ruleFormRef.value,
|
|
5013
5061
|
getFormParams: () => toRaw(formParams)
|
|
5014
5062
|
});
|
|
5015
|
-
|
|
5016
|
-
let
|
|
5017
|
-
return createVNode(
|
|
5018
|
-
|
|
5019
|
-
|
|
5020
|
-
|
|
5021
|
-
|
|
5022
|
-
|
|
5023
|
-
|
|
5024
|
-
|
|
5025
|
-
|
|
5063
|
+
return () => {
|
|
5064
|
+
let _slot2;
|
|
5065
|
+
return createVNode(NextSpinLoading, {
|
|
5066
|
+
loading: spanResizeLoading.value
|
|
5067
|
+
}, _isSlot$2(_slot2 = (() => {
|
|
5068
|
+
let _slot;
|
|
5069
|
+
return createVNode(ElForm, {
|
|
5070
|
+
ref: ruleFormRef,
|
|
5071
|
+
class: ns$6.b(),
|
|
5072
|
+
inline: !1,
|
|
5073
|
+
model: formParams,
|
|
5074
|
+
size: options.size
|
|
5075
|
+
}, {
|
|
5076
|
+
default: () => [ createVNode(ElRow, {
|
|
5026
5077
|
gutter: 20
|
|
5027
|
-
}, (
|
|
5078
|
+
}, _isSlot$2(_slot = formColumns.map((column => !column.hide && createVNode(ElCol, {
|
|
5028
5079
|
span: valueExist(column.span, colSpan.value)
|
|
5029
5080
|
}, {
|
|
5030
5081
|
default: () => [ createVNode(ElFormItem, {
|
|
@@ -5037,7 +5088,7 @@ var Element$6 = defineComponent({
|
|
|
5037
5088
|
}, {
|
|
5038
5089
|
label: () => column.label ? createVNode(Fragment, null, [ createVNode(NextTextEllipsis, {
|
|
5039
5090
|
content: t(column.label),
|
|
5040
|
-
class: ns$
|
|
5091
|
+
class: ns$6.e("item-label")
|
|
5041
5092
|
}, null), column.tip ? createVNode(ElTooltip, {
|
|
5042
5093
|
effect: "dark",
|
|
5043
5094
|
content: column.tip,
|
|
@@ -5054,10 +5105,10 @@ var Element$6 = defineComponent({
|
|
|
5054
5105
|
}) : null ]) : null,
|
|
5055
5106
|
default: () => renderFormItem(column)
|
|
5056
5107
|
}) ]
|
|
5057
|
-
})))
|
|
5108
|
+
})))) ? _slot : {
|
|
5058
5109
|
default: () => [ _slot ]
|
|
5059
|
-
})
|
|
5060
|
-
class: ns$
|
|
5110
|
+
}), _isEditing.value && options.showFooter ? createVNode("div", {
|
|
5111
|
+
class: ns$6.e("footer")
|
|
5061
5112
|
}, [ createVNode(ElButton, {
|
|
5062
5113
|
type: "primary",
|
|
5063
5114
|
loading: submitLoading.value,
|
|
@@ -5068,12 +5119,12 @@ var Element$6 = defineComponent({
|
|
|
5068
5119
|
onClick: onResetForm
|
|
5069
5120
|
}, {
|
|
5070
5121
|
default: () => [ t(options.resetText) || t("next.form.reset") ]
|
|
5071
|
-
}) : null ]) : null ]
|
|
5072
|
-
|
|
5073
|
-
|
|
5122
|
+
}) : null ]) : null ]
|
|
5123
|
+
});
|
|
5124
|
+
})()) ? _slot2 : {
|
|
5125
|
+
default: () => [ _slot2 ]
|
|
5074
5126
|
});
|
|
5075
5127
|
};
|
|
5076
|
-
return () => createVNode(Fragment, null, [ renderContent() ]);
|
|
5077
5128
|
}
|
|
5078
5129
|
});
|
|
5079
5130
|
|
|
@@ -5134,18 +5185,18 @@ function _isSlot(s) {
|
|
|
5134
5185
|
return "function" == typeof s || "[object Object]" === Object.prototype.toString.call(s) && !isVNode(s);
|
|
5135
5186
|
}
|
|
5136
5187
|
|
|
5137
|
-
const ns$
|
|
5188
|
+
const ns$5 = useNamespace("crud-table");
|
|
5138
5189
|
|
|
5139
5190
|
var Element$5 = defineComponent({
|
|
5140
5191
|
name: "NextCrudTable",
|
|
5141
5192
|
props: defaultPropsConfig,
|
|
5142
5193
|
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" ],
|
|
5143
5194
|
setup(props, {emit: emit, slots: slots, expose: expose}) {
|
|
5144
|
-
const _config = deepClone(defaultConfig$
|
|
5195
|
+
const _config = deepClone(defaultConfig$3), _options = computed((() => {
|
|
5145
5196
|
const cfg = unref(props.options);
|
|
5146
5197
|
return merge$1(_config, cfg);
|
|
5147
5198
|
})), options = unref(_options);
|
|
5148
|
-
provide("options", computed((() => _options.value))), provide("ns", ns$
|
|
5199
|
+
provide("options", computed((() => _options.value))), provide("ns", ns$5);
|
|
5149
5200
|
const {t: t} = useLocale(), _columns = ref(options.columns), _searchColumns = ref([]), _formColumns = ref([]), _updateColumnsAll = ops => {
|
|
5150
5201
|
((options, cb) => {
|
|
5151
5202
|
const _columns = reactive(options.columns), _loadDicData = col => {
|
|
@@ -5180,6 +5231,7 @@ var Element$5 = defineComponent({
|
|
|
5180
5231
|
rules: valueExist(col.formRules, col.rules, null),
|
|
5181
5232
|
span: valueExist(col.formSpan, col.span, null),
|
|
5182
5233
|
multiple: valueExist(col.formMultiple, col.multiple, !1),
|
|
5234
|
+
limit: valueExist(col.formLimit, col.limit, 1),
|
|
5183
5235
|
dicData: valueExist(col.formDicData, col.dicData, []),
|
|
5184
5236
|
loadDicData: valueExist(col.formLoadDicData, col.loadDicData, null),
|
|
5185
5237
|
onChange: valueExist(col.onChangeForm, col.onChange, null),
|
|
@@ -5386,11 +5438,11 @@ var Element$5 = defineComponent({
|
|
|
5386
5438
|
});
|
|
5387
5439
|
return () => createVNode(Fragment, null, [ createVNode(Fragment, null, [ createVNode("div", {
|
|
5388
5440
|
ref: crudTableRef,
|
|
5389
|
-
class: [ ns$
|
|
5441
|
+
class: [ ns$5.b(), props.className ],
|
|
5390
5442
|
style: props.style
|
|
5391
5443
|
}, [ options.showSearchForm || options.showHeaderMenu ? createVNode("header", {
|
|
5392
5444
|
ref: headerRef,
|
|
5393
|
-
class: ns$
|
|
5445
|
+
class: ns$5.b("header")
|
|
5394
5446
|
}, [ options.showSearchForm && createVNode(HeaderSearch, {
|
|
5395
5447
|
columns: _searchColumns.value,
|
|
5396
5448
|
onZoomResize: updateTableContentHeight,
|
|
@@ -5409,7 +5461,7 @@ var Element$5 = defineComponent({
|
|
|
5409
5461
|
}, {
|
|
5410
5462
|
default: () => [ createVNode("div", {
|
|
5411
5463
|
ref: tableRef,
|
|
5412
|
-
class: ns$
|
|
5464
|
+
class: ns$5.b("content")
|
|
5413
5465
|
}, [ createVNode(ElTable, {
|
|
5414
5466
|
data: tableData.value,
|
|
5415
5467
|
height: tableContentHeight.value,
|
|
@@ -5472,7 +5524,7 @@ var Element$5 = defineComponent({
|
|
|
5472
5524
|
}) ]) ]
|
|
5473
5525
|
}), options.isPagination ? createVNode("div", {
|
|
5474
5526
|
ref: footerRef,
|
|
5475
|
-
class: ns$
|
|
5527
|
+
class: ns$5.b("footer")
|
|
5476
5528
|
}, [ createVNode(FooterPagination, {
|
|
5477
5529
|
page: props.page,
|
|
5478
5530
|
onChange: onChangePagination
|
|
@@ -5530,15 +5582,15 @@ var propsConfig = {
|
|
|
5530
5582
|
total: 0
|
|
5531
5583
|
})
|
|
5532
5584
|
}
|
|
5533
|
-
}, defaultConfig = {};
|
|
5585
|
+
}, defaultConfig$1 = {};
|
|
5534
5586
|
|
|
5535
|
-
const ns$
|
|
5587
|
+
const ns$4 = useNamespace("crud-table-virtualized");
|
|
5536
5588
|
|
|
5537
5589
|
const NextCrudTableVirtualized = withInstall(defineComponent({
|
|
5538
5590
|
name: "NextCrudTableVirtualized",
|
|
5539
5591
|
props: propsConfig,
|
|
5540
5592
|
setup(props, {emit: emit}) {
|
|
5541
|
-
const _config = deepClone(defaultConfig), _options = computed((() => {
|
|
5593
|
+
const _config = deepClone(defaultConfig$1), _options = computed((() => {
|
|
5542
5594
|
const cfg = unref(props.options);
|
|
5543
5595
|
return merge$1(_config, cfg);
|
|
5544
5596
|
})), options = unref(_options);
|
|
@@ -5553,7 +5605,7 @@ const NextCrudTableVirtualized = withInstall(defineComponent({
|
|
|
5553
5605
|
emit("close-add-edit");
|
|
5554
5606
|
};
|
|
5555
5607
|
return () => createVNode(Fragment, null, [ createVNode("div", {
|
|
5556
|
-
class: [ ns$
|
|
5608
|
+
class: [ ns$4.b(), props.className ]
|
|
5557
5609
|
}, [ createVNode(NextSpinLoading, null, null), createVNode(NextDialog, {
|
|
5558
5610
|
modelValue: addEditDialog.visible,
|
|
5559
5611
|
"onUpdate:modelValue": $event => addEditDialog.visible = $event,
|
|
@@ -5564,7 +5616,7 @@ const NextCrudTableVirtualized = withInstall(defineComponent({
|
|
|
5564
5616
|
onClose: onCloseAddEditDialog
|
|
5565
5617
|
}, null) ]) ]);
|
|
5566
5618
|
}
|
|
5567
|
-
})), NextSpinLoading = withInstall(NextSpinLoading$1), ns$
|
|
5619
|
+
})), NextSpinLoading = withInstall(NextSpinLoading$1), ns$3 = useNamespace("upload");
|
|
5568
5620
|
|
|
5569
5621
|
const NextUpload = withInstall(defineComponent({
|
|
5570
5622
|
name: "NextUpload",
|
|
@@ -5599,7 +5651,7 @@ const NextUpload = withInstall(defineComponent({
|
|
|
5599
5651
|
const slots = this.$slots, props = this.$props, emit = this.$emit, _t = this.t, uploadfilesPreview = ref([]), body = document.getElementsByTagName("body")[0];
|
|
5600
5652
|
let previewImagesContainer = null;
|
|
5601
5653
|
return createVNode(ElUpload, {
|
|
5602
|
-
class: [ ns$
|
|
5654
|
+
class: [ ns$3.b(), props.className ],
|
|
5603
5655
|
style: props.style,
|
|
5604
5656
|
"list-type": props.listType,
|
|
5605
5657
|
"auto-upload": !1,
|
|
@@ -5637,7 +5689,7 @@ const NextUpload = withInstall(defineComponent({
|
|
|
5637
5689
|
})
|
|
5638
5690
|
});
|
|
5639
5691
|
}
|
|
5640
|
-
})), ns$
|
|
5692
|
+
})), ns$2 = useNamespace("video-player");
|
|
5641
5693
|
|
|
5642
5694
|
var Element$2 = defineComponent({
|
|
5643
5695
|
name: "NextVideoPlayer",
|
|
@@ -5712,7 +5764,7 @@ var Element$2 = defineComponent({
|
|
|
5712
5764
|
if (!classNames || !classNames.length) throw new Error("模型类别不能未空!");
|
|
5713
5765
|
container.innerHTML = "", tf.loadGraphModel(modelUrl).then((model => {
|
|
5714
5766
|
const canvas = document.createElement("canvas");
|
|
5715
|
-
canvas.className = ns$
|
|
5767
|
+
canvas.className = ns$2.b("recongition"), container.appendChild(canvas);
|
|
5716
5768
|
const ctx = canvas.getContext("2d"), detect_ctx = document.createElement("canvas").getContext("2d");
|
|
5717
5769
|
video.ontimeupdate = () => {
|
|
5718
5770
|
const {videoWidth: videoWidth, videoHeight: videoHeight, offsetTop: offsetTop, offsetLeft: offsetLeft} = video;
|
|
@@ -5883,7 +5935,7 @@ var Element$2 = defineComponent({
|
|
|
5883
5935
|
});
|
|
5884
5936
|
return () => createVNode(Fragment, null, [ createVNode("div", {
|
|
5885
5937
|
ref: videoBoxRef,
|
|
5886
|
-
class: [ ns$
|
|
5938
|
+
class: [ ns$2.b(), props.className ],
|
|
5887
5939
|
style: props.style
|
|
5888
5940
|
}, null) ]);
|
|
5889
5941
|
}
|
|
@@ -5980,7 +6032,7 @@ var ContextMenuLabel = defineComponent({
|
|
|
5980
6032
|
}
|
|
5981
6033
|
}, [ createVNode("span", {
|
|
5982
6034
|
style: {
|
|
5983
|
-
"background-color": colors[index]
|
|
6035
|
+
"background-color": colors[index % colors.length]
|
|
5984
6036
|
},
|
|
5985
6037
|
class: "label-line"
|
|
5986
6038
|
}, null), createVNode("span", null, [ name ]) ]))) ]), isValueExist(activateIndex.value) ? createVNode("div", {
|
|
@@ -5996,7 +6048,11 @@ var ContextMenuLabel = defineComponent({
|
|
|
5996
6048
|
}) ]) : null ]);
|
|
5997
6049
|
return () => createVNode(Fragment, null, [ renderContent() ]);
|
|
5998
6050
|
}
|
|
5999
|
-
})
|
|
6051
|
+
});
|
|
6052
|
+
|
|
6053
|
+
const {hexToRgb: hexToRgb} = useChangeColor();
|
|
6054
|
+
|
|
6055
|
+
var DraggableRect = defineComponent({
|
|
6000
6056
|
props: {
|
|
6001
6057
|
parentEl: {
|
|
6002
6058
|
type: Object,
|
|
@@ -6005,6 +6061,10 @@ var ContextMenuLabel = defineComponent({
|
|
|
6005
6061
|
rect: {
|
|
6006
6062
|
type: Object,
|
|
6007
6063
|
default: () => ({})
|
|
6064
|
+
},
|
|
6065
|
+
color: {
|
|
6066
|
+
type: String,
|
|
6067
|
+
default: null
|
|
6008
6068
|
}
|
|
6009
6069
|
},
|
|
6010
6070
|
emits: [ "draggle-resize", "contextmenu" ],
|
|
@@ -6113,17 +6173,21 @@ var ContextMenuLabel = defineComponent({
|
|
|
6113
6173
|
};
|
|
6114
6174
|
},
|
|
6115
6175
|
render() {
|
|
6116
|
-
const _ns = inject("ns", {});
|
|
6176
|
+
const _ns = inject("ns", {}), props = this.$props;
|
|
6117
6177
|
return createVNode("div", {
|
|
6118
6178
|
class: [ _ns.b("draggable-rect") ],
|
|
6119
6179
|
style: (() => {
|
|
6120
|
-
const {startX: startX, startY: startY, rectWidth: rectWidth, rectHeight: rectHeight} = this.rect
|
|
6121
|
-
return {
|
|
6180
|
+
const {startX: startX, startY: startY, rectWidth: rectWidth, rectHeight: rectHeight} = this.rect, style = {
|
|
6122
6181
|
top: startY + "px",
|
|
6123
6182
|
left: startX + "px",
|
|
6124
6183
|
width: rectWidth + "px",
|
|
6125
6184
|
height: rectHeight + "px"
|
|
6126
|
-
};
|
|
6185
|
+
}, color = props.color;
|
|
6186
|
+
if (color) {
|
|
6187
|
+
const rgb_color = hexToRgb(color);
|
|
6188
|
+
rgb_color && (style.backgroundColor = `rgba(${rgb_color[0]},${rgb_color[1]},${rgb_color[2]}, 0.5)`);
|
|
6189
|
+
}
|
|
6190
|
+
return style;
|
|
6127
6191
|
})(),
|
|
6128
6192
|
onMousedown: this.onMousedown,
|
|
6129
6193
|
onMouseup: this.onMouseup,
|
|
@@ -6163,13 +6227,18 @@ var ContextMenuLabel = defineComponent({
|
|
|
6163
6227
|
type: Array,
|
|
6164
6228
|
default: () => []
|
|
6165
6229
|
},
|
|
6230
|
+
contextClientHeight: {
|
|
6231
|
+
type: Number,
|
|
6232
|
+
default: null
|
|
6233
|
+
},
|
|
6166
6234
|
rowInfo: {
|
|
6167
6235
|
type: Object,
|
|
6168
6236
|
default: () => ({})
|
|
6169
6237
|
}
|
|
6170
6238
|
},
|
|
6171
|
-
|
|
6172
|
-
|
|
6239
|
+
emits: [ "change" ],
|
|
6240
|
+
setup(props, {emit: emit, expose: expose}) {
|
|
6241
|
+
const ns = inject("ns", {}), _emit = inject("_emit", null), canvasMainRef = ref(), canvasBaseRef = ref(), canvasRectRef = ref(), labels = ref([]), drawBaseCanvas = ref({}), formatLabelsType = () => {
|
|
6173
6242
|
const _labels = deepClone(labels.value);
|
|
6174
6243
|
let yolo_label = [];
|
|
6175
6244
|
return {
|
|
@@ -6180,7 +6249,7 @@ var ContextMenuLabel = defineComponent({
|
|
|
6180
6249
|
})),
|
|
6181
6250
|
label_txt: yolo_label.join("\n")
|
|
6182
6251
|
};
|
|
6183
|
-
},
|
|
6252
|
+
}, loadingImage = ref(!1), renderImageLabel = rowInfo => {
|
|
6184
6253
|
labels.value = (rowInfo => rowInfo.labels ? rowInfo.labels.map((rect => {
|
|
6185
6254
|
const typeName = props.classes[rect.type];
|
|
6186
6255
|
return typeName && (rect.typeName = typeName), rect;
|
|
@@ -6188,15 +6257,26 @@ var ContextMenuLabel = defineComponent({
|
|
|
6188
6257
|
const clientHeight = canvasMainRef.value?.clientHeight, ctx = canvasBaseRef.value?.getContext("2d");
|
|
6189
6258
|
if (rowInfo?.imageSrc) {
|
|
6190
6259
|
const image = new Image;
|
|
6191
|
-
image.src = rowInfo.imageSrc, image.onload = () => {
|
|
6192
|
-
|
|
6260
|
+
image.src = rowInfo.imageSrc, loadingImage.value = !0, image.onload = () => {
|
|
6261
|
+
loadingImage.value = !1;
|
|
6262
|
+
const {width: width, height: height} = image, canvasHeight = clientHeight, scaleFactor = parseFloat((canvasHeight / height).toFixed(3)), canvasWidth = Math.ceil(width * scaleFactor);
|
|
6193
6263
|
((canvasWidth, canvasHeight) => {
|
|
6194
6264
|
canvasMainRef.value.style.width = canvasWidth + "px", canvasMainRef.value.style.height = canvasHeight + "px",
|
|
6195
6265
|
canvasBaseRef.value.width = canvasWidth, canvasBaseRef.value.height = canvasHeight,
|
|
6196
6266
|
canvasBaseRef.value.style.width = canvasWidth + "px", canvasBaseRef.value.style.height = canvasHeight + "px",
|
|
6197
6267
|
canvasRectRef.value.width = canvasWidth, canvasRectRef.value.height = canvasHeight,
|
|
6198
6268
|
canvasRectRef.value.style.width = canvasWidth + "px", canvasRectRef.value.style.height = canvasHeight + "px";
|
|
6199
|
-
})(canvasWidth, canvasHeight)
|
|
6269
|
+
})(canvasWidth, canvasHeight), labels.value = ((labels, canvasHeight) => {
|
|
6270
|
+
let scale_rects = [];
|
|
6271
|
+
for (let i = 0; i < labels.length; i++) {
|
|
6272
|
+
const rect = labels[i], scale = parseFloat((canvasHeight / rect.canvasHeight).toFixed(3));
|
|
6273
|
+
scale && (rect.startX = Math.ceil(rect.startX * scale), rect.startY = Math.ceil(rect.startY * scale),
|
|
6274
|
+
rect.rectWidth = Math.ceil(rect.rectWidth * scale), rect.rectHeight = Math.ceil(rect.rectHeight * scale),
|
|
6275
|
+
rect.canvasWidth = Math.ceil(rect.canvasWidth * scale), rect.canvasHeight = canvasHeight),
|
|
6276
|
+
scale_rects.push(rect);
|
|
6277
|
+
}
|
|
6278
|
+
return scale_rects;
|
|
6279
|
+
})(labels.value, canvasHeight);
|
|
6200
6280
|
const {updateLabels: updateLabels, addDrawRect: addDrawRect, hitCanvasLabel: hitCanvasLabel} = (options => {
|
|
6201
6281
|
const {ctx: ctx, labels: labels, image: image, canvasWidth: canvasWidth, canvasHeight: canvasHeight} = options, updateLabels = () => {
|
|
6202
6282
|
ctx.clearRect(0, 0, canvasWidth, canvasHeight), ctx.drawImage(image, 0, 0, canvasWidth, canvasHeight);
|
|
@@ -6217,15 +6297,16 @@ var ContextMenuLabel = defineComponent({
|
|
|
6217
6297
|
ctx.strokeStyle = color, ctx.strokeRect(startX, startY, rectWidth, rectHeight);
|
|
6218
6298
|
},
|
|
6219
6299
|
hitCanvasLabel: (x, y) => {
|
|
6220
|
-
let hit_rect = null, hit_index = null;
|
|
6300
|
+
let hit_rect = null, hit_index = null, color = null;
|
|
6221
6301
|
for (let i = 0; i < labels.length; i++) {
|
|
6222
|
-
const rect = labels[i], {startX: startX, startY: startY, rectWidth: rectWidth, rectHeight: rectHeight} = rect;
|
|
6302
|
+
const rect = labels[i], {type: type, startX: startX, startY: startY, rectWidth: rectWidth, rectHeight: rectHeight} = rect;
|
|
6223
6303
|
x >= startX && x <= startX + rectWidth && y >= startY && y <= startY + rectHeight && (hit_rect = rect,
|
|
6224
|
-
hit_index = i);
|
|
6304
|
+
hit_index = i, color = colors[type]);
|
|
6225
6305
|
}
|
|
6226
6306
|
return {
|
|
6227
6307
|
hit_rect: hit_rect,
|
|
6228
|
-
hit_index: hit_index
|
|
6308
|
+
hit_index: hit_index,
|
|
6309
|
+
color: color
|
|
6229
6310
|
};
|
|
6230
6311
|
}
|
|
6231
6312
|
};
|
|
@@ -6235,20 +6316,23 @@ var ContextMenuLabel = defineComponent({
|
|
|
6235
6316
|
image: image,
|
|
6236
6317
|
canvasWidth: canvasWidth,
|
|
6237
6318
|
canvasHeight: canvasHeight,
|
|
6238
|
-
labels: labels.value
|
|
6319
|
+
labels: labels.value,
|
|
6320
|
+
scaleFactor: scaleFactor
|
|
6239
6321
|
});
|
|
6240
6322
|
drawBaseCanvas.value.updateLabels = updateLabels, drawBaseCanvas.value.addDrawRect = addDrawRect,
|
|
6241
6323
|
drawBaseCanvas.value.hitCanvasLabel = hitCanvasLabel;
|
|
6242
|
-
const {clearCanvas: clearCanvas} = ((canvas, callback) => {
|
|
6324
|
+
const {clearCanvas: clearCanvas} = ((canvas, callback, keyW) => {
|
|
6243
6325
|
const canvasWidth = canvas.width, canvasHeight = canvas.height, ctx = canvas?.getContext("2d"), clearCanvas = () => {
|
|
6244
6326
|
ctx.clearRect(0, 0, canvasWidth, canvasHeight);
|
|
6245
6327
|
};
|
|
6246
6328
|
clearCanvas();
|
|
6247
6329
|
let startX, startY, endX, endY, isDrawing = !1, isRectDraw = !1, isWKeyPressed = !1;
|
|
6248
6330
|
document.addEventListener("keydown", (event => {
|
|
6249
|
-
"
|
|
6331
|
+
"KeyW" === event.code && (isWKeyPressed = !0, canvas.style.cursor = "crosshair",
|
|
6332
|
+
canvas.style.zIndex = "11", keyW && keyW());
|
|
6250
6333
|
})), document.addEventListener("keyup", (event => {
|
|
6251
|
-
"
|
|
6334
|
+
isDrawing || "KeyW" === event.code && (isWKeyPressed = !1, canvas.style.cursor = "unset",
|
|
6335
|
+
canvas.style.zIndex = "0");
|
|
6252
6336
|
})), canvas.addEventListener("mousedown", (e => {
|
|
6253
6337
|
isWKeyPressed && (isDrawing = !0, startX = e.offsetX, startY = e.offsetY);
|
|
6254
6338
|
})), canvas.addEventListener("mousemove", (e => {
|
|
@@ -6256,7 +6340,7 @@ var ContextMenuLabel = defineComponent({
|
|
|
6256
6340
|
drawRect());
|
|
6257
6341
|
})), canvas.addEventListener("mouseup", (() => {
|
|
6258
6342
|
if (!isRectDraw) return;
|
|
6259
|
-
isDrawing = !1, isWKeyPressed = !1;
|
|
6343
|
+
isDrawing = !1, isWKeyPressed = !1, canvas.style.cursor = "unset", canvas.style.zIndex = "0";
|
|
6260
6344
|
const rectWidth = Math.abs(endX - startX), rectHeight = Math.abs(endY - startY);
|
|
6261
6345
|
startX > endX && (startX = endX), startY > endY && (startY = endY), callback && callback({
|
|
6262
6346
|
startX: startX,
|
|
@@ -6281,8 +6365,12 @@ var ContextMenuLabel = defineComponent({
|
|
|
6281
6365
|
};
|
|
6282
6366
|
})(canvasRectRef.value, ((rect, {endX: endX, endY: endY}) => {
|
|
6283
6367
|
activate_add_label.value = rect, drawBaseCanvas.value.addDrawRect(rect), updateContextmenuLabelFixed(endX, endY, rect);
|
|
6368
|
+
}), (() => {
|
|
6369
|
+
onCloseDraggableRectFixed();
|
|
6284
6370
|
}));
|
|
6285
6371
|
drawBaseCanvas.value.clearCanvasRect = clearCanvas;
|
|
6372
|
+
}, image.onerror = () => {
|
|
6373
|
+
loadingImage.value = !1;
|
|
6286
6374
|
};
|
|
6287
6375
|
}
|
|
6288
6376
|
canvasBaseRef.value.addEventListener("contextmenu", (e => {
|
|
@@ -6292,9 +6380,9 @@ var ContextMenuLabel = defineComponent({
|
|
|
6292
6380
|
updateContextmenuLabelFixed(x, y, hit_rect);
|
|
6293
6381
|
}));
|
|
6294
6382
|
})), canvasBaseRef.value.addEventListener("click", (e => {
|
|
6295
|
-
const x = e.offsetX, y = e.offsetY, {hit_rect: hit_rect, hit_index: hit_index} = drawBaseCanvas.value.hitCanvasLabel(x, y);
|
|
6383
|
+
const x = e.offsetX, y = e.offsetY, {hit_rect: hit_rect, hit_index: hit_index, color: color} = drawBaseCanvas.value.hitCanvasLabel(x, y);
|
|
6296
6384
|
onCloseDraggableRectFixed(), onCloseContentmenuLabel(), hit_rect && nextTick((() => {
|
|
6297
|
-
updateDraggableRectFixed(x, y, hit_rect, hit_index);
|
|
6385
|
+
updateDraggableRectFixed(x, y, hit_rect, hit_index, color);
|
|
6298
6386
|
}));
|
|
6299
6387
|
}));
|
|
6300
6388
|
};
|
|
@@ -6305,7 +6393,13 @@ var ContextMenuLabel = defineComponent({
|
|
|
6305
6393
|
}), {
|
|
6306
6394
|
deep: !0,
|
|
6307
6395
|
immediate: !0
|
|
6308
|
-
})
|
|
6396
|
+
}), watch((() => props.contextClientHeight), (height => {
|
|
6397
|
+
if (valueExist(height)) {
|
|
6398
|
+
canvasMainRef.value.style.height = height + "px";
|
|
6399
|
+
const rowInfo = toRaw(props.rowInfo);
|
|
6400
|
+
renderImageLabel(rowInfo);
|
|
6401
|
+
}
|
|
6402
|
+
}));
|
|
6309
6403
|
}));
|
|
6310
6404
|
const contextmenuLabelFixed = ref({
|
|
6311
6405
|
show: !1,
|
|
@@ -6335,21 +6429,23 @@ var ContextMenuLabel = defineComponent({
|
|
|
6335
6429
|
width: 0,
|
|
6336
6430
|
height: 0,
|
|
6337
6431
|
activateRect: null,
|
|
6338
|
-
activateIndex: null
|
|
6339
|
-
|
|
6432
|
+
activateIndex: null,
|
|
6433
|
+
color: null
|
|
6434
|
+
}), updateDraggableRectFixed = (x, y, rect, index, color) => {
|
|
6340
6435
|
draggableRectFixed.value.show = !0, draggableRectFixed.value.top = y, draggableRectFixed.value.left = x,
|
|
6341
6436
|
draggableRectFixed.value.width = rect.rectWidth, draggableRectFixed.value.height = rect.rectHeight,
|
|
6342
|
-
draggableRectFixed.value.activateRect = rect, draggableRectFixed.value.activateIndex = index
|
|
6437
|
+
draggableRectFixed.value.activateRect = rect, draggableRectFixed.value.activateIndex = index,
|
|
6438
|
+
draggableRectFixed.value.color = color;
|
|
6343
6439
|
}, onCloseDraggableRectFixed = () => {
|
|
6344
6440
|
draggableRectFixed.value.show = !1, draggableRectFixed.value.top = 0, draggableRectFixed.value.left = 0,
|
|
6345
6441
|
draggableRectFixed.value.width = 0, draggableRectFixed.value.height = 0, draggableRectFixed.value.activateRect = null,
|
|
6346
|
-
draggableRectFixed.value.activateIndex = null;
|
|
6442
|
+
draggableRectFixed.value.activateIndex = null, draggableRectFixed.value.color = null;
|
|
6347
6443
|
}, onDraggleRectResize = rect => {
|
|
6348
6444
|
draggableRectFixed.value.activateRect = rect, drawBaseCanvas.value.updateLabels();
|
|
6349
6445
|
const i = labels.value.findIndex((o => isEqual(o, rect)));
|
|
6350
6446
|
i > -1 && labels.value.splice(i, 1, rect);
|
|
6351
6447
|
const {rects: rects, label_txt: label_txt} = formatLabelsType();
|
|
6352
|
-
_emit("change", rects, label_txt);
|
|
6448
|
+
_emit("change", rects, label_txt), emit("change", rects, label_txt);
|
|
6353
6449
|
}, onContextmenuDraggable = (e, rect) => {
|
|
6354
6450
|
e.preventDefault();
|
|
6355
6451
|
const rect_x = e.offsetX, rect_y = e.offsetY, x = rect_x + rect.startX, y = rect_y + rect.startY;
|
|
@@ -6364,40 +6460,117 @@ var ContextMenuLabel = defineComponent({
|
|
|
6364
6460
|
i > -1 ? labels.value.splice(i, 1, activate_add_label.value) : labels.value.push(activate_add_label.value),
|
|
6365
6461
|
onCloseContentmenuLabel();
|
|
6366
6462
|
const {rects: rects, label_txt: label_txt} = formatLabelsType();
|
|
6367
|
-
_emit("change", rects, label_txt);
|
|
6463
|
+
_emit("change", rects, label_txt), emit("change", rects, label_txt);
|
|
6368
6464
|
}, onDeleteLabel = rect => {
|
|
6369
6465
|
const i = labels.value.findIndex((o => isEqual(o, rect)));
|
|
6370
6466
|
labels.value.splice(i, 1), onCloseContentmenuLabel(), onCloseDraggableRectFixed(),
|
|
6371
6467
|
drawBaseCanvas.value.updateLabels();
|
|
6372
6468
|
const {rects: rects, label_txt: label_txt} = formatLabelsType();
|
|
6373
|
-
_emit("change", rects, label_txt);
|
|
6469
|
+
_emit("change", rects, label_txt), emit("change", rects, label_txt);
|
|
6374
6470
|
};
|
|
6375
|
-
|
|
6376
|
-
|
|
6377
|
-
|
|
6378
|
-
|
|
6379
|
-
|
|
6380
|
-
|
|
6381
|
-
|
|
6382
|
-
|
|
6383
|
-
|
|
6384
|
-
|
|
6385
|
-
|
|
6386
|
-
|
|
6387
|
-
|
|
6388
|
-
|
|
6389
|
-
|
|
6390
|
-
|
|
6391
|
-
|
|
6392
|
-
|
|
6393
|
-
|
|
6394
|
-
|
|
6395
|
-
|
|
6396
|
-
|
|
6471
|
+
expose({
|
|
6472
|
+
onCloseDraggableRectFixed: onCloseDraggableRectFixed,
|
|
6473
|
+
onCloseContentmenuLabel: onCloseContentmenuLabel,
|
|
6474
|
+
onSelectedLabel: (rect, index) => {
|
|
6475
|
+
onCloseDraggableRectFixed(), nextTick((() => {
|
|
6476
|
+
const {startX: x, startY: y, type: type} = rect;
|
|
6477
|
+
updateDraggableRectFixed(x, y, rect, index, colors[type]);
|
|
6478
|
+
}));
|
|
6479
|
+
},
|
|
6480
|
+
onDeleteLabel: onDeleteLabel
|
|
6481
|
+
});
|
|
6482
|
+
return () => createVNode(Fragment, null, [ createVNode(NextSpinLoading, {
|
|
6483
|
+
loading: loadingImage.value,
|
|
6484
|
+
class: [ ns.b("loading") ]
|
|
6485
|
+
}, {
|
|
6486
|
+
default: () => [ createVNode("div", {
|
|
6487
|
+
ref: canvasMainRef,
|
|
6488
|
+
class: [ ns.b("canvas") ]
|
|
6489
|
+
}, [ createVNode("canvas", {
|
|
6490
|
+
ref: canvasBaseRef,
|
|
6491
|
+
class: [ ns.be("canvas", "context") ]
|
|
6492
|
+
}, null), createVNode("canvas", {
|
|
6493
|
+
ref: canvasRectRef,
|
|
6494
|
+
class: [ ns.be("canvas", "rect") ]
|
|
6495
|
+
}, null), contextmenuLabelFixed.value.show ? createVNode(ContextMenuLabel, {
|
|
6496
|
+
labelRect: contextmenuLabelRect.value,
|
|
6497
|
+
classes: props.classes,
|
|
6498
|
+
activateRect: contextmenuLabelFixed.value.activateRect,
|
|
6499
|
+
onClose: onCloseContentmenuLabel,
|
|
6500
|
+
onSelect: onSelectLabel,
|
|
6501
|
+
onDelete: onDeleteLabel
|
|
6502
|
+
}, null) : null, draggableRectFixed.value.show ? createVNode(DraggableRect, {
|
|
6503
|
+
parentEl: canvasMainRef.value,
|
|
6504
|
+
rect: draggableRectFixed.value.activateRect,
|
|
6505
|
+
color: draggableRectFixed.value.color,
|
|
6506
|
+
onDraggleResize: onDraggleRectResize,
|
|
6507
|
+
onContextmenu: onContextmenuDraggable
|
|
6508
|
+
}, null) : null ]) ]
|
|
6509
|
+
}) ]);
|
|
6397
6510
|
}
|
|
6398
|
-
})
|
|
6511
|
+
}), RightLabel = defineComponent({
|
|
6512
|
+
props: {
|
|
6513
|
+
classes: {
|
|
6514
|
+
type: Array,
|
|
6515
|
+
default: () => []
|
|
6516
|
+
},
|
|
6517
|
+
labels: {
|
|
6518
|
+
type: Array,
|
|
6519
|
+
default: () => []
|
|
6520
|
+
}
|
|
6521
|
+
},
|
|
6522
|
+
emits: [ "delete", "select" ],
|
|
6523
|
+
setup(props, {emit: emit}) {
|
|
6524
|
+
const {t: t} = useLocale(), ns = inject("ns", {}), labels = ref([]);
|
|
6525
|
+
watch((() => props.labels), (rects => {
|
|
6526
|
+
const _rects = toRaw(rects);
|
|
6527
|
+
labels.value = (labels => labels.length ? labels.map((rect => {
|
|
6528
|
+
const typeName = props.classes[rect.type];
|
|
6529
|
+
return typeName && (rect.typeName = typeName), rect;
|
|
6530
|
+
})) : [])(_rects);
|
|
6531
|
+
}), {
|
|
6532
|
+
deep: !0,
|
|
6533
|
+
immediate: !0
|
|
6534
|
+
});
|
|
6535
|
+
const renderContent = () => createVNode("div", {
|
|
6536
|
+
class: [ ns.b("right") ]
|
|
6537
|
+
}, [ labels.value.length ? createVNode("ul", null, [ labels.value.map(((rect, index) => createVNode("li", {
|
|
6538
|
+
key: index,
|
|
6539
|
+
onClick: () => ((rect, index) => {
|
|
6540
|
+
emit("select", rect, index);
|
|
6541
|
+
})(rect, index)
|
|
6542
|
+
}, [ createVNode("div", null, [ createVNode("span", {
|
|
6543
|
+
style: {
|
|
6544
|
+
"background-color": colors[rect.type]
|
|
6545
|
+
},
|
|
6546
|
+
class: "label-line"
|
|
6547
|
+
}, null), createVNode("span", null, [ rect.typeName ]) ]), createVNode(ElPopconfirm, {
|
|
6548
|
+
title: t("next.labelimg.confirmDeleteLabel"),
|
|
6549
|
+
width: 180,
|
|
6550
|
+
onConfirm: () => (rect => {
|
|
6551
|
+
emit("delete", rect);
|
|
6552
|
+
})(rect)
|
|
6553
|
+
}, {
|
|
6554
|
+
reference: () => createVNode(ElIcon, {
|
|
6555
|
+
size: 16,
|
|
6556
|
+
color: "#ff0000",
|
|
6557
|
+
onClick: event => {
|
|
6558
|
+
event.preventDefault(), event.stopPropagation();
|
|
6559
|
+
}
|
|
6560
|
+
}, {
|
|
6561
|
+
default: () => [ createVNode(delete_default, null, null) ]
|
|
6562
|
+
})
|
|
6563
|
+
}) ]))) ]) : createVNode(ElEmpty, {
|
|
6564
|
+
"image-size": 120,
|
|
6565
|
+
description: t("next.labelimg.emptyLabelText")
|
|
6566
|
+
}, null) ]);
|
|
6567
|
+
return () => createVNode(Fragment, null, [ renderContent() ]);
|
|
6568
|
+
}
|
|
6569
|
+
}), defaultConfig = {
|
|
6570
|
+
mainContentHeight: 600
|
|
6571
|
+
};
|
|
6399
6572
|
|
|
6400
|
-
const ns = useNamespace("labelimg");
|
|
6573
|
+
const ns$1 = useNamespace("labelimg");
|
|
6401
6574
|
|
|
6402
6575
|
var Element = defineComponent({
|
|
6403
6576
|
name: "NextLabelimg",
|
|
@@ -6408,25 +6581,58 @@ var Element = defineComponent({
|
|
|
6408
6581
|
},
|
|
6409
6582
|
style: {
|
|
6410
6583
|
type: Object,
|
|
6411
|
-
default: () => ({
|
|
6584
|
+
default: () => ({
|
|
6585
|
+
position: "unset"
|
|
6586
|
+
})
|
|
6587
|
+
},
|
|
6588
|
+
rowKey: {
|
|
6589
|
+
type: String,
|
|
6590
|
+
default: "id"
|
|
6412
6591
|
},
|
|
6413
6592
|
options: {
|
|
6414
6593
|
type: Object,
|
|
6415
|
-
default: () => ({
|
|
6416
|
-
|
|
6417
|
-
|
|
6418
|
-
|
|
6594
|
+
default: () => ({})
|
|
6595
|
+
},
|
|
6596
|
+
classes: {
|
|
6597
|
+
type: Array,
|
|
6598
|
+
default: () => []
|
|
6599
|
+
},
|
|
6600
|
+
data: {
|
|
6601
|
+
type: Array,
|
|
6602
|
+
default: () => []
|
|
6419
6603
|
}
|
|
6420
6604
|
},
|
|
6421
6605
|
emits: [ "change", "save", "prev-click", "next-click" ],
|
|
6422
6606
|
setup(props, {emit: emit, slots: slots, expose: expose}) {
|
|
6423
|
-
const {t: t} = useLocale()
|
|
6424
|
-
|
|
6425
|
-
|
|
6426
|
-
|
|
6427
|
-
|
|
6428
|
-
|
|
6429
|
-
|
|
6607
|
+
const {t: t} = useLocale(), _config = deepClone(defaultConfig), _options = computed((() => {
|
|
6608
|
+
const cfg = unref(props.options);
|
|
6609
|
+
return merge$1(_config, cfg);
|
|
6610
|
+
})), options = unref(_options);
|
|
6611
|
+
provide("ns", ns$1), provide("_emit", emit);
|
|
6612
|
+
const activateNodeIndex = ref(0), classes = ref(props.classes), labelImages = ref(deepClone(props.data));
|
|
6613
|
+
watch((() => props.data), (data => {
|
|
6614
|
+
labelImages.value = deepClone(data);
|
|
6615
|
+
}), {
|
|
6616
|
+
deep: !0
|
|
6617
|
+
}), watch((() => props.data.length), (() => {
|
|
6618
|
+
activateNodeIndex.value = 0;
|
|
6619
|
+
})), watch((() => props.classes), (val => {
|
|
6620
|
+
classes.value = val;
|
|
6621
|
+
}), {
|
|
6622
|
+
deep: !0
|
|
6623
|
+
});
|
|
6624
|
+
const currentNode = computed((() => {
|
|
6625
|
+
if (!labelImages.value) return {};
|
|
6626
|
+
const node = labelImages.value[activateNodeIndex.value] || {};
|
|
6627
|
+
return deepClone(node);
|
|
6628
|
+
})), activateNodeLabels = ref(currentNode.value.labels || []);
|
|
6629
|
+
watch((() => currentNode.value), (() => {
|
|
6630
|
+
activateNodeLabels.value = currentNode.value.labels || [];
|
|
6631
|
+
}));
|
|
6632
|
+
const onChangeNodeRect = rects => {
|
|
6633
|
+
currentNode.value.labels = rects, activateNodeLabels.value = rects;
|
|
6634
|
+
}, loading = ref(!1), formatNodeLabels = () => {
|
|
6635
|
+
const node = currentNode.value;
|
|
6430
6636
|
let yolo_label = [];
|
|
6431
6637
|
return node.labels.forEach((rect => {
|
|
6432
6638
|
delete rect.typeName;
|
|
@@ -6436,89 +6642,123 @@ var Element = defineComponent({
|
|
|
6436
6642
|
node: node,
|
|
6437
6643
|
label_txt: yolo_label.join("\n")
|
|
6438
6644
|
};
|
|
6645
|
+
}, isChangeNodeLabels = () => isEqual(labelImages.value[activateNodeIndex.value].labels, currentNode.value.labels), switchKeydownAD = e => {
|
|
6646
|
+
const imageLength = labelImages.value.length;
|
|
6647
|
+
"KeyD" === e.code ? (activateNodeIndex.value++, activateNodeIndex.value >= imageLength && (activateNodeIndex.value = 0)) : "KeyA" === e.code && (activateNodeIndex.value--,
|
|
6648
|
+
activateNodeIndex.value < 0 && (activateNodeIndex.value = imageLength - 1));
|
|
6439
6649
|
}, onKeydownPrevNext = e => {
|
|
6440
6650
|
if (loading.value) return;
|
|
6441
6651
|
if (![ "KeyA", "KeyD" ].includes(e.code)) return;
|
|
6442
6652
|
loading.value = !0;
|
|
6443
6653
|
const {node: node, label_txt: label_txt} = formatNodeLabels();
|
|
6654
|
+
if (canvasContextRef.value.onCloseDraggableRectFixed(), isChangeNodeLabels()) return switchKeydownAD(e),
|
|
6655
|
+
void (loading.value = !1);
|
|
6444
6656
|
emit("save", {
|
|
6445
6657
|
node: node,
|
|
6446
6658
|
label_txt: label_txt
|
|
6447
|
-
}, (
|
|
6448
|
-
|
|
6449
|
-
|
|
6659
|
+
}, (imageItem => {
|
|
6660
|
+
labelImages.value[activateNodeIndex.value] = imageItem || node, switchKeydownAD(e),
|
|
6661
|
+
loading.value = !1;
|
|
6662
|
+
}), (() => {
|
|
6663
|
+
loading.value = !1;
|
|
6664
|
+
}));
|
|
6665
|
+
}, onChangeActivateNode = index => {
|
|
6666
|
+
if (loading.value) return;
|
|
6667
|
+
loading.value = !0;
|
|
6668
|
+
const {node: node, label_txt: label_txt} = formatNodeLabels();
|
|
6669
|
+
if (canvasContextRef.value.onCloseDraggableRectFixed(), isChangeNodeLabels()) return activateNodeIndex.value = index,
|
|
6670
|
+
void (loading.value = !1);
|
|
6671
|
+
emit("save", {
|
|
6672
|
+
node: node,
|
|
6673
|
+
label_txt: label_txt
|
|
6674
|
+
}, (imageItem => {
|
|
6675
|
+
labelImages.value[activateNodeIndex.value] = imageItem || node, activateNodeIndex.value = index,
|
|
6676
|
+
loading.value = !1;
|
|
6450
6677
|
}), (() => {
|
|
6451
6678
|
loading.value = !1;
|
|
6452
6679
|
}));
|
|
6453
6680
|
}, onPaginationPrev = () => {
|
|
6454
|
-
|
|
6681
|
+
const imageLength = labelImages.value.length;
|
|
6682
|
+
let i = activateNodeIndex.value - 1;
|
|
6683
|
+
i < 0 && (i = imageLength - 1), onChangeActivateNode(i), emit("prev-click");
|
|
6455
6684
|
}, onPaginationNext = () => {
|
|
6456
|
-
|
|
6457
|
-
|
|
6685
|
+
const imageLength = labelImages.value.length;
|
|
6686
|
+
let i = activateNodeIndex.value + 1;
|
|
6687
|
+
i >= imageLength && (i = 0), onChangeActivateNode(i), emit("next-click");
|
|
6688
|
+
}, canvasContextRef = ref(), layoutLabelRef = ref(), headerRef = ref(), mainRef = ref(), footerRef = ref(), mainContentHeight = ref(options.mainContentHeight);
|
|
6458
6689
|
onMounted((() => {
|
|
6459
|
-
document.addEventListener("keydown", onKeydownPrevNext), elementResize(
|
|
6690
|
+
document.addEventListener("keydown", onKeydownPrevNext), elementResize(layoutLabelRef.value, (() => {
|
|
6460
6691
|
nextTick((() => {
|
|
6461
|
-
|
|
6692
|
+
layoutLabelRef.value.style.position = "unset";
|
|
6693
|
+
const contentHeight = (layoutLabelRef.value?.clientHeight || 0) - ((headerRef.value?.clientHeight || 0) + (footerRef.value?.clientHeight || 0));
|
|
6462
6694
|
mainContentHeight.value = contentHeight;
|
|
6463
6695
|
}));
|
|
6464
6696
|
}));
|
|
6465
6697
|
})), onUnmounted((() => {
|
|
6466
6698
|
document.removeEventListener("keydown", onKeydownPrevNext);
|
|
6467
|
-
}))
|
|
6699
|
+
}));
|
|
6700
|
+
const onSelectLabelNode = (rect, index) => {
|
|
6701
|
+
canvasContextRef.value.onSelectedLabel(rect, index);
|
|
6702
|
+
}, onDeleteLabelNode = rect => {
|
|
6703
|
+
canvasContextRef.value.onDeleteLabel(rect);
|
|
6704
|
+
};
|
|
6705
|
+
expose({
|
|
6468
6706
|
convertToLabel: convertToLabel,
|
|
6469
6707
|
canvertToCanvas: canvertToCanvas
|
|
6470
6708
|
});
|
|
6471
|
-
|
|
6472
|
-
ref:
|
|
6473
|
-
class: [ ns.b(), props.className ],
|
|
6709
|
+
return () => createVNode(Fragment, null, [ createVNode("div", {
|
|
6710
|
+
ref: layoutLabelRef,
|
|
6711
|
+
class: [ ns$1.b(), props.className ],
|
|
6474
6712
|
style: {
|
|
6475
6713
|
...props.style
|
|
6476
6714
|
}
|
|
6477
6715
|
}, [ createVNode(NextSpinLoading$1, {
|
|
6478
6716
|
loading: loading.value,
|
|
6479
6717
|
tip: t("next.labelimg.saveTxt"),
|
|
6480
|
-
class: [ ns.b("loading") ]
|
|
6718
|
+
class: [ ns$1.b("loading") ]
|
|
6481
6719
|
}, {
|
|
6482
6720
|
default: () => [ createVNode(ElScrollbar, null, {
|
|
6483
6721
|
default: () => [ createVNode("header", {
|
|
6484
6722
|
ref: headerRef,
|
|
6485
|
-
class: [ ns.b("header") ]
|
|
6723
|
+
class: [ ns$1.b("header") ]
|
|
6486
6724
|
}, [ slots.header ? slots.header() : createVNode(Fragment, null, [ createVNode("ul", null, null), createVNode("ul", null, null) ]) ]), createVNode("div", {
|
|
6487
6725
|
ref: mainRef,
|
|
6488
|
-
class: [ ns.b("main") ]
|
|
6726
|
+
class: [ ns$1.b("main") ],
|
|
6727
|
+
style: {
|
|
6728
|
+
height: mainContentHeight.value + "px"
|
|
6729
|
+
}
|
|
6730
|
+
}, [ createVNode("div", {
|
|
6731
|
+
class: [ ns$1.be("main", "content") ]
|
|
6489
6732
|
}, [ createVNode(CanvasContext, {
|
|
6490
|
-
|
|
6491
|
-
|
|
6733
|
+
ref: canvasContextRef,
|
|
6734
|
+
contextClientHeight: mainContentHeight.value,
|
|
6735
|
+
classes: classes.value,
|
|
6736
|
+
rowInfo: currentNode.value,
|
|
6737
|
+
onChange: onChangeNodeRect
|
|
6738
|
+
}, null) ]), createVNode(RightLabel, {
|
|
6739
|
+
classes: classes.value,
|
|
6740
|
+
labels: activateNodeLabels.value,
|
|
6741
|
+
onDelete: onDeleteLabelNode,
|
|
6742
|
+
onSelect: onSelectLabelNode
|
|
6492
6743
|
}, null) ]), createVNode("footer", {
|
|
6493
6744
|
ref: footerRef,
|
|
6494
|
-
class: [ ns.b("footer") ]
|
|
6745
|
+
class: [ ns$1.b("footer") ]
|
|
6495
6746
|
}, [ createVNode("div", {
|
|
6496
|
-
class: [ ns.be("footer", "left") ]
|
|
6747
|
+
class: [ ns$1.be("footer", "left") ]
|
|
6497
6748
|
}, [ createVNode(ElIcon, {
|
|
6498
6749
|
size: 24,
|
|
6750
|
+
color: "#797979",
|
|
6499
6751
|
onClick: onPaginationPrev
|
|
6500
6752
|
}, {
|
|
6501
6753
|
default: () => [ createVNode(arrow_left_default, null, null) ]
|
|
6502
6754
|
}) ]), createVNode("div", {
|
|
6503
|
-
class: [ ns.be("footer", "center") ]
|
|
6755
|
+
class: [ ns$1.be("footer", "center") ]
|
|
6504
6756
|
}, [ createVNode(ElScrollbar, null, {
|
|
6505
6757
|
default: () => [ createVNode("ul", {
|
|
6506
|
-
class: [ ns.bem("footer", "center", "list") ]
|
|
6507
|
-
}, [
|
|
6758
|
+
class: [ ns$1.bem("footer", "center", "list") ]
|
|
6759
|
+
}, [ labelImages.value.map(((item, index) => createVNode("li", {
|
|
6508
6760
|
key: index,
|
|
6509
|
-
onClick: () => (index
|
|
6510
|
-
if (loading.value) return;
|
|
6511
|
-
loading.value = !0;
|
|
6512
|
-
const {node: node, label_txt: label_txt} = formatNodeLabels();
|
|
6513
|
-
emit("save", {
|
|
6514
|
-
node: node,
|
|
6515
|
-
label_txt: label_txt
|
|
6516
|
-
}, (() => {
|
|
6517
|
-
activateNodeIndex.value = index, loading.value = !1;
|
|
6518
|
-
}), (() => {
|
|
6519
|
-
loading.value = !1;
|
|
6520
|
-
}));
|
|
6521
|
-
})(index),
|
|
6761
|
+
onClick: () => onChangeActivateNode(index),
|
|
6522
6762
|
class: {
|
|
6523
6763
|
"is-activate": activateNodeIndex.value === index
|
|
6524
6764
|
}
|
|
@@ -6531,20 +6771,90 @@ var Element = defineComponent({
|
|
|
6531
6771
|
fit: "cover"
|
|
6532
6772
|
}, null) ]))) ]) ]
|
|
6533
6773
|
}) ]), createVNode("div", {
|
|
6534
|
-
class: [ ns.be("footer", "right") ]
|
|
6774
|
+
class: [ ns$1.be("footer", "right") ]
|
|
6535
6775
|
}, [ createVNode(ElIcon, {
|
|
6536
6776
|
size: 24,
|
|
6777
|
+
color: "#797979",
|
|
6537
6778
|
onClick: onPaginationNext
|
|
6538
6779
|
}, {
|
|
6539
6780
|
default: () => [ createVNode(arrow_right_default, null, null) ]
|
|
6540
6781
|
}) ]) ]) ]
|
|
6541
6782
|
}) ]
|
|
6542
|
-
}) ]);
|
|
6543
|
-
|
|
6783
|
+
}) ]) ]);
|
|
6784
|
+
}
|
|
6785
|
+
});
|
|
6786
|
+
|
|
6787
|
+
const ns = useNamespace("labelimg-preview");
|
|
6788
|
+
|
|
6789
|
+
var preview = defineComponent({
|
|
6790
|
+
name: "NextLabelimgPreview",
|
|
6791
|
+
props: {
|
|
6792
|
+
className: {
|
|
6793
|
+
type: String,
|
|
6794
|
+
default: ""
|
|
6795
|
+
},
|
|
6796
|
+
style: {
|
|
6797
|
+
type: Object,
|
|
6798
|
+
default: () => ({})
|
|
6799
|
+
},
|
|
6800
|
+
src: {
|
|
6801
|
+
type: String,
|
|
6802
|
+
default: ""
|
|
6803
|
+
},
|
|
6804
|
+
classes: {
|
|
6805
|
+
type: Array,
|
|
6806
|
+
default: () => []
|
|
6807
|
+
},
|
|
6808
|
+
labels: {
|
|
6809
|
+
type: Array,
|
|
6810
|
+
default: () => []
|
|
6811
|
+
}
|
|
6812
|
+
},
|
|
6813
|
+
setup(props) {
|
|
6814
|
+
const canvasBaseRef = ref(), classes = ref(deepClone(props.classes)), labels = ref(deepClone(props.labels)), renderImageAndLabel = () => {
|
|
6815
|
+
if (props.src) {
|
|
6816
|
+
const ctx = canvasBaseRef.value?.getContext("2d"), image = new Image;
|
|
6817
|
+
image.src = props.src, image.onload = () => {
|
|
6818
|
+
const {width: width, height: height} = image, canvasHeight = height, scaleFactor = canvasHeight / height, canvasWidth = Math.ceil(width * scaleFactor);
|
|
6819
|
+
((canvasWidth, canvasHeight) => {
|
|
6820
|
+
canvasBaseRef.value.width = canvasWidth, canvasBaseRef.value.height = canvasHeight,
|
|
6821
|
+
canvasBaseRef.value.style.width = canvasWidth + "px", canvasBaseRef.value.style.height = canvasHeight + "px";
|
|
6822
|
+
})(canvasWidth, canvasHeight), ctx.clearRect(0, 0, canvasWidth, canvasHeight), ctx.drawImage(image, 0, 0, canvasWidth, canvasHeight);
|
|
6823
|
+
for (let i = 0; i < labels.value.length; i++) {
|
|
6824
|
+
const rect = labels.value[i], {startX: startX, startY: startY, rectWidth: rectWidth, rectHeight: rectHeight, type: type} = rect, color = colors[type % colors.length];
|
|
6825
|
+
if (ctx.font = "bold 14px serif", ctx.textBaseline = "top", ctx.save(), ctx.strokeStyle = color,
|
|
6826
|
+
ctx.strokeRect(startX, startY, rectWidth, rectHeight), !isValueExist(rect.typeName)) {
|
|
6827
|
+
const typeName = classes.value[rect.type];
|
|
6828
|
+
typeName && (rect.typeName = typeName);
|
|
6829
|
+
}
|
|
6830
|
+
if (isValueExist(rect.typeName) || isValueExist(rect.type)) {
|
|
6831
|
+
const text = rect.typeName || rect.type;
|
|
6832
|
+
ctx.fillStyle = color, ctx.fillText(text, startX + 6, startY + 6);
|
|
6833
|
+
}
|
|
6834
|
+
ctx.restore();
|
|
6835
|
+
}
|
|
6836
|
+
};
|
|
6837
|
+
}
|
|
6838
|
+
};
|
|
6839
|
+
onMounted((() => {
|
|
6840
|
+
watch((() => props.src), (() => {
|
|
6841
|
+
renderImageAndLabel();
|
|
6842
|
+
}), {
|
|
6843
|
+
immediate: !0
|
|
6844
|
+
});
|
|
6845
|
+
}));
|
|
6846
|
+
return () => createVNode(Fragment, null, [ createVNode("div", {
|
|
6847
|
+
class: [ ns.b(), props.className ],
|
|
6848
|
+
style: {
|
|
6849
|
+
...props.style
|
|
6850
|
+
}
|
|
6851
|
+
}, [ createVNode("canvas", {
|
|
6852
|
+
ref: canvasBaseRef
|
|
6853
|
+
}, null) ]) ]);
|
|
6544
6854
|
}
|
|
6545
6855
|
});
|
|
6546
6856
|
|
|
6547
|
-
const NextLabelimg = withInstall(Element);
|
|
6857
|
+
const NextLabelimg = withInstall(Element), NextLabelimgPreview = withInstall(preview);
|
|
6548
6858
|
|
|
6549
6859
|
var components = Object.freeze({
|
|
6550
6860
|
__proto__: null,
|
|
@@ -6555,6 +6865,7 @@ var components = Object.freeze({
|
|
|
6555
6865
|
NextDragResize: NextDragResize,
|
|
6556
6866
|
NextForm: NextForm,
|
|
6557
6867
|
NextLabelimg: NextLabelimg,
|
|
6868
|
+
NextLabelimgPreview: NextLabelimgPreview,
|
|
6558
6869
|
NextLayout: NextLayout,
|
|
6559
6870
|
NextMenu: NextMenu,
|
|
6560
6871
|
NextSpinLoading: NextSpinLoading,
|
|
@@ -6597,7 +6908,7 @@ const zoomDialog = app => {
|
|
|
6597
6908
|
}));
|
|
6598
6909
|
}
|
|
6599
6910
|
});
|
|
6600
|
-
}, version = "0.
|
|
6911
|
+
}, version = "0.3.0", install = function(app) {
|
|
6601
6912
|
Object.keys(components).forEach((key => {
|
|
6602
6913
|
const component = components[key];
|
|
6603
6914
|
app.component(component.name, component);
|
|
@@ -6607,8 +6918,8 @@ const zoomDialog = app => {
|
|
|
6607
6918
|
};
|
|
6608
6919
|
|
|
6609
6920
|
var index = {
|
|
6610
|
-
version: "0.
|
|
6921
|
+
version: "0.3.0",
|
|
6611
6922
|
install: install
|
|
6612
6923
|
};
|
|
6613
6924
|
|
|
6614
|
-
export { NextContainer, NextCrudTable, NextCrudTableVirtualized, NextDialog, NextDragResize, NextForm, NextLabelimg, 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 };
|
|
6925
|
+
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 };
|