@cecee/document-flip-book 1.0.10 → 1.0.13

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.
@@ -50,6 +50,7 @@ var DocumentFlipBook = function DocumentFlipBook(_ref) {
50
50
  showHeaderBar = _ref$showHeaderBar === void 0 ? true : _ref$showHeaderBar,
51
51
  pdfWorkerSrc = _ref.pdfWorkerSrc;
52
52
  var flipRef = (0, _react.useRef)(null);
53
+ console.log(documentInfo);
53
54
 
54
55
  // 初始化 PDF Worker
55
56
  (0, _react.useEffect)(function () {
@@ -550,7 +551,6 @@ var DocumentFlipBook = function DocumentFlipBook(_ref) {
550
551
  className: "dfb-stage",
551
552
  children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_antd.Spin, {
552
553
  size: "large",
553
- tip: "\u6B63\u5728\u89E3\u6790\u6863\u6848\u7ED3\u6784...",
554
554
  spinning: loading,
555
555
  children: /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
556
556
  className: "dfb-book-wrapper",
@@ -617,20 +617,22 @@ var DocumentFlipBook = function DocumentFlipBook(_ref) {
617
617
  length: total
618
618
  }).map(function (_, i) {
619
619
  return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
620
- className: "book-view bg-white",
620
+ className: "book-view",
621
621
  style: {
622
622
  width: '100%',
623
- height: '100%'
623
+ height: '100%',
624
+ background: '#fff'
624
625
  },
625
626
  children: renderContent(i)
626
627
  }, i);
627
628
  })
628
629
  }, "".concat(archiveId, "-").concat(activeTab)), !loading && pages.length === 0 && /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
629
- className: "book-view bg-white",
630
+ className: "book-view",
630
631
  style: {
631
632
  width: _utils.VIEWPORT_WIDTH,
632
633
  height: _utils.VIEWPORT_HEIGHT,
633
- margin: 'auto'
634
+ margin: 'auto',
635
+ background: '#fff'
634
636
  },
635
637
  children: renderContent(0)
636
638
  })]
@@ -51,16 +51,16 @@ var HeaderBar = function HeaderBar(_ref) {
51
51
  setExportModalVisible(false);
52
52
  };
53
53
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
54
- className: "common-header-bar flex items-center justify-between h-[50px] px-4 bg-white border-b border-[#f0f0f0]",
54
+ className: "common-header-bar",
55
55
  children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
56
- className: "header-left flex items-center",
56
+ className: "header-left",
57
57
  children: [title && /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
58
- className: "text-lg font-bold mr-4",
58
+ className: "header-title",
59
59
  children: title
60
60
  }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_antd.Space, {
61
61
  size: 0,
62
62
  children: [mode !== 'modal' && /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
63
- className: "flex items-center",
63
+ className: "header-item",
64
64
  children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_antd.Button, {
65
65
  type: "link",
66
66
  onClick: onBack,
@@ -77,7 +77,7 @@ var HeaderBar = function HeaderBar(_ref) {
77
77
  className: "dfb-divider"
78
78
  })]
79
79
  }), /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
80
- className: "flex items-center",
80
+ className: "header-item",
81
81
  children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_antd.Button, {
82
82
  type: "link",
83
83
  onClick: onRefresh,
@@ -179,7 +179,7 @@ var HeaderBar = function HeaderBar(_ref) {
179
179
  })]
180
180
  })]
181
181
  }), /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
182
- className: "header-right flex items-center",
182
+ className: "header-right",
183
183
  children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_antd.Button, {
184
184
  type: "link",
185
185
  onClick: onPrint,
@@ -11,7 +11,7 @@ var _antd = require("antd");
11
11
  var _jsxRuntime = require("react/jsx-runtime");
12
12
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
13
13
  var ProjectCover = /*#__PURE__*/_react.default.forwardRef(function (_ref, ref) {
14
- var _user$company, _info$dt, _user$info;
14
+ var _user$company, _info$edr04bs, _info$edr04bs2, _info$edr04bs3, _info$edr04bs4, _info$dt, _user$info;
15
15
  var documentInfo = _ref.documentInfo,
16
16
  _ref$themeColor = _ref.themeColor,
17
17
  themeColor = _ref$themeColor === void 0 ? '#4baae3' : _ref$themeColor;
@@ -27,6 +27,70 @@ var ProjectCover = /*#__PURE__*/_react.default.forwardRef(function (_ref, ref) {
27
27
  lineWidth: 2
28
28
  }
29
29
  };
30
+ var title = (info === null || info === void 0 ? void 0 : info.title) || '高企研发';
31
+ var isFourFlows = title === '四流合一档案';
32
+
33
+ // 定义统计项配置
34
+ var statsConfig = isFourFlows ? [{
35
+ label: '发票',
36
+ checked: !!(info !== null && info !== void 0 && (_info$edr04bs = info.edr04bs) !== null && _info$edr04bs !== void 0 && _info$edr04bs.length),
37
+ count: (info === null || info === void 0 || (_info$edr04bs2 = info.edr04bs) === null || _info$edr04bs2 === void 0 ? void 0 : _info$edr04bs2.length) || '-'
38
+ }, {
39
+ label: '合同',
40
+ checked: false,
41
+ count: '-'
42
+ }, {
43
+ label: '物流',
44
+ checked: false,
45
+ count: '-'
46
+ }, {
47
+ label: '钱流',
48
+ checked: false,
49
+ count: '-'
50
+ }] : [{
51
+ label: '纪要',
52
+ checked: !!(info !== null && info !== void 0 && (_info$edr04bs3 = info.edr04bs) !== null && _info$edr04bs3 !== void 0 && _info$edr04bs3.length),
53
+ count: (info === null || info === void 0 || (_info$edr04bs4 = info.edr04bs) === null || _info$edr04bs4 === void 0 ? void 0 : _info$edr04bs4.length) || '-'
54
+ }, {
55
+ label: '人员',
56
+ checked: false,
57
+ count: '1'
58
+ }, {
59
+ label: '费用',
60
+ checked: false,
61
+ count: '3'
62
+ }, {
63
+ label: '说明书',
64
+ checked: false,
65
+ count: '1'
66
+ }];
67
+
68
+ // 渲染统计行辅助函数
69
+ var renderStatsRow = function renderStatsRow(startIndex) {
70
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
71
+ className: "project-cover-stats-row",
72
+ style: startIndex > 0 ? {
73
+ borderTop: 'none'
74
+ } : {},
75
+ children: statsConfig.slice(startIndex, startIndex + 2).map(function (item, idx) {
76
+ return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_react.default.Fragment, {
77
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
78
+ className: "stat-cell-label",
79
+ children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_antd.ConfigProvider, {
80
+ theme: checkboxTheme,
81
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_antd.Checkbox, {
82
+ checked: item.checked,
83
+ disabled: true
84
+ }), " ", item.label]
85
+ })
86
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
87
+ className: "stat-cell-value",
88
+ children: item.count
89
+ })]
90
+ }, item.label);
91
+ })
92
+ });
93
+ };
30
94
  return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
31
95
  className: "project-cover-container",
