cnhis-design-vue 3.2.7-beta.17 → 3.2.7-beta.19

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.
Files changed (33) hide show
  1. package/es/components/fabric-chart/src/hooks/temperature/useCenter.js +1 -1
  2. package/es/components/fabric-chart/src/hooks/temperature/useLeft.js +1 -1
  3. package/es/components/field-set/src/FieldColor.vue.d.ts +2 -2
  4. package/es/components/field-set/src/FieldFilter.vue.d.ts +2 -2
  5. package/es/components/field-set/src/FieldSet.vue.d.ts +4 -4
  6. package/es/components/field-set/src/components/Row.vue.d.ts +2 -2
  7. package/es/components/form-config/index.d.ts +3 -0
  8. package/es/components/form-config/src/FormConfig.vue.d.ts +3 -0
  9. package/es/components/form-config/src/components/FormConfigEdit.vue.d.ts +3 -0
  10. package/es/components/form-render/src/components/renderer/formItem.js +1 -1
  11. package/es/components/form-render/src/components/tooltipMessage.vue2.js +1 -1
  12. package/es/components/form-render/src/types/fieldItem.d.ts +1 -0
  13. package/es/components/iho-chat/index.d.ts +33 -6
  14. package/es/components/iho-chat/src/Index.vue.d.ts +33 -6
  15. package/es/components/iho-chat/src/components/ChatFooter.vue.d.ts +1 -1
  16. package/es/components/iho-chat/src/components/ChatFooter.vue2.js +1 -1
  17. package/es/components/iho-chat/src/components/ChatMain.vue.d.ts +5 -2
  18. package/es/components/iho-chat/src/components/ChatMain.vue2.js +1 -1
  19. package/es/components/iho-chat/src/components/ContextMenu.js +1 -1
  20. package/es/components/iho-chat/src/components/MultipleVideo.vue.d.ts +14 -2
  21. package/es/components/iho-chat/src/components/MultipleVideo.vue2.js +1 -1
  22. package/es/components/iho-chat/src/components/Video.vue.d.ts +14 -2
  23. package/es/components/iho-chat/src/components/Video.vue2.js +1 -1
  24. package/es/components/iho-chat/src/hooks/useState.js +1 -1
  25. package/es/components/iho-chat/src/hooks/useVideo.d.ts +11 -0
  26. package/es/components/iho-chat/src/hooks/useVideo.js +1 -1
  27. package/es/components/iho-chat/src/utils/index.js +1 -1
  28. package/es/components/iho-chat/style/index.css +1 -1
  29. package/es/components/index.css +1 -1
  30. package/es/components/shortcut-setter/index.d.ts +1 -0
  31. package/es/components/shortcut-setter/src/ShortcutSetter.vue.d.ts +1 -0
  32. package/es/shared/package.json.js +1 -1
  33. package/package.json +2 -2
