next-element-vue 0.3.1 → 0.3.2

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.umd.js CHANGED
@@ -2,8 +2,8 @@
2
2
  /**
3
3
  * 作  者:huangteng
4
4
  * 邮  箱:htengweb@163.com
5
- * 当前版本:0.3.1 v
6
- * 发布日期:2024-06-22
5
+ * 当前版本:0.3.2 v
6
+ * 发布日期:2024-06-27
7
7
  * 地  址:https://www.npmjs.com/package/next-element-vue
8
8
  */
9
9
 
@@ -3159,6 +3159,8 @@
3159
3159
  settingBtn: !0,
3160
3160
  operations: !0,
3161
3161
  operationsWidth: 260,
3162
+ operationsHeaderAlign: "center",
3163
+ operationsColumnAlign: "center",
3162
3164
  operationsBtnPlain: !1,
3163
3165
  operationsBtnText: !0,
3164
3166
  operationsBtnSize: "small",
@@ -3752,7 +3754,9 @@
3752
3754
  }, mergeDicData = loopDicData(columnOption.dicData);
3753
3755
  return vue.createVNode("span", null, [ _formatterColumnValue(row[columnOption.prop], mergeDicData) ]);
3754
3756
  }
3755
- return null;
3757
+ return columnOption.cellUnit ? vue.createVNode(vue.Fragment, null, [ vue.createVNode("span", null, [ row[columnOption.prop] ]), vue.createVNode("em", {
3758
+ class: "cell-unit"
3759
+ }, [ columnOption.cellUnit ]) ]) : null;
3756
3760
  };