32
96
  style: {
@@ -41,66 +105,9 @@ var ProjectCover = /*#__PURE__*/_react.default.forwardRef(function (_ref, ref) {
41
105
  className: "project-cover-header",
42
106
  children: /*#__PURE__*/(0, _jsxRuntime.jsx)("h1", {
43
107
  className: "project-cover-title",
44
- children: (info === null || info === void 0 ? void 0 : info.title) || '高企研发'
108
+ children: title
45
109
  })
46
- }), /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
47
- className: "project-cover-stats-row",
48
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
49
- className: "stat-cell-label",
50
- children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_antd.ConfigProvider, {
51
- theme: checkboxTheme,
52
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_antd.Checkbox, {
53
- checked: !!(info !== null && info !== void 0 && info.edr04bs && info.edr04bs.length > 0),
54
- disabled: true
55
- }), " \u7EAA\u8981"]
56
- })
57
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
58
- className: "stat-cell-value",
59
- children: info !== null && info !== void 0 && info.edr04bs && info.edr04bs.length > 0 ? info.edr04bs.length : '-'
60
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
61
- className: "stat-cell-label",
62
- children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_antd.ConfigProvider, {
63
- theme: checkboxTheme,
64
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_antd.Checkbox, {
65
- checked: false,
66
- disabled: true
67
- }), " \u4EBA\u5458"]
68
- })
69
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
70
- className: "stat-cell-value",
71
- children: "1"
72
- })]
73
- }), /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
74
- className: "project-cover-stats-row",
75
- style: {
76
- borderTop: 'none'
77
- },
78
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
79
- className: "stat-cell-label",
80
- children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_antd.ConfigProvider, {
81
- theme: checkboxTheme,
82
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_antd.Checkbox, {
83
- checked: false,
84
- disabled: true
85
- }), " \u8D39\u7528"]
86
- })
87
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
88
- className: "stat-cell-value",
89
- children: "3"
90
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
91
- className: "stat-cell-label",
92
- children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_antd.ConfigProvider, {
93
- theme: checkboxTheme,
94
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_antd.Checkbox, {
95
- checked: false,
96
- disabled: true
97
- }), " \u8BF4\u660E\u4E66"]
98
- })
99
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
100
- className: "stat-cell-value",
101
- children: "1"
102
- })]
103
- }), /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
110
+ }), renderStatsRow(0), renderStatsRow(2), /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
104
111
  className: "project-cover-details",
105
112
  children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
106
113
  className: "detail-row",