@@ -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,A,R,I){r(E,$);const{getEqualXTypes:X,handleAddPrevent:D,getPointEventProps:H}=w(E,O,$),{createShadowLines:z}=t(),{left:F,xScaleList:_,xCellWidth:W,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}=$,oe=new Set,le=["xinmai","mai"],se=new Map,re=new Set,ue=new Set,ae=new Set,ce=x(F.yScaleValue),de=new Set;function pe(t){var o;const l=ce.find((e=>"pulse"===e.type));if(l&&(null==(o=l.dataList)?void 0:o.length)&&(oe.size&&E.value.remove(...oe),oe.clear(),se.size>1)){if(t){const{type:e,key:i}=t.origin||{};if("pulse"===e){const e=se.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 se)t.push(e[1]),e[0]===le[0]&&e[1].forEach((e=>{(se.get(le[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(ae).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)===le[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(...z(t,r._angle,r.space)),e.forEach((e=>{Object.assign(e,{...n,...r}),oe.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),oe.add(n)}))}E.value.add(...e)}oe.add(l),E.value.add(l)}))}}function fe(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,A=[],I=[],X=[];let D=null;const z=e=>"breathe"==a&&e.respirator&&k.type&&k.fixedValue&&!e.value&&ge(e.time);if(null==(u=e.list)||u.forEach(((u,j)=>{const F=d(a)?L.find((e=>e.key===u.key)):e,_=ye(z(u)?{...u,value:k.fixedValue}:u,r),G=e.list[j+1],N=G?ye(z(G)?{...G,value:k.fixedValue}:G,r):void 0,B=G?d(a)?L.find((e=>e.key===G.key)):e:{},{title:J=""}=F;if("脉搏"===J&&"脉搏"!==B.title||"脉搏"!==J&&"脉搏"===B.title||!_||!N||f(_[0],1)!==f(N[0],1))_&&D&&(_[0]=D),D=null;else{const e=_[0]-W/2;_[0]=e+W/4,N[0]=D=_[0]+W/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:z(t)?k.fixedValue:t.value,originX:"center",originY:"center",fill:n.stroke||"#000"});return X.push(s),{obj:s,top:-q}}(_,u,F),function(e,t,r,u){var d,f;if(!["temperature","pain","breathe"].includes(a))return;if(!(null==e?void 0:e.length)&&"temperature"===a&&!ge(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,Y,E;if(t.noRise&&p.show){const i=M(p,t)?V(a,S,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||ae.add(w);else if(t.value){w=s([x,i,i+2*q],{...p.style})}w&&X.push(w),w&&M(p,t)&&de.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&&(Y=l([x,e[1]-(m?q:0)-5],{value:"v",originX:"center",originY:"bottom",...g}),X.push(Y)),h(t.physicsReduce)||h(t.drugReduce)){const l=V(a,S,null!=(d=t.physicsReduce)?d:t.drugReduce),s=l<e[1]&&(null==te?void 0:te.hypothermyViewCustom)?x+W/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&&(E=o(k.type,{left:x,top:e[1]-(m?q:0)-5,originX:"center",originY:"bottom",...k.style}),X.push(E))}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:Y,top:(m?-q:0)-5},reducePoint:{obj:j,type:"reduce"},respirator:{obj:E,top:(m?-q:0)-5}})}(_,u,F,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}})}(_,u,F,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=he(a,e.list[u].value),L=l&&he(a,j.value),S=()=>"pulse"==a&&s.pacemakerShow?m.value:z(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:z(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:z(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===le[1]?re.add(p):z(s)||ue.add(p),function(e){Q.hovered&&(e.on("mouseover",(()=>{ve(e,"hover")})),e.on("mouseout",(()=>{R.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)))})),pe(e)}(e),Q.hovered&&ve(e)})),e.on("mouseup",(t=>{if(R.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),xe(n,"change")}}))}(p),A.push(p),ae.add(p))}(_,N,u,j,F,K)})),"pulse"===a){const{key:t}=e;let i=null;se.set(t,A.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-W/2;e.set("left",t+W/4),null==(o=e.rightLine)||o.set("x1",e.left),i=e.left+W/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 F=I.filter((e=>e));E.value.add(...F,...A,...X)}function he(e,t){return"pain"===e&&0==t}function ve(e,t="moving"){const{title:i,unit:n,type:o,data:l}=e.origin;R.point={x:e.left,y:e.top};let s=`时间 ${((null==l?void 0:l.time)||C(e.left)).slice(-5)}`;R.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],R.show=!0}function ge(e){const[t]=_,i=j(_),n=t.start,o=i.end,l=c(e);return l>=n&&l<=o}function ye(e,t){const i="pain"===t.type?Z:U;if(!g(e)||!ge(e.time))return;const n=T(e.time),o=V(t.type,t.list,e.value);return[n,o<i.originY?i.originY:o>i.endY?i.endY:o]}function me(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 xe(e,t="add"){const{type:i,dataIndex:n,index:o,data:l,key:s}=e,r=ce.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;be()}function be(){var e;ae.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}([...ae]))),ae.clear(),je()}function je(e){se.clear(),ae.clear(),re.clear(),de.clear(),ue.clear(),ce.forEach((t=>{null==e||e(t),t.dataList.forEach(((e,i)=>{!e.show||d(t.type)&&!e.enable||fe(e,i,t)}))})),pe(),[...ae].forEach((e=>{null==e||e.bringToFront()})),function(){var e;const t=ce.find((e=>"pulse"===e.type));if(!t||!(null==(e=t.dataList)?void 0:e.length))return;if(!t.dataList.some((e=>e.title.includes("脉搏"))))return;const i=Object.assign({},S,F.overlap||{}),l=[];re.size&&[...re].forEach((e=>{[...ue].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(),ae.add(e)}))}))}()}return je((e=>function(e){if("temperature"!==e.type||!e.positionLine)return;const t=V(e.type,e.list,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([...ae],e,"_type").includes(i.bigType)){const e=["pain"].includes(i.bigType)?Z:U;t>=e.originY&&t<=e.endY&&I.list.push({renderItem:A?A(i):()=>i.title,origin:{title:i.title,unit:i.unit,type:a(i.bigType),dataIndex:i.dataIndex,key:i.key},pointer:n})}}));const i=me(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),xe(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),xe(t)}},setPopup:ve,isAddPoint:me,updateData:xe,redrawPoints:be,gridPoints:ae,fixedNoRisePoints:de}}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 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=>"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,Y,E;if(t.noRise&&p.show){const i=M(p,t)?V(a,S,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&&(Y=l([x,e[1]-(m?q:0)-5],{value:"v",originX:"center",originY:"bottom",...g}),X.push(Y)),h(t.physicsReduce)||h(t.drugReduce)){const l=V(a,S,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&&(E=o(k.type,{left:x,top:e[1]-(m?q:0)-5,originX:"center",originY:"bottom",...k.style}),X.push(E))}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:Y,top:(m?-q:0)-5},reducePoint:{obj:j,type:"reduce"},respirator:{obj:E,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,t.list,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=>{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=>"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.list,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 +1 @@
1
- import{fabric as e}from"../../../../../shared/utils/fabricjs/index.js";import{drawLine as t,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{last as u}from"lodash-es";import"../useEvent.js";import{getScaleInfo as a,drawScaleNumber as h,drawScaleLine as c}from"../useScaleColumn.js";import{useCommon as d}from"../useCommon.js";import"vue";import"./useShadow.js";import"@vueuse/shared";import"naive-ui";import"@vueuse/core";function p(p,g,f,m,v,y,w,S,b,Y,x,j){var C,X;const{getEqualXTypes:N,handleAddPrevent:T,isGridLimit:V}=d(p,f,g),{originY:L,endY:k,originX:E,endX:M,xCellWidth:W,yCellHeight:G,left:I,vitalSignsOriginY:O,painOriginY:R,painHeight:A,iconsWidth:H,itemList:_,painIndex:B,right:J,canvasWidth:$,canvasHeight:q,getRightInfo:D,borderStyle:P,surplusCell:z,painSurplusCell:F}=g;function K(o){var s;if(!(null==o?void 0:o.length))return;const{layout:r}=o[0];let d=H,g=E;"right"===r&&(d=M,g=M+(null!=(s=null==J?void 0:J.width)?s:0));const f=[],m=A&&"right"!==r?o.length-1:o.length,v=(g-d)/m,y=v+(g-d)%m;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:d,style:g,title:f}=n,m=R.originY-F[0]*G,v=l({width:E-H,height:A+(F[0]+F[1])*G,...P},{value:`${f}`,...i,...g||{}},{left:H,top:m}),y=t([H,m,E,m],P),w=[];if(r||u){const{lineXMain:t,textLeft:i}=a(c,H,E-H),l=o.length;o.forEach(((o,a)=>{let c=R.endY-a*G*s;if(0===a&&0===F[1]&&(c=k-5),u&&(!(0===a||a===l-1)||d||0===a&&F[1]>0||a===l-1&&F[0]>0)&&w.push(h(o,n,i,c)),r&&(0!==a||F[1]>0)){const[i,n]=t,o=new e.Line([i,c,n,c],{...P,...g});w.push(o)}}))}p.value.add(y,v,...w),v.sendToBack()}(o);const g=[],m=0===s?y:v,w=0===s?d:y+d+(s-1)*v,S="right"===r?0:O.originY,b="right"===r?q:O.endY,Y=s>0?t([w,S,w,b],{objectCaching:!1,...P}):null;Y&&g.push(Y);const x=w+m/2,{list:j=[],spaceGridNumber:C=5,showScale:X,showNumber:N,position:T,showMaxMinNumber:V,detailedList:M=[],showdetailedScale:W,showRange:I=[]}=o;if(X||N){const{lineXMain:e,lineXSub:t,textLeft:i}=a(T,w,m),n=(j[1]-j[0])/2,l=W&&!M.length?j.reduce(((e,t,i)=>{const o=e[e.length-1];return 0===i?[t]:e.concat([o+n,o+2*n])}),[]):W&&(null==M?void 0:M.length)?M:j,[s=l[0],r=u(l)]=I;l.forEach(((n,u)=>{if(s&&+n<+s)return;if(r&&+n>+r)return;const a=O.endY-u*G*(W?C/2:C),d=[s,r].includes(n);if(N&&(!d||V)){const e=0==u?a-5:a,t=h(n,o,i,e),l=O.originY+t.height/2;e<l&&t.set({top:l}),g.push(t)}g.push(...c(o,u,e,t,a,G,O.originY,l.findIndex((e=>e==r))+1))}))}let _=o.title||"";o.unit&&(_+="\n"+o.unit);let J=O.originY+G;0!==B&&z[0]>1&&(J=L+G*z[0]/2),_&&g.push(new e.Text(String(_),{...i,left:x,top:J,textAlign:"center",...o.style}));const $=new e.Group(g,{...n,objectCaching:!1});f.push($)}));const w=f.length>0?new e.Group([...f],{...n,objectCaching:!1}):null;w&&p.value.add(w),w&&w.sendToBack()}H&&function(){const e=JSON.parse(JSON.stringify(_));let t=k;const i=H-I.icons.marginRight;e.reverse().forEach((e=>{t-=10;let n=e.title.replace(/(.{2})/g,"$1\n");n.endsWith("\n")&&(n=n.slice(0,n.length-1));const{text:l,icon:u}=o(n,e,{text:{left:i-(e.pointAttr.width||10)-5,top:t,originX:"right"},icon:{originX:"right",left:i,topY:t,origin:{type:s(e.bigType),_type:e.bigType},...g.event}});var a;t-=l.height||30,(a=u).on("moving",(()=>{a.set("originX","center"),function(e){if(e.left>=E&&e.left<=M){e.setCoords();const t="pain"===e.origin.type?R:O;e.top<t.originY&&e.set("top",t.originY),e.top>t.endY&&e.set("top",t.endY)}}(a),V(a)?m(a):v.show=!1})),a.on("mouseup:before",(e=>{if(v.show=!1,0===e.e.button&&V(a)){const e=N([...j],a.left,"_type").includes(a.origin._type),t=Y(a.left);if(!t||e)e&&t&&T("repeat");else{const e={data:{time:S(a.left),value:b(a.origin.type,a.top),...r(a.origin.type)?{key:a.origin.key}:{}},...a.origin};f("add",e),x(e)}}!function(e){e.setCoords().set({originX:"right",left:e.originLeft,top:e.originTop})}(a)})),p.value.add(l,u)}))}();const Q=I.yScaleValue.filter((e=>"left"===e.layout&&"pain"!==e.type&&e.show));if((null==J?void 0:J.width)&&"left"===(null==(C=null==J?void 0:J.yScaleValue)?void 0:C.layout)&&(null==(X=null==J?void 0:J.yScaleValue)?void 0:X.show)&&Q.push(D),B>0&&I.yScaleValue[B].show){const e=I.yScaleValue[B];0===B&&I.yScaleValue.length>1&&Q.unshift(e),B==I.yScaleValue.length-1&&Q.push(e)}const U=Q.findIndex((e=>"pulse"===e.type&&e.show&&e.doubleShow)),Z=Q[U];return U>-1&&Q.splice(U,0,{...Z,title:(null==Z?void 0:Z.doubleTitle)||(null==Z?void 0:Z.title)}),K(Q),p.value.add(new e.Rect({left:H,top:0,width:$-H-P.strokeWidth,height:q-P.strokeWidth,fill:"transparent",...P})),{drawScaleValue:K}}export{p as useLeft};
1
+ import{fabric as e}from"../../../../../shared/utils/fabricjs/index.js";import{drawLine as t,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{last as u}from"lodash-es";import"../useEvent.js";import{getScaleInfo as a,drawScaleNumber as h,drawScaleLine as c}from"../useScaleColumn.js";import{useCommon as p}from"../useCommon.js";import"vue";import"./useShadow.js";import"@vueuse/shared";import"naive-ui";import"@vueuse/core";function d(d,g,f,m,v,y,w,S,b,Y,x,j){var C,X;const{getEqualXTypes:N,handleAddPrevent:T,isGridLimit:V}=p(d,f,g),{originY:L,endY:E,originX:M,endX:G,xCellWidth:k,yCellHeight:I,left:O,vitalSignsOriginY:W,painOriginY:A,painHeight:H,iconsWidth:R,itemList:_,painIndex:B,right:J,canvasWidth:$,canvasHeight:q,getRightInfo:D,borderStyle:P,surplusCell:z,painSurplusCell:F}=g;function K(o){var s;if(!(null==o?void 0:o.length))return;const{layout:r}=o[0];let p=R,g=M;"right"===r&&(p=G,g=G+(null!=(s=null==J?void 0:J.width)?s:0));const f=[],m=H&&"right"!==r?o.length-1:o.length,v=(g-p)/m,y=v+(g-p)%m;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:g,title:f}=n,m=A.originY-F[0]*I,v=l({width:M-R,height:H+(F[0]+F[1])*I,...P},{value:`${f}`,...i,...g||{}},{left:R,top:m}),y=t([R,m,M,m],P),w=[];if(r||u){const{lineXMain:t,textLeft:i}=a(c,R,M-R),l=o.length;o.forEach(((o,a)=>{let c=A.endY-a*I*s;if(0===a&&0===F[1]&&(c=E-5),u&&(!(0===a||a===l-1)||p||0===a&&F[1]>0||a===l-1&&F[0]>0)&&w.push(h(o,n,i,c)),r&&(0!==a||F[1]>0)){const[i,n]=t,o=new e.Line([i,c,n,c],{...P,...g});w.push(o)}}))}d.value.add(y,v,...w),v.sendToBack()}(o);const g=[],m=0===s?y:v,w=0===s?p:y+p+(s-1)*v,S="right"===r?0:W.originY,b="right"===r?q:W.endY,Y=s>0?t([w,S,w,b],{objectCaching:!1,...P}):null;Y&&g.push(Y);const x=w+m/2,{list:j=[],spaceGridNumber:C=5,showScale:X,showNumber:N,position:T,showMaxMinNumber:V,detailedList:G=[],showdetailedScale:k,showRange:O=[]}=o;if(X||N){const{lineXMain:e,lineXSub:t,textLeft:i}=a(T,w,m),n=(j[1]-j[0])/2,l=k&&!G.length?j.reduce(((e,t,i)=>{const o=e[e.length-1];return 0===i?[t]:e.concat([o+n,o+2*n])}),[]):k&&(null==G?void 0:G.length)?G:j,[s=l[0],r=u(l)]=O;l.forEach(((n,u)=>{if(s&&+n<+s)return;if(r&&+n>+r)return;const a=W.endY-u*I*(k?C/2:C),p=[s,r].includes(n);if(N&&(!p||V)){const e=0==u?a-5:a,t=h(n,o,i,e),l=W.originY+t.height/2;e<l&&t.set({top:l}),g.push(t)}g.push(...c(o,u,e,t,a,I,W.originY,l.findIndex((e=>e==r))+1))}))}let _=o.title||"";o.unit&&(_+="\n"+o.unit);let J=W.originY+I;0!==B&&z[0]>1&&(J=L+I*z[0]/2),_&&g.push(new e.Text(String(_),{...i,left:x,top:J,textAlign:"center",...o.style}));const $=new e.Group(g,{...n,objectCaching:!1});f.push($)}));const w=f.length>0?new e.Group([...f],{...n,objectCaching:!1}):null;w&&d.value.add(w),w&&w.sendToBack()}R&&function(){const e=JSON.parse(JSON.stringify(_));let t=E;const i=R-O.icons.marginRight;e.reverse().forEach((e=>{t-=10;let n=e.title.replace(/(.{2})/g,"$1\n");n.endsWith("\n")&&(n=n.slice(0,n.length-1));const{text:l,icon:u}=o(n,e,{text:{left:i-(e.pointAttr.width||10)-5,top:t,originX:"right"},icon:{originX:"right",left:i,topY:t,origin:{type:s(e.bigType),_type:e.bigType},...g.event}});var a;t-=l.height||30,(a=u).on("moving",(()=>{a.set("originX","center"),function(e){if(e.left>=M&&e.left<=G){e.setCoords();const t="pain"===e.origin.type?A:W;e.top<t.originY&&e.set("top",t.originY),e.top>t.endY&&e.set("top",t.endY)}}(a),V(a)?m(a):v.show=!1})),a.on("mouseup:before",(e=>{if(v.show=!1,0===e.e.button&&V(a)){const e=N([...j],a.left,"_type").includes(a.origin._type),t=Y(a.left);if(!t||e)e&&t&&T("repeat");else{const e={data:{time:S(a.left),value:b(a.origin.type,a.top),...r(a.origin.type)?{key:a.origin.key}:{}},...a.origin};f("add",e),x(e)}}!function(e){e.setCoords().set({originX:"right",left:e.originLeft,top:e.originTop})}(a)})),d.value.add(l,u)}))}();const Q=O.yScaleValue.filter((e=>"left"===e.layout&&"pain"!==e.type&&e.show));if((null==J?void 0:J.width)&&"left"===(null==(C=null==J?void 0:J.yScaleValue)?void 0:C.layout)&&(null==(X=null==J?void 0:J.yScaleValue)?void 0:X.show)&&Q.push(D),B>0&&O.yScaleValue[B].show){const e=O.yScaleValue[B];0===B&&O.yScaleValue.length>1&&Q.unshift(e),B==O.yScaleValue.length-1&&Q.push(e)}const U=Q.findIndex((e=>"pulse"===e.type&&e.show&&e.doubleShow)),Z=Q[U];return U>-1&&Q.splice(U,0,{...Z,title:(null==Z?void 0:Z.doubleTitle)||(null==Z?void 0:Z.title)}),K(Q),{drawScaleValue:K}}export{d as useLeft};
@@ -466,11 +466,11 @@ declare const _default: import("vue").DefineComponent<{
466
466
  hide: boolean;
467
467
  }>;
