cnhis-design-vue 3.1.48-beta.5 → 3.1.48-beta.6
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/es/components/card-reader-sdk/src/cardReaderSDK.d.ts +24 -3
- package/es/components/card-reader-sdk/src/cardReaderSDK.js +1 -1
- package/es/components/card-reader-sdk/src/types/index.d.ts +21 -15
- package/es/components/fabric-chart/src/hooks/birthProcess/useBirthProcess.js +1 -1
- package/es/components/fabric-chart/src/hooks/birthProcess/useBirthProcessChart.js +1 -1
- package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useCenter.js +1 -1
- package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useLeft.js +1 -1
- package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useOther.js +1 -1
- package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useTop.js +1 -1
- package/es/components/fabric-chart/src/hooks/temperature/useBottom.js +1 -1
- package/es/components/fabric-chart/src/hooks/temperature/useCenter.js +1 -1
- package/es/components/fabric-chart/src/hooks/temperature/useLeft.js +1 -1
- package/es/components/fabric-chart/src/hooks/temperature/useOther.js +1 -1
- package/es/components/fabric-chart/src/hooks/temperature/useTemperatureChart.js +1 -1
- package/es/components/fabric-chart/src/hooks/temperature/useTop.js +1 -1
- package/es/shared/package.json.js +1 -1
- package/es/shared/types/index.d.ts +1 -0
- package/package.json +2 -2
|
@@ -10,13 +10,34 @@ export default class CardReaderSDK {
|
|
|
10
10
|
static create(options?: InsuranceType.CardReadOptions): CardReaderSDK;
|
|
11
11
|
destroy(): void;
|
|
12
12
|
readHealthCard(instance?: ComponentInternalInstance): Promise<string>;
|
|
13
|
-
readIdCard(params?: InsuranceType.CardReadParams): Promise<
|
|
14
|
-
|
|
13
|
+
readIdCard(params?: InsuranceType.CardReadParams): Promise<Partial<{
|
|
14
|
+
persioninfo: Record<"sex" | "age" | "address" | "birthday" | "location" | "cardnum" | "cardpwd" | "folk" | "idnumber" | "ownpay" | "ptname" | "pttype" | "recordid" | "updateflag", string>;
|
|
15
|
+
cardinfo: {
|
|
16
|
+
cardid: string;
|
|
17
|
+
cardno: string;
|
|
18
|
+
};
|
|
19
|
+
iar1: Record<"iaa01" | "acf01" | "iab02" | "iac03" | "iad04" | "iai03" | "iak04" | "iak05" | "iak06" | "iak22" | "iar01" | "iar10" | "iar11" | "iar12" | "iar13" | "iar14" | "iar15" | "iar16" | "iar17" | "iar18" | "iar19" | "iar20" | "iar21" | "iar22" | "iar23" | "iar24" | "iar25" | "iar26" | "iar27" | "iar28" | "iar29" | "iar30" | "iar31" | "iar32" | "iar33" | "iar34" | "iar35" | "iar36" | "iar37" | "iar38" | "iar39" | "iar40" | "iar41" | "iar42" | "iar43" | "iar44" | "iar45" | "iar46" | "iar47" | "iar48" | "iar49" | "iar50" | "iar51" | "iar52" | "iar53" | "iar54" | "iar55" | "iar56" | "iar57" | "iar58" | "iar59" | "iar60" | "iar61" | "iar62" | "iar63" | "iar64" | "iar65" | "iar66" | "iar67" | "iar68" | "iar69" | "iar70" | "iar71" | "iar72" | "iar73" | "iar74" | "iar75", string>;
|
|
20
|
+
}> | undefined>;
|
|
21
|
+
readVisitCard(params?: InsuranceType.CardReadParams): Promise<Partial<{
|
|
22
|
+
persioninfo: Record<"sex" | "age" | "address" | "birthday" | "location" | "cardnum" | "cardpwd" | "folk" | "idnumber" | "ownpay" | "ptname" | "pttype" | "recordid" | "updateflag", string>;
|
|
23
|
+
cardinfo: {
|
|
24
|
+
cardid: string;
|
|
25
|
+
cardno: string;
|
|
26
|
+
};
|
|
27
|
+
iar1: Record<"iaa01" | "acf01" | "iab02" | "iac03" | "iad04" | "iai03" | "iak04" | "iak05" | "iak06" | "iak22" | "iar01" | "iar10" | "iar11" | "iar12" | "iar13" | "iar14" | "iar15" | "iar16" | "iar17" | "iar18" | "iar19" | "iar20" | "iar21" | "iar22" | "iar23" | "iar24" | "iar25" | "iar26" | "iar27" | "iar28" | "iar29" | "iar30" | "iar31" | "iar32" | "iar33" | "iar34" | "iar35" | "iar36" | "iar37" | "iar38" | "iar39" | "iar40" | "iar41" | "iar42" | "iar43" | "iar44" | "iar45" | "iar46" | "iar47" | "iar48" | "iar49" | "iar50" | "iar51" | "iar52" | "iar53" | "iar54" | "iar55" | "iar56" | "iar57" | "iar58" | "iar59" | "iar60" | "iar61" | "iar62" | "iar63" | "iar64" | "iar65" | "iar66" | "iar67" | "iar68" | "iar69" | "iar70" | "iar71" | "iar72" | "iar73" | "iar74" | "iar75", string>;
|
|
28
|
+
}> | undefined>;
|
|
15
29
|
readHospitalCard(params?: InsuranceType.CardReadParams & {
|
|
16
30
|
iai03?: string;
|
|
17
31
|
bdp02?: string;
|
|
18
32
|
vaa05?: string;
|
|
19
|
-
}): Promise<
|
|
33
|
+
}): Promise<Partial<{
|
|
34
|
+
persioninfo: Record<"sex" | "age" | "address" | "birthday" | "location" | "cardnum" | "cardpwd" | "folk" | "idnumber" | "ownpay" | "ptname" | "pttype" | "recordid" | "updateflag", string>;
|
|
35
|
+
cardinfo: {
|
|
36
|
+
cardid: string;
|
|
37
|
+
cardno: string;
|
|
38
|
+
};
|
|
39
|
+
iar1: Record<"iaa01" | "acf01" | "iab02" | "iac03" | "iad04" | "iai03" | "iak04" | "iak05" | "iak06" | "iak22" | "iar01" | "iar10" | "iar11" | "iar12" | "iar13" | "iar14" | "iar15" | "iar16" | "iar17" | "iar18" | "iar19" | "iar20" | "iar21" | "iar22" | "iar23" | "iar24" | "iar25" | "iar26" | "iar27" | "iar28" | "iar29" | "iar30" | "iar31" | "iar32" | "iar33" | "iar34" | "iar35" | "iar36" | "iar37" | "iar38" | "iar39" | "iar40" | "iar41" | "iar42" | "iar43" | "iar44" | "iar45" | "iar46" | "iar47" | "iar48" | "iar49" | "iar50" | "iar51" | "iar52" | "iar53" | "iar54" | "iar55" | "iar56" | "iar57" | "iar58" | "iar59" | "iar60" | "iar61" | "iar62" | "iar63" | "iar64" | "iar65" | "iar66" | "iar67" | "iar68" | "iar69" | "iar70" | "iar71" | "iar72" | "iar73" | "iar74" | "iar75", string>;
|
|
40
|
+
}> | undefined>;
|
|
20
41
|
private createBasicParams;
|
|
21
42
|
private checkLoading;
|
|
22
43
|
private checkResCodeAndLoading;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{isFunction as a}from"lodash-es";import e from"./insuranceSDK.js";import{CARD_TYPE as
|
|
1
|
+
import{isFunction as a}from"lodash-es";import e from"./insuranceSDK.js";import{CARD_TYPE as t}from"./constants/index.js";import{ReadHealthCard as r}from"./utils/readHealthCard.js";class s{constructor(a){this.options=a,this.loading=!1,this.readHealthCardDialog=new r,this.insurance=new e}get basicParamsRes(){return a(this.options.basicParams)?this.options.basicParams():this.options.basicParams}static create(a={}){return new s(a)}destroy(){this.insurance.destroy()}async readHealthCard(a){return await this.checkLoading(),this.readHealthCardDialog.show(a)}async readIdCard(a={}){await this.checkLoading();const e=this.createBasicParams(t.ID_CARD,a);return this.checkResCodeAndLoading(this.insurance.getInsuranceInfoPromise(e))}async readVisitCard(a={}){await this.checkLoading();const e=this.createBasicParams(t.VISIT_CARD,a,{transsystem:"10",transdata:{readtype:1}});return this.checkResCodeAndLoading(this.insurance.getInsuranceInfoPromise(e))}async readHospitalCard(a={}){await this.checkLoading();const e=this.createBasicParams(t.HOSPITAL_CARD,a,{iar1Json:{iaa01:a.interfaceid,iai03:a.iai03||"",bdp02:a.bdp02||""},personinfo:{location:0,ptname:a.vaa05||""},transchannel:"101",interfaceid:a.interfaceid,transtype:"YB0000"});return this.checkResCodeAndLoading(this.insurance.getInsuranceInfoPromise(e))}createBasicParams(a,e,t){var r,s;const{operatorname:i,operatorcode:n,...o}=this.basicParamsRes||{};return{type:a,operatorname:null!=(r=e.operatorname)?r:i,operatorcode:null!=(s=e.operatorcode)?s:n,...o,...t}}checkLoading(){if(this.loading)return Promise.reject("请勿重复读卡")}async checkResCodeAndLoading(a){try{this.loading=!0;const e=await a;return 3===e.returncode?Promise.reject(`读卡服务提示: ${e.returnmsg||"读卡失败"}`):e.returndata}finally{this.loading=!1}}}export{s as default};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { AnyObject, Func } from '../../../../../es/shared/types';
|
|
1
|
+
import { AnyObject, Func, NumberRange } from '../../../../../es/shared/types';
|
|
2
2
|
export declare namespace InsuranceType {
|
|
3
|
-
type ExecType = 'hisyb' | 'login';
|
|
4
|
-
type IHOWindow = Window & {
|
|
3
|
+
export type ExecType = 'hisyb' | 'login';
|
|
4
|
+
export type IHOWindow = Window & {
|
|
5
5
|
chrome: {
|
|
6
6
|
webview: {
|
|
7
7
|
addEventListener: (type: string, handler: Func) => void;
|
|
@@ -10,26 +10,26 @@ export declare namespace InsuranceType {
|
|
|
10
10
|
};
|
|
11
11
|
};
|
|
12
12
|
};
|
|
13
|
-
type MessageDataType = {
|
|
13
|
+
export type MessageDataType = {
|
|
14
14
|
exec: ExecType;
|
|
15
15
|
res: {
|
|
16
16
|
transcmd: string;
|
|
17
17
|
};
|
|
18
18
|
};
|
|
19
|
-
type MessageType = {
|
|
19
|
+
export type MessageType = {
|
|
20
20
|
data: string | MessageDataType;
|
|
21
21
|
};
|
|
22
|
-
type PostMessageResult<T extends ExecType> = {
|
|
22
|
+
export type PostMessageResult<T extends ExecType> = {
|
|
23
23
|
result: any;
|
|
24
24
|
exec: T;
|
|
25
25
|
res: any;
|
|
26
26
|
};
|
|
27
|
-
type CardReadParams = Partial<{
|
|
27
|
+
export type CardReadParams = Partial<{
|
|
28
28
|
operatorname: string;
|
|
29
29
|
operatorcode: string;
|
|
30
30
|
location: number;
|
|
31
31
|
needLogin: boolean;
|
|
32
|
-
interfaceid:
|
|
32
|
+
interfaceid: number;
|
|
33
33
|
iar1Json: AnyObject;
|
|
34
34
|
personinfo: AnyObject;
|
|
35
35
|
transdata: AnyObject;
|
|
@@ -37,17 +37,23 @@ export declare namespace InsuranceType {
|
|
|
37
37
|
transtype: string;
|
|
38
38
|
transchannel: string;
|
|
39
39
|
}>;
|
|
40
|
-
type
|
|
40
|
+
type MapperIar<T extends any[], Res extends any[] = []> = T extends [infer F, ...infer Rest] ? MapperIar<Rest, [...Res, `iar${F extends number ? F : never}`]> : Res;
|
|
41
|
+
export type CardReadResult = {
|
|
41
42
|
returncode: number;
|
|
42
43
|
returnmsg: string;
|
|
43
44
|
} & Partial<{
|
|
44
|
-
returndata: {
|
|
45
|
-
persioninfo
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
45
|
+
returndata: Partial<{
|
|
46
|
+
persioninfo: Record<'address' | 'age' | 'birthday' | 'cardnum' | 'cardpwd' | 'folk' | 'idnumber' | 'location' | 'ownpay' | 'ptname' | 'pttype' | 'recordid' | 'sex' | 'updateflag', string>;
|
|
47
|
+
cardinfo: {
|
|
48
|
+
cardid: string;
|
|
49
|
+
cardno: string;
|
|
50
|
+
};
|
|
51
|
+
iar1: Record<'acf01' | 'iaa01' | 'iab02' | 'iac03' | 'iad04' | 'iai03' | 'iak04' | 'iak05' | 'iak06' | 'iak22' | 'iar01' | 'iar10' | MapperIar<NumberRange<10, 75>>[number], string>;
|
|
52
|
+
}>;
|
|
53
|
+
transcmd: string;
|
|
49
54
|
}>;
|
|
50
|
-
type CardReadOptions = Partial<{
|
|
55
|
+
export type CardReadOptions = Partial<{
|
|
51
56
|
basicParams: CardReadParams | (() => CardReadParams);
|
|
52
57
|
}>;
|
|
58
|
+
export {};
|
|
53
59
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{fabric as e}from"../../../../../shared/utils/fabricjs/index.js";import{drawLine as t,drawArrow as o,drawText as n,defaultTextStyle as i,drawPoint as r,drawTextAndIconGroup as l,defaultStyle as s,defaultRectStyle as a}from"../useDraw.js";import{useGrid as u}from"../useGrid.js";import{useBirthProcessCumputedPoint as c}from"../useCumputedPoint.js";import"@vueuse/core";import{getScaleInfo as d,drawScaleNumber as f,drawScaleLine as p}from"../useScaleColumn.js";import{useCommon as h}from"../useCommon.js";import"vue";import{getIndex as g,isEffectiveNode as v,getTime as m,getScaleNumberList as y}from"../../utils/index.js";import"../temperature/useShadow.js";import{cloneDeep as k}from"lodash-es";import{format as w}from"date-fns";function x(x,b,j,C,P){const{cumputedX:S,cumputedY:G,getXValue:M,getYValue:T}=c(b),{getEqualXTypes:Y,handleAddPrevent:E,isGridLimit:L}=h(x,j,b),{xAxis:X,grid:A,originX:I,originY:H,xCellWidth:O,endY:W,startTime:V,leftAddAreaWidth:D,leftScales:N,rightScales:R,yCellHeight:$,endX:B,scaleValues:F,canvasWidth:q,borderStyle:z,rightAddAreaWidth:J,event:K,originYCervix:Q,other:U,canvasHeight:Z}=b,_=k(F),ee=new Set;function te(){_.filter((e=>e.show)).forEach(((e,l)=>{var s;const a=[],u=[],c=[];null==(s=e.data)||s.forEach(((s,d)=>{!function(s,d,f){let p,h;const{pointAttr:g={},lineAttr:v={},title:m="",key:y,type:k="circle",childbirthStyle:w={}}=e,P=e.data[f+1],S=le(P,e);if(s&&S&&!d.breakpoint)h=t([...s,...S],{...v});else if(s&&!S&&!d.breakpoint){const o=le(P,e);h=o?t([...s,...o],{...v}):null}let G,Y;if(d.childbirth){const e=s[1]+$;G=o([s[0],s[1],e],w),c.push(G),Y=n([s[0]+O/2,e-$/2],{value:String(d.childbirth),...i,originX:"left",originY:"center",...w}),c.push(Y)}const E=u[f-1],L={origin:{data:d,title:m,key:y||"",dataIndex:l,index:f},leftLine:E,rightLine:h,arrowGroup:G,arrowGroupText:Y,...g,...b.event.hovered?b.event.evented?{selectable:!0}:{selectable:!0,lockMovementX:!0,lockMovementY:!0}:b.event};E?p=r(k,{left:E.get("x2"),top:E.get("y2"),...L}):s&&(L.leftLine=null,p=r(k,{left:s[0],top:s[1],...L}));u.push(h),p&&(!function(e){K.hovered&&(e.on("mouseover",(()=>{re(e,"hover")})),e.on("mouseout",(()=>{C.show=!1})));if(e.lockMovementX&&e.lockMovementY)return;e.on("moving",(()=>{ie(e),function(e){var t,o,n,i;null==(t=e.leftLine)||t.setCoords().set({x2:e.left,y2:e.top}),null==(o=e.rightLine)||o.setCoords().set({x1:e.left,y1:e.top}),null==(n=e.arrowGroup)||n.setCoords().set({left:e.left,top:e.top}),null==(i=e.arrowGroupText)||i.setCoords().set({left:e.left+O/2,top:e.top+$/2})}(e),K.hovered&&re(e)})),e.on("mouseup",(t=>{if(C.show=!1,1===t.button){const{key:t}=e.origin,o={...e.origin,data:{...e.origin.data,time:M(e.left),value:T(t,e.top)}};x.value.discardActiveObject(),j("change",o),oe(o,"change")}}))}(p),a.push(p),ee.add(p))}(le(s,e),s,d)})),Promise.all(a).then((e=>{const t=u.filter((e=>e));let o=null;e=e.filter((e=>(e&&o&&(o.nextPoint=e,e.prevPoint=o),o=e||o,e))),Promise.all(c).then((o=>{x.value.add(...t,...e,...o),e.forEach((e=>{null==e||e.bringToFront()}))}))}))}))}function oe(e,t="add"){const{dataIndex:o,data:n,index:i,key:r}=e,l=_.find((e=>e.key===r));switch(t){case"remove":l.data.splice(i,1);break;case"change":l.data[i]=n;break;default:{const e=g(n.time,l.data);l.data.splice(e,0,n);break}}ne()}function ne(){var e;ee.size&&(null==(e=x.value)||e.remove(...function(e){const t=[];return e.forEach((e=>{e&&t.push(e),(null==e?void 0:e.leftLine)&&t.push(null==e?void 0:e.leftLine),(null==e?void 0:e.rightLine)&&t.push(null==e?void 0:e.rightLine),(null==e?void 0:e.arrowGroup)&&t.push(null==e?void 0:e.arrowGroup),(null==e?void 0:e.arrowGroupText)&&t.push(null==e?void 0:e.arrowGroupText)})),t}([...ee]))),ee.clear(),te()}function ie(e){const t=e.prevPoint?e.prevPoint.left:I,o=e.nextPoint?e.nextPoint.left:B;e.setCoords(),["cervix","fetalPresentation"].includes(e.origin.key)&&e.top<Q&&e.set("top",Q),e.top<H&&e.set("top",H),e.top>W&&e.set("top",W),e.left<t&&e.set("left",t),e.left>o&&e.set("left",o)}function re(e,t="moving"){const{title:o,key:n,data:i}=e.origin;C.point={x:e.left,y:e.top},C.list=[`${o} ${"hover"===t?i.value:T(n,e.top)}`,`时间 ${M(e.left).slice(-5)}`],C.show=!0}function le(e,t){if(v(e)&&function(e){const t=V+864e5,o=m(e);return o>=V&&o<=t}(e.time)){const o=S(e.time),n=G(t.key,t.range,e.value);return[o,n<H?H:n>W?W:n]}}function se(e,t){return e+1>t[1]?t[0]:e+1}return u(x,b),function(){const t=new e.Rect({...z,width:q-D-J-1,height:W-1,left:D,top:0,fill:"transparent"});x.value.add(t)}(),function(){function t(t,o="left"){let r="left"===o?D:B;t.forEach(((t,o)=>{const{range:l,spaceValue:u,width:c,title:h,titleStyle:g,key:v,position:m="center",spaceGridNumber:k=1,showNumber:w,showMaxMinNumber:b}=t,j=[],C=[],P=r+c/2,S=y(l,u),G=S.length;S.forEach(((e,o)=>{const{lineXMain:n,lineXSub:i,textLeft:l}=d(m,r,c),s=W-o*$*k,a=0===o?W-8:o!==S.length-1||H||Q&&"FHR"!==v?s:H+8;!w||(0===o||o===G-1)&&!b||j.push(f(String(e),t,l,a)),C.push(...p(t,o,n,i,s,$,H,G))}));const M=new e.Rect({...a,strokeWidth:.5,width:c,height:W,left:P,top:W/2}),T=n([P,H>0?H-$/2:$/2],{value:String(h),...i,...g}),Y=new e.Group([...C,...j,M,...T?[T]:[]],{objectCaching:!1,...s});x.value.add(Y),Y.sendToBack(),r+=c}))}t(N),t(R,"right")}(),function(){const{show:t,startTime:o,range:r=[0,23],position:l="top",style:a}=X.time,{show:u,range:c=[0,23],position:d,style:f}=X.processTime;if(t||u){const p=[],h=[],g=[],v=[],m=I+O/2,y=$/2;for(let e=0;e<A.mainXCell;e++){if(t){const t=0===e?+o.slice(11,13):se(p.at(-1),r);p.push(t);const s="top"===l?H-y:W+y;g.push(n([m+e*O,s],{value:String(t),...i,...a||{}}))}if(u){const t=0===e?c[0]:h.at(-1)+1;h.push(t);const o="top"===d?y:Z-y;v.push(n([m+e*O,o],{value:String(t),...i,...f||{}}))}}const k=new e.Group([...g,...v],{objectCaching:!1,...s});x.value.add(k),x.value.sendToBack(k)}}(),function(){var e;const o=Object.values(U),n=[],i={},r=_.find((e=>"cervix"===e.key&&e.show)),l=null==(e=null==r?void 0:r.data)?void 0:e.find((e=>3==+e.value));function s(e,t){const{key:o,range:n}=r||{},i=G(o,n,10),l=[0,t],s=[-t/e,0],a=[(W-i-t)/e,W-i],u=[B-I,e*(B-I)+t];let c=[],d=[];function f([o,n]){return Math.abs(n-e*o-t)<=1}function p([e,t]){const[o,n]=[...h([e,t])];return o>=I&&o<=B&&n>=i&&n<=W}function h([e,t]){return[I+e,W-t]}return f(l)&&p(l)&&(c=h(l)),f(s)&&p(s)&&(c=h(s)),f(a)&&p(a)&&(d=h(a)),f(u)&&p(u)&&(d=h(u)),[...c,...d]}o.forEach((e=>{if(!e.show)return;const{key:o}=e;switch(o){case"fetalPresentation":{const{range:i,show:r}=_.find((e=>e.key===o));if(r){const r=G(o,i,0);n.push(t([I,r,B,r],{...e}))}break}case"alert":if(l){const{key:o,range:a}=r||{},u=216e5,c={time:w(new Date(m(l.time)+u),"yyyy-MM-dd HH:mm"),value:10},[d,f]=[S(l.time)-I,W-G(o,a,l.value)],[p,h]=[S(c.time)-I,W-G(o,a,c.value)],g=(h-f)/(p-d),v=f-d*g,y=s(g,v);y.length>0&&(n.push(t(y,{...e})),Object.assign(i,{k:g,b:v}))}break;case"handling":if(l){const{k:o,b:r}=i,a=144e5,u=s(o,r-(S(w(new Date(m(l.time)+a),"yyyy-MM-dd HH:mm"))-S(l.time))*o);u.length>0&&n.push(t(u,{...e}))}}})),x.value.add(...n)}(),te(),function(){function e(e,t){const o=_.findIndex((t=>t.key===e.key));return{renderItem:()=>e.title,origin:{title:e.title,unit:e.unit,dataIndex:o,key:e.key},pointer:t}}b.event.evented&&x.value.on("mouse:up",(t=>{if(3===t.button){const{x:o=0,y:n=0}=t.pointer||{};o>=I&&o<=B&&n>=H&&n<=W&&(P.point={x:o,y:n},P.show=!0,t.target?(P.target=t.target,P.list=["删除节点"],x.value.forEachObject((e=>{e.origin&&e.left===t.target.left&&e.top===t.target.top&&P.list.push({renderItem:()=>e.origin.title,origin:{...e.origin},mode:"remove",pointer:t.pointer})}))):(P.target=null,P.list=["新增节点"],_.filter((e=>e.show)).forEach((i=>{if(!Y(o,"key",O).includes(i.key)){if(["cervix","fetalPresentation"].includes(i.key)&&n<Q)return;P.list.push(e(i,t.pointer))}})),1===P.list.length&&(P.show=!1,E("repeat"),console.log("当前时间段内无可新增节点"))))}}))}(),function(){const e=q-J/2;function t(e,t){if(!e.length)return;let n=H;const i=[];e.forEach((e=>{const o=e.title.split("").join("\n"),r=F.findIndex((t=>t.key===e.key)),{text:s,icon:a}=l(o,e,{text:{originY:"top",left:t,top:n},icon:{left:t,topY:n,originY:"top",origin:{type:e.type,dataIndex:r},...b.event}},"vertical");var u;n+=s.height+a.height+15,(u=a).on("moving",(()=>{u.set("originY","center"),L(u)?(ie(u),re(u)):C.show=!1})),u.on("mouseup:before",(e=>{if(C.show=!1,0===e.e.button&&L(u))if(Y(u.left,"key",O).includes(u.origin.key))E("repeat");else{const e={data:{time:M(u.left),value:T(u.origin.key,u.top)},...u.origin};j("add",e),oe(e)}!function(e){e.setCoords().set({originY:"top",left:e.originLeft,top:e.originTop})}(u)})),i.push(s,a)})),o(i),x.value.add(...i)}function o(e){const t=e.at(-1),o=(W-H)/2,n=(t.height+t.top-H)/2;e.forEach((e=>{const t=e.top+o-n;e.set({top:t,originTop:t})}))}t(N,D/2),t(R,e)}(),{clickMenu:function({item:e,target:t}){const o={...e.origin};"remove"===e.mode?(j("remove",o),oe(o,"remove")):(Object.assign(o,{data:{time:M(e.pointer.x),value:T(e.origin.key,e.pointer.y)}}),j("add",o),oe(o))},redrawPoints:ne}}export{x as useBirthProcess};
|
|
1
|
+
import{fabric as e}from"../../../../../shared/utils/fabricjs/index.js";import{drawLine as t,drawArrow as o,drawText as n,defaultTextStyle as i,drawPoint as r,drawTextAndIconGroup as l,defaultStyle as s,defaultRectStyle as a}from"../useDraw.js";import{useGrid as u}from"../useGrid.js";import{useBirthProcessCumputedPoint as c}from"../useCumputedPoint.js";import"@vueuse/core";import{getScaleInfo as d,drawScaleNumber as f,drawScaleLine as p}from"../useScaleColumn.js";import{useCommon as h}from"../useCommon.js";import"vue";import{getIndex as g,isEffectiveNode as v,getTime as m,getScaleNumberList as y}from"../../utils/index.js";import"../temperature/useShadow.js";import{cloneDeep as k}from"lodash-es";import{format as w}from"date-fns";import"../../../../../shared/utils/index.js";function x(x,b,j,C,P){const{cumputedX:S,cumputedY:G,getXValue:M,getYValue:T}=c(b),{getEqualXTypes:Y,handleAddPrevent:E,isGridLimit:L}=h(x,j,b),{xAxis:X,grid:A,originX:I,originY:H,xCellWidth:O,endY:W,startTime:V,leftAddAreaWidth:D,leftScales:N,rightScales:R,yCellHeight:$,endX:B,scaleValues:F,canvasWidth:q,borderStyle:z,rightAddAreaWidth:J,event:K,originYCervix:Q,other:U,canvasHeight:Z}=b,_=k(F),ee=new Set;function te(){_.filter((e=>e.show)).forEach(((e,l)=>{var s;const a=[],u=[],c=[];null==(s=e.data)||s.forEach(((s,d)=>{!function(s,d,f){let p,h;const{pointAttr:g={},lineAttr:v={},title:m="",key:y,type:k="circle",childbirthStyle:w={}}=e,P=e.data[f+1],S=le(P,e);if(s&&S&&!d.breakpoint)h=t([...s,...S],{...v});else if(s&&!S&&!d.breakpoint){const o=le(P,e);h=o?t([...s,...o],{...v}):null}let G,Y;if(d.childbirth){const e=s[1]+$;G=o([s[0],s[1],e],w),c.push(G),Y=n([s[0]+O/2,e-$/2],{value:String(d.childbirth),...i,originX:"left",originY:"center",...w}),c.push(Y)}const E=u[f-1],L={origin:{data:d,title:m,key:y||"",dataIndex:l,index:f},leftLine:E,rightLine:h,arrowGroup:G,arrowGroupText:Y,...g,...b.event.hovered?b.event.evented?{selectable:!0}:{selectable:!0,lockMovementX:!0,lockMovementY:!0}:b.event};E?p=r(k,{left:E.get("x2"),top:E.get("y2"),...L}):s&&(L.leftLine=null,p=r(k,{left:s[0],top:s[1],...L}));u.push(h),p&&(!function(e){K.hovered&&(e.on("mouseover",(()=>{re(e,"hover")})),e.on("mouseout",(()=>{C.show=!1})));if(e.lockMovementX&&e.lockMovementY)return;e.on("moving",(()=>{ie(e),function(e){var t,o,n,i;null==(t=e.leftLine)||t.setCoords().set({x2:e.left,y2:e.top}),null==(o=e.rightLine)||o.setCoords().set({x1:e.left,y1:e.top}),null==(n=e.arrowGroup)||n.setCoords().set({left:e.left,top:e.top}),null==(i=e.arrowGroupText)||i.setCoords().set({left:e.left+O/2,top:e.top+$/2})}(e),K.hovered&&re(e)})),e.on("mouseup",(t=>{if(C.show=!1,1===t.button){const{key:t}=e.origin,o={...e.origin,data:{...e.origin.data,time:M(e.left),value:T(t,e.top)}};x.value.discardActiveObject(),j("change",o),oe(o,"change")}}))}(p),a.push(p),ee.add(p))}(le(s,e),s,d)})),Promise.all(a).then((e=>{const t=u.filter((e=>e));let o=null;e=e.filter((e=>(e&&o&&(o.nextPoint=e,e.prevPoint=o),o=e||o,e))),Promise.all(c).then((o=>{x.value.add(...t,...e,...o),e.forEach((e=>{null==e||e.bringToFront()}))}))}))}))}function oe(e,t="add"){const{dataIndex:o,data:n,index:i,key:r}=e,l=_.find((e=>e.key===r));switch(t){case"remove":l.data.splice(i,1);break;case"change":l.data[i]=n;break;default:{const e=g(n.time,l.data);l.data.splice(e,0,n);break}}ne()}function ne(){var e;ee.size&&(null==(e=x.value)||e.remove(...function(e){const t=[];return e.forEach((e=>{e&&t.push(e),(null==e?void 0:e.leftLine)&&t.push(null==e?void 0:e.leftLine),(null==e?void 0:e.rightLine)&&t.push(null==e?void 0:e.rightLine),(null==e?void 0:e.arrowGroup)&&t.push(null==e?void 0:e.arrowGroup),(null==e?void 0:e.arrowGroupText)&&t.push(null==e?void 0:e.arrowGroupText)})),t}([...ee]))),ee.clear(),te()}function ie(e){const t=e.prevPoint?e.prevPoint.left:I,o=e.nextPoint?e.nextPoint.left:B;e.setCoords(),["cervix","fetalPresentation"].includes(e.origin.key)&&e.top<Q&&e.set("top",Q),e.top<H&&e.set("top",H),e.top>W&&e.set("top",W),e.left<t&&e.set("left",t),e.left>o&&e.set("left",o)}function re(e,t="moving"){const{title:o,key:n,data:i}=e.origin;C.point={x:e.left,y:e.top},C.list=[`${o} ${"hover"===t?i.value:T(n,e.top)}`,`时间 ${M(e.left).slice(-5)}`],C.show=!0}function le(e,t){if(v(e)&&function(e){const t=V+864e5,o=m(e);return o>=V&&o<=t}(e.time)){const o=S(e.time),n=G(t.key,t.range,e.value);return[o,n<H?H:n>W?W:n]}}function se(e,t){return e+1>t[1]?t[0]:e+1}return u(x,b),function(){const t=new e.Rect({...z,width:q-D-J-1,height:W-1,left:D,top:0,fill:"transparent"});x.value.add(t)}(),function(){function t(t,o="left"){let r="left"===o?D:B;t.forEach(((t,o)=>{const{range:l,spaceValue:u,width:c,title:h,titleStyle:g,key:v,position:m="center",spaceGridNumber:k=1,showNumber:w,showMaxMinNumber:b}=t,j=[],C=[],P=r+c/2,S=y(l,u),G=S.length;S.forEach(((e,o)=>{const{lineXMain:n,lineXSub:i,textLeft:l}=d(m,r,c),s=W-o*$*k,a=0===o?W-8:o!==S.length-1||H||Q&&"FHR"!==v?s:H+8;!w||(0===o||o===G-1)&&!b||j.push(f(String(e),t,l,a)),C.push(...p(t,o,n,i,s,$,H,G))}));const M=new e.Rect({...a,strokeWidth:.5,width:c,height:W,left:P,top:W/2}),T=n([P,H>0?H-$/2:$/2],{value:String(h),...i,...g}),Y=new e.Group([...C,...j,M,...T?[T]:[]],{objectCaching:!1,...s});x.value.add(Y),Y.sendToBack(),r+=c}))}t(N),t(R,"right")}(),function(){const{show:t,startTime:o,range:r=[0,23],position:l="top",style:a}=X.time,{show:u,range:c=[0,23],position:d,style:f}=X.processTime;if(t||u){const p=[],h=[],g=[],v=[],m=I+O/2,y=$/2;for(let e=0;e<A.mainXCell;e++){if(t){const t=0===e?+o.slice(11,13):se(p.at(-1),r);p.push(t);const s="top"===l?H-y:W+y;g.push(n([m+e*O,s],{value:String(t),...i,...a||{}}))}if(u){const t=0===e?c[0]:h.at(-1)+1;h.push(t);const o="top"===d?y:Z-y;v.push(n([m+e*O,o],{value:String(t),...i,...f||{}}))}}const k=new e.Group([...g,...v],{objectCaching:!1,...s});x.value.add(k),x.value.sendToBack(k)}}(),function(){var e;const o=Object.values(U),n=[],i={},r=_.find((e=>"cervix"===e.key&&e.show)),l=null==(e=null==r?void 0:r.data)?void 0:e.find((e=>3==+e.value));function s(e,t){const{key:o,range:n}=r||{},i=G(o,n,10),l=[0,t],s=[-t/e,0],a=[(W-i-t)/e,W-i],u=[B-I,e*(B-I)+t];let c=[],d=[];function f([o,n]){return Math.abs(n-e*o-t)<=1}function p([e,t]){const[o,n]=[...h([e,t])];return o>=I&&o<=B&&n>=i&&n<=W}function h([e,t]){return[I+e,W-t]}return f(l)&&p(l)&&(c=h(l)),f(s)&&p(s)&&(c=h(s)),f(a)&&p(a)&&(d=h(a)),f(u)&&p(u)&&(d=h(u)),[...c,...d]}o.forEach((e=>{if(!e.show)return;const{key:o}=e;switch(o){case"fetalPresentation":{const{range:i,show:r}=_.find((e=>e.key===o));if(r){const r=G(o,i,0);n.push(t([I,r,B,r],{...e}))}break}case"alert":if(l){const{key:o,range:a}=r||{},u=216e5,c={time:w(new Date(m(l.time)+u),"yyyy-MM-dd HH:mm"),value:10},[d,f]=[S(l.time)-I,W-G(o,a,l.value)],[p,h]=[S(c.time)-I,W-G(o,a,c.value)],g=(h-f)/(p-d),v=f-d*g,y=s(g,v);y.length>0&&(n.push(t(y,{...e})),Object.assign(i,{k:g,b:v}))}break;case"handling":if(l){const{k:o,b:r}=i,a=144e5,u=s(o,r-(S(w(new Date(m(l.time)+a),"yyyy-MM-dd HH:mm"))-S(l.time))*o);u.length>0&&n.push(t(u,{...e}))}}})),x.value.add(...n)}(),te(),function(){function e(e,t){const o=_.findIndex((t=>t.key===e.key));return{renderItem:()=>e.title,origin:{title:e.title,unit:e.unit,dataIndex:o,key:e.key},pointer:t}}b.event.evented&&x.value.on("mouse:up",(t=>{if(3===t.button){const{x:o=0,y:n=0}=t.pointer||{};o>=I&&o<=B&&n>=H&&n<=W&&(P.point={x:o,y:n},P.show=!0,t.target?(P.target=t.target,P.list=["删除节点"],x.value.forEachObject((e=>{e.origin&&e.left===t.target.left&&e.top===t.target.top&&P.list.push({renderItem:()=>e.origin.title,origin:{...e.origin},mode:"remove",pointer:t.pointer})}))):(P.target=null,P.list=["新增节点"],_.filter((e=>e.show)).forEach((i=>{if(!Y(o,"key",O).includes(i.key)){if(["cervix","fetalPresentation"].includes(i.key)&&n<Q)return;P.list.push(e(i,t.pointer))}})),1===P.list.length&&(P.show=!1,E("repeat"),console.log("当前时间段内无可新增节点"))))}}))}(),function(){const e=q-J/2;function t(e,t){if(!e.length)return;let n=H;const i=[];e.forEach((e=>{const o=e.title.split("").join("\n"),r=F.findIndex((t=>t.key===e.key)),{text:s,icon:a}=l(o,e,{text:{originY:"top",left:t,top:n},icon:{left:t,topY:n,originY:"top",origin:{type:e.type,dataIndex:r},...b.event}},"vertical");var u;n+=s.height+a.height+15,(u=a).on("moving",(()=>{u.set("originY","center"),L(u)?(ie(u),re(u)):C.show=!1})),u.on("mouseup:before",(e=>{if(C.show=!1,0===e.e.button&&L(u))if(Y(u.left,"key",O).includes(u.origin.key))E("repeat");else{const e={data:{time:M(u.left),value:T(u.origin.key,u.top)},...u.origin};j("add",e),oe(e)}!function(e){e.setCoords().set({originY:"top",left:e.originLeft,top:e.originTop})}(u)})),i.push(s,a)})),o(i),x.value.add(...i)}function o(e){const t=e.at(-1),o=(W-H)/2,n=(t.height+t.top-H)/2;e.forEach((e=>{const t=e.top+o-n;e.set({top:t,originTop:t})}))}t(N,D/2),t(R,e)}(),{clickMenu:function({item:e,target:t}){const o={...e.origin};"remove"===e.mode?(j("remove",o),oe(o,"remove")):(Object.assign(o,{data:{time:M(e.pointer.x),value:T(e.origin.key,e.pointer.y)}}),j("add",o),oe(o))},redrawPoints:ne}}export{x as useBirthProcess};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{ref as e,computed as a,reactive as t,onMounted as l,nextTick as r}from"vue";import{defaultBorderStyle as u}from"../useDraw.js";import"../../../../../shared/utils/fabricjs/index.js";import"date-fns";import{getTime as i}from"../../utils/index.js";import{useEvent as s,useCanvasEvent as d}from"../useEvent.js";import"../temperature/useShadow.js";import"lodash-es";import{useBirthProcess as n}from"./useBirthProcess.js";function o(o,v,c,h,m,f){const
|
|
1
|
+
import{ref as e,computed as a,reactive as t,onMounted as l,nextTick as r}from"vue";import{defaultBorderStyle as u}from"../useDraw.js";import"../../../../../shared/utils/fabricjs/index.js";import"date-fns";import{getTime as i}from"../../utils/index.js";import{useEvent as s,useCanvasEvent as d}from"../useEvent.js";import"../temperature/useShadow.js";import"lodash-es";import"../../../../../shared/utils/index.js";import{useBirthProcess as n}from"./useBirthProcess.js";function o(o,v,c,h,m,f){const p=e(),x=e(),g=e(),w=a((()=>v.data.scaleValues.filter((e=>"left"===e.layout&&e.show)))),y=a((()=>v.data.scaleValues.filter((e=>"right"===e.layout&&e.show)))),V=a((()=>{var e;return(null==(e=y.value)?void 0:e.length)?30:0})),j=a((()=>{var e;return 30+(null==(e=w.value)?void 0:e.reduce(((e,a)=>e+=a.width),0))})),b=a((()=>{var e;const{width:a}=v.data,t=null==(e=y.value)?void 0:e.reduce(((e,a)=>e+=a.width),0);return a-V.value-t})),A=a((()=>v.data.grid.mainXCell)),C=a((()=>{const e=v.data.grid.mainYCell||14;return v.data.scaleValues.find((e=>e.show&&"FHR"===e.key))||14!==e?e:10})),k=a((()=>(b.value-j.value)/A.value)),Y=a((()=>{const{xAxis:e,height:a}=v.data,t=Object.values(e).reduce(((e,a)=>(a.show&&e++,e)),0);return a/(C.value+t)})),S=a((()=>{const{xAxis:e}=v.data,a=Object.values(e).reduce(((e,a)=>(a.show&&"top"===a.position&&e++,e)),0);return Y.value*a})),H=a((()=>{var e;const{scaleValues:a}=v.data;if(!(null==(e=a.find((e=>"FHR"===e.key)))?void 0:e.show)&&!S.value)return S.value;const t=a.find((e=>"cervix"===e.key)),[,l]=(null==t?void 0:t.range)||[0,10],r=(null==t?void 0:t.spaceValue)||1;return P.value-l*r*Y.value})),P=a((()=>{const{xAxis:e,height:a}=v.data,t=Object.values(e).reduce(((e,a)=>(a.show&&"bottom"===a.position&&e++,e)),0);return a-Y.value*t})),X=a((()=>i(v.data.xAxis.time.startTime))),F=a((()=>36e5/k.value)),R=a((()=>{const{scaleValues:e}=v.data,a=e.find((e=>"cervix"===e.key));return Y.value/((null==a?void 0:a.spaceValue)||1)})),W=a((()=>{const{scaleValues:e}=v.data,a=e.find((e=>"FHR"===e.key));return Y.value/((null==a?void 0:a.spaceValue)||10)})),O=a((()=>{const{scaleValues:e}=v.data,a=e.find((e=>"fetalPresentation"===e.key));return Y.value/((null==a?void 0:a.spaceValue)||1)})),M=a((()=>{var e;return(null==(e=v.data.grid)?void 0:e.event)||{selectable:!0,evented:!0,hovered:!0}})),N=t({canvasWidth:v.data.width,canvasHeight:v.data.height,borderStyle:{...u,...v.data.borderStyle||{}},selectionStyle:v.data.selectionStyle||{},grid:v.data.grid,other:v.data.other,originX:j.value,endX:b.value,originY:S.value,endY:P.value,xCellWidth:k.value,yCellHeight:Y.value,gridXNumber:A.value,gridYNumber:C.value,xAxis:v.data.xAxis,leftScales:w.value,rightScales:y.value,leftAddAreaWidth:30,rightAddAreaWidth:V.value,startTime:X.value,timeXCell:F.value,cervixYCell:R.value,FHRYCell:W.value,fetalPresentationYCell:O.value,scaleValues:v.data.scaleValues,event:M.value,originYCervix:H.value});return l((()=>{r((()=>{const{clickMenu:e,redrawPoints:a}=n(o,N,c,m,f);x.value=a,g.value=e,s(h.value);const{select:t}=d(o,N,c);p.value=t}))})),{propItems:N,redrawPoints:x,select:p,clickMenu:g}}export{o as useBirthProcessChart};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{drawLine as e,drawPoint as t}from"../useDraw.js";import{useGrid as n}from"../useGrid.js";import{useBirthProcessCumputedPoint as
|
|
1
|
+
import{drawLine as e,drawPoint as t}from"../useDraw.js";import{useGrid as n}from"../useGrid.js";import{useBirthProcessCumputedPoint as i}from"../useCumputedPoint.js";import"@vueuse/core";import"../../../../../shared/utils/fabricjs/index.js";import"vue";import{getIndex as o,isEffectiveNode as l,getTime as r}from"../../utils/index.js";import{cloneDeep as s}from"lodash-es";import"date-fns";import"../temperature/useShadow.js";import{uuidGenerator as a}from"../../../../../shared/utils/index.js";function f(f,u,c,p,d){const{cumputedX:v,cumputedY:m,getXValue:g,getYValue:h}=i(u),{xCellWidth:y,yCellHeight:L,originX:x,endX:k,originY:A,endY:P,event:b,scaleValues:j,xAxis:w,startTime:C,timeXCell:X}=u,M=new Map,Y=new Set,V=s(j);let $=[];function E(){V.forEach((e=>{e.dataList.forEach(((t,n)=>{I(t,n,e)}))}))}function I(n,i,o){var l;const{type:r,unit:s,dataList:d=[]}=o,v=[],m=a();M.set(m,[]),null==(l=n.list)||l.forEach(((l,a)=>{!function(n,l,a,d){var L;let j,w;const{pointAttr:C={},lineAttr:V={},title:E="",key:I,type:T="circle"}=d,J=D(d.list[a+1],o);n&&J&&!l.breakpoint&&n[0]!==J[0]&&(w=e([...n,...J],V));const N=v[a-1],G={origin:{data:l,title:E,key:I||"",unit:s,type:r,dataIndex:i,index:a,lineAttr:V},uuid:m,leftLine:N,rightLine:w,...C,...u.event.hovered?u.event.evented?{selectable:!0}:{selectable:!0,lockMovementX:!0,lockMovementY:!0}:u.event};N?j=t(T,{left:N.get("x2"),top:N.get("y2"),...G}):n&&(G.leftLine=null,j=t(T,{left:n[0],top:n[1],...G}));v.push(w),j&&(j.originLeft=j.left,j.originTop=j.top,function(e){b.hovered&&(e.on("mouseover",(()=>{z(e,"hover")})),e.on("mouseout",(()=>{p.show=!1})));if(e.lockMovementX&&e.lockMovementY)return;e.on("moving",(()=>{!function(e){e.setCoords();const t=6e4/X,n=e.prevPoint?e.prevPoint.left+t:x,i=e.nextPoint?e.nextPoint.left-t:k;e.top<A&&e.set("top",A),e.top>P&&e.set("top",P),e.left<n&&e.set("left",n),e.left>i&&e.set("left",i)}(e),function(e){var t,n;null==(t=e.leftLine)||t.setCoords().set({x2:e.left,y2:e.top}),null==(n=e.rightLine)||n.setCoords().set({x1:e.left,y1:e.top})}(e),b.hovered&&z(e),function(e){const{originLeft:t,originTop:n,left:i,top:o,origin:l}=e,r=~~((i-t)/y);if(i>t+y&&!e.nextPoint){if(0===$.length){O(e,[...e.leftLine?[e.leftLine.x1,e.leftLine.y1]:[t,n],t,n]),e.leftLine&&e.leftLine.set({stroke:"transparent"})}const i=t+y*r;if($.every((e=>e.left!==i))){const t=g(i),n=h(l.type,o);$.push({data:{time:t,value:n},left:i,top:o}),O(e,[...e.prevPointer,i,o])}$.length<r&&function(e,t){const{originLeft:n,originTop:i,origin:o}=e;let l=1;for(;l<=t;){const t=n+y*l,r=$.some((e=>Math.abs(e.left-t)<=1));if(!r){let l=0;const r=$.find(((e,n)=>(e.left>t&&(l=n),e.left>t)));if(r){const s=JSON.parse(JSON.stringify(r)),a=$[l-1]||{left:n,top:i},f=~~((r.left-(t-y))/y),u=(r.top-a.top)/f;s.top=a.top+u,s.left=t,s.data={time:g(t),value:h(o.type,s.top)},$.splice(l,0,s),O(e,[a.left,a.top,s.left,s.top])}}l++}}(e,r)}if($.length>0&&i<$[$.length-1].left){for(const e of Y)e.left>i&&(e.leftLine&&f.value.remove(e.leftLine),f.value.remove(e));if($=$.filter((e=>e.left<=i)),0===$.length){e.leftLine&&e.leftLine.set(e.origin.lineAttr);for(const e of Y)e.leftLine&&f.value.remove(e.leftLine),f.value.remove(e)}if($.length>0){const t=$.at(-1);e.prevPointer=[t.left,t.top]}}}(e)})),e.on("mouseup",(t=>{if(p.show=!1,1===t.button){const{key:t,type:n}=e.origin,i={...e.origin,data:{...e.origin.data,time:g(e.left),value:h(n,e.top)}};f.value.discardActiveObject();const o=Object.assign({},i,{uuid:e.uuid});if($.length>0){const e=$.map((e=>e.data));c("add",{...i,data:e}),S({...o,data:e},"add")}else c("change",i),S(o,"change")}}))}(j),null==(L=M.get(m))||L.push(j))}(D(l,o),l,a,n)})),Promise.all(M.get(m)).then((e=>{const t=v.filter((e=>e));let n=null;e=e.map((e=>(e&&n&&(n.nextPoint=e,e.prevPoint=n),n=e||n,e))),f.value.add(...t,...e)}))}function O(t,n){const[i,o,l,r]=n;t.clone((i=>{i.set({left:l,top:r}),t.prevPointer=[l,r];const o=e(n,t.origin.lineAttr);i.leftLine=o,Y.add(i),f.value.add(o,i)}))}function S(e,t="add"){const{dataIndex:n,data:i,index:l,key:r,type:s,uuid:a}=e,u=V.find((e=>e.type===s)),c=u.dataList.find((e=>e.key===r));switch(t){case"remove":c.list.splice(l,1);break;case"change":c.list[l]=i;break;default:{const e=Array.isArray(i)?i[0].time:i.time,t=o(e,c.list),n=Array.isArray(i)?i:[i];c.list.splice(t,0,...n);break}}!function(e){var t,n,i;if(Y.size&&(null==(t=f.value)||t.remove(...T([...Y]))),Y.clear(),$=[],e){const{uuid:t,item:i,dataIndex:o,scaleValue:l}=e;null==(n=f.value)||n.remove(...T(M.get(t))),M.delete(t),I(i,o,l)}else{const e=Array.from(M.values()).flat();M.size&&(null==(i=f.value)||i.remove(...T(e))),M.clear(),E()}}({item:c,dataIndex:n,scaleValue:u,uuid:a})}function T(e){const t=[];return e.forEach((e=>{e&&t.push(e),(null==e?void 0:e.leftLine)&&t.push(null==e?void 0:e.leftLine),(null==e?void 0:e.rightLine)&&t.push(null==e?void 0:e.rightLine)})),t}function z(e,t="moving"){const{title:n,type:i,data:o,unit:l}=e.origin;p.point={x:e.left,y:e.top};const r=`${"hover"===t?o.value:h(i,e.top)}`;p.list=[`${n} ${r}${l||""}`,`时间 ${g(e.left).slice(-5)}`],p.show=!0}function D(e,t){if(l(e)&&function(e){const t=Date.parse(w.list.at(-1)),n=r(e);return n>=C&&n<=t}(e.time)){const n=v(e.time),i=m(t.type,t.range,e.value);return[n,i<A?A:i>P?P:i]}}n(f,u),E()}export{f as useCenter};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{fabric as t}from"../../../../../shared/utils/fabricjs/index.js";import{drawTextGroup as e,defaultRectStyle as i,drawTextAndIconGroup as o,drawText as l,defaultTextStyle as n,defaultStyle as r}from"../useDraw.js";import"date-fns";import{getScaleNumberList as
|
|
1
|
+
import{fabric as t}from"../../../../../shared/utils/fabricjs/index.js";import{drawTextGroup as e,defaultRectStyle as i,drawTextAndIconGroup as o,drawText as l,defaultTextStyle as n,defaultStyle as r}from"../useDraw.js";import"date-fns";import{getScaleNumberList as s}from"../../utils/index.js";import"@vueuse/core";import{drawScaleNumber as a}from"../useScaleColumn.js";import"vue";import"lodash-es";import"../temperature/useShadow.js";import"../../../../../shared/utils/index.js";function d(d,u,h){const{originY:c,endY:p,borderStyle:f,left:m,itemList:g,scaleValues:v,originX:w,endX:j,yCellHeight:y,markHeight:S,canvasWidth:x,canvasHeight:W}=u;!function(){if(!m)return;const{title:t,titleWidth:i,titleStyle:o}=m,l=e({width:i,height:p-c+S,...f},{value:t.split("").join("\n"),...o||{}},{left:0,top:c},!0);d.value.add(l)}(),v.forEach(((e,i)=>{var o,u;const h="left"===e.layout?w-5:j+5,{range:c,spaceValue:f,title:g,unit:v,titleStyle:S,spaceGridNumber:W=1,showNumber:b,showMaxMinNumber:N}=e,k=[],X=s(c,f),Y=X.length;X.forEach(((t,i)=>{const o=0===i?p-5:p-i*y*W;!b||(0===i||i===Y-1)&&!N||k.push(a(String(t),{...e,position:e.layout},h,o))}));const C=g&&l(["left"===e.layout?m.width/2:j+(x-j)/2,(null!=(u=null==(o=k.at(-1))?void 0:o.top)?u:330)-y],{value:`${g}${v?"\n"+v:""}`,...n,...S}),E=new t.Group([...k,...C?[C]:[]],{objectCaching:!1,...r});d.value.add(E),E.sendToBack()})),function(){const e=new t.Rect({width:w-m.titleWidth,height:p-c+S,left:m.titleWidth,top:c,...i,originX:"left",originY:"top",...f});d.value.add(e);const l=JSON.parse(JSON.stringify(g));let n=p;const r=m.titleWidth+15;l.reverse().forEach((t=>{n-=10;const e=t.title,{text:i,icon:l}=o(e,t,{text:{left:r,top:n},icon:{leftX:r,topY:n}});n-=i.height||30,d.value.add(i,l)}))}(),d.value.add(new t.Rect({left:0,top:0,width:x-f.strokeWidth,height:W-f.strokeWidth,fill:"transparent",...f}))}export{d as useLeft};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{fabric as t}from"../../../../../shared/utils/fabricjs/index.js";import{drawPoint as
|
|
1
|
+
import{fabric as t}from"../../../../../shared/utils/fabricjs/index.js";import{drawPoint as e,drawText as o}from"../useDraw.js";import{useBirthProcessCumputedPoint as r}from"../useCumputedPoint.js";import"@vueuse/core";import"vue";import"lodash-es";import"date-fns";import"../temperature/useShadow.js";import"../../../../../shared/utils/index.js";function i(i,n,l){const{cumputedX:a}=r(n),{other:u,yCellHeight:s,endX:c,originX:d,originY:f}=n;function m(t){return t>=d&&t<=c}!function(){if(!(null==u?void 0:u.horizontal))return;const{horizontal:r}=u,n=d-5;let l=f+s/2;r.forEach((r=>{const{title:u,titleStyle:c={},type:d,pointAttr:f={},textStyle:p={},data:h}=r,v=u&&e(u,{...c,originX:"right",left:n,top:l});i.value.add(v),h.forEach((r=>{const{time:n,value:u}=r,s=a(n);if(!m(s))return;const c=e(d,{...f,left:s,top:l}),h=s+c.width/2+2,v=o([h,l],{value:u,...p,originX:"left"}),g=new t.Group([c,v],{lockMovementX:!0,lockMovementY:!0,objectCaching:!1,hasControls:!1,hasBorders:!1,hoverCursor:"pointer"});i.value.add(g)})),l+=s}))}(),function(){if(!(null==u?void 0:u.vertical))return;const{vertical:t}=u;t.forEach((t=>{const{textStyle:o={},data:r,time:n}=t,l=a(n);if(!m(l))return;let u=f+s/2;r.forEach((t=>{const r=e(String(t),{...o,lockMovementX:!0,lockMovementY:!0,left:l,originX:"left",top:u});u+=s,i.value.add(r)}))}))}()}export{i as useOther};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{fabric as t}from"../../../../../shared/utils/fabricjs/index.js";import{drawText as e,defaultStyle as i,defaultRectStyle as n,drawTextGroup as o,drawLine as l,drawPoint as r}from"../useDraw.js";import{useGrid as s}from"../useGrid.js";import{useBirthProcessCumputedPoint as f}from"../useCumputedPoint.js";import"@vueuse/core";import"vue";import{cloneDeep as c}from"lodash-es";import"date-fns";import"../temperature/useShadow.js";function a(a,u,
|
|
1
|
+
import{fabric as t}from"../../../../../shared/utils/fabricjs/index.js";import{drawText as e,defaultStyle as i,defaultRectStyle as n,drawTextGroup as o,drawLine as l,drawPoint as r}from"../useDraw.js";import{useGrid as s}from"../useGrid.js";import{useBirthProcessCumputedPoint as f}from"../useCumputedPoint.js";import"@vueuse/core";import"vue";import{cloneDeep as c}from"lodash-es";import"date-fns";import"../temperature/useShadow.js";import"../../../../../shared/utils/index.js";function a(a,d,u,m,h){const{cumputedX:p,getXValue:x}=f(d),{originX:L,endX:g,xCellWidth:v,originYXAxis:X,top:C,topList:w,canvasWidth:y,borderStyle:Y,treeData:S,xAxis:j,topGridYNumber:b,topGridOriginY:k,topGridYCellHeight:G,topGridEndY:I,event:z}=d,A=new Set;function M(t,e,i){let n;const{content:o}=t.value||{};if(o){const{lineStyle:l,textStyle:s,totalStyle:f}=C.data||{},{startLine:c,centerLine:a,endLine:d}=e;n=r(o,{fontSize:12,...s,backgroundColor:"#fff",lockMovementX:!0,lockMovementY:!0});const u=$(n,e,i);n&&(n.set(u),n.origin={data:t},D(n),c&&(c.text=n),d&&(d.text=n))}return n}function $(t,e,i){const n=t.width+1,{startLine:o,centerLine:l,endLine:r}=e,s={top:i,originX:"center",originY:"center"};return l&&n<=l.width?s.left=l.x1+l.width/2:r&&n<=r.limitX.x2-r.left?(s.originX="left",s.left=r.left+1):o&&!r&&n<=o.limitX.x2-o.left?(s.originX="left",s.left=o.left+(o.isCustomIcon?5:1)):o&&n<=o.left-o.limitX.x1?(s.originX="right",s.left=o.left-(o.isCustomIcon?5:1)):l?(s.originY="top",s.left=l.x1+l.width/2,s.top=i+1,s.fontSize=10):o&&(s.originX="left",s.originY="top",s.fontSize=10,s.left=o.left,s.top=i+1),s}function E(e,{isCustomIcon:i,isContinue:n,isLeft:o}){const{x:s,y1:f,y2:c,halfY:a}=e;if(!s||s<L||s>g)return;const{lineStyle:d}=C.data||{};let u;const m={left:s,top:a};u=i?r("circle",{fill:d.stroke,...m}):n?r(">",{fill:d.stroke,...m,fontSize:18}):l([s,f,s,a],d);const h=new t.Rect({width:v,height:G,fill:"transparent",left:s-v/2,top:f}),p=new t.Group([u,h],{originX:"center",originY:"center",hasControls:!1,hasBorders:!1,objectCaching:!1,hoverCursor:"pointer",lockMovementY:!0});return p.isLeft=o,p.isCustomIcon=i,D(p),p}function D(t){z.hovered&&(t.on("mouseover",(()=>{H(t,"hover")})),t.on("mouseout",(()=>{m.show=!1}))),t.lockMovementX&&t.lockMovementY||(t.on("moving",(()=>{!function(t){t.setCoords(),t.left<t.limitX.x1&&t.set("left",t.limitX.x1);t.left>t.limitX.x2&&t.set("left",t.limitX.x2)}(t),function(t){if(t.centerLine){const e=t.isLeft?{x1:t.left}:{x2:t.left};t.centerLine.setCoords().set(e)}if(t.text){const e=$(t.text,{startLine:t.isLeft?t:t.nearLine,centerLine:t.centerLine,endLine:t.isLeft?t.nearLine:t},t.top);t.text.setCoords().set(e)}}(t),z.hovered&&H(t)})),t.on("mouseup",(e=>{if(1===e.button){!function(t){t.isLeft?(t.prevLine&&(t.prevLine.limitX.x2=t.left),t.nearLine&&(t.nearLine.limitX.x1=t.left)):(t.nextLine&&(t.nextLine.limitX.x1=t.left),t.nearLine&&(t.nearLine.limitX.x2=t.left))}(t);const e={type:"tree",...t.origin};u("change",e)}})))}function H(t,e="moving"){var i,n,o;const{data:l}=t.origin;m.point={x:t.left,y:t.top};let[r="",s=""]=l.time||[];if("moving"===e){const e=x(t.left);t.isLeft?r=e:s=e,l.time=[r,s],t.text&&(t.text.origin.data.time=[r,s])}m.list=[`开始时间 ${r}`,`结束时间 ${s}`,`流速 ${(null==(i=l.value)?void 0:i.currentSpeed)||""}`,`浓度 ${(null==(n=l.value)?void 0:n.consistence)||""}`,`总量 ${(null==(o=l.value)?void 0:o.total)||""}`],m.show=!0}s(a,{...d,gridYNumber:b,originY:k,yCellHeight:G,endY:I}),function(){const{height:o,list:l,left:r,spaceValue:s}=j;if(!o)return;const f=[],c=X+o/2;l.forEach(((t,i)=>{const n=r+i*v*s;f.push(e([n,c],{value:t.slice(11,16)}))}));const d=f.length>0?new t.Group([...f],{...i,objectCaching:!1}):null;d&&a.value.add(d);const u=new t.Rect({width:y,height:o,left:0,top:X,...n,originX:"left",originY:"top",...Y});a.value.add(u)}(),function(){var e;const n=(null==(e=null==C?void 0:C.tree)?void 0:e.textStyle)||{},r=[];!function t(e){e.forEach((e=>{var i;const{width:s,height:f,left:a,top:d,title:u=""}=e,m={value:u,...n};(null==(i=e.children)?void 0:i.length)?(m.value=u.split("").join("\n"),t(e.children)):(m.textAlign="left",function(t){if(!(null==t?void 0:t.data)||!Array.isArray(t.data))return;const{lineStyle:e,textStyle:i,totalStyle:n}=C.data||{},o=t.top,r=o+G,s=r-G/2,f={y1:o,y2:r,halfY:s},a=[],d=c(t);delete d.data,t.data.forEach(((t,i,n)=>{const{time:o,continue:r}=t,[c,u]=o,m=c&&p(c),h=u&&p(u),x=E({...f,x:m},{isCustomIcon:!h&&!r,isContinue:!1,isLeft:!0}),v=E({...f,x:h},{isCustomIcon:!1,isContinue:!!r});let X,C,w;if((x||m<L)&&(v||h>g)){X=l([x?m:L,s,v?h:g,s],e)}a.push({startLine:x,centerLine:X,endLine:v}),function(t,e,i){const{startLine:n,centerLine:o,endLine:l}=e[t],{startLine:r,endLine:s}=e[t-1]||{};if(n){n.origin=i;const t={x1:L,x2:l?l.left:g};s?(t.x1=s.left,s.limitX.x2=n.left,n.prevLine=s,s.nextLine=n):r&&(t.x1=r.left,r.limitX.x2=n.left,n.prevLine=r,r.nextLine=n),n.limitX=t,o&&(n.centerLine=o)}if(l){l.origin=i;const t={x1:n?n.left:L,x2:g};l.limitX=t,o&&(l.centerLine=o)}n&&l&&(n.nearLine=l,l.nearLine=n)}(i,a,Object.assign({},d,{data:t,index:i})),n[i-1]&&(C=M(n[i-1],a[i-1],s)),i===n.length-1&&(w=M(t,a[i],s)),X&&A.add(X),x&&A.add(x),v&&A.add(v),C&&A.add(C),w&&A.add(w)}))}(e)),r.push(o({width:s,height:f,...Y},m,{left:a,top:d},!0))}))}(S);const s=r.length>0?new t.Group([...r],{...i,objectCaching:!1}):null;s&&a.value.add(s),A.size&&a.value.add(...A)}()}export{a as useTop};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{fabric as t}from"../../../../../shared/utils/fabricjs/index.js";import{drawTextGroup as e,defaultTextStyle as i,defaultStyle as n}from"../useDraw.js";import"date-fns";import"lodash-es";import"@vueuse/core";import"vue";import"./useShadow.js";function o(o,s){const{xScaleList:r,originX:a,endX:l,endY:
|
|
1
|
+
import{fabric as t}from"../../../../../shared/utils/fabricjs/index.js";import{drawTextGroup as e,defaultTextStyle as i,defaultStyle as n}from"../useDraw.js";import"date-fns";import"lodash-es";import"@vueuse/core";import"vue";import"./useShadow.js";import"../../../../../shared/utils/index.js";function o(o,s){const{xScaleList:r,originX:a,endX:l,endY:d,xCellWidth:h,canvasWidth:c,canvasHeight:u,bottom:p,breathingHeight:g,iconsWidth:m,borderStyle:f}=s;!function(){var s,c,u;if(!g||!p){const e=new t.Line([m,d-1,l,d-1],f);return o.value.add(e),e.sendToBack(),!1}const v=g,b=(null==(s=p.breathing)?void 0:s.list)||[],w=[];let x=!0;r.forEach(((t,n)=>{const o=a+n*h;let s="";b.forEach(((e,i)=>{const n=new Date(e.time).getTime();n>=t&&n<+t+t.scaleCell&&(s=e.value)}));const r=x?{top:-(v/2-10)}:{top:v/2-10};s&&(x=!x);const l=e({width:h,height:v,...f},Object.assign({},{text:String(s),...i},s?r:{}),{left:o,top:d});w.push(l)}));const j=e({width:l,height:v,...f},{text:String((null==(c=p.breathing)?void 0:c.title)+(null==(u=p.breathing)?void 0:u.unit)),...i,left:-(l-a)/2},{left:0,top:d});w.push(j);const S=w.length>0?new t.Group([...w],{...n}):null;S&&S.sendToBack(),S&&o.value.add(S)}()}export{o as useBottom};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{fabric as e}from"../../../../../shared/utils/fabricjs/index.js";import{useShadow as t}from"./useShadow.js";import{drawLine as i,defaultStyle as n,drawPoint as o,drawText as l,drawArrow as s}from"../useDraw.js";import{useGrid as r}from"../useGrid.js";import"date-fns";import{isOneLine as a,getType as u,isOverlapPoint as d,isValidValue as c,setOtherType as p,isEffectiveNode as f,getTime as h,getIndex as v,deleteProperty as g}from"../../utils/index.js";import"@vueuse/core";import{useCommon as y}from"../useCommon.js";import"vue";import{cloneDeep as m}from"lodash-es";import{TEMPERATURE_MENU as x,PAIN_MENU as b,OVERLAP as w}from"../../constants/index.js";function j(j,k,Y,S,E,$,M,O,P,A){r(j,k);const{getEqualXTypes:I,handleAddPrevent:T}=y(j,Y,k),{createShadowLines:C}=t(),{left:R,xScaleList:X,xCellWidth:F,yCellHeight:z,originX:D,endX:V,originY:_,endY:G,itemList:H,event:q,vitalSignsOriginY:W,painOriginY:B,hospitalizationDate:J,config:K,canvasHeight:N}=k,Q=new Set,U=["xinmai","mai"],Z=new Map,ee=new Set,te=new Set,ie=new Set,ne=m(R.yScaleValue);function oe(t){var i;const o=ne.find((e=>"pulse"===e.type));if(o&&(null==(i=o.dataList)?void 0:i.length)&&(Q.size&&j.value.remove(...Q),Q.clear(),Z.size>1)){if(t){const{type:e,key:i}=t.origin||{};if("pulse"===e){const e=Z.get(i),n=null==e?void 0:e.findIndex((e=>e[0]===t.left));e.splice(n,1,[t.left,t.top])}}(function(){const e=[],t=[],i=[];for(const e of Z)t.push(e[1]),e[0]===U[0]&&e[1].forEach((e=>{(Z.get(U[1])||[]).findIndex((t=>t[0]===e[0]))>-1&&i.push(e[0])}));const[n,o]=t;let l=[],s=[];return i.forEach((t=>{const i=n.findIndex((e=>e[0]===t)),r=o.findIndex((e=>e[0]===t)),a=n[i],u=o[r],d=n[i-1],c=n[i+1],p=o[r-1],f=o[r+1];if(d&&p){if(d[0]!==p[0]){const e=Math.max(d[0],p[0]);l.push([d,p].find((t=>t[0]===e)))}}else d?l.push(d):p&&s.push(p);const h=Math.min(a[1],u[1]);l.push([a,u].find((e=>e[1]===h)));const v=Math.max(a[1],u[1]);s.push([a,u].find((e=>e[1]===v)));const g=()=>{const t=[...l,...s.reverse()],[i]=t,n=t.at(-1);i[0]===n[0]&&i[1]===n[1]&&t.splice(-1,1),e.push(t),l=[],s=[]};if(c&&f){if(c[0]!==f[0]){const e=Math.min(c[0],f[0]);l.push([c,f].find((t=>t[0]===e))),g()}}else c?(l.push(c),g()):f?(s.push(f),g()):g()})),e})().forEach((t=>{var i,l,s,r,a,u;const d=t.map((e=>({x:e[0],y:e[1]}))),c=new e.Polygon(d,{...n,...(null==(i=o.shadow)?void 0:i.style)||{}});if("slash"==(null==(l=o.shadow)?void 0:l.mode)){c.set({fill:"transparent",stroke:(null==(r=null==(s=o.shadow)?void 0:s.style)?void 0:r.stroke)||"#f00"});const e=C(t,null==(a=o.shadow)?void 0:a.style._angle,null==(u=o.shadow)?void 0:u.style.space);e.forEach((e=>{var t;Object.assign(e,{...n,...(null==(t=o.shadow)?void 0:t.style)||{}}),Q.add(e)})),j.value.add(...e)}Q.add(c),j.value.add(c)}))}}function le(){var e;const t=ne.find((e=>"pulse"===e.type));if(!t||!(null==(e=t.dataList)?void 0:e.length))return;if(!t.dataList.some((e=>e.title.includes("脉搏"))))return;const i=Object.assign({},w,R.overlap||{}),l=[];ee.size&&[...ee].forEach((e=>{[...te].forEach((t=>{if(t.origin&&d(e,t)){const e=t.origin.key;if(e){const s={left:t.left,top:t.top,...n,hoverCursor:"default"};let r="koumai";"yemai"===e&&(r=e),"humai"===e&&(r="circle"),l.push(o(r,{...i[e]||{},...s}))}}}))})),setTimeout((()=>{j.value.add(...l),l.forEach((e=>{null==e||e.bringToFront(),ie.add(e)}))}))}function se(e,t,r){var u;const{type:d,riseStyle:f={},noRiseStyle:h={},verifiedStyle:v={},reduceStyle:g={},pacemaker:y={},upArrowStyle:m={},limitValueStyle:x={},nonePainPointStyle:b={},dataList:w=[]}=r,S=[],$=[],O=[];null==(u=e.list)||u.forEach(((u,A)=>{const I=a(d)?w.find((e=>e.key===u.key)):e,T=ue(u,r),C={};C.value=function(e,t,i){if(!(null==e?void 0:e.length)||!K.showValue)return;const{lineAttr:n={}}=i,o=e[1]<=W.originY+z?e[1]+z:e[1]-z,s=l([e[0],o],{value:t.value,originX:"center",originY:"center",fill:n.stroke||"#000"});return O.push(s),{obj:s,top:-z}}(T,u,I),function(e,t,r,a,u){var p,y;if(!(null==e?void 0:e.length)||!["temperature","pain"].includes(d))return;const{lineAttr:m={}}=r,{value:x}=a;let b,w,j,k,Y,S;if(t.noRise&&h.show){const t=L(h)?E(u.type,u.list,35):e[1];if(h.text)j=l([e[0],L(h)?t:t+5],{value:h.text.split("").join("\n"),originY:"top",...h.style||{}}),O.push(j);else{const i=t+2*z;k=s([e[0],t,i],h.style||{}),O.push(k)}}t.rise&&f.show&&f.text&&(Y=l([e[0],e[1]-(x?z:0)-5],{value:f.text.split("").join("\n"),originY:"bottom",...f.style||{}}),O.push(Y));t.verified&&(S=l([e[0],e[1]-(x?z:0)-5],{value:"v",originX:"center",originY:"bottom",...v}),O.push(S));if(c(t.physicsReduce)||c(t.drugReduce)){const l=E(d,u.list,null!=(p=t.physicsReduce)?p:t.drugReduce);b=i([...e,e[0],l],{...m,...g.line,...n}),w=o((null==(y=null==g?void 0:g.point)?void 0:y.type)||"circle",{left:e[0],top:l,...g.point,...n,originY:l===N?"bottom":"center"}),b&&O.push(b),w&&O.push(w)}Object.assign(a,{reduceLine:{obj:b,type:"line"},noRiseText:{obj:j,top:5,isFixed:L(h)},arrowGroup:{obj:k,top:2*z,isFixed:L(h)},riseText:{obj:Y,top:(x?-z:0)-5},verifiedText:{obj:S,top:(x?-z:0)-5},reducePoint:{obj:w,type:"reduce"}})}(T,u,I,C,r),function(e,t,i,n){if(!(null==e?void 0:e.length)||!["pulse"].includes(d))return;let o,a;const{upArrowShow:u=!1,limitValueShow:c=!1}=i;if(u&&+t.value>180){let t=e[1]-2.5*z,i=[e[1]-z/2,t];t<W.originY&&(t=e[1]+2.5*z,i=[t,e[1]+z/2]),o=s([e[0],i[0],i[1]],m,"up"),O.push(o)}if(c){const i={value:t.value,originX:"center",originY:"center",...x};if(+t.value>Math.max(...r.list)){const t=o?e[1]+z/2+o.height:e[1]+z;a=l([e[0],t],i),O.push(a)}+t.value<Math.min(...r.list)&&(a=l([e[0],e[1]-z],i),O.push(a))}Object.assign(n,{upArrow:{obj:o},limitValue:{obj:a,top:-z}})}(T,u,I,C),function(n,l,s,a,u){let c,f;const{pointAttr:h={},lineAttr:v={},title:g="",key:m,type:x="circle"}=a,w=e.list[s+1],L=ue(w,r),E=re(d,e.list[s].value),O=L&&re(d,w.value);!n||!L||l.breakpoint||E||O||n[0]===L[0]||(f=i([...n,...L],{...v}));const A=l.pacemakerShow&&"pulse"==d?y.value:E?0:x,I=$[s-1],T={origin:{data:l,title:g,key:m||"",unit:r.unit,type:d,_type:p(g,d),dataIndex:t,index:s},leftLine:I,rightLine:f,otherObj:u,lockMovementX:!0,...l.pacemakerShow&&"pulse"==d?y.style:h,...k.event.hovered?k.event.evented?{selectable:!0}:{selectable:!0,lockMovementY:!0}:k.event,...E?{selectable:!1,evented:!1,...b}:{}};if(I){const e=I.get("y2");c=o(A,{left:I.get("x2"),top:E?e-5:e,...T})}else n&&(T.leftLine=null,c=o(A,{left:n[0],top:E?n[1]-5:n[1],...T}));$.push(f),c&&(g.includes("脉搏")?ee.add(c):te.add(c),function(e){q.hovered&&(e.on("mouseover",(()=>{ae(e,"hover")})),e.on("mouseout",(()=>{P.show=!1})));if(e.lockMovementX&&e.lockMovementY)return;e.on("moving",(()=>{!function(e){e.setCoords();const t="pain"===e.origin.type?B:W;e.top<t.originY&&e.set("top",t.originY);e.top>t.endY&&e.set("top",t.endY)}(e),function(e){var t,i;null==(t=e.leftLine)||t.setCoords().set({x2:e.left,y2:e.top}),null==(i=e.rightLine)||i.setCoords().set({x1:e.left,y1:e.top}),Object.values(e.otherObj).forEach((t=>{const{obj:i,type:n="",top:o=0,isFixed:l}=t||{};"reduce"!==n&&("line"===n?null==i||i.setCoords().set({x1:e.left,y1:e.top}):!l&&(null==i||i.setCoords().set({left:e.left,top:e.top+o})))})),oe(e)}(e),q.hovered&&ae(e)})),e.on("mouseup",(t=>{if(P.show=!1,1===t.button){const{type:t}=e.origin,i=M(t,e.top),n={...e.origin,data:{...e.origin.data,value:i}};j.value.discardActiveObject(),Y("change",n),ce(n,"change")}}))}(c),S.push(c),ie.add(c))}(T,u,A,I,C)})),"pulse"===d&&U.forEach((e=>{Z.set(e,S.filter((t=>{var i;return(null==(i=t.origin)?void 0:i.key)===e})).map((e=>[e.left,e.top])))})),Promise.all(S).then((e=>{const t=$.filter((e=>e));let i=null;e=e.map((e=>(e&&i&&(i.nextPoint=e,e.prevPoint=i),i=e||i,e))),Promise.all(O).then((i=>{j.value.add(...t,...e,...i),e.forEach((t=>{null==t||t.bringToFront(),function(e,t){if("pulse"===e.origin.type){t.filter((t=>t.left===e.left&&"pulse"===t.origin.type)).length>1&&(e.leftLine&&j.value.remove(e.leftLine),e.rightLine&&j.value.remove(e.rightLine))}}(t,e)}))}))}))}function re(e,t){return"pain"===e&&0==t}function ae(e,t="moving"){const{title:i,unit:n,type:o,data:l}=e.origin;P.point={x:e.left,y:e.top},P.list=[function(){const{drugReduce:s,physicsReduce:r}=l||{},a="hover"===t?l.value:M(o,e.top);if(c(s))return`药物降${"pain"==o?"痛":"温"} ${a}—>${s}${n||""}`;if(c(r))return`物理降${"pain"==o?"痛":"温"} ${a}—>${r}${n||""}`;return`${i} ${a}${n||""}`}(),`时间 ${((null==l?void 0:l.time)||$(e.left)).slice(-5)}`],P.show=!0}function ue(e,t){const i="pain"===t.type?B:W;if(f(e)&&function(e){const[t]=X,i=X.at(-1),n=t.start,o=i.end,l=h(e);return l>=n&&l<=o}(e.time)){const n=S(e.time),o=E(t.type,t.list,e.value);return[n,o<i.originY?i.originY:o>i.endY?i.endY:o]}}function de(e){const t=new Date,i=String(t.getMonth()+1).padStart(2,"0"),n=String(t.getDate()).padStart(2,"0"),o=h(`${t.getFullYear()}-${i}-${n} 23:59:59`),l=h(`${$(e)}:00`);return J&&l<h(J)?(T("exceedMin"),!1):!(l>o)||(T("exceedMax"),!1)}function ce(e,t="add"){const{type:i,dataIndex:n,index:o,data:l,key:s}=e,r=ne.find((e=>e.type===i));if("add"===t){const e=a(i)?r.dataList.find((e=>e.enable)):r.dataList[n],t=v(l.time,e.list);e.list.splice(t,0,l)}else r.dataList[n].list[o]=l;pe()}function pe(){var e;ie.size&&(null==(e=j.value)||e.remove(...function(e){const t=[];return e.forEach((e=>{e&&t.push(e),(null==e?void 0:e.leftLine)&&t.push(null==e?void 0:e.leftLine),(null==e?void 0:e.rightLine)&&t.push(null==e?void 0:e.rightLine),Object.values((null==e?void 0:e.otherObj)||{}).forEach((e=>{(null==e?void 0:e.obj)&&t.push(null==e?void 0:e.obj)}))})),t}([...ie]))),Z.clear(),ie.clear(),ee.clear(),te.clear(),ne.forEach((e=>{e.dataList.forEach(((t,i)=>{a(e.type)&&!t.enable||se(t,i,e)}))})),oe(),le()}return Z.clear(),ee.clear(),te.clear(),ne.forEach((e=>{!function(e){if("temperature"!==e.type||!e.positionLine)return;const t=E(e.type,e.list,e.positionLine.value),n=i([D,t,V,t],e.positionLine);j.value.add(n)}(e),e.dataList.forEach(((t,i)=>{a(e.type)&&!t.enable||se(t,i,e)}))})),oe(),le(),k.event.evented&&j.value.on("mouse:up",(e=>{var t;if(3===e.button){const{x:i=0,y:n=0}=e.pointer||{};if(i>=D&&i<=V&&n>=_&&n<=G){A.point={x:i,y:n},A.show=!0;const{type:o}=(null==(t=e.target)?void 0:t.origin)||{};if(e.target&&["temperature","pain"].includes(o))"temperature"===o&&(A.list=[...x]),"pain"===o&&(A.list=[...b]),A.target=e.target;else{A.target=null,A.list=["新增节点"],H.forEach((t=>{if(!I(i,"_type",F).includes(t.bigType)){const i=["pain"].includes(t.bigType)?B:W;n>=i.originY&&n<=i.endY&&A.list.push({renderItem:O?O(t):()=>t.title,origin:{title:t.title,unit:t.unit,type:u(t.bigType),dataIndex:t.dataIndex,key:t.key},pointer:e.pointer})}}));const t=de(i);t&&1!==A.list.length||(A.show=!1,1===A.list.length&&t&&T("repeat"))}}}})),{clickMenu:function({item:e,target:t}){if(t){const{data:i,type:n,dataIndex:o,index:l}=t.origin,s=g(i,[...x,...b]);s[`${e.type}`]=e.value,a(n)&&(s.key=t.origin.key);const r={...t.origin,data:s};Y("change",r),ce(r,"change")}else{const t={data:{time:$(e.pointer.x),value:M(e.origin.type,e.pointer.y),...a(e.origin.type)?{key:e.origin.key}:{}},...e.origin};Y("add",t),ce(t)}},setPopup:ae,isAddPoint:de,updateData:ce,redrawPoints:pe}}function L(e){return"fixed"===e.position}export{j as useCenter};
|
|
1
|
+
import{fabric as e}from"../../../../../shared/utils/fabricjs/index.js";import{useShadow as t}from"./useShadow.js";import{drawLine as i,defaultStyle as n,drawPoint as o,drawText as l,drawArrow as s}from"../useDraw.js";import{useGrid as r}from"../useGrid.js";import"date-fns";import{isOneLine as a,getType as u,isOverlapPoint as d,isValidValue as c,setOtherType as p,isEffectiveNode as f,getTime as h,getIndex as v,deleteProperty as g}from"../../utils/index.js";import"@vueuse/core";import{useCommon as y}from"../useCommon.js";import"vue";import{cloneDeep as m}from"lodash-es";import"../../../../../shared/utils/index.js";import{TEMPERATURE_MENU as x,PAIN_MENU as b,OVERLAP as j}from"../../constants/index.js";function w(w,k,Y,S,E,$,M,O,P,A){r(w,k);const{getEqualXTypes:I,handleAddPrevent:T}=y(w,Y,k),{createShadowLines:C}=t(),{left:R,xScaleList:X,xCellWidth:F,yCellHeight:z,originX:D,endX:V,originY:_,endY:G,itemList:H,event:q,vitalSignsOriginY:W,painOriginY:B,hospitalizationDate:J,config:K,canvasHeight:N}=k,Q=new Set,U=["xinmai","mai"],Z=new Map,ee=new Set,te=new Set,ie=new Set,ne=m(R.yScaleValue);function oe(t){var i;const o=ne.find((e=>"pulse"===e.type));if(o&&(null==(i=o.dataList)?void 0:i.length)&&(Q.size&&w.value.remove(...Q),Q.clear(),Z.size>1)){if(t){const{type:e,key:i}=t.origin||{};if("pulse"===e){const e=Z.get(i),n=null==e?void 0:e.findIndex((e=>e[0]===t.left));e.splice(n,1,[t.left,t.top])}}(function(){const e=[],t=[],i=[];for(const e of Z)t.push(e[1]),e[0]===U[0]&&e[1].forEach((e=>{(Z.get(U[1])||[]).findIndex((t=>t[0]===e[0]))>-1&&i.push(e[0])}));const[n,o]=t;let l=[],s=[];return i.forEach((t=>{const i=n.findIndex((e=>e[0]===t)),r=o.findIndex((e=>e[0]===t)),a=n[i],u=o[r],d=n[i-1],c=n[i+1],p=o[r-1],f=o[r+1];if(d&&p){if(d[0]!==p[0]){const e=Math.max(d[0],p[0]);l.push([d,p].find((t=>t[0]===e)))}}else d?l.push(d):p&&s.push(p);const h=Math.min(a[1],u[1]);l.push([a,u].find((e=>e[1]===h)));const v=Math.max(a[1],u[1]);s.push([a,u].find((e=>e[1]===v)));const g=()=>{const t=[...l,...s.reverse()],[i]=t,n=t.at(-1);i[0]===n[0]&&i[1]===n[1]&&t.splice(-1,1),e.push(t),l=[],s=[]};if(c&&f){if(c[0]!==f[0]){const e=Math.min(c[0],f[0]);l.push([c,f].find((t=>t[0]===e))),g()}}else c?(l.push(c),g()):f?(s.push(f),g()):g()})),e})().forEach((t=>{var i,l,s,r,a,u;const d=t.map((e=>({x:e[0],y:e[1]}))),c=new e.Polygon(d,{...n,...(null==(i=o.shadow)?void 0:i.style)||{}});if("slash"==(null==(l=o.shadow)?void 0:l.mode)){c.set({fill:"transparent",stroke:(null==(r=null==(s=o.shadow)?void 0:s.style)?void 0:r.stroke)||"#f00"});const e=C(t,null==(a=o.shadow)?void 0:a.style._angle,null==(u=o.shadow)?void 0:u.style.space);e.forEach((e=>{var t;Object.assign(e,{...n,...(null==(t=o.shadow)?void 0:t.style)||{}}),Q.add(e)})),w.value.add(...e)}Q.add(c),w.value.add(c)}))}}function le(){var e;const t=ne.find((e=>"pulse"===e.type));if(!t||!(null==(e=t.dataList)?void 0:e.length))return;if(!t.dataList.some((e=>e.title.includes("脉搏"))))return;const i=Object.assign({},j,R.overlap||{}),l=[];ee.size&&[...ee].forEach((e=>{[...te].forEach((t=>{if(t.origin&&d(e,t)){const e=t.origin.key;if(e){const s={left:t.left,top:t.top,...n,hoverCursor:"default"};let r="koumai";"yemai"===e&&(r=e),"humai"===e&&(r="circle"),l.push(o(r,{...i[e]||{},...s}))}}}))})),setTimeout((()=>{w.value.add(...l),l.forEach((e=>{null==e||e.bringToFront(),ie.add(e)}))}))}function se(e,t,r){var u;const{type:d,riseStyle:f={},noRiseStyle:h={},verifiedStyle:v={},reduceStyle:g={},pacemaker:y={},upArrowStyle:m={},limitValueStyle:x={},nonePainPointStyle:b={},dataList:j=[]}=r,S=[],$=[],O=[];null==(u=e.list)||u.forEach(((u,A)=>{const I=a(d)?j.find((e=>e.key===u.key)):e,T=ue(u,r),C={};C.value=function(e,t,i){if(!(null==e?void 0:e.length)||!K.showValue)return;const{lineAttr:n={}}=i,o=e[1]<=W.originY+z?e[1]+z:e[1]-z,s=l([e[0],o],{value:t.value,originX:"center",originY:"center",fill:n.stroke||"#000"});return O.push(s),{obj:s,top:-z}}(T,u,I),function(e,t,r,a,u){var p,y;if(!(null==e?void 0:e.length)||!["temperature","pain"].includes(d))return;const{lineAttr:m={}}=r,{value:x}=a;let b,j,w,k,Y,S;if(t.noRise&&h.show){const t=L(h)?E(u.type,u.list,35):e[1];if(h.text)w=l([e[0],L(h)?t:t+5],{value:h.text.split("").join("\n"),originY:"top",...h.style||{}}),O.push(w);else{const i=t+2*z;k=s([e[0],t,i],h.style||{}),O.push(k)}}t.rise&&f.show&&f.text&&(Y=l([e[0],e[1]-(x?z:0)-5],{value:f.text.split("").join("\n"),originY:"bottom",...f.style||{}}),O.push(Y));t.verified&&(S=l([e[0],e[1]-(x?z:0)-5],{value:"v",originX:"center",originY:"bottom",...v}),O.push(S));if(c(t.physicsReduce)||c(t.drugReduce)){const l=E(d,u.list,null!=(p=t.physicsReduce)?p:t.drugReduce);b=i([...e,e[0],l],{...m,...g.line,...n}),j=o((null==(y=null==g?void 0:g.point)?void 0:y.type)||"circle",{left:e[0],top:l,...g.point,...n,originY:l===N?"bottom":"center"}),b&&O.push(b),j&&O.push(j)}Object.assign(a,{reduceLine:{obj:b,type:"line"},noRiseText:{obj:w,top:5,isFixed:L(h)},arrowGroup:{obj:k,top:2*z,isFixed:L(h)},riseText:{obj:Y,top:(x?-z:0)-5},verifiedText:{obj:S,top:(x?-z:0)-5},reducePoint:{obj:j,type:"reduce"}})}(T,u,I,C,r),function(e,t,i,n){if(!(null==e?void 0:e.length)||!["pulse"].includes(d))return;let o,a;const{upArrowShow:u=!1,limitValueShow:c=!1}=i;if(u&&+t.value>180){let t=e[1]-2.5*z,i=[e[1]-z/2,t];t<W.originY&&(t=e[1]+2.5*z,i=[t,e[1]+z/2]),o=s([e[0],i[0],i[1]],m,"up"),O.push(o)}if(c){const i={value:t.value,originX:"center",originY:"center",...x};if(+t.value>Math.max(...r.list)){const t=o?e[1]+z/2+o.height:e[1]+z;a=l([e[0],t],i),O.push(a)}+t.value<Math.min(...r.list)&&(a=l([e[0],e[1]-z],i),O.push(a))}Object.assign(n,{upArrow:{obj:o},limitValue:{obj:a,top:-z}})}(T,u,I,C),function(n,l,s,a,u){let c,f;const{pointAttr:h={},lineAttr:v={},title:g="",key:m,type:x="circle"}=a,j=e.list[s+1],L=ue(j,r),E=re(d,e.list[s].value),O=L&&re(d,j.value);!n||!L||l.breakpoint||E||O||n[0]===L[0]||(f=i([...n,...L],{...v}));const A=l.pacemakerShow&&"pulse"==d?y.value:E?0:x,I=$[s-1],T={origin:{data:l,title:g,key:m||"",unit:r.unit,type:d,_type:p(g,d),dataIndex:t,index:s},leftLine:I,rightLine:f,otherObj:u,lockMovementX:!0,...l.pacemakerShow&&"pulse"==d?y.style:h,...k.event.hovered?k.event.evented?{selectable:!0}:{selectable:!0,lockMovementY:!0}:k.event,...E?{selectable:!1,evented:!1,...b}:{}};if(I){const e=I.get("y2");c=o(A,{left:I.get("x2"),top:E?e-5:e,...T})}else n&&(T.leftLine=null,c=o(A,{left:n[0],top:E?n[1]-5:n[1],...T}));$.push(f),c&&(g.includes("脉搏")?ee.add(c):te.add(c),function(e){q.hovered&&(e.on("mouseover",(()=>{ae(e,"hover")})),e.on("mouseout",(()=>{P.show=!1})));if(e.lockMovementX&&e.lockMovementY)return;e.on("moving",(()=>{!function(e){e.setCoords();const t="pain"===e.origin.type?B:W;e.top<t.originY&&e.set("top",t.originY);e.top>t.endY&&e.set("top",t.endY)}(e),function(e){var t,i;null==(t=e.leftLine)||t.setCoords().set({x2:e.left,y2:e.top}),null==(i=e.rightLine)||i.setCoords().set({x1:e.left,y1:e.top}),Object.values(e.otherObj).forEach((t=>{const{obj:i,type:n="",top:o=0,isFixed:l}=t||{};"reduce"!==n&&("line"===n?null==i||i.setCoords().set({x1:e.left,y1:e.top}):!l&&(null==i||i.setCoords().set({left:e.left,top:e.top+o})))})),oe(e)}(e),q.hovered&&ae(e)})),e.on("mouseup",(t=>{if(P.show=!1,1===t.button){const{type:t}=e.origin,i=M(t,e.top),n={...e.origin,data:{...e.origin.data,value:i}};w.value.discardActiveObject(),Y("change",n),ce(n,"change")}}))}(c),S.push(c),ie.add(c))}(T,u,A,I,C)})),"pulse"===d&&U.forEach((e=>{Z.set(e,S.filter((t=>{var i;return(null==(i=t.origin)?void 0:i.key)===e})).map((e=>[e.left,e.top])))})),Promise.all(S).then((e=>{const t=$.filter((e=>e));let i=null;e=e.map((e=>(e&&i&&(i.nextPoint=e,e.prevPoint=i),i=e||i,e))),Promise.all(O).then((i=>{w.value.add(...t,...e,...i),e.forEach((t=>{null==t||t.bringToFront(),function(e,t){if("pulse"===e.origin.type){t.filter((t=>t.left===e.left&&"pulse"===t.origin.type)).length>1&&(e.leftLine&&w.value.remove(e.leftLine),e.rightLine&&w.value.remove(e.rightLine))}}(t,e)}))}))}))}function re(e,t){return"pain"===e&&0==t}function ae(e,t="moving"){const{title:i,unit:n,type:o,data:l}=e.origin;P.point={x:e.left,y:e.top},P.list=[function(){const{drugReduce:s,physicsReduce:r}=l||{},a="hover"===t?l.value:M(o,e.top);if(c(s))return`药物降${"pain"==o?"痛":"温"} ${a}—>${s}${n||""}`;if(c(r))return`物理降${"pain"==o?"痛":"温"} ${a}—>${r}${n||""}`;return`${i} ${a}${n||""}`}(),`时间 ${((null==l?void 0:l.time)||$(e.left)).slice(-5)}`],P.show=!0}function ue(e,t){const i="pain"===t.type?B:W;if(f(e)&&function(e){const[t]=X,i=X.at(-1),n=t.start,o=i.end,l=h(e);return l>=n&&l<=o}(e.time)){const n=S(e.time),o=E(t.type,t.list,e.value);return[n,o<i.originY?i.originY:o>i.endY?i.endY:o]}}function de(e){const t=new Date,i=String(t.getMonth()+1).padStart(2,"0"),n=String(t.getDate()).padStart(2,"0"),o=h(`${t.getFullYear()}-${i}-${n} 23:59:59`),l=h(`${$(e)}:00`);return J&&l<h(J)?(T("exceedMin"),!1):!(l>o)||(T("exceedMax"),!1)}function ce(e,t="add"){const{type:i,dataIndex:n,index:o,data:l,key:s}=e,r=ne.find((e=>e.type===i));if("add"===t){const e=a(i)?r.dataList.find((e=>e.enable)):r.dataList[n],t=v(l.time,e.list);e.list.splice(t,0,l)}else r.dataList[n].list[o]=l;pe()}function pe(){var e;ie.size&&(null==(e=w.value)||e.remove(...function(e){const t=[];return e.forEach((e=>{e&&t.push(e),(null==e?void 0:e.leftLine)&&t.push(null==e?void 0:e.leftLine),(null==e?void 0:e.rightLine)&&t.push(null==e?void 0:e.rightLine),Object.values((null==e?void 0:e.otherObj)||{}).forEach((e=>{(null==e?void 0:e.obj)&&t.push(null==e?void 0:e.obj)}))})),t}([...ie]))),Z.clear(),ie.clear(),ee.clear(),te.clear(),ne.forEach((e=>{e.dataList.forEach(((t,i)=>{a(e.type)&&!t.enable||se(t,i,e)}))})),oe(),le()}return Z.clear(),ee.clear(),te.clear(),ne.forEach((e=>{!function(e){if("temperature"!==e.type||!e.positionLine)return;const t=E(e.type,e.list,e.positionLine.value),n=i([D,t,V,t],e.positionLine);w.value.add(n)}(e),e.dataList.forEach(((t,i)=>{a(e.type)&&!t.enable||se(t,i,e)}))})),oe(),le(),k.event.evented&&w.value.on("mouse:up",(e=>{var t;if(3===e.button){const{x:i=0,y:n=0}=e.pointer||{};if(i>=D&&i<=V&&n>=_&&n<=G){A.point={x:i,y:n},A.show=!0;const{type:o}=(null==(t=e.target)?void 0:t.origin)||{};if(e.target&&["temperature","pain"].includes(o))"temperature"===o&&(A.list=[...x]),"pain"===o&&(A.list=[...b]),A.target=e.target;else{A.target=null,A.list=["新增节点"],H.forEach((t=>{if(!I(i,"_type",F).includes(t.bigType)){const i=["pain"].includes(t.bigType)?B:W;n>=i.originY&&n<=i.endY&&A.list.push({renderItem:O?O(t):()=>t.title,origin:{title:t.title,unit:t.unit,type:u(t.bigType),dataIndex:t.dataIndex,key:t.key},pointer:e.pointer})}}));const t=de(i);t&&1!==A.list.length||(A.show=!1,1===A.list.length&&t&&T("repeat"))}}}})),{clickMenu:function({item:e,target:t}){if(t){const{data:i,type:n,dataIndex:o,index:l}=t.origin,s=g(i,[...x,...b]);s[`${e.type}`]=e.value,a(n)&&(s.key=t.origin.key);const r={...t.origin,data:s};Y("change",r),ce(r,"change")}else{const t={data:{time:$(e.pointer.x),value:M(e.origin.type,e.pointer.y),...a(e.origin.type)?{key:e.origin.key}:{}},...e.origin};Y("add",t),ce(t)}},setPopup:ae,isAddPoint:de,updateData:ce,redrawPoints:pe}}function L(e){return"fixed"===e.position}export{w as useCenter};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{fabric as t}from"../../../../../shared/utils/fabricjs/index.js";import{drawLine as e,defaultTextStyle as i,defaultStyle as n,drawTextAndIconGroup as o,drawTextGroup as l}from"../useDraw.js";import"date-fns";import{getType as s,isOneLine as r}from"../../utils/index.js";import"@vueuse/core";import{getScaleInfo as a,drawScaleNumber as u,drawScaleLine as h}from"../useScaleColumn.js";import{useCommon as c}from"../useCommon.js";import"vue";import"lodash-es";import"./useShadow.js";function
|
|
1
|
+
import{fabric as t}from"../../../../../shared/utils/fabricjs/index.js";import{drawLine as e,defaultTextStyle as i,defaultStyle as n,drawTextAndIconGroup as o,drawTextGroup as l}from"../useDraw.js";import"date-fns";import{getType as s,isOneLine as r}from"../../utils/index.js";import"@vueuse/core";import{getScaleInfo as a,drawScaleNumber as u,drawScaleLine as h}from"../useScaleColumn.js";import{useCommon as c}from"../useCommon.js";import"vue";import"lodash-es";import"./useShadow.js";import"../../../../../shared/utils/index.js";function p(p,g,d,f,m,y,v,w,S,Y,b){var x,j;const{getEqualXTypes:X,handleAddPrevent:C,isGridLimit:N}=c(p,d,g),{originY:T,endY:V,originX:k,endX:L,xCellWidth:M,yCellHeight:W,left:E,vitalSignsOriginY:G,painOriginY:O,painHeight:A,iconsWidth:H,itemList:I,painIndex:R,right:_,canvasWidth:B,canvasHeight:J,getRightInfo:$,borderStyle:q}=g;function D(o){var s;if(!(null==o?void 0:o.length))return;const{layout:r}=o[0];let c=H,g=k;"right"===r&&(c=L,g=L+(null!=(s=null==_?void 0:_.width)?s:0));const d=[],f=A&&"right"!==r?o.length-1:o.length,m=(g-c)/f,y=m+(g-c)%f;o.forEach(((o,s)=>{if("pain"===o.type)return void function(n){const{list:o=[],spaceGridNumber:s=5,showScale:r,showNumber:h,position:c,showMaxMinNumber:g,style:d,title:f}=n,m=l({width:k-H,height:A,...q},{value:`${f}`,...i,...d||{}},{left:H,top:O.originY}),y=e([H,O.originY,k,O.originY],q),v=[];if(r||h){const{lineXMain:e,textLeft:i}=a(c,H,k-H),l=o.length;o.forEach(((o,a)=>{let c=O.endY-a*W*s;if(0===a&&(c=V-5),!h||(0===a||a===l-1)&&!g||v.push(u(o,n,i,c)),r&&0!==a){const[i,n]=e,o=new t.Line([i,c,n,c],{...q,...d});v.push(o)}}))}p.value.add(y,m,...v),m.sendToBack()}(o);const g=[],f=0===s?y:m,v=0===s?c:y+c+(s-1)*m,w="right"===r?0:G.originY,S="right"===r?J:G.endY,Y=s>0?e([v,w,v,S],{objectCaching:!1,...q}):null;Y&&g.push(Y);const b=v+f/2,{list:x=[],spaceGridNumber:j=5,showScale:X,showNumber:C,position:N,showMaxMinNumber:T}=o;if(X||C){const{lineXMain:t,lineXSub:e,textLeft:i}=a(N,v,f),n=x.length;x.forEach(((l,s)=>{const r=G.endY-s*W*j;if(C&&(!(0===s||s===n-1)||T)){const t=0==s?r-5:r,e=u(l,o,i,t),n=G.originY+e.height/2;t<n&&e.set({top:n}),g.push(e)}g.push(...h(o,s,t,e,r,W,G.originY))}))}let L=o.title||"";o.unit&&(L+="\n"+o.unit),L&&g.push(new t.Text(String(L),{...i,left:b,top:G.originY+W*j/2,textAlign:"center",...o.style}));const M=new t.Group(g,{...n,objectCaching:!1});d.push(M)}));const v=d.length>0?new t.Group([...d],{...n,objectCaching:!1}):null;v&&p.value.add(v),v&&v.sendToBack()}H&&function(){const t=JSON.parse(JSON.stringify(I));let e=V;const i=H-E.icons.marginRight;t.reverse().forEach((t=>{e-=10;let n=t.title.replace(/(.{2})/g,"$1\n");n.endsWith("\n")&&(n=n.slice(0,n.length-1));const{text:l,icon:a}=o(n,t,{text:{left:i-(t.pointAttr.width||10)-5,top:e,originX:"right"},icon:{originX:"right",left:i,topY:e,origin:{type:s(t.bigType),_type:t.bigType},...g.event}});var u;e-=l.height||30,(u=a).on("moving",(()=>{u.set("originX","center"),function(t){if(t.left>=k&&t.left<=L){t.setCoords();const e="pain"===t.origin.type?O:G;t.top<e.originY&&t.set("top",e.originY),t.top>e.endY&&t.set("top",e.endY)}}(u),N(u)?f(u):m.show=!1})),u.on("mouseup:before",(t=>{if(m.show=!1,0===t.e.button&&N(u)){const t=X(u.left,"_type",M).includes(u.origin._type),e=Y(u.left);if(!e||t)t&&e&&C("repeat");else{const t={data:{time:w(u.left),value:S(u.origin.type,u.top),...r(u.origin.type)?{key:u.origin.key}:{}},...u.origin};d("add",t),b(t)}}!function(t){t.setCoords().set({originX:"right",left:t.originLeft,top:t.originTop})}(u)})),p.value.add(l,a)}))}();const P=E.yScaleValue.filter((t=>"left"===t.layout&&"pain"!==t.type&&t.show));if((null==_?void 0:_.width)&&"left"===(null==(x=null==_?void 0:_.yScaleValue)?void 0:x.layout)&&(null==(j=null==_?void 0:_.yScaleValue)?void 0:j.show)&&P.push($),R>0&&E.yScaleValue[R].show){const t=E.yScaleValue[R];0===R&&E.yScaleValue.length>1&&P.unshift(t),R==E.yScaleValue.length-1&&P.push(t)}const z=P.findIndex((t=>"pulse"===t.type&&t.show&&t.doubleShow)),F=P[z];return z>-1&&P.splice(z,0,{...F,title:(null==F?void 0:F.doubleTitle)||(null==F?void 0:F.title)}),D(P),p.value.add(new t.Rect({left:H,top:0,width:B-H-q.strokeWidth,height:J-q.strokeWidth,fill:"transparent",...q})),{drawScaleValue:D}}export{p as useLeft};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{fabric as t}from"../../../../../shared/utils/fabricjs/index.js";import{defaultStyle as e}from"../useDraw.js";import"date-fns";import"lodash-es";import"@vueuse/core";import"vue";import"./useShadow.js";function i(i,n,o){const{other:r,vitalSignsOriginY:l,xCellWidth:s,yCellHeight:a,endX:
|
|
1
|
+
import{fabric as t}from"../../../../../shared/utils/fabricjs/index.js";import{defaultStyle as e}from"../useDraw.js";import"date-fns";import"lodash-es";import"@vueuse/core";import"vue";import"./useShadow.js";import"../../../../../shared/utils/index.js";function i(i,n,o){const{other:r,vitalSignsOriginY:l,xCellWidth:s,yCellHeight:a,endX:u}=n;let c=0;function h(i,n,o){const r=[];String(i.value).split("").forEach(((n,o)=>{const l=new t.Text(n,{left:0,top:a*o,originX:"center",...e,objectCaching:!1,...i.style||{}});c=(a-(l.height||0))/2,r.push(l)}));const l={originX:"center",left:n,top:o+c,baseTop:(i.baseTop||0)*a,trueLeft:n,trueHeight:r.length*a,objectCaching:!1};return new t.Group(r,l)}!function(){if(!(null==r?void 0:r.list))return!1;const n=[],c=[];r.list.forEach(((t,e)=>{const i=0===e?"vertical":t.align||"vertical",n=o(t.time,!0);if(n>u)return;const r=c.find((t=>t.left==n));if(r)r[i].push(t);else{const e={left:n,vertical:[],horizontal:[]};e[i].push(t),c.push(e)}})),c.forEach((t=>{let e=l.originY,i=t.left;t.vertical.forEach(((o,r)=>{var u,c;const f=(o.baseTop||0)*a,g=(null==(u=n.at(-1))?void 0:u.left)||0;0===r&&t.left<=g&&(i=g+s);if(n.filter((t=>t.trueLeft===i)).length){const t=String(o.value).length*a,r=(null==(c=n.at(-1))?void 0:c.trueHeight)||0;e+=r,e+t+f>l.endY&&(e=l.originY,i+=s)}e+=f,String(o.value).length&&n.push(h(o,i,e))})),t.horizontal.forEach(((e,o)=>{var r;const u=l.originY+(e.baseTop||0)*a,c=(null==(r=n.at(-1))?void 0:r.left)||0;t.left<=c&&(i=c+s),String(e.value).length&&n.push(h(e,i,u))}))}));const f=n.length>0?new t.Group([...n],{...e,objectCaching:!1}):null;f&&i.value.add(f)}()}export{i as useOther};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{ref as e,computed as t,reactive as a,onMounted as l,nextTick as u}from"vue";import{defaultBorderStyle as i}from"../useDraw.js";import"../../../../../shared/utils/fabricjs/index.js";import{useCumputedPoint as r}from"../useCumputedPoint.js";import{useEvent as n,useCanvasEvent as o}from"../useEvent.js";import{setOtherType as s,getFloorNumber as d}from"../../utils/index.js";import"lodash-es";import{format as v,addDays as c}from"date-fns";import{useTop as h}from"./useTop.js";import{useLeft as p}from"./useLeft.js";import{useRight as g}from"./useRight.js";import{useCenter as m}from"./useCenter.js";import{useBottom as f}from"./useBottom.js";import{useOther as y}from"./useOther.js";function Y(Y,S,b,w,C,x){const D=15,j=e(),V=e(),X=e(),H=t((()=>{const{top:e}=S.data;return e.date.show&&(e.date.height||D)||0})),L=t((()=>{var e;const{top:t}=S.data;return(null==(e=t.hospitalDays)?void 0:e.show)&&(t.hospitalDays.height||D)||0})),I=t((()=>{var e;const{top:t}=S.data;return(null==(e=t.operationDays)?void 0:e.show)&&(t.operationDays.height||D)||0})),M=t((()=>{var e,t,a;const{top:l}=S.data;return((null==(e=l.xScalevalue)?void 0:e.show)&&(l.xScalevalue.height||D)||0)+((null==(t=l.xScalevalue)?void 0:t.show)&&null!=(a=l.dayHeight)?a:0)})),N=t((()=>{var e;const{bottom:t}=S.data;return(null==(e=null==t?void 0:t.breathing)?void 0:e.show)&&(t.breathing.height||30)||0})),P=t((()=>{const{grid:e}=S.data;return e.mainXCell*e.subXCell+e.surplusXCell})),O=t((()=>{const{grid:e}=S.data;return e.mainYCell*e.subYCell+e.surplusYCell})),W=t((()=>{var e;const{width:t,right:a=null,top:l}=S.data;if(!a)return t;return t-(null!=(e=a.width)?e:0)})),$=t((()=>{const{grid:e}=S.data;return W.value-e.surplusXCell*z.value})),k=t((()=>{const{top:e,left:t}=S.data;return e.titleWidth+A.value})),G=t((()=>{const{bottom:e=null,height:t}=S.data;if(!e)return t;return t-(e.height||30)})),R=t((()=>{var e;const{top:t}=S.data,a=t.xScalevalue.show&&(null!=(e=t.dayHeight)?e:0)||0,l=t.xScalevalue.show&&(t.xScalevalue.height||D)||0;return H.value+a+l+L.value+I.value})),q=t((()=>{const{grid:e}=S.data;return R.value+e.surplusYCell*T.value})),z=t((()=>(W.value-k.value)/P.value)),T=t((()=>(G.value-R.value)/O.value)),A=t((()=>{var e,t;const{left:a}=S.data;return(null==(e=a.icons)?void 0:e.show)&&((null==(t=a.icons)?void 0:t.width)||100)||0})),B=t((()=>{var e,t;const{top:a,grid:l}=S.data,u=(null==(t=null==(e=a.date.list)?void 0:e.slice)?void 0:t.call(e,0,l.mainXCell))||[],i=a.xScalevalue.times;let r=k.value-z.value;const n=a.date.startDate||v(new Date,"yyyy-MM-dd");return u.reduce(((e,t,a)=>0===a?e.concat(n):e.concat(v(c(new Date(n.replace(/-/g,"/")),a),"yyyy-MM-dd"))),[]).map((e=>i.map((t=>{r+=z.value;const a=Date.parse(`${e} ${t.start}`),l=Date.parse(`${e} ${t.end}`);return{start:a,end:l,left:r,center:r+z.value/2,scaleCell:(l-a)/z.value}})))).flat()})),E=t((()=>ie("breathe"))),F=t((()=>ie("pulse"))),J=t((()=>ie("temperature"))),K=t((()=>ie("pain"))),Q=t((()=>{var e;return(null==(e=S.data.grid)?void 0:e.event)||{selectable:!0,evented:!0,hovered:!0}})),U=t((()=>{const{left:e}=S.data;return e.yScaleValue.map((e=>e.dataList.filter((e=>e.show)).map(((t,a)=>({...t,bigType:s(t.title,e.type),unit:e.unit,dataIndex:a}))))).flat()})),Z=t((()=>{const{left:e}=S.data;return e.yScaleValue.findIndex((e=>"pain"===e.type))})),_=t((()=>{const{grid:e}=S.data;return-1===Z.value?0:T.value*e.subYCell})),ee=t((()=>{const{left:e}=S.data,t={originY:G.value,endY:G.value};return 0===Z.value&&e.yScaleValue.length>1?(t.originY=q.value,t.endY=q.value+_.value):Z.value===e.yScaleValue.length-1&&(t.originY=G.value-_.value,t.endY=G.value),t})),te=t((()=>{const{left:e}=S.data,t={originY:R.value,endY:G.value};return 0===Z.value&&e.yScaleValue.length>1?(t.originY=q.value+_.value,t.endY=G.value):Z.value===e.yScaleValue.length-1&&(t.originY=q.value,t.endY=G.value-_.value),t})),ae=t((()=>{var e,t;const{top:a,grid:l}=S.data,u=[];for(const i in a)a[i].show&&u.push({...a[i],list:(null==(t=null==(e=a[i].list)?void 0:e.slice)?void 0:t.call(e,0,l.mainXCell))||[],key:i});return u.sort(((e,t)=>e.seq-t.seq))})),le=t((()=>{var e;const{left:t,right:a}=S.data,l=t.yScaleValue.find((e=>"temperature"===e.type)),u=(null==a?void 0:a.yScaleValue)||{};return(null==(e=null==l?void 0:l.list)?void 0:e.length)&&Object.assign(u,{list:l.list.map((e=>d(1.8*e+32))),spaceGridNumber:l.spaceGridNumber}),u})),ue=a({canvasWidth:S.data.width,canvasHeight:S.data.height,borderStyle:{...i,...S.data.borderStyle||{}},selectionStyle:S.data.selectionStyle||{},dateHeight:H.value,hospitalDaysHeight:L.value,operationDaysHeight:I.value,xScalevalueHeight:M.value,topList:ae.value,breathingHeight:N.value,hospitalizationDate:S.data.hospitalizationDate,grid:S.data.grid,top:S.data.top,left:S.data.left,right:S.data.right,bottom:S.data.bottom,other:S.data.other,painIndex:Z.value,painHeight:_.value,painOriginY:ee.value,vitalSignsOriginY:te.value,gridXNumber:P.value,gridYNumber:O.value,iconsWidth:A.value,originX:k.value,originY:R.value,originYLimit:q.value,endX:W.value,endXLimit:$.value,endY:G.value,xCellWidth:z.value,yCellHeight:T.value,xScaleList:B.value,breatheYCell:E.value,pulseYCell:F.value,temperatureYCell:J.value,painYCell:K.value,event:Q.value,itemList:U.value,getRightInfo:le.value,config:S.data.config||{}});function ie(e){const{yScaleValue:t}=S.data.left,a=t.find((t=>t.type===e)),l=(null==a?void 0:a.list)||[];return l.length?T.value/((l[1]-l[0])/a.spaceGridNumber):0}const{cumputedX:re,cumputedY:ne,getXValue:oe,getYValue:se}=r(ue);return l((()=>{u((()=>{h(Y,ue);const{setPopup:e,isAddPoint:t,updateData:a,redrawPoints:l,clickMenu:u}=m(Y,ue,b,re,ne,oe,se,S.addRenderItem,C,x);V.value=l,X.value=u;const{drawScaleValue:i}=p(Y,ue,b,e,C,re,ne,oe,se,t,a);g(Y,ue,i),f(Y,ue),y(Y,ue,re),n(w.value);const{select:r}=o(Y,ue,b);j.value=r}))})),{propItems:ue,redrawPoints:V,select:j,clickMenu:X}}export{Y as useTemperatureChart};
|
|
1
|
+
import{ref as e,computed as t,reactive as a,onMounted as l,nextTick as u}from"vue";import{defaultBorderStyle as i}from"../useDraw.js";import"../../../../../shared/utils/fabricjs/index.js";import{useCumputedPoint as r}from"../useCumputedPoint.js";import{useEvent as n,useCanvasEvent as o}from"../useEvent.js";import{setOtherType as s,getFloorNumber as d}from"../../utils/index.js";import"lodash-es";import{format as v,addDays as c}from"date-fns";import"../../../../../shared/utils/index.js";import{useTop as h}from"./useTop.js";import{useLeft as p}from"./useLeft.js";import{useRight as g}from"./useRight.js";import{useCenter as m}from"./useCenter.js";import{useBottom as f}from"./useBottom.js";import{useOther as y}from"./useOther.js";function Y(Y,S,b,w,C,x){const D=15,j=e(),V=e(),X=e(),H=t((()=>{const{top:e}=S.data;return e.date.show&&(e.date.height||D)||0})),L=t((()=>{var e;const{top:t}=S.data;return(null==(e=t.hospitalDays)?void 0:e.show)&&(t.hospitalDays.height||D)||0})),I=t((()=>{var e;const{top:t}=S.data;return(null==(e=t.operationDays)?void 0:e.show)&&(t.operationDays.height||D)||0})),M=t((()=>{var e,t,a;const{top:l}=S.data;return((null==(e=l.xScalevalue)?void 0:e.show)&&(l.xScalevalue.height||D)||0)+((null==(t=l.xScalevalue)?void 0:t.show)&&null!=(a=l.dayHeight)?a:0)})),N=t((()=>{var e;const{bottom:t}=S.data;return(null==(e=null==t?void 0:t.breathing)?void 0:e.show)&&(t.breathing.height||30)||0})),P=t((()=>{const{grid:e}=S.data;return e.mainXCell*e.subXCell+e.surplusXCell})),O=t((()=>{const{grid:e}=S.data;return e.mainYCell*e.subYCell+e.surplusYCell})),W=t((()=>{var e;const{width:t,right:a=null,top:l}=S.data;if(!a)return t;return t-(null!=(e=a.width)?e:0)})),$=t((()=>{const{grid:e}=S.data;return W.value-e.surplusXCell*z.value})),k=t((()=>{const{top:e,left:t}=S.data;return e.titleWidth+A.value})),G=t((()=>{const{bottom:e=null,height:t}=S.data;if(!e)return t;return t-(e.height||30)})),R=t((()=>{var e;const{top:t}=S.data,a=t.xScalevalue.show&&(null!=(e=t.dayHeight)?e:0)||0,l=t.xScalevalue.show&&(t.xScalevalue.height||D)||0;return H.value+a+l+L.value+I.value})),q=t((()=>{const{grid:e}=S.data;return R.value+e.surplusYCell*T.value})),z=t((()=>(W.value-k.value)/P.value)),T=t((()=>(G.value-R.value)/O.value)),A=t((()=>{var e,t;const{left:a}=S.data;return(null==(e=a.icons)?void 0:e.show)&&((null==(t=a.icons)?void 0:t.width)||100)||0})),B=t((()=>{var e,t;const{top:a,grid:l}=S.data,u=(null==(t=null==(e=a.date.list)?void 0:e.slice)?void 0:t.call(e,0,l.mainXCell))||[],i=a.xScalevalue.times;let r=k.value-z.value;const n=a.date.startDate||v(new Date,"yyyy-MM-dd");return u.reduce(((e,t,a)=>0===a?e.concat(n):e.concat(v(c(new Date(n.replace(/-/g,"/")),a),"yyyy-MM-dd"))),[]).map((e=>i.map((t=>{r+=z.value;const a=Date.parse(`${e} ${t.start}`),l=Date.parse(`${e} ${t.end}`);return{start:a,end:l,left:r,center:r+z.value/2,scaleCell:(l-a)/z.value}})))).flat()})),E=t((()=>ie("breathe"))),F=t((()=>ie("pulse"))),J=t((()=>ie("temperature"))),K=t((()=>ie("pain"))),Q=t((()=>{var e;return(null==(e=S.data.grid)?void 0:e.event)||{selectable:!0,evented:!0,hovered:!0}})),U=t((()=>{const{left:e}=S.data;return e.yScaleValue.map((e=>e.dataList.filter((e=>e.show)).map(((t,a)=>({...t,bigType:s(t.title,e.type),unit:e.unit,dataIndex:a}))))).flat()})),Z=t((()=>{const{left:e}=S.data;return e.yScaleValue.findIndex((e=>"pain"===e.type))})),_=t((()=>{const{grid:e}=S.data;return-1===Z.value?0:T.value*e.subYCell})),ee=t((()=>{const{left:e}=S.data,t={originY:G.value,endY:G.value};return 0===Z.value&&e.yScaleValue.length>1?(t.originY=q.value,t.endY=q.value+_.value):Z.value===e.yScaleValue.length-1&&(t.originY=G.value-_.value,t.endY=G.value),t})),te=t((()=>{const{left:e}=S.data,t={originY:R.value,endY:G.value};return 0===Z.value&&e.yScaleValue.length>1?(t.originY=q.value+_.value,t.endY=G.value):Z.value===e.yScaleValue.length-1&&(t.originY=q.value,t.endY=G.value-_.value),t})),ae=t((()=>{var e,t;const{top:a,grid:l}=S.data,u=[];for(const i in a)a[i].show&&u.push({...a[i],list:(null==(t=null==(e=a[i].list)?void 0:e.slice)?void 0:t.call(e,0,l.mainXCell))||[],key:i});return u.sort(((e,t)=>e.seq-t.seq))})),le=t((()=>{var e;const{left:t,right:a}=S.data,l=t.yScaleValue.find((e=>"temperature"===e.type)),u=(null==a?void 0:a.yScaleValue)||{};return(null==(e=null==l?void 0:l.list)?void 0:e.length)&&Object.assign(u,{list:l.list.map((e=>d(1.8*e+32))),spaceGridNumber:l.spaceGridNumber}),u})),ue=a({canvasWidth:S.data.width,canvasHeight:S.data.height,borderStyle:{...i,...S.data.borderStyle||{}},selectionStyle:S.data.selectionStyle||{},dateHeight:H.value,hospitalDaysHeight:L.value,operationDaysHeight:I.value,xScalevalueHeight:M.value,topList:ae.value,breathingHeight:N.value,hospitalizationDate:S.data.hospitalizationDate,grid:S.data.grid,top:S.data.top,left:S.data.left,right:S.data.right,bottom:S.data.bottom,other:S.data.other,painIndex:Z.value,painHeight:_.value,painOriginY:ee.value,vitalSignsOriginY:te.value,gridXNumber:P.value,gridYNumber:O.value,iconsWidth:A.value,originX:k.value,originY:R.value,originYLimit:q.value,endX:W.value,endXLimit:$.value,endY:G.value,xCellWidth:z.value,yCellHeight:T.value,xScaleList:B.value,breatheYCell:E.value,pulseYCell:F.value,temperatureYCell:J.value,painYCell:K.value,event:Q.value,itemList:U.value,getRightInfo:le.value,config:S.data.config||{}});function ie(e){const{yScaleValue:t}=S.data.left,a=t.find((t=>t.type===e)),l=(null==a?void 0:a.list)||[];return l.length?T.value/((l[1]-l[0])/a.spaceGridNumber):0}const{cumputedX:re,cumputedY:ne,getXValue:oe,getYValue:se}=r(ue);return l((()=>{u((()=>{h(Y,ue);const{setPopup:e,isAddPoint:t,updateData:a,redrawPoints:l,clickMenu:u}=m(Y,ue,b,re,ne,oe,se,S.addRenderItem,C,x);V.value=l,X.value=u;const{drawScaleValue:i}=p(Y,ue,b,e,C,re,ne,oe,se,t,a);g(Y,ue,i),f(Y,ue),y(Y,ue,re),n(w.value);const{select:r}=o(Y,ue,b);j.value=r}))})),{propItems:ue,redrawPoints:V,select:j,clickMenu:X}}export{Y as useTemperatureChart};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{fabric as t}from"../../../../../shared/utils/fabricjs/index.js";import{drawLine as e,defaultStyle as l,drawTextGroup as s,defaultTextStyle as i}from"../useDraw.js";import"date-fns";import"lodash-es";import"@vueuse/core";import"vue";import"./useShadow.js";function o(o,u){const{grid:h,originX:n,endX:a,xCellWidth:c,gridXNumber:r,top:p,xScalevalueHeight:d,iconsWidth:f,topList:v,endXLimit:g,canvasWidth:y,borderStyle:m}=u;!function(){const S=[];g&&S.push(new t.Line([g,0,y,0],m));let w=0;v.forEach(((t,l)=>{if(l>0&&(w+=u[`${v[l-1].key}Height`]),"xScalevalue"==t.key)!function(t,l,o){const u=p.dayHeight;if(!u)return;l.push(e([n,o+u,a,o+u],m));const d=c*h.subSecondXCell,f=(r-h.surplusXCell)/h.subSecondXCell;for(let h=0;h<f;h++){const a=n+h*d,c=h%2==0?"上午":"下午",r=s({width:d,height:u,...m},{value:c,...i,...t.style||{}},{left:a,top:o});l.push(r),l.push(e([a+d,o,a+d,o+u],m))}}(t,S,w),function(t,l,o){var u;const r=p.xScalevalue.show&&null!=(u=p.dayHeight)?u:0,v=d-r;if(!v)return;l.push(e([f,o+d,a,o+d],m));const g=s({width:n-f,height:d,...m},{value:p.xScalevalue.title,...i,...t.style||{},...t.titleStyle||{}},{left:f,top:o});l.push(g),l.push(e([n,o,n,o+d],m));const y=[];for(let t=0;t<h.mainXCell;t++)y.push(p.xScalevalue.list);y.flat().forEach(((u,h)=>{const a=n+h*c,p=s({width:c,height:v,...m},{value:u.value,...i,...t.style||{},...u.style||{}},{left:a,top:o+r});l.push(p),l.push(e([a+c,o+r,a+c,o+r+v],m))}))}(t,S,w);else{if(!u[`${t.key}Height`])return;const o=u[`${v[l].key}Height`];!function(t,l,o){const a=u[`${t.key}Height`],r=s({width:n-f,height:a,...m},{value:t.title,...i,...(null==t?void 0:t.style)||{},...t.titleStyle||{}},{left:f,top:o});l.push(r);const p=c*h.subXCell;t.list.forEach(((u,h)=>{const c=n+h*p,r=s({width:p,height:a,...m},{value:u,...i,...(null==t?void 0:t.style)||{}},{left:c,top:o});l.push(e([c+p,o,c+p,o+a],m)),l.push(r)}))}(t,S,w),S.push(e([f,w+o,a,w+o],m)),S.push(e([n,w,n,w+o],m))}}));const
|
|
1
|
+
import{fabric as t}from"../../../../../shared/utils/fabricjs/index.js";import{drawLine as e,defaultStyle as l,drawTextGroup as s,defaultTextStyle as i}from"../useDraw.js";import"date-fns";import"lodash-es";import"@vueuse/core";import"vue";import"./useShadow.js";import"../../../../../shared/utils/index.js";function o(o,u){const{grid:h,originX:n,endX:a,xCellWidth:c,gridXNumber:r,top:p,xScalevalueHeight:d,iconsWidth:f,topList:v,endXLimit:g,canvasWidth:y,borderStyle:m}=u;!function(){const S=[];g&&S.push(new t.Line([g,0,y,0],m));let w=0;v.forEach(((t,l)=>{if(l>0&&(w+=u[`${v[l-1].key}Height`]),"xScalevalue"==t.key)!function(t,l,o){const u=p.dayHeight;if(!u)return;l.push(e([n,o+u,a,o+u],m));const d=c*h.subSecondXCell,f=(r-h.surplusXCell)/h.subSecondXCell;for(let h=0;h<f;h++){const a=n+h*d,c=h%2==0?"上午":"下午",r=s({width:d,height:u,...m},{value:c,...i,...t.style||{}},{left:a,top:o});l.push(r),l.push(e([a+d,o,a+d,o+u],m))}}(t,S,w),function(t,l,o){var u;const r=p.xScalevalue.show&&null!=(u=p.dayHeight)?u:0,v=d-r;if(!v)return;l.push(e([f,o+d,a,o+d],m));const g=s({width:n-f,height:d,...m},{value:p.xScalevalue.title,...i,...t.style||{},...t.titleStyle||{}},{left:f,top:o});l.push(g),l.push(e([n,o,n,o+d],m));const y=[];for(let t=0;t<h.mainXCell;t++)y.push(p.xScalevalue.list);y.flat().forEach(((u,h)=>{const a=n+h*c,p=s({width:c,height:v,...m},{value:u.value,...i,...t.style||{},...u.style||{}},{left:a,top:o+r});l.push(p),l.push(e([a+c,o+r,a+c,o+r+v],m))}))}(t,S,w);else{if(!u[`${t.key}Height`])return;const o=u[`${v[l].key}Height`];!function(t,l,o){const a=u[`${t.key}Height`],r=s({width:n-f,height:a,...m},{value:t.title,...i,...(null==t?void 0:t.style)||{},...t.titleStyle||{}},{left:f,top:o});l.push(r);const p=c*h.subXCell;t.list.forEach(((u,h)=>{const c=n+h*p,r=s({width:p,height:a,...m},{value:u,...i,...(null==t?void 0:t.style)||{}},{left:c,top:o});l.push(e([c+p,o,c+p,o+a],m)),l.push(r)}))}(t,S,w),S.push(e([f,w+o,a,w+o],m)),S.push(e([n,w,n,w+o],m))}}));const x=S.length>0?new t.Group([...S],{...l,objectCaching:!1}):null;x&&x.sendToBack(),x&&o.value.add(x)}()}export{o as useTop};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var e="@cnhis-design-vue/shared",i="3.1.48-beta.
|
|
1
|
+
var e="@cnhis-design-vue/shared",i="3.1.48-beta.6",s="index.ts",n={"naive-ui":"^2.30.0",vue:"^3.2.0"},a={"@vicons/ionicons5":"^0.12.0","lodash-es":"^4.17.21",moment:"^2.29.1","video.js":"^7.19.2","videojs-contrib-hls":"^5.15.0",viewerjs:"^1.10.5","xe-utils":"^3.5.4"},d={name:e,version:"3.1.48-beta.6",private:!0,main:"index.ts",peerDependencies:n,dependencies:a};export{d as default,a as dependencies,s as main,e as name,n as peerDependencies,i as version};
|
|
@@ -21,3 +21,4 @@ declare type UnionToIntersection<T> = (T extends T ? (params: T) => any : never)
|
|
|
21
21
|
export declare type UnionToTuple<T, Result extends unknown[] = []> = UnionToIntersection<T extends any ? () => T : never> extends () => infer Return ? UnionToTuple<Exclude<T, Return>, [Return, ...Result]> : Result;
|
|
22
22
|
export declare type MaybeString<T extends string | number> = T | `${T}`;
|
|
23
23
|
export declare type GetFn<T> = T extends (...args: any[]) => any ? T : never;
|
|
24
|
+
export declare type NumberRange<From extends number, End extends number, Result extends number[] = [], U extends readonly unknown[] = [], Flag = false> = U['length'] extends End ? [...Result, U['length']] : U['length'] extends From ? NumberRange<From, End, [...Result, U['length']], [unknown, ...U], true> : Flag extends true ? NumberRange<From, End, [...Result, U['length']], [unknown, ...U], Flag> : NumberRange<From, End, Result, [unknown, ...U], Flag>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cnhis-design-vue",
|
|
3
|
-
"version": "3.1.48-beta.
|
|
3
|
+
"version": "3.1.48-beta.6",
|
|
4
4
|
"license": "ISC",
|
|
5
5
|
"module": "./es/components/index.js",
|
|
6
6
|
"main": "./es/components/index.js",
|
|
@@ -63,5 +63,5 @@
|
|
|
63
63
|
"iOS 7",
|
|
64
64
|
"last 3 iOS versions"
|
|
65
65
|
],
|
|
66
|
-
"gitHead": "
|
|
66
|
+
"gitHead": "b3e756eea80f47051be6c1d55d8b20f8ecdbc673"
|
|
67
67
|
}
|