cnhis-design-vue 3.1.14-beta.4 → 3.1.14-beta.7
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 +22 -22
- package/es/packages/annotation-edit/index.d.ts +17 -0
- package/es/packages/annotation-edit/index.js +10 -0
- package/es/packages/annotation-edit/src/AnnotationEdit.d.ts +16 -0
- package/es/packages/annotation-edit/src/AnnotationEdit.js +119 -0
- package/es/packages/annotation-edit/style/index.css +15 -0
- package/es/packages/big-table/src/BigTable.vue.d.ts +2 -12
- package/es/packages/big-table/src/BigTable.vue_vue_type_script_setup_true_lang.js +4 -4
- package/es/packages/big-table/src/bigTableEmits.js +1 -1
- package/es/packages/big-table/src/utils.js +2 -2
- package/es/packages/button-print/index.d.ts +1 -0
- package/es/packages/button-print/index.js +1 -0
- package/es/packages/button-print/src/ButtonPrint.vue_vue_type_script_setup_true_lang.js +5 -1
- package/es/packages/button-print/src/utils/index.d.ts +1 -0
- package/es/packages/button-print/src/utils/index.js +1 -0
- package/es/packages/button-print/src/utils/print.d.ts +1 -1
- package/es/packages/button-print/src/utils/print.js +1 -1
- package/es/packages/fabric-chart/index.d.ts +5 -2
- package/es/packages/fabric-chart/src/FabricChart.vue.d.ts +6 -3
- package/es/packages/fabric-chart/src/FabricChart.vue_vue_type_script_setup_true_lang.js +24 -3
- package/es/packages/fabric-chart/src/hooks/index.d.ts +1 -1
- package/es/packages/fabric-chart/src/hooks/index.js +2 -2
- package/es/packages/fabric-chart/src/hooks/useCenter.js +19 -14
- package/es/packages/fabric-chart/src/hooks/useEvent.d.ts +6 -0
- package/es/packages/fabric-chart/src/hooks/useEvent.js +66 -1
- package/es/packages/fabric-chart/src/hooks/useTop.js +2 -11
- package/es/packages/fabric-chart/src/interface.d.ts +3 -0
- package/es/packages/form-render/index.d.ts +1 -1
- package/es/packages/form-render/src/FormRender.vue.d.ts +1 -1
- package/es/packages/form-render/src/components/renderer/formItem.js +8 -92
- package/es/packages/form-render/src/hooks/useAnchor.d.ts +1 -1
- package/es/packages/form-render/src/hooks/useAnchor.js +3 -3
- package/es/packages/form-render/src/hooks/useFieldListAdaptor.js +5 -3
- package/es/packages/form-render/src/types/fieldItem.d.ts +1 -0
- package/es/packages/form-render/src/utils/index.d.ts +1 -0
- package/es/packages/form-render/src/utils/index.js +4 -1
- package/es/packages/form-render/style/index.css +17 -15
- package/es/packages/index.css +17 -15
- package/es/packages/index.d.ts +1 -0
- package/es/packages/index.js +1 -0
- package/es/packages/info-header/index.d.ts +0 -2
- package/es/packages/info-header/src/InfoHeader.vue.d.ts +0 -2
- package/es/packages/info-header/src/InfoHeader.vue_vue_type_script_setup_true_lang.js +1 -1
- package/es/{packages/info-header/src → src/components/SlotRender}/SlotRender.d.ts +0 -2
- package/es/{packages/info-header/src → src/components/SlotRender}/SlotRender.js +5 -5
- package/es/src/components/SlotRender/index.d.ts +2 -0
- package/es/src/components/SlotRender/index.js +2 -0
- package/global.d.ts +8 -8
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
# Vue 3 + Typescript + Vite
|
|
2
|
-
|
|
3
|
-
This template should help get you started developing with Vue 3 and Typescript in Vite. The template uses Vue 3 `<script setup>` SFCs, check out the [script setup docs](https://v3.vuejs.org/api/sfc-script-setup.html#sfc-script-setup) to learn more.
|
|
4
|
-
|
|
5
|
-
## Recommended IDE Setup
|
|
6
|
-
|
|
7
|
-
- [VSCode](https://code.visualstudio.com/) + [Volar](https://marketplace.visualstudio.com/items?itemName=johnsoncodehk.volar)
|
|
8
|
-
|
|
9
|
-
## Type Support For `.vue` Imports in TS
|
|
10
|
-
|
|
11
|
-
Since TypeScript cannot handle type information for `.vue` imports, they are shimmed to be a generic Vue component type by default. In most cases this is fine if you don't really care about component prop types outside of templates. However, if you wish to get actual prop types in `.vue` imports (for example to get props validation when using manual `h(...)` calls), you can enable Volar's `.vue` type support plugin by running `Volar: Switch TS Plugin on/off` from VSCode command palette.
|
|
12
|
-
|
|
13
|
-
## 使用
|
|
14
|
-
```JavaScript
|
|
15
|
-
import { createApp } from "vue";
|
|
16
|
-
import App from "./App.vue";
|
|
17
|
-
import cui from "cnhis-design-vue";
|
|
18
|
-
import "cnhis-design-vue/es/index.css";
|
|
19
|
-
|
|
20
|
-
const app = createApp(App);
|
|
21
|
-
app.use(cui);
|
|
22
|
-
app.mount("#app");
|
|
1
|
+
# Vue 3 + Typescript + Vite
|
|
2
|
+
|
|
3
|
+
This template should help get you started developing with Vue 3 and Typescript in Vite. The template uses Vue 3 `<script setup>` SFCs, check out the [script setup docs](https://v3.vuejs.org/api/sfc-script-setup.html#sfc-script-setup) to learn more.
|
|
4
|
+
|
|
5
|
+
## Recommended IDE Setup
|
|
6
|
+
|
|
7
|
+
- [VSCode](https://code.visualstudio.com/) + [Volar](https://marketplace.visualstudio.com/items?itemName=johnsoncodehk.volar)
|
|
8
|
+
|
|
9
|
+
## Type Support For `.vue` Imports in TS
|
|
10
|
+
|
|
11
|
+
Since TypeScript cannot handle type information for `.vue` imports, they are shimmed to be a generic Vue component type by default. In most cases this is fine if you don't really care about component prop types outside of templates. However, if you wish to get actual prop types in `.vue` imports (for example to get props validation when using manual `h(...)` calls), you can enable Volar's `.vue` type support plugin by running `Volar: Switch TS Plugin on/off` from VSCode command palette.
|
|
12
|
+
|
|
13
|
+
## 使用
|
|
14
|
+
```JavaScript
|
|
15
|
+
import { createApp } from "vue";
|
|
16
|
+
import App from "./App.vue";
|
|
17
|
+
import cui from "cnhis-design-vue";
|
|
18
|
+
import "cnhis-design-vue/es/index.css";
|
|
19
|
+
|
|
20
|
+
const app = createApp(App);
|
|
21
|
+
app.use(cui);
|
|
22
|
+
app.mount("#app");
|
|
23
23
|
```
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { SFCWithInstall } from '../../../es/src/types';
|
|
2
|
+
declare const Annotation: SFCWithInstall<import("vue").DefineComponent<{
|
|
3
|
+
modelValue: {
|
|
4
|
+
type: StringConstructor;
|
|
5
|
+
default: string;
|
|
6
|
+
};
|
|
7
|
+
}, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "update:modelValue"[], "update:modelValue", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
8
|
+
modelValue: {
|
|
9
|
+
type: StringConstructor;
|
|
10
|
+
default: string;
|
|
11
|
+
};
|
|
12
|
+
}>> & {
|
|
13
|
+
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
|
|
14
|
+
}, {
|
|
15
|
+
modelValue: string;
|
|
16
|
+
}>>;
|
|
17
|
+
export default Annotation;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { COMPONENT_NAMESPACE } from '../../src/global/variable';
|
|
2
|
+
import { safeComponentRegister } from '../../src/utils';
|
|
3
|
+
import script from './src/AnnotationEdit.js';
|
|
4
|
+
|
|
5
|
+
const Annotation = script;
|
|
6
|
+
Annotation.install = function(app) {
|
|
7
|
+
safeComponentRegister(app, Annotation, COMPONENT_NAMESPACE + "Annotation");
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
export { Annotation as default };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
declare const _default: import("vue").DefineComponent<{
|
|
2
|
+
modelValue: {
|
|
3
|
+
type: StringConstructor;
|
|
4
|
+
default: string;
|
|
5
|
+
};
|
|
6
|
+
}, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "update:modelValue"[], "update:modelValue", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
7
|
+
modelValue: {
|
|
8
|
+
type: StringConstructor;
|
|
9
|
+
default: string;
|
|
10
|
+
};
|
|
11
|
+
}>> & {
|
|
12
|
+
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
|
|
13
|
+
}, {
|
|
14
|
+
modelValue: string;
|
|
15
|
+
}>;
|
|
16
|
+
export default _default;
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
import { defineComponent, computed, ref, createVNode, unref } from 'vue';
|
|
2
|
+
import { FileTrayFull, FileTray } from '@vicons/ionicons5';
|
|
3
|
+
import { NPopover, NIcon, NInput } from 'naive-ui';
|
|
4
|
+
|
|
5
|
+
var script = defineComponent({
|
|
6
|
+
props: {
|
|
7
|
+
modelValue: {
|
|
8
|
+
type: String,
|
|
9
|
+
default: ""
|
|
10
|
+
}
|
|
11
|
+
},
|
|
12
|
+
emits: ["update:modelValue"],
|
|
13
|
+
setup(props, {
|
|
14
|
+
emit
|
|
15
|
+
}) {
|
|
16
|
+
const modelValue = computed({
|
|
17
|
+
get() {
|
|
18
|
+
return props.modelValue;
|
|
19
|
+
},
|
|
20
|
+
set(value) {
|
|
21
|
+
emit("update:modelValue", value);
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
const __showPopper = ref(false);
|
|
25
|
+
const showPopper = computed({
|
|
26
|
+
get() {
|
|
27
|
+
return __showPopper.value;
|
|
28
|
+
},
|
|
29
|
+
async set(value) {
|
|
30
|
+
__showPopper.value = value;
|
|
31
|
+
if (!value && isEdit.value) {
|
|
32
|
+
await new Promise((resolve) => setTimeout(resolve, 200));
|
|
33
|
+
isEdit.value = false;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
});
|
|
37
|
+
const isEdit = ref(false);
|
|
38
|
+
let clickTimer;
|
|
39
|
+
function iconClick() {
|
|
40
|
+
clearTimeout(clickTimer);
|
|
41
|
+
if (showPopper.value && isEdit.value) {
|
|
42
|
+
showPopper.value = false;
|
|
43
|
+
return;
|
|
44
|
+
}
|
|
45
|
+
clickTimer = setTimeout(() => {
|
|
46
|
+
if (!unref(modelValue)) {
|
|
47
|
+
isEdit.value = showPopper.value = true;
|
|
48
|
+
}
|
|
49
|
+
}, 200);
|
|
50
|
+
}
|
|
51
|
+
function iconDbClick() {
|
|
52
|
+
clearTimeout(clickTimer);
|
|
53
|
+
if (!unref(modelValue))
|
|
54
|
+
return;
|
|
55
|
+
showPopper.value = true;
|
|
56
|
+
isEdit.value = true;
|
|
57
|
+
}
|
|
58
|
+
function iconMouseenter() {
|
|
59
|
+
if (!unref(modelValue))
|
|
60
|
+
return;
|
|
61
|
+
showPopper.value = true;
|
|
62
|
+
}
|
|
63
|
+
function iconMouseleave() {
|
|
64
|
+
if (!unref(modelValue) || isEdit.value)
|
|
65
|
+
return;
|
|
66
|
+
showPopper.value = false;
|
|
67
|
+
}
|
|
68
|
+
function renderAnnotation() {
|
|
69
|
+
return createVNode("section", {
|
|
70
|
+
"class": ["annotation-edit", {
|
|
71
|
+
"is-active": !!unref(modelValue)
|
|
72
|
+
}],
|
|
73
|
+
"style": {
|
|
74
|
+
"--icon-right": "-5"
|
|
75
|
+
},
|
|
76
|
+
"annotation-hover-show": !unref(modelValue) && !isEdit.value
|
|
77
|
+
}, [createVNode(NPopover, {
|
|
78
|
+
"style": {
|
|
79
|
+
maxWidth: "200px",
|
|
80
|
+
wordBreak: "break-all"
|
|
81
|
+
},
|
|
82
|
+
"show": showPopper.value,
|
|
83
|
+
"onUpdate:show": ($event) => showPopper.value = $event,
|
|
84
|
+
"trigger": "manual",
|
|
85
|
+
"duration": 100
|
|
86
|
+
}, {
|
|
87
|
+
default: renderDefault,
|
|
88
|
+
trigger: renderTrigger
|
|
89
|
+
})]);
|
|
90
|
+
function renderText() {
|
|
91
|
+
return createVNode("span", null, [unref(modelValue)]);
|
|
92
|
+
}
|
|
93
|
+
function renderTextarea() {
|
|
94
|
+
return createVNode(NInput, {
|
|
95
|
+
"type": "textarea",
|
|
96
|
+
"value": modelValue.value,
|
|
97
|
+
"onUpdate:value": ($event) => modelValue.value = $event
|
|
98
|
+
}, null);
|
|
99
|
+
}
|
|
100
|
+
function renderDefault() {
|
|
101
|
+
return createVNode("div", null, [isEdit.value ? renderTextarea() : renderText()]);
|
|
102
|
+
}
|
|
103
|
+
function renderTrigger() {
|
|
104
|
+
return createVNode("div", {
|
|
105
|
+
"class": "annotation-edit__icon",
|
|
106
|
+
"onMouseleave": iconMouseleave,
|
|
107
|
+
"onMouseenter": iconMouseenter,
|
|
108
|
+
"onDblclick": iconDbClick,
|
|
109
|
+
"onClick": iconClick
|
|
110
|
+
}, [createVNode(NIcon, {
|
|
111
|
+
"component": unref(modelValue) ? FileTrayFull : FileTray
|
|
112
|
+
}, null)]);
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
return renderAnnotation;
|
|
116
|
+
}
|
|
117
|
+
});
|
|
118
|
+
|
|
119
|
+
export { script as default };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
.annotation-edit {
|
|
2
|
+
cursor: pointer;
|
|
3
|
+
color: #0067ee;
|
|
4
|
+
font-size: 16px;
|
|
5
|
+
user-select: none;
|
|
6
|
+
display: inline-flex;
|
|
7
|
+
align-items: center;
|
|
8
|
+
}
|
|
9
|
+
.annotation-edit.is-active {
|
|
10
|
+
color: rgba(255, 152, 40);
|
|
11
|
+
}
|
|
12
|
+
.annotation-edit__icon {
|
|
13
|
+
display: inline-flex;
|
|
14
|
+
align-items: center;
|
|
15
|
+
}
|
|
@@ -1091,9 +1091,6 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
1091
1091
|
textColorGhostHoverSuccess: string;
|
|
1092
1092
|
textColorGhostPressedSuccess: string;
|
|
1093
1093
|
textColorGhostFocusSuccess: string;
|
|
1094
|
-
/**
|
|
1095
|
-
* 删除选中scan数据
|
|
1096
|
-
*/
|
|
1097
1094
|
textColorGhostDisabledSuccess: string;
|
|
1098
1095
|
borderSuccess: string;
|
|
1099
1096
|
borderHoverSuccess: string;
|
|
@@ -1136,14 +1133,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
1136
1133
|
textColorHoverError: string;
|
|
1137
1134
|
textColorPressedError: string;
|
|
1138
1135
|
textColorFocusError: string;
|
|
1139
|
-
textColorDisabledError: string;
|
|
1140
|
-
* 初始化props
|
|
1141
|
-
* @param {*} unionItem
|
|
1142
|
-
* @param {*} row
|
|
1143
|
-
* @param {*} column
|
|
1144
|
-
* @param {*} $rowIndex
|
|
1145
|
-
* @returns
|
|
1146
|
-
*/
|
|
1136
|
+
textColorDisabledError: string;
|
|
1147
1137
|
textColorTextError: string;
|
|
1148
1138
|
textColorTextHoverError: string;
|
|
1149
1139
|
textColorTextPressedError: string;
|
|
@@ -1315,7 +1305,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
1315
1305
|
colorWarning: string;
|
|
1316
1306
|
colorHoverWarning: string;
|
|
1317
1307
|
colorPressedWarning: string;
|
|
1318
|
-
colorFocusWarning: string;
|
|
1308
|
+
colorFocusWarning: string; /** string */
|
|
1319
1309
|
colorDisabledWarning: string;
|
|
1320
1310
|
textColorWarning: string;
|
|
1321
1311
|
textColorHoverWarning: string;
|
|
@@ -518,7 +518,6 @@ var script = /* @__PURE__ */ defineComponent({
|
|
|
518
518
|
return columns;
|
|
519
519
|
};
|
|
520
520
|
const formatterEdit = (params, col) => {
|
|
521
|
-
console.log(params, col);
|
|
522
521
|
let {
|
|
523
522
|
row,
|
|
524
523
|
column,
|
|
@@ -541,8 +540,8 @@ var script = /* @__PURE__ */ defineComponent({
|
|
|
541
540
|
index: $rowIndex,
|
|
542
541
|
type: formType,
|
|
543
542
|
onFormChange,
|
|
544
|
-
|
|
545
|
-
emit("
|
|
543
|
+
onClick: () => {
|
|
544
|
+
emit("formClick", {
|
|
546
545
|
value: row[col.columnName],
|
|
547
546
|
row,
|
|
548
547
|
column: col,
|
|
@@ -2303,7 +2302,8 @@ var script = /* @__PURE__ */ defineComponent({
|
|
|
2303
2302
|
visibleMethod: unref(visibleMethod),
|
|
2304
2303
|
trigger: "cell",
|
|
2305
2304
|
reserve: true,
|
|
2306
|
-
highlight: true
|
|
2305
|
+
highlight: true,
|
|
2306
|
+
..._ctx.$attrs.checkboxConfig || {}
|
|
2307
2307
|
},
|
|
2308
2308
|
"radio-config": {
|
|
2309
2309
|
checkField: "checked",
|
|
@@ -140,7 +140,7 @@ const reScrollFilterWrap = () => {
|
|
|
140
140
|
});
|
|
141
141
|
};
|
|
142
142
|
const showFilter = (field, columnName, event, props, state) => {
|
|
143
|
-
var _a;
|
|
143
|
+
var _a, _b, _c;
|
|
144
144
|
if (props.isInlineOperating)
|
|
145
145
|
return false;
|
|
146
146
|
const target = event.target;
|
|
@@ -161,7 +161,7 @@ const showFilter = (field, columnName, event, props, state) => {
|
|
|
161
161
|
field.top = btnRectTop + FILTER_BOX_TOP_OFFSET + (props.filterTopOffset || 0) + "px";
|
|
162
162
|
field.visible = !field.visible;
|
|
163
163
|
const len = (_a = state.filterFields[columnName]) == null ? void 0 : _a.CONVERT.length;
|
|
164
|
-
field.checkAll = len ===
|
|
164
|
+
field.checkAll = len === ((_c = (_b = state.filterFields[columnName]) == null ? void 0 : _b.filterItems) == null ? void 0 : _c.length);
|
|
165
165
|
field.indeterminate = !!len && len !== field.setting.showSetting.length;
|
|
166
166
|
field.searchFilterText = "";
|
|
167
167
|
};
|
|
@@ -2,6 +2,7 @@ import { COMPONENT_NAMESPACE } from '../../src/global/variable';
|
|
|
2
2
|
import { safeComponentRegister } from '../../src/utils';
|
|
3
3
|
import './src/ButtonPrint.js';
|
|
4
4
|
import script from './src/ButtonPrint.vue_vue_type_script_setup_true_lang.js';
|
|
5
|
+
export { Print } from './src/utils/print.js';
|
|
5
6
|
|
|
6
7
|
const ButtonPrint = script;
|
|
7
8
|
ButtonPrint.install = function(app) {
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { defineComponent, reactive, computed, onMounted, onUnmounted, watch, openBlock, createElementBlock, Fragment, createVNode, unref, withCtx, renderSlot, withModifiers, createCommentVNode, createTextVNode, toDisplayString, mergeProps } from 'vue';
|
|
2
|
+
import { isObject } from '@vue/shared';
|
|
2
3
|
import { useMessage, NDropdown, NButton, NIcon } from 'naive-ui';
|
|
3
4
|
import { ChevronDown } from '@vicons/ionicons5';
|
|
4
|
-
import Print from './utils/print.js';
|
|
5
|
+
import { Print } from './utils/print.js';
|
|
5
6
|
import './components/IdentityVerification.js';
|
|
6
7
|
import moment from 'moment';
|
|
7
8
|
import script$1 from './components/IdentityVerification.vue_vue_type_script_setup_true_lang.js';
|
|
@@ -123,6 +124,9 @@ var script = /* @__PURE__ */ defineComponent({
|
|
|
123
124
|
};
|
|
124
125
|
const callLocalServicesErrorCb = (res) => {
|
|
125
126
|
emit("error", res);
|
|
127
|
+
if (isObject(res) && res.type === "notInstalledApp") {
|
|
128
|
+
$message.error(res.message);
|
|
129
|
+
}
|
|
126
130
|
};
|
|
127
131
|
const prevFnError = () => {
|
|
128
132
|
let error = {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './print';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Print } from './print.js';
|
|
@@ -14,7 +14,8 @@ declare const FabricChart: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
14
14
|
data: import("./src/interface").IData;
|
|
15
15
|
addRenderItem?: Function | undefined;
|
|
16
16
|
};
|
|
17
|
-
emits: (event: "change" | "add", ...args: any[]) => void;
|
|
17
|
+
emits: (event: "select" | "change" | "add", ...args: any[]) => void;
|
|
18
|
+
select: import("vue").Ref<any>;
|
|
18
19
|
canvasRef: any;
|
|
19
20
|
canvas: import("vue").Ref<any>;
|
|
20
21
|
dateHeight: import("vue").ComputedRef<number>;
|
|
@@ -48,6 +49,7 @@ declare const FabricChart: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
48
49
|
originY: number;
|
|
49
50
|
endY: number;
|
|
50
51
|
}>;
|
|
52
|
+
topList: import("vue").ComputedRef<import("./src/interface").IDate[]>;
|
|
51
53
|
propItems: any;
|
|
52
54
|
cumputedX: (value: string | number) => any;
|
|
53
55
|
cumputedY: (type: import("./src/interface").IPointType, scaleValueList: number[], value: string | number) => number;
|
|
@@ -180,7 +182,7 @@ declare const FabricChart: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
180
182
|
show: boolean;
|
|
181
183
|
list: unknown[];
|
|
182
184
|
}>;
|
|
183
|
-
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("change" | "add")[], "change" | "add", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
185
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("select" | "change" | "add")[], "select" | "change" | "add", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
184
186
|
data: {
|
|
185
187
|
type: null;
|
|
186
188
|
required: true;
|
|
@@ -191,6 +193,7 @@ declare const FabricChart: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
191
193
|
};
|
|
192
194
|
}>> & {
|
|
193
195
|
onChange?: ((...args: any[]) => any) | undefined;
|
|
196
|
+
onSelect?: ((...args: any[]) => any) | undefined;
|
|
194
197
|
onAdd?: ((...args: any[]) => any) | undefined;
|
|
195
198
|
}, {}>>;
|
|
196
199
|
export default FabricChart;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { IData } from './interface';
|
|
1
|
+
import { IData, IDate } from './interface';
|
|
2
2
|
declare const _default: import("vue").DefineComponent<{
|
|
3
3
|
data: {
|
|
4
4
|
type: null;
|
|
@@ -14,7 +14,8 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
14
14
|
data: IData;
|
|
15
15
|
addRenderItem?: Function | undefined;
|
|
16
16
|
};
|
|
17
|
-
emits: (event: "change" | "add", ...args: any[]) => void;
|
|
17
|
+
emits: (event: "select" | "change" | "add", ...args: any[]) => void;
|
|
18
|
+
select: import("vue").Ref<any>;
|
|
18
19
|
canvasRef: any;
|
|
19
20
|
canvas: import("vue").Ref<any>;
|
|
20
21
|
dateHeight: import("vue").ComputedRef<number>;
|
|
@@ -48,6 +49,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
48
49
|
originY: number;
|
|
49
50
|
endY: number;
|
|
50
51
|
}>;
|
|
52
|
+
topList: import("vue").ComputedRef<IDate[]>;
|
|
51
53
|
propItems: any;
|
|
52
54
|
cumputedX: (value: string | number) => any;
|
|
53
55
|
cumputedY: (type: import("./interface").IPointType, scaleValueList: number[], value: string | number) => number;
|
|
@@ -180,7 +182,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
180
182
|
show: boolean;
|
|
181
183
|
list: unknown[];
|
|
182
184
|
}>;
|
|
183
|
-
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("change" | "add")[], "change" | "add", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
185
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("select" | "change" | "add")[], "select" | "change" | "add", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
184
186
|
data: {
|
|
185
187
|
type: null;
|
|
186
188
|
required: true;
|
|
@@ -191,6 +193,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
191
193
|
};
|
|
192
194
|
}>> & {
|
|
193
195
|
onChange?: ((...args: any[]) => any) | undefined;
|
|
196
|
+
onSelect?: ((...args: any[]) => any) | undefined;
|
|
194
197
|
onAdd?: ((...args: any[]) => any) | undefined;
|
|
195
198
|
}, {}>;
|
|
196
199
|
export default _default;
|
|
@@ -9,7 +9,7 @@ import { useLeft } from './hooks/useLeft.js';
|
|
|
9
9
|
import { useRight } from './hooks/useRight.js';
|
|
10
10
|
import { useBottom } from './hooks/useBottom.js';
|
|
11
11
|
import { useOther } from './hooks/useOther.js';
|
|
12
|
-
import { useEvent } from './hooks/useEvent.js';
|
|
12
|
+
import { useEvent, useCanvasEvent } from './hooks/useEvent.js';
|
|
13
13
|
import script$1 from './components/PopupTip.vue_vue_type_script_setup_true_lang.js';
|
|
14
14
|
import { useCumputedPoint } from './hooks/useCumputedPoint.js';
|
|
15
15
|
|
|
@@ -19,10 +19,11 @@ var script = /* @__PURE__ */ defineComponent({
|
|
|
19
19
|
data: { type: null, required: true },
|
|
20
20
|
addRenderItem: { type: Function, required: false }
|
|
21
21
|
},
|
|
22
|
-
emits: ["change", "add"],
|
|
23
|
-
setup(__props, { emit: emits }) {
|
|
22
|
+
emits: ["change", "add", "select"],
|
|
23
|
+
setup(__props, { expose, emit: emits }) {
|
|
24
24
|
const props = __props;
|
|
25
25
|
const defaultHeight = 15;
|
|
26
|
+
let select = ref();
|
|
26
27
|
const canvasRef = ref(null);
|
|
27
28
|
let canvas = ref();
|
|
28
29
|
const dateHeight = computed(() => {
|
|
@@ -200,14 +201,29 @@ var script = /* @__PURE__ */ defineComponent({
|
|
|
200
201
|
}
|
|
201
202
|
return obj;
|
|
202
203
|
});
|
|
204
|
+
const topList = computed(() => {
|
|
205
|
+
const { top } = props.data;
|
|
206
|
+
let topList2 = [];
|
|
207
|
+
for (let i in top) {
|
|
208
|
+
if (top[i].show) {
|
|
209
|
+
topList2.push({
|
|
210
|
+
...top[i],
|
|
211
|
+
key: i
|
|
212
|
+
});
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
return topList2.sort((a, b) => a.seq - b.seq);
|
|
216
|
+
});
|
|
203
217
|
const propItems = reactive({
|
|
204
218
|
canvasWidth: props.data.width,
|
|
205
219
|
canvasHeight: props.data.height,
|
|
206
220
|
borderStyle: props.data.borderStyle || defaultBorderStyle,
|
|
221
|
+
selectionStyle: props.data.selectionStyle || {},
|
|
207
222
|
dateHeight: dateHeight.value,
|
|
208
223
|
hospitalDaysHeight: hospitalDaysHeight.value,
|
|
209
224
|
operationDaysHeight: operationDaysHeight.value,
|
|
210
225
|
xScalevalueHeight: xScalevalueHeight.value,
|
|
226
|
+
topList: topList.value,
|
|
211
227
|
breathingHeight: breathingHeight.value,
|
|
212
228
|
grid: props.data.grid,
|
|
213
229
|
top: props.data.top,
|
|
@@ -253,11 +269,16 @@ var script = /* @__PURE__ */ defineComponent({
|
|
|
253
269
|
fireRightClick: true
|
|
254
270
|
});
|
|
255
271
|
useEvent(canvasRef.value);
|
|
272
|
+
const { select: selectFunc } = useCanvasEvent(canvas, propItems, emits);
|
|
273
|
+
select.value = selectFunc;
|
|
256
274
|
});
|
|
257
275
|
onBeforeUnmount(() => {
|
|
258
276
|
canvas.value.clear();
|
|
259
277
|
canvas.value = null;
|
|
260
278
|
});
|
|
279
|
+
expose({
|
|
280
|
+
select
|
|
281
|
+
});
|
|
261
282
|
return (_ctx, _cache) => {
|
|
262
283
|
return openBlock(), createElementBlock(Fragment, null, [
|
|
263
284
|
createElementVNode("canvas", {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { defaultBorderStyle } from './useDraw.js';
|
|
1
|
+
export { defaultBorderStyle, defaultLineStyle, defaultRectStyle, defaultStyle, defaultTextStyle, drawLine, drawPoint, drawTextGroup } from './useDraw.js';
|
|
2
2
|
export { useCumputedPoint } from './useCumputedPoint.js';
|
|
3
3
|
export { useTop } from './useTop.js';
|
|
4
4
|
export { useLeft } from './useLeft.js';
|
|
@@ -6,4 +6,4 @@ export { useRight } from './useRight.js';
|
|
|
6
6
|
export { useCenter } from './useCenter.js';
|
|
7
7
|
export { useBottom } from './useBottom.js';
|
|
8
8
|
export { useOther } from './useOther.js';
|
|
9
|
-
export { useEvent } from './useEvent.js';
|
|
9
|
+
export { useCanvasEvent, useEvent } from './useEvent.js';
|
|
@@ -88,19 +88,26 @@ function useCenter(canvas, propItems, emits, cumputedX, cumputedY, getXValue, ge
|
|
|
88
88
|
}
|
|
89
89
|
const [data1, data2] = copyDataList;
|
|
90
90
|
const getPoint = (item) => {
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
91
|
+
if (item.x && item.y) {
|
|
92
|
+
return {
|
|
93
|
+
x: item.x,
|
|
94
|
+
y: item.y
|
|
95
|
+
};
|
|
96
|
+
}
|
|
97
|
+
if (isEffectiveNode(item) && isLimit(item.time)) {
|
|
98
|
+
let y = cumputedY(pulseObj.type, pulseObj.list, item.value);
|
|
99
|
+
y = y < vitalSignsOriginY.originY ? vitalSignsOriginY.originY : y > vitalSignsOriginY.endY ? vitalSignsOriginY.endY : y;
|
|
100
|
+
return {
|
|
101
|
+
x: cumputedX(item.time),
|
|
102
|
+
y
|
|
103
|
+
};
|
|
104
|
+
}
|
|
98
105
|
};
|
|
99
106
|
data1.list.forEach((item, index) => {
|
|
100
107
|
const point1 = getPoint(item);
|
|
101
108
|
const item2 = data2.list[index];
|
|
102
109
|
const point2 = item2 ? getPoint(item2) : null;
|
|
103
|
-
if (point2 && point1.x === point2.x && point1.y !== point2.y) {
|
|
110
|
+
if (point1 && point2 && point1.x === point2.x && point1.y !== point2.y) {
|
|
104
111
|
points1.push(point1);
|
|
105
112
|
points2.push(point2);
|
|
106
113
|
const itemPrev = data1.list[index - 1];
|
|
@@ -108,12 +115,12 @@ function useCenter(canvas, propItems, emits, cumputedX, cumputedY, getXValue, ge
|
|
|
108
115
|
const itemNext2 = data2.list[index + 1];
|
|
109
116
|
if (itemPrev && points1.length === 1) {
|
|
110
117
|
const point = getPoint(itemPrev);
|
|
111
|
-
points1.unshift(point);
|
|
118
|
+
point && points1.unshift(point);
|
|
112
119
|
}
|
|
113
120
|
if (itemNext && itemNext2) {
|
|
114
121
|
const pointNext = getPoint(itemNext);
|
|
115
122
|
const pointNext2 = getPoint(itemNext2);
|
|
116
|
-
if (pointNext.x === pointNext2.x && pointNext.y === pointNext2.y) {
|
|
123
|
+
if (pointNext && pointNext2 && pointNext.x === pointNext2.x && pointNext.y === pointNext2.y) {
|
|
117
124
|
points1.push(pointNext);
|
|
118
125
|
}
|
|
119
126
|
} else {
|
|
@@ -349,13 +356,11 @@ function useCenter(canvas, propItems, emits, cumputedX, cumputedY, getXValue, ge
|
|
|
349
356
|
coolPoint && otherList.push(coolPoint);
|
|
350
357
|
}
|
|
351
358
|
}
|
|
352
|
-
let line;
|
|
353
359
|
let point;
|
|
354
|
-
|
|
355
|
-
line = points && nextPoint && !v.breakpoint ? drawLine([...points, ...nextPoint], {
|
|
360
|
+
const line = points && nextPoint && !v.breakpoint ? drawLine([...points, ...nextPoint], {
|
|
356
361
|
...lineAttr
|
|
357
362
|
}) : null;
|
|
358
|
-
previousLine = lineList[index - 1];
|
|
363
|
+
const previousLine = lineList[index - 1];
|
|
359
364
|
const pointAttrNew = {
|
|
360
365
|
origin: {
|
|
361
366
|
data: v,
|
|
@@ -1 +1,7 @@
|
|
|
1
|
+
import { Ref } from 'vue';
|
|
2
|
+
import { fabric } from '../utils';
|
|
3
|
+
import { IPropItems } from '../interface';
|
|
1
4
|
export declare function useEvent(element: HTMLCanvasElement | any): void;
|
|
5
|
+
export declare function useCanvasEvent(canvas: Ref<fabric.Canvas>, propItems: IPropItems, emits: any): {
|
|
6
|
+
select: (key: string) => void;
|
|
7
|
+
};
|