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.umd.js
CHANGED
|
@@ -2,8 +2,8 @@
|
|
|
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
|
|
|
@@ -756,7 +756,8 @@
|
|
|
756
756
|
cancelDelete: "取消删除操作",
|
|
757
757
|
confirmButtonText: "确 定",
|
|
758
758
|
cancelButtonText: "取 消"
|
|
759
|
-
}
|
|
759
|
+
},
|
|
760
|
+
uploadfileExceed: "上传文件数量超出限制范围"
|
|
760
761
|
},
|
|
761
762
|
form: {
|
|
762
763
|
input: "请输入",
|
|
@@ -793,7 +794,10 @@
|
|
|
793
794
|
labelimg: {
|
|
794
795
|
saveTxt: "保存中...",
|
|
795
796
|
emptyLabelText: "暂无标签数据",
|
|
796
|
-
confirmDeleteLabel: "确定要删除该标注吗?"
|
|
797
|
+
confirmDeleteLabel: "确定要删除该标注吗?",
|
|
798
|
+
saveLabel: "保存当前标注",
|
|
799
|
+
instructions: "使用说明",
|
|
800
|
+
labelNoUpdate: "暂无标签数据更新"
|
|
797
801
|
}
|
|
798
802
|
}
|
|
799
803
|
}, enLocale = {
|
|
@@ -830,7 +834,8 @@
|
|
|
830
834
|
cancelDelete: "Cancel delete",
|
|
831
835
|
confirmButtonText: "OK",
|
|
832
836
|
cancelButtonText: "Cancel"
|
|
833
|
-
}
|
|
837
|
+
},
|
|
838
|
+
uploadfileExceed: "The number of uploaded files exceeds the limit"
|
|
834
839
|
},
|
|
835
840
|
form: {
|
|
836
841
|
input: "please input ",
|
|
@@ -867,7 +872,10 @@
|
|
|
867
872
|
labelimg: {
|
|
868
873
|
saveTxt: "saving...",
|
|
869
874
|
emptyLabelText: "No label data",
|
|
870
|
-
confirmDeleteLabel: "Are you sure you want to delete this annotation?"
|
|
875
|
+
confirmDeleteLabel: "Are you sure you want to delete this annotation?",
|
|
876
|
+
saveLabel: "save label",
|
|
877
|
+
instructions: "instructions",
|
|
878
|
+
labelNoUpdate: "No label data update"
|
|
871
879
|
}
|
|
872
880
|
}
|
|
873
881
|
}, zhtwLocale = {
|
|
@@ -904,7 +912,8 @@
|
|
|
904
912
|
cancelDelete: "取消删除操作",
|
|
905
913
|
confirmButtonText: "確 定",
|
|
906
914
|
cancelButtonText: "取 消"
|
|
907
|
-
}
|
|
915
|
+
},
|
|
916
|
+
uploadfileExceed: "上传文件数量超出限制范围"
|
|
908
917
|
},
|
|
909
918
|
form: {
|
|
910
919
|
input: "請輸入",
|
|
@@ -941,7 +950,10 @@
|
|
|
941
950
|
labelimg: {
|
|
942
951
|
saveTxt: "保存中...",
|
|
943
952
|
emptyLabelText: "暂无标签数据",
|
|
944
|
-
confirmDeleteLabel: "确定要删除该标注吗?"
|
|
953
|
+
confirmDeleteLabel: "确定要删除该标注吗?",
|
|
954
|
+
saveLabel: "保存当前标注",
|
|
955
|
+
instructions: "使用说明",
|
|
956
|
+
labelNoUpdate: "暂无标签数据更新"
|
|
945
957
|
}
|
|
946
958
|
}
|
|
947
959
|
};
|
|
@@ -1087,13 +1099,16 @@
|
|
|
1087
1099
|
} ],
|
|
1088
1100
|
userDropdown: [ {
|
|
1089
1101
|
value: "/",
|
|
1090
|
-
label: "next.layout.home"
|
|
1102
|
+
label: "next.layout.home",
|
|
1103
|
+
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>'
|
|
1091
1104
|
}, {
|
|
1092
1105
|
value: "/personal",
|
|
1093
|
-
label: "next.layout.personal"
|
|
1106
|
+
label: "next.layout.personal",
|
|
1107
|
+
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>'
|
|
1094
1108
|
}, {
|
|
1095
1109
|
value: "logOut",
|
|
1096
1110
|
label: "next.layout.logOut",
|
|
1111
|
+
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>',
|
|
1097
1112
|
divided: !0
|
|
1098
1113
|
} ],
|
|
1099
1114
|
showTabs: !0,
|
|
@@ -1460,7 +1475,18 @@
|
|
|
1460
1475
|
}, null, -1) ];
|
|
1461
1476
|
var view_default = export_helper_default(view_vue_vue_type_script_lang_default, [ [ "render", function(_ctx, _cache, $props, $setup, $data, $options) {
|
|
1462
1477
|
return vue.openBlock(), vue.createElementBlock("svg", _hoisted_1283, _hoisted_3282);
|
|
1463
|
-
} ], [ "__file", "view.vue" ] ]),
|
|
1478
|
+
} ], [ "__file", "view.vue" ] ]), warning_vue_vue_type_script_lang_default = {
|
|
1479
|
+
name: "Warning"
|
|
1480
|
+
}, _hoisted_1288 = {
|
|
1481
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1482
|
+
viewBox: "0 0 1024 1024"
|
|
1483
|
+
}, _hoisted_3287 = [ vue.createElementVNode("path", {
|
|
1484
|
+
fill: "currentColor",
|
|
1485
|
+
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"
|
|
1486
|
+
}, null, -1) ];
|
|
1487
|
+
var warning_default = export_helper_default(warning_vue_vue_type_script_lang_default, [ [ "render", function(_ctx, _cache, $props, $setup, $data, $options) {
|
|
1488
|
+
return vue.openBlock(), vue.createElementBlock("svg", _hoisted_1288, _hoisted_3287);
|
|
1489
|
+
} ], [ "__file", "warning.vue" ] ]), LayoutSetting = vue.defineComponent({
|
|
1464
1490
|
setup() {},
|
|
1465
1491
|
render() {
|
|
1466
1492
|
const _slots = vue.inject("__slots__", {}), _ns = vue.inject("__ns__", {}), _config = vue.inject("options", {}), _updateOptions = vue.inject("updateOptions", null), settingConfig = vue.reactive({
|
|
@@ -1589,16 +1615,13 @@
|
|
|
1589
1615
|
class: _ns.be("config-bar-item", "label")
|
|
1590
1616
|
}, [ vue.createTextVNode("是否显示标签栏") ]), vue.createVNode("div", {
|
|
1591
1617
|
class: _ns.be("config-bar-item", "value")
|
|
1592
|
-
}, [ vue.createVNode(
|
|
1618
|
+
}, [ vue.createVNode(elementPlus.ElSwitch, {
|
|
1593
1619
|
modelValue: _config.showTabs,
|
|
1594
1620
|
"onUpdate:modelValue": $event => _config.showTabs = $event
|
|
1595
1621
|
}, null) ]) ]), _slots.setting?.() ]
|
|
1596
1622
|
});
|
|
1597
1623
|
}
|
|
1598
1624
|
});
|
|
1599
|
-
function _isSlot$8(s) {
|
|
1600
|
-
return "function" == typeof s || "[object Object]" === Object.prototype.toString.call(s) && !vue.isVNode(s);
|
|
1601
|
-
}
|
|
1602
1625
|
var HeaderTools = vue.defineComponent({
|
|
1603
1626
|
setup() {
|
|
1604
1627
|
const locale = vue.inject(localeContextKey, vue.ref()), config = vue.inject("options", {}), {t: t} = useLocale(), {toggle: toggle, isFullscreen: isFullscreen} = core.useFullscreen(), language = vue.ref(vue.computed((() => config.language)).value), settingDrawer = vue.ref(!1);
|
|
@@ -1650,14 +1673,15 @@
|
|
|
1650
1673
|
}) ]),
|
|
1651
1674
|
dropdown: () => {
|
|
1652
1675
|
let _slot;
|
|
1653
|
-
return vue.createVNode(elementPlus.ElDropdownMenu, null,
|
|
1676
|
+
return vue.createVNode(elementPlus.ElDropdownMenu, null, "function" == typeof (s = _slot = _languageDropdown.map((item => vue.createVNode(elementPlus.ElDropdownItem, {
|
|
1654
1677
|
command: item.value,
|
|
1655
1678
|
disabled: this.language === item.value
|
|
1656
1679
|
}, {
|
|
1657
1680
|
default: () => [ item.label ]
|
|
1658
|
-
})))) ? _slot : {
|
|
1681
|
+
})))) || "[object Object]" === Object.prototype.toString.call(s) && !vue.isVNode(s) ? _slot : {
|
|
1659
1682
|
default: () => [ _slot ]
|
|
1660
1683
|
});
|
|
1684
|
+
var s;
|
|
1661
1685
|
}
|
|
1662
1686
|
}) ]), vue.createVNode("li", null, [ vue.createVNode("span", {
|
|
1663
1687
|
style: {
|
|
@@ -1694,6 +1718,7 @@
|
|
|
1694
1718
|
}) ]) ]), slots[slots_config_headerToolsSuffix]?.(), vue.createVNode("li", null, [ vue.createVNode(elementPlus.ElDropdown, {
|
|
1695
1719
|
"show-timeout": 70,
|
|
1696
1720
|
"hide-timeout": 80,
|
|
1721
|
+
"popper-class": _ns.be("header-tools", "userDropdown"),
|
|
1697
1722
|
onCommand: command => {
|
|
1698
1723
|
_emit("changeUserDropdown", command), _config.onChangeUserDropdown && _config.onChangeUserDropdown(command);
|
|
1699
1724
|
}
|
|
@@ -1709,15 +1734,17 @@
|
|
|
1709
1734
|
default: () => [ vue.createVNode(arrow_down_default, null, null) ]
|
|
1710
1735
|
}) ]),
|
|
1711
1736
|
dropdown: () => vue.createVNode(elementPlus.ElDropdownMenu, null, {
|
|
1712
|
-
default: () => [ _userDropdown?.map((item => {
|
|
1713
|
-
|
|
1714
|
-
|
|
1715
|
-
|
|
1716
|
-
|
|
1717
|
-
|
|
1718
|
-
|
|
1719
|
-
})
|
|
1720
|
-
|
|
1737
|
+
default: () => [ _userDropdown?.map((item => vue.createVNode(elementPlus.ElDropdownItem, {
|
|
1738
|
+
command: item.value,
|
|
1739
|
+
divided: !!item.divided
|
|
1740
|
+
}, {
|
|
1741
|
+
default: () => [ item.svg ? vue.createVNode("span", {
|
|
1742
|
+
innerHTML: item.svg,
|
|
1743
|
+
class: "item-svg"
|
|
1744
|
+
}, null) : null, item.iconfont ? vue.createVNode("i", {
|
|
1745
|
+
class: item.iconfont
|
|
1746
|
+
}, null) : null, _t(item.label) ]
|
|
1747
|
+
}))) ]
|
|
1721
1748
|
})
|
|
1722
1749
|
}) ]), vue.createVNode("li", null, [ vue.createVNode("span", {
|
|
1723
1750
|
style: {
|
|
@@ -3608,8 +3635,11 @@
|
|
|
3608
3635
|
class: ns.b("header-menu")
|
|
3609
3636
|
}, [ vue.createVNode("div", {
|
|
3610
3637
|
class: ns.b("header-menu-left")
|
|
3611
|
-
}, [ this.$slots["menu-left-prefix"]?.(
|
|
3638
|
+
}, [ this.$slots["menu-left-prefix"]?.({
|
|
3639
|
+
size: options.size
|
|
3640
|
+
}), options.addBtn && vue.createVNode(elementPlus.ElButton, {
|
|
3612
3641
|
type: "primary",
|
|
3642
|
+
size: options.size,
|
|
3613
3643
|
onClick: () => {
|
|
3614
3644
|
this.$emit("clickAdd");
|
|
3615
3645
|
}
|
|
@@ -3620,6 +3650,7 @@
|
|
|
3620
3650
|
default: () => t("next.table.add")
|
|
3621
3651
|
}), options.batchDelBtn && vue.createVNode(elementPlus.ElButton, {
|
|
3622
3652
|
type: "danger",
|
|
3653
|
+
size: options.size,
|
|
3623
3654
|
disabled: !multipleSelectionLength.value,
|
|
3624
3655
|
onClick: () => {
|
|
3625
3656
|
const selection = vue.unref(vue.toRaw(multipleSelection.value.map((row => vue.toRaw(row)))));
|
|
@@ -3643,10 +3674,15 @@
|
|
|
3643
3674
|
default: () => [ vue.createVNode(delete_default, null, null) ]
|
|
3644
3675
|
}),
|
|
3645
3676
|
default: () => t("next.table.batchDelete")
|
|
3646
|
-
}), this.$slots["menu-left-suffix"]?.(
|
|
3677
|
+
}), this.$slots["menu-left-suffix"]?.({
|
|
3678
|
+
size: options.size
|
|
3679
|
+
}) ]), vue.createVNode("div", {
|
|
3647
3680
|
class: ns.b("header-menu-right")
|
|
3648
|
-
}, [ this.$slots["menu-right-prefix"]?.(
|
|
3681
|
+
}, [ this.$slots["menu-right-prefix"]?.({
|
|
3682
|
+
size: options.size
|
|
3683
|
+
}), options.refreshBtn && vue.createVNode(elementPlus.ElButton, {
|
|
3649
3684
|
circle: !0,
|
|
3685
|
+
size: options.size,
|
|
3650
3686
|
onClick: () => {
|
|
3651
3687
|
this.$emit("clickRefresh");
|
|
3652
3688
|
}
|
|
@@ -3656,6 +3692,7 @@
|
|
|
3656
3692
|
})
|
|
3657
3693
|
}), options.settingBtn && vue.createVNode(elementPlus.ElButton, {
|
|
3658
3694
|
circle: !0,
|
|
3695
|
+
size: options.size,
|
|
3659
3696
|
onClick: () => {
|
|
3660
3697
|
drawerSettingRef.value.visible = !0;
|
|
3661
3698
|
}
|
|
@@ -3663,7 +3700,9 @@
|
|
|
3663
3700
|
icon: () => vue.createVNode(elementPlus.ElIcon, null, {
|
|
3664
3701
|
default: () => [ vue.createVNode(tools_default, null, null) ]
|
|
3665
3702
|
})
|
|
3666
|
-
}), this.$slots["menu-right-suffix"]?.(
|
|
3703
|
+
}), this.$slots["menu-right-suffix"]?.({
|
|
3704
|
+
size: options.size
|
|
3705
|
+
}) ]), vue.createVNode(DrawerSetting, {
|
|
3667
3706
|
ref: drawerSettingRef
|
|
3668
3707
|
}, null) ]);
|
|
3669
3708
|
}
|
|
@@ -4140,7 +4179,7 @@
|
|
|
4140
4179
|
}
|
|
4141
4180
|
})(event, vue.toRaw(row))
|
|
4142
4181
|
}, null) : vue.createVNode(elementPlus.ElRadio, {
|
|
4143
|
-
|
|
4182
|
+
value: value,
|
|
4144
4183
|
onChange: () => {
|
|
4145
4184
|
sinleSelection.value = value, multipleSelection.value = [ row ];
|
|
4146
4185
|
}
|
|
@@ -4271,12 +4310,20 @@
|
|
|
4271
4310
|
values: [ "text", "picture", "picture-card" ],
|
|
4272
4311
|
default: "picture-card"
|
|
4273
4312
|
},
|
|
4313
|
+
multiple: {
|
|
4314
|
+
type: Boolean,
|
|
4315
|
+
default: !1
|
|
4316
|
+
},
|
|
4317
|
+
limit: {
|
|
4318
|
+
type: Number,
|
|
4319
|
+
default: 1
|
|
4320
|
+
},
|
|
4274
4321
|
accept: {
|
|
4275
4322
|
type: String,
|
|
4276
4323
|
default: "image/*"
|
|
4277
4324
|
}
|
|
4278
4325
|
},
|
|
4279
|
-
emits: [ "change" ],
|
|
4326
|
+
emits: [ "change", "exceed" ],
|
|
4280
4327
|
setup(props) {
|
|
4281
4328
|
const {appContext: appContext} = vue.getCurrentInstance(), {t: t} = useLocale();
|
|
4282
4329
|
return {
|
|
@@ -4312,6 +4359,8 @@
|
|
|
4312
4359
|
class: [ ns$7.b("upload-image"), props.className ],
|
|
4313
4360
|
style: props.style,
|
|
4314
4361
|
"list-type": props.listType,
|
|
4362
|
+
multiple: props.multiple,
|
|
4363
|
+
limit: props.limit,
|
|
4315
4364
|
"auto-upload": !1,
|
|
4316
4365
|
"on-preview": uploadFile => {
|
|
4317
4366
|
const body = document.getElementsByTagName("body")[0], initial = uploadfilesPreview.value.findIndex((file => file.url === uploadFile.url)) || 0;
|
|
@@ -4330,8 +4379,14 @@
|
|
|
4330
4379
|
});
|
|
4331
4380
|
previewImagesContainer.appContext = this.appContext, vue.render(previewComponent, previewImagesContainer);
|
|
4332
4381
|
},
|
|
4333
|
-
|
|
4382
|
+
"on-change": (uploadfile, uploadfiles) => {
|
|
4334
4383
|
uploadfilesPreview.value = uploadfiles, emit("change", uploadfile, uploadfiles);
|
|
4384
|
+
},
|
|
4385
|
+
"on-exceed": (uploadfile, uploadfiles) => {
|
|
4386
|
+
elementPlus.ElMessage({
|
|
4387
|
+
type: "info",
|
|
4388
|
+
message: _t("next.table.uploadfileExceed")
|
|
4389
|
+
}), emit("exceed", uploadfile, uploadfiles);
|
|
4335
4390
|
}
|
|
4336
4391
|
}, {
|
|
4337
4392
|
trigger: () => slots.default ? slots.default() : "picture-card" === props.listType ? vue.createVNode(elementPlus.ElIcon, null, {
|
|
@@ -4434,6 +4489,9 @@
|
|
|
4434
4489
|
}, null) ]);
|
|
4435
4490
|
}
|
|
4436
4491
|
});
|
|
4492
|
+
function _isSlot$2(s) {
|
|
4493
|
+
return "function" == typeof s || "[object Object]" === Object.prototype.toString.call(s) && !vue.isVNode(s);
|
|
4494
|
+
}
|
|
4437
4495
|
const ns$6 = useNamespace("form");
|
|
4438
4496
|
var Element$6 = vue.defineComponent({
|
|
4439
4497
|
name: "NextForm",
|
|
@@ -4476,17 +4534,17 @@
|
|
|
4476
4534
|
deep: !0,
|
|
4477
4535
|
immediate: !0
|
|
4478
4536
|
});
|
|
4479
|
-
const formColumns = arrayObjNoRepeat(_formColumns.value, "prop");
|
|
4537
|
+
const formColumns = arrayObjNoRepeat(_formColumns.value, "prop"), spanResizeLoading = vue.ref(!1);
|
|
4480
4538
|
vue.onMounted((() => {
|
|
4481
4539
|
const formEl = ruleFormRef.value?.$el;
|
|
4482
4540
|
let timer = null;
|
|
4483
4541
|
elementResize(formEl, (el => {
|
|
4484
|
-
null !== timer
|
|
4542
|
+
null !== timer ? clearTimeout(timer) : spanResizeLoading.value = !0, timer = setTimeout((() => {
|
|
4485
4543
|
colSpan.value = ((el, minWidth = 350) => {
|
|
4486
4544
|
const el_width = el.clientWidth;
|
|
4487
4545
|
let span = Math.floor(el_width / minWidth);
|
|
4488
4546
|
return span > 4 && (span = 4), Math.ceil(24 / span);
|
|
4489
|
-
})(el, options.columnMinWidth), clearTimeout(timer);
|
|
4547
|
+
})(el, options.columnMinWidth), spanResizeLoading.value = !1, clearTimeout(timer);
|
|
4490
4548
|
}), 200);
|
|
4491
4549
|
}));
|
|
4492
4550
|
}));
|
|
@@ -4683,7 +4741,7 @@
|
|
|
4683
4741
|
}, {
|
|
4684
4742
|
default: () => [ col.dicData && col.dicData.map((item => vue.createVNode(elementPlus.ElRadio, {
|
|
4685
4743
|
key: item.value,
|
|
4686
|
-
|
|
4744
|
+
value: item.value,
|
|
4687
4745
|
disabled: valueExist(item.disabled, !1)
|
|
4688
4746
|
}, {
|
|
4689
4747
|
default: () => [ item.label ]
|
|
@@ -4777,7 +4835,10 @@
|
|
|
4777
4835
|
modelValue: formParams[col.prop],
|
|
4778
4836
|
"onUpdate:modelValue": $event => formParams[col.prop] = $event,
|
|
4779
4837
|
disabled: col.disabled,
|
|
4780
|
-
|
|
4838
|
+
multiple: col.multiple,
|
|
4839
|
+
limit: col.limit,
|
|
4840
|
+
onChange: (...arg) => col.onChange?.(...arg, col, formParams, formColumns),
|
|
4841
|
+
onExceed: (...arg) => col.onExceed?.(...arg, col, formParams, formColumns)
|
|
4781
4842
|
}, null) : "treeSelect" === col.type ? vue.createVNode(treeSelect, {
|
|
4782
4843
|
modelValue: formParams[col.prop],
|
|
4783
4844
|
"onUpdate:modelValue": $event => formParams[col.prop] = $event,
|
|
@@ -4793,19 +4854,22 @@
|
|
|
4793
4854
|
getFormInstance: () => ruleFormRef.value,
|
|
4794
4855
|
getFormParams: () => vue.toRaw(formParams)
|
|
4795
4856
|
});
|
|
4796
|
-
|
|
4797
|
-
let
|
|
4798
|
-
return vue.createVNode(
|
|
4799
|
-
|
|
4800
|
-
|
|
4801
|
-
|
|
4802
|
-
|
|
4803
|
-
|
|
4804
|
-
|
|
4805
|
-
|
|
4806
|
-
|
|
4857
|
+
return () => {
|
|
4858
|
+
let _slot2;
|
|
4859
|
+
return vue.createVNode(NextSpinLoading, {
|
|
4860
|
+
loading: spanResizeLoading.value
|
|
4861
|
+
}, _isSlot$2(_slot2 = (() => {
|
|
4862
|
+
let _slot;
|
|
4863
|
+
return vue.createVNode(elementPlus.ElForm, {
|
|
4864
|
+
ref: ruleFormRef,
|
|
4865
|
+
class: ns$6.b(),
|
|
4866
|
+
inline: !1,
|
|
4867
|
+
model: formParams,
|
|
4868
|
+
size: options.size
|
|
4869
|
+
}, {
|
|
4870
|
+
default: () => [ vue.createVNode(elementPlus.ElRow, {
|
|
4807
4871
|
gutter: 20
|
|
4808
|
-
}, (
|
|
4872
|
+
}, _isSlot$2(_slot = formColumns.map((column => !column.hide && vue.createVNode(elementPlus.ElCol, {
|
|
4809
4873
|
span: valueExist(column.span, colSpan.value)
|
|
4810
4874
|
}, {
|
|
4811
4875
|
default: () => [ vue.createVNode(elementPlus.ElFormItem, {
|
|
@@ -4835,9 +4899,9 @@
|
|
|
4835
4899
|
}) : null ]) : null,
|
|
4836
4900
|
default: () => renderFormItem(column)
|
|
4837
4901
|
}) ]
|
|
4838
|
-
})))
|
|
4902
|
+
})))) ? _slot : {
|
|
4839
4903
|
default: () => [ _slot ]
|
|
4840
|
-
})
|
|
4904
|
+
}), _isEditing.value && options.showFooter ? vue.createVNode("div", {
|
|
4841
4905
|
class: ns$6.e("footer")
|
|
4842
4906
|
}, [ vue.createVNode(elementPlus.ElButton, {
|
|
4843
4907
|
type: "primary",
|
|
@@ -4849,12 +4913,12 @@
|
|
|
4849
4913
|
onClick: onResetForm
|
|
4850
4914
|
}, {
|
|
4851
4915
|
default: () => [ t(options.resetText) || t("next.form.reset") ]
|
|
4852
|
-
}) : null ]) : null ]
|
|
4853
|
-
|
|
4854
|
-
|
|
4916
|
+
}) : null ]) : null ]
|
|
4917
|
+
});
|
|
4918
|
+
})()) ? _slot2 : {
|
|
4919
|
+
default: () => [ _slot2 ]
|
|
4855
4920
|
});
|
|
4856
4921
|
};
|
|
4857
|
-
return () => vue.createVNode(vue.Fragment, null, [ renderContent() ]);
|
|
4858
4922
|
}
|
|
4859
4923
|
});
|
|
4860
4924
|
const NextTreeSelect = withInstall(treeSelect), NextForm = withInstall(Element$6);
|
|
@@ -4956,6 +5020,7 @@
|
|
|
4956
5020
|
rules: valueExist(col.formRules, col.rules, null),
|
|
4957
5021
|
span: valueExist(col.formSpan, col.span, null),
|
|
4958
5022
|
multiple: valueExist(col.formMultiple, col.multiple, !1),
|
|
5023
|
+
limit: valueExist(col.formLimit, col.limit, 1),
|
|
4959
5024
|
dicData: valueExist(col.formDicData, col.dicData, []),
|
|
4960
5025
|
loadDicData: valueExist(col.formLoadDicData, col.loadDicData, null),
|
|
4961
5026
|
onChange: valueExist(col.onChangeForm, col.onChange, null),
|
|
@@ -5663,7 +5728,103 @@
|
|
|
5663
5728
|
name: "NextDragResize",
|
|
5664
5729
|
props: {},
|
|
5665
5730
|
setup: () => () => vue.createVNode(vue.Fragment, null, [ vue.createVNode(vue.Fragment, null, null) ])
|
|
5666
|
-
}))
|
|
5731
|
+
}));
|
|
5732
|
+
var ToolHeader = vue.defineComponent({
|
|
5733
|
+
props: {
|
|
5734
|
+
isFullscreen: {
|
|
5735
|
+
type: Boolean,
|
|
5736
|
+
default: !1
|
|
5737
|
+
}
|
|
5738
|
+
},
|
|
5739
|
+
emits: [ "fullscreen", "save" ],
|
|
5740
|
+
setup(props, {emit: emit}) {
|
|
5741
|
+
const _ns = vue.inject("ns", {}), {t: t} = useLocale(), switchFillscreen = val => {
|
|
5742
|
+
emit("fullscreen", val);
|
|
5743
|
+
};
|
|
5744
|
+
return () => vue.createVNode(vue.Fragment, null, [ vue.createVNode(vue.Fragment, null, [ vue.createVNode("ul", {
|
|
5745
|
+
class: [ _ns.be("header", "tool") ]
|
|
5746
|
+
}, [ vue.createVNode("li", {
|
|
5747
|
+
onClick: () => emit("save")
|
|
5748
|
+
}, [ vue.createVNode("svg", {
|
|
5749
|
+
t: "1719034799379",
|
|
5750
|
+
class: "icon",
|
|
5751
|
+
viewBox: "0 0 1024 1024",
|
|
5752
|
+
version: "1.1",
|
|
5753
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
5754
|
+
"p-id": "4272",
|
|
5755
|
+
width: "18",
|
|
5756
|
+
height: "18"
|
|
5757
|
+
}, [ vue.createVNode("path", {
|
|
5758
|
+
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",
|
|
5759
|
+
"p-id": "4273"
|
|
5760
|
+
}, null), vue.createVNode("path", {
|
|
5761
|
+
d: "M536 196.3h42.7v87.2H536zM368.7 641.2h220.7v42.7H368.7zM368.7 744h170.9v42.7H368.7z",
|
|
5762
|
+
"p-id": "4274"
|
|
5763
|
+
}, null) ]), vue.createVNode("span", {
|
|
5764
|
+
style: "padding-left: 3px"
|
|
5765
|
+
}, [ t("next.labelimg.saveLabel") ]) ]) ]), vue.createVNode("ul", {
|
|
5766
|
+
class: [ _ns.be("header", "tool") ]
|
|
5767
|
+
}, [ vue.createVNode("li", {
|
|
5768
|
+
style: "margin-right: 30px;"
|
|
5769
|
+
}, [ vue.createVNode(elementPlus.ElPopover, {
|
|
5770
|
+
trigger: "hover",
|
|
5771
|
+
placement: "bottom",
|
|
5772
|
+
width: "none"
|
|
5773
|
+
}, {
|
|
5774
|
+
reference: () => vue.createVNode("div", {
|
|
5775
|
+
class: "flex-center"
|
|
5776
|
+
}, [ vue.createVNode("span", {
|
|
5777
|
+
style: "padding-right: 3px"
|
|
5778
|
+
}, [ t("next.labelimg.instructions") ]), vue.createVNode(elementPlus.ElIcon, {
|
|
5779
|
+
size: 14
|
|
5780
|
+
}, {
|
|
5781
|
+
default: () => [ vue.createVNode(warning_default, null, null) ]
|
|
5782
|
+
}) ]),
|
|
5783
|
+
default: () => vue.createVNode("ul", {
|
|
5784
|
+
style: "font-size: 12px;white-space: nowrap;"
|
|
5785
|
+
}, [ vue.createVNode("li", null, [ vue.createVNode("span", null, [ vue.createTextVNode("W:") ]), vue.createVNode("span", null, [ vue.createTextVNode("鼠标移入图片中,长按W键,鼠标按下左键,移动鼠标开始绘制,鼠标抬起结束绘制") ]) ]), vue.createVNode("li", null, [ vue.createVNode("span", null, [ vue.createTextVNode("A:") ]), vue.createVNode("span", null, [ vue.createTextVNode("A键进入上一张图片进行标注") ]) ]), vue.createVNode("li", null, [ vue.createVNode("span", null, [ vue.createTextVNode("D:") ]), vue.createVNode("span", null, [ vue.createTextVNode("D键进入下一张图片进行标注") ]) ]) ])
|
|
5786
|
+
}) ]), props.isFullscreen ? vue.createVNode("li", {
|
|
5787
|
+
onClick: () => switchFillscreen(!1)
|
|
5788
|
+
}, [ vue.createVNode(elementPlus.ElTooltip, {
|
|
5789
|
+
placement: "top",
|
|
5790
|
+
content: "取消全屏"
|
|
5791
|
+
}, {
|
|
5792
|
+
default: () => [ vue.createVNode("svg", {
|
|
5793
|
+
t: "1719035442027",
|
|
5794
|
+
class: "icon",
|
|
5795
|
+
viewBox: "0 0 1024 1024",
|
|
5796
|
+
version: "1.1",
|
|
5797
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
5798
|
+
"p-id": "5388",
|
|
5799
|
+
width: "18",
|
|
5800
|
+
height: "18"
|
|
5801
|
+
}, [ vue.createVNode("path", {
|
|
5802
|
+
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",
|
|
5803
|
+
"p-id": "5389"
|
|
5804
|
+
}, null) ]) ]
|
|
5805
|
+
}) ]) : vue.createVNode("li", {
|
|
5806
|
+
onClick: () => switchFillscreen(!0)
|
|
5807
|
+
}, [ vue.createVNode(elementPlus.ElTooltip, {
|
|
5808
|
+
placement: "top",
|
|
5809
|
+
content: "全屏"
|
|
5810
|
+
}, {
|
|
5811
|
+
default: () => [ vue.createVNode("svg", {
|
|
5812
|
+
t: "1719035375323",
|
|
5813
|
+
class: "icon",
|
|
5814
|
+
viewBox: "0 0 1024 1024",
|
|
5815
|
+
version: "1.1",
|
|
5816
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
5817
|
+
"p-id": "5241",
|
|
5818
|
+
width: "18",
|
|
5819
|
+
height: "18"
|
|
5820
|
+
}, [ vue.createVNode("path", {
|
|
5821
|
+
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",
|
|
5822
|
+
"p-id": "5242"
|
|
5823
|
+
}, null) ]) ]
|
|
5824
|
+
}) ]) ]) ]) ]);
|
|
5825
|
+
}
|
|
5826
|
+
});
|
|
5827
|
+
const colors = [ "#5470c6", "#91cc75", "#fac858", "#ee6666", "#73c0de", "#3ba272", "#fc8452", "#9a60b4", "#ea7ccc" ], convertToLabel = rect => {
|
|
5667
5828
|
const label_type = rect.type, x_center = rect.startX + rect.rectWidth / 2, y_center = rect.startY + rect.rectHeight / 2;
|
|
5668
5829
|
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)) ];
|
|
5669
5830
|
}, canvertToCanvas = (labelData, canvasWidth, canvasHeight) => {
|
|
@@ -5716,7 +5877,7 @@
|
|
|
5716
5877
|
labelRectWidthHeight.value.width = clientWidth, labelRectWidthHeight.value.height = clientHeight;
|
|
5717
5878
|
}));
|
|
5718
5879
|
const labelMenuRef = vue.ref(), labelStyleFixed = vue.computed((() => {
|
|
5719
|
-
const {left: left, top: top
|
|
5880
|
+
const {left: left, top: top} = props.labelRect, height_diff = top + labelRectWidthHeight.value.height - window.innerHeight;
|
|
5720
5881
|
let y = top;
|
|
5721
5882
|
return height_diff > 0 && (y -= height_diff), {
|
|
5722
5883
|
top: y + "px",
|
|
@@ -5962,6 +6123,12 @@
|
|
|
5962
6123
|
})),
|
|
5963
6124
|
label_txt: yolo_label.join("\n")
|
|
5964
6125
|
};
|
|
6126
|
+
}, setContainerWidthHeight = (canvasWidth, canvasHeight) => {
|
|
6127
|
+
canvasMainRef.value.style.width = canvasWidth + "px", canvasMainRef.value.style.height = canvasHeight + "px",
|
|
6128
|
+
canvasBaseRef.value.width = canvasWidth, canvasBaseRef.value.height = canvasHeight,
|
|
6129
|
+
canvasBaseRef.value.style.width = canvasWidth + "px", canvasBaseRef.value.style.height = canvasHeight + "px",
|
|
6130
|
+
canvasRectRef.value.width = canvasWidth, canvasRectRef.value.height = canvasHeight,
|
|
6131
|
+
canvasRectRef.value.style.width = canvasWidth + "px", canvasRectRef.value.style.height = canvasHeight + "px";
|
|
5965
6132
|
}, loadingImage = vue.ref(!1), renderImageLabel = rowInfo => {
|
|
5966
6133
|
labels.value = (rowInfo => rowInfo.labels ? rowInfo.labels.map((rect => {
|
|
5967
6134
|
const typeName = props.classes[rect.type];
|
|
@@ -5972,14 +6139,13 @@
|
|
|
5972
6139
|
const image = new Image;
|
|
5973
6140
|
image.src = rowInfo.imageSrc, loadingImage.value = !0, image.onload = () => {
|
|
5974
6141
|
loadingImage.value = !1;
|
|
5975
|
-
|
|
5976
|
-
(
|
|
5977
|
-
|
|
5978
|
-
|
|
5979
|
-
|
|
5980
|
-
|
|
5981
|
-
|
|
5982
|
-
})(canvasWidth, canvasHeight), labels.value = ((labels, canvasHeight) => {
|
|
6142
|
+
let {width: width, height: height} = image;
|
|
6143
|
+
if (height > clientHeight) {
|
|
6144
|
+
const scale = height / clientHeight;
|
|
6145
|
+
height = clientHeight, image.style.height = height + "px", width /= scale;
|
|
6146
|
+
}
|
|
6147
|
+
const canvasHeight = height, scaleFactor = parseFloat((canvasHeight / height).toFixed(3)), canvasWidth = Math.ceil(width * scaleFactor);
|
|
6148
|
+
setContainerWidthHeight(canvasWidth, canvasHeight), labels.value = ((labels, canvasHeight) => {
|
|
5983
6149
|
let scale_rects = [];
|
|
5984
6150
|
for (let i = 0; i < labels.length; i++) {
|
|
5985
6151
|
const rect = labels[i], scale = parseFloat((canvasHeight / rect.canvasHeight).toFixed(3));
|
|
@@ -6120,9 +6286,11 @@
|
|
|
6120
6286
|
left: 0,
|
|
6121
6287
|
activateRect: null
|
|
6122
6288
|
}), updateContextmenuLabelFixed = (x, y, rect) => {
|
|
6123
|
-
|
|
6124
|
-
contextmenuLabelFixed.value.
|
|
6125
|
-
contextmenuLabelFixed.value.
|
|
6289
|
+
const contextRect = canvasBaseRef.value.getBoundingClientRect();
|
|
6290
|
+
contextmenuLabelFixed.value.show = !0, contextmenuLabelFixed.value.left = x + contextRect.x,
|
|
6291
|
+
contextmenuLabelFixed.value.top = y + contextRect.y, contextmenuLabelFixed.value.canvasWidth = canvasBaseRef.value.width,
|
|
6292
|
+
contextmenuLabelFixed.value.canvasHeight = canvasBaseRef.value.height, contextmenuLabelFixed.value.activateRect = rect,
|
|
6293
|
+
activate_add_label.value = rect;
|
|
6126
6294
|
}, onCloseContentmenuLabel = () => {
|
|
6127
6295
|
contextmenuLabelFixed.value.show = !1, contextmenuLabelFixed.value.top = 0, contextmenuLabelFixed.value.left = 0,
|
|
6128
6296
|
contextmenuLabelFixed.value.activateRect = null, activate_add_label.value = null,
|
|
@@ -6190,7 +6358,14 @@
|
|
|
6190
6358
|
updateDraggableRectFixed(x, y, rect, index, colors[type]);
|
|
6191
6359
|
}));
|
|
6192
6360
|
},
|
|
6193
|
-
onDeleteLabel: onDeleteLabel
|
|
6361
|
+
onDeleteLabel: onDeleteLabel,
|
|
6362
|
+
rerenderImage: () => {
|
|
6363
|
+
setContainerWidthHeight(0, 0), onCloseContentmenuLabel(), onCloseDraggableRectFixed(),
|
|
6364
|
+
vue.nextTick((() => {
|
|
6365
|
+
const rowInfo = vue.toRaw(props.rowInfo);
|
|
6366
|
+
renderImageLabel(rowInfo);
|
|
6367
|
+
}));
|
|
6368
|
+
}
|
|
6194
6369
|
});
|
|
6195
6370
|
return () => vue.createVNode(vue.Fragment, null, [ vue.createVNode(NextSpinLoading, {
|
|
6196
6371
|
loading: loadingImage.value,
|
|
@@ -6223,6 +6398,9 @@
|
|
|
6223
6398
|
}
|
|
6224
6399
|
}), RightLabel = vue.defineComponent({
|
|
6225
6400
|
props: {
|
|
6401
|
+
contentHeight: {
|
|
6402
|
+
type: Number
|
|
6403
|
+
},
|
|
6226
6404
|
classes: {
|
|
6227
6405
|
type: Array,
|
|
6228
6406
|
default: () => []
|
|
@@ -6246,7 +6424,10 @@
|
|
|
6246
6424
|
immediate: !0
|
|
6247
6425
|
});
|
|
6248
6426
|
const renderContent = () => vue.createVNode("div", {
|
|
6249
|
-
class: [ ns.b("right") ]
|
|
6427
|
+
class: [ ns.b("right") ],
|
|
6428
|
+
style: {
|
|
6429
|
+
height: props.contentHeight + "px"
|
|
6430
|
+
}
|
|
6250
6431
|
}, [ labels.value.length ? vue.createVNode("ul", null, [ labels.value.map(((rect, index) => vue.createVNode("li", {
|
|
6251
6432
|
key: index,
|
|
6252
6433
|
onClick: () => ((rect, index) => {
|
|
@@ -6280,7 +6461,7 @@
|
|
|
6280
6461
|
return () => vue.createVNode(vue.Fragment, null, [ renderContent() ]);
|
|
6281
6462
|
}
|
|
6282
6463
|
}), defaultConfig = {
|
|
6283
|
-
|
|
6464
|
+
minContentHeight: 500
|
|
6284
6465
|
};
|
|
6285
6466
|
const ns$1 = useNamespace("labelimg");
|
|
6286
6467
|
var Element = vue.defineComponent({
|
|
@@ -6292,9 +6473,7 @@
|
|
|
6292
6473
|
},
|
|
6293
6474
|
style: {
|
|
6294
6475
|
type: Object,
|
|
6295
|
-
default: () => ({
|
|
6296
|
-
position: "unset"
|
|
6297
|
-
})
|
|
6476
|
+
default: () => ({})
|
|
6298
6477
|
},
|
|
6299
6478
|
rowKey: {
|
|
6300
6479
|
type: String,
|
|
@@ -6377,9 +6556,8 @@
|
|
|
6377
6556
|
if (loading.value) return;
|
|
6378
6557
|
loading.value = !0;
|
|
6379
6558
|
const {node: node, label_txt: label_txt} = formatNodeLabels();
|
|
6380
|
-
|
|
6381
|
-
|
|
6382
|
-
emit("save", {
|
|
6559
|
+
return canvasContextRef.value.onCloseDraggableRectFixed(), isChangeNodeLabels() ? (activateNodeIndex.value = index,
|
|
6560
|
+
loading.value = !1, !1) : (emit("save", {
|
|
6383
6561
|
node: node,
|
|
6384
6562
|
label_txt: label_txt
|
|
6385
6563
|
}, (imageItem => {
|
|
@@ -6387,7 +6565,7 @@
|
|
|
6387
6565
|
loading.value = !1;
|
|
6388
6566
|
}), (() => {
|
|
6389
6567
|
loading.value = !1;
|
|
6390
|
-
}));
|
|
6568
|
+
})), !0);
|
|
6391
6569
|
}, onPaginationPrev = () => {
|
|
6392
6570
|
const imageLength = labelImages.value.length;
|
|
6393
6571
|
let i = activateNodeIndex.value - 1;
|
|
@@ -6396,30 +6574,35 @@
|
|
|
6396
6574
|
const imageLength = labelImages.value.length;
|
|
6397
6575
|
let i = activateNodeIndex.value + 1;
|
|
6398
6576
|
i >= imageLength && (i = 0), onChangeActivateNode(i), emit("next-click");
|
|
6399
|
-
}, canvasContextRef = vue.ref(), layoutLabelRef = vue.ref(), headerRef = vue.ref(), mainRef = vue.ref(), footerRef = vue.ref(), mainContentHeight = vue.ref(options.
|
|
6400
|
-
|
|
6401
|
-
|
|
6402
|
-
|
|
6403
|
-
layoutLabelRef.value.style.position = "unset";
|
|
6404
|
-
const contentHeight = (layoutLabelRef.value?.clientHeight || 0) - ((headerRef.value?.clientHeight || 0) + (footerRef.value?.clientHeight || 0));
|
|
6405
|
-
mainContentHeight.value = contentHeight;
|
|
6406
|
-
}));
|
|
6577
|
+
}, canvasContextRef = vue.ref(), layoutLabelRef = vue.ref(), headerRef = vue.ref(), mainRef = vue.ref(), footerRef = vue.ref(), mainContentHeight = vue.ref(options.minContentHeight), updateMainContentHeight = () => {
|
|
6578
|
+
vue.nextTick((() => {
|
|
6579
|
+
const contentHeight = (layoutLabelRef.value?.clientHeight || 0) - ((headerRef.value?.clientHeight || 0) + (footerRef.value?.clientHeight || 0));
|
|
6580
|
+
mainContentHeight.value = contentHeight;
|
|
6407
6581
|
}));
|
|
6582
|
+
};
|
|
6583
|
+
vue.onMounted((() => {
|
|
6584
|
+
document.addEventListener("keydown", onKeydownPrevNext), elementResize(layoutLabelRef.value.parentElement, (() => {
|
|
6585
|
+
updateMainContentHeight();
|
|
6586
|
+
})), window.addEventListener("resize", updateMainContentHeight);
|
|
6408
6587
|
})), vue.onUnmounted((() => {
|
|
6409
|
-
document.removeEventListener("keydown", onKeydownPrevNext);
|
|
6588
|
+
document.removeEventListener("keydown", onKeydownPrevNext), window.removeEventListener("resize", updateMainContentHeight);
|
|
6410
6589
|
}));
|
|
6411
6590
|
const onSelectLabelNode = (rect, index) => {
|
|
6412
6591
|
canvasContextRef.value.onSelectedLabel(rect, index);
|
|
6413
6592
|
}, onDeleteLabelNode = rect => {
|
|
6414
6593
|
canvasContextRef.value.onDeleteLabel(rect);
|
|
6594
|
+
}, isFullscreen = vue.ref(!1), onSwitchFillscreen = val => {
|
|
6595
|
+
isFullscreen.value = val, updateMainContentHeight(), vue.nextTick((() => {
|
|
6596
|
+
canvasContextRef.value.rerenderImage();
|
|
6597
|
+
}));
|
|
6415
6598
|
};
|
|
6416
6599
|
expose({
|
|
6417
6600
|
convertToLabel: convertToLabel,
|
|
6418
6601
|
canvertToCanvas: canvertToCanvas
|
|
6419
6602
|
});
|
|
6420
|
-
|
|
6603
|
+
const renderContent = () => vue.createVNode("div", {
|
|
6421
6604
|
ref: layoutLabelRef,
|
|
6422
|
-
class: [ ns$1.b(), props.className ],
|
|
6605
|
+
class: [ ns$1.b(), props.className, isFullscreen.value ? ns$1.b("fullscreen") : "" ],
|
|
6423
6606
|
style: {
|
|
6424
6607
|
...props.style
|
|
6425
6608
|
}
|
|
@@ -6432,21 +6615,35 @@
|
|
|
6432
6615
|
default: () => [ vue.createVNode("header", {
|
|
6433
6616
|
ref: headerRef,
|
|
6434
6617
|
class: [ ns$1.b("header") ]
|
|
6435
|
-
}, [ slots.header ? slots.header() : vue.createVNode(
|
|
6436
|
-
|
|
6437
|
-
|
|
6438
|
-
|
|
6439
|
-
|
|
6618
|
+
}, [ slots.header ? slots.header() : vue.createVNode(ToolHeader, {
|
|
6619
|
+
isFullscreen: isFullscreen.value,
|
|
6620
|
+
onFullscreen: onSwitchFillscreen,
|
|
6621
|
+
onSave: () => {
|
|
6622
|
+
onChangeActivateNode(activateNodeIndex.value) || elementPlus.ElMessage({
|
|
6623
|
+
type: "info",
|
|
6624
|
+
message: t("next.labelimg.labelNoUpdate")
|
|
6625
|
+
});
|
|
6440
6626
|
}
|
|
6441
|
-
},
|
|
6627
|
+
}, null) ]), vue.createVNode("div", {
|
|
6628
|
+
ref: mainRef,
|
|
6629
|
+
class: [ ns$1.b("main") ]
|
|
6630
|
+
}, [ vue.createVNode(elementPlus.ElScrollbar, {
|
|
6442
6631
|
class: [ ns$1.be("main", "content") ]
|
|
6443
|
-
},
|
|
6444
|
-
|
|
6445
|
-
|
|
6446
|
-
|
|
6447
|
-
|
|
6448
|
-
|
|
6449
|
-
|
|
6632
|
+
}, {
|
|
6633
|
+
default: () => [ vue.createVNode("div", {
|
|
6634
|
+
class: [ ns$1.be("main", "content") ],
|
|
6635
|
+
style: {
|
|
6636
|
+
height: mainContentHeight.value + "px"
|
|
6637
|
+
}
|
|
6638
|
+
}, [ vue.createVNode(CanvasContext, {
|
|
6639
|
+
ref: canvasContextRef,
|
|
6640
|
+
contextClientHeight: mainContentHeight.value,
|
|
6641
|
+
classes: classes.value,
|
|
6642
|
+
rowInfo: currentNode.value,
|
|
6643
|
+
onChange: onChangeNodeRect
|
|
6644
|
+
}, null) ]) ]
|
|
6645
|
+
}), vue.createVNode(RightLabel, {
|
|
6646
|
+
contentHeight: mainContentHeight.value,
|
|
6450
6647
|
classes: classes.value,
|
|
6451
6648
|
labels: activateNodeLabels.value,
|
|
6452
6649
|
onDelete: onDeleteLabelNode,
|
|
@@ -6491,7 +6688,8 @@
|
|
|
6491
6688
|
default: () => [ vue.createVNode(arrow_right_default, null, null) ]
|
|
6492
6689
|
}) ]) ]) ]
|
|
6493
6690
|
}) ]
|
|
6494
|
-
}) ])
|
|
6691
|
+
}) ]);
|
|
6692
|
+
return () => vue.createVNode(vue.Fragment, null, [ renderContent() ]);
|
|
6495
6693
|
}
|
|
6496
6694
|
});
|
|
6497
6695
|
const ns = useNamespace("labelimg-preview");
|
|
@@ -6623,7 +6821,7 @@
|
|
|
6623
6821
|
})(app);
|
|
6624
6822
|
};
|
|
6625
6823
|
var index = {
|
|
6626
|
-
version: "0.
|
|
6824
|
+
version: "0.3.1",
|
|
6627
6825
|
install: install
|
|
6628
6826
|
};
|
|
6629
6827
|
exports.NextContainer = NextContainer, exports.NextCrudTable = NextCrudTable, exports.NextCrudTableVirtualized = NextCrudTableVirtualized,
|
|
@@ -6669,7 +6867,7 @@
|
|
|
6669
6867
|
}), exports.useGetDerivedNamespace = useGetDerivedNamespace, exports.useLanguage = (locale, lang) => {
|
|
6670
6868
|
const localeRef = vue.isRef(locale) ? locale : vue.ref(locale), nextLang = localeLang[lang] || localeLang["zh-cn"];
|
|
6671
6869
|
localeRef.value.name = lang, localeRef.value.next = nextLang.next;
|
|
6672
|
-
}, exports.useLocale = useLocale, exports.useNamespace = useNamespace, exports.version = "0.
|
|
6870
|
+
}, exports.useLocale = useLocale, exports.useNamespace = useNamespace, exports.version = "0.3.1",
|
|
6673
6871
|
Object.defineProperty(exports, "__esModule", {
|
|
6674
6872
|
value: !0
|
|
6675
6873
|
});
|