cnhis-design-vue 3.2.10-beta.1 → 3.2.10-beta.18
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/README.md +87 -87
- package/es/components/ai-chat/index.d.ts +2 -2
- package/es/components/ai-chat/src/Index.vue.d.ts +2 -2
- package/es/components/ai-chat/src/components/ChatFooter.vue.d.ts +2 -2
- package/es/components/ai-chat/src/components/ChatFooter.vue2.js +1 -1
- package/es/components/ai-chat/src/components/ChatMain.js +1 -1
- package/es/components/ai-chat/style/index.css +1 -1
- package/es/components/base-search/index.d.ts +3 -0
- package/es/components/base-search/src/index.vue.d.ts +3 -0
- package/es/components/bpmn-workflow/src/BpmnWorkflow.d.ts +0 -0
- package/es/components/bpmn-workflow/types/BpmnViewer.d.ts +1 -0
- package/es/components/bpmn-workflow/types/ModelingModule.d.ts +1 -0
- package/es/components/bpmn-workflow/types/MoveCanvasModule.d.ts +1 -0
- package/es/components/button-print/src/utils/print.js +1 -1
- package/es/components/card-reader-sdk/src/insuranceSDK.js +1 -1
- package/es/components/card-reader-sdk/src/utils/index.js +1 -1
- package/es/components/classification/index.d.ts +1 -1
- package/es/components/classification/src/components/search-filter/index.vue.d.ts +1 -1
- package/es/components/classification/src/components/set-classification/index.vue.d.ts +1 -1
- package/es/components/classification/src/components/table-modal/index.vue.d.ts +0 -3
- package/es/components/classification/src/index.vue.d.ts +1 -1
- package/es/components/date-picker/src/DatePicker.vue2.js +1 -1
- package/es/components/fabric-chart/src/hooks/birthProcess/useBirthProcess.js +1 -1
- package/es/components/fabric-chart/src/hooks/birthProcess/useBirthProcessChart.js +1 -1
- package/es/components/fabric-chart/src/hooks/temperature/useCenter.js +1 -1
- package/es/components/field-set/index.d.ts +13 -0
- package/es/components/field-set/src/FieldColor.vue.d.ts +73 -27
- package/es/components/field-set/src/FieldColor.vue2.js +1 -1
- package/es/components/field-set/src/FieldFilter.vue.d.ts +20 -5
- package/es/components/field-set/src/FieldFilter.vue2.js +1 -1
- package/es/components/field-set/src/FieldSet.vue.d.ts +6 -3
- package/es/components/field-set/src/Index.vue.d.ts +13 -0
- package/es/components/field-set/src/Index.vue2.js +1 -1
- package/es/components/field-set/src/components/condition.vue.d.ts +18 -4
- package/es/components/field-set/src/components/condition.vue2.js +1 -1
- package/es/components/field-set/src/components/edit-dialog.vue.d.ts +63 -22
- package/es/components/field-set/src/components/edit-dialog.vue2.js +1 -1
- package/es/components/field-set/src/components/edit-filter.vue.d.ts +44 -44
- package/es/components/field-set/src/components/edit-filter.vue2.js +1 -1
- package/es/components/field-set/src/components/table-row.vue.d.ts +6 -3
- package/es/components/field-set/src/components/table-row.vue2.js +1 -1
- package/es/components/field-set/style/index.css +1 -1
- package/es/components/form-config/index.d.ts +3 -3
- package/es/components/form-config/src/FormConfig.vue.d.ts +3 -3
- package/es/components/form-config/src/components/FormConfigEdit.vue.d.ts +3 -3
- package/es/components/form-render/index.js +1 -1
- package/es/components/form-render/src/components/renderer/combination/combination.d.ts +1 -1
- package/es/components/form-render/src/components/renderer/combination/jsonCombination.d.ts +1 -1
- package/es/components/form-render/src/components/renderer/combination/tableCombination.d.ts +1 -1
- package/es/components/form-render/src/components/renderer/lineBar/FormCollapse.vue.d.ts +1 -1
- package/es/components/form-render/src/components/renderer/lineBar/index.d.ts +1 -1
- package/es/components/form-render/src/components/renderer/text.d.ts +1 -1
- package/es/components/form-render/src/components/renderer/text.js +1 -1
- package/es/components/form-render/src/hooks/useFieldListAdaptor.js +1 -1
- package/es/components/form-render/src/hooks/useFieldNormalize.js +1 -1
- package/es/components/form-render/src/types/fieldItem.d.ts +1 -1
- package/es/components/form-render/src/types/index.d.ts +4 -3
- package/es/components/form-render/src/utils/index.d.ts +2 -0
- package/es/components/form-render/src/utils/index.js +1 -1
- package/es/components/iho-chat/index.d.ts +8 -8
- package/es/components/iho-chat/src/Index.vue.d.ts +8 -8
- package/es/components/iho-chat/src/components/ChatAdd.vue.d.ts +1 -1
- package/es/components/iho-chat/src/components/ChatFile.vue.d.ts +1 -1
- package/es/components/iho-chat/src/components/ChatFooter.vue.d.ts +1 -1
- package/es/components/iho-chat/src/components/ChatFooter.vue2.js +1 -1
- package/es/components/iho-chat/src/components/ChatHeader.vue.d.ts +3 -3
- package/es/components/iho-chat/src/components/ChatMain.vue.d.ts +2 -2
- package/es/components/iho-chat/src/components/ChatMain.vue2.js +1 -1
- package/es/components/iho-chat/src/components/ChatSet.vue.d.ts +1 -1
- package/es/components/iho-chat/src/components/ContextMenu.js +1 -1
- package/es/components/iho-chat/src/components/MultipleVideo.vue.d.ts +1 -1
- package/es/components/iho-chat/src/components/PersonProfile.vue2.js +1 -1
- package/es/components/iho-chat/src/utils/index.d.ts +1 -1
- package/es/components/iho-chat/src/utils/index.js +1 -1
- package/es/components/iho-table/src/plugins/filterDaterangeRenderPlugin/index.js +1 -1
- package/es/components/iho-table/src/plugins/filterRenderPlugin/filter.vue.d.ts +1 -0
- package/es/components/iho-table/src/plugins/filterRenderPlugin/filter.vue2.js +1 -1
- package/es/components/iho-table/src/plugins/filterRenderPlugin/index.js +1 -1
- package/es/components/iho-table/src/plugins/filterTextPlugin/filter.vue.d.ts +30 -0
- package/es/components/iho-table/src/plugins/filterTextPlugin/filter.vue.js +1 -0
- package/es/components/iho-table/src/plugins/filterTextPlugin/filter.vue2.js +1 -0
- package/es/components/iho-table/src/plugins/filterTextPlugin/index.d.ts +1 -0
- package/es/components/iho-table/src/plugins/filterTextPlugin/index.js +1 -0
- package/es/components/iho-table/src/plugins/headerPlugin/index.js +1 -1
- package/es/components/iho-table/src/plugins/index.js +1 -1
- package/es/components/iho-table/src/plugins/lowCodeFieldAdaptorPlugin.js +1 -1
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/inputRendererPlugin.js +1 -1
- package/es/components/iho-table/src/plugins/verticalTablePlugin/src/utils.js +1 -1
- package/es/components/iho-table/src/types/index.d.ts +1 -0
- package/es/components/iho-table/src/utils/index.d.ts +3 -1
- package/es/components/iho-table/src/utils/index.js +1 -1
- package/es/components/index.css +1 -1
- package/es/components/index.js +1 -1
- package/es/components/quick-search/index.d.ts +18 -0
- package/es/components/quick-search/src/index.vue.d.ts +18 -0
- package/es/components/quick-search/src/index.vue2.js +1 -1
- package/es/components/scale-view/src/ScaleView.vue2.js +1 -1
- package/es/components/scale-view/src/components/formitem/r-upload.d.ts +4 -4
- package/es/components/scale-view/src/components/formitem/r-upload.js +1 -1
- package/es/components/scale-view/src/components/formitem/standard-modal.d.ts +1 -1
- package/es/components/scale-view/src/hooks/use-component.d.ts +10 -8
- package/es/components/scale-view/style/index.css +1 -1
- package/es/components/select-label/src/LabelFormContent.vue2.js +1 -1
- package/es/components/shortcut-setter/index.d.ts +1 -1
- package/es/components/shortcut-setter/src/ShortcutSetter.vue.d.ts +1 -1
- package/es/components/table-filter/src/components/bi-filter/helpers/options.d.ts +1 -7
- package/es/components/table-filter/src/components/classify-filter/ValueCfg.vue.d.ts +1 -1
- package/es/components/table-filter/src/components/classify-filter/components/SelectTreeDynamic.vue.d.ts +1 -1
- package/es/components/table-filter/src/components/classify-filter/components/index.d.ts +1 -1
- package/es/components/table-filter/src/components/classify-filter/index.vue.d.ts +1 -1
- package/es/components/table-filter/src/components/render-widget/components/SelectTreeDynamic.vue.d.ts +1 -1
- package/es/components/table-filter/src/components/render-widget/components/index.d.ts +5 -5
- package/es/components/table-filter/src/components/render-widget/helpers/dateExtraMap.d.ts +3 -49
- package/es/components/table-filter/src/components/render-widget/helpers/enums.d.ts +1 -18
- package/es/components/table-filter/src/components/render-widget/widgetCfgMaps.d.ts +5 -5
- package/es/components/table-filter/src/hooks/useAdvanced.d.ts +1 -0
- package/es/components/table-filter/src/hooks/useAdvanced.js +1 -1
- package/es/components/table-filter/src/hooks/useMixins.d.ts +1 -1
- package/es/components/table-filter/src/hooks/useRenderWidget.js +1 -1
- package/es/components/table-filter/src/types/index.d.ts +3 -0
- package/es/components/vod-chunk-upload/index.d.ts +2 -0
- package/es/components/vod-chunk-upload/src/chunk-upload-new.vue.d.ts +18 -4
- package/es/components/vod-chunk-upload/src/chunk-upload-new.vue2.js +1 -1
- package/es/components/vod-chunk-upload/src/hooks/upload-data.d.ts +5 -1
- package/es/components/vod-chunk-upload/src/hooks/upload-data.js +1 -1
- package/es/components/vod-chunk-upload/src/hooks/vod-computed.js +1 -1
- package/es/components/vod-chunk-upload/src/vod-chunk-upload/vod-chunk-upload.vue.d.ts +2 -0
- package/es/components/vod-chunk-upload/src/vod-chunk-upload/vod-chunk-upload.vue2.js +1 -1
- package/es/env.d.ts +25 -25
- package/es/shared/assets/img/ai__avatar.png.js +1 -1
- package/es/shared/assets/img/defaultCover/10review_successful.png.js +1 -1
- package/es/shared/assets/img/defaultCover/11review_fail.png.js +1 -1
- package/es/shared/assets/img/defaultCover/12no_setting.png.js +1 -1
- package/es/shared/assets/img/defaultCover/13no_menu_setting.png.js +1 -1
- package/es/shared/assets/img/defaultCover/14no_call_setting.png.js +1 -1
- package/es/shared/assets/img/defaultCover/15no_use_tag.png.js +1 -1
- package/es/shared/assets/img/defaultCover/16no_table_data.png.js +1 -1
- package/es/shared/assets/img/defaultCover/1location.png.js +1 -1
- package/es/shared/assets/img/defaultCover/2notfound.png.js +1 -1
- package/es/shared/assets/img/defaultCover/3loading.png.js +1 -1
- package/es/shared/assets/img/defaultCover/4no_permission.png.js +1 -1
- package/es/shared/assets/img/defaultCover/5no_data.png.js +1 -1
- package/es/shared/assets/img/defaultCover/6no_network.png.js +1 -1
- package/es/shared/assets/img/defaultCover/7no_doctor.png.js +1 -1
- package/es/shared/assets/img/defaultCover/8system_error.png.js +1 -1
- package/es/shared/assets/img/defaultCover/9system_upgrade.png.js +1 -1
- package/es/shared/assets/img/failure.png.js +1 -1
- package/es/shared/assets/img/logo.png.js +1 -1
- package/es/shared/assets/img/no-permission.png.js +1 -1
- package/es/shared/assets/img/nodata.png.js +1 -1
- package/es/shared/assets/img/notfound.png.js +1 -1
- package/es/shared/assets/img/qr.png.js +1 -1
- package/es/shared/assets/img/success.png.js +1 -1
- package/es/shared/assets/img/table_style_2.png.js +1 -1
- package/es/shared/assets/img/video.png.js +1 -1
- package/es/shared/assets/img/video_default_cover.png.js +1 -1
- package/es/shared/assets/img/xb_big.png.js +1 -1
- package/es/shared/assets/img/xb_small.png.js +1 -1
- package/es/shared/components/VueDraggable/src/vuedraggable.d.ts +86 -0
- package/es/shared/package.json.js +1 -1
- package/es/shared/utils/fabricjs/index.d.ts +6823 -0
- package/es/shared/utils/index.js +1 -1
- package/es/shared/utils/tapable/index.d.ts +139 -0
- package/package.json +2 -2
@@ -1 +1 @@
|
|
1
|
-
import{fabric as
|
1
|
+
import{fabric as e}from"../../../../../shared/utils/fabricjs/index.js";import{drawLine as t,drawArrow as n,drawText as o,defaultTextStyle as i,drawPoint as r,drawTextAndIconGroup as l,defaultStyle as s,defaultRectStyle as a}from"../useDraw.js";import{useGrid as u}from"../useGrid.js";import{useBirthProcessCumputedPoint as c}from"../useCumputedPoint.js";import"../useEvent.js";import{getScaleInfo as d,drawScaleNumber as f,drawScaleLine as p}from"../useScaleColumn.js";import{useCommon as h}from"../useCommon.js";import"vue";import{getIndex as g,isEffectiveNode as m,getTime as v,getScaleNumberList as y}from"../../utils/index.js";import{cloneDeep as k,last as w,range as x}from"lodash-es";import"../temperature/useShadow.js";import"@vueuse/shared";import{format as b}from"date-fns";import"naive-ui";import"@vueuse/core";function j(j,C,P,S,E){const{computedX:X,computedY:G,getXValue:T,getYValue:A}=c(C),{getEqualXTypes:L,handleAddPrevent:Y,isGridLimit:M,setPrevAndNextPoint:I,getPointEventProps:H}=h(j,P,C),{xAxis:W,grid:D,originX:N,originY:O,xCellWidth:V,endY:R,startTime:$,leftAddAreaWidth:B,leftScales:F,rightScales:q,yCellHeight:z,endX:J,scaleValues:K,canvasWidth:Q,borderStyle:U,rightAddAreaWidth:Z,event:_,originYCervix:ee,other:te,canvasHeight:ne}=C,oe=k(K),ie=new Set;function re(){oe.filter((({showData:e=!0})=>e)).forEach(((e,l)=>{var s;const a=[],u=[],c=[];null==(s=e.data)||s.forEach(((s,d)=>{!function(s,d,f){let p,h;const{pointAttr:g={},lineAttr:m={},title:v="",key:y,type:k="circle",childbirthStyle:w={}}=e,x=e.data[f+1],b=ce(x,e);if(s&&b&&!d.breakpoint)h=t([...s,...b],{...m});else if(s&&!b&&!d.breakpoint){const n=ce(x,e);h=n?t([...s,...n],{...m}):null}let C,E;if(d.childbirth){const e=s[1]+z;C=n([s[0],s[1],e],w),c.push(C),E=o([s[0]+V/2,e-z/2],{value:String(d.childbirth),...i,originX:"left",originY:"center",...w}),c.push(E)}const X=u[f-1],G={origin:{data:d,title:v,key:y||"",dataIndex:l,index:f},leftLine:X,rightLine:h,arrowGroup:C,arrowGroupText:E,...g,...H()};s&&(X||(G.leftLine=null),p=r(k,{left:s[0],top:s[1],...G}));u.push(h),p&&(!function(e){_.hovered&&(e.on("mouseover",(()=>{ue(e,"hover")})),e.on("mouseout",(()=>{S.show=!1})));if(e.lockMovementX&&e.lockMovementY)return;e.on("moving",(()=>{ae(e),function(e){var t,n,o,i;null==(t=e.leftLine)||t.setCoords().set({x2:e.left,y2:e.top}),null==(n=e.rightLine)||n.setCoords().set({x1:e.left,y1:e.top}),null==(o=e.arrowGroup)||o.setCoords().set({left:e.left,top:e.top}),null==(i=e.arrowGroupText)||i.setCoords().set({left:e.left+V/2,top:e.top+z/2})}(e),_.hovered&&ue(e)})),e.on("mouseup",(t=>{if(S.show=!1,1===t.button){const{key:t}=e.origin,n={...e.origin,data:{...e.origin.data,time:T(e.left),value:A(t,e.top)}};j.value.discardActiveObject(),P("change",n),le(n,"change")}}))}(p),a.push(p),ie.add(p))}(ce(s,e),s,d)})),Promise.all(a).then((e=>{const t=u.filter((e=>e));I(e),Promise.all(c).then((n=>{j.value.add(...t,...e,...n),e.forEach((e=>{null==e||e.bringToFront()}))}))}))}))}function le(e,t="add"){const{dataIndex:n,data:o,index:i,key:r}=e,l=oe.find((e=>e.key===r));switch(t){case"remove":l.data.splice(i,1);break;case"change":l.data[i]=o;break;default:{const e=g(o.time,l.data);l.data.splice(e,0,o);break}}se()}function se(){var e;ie.size&&(null==(e=j.value)||e.remove(...function(e){const t=[];return e.forEach((e=>{e&&t.push(e),(null==e?void 0:e.leftLine)&&t.push(null==e?void 0:e.leftLine),(null==e?void 0:e.rightLine)&&t.push(null==e?void 0:e.rightLine),(null==e?void 0:e.arrowGroup)&&t.push(null==e?void 0:e.arrowGroup),(null==e?void 0:e.arrowGroupText)&&t.push(null==e?void 0:e.arrowGroupText)})),t}([...ie]))),ie.clear(),re()}function ae(e){const t=e.prevPoint?e.prevPoint.left:N,n=e.nextPoint?e.nextPoint.left:J;e.setCoords(),["cervix","fetalPresentation"].includes(e.origin.key)&&e.top<ee&&e.set("top",ee),e.top<O&&e.set("top",O),e.top>R&&e.set("top",R),e.left<t&&e.set("left",t),e.left>n&&e.set("left",n)}function ue(e,t="moving"){const{title:n,key:o,data:i}=e.origin;S.point={x:e.left,y:e.top},S.list=[`${n} ${"hover"===t?i.value:A(o,e.top)}`,`时间 ${T(e.left).slice(-5)}`],S.show=!0}function ce(e,t){if(m(e)&&function(e){const t=$+864e5,n=v(e);return n>=$&&n<=t}(e.time)){const n=X(e.time),o=G(t.key,t.range,e.value);return[n,o<O?O:o>R?R:o]}}function de(e,t){return e+1>t[1]?t[0]:e+1}return u(j,C),function(){const t=new e.Rect({...U,width:Q-B-Z-1,height:R-1,left:B,top:0,fill:"transparent"});j.value.add(t)}(),function(){function t(t,n="left"){let r="left"===n?B:J;t.forEach(((t,n)=>{const{range:l,spaceValue:u,width:c,title:h,titleStyle:g,key:m,position:v="center",spaceGridNumber:k=1,showNumber:w,showMaxMinNumber:x}=t,b=[],C=[],P=r+c/2,S=y(l,u),E=S.length,{lineXMain:X,lineXSub:G,textLeft:T}=d(v,r,c);S.forEach(((e,n)=>{const o=R-n*z*k,i=0===n?R-8:n!==S.length-1||O||ee&&"FHR"!==m?o:O+8;!w||(0===n||n===E-1)&&!x||b.push(f(String(e),t,T,i)),C.push(...p(t,n,X,G,o,z,O,E,1))}));const A=new e.Rect({...a,strokeWidth:.5,width:c,height:R,left:P,top:R/2}),L=o([P,O>0?O-z/2:z/2],{value:String(h),...i,...g}),Y=new e.Group([...C,...b,A,...L?[L]:[]],{objectCaching:!1,...s});j.value.add(Y),Y.sendToBack(),r+=c}))}t(F),t(q,"right")}(),function(){const{show:t,startTime:n,range:r=[0,23],position:l="top",style:a}=W.time,{show:u,range:c=[0,23],position:d,style:f={}}=W.processTime;if(t||u){const p=[],h=x(c[0],c[1]+1),g=[],m=[],v=z/2;for(let e=0;e<D.mainXCell;e++){if(t){const{textAlign:t="center"}=a,s=N+("center"===t?V/2:0),u=0===e&&"center"!==t?s+5:s,c=0===e?+n.slice(11,13):de(w(p),r);p.push(c);const d="top"===l?O-v:R+v;g.push(o([u+e*V,d],{value:String(c),...i,...a})),e===D.mainXCell-1&&"center"!==t&&g.push(o([J-1,d],{value:String(de(w(p),r)),...i,...a,originX:"center"!==t?"right":"center"}))}if(u&&e<=h.length){const{textAlign:t="center"}=f,n=N+("center"===t?V/2:0),r=0===e&&"center"!==t?n+5:n,l="top"===d?v:ne-v;m.push(o([r+e*V,l],{value:String(h[e]),...i,...f})),e===D.mainXCell-1&&"center"!==t&&m.push(o([J-1,l],{value:String(w(h)),...i,...a,originX:"center"!==t?"right":"center"}))}}const y=new e.Group([...g,...m],{objectCaching:!1,...s});j.value.add(y),j.value.sendToBack(y)}}(),function(){var e;const n=Object.values(te),o=[],i={},r=oe.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:n,range:o}=r||{},i=G(n,o,10),l=[0,t],s=[-t/e,0],a=[(R-i-t)/e,R-i],u=[J-N,e*(J-N)+t];let c=[],d=[];function f([n,o]){return Math.abs(o-e*n-t)<=1}function p([e,t]){const[n,o]=[...h([e,t])];return n>=N&&n<=J&&o>=i&&o<=R}function h([e,t]){return[N+e,R-t]}return f(l)&&p(l)&&(c=h(l)),f(s)&&p(s)&&(c=h(s)),f(a)&&p(a)&&(d=h(a)),f(u)&&p(u)&&(d=h(u)),[...c,...d]}n.forEach((e=>{if(!e.show)return;const{key:n}=e;switch(n){case"fetalPresentation":{const{range:i,show:r}=oe.find((e=>e.key===n));if(r){const r=G(n,i,0);o.push(t([N,r,J,r],{...e}))}break}case"alert":if(l){const{key:n,range:a}=r||{},u=216e5,c={time:b(new Date(v(l.time)+u),"yyyy-MM-dd HH:mm"),value:10},[d,f]=[X(l.time)-N,R-G(n,a,l.value)],[p,h]=[X(c.time)-N,R-G(n,a,c.value)],g=(h-f)/(p-d),m=f-d*g,y=s(g,m);y.length>0&&(o.push(t(y,{...e})),Object.assign(i,{k:g,b:m}))}break;case"handling":if(l){const{k:n,b:r}=i,a=144e5,u=s(n,r-(X(b(new Date(v(l.time)+a),"yyyy-MM-dd HH:mm"))-X(l.time))*n);u.length>0&&o.push(t(u,{...e}))}}})),j.value.add(...o)}(),re(),function(){function e(e,t){const n=oe.findIndex((t=>t.key===e.key));return{renderItem:()=>e.title,origin:{title:e.title,unit:e.unit,dataIndex:n,key:e.key},pointer:t}}C.event.evented&&j.value.on("mouse:up",(t=>{if(3===t.button){const{x:n=0,y:o=0}=t.pointer||{};n>=N&&n<=J&&o>=O&&o<=R&&(E.point={x:n,y:o},E.show=!0,t.target?(E.target=t.target,E.list=["删除节点"],[...ie].forEach((e=>{e.origin&&e.left===t.target.left&&e.top===t.target.top&&E.list.push({renderItem:()=>e.origin.title,origin:{...e.origin},mode:"remove",pointer:t.pointer})}))):(E.target=null,E.list=["新增节点"],oe.filter((e=>e.show)).forEach((i=>{if(!L([...ie],n,"key").includes(i.key)){if(["cervix","fetalPresentation"].includes(i.key)&&o<ee)return;E.list.push(e(i,t.pointer))}})),1===E.list.length&&(E.show=!1,Y("repeat"),console.log("当前时间段内无可新增节点"))))}}))}(),function(){const e=Q-Z/2;function t(e,t){if(!e.length)return;let o=O;const i=[];e.forEach((e=>{const n=e.title.split("").join("\n"),r=K.findIndex((t=>t.key===e.key)),{text:s,icon:a}=l(n,e,{text:{originY:"top",left:t,top:o},icon:{left:t,topY:o,originY:"top",origin:{type:e.type,dataIndex:r},...C.event}},"vertical");var u;o+=s.height+a.height+15,(u=a).on("moving",(()=>{u.set("originY","center"),M(u)?(ae(u),ue(u)):S.show=!1})),u.on("mouseup:before",(e=>{if(S.show=!1,0===e.e.button&&M(u))if(L([...ie],u.left,"key").includes(u.origin.key))Y("repeat");else{const e={data:{time:T(u.left),value:A(u.origin.key,u.top)},...u.origin};P("add",e),le(e)}!function(e){e.setCoords().set({originY:"top",left:e.originLeft,top:e.originTop})}(u)})),i.push(s,a)})),n(i),j.value.add(...i)}function n(e){const t=w(e),n=(R-O)/2,o=(t.height+t.top-O)/2;e.forEach((e=>{const t=e.top+n-o;e.set({top:t,originTop:t})}))}t(F,B/2),t(q,e)}(),{clickMenu:function({item:e,target:t}){const n={...e.origin};"remove"===e.mode?(P("remove",n),le(n,"remove")):(Object.assign(n,{data:{time:T(e.pointer.x),value:A(e.origin.key,e.pointer.y)}}),P("add",n),le(n))},redrawPoints:se}}export{j as useBirthProcess};
|
@@ -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"date-fns";import{getTime as r}from"../../utils/index.js";import"lodash-es";import"../useEvent.js";import"../temperature/useShadow.js";import"@vueuse/shared";import"naive-ui";import"@vueuse/core";import{useBirthProcess as i}from"./useBirthProcess.js";function s(s,n,d,o,v,c){const h=e({select:null,redrawPoints:null,clickMenu:null}),m=a((()=>n.data.scaleValues.filter((e=>"left"===e
|
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"date-fns";import{getTime as r}from"../../utils/index.js";import"lodash-es";import"../useEvent.js";import"../temperature/useShadow.js";import"@vueuse/shared";import"naive-ui";import"@vueuse/core";import{useBirthProcess as i}from"./useBirthProcess.js";function s(s,n,d,o,v,c){const h=e({select:null,redrawPoints:null,clickMenu:null}),m=a((()=>n.data.scaleValues.filter((({layout:e="left",show:a=!0})=>"left"===e&&a)))),f=a((()=>n.data.scaleValues.filter((({layout:e="left",show:a=!0})=>"right"===e&&a)))),p=a((()=>{var e;return(null==(e=f.value)?void 0:e.length)?30:0})),g=a((()=>{var e;return 30+(null==(e=m.value)?void 0:e.reduce(((e,a)=>e+=a.width),0))})),x=a((()=>{var e;const{width:a}=n.data,t=null==(e=f.value)?void 0:e.reduce(((e,a)=>e+=a.width),0);return a-p.value-t})),w=a((()=>n.data.grid.mainXCell)),y=a((()=>{const e=n.data.grid.mainYCell||14;return n.data.scaleValues.find((e=>e.show&&"FHR"===e.key))||14!==e?e:10})),V=a((()=>(x.value-g.value)/w.value)),b=a((()=>{const{xAxis:e,height:a}=n.data,t=Object.values(e).reduce(((e,a)=>(a.show&&e++,e)),0);return a/(y.value+t)})),j=a((()=>{const{xAxis:e}=n.data,a=Object.values(e).reduce(((e,a)=>(a.show&&"top"===a.position&&e++,e)),0);return b.value*a})),A=a((()=>{var e;const{scaleValues:a}=n.data;if(!(null==(e=a.find((e=>"FHR"===e.key)))?void 0:e.show)&&!j.value)return j.value;const t=a.find((e=>"cervix"===e.key)),[,l]=(null==t?void 0:t.range)||[0,10],u=(null==t?void 0:t.spaceValue)||1;return k.value-l*u*b.value})),k=a((()=>{const{xAxis:e,height:a}=n.data,t=Object.values(e).reduce(((e,a)=>(a.show&&"bottom"===a.position&&e++,e)),0);return a-b.value*t})),C=a((()=>r(n.data.xAxis.time.startTime))),Y=a((()=>36e5/V.value)),S=a((()=>{const{scaleValues:e}=n.data,a=e.find((e=>"cervix"===e.key));return b.value/((null==a?void 0:a.spaceValue)||1)})),H=a((()=>{const{scaleValues:e}=n.data,a=e.find((e=>"FHR"===e.key));return b.value/((null==a?void 0:a.spaceValue)||10)})),P=a((()=>{const{scaleValues:e}=n.data,a=e.find((e=>"fetalPresentation"===e.key));return b.value/((null==a?void 0:a.spaceValue)||1)})),X=a((()=>{var e;return(null==(e=n.data.grid)?void 0:e.event)||{selectable:!0,evented:!0,hovered:!0}})),F=e({canvasWidth:n.data.width,canvasHeight:n.data.height,borderStyle:{...u,...n.data.borderStyle||{}},selectionStyle:n.data.selectionStyle||{},grid:n.data.grid,other:n.data.other,originX:g.value,endX:x.value,originY:j.value,endY:k.value,xCellWidth:V.value,yCellHeight:b.value,gridXNumber:w.value,gridYNumber:y.value,xAxis:n.data.xAxis,leftScales:m.value,rightScales:f.value,leftAddAreaWidth:30,rightAddAreaWidth:p.value,startTime:C.value,timeXCell:Y.value,cervixYCell:S.value,FHRYCell:H.value,fetalPresentationYCell:P.value,scaleValues:n.data.scaleValues,event:X.value,originYCervix:A.value});return t((()=>s.value),(e=>{e&&function(){const{clickMenu:e,redrawPoints:a}=i(s,F,d,v,c);h.redrawPoints=a,h.clickMenu=e}()}),{immediate:!0}),{propItems:F,...l(h)}}export{s as useBirthProcessChart};
|
@@ -1 +1 @@
|
|
1
|
-
import{fabric as e}from"../../../../../shared/utils/fabricjs/index.js";import{useShadow as t}from"./useShadow.js";import{drawLine as i,defaultStyle as n,drawPoint as o,drawText as l,drawArrow as s}from"../useDraw.js";import{useGrid as r}from"../useGrid.js";import{format as u}from"date-fns";import{getType as a,getTime as c,isOneLine as d,isOverlapPoint as p,getFloorNumber as f,isValidValue as h,setOtherType as v,isEffectiveNode as g,deleteProperty as y,getIndex as m}from"../../utils/index.js";import{cloneDeep as x,flatten as b,last as j}from"lodash-es";import"../useEvent.js";import{useCommon as w}from"../useCommon.js";import"vue";import"naive-ui";import"@vueuse/core";import{TEMPERATURE_MENU as k,PAIN_MENU as L,OVERLAP as S}from"../../constants/index.js";import{promiseTimeout as Y}from"@vueuse/shared";function E(E,$,O,T,V,C,P,R,A,I){r(E,$);const{getEqualXTypes:X,handleAddPrevent:D,getPointEventProps:H}=w(E,O,$),{createShadowLines:W}=t(),{left:z,xScaleList:F,xCellWidth:_,yCellHeight:q,originX:G,endX:N,originY:B,endY:J,itemList:K,event:Q,vitalSignsOriginY:U,painOriginY:Z,hospitalizationDate:ee,config:te,canvasHeight:ie,painSurplusCell:ne,iconsWidth:oe,canvasWidth:le,borderStyle:se}=$,re=new Set,ue=["xinmai","mai"],ae=new Map,ce=new Set,de=new Set,pe=new Set,fe=x(z.yScaleValue),he=new Set;function ve(t){var o;const l=fe.find((e=>e.show&&"pulse"===e.type));if(l&&(null==(o=l.dataList)?void 0:o.length)&&(re.size&&E.value.remove(...re),re.clear(),ae.size>1)){if(t){const{type:e,key:i}=t.origin||{};if("pulse"===e){const e=ae.get(i),n=null==e?void 0:e.findIndex((e=>e[0]===t.left));e.splice(n,1,[t.left,t.top])}}const o=function(){const e=[],t=[],i=[];for(const e of ae)t.push(e[1]),e[0]===ue[0]&&e[1].forEach((e=>{(ae.get(ue[1])||[]).findIndex((t=>t[0]===e[0]))>-1&&i.push(e[0])}));const[n,o]=t;let l=[],s=[];return i.forEach((t=>{const i=n.findIndex((e=>e[0]===t)),r=o.findIndex((e=>e[0]===t)),u=n[i],a=o[r],c=n[i-1],d=n[i+1],p=o[r-1],f=o[r+1];if(c&&p){if(c[0]!==p[0]){const e=Math.max(c[0],p[0]);l.push([c,p].find((t=>t[0]===e)))}}else c?l.push(c):p&&s.push(p);const h=Math.min(u[1],a[1]);l.push([u,a].find((e=>e[1]===h)));const v=Math.max(u[1],a[1]);s.push([u,a].find((e=>e[1]===v)));const g=()=>{const t=[...l,...s.reverse()],[i]=t,n=j(t);i[0]===n[0]&&i[1]===n[1]&&t.splice(-1,1),e.push(t),l=[],s=[]};if(d&&f){if(d[0]!==f[0]){const e=Math.min(d[0],f[0]);l.push([d,f].find((t=>t[0]===e))),g()}}else d?(l.push(d),g()):f?(s.push(f),g()):g()})),e}();o.length>0&&function(e){Y(0).then((()=>{e.forEach((e=>{const t=[],i=[];Array.from(pe).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)=>{t>0&&e.leftLine&&E.value.remove(e.leftLine)}))}))}))}))}(o);const{mode:s,style:r={}}=l.shadow||{};o.forEach((t=>{const o=t.map((e=>({x:e[0],y:e[1]}))),l=new e.Polygon(o,{...n,...r,strokeWidth:1});if(["slash","line"].includes(s)){l.set({fill:"transparent",stroke:r.stroke||"#f00"});const e=[];if(["slash"].includes(s))e.push(...W(t,r._angle,r.space)),e.forEach((e=>{Object.assign(e,{...n,...r}),re.add(e)}));else{const n=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}(t);n.forEach((t=>{const n=i([...b(t)],{...r,originX:"center"});e.push(n),re.add(n)}))}E.value.add(...e)}re.add(l),E.value.add(l)}))}}function ge(e,t,r){var u;const{type:a,riseStyle:c={},noRiseStyle:p={},verifiedStyle:g={},reduceStyle:y={},pacemaker:m={},upArrowStyle:x={},limitValueStyle:b={},nonePainPointStyle:j={},belowMinValueStyle:w={},respiratorStyle:k={},dataList:L=[],list:S=[]}=r,{type:Y,textStyle:$,showConnectLine:C=!1}=j,R=[],I=[],X=[];let D=null;const W=e=>"breathe"==a&&e.respirator&&k.type&&k.fixedValue&&!e.value&&xe(e.time);if(null==(u=e.list)||u.forEach(((u,j)=>{const z=d(a)?L.find((e=>e.key===u.key)):e,F=be(W(u)?{...u,value:k.fixedValue}:u,r),G=e.list[j+1],N=G?be(W(G)?{...G,value:k.fixedValue}:G,r):void 0,B=G?d(a)?L.find((e=>e.key===G.key)):e:{},{title:J=""}=z;if("脉搏"===J&&"脉搏"!==B.title||"脉搏"!==J&&"脉搏"===B.title||!F||!N||f(F[0],1)!==f(N[0],1))F&&D&&(F[0]=D),D=null;else{const e=F[0]-_/2;F[0]=e+_/4,N[0]=D=F[0]+_/2}const K={};K.value=function(e,t,i){if(!(null==e?void 0:e.length)||!te.showValue)return;const{lineAttr:n={}}=i,o=e[1]<=U.originY+q?e[1]+q:e[1]-q,s=l([e[0],o],{value:W(t)?k.fixedValue:t.value,originX:"center",originY:"center",fill:n.stroke||"#000"});return X.push(s),{obj:s,top:-q}}(F,u,z),function(e,t,r,u){var d,f;if(!["temperature","pain","breathe"].includes(a))return;if(!(null==e?void 0:e.length)&&"temperature"===a&&!xe(t.time))return;if(!(null==e?void 0:e.length)&&"pain"===a)return;if(!t.value&&"breathe"===a)return;const{lineAttr:v={}}=r,{value:m}=u,x=T(t.time);let b,j,w,L,S,Y;if(t.noRise&&p.show){const i=M(p,t)?V(a,35):(null==e?void 0:e[1])||0;if(p.text)w=l([x,M(p,t)?i:i+5],{value:p.text.split("").join("\n"),originY:"top",...p.style}),t.value||pe.add(w);else if(t.value){w=s([x,i,i+2*q],{...p.style})}w&&X.push(w),w&&M(p,t)&&he.add(w)}if(null==e?void 0:e[1]){if(t.rise&&c.show&&c.text&&(L=l([x,e[1]-(m?q:0)-5],{value:c.text.split("").join("\n"),originY:"bottom",...c.style}),X.push(L)),t.verified&&(S=l([x,e[1]-(m?q:0)-5],{value:"v",originX:"center",originY:"bottom",...g}),X.push(S)),h(t.physicsReduce)||h(t.drugReduce)){const l=V(a,null!=(d=t.physicsReduce)?d:t.drugReduce),s=l<e[1]&&(null==te?void 0:te.hypothermyViewCustom)?x+_/2:x;b=i([...e,s,l],{...v,...y.line,...n}),j=o((null==(f=null==y?void 0:y.point)?void 0:f.type)||"circle",{left:s,top:l,...y.point,...n,originY:l===ie?"bottom":"center"}),b&&X.push(b),j&&X.push(j)}t.respirator&&(Y=o(k.type,{left:x,top:e[1]-(m?q:0)-5,originX:"center",originY:"bottom",...k.style}),X.push(Y))}Object.assign(u,{reduceLine:{obj:b,type:"line"},noRiseText:{obj:w,top:p.text?5:2*q,isFixed:M(p,t)},riseText:{obj:L,top:(m?-q:0)-5},verifiedText:{obj:S,top:(m?-q:0)-5},reducePoint:{obj:j,type:"reduce"},respirator:{obj:Y,top:(m?-q:0)-5}})}(F,u,z,K),function(e,t,i,n){if(!(null==e?void 0:e.length)||!["pulse"].includes(a))return;const o=Math.max(...S),r=Math.min(...S);let u,c,d;const{upArrowShow:p=!1,limitValueShow:f=!1}=i;if(p&&+t.value>180){let t=e[1]-2.5*q,i=[e[1]-q/2,t];t<U.originY&&(t=e[1]+2.5*q,i=[t,e[1]+q/2]),u=s([e[0],i[0],i[1]],x,"up"),X.push(u)}if(f){const i={value:t.value,originX:"center",originY:"center",...b};if(+t.value>o){const t=u?e[1]+q/2+u.height:e[1]+q;c=l([e[0],t],i),X.push(c)}+t.value<r&&(c=l([e[0],e[1]-q],i),X.push(c))}if(w.show&&+t.value<r){const t=e[1];if(w.text)d=l([e[0],e[1]+5],{value:w.text.split("").join("\n"),originY:"top",...w.style});else{const i=t+2*q;d=s([e[0],t,i],{...w.style})}X.push(d)}Object.assign(n,{upArrow:{obj:u},limitValue:{obj:c,top:-q},belowMinValue:{obj:d,top:w.text?5:2*q,moveHide:!0}})}(F,u,z,K),function(n,l,s,u,c,d){let p,f;const{pointAttr:h={},lineAttr:g={},title:y="",key:x,type:b="circle"}=c,j=e.list[u+1],w=ye(a,e.list[u].value),L=l&&ye(a,j.value),S=()=>"pulse"==a&&s.pacemakerShow?m.value:W(s)?k.type:w&&"number"===Y?0:b;if(n&&l&&!s.breakpoint&&(!w&&!L||C)){f=i([...n,...l],{...g});const{obj:e}=(null==d?void 0:d.reducePoint)||{};if((null==e?void 0:e.top)<n[1]&&(null==te?void 0:te.hypothermyViewCustom)){const t=i([e.left,e.top,...l],{...g});X.unshift(t),Object.assign(d,{reduceRightLine:{obj:t,type:"reduce"}}),f.set("stroke","transparent")}}const M=S(),T=I[u-1],V={origin:{data:W(s)?{...s,value:k.fixedValue}:s,title:y,key:x||"",unit:r.unit,type:a,_type:v(y,a),dataIndex:t,index:u},leftLine:T,rightLine:f,otherObj:d,...s.pacemakerShow&&"pulse"==a?m.style:W(s)?k.style:h,lockMovementX:!0,...H(),...w?{selectable:!1,evented:!1,..."number"===Y?$:{}}:{}};n&&(T?V.leftLine.set("x2",n[0]):V.leftLine=null,p=o(M,{left:n[0],top:w&&!ne[1]?n[1]-5:n[1],...V}));I.push(f),p&&(x===ue[1]?ce.add(p):W(s)||de.add(p),function(e){Q.hovered&&(e.on("mouseover",(()=>{me(e,"hover")})),e.on("mouseout",(()=>{A.show=!1})));if(e.lockMovementX&&e.lockMovementY)return;e.on("moving",(()=>{!function(e){e.setCoords();const t="pain"===e.origin.type?Z:U;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:s=!1}=t||{};"reduce"!==n&&i&&("line"===n?i.setCoords().set({x1:e.left,y1:e.top}):(l||i.setCoords().set({left:e.left,top:e.top+o}),s&&(E.value.remove(i),delete e.otherObj.obj)))})),ve(e)}(e),Q.hovered&&me(e)})),e.on("mouseup",(t=>{if(A.show=!1,1===t.button){const{type:t}=e.origin,i=P(t,e.top),n={...e.origin,data:{...e.origin.data,value:i}};E.value.discardActiveObject(),O("change",n),we(n,"change")}}))}(p),R.push(p),pe.add(p))}(F,N,u,j,z,K)})),"pulse"===a){const{key:t}=e;let i=null;ae.set(t,R.map(((e,t,n)=>{var o,l;const s=n[t+1];if(s&&f(e.left,1)===f(s.left,1)){const t=e.left-_/2;e.set("left",t+_/4),null==(o=e.rightLine)||o.set("x1",e.left),i=e.left+_/2,s.set("left",i)}else i&&(null==(l=e.leftLine)||l.set("x2",i),e.set("left",i)),i=null;return[e.left,e.top]})))}const z=I.filter((e=>e));E.value.add(...z,...R,...X)}function ye(e,t){return"pain"===e&&0==t}function me(e,t="moving"){const{title:i,unit:n,type:o,data:l}=e.origin;A.point={x:e.left,y:e.top};let s=`时间 ${((null==l?void 0:l.time)||C(e.left)).slice(-5)}`;A.list=[function(){const{drugReduce:r,physicsReduce:u}=l||{},a="hover"===t?l.value:P(o,e.top);if(h(r))return s+=(null==l?void 0:l.changeTime)?"—>"+(null==l?void 0:l.changeTime.slice(-5)):"",`药物降${"pain"==o?"痛":"温"} ${a}—>${r}${n||""}`;if(h(u))return s+=(null==l?void 0:l.changeTime)?"—>"+(null==l?void 0:l.changeTime.slice(-5)):"",`物理降${"pain"==o?"痛":"温"} ${a}—>${u}${n||""}`;return`${i} ${a}${n||""}`}(),s],A.show=!0}function xe(e){const[t]=F,i=j(F),n=t.start,o=i.end,l=c(e);return l>=n&&l<=o}function be(e,t){const i="pain"===t.type?Z:U;if(!g(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=c(`${t.getFullYear()}-${i}-${n} 23:59:59`),l=c(`${C(e)}:00`);return ee&&l<c(ee)?(D("exceedMin"),!1):!(l>o)||(D("exceedMax"),!1)}function we(e,t="add"){const{type:i,dataIndex:n,index:o,data:l,key:s}=e,r=fe.find((e=>e.type===i));if("add"===t){const e=d(i)?r.dataList.find((e=>e.enable)):r.dataList[n],t=m(l.time,e.list);e.list.splice(t,0,l)}else r.dataList[n].list[o]=l;ke()}function ke(){var e;pe.size&&(null==(e=E.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}([...pe]))),pe.clear(),Le()}function Le(e){ae.clear(),pe.clear(),ce.clear(),he.clear(),de.clear(),fe.forEach((t=>{t.show&&(null==e||e(t),t.dataList.forEach(((e,i)=>{!e.show||d(t.type)&&!e.enable||ge(e,i,t)})))})),ve(),[...pe].forEach((e=>{null==e||e.bringToFront()})),function(){var e;const t=fe.find((e=>e.show&&"pulse"===e.type));if(!t||!(null==(e=t.dataList)?void 0:e.length))return;if(!t.dataList.some((e=>e.title.includes("脉搏"))))return;const i=Object.assign({},S,z.overlap||{}),l=[];ce.size&&[...ce].forEach((e=>{[...de].forEach((t=>{if(t.origin&&p(e,t)){const e=t.origin.key;if(e){const s={left:t.left,top:t.top,...n,hoverCursor:"default"};let r="koumai";"yemai"===e&&(r=e),l.push(o(r,{...i[e],...s}))}}}))})),setTimeout((()=>{E.value.add(...l),l.forEach((e=>{null==e||e.bringToFront(),pe.add(e)}))}))}()}return function(){const t=new e.Rect({left:oe,top:0,width:le-oe-se.strokeWidth,height:ie-se.strokeWidth,fill:"transparent",...se});E.value.add(t)}(),Le((e=>function(e){if("temperature"!==e.type||!e.positionLine)return;const t=V(e.type,e.positionLine.value),n=i([G,t,N,t],e.positionLine);E.value.add(n)}(e))),E.value.on("mouse:up",(e=>{const{button:t,target:i,pointer:n={}}=e;if(3===t){if(!$.event.evented)return;const{x:e=0,y:t=0}=n;if(e>=G&&e<=N&&t>=B&&t<=J){I.point={x:e,y:t},I.show=!0;const{type:o}=(null==i?void 0:i.origin)||{};if(i&&["temperature","pain"].includes(o))"temperature"===o&&(I.list=[...k]),"pain"===o&&(I.list=[...L]),I.target=i;else{I.target=null,I.list=["新增节点"],K.forEach((i=>{if(!X([...pe],e,"_type").includes(i.bigType)){const e=["pain"].includes(i.bigType)?Z:U;t>=e.originY&&t<=e.endY&&I.list.push({renderItem:R?R(i):()=>i.title,origin:{title:i.title,unit:i.unit,type:a(i.bigType),dataIndex:i.dataIndex,key:i.key},pointer:n})}}));const i=je(e);i&&1!==I.list.length||(I.show=!1,1===I.list.length&&i&&D("repeat"))}}}if(1===t){if(i)return;const{x:e=0,y:t=0}=n;e>=G&&e<=N&&t>0&&t<ie&&O("click:grid",{x:e,y:t,time:C(e)})}})),{clickMenu:function({item:e,target:t}){if(t){const{data:i,type:n,dataIndex:o,index:l}=t.origin,s=y(i,[...k,...L]);s[`${e.type}`]=e.value,s.changeTime=u(new Date,"yyyy-MM-dd HH:mm"),d(n)&&(s.key=t.origin.key);const r={...t.origin,data:s};O("change",r),we(r,"change")}else{const t={data:{time:C(e.pointer.x),value:P(e.origin.type,e.pointer.y),...d(e.origin.type)?{key:e.origin.key}:{}},...e.origin};O("add",t),we(t)}},setPopup:me,isAddPoint:je,updateData:we,redrawPoints:ke,gridPoints:pe,fixedNoRisePoints:he}}function M(e,t){return e.fixed||!t.value&&0!==t.value}export{E as useCenter};
|
1
|
+
import{fabric as e}from"../../../../../shared/utils/fabricjs/index.js";import{useShadow as t}from"./useShadow.js";import{drawLine as i,defaultStyle as n,drawPoint as o,drawText as l,drawArrow as r}from"../useDraw.js";import{useGrid as s}from"../useGrid.js";import{format as u}from"date-fns";import{getType as a,getTime as c,isOneLine as d,isOverlapPoint as p,getFloorNumber as f,isValidValue as h,setOtherType as v,isEffectiveNode as g,deleteProperty as m,getIndex as y}from"../../utils/index.js";import{cloneDeep as x,flatten as b,last as j}from"lodash-es";import"../useEvent.js";import{useCommon as w}from"../useCommon.js";import"vue";import"naive-ui";import"@vueuse/core";import{TEMPERATURE_MENU as k,PAIN_MENU as L,OVERLAP as S}from"../../constants/index.js";import{promiseTimeout as Y}from"@vueuse/shared";function E(E,$,O,T,V,P,R,C,A,I){s(E,$);const{getEqualXTypes:X,handleAddPrevent:D,getPointEventProps:H}=w(E,O,$),{createShadowLines:W}=t(),{left:z,xScaleList:F,xCellWidth:_,yCellHeight:q,originX:G,endX:N,originY:B,endY:J,itemList:K,event:Q,vitalSignsOriginY:U,painOriginY:Z,hospitalizationDate:ee,config:te,canvasHeight:ie,painSurplusCell:ne,iconsWidth:oe,canvasWidth:le,borderStyle:re}=$,se=new Set,ue=["xinmai","mai"],ae=new Map,ce=new Set,de=new Set,pe=new Set,fe=x(z.yScaleValue),he=new Set;function ve(t){var o;const l=fe.find((e=>e.show&&"pulse"===e.type));if(l&&(null==(o=l.dataList)?void 0:o.length)&&(se.size&&E.value.remove(...se),se.clear(),ae.size>1)){if(t){const{type:e,key:i}=t.origin||{};if("pulse"===e){const e=ae.get(i),n=null==e?void 0:e.findIndex((e=>e[0]===t.left));e.splice(n,1,[t.left,t.top])}}const o=function(){const e=[],t=[],i=[];for(const e of ae)t.push(e[1]),e[0]===ue[0]&&e[1].forEach((e=>{(ae.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)),u=n[i],a=o[s],c=n[i-1],d=n[i+1],p=o[s-1],f=o[s+1];if(c&&p){if(c[0]!==p[0]){const e=Math.max(c[0],p[0]);l.push([c,p].find((t=>t[0]===e)))}}else c?l.push(c):p&&r.push(p);const h=Math.min(u[1],a[1]);l.push([u,a].find((e=>e[1]===h)));const v=Math.max(u[1],a[1]);r.push([u,a].find((e=>e[1]===v)));const g=()=>{const t=[...l,...r.reverse()],[i]=t,n=j(t);i[0]===n[0]&&i[1]===n[1]&&t.splice(-1,1),e.push(t),l=[],r=[]};if(d&&f){if(d[0]!==f[0]){const e=Math.min(d[0],f[0]);l.push([d,f].find((t=>t[0]===e))),g()}}else d?(l.push(d),g()):f?(r.push(f),g()):g()})),e}();o.length>0&&function(e){Y(0).then((()=>{e.forEach((e=>{const t=[],i=[];Array.from(pe).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)=>{t>0&&e.leftLine&&E.value.remove(e.leftLine)}))}))}))}))}(o);const{mode:r,style:s={}}=l.shadow||{};o.forEach((t=>{const o=t.map((e=>({x:e[0],y:e[1]}))),l=new e.Polygon(o,{...n,...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(t,s._angle,s.space)),e.forEach((e=>{Object.assign(e,{...n,...s}),se.add(e)}));else{const n=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}(t);n.forEach((t=>{const n=i([...b(t)],{...s,originX:"center"});e.push(n),se.add(n)}))}E.value.add(...e)}se.add(l),E.value.add(l)}))}}function ge(e,t,s){var u;const{type:a,riseStyle:c={},noRiseStyle:p={},verifiedStyle:g={},reduceStyle:m={},pacemaker:y={},upArrowStyle:b={},limitValueStyle:j={},nonePainPointStyle:w={},belowMinValueStyle:k={},respiratorStyle:L={},dataList:S=[],list:Y=[]}=s,{type:$,textStyle:P}=w,C=[],I=[],X=[];let D=null;const W=e=>"breathe"==a&&e.respirator&&L.type&&L.fixedValue&&!e.value&&ye(e.time);if(null==(u=e.list)||u.forEach(((u,w)=>{const z=d(a)?S.find((e=>e.key===u.key)):e,F=xe(W(u)?{...u,value:L.fixedValue}:u,s),G=e.list[w+1],N=G?xe(W(G)?{...G,value:L.fixedValue}:G,s):void 0,B=G?d(a)?S.find((e=>e.key===G.key)):e:{},{title:J=""}=z;if("脉搏"===J&&"脉搏"!==B.title||"脉搏"!==J&&"脉搏"===B.title||!F||!N||f(F[0],1)!==f(N[0],1))F&&D&&(F[0]=D),D=null;else{const e=F[0]-_/2;F[0]=e+_/4,N[0]=D=F[0]+_/2}const K={};K.value=function(e,t,i){if(!(null==e?void 0:e.length)||!te.showValue)return;const{lineAttr:n={}}=i,o=e[1]<=U.originY+q?e[1]+q:e[1]-q,r=l([e[0],o],{value:W(t)?L.fixedValue:t.value,originX:"center",originY:"center",fill:n.stroke||"#000"});return X.push(r),{obj:r,top:-q}}(F,u,z),function(e,t,s,u){var d,f;if(!["temperature","pain","breathe"].includes(a))return;if(!(null==e?void 0:e.length)&&"temperature"===a&&!ye(t.time))return;if(!(null==e?void 0:e.length)&&"pain"===a)return;if(!t.value&&"breathe"===a)return;const{lineAttr:v={}}=s,{value:y}=u,x=T(t.time);let b,j,w,k,S,Y;if(t.noRise&&p.show){const i=M(p,t)?V(a,35):(null==e?void 0:e[1])||0;if(p.text)w=l([x,M(p,t)?i:i+5],{value:p.text.split("").join("\n"),originY:"top",...p.style}),t.value||pe.add(w);else if(t.value){w=r([x,i,i+2*q],{...p.style})}w&&X.push(w),w&&M(p,t)&&he.add(w)}if(null==e?void 0:e[1]){if(t.rise&&c.show&&c.text&&(k=l([x,e[1]-(y?q:0)-5],{value:c.text.split("").join("\n"),originY:"bottom",...c.style}),X.push(k)),t.verified&&(S=l([x,e[1]-(y?q:0)-5],{value:"v",originX:"center",originY:"bottom",...g}),X.push(S)),h(t.physicsReduce)||h(t.drugReduce)){const l=V(a,null!=(d=t.physicsReduce)?d:t.drugReduce),r=l<e[1]&&(null==te?void 0:te.hypothermyViewCustom)?x+_/2:x;b=i([...e,r,l],{...v,...m.line,...n}),j=o((null==(f=null==m?void 0:m.point)?void 0:f.type)||"circle",{left:r,top:l,...m.point,...n,originY:l===ie?"bottom":"center"}),b&&X.push(b),j&&X.push(j)}t.respirator&&(Y=o(L.type,{left:x,top:e[1]-(y?q:0)-5,originX:"center",originY:"bottom",...L.style}),X.push(Y))}Object.assign(u,{reduceLine:{obj:b,type:"line"},noRiseText:{obj:w,top:p.text?5:2*q,isFixed:M(p,t)},riseText:{obj:k,top:(y?-q:0)-5},verifiedText:{obj:S,top:(y?-q:0)-5},reducePoint:{obj:j,type:"reduce"},respirator:{obj:Y,top:(y?-q:0)-5}})}(F,u,z,K),function(e,t,i,n){if(!(null==e?void 0:e.length)||!["pulse"].includes(a))return;const o=Math.max(...Y),s=Math.min(...Y);let u,c,d;const{upArrowShow:p=!1,limitValueShow:f=!1}=i;if(p&&+t.value>180){let t=e[1]-2.5*q,i=[e[1]-q/2,t];t<U.originY&&(t=e[1]+2.5*q,i=[t,e[1]+q/2]),u=r([e[0],i[0],i[1]],b,"up"),X.push(u)}if(f){const i={value:t.value,originX:"center",originY:"center",...j};if(+t.value>o){const t=u?e[1]+q/2+u.height:e[1]+q;c=l([e[0],t],i),X.push(c)}+t.value<s&&(c=l([e[0],e[1]-q],i),X.push(c))}if(k.show&&+t.value<s){const t=e[1];if(k.text)d=l([e[0],e[1]+5],{value:k.text.split("").join("\n"),originY:"top",...k.style});else{const i=t+2*q;d=r([e[0],t,i],{...k.style})}X.push(d)}Object.assign(n,{upArrow:{obj:u},limitValue:{obj:c,top:-q},belowMinValue:{obj:d,top:k.text?5:2*q,moveHide:!0}})}(F,u,z,K),function(n,l,r,u,c,d){let f,h;const{pointAttr:g={},lineAttr:m={},title:b="",key:j,type:w="circle"}=c,k=e.list[u+1];let S=x(n),Y=x(l);const M=function(e,t){return"pain"===e&&0==t}(a,e.list[u].value),D=()=>"pulse"==a&&r.pacemakerShow?y.value:W(r)?L.type:M&&"number"===$?0:w,z=e=>e&&p.show&&p.fixed&&ye(e.time)&&e.noRise&&!e.value&&0!==e.value;if((()=>{if(r.breakpoint)return!1;if("temperature"===a&&(n||z(r))&&(l||z(k))){const e=V(a,35);return n||(S=[T(r.time),e]),l||(Y=[T(k.time),e]),!0}return!!n&&!!l})()){h=i([...S,...Y],{...m});const{obj:e}=(null==d?void 0:d.reducePoint)||{};if(n&&l&&(null==e?void 0:e.top)<n[1]&&(null==te?void 0:te.hypothermyViewCustom)){const t=i([e.left,e.top,...l],{...m});X.unshift(t),Object.assign(d,{reduceRightLine:{obj:t,type:"reduce"}}),h.set("stroke","transparent")}}const F=D(),_=I[u-1],q={origin:{data:W(r)?{...r,value:L.fixedValue}:r,title:b,key:j||"",unit:s.unit,type:a,_type:v(b,a),dataIndex:t,index:u},leftLine:_,rightLine:h,otherObj:d,...r.pacemakerShow&&"pulse"==a?y.style:W(r)?L.style:g,lockMovementX:!0,...H(),...M?{selectable:!1,evented:!1,..."number"===$?P:{}}:{}};n&&(_?q.leftLine.set("x2",n[0]):q.leftLine=null,f=o(F,{left:n[0],top:M&&!ne[1]?n[1]-5:n[1],...q}));I.push(h),f&&(j===ue[1]?ce.add(f):W(r)||de.add(f),function(e){Q.hovered&&(e.on("mouseover",(()=>{me(e,"hover")})),e.on("mouseout",(()=>{A.show=!1})));if(e.lockMovementX&&e.lockMovementY)return;e.on("moving",(()=>{!function(e){e.setCoords();const t="pain"===e.origin.type?Z:U;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}=t||{};"reduce"!==n&&i&&("line"===n?i.setCoords().set({x1:e.left,y1:e.top}):(l||i.setCoords().set({left:e.left,top:e.top+o}),r&&(E.value.remove(i),delete e.otherObj.obj)))})),ve(e)}(e),Q.hovered&&me(e)})),e.on("mouseup",(t=>{if(A.show=!1,1===t.button){const{type:t}=e.origin,i=R(t,e.top),n={...e.origin,data:{...e.origin.data,value:i}};E.value.discardActiveObject(),O("change",n),je(n,"change")}}))}(f),C.push(f),pe.add(f))}(F,N,u,w,z,K)})),"pulse"===a){const{key:t}=e;let i=null;ae.set(t,C.map(((e,t,n)=>{var o,l;const r=n[t+1];if(r&&f(e.left,1)===f(r.left,1)){const t=e.left-_/2;e.set("left",t+_/4),null==(o=e.rightLine)||o.set("x1",e.left),i=e.left+_/2,r.set("left",i)}else i&&(null==(l=e.leftLine)||l.set("x2",i),e.set("left",i)),i=null;return[e.left,e.top]})))}const z=I.filter((e=>e));E.value.add(...z,...C,...X)}function me(e,t="moving"){const{title:i,unit:n,type:o,data:l}=e.origin;A.point={x:e.left,y:e.top};let r=`时间 ${((null==l?void 0:l.time)||P(e.left)).slice(-5)}`;A.list=[function(){const{drugReduce:s,physicsReduce:u}=l||{},a="hover"===t?l.value:R(o,e.top);if(h(s))return r+=(null==l?void 0:l.changeTime)?"—>"+(null==l?void 0:l.changeTime.slice(-5)):"",`药物降${"pain"==o?"痛":"温"} ${a}—>${s}${n||""}`;if(h(u))return r+=(null==l?void 0:l.changeTime)?"—>"+(null==l?void 0:l.changeTime.slice(-5)):"",`物理降${"pain"==o?"痛":"温"} ${a}—>${u}${n||""}`;return`${i} ${a}${n||""}`}(),r],A.show=!0}function ye(e){const[t]=F,i=j(F),n=t.start,o=i.end,l=c(e);return l>=n&&l<=o}function xe(e,t){const i="pain"===t.type?Z:U;if(!g(e)||!ye(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 be(e){const t=new Date,i=String(t.getMonth()+1).padStart(2,"0"),n=String(t.getDate()).padStart(2,"0"),o=c(`${t.getFullYear()}-${i}-${n} 23:59:59`),l=c(`${P(e)}:00`);return ee&&l<c(ee)?(D("exceedMin"),!1):!(l>o)||(D("exceedMax"),!1)}function je(e,t="add"){const{type:i,dataIndex:n,index:o,data:l,key:r}=e,s=fe.find((e=>e.type===i));if("add"===t){const e=d(i)?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;we()}function we(){var e;pe.size&&(null==(e=E.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}([...pe]))),pe.clear(),ke()}function ke(e){ae.clear(),pe.clear(),ce.clear(),he.clear(),de.clear(),fe.forEach((t=>{t.show&&(null==e||e(t),t.dataList.forEach(((e,i)=>{!e.show||d(t.type)&&!e.enable||ge(e,i,t)})))})),ve(),[...pe].forEach((e=>{null==e||e.bringToFront()})),function(){var e;const t=fe.find((e=>e.show&&"pulse"===e.type));if(!t||!(null==(e=t.dataList)?void 0:e.length))return;if(!t.dataList.some((e=>e.title.includes("脉搏"))))return;const i=Object.assign({},S,z.overlap||{}),l=[];ce.size&&[...ce].forEach((e=>{[...de].forEach((t=>{if(t.origin&&p(e,t)){const e=t.origin.key;if(e){const r={left:t.left,top:t.top,...n,hoverCursor:"default"};let s="koumai";"yemai"===e&&(s=e),l.push(o(s,{...i[e],...r}))}}}))})),setTimeout((()=>{E.value.add(...l),l.forEach((e=>{null==e||e.bringToFront(),pe.add(e)}))}))}()}return function(){const t=new e.Rect({left:oe,top:0,width:le-oe-re.strokeWidth,height:ie-re.strokeWidth,fill:"transparent",...re});E.value.add(t)}(),ke((e=>function(e){if("temperature"!==e.type||!e.positionLine)return;const t=V(e.type,e.positionLine.value),n=i([G,t,N,t],e.positionLine);E.value.add(n)}(e))),E.value.on("mouse:up",(e=>{const{button:t,target:i,pointer:n={}}=e;if(3===t){if(!$.event.evented)return;const{x:e=0,y:t=0}=n;if(e>=G&&e<=N&&t>=B&&t<=J){I.point={x:e,y:t},I.show=!0;const{type:o}=(null==i?void 0:i.origin)||{};if(i&&["temperature","pain"].includes(o))"temperature"===o&&(I.list=[...k]),"pain"===o&&(I.list=[...L]),I.target=i;else{I.target=null,I.list=["新增节点"],K.forEach((i=>{if(!X([...pe],e,"_type").includes(i.bigType)){const e=["pain"].includes(i.bigType)?Z:U;t>=e.originY&&t<=e.endY&&I.list.push({renderItem:C?C(i):()=>i.title,origin:{title:i.title,unit:i.unit,type:a(i.bigType),dataIndex:i.dataIndex,key:i.key},pointer:n})}}));const i=be(e);i&&1!==I.list.length||(I.show=!1,1===I.list.length&&i&&D("repeat"))}}}if(1===t){if(i)return;const{x:e=0,y:t=0}=n;e>=G&&e<=N&&t>0&&t<ie&&O("click:grid",{x:e,y:t,time:P(e)})}})),{clickMenu:function({item:e,target:t}){if(t){const{data:i,type:n,dataIndex:o,index:l}=t.origin,r=m(i,[...k,...L]);r[`${e.type}`]=e.value,r.changeTime=u(new Date,"yyyy-MM-dd HH:mm"),d(n)&&(r.key=t.origin.key);const s={...t.origin,data:r};O("change",s),je(s,"change")}else{const t={data:{time:P(e.pointer.x),value:R(e.origin.type,e.pointer.y),...d(e.origin.type)?{key:e.origin.key}:{}},...e.origin};O("add",t),je(t)}},setPopup:me,isAddPoint:be,updateData:je,redrawPoints:we,gridPoints:pe,fixedNoRisePoints:he}}function M(e,t){return e.fixed||!t.value&&0!==t.value}export{E as useCenter};
|
@@ -27,6 +27,10 @@ declare const FieldSet: SFCWithInstall<import("vue").DefineComponent<{
|
|
27
27
|
type: import("vue").PropType<import("./src/types").FilterSetItem[]>;
|
28
28
|
default: () => never[];
|
29
29
|
};
|
30
|
+
showFilterColumnNames: {
|
31
|
+
type: import("vue").PropType<("type" | "title" | "optionType" | "isShowSearch" | "filterExplicit" | "explicitRequired" | "defaultValue" | "customTitle" | "width")[]>;
|
32
|
+
default: () => never[];
|
33
|
+
};
|
30
34
|
}, {
|
31
35
|
attrs: {
|
32
36
|
[x: string]: unknown;
|
@@ -58,6 +62,10 @@ declare const FieldSet: SFCWithInstall<import("vue").DefineComponent<{
|
|
58
62
|
type: import("vue").PropType<import("./src/types").FilterSetItem[]>;
|
59
63
|
default: () => never[];
|
60
64
|
};
|
65
|
+
showFilterColumnNames: {
|
66
|
+
type: import("vue").PropType<("type" | "title" | "optionType" | "isShowSearch" | "filterExplicit" | "explicitRequired" | "defaultValue" | "customTitle" | "width")[]>;
|
67
|
+
default: () => never[];
|
68
|
+
};
|
61
69
|
}>> & {
|
62
70
|
onSave?: ((...args: any[]) => any) | undefined;
|
63
71
|
}>>;
|
@@ -109,6 +117,10 @@ declare const FieldSet: SFCWithInstall<import("vue").DefineComponent<{
|
|
109
117
|
type: import("vue").PropType<import("./src/types").FilterSetItem[]>;
|
110
118
|
default: () => never[];
|
111
119
|
};
|
120
|
+
showFilterColumnNames: {
|
121
|
+
type: import("vue").PropType<("type" | "title" | "optionType" | "isShowSearch" | "filterExplicit" | "explicitRequired" | "defaultValue" | "customTitle" | "width")[]>;
|
122
|
+
default: () => never[];
|
123
|
+
};
|
112
124
|
}>> & {
|
113
125
|
onSave?: ((...args: any[]) => any) | undefined;
|
114
126
|
}, {
|
@@ -116,5 +128,6 @@ declare const FieldSet: SFCWithInstall<import("vue").DefineComponent<{
|
|
116
128
|
fieldColorList: import("./src/types").ColorSetItem[];
|
117
129
|
highlightRowColorList: import("./src/types").ColorSetItem[];
|
118
130
|
fieldFilterList: import("./src/types").FilterSetItem[];
|
131
|
+
showFilterColumnNames: ("type" | "title" | "optionType" | "isShowSearch" | "filterExplicit" | "explicitRequired" | "defaultValue" | "customTitle" | "width")[];
|
119
132
|
}>>;
|
120
133
|
export default FieldSet;
|
@@ -37,6 +37,8 @@ declare const _default: import("vue").DefineComponent<{
|
|
37
37
|
visible: import("vue").Ref<boolean>;
|
38
38
|
currentRow: import("vue").Ref<AnyObject | null>;
|
39
39
|
data: import("vue").Ref<AnyObject[]>;
|
40
|
+
readonly: import("vue").Ref<boolean>;
|
41
|
+
isAdd: import("vue").Ref<boolean>;
|
40
42
|
columns: import("vue").Ref<{
|
41
43
|
[x: string]: any;
|
42
44
|
title: string;
|
@@ -63,13 +65,13 @@ declare const _default: import("vue").DefineComponent<{
|
|
63
65
|
hide?: boolean | undefined;
|
64
66
|
}[];
|
65
67
|
data: AnyObject[];
|
66
|
-
onEdit: (row: AnyObject) => void;
|
68
|
+
onEdit: ({ row, readonly: _readonly, add }: AnyObject) => void;
|
67
69
|
isHighlightRow: boolean;
|
68
70
|
};
|
69
71
|
handleFieldSave: () => void;
|
70
72
|
onCancle: () => void;
|
71
73
|
onAdd: () => void;
|
72
|
-
onEdit: (row: AnyObject) => void;
|
74
|
+
onEdit: ({ row, readonly: _readonly, add }: AnyObject) => void;
|
73
75
|
initColumns: () => void;
|
74
76
|
initData: () => void;
|
75
77
|
getShowColumn: (column: FieldSetColumnItem) => boolean;
|
@@ -351,7 +353,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
351
353
|
}>>;
|
352
354
|
emit: (event: "edit" | "updateChecked", ...args: any[]) => void;
|
353
355
|
onRemove: () => void;
|
354
|
-
onEdit: () => void;
|
356
|
+
onEdit: (param?: AnyObject) => void;
|
355
357
|
isRenderTooltip: (field: string) => any;
|
356
358
|
getTooltipContent: () => any;
|
357
359
|
getTextValue: (field: string) => any;
|
@@ -363,7 +365,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
363
365
|
label: string;
|
364
366
|
value: number;
|
365
367
|
}[];
|
366
|
-
getSelectText: (field: string) =>
|
368
|
+
getSelectText: (field: string) => any;
|
367
369
|
selectProps: (field: string) => {
|
368
370
|
valueField: string;
|
369
371
|
labelField: string;
|
@@ -383,6 +385,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
383
385
|
NPopconfirm: any;
|
384
386
|
NPopover: any;
|
385
387
|
NSpace: any;
|
388
|
+
NButton: any;
|
386
389
|
setStyle: typeof setStyle;
|
387
390
|
setColorInfo: typeof setColorInfo;
|
388
391
|
ReorderTwoOutline: 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<{}>>, {}>;
|
@@ -390,6 +393,8 @@ declare const _default: import("vue").DefineComponent<{
|
|
390
393
|
CreateOutline: 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<{}>>, {}>;
|
391
394
|
HelpCircleOutline: 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<{}>>, {}>;
|
392
395
|
CaretDownOutline: 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<{}>>, {}>;
|
396
|
+
EyeOutline: 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<{}>>, {}>;
|
397
|
+
CopyOutline: 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<{}>>, {}>;
|
393
398
|
isFunction: (value: any) => value is (...args: any[]) => any;
|
394
399
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("edit" | "updateChecked")[], "edit" | "updateChecked", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
395
400
|
element: {
|
@@ -527,9 +532,9 @@ declare const _default: import("vue").DefineComponent<{
|
|
527
532
|
}>;
|
528
533
|
developMode: boolean;
|
529
534
|
draggable: boolean;
|
535
|
+
isHighlightRow: boolean;
|
530
536
|
idx: number;
|
531
537
|
isHighlight: boolean;
|
532
|
-
isHighlightRow: boolean;
|
533
538
|
isFieldSet: boolean;
|
534
539
|
fieldDescribeMode: "column" | "tooltip";
|
535
540
|
hideExpressionOption: AnyObject[];
|
@@ -547,6 +552,14 @@ declare const _default: import("vue").DefineComponent<{
|
|
547
552
|
type: PropType<AnyObject | null>;
|
548
553
|
default: null;
|
549
554
|
};
|
555
|
+
readonly: {
|
556
|
+
type: BooleanConstructor;
|
557
|
+
default: boolean;
|
558
|
+
};
|
559
|
+
isAdd: {
|
560
|
+
type: BooleanConstructor;
|
561
|
+
default: boolean;
|
562
|
+
};
|
550
563
|
}, {
|
551
564
|
cssVars: import("vue").ComputedRef<AnyObject>;
|
552
565
|
message: import("naive-ui").MessageApi;
|
@@ -569,6 +582,14 @@ declare const _default: import("vue").DefineComponent<{
|
|
569
582
|
type: PropType<AnyObject | null>;
|
570
583
|
default: null;
|
571
584
|
};
|
585
|
+
readonly: {
|
586
|
+
type: BooleanConstructor;
|
587
|
+
default: boolean;
|
588
|
+
};
|
589
|
+
isAdd: {
|
590
|
+
type: BooleanConstructor;
|
591
|
+
default: boolean;
|
592
|
+
};
|
572
593
|
}>> & {
|
573
594
|
onConfirm?: ((...args: any[]) => any) | undefined;
|
574
595
|
"onUpdate:visible"?: ((...args: any[]) => any) | undefined;
|
@@ -577,7 +598,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
577
598
|
formRef: import("vue").Ref<any>;
|
578
599
|
conditionRef: import("vue").Ref<any>;
|
579
600
|
filterVisible: import("vue").Ref<boolean>;
|
580
|
-
title: import("vue").ComputedRef<"新增" | "修改" | "过滤条件">;
|
601
|
+
title: import("vue").ComputedRef<"复制" | "新增" | "修改" | "过滤条件">;
|
581
602
|
model: {
|
582
603
|
name: string;
|
583
604
|
color: string;
|
@@ -604,18 +625,26 @@ declare const _default: import("vue").DefineComponent<{
|
|
604
625
|
NRadio: any;
|
605
626
|
NSpace: any;
|
606
627
|
Condition: import("vue").DefineComponent<{
|
607
|
-
|
628
|
+
model: {
|
608
629
|
type: PropType<AnyObject>;
|
609
630
|
default: null;
|
610
631
|
};
|
632
|
+
readonly: {
|
633
|
+
type: BooleanConstructor;
|
634
|
+
default: boolean;
|
635
|
+
};
|
611
636
|
}, {
|
612
637
|
customValue: string;
|
613
638
|
cssVars: import("vue").ComputedRef<AnyObject>;
|
614
639
|
props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
|
615
|
-
|
640
|
+
model: {
|
616
641
|
type: PropType<AnyObject>;
|
617
642
|
default: null;
|
618
643
|
};
|
644
|
+
readonly: {
|
645
|
+
type: BooleanConstructor;
|
646
|
+
default: boolean;
|
647
|
+
};
|
619
648
|
}>> & {}>>;
|
620
649
|
fieldList: AnyObject[];
|
621
650
|
queryWordbookData: ((params: import("../../../components/field-set/src/types").ColorSetWordbook) => Promise<{
|
@@ -749,6 +778,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
749
778
|
NInputNumber: any;
|
750
779
|
NSelect: any;
|
751
780
|
NIcon: any;
|
781
|
+
NButton: any;
|
752
782
|
AddCircleSharp: 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<{}>>, {}>;
|
753
783
|
RemoveCircle: 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<{}>>, {}>;
|
754
784
|
UNIT_OPTIONS: {
|
@@ -879,32 +909,29 @@ declare const _default: import("vue").DefineComponent<{
|
|
879
909
|
holidays: Date[];
|
880
910
|
}>>;
|
881
911
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
882
|
-
|
912
|
+
model: {
|
883
913
|
type: PropType<AnyObject>;
|
884
914
|
default: null;
|
885
915
|
};
|
916
|
+
readonly: {
|
917
|
+
type: BooleanConstructor;
|
918
|
+
default: boolean;
|
919
|
+
};
|
886
920
|
}>>, {
|
887
|
-
|
921
|
+
model: AnyObject;
|
922
|
+
readonly: boolean;
|
888
923
|
}>;
|
889
924
|
EditFilter: import("vue").DefineComponent<{
|
890
925
|
visible: {
|
891
926
|
type: BooleanConstructor;
|
892
927
|
default: boolean;
|
893
928
|
};
|
894
|
-
model: {
|
895
|
-
type: PropType<AnyObject>;
|
896
|
-
default: null;
|
897
|
-
};
|
898
929
|
}, {
|
899
930
|
props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
|
900
931
|
visible: {
|
901
932
|
type: BooleanConstructor;
|
902
933
|
default: boolean;
|
903
934
|
};
|
904
|
-
model: {
|
905
|
-
type: PropType<AnyObject>;
|
906
|
-
default: null;
|
907
|
-
};
|
908
935
|
}>> & {
|
909
936
|
onConfirm?: ((...args: any[]) => any) | undefined;
|
910
937
|
"onUpdate:visible"?: ((...args: any[]) => any) | undefined;
|
@@ -915,18 +942,26 @@ declare const _default: import("vue").DefineComponent<{
|
|
915
942
|
onClose: () => void;
|
916
943
|
NModal: any;
|
917
944
|
Condition: import("vue").DefineComponent<{
|
918
|
-
|
945
|
+
model: {
|
919
946
|
type: PropType<AnyObject>;
|
920
947
|
default: null;
|
921
948
|
};
|
949
|
+
readonly: {
|
950
|
+
type: BooleanConstructor;
|
951
|
+
default: boolean;
|
952
|
+
};
|
922
953
|
}, {
|
923
954
|
customValue: string;
|
924
955
|
cssVars: import("vue").ComputedRef<AnyObject>;
|
925
956
|
props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
|
926
|
-
|
957
|
+
model: {
|
927
958
|
type: PropType<AnyObject>;
|
928
959
|
default: null;
|
929
960
|
};
|
961
|
+
readonly: {
|
962
|
+
type: BooleanConstructor;
|
963
|
+
default: boolean;
|
964
|
+
};
|
930
965
|
}>> & {}>>;
|
931
966
|
fieldList: AnyObject[];
|
932
967
|
queryWordbookData: ((params: import("../../../components/field-set/src/types").ColorSetWordbook) => Promise<{
|
@@ -1060,6 +1095,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
1060
1095
|
NInputNumber: any;
|
1061
1096
|
NSelect: any;
|
1062
1097
|
NIcon: any;
|
1098
|
+
NButton: any;
|
1063
1099
|
AddCircleSharp: 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<{}>>, {}>;
|
1064
1100
|
RemoveCircle: 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<{}>>, {}>;
|
1065
1101
|
UNIT_OPTIONS: {
|
@@ -1190,28 +1226,28 @@ declare const _default: import("vue").DefineComponent<{
|
|
1190
1226
|
holidays: Date[];
|
1191
1227
|
}>>;
|
1192
1228
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
1193
|
-
|
1229
|
+
model: {
|
1194
1230
|
type: PropType<AnyObject>;
|
1195
1231
|
default: null;
|
1196
1232
|
};
|
1233
|
+
readonly: {
|
1234
|
+
type: BooleanConstructor;
|
1235
|
+
default: boolean;
|
1236
|
+
};
|
1197
1237
|
}>>, {
|
1198
|
-
|
1238
|
+
model: AnyObject;
|
1239
|
+
readonly: boolean;
|
1199
1240
|
}>;
|
1200
1241
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("confirm" | "update:visible")[], "confirm" | "update:visible", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
1201
1242
|
visible: {
|
1202
1243
|
type: BooleanConstructor;
|
1203
1244
|
default: boolean;
|
1204
1245
|
};
|
1205
|
-
model: {
|
1206
|
-
type: PropType<AnyObject>;
|
1207
|
-
default: null;
|
1208
|
-
};
|
1209
1246
|
}>> & {
|
1210
1247
|
onConfirm?: ((...args: any[]) => any) | undefined;
|
1211
1248
|
"onUpdate:visible"?: ((...args: any[]) => any) | undefined;
|
1212
1249
|
}, {
|
1213
1250
|
visible: boolean;
|
1214
|
-
model: AnyObject;
|
1215
1251
|
}>;
|
1216
1252
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("confirm" | "update:visible")[], "confirm" | "update:visible", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
1217
1253
|
visible: {
|
@@ -1226,12 +1262,22 @@ declare const _default: import("vue").DefineComponent<{
|
|
1226
1262
|
type: PropType<AnyObject | null>;
|
1227
1263
|
default: null;
|
1228
1264
|
};
|
1265
|
+
readonly: {
|
1266
|
+
type: BooleanConstructor;
|
1267
|
+
default: boolean;
|
1268
|
+
};
|
1269
|
+
isAdd: {
|
1270
|
+
type: BooleanConstructor;
|
1271
|
+
default: boolean;
|
1272
|
+
};
|
1229
1273
|
}>> & {
|
1230
1274
|
onConfirm?: ((...args: any[]) => any) | undefined;
|
1231
1275
|
"onUpdate:visible"?: ((...args: any[]) => any) | undefined;
|
1232
1276
|
}, {
|
1233
1277
|
row: AnyObject | null;
|
1234
1278
|
visible: boolean;
|
1279
|
+
isAdd: boolean;
|
1280
|
+
readonly: boolean;
|
1235
1281
|
isFieldColor: boolean;
|
1236
1282
|
}>;
|
1237
1283
|
setStyle: typeof setStyle;
|
@@ -1 +1 @@
|
|
1
|
-
import{defineComponent as e,ref as l,reactive as t,openBlock as i,createElementBlock as a,createElementVNode as o,Fragment as s,renderList as r,normalizeStyle as
|
1
|
+
import{defineComponent as e,ref as l,reactive as t,openBlock as i,createElementBlock as a,createElementVNode as o,Fragment as s,renderList as r,normalizeStyle as d,unref as u,toDisplayString as n,createCommentVNode as f,createVNode as c,withCtx as p,mergeProps as m,renderSlot as v,createTextVNode as y,createBlock as b}from"vue";import{NButton as h}from"naive-ui";import x from"../../../shared/components/VueDraggable/src/vuedraggable.js";import g from"./components/table-row.vue.js";import _ from"./components/edit-dialog.vue.js";import{cloneDeep as k,omit as w}from"lodash-es";import{setColorInfo as C,setStyle as F}from"./utils/index.js";import{uuidGenerator as j}from"../../../shared/utils/index.js";import{format as A}from"date-fns";const D={class:"main-wrapper"},S={class:"main-wrapper__table"},V={class:"main-wrapper__table-header"},B={class:"main-wrapper__table-body",ref:"tableBodyRef"},E=["tabindex"],M={key:0,class:"main-wrapper__table-footer"};var L=e({__name:"FieldColor",props:{footerFlag:{type:Boolean,default:!0},isFieldColor:{type:Boolean,default:!0},defaultList:{type:Array,default:()=>[]}},emits:["save","close"],setup(e,{expose:L,emit:R}){const U=e,Y=l(!1),H=l(null),I=l([]),N=l(!1),T=l(!1),$=l([{title:"名称",type:"text",field:"name"},{title:"字段",type:"text",field:"title"},{title:"创建时间",type:"text",field:"createDate"},{title:"效果",type:"text",field:"result"},{title:"颜色",type:"color",field:"color"},{title:"颜色应用于",type:"select",checkedAll:!1,disabledAll:!1,field:"colorScope"},{title:"显示",type:"checkbox",checkedAll:!1,disabledAll:!1,field:"status"},{title:"操作",type:"custom",field:"opt"}]),q=t({columns:$,data:I,onEdit:function({row:e,readonly:l=!1,add:t=!1}){H.value=k(e),T.value=t,N.value=l,Y.value=!0},isHighlightRow:!U.isFieldColor});function z(){R("save")}function G(){R("close")}function J(){H.value=null,T.value=!0,Y.value=!0}function K(e){if(C(e),T.value){const l=A(new Date,"yyyy-MM-dd");I.value.push({...e,createDate:l,uuid:j(),defaultMark:0})}else{const l=I.value.findIndex((l=>l.uuid===e.uuid));I.value.splice(l,1,e)}}return $.value.forEach((e=>{e.isShow=function(e){return U.isFieldColor&&"result"!==e.field||!U.isFieldColor&&"title"!==e.field}(e)})),I.value=U.defaultList.concat(I.value),I.value.forEach((e=>{e.uuid=j(),e.status="Y"===e.status,C(e)})),L({getTableFields:function(){return I.value.map((e=>{const l=k(e);return l.status=l.status?"Y":"N",w(l,["uuid","style","result"])}))}}),(l,t)=>(i(),a("div",D,[o("div",S,[o("div",V,[(i(!0),a(s,null,r($.value,((e,l)=>(i(),a(s,{key:l},[e.isShow?(i(),a("span",{key:0,class:"table-cell",style:d(u(F)(e,l))},[o("span",null,n(e.title),1)],4)):f("v-if",!0)],64)))),128))]),o("div",B,[c(u(x),{modelValue:I.value,"onUpdate:modelValue":t[0]||(t[0]=e=>I.value=e),animation:"150","item-key":"id",draggable:".item"},{item:p((({element:e,index:l})=>[e.hide?f("v-if",!0):(i(),a("div",{key:0,class:"item",tabindex:l},[c(g,m(q,{element:e,index:l}),null,16,["element","index"])],8,E))])),_:1},8,["modelValue"])],512)]),e.footerFlag?(i(),a("div",M,[f(" 底部按钮插槽 "),v(l.$slots,"colorSetFooter",{},(()=>[c(u(h),{style:{"margin-right":"8px"},onClick:G},{default:p((()=>[y("取消")])),_:1}),c(u(h),{style:{"margin-right":"8px"},onClick:J},{default:p((()=>[y("新增")])),_:1}),c(u(h),{type:"primary",onClick:z},{default:p((()=>[y("保存")])),_:1})]))])):f("v-if",!0),Y.value?(i(),b(_,{key:1,visible:Y.value,"onUpdate:visible":t[1]||(t[1]=e=>Y.value=e),"is-field-color":e.isFieldColor,row:H.value,readonly:N.value,"is-add":T.value,onConfirm:K},null,8,["visible","is-field-color","row","readonly","is-add"])):f("v-if",!0)]))}});export{L as default};
|