@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.
- package/dist/cjs/DocumentFlipBook.js +7 -5
- package/dist/cjs/HeaderBar.js +6 -6
- package/dist/cjs/ProjectCover.js +67 -60
- package/dist/cjs/exportHtml.js +44 -4
- package/dist/cjs/index.d.ts +1 -0
- package/dist/cjs/index.js +1 -0
- package/dist/cjs/index.less +37 -6
- package/dist/cjs/utils.d.ts +1 -1
- package/dist/cjs/utils.js +1 -1
- package/dist/esm/DocumentFlipBook.js +7 -5
- package/dist/esm/HeaderBar.js +6 -6
- package/dist/esm/ProjectCover.js +67 -60
- package/dist/esm/exportHtml.js +44 -4
- package/dist/esm/index.d.ts +1 -0
- package/dist/esm/index.js +2 -1
- package/dist/esm/index.less +37 -6
- package/dist/esm/utils.d.ts +1 -1
- package/dist/esm/utils.js +1 -1
- package/package.json +1 -1
|
@@ -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
|
|
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
|
|
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
|
})]
|
package/dist/cjs/HeaderBar.js
CHANGED
|
@@ -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
|
|
54
|
+
className: "common-header-bar",
|
|
55
55
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
56
|
-
className: "header-left
|
|
56
|
+
className: "header-left",
|
|
57
57
|
children: [title && /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
58
|
-
className: "
|
|
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: "
|
|
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: "
|
|
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
|
|
182
|
+
className: "header-right",
|
|
183
183
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_antd.Button, {
|
|
184
184
|
type: "link",
|
|
185
185
|
onClick: onPrint,
|
package/dist/cjs/ProjectCover.js
CHANGED
|
@@ -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:
|
|
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",
|
package/dist/cjs/exportHtml.js
CHANGED
|
@@ -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
|
-
|
|
49
|
-
title: (info === null || info === void 0 ? void 0 : info.title) || '高企研发'
|
|
83
|
+
title: title
|
|
50
84
|
};
|
|
51
|
-
|
|
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,
|
package/dist/cjs/index.d.ts
CHANGED
package/dist/cjs/index.js
CHANGED
package/dist/cjs/index.less
CHANGED
|
@@ -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:
|
|
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: -
|
|
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: -
|
|
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:
|
|
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
|
|
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
|
|
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
|
|
package/dist/cjs/utils.d.ts
CHANGED
|
@@ -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 =
|
|
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 =
|
|
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
|
|
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
|
|
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
|
})]
|
package/dist/esm/HeaderBar.js
CHANGED
|
@@ -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
|
|
45
|
+
className: "common-header-bar",
|
|
46
46
|
children: [/*#__PURE__*/_jsxs("div", {
|
|
47
|
-
className: "header-left
|
|
47
|
+
className: "header-left",
|
|
48
48
|
children: [title && /*#__PURE__*/_jsx("span", {
|
|
49
|
-
className: "
|
|
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: "
|
|
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: "
|
|
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
|
|
173
|
+
className: "header-right",
|
|
174
174
|
children: [/*#__PURE__*/_jsxs(Button, {
|
|
175
175
|
type: "link",
|
|
176
176
|
onClick: onPrint,
|
package/dist/esm/ProjectCover.js
CHANGED
|
@@ -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:
|
|
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",
|
package/dist/esm/exportHtml.js
CHANGED
|
@@ -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
|
-
|
|
40
|
-
title: (info === null || info === void 0 ? void 0 : info.title) || '高企研发'
|
|
74
|
+
title: title
|
|
41
75
|
};
|
|
42
|
-
|
|
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,
|
package/dist/esm/index.d.ts
CHANGED
package/dist/esm/index.js
CHANGED
package/dist/esm/index.less
CHANGED
|
@@ -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:
|
|
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: -
|
|
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: -
|
|
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:
|
|
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
|
|
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
|
|
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
|
|
package/dist/esm/utils.d.ts
CHANGED
|
@@ -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 =
|
|
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 =
|
|
24
|
+
export var VIEWPORT_WIDTH = 520;
|
|
25
25
|
export var VIEWPORT_HEIGHT = 670;
|
|
26
26
|
export var HEIGHT = '100%';
|
|
27
27
|
|