cnhis-design-vue 3.2.8-release.4 → 3.2.9-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/classification/src/components/table-modal/index.vue.d.ts +3 -0
- package/es/components/fabric-chart/src/hooks/temperature/useCenter.js +1 -1
- package/es/components/fabric-chart/src/hooks/temperature/useOther.js +1 -1
- package/es/components/fabric-chart/src/hooks/temperature/useTemperatureChart.js +1 -1
- package/es/components/fabric-chart/src/hooks/useCumputedPoint.d.ts +1 -1
- package/es/components/fabric-chart/src/hooks/useCumputedPoint.js +1 -1
- package/es/components/field-set/src/FieldColor.vue.d.ts +17 -0
- package/es/components/field-set/src/FieldFilter.vue.d.ts +17 -0
- package/es/components/field-set/src/FieldSet.vue.d.ts +44 -1
- package/es/components/field-set/src/FieldSet.vue2.js +1 -1
- package/es/components/field-set/src/components/edit-dialog.vue2.js +1 -1
- package/es/components/field-set/src/components/table-row.vue.d.ts +17 -0
- package/es/components/field-set/src/components/table-row.vue2.js +1 -1
- package/es/components/field-set/src/types/index.d.ts +1 -1
- package/es/components/form-render/src/hooks/useFieldListAdaptor.js +1 -1
- package/es/components/iho-chat/index.d.ts +1 -0
- package/es/components/iho-chat/src/Index.vue.d.ts +1 -0
- package/es/components/iho-chat/src/api/index.d.ts +1 -0
- package/es/components/iho-chat/src/api/index.js +1 -1
- package/es/components/iho-chat/src/components/ChatFile.vue2.js +1 -1
- package/es/components/iho-chat/src/components/ChatFooter.vue.d.ts +13 -11
- package/es/components/iho-chat/src/components/ChatFooter.vue2.js +1 -1
- package/es/components/iho-chat/src/components/ChatMain.vue2.js +1 -1
- package/es/components/iho-chat/src/components/ContextMenu.js +1 -1
- package/es/components/iho-chat/src/components/PersonProfile.vue2.js +1 -1
- package/es/components/iho-chat/style/index.css +1 -1
- package/es/components/index.css +1 -1
- package/es/components/scale-view/src/ScaleView.vue2.js +1 -1
- package/es/env.d.ts +25 -25
- package/es/shared/package.json.js +1 -1
- package/package.json +2 -2
@@ -1 +1 @@
|
|
1
|
-
import{fabric as e}from"../../../../../shared/utils/fabricjs/index.js";import{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
|
+
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,S,Y;if(t.noRise&&p.show){const i=M(p,t)?V(a,35):(null==e?void 0:e[1])||0;if(p.text)w=l([x,M(p,t)?i:i+5],{value:p.text.split("").join("\n"),originY:"top",...p.style}),t.value||pe.add(w);else if(t.value){w=s([x,i,i+2*q],{...p.style})}w&&X.push(w),w&&M(p,t)&&he.add(w)}if(null==e?void 0:e[1]){if(t.rise&&c.show&&c.text&&(L=l([x,e[1]-(m?q:0)-5],{value:c.text.split("").join("\n"),originY:"bottom",...c.style}),X.push(L)),t.verified&&(S=l([x,e[1]-(m?q:0)-5],{value:"v",originX:"center",originY:"bottom",...g}),X.push(S)),h(t.physicsReduce)||h(t.drugReduce)){const l=V(a,null!=(d=t.physicsReduce)?d:t.drugReduce),s=l<e[1]&&(null==te?void 0:te.hypothermyViewCustom)?x+_/2:x;b=i([...e,s,l],{...v,...y.line,...n}),j=o((null==(f=null==y?void 0:y.point)?void 0:f.type)||"circle",{left:s,top:l,...y.point,...n,originY:l===ie?"bottom":"center"}),b&&X.push(b),j&&X.push(j)}t.respirator&&(Y=o(k.type,{left:x,top:e[1]-(m?q:0)-5,originX:"center",originY:"bottom",...k.style}),X.push(Y))}Object.assign(u,{reduceLine:{obj:b,type:"line"},noRiseText:{obj:w,top:p.text?5:2*q,isFixed:M(p,t)},riseText:{obj:L,top:(m?-q:0)-5},verifiedText:{obj:S,top:(m?-q:0)-5},reducePoint:{obj:j,type:"reduce"},respirator:{obj:Y,top:(m?-q:0)-5}})}(F,u,z,K),function(e,t,i,n){if(!(null==e?void 0:e.length)||!["pulse"].includes(a))return;const o=Math.max(...S),r=Math.min(...S);let u,c,d;const{upArrowShow:p=!1,limitValueShow:f=!1}=i;if(p&&+t.value>180){let t=e[1]-2.5*q,i=[e[1]-q/2,t];t<U.originY&&(t=e[1]+2.5*q,i=[t,e[1]+q/2]),u=s([e[0],i[0],i[1]],x,"up"),X.push(u)}if(f){const i={value:t.value,originX:"center",originY:"center",...b};if(+t.value>o){const t=u?e[1]+q/2+u.height:e[1]+q;c=l([e[0],t],i),X.push(c)}+t.value<r&&(c=l([e[0],e[1]-q],i),X.push(c))}if(w.show&&+t.value<r){const t=e[1];if(w.text)d=l([e[0],e[1]+5],{value:w.text.split("").join("\n"),originY:"top",...w.style});else{const i=t+2*q;d=s([e[0],t,i],{...w.style})}X.push(d)}Object.assign(n,{upArrow:{obj:u},limitValue:{obj:c,top:-q},belowMinValue:{obj:d,top:w.text?5:2*q,moveHide:!0}})}(F,u,z,K),function(n,l,s,u,c,d){let p,f;const{pointAttr:h={},lineAttr:g={},title:y="",key:x,type:b="circle"}=c,j=e.list[u+1],w=ye(a,e.list[u].value),L=l&&ye(a,j.value),S=()=>"pulse"==a&&s.pacemakerShow?m.value:W(s)?k.type:w&&"number"===Y?0:b;if(n&&l&&!s.breakpoint&&(!w&&!L||C)){f=i([...n,...l],{...g});const{obj:e}=(null==d?void 0:d.reducePoint)||{};if((null==e?void 0:e.top)<n[1]&&(null==te?void 0:te.hypothermyViewCustom)){const t=i([e.left,e.top,...l],{...g});X.unshift(t),Object.assign(d,{reduceRightLine:{obj:t,type:"reduce"}}),f.set("stroke","transparent")}}const M=S(),T=I[u-1],V={origin:{data:W(s)?{...s,value:k.fixedValue}:s,title:y,key:x||"",unit:r.unit,type:a,_type:v(y,a),dataIndex:t,index:u},leftLine:T,rightLine:f,otherObj:d,...s.pacemakerShow&&"pulse"==a?m.style:W(s)?k.style:h,lockMovementX:!0,...H(),...w?{selectable:!1,evented:!1,..."number"===Y?$:{}}:{}};n&&(T?V.leftLine.set("x2",n[0]):V.leftLine=null,p=o(M,{left:n[0],top:w&&!ne[1]?n[1]-5:n[1],...V}));I.push(f),p&&(x===ue[1]?ce.add(p):W(s)||de.add(p),function(e){Q.hovered&&(e.on("mouseover",(()=>{me(e,"hover")})),e.on("mouseout",(()=>{A.show=!1})));if(e.lockMovementX&&e.lockMovementY)return;e.on("moving",(()=>{!function(e){e.setCoords();const t="pain"===e.origin.type?Z:U;e.top<t.originY&&e.set("top",t.originY);e.top>t.endY&&e.set("top",t.endY)}(e),function(e){var t,i;null==(t=e.leftLine)||t.setCoords().set({x2:e.left,y2:e.top}),null==(i=e.rightLine)||i.setCoords().set({x1:e.left,y1:e.top}),Object.values(e.otherObj).forEach((t=>{const{obj:i,type:n="",top:o=0,isFixed:l,moveHide:s=!1}=t||{};"reduce"!==n&&i&&("line"===n?i.setCoords().set({x1:e.left,y1:e.top}):(l||i.setCoords().set({left:e.left,top:e.top+o}),s&&(E.value.remove(i),delete e.otherObj.obj)))})),ve(e)}(e),Q.hovered&&me(e)})),e.on("mouseup",(t=>{if(A.show=!1,1===t.button){const{type:t}=e.origin,i=P(t,e.top),n={...e.origin,data:{...e.origin.data,value:i}};E.value.discardActiveObject(),O("change",n),we(n,"change")}}))}(p),R.push(p),pe.add(p))}(F,N,u,j,z,K)})),"pulse"===a){const{key:t}=e;let i=null;ae.set(t,R.map(((e,t,n)=>{var o,l;const s=n[t+1];if(s&&f(e.left,1)===f(s.left,1)){const t=e.left-_/2;e.set("left",t+_/4),null==(o=e.rightLine)||o.set("x1",e.left),i=e.left+_/2,s.set("left",i)}else i&&(null==(l=e.leftLine)||l.set("x2",i),e.set("left",i)),i=null;return[e.left,e.top]})))}const z=I.filter((e=>e));E.value.add(...z,...R,...X)}function ye(e,t){return"pain"===e&&0==t}function me(e,t="moving"){const{title:i,unit:n,type:o,data:l}=e.origin;A.point={x:e.left,y:e.top};let s=`时间 ${((null==l?void 0:l.time)||C(e.left)).slice(-5)}`;A.list=[function(){const{drugReduce:r,physicsReduce:u}=l||{},a="hover"===t?l.value:P(o,e.top);if(h(r))return s+=(null==l?void 0:l.changeTime)?"—>"+(null==l?void 0:l.changeTime.slice(-5)):"",`药物降${"pain"==o?"痛":"温"} ${a}—>${r}${n||""}`;if(h(u))return s+=(null==l?void 0:l.changeTime)?"—>"+(null==l?void 0:l.changeTime.slice(-5)):"",`物理降${"pain"==o?"痛":"温"} ${a}—>${u}${n||""}`;return`${i} ${a}${n||""}`}(),s],A.show=!0}function xe(e){const[t]=F,i=j(F),n=t.start,o=i.end,l=c(e);return l>=n&&l<=o}function be(e,t){const i="pain"===t.type?Z:U;if(!g(e)||!xe(e.time))return;const n=T(e.time),o=V(t.type,e.value);return[n,o<i.originY?i.originY:o>i.endY?i.endY:o]}function je(e){const t=new Date,i=String(t.getMonth()+1).padStart(2,"0"),n=String(t.getDate()).padStart(2,"0"),o=c(`${t.getFullYear()}-${i}-${n} 23:59:59`),l=c(`${C(e)}:00`);return ee&&l<c(ee)?(D("exceedMin"),!1):!(l>o)||(D("exceedMax"),!1)}function we(e,t="add"){const{type:i,dataIndex:n,index:o,data:l,key:s}=e,r=fe.find((e=>e.type===i));if("add"===t){const e=d(i)?r.dataList.find((e=>e.enable)):r.dataList[n],t=m(l.time,e.list);e.list.splice(t,0,l)}else r.dataList[n].list[o]=l;ke()}function ke(){var e;pe.size&&(null==(e=E.value)||e.remove(...function(e){const t=[];return e.forEach((e=>{e&&t.push(e),(null==e?void 0:e.leftLine)&&t.push(null==e?void 0:e.leftLine),(null==e?void 0:e.rightLine)&&t.push(null==e?void 0:e.rightLine),Object.values((null==e?void 0:e.otherObj)||{}).forEach((e=>{(null==e?void 0:e.obj)&&t.push(null==e?void 0:e.obj)}))})),t}([...pe]))),pe.clear(),Le()}function Le(e){ae.clear(),pe.clear(),ce.clear(),he.clear(),de.clear(),fe.forEach((t=>{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.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{defaultStyle as t}from"../useDraw.js";import"date-fns";import{cloneDeep as i,last as l}from"lodash-es";import"../useEvent.js";import"vue";import"./useShadow.js";import"@vueuse/shared";import"naive-ui";import"@vueuse/core";function n(n,o,r,u,a,s){const{left:h,other:f,vitalSignsOriginY:c,xCellWidth:g,yCellHeight:v,endX:p}=o;let d=0;function m(i,l,o,u=!1){const a=[],s=u&&i.fixed&&i.fixedValue?i.fixedValue:i.value;String(s).split("").forEach(((l,n)=>{const o=new e.Text(l,{left:0,top:v*n,originX:"center",...t,objectCaching:!1,...i.style||{}});d=(v-(o.height||0))/2,a.push(o)}));const h=new e.Rect({left:0,top:0,width:g,height:v*a.length,fill:"transparent",originX:"center",...t}),{eventHighlight:c=!1}=f||{},p={originX:"center",left:l,top:o+d,baseTop:(i.baseTop||0)*v,trueLeft:l,trueHeight:a.length*v,objectCaching:!1,hoverCursor:"pointer",highlightObject:h,originData:i,selectable:!1,evented:c},m=new e.Group([h,...a],p);return function(e){const{highlightColor:t="#ffff00"}=f||{};e.on("mouseover",(()=>{e.highlightObject.set("fill",t),n.value.requestRenderAll()})),e.on("mouseout",(()=>{e.highlightObject.set("fill","transparent"),n.value.requestRenderAll()})),e.on("mousedown",(function(){r("eventClick",e.originData)}))}(m),n.value.add(m),m}!function(){var e,t;if(!(null==f?void 0:f.list))return!1;const n=[],o=[];i(f.list).forEach(((e,t)=>{e.value=e.value||"";const i=0===t?"vertical":e.align||"vertical",l=u(e.time,!0);if(l>p)return;const n=o.find((e=>e.left==l));if(n)n[i].push(e);else{const t={left:l,vertical:[],horizontal:[]};t[i].push(e),o.push(t)}}));const r=null==(t=null==(e=h.yScaleValue)?void 0:e.find((e=>"temperature"===e.type)))?void 0:t.list,d=(null==r?void 0:r.length)?a("temperature",
|
1
|
+
import{fabric as e}from"../../../../../shared/utils/fabricjs/index.js";import{defaultStyle as t}from"../useDraw.js";import"date-fns";import{cloneDeep as i,last as l}from"lodash-es";import"../useEvent.js";import"vue";import"./useShadow.js";import"@vueuse/shared";import"naive-ui";import"@vueuse/core";function n(n,o,r,u,a,s){const{left:h,other:f,vitalSignsOriginY:c,xCellWidth:g,yCellHeight:v,endX:p}=o;let d=0;function m(i,l,o,u=!1){const a=[],s=u&&i.fixed&&i.fixedValue?i.fixedValue:i.value;String(s).split("").forEach(((l,n)=>{const o=new e.Text(l,{left:0,top:v*n,originX:"center",...t,objectCaching:!1,...i.style||{}});d=(v-(o.height||0))/2,a.push(o)}));const h=new e.Rect({left:0,top:0,width:g,height:v*a.length,fill:"transparent",originX:"center",...t}),{eventHighlight:c=!1}=f||{},p={originX:"center",left:l,top:o+d,baseTop:(i.baseTop||0)*v,trueLeft:l,trueHeight:a.length*v,objectCaching:!1,hoverCursor:"pointer",highlightObject:h,originData:i,selectable:!1,evented:c},m=new e.Group([h,...a],p);return function(e){const{highlightColor:t="#ffff00"}=f||{};e.on("mouseover",(()=>{e.highlightObject.set("fill",t),n.value.requestRenderAll()})),e.on("mouseout",(()=>{e.highlightObject.set("fill","transparent"),n.value.requestRenderAll()})),e.on("mousedown",(function(){r("eventClick",e.originData)}))}(m),n.value.add(m),m}!function(){var e,t;if(!(null==f?void 0:f.list))return!1;const n=[],o=[];i(f.list).forEach(((e,t)=>{e.value=e.value||"";const i=0===t?"vertical":e.align||"vertical",l=u(e.time,!0);if(l>p)return;const n=o.find((e=>e.left==l));if(n)n[i].push(e);else{const t={left:l,vertical:[],horizontal:[]};t[i].push(e),o.push(t)}}));const r=null==(t=null==(e=h.yScaleValue)?void 0:e.find((e=>"temperature"===e.type)))?void 0:t.list,d=(null==r?void 0:r.length)?a("temperature",35):0;o.forEach((e=>{let t=c.originY,i=e.left,o=0,r=d,u=i;function a(e,t){var o,a;if((e=>e.fixed&&d&&(e.fixedValue||e.value))(e)){const h=[...s].find((e=>Math.abs(e.left-i)<1));h&&(t||Math.abs(i-u)>1)&&(r=h.top+h.height),u=i,n.push(m(e,i,r,!0)),r+=null!=(a=null==(o=l(n))?void 0:o.trueHeight)?a:0}}e.vertical.forEach(((r,u)=>{var s,h,f;const p=(r.baseTop||0)*v,d=(null==(s=l(n))?void 0:s.left)||0;0===u&&e.left<=d&&(i=d+g);if(n.filter((e=>e.trueLeft===i)).length){const e=String(r.value).length;t+=o,t+e*v+p>c.endY&&(t=c.originY,i+=g)}t+=p,String(r.value).length&&(n.push(m(r,i,t)),o=null!=(f=null==(h=l(n))?void 0:h.trueHeight)?f:0),a(r,0===u)})),e.horizontal.forEach(((t,o)=>{var r,u;const s=c.originY+(t.baseTop||0)*v,h=(null==(r=l(n))?void 0:r.left)||0;e.left<=h&&(i=h+g),String(t.value).length&&n.push(m(t,i,s)),a(t,0===(null==(u=e.vertical)?void 0:u.length)&&0===o)}))}))}()}export{n as useOther};
|
@@ -1 +1 @@
|
|
1
|
-
import{reactive as e,computed as a,watch as t,toRefs as l}from"vue";import{defaultBorderStyle as u}from"../useDraw.js";import"../../../../../shared/utils/fabricjs/index.js";import{useCumputedPoint as i}from"../useCumputedPoint.js";import{useCanvasEvent as n}from"../useEvent.js";import{setOtherType as r,getFloorNumber as o}from"../../utils/index.js";import{flatten as v}from"lodash-es";import{format as s,addDays as d}from"date-fns";import"naive-ui";import"@vueuse/core";import{useTop as c}from"./useTop.js";import{useLeft as h}from"./useLeft.js";import{useRight as p}from"./useRight.js";import{useCenter as g}from"./useCenter.js";import{useBottom as m}from"./useBottom.js";import{useOther as f}from"./useOther.js";function y(y,S,b,Y,
|
1
|
+
import{reactive as e,computed as a,watch as t,toRefs as l}from"vue";import{defaultBorderStyle as u}from"../useDraw.js";import"../../../../../shared/utils/fabricjs/index.js";import{useCumputedPoint as i}from"../useCumputedPoint.js";import{useCanvasEvent as n}from"../useEvent.js";import{setOtherType as r,getFloorNumber as o}from"../../utils/index.js";import{flatten as v}from"lodash-es";import{format as s,addDays as d}from"date-fns";import"naive-ui";import"@vueuse/core";import{useTop as c}from"./useTop.js";import{useLeft as h}from"./useLeft.js";import{useRight as p}from"./useRight.js";import{useCenter as g}from"./useCenter.js";import{useBottom as m}from"./useBottom.js";import{useOther as f}from"./useOther.js";function y(y,S,w,b,Y,D){const x=15,C=e({select:null,redrawPoints:null,clickMenu:null}),j=a((()=>{const{painSurplusCell:e=[0,0]}=S.data.grid||{};return~J.value?e:[0,0]})),V=a((()=>{var e,a;const t=(null==(a=null==(e=S.data.grid)?void 0:e.surplusCell)?void 0:a.slice())||[0,0,0,0];return 0===J.value?t[0]=t[0]+j.value[1]:J.value>0&&(t[2]=t[2]+j.value[0]),t})),H=a((()=>0===J.value?[j.value[0],V.value[1],V.value[2],V.value[3]]:J.value>0?[V.value[0],V.value[1],j.value[1],V.value[3]]:V.value)),X=a((()=>{const{top:e}=S.data;return e.date.show&&(e.date.height||x)||0})),L=a((()=>{var e;const{top:a}=S.data;return(null==(e=a.hospitalDays)?void 0:e.show)&&(a.hospitalDays.height||x)||0})),P=a((()=>{var e;const{top:a}=S.data;return(null==(e=a.operationDays)?void 0:e.show)&&(a.operationDays.height||x)||0})),M=a((()=>{var e,a,t;const{top:l}=S.data;return((null==(e=l.xScalevalue)?void 0:e.show)&&(l.xScalevalue.height||x)||0)+((null==(a=l.xScalevalue)?void 0:a.show)&&null!=(t=l.dayHeight)?t:0)})),I=a((()=>{var e;const{top:a}=S.data;return(null==(e=a.childbirthDays)?void 0:e.show)&&(a.childbirthDays.height||x)||0})),N=a((()=>{var e;const{bottom:a}=S.data;return(null==(e=null==a?void 0:a.breathing)?void 0:e.show)&&(a.breathing.height||30)||0})),k=a((()=>{const{grid:e}=S.data;return e.mainXCell*e.subXCell+V.value[1]+V.value[3]})),O=a((()=>{const{grid:e}=S.data,a=J.value>0?j.value[1]:j.value[0];return e.mainYCell*e.subYCell+V.value[0]+V.value[2]+a})),R=a((()=>{var e;const{width:a,right:t=null,top:l}=S.data;if(!t)return a;return a-(null!=(e=t.width)?e:0)})),W=a((()=>R.value-V.value[1]*G.value)),$=a((()=>{const{top:e,left:a}=S.data;return e.titleWidth+A.value})),q=a((()=>{const{bottom:e=null,height:a}=S.data;if(!e)return a;return a-(e.height||30)})),z=a((()=>{var e;const{top:a}=S.data,t=a.xScalevalue.show&&(null!=(e=a.dayHeight)?e:0)||0,l=a.xScalevalue.show&&(a.xScalevalue.height||x)||0;return X.value+t+l+L.value+P.value+I.value})),G=a((()=>(R.value-$.value)/k.value)),T=a((()=>(q.value-z.value)/O.value)),A=a((()=>{var e,a;const{left:t}=S.data;return(null==(e=t.icons)?void 0:e.show)&&((null==(a=t.icons)?void 0:a.width)||100)||0})),B=a((()=>{var e,a;const{top:t,grid:l}=S.data,u=(null==(a=null==(e=t.date.list)?void 0:e.slice)?void 0:a.call(e,0,l.mainXCell))||[],i=t.xScalevalue.times;let n=$.value-G.value;const r=t.date.startDate||s(new Date,"yyyy-MM-dd"),o=u.reduce(((e,a,t)=>0===t?e.concat(r):e.concat(s(d(new Date(r.replace(/-/g,"/")),t),"yyyy-MM-dd"))),[]).map((e=>i.map((a=>{n+=G.value;const t=Date.parse(`${e} ${a.start}`),l=Date.parse(`${e} ${a.end}`);return{start:t,end:l,left:n,center:n+G.value/2,scaleCell:(l-t)/G.value}}))));return v(o)})),E=a((()=>{var e;return(null==(e=S.data.grid)?void 0:e.event)||{selectable:!0,evented:!0,hovered:!0}})),F=a((()=>{const{left:e}=S.data;return v(e.yScaleValue.map((e=>e.dataList.filter((e=>e.show)).map(((a,t)=>({...a,bigType:r(a.title,e.type),unit:e.unit,dataIndex:t}))))))})),J=a((()=>{var e,a;const{left:t}=S.data,l=t.yScaleValue.findIndex((e=>"pain"===e.type));return l>-1&&(null==(a=null==(e=t.yScaleValue[l].dataList)?void 0:e[0])?void 0:a.show)?l:-1})),K=a((()=>{const{grid:e}=S.data;return-1===J.value?0:T.value*e.subYCell})),Q=a((()=>{const{left:e}=S.data,a={originY:z.value+j.value[0]*T.value,endY:q.value-j.value[1]*T.value};return 0===J.value&&e.yScaleValue.length>1?a.endY=a.originY+K.value:J.value===e.yScaleValue.length-1&&(a.originY=a.endY-K.value),a})),U=a((()=>{const{left:e}=S.data,a={originY:z.value+V.value[0]*T.value,endY:q.value-V.value[2]*T.value};return 0===J.value&&e.yScaleValue.length>1?a.originY=Q.value.endY+V.value[0]*T.value:J.value===e.yScaleValue.length-1&&(a.endY=Q.value.originY-V.value[2]*T.value),a})),Z=a((()=>{var e,a;const{top:t,grid:l}=S.data,u=[];for(const i in t)t[i].show&&u.push({...t[i],list:(null==(a=null==(e=t[i].list)?void 0:e.slice)?void 0:a.call(e,0,l.mainXCell))||[],key:i});return u.sort(((e,a)=>e.seq-a.seq))})),_=a((()=>{var e;const{left:a,right:t}=S.data,l=a.yScaleValue.find((e=>"temperature"===e.type)),u=(null==t?void 0:t.yScaleValue)||{};if(null==(e=null==l?void 0:l.list)?void 0:e.length){const e=(null==u?void 0:u.showdetailedScale)?l.list.reduce((e=>{const a=e[e.length-1];return a?e.concat([a+1,a+2]):e.concat([92])}),[]):[],a=l.list.map((e=>o(1.8*e+32)));Object.assign(u,{list:a,detailedList:e,spaceGridNumber:l.spaceGridNumber})}return u})),ee=e({canvasWidth:S.data.width,canvasHeight:S.data.height,borderStyle:{...u,...S.data.borderStyle||{}},selectionStyle:S.data.selectionStyle||{},dateHeight:X.value,hospitalDaysHeight:L.value,operationDaysHeight:P.value,xScalevalueHeight:M.value,childbirthDaysHeight:I.value,topList:Z.value,breathingHeight:N.value,hospitalizationDate:S.data.hospitalizationDate,grid:S.data.grid,top:S.data.top,left:S.data.left,right:S.data.right,bottom:S.data.bottom,other:S.data.other,painIndex:J.value,painHeight:K.value,painOriginY:Q.value,vitalSignsOriginY:U.value,gridXNumber:k.value,gridYNumber:O.value,iconsWidth:A.value,originX:$.value,originY:z.value,endX:R.value,endXLimit:W.value,endY:q.value,xCellWidth:G.value,yCellHeight:T.value,xScaleList:B.value,event:E.value,itemList:F.value,getRightInfo:_.value,config:S.data.config||{},surplusCell:V.value,painSurplusCell:j.value,mainSurplusCell:H.value}),{computedX:ae,computedY:te,getXValue:le,getYValue:ue}=i(ee);return t((()=>y.value),(e=>{e&&function(){c(y,ee);const{setPopup:e,isAddPoint:a,updateData:t,redrawPoints:l,clickMenu:u,gridPoints:i,fixedNoRisePoints:r}=g(y,ee,w,ae,te,le,ue,S.addRenderItem,Y,D);C.redrawPoints=l,C.clickMenu=u;const{drawScaleValue:o}=h(y,ee,w,e,Y,ae,te,le,ue,a,t,i);p(y,ee,o),m(y,ee),f(y,ee,w,ae,te,r);const{select:v}=n(y,ee,w);C.select=v}()}),{immediate:!0}),{propItems:ee,...l(C)}}export{y as useTemperatureChart};
|
@@ -2,7 +2,7 @@ import { IPointType } from '../interface';
|
|
2
2
|
import { AnyObject } from '../../../../shared/types';
|
3
3
|
export declare function useCumputedPoint(propItems: AnyObject): {
|
4
4
|
computedX: (value: number | string, setAllCenter?: boolean) => any;
|
5
|
-
computedY: (type:
|
5
|
+
computedY: (type: string, value: number | string) => number;
|
6
6
|
getXValue: (pointX: number) => string | undefined;
|
7
7
|
getYValue: (type: IPointType, pointY: number) => number;
|
8
8
|
};
|
@@ -1 +1 @@
|
|
1
|
-
import{format as
|
1
|
+
import{format as e}from"date-fns";import{getTime as n,getFloorNumber as t}from"../utils/index.js";import{last as l}from"lodash-es";function i(i){const{xScaleList:u,xCellWidth:r,yCellHeight:c,left:o,vitalSignsOriginY:a,painOriginY:d,canvasWidth:s}=i;function f(e){let n=0;const t=o.yScaleValue.find((n=>n.type===e)),l=(null==t?void 0:t.list)||[];return l.length?(n=c/((l[1]-l[0])/t.spaceGridNumber),{yScaleCell:n,list:l}):{yScaleCell:n,list:l}}return{computedX:function(e,t=!1){const i=n(e),[r]=u,c=l(u);if(i<r.start)return 0;if(i>c.end)return s;const o=u.findIndex((e=>e.end>=i));if(o>-1){return u[o].center}},computedY:function(e,n){const{yScaleCell:t,list:l}=f(e),i=+n-Math.min(...l);return("pain"===e?d.endY:a.endY)-t*i},getXValue:function(n){const t=u.findIndex((e=>e.left+r>=n));if(t>-1){const l=u[t],i=n-l.left,r=l.scaleCell*i,c=l.start+r;return e(new Date(c),"yyyy-MM-dd HH:mm")}},getYValue:function(e,n){const{yScaleCell:l,list:i}=f(e),u=i.length?Math.min(...i):0,r="pain"===e?d.endY:a.endY;return t((r-n)/l+u)}}}function u(l){const{xAxis:i,originX:u,originY:r,xCellWidth:c,endY:o,timeXCell:a,startTime:d,scaleValues:s}=l;return{computedX:function(e){return(n(e)-d)/a+u},computedY:function(e,n,t){const[i]=n;return o-(+t-i)*l[`${e}YCell`]},getXValue:function(n){return e(new Date((n-u)*a+d),"yyyy-MM-dd HH:mm")},getYValue:function(e,n){const i=s.find((n=>[n.key,n.type||""].includes(e))),[u]=(null==i?void 0:i.range)||[0],r=(o-n)/l[`${e}YCell`]+u;return t(r)}}}function r(e){const{config:n,xCellWidth:l,yCellHeight:i}=e,{hz:u,mainXCellValue:r,valueUnit:c,mainYCellValue:o}=n;return{computedX:function(e){return e/u/r*l},computedY:function(e){return("uv"===c?.001*e:"v"===c?1e3*e:e)/o*i},getXValue:function(e){return t(r/l*e)},getYValue:function(e){return t(o/i*e)}}}export{u as useBirthProcessCumputedPoint,i as useCumputedPoint,r as useElectrocardiogramCumputedPoint};
|
@@ -231,6 +231,10 @@ declare const _default: import("vue").DefineComponent<{
|
|
231
231
|
columnWidthProps: {
|
232
232
|
type: ObjectConstructor;
|
233
233
|
};
|
234
|
+
hideExpressionOption: {
|
235
|
+
type: PropType<AnyObject[]>;
|
236
|
+
default: () => never[];
|
237
|
+
};
|
234
238
|
}, {
|
235
239
|
fixedWayOptions: {
|
236
240
|
label: string;
|
@@ -325,6 +329,10 @@ declare const _default: import("vue").DefineComponent<{
|
|
325
329
|
columnWidthProps: {
|
326
330
|
type: ObjectConstructor;
|
327
331
|
};
|
332
|
+
hideExpressionOption: {
|
333
|
+
type: PropType<AnyObject[]>;
|
334
|
+
default: () => never[];
|
335
|
+
};
|
328
336
|
}>> & {
|
329
337
|
onUpdateChecked?: ((...args: any[]) => any) | undefined;
|
330
338
|
onEdit?: ((...args: any[]) => any) | undefined;
|
@@ -342,6 +350,10 @@ declare const _default: import("vue").DefineComponent<{
|
|
342
350
|
label: string;
|
343
351
|
value: number;
|
344
352
|
}[];
|
353
|
+
selectProps: (field: string) => {
|
354
|
+
valueField: string;
|
355
|
+
labelField: string;
|
356
|
+
};
|
345
357
|
getOptions: (column: AnyObject) => any;
|
346
358
|
setDisabled: (column: AnyObject) => any;
|
347
359
|
getStyle: (column: AnyObject) => import("vue").CSSProperties;
|
@@ -442,6 +454,10 @@ declare const _default: import("vue").DefineComponent<{
|
|
442
454
|
columnWidthProps: {
|
443
455
|
type: ObjectConstructor;
|
444
456
|
};
|
457
|
+
hideExpressionOption: {
|
458
|
+
type: PropType<AnyObject[]>;
|
459
|
+
default: () => never[];
|
460
|
+
};
|
445
461
|
}>> & {
|
446
462
|
onUpdateChecked?: ((...args: any[]) => any) | undefined;
|
447
463
|
onEdit?: ((...args: any[]) => any) | undefined;
|
@@ -491,6 +507,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
491
507
|
isHighlight: boolean;
|
492
508
|
isFieldSet: boolean;
|
493
509
|
fieldDescribeMode: "column" | "tooltip";
|
510
|
+
hideExpressionOption: AnyObject[];
|
494
511
|
}>;
|
495
512
|
EditDialog: import("vue").DefineComponent<{
|
496
513
|
visible: {
|
@@ -253,6 +253,10 @@ declare const _default: import("vue").DefineComponent<{
|
|
253
253
|
columnWidthProps: {
|
254
254
|
type: ObjectConstructor;
|
255
255
|
};
|
256
|
+
hideExpressionOption: {
|
257
|
+
type: PropType<AnyObject[]>;
|
258
|
+
default: () => never[];
|
259
|
+
};
|
256
260
|
}, {
|
257
261
|
fixedWayOptions: {
|
258
262
|
label: string;
|
@@ -347,6 +351,10 @@ declare const _default: import("vue").DefineComponent<{
|
|
347
351
|
columnWidthProps: {
|
348
352
|
type: ObjectConstructor;
|
349
353
|
};
|
354
|
+
hideExpressionOption: {
|
355
|
+
type: PropType<AnyObject[]>;
|
356
|
+
default: () => never[];
|
357
|
+
};
|
350
358
|
}>> & {
|
351
359
|
onUpdateChecked?: ((...args: any[]) => any) | undefined;
|
352
360
|
onEdit?: ((...args: any[]) => any) | undefined;
|
@@ -364,6 +372,10 @@ declare const _default: import("vue").DefineComponent<{
|
|
364
372
|
label: string;
|
365
373
|
value: number;
|
366
374
|
}[];
|
375
|
+
selectProps: (field: string) => {
|
376
|
+
valueField: string;
|
377
|
+
labelField: string;
|
378
|
+
};
|
367
379
|
getOptions: (column: AnyObject) => any;
|
368
380
|
setDisabled: (column: AnyObject) => any;
|
369
381
|
getStyle: (column: AnyObject) => import("vue").CSSProperties;
|
@@ -464,6 +476,10 @@ declare const _default: import("vue").DefineComponent<{
|
|
464
476
|
columnWidthProps: {
|
465
477
|
type: ObjectConstructor;
|
466
478
|
};
|
479
|
+
hideExpressionOption: {
|
480
|
+
type: PropType<AnyObject[]>;
|
481
|
+
default: () => never[];
|
482
|
+
};
|
467
483
|
}>> & {
|
468
484
|
onUpdateChecked?: ((...args: any[]) => any) | undefined;
|
469
485
|
onEdit?: ((...args: any[]) => any) | undefined;
|
@@ -513,6 +529,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
513
529
|
isHighlight: boolean;
|
514
530
|
isFieldSet: boolean;
|
515
531
|
fieldDescribeMode: "column" | "tooltip";
|
532
|
+
hideExpressionOption: AnyObject[];
|
516
533
|
}>;
|
517
534
|
setStyle: typeof setStyle;
|
518
535
|
}, 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<{
|
@@ -79,6 +79,13 @@ declare const _default: import("vue").DefineComponent<{
|
|
79
79
|
columnWidthProps: {
|
80
80
|
type: ObjectConstructor;
|
81
81
|
};
|
82
|
+
showHideExpression: {
|
83
|
+
type: BooleanConstructor;
|
84
|
+
};
|
85
|
+
hideExpressionOption: {
|
86
|
+
type: PropType<AnyObject[]>;
|
87
|
+
default: () => never[];
|
88
|
+
};
|
82
89
|
}, {
|
83
90
|
fieldsMapping: Record<string, string>;
|
84
91
|
attrs: {
|
@@ -161,15 +168,24 @@ declare const _default: import("vue").DefineComponent<{
|
|
161
168
|
columnWidthProps: {
|
162
169
|
type: ObjectConstructor;
|
163
170
|
};
|
171
|
+
showHideExpression: {
|
172
|
+
type: BooleanConstructor;
|
173
|
+
};
|
174
|
+
hideExpressionOption: {
|
175
|
+
type: PropType<AnyObject[]>;
|
176
|
+
default: () => never[];
|
177
|
+
};
|
164
178
|
}>> & {
|
165
179
|
onSave?: ((...args: any[]) => any) | undefined;
|
166
180
|
onClose?: ((...args: any[]) => any) | undefined;
|
167
181
|
onReset?: ((...args: any[]) => any) | undefined;
|
168
182
|
}>>;
|
169
183
|
emit: (event: "close" | "save" | "reset", ...args: any[]) => void;
|
184
|
+
resetKey: import("vue").Ref<number>;
|
170
185
|
keyword: import("vue").Ref<string>;
|
171
186
|
tableBodyRef: import("vue").Ref<HTMLDivElement | undefined>;
|
172
187
|
newFields: import("vue").Ref<AnyObject[]>;
|
188
|
+
defaultColumns: FieldSetColumnItem[];
|
173
189
|
columns: import("vue").Ref<{
|
174
190
|
[x: string]: any;
|
175
191
|
title: string;
|
@@ -209,6 +225,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
209
225
|
fieldDescribeMode: "column" | "tooltip";
|
210
226
|
developMode: boolean;
|
211
227
|
columnWidthProps: Record<string, any> | undefined;
|
228
|
+
hideExpressionOption: AnyObject[];
|
212
229
|
};
|
213
230
|
searchData: {
|
214
231
|
keyword: string;
|
@@ -391,6 +408,10 @@ declare const _default: import("vue").DefineComponent<{
|
|
391
408
|
columnWidthProps: {
|
392
409
|
type: ObjectConstructor;
|
393
410
|
};
|
411
|
+
hideExpressionOption: {
|
412
|
+
type: PropType<AnyObject[]>;
|
413
|
+
default: () => never[];
|
414
|
+
};
|
394
415
|
}, {
|
395
416
|
fixedWayOptions: {
|
396
417
|
label: string;
|
@@ -485,6 +506,10 @@ declare const _default: import("vue").DefineComponent<{
|
|
485
506
|
columnWidthProps: {
|
486
507
|
type: ObjectConstructor;
|
487
508
|
};
|
509
|
+
hideExpressionOption: {
|
510
|
+
type: PropType<AnyObject[]>;
|
511
|
+
default: () => never[];
|
512
|
+
};
|
488
513
|
}>> & {
|
489
514
|
onUpdateChecked?: ((...args: any[]) => any) | undefined;
|
490
515
|
onEdit?: ((...args: any[]) => any) | undefined;
|
@@ -502,6 +527,10 @@ declare const _default: import("vue").DefineComponent<{
|
|
502
527
|
label: string;
|
503
528
|
value: number;
|
504
529
|
}[];
|
530
|
+
selectProps: (field: string) => {
|
531
|
+
valueField: string;
|
532
|
+
labelField: string;
|
533
|
+
};
|
505
534
|
getOptions: (column: AnyObject) => any;
|
506
535
|
setDisabled: (column: AnyObject) => any;
|
507
536
|
getStyle: (column: AnyObject) => import("vue").CSSProperties;
|
@@ -602,6 +631,10 @@ declare const _default: import("vue").DefineComponent<{
|
|
602
631
|
columnWidthProps: {
|
603
632
|
type: ObjectConstructor;
|
604
633
|
};
|
634
|
+
hideExpressionOption: {
|
635
|
+
type: PropType<AnyObject[]>;
|
636
|
+
default: () => never[];
|
637
|
+
};
|
605
638
|
}>> & {
|
606
639
|
onUpdateChecked?: ((...args: any[]) => any) | undefined;
|
607
640
|
onEdit?: ((...args: any[]) => any) | undefined;
|
@@ -651,6 +684,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
651
684
|
isHighlight: boolean;
|
652
685
|
isFieldSet: boolean;
|
653
686
|
fieldDescribeMode: "column" | "tooltip";
|
687
|
+
hideExpressionOption: AnyObject[];
|
654
688
|
}>;
|
655
689
|
isArray: {
|
656
690
|
(value?: any): value is any[];
|
@@ -736,6 +770,13 @@ declare const _default: import("vue").DefineComponent<{
|
|
736
770
|
columnWidthProps: {
|
737
771
|
type: ObjectConstructor;
|
738
772
|
};
|
773
|
+
showHideExpression: {
|
774
|
+
type: BooleanConstructor;
|
775
|
+
};
|
776
|
+
hideExpressionOption: {
|
777
|
+
type: PropType<AnyObject[]>;
|
778
|
+
default: () => never[];
|
779
|
+
};
|
739
780
|
}>> & {
|
740
781
|
onSave?: ((...args: any[]) => any) | undefined;
|
741
782
|
onClose?: ((...args: any[]) => any) | undefined;
|
@@ -766,9 +807,11 @@ declare const _default: import("vue").DefineComponent<{
|
|
766
807
|
developMode: boolean;
|
767
808
|
footerFlag: boolean;
|
768
809
|
fieldDescribeMode: "column" | "tooltip";
|
769
|
-
|
810
|
+
hideExpressionOption: AnyObject[];
|
770
811
|
showSearch: boolean;
|
812
|
+
customColumns: FieldSetColumnItem[];
|
771
813
|
showSortPriority: boolean;
|
772
814
|
showHeadFilter: boolean;
|
815
|
+
showHideExpression: boolean;
|
773
816
|
}>;
|
774
817
|
export default _default;
|
@@ -1 +1 @@
|
|
1
|
-
import{defineComponent as e,useAttrs as l,ref as t,computed as i,reactive as o,watch as d,openBlock as a,createElementBlock as r,createBlock as s,unref as n,withKeys as u,withModifiers as c,createCommentVNode as f,createElementVNode as
|
1
|
+
import{defineComponent as e,useAttrs as l,ref as t,computed as i,reactive as o,watch as d,openBlock as a,createElementBlock as r,createBlock as s,unref as n,withKeys as u,withModifiers as c,createCommentVNode as f,createElementVNode as p,Fragment as h,renderList as m,normalizeStyle as y,withCtx as v,createTextVNode as b,toDisplayString as x,createVNode as g,normalizeClass as k,mergeProps as w,renderSlot as S}from"vue";import{NInput as A,NCheckbox as _,NTooltip as E,NIcon as D,NPopconfirm as W,NButton as C}from"naive-ui";import P from"../../../shared/components/VueDraggable/src/vuedraggable.js";import F from"./components/table-row.vue.js";import{isArray as M,cloneDeep as H,isString as B,omit as N}from"lodash-es";import{isDisable as j,setStyle as q,isDraggableItem as O,isDraggable as V,getGroupTree as R}from"./utils/index.js";import{uuidGenerator as I}from"../../../shared/utils/index.js";import{HelpCircleSharp as U}from"@vicons/ionicons5";const T={class:"main-wrapper"},K={class:"main-wrapper__table-header"},G=p("span",null,"数值越小,优先级越高",-1),L=["tabindex"],$={key:1,class:"main-wrapper__table-footer"};var z=e({__name:"FieldSet",props:{fields:{type:Array,default:()=>[]},footerFlag:{type:Boolean,default:!0},type:{type:String,default:"old"},isEdit:{type:Boolean,default:!1},showColumnNames:{type:Array},groupSetting:{type:Object},customColumns:{type:Array,default:()=>[]},showSeq:{type:Boolean,default:!1},showSearch:{type:Boolean,default:!1},showSortPriority:{type:Boolean,default:!1},showHeadFilter:{type:Boolean,default:!1},fieldShowMaxValue:{type:Number},rowDraggable:{type:Boolean,default:!0},fieldDescribeMode:{type:String,default:"tooltip"},developMode:{type:Boolean},columnWidthProps:{type:Object},showHideExpression:{type:Boolean},hideExpressionOption:{type:Array,default:()=>[]}},emits:["save","close","reset"],setup(e,{expose:z,emit:J}){const Q=e,X={sid:"id",columnName:"name",isShow:"show",isSort:"sort",isFixed:"fixedWay",colWidth:"columnWidth"};l();const Y=t(Date.now()),Z=t(""),ee=t(),le=t([]),te=[{title:"所有字段",type:"text",field:"title"},{title:"显示",type:"checkbox",checkedAll:!1,disabledAll:!!Q.fieldShowMaxValue,field:"show",fieldShowMaxValue:Q.fieldShowMaxValue},{title:"编辑",type:"checkbox",checkedAll:!1,disabledAll:!1,field:"editable"},{title:"必填",type:"checkbox",checkedAll:!1,disabledAll:!1,field:"required"},{title:"排序",type:"checkbox",checkedAll:!1,disabledAll:!1,field:"sort"},{title:"加粗",type:"checkbox",checkedAll:!1,disabledAll:!1,field:"bold"},{title:"默认排序",type:"select",field:"sortDirection"},{title:"排序优先级",type:"select",field:"sortPriority"},{title:"固定",type:"select",field:"fixedWay"},{title:"自定义标题",type:"input",field:"alias"},{title:"列宽",type:"inputNumber",field:"columnWidth"},{title:"表头筛选",type:"checkbox",isHeadCheckHide:!0,field:"isShowHeaderFilter"},{title:"脱敏配置",type:"select",field:"hideExpression"}],ie=t([]),oe=i((()=>le.value.flat())),de=i((()=>oe.value.some((e=>e.feildDescribe)))),ae=o({columns:ie,data:oe,onUpdateChecked:function({checked:e,column:l}){const t=!e||me(l.field);l.checkedAll=!t},draggable:Q.rowDraggable,isFieldSet:!0,fieldDescribeMode:Q.fieldDescribeMode,developMode:Q.developMode,columnWidthProps:Q.columnWidthProps,hideExpressionOption:Q.hideExpressionOption}),re={keyword:Z.value,idx:0,startIdx:0},se=()=>{J("save")},ne=()=>{J("close")};function ue(){le.value=ce(),he(),Y.value=Date.now(),J("reset")}function ce(){const e=H(Q.fields).map((e=>({...e,uuid:I()})));return Object.keys(X).forEach((l=>{e.forEach((e=>{"old"==Q.type&&Reflect.has(e,l)&&("isFixed"==l?e.fixedWay=1==e[l]?"LEFT":2==e[l]?"RIGHT":"NONE":["isShow","isSort"].includes(l)&&"boolean"!=typeof l?e[X[l]]=1==e[l]:e[X[l]]=e[l],Reflect.deleteProperty(e,l)),e.columnWidth=+e.columnWidth||null,Reflect.has(e,"alias")||(e.alias=""),Reflect.has(e,"bold")||(e.bold=!1),e.draggable=!!V(e)}))})),function(e){if(Q.groupSetting){return R(Q.groupSetting,e).reduce(((t,i)=>{const o=B(i)?e.find((e=>e.name===i)):l(i.children);return o&&t.push(o),t}),[])}return e;function l(t){const i=[];return t.forEach((t=>{if(t.children)i.push(...l(t.children));else{const l=e.find((e=>e.name===t));l&&i.push(l)}})),i}}(e)}function fe(){const e=re.keyword!==Z.value;let l=Z.value?oe.value.findIndex(((l,t)=>{var i;if(null==(i=l.title)?void 0:i.includes(Z.value))return!!e||t>re.idx})):0;-1!==l||e||(l=re.startIdx),ee.value.scrollTop=52*l,Object.assign(re,{keyword:Z.value,idx:l},e?{startIdx:l}:{})}function pe(e){var l;return!!Z.value&&(null==(l=e.title)?void 0:l.includes(Z.value))}function he(){var e,l;ie.value=H(te),(null==(e=Q.showColumnNames)?void 0:e.length)&&(ie.value=te.filter((e=>{var l,t;return"title"===e.field||(null==(t=null==(l=Q.showColumnNames)?void 0:l.includes)?void 0:t.call(l,e.field))}))),(null==(l=Q.customColumns)?void 0:l.length)&&ie.value.push(...Q.customColumns),"column"===Q.fieldDescribeMode&&de.value&&ie.value.push({title:"字段描述",type:"text",field:"feildDescribe"}),Q.showSeq&&ie.value.splice(1,0,{title:"排序",type:"text",field:"seq"}),ie.value.forEach((e=>{if(e.isShow=function(e){return!(["editable","required"].includes(e.field)&&!Q.isEdit||"sortPriority"===e.field&&!Q.showSortPriority||"isShowHeaderFilter"===e.field&&!Q.showHeadFilter||"hideExpression"===e.field&&!Q.showHideExpression)}(e),"checkbox"===e.type){const l=le.value.flat().every((l=>!Reflect.has(l,e.field)));e.checkedAll=!me(e.field)&&!l}}))}function me(e){return le.value.flat().some((l=>!j(l,e)&&!l[e]&&"0001"!=l.id))}function ye(e){return!!O(e.relatedContext.element)}return d([()=>Q.fields,()=>{var e;return null==(e=Q.showColumnNames)?void 0:e.length}],(([e,l])=>{e.length>0&&(le.value=ce(),he())}),{immediate:!0,deep:!0}),z({getTableFields:function(){let e=[];return e="old"==Q.type?oe.value.map(((e,l)=>({id:e.id,field:e.name,visible:e.show,sequence:l,sortable:e.sort,title:e.alias,fixed:e.fixedWay,minWidth:e.columnWidth,bold:e.bold,sortDirection:e.sortDirection,sortPriority:e.sortPriority,...Q.isEdit?{required:e.required,editable:e.editable}:{}}))):oe.value,e.map((e=>N(e,["uuid"])))}}),(l,t)=>(a(),r("div",T,[e.showSearch?(a(),s(n(A),{key:0,class:"main-wrapper__search-wrapper",value:Z.value,"onUpdate:value":t[0]||(t[0]=e=>Z.value=e),valueModifiers:{trim:!0},placeholder:"请输入字段标题",onKeydown:u(c(fe,["prevent"]),["enter"])},null,8,["value","onKeydown"])):f("v-if",!0),p("div",K,[(a(!0),r(h,null,m(ie.value,((l,t)=>(a(),r(h,{key:t},[l.isShow?(a(),r("span",{key:0,class:"table-cell",style:y(n(q)(l,t,e.columnWidthProps))},["checkbox"!==l.type||l.isHeadCheckHide?(a(),r(h,{key:1},[b(x(l.title),1)],64)):(a(),s(n(_),{key:0,checked:l.checkedAll,"onUpdate:checked":[e=>l.checkedAll=e,e=>{return t=e,i=l.field,void oe.value.forEach((e=>{j(e,i)||(e[i]=t)}));var t,i}],disabled:l.disabledAll},{default:v((()=>[b(x(l.title),1)])),_:2},1032,["checked","onUpdate:checked","disabled"])),"sortPriority"===l.field?(a(),s(n(E),{key:2,trigger:"hover"},{trigger:v((()=>[g(n(D),{component:n(U),style:{top:"2px"}},null,8,["component"])])),default:v((()=>[G])),_:1})):f("v-if",!0)],4)):f("v-if",!0)],64)))),128))]),p("div",{class:"main-wrapper__table-body",ref_key:"tableBodyRef",ref:ee},[(a(),s(n(P),{modelValue:le.value,"onUpdate:modelValue":t[1]||(t[1]=e=>le.value=e),animation:"150","item-key":"id",filter:".disabled",draggable:".item",move:ye,disabled:!e.rowDraggable,key:Y.value},{item:v((({element:e,index:l})=>[e.hide?f("v-if",!0):(a(),r("div",{key:0,class:k(["item",n(O)(e)?"":"disabled"]),tabindex:l},[n(M)(e)?(a(!0),r(h,{key:0},m(e,((e,t)=>(a(),s(F,w(ae,{key:t,element:e,idx:l+1,"is-highlight":pe(e)}),null,16,["element","idx","is-highlight"])))),128)):(a(),s(F,w({key:1},ae,{element:e,idx:l+1,"is-highlight":pe(e)}),null,16,["element","idx","is-highlight"]))],10,L))])),_:1},8,["modelValue","disabled"]))],512),e.footerFlag?(a(),r("div",$,[f(" 底部按钮插槽 "),S(l.$slots,"footer",{},(()=>[g(n(W),{onPositiveClick:ue},{trigger:v((()=>[g(n(C),{style:{"margin-right":"8px"}},{default:v((()=>[b("恢复默认设置")])),_:1})])),default:v((()=>[b(" 确认要恢复系统默认设置吗? ")])),_:1}),g(n(C),{style:{"margin-right":"8px"},onClick:ne},{default:v((()=>[b("取消")])),_:1}),g(n(C),{type:"primary",onClick:se},{default:v((()=>[b("保存")])),_:1})]))])):f("v-if",!0)]))}});export{z as default};
|
@@ -1 +1 @@
|
|
1
|
-
import{defineComponent as e,inject as l,ref as o,computed as a,reactive as t,openBlock as i,createBlock as
|
1
|
+
import{defineComponent as e,inject as l,ref as o,computed as a,reactive as t,openBlock as i,createBlock as r,unref as s,withCtx as n,createVNode as u,normalizeStyle as c,createElementVNode as d,createCommentVNode as m}from"vue";import{useMessage as p,NModal as f,NForm as v,NFormItem as b,NInput as h,NColorPicker as g,NSelect as k,NCheckbox as _,NRadioGroup as w,NSpace as y,NRadio as C}from"naive-ui";import{useTheme as j}from"../../../../shared/hooks/useTheme.js";import"@vueuse/core";import"date-fns";import"lodash-es";import"@vue/shared";import"../../../../shared/utils/index.js";import"@vueuse/shared";import"../../../../shared/hooks/selectHooks/useSearchContent.js";import"@vicons/ionicons5";import"../../../../shared/hooks/useScrollLoading.js";import x from"./condition.vue.js";import F from"./edit-filter.vue.js";import{COLOR_MAP as N,InjectionFieldList as U}from"../constants/index.js";var O=e({__name:"edit-dialog",props:{visible:{type:Boolean,default:!1},isFieldColor:{type:Boolean,default:!0},row:{type:Object,default:null}},emits:["update:visible","confirm"],setup(e,{emit:O}){const S=e,q=j(),B=p(),E=Object.entries(N).map((([e,l])=>({label:l,value:e}))),R=Object.entries(N).map((([e])=>e)),D=l(U),H=o(),L=o(),P=o(!1),T=a((()=>S.row?S.isFieldColor?"修改":"过滤条件":"新增")),W=t({name:"",color:"",status:!0,columnName:"",colorScope:S.isFieldColor?"font":"background",condition:[],sqlExpression:""}),z=t({name:[{required:!0,message:"请输入名称",trigger:["blur"]}],color:[{required:!0,message:"请选择颜色",trigger:["blur"]}],columnName:[{required:!0,validator:(e,l)=>!(!l&&S.isFieldColor)||new Error("请选择字段"),trigger:["blur"]}]});function A(e){return u("span",{style:{"--color":e.value},class:"c-field-set__color-block"},[e.label])}function G(){var e;null==(e=H.value)||e.validate((async e=>{var l,o;if(e){const l=await e;B.warning(l[0][0].message)}else{if(S.isFieldColor||Object.assign(W,L.value.getData()),!(null==(l=W.condition)?void 0:l.length))return void B.warning("请配置过滤条件");const e=S.isFieldColor?{title:null==(o=D.find((e=>e.columnName===W.columnName)))?void 0:o.title}:{};O("confirm",{...W,...e}),I()}}))}function I(){O("update:visible",!1)}function J(e){Object.assign(W,e)}return function(){if(!S.row)return;Object.assign(W,S.row)}(),(l,o)=>(i(),r(s(f),{preset:"dialog",style:{width:"860px"},title:s(T),"close-on-esc":!1,"show-icon":!1,"mask-closable":!1,"positive-text":"确定","negative-text":"取消","trap-focus":!1,show:e.visible,onPositiveClick:G,onNegativeClick:I,onClose:I},{default:n((()=>[u(s(v),{ref_key:"formRef",ref:H,model:W,rules:z,"label-placement":"left","label-width":"auto","show-feedback":!1,"show-require-mark":!1,style:c({maxWidth:"500px",...s(q)})},{default:n((()=>[u(s(b),{label:"名称:",path:"name",style:{"margin-bottom":"10px"}},{default:n((()=>[u(s(h),{value:W.name,"onUpdate:value":o[0]||(o[0]=e=>W.name=e),placeholder:"请填写名称",clearable:""},null,8,["value"])])),_:1}),e.isFieldColor?(i(),r(s(b),{key:0,label:"颜色:",path:"color"},{default:n((()=>[u(s(g),{clearable:"",placeholder:"请选择颜色",value:W.color,"onUpdate:value":o[1]||(o[1]=e=>W.color=e),swatches:s(R),modes:["hex"],class:"c-field-set__color-picker"},null,8,["value","swatches"])])),_:1})):(i(),r(s(b),{key:1,label:"颜色:",path:"color"},{default:n((()=>[u(s(k),{value:W.color,"onUpdate:value":o[2]||(o[2]=e=>W.color=e),placeholder:"请选择颜色","render-label":A,options:s(E)},null,8,["value","options"])])),_:1})),u(s(b),{label:"显示:",path:"status"},{default:n((()=>[u(s(_),{checked:W.status,"onUpdate:checked":o[3]||(o[3]=e=>W.status=e)},null,8,["checked"])])),_:1}),u(s(b),{label:"颜色应用于:",path:"colorScope"},{default:n((()=>[u(s(w),{value:W.colorScope,"onUpdate:value":o[4]||(o[4]=e=>W.colorScope=e)},{default:n((()=>[u(s(y),null,{default:n((()=>[u(s(C),{label:"字体",value:"font"}),u(s(C),{label:"背景",value:"background"})])),_:1})])),_:1},8,["value"])])),_:1}),e.isFieldColor?(i(),r(s(b),{key:2,label:"字段:",path:"columnName",style:{"margin-bottom":"10px"}},{default:n((()=>[u(s(y),{class:"c-field-set__space",align:"center"},{default:n((()=>[u(s(k),{value:W.columnName,"onUpdate:value":o[5]||(o[5]=e=>W.columnName=e),placeholder:"请选择字段名","label-field":"title","value-field":"columnName",options:s(D)},null,8,["value","options"]),d("span",{class:"filter-btn",onClick:o[6]||(o[6]=()=>P.value=!0)},"筛选")])),_:1})])),_:1})):m("v-if",!0)])),_:1},8,["model","rules","style"]),e.isFieldColor?(i(),r(F,{key:1,visible:P.value,"onUpdate:visible":o[7]||(o[7]=e=>P.value=e),model:W,onConfirm:J},null,8,["visible","model"])):(i(),r(x,{key:0,ref_key:"conditionRef",ref:L,data:W},null,8,["data"]))])),_:1},8,["title","show"]))}});export{O as default};
|
@@ -82,6 +82,10 @@ declare const _default: import("vue").DefineComponent<{
|
|
82
82
|
columnWidthProps: {
|
83
83
|
type: ObjectConstructor;
|
84
84
|
};
|
85
|
+
hideExpressionOption: {
|
86
|
+
type: PropType<AnyObject[]>;
|
87
|
+
default: () => never[];
|
88
|
+
};
|
85
89
|
}, {
|
86
90
|
fixedWayOptions: {
|
87
91
|
label: string;
|
@@ -176,6 +180,10 @@ declare const _default: import("vue").DefineComponent<{
|
|
176
180
|
columnWidthProps: {
|
177
181
|
type: ObjectConstructor;
|
178
182
|
};
|
183
|
+
hideExpressionOption: {
|
184
|
+
type: PropType<AnyObject[]>;
|
185
|
+
default: () => never[];
|
186
|
+
};
|
179
187
|
}>> & {
|
180
188
|
onUpdateChecked?: ((...args: any[]) => any) | undefined;
|
181
189
|
onEdit?: ((...args: any[]) => any) | undefined;
|
@@ -193,6 +201,10 @@ declare const _default: import("vue").DefineComponent<{
|
|
193
201
|
label: string;
|
194
202
|
value: number;
|
195
203
|
}[];
|
204
|
+
selectProps: (field: string) => {
|
205
|
+
valueField: string;
|
206
|
+
labelField: string;
|
207
|
+
};
|
196
208
|
getOptions: (column: AnyObject) => any;
|
197
209
|
setDisabled: (column: AnyObject) => any;
|
198
210
|
getStyle: (column: AnyObject) => CSSProperties;
|
@@ -293,6 +305,10 @@ declare const _default: import("vue").DefineComponent<{
|
|
293
305
|
columnWidthProps: {
|
294
306
|
type: ObjectConstructor;
|
295
307
|
};
|
308
|
+
hideExpressionOption: {
|
309
|
+
type: PropType<AnyObject[]>;
|
310
|
+
default: () => never[];
|
311
|
+
};
|
296
312
|
}>> & {
|
297
313
|
onUpdateChecked?: ((...args: any[]) => any) | undefined;
|
298
314
|
onEdit?: ((...args: any[]) => any) | undefined;
|
@@ -342,5 +358,6 @@ declare const _default: import("vue").DefineComponent<{
|
|
342
358
|
isHighlight: boolean;
|
343
359
|
isFieldSet: boolean;
|
344
360
|
fieldDescribeMode: "column" | "tooltip";
|
361
|
+
hideExpressionOption: AnyObject[];
|
345
362
|
}>;
|
346
363
|
export default _default;
|
@@ -1 +1 @@
|
|
1
|
-
import{defineComponent as e,openBlock as
|
1
|
+
import{defineComponent as e,openBlock as l,createElementBlock as t,Fragment as i,renderList as n,normalizeStyle as o,unref as a,createBlock as r,withCtx as d,createVNode as u,createCommentVNode as s,createElementVNode as c,toDisplayString as f,normalizeClass as p,withDirectives as m,vShow as v,mergeProps as y,resolveDynamicComponent as b,createTextVNode as h}from"vue";import{NTooltip as g,NIcon as k,NCheckbox as x,NSelect as E,NColorPicker as S,NInput as D,NInputNumber as T,NPopconfirm as w}from"naive-ui";import{setStyle as O,setColorInfo as j,isShowExplicitRequired as C,isDisable as M}from"../utils/index.js";import{ReorderTwoOutline as N,HelpCircleOutline as U,CreateOutline as F,TrashOutline as _}from"@vicons/ionicons5";import{isFunction as P,isArray as A,range as H}from"lodash-es";import{COLOR_MAP as L}from"../constants/index.js";import{WIDGET_TYPE as R,SELECT_MAP as V,WIDGET_MAP as B,SELECT_TYPE as I,SELECT_DEFAULT_MAP as W,DATE_MAP as q,DATETIME_MAP as G}from"../constants/filter.js";const z={class:"row"},J=["title"],K=c("span",null,"拖拽调整顺序",-1);var Q=e({__name:"table-row",props:{element:{type:Object,default:()=>({})},columns:{type:Array,default:()=>[]},idx:{type:Number,default:1},data:{type:Array,default:()=>[]},isHighlight:{type:Boolean},index:{type:Number,default:0},isHighlightRow:{type:Boolean,default:!1},draggable:{type:Boolean,default:!0},isFieldSet:{type:Boolean,default:!1},fieldDescribeMode:{type:String,default:"tooltip"},developMode:{type:Boolean},columnWidthProps:{type:Object},hideExpressionOption:{type:Array,default:()=>[]}},emits:["updateChecked","edit"],setup(e,{emit:Q}){const X=e,Y=[{label:"不固定",value:"NONE"},{label:"左固定",value:"LEFT"},{label:"右固定",value:"RIGHT"}],Z=[{label:"不排序",value:"NONE"},{label:"升序",value:"ASC"},{label:"降序",value:"DESC"}],$=[{label:"字体",value:"font"},{label:"背景",value:"background"}],ee=Object.entries(L).map((([e])=>e));function le(){X.data.splice(X.index,1)}function te(){Q("edit",X.element)}function ie(){var e;return X.element.feildDescribe||(null==(e=X.element.settingObj)?void 0:e.fieldDescDev)}function ne(e){return"seq"===e?X.idx:"optionType"===e?X.element[e]&&X.element.type===R.SELECT?V[X.element[e]]:"":"type"===e?B[X.element[e]]:X.element[e]}function oe(e){if("defaultValue"===e){const{optionType:e}=X.element;return e===I.SELECT_MULTIPLE}return!1}function ae(e){if("0001"==X.element.id&&"fixedWay"!=e)return!1;const{isConfiguredHeaderFilter:l}=X.element;return"isShowHeaderFilter"===e?!!l:!(["explicitRequired","defaultValue"].includes(e)&&![R.DATE,R.DATETIME,R.SELECT].includes(X.element.type))}function re(e){return!["explicitRequired","defaultValue"].includes(e)||C(X.element)}function de(e){const l={valueField:"value",labelField:"label"};return"hideExpression"===e&&(l.valueField="id",l.labelField="name"),l}function ue(e){switch(e.field){case"fixedWay":return Y;case"sortDirection":return Z;case"sortPriority":return function(){const e=H(1,X.data.length+1).map((e=>({label:e.toString(),value:e}))),l=X.data.filter((e=>!!e.sortPriority&&e.uuid!==X.element.uuid)).map((e=>e.sortPriority));return e.filter((e=>!l.includes(e.value)))}();case"colorScope":return $;case"hideExpression":return X.hideExpressionOption;case"defaultValue":{const{type:e,optionInfo:l}=X.element;return e===R.SELECT?A(null==l?void 0:l.list)&&l.list.length>0?l.list.map((e=>({...e,label:e.name}))):Object.entries(W).map((([e,l])=>({value:e,label:l}))):e===R.DATE?Object.entries(q).map((([e,l])=>({value:e,label:l}))):e===R.DATETIME?Object.entries(G).map((([e,l])=>({value:e,label:l}))):[]}default:return[]}}function se(e){var l;if(1==X.element.defaultMark||"color"===e.type&&X.isHighlightRow)return!0;if("checkbox"===e.type)return"show"===e.field&&e.fieldShowMaxValue?!X.element[e.field]&&(null==(l=X.data.filter((l=>l[e.field])))?void 0:l.length)===e.fieldShowMaxValue:M(X.element,e.field);if("sortPriority"!==e.field)return!1;const{sortDirection:t}=X.element;return!t||"NONE"===t}function ce(e){return["title","result"].includes(e.field)&&X.element.style||{}}return(C,M)=>(l(),t("div",z,[(l(!0),t(i,null,n(e.columns,((n,C)=>{return l(),t(i,{key:C},[n.isShow?(l(),t("span",{key:0,class:"table-cell",title:e.element[n.field],style:o(a(O)(n,C,e.columnWidthProps))},["text"===n.type?(l(),t(i,{key:0},[0===C?(l(),t(i,{key:0},[!e.isFieldSet||e.draggable&&e.isFieldSet?(l(),r(a(g),{key:0,trigger:"hover"},{trigger:d((()=>[u(a(k),{style:{"margin-right":"5px",top:"2px"},component:a(N)},null,8,["component"])])),default:d((()=>[K])),_:1})):s("v-if",!0),(A=n.field,"title"===A&&("tooltip"===X.fieldDescribeMode&&X.element.feildDescribe||X.developMode&&(null==(H=X.element.settingObj)?void 0:H.fieldDescDev))?(l(),r(a(g),{key:1,trigger:"hover"},{trigger:d((()=>[u(a(k),{style:{"margin-right":"5px",top:"2px"},component:a(U)},null,8,["component"])])),default:d((()=>[c("span",null,f(ie()),1)])),_:1})):s("v-if",!0))],64)):s("v-if",!0),c("span",{class:p([e.isHighlight&&"title"===n.field?"highlight":""]),style:o(ce(n))},f(ne(n.field)),7)],64)):s("v-if",!0),"checkbox"===n.type&&ae(n.field)?m((l(),r(a(x),{key:1,disabled:se(n),checked:e.element[n.field],"onUpdate:checked":[l=>e.element[n.field]=l,e=>function(e,l){Q("updateChecked",{checked:e,column:l})}(e,n)]},null,8,["disabled","checked","onUpdate:checked"])),[[v,re(n.field)]]):s("v-if",!0),"select"===n.type&&ae(n.field)?m((l(),r(a(E),y({key:2},de(n.field),{clearable:"",multiple:oe(n.field),disabled:se(n),value:e.element[n.field],"onUpdate:value":[l=>e.element[n.field]=l,e=>function(e,l){"sortDirection"===l.field&&"NONE"===e&&(X.element.sortPriority=null),"colorScope"===l.field&&j(X.element)}(e,n)],options:ue(n)}),null,16,["multiple","disabled","value","onUpdate:value","options"])),[[v,re(n.field)]]):s("v-if",!0),"color"===n.type?(l(),r(a(S),{key:3,class:"c-field-set__color-picker",clearable:"",disabled:se(n),value:e.element[n.field],"onUpdate:value":[l=>e.element[n.field]=l,M[0]||(M[0]=l=>a(j)(e.element))],"show-preview":"",modes:["hex"],swatches:a(ee)},null,8,["disabled","value","onUpdate:value","swatches"])):s("v-if",!0),"input"===n.type?m((l(),r(a(D),{key:4,value:e.element[n.field],"onUpdate:value":l=>e.element[n.field]=l,clearable:""},null,8,["value","onUpdate:value"])),[[v,"0001"!=e.element.id]]):s("v-if",!0),"inputNumber"===n.type?(l(),r(a(T),{key:5,value:e.element[n.field],"onUpdate:value":l=>e.element[n.field]=l},null,8,["value","onUpdate:value"])):s("v-if",!0),"custom"===n.type&&a(P)(n.contentRender)?(l(),r(b((()=>n.contentRender(n,e.element))),{key:6})):s("v-if",!0),"custom"===n.type&&"opt"===n.field&&1!=e.element.defaultMark?(l(),t(i,{key:7},[u(a(g),{trigger:"hover"},{trigger:d((()=>[u(a(k),{component:a(F),onClick:te},null,8,["component"])])),default:d((()=>[h(" 编辑 ")])),_:1}),u(a(w),{onPositiveClick:le},{trigger:d((()=>[u(a(g),{trigger:"hover"},{trigger:d((()=>[u(a(k),{component:a(_)},null,8,["component"])])),default:d((()=>[h(" 删除 ")])),_:1})])),default:d((()=>[h(" 是否确认删除? ")])),_:1})],64)):s("v-if",!0)],12,J)):s("v-if",!0)],64);var A,H})),128))]))}});export{Q as default};
|
@@ -18,7 +18,7 @@ export type FieldSetItem = Partial<{
|
|
18
18
|
hide: boolean;
|
19
19
|
[key: string]: any;
|
20
20
|
}>;
|
21
|
-
export type FieldSetColumnName = 'show' | 'editable' | 'required' | 'sort' | 'bold' | 'sortDirection' | 'sortPriority' | 'fixedWay' | 'alias' | 'columnWidth';
|
21
|
+
export type FieldSetColumnName = 'show' | 'editable' | 'required' | 'sort' | 'bold' | 'sortDirection' | 'sortPriority' | 'fixedWay' | 'alias' | 'columnWidth' | 'hideExpression';
|
22
22
|
export type FieldSetColumnItem = {
|
23
23
|
title: string;
|
24
24
|
type: 'text' | 'checkbox' | 'select' | 'input' | 'inputNumber' | 'color' | 'custom';
|