next-element-vue 0.2.9 → 0.3.1
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 +3 -3
- package/dist/index.js +309 -108
- package/dist/index.min.js +3 -3
- package/dist/index.umd.js +304 -106
- package/dist/index.umd.min.js +3 -3
- package/dist/packages/components/crud-table/src/config.d.ts +1 -0
- 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 +5 -9
- package/dist/packages/components/labelimg/src/config.d.ts +1 -1
- package/dist/packages/components/labelimg/src/index.d.ts +2 -6
- package/dist/packages/components/labelimg/src/widgets/right-label.d.ts +6 -0
- package/dist/packages/components/labelimg/src/widgets/tool-header.d.ts +17 -0
- package/dist/packages/components/layout/src/config.d.ts +2 -0
- package/dist/packages/components/spin-loading/index.d.ts +1 -0
- package/dist/packages/hooks/use-locale/index.d.ts +5 -0
- package/dist/packages/locale/lang/en.d.ts +4 -0
- package/dist/packages/locale/lang/zh-cn.d.ts +4 -0
- package/dist/packages/locale/lang/zh-tw.d.ts +4 -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.1 v
|
|
6
|
+
* 发布日期:2024-06-22
|
|
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, ElPopconfirm } 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, ElPopover, 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: "请输入",
|
|
@@ -891,7 +892,10 @@ var merge = createAssigner((function(object, source, srcIndex) {
|
|
|
891
892
|
labelimg: {
|
|
892
893
|
saveTxt: "保存中...",
|
|
893
894
|
emptyLabelText: "暂无标签数据",
|
|
894
|
-
confirmDeleteLabel: "确定要删除该标注吗?"
|
|
895
|
+
confirmDeleteLabel: "确定要删除该标注吗?",
|
|
896
|
+
saveLabel: "保存当前标注",
|
|
897
|
+
instructions: "使用说明",
|
|
898
|
+
labelNoUpdate: "暂无标签数据更新"
|
|
895
899
|
}
|
|
896
900
|
}
|
|
897
901
|
}, enLocale = {
|
|
@@ -928,7 +932,8 @@ var merge = createAssigner((function(object, source, srcIndex) {
|
|
|
928
932
|
cancelDelete: "Cancel delete",
|
|
929
933
|
confirmButtonText: "OK",
|
|
930
934
|
cancelButtonText: "Cancel"
|
|
931
|
-
}
|
|
935
|
+
},
|
|
936
|
+
uploadfileExceed: "The number of uploaded files exceeds the limit"
|
|
932
937
|
},
|
|
933
938
|
form: {
|
|
934
939
|
input: "please input ",
|
|
@@ -965,7 +970,10 @@ var merge = createAssigner((function(object, source, srcIndex) {
|
|
|
965
970
|
labelimg: {
|
|
966
971
|
saveTxt: "saving...",
|
|
967
972
|
emptyLabelText: "No label data",
|
|
968
|
-
confirmDeleteLabel: "Are you sure you want to delete this annotation?"
|
|
973
|
+
confirmDeleteLabel: "Are you sure you want to delete this annotation?",
|
|
974
|
+
saveLabel: "save label",
|
|
975
|
+
instructions: "instructions",
|
|
976
|
+
labelNoUpdate: "No label data update"
|
|
969
977
|
}
|
|
970
978
|
}
|
|
971
979
|
}, zhtwLocale = {
|
|
@@ -1002,7 +1010,8 @@ var merge = createAssigner((function(object, source, srcIndex) {
|
|
|
1002
1010
|
cancelDelete: "取消删除操作",
|
|
1003
1011
|
confirmButtonText: "確 定",
|
|
1004
1012
|
cancelButtonText: "取 消"
|
|
1005
|
-
}
|
|
1013
|
+
},
|
|
1014
|
+
uploadfileExceed: "上传文件数量超出限制范围"
|
|
1006
1015
|
},
|
|
1007
1016
|
form: {
|
|
1008
1017
|
input: "請輸入",
|
|
@@ -1039,7 +1048,10 @@ var merge = createAssigner((function(object, source, srcIndex) {
|
|
|
1039
1048
|
labelimg: {
|
|
1040
1049
|
saveTxt: "保存中...",
|
|
1041
1050
|
emptyLabelText: "暂无标签数据",
|
|
1042
|
-
confirmDeleteLabel: "确定要删除该标注吗?"
|
|
1051
|
+
confirmDeleteLabel: "确定要删除该标注吗?",
|
|
1052
|
+
saveLabel: "保存当前标注",
|
|
1053
|
+
instructions: "使用说明",
|
|
1054
|
+
labelNoUpdate: "暂无标签数据更新"
|
|
1043
1055
|
}
|
|
1044
1056
|
}
|
|
1045
1057
|
};
|
|
@@ -1222,13 +1234,16 @@ var defaultConfig$4 = {
|
|
|
1222
1234
|
} ],
|
|
1223
1235
|
userDropdown: [ {
|
|
1224
1236
|
value: "/",
|
|
1225
|
-
label: "next.layout.home"
|
|
1237
|
+
label: "next.layout.home",
|
|
1238
|
+
svg: '<svg t="1718695810903" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="11410" width="16" height="16"><path d="M988.672 502.272l-476.16-476.16-476.16 476.16c-8.704 8.704-8.704 22.528 0 31.232l1.536 1.536c8.704 8.704 22.528 8.704 31.232 0l443.392-443.392 443.392 443.392c8.704 8.704 22.528 8.704 31.232 0l1.536-1.536c8.704-8.704 8.704-22.528 0-31.232z" fill="" p-id="11411"></path><path d="M860.16 534.016c-12.288 0-22.016 9.728-22.016 22.016v333.312c0 54.272-27.648 64-47.104 64h-152.064v-227.84c0-25.088 0-59.392-44.544-59.392H418.816c-44.032 0-44.032 33.28-44.032 59.392v227.84h-153.6c-44.032 0-45.056-64-45.056-64v-333.312c0.512-12.288-8.704-22.528-20.992-23.04-12.288-0.512-22.528 8.704-23.04 20.992v368.64c0 65.536 70.144 75.264 70.144 75.264h217.088v-287.232h176.64v287.232H824.32c39.424 0 57.856-44.032 57.856-75.264v-366.592c0-12.288-9.728-22.016-22.016-22.016z" fill="" p-id="11412"></path></svg>'
|
|
1226
1239
|
}, {
|
|
1227
1240
|
value: "/personal",
|
|
1228
|
-
label: "next.layout.personal"
|
|
1241
|
+
label: "next.layout.personal",
|
|
1242
|
+
svg: '<svg t="1718695007028" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2161" width="16" height="16"><path d="M512 87.04c-136.704 0-247.808 111.104-247.808 247.808 0 98.816 58.368 184.32 142.336 223.744-155.136 45.568-268.8 188.928-268.8 358.912 0 10.752 8.704 19.456 19.456 19.456 10.752 0 19.456-8.704 19.456-19.456 0-184.832 150.528-335.36 335.36-335.36 136.704 0 247.808-111.104 247.808-247.808S648.704 87.04 512 87.04z m0 456.192c-115.2 0-208.384-93.696-208.384-208.384 0-115.2 93.696-208.384 208.384-208.384 115.2 0 208.384 93.696 208.384 208.384 0 114.688-93.184 208.384-208.384 208.384z m226.816 76.8c-8.704-6.656-20.992-5.12-27.648 3.584-6.656 8.704-5.12 20.992 3.584 27.648 83.968 64 132.096 161.28 132.096 266.752 0 10.752 8.704 19.456 19.456 19.456 10.752 0 19.456-8.704 19.456-19.456 0.512-118.272-53.248-226.816-146.944-297.984z" fill="" p-id="2162"></path></svg>'
|
|
1229
1243
|
}, {
|
|
1230
1244
|
value: "logOut",
|
|
1231
1245
|
label: "next.layout.logOut",
|
|
1246
|
+
svg: '<svg t="1718695049981" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2313" width="16" height="16"><path d="M896 928H384a32 32 0 0 1-32-32v-128a32 32 0 0 1 64 0v96h448v-704h-448V256a32 32 0 1 1-64 0V128a32 32 0 0 1 32-32h512a32 32 0 0 1 32 32v768a32 32 0 0 1-32 32z" fill="" p-id="2314"></path><path d="M608 544H192a32 32 0 0 1 0-64h416a32 32 0 0 1 0 64z" fill="" p-id="2315"></path><path d="M256 672a30.08 30.08 0 0 1-22.4-9.6l-128-128a30.72 30.72 0 0 1 0-44.8l128-128a31.36 31.36 0 1 1 44.8 44.8L173.44 512l104.96 105.6a30.72 30.72 0 0 1 0 44.8 30.08 30.08 0 0 1-22.4 9.6z" fill="" p-id="2316"></path></svg>',
|
|
1232
1247
|
divided: !0
|
|
1233
1248
|
} ],
|
|
1234
1249
|
showTabs: !0,
|
|
@@ -1621,7 +1636,19 @@ var tools_default = export_helper_default(tools_vue_vue_type_script_lang_default
|
|
|
1621
1636
|
|
|
1622
1637
|
var view_default = export_helper_default(view_vue_vue_type_script_lang_default, [ [ "render", function(_ctx, _cache, $props, $setup, $data, $options) {
|
|
1623
1638
|
return openBlock(), createElementBlock("svg", _hoisted_1283, _hoisted_3282);
|
|
1624
|
-
} ], [ "__file", "view.vue" ] ]),
|
|
1639
|
+
} ], [ "__file", "view.vue" ] ]), warning_vue_vue_type_script_lang_default = {
|
|
1640
|
+
name: "Warning"
|
|
1641
|
+
}, _hoisted_1288 = {
|
|
1642
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1643
|
+
viewBox: "0 0 1024 1024"
|
|
1644
|
+
}, _hoisted_3287 = [ createElementVNode("path", {
|
|
1645
|
+
fill: "currentColor",
|
|
1646
|
+
d: "M512 64a448 448 0 1 1 0 896 448 448 0 0 1 0-896zm0 832a384 384 0 0 0 0-768 384 384 0 0 0 0 768zm48-176a48 48 0 1 1-96 0 48 48 0 0 1 96 0zm-48-464a32 32 0 0 1 32 32v288a32 32 0 0 1-64 0V288a32 32 0 0 1 32-32z"
|
|
1647
|
+
}, null, -1) ];
|
|
1648
|
+
|
|
1649
|
+
var warning_default = export_helper_default(warning_vue_vue_type_script_lang_default, [ [ "render", function(_ctx, _cache, $props, $setup, $data, $options) {
|
|
1650
|
+
return openBlock(), createElementBlock("svg", _hoisted_1288, _hoisted_3287);
|
|
1651
|
+
} ], [ "__file", "warning.vue" ] ]), LayoutSetting = defineComponent({
|
|
1625
1652
|
setup() {},
|
|
1626
1653
|
render() {
|
|
1627
1654
|
const _slots = inject("__slots__", {}), _ns = inject("__ns__", {}), _config = inject("options", {}), _updateOptions = inject("updateOptions", null), settingConfig = reactive({
|
|
@@ -1750,7 +1777,7 @@ var view_default = export_helper_default(view_vue_vue_type_script_lang_default,
|
|
|
1750
1777
|
class: _ns.be("config-bar-item", "label")
|
|
1751
1778
|
}, [ createTextVNode("是否显示标签栏") ]), createVNode("div", {
|
|
1752
1779
|
class: _ns.be("config-bar-item", "value")
|
|
1753
|
-
}, [ createVNode(
|
|
1780
|
+
}, [ createVNode(ElSwitch, {
|
|
1754
1781
|
modelValue: _config.showTabs,
|
|
1755
1782
|
"onUpdate:modelValue": $event => _config.showTabs = $event
|
|
1756
1783
|
}, null) ]) ]), _slots.setting?.() ]
|
|
@@ -1758,10 +1785,6 @@ var view_default = export_helper_default(view_vue_vue_type_script_lang_default,
|
|
|
1758
1785
|
}
|
|
1759
1786
|
});
|
|
1760
1787
|
|
|
1761
|
-
function _isSlot$8(s) {
|
|
1762
|
-
return "function" == typeof s || "[object Object]" === Object.prototype.toString.call(s) && !isVNode(s);
|
|
1763
|
-
}
|
|
1764
|
-
|
|
1765
1788
|
var HeaderTools = defineComponent({
|
|
1766
1789
|
setup() {
|
|
1767
1790
|
const locale = inject(localeContextKey, ref()), config = inject("options", {}), {t: t} = useLocale(), {toggle: toggle, isFullscreen: isFullscreen} = useFullscreen(), language = ref(computed((() => config.language)).value), settingDrawer = ref(!1);
|
|
@@ -1813,14 +1836,15 @@ var HeaderTools = defineComponent({
|
|
|
1813
1836
|
}) ]),
|
|
1814
1837
|
dropdown: () => {
|
|
1815
1838
|
let _slot;
|
|
1816
|
-
return createVNode(ElDropdownMenu, null,
|
|
1839
|
+
return createVNode(ElDropdownMenu, null, "function" == typeof (s = _slot = _languageDropdown.map((item => createVNode(ElDropdownItem, {
|
|
1817
1840
|
command: item.value,
|
|
1818
1841
|
disabled: this.language === item.value
|
|
1819
1842
|
}, {
|
|
1820
1843
|
default: () => [ item.label ]
|
|
1821
|
-
})))) ? _slot : {
|
|
1844
|
+
})))) || "[object Object]" === Object.prototype.toString.call(s) && !isVNode(s) ? _slot : {
|
|
1822
1845
|
default: () => [ _slot ]
|
|
1823
1846
|
});
|
|
1847
|
+
var s;
|
|
1824
1848
|
}
|
|
1825
1849
|
}) ]), createVNode("li", null, [ createVNode("span", {
|
|
1826
1850
|
style: {
|
|
@@ -1857,6 +1881,7 @@ var HeaderTools = defineComponent({
|
|
|
1857
1881
|
}) ]) ]), slots[slots_config_headerToolsSuffix]?.(), createVNode("li", null, [ createVNode(ElDropdown, {
|
|
1858
1882
|
"show-timeout": 70,
|
|
1859
1883
|
"hide-timeout": 80,
|
|
1884
|
+
"popper-class": _ns.be("header-tools", "userDropdown"),
|
|
1860
1885
|
onCommand: command => {
|
|
1861
1886
|
_emit("changeUserDropdown", command), _config.onChangeUserDropdown && _config.onChangeUserDropdown(command);
|
|
1862
1887
|
}
|
|
@@ -1872,15 +1897,17 @@ var HeaderTools = defineComponent({
|
|
|
1872
1897
|
default: () => [ createVNode(arrow_down_default, null, null) ]
|
|
1873
1898
|
}) ]),
|
|
1874
1899
|
dropdown: () => createVNode(ElDropdownMenu, null, {
|
|
1875
|
-
default: () => [ _userDropdown?.map((item => {
|
|
1876
|
-
|
|
1877
|
-
|
|
1878
|
-
|
|
1879
|
-
|
|
1880
|
-
|
|
1881
|
-
|
|
1882
|
-
})
|
|
1883
|
-
|
|
1900
|
+
default: () => [ _userDropdown?.map((item => createVNode(ElDropdownItem, {
|
|
1901
|
+
command: item.value,
|
|
1902
|
+
divided: !!item.divided
|
|
1903
|
+
}, {
|
|
1904
|
+
default: () => [ item.svg ? createVNode("span", {
|
|
1905
|
+
innerHTML: item.svg,
|
|
1906
|
+
class: "item-svg"
|
|
1907
|
+
}, null) : null, item.iconfont ? createVNode("i", {
|
|
1908
|
+
class: item.iconfont
|
|
1909
|
+
}, null) : null, _t(item.label) ]
|
|
1910
|
+
}))) ]
|
|
1884
1911
|
})
|
|
1885
1912
|
}) ]), createVNode("li", null, [ createVNode("span", {
|
|
1886
1913
|
style: {
|
|
@@ -3823,8 +3850,11 @@ var HeaderSearch = defineComponent({
|
|
|
3823
3850
|
class: ns.b("header-menu")
|
|
3824
3851
|
}, [ createVNode("div", {
|
|
3825
3852
|
class: ns.b("header-menu-left")
|
|
3826
|
-
}, [ this.$slots["menu-left-prefix"]?.(
|
|
3853
|
+
}, [ this.$slots["menu-left-prefix"]?.({
|
|
3854
|
+
size: options.size
|
|
3855
|
+
}), options.addBtn && createVNode(ElButton, {
|
|
3827
3856
|
type: "primary",
|
|
3857
|
+
size: options.size,
|
|
3828
3858
|
onClick: () => {
|
|
3829
3859
|
this.$emit("clickAdd");
|
|
3830
3860
|
}
|
|
@@ -3835,6 +3865,7 @@ var HeaderSearch = defineComponent({
|
|
|
3835
3865
|
default: () => t("next.table.add")
|
|
3836
3866
|
}), options.batchDelBtn && createVNode(ElButton, {
|
|
3837
3867
|
type: "danger",
|
|
3868
|
+
size: options.size,
|
|
3838
3869
|
disabled: !multipleSelectionLength.value,
|
|
3839
3870
|
onClick: () => {
|
|
3840
3871
|
const selection = unref(toRaw(multipleSelection.value.map((row => toRaw(row)))));
|
|
@@ -3858,10 +3889,15 @@ var HeaderSearch = defineComponent({
|
|
|
3858
3889
|
default: () => [ createVNode(delete_default, null, null) ]
|
|
3859
3890
|
}),
|
|
3860
3891
|
default: () => t("next.table.batchDelete")
|
|
3861
|
-
}), this.$slots["menu-left-suffix"]?.(
|
|
3892
|
+
}), this.$slots["menu-left-suffix"]?.({
|
|
3893
|
+
size: options.size
|
|
3894
|
+
}) ]), createVNode("div", {
|
|
3862
3895
|
class: ns.b("header-menu-right")
|
|
3863
|
-
}, [ this.$slots["menu-right-prefix"]?.(
|
|
3896
|
+
}, [ this.$slots["menu-right-prefix"]?.({
|
|
3897
|
+
size: options.size
|
|
3898
|
+
}), options.refreshBtn && createVNode(ElButton, {
|
|
3864
3899
|
circle: !0,
|
|
3900
|
+
size: options.size,
|
|
3865
3901
|
onClick: () => {
|
|
3866
3902
|
this.$emit("clickRefresh");
|
|
3867
3903
|
}
|
|
@@ -3871,6 +3907,7 @@ var HeaderSearch = defineComponent({
|
|
|
3871
3907
|
})
|
|
3872
3908
|
}), options.settingBtn && createVNode(ElButton, {
|
|
3873
3909
|
circle: !0,
|
|
3910
|
+
size: options.size,
|
|
3874
3911
|
onClick: () => {
|
|
3875
3912
|
drawerSettingRef.value.visible = !0;
|
|
3876
3913
|
}
|
|
@@ -3878,7 +3915,9 @@ var HeaderSearch = defineComponent({
|
|
|
3878
3915
|
icon: () => createVNode(ElIcon, null, {
|
|
3879
3916
|
default: () => [ createVNode(tools_default, null, null) ]
|
|
3880
3917
|
})
|
|
3881
|
-
}), this.$slots["menu-right-suffix"]?.(
|
|
3918
|
+
}), this.$slots["menu-right-suffix"]?.({
|
|
3919
|
+
size: options.size
|
|
3920
|
+
}) ]), createVNode(DrawerSetting, {
|
|
3882
3921
|
ref: drawerSettingRef
|
|
3883
3922
|
}, null) ]);
|
|
3884
3923
|
}
|
|
@@ -4366,7 +4405,7 @@ const ns$8 = useNamespace("form"), InputTableSelect = defineComponent({
|
|
|
4366
4405
|
}
|
|
4367
4406
|
})(event, toRaw(row))
|
|
4368
4407
|
}, null) : createVNode(ElRadio, {
|
|
4369
|
-
|
|
4408
|
+
value: value,
|
|
4370
4409
|
onChange: () => {
|
|
4371
4410
|
sinleSelection.value = value, multipleSelection.value = [ row ];
|
|
4372
4411
|
}
|
|
@@ -4498,12 +4537,20 @@ var UploadImage = defineComponent({
|
|
|
4498
4537
|
values: [ "text", "picture", "picture-card" ],
|
|
4499
4538
|
default: "picture-card"
|
|
4500
4539
|
},
|
|
4540
|
+
multiple: {
|
|
4541
|
+
type: Boolean,
|
|
4542
|
+
default: !1
|
|
4543
|
+
},
|
|
4544
|
+
limit: {
|
|
4545
|
+
type: Number,
|
|
4546
|
+
default: 1
|
|
4547
|
+
},
|
|
4501
4548
|
accept: {
|
|
4502
4549
|
type: String,
|
|
4503
4550
|
default: "image/*"
|
|
4504
4551
|
}
|
|
4505
4552
|
},
|
|
4506
|
-
emits: [ "change" ],
|
|
4553
|
+
emits: [ "change", "exceed" ],
|
|
4507
4554
|
setup(props) {
|
|
4508
4555
|
const {appContext: appContext} = getCurrentInstance(), {t: t} = useLocale();
|
|
4509
4556
|
return {
|
|
@@ -4539,6 +4586,8 @@ var UploadImage = defineComponent({
|
|
|
4539
4586
|
class: [ ns$7.b("upload-image"), props.className ],
|
|
4540
4587
|
style: props.style,
|
|
4541
4588
|
"list-type": props.listType,
|
|
4589
|
+
multiple: props.multiple,
|
|
4590
|
+
limit: props.limit,
|
|
4542
4591
|
"auto-upload": !1,
|
|
4543
4592
|
"on-preview": uploadFile => {
|
|
4544
4593
|
const body = document.getElementsByTagName("body")[0], initial = uploadfilesPreview.value.findIndex((file => file.url === uploadFile.url)) || 0;
|
|
@@ -4557,8 +4606,14 @@ var UploadImage = defineComponent({
|
|
|
4557
4606
|
});
|
|
4558
4607
|
previewImagesContainer.appContext = this.appContext, render(previewComponent, previewImagesContainer);
|
|
4559
4608
|
},
|
|
4560
|
-
|
|
4609
|
+
"on-change": (uploadfile, uploadfiles) => {
|
|
4561
4610
|
uploadfilesPreview.value = uploadfiles, emit("change", uploadfile, uploadfiles);
|
|
4611
|
+
},
|
|
4612
|
+
"on-exceed": (uploadfile, uploadfiles) => {
|
|
4613
|
+
ElMessage({
|
|
4614
|
+
type: "info",
|
|
4615
|
+
message: _t("next.table.uploadfileExceed")
|
|
4616
|
+
}), emit("exceed", uploadfile, uploadfiles);
|
|
4562
4617
|
}
|
|
4563
4618
|
}, {
|
|
4564
4619
|
trigger: () => slots.default ? slots.default() : "picture-card" === props.listType ? createVNode(ElIcon, null, {
|
|
@@ -4662,6 +4717,10 @@ var UploadImage = defineComponent({
|
|
|
4662
4717
|
}
|
|
4663
4718
|
});
|
|
4664
4719
|
|
|
4720
|
+
function _isSlot$2(s) {
|
|
4721
|
+
return "function" == typeof s || "[object Object]" === Object.prototype.toString.call(s) && !isVNode(s);
|
|
4722
|
+
}
|
|
4723
|
+
|
|
4665
4724
|
const ns$6 = useNamespace("form");
|
|
4666
4725
|
|
|
4667
4726
|
var Element$6 = defineComponent({
|
|
@@ -4705,17 +4764,17 @@ var Element$6 = defineComponent({
|
|
|
4705
4764
|
deep: !0,
|
|
4706
4765
|
immediate: !0
|
|
4707
4766
|
});
|
|
4708
|
-
const formColumns = arrayObjNoRepeat(_formColumns.value, "prop");
|
|
4767
|
+
const formColumns = arrayObjNoRepeat(_formColumns.value, "prop"), spanResizeLoading = ref(!1);
|
|
4709
4768
|
onMounted((() => {
|
|
4710
4769
|
const formEl = ruleFormRef.value?.$el;
|
|
4711
4770
|
let timer = null;
|
|
4712
4771
|
elementResize(formEl, (el => {
|
|
4713
|
-
null !== timer
|
|
4772
|
+
null !== timer ? clearTimeout(timer) : spanResizeLoading.value = !0, timer = setTimeout((() => {
|
|
4714
4773
|
colSpan.value = ((el, minWidth = 350) => {
|
|
4715
4774
|
const el_width = el.clientWidth;
|
|
4716
4775
|
let span = Math.floor(el_width / minWidth);
|
|
4717
4776
|
return span > 4 && (span = 4), Math.ceil(24 / span);
|
|
4718
|
-
})(el, options.columnMinWidth), clearTimeout(timer);
|
|
4777
|
+
})(el, options.columnMinWidth), spanResizeLoading.value = !1, clearTimeout(timer);
|
|
4719
4778
|
}), 200);
|
|
4720
4779
|
}));
|
|
4721
4780
|
}));
|
|
@@ -4912,7 +4971,7 @@ var Element$6 = defineComponent({
|
|
|
4912
4971
|
}, {
|
|
4913
4972
|
default: () => [ col.dicData && col.dicData.map((item => createVNode(ElRadio, {
|
|
4914
4973
|
key: item.value,
|
|
4915
|
-
|
|
4974
|
+
value: item.value,
|
|
4916
4975
|
disabled: valueExist(item.disabled, !1)
|
|
4917
4976
|
}, {
|
|
4918
4977
|
default: () => [ item.label ]
|
|
@@ -5006,7 +5065,10 @@ var Element$6 = defineComponent({
|
|
|
5006
5065
|
modelValue: formParams[col.prop],
|
|
5007
5066
|
"onUpdate:modelValue": $event => formParams[col.prop] = $event,
|
|
5008
5067
|
disabled: col.disabled,
|
|
5009
|
-
|
|
5068
|
+
multiple: col.multiple,
|
|
5069
|
+
limit: col.limit,
|
|
5070
|
+
onChange: (...arg) => col.onChange?.(...arg, col, formParams, formColumns),
|
|
5071
|
+
onExceed: (...arg) => col.onExceed?.(...arg, col, formParams, formColumns)
|
|
5010
5072
|
}, null) : "treeSelect" === col.type ? createVNode(treeSelect, {
|
|
5011
5073
|
modelValue: formParams[col.prop],
|
|
5012
5074
|
"onUpdate:modelValue": $event => formParams[col.prop] = $event,
|
|
@@ -5022,19 +5084,22 @@ var Element$6 = defineComponent({
|
|
|
5022
5084
|
getFormInstance: () => ruleFormRef.value,
|
|
5023
5085
|
getFormParams: () => toRaw(formParams)
|
|
5024
5086
|
});
|
|
5025
|
-
|
|
5026
|
-
let
|
|
5027
|
-
return createVNode(
|
|
5028
|
-
|
|
5029
|
-
|
|
5030
|
-
|
|
5031
|
-
|
|
5032
|
-
|
|
5033
|
-
|
|
5034
|
-
|
|
5035
|
-
|
|
5087
|
+
return () => {
|
|
5088
|
+
let _slot2;
|
|
5089
|
+
return createVNode(NextSpinLoading, {
|
|
5090
|
+
loading: spanResizeLoading.value
|
|
5091
|
+
}, _isSlot$2(_slot2 = (() => {
|
|
5092
|
+
let _slot;
|
|
5093
|
+
return createVNode(ElForm, {
|
|
5094
|
+
ref: ruleFormRef,
|
|
5095
|
+
class: ns$6.b(),
|
|
5096
|
+
inline: !1,
|
|
5097
|
+
model: formParams,
|
|
5098
|
+
size: options.size
|
|
5099
|
+
}, {
|
|
5100
|
+
default: () => [ createVNode(ElRow, {
|
|
5036
5101
|
gutter: 20
|
|
5037
|
-
}, (
|
|
5102
|
+
}, _isSlot$2(_slot = formColumns.map((column => !column.hide && createVNode(ElCol, {
|
|
5038
5103
|
span: valueExist(column.span, colSpan.value)
|
|
5039
5104
|
}, {
|
|
5040
5105
|
default: () => [ createVNode(ElFormItem, {
|
|
@@ -5064,9 +5129,9 @@ var Element$6 = defineComponent({
|
|
|
5064
5129
|
}) : null ]) : null,
|
|
5065
5130
|
default: () => renderFormItem(column)
|
|
5066
5131
|
}) ]
|
|
5067
|
-
})))
|
|
5132
|
+
})))) ? _slot : {
|
|
5068
5133
|
default: () => [ _slot ]
|
|
5069
|
-
})
|
|
5134
|
+
}), _isEditing.value && options.showFooter ? createVNode("div", {
|
|
5070
5135
|
class: ns$6.e("footer")
|
|
5071
5136
|
}, [ createVNode(ElButton, {
|
|
5072
5137
|
type: "primary",
|
|
@@ -5078,12 +5143,12 @@ var Element$6 = defineComponent({
|
|
|
5078
5143
|
onClick: onResetForm
|
|
5079
5144
|
}, {
|
|
5080
5145
|
default: () => [ t(options.resetText) || t("next.form.reset") ]
|
|
5081
|
-
}) : null ]) : null ]
|
|
5082
|
-
|
|
5083
|
-
|
|
5146
|
+
}) : null ]) : null ]
|
|
5147
|
+
});
|
|
5148
|
+
})()) ? _slot2 : {
|
|
5149
|
+
default: () => [ _slot2 ]
|
|
5084
5150
|
});
|
|
5085
5151
|
};
|
|
5086
|
-
return () => createVNode(Fragment, null, [ renderContent() ]);
|
|
5087
5152
|
}
|
|
5088
5153
|
});
|
|
5089
5154
|
|
|
@@ -5190,6 +5255,7 @@ var Element$5 = defineComponent({
|
|
|
5190
5255
|
rules: valueExist(col.formRules, col.rules, null),
|
|
5191
5256
|
span: valueExist(col.formSpan, col.span, null),
|
|
5192
5257
|
multiple: valueExist(col.formMultiple, col.multiple, !1),
|
|
5258
|
+
limit: valueExist(col.formLimit, col.limit, 1),
|
|
5193
5259
|
dicData: valueExist(col.formDicData, col.dicData, []),
|
|
5194
5260
|
loadDicData: valueExist(col.formLoadDicData, col.loadDicData, null),
|
|
5195
5261
|
onChange: valueExist(col.onChangeForm, col.onChange, null),
|
|
@@ -5905,7 +5971,105 @@ const NextDragResize = withInstall(defineComponent({
|
|
|
5905
5971
|
name: "NextDragResize",
|
|
5906
5972
|
props: {},
|
|
5907
5973
|
setup: () => () => createVNode(Fragment, null, [ createVNode(Fragment, null, null) ])
|
|
5908
|
-
}))
|
|
5974
|
+
}));
|
|
5975
|
+
|
|
5976
|
+
var ToolHeader = defineComponent({
|
|
5977
|
+
props: {
|
|
5978
|
+
isFullscreen: {
|
|
5979
|
+
type: Boolean,
|
|
5980
|
+
default: !1
|
|
5981
|
+
}
|
|
5982
|
+
},
|
|
5983
|
+
emits: [ "fullscreen", "save" ],
|
|
5984
|
+
setup(props, {emit: emit}) {
|
|
5985
|
+
const _ns = inject("ns", {}), {t: t} = useLocale(), switchFillscreen = val => {
|
|
5986
|
+
emit("fullscreen", val);
|
|
5987
|
+
};
|
|
5988
|
+
return () => createVNode(Fragment, null, [ createVNode(Fragment, null, [ createVNode("ul", {
|
|
5989
|
+
class: [ _ns.be("header", "tool") ]
|
|
5990
|
+
}, [ createVNode("li", {
|
|
5991
|
+
onClick: () => emit("save")
|
|
5992
|
+
}, [ createVNode("svg", {
|
|
5993
|
+
t: "1719034799379",
|
|
5994
|
+
class: "icon",
|
|
5995
|
+
viewBox: "0 0 1024 1024",
|
|
5996
|
+
version: "1.1",
|
|
5997
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
5998
|
+
"p-id": "4272",
|
|
5999
|
+
width: "18",
|
|
6000
|
+
height: "18"
|
|
6001
|
+
}, [ createVNode("path", {
|
|
6002
|
+
d: "M831.4 252.2L711.5 132.4c-10.3-10.3-24.2-16.1-38.8-16.1h-450c-23.3 0-42.2 18.9-42.2 42.2v709.4c0 23.3 18.9 42.2 42.2 42.2h582.6c23.3 0 42.2-18.9 42.2-42.2V291c-0.1-14.5-5.8-28.5-16.1-38.8zM619.6 159v159.8c0 4-3.3 7.3-7.3 7.3H387.2c-4 0-7.3-3.3-7.3-7.3V159h239.7z m67.7 708.4H340.8v-292c0-3.9 3.2-7.1 7.1-7.1h332.4c3.9 0 7.1 3.2 7.1 7.1v292z m117.4 0H730v-292c0-27.5-22.3-49.8-49.8-49.8H347.8c-27.5 0-49.8 22.3-49.8 49.8v292h-74.7V159.1h113.9v159.8c0 27.6 22.4 50.1 50.1 50.1h225.1c27.6 0 50.1-22.4 50.1-50.1V159h10.4c3.2 0 6.3 1.3 8.6 3.6l119.9 119.9c2.3 2.3 3.6 5.3 3.6 8.6l-0.3 576.3z",
|
|
6003
|
+
"p-id": "4273"
|
|
6004
|
+
}, null), createVNode("path", {
|
|
6005
|
+
d: "M536 196.3h42.7v87.2H536zM368.7 641.2h220.7v42.7H368.7zM368.7 744h170.9v42.7H368.7z",
|
|
6006
|
+
"p-id": "4274"
|
|
6007
|
+
}, null) ]), createVNode("span", {
|
|
6008
|
+
style: "padding-left: 3px"
|
|
6009
|
+
}, [ t("next.labelimg.saveLabel") ]) ]) ]), createVNode("ul", {
|
|
6010
|
+
class: [ _ns.be("header", "tool") ]
|
|
6011
|
+
}, [ createVNode("li", {
|
|
6012
|
+
style: "margin-right: 30px;"
|
|
6013
|
+
}, [ createVNode(ElPopover, {
|
|
6014
|
+
trigger: "hover",
|
|
6015
|
+
placement: "bottom",
|
|
6016
|
+
width: "none"
|
|
6017
|
+
}, {
|
|
6018
|
+
reference: () => createVNode("div", {
|
|
6019
|
+
class: "flex-center"
|
|
6020
|
+
}, [ createVNode("span", {
|
|
6021
|
+
style: "padding-right: 3px"
|
|
6022
|
+
}, [ t("next.labelimg.instructions") ]), createVNode(ElIcon, {
|
|
6023
|
+
size: 14
|
|
6024
|
+
}, {
|
|
6025
|
+
default: () => [ createVNode(warning_default, null, null) ]
|
|
6026
|
+
}) ]),
|
|
6027
|
+
default: () => createVNode("ul", {
|
|
6028
|
+
style: "font-size: 12px;white-space: nowrap;"
|
|
6029
|
+
}, [ createVNode("li", null, [ createVNode("span", null, [ createTextVNode("W:") ]), createVNode("span", null, [ createTextVNode("鼠标移入图片中,长按W键,鼠标按下左键,移动鼠标开始绘制,鼠标抬起结束绘制") ]) ]), createVNode("li", null, [ createVNode("span", null, [ createTextVNode("A:") ]), createVNode("span", null, [ createTextVNode("A键进入上一张图片进行标注") ]) ]), createVNode("li", null, [ createVNode("span", null, [ createTextVNode("D:") ]), createVNode("span", null, [ createTextVNode("D键进入下一张图片进行标注") ]) ]) ])
|
|
6030
|
+
}) ]), props.isFullscreen ? createVNode("li", {
|
|
6031
|
+
onClick: () => switchFillscreen(!1)
|
|
6032
|
+
}, [ createVNode(ElTooltip, {
|
|
6033
|
+
placement: "top",
|
|
6034
|
+
content: "取消全屏"
|
|
6035
|
+
}, {
|
|
6036
|
+
default: () => [ createVNode("svg", {
|
|
6037
|
+
t: "1719035442027",
|
|
6038
|
+
class: "icon",
|
|
6039
|
+
viewBox: "0 0 1024 1024",
|
|
6040
|
+
version: "1.1",
|
|
6041
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
6042
|
+
"p-id": "5388",
|
|
6043
|
+
width: "18",
|
|
6044
|
+
height: "18"
|
|
6045
|
+
}, [ createVNode("path", {
|
|
6046
|
+
d: "M354.133333 682.666667H256v-42.666667h170.666667v170.666667H384v-98.133334L243.2 853.333333l-29.866667-29.866666L354.133333 682.666667z m358.4 0l140.8 140.8-29.866666 29.866666-140.8-140.8V810.666667h-42.666667v-170.666667h170.666667v42.666667h-98.133334zM354.133333 384L213.333333 243.2l29.866667-29.866667L384 354.133333V256h42.666667v170.666667H256V384h98.133333z m358.4 0H810.666667v42.666667h-170.666667V256h42.666667v98.133333L823.466667 213.333333l29.866666 29.866667L712.533333 384z",
|
|
6047
|
+
"p-id": "5389"
|
|
6048
|
+
}, null) ]) ]
|
|
6049
|
+
}) ]) : createVNode("li", {
|
|
6050
|
+
onClick: () => switchFillscreen(!0)
|
|
6051
|
+
}, [ createVNode(ElTooltip, {
|
|
6052
|
+
placement: "top",
|
|
6053
|
+
content: "全屏"
|
|
6054
|
+
}, {
|
|
6055
|
+
default: () => [ createVNode("svg", {
|
|
6056
|
+
t: "1719035375323",
|
|
6057
|
+
class: "icon",
|
|
6058
|
+
viewBox: "0 0 1024 1024",
|
|
6059
|
+
version: "1.1",
|
|
6060
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
6061
|
+
"p-id": "5241",
|
|
6062
|
+
width: "18",
|
|
6063
|
+
height: "18"
|
|
6064
|
+
}, [ createVNode("path", {
|
|
6065
|
+
d: "M285.866667 810.666667H384v42.666666H213.333333v-170.666666h42.666667v98.133333l128-128 29.866667 29.866667-128 128z m494.933333 0l-128-128 29.866667-29.866667 128 128V682.666667h42.666666v170.666666h-170.666666v-42.666666h98.133333zM285.866667 256l128 128-29.866667 29.866667-128-128V384H213.333333V213.333333h170.666667v42.666667H285.866667z m494.933333 0H682.666667V213.333333h170.666666v170.666667h-42.666666V285.866667l-128 128-29.866667-29.866667 128-128z",
|
|
6066
|
+
"p-id": "5242"
|
|
6067
|
+
}, null) ]) ]
|
|
6068
|
+
}) ]) ]) ]) ]);
|
|
6069
|
+
}
|
|
6070
|
+
});
|
|
6071
|
+
|
|
6072
|
+
const colors = [ "#5470c6", "#91cc75", "#fac858", "#ee6666", "#73c0de", "#3ba272", "#fc8452", "#9a60b4", "#ea7ccc" ], convertToLabel = rect => {
|
|
5909
6073
|
const label_type = rect.type, x_center = rect.startX + rect.rectWidth / 2, y_center = rect.startY + rect.rectHeight / 2;
|
|
5910
6074
|
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
6075
|
}, canvertToCanvas = (labelData, canvasWidth, canvasHeight) => {
|
|
@@ -5959,7 +6123,7 @@ var ContextMenuLabel = defineComponent({
|
|
|
5959
6123
|
labelRectWidthHeight.value.width = clientWidth, labelRectWidthHeight.value.height = clientHeight;
|
|
5960
6124
|
}));
|
|
5961
6125
|
const labelMenuRef = ref(), labelStyleFixed = computed((() => {
|
|
5962
|
-
const {left: left, top: top
|
|
6126
|
+
const {left: left, top: top} = props.labelRect, height_diff = top + labelRectWidthHeight.value.height - window.innerHeight;
|
|
5963
6127
|
let y = top;
|
|
5964
6128
|
return height_diff > 0 && (y -= height_diff), {
|
|
5965
6129
|
top: y + "px",
|
|
@@ -6207,6 +6371,12 @@ var DraggableRect = defineComponent({
|
|
|
6207
6371
|
})),
|
|
6208
6372
|
label_txt: yolo_label.join("\n")
|
|
6209
6373
|
};
|
|
6374
|
+
}, setContainerWidthHeight = (canvasWidth, canvasHeight) => {
|
|
6375
|
+
canvasMainRef.value.style.width = canvasWidth + "px", canvasMainRef.value.style.height = canvasHeight + "px",
|
|
6376
|
+
canvasBaseRef.value.width = canvasWidth, canvasBaseRef.value.height = canvasHeight,
|
|
6377
|
+
canvasBaseRef.value.style.width = canvasWidth + "px", canvasBaseRef.value.style.height = canvasHeight + "px",
|
|
6378
|
+
canvasRectRef.value.width = canvasWidth, canvasRectRef.value.height = canvasHeight,
|
|
6379
|
+
canvasRectRef.value.style.width = canvasWidth + "px", canvasRectRef.value.style.height = canvasHeight + "px";
|
|
6210
6380
|
}, loadingImage = ref(!1), renderImageLabel = rowInfo => {
|
|
6211
6381
|
labels.value = (rowInfo => rowInfo.labels ? rowInfo.labels.map((rect => {
|
|
6212
6382
|
const typeName = props.classes[rect.type];
|
|
@@ -6217,14 +6387,13 @@ var DraggableRect = defineComponent({
|
|
|
6217
6387
|
const image = new Image;
|
|
6218
6388
|
image.src = rowInfo.imageSrc, loadingImage.value = !0, image.onload = () => {
|
|
6219
6389
|
loadingImage.value = !1;
|
|
6220
|
-
|
|
6221
|
-
(
|
|
6222
|
-
|
|
6223
|
-
|
|
6224
|
-
|
|
6225
|
-
|
|
6226
|
-
|
|
6227
|
-
})(canvasWidth, canvasHeight), labels.value = ((labels, canvasHeight) => {
|
|
6390
|
+
let {width: width, height: height} = image;
|
|
6391
|
+
if (height > clientHeight) {
|
|
6392
|
+
const scale = height / clientHeight;
|
|
6393
|
+
height = clientHeight, image.style.height = height + "px", width /= scale;
|
|
6394
|
+
}
|
|
6395
|
+
const canvasHeight = height, scaleFactor = parseFloat((canvasHeight / height).toFixed(3)), canvasWidth = Math.ceil(width * scaleFactor);
|
|
6396
|
+
setContainerWidthHeight(canvasWidth, canvasHeight), labels.value = ((labels, canvasHeight) => {
|
|
6228
6397
|
let scale_rects = [];
|
|
6229
6398
|
for (let i = 0; i < labels.length; i++) {
|
|
6230
6399
|
const rect = labels[i], scale = parseFloat((canvasHeight / rect.canvasHeight).toFixed(3));
|
|
@@ -6365,9 +6534,11 @@ var DraggableRect = defineComponent({
|
|
|
6365
6534
|
left: 0,
|
|
6366
6535
|
activateRect: null
|
|
6367
6536
|
}), updateContextmenuLabelFixed = (x, y, rect) => {
|
|
6368
|
-
|
|
6369
|
-
contextmenuLabelFixed.value.
|
|
6370
|
-
contextmenuLabelFixed.value.
|
|
6537
|
+
const contextRect = canvasBaseRef.value.getBoundingClientRect();
|
|
6538
|
+
contextmenuLabelFixed.value.show = !0, contextmenuLabelFixed.value.left = x + contextRect.x,
|
|
6539
|
+
contextmenuLabelFixed.value.top = y + contextRect.y, contextmenuLabelFixed.value.canvasWidth = canvasBaseRef.value.width,
|
|
6540
|
+
contextmenuLabelFixed.value.canvasHeight = canvasBaseRef.value.height, contextmenuLabelFixed.value.activateRect = rect,
|
|
6541
|
+
activate_add_label.value = rect;
|
|
6371
6542
|
}, onCloseContentmenuLabel = () => {
|
|
6372
6543
|
contextmenuLabelFixed.value.show = !1, contextmenuLabelFixed.value.top = 0, contextmenuLabelFixed.value.left = 0,
|
|
6373
6544
|
contextmenuLabelFixed.value.activateRect = null, activate_add_label.value = null,
|
|
@@ -6435,7 +6606,14 @@ var DraggableRect = defineComponent({
|
|
|
6435
6606
|
updateDraggableRectFixed(x, y, rect, index, colors[type]);
|
|
6436
6607
|
}));
|
|
6437
6608
|
},
|
|
6438
|
-
onDeleteLabel: onDeleteLabel
|
|
6609
|
+
onDeleteLabel: onDeleteLabel,
|
|
6610
|
+
rerenderImage: () => {
|
|
6611
|
+
setContainerWidthHeight(0, 0), onCloseContentmenuLabel(), onCloseDraggableRectFixed(),
|
|
6612
|
+
nextTick((() => {
|
|
6613
|
+
const rowInfo = toRaw(props.rowInfo);
|
|
6614
|
+
renderImageLabel(rowInfo);
|
|
6615
|
+
}));
|
|
6616
|
+
}
|
|
6439
6617
|
});
|
|
6440
6618
|
return () => createVNode(Fragment, null, [ createVNode(NextSpinLoading, {
|
|
6441
6619
|
loading: loadingImage.value,
|
|
@@ -6468,6 +6646,9 @@ var DraggableRect = defineComponent({
|
|
|
6468
6646
|
}
|
|
6469
6647
|
}), RightLabel = defineComponent({
|
|
6470
6648
|
props: {
|
|
6649
|
+
contentHeight: {
|
|
6650
|
+
type: Number
|
|
6651
|
+
},
|
|
6471
6652
|
classes: {
|
|
6472
6653
|
type: Array,
|
|
6473
6654
|
default: () => []
|
|
@@ -6491,7 +6672,10 @@ var DraggableRect = defineComponent({
|
|
|
6491
6672
|
immediate: !0
|
|
6492
6673
|
});
|
|
6493
6674
|
const renderContent = () => createVNode("div", {
|
|
6494
|
-
class: [ ns.b("right") ]
|
|
6675
|
+
class: [ ns.b("right") ],
|
|
6676
|
+
style: {
|
|
6677
|
+
height: props.contentHeight + "px"
|
|
6678
|
+
}
|
|
6495
6679
|
}, [ labels.value.length ? createVNode("ul", null, [ labels.value.map(((rect, index) => createVNode("li", {
|
|
6496
6680
|
key: index,
|
|
6497
6681
|
onClick: () => ((rect, index) => {
|
|
@@ -6525,7 +6709,7 @@ var DraggableRect = defineComponent({
|
|
|
6525
6709
|
return () => createVNode(Fragment, null, [ renderContent() ]);
|
|
6526
6710
|
}
|
|
6527
6711
|
}), defaultConfig = {
|
|
6528
|
-
|
|
6712
|
+
minContentHeight: 500
|
|
6529
6713
|
};
|
|
6530
6714
|
|
|
6531
6715
|
const ns$1 = useNamespace("labelimg");
|
|
@@ -6539,9 +6723,7 @@ var Element = defineComponent({
|
|
|
6539
6723
|
},
|
|
6540
6724
|
style: {
|
|
6541
6725
|
type: Object,
|
|
6542
|
-
default: () => ({
|
|
6543
|
-
position: "unset"
|
|
6544
|
-
})
|
|
6726
|
+
default: () => ({})
|
|
6545
6727
|
},
|
|
6546
6728
|
rowKey: {
|
|
6547
6729
|
type: String,
|
|
@@ -6624,9 +6806,8 @@ var Element = defineComponent({
|
|
|
6624
6806
|
if (loading.value) return;
|
|
6625
6807
|
loading.value = !0;
|
|
6626
6808
|
const {node: node, label_txt: label_txt} = formatNodeLabels();
|
|
6627
|
-
|
|
6628
|
-
|
|
6629
|
-
emit("save", {
|
|
6809
|
+
return canvasContextRef.value.onCloseDraggableRectFixed(), isChangeNodeLabels() ? (activateNodeIndex.value = index,
|
|
6810
|
+
loading.value = !1, !1) : (emit("save", {
|
|
6630
6811
|
node: node,
|
|
6631
6812
|
label_txt: label_txt
|
|
6632
6813
|
}, (imageItem => {
|
|
@@ -6634,7 +6815,7 @@ var Element = defineComponent({
|
|
|
6634
6815
|
loading.value = !1;
|
|
6635
6816
|
}), (() => {
|
|
6636
6817
|
loading.value = !1;
|
|
6637
|
-
}));
|
|
6818
|
+
})), !0);
|
|
6638
6819
|
}, onPaginationPrev = () => {
|
|
6639
6820
|
const imageLength = labelImages.value.length;
|
|
6640
6821
|
let i = activateNodeIndex.value - 1;
|
|
@@ -6643,30 +6824,35 @@ var Element = defineComponent({
|
|
|
6643
6824
|
const imageLength = labelImages.value.length;
|
|
6644
6825
|
let i = activateNodeIndex.value + 1;
|
|
6645
6826
|
i >= imageLength && (i = 0), onChangeActivateNode(i), emit("next-click");
|
|
6646
|
-
}, canvasContextRef = ref(), layoutLabelRef = ref(), headerRef = ref(), mainRef = ref(), footerRef = ref(), mainContentHeight = ref(options.
|
|
6647
|
-
|
|
6648
|
-
|
|
6649
|
-
|
|
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
|
-
}));
|
|
6827
|
+
}, canvasContextRef = ref(), layoutLabelRef = ref(), headerRef = ref(), mainRef = ref(), footerRef = ref(), mainContentHeight = ref(options.minContentHeight), updateMainContentHeight = () => {
|
|
6828
|
+
nextTick((() => {
|
|
6829
|
+
const contentHeight = (layoutLabelRef.value?.clientHeight || 0) - ((headerRef.value?.clientHeight || 0) + (footerRef.value?.clientHeight || 0));
|
|
6830
|
+
mainContentHeight.value = contentHeight;
|
|
6654
6831
|
}));
|
|
6832
|
+
};
|
|
6833
|
+
onMounted((() => {
|
|
6834
|
+
document.addEventListener("keydown", onKeydownPrevNext), elementResize(layoutLabelRef.value.parentElement, (() => {
|
|
6835
|
+
updateMainContentHeight();
|
|
6836
|
+
})), window.addEventListener("resize", updateMainContentHeight);
|
|
6655
6837
|
})), onUnmounted((() => {
|
|
6656
|
-
document.removeEventListener("keydown", onKeydownPrevNext);
|
|
6838
|
+
document.removeEventListener("keydown", onKeydownPrevNext), window.removeEventListener("resize", updateMainContentHeight);
|
|
6657
6839
|
}));
|
|
6658
6840
|
const onSelectLabelNode = (rect, index) => {
|
|
6659
6841
|
canvasContextRef.value.onSelectedLabel(rect, index);
|
|
6660
6842
|
}, onDeleteLabelNode = rect => {
|
|
6661
6843
|
canvasContextRef.value.onDeleteLabel(rect);
|
|
6844
|
+
}, isFullscreen = ref(!1), onSwitchFillscreen = val => {
|
|
6845
|
+
isFullscreen.value = val, updateMainContentHeight(), nextTick((() => {
|
|
6846
|
+
canvasContextRef.value.rerenderImage();
|
|
6847
|
+
}));
|
|
6662
6848
|
};
|
|
6663
6849
|
expose({
|
|
6664
6850
|
convertToLabel: convertToLabel,
|
|
6665
6851
|
canvertToCanvas: canvertToCanvas
|
|
6666
6852
|
});
|
|
6667
|
-
|
|
6853
|
+
const renderContent = () => createVNode("div", {
|
|
6668
6854
|
ref: layoutLabelRef,
|
|
6669
|
-
class: [ ns$1.b(), props.className ],
|
|
6855
|
+
class: [ ns$1.b(), props.className, isFullscreen.value ? ns$1.b("fullscreen") : "" ],
|
|
6670
6856
|
style: {
|
|
6671
6857
|
...props.style
|
|
6672
6858
|
}
|
|
@@ -6679,21 +6865,35 @@ var Element = defineComponent({
|
|
|
6679
6865
|
default: () => [ createVNode("header", {
|
|
6680
6866
|
ref: headerRef,
|
|
6681
6867
|
class: [ ns$1.b("header") ]
|
|
6682
|
-
}, [ slots.header ? slots.header() : createVNode(
|
|
6683
|
-
|
|
6684
|
-
|
|
6685
|
-
|
|
6686
|
-
|
|
6868
|
+
}, [ slots.header ? slots.header() : createVNode(ToolHeader, {
|
|
6869
|
+
isFullscreen: isFullscreen.value,
|
|
6870
|
+
onFullscreen: onSwitchFillscreen,
|
|
6871
|
+
onSave: () => {
|
|
6872
|
+
onChangeActivateNode(activateNodeIndex.value) || ElMessage({
|
|
6873
|
+
type: "info",
|
|
6874
|
+
message: t("next.labelimg.labelNoUpdate")
|
|
6875
|
+
});
|
|
6687
6876
|
}
|
|
6688
|
-
},
|
|
6877
|
+
}, null) ]), createVNode("div", {
|
|
6878
|
+
ref: mainRef,
|
|
6879
|
+
class: [ ns$1.b("main") ]
|
|
6880
|
+
}, [ createVNode(ElScrollbar, {
|
|
6689
6881
|
class: [ ns$1.be("main", "content") ]
|
|
6690
|
-
},
|
|
6691
|
-
|
|
6692
|
-
|
|
6693
|
-
|
|
6694
|
-
|
|
6695
|
-
|
|
6696
|
-
|
|
6882
|
+
}, {
|
|
6883
|
+
default: () => [ createVNode("div", {
|
|
6884
|
+
class: [ ns$1.be("main", "content") ],
|
|
6885
|
+
style: {
|
|
6886
|
+
height: mainContentHeight.value + "px"
|
|
6887
|
+
}
|
|
6888
|
+
}, [ createVNode(CanvasContext, {
|
|
6889
|
+
ref: canvasContextRef,
|
|
6890
|
+
contextClientHeight: mainContentHeight.value,
|
|
6891
|
+
classes: classes.value,
|
|
6892
|
+
rowInfo: currentNode.value,
|
|
6893
|
+
onChange: onChangeNodeRect
|
|
6894
|
+
}, null) ]) ]
|
|
6895
|
+
}), createVNode(RightLabel, {
|
|
6896
|
+
contentHeight: mainContentHeight.value,
|
|
6697
6897
|
classes: classes.value,
|
|
6698
6898
|
labels: activateNodeLabels.value,
|
|
6699
6899
|
onDelete: onDeleteLabelNode,
|
|
@@ -6738,7 +6938,8 @@ var Element = defineComponent({
|
|
|
6738
6938
|
default: () => [ createVNode(arrow_right_default, null, null) ]
|
|
6739
6939
|
}) ]) ]) ]
|
|
6740
6940
|
}) ]
|
|
6741
|
-
}) ])
|
|
6941
|
+
}) ]);
|
|
6942
|
+
return () => createVNode(Fragment, null, [ renderContent() ]);
|
|
6742
6943
|
}
|
|
6743
6944
|
});
|
|
6744
6945
|
|
|
@@ -6866,7 +7067,7 @@ const zoomDialog = app => {
|
|
|
6866
7067
|
}));
|
|
6867
7068
|
}
|
|
6868
7069
|
});
|
|
6869
|
-
}, version = "0.
|
|
7070
|
+
}, version = "0.3.1", install = function(app) {
|
|
6870
7071
|
Object.keys(components).forEach((key => {
|
|
6871
7072
|
const component = components[key];
|
|
6872
7073
|
app.component(component.name, component);
|
|
@@ -6876,7 +7077,7 @@ const zoomDialog = app => {
|
|
|
6876
7077
|
};
|
|
6877
7078
|
|
|
6878
7079
|
var index = {
|
|
6879
|
-
version: "0.
|
|
7080
|
+
version: "0.3.1",
|
|
6880
7081
|
install: install
|
|
6881
7082
|
};
|
|
6882
7083
|
|