@hailin-zheng/editor-core 1.1.24 → 1.1.26
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/index-cjs.js +13 -1319
- package/index-cjs.js.map +1 -1
- package/index.js +13 -1318
- package/index.js.map +1 -1
- package/med_editor/framework/element-util.d.ts +1 -1
- package/med_editor/texteditor.d.ts +1 -1
- package/package.json +1 -1
package/index.js
CHANGED
@@ -4,7 +4,6 @@ import * as acor from 'acorn';
|
|
4
4
|
import { generate } from 'astring';
|
5
5
|
import estraverse from 'estraverse';
|
6
6
|
import * as bwipjs from 'bwip-js';
|
7
|
-
import moment$1 from 'moment/moment';
|
8
7
|
|
9
8
|
/**
|
10
9
|
* 元素事件
|
@@ -3665,7 +3664,7 @@ class DocumentFooterRenderObject extends BlockContainerRenderObject {
|
|
3665
3664
|
const { render, position } = e;
|
3666
3665
|
render.tran(() => {
|
3667
3666
|
//判断页眉是否为输入内容
|
3668
|
-
const isFooterEmpty = ElementUtil.
|
3667
|
+
const isFooterEmpty = ElementUtil.checkEmptyRenderContent(this);
|
3669
3668
|
if (this.element.disableClick && render.drawMode === 'view') {
|
3670
3669
|
if (isFooterEmpty) {
|
3671
3670
|
render.contentContext.setGlobalAlpha(0);
|
@@ -3742,7 +3741,7 @@ class DocumentHeaderRenderObject extends BlockContainerRenderObject {
|
|
3742
3741
|
const { render, position } = e;
|
3743
3742
|
render.tran(() => {
|
3744
3743
|
//判断页眉是否为输入内容
|
3745
|
-
const isHeaderEmpty = ElementUtil.
|
3744
|
+
const isHeaderEmpty = ElementUtil.checkEmptyRenderContent(this);
|
3746
3745
|
//存在输入内容时,绘制页眉-页体分割线
|
3747
3746
|
if (!isHeaderEmpty || !this.element.disableClick) {
|
3748
3747
|
const headerLineY = this.rect.height;
|
@@ -6202,6 +6201,7 @@ class ElementUtil {
|
|
6202
6201
|
canvas.style.height = scaleHeight + 'px';
|
6203
6202
|
canvas.width = scaleWidth * dpr;
|
6204
6203
|
canvas.height = scaleHeight * dpr;
|
6204
|
+
ctx.textBaseline = 'top';
|
6205
6205
|
ctx.scale(dpr, dpr);
|
6206
6206
|
}
|
6207
6207
|
// static setOffscreenCanvas(canvas: OffscreenCanvas, ctx: OffscreenCanvasRenderingContext2D, viewOptions: { width: number, height: number }, scale: number = 1): void {
|
@@ -7443,7 +7443,7 @@ class ElementUtil {
|
|
7443
7443
|
* 校验是否为空内容
|
7444
7444
|
* @param ele
|
7445
7445
|
*/
|
7446
|
-
static
|
7446
|
+
static checkEmptyRenderContent(ele) {
|
7447
7447
|
if (ele.length === 1) {
|
7448
7448
|
const firstRender = ele.getChild(0);
|
7449
7449
|
if (firstRender instanceof ParagraphRenderObject) {
|
@@ -17285,6 +17285,9 @@ class ElementTrackManage {
|
|
17285
17285
|
//ele获取的为父容器
|
17286
17286
|
if (index === parentIndex + 1) {
|
17287
17287
|
if (ele instanceof BranchElement) {
|
17288
|
+
if (ele.type === 'tbc' && ele.getChildLength() === 2) {
|
17289
|
+
ele.clearItems();
|
17290
|
+
}
|
17288
17291
|
ele.addChild(target, 0);
|
17289
17292
|
return;
|
17290
17293
|
}
|
@@ -18815,7 +18818,7 @@ class ViewPaint {
|
|
18815
18818
|
this.init();
|
18816
18819
|
}
|
18817
18820
|
init() {
|
18818
|
-
this.ctx.textBaseline = '
|
18821
|
+
this.ctx.textBaseline = 'top';
|
18819
18822
|
}
|
18820
18823
|
/**
|
18821
18824
|
* 更新绘制画布大小
|
@@ -18842,8 +18845,8 @@ class ViewPaint {
|
|
18842
18845
|
this.ctx.save();
|
18843
18846
|
this.ctx.fillStyle = textProps.color;
|
18844
18847
|
this.ctx.font = textProps.getFont();
|
18845
|
-
const vertHeight = textProps.vertAlign === 'superscript' ? 0 : height;
|
18846
|
-
this.ctx.fillText(text, x, y + vertHeight
|
18848
|
+
const vertHeight = 0; //textProps.vertAlign === 'superscript' ? 0 : height;
|
18849
|
+
this.ctx.fillText(text, x, y + vertHeight);
|
18847
18850
|
this.ctx.restore();
|
18848
18851
|
if (textProps.linethrough) {
|
18849
18852
|
this.drawHoriLine(x, y + (Math.ceil(height / 2)), width, textProps.color, 1);
|
@@ -20407,1314 +20410,6 @@ function pointInPoly(pt, poly) {
|
|
20407
20410
|
return c;
|
20408
20411
|
}
|
20409
20412
|
|
20410
|
-
const timelineConfig = {
|
20411
|
-
fontSize: 12,
|
20412
|
-
fontName: '宋体',
|
20413
|
-
/**
|
20414
|
-
* 单个时刻的宽度,像素
|
20415
|
-
*/
|
20416
|
-
timeTickWidth: 14,
|
20417
|
-
/**
|
20418
|
-
* 纵轴一个单位的高度
|
20419
|
-
*/
|
20420
|
-
timeValueHeight: 20,
|
20421
|
-
/**
|
20422
|
-
* 单个时刻宽度代表的小时数
|
20423
|
-
*/
|
20424
|
-
timeTickHours: 4,
|
20425
|
-
/**
|
20426
|
-
* 体温点的大小
|
20427
|
-
*/
|
20428
|
-
temperaturePointSize: 4,
|
20429
|
-
/**
|
20430
|
-
* 心率点的大小
|
20431
|
-
*/
|
20432
|
-
heartRatePointSize: 4,
|
20433
|
-
temperatureModels: [42, 41, 40, 39, 38, 37, 36, 35],
|
20434
|
-
heartRateModels: [180, 160, 140, 120, 100, 80, 40, 20],
|
20435
|
-
valueRuleCounts: 8,
|
20436
|
-
/**
|
20437
|
-
* 时刻头部高度
|
20438
|
-
*/
|
20439
|
-
tickHeaderHeight: 20,
|
20440
|
-
/**
|
20441
|
-
* 体温符号
|
20442
|
-
*/
|
20443
|
-
temperatureSymbol: '℃',
|
20444
|
-
heartRateSymbol: 'BPM'
|
20445
|
-
};
|
20446
|
-
class TimelineBaseControl extends AbsolutePanel {
|
20447
|
-
startTime;
|
20448
|
-
showDays = 0;
|
20449
|
-
constructor() {
|
20450
|
-
super();
|
20451
|
-
this.border = 1;
|
20452
|
-
this.borderColor = '#000';
|
20453
|
-
this.bgColor = '#fff';
|
20454
|
-
}
|
20455
|
-
measureOverride(e, availableSize) {
|
20456
|
-
this.build(e);
|
20457
|
-
return super.measureOverride(e, availableSize);
|
20458
|
-
}
|
20459
|
-
isBuild = false;
|
20460
|
-
build(e) {
|
20461
|
-
if (this.isBuild) {
|
20462
|
-
return;
|
20463
|
-
}
|
20464
|
-
this.clearChildren();
|
20465
|
-
this.buildOverride(e);
|
20466
|
-
this.isBuild = true;
|
20467
|
-
}
|
20468
|
-
reBuild() {
|
20469
|
-
this.isBuild = false;
|
20470
|
-
}
|
20471
|
-
buildOverride(e) {
|
20472
|
-
}
|
20473
|
-
}
|
20474
|
-
class TickContainer extends AbsolutePanel {
|
20475
|
-
tickControl;
|
20476
|
-
_startTime;
|
20477
|
-
_showDays = 0;
|
20478
|
-
scrollX = 0;
|
20479
|
-
get startTime() {
|
20480
|
-
return this._startTime;
|
20481
|
-
}
|
20482
|
-
set startTime(value) {
|
20483
|
-
this._startTime = value;
|
20484
|
-
this.tickControl.startTime = value;
|
20485
|
-
}
|
20486
|
-
get showDays() {
|
20487
|
-
return this._showDays;
|
20488
|
-
}
|
20489
|
-
set showDays(value) {
|
20490
|
-
this._showDays = value;
|
20491
|
-
this.tickControl.showDays = value;
|
20492
|
-
}
|
20493
|
-
arrangeOverride(e, finalSize) {
|
20494
|
-
this.controls.filter(item => item !== this.tickControl).forEach(item => {
|
20495
|
-
const itemRect = {
|
20496
|
-
x: item.x,
|
20497
|
-
y: item.y,
|
20498
|
-
width: item.desiredSize.width,
|
20499
|
-
height: item.desiredSize.height
|
20500
|
-
};
|
20501
|
-
item.arrange(e, itemRect);
|
20502
|
-
});
|
20503
|
-
this.tickControl.arrange(e, { x: this.tickControl.x - this.scrollX,
|
20504
|
-
y: this.tickControl.y,
|
20505
|
-
width: this.tickControl.desiredSize.width,
|
20506
|
-
height: this.tickControl.desiredSize.height });
|
20507
|
-
return finalSize;
|
20508
|
-
}
|
20509
|
-
}
|
20510
|
-
|
20511
|
-
class TemperaturePoint extends NodeCore {
|
20512
|
-
type;
|
20513
|
-
value;
|
20514
|
-
constructor(type = 'axillary', value) {
|
20515
|
-
super();
|
20516
|
-
this.type = type;
|
20517
|
-
this.value = value;
|
20518
|
-
this.bgColor = 'blue';
|
20519
|
-
this.width = timelineConfig.temperaturePointSize;
|
20520
|
-
this.height = timelineConfig.temperaturePointSize;
|
20521
|
-
this.addEventListener('mouseenter', evt => {
|
20522
|
-
this.bgColor = 'red';
|
20523
|
-
const onMouseLeave = () => {
|
20524
|
-
this.bgColor = 'blue';
|
20525
|
-
this.removeEventListener('mouseleave', onMouseLeave);
|
20526
|
-
};
|
20527
|
-
this.addEventListener('mouseleave', onMouseLeave);
|
20528
|
-
});
|
20529
|
-
}
|
20530
|
-
renderOutline(renderCtx) {
|
20531
|
-
translate(renderCtx, this.finalRect.x, this.finalRect.y);
|
20532
|
-
translate(renderCtx, this.border + this.padding, this.border + this.padding);
|
20533
|
-
}
|
20534
|
-
render(e) {
|
20535
|
-
if (this.type === 'axillary') {
|
20536
|
-
this.renderAxillary(e);
|
20537
|
-
}
|
20538
|
-
else if (this.type === 'oral') {
|
20539
|
-
this.renderOral(e);
|
20540
|
-
}
|
20541
|
-
else if (this.type === 'anal') {
|
20542
|
-
this.renderAnal(e);
|
20543
|
-
}
|
20544
|
-
}
|
20545
|
-
/**
|
20546
|
-
* 绘制腋下温度 X
|
20547
|
-
* @private
|
20548
|
-
*/
|
20549
|
-
renderAxillary(e) {
|
20550
|
-
const { width, height } = this.finalRect;
|
20551
|
-
const x = 0, y = 0;
|
20552
|
-
e.render.strokeLines([{ x, y }, { x: x + width, y: y + height }], 3, this.bgColor);
|
20553
|
-
e.render.strokeLines([{ x: x + width, y }, { x, y: y + height }], 3, this.bgColor);
|
20554
|
-
}
|
20555
|
-
/**
|
20556
|
-
* 绘制肛下温度 ○
|
20557
|
-
* @private
|
20558
|
-
*/
|
20559
|
-
renderAnal(e) {
|
20560
|
-
const width = this.finalRect.width;
|
20561
|
-
const ctx = e.render.ctx;
|
20562
|
-
ctx.save();
|
20563
|
-
ctx.beginPath();
|
20564
|
-
ctx.strokeStyle = this.bgColor;
|
20565
|
-
ctx.lineWidth = 2;
|
20566
|
-
ctx.arc(width / 2, width / 2, width, 0, 2 * Math.PI);
|
20567
|
-
ctx.stroke();
|
20568
|
-
ctx.restore();
|
20569
|
-
}
|
20570
|
-
/**
|
20571
|
-
* 绘制口腔温度 ●
|
20572
|
-
* @private
|
20573
|
-
*/
|
20574
|
-
renderOral(e) {
|
20575
|
-
const width = this.finalRect.width;
|
20576
|
-
e.render.fillCircular(width / 2, width / 2, width, this.bgColor);
|
20577
|
-
}
|
20578
|
-
}
|
20579
|
-
class HeartRatePoint extends NodeCore {
|
20580
|
-
value;
|
20581
|
-
constructor() {
|
20582
|
-
super();
|
20583
|
-
this.bgColor = 'red';
|
20584
|
-
this.width = timelineConfig.heartRatePointSize * 2;
|
20585
|
-
this.height = timelineConfig.heartRatePointSize * 2;
|
20586
|
-
this.addEventListener('mouseenter', evt => {
|
20587
|
-
this.bgColor = 'green';
|
20588
|
-
const tipLabel = new LabelNode();
|
20589
|
-
tipLabel.text = this.value;
|
20590
|
-
tipLabel.fontSize = timelineConfig.fontSize;
|
20591
|
-
tipLabel.shadowBlur = 5;
|
20592
|
-
tipLabel.shadowColor = '#000';
|
20593
|
-
tipLabel.bgColor = '#fff';
|
20594
|
-
tipLabel.x = this.x;
|
20595
|
-
tipLabel.y = this.y - tipLabel.fontSize - 2;
|
20596
|
-
this.parent?.addChild(tipLabel);
|
20597
|
-
const onMouseLeave = () => {
|
20598
|
-
this.bgColor = 'red';
|
20599
|
-
this.parent?.removeChild(tipLabel);
|
20600
|
-
this.removeEventListener('mouseleave', onMouseLeave);
|
20601
|
-
};
|
20602
|
-
this.addEventListener('mouseleave', onMouseLeave);
|
20603
|
-
});
|
20604
|
-
}
|
20605
|
-
renderOutline(renderCtx) {
|
20606
|
-
translate(renderCtx, this.finalRect.x, this.finalRect.y);
|
20607
|
-
translate(renderCtx, this.border + this.padding, this.border + this.padding);
|
20608
|
-
}
|
20609
|
-
render(e) {
|
20610
|
-
const heartRatePointSize = this.finalRect.width / 2;
|
20611
|
-
e.render.fillCircular(heartRatePointSize, heartRatePointSize, heartRatePointSize, this.bgColor);
|
20612
|
-
}
|
20613
|
-
}
|
20614
|
-
class TimeLinePath extends NodeCore {
|
20615
|
-
startPos;
|
20616
|
-
endPos;
|
20617
|
-
lineColor = '#000';
|
20618
|
-
lineWidth = 1;
|
20619
|
-
constructor() {
|
20620
|
-
super();
|
20621
|
-
this.allowHitTest = true;
|
20622
|
-
this.enableClip = false;
|
20623
|
-
}
|
20624
|
-
renderOutline(renderCtx) {
|
20625
|
-
translate(renderCtx, this.finalRect.x, this.finalRect.y);
|
20626
|
-
translate(renderCtx, this.border + this.padding, this.border + this.padding);
|
20627
|
-
}
|
20628
|
-
render(e) {
|
20629
|
-
e.render.strokeLines([this.startPos, this.endPos], this.lineWidth, this.lineColor);
|
20630
|
-
}
|
20631
|
-
}
|
20632
|
-
|
20633
|
-
class TimelineControl extends AbsolutePanel {
|
20634
|
-
render(e) {
|
20635
|
-
}
|
20636
|
-
constructor() {
|
20637
|
-
super();
|
20638
|
-
this.border = 1;
|
20639
|
-
this.borderColor = '#000';
|
20640
|
-
}
|
20641
|
-
measureOverride(e, availableSize) {
|
20642
|
-
const height = this.controls.reduce((prev, curr) => {
|
20643
|
-
curr.measure(e, availableSize);
|
20644
|
-
return prev + curr.desiredSize.height;
|
20645
|
-
}, 0);
|
20646
|
-
return {
|
20647
|
-
height, width: availableSize.width
|
20648
|
-
};
|
20649
|
-
}
|
20650
|
-
arrangeOverride(e, finalSize) {
|
20651
|
-
this.controls.reduce((prev, curr) => {
|
20652
|
-
const itemRect = {
|
20653
|
-
x: 0,
|
20654
|
-
y: prev,
|
20655
|
-
width: curr.desiredSize.width,
|
20656
|
-
height: curr.desiredSize.height
|
20657
|
-
};
|
20658
|
-
curr.arrange(e, itemRect);
|
20659
|
-
return prev + curr.desiredSize.height;
|
20660
|
-
}, 0);
|
20661
|
-
return finalSize;
|
20662
|
-
}
|
20663
|
-
reBuild() {
|
20664
|
-
treeForEach(this, item => {
|
20665
|
-
if (item instanceof NodeItems) {
|
20666
|
-
return item.controls;
|
20667
|
-
}
|
20668
|
-
else {
|
20669
|
-
return [];
|
20670
|
-
}
|
20671
|
-
}, (item) => {
|
20672
|
-
if (item instanceof TimelineBaseControl) {
|
20673
|
-
item.reBuild();
|
20674
|
-
}
|
20675
|
-
});
|
20676
|
-
}
|
20677
|
-
}
|
20678
|
-
function treeForEach(root, children, callback) {
|
20679
|
-
callback(root);
|
20680
|
-
children(root).forEach(node => {
|
20681
|
-
treeForEach(node, children, callback);
|
20682
|
-
});
|
20683
|
-
}
|
20684
|
-
/**
|
20685
|
-
* 中间网格数据绘制区域
|
20686
|
-
*/
|
20687
|
-
class TimeGridContainer extends AbsolutePanel {
|
20688
|
-
get gridHeight() {
|
20689
|
-
return this._gridHeight;
|
20690
|
-
}
|
20691
|
-
set gridHeight(value) {
|
20692
|
-
this._gridHeight = value;
|
20693
|
-
this.timelineGridControl.height = value;
|
20694
|
-
this.timeValueRuleContainer.height = value;
|
20695
|
-
}
|
20696
|
-
_startTime;
|
20697
|
-
_showDays = 7;
|
20698
|
-
get startTime() {
|
20699
|
-
return this._startTime;
|
20700
|
-
}
|
20701
|
-
set startTime(value) {
|
20702
|
-
this._startTime = value;
|
20703
|
-
this.timelineGridControl.startTime = value;
|
20704
|
-
}
|
20705
|
-
get showDays() {
|
20706
|
-
return this._showDays;
|
20707
|
-
}
|
20708
|
-
set showDays(value) {
|
20709
|
-
this._showDays = value;
|
20710
|
-
this.timelineGridControl.showDays = value;
|
20711
|
-
}
|
20712
|
-
/**
|
20713
|
-
* 网格区域高度
|
20714
|
-
*/
|
20715
|
-
_gridHeight = 0;
|
20716
|
-
scrollX = 0;
|
20717
|
-
timelineGridControl;
|
20718
|
-
timeValueRuleContainer;
|
20719
|
-
constructor() {
|
20720
|
-
super();
|
20721
|
-
this.timelineGridControl = new TimelineGridControl();
|
20722
|
-
this.addChild(this.timelineGridControl);
|
20723
|
-
this.timeValueRuleContainer = new TimeValueRuleContainer();
|
20724
|
-
this.addChild(this.timeValueRuleContainer);
|
20725
|
-
}
|
20726
|
-
init() {
|
20727
|
-
this.timelineGridControl.init();
|
20728
|
-
}
|
20729
|
-
measureOverride(e, availableSize) {
|
20730
|
-
this.timelineGridControl.measure(e, availableSize);
|
20731
|
-
const height = this.timelineGridControl.desiredSize.height;
|
20732
|
-
this.timeValueRuleContainer.measure(e, { height, width: availableSize.width });
|
20733
|
-
return { height, width: availableSize.width };
|
20734
|
-
}
|
20735
|
-
arrangeOverride(e, finalSize) {
|
20736
|
-
this.controls.filter(item => item !== this.timelineGridControl).forEach(item => {
|
20737
|
-
const itemRect = {
|
20738
|
-
x: item.x,
|
20739
|
-
y: item.y,
|
20740
|
-
width: item.desiredSize.width,
|
20741
|
-
height: item.desiredSize.height
|
20742
|
-
};
|
20743
|
-
item.arrange(e, itemRect);
|
20744
|
-
});
|
20745
|
-
this.timelineGridControl.arrange(e, {
|
20746
|
-
x: this.timelineGridControl.x - this.scrollX,
|
20747
|
-
y: this.timelineGridControl.y,
|
20748
|
-
width: this.timelineGridControl.desiredSize.width,
|
20749
|
-
height: this.timelineGridControl.desiredSize.height
|
20750
|
-
});
|
20751
|
-
return finalSize;
|
20752
|
-
}
|
20753
|
-
render(e) {
|
20754
|
-
}
|
20755
|
-
}
|
20756
|
-
class TimeValueRuleContainer extends AbsolutePanel {
|
20757
|
-
getLayoutWidth() {
|
20758
|
-
return this.controls.reduce((prev, curr) => prev + curr.width, 0);
|
20759
|
-
}
|
20760
|
-
init() {
|
20761
|
-
this.controls.reduce((prev, curr) => {
|
20762
|
-
curr.x = prev;
|
20763
|
-
return prev + curr.width;
|
20764
|
-
}, 0);
|
20765
|
-
}
|
20766
|
-
renderOutline(renderCtx) {
|
20767
|
-
translate(renderCtx, this.finalRect.x, this.finalRect.y);
|
20768
|
-
translate(renderCtx, this.border + this.padding, this.border + this.padding);
|
20769
|
-
}
|
20770
|
-
render(e) {
|
20771
|
-
}
|
20772
|
-
}
|
20773
|
-
/**
|
20774
|
-
* 标题区域
|
20775
|
-
* 时间刻度:日期、住院天数、手术天数、时刻
|
20776
|
-
* 数值标尺区域、数据网格区域
|
20777
|
-
* 文本时间轴区域
|
20778
|
-
*/
|
20779
|
-
class TimelineGridControl extends TimelineBaseControl {
|
20780
|
-
get isShowTemperature() {
|
20781
|
-
return this._isShowTemperature;
|
20782
|
-
}
|
20783
|
-
set isShowTemperature(value) {
|
20784
|
-
this.propertyChanged('isShowTemperature', this._isShowTemperature, value);
|
20785
|
-
this._isShowTemperature = value;
|
20786
|
-
}
|
20787
|
-
get isShowHeartRate() {
|
20788
|
-
return this._isShowHeartRate;
|
20789
|
-
}
|
20790
|
-
set isShowHeartRate(value) {
|
20791
|
-
this.propertyChanged('isShowHeartRate', this._isShowHeartRate, value);
|
20792
|
-
this._isShowHeartRate = value;
|
20793
|
-
}
|
20794
|
-
//体温数据
|
20795
|
-
temperatureData = [];
|
20796
|
-
//心率数据
|
20797
|
-
heartRateData = [];
|
20798
|
-
//体温时间轴值模型
|
20799
|
-
temperatureTimeLineValueModel = [];
|
20800
|
-
//心率时间轴值模型
|
20801
|
-
heartRateTimeLineValueModel = [];
|
20802
|
-
//图章数据
|
20803
|
-
eventData = [];
|
20804
|
-
_isShowTemperature = true;
|
20805
|
-
_isShowHeartRate = true;
|
20806
|
-
mousePos = null;
|
20807
|
-
constructor() {
|
20808
|
-
super();
|
20809
|
-
this.startTime = moment$1(moment$1().format("YYYY-MM-DD")).toDate();
|
20810
|
-
this.addEventListener('mousemove', evt => {
|
20811
|
-
const pos = evt.pos;
|
20812
|
-
const nodePos = getNodePosition(this, { x: 0, y: 0 });
|
20813
|
-
this.mousePos = { x: pos.x - nodePos.x, y: pos.y - nodePos.y };
|
20814
|
-
});
|
20815
|
-
this.addEventListener('mouseleave', evt => {
|
20816
|
-
this.mousePos = null;
|
20817
|
-
});
|
20818
|
-
}
|
20819
|
-
randomNum = (start, end) => {
|
20820
|
-
return Math.floor(Math.random() * (end - start) + start);
|
20821
|
-
};
|
20822
|
-
getLayoutWidth() {
|
20823
|
-
return this.showDays * (24 / timelineConfig.timeTickHours) * timelineConfig.timeTickWidth;
|
20824
|
-
}
|
20825
|
-
init() {
|
20826
|
-
this.temperatureTimeLineValueModel = timelineConfig.temperatureModels.map((item, index, arr) => ({
|
20827
|
-
value: item,
|
20828
|
-
offset: (index + 1) / (arr.length + 1)
|
20829
|
-
}));
|
20830
|
-
this.heartRateTimeLineValueModel = timelineConfig.heartRateModels.map((item, index, arr) => ({
|
20831
|
-
value: item,
|
20832
|
-
offset: (index + 1) / (arr.length + 1)
|
20833
|
-
}));
|
20834
|
-
const { timeTickHours } = timelineConfig;
|
20835
|
-
for (let i = 0; i < this.showDays; i++) {
|
20836
|
-
for (let j = 0; j < 24; j += timeTickHours) {
|
20837
|
-
this.temperatureData.push({
|
20838
|
-
date: moment$1(this.startTime).add(i, 'days').add(j, 'hours').toDate(),
|
20839
|
-
value: this.randomNum(33, 43) + this.randomNum(0, 10) / 10
|
20840
|
-
//value: 43
|
20841
|
-
});
|
20842
|
-
this.heartRateData.push({
|
20843
|
-
date: moment$1(this.startTime).add(i, 'days').add(j, 'hours').toDate(),
|
20844
|
-
value: this.randomNum(70, 150)
|
20845
|
-
});
|
20846
|
-
}
|
20847
|
-
this.eventData.push({ date: moment$1(this.startTime).add(i, 'days').toDate(), value: '入\r\n院\r\n111' });
|
20848
|
-
}
|
20849
|
-
this.temperatureData.sort((prev, curr) => {
|
20850
|
-
return curr.date > prev.date ? 1 : -1;
|
20851
|
-
});
|
20852
|
-
this.heartRateData.sort((prev, curr) => curr.date > prev.date ? 1 : -1);
|
20853
|
-
}
|
20854
|
-
buildOverride(e) {
|
20855
|
-
this.temperatureData.length = 0;
|
20856
|
-
this.heartRateData.length = 0;
|
20857
|
-
this.eventData.length = 0;
|
20858
|
-
this.init();
|
20859
|
-
this.buildTemperature(e);
|
20860
|
-
this.buildHearRate(e);
|
20861
|
-
this.buildStampUnit(e);
|
20862
|
-
const tipLabel = new LabelNode();
|
20863
|
-
tipLabel.text = '外\r\n科\r\n手\r\n术';
|
20864
|
-
tipLabel.borderColor = '#000';
|
20865
|
-
tipLabel.border = 1;
|
20866
|
-
tipLabel.shadowBlur = 5;
|
20867
|
-
tipLabel.shadowColor = 'red';
|
20868
|
-
tipLabel.fontSize = 12;
|
20869
|
-
tipLabel.bgColor = '#fff';
|
20870
|
-
tipLabel.color = 'red';
|
20871
|
-
tipLabel.textWrapping = 'wrap';
|
20872
|
-
//tipLabel.width = 14;
|
20873
|
-
tipLabel.x = 100;
|
20874
|
-
tipLabel.y = 30;
|
20875
|
-
this.addChild(tipLabel);
|
20876
|
-
}
|
20877
|
-
render(e) {
|
20878
|
-
const { timeValueHeight, timeTickHours, timeTickWidth } = timelineConfig;
|
20879
|
-
const ticks = 24 / timeTickHours;
|
20880
|
-
for (let i = 0; i < this.showDays; i++) {
|
20881
|
-
for (let j = 1; j <= ticks; j++) {
|
20882
|
-
const x = i * timeTickWidth * ticks + j * timeTickWidth;
|
20883
|
-
const color = j < ticks ? '#69c0ff' : '#ffadd2';
|
20884
|
-
e.render.strokeLines([{
|
20885
|
-
x,
|
20886
|
-
y: 0
|
20887
|
-
}, { x, y: this.finalRect.height }], 0.5, color);
|
20888
|
-
}
|
20889
|
-
}
|
20890
|
-
for (let i = timeValueHeight; i < this.finalRect.height; i += timeValueHeight) {
|
20891
|
-
e.render.strokeLines([{
|
20892
|
-
x: 0,
|
20893
|
-
y: i
|
20894
|
-
}, { x: this.finalRect.width, y: i }], 0.5, '#69c0ff');
|
20895
|
-
}
|
20896
|
-
this.renderTemperatureGuideLine(e);
|
20897
|
-
if (this.mousePos) {
|
20898
|
-
e.render.strokeLines([{ x: 0, y: this.mousePos.y }, { x: this.finalRect.width, y: this.mousePos.y }]);
|
20899
|
-
e.render.strokeLines([{ x: this.mousePos.x, y: 0 }, { x: this.mousePos.x, y: this.finalRect.height }]);
|
20900
|
-
}
|
20901
|
-
}
|
20902
|
-
renderTemperatureGuideLine(e) {
|
20903
|
-
const timelineValue = this.temperatureTimeLineValueModel.map(item => ({
|
20904
|
-
value: item.value,
|
20905
|
-
offset: this.height * item.offset
|
20906
|
-
}));
|
20907
|
-
//绘制正常36-37度,辅助线
|
20908
|
-
const startPoint = 36.5;
|
20909
|
-
const endPoint = 37.3;
|
20910
|
-
const startFilter = timelineValue.filter(item => item.value >= startPoint);
|
20911
|
-
const endFilter = timelineValue.filter(item => item.value >= endPoint);
|
20912
|
-
let startY = 0;
|
20913
|
-
let endY = 0;
|
20914
|
-
if (startFilter.length > 1) {
|
20915
|
-
const curr = startFilter[startFilter.length - 1];
|
20916
|
-
const next = startFilter[startFilter.length - 2];
|
20917
|
-
startY = curr.offset + (curr.value - startPoint) * (next.offset - curr.offset) / (curr.value - next.value);
|
20918
|
-
}
|
20919
|
-
if (endFilter.length > 1) {
|
20920
|
-
const curr = endFilter[endFilter.length - 1];
|
20921
|
-
const next = endFilter[endFilter.length - 2];
|
20922
|
-
endY = curr.offset + (curr.value - endPoint) * (next.offset - curr.offset) / (curr.value - next.value);
|
20923
|
-
}
|
20924
|
-
e.render.strokeLines([{ x: 0, y: startY }, { x: this.finalRect.width, y: startY }], 1, 'red');
|
20925
|
-
e.render.strokeLines([{ x: 0, y: endY }, { x: this.finalRect.width, y: endY }], 1, 'red');
|
20926
|
-
}
|
20927
|
-
buildTemperature(e) {
|
20928
|
-
if (this.temperatureData.length === 0) {
|
20929
|
-
return;
|
20930
|
-
}
|
20931
|
-
const height = this.height;
|
20932
|
-
const { timeValueHeight, timeTickHours, timeTickWidth, temperaturePointSize } = timelineConfig;
|
20933
|
-
const timelineValue = this.temperatureTimeLineValueModel.map(item => ({
|
20934
|
-
value: item.value,
|
20935
|
-
offset: height * item.offset
|
20936
|
-
}));
|
20937
|
-
//获取体温点纵向坐标
|
20938
|
-
const getTimelineVerValue = (val) => {
|
20939
|
-
const filter = timelineValue.filter(item => item.value >= val);
|
20940
|
-
if (filter.length) {
|
20941
|
-
if (filter.length > 1) {
|
20942
|
-
const curr = filter[filter.length - 1];
|
20943
|
-
const next = filter[filter.length - 2];
|
20944
|
-
return curr.offset + (curr.value - val) * (next.offset - curr.offset) / (curr.value - next.value);
|
20945
|
-
}
|
20946
|
-
else {
|
20947
|
-
return filter[0].offset;
|
20948
|
-
}
|
20949
|
-
}
|
20950
|
-
return -1;
|
20951
|
-
};
|
20952
|
-
let prevPos = null;
|
20953
|
-
for (let i = 0; i < this.showDays; i++) {
|
20954
|
-
const ticks = 24 / timeTickHours;
|
20955
|
-
for (let j = 0; j < ticks; j++) {
|
20956
|
-
const hourOffset = j * timeTickHours;
|
20957
|
-
const x = i * timeTickWidth * ticks + j * timeTickWidth;
|
20958
|
-
const startTime = moment$1(this.startTime).add(i, 'days').add(hourOffset, 'hours');
|
20959
|
-
const endTime = moment$1(this.startTime).add(i, 'days').add(hourOffset + timeTickHours, 'hours');
|
20960
|
-
const predicate = (item) => {
|
20961
|
-
return moment$1(item).isBetween(startTime, endTime, null, '(]');
|
20962
|
-
};
|
20963
|
-
const currTimePoints = this.temperatureData.filter(item => predicate(item.date));
|
20964
|
-
currTimePoints.forEach(item => {
|
20965
|
-
let currX = x;
|
20966
|
-
const diffMinutes = moment$1(item.date).diff(startTime, 'minutes');
|
20967
|
-
const offsetMinutes = diffMinutes * timeTickWidth / (timeTickHours * 60);
|
20968
|
-
currX += offsetMinutes;
|
20969
|
-
let currY = getTimelineVerValue(item.value);
|
20970
|
-
//超出显示范围
|
20971
|
-
if (currY > height) {
|
20972
|
-
currY = height;
|
20973
|
-
this.setExceededValueTip(e, item.value + '℃', currX, currY - 20);
|
20974
|
-
}
|
20975
|
-
if (currY < 0) {
|
20976
|
-
currY = 0;
|
20977
|
-
this.setExceededValueTip(e, item.value + '℃', currX, currY + 5);
|
20978
|
-
}
|
20979
|
-
const point = new TemperaturePoint('axillary', item.value);
|
20980
|
-
point.x = currX - point.width / 2;
|
20981
|
-
point.y = currY - point.width / 2;
|
20982
|
-
this.addChild(point);
|
20983
|
-
if (prevPos) {
|
20984
|
-
const linePath = new TimeLinePath();
|
20985
|
-
linePath.lineColor = 'blue';
|
20986
|
-
linePath.startPos = prevPos;
|
20987
|
-
linePath.endPos = { x: currX, y: currY };
|
20988
|
-
this.addChild(linePath);
|
20989
|
-
}
|
20990
|
-
prevPos = { x: currX, y: currY };
|
20991
|
-
});
|
20992
|
-
}
|
20993
|
-
}
|
20994
|
-
}
|
20995
|
-
setExceededValueTip(e, tip, x, y) {
|
20996
|
-
const tipLabel = new LabelNode();
|
20997
|
-
tipLabel.text = tip;
|
20998
|
-
tipLabel.borderColor = '#000';
|
20999
|
-
tipLabel.border = 1;
|
21000
|
-
tipLabel.shadowBlur = 5;
|
21001
|
-
tipLabel.shadowColor = '#000';
|
21002
|
-
tipLabel.fontSize = 10;
|
21003
|
-
tipLabel.bgColor = '#fff';
|
21004
|
-
const tipLabelWidth = e.render.measureText2(tipLabel.text, tipLabel);
|
21005
|
-
tipLabel.x = x -= tipLabelWidth / 2;
|
21006
|
-
tipLabel.y = y;
|
21007
|
-
this.addChild(tipLabel);
|
21008
|
-
}
|
21009
|
-
buildHearRate(e) {
|
21010
|
-
const height = this.height;
|
21011
|
-
const { timeTickHours, timeTickWidth, heartRateSymbol } = timelineConfig;
|
21012
|
-
const timelineValue = this.heartRateTimeLineValueModel.map(item => ({
|
21013
|
-
value: item.value,
|
21014
|
-
offset: height * item.offset
|
21015
|
-
}));
|
21016
|
-
//获取心率纵向坐标
|
21017
|
-
const getTimelineVerValue = (val) => {
|
21018
|
-
const filter = timelineValue.filter(item => item.value >= val);
|
21019
|
-
if (filter.length) {
|
21020
|
-
if (filter.length > 1) {
|
21021
|
-
const curr = filter[filter.length - 1];
|
21022
|
-
const next = filter[filter.length - 2];
|
21023
|
-
return curr.offset + (curr.value - val) * (next.offset - curr.offset) / (curr.value - next.value);
|
21024
|
-
}
|
21025
|
-
else {
|
21026
|
-
return filter[0].offset;
|
21027
|
-
}
|
21028
|
-
}
|
21029
|
-
return -1;
|
21030
|
-
};
|
21031
|
-
//const getTimelineHorValue=()
|
21032
|
-
let prevPos = null;
|
21033
|
-
for (let i = 0; i < this.showDays; i++) {
|
21034
|
-
const ticks = 24 / timeTickHours;
|
21035
|
-
for (let j = 0; j < ticks; j++) {
|
21036
|
-
const hourOffset = j * timeTickHours;
|
21037
|
-
const x = i * timeTickWidth * ticks + j * timeTickWidth;
|
21038
|
-
const startTime = moment$1(this.startTime).add(i, 'days').add(hourOffset, 'hours');
|
21039
|
-
const endTime = moment$1(this.startTime).add(i, 'days').add(hourOffset + timeTickHours, 'hours');
|
21040
|
-
const predicate = (item) => {
|
21041
|
-
return moment$1(item).isBetween(startTime, endTime, null, '(]');
|
21042
|
-
};
|
21043
|
-
const currTimePoints = this.heartRateData.filter(item => predicate(item.date));
|
21044
|
-
currTimePoints.forEach(item => {
|
21045
|
-
let currX = x;
|
21046
|
-
const diffMinutes = moment$1(item.date).diff(startTime, 'minutes');
|
21047
|
-
const offsetMinutes = diffMinutes * timeTickWidth / (timeTickHours * 60);
|
21048
|
-
currX += offsetMinutes;
|
21049
|
-
let currY = getTimelineVerValue(item.value);
|
21050
|
-
//超出显示范围
|
21051
|
-
if (currY > height) {
|
21052
|
-
currY = height;
|
21053
|
-
this.setExceededValueTip(e, item.value + heartRateSymbol, currX, currY - 20);
|
21054
|
-
}
|
21055
|
-
if (currY < 0) {
|
21056
|
-
currY = 0;
|
21057
|
-
this.setExceededValueTip(e, item.value + heartRateSymbol, currX, currY + 5);
|
21058
|
-
}
|
21059
|
-
const point = new HeartRatePoint();
|
21060
|
-
point.value = item.value + '次/分';
|
21061
|
-
point.x = currX - point.width / 2;
|
21062
|
-
point.y = currY - point.width / 2;
|
21063
|
-
this.addChild(point);
|
21064
|
-
if (prevPos) {
|
21065
|
-
const linePath = new TimeLinePath();
|
21066
|
-
linePath.lineColor = 'red';
|
21067
|
-
linePath.startPos = prevPos;
|
21068
|
-
linePath.endPos = { x: currX, y: currY };
|
21069
|
-
this.addChild(linePath);
|
21070
|
-
}
|
21071
|
-
prevPos = { x: currX, y: currY };
|
21072
|
-
});
|
21073
|
-
}
|
21074
|
-
}
|
21075
|
-
}
|
21076
|
-
buildStampUnit(e) {
|
21077
|
-
if (!this.eventData.length) {
|
21078
|
-
return;
|
21079
|
-
}
|
21080
|
-
const { timeTickHours, timeTickWidth, heartRateSymbol } = timelineConfig;
|
21081
|
-
for (let i = 0; i < this.showDays; i++) {
|
21082
|
-
const ticks = 24 / timeTickHours;
|
21083
|
-
for (let j = 0; j < ticks; j++) {
|
21084
|
-
const hourOffset = j * timeTickHours;
|
21085
|
-
const x = i * timeTickWidth * ticks + j * timeTickWidth;
|
21086
|
-
const startTime = moment$1(this.startTime).add(i, 'days').add(hourOffset, 'hours');
|
21087
|
-
const endTime = moment$1(this.startTime).add(i, 'days').add(hourOffset + timeTickHours, 'hours');
|
21088
|
-
const predicate = (item) => {
|
21089
|
-
return moment$1(item).isBetween(startTime, endTime, null, '(]');
|
21090
|
-
};
|
21091
|
-
const currTimePoints = this.eventData.filter(item => predicate(item.date));
|
21092
|
-
currTimePoints.forEach(item => {
|
21093
|
-
let currX = x;
|
21094
|
-
const diffMinutes = moment$1(item.date).diff(startTime, 'minutes');
|
21095
|
-
const offsetMinutes = diffMinutes * timeTickWidth / (timeTickHours * 60);
|
21096
|
-
currX += offsetMinutes;
|
21097
|
-
const tipLabel = new LabelNode();
|
21098
|
-
tipLabel.text = item.value;
|
21099
|
-
tipLabel.borderColor = '#000';
|
21100
|
-
tipLabel.border = 1;
|
21101
|
-
tipLabel.shadowBlur = 5;
|
21102
|
-
tipLabel.shadowColor = 'red';
|
21103
|
-
tipLabel.fontSize = 12;
|
21104
|
-
tipLabel.bgColor = '#fff';
|
21105
|
-
tipLabel.color = 'red';
|
21106
|
-
tipLabel.textWrapping = 'wrap';
|
21107
|
-
//tipLabel.width = 14;
|
21108
|
-
tipLabel.x = currX;
|
21109
|
-
tipLabel.y = 30;
|
21110
|
-
this.addChild(tipLabel);
|
21111
|
-
});
|
21112
|
-
}
|
21113
|
-
}
|
21114
|
-
}
|
21115
|
-
}
|
21116
|
-
/**
|
21117
|
-
* 心率数值标尺控件
|
21118
|
-
*/
|
21119
|
-
class HeartRateValueRuleControl extends TimelineBaseControl {
|
21120
|
-
constructor() {
|
21121
|
-
super();
|
21122
|
-
this.width = 50;
|
21123
|
-
}
|
21124
|
-
//体温时间轴值模型
|
21125
|
-
heartRateTimeLineValueModel = [];
|
21126
|
-
buildOverride(e) {
|
21127
|
-
const width = this.width;
|
21128
|
-
const height = this.height;
|
21129
|
-
const label = new LabelNode();
|
21130
|
-
label.text = '心率';
|
21131
|
-
label.fontSize = timelineConfig.fontSize;
|
21132
|
-
label.fontName = timelineConfig.fontName;
|
21133
|
-
label.y = 5;
|
21134
|
-
this.addChild(label);
|
21135
|
-
const textProps = new TextProps();
|
21136
|
-
textProps.fontSize = timelineConfig.fontSize;
|
21137
|
-
textProps.fontName = timelineConfig.fontName;
|
21138
|
-
label.x = (width - e.render.measureText(label.text, textProps).width) / 2;
|
21139
|
-
const timelineValue = this.heartRateTimeLineValueModel.map(item => ({
|
21140
|
-
value: item.value,
|
21141
|
-
offset: (height) * item.offset
|
21142
|
-
}));
|
21143
|
-
timelineValue.forEach(item => {
|
21144
|
-
const valueLabel = new LabelNode();
|
21145
|
-
valueLabel.fontName = timelineConfig.fontName;
|
21146
|
-
valueLabel.fontSize = timelineConfig.fontSize;
|
21147
|
-
valueLabel.text = item.value + '';
|
21148
|
-
valueLabel.x = (width - e.render.measureText(valueLabel.text, textProps).width) / 2;
|
21149
|
-
valueLabel.y = item.offset;
|
21150
|
-
this.addChild(valueLabel);
|
21151
|
-
});
|
21152
|
-
}
|
21153
|
-
render(e) {
|
21154
|
-
}
|
21155
|
-
}
|
21156
|
-
/**
|
21157
|
-
* 体温数值标尺控件
|
21158
|
-
*/
|
21159
|
-
class TemperatureValueRuleControl extends TimelineBaseControl {
|
21160
|
-
constructor() {
|
21161
|
-
super();
|
21162
|
-
this.width = 50;
|
21163
|
-
}
|
21164
|
-
//体温时间轴值模型
|
21165
|
-
temperatureTimeLineValueModel = [];
|
21166
|
-
buildOverride(e) {
|
21167
|
-
const width = this.width;
|
21168
|
-
const height = this.height;
|
21169
|
-
const label = new LabelNode();
|
21170
|
-
label.text = '体温';
|
21171
|
-
label.fontSize = timelineConfig.fontSize;
|
21172
|
-
label.fontName = timelineConfig.fontName;
|
21173
|
-
label.y = 5;
|
21174
|
-
this.addChild(label);
|
21175
|
-
label.x = (width - e.render.measureText2(label.text, label)) / 2;
|
21176
|
-
const timelineValue = this.temperatureTimeLineValueModel.map(item => ({
|
21177
|
-
value: item.value,
|
21178
|
-
offset: (height) * item.offset
|
21179
|
-
}));
|
21180
|
-
timelineValue.forEach(item => {
|
21181
|
-
const valueLabel = new LabelNode();
|
21182
|
-
valueLabel.fontName = timelineConfig.fontName;
|
21183
|
-
valueLabel.fontSize = timelineConfig.fontSize;
|
21184
|
-
valueLabel.text = item.value + '';
|
21185
|
-
valueLabel.x = (width - e.render.measureText2(valueLabel.text, valueLabel)) / 2;
|
21186
|
-
valueLabel.y = item.offset;
|
21187
|
-
this.addChild(valueLabel);
|
21188
|
-
});
|
21189
|
-
}
|
21190
|
-
render(e) {
|
21191
|
-
}
|
21192
|
-
}
|
21193
|
-
|
21194
|
-
/**
|
21195
|
-
* 事件轴标题
|
21196
|
-
* 日期、手术天数、术后天数、时刻
|
21197
|
-
*/
|
21198
|
-
class TimeTickTitleControl extends TimelineBaseControl {
|
21199
|
-
constructor() {
|
21200
|
-
super();
|
21201
|
-
this.bgColor = '#fff';
|
21202
|
-
}
|
21203
|
-
title;
|
21204
|
-
render(e) {
|
21205
|
-
}
|
21206
|
-
buildOverride(e) {
|
21207
|
-
const width = this.width;
|
21208
|
-
const height = this.height;
|
21209
|
-
const label = new LabelNode();
|
21210
|
-
label.text = this.title;
|
21211
|
-
label.fontSize = timelineConfig.fontSize;
|
21212
|
-
label.fontName = timelineConfig.fontName;
|
21213
|
-
const titleWidth = e.render.measureText2(label.text, label);
|
21214
|
-
label.x = (width - titleWidth) / 2;
|
21215
|
-
label.y = (height - label.fontSize) / 2;
|
21216
|
-
this.addChild(label);
|
21217
|
-
}
|
21218
|
-
}
|
21219
|
-
/**
|
21220
|
-
* 文本状态时刻控件,用于显示状态文本,例如:小便等
|
21221
|
-
*/
|
21222
|
-
class TextStatusTickControl extends TimelineBaseControl {
|
21223
|
-
render(e) {
|
21224
|
-
}
|
21225
|
-
buildOverride(e) {
|
21226
|
-
const { timeTickHours, timeTickWidth } = timelineConfig;
|
21227
|
-
const height = this.height;
|
21228
|
-
const ticks = 24 / timeTickHours;
|
21229
|
-
for (let i = 0; i < this.showDays; i++) {
|
21230
|
-
const width = ticks * timeTickWidth;
|
21231
|
-
// const curr = moment(this.startTime).add(i, 'days').format('YYYY-MM-DD');
|
21232
|
-
//
|
21233
|
-
// const label = new LabelNode();
|
21234
|
-
// label.text = curr + '';
|
21235
|
-
// label.fontSize = timelineConfig.fontSize;
|
21236
|
-
// label.fontName = timelineConfig.fontName;
|
21237
|
-
//
|
21238
|
-
// const dateTitleWidth = e.render.measureText2(curr + '', label);
|
21239
|
-
//
|
21240
|
-
// label.x = i * width + (width - dateTitleWidth) / 2;
|
21241
|
-
// label.y = (height - label.fontSize) / 2;
|
21242
|
-
// this.addChild(label);
|
21243
|
-
const path = new TimeLinePath();
|
21244
|
-
path.startPos = { x: i * width, y: 0 };
|
21245
|
-
path.endPos = { x: i * width, y: height };
|
21246
|
-
path.lineColor = '#ffadd2';
|
21247
|
-
this.addChild(path);
|
21248
|
-
}
|
21249
|
-
}
|
21250
|
-
}
|
21251
|
-
/**
|
21252
|
-
* 呼吸状态容器
|
21253
|
-
*/
|
21254
|
-
class TimelineHXStatusContainer extends TickContainer {
|
21255
|
-
tickTitleControl;
|
21256
|
-
constructor() {
|
21257
|
-
super();
|
21258
|
-
this.tickTitleControl = new TimeTickTitleControl();
|
21259
|
-
this.tickTitleControl.title = '呼吸';
|
21260
|
-
this.tickTitleControl.height = timelineConfig.tickHeaderHeight;
|
21261
|
-
this.tickControl = new TextStatusTickControl();
|
21262
|
-
this.tickControl.height = timelineConfig.tickHeaderHeight;
|
21263
|
-
this.addChild(this.tickControl);
|
21264
|
-
this.addChild(this.tickTitleControl);
|
21265
|
-
this.height = timelineConfig.tickHeaderHeight;
|
21266
|
-
}
|
21267
|
-
/**
|
21268
|
-
* 设置标题和刻度宽度
|
21269
|
-
* @param titleWidth
|
21270
|
-
* @param tickWidth
|
21271
|
-
*/
|
21272
|
-
setLayout(titleWidth, tickWidth) {
|
21273
|
-
this.width = tickWidth + titleWidth;
|
21274
|
-
this.tickTitleControl.width = titleWidth;
|
21275
|
-
this.tickControl.width = tickWidth;
|
21276
|
-
this.tickControl.x = titleWidth;
|
21277
|
-
}
|
21278
|
-
render(e) {
|
21279
|
-
}
|
21280
|
-
}
|
21281
|
-
/**
|
21282
|
-
* 小便状态容器
|
21283
|
-
*/
|
21284
|
-
class TimelineXBStatusContainer extends TickContainer {
|
21285
|
-
//statusControl: TextStatusTickControl;
|
21286
|
-
tickTitleControl;
|
21287
|
-
constructor() {
|
21288
|
-
super();
|
21289
|
-
this.tickTitleControl = new TimeTickTitleControl();
|
21290
|
-
this.tickTitleControl.title = '小便 ml';
|
21291
|
-
this.tickTitleControl.height = timelineConfig.tickHeaderHeight;
|
21292
|
-
this.tickControl = new TextStatusTickControl();
|
21293
|
-
this.tickControl.height = timelineConfig.tickHeaderHeight;
|
21294
|
-
this.addChild(this.tickControl);
|
21295
|
-
this.addChild(this.tickTitleControl);
|
21296
|
-
this.height = timelineConfig.tickHeaderHeight;
|
21297
|
-
}
|
21298
|
-
/**
|
21299
|
-
* 设置标题和刻度宽度
|
21300
|
-
* @param titleWidth
|
21301
|
-
* @param tickWidth
|
21302
|
-
*/
|
21303
|
-
setLayout(titleWidth, tickWidth) {
|
21304
|
-
this.width = tickWidth + titleWidth;
|
21305
|
-
this.tickTitleControl.width = titleWidth;
|
21306
|
-
this.tickControl.width = tickWidth;
|
21307
|
-
this.tickControl.x = titleWidth;
|
21308
|
-
}
|
21309
|
-
render(e) {
|
21310
|
-
}
|
21311
|
-
}
|
21312
|
-
/**
|
21313
|
-
* 其他状态容器
|
21314
|
-
*/
|
21315
|
-
class TimelineOtherStatusContainer extends TickContainer {
|
21316
|
-
//statusControl: TextStatusTickControl;
|
21317
|
-
tickTitleControl;
|
21318
|
-
constructor() {
|
21319
|
-
super();
|
21320
|
-
this.tickTitleControl = new TimeTickTitleControl();
|
21321
|
-
this.tickTitleControl.title = '其他';
|
21322
|
-
this.tickTitleControl.height = timelineConfig.tickHeaderHeight;
|
21323
|
-
this.tickControl = new TextStatusTickControl();
|
21324
|
-
this.tickControl.height = timelineConfig.tickHeaderHeight;
|
21325
|
-
this.addChild(this.tickControl);
|
21326
|
-
this.addChild(this.tickTitleControl);
|
21327
|
-
this.height = timelineConfig.tickHeaderHeight;
|
21328
|
-
}
|
21329
|
-
/**
|
21330
|
-
* 设置标题和刻度宽度
|
21331
|
-
* @param titleWidth
|
21332
|
-
* @param tickWidth
|
21333
|
-
*/
|
21334
|
-
setLayout(titleWidth, tickWidth) {
|
21335
|
-
this.width = tickWidth + titleWidth;
|
21336
|
-
this.tickTitleControl.width = titleWidth;
|
21337
|
-
this.tickControl.width = tickWidth;
|
21338
|
-
this.tickControl.x = titleWidth;
|
21339
|
-
}
|
21340
|
-
render(e) {
|
21341
|
-
}
|
21342
|
-
}
|
21343
|
-
|
21344
|
-
/**
|
21345
|
-
* 时间刻度区域
|
21346
|
-
* 循环日期显示
|
21347
|
-
* 住院天数
|
21348
|
-
* 术后天数
|
21349
|
-
* 时刻等
|
21350
|
-
*/
|
21351
|
-
/**
|
21352
|
-
* 日期时刻容器
|
21353
|
-
*/
|
21354
|
-
class DateTickContainer extends TickContainer {
|
21355
|
-
tickTitleControl;
|
21356
|
-
constructor() {
|
21357
|
-
super();
|
21358
|
-
this.tickTitleControl = new TimeTickTitleControl();
|
21359
|
-
this.tickTitleControl.title = '日期';
|
21360
|
-
this.tickTitleControl.height = timelineConfig.tickHeaderHeight;
|
21361
|
-
this.tickControl = new DateTickControl();
|
21362
|
-
this.tickControl.height = timelineConfig.tickHeaderHeight;
|
21363
|
-
this.addChild(this.tickControl);
|
21364
|
-
this.addChild(this.tickTitleControl);
|
21365
|
-
this.height = timelineConfig.tickHeaderHeight;
|
21366
|
-
}
|
21367
|
-
/**
|
21368
|
-
* 设置标题和刻度宽度
|
21369
|
-
* @param titleWidth
|
21370
|
-
* @param tickWidth
|
21371
|
-
*/
|
21372
|
-
setLayout(titleWidth, tickWidth) {
|
21373
|
-
this.width = tickWidth + titleWidth;
|
21374
|
-
this.tickTitleControl.width = titleWidth;
|
21375
|
-
this.tickControl.width = tickWidth;
|
21376
|
-
this.tickControl.x = titleWidth;
|
21377
|
-
}
|
21378
|
-
render(e) {
|
21379
|
-
}
|
21380
|
-
}
|
21381
|
-
/**
|
21382
|
-
* 日期刻度
|
21383
|
-
*/
|
21384
|
-
class DateTickControl extends TimelineBaseControl {
|
21385
|
-
buildOverride(e) {
|
21386
|
-
const { timeTickHours, timeTickWidth } = timelineConfig;
|
21387
|
-
const height = this.height;
|
21388
|
-
const ticks = 24 / timeTickHours;
|
21389
|
-
for (let i = 0; i < this.showDays; i++) {
|
21390
|
-
const width = ticks * timeTickWidth;
|
21391
|
-
const curr = moment$1(this.startTime).add(i, 'days').format('YYYY-MM-DD');
|
21392
|
-
const label = new LabelNode();
|
21393
|
-
label.text = curr + '';
|
21394
|
-
label.fontSize = timelineConfig.fontSize;
|
21395
|
-
label.fontName = timelineConfig.fontName;
|
21396
|
-
const dateTitleWidth = e.render.measureText2(curr + '', label);
|
21397
|
-
label.x = i * width + (width - dateTitleWidth) / 2;
|
21398
|
-
label.y = (height - label.fontSize) / 2;
|
21399
|
-
this.addChild(label);
|
21400
|
-
const path = new TimeLinePath();
|
21401
|
-
path.startPos = { x: i * width, y: 0 };
|
21402
|
-
path.endPos = { x: i * width, y: height };
|
21403
|
-
path.lineColor = '#ffadd2';
|
21404
|
-
this.addChild(path);
|
21405
|
-
}
|
21406
|
-
}
|
21407
|
-
render(e) {
|
21408
|
-
}
|
21409
|
-
}
|
21410
|
-
class TimeTickContainer extends TickContainer {
|
21411
|
-
tickTitleControl;
|
21412
|
-
constructor() {
|
21413
|
-
super();
|
21414
|
-
this.tickTitleControl = new TimeTickTitleControl();
|
21415
|
-
this.tickTitleControl.title = '时刻';
|
21416
|
-
this.tickTitleControl.height = timelineConfig.tickHeaderHeight;
|
21417
|
-
this.tickControl = new TimeTickControl();
|
21418
|
-
this.tickControl.height = timelineConfig.tickHeaderHeight;
|
21419
|
-
this.addChild(this.tickControl);
|
21420
|
-
this.addChild(this.tickTitleControl);
|
21421
|
-
this.height = timelineConfig.tickHeaderHeight;
|
21422
|
-
}
|
21423
|
-
/**
|
21424
|
-
* 设置标题和刻度宽度
|
21425
|
-
* @param titleWidth
|
21426
|
-
* @param tickWidth
|
21427
|
-
*/
|
21428
|
-
setLayout(titleWidth, tickWidth) {
|
21429
|
-
this.width = tickWidth + titleWidth;
|
21430
|
-
this.tickTitleControl.width = titleWidth;
|
21431
|
-
this.tickControl.width = tickWidth;
|
21432
|
-
this.tickControl.x = titleWidth;
|
21433
|
-
}
|
21434
|
-
render(e) {
|
21435
|
-
}
|
21436
|
-
}
|
21437
|
-
class TimeTickControl extends TimelineBaseControl {
|
21438
|
-
constructor() {
|
21439
|
-
super();
|
21440
|
-
this.border = 1;
|
21441
|
-
this.borderColor = '#000';
|
21442
|
-
}
|
21443
|
-
showDays = 7;
|
21444
|
-
buildOverride(e) {
|
21445
|
-
const { timeTickHours, timeTickWidth } = timelineConfig;
|
21446
|
-
const ticks = 24 / timeTickHours;
|
21447
|
-
for (let i = 0; i < this.showDays; i++) {
|
21448
|
-
for (let j = 1; j <= ticks; j++) {
|
21449
|
-
const hourOffset = j * timeTickHours;
|
21450
|
-
const x = i * timeTickWidth * ticks + j * timeTickWidth;
|
21451
|
-
const text = hourOffset + '';
|
21452
|
-
const label = new LabelNode();
|
21453
|
-
label.text = text;
|
21454
|
-
label.fontSize = timelineConfig.fontSize;
|
21455
|
-
label.fontName = timelineConfig.fontName;
|
21456
|
-
const dateTitleWidth = e.render.measureText2(text, label);
|
21457
|
-
label.x = x - timeTickWidth + (timeTickWidth - dateTitleWidth) / 2;
|
21458
|
-
label.y = 0;
|
21459
|
-
this.addChild(label);
|
21460
|
-
}
|
21461
|
-
}
|
21462
|
-
}
|
21463
|
-
render(e) {
|
21464
|
-
const { timeTickHours, timeTickWidth } = timelineConfig;
|
21465
|
-
const ticks = 24 / timeTickHours;
|
21466
|
-
for (let i = 0; i < this.showDays; i++) {
|
21467
|
-
for (let j = 1; j <= ticks; j++) {
|
21468
|
-
const x = i * timeTickWidth * ticks + j * timeTickWidth;
|
21469
|
-
const color = j < ticks ? '#69c0ff' : '#ffadd2';
|
21470
|
-
e.render.strokeLines([{
|
21471
|
-
x,
|
21472
|
-
y: 0
|
21473
|
-
}, { x, y: this.finalRect.height }], 1, color);
|
21474
|
-
}
|
21475
|
-
}
|
21476
|
-
}
|
21477
|
-
}
|
21478
|
-
class InPatDaysTickContainer extends TickContainer {
|
21479
|
-
//inPatDaysControl: InPatDaysControl;
|
21480
|
-
tickTitleControl;
|
21481
|
-
constructor() {
|
21482
|
-
super();
|
21483
|
-
this.tickTitleControl = new TimeTickTitleControl();
|
21484
|
-
this.tickTitleControl.title = '住院天数';
|
21485
|
-
this.tickTitleControl.height = timelineConfig.tickHeaderHeight;
|
21486
|
-
this.tickControl = new InPatDaysControl();
|
21487
|
-
this.tickControl.height = timelineConfig.tickHeaderHeight;
|
21488
|
-
this.addChild(this.tickControl);
|
21489
|
-
this.addChild(this.tickTitleControl);
|
21490
|
-
this.height = timelineConfig.tickHeaderHeight;
|
21491
|
-
}
|
21492
|
-
/**
|
21493
|
-
* 设置标题和刻度宽度
|
21494
|
-
* @param titleWidth
|
21495
|
-
* @param tickWidth
|
21496
|
-
*/
|
21497
|
-
setLayout(titleWidth, tickWidth) {
|
21498
|
-
this.width = tickWidth + titleWidth;
|
21499
|
-
this.tickTitleControl.width = titleWidth;
|
21500
|
-
this.tickControl.width = tickWidth;
|
21501
|
-
this.tickControl.x = titleWidth;
|
21502
|
-
}
|
21503
|
-
render(e) {
|
21504
|
-
}
|
21505
|
-
}
|
21506
|
-
class InPatDaysControl extends TimelineBaseControl {
|
21507
|
-
buildOverride(e) {
|
21508
|
-
const { timeTickHours, timeTickWidth } = timelineConfig;
|
21509
|
-
const height = this.height;
|
21510
|
-
const ticks = 24 / timeTickHours;
|
21511
|
-
for (let i = 0; i < this.showDays; i++) {
|
21512
|
-
const width = ticks * timeTickWidth;
|
21513
|
-
const text = (i + 1) + '';
|
21514
|
-
const label = new LabelNode();
|
21515
|
-
label.text = text;
|
21516
|
-
label.fontSize = timelineConfig.fontSize;
|
21517
|
-
label.fontName = timelineConfig.fontName;
|
21518
|
-
const dateTitleWidth = e.render.measureText2(text, label);
|
21519
|
-
label.x = i * width + (width - dateTitleWidth + label.fontSize) / 2;
|
21520
|
-
label.y = (height - label.fontSize) / 2;
|
21521
|
-
this.addChild(label);
|
21522
|
-
const path = new TimeLinePath();
|
21523
|
-
path.startPos = { x: i * width, y: 0 };
|
21524
|
-
path.endPos = { x: i * width, y: height };
|
21525
|
-
path.lineColor = '#ffadd2';
|
21526
|
-
this.addChild(path);
|
21527
|
-
}
|
21528
|
-
}
|
21529
|
-
render(e) {
|
21530
|
-
}
|
21531
|
-
}
|
21532
|
-
|
21533
|
-
class TimelineScrollBar extends NodeItems {
|
21534
|
-
//滚动条方向
|
21535
|
-
orientation = 'horizontal';
|
21536
|
-
thumb;
|
21537
|
-
thumbSize = 10;
|
21538
|
-
//按照百分比计算
|
21539
|
-
scrollChanged = new Subject();
|
21540
|
-
//总滚动宽度
|
21541
|
-
scrollSize = 0;
|
21542
|
-
//显示区域宽度
|
21543
|
-
viewSize = 0;
|
21544
|
-
scrollX = 0;
|
21545
|
-
scrollY = 0;
|
21546
|
-
constructor(orientation) {
|
21547
|
-
super();
|
21548
|
-
this.bgColor = '#fff';
|
21549
|
-
this.border = 1;
|
21550
|
-
this.borderColor = '#000';
|
21551
|
-
this.height = 16;
|
21552
|
-
this.orientation = orientation;
|
21553
|
-
this.thumb = new ScrollThumb();
|
21554
|
-
this.addChild(this.thumb);
|
21555
|
-
this.thumb.addEventListener('mousedown', evt => {
|
21556
|
-
const pos = { ...evt.pos };
|
21557
|
-
const { x, y } = this.thumb.finalRect;
|
21558
|
-
const mouseMoveListener = (evt2) => {
|
21559
|
-
//const scrollView = this.parent as ScrollView;
|
21560
|
-
const pos2 = evt2.pos;
|
21561
|
-
let moveX = pos2.x - pos.x;
|
21562
|
-
let moveY = pos2.y - pos.y;
|
21563
|
-
moveX += x;
|
21564
|
-
moveY += y;
|
21565
|
-
moveX = (moveX / this.finalRect.width) * this.scrollSize;
|
21566
|
-
moveY = (moveY / this.finalRect.height) * this.scrollSize;
|
21567
|
-
this.updateScroll(moveX, moveY);
|
21568
|
-
};
|
21569
|
-
const mouseUpListener = (evt3) => {
|
21570
|
-
this.thumb.removeEventListener('mousemove', mouseMoveListener);
|
21571
|
-
this.thumb.removeEventListener('mouseup', mouseUpListener);
|
21572
|
-
};
|
21573
|
-
this.thumb.addEventListener('mousemove', mouseMoveListener);
|
21574
|
-
this.thumb.addEventListener('mouseup', mouseUpListener);
|
21575
|
-
});
|
21576
|
-
}
|
21577
|
-
updateScroll(x, y) {
|
21578
|
-
//const scrollView = this.parent as ScrollView;
|
21579
|
-
if (this.orientation === 'horizontal') {
|
21580
|
-
if (this.finalRect.height === 0) {
|
21581
|
-
return;
|
21582
|
-
}
|
21583
|
-
if (x + this.viewSize > this.scrollSize) {
|
21584
|
-
x = this.scrollSize - this.viewSize;
|
21585
|
-
}
|
21586
|
-
x = x < 0 ? 0 : x;
|
21587
|
-
this.scrollChanged.next(x);
|
21588
|
-
this.scrollX = x;
|
21589
|
-
}
|
21590
|
-
}
|
21591
|
-
updateScrollByCurrent(increaseX, increaseY) {
|
21592
|
-
//const scrollView = this.parent as ScrollView;
|
21593
|
-
increaseX += this.scrollX;
|
21594
|
-
increaseY += this.scrollY;
|
21595
|
-
this.updateScroll(increaseX, increaseY);
|
21596
|
-
}
|
21597
|
-
measureOverride(e, availableSize) {
|
21598
|
-
if (this.orientation === 'horizontal') {
|
21599
|
-
return this.measureHorizontalBar(e, availableSize);
|
21600
|
-
}
|
21601
|
-
else {
|
21602
|
-
//return this.measureVerticalBar(e, availableSize);
|
21603
|
-
throw new Error('未实现');
|
21604
|
-
}
|
21605
|
-
}
|
21606
|
-
/**
|
21607
|
-
* 横向滚动条测量
|
21608
|
-
*/
|
21609
|
-
measureHorizontalBar(e, availableSize) {
|
21610
|
-
if (this.scrollSize > this.viewSize) {
|
21611
|
-
//计算滚动按钮的长度
|
21612
|
-
const thumbWidth = (this.viewSize / this.scrollSize) * availableSize.width;
|
21613
|
-
this.thumb.measure(e, { width: thumbWidth, height: this.thumbSize });
|
21614
|
-
return { width: availableSize.width, height: ScrollBarSize };
|
21615
|
-
}
|
21616
|
-
else {
|
21617
|
-
this.thumb.measure(e, { width: 0, height: 0 });
|
21618
|
-
return { width: 0, height: 0 };
|
21619
|
-
}
|
21620
|
-
}
|
21621
|
-
arrangeOverride(e, finalSize) {
|
21622
|
-
//const scrollView = this.parent as ScrollView;
|
21623
|
-
const { width, height } = this.thumb.desiredSize;
|
21624
|
-
const x = this.orientation === 'horizontal' ? (this.scrollX / this.scrollSize) * finalSize.width : (ScrollBarSize - this.thumbSize) / 2;
|
21625
|
-
const y = this.orientation === 'horizontal' ? (ScrollBarSize - this.thumbSize) / 2 : (this.scrollY / this.scrollSize) * finalSize.height;
|
21626
|
-
this.thumb.arrange(e, { x, y, width, height });
|
21627
|
-
return super.arrangeOverride(e, finalSize);
|
21628
|
-
}
|
21629
|
-
render(e) {
|
21630
|
-
//e.render.contentContext.clearRect(0,0,this.finalRect.width,this.finalRect.height);
|
21631
|
-
//e.render.fillRect(0, 0, this.finalRect.width, this.finalRect.height, 'red')
|
21632
|
-
}
|
21633
|
-
}
|
21634
|
-
|
21635
|
-
function createTimeline() {
|
21636
|
-
const timeline = new TimelineControl();
|
21637
|
-
timeline.width = 940;
|
21638
|
-
const timeGridContainer = new TimeGridContainer();
|
21639
|
-
//timeGridContainer.y = 80;
|
21640
|
-
const timelineGridControl = timeGridContainer.timelineGridControl; //new TimeLineControl();
|
21641
|
-
timelineGridControl.showDays = 100;
|
21642
|
-
timelineGridControl.width = timelineGridControl.getLayoutWidth();
|
21643
|
-
timelineGridControl.height = 300;
|
21644
|
-
timelineGridControl.init();
|
21645
|
-
const tempValueRule = new TemperatureValueRuleControl();
|
21646
|
-
tempValueRule.temperatureTimeLineValueModel = timelineGridControl.temperatureTimeLineValueModel;
|
21647
|
-
tempValueRule.bgColor = '#fff';
|
21648
|
-
tempValueRule.height = timelineGridControl.height;
|
21649
|
-
timeGridContainer.timeValueRuleContainer.addChild(tempValueRule);
|
21650
|
-
tempValueRule.addEventListener('mouseenter', evt => {
|
21651
|
-
tempValueRule.bgColor = 'grey';
|
21652
|
-
const mousemoveHandler = () => {
|
21653
|
-
tempValueRule.bgColor = '#fff';
|
21654
|
-
tempValueRule.removeEventListener('mouseleave', mousemoveHandler);
|
21655
|
-
};
|
21656
|
-
tempValueRule.addEventListener('mouseleave', mousemoveHandler);
|
21657
|
-
});
|
21658
|
-
const heartRateValueRule = new HeartRateValueRuleControl();
|
21659
|
-
heartRateValueRule.heartRateTimeLineValueModel = timelineGridControl.heartRateTimeLineValueModel;
|
21660
|
-
heartRateValueRule.bgColor = '#fff';
|
21661
|
-
heartRateValueRule.height = timelineGridControl.height;
|
21662
|
-
timeGridContainer.timeValueRuleContainer.addChild(heartRateValueRule);
|
21663
|
-
heartRateValueRule.addEventListener('mouseenter', evt => {
|
21664
|
-
heartRateValueRule.bgColor = 'grey';
|
21665
|
-
const mousemoveHandler = () => {
|
21666
|
-
heartRateValueRule.bgColor = '#fff';
|
21667
|
-
heartRateValueRule.removeEventListener('mouseleave', mousemoveHandler);
|
21668
|
-
};
|
21669
|
-
heartRateValueRule.addEventListener('mouseleave', mousemoveHandler);
|
21670
|
-
});
|
21671
|
-
timeGridContainer.timeValueRuleContainer.init();
|
21672
|
-
const titleWidth = timeGridContainer.timeValueRuleContainer.getLayoutWidth();
|
21673
|
-
timeGridContainer.timeValueRuleContainer.width = titleWidth;
|
21674
|
-
timeGridContainer.timeValueRuleContainer.height = timelineGridControl.height;
|
21675
|
-
timeGridContainer.timelineGridControl.x = timeGridContainer.timeValueRuleContainer.width;
|
21676
|
-
const dateHeader = new DateTickContainer();
|
21677
|
-
dateHeader.showDays = timelineGridControl.showDays;
|
21678
|
-
dateHeader.setLayout(titleWidth, timelineGridControl.width);
|
21679
|
-
timeline.addChild(dateHeader);
|
21680
|
-
const inDaysHeader = new InPatDaysTickContainer();
|
21681
|
-
inDaysHeader.showDays = timelineGridControl.showDays;
|
21682
|
-
inDaysHeader.setLayout(titleWidth, timelineGridControl.width);
|
21683
|
-
timeline.addChild(inDaysHeader);
|
21684
|
-
const timeHeader = new TimeTickContainer();
|
21685
|
-
timeHeader.showDays = timelineGridControl.showDays;
|
21686
|
-
timeHeader.setLayout(titleWidth, timelineGridControl.width);
|
21687
|
-
timeline.addChild(timeHeader);
|
21688
|
-
timeline.addChild(timeGridContainer);
|
21689
|
-
const hxStatus = new TimelineHXStatusContainer();
|
21690
|
-
hxStatus.showDays = timelineGridControl.showDays;
|
21691
|
-
hxStatus.setLayout(titleWidth, timelineGridControl.width);
|
21692
|
-
timeline.addChild(hxStatus);
|
21693
|
-
const xbStatus = new TimelineXBStatusContainer();
|
21694
|
-
xbStatus.showDays = timelineGridControl.showDays;
|
21695
|
-
xbStatus.setLayout(titleWidth, timelineGridControl.width);
|
21696
|
-
timeline.addChild(xbStatus);
|
21697
|
-
const otStatus = new TimelineOtherStatusContainer();
|
21698
|
-
otStatus.showDays = timelineGridControl.showDays;
|
21699
|
-
otStatus.setLayout(titleWidth, timelineGridControl.width);
|
21700
|
-
timeline.addChild(otStatus);
|
21701
|
-
const timelineScrollbar = new TimelineScrollBar('horizontal');
|
21702
|
-
timelineScrollbar.scrollSize = timelineGridControl.width;
|
21703
|
-
timelineScrollbar.viewSize = 840;
|
21704
|
-
timelineScrollbar.width = timeline.width;
|
21705
|
-
timelineScrollbar.scrollChanged.subscribe(data => {
|
21706
|
-
dateHeader.scrollX = data;
|
21707
|
-
inDaysHeader.scrollX = data;
|
21708
|
-
timeHeader.scrollX = data;
|
21709
|
-
timeGridContainer.scrollX = data;
|
21710
|
-
xbStatus.scrollX = data;
|
21711
|
-
hxStatus.scrollX = data;
|
21712
|
-
otStatus.scrollX = data;
|
21713
|
-
});
|
21714
|
-
timeline.addChild(timelineScrollbar);
|
21715
|
-
return timeline;
|
21716
|
-
}
|
21717
|
-
|
21718
20413
|
/**
|
21719
20414
|
* Node宽度定义
|
21720
20415
|
* 1.在单页模式下,文档最小宽度为单个文档宽度+合适的外边距
|
@@ -22310,7 +21005,7 @@ class CanvasTextEditor extends AbsolutePanel {
|
|
22310
21005
|
/**
|
22311
21006
|
* 开启格式刷
|
22312
21007
|
*/
|
22313
|
-
enableFormatBrush() {
|
21008
|
+
enableFormatBrush(once = false) {
|
22314
21009
|
const startControl = this.selectionState.startControl;
|
22315
21010
|
if (startControl instanceof TextGroupElement) {
|
22316
21011
|
const selectedStyle = startControl.props.clone(null);
|
@@ -22607,8 +21302,8 @@ class CanvasTextEditor extends AbsolutePanel {
|
|
22607
21302
|
const win = new Window();
|
22608
21303
|
win.width = 1000;
|
22609
21304
|
win.height = 800;
|
22610
|
-
const timeLineControl = createTimeline();
|
22611
|
-
win.content.addChild(timeLineControl)
|
21305
|
+
//const timeLineControl = createTimeline();
|
21306
|
+
//win.content.addChild(timeLineControl)
|
22612
21307
|
const rule2 = new RuleControl(this.docCtx);
|
22613
21308
|
this.rule = rule2;
|
22614
21309
|
rule2.width = 700;
|