cnhis-design-vue 3.2.19-beta.8 → 3.3.1-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/components/ai-chat/index.d.ts +147 -17
- package/es/components/ai-chat/src/Index.vue.d.ts +147 -17
- package/es/components/ai-chat/src/Index.vue2.js +1 -1
- package/es/components/ai-chat/src/api/index.d.ts +6 -0
- package/es/components/ai-chat/src/api/index.js +1 -0
- package/es/components/ai-chat/src/components/ChatAudio.vue.d.ts +44 -0
- package/es/components/ai-chat/src/components/ChatAudio.vue.js +1 -0
- package/es/components/ai-chat/src/components/ChatAudio.vue2.js +1 -0
- package/es/components/ai-chat/src/components/ChatCard.js +1 -1
- package/es/components/ai-chat/src/components/ChatFooter.vue.d.ts +55 -2
- package/es/components/ai-chat/src/components/ChatFooter.vue2.js +1 -1
- package/es/components/ai-chat/src/components/ChatMain.d.ts +1 -7
- package/es/components/ai-chat/src/components/ChatMain.js +1 -1
- package/es/components/ai-chat/src/components/ChatMainInner.d.ts +2 -0
- package/es/components/ai-chat/src/components/ChatMainInner.js +1 -0
- package/es/components/ai-chat/src/components/ChatRight.vue.d.ts +56 -0
- package/es/components/ai-chat/src/components/ChatRight.vue.js +1 -0
- package/es/components/ai-chat/src/components/ChatRight.vue2.js +1 -0
- package/es/components/ai-chat/src/components/card/JsonCard.d.ts +25 -0
- package/es/components/ai-chat/src/components/card/JsonCard.js +1 -0
- package/es/components/ai-chat/src/components/card/SelectIcon.d.ts +14 -0
- package/es/components/ai-chat/src/components/card/SelectIcon.js +1 -0
- package/es/components/ai-chat/src/hooks/useProgram.d.ts +6 -0
- package/es/components/ai-chat/src/hooks/useProgram.js +1 -0
- package/es/components/ai-chat/src/hooks/useWebsocket.d.ts +2 -0
- package/es/components/ai-chat/src/hooks/useWebsocket.js +1 -0
- package/es/components/ai-chat/src/utils/index.d.ts +1 -0
- package/es/components/ai-chat/src/utils/index.js +1 -1
- package/es/components/ai-chat/style/index.css +1 -1
- package/es/components/audio-sdk/src/audioSDK.d.ts +6 -7
- package/es/components/audio-sdk/src/audioSDK.js +1 -1
- package/es/components/audio-sdk/src/utils/recordingModal.d.ts +2 -1
- package/es/components/audio-sdk/src/utils/recordingModal.js +1 -1
- package/es/components/editor/src/Editor.js +1 -1
- package/es/components/editor/style/index.css +1 -0
- package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useOther.js +1 -1
- package/es/components/fabric-chart/src/hooks/temperature/useLeft.js +1 -1
- package/es/components/fabric-chart/src/hooks/useGrid.js +1 -1
- package/es/components/iho-table/src/plugins/filterRemoteSearchPlugin/index.d.ts +1 -0
- package/es/components/iho-table/src/plugins/filterRemoteSearchPlugin/index.js +1 -0
- package/es/components/iho-table/src/plugins/filterRemoteSearchPlugin/remoteFilter.vue.d.ts +68 -0
- package/es/components/iho-table/src/plugins/filterRemoteSearchPlugin/remoteFilter.vue.js +1 -0
- package/es/components/iho-table/src/plugins/filterRemoteSearchPlugin/remoteFilter.vue2.js +1 -0
- package/es/components/iho-table/src/plugins/filterRenderPlugin/filter.vue.d.ts +7 -9
- package/es/components/iho-table/src/plugins/filterRenderPlugin/filter.vue2.js +1 -1
- package/es/components/iho-table/src/plugins/index.js +1 -1
- package/es/components/iho-table/src/plugins/pluginHooks/index.d.ts +1 -0
- package/es/components/iho-table/src/plugins/pluginHooks/index.js +1 -0
- package/es/components/iho-table/src/plugins/pluginHooks/useFilter.d.ts +21 -0
- package/es/components/iho-table/src/plugins/pluginHooks/useFilter.js +1 -0
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/levelSearchCascadePlugin/levelSearchCascade.vue.d.ts +13 -0
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/levelSearchCascadePlugin/levelSearchCascade.vue2.js +1 -1
- package/es/components/iho-table/src/plugins/verticalTablePlugin/src/hooks/index.js +1 -1
- package/es/components/iho-table/src/types/index.d.ts +3 -1
- package/es/components/iho-table/src/utils/index.d.ts +1 -0
- package/es/components/iho-table/src/utils/index.js +1 -1
- package/es/components/index.css +1 -1
- package/es/shared/assets/img/file-emr.png.js +1 -0
- package/es/shared/assets/img/file.png.js +1 -0
- package/es/shared/assets/img/use.png.js +1 -0
- package/es/shared/package.json.js +1 -1
- package/es/shared/types/business.d.ts +14 -0
- package/package.json +2 -2
@@ -1 +1 @@
|
|
1
|
-
import{ref as e}from"vue";import t from"recorder-core";import"recorder-core/src/engine/mp3";import"recorder-core/src/engine/mp3-engine";import{RecordingModal as s}from"./utils/recordingModal.js";const i=class{constructor(){if(this.recordingModal=
|
1
|
+
import{ref as e}from"vue";import t from"recorder-core";import"recorder-core/src/engine/mp3";import"recorder-core/src/engine/mp3-engine";import{RecordingModal as s}from"./utils/recordingModal.js";const i=class{constructor(){if(this.recordingModal=null,this.webSocket=null,this.messageHandlerQueue=[],this.recorder=null,this.contentRef=e(""),this.realTimeSendStartTime=0,this.realTimeSendBytesChunks=[],this.realTimeSendClearPrevBufferIdx=0,this.timer=null,this.option={},this.hasEventListener=!1,this.isReady=!1,i.instance)return i.instance;i.instance=this}static create(){return new i}initRecorder(){this.recorder=t({type:"mp3",sampleRate:16e3,bitRate:16,...this.option.realTimeRecognition&&this.option.recognizable?{onProcess:this.onProcess.bind(this),takeoffEncodeChunk:this.takeoffEncodeChunk.bind(this)}:{}})}async onProcess(e,t,s,i,r){0===this.realTimeSendStartTime&&(this.realTimeSendStartTime=Date.now(),this.realTimeSendBytesChunks=[],this.realTimeSendClearPrevBufferIdx=0);for(let t=this.realTimeSendClearPrevBufferIdx;t<r;t++)e[t]=null;this.realTimeSendClearPrevBufferIdx=r}async takeoffEncodeChunk(e){var t;e&&this.realTimeSendBytesChunks.push(e);const s=Date.now();if(s-this.realTimeSendStartTime<i.sendInterval)return;this.realTimeSendStartTime=s;let r=0;for(let e=0;e<this.realTimeSendBytesChunks.length;e++)r+=this.realTimeSendBytesChunks[e].length;const n=new Uint8Array(r);for(let e=0,t=0;e<this.realTimeSendBytesChunks.length;e++){const s=this.realTimeSendBytesChunks[e];n.set(s,t),t+=s.length}if(this.realTimeSendBytesChunks=[],n.length>0){const e=new Blob([n],{type:"audio/wav"});null==(t=this.webSocket)||t.send(e)}}run(e,t){this.recorder||this.initRecorder(),this.messageHandlerQueue.push(e),this.option.timed&&(this.timer=setTimeout((()=>{this.stop()}),1e3*this.option.timed)),this.recorder.open((()=>{var e;this.recorder.start(),null==(e=this.recordingModal)||e.show({instance:t,contentRef:this.contentRef,onClose:()=>this.stop()})}),((e,t)=>{this.handleError({msg:e,isUserNotAllow:t})}))}start(e,t){return Object.assign(this.option,{recognizable:!0,showModal:!0},t||{}),this.option.recognizable||(this.option.showModal=!1),new Promise(((t,i)=>{if(this.messageHandlerQueue.length>0)return void i({result:"fail",msg:"当前已存在正在录音的任务"});const{showModal:r}=this.option;if(r&&!this.recordingModal&&(this.recordingModal=new s),r&&!this.hasEventListener&&(document.addEventListener("keydown",this.handleKeydown),this.hasEventListener=!0),this.option.recognizable&&!this.webSocket)return this.webSocket=new WebSocket("wss://emr-tl.cnhis.com/audio/socket"),this.webSocket.onopen=()=>{this.isReady=!0,this.run({resolve:t,reject:i},e)},this.webSocket.onmessage=this.handleMessage.bind(this),this.webSocket.onerror=()=>console.log("WebSocket连接失败"),void(this.webSocket.binaryType="blob");const n=this;!async function s(r=0){if(r>5)return i({result:"fail",msg:"WebSocket连接失败"});n.option.recognizable&&!n.isReady?setTimeout((()=>{s(++r)}),100):n.run({resolve:t,reject:i},e)}()}))}pause(){var e;null==(e=this.recorder)||e.pause()}resume(){var e;null==(e=this.recorder)||e.resume()}stop(){var e,t;if(null==(e=this.recordingModal)||e.hide(),this.option.realTimeRecognition&&this.option.recognizable){const e=this.messageHandlerQueue.shift();if(!e)return;const{resolve:t,reject:s}=e;t({result:"success",data:{text:this.contentRef.value}}),this.reset()}else null==(t=this.recorder)||t.stop((async(e,t)=>{var s;if(this.option.recognizable)null==(s=this.webSocket)||s.send(e);else{const t=this.messageHandlerQueue.shift();if(!t)return;const{resolve:s,reject:i}=t;s({result:"success",data:e}),this.reset()}}),(e=>{this.handleError({msg:e})}),!0)}handleError(e){const t=this.messageHandlerQueue.shift();if(!t)return;const{resolve:s,reject:i}=t;i({result:"fail",...e}),this.reset()}handleMessage(e){const{data:t}=e||{};if(!function(e){try{return JSON.parse(e),!0}catch(e){return!1}}(t))return void this.handleError({msg:"接收数据不是一个有效SJON"});const s=JSON.parse(t);if("success"===s.msg)if(this.option.realTimeRecognition)this.contentRef.value+=s.data.text.replace(/[??,。,.\s]/g,"");else{const e=this.messageHandlerQueue.shift();if(!e)return;const{resolve:t,reject:i}=e;t({result:"success",data:s.data.text.replace(/[??,。,.\s]/g,"")}),this.reset()}else this.handleError({msg:s.msg})}handleKeydown(e){var t,s,r,n;if(" "===e.key||"Space"===e.code){if(!(null==(s=null==(t=i.instance)?void 0:t.recordingModal)?void 0:s.rendered)||0===(null==(r=i.instance)?void 0:r.messageHandlerQueue.length))return;e.preventDefault(),null==(n=i.instance)||n.stop()}}reset(){var e;null==(e=this.recorder)||e.close(),this.realTimeSendStartTime=0,this.contentRef.value="",this.timer&&(clearTimeout(this.timer),this.timer=null),this.option={realTimeRecognition:!1,allowPunctuationMark:!0,timed:5},this.messageHandlerQueue=[]}destroy(){this.webSocket&&(this.webSocket.close(),this.webSocket=null,this.isReady=!1),document.removeEventListener("keydown",this.handleKeydown),this.hasEventListener=!1,this.reset(),this.recorder=null}static destroy(){i.instance&&(i.instance.destroy(),i.instance=null)}};let r=i;r.sendInterval=1500;export{r as default};
|
@@ -2,9 +2,10 @@ import { ComponentInternalInstance, Ref } from 'vue';
|
|
2
2
|
export declare class RecordingModal {
|
3
3
|
rendered: boolean;
|
4
4
|
target: HTMLElement | null;
|
5
|
-
show(
|
5
|
+
show({ contentRef, onClose, instance }: {
|
6
6
|
contentRef: Ref<string>;
|
7
7
|
onClose: () => void;
|
8
|
+
instance?: ComponentInternalInstance;
|
8
9
|
}): void;
|
9
10
|
hide(): void;
|
10
11
|
}
|
@@ -1 +1 @@
|
|
1
|
-
import{ref as e,render as t,createVNode as n,withCtx as r,nextTick as o}from"vue";import{createProviderWrapper as s}from"../../../../shared/utils/index.js";import
|
1
|
+
import{ref as e,render as t,createVNode as n,withCtx as r,nextTick as o}from"vue";import{createProviderWrapper as s}from"../../../../shared/utils/index.js";import i from"../components/recording.vue.js";class l{constructor(){this.rendered=!1,this.target=null}show({contentRef:l,onClose:a,instance:d}){if(this.rendered)return;this.rendered=!0;const u=document.createElement("div"),h=e(!1),c=s(d);t(n(c,null,{default:r((()=>n(i,{to:u,content:l.value,show:h.value,"onUpdate:show":e=>h.value=e,onClose:()=>p(),onAfterLeave:()=>p()},null)),d)}),u);const m=this;var v;function p(){a()}v=u,document.body.appendChild(v),m.target=v,o((()=>h.value=!0))}hide(){var e;(null==(e=this.target)?void 0:e.parentElement)&&(this.rendered=!1,this.target.parentElement.removeChild(this.target),this.target=null)}}export{l as RecordingModal};
|
@@ -1 +1 @@
|
|
1
|
-
import{defineComponent as e,shallowRef as
|
1
|
+
import{defineComponent as e,shallowRef as t,reactive as o,onBeforeUnmount as r,createVNode as i,mergeProps as l}from"vue";import"@wangeditor/editor/dist/css/style.css";import{Editor as d,Toolbar as s}from"@wangeditor/editor-for-vue";var a=e({name:"Editor",inheritAttrs:!1,components:{Editor:d,Toolbar:s},props:{editorConfig:{type:Object},toolbarConfig:{type:Object},uploadImgUrl:{type:String},isDisabled:{type:Boolean,default:!1}},emits:[],setup(e,{attrs:a,slots:n,emit:u}){const p=t(),c=o({MENU_CONF:{uploadImage:{server:e.uploadImgUrl||""}},...e.editorConfig});r((()=>{const e=p.value;null!=e&&e.destroy()}));const f=t=>{p.value=t,e.isDisabled&&t.disable(),console.log("实例",t)};return{editorRef:p,renderVN:()=>i("div",{class:"c-editor"},[i(s,{style:"border-bottom: 1px solid #ccc",editor:p.value,defaultConfig:e.toolbarConfig,mode:"default"},null),i(d,l({class:"c-editor__main",style:"height: 500px"},a,{defaultConfig:c,mode:"default",onOnCreated:f}),null)])}},render(){return this.renderVN()}});export{a as default};
|
@@ -0,0 +1 @@
|
|
1
|
+
.c-editor{border:1px solid #ccc}.c-editor__main{height:500px;overflow-y:hidden}
|
@@ -1 +1 @@
|
|
1
|
-
import{fabric as t}from"../../../../../shared/utils/fabricjs/index.js";import{drawPoint as e,drawText as i,drawLine as o,defaultLineStyle as n}from"../useDraw.js";import{useBirthProcessCumputedPoint as r}from"../useCumputedPoint.js";import{bus as a}from"../useEvent.js";import{useShadow as l}from"../useShadow.js";import{useCommon as s}from"../useCommon.js";import"vue";import{getIndex as c}from"../../utils/index.js";import{filter as d,cloneDeep as u,omit as f,flatten as h,isNumber as g,pick as m}from"lodash-es";import{format as p}from"date-fns";import{OTHER_MENU as v}from"../../constants/index.js";import"@vueuse/shared";import"naive-ui";import"./useTop.js";import"@vueuse/core";import"../../../../../shared/utils/index.js";const x=d(v,(t=>"add"!==t.type));function y(d,v,y,k,C,w,X,b,E){const{computedX:A,getXValue:L}=r(v),{getEqualXTypes:j,handleAddPrevent:P,isGridLimit:S,getPointEventProps:z}=s(d,y,v),{createShadowLines:I}=l(),{canvasWidth:M,other:T,yCellHeight:H,xCellWidth:O,endX:$,originX:B,originY:W,endY:Y,markHeight:D,event:_,topGridYCellHeight:V,extracorporealCirculationHeight:G}=v,K=new Map,R=u(T);let q=[],F=null;function J(){var o;if(!(null==(o=null==R?void 0:R.horizontal)?void 0:o.length))return;const n="horizontal";K.set(n,[]);const{horizontal:r}=R;let a=W+H/2;r.forEach(((o,r)=>{const{title:l,type:s,pointAttr:c={},textStyle:d={},data:u,showIcon:f=!0}=o;let h=null;u.forEach(((o,u)=>{const{time:g,value:m}=o,p=A(g);if(!ot(p))return;const v=[],x=f&&e(s,{...c,left:p,top:a});x&&v.push(x);const y=f?p+x.width/2+2:p,k=i([y,a],{value:m,...d,originX:"left"});v.push(k);const C=new t.Group(v,{lockMovementY:!0,objectCaching:!1,hasControls:!1,hasBorders:!1,hoverCursor:"pointer",...z()});Object.assign(C,{originLeft:p,iconHalfWidth:x?x.width/2:0,origin:{type:"other",key:n,dataIndex:r,index:u,data:o,title:l},limitX:{x1:B,x2:$-C.width}}),h&&(C.limitX.x1=h.left,h.limitX.x2=C.left,C.prevPoint=h,h.nextPoint=C),h=C,tt(C),K.get(n).push(C)})),a+=H})),d.value.add(...K.get(n))}function N(){var t;if(!(null==(t=null==R?void 0:R.vertical)?void 0:t.length))return;const i="vertical";K.set(i,[]);const{vertical:o}=R;o.forEach(((t,o)=>{const{show:n=!0,marginTop:r=0,textStyle:a={},data:l,time:s}=t,c=A(s);if(!n||!ot(c))return;const{lineHeight:d=H}=a;let u=W+r+d/2;l.forEach(((t,n)=>{const r=e(String(t),{...a,lockMovementY:!0,left:c,originX:"left",top:u,origin:{type:"other",key:i,dataIndex:o,index:n,data:{value:t}},...z()});u+=d,tt(r),K.get(i).push(r)}));const f=K.get(i).filter((t=>t.origin.dataIndex===o)),h=Math.max(...f.map((t=>t.width))),g=c>$-h;f.forEach(((t,e,i)=>{t.siblingPoints=i.filter((e=>e.origin.index!==t.origin.index)),t.maxTextWidth=h,g&&t.set("originX","right")}))})),d.value.add(...K.get(i))}function Q(t,e="add"){const{dataIndex:i,data:o,index:n,key:r,dataKey:a,time:l}=t,s=R[r],d=["mark","extracorporealCirculation"].includes(r)?s.dataList[i]:s[i];switch(e){case"remove":d.data.splice(n,1);break;case"change":if("mark"===r){d.list.splice(n,1);const t=s.dataList.find((t=>t.time===l));t?t.list.push(o):(s.dataList.push({time:l,list:[o]}),s.dataList.sort(((t,e)=>Date.parse(t.time)-Date.parse(e.time))))}else"extracorporealCirculation"===r?d[a]=o:d.data[n]=o;break;default:{const t=Array.isArray(o)?o[0].time:o.time,e=c(t,d.data),i=Array.isArray(o)?o:[o];d.data.splice(e,0,...i);break}}U(t)}function U(t){var e;const{key:i}=t;switch(null==(e=d.value)||e.remove(...K.get(i)),K.delete(i),i){case"horizontal":J();break;case"vertical":N();break;case"mark":Z();break;case"extracorporealCirculation":rt()}}function Z(){if(!D)return;const{title:t,titleStyle:o,pointAttr:n,dataList:r}=R.mark||{};if(!(null==r?void 0:r.length))return;const a="mark";K.set(a,[]);const l=i([B-5,Y+D/2],{value:t,...o,originX:"right"});d.value.add(l);const s=Y+D+G,c=Y+G;let u=0;const f={};r.forEach(((t,i)=>{const{time:o,list:r=[]}=t,l=A(o);if(!ot(l))return;let h=c+1;r.forEach(((t,o)=>{var r;const{style:g}=t,m=e((null==g?void 0:g.type)||"circleAndText",{...(null==g?void 0:g.pointAttr)||n,text:t.text,left:l,top:c+10,origin:{data:t,key:"mark",type:"other",dataIndex:i,index:o}}),p=m.height;u&&l-u<=O&&(null==(r=f[`x_${u}`])||r.forEach((([t,e])=>{h+p>=s&&(h=Y-1),t<e&&h>=t&&h<e&&(h=e),t>e&&h>e&&h<=t&&(h=e)})));const{topObj:v,startTop:x,oldStartTop:y}=function(t,e){const i={};let o;if(t>Y){const r=t+e;i.y2=t+e/2,r>=s?n(Y-1):(o=t,t=r)}else n(t);function n(n){o=n,i.y2=n-e/2;t=n-e}return{topObj:i,startTop:t,oldStartTop:o}}(h,p);h=x,f[`x_${l}`]||(f[`x_${l}`]=[]),f[`x_${l}`].push([y,h]),m.set("top",v.y2),K.get(a).push(m),tt(m),d.value.add(m)})),u=l})),function(t){const e=t=>{var e,i;return null==(i=null==(e=t.origin)?void 0:e.data)?void 0:i.isStart},i=t.find((t=>e(t))),o=t.find((t=>!e(t)&&t.left>i.left)),n=t.filter((t=>!e(t)));t.forEach((t=>{const r={x1:B,x2:$};e(t)?(r.x2=o.left,t.otherPoints=n):(r.x1=i.left,t.startPoint=i),t.limitX=r}))}(K.get(a))}function tt(t){if(_.hovered&&(t.on("mouseover",(()=>{et(t)})),t.on("mouseout",(()=>{k.show=!1}))),t.lockMovementX&&t.lockMovementY)return;const{key:e}=t.origin,i=["mark","horizontal"].includes(e),o=["mark","vertical"].includes(e),n=["mark","extracorporealCirculation"].includes(e),r="extracorporealCirculation"===e;t.on("moving",(()=>{t.moving=!0,i?function(t){const e=t.origin.key,i="horizontal"===e;t.setCoords(),t.left<t.limitX.x1&&t.set("left",t.limitX.x1+(i?1:0));t.left>t.limitX.x2&&t.set("left",t.limitX.x2+(i?-1:0));if("mark"===e){t.top<W&&t.set("top",W);const e=Y+G+D-t.height/2;t.top>e&&t.set("top",e)}i&&(t.originLeft=t.left+t.iconHalfWidth)}(t):r?function(t){t.setCoords();const{left:e,limitX:i}=t,o=p(new Date,"yyyy-MM-dd HH:mm"),n=A(o);i.isCurrentTime&&i.x2<n&&n>0&&n<M&&(i.x2=n);e<i.x1&&t.set({x1:i.x1,x2:i.x1});e>i.x2&&t.set({x1:i.x2,x2:i.x2});it(t,"left"),it(t,"right")}(t):(w(t),function(t){const e=t.left+t.maxTextWidth>$?"right":"left";t.setCoords().set({originX:e}),t.siblingPoints.forEach((i=>i.setCoords().set({originX:e,left:t.left})))}(t)),_.hovered&&et(t)})),t.on("mouseup",(r=>{var a;if(k.show=!1,1===r.button){if(!t.moving)return;t.moving=!1,i&&function(t){var e,i;if("mark"===t.origin.key){if((null==(i=null==(e=t.origin)?void 0:e.data)?void 0:i.isStart)&&t.otherPoints)t.otherPoints.forEach((e=>{e.limitX.x1=t.left}));else{const e=t.startPoint.otherPoints.map((t=>t.left)),i=Math.min(...e);t.startPoint.limitX.x2=i}return}t.prevPoint&&(t.prevPoint.limitX.x2=t.left);t.nextPoint&&(t.nextPoint.limitX.x1=t.left)}(t);const e=L(null!=(a=t.originLeft)?a:t.left),r={...t.origin,...o?{time:e}:{data:{...t.origin.data,time:e}}};d.value.discardActiveObject(),y("change",r),n&&Q(r,"change")}3===r.button&&["horizontal","vertical"].includes(e)&&(C.point={x:t.left,y:t.top},C.show=!0,C.target=t,C.list=x.map((t=>({...t,renderItem:()=>t.label,_type:"other"}))))}))}function et(t){k.isTarget=!0,k.show=!0;const{key:e,data:i={}}=t.origin||{};let o=i.value;const n="extracorporealCirculation"===e||"mark"===e;k.point={x:t.left,y:n?t.top:t.top+V/2};const r=!t.origin.isMenu&&t.originLeft?t.originLeft:t.left,a=L(r);k.list=[`时间 ${a.slice(-5)}`],n&&("mark"===e&&(o=i.name),k.list.unshift(o+" ")),k.sourceData=[{type:"other",key:e,time:a,value:o}]}function it(t,e){const{shadowObjs:i,params:o}=t[`${e}ShadowBox`]||{};if(!i||!o)return;i.forEach((t=>d.value.remove(t)));o["left"===e?1:0]=t.left;const n=nt(...o);t[`${e}ShadowBox`]={shadowObjs:n,params:o}}function ot(t){return t>=B&&t<=$}function nt(...e){const[i,o,r,a]=e,{mode:l,style:s}=a,c=f(s,["angle","space"]),u=[[i,Y],[o,Y],[o,r],[i,r]],h=new t.Polygon(u.map((t=>({x:t[0],y:t[1]}))),{...n,...c,stroke:"transparent",..."slash"===l?{fill:"transparent"}:{}}),g=[];return["slash"].includes(l)&&g.push(...I(u,s.angle,s.space,c)),d.value.add(h,...g),K.get("extracorporealCirculation").push(h,...g),[h,...g]}function rt(){if(!G)return;const{dataList:e,ascendAortaStyle:i,extracorporealCirculationStyle:o}=R.extracorporealCirculation||{};if(!(null==e?void 0:e.length))return;const n="extracorporealCirculation";K.set(n,[]);const r=Y+G;let a,l;function s(t){return t&&t>B&&t<M}function c(t){return void 0===t||""===t}e.forEach(((u,f)=>{const h=function(t){const{extracorporealCirculationStart:e,closeAscendAorta:i,openAscendAorta:o,extracorporealCirculationEnd:n}=t;let r,a,l,s;return e&&(r=A(e.time)),i&&(a=A(i.time)),o&&(l=A(o.time)),n&&(s=A(n.time)),[r,a,l,s]}(u);if(-1===h.findIndex((t=>t>0&&t<M)))return;let g;h.forEach(((m,v)=>{if(c(m))return;const x=h[v+1],y=h[v-1];if(s(m)||s(x)){const k=s(m)?m:B,C=s(x)?x:c(x)?null:$,w=s(y)?y:B,X={};if(v<h.length-1&&C&&(X.params=[k,C,r,[0,2].includes(v)?o:i],X.shadowObjs=nt(...X.params)),s(m)){const i=function(t){switch(t){case 0:return"extracorporealCirculationStart";case 1:return"closeAscendAorta";case 2:return"openAscendAorta";case 3:return"extracorporealCirculationEnd"}}(v),o=p(new Date,"yyyy-MM-dd HH:mm"),c=A(o),x=m<c&&s(c)?c:m,y=function(e,i){const o=new t.Line(e,{...i,stroke:"transparent",strokeWidth:5,hasControls:!1,hasBorders:!1,hoverCursor:"e-resize",lockMovementY:!0,originX:"center"});return tt(o),d.value.add(o),K.get("extracorporealCirculation").push(o),o}([m,Y,m,r],{origin:{dataIndex:f,dataKey:i,key:n,data:u[i],type:"other"},limitX:{x1:0===v?null!=a?a:B:w,x2:C||x,isCurrentTime:!C&&f===e.length-1},...[1,2,3].includes(v)?{leftShadowBox:g}:{},...[0,1,2].includes(v)?{rightShadowBox:X}:{}});v===h.length-1&&(a=m,l=y),0===v&&l&&(l.limitX.x2=k)}g=X}}))}))}function at(t){const{code:e}=t;F&&(e.includes("Enter")||e.includes("Esc"))&&(e.includes("Esc")&&(F.text=""),F.exitEditing(),d.value.discardActiveObject(F))}return function(){if(!(null==T?void 0:T.longLine)||!T.longLine.time)return;const{time:t,style:e}=T.longLine,i=A(t),n=o([i,0,i,Y],e);d.value.add(n)}(),function(){var t;if(!(null==(t=null==R?void 0:R.horizontal)?void 0:t.length))return;q=[];const{horizontal:i}=R,o=B-5;let n=W+H/2;i.forEach(((t,i)=>{const{title:r,titleStyle:a={},defaultAddValue:l,data:s=[]}=t,c=r&&e(r,{...a,originX:"right",left:o,top:n,origin:{defaultAddValue:l,dataIndex:i,type:"other",key:"horizontal",title:r,isMenu:!0},originLeft:o,originTop:n});var u;q.push({type:"other",title:r,key:"horizontal",dataIndex:i,dataList:s.map((t=>A(t.time))),y1:n-c.height/2,y2:n+c.height/2}),(u=c).on("moving",(()=>{u.set("originX","center"),S(u)?et(u):k.show=!1})),u.on("mouseup:before",(t=>{if(k.show=!1,0===t.e.button&&S(u))if(j(K.get("horizontal"),u.left,"key",O).includes(u.origin.key))P("repeat"),console.log("重复节点");else{const t={data:{time:L(u.left),value:u.origin.defaultAddValue},...u.origin};y("add",f(t,["isMenu"])),Q(t)}!function(t){t.setCoords().set({originX:"right",left:t.originLeft,top:t.originTop})}(u)})),d.value.add(c),n+=H}))}(),J(),N(),Z(),rt(),a.on((()=>{const t="horizontal",e=X(K.get(t));e.length>0?b((()=>{const i=function(t){const e=t.reduce(((t,e)=>{const{dataIndex:i}=e.origin;return t[i]=t[i]?t[i].concat(e.origin):[e.origin],t}),{});return h(Object.keys(e).map((t=>{const i=e[t];return R.horizontal[t].data.splice(i[0].index,i.length),i})))}(e);U({key:t}),y("remove",i)})):E()})),_.evented&&(window.addEventListener("keydown",at,!0),d.value.on("mouse:up",(e=>{var i,o,n,r;if(1===e.button){const{target:a,pointer:l={}}=e,{x:s=0,y:c=0}=l;if(!S({left:s,top:c}))return;if(!(null==q?void 0:q.length)||F)return;if(a&&"horizontal"!==(null==(i=a.origin)?void 0:i.key))return;let u="";if(a){if(a.moving)return;u=null==(r=null==(n=null==(o=a.origin)?void 0:o.data)?void 0:n.value)?void 0:r.toString()}const f=q.find((({y1:t,y2:e})=>c>=t&&c<=e));g(null==f?void 0:f.dataIndex)&&(F=new t.Textbox(u,{left:s,top:c,width:100,height:100,fontSize:18,objectCaching:!1,hasControls:!1,borderColor:"#000",editingBorderColor:"#000",backgroundColor:"#fff",fontFamily:"微软雅黑"}),F.otherListPointHeightRangeItem={...f,left:s,target:a},d.value.add(F),d.value.setActiveObject(F),F.enterEditing(),u&&F.setSelectionEnd(u.length))}})),d.value.on("selection:cleared",(({deselected:t})=>{var e;if(null==t?void 0:t.find((t=>t.otherListPointHeightRangeItem))){let{text:t}=F;const{otherListPointHeightRangeItem:i}=F;if(t=t.replace(/^\s+|\s+$/g,""),d.value.remove(F),F=null,!t)return;const{left:o,target:n}=i;if(n){if(t==(null==(e=n.origin)?void 0:e.data.value))return;const i={...n.origin,data:{...n.origin.data,value:t}};y("change",i),Q(i,"change")}else{const e={...m(i,["title","type","key","dataIndex"]),data:{time:L(o),value:t}};y("add",e),Q(e)}}}))),{clickMenu:function({item:t,target:e}){if(!e)return;const{type:i,_type:o}=t,n={...e.origin,type:o};y(i,n),"remove"===i&&Q(n,i)},handleKeydown:at}}export{y as useOther};
|
1
|
+
import{fabric as t}from"../../../../../shared/utils/fabricjs/index.js";import{drawPoint as e,drawText as i,drawLine as o,defaultLineStyle as n}from"../useDraw.js";import{useBirthProcessCumputedPoint as r}from"../useCumputedPoint.js";import{bus as a}from"../useEvent.js";import{useShadow as l}from"../useShadow.js";import{useCommon as s}from"../useCommon.js";import"vue";import{getIndex as c}from"../../utils/index.js";import{filter as d,cloneDeep as u,omit as f,flatten as h,isNumber as g,pick as m}from"lodash-es";import{format as p}from"date-fns";import{OTHER_MENU as v}from"../../constants/index.js";import"@vueuse/shared";import"naive-ui";import"./useTop.js";import"@vueuse/core";import"../../../../../shared/utils/index.js";const x=d(v,(t=>"add"!==t.type));function y(d,v,y,k,C,w,X,b,E){const{computedX:A,getXValue:L}=r(v),{getEqualXTypes:j,handleAddPrevent:P,isGridLimit:S,getPointEventProps:z}=s(d,y,v),{createShadowLines:I}=l(),{canvasWidth:M,other:T,yCellHeight:H,xCellWidth:O,endX:$,originX:B,originY:W,endY:Y,markHeight:D,event:_,topGridYCellHeight:V,extracorporealCirculationHeight:G}=v,K=new Map,R=u(T);let q=[],F=null;function J(){var o;if(!(null==(o=null==R?void 0:R.horizontal)?void 0:o.length))return;const n="horizontal";K.set(n,[]);const{horizontal:r}=R;let a=W+H/2;r.forEach(((o,r)=>{const{title:l,type:s,pointAttr:c={},textStyle:d={},data:u,showIcon:f=!0}=o;let h=null;u.forEach(((o,u)=>{const{time:g,value:m}=o,p=A(g);if(!ot(p))return;const v=[],x=f&&e(s,{...c,left:p,top:a});x&&v.push(x);const y=f?p+x.width/2+2:p,k=i([y,a],{value:m,...d,originX:"left"});v.push(k);const C=new t.Group(v,{lockMovementY:!0,objectCaching:!1,hasControls:!1,hasBorders:!1,hoverCursor:"pointer",...z()});Object.assign(C,{originLeft:p,iconHalfWidth:x?x.width/2:0,origin:{type:"other",key:n,dataIndex:r,index:u,data:o,title:l},limitX:{x1:B,x2:$-C.width}}),h&&(C.limitX.x1=h.left,h.limitX.x2=C.left,C.prevPoint=h,h.nextPoint=C),h=C,tt(C),K.get(n).push(C)})),a+=H})),d.value.add(...K.get(n))}function N(){var t;if(!(null==(t=null==R?void 0:R.vertical)?void 0:t.length))return;const i="vertical";K.set(i,[]);const{vertical:o}=R;o.forEach(((t,o)=>{const{show:n=!0,marginTop:r=0,textStyle:a={},data:l,time:s}=t,c=A(s);if(!n||!ot(c))return;const{lineHeight:d=H}=a;let u=W+r+d/2;l.forEach(((t,n)=>{const r=e(String(t.value),{...a,lockMovementY:!0,left:c,originX:"left",top:u,origin:{type:"other",key:i,dataIndex:o,index:n,data:t},...z()});u+=d,tt(r),K.get(i).push(r)}));const f=K.get(i).filter((t=>t.origin.dataIndex===o)),h=Math.max(...f.map((t=>t.width))),g=c>$-h;f.forEach(((t,e,i)=>{t.siblingPoints=i.filter((e=>e.origin.index!==t.origin.index)),t.maxTextWidth=h,g&&t.set("originX","right")}))})),d.value.add(...K.get(i))}function Q(t,e="add"){const{dataIndex:i,data:o,index:n,key:r,dataKey:a,time:l}=t,s=R[r],d=["mark","extracorporealCirculation"].includes(r)?s.dataList[i]:s[i];switch(e){case"remove":d.data.splice(n,1);break;case"change":if("mark"===r){d.list.splice(n,1);const t=s.dataList.find((t=>t.time===l));t?t.list.push(o):(s.dataList.push({time:l,list:[o]}),s.dataList.sort(((t,e)=>Date.parse(t.time)-Date.parse(e.time))))}else"extracorporealCirculation"===r?d[a]=o:d.data[n]=o;break;default:{const t=Array.isArray(o)?o[0].time:o.time,e=c(t,d.data),i=Array.isArray(o)?o:[o];d.data.splice(e,0,...i);break}}U(t)}function U(t){var e;const{key:i}=t;switch(null==(e=d.value)||e.remove(...K.get(i)),K.delete(i),i){case"horizontal":J();break;case"vertical":N();break;case"mark":Z();break;case"extracorporealCirculation":rt()}}function Z(){if(!D)return;const{title:t,titleStyle:o,pointAttr:n,dataList:r}=R.mark||{};if(!(null==r?void 0:r.length))return;const a="mark";K.set(a,[]);const l=i([B-5,Y+D/2],{value:t,...o,originX:"right"});d.value.add(l);const s=Y+D+G,c=Y+G;let u=0;const f={};r.forEach(((t,i)=>{const{time:o,list:r=[]}=t,l=A(o);if(!ot(l))return;let h=c+1;r.forEach(((t,o)=>{var r;const{style:g}=t,m=e((null==g?void 0:g.type)||"circleAndText",{...(null==g?void 0:g.pointAttr)||n,text:t.text,left:l,top:c+10,origin:{data:t,key:"mark",type:"other",dataIndex:i,index:o}}),p=m.height;u&&l-u<=O&&(null==(r=f[`x_${u}`])||r.forEach((([t,e])=>{h+p>=s&&(h=Y-1),t<e&&h>=t&&h<e&&(h=e),t>e&&h>e&&h<=t&&(h=e)})));const{topObj:v,startTop:x,oldStartTop:y}=function(t,e){const i={};let o;if(t>Y){const r=t+e;i.y2=t+e/2,r>=s?n(Y-1):(o=t,t=r)}else n(t);function n(n){o=n,i.y2=n-e/2;t=n-e}return{topObj:i,startTop:t,oldStartTop:o}}(h,p);h=x,f[`x_${l}`]||(f[`x_${l}`]=[]),f[`x_${l}`].push([y,h]),m.set("top",v.y2),K.get(a).push(m),tt(m),d.value.add(m)})),u=l})),function(t){const e=t=>{var e,i;return null==(i=null==(e=t.origin)?void 0:e.data)?void 0:i.isStart},i=t.find((t=>e(t))),o=t.find((t=>!e(t)&&t.left>i.left)),n=t.filter((t=>!e(t)));t.forEach((t=>{const r={x1:B,x2:$};e(t)?(r.x2=o.left,t.otherPoints=n):(r.x1=i.left,t.startPoint=i),t.limitX=r}))}(K.get(a))}function tt(t){if(_.hovered&&(t.on("mouseover",(()=>{et(t)})),t.on("mouseout",(()=>{k.show=!1}))),t.lockMovementX&&t.lockMovementY)return;const{key:e}=t.origin,i=["mark","horizontal"].includes(e),o=["mark","vertical"].includes(e),n=["mark","extracorporealCirculation"].includes(e),r="extracorporealCirculation"===e;t.on("moving",(()=>{t.moving=!0,i?function(t){const e=t.origin.key,i="horizontal"===e;t.setCoords(),t.left<t.limitX.x1&&t.set("left",t.limitX.x1+(i?1:0));t.left>t.limitX.x2&&t.set("left",t.limitX.x2+(i?-1:0));if("mark"===e){t.top<W&&t.set("top",W);const e=Y+G+D-t.height/2;t.top>e&&t.set("top",e)}i&&(t.originLeft=t.left+t.iconHalfWidth)}(t):r?function(t){t.setCoords();const{left:e,limitX:i}=t,o=p(new Date,"yyyy-MM-dd HH:mm"),n=A(o);i.isCurrentTime&&i.x2<n&&n>0&&n<M&&(i.x2=n);e<i.x1&&t.set({x1:i.x1,x2:i.x1});e>i.x2&&t.set({x1:i.x2,x2:i.x2});it(t,"left"),it(t,"right")}(t):(w(t),function(t){const e=t.left+t.maxTextWidth>$?"right":"left";t.setCoords().set({originX:e}),t.siblingPoints.forEach((i=>i.setCoords().set({originX:e,left:t.left})))}(t)),_.hovered&&et(t)})),t.on("mouseup",(r=>{var a;if(k.show=!1,1===r.button){if(!t.moving)return;t.moving=!1,i&&function(t){var e,i;if("mark"===t.origin.key){if((null==(i=null==(e=t.origin)?void 0:e.data)?void 0:i.isStart)&&t.otherPoints)t.otherPoints.forEach((e=>{e.limitX.x1=t.left}));else{const e=t.startPoint.otherPoints.map((t=>t.left)),i=Math.min(...e);t.startPoint.limitX.x2=i}return}t.prevPoint&&(t.prevPoint.limitX.x2=t.left);t.nextPoint&&(t.nextPoint.limitX.x1=t.left)}(t);const e=L(null!=(a=t.originLeft)?a:t.left),r={...t.origin,...o?{time:e}:{data:{...t.origin.data,time:e}}};d.value.discardActiveObject(),y("change",r),n&&Q(r,"change")}3===r.button&&["horizontal","vertical"].includes(e)&&(C.point={x:t.left,y:t.top},C.show=!0,C.target=t,C.list=x.map((t=>({...t,renderItem:()=>t.label,_type:"other"}))))}))}function et(t){k.isTarget=!0,k.show=!0;const{key:e,data:i={}}=t.origin||{};let o=i.value;const n="extracorporealCirculation"===e||"mark"===e;k.point={x:t.left,y:n?t.top:t.top+V/2};const r=!t.origin.isMenu&&t.originLeft?t.originLeft:t.left,a=L(r);k.list=[`时间 ${a.slice(-5)}`],n&&("mark"===e&&(o=i.name),k.list.unshift(o+" ")),k.sourceData=[{type:"other",key:e,time:a,value:o}]}function it(t,e){const{shadowObjs:i,params:o}=t[`${e}ShadowBox`]||{};if(!i||!o)return;i.forEach((t=>d.value.remove(t)));o["left"===e?1:0]=t.left;const n=nt(...o);t[`${e}ShadowBox`]={shadowObjs:n,params:o}}function ot(t){return t>=B&&t<=$}function nt(...e){const[i,o,r,a]=e,{mode:l,style:s}=a,c=f(s,["angle","space"]),u=[[i,Y],[o,Y],[o,r],[i,r]],h=new t.Polygon(u.map((t=>({x:t[0],y:t[1]}))),{...n,...c,stroke:"transparent",..."slash"===l?{fill:"transparent"}:{}}),g=[];return["slash"].includes(l)&&g.push(...I(u,s.angle,s.space,c)),d.value.add(h,...g),K.get("extracorporealCirculation").push(h,...g),[h,...g]}function rt(){if(!G)return;const{dataList:e,ascendAortaStyle:i,extracorporealCirculationStyle:o}=R.extracorporealCirculation||{};if(!(null==e?void 0:e.length))return;const n="extracorporealCirculation";K.set(n,[]);const r=Y+G;let a,l;function s(t){return t&&t>B&&t<M}function c(t){return void 0===t||""===t}e.forEach(((u,f)=>{const h=function(t){const{extracorporealCirculationStart:e,closeAscendAorta:i,openAscendAorta:o,extracorporealCirculationEnd:n}=t;let r,a,l,s;return e&&(r=A(e.time)),i&&(a=A(i.time)),o&&(l=A(o.time)),n&&(s=A(n.time)),[r,a,l,s]}(u);if(-1===h.findIndex((t=>t>0&&t<M)))return;let g;h.forEach(((m,v)=>{if(c(m))return;const x=h[v+1],y=h[v-1];if(s(m)||s(x)){const k=s(m)?m:B,C=s(x)?x:c(x)?null:$,w=s(y)?y:B,X={};if(v<h.length-1&&C&&(X.params=[k,C,r,[0,2].includes(v)?o:i],X.shadowObjs=nt(...X.params)),s(m)){const i=function(t){switch(t){case 0:return"extracorporealCirculationStart";case 1:return"closeAscendAorta";case 2:return"openAscendAorta";case 3:return"extracorporealCirculationEnd"}}(v),o=p(new Date,"yyyy-MM-dd HH:mm"),c=A(o),x=m<c&&s(c)?c:m,y=function(e,i){const o=new t.Line(e,{...i,stroke:"transparent",strokeWidth:5,hasControls:!1,hasBorders:!1,hoverCursor:"e-resize",lockMovementY:!0,originX:"center"});return tt(o),d.value.add(o),K.get("extracorporealCirculation").push(o),o}([m,Y,m,r],{origin:{dataIndex:f,dataKey:i,key:n,data:u[i],type:"other"},limitX:{x1:0===v?null!=a?a:B:w,x2:C||x,isCurrentTime:!C&&f===e.length-1},...[1,2,3].includes(v)?{leftShadowBox:g}:{},...[0,1,2].includes(v)?{rightShadowBox:X}:{}});v===h.length-1&&(a=m,l=y),0===v&&l&&(l.limitX.x2=k)}g=X}}))}))}function at(t){const{code:e}=t;F&&(e.includes("Enter")||e.includes("Esc"))&&(e.includes("Esc")&&(F.text=""),F.exitEditing(),d.value.discardActiveObject(F))}return function(){if(!(null==T?void 0:T.longLine)||!T.longLine.time)return;const{time:t,style:e}=T.longLine,i=A(t),n=o([i,0,i,Y],e);d.value.add(n)}(),function(){var t;if(!(null==(t=null==R?void 0:R.horizontal)?void 0:t.length))return;q=[];const{horizontal:i}=R,o=B-5;let n=W+H/2;i.forEach(((t,i)=>{const{title:r,titleStyle:a={},defaultAddValue:l,data:s=[]}=t,c=r&&e(r,{...a,originX:"right",left:o,top:n,origin:{defaultAddValue:l,dataIndex:i,type:"other",key:"horizontal",title:r,isMenu:!0},originLeft:o,originTop:n});var u;q.push({type:"other",title:r,key:"horizontal",dataIndex:i,dataList:s.map((t=>A(t.time))),y1:n-c.height/2,y2:n+c.height/2}),(u=c).on("moving",(()=>{u.set("originX","center"),S(u)?et(u):k.show=!1})),u.on("mouseup:before",(t=>{if(k.show=!1,0===t.e.button&&S(u))if(j(K.get("horizontal"),u.left,"key",O).includes(u.origin.key))P("repeat"),console.log("重复节点");else{const t={data:{time:L(u.left),value:u.origin.defaultAddValue},...u.origin};y("add",f(t,["isMenu"])),Q(t)}!function(t){t.setCoords().set({originX:"right",left:t.originLeft,top:t.originTop})}(u)})),d.value.add(c),n+=H}))}(),J(),N(),Z(),rt(),a.on((()=>{const t="horizontal",e=X(K.get(t));e.length>0?b((()=>{const i=function(t){const e=t.reduce(((t,e)=>{const{dataIndex:i}=e.origin;return t[i]=t[i]?t[i].concat(e.origin):[e.origin],t}),{});return h(Object.keys(e).map((t=>{const i=e[t];return R.horizontal[t].data.splice(i[0].index,i.length),i})))}(e);U({key:t}),y("remove",i)})):E()})),_.evented&&(window.addEventListener("keydown",at,!0),d.value.on("mouse:up",(e=>{var i,o,n,r;if(1===e.button){const{target:a,pointer:l={}}=e,{x:s=0,y:c=0}=l;if(!S({left:s,top:c}))return;if(!(null==q?void 0:q.length)||F)return;if(a&&"horizontal"!==(null==(i=a.origin)?void 0:i.key))return;let u="";if(a){if(a.moving)return;u=null==(r=null==(n=null==(o=a.origin)?void 0:o.data)?void 0:n.value)?void 0:r.toString()}const f=q.find((({y1:t,y2:e})=>c>=t&&c<=e));g(null==f?void 0:f.dataIndex)&&(F=new t.Textbox(u,{left:s,top:c,width:100,height:100,fontSize:18,objectCaching:!1,hasControls:!1,borderColor:"#000",editingBorderColor:"#000",backgroundColor:"#fff",fontFamily:"微软雅黑"}),F.otherListPointHeightRangeItem={...f,left:s,target:a},d.value.add(F),d.value.setActiveObject(F),F.enterEditing(),u&&F.setSelectionEnd(u.length))}})),d.value.on("selection:cleared",(({deselected:t})=>{var e;if(null==t?void 0:t.find((t=>t.otherListPointHeightRangeItem))){let{text:t}=F;const{otherListPointHeightRangeItem:i}=F;if(t=t.replace(/^\s+|\s+$/g,""),d.value.remove(F),F=null,!t)return;const{left:o,target:n}=i;if(n){if(t==(null==(e=n.origin)?void 0:e.data.value))return;const i={...n.origin,data:{...n.origin.data,value:t}};y("change",i),Q(i,"change")}else{const e={...m(i,["title","type","key","dataIndex"]),data:{time:L(o),value:t}};y("add",e),Q(e)}}}))),{clickMenu:function({item:t,target:e}){if(!e)return;const{type:i,_type:o}=t,n={...e.origin,type:o};y(i,n),"remove"===i&&Q(n,i)},handleKeydown:at}}export{y as useOther};
|
@@ -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
|
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 s}from"../useDraw.js";import"date-fns";import{getType as l}from"../../utils/index.js";import{last as r}from"lodash-es";import"../useEvent.js";import"../useShadow.js";import{getScaleInfo as u,drawScaleNumber as a,drawScaleLine as c}from"../useScaleColumn.js";import{useCommon as h}from"../useCommon.js";import"vue";import"../../constants/index.js";import"@vueuse/shared";import"naive-ui";import"../surgicalAnesthesia/useTop.js";import"@vueuse/core";import"../surgicalAnesthesia/useOther.js";import"../../../../../shared/utils/index.js";function p(p,d,g,f,m,y,v,w,S,b,x,Y){var j,C;const{getEqualXTypes:T,handleAddPrevent:L,isGridLimit:X}=h(p,g,d),{originY:N,endY:O,originX:V,endX:k,xCellWidth:E,yCellHeight:M,left:A,vitalSignsOriginY:B,painOriginY:G,painHeight:I,iconsWidth:H,itemList:R,painIndex:W,right:_,grid:J,canvasHeight:$,getRightInfo:q,borderStyle:D,surplusCell:P,painSurplusCell:z,painBorderColor:F,config:K}=d;function Q(o){var l;if(!(null==o?void 0:o.length))return;const{layout:h}=o[0];let d=H,g=V;"right"===h&&(d=k,g=k+(null!=(l=null==_?void 0:_.width)?l:0));const f=[],m=I&&"right"!==h?o.length-1:o.length,y=(g-d)/m,v=y+(g-d)%m,w=J.surplusCell||[0,0,0,0],S=B.originY-w[0]*M;o.forEach(((o,l)=>{if("pain"===o.type)return void function(n){const{list:o=[],spaceGridNumber:l=5,showScale:r,showNumber:c,position:h,showMaxMinNumber:d,style:g,title:f}=n,m=[],y=G.originY-z[0]*M,v=s({width:V-H,height:I+(z[0]+z[1])*M,...D},{value:`${f}`,...i,...g||{}},{left:H,top:y});m.push(v);const w=F?null:t([H,y,V,y],D);w&&m.push(w);const S=[];if(r||c){const{lineXMain:t,textLeft:i}=u(h,H,V-H),s=o.length;o.forEach(((o,u)=>{let h=G.endY-u*M*l;if(0===u&&0===z[1]&&(h=O-5),c&&(!(0===u||u===s-1)||d||0===u&&z[1]>0||u===s-1&&z[0]>0)&&S.push(a(o,n,i,h)),r&&(0!==u||z[1]>0)){const[i,n]=t,o=new e.Line([i,h,n,h],{...D,...g});S.push(o)}}))}p.value.add(...m,...S),v.sendToBack()}(o);const g=[],m=0===l?v:y,w=0===l?d:v+d+(l-1)*y;let b=0;"right"!==h&&(b=S,K.scaleTitleBorder&&(b+=M));const x="right"===h?$:B.endY,Y=l>0?t([w,b,w,x],{objectCaching:!1,...D}):null;Y&&g.push(Y);const j=w+m/2,{list:C=[],spaceGridNumber:T=5,showScale:L,showNumber:X,position:N,showMaxMinNumber:k,detailedList:E=[],showdetailedScale:A,showRange:R=[]}=o;if(L||X){const{lineXMain:e,lineXSub:t,textLeft:i}=u(N,w,m),n=(C[1]-C[0])/2,s=A&&!E.length?C.reduce(((e,t,i)=>{const o=e[e.length-1];return 0===i?[t]:e.concat([o+n,o+2*n])}),[]):A&&(null==E?void 0:E.length)?E:C,[l=s[0],h=r(s)]=R;s.forEach(((n,r)=>{if(l&&+n<+l)return;if(h&&+n>+h)return;const u=B.endY-r*M*(A?T/2:T),p=[l,h].includes(n);if(X&&(!p||k)){const e=0==r?u-5:u,t=a(n,o,i,e),s=B.originY+t.height/2;e<s&&t.set({top:s}),g.push(t)}g.push(...c(o,r,e,t,u,M,B.originY,s.findIndex((e=>e==h))+1))}))}let W=o.title||"";o.unit&&(W+="\n"+o.unit);const _=S+2;if(W){const n=new e.Text(String(W),{...i,originY:"top",left:j,top:_,textAlign:"center",...o.style});if(K.scaleTitleBorder){n.setCoords().set({top:M>12?S+1:S});const e=t([w,S+M,w+m,S+M],{objectCaching:!1,...D});g.push(e)}g.push(n)}const J=new e.Group(g,{...n,objectCaching:!1});f.push(J)}));const b=f.length>0?new e.Group([...f],{...n,objectCaching:!1}):null;b&&p.value.add(b),b&&b.sendToBack()}H&&function(){const e=JSON.parse(JSON.stringify(R));let t=O;const i=H-A.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:s,icon:r}=o(n,e,{text:{left:i-(e.pointAttr.width||10)-5,top:t,originX:"right"},icon:{originX:"right",left:i,topY:t,origin:{key:e.key,type:l(e.bigType),_type:e.bigType,isOneLine:e.isOneLine},...d.event}});var u;t-=s.height||30,(u=r).on("moving",(()=>{u.set("originX","center"),function(e){if(e.left>=V&&e.left<=k){e.setCoords();const t="pain"===e.origin.type?G:B;e.top<t.originY&&e.set("top",t.originY),e.top>t.endY&&e.set("top",t.endY)}}(u),X(u)?f(u):m.show=!1})),u.on("mouseup:before",(e=>{if(m.show=!1,0===e.e.button&&X(u)){const e=T([...Y],u.left,"_type").includes(u.origin._type),t=b(u.left);if(!t||e)e&&t&&L("repeat");else{const e={data:{time:w(u.left),value:S(u.origin.type,u.top),...u.origin.isOneLine?{key:u.origin.key}:{}},...u.origin};g("add",e),x(e)}}!function(e){e.setCoords().set({originX:"right",left:e.originLeft,top:e.originTop})}(u)})),p.value.add(s,r)}))}();const U=A.yScaleValue.filter((e=>"left"===e.layout&&"pain"!==e.type&&e.show));if((null==_?void 0:_.width)&&"left"===(null==(j=null==_?void 0:_.yScaleValue)?void 0:j.layout)&&(null==(C=null==_?void 0:_.yScaleValue)?void 0:C.show)&&U.push(q),W>0&&A.yScaleValue[W].show){const e=A.yScaleValue[W];0===W&&A.yScaleValue.length>1&&U.unshift(e),W==A.yScaleValue.length-1&&U.push(e)}const Z=U.findIndex((e=>"pulse"===e.type&&e.show&&e.doubleShow)),ee=U[Z];return Z>-1&&U.splice(Z,0,{...ee,title:(null==ee?void 0:ee.doubleTitle)||(null==ee?void 0:ee.title)}),Q(U),{drawScaleValue:Q}}export{p as useLeft};
|
@@ -1 +1 @@
|
|
1
|
-
import{fabric as e}from"../../../../shared/utils/fabricjs/index.js";import{drawLine as l,defaultStyle as
|
1
|
+
import{fabric as e}from"../../../../shared/utils/fabricjs/index.js";import{drawLine as l,defaultStyle as n}from"./useDraw.js";function i(i,s){var u,t,r;const{gridYNumber:d,originY:o,grid:a,originX:b,endX:c,xCellWidth:C,yCellHeight:S,gridXNumber:g,endY:m,borderStyle:p,mainSurplusCell:X,isTemperature:f,config:y}=s,Y=null!=(u=null!=X?X:s.surplusCell)?u:[0,0,0,0],h=[],v=[],L=new Set,j=(null==(t=a.mainLineStyle)?void 0:t.x)||{},x=(null==(r=a.mainLineStyle)?void 0:r.y)||{},w=a.subLineStyle||j,O=a.subSecondLineStyle||{},{originY:I=0,endY:N=0}=s.vitalSignsOriginY||{},P=Math.round((m-N)/S);for(let e=0;e<=d;e++){const n=o+~~(S*(d-e)),i={...p,...w},s=l([b,n,c,n],i);if((!f||y.mainLineStyleIncludePain)&&(e-Y[2])%a.subYCell==0&&e<=d-Y[0])s.set(j),L.add(s);else if(f&&!y.mainLineStyleIncludePain){const l=o+S*(d-e);l>=I&&l<=N+1&&(e-P)%a.subYCell==0?(s.set(j),L.add(s)):h.push(s)}else h.push(s)}for(let e=0;e<=g;e++){const n=b+~~(C*e),i={...p,...a.subXCell?w:x};a.subXCell&&e%a.subXCell==0?Object.assign(i,{...0!==e&&e!==g?x:p}):a.subSecondXCell&&e%a.subSecondXCell==0&&Object.assign(i,O);const s=l([n,o,n,m],i);a.subXCell&&e%a.subXCell==0?L.add(s):v.push(s)}const T=new e.Group([...h,...v,...L],n);i.value.add(T),i.value.sendToBack(T)}export{i as useGrid};
|
@@ -0,0 +1 @@
|
|
1
|
+
export declare function filterRemoteSearchPlugin(): import("../../../../../components/iho-table").TablePlugin;
|
@@ -0,0 +1 @@
|
|
1
|
+
import{createVNode as e}from"vue";import{isObject as o}from"@vue/shared";import"../../../index.js";import{IhoTableRenderHelper as i}from"../../utils/index.js";import r from"./remoteFilter.vue.js";import{defineTablePlugin as t}from"../../hooks/useTablePlugin.js";function n(){const n="filterRemoteSearchPlugin";return t({name:n,vxe(o){o.renderer.mixin({[n]:{showFilterFooter:!1,renderFilter:o=>e(r,{payload:o},null)}})},apply(e){e.fieldHooks.field.tap(n,((e,r,t,{$table:l})=>{var f;const a=null==(f=e.editRender)?void 0:f.props;return o(a)&&i.hasRemoteSearchFilter(a)?(e.filterRender={name:n},e.filters=[],t.filterConfig={iconMatch:"iho-table--iconfont iho-table-icon-filter",iconNone:"iho-table--iconfont iho-table-icon-filter",...t.filterConfig},e):e}))}})}export{n as filterRemoteSearchPlugin};
|
@@ -0,0 +1,68 @@
|
|
1
|
+
import { AnyObject } from '../../../../../shared/types';
|
2
|
+
import { PropType } from 'vue';
|
3
|
+
import { VxeColumnPropTypes } from 'vxe-table';
|
4
|
+
import { LowCodeTableFieldItem } from '../../../../../components/iho-table';
|
5
|
+
declare const _default: import("vue").DefineComponent<{
|
6
|
+
payload: {
|
7
|
+
type: PropType<VxeColumnPropTypes.FilterSlotParams>;
|
8
|
+
required: true;
|
9
|
+
};
|
10
|
+
}, {
|
11
|
+
props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
|
12
|
+
payload: {
|
13
|
+
type: PropType<VxeColumnPropTypes.FilterSlotParams>;
|
14
|
+
required: true;
|
15
|
+
};
|
16
|
+
}>> & {}>>;
|
17
|
+
searchFilterText: import("vue").Ref<string>;
|
18
|
+
loading: import("vue").Ref<boolean>;
|
19
|
+
optionsListRef: import("vue").Ref<AnyObject[]>;
|
20
|
+
lowCodeField: import("vue").ComputedRef<Partial<LowCodeTableFieldItem>>;
|
21
|
+
checkedRef: import("vue").Ref<string[]>;
|
22
|
+
containerStyleWithHeight: import("vue").ComputedRef<import("vue").CSSProperties>;
|
23
|
+
containerProps: {
|
24
|
+
ref: import("vue").Ref<any>;
|
25
|
+
onScroll: () => void;
|
26
|
+
style: Partial<CSSStyleDeclaration>;
|
27
|
+
};
|
28
|
+
wrapperProps: import("vue").ComputedRef<{
|
29
|
+
style: {
|
30
|
+
width: string;
|
31
|
+
height: string;
|
32
|
+
marginTop: string;
|
33
|
+
};
|
34
|
+
}>;
|
35
|
+
list: import("vue").Ref<import("@vueuse/core").UseVirtualListItem<AnyObject>[]>;
|
36
|
+
reset: () => void;
|
37
|
+
close: () => void;
|
38
|
+
confirm: () => void;
|
39
|
+
SlotRender: import("vue").DefineComponent<{
|
40
|
+
renderer: {
|
41
|
+
type: PropType<string | import("vue").Component | import("../../../../../shared/types").AnyFn>;
|
42
|
+
required: true;
|
43
|
+
};
|
44
|
+
rootSlots: {
|
45
|
+
type: PropType<Record<string, import("../../../../../shared/types").AnyFn>>;
|
46
|
+
};
|
47
|
+
}, () => any, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
48
|
+
renderer: {
|
49
|
+
type: PropType<string | import("vue").Component | import("../../../../../shared/types").AnyFn>;
|
50
|
+
required: true;
|
51
|
+
};
|
52
|
+
rootSlots: {
|
53
|
+
type: PropType<Record<string, import("../../../../../shared/types").AnyFn>>;
|
54
|
+
};
|
55
|
+
}>>, {}>;
|
56
|
+
NButton: any;
|
57
|
+
NButtonGroup: any;
|
58
|
+
NCheckbox: any;
|
59
|
+
NCheckboxGroup: any;
|
60
|
+
NInput: any;
|
61
|
+
NSpin: any;
|
62
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
63
|
+
payload: {
|
64
|
+
type: PropType<VxeColumnPropTypes.FilterSlotParams>;
|
65
|
+
required: true;
|
66
|
+
};
|
67
|
+
}>>, {}>;
|
68
|
+
export default _default;
|
@@ -0,0 +1 @@
|
|
1
|
+
import e from"./remoteFilter.vue2.js";import r from"../../../../../_virtual/_plugin-vue_export-helper.js";var t=r(e,[["__file","remoteFilter.vue"]]);export{t as default};
|
@@ -0,0 +1 @@
|
|
1
|
+
import{defineComponent as e,ref as l,computed as a,openBlock as t,createElementBlock as o,createVNode as n,unref as r,withCtx as i,createElementVNode as u,mergeProps as d,normalizeProps as s,guardReactiveProps as p,Fragment as v,renderList as c,createBlock as f,createTextVNode as w,toDisplayString as m,normalizeStyle as _}from"vue";import g from"../../../../../shared/components/SlotRender/SlotRender.js";import{NInput as y,NSpin as h,NCheckboxGroup as b,NCheckbox as L,NButtonGroup as C,NButton as k}from"naive-ui";import{useFilter as B}from"../pluginHooks/useFilter.js";import{getLowCodeFieldFromField as j}from"../../utils/index.js";const R={class:"iho-table__filterWrapper"},F=["title"],S={class:"iho-table__filterFooter"};var W=e({__name:"remoteFilter",props:{payload:{type:Object,required:!0}},setup(e){const W=e,x=l(""),H=l(!1),I=l([]),P=a((()=>j(W.payload.column)||{})),U=l([]),{containerStyleWithHeight:q,containerProps:z,wrapperProps:O,list:A}=B(W,I);function D(){}function E(){}function G(){}return(l,a)=>{var B,j;return t(),o("section",R,[n(r(y),{value:x.value,"onUpdate:value":a[0]||(a[0]=e=>x.value=e)},null,8,["value"]),n(r(h),{show:H.value},{default:i((()=>[n(r(b),{value:U.value,"onUpdate:value":a[1]||(a[1]=e=>U.value=e)},{default:i((()=>[u("section",d(r(z),{style:r(q),class:"iho-table__filterListWrapper"}),[u("section",s(p(r(O))),[(t(!0),o(v,null,c(r(A),(l=>(t(),o("div",{class:"iho-table__filterListItem",key:l.data.value},[n(r(L),{value:l.data.value},{default:i((()=>[u("div",{class:"iho-table__filterListItemContent",title:l.data.label},[r(P).filterLabelRender?(t(),f(r(g),d({key:0,renderer:r(P).filterLabelRender},e.payload,{option:l.data}),null,16,["renderer","option"])):(t(),o(v,{key:1},[w(m(l.data.label),1)],64))],8,F)])),_:2},1032,["value"])])))),128))],16)],16)])),_:1},8,["value"])])),_:1},8,["show"]),u("footer",S,[u("section",null,[w((null==(B=window.getLanguageByCode)?void 0:B.call(window,"10010.1.39"))||"已选择"),u("span",{style:_({color:"var(--c-primary-color)"})},m(U.value.length),5),w((null==(j=window.getLanguageByCode)?void 0:j.call(window,"10010.1.417"))||"项")]),n(r(C),{size:"small"},{default:i((()=>[n(r(k),{onClick:D},{default:i((()=>{var e;return[w((null==(e=window.getLanguageByCode)?void 0:e.call(window,"10010.1.509"))||"清空")]})),_:1}),n(r(k),{onClick:E},{default:i((()=>{var e;return[w((null==(e=window.getLanguageByCode)?void 0:e.call(window,"10010.1.28"))||"取消")]})),_:1}),n(r(k),{type:"primary",onClick:G},{default:i((()=>{var e;return[w((null==(e=window.getLanguageByCode)?void 0:e.call(window,"10010.1.27"))||"确定")]})),_:1})])),_:1})])])}}});export{W as default};
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import {
|
1
|
+
import { PropType } from 'vue';
|
2
2
|
import { VxeColumnPropTypes, VxeTableConstructor, VxeTableMethods, VxeTablePrivateMethods } from 'vxe-table';
|
3
3
|
import { LowCodeTableFieldItem } from '../../../../../components/iho-table';
|
4
4
|
declare const _default: import("vue").DefineComponent<{
|
@@ -23,11 +23,14 @@ declare const _default: import("vue").DefineComponent<{
|
|
23
23
|
checkedCacheRef: import("vue").Ref<string[]>;
|
24
24
|
searchFilterText: import("vue").Ref<string>;
|
25
25
|
close: () => Promise<void>;
|
26
|
-
OPTION_ITEM_HEIGHT: number;
|
27
|
-
viewCapacity: import("vue").ComputedRef<number>;
|
28
26
|
customFilterMethod: import("vue").ComputedRef<any>;
|
29
27
|
filteredList: import("vue").ComputedRef<import("vxe-table").VxeTableDefines.FilterOption[]>;
|
30
|
-
|
28
|
+
partCheckAll: import("vue").WritableComputedRef<boolean>;
|
29
|
+
partIndeterminate: import("vue").ComputedRef<boolean>;
|
30
|
+
checkAll: import("vue").WritableComputedRef<boolean>;
|
31
|
+
indeterminate: import("vue").ComputedRef<boolean>;
|
32
|
+
containerStyleWithHeight: import("vue").ComputedRef<import("vue").CSSProperties>;
|
33
|
+
list: import("vue").Ref<import("@vueuse/core").UseVirtualListItem<import("../../../../../shared/types").AnyObject>[]>;
|
31
34
|
containerProps: {
|
32
35
|
ref: import("vue").Ref<any>;
|
33
36
|
onScroll: () => void;
|
@@ -40,11 +43,6 @@ declare const _default: import("vue").DefineComponent<{
|
|
40
43
|
marginTop: string;
|
41
44
|
};
|
42
45
|
}>;
|
43
|
-
partCheckAll: import("vue").WritableComputedRef<boolean>;
|
44
|
-
partIndeterminate: import("vue").ComputedRef<boolean>;
|
45
|
-
checkAll: import("vue").WritableComputedRef<boolean>;
|
46
|
-
indeterminate: import("vue").ComputedRef<boolean>;
|
47
|
-
containerStyleWithHeight: import("vue").ComputedRef<CSSProperties>;
|
48
46
|
confirm: () => void;
|
49
47
|
reset: () => void;
|
50
48
|
loading: import("vue").Ref<boolean>;
|
@@ -1 +1 @@
|
|
1
|
-
import{defineComponent as e,inject as l,computed as a,ref as t,onDeactivated as n,onMounted as u,toRaw as
|
1
|
+
import{defineComponent as e,inject as l,computed as a,ref as t,onDeactivated as n,onMounted as u,toRaw as i,openBlock as o,createElementBlock as r,unref as v,createBlock as d,createCommentVNode as s,createVNode as c,isRef as p,withCtx as f,createTextVNode as h,createElementVNode as m,toDisplayString as y,mergeProps as _,normalizeProps as g,guardReactiveProps as w,Fragment as k,renderList as b,normalizeStyle as L}from"vue";import C from"../../../../../shared/components/CancelRadio/CancelRadio.js";import F from"../../../../../shared/components/SlotRender/SlotRender.js";import{keywordMatcher as D}from"../../../../../shared/utils/index.js";import{isString as R,isFunction as S,isEqual as j}from"lodash-es";import{NInput as B,NCheckbox as I,NSpin as x,NCheckboxGroup as U,NRadioGroup as W,NButtonGroup as $,NButton as E}from"naive-ui";import{InjectionIhoTableConfig as O}from"../../constants/index.js";import{useFilter as Y}from"../pluginHooks/useFilter.js";import{getLowCodeFieldFromField as H,isVariableHeightTable as M}from"../../utils/index.js";const P={class:"iho-table__filterWrapper"},V={key:1,class:"iho-table__filterCheckAllWrapper"},q={key:0,class:"iho-table__filterListItem"},z={class:"iho-table__filterListItem"},A=["title"],N=["title"],G={class:"iho-table__filterListItemContent"},J={class:"iho-table__filterFooter"};var K=e({__name:"filter",props:{payload:{type:Object,required:!0}},setup(e){const K=e,Q=l("$xetable"),T=l(O),X=a((()=>H(K.payload.column)||{})),Z=a((()=>{var e;return(null==(e=null==Q?void 0:Q.internalData)?void 0:e.afterFullData)||[]})),ee=a((()=>{var e;return!!(null==(e=K.payload)?void 0:e.column.filterMultiple)})),le=a((()=>{var e,l,a;return null!=(a=null==(l=null==(e=K.payload)?void 0:e.column)?void 0:l.filters)?a:[]})),ae=a({get:()=>le.value.reduce(((e,l)=>(l.checked&&e.push(l.value),e)),[]),async set(e){var l,a,t,n;if(!K.payload||!Q)return;const u=Q.reactData.filterStore.options||[];if(ee.value?(u.forEach((l=>l._checked=e.includes(l.value))),Q.checkFilterOptions()):u.forEach((l=>l._checked=l.value===e[0])),!M(Q))return i();function i(){K.payload.$panel.confirmFilter(new CustomEvent("click"))}(null!=(a=null==(l=Q.internalData.afterFullData)?void 0:l.length)?a:0)>(null!=(n=null==(t=T.value.scrollY)?void 0:t.gt)?n:100)&&(Q.reactData.scrollYLoad=!0),i(),Q.reactData.scrollYLoad=!1}}),te=t([...ae.value]),ne=t("");async function ue(){Q&&(Q.reactData.filterStore.visible=!1)}n(ue);const ie=a((()=>{var e;return null==(e=K.payload.column.editRender.props)?void 0:e.filterOptionsFilterMethod})),oe=a((()=>ne.value?le.value.filter((e=>ie.value?ie.value(ne.value,e):!!`${e.label}`.includes(ne.value)||(R(e.data)?D(ne.value,e.data):void 0))):le.value)),re=a({get:()=>!!oe.value.length&&oe.value.every((e=>te.value.includes(e.value))),set(e){te.value=e?[...new Set([...te.value,...oe.value.map((e=>e.value))])]:te.value.filter((e=>oe.value.every((l=>l.value!==e))))}}),ve=a((()=>oe.value.some((e=>te.value.includes(e.value)))&&!re.value)),de=a({get:()=>te.value.length===le.value.length&&0!==le.value.length,set:e=>{te.value=e?le.value.map((e=>e.value)):[]}}),se=a((()=>!!te.value.length&&!de.value)),{containerStyleWithHeight:ce,list:pe,containerProps:fe,wrapperProps:he}=Y(K,oe);function me(){ae.value=ee.value?te.value:j(te.value[0],null)?[]:[te.value[0]],ue()}function ye(){te.value=ee.value?[]:[null]}const _e=t(!1);return u((async()=>{var e;if(!Q)return;const l=null==(e=K.payload.column.editRender.props)?void 0:e.onFilterShow;if(S(l))try{_e.value=!0,await l(K.payload);const{filterStore:e}=Q.reactData;i(e.options)!==i(le.value)&&(e.options=le.value)}finally{_e.value=!1}})),(l,a)=>{var t,n;return o(),r("section",P,[v(le).length>5?(o(),d(v(B),{key:0,value:ne.value,"onUpdate:value":a[0]||(a[0]=e=>ne.value=e)},null,8,["value"])):s("v-if",!0),v(ee)?(o(),r("div",V,[v(le).length>5?(o(),r("div",q,[c(v(I),{checked:v(re),"onUpdate:checked":a[1]||(a[1]=e=>p(re)?re.value=e:null),indeterminate:v(ve)},{default:f((()=>[h("全选当前")])),_:1},8,["checked","indeterminate"])])):s("v-if",!0),m("div",z,[c(v(I),{checked:v(de),"onUpdate:checked":a[2]||(a[2]=e=>p(de)?de.value=e:null),indeterminate:v(se)},{default:f((()=>{var e;return[h(((null==(e=window.getLanguageByCode)?void 0:e.call(window,"10010.1.577"))||"全选所有")+y(v(X).showFilterFullNums?`(${v(Z).length})`:""),1)]})),_:1},8,["checked","indeterminate"])])])):s("v-if",!0),c(v(x),{show:_e.value},{default:f((()=>[v(ee)?(o(),d(v(U),{key:0,value:te.value,"onUpdate:value":a[3]||(a[3]=e=>te.value=e)},{default:f((()=>[m("section",_(v(fe),{style:v(ce),class:"iho-table__filterListWrapper"}),[m("section",g(w(v(he))),[(o(!0),r(k,null,b(v(pe),(l=>(o(),r("div",{class:"iho-table__filterListItem",key:l.data.value},[c(v(I),{value:l.data.value},{default:f((()=>[m("div",{class:"iho-table__filterListItemContent",title:l.data.label},[v(X).filterLabelRender?(o(),d(v(F),_({key:0,renderer:v(X).filterLabelRender},e.payload,{option:l.data}),null,16,["renderer","option"])):(o(),r(k,{key:1},[h(y(l.data.label),1)],64))],8,A)])),_:2},1032,["value"])])))),128))],16)],16)])),_:1},8,["value"])):(o(),d(v(W),{key:1,value:te.value[0],"onUpdate:value":a[5]||(a[5]=e=>te.value[0]=e)},{default:f((()=>[m("section",_(v(fe),{style:v(ce),class:"iho-table__filterListWrapper"}),[m("section",g(w(v(he))),[(o(!0),r(k,null,b(v(pe),(e=>(o(),r("div",{class:"iho-table__filterListItem",key:e.data.value,title:e.data.label},[c(v(C),{value:e.data.value,currentValue:te.value[0],cancelable:"",onCancel:a[4]||(a[4]=e=>te.value=[null])},{default:f((()=>[m("div",G,y(e.data.label),1)])),_:2},1032,["value","currentValue"])],8,N)))),128))],16)],16)])),_:1},8,["value"]))])),_:1},8,["show"]),m("footer",J,[m("section",null,[v(ee)?(o(),r(k,{key:0},[h((null==(t=window.getLanguageByCode)?void 0:t.call(window,"10010.1.39"))||"已选择"),m("span",{style:L({color:"var(--c-primary-color)"})},y(te.value.length),5),h((null==(n=window.getLanguageByCode)?void 0:n.call(window,"10010.1.417"))||"项")],64)):s("v-if",!0)]),c(v($),{size:"small"},{default:f((()=>[c(v(E),{onClick:ye},{default:f((()=>{var e;return[h((null==(e=window.getLanguageByCode)?void 0:e.call(window,"10010.1.509"))||"清空")]})),_:1}),c(v(E),{onClick:ue},{default:f((()=>{var e;return[h((null==(e=window.getLanguageByCode)?void 0:e.call(window,"10010.1.28"))||"取消")]})),_:1}),c(v(E),{type:"primary",onClick:me},{default:f((()=>{var e;return[h((null==(e=window.getLanguageByCode)?void 0:e.call(window,"10010.1.27"))||"确定")]})),_:1})])),_:1})])])}}});export{K as default};
|
@@ -1 +1 @@
|
|
1
|
-
import*as e from"./anchorPlugin/index.js";import*as r from"./bindEventSettingPlugin.js";import*as i from"./colorAndIconPlugin.js";import*as n from"./copyPastePlugin.js";import*as s from"./crossHeaderPlugin.js";import*as t from"./defaultConfigPlugin.js";import*as l from"./defaultValuePlugin.js";import*as d from"./dragScrollPlugin.js";import*as g from"./dynamicFilterRenderPlugin/index.js";import*as o from"./filterDaterangeRenderPlugin/index.js";import*as u from"./
|
1
|
+
import*as e from"./anchorPlugin/index.js";import*as r from"./bindEventSettingPlugin.js";import*as i from"./colorAndIconPlugin.js";import*as n from"./copyPastePlugin.js";import*as s from"./crossHeaderPlugin.js";import*as t from"./defaultConfigPlugin.js";import*as l from"./defaultValuePlugin.js";import*as d from"./dragScrollPlugin.js";import*as g from"./dynamicFilterRenderPlugin/index.js";import*as o from"./filterDaterangeRenderPlugin/index.js";import*as u from"./filterRemoteSearchPlugin/index.js";import*as a from"./filterRenderPlugin/index.js";import*as P from"./filterTextPlugin/index.js";import*as m from"./filterVisibleEventPlugin.js";import*as f from"./forceArrowKeyPlugin.js";import*as x from"./headerPlugin/index.js";import*as p from"./highLightSetPlugin.js";import*as j from"./keyboardEventPlugin.js";import*as c from"./lowCodeFieldAdaptorPlugin.js";import*as R from"./maxCheckSizePlugin.js";import*as b from"./operationalFormPlugin.js";import*as w from"./pagerScrollPlugin/index.js";import*as h from"./rendererPlugins/editableWidgets/dateRendererPlugin/index.js";import*as S from"./rendererPlugins/editableWidgets/inputRendererPlugin.js";import*as W from"./rendererPlugins/editableWidgets/levelSearchCascadePlugin/index.js";import*as v from"./rendererPlugins/editableWidgets/numberRendererPlugin.js";import*as k from"./rendererPlugins/editableWidgets/radioRendererPlugin.js";import*as y from"./rendererPlugins/editableWidgets/selectRendererPlugin/index.js";import*as C from"./rendererPlugins/editableWidgets/separateRendererPlugin/index.js";import*as F from"./rendererPlugins/editableWidgets/switchRendererPlugin.js";import*as A from"./rendererPlugins/editableWidgets/timeRendererPlugin/index.js";import*as E from"./rendererPlugins/widgets/checkRendererPlugin.js";import*as T from"./rendererPlugins/widgets/colorRendererPlugin.js";import*as D from"./rendererPlugins/widgets/defaultRendererPlugin.js";import*as H from"./rendererPlugins/widgets/htmlRendererPlugin.js";import*as V from"./rendererPlugins/widgets/labelRendererPlugin.js";import*as q from"./rendererPlugins/widgets/pictureRendererPlugin.js";import*as z from"./rendererPlugins/widgets/seqRendererPlugin.js";import*as G from"./rowClickPlugin.js";import*as I from"./rowDragPlugin.js";import*as K from"./rowGroupSettingPlugin/index.js";import*as L from"./stickyFixedPlugin.js";import*as O from"./varialbleHeightPlugin.js";import*as B from"./verticalTablePlugin/index.js";import*as J from"./virtualTreePlugin.js";import*as M from"./wordbookSettingPlugin.js";import{separateMetaModule as N}from"../../../../shared/utils/index.js";var Q=N(Object.assign({"./anchorPlugin/index.tsx":e,"./bindEventSettingPlugin.ts":r,"./colorAndIconPlugin.ts":i,"./copyPastePlugin.ts":n,"./crossHeaderPlugin.ts":s,"./defaultConfigPlugin.ts":t,"./defaultValuePlugin.ts":l,"./dragScrollPlugin.ts":d,"./dynamicFilterRenderPlugin/index.tsx":g,"./filterDaterangeRenderPlugin/index.tsx":o,"./filterRemoteSearchPlugin/index.tsx":u,"./filterRenderPlugin/index.tsx":a,"./filterTextPlugin/index.tsx":P,"./filterVisibleEventPlugin.ts":m,"./forceArrowKeyPlugin.ts":f,"./headerPlugin/index.tsx":x,"./highLightSetPlugin.tsx":p,"./keyboardEventPlugin.ts":j,"./lowCodeFieldAdaptorPlugin.tsx":c,"./maxCheckSizePlugin.ts":R,"./operationalFormPlugin.ts":b,"./pagerScrollPlugin/index.ts":w,"./rendererPlugins/editableWidgets/dateRendererPlugin/index.tsx":h,"./rendererPlugins/editableWidgets/inputRendererPlugin.tsx":S,"./rendererPlugins/editableWidgets/levelSearchCascadePlugin/index.tsx":W,"./rendererPlugins/editableWidgets/numberRendererPlugin.tsx":v,"./rendererPlugins/editableWidgets/radioRendererPlugin.tsx":k,"./rendererPlugins/editableWidgets/selectRendererPlugin/index.tsx":y,"./rendererPlugins/editableWidgets/separateRendererPlugin/index.tsx":C,"./rendererPlugins/editableWidgets/switchRendererPlugin.tsx":F,"./rendererPlugins/editableWidgets/timeRendererPlugin/index.tsx":A,"./rendererPlugins/widgets/checkRendererPlugin.tsx":E,"./rendererPlugins/widgets/colorRendererPlugin.tsx":T,"./rendererPlugins/widgets/defaultRendererPlugin.tsx":D,"./rendererPlugins/widgets/htmlRendererPlugin.tsx":H,"./rendererPlugins/widgets/labelRendererPlugin.tsx":V,"./rendererPlugins/widgets/pictureRendererPlugin.tsx":q,"./rendererPlugins/widgets/seqRendererPlugin.tsx":z,"./rowClickPlugin.ts":G,"./rowDragPlugin.ts":I,"./rowGroupSettingPlugin/index.ts":K,"./stickyFixedPlugin.tsx":L,"./varialbleHeightPlugin.tsx":O,"./verticalTablePlugin/index.ts":B,"./virtualTreePlugin.ts":J,"./wordbookSettingPlugin.ts":M}));export{Q as default};
|
@@ -0,0 +1 @@
|
|
1
|
+
export * from './useFilter';
|
@@ -0,0 +1 @@
|
|
1
|
+
export{useFilter}from"./useFilter.js";
|
@@ -0,0 +1,21 @@
|
|
1
|
+
import { AnyObject } from '../../../../../shared/types';
|
2
|
+
import { CSSProperties, Ref } from 'vue';
|
3
|
+
import { VxeColumnPropTypes } from 'vxe-table';
|
4
|
+
export declare function useFilter(props: {
|
5
|
+
payload: VxeColumnPropTypes.FilterSlotParams;
|
6
|
+
}, optionListRef: Ref<AnyObject[]>): {
|
7
|
+
containerStyleWithHeight: import("vue").ComputedRef<CSSProperties>;
|
8
|
+
list: Ref<import("@vueuse/core").UseVirtualListItem<AnyObject>[]>;
|
9
|
+
containerProps: {
|
10
|
+
ref: Ref<any>;
|
11
|
+
onScroll: () => void;
|
12
|
+
style: Partial<CSSStyleDeclaration>;
|
13
|
+
};
|
14
|
+
wrapperProps: import("vue").ComputedRef<{
|
15
|
+
style: {
|
16
|
+
width: string;
|
17
|
+
height: string;
|
18
|
+
marginTop: string;
|
19
|
+
};
|
20
|
+
}>;
|
21
|
+
};
|
@@ -0,0 +1 @@
|
|
1
|
+
import{widthAppend as r}from"../../../../../shared/utils/index.js";import{useVirtualList as o}from"@vueuse/core";import{isNumber as e}from"lodash-es";import{computed as t}from"vue";function i(i,n){const p=t((()=>{var r,o;if(!i.payload||!i.payload.column)return 10;const{filterCapacity:t}=null!=(o=null==(r=i.payload.column.editRender)?void 0:r.props)?o:{};return e(t)&&t>0?t:10})),a=t((()=>({height:r(32*p.value)}))),{list:l,containerProps:s,wrapperProps:u}=o(n,{itemHeight:32,overscan:3});return{containerStyleWithHeight:a,list:l,containerProps:s,wrapperProps:u}}export{i as useFilter};
|
@@ -25,6 +25,10 @@ declare const _default: import("vue").DefineComponent<{
|
|
25
25
|
type: BooleanConstructor;
|
26
26
|
default: boolean;
|
27
27
|
};
|
28
|
+
checkAbleLevel: {
|
29
|
+
type: PropType<number | "last">;
|
30
|
+
default: string;
|
31
|
+
};
|
28
32
|
wordbook: {
|
29
33
|
type: PropType<Partial<{
|
30
34
|
level_num: number;
|
@@ -88,6 +92,10 @@ declare const _default: import("vue").DefineComponent<{
|
|
88
92
|
type: BooleanConstructor;
|
89
93
|
default: boolean;
|
90
94
|
};
|
95
|
+
checkAbleLevel: {
|
96
|
+
type: PropType<number | "last">;
|
97
|
+
default: string;
|
98
|
+
};
|
91
99
|
wordbook: {
|
92
100
|
type: PropType<Partial<{
|
93
101
|
level_num: number;
|
@@ -503,6 +511,10 @@ declare const _default: import("vue").DefineComponent<{
|
|
503
511
|
type: BooleanConstructor;
|
504
512
|
default: boolean;
|
505
513
|
};
|
514
|
+
checkAbleLevel: {
|
515
|
+
type: PropType<number | "last">;
|
516
|
+
default: string;
|
517
|
+
};
|
506
518
|
wordbook: {
|
507
519
|
type: PropType<Partial<{
|
508
520
|
level_num: number;
|
@@ -549,5 +561,6 @@ declare const _default: import("vue").DefineComponent<{
|
|
549
561
|
valueField: string;
|
550
562
|
lazyRequest: boolean;
|
551
563
|
requestCache: boolean;
|
564
|
+
checkAbleLevel: number | "last";
|
552
565
|
}>;
|
553
566
|
export default _default;
|
@@ -1 +1 @@
|
|
1
|
-
import{defineComponent as e,inject as a,openBlock as t,createBlock as o,unref as r,isRef as s,withCtx as
|
1
|
+
import{defineComponent as e,inject as a,openBlock as t,createBlock as o,unref as r,isRef as s,withCtx as l,createVNode as u}from"vue";import i from"../../../../../../../shared/components/no-data/NoData.vue.js";import"../../../../../../../shared/utils/index.js";import"naive-ui";import"@vueuse/core";import"date-fns";import"lodash-es";import"@vue/shared";import{useLevelSearchCascader as p}from"../../../../../../../shared/hooks/useLevelSearchCascader.js";import"@vueuse/shared";import"../../../../../../../shared/hooks/selectHooks/useSearchContent.js";import"@vicons/ionicons5";import"../../../../../../../shared/hooks/useScrollLoading.js";import{InjectionTableAsyncQueue as n}from"../../../../constants/index.js";import d from"../../../../../../search-cascader/index.js";var c=e({__name:"levelSearchCascade",props:{options:{type:Array,default:()=>[]},labelField:{type:String,default:"text"},valueField:{type:String,default:"value"},autograph:{type:String,required:!0},lazyRequest:{type:Boolean,default:!0},requestCache:{type:Boolean,default:!0},checkAbleLevel:{type:[Number,String],default:"last"},wordbook:{type:Object,required:!0},value:{type:[String,Array]},fieldKey:{type:String,required:!0},payload:{type:Object,required:!0}},emits:["update:value","click"],setup(e,{emit:c}){const h=e,m=a(n),{valueKey:y,valueRef:f,labelKey:v,optionsRef:k,showRef:S,fetchData:b,menuWidth:g,searchCascaderRef:j}=p(h,c,{fieldKey:h.fieldKey,asyncQueue:m,getRequestPayload:()=>h.payload});function q(){g.value=150}function w(e){c("click",e)}return(e,a)=>(t(),o(r(d),{ref_key:"searchCascaderRef",ref:j,value:r(f),"onUpdate:value":a[0]||(a[0]=e=>s(f)?f.value=e:null),show:r(S),"onUpdate:show":a[1]||(a[1]=e=>s(S)?S.value=e:null),options:r(k),"label-key":r(v),"value-key":r(y),search:r(b),"menu-width":r(g),"input-props":{onClick:w},onFocus:q},{empty:l((()=>[u(r(i))])),_:1},8,["value","show","options","label-key","value-key","search","menu-width","input-props"]))}});export{c as default};
|
@@ -1 +1 @@
|
|
1
|
-
import"../../../../../../../shared/utils/tapable/SyncHook.js";import"../../../../../../../shared/utils/tapable/SyncBailHook.js";import e from"../../../../../../../shared/utils/tapable/SyncWaterfallHook.js";import"../../../../../../../shared/utils/tapable/SyncLoopHook.js";import"../../../../../../../shared/utils/tapable/AsyncParallelHook.js";import"../../../../../../../shared/utils/tapable/AsyncParallelBailHook.js";import"../../../../../../../shared/utils/tapable/AsyncSeriesHook.js";import"../../../../../../../shared/utils/tapable/AsyncSeriesBailHook.js";import"../../../../../../../shared/utils/tapable/AsyncSeriesLoopHook.js";import"../../../../../../../shared/utils/tapable/AsyncSeriesWaterfallHook.js";import{useRowHeight as s}from"./useRowHeight.js";import{useRowClassName as o}from"./useRowClassName.js";import{useExpose as a}from"./useExpose.js";import{useColumn2Data as t}from"./useColumn2Data.js";import{useData2Column as
|
1
|
+
import"../../../../../../../shared/utils/tapable/SyncHook.js";import"../../../../../../../shared/utils/tapable/SyncBailHook.js";import e from"../../../../../../../shared/utils/tapable/SyncWaterfallHook.js";import"../../../../../../../shared/utils/tapable/SyncLoopHook.js";import"../../../../../../../shared/utils/tapable/AsyncParallelHook.js";import"../../../../../../../shared/utils/tapable/AsyncParallelBailHook.js";import"../../../../../../../shared/utils/tapable/AsyncSeriesHook.js";import"../../../../../../../shared/utils/tapable/AsyncSeriesBailHook.js";import"../../../../../../../shared/utils/tapable/AsyncSeriesLoopHook.js";import"../../../../../../../shared/utils/tapable/AsyncSeriesWaterfallHook.js";import{useRowHeight as s}from"./useRowHeight.js";import{useRowClassName as o}from"./useRowClassName.js";import{useExpose as a}from"./useExpose.js";import{useColumn2Data as t}from"./useColumn2Data.js";import{useData2Column as l}from"./useData2Column.js";import{useEditCell as r}from"./useEditCell.js";import{useEventConvert as i}from"./useEventConvert.js";import{useTriggerRow as p}from"./useTriggerRow.js";const m=()=>({cellStyle:new e(["styles","payload","verticalState"]),cellClassName:new e(["classes","payload","verticalState"]),config:new e(["config","verticalState"]),headerRowStyle:new e(["styles","payload","verticalState"])}),n=(e,m,n)=>{r(e,m,n),p(e,m,n),i(e,m,n),l(e,m,n),t(e,m,n),a(e,m),o(e,m,n),s(e)};export{m as createVerticalTableHooks,n as usePresetVerticalPlugins};
|
@@ -157,10 +157,12 @@ export declare namespace IhoTableLowCodeField {
|
|
157
157
|
}>;
|
158
158
|
type FilterSetting = Partial<{
|
159
159
|
daterange: boolean;
|
160
|
-
type: 'daterange' | 'text';
|
160
|
+
type: 'daterange' | 'text' | 'remote';
|
161
|
+
pagination: boolean;
|
161
162
|
text: Partial<{
|
162
163
|
inputProps: AnyObject;
|
163
164
|
}>;
|
165
|
+
urlConfig: LowCodeTypes.UrlConfig;
|
164
166
|
}>;
|
165
167
|
type ColorAndIconItem = Partial<{
|
166
168
|
condition: {
|
@@ -53,6 +53,7 @@ export declare const IhoTableRenderHelper: Readonly<{
|
|
53
53
|
value: string;
|
54
54
|
extraValue: string;
|
55
55
|
}[] | undefined;
|
56
|
+
hasRemoteSearchFilter(lowCodeField: LowCodeTableFieldItem): boolean;
|
56
57
|
hasOptionFilter(lowCodeField: LowCodeTableFieldItem): boolean;
|
57
58
|
hasDateFilter(lowCodeField: LowCodeTableFieldItem): boolean;
|
58
59
|
hasTextFilter(lowCodeField: LowCodeTableFieldItem): boolean;
|
@@ -1 +1 @@
|
|
1
|
-
import{reactive as e,inject as t,unref as n,toRaw as r,normalizeStyle as i,createVNode as o}from"vue";import{jsonParse as l}from"../../../../shared/utils/index.js";import{promiseTimeout as u}from"@vueuse/shared";import{parse as a,isValid as c,compareDesc as s}from"date-fns";import{isNumber as d,isFunction as f,isString as p,isObject as m,isArray as v}from"lodash-es";import{InjectionIhoTableEmits as h,InjectionIhoTableConfig as g,IHO_TABLE_STRING_STATUS as I,IHO_TABLE_NUMBER_STATUS as E,IHO_TABLE_TREE_TYPE as T,EDITABLE_WIDGET_TYPE as w,InjectionIhoTableUUID as F}from"../constants/index.js";import{getSeparateInfo as
|
1
|
+
import{reactive as e,inject as t,unref as n,toRaw as r,normalizeStyle as i,createVNode as o}from"vue";import{jsonParse as l}from"../../../../shared/utils/index.js";import{promiseTimeout as u}from"@vueuse/shared";import{parse as a,isValid as c,compareDesc as s}from"date-fns";import{isNumber as d,isFunction as f,isString as p,isObject as m,isArray as v}from"lodash-es";import{InjectionIhoTableEmits as h,InjectionIhoTableConfig as g,IHO_TABLE_STRING_STATUS as I,IHO_TABLE_NUMBER_STATUS as E,IHO_TABLE_TREE_TYPE as T,EDITABLE_WIDGET_TYPE as w,InjectionIhoTableUUID as F}from"../constants/index.js";import{getSeparateInfo as S}from"./separateMap.js";export{deleteSeparateInfo,getSeparateInfo,setSeparateInfo}from"./separateMap.js";function R(e){return console.warn(`[IhoTable]: ${e}`)}const C=Object.freeze({getCellType(e){var t;return((null==(t=e.settingObj)?void 0:t.attr)||e.formType||"DEFAULT").toUpperCase()}});function b(){var e,n,r;const i=t(g);return i||R("this function(getRowHeight) only can be used in setup environment"),null!=(r=null==(n=null==(e=null==i?void 0:i.value)?void 0:e.rowConfig)?void 0:n.height)?r:32}function D(e){const t=e.slice(2);return`${t[0].toLowerCase()}${t.slice(1)}`}function O(e){return`on${e[0].toUpperCase()}${e.slice(1)}`}function P(t,n=!0){const r=n?e(new Map):new Map;return{uuidMap:r,getItemFromUUID:function(e){return r.get(e)||r.set(e,t()),r.get(e)},setItemFromUUID:function(e,t){r.set(e,t)},removeItemFromUUID:function(e){r.delete(e)}}}async function x(e,t,r,i,o=2){const l=function(){var o;const l=null==(o=n(i))?void 0:o.getColumnByField(e.field);if(!l)return;const u=y(l);return u?f(u.separateWidth)?u.separateWidth({column:l,row:t,rowIndex:r,$table:n(i)}):d(u.separateWidth)?u.separateWidth:l.renderWidth:l.renderWidth}();return d(l)&&l>0?l:o<=0?function(){const t=+e.colWidth;return d(t)?t:64}():(await u(0),x(e,t,r,i,o-1))}function A(e){const i=t(h);function o(){var t;const r=n(e);return{$table:r.$table,value:r.row[r.column.field],row:r.row,column:{...r.column,...null==(t=r.column.editRender)?void 0:t.props},index:r.rowIndex>-1?r.rowIndex:r.$rowIndex}}function l(e={}){i("formChange",{...o(),...r(e)})}function u(e={}){i("formClick",{...o(),...r(e)})}return{emitFormChange:function(){l()},emitFormClick:function(){u()},emitFormChangeWithParams:l,emitFormClickWithParams:u}}function y(e){var t;return null==(t=e.editRender)?void 0:t.props}const $=Object.freeze({createDefaultRenderCell:function(){return function({props:e},{row:n,column:r}){if("bottom"!==(null==e?void 0:e.separatePlacement))return c(n[r.field]);const i=t(F),l=S(i,n);if(!l)return c(n[r.field]);const{originalData:u=n,isLastRow:a}=l;return c(a?u[r.field]:null);function c(e){return[o("span",{title:U(r,e),class:"iho-table__colorAndIcon"},[e])]}}},createRenderEdit:function(e){return function({props:t},n){return e({...n,fieldItem:t||{},...A(n)})}},isEditableColumn(e,t){var n;return!1!==(null==(n=e.editConfig)?void 0:n.showIcon)&&t.editRender&&!1!==t.editRender.enabled},hasFilter(e){return this.hasDateFilter(e)||this.hasOptionFilter(e)||this.hasTextFilter(e)},hasDynamicFilter:e=>e.optionInfo&&(e.optionInfo.dynamicOptionInfo||e.optionInfo.list),hasRemoteSearchFilter(e){var t;return"remote"===(null==(t=e.filterSetting)?void 0:t.type)},hasOptionFilter(e){var t;if(M(e))return!0;const n=null==(t=e.settingObj)?void 0:t.showSetting;if(n&&n.length)return n.some((e=>{var t;return e.change_text&&(null==(t=e.filter)?void 0:t.length)}));let r=e.fieldSetting;return p(r)&&(r=l(r||"")),m(r)&&((i=r).notParticipatingSearch!==I.POSITIVE&&"manual"===(null==(o=i.mapping)?void 0:o.type));var i,o},hasDateFilter(e){var t;return"daterange"===(null==(t=null==e?void 0:e.filterSetting)?void 0:t.type)},hasTextFilter(e){var t;return"text"===(null==(t=null==e?void 0:e.filterSetting)?void 0:t.type)},hasTitlePrefix(e){var t,n;return e&&((null==(t=e.titlePrefix)?void 0:t.content)||(null==(n=e.titlePrefix)?void 0:n.useHTML))}}),_=Object.freeze({isPositive:e=>e===E.POSITIVE||e===I.POSITIVE,isNegative:e=>e===E.NEGATIVE||e===I.NEGATIVE,notPositive:e=>e!==E.POSITIVE&&e!==I.POSITIVE,notNegative:e=>e!==E.NEGATIVE&&e!==I.NEGATIVE});function N(e){return[T.TRANSFORM_WITH_SPAN_METHOD,T.TRANSFORM_TREE_TYPE].includes(`${e.isTree}`)}function H(e){return p(e)&&!!e.match(/^###\{[^{}]+}$/)}function V(e){try{return JSON.parse(e.replace(/^###/,""))}catch(e){return{}}}function W(e,t){if(e.$__SEPARATE||!t.editRender||!t.editRender.props)return e[t.field];const{fieldSetting:n}=t.editRender.props;if(!p(n))return e[t.field];const{mergedFeildExpression:r}=l(n);return r&&p(r)?r.replace(/#{(.+?)}/g,(function(t,n){let r=n?e[n.trim()]:null;H(r)&&(r=V(r).change_text);return r||(null==r?"--":r)})):e[t.field]}const j=["SEARCH","SELECT","RADIO","CHECKBOX"];function M(e){return e.notParticipatingSearch===E.NEGATIVE&&j.includes(C.getCellType(e))&&v(e.options)&&e.options.length}function U(e,t=""){return"tooltip"!==e.showOverflow&&p(t)?t:""}function G(e,t){var r,i,o;t=n(t)||"";const l=null!=(i=null==(r=e.editRender)?void 0:r.props)?i:{},u=a(t,(null==(o=null==l?void 0:l.componentProps)?void 0:o.valueFormat)||"HH:mm",new Date);return!c(u)}function L(e,t,r){var i,o;const l=null!=(o=null==(i=e.editRender)?void 0:i.props)?o:{};return r=n(r)||"",!c(new Date(r))||p(l.connectField)&&t[l.connectField]&&(l.isStartDate&&s(new Date(r),new Date(t[l.connectField]))<0||l.isEndDate&&s(new Date(r),new Date(t[l.connectField]))>0)}function k(e){var t,n;return(!0===e.variableHeight||"1"===e.variableHeight)&&(null!=(n=null==(t=e.editRender)?void 0:t.name)?n:C.getCellType(e))!==w.SEPARATE}function z(e){const t=e.internalData.tableFullColumn;return!!v(t)&&t.some((e=>{var t,n;return k(null!=(n=null==(t=e.editRender)?void 0:t.props)?n:{})}))}function B(e,t){return t?e?n=>[f(e)?e(n):e,f(t)?t(n):t]:t:e}function J(e,t){return t?e?n=>i([f(e)?e(n):e,f(t)?t(n):t]):t:e}function K(e){return function({option:t,column:n,row:r}){if(e&&v(r[e])&&r[e].length)return!1;const i=r[n.field];if(v(i))return i.some((e=>[t.label,t.value].includes(e)));if(p(i)){if(i===t.value||i===t.label)return!0;const{value:e,change_text:n}=V(i);return n===t.label||e===t.value}return null!=i&&t.value===i}}export{$ as IhoTableRenderHelper,_ as IhoTableStatusHelper,C as IhoTableUtils,R as IhoTableWarn,K as createIhoTableFilterMethod,D as eventListener2EventName,O as eventName2EventListener,x as getColumnRenderWidth,y as getLowCodeFieldFromField,b as getRowHeight,U as getTitle,M as isCompatibleColumn,L as isInvalidDate,G as isInvalidTime,H as isRichContent,N as isTransformTreeType,k as isVariableHeightColumn,z as isVariableHeightTable,B as mergeVxeClass,J as mergeVxeStyle,W as parseMergeField,V as parseRichContent,A as useIhoTableFormEvent,P as useUUIDMap};
|