cnhis-design-vue 3.1.48-beta.20 → 3.1.48-beta.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +87 -87
- package/es/components/card-reader-sdk/src/components/readCardDialog.vue2.js +1 -1
- package/es/components/fabric-chart/src/constants/index.d.ts +4 -0
- package/es/components/fabric-chart/src/constants/index.js +1 -1
- package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useCenter.js +1 -1
- package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useOther.d.ts +7 -2
- package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useOther.js +1 -1
- package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useSurgicalAnesthesiaChart.js +1 -1
- package/es/components/fabric-chart/src/utils/index.d.ts +6 -0
- package/es/components/fabric-chart/src/utils/index.js +1 -1
- package/es/components/form-config/index.d.ts +7 -0
- package/es/components/form-config/src/FormConfig.vue.d.ts +7 -0
- package/es/components/form-config/src/components/FormConfigEdit.vue.d.ts +3 -0
- package/es/components/form-render/src/components/renderer/radio_checkbox.js +1 -1
- package/es/components/form-render/src/components/renderer/select.js +1 -1
- package/es/components/form-render/src/hooks/useComplexOptions.d.ts +9 -6
- package/es/components/form-render/src/hooks/useComplexOptions.js +1 -1
- package/es/components/form-render/src/hooks/useFieldNormalize.js +1 -1
- package/es/components/form-render/src/types/fieldItem.d.ts +2 -0
- package/es/components/form-render/style/index.css +1 -1
- package/es/components/iho-table/index.d.ts +8 -3
- package/es/components/iho-table/src/IhoTable.vue.d.ts +8 -3
- package/es/components/iho-table/src/constants/index.d.ts +4 -3
- package/es/components/iho-table/src/constants/index.js +1 -1
- package/es/components/iho-table/src/hooks/tapHooks/index.d.ts +1 -0
- package/es/components/iho-table/src/hooks/tapHooks/useEventHooks.d.ts +2 -1
- package/es/components/iho-table/src/hooks/tapHooks/useEventHooks.js +1 -1
- package/es/components/iho-table/src/types/pluginType.d.ts +3 -1
- package/es/components/index.css +1 -1
- package/es/components/scale-view/index.d.ts +24 -1
- package/es/components/scale-view/src/ScaleView.vue.d.ts +24 -1
- package/es/components/scale-view/src/ScaleView.vue2.js +1 -1
- package/es/components/scale-view/src/components/DescribeContent.vue.d.ts +21 -0
- package/es/components/scale-view/src/components/DescribeContent.vue.js +1 -0
- package/es/components/scale-view/src/components/DescribeContent.vue2.js +1 -0
- package/es/components/scale-view/src/components/formitem/r-datetime.js +1 -1
- package/es/components/scale-view/src/hooks/scaleview-computed.d.ts +6 -2
- package/es/components/scale-view/src/hooks/scaleview-computed.js +1 -1
- package/es/components/scale-view/src/hooks/scaleview-init.js +1 -1
- package/es/components/scale-view/src/utils/judge-types.js +1 -1
- package/es/components/scale-view/style/index.css +1 -1
- package/es/components/select-label/src/LabelFormContent.vue2.js +1 -1
- package/es/components/select-person/src/SearchMultiple.vue.d.ts +6 -0
- package/es/components/shortcut-setter/index.d.ts +1 -0
- package/es/components/shortcut-setter/src/ShortcutSetter.vue.d.ts +1 -0
- package/es/components/table-export-field/src/components/ExportModal.vue.d.ts +0 -3
- package/es/env.d.ts +25 -25
- package/es/shared/assets/img/failure.png.js +1 -1
- package/es/shared/assets/img/no-permission.png.js +1 -1
- package/es/shared/assets/img/nodata.png.js +1 -1
- package/es/shared/assets/img/notfound.png.js +1 -1
- package/es/shared/assets/img/qr.png.js +1 -1
- package/es/shared/assets/img/success.png.js +1 -1
- package/es/shared/assets/img/video.png.js +1 -1
- package/es/shared/assets/img/video_default_cover.png.js +1 -1
- package/es/shared/assets/img/xb_big.png.js +1 -1
- package/es/shared/assets/img/xb_small.png.js +1 -1
- package/es/shared/package.json.js +1 -1
- package/package.json +67 -67
- package/es/components/bpmn-workflow/src/BpmnWorkflow.d.ts +0 -0
- package/es/components/bpmn-workflow/types/BpmnViewer.d.ts +0 -1
- package/es/components/bpmn-workflow/types/ModelingModule.d.ts +0 -1
- package/es/components/bpmn-workflow/types/MoveCanvasModule.d.ts +0 -1
- package/es/shared/components/VueDraggable/src/vuedraggable.d.ts +0 -86
- package/es/shared/utils/fabricjs/index.d.ts +0 -6823
- package/es/shared/utils/tapable/index.d.ts +0 -139
- package/es/shared/utils/tapableLess.d.ts +0 -28
- 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{defineComponent as o,watch as e,nextTick as
|
|
1
|
+
import{defineComponent as o,watch as e,nextTick as t,ref as n,openBlock as l,createBlock as s,unref as a,mergeProps as u,withCtx as r,createVNode as i,withKeys as p,withModifiers as c}from"vue";import{NModal as v,NInput as d}from"naive-ui";var f=o({__name:"readCardDialog",props:{show:{type:Boolean},inputProps:null,modalProps:null},emits:["update:show","confirm","close"],setup(o,{emit:f}){const m=o;e((()=>m.show),(async o=>{var e;o&&(await t(),null==(e=w.value)||e.focus())}));const w=n(),h=n("");function y(){f("update:show",!1),f("close")}function P(){f("confirm",h.value)}return(e,t)=>(l(),s(a(v),u({preset:"dialog",title:"扫码电子健康卡",show:o.show,"close-on-esc":!1,"show-icon":!1,"positive-text":"确认"},o.modalProps,{"trap-focus":!1,onClose:y,onPositiveClick:P}),{default:r((()=>[i(a(d),u({value:h.value,"onUpdate:value":t[0]||(t[0]=o=>h.value=o),ref_key:"inputRef",ref:w,placeholder:"请输入健康卡号"},o.inputProps,{onKeydown:p(c(P,["prevent","stop"]),["enter"])}),null,16,["value","onKeydown"])])),_:1},16,["show"]))}});export{f as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=[{label:"升温",value:!0,type:"rise"},{label:"药物降温",value:void 0,type:"drugReduce"},{label:"物理降温",value:void 0,type:"physicsReduce"},{label:"不升",value:!0,type:"noRise"}],i=[{label:"药物降痛",value:void 0,type:"drugReduce"},{label:"物理降痛",value:void 0,type:"physicsReduce"}],l="#2563F4",
|
|
1
|
+
const e=[{label:"升温",value:!0,type:"rise"},{label:"药物降温",value:void 0,type:"drugReduce"},{label:"物理降温",value:void 0,type:"physicsReduce"},{label:"不升",value:!0,type:"noRise"}],i=[{label:"药物降痛",value:void 0,type:"drugReduce"},{label:"物理降痛",value:void 0,type:"physicsReduce"}],l=[{label:"修改",type:"change"},{label:"删除",type:"remove"}],r="#2563F4",a="#FF1818",s={yemai:{stroke:a,strokeX:r,strokeWidth:1,strokeWidthX:1,radius:6,angle:45},koumai:{stroke:a,strokeWidth:1,radius:6,radiusCircle:3,fillCircle:r},gangmai:{radius:6,radiusCircle:3,stroke:r,fillCircle:a},xinmai:{radius:6,radiusCircle:3,stroke:a,fillCircle:a},humai:{radius:6,fill:"green"},ermai:{stroke:a,strokeWidth:1,radius:6,radiusCircle:3,fillCircle:r}};export{l as OTHER_MENU,s as OVERLAP,i as PAIN_MENU,e as TEMPERATURE_MENU};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{drawLine as e,drawPoint as t}from"../useDraw.js";import{useGrid as n}from"../useGrid.js";import{useBirthProcessCumputedPoint as i}from"../useCumputedPoint.js";import"@vueuse/core";import"../../../../../shared/utils/fabricjs/index.js";import{useCommon as o}from"../useCommon.js";import"vue";import{
|
|
1
|
+
import{drawLine as e,drawPoint as t}from"../useDraw.js";import{useGrid as n}from"../useGrid.js";import{useBirthProcessCumputedPoint as i}from"../useCumputedPoint.js";import"@vueuse/core";import"../../../../../shared/utils/fabricjs/index.js";import{useCommon as o}from"../useCommon.js";import"vue";import{getPointRange as l,getIndex as r,isEffectiveNode as a,getTime as s}from"../../utils/index.js";import{cloneDeep as f}from"lodash-es";import"date-fns";import"../temperature/useShadow.js";function u(u,p,c,d,m){const{cumputedX:v,cumputedY:g,getXValue:h,getYValue:y}=i(p),{xCellWidth:L,yCellHeight:x,originX:k,endX:P,originY:b,endY:A,event:w,scaleValues:j,xAxis:C,startTime:I,timeXCell:T,itemList:X}=p,E=new Map,M=new Set,Y=f(j);let _=[];n(u,p);const{getEqualXTypes:V,handleAddPrevent:$}=o(u,c,p);function O(){Y.forEach((e=>{e.dataList.forEach(((t,n)=>{S(t,n,e)}))})),function(){if(!w.evented)return;u.value.on("mouse:up",(e=>{if(3===e.button){const{x:t=0,y:n=0}=e.pointer||{};if(t>=k&&t<=P&&n>=b&&n<=A)if(m.point={x:t,y:n},m.show=!0,e.target){if("main"!==e.target.__type)return;m.target=e.target,m.list=["删除节点"];const{minLeft:t,maxLeft:n,minTop:i,maxTop:o}=l(e.target);H().forEach((l=>{"main"===l.__type&&l.left>t&&l.left<n&&l.top>i&&l.top<o&&m.list.push({renderItem:()=>l.origin.title,origin:{...l.origin},mode:"remove",pointer:e.pointer})})),1===m.list.length&&(m.show=!1,console.log("当前时间段内无可删除节点"))}else m.target=null,m.list=["新增节点"],X.forEach((n=>{V(H(),t,"key").includes(n.key)||m.list.push({renderItem:()=>n.title,origin:{title:n.title,unit:n.unit,type:n.bigType,dataIndex:n.dataIndex,key:n.key},pointer:e.pointer})})),1===m.list.length&&(m.show=!1,$("repeat"),console.log("当前时间段内无可新增节点"))}}))}()}function S(n,i,o){var l;const{type:r,unit:a,dataList:s=[]}=o,f=[];E.set(n.key,[]),null==(l=n.list)||l.forEach(((l,s)=>{!function(n,l,s,m){var v;let g,x;const{pointAttr:j={},lineAttr:C={},title:I="",key:X,type:Y="circle"}=m,V=G(m.list[s+1],o);n&&V&&!l.breakpoint&&n[0]!==V[0]&&(x=e([...n,...V],C));const $=f[s-1],O={origin:{data:l,title:I,key:X||"",unit:a,type:r,dataIndex:i,index:s,lineAttr:C},__type:"main",leftLine:$,rightLine:x,...j,...p.event.hovered?p.event.evented?{selectable:!0}:{selectable:!0,lockMovementX:!0,lockMovementY:!0}:p.event};$?g=t(Y,{left:$.get("x2"),top:$.get("y2"),...O}):n&&(O.leftLine=null,g=t(Y,{left:n[0],top:n[1],...O}));f.push(x),g&&(g.originLeft=g.left,g.originTop=g.top,function(e){w.hovered&&(e.on("mouseover",(()=>{q(e,"hover")})),e.on("mouseout",(()=>{d.show=!1})));if(e.lockMovementX&&e.lockMovementY)return;e.on("moving",(()=>{!function(e){e.setCoords();const t=6e4/T,n=e.prevPoint?e.prevPoint.left+t:k,i=e.nextPoint?e.nextPoint.left-t:P;e.top<b&&e.set("top",b),e.top>A&&e.set("top",A),e.left<n&&e.set("left",n),e.left>i&&e.set("left",i)}(e),function(e){var t,n;null==(t=e.leftLine)||t.setCoords().set({x2:e.left,y2:e.top}),null==(n=e.rightLine)||n.setCoords().set({x1:e.left,y1:e.top})}(e),w.hovered&&q(e),function(e){const{originLeft:t,originTop:n,left:i,top:o,origin:l}=e,r=~~((i-t)/L);if(i>t+L&&!e.nextPoint){if(0===_.length){z(e,[...e.leftLine?[e.leftLine.x1,e.leftLine.y1]:[t,n],t,n]),e.leftLine&&e.leftLine.set({stroke:"transparent"})}const i=t+L*r;if(_.every((e=>e.left!==i))){const t=h(i),n=y(l.type,o);_.push({data:{time:t,value:n},left:i,top:o}),z(e,[...e.prevPointer,i,o])}_.length<r&&function(e,t){const{originLeft:n,originTop:i,origin:o}=e;let l=1;for(;l<=t;){const t=n+L*l,r=_.some((e=>Math.abs(e.left-t)<=1));if(!r){let l=0;const r=_.find(((e,n)=>(e.left>t&&(l=n),e.left>t)));if(r){const a=JSON.parse(JSON.stringify(r)),s=_[l-1]||{left:n,top:i},f=~~((r.left-(t-L))/L),u=(r.top-s.top)/f;a.top=s.top+u,a.left=t,a.data={time:h(t),value:y(o.type,a.top)},_.splice(l,0,a),z(e,[s.left,s.top,a.left,a.top])}}l++}}(e,r)}if(_.length>0&&i<_[_.length-1].left){for(const e of M)e.left>i&&(e.leftLine&&u.value.remove(e.leftLine),u.value.remove(e));if(_=_.filter((e=>e.left<=i)),0===_.length){e.leftLine&&e.leftLine.set(e.origin.lineAttr);for(const e of M)e.leftLine&&u.value.remove(e.leftLine),u.value.remove(e)}if(_.length>0){const t=_.at(-1);e.prevPointer=[t.left,t.top]}}}(e)})),e.on("mouseup",(t=>{if(d.show=!1,1===t.button){const{key:t,type:n}=e.origin,i={...e.origin,data:{...e.origin.data,time:h(e.left),value:y(n,e.top)}};if(u.value.discardActiveObject(),_.length>0){const e=_.map((e=>e.data));c("add",{...i,data:e}),D({...i,data:e})}else c("change",i),D(i,"change")}}))}(g),null==(v=E.get(X))||v.push(g))}(G(l,o),l,s,n)})),Promise.all(E.get(n.key)).then((e=>{const t=f.filter((e=>e));let n=null;e=e.map((e=>(e&&n&&(n.nextPoint=e,e.prevPoint=n),n=e||n,e))),u.value.add(...t,...e)}))}function z(t,n){const[i,o,l,r]=n;t.clone((i=>{i.set({left:l,top:r}),t.prevPointer=[l,r];const o=e(n,t.origin.lineAttr);i.leftLine=o,M.add(i),u.value.add(o,i)}))}function D(e,t="add"){const{dataIndex:n,data:i,index:o,key:l,type:a}=e,s=Y.find((e=>e.type===a)),f=s.dataList.find((e=>e.key===l));switch(t){case"remove":f.list.splice(o,1);break;case"change":f.list[o]=i;break;default:{const e=Array.isArray(i)?i[0].time:i.time,t=r(e,f.list),n=Array.isArray(i)?i:[i];f.list.splice(t,0,...n);break}}J({dataIndex:n,scaleValue:s})}function J(e){var t,n,i;if(M.size&&(null==(t=u.value)||t.remove(...N([...M]))),M.clear(),_=[],e){const{dataIndex:t,scaleValue:i}=e,o=i.dataList[t];null==(n=u.value)||n.remove(...N(E.get(o.key))),E.delete(o.key),S(o,t,i)}else E.size&&(null==(i=u.value)||i.remove(...N(H()))),E.clear(),O()}function N(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)})),t}function q(e,t="moving"){const{title:n,type:i,data:o,unit:l}=e.origin;d.point={x:e.left,y:e.top};const r=`${"hover"===t?o.value:y(i,e.top)}`;d.list=[`${n} ${r}${l||""}`,`时间 ${h(e.left).slice(-5)}`],d.show=!0}function G(e,t){if(a(e)&&function(e){const t=Date.parse(C.list.at(-1)),n=s(e);return n>=I&&n<=t}(e.time)){const n=v(e.time),i=g(t.type,t.range,e.value);return[n,i<b?b:i>A?A:i]}}function H(){return Array.from(E.values()).flat()}return O(),{redrawPoints:J,clickMenu:function({item:e,target:t}){const n={...e.origin};"remove"===e.mode?(c("remove",n),D(n,"remove")):(Object.assign(n,{data:{time:h(e.pointer.x),value:y(e.origin.type,e.pointer.y)}}),c("add",n),D(n))}}}export{u as useCenter};
|
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
import { Ref } from 'vue';
|
|
2
2
|
import { fabric } from '../../../../../../es/shared/utils/fabricjs';
|
|
3
|
-
import { IPointTipProps } from '../../../../../../es/components/fabric-chart/src/interface';
|
|
3
|
+
import { IPointTipProps, IPointMenuProps } from '../../../../../../es/components/fabric-chart/src/interface';
|
|
4
4
|
import { AnyObject } from '../../../../../../es/shared/types';
|
|
5
|
-
export declare function useOther(canvas: Ref<fabric.Canvas>, propItems: AnyObject, emits: Function, pointTipProps: IPointTipProps):
|
|
5
|
+
export declare function useOther(canvas: Ref<fabric.Canvas>, propItems: AnyObject, emits: Function, pointTipProps: IPointTipProps, pointMenuProps: IPointMenuProps): {
|
|
6
|
+
clickMenu: ({ item, target }: {
|
|
7
|
+
item: AnyObject;
|
|
8
|
+
target: any;
|
|
9
|
+
}) => void;
|
|
10
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{fabric as t}from"../../../../../shared/utils/fabricjs/index.js";import{drawPoint as
|
|
1
|
+
import{fabric as t}from"../../../../../shared/utils/fabricjs/index.js";import{drawPoint as e,drawText as o}from"../useDraw.js";import{useBirthProcessCumputedPoint as i}from"../useCumputedPoint.js";import"@vueuse/core";import"vue";import"lodash-es";import"date-fns";import"../temperature/useShadow.js";import{OTHER_MENU as n}from"../../constants/index.js";function r(r,l,a,s,u){const{cumputedX:c,getXValue:f}=i(l),{other:d,yCellHeight:m,endX:h,originX:p,originY:v,endY:g,markHeight:x,event:y,topGridYCellHeight:X}=l;function k(t){y.hovered&&(t.on("mouseover",(()=>{_(t)})),t.on("mouseout",(()=>{s.show=!1}))),y.evented&&t.on("mouseup",(e=>{s.show=!1,3===e.button&&(u.point={x:t.left,y:t.top},u.show=!0,u.target=t,u.list=n.map((t=>({...t,renderItem:()=>t.label}))))}))}function _(t){s.point={x:t.left,y:"mark"===t.__type?t.top:t.top+X/2},s.list=[`时间 ${f(t.left).slice(-5)}`],"mark"===t.__type&&s.list.unshift(t.origin.name+" "),s.show=!0}function S(t){return t>=p&&t<=h}return function(){if(!(null==d?void 0:d.horizontal))return;const{horizontal:i}=d,n=p-5;let l=v+m/2;i.forEach(((i,a)=>{const{title:s,titleStyle:u={},type:f,pointAttr:d={},textStyle:h={},data:p}=i,v=s&&e(s,{...u,originX:"right",left:n,top:l});r.value.add(v),p.forEach(((i,n)=>{const{time:u,value:m}=i,p=c(u);if(!S(p))return;const v=e(f,{...d,left:p,top:l}),g=p+v.width/2+2,x=o([g,l],{value:m,...h,originX:"left"}),y=new t.Group([v,x],{lockMovementX:!0,lockMovementY:!0,objectCaching:!1,hasControls:!1,hasBorders:!1,hoverCursor:"pointer"});y.__type="other",y.origin={__type:"other",key:"horizontal",dataIndex:a,index:n,data:i,title:s},k(y),r.value.add(y)})),l+=m}))}(),function(){if(!(null==d?void 0:d.vertical))return;const{vertical:t}=d;t.forEach(((t,o)=>{const{textStyle:i={},data:n,time:l}=t,a=c(l);if(!S(a))return;let s=v+m/2;n.forEach(((t,n)=>{const u=e(String(t),{...i,lockMovementX:!0,lockMovementY:!0,left:a,originX:"left",top:s,__type:"other",origin:{key:"vertical",dataIndex:o,index:n,data:{time:l,value:t}}});s+=m,k(u),r.value.add(u)}))}))}(),function(){if(!(null==d?void 0:d.mark)||!x)return;const{title:t,titleStyle:i,pointAttr:n,dataList:l}=d.mark,u=o([p-5,g+x/2],{value:t,...i,originX:"right"});r.value.add(u);const m=g+x,X=[];l.forEach((t=>{const{time:o,list:i=[]}=t,l=c(o);if(!S(l))return;let u=g;i.forEach((t=>{let o=!1;const i=e("circleAndText",{...n,text:t.text,left:l,top:u,origin:t,__type:"mark"}),c=i.height;u+c<=m&&u>=g?(i.set("top",u+c/2),u+=c):(o||(u=g,o=!0),i.set("top",u-c/2),u-=c),X.push(i),function(t){y.hovered&&(t.on("mouseover",(()=>{_(t)})),t.on("mouseout",(()=>{s.show=!1})));if(t.lockMovementX&&t.lockMovementY)return;t.on("moving",(()=>{!function(t){t.setCoords(),t.left<t.limitX.x1&&t.set("left",t.limitX.x1);t.left>t.limitX.x2&&t.set("left",t.limitX.x2);t.top<v&&t.set("top",v);const e=g+x-t.height/2;t.top>e&&t.set("top",e)}(t),y.hovered&&_(t)})),t.on("mouseup",(e=>{if(s.show=!1,1===e.button){!function(t){var e;if((null==(e=t.origin)?void 0:e.isStart)&&t.otherPoints)t.otherPoints.forEach((e=>{e.limitX.x1=t.left}));else{const e=t.startPoint.otherPoints.map((t=>t.left));console.log(e);const o=Math.min(...e);console.log(o,t.startPoint),t.startPoint.limitX.x2=o}}(t);const e={type:"mark",time:f(t.left),data:t.origin};r.value.discardActiveObject(),a("change",e)}}))}(i),r.value.add(i)}))})),function(t){const e=t.find((t=>{var e;return null==(e=t.origin)?void 0:e.isStart})),o=t.find((t=>{var o;return!(null==(o=t.origin)?void 0:o.isStart)&&t.left>e.left})),i=t.filter((t=>{var e;return!(null==(e=t.origin)?void 0:e.isStart)}));t.forEach((t=>{var n;const r={x1:p,x2:h};(null==(n=t.origin)?void 0:n.isStart)?(r.x2=o.left,t.otherPoints=i):(r.x1=e.left,t.startPoint=e),t.limitX=r}))}(X)}(),{clickMenu:function({item:t,target:e}){if(!e)return;const{type:o}=t;a(o,{...e.origin,type:"other"})}}}export{r as useOther};
|
package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useSurgicalAnesthesiaChart.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{ref as e,computed as t,reactive as a,unref as r,onMounted as i,nextTick as l}from"vue";import{defaultBorderStyle as
|
|
1
|
+
import{ref as e,computed as t,reactive as a,unref as r,onMounted as i,nextTick as l}from"vue";import{defaultBorderStyle as n}from"../useDraw.js";import"../../../../../shared/utils/fabricjs/index.js";import{format as u}from"date-fns";import{getChildrenSize as s}from"../../utils/index.js";import{useEvent as o}from"../useEvent.js";import{cloneDeep as d,range as c}from"lodash-es";import"../temperature/useShadow.js";import{OTHER_MENU as p}from"../../constants/index.js";import{useTop as m}from"./useTop.js";import{useLeft as v}from"./useLeft.js";import{useCenter as h}from"./useCenter.js";import{useOther as f}from"./useOther.js";function g(g,y,x,w,b,j){const Y=e(),C=e(),H=e(),A=t((()=>y.data.layout||{top:"drug",center:"xAxis",bottom:"intraoperatively"})),D=t((()=>{var e;return null!=(e=y.data.left.width)?e:0})),M=t((()=>{const{grid:e}=y.data;return e.mainXCell*e.subXCell})),T=t((()=>{const{grid:e}=y.data;return e.mainYCell*e.subYCell})),X=t((()=>s(y.data.top.treeData))),V=t((()=>y.data.top.tree.cellHeight)),k=t((()=>V.value*X.value)),G=t((()=>_(Z("drug")||"top"))),S=t((()=>G.value+k.value)),N=t((()=>{var e;return Date.parse((null==(e=y.data.xAxis)?void 0:e.startTime)||u(new Date,"yyyy-MM-dd HH:mm:ss"))})),O=t((()=>{const e=d(y.data.xAxis),{spaceValue:t,spaceTimeStamp:a}=e,r=c(M.value/t+1).map((r=>0===r?e.startTime:u(new Date(N.value+r*t*a),"yyyy-MM-dd HH:mm:ss")));return{...e,list:r,left:D.value}})),E=function(){const e=d(y.data.top.treeData);let t=0;const{cellWidth:a,cellHeight:r}=y.data.top.tree;return function e(i,l=0){i.forEach((i=>{var n;const u={top:t*r+G.value,left:l*a,width:a,height:r};if(t++,null==(n=i.children)?void 0:n.length){t--;const a=s(i.children);u.height=a*r,e(i.children,l+1)}else u.width=D.value-u.left;Object.assign(i,u)}))}(e),e}(),L=t((()=>_(Z("xAxis")||"center"))),W=t((()=>{var e;const{width:t,right:a}=y.data;if(!a)return t;return t-(null!=(e=a.width)?e:0)})),I=t((()=>_(Z("intraoperatively")||"bottom"))),P=t((()=>{var e;const{show:t=!0,height:a}=(null==(e=y.data.other)?void 0:e.mark)||{};return t&&a?a:0})),q=t((()=>I.value+(y.data.height-k.value-O.value.height-P.value))),z=t((()=>(W.value-D.value)/M.value)),B=t((()=>(q.value-I.value)/T.value)),F=t((()=>O.value.spaceTimeStamp/z.value)),J=t((()=>{const{scaleValues:e}=y.data;return e.map((e=>e.dataList.filter((e=>e.show)).map(((t,a)=>({...t,bigType:e.type,unit:e.unit,dataIndex:a}))))).flat()})),K=t((()=>ee("pulse"))),Q=t((()=>ee("temperature"))),R=t((()=>{var e;return(null==(e=y.data.grid)?void 0:e.event)||{selectable:!0,evented:!0,hovered:!0}})),U=a({canvasWidth:y.data.width,canvasHeight:y.data.height,borderStyle:{...n,...y.data.borderStyle||{}},grid:y.data.grid,top:y.data.top,left:y.data.left,other:y.data.other,topGridYNumber:r(X),topGridYCellHeight:r(V),topGridOriginY:r(G),topGridEndY:r(S),treeData:E,xAxis:r(O),originYXAxis:r(L),startTime:r(N),timeXCell:r(F),gridXNumber:r(M),gridYNumber:r(T),xCellWidth:r(z),yCellHeight:r(B),originX:r(D),endX:r(W),originY:r(I),endY:r(q),markHeight:r(P),itemList:r(J),scaleValues:y.data.scaleValues,pulseYCell:r(K),temperatureYCell:r(Q),event:r(R)});function Z(e){let t="";return Object.entries(A.value).some((([a,r])=>{if(r===e)return t=a,!0})),t}function $(e){const t=A.value[e],a=O.value.height;switch(t){case"drug":return k.value;case"xAxis":return a;default:return y.data.height-k.value-a}}function _(e){switch(e){case"top":return 0;case"center":return $("top");default:return $("top")+$("center")}}function ee(e){const{scaleValues:t}=y.data,a=t.find((t=>t.type===e));return B.value*(a.spaceGridNumber||1)/(a.spaceValue||1)}return i((async()=>{await l(),m(g,U,x,b),v(g,U);const{clickMenu:e}=f(g,U,x,b,j),{redrawPoints:t,clickMenu:a}=h(g,U,x,b,j);C.value=t,H.value=t=>{const{item:r}=t;r.type&&p.map((e=>e.type)).includes(r.type)?e(t):a(t)},o(w.value)})),{propItems:U,redrawPoints:C,select:Y,clickMenu:H}}export{g as useSurgicalAnesthesiaChart};
|
|
@@ -23,3 +23,9 @@ export declare function getTime(value: number | string): number;
|
|
|
23
23
|
* @return {number[]}
|
|
24
24
|
*/
|
|
25
25
|
export declare function getScaleNumberList(range: [number, number], spaceValue: number): number[];
|
|
26
|
+
export declare function getPointRange(target: any): {
|
|
27
|
+
minLeft: number;
|
|
28
|
+
maxLeft: any;
|
|
29
|
+
minTop: number;
|
|
30
|
+
maxTop: any;
|
|
31
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{isNull as n,isNumber as t}from"lodash-es";function e(n){return(null==n?void 0:n.time)&&((null==n?void 0:n.value)||0===(null==n?void 0:n.value))}function r(n,t){const e={};for(const r in n)t.map((n=>n.type)).includes(r)||(e[r]=n[r]);return e}function u(n,t){const e=t.findIndex((t=>
|
|
1
|
+
import{isNull as n,isNumber as t}from"lodash-es";function e(n){return(null==n?void 0:n.time)&&((null==n?void 0:n.value)||0===(null==n?void 0:n.value))}function r(n,t){const e={};for(const r in n)t.map((n=>n.type)).includes(r)||(e[r]=n[r]);return e}function u(n,t){const e=t.findIndex((t=>p(t.time)>p(n)));return~e?e:t.length}function o(n){return["temperature","pulse"].includes(n)}function i(n,t){return n.includes("心率")?"pulse_other":t}function l(n){return n.includes("_other")?n.split("_")[0]:n}function c(t){return!Number.isNaN(+t)&&!n(t)}function f(n,t){return a(n.left,1)===a(t.left,1)&&Math.abs(a(n.top,1)-a(t.top,1))<=2}function a(n,t=100){return Math.floor(n*t)/t}function s(n){let t=0;return n.forEach((n=>{var e;(null==(e=n.children)?void 0:e.length)?t+=s(n.children):t++})),t}function p(n){return n?t(n)?new Date(n).getTime():Date.parse(n.replace(/-/g,"/")):Date.now()}function d(n,t){const e=[],[r,u]=n;for(let n=r;t>0?n<=u:n>=u;n+=t)e.push(n);return e}function h(n){const{width:t,height:e,left:r,top:u}=n,o=t/2,i=e/2;return{minLeft:r-o,maxLeft:r+o,minTop:u-i,maxTop:u+i}}export{r as deleteProperty,s as getChildrenSize,a as getFloorNumber,u as getIndex,h as getPointRange,d as getScaleNumberList,p as getTime,l as getType,e as isEffectiveNode,o as isOneLine,f as isOverlapPoint,c as isValidValue,i as setOtherType};
|
|
@@ -195,6 +195,7 @@ declare const FormConfig: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
195
195
|
p_name: string;
|
|
196
196
|
}[] | undefined;
|
|
197
197
|
}[] | undefined;
|
|
198
|
+
show_mode?: ("DROPDOWN" | "H_TILE" | "V_TILE" | "TILE") | undefined;
|
|
198
199
|
fieldType?: import("@formily/json-schema").SchemaTypes | undefined;
|
|
199
200
|
content?: string | import("..").FormRenderer | Record<string, import("..").FormRenderer> | undefined;
|
|
200
201
|
lazyRequest?: boolean | undefined;
|
|
@@ -1915,6 +1916,7 @@ declare const FormConfig: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
1915
1916
|
p_name: string;
|
|
1916
1917
|
}[] | undefined;
|
|
1917
1918
|
}[] | undefined;
|
|
1919
|
+
show_mode?: ("DROPDOWN" | "H_TILE" | "V_TILE" | "TILE") | undefined;
|
|
1918
1920
|
fieldType?: import("@formily/json-schema").SchemaTypes | undefined;
|
|
1919
1921
|
content?: string | import("..").FormRenderer | Record<string, import("..").FormRenderer> | undefined;
|
|
1920
1922
|
lazyRequest?: boolean | undefined;
|
|
@@ -3644,6 +3646,7 @@ declare const FormConfig: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
3644
3646
|
p_name: string;
|
|
3645
3647
|
}[] | undefined;
|
|
3646
3648
|
}[] | undefined;
|
|
3649
|
+
show_mode?: ("DROPDOWN" | "H_TILE" | "V_TILE" | "TILE") | undefined;
|
|
3647
3650
|
fieldType?: import("@formily/json-schema").SchemaTypes | undefined;
|
|
3648
3651
|
content?: string | import("..").FormRenderer | Record<string, import("..").FormRenderer> | undefined;
|
|
3649
3652
|
lazyRequest?: boolean | undefined;
|
|
@@ -5364,6 +5367,7 @@ declare const FormConfig: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
5364
5367
|
p_name: string;
|
|
5365
5368
|
}[] | undefined;
|
|
5366
5369
|
}[] | undefined;
|
|
5370
|
+
show_mode?: ("DROPDOWN" | "H_TILE" | "V_TILE" | "TILE") | undefined;
|
|
5367
5371
|
fieldType?: import("@formily/json-schema").SchemaTypes | undefined;
|
|
5368
5372
|
content?: string | import("..").FormRenderer | Record<string, import("..").FormRenderer> | undefined;
|
|
5369
5373
|
lazyRequest?: boolean | undefined;
|
|
@@ -8060,6 +8064,7 @@ declare const FormConfig: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
8060
8064
|
p_name: string;
|
|
8061
8065
|
}[] | undefined;
|
|
8062
8066
|
}[] | undefined;
|
|
8067
|
+
show_mode?: ("DROPDOWN" | "H_TILE" | "V_TILE" | "TILE") | undefined;
|
|
8063
8068
|
fieldType?: import("@formily/json-schema").SchemaTypes | undefined;
|
|
8064
8069
|
content?: string | import("..").FormRenderer | Record<string, import("..").FormRenderer> | undefined;
|
|
8065
8070
|
lazyRequest?: boolean | undefined;
|
|
@@ -9791,6 +9796,7 @@ declare const FormConfig: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
9791
9796
|
p_name: string;
|
|
9792
9797
|
}[] | undefined;
|
|
9793
9798
|
}[] | undefined;
|
|
9799
|
+
show_mode?: ("DROPDOWN" | "H_TILE" | "V_TILE" | "TILE") | undefined;
|
|
9794
9800
|
fieldType?: import("@formily/json-schema").SchemaTypes | undefined;
|
|
9795
9801
|
content?: string | import("..").FormRenderer | Record<string, import("..").FormRenderer> | undefined;
|
|
9796
9802
|
lazyRequest?: boolean | undefined;
|
|
@@ -11495,6 +11501,7 @@ declare const FormConfig: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
11495
11501
|
p_name: string;
|
|
11496
11502
|
}[] | undefined;
|
|
11497
11503
|
}[] | undefined;
|
|
11504
|
+
show_mode?: ("DROPDOWN" | "H_TILE" | "V_TILE" | "TILE") | undefined;
|
|
11498
11505
|
fieldType?: import("@formily/json-schema").SchemaTypes | undefined;
|
|
11499
11506
|
content?: string | import("..").FormRenderer | Record<string, import("..").FormRenderer> | undefined;
|
|
11500
11507
|
lazyRequest?: boolean | undefined;
|
|
@@ -197,6 +197,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
197
197
|
p_name: string;
|
|
198
198
|
}[] | undefined;
|
|
199
199
|
}[] | undefined;
|
|
200
|
+
show_mode?: ("DROPDOWN" | "H_TILE" | "V_TILE" | "TILE") | undefined;
|
|
200
201
|
fieldType?: import("@formily/json-schema").SchemaTypes | undefined;
|
|
201
202
|
content?: string | import("../../../../es/components/form-render").FormRenderer | Record<string, import("../../../../es/components/form-render").FormRenderer> | undefined;
|
|
202
203
|
lazyRequest?: boolean | undefined;
|
|
@@ -1917,6 +1918,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
1917
1918
|
p_name: string;
|
|
1918
1919
|
}[] | undefined;
|
|
1919
1920
|
}[] | undefined;
|
|
1921
|
+
show_mode?: ("DROPDOWN" | "H_TILE" | "V_TILE" | "TILE") | undefined;
|
|
1920
1922
|
fieldType?: import("@formily/json-schema").SchemaTypes | undefined;
|
|
1921
1923
|
content?: string | import("../../../../es/components/form-render").FormRenderer | Record<string, import("../../../../es/components/form-render").FormRenderer> | undefined;
|
|
1922
1924
|
lazyRequest?: boolean | undefined;
|
|
@@ -3646,6 +3648,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
3646
3648
|
p_name: string;
|
|
3647
3649
|
}[] | undefined;
|
|
3648
3650
|
}[] | undefined;
|
|
3651
|
+
show_mode?: ("DROPDOWN" | "H_TILE" | "V_TILE" | "TILE") | undefined;
|
|
3649
3652
|
fieldType?: import("@formily/json-schema").SchemaTypes | undefined;
|
|
3650
3653
|
content?: string | import("../../../../es/components/form-render").FormRenderer | Record<string, import("../../../../es/components/form-render").FormRenderer> | undefined;
|
|
3651
3654
|
lazyRequest?: boolean | undefined;
|
|
@@ -5366,6 +5369,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
5366
5369
|
p_name: string;
|
|
5367
5370
|
}[] | undefined;
|
|
5368
5371
|
}[] | undefined;
|
|
5372
|
+
show_mode?: ("DROPDOWN" | "H_TILE" | "V_TILE" | "TILE") | undefined;
|
|
5369
5373
|
fieldType?: import("@formily/json-schema").SchemaTypes | undefined;
|
|
5370
5374
|
content?: string | import("../../../../es/components/form-render").FormRenderer | Record<string, import("../../../../es/components/form-render").FormRenderer> | undefined;
|
|
5371
5375
|
lazyRequest?: boolean | undefined;
|
|
@@ -8062,6 +8066,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
8062
8066
|
p_name: string;
|
|
8063
8067
|
}[] | undefined;
|
|
8064
8068
|
}[] | undefined;
|
|
8069
|
+
show_mode?: ("DROPDOWN" | "H_TILE" | "V_TILE" | "TILE") | undefined;
|
|
8065
8070
|
fieldType?: import("@formily/json-schema").SchemaTypes | undefined;
|
|
8066
8071
|
content?: string | import("../../../../es/components/form-render").FormRenderer | Record<string, import("../../../../es/components/form-render").FormRenderer> | undefined;
|
|
8067
8072
|
lazyRequest?: boolean | undefined;
|
|
@@ -9793,6 +9798,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
9793
9798
|
p_name: string;
|
|
9794
9799
|
}[] | undefined;
|
|
9795
9800
|
}[] | undefined;
|
|
9801
|
+
show_mode?: ("DROPDOWN" | "H_TILE" | "V_TILE" | "TILE") | undefined;
|
|
9796
9802
|
fieldType?: import("@formily/json-schema").SchemaTypes | undefined;
|
|
9797
9803
|
content?: string | import("../../../../es/components/form-render").FormRenderer | Record<string, import("../../../../es/components/form-render").FormRenderer> | undefined;
|
|
9798
9804
|
lazyRequest?: boolean | undefined;
|
|
@@ -11497,6 +11503,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
11497
11503
|
p_name: string;
|
|
11498
11504
|
}[] | undefined;
|
|
11499
11505
|
}[] | undefined;
|
|
11506
|
+
show_mode?: ("DROPDOWN" | "H_TILE" | "V_TILE" | "TILE") | undefined;
|
|
11500
11507
|
fieldType?: import("@formily/json-schema").SchemaTypes | undefined;
|
|
11501
11508
|
content?: string | import("../../../../es/components/form-render").FormRenderer | Record<string, import("../../../../es/components/form-render").FormRenderer> | undefined;
|
|
11502
11509
|
lazyRequest?: boolean | undefined;
|
|
@@ -150,6 +150,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
150
150
|
p_name: string;
|
|
151
151
|
}[] | undefined;
|
|
152
152
|
}[] | undefined;
|
|
153
|
+
show_mode?: ("DROPDOWN" | "H_TILE" | "V_TILE" | "TILE") | undefined;
|
|
153
154
|
fieldType?: import("@formily/json-schema").SchemaTypes | undefined;
|
|
154
155
|
content?: string | import("../../../../../es/components/form-render").FormRenderer | Record<string, import("../../../../../es/components/form-render").FormRenderer> | undefined;
|
|
155
156
|
lazyRequest?: boolean | undefined;
|
|
@@ -1881,6 +1882,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
1881
1882
|
p_name: string;
|
|
1882
1883
|
}[] | undefined;
|
|
1883
1884
|
}[] | undefined;
|
|
1885
|
+
show_mode?: ("DROPDOWN" | "H_TILE" | "V_TILE" | "TILE") | undefined;
|
|
1884
1886
|
fieldType?: import("@formily/json-schema").SchemaTypes | undefined;
|
|
1885
1887
|
content?: string | import("../../../../../es/components/form-render").FormRenderer | Record<string, import("../../../../../es/components/form-render").FormRenderer> | undefined;
|
|
1886
1888
|
lazyRequest?: boolean | undefined;
|
|
@@ -3585,6 +3587,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
3585
3587
|
p_name: string;
|
|
3586
3588
|
}[] | undefined;
|
|
3587
3589
|
}[] | undefined;
|
|
3590
|
+
show_mode?: ("DROPDOWN" | "H_TILE" | "V_TILE" | "TILE") | undefined;
|
|
3588
3591
|
fieldType?: import("@formily/json-schema").SchemaTypes | undefined;
|
|
3589
3592
|
content?: string | import("../../../../../es/components/form-render").FormRenderer | Record<string, import("../../../../../es/components/form-render").FormRenderer> | undefined;
|
|
3590
3593
|
lazyRequest?: boolean | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{defineComponent as e,
|
|
1
|
+
import{defineComponent as e,computed as t,useAttrs as o,createVNode as a,isVNode as l}from"vue";import{connect as r,mapProps as i}from"@formily/vue";import{promiseTimeout as u}from"@vueuse/shared";import{isNumber as n}from"lodash-es";import{NSpace as p,NRadio as s,NRadioGroup as d,NCheckbox as m,NCheckboxGroup as c}from"naive-ui";import"../../../index.js";import{useComplexOptions as v}from"../../hooks/useComplexOptions.js";import"../../../../../shared/utils/index.js";import"@formily/core";import"@formily/path";import"@vue/shared";import"@vueuse/core";import"date-fns";import{assignUpdateValue as f,createVisitedSetter as y}from"../../utils/schema.js";import{useUrlConfigOptions as h,useAutographOptions as b}from"../../hooks/useFormRenderOptions.js";import{useCommonInjection as j}from"../../hooks/useCommonInjection.js";import{useFormField as g}from"../../hooks/useFormField.js";function k(r,i,s){return e({name:r,props:{value:{type:[String,Number,Object,Array]},options:{type:Array,default:()=>[]},urlConfig:{type:Object},autograph:{type:String},lazyRequest:{type:Boolean,default:!1},requestCache:{type:Boolean,default:!0},labelField:{type:String,default:"text"},valueField:{type:String,default:"value"},wordbook:{type:Object},vertical:{type:Boolean,default:!1},childFieldStrategy:{type:String,default:"checked"},clearable:Boolean,onChange:{}},emits:["update:value"],setup(e,{emit:r}){const{field:m}=g();const c=t({get(){return t=e.value,n(t)?t+"":t;var t},set(e){r("update:value",e)}}),{renderComplexOption:f}=v(e,c),{labelKey:k,valueKey:S,fullOptions:C}=e.urlConfig?h(e,c):b(e,c),{injectValueBindKey:F,injectValueValidate:O}=j();O(c);const x=F(c),B=o();return()=>a(i,{key:x.value,value:c.value,"onUpdate:value":e=>c.value=e,onClick:y(m)},{default:()=>[a(p,{vertical:e.vertical,"vertical-space":e.vertical},{default:()=>{var t;return[null==(t=C.value)?void 0:t.map((t=>{let o;return a(s,{key:t[S.value],value:t[S.value],disabled:t.disabled,onClick:()=>async function(t){if(null==B?void 0:B.disabled)return;if(i!==d||!e.clearable)return;const o=c.value;await u(0),o===t[S.value]&&(c.value=null)}(t)},"function"==typeof(r=o=f({value:c.value,option:t,valueKey:S.value,labelKey:k.value,childFieldStrategy:e.childFieldStrategy}))||"[object Object]"===Object.prototype.toString.call(r)&&!l(r)?o:{default:()=>[o]});var r}))]}})]})}})}const S=r(k("FormRadio",d,s),i({dataSource:"options"},f)),C=r(k("FormCheckbox",c,m),i({dataSource:"options"},f));export{C as CHECKBOX,S as RADIO};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{defineComponent as e,computed as t,inject as o,useAttrs as
|
|
1
|
+
import{defineComponent as e,computed as t,inject as o,useAttrs as l,createVNode as a,mergeProps as r}from"vue";import{useDebounceFn as s}from"@vueuse/core";import{cloneDeep as n,isArray as u,isString as i}from"lodash-es";import{useCommonInjection as p,useSelectOptionProps as m}from"../../hooks/useCommonInjection.js";import{useComplexOptions as c,useComplexOptionsSpan as d}from"../../hooks/useComplexOptions.js";import{InjectionChangeContextCollector as v,InjectionFormUUID as f}from"../../constants/index.js";import"../../../../../shared/utils/index.js";import"../../../index.js";import"@formily/core";import"@formily/path";import"@vue/shared";import"date-fns";import{assignUpdateValue as y,assignClearBindVisited as h,createVisitedSetter as j}from"../../utils/schema.js";import{useFormField as b}from"../../hooks/useFormField.js";import{NSelect as k}from"naive-ui";import"../../../../../shared/utils/tapable/SyncHook.js";import"../../../../../shared/utils/tapable/SyncBailHook.js";import"../../../../../shared/utils/tapable/SyncWaterfallHook.js";import"../../../../../shared/utils/tapable/SyncLoopHook.js";import"../../../../../shared/utils/tapable/AsyncParallelHook.js";import"../../../../../shared/utils/tapable/AsyncParallelBailHook.js";import"../../../../../shared/utils/tapable/AsyncSeriesHook.js";import"../../../../../shared/utils/tapable/AsyncSeriesBailHook.js";import"../../../../../shared/utils/tapable/AsyncSeriesLoopHook.js";import"../../../../../shared/utils/tapable/AsyncSeriesWaterfallHook.js";import"../../hooks/useFormValidator.js";import{connect as C,mapProps as S}from"@formily/vue";import"./index.js";import{useUrlConfigOptions as F,useAutographOptions as g,useRecommendOptions as x,searchContentMatcher as A}from"../../hooks/useFormRenderOptions.js";const H=C(e({name:"FormSelect",props:{value:{type:[String,Array,Number]},lazyRequest:{type:Boolean,default:!0},requestCache:{type:Boolean,default:!0},options:{type:Array,default:()=>[]},onChange:{},labelField:{type:String,default:"text"},valueField:{type:String,default:"value"},allowCreate:Boolean,urlConfig:{type:Object},autograph:{type:String},wordbook:{type:Object},recommend:{type:Boolean,default:!1},commonList:{type:Array},recentList:{type:Array},getRecommendInfo:{type:Function},commonNum:{type:Number,default:10},recentNum:{type:Number,default:10},recommendCache:{type:Boolean,default:!1}},emits:["update:value","postRecommend"],setup(e,{slots:y,emit:h}){const C=t({get:()=>e.value,async set(e){h("update:value",e),w(e)}}),{labelKey:S,valueKey:H,fetchData:O,searchContent:B,fullOptions:K,filterOptions:L}=e.urlConfig?F(e,C):g(e,C),{renderComplexOption:R,hasComplexOption:V}=c(e,C),{getRecommend:_,postRecommend:w,sortedOptions:N}=x(e,L,h,S,H),{field:P,fieldKey:I}=b();o(v).setContext(I.value,(e=>{return{currentOption:n((t=e,u(t)?function(e){const t=K.value.reduce(((e,t)=>(e[t[H.value]]=t,e)),{});return e.map((e=>t[e]))}(t):(o=t,K.value.find((e=>e[H.value]===o)))))};var t,o}));const W=s((async(e="")=>{B.value=e,O(e),_(e)}),300),{injectValueValidate:q,injectValueWatchFromEmpty:U,injectValueBindKey:z}=p();U(C,W),q(C);const D=z(C),{menuProps:E,nodeProps:G}=m();function J(e){const t=e[S.value];if(!t||!i(t))return"";const o=B.value?A(B.value,t):null;return o?a("section",null,[o.map(((e,t)=>0!==t&&e?a("span",{style:{color:t%2==0?"var(--n-option-text-color-active)":""}},[e]):null))]):t}const M=t((()=>N.value.length||!e.allowCreate?N.value:B.value?[{[S.value]:B.value,[H.value]:B.value},...N.value]:N.value)),Q=l(),T=t((()=>{if(e.allowCreate)return C.value;const t=Q.multiple&&u(C.value);return M.value.find((e=>t?C.value.includes(e[H.value]):e[H.value]===C.value))?C.value:null}));function X(e){if(e)return W();B.value=""}const Y=o(f),{getSpan:Z}=d();function $(e){return a(k,r({key:D.value,remote:!0,filterable:!0,value:T.value,onUpdateValue:e=>C.value=e,"menu-props":E,"node-props":G,labelField:S.value,valueField:H.value,options:M.value,onSearch:W,"onUpdate:show":X,onFocus:j(P),renderLabel:J},e,Q),y)}return()=>{var e,t;if(!V.value)return $();const o=null!=(t=null==(e=P.value.decoratorProps)?void 0:e.span)?t:6,l=Z(Y,P.value.address);return a("section",{class:"form-render__selectChildField",style:{"--column":l+o}},[$({class:"form-render__selectChildFieldItem",style:{"--form-item-column":o}}),K.value.map((e=>R({option:e,value:C.value,valueKey:H.value,labelKey:S.value,childFieldStrategy:"checked",renderLabel:!1,attrs:{class:"form-render__selectChildFieldItem",style:{"--form-item-column":l}}})))])}}}),S({dataSource:"options"},y,h));export{H as SELECT};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { AnyObject
|
|
1
|
+
import { AnyObject } from '../../../../../es/shared/types';
|
|
2
2
|
import { Path } from '@formily/path';
|
|
3
|
+
import { Ref } from 'vue';
|
|
3
4
|
import { FormOptionItem } from '../../../../../es/components/form-render';
|
|
4
5
|
declare function setSpan(uuid: string, address: Path | string, span?: number): void;
|
|
5
6
|
declare function getSpan(uuid: string, address: Path | string, withSelf?: boolean): number;
|
|
@@ -8,15 +9,17 @@ declare function clearSpan(uuid: string): void;
|
|
|
8
9
|
export declare function useComplexOptions(props: {
|
|
9
10
|
options: AnyObject[];
|
|
10
11
|
value: unknown;
|
|
11
|
-
},
|
|
12
|
-
renderComplexOption: ({ value, option, valueKey, labelKey, childFieldStrategy }: {
|
|
12
|
+
}, valueRef: Ref): {
|
|
13
|
+
renderComplexOption: ({ value, option, valueKey, labelKey, childFieldStrategy, renderLabel, attrs }: {
|
|
13
14
|
value: unknown;
|
|
14
15
|
option: FormOptionItem;
|
|
15
|
-
valueKey
|
|
16
|
-
labelKey
|
|
16
|
+
valueKey?: string | undefined;
|
|
17
|
+
labelKey?: string | undefined;
|
|
17
18
|
childFieldStrategy: 'checked' | 'all';
|
|
19
|
+
renderLabel?: boolean | undefined;
|
|
20
|
+
attrs?: AnyObject | undefined;
|
|
18
21
|
}) => any[];
|
|
19
|
-
valueRef:
|
|
22
|
+
valueRef: Ref<any>;
|
|
20
23
|
hasComplexOption: import("vue").ComputedRef<boolean>;
|
|
21
24
|
};
|
|
22
25
|
export declare function useComplexOptionsSpan(): {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{reactive as e,computed as t,createVNode as r,
|
|
1
|
+
import{reactive as e,computed as t,createVNode as r,mergeProps as n,defineComponent as l,inject as o,provide as a,watch as i,onUnmounted as s,onMounted as c,withModifiers as u}from"vue";import{checkInSetupEnv as d}from"../../../../shared/utils/index.js";import{useField as p,useForm as m,RecursionField as f}from"@formily/vue";import{isArray as v,noop as h}from"lodash-es";import"../../index.js";import{InjectionFormUUID as y,InjectionBusinessCollector as g}from"../constants/index.js";import{useFieldListAdaptor as b}from"./useFieldListAdaptor.js";import{createObjSchema as F}from"../utils/schema.js";const x=e(new Map);function S(e,t,r=0){x.set(e,x.get(e)||{});x.get(e)[t+""]=r}function j(e,t,r=!0){const n=x.get(e);return n?Object.entries(n).reduce(((e,[n,l])=>r&&n===`${t}`||n.startsWith(`${t}.`)?e+l:e),0):0}function O(e,t){const r=x.get(e);r&&Reflect.deleteProperty(r,t+"")}function $(e){x.delete(e)}const k=l({props:{fieldItems:{type:Array,default:()=>[]},childFieldStrategy:{type:String,default:"checked"},name:{type:String,required:!0}},setup(e){const l=o(y),d=o(g),v=p(),x=o(l+"_virtualParent",""),$=`${x?x+".":""}${v.value.address}`;function k(e){return`${$}.${e}`}a(l+"_virtualParent",$);const{schemaAdaptor:E}=b(d);function K(t){var r,n;return Object.assign(t,{"x-decorator-props":{...t["x-decorator-props"],labelPlacement:"left",showFeedback:!1,showLabel:!!t.title},"x-component-props":{...t["x-component-props"],childFieldStrategy:null!=(n=null==(r=t["x-component-props"])?void 0:r.childFieldStrategy)?n:e.childFieldStrategy,size:"small"}})}const P=t((()=>{const t=E(e.fieldItems);return Object.values(t).forEach(K),F(t)}));i(P,(()=>{return e=P.value,void Object.values(e.properties||{}).forEach((e=>{var t;S(l,k(e.name),null==(t=null==e?void 0:e["x-decorator-props"])?void 0:t.span)}));var e}),{immediate:!0});const _=m();function w(){return e.fieldItems.map((e=>_.value.query(e.val_key).take()))}s((()=>{var e;w().forEach((e=>{e&&e.setDisplay("none")})),e=P.value,Object.values(e.properties||{}).forEach((e=>{O(l,k(e.name))}))})),c((()=>{w().forEach((e=>{e&&e.setDisplay("visible")}))}));const I=u(h,["stop"]),A=["onClick","onKeydown","onKeyup","onKeypress"].reduce(((e,t)=>(e[t]=I,e)),{});return()=>{return r("section",n({class:"form-render__labelField",style:{"--column":(e=P.value,Object.values(e.properties||{}).reduce(((e,t)=>e+j(l,k(t.name))),0))}},A),[r(f,{basePath:".",schema:P.value},null)]);var e}}});function E(e,l){d();const o=t((()=>e.options.some((e=>v(e.childrenFields)&&e.childrenFields.length))));function a(e,t,r="value"){if(v(e)?e.includes(t[r]):e===t[r])return v(t.childrenFields)&&t.childrenFields.length}return{renderComplexOption:function({value:e,option:t,valueKey:l="value",labelKey:i="label",childFieldStrategy:s,renderLabel:c=!0,attrs:u}){return[c?t[i]:null,o.value&&("all"===s||a(e,t,l))?r(k,n({fieldItems:t.childrenFields,name:t[l],childFieldStrategy:s},u),null):null]},valueRef:l,hasComplexOption:o}}function K(){return{getSpan:j,setSpan:S,deleteSpan:O,clearSpan:$}}export{E as useComplexOptions,K as useComplexOptionsSpan};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{arrayed as t}from"../../../../shared/utils/index.js";import"../../../../shared/utils/tapable/SyncHook.js";import"../../../../shared/utils/tapable/SyncBailHook.js";import e from"../../../../shared/utils/tapable/SyncWaterfallHook.js";import"../../../../shared/utils/tapable/SyncLoopHook.js";import"../../../../shared/utils/tapable/AsyncParallelHook.js";import"../../../../shared/utils/tapable/AsyncParallelBailHook.js";import"../../../../shared/utils/tapable/AsyncSeriesHook.js";import"../../../../shared/utils/tapable/AsyncSeriesBailHook.js";import"../../../../shared/utils/tapable/AsyncSeriesLoopHook.js";import"../../../../shared/utils/tapable/AsyncSeriesWaterfallHook.js";import{FIELD_BUSINESS_TYPE as l}from"../constants/index.js";function a(){const a=new e(["fieldItem"]);a.tap("__block",(t=>(["CHECKBOX_BLOCK","RADIO_BLOCK"].includes(t.html_type)&&(t.__vertical=!0),t))),a.tap("__age",(e=>("AGE"===e.html_type&&(e.html_type="INPUT_NUMBER",e.reactions=e.reactions?t(e.reactions):[],e.reactions.push({target:e.val_key_unit,fulfill:{state:{disabled:"{{$self.disabled}}"}}}),e.suffixConfig=[{validate:{obj_type:l.AGE_UNIT},val_key:e.val_key_unit,html_type:"SELECT",option:e.option,urlConfig:e.urlConfig}]),e))),a.tap("__multiple_select",(t=>{const{html_type:e,multi_select:l,__multiple:a}=t;return t.__multiple="SEARCH"!==e&&("SEARCH_MORE"===e||("SELECT"===e?"0"===l:a)),t}));const s=[[["SEARCH","PHONE_TYPE","IDCARD_TYPE","SEARCH_MORE"],"SELECT"],["DIGITAL","INPUT_NUMBER"],["CHECKBOX_BLOCK","CHECKBOX"],["RADIO_BLOCK","RADIO"],[["DATE-INPUT","DATETIME-INPUT"],"DATE"],["SWITCH_COMPONENT","SWITCH"],["SLIDER_COMPONENT","SLIDER"],["LEVEL_SEARCH_CASCADE","LEVEL_SEARCH_CASCADER"],["SEARCH_CASCADE","SEARCH_CASCADER"]];
|
|
1
|
+
import{arrayed as t}from"../../../../shared/utils/index.js";import"../../../../shared/utils/tapable/SyncHook.js";import"../../../../shared/utils/tapable/SyncBailHook.js";import e from"../../../../shared/utils/tapable/SyncWaterfallHook.js";import"../../../../shared/utils/tapable/SyncLoopHook.js";import"../../../../shared/utils/tapable/AsyncParallelHook.js";import"../../../../shared/utils/tapable/AsyncParallelBailHook.js";import"../../../../shared/utils/tapable/AsyncSeriesHook.js";import"../../../../shared/utils/tapable/AsyncSeriesBailHook.js";import"../../../../shared/utils/tapable/AsyncSeriesLoopHook.js";import"../../../../shared/utils/tapable/AsyncSeriesWaterfallHook.js";import{FIELD_BUSINESS_TYPE as l}from"../constants/index.js";function a(){const a=new e(["fieldItem"]);a.tap("__block",(t=>(["CHECKBOX_BLOCK","RADIO_BLOCK"].includes(t.html_type)&&(t.__vertical=!0),t))),a.tap("__age",(e=>("AGE"===e.html_type&&(e.html_type="INPUT_NUMBER",e.reactions=e.reactions?t(e.reactions):[],e.reactions.push({target:e.val_key_unit,fulfill:{state:{disabled:"{{$self.disabled}}"}}}),e.suffixConfig=[{validate:{obj_type:l.AGE_UNIT},val_key:e.val_key_unit,html_type:"SELECT",option:e.option,urlConfig:e.urlConfig}]),e))),a.tap("__multiple_select",(t=>{const{html_type:e,multi_select:l,__multiple:a}=t;return t.__multiple="SEARCH"!==e&&("SEARCH_MORE"===e||("SELECT"===e?"0"===l:a)),t}));const s=[[["SEARCH","PHONE_TYPE","IDCARD_TYPE","SEARCH_MORE"],"SELECT"],["DIGITAL","INPUT_NUMBER"],["CHECKBOX_BLOCK","CHECKBOX"],["RADIO_BLOCK","RADIO"],[["DATE-INPUT","DATETIME-INPUT"],"DATE"],["SWITCH_COMPONENT","SWITCH"],["SLIDER_COMPONENT","SLIDER"],["LEVEL_SEARCH_CASCADE","LEVEL_SEARCH_CASCADER"],["SEARCH_CASCADE","SEARCH_CASCADER"]];a.tap("__normalize",(t=>(s.some((([e,l])=>(Array.isArray(e)?e.includes(t.html_type):e===t.html_type)&&(t.html_type=l))),t)));const o=new Map([[["SELECT","SEARCH","SEARCH_MORE"],new Map([["H_TILE",t=>t.html_type=t.__multiple?"CHECKBOX":"RADIO"],["V_TILE",t=>{t.html_type=t.__multiple?"CHECKBOX":"RADIO",t.__vertical=!0}]])],["RADIO",new Map([["DROPDOWN",t=>t.html_type="SELECT"]])],["CHECKBOX",new Map([["DROPDOWN",t=>{t.__multiple=!0,t.html_type="SELECT"}]])]]);return a.tap({stage:9999,name:"__show_mode"},(e=>e.show_mode?([...o].some((([l,a])=>{if(!t(l).includes(e.html_type))return;const s=a.get(e.show_mode);return s&&s(e),!0})),e):e)),{FieldNormalizeWaterfallHook:a}}export{a as useFieldNormalize};
|