468
468
  draggable: boolean;
469
- fieldDescribeMode: "column" | "tooltip";
470
- isFieldSet: boolean;
471
469
  idx: number;
472
470
  isHighlight: boolean;
473
471
  isHighlightRow: boolean;
472
+ isFieldSet: boolean;
473
+ fieldDescribeMode: "column" | "tooltip";
474
474
  }>;
475
475
  EditDialog: import("vue").DefineComponent<{
476
476
  visible: {
@@ -488,11 +488,11 @@ declare const _default: import("vue").DefineComponent<{
488
488
  hide: boolean;
489
489
  }>;
490
490
  draggable: boolean;
491
- fieldDescribeMode: "column" | "tooltip";
492
- isFieldSet: boolean;
493
491
  idx: number;
494
492
  isHighlight: boolean;
495
493
  isHighlightRow: boolean;
494
+ isFieldSet: boolean;
495
+ fieldDescribeMode: "column" | "tooltip";
496
496
  }>;
497
497
  setStyle: typeof setStyle;
498
498
  }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("close" | "save" | "reset")[], "close" | "save" | "reset", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
@@ -612,11 +612,11 @@ declare const _default: import("vue").DefineComponent<{
612
612
  hide: boolean;
613
613
  }>;
614
614
  draggable: boolean;
615
- fieldDescribeMode: "column" | "tooltip";
616
- isFieldSet: boolean;
617
615
  idx: number;
618
616
  isHighlight: boolean;
619
617
  isHighlightRow: boolean;
618
+ isFieldSet: boolean;
619
+ fieldDescribeMode: "column" | "tooltip";
620
620
  }>;
621
621
  isArray: {
622
622
  (value?: any): value is any[];
@@ -724,10 +724,10 @@ declare const _default: import("vue").DefineComponent<{
724
724
  rowDraggable: boolean;
725
725
  showSeq: boolean;
726
726
  footerFlag: boolean;
727
- customColumns: FieldSetColumnItem[];
727
+ fieldDescribeMode: "column" | "tooltip";
728
728
  showSearch: boolean;
729
+ customColumns: FieldSetColumnItem[];
729
730
  showSortPriority: boolean;
730
731
  showHeadFilter: boolean;
731
- fieldDescribeMode: "column" | "tooltip";
732
732
  }>;
733
733
  export default _default;
@@ -317,10 +317,10 @@ declare const _default: import("vue").DefineComponent<{
317
317
  hide: boolean;
318
318
  }>;
319
319
  draggable: boolean;
320
- fieldDescribeMode: "column" | "tooltip";
321
- isFieldSet: boolean;
322
320
  idx: number;
323
321
  isHighlight: boolean;
324
322
  isHighlightRow: boolean;
323
+ isFieldSet: boolean;
324
+ fieldDescribeMode: "column" | "tooltip";
325
325
  }>;
326
326
  export default _default;