@@ -19,7 +19,7 @@ function _asyncToGenerator(fn) { return function () { var self = this, args = ar
19
19
  */
20
20
  var renderCoverToImage = /*#__PURE__*/function () {
21
21
  var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(options) {
22
- var data, archiveInfo, _options$themeColor, themeColor, _options$companyName, companyName, _options$isProjectMod, isProjectMode, acc51c, div, html, _info$user, info, coverData, _archiveInfo$nsp24c, _coverData, canvas;
22
+ var data, archiveInfo, _options$themeColor, themeColor, _options$companyName, companyName, _options$isProjectMod, isProjectMode, acc51c, div, html, _info$edr04bs, _info$edr04bs2, _info$edr04bs3, _info$edr04bs4, _info$user, info, title, isFourFlows, stats, coverData, renderHtmlStatsRow, _archiveInfo$nsp24c, _coverData, canvas;
23
23
  return _regeneratorRuntime().wrap(function _callee$(_context) {
24
24
  while (1) switch (_context.prev = _context.next) {
25
25
  case 0:
@@ -35,6 +35,41 @@ var renderCoverToImage = /*#__PURE__*/function () {
35
35
  html = '';
36
36
  if (isProjectMode) {
37
37
  info = archiveInfo || {};
38
+ title = (info === null || info === void 0 ? void 0 : info.title) || '高企研发';
39
+ isFourFlows = title === '四流合一档案';
40
+ stats = isFourFlows ? [{
41
+ label: '发票',
42
+ checked: !!(info !== null && info !== void 0 && (_info$edr04bs = info.edr04bs) !== null && _info$edr04bs !== void 0 && _info$edr04bs.length),
43
+ count: (info === null || info === void 0 || (_info$edr04bs2 = info.edr04bs) === null || _info$edr04bs2 === void 0 ? void 0 : _info$edr04bs2.length) || '-'
44
+ }, {
45
+ label: '合同',
46
+ checked: false,
47
+ count: '-'
48
+ }, {
49
+ label: '物流',
50
+ checked: false,
51
+ count: '-'
52
+ }, {
53
+ label: '钱流',
54
+ checked: false,
55
+ count: '-'
56
+ }] : [{
57
+ label: '纪要',
58
+ checked: !!(info !== null && info !== void 0 && (_info$edr04bs3 = info.edr04bs) !== null && _info$edr04bs3 !== void 0 && _info$edr04bs3.length),
59
+ count: (info === null || info === void 0 || (_info$edr04bs4 = info.edr04bs) === null || _info$edr04bs4 === void 0 ? void 0 : _info$edr04bs4.length) || '-'
60
+ }, {
61
+ label: '人员',
62
+ checked: false,
63
+ count: '1'
64
+ }, {
65
+ label: '费用',
66
+ checked: false,
67
+ count: '3'
68
+ }, {
69
+ label: '说明书',
70
+ checked: false,
71
+ count: '1'
72
+ }];
38
73
  coverData = {
39
74
  year: info !== null && info !== void 0 && info.dt ? info.dt.slice(0, 4) : (0, _dayjs.default)().format('YYYY'),
40
75
  archiveNo: (info === null || info === void 0 ? void 0 : info.code) || '-',
@@ -45,10 +80,15 @@ var renderCoverToImage = /*#__PURE__*/function () {
45
80
  creator: (info === null || info === void 0 ? void 0 : info.full_name) || (info === null || info === void 0 || (_info$user = info.user) === null || _info$user === void 0 || (_info$user = _info$user.info) === null || _info$user === void 0 ? void 0 : _info$user.name) || '管理员',
46
81
  totalVolumes: (info === null || info === void 0 ? void 0 : info.totalVolumes) || '',
47
82
  volumeNumber: (info === null || info === void 0 ? void 0 : info.volumeNumber) || '',
48
- edr04bs: (info === null || info === void 0 ? void 0 : info.edr04bs) || [],
49
- title: (info === null || info === void 0 ? void 0 : info.title) || '高企研发'
83
+ title: title
50
84
  };
51
- html = "\n <div style=\"width: 600px; height: 800px; background-color: ".concat(themeColor, "; display: flex; flex-direction: column; padding: 30px; box-sizing: border-box; font-family: SimSun, STSong, serif;\">\n <div style=\"border: 5px solid #000; padding: 5px; height: 100%; box-sizing: border-box;\">\n <div style=\"border: 2px solid #000; height: 100%; display: flex; flex-direction: column; box-sizing: border-box;\">\n <div style=\"text-align: center; color: #000; padding: 8px 0;\">\n <h1 style=\"font-size: 54px; margin: 0; font-weight: 900; letter-spacing: 8px;\">").concat(coverData.title, "</h1>\n </div>\n\n <div style=\"display: flex; border-top: 1px solid #000; border-bottom: 1px solid #000;\">\n <div style=\"flex: 1; text-align: center; padding: 8px; border-right: 1px solid #000; font-weight: bold; display: flex; align-items: center; justify-content: center; gap: 8px;\">").concat(coverData.edr04bs.length > 0 ? '☑' : '☐', " \u7EAA\u8981</div>\n <div style=\"flex: 1; text-align: center; padding: 8px; border-right: 1px solid #000; font-family: 'Times New Roman'; font-size: 18px; font-weight: bold;\">").concat(coverData.edr04bs.length > 0 ? coverData.edr04bs.length : '-', "</div>\n <div style=\"flex: 1; text-align: center; padding: 8px; border-right: 1px solid #000; font-weight: bold; display: flex; align-items: center; justify-content: center; gap: 8px;\">\u2610 \u4EBA\u5458</div>\n <div style=\"flex: 1; text-align: center; padding: 8px; font-family: 'Times New Roman'; font-size: 18px; font-weight: bold;\">1</div>\n </div>\n <div style=\"display: flex; border-bottom: 1px solid #000;\">\n <div style=\"flex: 1; text-align: center; padding: 8px; border-right: 1px solid #000; font-weight: bold; display: flex; align-items: center; justify-content: center; gap: 8px;\">\u2610 \u8D39\u7528</div>\n <div style=\"flex: 1; text-align: center; padding: 8px; border-right: 1px solid #000; font-family: 'Times New Roman'; font-size: 18px; font-weight: bold;\">3</div>\n <div style=\"flex: 1; text-align: center; padding: 8px; border-right: 1px solid #000; font-weight: bold; display: flex; align-items: center; justify-content: center; gap: 8px;\">\u2610 \u8BF4\u660E\u4E66</div>\n <div style=\"flex: 1; text-align: center; padding: 8px; font-family: 'Times New Roman'; font-size: 18px; font-weight: bold;\">1</div>\n </div>\n\n <div style=\" display: flex; flex-direction: column;\">\n <div style=\"display: flex; border-bottom: 1px solid #000;\"><div style=\"width: 100px; padding: 8px; font-weight: bold; border-right: 1px solid #000;\">\u5E74\u5EA6</div><div style=\"flex: 1; padding: 8px; font-weight: 600;\">").concat(coverData.year, "</div></div>\n <div style=\"display: flex; border-bottom: 1px solid #000;\"><div style=\"width: 100px; padding: 8px; font-weight: bold; border-right: 1px solid #000;\">\u6863\u6848\u53F7</div><div style=\"flex: 1; padding: 8px; font-weight: 600;\">").concat(coverData.archiveNo, "</div></div>\n <div style=\"display: flex; border-bottom: 1px solid #000;\"><div style=\"width: 100px; padding: 8px; font-weight: bold; border-right: 1px solid #000;\">\u9879\u76EE\u540D\u79F0</div><div style=\"flex: 1; padding: 8px; font-weight: 600;\">").concat(coverData.projectName, "</div></div>\n <div style=\"display: flex; border-bottom: 1px solid #000;\"><div style=\"width: 100px; padding: 8px; font-weight: bold; border-right: 1px solid #000;\">\u9879\u76EE\u7F16\u53F7</div><div style=\"flex: 1; padding: 8px; font-weight: 600;\">").concat(coverData.projectNo, "</div></div>\n <div style=\"display: flex; border-bottom: 1px solid #000;\"><div style=\"width: 100px; padding: 8px; font-weight: bold; border-right: 1px solid #000;\">\u7F16\u5236\u5355\u4F4D</div><div style=\"flex: 1; padding: 8px; font-weight: 600;\">").concat(coverData.company, "</div></div>\n <div style=\"display: flex; border-bottom: 1px solid #000;\"><div style=\"width: 100px; padding: 8px; font-weight: bold; border-right: 1px solid #000;\">\u7F16\u5236\u65E5\u671F</div><div style=\"flex: 1; padding: 8px; font-weight: 600;\">").concat(coverData.date, "</div></div>\n <div style=\"display: flex; border-bottom: 1px solid #000;\"><div style=\"width: 100px; padding: 8px; font-weight: bold; border-right: 1px solid #000;\">\u7F16\u5236\u4EBA</div><div style=\"flex: 1; padding: 8px; font-weight: 600;\">").concat(coverData.creator, "</div></div>\n </div>\n\n <div style=\"display: flex; border-bottom: 1px solid #000;\">\n <div style=\"flex: 1; text-align: center; padding: 10px; border-right: 1px solid #000; font-weight: bold; display: flex; align-items: center; justify-content: center; font-size: 16px;\">\u51ED\u8BC1</div>\n <div style=\"flex: 1; text-align: center; padding: 10px; border-right: 1px solid #000; font-weight: bold; display: flex; align-items: center; justify-content: center; font-size: 16px;\">\u5F20\u9644\u4EF6</div>\n <div style=\"flex: 1; text-align: center; padding: 10px; font-weight: bold; display: flex; align-items: center; justify-content: center; font-size: 16px;\">\u5F20</div>\n </div>\n <div style=\"display: flex; border-bottom: 1px solid #000;\">\n <div style=\"flex: 1; text-align: center; padding: 10px; border-right: 1px solid #000; font-weight: bold; display: flex; align-items: center; justify-content: center; font-size: 16px;\">\u5171</div>\n <div style=\"flex: 1; text-align: center; padding: 10px; border-right: 1px solid #000; font-weight: bold; display: flex; align-items: center; justify-content: center; font-size: 16px;\">").concat(coverData.totalVolumes, "\u518C\u7B2C</div>\n <div style=\"flex: 1; text-align: center; padding: 10px; font-weight: bold; display: flex; align-items: center; justify-content: center; font-size: 16px;\">").concat(coverData.volumeNumber, "\u518C</div>\n </div>\n </div>\n </div>\n </div>\n ");
85
+ renderHtmlStatsRow = function renderHtmlStatsRow(startIndex) {
86
+ var rowStats = stats.slice(startIndex, startIndex + 2);
87
+ return "\n <div style=\"display: flex; border-bottom: 1px solid #000; ".concat(startIndex === 0 ? 'border-top: 1px solid #000;' : '', "\">\n ").concat(rowStats.map(function (s, i) {
88
+ return "\n <div style=\"flex: 1; text-align: center; padding: 8px; border-right: 1px solid #000; font-weight: bold; display: flex; align-items: center; justify-content: center; gap: 8px;\">\n ".concat(s.checked ? '☑' : '☐', " ").concat(s.label, "\n </div>\n <div style=\"flex: 1; text-align: center; padding: 8px; ").concat(i === 0 ? 'border-right: 1px solid #000;' : '', " font-family: 'Times New Roman'; font-size: 18px; font-weight: bold;\">\n ").concat(s.count, "\n </div>\n ");
89
+ }).join(''), "\n </div>\n ");
90
+ };
91
+ html = "\n <div style=\"width: 600px; height: 800px; background-color: ".concat(themeColor, "; display: flex; flex-direction: column; padding: 30px; box-sizing: border-box; font-family: SimSun, STSong, serif;\">\n <div style=\"border: 5px solid #000; padding: 5px; height: 100%; box-sizing: border-box;\">\n <div style=\"border: 2px solid #000; height: 100%; display: flex; flex-direction: column; box-sizing: border-box;\">\n <div style=\"text-align: center; color: #000; padding: 8px 0;\">\n <h1 style=\"font-size: 54px; margin: 0; font-weight: 900; letter-spacing: 8px;padding: 14px 0;\">").concat(coverData.title, "</h1>\n </div>\n\n ").concat(renderHtmlStatsRow(0), "\n ").concat(renderHtmlStatsRow(2), "\n\n <div style=\" display: flex; flex-direction: column;\">\n <div style=\"display: flex; border-bottom: 1px solid #000;\"><div style=\"width: 100px; padding: 8px; font-weight: bold; border-right: 1px solid #000;\">\u5E74\u5EA6</div><div style=\"flex: 1; padding: 8px; font-weight: 600;\">").concat(coverData.year, "</div></div>\n <div style=\"display: flex; border-bottom: 1px solid #000;\"><div style=\"width: 100px; padding: 8px; font-weight: bold; border-right: 1px solid #000;\">\u6863\u6848\u53F7</div><div style=\"flex: 1; padding: 8px; font-weight: 600;\">").concat(coverData.archiveNo, "</div></div>\n <div style=\"display: flex; border-bottom: 1px solid #000;\"><div style=\"width: 100px; padding: 8px; font-weight: bold; border-right: 1px solid #000;\">\u9879\u76EE\u540D\u79F0</div><div style=\"flex: 1; padding: 8px; font-weight: 600;\">").concat(coverData.projectName, "</div></div>\n <div style=\"display: flex; border-bottom: 1px solid #000;\"><div style=\"width: 100px; padding: 8px; font-weight: bold; border-right: 1px solid #000;\">\u9879\u76EE\u7F16\u53F7</div><div style=\"flex: 1; padding: 8px; font-weight: 600;\">").concat(coverData.projectNo, "</div></div>\n <div style=\"display: flex; border-bottom: 1px solid #000;\"><div style=\"width: 100px; padding: 8px; font-weight: bold; border-right: 1px solid #000;\">\u7F16\u5236\u5355\u4F4D</div><div style=\"flex: 1; padding: 8px; font-weight: 600;\">").concat(coverData.company, "</div></div>\n <div style=\"display: flex; border-bottom: 1px solid #000;\"><div style=\"width: 100px; padding: 8px; font-weight: bold; border-right: 1px solid #000;\">\u7F16\u5236\u65E5\u671F</div><div style=\"flex: 1; padding: 8px; font-weight: 600;\">").concat(coverData.date, "</div></div>\n <div style=\"display: flex; border-bottom: 1px solid #000;\"><div style=\"width: 100px; padding: 8px; font-weight: bold; border-right: 1px solid #000;\">\u7F16\u5236\u4EBA</div><div style=\"flex: 1; padding: 8px; font-weight: 600;\">").concat(coverData.creator, "</div></div>\n </div>\n\n <div style=\"display: flex; border-bottom: 1px solid #000;\">\n <div style=\"flex: 1; text-align: center; padding: 10px; border-right: 1px solid #000; font-weight: bold; display: flex; align-items: center; justify-content: center; font-size: 16px;\">\u51ED\u8BC1</div>\n <div style=\"flex: 1; text-align: center; padding: 10px; border-right: 1px solid #000; font-weight: bold; display: flex; align-items: center; justify-content: center; font-size: 16px;\">\u5F20\u9644\u4EF6</div>\n <div style=\"flex: 1; text-align: center; padding: 10px; font-weight: bold; display: flex; align-items: center; justify-content: center; font-size: 16px;\">\u5F20</div>\n </div>\n <div style=\"display: flex; border-bottom: 1px solid #000;\">\n <div style=\"flex: 1; text-align: center; padding: 10px; border-right: 1px solid #000; font-weight: bold; display: flex; align-items: center; justify-content: center; font-size: 16px;\">\u5171</div>\n <div style=\"flex: 1; text-align: center; padding: 10px; border-right: 1px solid #000; font-weight: bold; display: flex; align-items: center; justify-content: center; font-size: 16px;\">").concat(coverData.totalVolumes, "\u518C\u7B2C</div>\n <div style=\"flex: 1; text-align: center; padding: 10px; font-weight: bold; display: flex; align-items: center; justify-content: center; font-size: 16px;\">").concat(coverData.volumeNumber, "\u518C</div>\n </div>\n </div>\n </div>\n </div>\n ");
52
92
  } else {
53
93
  _coverData = {
54
94
  company: companyName,
@@ -1,3 +1,4 @@
1
1
  export { default as DocumentFlipBook } from './DocumentFlipBook';
2
2
  export { setupPdfWorker } from './utils';
3
3
  export * from './types';
4
+ import './index.less';
package/dist/cjs/index.js CHANGED
@@ -33,4 +33,5 @@ Object.keys(_types).forEach(function (key) {
33
33
  }
34
34
  });
35
35
  });
36
+ require("./index.less");
36
37
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
@@ -1,3 +1,33 @@
1
+ .common-header-bar {
2
+ display: flex;
3
+ align-items: center;
4
+ justify-content: space-between;
5
+ height: 50px;
6
+ padding: 0 16px;
7
+ background: #fff;
8
+ border-bottom: 1px solid #f0f0f0;
9
+
10
+ .header-left,
11
+ .header-right,
12
+ .header-item {
13
+ display: flex;
14
+ align-items: center;
15
+ }
16
+
17
+ .header-title {
18
+ font-size: 18px;
19
+ font-weight: bold;
20
+ margin-right: 16px;
21
+ }
22
+
23
+ .dfb-divider {
24
+ width: 1px;
25
+ height: 18px;
26
+ background: #e8e8e8;
27
+ margin: 0 8px;
28
+ }
29
+ }
30
+
1
31
  .book-page {
2
32
  width: 100%;
3
33
  height: 100%;
@@ -226,7 +256,7 @@
226
256
 
227
257
  .dfb-sideTabs {
228
258
  position: absolute;
229
- right: -18px; // 调整位置,使其紧贴书本边缘
259
+ right: 2px; // 调整位置,使其紧贴书本边缘
230
260
  top: 40px;
231
261
  display: flex;
232
262
  flex-direction: column;
@@ -235,7 +265,7 @@
235
265
  transition: all 0.3s ease;
236
266
 
237
267
  &.is-on-cover {
238
- right: -40px; // 封面是单页模式,标签需要向左移动(进入书壳内部边缘)
268
+ right: -42px; // 封面是单页模式,标签需要向左移动(进入书壳内部边缘)
239
269
  top: 40px;
240
270
  }
241
271
 
@@ -277,7 +307,7 @@
277
307
 
278
308
  &.is-active {
279
309
  position: relative;
280
- left: -8px;
310
+ left: -10px;
281
311
  width: 52px; // 选中态更长
282
312
  padding-left: 16px;
283
313
  font-weight: 700;
@@ -301,7 +331,7 @@
301
331
  }
302
332
 
303
333
  .is-on-activeTab {
304
- right: -8px !important;
334
+ right:12px !important;
305
335
  }
306
336
 
307
337
  .dfb-book-wrapper {
@@ -313,14 +343,14 @@
313
343
 
314
344
  .dfb-bookShell1 {
315
345
  position: relative;
316
- padding: 18px 0 18px 34px;
346
+ padding: 18px 0 18px 54px;
317
347
  background: transparent;
318
348
  transition: background-color 0.3s ease;
319
349
  }
320
350
 
321
351
  .dfb-bookShell {
322
352
  position: relative;
323
- padding: 18px 34px;
353
+ padding: 18px 54px;
324
354
  background: #9F7D4E;
325
355
  transition: background-color 0.3s ease;
326
356
 
@@ -549,6 +579,7 @@
549
579
  margin: 0;
550
580
  font-weight: 900;
551
581
  letter-spacing: 8px;
582
+ padding: 14px 0;
552
583
  }
553
584
  }
554
585
 
@@ -2,7 +2,7 @@ import { AttachmentItem, BuiltPage, PdfDocumentLike } from './types';
2
2
  export declare const setupPdfWorker: (customSrc?: string) => void;
3
3
  export declare const PDF_OPTIONS: {};
4
4
  export declare const PDF_PRELOAD_TIMEOUT = 60000;
5
- export declare const VIEWPORT_WIDTH = 570;
5
+ export declare const VIEWPORT_WIDTH = 520;
6
6
  export declare const VIEWPORT_HEIGHT = 670;
7
7
  export declare const HEIGHT = "100%";
8
8
  export declare const isPdfFile: (path: string) => boolean;
package/dist/cjs/utils.js CHANGED
@@ -27,7 +27,7 @@ var setupPdfWorker = exports.setupPdfWorker = function setupPdfWorker(customSrc)
27
27
  setupPdfWorker();
28
28
  var PDF_OPTIONS = exports.PDF_OPTIONS = {};
29
29
  var PDF_PRELOAD_TIMEOUT = exports.PDF_PRELOAD_TIMEOUT = 60000; // 增加到 60 秒,适配超大文件或慢速网络
30
- var VIEWPORT_WIDTH = exports.VIEWPORT_WIDTH = 570;
30
+ var VIEWPORT_WIDTH = exports.VIEWPORT_WIDTH = 520;
31
31
  var VIEWPORT_HEIGHT = exports.VIEWPORT_HEIGHT = 670;
32
32
  var HEIGHT = exports.HEIGHT = '100%';
33
33
 
@@ -42,6 +42,7 @@ var DocumentFlipBook = function DocumentFlipBook(_ref) {
42
42
  showHeaderBar = _ref$showHeaderBar === void 0 ? true : _ref$showHeaderBar,
43
43
  pdfWorkerSrc = _ref.pdfWorkerSrc;
44
44
  var flipRef = useRef(null);
45
+ console.log(documentInfo);
45
46
 
46
47
  // 初始化 PDF Worker
47
48
  useEffect(function () {
@@ -536,7 +537,6 @@ var DocumentFlipBook = function DocumentFlipBook(_ref) {
536
537
  className: "dfb-stage",
537
538
  children: /*#__PURE__*/_jsx(Spin, {
538
539
  size: "large",
539
- tip: "\u6B63\u5728\u89E3\u6790\u6863\u6848\u7ED3\u6784...",
540
540
  spinning: loading,
541
541
  children: /*#__PURE__*/_jsx("div", {
542
542
  className: "dfb-book-wrapper",
@@ -603,20 +603,22 @@ var DocumentFlipBook = function DocumentFlipBook(_ref) {
603
603
  length: total
604
604
  }).map(function (_, i) {
605
605
  return /*#__PURE__*/_jsx("div", {
606
- className: "book-view bg-white",
606
+ className: "book-view",
607
607
  style: {
608
608
  width: '100%',
609
- height: '100%'
609
+ height: '100%',
610
+ background: '#fff'
610
611
  },
611
612
  children: renderContent(i)
612
613
  }, i);
613
614
  })
614
615
  }, "".concat(archiveId, "-").concat(activeTab)), !loading && pages.length === 0 && /*#__PURE__*/_jsx("div", {
615
- className: "book-view bg-white",
616
+ className: "book-view",
616
617
  style: {
617
618
  width: VIEWPORT_WIDTH,
618
619
  height: VIEWPORT_HEIGHT,
619
- margin: 'auto'
620
+ margin: 'auto',
621
+ background: '#fff'
620
622
  },
621
623
  children: renderContent(0)
622
624
  })]
@@ -42,16 +42,16 @@ var HeaderBar = function HeaderBar(_ref) {
42
42
  setExportModalVisible(false);
43
43
  };
44
44
  return /*#__PURE__*/_jsxs("div", {
45
- className: "common-header-bar flex items-center justify-between h-[50px] px-4 bg-white border-b border-[#f0f0f0]",
45
+ className: "common-header-bar",
46
46
  children: [/*#__PURE__*/_jsxs("div", {
47
- className: "header-left flex items-center",
47
+ className: "header-left",
48
48
  children: [title && /*#__PURE__*/_jsx("span", {
49
- className: "text-lg font-bold mr-4",
49
+ className: "header-title",
50
50
  children: title
51
51
  }), /*#__PURE__*/_jsxs(Space, {
52
52
  size: 0,
53
53
  children: [mode !== 'modal' && /*#__PURE__*/_jsxs("div", {
54
- className: "flex items-center",
54
+ className: "header-item",
55
55
  children: [/*#__PURE__*/_jsxs(Button, {
56
56
  type: "link",
57
57
  onClick: onBack,
@@ -68,7 +68,7 @@ var HeaderBar = function HeaderBar(_ref) {
68
68
  className: "dfb-divider"
69
69
  })]
70
70
  }), /*#__PURE__*/_jsxs("div", {
71
- className: "flex items-center",
71
+ className: "header-item",
72
72
  children: [/*#__PURE__*/_jsxs(Button, {
73
73
  type: "link",
74
74
  onClick: onRefresh,
@@ -170,7 +170,7 @@ var HeaderBar = function HeaderBar(_ref) {
170
170
  })]
171
171
  })]
172
172
  }), /*#__PURE__*/_jsxs("div", {
173
- className: "header-right flex items-center",
173
+ className: "header-right",
174
174
  children: [/*#__PURE__*/_jsxs(Button, {
175
175
  type: "link",
176
176
  onClick: onPrint,
@@ -5,7 +5,7 @@ import { Checkbox, ConfigProvider } from 'antd';
5
5
  import { jsx as _jsx } from "react/jsx-runtime";
6
6
  import { jsxs as _jsxs } from "react/jsx-runtime";
7
7
  var ProjectCover = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
8
- var _user$company, _info$dt, _user$info;
8
+ var _user$company, _info$edr04bs, _info$edr04bs2, _info$edr04bs3, _info$edr04bs4, _info$dt, _user$info;
9
9
  var documentInfo = _ref.documentInfo,
10
10
  _ref$themeColor = _ref.themeColor,
11
11
  themeColor = _ref$themeColor === void 0 ? '#4baae3' : _ref$themeColor;
@@ -21,6 +21,70 @@ var ProjectCover = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
21
21
  lineWidth: 2
22
22
  }
23
23
  };
24
+ var title = (info === null || info === void 0 ? void 0 : info.title) || '高企研发';
25
+ var isFourFlows = title === '四流合一档案';
26
+
27
+ // 定义统计项配置
28
+ var statsConfig = isFourFlows ? [{
29
+ label: '发票',
30
+ checked: !!(info !== null && info !== void 0 && (_info$edr04bs = info.edr04bs) !== null && _info$edr04bs !== void 0 && _info$edr04bs.length),
31
+ count: (info === null || info === void 0 || (_info$edr04bs2 = info.edr04bs) === null || _info$edr04bs2 === void 0 ? void 0 : _info$edr04bs2.length) || '-'
32
+ }, {
33
+ label: '合同',
34
+ checked: false,
35
+ count: '-'
36
+ }, {
37
+ label: '物流',
38
+ checked: false,
39
+ count: '-'
40
+ }, {
41
+ label: '钱流',
42
+ checked: false,
43
+ count: '-'
44
+ }] : [{
45
+ label: '纪要',
46
+ checked: !!(info !== null && info !== void 0 && (_info$edr04bs3 = info.edr04bs) !== null && _info$edr04bs3 !== void 0 && _info$edr04bs3.length),
47
+ count: (info === null || info === void 0 || (_info$edr04bs4 = info.edr04bs) === null || _info$edr04bs4 === void 0 ? void 0 : _info$edr04bs4.length) || '-'
48
+ }, {
49
+ label: '人员',
50
+ checked: false,
51
+ count: '1'
52
+ }, {
53
+ label: '费用',
54
+ checked: false,
55
+ count: '3'
56
+ }, {
57
+ label: '说明书',
58
+ checked: false,
59
+ count: '1'
60
+ }];
61
+
62
+ // 渲染统计行辅助函数
63
+ var renderStatsRow = function renderStatsRow(startIndex) {
64
+ return /*#__PURE__*/_jsx("div", {
65
+ className: "project-cover-stats-row",
66
+ style: startIndex > 0 ? {
67
+ borderTop: 'none'
68
+ } : {},
69
+ children: statsConfig.slice(startIndex, startIndex + 2).map(function (item, idx) {
70
+ return /*#__PURE__*/_jsxs(React.Fragment, {
71
+ children: [/*#__PURE__*/_jsx("div", {
72
+ className: "stat-cell-label",
73
+ children: /*#__PURE__*/_jsxs(ConfigProvider, {
74
+ theme: checkboxTheme,
75
+ children: [/*#__PURE__*/_jsx(Checkbox, {
76
+ checked: item.checked,
77
+ disabled: true
78
+ }), " ", item.label]
79
+ })
80
+ }), /*#__PURE__*/_jsx("div", {
81
+ className: "stat-cell-value",
82
+ children: item.count
83
+ })]
84
+ }, item.label);
85
+ })
86
+ });
87
+ };
24
88
  return /*#__PURE__*/_jsx("div", {
25
89
  className: "project-cover-container",
26
90
  style: {
@@ -35,66 +99,9 @@ var ProjectCover = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
35
99
  className: "project-cover-header",
36
100
  children: /*#__PURE__*/_jsx("h1", {
37
101
  className: "project-cover-title",
38
- children: (info === null || info === void 0 ? void 0 : info.title) || '高企研发'
102
+ children: title
39
103
  })
40
- }), /*#__PURE__*/_jsxs("div", {
41
- className: "project-cover-stats-row",
42
- children: [/*#__PURE__*/_jsx("div", {
43
- className: "stat-cell-label",
44
- children: /*#__PURE__*/_jsxs(ConfigProvider, {
45
- theme: checkboxTheme,
46
- children: [/*#__PURE__*/_jsx(Checkbox, {
47
- checked: !!(info !== null && info !== void 0 && info.edr04bs && info.edr04bs.length > 0),
48
- disabled: true
49
- }), " \u7EAA\u8981"]
50
- })
51
- }), /*#__PURE__*/_jsx("div", {
52
- className: "stat-cell-value",
53
- children: info !== null && info !== void 0 && info.edr04bs && info.edr04bs.length > 0 ? info.edr04bs.length : '-'
54
- }), /*#__PURE__*/_jsx("div", {
55
- className: "stat-cell-label",
56
- children: /*#__PURE__*/_jsxs(ConfigProvider, {
57
- theme: checkboxTheme,
58
- children: [/*#__PURE__*/_jsx(Checkbox, {
59
- checked: false,
60
- disabled: true
61
- }), " \u4EBA\u5458"]
62
- })
63
- }), /*#__PURE__*/_jsx("div", {
64
- className: "stat-cell-value",
65
- children: "1"
66
- })]
67
- }), /*#__PURE__*/_jsxs("div", {
68
- className: "project-cover-stats-row",
69
- style: {
70
- borderTop: 'none'
71
- },
72
- children: [/*#__PURE__*/_jsx("div", {
73
- className: "stat-cell-label",
74
- children: /*#__PURE__*/_jsxs(ConfigProvider, {
75
- theme: checkboxTheme,
76
- children: [/*#__PURE__*/_jsx(Checkbox, {
77
- checked: false,
78
- disabled: true
79
- }), " \u8D39\u7528"]
80
- })
81
- }), /*#__PURE__*/_jsx("div", {
82
- className: "stat-cell-value",
83
- children: "3"
84
- }), /*#__PURE__*/_jsx("div", {
85
- className: "stat-cell-label",
86
- children: /*#__PURE__*/_jsxs(ConfigProvider, {
87
- theme: checkboxTheme,
88
- children: [/*#__PURE__*/_jsx(Checkbox, {
89
- checked: false,
90
- disabled: true
91
- }), " \u8BF4\u660E\u4E66"]
92
- })
93
- }), /*#__PURE__*/_jsx("div", {
94
- className: "stat-cell-value",
95
- children: "1"
96
- })]
97
- }), /*#__PURE__*/_jsxs("div", {
104
+ }), renderStatsRow(0), renderStatsRow(2), /*#__PURE__*/_jsxs("div", {
98
105
  className: "project-cover-details",
99
106
  children: [/*#__PURE__*/_jsxs("div", {
100
107
  className: "detail-row",
@@ -10,7 +10,7 @@ import { renderPdfPageToDataUrl, renderImageToDataUrl } from "./exportPdf";
10
10
  */
11
11
  var renderCoverToImage = /*#__PURE__*/function () {
12
12
  var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(options) {
13
- var data, archiveInfo, _options$themeColor, themeColor, _options$companyName, companyName, _options$isProjectMod, isProjectMode, acc51c, div, html, _info$user, info, coverData, _archiveInfo$nsp24c, _coverData, canvas;
13
+ var data, archiveInfo, _options$themeColor, themeColor, _options$companyName, companyName, _options$isProjectMod, isProjectMode, acc51c, div, html, _info$edr04bs, _info$edr04bs2, _info$edr04bs3, _info$edr04bs4, _info$user, info, title, isFourFlows, stats, coverData, renderHtmlStatsRow, _archiveInfo$nsp24c, _coverData, canvas;
14
14
  return _regeneratorRuntime().wrap(function _callee$(_context) {
15
15
  while (1) switch (_context.prev = _context.next) {
16
16
  case 0:
@@ -26,6 +26,41 @@ var renderCoverToImage = /*#__PURE__*/function () {
26
26
  html = '';
27
27
  if (isProjectMode) {
28
28
  info = archiveInfo || {};
29
+ title = (info === null || info === void 0 ? void 0 : info.title) || '高企研发';
30
+ isFourFlows = title === '四流合一档案';
31
+ stats = isFourFlows ? [{
32
+ label: '发票',
33
+ checked: !!(info !== null && info !== void 0 && (_info$edr04bs = info.edr04bs) !== null && _info$edr04bs !== void 0 && _info$edr04bs.length),
34
+ count: (info === null || info === void 0 || (_info$edr04bs2 = info.edr04bs) === null || _info$edr04bs2 === void 0 ? void 0 : _info$edr04bs2.length) || '-'
35
+ }, {
36
+ label: '合同',
37
+ checked: false,
38
+ count: '-'
39
+ }, {
40
+ label: '物流',
41
+ checked: false,
42
+ count: '-'
43
+ }, {
44
+ label: '钱流',
45
+ checked: false,
46
+ count: '-'
47
+ }] : [{
48
+ label: '纪要',
49
+ checked: !!(info !== null && info !== void 0 && (_info$edr04bs3 = info.edr04bs) !== null && _info$edr04bs3 !== void 0 && _info$edr04bs3.length),
50
+ count: (info === null || info === void 0 || (_info$edr04bs4 = info.edr04bs) === null || _info$edr04bs4 === void 0 ? void 0 : _info$edr04bs4.length) || '-'
51
+ }, {
52
+ label: '人员',
53
+ checked: false,
54
+ count: '1'
55
+ }, {
56
+ label: '费用',
57
+ checked: false,
58
+ count: '3'
59
+ }, {
60
+ label: '说明书',
61
+ checked: false,
62
+ count: '1'
63
+ }];
29
64
  coverData = {
30
65
  year: info !== null && info !== void 0 && info.dt ? info.dt.slice(0, 4) : dayjs().format('YYYY'),
31
66
  archiveNo: (info === null || info === void 0 ? void 0 : info.code) || '-',
@@ -36,10 +71,15 @@ var renderCoverToImage = /*#__PURE__*/function () {
36
71
  creator: (info === null || info === void 0 ? void 0 : info.full_name) || (info === null || info === void 0 || (_info$user = info.user) === null || _info$user === void 0 || (_info$user = _info$user.info) === null || _info$user === void 0 ? void 0 : _info$user.name) || '管理员',
37
72
  totalVolumes: (info === null || info === void 0 ? void 0 : info.totalVolumes) || '',
38
73
  volumeNumber: (info === null || info === void 0 ? void 0 : info.volumeNumber) || '',
39
- edr04bs: (info === null || info === void 0 ? void 0 : info.edr04bs) || [],
40
- title: (info === null || info === void 0 ? void 0 : info.title) || '高企研发'
74
+ title: title
41
75
  };
42
- html = "\n <div style=\"width: 600px; height: 800px; background-color: ".concat(themeColor, "; display: flex; flex-direction: column; padding: 30px; box-sizing: border-box; font-family: SimSun, STSong, serif;\">\n <div style=\"border: 5px solid #000; padding: 5px; height: 100%; box-sizing: border-box;\">\n <div style=\"border: 2px solid #000; height: 100%; display: flex; flex-direction: column; box-sizing: border-box;\">\n <div style=\"text-align: center; color: #000; padding: 8px 0;\">\n <h1 style=\"font-size: 54px; margin: 0; font-weight: 900; letter-spacing: 8px;\">").concat(coverData.title, "</h1>\n </div>\n\n <div style=\"display: flex; border-top: 1px solid #000; border-bottom: 1px solid #000;\">\n <div style=\"flex: 1; text-align: center; padding: 8px; border-right: 1px solid #000; font-weight: bold; display: flex; align-items: center; justify-content: center; gap: 8px;\">").concat(coverData.edr04bs.length > 0 ? '☑' : '☐', " \u7EAA\u8981</div>\n <div style=\"flex: 1; text-align: center; padding: 8px; border-right: 1px solid #000; font-family: 'Times New Roman'; font-size: 18px; font-weight: bold;\">").concat(coverData.edr04bs.length > 0 ? coverData.edr04bs.length : '-', "</div>\n <div style=\"flex: 1; text-align: center; padding: 8px; border-right: 1px solid #000; font-weight: bold; display: flex; align-items: center; justify-content: center; gap: 8px;\">\u2610 \u4EBA\u5458</div>\n <div style=\"flex: 1; text-align: center; padding: 8px; font-family: 'Times New Roman'; font-size: 18px; font-weight: bold;\">1</div>\n </div>\n <div style=\"display: flex; border-bottom: 1px solid #000;\">\n <div style=\"flex: 1; text-align: center; padding: 8px; border-right: 1px solid #000; font-weight: bold; display: flex; align-items: center; justify-content: center; gap: 8px;\">\u2610 \u8D39\u7528</div>\n <div style=\"flex: 1; text-align: center; padding: 8px; border-right: 1px solid #000; font-family: 'Times New Roman'; font-size: 18px; font-weight: bold;\">3</div>\n <div style=\"flex: 1; text-align: center; padding: 8px; border-right: 1px solid #000; font-weight: bold; display: flex; align-items: center; justify-content: center; gap: 8px;\">\u2610 \u8BF4\u660E\u4E66</div>\n <div style=\"flex: 1; text-align: center; padding: 8px; font-family: 'Times New Roman'; font-size: 18px; font-weight: bold;\">1</div>\n </div>\n\n <div style=\" display: flex; flex-direction: column;\">\n <div style=\"display: flex; border-bottom: 1px solid #000;\"><div style=\"width: 100px; padding: 8px; font-weight: bold; border-right: 1px solid #000;\">\u5E74\u5EA6</div><div style=\"flex: 1; padding: 8px; font-weight: 600;\">").concat(coverData.year, "</div></div>\n <div style=\"display: flex; border-bottom: 1px solid #000;\"><div style=\"width: 100px; padding: 8px; font-weight: bold; border-right: 1px solid #000;\">\u6863\u6848\u53F7</div><div style=\"flex: 1; padding: 8px; font-weight: 600;\">").concat(coverData.archiveNo, "</div></div>\n <div style=\"display: flex; border-bottom: 1px solid #000;\"><div style=\"width: 100px; padding: 8px; font-weight: bold; border-right: 1px solid #000;\">\u9879\u76EE\u540D\u79F0</div><div style=\"flex: 1; padding: 8px; font-weight: 600;\">").concat(coverData.projectName, "</div></div>\n <div style=\"display: flex; border-bottom: 1px solid #000;\"><div style=\"width: 100px; padding: 8px; font-weight: bold; border-right: 1px solid #000;\">\u9879\u76EE\u7F16\u53F7</div><div style=\"flex: 1; padding: 8px; font-weight: 600;\">").concat(coverData.projectNo, "</div></div>\n <div style=\"display: flex; border-bottom: 1px solid #000;\"><div style=\"width: 100px; padding: 8px; font-weight: bold; border-right: 1px solid #000;\">\u7F16\u5236\u5355\u4F4D</div><div style=\"flex: 1; padding: 8px; font-weight: 600;\">").concat(coverData.company, "</div></div>\n <div style=\"display: flex; border-bottom: 1px solid #000;\"><div style=\"width: 100px; padding: 8px; font-weight: bold; border-right: 1px solid #000;\">\u7F16\u5236\u65E5\u671F</div><div style=\"flex: 1; padding: 8px; font-weight: 600;\">").concat(coverData.date, "</div></div>\n <div style=\"display: flex; border-bottom: 1px solid #000;\"><div style=\"width: 100px; padding: 8px; font-weight: bold; border-right: 1px solid #000;\">\u7F16\u5236\u4EBA</div><div style=\"flex: 1; padding: 8px; font-weight: 600;\">").concat(coverData.creator, "</div></div>\n </div>\n\n <div style=\"display: flex; border-bottom: 1px solid #000;\">\n <div style=\"flex: 1; text-align: center; padding: 10px; border-right: 1px solid #000; font-weight: bold; display: flex; align-items: center; justify-content: center; font-size: 16px;\">\u51ED\u8BC1</div>\n <div style=\"flex: 1; text-align: center; padding: 10px; border-right: 1px solid #000; font-weight: bold; display: flex; align-items: center; justify-content: center; font-size: 16px;\">\u5F20\u9644\u4EF6</div>\n <div style=\"flex: 1; text-align: center; padding: 10px; font-weight: bold; display: flex; align-items: center; justify-content: center; font-size: 16px;\">\u5F20</div>\n </div>\n <div style=\"display: flex; border-bottom: 1px solid #000;\">\n <div style=\"flex: 1; text-align: center; padding: 10px; border-right: 1px solid #000; font-weight: bold; display: flex; align-items: center; justify-content: center; font-size: 16px;\">\u5171</div>\n <div style=\"flex: 1; text-align: center; padding: 10px; border-right: 1px solid #000; font-weight: bold; display: flex; align-items: center; justify-content: center; font-size: 16px;\">").concat(coverData.totalVolumes, "\u518C\u7B2C</div>\n <div style=\"flex: 1; text-align: center; padding: 10px; font-weight: bold; display: flex; align-items: center; justify-content: center; font-size: 16px;\">").concat(coverData.volumeNumber, "\u518C</div>\n </div>\n </div>\n </div>\n </div>\n ");
76
+ renderHtmlStatsRow = function renderHtmlStatsRow(startIndex) {
77
+ var rowStats = stats.slice(startIndex, startIndex + 2);
78
+ return "\n <div style=\"display: flex; border-bottom: 1px solid #000; ".concat(startIndex === 0 ? 'border-top: 1px solid #000;' : '', "\">\n ").concat(rowStats.map(function (s, i) {
79
+ return "\n <div style=\"flex: 1; text-align: center; padding: 8px; border-right: 1px solid #000; font-weight: bold; display: flex; align-items: center; justify-content: center; gap: 8px;\">\n ".concat(s.checked ? '☑' : '☐', " ").concat(s.label, "\n </div>\n <div style=\"flex: 1; text-align: center; padding: 8px; ").concat(i === 0 ? 'border-right: 1px solid #000;' : '', " font-family: 'Times New Roman'; font-size: 18px; font-weight: bold;\">\n ").concat(s.count, "\n </div>\n ");
80
+ }).join(''), "\n </div>\n ");
81
+ };
82
+ html = "\n <div style=\"width: 600px; height: 800px; background-color: ".concat(themeColor, "; display: flex; flex-direction: column; padding: 30px; box-sizing: border-box; font-family: SimSun, STSong, serif;\">\n <div style=\"border: 5px solid #000; padding: 5px; height: 100%; box-sizing: border-box;\">\n <div style=\"border: 2px solid #000; height: 100%; display: flex; flex-direction: column; box-sizing: border-box;\">\n <div style=\"text-align: center; color: #000; padding: 8px 0;\">\n <h1 style=\"font-size: 54px; margin: 0; font-weight: 900; letter-spacing: 8px;padding: 14px 0;\">").concat(coverData.title, "</h1>\n </div>\n\n ").concat(renderHtmlStatsRow(0), "\n ").concat(renderHtmlStatsRow(2), "\n\n <div style=\" display: flex; flex-direction: column;\">\n <div style=\"display: flex; border-bottom: 1px solid #000;\"><div style=\"width: 100px; padding: 8px; font-weight: bold; border-right: 1px solid #000;\">\u5E74\u5EA6</div><div style=\"flex: 1; padding: 8px; font-weight: 600;\">").concat(coverData.year, "</div></div>\n <div style=\"display: flex; border-bottom: 1px solid #000;\"><div style=\"width: 100px; padding: 8px; font-weight: bold; border-right: 1px solid #000;\">\u6863\u6848\u53F7</div><div style=\"flex: 1; padding: 8px; font-weight: 600;\">").concat(coverData.archiveNo, "</div></div>\n <div style=\"display: flex; border-bottom: 1px solid #000;\"><div style=\"width: 100px; padding: 8px; font-weight: bold; border-right: 1px solid #000;\">\u9879\u76EE\u540D\u79F0</div><div style=\"flex: 1; padding: 8px; font-weight: 600;\">").concat(coverData.projectName, "</div></div>\n <div style=\"display: flex; border-bottom: 1px solid #000;\"><div style=\"width: 100px; padding: 8px; font-weight: bold; border-right: 1px solid #000;\">\u9879\u76EE\u7F16\u53F7</div><div style=\"flex: 1; padding: 8px; font-weight: 600;\">").concat(coverData.projectNo, "</div></div>\n <div style=\"display: flex; border-bottom: 1px solid #000;\"><div style=\"width: 100px; padding: 8px; font-weight: bold; border-right: 1px solid #000;\">\u7F16\u5236\u5355\u4F4D</div><div style=\"flex: 1; padding: 8px; font-weight: 600;\">").concat(coverData.company, "</div></div>\n <div style=\"display: flex; border-bottom: 1px solid #000;\"><div style=\"width: 100px; padding: 8px; font-weight: bold; border-right: 1px solid #000;\">\u7F16\u5236\u65E5\u671F</div><div style=\"flex: 1; padding: 8px; font-weight: 600;\">").concat(coverData.date, "</div></div>\n <div style=\"display: flex; border-bottom: 1px solid #000;\"><div style=\"width: 100px; padding: 8px; font-weight: bold; border-right: 1px solid #000;\">\u7F16\u5236\u4EBA</div><div style=\"flex: 1; padding: 8px; font-weight: 600;\">").concat(coverData.creator, "</div></div>\n </div>\n\n <div style=\"display: flex; border-bottom: 1px solid #000;\">\n <div style=\"flex: 1; text-align: center; padding: 10px; border-right: 1px solid #000; font-weight: bold; display: flex; align-items: center; justify-content: center; font-size: 16px;\">\u51ED\u8BC1</div>\n <div style=\"flex: 1; text-align: center; padding: 10px; border-right: 1px solid #000; font-weight: bold; display: flex; align-items: center; justify-content: center; font-size: 16px;\">\u5F20\u9644\u4EF6</div>\n <div style=\"flex: 1; text-align: center; padding: 10px; font-weight: bold; display: flex; align-items: center; justify-content: center; font-size: 16px;\">\u5F20</div>\n </div>\n <div style=\"display: flex; border-bottom: 1px solid #000;\">\n <div style=\"flex: 1; text-align: center; padding: 10px; border-right: 1px solid #000; font-weight: bold; display: flex; align-items: center; justify-content: center; font-size: 16px;\">\u5171</div>\n <div style=\"flex: 1; text-align: center; padding: 10px; border-right: 1px solid #000; font-weight: bold; display: flex; align-items: center; justify-content: center; font-size: 16px;\">").concat(coverData.totalVolumes, "\u518C\u7B2C</div>\n <div style=\"flex: 1; text-align: center; padding: 10px; font-weight: bold; display: flex; align-items: center; justify-content: center; font-size: 16px;\">").concat(coverData.volumeNumber, "\u518C</div>\n </div>\n </div>\n </div>\n </div>\n ");
43
83
  } else {
44
84
  _coverData = {
45
85
  company: companyName,
@@ -1,3 +1,4 @@
1
1
  export { default as DocumentFlipBook } from './DocumentFlipBook';
2
2
  export { setupPdfWorker } from './utils';
3
3
  export * from './types';
4
+ import './index.less';
package/dist/esm/index.js CHANGED
@@ -1,3 +1,4 @@
1
1
  export { default as DocumentFlipBook } from "./DocumentFlipBook";
2
2
  export { setupPdfWorker } from "./utils";
3
- export * from "./types";
3
+ export * from "./types";
4
+ import "./index.less";
@@ -1,3 +1,33 @@
1
+ .common-header-bar {
2
+ display: flex;
3
+ align-items: center;
4
+ justify-content: space-between;
5
+ height: 50px;
6
+ padding: 0 16px;
7
+ background: #fff;
8
+ border-bottom: 1px solid #f0f0f0;
9
+
10
+ .header-left,
11
+ .header-right,
12
+ .header-item {
13
+ display: flex;
14
+ align-items: center;
15
+ }
16
+
17
+ .header-title {
18
+ font-size: 18px;
19
+ font-weight: bold;
20
+ margin-right: 16px;
21
+ }
22
+
23
+ .dfb-divider {
24
+ width: 1px;
25
+ height: 18px;
26
+ background: #e8e8e8;
27
+ margin: 0 8px;
28
+ }
29
+ }
30
+
1
31
  .book-page {
2
32
  width: 100%;
3
33
  height: 100%;
@@ -226,7 +256,7 @@
226
256
 
227
257
  .dfb-sideTabs {
228
258
  position: absolute;
229
- right: -18px; // 调整位置,使其紧贴书本边缘
259
+ right: 2px; // 调整位置,使其紧贴书本边缘
230
260
  top: 40px;
231
261
  display: flex;
232
262
  flex-direction: column;
@@ -235,7 +265,7 @@
235
265
  transition: all 0.3s ease;
236
266
 
237
267
  &.is-on-cover {
238
- right: -40px; // 封面是单页模式,标签需要向左移动(进入书壳内部边缘)
268
+ right: -42px; // 封面是单页模式,标签需要向左移动(进入书壳内部边缘)
239
269
  top: 40px;
240
270
  }
241
271
 
@@ -277,7 +307,7 @@
277
307
 
278
308
  &.is-active {
279
309
  position: relative;
280
- left: -8px;
310
+ left: -10px;
281
311
  width: 52px; // 选中态更长
282
312
  padding-left: 16px;
283
313
  font-weight: 700;
@@ -301,7 +331,7 @@
301
331
  }
302
332
 
303
333
  .is-on-activeTab {
304
- right: -8px !important;
334
+ right:12px !important;
305
335
  }
306
336
 
307
337
  .dfb-book-wrapper {
@@ -313,14 +343,14 @@
313
343
 
314
344
  .dfb-bookShell1 {
315
345
  position: relative;
316
- padding: 18px 0 18px 34px;
346
+ padding: 18px 0 18px 54px;
317
347
  background: transparent;
318
348
  transition: background-color 0.3s ease;
319
349
  }
320
350
 
321
351
  .dfb-bookShell {
322
352
  position: relative;
323
- padding: 18px 34px;
353
+ padding: 18px 54px;
324
354
  background: #9F7D4E;
325
355
  transition: background-color 0.3s ease;
326
356
 
@@ -549,6 +579,7 @@
549
579
  margin: 0;
550
580
  font-weight: 900;
551
581
  letter-spacing: 8px;
582
+ padding: 14px 0;
552
583
  }
553
584
  }
554
585
 
@@ -2,7 +2,7 @@ import { AttachmentItem, BuiltPage, PdfDocumentLike } from './types';
2
2
  export declare const setupPdfWorker: (customSrc?: string) => void;
3
3
  export declare const PDF_OPTIONS: {};
4
4
  export declare const PDF_PRELOAD_TIMEOUT = 60000;
5
- export declare const VIEWPORT_WIDTH = 570;
5
+ export declare const VIEWPORT_WIDTH = 520;
6
6
  export declare const VIEWPORT_HEIGHT = 670;
7
7
  export declare const HEIGHT = "100%";
8
8
  export declare const isPdfFile: (path: string) => boolean;
package/dist/esm/utils.js CHANGED
@@ -21,7 +21,7 @@ export var setupPdfWorker = function setupPdfWorker(customSrc) {
21
21
  setupPdfWorker();
22
22
  export var PDF_OPTIONS = {};
23
23
  export var PDF_PRELOAD_TIMEOUT = 60000; // 增加到 60 秒,适配超大文件或慢速网络
24
- export var VIEWPORT_WIDTH = 570;
24
+ export var VIEWPORT_WIDTH = 520;
25
25
  export var VIEWPORT_HEIGHT = 670;
26
26
  export var HEIGHT = '100%';
27
27
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cecee/document-flip-book",
3
- "version": "1.0.10",
3
+ "version": "1.0.13",
4
4
  "description": "A high-performance document flipbook component based on React and Ant Design.",
5
5
  "publishConfig": {
6
6
  "access": "public"