cnhis-design-vue 3.1.41-beta.25 → 3.1.41-beta.26
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1 +1 @@
|
|
|
1
|
-
import{useBirthProcessCumputedPoint as t}from"./useCumputedPoint.js";import e from"./useGrid.js";import{drawLine as n,drawArrow as o,drawText as i,defaultTextStyle as r,drawPoint as l,defaultStyle as s,defaultRectStyle as a}from"./useDraw.js";import{fabric as u}from"../utils/index.js";import{getIndex as c,isEffectiveNode as f}from"../utils/utils.js";import{cloneDeep as
|
|
1
|
+
import{useBirthProcessCumputedPoint as t}from"./useCumputedPoint.js";import e from"./useGrid.js";import{drawLine as n,drawArrow as o,drawText as i,defaultTextStyle as r,drawPoint as l,defaultStyle as s,defaultRectStyle as a}from"./useDraw.js";import{fabric as u}from"../utils/index.js";import{getIndex as c,isEffectiveNode as f}from"../utils/utils.js";import{cloneDeep as d}from"lodash-es";import{format as p}from"date-fns";function h(h,g,v,m,y,k){const{cumputedX:w,cumputedY:x,getXValue:b,getYValue:T}=t(g),{getEqualXTypes:j,repeatTip:C}=k,{xAxis:E,grid:P,originX:S,originY:Y,xCellWidth:G,endY:L,startTime:M,leftAddAreaWidth:A,leftScales:X,rightScales:I,yCellHeight:D,endX:H,scaleValues:O,canvasWidth:V,borderStyle:W,rightAddAreaWidth:$,event:R,originYCervix:q,other:z}=g,B=d(O),F=new Set;function J(){B.filter((t=>t.show)).forEach(((t,e)=>{var s;const a=[],u=[],c=[];null==(s=t.data)||s.forEach(((s,f)=>{!function(s,f,d){let p,y;const{pointAttr:k={},lineAttr:w={},title:x="",key:j,type:C="circle",childbirth:E={}}=t,P=t.data[d+1],S=U(P,t);if(s&&S&&!f.breakpoint)y=n([...s,...S],{...w});else if(s&&!S&&!f.breakpoint){const e=U(P,t);y=e?n([...s,...e],{...w}):null}let Y,L;if(f.childbirth){const t=s[1]+D;Y=o([s[0],s[1],t],E.style||{}),c.push(Y),E.text&&(L=i([s[0]+G/2,t-D/2],{value:String(E.text),...r,originX:"left",originY:"center",...E.style||{}}),c.push(L))}const M=u[d-1],A={origin:{data:f,title:x,key:j||"",dataIndex:e,index:d},leftLine:M,rightLine:y,arrowGroup:Y,arrowGroupText:L,...k,...g.event.hovered?g.event.evented?{selectable:!0}:{selectable:!0,lockMovementX:!0,lockMovementY:!0}:g.event};M?p=l(C,{left:M.get("x2"),top:M.get("y2"),...A}):s&&(A.leftLine=null,p=l(C,{left:s[0],top:s[1],...A}));u.push(y),p&&(!function(t){R.hovered&&(t.on("mouseover",(()=>{Q(t)})),t.on("mouseout",(()=>{m.show=!1})));if(t.lockMovementX&&t.lockMovementY)return;t.on("moving",(()=>{N(t),function(t){var e,n,o,i;null==(e=t.leftLine)||e.setCoords().set({x2:t.left,y2:t.top}),null==(n=t.rightLine)||n.setCoords().set({x1:t.left,y1:t.top}),null==(o=t.arrowGroup)||o.setCoords().set({left:t.left,top:t.top}),null==(i=t.arrowGroupText)||i.setCoords().set({left:t.left+G/2,top:t.top+D/2})}(t),R.hovered&&Q(t)})),t.on("mouseup",(e=>{if(m.show=!1,1===e.button){const{key:e}=t.origin,n={...t.origin,data:{...t.origin.data,time:b(t.left),value:T(e,t.top)}};h.value.discardActiveObject(),v("change",n),K(n,"change")}}))}(p),a.push(p),F.add(p))}(U(s,t),s,f)})),Promise.all(a).then((t=>{const e=u.filter((t=>t));let n=null;t=t.filter((t=>(t&&n&&(n.nextPoint=t,t.prevPoint=n),n=t||n,t))),Promise.all(c).then((n=>{h.value.add(...e,...t,...n),t.forEach((t=>{null==t||t.bringToFront()}))}))}))}))}function K(t,e="add"){const{dataIndex:n,data:o,index:i,key:r}=t,l=B.find((t=>t.key===r));switch(e){case"remove":l.data.splice(i,1);break;case"change":l.data[i]=o;break;default:{const t=c(o.time,l.data);l.data.splice(t,0,o);break}}var s;F.size&&(null==(s=h.value)||s.remove(...function(t){const e=[];return t.forEach((t=>{t&&e.push(t),(null==t?void 0:t.leftLine)&&e.push(null==t?void 0:t.leftLine),(null==t?void 0:t.rightLine)&&e.push(null==t?void 0:t.rightLine),(null==t?void 0:t.arrowGroup)&&e.push(null==t?void 0:t.arrowGroup),(null==t?void 0:t.arrowGroupText)&&e.push(null==t?void 0:t.arrowGroupText)})),e}([...F]))),F.clear(),J()}function N(t){const e=t.prevPoint?t.prevPoint.left:S,n=t.nextPoint?t.nextPoint.left:H;t.setCoords(),["cervix","fetalPresentation"].includes(t.origin.key)&&t.top<q&&t.set("top",q),t.top<Y&&t.set("top",Y),t.top>L&&t.set("top",L),t.left<e&&t.set("left",e),t.left>n&&t.set("left",n)}function Q(t){const{title:e,key:n}=t.origin;m.point={x:t.left,y:t.top},m.list=[`${e} ${T(n,t.top)}`,`时间 ${b(t.left).slice(-5)}`],m.show=!0}function U(t,e){if(f(t)&&function(t){const e=M+864e5,n=new Date(t).getTime();return n>=M&&n<=e}(t.time)){const n=w(t.time),o=x(e.key,e.range,t.value);return[n,o<Y?Y:o>L?L:o]}}function Z(t,e){return t+1>e[1]?e[0]:t+1}return e(h,g,!0),function(){const t=new u.Rect({...W,width:V-A-$-1,height:L,left:A,top:0,fill:"transparent"});h.value.add(t)}(),function(){let t=A;[...X,...I].forEach(((e,n)=>{const{range:o,spaceValue:l,width:c,title:f,titleStyle:d,layout:p}=e,g=[];"right"===p&&(t=H);const v=t+c/2,m=function(t,e){const n=[],[o,i]=t;for(let t=o;e>0?t<=i:t>=i;t+=e)n.push(t);return n}(o,l);m.forEach(((t,e)=>{const n=0===e?L-8:L-e*D;g.push(i([v,n],{value:String(t),...r}))}));const y=new u.Rect({...a,width:c,height:L,left:v,top:L/2}),k=Y>0?i([v,Y-D/2],{value:String(f),...r,...d}):null,w=new u.Group([...g,y,...k?[k]:[]],{objectCaching:!1,...s});h.value.add(w),t+=c}))}(),function(){const{show:t,startTime:e,range:n=[0,23],position:o="top",style:l}=E.time,{show:a,range:c=[0,23],style:f}=E.processTime;if(t||a){const d=[],p=[],g=[],v=[],m=S+G/2;for(let s=0;s<P.mainXCell;s++){if(t){const t=0===s?+e.slice(11,13):Z(d.at(-1),n);d.push(t);const a="top"==o?Y-15:L+15;g.push(i([m+s*G,a],{value:String(t),...r,...l||{}}))}if(a){const t=0===s?c[0]:p.at(-1)+1;p.push(t);const e="top"==o?L+15:Y-15;v.push(i([m+s*G,e],{value:String(t),...r,...f||{}}))}}const y=new u.Group([...g,...v],{objectCaching:!1,...s});h.value.add(y),h.value.sendToBack(y)}}(),function(){var t;const e=Object.values(z),o=[],i={},r=B.find((t=>"cervix"===t.key&&t.show)),l=null==(t=null==r?void 0:r.data)?void 0:t.find((t=>3==+t.value));function s(t,e){const{key:n,range:o}=r||{},i=x(n,o,10),l=[0,e],s=[-e/t,0],a=[(L-i-e)/t,L-i],u=[H-S,t*(H-S)+e];let c=[],f=[];function d([n,o]){return Math.abs(o-t*n-e)<=1}function p([t,e]){const[n,o]=[...h([t,e])];return n>=S&&n<=H&&o>=i&&o<=L}function h([t,e]){return[S+t,L-e]}return d(l)&&p(l)&&(c=h(l)),d(s)&&p(s)&&(c=h(s)),d(a)&&p(a)&&(f=h(a)),d(u)&&p(u)&&(f=h(u)),[...c,...f]}e.forEach((t=>{if(!t.show)return;const{key:e}=t;switch(e){case"fetalPresentation":{const{range:i,show:r}=B.find((t=>t.key===e));if(r){const r=x(e,i,0);o.push(n([S,r,H,r],{...t}))}break}case"alert":if(l){const{key:e,range:a}=r||{},u=216e5,c={time:p(new Date(new Date(l.time).getTime()+u),"yyyy-MM-dd HH:mm"),value:10},[f,d]=[w(l.time)-S,L-x(e,a,l.value)],[h,g]=[w(c.time)-S,L-x(e,a,c.value)],v=(g-d)/(h-f),m=d-f*v,y=s(v,m);y.length>0&&(o.push(n(y,{...t})),Object.assign(i,{k:v,b:m}))}break;case"handling":if(l){const{k:e,b:r}=i,a=144e5,u=s(e,r-(w(p(new Date(new Date(l.time).getTime()+a),"yyyy-MM-dd HH:mm"))-w(l.time))*e);u.length>0&&o.push(n(u,{...t}))}}})),h.value.add(...o)}(),J(),function(){function t(t,e){const n=B.findIndex((e=>e.key===t.key));return{renderItem:()=>t.title,origin:{title:t.title,unit:t.unit,dataIndex:n,key:t.key},pointer:e}}g.event.evented&&h.value.on("mouse:up",(e=>{if(3===e.button){const{x:n=0,y:o=0}=e.pointer||{};n>=S&&n<=H&&o>=Y&&o<=L&&(y.point={x:n,y:o},y.show=!0,e.target?(y.target=e.target,y.list=["删除节点"],h.value.forEachObject((t=>{t.origin&&t.left===e.target.left&&t.top===e.target.top&&y.list.push({renderItem:()=>t.origin.title,origin:{...t.origin},mode:"remove",pointer:e.pointer})}))):(y.target=null,y.list=["新增节点"],B.filter((t=>t.show)).forEach((i=>{if(!j(n,"key",G).includes(i.key)){if(["cervix","fetalPresentation"].includes(i.key)&&o<q)return;y.list.push(t(i,e.pointer))}})),1===y.list.length&&(y.show=!1,C(),console.log("当前时间段内无可新增节点"))))}}))}(),function(){const t=V-$/2;function e(t,e){if(!t.length)return;let o=Y;const i=[];t.forEach((t=>{const n=t.title.split("").join("\n"),s=O.findIndex((e=>e.key===t.key)),a=new u.Text(String(n),{...r,...t.titleStyle||{},originY:"top",left:e,top:o,lineHeight:1}),c=l(t.type,{left:e,top:o+a.height+3,...t.pointAttr,originY:"top",origin:{title:t.title,unit:t.unit,type:t.type,dataIndex:s,key:t.key,isMenu:!0},originLeft:e,originTop:o+a.height+3,...g.event});o+=a.height+c.height+15,function(t){function e(t){const{left:e,top:n}=t;return e>=S&&e<=H&&n>=Y&&n<=L}t.on("moving",(()=>{t.set("originY","center"),e(t)?(N(t),Q(t)):m.show=!1})),t.on("mouseup:before",(n=>{if(m.show=!1,0===n.e.button&&e(t))if(j(t.left,"key",G).includes(t.origin.key))C();else{const e={data:{time:b(t.left),value:T(t.origin.key,t.top)},...t.origin};v("add",e),K(e)}!function(t){t.setCoords().set({originY:"top",left:t.originLeft,top:t.originTop})}(t)}))}(c),i.push(a,c)})),n(i),h.value.add(...i)}function n(t){const e=t.at(-1),n=(L-Y)/2,o=(e.height+e.top-Y)/2;t.forEach((t=>{const e=t.top+n-o;t.set({top:e,originTop:e})}))}e(X,A/2),e(I,t)}(),{clickMenu:function({item:t,target:e}){const n={...t.origin};"remove"===t.mode?(v("remove",n),K(n,"remove")):(Object.assign(n,{data:{time:b(t.pointer.x),value:T(t.origin.key,t.pointer.y)}}),v("add",n),K(n))}}}export{h as useBirthProcess};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{ref as e,reactive as a,computed as l,onMounted as t,nextTick as u}from"vue";import{defaultBorderStyle as r}from"./useDraw.js";import"date-fns";import"../utils/index.js";import"lodash-es";import"./useShadow.js";import{useEvent as i,useCanvasEvent as s}from"./useEvent.js";import{useBirthProcess as n}from"./useBirthProcess.js";import{useCommon as d}from"./useCommon.js";function o(o,v,c,h){const m=e(),p=e(),g=e(),f=a({show:!1,point:{x:0,y:0},list:[]}),x=a({show:!1,point:{x:0,y:0},list:[],target:null}),
|
|
1
|
+
import{ref as e,reactive as a,computed as l,onMounted as t,nextTick as u}from"vue";import{defaultBorderStyle as r}from"./useDraw.js";import"date-fns";import"../utils/index.js";import"lodash-es";import"./useShadow.js";import{useEvent as i,useCanvasEvent as s}from"./useEvent.js";import{useBirthProcess as n}from"./useBirthProcess.js";import{useCommon as d}from"./useCommon.js";function o(o,v,c,h){const m=e(),p=e(),g=e(),f=a({show:!1,point:{x:0,y:0},list:[]}),x=a({show:!1,point:{x:0,y:0},list:[],target:null}),w=l((()=>v.data.scaleValues.filter((e=>"left"===e.layout&&e.show)))),y=l((()=>v.data.scaleValues.filter((e=>"right"===e.layout&&e.show)))),V=l((()=>{var e;return(null==(e=y.value)?void 0:e.length)?30:0})),C=l((()=>{var e;return 30+(null==(e=w.value)?void 0:e.reduce(((e,a)=>e+=a.width),0))})),A=l((()=>{var e;const{width:a}=v.data,l=null==(e=y.value)?void 0:e.reduce(((e,a)=>e+=a.width),0);return a-V.value-l})),Y=l((()=>v.data.grid.mainXCell)),j=l((()=>v.data.grid.mainYCell)),S=l((()=>(A.value-C.value)/Y.value)),b=l((()=>{const{xAxis:e,height:a}=v.data,l=Object.values(e).reduce(((e,a)=>(a.show&&e++,e)),0);return a/(j.value+l)})),k=l((()=>b.value)),P=l((()=>{const{scaleValues:e}=v.data,a=e.find((e=>"cervix"===e.key)),[,l]=(null==a?void 0:a.range)||[0,10],t=(null==a?void 0:a.spaceValue)||1;return X.value-l*t*b.value})),X=l((()=>{const{height:e}=v.data;return e-b.value})),H=l((()=>new Date(v.data.xAxis.time.startTime).getTime())),T=l((()=>36e5/S.value)),W=l((()=>{const{scaleValues:e}=v.data,a=e.find((e=>"cervix"===e.key));return((null==a?void 0:a.spaceValue)||1)/b.value})),M=l((()=>{const{scaleValues:e}=v.data,a=e.find((e=>"FHR"===e.key));return((null==a?void 0:a.spaceValue)||10)/b.value})),D=l((()=>{const{scaleValues:e}=v.data,a=e.find((e=>"fetalPresentation"===e.key));return((null==a?void 0:a.spaceValue)||1)/b.value})),F=l((()=>{var e;return(null==(e=v.data.grid)?void 0:e.event)||{selectable:!0,evented:!0,hovered:!0}})),N=a({canvasWidth:v.data.width,canvasHeight:v.data.height,borderStyle:{...r,...v.data.borderStyle},selectionStyle:v.data.selectionStyle||{},grid:v.data.grid,other:v.data.other,originX:C.value,endX:A.value,originY:k.value,endY:X.value,xCellWidth:S.value,yCellHeight:b.value,gridXNumber:Y.value,gridYNumber:j.value,xAxis:v.data.xAxis,leftScales:w.value,rightScales:y.value,leftAddAreaWidth:30,rightAddAreaWidth:V.value,startTime:H.value,timeXCell:T.value,cervixYCell:W.value,FHRYCell:M.value,fetalPresentationYCell:D.value,scaleValues:v.data.scaleValues,event:F.value,originYCervix:P.value}),R=d(o);return t((()=>{u((()=>{const{clickMenu:e}=n(o,N,c,f,x,R);g.value=e,i(h.value);const{select:a}=s(o,N,c);m.value=a}))})),{propItems:N,redrawPoints:p,select:m,pointTipProps:f,pointMenuProps:x,clickMenu:g}}export{o as default};
|
package/package.json
CHANGED
|
@@ -1,65 +1,65 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "cnhis-design-vue",
|
|
3
|
-
"version": "3.1.41-beta.
|
|
4
|
-
"license": "ISC",
|
|
5
|
-
"module": "./es/components/index.js",
|
|
6
|
-
"main": "./es/components/index.js",
|
|
7
|
-
"types": "./es/components/index.d.ts",
|
|
8
|
-
"sideEffects": [
|
|
9
|
-
"es/components/**/style/*",
|
|
10
|
-
"es/components/*(.css,.less)"
|
|
11
|
-
],
|
|
12
|
-
"files": [
|
|
13
|
-
"es",
|
|
14
|
-
"README.md"
|
|
15
|
-
],
|
|
16
|
-
"peerDependencies": {
|
|
17
|
-
"naive-ui": "^2.30.0",
|
|
18
|
-
"vue": "^3.2.0",
|
|
19
|
-
"vxe-table": "^4.2.5"
|
|
20
|
-
},
|
|
21
|
-
"dependencies": {
|
|
22
|
-
"@formily/core": "2.1.9",
|
|
23
|
-
"@formily/path": "2.1.9",
|
|
24
|
-
"@formily/reactive": "2.1.9",
|
|
25
|
-
"@formily/vue": "2.1.9",
|
|
26
|
-
"@vicons/ionicons5": "^0.12.0",
|
|
27
|
-
"@vueuse/core": "^8.6.0",
|
|
28
|
-
"@vueuse/shared": "^8.6.0",
|
|
29
|
-
"@wangeditor/editor": "^5.1.1",
|
|
30
|
-
"@wangeditor/editor-for-vue": "^5.1.11",
|
|
31
|
-
"axios": "^0.27.2",
|
|
32
|
-
"bpmn-js": "^9.2.2",
|
|
33
|
-
"bpmnlint-utils": "^1.0.2",
|
|
34
|
-
"date-fns": "^2.29.1",
|
|
35
|
-
"diagram-js": "^8.7.1",
|
|
36
|
-
"ids": "^1.0.0",
|
|
37
|
-
"inherits": "^2.0.4",
|
|
38
|
-
"lodash": "^4.17.21",
|
|
39
|
-
"lodash-es": "^4.17.21",
|
|
40
|
-
"lodash-unified": "^1.0.2",
|
|
41
|
-
"min-dash": "^3.8.1",
|
|
42
|
-
"min-dom": "^3.2.1",
|
|
43
|
-
"moment": "^2.29.1",
|
|
44
|
-
"naive-ui": "^2.30.0",
|
|
45
|
-
"sortablejs": "^1.15.0",
|
|
46
|
-
"spark-md5": "^3.0.2",
|
|
47
|
-
"tiny-svg": "^2.2.4",
|
|
48
|
-
"v-viewer": "^3.0.10",
|
|
49
|
-
"video.js": "^7.19.2",
|
|
50
|
-
"videojs-contrib-hls": "^5.15.0",
|
|
51
|
-
"viewerjs": "^1.10.5",
|
|
52
|
-
"vue": "^3.2.0",
|
|
53
|
-
"vue-simple-uploader": "^1.0.0-beta.5",
|
|
54
|
-
"xe-utils": "^3.5.4"
|
|
55
|
-
},
|
|
56
|
-
"browserslist": [
|
|
57
|
-
"defaults",
|
|
58
|
-
"not ie < 8",
|
|
59
|
-
"last 2 versions",
|
|
60
|
-
"> 1%",
|
|
61
|
-
"iOS 7",
|
|
62
|
-
"last 3 iOS versions"
|
|
63
|
-
],
|
|
64
|
-
"gitHead": "
|
|
65
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "cnhis-design-vue",
|
|
3
|
+
"version": "3.1.41-beta.26",
|
|
4
|
+
"license": "ISC",
|
|
5
|
+
"module": "./es/components/index.js",
|
|
6
|
+
"main": "./es/components/index.js",
|
|
7
|
+
"types": "./es/components/index.d.ts",
|
|
8
|
+
"sideEffects": [
|
|
9
|
+
"es/components/**/style/*",
|
|
10
|
+
"es/components/*(.css,.less)"
|
|
11
|
+
],
|
|
12
|
+
"files": [
|
|
13
|
+
"es",
|
|
14
|
+
"README.md"
|
|
15
|
+
],
|
|
16
|
+
"peerDependencies": {
|
|
17
|
+
"naive-ui": "^2.30.0",
|
|
18
|
+
"vue": "^3.2.0",
|
|
19
|
+
"vxe-table": "^4.2.5"
|
|
20
|
+
},
|
|
21
|
+
"dependencies": {
|
|
22
|
+
"@formily/core": "2.1.9",
|
|
23
|
+
"@formily/path": "2.1.9",
|
|
24
|
+
"@formily/reactive": "2.1.9",
|
|
25
|
+
"@formily/vue": "2.1.9",
|
|
26
|
+
"@vicons/ionicons5": "^0.12.0",
|
|
27
|
+
"@vueuse/core": "^8.6.0",
|
|
28
|
+
"@vueuse/shared": "^8.6.0",
|
|
29
|
+
"@wangeditor/editor": "^5.1.1",
|
|
30
|
+
"@wangeditor/editor-for-vue": "^5.1.11",
|
|
31
|
+
"axios": "^0.27.2",
|
|
32
|
+
"bpmn-js": "^9.2.2",
|
|
33
|
+
"bpmnlint-utils": "^1.0.2",
|
|
34
|
+
"date-fns": "^2.29.1",
|
|
35
|
+
"diagram-js": "^8.7.1",
|
|
36
|
+
"ids": "^1.0.0",
|
|
37
|
+
"inherits": "^2.0.4",
|
|
38
|
+
"lodash": "^4.17.21",
|
|
39
|
+
"lodash-es": "^4.17.21",
|
|
40
|
+
"lodash-unified": "^1.0.2",
|
|
41
|
+
"min-dash": "^3.8.1",
|
|
42
|
+
"min-dom": "^3.2.1",
|
|
43
|
+
"moment": "^2.29.1",
|
|
44
|
+
"naive-ui": "^2.30.0",
|
|
45
|
+
"sortablejs": "^1.15.0",
|
|
46
|
+
"spark-md5": "^3.0.2",
|
|
47
|
+
"tiny-svg": "^2.2.4",
|
|
48
|
+
"v-viewer": "^3.0.10",
|
|
49
|
+
"video.js": "^7.19.2",
|
|
50
|
+
"videojs-contrib-hls": "^5.15.0",
|
|
51
|
+
"viewerjs": "^1.10.5",
|
|
52
|
+
"vue": "^3.2.0",
|
|
53
|
+
"vue-simple-uploader": "^1.0.0-beta.5",
|
|
54
|
+
"xe-utils": "^3.5.4"
|
|
55
|
+
},
|
|
56
|
+
"browserslist": [
|
|
57
|
+
"defaults",
|
|
58
|
+
"not ie < 8",
|
|
59
|
+
"last 2 versions",
|
|
60
|
+
"> 1%",
|
|
61
|
+
"iOS 7",
|
|
62
|
+
"last 3 iOS versions"
|
|
63
|
+
],
|
|
64
|
+
"gitHead": "ee7bdd7fa3e1aa3be91959e95c3be3ae2d26db0b"
|
|
65
|
+
}
|