cnhis-design-vue 3.1.48 → 3.1.49-beta.1
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/classification/index.d.ts +4 -2
- package/es/components/classification/src/components/search-filter/index.vue.d.ts +4 -2
- package/es/components/classification/src/components/set-classification/index.vue.d.ts +4 -2
- package/es/components/classification/src/index.vue.d.ts +4 -2
- package/es/components/date-picker/index.d.ts +2 -1
- package/es/components/date-picker/src/DatePicker.vue.d.ts +2 -1
- package/es/components/date-picker/src/DatePicker.vue2.js +1 -1
- package/es/components/fabric-chart/src/FabricChart.vue2.js +1 -1
- package/es/components/fabric-chart/src/components/PopupMenu.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/index.js +1 -1
- package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useCenter.js +1 -1
- package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useLeft.js +1 -1
- package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useOther.js +1 -1
- package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useSurgicalAnesthesiaChart.js +1 -1
- package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useTop.js +1 -1
- package/es/components/fabric-chart/src/hooks/temperature/useBottom.js +1 -1
- package/es/components/fabric-chart/src/hooks/temperature/useCenter.js +1 -1
- package/es/components/fabric-chart/src/hooks/temperature/useLeft.js +1 -1
- package/es/components/fabric-chart/src/hooks/temperature/useOther.js +1 -1
- package/es/components/fabric-chart/src/hooks/temperature/useTemperatureChart.js +1 -1
- package/es/components/fabric-chart/src/hooks/temperature/useTop.js +1 -1
- package/es/components/fabric-chart/src/hooks/useEvent.d.ts +0 -1
- package/es/components/fabric-chart/src/hooks/useEvent.js +1 -1
- package/es/components/field-set/index.d.ts +26 -0
- package/es/components/field-set/src/FieldSet.vue.d.ts +26 -0
- package/es/components/field-set/src/FieldSet.vue2.js +1 -1
- package/es/components/field-set/src/components/Row.vue.d.ts +13 -0
- package/es/components/field-set/src/components/Row.vue2.js +1 -1
- package/es/components/form-config/index.d.ts +7 -0
- package/es/components/form-config/src/FormConfig.vue.d.ts +7 -0
- package/es/components/form-config/src/components/FormConfigEdit.vue.d.ts +3 -0
- package/es/components/form-render/src/components/renderer/inputNumber.d.ts +35 -0
- package/es/components/form-render/src/components/renderer/inputNumber.js +1 -1
- package/es/components/form-render/src/hooks/useFieldListAdaptor.js +1 -1
- package/es/components/form-render/src/hooks/useFormValidator.js +1 -1
- package/es/components/form-render/src/types/fieldItem.d.ts +1 -0
- package/es/components/form-render/style/index.css +1 -1
- package/es/components/iho-table/src/plugins/filterDaterangeRenderPlugin/filter.vue.d.ts +2 -1
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/dateRendererPlugin/editDate.vue.d.ts +2 -1
- package/es/components/index.css +1 -1
- package/es/components/scale-view/src/ScaleView.vue2.js +1 -1
- package/es/components/select-label/src/LabelFormContent.vue2.js +1 -1
- package/es/components/select-person/src/SearchMultiple.vue.d.ts +6 -0
- package/es/components/shortcut-setter/index.d.ts +1 -0
- package/es/components/shortcut-setter/src/ShortcutSetter.vue.d.ts +1 -0
- package/es/components/table-export-field/src/components/ExportModal.vue.d.ts +0 -3
- package/es/components/table-filter/src/components/classify-filter/ValueCfg.vue.d.ts +4 -2
- package/es/components/table-filter/src/components/classify-filter/components/Date.vue.d.ts +2 -1
- package/es/components/table-filter/src/components/classify-filter/components/DateRange.vue.d.ts +2 -1
- package/es/components/table-filter/src/components/classify-filter/components/index.d.ts +4 -2
- package/es/components/table-filter/src/components/classify-filter/index.vue.d.ts +4 -2
- package/es/components/table-filter/src/components/render-widget/components/DateInner.vue.d.ts +2 -1
- package/es/components/table-filter/src/components/render-widget/components/DateOut.vue.d.ts +2 -1
- package/es/components/table-filter/src/components/render-widget/components/DateRangeInner.vue.d.ts +2 -1
- package/es/components/table-filter/src/components/render-widget/components/DateRangeOut.vue.d.ts +2 -1
- package/es/components/table-filter/src/components/render-widget/components/index.d.ts +8 -4
- package/es/components/table-filter/src/components/render-widget/widgetCfgMaps.d.ts +8 -4
- package/es/env.d.ts +25 -25
- package/es/shared/assets/img/failure.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/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/hooks/useDateTime.d.ts +1 -0
- package/es/shared/hooks/useDateTime.js +1 -1
- package/es/shared/package.json.js +1 -1
- package/package.json +2 -2
- package/es/components/bpmn-workflow/src/BpmnWorkflow.d.ts +0 -0
- package/es/components/bpmn-workflow/types/BpmnViewer.d.ts +0 -1
- package/es/components/bpmn-workflow/types/ModelingModule.d.ts +0 -1
- package/es/components/bpmn-workflow/types/MoveCanvasModule.d.ts +0 -1
- package/es/shared/components/VueDraggable/src/vuedraggable.d.ts +0 -86
- package/es/shared/utils/fabricjs/index.d.ts +0 -6823
- package/es/shared/utils/tapable/index.d.ts +0 -139
- package/es/shared/utils/tapableLess.d.ts +0 -28
- package/es/shared/utils/tapableLess.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{fabric as e}from"../../../../../shared/utils/fabricjs/index.js";import{useShadow as t}from"./useShadow.js";import{drawLine as n,defaultStyle as i,drawPoint as o,drawText as l,drawArrow as r}from"../useDraw.js";import{useGrid as s}from"../useGrid.js";import"date-fns";import{isOneLine as a,getType as u,isOverlapPoint as c,isValidValue as p,setOtherType as d,isEffectiveNode as f,getTime as h,getIndex as g,deleteProperty as v}from"../../utils/index.js";import"@vueuse/core";import{useCommon as y}from"../useCommon.js";import"vue";import{cloneDeep as m}from"lodash-es";import{TEMPERATURE_MENU as x,PAIN_MENU as b,OVERLAP as j}from"../../constants/index.js";function L(L,k,S,Y,E,M,$,O,P,A){s(L,k);const{getEqualXTypes:C,handleAddPrevent:I}=y(L,S,k),{createShadowLines:T}=t(),{left:R,xScaleList:X,xCellWidth:F,yCellHeight:z,originX:D,endX:V,originY:_,endY:G,itemList:H,event:W,vitalSignsOriginY:q,painOriginY:B,hospitalizationDate:J,config:K,canvasHeight:N}=k,Q=new Set,U=["xinmai","mai"],Z=new Map,ee=new Set,te=new Set,ne=new Set,ie=m(R.yScaleValue);function oe(t){var o;const l=ie.find((e=>"pulse"===e.type));if(l&&(null==(o=l.dataList)?void 0:o.length)&&(Q.size&&L.value.remove(...Q),Q.clear(),Z.size>1)){if(t){const{type:e,key:n}=t.origin||{};if("pulse"===e){const e=Z.get(n),i=null==e?void 0:e.findIndex((e=>e[0]===t.left));e.splice(i,1,[t.left,t.top])}}const o=function(){const e=[],t=[],n=[];for(const e of Z)t.push(e[1]),e[0]===U[0]&&e[1].forEach((e=>{(Z.get(U[1])||[]).findIndex((t=>t[0]===e[0]))>-1&&n.push(e[0])}));const[i,o]=t;let l=[],r=[];return n.forEach((t=>{const n=i.findIndex((e=>e[0]===t)),s=o.findIndex((e=>e[0]===t)),a=i[n],u=o[s],c=i[n-1],p=i[n+1],d=o[s-1],f=o[s+1];if(c&&d){if(c[0]!==d[0]){const e=Math.max(c[0],d[0]);l.push([c,d].find((t=>t[0]===e)))}}else c?l.push(c):d&&r.push(d);const h=Math.min(a[1],u[1]);l.push([a,u].find((e=>e[1]===h)));const g=Math.max(a[1],u[1]);r.push([a,u].find((e=>e[1]===g)));const v=()=>{const t=[...l,...r.reverse()],[n]=t,i=t.at(-1);n[0]===i[0]&&n[1]===i[1]&&t.splice(-1,1),e.push(t),l=[],r=[]};if(p&&f){if(p[0]!==f[0]){const e=Math.min(p[0],f[0]);l.push([p,f].find((t=>t[0]===e))),v()}}else p?(l.push(p),v()):f?(r.push(f),v()):v()})),e}(),{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,{...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(...T(t,s._angle,s.space)),e.forEach((e=>{Object.assign(e,{...i,...s}),Q.add(e)}));else{const i=function(e){const t=e.reduce(((e,t)=>{const n=Math.trunc(t[0]);return e[n]=e[n]?e[n].concat(t):[t],e}),{}),n=Object.values(t).filter((e=>2===e.length&&Math.trunc(e[0][1])!==Math.trunc(e[1][1])));return n}(t);i.forEach((t=>{const i=n([...t.flat()],{...s,originX:"center"});e.push(i),Q.add(i)}))}L.value.add(...e)}Q.add(l),L.value.add(l)}))}}function le(){var e;const t=ie.find((e=>"pulse"===e.type));if(!t||!(null==(e=t.dataList)?void 0:e.length))return;if(!t.dataList.some((e=>e.title.includes("脉搏"))))return;const n=Object.assign({},j,R.overlap||{}),l=[];ee.size&&[...ee].forEach((e=>{[...te].forEach((t=>{if(t.origin&&c(e,t)){const e=t.origin.key;if(e){const r={left:t.left,top:t.top,...i,hoverCursor:"default"};let s="koumai";"yemai"===e&&(s=e),"humai"===e&&(s="circle"),l.push(o(s,{...n[e]||{},...r}))}}}))})),setTimeout((()=>{L.value.add(...l),l.forEach((e=>{null==e||e.bringToFront(),ne.add(e)}))}))}function re(e,t,s){var u;const{type:c,riseStyle:f={},noRiseStyle:h={},verifiedStyle:g={},reduceStyle:v={},pacemaker:y={},upArrowStyle:m={},limitValueStyle:x={},nonePainPointStyle:b={},dataList:j=[]}=s,{type:Y,textStyle:M,showConnectLine:O=!1}=b,A=[],C=[],I=[];null==(u=e.list)||u.forEach(((u,b)=>{const T=a(c)?j.find((e=>e.key===u.key)):e,R=ue(u,s),X={};X.value=function(e,t,n){if(!(null==e?void 0:e.length)||!K.showValue)return;const{lineAttr:i={}}=n,o=e[1]<=q.originY+z?e[1]+z:e[1]-z,r=l([e[0],o],{value:t.value,originX:"center",originY:"center",fill:i.stroke||"#000"});return I.push(r),{obj:r,top:-z}}(R,u,T),function(e,t,s,a,u){var d,y;if(!(null==e?void 0:e.length)||!["temperature","pain"].includes(c))return;const{lineAttr:m={}}=s,{value:x}=a;let b,j,L,k,S,Y;if(t.noRise&&h.show){const t=w(h)?E(u.type,u.list,35):e[1];if(h.text)L=l([e[0],w(h)?t:t+5],{value:h.text.split("").join("\n"),originY:"top",...h.style||{}}),I.push(L);else{const n=t+2*z;k=r([e[0],t,n],h.style||{}),I.push(k)}}t.rise&&f.show&&f.text&&(S=l([e[0],e[1]-(x?z:0)-5],{value:f.text.split("").join("\n"),originY:"bottom",...f.style||{}}),I.push(S));t.verified&&(Y=l([e[0],e[1]-(x?z:0)-5],{value:"v",originX:"center",originY:"bottom",...g}),I.push(Y));if(p(t.physicsReduce)||p(t.drugReduce)){const l=E(c,u.list,null!=(d=t.physicsReduce)?d:t.drugReduce);b=n([...e,e[0],l],{...m,...v.line,...i}),j=o((null==(y=null==v?void 0:v.point)?void 0:y.type)||"circle",{left:e[0],top:l,...v.point,...i,originY:l===N?"bottom":"center"}),b&&I.push(b),j&&I.push(j)}Object.assign(a,{reduceLine:{obj:b,type:"line"},noRiseText:{obj:L,top:5,isFixed:w(h)},arrowGroup:{obj:k,top:2*z,isFixed:w(h)},riseText:{obj:S,top:(x?-z:0)-5},verifiedText:{obj:Y,top:(x?-z:0)-5},reducePoint:{obj:j,type:"reduce"}})}(R,u,T,X,s),function(e,t,n,i){if(!(null==e?void 0:e.length)||!["pulse"].includes(c))return;let o,a;const{upArrowShow:u=!1,limitValueShow:p=!1}=n;if(u&&+t.value>180){let t=e[1]-2.5*z,n=[e[1]-z/2,t];t<q.originY&&(t=e[1]+2.5*z,n=[t,e[1]+z/2]),o=r([e[0],n[0],n[1]],m,"up"),I.push(o)}if(p){const n={value:t.value,originX:"center",originY:"center",...x};if(+t.value>Math.max(...s.list)){const t=o?e[1]+z/2+o.height:e[1]+z;a=l([e[0],t],n),I.push(a)}+t.value<Math.min(...s.list)&&(a=l([e[0],e[1]-z],n),I.push(a))}Object.assign(i,{upArrow:{obj:o},limitValue:{obj:a,top:-z}})}(R,u,T,X),function(i,l,r,a,u){let p,f;const{pointAttr:h={},lineAttr:g={},title:v="",key:m,type:x="circle"}=a,b=e.list[r+1],j=ue(b,s),w=se(c,e.list[r].value),E=j&&se(c,b.value);i&&j&&!l.breakpoint&&(!w&&!E||O)&&i[0]!==j[0]&&(f=n([...i,...j],{...g}));const I=l.pacemakerShow&&"pulse"==c?y.value:w&&"number"===Y?0:x,T=C[r-1],R={origin:{data:l,title:v,key:m||"",unit:s.unit,type:c,_type:d(v,c),dataIndex:t,index:r},leftLine:T,rightLine:f,otherObj:u,lockMovementX:!0,...l.pacemakerShow&&"pulse"==c?y.style:h,...k.event.hovered?k.event.evented?{selectable:!0}:{selectable:!0,lockMovementY:!0}:k.event,...w?{selectable:!1,evented:!1,..."number"===Y?M:{}}:{}};if(T){const e=T.get("y2");p=o(I,{left:T.get("x2"),top:w?e-5:e,...R})}else i&&(R.leftLine=null,p=o(I,{left:i[0],top:w?i[1]-5:i[1],...R}));C.push(f),p&&(v.includes("脉搏")?ee.add(p):te.add(p),function(e){W.hovered&&(e.on("mouseover",(()=>{ae(e,"hover")})),e.on("mouseout",(()=>{P.show=!1})));if(e.lockMovementX&&e.lockMovementY)return;e.on("moving",(()=>{!function(e){e.setCoords();const t="pain"===e.origin.type?B:q;e.top<t.originY&&e.set("top",t.originY);e.top>t.endY&&e.set("top",t.endY)}(e),function(e){var t,n;null==(t=e.leftLine)||t.setCoords().set({x2:e.left,y2:e.top}),null==(n=e.rightLine)||n.setCoords().set({x1:e.left,y1:e.top}),Object.values(e.otherObj).forEach((t=>{const{obj:n,type:i="",top:o=0,isFixed:l}=t||{};"reduce"!==i&&("line"===i?null==n||n.setCoords().set({x1:e.left,y1:e.top}):!l&&(null==n||n.setCoords().set({left:e.left,top:e.top+o})))})),oe(e)}(e),W.hovered&&ae(e)})),e.on("mouseup",(t=>{if(P.show=!1,1===t.button){const{type:t}=e.origin,n=$(t,e.top),i={...e.origin,data:{...e.origin.data,value:n}};L.value.discardActiveObject(),S("change",i),pe(i,"change")}}))}(p),A.push(p),ne.add(p))}(R,u,b,T,X)})),"pulse"===c&&U.forEach((e=>{Z.set(e,A.filter((t=>{var n;return(null==(n=t.origin)?void 0:n.key)===e})).map((e=>[e.left,e.top])))})),Promise.all(A).then((e=>{const t=C.filter((e=>e));let n=null;e=e.map((e=>(e&&n&&(n.nextPoint=e,e.prevPoint=n),n=e||n,e))),Promise.all(I).then((n=>{L.value.add(...t,...e,...n),e.forEach((t=>{null==t||t.bringToFront(),function(e,t){if("pulse"===e.origin.type){t.filter((t=>t.left===e.left&&"pulse"===t.origin.type)).length>1&&(e.leftLine&&L.value.remove(e.leftLine),e.rightLine&&L.value.remove(e.rightLine))}}(t,e)}))}))}))}function se(e,t){return"pain"===e&&0==t}function ae(e,t="moving"){const{title:n,unit:i,type:o,data:l}=e.origin;P.point={x:e.left,y:e.top},P.list=[function(){const{drugReduce:r,physicsReduce:s}=l||{},a="hover"===t?l.value:$(o,e.top);if(p(r))return`药物降${"pain"==o?"痛":"温"} ${a}—>${r}${i||""}`;if(p(s))return`物理降${"pain"==o?"痛":"温"} ${a}—>${s}${i||""}`;return`${n} ${a}${i||""}`}(),`时间 ${((null==l?void 0:l.time)||M(e.left)).slice(-5)}`],P.show=!0}function ue(e,t){const n="pain"===t.type?B:q;if(f(e)&&function(e){const[t]=X,n=X.at(-1),i=t.start,o=n.end,l=h(e);return l>=i&&l<=o}(e.time)){const i=Y(e.time),o=E(t.type,t.list,e.value);return[i,o<n.originY?n.originY:o>n.endY?n.endY:o]}}function ce(e){const t=new Date,n=String(t.getMonth()+1).padStart(2,"0"),i=String(t.getDate()).padStart(2,"0"),o=h(`${t.getFullYear()}-${n}-${i} 23:59:59`),l=h(`${M(e)}:00`);return J&&l<h(J)?(I("exceedMin"),!1):!(l>o)||(I("exceedMax"),!1)}function pe(e,t="add"){const{type:n,dataIndex:i,index:o,data:l,key:r}=e,s=ie.find((e=>e.type===n));if("add"===t){const e=a(n)?s.dataList.find((e=>e.enable)):s.dataList[i],t=g(l.time,e.list);e.list.splice(t,0,l)}else s.dataList[i].list[o]=l;de()}function de(){var e;ne.size&&(null==(e=L.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}([...ne]))),Z.clear(),ne.clear(),ee.clear(),te.clear(),ie.forEach((e=>{e.dataList.forEach(((t,n)=>{a(e.type)&&!t.enable||re(t,n,e)}))})),oe(),le()}return Z.clear(),ee.clear(),te.clear(),ie.forEach((e=>{!function(e){if("temperature"!==e.type||!e.positionLine)return;const t=E(e.type,e.list,e.positionLine.value),i=n([D,t,V,t],e.positionLine);L.value.add(i)}(e),e.dataList.forEach(((t,n)=>{a(e.type)&&!t.enable||re(t,n,e)}))})),oe(),le(),k.event.evented&&L.value.on("mouse:up",(e=>{var t;if(3===e.button){const{x:n=0,y:i=0}=e.pointer||{};if(n>=D&&n<=V&&i>=_&&i<=G){A.point={x:n,y:i},A.show=!0;const{type:o}=(null==(t=e.target)?void 0:t.origin)||{};if(e.target&&["temperature","pain"].includes(o))"temperature"===o&&(A.list=[...x]),"pain"===o&&(A.list=[...b]),A.target=e.target;else{A.target=null,A.list=["新增节点"],H.forEach((t=>{if(!C([...ne],n,"_type").includes(t.bigType)){const n=["pain"].includes(t.bigType)?B:q;i>=n.originY&&i<=n.endY&&A.list.push({renderItem:O?O(t):()=>t.title,origin:{title:t.title,unit:t.unit,type:u(t.bigType),dataIndex:t.dataIndex,key:t.key},pointer:e.pointer})}}));const t=ce(n);t&&1!==A.list.length||(A.show=!1,1===A.list.length&&t&&I("repeat"))}}}})),{clickMenu:function({item:e,target:t}){if(t){const{data:n,type:i,dataIndex:o,index:l}=t.origin,r=v(n,[...x,...b]);r[`${e.type}`]=e.value,a(i)&&(r.key=t.origin.key);const s={...t.origin,data:r};S("change",s),pe(s,"change")}else{const t={data:{time:M(e.pointer.x),value:$(e.origin.type,e.pointer.y),...a(e.origin.type)?{key:e.origin.key}:{}},...e.origin};S("add",t),pe(t)}},setPopup:ae,isAddPoint:ce,updateData:pe,redrawPoints:de,gridPoints:ne}}function w(e){return"fixed"===e.position}export{L as useCenter};
|
|
1
|
+
import{fabric as e}from"../../../../../shared/utils/fabricjs/index.js";import{useShadow as t}from"./useShadow.js";import{drawLine as n,defaultStyle as i,drawPoint as o,drawText as l,drawArrow as r}from"../useDraw.js";import{useGrid as s}from"../useGrid.js";import"date-fns";import{isOneLine as a,getType as u,isOverlapPoint as c,isValidValue as p,setOtherType as d,isEffectiveNode as f,getTime as h,getIndex as g,deleteProperty as v}from"../../utils/index.js";import{useCommon as y}from"../useCommon.js";import"vue";import{cloneDeep as m}from"lodash-es";import{TEMPERATURE_MENU as x,PAIN_MENU as b,OVERLAP as j}from"../../constants/index.js";function L(L,k,S,Y,E,M,$,O,P,A){s(L,k);const{getEqualXTypes:C,handleAddPrevent:I}=y(L,S,k),{createShadowLines:T}=t(),{left:R,xScaleList:X,xCellWidth:F,yCellHeight:z,originX:D,endX:V,originY:_,endY:G,itemList:H,event:W,vitalSignsOriginY:q,painOriginY:B,hospitalizationDate:J,config:K,canvasHeight:N}=k,Q=new Set,U=["xinmai","mai"],Z=new Map,ee=new Set,te=new Set,ne=new Set,ie=m(R.yScaleValue);function oe(t){var o;const l=ie.find((e=>"pulse"===e.type));if(l&&(null==(o=l.dataList)?void 0:o.length)&&(Q.size&&L.value.remove(...Q),Q.clear(),Z.size>1)){if(t){const{type:e,key:n}=t.origin||{};if("pulse"===e){const e=Z.get(n),i=null==e?void 0:e.findIndex((e=>e[0]===t.left));e.splice(i,1,[t.left,t.top])}}const o=function(){const e=[],t=[],n=[];for(const e of Z)t.push(e[1]),e[0]===U[0]&&e[1].forEach((e=>{(Z.get(U[1])||[]).findIndex((t=>t[0]===e[0]))>-1&&n.push(e[0])}));const[i,o]=t;let l=[],r=[];return n.forEach((t=>{const n=i.findIndex((e=>e[0]===t)),s=o.findIndex((e=>e[0]===t)),a=i[n],u=o[s],c=i[n-1],p=i[n+1],d=o[s-1],f=o[s+1];if(c&&d){if(c[0]!==d[0]){const e=Math.max(c[0],d[0]);l.push([c,d].find((t=>t[0]===e)))}}else c?l.push(c):d&&r.push(d);const h=Math.min(a[1],u[1]);l.push([a,u].find((e=>e[1]===h)));const g=Math.max(a[1],u[1]);r.push([a,u].find((e=>e[1]===g)));const v=()=>{const t=[...l,...r.reverse()],[n]=t,i=t.at(-1);n[0]===i[0]&&n[1]===i[1]&&t.splice(-1,1),e.push(t),l=[],r=[]};if(p&&f){if(p[0]!==f[0]){const e=Math.min(p[0],f[0]);l.push([p,f].find((t=>t[0]===e))),v()}}else p?(l.push(p),v()):f?(r.push(f),v()):v()})),e}(),{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,{...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(...T(t,s._angle,s.space)),e.forEach((e=>{Object.assign(e,{...i,...s}),Q.add(e)}));else{const i=function(e){const t=e.reduce(((e,t)=>{const n=Math.trunc(t[0]);return e[n]=e[n]?e[n].concat(t):[t],e}),{}),n=Object.values(t).filter((e=>2===e.length&&Math.trunc(e[0][1])!==Math.trunc(e[1][1])));return n}(t);i.forEach((t=>{const i=n([...t.flat()],{...s,originX:"center"});e.push(i),Q.add(i)}))}L.value.add(...e)}Q.add(l),L.value.add(l)}))}}function le(){var e;const t=ie.find((e=>"pulse"===e.type));if(!t||!(null==(e=t.dataList)?void 0:e.length))return;if(!t.dataList.some((e=>e.title.includes("脉搏"))))return;const n=Object.assign({},j,R.overlap||{}),l=[];ee.size&&[...ee].forEach((e=>{[...te].forEach((t=>{if(t.origin&&c(e,t)){const e=t.origin.key;if(e){const r={left:t.left,top:t.top,...i,hoverCursor:"default"};let s="koumai";"yemai"===e&&(s=e),"humai"===e&&(s="circle"),l.push(o(s,{...n[e]||{},...r}))}}}))})),setTimeout((()=>{L.value.add(...l),l.forEach((e=>{null==e||e.bringToFront(),ne.add(e)}))}))}function re(e,t,s){var u;const{type:c,riseStyle:f={},noRiseStyle:h={},verifiedStyle:g={},reduceStyle:v={},pacemaker:y={},upArrowStyle:m={},limitValueStyle:x={},nonePainPointStyle:b={},dataList:j=[]}=s,{type:Y,textStyle:M,showConnectLine:O=!1}=b,A=[],C=[],I=[];null==(u=e.list)||u.forEach(((u,b)=>{const T=a(c)?j.find((e=>e.key===u.key)):e,R=ue(u,s),X={};X.value=function(e,t,n){if(!(null==e?void 0:e.length)||!K.showValue)return;const{lineAttr:i={}}=n,o=e[1]<=q.originY+z?e[1]+z:e[1]-z,r=l([e[0],o],{value:t.value,originX:"center",originY:"center",fill:i.stroke||"#000"});return I.push(r),{obj:r,top:-z}}(R,u,T),function(e,t,s,a,u){var d,y;if(!(null==e?void 0:e.length)||!["temperature","pain"].includes(c))return;const{lineAttr:m={}}=s,{value:x}=a;let b,j,L,k,S,Y;if(t.noRise&&h.show){const t=w(h)?E(u.type,u.list,35):e[1];if(h.text)L=l([e[0],w(h)?t:t+5],{value:h.text.split("").join("\n"),originY:"top",...h.style||{}}),I.push(L);else{const n=t+2*z;k=r([e[0],t,n],h.style||{}),I.push(k)}}t.rise&&f.show&&f.text&&(S=l([e[0],e[1]-(x?z:0)-5],{value:f.text.split("").join("\n"),originY:"bottom",...f.style||{}}),I.push(S));t.verified&&(Y=l([e[0],e[1]-(x?z:0)-5],{value:"v",originX:"center",originY:"bottom",...g}),I.push(Y));if(p(t.physicsReduce)||p(t.drugReduce)){const l=E(c,u.list,null!=(d=t.physicsReduce)?d:t.drugReduce);b=n([...e,e[0],l],{...m,...v.line,...i}),j=o((null==(y=null==v?void 0:v.point)?void 0:y.type)||"circle",{left:e[0],top:l,...v.point,...i,originY:l===N?"bottom":"center"}),b&&I.push(b),j&&I.push(j)}Object.assign(a,{reduceLine:{obj:b,type:"line"},noRiseText:{obj:L,top:5,isFixed:w(h)},arrowGroup:{obj:k,top:2*z,isFixed:w(h)},riseText:{obj:S,top:(x?-z:0)-5},verifiedText:{obj:Y,top:(x?-z:0)-5},reducePoint:{obj:j,type:"reduce"}})}(R,u,T,X,s),function(e,t,n,i){if(!(null==e?void 0:e.length)||!["pulse"].includes(c))return;let o,a;const{upArrowShow:u=!1,limitValueShow:p=!1}=n;if(u&&+t.value>180){let t=e[1]-2.5*z,n=[e[1]-z/2,t];t<q.originY&&(t=e[1]+2.5*z,n=[t,e[1]+z/2]),o=r([e[0],n[0],n[1]],m,"up"),I.push(o)}if(p){const n={value:t.value,originX:"center",originY:"center",...x};if(+t.value>Math.max(...s.list)){const t=o?e[1]+z/2+o.height:e[1]+z;a=l([e[0],t],n),I.push(a)}+t.value<Math.min(...s.list)&&(a=l([e[0],e[1]-z],n),I.push(a))}Object.assign(i,{upArrow:{obj:o},limitValue:{obj:a,top:-z}})}(R,u,T,X),function(i,l,r,a,u){let p,f;const{pointAttr:h={},lineAttr:g={},title:v="",key:m,type:x="circle"}=a,b=e.list[r+1],j=ue(b,s),w=se(c,e.list[r].value),E=j&&se(c,b.value);i&&j&&!l.breakpoint&&(!w&&!E||O)&&i[0]!==j[0]&&(f=n([...i,...j],{...g}));const I=l.pacemakerShow&&"pulse"==c?y.value:w&&"number"===Y?0:x,T=C[r-1],R={origin:{data:l,title:v,key:m||"",unit:s.unit,type:c,_type:d(v,c),dataIndex:t,index:r},leftLine:T,rightLine:f,otherObj:u,lockMovementX:!0,...l.pacemakerShow&&"pulse"==c?y.style:h,...k.event.hovered?k.event.evented?{selectable:!0}:{selectable:!0,lockMovementY:!0}:k.event,...w?{selectable:!1,evented:!1,..."number"===Y?M:{}}:{}};if(T){const e=T.get("y2");p=o(I,{left:T.get("x2"),top:w?e-5:e,...R})}else i&&(R.leftLine=null,p=o(I,{left:i[0],top:w?i[1]-5:i[1],...R}));C.push(f),p&&(v.includes("脉搏")?ee.add(p):te.add(p),function(e){W.hovered&&(e.on("mouseover",(()=>{ae(e,"hover")})),e.on("mouseout",(()=>{P.show=!1})));if(e.lockMovementX&&e.lockMovementY)return;e.on("moving",(()=>{!function(e){e.setCoords();const t="pain"===e.origin.type?B:q;e.top<t.originY&&e.set("top",t.originY);e.top>t.endY&&e.set("top",t.endY)}(e),function(e){var t,n;null==(t=e.leftLine)||t.setCoords().set({x2:e.left,y2:e.top}),null==(n=e.rightLine)||n.setCoords().set({x1:e.left,y1:e.top}),Object.values(e.otherObj).forEach((t=>{const{obj:n,type:i="",top:o=0,isFixed:l}=t||{};"reduce"!==i&&("line"===i?null==n||n.setCoords().set({x1:e.left,y1:e.top}):!l&&(null==n||n.setCoords().set({left:e.left,top:e.top+o})))})),oe(e)}(e),W.hovered&&ae(e)})),e.on("mouseup",(t=>{if(P.show=!1,1===t.button){const{type:t}=e.origin,n=$(t,e.top),i={...e.origin,data:{...e.origin.data,value:n}};L.value.discardActiveObject(),S("change",i),pe(i,"change")}}))}(p),A.push(p),ne.add(p))}(R,u,b,T,X)})),"pulse"===c&&U.forEach((e=>{Z.set(e,A.filter((t=>{var n;return(null==(n=t.origin)?void 0:n.key)===e})).map((e=>[e.left,e.top])))})),Promise.all(A).then((e=>{const t=C.filter((e=>e));let n=null;e=e.map((e=>(e&&n&&(n.nextPoint=e,e.prevPoint=n),n=e||n,e))),Promise.all(I).then((n=>{L.value.add(...t,...e,...n),e.forEach((t=>{null==t||t.bringToFront(),function(e,t){if("pulse"===e.origin.type){t.filter((t=>t.left===e.left&&"pulse"===t.origin.type)).length>1&&(e.leftLine&&L.value.remove(e.leftLine),e.rightLine&&L.value.remove(e.rightLine))}}(t,e)}))}))}))}function se(e,t){return"pain"===e&&0==t}function ae(e,t="moving"){const{title:n,unit:i,type:o,data:l}=e.origin;P.point={x:e.left,y:e.top},P.list=[function(){const{drugReduce:r,physicsReduce:s}=l||{},a="hover"===t?l.value:$(o,e.top);if(p(r))return`药物降${"pain"==o?"痛":"温"} ${a}—>${r}${i||""}`;if(p(s))return`物理降${"pain"==o?"痛":"温"} ${a}—>${s}${i||""}`;return`${n} ${a}${i||""}`}(),`时间 ${((null==l?void 0:l.time)||M(e.left)).slice(-5)}`],P.show=!0}function ue(e,t){const n="pain"===t.type?B:q;if(f(e)&&function(e){const[t]=X,n=X.at(-1),i=t.start,o=n.end,l=h(e);return l>=i&&l<=o}(e.time)){const i=Y(e.time),o=E(t.type,t.list,e.value);return[i,o<n.originY?n.originY:o>n.endY?n.endY:o]}}function ce(e){const t=new Date,n=String(t.getMonth()+1).padStart(2,"0"),i=String(t.getDate()).padStart(2,"0"),o=h(`${t.getFullYear()}-${n}-${i} 23:59:59`),l=h(`${M(e)}:00`);return J&&l<h(J)?(I("exceedMin"),!1):!(l>o)||(I("exceedMax"),!1)}function pe(e,t="add"){const{type:n,dataIndex:i,index:o,data:l,key:r}=e,s=ie.find((e=>e.type===n));if("add"===t){const e=a(n)?s.dataList.find((e=>e.enable)):s.dataList[i],t=g(l.time,e.list);e.list.splice(t,0,l)}else s.dataList[i].list[o]=l;de()}function de(){var e;ne.size&&(null==(e=L.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}([...ne]))),Z.clear(),ne.clear(),ee.clear(),te.clear(),ie.forEach((e=>{e.dataList.forEach(((t,n)=>{a(e.type)&&!t.enable||re(t,n,e)}))})),oe(),le()}return Z.clear(),ee.clear(),te.clear(),ie.forEach((e=>{!function(e){if("temperature"!==e.type||!e.positionLine)return;const t=E(e.type,e.list,e.positionLine.value),i=n([D,t,V,t],e.positionLine);L.value.add(i)}(e),e.dataList.forEach(((t,n)=>{a(e.type)&&!t.enable||re(t,n,e)}))})),oe(),le(),k.event.evented&&L.value.on("mouse:up",(e=>{var t;if(3===e.button){const{x:n=0,y:i=0}=e.pointer||{};if(n>=D&&n<=V&&i>=_&&i<=G){A.point={x:n,y:i},A.show=!0;const{type:o}=(null==(t=e.target)?void 0:t.origin)||{};if(e.target&&["temperature","pain"].includes(o))"temperature"===o&&(A.list=[...x]),"pain"===o&&(A.list=[...b]),A.target=e.target;else{A.target=null,A.list=["新增节点"],H.forEach((t=>{if(!C([...ne],n,"_type").includes(t.bigType)){const n=["pain"].includes(t.bigType)?B:q;i>=n.originY&&i<=n.endY&&A.list.push({renderItem:O?O(t):()=>t.title,origin:{title:t.title,unit:t.unit,type:u(t.bigType),dataIndex:t.dataIndex,key:t.key},pointer:e.pointer})}}));const t=ce(n);t&&1!==A.list.length||(A.show=!1,1===A.list.length&&t&&I("repeat"))}}}})),{clickMenu:function({item:e,target:t}){if(t){const{data:n,type:i,dataIndex:o,index:l}=t.origin,r=v(n,[...x,...b]);r[`${e.type}`]=e.value,a(i)&&(r.key=t.origin.key);const s={...t.origin,data:r};S("change",s),pe(s,"change")}else{const t={data:{time:M(e.pointer.x),value:$(e.origin.type,e.pointer.y),...a(e.origin.type)?{key:e.origin.key}:{}},...e.origin};S("add",t),pe(t)}},setPopup:ae,isAddPoint:ce,updateData:pe,redrawPoints:de,gridPoints:ne}}function w(e){return"fixed"===e.position}export{L as useCenter};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{fabric as t}from"../../../../../shared/utils/fabricjs/index.js";import{drawLine as e,defaultTextStyle as i,defaultStyle as n,drawTextAndIconGroup as o,drawTextGroup as l}from"../useDraw.js";import"date-fns";import{getType as s,isOneLine as r}from"../../utils/index.js";import
|
|
1
|
+
import{fabric as t}from"../../../../../shared/utils/fabricjs/index.js";import{drawLine as e,defaultTextStyle as i,defaultStyle as n,drawTextAndIconGroup as o,drawTextGroup as l}from"../useDraw.js";import"date-fns";import{getType as s,isOneLine as r}from"../../utils/index.js";import{getScaleInfo as a,drawScaleNumber as h,drawScaleLine as u}from"../useScaleColumn.js";import{useCommon as c}from"../useCommon.js";import"vue";import"lodash-es";import"./useShadow.js";function g(g,p,d,f,y,m,v,w,S,Y,b,x){var j,X;const{getEqualXTypes:C,handleAddPrevent:N,isGridLimit:T}=c(g,d,p),{originY:V,endY:k,originX:L,endX:M,xCellWidth:W,yCellHeight:E,left:G,vitalSignsOriginY:O,painOriginY:A,painHeight:H,iconsWidth:I,itemList:R,painIndex:_,right:B,canvasWidth:J,canvasHeight:$,getRightInfo:q,borderStyle:D}=p;function P(o){var s;if(!(null==o?void 0:o.length))return;const{layout:r}=o[0];let c=I,p=L;"right"===r&&(c=M,p=M+(null!=(s=null==B?void 0:B.width)?s:0));const d=[],f=H&&"right"!==r?o.length-1:o.length,y=(p-c)/f,m=y+(p-c)%f;o.forEach(((o,s)=>{if("pain"===o.type)return void function(n){const{list:o=[],spaceGridNumber:s=5,showScale:r,showNumber:u,position:c,showMaxMinNumber:p,style:d,title:f}=n,y=l({width:L-I,height:H,...D},{value:`${f}`,...i,...d||{}},{left:I,top:A.originY}),m=e([I,A.originY,L,A.originY],D),v=[];if(r||u){const{lineXMain:e,textLeft:i}=a(c,I,L-I),l=o.length;o.forEach(((o,a)=>{let c=A.endY-a*E*s;if(0===a&&(c=k-5),!u||(0===a||a===l-1)&&!p||v.push(h(o,n,i,c)),r&&0!==a){const[i,n]=e,o=new t.Line([i,c,n,c],{...D,...d});v.push(o)}}))}g.value.add(m,y,...v),y.sendToBack()}(o);const p=[],f=0===s?m:y,v=0===s?c:m+c+(s-1)*y,w="right"===r?0:O.originY,S="right"===r?$:O.endY,Y=s>0?e([v,w,v,S],{objectCaching:!1,...D}):null;Y&&p.push(Y);const b=v+f/2,{list:x=[],spaceGridNumber:j=5,showScale:X,showNumber:C,position:N,showMaxMinNumber:T}=o;if(X||C){const{lineXMain:t,lineXSub:e,textLeft:i}=a(N,v,f),n=x.length;x.forEach(((l,s)=>{const r=O.endY-s*E*j;if(C&&(!(0===s||s===n-1)||T)){const t=0==s?r-5:r,e=h(l,o,i,t),n=O.originY+e.height/2;t<n&&e.set({top:n}),p.push(e)}p.push(...u(o,s,t,e,r,E,O.originY))}))}let V=o.title||"";o.unit&&(V+="\n"+o.unit),V&&p.push(new t.Text(String(V),{...i,left:b,top:O.originY+E*j/2,textAlign:"center",...o.style}));const M=new t.Group(p,{...n,objectCaching:!1});d.push(M)}));const v=d.length>0?new t.Group([...d],{...n,objectCaching:!1}):null;v&&g.value.add(v),v&&v.sendToBack()}I&&function(){const t=JSON.parse(JSON.stringify(R));let e=k;const i=I-G.icons.marginRight;t.reverse().forEach((t=>{e-=10;let n=t.title.replace(/(.{2})/g,"$1\n");n.endsWith("\n")&&(n=n.slice(0,n.length-1));const{text:l,icon:a}=o(n,t,{text:{left:i-(t.pointAttr.width||10)-5,top:e,originX:"right"},icon:{originX:"right",left:i,topY:e,origin:{type:s(t.bigType),_type:t.bigType},...p.event}});var h;e-=l.height||30,(h=a).on("moving",(()=>{h.set("originX","center"),function(t){if(t.left>=L&&t.left<=M){t.setCoords();const e="pain"===t.origin.type?A:O;t.top<e.originY&&t.set("top",e.originY),t.top>e.endY&&t.set("top",e.endY)}}(h),T(h)?f(h):y.show=!1})),h.on("mouseup:before",(t=>{if(y.show=!1,0===t.e.button&&T(h)){const t=C([...x],h.left,"_type").includes(h.origin._type),e=Y(h.left);if(!e||t)t&&e&&N("repeat");else{const t={data:{time:w(h.left),value:S(h.origin.type,h.top),...r(h.origin.type)?{key:h.origin.key}:{}},...h.origin};d("add",t),b(t)}}!function(t){t.setCoords().set({originX:"right",left:t.originLeft,top:t.originTop})}(h)})),g.value.add(l,a)}))}();const z=G.yScaleValue.filter((t=>"left"===t.layout&&"pain"!==t.type&&t.show));if((null==B?void 0:B.width)&&"left"===(null==(j=null==B?void 0:B.yScaleValue)?void 0:j.layout)&&(null==(X=null==B?void 0:B.yScaleValue)?void 0:X.show)&&z.push(q),_>0&&G.yScaleValue[_].show){const t=G.yScaleValue[_];0===_&&G.yScaleValue.length>1&&z.unshift(t),_==G.yScaleValue.length-1&&z.push(t)}const F=z.findIndex((t=>"pulse"===t.type&&t.show&&t.doubleShow)),K=z[F];return F>-1&&z.splice(F,0,{...K,title:(null==K?void 0:K.doubleTitle)||(null==K?void 0:K.title)}),P(z),g.value.add(new t.Rect({left:I,top:0,width:J-I-D.strokeWidth,height:$-D.strokeWidth,fill:"transparent",...D})),{drawScaleValue:P}}export{g as useLeft};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{fabric as t}from"../../../../../shared/utils/fabricjs/index.js";import{defaultStyle as e}from"../useDraw.js";import"date-fns";import"lodash-es";import"
|
|
1
|
+
import{fabric as t}from"../../../../../shared/utils/fabricjs/index.js";import{defaultStyle as e}from"../useDraw.js";import"date-fns";import"lodash-es";import"vue";import"./useShadow.js";function i(i,n,o){const{other:l,vitalSignsOriginY:r,xCellWidth:s,yCellHeight:a,endX:c}=n;let h=0;function u(i,n,o){const l=[];String(i.value).split("").forEach(((n,o)=>{const r=new t.Text(n,{left:0,top:a*o,originX:"center",...e,objectCaching:!1,...i.style||{}});h=(a-(r.height||0))/2,l.push(r)}));const r={originX:"center",left:n,top:o+h,baseTop:(i.baseTop||0)*a,trueLeft:n,trueHeight:l.length*a,objectCaching:!1};return new t.Group(l,r)}!function(){if(!(null==l?void 0:l.list))return!1;const n=[],h=[];l.list.forEach(((t,e)=>{const i=0===e?"vertical":t.align||"vertical",n=o(t.time,!0);if(n>c)return;const l=h.find((t=>t.left==n));if(l)l[i].push(t);else{const e={left:n,vertical:[],horizontal:[]};e[i].push(t),h.push(e)}})),h.forEach((t=>{let e=r.originY,i=t.left;t.vertical.forEach(((o,l)=>{var c,h;const f=(o.baseTop||0)*a,g=(null==(c=n.at(-1))?void 0:c.left)||0;0===l&&t.left<=g&&(i=g+s);if(n.filter((t=>t.trueLeft===i)).length){const t=String(o.value).length*a,l=(null==(h=n.at(-1))?void 0:h.trueHeight)||0;e+=l,e+t+f>r.endY&&(e=r.originY,i+=s)}e+=f,String(o.value).length&&n.push(u(o,i,e))})),t.horizontal.forEach(((e,o)=>{var l;const c=r.originY+(e.baseTop||0)*a,h=(null==(l=n.at(-1))?void 0:l.left)||0;t.left<=h&&(i=h+s),String(e.value).length&&n.push(u(e,i,c))}))}));const f=n.length>0?new t.Group([...n],{...e,objectCaching:!1}):null;f&&i.value.add(f)}()}export{i as useOther};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{ref as e,computed as t,reactive as a,onMounted as l,nextTick as u}from"vue";import{defaultBorderStyle as i}from"../useDraw.js";import"../../../../../shared/utils/fabricjs/index.js";import{useCumputedPoint as r}from"../useCumputedPoint.js";import{
|
|
1
|
+
import{ref as e,computed as t,reactive as a,onMounted as l,nextTick as u}from"vue";import{defaultBorderStyle as i}from"../useDraw.js";import"../../../../../shared/utils/fabricjs/index.js";import{useCumputedPoint as r}from"../useCumputedPoint.js";import{useCanvasEvent as n}from"../useEvent.js";import{setOtherType as o,getFloorNumber as s}from"../../utils/index.js";import"lodash-es";import{format as d,addDays as v}from"date-fns";import{useTop as c}from"./useTop.js";import{useLeft as h}from"./useLeft.js";import{useRight as p}from"./useRight.js";import{useCenter as g}from"./useCenter.js";import{useBottom as m}from"./useBottom.js";import{useOther as f}from"./useOther.js";function y(y,Y,S,b,w,C){const x=15,D=e(),j=e(),V=e(),X=t((()=>{const{top:e}=Y.data;return e.date.show&&(e.date.height||x)||0})),H=t((()=>{var e;const{top:t}=Y.data;return(null==(e=t.hospitalDays)?void 0:e.show)&&(t.hospitalDays.height||x)||0})),L=t((()=>{var e;const{top:t}=Y.data;return(null==(e=t.operationDays)?void 0:e.show)&&(t.operationDays.height||x)||0})),I=t((()=>{var e,t,a;const{top:l}=Y.data;return((null==(e=l.xScalevalue)?void 0:e.show)&&(l.xScalevalue.height||x)||0)+((null==(t=l.xScalevalue)?void 0:t.show)&&null!=(a=l.dayHeight)?a:0)})),M=t((()=>{var e;const{bottom:t}=Y.data;return(null==(e=null==t?void 0:t.breathing)?void 0:e.show)&&(t.breathing.height||30)||0})),P=t((()=>{const{grid:e}=Y.data;return e.mainXCell*e.subXCell+e.surplusXCell})),N=t((()=>{const{grid:e}=Y.data;return e.mainYCell*e.subYCell+e.surplusYCell})),O=t((()=>{var e;const{width:t,right:a=null,top:l}=Y.data;if(!a)return t;return t-(null!=(e=a.width)?e:0)})),W=t((()=>{const{grid:e}=Y.data;return O.value-e.surplusXCell*q.value})),$=t((()=>{const{top:e,left:t}=Y.data;return e.titleWidth+T.value})),k=t((()=>{const{bottom:e=null,height:t}=Y.data;if(!e)return t;return t-(e.height||30)})),G=t((()=>{var e;const{top:t}=Y.data,a=t.xScalevalue.show&&(null!=(e=t.dayHeight)?e:0)||0,l=t.xScalevalue.show&&(t.xScalevalue.height||x)||0;return X.value+a+l+H.value+L.value})),R=t((()=>{const{grid:e}=Y.data;return G.value+e.surplusYCell*z.value})),q=t((()=>(O.value-$.value)/P.value)),z=t((()=>(k.value-G.value)/N.value)),T=t((()=>{var e,t;const{left:a}=Y.data;return(null==(e=a.icons)?void 0:e.show)&&((null==(t=a.icons)?void 0:t.width)||100)||0})),A=t((()=>{var e,t;const{top:a,grid:l}=Y.data,u=(null==(t=null==(e=a.date.list)?void 0:e.slice)?void 0:t.call(e,0,l.mainXCell))||[],i=a.xScalevalue.times;let r=$.value-q.value;const n=a.date.startDate||d(new Date,"yyyy-MM-dd");return u.reduce(((e,t,a)=>0===a?e.concat(n):e.concat(d(v(new Date(n.replace(/-/g,"/")),a),"yyyy-MM-dd"))),[]).map((e=>i.map((t=>{r+=q.value;const a=Date.parse(`${e} ${t.start}`),l=Date.parse(`${e} ${t.end}`);return{start:a,end:l,left:r,center:r+q.value/2,scaleCell:(l-a)/q.value}})))).flat()})),B=t((()=>ue("breathe"))),E=t((()=>ue("pulse"))),F=t((()=>ue("temperature"))),J=t((()=>ue("pain"))),K=t((()=>{var e;return(null==(e=Y.data.grid)?void 0:e.event)||{selectable:!0,evented:!0,hovered:!0}})),Q=t((()=>{const{left:e}=Y.data;return e.yScaleValue.map((e=>e.dataList.filter((e=>e.show)).map(((t,a)=>({...t,bigType:o(t.title,e.type),unit:e.unit,dataIndex:a}))))).flat()})),U=t((()=>{const{left:e}=Y.data;return e.yScaleValue.findIndex((e=>"pain"===e.type))})),Z=t((()=>{const{grid:e}=Y.data;return-1===U.value?0:z.value*e.subYCell})),_=t((()=>{const{left:e}=Y.data,t={originY:k.value,endY:k.value};return 0===U.value&&e.yScaleValue.length>1?(t.originY=R.value,t.endY=R.value+Z.value):U.value===e.yScaleValue.length-1&&(t.originY=k.value-Z.value,t.endY=k.value),t})),ee=t((()=>{const{left:e}=Y.data,t={originY:G.value,endY:k.value};return 0===U.value&&e.yScaleValue.length>1?(t.originY=R.value+Z.value,t.endY=k.value):U.value===e.yScaleValue.length-1&&(t.originY=R.value,t.endY=k.value-Z.value),t})),te=t((()=>{var e,t;const{top:a,grid:l}=Y.data,u=[];for(const i in a)a[i].show&&u.push({...a[i],list:(null==(t=null==(e=a[i].list)?void 0:e.slice)?void 0:t.call(e,0,l.mainXCell))||[],key:i});return u.sort(((e,t)=>e.seq-t.seq))})),ae=t((()=>{var e;const{left:t,right:a}=Y.data,l=t.yScaleValue.find((e=>"temperature"===e.type)),u=(null==a?void 0:a.yScaleValue)||{};return(null==(e=null==l?void 0:l.list)?void 0:e.length)&&Object.assign(u,{list:l.list.map((e=>s(1.8*e+32))),spaceGridNumber:l.spaceGridNumber}),u})),le=a({canvasWidth:Y.data.width,canvasHeight:Y.data.height,borderStyle:{...i,...Y.data.borderStyle||{}},selectionStyle:Y.data.selectionStyle||{},dateHeight:X.value,hospitalDaysHeight:H.value,operationDaysHeight:L.value,xScalevalueHeight:I.value,topList:te.value,breathingHeight:M.value,hospitalizationDate:Y.data.hospitalizationDate,grid:Y.data.grid,top:Y.data.top,left:Y.data.left,right:Y.data.right,bottom:Y.data.bottom,other:Y.data.other,painIndex:U.value,painHeight:Z.value,painOriginY:_.value,vitalSignsOriginY:ee.value,gridXNumber:P.value,gridYNumber:N.value,iconsWidth:T.value,originX:$.value,originY:G.value,originYLimit:R.value,endX:O.value,endXLimit:W.value,endY:k.value,xCellWidth:q.value,yCellHeight:z.value,xScaleList:A.value,breatheYCell:B.value,pulseYCell:E.value,temperatureYCell:F.value,painYCell:J.value,event:K.value,itemList:Q.value,getRightInfo:ae.value,config:Y.data.config||{}});function ue(e){const{yScaleValue:t}=Y.data.left,a=t.find((t=>t.type===e)),l=(null==a?void 0:a.list)||[];return l.length?z.value/((l[1]-l[0])/a.spaceGridNumber):0}const{cumputedX:ie,cumputedY:re,getXValue:ne,getYValue:oe}=r(le);return l((()=>{u((()=>{c(y,le);const{setPopup:e,isAddPoint:t,updateData:a,redrawPoints:l,clickMenu:u,gridPoints:i}=g(y,le,S,ie,re,ne,oe,Y.addRenderItem,w,C);j.value=l,V.value=u;const{drawScaleValue:r}=h(y,le,S,e,w,ie,re,ne,oe,t,a,i);p(y,le,r),m(y,le),f(y,le,ie);const{select:o}=n(y,le,S);D.value=o}))})),{propItems:le,redrawPoints:j,select:D,clickMenu:V}}export{y as useTemperatureChart};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{fabric as t}from"../../../../../shared/utils/fabricjs/index.js";import{drawLine as e,defaultStyle as l,drawTextGroup as s,defaultTextStyle as i}from"../useDraw.js";import"date-fns";import"lodash-es";import"
|
|
1
|
+
import{fabric as t}from"../../../../../shared/utils/fabricjs/index.js";import{drawLine as e,defaultStyle as l,drawTextGroup as s,defaultTextStyle as i}from"../useDraw.js";import"date-fns";import"lodash-es";import"vue";import"./useShadow.js";function o(o,u){const{grid:h,originX:n,endX:a,xCellWidth:c,gridXNumber:r,top:p,xScalevalueHeight:d,iconsWidth:f,topList:g,endXLimit:v,canvasWidth:y,borderStyle:m}=u;!function(){const S=[];v&&S.push(new t.Line([v,0,y,0],m));let w=0;g.forEach(((t,l)=>{if(l>0&&(w+=u[`${g[l-1].key}Height`]),"xScalevalue"==t.key)!function(t,l,o){const u=p.dayHeight;if(!u)return;l.push(e([n,o+u,a,o+u],m));const d=c*h.subSecondXCell,f=(r-h.surplusXCell)/h.subSecondXCell;for(let h=0;h<f;h++){const a=n+h*d,c=h%2==0?"上午":"下午",r=s({width:d,height:u,...m},{value:c,...i,...t.style||{}},{left:a,top:o});l.push(r),l.push(e([a+d,o,a+d,o+u],m))}}(t,S,w),function(t,l,o){var u;const r=p.xScalevalue.show&&null!=(u=p.dayHeight)?u:0,g=d-r;if(!g)return;l.push(e([f,o+d,a,o+d],m));const v=s({width:n-f,height:d,...m},{value:p.xScalevalue.title,...i,...t.style||{},...t.titleStyle||{}},{left:f,top:o});l.push(v),l.push(e([n,o,n,o+d],m));const y=[];for(let t=0;t<h.mainXCell;t++)y.push(p.xScalevalue.list);y.flat().forEach(((u,h)=>{const a=n+h*c,p=s({width:c,height:g,...m},{value:u.value,...i,...t.style||{},...u.style||{}},{left:a,top:o+r});l.push(p),l.push(e([a+c,o+r,a+c,o+r+g],m))}))}(t,S,w);else{if(!u[`${t.key}Height`])return;const o=u[`${g[l].key}Height`];!function(t,l,o){const a=u[`${t.key}Height`],r=s({width:n-f,height:a,...m},{value:t.title,...i,...(null==t?void 0:t.style)||{},...t.titleStyle||{}},{left:f,top:o});l.push(r);const p=c*h.subXCell;t.list.forEach(((u,h)=>{const c=n+h*p,r=s({width:p,height:a,...m},{value:u,...i,...(null==t?void 0:t.style)||{}},{left:c,top:o});l.push(e([c+p,o,c+p,o+a],m)),l.push(r)}))}(t,S,w),S.push(e([f,w+o,a,w+o],m)),S.push(e([n,w,n,w+o],m))}}));const X=S.length>0?new t.Group([...S],{...l,objectCaching:!1}):null;X&&X.sendToBack(),X&&o.value.add(X)}()}export{o as useTop};
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { Ref } from 'vue';
|
|
2
2
|
import { fabric } from '../../../../../es/shared/utils/fabricjs';
|
|
3
3
|
import { IPropItems } from '../interface';
|
|
4
|
-
export declare function useEvent(element: HTMLCanvasElement | null): void;
|
|
5
4
|
export declare function useCanvasEvent(canvas: Ref<fabric.Canvas>, propItems: IPropItems, emits: any): {
|
|
6
5
|
select: (key: string) => void;
|
|
7
6
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{fabric as t}from"../../../../shared/utils/fabricjs/index.js";function e(e,n,o){const{originY:l,originX:i,endX:s,endY:d,iconsWidth:r,selectionStyle:h,topList:u}=n;function c(n,o){const{left:l,top:i,width:s,height:d}=n,r=new t.Rect({key:o,left:null!=l?l:0,top:null!=i?i:0,width:s,height:d,stroke:"transparent",fill:"transparent",lockMovementX:!0,lockMovementY:!0,transparentCorners:!1,hasControls:!1,...h,strokeWidth:0});return e.value.add(r),r}let f=[];function a(t){k();p(null==f?void 0:f.find((e=>e.key===t)))}function k(){f.forEach((t=>{t.set("strokeWidth",0),t.key.endsWith("All")&&t.sendToBack()}))}function p(t){var n;e.value.discardActiveObject(),!(null==t?void 0:t.key.includes("grid"))&&(null==t||t.bringToFront()),null==t||t.set("strokeWidth",null!=(n=h.strokeWidth)?n:2)}return("boolean"!=typeof(null==h?void 0:h.evented)||(null==h?void 0:h.evented))&&(f=function(){const t=[];t.push(c({left:r,top:l+1,width:i-r,height:d-l-3},"left"));let e=0;return u.forEach(((o,l)=>{l>0&&(e+=n[`${u[l-1].key}Height`]);const d={top:e+1,height:n[`${o.key}Height`]-1};t.push(c({left:r,width:s-r,...d},o.key+"All")),t.push(c({left:r,width:i-r,...d},o.key+"Title")),t.push(c({left:i,width:s-i,...d},o.key))})),t.push(c({left:i,top:l+1,width:s-i,height:d-l-3},"grid")),t.forEach((t=>{t.key.endsWith("All")?(t.sendToBack(),t.on("mouseup",(e=>{const{button:n,pointer:l}=e;if(1==n){const e=t.key.replace("All",""),n=(null==l?void 0:l.x)&&(null==l?void 0:l.x)<=i?e+"Title":e;t.sendToBack(),a(n),o("select",n)}}))):t.on("mousedown",(()=>{k(),p(t),o("select",t.key)}))})),t}()),{select:a}}export{e as useCanvasEvent};
|
|
@@ -44,6 +44,10 @@ declare const FieldSet: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
44
44
|
type: import("vue").PropType<import("./src/types").FieldSetColumnItem[]>;
|
|
45
45
|
default: () => never[];
|
|
46
46
|
};
|
|
47
|
+
showSeq: {
|
|
48
|
+
type: BooleanConstructor;
|
|
49
|
+
default: boolean;
|
|
50
|
+
};
|
|
47
51
|
}, {
|
|
48
52
|
fieldsMapping: Record<string, string>;
|
|
49
53
|
props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
|
|
@@ -90,6 +94,10 @@ declare const FieldSet: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
90
94
|
type: import("vue").PropType<import("./src/types").FieldSetColumnItem[]>;
|
|
91
95
|
default: () => never[];
|
|
92
96
|
};
|
|
97
|
+
showSeq: {
|
|
98
|
+
type: BooleanConstructor;
|
|
99
|
+
default: boolean;
|
|
100
|
+
};
|
|
93
101
|
}>> & {
|
|
94
102
|
onReset?: ((...args: any[]) => any) | undefined;
|
|
95
103
|
onClose?: ((...args: any[]) => any) | undefined;
|
|
@@ -222,6 +230,10 @@ declare const FieldSet: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
222
230
|
}>[]>;
|
|
223
231
|
default: () => never[];
|
|
224
232
|
};
|
|
233
|
+
idx: {
|
|
234
|
+
type: NumberConstructor;
|
|
235
|
+
default: number;
|
|
236
|
+
};
|
|
225
237
|
}, {
|
|
226
238
|
fixedWayOptions: {
|
|
227
239
|
label: string;
|
|
@@ -257,6 +269,10 @@ declare const FieldSet: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
257
269
|
}>[]>;
|
|
258
270
|
default: () => never[];
|
|
259
271
|
};
|
|
272
|
+
idx: {
|
|
273
|
+
type: NumberConstructor;
|
|
274
|
+
default: number;
|
|
275
|
+
};
|
|
260
276
|
}>> & {
|
|
261
277
|
onUpdateChecked?: ((...args: any[]) => any) | undefined;
|
|
262
278
|
}>>;
|
|
@@ -301,6 +317,10 @@ declare const FieldSet: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
301
317
|
}>[]>;
|
|
302
318
|
default: () => never[];
|
|
303
319
|
};
|
|
320
|
+
idx: {
|
|
321
|
+
type: NumberConstructor;
|
|
322
|
+
default: number;
|
|
323
|
+
};
|
|
304
324
|
}>> & {
|
|
305
325
|
onUpdateChecked?: ((...args: any[]) => any) | undefined;
|
|
306
326
|
}, {
|
|
@@ -323,6 +343,7 @@ declare const FieldSet: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
323
343
|
hide: boolean;
|
|
324
344
|
}>[];
|
|
325
345
|
element: import("../../../es/shared/types").AnyObject;
|
|
346
|
+
idx: number;
|
|
326
347
|
}>;
|
|
327
348
|
isArray: {
|
|
328
349
|
(value?: any): value is any[];
|
|
@@ -373,12 +394,17 @@ declare const FieldSet: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
373
394
|
type: import("vue").PropType<import("./src/types").FieldSetColumnItem[]>;
|
|
374
395
|
default: () => never[];
|
|
375
396
|
};
|
|
397
|
+
showSeq: {
|
|
398
|
+
type: BooleanConstructor;
|
|
399
|
+
default: boolean;
|
|
400
|
+
};
|
|
376
401
|
}>> & {
|
|
377
402
|
onReset?: ((...args: any[]) => any) | undefined;
|
|
378
403
|
onClose?: ((...args: any[]) => any) | undefined;
|
|
379
404
|
onSave?: ((...args: any[]) => any) | undefined;
|
|
380
405
|
}, {
|
|
381
406
|
type: string;
|
|
407
|
+
showSeq: boolean;
|
|
382
408
|
fields: Partial<{
|
|
383
409
|
[key: string]: any;
|
|
384
410
|
id: string;
|
|
@@ -46,6 +46,10 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
46
46
|
type: PropType<FieldSetColumnItem[]>;
|
|
47
47
|
default: () => never[];
|
|
48
48
|
};
|
|
49
|
+
showSeq: {
|
|
50
|
+
type: BooleanConstructor;
|
|
51
|
+
default: boolean;
|
|
52
|
+
};
|
|
49
53
|
}, {
|
|
50
54
|
fieldsMapping: Record<string, string>;
|
|
51
55
|
props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
|
|
@@ -92,6 +96,10 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
92
96
|
type: PropType<FieldSetColumnItem[]>;
|
|
93
97
|
default: () => never[];
|
|
94
98
|
};
|
|
99
|
+
showSeq: {
|
|
100
|
+
type: BooleanConstructor;
|
|
101
|
+
default: boolean;
|
|
102
|
+
};
|
|
95
103
|
}>> & {
|
|
96
104
|
onReset?: ((...args: any[]) => any) | undefined;
|
|
97
105
|
onClose?: ((...args: any[]) => any) | undefined;
|
|
@@ -224,6 +232,10 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
224
232
|
}>[]>;
|
|
225
233
|
default: () => never[];
|
|
226
234
|
};
|
|
235
|
+
idx: {
|
|
236
|
+
type: NumberConstructor;
|
|
237
|
+
default: number;
|
|
238
|
+
};
|
|
227
239
|
}, {
|
|
228
240
|
fixedWayOptions: {
|
|
229
241
|
label: string;
|
|
@@ -259,6 +271,10 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
259
271
|
}>[]>;
|
|
260
272
|
default: () => never[];
|
|
261
273
|
};
|
|
274
|
+
idx: {
|
|
275
|
+
type: NumberConstructor;
|
|
276
|
+
default: number;
|
|
277
|
+
};
|
|
262
278
|
}>> & {
|
|
263
279
|
onUpdateChecked?: ((...args: any[]) => any) | undefined;
|
|
264
280
|
}>>;
|
|
@@ -303,6 +319,10 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
303
319
|
}>[]>;
|
|
304
320
|
default: () => never[];
|
|
305
321
|
};
|
|
322
|
+
idx: {
|
|
323
|
+
type: NumberConstructor;
|
|
324
|
+
default: number;
|
|
325
|
+
};
|
|
306
326
|
}>> & {
|
|
307
327
|
onUpdateChecked?: ((...args: any[]) => any) | undefined;
|
|
308
328
|
}, {
|
|
@@ -325,6 +345,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
325
345
|
hide: boolean;
|
|
326
346
|
}>[];
|
|
327
347
|
element: AnyObject;
|
|
348
|
+
idx: number;
|
|
328
349
|
}>;
|
|
329
350
|
isArray: {
|
|
330
351
|
(value?: any): value is any[];
|
|
@@ -375,12 +396,17 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
375
396
|
type: PropType<FieldSetColumnItem[]>;
|
|
376
397
|
default: () => never[];
|
|
377
398
|
};
|
|
399
|
+
showSeq: {
|
|
400
|
+
type: BooleanConstructor;
|
|
401
|
+
default: boolean;
|
|
402
|
+
};
|
|
378
403
|
}>> & {
|
|
379
404
|
onReset?: ((...args: any[]) => any) | undefined;
|
|
380
405
|
onClose?: ((...args: any[]) => any) | undefined;
|
|
381
406
|
onSave?: ((...args: any[]) => any) | undefined;
|
|
382
407
|
}, {
|
|
383
408
|
type: string;
|
|
409
|
+
showSeq: boolean;
|
|
384
410
|
fields: Partial<{
|
|
385
411
|
[key: string]: any;
|
|
386
412
|
id: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{defineComponent as e,ref as l,computed as t,watch as i,openBlock as d,createElementBlock as o,createElementVNode as a,Fragment as s,renderList as c,normalizeStyle as n,unref as
|
|
1
|
+
import{defineComponent as e,ref as l,computed as t,watch as i,openBlock as d,createElementBlock as o,createElementVNode as a,Fragment as s,renderList as c,normalizeStyle as n,unref as u,createBlock as r,withCtx as f,createTextVNode as m,toDisplayString as h,createCommentVNode as p,createVNode as y,renderSlot as v}from"vue";import{NCheckbox as b,NPopconfirm as k,NButton as x}from"naive-ui";import g from"../../../shared/components/VueDraggable/src/vuedraggable.js";import A from"./components/Row.vue.js";import{isArray as w,cloneDeep as _}from"lodash-es";import{setStyle as S,getGroupTree as C,isDisable as W}from"./utils/index.js";import{isString as E}from"xe-utils";const q={class:"c-field-set"},F={class:"c-field-set__table-header"},N={class:"c-field-set__table-body"},R=["tabindex"],j={key:0,class:"c-field-set__table-footer"};var U=e({__name:"FieldSet",props:{fields:{type:Array,default:()=>[]},footerFlag:{type:Boolean,default:!0},type:{type:String,default:"old"},isEdit:{type:Boolean,default:!1},showColumnNames:{type:Array},groupSetting:{type:Object},customColumns:{type:Array,default:()=>[]},showSeq:{type:Boolean,default:!1}},emits:["save","close","reset"],setup(e,{expose:U,emit:D}){const V=e,B={sid:"id",columnName:"name",isShow:"show",isSort:"sort",isFixed:"fixedWay",colWidth:"columnWidth"},O=l([]),T=l([{title:"所有字段",type:"text",field:"title"},{title:"显示",type:"checkbox",checkedAll:!1,disabledAll:!1,field:"show"},{title:"编辑",type:"checkbox",checkedAll:!1,disabledAll:!1,field:"editable"},{title:"必填",type:"checkbox",checkedAll:!1,disabledAll:!1,field:"required"},{title:"排序",type:"checkbox",checkedAll:!1,disabledAll:!1,field:"sort"},{title:"加粗",type:"checkbox",checkedAll:!1,disabledAll:!1,field:"bold"},{title:"默认排序",type:"select",field:"sortDirection"},{title:"固定",type:"select",field:"fixedWay"},{title:"自定义标题",type:"input",field:"alias"},{title:"列宽",type:"inputNumber",field:"columnWidth"}]),P=t((()=>O.value.flat())),G=()=>{D("save",{tableFields:$()})},H=()=>{D("close")};function I(){O.value=L(),J(),D("reset")}function L(){const e=_(V.fields);return Object.keys(B).forEach((l=>{e.forEach((e=>{"old"==V.type&&Reflect.has(e,l)&&("isFixed"==l?e.fixedWay=1==e[l]?"LEFT":2==e[l]?"RIGHT":"NONE":["isShow","isSort"].includes(l)&&"boolean"!=typeof l?e[B[l]]=1==e[l]:e[B[l]]=e[l],Reflect.deleteProperty(e,l)),e.columnWidth=+e.columnWidth||null,Reflect.has(e,"alias")||(e.alias=""),Reflect.has(e,"bold")||(e.bold=!1)}))})),function(e){if(V.groupSetting){return C(V.groupSetting,e).reduce(((t,i)=>{const d=E(i)?e.find((e=>e.name===i)):l(i.children);return d&&t.push(d),t}),[])}return e;function l(t){const i=[];return t.forEach((t=>{if(t.children)i.push(...l(t.children));else{const l=e.find((e=>e.name===t));l&&i.push(l)}})),i}}(e)}const $=()=>"old"==V.type?P.value.map(((e,l)=>({id:e.id,field:e.name,visible:e.show,sequence:l,sortable:e.sort,title:e.alias,fixed:e.fixedWay,minWidth:e.columnWidth,bold:e.bold,sortDirection:e.sortDirection,...V.isEdit?{required:e.required,editable:e.editable}:{}}))):P.value;function z({checked:e,column:l}){const t=!e||K(l.field);l.checkedAll=!t}function J(){var e,l;(null==(e=V.showColumnNames)?void 0:e.length)&&(T.value=T.value.filter((e=>{var l,t;return"title"===e.field||(null==(t=null==(l=V.showColumnNames)?void 0:l.includes)?void 0:t.call(l,e.field))}))),(null==(l=V.customColumns)?void 0:l.length)&&T.value.push(...V.customColumns),V.showSeq&&T.value.splice(1,0,{title:"排序",type:"text",field:"seq"}),T.value.forEach((e=>{if(function(e){const l=["editable","required"].includes(e.field);return l&&V.isEdit||!l}(e)&&(e.isShow=!0),"checkbox"===e.type){const l=O.value.flat().every((l=>!Reflect.has(l,e.field)));e.checkedAll=!K(e.field)&&!l}}))}function K(e){return O.value.flat().some((l=>!W(l,e)&&!l[e]&&"0001"!=l.id))}return i([()=>V.fields,()=>{var e;return null==(e=V.showColumnNames)?void 0:e.length}],(([e,l])=>{e.length>0&&(O.value=L(),J())}),{immediate:!0,deep:!0}),U({getTableFields:$}),(l,t)=>(d(),o("div",q,[a("div",F,[(d(!0),o(s,null,c(T.value,((e,l)=>(d(),o(s,{key:l},[e.isShow?(d(),o("span",{key:0,class:"table-cell",style:n(u(S)(e))},["checkbox"===e.type?(d(),r(u(b),{key:0,checked:e.checkedAll,"onUpdate:checked":[l=>e.checkedAll=l,l=>{return t=l,i=e.field,void P.value.forEach((e=>{W(e,i)||(e[i]=t)}));var t,i}],disabled:e.disabledAll},{default:f((()=>[m(h(e.title),1)])),_:2},1032,["checked","onUpdate:checked","disabled"])):p("v-if",!0),m(" "+h("checkbox"!==e.type?e.title:""),1)],4)):p("v-if",!0)],64)))),128))]),a("div",N,[y(u(g),{modelValue:O.value,"onUpdate:modelValue":t[0]||(t[0]=e=>O.value=e),animation:"150","item-key":"id",draggable:".item"},{item:f((({element:e,index:l})=>[e.hide?p("v-if",!0):(d(),o("div",{key:0,class:"item",tabindex:l},[u(w)(e)?(d(!0),o(s,{key:0},c(e,((e,t)=>(d(),r(A,{key:t,element:e,columns:T.value,idx:l+1,onUpdateChecked:z},null,8,["element","columns","idx"])))),128)):(d(),r(A,{key:1,element:e,columns:T.value,idx:l+1,onUpdateChecked:z},null,8,["element","columns","idx"]))],8,R))])),_:1},8,["modelValue"])]),e.footerFlag?(d(),o("div",j,[p(" 底部按钮插槽 "),v(l.$slots,"footer",{},(()=>[y(u(k),{onPositiveClick:I},{trigger:f((()=>[y(u(x),{style:{"margin-right":"8px"}},{default:f((()=>[m("恢复默认设置")])),_:1})])),default:f((()=>[m(" 确认要恢复系统默认设置吗? ")])),_:1}),y(u(x),{style:{"margin-right":"8px"},onClick:H},{default:f((()=>[m("取消")])),_:1}),y(u(x),{type:"primary",onClick:G},{default:f((()=>[m("保存")])),_:1})]))])):p("v-if",!0)]))}});export{U as default};
|
|
@@ -27,6 +27,10 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
27
27
|
}>[]>;
|
|
28
28
|
default: () => never[];
|
|
29
29
|
};
|
|
30
|
+
idx: {
|
|
31
|
+
type: NumberConstructor;
|
|
32
|
+
default: number;
|
|
33
|
+
};
|
|
30
34
|
}, {
|
|
31
35
|
fixedWayOptions: {
|
|
32
36
|
label: string;
|
|
@@ -62,6 +66,10 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
62
66
|
}>[]>;
|
|
63
67
|
default: () => never[];
|
|
64
68
|
};
|
|
69
|
+
idx: {
|
|
70
|
+
type: NumberConstructor;
|
|
71
|
+
default: number;
|
|
72
|
+
};
|
|
65
73
|
}>> & {
|
|
66
74
|
onUpdateChecked?: ((...args: any[]) => any) | undefined;
|
|
67
75
|
}>>;
|
|
@@ -106,6 +114,10 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
106
114
|
}>[]>;
|
|
107
115
|
default: () => never[];
|
|
108
116
|
};
|
|
117
|
+
idx: {
|
|
118
|
+
type: NumberConstructor;
|
|
119
|
+
default: number;
|
|
120
|
+
};
|
|
109
121
|
}>> & {
|
|
110
122
|
onUpdateChecked?: ((...args: any[]) => any) | undefined;
|
|
111
123
|
}, {
|
|
@@ -128,5 +140,6 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
128
140
|
hide: boolean;
|
|
129
141
|
}>[];
|
|
130
142
|
element: AnyObject;
|
|
143
|
+
idx: number;
|
|
131
144
|
}>;
|
|
132
145
|
export default _default;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{defineComponent as e,openBlock as l,createElementBlock as t,Fragment as n,renderList as
|
|
1
|
+
import{defineComponent as e,openBlock as l,createElementBlock as t,Fragment as n,renderList as i,normalizeStyle as a,unref as d,createBlock as u,withCtx as o,createVNode as p,createCommentVNode as f,createTextVNode as m,toDisplayString as c,withDirectives as v,vShow as r,createElementVNode as s}from"vue";import{NTooltip as y,NIcon as k,NCheckbox as b,NSelect as h,NInput as x,NInputNumber as U}from"naive-ui";import{setStyle as g,isDisable as N}from"../utils/index.js";import{ReorderTwoOutline as C}from"@vicons/ionicons5";const E={class:"row"},w=["title"],O=s("span",null,"拖拽调整顺序",-1);var S=e({__name:"Row",props:{element:{type:Object,default:()=>({})},columns:{type:Array,default:()=>[]},idx:{type:Number,default:1}},emits:["updateChecked"],setup(e,{emit:s}){const S=[{label:"不固定",value:"NONE"},{label:"左固定",value:"LEFT"},{label:"右固定",value:"RIGHT"}],_=[{label:"不排序",value:"NONE"},{label:"升序",value:"ASC"},{label:"降序",value:"DESC"}];function j(e){return"fixedWay"===e.field?S:_}return(S,_)=>(l(),t("div",E,[(l(!0),t(n,null,i(e.columns,((i,E)=>(l(),t(n,{key:E},[i.isShow?(l(),t("span",{key:0,class:"table-cell",title:e.element[i.field],style:a(d(g)(i))},["text"===i.type?(l(),t(n,{key:0},[0===E?(l(),u(d(y),{key:0,trigger:"hover"},{trigger:o((()=>[p(d(k),{style:{"margin-right":"5px",top:"2px"},component:d(C)},null,8,["component"])])),default:o((()=>[O])),_:1})):f("v-if",!0),m(" "+c("seq"===i.field?e.idx:e.element[i.field]),1)],64)):f("v-if",!0),"checkbox"===i.type?v((l(),u(d(b),{key:1,disabled:d(N)(e.element,i.field),checked:e.element[i.field],"onUpdate:checked":[l=>e.element[i.field]=l,e=>function(e,l){s("updateChecked",{checked:e,column:l})}(e,i)]},null,8,["disabled","checked","onUpdate:checked"])),[[r,"0001"!=e.element.id]]):f("v-if",!0),"select"===i.type?v((l(),u(d(h),{key:2,value:e.element[i.field],"onUpdate:value":l=>e.element[i.field]=l,options:j(i)},null,8,["value","onUpdate:value","options"])),[[r,"fixedWay"===i.field||"0001"!=e.element.id]]):f("v-if",!0),"input"===i.type?v((l(),u(d(x),{key:3,value:e.element[i.field],"onUpdate:value":l=>e.element[i.field]=l,clearable:""},null,8,["value","onUpdate:value"])),[[r,"0001"!=e.element.id]]):f("v-if",!0),"inputNumber"===i.type?(l(),u(d(U),{key:4,value:e.element[i.field],"onUpdate:value":l=>e.element[i.field]=l},null,8,["value","onUpdate:value"])):f("v-if",!0)],12,w)):f("v-if",!0)],64)))),128))]))}});export{S as default};
|
|
@@ -202,6 +202,7 @@ declare const FormConfig: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
202
202
|
allow_check_mid_level?: "1" | "2" | "3" | "4" | undefined;
|
|
203
203
|
prefix?: string | import("../../../es/shared/types").AnyObject | (() => any) | undefined;
|
|
204
204
|
suffix?: string | import("../../../es/shared/types").AnyObject | (() => any) | undefined;
|
|
205
|
+
allowSlash?: boolean | undefined;
|
|
205
206
|
fieldType?: import("@formily/json-schema").SchemaTypes | undefined;
|
|
206
207
|
content?: string | import("..").FormRenderer | Record<string, import("..").FormRenderer> | undefined;
|
|
207
208
|
lazyRequest?: boolean | undefined;
|
|
@@ -1929,6 +1930,7 @@ declare const FormConfig: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
1929
1930
|
allow_check_mid_level?: "1" | "2" | "3" | "4" | undefined;
|
|
1930
1931
|
prefix?: string | import("../../../es/shared/types").AnyObject | (() => any) | undefined;
|
|
1931
1932
|
suffix?: string | import("../../../es/shared/types").AnyObject | (() => any) | undefined;
|
|
1933
|
+
allowSlash?: boolean | undefined;
|
|
1932
1934
|
fieldType?: import("@formily/json-schema").SchemaTypes | undefined;
|
|
1933
1935
|
content?: string | import("..").FormRenderer | Record<string, import("..").FormRenderer> | undefined;
|
|
1934
1936
|
lazyRequest?: boolean | undefined;
|
|
@@ -3665,6 +3667,7 @@ declare const FormConfig: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
3665
3667
|
allow_check_mid_level?: "1" | "2" | "3" | "4" | undefined;
|
|
3666
3668
|
prefix?: string | import("../../../es/shared/types").AnyObject | (() => any) | undefined;
|
|
3667
3669
|
suffix?: string | import("../../../es/shared/types").AnyObject | (() => any) | undefined;
|
|
3670
|
+
allowSlash?: boolean | undefined;
|
|
3668
3671
|
fieldType?: import("@formily/json-schema").SchemaTypes | undefined;
|
|
3669
3672
|
content?: string | import("..").FormRenderer | Record<string, import("..").FormRenderer> | undefined;
|
|
3670
3673
|
lazyRequest?: boolean | undefined;
|
|
@@ -5392,6 +5395,7 @@ declare const FormConfig: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
5392
5395
|
allow_check_mid_level?: "1" | "2" | "3" | "4" | undefined;
|
|
5393
5396
|
prefix?: string | import("../../../es/shared/types").AnyObject | (() => any) | undefined;
|
|
5394
5397
|
suffix?: string | import("../../../es/shared/types").AnyObject | (() => any) | undefined;
|
|
5398
|
+
allowSlash?: boolean | undefined;
|
|
5395
5399
|
fieldType?: import("@formily/json-schema").SchemaTypes | undefined;
|
|
5396
5400
|
content?: string | import("..").FormRenderer | Record<string, import("..").FormRenderer> | undefined;
|
|
5397
5401
|
lazyRequest?: boolean | undefined;
|
|
@@ -8095,6 +8099,7 @@ declare const FormConfig: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
8095
8099
|
allow_check_mid_level?: "1" | "2" | "3" | "4" | undefined;
|
|
8096
8100
|
prefix?: string | import("../../../es/shared/types").AnyObject | (() => any) | undefined;
|
|
8097
8101
|
suffix?: string | import("../../../es/shared/types").AnyObject | (() => any) | undefined;
|
|
8102
|
+
allowSlash?: boolean | undefined;
|
|
8098
8103
|
fieldType?: import("@formily/json-schema").SchemaTypes | undefined;
|
|
8099
8104
|
content?: string | import("..").FormRenderer | Record<string, import("..").FormRenderer> | undefined;
|
|
8100
8105
|
lazyRequest?: boolean | undefined;
|
|
@@ -9833,6 +9838,7 @@ declare const FormConfig: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
9833
9838
|
allow_check_mid_level?: "1" | "2" | "3" | "4" | undefined;
|
|
9834
9839
|
prefix?: string | import("../../../es/shared/types").AnyObject | (() => any) | undefined;
|
|
9835
9840
|
suffix?: string | import("../../../es/shared/types").AnyObject | (() => any) | undefined;
|
|
9841
|
+
allowSlash?: boolean | undefined;
|
|
9836
9842
|
fieldType?: import("@formily/json-schema").SchemaTypes | undefined;
|
|
9837
9843
|
content?: string | import("..").FormRenderer | Record<string, import("..").FormRenderer> | undefined;
|
|
9838
9844
|
lazyRequest?: boolean | undefined;
|
|
@@ -11544,6 +11550,7 @@ declare const FormConfig: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
11544
11550
|
allow_check_mid_level?: "1" | "2" | "3" | "4" | undefined;
|
|
11545
11551
|
prefix?: string | import("../../../es/shared/types").AnyObject | (() => any) | undefined;
|
|
11546
11552
|
suffix?: string | import("../../../es/shared/types").AnyObject | (() => any) | undefined;
|
|
11553
|
+
allowSlash?: boolean | undefined;
|
|
11547
11554
|
fieldType?: import("@formily/json-schema").SchemaTypes | undefined;
|
|
11548
11555
|
content?: string | import("..").FormRenderer | Record<string, import("..").FormRenderer> | undefined;
|
|
11549
11556
|
lazyRequest?: boolean | undefined;
|
|
@@ -204,6 +204,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
204
204
|
allow_check_mid_level?: "1" | "2" | "3" | "4" | undefined;
|
|
205
205
|
prefix?: string | import("../../../../es/shared/types").AnyObject | (() => any) | undefined;
|
|
206
206
|
suffix?: string | import("../../../../es/shared/types").AnyObject | (() => any) | undefined;
|
|
207
|
+
allowSlash?: boolean | undefined;
|
|
207
208
|
fieldType?: import("@formily/json-schema").SchemaTypes | undefined;
|
|
208
209
|
content?: string | import("../../../../es/components/form-render").FormRenderer | Record<string, import("../../../../es/components/form-render").FormRenderer> | undefined;
|
|
209
210
|
lazyRequest?: boolean | undefined;
|
|
@@ -1931,6 +1932,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
1931
1932
|
allow_check_mid_level?: "1" | "2" | "3" | "4" | undefined;
|
|
1932
1933
|
prefix?: string | import("../../../../es/shared/types").AnyObject | (() => any) | undefined;
|
|
1933
1934
|
suffix?: string | import("../../../../es/shared/types").AnyObject | (() => any) | undefined;
|
|
1935
|
+
allowSlash?: boolean | undefined;
|
|
1934
1936
|
fieldType?: import("@formily/json-schema").SchemaTypes | undefined;
|
|
1935
1937
|
content?: string | import("../../../../es/components/form-render").FormRenderer | Record<string, import("../../../../es/components/form-render").FormRenderer> | undefined;
|
|
1936
1938
|
lazyRequest?: boolean | undefined;
|
|
@@ -3667,6 +3669,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
3667
3669
|
allow_check_mid_level?: "1" | "2" | "3" | "4" | undefined;
|
|
3668
3670
|
prefix?: string | import("../../../../es/shared/types").AnyObject | (() => any) | undefined;
|
|
3669
3671
|
suffix?: string | import("../../../../es/shared/types").AnyObject | (() => any) | undefined;
|
|
3672
|
+
allowSlash?: boolean | undefined;
|
|
3670
3673
|
fieldType?: import("@formily/json-schema").SchemaTypes | undefined;
|
|
3671
3674
|
content?: string | import("../../../../es/components/form-render").FormRenderer | Record<string, import("../../../../es/components/form-render").FormRenderer> | undefined;
|
|
3672
3675
|
lazyRequest?: boolean | undefined;
|
|
@@ -5394,6 +5397,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
5394
5397
|
allow_check_mid_level?: "1" | "2" | "3" | "4" | undefined;
|
|
5395
5398
|
prefix?: string | import("../../../../es/shared/types").AnyObject | (() => any) | undefined;
|
|
5396
5399
|
suffix?: string | import("../../../../es/shared/types").AnyObject | (() => any) | undefined;
|
|
5400
|
+
allowSlash?: boolean | undefined;
|
|
5397
5401
|
fieldType?: import("@formily/json-schema").SchemaTypes | undefined;
|
|
5398
5402
|
content?: string | import("../../../../es/components/form-render").FormRenderer | Record<string, import("../../../../es/components/form-render").FormRenderer> | undefined;
|
|
5399
5403
|
lazyRequest?: boolean | undefined;
|
|
@@ -8097,6 +8101,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
8097
8101
|
allow_check_mid_level?: "1" | "2" | "3" | "4" | undefined;
|
|
8098
8102
|
prefix?: string | import("../../../../es/shared/types").AnyObject | (() => any) | undefined;
|
|
8099
8103
|
suffix?: string | import("../../../../es/shared/types").AnyObject | (() => any) | undefined;
|
|
8104
|
+
allowSlash?: boolean | undefined;
|
|
8100
8105
|
fieldType?: import("@formily/json-schema").SchemaTypes | undefined;
|
|
8101
8106
|
content?: string | import("../../../../es/components/form-render").FormRenderer | Record<string, import("../../../../es/components/form-render").FormRenderer> | undefined;
|
|
8102
8107
|
lazyRequest?: boolean | undefined;
|
|
@@ -9835,6 +9840,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
9835
9840
|
allow_check_mid_level?: "1" | "2" | "3" | "4" | undefined;
|
|
9836
9841
|
prefix?: string | import("../../../../es/shared/types").AnyObject | (() => any) | undefined;
|
|
9837
9842
|
suffix?: string | import("../../../../es/shared/types").AnyObject | (() => any) | undefined;
|
|
9843
|
+
allowSlash?: boolean | undefined;
|
|
9838
9844
|
fieldType?: import("@formily/json-schema").SchemaTypes | undefined;
|
|
9839
9845
|
content?: string | import("../../../../es/components/form-render").FormRenderer | Record<string, import("../../../../es/components/form-render").FormRenderer> | undefined;
|
|
9840
9846
|
lazyRequest?: boolean | undefined;
|
|
@@ -11546,6 +11552,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
11546
11552
|
allow_check_mid_level?: "1" | "2" | "3" | "4" | undefined;
|
|
11547
11553
|
prefix?: string | import("../../../../es/shared/types").AnyObject | (() => any) | undefined;
|
|
11548
11554
|
suffix?: string | import("../../../../es/shared/types").AnyObject | (() => any) | undefined;
|
|
11555
|
+
allowSlash?: boolean | undefined;
|
|
11549
11556
|
fieldType?: import("@formily/json-schema").SchemaTypes | undefined;
|
|
11550
11557
|
content?: string | import("../../../../es/components/form-render").FormRenderer | Record<string, import("../../../../es/components/form-render").FormRenderer> | undefined;
|
|
11551
11558
|
lazyRequest?: boolean | undefined;
|
|
@@ -157,6 +157,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
157
157
|
allow_check_mid_level?: "1" | "2" | "3" | "4" | undefined;
|
|
158
158
|
prefix?: string | import("../../../../../es/shared/types").AnyObject | (() => any) | undefined;
|
|
159
159
|
suffix?: string | import("../../../../../es/shared/types").AnyObject | (() => any) | undefined;
|
|
160
|
+
allowSlash?: boolean | undefined;
|
|
160
161
|
fieldType?: import("@formily/json-schema").SchemaTypes | undefined;
|
|
161
162
|
content?: string | import("../../../../../es/components/form-render").FormRenderer | Record<string, import("../../../../../es/components/form-render").FormRenderer> | undefined;
|
|
162
163
|
lazyRequest?: boolean | undefined;
|
|
@@ -1895,6 +1896,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
1895
1896
|
allow_check_mid_level?: "1" | "2" | "3" | "4" | undefined;
|
|
1896
1897
|
prefix?: string | import("../../../../../es/shared/types").AnyObject | (() => any) | undefined;
|
|
1897
1898
|
suffix?: string | import("../../../../../es/shared/types").AnyObject | (() => any) | undefined;
|
|
1899
|
+
allowSlash?: boolean | undefined;
|
|
1898
1900
|
fieldType?: import("@formily/json-schema").SchemaTypes | undefined;
|
|
1899
1901
|
content?: string | import("../../../../../es/components/form-render").FormRenderer | Record<string, import("../../../../../es/components/form-render").FormRenderer> | undefined;
|
|
1900
1902
|
lazyRequest?: boolean | undefined;
|
|
@@ -3606,6 +3608,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
3606
3608
|
allow_check_mid_level?: "1" | "2" | "3" | "4" | undefined;
|
|
3607
3609
|
prefix?: string | import("../../../../../es/shared/types").AnyObject | (() => any) | undefined;
|
|
3608
3610
|
suffix?: string | import("../../../../../es/shared/types").AnyObject | (() => any) | undefined;
|
|
3611
|
+
allowSlash?: boolean | undefined;
|
|
3609
3612
|
fieldType?: import("@formily/json-schema").SchemaTypes | undefined;
|
|
3610
3613
|
content?: string | import("../../../../../es/components/form-render").FormRenderer | Record<string, import("../../../../../es/components/form-render").FormRenderer> | undefined;
|
|
3611
3614
|
lazyRequest?: boolean | undefined;
|