cnhis-design-vue 3.1.47-beta.14 → 3.1.47-beta.16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (45) hide show
  1. package/README.md +87 -87
  2. package/es/components/fabric-chart/src/hooks/birthProcess/useBirthProcess.js +1 -1
  3. package/es/components/fabric-chart/src/hooks/index.js +1 -1
  4. package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useCenter.js +1 -1
  5. package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useLeft.js +1 -1
  6. package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useSurgicalAnesthesiaChart.js +1 -1
  7. package/es/components/fabric-chart/src/hooks/temperature/useCenter.js +1 -1
  8. package/es/components/fabric-chart/src/hooks/temperature/useLeft.js +1 -1
  9. package/es/components/fabric-chart/src/hooks/useCommon.d.ts +4 -1
  10. package/es/components/fabric-chart/src/hooks/useCommon.js +1 -1
  11. package/es/components/fabric-chart/src/hooks/useDraw.d.ts +8 -0
  12. package/es/components/fabric-chart/src/hooks/useDraw.js +1 -1
  13. package/es/components/scale-view/src/ScaleView.vue2.js +1 -1
  14. package/es/components/select-label/src/LabelFormContent.vue2.js +1 -1
  15. package/es/components/select-person/index.d.ts +4 -0
  16. package/es/components/select-person/src/SearchMultiple.vue.d.ts +6 -0
  17. package/es/components/select-person/src/SelectPerson.vue.d.ts +1 -0
  18. package/es/components/select-person/src/SelectPerson.vue2.js +1 -1
  19. package/es/components/select-person/src/utils/index.d.ts +1 -1
  20. package/es/components/select-person/src/utils/index.js +1 -1
  21. package/es/components/shortcut-provider/src/hooks/useShortcuts.js +1 -1
  22. package/es/components/shortcut-provider/src/types/index.d.ts +1 -1
  23. package/es/components/table-export-field/src/components/ExportModal.vue.d.ts +0 -3
  24. package/es/env.d.ts +25 -25
  25. package/es/shared/assets/img/failure.png.js +1 -1
  26. package/es/shared/assets/img/no-permission.png.js +1 -1
  27. package/es/shared/assets/img/nodata.png.js +1 -1
  28. package/es/shared/assets/img/notfound.png.js +1 -1
  29. package/es/shared/assets/img/qr.png.js +1 -1
  30. package/es/shared/assets/img/success.png.js +1 -1
  31. package/es/shared/assets/img/video.png.js +1 -1
  32. package/es/shared/assets/img/video_default_cover.png.js +1 -1
  33. package/es/shared/assets/img/xb_big.png.js +1 -1
  34. package/es/shared/assets/img/xb_small.png.js +1 -1
  35. package/es/shared/package.json.js +1 -1
  36. package/package.json +2 -2
  37. package/es/components/bpmn-workflow/src/BpmnWorkflow.d.ts +0 -0
  38. package/es/components/bpmn-workflow/types/BpmnViewer.d.ts +0 -1
  39. package/es/components/bpmn-workflow/types/ModelingModule.d.ts +0 -1
  40. package/es/components/bpmn-workflow/types/MoveCanvasModule.d.ts +0 -1
  41. package/es/shared/components/VueDraggable/src/vuedraggable.d.ts +0 -86
  42. package/es/shared/utils/fabricjs/index.d.ts +0 -6823
  43. package/es/shared/utils/tapable/index.d.ts +0 -139
  44. package/es/shared/utils/tapableLess.d.ts +0 -28
  45. package/es/shared/utils/tapableLess.js +0 -1
