ztxkui 3.9.3 → 3.9.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.
@@ -283,22 +283,27 @@ export function getPositionLocal(localKey) {
283
283
  * @description 设置标签位置
284
284
  */
285
285
  export function setPositionDom(value) {
286
- var _a;
287
286
  var printDom = document.querySelectorAll('.html2canvas-container-page');
288
287
  for (var i = 0; i < printDom.length; i++) {
289
288
  var item = printDom[i];
290
289
  item.setAttribute('style', "padding-top: " + ((value === null || value === void 0 ? void 0 : value.top) < 0 ? 0 : (value === null || value === void 0 ? void 0 : value.top) || 0) + "px; padding-left: " + ((value === null || value === void 0 ? void 0 : value.left) < 0 ? 0 : (value === null || value === void 0 ? void 0 : value.left) || 0) + "px");
291
290
  var childResultStyle = {};
292
- var childrenDom = item.querySelectorAll('.set-box');
293
291
  if ((value === null || value === void 0 ? void 0 : value.top) < 0) {
294
- var initTop = (_a = childrenDom[0]) === null || _a === void 0 ? void 0 : _a.dataset.top;
295
- console.log(initTop);
296
292
  childResultStyle.top = value === null || value === void 0 ? void 0 : value.top;
297
293
  }
298
294
  if ((value === null || value === void 0 ? void 0 : value.left) < 0) {
299
295
  childResultStyle.left = value === null || value === void 0 ? void 0 : value.left;
300
296
  }
301
- if (childResultStyle.top || childResultStyle.left) {
297
+ console.log(childResultStyle);
298
+ if (childResultStyle.top && !childResultStyle.left) {
299
+ setMinusPosition(item, childResultStyle);
300
+ reductionMinusPostion(item, 'left');
301
+ }
302
+ else if (!childResultStyle.top && childResultStyle.left) {
303
+ setMinusPosition(item, childResultStyle);
304
+ reductionMinusPostion(item, 'top');
305
+ }
306
+ else if (childResultStyle.top && childResultStyle.left) {
302
307
  setMinusPosition(item, childResultStyle);
303
308
  }
304
309
  else {
@@ -366,9 +371,11 @@ export function reductionMinusPostion(dom, type) {
366
371
  var childrenDom = dom.querySelectorAll('.set-box');
367
372
  if (childrenDom) {
368
373
  if (type === 'top') {
374
+ console.log(childrenDom[0].style.top);
369
375
  childrenDom[0].style.top = childrenDom[0].dataset.top;
370
376
  }
371
377
  else if (type === 'left') {
378
+ console.log(childrenDom[0].style.left);
372
379
  childrenDom[0].style.left = childrenDom[0].dataset.left;
373
380
  }
374
381
  else {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ztxkui",
3
- "version": "3.9.3",
3
+ "version": "3.9.4",
4
4
  "private": false,
5
5
  "description": "React components library",
6
6
  "author": "zt-front-end",