next-element-vue 0.3.3 → 0.3.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.css +1 -1
- package/dist/index.js +330 -51
- package/dist/index.min.js +3 -3
- package/dist/index.umd.js +329 -51
- package/dist/index.umd.min.js +3 -3
- package/dist/packages/components/labelme/index.d.ts +4 -1
- package/dist/packages/components/labelme/src/index.d.ts +4 -1
- package/dist/packages/components/labelme/src/widgets/header-tool.d.ts +35 -0
- package/dist/packages/hooks/use-locale/index.d.ts +3 -0
- package/dist/packages/locale/lang/en.d.ts +6 -0
- package/dist/packages/locale/lang/zh-cn.d.ts +6 -0
- package/dist/packages/locale/lang/zh-tw.d.ts +3 -0
- package/package.json +2 -2
package/dist/index.css
CHANGED
|
@@ -13,4 +13,4 @@
|
|
|
13
13
|
.next-video-player{border-radius:5px;height:100%;min-height:200px;overflow:hidden;position:relative;width:100%}.next-video-player .vjs-default-skin{height:100%!important;left:0;min-height:200px;padding:unset!important;position:absolute;top:0;width:100%}.next-video-player .screemshot-btn{align-items:center;background-color:rgba(0,0,0,.6);border-radius:50%;cursor:pointer;display:inline-flex;height:45px;justify-content:center;opacity:0;position:absolute;right:10px;top:50%;transform:translateY(-50%);transition:all .5s ease-in-out;width:45px}.next-video-player .screemshot-btn i{transition:all .3s ease-in-out}.next-video-player .screemshot-btn:hover i{transform:scale(1.1)}.next-video-player:hover .screemshot-btn{opacity:1}.next-video-player-recongition{height:100%;left:0;pointer-events:none;position:absolute;top:0;width:100%;z-index:99}
|
|
14
14
|
.next-drag-resize{position:relative}
|
|
15
15
|
.next-labelimg-loading .next-spin-loading-mask__text{text-shadow:unset}.next-labelimg-fullscreen{background-color:#fff;bottom:0;left:0;overflow:hidden;position:fixed;right:0;top:0;transition:all .3s;z-index:999}.next-labelimg{border:1px solid #eee;border-radius:3px;box-sizing:border-box;height:100%;-webkit-user-select:none;-moz-user-select:none;user-select:none;width:100%}.next-labelimg-header{box-shadow:0 0 4px 0 rgba(0,0,0,.15);font-size:12px;justify-content:space-between;padding:10px 12px}.next-labelimg-header,.next-labelimg-header__tool,.next-labelimg-header__tool>li{align-items:center;display:flex}.next-labelimg-header__tool>li{cursor:pointer;margin:0 6px}.next-labelimg-header__tool>li.hover:hover{color:var(--el-color-primary)}.next-labelimg-header__tool>li.hover:hover svg{fill:var(--el-color-primary)}.next-labelimg-main{align-items:center;display:flex;justify-content:space-between}.next-labelimg-main__content{align-items:center;display:flex;flex:1 1 100%;justify-content:center}.next-labelimg-main .next-labelimg-loading{align-items:center;display:flex;justify-content:center;width:100%}.next-labelimg-main .next-labelimg-canvas{height:100%;min-height:500px;position:relative;width:100%}.next-labelimg-main .next-labelimg-canvas__context{height:100%;position:absolute;width:100%;z-index:3}.next-labelimg-main .next-labelimg-canvas__rect{height:100%;position:absolute;width:100%;z-index:1}.next-labelimg-main .next-labelimg-right{box-sizing:border-box;flex:0 0 200px;height:inherit;padding:10px;text-align:left}.next-labelimg-main .next-labelimg-right>ul{border-radius:5px;box-shadow:0 0 4px 0 rgba(0,0,0,.15);box-sizing:border-box;height:100%;padding:10px}.next-labelimg-main .next-labelimg-right>ul li{align-items:center;border:1px solid #ddd;border-radius:3px;display:flex;font-size:12px;justify-content:space-between;line-height:20px;margin:5px 0;padding:3px 6px}.next-labelimg-main .next-labelimg-right>ul li .el-icon{cursor:pointer}.next-labelimg-main .next-labelimg-right>ul li:hover{border:1px solid var(--el-color-primary)}.next-labelimg-main .next-labelimg-right>ul li .label-line{border-radius:3px;display:inline-block;height:10px;margin-right:6px;width:3px}.next-labelimg-footer{align-items:center;display:flex;justify-content:space-between;padding:20px 12px 8px}.next-labelimg-footer .left-right,.next-labelimg-footer .next-labelimg-footer__left,.next-labelimg-footer .next-labelimg-footer__right{align-items:center;display:flex;flex:0 0 50px;justify-content:center}.next-labelimg-footer .left-right .el-icon:hover,.next-labelimg-footer .next-labelimg-footer__left .el-icon:hover,.next-labelimg-footer .next-labelimg-footer__right .el-icon:hover{cursor:pointer}.next-labelimg-footer__center{flex:1 1 auto}.next-labelimg-footer__center--list{align-items:center;display:flex;flex-wrap:nowrap;justify-content:flex-start;min-height:80px}.next-labelimg-footer__center--list>li{background-color:#fff;border:1px solid #eee;box-sizing:border-box;cursor:pointer;flex:0 0 100px;height:80px;margin:0 5px;overflow:hidden;text-align:center}.next-labelimg-footer__center--list>li.is-activate,.next-labelimg-footer__center--list>li:hover{border:1px solid var(--el-color-primary)}.next-labelimg .next-labelimg-contextmenu-label{background-color:#fff;border-radius:8px;box-shadow:0 0 50px 3px #ccc;padding:10px 15px;position:fixed;transition:all .3s;white-space:nowrap;z-index:9999}.next-labelimg .next-labelimg-contextmenu-label>.label-head{align-items:center;display:flex;font-size:14px;justify-content:space-between;padding-bottom:10px}.next-labelimg .next-labelimg-contextmenu-label>.label-head .el-icon{transition:all .3s}.next-labelimg .next-labelimg-contextmenu-label>.label-head .el-icon:hover{cursor:pointer;transform:rotate(90deg)}.next-labelimg .next-labelimg-contextmenu-label>.label-main{scrollbar-face-color:transparent;scrollbar-3dlight-color:#aaa;scrollbar-highlight-color:#aaa;scrollbar-shadow-color:#aaa;scrollbar-base-color:#aaa;scrollbar-track-color:transparent;scrollbar-arrow-color:transparent;max-height:300px;overflow-y:auto}.next-labelimg .next-labelimg-contextmenu-label>.label-main::-webkit-scrollbar{background-color:transparent;border-radius:6px;height:10px;max-width:6px;width:6px}.next-labelimg .next-labelimg-contextmenu-label>.label-main::-webkit-scrollbar-thumb{background-color:hsla(0,0%,67%,.2);border-radius:6px}.next-labelimg .next-labelimg-contextmenu-label>.label-main::-webkit-scrollbar-thumb:hover{background-color:#aaa}.next-labelimg .next-labelimg-contextmenu-label>.label-main::-webkit-scrollbar-thumb:inactive{background-color:#eee}.next-labelimg .next-labelimg-contextmenu-label>.label-main:hover::-webkit-scrollbar-thumb{background-color:hsla(0,0%,67%,.5)}.next-labelimg .next-labelimg-contextmenu-label>.label-main::-webkit-scrollbar-track-piece{background-color:transparent;border-radius:6px}.next-labelimg .next-labelimg-contextmenu-label>.label-main::-webkit-resizer,.next-labelimg .next-labelimg-contextmenu-label>.label-main::-webkit-scrollbar-corner{background-color:transparent}.next-labelimg .next-labelimg-contextmenu-label>.label-main>li{align-items:center;display:flex;font-size:12px;padding:3px 0}.next-labelimg .next-labelimg-contextmenu-label>.label-main>li .label-line{border-radius:3px;display:inline-block;height:10px;margin-right:6px;width:3px}.next-labelimg .next-labelimg-contextmenu-label>.label-main>li.activate-label{color:var(--el-color-primary)}.next-labelimg .next-labelimg-draggable-rect{background-color:hsla(0,0%,99%,.5);cursor:move;position:absolute;z-index:999}.next-labelimg .next-labelimg-draggable-rect__resize{height:100%;position:relative;width:100%}.next-labelimg .next-labelimg-draggable-rect__resize .bottom-center,.next-labelimg .next-labelimg-draggable-rect__resize .bottom-left,.next-labelimg .next-labelimg-draggable-rect__resize .bottom-right,.next-labelimg .next-labelimg-draggable-rect__resize .dot,.next-labelimg .next-labelimg-draggable-rect__resize .left-center,.next-labelimg .next-labelimg-draggable-rect__resize .right-center,.next-labelimg .next-labelimg-draggable-rect__resize .top-center,.next-labelimg .next-labelimg-draggable-rect__resize .top-left,.next-labelimg .next-labelimg-draggable-rect__resize .top-right{background-color:var(--el-color-primary);border:1px solid var(--el-color-primary);box-sizing:border-box;height:10px;position:absolute;width:10px}.next-labelimg .next-labelimg-draggable-rect__resize .top-left{cursor:nw-resize;left:-5px;top:-5px}.next-labelimg .next-labelimg-draggable-rect__resize .top-center{cursor:s-resize;left:50%;top:-5px;transform:translateX(-50%)}.next-labelimg .next-labelimg-draggable-rect__resize .top-right{cursor:sw-resize;right:-5px;top:-5px}.next-labelimg .next-labelimg-draggable-rect__resize .left-center{cursor:w-resize;left:-5px;top:50%;transform:translateY(-50%)}.next-labelimg .next-labelimg-draggable-rect__resize .right-center{cursor:w-resize;right:-5px;top:50%;transform:translateY(-50%)}.next-labelimg .next-labelimg-draggable-rect__resize .bottom-left{bottom:-5px;cursor:sw-resize;left:-5px}.next-labelimg .next-labelimg-draggable-rect__resize .bottom-center{bottom:-5px;cursor:s-resize;left:50%;transform:translateX(-50%)}.next-labelimg .next-labelimg-draggable-rect__resize .bottom-right{bottom:-5px;cursor:nw-resize;right:-5px}.next-labelimg-preview{display:inline-block;height:100%}
|
|
16
|
-
.next-labelme-loading .next-spin-loading-mask__text{text-shadow:unset}.next-labelme{border:1px solid #eee;border-radius:3px;box-sizing:border-box;height:100%;-webkit-user-select:none;-moz-user-select:none;user-select:none;width:100%}.next-labelme-main{align-items:center;display:flex;justify-content:space-between}.next-labelme-main__content{align-items:center;display:flex;flex:1 1 100%;justify-content:center}.next-labelme-main .next-labelme-loading{align-items:center;display:flex;justify-content:center;width:100%}.next-labelme-main .next-labelme-canvas{height:100%;min-height:500px;position:relative;width:100%}.next-labelme-main .next-labelme-canvas__context{height:100%;position:absolute;width:100%;z-index:3}.next-labelme-main .next-labelme-canvas__rect{height:100%;position:absolute;width:100%;z-index:1}
|
|
16
|
+
.next-labelme-loading .next-spin-loading-mask__text{text-shadow:unset}.next-labelme-fullscreen{background-color:#fff;bottom:0;left:0;overflow:hidden;position:fixed;right:0;top:0;transition:all .3s;z-index:999}.next-labelme{border:1px solid #eee;border-radius:3px;box-sizing:border-box;height:100%;-webkit-user-select:none;-moz-user-select:none;user-select:none;width:100%}.next-labelme-header{box-shadow:0 0 4px 0 rgba(0,0,0,.15);font-size:12px;justify-content:space-between;padding:10px 12px}.next-labelme-header,.next-labelme-header__tool,.next-labelme-header__tool>li{align-items:center;display:flex}.next-labelme-header__tool>li{cursor:pointer;justify-content:center;margin:0 6px;text-align:center}.next-labelme-header__tool>li>.label-text{line-height:normal;margin:0;padding:5px 8px}.next-labelme-header__tool>li.tool-item{flex-direction:column}.next-labelme-header__tool>li.tool-item:hover{color:var(--el-color-primary)}.next-labelme-header__tool>li.tool-item:hover svg{fill:var(--el-color-primary)}.next-labelme-main{align-items:center;display:flex;justify-content:space-between}.next-labelme-main__content{align-items:center;display:flex;flex:1 1 100%;height:100%;justify-content:center}.next-labelme-main .next-labelme-loading{align-items:center;display:flex;justify-content:center;width:100%}.next-labelme-main .next-labelme-canvas{height:100%;min-height:500px;position:relative;width:100%}.next-labelme-main .next-labelme-canvas__context{height:100%;position:absolute;width:100%;z-index:3}.next-labelme-main .next-labelme-canvas__rect{height:100%;position:absolute;width:100%;z-index:1}.next-labelme-footer{align-items:center;display:flex;justify-content:space-between;padding:20px 12px 8px}.next-labelme-footer .left-right,.next-labelme-footer .next-labelme-footer__left,.next-labelme-footer .next-labelme-footer__right{align-items:center;display:flex;flex:0 0 50px;justify-content:center}.next-labelme-footer .left-right .el-icon:hover,.next-labelme-footer .next-labelme-footer__left .el-icon:hover,.next-labelme-footer .next-labelme-footer__right .el-icon:hover{cursor:pointer}.next-labelme-footer__center{flex:1 1 auto}.next-labelme-footer__center--list{align-items:center;display:flex;flex-wrap:nowrap;justify-content:flex-start;min-height:80px}.next-labelme-footer__center--list>li{background-color:#fff;border:1px solid #eee;box-sizing:border-box;cursor:pointer;flex:0 0 100px;height:80px;margin:0 5px;overflow:hidden;text-align:center}.next-labelme-footer__center--list>li.is-activate,.next-labelme-footer__center--list>li:hover{border:1px solid var(--el-color-primary)}
|
package/dist/index.js
CHANGED
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
/**
|
|
3
3
|
* 作 者:huangteng
|
|
4
4
|
* 邮 箱:htengweb@163.com
|
|
5
|
-
* 当前版本:0.3.
|
|
6
|
-
* 发布日期:2024-
|
|
5
|
+
* 当前版本:0.3.4 v
|
|
6
|
+
* 发布日期:2024-08-10
|
|
7
7
|
* 地 址:https://www.npmjs.com/package/next-element-vue
|
|
8
8
|
*/
|
|
9
9
|
|
|
@@ -896,6 +896,12 @@ var merge = createAssigner((function(object, source, srcIndex) {
|
|
|
896
896
|
saveLabel: "保存当前标注",
|
|
897
897
|
instructions: "使用说明",
|
|
898
898
|
labelNoUpdate: "暂无标签数据更新"
|
|
899
|
+
},
|
|
900
|
+
labelme: {
|
|
901
|
+
saveLabel: "保存",
|
|
902
|
+
createPolygon: "创建多边形",
|
|
903
|
+
editPolygon: "编辑多边形",
|
|
904
|
+
deletePolyton: "删除多边形"
|
|
899
905
|
}
|
|
900
906
|
}
|
|
901
907
|
}, enLocale = {
|
|
@@ -974,6 +980,12 @@ var merge = createAssigner((function(object, source, srcIndex) {
|
|
|
974
980
|
saveLabel: "save label",
|
|
975
981
|
instructions: "instructions",
|
|
976
982
|
labelNoUpdate: "No label data update"
|
|
983
|
+
},
|
|
984
|
+
labelme: {
|
|
985
|
+
saveLabel: "saving...",
|
|
986
|
+
createPolygon: "create polygon",
|
|
987
|
+
editPolygon: "edit polygon",
|
|
988
|
+
deletePolyton: "delete polygon"
|
|
977
989
|
}
|
|
978
990
|
}
|
|
979
991
|
}, zhtwLocale = {
|
|
@@ -1052,6 +1064,9 @@ var merge = createAssigner((function(object, source, srcIndex) {
|
|
|
1052
1064
|
saveLabel: "保存当前标注",
|
|
1053
1065
|
instructions: "使用说明",
|
|
1054
1066
|
labelNoUpdate: "暂无标签数据更新"
|
|
1067
|
+
},
|
|
1068
|
+
labelme: {
|
|
1069
|
+
saveLabel: "保存"
|
|
1055
1070
|
}
|
|
1056
1071
|
}
|
|
1057
1072
|
};
|
|
@@ -3501,7 +3516,7 @@ var NextSpinLoading$1 = defineComponent({
|
|
|
3501
3516
|
return start.setTime(start.getTime() - 94608e6), [ start, end ];
|
|
3502
3517
|
}
|
|
3503
3518
|
} ], _onChangeNumberRange = (value, key) => {
|
|
3504
|
-
formParams
|
|
3519
|
+
formParams[key] = value;
|
|
3505
3520
|
}, renderColItemContent = col => {
|
|
3506
3521
|
const _disabled = valueExist(col.searchDisabled, col.disabled, !1);
|
|
3507
3522
|
if (slots[searchFormSlotName(col.prop)]) return slots[searchFormSlotName(col.prop)]({
|
|
@@ -3532,7 +3547,7 @@ var NextSpinLoading$1 = defineComponent({
|
|
|
3532
3547
|
placeholder: placeholder,
|
|
3533
3548
|
onInput: e => ((val, key) => {
|
|
3534
3549
|
const value = val.replace(/\D/g, "");
|
|
3535
|
-
formParams
|
|
3550
|
+
formParams[key] = value;
|
|
3536
3551
|
})(e, col.prop)
|
|
3537
3552
|
}, {
|
|
3538
3553
|
prefix: col.prefix ? () => col.prefix(formParams, col) : null,
|
|
@@ -3553,7 +3568,7 @@ var NextSpinLoading$1 = defineComponent({
|
|
|
3553
3568
|
let value = val;
|
|
3554
3569
|
value = value.replace(/[^0-9\.]/g, ""), value = value.replace(/^\./, "0."), value = value.replace(/\.{2,}/g, "."),
|
|
3555
3570
|
value = value.replace(".", "DUMMY"), value = value.replace(/\./g, ""), value = value.replace("DUMMY", "."),
|
|
3556
|
-
formParams
|
|
3571
|
+
formParams[key] = value;
|
|
3557
3572
|
})(e, col.prop)
|
|
3558
3573
|
}, {
|
|
3559
3574
|
prefix: col.prefix ? () => col.prefix(formParams, col) : null,
|
|
@@ -7106,13 +7121,14 @@ class CreatePolygonVertexes {
|
|
|
7106
7121
|
this.canvas.style.cursor = "crosshair");
|
|
7107
7122
|
}
|
|
7108
7123
|
canvasMouseDblclick(e) {
|
|
7109
|
-
e.stopPropagation(), this.canvas.style.cursor = "unset", this.mouseOffset.x = e.offsetX,
|
|
7110
|
-
this.mouseOffset.y = e.offsetY, this.vertexes.push([ e.offsetX, e.offsetY ]), this.vertexes = vertexesUnique(this.vertexes),
|
|
7124
|
+
e.stopPropagation(), this.isDrawing && (this.canvas.style.cursor = "unset", this.mouseOffset.x = e.offsetX,
|
|
7125
|
+
this.mouseOffset.y = e.offsetY, this.vertexes.push([ e.offsetX, e.offsetY ]), this.vertexes = vertexesUnique(this.vertexes)),
|
|
7111
7126
|
this.notifyDestryedListerers(), this.destroyed();
|
|
7112
7127
|
}
|
|
7113
7128
|
destroyed() {
|
|
7114
|
-
this.isDrawing = !1, this.vertexes = [], this.vertexesObservers = [], this.
|
|
7115
|
-
|
|
7129
|
+
this.isDrawing = !1, this.vertexes = [], this.vertexesObservers = [], this.destroyedObservers = () => {
|
|
7130
|
+
this.canvas.removeEventListener("click", this.canvasMouseClick);
|
|
7131
|
+
}, this.canvas.removeEventListener("mousemove", this.canvasMousemove), this.canvas.removeEventListener("dblclick", this.canvasMouseDblclick);
|
|
7116
7132
|
}
|
|
7117
7133
|
}
|
|
7118
7134
|
|
|
@@ -7212,14 +7228,11 @@ class EditPolygonPath {
|
|
|
7212
7228
|
}
|
|
7213
7229
|
canvasMousedown(e) {
|
|
7214
7230
|
e.stopPropagation(), e.preventDefault(), this.canClickEvent = !0;
|
|
7215
|
-
const {offsetX: x, offsetY: y} = e;
|
|
7216
|
-
|
|
7217
|
-
|
|
7218
|
-
|
|
7219
|
-
|
|
7220
|
-
const i = this.pointInEdgeCentre(x, y);
|
|
7221
|
-
isValueExist(i) && (this.isMoveEditing = !0, this.pointCentreIndex = i + 1, this.vertexes.splice(this.pointCentreIndex, 0, [ x, y ]));
|
|
7222
|
-
}
|
|
7231
|
+
const {offsetX: x, offsetY: y} = e, vertex_i = this.pointInVertexes(x, y);
|
|
7232
|
+
isValueExist(vertex_i) && (this.isMoveEditing = !0, this.pointVertexIndex = vertex_i,
|
|
7233
|
+
this.vertexes.splice(this.pointVertexIndex, 1, [ x, y ]));
|
|
7234
|
+
const i = this.pointInEdgeCentre(x, y);
|
|
7235
|
+
isValueExist(i) && (this.isMoveEditing = !0, this.pointCentreIndex = i + 1, this.vertexes.splice(this.pointCentreIndex, 0, [ x, y ])),
|
|
7223
7236
|
setTimeout((() => {
|
|
7224
7237
|
this.canClickEvent = !1;
|
|
7225
7238
|
}), 200);
|
|
@@ -7235,8 +7248,7 @@ class EditPolygonPath {
|
|
|
7235
7248
|
canvasMouseClick(e) {
|
|
7236
7249
|
e.stopPropagation();
|
|
7237
7250
|
const {offsetX: x, offsetY: y} = e;
|
|
7238
|
-
if (this.
|
|
7239
|
-
e.stopImmediatePropagation();
|
|
7251
|
+
if (this.canClickEvent) {
|
|
7240
7252
|
const i = this.pointInVertexes(x, y);
|
|
7241
7253
|
if (isValueExist(i)) {
|
|
7242
7254
|
if (this.vertexes.length <= 3) return;
|
|
@@ -7273,8 +7285,8 @@ class CreateDrawCanvas {
|
|
|
7273
7285
|
const {canvas: canvas, ctx: ctx, image: image, canvasWidth: canvasWidth, canvasHeight: canvasHeight, paths: paths} = options;
|
|
7274
7286
|
this.canvas = canvas, this.ctx = ctx, this.image = image, this.canvasWidth = canvasWidth,
|
|
7275
7287
|
this.canvasHeight = canvasHeight, this.paths = paths || [], this.editVertexes = [],
|
|
7276
|
-
this.render(), this.
|
|
7277
|
-
this.createPolygonVertexes.vertexesChangeEventListener(((vertexes, mouseOffset) => {
|
|
7288
|
+
this.render(), this.createPolygonVertexes = new CreatePolygonVertexes(canvas, ctx),
|
|
7289
|
+
this.editDrawPolygon = new EditPolygonPath(canvas, ctx), this.createPolygonVertexes.vertexesChangeEventListener(((vertexes, mouseOffset) => {
|
|
7278
7290
|
this.render(), this.editDrawPolygon.drawPolygon(vertexes, mouseOffset), this.editVertexes = vertexes,
|
|
7279
7291
|
this.notifyObservers();
|
|
7280
7292
|
})), this.createPolygonVertexes.onDestroyed((vertexes => {
|
|
@@ -7335,8 +7347,12 @@ var CanvasContext = defineComponent({
|
|
|
7335
7347
|
}
|
|
7336
7348
|
},
|
|
7337
7349
|
emits: [ "editPolygon" ],
|
|
7338
|
-
setup(props, {emit: emit}) {
|
|
7339
|
-
const ns = inject("ns", {}), canvasMainRef = ref(), canvasBaseRef = ref(), drawCanvas = ref(),
|
|
7350
|
+
setup(props, {emit: emit, expose: expose}) {
|
|
7351
|
+
const ns = inject("ns", {}), canvasMainRef = ref(), canvasBaseRef = ref(), drawCanvas = ref(), setContainerWidthHeight = (canvasWidth, canvasHeight) => {
|
|
7352
|
+
canvasMainRef.value.style.width = canvasWidth + "px", canvasMainRef.value.style.height = canvasHeight + "px",
|
|
7353
|
+
canvasBaseRef.value.width = canvasWidth, canvasBaseRef.value.height = canvasHeight,
|
|
7354
|
+
canvasBaseRef.value.style.width = canvasWidth + "px", canvasBaseRef.value.style.height = canvasHeight + "px";
|
|
7355
|
+
}, loadingImage = ref(!1), renderImageLabel = rowInfo => {
|
|
7340
7356
|
const clientHeight = canvasMainRef.value?.clientHeight, ctx = canvasBaseRef.value?.getContext("2d");
|
|
7341
7357
|
if (rowInfo?.imageSrc) {
|
|
7342
7358
|
const image = new Image;
|
|
@@ -7348,11 +7364,7 @@ var CanvasContext = defineComponent({
|
|
|
7348
7364
|
height = clientHeight, image.style.height = height + "px", width /= scale;
|
|
7349
7365
|
}
|
|
7350
7366
|
const canvasHeight = height, scaleFactor = parseFloat((canvasHeight / height).toFixed(3)), canvasWidth = Math.ceil(width * scaleFactor);
|
|
7351
|
-
(
|
|
7352
|
-
canvasMainRef.value.style.width = canvasWidth + "px", canvasMainRef.value.style.height = canvasHeight + "px",
|
|
7353
|
-
canvasBaseRef.value.width = canvasWidth, canvasBaseRef.value.height = canvasHeight,
|
|
7354
|
-
canvasBaseRef.value.style.width = canvasWidth + "px", canvasBaseRef.value.style.height = canvasHeight + "px";
|
|
7355
|
-
})(canvasWidth, canvasHeight), drawCanvas.value = new CreateDrawCanvas({
|
|
7367
|
+
setContainerWidthHeight(canvasWidth, canvasHeight), drawCanvas.value = new CreateDrawCanvas({
|
|
7356
7368
|
canvas: canvasBaseRef.value,
|
|
7357
7369
|
ctx: ctx,
|
|
7358
7370
|
image: image,
|
|
@@ -7387,9 +7399,19 @@ var CanvasContext = defineComponent({
|
|
|
7387
7399
|
}
|
|
7388
7400
|
}));
|
|
7389
7401
|
}));
|
|
7390
|
-
return (
|
|
7402
|
+
return expose({
|
|
7403
|
+
rerenderImage: () => {
|
|
7404
|
+
setContainerWidthHeight(0, 0), nextTick((() => {
|
|
7405
|
+
const rowInfo = toRaw(props.rowInfo);
|
|
7406
|
+
renderImageLabel(rowInfo);
|
|
7407
|
+
}));
|
|
7408
|
+
}
|
|
7409
|
+
}), () => createVNode(Fragment, null, [ createVNode(NextSpinLoading, {
|
|
7391
7410
|
loading: loadingImage.value,
|
|
7392
|
-
class: [ ns.b("loading") ]
|
|
7411
|
+
class: [ ns.b("loading") ],
|
|
7412
|
+
style: {
|
|
7413
|
+
height: "100%"
|
|
7414
|
+
}
|
|
7393
7415
|
}, {
|
|
7394
7416
|
default: () => [ createVNode("div", {
|
|
7395
7417
|
ref: canvasMainRef,
|
|
@@ -7400,13 +7422,175 @@ var CanvasContext = defineComponent({
|
|
|
7400
7422
|
}, null) ]) ]
|
|
7401
7423
|
}) ]);
|
|
7402
7424
|
}
|
|
7425
|
+
}), HeaderTool = defineComponent({
|
|
7426
|
+
props: {
|
|
7427
|
+
isFullscreen: {
|
|
7428
|
+
type: Boolean,
|
|
7429
|
+
default: !1
|
|
7430
|
+
},
|
|
7431
|
+
imageIndex: {
|
|
7432
|
+
type: Number,
|
|
7433
|
+
default: 0
|
|
7434
|
+
},
|
|
7435
|
+
imageLength: {
|
|
7436
|
+
type: Number,
|
|
7437
|
+
default: 0
|
|
7438
|
+
}
|
|
7439
|
+
},
|
|
7440
|
+
emits: [ "fullscreen", "save" ],
|
|
7441
|
+
setup(props, {emit: emit}) {
|
|
7442
|
+
const _ns = inject("ns", {}), {t: t} = useLocale(), switchFillscreen = val => {
|
|
7443
|
+
emit("fullscreen", val);
|
|
7444
|
+
};
|
|
7445
|
+
return () => createVNode(Fragment, null, [ createVNode(Fragment, null, [ createVNode("ul", {
|
|
7446
|
+
class: [ _ns.be("header", "tool") ]
|
|
7447
|
+
}, [ createVNode("li", {
|
|
7448
|
+
class: "tool-item",
|
|
7449
|
+
onClick: () => emit("save")
|
|
7450
|
+
}, [ createVNode("svg", {
|
|
7451
|
+
t: "1719034799379",
|
|
7452
|
+
class: "icon",
|
|
7453
|
+
viewBox: "0 0 1024 1024",
|
|
7454
|
+
version: "1.1",
|
|
7455
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
7456
|
+
"p-id": "4272",
|
|
7457
|
+
width: "18",
|
|
7458
|
+
height: "18"
|
|
7459
|
+
}, [ createVNode("path", {
|
|
7460
|
+
d: "M831.4 252.2L711.5 132.4c-10.3-10.3-24.2-16.1-38.8-16.1h-450c-23.3 0-42.2 18.9-42.2 42.2v709.4c0 23.3 18.9 42.2 42.2 42.2h582.6c23.3 0 42.2-18.9 42.2-42.2V291c-0.1-14.5-5.8-28.5-16.1-38.8zM619.6 159v159.8c0 4-3.3 7.3-7.3 7.3H387.2c-4 0-7.3-3.3-7.3-7.3V159h239.7z m67.7 708.4H340.8v-292c0-3.9 3.2-7.1 7.1-7.1h332.4c3.9 0 7.1 3.2 7.1 7.1v292z m117.4 0H730v-292c0-27.5-22.3-49.8-49.8-49.8H347.8c-27.5 0-49.8 22.3-49.8 49.8v292h-74.7V159.1h113.9v159.8c0 27.6 22.4 50.1 50.1 50.1h225.1c27.6 0 50.1-22.4 50.1-50.1V159h10.4c3.2 0 6.3 1.3 8.6 3.6l119.9 119.9c2.3 2.3 3.6 5.3 3.6 8.6l-0.3 576.3z",
|
|
7461
|
+
"p-id": "4273"
|
|
7462
|
+
}, null), createVNode("path", {
|
|
7463
|
+
d: "M536 196.3h42.7v87.2H536zM368.7 641.2h220.7v42.7H368.7zM368.7 744h170.9v42.7H368.7z",
|
|
7464
|
+
"p-id": "4274"
|
|
7465
|
+
}, null) ]), createVNode("p", {
|
|
7466
|
+
class: "label-text"
|
|
7467
|
+
}, [ t("next.labelme.saveLabel") ]) ]), createVNode("li", {
|
|
7468
|
+
class: "tool-item"
|
|
7469
|
+
}, [ createVNode("svg", {
|
|
7470
|
+
t: "1721826305513",
|
|
7471
|
+
class: "icon",
|
|
7472
|
+
viewBox: "0 0 1025 1024",
|
|
7473
|
+
version: "1.1",
|
|
7474
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
7475
|
+
"p-id": "6215",
|
|
7476
|
+
width: "18",
|
|
7477
|
+
height: "18"
|
|
7478
|
+
}, [ createVNode("path", {
|
|
7479
|
+
d: "M358.5 1021.5c-52.93 0-96-43.07-96-96 0-13.12 2.6-25.84 7.74-37.81l0.12-0.27-141.99-184.66-0.34 0.11a95.806 95.806 0 0 1-29.53 4.64c-52.93 0-96-43.07-96-96s43.07-96 96-96c7.56 0 15.09 0.89 22.41 2.64l0.36 0.09 213.67-370.08-0.16-0.25c-9.34-15.12-14.28-32.54-14.28-50.39 0-52.93 43.07-96 96-96 40.36 0 76.66 25.5 90.34 63.46l0.09 0.26 300.27 61.72 0.19-0.26c18.01-25.16 47.21-40.18 78.11-40.18 52.93 0 96 43.07 96 96 0 36.49-20.26 69.36-52.88 85.79l-0.31 0.16 41.76 393.5 0.25 0.12a96.184 96.184 0 0 1 39.11 34.79c9.85 15.41 15.06 33.27 15.06 51.65 0 52.93-43.07 96-96 96-31.18 0-60.53-15.24-78.52-40.76l-0.22-0.31-396.7 138.78-0.05 0.29c-8.2 45.76-47.94 78.97-94.5 78.97z m0-192c34.03 0 64.82 17.44 82.36 46.66l0.21 0.35L832.93 739.4l0.03-0.32c3.81-39.11 31.82-72.49 69.7-83.05l0.41-0.11-40.34-380.14-0.34-0.08c-39.73-9.82-68.86-43.81-72.49-84.56l-0.03-0.37-283.9-58.36-0.15 0.39c-7 17.7-19.01 32.81-34.72 43.69-16.08 11.13-34.96 17.02-54.59 17.02-9.75 0-19.37-1.46-28.59-4.33l-0.38-0.12L176.19 555.1l0.19 0.26c11.86 16.42 18.12 35.83 18.12 56.14 0 17.74-4.88 35.06-14.11 50.11l-0.18 0.29 136.28 177.25 0.37-0.18c13.04-6.28 27.05-9.47 41.64-9.47z",
|
|
7480
|
+
"p-id": "6216"
|
|
7481
|
+
}, null), createVNode("path", {
|
|
7482
|
+
d: "M416.5 2c40.15 0 76.26 25.37 89.87 63.13l0.19 0.53 0.55 0.11 299.68 61.6 0.64 0.13 0.38-0.53c8.66-12.1 20.19-22.15 33.34-29.06C854.71 90.77 870.06 87 885.5 87c52.66 0 95.5 42.84 95.5 95.5 0 18.03-5.05 35.58-14.6 50.77a95.81 95.81 0 0 1-38 34.57l-0.62 0.31 0.07 0.69 41.7 392.88 0.06 0.55 0.5 0.24c15.91 7.71 29.36 19.68 38.91 34.61 9.8 15.33 14.98 33.09 14.98 51.38 0 52.66-42.84 95.5-95.5 95.5-31.02 0-60.22-15.16-78.11-40.55l-0.43-0.62-0.71 0.25-396.09 138.59-0.55 0.19-0.1 0.57c-3.9 21.77-15.4 41.67-32.39 56.03-17.2 14.54-39.08 22.54-61.62 22.54-52.66 0-95.5-42.84-95.5-95.5 0-13.05 2.59-25.71 7.7-37.61l0.23-0.54-0.36-0.46-141.59-184.16-0.43-0.56-0.67 0.22A95.43 95.43 0 0 1 98.5 707C45.84 707 3 664.16 3 611.5S45.84 516 98.5 516c7.52 0 15.01 0.88 22.29 2.62l0.73 0.17 0.37-0.65 213.33-369.5 0.3-0.52-0.31-0.51c-9.29-15.04-14.2-32.37-14.2-50.12C321 44.84 363.84 2 416.5 2m0 191c-9.7 0-19.27-1.45-28.44-4.31l-0.76-0.24-0.4 0.69-210.98 365.43-0.32 0.56 0.38 0.52C187.77 571.99 194 591.3 194 611.5c0 17.64-4.85 34.88-14.03 49.85l-0.36 0.59 0.42 0.55 135.82 176.65 0.5 0.64 0.73-0.35c12.97-6.26 26.91-9.43 41.42-9.43 16.79 0 33.3 4.42 47.75 12.78a96.095 96.095 0 0 1 34.18 33.63l0.42 0.7 0.77-0.27 391.17-136.87 0.6-0.21 0.06-0.64c1.88-19.33 9.53-37.41 22.11-52.28 12.44-14.71 28.77-25.2 47.22-30.35l0.82-0.23-0.09-0.84-40.26-379.37-0.07-0.7-0.68-0.17c-39.52-9.77-68.5-43.58-72.11-84.12l-0.07-0.74-0.73-0.15-283.12-58.2-0.82-0.17-0.31 0.78c-6.96 17.61-18.91 32.64-34.54 43.46-15.99 11.11-34.77 16.96-54.3 16.96m0-192C363.2 1 320 44.2 320 97.5c0 18.58 5.26 35.93 14.35 50.65l-213.33 369.5A96.669 96.669 0 0 0 98.5 515C45.2 515 2 558.2 2 611.5S45.2 708 98.5 708a96.5 96.5 0 0 0 29.69-4.66l141.59 184.15c-5 11.66-7.78 24.51-7.78 38.01 0 53.3 43.2 96.5 96.5 96.5 47.46 0 86.91-34.25 94.99-79.39l396.08-138.59C867.04 828.81 895.88 845 928.5 845c53.3 0 96.5-43.2 96.5-96.5 0-38.22-22.23-71.26-54.46-86.88l-41.7-392.88C960.37 252.86 982 220.21 982 182.5c0-53.3-43.2-96.5-96.5-96.5-32.37 0-61.01 15.94-78.51 40.39l-299.68-61.6C493.91 27.59 458.31 1 416.5 1z m0 193c40.77 0 75.63-25.28 89.77-61.03l283.12 58.2c3.69 41.4 33.52 75.27 72.87 85l40.26 379.37c-37.74 10.53-66.15 43.41-70.06 83.49L441.29 875.9c-16.87-28.1-47.63-46.9-82.79-46.9-15 0-29.2 3.42-41.86 9.53L180.82 661.88c8.99-14.66 14.18-31.91 14.18-50.38 0-21.07-6.76-40.56-18.22-56.43l210.98-365.42c9.08 2.83 18.73 4.35 28.74 4.35z",
|
|
7483
|
+
"p-id": "6217"
|
|
7484
|
+
}, null) ]), createVNode("p", {
|
|
7485
|
+
class: "label-text"
|
|
7486
|
+
}, [ t("next.labelme.createPolygon") ]) ]), createVNode("li", {
|
|
7487
|
+
class: "tool-item"
|
|
7488
|
+
}, [ createVNode("svg", {
|
|
7489
|
+
t: "1721826424613",
|
|
7490
|
+
class: "icon",
|
|
7491
|
+
viewBox: "0 0 1024 1024",
|
|
7492
|
+
version: "1.1",
|
|
7493
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
7494
|
+
"p-id": "7356",
|
|
7495
|
+
width: "18",
|
|
7496
|
+
height: "18"
|
|
7497
|
+
}, [ createVNode("path", {
|
|
7498
|
+
d: "M102.4 870.4v51.2h102.4v51.2H51.2v-102.4h51.2z m870.4-51.2v153.6h-102.4v-51.2h51.2v-102.4h51.2zM409.6 921.6v51.2H358.4v-51.2h51.2z m102.4 0v51.2H460.8v-51.2h51.2z m102.4 0v51.2h-51.2v-51.2h51.2z m102.4 0v51.2h-51.2v-51.2h51.2z m102.4 0v51.2h-51.2v-51.2h51.2zM307.2 921.6v51.2H256v-51.2h51.2z m204.8-742.4a51.2 51.2 0 0 1 51.0464 55.0912l118.8352 68.608a102.4 102.4 0 1 1 96.1536 157.3888v155.136a51.2 51.2 0 1 1-51.6096 80.0256L556.3392 793.6a51.2 51.2 0 1 1-88.7296 0.0512l-169.984-98.2016A51.1488 51.1488 0 0 1 204.8 665.6a51.2 51.2 0 0 1 41.1136-50.176V408.576a51.2 51.2 0 1 1 51.712-79.9744l163.3792-94.3616L460.8 230.4a51.2 51.2 0 0 1 45.2096-50.8416zM102.4 768v51.2H51.2v-51.2h51.2z m870.4-51.2v51.2h-51.2v-51.2h51.2zM297.0624 412.8768l0.1024 222.208 1.024 1.536L486.4 745.2672v-188.928a51.2 51.2 0 0 1-25.2416-38.4L460.8 512v-0.8704L297.0624 412.8768z m399.0528 18.432L563.2 511.1808 563.2 512a51.2 51.2 0 0 1-25.5488 44.3392l-0.0512 188.8768 188.2624-108.6976 0.9216-1.28V452.096a102.6048 102.6048 0 0 1-30.6688-20.7872zM102.4 665.6v51.2H51.2v-51.2h51.2z m870.4-51.2v51.2h-51.2v-51.2h51.2zM102.4 563.2v51.2H51.2v-51.2h51.2z m870.4-51.2v51.2h-51.2v-51.2h51.2zM102.4 460.8v51.2H51.2V460.8h51.2z m387.584-184.1664L326.6048 370.8928l160.6144 96.256a50.8416 50.8416 0 0 1 18.7904-5.9904L512 460.8c9.0112 0 17.5104 2.3552 24.832 6.4l132.9664-79.7184a102.4 102.4 0 0 1-4.0448-34.7648l-131.7888-76.032a50.9952 50.9952 0 0 1-43.9808 0zM972.8 409.6v51.2h-51.2V409.6h51.2zM102.4 358.4v51.2H51.2V358.4h51.2z m870.4-51.2v51.2h-51.2V307.2h51.2zM102.4 256v51.2H51.2V256h51.2z m870.4-51.2v51.2h-51.2V204.8h51.2zM153.6 51.2v51.2H102.4v102.4H51.2V51.2h102.4z m819.2 0v102.4h-51.2V102.4h-102.4V51.2h153.6z m-409.6 0v51.2h-51.2V51.2h51.2z m102.4 0v51.2h-51.2V51.2h51.2z m102.4 0v51.2h-51.2V51.2h51.2zM256 51.2v51.2H204.8V51.2h51.2z m102.4 0v51.2H307.2V51.2h51.2z m102.4 0v51.2H409.6V51.2h51.2z",
|
|
7499
|
+
"p-id": "7357"
|
|
7500
|
+
}, null) ]), createVNode("p", {
|
|
7501
|
+
class: "label-text"
|
|
7502
|
+
}, [ t("next.labelme.editPolygon") ]) ]), createVNode("li", {
|
|
7503
|
+
class: "tool-item"
|
|
7504
|
+
}, [ createVNode("svg", {
|
|
7505
|
+
t: "1721826579655",
|
|
7506
|
+
class: "icon",
|
|
7507
|
+
viewBox: "0 0 1024 1024",
|
|
7508
|
+
version: "1.1",
|
|
7509
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
7510
|
+
"p-id": "10996",
|
|
7511
|
+
width: "18",
|
|
7512
|
+
height: "18"
|
|
7513
|
+
}, [ createVNode("path", {
|
|
7514
|
+
d: "M847.743 223.953H640.639c-3.132-68.921-60.177-124.029-129.858-124.029s-126.726 55.108-129.858 124.029H173.256c-17.673 0-32 14.327-32 32s14.327 32 32 32h674.487c17.673 0 32-14.327 32-32s-14.327-32-32-32z m-336.962-60.03c34.379 0 62.689 26.426 65.718 60.029H445.064c3.029-33.603 31.338-60.029 65.717-60.029zM767.743 351.79c-17.673 0-32 14.327-32 32v478.173H288.256V383.79c0-17.673-14.327-32-32-32s-32 14.327-32 32v510.173c0 17.673 14.327 32 32 32h511.487c17.673 0 32-14.327 32-32V383.79c0-17.673-14.327-32-32-32z",
|
|
7515
|
+
"p-id": "10997"
|
|
7516
|
+
}, null), createVNode("path", {
|
|
7517
|
+
d: "M449.306 732.802V448.208c0-17.673-14.327-32-32-32s-32 14.327-32 32v284.593c0 17.673 14.327 32 32 32s32-14.326 32-31.999z m191.534 0V448.208c0-17.673-14.327-32-32-32s-32 14.327-32 32v284.593c0 17.673 14.327 32 32 32s32-14.326 32-31.999z",
|
|
7518
|
+
"p-id": "10998"
|
|
7519
|
+
}, null) ]), createVNode("p", {
|
|
7520
|
+
class: "label-text"
|
|
7521
|
+
}, [ t("next.labelme.deletePolyton") ]) ]) ]), createVNode("ul", {
|
|
7522
|
+
class: [ _ns.be("header", "tool") ]
|
|
7523
|
+
}, [ props.imageLength ? createVNode("li", null, [ createVNode("span", null, [ createTextVNode("第 "), props.imageIndex + 1, createTextVNode(" 张") ]), createVNode("em", {
|
|
7524
|
+
style: "padding: 0 5px;"
|
|
7525
|
+
}, [ createTextVNode("/") ]), createVNode("span", null, [ createTextVNode("共 "), props.imageLength, createTextVNode(" 张") ]) ]) : null, createVNode("li", {
|
|
7526
|
+
style: "margin-right: 30px;",
|
|
7527
|
+
class: "tool-item"
|
|
7528
|
+
}, [ createVNode(ElPopover, {
|
|
7529
|
+
trigger: "hover",
|
|
7530
|
+
placement: "bottom",
|
|
7531
|
+
width: "none"
|
|
7532
|
+
}, {
|
|
7533
|
+
reference: () => createVNode("div", {
|
|
7534
|
+
class: "flex-center"
|
|
7535
|
+
}, [ createVNode("span", {
|
|
7536
|
+
style: "padding-right: 3px"
|
|
7537
|
+
}, [ t("next.labelimg.instructions") ]), createVNode(ElIcon, {
|
|
7538
|
+
size: 14
|
|
7539
|
+
}, {
|
|
7540
|
+
default: () => [ createVNode(warning_default, null, null) ]
|
|
7541
|
+
}) ]),
|
|
7542
|
+
default: () => createVNode("ul", {
|
|
7543
|
+
style: "font-size: 12px;white-space: nowrap;"
|
|
7544
|
+
}, [ createVNode("li", null, [ createVNode("span", null, [ createTextVNode("A:") ]), createVNode("span", null, [ createTextVNode("A键进入上一张图片进行标注") ]) ]), createVNode("li", null, [ createVNode("span", null, [ createTextVNode("D:") ]), createVNode("span", null, [ createTextVNode("D键进入下一张图片进行标注") ]) ]) ])
|
|
7545
|
+
}) ]), props.isFullscreen ? createVNode("li", {
|
|
7546
|
+
class: "tool-item",
|
|
7547
|
+
onClick: () => switchFillscreen(!1)
|
|
7548
|
+
}, [ createVNode(ElTooltip, {
|
|
7549
|
+
placement: "top",
|
|
7550
|
+
content: "取消全屏"
|
|
7551
|
+
}, {
|
|
7552
|
+
default: () => [ createVNode("svg", {
|
|
7553
|
+
t: "1719035442027",
|
|
7554
|
+
class: "icon",
|
|
7555
|
+
viewBox: "0 0 1024 1024",
|
|
7556
|
+
version: "1.1",
|
|
7557
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
7558
|
+
"p-id": "5388",
|
|
7559
|
+
width: "18",
|
|
7560
|
+
height: "18"
|
|
7561
|
+
}, [ createVNode("path", {
|
|
7562
|
+
d: "M354.133333 682.666667H256v-42.666667h170.666667v170.666667H384v-98.133334L243.2 853.333333l-29.866667-29.866666L354.133333 682.666667z m358.4 0l140.8 140.8-29.866666 29.866666-140.8-140.8V810.666667h-42.666667v-170.666667h170.666667v42.666667h-98.133334zM354.133333 384L213.333333 243.2l29.866667-29.866667L384 354.133333V256h42.666667v170.666667H256V384h98.133333z m358.4 0H810.666667v42.666667h-170.666667V256h42.666667v98.133333L823.466667 213.333333l29.866666 29.866667L712.533333 384z",
|
|
7563
|
+
"p-id": "5389"
|
|
7564
|
+
}, null) ]) ]
|
|
7565
|
+
}) ]) : createVNode("li", {
|
|
7566
|
+
class: "tool-item",
|
|
7567
|
+
onClick: () => switchFillscreen(!0)
|
|
7568
|
+
}, [ createVNode(ElTooltip, {
|
|
7569
|
+
placement: "top",
|
|
7570
|
+
content: "全屏"
|
|
7571
|
+
}, {
|
|
7572
|
+
default: () => [ createVNode("svg", {
|
|
7573
|
+
t: "1719035375323",
|
|
7574
|
+
class: "icon",
|
|
7575
|
+
viewBox: "0 0 1024 1024",
|
|
7576
|
+
version: "1.1",
|
|
7577
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
7578
|
+
"p-id": "5241",
|
|
7579
|
+
width: "18",
|
|
7580
|
+
height: "18"
|
|
7581
|
+
}, [ createVNode("path", {
|
|
7582
|
+
d: "M285.866667 810.666667H384v42.666666H213.333333v-170.666666h42.666667v98.133333l128-128 29.866667 29.866667-128 128z m494.933333 0l-128-128 29.866667-29.866667 128 128V682.666667h42.666666v170.666666h-170.666666v-42.666666h98.133333zM285.866667 256l128 128-29.866667 29.866667-128-128V384H213.333333V213.333333h170.666667v42.666667H285.866667z m494.933333 0H682.666667V213.333333h170.666666v170.666667h-42.666666V285.866667l-128 128-29.866667-29.866667 128-128z",
|
|
7583
|
+
"p-id": "5242"
|
|
7584
|
+
}, null) ]) ]
|
|
7585
|
+
}) ]) ]) ]) ]);
|
|
7586
|
+
}
|
|
7403
7587
|
}), defaultConfig = {
|
|
7404
7588
|
minContentHeight: 500
|
|
7405
7589
|
};
|
|
7406
7590
|
|
|
7407
7591
|
const ns = useNamespace("labelme");
|
|
7408
7592
|
|
|
7409
|
-
|
|
7593
|
+
var Element = defineComponent({
|
|
7410
7594
|
name: "NextLabelme",
|
|
7411
7595
|
props: {
|
|
7412
7596
|
className: {
|
|
@@ -7430,14 +7614,14 @@ const NextLabelme = withInstall(defineComponent({
|
|
|
7430
7614
|
default: () => []
|
|
7431
7615
|
}
|
|
7432
7616
|
},
|
|
7433
|
-
emits: [ "change", "edit-polygon" ],
|
|
7434
|
-
setup(props, {emit: emit}) {
|
|
7617
|
+
emits: [ "change", "save", "edit-polygon", "prev-click", "next-click" ],
|
|
7618
|
+
setup(props, {emit: emit, slots: slots}) {
|
|
7435
7619
|
const _config = deepClone(defaultConfig), _options = computed((() => {
|
|
7436
7620
|
const cfg = unref(props.options);
|
|
7437
7621
|
return merge$1(_config, cfg);
|
|
7438
7622
|
})), options = unref(_options);
|
|
7439
|
-
provide("ns", ns)
|
|
7440
|
-
const activateNodeIndex = ref(0), classes = ref(props.classes), labelImages = ref(deepClone(props.data));
|
|
7623
|
+
provide("ns", ns);
|
|
7624
|
+
const {t: t} = useLocale(), activateNodeIndex = ref(0), classes = ref(props.classes), labelImages = ref(deepClone(props.data));
|
|
7441
7625
|
watch((() => props.data), (data => {
|
|
7442
7626
|
labelImages.value = deepClone(data);
|
|
7443
7627
|
}), {
|
|
@@ -7453,28 +7637,123 @@ const NextLabelme = withInstall(defineComponent({
|
|
|
7453
7637
|
if (!labelImages.value) return {};
|
|
7454
7638
|
const node = labelImages.value[activateNodeIndex.value] || {};
|
|
7455
7639
|
return deepClone(node);
|
|
7456
|
-
})), mainContentHeight = ref(options.minContentHeight), mainRef = ref(),
|
|
7640
|
+
})), loading = ref(!1), mainContentHeight = ref(options.minContentHeight), canvasContextRef = ref(), layoutLabelRef = ref(), headerRef = ref(), mainRef = ref(), footerRef = ref(), updateMainContentHeight = () => {
|
|
7641
|
+
nextTick((() => {
|
|
7642
|
+
const contentHeight = (layoutLabelRef.value?.clientHeight || 0) - ((headerRef.value?.clientHeight || 0) + (footerRef.value?.clientHeight || 0));
|
|
7643
|
+
mainContentHeight.value = contentHeight;
|
|
7644
|
+
}));
|
|
7645
|
+
};
|
|
7646
|
+
onMounted((() => {
|
|
7647
|
+
document.addEventListener("keydown", onKeydownPrevNext), elementResize(layoutLabelRef.value.parentElement, (() => {
|
|
7648
|
+
updateMainContentHeight();
|
|
7649
|
+
})), window.addEventListener("resize", updateMainContentHeight);
|
|
7650
|
+
})), onUnmounted((() => {
|
|
7651
|
+
document.removeEventListener("keydown", onKeydownPrevNext), window.removeEventListener("resize", updateMainContentHeight);
|
|
7652
|
+
}));
|
|
7653
|
+
const onKeydownPrevNext = () => {}, onPaginationPrev = () => {
|
|
7654
|
+
const imageLength = labelImages.value.length;
|
|
7655
|
+
let i = activateNodeIndex.value - 1;
|
|
7656
|
+
i < 0 && (i = imageLength - 1), onChangeActivateNode(i), emit("prev-click");
|
|
7657
|
+
}, onPaginationNext = () => {
|
|
7658
|
+
const imageLength = labelImages.value.length;
|
|
7659
|
+
let i = activateNodeIndex.value + 1;
|
|
7660
|
+
i >= imageLength && (i = 0), onChangeActivateNode(i), emit("next-click");
|
|
7661
|
+
}, onChangeActivateNode = index => {
|
|
7662
|
+
if (loading.value) return;
|
|
7663
|
+
loading.value = !0;
|
|
7664
|
+
const node = currentNode.value;
|
|
7665
|
+
emit("save", {
|
|
7666
|
+
node: node
|
|
7667
|
+
}, (imageItem => {
|
|
7668
|
+
labelImages.value[activateNodeIndex.value] = imageItem || node, activateNodeIndex.value = index,
|
|
7669
|
+
loading.value = !1;
|
|
7670
|
+
}), (() => {
|
|
7671
|
+
loading.value = !1;
|
|
7672
|
+
}));
|
|
7673
|
+
}, isFullscreen = ref(!1), onSwitchFillscreen = val => {
|
|
7674
|
+
isFullscreen.value = val, updateMainContentHeight(), nextTick((() => {
|
|
7675
|
+
canvasContextRef.value.rerenderImage();
|
|
7676
|
+
}));
|
|
7677
|
+
}, onEditPlygonChange = plygon => {
|
|
7457
7678
|
emit("edit-polygon", plygon);
|
|
7458
7679
|
};
|
|
7459
7680
|
return () => createVNode(Fragment, null, [ createVNode("div", {
|
|
7681
|
+
ref: layoutLabelRef,
|
|
7460
7682
|
class: [ ns.b(), props.className, isFullscreen.value ? ns.b("fullscreen") : "" ],
|
|
7461
7683
|
style: {
|
|
7462
7684
|
...props.style
|
|
7463
7685
|
}
|
|
7464
|
-
}, [ createVNode(
|
|
7465
|
-
|
|
7466
|
-
|
|
7467
|
-
|
|
7468
|
-
|
|
7469
|
-
|
|
7470
|
-
|
|
7471
|
-
|
|
7472
|
-
|
|
7473
|
-
|
|
7474
|
-
|
|
7475
|
-
|
|
7686
|
+
}, [ createVNode(NextSpinLoading, {
|
|
7687
|
+
loading: loading.value,
|
|
7688
|
+
tip: t("next.labelimg.saveTxt"),
|
|
7689
|
+
class: [ ns.b("loading") ]
|
|
7690
|
+
}, {
|
|
7691
|
+
default: () => [ createVNode(ElScrollbar, null, {
|
|
7692
|
+
default: () => [ createVNode("header", {
|
|
7693
|
+
ref: headerRef,
|
|
7694
|
+
class: [ ns.b("header") ]
|
|
7695
|
+
}, [ slots.header ? slots.header() : createVNode(HeaderTool, {
|
|
7696
|
+
isFullscreen: isFullscreen.value,
|
|
7697
|
+
imageIndex: activateNodeIndex.value,
|
|
7698
|
+
imageLength: labelImages.value.length,
|
|
7699
|
+
onFullscreen: onSwitchFillscreen
|
|
7700
|
+
}, null) ]), createVNode("div", {
|
|
7701
|
+
ref: mainRef,
|
|
7702
|
+
class: [ ns.b("main") ]
|
|
7703
|
+
}, [ createVNode("div", {
|
|
7704
|
+
class: [ ns.be("main", "content") ],
|
|
7705
|
+
style: {
|
|
7706
|
+
height: mainContentHeight.value + "px"
|
|
7707
|
+
}
|
|
7708
|
+
}, [ createVNode(CanvasContext, {
|
|
7709
|
+
ref: canvasContextRef,
|
|
7710
|
+
rowInfo: currentNode.value,
|
|
7711
|
+
onEditPolygon: onEditPlygonChange
|
|
7712
|
+
}, null) ]) ]), createVNode("footer", {
|
|
7713
|
+
ref: footerRef,
|
|
7714
|
+
class: [ ns.b("footer") ]
|
|
7715
|
+
}, [ createVNode("div", {
|
|
7716
|
+
class: [ ns.be("footer", "left") ]
|
|
7717
|
+
}, [ createVNode(ElIcon, {
|
|
7718
|
+
size: 24,
|
|
7719
|
+
color: "#797979",
|
|
7720
|
+
onClick: onPaginationPrev
|
|
7721
|
+
}, {
|
|
7722
|
+
default: () => [ createVNode(arrow_left_default, null, null) ]
|
|
7723
|
+
}) ]), createVNode("div", {
|
|
7724
|
+
class: [ ns.be("footer", "center") ]
|
|
7725
|
+
}, [ createVNode(ElScrollbar, null, {
|
|
7726
|
+
default: () => [ createVNode("ul", {
|
|
7727
|
+
class: [ ns.bem("footer", "center", "list") ]
|
|
7728
|
+
}, [ labelImages.value.map(((item, index) => createVNode("li", {
|
|
7729
|
+
key: index,
|
|
7730
|
+
onClick: () => onChangeActivateNode(index),
|
|
7731
|
+
class: {
|
|
7732
|
+
"is-activate": activateNodeIndex.value === index
|
|
7733
|
+
}
|
|
7734
|
+
}, [ createVNode(ElImage, {
|
|
7735
|
+
style: "height: 100%",
|
|
7736
|
+
src: item.imageSrc,
|
|
7737
|
+
"zoom-rate": 1.2,
|
|
7738
|
+
"max-scale": 2,
|
|
7739
|
+
"min-scale": .2,
|
|
7740
|
+
fit: "cover"
|
|
7741
|
+
}, null) ]))) ]) ]
|
|
7742
|
+
}) ]), createVNode("div", {
|
|
7743
|
+
class: [ ns.be("footer", "right") ]
|
|
7744
|
+
}, [ createVNode(ElIcon, {
|
|
7745
|
+
size: 24,
|
|
7746
|
+
color: "#797979",
|
|
7747
|
+
onClick: onPaginationNext
|
|
7748
|
+
}, {
|
|
7749
|
+
default: () => [ createVNode(arrow_right_default, null, null) ]
|
|
7750
|
+
}) ]) ]) ]
|
|
7751
|
+
}) ]
|
|
7752
|
+
}) ]) ]);
|
|
7476
7753
|
}
|
|
7477
|
-
})
|
|
7754
|
+
});
|
|
7755
|
+
|
|
7756
|
+
const NextLabelme = withInstall(Element);
|
|
7478
7757
|
|
|
7479
7758
|
var components = Object.freeze({
|
|
7480
7759
|
__proto__: null,
|
|
@@ -7529,7 +7808,7 @@ const zoomDialog = app => {
|
|
|
7529
7808
|
}));
|
|
7530
7809
|
}
|
|
7531
7810
|
});
|
|
7532
|
-
}, version = "0.3.
|
|
7811
|
+
}, version = "0.3.4", install = function(app) {
|
|
7533
7812
|
Object.keys(components).forEach((key => {
|
|
7534
7813
|
const component = components[key];
|
|
7535
7814
|
app.component(component.name, component);
|
|
@@ -7539,7 +7818,7 @@ const zoomDialog = app => {
|
|
|
7539
7818
|
};
|
|
7540
7819
|
|
|
7541
7820
|
var index = {
|
|
7542
|
-
version: "0.3.
|
|
7821
|
+
version: "0.3.4",
|
|
7543
7822
|
install: install
|
|
7544
7823
|
};
|
|
7545
7824
|
|