package/README.md CHANGED
@@ -1,87 +1,87 @@
1
- # 安装
2
-
3
- ```shell
4
- npm i cnhis-design-vue@[版本号]
5
- # or
6
- yarn add cnhis-design-vue@[版本号] #推荐
7
- ```
8
-
9
- ## 1.全局引入
10
-
11
- ```typescript
12
- // main.ts
13
- import { createApp } from 'vue';
14
- import App from './App.vue';
15
- import 'cnhis-design-vue/es/packages/index.css';
16
- import cui from 'cnhis-design-vue';
17
-
18
- const app = createApp(App);
19
- app.use(cui).mount('#app');
20
- ```
21
-
22
- ## 2. 按需引入
23
-
24
- 组件现在支持了自动按需引入, 但是样式文件需要额外的处理
25
-
26
- ### 2.1 样式处理方式1 (按需引入样式)
27
-
28
- ```shell
29
- # 安装自动导入样式的插件
30
- npm i -d vite-plugin-style-import
31
- ```
32
-
33
- ```typescript
34
- // vite.config.ts
35
- import { defineConfig } from 'vite';
36
- import { createStyleImportPlugin } from 'vite-plugin-style-import';
37
-
38
- export default defineConfig({
39
- plugins: [
40
- // ...otherPlugins
41
- createStyleImportPlugin({
42
- libs: [
43
- {
44
- libraryName: 'cnhis-design-vue',
45
- esModule: true,
46
- ensureStyleFile: true,
47
- resolveStyle: name => {
48
- return `cnhis-design-vue/es/components/${ name.slice(2) }/style/index.css`;
49
- }
50
- }
51
- ]
52
- })
53
- ]
54
- });
55
- ```
56
-
57
- ### 2.2 样式处理方式2 (全局引入样式)
58
-
59
- ```typescript
60
- // main.ts
61
- import 'cnhis-design-vue/es/components/index.css';
62
- ```
63
-
64
- ## 3.FAQ
65
-
66
- ### 3.1 项目打包后样式丢失
67
-
68
- 处理方法, 将 cnhis-design-vue 从 vendor 包中移除 (没有出现此问题则不需要)
69
-
70
- ```typescript
71
- // vite.config.ts
72
- import { defineConfig } from 'vite';
73
-
74
- export default defineConfig({
75
- build: {
76
- rollupOptions: {
77
- // ..otherOptions
78
- output: {
79
- dir: './dist',
80
- manualChunks: {
81
- 'cnhis-vendor': ['cnhis-design-vue']
82
- }
83
- }
84
- }
85
- }
86
- });
87
- ```
1
+ # 安装
2
+
3
+ ```shell
4
+ npm i cnhis-design-vue@[版本号]
5
+ # or
6
+ yarn add cnhis-design-vue@[版本号] #推荐
7
+ ```
8
+
9
+ ## 1.全局引入
10
+
11
+ ```typescript
12
+ // main.ts
13
+ import { createApp } from 'vue';
14
+ import App from './App.vue';
15
+ import 'cnhis-design-vue/es/packages/index.css';
16
+ import cui from 'cnhis-design-vue';
17
+
18
+ const app = createApp(App);
19
+ app.use(cui).mount('#app');
20
+ ```
21
+
22
+ ## 2. 按需引入
23
+
24
+ 组件现在支持了自动按需引入, 但是样式文件需要额外的处理
25
+
26
+ ### 2.1 样式处理方式1 (按需引入样式)
27
+
28
+ ```shell
29
+ # 安装自动导入样式的插件
30
+ npm i -d vite-plugin-style-import
31
+ ```
32
+
33
+ ```typescript
34
+ // vite.config.ts
35
+ import { defineConfig } from 'vite';
36
+ import { createStyleImportPlugin } from 'vite-plugin-style-import';
37
+
38
+ export default defineConfig({
39
+ plugins: [
40
+ // ...otherPlugins
41
+ createStyleImportPlugin({
42
+ libs: [
43
+ {
44
+ libraryName: 'cnhis-design-vue',
45
+ esModule: true,
46
+ ensureStyleFile: true,
47
+ resolveStyle: name => {
48
+ return `cnhis-design-vue/es/components/${ name.slice(2) }/style/index.css`;
49
+ }
50
+ }
51
+ ]
52
+ })
53
+ ]
54
+ });
55
+ ```
56
+
57
+ ### 2.2 样式处理方式2 (全局引入样式)
58
+
59
+ ```typescript
60
+ // main.ts
61
+ import 'cnhis-design-vue/es/components/index.css';
62
+ ```
63
+
64
+ ## 3.FAQ
65
+
66
+ ### 3.1 项目打包后样式丢失
67
+
68
+ 处理方法, 将 cnhis-design-vue 从 vendor 包中移除 (没有出现此问题则不需要)
69
+
70
+ ```typescript
71
+ // vite.config.ts
72
+ import { defineConfig } from 'vite';
73
+
74
+ export default defineConfig({
75
+ build: {
76
+ rollupOptions: {
77
+ // ..otherOptions
78
+ output: {
79
+ dir: './dist',
80
+ manualChunks: {
81
+ 'cnhis-vendor': ['cnhis-design-vue']
82
+ }
83
+ }
84
+ }
85
+ }
86
+ });
87
+ ```
@@ -1 +1 @@
1
- import{fabric as t}from"../../../../../shared/utils/fabricjs/index.js";import{drawLine as e,drawArrow as n,drawText as o,defaultTextStyle as i,drawPoint as r,defaultStyle as l,defaultRectStyle as s}from"../useDraw.js";import{useGrid as a}from"../useGrid.js";import{useBirthProcessCumputedPoint as u}from"../useCumputedPoint.js";import"@vueuse/core";import{getScaleInfo as c,drawScaleNumber as f,drawScaleLine as d}from"../useScaleColumn.js";import{useCommon as p}from"../useCommon.js";import"vue";import{getIndex as h,isEffectiveNode as g,getTime as v,getScaleNumberList as m}from"../../utils/index.js";import"../temperature/useShadow.js";import{cloneDeep as y}from"lodash-es";import{format as k}from"date-fns";function w(w,x,b,j,S){const{cumputedX:C,cumputedY:T,getXValue:M,getYValue:P}=u(x),{getEqualXTypes:E,handleAddPrevent:G}=p(w,b),{xAxis:L,grid:Y,originX:X,originY:A,xCellWidth:H,endY:I,startTime:O,leftAddAreaWidth:W,leftScales:V,rightScales:D,yCellHeight:N,endX:R,scaleValues:$,canvasWidth:B,borderStyle:F,rightAddAreaWidth:q,event:z,originYCervix:J,other:K,canvasHeight:Q}=x,U=y($),Z=new Set;function _(){U.filter((t=>t.show)).forEach(((t,l)=>{var s;const a=[],u=[],c=[];null==(s=t.data)||s.forEach(((s,f)=>{!function(s,f,d){let p,h;const{pointAttr:g={},lineAttr:v={},title:m="",key:y,type:k="circle",childbirthStyle:S={}}=t,C=t.data[d+1],T=it(C,t);if(s&&T&&!f.breakpoint)h=e([...s,...T],{...v});else if(s&&!T&&!f.breakpoint){const n=it(C,t);h=n?e([...s,...n],{...v}):null}let E,G;if(f.childbirth){const t=s[1]+N;E=n([s[0],s[1],t],S),c.push(E),G=o([s[0]+H/2,t-N/2],{value:String(f.childbirth),...i,originX:"left",originY:"center",...S}),c.push(G)}const L=u[d-1],Y={origin:{data:f,title:m,key:y||"",dataIndex:l,index:d},leftLine:L,rightLine:h,arrowGroup:E,arrowGroupText:G,...g,...x.event.hovered?x.event.evented?{selectable:!0}:{selectable:!0,lockMovementX:!0,lockMovementY:!0}:x.event};L?p=r(k,{left:L.get("x2"),top:L.get("y2"),...Y}):s&&(Y.leftLine=null,p=r(k,{left:s[0],top:s[1],...Y}));u.push(h),p&&(!function(t){z.hovered&&(t.on("mouseover",(()=>{ot(t,"hover")})),t.on("mouseout",(()=>{j.show=!1})));if(t.lockMovementX&&t.lockMovementY)return;t.on("moving",(()=>{nt(t),function(t){var e,n,o,i;null==(e=t.leftLine)||e.setCoords().set({x2:t.left,y2:t.top}),null==(n=t.rightLine)||n.setCoords().set({x1:t.left,y1:t.top}),null==(o=t.arrowGroup)||o.setCoords().set({left:t.left,top:t.top}),null==(i=t.arrowGroupText)||i.setCoords().set({left:t.left+H/2,top:t.top+N/2})}(t),z.hovered&&ot(t)})),t.on("mouseup",(e=>{if(j.show=!1,1===e.button){const{key:e}=t.origin,n={...t.origin,data:{...t.origin.data,time:M(t.left),value:P(e,t.top)}};w.value.discardActiveObject(),b("change",n),tt(n,"change")}}))}(p),a.push(p),Z.add(p))}(it(s,t),s,f)})),Promise.all(a).then((t=>{const e=u.filter((t=>t));let n=null;t=t.filter((t=>(t&&n&&(n.nextPoint=t,t.prevPoint=n),n=t||n,t))),Promise.all(c).then((n=>{w.value.add(...e,...t,...n),t.forEach((t=>{null==t||t.bringToFront()}))}))}))}))}function tt(t,e="add"){const{dataIndex:n,data:o,index:i,key:r}=t,l=U.find((t=>t.key===r));switch(e){case"remove":l.data.splice(i,1);break;case"change":l.data[i]=o;break;default:{const t=h(o.time,l.data);l.data.splice(t,0,o);break}}et()}function et(){var t;Z.size&&(null==(t=w.value)||t.remove(...function(t){const e=[];return t.forEach((t=>{t&&e.push(t),(null==t?void 0:t.leftLine)&&e.push(null==t?void 0:t.leftLine),(null==t?void 0:t.rightLine)&&e.push(null==t?void 0:t.rightLine),(null==t?void 0:t.arrowGroup)&&e.push(null==t?void 0:t.arrowGroup),(null==t?void 0:t.arrowGroupText)&&e.push(null==t?void 0:t.arrowGroupText)})),e}([...Z]))),Z.clear(),_()}function nt(t){const e=t.prevPoint?t.prevPoint.left:X,n=t.nextPoint?t.nextPoint.left:R;t.setCoords(),["cervix","fetalPresentation"].includes(t.origin.key)&&t.top<J&&t.set("top",J),t.top<A&&t.set("top",A),t.top>I&&t.set("top",I),t.left<e&&t.set("left",e),t.left>n&&t.set("left",n)}function ot(t,e="moving"){const{title:n,key:o,data:i}=t.origin;j.point={x:t.left,y:t.top},j.list=[`${n} ${"hover"===e?i.value:P(o,t.top)}`,`时间 ${M(t.left).slice(-5)}`],j.show=!0}function it(t,e){if(g(t)&&function(t){const e=O+864e5,n=v(t);return n>=O&&n<=e}(t.time)){const n=C(t.time),o=T(e.key,e.range,t.value);return[n,o<A?A:o>I?I:o]}}function rt(t,e){return t+1>e[1]?e[0]:t+1}return a(w,x),function(){const e=new t.Rect({...F,width:B-W-q-1,height:I-1,left:W,top:0,fill:"transparent"});w.value.add(e)}(),function(){function e(e,n="left"){let r="left"===n?W:R;e.forEach(((e,n)=>{const{range:a,spaceValue:u,width:p,title:h,titleStyle:g,key:v,position:y="center",spaceGridNumber:k=1,showNumber:x,showMaxMinNumber:b}=e,j=[],S=[],C=r+p/2,T=m(a,u),M=T.length;T.forEach(((t,n)=>{const{lineXMain:o,lineXSub:i,textLeft:l}=c(y,r,p),s=I-n*N*k,a=0===n?I-8:n!==T.length-1||A||J&&"FHR"!==v?s:A+8;!x||(0===n||n===M-1)&&!b||j.push(f(String(t),e,l,a)),S.push(...d(e,n,o,i,s,N,A,M))}));const P=new t.Rect({...s,strokeWidth:.5,width:p,height:I,left:C,top:I/2}),E=o([C,A>0?A-N/2:N/2],{value:String(h),...i,...g}),G=new t.Group([...S,...j,P,...E?[E]:[]],{objectCaching:!1,...l});w.value.add(G),G.sendToBack(),r+=p}))}e(V),e(D,"right")}(),function(){const{show:e,startTime:n,range:r=[0,23],position:s="top",style:a}=L.time,{show:u,range:c=[0,23],position:f,style:d}=L.processTime;if(e||u){const p=[],h=[],g=[],v=[],m=X+H/2,y=N/2;for(let t=0;t<Y.mainXCell;t++){if(e){const e=0===t?+n.slice(11,13):rt(p.at(-1),r);p.push(e);const l="top"===s?A-y:I+y;g.push(o([m+t*H,l],{value:String(e),...i,...a||{}}))}if(u){const e=0===t?c[0]:h.at(-1)+1;h.push(e);const n="top"===f?y:Q-y;v.push(o([m+t*H,n],{value:String(e),...i,...d||{}}))}}const k=new t.Group([...g,...v],{objectCaching:!1,...l});w.value.add(k),w.value.sendToBack(k)}}(),function(){var t;const n=Object.values(K),o=[],i={},r=U.find((t=>"cervix"===t.key&&t.show)),l=null==(t=null==r?void 0:r.data)?void 0:t.find((t=>3==+t.value));function s(t,e){const{key:n,range:o}=r||{},i=T(n,o,10),l=[0,e],s=[-e/t,0],a=[(I-i-e)/t,I-i],u=[R-X,t*(R-X)+e];let c=[],f=[];function d([n,o]){return Math.abs(o-t*n-e)<=1}function p([t,e]){const[n,o]=[...h([t,e])];return n>=X&&n<=R&&o>=i&&o<=I}function h([t,e]){return[X+t,I-e]}return d(l)&&p(l)&&(c=h(l)),d(s)&&p(s)&&(c=h(s)),d(a)&&p(a)&&(f=h(a)),d(u)&&p(u)&&(f=h(u)),[...c,...f]}n.forEach((t=>{if(!t.show)return;const{key:n}=t;switch(n){case"fetalPresentation":{const{range:i,show:r}=U.find((t=>t.key===n));if(r){const r=T(n,i,0);o.push(e([X,r,R,r],{...t}))}break}case"alert":if(l){const{key:n,range:a}=r||{},u=216e5,c={time:k(new Date(v(l.time)+u),"yyyy-MM-dd HH:mm"),value:10},[f,d]=[C(l.time)-X,I-T(n,a,l.value)],[p,h]=[C(c.time)-X,I-T(n,a,c.value)],g=(h-d)/(p-f),m=d-f*g,y=s(g,m);y.length>0&&(o.push(e(y,{...t})),Object.assign(i,{k:g,b:m}))}break;case"handling":if(l){const{k:n,b:r}=i,a=144e5,u=s(n,r-(C(k(new Date(v(l.time)+a),"yyyy-MM-dd HH:mm"))-C(l.time))*n);u.length>0&&o.push(e(u,{...t}))}}})),w.value.add(...o)}(),_(),function(){function t(t,e){const n=U.findIndex((e=>e.key===t.key));return{renderItem:()=>t.title,origin:{title:t.title,unit:t.unit,dataIndex:n,key:t.key},pointer:e}}x.event.evented&&w.value.on("mouse:up",(e=>{if(3===e.button){const{x:n=0,y:o=0}=e.pointer||{};n>=X&&n<=R&&o>=A&&o<=I&&(S.point={x:n,y:o},S.show=!0,e.target?(S.target=e.target,S.list=["删除节点"],w.value.forEachObject((t=>{t.origin&&t.left===e.target.left&&t.top===e.target.top&&S.list.push({renderItem:()=>t.origin.title,origin:{...t.origin},mode:"remove",pointer:e.pointer})}))):(S.target=null,S.list=["新增节点"],U.filter((t=>t.show)).forEach((i=>{if(!E(n,"key",H).includes(i.key)){if(["cervix","fetalPresentation"].includes(i.key)&&o<J)return;S.list.push(t(i,e.pointer))}})),1===S.list.length&&(S.show=!1,G("repeat"),console.log("当前时间段内无可新增节点"))))}}))}(),function(){const e=B-q/2;function n(e,n){if(!e.length)return;let l=A;const s=[];e.forEach((e=>{const o=e.title.split("").join("\n"),a=$.findIndex((t=>t.key===e.key)),u=new t.Text(String(o),{...i,...e.titleStyle||{},originY:"top",left:n,top:l,lineHeight:1}),c=r(e.type,{left:n,top:l+u.height+3,...e.pointAttr,originY:"top",origin:{title:e.title,unit:e.unit,type:e.type,dataIndex:a,key:e.key,isMenu:!0},originLeft:n,originTop:l+u.height+3,...x.event});l+=u.height+c.height+15,function(t){function e(t){const{left:e,top:n}=t;return e>=X&&e<=R&&n>=A&&n<=I}t.on("moving",(()=>{t.set("originY","center"),e(t)?(nt(t),ot(t)):j.show=!1})),t.on("mouseup:before",(n=>{if(j.show=!1,0===n.e.button&&e(t))if(E(t.left,"key",H).includes(t.origin.key))G("repeat");else{const e={data:{time:M(t.left),value:P(t.origin.key,t.top)},...t.origin};b("add",e),tt(e)}!function(t){t.setCoords().set({originY:"top",left:t.originLeft,top:t.originTop})}(t)}))}(c),s.push(u,c)})),o(s),w.value.add(...s)}function o(t){const e=t.at(-1),n=(I-A)/2,o=(e.height+e.top-A)/2;t.forEach((t=>{const e=t.top+n-o;t.set({top:e,originTop:e})}))}n(V,W/2),n(D,e)}(),{clickMenu:function({item:t,target:e}){const n={...t.origin};"remove"===t.mode?(b("remove",n),tt(n,"remove")):(Object.assign(n,{data:{time:M(t.pointer.x),value:P(t.origin.key,t.pointer.y)}}),b("add",n),tt(n))},redrawPoints:et}}export{w as useBirthProcess};
1
+ import{fabric as e}from"../../../../../shared/utils/fabricjs/index.js";import{drawLine as t,drawArrow as o,drawText as n,defaultTextStyle as i,drawPoint as r,drawTextAndIconGroup as l,defaultStyle as s,defaultRectStyle as a}from"../useDraw.js";import{useGrid as u}from"../useGrid.js";import{useBirthProcessCumputedPoint as c}from"../useCumputedPoint.js";import"@vueuse/core";import{getScaleInfo as d,drawScaleNumber as f,drawScaleLine as p}from"../useScaleColumn.js";import{useCommon as h}from"../useCommon.js";import"vue";import{getIndex as g,isEffectiveNode as v,getTime as m,getScaleNumberList as y}from"../../utils/index.js";import"../temperature/useShadow.js";import{cloneDeep as k}from"lodash-es";import{format as w}from"date-fns";function x(x,b,j,C,P){const{cumputedX:S,cumputedY:G,getXValue:M,getYValue:T}=c(b),{getEqualXTypes:Y,handleAddPrevent:E,isGridLimit:L}=h(x,j,b),{xAxis:X,grid:A,originX:I,originY:H,xCellWidth:O,endY:W,startTime:V,leftAddAreaWidth:D,leftScales:N,rightScales:R,yCellHeight:$,endX:B,scaleValues:F,canvasWidth:q,borderStyle:z,rightAddAreaWidth:J,event:K,originYCervix:Q,other:U,canvasHeight:Z}=b,_=k(F),ee=new Set;function te(){_.filter((e=>e.show)).forEach(((e,l)=>{var s;const a=[],u=[],c=[];null==(s=e.data)||s.forEach(((s,d)=>{!function(s,d,f){let p,h;const{pointAttr:g={},lineAttr:v={},title:m="",key:y,type:k="circle",childbirthStyle:w={}}=e,P=e.data[f+1],S=le(P,e);if(s&&S&&!d.breakpoint)h=t([...s,...S],{...v});else if(s&&!S&&!d.breakpoint){const o=le(P,e);h=o?t([...s,...o],{...v}):null}let G,Y;if(d.childbirth){const e=s[1]+$;G=o([s[0],s[1],e],w),c.push(G),Y=n([s[0]+O/2,e-$/2],{value:String(d.childbirth),...i,originX:"left",originY:"center",...w}),c.push(Y)}const E=u[f-1],L={origin:{data:d,title:m,key:y||"",dataIndex:l,index:f},leftLine:E,rightLine:h,arrowGroup:G,arrowGroupText:Y,...g,...b.event.hovered?b.event.evented?{selectable:!0}:{selectable:!0,lockMovementX:!0,lockMovementY:!0}:b.event};E?p=r(k,{left:E.get("x2"),top:E.get("y2"),...L}):s&&(L.leftLine=null,p=r(k,{left:s[0],top:s[1],...L}));u.push(h),p&&(!function(e){K.hovered&&(e.on("mouseover",(()=>{re(e,"hover")})),e.on("mouseout",(()=>{C.show=!1})));if(e.lockMovementX&&e.lockMovementY)return;e.on("moving",(()=>{ie(e),function(e){var t,o,n,i;null==(t=e.leftLine)||t.setCoords().set({x2:e.left,y2:e.top}),null==(o=e.rightLine)||o.setCoords().set({x1:e.left,y1:e.top}),null==(n=e.arrowGroup)||n.setCoords().set({left:e.left,top:e.top}),null==(i=e.arrowGroupText)||i.setCoords().set({left:e.left+O/2,top:e.top+$/2})}(e),K.hovered&&re(e)})),e.on("mouseup",(t=>{if(C.show=!1,1===t.button){const{key:t}=e.origin,o={...e.origin,data:{...e.origin.data,time:M(e.left),value:T(t,e.top)}};x.value.discardActiveObject(),j("change",o),oe(o,"change")}}))}(p),a.push(p),ee.add(p))}(le(s,e),s,d)})),Promise.all(a).then((e=>{const t=u.filter((e=>e));let o=null;e=e.filter((e=>(e&&o&&(o.nextPoint=e,e.prevPoint=o),o=e||o,e))),Promise.all(c).then((o=>{x.value.add(...t,...e,...o),e.forEach((e=>{null==e||e.bringToFront()}))}))}))}))}function oe(e,t="add"){const{dataIndex:o,data:n,index:i,key:r}=e,l=_.find((e=>e.key===r));switch(t){case"remove":l.data.splice(i,1);break;case"change":l.data[i]=n;break;default:{const e=g(n.time,l.data);l.data.splice(e,0,n);break}}ne()}function ne(){var e;ee.size&&(null==(e=x.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),(null==e?void 0:e.arrowGroup)&&t.push(null==e?void 0:e.arrowGroup),(null==e?void 0:e.arrowGroupText)&&t.push(null==e?void 0:e.arrowGroupText)})),t}([...ee]))),ee.clear(),te()}function ie(e){const t=e.prevPoint?e.prevPoint.left:I,o=e.nextPoint?e.nextPoint.left:B;e.setCoords(),["cervix","fetalPresentation"].includes(e.origin.key)&&e.top<Q&&e.set("top",Q),e.top<H&&e.set("top",H),e.top>W&&e.set("top",W),e.left<t&&e.set("left",t),e.left>o&&e.set("left",o)}function re(e,t="moving"){const{title:o,key:n,data:i}=e.origin;C.point={x:e.left,y:e.top},C.list=[`${o} ${"hover"===t?i.value:T(n,e.top)}`,`时间 ${M(e.left).slice(-5)}`],C.show=!0}function le(e,t){if(v(e)&&function(e){const t=V+864e5,o=m(e);return o>=V&&o<=t}(e.time)){const o=S(e.time),n=G(t.key,t.range,e.value);return[o,n<H?H:n>W?W:n]}}function se(e,t){return e+1>t[1]?t[0]:e+1}return u(x,b),function(){const t=new e.Rect({...z,width:q-D-J-1,height:W-1,left:D,top:0,fill:"transparent"});x.value.add(t)}(),function(){function t(t,o="left"){let r="left"===o?D:B;t.forEach(((t,o)=>{const{range:l,spaceValue:u,width:c,title:h,titleStyle:g,key:v,position:m="center",spaceGridNumber:k=1,showNumber:w,showMaxMinNumber:b}=t,j=[],C=[],P=r+c/2,S=y(l,u),G=S.length;S.forEach(((e,o)=>{const{lineXMain:n,lineXSub:i,textLeft:l}=d(m,r,c),s=W-o*$*k,a=0===o?W-8:o!==S.length-1||H||Q&&"FHR"!==v?s:H+8;!w||(0===o||o===G-1)&&!b||j.push(f(String(e),t,l,a)),C.push(...p(t,o,n,i,s,$,H,G))}));const M=new e.Rect({...a,strokeWidth:.5,width:c,height:W,left:P,top:W/2}),T=n([P,H>0?H-$/2:$/2],{value:String(h),...i,...g}),Y=new e.Group([...C,...j,M,...T?[T]:[]],{objectCaching:!1,...s});x.value.add(Y),Y.sendToBack(),r+=c}))}t(N),t(R,"right")}(),function(){const{show:t,startTime:o,range:r=[0,23],position:l="top",style:a}=X.time,{show:u,range:c=[0,23],position:d,style:f}=X.processTime;if(t||u){const p=[],h=[],g=[],v=[],m=I+O/2,y=$/2;for(let e=0;e<A.mainXCell;e++){if(t){const t=0===e?+o.slice(11,13):se(p.at(-1),r);p.push(t);const s="top"===l?H-y:W+y;g.push(n([m+e*O,s],{value:String(t),...i,...a||{}}))}if(u){const t=0===e?c[0]:h.at(-1)+1;h.push(t);const o="top"===d?y:Z-y;v.push(n([m+e*O,o],{value:String(t),...i,...f||{}}))}}const k=new e.Group([...g,...v],{objectCaching:!1,...s});x.value.add(k),x.value.sendToBack(k)}}(),function(){var e;const o=Object.values(U),n=[],i={},r=_.find((e=>"cervix"===e.key&&e.show)),l=null==(e=null==r?void 0:r.data)?void 0:e.find((e=>3==+e.value));function s(e,t){const{key:o,range:n}=r||{},i=G(o,n,10),l=[0,t],s=[-t/e,0],a=[(W-i-t)/e,W-i],u=[B-I,e*(B-I)+t];let c=[],d=[];function f([o,n]){return Math.abs(n-e*o-t)<=1}function p([e,t]){const[o,n]=[...h([e,t])];return o>=I&&o<=B&&n>=i&&n<=W}function h([e,t]){return[I+e,W-t]}return f(l)&&p(l)&&(c=h(l)),f(s)&&p(s)&&(c=h(s)),f(a)&&p(a)&&(d=h(a)),f(u)&&p(u)&&(d=h(u)),[...c,...d]}o.forEach((e=>{if(!e.show)return;const{key:o}=e;switch(o){case"fetalPresentation":{const{range:i,show:r}=_.find((e=>e.key===o));if(r){const r=G(o,i,0);n.push(t([I,r,B,r],{...e}))}break}case"alert":if(l){const{key:o,range:a}=r||{},u=216e5,c={time:w(new Date(m(l.time)+u),"yyyy-MM-dd HH:mm"),value:10},[d,f]=[S(l.time)-I,W-G(o,a,l.value)],[p,h]=[S(c.time)-I,W-G(o,a,c.value)],g=(h-f)/(p-d),v=f-d*g,y=s(g,v);y.length>0&&(n.push(t(y,{...e})),Object.assign(i,{k:g,b:v}))}break;case"handling":if(l){const{k:o,b:r}=i,a=144e5,u=s(o,r-(S(w(new Date(m(l.time)+a),"yyyy-MM-dd HH:mm"))-S(l.time))*o);u.length>0&&n.push(t(u,{...e}))}}})),x.value.add(...n)}(),te(),function(){function e(e,t){const o=_.findIndex((t=>t.key===e.key));return{renderItem:()=>e.title,origin:{title:e.title,unit:e.unit,dataIndex:o,key:e.key},pointer:t}}b.event.evented&&x.value.on("mouse:up",(t=>{if(3===t.button){const{x:o=0,y:n=0}=t.pointer||{};o>=I&&o<=B&&n>=H&&n<=W&&(P.point={x:o,y:n},P.show=!0,t.target?(P.target=t.target,P.list=["删除节点"],x.value.forEachObject((e=>{e.origin&&e.left===t.target.left&&e.top===t.target.top&&P.list.push({renderItem:()=>e.origin.title,origin:{...e.origin},mode:"remove",pointer:t.pointer})}))):(P.target=null,P.list=["新增节点"],_.filter((e=>e.show)).forEach((i=>{if(!Y(o,"key",O).includes(i.key)){if(["cervix","fetalPresentation"].includes(i.key)&&n<Q)return;P.list.push(e(i,t.pointer))}})),1===P.list.length&&(P.show=!1,E("repeat"),console.log("当前时间段内无可新增节点"))))}}))}(),function(){const e=q-J/2;function t(e,t){if(!e.length)return;let n=H;const i=[];e.forEach((e=>{const o=e.title.split("").join("\n"),r=F.findIndex((t=>t.key===e.key)),{text:s,icon:a}=l(o,e,{text:{originY:"top",left:t,top:n},icon:{left:t,topY:n,originY:"top",origin:{type:e.type,dataIndex:r},...b.event}},"vertical");var u;n+=s.height+a.height+15,(u=a).on("moving",(()=>{u.set("originY","center"),L(u)?(ie(u),re(u)):C.show=!1})),u.on("mouseup:before",(e=>{if(C.show=!1,0===e.e.button&&L(u))if(Y(u.left,"key",O).includes(u.origin.key))E("repeat");else{const e={data:{time:M(u.left),value:T(u.origin.key,u.top)},...u.origin};j("add",e),oe(e)}!function(e){e.setCoords().set({originY:"top",left:e.originLeft,top:e.originTop})}(u)})),i.push(s,a)})),o(i),x.value.add(...i)}function o(e){const t=e.at(-1),o=(W-H)/2,n=(t.height+t.top-H)/2;e.forEach((e=>{const t=e.top+o-n;e.set({top:t,originTop:t})}))}t(N,D/2),t(R,e)}(),{clickMenu:function({item:e,target:t}){const o={...e.origin};"remove"===e.mode?(j("remove",o),oe(o,"remove")):(Object.assign(o,{data:{time:M(e.pointer.x),value:T(e.origin.key,e.pointer.y)}}),j("add",o),oe(o))},redrawPoints:ne}}export{x as useBirthProcess};
@@ -1 +1 @@
1
- export{defaultBorderStyle,defaultLineStyle,defaultRectStyle,defaultStyle,defaultTextStyle,drawArrow,drawLine,drawPoint,drawText,drawTextGroup}from"./useDraw.js";export{useGrid}from"./useGrid.js";export{useBirthProcessCumputedPoint,useCumputedPoint}from"./useCumputedPoint.js";export{useCanvasEvent,useEvent}from"./useEvent.js";export{drawScaleLine,drawScaleNumber,getScaleInfo}from"./useScaleColumn.js";export{useCommon}from"./useCommon.js";export{useBirthProcessChart}from"./birthProcess/useBirthProcessChart.js";export{useTemperatureChart}from"./temperature/useTemperatureChart.js";export{useSurgicalAnesthesiaChart}from"./surgicalAnesthesia/useSurgicalAnesthesiaChart.js";
1
+ export{defaultBorderStyle,defaultLineStyle,defaultRectStyle,defaultStyle,defaultTextStyle,drawArrow,drawLine,drawPoint,drawText,drawTextAndIconGroup,drawTextGroup}from"./useDraw.js";export{useGrid}from"./useGrid.js";export{useBirthProcessCumputedPoint,useCumputedPoint}from"./useCumputedPoint.js";export{useCanvasEvent,useEvent}from"./useEvent.js";export{drawScaleLine,drawScaleNumber,getScaleInfo}from"./useScaleColumn.js";export{useCommon}from"./useCommon.js";export{useBirthProcessChart}from"./birthProcess/useBirthProcessChart.js";export{useTemperatureChart}from"./temperature/useTemperatureChart.js";export{useSurgicalAnesthesiaChart}from"./surgicalAnesthesia/useSurgicalAnesthesiaChart.js";
@@ -1 +1 @@
1
- import"../useDraw.js";import{useGrid as r}from"../useGrid.js";import"date-fns";import"lodash-es";import"@vueuse/core";import"../../../../../shared/utils/fabricjs/index.js";import"vue";import"../temperature/useShadow.js";function e(e,o){r(e,o)}export{e as useCenter};
1
+ import{drawLine as t,drawPoint as e}from"../useDraw.js";import{useGrid as i}from"../useGrid.js";import{useBirthProcessCumputedPoint as n}from"../useCumputedPoint.js";import"@vueuse/core";import"../../../../../shared/utils/fabricjs/index.js";import"vue";import{isEffectiveNode as o,getTime as r}from"../../utils/index.js";import{cloneDeep as s}from"lodash-es";import"date-fns";import"../temperature/useShadow.js";function l(l,a){const{cumputedX:u,cumputedY:p,getXValue:c,getYValue:m}=n(a),{left:d,xCellWidth:f,yCellHeight:h,originX:v,endX:g,originY:x,endY:y,itemList:j,event:L,canvasHeight:Y,scaleValues:b,xAxis:k,startTime:P}=a,X=new Set,w=s(b);function A(t,e){if(o(t)&&function(t){const e=Date.parse(k.list.at(-1)),i=r(t);return i>=P&&i<=e}(t.time)){const i=u(t.time),n=p(e.type,e.range,t.value);return[i,n<x?x:n>y?y:n]}}i(l,a),w.forEach((i=>{i.dataList.forEach(((n,o)=>{!function(i,n,o){var r;const{type:s,dataList:u=[]}=o,p=[],c=[];function m(i,r,l,u){let m,d;const{pointAttr:f={},lineAttr:h={},title:v="",key:g,type:x="circle"}=u,y=A(u.list[l+1],o);i&&y&&!r.breakpoint&&i[0]!==y[0]&&(d=t([...i,...y],{...h}));const j=c[l-1],L={origin:{data:r,title:v,key:g||"",unit:o.unit,type:s,dataIndex:n,index:l},leftLine:j,rightLine:d,...f,...a.event.hovered?a.event.evented?{selectable:!0}:{selectable:!0,lockMovementY:!0}:a.event};j?m=e(x,{left:j.get("x2"),top:j.get("y2"),...L}):i&&(L.leftLine=null,m=e(x,{left:i[0],top:i[1],...L})),c.push(d),m&&(p.push(m),X.add(m))}null==(r=i.list)||r.forEach(((t,e)=>{m(A(t,o),t,e,i)})),Promise.all(p).then((t=>{const e=c.filter((t=>t));let i=null;t=t.map((t=>(t&&i&&(i.nextPoint=t,t.prevPoint=i),i=t||i,t))),l.value.add(...e,...t)}))}(n,o,i)}))}))}export{l as useCenter};
@@ -1 +1 @@
1
- import{fabric as t}from"../../../../../shared/utils/fabricjs/index.js";import{drawTextGroup as e,defaultStyle as i,drawPoint as o,drawText as n,defaultTextStyle as r}from"../useDraw.js";import"date-fns";import{getScaleNumberList as l}from"../../utils/index.js";import"@vueuse/core";import{drawScaleNumber as s}from"../useScaleColumn.js";import"vue";import"lodash-es";import"../temperature/useShadow.js";function a(a,u,c){const{originY:h,endY:d,borderStyle:p,left:g,itemList:f,scaleValues:m,originX:y,endX:S,yCellHeight:w}=u;!function(){if(!g)return;const{title:t,titleWidth:i,titleStyle:o}=g,n=e({width:i,height:d-h,...p},{value:t.split("").join("\n"),...o||{}},{left:0,top:h},!0);a.value.add(n)}(),m.forEach(((e,o)=>{const u="left"===e.layout?y-5:S+5,{range:c,spaceValue:p,title:f,titleStyle:m,spaceGridNumber:b=1,showNumber:j,showMaxMinNumber:v}=e,x=[],N=l(c,p);console.log(555,N);const C=N.length;N.forEach(((t,i)=>{const o=0===i?d-5:d-i*w*b;!j||(0===i||i===C-1)&&!v||x.push(s(String(t),{...e,position:e.layout},u,o))}));const T=n([g.width/2,h+w],{value:String(f),...r,...m}),X=new t.Group([...x,...T?[T]:[]],{objectCaching:!1,...i});a.value.add(X),X.sendToBack()})),function(){const e=JSON.parse(JSON.stringify(f));let n=d;const r=g.titleWidth+15;e.reverse().forEach((e=>{n-=10;const l=e.title,s=new t.Text(String(l),{...i,objectCaching:!1,...e.titleStyle||{},originX:"left",originY:"bottom",left:r,top:n,lineHeight:1,fontSize:12}),u=o(e.type,{left:r+s.width+5,top:n-(s.height||30)/2-1,...e.pointAttr,originY:"center",originX:"left",origin:{title:e.title,unit:e.unit,type:e.bigType,dataIndex:e.dataIndex,key:e.key,isMenu:!0},originLeft:r+s.width+5,originTop:n-(s.height||30)/2-1});n-=s.height||30,a.value.add(s,u)}))}()}export{a as useLeft};
1
+ import{fabric as t}from"../../../../../shared/utils/fabricjs/index.js";import{drawTextGroup as e,drawTextAndIconGroup as i,drawText as o,defaultTextStyle as l,defaultStyle as n}from"../useDraw.js";import"date-fns";import{getScaleNumberList as r}from"../../utils/index.js";import"@vueuse/core";import{drawScaleNumber as s}from"../useScaleColumn.js";import"vue";import"lodash-es";import"../temperature/useShadow.js";function a(a,u,c){const{originY:d,endY:h,borderStyle:p,left:f,itemList:m,scaleValues:v,originX:g,endX:w,yCellHeight:j,canvasWidth:y,canvasHeight:S}=u;!function(){if(!f)return;const{title:t,titleWidth:i,titleStyle:o}=f,l=e({width:i,height:h-d,...p},{value:t.split("").join("\n"),...o||{}},{left:0,top:d},!0);a.value.add(l)}(),v.forEach(((e,i)=>{var u,c;const d="left"===e.layout?g-5:w+5,{range:p,spaceValue:m,title:v,unit:S,titleStyle:b,spaceGridNumber:x=1,showNumber:N,showMaxMinNumber:W}=e,k=[],C=r(p,m),E=C.length;C.forEach(((t,i)=>{const o=0===i?h-5:h-i*j*x;!N||(0===i||i===E-1)&&!W||k.push(s(String(t),{...e,position:e.layout},d,o))}));const X=v&&o(["left"===e.layout?f.width/2:w+(y-w)/2,(null!=(c=null==(u=k.at(-1))?void 0:u.top)?c:330)-j],{value:`${v}${S?"\n"+S:""}`,...l,...b}),Y=new t.Group([...k,...X?[X]:[]],{objectCaching:!1,...n});a.value.add(Y),Y.sendToBack()})),function(){const t=JSON.parse(JSON.stringify(m));let e=h;const o=f.titleWidth+15;t.reverse().forEach((t=>{e-=10;const l=t.title,{text:n,icon:r}=i(l,t,{text:{left:o,top:e},icon:{leftX:o,topY:e}});e-=n.height||30,a.value.add(n,r)}))}(),a.value.add(new t.Rect({left:0,top:0,width:y-p.strokeWidth,height:S-p.strokeWidth,fill:"transparent",...p}))}export{a as useLeft};
@@ -1 +1 @@
1
- import{ref as t,reactive as e,computed as a,unref as i,onMounted as r,nextTick as l}from"vue";import{defaultBorderStyle as o}from"../useDraw.js";import"../../../../../shared/utils/fabricjs/index.js";import{format as s}from"date-fns";import{getChildrenSize as n}from"../../utils/index.js";import"@vueuse/core";import{cloneDeep as u,range as d}from"lodash-es";import"../temperature/useShadow.js";import{useTop as p}from"./useTop.js";import{useLeft as m}from"./useLeft.js";import{useCenter as h}from"./useCenter.js";function c(c,v,f,g){const x=t(),y=t(),w=t(),b=e({show:!1,point:{x:0,y:0},list:[]}),j=e({show:!1,point:{x:0,y:0},list:[],target:null}),C=a((()=>{var t;return null!=(t=v.data.left.width)?t:0})),H=a((()=>n(v.data.top.treeData))),Y=a((()=>{const{xAxis:t}=v.data;return"top"===t.position?t.height:0})),T=function(){const t=u(v.data.top.treeData);let e=0;const{cellWidth:a,cellHeight:i}=v.data.top.tree;return function t(r,l=0){r.forEach((r=>{var o;const s={top:e*i+Y.value,left:l*a,width:a,height:i};if(e++,null==(o=r.children)?void 0:o.length){e--;const a=n(r.children);s.height=a*i,t(r.children,l+1)}else s.width=C.value-s.left;Object.assign(r,s)}))}(t),t}();const D=a((()=>{const{grid:t}=v.data;return t.mainXCell*t.subXCell})),M=a((()=>v.data.top.tree.cellHeight)),X=a((()=>Y.value+M.value*H.value)),A=a((()=>{const t=u(v.data.xAxis),{position:e,spaceValue:a,spaceTimeStamp:i}=t,r=d(D.value/a+1).map((e=>0===e?t.startTime:s(new Date(W.value+e*a*i),"yyyy-MM-dd HH:mm:ss")));return{...t,list:r,left:C.value,top:"top"===e?0:X.value}})),S=a((()=>{const{grid:t}=v.data;return t.mainYCell*t.subYCell})),G=a((()=>{var t;const{width:e,right:a}=v.data;if(!a)return e;return e-(null!=(t=a.width)?t:0)})),V=a((()=>v.data.xAxis.height+M.value*H.value)),L=a((()=>{var t;const{bottom:e=null,height:a}=v.data;if(!e)return a;return a-(null!=(t=e.height)?t:0)})),N=a((()=>(G.value-C.value)/D.value)),P=a((()=>(L.value-V.value)/S.value)),W=a((()=>{var t;return Date.parse((null==(t=v.data.xAxis)?void 0:t.startTime)||s(new Date,"yyyy-MM-dd HH:mm:ss"))})),E=a((()=>A.value.spaceTimeStamp/N.value)),I=a((()=>{const{scaleValues:t}=v.data;return t.map((t=>t.dataList.filter((t=>t.show)).map(((e,a)=>({...e,bigType:t.type,unit:t.unit,dataIndex:a}))))).flat()})),O=e({canvasWidth:v.data.width,canvasHeight:v.data.height,borderStyle:{...o,...v.data.borderStyle||{}},grid:v.data.grid,top:v.data.top,left:v.data.left,other:v.data.other,topGridYNumber:i(H),topGridYCellHeight:i(M),topGridOriginY:i(Y),topGridEndY:i(X),treeData:T,xAxis:i(A),startTime:i(W),timeXCell:i(E),gridXNumber:i(D),gridYNumber:i(S),xCellWidth:i(N),yCellHeight:i(P),originX:i(C),endX:i(G),originY:i(V),endY:i(L),itemList:i(I),scaleValues:v.data.scaleValues});return r((async()=>{await l(),p(c,O),m(c,O),h(c,O)})),{propItems:O,redrawPoints:y,select:x,pointTipProps:b,pointMenuProps:j,clickMenu:w}}export{c as useSurgicalAnesthesiaChart};
1
+ import{ref as t,reactive as e,computed as a,unref as r,onMounted as l,nextTick as i}from"vue";import{defaultBorderStyle as s}from"../useDraw.js";import"../../../../../shared/utils/fabricjs/index.js";import{format as n}from"date-fns";import{getChildrenSize as o}from"../../utils/index.js";import"@vueuse/core";import{cloneDeep as u,range as d}from"lodash-es";import"../temperature/useShadow.js";import{useTop as p}from"./useTop.js";import{useLeft as c}from"./useLeft.js";import{useCenter as m}from"./useCenter.js";function h(h,v,f,g){const y=t(),x=t(),w=t(),b=e({show:!1,point:{x:0,y:0},list:[]}),C=e({show:!1,point:{x:0,y:0},list:[],target:null}),Y=a((()=>{var t;return null!=(t=v.data.left.width)?t:0})),j=a((()=>o(v.data.top.treeData))),H=a((()=>{const{xAxis:t}=v.data;return"top"===t.position?t.height:0})),T=function(){const t=u(v.data.top.treeData);let e=0;const{cellWidth:a,cellHeight:r}=v.data.top.tree;return function t(l,i=0){l.forEach((l=>{var s;const n={top:e*r+H.value,left:i*a,width:a,height:r};if(e++,null==(s=l.children)?void 0:s.length){e--;const a=o(l.children);n.height=a*r,t(l.children,i+1)}else n.width=Y.value-n.left;Object.assign(l,n)}))}(t),t}();const V=a((()=>{const{grid:t}=v.data;return t.mainXCell*t.subXCell})),D=a((()=>v.data.top.tree.cellHeight)),M=a((()=>H.value+D.value*j.value)),X=a((()=>{const t=u(v.data.xAxis),{position:e,spaceValue:a,spaceTimeStamp:r}=t,l=d(V.value/a+1).map((e=>0===e?t.startTime:n(new Date(W.value+e*a*r),"yyyy-MM-dd HH:mm:ss")));return{...t,list:l,left:Y.value,top:"top"===e?0:M.value}})),A=a((()=>{const{grid:t}=v.data;return t.mainYCell*t.subYCell})),S=a((()=>{var t;const{width:e,right:a}=v.data;if(!a)return e;return e-(null!=(t=a.width)?t:0)})),G=a((()=>v.data.xAxis.height+D.value*j.value)),L=a((()=>{var t;const{bottom:e=null,height:a}=v.data;if(!e)return a;return a-(null!=(t=e.height)?t:0)})),N=a((()=>(S.value-Y.value)/V.value)),P=a((()=>(L.value-G.value)/A.value)),W=a((()=>{var t;return Date.parse((null==(t=v.data.xAxis)?void 0:t.startTime)||n(new Date,"yyyy-MM-dd HH:mm:ss"))})),E=a((()=>X.value.spaceTimeStamp/N.value)),I=a((()=>{const{scaleValues:t}=v.data;return t.map((t=>t.dataList.filter((t=>t.show)).map(((e,a)=>({...e,bigType:t.type,unit:t.unit,dataIndex:a}))))).flat()})),O=a((()=>{const{scaleValues:t}=v.data,e=t.find((t=>"pulse"===t.type));return((null==e?void 0:e.spaceValue)||20)/P.value})),k=a((()=>{const{scaleValues:t}=v.data,e=t.find((t=>"temperature"===t.type));return((null==e?void 0:e.spaceValue)||2)/P.value})),q=a((()=>{var t;return(null==(t=v.data.grid)?void 0:t.event)||{selectable:!0,evented:!0,hovered:!0}})),z=e({canvasWidth:v.data.width,canvasHeight:v.data.height,borderStyle:{...s,...v.data.borderStyle||{}},grid:v.data.grid,top:v.data.top,left:v.data.left,other:v.data.other,topGridYNumber:r(j),topGridYCellHeight:r(D),topGridOriginY:r(H),topGridEndY:r(M),treeData:T,xAxis:r(X),startTime:r(W),timeXCell:r(E),gridXNumber:r(V),gridYNumber:r(A),xCellWidth:r(N),yCellHeight:r(P),originX:r(Y),endX:r(S),originY:r(G),endY:r(L),itemList:r(I),scaleValues:v.data.scaleValues,pulseYCell:r(O),temperatureYCell:r(k),event:r(q)});return l((async()=>{await i(),p(h,z),c(h,z),m(h,z)})),{propItems:z,redrawPoints:x,select:y,pointTipProps:b,pointMenuProps:C,clickMenu:w}}export{h as useSurgicalAnesthesiaChart};
@@ -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"date-fns";import{isOneLine as a,getType as u,isOverlapPoint as p,isValidValue as d,setOtherType as c,isEffectiveNode as f,getTime as h,getIndex as v,deleteProperty as g}from"../../utils/index.js";import"@vueuse/core";import{useCommon as y}from"../useCommon.js";import"vue";import{cloneDeep as m}from"lodash-es";import{TEMPERATURE_MENU as x,PAIN_MENU as b,OVERLAP as w}from"../../constants/index.js";function j(j,k,Y,S,E,$,M,P,O,T){r(j,k);const{getEqualXTypes:A,handleAddPrevent:I}=y(j,Y),{createShadowLines:C}=t(),{left:R,xScaleList:X,xCellWidth:F,yCellHeight:z,originX:D,endX:V,originY:_,endY:G,itemList:H,event:q,vitalSignsOriginY:W,painOriginY:B,hospitalizationDate:J,config:K,canvasHeight:N}=k,Q=new Set,U=["xinmai","mai"],Z=new Map,ee=new Set,te=new Set,ie=new Set,ne=m(R.yScaleValue);function oe(t){var i;const o=ne.find((e=>"pulse"===e.type));if(o&&(null==(i=o.dataList)?void 0:i.length)&&(Q.size&&j.value.remove(...Q),Q.clear(),Z.size>1)){if(t){const{type:e,key:i}=t.origin||{};if("pulse"===e){const e=Z.get(i),n=null==e?void 0:e.findIndex((e=>e[0]===t.left));e.splice(n,1,[t.left,t.top])}}(function(){const e=[],t=[],i=[];for(const e of Z)t.push(e[1]),e[0]===U[0]&&e[1].forEach((e=>{(Z.get(U[1])||[]).findIndex((t=>t[0]===e[0]))>-1&&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)),a=n[i],u=o[r],p=n[i-1],d=n[i+1],c=o[r-1],f=o[r+1];if(p&&c){if(p[0]!==c[0]){const e=Math.max(p[0],c[0]);l.push([p,c].find((t=>t[0]===e)))}}else p?l.push(p):c&&s.push(c);const h=Math.min(a[1],u[1]);l.push([a,u].find((e=>e[1]===h)));const v=Math.max(a[1],u[1]);s.push([a,u].find((e=>e[1]===v)));const g=()=>{const t=[...l,...s.reverse()],[i]=t,n=t.at(-1);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})().forEach((t=>{var i,l,s,r,a,u;const p=t.map((e=>({x:e[0],y:e[1]}))),d=new e.Polygon(p,{...n,...(null==(i=o.shadow)?void 0:i.style)||{}});if("slash"==(null==(l=o.shadow)?void 0:l.mode)){d.set({fill:"transparent",stroke:(null==(r=null==(s=o.shadow)?void 0:s.style)?void 0:r.stroke)||"#f00"});const e=C(t,null==(a=o.shadow)?void 0:a.style._angle,null==(u=o.shadow)?void 0:u.style.space);e.forEach((e=>{var t;Object.assign(e,{...n,...(null==(t=o.shadow)?void 0:t.style)||{}}),Q.add(e)})),j.value.add(...e)}Q.add(d),j.value.add(d)}))}}function le(){var e;const t=ne.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({},w,R.overlap||{}),l=[];ee.size&&[...ee].forEach((e=>{[...te].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),"humai"===e&&(r="circle"),l.push(o(r,{...i[e]||{},...s}))}}}))})),setTimeout((()=>{j.value.add(...l),l.forEach((e=>{null==e||e.bringToFront(),ie.add(e)}))}))}function se(e,t,r){var u;const{type:p,riseStyle:f={},noRiseStyle:h={},verifiedStyle:v={},reduceStyle:g={},pacemaker:y={},upArrowStyle:m={},limitValueStyle:x={},nonePainPointStyle:b={},dataList:w=[]}=r,S=[],$=[],P=[];null==(u=e.list)||u.forEach(((u,T)=>{const A=a(p)?w.find((e=>e.key===u.key)):e,I=ue(u,r),C={};C.value=function(e,t,i){if(!(null==e?void 0:e.length)||!K.showValue)return;const{lineAttr:n={}}=i,o=e[1]<=W.originY+z?e[1]+z:e[1]-z,s=l([e[0],o],{value:t.value,originX:"center",originY:"center",fill:n.stroke||"#000"});return P.push(s),{obj:s,top:-z}}(I,u,A),function(e,t,r,a,u){var c,y;if(!(null==e?void 0:e.length)||!["temperature","pain"].includes(p))return;const{lineAttr:m={}}=r,{value:x}=a;let b,w,j,k,Y,S;if(t.noRise&&h.show){const t=L(h)?E(u.type,u.list,35):e[1];if(h.text)j=l([e[0],L(h)?t:t+5],{value:h.text.split("").join("\n"),originY:"top",...h.style||{}}),P.push(j);else{const i=t+2*z;k=s([e[0],t,i],h.style||{}),P.push(k)}}t.rise&&f.show&&f.text&&(Y=l([e[0],e[1]-(x?z:0)-5],{value:f.text.split("").join("\n"),originY:"bottom",...f.style||{}}),P.push(Y));t.verified&&(S=l([e[0],e[1]-(x?z:0)-5],{value:"v",originX:"center",originY:"bottom",...v}),P.push(S));if(d(t.physicsReduce)||d(t.drugReduce)){const l=E(p,u.list,null!=(c=t.physicsReduce)?c:t.drugReduce);b=i([...e,e[0],l],{...m,...g.line,...n}),w=o((null==(y=null==g?void 0:g.point)?void 0:y.type)||"circle",{left:e[0],top:l,...g.point,...n,originY:l===N?"bottom":"center"}),b&&P.push(b),w&&P.push(w)}Object.assign(a,{reduceLine:{obj:b,type:"line"},noRiseText:{obj:j,top:5,isFixed:L(h)},arrowGroup:{obj:k,top:2*z,isFixed:L(h)},riseText:{obj:Y,top:(x?-z:0)-5},verifiedText:{obj:S,top:(x?-z:0)-5},reducePoint:{obj:w,type:"reduce"}})}(I,u,A,C,r),function(e,t,i,n){if(!(null==e?void 0:e.length)||!["pulse"].includes(p))return;let o,a;const{upArrowShow:u=!1,limitValueShow:d=!1}=i;if(u&&+t.value>180){let t=e[1]-2.5*z,i=[e[1]-z/2,t];t<W.originY&&(t=e[1]+2.5*z,i=[t,e[1]+z/2]),o=s([e[0],i[0],i[1]],m,"up"),P.push(o)}if(d){const i={value:t.value,originX:"center",originY:"center",...x};if(+t.value>Math.max(...r.list)){const t=o?e[1]+z/2+o.height:e[1]+z;a=l([e[0],t],i),P.push(a)}+t.value<Math.min(...r.list)&&(a=l([e[0],e[1]-z],i),P.push(a))}Object.assign(n,{upArrow:{obj:o},limitValue:{obj:a,top:-z}})}(I,u,A,C),function(n,l,s,a,u){let d,f;const{pointAttr:h={},lineAttr:v={},title:g="",key:m,type:x="circle"}=a,w=e.list[s+1],L=ue(w,r),E=re(p,e.list[s].value),P=L&&re(p,w.value);!n||!L||l.breakpoint||E||P||n[0]===L[0]||(f=i([...n,...L],{...v}));const T=l.pacemakerShow&&"pulse"==p?y.value:E?0:x,A=$[s-1],I={origin:{data:l,title:g,key:m||"",unit:r.unit,type:p,_type:c(g,p),dataIndex:t,index:s},leftLine:A,rightLine:f,otherObj:u,lockMovementX:!0,...l.pacemakerShow&&"pulse"==p?y.style:h,...k.event.hovered?k.event.evented?{selectable:!0}:{selectable:!0,lockMovementY:!0}:k.event,...E?{selectable:!1,evented:!1,...b}:{}};if(A){const e=A.get("y2");d=o(T,{left:A.get("x2"),top:E?e-5:e,...I})}else n&&(I.leftLine=null,d=o(T,{left:n[0],top:E?n[1]-5:n[1],...I}));$.push(f),d&&(g.includes("脉搏")?ee.add(d):te.add(d),function(e){q.hovered&&(e.on("mouseover",(()=>{ae(e,"hover")})),e.on("mouseout",(()=>{O.show=!1})));if(e.lockMovementX&&e.lockMovementY)return;e.on("moving",(()=>{!function(e){e.setCoords();const t="pain"===e.origin.type?B:W;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}=t||{};"reduce"!==n&&("line"===n?null==i||i.setCoords().set({x1:e.left,y1:e.top}):!l&&(null==i||i.setCoords().set({left:e.left,top:e.top+o})))})),oe(e)}(e),q.hovered&&ae(e)})),e.on("mouseup",(t=>{if(O.show=!1,1===t.button){const{type:t}=e.origin,i=M(t,e.top),n={...e.origin,data:{...e.origin.data,value:i}};j.value.discardActiveObject(),Y("change",n),de(n,"change")}}))}(d),S.push(d),ie.add(d))}(I,u,T,A,C)})),"pulse"===p&&U.forEach((e=>{Z.set(e,S.filter((t=>{var i;return(null==(i=t.origin)?void 0:i.key)===e})).map((e=>[e.left,e.top])))})),Promise.all(S).then((e=>{const t=$.filter((e=>e));let i=null;e=e.map((e=>(e&&i&&(i.nextPoint=e,e.prevPoint=i),i=e||i,e))),Promise.all(P).then((i=>{j.value.add(...t,...e,...i),e.forEach((t=>{null==t||t.bringToFront(),function(e,t){if("pulse"===e.origin.type){t.filter((t=>t.left===e.left&&"pulse"===t.origin.type)).length>1&&(e.leftLine&&j.value.remove(e.leftLine),e.rightLine&&j.value.remove(e.rightLine))}}(t,e)}))}))}))}function re(e,t){return"pain"===e&&0==t}function ae(e,t="moving"){const{title:i,unit:n,type:o,data:l}=e.origin;O.point={x:e.left,y:e.top},O.list=[function(){const{drugReduce:s,physicsReduce:r}=l||{},a="hover"===t?l.value:M(o,e.top);if(d(s))return`药物降${"pain"==o?"痛":"温"} ${a}—>${s}${n||""}`;if(d(r))return`物理降${"pain"==o?"痛":"温"} ${a}—>${r}${n||""}`;return`${i} ${a}${n||""}`}(),`时间 ${((null==l?void 0:l.time)||$(e.left)).slice(-5)}`],O.show=!0}function ue(e,t){const i="pain"===t.type?B:W;if(f(e)&&function(e){const[t]=X,i=X.at(-1),n=t.start,o=i.end,l=h(e);return l>=n&&l<=o}(e.time)){const n=S(e.time),o=E(t.type,t.list,e.value);return[n,o<i.originY?i.originY:o>i.endY?i.endY:o]}}function pe(e){const t=new Date,i=String(t.getMonth()+1).padStart(2,"0"),n=String(t.getDate()).padStart(2,"0"),o=h(`${t.getFullYear()}-${i}-${n} 23:59:59`),l=h(`${$(e)}:00`);return J&&l<h(J)?(I("exceedMin"),!1):!(l>o)||(I("exceedMax"),!1)}function de(e,t="add"){const{type:i,dataIndex:n,index:o,data:l,key:s}=e,r=ne.find((e=>e.type===i));if("add"===t){const e=a(i)?r.dataList.find((e=>e.enable)):r.dataList[n],t=v(l.time,e.list);e.list.splice(t,0,l)}else r.dataList[n].list[o]=l;ce()}function ce(){var e;ie.size&&(null==(e=j.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}([...ie]))),Z.clear(),ie.clear(),ee.clear(),te.clear(),ne.forEach((e=>{e.dataList.forEach(((t,i)=>{a(e.type)&&!t.enable||se(t,i,e)}))})),oe(),le()}return Z.clear(),ee.clear(),te.clear(),ne.forEach((e=>{!function(e){if("temperature"!==e.type||!e.positionLine)return;const t=E(e.type,e.list,e.positionLine.value),n=i([D,t,V,t],e.positionLine);j.value.add(n)}(e),e.dataList.forEach(((t,i)=>{a(e.type)&&!t.enable||se(t,i,e)}))})),oe(),le(),k.event.evented&&j.value.on("mouse:up",(e=>{var t;if(3===e.button){const{x:i=0,y:n=0}=e.pointer||{};if(i>=D&&i<=V&&n>=_&&n<=G){T.point={x:i,y:n},T.show=!0;const{type:o}=(null==(t=e.target)?void 0:t.origin)||{};if(e.target&&["temperature","pain"].includes(o))"temperature"===o&&(T.list=[...x]),"pain"===o&&(T.list=[...b]),T.target=e.target;else{T.target=null,T.list=["新增节点"],H.forEach((t=>{if(!A(i,"_type",F).includes(t.bigType)){const i=["pain"].includes(t.bigType)?B:W;n>=i.originY&&n<=i.endY&&T.list.push({renderItem:P?P(t):()=>t.title,origin:{title:t.title,unit:t.unit,type:u(t.bigType),dataIndex:t.dataIndex,key:t.key},pointer:e.pointer})}}));const t=pe(i);t&&1!==T.list.length||(T.show=!1,1===T.list.length&&t&&I("repeat"))}}}})),{pointTipProps:O,pointMenuProps:T,clickMenu:function({item:e,target:t}){if(t){const{data:i,type:n,dataIndex:o,index:l}=t.origin,s=g(i,[...x,...b]);s[`${e.type}`]=e.value,a(n)&&(s.key=t.origin.key);const r={...t.origin,data:s};Y("change",r),de(r,"change")}else{const t={data:{time:$(e.pointer.x),value:M(e.origin.type,e.pointer.y),...a(e.origin.type)?{key:e.origin.key}:{}},...e.origin};Y("add",t),de(t)}},setPopup:ae,isAddPoint:pe,updateData:de,redrawPoints:ce}}function L(e){return"fixed"===e.position}export{j 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"date-fns";import{isOneLine as a,getType as u,isOverlapPoint as p,isValidValue as d,setOtherType as c,isEffectiveNode as f,getTime as h,getIndex as v,deleteProperty as g}from"../../utils/index.js";import"@vueuse/core";import{useCommon as y}from"../useCommon.js";import"vue";import{cloneDeep as m}from"lodash-es";import{TEMPERATURE_MENU as x,PAIN_MENU as b,OVERLAP as w}from"../../constants/index.js";function j(j,k,Y,S,E,$,M,P,O,T){r(j,k);const{getEqualXTypes:A,handleAddPrevent:I}=y(j,Y,k),{createShadowLines:C}=t(),{left:R,xScaleList:X,xCellWidth:F,yCellHeight:z,originX:D,endX:V,originY:_,endY:G,itemList:H,event:q,vitalSignsOriginY:W,painOriginY:B,hospitalizationDate:J,config:K,canvasHeight:N}=k,Q=new Set,U=["xinmai","mai"],Z=new Map,ee=new Set,te=new Set,ie=new Set,ne=m(R.yScaleValue);function oe(t){var i;const o=ne.find((e=>"pulse"===e.type));if(o&&(null==(i=o.dataList)?void 0:i.length)&&(Q.size&&j.value.remove(...Q),Q.clear(),Z.size>1)){if(t){const{type:e,key:i}=t.origin||{};if("pulse"===e){const e=Z.get(i),n=null==e?void 0:e.findIndex((e=>e[0]===t.left));e.splice(n,1,[t.left,t.top])}}(function(){const e=[],t=[],i=[];for(const e of Z)t.push(e[1]),e[0]===U[0]&&e[1].forEach((e=>{(Z.get(U[1])||[]).findIndex((t=>t[0]===e[0]))>-1&&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)),a=n[i],u=o[r],p=n[i-1],d=n[i+1],c=o[r-1],f=o[r+1];if(p&&c){if(p[0]!==c[0]){const e=Math.max(p[0],c[0]);l.push([p,c].find((t=>t[0]===e)))}}else p?l.push(p):c&&s.push(c);const h=Math.min(a[1],u[1]);l.push([a,u].find((e=>e[1]===h)));const v=Math.max(a[1],u[1]);s.push([a,u].find((e=>e[1]===v)));const g=()=>{const t=[...l,...s.reverse()],[i]=t,n=t.at(-1);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})().forEach((t=>{var i,l,s,r,a,u;const p=t.map((e=>({x:e[0],y:e[1]}))),d=new e.Polygon(p,{...n,...(null==(i=o.shadow)?void 0:i.style)||{}});if("slash"==(null==(l=o.shadow)?void 0:l.mode)){d.set({fill:"transparent",stroke:(null==(r=null==(s=o.shadow)?void 0:s.style)?void 0:r.stroke)||"#f00"});const e=C(t,null==(a=o.shadow)?void 0:a.style._angle,null==(u=o.shadow)?void 0:u.style.space);e.forEach((e=>{var t;Object.assign(e,{...n,...(null==(t=o.shadow)?void 0:t.style)||{}}),Q.add(e)})),j.value.add(...e)}Q.add(d),j.value.add(d)}))}}function le(){var e;const t=ne.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({},w,R.overlap||{}),l=[];ee.size&&[...ee].forEach((e=>{[...te].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),"humai"===e&&(r="circle"),l.push(o(r,{...i[e]||{},...s}))}}}))})),setTimeout((()=>{j.value.add(...l),l.forEach((e=>{null==e||e.bringToFront(),ie.add(e)}))}))}function se(e,t,r){var u;const{type:p,riseStyle:f={},noRiseStyle:h={},verifiedStyle:v={},reduceStyle:g={},pacemaker:y={},upArrowStyle:m={},limitValueStyle:x={},nonePainPointStyle:b={},dataList:w=[]}=r,S=[],$=[],P=[];null==(u=e.list)||u.forEach(((u,T)=>{const A=a(p)?w.find((e=>e.key===u.key)):e,I=ue(u,r),C={};C.value=function(e,t,i){if(!(null==e?void 0:e.length)||!K.showValue)return;const{lineAttr:n={}}=i,o=e[1]<=W.originY+z?e[1]+z:e[1]-z,s=l([e[0],o],{value:t.value,originX:"center",originY:"center",fill:n.stroke||"#000"});return P.push(s),{obj:s,top:-z}}(I,u,A),function(e,t,r,a,u){var c,y;if(!(null==e?void 0:e.length)||!["temperature","pain"].includes(p))return;const{lineAttr:m={}}=r,{value:x}=a;let b,w,j,k,Y,S;if(t.noRise&&h.show){const t=L(h)?E(u.type,u.list,35):e[1];if(h.text)j=l([e[0],L(h)?t:t+5],{value:h.text.split("").join("\n"),originY:"top",...h.style||{}}),P.push(j);else{const i=t+2*z;k=s([e[0],t,i],h.style||{}),P.push(k)}}t.rise&&f.show&&f.text&&(Y=l([e[0],e[1]-(x?z:0)-5],{value:f.text.split("").join("\n"),originY:"bottom",...f.style||{}}),P.push(Y));t.verified&&(S=l([e[0],e[1]-(x?z:0)-5],{value:"v",originX:"center",originY:"bottom",...v}),P.push(S));if(d(t.physicsReduce)||d(t.drugReduce)){const l=E(p,u.list,null!=(c=t.physicsReduce)?c:t.drugReduce);b=i([...e,e[0],l],{...m,...g.line,...n}),w=o((null==(y=null==g?void 0:g.point)?void 0:y.type)||"circle",{left:e[0],top:l,...g.point,...n,originY:l===N?"bottom":"center"}),b&&P.push(b),w&&P.push(w)}Object.assign(a,{reduceLine:{obj:b,type:"line"},noRiseText:{obj:j,top:5,isFixed:L(h)},arrowGroup:{obj:k,top:2*z,isFixed:L(h)},riseText:{obj:Y,top:(x?-z:0)-5},verifiedText:{obj:S,top:(x?-z:0)-5},reducePoint:{obj:w,type:"reduce"}})}(I,u,A,C,r),function(e,t,i,n){if(!(null==e?void 0:e.length)||!["pulse"].includes(p))return;let o,a;const{upArrowShow:u=!1,limitValueShow:d=!1}=i;if(u&&+t.value>180){let t=e[1]-2.5*z,i=[e[1]-z/2,t];t<W.originY&&(t=e[1]+2.5*z,i=[t,e[1]+z/2]),o=s([e[0],i[0],i[1]],m,"up"),P.push(o)}if(d){const i={value:t.value,originX:"center",originY:"center",...x};if(+t.value>Math.max(...r.list)){const t=o?e[1]+z/2+o.height:e[1]+z;a=l([e[0],t],i),P.push(a)}+t.value<Math.min(...r.list)&&(a=l([e[0],e[1]-z],i),P.push(a))}Object.assign(n,{upArrow:{obj:o},limitValue:{obj:a,top:-z}})}(I,u,A,C),function(n,l,s,a,u){let d,f;const{pointAttr:h={},lineAttr:v={},title:g="",key:m,type:x="circle"}=a,w=e.list[s+1],L=ue(w,r),E=re(p,e.list[s].value),P=L&&re(p,w.value);!n||!L||l.breakpoint||E||P||n[0]===L[0]||(f=i([...n,...L],{...v}));const T=l.pacemakerShow&&"pulse"==p?y.value:E?0:x,A=$[s-1],I={origin:{data:l,title:g,key:m||"",unit:r.unit,type:p,_type:c(g,p),dataIndex:t,index:s},leftLine:A,rightLine:f,otherObj:u,lockMovementX:!0,...l.pacemakerShow&&"pulse"==p?y.style:h,...k.event.hovered?k.event.evented?{selectable:!0}:{selectable:!0,lockMovementY:!0}:k.event,...E?{selectable:!1,evented:!1,...b}:{}};if(A){const e=A.get("y2");d=o(T,{left:A.get("x2"),top:E?e-5:e,...I})}else n&&(I.leftLine=null,d=o(T,{left:n[0],top:E?n[1]-5:n[1],...I}));$.push(f),d&&(g.includes("脉搏")?ee.add(d):te.add(d),function(e){q.hovered&&(e.on("mouseover",(()=>{ae(e,"hover")})),e.on("mouseout",(()=>{O.show=!1})));if(e.lockMovementX&&e.lockMovementY)return;e.on("moving",(()=>{!function(e){e.setCoords();const t="pain"===e.origin.type?B:W;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}=t||{};"reduce"!==n&&("line"===n?null==i||i.setCoords().set({x1:e.left,y1:e.top}):!l&&(null==i||i.setCoords().set({left:e.left,top:e.top+o})))})),oe(e)}(e),q.hovered&&ae(e)})),e.on("mouseup",(t=>{if(O.show=!1,1===t.button){const{type:t}=e.origin,i=M(t,e.top),n={...e.origin,data:{...e.origin.data,value:i}};j.value.discardActiveObject(),Y("change",n),de(n,"change")}}))}(d),S.push(d),ie.add(d))}(I,u,T,A,C)})),"pulse"===p&&U.forEach((e=>{Z.set(e,S.filter((t=>{var i;return(null==(i=t.origin)?void 0:i.key)===e})).map((e=>[e.left,e.top])))})),Promise.all(S).then((e=>{const t=$.filter((e=>e));let i=null;e=e.map((e=>(e&&i&&(i.nextPoint=e,e.prevPoint=i),i=e||i,e))),Promise.all(P).then((i=>{j.value.add(...t,...e,...i),e.forEach((t=>{null==t||t.bringToFront(),function(e,t){if("pulse"===e.origin.type){t.filter((t=>t.left===e.left&&"pulse"===t.origin.type)).length>1&&(e.leftLine&&j.value.remove(e.leftLine),e.rightLine&&j.value.remove(e.rightLine))}}(t,e)}))}))}))}function re(e,t){return"pain"===e&&0==t}function ae(e,t="moving"){const{title:i,unit:n,type:o,data:l}=e.origin;O.point={x:e.left,y:e.top},O.list=[function(){const{drugReduce:s,physicsReduce:r}=l||{},a="hover"===t?l.value:M(o,e.top);if(d(s))return`药物降${"pain"==o?"痛":"温"} ${a}—>${s}${n||""}`;if(d(r))return`物理降${"pain"==o?"痛":"温"} ${a}—>${r}${n||""}`;return`${i} ${a}${n||""}`}(),`时间 ${((null==l?void 0:l.time)||$(e.left)).slice(-5)}`],O.show=!0}function ue(e,t){const i="pain"===t.type?B:W;if(f(e)&&function(e){const[t]=X,i=X.at(-1),n=t.start,o=i.end,l=h(e);return l>=n&&l<=o}(e.time)){const n=S(e.time),o=E(t.type,t.list,e.value);return[n,o<i.originY?i.originY:o>i.endY?i.endY:o]}}function pe(e){const t=new Date,i=String(t.getMonth()+1).padStart(2,"0"),n=String(t.getDate()).padStart(2,"0"),o=h(`${t.getFullYear()}-${i}-${n} 23:59:59`),l=h(`${$(e)}:00`);return J&&l<h(J)?(I("exceedMin"),!1):!(l>o)||(I("exceedMax"),!1)}function de(e,t="add"){const{type:i,dataIndex:n,index:o,data:l,key:s}=e,r=ne.find((e=>e.type===i));if("add"===t){const e=a(i)?r.dataList.find((e=>e.enable)):r.dataList[n],t=v(l.time,e.list);e.list.splice(t,0,l)}else r.dataList[n].list[o]=l;ce()}function ce(){var e;ie.size&&(null==(e=j.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}([...ie]))),Z.clear(),ie.clear(),ee.clear(),te.clear(),ne.forEach((e=>{e.dataList.forEach(((t,i)=>{a(e.type)&&!t.enable||se(t,i,e)}))})),oe(),le()}return Z.clear(),ee.clear(),te.clear(),ne.forEach((e=>{!function(e){if("temperature"!==e.type||!e.positionLine)return;const t=E(e.type,e.list,e.positionLine.value),n=i([D,t,V,t],e.positionLine);j.value.add(n)}(e),e.dataList.forEach(((t,i)=>{a(e.type)&&!t.enable||se(t,i,e)}))})),oe(),le(),k.event.evented&&j.value.on("mouse:up",(e=>{var t;if(3===e.button){const{x:i=0,y:n=0}=e.pointer||{};if(i>=D&&i<=V&&n>=_&&n<=G){T.point={x:i,y:n},T.show=!0;const{type:o}=(null==(t=e.target)?void 0:t.origin)||{};if(e.target&&["temperature","pain"].includes(o))"temperature"===o&&(T.list=[...x]),"pain"===o&&(T.list=[...b]),T.target=e.target;else{T.target=null,T.list=["新增节点"],H.forEach((t=>{if(!A(i,"_type",F).includes(t.bigType)){const i=["pain"].includes(t.bigType)?B:W;n>=i.originY&&n<=i.endY&&T.list.push({renderItem:P?P(t):()=>t.title,origin:{title:t.title,unit:t.unit,type:u(t.bigType),dataIndex:t.dataIndex,key:t.key},pointer:e.pointer})}}));const t=pe(i);t&&1!==T.list.length||(T.show=!1,1===T.list.length&&t&&I("repeat"))}}}})),{pointTipProps:O,pointMenuProps:T,clickMenu:function({item:e,target:t}){if(t){const{data:i,type:n,dataIndex:o,index:l}=t.origin,s=g(i,[...x,...b]);s[`${e.type}`]=e.value,a(n)&&(s.key=t.origin.key);const r={...t.origin,data:s};Y("change",r),de(r,"change")}else{const t={data:{time:$(e.pointer.x),value:M(e.origin.type,e.pointer.y),...a(e.origin.type)?{key:e.origin.key}:{}},...e.origin};Y("add",t),de(t)}},setPopup:ae,isAddPoint:pe,updateData:de,redrawPoints:ce}}function L(e){return"fixed"===e.position}export{j as useCenter};
@@ -1 +1 @@
1
- import{fabric as t}from"../../../../../shared/utils/fabricjs/index.js";import{drawLine as e,defaultTextStyle as i,defaultStyle as n,drawPoint as o,drawTextGroup as l}from"../useDraw.js";import"date-fns";import{getType as r,isOneLine as s}from"../../utils/index.js";import"@vueuse/core";import{getScaleInfo as a,drawScaleNumber as u,drawScaleLine as h}from"../useScaleColumn.js";import{useCommon as g}from"../useCommon.js";import"vue";import"lodash-es";import"./useShadow.js";function p(p,c,d,f,y,m,v,w,S,b,Y){var x,j;const{getEqualXTypes:C,handleAddPrevent:T}=g(p,d),{originY:X,endY:k,originX:N,endX:V,xCellWidth:M,yCellHeight:L,left:W,vitalSignsOriginY:E,painOriginY:I,painHeight:A,iconsWidth:G,itemList:H,painIndex:O,right:R,canvasWidth:_,canvasHeight:B,getRightInfo:J,borderStyle:$}=c;function q(o){var r;if(!(null==o?void 0:o.length))return;const{layout:s}=o[0];let g=G,c=N;"right"===s&&(g=V,c=V+(null!=(r=null==R?void 0:R.width)?r:0));const d=[],f=A&&"right"!==s?o.length-1:o.length,y=(c-g)/f,m=y+(c-g)%f;o.forEach(((o,r)=>{if("pain"===o.type)return void function(n){const{list:o=[],spaceGridNumber:r=5,showScale:s,showNumber:h,position:g,showMaxMinNumber:c,style:d,title:f}=n,y=l({width:N-G,height:A,...$},{value:`${f}`,...i,...d||{}},{left:G,top:I.originY}),m=e([G,I.originY,N,I.originY],$),v=[];if(s||h){const{lineXMain:e,textLeft:i}=a(g,G,N-G),l=o.length;o.forEach(((o,a)=>{let g=I.endY-a*L*r;if(0===a&&(g=k-5),!h||(0===a||a===l-1)&&!c||v.push(u(o,n,i,g)),s&&0!==a){const[i,n]=e,o=new t.Line([i,g,n,g],{...$,...d});v.push(o)}}))}p.value.add(m,y,...v),y.sendToBack()}(o);const c=[],f=0===r?m:y,v=0===r?g:m+g+(r-1)*y,w="right"===s?0:E.originY,S="right"===s?B:E.endY,b=r>0?e([v,w,v,S],{objectCaching:!1,...$}):null;b&&c.push(b);const Y=v+f/2,{list:x=[],spaceGridNumber:j=5,showScale:C,showNumber:T,position:X,showMaxMinNumber:V}=o;if(C||T){const{lineXMain:t,lineXSub:e,textLeft:i}=a(X,v,f),n=x.length;x.forEach(((l,r)=>{const s=E.endY-r*L*j;if(T&&(!(0===r||r===n-1)||V)){const t=0==r?s-5:s,e=u(l,o,i,t),n=E.originY+e.height/2;t<n&&e.set({top:n}),c.push(e)}c.push(...h(o,r,t,e,s,L,E.originY))}))}let M=o.title||"";o.unit&&(M+="\n"+o.unit),M&&c.push(new t.Text(String(M),{...i,left:Y,top:E.originY+L*j/2,textAlign:"center",...o.style}));const W=new t.Group(c,{...n,objectCaching:!1});d.push(W)}));const v=d.length>0?new t.Group([...d],{...n,objectCaching:!1}):null;v&&p.value.add(v),v&&v.sendToBack()}function z(t){return t.left>=N&&t.left<V&&t.top>=X&&t.top<=k}G&&function(){const e=JSON.parse(JSON.stringify(H));let i=k;const l=G-W.icons.marginRight;e.reverse().forEach((e=>{i-=10;let a=e.title.replace(/(.{2})/g,"$1\n");a.endsWith("\n")&&(a=a.slice(0,a.length-1));const u=new t.Text(String(a),{...n,objectCaching:!1,...e.titleStyle||{},originX:"right",originY:"bottom",left:l-(e.pointAttr.width||10)-5,top:i,lineHeight:1,fontSize:12}),h=o(e.type,{left:l,top:i-(u.height||30)/2-1,...e.pointAttr,originY:"center",originX:"right",origin:{title:e.title,unit:e.unit,type:r(e.bigType),_type:e.bigType,dataIndex:e.dataIndex,key:e.key,isMenu:!0},originLeft:l,originTop:i-(u.height||30)/2-1,...c.event});var g;i-=u.height||30,(g=h).on("moving",(()=>{g.set("originX","center"),function(t){if(t.left>=N&&t.left<=V){t.setCoords();const e="pain"===t.origin.type?I:E;t.top<e.originY&&t.set("top",e.originY),t.top>e.endY&&t.set("top",e.endY)}}(g),z(g)?f(g):y.show=!1})),g.on("mouseup:before",(t=>{if(y.show=!1,0===t.e.button&&z(g)){const t=C(g.left,"_type",M).includes(g.origin._type),e=b(g.left);if(!e||t)t&&e&&T("repeat");else{const t={data:{time:w(g.left),value:S(g.origin.type,g.top),...s(g.origin.type)?{key:g.origin.key}:{}},...g.origin};d("add",t),Y(t)}}!function(t){t.setCoords().set({originX:"right",left:t.originLeft,top:t.originTop})}(g)})),p.value.add(u,h)}))}();const D=W.yScaleValue.filter((t=>"left"===t.layout&&"pain"!==t.type&&t.show));if((null==R?void 0:R.width)&&"left"===(null==(x=null==R?void 0:R.yScaleValue)?void 0:x.layout)&&(null==(j=null==R?void 0:R.yScaleValue)?void 0:j.show)&&D.push(J),O>0&&W.yScaleValue[O].show){const t=W.yScaleValue[O];0===O&&W.yScaleValue.length>1&&D.unshift(t),O==W.yScaleValue.length-1&&D.push(t)}const P=D.findIndex((t=>"pulse"===t.type&&t.show&&t.doubleShow)),F=D[P];return P>-1&&D.splice(P,0,{...F,title:(null==F?void 0:F.doubleTitle)||(null==F?void 0:F.title)}),q(D),p.value.add(new t.Rect({left:G,top:0,width:_-G-$.strokeWidth,height:B-$.strokeWidth,fill:"transparent",...$})),{drawScaleValue:q}}export{p as useLeft};
1
+ import{fabric as t}from"../../../../../shared/utils/fabricjs/index.js";import{drawLine as e,defaultTextStyle as i,defaultStyle as n,drawTextAndIconGroup as o,drawTextGroup as l}from"../useDraw.js";import"date-fns";import{getType as s,isOneLine as r}from"../../utils/index.js";import"@vueuse/core";import{getScaleInfo as a,drawScaleNumber as u,drawScaleLine as h}from"../useScaleColumn.js";import{useCommon as c}from"../useCommon.js";import"vue";import"lodash-es";import"./useShadow.js";function g(g,p,d,f,m,y,v,w,S,Y,b){var x,j;const{getEqualXTypes:X,handleAddPrevent:C,isGridLimit:N}=c(g,d,p),{originY:T,endY:V,originX:k,endX:L,xCellWidth:M,yCellHeight:W,left:E,vitalSignsOriginY:G,painOriginY:O,painHeight:A,iconsWidth:H,itemList:I,painIndex:R,right:_,canvasWidth:B,canvasHeight:J,getRightInfo:$,borderStyle:q}=p;function D(o){var s;if(!(null==o?void 0:o.length))return;const{layout:r}=o[0];let c=H,p=k;"right"===r&&(c=L,p=L+(null!=(s=null==_?void 0:_.width)?s:0));const d=[],f=A&&"right"!==r?o.length-1:o.length,m=(p-c)/f,y=m+(p-c)%f;o.forEach(((o,s)=>{if("pain"===o.type)return void function(n){const{list:o=[],spaceGridNumber:s=5,showScale:r,showNumber:h,position:c,showMaxMinNumber:p,style:d,title:f}=n,m=l({width:k-H,height:A,...q},{value:`${f}`,...i,...d||{}},{left:H,top:O.originY}),y=e([H,O.originY,k,O.originY],q),v=[];if(r||h){const{lineXMain:e,textLeft:i}=a(c,H,k-H),l=o.length;o.forEach(((o,a)=>{let c=O.endY-a*W*s;if(0===a&&(c=V-5),!h||(0===a||a===l-1)&&!p||v.push(u(o,n,i,c)),r&&0!==a){const[i,n]=e,o=new t.Line([i,c,n,c],{...q,...d});v.push(o)}}))}g.value.add(y,m,...v),m.sendToBack()}(o);const p=[],f=0===s?y:m,v=0===s?c:y+c+(s-1)*m,w="right"===r?0:G.originY,S="right"===r?J:G.endY,Y=s>0?e([v,w,v,S],{objectCaching:!1,...q}):null;Y&&p.push(Y);const b=v+f/2,{list:x=[],spaceGridNumber:j=5,showScale:X,showNumber:C,position:N,showMaxMinNumber:T}=o;if(X||C){const{lineXMain:t,lineXSub:e,textLeft:i}=a(N,v,f),n=x.length;x.forEach(((l,s)=>{const r=G.endY-s*W*j;if(C&&(!(0===s||s===n-1)||T)){const t=0==s?r-5:r,e=u(l,o,i,t),n=G.originY+e.height/2;t<n&&e.set({top:n}),p.push(e)}p.push(...h(o,s,t,e,r,W,G.originY))}))}let L=o.title||"";o.unit&&(L+="\n"+o.unit),L&&p.push(new t.Text(String(L),{...i,left:b,top:G.originY+W*j/2,textAlign:"center",...o.style}));const M=new t.Group(p,{...n,objectCaching:!1});d.push(M)}));const v=d.length>0?new t.Group([...d],{...n,objectCaching:!1}):null;v&&g.value.add(v),v&&v.sendToBack()}H&&function(){const t=JSON.parse(JSON.stringify(I));let e=V;const i=H-E.icons.marginRight;t.reverse().forEach((t=>{e-=10;let n=t.title.replace(/(.{2})/g,"$1\n");n.endsWith("\n")&&(n=n.slice(0,n.length-1));const{text:l,icon:a}=o(n,t,{text:{left:i-(t.pointAttr.width||10)-5,top:e,originX:"right"},icon:{originX:"right",left:i,topY:e,origin:{type:s(t.bigType),_type:t.bigType},...p.event}});var u;e-=l.height||30,(u=a).on("moving",(()=>{u.set("originX","center"),function(t){if(t.left>=k&&t.left<=L){t.setCoords();const e="pain"===t.origin.type?O:G;t.top<e.originY&&t.set("top",e.originY),t.top>e.endY&&t.set("top",e.endY)}}(u),N(u)?f(u):m.show=!1})),u.on("mouseup:before",(t=>{if(m.show=!1,0===t.e.button&&N(u)){const t=X(u.left,"_type",M).includes(u.origin._type),e=Y(u.left);if(!e||t)t&&e&&C("repeat");else{const t={data:{time:w(u.left),value:S(u.origin.type,u.top),...r(u.origin.type)?{key:u.origin.key}:{}},...u.origin};d("add",t),b(t)}}!function(t){t.setCoords().set({originX:"right",left:t.originLeft,top:t.originTop})}(u)})),g.value.add(l,a)}))}();const P=E.yScaleValue.filter((t=>"left"===t.layout&&"pain"!==t.type&&t.show));if((null==_?void 0:_.width)&&"left"===(null==(x=null==_?void 0:_.yScaleValue)?void 0:x.layout)&&(null==(j=null==_?void 0:_.yScaleValue)?void 0:j.show)&&P.push($),R>0&&E.yScaleValue[R].show){const t=E.yScaleValue[R];0===R&&E.yScaleValue.length>1&&P.unshift(t),R==E.yScaleValue.length-1&&P.push(t)}const z=P.findIndex((t=>"pulse"===t.type&&t.show&&t.doubleShow)),F=P[z];return z>-1&&P.splice(z,0,{...F,title:(null==F?void 0:F.doubleTitle)||(null==F?void 0:F.title)}),D(P),g.value.add(new t.Rect({left:H,top:0,width:B-H-q.strokeWidth,height:J-q.strokeWidth,fill:"transparent",...q})),{drawScaleValue:D}}export{g as useLeft};
@@ -1,6 +1,9 @@
1
1
  import { Ref } from 'vue';
