cnhis-design-vue 3.2.16-beta.8 → 3.2.17-beta.2
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/button-print/src/components/NewPrintComponent.vue2.js +1 -1
- package/es/components/expand-field/index.d.ts +28 -1
- package/es/components/expand-field/src/components/FormItemPerson.vue.d.ts +28 -1
- package/es/components/expand-field/src/components/PersonModal.vue.d.ts +28 -1
- package/es/components/expand-field/src/components/form.vue.d.ts +28 -1
- package/es/components/expand-field/src/index.vue.d.ts +28 -1
- package/es/components/fabric-chart/src/hooks/birthProcess/useBirthProcess.js +1 -1
- package/es/components/fabric-chart/src/hooks/temperature/useCenter.js +1 -1
- package/es/components/fabric-chart/src/hooks/temperature/useTemperatureChart.js +1 -1
- package/es/components/fabric-chart/src/hooks/useGrid.js +1 -1
- package/es/components/fabric-chart/src/interface.d.ts +1 -0
- package/es/components/field-set/src/FieldColor.vue.d.ts +1 -1
- package/es/components/field-set/src/FieldFilter.vue.d.ts +1 -1
- package/es/components/field-set/src/FieldSet.vue.d.ts +1 -1
- package/es/components/field-set/src/components/table-row.vue.d.ts +1 -1
- package/es/components/form-config/index.d.ts +147 -24
- package/es/components/form-config/src/FormConfig.vue.d.ts +147 -24
- package/es/components/form-config/src/FormConfig.vue2.js +1 -1
- package/es/components/form-config/src/components/FormConfigEdit.vue.d.ts +8 -0
- package/es/components/form-config/src/components/FormConfigEventSetting.vue.d.ts +210 -95
- package/es/components/form-config/src/components/FormConfigEventSetting.vue2.js +1 -1
- package/es/components/form-render/src/components/renderer/formItem.js +1 -1
- package/es/components/form-render/src/components/renderer/text.js +1 -1
- package/es/components/form-render/src/hooks/useFieldNormalize.js +1 -1
- package/es/components/form-render/src/types/fieldItem.d.ts +3 -1
- package/es/components/iho-chat/index.d.ts +321 -365
- package/es/components/iho-chat/src/Index.vue.d.ts +321 -365
- package/es/components/iho-chat/src/Index.vue2.js +1 -1
- package/es/components/iho-chat/src/components/ChatAdd.vue.d.ts +9 -0
- package/es/components/iho-chat/src/components/ChatFile.vue.d.ts +18 -0
- package/es/components/iho-chat/src/components/ChatFooter.vue.d.ts +18 -0
- package/es/components/iho-chat/src/components/ChatHeader.vue.d.ts +65 -182
- package/es/components/iho-chat/src/components/ChatHeader.vue2.js +1 -1
- package/es/components/iho-chat/src/components/ChatMain.vue.d.ts +94 -182
- package/es/components/iho-chat/src/components/ChatMain.vue2.js +1 -1
- package/es/components/iho-chat/src/components/ChatRecord.vue.d.ts +9 -0
- package/es/components/iho-chat/src/components/ChatSearch.vue.d.ts +37 -20
- package/es/components/iho-chat/src/components/ChatSearch.vue2.js +1 -1
- package/es/components/iho-chat/src/components/ChatSet.vue.d.ts +19 -91
- package/es/components/iho-chat/src/components/ChatSet.vue2.js +1 -1
- package/es/components/iho-chat/src/components/MessageEvent.vue.d.ts +10 -91
- package/es/components/iho-chat/src/components/MessageEvent.vue2.js +1 -1
- package/es/components/iho-chat/src/components/MultipleVideo.vue.d.ts +18 -0
- package/es/components/iho-chat/src/components/PersonProfile.vue.d.ts +12 -46
- package/es/components/iho-chat/src/components/PersonProfile.vue2.js +1 -1
- package/es/components/iho-chat/src/components/SelectLabel.vue.d.ts +54 -0
- package/es/components/iho-chat/src/components/SelectLabel.vue.js +1 -0
- package/es/components/iho-chat/src/components/SelectLabel.vue2.js +1 -0
- package/es/components/iho-chat/src/components/SiderList.vue.d.ts +9 -0
- package/es/components/iho-chat/src/components/Video.vue.d.ts +9 -0
- package/es/components/iho-chat/src/hooks/useData.d.ts +30 -0
- package/es/components/iho-chat/src/hooks/useData.js +1 -1
- package/es/components/iho-chat/src/hooks/useVideo.d.ts +9 -0
- package/es/components/iho-chat/src/types/index.d.ts +9 -0
- package/es/components/iho-chat/style/index.css +1 -1
- package/es/components/iho-table/src/plugins/filterTextPlugin/filter.vue.d.ts +1 -0
- package/es/components/iho-table/src/plugins/filterTextPlugin/filter.vue2.js +1 -1
- package/es/components/iho-table/src/types/index.d.ts +3 -0
- package/es/components/index.css +1 -1
- package/es/components/select-person/index.d.ts +28 -1
- package/es/components/select-person/src/SelectPerson.vue.d.ts +15 -1
- package/es/components/select-person/src/SelectPerson.vue2.js +1 -1
- package/es/components/select-person/src/index.vue.d.ts +28 -1
- package/es/components/select-person/src/index.vue2.js +1 -1
- package/es/components/shortcut-setter/index.d.ts +2 -0
- package/es/components/shortcut-setter/src/ShortcutSetter.vue.d.ts +2 -0
- package/es/shared/package.json.js +1 -1
- package/package.json +2 -2
@@ -1 +1 @@
|
|
1
|
-
import{fabric as e}from"../../../../../shared/utils/fabricjs/index.js";import{drawLine as t,drawArrow as o,drawPoint as n,defaultStyle as i,drawText as r,defaultTextStyle as l,drawTextAndIconGroup as s,defaultRectStyle as a}from"../useDraw.js";import{useGrid as c}from"../useGrid.js";import{useBirthProcessCumputedPoint as u}from"../useCumputedPoint.js";import"../useEvent.js";import"../useShadow.js";import{getScaleInfo as d,drawScaleNumber as h,drawScaleLine as f}from"../useScaleColumn.js";import{useCommon as p}from"../useCommon.js";import"vue";import{getIndex as g,isEffectiveNode as v,getTime as m,getScaleNumberList as y}from"../../utils/index.js";import{cloneDeep as b,last as w,range as j}from"lodash-es";import"../../constants/index.js";import"@vueuse/shared";import{format as k}from"date-fns";import"naive-ui";import"../surgicalAnesthesia/useTop.js";import"@vueuse/core";import"../surgicalAnesthesia/useOther.js";import"../../../../../shared/utils/index.js";function x(x,S,C,P,A){const{computedX:E,computedY:O,getXValue:X,getYValue:L}=u(S),{getEqualXTypes:M,handleAddPrevent:Y,isGridLimit:T,setPrevAndNextPoint:H,getPointEventProps:I}=p(x,C,S),{xAxis:D,grid:B,originX:G,originY:N,xCellWidth:W,endY:V,startTime:F,leftAddAreaWidth:R,leftScales:$,rightScales:q,yCellHeight:z,endX:J,scaleValues:K,canvasWidth:Q,borderStyle:U,rightAddAreaWidth:Z,event:_,originYCervix:ee,other:te,canvasHeight:oe,scalebarBorder:ne,padding:ie}=S,re=b(K),le=new Set;function se(){re.filter((({showData:e=!0})=>e)).forEach(((e,s)=>{var a;const c=[],u=[],d=[],{pointAttr:h={},lineAttr:f={},title:p="",key:g,type:v="circle",childbirthStyle:m={},surgicalDeliveryStyle:y={},dystociaStyle:b={}}=e;function w(r,l,s,a){if(l[s]){const{type:c="circle",style:u={},arrowStyle:h={}}=e[s+"Style"],p=E(l[s]),g=t([...r,p,r[1]],{...f,strokeDashArray:[4,2],...i}),v="dystocia"===s&&r[1]-N>=z?r[1]-z:r[1],m=n(c,{left:p,top:v,...u,...i}),y=v+m.height/2,b="dystocia"===s?o([p,y+z,y],f,"up"):null;g&&(d.push(g),a[s+"Line"]={obj:g,type:"line",left:p-r[0]}),m&&(d.push(m),a[s]={obj:m,left:p-r[0]}),b&&(d.push(b),a[s+"Arrow"]={obj:b,left:p-r[0],moveHide:!0})}}null==(a=e.data)||a.forEach(((a,y)=>{!function(a,y,b){let j,S;const A=e.data[b+1],E=he(A,e);if(a&&E&&!y.breakpoint)S=t([...a,...E],{...f});else if(a&&!E&&!y.breakpoint){const o=he(A,e);S=o?t([...a,...o],{...f}):null}const O={};if(["fetalPresentation","cervix"].includes(g)){let e,t;if(y.childbirth){const{type:s="arrow",style:c={},textStyle:u={}}=m;if("arrow"===s){const t=a[1]+z;e=o([a[0],a[1],t],c)}else e=n(s,{left:a[0],top:a[1],...c,...i,hoverCursor:"default"});t=r([a[0]+W/2,a[1]+z/2],{value:String(y.childbirth),...l,originX:"left",originY:"center",...u}),e&&(d.push(e),Object.assign(O,{childbirthIcon:{obj:e,type:s}})),t&&(d.push(t),Object.assign(O,{childbirthText:{obj:t,left:W/2,top:z/2}}))}}"fetalPresentation"===g&&(w(a,y,"surgicalDelivery",O),w(a,y,"dystocia",O));const M=u[b-1],Y={origin:{data:y,title:p,key:g||"",dataIndex:s,index:b},leftLine:M,rightLine:S,otherObj:O,...h,...I()};a&&(M||(Y.leftLine=null),j=n(v,{left:a[0],top:a[1],...Y}));u.push(S),j&&(!function(e){_.hovered&&(e.on("mouseover",(()=>{de(e,"hover")})),e.on("mouseout",(()=>{P.show=!1})));if(e.lockMovementX&&e.lockMovementY)return;e.on("moving",(()=>{ue(e),function(e){var t,o;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}),Object.values(e.otherObj).forEach((t=>{const{obj:o,top:n=0,left:i=0,type:r="",moveHide:l}=t||{};o&&("line"===r?o.setCoords().set({x1:e.left,y1:e.top,x2:e.left+i,y2:e.top}):o.setCoords().set({left:e.left+i,top:e.top+n}),l&&(x.value.remove(o),delete e.otherObj.obj))}))}(e),_.hovered&&de(e)})),e.on("mouseup",(t=>{if(P.show=!1,1===t.button){const{key:t}=e.origin,o={...e.origin,data:{...e.origin.data,time:X(e.left),value:L(t,e.top)}};["surgicalDelivery","dystocia"].some((t=>{var n;(null==(n=e.otherObj[t])?void 0:n.obj)&&(o.data[t]=k(new Date(X(e.left+e.otherObj[t].left)),"yyyy-MM-dd HH:mm"))})),x.value.discardActiveObject(),C("change",o),ae(o,"change")}}))}(j),c.push(j),le.add(j))}(he(a,e),a,y)})),Promise.all(c).then((e=>{const t=u.filter((e=>e));H(e),Promise.all(d).then((o=>{x.value.add(...t,...e,...o),e.forEach((e=>{null==e||e.bringToFront();const{childbirthIcon:t}=e.otherObj||{};(null==t?void 0:t.obj)&&"arrow"!==(null==t?void 0:t.type)&&t.obj.bringToFront()}))}))}))}))}function ae(e,t="add"){const{dataIndex:o,data:n,index:i,key:r}=e,l=re.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}}ce()}function ce(){var e;le.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),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}([...le]))),le.clear(),se()}function ue(e){const t=e.prevPoint?e.prevPoint.left:G,o=e.nextPoint?e.nextPoint.left:J;e.setCoords(),["cervix","fetalPresentation"].includes(e.origin.key)&&e.top<ee&&e.set("top",ee),e.top<N&&e.set("top",N),e.top>V&&e.set("top",V),e.left<t&&e.set("left",t),e.left>o&&e.set("left",o)}function de(e,t="moving"){const{title:o,key:n,data:i}=e.origin;P.point={x:e.left,y:e.top},P.list=[`${o} ${"hover"===t?i.value:L(n,e.top)}`,`时间 ${X(e.left).slice(-5)}`],P.show=!0}function he(e,t){if(v(e)&&function(e){const t=F+864e5,o=m(e);return o>=F&&o<=t}(e.time)){const o=E(e.time),n=O(t.key,t.range,e.value);return[o,n<N?N:n>V?V:n]}}function fe(e,t){return e+1>t[1]?t[0]:e+1}return c(x,S),function(){const t=ne?{width:Q-R-Z-1,left:R}:{width:J-G-(q.length?0:1),left:G},o=new e.Rect({...U,height:V-ie[0]-1,top:ie[0],fill:"transparent",...t});x.value.add(o)}(),function(){function t(t,o="left"){let n="left"===o?R:J;t.forEach(((t,o)=>{const{range:s,spaceValue:c,width:u,title:p,titleStyle:g,key:v,position:m="center",spaceGridNumber:b=1,showNumber:w=!0,showMaxMinNumber:j=!0,showName:k=!0}=t,S=[],C=[],P=n+u/2,A=y(s,c),E=A.length,{lineXMain:O,lineXSub:X,textLeft:L}=d(m,n,u);A.forEach(((e,o)=>{const n=V-o*z*b,i=0===o?V-8:o!==A.length-1||!ie[0]||ee&&"FHR"!==v?n:N+8;!w||(0===o||o===E-1)&&!j||S.push(h(String(e),t,L,i)),C.push(...f(t,o,O,X,n,z,N,E,1))}));const M=[],Y=ne?new e.Rect({...a,strokeWidth:.5,width:u,height:V-ie[0],left:P,top:ie[0]+(V-ie[0])/2}):null;if(Y&&M.push(Y),k){const e=r([P,N-ie[0]>0?N-z/2:z/2],{value:String(p),...l,...g});e&&M.push(e)}const T=new e.Group([...C,...S,...M],{objectCaching:!1,...i});x.value.add(T),T.sendToBack(),n+=u}))}t($),t(q,"right")}(),function(){const{show:t,startTime:o,range:n=[0,23],position:s="top",style:a}=D.time,{show:c,range:u=[0,23],position:d,style:h={}}=D.processTime;if(t||c){const f=[],p=j(u[0],u[1]+1),g=[],v=[],m=z/2;for(let e=0;e<B.mainXCell;e++){if(t){const{textAlign:t="center"}=a,i=G+("center"===t?W/2:0),c=0===e&&"center"!==t?i+5:i,u=0===e?+o.slice(11,13):fe(w(f),n);f.push(u);const d="top"===s?N-m:V+m;g.push(r([c+e*W,d],{value:String(u),...l,...a})),e===B.mainXCell-1&&"center"!==t&&g.push(r([J-1,d],{value:String(fe(w(f),n)),...l,...a,originX:"center"!==t?"right":"center"}))}if(c&&e<=p.length){const{textAlign:t="center"}=h,o=G+("center"===t?W/2:0),n=0===e&&"center"!==t?o+5:o,i="top"===d?m:oe-m;v.push(r([n+e*W,i],{value:String(p[e]),...l,...h})),e===B.mainXCell-1&&"center"!==t&&v.push(r([J-1,i],{value:String(w(p)),...l,...a,originX:"center"!==t?"right":"center"}))}}const y=new e.Group([...g,...v],{objectCaching:!1,...i});x.value.add(y),x.value.sendToBack(y)}}(),function(){var e;const o=Object.values(te),n=[],i={},r=re.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=O(o,n,10),l=[0,t],s=[-t/e,0],a=[(V-i-t)/e,V-i],c=[J-G,e*(J-G)+t];let u=[],d=[];function h([o,n]){return Math.abs(n-e*o-t)<=1}function f([e,t]){const[o,n]=[...p([e,t])];return o>=G&&o<=J&&n>=i&&n<=V}function p([e,t]){return[G+e,V-t]}return h(l)&&f(l)&&(u=p(l)),h(s)&&f(s)&&(u=p(s)),h(a)&&f(a)&&(d=p(a)),h(c)&&f(c)&&(d=p(c)),[...u,...d]}o.forEach((e=>{if(!e.show)return;const{key:o}=e;switch(o){case"fetalPresentation":{const{range:i,show:r}=re.find((e=>e.key===o));if(r){const r=O(o,i,0);n.push(t([G,r,J,r],{...e}))}break}case"alert":if(l){const{key:o,range:a}=r||{},c=216e5,u={time:k(new Date(m(l.time)+c),"yyyy-MM-dd HH:mm"),value:10},[d,h]=[E(l.time)-G,V-O(o,a,l.value)],[f,p]=[E(u.time)-G,V-O(o,a,u.value)],g=(p-h)/(f-d),v=h-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,c=s(o,r-(E(k(new Date(m(l.time)+a),"yyyy-MM-dd HH:mm"))-E(l.time))*o);c.length>0&&n.push(t(c,{...e}))}}})),x.value.add(...n)}(),se(),function(){function e(e,t){const o=re.findIndex((t=>t.key===e.key));return{renderItem:()=>e.title,origin:{title:e.title,unit:e.unit,dataIndex:o,key:e.key},pointer:t}}S.event.evented&&x.value.on("mouse:up",(t=>{var o,n;if(3===t.button){const{x:i=0,y:r=0}=t.pointer||{};i>=G&&i<=J&&r>=N&&r<=V&&(A.point={x:i,y:r},A.show=!0,t.target?(A.target=t.target,A.list=[(null==(n=window.getLanguageByCode)?void 0:n.call(window,"10010.1.220"))||"删除节点"],[...le].forEach((e=>{e.origin&&e.left===t.target.left&&e.top===t.target.top&&A.list.push({renderItem:()=>e.origin.title,origin:{...e.origin},mode:"remove",pointer:t.pointer})}))):(A.target=null,A.list=[(null==(o=window.getLanguageByCode)?void 0:o.call(window,"10010.1.219"))||"新增节点"],re.filter((e=>e.show)).forEach((o=>{if(!M([...le],i,"key").includes(o.key)){if(["cervix","fetalPresentation"].includes(o.key)&&r<ee)return;A.list.push(e(o,t.pointer))}})),1===A.list.length&&(A.show=!1,Y("repeat"),console.log("当前时间段内无可新增节点"))))}}))}(),function(){const e=Q-Z/2;function t(e,t){if(!e.length)return;let n=N;const i=[];e.forEach((e=>{const o=(e.alias||e.title).split("").join("\n"),a=K.findIndex((t=>t.key===e.key));if(e.alias){const s=r([t,n],{value:o,...l,originY:"top",...e.titleStyle});o&&(n+=s.height+15,i.push(s))}else{const{text:r,icon:l}=s(o,e,{text:{originX:"center",originY:"top",left:t,top:n},icon:{left:t,topY:n,originX:"center",originY:"top",origin:{type:e.type,dataIndex:a},...S.event}},"vertical");n+=r.height+l.height+15,(c=l).on("moving",(()=>{c.set("originY","center"),T(c)?(ue(c),de(c)):P.show=!1})),c.on("mouseup:before",(e=>{if(P.show=!1,0===e.e.button&&T(c))if(M([...le],c.left,"key").includes(c.origin.key))Y("repeat");else{const e={data:{time:X(c.left),value:L(c.origin.key,c.top)},...c.origin};C("add",e),ae(e)}!function(e){e.setCoords().set({originY:"top",left:e.originLeft,top:e.originTop})}(c)})),i.push(r,l)}var c})),o(i),x.value.add(...i)}function o(e){const t=w(e),o=(V-N)/2,n=(t.height+t.top-N)/2;e.forEach((e=>{const t=e.top+o-n;e.set({top:t,originTop:t})}))}t($,R/2),t(q,e)}(),{clickMenu:function({item:e,target:t}){const o={...e.origin};"remove"===e.mode?(C("remove",o),ae(o,"remove")):(Object.assign(o,{data:{time:X(e.pointer.x),value:L(e.origin.key,e.pointer.y)}}),C("add",o),ae(o))},redrawPoints:ce}}export{x as useBirthProcess};
|
1
|
+
import{fabric as e}from"../../../../../shared/utils/fabricjs/index.js";import{drawLine as t,drawArrow as i,drawPoint as n,defaultStyle as o,drawText as r,defaultTextStyle as l,drawTextAndIconGroup as s,defaultRectStyle as a}from"../useDraw.js";import{useGrid as c}from"../useGrid.js";import{useBirthProcessCumputedPoint as u}from"../useCumputedPoint.js";import"../useEvent.js";import"../useShadow.js";import{getScaleInfo as d,drawScaleNumber as h,drawScaleLine as f}from"../useScaleColumn.js";import{useCommon as p}from"../useCommon.js";import"vue";import{getIndex as g,isEffectiveNode as v,getTime as m,getScaleNumberList as y}from"../../utils/index.js";import{cloneDeep as b,isString as w,last as j,range as k}from"lodash-es";import"../../constants/index.js";import"@vueuse/shared";import{format as x}from"date-fns";import"naive-ui";import"../surgicalAnesthesia/useTop.js";import"@vueuse/core";import"../surgicalAnesthesia/useOther.js";import"../../../../../shared/utils/index.js";function S(S,C,A,E,O){const{computedX:P,computedY:X,getXValue:L,getYValue:M}=u(C),{getEqualXTypes:Y,handleAddPrevent:T,isGridLimit:H,setPrevAndNextPoint:I,getPointEventProps:D}=p(S,A,C),{xAxis:B,grid:G,originX:N,originY:W,xCellWidth:V,endY:F,startTime:R,leftAddAreaWidth:$,leftScales:q,rightScales:z,yCellHeight:J,endX:K,scaleValues:Q,canvasWidth:U,borderStyle:Z,rightAddAreaWidth:_,event:ee,originYCervix:te,other:ie,canvasHeight:ne,scalebarBorder:oe,padding:re}=C,le=b(Q),se=new Set;function ae(){le.filter((({showData:e=!0})=>e)).forEach(((e,s)=>{var a;const c=[],u=[],d=[],{pointAttr:h={},lineAttr:f={},title:p="",key:g,type:v="circle",childbirthStyle:m={},surgicalDeliveryStyle:y={},dystociaStyle:b={}}=e;function j(r,l,s,a){if(l[s]){const{type:c="circle",style:u={},arrowStyle:h={}}=e[s+"Style"],p=P(l[s]),g=t([...r,p,r[1]],{...f,strokeDashArray:[4,2],...o}),v="dystocia"===s&&r[1]-W>=J?r[1]-J:r[1],m=n(c,{left:p,top:v,...u,...o}),y=v+m.height/2,b="dystocia"===s?i([p,y+J,y],f,"up"):null;g&&(d.push(g),a[s+"Line"]={obj:g,type:"line",left:p-r[0]}),m&&(d.push(m),a[s]={obj:m,left:p-r[0]}),b&&(d.push(b),a[s+"Arrow"]={obj:b,left:p-r[0],moveHide:!0})}}null==(a=e.data)||a.forEach(((a,y)=>{!function(a,y,b){let k,C;const O=e.data[b+1],P=fe(O,e);if(a&&P&&!y.breakpoint)C=t([...a,...P],{...f});else if(a&&!P&&!y.breakpoint){const i=fe(O,e);C=i?t([...a,...i],{...f}):null}const X={};if(["fetalPresentation","cervix"].includes(g)){let e,t;if(y.childbirth){const{type:s="arrow",style:c={},textStyle:u={}}=m;if("arrow"===s){const t=a[1]+J;e=i([a[0],a[1],t],c)}else e=n(s,{left:a[0],top:a[1],...c,...o,hoverCursor:"default"});t=w(y.childbirth)?r([a[0]+V/2,a[1]+J/2],{value:String(y.childbirth),...l,originX:"left",originY:"center",...u}):null,e&&(d.push(e),Object.assign(X,{childbirthIcon:{obj:e,type:s}})),t&&(d.push(t),Object.assign(X,{childbirthText:{obj:t,left:V/2,top:J/2}}))}}"fetalPresentation"===g&&(j(a,y,"surgicalDelivery",X),j(a,y,"dystocia",X));const Y=u[b-1],T={origin:{data:y,title:p,key:g||"",dataIndex:s,index:b},leftLine:Y,rightLine:C,otherObj:X,...h,...D()};a&&(Y||(T.leftLine=null),k=n(v,{left:a[0],top:a[1],...T}));C&&u.push(C),k&&(!function(e){ee.hovered&&(e.on("mouseover",(()=>{he(e,"hover")})),e.on("mouseout",(()=>{E.show=!1})));if(e.lockMovementX&&e.lockMovementY)return;e.on("moving",(()=>{de(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,top:n=0,left:o=0,type:r="",moveHide:l}=t||{};i&&("line"===r?i.setCoords().set({x1:e.left,y1:e.top,x2:e.left+o,y2:e.top}):i.setCoords().set({left:e.left+o,top:e.top+n}),l&&(S.value.remove(i),delete e.otherObj.obj))}))}(e),ee.hovered&&he(e)})),e.on("mouseup",(t=>{if(E.show=!1,1===t.button){const{key:t}=e.origin,i={...e.origin,data:{...e.origin.data,time:L(e.left),value:M(t,e.top)}};["surgicalDelivery","dystocia"].some((t=>{var n;(null==(n=e.otherObj[t])?void 0:n.obj)&&(i.data[t]=x(new Date(L(e.left+e.otherObj[t].left)),"yyyy-MM-dd HH:mm"))})),S.value.discardActiveObject(),A("change",i),ce(i,"change")}}))}(k),c.push(k),se.add(k))}(fe(a,e),a,y)})),I(c),S.value.add(...u,...d,...c),c.forEach((e=>{null==e||e.bringToFront();const{childbirthIcon:t}=e.otherObj||{};(null==t?void 0:t.obj)&&"arrow"!==(null==t?void 0:t.type)&&t.obj.bringToFront()}))}))}function ce(e,t="add"){const{dataIndex:i,data:n,index:o,key:r}=e,l=le.find((e=>e.key===r));switch(t){case"remove":l.data.splice(o,1);break;case"change":l.data[o]=n;break;default:{const e=g(n.time,l.data);l.data.splice(e,0,n);break}}ue()}function ue(){var e;se.size&&(null==(e=S.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}([...se]))),se.clear(),ae()}function de(e){const t=e.prevPoint?e.prevPoint.left:N,i=e.nextPoint?e.nextPoint.left:K;e.setCoords(),["cervix","fetalPresentation"].includes(e.origin.key)&&e.top<te&&e.set("top",te),e.top<W&&e.set("top",W),e.top>F&&e.set("top",F),e.left<t&&e.set("left",t),e.left>i&&e.set("left",i)}function he(e,t="moving"){const{title:i,key:n,data:o}=e.origin;E.point={x:e.left,y:e.top},E.list=[`${i} ${"hover"===t?o.value:M(n,e.top)}`,`时间 ${L(e.left).slice(-5)}`],E.show=!0}function fe(e,t){if(v(e)&&function(e){const t=R+864e5,i=m(e);return i>=R&&i<=t}(e.time)){const i=P(e.time),n=X(t.key,t.range,e.value);return[i,n<W?W:n>F?F:n]}}function pe(e,t){return e+1>t[1]?t[0]:e+1}return c(S,C),function(){const t=oe?{width:U-$-_-1,left:$}:{width:K-N-(z.length?0:1),left:N},i=new e.Rect({...Z,height:F-re[0]-1,top:re[0],fill:"transparent",...t});S.value.add(i)}(),function(){function t(t,i="left"){let n="left"===i?$:K;t.forEach(((t,i)=>{const{range:s,spaceValue:c,width:u,title:p,titleStyle:g,key:v,position:m="center",spaceGridNumber:b=1,showNumber:w=!0,showMaxMinNumber:j=!0,showName:k=!0}=t,x=[],C=[],A=n+u/2,E=y(s,c),O=E.length,{lineXMain:P,lineXSub:X,textLeft:L}=d(m,n,u);E.forEach(((e,i)=>{const n=F-i*J*b,o=0===i?F-8:i!==E.length-1||!re[0]||te&&"FHR"!==v?n:W+8;!w||(0===i||i===O-1)&&!j||x.push(h(String(e),t,L,o)),C.push(...f(t,i,P,X,n,J,W,O,1))}));const M=[],Y=oe?new e.Rect({...a,strokeWidth:.5,width:u,height:F-re[0],left:A,top:re[0]+(F-re[0])/2}):null;if(Y&&M.push(Y),k){const e=r([A,W-re[0]>0?W-J/2:J/2],{value:String(p),...l,...g});e&&M.push(e)}const T=new e.Group([...C,...x,...M],{objectCaching:!1,...o});S.value.add(T),T.sendToBack(),n+=u}))}t(q),t(z,"right")}(),function(){const{show:t,startTime:i,range:n=[0,23],position:s="top",style:a}=B.time,{show:c,range:u=[0,23],position:d,style:h={}}=B.processTime;if(t||c){const f=[],p=k(u[0],u[1]+1),g=[],v=[],m=J/2;for(let e=0;e<G.mainXCell;e++){if(t){const{textAlign:t="center"}=a,o=N+("center"===t?V/2:0),c=0===e&&"center"!==t?o+5:o,u=0===e?+i.slice(11,13):pe(j(f),n);f.push(u);const d="top"===s?W-m:F+m;g.push(r([c+e*V,d],{value:String(u),...l,...a})),e===G.mainXCell-1&&"center"!==t&&g.push(r([K-1,d],{value:String(pe(j(f),n)),...l,...a,originX:"center"!==t?"right":"center"}))}if(c&&e<=p.length){const{textAlign:t="center"}=h,i=N+("center"===t?V/2:0),n=0===e&&"center"!==t?i+5:i,o="top"===d?m:ne-m;v.push(r([n+e*V,o],{value:String(p[e]),...l,...h})),e===G.mainXCell-1&&"center"!==t&&v.push(r([K-1,o],{value:String(j(p)),...l,...a,originX:"center"!==t?"right":"center"}))}}const y=new e.Group([...g,...v],{objectCaching:!1,...o});S.value.add(y),S.value.sendToBack(y)}}(),function(){var e;const i=Object.values(ie),n=[],o={},r=le.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:i,range:n}=r||{},o=X(i,n,10),l=[0,t],s=[-t/e,0],a=[(F-o-t)/e,F-o],c=[K-N,e*(K-N)+t];let u=[],d=[];function h([i,n]){return Math.abs(n-e*i-t)<=1}function f([e,t]){const[i,n]=[...p([e,t])];return i>=N&&i<=K&&n>=o&&n<=F}function p([e,t]){return[N+e,F-t]}return h(l)&&f(l)&&(u=p(l)),h(s)&&f(s)&&(u=p(s)),h(a)&&f(a)&&(d=p(a)),h(c)&&f(c)&&(d=p(c)),[...u,...d]}i.forEach((e=>{if(!e.show)return;const{key:i}=e;switch(i){case"fetalPresentation":{const{range:o,show:r}=le.find((e=>e.key===i));if(r){const r=X(i,o,0);n.push(t([N,r,K,r],{...e}))}break}case"alert":if(l){const{key:i,range:a}=r||{},c=216e5,u={time:x(new Date(m(l.time)+c),"yyyy-MM-dd HH:mm"),value:10},[d,h]=[P(l.time)-N,F-X(i,a,l.value)],[f,p]=[P(u.time)-N,F-X(i,a,u.value)],g=(p-h)/(f-d),v=h-d*g,y=s(g,v);y.length>0&&(n.push(t(y,{...e})),Object.assign(o,{k:g,b:v}))}break;case"handling":if(l){const{k:i,b:r}=o,a=144e5,c=s(i,r-(P(x(new Date(m(l.time)+a),"yyyy-MM-dd HH:mm"))-P(l.time))*i);c.length>0&&n.push(t(c,{...e}))}}})),S.value.add(...n)}(),ae(),function(){function e(e,t){const i=le.findIndex((t=>t.key===e.key));return{renderItem:()=>e.title,origin:{title:e.title,unit:e.unit,dataIndex:i,key:e.key},pointer:t}}C.event.evented&&S.value.on("mouse:up",(t=>{var i,n;if(3===t.button){const{x:o=0,y:r=0}=t.pointer||{};o>=N&&o<=K&&r>=W&&r<=F&&(O.point={x:o,y:r},O.show=!0,t.target?(O.target=t.target,O.list=[(null==(n=window.getLanguageByCode)?void 0:n.call(window,"10010.1.220"))||"删除节点"],[...se].forEach((e=>{e.origin&&e.left===t.target.left&&e.top===t.target.top&&O.list.push({renderItem:()=>e.origin.title,origin:{...e.origin},mode:"remove",pointer:t.pointer})}))):(O.target=null,O.list=[(null==(i=window.getLanguageByCode)?void 0:i.call(window,"10010.1.219"))||"新增节点"],le.filter((e=>e.show)).forEach((i=>{if(!Y([...se],o,"key").includes(i.key)){if(["cervix","fetalPresentation"].includes(i.key)&&r<te)return;O.list.push(e(i,t.pointer))}})),1===O.list.length&&(O.show=!1,T("repeat"),console.log("当前时间段内无可新增节点"))))}}))}(),function(){const e=U-_/2;function t(e,t){if(!e.length)return;let n=W;const o=[];e.forEach((e=>{const i=(e.alias||e.title).split("").join("\n"),a=Q.findIndex((t=>t.key===e.key));if(e.alias){const s=r([t,n],{value:i,...l,originY:"top",...e.titleStyle});i&&(n+=s.height+15,o.push(s))}else{const{text:r,icon:l}=s(i,e,{text:{originX:"center",originY:"top",left:t,top:n},icon:{left:t,topY:n,originX:"center",originY:"top",origin:{type:e.type,dataIndex:a},...C.event}},"vertical");n+=r.height+l.height+15,(c=l).on("moving",(()=>{c.set("originY","center"),H(c)?(de(c),he(c)):E.show=!1})),c.on("mouseup:before",(e=>{if(E.show=!1,0===e.e.button&&H(c))if(Y([...se],c.left,"key").includes(c.origin.key))T("repeat");else{const e={data:{time:L(c.left),value:M(c.origin.key,c.top)},...c.origin};A("add",e),ce(e)}!function(e){e.setCoords().set({originY:"top",left:e.originLeft,top:e.originTop})}(c)})),o.push(r,l)}var c})),i(o),S.value.add(...o)}function i(e){const t=j(e),i=(F-W)/2,n=(t.height+t.top-W)/2;e.forEach((e=>{const t=e.top+i-n;e.set({top:t,originTop:t})}))}t(q,$/2),t(z,e)}(),{clickMenu:function({item:e,target:t}){const i={...e.origin};"remove"===e.mode?(A("remove",i),ce(i,"remove")):(Object.assign(i,{data:{time:L(e.pointer.x),value:M(e.origin.key,e.pointer.y)}}),A("add",i),ce(i))},redrawPoints:ue}}export{S as useBirthProcess};
|
@@ -1 +1 @@
|
|
1
|
-
import{fabric as e}from"../../../../../shared/utils/fabricjs/index.js";import{drawLine as t,defaultStyle as i,drawPoint as n,drawText as o,drawArrow as l}from"../useDraw.js";import{useGrid as r}from"../useGrid.js";import{format as s}from"date-fns";import{getType as a,getTime as u,isOneLine as d,isOverlapPoint as c,getFloorNumber as p,isValidValue as f,setOtherType as h,isEffectiveNode as v,deleteProperty as g,getIndex as y}from"../../utils/index.js";import{cloneDeep as m,omit as w,flatten as x,last as b}from"lodash-es";import"../useEvent.js";import{useShadow as j}from"../useShadow.js";import{useCommon as L}from"../useCommon.js";import"vue";import"naive-ui";import"../surgicalAnesthesia/useTop.js";import"@vueuse/core";import{TEMPERATURE_MENU as k,PAIN_MENU as S,OVERLAP as Y}from"../../constants/index.js";import"../surgicalAnesthesia/useOther.js";import"../../../../../shared/utils/index.js";import{promiseTimeout as E}from"@vueuse/shared";function M(M,C,$,T,V,A,P,R,I,X){r(M,C);const{getEqualXTypes:B,handleAddPrevent:D,getPointEventProps:H}=L(M,$,C),{createShadowLines:W}=j(),{left:z,xScaleList:F,xCellWidth:_,yCellHeight:K,originX:q,endX:G,originY:N,endY:J,itemList:Q,event:U,vitalSignsOriginY:Z,painOriginY:ee,hospitalizationDate:te,config:ie,canvasHeight:ne,painSurplusCell:oe,iconsWidth:le,canvasWidth:re,borderStyle:se}=C,ae=new Set,ue=["xinmai","mai"],de=new Map,ce=new Set,pe=new Set,fe=new Set,he=m(z.yScaleValue),ve=new Set;function ge(n){var o;const l=he.find((e=>e.show&&"pulse"===e.type));if(l&&(null==(o=l.dataList)?void 0:o.length)&&(ae.size&&M.value.remove(...ae),ae.clear(),de.size>1)){if(n){const{type:e,key:t}=n.origin||{};if("pulse"===e){const e=de.get(t),i=null==e?void 0:e.findIndex((e=>e[0]===n.left));e.splice(i,1,[n.left,n.top])}}const o=function(){const e=[],t=[],i=[];for(const e of de)t.push(e[1]),e[0]===ue[0]&&e[1].forEach((e=>{(de.get(ue[1])||[]).findIndex((t=>t[0]===e[0]))>-1&&i.push(e[0])}));const[n,o]=t;let l=[],r=[];return i.forEach((t=>{const i=n.findIndex((e=>e[0]===t)),s=o.findIndex((e=>e[0]===t)),a=n[i],u=o[s],d=n[i-1],c=n[i+1],p=o[s-1],f=o[s+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&&r.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]);r.push([a,u].find((e=>e[1]===v)));const g=()=>{const t=[...l,...r.reverse()],[i]=t,n=b(t);i[0]===n[0]&&i[1]===n[1]&&t.splice(-1,1),e.push(t),l=[],r=[]};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?(r.push(f),g()):g()})),e}();o.length>0&&function(e){E(0).then((()=>{e.forEach((e=>{const t=[],i=[];Array.from(fe).forEach((n=>{var o,l;"pulse"===(null==(o=null==n?void 0:n.origin)?void 0:o.type)&&e.find((e=>Math.abs(n.left-e[0])<=1&&Math.abs(n.top-e[1])<=1))&&((null==(l=null==n?void 0:n.origin)?void 0:l.key)===ue[0]?t.push(n):i.push(n))})),[t,i].forEach((e=>{1!==(null==e?void 0:e.length)&&e.sort(((e,t)=>e.left-t.left)).forEach(((e,t)=>{0==t?e.rightLine&&M.value.remove(e.rightLine):e.leftLine&&M.value.remove(e.leftLine)}))}))}))}))}(o);const{mode:r,style:s={}}=l.shadow||{};o.forEach((n=>{const o=n.map((e=>({x:e[0],y:e[1]}))),l=new e.Polygon(o,{...i,...s,strokeWidth:1});if(["slash","line"].includes(r)){l.set({fill:"transparent",stroke:s.stroke||"#f00"});const e=[];if(["slash"].includes(r))e.push(...W(n,s._angle,s.space,w(s,["_angle","space"]))),e.forEach((e=>{ae.add(e)}));else{const i=function(e){const t=e.reduce(((e,t)=>{const i=Math.trunc(t[0]);return e[i]=e[i]?e[i].concat([t]):[t],e}),{}),i=Object.values(t).filter((e=>2===e.length&&Math.trunc(e[0][1])!==Math.trunc(e[1][1])));return i}(n);i.forEach((i=>{const n=t([...x(i)],{...s,originX:"center"});e.push(n),ae.add(n)}))}M.value.add(...e)}ae.add(l),M.value.add(l)}))}}function ye(e,r,s){var a;const{type:u,riseStyle:c={},noRiseStyle:v={},verifiedStyle:g={},reduceStyle:y={},pacemaker:w={},upArrowStyle:x={},limitValueStyle:b={},nonePainPointStyle:j={},belowMinValueStyle:L={},respiratorStyle:k={},dataList:S=[],list:Y=[]}=s,{type:E,textStyle:C}=j,A=[],R=[],X=[];let B=null;const D=e=>"breathe"==u&&e.respirator&&k.type&&k.fixedValue&&!e.value&&xe(e.time),W=d(s);if(null==(a=e.list)||a.forEach(((a,d)=>{var j,z,F,q;const G=W?S.find((e=>e.key===a.key)):e,N=be(D(a)?{...a,value:k.fixedValue}:a,s),J=e.list[d+1],Q=J?be(D(J)?{...J,value:k.fixedValue}:J,s):void 0,te=J?W?S.find((e=>e.key===J.key)):e:{},{title:le=""}=G;if(le===((null==(j=window.getLanguageByCode)?void 0:j.call(window,"10010.1.235"))||"脉搏")&&te.title!==((null==(z=window.getLanguageByCode)?void 0:z.call(window,"10010.1.235"))||"脉搏")||le!==((null==(F=window.getLanguageByCode)?void 0:F.call(window,"10010.1.235"))||"脉搏")&&te.title===((null==(q=window.getLanguageByCode)?void 0:q.call(window,"10010.1.235"))||"脉搏")||!N||!Q||p(N[0],1)!==p(Q[0],1))N&&B&&(N[0]=B),B=null;else{const e=N[0]-_/2;N[0]=e+_/4,Q[0]=B=N[0]+_/2}const re={};re.value=function(e,t,i){if(!(null==e?void 0:e.length)||!ie.showValue)return;const{lineAttr:n={}}=i,l=e[1]<=Z.originY+K?e[1]+K:e[1]-K,r=o([e[0],l],{value:D(t)?k.fixedValue:t.value,originX:"center",originY:"center",fill:n.stroke||"#000"});return X.push(r),{obj:r,top:-K}}(N,a,G),function(e,r,s,a){var d,p,h;if(!["temperature","pain","breathe"].includes(u))return;if(!(null==e?void 0:e.length)&&"temperature"===u&&!xe(r.time))return;if(!(null==e?void 0:e.length)&&"pain"===u)return;if(!r.value&&"breathe"===u)return;const{lineAttr:m={},key:w}=s,{value:x}=a,b=T(r.time);let j,L,S,Y,E,M;if(r.noRise&&v.show){const t=O(v,r)?V(u,35):(null==e?void 0:e[1])||0;if(v.text)S=o([b,O(v,r)?t:t+5],{value:v.text.split("").join("\n"),originY:"top",...v.style}),r.value||fe.add(S);else if(r.value){S=l([b,t,t+2*K],{...v.style})}S&&X.push(S),S&&O(v,r)&&ve.add(S)}if(null==e?void 0:e[1]){if(r.rise&&c.show&&c.text&&(Y=o([b,e[1]-(x?K:0)-5],{value:c.text.split("").join("\n"),originY:"bottom",...c.style}),X.push(Y)),r.verified){const t=(null==(d=null==g?void 0:g.position)?void 0:d[w])||"top";E=o(["top-right"===t?b+_/2:b,e[1]-(x?K:0)-5],{value:"v",originX:"center",originY:"bottom",...g}),X.push(E)}if(f(r.physicsReduce)||f(r.drugReduce)){const o=V(u,null!=(p=r.physicsReduce)?p:r.drugReduce),l=o<e[1]&&(null==ie?void 0:ie.hypothermyViewCustom)?b+_/2:b;j=t([...e,l,o],{...m,...y.line,...i}),L=n((null==(h=null==y?void 0:y.point)?void 0:h.type)||"circle",{left:l,top:o,...y.point,...i,originY:o===ne?"bottom":"center"}),j&&X.push(j),L&&X.push(L)}r.respirator&&(M=n(k.type,{left:b,top:e[1]-(x?K:0)-5,originX:"center",originY:"bottom",...k.style}),X.push(M))}Object.assign(a,{reduceLine:{obj:j,type:"line"},noRiseText:{obj:S,top:v.text?5:2*K,isFixed:O(v,r)},riseText:{obj:Y,top:(x?-K:0)-5},verifiedText:{obj:E,left:_/2,top:(x?-K:0)-5},reducePoint:{obj:L,type:"reduce"},respirator:{obj:M,top:(x?-K:0)-5}})}(N,a,G,re),function(e,t,i,n){if(!(null==e?void 0:e.length)||!["pulse"].includes(u))return;const r=Math.max(...Y),s=Math.min(...Y);let a,d,c;const{upArrowShow:p=!1,limitValueShow:f=!1}=i;if(p&&+t.value>180){let t=e[1]-2.5*K,i=[e[1]-K/2,t];t<Z.originY&&(t=e[1]+2.5*K,i=[t,e[1]+K/2]),a=l([e[0],i[0],i[1]],x,"up"),X.push(a)}if(f){const i={value:t.value,originX:"center",originY:"center",...b};if(+t.value>r){const t=a?e[1]+K/2+a.height:e[1]+K;d=o([e[0],t],i),X.push(d)}+t.value<s&&(d=o([e[0],e[1]-K],i),X.push(d))}if(L.show&&+t.value<s){const t=e[1];if(L.text)c=o([e[0],e[1]+5],{value:L.text.split("").join("\n"),originY:"top",...L.style});else{const i=t+2*K;c=l([e[0],t,i],{...L.style})}X.push(c)}Object.assign(n,{upArrow:{obj:a},limitValue:{obj:d,top:-K},belowMinValue:{obj:c,top:L.text?5:2*K,moveHide:!0}})}(N,a,G,re),function(i,o,l,a,d,c){let p,f;const{pointAttr:g={},lineAttr:y={},title:x="",key:b,type:j="circle",overlapKey:L}=d,S=g.height?g.height/2:5,Y=e.list[a+1];let O=m(i),B=m(o);const z=me(u,e.list[a].value),F=()=>"pulse"==u&&l.pacemakerShow?w.value:D(l)?k.type:z&&"number"===E?0:j,_=e=>e&&v.show&&v.fixed&&xe(e.time)&&e.noRise&&!e.value&&0!==e.value;if((()=>{if(l.breakpoint)return!1;if("temperature"===u&&(i||_(l))&&(o||_(Y))){const e=V(u,35);return i||(O=[T(l.time),e]),o||(B=[T(Y.time),e]),!0}return!!i&&!!o})()){O&&B&&z&&me(u,Y.value)&&!oe[1]&&"icon"===E&&(O[1]=O[1]-S,B[1]=B[1]-S),f=t([...O,...B],{...y});const{obj:e}=(null==c?void 0:c.reducePoint)||{};if(i&&o&&(null==e?void 0:e.top)<i[1]&&(null==ie?void 0:ie.hypothermyViewCustom)){const i=t([e.left,e.top,...o],{...y});X.unshift(i),Object.assign(c,{reduceRightLine:{obj:i,type:"reduce"}}),f.set("stroke","transparent")}}const K=F(),q=R[a-1],G={origin:{data:D(l)?{...l,value:k.fixedValue}:l,title:x,key:b||"",overlapKey:L,unit:s.unit,type:u,_type:h(x,u),dataIndex:r,index:a,isOneLine:W},leftLine:q,rightLine:f,otherObj:c,...l.pacemakerShow&&"pulse"==u?w.style:D(l)?k.style:g,...H(),lockMovementX:!0,...z?{selectable:!1,evented:!1,..."number"===E?C:{}}:{}};i&&(q?G.leftLine.set("x2",i[0]):G.leftLine=null,p=n(K,{left:i[0],top:z&&!oe[1]?i[1]-S:i[1],...G}));R.push(f),p&&(b===ue[1]?ce.add(p):D(l)||pe.add(p),function(e){U.hovered&&(e.on("mouseover",(()=>{we(e,"hover")})),e.on("mouseout",(()=>{I.show=!1})));if(e.lockMovementX&&e.lockMovementY)return;e.on("moving",(()=>{!function(e){e.setCoords();const t="pain"===e.origin.type?ee:Z;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,moveHide:r=!1,left:s=0}=t||{};"reduce"!==n&&i&&("line"===n?i.setCoords().set({x1:e.left,y1:e.top}):(l||i.setCoords().set({left:e.left+s,top:e.top+o}),r&&(M.value.remove(i),delete e.otherObj.obj)))})),ge(e)}(e),U.hovered&&we(e)})),e.on("mouseup",(t=>{if(I.show=!1,1===t.button){const{type:t}=e.origin,i=P(t,e.top),n={...e.origin,data:{...e.origin.data,value:i}};M.value.discardActiveObject(),$("change",n),Le(n,"change")}}))}(p),A.push(p),fe.add(p))}(N,Q,a,d,G,re)})),"pulse"===u){let t=null;const i=e=>e.map(((e,i,n)=>{var o,l;const r=n[i+1];if(r&&p(e.left,1)===p(r.left,1)){const i=e.left-_/2;e.set("left",i+_/4),null==(o=e.rightLine)||o.set("x1",e.left),t=e.left+_/2,r.set("left",t)}else t&&(null==(l=e.leftLine)||l.set("x2",t),e.set("left",t)),t=null;return[e.left,e.top]}));if(W){const e={};ue.forEach((t=>{e[t]=A.filter((e=>{var i;return(null==(i=e.origin)?void 0:i.key)===t})),de.set(t,i(e[t]))}))}else{const{key:t}=e;de.set(t,i(A))}}const z=R.filter((e=>e));M.value.add(...z,...A,...X)}function me(e,t){return"pain"===e&&0==t}function we(e,t="moving"){const{title:i,unit:n,type:o,data:l}=e.origin;I.point={x:e.left,y:e.top};let r=`时间 ${((null==l?void 0:l.time)||A(e.left)).slice(-5)}`;I.list=[function(){const{drugReduce:s,physicsReduce:a}=l||{},u="hover"===t?l.value:P(o,e.top);if(f(s))return r+=(null==l?void 0:l.changeTime)?"—>"+(null==l?void 0:l.changeTime.slice(-5)):"",`药物降${"pain"==o?"痛":"温"} ${u}—>${s}${n||""}`;if(f(a))return r+=(null==l?void 0:l.changeTime)?"—>"+(null==l?void 0:l.changeTime.slice(-5)):"",`物理降${"pain"==o?"痛":"温"} ${u}—>${a}${n||""}`;return`${i} ${u}${n||""}`}(),r],I.show=!0}function xe(e){const[t]=F,i=b(F),n=t.start,o=i.end,l=u(e);return l>=n&&l<=o}function be(e,t){const i="pain"===t.type?ee:Z;if(!v(e)||!xe(e.time))return;const n=T(e.time),o=V(t.type,e.value);return[n,o<i.originY?i.originY:o>i.endY?i.endY:o]}function je(e){const t=new Date,i=String(t.getMonth()+1).padStart(2,"0"),n=String(t.getDate()).padStart(2,"0"),o=u(`${t.getFullYear()}-${i}-${n} 23:59:59`),l=u(`${A(e)}:00`);return te&&l<u(te)?(D("exceedMin"),!1):!(l>o)||(D("exceedMax"),!1)}function Le(e,t="add"){const{type:i,dataIndex:n,index:o,data:l,key:r}=e,s=he.find((e=>e.type===i));if("add"===t){const e=d(s)?s.dataList.find((e=>e.enable)):s.dataList[n],t=y(l.time,e.list);e.list.splice(t,0,l)}else s.dataList[n].list[o]=l;ke()}function ke(){var e;fe.size&&(null==(e=M.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}([...fe]))),fe.clear(),Se()}function Se(e){de.clear(),fe.clear(),ce.clear(),ve.clear(),pe.clear(),he.forEach((t=>{t.show&&(null==e||e(t),t.dataList.forEach(((e,i)=>{!e.show||d(t)&&!e.enable||ye(e,i,t)})))})),ge(),[...fe].forEach((e=>{null==e||e.bringToFront()})),function(){var e;const t=he.find((e=>e.show&&"pulse"===e.type));if(!t||!(null==(e=t.dataList)?void 0:e.length))return;if(!t.dataList.some((e=>{var t;return e.title.includes((null==(t=window.getLanguageByCode)?void 0:t.call(window,"10010.1.235"))||"脉搏")})))return;const o=Object.assign({},Y,z.overlap||{}),l=[];ce.size&&[...ce].forEach((e=>{[...pe].forEach((t=>{if(t.origin&&c(e,t)){const e=t.origin.key,r=t.origin.overlapKey;if(e){const s={left:t.left,top:t.top,...i,hoverCursor:"default"};let a=r||"koumai";"yemai"===e&&(a=e);const u=r||e;l.push(n(a,{...o[u],...s}))}}}))})),setTimeout((()=>{M.value.add(...l),l.forEach((e=>{null==e||e.bringToFront(),fe.add(e)}))}))}()}return function(){const t=new e.Rect({left:le,top:0,width:re-le-se.strokeWidth,height:ne-se.strokeWidth,fill:"transparent",...se});M.value.add(t)}(),Se((e=>function(e){if("temperature"!==e.type||!e.positionLine)return;const i=V(e.type,e.positionLine.value),n=t([q,i,G,i],e.positionLine);M.value.add(n)}(e))),M.value.on("mouse:up",(e=>{var t;const{button:i,target:n,pointer:o={}}=e;if(3===i){if(!C.event.evented)return;const{x:e=0,y:i=0}=o;if(e>=q&&e<=G&&i>=N&&i<=J){X.point={x:e,y:i},X.show=!0;const{type:l}=(null==n?void 0:n.origin)||{};if(n&&["temperature","pain"].includes(l))"temperature"===l&&(X.list=[...k]),"pain"===l&&(X.list=[...S]),X.target=n;else{X.target=null,X.list=[(null==(t=window.getLanguageByCode)?void 0:t.call(window,"10010.1.219"))||"新增节点"],Q.forEach((t=>{if(!B([...fe],e,"_type").includes(t.bigType)){const e=["pain"].includes(t.bigType)?ee:Z;i>=e.originY&&i<=e.endY&&X.list.push({renderItem:R?R(t):()=>t.title,origin:{title:t.title,unit:t.unit,type:a(t.bigType),dataIndex:t.dataIndex,key:t.key,isOneLine:t.isOneLine},pointer:o})}}));const n=je(e);n&&1!==X.list.length||(X.show=!1,1===X.list.length&&n&&D("repeat"))}}}if(1===i){if(n)return;const{x:e=0,y:t=0}=o;e>=q&&e<=G&&t>0&&t<ne&&$("click:grid",{x:e,y:t,time:A(e)})}})),{clickMenu:function({item:e,target:t}){if(t){const{data:i,type:n,isOneLine:o,dataIndex:l,index:r}=t.origin,a=g(i,[...k,...S]);a[`${e.type}`]=e.value,a.changeTime=s(new Date,"yyyy-MM-dd HH:mm"),o&&(a.key=t.origin.key);const u={...t.origin,data:a};$("change",u),Le(u,"change")}else{const t={data:{time:A(e.pointer.x),value:P(e.origin.type,e.pointer.y),...e.origin.isOneLine?{key:e.origin.key}:{}},...e.origin};$("add",t),Le(t)}},setPopup:we,isAddPoint:je,updateData:Le,redrawPoints:ke,gridPoints:fe,fixedNoRisePoints:ve}}function O(e,t){return e.fixed||!t.value&&0!==t.value}export{M as useCenter};
|
1
|
+
import{fabric as e}from"../../../../../shared/utils/fabricjs/index.js";import{drawLine as t,defaultStyle as i,drawPoint as n,drawText as o,drawArrow as l}from"../useDraw.js";import{useGrid as r}from"../useGrid.js";import{format as s}from"date-fns";import{getType as a,getTime as u,isOneLine as d,isOverlapPoint as c,getFloorNumber as p,isValidValue as f,setOtherType as h,isEffectiveNode as v,deleteProperty as g,getIndex as y}from"../../utils/index.js";import{cloneDeep as m,omit as w,flatten as x,last as b}from"lodash-es";import"../useEvent.js";import{useShadow as j}from"../useShadow.js";import{useCommon as L}from"../useCommon.js";import"vue";import"naive-ui";import"../surgicalAnesthesia/useTop.js";import"@vueuse/core";import{TEMPERATURE_MENU as k,PAIN_MENU as S,OVERLAP as Y}from"../../constants/index.js";import"../surgicalAnesthesia/useOther.js";import"../../../../../shared/utils/index.js";import{promiseTimeout as E}from"@vueuse/shared";function M(M,C,T,$,P,V,A,R,I,X){r(M,{...C,isTemperature:!0});const{getEqualXTypes:H,handleAddPrevent:B,getPointEventProps:D}=L(M,T,C),{createShadowLines:W}=j(),{left:z,xScaleList:F,xCellWidth:_,yCellHeight:K,originX:q,endX:G,originY:N,endY:J,itemList:Q,event:U,vitalSignsOriginY:Z,painOriginY:ee,hospitalizationDate:te,config:ie,canvasHeight:ne,painSurplusCell:oe,iconsWidth:le,canvasWidth:re,borderStyle:se,painScalePositionSurplusHeight:ae}=C,ue=new Set,de=["xinmai","mai"],ce=new Map,pe=new Set,fe=new Set,he=new Set,ve=m(z.yScaleValue),ge=new Set;function ye(n){var o;const l=ve.find((e=>e.show&&"pulse"===e.type));if(l&&(null==(o=l.dataList)?void 0:o.length)&&(ue.size&&M.value.remove(...ue),ue.clear(),ce.size>1)){if(n){const{type:e,key:t}=n.origin||{};if("pulse"===e){const e=ce.get(t),i=null==e?void 0:e.findIndex((e=>e[0]===n.left));e.splice(i,1,[n.left,n.top])}}const o=function(){const e=[],t=[],i=[];for(const e of ce)t.push(e[1]),e[0]===de[0]&&e[1].forEach((e=>{(ce.get(de[1])||[]).findIndex((t=>t[0]===e[0]))>-1&&i.push(e[0])}));const[n,o]=t;let l=[],r=[];return i.forEach((t=>{const i=n.findIndex((e=>e[0]===t)),s=o.findIndex((e=>e[0]===t)),a=n[i],u=o[s],d=n[i-1],c=n[i+1],p=o[s-1],f=o[s+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&&r.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]);r.push([a,u].find((e=>e[1]===v)));const g=()=>{const t=[...l,...r.reverse()],[i]=t,n=b(t);i[0]===n[0]&&i[1]===n[1]&&t.splice(-1,1),e.push(t),l=[],r=[]};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?(r.push(f),g()):g()})),e}();o.length>0&&function(e){E(0).then((()=>{e.forEach((e=>{const t=[],i=[];Array.from(he).forEach((n=>{var o,l;"pulse"===(null==(o=null==n?void 0:n.origin)?void 0:o.type)&&e.find((e=>Math.abs(n.left-e[0])<=1&&Math.abs(n.top-e[1])<=1))&&((null==(l=null==n?void 0:n.origin)?void 0:l.key)===de[0]?t.push(n):i.push(n))})),[t,i].forEach((e=>{1!==(null==e?void 0:e.length)&&e.sort(((e,t)=>e.left-t.left)).forEach(((e,t)=>{0==t?e.rightLine&&M.value.remove(e.rightLine):e.leftLine&&M.value.remove(e.leftLine)}))}))}))}))}(o);const{mode:r,style:s={}}=l.shadow||{};o.forEach((n=>{const o=n.map((e=>({x:e[0],y:e[1]}))),l=new e.Polygon(o,{...i,...s,strokeWidth:1});if(["slash","line"].includes(r)){l.set({fill:"transparent",stroke:s.stroke||"#f00"});const e=[];if(["slash"].includes(r))e.push(...W(n,s._angle,s.space,w(s,["_angle","space"]))),e.forEach((e=>{ue.add(e)}));else{const i=function(e){const t=e.reduce(((e,t)=>{const i=Math.trunc(t[0]);return e[i]=e[i]?e[i].concat([t]):[t],e}),{}),i=Object.values(t).filter((e=>2===e.length&&Math.trunc(e[0][1])!==Math.trunc(e[1][1])));return i}(n);i.forEach((i=>{const n=t([...x(i)],{...s,originX:"center"});e.push(n),ue.add(n)}))}M.value.add(...e)}ue.add(l),M.value.add(l)}))}}function me(e,r,s){var a;const{type:u,riseStyle:c={},noRiseStyle:v={},verifiedStyle:g={},reduceStyle:y={},pacemaker:w={},upArrowStyle:x={},limitValueStyle:b={},nonePainPointStyle:j={},belowMinValueStyle:L={},respiratorStyle:k={},dataList:S=[],list:Y=[]}=s,{type:E,textStyle:C}=j,V=[],R=[],X=[];let H=null;const B=e=>"breathe"==u&&e.respirator&&k.type&&k.fixedValue&&!e.value&&be(e.time),W=d(s);if(null==(a=e.list)||a.forEach(((a,d)=>{var j,z,F,q;const G=W?S.find((e=>e.key===a.key)):e,N=je(B(a)?{...a,value:k.fixedValue}:a,s),J=e.list[d+1],Q=J?je(B(J)?{...J,value:k.fixedValue}:J,s):void 0,te=J?W?S.find((e=>e.key===J.key)):e:{},{title:le=""}=G;if(le===((null==(j=window.getLanguageByCode)?void 0:j.call(window,"10010.1.235"))||"脉搏")&&te.title!==((null==(z=window.getLanguageByCode)?void 0:z.call(window,"10010.1.235"))||"脉搏")||le!==((null==(F=window.getLanguageByCode)?void 0:F.call(window,"10010.1.235"))||"脉搏")&&te.title===((null==(q=window.getLanguageByCode)?void 0:q.call(window,"10010.1.235"))||"脉搏")||!N||!Q||p(N[0],1)!==p(Q[0],1))N&&H&&(N[0]=H),H=null;else{const e=N[0]-_/2;N[0]=e+_/4,Q[0]=H=N[0]+_/2}const re={};re.value=function(e,t,i){if(!(null==e?void 0:e.length)||!ie.showValue)return;const{lineAttr:n={}}=i,l=e[1]<=Z.originY+K?e[1]+K:e[1]-K,r=o([e[0],l],{value:B(t)?k.fixedValue:t.value,originX:"center",originY:"center",fill:n.stroke||"#000"});return X.push(r),{obj:r,top:-K}}(N,a,G),function(e,r,s,a){var d,p,h;if(!["temperature","pain","breathe"].includes(u))return;if(!(null==e?void 0:e.length)&&"temperature"===u&&!be(r.time))return;if(!(null==e?void 0:e.length)&&"pain"===u)return;if(!r.value&&"breathe"===u)return;const{lineAttr:m={},key:w}=s,{value:x}=a,b=$(r.time);let j,L,S,Y,E,M;if(r.noRise&&v.show){const t=O(v,r)?P(u,35):(null==e?void 0:e[1])||0;if(v.text)S=o([b,O(v,r)?t:t+5],{value:v.text.split("").join("\n"),originY:"top",...v.style}),r.value||he.add(S);else if(r.value){S=l([b,t,t+2*K],{...v.style})}S&&X.push(S),S&&O(v,r)&&ge.add(S)}if(null==e?void 0:e[1]){if(r.rise&&c.show&&c.text&&(Y=o([b,e[1]-(x?K:0)-5],{value:c.text.split("").join("\n"),originY:"bottom",...c.style}),X.push(Y)),r.verified){const t=(null==(d=null==g?void 0:g.position)?void 0:d[w])||"top";E=o(["top-right"===t?b+_/2:b,e[1]-(x?K:0)-5],{value:"v",originX:"center",originY:"bottom",...g}),X.push(E)}if(f(r.physicsReduce)||f(r.drugReduce)){const o=P(u,null!=(p=r.physicsReduce)?p:r.drugReduce),l=o<e[1]&&(null==ie?void 0:ie.hypothermyViewCustom)?b+_/2:b;j=t([...e,l,o],{...m,...y.line,...i}),L=n((null==(h=null==y?void 0:y.point)?void 0:h.type)||"circle",{left:l,top:o,...y.point,...i,originY:o===ne?"bottom":"center"}),j&&X.push(j),L&&X.push(L)}r.respirator&&(M=n(k.type,{left:b,top:e[1]-(x?K:0)-5,originX:"center",originY:"bottom",...k.style}),X.push(M))}Object.assign(a,{reduceLine:{obj:j,type:"line"},noRiseText:{obj:S,top:v.text?5:2*K,isFixed:O(v,r)},riseText:{obj:Y,top:(x?-K:0)-5},verifiedText:{obj:E,left:_/2,top:(x?-K:0)-5},reducePoint:{obj:L,type:"reduce"},respirator:{obj:M,top:(x?-K:0)-5}})}(N,a,G,re),function(e,t,i,n){if(!(null==e?void 0:e.length)||!["pulse"].includes(u))return;const r=Math.max(...Y),s=Math.min(...Y);let a,d,c;const{upArrowShow:p=!1,limitValueShow:f=!1}=i;if(p&&+t.value>180){let t=e[1]-2.5*K,i=[e[1]-K/2,t];t<Z.originY&&(t=e[1]+2.5*K,i=[t,e[1]+K/2]),a=l([e[0],i[0],i[1]],x,"up"),X.push(a)}if(f){const i={value:t.value,originX:"center",originY:"center",...b};if(+t.value>r){const t=a?e[1]+K/2+a.height:e[1]+K;d=o([e[0],t],i),X.push(d)}+t.value<s&&(d=o([e[0],e[1]-K],i),X.push(d))}if(L.show&&+t.value<s){const t=e[1];if(L.text)c=o([e[0],e[1]+5],{value:L.text.split("").join("\n"),originY:"top",...L.style});else{const i=t+2*K;c=l([e[0],t,i],{...L.style})}X.push(c)}Object.assign(n,{upArrow:{obj:a},limitValue:{obj:d,top:-K},belowMinValue:{obj:c,top:L.text?5:2*K,moveHide:!0}})}(N,a,G,re),function(i,o,l,a,d,c){let p,f;const{pointAttr:g={},lineAttr:y={},title:x="",key:b,type:j="circle",overlapKey:L}=d,S=g.height?g.height/2:5,Y=e.list[a+1];let O=m(i),H=m(o);const z=we(u,e.list[a].value),F=()=>"pulse"==u&&l.pacemakerShow?w.value:B(l)?k.type:z&&"number"===E?0:j,_=e=>e&&v.show&&v.fixed&&be(e.time)&&e.noRise&&!e.value&&0!==e.value;if((()=>{if(l.breakpoint)return!1;if("temperature"===u&&(i||_(l))&&(o||_(Y))){const e=P(u,35);return i||(O=[$(l.time),e]),o||(H=[$(Y.time),e]),!0}return!!i&&!!o})()){O&&H&&z&&we(u,Y.value)&&!oe[1]&&!ae&&"icon"===E&&(O[1]=O[1]-S,H[1]=H[1]-S),f=t([...O,...H],{...y});const{obj:e}=(null==c?void 0:c.reducePoint)||{};if(i&&o&&(null==e?void 0:e.top)<i[1]&&(null==ie?void 0:ie.hypothermyViewCustom)){const i=t([e.left,e.top,...o],{...y});X.unshift(i),Object.assign(c,{reduceRightLine:{obj:i,type:"reduce"}}),f.set("stroke","transparent")}}const K=F(),q=R[a-1],G={origin:{data:B(l)?{...l,value:k.fixedValue}:l,title:x,key:b||"",overlapKey:L,unit:s.unit,type:u,_type:h(x,u),dataIndex:r,index:a,isOneLine:W},leftLine:q,rightLine:f,otherObj:c,...l.pacemakerShow&&"pulse"==u?w.style:B(l)?k.style:g,...D(),lockMovementX:!0,...z?{selectable:!1,evented:!1,..."number"===E?C:{}}:{}};i&&(q?G.leftLine.set("x2",i[0]):G.leftLine=null,p=n(K,{left:i[0],top:!z||oe[1]||ae?i[1]:i[1]-S,...G}));R.push(f),p&&(b===de[1]?pe.add(p):B(l)||fe.add(p),function(e){U.hovered&&(e.on("mouseover",(()=>{xe(e,"hover")})),e.on("mouseout",(()=>{I.show=!1})));if(e.lockMovementX&&e.lockMovementY)return;e.on("moving",(()=>{!function(e){e.setCoords();const t="pain"===e.origin.type?ee:Z;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,moveHide:r=!1,left:s=0}=t||{};"reduce"!==n&&i&&("line"===n?i.setCoords().set({x1:e.left,y1:e.top}):(l||i.setCoords().set({left:e.left+s,top:e.top+o}),r&&(M.value.remove(i),delete e.otherObj.obj)))})),ye(e)}(e),U.hovered&&xe(e)})),e.on("mouseup",(t=>{if(I.show=!1,1===t.button){const{type:t}=e.origin,i=A(t,e.top),n={...e.origin,data:{...e.origin.data,value:i}};M.value.discardActiveObject(),T("change",n),ke(n,"change")}}))}(p),V.push(p),he.add(p))}(N,Q,a,d,G,re)})),"pulse"===u){let t=null;const i=e=>e.map(((e,i,n)=>{var o,l;const r=n[i+1];if(r&&p(e.left,1)===p(r.left,1)){const i=e.left-_/2;e.set("left",i+_/4),null==(o=e.rightLine)||o.set("x1",e.left),t=e.left+_/2,r.set("left",t)}else t&&(null==(l=e.leftLine)||l.set("x2",t),e.set("left",t)),t=null;return[e.left,e.top]}));if(W){const e={};de.forEach((t=>{e[t]=V.filter((e=>{var i;return(null==(i=e.origin)?void 0:i.key)===t})),ce.set(t,i(e[t]))}))}else{const{key:t}=e;ce.set(t,i(V))}}const z=R.filter((e=>e));M.value.add(...z,...V,...X)}function we(e,t){return"pain"===e&&0==t}function xe(e,t="moving"){const{title:i,unit:n,type:o,data:l}=e.origin;I.point={x:e.left,y:e.top};let r=`时间 ${((null==l?void 0:l.time)||V(e.left)).slice(-5)}`;I.list=[function(){const{drugReduce:s,physicsReduce:a}=l||{},u="hover"===t?l.value:A(o,e.top);if(f(s))return r+=(null==l?void 0:l.changeTime)?"—>"+(null==l?void 0:l.changeTime.slice(-5)):"",`药物降${"pain"==o?"痛":"温"} ${u}—>${s}${n||""}`;if(f(a))return r+=(null==l?void 0:l.changeTime)?"—>"+(null==l?void 0:l.changeTime.slice(-5)):"",`物理降${"pain"==o?"痛":"温"} ${u}—>${a}${n||""}`;return`${i} ${u}${n||""}`}(),r],I.show=!0}function be(e){const[t]=F,i=b(F),n=t.start,o=i.end,l=u(e);return l>=n&&l<=o}function je(e,t){const i="pain"===t.type?ee:Z;if(!v(e)||!be(e.time))return;const n=$(e.time),o=P(t.type,e.value);return[n,o<i.originY?i.originY:o>i.endY?i.endY:o]}function Le(e){const t=new Date,i=String(t.getMonth()+1).padStart(2,"0"),n=String(t.getDate()).padStart(2,"0"),o=u(`${t.getFullYear()}-${i}-${n} 23:59:59`),l=u(`${V(e)}:00`);return te&&l<u(te)?(B("exceedMin"),!1):!(l>o)||(B("exceedMax"),!1)}function ke(e,t="add"){const{type:i,dataIndex:n,index:o,data:l,key:r}=e,s=ve.find((e=>e.type===i));if("add"===t){const e=d(s)?s.dataList.find((e=>e.enable)):s.dataList[n],t=y(l.time,e.list);e.list.splice(t,0,l)}else s.dataList[n].list[o]=l;Se()}function Se(){var e;he.size&&(null==(e=M.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}([...he]))),he.clear(),Ye()}function Ye(e){ce.clear(),he.clear(),pe.clear(),ge.clear(),fe.clear(),ve.forEach((t=>{t.show&&(null==e||e(t),t.dataList.forEach(((e,i)=>{!e.show||d(t)&&!e.enable||me(e,i,t)})))})),ye(),[...he].forEach((e=>{null==e||e.bringToFront()})),function(){var e;const t=ve.find((e=>e.show&&"pulse"===e.type));if(!t||!(null==(e=t.dataList)?void 0:e.length))return;if(!t.dataList.some((e=>{var t;return e.title.includes((null==(t=window.getLanguageByCode)?void 0:t.call(window,"10010.1.235"))||"脉搏")})))return;const o=Object.assign({},Y,z.overlap||{}),l=[];pe.size&&[...pe].forEach((e=>{[...fe].forEach((t=>{if(t.origin&&c(e,t)){const e=t.origin.key,r=t.origin.overlapKey;if(e){const s={left:t.left,top:t.top,...i,hoverCursor:"default"};let a=r||"koumai";"yemai"===e&&(a=e);const u=r||e;l.push(n(a,{...o[u],...s}))}}}))})),setTimeout((()=>{M.value.add(...l),l.forEach((e=>{null==e||e.bringToFront(),he.add(e)}))}))}()}return function(){const t=new e.Rect({left:le,top:0,width:re-le-se.strokeWidth,height:ne-se.strokeWidth,fill:"transparent",...se});M.value.add(t)}(),Ye((e=>function(e){if("temperature"!==e.type||!e.positionLine)return;const i=P(e.type,e.positionLine.value),n=t([q,i,G,i],e.positionLine);M.value.add(n)}(e))),M.value.on("mouse:up",(e=>{var t;const{button:i,target:n,pointer:o={}}=e;if(3===i){if(!C.event.evented)return;const{x:e=0,y:i=0}=o;if(e>=q&&e<=G&&i>=N&&i<=J){X.point={x:e,y:i},X.show=!0;const{type:l}=(null==n?void 0:n.origin)||{};if(n&&["temperature","pain"].includes(l))"temperature"===l&&(X.list=[...k]),"pain"===l&&(X.list=[...S]),X.target=n;else{X.target=null,X.list=[(null==(t=window.getLanguageByCode)?void 0:t.call(window,"10010.1.219"))||"新增节点"],Q.forEach((t=>{if(!H([...he],e,"_type").includes(t.bigType)){const e=["pain"].includes(t.bigType)?ee:Z;i>=e.originY&&i<=e.endY&&X.list.push({renderItem:R?R(t):()=>t.title,origin:{title:t.title,unit:t.unit,type:a(t.bigType),dataIndex:t.dataIndex,key:t.key,isOneLine:t.isOneLine},pointer:o})}}));const n=Le(e);n&&1!==X.list.length||(X.show=!1,1===X.list.length&&n&&B("repeat"))}}}if(1===i){if(n)return;const{x:e=0,y:t=0}=o;e>=q&&e<=G&&t>0&&t<ne&&T("click:grid",{x:e,y:t,time:V(e)})}})),{clickMenu:function({item:e,target:t}){if(t){const{data:i,type:n,isOneLine:o,dataIndex:l,index:r}=t.origin,a=g(i,[...k,...S]);a[`${e.type}`]=e.value,a.changeTime=s(new Date,"yyyy-MM-dd HH:mm"),o&&(a.key=t.origin.key);const u={...t.origin,data:a};T("change",u),ke(u,"change")}else{const t={data:{time:V(e.pointer.x),value:A(e.origin.type,e.pointer.y),...e.origin.isOneLine?{key:e.origin.key}:{}},...e.origin};T("add",t),ke(t)}},setPopup:xe,isAddPoint:Le,updateData:ke,redrawPoints:Se,gridPoints:he,fixedNoRisePoints:ge}}function O(e,t){return e.fixed||!t.value&&0!==t.value}export{M as useCenter};
|
@@ -1 +1 @@
|
|
1
|
-
import{reactive as e,computed as a,watch as t,toRefs as l}from"vue";import{defaultBorderStyle as u}from"../useDraw.js";import"../../../../../shared/utils/fabricjs/index.js";import{useCumputedPoint as i}from"../useCumputedPoint.js";import{useCanvasEvent as n}from"../useEvent.js";import"../useShadow.js";import"../useCommon.js";import{setOtherType as r,isOneLine as o,getFloorNumber as s}from"../../utils/index.js";import{flatten as v}from"lodash-es";import{format as d,addDays as c}from"date-fns";import"naive-ui";import"../surgicalAnesthesia/useTop.js";import"@vueuse/core";import"../../constants/index.js";import"../surgicalAnesthesia/useOther.js";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 S(S,w,b,Y,j,x){const C=15,D=e({select:null,redrawPoints:null,clickMenu:null}),V=a((()=>{const{painSurplusCell:e=[0,0]}=w.data.grid||{};return~
|
1
|
+
import{reactive as e,computed as a,watch as t,toRefs as l}from"vue";import{defaultBorderStyle as u}from"../useDraw.js";import"../../../../../shared/utils/fabricjs/index.js";import{useCumputedPoint as i}from"../useCumputedPoint.js";import{useCanvasEvent as n}from"../useEvent.js";import"../useShadow.js";import"../useCommon.js";import{setOtherType as r,isOneLine as o,getFloorNumber as s}from"../../utils/index.js";import{flatten as v}from"lodash-es";import{format as d,addDays as c}from"date-fns";import"naive-ui";import"../surgicalAnesthesia/useTop.js";import"@vueuse/core";import"../../constants/index.js";import"../surgicalAnesthesia/useOther.js";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 S(S,w,b,Y,j,x){const C=15,D=e({select:null,redrawPoints:null,clickMenu:null}),V=a((()=>{const{painSurplusCell:e=[0,0]}=w.data.grid||{};return~Q.value?e:[0,0]})),H=a((()=>{var e,a;const t=(null==(a=null==(e=w.data.grid)?void 0:e.surplusCell)?void 0:a.slice())||[0,0,0,0];return 0===Q.value?t[0]=t[0]+V.value[1]:Q.value>0&&(t[2]=t[2]+V.value[0]),t})),P=a((()=>0===Q.value?[V.value[0],H.value[1],H.value[2],H.value[3]]:Q.value>0?[H.value[0],H.value[1],V.value[1],H.value[3]]:H.value)),X=a((()=>{const{top:e}=w.data;return e.date.show&&(e.date.height||C)||0})),L=a((()=>{var e;const{top:a}=w.data;return(null==(e=a.hospitalDays)?void 0:e.show)&&(a.hospitalDays.height||C)||0})),M=a((()=>{var e;const{top:a}=w.data;return(null==(e=a.operationDays)?void 0:e.show)&&(a.operationDays.height||C)||0})),I=a((()=>{var e,a,t;const{top:l}=w.data;return((null==(e=l.xScalevalue)?void 0:e.show)&&(l.xScalevalue.height||C)||0)+((null==(a=l.xScalevalue)?void 0:a.show)&&null!=(t=l.dayHeight)?t:0)})),O=a((()=>{var e;const{top:a}=w.data;return(null==(e=a.childbirthDays)?void 0:e.show)&&(a.childbirthDays.height||C)||0})),N=a((()=>{var e;const{bottom:a}=w.data;return(null==(e=null==a?void 0:a.breathing)?void 0:e.show)&&(a.breathing.height||30)||0})),k=a((()=>{const{grid:e}=w.data;return e.mainXCell*e.subXCell+H.value[1]+H.value[3]})),R=a((()=>{const{mainYCell:e,subYCell:a,painSubYCell:t=5}=w.data.grid,l=Q.value>0?V.value[1]:V.value[0];return(e-1)*a+t+H.value[0]+H.value[2]+l})),W=a((()=>{var e;const{width:a,right:t=null,top:l}=w.data;if(!t)return a;return a-(null!=(e=t.width)?e:0)})),$=a((()=>W.value-H.value[1]*z.value)),A=a((()=>{const{top:e,left:a}=w.data;return e.titleWidth+B.value})),T=a((()=>{const{bottom:e=null,height:a}=w.data;if(!e)return a;return a-(e.height||30)})),q=a((()=>{var e;const{top:a}=w.data,t=a.xScalevalue.show&&(null!=(e=a.dayHeight)?e:0)||0,l=a.xScalevalue.show&&(a.xScalevalue.height||C)||0;return X.value+t+l+L.value+M.value+O.value})),z=a((()=>(W.value-A.value)/k.value)),G=a((()=>(T.value-q.value)/R.value)),B=a((()=>{var e,a;const{left:t}=w.data;return(null==(e=t.icons)?void 0:e.show)&&((null==(a=t.icons)?void 0:a.width)||100)||0})),E=a((()=>{var e,a;const{top:t,grid:l}=w.data,u=(null==(a=null==(e=t.date.list)?void 0:e.slice)?void 0:a.call(e,0,l.mainXCell))||[],i=t.xScalevalue.times;let n=A.value-z.value;const r=t.date.startDate||d(new Date,"yyyy-MM-dd"),o=u.reduce(((e,a,t)=>0===t?e.concat(r):e.concat(d(c(new Date(r.replace(/-/g,"/")),t),"yyyy-MM-dd"))),[]).map((e=>i.map((a=>{n+=z.value;const t=Date.parse(`${e} ${a.start}`),l=Date.parse(`${e} ${a.end}`);return{start:t,end:l,left:n,center:n+z.value/2,scaleCell:(l-t)/z.value}}))));return v(o)})),F=a((()=>{var e;return(null==(e=w.data.grid)?void 0:e.event)||{selectable:!0,evented:!0,hovered:!0}})),J=a((()=>{const{left:e}=w.data;return v(e.yScaleValue.filter((e=>e.show)).map((e=>e.dataList.filter((e=>e.show)).map(((a,t)=>({...a,bigType:r(a.title,e.type),unit:e.unit,dataIndex:t,isOneLine:o(e)}))))))})),K=a((()=>{const{left:e}=w.data,a=e.yScaleValue.find((e=>"pain"===e.type));if(!a)return 0;const{numberVerticalPosition:t="bottom"}=a;return"center"===t?G.value/2:0})),Q=a((()=>{const{left:e}=w.data,a=e.yScaleValue.findIndex((e=>"pain"===e.type));return a>-1&&e.yScaleValue[a].show?a:-1})),U=a((()=>{const{painSubYCell:e=5}=w.data.grid;return-1===Q.value?0:G.value*e})),Z=a((()=>{const{left:e}=w.data,a={originY:q.value+V.value[0]*G.value,endY:T.value-V.value[1]*G.value-K.value};return 0===Q.value&&e.yScaleValue.length>1?a.endY=a.originY+U.value-K.value:Q.value===e.yScaleValue.length-1&&(a.originY=a.endY-U.value+K.value),a})),_=a((()=>{const{left:e}=w.data,a={originY:q.value+H.value[0]*G.value,endY:T.value-H.value[2]*G.value};return 0===Q.value&&e.yScaleValue.length>1?a.originY=Z.value.endY+K.value+H.value[0]*G.value:Q.value===e.yScaleValue.length-1&&(a.endY=Z.value.originY-H.value[2]*G.value),a})),ee=a((()=>{var e,a;const{top:t,grid:l}=w.data,u=[];for(const i in t)t[i].show&&u.push({...t[i],list:(null==(a=null==(e=t[i].list)?void 0:e.slice)?void 0:a.call(e,0,l.mainXCell))||[],key:i});return u.sort(((e,a)=>e.seq-a.seq))})),ae=a((()=>{var e;const{left:a,right:t}=w.data,l=a.yScaleValue.find((e=>"temperature"===e.type)),u=(null==t?void 0:t.yScaleValue)||{};if(null==(e=null==l?void 0:l.list)?void 0:e.length){const e=(null==u?void 0:u.showdetailedScale)?l.list.reduce((e=>{const a=e[e.length-1];return a?e.concat([a+1,a+2]):e.concat([92])}),[]):[],a=l.list.map((e=>s(1.8*e+32)));Object.assign(u,{list:a,detailedList:e,spaceGridNumber:l.spaceGridNumber})}return u})),te=e({canvasWidth:w.data.width,canvasHeight:w.data.height,borderStyle:{...u,...w.data.borderStyle||{}},selectionStyle:w.data.selectionStyle||{},dateHeight:X.value,hospitalDaysHeight:L.value,operationDaysHeight:M.value,xScalevalueHeight:I.value,childbirthDaysHeight:O.value,topList:ee.value,breathingHeight:N.value,hospitalizationDate:w.data.hospitalizationDate,grid:w.data.grid,top:w.data.top,left:w.data.left,right:w.data.right,bottom:w.data.bottom,other:w.data.other,painIndex:Q.value,painHeight:U.value,painOriginY:Z.value,vitalSignsOriginY:_.value,gridXNumber:k.value,gridYNumber:R.value,iconsWidth:B.value,originX:A.value,originY:q.value,endX:W.value,endXLimit:$.value,endY:T.value,xCellWidth:z.value,yCellHeight:G.value,xScaleList:E.value,event:F.value,itemList:J.value,getRightInfo:ae.value,config:w.data.config||{},surplusCell:H.value,painSurplusCell:V.value,mainSurplusCell:P.value,painScalePositionSurplusHeight:K.value}),{computedX:le,computedY:ue,getXValue:ie,getYValue:ne}=i(te);return t((()=>S.value),(e=>{e&&function(){h(S,te);const{setPopup:e,isAddPoint:a,updateData:t,redrawPoints:l,clickMenu:u,gridPoints:i,fixedNoRisePoints:r}=m(S,te,b,le,ue,ie,ne,w.addRenderItem,j,x);D.redrawPoints=l,D.clickMenu=u;const{drawScaleValue:o}=p(S,te,b,e,j,le,ue,ie,ne,a,t,i);g(S,te,o),f(S,te),y(S,te,b,le,ue,r);const{select:s}=n(S,te,b);D.select=s}()}),{immediate:!0}),{propItems:te,...l(D)}}export{S as useTemperatureChart};
|
@@ -1 +1 @@
|
|
1
|
-
import{fabric as e}from"../../../../shared/utils/fabricjs/index.js";import{drawLine as l,defaultStyle as s}from"./useDraw.js";function n(n,
|
1
|
+
import{fabric as e}from"../../../../shared/utils/fabricjs/index.js";import{drawLine as l,defaultStyle as s}from"./useDraw.js";function n(n,i){var u,r,t;const{gridYNumber:o,originY:d,grid:a,originX:b,endX:c,xCellWidth:C,yCellHeight:g,gridXNumber:S,endY:m,borderStyle:p,mainSurplusCell:X,isTemperature:f}=i,Y=null!=(u=null!=X?X:i.surplusCell)?u:[0,0,0,0],h=[],y=[],v=new Set,j=(null==(r=a.mainLineStyle)?void 0:r.x)||{},x=(null==(t=a.mainLineStyle)?void 0:t.y)||{},L=a.subLineStyle||j,w=a.subSecondLineStyle||{},{originY:O=0,endY:N=0}=i.vitalSignsOriginY||{},T=Math.round((m-N)/g);for(let e=0;e<=o;e++){const s=d+~~(g*(o-e)),n={...p,...L},i=l([b,s,c,s],n);if(!f&&(e-Y[2])%a.subYCell==0&&e<=o-Y[0])i.set(j),v.add(i);else if(f){const l=d+g*(o-e);l>=O&&l<=N+1&&(e-T)%a.subYCell==0?(i.set(j),v.add(i)):h.push(i)}else h.push(i)}for(let e=0;e<=S;e++){const s=b+~~(C*e),n={...p,...a.subXCell?L:x};a.subXCell&&e%a.subXCell==0?Object.assign(n,{...0!==e&&e!==S?x:p}):a.subSecondXCell&&e%a.subSecondXCell==0&&Object.assign(n,w);const i=l([s,d,s,m],n);a.subXCell&&e%a.subXCell==0?v.add(i):y.push(i)}const k=new e.Group([...h,...y,...v],s);n.value.add(k),n.value.sendToBack(k)}export{n as useGrid};
|
@@ -532,9 +532,9 @@ declare const _default: import("vue").DefineComponent<{
|
|
532
532
|
}>;
|
533
533
|
developMode: boolean;
|
534
534
|
draggable: boolean;
|
535
|
-
isHighlightRow: boolean;
|
536
535
|
idx: number;
|
537
536
|
isHighlight: boolean;
|
537
|
+
isHighlightRow: boolean;
|
538
538
|
isFieldSet: boolean;
|
539
539
|
fieldDescribeMode: "column" | "tooltip";
|
540
540
|
hideExpressionOption: AnyObject[];
|
@@ -561,9 +561,9 @@ declare const _default: import("vue").DefineComponent<{
|
|
561
561
|
}>;
|
562
562
|
developMode: boolean;
|
563
563
|
draggable: boolean;
|
564
|
-
isHighlightRow: boolean;
|
565
564
|
idx: number;
|
566
565
|
isHighlight: boolean;
|
566
|
+
isHighlightRow: boolean;
|
567
567
|
isFieldSet: boolean;
|
568
568
|
fieldDescribeMode: "column" | "tooltip";
|
569
569
|
hideExpressionOption: AnyObject[];
|
@@ -720,9 +720,9 @@ declare const _default: import("vue").DefineComponent<{
|
|
720
720
|
}>;
|
721
721
|
developMode: boolean;
|
722
722
|
draggable: boolean;
|
723
|
-
isHighlightRow: boolean;
|
724
723
|
idx: number;
|
725
724
|
isHighlight: boolean;
|
725
|
+
isHighlightRow: boolean;
|
726
726
|
isFieldSet: boolean;
|
727
727
|
fieldDescribeMode: "column" | "tooltip";
|
728
728
|
hideExpressionOption: AnyObject[];
|
@@ -383,9 +383,9 @@ declare const _default: import("vue").DefineComponent<{
|
|
383
383
|
}>;
|
384
384
|
developMode: boolean;
|
385
385
|
draggable: boolean;
|
386
|
-
isHighlightRow: boolean;
|
387
386
|
idx: number;
|
388
387
|
isHighlight: boolean;
|
388
|
+
isHighlightRow: boolean;
|
389
389
|
isFieldSet: boolean;
|
390
390
|
fieldDescribeMode: "column" | "tooltip";
|
391
391
|
hideExpressionOption: AnyObject[];
|
@@ -1928,6 +1928,8 @@ declare const FormConfig: SFCWithInstall<import("vue").DefineComponent<{
|
|
1928
1928
|
linebarDirection?: "horizontal" | "vertical" | undefined;
|
1929
1929
|
linebarTextDirection?: "horizontal" | "vertical" | undefined;
|
1930
1930
|
labelColor?: string | undefined;
|
1931
|
+
fieldTitleRed?: boolean | import("..").FormCommonState | undefined;
|
1932
|
+
fieldTitleColor?: string | undefined;
|
1931
1933
|
fieldType?: import("@formily/json-schema").SchemaTypes | undefined;
|
1932
1934
|
content?: string | import("..").FormRenderer | Record<string, import("..").FormRenderer> | undefined;
|
1933
1935
|
lazyRequest?: boolean | undefined;
|
@@ -2178,6 +2180,8 @@ declare const FormConfig: SFCWithInstall<import("vue").DefineComponent<{
|
|
2178
2180
|
linebarDirection?: "horizontal" | "vertical" | undefined;
|
2179
2181
|
linebarTextDirection?: "horizontal" | "vertical" | undefined;
|
2180
2182
|
labelColor?: string | undefined;
|
2183
|
+
fieldTitleRed?: boolean | import("..").FormCommonState | undefined;
|
2184
|
+
fieldTitleColor?: string | undefined;
|
2181
2185
|
fieldType?: import("@formily/json-schema").SchemaTypes | undefined;
|
2182
2186
|
content?: string | import("..").FormRenderer | Record<string, import("..").FormRenderer> | undefined;
|
2183
2187
|
lazyRequest?: boolean | undefined;
|
@@ -2401,6 +2405,8 @@ declare const FormConfig: SFCWithInstall<import("vue").DefineComponent<{
|
|
2401
2405
|
linebarDirection?: "horizontal" | "vertical" | undefined;
|
2402
2406
|
linebarTextDirection?: "horizontal" | "vertical" | undefined;
|
2403
2407
|
labelColor?: string | undefined;
|
2408
|
+
fieldTitleRed?: boolean | import("..").FormCommonState | undefined;
|
2409
|
+
fieldTitleColor?: string | undefined;
|
2404
2410
|
fieldType?: import("@formily/json-schema").SchemaTypes | undefined;
|
2405
2411
|
content?: string | import("..").FormRenderer | Record<string, import("..").FormRenderer> | undefined;
|
2406
2412
|
lazyRequest?: boolean | undefined;
|
@@ -2632,6 +2638,8 @@ declare const FormConfig: SFCWithInstall<import("vue").DefineComponent<{
|
|
2632
2638
|
linebarDirection?: "horizontal" | "vertical" | undefined;
|
2633
2639
|
linebarTextDirection?: "horizontal" | "vertical" | undefined;
|
2634
2640
|
labelColor?: string | undefined;
|
2641
|
+
fieldTitleRed?: boolean | import("..").FormCommonState | undefined;
|
2642
|
+
fieldTitleColor?: string | undefined;
|
2635
2643
|
fieldType?: import("@formily/json-schema").SchemaTypes | undefined;
|
2636
2644
|
content?: string | import("..").FormRenderer | Record<string, import("..").FormRenderer> | undefined;
|
2637
2645
|
lazyRequest?: boolean | undefined;
|
@@ -3816,9 +3824,14 @@ declare const FormConfig: SFCWithInstall<import("vue").DefineComponent<{
|
|
3816
3824
|
required: true;
|
3817
3825
|
default: () => never[];
|
3818
3826
|
};
|
3827
|
+
bindFormRenderRef: {
|
3828
|
+
type: null;
|
3829
|
+
required: true;
|
3830
|
+
};
|
3819
3831
|
}, {
|
3820
3832
|
props: {
|
3821
3833
|
modelValue: import("../../shared/types").LowCodeTypes.reactionConfig[];
|
3834
|
+
bindFormRenderRef: import("..").FormRenderExpose;
|
3822
3835
|
};
|
3823
3836
|
emit: (event: "update:modelValue" | "validateFailure", ...args: any[]) => void;
|
3824
3837
|
cssVars: import("vue").ComputedRef<import("../../shared/types").AnyObject>;
|
@@ -3870,46 +3883,152 @@ declare const FormConfig: SFCWithInstall<import("vue").DefineComponent<{
|
|
3870
3883
|
removeCondition: (config: import("../../shared/types").LowCodeTypes.reactionConfig, index: number) => void;
|
3871
3884
|
onUpdateConditionType: (condition: import("../../shared/types").LowCodeTypes.reactionsConObj, type: import("../../shared/types").LowCodeTypes.VALUE_RELATION) => void;
|
3872
3885
|
showRef: import("vue").Ref<boolean>;
|
3886
|
+
addSetValueField: (item: import("../../shared/types").LowCodeTypes.reactionConfig) => void;
|
3873
3887
|
fieldListRef: import("vue").Ref<import("./src/types").FormConfigItem[]>;
|
3874
3888
|
fieldOptions: import("vue").ComputedRef<import("./src/types").FormConfigItem[]>;
|
3889
|
+
setValueTypes: string[];
|
3875
3890
|
setValueFieldOptions: import("vue").ComputedRef<import("./src/types").FormConfigItem[]>;
|
3876
3891
|
currentTypeList: string[];
|
3877
3892
|
dialog: import("naive-ui").DialogApi;
|
3878
3893
|
onNegativeClick: () => Promise<void>;
|
3879
3894
|
onPositiveClick: () => Promise<void>;
|
3880
3895
|
configValidate: () => Promise<void>;
|
3881
|
-
|
3882
|
-
|
3883
|
-
|
3884
|
-
|
3885
|
-
|
3886
|
-
|
3887
|
-
|
3888
|
-
}
|
3896
|
+
generateFieldListByKeys: (keyList: import("./src/constants").EditAbleField[], formConfigItem?: import("./src/types").FormConfigItem | undefined, fieldItem?: import("..").FieldItem | undefined) => import("..").FieldItem[];
|
3897
|
+
setValueFormFieldList: (field: string) => {
|
3898
|
+
val_key: string;
|
3899
|
+
alias: string;
|
3900
|
+
decoratorProps: {
|
3901
|
+
showFeedback: boolean;
|
3902
|
+
};
|
3903
|
+
html_type: "LINEBAR" | ({} & string) | "INPUT" | "TEXTAREA" | "SELECT" | "LINE_BREAKS" | "INPUT_NUMBER" | "REMOTE_SEARCH" | "DATE" | "LEVEL_SEARCH_CASCADER" | "SEARCH_CASCADER" | "COMBINATION" | "RADIO" | "CHECKBOX" | "SWITCH" | "SLIDER" | "COMPLEX" | "SEARCH" | "PHONE_TYPE" | "IDCARD_TYPE" | "SEARCH_MORE" | "DIGITAL" | "CHECKBOX_BLOCK" | "RADIO_BLOCK" | "DATE-INPUT" | "DATETIME-INPUT" | "SWITCH_COMPONENT" | "SLIDER_COMPONENT" | "LEVEL_SEARCH_CASCADE" | "SEARCH_CASCADE";
|
3904
|
+
annotation?: boolean | undefined;
|
3905
|
+
val_key_unit?: string | undefined;
|
3906
|
+
is_edit?: import("..").FormCommonState | undefined;
|
3907
|
+
elem_width?: number | undefined;
|
3908
|
+
is_show?: import("..").FormCommonState | undefined;
|
3909
|
+
is_null?: import("..").FormCommonState | undefined;
|
3910
|
+
name?: string | undefined;
|
3911
|
+
default_val?: any;
|
3912
|
+
is_empty?: import("..").FormCommonState | undefined;
|
3913
|
+
hide_title?: import("..").FormCommonState | undefined;
|
3914
|
+
placeholder?: string | undefined;
|
3915
|
+
validate?: Partial<{
|
3889
3916
|
[key: string]: any;
|
3890
|
-
|
3891
|
-
|
3892
|
-
|
3893
|
-
|
3894
|
-
|
3895
|
-
|
3896
|
-
|
3897
|
-
|
3917
|
+
obj_type: "password" | "sex" | "age" | "email" | "birthday" | "id_card" | "age_unit" | "mobile" | "telephone" | "bank_card" | "website" | "gestational_weeks" | "gestational_stage" | "customer_name";
|
3918
|
+
vali_obj: string;
|
3919
|
+
max_value: string | number;
|
3920
|
+
min_value: string | number;
|
3921
|
+
min_date: string;
|
3922
|
+
max_date: string;
|
3923
|
+
min_length: string | number;
|
3924
|
+
max_length: string | number;
|
3925
|
+
decimal_length: string | number;
|
3926
|
+
regular_expression: string | RegExp;
|
3927
|
+
regular_error_tip: string;
|
3928
|
+
message: string;
|
3929
|
+
}> | undefined;
|
3930
|
+
option?: import("..").FormOptionItem[] | undefined;
|
3931
|
+
multi_select?: import("..").FormCommonState | undefined;
|
3932
|
+
multi_select_value?: string | number | undefined;
|
3933
|
+
wordbook?: Partial<{
|
3934
|
+
level_num: number;
|
3935
|
+
id: string;
|
3936
|
+
name: string;
|
3937
|
+
render_key: string[];
|
3938
|
+
search_key: string[];
|
3939
|
+
value_key: string;
|
3940
|
+
queryParams: string[];
|
3941
|
+
primary_key: string;
|
3942
|
+
type: string;
|
3943
|
+
level_key: string;
|
3944
|
+
link_key: string;
|
3945
|
+
link_key_split: string;
|
3946
|
+
show_key: string | string[];
|
3947
|
+
conObj: import("../../shared/types").AnyObject[];
|
3948
|
+
conObjFirstLevel: import("../../shared/types").AnyObject[];
|
3949
|
+
setting: Partial<{
|
3950
|
+
cascading: {
|
3951
|
+
'form.name': string;
|
3952
|
+
value: string;
|
3953
|
+
}[];
|
3954
|
+
}>;
|
3955
|
+
}> | undefined;
|
3956
|
+
open?: import("../../shared/types").LowCodeTypes.switchProperty | undefined;
|
3957
|
+
close?: import("../../shared/types").LowCodeTypes.switchProperty | undefined;
|
3958
|
+
requiredReminderContent?: string | undefined;
|
3959
|
+
date_format?: string | undefined;
|
3960
|
+
step_length?: string | number | undefined;
|
3961
|
+
urlConfig?: import("..").UrlConfig | undefined;
|
3962
|
+
suffixConfig?: import("../../shared/types").ArrayAble<import("..").FieldItem> | undefined;
|
3963
|
+
prefixConfig?: import("../../shared/types").ArrayAble<import("..").FieldItem> | undefined;
|
3964
|
+
autograph?: string | undefined;
|
3965
|
+
defined_error_msg?: string | undefined;
|
3966
|
+
extendKey?: string | undefined;
|
3967
|
+
is_not_fold?: string | undefined;
|
3968
|
+
remark?: string | undefined;
|
3969
|
+
free_entry?: import("..").FormCommonState | undefined;
|
3970
|
+
save_free_entry?: import("..").FormCommonState | undefined;
|
3971
|
+
initialize_high?: number | undefined;
|
3972
|
+
bindEventSetting?: import("../../shared/types").LowCodeTypes.BindEventSettingItem[] | undefined;
|
3973
|
+
show_mode?: import("../../shared/types").LowCodeTypes.showModeType | undefined;
|
3974
|
+
is_allow_check_mid?: import("..").FormCommonState | undefined;
|
3975
|
+
allow_check_mid_level?: "1" | "2" | "3" | "4" | undefined;
|
3976
|
+
prefix?: string | import("../../shared/types").AnyObject | (() => any) | undefined;
|
3977
|
+
suffix?: string | import("../../shared/types").AnyObject | (() => any) | undefined;
|
3978
|
+
allowSlash?: string | boolean | undefined;
|
3979
|
+
allowModify?: import("..").FormCommonState | undefined;
|
3980
|
+
show_key?: string | undefined;
|
3981
|
+
whiteList?: string[] | undefined;
|
3982
|
+
bordered?: string | boolean | undefined;
|
3983
|
+
displayMode?: "form" | "table" | undefined;
|
3984
|
+
editor_title?: string | undefined;
|
3985
|
+
editor_title_mode?: "EMBEDDED_FORM" | "HOVER_TOOLTIP" | "POPUP_ALERT" | undefined;
|
3986
|
+
linebarWidth?: string | undefined;
|
3987
|
+
linebarDirection?: "horizontal" | "vertical" | undefined;
|
3988
|
+
linebarTextDirection?: "horizontal" | "vertical" | undefined;
|
3989
|
+
labelColor?: string | undefined;
|
3990
|
+
fieldTitleRed?: boolean | import("..").FormCommonState | undefined;
|
3991
|
+
fieldTitleColor?: string | undefined;
|
3992
|
+
fieldType?: import("@formily/json-schema").SchemaTypes | undefined;
|
3993
|
+
content?: string | import("..").FormRenderer | Record<string, import("..").FormRenderer> | undefined;
|
3994
|
+
lazyRequest?: boolean | undefined;
|
3995
|
+
requestCache?: boolean | undefined;
|
3996
|
+
maxGroupNum?: number | undefined;
|
3997
|
+
minGroupNum?: number | undefined;
|
3998
|
+
jsonCombination?: boolean | undefined;
|
3999
|
+
combinationItemDeletable?: boolean | import("..").CombinationItemDeletableFn | undefined;
|
4000
|
+
children?: import("..").FieldItem[] | undefined;
|
4001
|
+
properties?: import("..").FieldItem[] | undefined;
|
4002
|
+
componentProps?: import("../../shared/types").AnyObject | undefined;
|
4003
|
+
noDecorator?: Boolean | undefined;
|
4004
|
+
display?: "flex" | "grid" | undefined;
|
4005
|
+
slots?: Record<string, (...args: unknown[]) => unknown> | undefined;
|
4006
|
+
wrapperStyle?: Record<string, string | number> | undefined;
|
4007
|
+
childFieldStrategy?: "checked" | "all" | undefined;
|
4008
|
+
childWidthMode?: "inner" | "outer" | undefined;
|
4009
|
+
validator?: ((value: unknown, fieldItem: import("..").FieldItem, field: import("@formily/core").Field<any, any, any, any>) => string | void) | undefined;
|
4010
|
+
reactions?: import("../../shared/types").ArrayAble<import("..").ReactionType> | undefined;
|
4011
|
+
}[];
|
4012
|
+
removeSetValueField: (item: import("../../shared/types").LowCodeTypes.reactionConfig, index: number) => void;
|
4013
|
+
onFormChange: (payload: import("..").FormChangePayload, item: {
|
4014
|
+
field: string;
|
4015
|
+
value: string;
|
4016
|
+
}) => void;
|
3898
4017
|
HelpCircleSharp: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
|
3899
4018
|
NButton: any;
|
3900
|
-
NModal: any;
|
3901
|
-
NSpace: any;
|
3902
|
-
NScrollbar: any;
|
3903
|
-
NThing: any;
|
3904
|
-
NInputGroup: any;
|
3905
|
-
NSelect: any;
|
3906
|
-
NInput: any;
|
3907
4019
|
NCollapse: any;
|
3908
4020
|
NCollapseItem: any;
|
3909
4021
|
NEllipsis: any;
|
3910
4022
|
NEmpty: any;
|
3911
|
-
NTooltip: any;
|
3912
4023
|
NIcon: any;
|
4024
|
+
NInput: any;
|
4025
|
+
NInputGroup: any;
|
4026
|
+
NModal: any;
|
4027
|
+
NScrollbar: any;
|
4028
|
+
NSelect: any;
|
4029
|
+
NSpace: any;
|
4030
|
+
NThing: any;
|
4031
|
+
NTooltip: any;
|
3913
4032
|
conditionTypeOptions: {
|
3914
4033
|
value: import("../../shared/types").LowCodeTypes.VALUE_RELATION;
|
3915
4034
|
label: string;
|
@@ -4929,6 +5048,10 @@ declare const FormConfig: SFCWithInstall<import("vue").DefineComponent<{
|
|
4929
5048
|
required: true;
|
4930
5049
|
default: () => never[];
|
4931
5050
|
};
|
5051
|
+
bindFormRenderRef: {
|
5052
|
+
type: null;
|
5053
|
+
required: true;
|
5054
|
+
};
|
4932
5055
|
}>> & {
|
4933
5056
|
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
|
4934
5057
|
onValidateFailure?: ((...args: any[]) => any) | undefined;
|