3757
3761
  return () => vue.createVNode(vue.Fragment, null, [ !columnOption.hide && vue.createVNode(elementPlus.ElTableColumn, {
3758
3762
  prop: columnOption.prop,
@@ -3783,8 +3787,8 @@
3783
3787
  fixed: "right",
3784
3788
  label: t("next.table.operation"),
3785
3789
  width: options.operationsWidth,
3786
- headerAlign: options.headerAlign,
3787
- align: options.cellAlign
3790
+ headerAlign: valueExist(options.operationsHeaderAlign, options.headerAlign),
3791
+ align: valueExist(options.operationsColumnAlign, options.cellAlign)
3788
3792
  }, {
3789
3793
  default: scoped => vue.createVNode(vue.Fragment, null, [ slots["operation-column-prefix"]?.(scoped, {
3790
3794
  text: btnText,
@@ -5223,7 +5227,8 @@
5223
5227
  getFormExpose: () => addEditFormRef.value?.getFormExpose(),
5224
5228
  updateColumns: ops => {
5225
5229
  _updateColumnsAll(ops);
5226
- }
5230
+ },
5231
+ getSearchFormParams: () => _searchFormParams.value
5227
5232
  });
5228
5233
  return () => vue.createVNode(vue.Fragment, null, [ vue.createVNode(vue.Fragment, null, [ vue.createVNode("div", {
5229
5234
  ref: crudTableRef,
@@ -5734,6 +5739,14 @@
5734
5739
  isFullscreen: {
5735
5740
  type: Boolean,
5736
5741
  default: !1
5742
+ },
5743
+ imageIndex: {
5744
+ type: Number,
5745
+ default: 0
5746
+ },
5747
+ imageLength: {
5748
+ type: Number,
5749
+ default: 0
5737
5750
  }
5738
5751
  },
5739
5752
  emits: [ "fullscreen", "save" ],
@@ -5744,6 +5757,7 @@
5744
5757
  return () => vue.createVNode(vue.Fragment, null, [ vue.createVNode(vue.Fragment, null, [ vue.createVNode("ul", {
5745
5758
  class: [ _ns.be("header", "tool") ]
5746
5759
  }, [ vue.createVNode("li", {
5760
+ class: "hover",
5747
5761
  onClick: () => emit("save")
5748
5762
  }, [ vue.createVNode("svg", {
5749
5763
  t: "1719034799379",
@@ -5764,8 +5778,11 @@
5764
5778
  style: "padding-left: 3px"
5765
5779
  }, [ t("next.labelimg.saveLabel") ]) ]) ]), vue.createVNode("ul", {
5766
5780
  class: [ _ns.be("header", "tool") ]
5767
- }, [ vue.createVNode("li", {
5768
- style: "margin-right: 30px;"
5781
+ }, [ props.imageLength ? vue.createVNode("li", null, [ vue.createVNode("span", null, [ vue.createTextVNode("第 "), props.imageIndex + 1, vue.createTextVNode(" 张") ]), vue.createVNode("em", {
5782
+ style: "padding: 0 5px;"
5783
+ }, [ vue.createTextVNode("/") ]), vue.createVNode("span", null, [ vue.createTextVNode("共 "), props.imageLength, vue.createTextVNode(" 张") ]) ]) : null, vue.createVNode("li", {
5784
+ style: "margin-right: 30px;",
5785
+ class: "hover"
5769
5786
  }, [ vue.createVNode(elementPlus.ElPopover, {
5770
5787
  trigger: "hover",
5771
5788
  placement: "bottom",
@@ -5784,6 +5801,7 @@
5784
5801
  style: "font-size: 12px;white-space: nowrap;"
5785
5802
  }, [ 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
5803
  }) ]), props.isFullscreen ? vue.createVNode("li", {
5804
+ class: "hover",
5787
5805
  onClick: () => switchFillscreen(!1)
5788
5806
  }, [ vue.createVNode(elementPlus.ElTooltip, {
5789
5807
  placement: "top",
@@ -5803,6 +5821,7 @@
5803
5821
  "p-id": "5389"
5804
5822
  }, null) ]) ]
5805
5823
  }) ]) : vue.createVNode("li", {
5824
+ class: "hover",
5806
5825
  onClick: () => switchFillscreen(!0)
5807
5826
  }, [ vue.createVNode(elementPlus.ElTooltip, {
5808
5827
  placement: "top",
@@ -6030,7 +6049,7 @@
6030
6049
  parentRect = props.parentEl.getBoundingClientRect(), document.addEventListener("mousemove", onMousemove),
6031
6050
  document.addEventListener("mouseup", onMouseup);
6032
6051
  })), vue.onUnmounted((() => {
6033
- document.removeEventListener("mousemove", onMousemove, !1), document.removeEventListener("mouseup", onMouseup, !1);
6052
+ document.removeEventListener("mousemove", onMousemove), document.removeEventListener("mouseup", onMouseup);
6034
6053
  })), {
6035
6054
  onMousedown: e => {
6036
6055
  e.preventDefault(), isDraggle.value = !0, draggleOffset.value.diff_x = e.offsetX,
@@ -6038,7 +6057,7 @@
6038
6057
  },
6039
6058
  onMouseup: onMouseup,
6040
6059
  onContextmenu: e => {
6041
- e.preventDefault(), emit("contextmenu", e, rect.value);
6060
+ e.preventDefault(), e.preventDefault(), emit("contextmenu", e, rect.value);
6042
6061
  },
6043
6062
  rect: rect,
6044
6063
  onMousedownDot: (e, corner) => {
@@ -6200,26 +6219,13 @@
6200
6219
  });
6201
6220
  drawBaseCanvas.value.updateLabels = updateLabels, drawBaseCanvas.value.addDrawRect = addDrawRect,
6202
6221
  drawBaseCanvas.value.hitCanvasLabel = hitCanvasLabel;
6203
- const {clearCanvas: clearCanvas} = ((canvas, callback, keyW) => {
6222
+ const {clearCanvas: clearCanvas, removeEventAll: removeEventAll} = ((canvas, callback, keyW) => {
6204
6223
  const canvasWidth = canvas.width, canvasHeight = canvas.height, ctx = canvas?.getContext("2d"), clearCanvas = () => {
6205
6224
  ctx.clearRect(0, 0, canvasWidth, canvasHeight);
6206
6225
  };
6207
6226
  clearCanvas();
6208
6227
  let startX, startY, endX, endY, isDrawing = !1, isRectDraw = !1, isWKeyPressed = !1;
6209
- document.addEventListener("keydown", (event => {
6210
- "KeyW" === event.code && (isWKeyPressed = !0, canvas.style.cursor = "crosshair",
6211
- canvas.style.zIndex = "11", keyW && keyW());
6212
- })), document.addEventListener("keyup", (event => {
6213
- isDrawing || "KeyW" === event.code && (isWKeyPressed = !1, canvas.style.cursor = "unset",
6214
- canvas.style.zIndex = "0");
6215
- })), canvas.addEventListener("mousedown", (e => {
6216
- isWKeyPressed && (isDrawing = !0, startX = e.offsetX, startY = e.offsetY);
6217
- })), canvas.addEventListener("mousemove", (e => {
6218
- isDrawing && isWKeyPressed && (isRectDraw = !0, endX = e.offsetX, endY = e.offsetY,
6219
- drawRect());
6220
- })), canvas.addEventListener("mouseup", (() => {
6221
- if (!isRectDraw) return;
6222
- isDrawing = !1, isWKeyPressed = !1, canvas.style.cursor = "unset", canvas.style.zIndex = "0";
6228
+ const drawRectDone = () => {
6223
6229
  const rectWidth = Math.abs(endX - startX), rectHeight = Math.abs(endY - startY);
6224
6230
  startX > endX && (startX = endX), startY > endY && (startY = endY), callback && callback({
6225
6231
  startX: startX,
@@ -6231,8 +6237,30 @@
6231
6237
  }, {
6232
6238
  endX: endX,
6233
6239
  endY: endY
6234
- }), isRectDraw = !1;
6235
- }));
6240
+ });
6241
+ }, documentKeydown = event => {
6242
+ "KeyW" === event.code && (isWKeyPressed = !0, canvas.style.cursor = "crosshair",
6243
+ canvas.style.zIndex = "11", keyW && keyW());
6244
+ }, documentKeyup = event => {
6245
+ isDrawing || "KeyW" === event.code && (isWKeyPressed = !1, canvas.style.cursor = "unset",
6246
+ canvas.style.zIndex = "0");
6247
+ }, documentMouseup = () => {
6248
+ isRectDraw && (isDrawing = !1, isWKeyPressed = !1, canvas.style.cursor = "unset",
6249
+ canvas.style.zIndex = "0", drawRectDone(), isRectDraw = !1);
6250
+ };
6251
+ document.addEventListener("keydown", documentKeydown), document.addEventListener("keyup", documentKeyup),
6252
+ document.addEventListener("mouseup", documentMouseup);
6253
+ const canvasMousedown = e => {
6254
+ isWKeyPressed && (isDrawing = !0, startX = e.offsetX, startY = e.offsetY);
6255
+ }, canvasMousemove = e => {
6256
+ isDrawing && isWKeyPressed && (isRectDraw = !0, endX = e.offsetX, endY = e.offsetY,
6257
+ drawRect());
6258
+ }, canvasMouseup = e => {
6259
+ e.stopPropagation(), isRectDraw && (isDrawing = !1, isWKeyPressed = !1, canvas.style.cursor = "unset",
6260
+ canvas.style.zIndex = "0", drawRectDone(), isRectDraw = !1);
6261
+ };
6262
+ canvas.addEventListener("mousedown", canvasMousedown), canvas.addEventListener("mousemove", canvasMousemove),
6263
+ canvas.addEventListener("mouseup", canvasMouseup);
6236
6264
  const drawRect = (color = "#f30635") => {
6237
6265
  clearCanvas(), ctx.strokeStyle = color, ctx.strokeRect(startX, startY, endX - startX, endY - startY);
6238
6266
  };
@@ -6240,14 +6268,19 @@
6240
6268
  canvas: canvas,
6241
6269
  ctx: ctx,
6242
6270
  clearCanvas: clearCanvas,
6243
- drawRect: drawRect
6271
+ drawRect: drawRect,
6272
+ removeEventAll: () => {
6273
+ document.removeEventListener("mousedown", documentKeydown), document.removeEventListener("keyup", documentKeyup),
6274
+ document.removeEventListener("mouseup", documentMouseup), canvas.removeEventListener("mousedown", canvasMousedown),
6275
+ canvas.removeEventListener("mousemove", canvasMousemove), canvas.removeEventListener("mouseup", canvasMouseup);
6276
+ }
6244
6277
  };
6245
6278
  })(canvasRectRef.value, ((rect, {endX: endX, endY: endY}) => {
6246
6279
  activate_add_label.value = rect, drawBaseCanvas.value.addDrawRect(rect), updateContextmenuLabelFixed(endX, endY, rect);
6247
6280
  }), (() => {
6248
6281
  onCloseDraggableRectFixed();
6249
6282
  }));
6250
- drawBaseCanvas.value.clearCanvasRect = clearCanvas;
6283
+ drawBaseCanvas.value.clearCanvasRect = clearCanvas, drawBaseCanvas.value.removeEventAll = removeEventAll;
6251
6284
  }, image.onerror = () => {
6252
6285
  loadingImage.value = !1;
6253
6286
  };
@@ -6279,6 +6312,8 @@
6279
6312
  renderImageLabel(rowInfo);
6280
6313
  }
6281
6314
  }));
6315
+ })), vue.onUnmounted((() => {
6316
+ drawBaseCanvas.value.removeEventAll();
6282
6317
  }));
6283
6318
  const contextmenuLabelFixed = vue.ref({
6284
6319
  show: !1,
@@ -6354,8 +6389,8 @@
6354
6389
  onCloseContentmenuLabel: onCloseContentmenuLabel,
6355
6390
  onSelectedLabel: (rect, index) => {
6356
6391
  onCloseDraggableRectFixed(), vue.nextTick((() => {
6357
- const {startX: x, startY: y, type: type} = rect;
6358
- updateDraggableRectFixed(x, y, rect, index, colors[type]);
6392
+ const {startX: x, startY: y, type: type} = rect, color = colors[type];
6393
+ updateDraggableRectFixed(x, y, labels.value[index], index, color);
6359
6394
  }));
6360
6395
  },
6361
6396
  onDeleteLabel: onDeleteLabel,
@@ -6440,7 +6475,7 @@
6440
6475
  class: "label-line"
6441
6476
  }, null), vue.createVNode("span", null, [ rect.typeName ]) ]), vue.createVNode(elementPlus.ElPopconfirm, {
6442
6477
  title: t("next.labelimg.confirmDeleteLabel"),
6443
- width: 180,
6478
+ width: 200,
6444
6479
  onConfirm: () => (rect => {
6445
6480
  emit("delete", rect);
6446
6481
  })(rect)
@@ -6617,6 +6652,8 @@
6617
6652
  class: [ ns$1.b("header") ]
6618
6653
  }, [ slots.header ? slots.header() : vue.createVNode(ToolHeader, {
6619
6654
  isFullscreen: isFullscreen.value,
6655
+ imageIndex: activateNodeIndex.value,
6656
+ imageLength: labelImages.value.length,
6620
6657
  onFullscreen: onSwitchFillscreen,
6621
6658
  onSave: () => {
6622
6659
  onChangeActivateNode(activateNodeIndex.value) || elementPlus.ElMessage({
@@ -6821,7 +6858,7 @@
6821
6858
  })(app);
6822
6859
  };
6823
6860
  var index = {
6824
- version: "0.3.1",
6861
+ version: "0.3.2",
6825
6862
  install: install
6826
6863
  };
6827
6864
  exports.NextContainer = NextContainer, exports.NextCrudTable = NextCrudTable, exports.NextCrudTableVirtualized = NextCrudTableVirtualized,
@@ -6867,7 +6904,7 @@
6867
6904
  }), exports.useGetDerivedNamespace = useGetDerivedNamespace, exports.useLanguage = (locale, lang) => {
6868
6905
  const localeRef = vue.isRef(locale) ? locale : vue.ref(locale), nextLang = localeLang[lang] || localeLang["zh-cn"];
6869
6906
  localeRef.value.name = lang, localeRef.value.next = nextLang.next;
6870
- }, exports.useLocale = useLocale, exports.useNamespace = useNamespace, exports.version = "0.3.1",
6907
+ }, exports.useLocale = useLocale, exports.useNamespace = useNamespace, exports.version = "0.3.2",
6871
6908
  Object.defineProperty(exports, "__esModule", {
6872
6909
  value: !0
6873
6910
  });