|
@@ -19,7 +19,11 @@ const ExportType = [
|
|
];
|
|
];
|
|
const ExportTypeMap = getMap(ExportType, 'value', 'label');
|
|
const ExportTypeMap = getMap(ExportType, 'value', 'label');
|
|
const AnswerIndex = ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K'];
|
|
const AnswerIndex = ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K'];
|
|
-
|
|
+const width = 595;
|
|
|
|
+const height = 1050;
|
|
|
|
+const top = 72;
|
|
|
|
+const left = 93;
|
|
|
|
+const size = 10;
|
|
export default class extends Page {
|
|
export default class extends Page {
|
|
initState() {
|
|
initState() {
|
|
const { info } = this.props.user;
|
|
const { info } = this.props.user;
|
|
@@ -34,6 +38,30 @@ export default class extends Page {
|
|
My.exportDetail(id)
|
|
My.exportDetail(id)
|
|
.then(result => {
|
|
.then(result => {
|
|
this.setState({ data: result });
|
|
this.setState({ data: result });
|
|
|
|
+ setTimeout(() => {
|
|
|
|
+ const { waters } = result;
|
|
|
|
+ const waterList = [];
|
|
|
|
+ const pageSize = Math.ceil(this.view.offsetHeight / height);
|
|
|
|
+ console.log(pageSize, this.view.offsetHeight);
|
|
|
|
+ for (let i = 0; i < pageSize; i += 1) {
|
|
|
|
+ const a = [top, (height / 2 - top) / 2 - size / 2 + top, height / 2 - size / 2, (height / 2 + (height - top - height / 2) / 2) - size / 2, height - top - size];
|
|
|
|
+ for (let j = 0; j < 5; j += 1) {
|
|
|
|
+ waterList.push({
|
|
|
|
+ style: { left, top: a[j] + height * i, textAlign: 'left' },
|
|
|
|
+ text: waters[0],
|
|
|
|
+ });
|
|
|
|
+ waterList.push({
|
|
|
|
+ style: { left: width / 2, top: a[j] + height * i, textAlign: 'center' },
|
|
|
|
+ text: waters[1],
|
|
|
|
+ });
|
|
|
|
+ waterList.push({
|
|
|
|
+ style: { left: width - left, top: a[j] + height * i, textAlign: 'right' },
|
|
|
|
+ text: waters[0],
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ this.setState({ waterList });
|
|
|
|
+ }, 1000);
|
|
});
|
|
});
|
|
}
|
|
}
|
|
|
|
|
|
@@ -50,9 +78,14 @@ export default class extends Page {
|
|
}
|
|
}
|
|
|
|
|
|
renderView() {
|
|
renderView() {
|
|
- const { data = {}, showTip, nextTips } = this.state;
|
|
+ const { data = {}, showTip, nextTips, waterList = [] } = this.state;
|
|
return (
|
|
return (
|
|
- <div>
|
|
+ <div ref={(ref) => {
|
|
|
|
+ if (ref) this.view = ref;
|
|
|
|
+ }}>
|
|
|
|
+ {waterList.map(row => {
|
|
|
|
+ return <div className="water" style={row.style}>{row.text}</div>;
|
|
|
|
+ })}
|
|
{this.renderHead()}
|
|
{this.renderHead()}
|
|
{data.type !== 'note_course' && this.renderQuestion()}
|
|
{data.type !== 'note_course' && this.renderQuestion()}
|
|
{data.type === 'note_course' && this.renderNote()}
|
|
{data.type === 'note_course' && this.renderNote()}
|