ztxkui 3.9.2 → 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.
|
@@ -44,7 +44,7 @@ var PrintModal = function (_a) {
|
|
|
44
44
|
onChange && onChange(value);
|
|
45
45
|
};
|
|
46
46
|
return (React.createElement(Modal, { title: "\u8FB9\u8DDD\u8C03\u6574", visible: visible, loading: false, width: "90%", onCancel: onCancel, onOk: onSure },
|
|
47
|
-
React.createElement("div",
|
|
47
|
+
React.createElement("div", { style: { position: 'relative', zIndex: 1000 } },
|
|
48
48
|
"\u4E0A\u8FB9\u8DDD\uFF1A",
|
|
49
49
|
React.createElement(Slider, { min: -180, max: 200, step: 0.01, value: (value === null || value === void 0 ? void 0 : value.top) || 0, onChange: function (value) {
|
|
50
50
|
if (value < 0) {
|
|
@@ -57,7 +57,7 @@ var PrintModal = function (_a) {
|
|
|
57
57
|
}
|
|
58
58
|
setValue(function (preValue) { return (__assign(__assign({}, (preValue || {})), { top: value })); });
|
|
59
59
|
} })),
|
|
60
|
-
React.createElement("div",
|
|
60
|
+
React.createElement("div", { style: { position: 'relative', zIndex: 1000 } },
|
|
61
61
|
"\u5DE6\u8FB9\u8DDD\uFF1A",
|
|
62
62
|
React.createElement(Slider, { min: -180, max: 200, step: 0.01, value: (value === null || value === void 0 ? void 0 : value.left) || 0, onChange: function (value) {
|
|
63
63
|
if (value < 0) {
|
|
@@ -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
|
-
|
|
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 {
|
|
@@ -317,7 +322,6 @@ export function setPositionDeviation(value) {
|
|
|
317
322
|
};
|
|
318
323
|
}
|
|
319
324
|
export function setMinusPosition(dom, style) {
|
|
320
|
-
var _a, _b;
|
|
321
325
|
try {
|
|
322
326
|
var childrenDom = dom.querySelectorAll('.set-box');
|
|
323
327
|
if (childrenDom) {
|
|
@@ -327,15 +331,16 @@ export function setMinusPosition(dom, style) {
|
|
|
327
331
|
var left = childrenDom[0].dataset.left
|
|
328
332
|
? parseInt(childrenDom[0].dataset.left)
|
|
329
333
|
: 0;
|
|
330
|
-
var resultTop = top_1;
|
|
331
|
-
var resultLeft = left;
|
|
332
334
|
if (style.top) {
|
|
335
|
+
var resultTop = top_1;
|
|
333
336
|
resultTop += style.top;
|
|
337
|
+
childrenDom[0].style.top = resultTop + "px";
|
|
334
338
|
}
|
|
335
339
|
if (style.left) {
|
|
340
|
+
var resultLeft = left;
|
|
336
341
|
resultLeft += style.left;
|
|
342
|
+
childrenDom[0].style.left = resultLeft + "px";
|
|
337
343
|
}
|
|
338
|
-
(_b = (_a = childrenDom[0]) === null || _a === void 0 ? void 0 : _a.setAttribute) === null || _b === void 0 ? void 0 : _b.call(_a, 'style', "top: " + resultTop + "px; left: " + resultLeft + "px");
|
|
339
344
|
}
|
|
340
345
|
}
|
|
341
346
|
catch (err) {
|
|
@@ -362,18 +367,24 @@ export function initMinusPosition(dom) {
|
|
|
362
367
|
}
|
|
363
368
|
}
|
|
364
369
|
export function reductionMinusPostion(dom, type) {
|
|
365
|
-
var _a, _b, _c, _d, _e, _f;
|
|
366
370
|
try {
|
|
367
371
|
var childrenDom = dom.querySelectorAll('.set-box');
|
|
368
372
|
if (childrenDom) {
|
|
369
373
|
if (type === 'top') {
|
|
370
|
-
(
|
|
374
|
+
console.log(childrenDom[0].style.top);
|
|
375
|
+
childrenDom[0].style.top = childrenDom[0].dataset.top;
|
|
371
376
|
}
|
|
372
377
|
else if (type === 'left') {
|
|
373
|
-
(
|
|
378
|
+
console.log(childrenDom[0].style.left);
|
|
379
|
+
childrenDom[0].style.left = childrenDom[0].dataset.left;
|
|
374
380
|
}
|
|
375
381
|
else {
|
|
376
|
-
|
|
382
|
+
childrenDom[0].style.top = childrenDom[0].dataset.top;
|
|
383
|
+
childrenDom[0].style.left = childrenDom[0].dataset.left;
|
|
384
|
+
// childrenDom[0]?.setAttribute?.(
|
|
385
|
+
// 'style',
|
|
386
|
+
// `top: ${childrenDom[0].dataset.top}; left: ${childrenDom[0].dataset.left}`
|
|
387
|
+
// );
|
|
377
388
|
}
|
|
378
389
|
}
|
|
379
390
|
}
|