2
2
  import { fabric } from '../../../../../es/shared/utils/fabricjs';
3
- export declare function useCommon(canvas: Ref<fabric.Canvas>, emits: Function): {
3
+ import { IObject } from '../interface';
4
+ import { AnyObject } from '../../../../../es/shared/types';
5
+ export declare function useCommon(canvas: Ref<fabric.Canvas>, emits: Function, propItems: AnyObject): {
4
6
  getEqualXTypes: (pointX: number, field: string, range?: number) => string[];
5
7
  handleAddPrevent: (type: 'repeat' | 'exceedMax' | 'exceedMin') => void;
8
+ isGridLimit: (point: IObject) => boolean;
6
9
  };
@@ -1 +1 @@
1
- const e={repeat:"该时段已存在数值不能新增",exceedMax:"未来时间不允许录入",exceedMin:"不允许小于入院时间"};function n(n,t){return{getEqualXTypes:function(e,t,r=6){const i=[],o=r/2;return n.value.forEachObject((n=>{n.origin&&!n.origin.isMenu&&n.left>=e-o&&n.left<=e+o&&i.push(n.origin[t])})),[...new Set(i)]},handleAddPrevent:function(n){t("add:prevent",{type:n,message:e[n]})}}}export{n as useCommon};
1
+ const e={repeat:"该时段已存在数值不能新增",exceedMax:"未来时间不允许录入",exceedMin:"不允许小于入院时间"};function n(n,t,i){return{getEqualXTypes:function(e,t,i=6){const r=[],o=i/2;return n.value.forEachObject((n=>{n.origin&&!n.origin.isMenu&&n.left>=e-o&&n.left<=e+o&&r.push(n.origin[t])})),[...new Set(r)]},handleAddPrevent:function(n){t("add:prevent",{type:n,message:e[n]})},isGridLimit:function(e){const{left:n,top:t}=e,{originX:r,endX:o,originY:c,endY:u}=i;return n>=r&&n<=o&&t>=c&&t<=u}}}export{n as useCommon};
@@ -1,5 +1,6 @@
1
1
  import { fabric } from '../../../../../es/shared/utils/fabricjs';
2
2
  import { ILineOptions, ITextOptions } from '../interface';
3
+ import { AnyObject } from '../../../../../es/shared/types';
3
4
  export declare const defaultStyle: {
4
5
  evented: boolean;
5
6
  selectable: boolean;
@@ -48,3 +49,10 @@ export declare function drawText([x, y]: [x: number, y: number], style: ITextOpt
48
49
  export declare function drawArrow([x, y1, y2]: [x: number, y1: number, y2: number], style: ITextOptions | any, type?: string): fabric.Group;
49
50
  export declare function drawTextGroup(rectStyle: Partial<fabric.IRectOptions>, fontStyle: Partial<ITextOptions>, groupStyle: Partial<fabric.IGroupOptions>, showRect?: boolean): fabric.Group;
50
51
  export declare function drawPoint(type: string | undefined, style: any): fabric.Object;
52
+ export declare function drawTextAndIconGroup(title: string, item: AnyObject, option: {
53
+ text: AnyObject;
54
+ icon: AnyObject;
55
+ }, direction?: string): {
56
+ text: fabric.Text;
57
+ icon: fabric.Object;
58
+ };
@@ -1 +1 @@
1
- import{fabric as e}from"../../../../shared/utils/fabricjs/index.js";const t={evented:!1,selectable:!1},r={stroke:"#000",strokeWidth:1,strokeUniform:!0,...t},n={stroke:"#000",strokeWidth:1,strokeDashArray:[0,0],strokeUniform:!0,...t},i={fill:"transparent",stroke:"#000",strokeWidth:1,originX:"center",originY:"center",objectCaching:!1,strokeUniform:!0,...t},o={fontFamily:"微软雅黑",fontSize:12,fill:"#000",centeredRotation:!0,originX:"center",originY:"center",lineHeight:1,objectCaching:!1,strokeUniform:!0,...t};function c(t,r){return new e.Line(t,{...n,...r})}function s([t,r],n){return new e.Text(String(n.value),{...o,left:t,top:r,...n})}function a([r,n,i],o,a="down"){const l=c([r,n,r,i],{strokeWidth:1,stroke:o.fill}),g=s([r+.5,"up"===a?i-3:i+3],{value:"v",originX:"center",originY:"bottom",fontSize:16,angle:"up"===a?180:0,objectCaching:!1,...o});return new e.Group([l,g],{...t,originX:"center",originY:"top",objectCaching:!1})}function l(r,n,c,s=!1){const a=new e.Rect({...i,...r,...s?{}:{stroke:"transparent"}}),{value:l="标题",textAlign:g="center",verticalAlign:u="center"}=n,h=r.width/2,f=r.height/2,d=new e.Text(String(l),{...o,...n,..."left"==g||"right"==g?{originX:g,left:"left"==g?-h:h}:{},..."top"==u||"bottom"==u?{originY:u,top:"top"==u?-f:f}:{}});return new e.Group([a,d],{objectCaching:!1,...t,...c})}function g(t="circle",r){const n={originX:"center",originY:"center",hasControls:!1,hasBorders:!1,hoverCursor:"pointer",objectCaching:!1,...r},i=()=>new e.Circle({objectCaching:!1,strokeWidth:r.strokeWidth||1,stroke:r.stroke||"red",radius:r.radius||5,fill:"#fff"});switch(t){case"triangle":return new e.Triangle({width:20,height:20,strokeWidth:1,scale:1,...n});case"circle":return new e.Circle({objectCaching:!1,strokeWidth:1,radius:5,scale:1,...n});case"image":return new e.Image(r.element,{...n,scale:1});case"yemai":{const t=()=>{const t=2*((r.radius||5)+(r.strokeWidth||1)),n={stroke:r.strokeX||"blue",strokeWidth:r.strokeWidthX||1,originX:"center",originY:"center"},i=new e.Line([0,t/2,t,t/2],n),o=new e.Line([t/2,0,t/2,t],n);return new e.Group([i,o])};return new e.Group([i(),t()],{scale:1,...n})}case"koumai":{const t=(r.radius||5)+(r.strokeWidth||1),o=new e.Circle({objectCaching:!1,radius:r.radiusCircle||2,fill:r.fillCircle||"#000",originX:"center",originY:"center",left:t,top:t});return new e.Group([i(),o],{scale:1,...n})}default:return r&&Reflect.deleteProperty(r,"stroke"),new e.Text(String(t),{fontFamily:"微软雅黑",scale:1,fontSize:14,fill:"#000",...n})}}export{r as defaultBorderStyle,n as defaultLineStyle,i as defaultRectStyle,t as defaultStyle,o as defaultTextStyle,a as drawArrow,c as drawLine,g as drawPoint,s as drawText,l as drawTextGroup};
1
+ import{fabric as e}from"../../../../shared/utils/fabricjs/index.js";const t={evented:!1,selectable:!1},i={stroke:"#000",strokeWidth:1,strokeUniform:!0,...t},n={stroke:"#000",strokeWidth:1,strokeDashArray:[0,0],strokeUniform:!0,...t},r={fill:"transparent",stroke:"#000",strokeWidth:1,originX:"center",originY:"center",objectCaching:!1,strokeUniform:!0,...t},o={fontFamily:"微软雅黑",fontSize:12,fill:"#000",centeredRotation:!0,originX:"center",originY:"center",lineHeight:1,objectCaching:!1,strokeUniform:!0,...t};function c(t,i){return new e.Line(t,{...n,...i})}function l([t,i],n){return new e.Text(String(n.value),{...o,left:t,top:i,...n})}function s([i,n,r],o,s="down"){const a=c([i,n,i,r],{strokeWidth:1,stroke:o.fill}),g=l([i+.5,"up"===s?r-3:r+3],{value:"v",originX:"center",originY:"bottom",fontSize:16,angle:"up"===s?180:0,objectCaching:!1,...o});return new e.Group([a,g],{...t,originX:"center",originY:"top",objectCaching:!1})}function a(i,n,c,l=!1){const s=new e.Rect({...r,...i,...l?{}:{stroke:"transparent"}}),{value:a="标题",textAlign:g="center",verticalAlign:u="center"}=n,h=i.width/2,f=i.height/2,d=new e.Text(String(a),{...o,...n,..."left"==g||"right"==g?{originX:g,left:"left"==g?-h:h}:{},..."top"==u||"bottom"==u?{originY:u,top:"top"==u?-f:f}:{}});return new e.Group([s,d],{objectCaching:!1,...t,...c})}function g(t="circle",i){const n={originX:"center",originY:"center",hasControls:!1,hasBorders:!1,hoverCursor:"pointer",objectCaching:!1,...i},r=()=>new e.Circle({objectCaching:!1,strokeWidth:i.strokeWidth||1,stroke:i.stroke||"red",radius:i.radius||5,fill:"#fff"});switch(t){case"triangle":return new e.Triangle({width:20,height:20,strokeWidth:1,scale:1,...n});case"circle":return new e.Circle({objectCaching:!1,strokeWidth:1,radius:5,scale:1,...n});case"image":return new e.Image(i.element,{...n,scale:1});case"yemai":{const t=()=>{const t=2*((i.radius||5)+(i.strokeWidth||1)),n={stroke:i.strokeX||"blue",strokeWidth:i.strokeWidthX||1,originX:"center",originY:"center"},r=new e.Line([0,t/2,t,t/2],n),o=new e.Line([t/2,0,t/2,t],n);return new e.Group([r,o])};return new e.Group([r(),t()],{scale:1,...n})}case"koumai":{const t=(i.radius||5)+(i.strokeWidth||1),o=new e.Circle({objectCaching:!1,radius:i.radiusCircle||2,fill:i.fillCircle||"#000",originX:"center",originY:"center",left:t,top:t});return new e.Group([r(),o],{scale:1,...n})}default:return i&&Reflect.deleteProperty(i,"stroke"),new e.Text(String(t),{fontFamily:"微软雅黑",scale:1,fontSize:14,fill:"#000",...n})}}function u(i,n,r,o="horizontal"){const c=new e.Text(String(i),{...t,objectCaching:!1,...n.titleStyle||{},originX:"left",originY:"bottom",lineHeight:1,fontSize:12,...r.text}),{top:l,topY:s,left:a,leftX:u}=r.icon,h=null!=l?l:"horizontal"===o?s-(c.height||30)/2-1:s+c.height+3,f=null!=a?a:u+c.width+5;return{text:c,icon:g(n.type,{...n.pointAttr,originY:"center",originX:"left",originLeft:f,originTop:h,...r.icon,origin:{title:n.title,unit:n.unit,type:n.bigType,dataIndex:n.dataIndex,key:n.key,isMenu:!0,...r.icon.origin},left:f,top:h})}}export{i as defaultBorderStyle,n as defaultLineStyle,r as defaultRectStyle,t as defaultStyle,o as defaultTextStyle,s as drawArrow,c as drawLine,g as drawPoint,l as drawText,u as drawTextAndIconGroup,a as drawTextGroup};
@@ -1 +1 @@
1
- import{defineComponent as e,reactive as t,ref as a,watch as o,nextTick as l,openBlock as i,createElementBlock as n,normalizeClass as s,unref as r,createCommentVNode as u,Fragment as c,createBlock as p,mergeProps as d,createElementVNode as m,normalizeStyle as v,createVNode as f,withCtx as g,renderList as y,toDisplayString as b,createTextVNode as k,resolveDynamicComponent as C,h as S}from"vue";import w from"./hooks/use-noData.js";import{getScaleViewState as h}from"./hooks/scaleview-state.js";import{ScaleViewComputed as E}from"./hooks/scaleview-computed.js";import{ScaleViewInit as O}from"./hooks/scaleview-init.js";import{ScaleViewSubmit as A}from"./hooks/scaleview-submit.js";import{handleQueryParams as j,isCollection as _,isEvaluation as T}from"./utils/judge-types.js";import{useEvent as L}from"./hooks/use-event.js";import P from"./components/NoData.vue.js";import D from"./components/EvaluateCountdown.vue.js";import F from"./components/EvaluatePage.vue.js";import B from"./components/AnswerParse.vue.js";import N from"./components/ScaleScore.js";import{useDialog as x,useMessage as I,NForm as q,NFormItem as M,NButton as R}from"naive-ui";const K=["innerHTML"],V={key:0,class:"required-text"},H={key:1,class:"evalute-label"},U=["onClick"],W=m("i",{class:"scale-view-iconfont icon-scale-view-dengpao"},null,-1),J={key:1,class:"footer"};var Y=e({__name:"ScaleView",props:{guageData:{type:Object,default:()=>({})},styleSetting:{type:Object,default:()=>({})},ids:{type:Object,default:()=>({guage_id:"",db_id:void 0})},params:{default:()=>({}),type:Object},noBtn:{type:[Boolean,String,Number],default:!1},hideBtn:{type:[Boolean,String,Number],default:!1},isLock:{type:[Boolean,String,Number],default:!1},type:{type:String,default:""},openType:{type:String,default:""},scaleApiConfig:{type:Object,default:()=>({})},getSelectOptions:{type:Function,default:()=>Promise.resolve([])},getSearchOptions:{type:Function,default:()=>Promise.resolve([])},getCascadeOptions:{type:Function,default:()=>Promise.resolve([])},getLabelList:{type:Function,default:()=>Promise.resolve([])},deleteLabel:{type:Function,default:()=>Promise.resolve({status:!0})},saveLabelItem:{type:Function,default:()=>Promise.resolve({status:!0})},uploadPictureUrl:{type:String,default:""},uploadFileUrl:{type:String,default:""},ak:{type:String,default:"KP3BZ-OAC3W-PY6RY-OJ6DV-JYKN3-H6F72"},sourceType:{type:String,default:""},getChunkUploadConfig:{type:Function,default:()=>Promise.resolve({})},fontSizeObj:{type:Object,default:()=>({large:1.25,medium:1.1,small:1,extrasmall:.9})}},emits:["onCloseSetting","submitNoRequest","onSubmit","startWriteScale"],setup(e,{expose:Y,emit:X}){const z=e,{ScaleViewState:G}=h(),Q=t(G),Z=x(),$=I(),ee=a(null),te=a(null),{noDataState:ae,setNoData:oe,resetNodata:le}=w(),ie=j(),{showEvatip:ne,isFormBoldOpen:se,scaleStyle:re,handlePageClass:ue,isShowItem:ce,handleShowQuestionNumber:pe,hasScore:de,isPreviewScale:me,showEvaluateEntry:ve,showEvaluateCoundownPage:fe,showSaveBtn:ge,showEvaluateLabel:ye,showAnswerParse:be,propsConfig:ke,evaluatePageProps:Ce,evaluateCountdownProps:Se,skipCover:we,scaleEdit:he}=E(z,Q,{query:ie}),{initForm:Ee}=O(z,Q,X,{query:ie}),{submitMethod:Oe}=A(z,Q,X,{query:ie}),{nextLogicEvent:Ae,handleDynamicDataRelation:je}=L(z,Q);(()=>{let{id:e}=ie;e&&(Q.shareId=e)})();const _e=e=>{try{le(),Ee(e)}catch(e){console.log(e,"--error"),Q.spinning=!1,Q.hasFrontAddress=!1,oe(!0,null==e?void 0:e.resultMsg,null==e?void 0:e.result)}};o((()=>z.ids),((e,t)=>{t?e.guage_id&&e.guage_id!=t.guage_id&&_e(e):e.guage_id&&_e(e)}),{immediate:!0}),o((()=>z.guageData),(e=>{if(!e||!Object.keys(e||{}).length)return;Q.form={},Q.formArray=[];const t=JSON.parse(JSON.stringify(e));l((()=>{Ee(t)}))}),{immediate:!0});const Te=e=>{Q.showEvaluateSettingWrap=!1,Q.showEvaluateCountdown=!!e,X("startWriteScale")},Le=()=>{console.log("----closeEvaluateCountdown"),Q.showEvaluateCountdown=!1,me.value||(Q.banSubmit=!0,Oe(),Z.warning({title:"温馨提示",content:"测评时间到了,结束测评!",maskClosable:!1,positiveText:"确定",onPositiveClick:()=>({})}))},Pe=e=>{Z.warning({title:"提示",content:()=>S("div",{class:"evatip-container"},[S("span","答案解析:"),S("p",e)]),class:"c-evatip-dialog-wrap",showIcon:!1,positiveText:"确定",negativeText:"关闭",maskClosable:!1,onPositiveClick(){},onNegativeClick(){}})},De=(e,t,a)=>{let{choiceObj:o,isSetObj:l}=a||{};switch(t.type.includes("SELECT")||(Q.form[t.val_key]=e),t.type){case"SELECT":case"EVALUATE_SELECT":{let{value:a,list:o=[]}=e;Q.form[t.val_key]=a,Ae(e,t,Q.formArray),je(o,t,Q.formArray)}break;case"RADIO_BLOCK":case"CHECKBOX_BLOCK":l&&(Q.choiceComObj[t.val_key]=o),Ae(e,t,Q.formArray);break;case"EVALUATE_RADIO_BLOCK":case"EVALUATE_CHECKBOX_BLOCK":Ae(e,t,Q.formArray);break;case"DATE":case"TIME":case"DATETIME":case"SEARCH_CASCADE":Q.submitForm[t.val_key]=e}},Fe=(e,t)=>{console.log(t),Q.form[t.val_key]=e},Be=e=>{if(!e||!e.length)return{labelStr:"",labels:[]};const t=e||[],a=[],o=[];return t.forEach((e=>{o.push(e),a.push(e.labelName)})),Q.labelSelectedList=t,{labelStr:a.join(","),labels:o}},Ne=()=>{var e;if(!Q.formArray.find((e=>T(e.type))))return void xe("确认要提交吗?");let{evaluateResultSetting:t}=Q.config;if(!t||!Object.keys(t).length&&!ve.value||he.value)return void xe("确认要结束测评吗?");if("formIframe"==z.openType&&ve.value)return void X("submitNoRequest");let a="确定要提前结束测评吗?";if(fe.value&&(null==(e=ee.value)?void 0:e.getCountdownObj)){const e=ee.value.getCountdownObj(),{setAnswered:t,totalLen:o}=e;t<o?a="存在未作答的题目,确定要提前结束测评吗?":!(null==Q?void 0:Q.showEvaluateCountdown)&&(a="确认要结束测评吗?")}we.value&&!(null==Q?void 0:Q.showEvaluateCountdown)&&(a="确认要结束测评吗?"),xe(a)},xe=e=>{Z.warning({title:"温馨提示",content:()=>S("div",{style:{paddingLeft:"30px"}},e),positiveText:"确定",negativeText:"取消",maskClosable:!1,closable:!1,positiveButtonProps:{type:"primary"},onPositiveClick:async()=>{const e=await Ie();X("onSubmit",e)},onNegativeClick(){}})},Ie=()=>new Promise(((e,t)=>{var a;null==(a=te.value)||a.validate((t=>{var a;if(t){console.log(t);let o=(null==(a=t[0])?void 0:a[0])||{},l=o.field,i=o.message,n=Q.formArray.find((e=>e.databaseTitle===l));return n&&(l=n.title),$.error(l+i),e(!1),!1}{const t=Oe();e(t)}}))})),qe=()=>{X("onCloseSetting")};return Y({getScaleData:()=>({...Q}),onSubmitForm:Ie,cancel:qe}),(e,t)=>(i(),n("div",{class:s(["c-scale-view-block",{"c-scale-view-block-hasfooter":r(ge)}])},[u(' <template v-if="state.spinning">\n <n-spin :show="state.spinning" description="加载中"></n-spin>\n </template> '),Q.spinning||Q.hasFrontAddress?u("v-if",!0):(i(),n(c,{key:0},[r(ae).noData?(i(),p(P,{key:0,noDataImg:r(ae).noDataImg,noDataTip:r(ae).noDataTip},null,8,["noDataImg","noDataTip"])):(i(),n(c,{key:1},[r(ve)&&!r(we)?(i(),p(F,d({key:0},r(Ce),{onWriteGuage:Te}),null,16)):(i(),n(c,{key:1},[r(fe)?(i(),p(D,d({key:0,ref_key:"countdownDom",ref:ee},r(Se),{onCloseEvaluateCountdown:Le}),null,16)):u("v-if",!0),m("div",{class:s(["scale-container",{"scale-container-nopadding":r(ue),"scale-container-hasfooter":r(ge)}]),style:v(r(re))},[r(de)?(i(),p(r(N),{key:0,config:Q.config,maxScore:Q.maxScore},null,8,["config","maxScore"])):u("v-if",!0),f(r(q),{ref_key:"formRef",ref:te,model:Q.form,rules:Q.rules,"require-mark-placement":"left",class:"main"},{default:g((()=>[(i(!0),n(c,null,y(Q.formArray,((e,t)=>(i(),n(c,{key:(e.id||e.seq)+t},[r(ce)(e)?(i(),p(r(M),{key:0,path:e.val_key,"show-label":!r(_)(e.type),class:"c-scle-form-item"},{label:g((()=>[m("span",{class:s({"scale-label-required":r(se)(e)}),innerHTML:r(pe)(e)},null,10,K),r(se)(e)?(i(),n("span",V,"(必填)")):u("v-if",!0),r(ye)(e)?(i(),n("span",H,b(r(ye)(e)),1)):u("v-if",!0),r(ne)(e)?(i(),n("span",{key:2,class:"evalute-tip",onClick:t=>(async e=>{var t;if(Q.evatipMap[e.id])return void Pe(Q.evatipMap[e.id]);let a="getSubjectAnswer";const o=(null==(t=z.scaleApiConfig)?void 0:t[a])||null;if(!o||"function"!=typeof o)return void $.error(`${a} Is not a function`);let l=await o(e.id);l&&(Q.evatipMap[e.id]||(Q.evatipMap[e.id]=l,Pe(l)))})(e)},[W,k(" 查看提示 ")],8,U)):u("v-if",!0)])),default:g((()=>[(i(),p(C(e.renderCom),d(r(ke)(e,t),{key:(e.id||e.seq)+t,onScaleChange:De,onOnChange:t=>((e,t)=>{Q.form[t.val_key]=Be(e)})(t,e),onVodFileList:Fe}),null,16,["onOnChange"])),r(be)(e)?(i(),p(B,{key:0,item:e},null,8,["item"])):u("v-if",!0)])),_:2},1032,["path","show-label"])):u("v-if",!0)],64)))),128))])),_:1},8,["model","rules"])],6),r(ge)?(i(),n("div",J,[u(" 分享的链接 隐藏取消按钮 "),"guage"!==z.sourceType?(i(),p(r(R),{key:0,onClick:qe},{default:g((()=>[k("取消")])),_:1})):u("v-if",!0),z.isLock?u("v-if",!0):(i(),p(r(R),{key:1,onClick:Ne,disabled:Q.banSubmit,type:"primary"},{default:g((()=>[k(" 保存 ")])),_:1},8,["disabled"]))])):u("v-if",!0)],64))],64))],64))],2))}});export{Y as default};
1
+ import{defineComponent as e,reactive as t,ref as a,watch as o,nextTick as l,openBlock as i,createElementBlock as n,normalizeClass as s,unref as r,createCommentVNode as u,Fragment as c,createBlock as p,mergeProps as d,createElementVNode as m,normalizeStyle as v,createVNode as f,withCtx as g,renderList as y,toDisplayString as b,createTextVNode as k,resolveDynamicComponent as C,h as S}from"vue";import w from"./hooks/use-noData.js";import{getScaleViewState as h}from"./hooks/scaleview-state.js";import{ScaleViewComputed as E}from"./hooks/scaleview-computed.js";import{ScaleViewInit as O}from"./hooks/scaleview-init.js";import{ScaleViewSubmit as A}from"./hooks/scaleview-submit.js";import{handleQueryParams as j,isCollection as _,isEvaluation as T}from"./utils/judge-types.js";import{useEvent as L}from"./hooks/use-event.js";import P from"./components/NoData.vue.js";import D from"./components/EvaluateCountdown.vue.js";import F from"./components/EvaluatePage.vue.js";import B from"./components/AnswerParse.vue.js";import N from"./components/ScaleScore.js";import{useDialog as x,useMessage as I,NForm as q,NFormItem as M,NButton as R}from"naive-ui";const K=["innerHTML"],V={key:0,class:"required-text"},H={key:1,class:"evalute-label"},U=["onClick"],W=m("i",{class:"scale-view-iconfont icon-scale-view-dengpao"},null,-1),J={key:1,class:"footer"};var Y=e({__name:"ScaleView",props:{guageData:{type:Object,default:()=>({})},styleSetting:{type:Object,default:()=>({})},ids:{type:Object,default:()=>({guage_id:"",db_id:void 0})},params:{default:()=>({}),type:Object},noBtn:{type:[Boolean,String,Number],default:!1},hideBtn:{type:[Boolean,String,Number],default:!1},isLock:{type:[Boolean,String,Number],default:!1},type:{type:String,default:""},openType:{type:String,default:""},scaleApiConfig:{type:Object,default:()=>({})},getSelectOptions:{type:Function,default:()=>Promise.resolve([])},getSearchOptions:{type:Function,default:()=>Promise.resolve([])},getCascadeOptions:{type:Function,default:()=>Promise.resolve([])},getLabelList:{type:Function,default:()=>Promise.resolve([])},deleteLabel:{type:Function,default:()=>Promise.resolve({status:!0})},saveLabelItem:{type:Function,default:()=>Promise.resolve({status:!0})},uploadPictureUrl:{type:String,default:""},uploadFileUrl:{type:String,default:""},ak:{type:String,default:"KP3BZ-OAC3W-PY6RY-OJ6DV-JYKN3-H6F72"},sourceType:{type:String,default:""},getChunkUploadConfig:{type:Function,default:()=>Promise.resolve({})},fontSizeObj:{type:Object,default:()=>({large:1.25,medium:1.1,small:1,extrasmall:.9})}},emits:["onCloseSetting","submitNoRequest","onSubmit","startWriteScale"],setup(e,{expose:Y,emit:X}){const z=e,{ScaleViewState:G}=h(),Q=t(G),Z=x(),$=I(),ee=a(null),te=a(null),{noDataState:ae,setNoData:oe,resetNodata:le}=w(),ie=j(),{showEvatip:ne,isFormBoldOpen:se,scaleStyle:re,handlePageClass:ue,isShowItem:ce,handleShowQuestionNumber:pe,hasScore:de,isPreviewScale:me,showEvaluateEntry:ve,showEvaluateCoundownPage:fe,showSaveBtn:ge,showEvaluateLabel:ye,showAnswerParse:be,propsConfig:ke,evaluatePageProps:Ce,evaluateCountdownProps:Se,skipCover:we,scaleEdit:he}=E(z,Q,{query:ie}),{initForm:Ee}=O(z,Q,X,{query:ie}),{submitMethod:Oe}=A(z,Q,X,{query:ie}),{nextLogicEvent:Ae,handleDynamicDataRelation:je}=L(z,Q);(()=>{let{id:e}=ie;e&&(Q.shareId=e)})();const _e=e=>{try{le(),Ee(e)}catch(e){console.log(e,"--error"),Q.spinning=!1,Q.hasFrontAddress=!1,oe(!0,null==e?void 0:e.resultMsg,null==e?void 0:e.result)}};o((()=>z.ids),((e,t)=>{t?e.guage_id&&e.guage_id!=t.guage_id&&_e(e):e.guage_id&&_e(e)}),{immediate:!0}),o((()=>z.guageData),(e=>{if(!e||!Object.keys(e||{}).length)return;Q.form={},Q.formArray=[];const t=JSON.parse(JSON.stringify(e));l((()=>{Ee(t)}))}),{immediate:!0});const Te=e=>{Q.showEvaluateSettingWrap=!1,Q.showEvaluateCountdown=!!e,X("startWriteScale")},Le=()=>{console.log("----closeEvaluateCountdown"),Q.showEvaluateCountdown=!1,me.value||(Q.banSubmit=!0,Oe(),Z.warning({title:"温馨提示",content:"测评时间到了,结束测评!",maskClosable:!1,positiveText:"确定",onPositiveClick:()=>({})}))},Pe=e=>{Z.warning({title:"提示",content:()=>S("div",{class:"evatip-container"},[S("span","答案解析:"),S("p",e)]),class:"c-evatip-dialog-wrap",showIcon:!1,positiveText:"确定",negativeText:"关闭",maskClosable:!1,onPositiveClick(){},onNegativeClick(){}})},De=(e,t,a)=>{let{choiceObj:o,isSetObj:l}=a||{};switch(t.type.includes("SELECT")||(Q.form[t.val_key]=e),t.type){case"SELECT":case"EVALUATE_SELECT":{let{value:a,list:o=[]}=e;Q.form[t.val_key]=a,Ae(e,t,Q.formArray),je(o,t,Q.formArray)}break;case"RADIO_BLOCK":case"CHECKBOX_BLOCK":l&&(Q.choiceComObj[t.val_key]=o),Ae(e,t,Q.formArray);break;case"EVALUATE_RADIO_BLOCK":case"EVALUATE_CHECKBOX_BLOCK":Ae(e,t,Q.formArray);break;case"DATE":case"TIME":case"DATETIME":case"SEARCH_CASCADE":Q.submitForm[t.val_key]=e}},Fe=(e,t)=>{console.log(t),Q.form[t.val_key]=e},Be=e=>{if(!e||!e.length)return{labelStr:"",labels:[]};const t=e||[],a=[],o=[];return t.forEach((e=>{o.push(e),a.push(e.labelName)})),Q.labelSelectedList=t,{labelStr:a.join(","),labels:o}},Ne=()=>{var e;if(!Q.formArray.find((e=>T(e.type))))return void xe("确认要提交吗?");let{evaluateResultSetting:t}=Q.config;if(!t||!Object.keys(t).length&&!ve.value||he.value)return void xe("确认要结束测评吗?");if("formIframe"==z.openType&&ve.value)return void X("submitNoRequest");let a="确定要提前结束测评吗?";if(fe.value&&(null==(e=ee.value)?void 0:e.getCountdownObj)){const e=ee.value.getCountdownObj(),{setAnswered:t,totalLen:o}=e;t<o?a="存在未作答的题目,确定要提前结束测评吗?":!(null==Q?void 0:Q.showEvaluateCountdown)&&(a="确认要结束测评吗?")}we.value&&!(null==Q?void 0:Q.showEvaluateCountdown)&&(a="确认要结束测评吗?"),xe(a)},xe=e=>{Z.warning({title:"温馨提示",content:()=>S("div",{style:{paddingLeft:"30px"}},e),positiveText:"确定",negativeText:"取消",maskClosable:!1,closable:!1,positiveButtonProps:{type:"primary"},onPositiveClick:async()=>{const e=await Ie();X("onSubmit",e)},onNegativeClick(){}})},Ie=()=>new Promise(((e,t)=>{var a;null==(a=te.value)||a.validate((t=>{var a;if(t){console.log(t);let o=(null==(a=t[0])?void 0:a[0])||{},l=o.field,i=o.message,n=Q.formArray.find((e=>e.databaseTitle===l));return n&&(l=n.title),$.error(l+i),e(!1),!1}{const t=Oe();e(t)}}))})),qe=()=>{X("onCloseSetting")};return Y({getScaleData:()=>({...Q}),onSubmitForm:Ie,cancel:qe}),(e,t)=>(i(),n("div",{class:s(["c-scale-view-block",{"c-scale-view-block-hasfooter":r(ge)}])},[u(' <template v-if="state.spinning">\r\n <n-spin :show="state.spinning" description="加载中"></n-spin>\r\n </template> '),Q.spinning||Q.hasFrontAddress?u("v-if",!0):(i(),n(c,{key:0},[r(ae).noData?(i(),p(P,{key:0,noDataImg:r(ae).noDataImg,noDataTip:r(ae).noDataTip},null,8,["noDataImg","noDataTip"])):(i(),n(c,{key:1},[r(ve)&&!r(we)?(i(),p(F,d({key:0},r(Ce),{onWriteGuage:Te}),null,16)):(i(),n(c,{key:1},[r(fe)?(i(),p(D,d({key:0,ref_key:"countdownDom",ref:ee},r(Se),{onCloseEvaluateCountdown:Le}),null,16)):u("v-if",!0),m("div",{class:s(["scale-container",{"scale-container-nopadding":r(ue),"scale-container-hasfooter":r(ge)}]),style:v(r(re))},[r(de)?(i(),p(r(N),{key:0,config:Q.config,maxScore:Q.maxScore},null,8,["config","maxScore"])):u("v-if",!0),f(r(q),{ref_key:"formRef",ref:te,model:Q.form,rules:Q.rules,"require-mark-placement":"left",class:"main"},{default:g((()=>[(i(!0),n(c,null,y(Q.formArray,((e,t)=>(i(),n(c,{key:(e.id||e.seq)+t},[r(ce)(e)?(i(),p(r(M),{key:0,path:e.val_key,"show-label":!r(_)(e.type),class:"c-scle-form-item"},{label:g((()=>[m("span",{class:s({"scale-label-required":r(se)(e)}),innerHTML:r(pe)(e)},null,10,K),r(se)(e)?(i(),n("span",V,"(必填)")):u("v-if",!0),r(ye)(e)?(i(),n("span",H,b(r(ye)(e)),1)):u("v-if",!0),r(ne)(e)?(i(),n("span",{key:2,class:"evalute-tip",onClick:t=>(async e=>{var t;if(Q.evatipMap[e.id])return void Pe(Q.evatipMap[e.id]);let a="getSubjectAnswer";const o=(null==(t=z.scaleApiConfig)?void 0:t[a])||null;if(!o||"function"!=typeof o)return void $.error(`${a} Is not a function`);let l=await o(e.id);l&&(Q.evatipMap[e.id]||(Q.evatipMap[e.id]=l,Pe(l)))})(e)},[W,k(" 查看提示 ")],8,U)):u("v-if",!0)])),default:g((()=>[(i(),p(C(e.renderCom),d(r(ke)(e,t),{key:(e.id||e.seq)+t,onScaleChange:De,onOnChange:t=>((e,t)=>{Q.form[t.val_key]=Be(e)})(t,e),onVodFileList:Fe}),null,16,["onOnChange"])),r(be)(e)?(i(),p(B,{key:0,item:e},null,8,["item"])):u("v-if",!0)])),_:2},1032,["path","show-label"])):u("v-if",!0)],64)))),128))])),_:1},8,["model","rules"])],6),r(ge)?(i(),n("div",J,[u(" 分享的链接 隐藏取消按钮 "),"guage"!==z.sourceType?(i(),p(r(R),{key:0,onClick:qe},{default:g((()=>[k("取消")])),_:1})):u("v-if",!0),z.isLock?u("v-if",!0):(i(),p(r(R),{key:1,onClick:Ne,disabled:Q.banSubmit,type:"primary"},{default:g((()=>[k(" 保存 ")])),_:1},8,["disabled"]))])):u("v-if",!0)],64))],64))],64))],2))}});export{Y as default};
@@ -1 +1 @@
1
- import{defineComponent as t,ref as e,reactive as l,computed as a,watch as i,openBlock as n,createElementBlock as s,unref as d,createCommentVNode as o,withDirectives as r,createElementVNode as c,normalizeClass as b,createVNode as u,withCtx as p,Fragment as f,renderList as h,createBlock as y,createTextVNode as v,toDisplayString as m,vShow as g,nextTick as C}from"vue";import{useMessage as L,NAnchor as I,NAnchorLink as S}from"naive-ui";import E from"./components/label-classify.vue.js";import{handleLabelColor as w}from"../../../shared/utils/vexutils.js";import x from"../../../shared/utils/vexutilsExpand.js";const A={key:0,class:"label-disable-wrap"},O=[c("p",{class:"label-disable-title"},"无可选标签",-1),c("p",{class:"label-disable-desc"},"请联系管理员进行标签管理设置",-1)],K={style:{height:"100%"}},j={class:"label-wrap"},k=["id"],T={class:"edit-label-type"};var B=t({__name:"LabelFormContent",props:{item:{default:()=>({})},isEdit:{type:Boolean,default:!0},isLock:{type:Boolean,default:!1},labelSelectedList:null,isChangeWindow:{type:Boolean},getLabelList:{type:Function,default:()=>Promise.resolve({rows:[]})},deleteLabel:{type:Function,default:()=>Promise.resolve({status:!0})},saveLabelItem:{type:Function,default:()=>Promise.resolve({status:!0})},labelOptions:null,sourceType:{default:""},explicit:{type:Boolean,default:!1}},emits:["explicitOnChange","change","updateLabelData"],setup(t,{expose:B,emit:D}){const V=t,F=L(),P=e(null),_=l({editLabelItem:{},inited:!1,labelSelectedEdit:[],labelAnchorKey:"",cacheAnchorKey:"",labelConfig:{}});let N=e(0);const W=a((()=>{if(!_.inited)return!1;let t=_.labelConfig;return!t||Object.keys(t).every((e=>!t[e].itemList))})),$=a((()=>{let t=[].concat(..._.labelSelectedEdit,...V.labelSelectedList);return J(t,"labelId")})),q=a((()=>{const t=$.value||[];return Array.isArray(t)?t.map((t=>t.labelId)):[]})),J=(t,e)=>{let l={};return t.reduce(((t,a)=>(!l[a[e]]&&(l[a[e]]=t.push(a)),t)),[])},R=()=>{if(_.labelSelectedEdit=$.value,"object"==typeof _.labelConfig){Object.keys(_.labelConfig||{}).forEach((t=>{var e;let l=(null==(e=_.labelConfig[t])?void 0:e.itemList)||[];l.length&&l.forEach((t=>{q.value.includes(t.labelId)&&(t.isSelect=!0)}))}))}},z=(t,e)=>{if(!t)return;let l=Object.keys(t)||[];if(!l.length)return;let a=t[l[0]].curKey;if(e&&"string"==typeof e){let[i]=e.split("~"),n=l.find((e=>t[e]&&t[e].curKey&&t[e].curKey.includes(i)));n&&(a=t[n].curKey)}a&&Y(a)},G=(t,e)=>{e.showAdd=!0;const l=t.target.nextElementSibling;C((()=>{var t;null==(t=null==l?void 0:l.firstChild)||t.focus()}))},H=(t,e)=>{setTimeout((()=>{e.addVal?Q(e):e.showAdd=!1}),150)},M=(t,e)=>{e.addVal="",e.showAdd=!1},Q=async t=>{var e;if(!!t.itemList.filter((t=>!(t.isPublic&&1==t.isPublic))).find((e=>e.labelName===t.addVal)))return F.error("标签名称重复!"),!1;let l="";l=(null==(e=t.itemList)?void 0:e.length)?t.itemList[0].parentColor||t.parentColor||"":(null==t?void 0:t.parentColor)||"";const a={type:t.typeId,name:t.addVal,parentColor:l},{status:i}=await V.saveLabelItem(a,t);i&&(F.success("添加成功!"),D("updateLabelData"),t.showAdd=!1)},U=(t,e,l,a)=>{var i;const n=l.itemList,s=l.multipleChoice;let d=(null==(i=_.labelSelectedEdit)?void 0:i.length)&&x.clone(_.labelSelectedEdit,!0)||[];if(t){if(d.some((t=>t.labelId==e.labelId)))return;if(2==s){const{typeId:t,labelId:l}=e;d=d.filter((e=>e.typeId!==t)),n.forEach((t=>{t.labelId!==l&&(t.isSelect=!1)}))}d.push(e)}else{const t=d.findIndex((t=>t.labelId==e.labelId));-1!=t&&d.splice(t,1)}_.labelSelectedEdit=[...d],N.value++,V.explicit&&D("explicitOnChange",[..._.labelSelectedEdit])},X=async t=>{const{status:e}=await V.deleteLabel(t,V.item);if(e){F.success("删除成功!");for(const e in _.labelConfig){const l=_.labelConfig[e].itemList.findIndex((e=>e.labelId==t.labelId));-1!=l&&_.labelConfig[e].itemList.splice(l,1)}const e=_.labelSelectedEdit||[],l=V.labelSelectedList||[];if(e&&e.length){const l=e.findIndex((e=>e.labelId==t.labelId));-1!=l&&e.splice(l,1)}if(l&&l.length){const e=l.findIndex((e=>e.labelId==t.labelId));-1!=e&&l.splice(e,1),D("change",[...l],V.item)}D("updateLabelData")}else F.warning("删除失败")},Y=t=>{t&&setTimeout((()=>{let e,l="#"+t;e=P.value.querySelector("a[href='"+l+"']"),e&&e.click(),_.labelAnchorKey=t}),32)},Z=t=>{t.preventDefault()},tt=t=>{if(!t)return;let e=t.slice(1);_.cacheAnchorKey=e},et=()=>{var t;return null==(t=P.value)?void 0:t.querySelector(".right-label-wrap")};return i((()=>V.labelOptions),(t=>{t&&(()=>{var t;if(V.isLock)return;const e=JSON.parse(JSON.stringify(V.labelOptions));for(let l in e){let a=(null==(t=e[l])?void 0:t.typeId)||"";Object.assign(e[l],{curKey:`${l}_${a}}`})}_.labelConfig=e,C((()=>{let t;R(),V.explicit&&_.inited&&(t=_.labelAnchorKey),z(_.labelConfig,t),_.inited=!0}))})()}),{immediate:!0,deep:!0}),B({resetShowAdd:()=>{let{labelObj:t}=_.editLabelItem;if(t&&Object.keys(t).length)for(let e in t){let l=t[e];Object.assign(l,{showAdd:!1})}},handleLabelForm:t=>{t([..._.labelSelectedEdit||[]])},handleResetOptions:()=>{},hanldeSetLabelItem:(t,e)=>{if("object"==typeof _.labelConfig){Object.keys(_.labelConfig||{}).forEach((l=>{var a;let i=(null==(a=_.labelConfig[l])?void 0:a.itemList)||[];i.length&&i.forEach((l=>{t==l.labelId&&(l.isSelect=e)}))}))}if(!1===e&&Array.isArray(_.labelSelectedEdit)){const e=_.labelSelectedEdit.findIndex((e=>e.labelId==t));-1!=e&&_.labelSelectedEdit.splice(e,1)}}}),(e,l)=>(n(),s("div",{class:"c-label-form-content",ref_key:"labelFormContent",ref:P},[d(W)?(n(),s("div",A,O)):o("v-if",!0),r(c("div",K,[c("div",j,[o(" 表单内嵌打开标签组件的样式 "),o(' <div v-if="explicit" class="explicit-continer">\n\t\t\t\t\t<n-tabs :value="state.labelAnchorKey" type="card" @change="labelAnchorTabsOnChange" tab-position="top">\n\t\t\t\t\t\t<template v-for="(v, i) in state.labelConfig">\n\t\t\t\t\t\t\t<n-tab-pane :name="v.curKey">\n\t\t\t\t\t\t\t\t<span slot="tab">\n\t\t\t\t\t\t\t\t\t{{ i }}\n\t\t\t\t\t\t\t\t\t<span class="edit-label-type">({{ v.multipleChoice == 2 ? \'单\' : \'多\' }}选)</span>\n\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t<div class="explicit-label-wrap left-label-wrap">\n\t\t\t\t\t\t\t\t\t<div class="edit-label-content">\n\t\t\t\t\t\t\t\t\t\t<labelClassify\n\t\t\t\t\t\t\t\t\t\t\t:classifyItem="v"\n\t\t\t\t\t\t\t\t\t\t\t:handleLabelChange="handleLabelChange"\n\t\t\t\t\t\t\t\t\t\t\t:handleLabelColor="handleLabelColor"\n\t\t\t\t\t\t\t\t\t\t\t:handleDelLabel="handleDelLabel"\n\t\t\t\t\t\t\t\t\t\t\t:hanldeBlur="hanldeBlur"\n\t\t\t\t\t\t\t\t\t\t\t:handleAddLabel="handleAddLabel"\n\t\t\t\t\t\t\t\t\t\t\t:clearaddVal="clearaddVal"\n\t\t\t\t\t\t\t\t\t\t\t:isEdit="isEdit"\n\t\t\t\t\t\t\t\t\t\t\t:sourceType="sourceType"\n\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</n-tab-pane>\n\t\t\t\t\t\t</template>\n\t\t\t\t\t</n-tabs>\n\t\t\t\t</div> '),o("\n\t\t\t\t\t普通标签样式\n\t\t\t\t\tv-else\n\t\t\t\t\texplicit\n\t\t\t\t "),c("div",{class:b(["left-label-wrap",{"total-left-label-wrap":t.isChangeWindow}])},[u(d(I),{"offset-target":et,type:"block",onClick:Z,onChange:tt},{default:p((()=>[(n(!0),s(f,null,h(_.labelConfig,((t,e)=>(n(),y(d(S),{href:`#${t.curKey}`,title:String(e)},null,8,["href","title"])))),256))])),_:1})],2),o(' v-if="!explicit" '),c("div",{class:b(["right-label-wrap",{"total-right-label-wrap":t.isChangeWindow}])},[(n(!0),s(f,null,h(_.labelConfig,((e,l)=>(n(),s("div",{key:l,class:"edit-label-content"},[c("div",{class:"edit-label",id:e.curKey},[v(m(l)+" ",1),c("span",T,"("+m(2==e.multipleChoice?"单":"多")+"选)",1)],8,k),u(E,{classifyItem:e,handleLabelChange:U,handleLabelColor:d(w),handleDelLabel:X,hanldeBlur:H,handleAddLabel:G,clearaddVal:M,isEdit:t.isEdit,sourceType:t.sourceType},null,8,["classifyItem","handleLabelColor","isEdit","sourceType"])])))),128))],2)])],512),[[g,!d(W)]])],512))}});export{B as default};
1
+ import{defineComponent as t,ref as e,reactive as l,computed as a,watch as i,openBlock as n,createElementBlock as s,unref as r,createCommentVNode as d,withDirectives as o,createElementVNode as c,normalizeClass as b,createVNode as u,withCtx as p,Fragment as f,renderList as h,createBlock as y,createTextVNode as v,toDisplayString as m,vShow as g,nextTick as C}from"vue";import{useMessage as L,NAnchor as I,NAnchorLink as S}from"naive-ui";import E from"./components/label-classify.vue.js";import{handleLabelColor as w}from"../../../shared/utils/vexutils.js";import x from"../../../shared/utils/vexutilsExpand.js";const A={key:0,class:"label-disable-wrap"},O=[c("p",{class:"label-disable-title"},"无可选标签",-1),c("p",{class:"label-disable-desc"},"请联系管理员进行标签管理设置",-1)],K={style:{height:"100%"}},j={class:"label-wrap"},k=["id"],T={class:"edit-label-type"};var B=t({__name:"LabelFormContent",props:{item:{default:()=>({})},isEdit:{type:Boolean,default:!0},isLock:{type:Boolean,default:!1},labelSelectedList:null,isChangeWindow:{type:Boolean},getLabelList:{type:Function,default:()=>Promise.resolve({rows:[]})},deleteLabel:{type:Function,default:()=>Promise.resolve({status:!0})},saveLabelItem:{type:Function,default:()=>Promise.resolve({status:!0})},labelOptions:null,sourceType:{default:""},explicit:{type:Boolean,default:!1}},emits:["explicitOnChange","change","updateLabelData"],setup(t,{expose:B,emit:D}){const V=t,F=L(),P=e(null),_=l({editLabelItem:{},inited:!1,labelSelectedEdit:[],labelAnchorKey:"",cacheAnchorKey:"",labelConfig:{}});let N=e(0);const W=a((()=>{if(!_.inited)return!1;let t=_.labelConfig;return!t||Object.keys(t).every((e=>!t[e].itemList))})),$=a((()=>{let t=[].concat(..._.labelSelectedEdit,...V.labelSelectedList);return J(t,"labelId")})),q=a((()=>{const t=$.value||[];return Array.isArray(t)?t.map((t=>t.labelId)):[]})),J=(t,e)=>{let l={};return t.reduce(((t,a)=>(!l[a[e]]&&(l[a[e]]=t.push(a)),t)),[])},R=()=>{if(_.labelSelectedEdit=$.value,"object"==typeof _.labelConfig){Object.keys(_.labelConfig||{}).forEach((t=>{var e;let l=(null==(e=_.labelConfig[t])?void 0:e.itemList)||[];l.length&&l.forEach((t=>{q.value.includes(t.labelId)&&(t.isSelect=!0)}))}))}},z=(t,e)=>{if(!t)return;let l=Object.keys(t)||[];if(!l.length)return;let a=t[l[0]].curKey;if(e&&"string"==typeof e){let[i]=e.split("~"),n=l.find((e=>t[e]&&t[e].curKey&&t[e].curKey.includes(i)));n&&(a=t[n].curKey)}a&&Y(a)},G=(t,e)=>{e.showAdd=!0;const l=t.target.nextElementSibling;C((()=>{var t;null==(t=null==l?void 0:l.firstChild)||t.focus()}))},H=(t,e)=>{setTimeout((()=>{e.addVal?Q(e):e.showAdd=!1}),150)},M=(t,e)=>{e.addVal="",e.showAdd=!1},Q=async t=>{var e;if(!!t.itemList.filter((t=>!(t.isPublic&&1==t.isPublic))).find((e=>e.labelName===t.addVal)))return F.error("标签名称重复!"),!1;let l="";l=(null==(e=t.itemList)?void 0:e.length)?t.itemList[0].parentColor||t.parentColor||"":(null==t?void 0:t.parentColor)||"";const a={type:t.typeId,name:t.addVal,parentColor:l},{status:i}=await V.saveLabelItem(a,t);i&&(F.success("添加成功!"),D("updateLabelData"),t.showAdd=!1)},U=(t,e,l,a)=>{var i;const n=l.itemList,s=l.multipleChoice;let r=(null==(i=_.labelSelectedEdit)?void 0:i.length)&&x.clone(_.labelSelectedEdit,!0)||[];if(t){if(r.some((t=>t.labelId==e.labelId)))return;if(2==s){const{typeId:t,labelId:l}=e;r=r.filter((e=>e.typeId!==t)),n.forEach((t=>{t.labelId!==l&&(t.isSelect=!1)}))}r.push(e)}else{const t=r.findIndex((t=>t.labelId==e.labelId));-1!=t&&r.splice(t,1)}_.labelSelectedEdit=[...r],N.value++,V.explicit&&D("explicitOnChange",[..._.labelSelectedEdit])},X=async t=>{const{status:e}=await V.deleteLabel(t,V.item);if(e){F.success("删除成功!");for(const e in _.labelConfig){const l=_.labelConfig[e].itemList.findIndex((e=>e.labelId==t.labelId));-1!=l&&_.labelConfig[e].itemList.splice(l,1)}const e=_.labelSelectedEdit||[],l=V.labelSelectedList||[];if(e&&e.length){const l=e.findIndex((e=>e.labelId==t.labelId));-1!=l&&e.splice(l,1)}if(l&&l.length){const e=l.findIndex((e=>e.labelId==t.labelId));-1!=e&&l.splice(e,1),D("change",[...l],V.item)}D("updateLabelData")}else F.warning("删除失败")},Y=t=>{t&&setTimeout((()=>{let e,l="#"+t;e=P.value.querySelector("a[href='"+l+"']"),e&&e.click(),_.labelAnchorKey=t}),32)},Z=t=>{t.preventDefault()},tt=t=>{if(!t)return;let e=t.slice(1);_.cacheAnchorKey=e},et=()=>{var t;return null==(t=P.value)?void 0:t.querySelector(".right-label-wrap")};return i((()=>V.labelOptions),(t=>{t&&(()=>{var t;if(V.isLock)return;const e=JSON.parse(JSON.stringify(V.labelOptions));for(let l in e){let a=(null==(t=e[l])?void 0:t.typeId)||"";Object.assign(e[l],{curKey:`${l}_${a}}`})}_.labelConfig=e,C((()=>{let t;R(),V.explicit&&_.inited&&(t=_.labelAnchorKey),z(_.labelConfig,t),_.inited=!0}))})()}),{immediate:!0,deep:!0}),B({resetShowAdd:()=>{let{labelObj:t}=_.editLabelItem;if(t&&Object.keys(t).length)for(let e in t){let l=t[e];Object.assign(l,{showAdd:!1})}},handleLabelForm:t=>{t([..._.labelSelectedEdit||[]])},handleResetOptions:()=>{},hanldeSetLabelItem:(t,e)=>{if("object"==typeof _.labelConfig){Object.keys(_.labelConfig||{}).forEach((l=>{var a;let i=(null==(a=_.labelConfig[l])?void 0:a.itemList)||[];i.length&&i.forEach((l=>{t==l.labelId&&(l.isSelect=e)}))}))}if(!1===e&&Array.isArray(_.labelSelectedEdit)){const e=_.labelSelectedEdit.findIndex((e=>e.labelId==t));-1!=e&&_.labelSelectedEdit.splice(e,1)}}}),(e,l)=>(n(),s("div",{class:"c-label-form-content",ref_key:"labelFormContent",ref:P},[r(W)?(n(),s("div",A,O)):d("v-if",!0),o(c("div",K,[c("div",j,[d(" 表单内嵌打开标签组件的样式 "),d(' <div v-if="explicit" class="explicit-continer">\r\n\t\t\t\t\t<n-tabs :value="state.labelAnchorKey" type="card" @change="labelAnchorTabsOnChange" tab-position="top">\r\n\t\t\t\t\t\t<template v-for="(v, i) in state.labelConfig">\r\n\t\t\t\t\t\t\t<n-tab-pane :name="v.curKey">\r\n\t\t\t\t\t\t\t\t<span slot="tab">\r\n\t\t\t\t\t\t\t\t\t{{ i }}\r\n\t\t\t\t\t\t\t\t\t<span class="edit-label-type">({{ v.multipleChoice == 2 ? \'单\' : \'多\' }}选)</span>\r\n\t\t\t\t\t\t\t\t</span>\r\n\t\t\t\t\t\t\t\t<div class="explicit-label-wrap left-label-wrap">\r\n\t\t\t\t\t\t\t\t\t<div class="edit-label-content">\r\n\t\t\t\t\t\t\t\t\t\t<labelClassify\r\n\t\t\t\t\t\t\t\t\t\t\t:classifyItem="v"\r\n\t\t\t\t\t\t\t\t\t\t\t:handleLabelChange="handleLabelChange"\r\n\t\t\t\t\t\t\t\t\t\t\t:handleLabelColor="handleLabelColor"\r\n\t\t\t\t\t\t\t\t\t\t\t:handleDelLabel="handleDelLabel"\r\n\t\t\t\t\t\t\t\t\t\t\t:hanldeBlur="hanldeBlur"\r\n\t\t\t\t\t\t\t\t\t\t\t:handleAddLabel="handleAddLabel"\r\n\t\t\t\t\t\t\t\t\t\t\t:clearaddVal="clearaddVal"\r\n\t\t\t\t\t\t\t\t\t\t\t:isEdit="isEdit"\r\n\t\t\t\t\t\t\t\t\t\t\t:sourceType="sourceType"\r\n\t\t\t\t\t\t\t\t\t\t/>\r\n\t\t\t\t\t\t\t\t\t</div>\r\n\t\t\t\t\t\t\t\t</div>\r\n\t\t\t\t\t\t\t</n-tab-pane>\r\n\t\t\t\t\t\t</template>\r\n\t\t\t\t\t</n-tabs>\r\n\t\t\t\t</div> '),d("\r\n\t\t\t\t\t普通标签样式\r\n\t\t\t\t\tv-else\r\n\t\t\t\t\texplicit\r\n\t\t\t\t "),c("div",{class:b(["left-label-wrap",{"total-left-label-wrap":t.isChangeWindow}])},[u(r(I),{"offset-target":et,type:"block",onClick:Z,onChange:tt},{default:p((()=>[(n(!0),s(f,null,h(_.labelConfig,((t,e)=>(n(),y(r(S),{href:`#${t.curKey}`,title:String(e)},null,8,["href","title"])))),256))])),_:1})],2),d(' v-if="!explicit" '),c("div",{class:b(["right-label-wrap",{"total-right-label-wrap":t.isChangeWindow}])},[(n(!0),s(f,null,h(_.labelConfig,((e,l)=>(n(),s("div",{key:l,class:"edit-label-content"},[c("div",{class:"edit-label",id:e.curKey},[v(m(l)+" ",1),c("span",T,"("+m(2==e.multipleChoice?"单":"多")+"选)",1)],8,k),u(E,{classifyItem:e,handleLabelChange:U,handleLabelColor:r(w),handleDelLabel:X,hanldeBlur:H,handleAddLabel:G,clearaddVal:M,isEdit:t.isEdit,sourceType:t.sourceType},null,8,["classifyItem","handleLabelColor","isEdit","sourceType"])])))),128))],2)])],512),[[g,!r(W)]])],512))}});export{B as default};