@@ -1887,6 +1887,7 @@ declare const FormConfig: SFCWithInstall<import("vue").DefineComponent<{
1887
1887
  bordered?: string | boolean | undefined;
1888
1888
  displayMode?: "form" | "table" | undefined;
1889
1889
  editor_title?: string | undefined;
1890
+ editor_title_mode?: "EMBEDDED_FORM" | "HOVER_TOOLTIP" | "POPUP_ALERT" | undefined;
1890
1891
  linebarWidth?: string | undefined;
1891
1892
  linebarDirection?: "horizontal" | "vertical" | undefined;
1892
1893
  linebarTextDirection?: "horizontal" | "vertical" | undefined;
@@ -2134,6 +2135,7 @@ declare const FormConfig: SFCWithInstall<import("vue").DefineComponent<{
2134
2135
  bordered?: string | boolean | undefined;
2135
2136
  displayMode?: "form" | "table" | undefined;
2136
2137
  editor_title?: string | undefined;
2138
+ editor_title_mode?: "EMBEDDED_FORM" | "HOVER_TOOLTIP" | "POPUP_ALERT" | undefined;
2137
2139
  linebarWidth?: string | undefined;
2138
2140
  linebarDirection?: "horizontal" | "vertical" | undefined;
2139
2141
  linebarTextDirection?: "horizontal" | "vertical" | undefined;
@@ -2352,6 +2354,7 @@ declare const FormConfig: SFCWithInstall<import("vue").DefineComponent<{
2352
2354
  bordered?: string | boolean | undefined;
2353
2355
  displayMode?: "form" | "table" | undefined;
2354
2356
  editor_title?: string | undefined;
2357
+ editor_title_mode?: "EMBEDDED_FORM" | "HOVER_TOOLTIP" | "POPUP_ALERT" | undefined;
2355
2358
  linebarWidth?: string | undefined;
2356
2359
  linebarDirection?: "horizontal" | "vertical" | undefined;
2357
2360
  linebarTextDirection?: "horizontal" | "vertical" | undefined;
@@ -1890,6 +1890,7 @@ declare const _default: import("vue").DefineComponent<{
1890
1890
  bordered?: string | boolean | undefined;
1891
1891
  displayMode?: "form" | "table" | undefined;
1892
1892
  editor_title?: string | undefined;
1893
+ editor_title_mode?: "EMBEDDED_FORM" | "HOVER_TOOLTIP" | "POPUP_ALERT" | undefined;
1893
1894
  linebarWidth?: string | undefined;
1894
1895
  linebarDirection?: "horizontal" | "vertical" | undefined;
1895
1896
  linebarTextDirection?: "horizontal" | "vertical" | undefined;
@@ -2137,6 +2138,7 @@ declare const _default: import("vue").DefineComponent<{
2137
2138
  bordered?: string | boolean | undefined;
2138
2139
  displayMode?: "form" | "table" | undefined;
2139
2140
  editor_title?: string | undefined;
2141
+ editor_title_mode?: "EMBEDDED_FORM" | "HOVER_TOOLTIP" | "POPUP_ALERT" | undefined;
2140
2142
  linebarWidth?: string | undefined;
2141
2143
  linebarDirection?: "horizontal" | "vertical" | undefined;
2142
2144
  linebarTextDirection?: "horizontal" | "vertical" | undefined;
@@ -2355,6 +2357,7 @@ declare const _default: import("vue").DefineComponent<{
2355
2357
  bordered?: string | boolean | undefined;
2356
2358
  displayMode?: "form" | "table" | undefined;
2357
2359
  editor_title?: string | undefined;
2360
+ editor_title_mode?: "EMBEDDED_FORM" | "HOVER_TOOLTIP" | "POPUP_ALERT" | undefined;
2358
2361
  linebarWidth?: string | undefined;
2359
2362
  linebarDirection?: "horizontal" | "vertical" | undefined;
2360
2363
  linebarTextDirection?: "horizontal" | "vertical" | undefined;
@@ -393,6 +393,7 @@ declare const _default: import("vue").DefineComponent<{
393
393
  bordered?: string | boolean | undefined;
394
394
  displayMode?: "form" | "table" | undefined;
395
395
  editor_title?: string | undefined;
396
+ editor_title_mode?: "EMBEDDED_FORM" | "HOVER_TOOLTIP" | "POPUP_ALERT" | undefined;
396
397
  linebarWidth?: string | undefined;
397
398
  linebarDirection?: "horizontal" | "vertical" | undefined;
398
399
  linebarTextDirection?: "horizontal" | "vertical" | undefined;
@@ -640,6 +641,7 @@ declare const _default: import("vue").DefineComponent<{
640
641
  bordered?: string | boolean | undefined;
641
642
  displayMode?: "form" | "table" | undefined;
642
643
  editor_title?: string | undefined;
644
+ editor_title_mode?: "EMBEDDED_FORM" | "HOVER_TOOLTIP" | "POPUP_ALERT" | undefined;
643
645
  linebarWidth?: string | undefined;
644
646
  linebarDirection?: "horizontal" | "vertical" | undefined;
645
647
  linebarTextDirection?: "horizontal" | "vertical" | undefined;
@@ -858,6 +860,7 @@ declare const _default: import("vue").DefineComponent<{
858
860
  bordered?: string | boolean | undefined;
859
861
  displayMode?: "form" | "table" | undefined;
860
862
  editor_title?: string | undefined;
863
+ editor_title_mode?: "EMBEDDED_FORM" | "HOVER_TOOLTIP" | "POPUP_ALERT" | undefined;
861
864
  linebarWidth?: string | undefined;
862
865
  linebarDirection?: "horizontal" | "vertical" | undefined;
863
866
  linebarTextDirection?: "horizontal" | "vertical" | undefined;
@@ -1 +1 @@
1
- import{defineComponent as e,inject as l,computed as r,ref as t,onUnmounted as o,createVNode as a,mergeProps as n,unref as i}from"vue";import{arrayed as u,getStringWidth as d,widthAppend as s}from"../../../../../shared/utils/index.js";import{isVoidField as m}from"@formily/core";import{observe as f,autorun as v}from"@formily/reactive";import{connect as c,mapProps as p}from"@formily/vue";import{useDebounceFn as b}from"@vueuse/core";import{isString as h,isArray as y,isObject as _,isNumber as k,isFunction as g,uniq as F}from"lodash-es";import{NFormItem as I}from"naive-ui";import x from"../../../../annotation-edit/index.js";import"../../../index.js";import j from"../tooltipMessage.vue.js";import{InjectionFormGlobalProps as R,InjectionFormGlobalEmit as M,InjectionFormUUID as S,InjectionFormGraph as L,InjectionAnnotation as W,InjectionAnnotationShortcuts as O,InjectionFormColumnWidth as q}from"../../constants/index.js";import{useComplexOptionsSpan as w}from"../../hooks/useComplexOptions.js";import{validateMessageParser as C,editorUnescape as E}from"../../utils/index.js";import{dotEscape as K,createFieldAddressId as N}from"../../utils/schema.js";import{useFormField as P}from"../../hooks/useFormField.js";const A=c(e({name:"FormRenderItem",props:{label:String,propertyKey:String,remark:String,span:{type:Number,default:6},suffixFields:{type:Array},labelRender:Function,annotation:{},isOptionChildField:Boolean,feedback:String,showFeedback:{type:Boolean,default:void 0},fieldItem:{type:Object}},setup(e,{slots:u,attrs:c}){const p=l(R),C=l(M),{field:A,fieldKey:B,fieldAddress:T}=P(),V=l(S),$=r((()=>K(`${V}-${T.value}`))),H=t(!1);if(m(A.value)&&y(e.suffixFields)){const r=l(L);o(f(r,b((()=>{m(A.value)&&y(e.suffixFields)&&(H.value=e.suffixFields.some((e=>{const l=A.value.form.query(e).take();return l&&Reflect.get(l,"required")})))}),100)))}else o(v((()=>{H.value=Reflect.get(A.value,"required")})));const U=l(W),z=r({get(){var l,r;return null!=(r=null==(l=U.value)?void 0:l[e.propertyKey])?r:""},set(l){U.value={property:e.propertyKey,value:l}}}),D=l(O);const G=r((()=>{var l;const r={color:null==(l=e.fieldItem)?void 0:l.labelColor};return _(c.labelStyle)&&Object.assign(r,c.labelStyle),r})),J=r((()=>U.value&&!1!==e.annotation)),Q=r((()=>e.label&&" "!==e.label)),X=r((()=>{let l=0;return J.value&&(l+=18),e.remark&&(l+=18),l})),Y=l(R,{}),Z=r((()=>{var l;const r=null==(l=e.fieldItem)?void 0:l.bordered;return null==r?Y.bordered:r})),ee=l("n-form",{}),le=r((()=>{var e,l,r,t;if("left"!==(null!=(l=c.labelPlacement)?l:null==(e=ee.props)?void 0:e.labelPlacement))return"";let o=null!=(t=c.labelWidth)?t:null==(r=ee.props)?void 0:r.labelWidth;return o&&"auto"!==o?(o=parseInt(o+""),isNaN(o)||!k(o)?"":o-12-X.value-(H.value?11:0)):""})),re=r((()=>g(e.labelRender)?"":h(e.label)?e.label:""));function te(){return Q.value?a("section",{class:"form-render__formItemLabel"},[a("span",{class:"form-render__formItemLabel--text",style:{marginRight:s(X.value),maxWidth:s(le.value)},title:re.value},[g(e.labelRender)?e.labelRender(e.label):e.label]),X.value?a("section",{class:"form-render__formItemLabel--operation"},[e.remark?a("div",{class:"form-render__formItemLabel--tooltip"},[a(j,{message:e.remark},null)]):null,J.value?a(x,{class:"form-render__formItemLabel--annotation",modelValue:z.value,"onUpdate:modelValue":e=>z.value=e,shortcuts:i(D)},null):null]):null]):null}const oe=r((()=>{let l=X.value;return H.value&&(l+=11),h(e.label)&&(l+=le.value||d(e.label)),l})),ae=l(q),{getSpan:ne}=w();function ie(){var l,r,t;const o="inner"===(null==(l=e.fieldItem)?void 0:l.childWidthMode)?e.span:ne(V,A.value.address,!1)+e.span;if("left"!==(null!=(t=c.labelPlacement)?t:null==(r=ee.props)?void 0:r.labelPlacement)||!i(ae)||!(null==p?void 0:p.autoWidth))return o;const a=16+ae.value;let n=o*a-16-oe.value;const u=k(null==p?void 0:p.autoWidth)?p.autoWidth:120;let d=o;for(;n<u&&d<12;)d++,n+=a;return d}function ue(){var l,r,t;const o=null==(l=e.fieldItem)?void 0:l.editor_title;return h(o)&&o?a("section",{style:"display:flex;flex-direction:column;gap:4px"},[null==(t=u.default)?void 0:t.call(u),a("div",{innerHTML:E(o)},null)]):null==(r=u.default)?void 0:r.call(u)}function de(){const e=[A.value.path+""];return A.value.form.query("*").forEach((l=>{(l.address+"").includes(A.value.address+"")&&((l.path+"").includes(A.value.path+"")||e.push(l.path+""))})),e}const se=r({get:()=>!(!(null==p?void 0:p.selectMode)||!y(null==p?void 0:p.selectedFields))&&p.selectedFields.includes(A.value.path+""),set(e){if(!y(null==p?void 0:p.selectedFields))return;let l=[...p.selectedFields];e?(l.push(...de()),l=F(l)):de().forEach((e=>{const r=l.indexOf(e);r>-1&&l.splice(r,1)})),null==C||C("update:selectedFields",l)}}),me=r((()=>(null==p?void 0:p.selectMode)&&!(A.value.parent&&"LINEBAR"!==A.value.parent.componentType)));function fe(){(null==p?void 0:p.selectMode)&&(se.value=!se.value)}const ve=r((()=>e.isOptionChildField?!!e.feedback&&" "!==e.feedback&&e.showFeedback:e.showFeedback));return()=>a(I,n({class:["form-render__formItem",{"form-render--no-border":!Z.value,"form-render--underline":"underline"===Z.value,"form-render__formItemMask":me.value,"form-render__formItemMask--selected":me.value&&se.value}],style:{"--form-item-column":ie()},showFeedback:ve.value,feedback:e.feedback,labelStyle:G.value},{id:$.value,uuid:V,onClick:fe,"widget-type":A.value.componentType,"field-key":K(B.value),"field-address":N(T.value),required:H.value}),{...u,default:ue,label:te})}}),p({title:"label"},((e,l)=>{const r=m(l)?void 0:u(l.selfErrors).length?function(e,l){if(!h(l.defined_error_msg)||!l.defined_error_msg)return e.map((e=>C(e,l))).join(",");return C(l.defined_error_msg,l)}(u(l.selfErrors),e.fieldItem):void 0;return{...e,fieldItem:void 0,feedback:r,"validation-status":r?"error":void 0}})));export{A as FORM_ITEM};
1
+ import{defineComponent as e,inject as l,computed as t,ref as r,onUnmounted as o,createVNode as n,mergeProps as a,withModifiers as i,createTextVNode as u,unref as d}from"vue";import{arrayed as s,getStringWidth as m,widthAppend as f}from"../../../../../shared/utils/index.js";import{isVoidField as v}from"@formily/core";import{observe as c,autorun as p}from"@formily/reactive";import{connect as b,mapProps as h}from"@formily/vue";import{useDebounceFn as _}from"@vueuse/core";import{isString as y,isArray as g,isObject as I,isNumber as x,isFunction as k,uniq as F}from"lodash-es";import{NFormItem as R,NTooltip as j,NButton as M}from"naive-ui";import P from"../../../../annotation-edit/index.js";import"../../../index.js";import w from"../tooltipMessage.vue.js";import{InjectionFormGlobalProps as O,InjectionFormGlobalEmit as E,InjectionFormUUID as L,InjectionFormGraph as S,InjectionAnnotation as C,InjectionAnnotationShortcuts as T,InjectionFormColumnWidth as W}from"../../constants/index.js";import{useComplexOptionsSpan as N}from"../../hooks/useComplexOptions.js";import{validateMessageParser as U,editorUnescape as q}from"../../utils/index.js";import{dotEscape as A,createFieldAddressId as B}from"../../utils/schema.js";import{useFormField as K}from"../../hooks/useFormField.js";const D=b(e({name:"FormRenderItem",props:{label:String,propertyKey:String,remark:String,span:{type:Number,default:6},suffixFields:{type:Array},labelRender:Function,annotation:{},isOptionChildField:Boolean,feedback:String,showFeedback:{type:Boolean,default:void 0},fieldItem:{type:Object}},setup(e,{slots:s,attrs:b}){const h=l(O),U=l(E),{field:D,fieldKey:G,fieldAddress:H}=K(),V=l(L),$=t((()=>A(`${V}-${H.value}`))),z=r(!1);if(v(D.value)&&g(e.suffixFields)){const t=l(S);o(c(t,_((()=>{v(D.value)&&g(e.suffixFields)&&(z.value=e.suffixFields.some((e=>{const l=D.value.form.query(e).take();return l&&Reflect.get(l,"required")})))}),100)))}else o(p((()=>{z.value=Reflect.get(D.value,"required")})));const Y=l(C),J=t({get(){var l,t;return null!=(t=null==(l=Y.value)?void 0:l[e.propertyKey])?t:""},set(l){Y.value={property:e.propertyKey,value:l}}}),Q=l(T);const X=t((()=>{var l;const t={color:null==(l=e.fieldItem)?void 0:l.labelColor};return I(b.labelStyle)&&Object.assign(t,b.labelStyle),t})),Z=t((()=>Y.value&&!1!==e.annotation)),ee=t((()=>{var l,t;return y(null==(l=e.fieldItem)?void 0:l.editor_title)&&e.fieldItem.editor_title&&"POPUP_ALERT"===(null==(t=e.fieldItem)?void 0:t.editor_title_mode)})),le=r(!1),te=t((()=>e.label&&" "!==e.label)),re=t((()=>{let l=0;return Z.value&&(l+=18),e.remark&&(l+=18),ee.value&&(l+=32),l})),oe=l(O,{}),ne=t((()=>{var l;const t=null==(l=e.fieldItem)?void 0:l.bordered;return null==t?oe.bordered:t})),ae=l("n-form",{}),ie=t((()=>{var e,l,t,r;if("left"!==(null!=(l=b.labelPlacement)?l:null==(e=ae.props)?void 0:e.labelPlacement))return"";let o=null!=(r=b.labelWidth)?r:null==(t=ae.props)?void 0:t.labelWidth;return o&&"auto"!==o?(o=parseInt(o+""),isNaN(o)||!x(o)?"":o-12-re.value-(z.value?11:0)):""})),ue=t((()=>k(e.labelRender)?"":y(e.label)?e.label:""));function de(){return te.value?n("section",{class:"form-render__formItemLabel"},[n("span",{class:"form-render__formItemLabel--text",style:{marginRight:f(re.value),maxWidth:f(ie.value)},title:ue.value},[k(e.labelRender)?e.labelRender(e.label):e.label]),re.value?n("section",{class:"form-render__formItemLabel--operation"},[e.remark?n("div",{class:"form-render__formItemLabel--tooltip"},[n(w,{message:e.remark},null)]):null,Z.value?n(P,{class:"form-render__formItemLabel--annotation",modelValue:J.value,"onUpdate:modelValue":e=>J.value=e,shortcuts:d(Q)},null):null,ee.value?n(j,{zIndex:3e3,raw:!0,showArrow:!1,trigger:"manual",placement:"top-start",show:le.value,contentStyle:"background-color:white;color:rgb(51, 54, 57);padding:8px;position:relative;"},{trigger:()=>n(M,{onClick:i((()=>le.value=!le.value),["stop","prev"]),text:!0,type:"primary"},{default:()=>[n("span",{style:"display:inline-block;margin-left:4px"},[u("提示")])]}),default:()=>{var l,t;return[n("div",{innerHTML:q(null!=(t=null==(l=e.fieldItem)?void 0:l.editor_title)?t:"")},null),n(M,{text:!0,onClick:()=>le.value=!le.value,style:"position:absolute;right:2px;top:2px;line-height:1;height:12px;transform:scaleY(0.9)"},{default:()=>[u("x")]})]}}):null]):null]):null}const se=t((()=>{let l=re.value;return z.value&&(l+=11),y(e.label)&&(l+=ie.value||m(e.label)),l})),me=l(W),{getSpan:fe}=N();function ve(){var l,t,r,o,n,a,i;const u="inner"===(null==(l=e.fieldItem)?void 0:l.childWidthMode)?e.span:fe(V,D.value.address,!1)+e.span;if("left"!==(null!=(r=b.labelPlacement)?r:null==(t=ae.props)?void 0:t.labelPlacement)||!d(me)||!(null==h?void 0:h.autoWidth)||"INPUT_GROUP"===(null==(n=null==(o=D.value.parent)?void 0:o.component)?void 0:n[0]))return u;if("INPUT_GROUP"===(null==(i=null==(a=D.value.parent)?void 0:a.component)?void 0:i[0]))return u;const s=16+me.value;let m=u*s-16-se.value;const f=x(null==h?void 0:h.autoWidth)?h.autoWidth:120;let v=u;for(;m<f&&v<12;)v++,m+=s;return v}function ce(){var l,t,r,o,a;const i=null==(l=e.fieldItem)?void 0:l.editor_title,u=!(null==(t=e.fieldItem)?void 0:t.editor_title_mode)||"EMBEDDED_FORM"===(null==(r=e.fieldItem)?void 0:r.editor_title_mode);return y(i)&&i&&u?n("section",{style:"display:flex;flex-direction:column;gap:4px"},[null==(a=s.default)?void 0:a.call(s),n("div",{innerHTML:q(i)},null)]):null==(o=s.default)?void 0:o.call(s)}function pe(){const e=[D.value.path+""];return D.value.form.query("*").forEach((l=>{(l.address+"").includes(D.value.address+"")&&((l.path+"").includes(D.value.path+"")||e.push(l.path+""))})),e}const be=t({get:()=>!(!(null==h?void 0:h.selectMode)||!g(null==h?void 0:h.selectedFields))&&h.selectedFields.includes(D.value.path+""),set(e){if(!g(null==h?void 0:h.selectedFields))return;let l=[...h.selectedFields];e?(l.push(...pe()),l=F(l)):pe().forEach((e=>{const t=l.indexOf(e);t>-1&&l.splice(t,1)})),null==U||U("update:selectedFields",l)}}),he=t((()=>(null==h?void 0:h.selectMode)&&!(D.value.parent&&"LINEBAR"!==D.value.parent.componentType)));function _e(){(null==h?void 0:h.selectMode)&&(be.value=!be.value)}const ye=t((()=>e.isOptionChildField?!!e.feedback&&" "!==e.feedback&&e.showFeedback:e.showFeedback));return()=>n(R,a({class:["form-render__formItem",{"form-render--no-border":!ne.value,"form-render--underline":"underline"===ne.value,"form-render__formItemMask":he.value,"form-render__formItemMask--selected":he.value&&be.value}],style:{"--form-item-column":ve()},showFeedback:ye.value,feedback:e.feedback,labelStyle:X.value},{id:$.value,uuid:V,onClick:_e,"widget-type":D.value.componentType,"field-key":A(G.value),"field-address":B(H.value),required:z.value}),{...s,default:ce,label:de})}}),h({title:"label"},((e,l)=>{const t=v(l)?void 0:s(l.selfErrors).length?function(e,l){if(!y(l.defined_error_msg)||!l.defined_error_msg)return e.map((e=>U(e,l))).join(",");return U(l.defined_error_msg,l)}(s(l.selfErrors),e.fieldItem):void 0;return{...e,fieldItem:void 0,feedback:t,"validation-status":t?"error":void 0}})));export{D as FORM_ITEM};
@@ -1 +1 @@
1
- import{defineComponent as e,computed as o,openBlock as s,createBlock as r,unref as i,withCtx as t,createVNode as n,createElementVNode as a,createElementBlock as l,Fragment as m,renderList as p,toDisplayString as g}from"vue";import{HelpCircleOutline as f}from"@vicons/ionicons5";import{isString as u}from"lodash-es";import{NTooltip as c}from"naive-ui";const d={style:{display:"inline-flex","flex-direction":"column"}};var v=e({__name:"tooltipMessage",props:{message:String},setup(e){const v=e,x=o((()=>u(v.message)?v.message.split("<br>"):[]));return(e,o)=>(s(),r(i(c),{trigger:"hover"},{trigger:t((()=>[n(i(f))])),default:t((()=>[a("section",d,[(s(!0),l(m,null,p(i(x),(e=>(s(),l("span",{key:e},g(e),1)))),128))])])),_:1}))}});export{v as default};
1
+ import{defineComponent as e,computed as s,openBlock as o,createBlock as r,unref as t,withCtx as i,renderSlot as n,createVNode as l,createElementVNode as a,createElementBlock as m,Fragment as p,renderList as g,toDisplayString as f}from"vue";import{HelpCircleOutline as u}from"@vicons/ionicons5";import{isString as c}from"lodash-es";import{NTooltip as d}from"naive-ui";const v={style:{display:"inline-flex","flex-direction":"column"}};var x=e({__name:"tooltipMessage",props:{message:String},setup(e){const x=e,y=s((()=>c(x.message)?x.message.split("<br>"):[]));return(e,s)=>(o(),r(t(d),{trigger:"hover"},{trigger:i((()=>[n(e.$slots,"trigger",{},(()=>[l(t(u))]))])),default:i((()=>[a("section",v,[(o(!0),m(p,null,g(t(y),(e=>(o(),m("span",{key:e},f(e),1)))),128))])])),_:3}))}});export{x as default};
@@ -131,6 +131,7 @@ export type FieldItem = {
131
131
  bordered: boolean | string;
132
132
  displayMode: 'table' | 'form';
133
133
  editor_title: string;
134
+ editor_title_mode: 'EMBEDDED_FORM' | 'HOVER_TOOLTIP' | 'POPUP_ALERT';
134
135
  linebarWidth: string;
135
136
  linebarDirection: 'horizontal' | 'vertical';
136
137
  linebarTextDirection: 'horizontal' | 'vertical';
@@ -652,12 +652,14 @@ declare const IhoChat: SFCWithInstall<import("vue").DefineComponent<{
652
652
  setScrollToButtom: () => Promise<void>;
653
653
  resetInfo: () => void;
654
654
  setReferenceMsg: (msgItem: import("../../shared/types").AnyObject) => void;
655
+ handleSelect: (key: string, msgItem: import("../../shared/types").AnyObject) => void;
655
656
  NAvatar: any;
656
657
  NImageGroup: any;
657
658
  NImage: any;
658
659
  NIcon: any;
659
660
  NButtonGroup: any;
660
661
  NButton: any;
662
+ NFlex: any;
661
663
  PersonProfile: import("vue").DefineComponent<{
662
664
  userId: {
663
665
  type: StringConstructor;
@@ -838,18 +840,18 @@ declare const IhoChat: SFCWithInstall<import("vue").DefineComponent<{
838
840
  }, {
839
841
  show: boolean;
840
842
  }>;
841
- downloadFile: typeof import("./src/utils").downloadFile;
842
843
  simplifyMessage: typeof import("./src/utils").simplifyMessage;
843
844
  isAudioOrVideoMessage: typeof import("./src/utils").isAudioOrVideoMessage;
844
845
  getAVTime: typeof import("./src/utils").getAVTime;
845
846
  MESSAGE_TYPE: typeof import("./src/constants").MESSAGE_TYPE;
846
847
  ChatbubbleEllipsesOutline: 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<{}>>, {}>;
848
+ EllipsisHorizontal: 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<{}>>, {}>;
847
849
  CallOutline: 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<{}>>, {}>;
848
850
  VideocamOutline: 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<{}>>, {}>;
851
+ DocumentSharp: 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<{}>>, {}>;
849
852
  }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
850
853
  ChatFooter: import("vue").DefineComponent<{}, {
851
854
  inputRef: import("vue").Ref<HTMLDivElement | undefined>;
852
- content: import("vue").Ref<string>;
853
855
  state: import("./src/types").IState;
854
856
  sendMessage: (message: {
855
857
  chatType?: string | undefined;
@@ -858,6 +860,7 @@ declare const IhoChat: SFCWithInstall<import("vue").DefineComponent<{
858
860
  }) => Promise<void>;
859
861
  isGroupChat: import("vue").ComputedRef<boolean>;
860
862
  showEmoji: import("vue").Ref<boolean>;
863
+ content: import("vue").Ref<string>;
861
864
  chatAddProps: import("vue").ComputedRef<{
862
865
  options: import("../../shared/types").AnyObject[];
863
866
  defaultValue: import("../../shared/types").AnyObject[];
@@ -1141,6 +1144,20 @@ declare const IhoChat: SFCWithInstall<import("vue").DefineComponent<{
1141
1144
  timer: any;
1142
1145
  seconds: number;
1143
1146
  };
1147
+ installEventHandlers: ({ handleError, handleRemoteUserEnter, handleRemoteAudioAvailable, handleRemoteUserExit, handleRemoteVideoAvailable }: {
1148
+ handleError: import("../../shared/types").AnyFn;
1149
+ handleRemoteUserEnter: import("../../shared/types").AnyFn;
1150
+ handleRemoteAudioAvailable: import("../../shared/types").AnyFn;
1151
+ handleRemoteUserExit: import("../../shared/types").AnyFn;
1152
+ handleRemoteVideoAvailable: import("../../shared/types").AnyFn;
1153
+ }) => void;
1154
+ uninstallEventHandlers: ({ handleError, handleRemoteUserEnter, handleRemoteAudioAvailable, handleRemoteUserExit, handleRemoteVideoAvailable }: {
1155
+ handleError: import("../../shared/types").AnyFn;
1156
+ handleRemoteUserEnter: import("../../shared/types").AnyFn;
1157
+ handleRemoteAudioAvailable: import("../../shared/types").AnyFn;
1158
+ handleRemoteUserExit: import("../../shared/types").AnyFn;
1159
+ handleRemoteVideoAvailable: import("../../shared/types").AnyFn;
1160
+ }) => void;
1144
1161
  videoRef: import("vue").Ref<any>;
1145
1162
  selfVideoRef: import("vue").Ref<any>;
1146
1163
  isConnect: import("vue").Ref<boolean>;
@@ -1157,8 +1174,6 @@ declare const IhoChat: SFCWithInstall<import("vue").DefineComponent<{
1157
1174
  handleEnter: () => Promise<void>;
1158
1175
  handleFinish: () => void;
1159
1176
  handleExit: () => Promise<void>;
1160
- installEventHandlers: () => void;
1161
- uninstallEventHandlers: () => void;
1162
1177
  handleRemoteVideoAvailable: (event: any) => Promise<void>;
1163
1178
  handleRemoteAudioAvailable: (event: any) => void;
1164
1179
  handleRemoteUserEnter: () => void;
@@ -1195,6 +1210,20 @@ declare const IhoChat: SFCWithInstall<import("vue").DefineComponent<{
1195
1210
  timing: import("vue").Ref<string>;
1196
1211
  toggleVideo: () => Promise<void>;
1197
1212
  videocamOpen: import("vue").Ref<boolean>;
1213
+ installEventHandlers: ({ handleError, handleRemoteUserEnter, handleRemoteAudioAvailable, handleRemoteUserExit, handleRemoteVideoAvailable }: {
1214
+ handleError: import("../../shared/types").AnyFn;
1215
+ handleRemoteUserEnter: import("../../shared/types").AnyFn;
1216
+ handleRemoteAudioAvailable: import("../../shared/types").AnyFn;
1217
+ handleRemoteUserExit: import("../../shared/types").AnyFn;
1218
+ handleRemoteVideoAvailable: import("../../shared/types").AnyFn;
1219
+ }) => void;
1220
+ uninstallEventHandlers: ({ handleError, handleRemoteUserEnter, handleRemoteAudioAvailable, handleRemoteUserExit, handleRemoteVideoAvailable }: {
1221
+ handleError: import("../../shared/types").AnyFn;
1222
+ handleRemoteUserEnter: import("../../shared/types").AnyFn;
1223
+ handleRemoteAudioAvailable: import("../../shared/types").AnyFn;
1224
+ handleRemoteUserExit: import("../../shared/types").AnyFn;
1225
+ handleRemoteVideoAvailable: import("../../shared/types").AnyFn;
1226
+ }) => void;
1198
1227
  isConnect: import("vue").Ref<boolean>;
1199
1228
  callUser: import("vue").ComputedRef<any>;
1200
1229
  title: import("vue").ComputedRef<string>;
@@ -1202,8 +1231,6 @@ declare const IhoChat: SFCWithInstall<import("vue").DefineComponent<{
1202
1231
  handleCall: () => void;
1203
1232
  handleEnter: () => Promise<void>;
1204
1233
  handleExit: () => Promise<void>;
1205
- installEventHandlers: () => void;
1206
- uninstallEventHandlers: () => void;
1207
1234
  handleRemoteVideoAvailable: (event: any) => Promise<void>;
1208
1235
  handleRemoteAudioAvailable: (event: any) => Promise<void>;
1209
1236
  handleRemoteUserEnter: (event: any) => Promise<void>;
@@ -657,12 +657,14 @@ declare const _default: import("vue").DefineComponent<{
657
657
  setScrollToButtom: () => Promise<void>;
658
658
  resetInfo: () => void;
659
659
  setReferenceMsg: (msgItem: AnyObject) => void;
660
+ handleSelect: (key: string, msgItem: AnyObject) => void;
660
661
  NAvatar: any;
661
662
  NImageGroup: any;
662
663
  NImage: any;
663
664
  NIcon: any;
664
665
  NButtonGroup: any;
665
666
  NButton: any;
667
+ NFlex: any;
666
668
  PersonProfile: import("vue").DefineComponent<{
667
669
  userId: {
668
670
  type: StringConstructor;
@@ -843,18 +845,18 @@ declare const _default: import("vue").DefineComponent<{
843
845
  }, {
844
846
  show: boolean;
845
847
  }>;
846
- downloadFile: typeof import("./utils").downloadFile;
847
848
  simplifyMessage: typeof import("./utils").simplifyMessage;
848
849
  isAudioOrVideoMessage: typeof isAudioOrVideoMessage;
849
850
  getAVTime: typeof import("./utils").getAVTime;
850
851
  MESSAGE_TYPE: typeof import("./constants").MESSAGE_TYPE;
851
852
  ChatbubbleEllipsesOutline: 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<{}>>, {}>;
853
+ EllipsisHorizontal: 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<{}>>, {}>;
852
854
  CallOutline: 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<{}>>, {}>;
853
855
  VideocamOutline: 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<{}>>, {}>;
856
+ DocumentSharp: 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<{}>>, {}>;
854
857
  }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
855
858
  ChatFooter: import("vue").DefineComponent<{}, {
856
859
  inputRef: import("vue").Ref<HTMLDivElement | undefined>;
857
- content: import("vue").Ref<string>;
858
860
  state: IState;
859
861
  sendMessage: (message: {
860
862
  chatType?: string | undefined;
@@ -863,6 +865,7 @@ declare const _default: import("vue").DefineComponent<{
863
865
  }) => Promise<void>;
864
866
  isGroupChat: import("vue").ComputedRef<boolean>;
865
867
  showEmoji: import("vue").Ref<boolean>;
868
+ content: import("vue").Ref<string>;
866
869
  chatAddProps: import("vue").ComputedRef<{
867
870
  options: AnyObject[];
868
871
  defaultValue: AnyObject[];
@@ -1146,6 +1149,20 @@ declare const _default: import("vue").DefineComponent<{
1146
1149
  timer: any;
1147
1150
  seconds: number;
1148
1151
  };
1152
+ installEventHandlers: ({ handleError, handleRemoteUserEnter, handleRemoteAudioAvailable, handleRemoteUserExit, handleRemoteVideoAvailable }: {
1153
+ handleError: import("../../../shared/types").AnyFn;
1154
+ handleRemoteUserEnter: import("../../../shared/types").AnyFn;
1155
+ handleRemoteAudioAvailable: import("../../../shared/types").AnyFn;
1156
+ handleRemoteUserExit: import("../../../shared/types").AnyFn;
1157
+ handleRemoteVideoAvailable: import("../../../shared/types").AnyFn;
1158
+ }) => void;
1159
+ uninstallEventHandlers: ({ handleError, handleRemoteUserEnter, handleRemoteAudioAvailable, handleRemoteUserExit, handleRemoteVideoAvailable }: {
1160
+ handleError: import("../../../shared/types").AnyFn;
1161
+ handleRemoteUserEnter: import("../../../shared/types").AnyFn;
1162
+ handleRemoteAudioAvailable: import("../../../shared/types").AnyFn;
1163
+ handleRemoteUserExit: import("../../../shared/types").AnyFn;
1164
+ handleRemoteVideoAvailable: import("../../../shared/types").AnyFn;
1165
+ }) => void;
1149
1166
  videoRef: import("vue").Ref<any>;
1150
1167
  selfVideoRef: import("vue").Ref<any>;
1151
1168
  isConnect: import("vue").Ref<boolean>;
@@ -1162,8 +1179,6 @@ declare const _default: import("vue").DefineComponent<{
1162
1179
  handleEnter: () => Promise<void>;
1163
1180
  handleFinish: () => void;
1164
1181
  handleExit: () => Promise<void>;
1165
- installEventHandlers: () => void;
1166
- uninstallEventHandlers: () => void;
1167
1182
  handleRemoteVideoAvailable: (event: any) => Promise<void>;
1168
1183
  handleRemoteAudioAvailable: (event: any) => void;
1169
1184
  handleRemoteUserEnter: () => void;
@@ -1200,6 +1215,20 @@ declare const _default: import("vue").DefineComponent<{
1200
1215
  timing: import("vue").Ref<string>;
1201
1216
  toggleVideo: () => Promise<void>;
1202
1217
  videocamOpen: import("vue").Ref<boolean>;
1218
+ installEventHandlers: ({ handleError, handleRemoteUserEnter, handleRemoteAudioAvailable, handleRemoteUserExit, handleRemoteVideoAvailable }: {
1219
+ handleError: import("../../../shared/types").AnyFn;
1220
+ handleRemoteUserEnter: import("../../../shared/types").AnyFn;
1221
+ handleRemoteAudioAvailable: import("../../../shared/types").AnyFn;
1222
+ handleRemoteUserExit: import("../../../shared/types").AnyFn;
1223
+ handleRemoteVideoAvailable: import("../../../shared/types").AnyFn;
1224
+ }) => void;
1225
+ uninstallEventHandlers: ({ handleError, handleRemoteUserEnter, handleRemoteAudioAvailable, handleRemoteUserExit, handleRemoteVideoAvailable }: {
1226
+ handleError: import("../../../shared/types").AnyFn;
1227
+ handleRemoteUserEnter: import("../../../shared/types").AnyFn;
1228
+ handleRemoteAudioAvailable: import("../../../shared/types").AnyFn;
1229
+ handleRemoteUserExit: import("../../../shared/types").AnyFn;
1230
+ handleRemoteVideoAvailable: import("../../../shared/types").AnyFn;
1231
+ }) => void;
1203
1232
  isConnect: import("vue").Ref<boolean>;
1204
1233
  callUser: import("vue").ComputedRef<any>;
1205
1234
  title: import("vue").ComputedRef<string>;
@@ -1207,8 +1236,6 @@ declare const _default: import("vue").DefineComponent<{
1207
1236
  handleCall: () => void;
1208
1237
  handleEnter: () => Promise<void>;
1209
1238
  handleExit: () => Promise<void>;
1210
- installEventHandlers: () => void;
1211
- uninstallEventHandlers: () => void;
1212
1239
  handleRemoteVideoAvailable: (event: any) => Promise<void>;
1213
1240
  handleRemoteAudioAvailable: (event: any) => Promise<void>;
1214
1241
  handleRemoteUserEnter: (event: any) => Promise<void>;
@@ -8,7 +8,6 @@ type FileOptions = {
8
8
  };
9
9
  declare const _default: import("vue").DefineComponent<{}, {
10
10
  inputRef: import("vue").Ref<HTMLDivElement | undefined>;
11
- content: import("vue").Ref<string>;
12
11
  state: import("../types").IState;
13
12
  sendMessage: (message: {
14
13
  chatType?: string | undefined;
@@ -17,6 +16,7 @@ declare const _default: import("vue").DefineComponent<{}, {
17
16
  }) => Promise<void>;
18
17
  isGroupChat: import("vue").ComputedRef<boolean>;
19
18
  showEmoji: import("vue").Ref<boolean>;
19
+ content: import("vue").Ref<string>;
20
20
  chatAddProps: import("vue").ComputedRef<{
21
21
  options: AnyObject[];
22
22
  defaultValue: AnyObject[];
@@ -1 +1 @@
1
- import{defineComponent as e,ref as t,computed as n,watch as o,withDirectives as i,openBlock as s,createElementBlock as r,normalizeStyle as a,unref as c,createElementVNode as l,toDisplayString as u,createVNode as d,createCommentVNode as f,withCtx as m,Fragment as p,renderList as g,createBlock as y,createTextVNode as h,mergeProps as v,vShow as M}from"vue";import{NIcon as k,NPopover as C,NButton as _,NTooltip as x,NUpload as I,NUploadTrigger as b}from"naive-ui";import w from"./ChatAdd.vue.js";import{useState as T}from"../hooks/useState.js";import{useSession as z}from"../hooks/useSession.js";import{MESSAGE_TYPE as E,AV_STATUS as j}from"../constants/index.js";import"trtc-sdk-v5";import{simplifyMessage as R}from"../utils/index.js";import{emojis as q}from"../utils/emoji.js";import{uploadFileApi as L}from"../api/index.js";import{CloseCircleOutline as D,CallOutline as O,VideocamOutline as V}from"@vicons/ionicons5";import{xor as A,cloneDeep as F}from"lodash-es";import{uuidGenerator as K}from"../../../../shared/utils/index.js";const U={key:0,class:"reference-content-box"},S={class:"reference-content"},G=["innerHTML"],H={class:"tool-box"},N=l("i",{class:"chat--iconfont chat--icon-face"},null,-1),J={class:"emoji-box"},X=l("span",null,"默认表情",-1),B={class:"list-box"},P=["src"],Q=l("i",{class:"chat--iconfont chat--icon-good"},null,-1),W=l("i",{class:"chat--iconfont chat--icon-image"},null,-1),Y=l("i",{class:"chat--iconfont chat--icon-folder"},null,-1),Z={class:"btn-box"},$=l("span",{class:"tip"},"Enter 发送, Shift + Enter 换行",-1);var ee=e({__name:"ChatFooter",setup(e){const ee=t(),te=t(""),{state:ne,sendMessage:oe}=T(),{isGroupChat:ie}=z(ne),se=t(!1),re=n((()=>({options:ne.currentGroupUser,defaultValue:[ne.userInfo]})));function ae(e,t=[]){const n=K(),o=[],i=t.length>0;ne.showVideo||ne.showMultipleVideo||(i?(o.push(...A(t,[ne.userInfo.id])),Object.assign(ne.currentAVMsg,{callMode:"call",checkedIds:o,strRoomId:n,chatMessageType:e}),ne.showMultipleVideo=!0):oe({content:{chatMessageType:e,msg:"",avStatus:j.IN_CALL}}))}function ce(e){["Enter"].includes(e.key)&&(function(e){return e.altKey||e.ctrlKey||e.metaKey||e.shiftKey}(e)||(e.preventDefault(),de()))}function le(){var e,t;te.value=(null==(t=null==(e=ee.value)?void 0:e.innerText)?void 0:t.trim())||""}async function ue(e,t){const{file:n,name:o}=e.file,i=new FormData;i.append("sender",ne.userInfo.id),i.append("file",n);const s=await L(i);if(!s)return console.log("上传失败");fe({chatMessageType:t,msg:t===E.FILE?o:s,url:s})}function de(){if(!(te.value.length>2e3))return te.value?void fe({msg:te.value}):console.log("请输入内容");console.log("请控制在2000字以内")}async function fe(e){const{chatMessageType:t=E.TEXT,msg:n,url:o}=e,i={msg:n,chatMessageType:t};t===E.FILE&&(i.fileUrl=o),[E.TEXT,E.BLEND].includes(t)&&(ee.value.innerHTML="",te.value=""),ne.currentReferenceMsg&&(i.referenceContent=F(ne.currentReferenceMsg),ne.currentReferenceMsg=null),oe({content:i})}return o((()=>ne.currentReferenceMsg),(e=>{var t;e&&(null==(t=ee.value)||t.focus())})),(e,t)=>i((s(),r("section",{class:"chat-footer",style:a({cursor:c(ne).id?"default":"not-allowed"})},[c(ne).currentReferenceMsg?(s(),r("div",U,[l("div",S,[l("span",null,u(c(ne).currentReferenceMsg.senderName)+":",1),l("pre",{innerHTML:c(R)(c(ne).currentReferenceMsg.content)},null,8,G)]),d(c(k),{component:c(D),onClick:t[0]||(t[0]=()=>c(ne).currentReferenceMsg=null)},null,8,["component"])])):f("v-if",!0),l("div",H,[d(c(C),{show:se.value,"onUpdate:show":t[1]||(t[1]=e=>se.value=e),placement:"top",trigger:"click","show-arrow":!1,"display-directive":"show",delay:0},{trigger:m((()=>[d(c(_),{quaternary:"",size:"tiny"},{icon:m((()=>[N])),_:1})])),default:m((()=>[l("div",J,[f(' <span>最近使用</span>\n\t\t\t\t\t<div class="list-box">\n\t\t\t\t\t\t<template v-for="(img, index) in images" :key="index">\n\t\t\t\t\t\t\t<i>\n\t\t\t\t\t\t\t\t<img :src="img" />\n\t\t\t\t\t\t\t</i>\n\t\t\t\t\t\t</template>\n\t\t\t\t\t</div> '),X,l("div",B,[(s(!0),r(p,null,g(c(q).default,(([e,t])=>(s(),y(c(x),{key:e,"show-arrow":!1,trigger:"hover"},{trigger:m((()=>[d(c(_),{quaternary:"",size:"tiny",onClick:()=>function(e){se.value=!1,fe({chatMessageType:E.EMOJI,msg:e})}(e)},{icon:m((()=>[l("img",{src:t},null,8,P)])),_:2},1032,["onClick"])])),default:m((()=>[h(" "+u(e),1)])),_:2},1024)))),128))])])])),_:1},8,["show"]),d(c(_),{quaternary:"",size:"tiny",onClick:t[2]||(t[2]=()=>fe({chatMessageType:c(E).EMOJI,msg:0}))},{icon:m((()=>[Q])),_:1}),d(c(I),{abstract:"",multiple:"",accept:"image/*",onChange:t[3]||(t[3]=e=>ue(e,c(E).IMAGE))},{default:m((()=>[d(c(b),{abstract:""},{default:m((({handleClick:e})=>[d(c(_),{quaternary:"",size:"tiny",onClick:e},{icon:m((()=>[W])),_:2},1032,["onClick"])])),_:1})])),_:1}),d(c(I),{abstract:"",multiple:"",accept:"video/*,.pdf,.doc.docx,,.zip,.xlsx,.txt",onChange:t[4]||(t[4]=e=>ue(e,c(E).FILE))},{default:m((()=>[d(c(b),{abstract:""},{default:m((({handleClick:e})=>[d(c(_),{quaternary:"",size:"tiny",onClick:e},{icon:m((()=>[Y])),_:2},1032,["onClick"])])),_:1})])),_:1}),c(ie)?(s(),r(p,{key:0},[d(w,v(c(re),{onComfirm:t[5]||(t[5]=e=>ae(c(E).AUDIO,e))}),{trigger:m((()=>[d(c(_),{quaternary:"",size:"tiny"},{icon:m((()=>[d(c(k),{size:"18",component:c(O)},null,8,["component"])])),_:1})])),_:1},16),d(w,v(c(re),{onComfirm:t[6]||(t[6]=e=>ae(c(E).VIDEO,e))}),{trigger:m((()=>[d(c(_),{quaternary:"",size:"tiny"},{icon:m((()=>[d(c(k),{size:"20",component:c(V)},null,8,["component"])])),_:1})])),_:1},16)],64)):(s(),r(p,{key:1},[d(c(_),{quaternary:"",size:"tiny",onClick:t[7]||(t[7]=()=>ae(c(E).AUDIO))},{icon:m((()=>[d(c(k),{size:"18",component:c(O)},null,8,["component"])])),_:1}),d(c(_),{quaternary:"",size:"tiny",onClick:t[8]||(t[8]=()=>ae(c(E).VIDEO))},{icon:m((()=>[d(c(k),{size:"20",component:c(V)},null,8,["component"])])),_:1})],64))]),i(l("div",{ref_key:"inputRef",ref:ee,class:"input-box",contenteditable:"",onKeydown:ce,onInput:le},null,544),[[M,c(ne).id]]),l("div",Z,[$,d(c(_),{type:"primary",round:"",disabled:!te.value,onClick:de},{default:m((()=>[h("发送")])),_:1},8,["disabled"])])],4)),[[M,c(ne).id]])}});export{ee as default};
1
+ import{defineComponent as e,ref as t,computed as n,watch as o,withDirectives as i,openBlock as s,createElementBlock as r,normalizeStyle as c,unref as a,createElementVNode as l,toDisplayString as u,createVNode as m,createCommentVNode as d,withCtx as f,Fragment as p,renderList as g,createBlock as h,createTextVNode as y,mergeProps as v,vShow as M}from"vue";import{NIcon as k,NPopover as C,NButton as _,NTooltip as I,NUpload as x,NUploadTrigger as T}from"naive-ui";import b from"./ChatAdd.vue.js";import{useState as E}from"../hooks/useState.js";import{useSession as w}from"../hooks/useSession.js";import{MESSAGE_TYPE as z,AV_STATUS as L}from"../constants/index.js";import"trtc-sdk-v5";import{simplifyMessage as j}from"../utils/index.js";import{emojis as R}from"../utils/emoji.js";import{uploadFileApi as q}from"../api/index.js";import{CloseCircleOutline as O,CallOutline as D,VideocamOutline as A}from"@vicons/ionicons5";import{xor as V,cloneDeep as K}from"lodash-es";import{uuidGenerator as F}from"../../../../shared/utils/index.js";const H={key:0,class:"reference-content-box"},U={class:"reference-content"},G=["innerHTML"],J={class:"tool-box"},N=l("i",{class:"chat--iconfont chat--icon-face"},null,-1),S={class:"emoji-box"},X=l("span",null,"默认表情",-1),B={class:"list-box"},$=["src"],P=l("i",{class:"chat--iconfont chat--icon-good"},null,-1),Q=l("i",{class:"chat--iconfont chat--icon-image"},null,-1),W=l("i",{class:"chat--iconfont chat--icon-folder"},null,-1),Y={class:"btn-box"},Z=l("span",{class:"tip"},"Enter 发送, Ctrl + Enter 换行",-1);var ee=e({__name:"ChatFooter",setup(e){const ee=t(),{state:te,sendMessage:ne}=E(),{isGroupChat:oe}=w(te),ie=t(!1),se=t(""),re=n((()=>({options:te.currentGroupUser,defaultValue:[te.userInfo]})));function ce(e,t=[]){const n=F(),o=[],i=t.length>0;te.showVideo||te.showMultipleVideo||(i?(o.push(...V(t,[te.userInfo.id])),Object.assign(te.currentAVMsg,{callMode:"call",checkedIds:o,strRoomId:n,chatMessageType:e}),te.showMultipleVideo=!0):ne({content:{chatMessageType:e,msg:"",avStatus:L.IN_CALL}}))}function ae(e){["Enter"].includes(e.key)&&(e.ctrlKey&&(e.preventDefault(),document.execCommand("InsertLineBreak")),function(e){return e.altKey||e.ctrlKey||e.metaKey||e.shiftKey}(e)||(e.preventDefault(),me()))}function le(){var e;se.value=(null==(e=ee.value)?void 0:e.innerHTML)||""}async function ue(e,t){const{file:n,name:o}=e.file,i=new FormData;i.append("sender",te.userInfo.id),i.append("file",n);const s=await q(i);if(!s)return console.log("上传失败");de({chatMessageType:t,msg:t===z.FILE?o:s,url:s})}function me(){const{innerHTML:e="",innerText:t=""}=ee.value||{};if(se.value.trim().length>2e3)return void console.log("请控制在2000字以内");if(!se.value)return console.log("请输入内容");const n=e.split(t).find((e=>!!e));let o=z.TEXT,i="";if(n){if(t.replace(/\n$/,"")||(e.match(/<img[^>]*>/gi)||[]).length>1)o=z.BLEND,i=e;else if(e.includes(z.EMOJI)){o=z.EMOJI;const t=e.match(/data-msg\s*=\s*"([^"]*)"/);t&&(i=t[1])}else{o=z.IMAGE;const t=e.match(/src\s*=\s*"([^"]*)"/);t&&(i=t[1])}}else i=t.trim();i&&de({msg:i,chatMessageType:o,origin:"btn"})}async function de(e){const{chatMessageType:t=z.TEXT,msg:n,url:o,origin:i=""}=e,s={msg:n,chatMessageType:t};t===z.FILE&&(s.fileUrl=o),"btn"===i&&(ee.value.innerHTML="",se.value=""),te.currentReferenceMsg&&(t===z.TEXT&&(s.referenceContent=K(te.currentReferenceMsg)),te.currentReferenceMsg=null),ne({content:s})}return o((()=>te.currentReferenceMsg),(e=>{var t;e&&(null==(t=ee.value)||t.focus())})),(e,t)=>i((s(),r("section",{class:"chat-footer",style:c({cursor:a(te).id?"default":"not-allowed"})},[a(te).currentReferenceMsg?(s(),r("div",H,[l("div",U,[l("span",null,u(a(te).currentReferenceMsg.senderName)+":",1),l("pre",{innerHTML:a(j)(a(te).currentReferenceMsg.content)},null,8,G)]),m(a(k),{component:a(O),onClick:t[0]||(t[0]=()=>a(te).currentReferenceMsg=null)},null,8,["component"])])):d("v-if",!0),l("div",J,[m(a(C),{show:ie.value,"onUpdate:show":t[1]||(t[1]=e=>ie.value=e),placement:"top",trigger:"click","show-arrow":!1,"display-directive":"show",delay:0},{trigger:f((()=>[m(a(_),{quaternary:"",size:"tiny"},{icon:f((()=>[N])),_:1})])),default:f((()=>[l("div",S,[d(' <span>最近使用</span>\n\t\t\t\t\t<div class="list-box">\n\t\t\t\t\t\t<template v-for="(img, index) in images" :key="index">\n\t\t\t\t\t\t\t<i>\n\t\t\t\t\t\t\t\t<img :src="img" />\n\t\t\t\t\t\t\t</i>\n\t\t\t\t\t\t</template>\n\t\t\t\t\t</div> '),X,l("div",B,[(s(!0),r(p,null,g(a(R).default,(([e,t])=>(s(),h(a(I),{key:e,"show-arrow":!1,trigger:"hover"},{trigger:f((()=>[m(a(_),{quaternary:"",size:"tiny",onClick:()=>function(e){ie.value=!1,de({chatMessageType:z.EMOJI,msg:e})}(e)},{icon:f((()=>[l("img",{src:t},null,8,$)])),_:2},1032,["onClick"])])),default:f((()=>[y(" "+u(e),1)])),_:2},1024)))),128))])])])),_:1},8,["show"]),m(a(_),{quaternary:"",size:"tiny",onClick:t[2]||(t[2]=()=>de({chatMessageType:a(z).EMOJI,msg:0}))},{icon:f((()=>[P])),_:1}),m(a(x),{abstract:"",multiple:"",accept:"image/*",onChange:t[3]||(t[3]=e=>ue(e,a(z).IMAGE))},{default:f((()=>[m(a(T),{abstract:""},{default:f((({handleClick:e})=>[m(a(_),{quaternary:"",size:"tiny",onClick:e},{icon:f((()=>[Q])),_:2},1032,["onClick"])])),_:1})])),_:1}),m(a(x),{abstract:"",multiple:"",accept:"video/*,.pdf,.doc.docx,,.zip,.xlsx,.txt",onChange:t[4]||(t[4]=e=>ue(e,a(z).FILE))},{default:f((()=>[m(a(T),{abstract:""},{default:f((({handleClick:e})=>[m(a(_),{quaternary:"",size:"tiny",onClick:e},{icon:f((()=>[W])),_:2},1032,["onClick"])])),_:1})])),_:1}),a(oe)?(s(),r(p,{key:0},[m(b,v(a(re),{onComfirm:t[5]||(t[5]=e=>ce(a(z).AUDIO,e))}),{trigger:f((()=>[m(a(_),{quaternary:"",size:"tiny"},{icon:f((()=>[m(a(k),{size:"18",component:a(D)},null,8,["component"])])),_:1})])),_:1},16),m(b,v(a(re),{onComfirm:t[6]||(t[6]=e=>ce(a(z).VIDEO,e))}),{trigger:f((()=>[m(a(_),{quaternary:"",size:"tiny"},{icon:f((()=>[m(a(k),{size:"20",component:a(A)},null,8,["component"])])),_:1})])),_:1},16)],64)):(s(),r(p,{key:1},[m(a(_),{quaternary:"",size:"tiny",onClick:t[7]||(t[7]=()=>ce(a(z).AUDIO))},{icon:f((()=>[m(a(k),{size:"18",component:a(D)},null,8,["component"])])),_:1}),m(a(_),{quaternary:"",size:"tiny",onClick:t[8]||(t[8]=()=>ce(a(z).VIDEO))},{icon:f((()=>[m(a(k),{size:"20",component:a(A)},null,8,["component"])])),_:1})],64))]),i(l("div",{ref_key:"inputRef",ref:ee,class:"input-box",contenteditable:"",onKeydown:ae,onInput:le},null,544),[[M,a(te).id]]),l("div",Y,[Z,m(a(_),{type:"primary",round:"",disabled:!se.value,onClick:me},{default:f((()=>[y("发送")])),_:1},8,["disabled"])])],4)),[[M,a(te).id]])}});export{ee as default};