cnhis-design-vue 3.1.54-beta.1 → 3.1.54-beta.3

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.
@@ -1,11 +1,11 @@
1
1
  import { fabric } from '../../../../../../../es/shared/utils/fabricjs';
2
- declare type DetailEventOptions = Partial<{
3
- beforeEvent: () => any | Promise<any>;
2
+ declare type DetailEventOptions = {
3
+ beforeEvent?: () => any | Promise<any>;
4
4
  showScaleText: boolean;
5
- }> & {
5
+ showNumberText: boolean;
6
6
  scale: number;
7
7
  endX: number;
8
8
  endY: number;
9
9
  };
10
- export declare function useDetailEvent(polyline: fabric.Polyline, { scale, beforeEvent, endY, endX, showScaleText }: DetailEventOptions): void;
10
+ export declare function useDetailEvent(polyline: fabric.Polyline, { scale, beforeEvent, endY, endX, showScaleText, showNumberText }: DetailEventOptions): void;
11
11
  export {};
@@ -1 +1 @@
1
- import{fabric as t}from"../../../../../../shared/utils/fabricjs/index.js";import{defaultStyle as e}from"../../useDraw.js";import"date-fns";import"lodash-es";import"../../useEvent.js";import"vue";import"../../temperature/useShadow.js";import"naive-ui";import"@vueuse/core";import{POLYLINE_BASIC_SCALE as n,DETAIL_RADIUS as o}from"../constants/index.js";function r(r,{scale:s,beforeEvent:a,endY:i,endX:l,showScaleText:p=!0}){let u=null;function d(){var t;u&&(null==(t=r.canvas)||t.remove(u)),u=null}r.on("mousedown",(async f=>{var c,h;if(await(null==a?void 0:a()),1!==f.button||!f.target||!f.pointer)return;const y=f.target;if(!y.points)return;const{x:w,y:m}=f.pointer,x=(w-(y.left||0))/n;let v=x-o,g=x+o;v<=0?(v=0,g=Math.min(2*o,y.points.length-1)):g>=y.points.length-1&&(g=y.points.length-1,v=Math.max(y.points.length-2*o,0));const k=y.points.slice(v,g).map((({y:t},e)=>({x:e,y:t}))),b=x-v;let j=0,A=0;k.forEach(((t,e)=>{t.y>k[j].y&&(j=e),t.y<k[A].y&&(A=e)}));const D=n*s*o*2-1,S=n*s*(k[j].y-k[A].y)-1,E=S+30+70,L={x:l-w<=D?w-D:w,y:i-m<=E?m-E:m};var W,X,Y;d(),u=new t.Group([],{}),u.add(new t.Rect({...e,left:L.x,top:L.y,width:D,height:E,stroke:"transparent",fill:"#fff",shadow:new t.Shadow({color:"rgba(0, 0, 0, 0.3)",blur:15,offsetX:8,offsetY:8})}),(Y=k,new t.Polyline(Y,{...e,fill:"transparent",stroke:"red",strokeWidth:2,scaleX:n*s,scaleY:n*s,left:L.x,top:L.y+30})),function(n,o){const r=new t.Line(i(n[j]),{...e,stroke:"red",strokeDashArray:[3,4],width:3,left:L.x+j/k.length*D,top:L.y}),s=new t.Line(i(n[A]),{...e,stroke:"blue",strokeDashArray:[3,4],width:3,left:L.x+A/k.length*D,top:L.y}),a=new t.Line(i(n[o]),{...e,stroke:"green",strokeDashArray:[3,4],width:3,left:L.x+o/k.length*D,top:L.y});return new t.Group([r,s,a],{});function i(t){return[t.x,t.y,t.x,t.y-E]}}(k,b),(W=k,X=b,new t.Circle({...e,radius:5,fill:"transparent",stroke:"green",strokeWidth:1,left:L.x+X/k.length*D-5,top:L.y+(W[b].y-W[A].y)/(W[j].y-W[A].y)*S-5+30}))),p&&u.add(new t.Text(`x${s}`,{fill:"black",fontSize:20,left:L.x+10,top:L.y+E-30})),null==(c=r.canvas)||c.add(u),u.addWithUpdate(),null==(h=r.canvas)||h.discardActiveObject()})),r.on("mouseup",(async t=>{await(null==a?void 0:a()),1===t.button&&d()}))}export{r as useDetailEvent};
1
+ import{fabric as e}from"../../../../../../shared/utils/fabricjs/index.js";import{defaultStyle as t}from"../../useDraw.js";import"date-fns";import"lodash-es";import"../../useEvent.js";import"vue";import"../../temperature/useShadow.js";import"naive-ui";import"@vueuse/core";import{POLYLINE_BASIC_SCALE as n,DETAIL_RADIUS as o}from"../constants/index.js";function r(r,{scale:l,beforeEvent:s,endY:i,endX:a,showScaleText:u,showNumberText:f}){let p=null;function c(){var e;p&&(null==(e=r.canvas)||e.remove(p)),p=null}r.on("mousedown",(async y=>{var d,h;if(await(null==s?void 0:s()),1!==y.button||!y.target||!y.pointer)return;const w=y.target;if(!w.points)return;const{x:m,y:x}=y.pointer,v=(m-(w.left||0))/n;let g=v-o,b=v+o;g<=0?(g=0,b=Math.min(2*o,w.points.length-1)):b>=w.points.length-1&&(b=w.points.length-1,g=Math.max(w.points.length-2*o,0));const k=w.points.slice(g,b).map((({y:e},t)=>({x:t,y:e}))),j=v-g;let T=0,S=0;k.forEach(((e,t)=>{e.y>k[T].y&&(T=t),e.y<k[S].y&&(S=t)}));const $=n*l*o*2-1,E=n*l*(k[T].y-k[S].y)-1,G=E+30+70,L={x:a-m<=$?m-$:m,y:i-x<=G?x-G:x};c(),p=new e.Group;const W=[new e.Rect({...t,left:L.x,top:L.y,width:$,height:G,stroke:"transparent",fill:"#fff",shadow:new e.Shadow({color:"rgba(0, 0, 0, 0.3)",blur:15,offsetX:8,offsetY:8})}),(z=k,new e.Polyline(z,{...t,fill:"transparent",stroke:"red",strokeWidth:3,scaleX:n*l,scaleY:n*l,left:L.x,top:L.y+30})),function(n,o){const r={strokeDashArray:[3,4],width:3,top:L.y},l=new e.Line(a(n[T]),{...t,...r,left:L.x+T/n.length*$,stroke:"red"}),s=new e.Line(a(n[S]),{...t,...r,stroke:"blue",left:L.x+S/n.length*$}),i=new e.Line(a(n[o]),{...t,...r,stroke:"green",left:L.x+o/n.length*$});return new e.Group([l,s,i]);function a(e){return[e.x,e.y,e.x,e.y-G]}}(k,j),(X=k,Y=j,new e.Circle({...t,radius:5,fill:"transparent",stroke:"green",strokeWidth:1,left:L.x+Y/X.length*$-5,top:L.y+(X[Y].y-X[S].y)/(X[T].y-X[S].y)*E-5+30}))];var X,Y,z;u&&W.push(new e.Text(`x${l}`,{...t,fill:"black",fontSize:20,left:L.x+10,top:L.y+G-30})),f&&W.push(function(n,o){const r={fontSize:16,left:L.x+$/2+10},l=new e.Text(`最大: ${n[T].y} mv`,{...t,...r,fill:"red",top:L.y+G-20}),s=new e.Text(`最小: ${n[S].y} mv`,{...t,...r,fill:"blue",top:L.y+G-40}),i=new e.Text(`当前: ${n[o].y} mv`,{...t,...r,fill:"green",top:L.y+G-60});return new e.Group([l,s,i])}(k,j)),p.add(...W).addWithUpdate(),null==(d=r.canvas)||d.add(p),null==(h=r.canvas)||h.discardActiveObject()})),r.on("mouseup",(async e=>{await(null==s?void 0:s()),1===e.button&&c()}))}export{r as useDetailEvent};
@@ -1 +1 @@
1
- import{fabric as e}from"../../../../../shared/utils/fabricjs/index.js";import{useThrottleFn as t}from"@vueuse/core";import{range as r}from"lodash-es";import{useDetailEvent as o}from"./hooks/useDetailEvent.js";import{defaultTextStyle as n,drawLine as i}from"../useDraw.js";import{useGrid as s}from"../useGrid.js";import"date-fns";import"../useEvent.js";import"vue";import"../temperature/useShadow.js";import"naive-ui";import{POLYLINE_BASIC_SCALE as a}from"./constants/index.js";function l(l,d,c){const{borderStyle:u,originX:f,originY:m,xCellWidth:h,endY:p,yCellHeight:v,endX:g,canvasWidth:x,canvasHeight:j,dataList:k,columnNumber:w}=d,Y=new Set;function y(t=0){k.forEach(((r,i)=>{const{x:s,y:d}=r.origin,u=~~(r.data.length/w),f=r.data.reduce(((e,r,o)=>{const n=i<12&&o>=t&&o<=t+u||12===i?[{x:e.length+1,y:p-+r}]:[];return e.concat(n)}),[]),m=new e.Polyline(f,{fill:"transparent",stroke:"red",strokeWidth:10,left:s,top:d,scaleX:a,scaleY:a,originY:"center",hasControls:!1,hasBorders:!1,hoverCursor:"default",lockMovementX:!0,lockMovementY:!0}),x=new e.Text(String(r.title),{...n,left:s+h,top:d-2*v,originX:"left",originY:"top"});!function(e,{scale:t=6}={}){o(e,{scale:t,endX:g,endY:p,beforeEvent:()=>c.value&&Promise.reject()})}(m),m.startIdx=t,Y.add(m),l.value.add(x,m)}))}s(l,d),function(){const{strokeWidth:t}=u,r=new e.Rect({...u,width:x-t,height:j-t,left:f,top:m,fill:"transparent"});l.value.add(r)}(),function(){const e=x/w,t=[];r(w).forEach((r=>{if(r+1>=w)return;const o=(r+1)*e,n=i([o,0,o,j],{stroke:"#000"});t.push(n)})),l.value.add(...t)}(),y();return{updatePolyline:t((e=>{if(1===w)return;const t=k[k.length-1].data.length,r=~~(t/w),o=e/100*t-r/2,n=o+r>t?t-r:Math.max(0,o);if(Y.size){const[e]=[...Y];if(e.startIdx===n)return;[...Y].forEach((e=>l.value.remove(e))),Y.clear()}y(n)}),250)}}export{l as useElectrocardiogram};
1
+ import{fabric as e}from"../../../../../shared/utils/fabricjs/index.js";import{useThrottleFn as t}from"@vueuse/core";import{range as r}from"lodash-es";import{useDetailEvent as o}from"./hooks/useDetailEvent.js";import{defaultTextStyle as n,drawLine as i}from"../useDraw.js";import{useGrid as s}from"../useGrid.js";import"date-fns";import"../useEvent.js";import"vue";import"../temperature/useShadow.js";import"naive-ui";import{POLYLINE_BASIC_SCALE as a}from"./constants/index.js";function l(l,d,c){const{borderStyle:u,originX:h,originY:f,xCellWidth:m,endY:p,yCellHeight:g,endX:v,canvasWidth:x,canvasHeight:w,dataList:j,columnNumber:k}=d,S=new Set,Y=new Set;function b(t=0){j.forEach(((r,o)=>{if(o===j.length-1&&arguments.length)return;const{x:i,y:s}=r.origin,l=~~(r.data.length/k),d=r.data.reduce(((e,r,n)=>{const i=o<12&&n>=t&&n<=t+l||12===o?[{x:e.length+1,y:p-+r}]:[];return e.concat(i)}),[]),c=new e.Polyline(d,{fill:"transparent",stroke:"red",strokeWidth:10,left:i,top:s,scaleX:a,scaleY:a,originY:"center",hasControls:!1,hasBorders:!1,hoverCursor:"default",lockMovementX:!0,lockMovementY:!0});if(y(c),c.startIdx=t,o<j.length-1?S.add(c):Y.add(c),arguments.length)return;const u=new e.Text(String(r.title),{...n,left:i+m,top:s-2*g,originX:"left",originY:"top"});Y.add(u)}));const r=arguments.length?[...S]:[...S,...Y];l.value.add(...r)}function y(e,{scale:t=4,showScaleText:r=!0,showNumberText:n=!0}={}){o(e,{scale:t,endX:v,endY:p,showNumberText:n,showScaleText:r,beforeEvent:()=>c.value&&Promise.reject()})}s(l,d),function(){const{strokeWidth:t}=u,r=new e.Rect({...u,width:x-t,height:w-t,left:h,top:f,fill:"transparent"});l.value.add(r)}(),function(){const e=x/k,t=[];r(k).forEach((r=>{if(r+1>=k)return;const o=(r+1)*e,n=i([o,0,o,w],{stroke:"#000"});t.push(n)})),l.value.add(...t)}(),b();return{updatePolyline:t((e=>{if(1===k)return;const t=j[j.length-1].data.length,r=~~(t/k),o=e/100*t-r/2,n=o+r>t?t-r:Math.max(0,o);if(S.size){const[e]=[...S];if(e.startIdx===n)return;[...S].forEach((e=>l.value.remove(e))),S.clear()}requestAnimationFrame((()=>{b(n)}))}),200)}}export{l as useElectrocardiogram};
@@ -1 +1 @@
1
- var e="@cnhis-design-vue/shared",i="3.1.54-beta.1",s="index.ts",n={"naive-ui":"^2.30.0",vue:"^3.2.0"},a={"@vicons/ionicons5":"^0.12.0","lodash-es":"^4.17.21",moment:"^2.29.1","video.js":"^7.19.2","videojs-contrib-hls":"^5.15.0",viewerjs:"^1.10.5","xe-utils":"^3.5.4"},d={name:e,version:"3.1.54-beta.1",private:!0,main:"index.ts",peerDependencies:n,dependencies:a};export{d as default,a as dependencies,s as main,e as name,n as peerDependencies,i as version};
1
+ var e="@cnhis-design-vue/shared",i="3.1.54-beta.3",s="index.ts",n={"naive-ui":"^2.30.0",vue:"^3.2.0"},a={"@vicons/ionicons5":"^0.12.0","lodash-es":"^4.17.21",moment:"^2.29.1","video.js":"^7.19.2","videojs-contrib-hls":"^5.15.0",viewerjs:"^1.10.5","xe-utils":"^3.5.4"},d={name:e,version:"3.1.54-beta.3",private:!0,main:"index.ts",peerDependencies:n,dependencies:a};export{d as default,a as dependencies,s as main,e as name,n as peerDependencies,i as version};
@@ -1 +1 @@
1
- import{Path as e}from"@formily/path";import{isArray as r,isString as n,includes as t,negate as o,gt as a,gte as l,isNumber as c,lt as i,lte as u,noop as p,isObject as s}from"lodash-es";import{unref as f}from"vue";function m(e){return null==e||""==e}const E={EQ:(e,r)=>`${e}`===r,NEQ:(e,r)=>`${e}`!==r,CL:(e,o)=>!(!r(e)&&!n(e))&&t(e,o),NC:(e,o)=>!r(e)&&!n(e)||!t(e,o),NULL:m,NOT_NULL:o(m),BIG:a,BIGEQ:l,LESS:(e,r)=>!!(c(e)||n(e)&&e)&&i(e,r),LESSEQ:(e,r)=>!!(c(e)||n(e)&&e)&&u(e,r)};function g(e,r,n={}){return(n[r.con]||E[r.con]||(()=>!1))(e,`${r.value}`)}function _(t,o){if(!r(o.conObj))return!1;if(!o.sqlExpression||!n(o.sqlExpression))return o.conObj.every((r=>g(e.getIn(t,r.field_key),r,o.compareMap)));const a=o.conObj.map((r=>g(e.getIn(t,r.field_key),r,o.compareMap)));try{return new Function("return "+o.sqlExpression.replace(/OR/g,"||").replace(/AND/g,"&&").replace(/[a-zA-Z]/g,"").replace(/\d+/g,(e=>a[+e-1]?"true":"false")))()}catch(e){return console.error("表达式错误=>",o.sqlExpression),!1}}const L=Object.freeze({SET_VALUE:function(e,{getter:r,setter:n}){if(!s(e))return;const{results:t=[],params:o=[],compareMap:a={}}=e;if(!t.length)return;o.every((e=>e&&e.p_name&&g(r(e.p_name),{con:e.p_select,value:e.p_value},a)))&&t.forEach((e=>n(e.p_name,e.p_value)))},REPEAT_VALIDATE:p,IS_SHOW_FIELD:p,SQLSAVE:p,API:p});function d(e){return L[e]||p}function A(e,t,o){function a(e){return r(e)&&!!e.length}function l(e,r=!0){e.forEach((e=>{const a=e.operationFormParam.reduce(((e,r)=>(e[r=r.replace(/^table\./,"")]=+t(r),e)),{}),l=e.operationalRule.replace(/\${(.+?)}/g,"$1");let i=new Function("table",`return ${l}`)(a);n(i)&&(i=+i),i=c(i)?isNaN(i)?"":i.toFixed(+e.operationalPrecision):"",(r||null==t(e.operationalResult))&&o(e.operationalResult,i)}))}return{operationalFormHandler:function(r){if(!a(f(e)))return;const n=f(e).filter((e=>e.operationFormParam.includes(`table.${r}`)));n.length&&l(n)},triggerAllOperationalFormHandler:function(){a(f(e))&&l(f(e),!1)}}}export{d as getBindEventSettingTrigger,A as getOperationalFormHandler,g as isMatchLowCodeCondition,_ as isMatchLowCodeConditionsWithSqlExpression};
1
+ import{Path as e}from"@formily/path";import{isArray as r,isString as n,includes as t,negate as o,gt as a,gte as l,isNumber as i,lt as c,lte as u,noop as p,isObject as s}from"lodash-es";import{unref as f}from"vue";function m(e){return null==e||""==e}const E={EQ:(e,r)=>`${e}`===r,NEQ:(e,r)=>`${e}`!==r,CL:(e,o)=>!(!r(e)&&!n(e))&&t(e,o),NC:(e,o)=>!r(e)&&!n(e)||!t(e,o),NULL:m,NOT_NULL:o(m),BIG:a,BIGEQ:l,LESS:(e,r)=>!!(i(e)||n(e)&&e)&&c(e,r),LESSEQ:(e,r)=>!!(i(e)||n(e)&&e)&&u(e,r)};function g(e,r,n={}){return(n[r.con]||E[r.con]||(()=>!1))(e,`${r.value}`)}function _(t,o){if(!r(o.conObj))return!1;if(!o.sqlExpression||!n(o.sqlExpression))return o.conObj.every((r=>g(e.getIn(t,r.field_key),r,o.compareMap)));const a=o.conObj.map((r=>g(e.getIn(t,r.field_key),r,o.compareMap)));try{return new Function("return "+o.sqlExpression.replace(/OR/g,"||").replace(/AND/g,"&&").replace(/[a-zA-Z]/g,"").replace(/\d+/g,(e=>a[+e-1]?"true":"false")))()}catch(e){return console.error("表达式错误=>",o.sqlExpression),!1}}const d=Object.freeze({SET_VALUE:function(e,{getter:r,setter:t}){if(!s(e))return;const{results:o=[],params:a=[],compareMap:l={}}=e;if(!o.length)return;function i(e){var t;if(!n(e))return e;const o=e.trim().match(/^\$\{([a-zA-Z\d\s]+)}$/);return o?r(null==(t=o[1])?void 0:t.trim()):e}a.every((e=>e&&e.p_name&&g(r(e.p_name),{con:e.p_select,value:i(e.p_value)},l)))&&o.forEach((e=>t(e.p_name,i(e.p_value))))},REPEAT_VALIDATE:p,IS_SHOW_FIELD:p,SQLSAVE:p,API:p});function L(e){return d[e]||p}function A(e,t,o){function a(e){return r(e)&&!!e.length}function l(e,r=!0){e.forEach((e=>{const a=e.operationFormParam.reduce(((e,r)=>(e[r=r.replace(/^table\./,"")]=+t(r),e)),{}),l=e.operationalRule.replace(/\${(.+?)}/g,"$1");let c=new Function("table",`return ${l}`)(a);n(c)&&(c=+c),c=i(c)?isNaN(c)?"":c.toFixed(+e.operationalPrecision):"",(r||null==t(e.operationalResult))&&o(e.operationalResult,c)}))}return{operationalFormHandler:function(r){if(!a(f(e)))return;const n=f(e).filter((e=>e.operationFormParam.includes(`table.${r}`)));n.length&&l(n)},triggerAllOperationalFormHandler:function(){a(f(e))&&l(f(e),!1)}}}export{L as getBindEventSettingTrigger,A as getOperationalFormHandler,g as isMatchLowCodeCondition,_ as isMatchLowCodeConditionsWithSqlExpression};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cnhis-design-vue",
3
- "version": "3.1.54-beta.1",
3
+ "version": "3.1.54-beta.3",
4
4
  "license": "ISC",
5
5
  "module": "./es/components/index.js",
6
6
  "main": "./es/components/index.js",
@@ -63,5 +63,5 @@
63
63
  "iOS 7",
64
64
  "last 3 iOS versions"
65
65
  ],
66
- "gitHead": "42e3adf963ca50ee04e3df4039486ee3c48213f0"
66
+ "gitHead": "e7181d09c84223705700163272c36f86e8c4a6ab"
67
67
  }