cnhis-design-vue 3.1.19-beta.2 → 3.1.19-beta.4
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 +123 -0
- package/es/components/big-table/index.d.ts +1 -1
- package/es/components/big-table/src/BigTable.vue.d.ts +1 -1
- package/es/components/big-table/src/components/edit-form/edit-date.js +2 -1
- package/es/components/big-table/src/hooks/useEvent2.js +18 -24
- package/es/components/button-print/index.d.ts +1 -1
- package/es/components/button-print/src/ButtonPrint.vue.d.ts +1 -1
- package/es/components/button-print/src/components/IdentityVerification.vue.d.ts +1 -1
- package/es/components/drag-layout/index.d.ts +1 -1
- package/es/components/drag-layout/src/DragLayout.vue.d.ts +1 -1
- package/es/components/fabric-chart/index.d.ts +1 -1
- package/es/components/fabric-chart/src/FabricChart.vue.d.ts +1 -1
- package/es/components/fabric-chart/src/hooks/useCumputedPoint.d.ts +1 -1
- package/es/components/fabric-chart/src/hooks/useCumputedPoint2.js +2 -2
- package/es/components/fabric-chart/src/hooks/useOther2.js +18 -14
- package/es/components/form-config/index.d.ts +10 -3
- package/es/components/form-config/src/FormConfig.vue.d.ts +10 -3
- package/es/components/form-config/src/components/FormConfigCreator.vue.d.ts +1 -1
- package/es/components/form-config/src/components/FormConfigEdit.vue.d.ts +9 -2
- package/es/components/form-render/index.d.ts +1 -1
- package/es/components/form-render/index2.js +1 -0
- package/es/components/form-render/src/FormRender.js +3 -3
- package/es/components/form-render/src/FormRender.vue.d.ts +1 -1
- package/es/components/form-render/src/components/renderer/cascader.d.ts +9 -2
- package/es/components/form-render/src/components/renderer/cascader.js +39 -5
- package/es/components/form-render/src/components/renderer/index.d.ts +1 -0
- package/es/components/form-render/src/components/renderer/index.js +1 -0
- package/es/components/form-render/src/components/renderer/index2.js +1 -0
- package/es/components/form-render/src/components/renderer/inputGroup.d.ts +1 -1
- package/es/components/form-render/src/components/renderer/search.d.ts +48 -0
- package/es/components/form-render/src/components/renderer/search.js +172 -0
- package/es/components/form-render/src/components/renderer/select.d.ts +3 -3
- package/es/components/form-render/src/components/renderer/select.js +4 -11
- package/es/components/form-render/src/hooks/useFieldListAdaptor2.js +23 -6
- package/es/components/form-render/src/hooks/useFormContext2.js +2 -10
- package/es/components/form-render/src/hooks/useFormRequest.d.ts +10 -0
- package/es/components/form-render/src/hooks/useFormRequest2.js +8 -1
- package/es/components/form-render/src/types/fieldItem.d.ts +16 -4
- package/es/components/form-render/src/utils/index.d.ts +1 -0
- package/es/components/form-render/src/utils/index.js +24 -1
- package/es/components/form-render/src/utils/schema.d.ts +3 -1
- package/es/components/form-render/src/utils/schema.js +1 -1
- package/es/components/form-render/src/utils/schema2.js +9 -1
- package/es/components/form-table/index.d.ts +1 -1
- package/es/components/form-table/src/FormTable.vue.d.ts +1 -1
- package/es/components/form-table/src/components/index.d.ts +1 -1
- package/es/components/form-table/src/components/table-age.vue.d.ts +1 -1
- package/es/components/grid/src/hooks2.js +1 -0
- package/es/components/index.css +1 -1
- package/es/components/info-header/index.d.ts +1 -1
- package/es/components/info-header/src/InfoHeader.vue.d.ts +1 -1
- package/es/components/scale-view/index.d.ts +1 -1
- package/es/components/scale-view/src/ScaleView.vue.d.ts +1 -1
- package/es/components/scale-view/src/hooks/use-component.d.ts +2 -2
- package/es/components/select-label/index.d.ts +4 -4
- package/es/components/select-label/src/LabelFormContent.vue.d.ts +2 -2
- package/es/components/select-label/src/SelectLabel.vue.d.ts +2 -2
- package/es/components/select-person/index.d.ts +1 -1
- package/es/components/select-person/src/SelectPerson.vue.d.ts +1 -1
- package/es/components/shortcut-setter/index.d.ts +9 -2
- package/es/components/shortcut-setter/src/ShortcutSetter.vue.d.ts +9 -2
- package/es/components/steps-wheel/index.d.ts +30 -0
- package/es/components/steps-wheel/src/StepsWheel.js +152 -103
- package/es/components/steps-wheel/src/StepsWheel.vue.d.ts +30 -0
- package/es/components/steps-wheel/style/index.css +1 -1
- package/es/components/time-line/index.d.ts +1 -1
- package/es/components/time-line/src/TimeLine.vue.d.ts +1 -1
- package/package.json +6 -5
package/README.md
ADDED
|
@@ -0,0 +1,123 @@
|
|
|
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. 注意
|
|
65
|
+
|
|
66
|
+
由于 vxe-table 目前的引入方式是由组件 install 触发的,所以如果需要使用 c-grid/c-big-table 组件,需要全局注册二者任意一个
|
|
67
|
+
|
|
68
|
+
```typescript
|
|
69
|
+
// main.ts
|
|
70
|
+
import { createApp } from 'vue';
|
|
71
|
+
import App from './App.vue';
|
|
72
|
+
|
|
73
|
+
import { CGrid } from 'cnhis-design-vue';
|
|
74
|
+
// 或者
|
|
75
|
+
import { CBigTable } from 'cnhis-design-vue';
|
|
76
|
+
|
|
77
|
+
const app = createApp(App);
|
|
78
|
+
app.use(CGrid);
|
|
79
|
+
// 或者
|
|
80
|
+
app.use(CBigTable);
|
|
81
|
+
app.mount('#app');
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
## 4.FAQ
|
|
85
|
+
|
|
86
|
+
### 4.1 项目打包后样式丢失
|
|
87
|
+
|
|
88
|
+
> 处理方法, 将 cnhis-design-vue 从 vendor 包中移除
|
|
89
|
+
|
|
90
|
+
```typescript
|
|
91
|
+
// vite.config.ts
|
|
92
|
+
import { defineConfig } from 'vite';
|
|
93
|
+
|
|
94
|
+
export default defineConfig({
|
|
95
|
+
rollupOptions: {
|
|
96
|
+
// ..otherOptions
|
|
97
|
+
output: {
|
|
98
|
+
dir: './dist',
|
|
99
|
+
manualChunks(id: string) {
|
|
100
|
+
if (id.includes('node_modules') && !id.includes('cnhis-design-vue')) {
|
|
101
|
+
return 'vendor';
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
});
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
### 4.2 找不到文件
|
|
110
|
+
|
|
111
|
+
> 由于组件库输出文件类型由 js 修改成了 mjs, 如果配置了 resolve 属性的项目, 需要将 mjs 文件类型添加至 extensions 中
|
|
112
|
+
|
|
113
|
+
```javascript
|
|
114
|
+
// vite.config.ts
|
|
115
|
+
const config = {
|
|
116
|
+
// ...otherOptions
|
|
117
|
+
resolve: {
|
|
118
|
+
// ...otherOptions
|
|
119
|
+
// 如果没有配置, 则不用考虑
|
|
120
|
+
extensions: ['.js', '.ts', '.vue', '.json', '.mjs']
|
|
121
|
+
}
|
|
122
|
+
};
|
|
123
|
+
```
|
|
@@ -883,7 +883,7 @@ declare const BigTable: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
883
883
|
style: import("vue").Ref<string | import("vue").CSSProperties | undefined>;
|
|
884
884
|
class: import("vue").Ref<string | undefined>;
|
|
885
885
|
mergedClsPrefix: import("vue").Ref<string>;
|
|
886
|
-
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin,
|
|
886
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
887
887
|
readonly tab: import("vue").PropType<string | number | import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
888
888
|
[key: string]: any;
|
|
889
889
|
}> | (() => import("vue").VNodeChild)>;
|
|
@@ -881,7 +881,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
881
881
|
style: import("vue").Ref<string | import("vue").CSSProperties | undefined>;
|
|
882
882
|
class: import("vue").Ref<string | undefined>;
|
|
883
883
|
mergedClsPrefix: import("vue").Ref<string>;
|
|
884
|
-
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin,
|
|
884
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
885
885
|
readonly tab: import("vue").PropType<string | number | import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
886
886
|
[key: string]: any;
|
|
887
887
|
}> | (() => import("vue").VNodeChild)>;
|
|
@@ -108,7 +108,8 @@ var EditDate = defineComponent({
|
|
|
108
108
|
};
|
|
109
109
|
}
|
|
110
110
|
const formatConfig = computed(() => {
|
|
111
|
-
|
|
111
|
+
var _a;
|
|
112
|
+
const valueFormat = ((_a = props.col.componentProps) == null ? void 0 : _a.valueFormat) || props.col.valueFormat || "yyyy-MM-dd HH:mm:ss";
|
|
112
113
|
return {
|
|
113
114
|
valueFormat,
|
|
114
115
|
format: valueFormat,
|
|
@@ -16,14 +16,20 @@ const useEvent = (props, state, emit, xGrid, anchorEvent) => {
|
|
|
16
16
|
let activeIndex = index || 0;
|
|
17
17
|
if (!activeRow && !isEdit)
|
|
18
18
|
return;
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
19
|
+
if (isEdit) {
|
|
20
|
+
setTimeout(() => {
|
|
21
|
+
const { row, column, $rowIndex } = xGridRef.getSelectedCell() || {};
|
|
22
|
+
row && emit("keyboard", {
|
|
23
|
+
key: $event.key,
|
|
24
|
+
index: $rowIndex,
|
|
25
|
+
row,
|
|
26
|
+
column
|
|
27
|
+
});
|
|
28
|
+
["Tab", "Enter"].includes($event.key) && xGridRef.setEditCell(row, column);
|
|
24
29
|
});
|
|
30
|
+
return;
|
|
25
31
|
}
|
|
26
|
-
if (isArrow &&
|
|
32
|
+
if (isArrow && ["ArrowUp", "ArrowDown"].includes($event.key)) {
|
|
27
33
|
if ($event.key === "ArrowUp" && index > 0) {
|
|
28
34
|
activeIndex = index - 1;
|
|
29
35
|
}
|
|
@@ -33,32 +39,20 @@ const useEvent = (props, state, emit, xGrid, anchorEvent) => {
|
|
|
33
39
|
const row = xGridRef.getData(activeIndex);
|
|
34
40
|
xGridRef.scrollToRow(row);
|
|
35
41
|
xGridRef.setCurrentRow(row);
|
|
36
|
-
emitKeyBoard();
|
|
37
|
-
return;
|
|
38
42
|
}
|
|
39
43
|
if (isChecked && $event.key === " ") {
|
|
40
44
|
$event.preventDefault();
|
|
41
45
|
xGridRef.scrollToRow(activeRow);
|
|
42
46
|
xGridRef.setCheckboxRow(activeRow, true);
|
|
43
|
-
emitKeyBoard();
|
|
44
|
-
return;
|
|
45
47
|
}
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
index: $rowIndex,
|
|
53
|
-
row,
|
|
54
|
-
column
|
|
55
|
-
});
|
|
56
|
-
xGridRef.scrollToRow(row);
|
|
57
|
-
xGridRef.setEditCell(row, column);
|
|
48
|
+
emitKeyBoard();
|
|
49
|
+
function emitKeyBoard() {
|
|
50
|
+
emit("keyboard", {
|
|
51
|
+
key: $event.key,
|
|
52
|
+
index: activeIndex,
|
|
53
|
+
row: xGridRef.getCurrentRecord()
|
|
58
54
|
});
|
|
59
|
-
return;
|
|
60
55
|
}
|
|
61
|
-
emitKeyBoard();
|
|
62
56
|
}
|
|
63
57
|
let scrollEvent = (params) => {
|
|
64
58
|
emit("scroll", params);
|
|
@@ -383,7 +383,7 @@ declare const ButtonPrint: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
383
383
|
key: string;
|
|
384
384
|
render: () => import("vue").VNodeChild;
|
|
385
385
|
}[]>;
|
|
386
|
-
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin,
|
|
386
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
387
387
|
readonly label: StringConstructor;
|
|
388
388
|
readonly labelWidth: import("vue").PropType<string | number>;
|
|
389
389
|
readonly labelStyle: import("vue").PropType<string | import("vue").CSSProperties>;
|
|
@@ -387,7 +387,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
387
387
|
key: string;
|
|
388
388
|
render: () => import("vue").VNodeChild;
|
|
389
389
|
}[]>;
|
|
390
|
-
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin,
|
|
390
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
391
391
|
readonly label: StringConstructor;
|
|
392
392
|
readonly labelWidth: import("vue").PropType<string | number>;
|
|
393
393
|
readonly labelStyle: import("vue").PropType<string | import("vue").CSSProperties>;
|
|
@@ -210,7 +210,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
210
210
|
key: string;
|
|
211
211
|
render: () => import("vue").VNodeChild;
|
|
212
212
|
}[]>;
|
|
213
|
-
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin,
|
|
213
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
214
214
|
readonly label: StringConstructor;
|
|
215
215
|
readonly labelWidth: import("vue").PropType<string | number>;
|
|
216
216
|
readonly labelStyle: import("vue").PropType<string | import("vue").CSSProperties>;
|
|
@@ -205,7 +205,7 @@ declare const DragLayout: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
205
205
|
} | null>;
|
|
206
206
|
validate: import("naive-ui/es/form/src/interface").FormItemValidate;
|
|
207
207
|
restoreValidation: () => void;
|
|
208
|
-
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin,
|
|
208
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
209
209
|
readonly label: StringConstructor;
|
|
210
210
|
readonly labelWidth: import("vue").PropType<string | number>;
|
|
211
211
|
readonly labelStyle: import("vue").PropType<string | import("vue").CSSProperties>;
|
|
@@ -205,7 +205,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
205
205
|
} | null>;
|
|
206
206
|
validate: import("naive-ui/es/form/src/interface").FormItemValidate;
|
|
207
207
|
restoreValidation: () => void;
|
|
208
|
-
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin,
|
|
208
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
209
209
|
readonly label: StringConstructor;
|
|
210
210
|
readonly labelWidth: import("vue").PropType<string | number>;
|
|
211
211
|
readonly labelStyle: import("vue").PropType<string | import("vue").CSSProperties>;
|
|
@@ -55,7 +55,7 @@ declare const FabricChart: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
55
55
|
getRightInfo: import("vue").ComputedRef<any>;
|
|
56
56
|
propItems: any;
|
|
57
57
|
computedYCell: (type: import("./src/interface").IPointType) => number;
|
|
58
|
-
cumputedX: (value: string | number) => any;
|
|
58
|
+
cumputedX: (value: string | number, setAllCenter?: boolean) => any;
|
|
59
59
|
cumputedY: (type: import("./src/interface").IPointType, scaleValueList: number[], value: string | number) => number;
|
|
60
60
|
getXValue: (pointX: number) => string | undefined;
|
|
61
61
|
getYValue: (type: import("./src/interface").IPointType, pointY: number) => number;
|
|
@@ -56,7 +56,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
56
56
|
getRightInfo: import("vue").ComputedRef<any>;
|
|
57
57
|
propItems: any;
|
|
58
58
|
computedYCell: (type: IPointType) => number;
|
|
59
|
-
cumputedX: (value: string | number) => any;
|
|
59
|
+
cumputedX: (value: string | number, setAllCenter?: boolean) => any;
|
|
60
60
|
cumputedY: (type: IPointType, scaleValueList: number[], value: string | number) => number;
|
|
61
61
|
getXValue: (pointX: number) => string | undefined;
|
|
62
62
|
getYValue: (type: IPointType, pointY: number) => number;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { IPropItems, IPointType } from '../interface';
|
|
2
2
|
export declare function useCumputedPoint(propItems: IPropItems): {
|
|
3
|
-
cumputedX: (value: number | string) => any;
|
|
3
|
+
cumputedX: (value: number | string, setAllCenter?: boolean) => any;
|
|
4
4
|
cumputedY: (type: IPointType, scaleValueList: number[], value: number | string) => number;
|
|
5
5
|
getXValue: (pointX: number) => string | undefined;
|
|
6
6
|
getYValue: (type: IPointType, pointY: number) => number;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
function useCumputedPoint(propItems) {
|
|
2
2
|
const { xScaleList, originX, endY, xCellWidth, left, vitalSignsOriginY, painOriginY, canvasWidth } = propItems;
|
|
3
|
-
function cumputedX(value) {
|
|
3
|
+
function cumputedX(value, setAllCenter = false) {
|
|
4
4
|
const time = new Date(value).getTime();
|
|
5
5
|
const [minScale] = xScaleList;
|
|
6
6
|
const maxScale = xScaleList.at(-1);
|
|
@@ -11,7 +11,7 @@ function useCumputedPoint(propItems) {
|
|
|
11
11
|
const index = xScaleList.findIndex((v) => v.end >= time);
|
|
12
12
|
if (index > -1) {
|
|
13
13
|
const item = xScaleList[index];
|
|
14
|
-
if (time === item.start) {
|
|
14
|
+
if (time === item.start && !setAllCenter) {
|
|
15
15
|
return item.left;
|
|
16
16
|
} else {
|
|
17
17
|
return item.center;
|
|
@@ -3,7 +3,7 @@ import { fabric } from '../utils/index.js';
|
|
|
3
3
|
import { defaultStyle } from './useDraw2.js';
|
|
4
4
|
|
|
5
5
|
function useOther(canvas, propItems, cumputedX) {
|
|
6
|
-
const { other, vitalSignsOriginY } = propItems;
|
|
6
|
+
const { other, vitalSignsOriginY, xCellWidth } = propItems;
|
|
7
7
|
function drawOther() {
|
|
8
8
|
if (!(other == null ? void 0 : other.list))
|
|
9
9
|
return false;
|
|
@@ -11,7 +11,7 @@ function useOther(canvas, propItems, cumputedX) {
|
|
|
11
11
|
const otherList = [];
|
|
12
12
|
other.list.forEach((item) => {
|
|
13
13
|
const align = item.align || "vertical";
|
|
14
|
-
const left = cumputedX(item.time);
|
|
14
|
+
const left = cumputedX(item.time, true);
|
|
15
15
|
const obj = otherList.find((v) => v.left == left);
|
|
16
16
|
if (obj) {
|
|
17
17
|
obj[align].push(item);
|
|
@@ -25,7 +25,6 @@ function useOther(canvas, propItems, cumputedX) {
|
|
|
25
25
|
otherList.push(initObj);
|
|
26
26
|
}
|
|
27
27
|
});
|
|
28
|
-
let textWidth = 0;
|
|
29
28
|
otherList.forEach((item) => {
|
|
30
29
|
let topY = vitalSignsOriginY.originY;
|
|
31
30
|
let leftX = item.left;
|
|
@@ -33,17 +32,25 @@ function useOther(canvas, propItems, cumputedX) {
|
|
|
33
32
|
item.vertical.forEach((v) => {
|
|
34
33
|
const { commonOptions, value } = getTextData(v);
|
|
35
34
|
topY += (v.baseTop || 0) + textHeight;
|
|
35
|
+
const node = hasNode(item.left, topY);
|
|
36
|
+
if (node) {
|
|
37
|
+
topY += node.height;
|
|
38
|
+
}
|
|
36
39
|
const text = new fabric.Text(value, {
|
|
37
40
|
top: topY,
|
|
38
41
|
left: item.left,
|
|
39
42
|
...commonOptions
|
|
40
43
|
});
|
|
41
44
|
textHeight = text.height || 0;
|
|
42
|
-
|
|
45
|
+
list.push(text);
|
|
43
46
|
});
|
|
44
47
|
item.horizontal.forEach((v, i) => {
|
|
45
48
|
if (i > 0 || item.vertical.length) {
|
|
46
|
-
leftX +=
|
|
49
|
+
leftX += xCellWidth;
|
|
50
|
+
}
|
|
51
|
+
const node = hasNode(leftX, vitalSignsOriginY.originY);
|
|
52
|
+
if (node) {
|
|
53
|
+
leftX += xCellWidth;
|
|
47
54
|
}
|
|
48
55
|
const { commonOptions, value } = getTextData(v);
|
|
49
56
|
const text = new fabric.Text(value, {
|
|
@@ -51,15 +58,11 @@ function useOther(canvas, propItems, cumputedX) {
|
|
|
51
58
|
left: leftX,
|
|
52
59
|
...commonOptions
|
|
53
60
|
});
|
|
54
|
-
|
|
61
|
+
list.push(text);
|
|
55
62
|
});
|
|
56
63
|
});
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
textWidth = text.width || 0;
|
|
60
|
-
}
|
|
61
|
-
list.push(text);
|
|
62
|
-
}
|
|
64
|
+
const group = list.length > 0 ? new fabric.Group([...list], { ...defaultStyle }) : null;
|
|
65
|
+
group && canvas.value.add(group);
|
|
63
66
|
function getTextData(v) {
|
|
64
67
|
return {
|
|
65
68
|
commonOptions: {
|
|
@@ -71,8 +74,9 @@ function useOther(canvas, propItems, cumputedX) {
|
|
|
71
74
|
value: String(v.value.toString().split("").join("\n"))
|
|
72
75
|
};
|
|
73
76
|
}
|
|
74
|
-
|
|
75
|
-
|
|
77
|
+
function hasNode(x, y) {
|
|
78
|
+
return list.find((v) => v.left === x && y >= v.top && y <= v.top + v.height);
|
|
79
|
+
}
|
|
76
80
|
}
|
|
77
81
|
onMounted(() => {
|
|
78
82
|
nextTick(() => {
|
|
@@ -609,7 +609,7 @@ declare const FormConfig: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
609
609
|
style: import("vue").Ref<string | import("vue").CSSProperties | undefined>;
|
|
610
610
|
class: import("vue").Ref<string | undefined>;
|
|
611
611
|
mergedClsPrefix: import("vue").Ref<string>;
|
|
612
|
-
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin,
|
|
612
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
613
613
|
readonly tab: import("vue").PropType<string | number | import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
614
614
|
[key: string]: any;
|
|
615
615
|
}> | (() => import("vue").VNodeChild)>;
|
|
@@ -932,7 +932,13 @@ declare const FormConfig: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
932
932
|
multi_select?: import("..").FormCommonState | undefined;
|
|
933
933
|
multi_select_value?: string | number | undefined;
|
|
934
934
|
wordbook?: {
|
|
935
|
-
level_num
|
|
935
|
+
level_num?: number | undefined;
|
|
936
|
+
id: string;
|
|
937
|
+
name: string;
|
|
938
|
+
render_key: string[];
|
|
939
|
+
search_key: string[];
|
|
940
|
+
type: string;
|
|
941
|
+
value_key: string;
|
|
936
942
|
} | undefined;
|
|
937
943
|
open?: {
|
|
938
944
|
value?: any;
|
|
@@ -957,6 +963,7 @@ declare const FormConfig: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
957
963
|
})[] | undefined;
|
|
958
964
|
} | undefined;
|
|
959
965
|
suffixConfig?: any | any[] | undefined;
|
|
966
|
+
autograph?: string | undefined;
|
|
960
967
|
fieldType?: import("@formily/json-schema").SchemaTypes | undefined;
|
|
961
968
|
content?: string | import("..").FormRenderer | Record<string, import("..").FormRenderer> | undefined;
|
|
962
969
|
lazyRequest?: boolean | undefined;
|
|
@@ -3022,7 +3029,7 @@ declare const FormConfig: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
3022
3029
|
style: import("vue").Ref<string | import("vue").CSSProperties | undefined>;
|
|
3023
3030
|
class: import("vue").Ref<string | undefined>;
|
|
3024
3031
|
mergedClsPrefix: import("vue").Ref<string>;
|
|
3025
|
-
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin,
|
|
3032
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
3026
3033
|
readonly tab: import("vue").PropType<string | number | import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
3027
3034
|
[key: string]: any;
|
|
3028
3035
|
}> | (() => import("vue").VNodeChild)>;
|
|
@@ -611,7 +611,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
611
611
|
style: import("vue").Ref<string | import("vue").CSSProperties | undefined>;
|
|
612
612
|
class: import("vue").Ref<string | undefined>;
|
|
613
613
|
mergedClsPrefix: import("vue").Ref<string>;
|
|
614
|
-
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin,
|
|
614
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
615
615
|
readonly tab: PropType<string | number | import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
616
616
|
[key: string]: any;
|
|
617
617
|
}> | (() => import("vue").VNodeChild)>;
|
|
@@ -934,7 +934,13 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
934
934
|
multi_select?: import("../..").FormCommonState | undefined;
|
|
935
935
|
multi_select_value?: string | number | undefined;
|
|
936
936
|
wordbook?: {
|
|
937
|
-
level_num
|
|
937
|
+
level_num?: number | undefined;
|
|
938
|
+
id: string;
|
|
939
|
+
name: string;
|
|
940
|
+
render_key: string[];
|
|
941
|
+
search_key: string[];
|
|
942
|
+
type: string;
|
|
943
|
+
value_key: string;
|
|
938
944
|
} | undefined;
|
|
939
945
|
open?: {
|
|
940
946
|
value?: any;
|
|
@@ -959,6 +965,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
959
965
|
})[] | undefined;
|
|
960
966
|
} | undefined;
|
|
961
967
|
suffixConfig?: any | any[] | undefined;
|
|
968
|
+
autograph?: string | undefined;
|
|
962
969
|
fieldType?: import("@formily/json-schema").SchemaTypes | undefined;
|
|
963
970
|
content?: string | import("../..").FormRenderer | Record<string, import("../..").FormRenderer> | undefined;
|
|
964
971
|
lazyRequest?: boolean | undefined;
|
|
@@ -3024,7 +3031,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
3024
3031
|
style: import("vue").Ref<string | import("vue").CSSProperties | undefined>;
|
|
3025
3032
|
class: import("vue").Ref<string | undefined>;
|
|
3026
3033
|
mergedClsPrefix: import("vue").Ref<string>;
|
|
3027
|
-
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin,
|
|
3034
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
3028
3035
|
readonly tab: PropType<string | number | import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
3029
3036
|
[key: string]: any;
|
|
3030
3037
|
}> | (() => import("vue").VNodeChild)>;
|
|
@@ -471,7 +471,7 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
|
471
471
|
style: import("vue").Ref<string | import("vue").CSSProperties | undefined>;
|
|
472
472
|
class: import("vue").Ref<string | undefined>;
|
|
473
473
|
mergedClsPrefix: import("vue").Ref<string>;
|
|
474
|
-
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin,
|
|
474
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
475
475
|
readonly tab: import("vue").PropType<string | number | import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
476
476
|
[key: string]: any;
|
|
477
477
|
}> | (() => import("vue").VNodeChild)>;
|
|
@@ -61,7 +61,13 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
|
61
61
|
multi_select?: import("../../../../../es/components/form-render").FormCommonState | undefined;
|
|
62
62
|
multi_select_value?: string | number | undefined;
|
|
63
63
|
wordbook?: {
|
|
64
|
-
level_num
|
|
64
|
+
level_num?: number | undefined;
|
|
65
|
+
id: string;
|
|
66
|
+
name: string;
|
|
67
|
+
render_key: string[];
|
|
68
|
+
search_key: string[];
|
|
69
|
+
type: string;
|
|
70
|
+
value_key: string;
|
|
65
71
|
} | undefined;
|
|
66
72
|
open?: {
|
|
67
73
|
value?: any;
|
|
@@ -86,6 +92,7 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
|
86
92
|
})[] | undefined;
|
|
87
93
|
} | undefined;
|
|
88
94
|
suffixConfig?: any | any[] | undefined;
|
|
95
|
+
autograph?: string | undefined;
|
|
89
96
|
fieldType?: import("@formily/json-schema").SchemaTypes | undefined;
|
|
90
97
|
content?: string | import("../../../../../es/components/form-render").FormRenderer | Record<string, import("../../../../../es/components/form-render").FormRenderer> | undefined;
|
|
91
98
|
lazyRequest?: boolean | undefined;
|
|
@@ -2151,7 +2158,7 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
|
2151
2158
|
style: import("vue").Ref<string | import("vue").CSSProperties | undefined>;
|
|
2152
2159
|
class: import("vue").Ref<string | undefined>;
|
|
2153
2160
|
mergedClsPrefix: import("vue").Ref<string>;
|
|
2154
|
-
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin,
|
|
2161
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
2155
2162
|
readonly tab: import("vue").PropType<string | number | import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
2156
2163
|
[key: string]: any;
|
|
2157
2164
|
}> | (() => import("vue").VNodeChild)>;
|
|
@@ -457,7 +457,7 @@ declare const FormRender: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
457
457
|
style: import("vue").Ref<string | import("vue").CSSProperties | undefined>;
|
|
458
458
|
class: import("vue").Ref<string | undefined>;
|
|
459
459
|
mergedClsPrefix: import("vue").Ref<string>;
|
|
460
|
-
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin,
|
|
460
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
461
461
|
readonly tab: import("vue").PropType<string | number | import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
462
462
|
[key: string]: any;
|
|
463
463
|
}> | (() => import("vue").VNodeChild)>;
|
|
@@ -37,6 +37,7 @@ import './src/components/renderer/labelSelect.js';
|
|
|
37
37
|
import './src/components/renderer/slider.js';
|
|
38
38
|
import './src/components/renderer/complex.js';
|
|
39
39
|
import './src/components/renderer/simpleComponent.js';
|
|
40
|
+
import './src/components/renderer/search.js';
|
|
40
41
|
|
|
41
42
|
const FormRender = script;
|
|
42
43
|
FormRender.install = function(app) {
|
|
@@ -123,14 +123,14 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
123
123
|
error.messages.forEach((message) => {
|
|
124
124
|
if (!isObject(message))
|
|
125
125
|
return;
|
|
126
|
-
result.push(...arrayed(message).map(
|
|
126
|
+
result.push(...arrayed(message).map(bindEleInfo));
|
|
127
127
|
hasChildMessage = true;
|
|
128
128
|
});
|
|
129
129
|
}
|
|
130
|
-
!hasChildMessage && result.push(
|
|
130
|
+
!hasChildMessage && result.push(bindEleInfo(error));
|
|
131
131
|
return result;
|
|
132
132
|
}
|
|
133
|
-
function
|
|
133
|
+
function bindEleInfo(info) {
|
|
134
134
|
if (info.decoratorElement)
|
|
135
135
|
return info;
|
|
136
136
|
info.title = formModel.query(info.path).get("title");
|
|
@@ -457,7 +457,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
457
457
|
style: import("vue").Ref<string | import("vue").CSSProperties | undefined>;
|
|
458
458
|
class: import("vue").Ref<string | undefined>;
|
|
459
459
|
mergedClsPrefix: import("vue").Ref<string>;
|
|
460
|
-
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin,
|
|
460
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
461
461
|
readonly tab: PropType<string | number | import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
462
462
|
[key: string]: any;
|
|
463
463
|
}> | (() => import("vue").VNodeChild)>;
|
|
@@ -8,7 +8,6 @@ export declare const SEARCH_CASCADE: import("vue").DefineComponent<{
|
|
|
8
8
|
};
|
|
9
9
|
depth: {
|
|
10
10
|
type: (NumberConstructor | StringConstructor)[];
|
|
11
|
-
required: true;
|
|
12
11
|
};
|
|
13
12
|
urlConfig: {
|
|
14
13
|
type: PropType<UrlConfig>;
|
|
@@ -16,6 +15,10 @@ export declare const SEARCH_CASCADE: import("vue").DefineComponent<{
|
|
|
16
15
|
onFocus: {
|
|
17
16
|
type: PropType<Func<any[], any>>;
|
|
18
17
|
};
|
|
18
|
+
filterable: {
|
|
19
|
+
type: BooleanConstructor;
|
|
20
|
+
default: boolean;
|
|
21
|
+
};
|
|
19
22
|
onChange: {};
|
|
20
23
|
value: {};
|
|
21
24
|
}, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "update:value"[], "update:value", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
@@ -25,7 +28,6 @@ export declare const SEARCH_CASCADE: import("vue").DefineComponent<{
|
|
|
25
28
|
};
|
|
26
29
|
depth: {
|
|
27
30
|
type: (NumberConstructor | StringConstructor)[];
|
|
28
|
-
required: true;
|
|
29
31
|
};
|
|
30
32
|
urlConfig: {
|
|
31
33
|
type: PropType<UrlConfig>;
|
|
@@ -33,10 +35,15 @@ export declare const SEARCH_CASCADE: import("vue").DefineComponent<{
|
|
|
33
35
|
onFocus: {
|
|
34
36
|
type: PropType<Func<any[], any>>;
|
|
35
37
|
};
|
|
38
|
+
filterable: {
|
|
39
|
+
type: BooleanConstructor;
|
|
40
|
+
default: boolean;
|
|
41
|
+
};
|
|
36
42
|
onChange: {};
|
|
37
43
|
value: {};
|
|
38
44
|
}>> & {
|
|
39
45
|
"onUpdate:value"?: ((...args: any[]) => any) | undefined;
|
|
40
46
|
}, {
|
|
41
47
|
options: AnyObject[];
|
|
48
|
+
filterable: boolean;
|
|
42
49
|
}>;
|