cnhis-design-vue 3.1.47-beta.9 → 3.1.47-release.1
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/fabric-chart/src/hooks/surgicalAnesthesia/useSurgicalAnesthesiaChart.js +1 -1
- package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useTop.d.ts +1 -1
- package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useTop.js +1 -1
- package/es/components/fabric-chart/src/interface.d.ts +1 -0
- package/es/components/form-config/index.d.ts +7 -7
- package/es/components/form-config/src/FormConfig.vue.d.ts +7 -7
- package/es/components/form-config/src/components/FormConfigEdit.vue.d.ts +3 -3
- package/es/components/form-render/src/components/renderer/levelSearchCascader.d.ts +2 -2
- package/es/components/form-render/src/components/renderer/radio&checkbox.d.ts +4 -4
- package/es/components/form-render/src/components/renderer/select.d.ts +2 -2
- package/es/components/form-render/src/hooks/useFormRenderOptions.js +1 -1
- package/es/components/form-render/src/types/fieldItem.d.ts +1 -1
- package/es/components/index.css +1 -1
- package/es/components/multi-chat/index.d.ts +3 -3
- package/es/components/multi-chat/src/MultiChat.vue.d.ts +3 -3
- package/es/components/multi-chat/src/MultiChat.vue2.js +1 -1
- package/es/components/scale-view/index.d.ts +28 -0
- package/es/components/scale-view/src/ScaleView.vue.d.ts +28 -0
- package/es/components/scale-view/src/ScaleView.vue2.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 -1
- package/es/components/shortcut-setter/src/ShortcutSetter.vue.d.ts +1 -1
- package/es/components/steps-wheel/index.d.ts +27 -0
- package/es/components/steps-wheel/src/StepsWheel.vue.d.ts +27 -0
- package/es/components/steps-wheel/src/StepsWheel.vue2.js +1 -1
- package/es/components/steps-wheel/src/constants/index.js +1 -1
- package/es/components/steps-wheel/style/index.css +1 -1
- 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 +2 -2
- 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
|
+
```
|
package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useSurgicalAnesthesiaChart.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{ref as t,reactive as e,onMounted as i,nextTick as
|
|
1
|
+
import{ref as t,reactive as e,computed as a,unref as r,onMounted as i,nextTick as l}from"vue";import{defaultBorderStyle as o}from"../useDraw.js";import"../../../../../shared/utils/fabricjs/index.js";import{format as n}from"date-fns";import{getChildrenSize as s}from"../../utils/index.js";import"@vueuse/core";import{cloneDeep as d,range as u}from"lodash-es";import"../temperature/useShadow.js";import{useTop as p}from"./useTop.js";import{useCenter as h}from"./useCenter.js";function m(m,c,v,g){const f=t(),x=t(),w=t(),y=e({show:!1,point:{x:0,y:0},list:[]}),b=e({show:!1,point:{x:0,y:0},list:[],target:null}),C=a((()=>{var t;return null!=(t=c.data.left.width)?t:0})),H=a((()=>s(c.data.top.treeData))),Y=a((()=>{const{xAxis:t}=c.data;return"top"===t.position?t.height:0})),j=function(){const t=d(c.data.top.treeData);let e=0;const{cellWidth:a,cellHeight:r}=c.data.top.tree;return function t(i,l=0){i.forEach((i=>{var o;const n={top:e*r+Y.value,left:l*a,width:a,height:r};if(e++,null==(o=i.children)?void 0:o.length){e--;const a=s(i.children);n.height=a*r,t(i.children,l+1)}else n.width=C.value-n.left;Object.assign(i,n)}))}(t),t}();console.log(j);const D=a((()=>{const{grid:t}=c.data;return t.mainXCell*t.subXCell})),T=a((()=>c.data.top.tree.cellHeight)),M=a((()=>Y.value+T.value*H.value)),X=a((()=>{const t=d(c.data.xAxis),{position:e,spaceValue:a,spaceTimeStamp:r}=t,i=u(D.value/a+1).map((e=>0===e?t.startTime:n(new Date(E.value+e*a*r),"yyyy-MM-dd HH:mm:ss")));return{...t,list:i,left:C.value,top:"top"===e?0:M.value}})),A=a((()=>{const{grid:t}=c.data;return t.mainYCell*t.subYCell})),S=a((()=>{var t;const{width:e,right:a}=c.data;if(!a)return e;return e-(null!=(t=a.width)?t:0)})),G=a((()=>c.data.xAxis.height+T.value*H.value)),W=a((()=>{var t;const{bottom:e=null,height:a}=c.data;if(!e)return a;return a-(null!=(t=e.height)?t:0)})),N=a((()=>(S.value-C.value)/D.value)),P=a((()=>(W.value-G.value)/A.value)),E=a((()=>{var t;return Date.parse((null==(t=c.data.xAxis)?void 0:t.startTime)||n(new Date,"yyyy-MM-dd HH:mm:ss"))})),O=a((()=>X.value.spaceTimeStamp/N.value));console.log("xCellWidth",N.value);const k=e({canvasWidth:c.data.width,canvasHeight:c.data.height,borderStyle:{...o,...c.data.borderStyle||{}},grid:c.data.grid,top:c.data.top,other:c.data.other,topGridYNumber:r(H),topGridYCellHeight:r(T),topGridOriginY:r(Y),topGridEndY:r(M),treeData:j,xAxis:r(X),startTime:r(E),timeXCell:r(O),gridXNumber:r(D),gridYNumber:r(A),xCellWidth:r(N),yCellHeight:r(P),originX:r(C),endX:r(S),originY:r(G),endY:r(W)});return i((async()=>{await l(),p(m,k),h(m,k)})),{propItems:k,redrawPoints:x,select:f,pointTipProps:y,pointMenuProps:b,clickMenu:w}}export{m as useSurgicalAnesthesiaChart};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { type Ref } from 'vue';
|
|
2
2
|
import { fabric } from '../../../../../../es/shared/utils/fabricjs';
|
|
3
3
|
import { AnyObject } from '../../../../../../es/shared/types';
|
|
4
|
-
export declare function useTop(canvas: Ref<fabric.Canvas>, propItems: AnyObject): void;
|
|
4
|
+
export declare function useTop(canvas: Ref<fabric.Canvas>, propItems: AnyObject, emits: Function): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{fabric as t}from"../../../../../shared/utils/fabricjs/index.js";import{drawText as e,defaultStyle as i,drawTextGroup as o}from"../useDraw.js";import{useGrid as r}from"../useGrid.js";import"
|
|
1
|
+
import{fabric as t}from"../../../../../shared/utils/fabricjs/index.js";import{drawText as e,defaultStyle as i,drawTextGroup as n,drawLine as o,drawPoint as l}from"../useDraw.js";import{useGrid as r}from"../useGrid.js";import{useBirthProcessCumputedPoint as s}from"../useCumputedPoint.js";import"@vueuse/core";import"vue";import"lodash-es";import"date-fns";import"../temperature/useShadow.js";function c(c,u,a){const{cumputedX:d}=s(u),{grid:f,originX:h,endX:p,xCellWidth:m,gridXNumber:x,top:g,topList:v,canvasWidth:C,borderStyle:L,treeData:y,xAxis:X,topGridYNumber:Y,topGridOriginY:j,topGridYCellHeight:w,topGridEndY:b}=u,S=new Set;function G(e,{isCustomIcon:i,isContinue:n,isLeft:r}){const{x:s,y1:c,y2:u,halfY:a}=e;if(!s||s<h||s>p)return;const{lineStyle:d}=g.data||{};let f;const x={left:s,top:a};f=i?l("circle",{fill:d.stroke,...x}):n?l(">",{fill:d.stroke,...x,fontSize:18}):o([s,c,s,a],d);const v=new t.Rect({width:m,height:w,fill:"transparent",left:s-m/2,top:c}),C=new t.Group([f,v],{originX:"center",originY:"center",hasControls:!1,hasBorders:!1,objectCaching:!1,lockMovementY:!0});var L;return C.isLeft=r,(L=C).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)}(L),function(t){if(t.centerLine){const e=t.isLeft?{x1:t.left}:{x2:t.left};t.centerLine.setCoords().set(e)}}(L)})),L.on("mouseup",(t=>{t.button})),C}r(c,{...u,gridYNumber:Y,originY:j,yCellHeight:w,endY:b}),function(){const{height:n,list:o,left:l,top:r,spaceValue:s}=X,u=[],a=r+n/2;o.forEach(((t,i)=>{const n=l+i*m*s;u.push(e([n,a],{value:t.slice(11,16)}))}));const d=u.length>0?new t.Group([...u],{...i,objectCaching:!1}):null;d&&c.value.add(d)}(),function(){var e;const l=(null==(e=null==g?void 0:g.tree)?void 0:e.textStyle)||{},r=[];!function t(e){e.forEach((e=>{var i;const{width:s,height:c,left:u,top:a,title:f=""}=e,m={value:f,...l};(null==(i=e.children)?void 0:i.length)?(m.value=f.split("").join("\n"),t(e.children)):(m.textAlign="left",function(t){if(!(null==t?void 0:t.data)||!Array.isArray(t.data))return;const{lineStyle:e,textStyle:i,totalStyle:n}=g.data||{},l=t.top,r=l+w,s=r-w/2,c={y1:l,y2:r,halfY:s},u=[];function a(t){const{startLine:e,endLine:i}=u[t],{startLine:n,endLine:o}=u[t-1]||{};if(e){const t={x1:h,x2:i?i.left:p};o?(t.x1=o.left,o.limitX.x2=e.left):n&&(t.x1=n.left,n.limitX.x2=e.left),e.limitX=t}if(i){const t={x1:e?e.left:h,x2:p};i.limitX=t}}t.data.forEach(((t,i,n)=>{const{time:l,continue:r,value:f}=t,[m,x]=l,g=m&&d(m),v=x&&d(x),C=G({...c,x:g},{isCustomIcon:!v&&!r,isContinue:!1,isLeft:!0}),L=G({...c,x:v},{isCustomIcon:!1,isContinue:!!r});let y;if((C||g<h)&&(L||v>p)){y=o([C?g:h,s,L?v:p,s],e)}u.push({startLine:C,centerLine:y,endLine:L}),a(i),y&&(C&&(C.centerLine=y),L&&(L.centerLine=y),S.add(y)),C&&S.add(C),L&&S.add(L)}))}(e)),r.push(n({width:s,height:c,...L},m,{left:u,top:a},!0))}))}(y);const s=r.length>0?new t.Group([...r],{...i,objectCaching:!1}):null;s&&c.value.add(s),S.size&&c.value.add(...S)}()}export{c as useTop};
|
|
@@ -141,7 +141,7 @@ declare const FormConfig: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
141
141
|
level_key?: string | undefined;
|
|
142
142
|
link_key?: string | undefined;
|
|
143
143
|
link_key_split?: string | undefined;
|
|
144
|
-
show_key?: string[] | undefined;
|
|
144
|
+
show_key?: string | string[] | undefined;
|
|
145
145
|
conObj?: import("../../../es/shared/types").AnyObject[] | undefined;
|
|
146
146
|
conObjFirstLevel?: import("../../../es/shared/types").AnyObject[] | undefined;
|
|
147
147
|
setting?: {
|
|
@@ -1861,7 +1861,7 @@ declare const FormConfig: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
1861
1861
|
level_key?: string | undefined;
|
|
1862
1862
|
link_key?: string | undefined;
|
|
1863
1863
|
link_key_split?: string | undefined;
|
|
1864
|
-
show_key?: string[] | undefined;
|
|
1864
|
+
show_key?: string | string[] | undefined;
|
|
1865
1865
|
conObj?: import("../../../es/shared/types").AnyObject[] | undefined;
|
|
1866
1866
|
conObjFirstLevel?: import("../../../es/shared/types").AnyObject[] | undefined;
|
|
1867
1867
|
setting?: {
|
|
@@ -3590,7 +3590,7 @@ declare const FormConfig: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
3590
3590
|
level_key?: string | undefined;
|
|
3591
3591
|
link_key?: string | undefined;
|
|
3592
3592
|
link_key_split?: string | undefined;
|
|
3593
|
-
show_key?: string[] | undefined;
|
|
3593
|
+
show_key?: string | string[] | undefined;
|
|
3594
3594
|
conObj?: import("../../../es/shared/types").AnyObject[] | undefined;
|
|
3595
3595
|
conObjFirstLevel?: import("../../../es/shared/types").AnyObject[] | undefined;
|
|
3596
3596
|
setting?: {
|
|
@@ -5310,7 +5310,7 @@ declare const FormConfig: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
5310
5310
|
level_key?: string | undefined;
|
|
5311
5311
|
link_key?: string | undefined;
|
|
5312
5312
|
link_key_split?: string | undefined;
|
|
5313
|
-
show_key?: string[] | undefined;
|
|
5313
|
+
show_key?: string | string[] | undefined;
|
|
5314
5314
|
conObj?: import("../../../es/shared/types").AnyObject[] | undefined;
|
|
5315
5315
|
conObjFirstLevel?: import("../../../es/shared/types").AnyObject[] | undefined;
|
|
5316
5316
|
setting?: {
|
|
@@ -8006,7 +8006,7 @@ declare const FormConfig: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
8006
8006
|
level_key?: string | undefined;
|
|
8007
8007
|
link_key?: string | undefined;
|
|
8008
8008
|
link_key_split?: string | undefined;
|
|
8009
|
-
show_key?: string[] | undefined;
|
|
8009
|
+
show_key?: string | string[] | undefined;
|
|
8010
8010
|
conObj?: import("../../../es/shared/types").AnyObject[] | undefined;
|
|
8011
8011
|
conObjFirstLevel?: import("../../../es/shared/types").AnyObject[] | undefined;
|
|
8012
8012
|
setting?: {
|
|
@@ -9737,7 +9737,7 @@ declare const FormConfig: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
9737
9737
|
level_key?: string | undefined;
|
|
9738
9738
|
link_key?: string | undefined;
|
|
9739
9739
|
link_key_split?: string | undefined;
|
|
9740
|
-
show_key?: string[] | undefined;
|
|
9740
|
+
show_key?: string | string[] | undefined;
|
|
9741
9741
|
conObj?: import("../../../es/shared/types").AnyObject[] | undefined;
|
|
9742
9742
|
conObjFirstLevel?: import("../../../es/shared/types").AnyObject[] | undefined;
|
|
9743
9743
|
setting?: {
|
|
@@ -11441,7 +11441,7 @@ declare const FormConfig: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
11441
11441
|
level_key?: string | undefined;
|
|
11442
11442
|
link_key?: string | undefined;
|
|
11443
11443
|
link_key_split?: string | undefined;
|
|
11444
|
-
show_key?: string[] | undefined;
|
|
11444
|
+
show_key?: string | string[] | undefined;
|
|
11445
11445
|
conObj?: import("../../../es/shared/types").AnyObject[] | undefined;
|
|
11446
11446
|
conObjFirstLevel?: import("../../../es/shared/types").AnyObject[] | undefined;
|
|
11447
11447
|
setting?: {
|
|
@@ -143,7 +143,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
143
143
|
level_key?: string | undefined;
|
|
144
144
|
link_key?: string | undefined;
|
|
145
145
|
link_key_split?: string | undefined;
|
|
146
|
-
show_key?: string[] | undefined;
|
|
146
|
+
show_key?: string | string[] | undefined;
|
|
147
147
|
conObj?: import("../../../../es/shared/types").AnyObject[] | undefined;
|
|
148
148
|
conObjFirstLevel?: import("../../../../es/shared/types").AnyObject[] | undefined;
|
|
149
149
|
setting?: {
|
|
@@ -1863,7 +1863,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
1863
1863
|
level_key?: string | undefined;
|
|
1864
1864
|
link_key?: string | undefined;
|
|
1865
1865
|
link_key_split?: string | undefined;
|
|
1866
|
-
show_key?: string[] | undefined;
|
|
1866
|
+
show_key?: string | string[] | undefined;
|
|
1867
1867
|
conObj?: import("../../../../es/shared/types").AnyObject[] | undefined;
|
|
1868
1868
|
conObjFirstLevel?: import("../../../../es/shared/types").AnyObject[] | undefined;
|
|
1869
1869
|
setting?: {
|
|
@@ -3592,7 +3592,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
3592
3592
|
level_key?: string | undefined;
|
|
3593
3593
|
link_key?: string | undefined;
|
|
3594
3594
|
link_key_split?: string | undefined;
|
|
3595
|
-
show_key?: string[] | undefined;
|
|
3595
|
+
show_key?: string | string[] | undefined;
|
|
3596
3596
|
conObj?: import("../../../../es/shared/types").AnyObject[] | undefined;
|
|
3597
3597
|
conObjFirstLevel?: import("../../../../es/shared/types").AnyObject[] | undefined;
|
|
3598
3598
|
setting?: {
|
|
@@ -5312,7 +5312,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
5312
5312
|
level_key?: string | undefined;
|
|
5313
5313
|
link_key?: string | undefined;
|
|
5314
5314
|
link_key_split?: string | undefined;
|
|
5315
|
-
show_key?: string[] | undefined;
|
|
5315
|
+
show_key?: string | string[] | undefined;
|
|
5316
5316
|
conObj?: import("../../../../es/shared/types").AnyObject[] | undefined;
|
|
5317
5317
|
conObjFirstLevel?: import("../../../../es/shared/types").AnyObject[] | undefined;
|
|
5318
5318
|
setting?: {
|
|
@@ -8008,7 +8008,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
8008
8008
|
level_key?: string | undefined;
|
|
8009
8009
|
link_key?: string | undefined;
|
|
8010
8010
|
link_key_split?: string | undefined;
|
|
8011
|
-
show_key?: string[] | undefined;
|
|
8011
|
+
show_key?: string | string[] | undefined;
|
|
8012
8012
|
conObj?: import("../../../../es/shared/types").AnyObject[] | undefined;
|
|
8013
8013
|
conObjFirstLevel?: import("../../../../es/shared/types").AnyObject[] | undefined;
|
|
8014
8014
|
setting?: {
|
|
@@ -9739,7 +9739,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
9739
9739
|
level_key?: string | undefined;
|
|
9740
9740
|
link_key?: string | undefined;
|
|
9741
9741
|
link_key_split?: string | undefined;
|
|
9742
|
-
show_key?: string[] | undefined;
|
|
9742
|
+
show_key?: string | string[] | undefined;
|
|
9743
9743
|
conObj?: import("../../../../es/shared/types").AnyObject[] | undefined;
|
|
9744
9744
|
conObjFirstLevel?: import("../../../../es/shared/types").AnyObject[] | undefined;
|
|
9745
9745
|
setting?: {
|
|
@@ -11443,7 +11443,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
11443
11443
|
level_key?: string | undefined;
|
|
11444
11444
|
link_key?: string | undefined;
|
|
11445
11445
|
link_key_split?: string | undefined;
|
|
11446
|
-
show_key?: string[] | undefined;
|
|
11446
|
+
show_key?: string | string[] | undefined;
|
|
11447
11447
|
conObj?: import("../../../../es/shared/types").AnyObject[] | undefined;
|
|
11448
11448
|
conObjFirstLevel?: import("../../../../es/shared/types").AnyObject[] | undefined;
|
|
11449
11449
|
setting?: {
|
|
@@ -96,7 +96,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
96
96
|
level_key?: string | undefined;
|
|
97
97
|
link_key?: string | undefined;
|
|
98
98
|
link_key_split?: string | undefined;
|
|
99
|
-
show_key?: string[] | undefined;
|
|
99
|
+
show_key?: string | string[] | undefined;
|
|
100
100
|
conObj?: import("../../../../../es/shared/types").AnyObject[] | undefined;
|
|
101
101
|
conObjFirstLevel?: import("../../../../../es/shared/types").AnyObject[] | undefined;
|
|
102
102
|
setting?: {
|
|
@@ -1827,7 +1827,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
1827
1827
|
level_key?: string | undefined;
|
|
1828
1828
|
link_key?: string | undefined;
|
|
1829
1829
|
link_key_split?: string | undefined;
|
|
1830
|
-
show_key?: string[] | undefined;
|
|
1830
|
+
show_key?: string | string[] | undefined;
|
|
1831
1831
|
conObj?: import("../../../../../es/shared/types").AnyObject[] | undefined;
|
|
1832
1832
|
conObjFirstLevel?: import("../../../../../es/shared/types").AnyObject[] | undefined;
|
|
1833
1833
|
setting?: {
|
|
@@ -3531,7 +3531,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
3531
3531
|
level_key?: string | undefined;
|
|
3532
3532
|
link_key?: string | undefined;
|
|
3533
3533
|
link_key_split?: string | undefined;
|
|
3534
|
-
show_key?: string[] | undefined;
|
|
3534
|
+
show_key?: string | string[] | undefined;
|
|
3535
3535
|
conObj?: import("../../../../../es/shared/types").AnyObject[] | undefined;
|
|
3536
3536
|
conObjFirstLevel?: import("../../../../../es/shared/types").AnyObject[] | undefined;
|
|
3537
3537
|
setting?: {
|
|
@@ -40,7 +40,7 @@ export declare const LEVEL_SEARCH_CASCADER: import("vue").DefineComponent<{
|
|
|
40
40
|
level_key: string;
|
|
41
41
|
link_key: string;
|
|
42
42
|
link_key_split: string;
|
|
43
|
-
show_key: string[];
|
|
43
|
+
show_key: string | string[];
|
|
44
44
|
conObj: AnyObject[];
|
|
45
45
|
conObjFirstLevel: AnyObject[];
|
|
46
46
|
setting: Partial<{
|
|
@@ -95,7 +95,7 @@ export declare const LEVEL_SEARCH_CASCADER: import("vue").DefineComponent<{
|
|
|
95
95
|
level_key: string;
|
|
96
96
|
link_key: string;
|
|
97
97
|
link_key_split: string;
|
|
98
|
-
show_key: string[];
|
|
98
|
+
show_key: string | string[];
|
|
99
99
|
conObj: AnyObject[];
|
|
100
100
|
conObjFirstLevel: AnyObject[];
|
|
101
101
|
setting: Partial<{
|
|
@@ -41,7 +41,7 @@ export declare const RADIO: import("vue").DefineComponent<{
|
|
|
41
41
|
level_key: string;
|
|
42
42
|
link_key: string;
|
|
43
43
|
link_key_split: string;
|
|
44
|
-
show_key: string[];
|
|
44
|
+
show_key: string | string[];
|
|
45
45
|
conObj: AnyObject[];
|
|
46
46
|
conObjFirstLevel: AnyObject[];
|
|
47
47
|
setting: Partial<{
|
|
@@ -103,7 +103,7 @@ export declare const RADIO: import("vue").DefineComponent<{
|
|
|
103
103
|
level_key: string;
|
|
104
104
|
link_key: string;
|
|
105
105
|
link_key_split: string;
|
|
106
|
-
show_key: string[];
|
|
106
|
+
show_key: string | string[];
|
|
107
107
|
conObj: AnyObject[];
|
|
108
108
|
conObjFirstLevel: AnyObject[];
|
|
109
109
|
setting: Partial<{
|
|
@@ -177,7 +177,7 @@ export declare const CHECKBOX: import("vue").DefineComponent<{
|
|
|
177
177
|
level_key: string;
|
|
178
178
|
link_key: string;
|
|
179
179
|
link_key_split: string;
|
|
180
|
-
show_key: string[];
|
|
180
|
+
show_key: string | string[];
|
|
181
181
|
conObj: AnyObject[];
|
|
182
182
|
conObjFirstLevel: AnyObject[];
|
|
183
183
|
setting: Partial<{
|
|
@@ -239,7 +239,7 @@ export declare const CHECKBOX: import("vue").DefineComponent<{
|
|
|
239
239
|
level_key: string;
|
|
240
240
|
link_key: string;
|
|
241
241
|
link_key_split: string;
|
|
242
|
-
show_key: string[];
|
|
242
|
+
show_key: string | string[];
|
|
243
243
|
conObj: AnyObject[];
|
|
244
244
|
conObjFirstLevel: AnyObject[];
|
|
245
245
|
setting: Partial<{
|
|
@@ -49,7 +49,7 @@ export declare const SELECT: import("vue").DefineComponent<{
|
|
|
49
49
|
level_key: string;
|
|
50
50
|
link_key: string;
|
|
51
51
|
link_key_split: string;
|
|
52
|
-
show_key: string[];
|
|
52
|
+
show_key: string | string[];
|
|
53
53
|
conObj: AnyObject[];
|
|
54
54
|
conObjFirstLevel: AnyObject[];
|
|
55
55
|
setting: Partial<{
|
|
@@ -131,7 +131,7 @@ export declare const SELECT: import("vue").DefineComponent<{
|
|
|
131
131
|
level_key: string;
|
|
132
132
|
link_key: string;
|
|
133
133
|
link_key_split: string;
|
|
134
|
-
show_key: string[];
|
|
134
|
+
show_key: string | string[];
|
|
135
135
|
conObj: AnyObject[];
|
|
136
136
|
conObjFirstLevel: AnyObject[];
|
|
137
137
|
setting: Partial<{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{checkInSetupEnv as e,jsonParse as n}from"../../../../shared/utils/index.js";import{useForm as t}from"@formily/vue";import{useMemoize as l,useDebounceFn as u}from"@vueuse/core";import{identity as o,uniqBy as r,isString as a,isEqual as i,
|
|
1
|
+
import{checkInSetupEnv as e,jsonParse as n}from"../../../../shared/utils/index.js";import{useForm as t}from"@formily/vue";import{useMemoize as l,useDebounceFn as u}from"@vueuse/core";import{identity as o,uniqBy as r,isString as a,isEqual as i,isArray as c,omit as s,isFunction as v}from"lodash-es";import{computed as m,inject as f,ref as d,toRaw as y,watch as p}from"vue";import"../../index.js";import{InjectionAsyncQueue as h,InjectionFormLifeCycleCaller as g,InjectionFormItemDepsCollector as w}from"../constants/index.js";import{createUrlConfigParams as k,formRenderLog as b,keywordMatcher as R}from"../utils/index.js";import{useFormField as C}from"./useFormField.js";import{useFormRequest as F}from"./useFormRequest.js";function K(e,n){const t=d();return m({get:()=>t.value?t.value:e[n],set(e){t.value=e}})}const q=(()=>{const e=l((e=>new RegExp(`(.*)${e.split("").map((e=>`(${function(e){return e.match(/[()\[\]{}$^\/]/)?"\\"+e:e}(e)})`)).join("(.*)")}(.*)`)),{getKey:o});return(n,t)=>t.match(e(n))})();function O(){const e=d();return{searchContent:e,optionSearchFilter:function(n,t,l){if(!e.value)return n;const u=c(l)?l.filter((e=>e&&a(e))):[];return n.filter((n=>function(n,t,l){if(!e.value)return!0;const u=n?n[t]:"";return!!a(u)&&(!!q(e.value,u)||!!R(e.value,n.keyword)||!!l.length&&l.some((t=>a(n[t])&&n[t].includes(e.value))))}(n,t,u)))}}}function j(e,t,l,u,o){const a=K(e,"commonList"),i=K(e,"recentList"),{searchContent:c,optionSearchFilter:d}=O();function y(e){return n(e.itemObj)}const p=m((()=>{var e,n;return null!=(n=null==(e=a.value)?void 0:e.map(y))?n:[]})),g=m((()=>{var e,n;return null!=(n=null==(e=i.value)?void 0:e.map(y))?n:[]})),w=m((()=>{if(!e.recommend||!p.value.length&&!g.value.length)return t.value;const n=r(p.value.concat(g.value),(e=>e[o.value])),l=t.value.filter((e=>n.every((function(n){return n[o.value]!==e[o.value]}))));return[...d(n,u.value),...l]})),{getRecommendRequestInfo:k,getHttpInstance:b}=F();function R(n){const{url:t,getRecommendIds:l}=k(),u=v(l)?l():{},o=v(e.getRecommendInfo)?e.getRecommendInfo():{};return{url:t[n],info:Object.assign({},u,o)}}const{fieldKey:q}=C(),j=f(h);return{postRecommend:async function(n){if(!e.recommend)return;const t=b();if(!t)return;const{url:u,info:r}=R("post"),a=w.value.find((e=>e[o.value]===n));a&&l("postRecommend",await t.post(u,{...r,keyword:"",itemId:o.value,itemObj:JSON.stringify(a)}))},getRecommend:async function(n){if(!e.recommend)return;if(c.value=n,a.value&&i.value&&e.recommendCache)return;const t=await j.addAsync(function(n,t){const{url:l,info:u}=R("get");return{url:l,method:"get",key:n,cache:t,params:{...u,recNum:Math.max(e.commonNum,e.recentNum),keyword:""}}}(q.value,e.recommendCache)),{commonly:l,recently:u}=t.reduce(((e,n)=>("commonly"===n.type?e.commonly.push(s(n,["type"])):"recently"===n.type&&e.recently.push(s(n,["type"])),e)),{commonly:[],recently:[]});a.value=l.slice(0,e.commonNum),i.value=u.slice(0,e.recentNum)},sortedOptions:w}}function I(n,t){e();const l=f(h),o=f(g),r=m((()=>{var e,t,l;return null!=(l=null!=(t=null==(e=n.urlConfig)?void 0:e.nameKey)?t:n.labelField)?l:"text"})),c=m((()=>{var e,t,l;return null!=(l=null!=(t=null==(e=n.urlConfig)?void 0:e.valueKey)?t:n.valueField)?l:"value"})),{searchContent:s,optionSearchFilter:v}=O(),R=d(null),{field:F,fieldKey:K}=C(),q=u((async function(e){if(s.value=e||"",!n.urlConfig)return R.value=null;try{const e=await l.addAsync(await k({config:n.urlConfig,cache:n.requestCache,field:F.value}));y(R.value)!==e&&(R.value=e,o("afterOptionInit",[K.value,R.value]))}catch(e){a(e)&&b(e)}}),300),j=m((()=>R.value?v(R.value,r.value):Array.isArray(n.options)?v(n.options,r.value):[])),I=m((()=>R.value||n.options||[])),x=f(w);return p((()=>n.urlConfig),((e,l)=>{if(!i(e,l)){if(R.value=null,!e)return R.value=null;x.setDeps(K.value,e.dependKey||[],(async()=>{R.value=null,t.value=null,!n.lazyRequest&&await q()})),(t.value||!n.lazyRequest)&&q()}}),{immediate:!0}),{labelKey:r,valueKey:c,filterOptions:j,fullOptions:I,fetchData:q}}function x(n,l){e();const o=f(h),r=f(g),s=t(),v=m((()=>{var e,t,l,u;const o=null==(t=null==(e=n.wordbook)?void 0:e.render_key)?void 0:t[0];if(a(o))return o;let r=null==(l=n.wordbook)?void 0:l.show_key;return c(r)&&(r=r[0]),a(r)?r:null!=(u=n.labelField)?u:"text"})),k=m((()=>{var e,t,l;return null!=(l=null!=(t=null==(e=n.wordbook)?void 0:e.value_key)?t:n.valueField)?l:"value"})),R=m((()=>{var e;return(null==(e=n.wordbook)?void 0:e.search_key)||[]})),{searchContent:K,optionSearchFilter:q}=O(),j=d(null),{fieldKey:I}=C(),{getSearchRequestInfo:x}=F(),A=u((async function(e){if(K.value=e||"",!n.autograph||!n.wordbook)return j.value=null;try{const e=await o.addAsync(function(e,t,l){var u,o,r;const a={autograph:t,wordbookId:e.id,wordbookType:e.type,fieldKeys:e.search_key,keyword:"",page:1};if(null==(u=e.queryParams)?void 0:u.length){const n=null!=(r=null==(o=s.value)?void 0:o.getFormState().values)?r:{};e.queryParams.forEach((e=>{a[e]=n[e]}))}return console.log(a),{...x(),params:a,key:l,cache:n.requestCache}}(n.wordbook,n.autograph,I.value));y(j.value)!==e&&(j.value=e,r("afterOptionInit",[I.value,j.value]))}catch(e){a(e)&&b(e)}}),300),S=m((()=>j.value?q(j.value,v.value,R.value):Array.isArray(n.options)?q(n.options,v.value):[])),N=m((()=>j.value||n.options||[])),_=f(w);return p((()=>n.wordbook),((e,t)=>{if(!i(e,t)){if(j.value=null,!e)return j.value=null;_.setDeps(I.value,e.queryParams||[],(async()=>{j.value=null,A()})),(l.value||!n.lazyRequest)&&A()}}),{immediate:!0}),{labelKey:v,valueKey:k,filterOptions:S,fullOptions:N,fetchData:A}}export{q as searchContentMatcher,x as useAutographOptions,j as useRecommendOptions,I as useUrlConfigOptions};
|