ztxkui 3.6.13 → 3.6.14

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.
@@ -54,6 +54,8 @@ export interface IProps {
54
54
  showExportBtn?: boolean;
55
55
  /** 是否显示设置文字 */
56
56
  showSetFontBtn?: boolean;
57
+ /** 设置是否需要偏移 */
58
+ isSetPosition?: boolean;
57
59
  }
58
60
  declare const PrintContainer: React.FC<IProps>;
59
61
  export default PrintContainer;
@@ -94,25 +94,25 @@ function downloadFontTTF(_a) {
94
94
  });
95
95
  }
96
96
  var PrintContainer = function (_a) {
97
- var children = _a.children, waterText = _a.waterText, onFonsizeChange = _a.onFonsizeChange, hiddenClassName = _a.hiddenClassName, _b = _a.isAddExportPage, isAddExportPage = _b === void 0 ? false : _b, _c = _a.loading, loading = _c === void 0 ? false : _c, _d = _a.pdfName, pdfName = _d === void 0 ? 'pdf文件' : _d, request = _a.request, sealIdList = _a.sealIdList, _e = _a.showHandSeal, showHandSeal = _e === void 0 ? true : _e, _f = _a.showAutoSeal, showAutoSeal = _f === void 0 ? true : _f, _g = _a.needWatermark, needWatermark = _g === void 0 ? 0 : _g, fileId = _a.fileId, deptId = _a.deptId, flowId = _a.flowId, imgWaterBg = _a.imgWaterBg, onPrintCallback = _a.onPrintCallback, showPrintMessage = _a.showPrintMessage, onPrintBeforeCallback = _a.onPrintBeforeCallback, _h = _a.showPrintBtn, showPrintBtn = _h === void 0 ? true : _h, isUseXy = _a.isUseXy, localKey = _a.localKey, _j = _a.showExportBtn, showExportBtn = _j === void 0 ? true : _j, showSetFontBtn = _a.showSetFontBtn;
98
- var _k = useState(false), showWater = _k[0], setShowWater = _k[1];
97
+ var children = _a.children, waterText = _a.waterText, onFonsizeChange = _a.onFonsizeChange, hiddenClassName = _a.hiddenClassName, _b = _a.isAddExportPage, isAddExportPage = _b === void 0 ? false : _b, _c = _a.loading, loading = _c === void 0 ? false : _c, _d = _a.pdfName, pdfName = _d === void 0 ? 'pdf文件' : _d, request = _a.request, sealIdList = _a.sealIdList, _e = _a.showHandSeal, showHandSeal = _e === void 0 ? true : _e, _f = _a.showAutoSeal, showAutoSeal = _f === void 0 ? true : _f, _g = _a.needWatermark, needWatermark = _g === void 0 ? 0 : _g, fileId = _a.fileId, deptId = _a.deptId, flowId = _a.flowId, imgWaterBg = _a.imgWaterBg, onPrintCallback = _a.onPrintCallback, showPrintMessage = _a.showPrintMessage, onPrintBeforeCallback = _a.onPrintBeforeCallback, _h = _a.showPrintBtn, showPrintBtn = _h === void 0 ? true : _h, isUseXy = _a.isUseXy, localKey = _a.localKey, _j = _a.showExportBtn, showExportBtn = _j === void 0 ? true : _j, showSetFontBtn = _a.showSetFontBtn, _k = _a.isSetPosition, isSetPosition = _k === void 0 ? true : _k;
98
+ var _l = useState(false), showWater = _l[0], setShowWater = _l[1];
99
99
  var containerRef = useRef();
100
100
  var allDomRef = useRef();
101
- var _l = useState(false), spinning = _l[0], setSpinning = _l[1];
101
+ var _m = useState(false), spinning = _m[0], setSpinning = _m[1];
102
102
  // 确认盖章后,会得到一个合同id 这个之后盖章要用
103
- var _m = useState(), currentContractId = _m[0], setCurrentContractId = _m[1];
103
+ var _o = useState(), currentContractId = _o[0], setCurrentContractId = _o[1];
104
104
  // 盖章后会得到一个预览地址,这个地址耀保存,同一个合同id,不能重复盖章接口
105
- var _o = useState(), currentViewUrl = _o[0], setCurrentViewUrl = _o[1];
105
+ var _p = useState(), currentViewUrl = _p[0], setCurrentViewUrl = _p[1];
106
106
  // 收到盖章-印章列表
107
- var _p = useState(), _sealIdList = _p[0], setSealIdList = _p[1];
107
+ var _q = useState(), _sealIdList = _q[0], setSealIdList = _q[1];
108
108
  // 自动盖章-印章列表
109
- var _q = useState(), autoSealList = _q[0], setAutoSealList = _q[1];
109
+ var _r = useState(), autoSealList = _r[0], setAutoSealList = _r[1];
110
110
  // 边距调整相关
111
- var _r = useState(false), visible = _r[0], setVisible = _r[1];
112
- var _s = useState({
111
+ var _s = useState(false), visible = _s[0], setVisible = _s[1];
112
+ var _t = useState({
113
113
  top: 0,
114
114
  left: 0,
115
- }), value = _s[0], setValue = _s[1];
115
+ }), value = _t[0], setValue = _t[1];
116
116
  useEffect(function () {
117
117
  var v = getPositionLocal(localKey);
118
118
  setValue(v);
@@ -487,7 +487,9 @@ var PrintContainer = function (_a) {
487
487
  }); };
488
488
  function createPdf() {
489
489
  setTimeout(function () {
490
- setPositionDom(setPositionDeviation(value));
490
+ if (isSetPosition) {
491
+ setPositionDom(setPositionDeviation(value));
492
+ }
491
493
  htmlToPdfNoCanvas({
492
494
  dom: containerRef.current,
493
495
  fileBinary: fontTTF,
@@ -562,7 +564,9 @@ var PrintContainer = function (_a) {
562
564
  };
563
565
  function surePdfLoad() {
564
566
  setTimeout(function () {
565
- setPositionDom(setPositionDeviation(value));
567
+ if (isSetPosition) {
568
+ setPositionDom(setPositionDeviation(value));
569
+ }
566
570
  htmlToPdfNoCanvas({
567
571
  dom: containerRef.current,
568
572
  isShowPage: isAddExportPage,
@@ -719,7 +723,9 @@ var PrintContainer = function (_a) {
719
723
  };
720
724
  function pdfLoad() {
721
725
  setTimeout(function () {
722
- setPositionDom(setPositionDeviation(value));
726
+ if (isSetPosition) {
727
+ setPositionDom(setPositionDeviation(value));
728
+ }
723
729
  htmlToPdfNoCanvas({
724
730
  dom: containerRef.current,
725
731
  isShowPage: isAddExportPage,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ztxkui",
3
- "version": "3.6.13",
3
+ "version": "3.6.14",
4
4
  "private": false,
5
5
  "description": "React components library",
6
6
  "author": "zt-front-end",