cnhis-design-vue 3.1.13-beta.3 → 3.1.13-beta.6
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/es/packages/big-table/src/BigTable.vue.d.ts +15 -7
- package/es/packages/big-table/src/BigTable.vue_vue_type_script_setup_true_lang.js +30 -19
- package/es/packages/big-table/src/utils.js +2 -1
- package/es/packages/big-table/style/index.css +5 -0
- package/es/packages/bpmn-workflow/src/BpmnWorkflow.d.ts +5 -0
- package/es/packages/bpmn-workflow/types/BpmnViewer.d.ts +1 -0
- package/es/packages/bpmn-workflow/types/ModelingModule.d.ts +1 -0
- package/es/packages/bpmn-workflow/types/MoveCanvasModule.d.ts +1 -0
- package/es/packages/fabric-chart/src/hooks/useCenter.js +58 -2
- package/es/packages/fabric-chart/src/hooks/useDraw.d.ts +1 -1
- package/es/packages/fabric-chart/src/hooks/useDraw.js +59 -6
- package/es/packages/fabric-chart/src/hooks/useOther.js +3 -2
- package/es/packages/fabric-chart/src/interface.d.ts +1 -0
- package/es/packages/fabric-chart/src/utils/index.d.ts +6823 -2
- package/es/packages/form-render/index.d.ts +9 -0
- package/es/packages/form-render/src/FormRender.vue.d.ts +9 -0
- package/es/packages/form-render/src/FormRender.vue_vue_type_script_setup_true_lang.js +2 -1
- package/es/packages/form-render/src/components/renderer/formItem.d.ts +8 -293
- package/es/packages/form-render/src/components/renderer/formItem.js +135 -2
- package/es/packages/form-render/src/constants/index.d.ts +2 -1
- package/es/packages/form-render/src/constants/index.js +2 -1
- package/es/packages/form-render/src/hooks/useFieldListAdaptor.js +3 -1
- package/es/packages/form-render/src/hooks/useFormContext.d.ts +2 -1
- package/es/packages/form-render/src/hooks/useFormContext.js +13 -2
- package/es/packages/form-render/style/index.css +23 -0
- package/es/packages/index.css +28 -0
- package/es/packages/scale-view/src/hooks/scaleview-init.js +1 -5
- package/es/packages/scale-view/src/hooks/scaleview-submit.js +1 -6
- package/es/packages/scale-view/src/hooks/scaleview-validate.js +0 -3
- package/package.json +1 -1
- package/test.ts +0 -326
|
@@ -1080,7 +1080,9 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
1080
1080
|
textColorSuccess: string;
|
|
1081
1081
|
textColorHoverSuccess: string;
|
|
1082
1082
|
textColorPressedSuccess: string;
|
|
1083
|
-
textColorFocusSuccess: string;
|
|
1083
|
+
textColorFocusSuccess: string; /**
|
|
1084
|
+
* 删除选中scan数据
|
|
1085
|
+
*/
|
|
1084
1086
|
textColorDisabledSuccess: string;
|
|
1085
1087
|
textColorTextSuccess: string;
|
|
1086
1088
|
textColorTextHoverSuccess: string;
|
|
@@ -1098,7 +1100,12 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
1098
1100
|
borderFocusSuccess: string;
|
|
1099
1101
|
borderDisabledSuccess: string;
|
|
1100
1102
|
rippleColorSuccess: string;
|
|
1101
|
-
colorWarning: string;
|
|
1103
|
+
colorWarning: string; /**
|
|
1104
|
+
* 判断是否渲染EditForm
|
|
1105
|
+
* @param {*} row
|
|
1106
|
+
* @param {*} column
|
|
1107
|
+
* @returns
|
|
1108
|
+
*/
|
|
1102
1109
|
colorHoverWarning: string;
|
|
1103
1110
|
colorPressedWarning: string;
|
|
1104
1111
|
colorFocusWarning: string;
|
|
@@ -1173,10 +1180,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
1173
1180
|
}, any>>;
|
|
1174
1181
|
readonly themeOverrides: import("vue").PropType<import("naive-ui/es/_mixins/use-theme").ExtractThemeOverrides<import("naive-ui/es/_mixins").Theme<"Button", {
|
|
1175
1182
|
heightTiny: string;
|
|
1176
|
-
heightSmall: string;
|
|
1177
|
-
* 单个form提交失败
|
|
1178
|
-
* @param {*} obj
|
|
1179
|
-
*/
|
|
1183
|
+
heightSmall: string;
|
|
1180
1184
|
heightMedium: string;
|
|
1181
1185
|
heightLarge: string;
|
|
1182
1186
|
borderRadiusTiny: string;
|
|
@@ -1195,6 +1199,10 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
1195
1199
|
colorSecondaryHover: string;
|
|
1196
1200
|
colorSecondaryPressed: string;
|
|
1197
1201
|
colorTertiary: string;
|
|
1202
|
+
/**
|
|
1203
|
+
* 避免每次点击都查询
|
|
1204
|
+
* 初始化查一次 行编辑 表单search用
|
|
1205
|
+
*/
|
|
1198
1206
|
colorTertiaryHover: string;
|
|
1199
1207
|
colorTertiaryPressed: string;
|
|
1200
1208
|
colorQuaternary: string;
|
|
@@ -1297,7 +1305,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
1297
1305
|
textColorGhostSuccess: string;
|
|
1298
1306
|
textColorGhostHoverSuccess: string;
|
|
1299
1307
|
textColorGhostPressedSuccess: string;
|
|
1300
|
-
textColorGhostFocusSuccess: string;
|
|
1308
|
+
textColorGhostFocusSuccess: string; /** string */
|
|
1301
1309
|
textColorGhostDisabledSuccess: string;
|
|
1302
1310
|
borderSuccess: string;
|
|
1303
1311
|
borderHoverSuccess: string;
|
|
@@ -423,9 +423,16 @@ var script = /* @__PURE__ */ defineComponent({
|
|
|
423
423
|
};
|
|
424
424
|
}
|
|
425
425
|
const currentColumns = fieldList.map((item, index) => {
|
|
426
|
-
var _a2, _b2, _c, _d;
|
|
427
|
-
let filterField =
|
|
428
|
-
let
|
|
426
|
+
var _a2, _b2, _c, _d, _e;
|
|
427
|
+
let filterField = false;
|
|
428
|
+
let filterItems = [];
|
|
429
|
+
try {
|
|
430
|
+
const fieldSetting = JSON.parse(item.fieldSetting);
|
|
431
|
+
filterField = ((_a2 = fieldSetting == null ? void 0 : fieldSetting.mapping) == null ? void 0 : _a2.type) === "manual" && item.isMerge != 1;
|
|
432
|
+
filterItems = (_c = (_b2 = fieldSetting == null ? void 0 : fieldSetting.mapping) == null ? void 0 : _b2.mappingFiled) == null ? void 0 : _c.map((item2) => item2.value[0]);
|
|
433
|
+
} catch (e) {
|
|
434
|
+
}
|
|
435
|
+
let notParticipatingSort = ((_d = item == null ? void 0 : item.fieldSetting) == null ? void 0 : _d.notParticipatingSort) || "";
|
|
429
436
|
let fixed = isAboutNestTable.value ? "" : item.isFixed ? item.isFixed == 1 ? "left" : "right" : "";
|
|
430
437
|
let sortable = props.isNestTable ? false : !filterField && item.isSort == 1 && notParticipatingSort != 1 && item.isMerge != 1;
|
|
431
438
|
let treeNode = props.isNestTable ? false : state.isTree != 0 ? index === 0 : false;
|
|
@@ -475,7 +482,10 @@ var script = /* @__PURE__ */ defineComponent({
|
|
|
475
482
|
editRender: isEdit ? {} : generateEditRender(item)
|
|
476
483
|
});
|
|
477
484
|
if (filterField && !props.isNestTable && !isScanMultiTable2) {
|
|
478
|
-
state.filterFields[item.columnName] = Object.assign({}, vexutils.clone(
|
|
485
|
+
state.filterFields[item.columnName] = Object.assign({}, vexutils.clone({
|
|
486
|
+
...item,
|
|
487
|
+
setting: item.settingObj
|
|
488
|
+
}, true), {
|
|
479
489
|
visible: false,
|
|
480
490
|
left: "initial",
|
|
481
491
|
right: "initial",
|
|
@@ -484,7 +494,8 @@ var script = /* @__PURE__ */ defineComponent({
|
|
|
484
494
|
checkAll: false,
|
|
485
495
|
searchFilterText: "",
|
|
486
496
|
searchFilterCONVERT: [],
|
|
487
|
-
filterSort: ""
|
|
497
|
+
filterSort: "",
|
|
498
|
+
filterItems
|
|
488
499
|
});
|
|
489
500
|
let field = state.filterFields[item.columnName];
|
|
490
501
|
handlerInitSearchItem([field]);
|
|
@@ -495,7 +506,7 @@ var script = /* @__PURE__ */ defineComponent({
|
|
|
495
506
|
if (!isScanMultiTable2) {
|
|
496
507
|
col.slots.footer = "tooltip_footer";
|
|
497
508
|
}
|
|
498
|
-
if (props.showNestTable && state.isTree == 0 && ((
|
|
509
|
+
if (props.showNestTable && state.isTree == 0 && ((_e = props.curNestColumnConfig) == null ? void 0 : _e.isTree) == 0) {
|
|
499
510
|
col.slots.content = "nest_table_content";
|
|
500
511
|
}
|
|
501
512
|
return col;
|
|
@@ -734,7 +745,7 @@ var script = /* @__PURE__ */ defineComponent({
|
|
|
734
745
|
"class": "filter-header-icon vxe-filter--btn vxe-icon--funnel"
|
|
735
746
|
}, null), createVNode("span", {
|
|
736
747
|
"class": "filter-header-text"
|
|
737
|
-
}, [createTextVNode("\u7B5B\u9009")])]), field.
|
|
748
|
+
}, [createTextVNode("\u7B5B\u9009")])]), field.filterItems.length > 5 ? createVNode("div", {
|
|
738
749
|
"class": "checkbox-wrap checkbox-wrap--search"
|
|
739
750
|
}, [createVNode("div", {
|
|
740
751
|
"class": "check-search-wrap"
|
|
@@ -763,10 +774,10 @@ var script = /* @__PURE__ */ defineComponent({
|
|
|
763
774
|
}, {
|
|
764
775
|
default: () => [createVNode(NSpace, {
|
|
765
776
|
"item-style": "display: flex;"
|
|
766
|
-
}, _isSlot(_slot = field.
|
|
777
|
+
}, _isSlot(_slot = field.filterItems.map((item2) => {
|
|
767
778
|
return createVNode(NCheckbox, {
|
|
768
779
|
"value": item2.value,
|
|
769
|
-
"label": item2.
|
|
780
|
+
"label": item2.key
|
|
770
781
|
}, null);
|
|
771
782
|
})) ? _slot : {
|
|
772
783
|
default: () => [_slot]
|
|
@@ -777,15 +788,15 @@ var script = /* @__PURE__ */ defineComponent({
|
|
|
777
788
|
}, {
|
|
778
789
|
default: () => [createVNode(NSpace, {
|
|
779
790
|
"item-style": "display: flex;"
|
|
780
|
-
}, _isSlot(_slot2 = field.
|
|
791
|
+
}, _isSlot(_slot2 = field.filterItems.filter((item2) => {
|
|
781
792
|
if (!field.searchFilterText)
|
|
782
793
|
return item2;
|
|
783
794
|
let reg = new RegExp(field.searchFilterText);
|
|
784
|
-
return reg.test(item2.
|
|
795
|
+
return reg.test(item2.key);
|
|
785
796
|
}).map((item2) => {
|
|
786
797
|
return createVNode(NCheckbox, {
|
|
787
798
|
"value": item2.value,
|
|
788
|
-
"label": item2.
|
|
799
|
+
"label": item2.key
|
|
789
800
|
}, null);
|
|
790
801
|
})) ? _slot2 : {
|
|
791
802
|
default: () => [_slot2]
|
|
@@ -835,12 +846,12 @@ var script = /* @__PURE__ */ defineComponent({
|
|
|
835
846
|
const handleFilterSeach = (val, field) => {
|
|
836
847
|
field.searchFilterText = val;
|
|
837
848
|
if (val === "") {
|
|
838
|
-
field.checkAll = field.CONVERT.length === field.
|
|
839
|
-
field.indeterminate = !!field.CONVERT.length && field.CONVERT.length !== field.
|
|
849
|
+
field.checkAll = field.CONVERT.length === field.filterItems.length;
|
|
850
|
+
field.indeterminate = !!field.CONVERT.length && field.CONVERT.length !== field.filterItems.length;
|
|
840
851
|
return;
|
|
841
852
|
}
|
|
842
|
-
field.searchFilterCONVERT = field.
|
|
843
|
-
return field.searchFilterText === item.
|
|
853
|
+
field.searchFilterCONVERT = field.filterItems.filter((item) => {
|
|
854
|
+
return field.searchFilterText === item.key && field.CONVERT.includes(item.value);
|
|
844
855
|
}).map((item) => item.value);
|
|
845
856
|
_beforeSearchConvert = field.searchFilterCONVERT;
|
|
846
857
|
};
|
|
@@ -849,15 +860,15 @@ var script = /* @__PURE__ */ defineComponent({
|
|
|
849
860
|
let checked = val;
|
|
850
861
|
field.indeterminate = false;
|
|
851
862
|
field.checkAll = checked;
|
|
852
|
-
state.filterFields[field.columnName].CONVERT = checked ? field.
|
|
863
|
+
state.filterFields[field.columnName].CONVERT = checked ? field.filterItems.map((item) => {
|
|
853
864
|
return item.value;
|
|
854
865
|
}) : [];
|
|
855
866
|
};
|
|
856
867
|
const handleFilterChange = (value, name, field) => {
|
|
857
868
|
reScrollFilterWrap();
|
|
858
869
|
state.filterFields[name].CONVERT = value;
|
|
859
|
-
field.checkAll = value.length === field.
|
|
860
|
-
field.indeterminate = !!value.length && value.length !== field.
|
|
870
|
+
field.checkAll = value.length === field.filterItems.length;
|
|
871
|
+
field.indeterminate = !!value.length && value.length !== field.filterItems.length;
|
|
861
872
|
};
|
|
862
873
|
const handleFilterSearchChange = (value, columnName, field) => {
|
|
863
874
|
reScrollFilterWrap();
|
|
@@ -207,6 +207,7 @@ const handlerInitSearchItem = (arr) => {
|
|
|
207
207
|
if (!Array.isArray(arr))
|
|
208
208
|
return;
|
|
209
209
|
arr.forEach((el) => {
|
|
210
|
+
var _a;
|
|
210
211
|
if (el.setting) {
|
|
211
212
|
el.setting = typeof el.setting == "string" ? JSON.parse(el.setting) : el.setting;
|
|
212
213
|
if (!vexutils.isEmpty(el.setting.wordbook)) {
|
|
@@ -224,7 +225,7 @@ const handlerInitSearchItem = (arr) => {
|
|
|
224
225
|
return;
|
|
225
226
|
}
|
|
226
227
|
}
|
|
227
|
-
if (el.fieldType.includes("DATE")) {
|
|
228
|
+
if ((_a = el.fieldType) == null ? void 0 : _a.includes("DATE")) {
|
|
228
229
|
if (el.settingObj && el.settingObj.attr == "BIRTHDAY") {
|
|
229
230
|
el["con"] = "BIRTHDAY";
|
|
230
231
|
el["showDate"] = false;
|
|
@@ -249,6 +249,11 @@ body > .vxe-table--tooltip-wrapper {
|
|
|
249
249
|
height: 100%;
|
|
250
250
|
line-height: unset;
|
|
251
251
|
width: 100%;
|
|
252
|
+
display: inline-flex;
|
|
253
|
+
}
|
|
254
|
+
.custom-big-table .vxe-table .vxe-table--header .col--seq .vxe-cell--title,
|
|
255
|
+
.custom-big-table .vxe-table .vxe-table--header .col--checkbox .vxe-cell--title {
|
|
256
|
+
display: inline-block;
|
|
252
257
|
}
|
|
253
258
|
.custom-big-table .vxe-table .vxe-table--footer-wrapper.body--wrapper::-webkit-scrollbar,
|
|
254
259
|
.custom-big-table .vxe-table .vxe-table--body-wrapper::-webkit-scrollbar {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
declare module 'bpmn-js/lib/Viewer';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
declare module 'bpmn-js/lib/features/modeling';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
declare module 'diagram-js/lib/navigation/movecanvas';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { reactive, onMounted, nextTick } from 'vue';
|
|
2
2
|
import { fabric } from '../utils/index.js';
|
|
3
|
-
import { defaultStyle,
|
|
3
|
+
import { defaultStyle, drawPoint, drawLine, defaultTextStyle } from './useDraw.js';
|
|
4
4
|
import useGrid from './useGrid.js';
|
|
5
5
|
import { useShadow } from './useShadow.js';
|
|
6
6
|
import { TEMPERATURE_MENU, PAIN_MENU } from './constant.js';
|
|
@@ -36,6 +36,8 @@ function useCenter(canvas, propItems, emits, cumputedX, cumputedY, getXValue, ge
|
|
|
36
36
|
target: null
|
|
37
37
|
});
|
|
38
38
|
const shadowLinesCache = /* @__PURE__ */ new Set();
|
|
39
|
+
const maiboPoints = /* @__PURE__ */ new Set();
|
|
40
|
+
const otherPoints = /* @__PURE__ */ new Set();
|
|
39
41
|
onMounted(() => {
|
|
40
42
|
nextTick(() => {
|
|
41
43
|
init();
|
|
@@ -43,11 +45,14 @@ function useCenter(canvas, propItems, emits, cumputedX, cumputedY, getXValue, ge
|
|
|
43
45
|
});
|
|
44
46
|
function init() {
|
|
45
47
|
drawShaDow();
|
|
48
|
+
maiboPoints.clear();
|
|
49
|
+
otherPoints.clear();
|
|
46
50
|
left.yScaleValue.forEach((scaleValue) => {
|
|
47
51
|
scaleValue.dataList.forEach((item, dataIndex) => {
|
|
48
52
|
drawPolyLine(item, dataIndex, scaleValue);
|
|
49
53
|
});
|
|
50
54
|
});
|
|
55
|
+
drawOverlapPoint();
|
|
51
56
|
setCanvasEvent();
|
|
52
57
|
}
|
|
53
58
|
function drawShaDow(target) {
|
|
@@ -145,6 +150,7 @@ function useCenter(canvas, propItems, emits, cumputedX, cumputedY, getXValue, ge
|
|
|
145
150
|
pointMenuProps.point = { x, y };
|
|
146
151
|
pointMenuProps.show = true;
|
|
147
152
|
const { type } = ((_a = event.target) == null ? void 0 : _a.origin) || {};
|
|
153
|
+
console.log(999, type);
|
|
148
154
|
if (event.target && (type === "temperature" || type === "pain")) {
|
|
149
155
|
if (type === "temperature") {
|
|
150
156
|
pointMenuProps.list = [...TEMPERATURE_MENU];
|
|
@@ -181,13 +187,57 @@ function useCenter(canvas, propItems, emits, cumputedX, cumputedY, getXValue, ge
|
|
|
181
187
|
}
|
|
182
188
|
function getEqualXTypes(pointX) {
|
|
183
189
|
const types = [];
|
|
190
|
+
const left2 = cumputedX(getXValue(pointX));
|
|
184
191
|
canvas.value.forEachObject((obj) => {
|
|
185
|
-
if (obj.origin &&
|
|
192
|
+
if (obj.origin && left2 === obj.left) {
|
|
186
193
|
types.push(obj.origin.type);
|
|
187
194
|
}
|
|
188
195
|
});
|
|
189
196
|
return [...new Set(types)];
|
|
190
197
|
}
|
|
198
|
+
function drawOverlapPoint() {
|
|
199
|
+
var _a;
|
|
200
|
+
const pulseObj = left.yScaleValue.find((item) => item.type === "pulse");
|
|
201
|
+
if (!pulseObj || !((_a = pulseObj.dataList) == null ? void 0 : _a.length))
|
|
202
|
+
return;
|
|
203
|
+
if (!pulseObj.dataList.some((item) => item.title.includes("\u8109\u640F")))
|
|
204
|
+
return;
|
|
205
|
+
const overlap = left.overlap || {};
|
|
206
|
+
const points = [];
|
|
207
|
+
maiboPoints.size && [...maiboPoints].forEach((item) => {
|
|
208
|
+
[...otherPoints].forEach((obj) => {
|
|
209
|
+
if (obj.origin && item.left === obj.left && item.top === obj.top) {
|
|
210
|
+
const key = obj.origin.key;
|
|
211
|
+
if (key) {
|
|
212
|
+
const pointer = {
|
|
213
|
+
left: obj.left,
|
|
214
|
+
top: obj.top,
|
|
215
|
+
...defaultStyle,
|
|
216
|
+
hoverCursor: "default"
|
|
217
|
+
};
|
|
218
|
+
let type = "koumai";
|
|
219
|
+
if (key === "yemai") {
|
|
220
|
+
type = key;
|
|
221
|
+
}
|
|
222
|
+
if (key === "humai") {
|
|
223
|
+
type = "circle";
|
|
224
|
+
}
|
|
225
|
+
points.push(drawPoint(type, {
|
|
226
|
+
...overlap[key] || {},
|
|
227
|
+
...pointer
|
|
228
|
+
}));
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
});
|
|
232
|
+
});
|
|
233
|
+
setTimeout(() => {
|
|
234
|
+
canvas.value.add(...points);
|
|
235
|
+
points.forEach((v) => {
|
|
236
|
+
v == null ? void 0 : v.bringToFront();
|
|
237
|
+
});
|
|
238
|
+
canvas.value.renderAll();
|
|
239
|
+
});
|
|
240
|
+
}
|
|
191
241
|
function drawPolyLine(item, dataIndex, scaleValue) {
|
|
192
242
|
const {
|
|
193
243
|
pointAttr = {},
|
|
@@ -290,6 +340,7 @@ function useCenter(canvas, propItems, emits, cumputedX, cumputedY, getXValue, ge
|
|
|
290
340
|
origin: {
|
|
291
341
|
data: v,
|
|
292
342
|
title: item.title,
|
|
343
|
+
key: item.key || "",
|
|
293
344
|
unit: scaleValue.unit,
|
|
294
345
|
type: scaleValue.type,
|
|
295
346
|
dataIndex,
|
|
@@ -323,6 +374,11 @@ function useCenter(canvas, propItems, emits, cumputedX, cumputedY, getXValue, ge
|
|
|
323
374
|
}
|
|
324
375
|
lineList.push(line);
|
|
325
376
|
if (point) {
|
|
377
|
+
if (item.title.includes("\u8109\u640F")) {
|
|
378
|
+
maiboPoints.add(point);
|
|
379
|
+
} else {
|
|
380
|
+
otherPoints.add(point);
|
|
381
|
+
}
|
|
326
382
|
setPointEvent(point);
|
|
327
383
|
pointList.push(point);
|
|
328
384
|
}
|
|
@@ -39,4 +39,4 @@ export declare const defaultTextStyle: {
|
|
|
39
39
|
};
|
|
40
40
|
export declare function drawLine(points: number[], style: Partial<ILineOptions>): fabric.Line;
|
|
41
41
|
export declare function drawTextGroup(rectStyle: Partial<fabric.IRectOptions>, fontStyle: Partial<ITextOptions>, groupStyle: Partial<fabric.IGroupOptions>): fabric.Group;
|
|
42
|
-
export declare function drawPoint(type: string | undefined, style: any): fabric.
|
|
42
|
+
export declare function drawPoint(type: string | undefined, style: any): fabric.Object;
|
|
@@ -57,7 +57,6 @@ function drawTextGroup(rectStyle, fontStyle, groupStyle) {
|
|
|
57
57
|
});
|
|
58
58
|
}
|
|
59
59
|
function drawPoint(type = "circle", style) {
|
|
60
|
-
let point = null;
|
|
61
60
|
const newStyle = {
|
|
62
61
|
originX: "center",
|
|
63
62
|
originY: "center",
|
|
@@ -65,27 +64,81 @@ function drawPoint(type = "circle", style) {
|
|
|
65
64
|
hasBorders: false,
|
|
66
65
|
...style
|
|
67
66
|
};
|
|
67
|
+
const createCircleBorder = () => {
|
|
68
|
+
return new fabric.Circle({
|
|
69
|
+
objectCaching: false,
|
|
70
|
+
strokeWidth: style.strokeWidth || 1,
|
|
71
|
+
stroke: style.stroke || "red",
|
|
72
|
+
radius: style.radius || 5,
|
|
73
|
+
fill: "#fff"
|
|
74
|
+
});
|
|
75
|
+
};
|
|
68
76
|
switch (type) {
|
|
69
77
|
case "triangle":
|
|
70
|
-
|
|
78
|
+
return new fabric.Triangle({
|
|
71
79
|
width: 20,
|
|
72
80
|
height: 20,
|
|
73
81
|
strokeWidth: 1,
|
|
74
82
|
scale: 1,
|
|
75
83
|
...newStyle
|
|
76
84
|
});
|
|
77
|
-
break;
|
|
78
85
|
case "circle":
|
|
79
|
-
|
|
86
|
+
return new fabric.Circle({
|
|
80
87
|
objectCaching: false,
|
|
81
88
|
strokeWidth: 1,
|
|
82
89
|
radius: 5,
|
|
83
90
|
scale: 1,
|
|
84
91
|
...newStyle
|
|
85
92
|
});
|
|
86
|
-
|
|
93
|
+
case "image":
|
|
94
|
+
if (style == null ? void 0 : style.url) ; else {
|
|
95
|
+
return new fabric.Image(style.element, {
|
|
96
|
+
...newStyle,
|
|
97
|
+
scale: 1
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
case "yemai":
|
|
101
|
+
const createAdd = () => {
|
|
102
|
+
const width = ((style.radius || 5) + (style.strokeWidth || 1)) * 2;
|
|
103
|
+
const subLineStyle = {
|
|
104
|
+
stroke: style.strokeX || "blue",
|
|
105
|
+
strokeWidth: style.strokeWidthX || 1,
|
|
106
|
+
originX: "center",
|
|
107
|
+
originY: "center"
|
|
108
|
+
};
|
|
109
|
+
const line1 = new fabric.Line([0, width / 2, width, width / 2], subLineStyle);
|
|
110
|
+
const line2 = new fabric.Line([width / 2, 0, width / 2, width], subLineStyle);
|
|
111
|
+
return new fabric.Group([line1, line2]);
|
|
112
|
+
};
|
|
113
|
+
return new fabric.Group([createCircleBorder(), createAdd()], {
|
|
114
|
+
scale: 1,
|
|
115
|
+
...newStyle
|
|
116
|
+
});
|
|
117
|
+
case "koumai":
|
|
118
|
+
const left = (style.radius || 5) + (style.strokeWidth || 1);
|
|
119
|
+
const circle = new fabric.Circle({
|
|
120
|
+
objectCaching: false,
|
|
121
|
+
radius: style.radiusCircle || 2,
|
|
122
|
+
fill: style.fillCircle || "#000",
|
|
123
|
+
originX: "center",
|
|
124
|
+
originY: "center",
|
|
125
|
+
left,
|
|
126
|
+
top: left
|
|
127
|
+
});
|
|
128
|
+
return new fabric.Group([createCircleBorder(), circle], {
|
|
129
|
+
scale: 1,
|
|
130
|
+
...newStyle
|
|
131
|
+
});
|
|
132
|
+
default:
|
|
133
|
+
style && Reflect.deleteProperty(style, "stroke");
|
|
134
|
+
return new fabric.Text(String(type), {
|
|
135
|
+
fontFamily: "\u5FAE\u8F6F\u96C5\u9ED1",
|
|
136
|
+
scale: 1,
|
|
137
|
+
fontSize: 14,
|
|
138
|
+
fill: "#000",
|
|
139
|
+
...newStyle
|
|
140
|
+
});
|
|
87
141
|
}
|
|
88
|
-
return point;
|
|
89
142
|
}
|
|
90
143
|
|
|
91
144
|
export { defaultBorderStyle, defaultLineStyle, defaultRectStyle, defaultStyle, defaultTextStyle, drawLine, drawPoint, drawTextGroup };
|
|
@@ -9,13 +9,14 @@ function useOther(canvas, propItems, cumputedX) {
|
|
|
9
9
|
return false;
|
|
10
10
|
const list = [];
|
|
11
11
|
other.list.forEach((v, i) => {
|
|
12
|
+
var _a;
|
|
12
13
|
const text = new fabric.Text(String(v.value.toString().split("").join("\n")), {
|
|
13
14
|
originX: "center",
|
|
14
|
-
top: vitalSignsOriginY.originY,
|
|
15
|
+
top: (((_a = v.style) == null ? void 0 : _a.baseTop) || 0) + vitalSignsOriginY.originY,
|
|
15
16
|
left: cumputedX(v.time),
|
|
16
17
|
textAlign: "center",
|
|
17
18
|
...defaultStyle,
|
|
18
|
-
...
|
|
19
|
+
...v.style || {}
|
|
19
20
|
});
|
|
20
21
|
list.push(text);
|
|
21
22
|
});
|