cnhis-design-vue 3.1.9-beta.12 → 3.1.9-beta.13
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/fabric-chart/index.d.ts +34 -0
- package/es/packages/fabric-chart/src/FabricChart.vue.d.ts +34 -0
- package/es/packages/fabric-chart/src/FabricChart.vue_vue_type_script_setup_true_lang.js +12 -9
- package/es/packages/fabric-chart/src/hooks/useCenter.d.ts +4 -0
- package/es/packages/fabric-chart/src/hooks/useCenter.js +7 -0
- package/es/packages/fabric-chart/src/hooks/useDraw.d.ts +10 -3
- package/es/packages/fabric-chart/src/hooks/useDraw.js +9 -8
- package/es/packages/fabric-chart/src/hooks/useGrid.d.ts +4 -1
- package/es/packages/fabric-chart/src/hooks/useGrid.js +4 -6
- package/es/packages/fabric-chart/src/hooks/useLeft.d.ts +4 -0
- package/es/packages/fabric-chart/src/hooks/useLeft.js +66 -0
- package/es/packages/fabric-chart/src/hooks/useTop.d.ts +4 -0
- package/es/packages/fabric-chart/src/hooks/useTop.js +124 -0
- package/es/packages/fabric-chart/src/interface.d.ts +10 -2
- package/es/packages/fabric-chart/src/utils/index.d.ts +2 -0
- package/es/packages/fabric-chart/src/utils/index.js +15352 -0
- package/es/packages/form-render/index.d.ts +1 -1
- package/es/packages/form-render/index.js +1 -0
- package/es/packages/form-render/src/FormRender.vue.d.ts +1 -1
- package/es/packages/form-render/src/FormRender.vue_vue_type_script_setup_true_lang.js +9 -4
- package/es/packages/form-render/src/hooks/index.d.ts +1 -0
- package/es/packages/form-render/src/hooks/index.js +1 -0
- package/es/packages/form-render/src/hooks/useInitialData.d.ts +5 -0
- package/es/packages/form-render/src/hooks/useInitialData.js +11 -0
- package/es/packages/index.css +13 -4
- package/es/packages/index.js +1 -0
- package/es/packages/scale-view/src/ScaleView.vue_vue_type_script_setup_true_lang.js +6 -2
- package/es/packages/scale-view/src/components/composables/choose-common.d.ts +1 -0
- package/es/packages/scale-view/src/components/composables/choose-common.js +6 -1
- package/es/packages/scale-view/src/components/formitem/r-checkbox.js +11 -5
- package/es/packages/scale-view/src/components/formitem/r-radio.js +14 -7
- package/es/packages/scale-view/src/hooks/scaleview-init.js +3 -1
- package/es/packages/scale-view/style/index.css +13 -4
- package/es/packages/select-label/src/LabelFormContent.vue_vue_type_script_setup_true_lang.js +1 -2
- package/package.json +1 -4
- package/es/packages/bpmn-workflow/src/BpmnWorkflow.d.js +0 -1
- package/es/packages/bpmn-workflow/types/BpmnViewer.d.js +0 -1
- package/es/packages/bpmn-workflow/types/ModelingModule.d.js +0 -1
- package/es/packages/bpmn-workflow/types/MoveCanvasModule.d.js +0 -1
- package/es/packages/fabric-chart/src/Center.js +0 -4
- package/es/packages/fabric-chart/src/Center.vue.d.ts +0 -2
- package/es/packages/fabric-chart/src/Center.vue_vue_type_script_setup_true_lang.js +0 -15
- package/es/packages/fabric-chart/src/Top.js +0 -4
- package/es/packages/fabric-chart/src/Top.vue_vue_type_script_setup_true_lang.js +0 -128
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { SFCWithInstall } from '../../../es/src/types';
|
|
2
|
+
declare const FabricChart: SFCWithInstall<import("vue").DefineComponent<{
|
|
3
|
+
data: {
|
|
4
|
+
type: null;
|
|
5
|
+
required: true;
|
|
6
|
+
};
|
|
7
|
+
}, {
|
|
8
|
+
props: {
|
|
9
|
+
data: import("./src/interface").IData;
|
|
10
|
+
};
|
|
11
|
+
canvasRef: any;
|
|
12
|
+
canvas: import("vue").Ref<any>;
|
|
13
|
+
gridXNumber: import("vue").ComputedRef<number>;
|
|
14
|
+
gridYNumber: import("vue").ComputedRef<number>;
|
|
15
|
+
endX: import("vue").ComputedRef<number>;
|
|
16
|
+
originX: import("vue").ComputedRef<number>;
|
|
17
|
+
endY: import("vue").ComputedRef<number>;
|
|
18
|
+
originY: import("vue").ComputedRef<number>;
|
|
19
|
+
xCellWidth: import("vue").ComputedRef<number>;
|
|
20
|
+
yCellHeight: import("vue").ComputedRef<number>;
|
|
21
|
+
xScaleList: import("vue").ComputedRef<number[]>;
|
|
22
|
+
xScaleCell: import("vue").ComputedRef<number>;
|
|
23
|
+
breatheYCell: import("vue").ComputedRef<number>;
|
|
24
|
+
pulseYCell: import("vue").ComputedRef<number>;
|
|
25
|
+
centigradeYCell: import("vue").ComputedRef<number>;
|
|
26
|
+
event: import("vue").ComputedRef<any>;
|
|
27
|
+
propItems: any;
|
|
28
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
29
|
+
data: {
|
|
30
|
+
type: null;
|
|
31
|
+
required: true;
|
|
32
|
+
};
|
|
33
|
+
}>>, {}>>;
|
|
34
|
+
export default FabricChart;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { IData } from './interface';
|
|
2
|
+
declare const _default: import("vue").DefineComponent<{
|
|
3
|
+
data: {
|
|
4
|
+
type: null;
|
|
5
|
+
required: true;
|
|
6
|
+
};
|
|
7
|
+
}, {
|
|
8
|
+
props: {
|
|
9
|
+
data: IData;
|
|
10
|
+
};
|
|
11
|
+
canvasRef: any;
|
|
12
|
+
canvas: import("vue").Ref<any>;
|
|
13
|
+
gridXNumber: import("vue").ComputedRef<number>;
|
|
14
|
+
gridYNumber: import("vue").ComputedRef<number>;
|
|
15
|
+
endX: import("vue").ComputedRef<number>;
|
|
16
|
+
originX: import("vue").ComputedRef<number>;
|
|
17
|
+
endY: import("vue").ComputedRef<number>;
|
|
18
|
+
originY: import("vue").ComputedRef<number>;
|
|
19
|
+
xCellWidth: import("vue").ComputedRef<number>;
|
|
20
|
+
yCellHeight: import("vue").ComputedRef<number>;
|
|
21
|
+
xScaleList: import("vue").ComputedRef<number[]>;
|
|
22
|
+
xScaleCell: import("vue").ComputedRef<number>;
|
|
23
|
+
breatheYCell: import("vue").ComputedRef<number>;
|
|
24
|
+
pulseYCell: import("vue").ComputedRef<number>;
|
|
25
|
+
centigradeYCell: import("vue").ComputedRef<number>;
|
|
26
|
+
event: import("vue").ComputedRef<any>;
|
|
27
|
+
propItems: any;
|
|
28
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
29
|
+
data: {
|
|
30
|
+
type: null;
|
|
31
|
+
required: true;
|
|
32
|
+
};
|
|
33
|
+
}>>, {}>;
|
|
34
|
+
export default _default;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { defineComponent, ref, computed, reactive, provide, onMounted, openBlock, createElementBlock, createElementVNode
|
|
2
|
-
import { fabric } from '
|
|
3
|
-
import './Center.js';
|
|
4
|
-
import './Top.js';
|
|
1
|
+
import { defineComponent, ref, computed, reactive, provide, onMounted, openBlock, createElementBlock, createElementVNode } from 'vue';
|
|
2
|
+
import { fabric } from './utils/index.js';
|
|
5
3
|
import { InjectionCanvas, InjectionPropItems } from './interface.js';
|
|
6
|
-
import
|
|
7
|
-
import
|
|
4
|
+
import { defaultBorderStyle } from './hooks/useDraw.js';
|
|
5
|
+
import useTop from './hooks/useTop.js';
|
|
6
|
+
import useCenter from './hooks/useCenter.js';
|
|
7
|
+
import useLeft from './hooks/useLeft.js';
|
|
8
8
|
|
|
9
9
|
const _hoisted_1 = { class: "c-fabric-chart" };
|
|
10
10
|
var script = /* @__PURE__ */ defineComponent({
|
|
@@ -96,8 +96,10 @@ var script = /* @__PURE__ */ defineComponent({
|
|
|
96
96
|
const propItems = reactive({
|
|
97
97
|
canvasWidth: props.data.width,
|
|
98
98
|
canvasHeight: props.data.height,
|
|
99
|
+
borderStyle: props.data.borderStyle || defaultBorderStyle,
|
|
99
100
|
grid: props.data.grid,
|
|
100
101
|
top: props.data.top,
|
|
102
|
+
left: props.data.left,
|
|
101
103
|
gridXNumber: gridXNumber.value,
|
|
102
104
|
gridYNumber: gridYNumber.value,
|
|
103
105
|
originX: originX.value,
|
|
@@ -115,6 +117,9 @@ var script = /* @__PURE__ */ defineComponent({
|
|
|
115
117
|
});
|
|
116
118
|
provide(InjectionCanvas, canvas);
|
|
117
119
|
provide(InjectionPropItems, propItems);
|
|
120
|
+
useTop(canvas, propItems);
|
|
121
|
+
useCenter(canvas, propItems);
|
|
122
|
+
useLeft(canvas, propItems);
|
|
118
123
|
onMounted(() => {
|
|
119
124
|
canvas.value = new fabric.Canvas(canvasRef.value, {
|
|
120
125
|
width: propItems.canvasWidth,
|
|
@@ -130,9 +135,7 @@ var script = /* @__PURE__ */ defineComponent({
|
|
|
130
135
|
createElementVNode("canvas", {
|
|
131
136
|
ref_key: "canvasRef",
|
|
132
137
|
ref: canvasRef
|
|
133
|
-
}, null, 512)
|
|
134
|
-
createVNode(script$1),
|
|
135
|
-
createVNode(script$2)
|
|
138
|
+
}, null, 512)
|
|
136
139
|
]);
|
|
137
140
|
};
|
|
138
141
|
}
|
|
@@ -1,8 +1,15 @@
|
|
|
1
|
-
import { fabric } from '
|
|
1
|
+
import { fabric } from '../utils';
|
|
2
|
+
import { ILineOptions, ITextOptions } from '../interface';
|
|
2
3
|
export declare const defaultStyle: {
|
|
3
4
|
evented: boolean;
|
|
4
5
|
selectable: boolean;
|
|
5
6
|
};
|
|
7
|
+
export declare const defaultBorderStyle: {
|
|
8
|
+
evented: boolean;
|
|
9
|
+
selectable: boolean;
|
|
10
|
+
stroke: string;
|
|
11
|
+
strokeWidth: number;
|
|
12
|
+
};
|
|
6
13
|
export declare const defaultLineStyle: {
|
|
7
14
|
evented: boolean;
|
|
8
15
|
selectable: boolean;
|
|
@@ -30,6 +37,6 @@ export declare const defaultTextStyle: {
|
|
|
30
37
|
originY: string;
|
|
31
38
|
lineHeight: number;
|
|
32
39
|
};
|
|
33
|
-
export declare function drawLine(points: number[], style: Partial<
|
|
34
|
-
export declare function drawTextGroup(rectStyle: Partial<fabric.IRectOptions>, fontStyle: Partial<
|
|
40
|
+
export declare function drawLine(points: number[], style: Partial<ILineOptions>): fabric.Line;
|
|
41
|
+
export declare function drawTextGroup(rectStyle: Partial<fabric.IRectOptions>, fontStyle: Partial<ITextOptions>, groupStyle: Partial<fabric.IGroupOptions>): fabric.Group;
|
|
35
42
|
export declare function drawPoint(type: string, style: any): fabric.Triangle | fabric.Circle | undefined;
|
|
@@ -1,9 +1,14 @@
|
|
|
1
|
-
import { fabric } from '
|
|
1
|
+
import { fabric } from '../utils/index.js';
|
|
2
2
|
|
|
3
3
|
const defaultStyle = {
|
|
4
4
|
evented: false,
|
|
5
5
|
selectable: false
|
|
6
6
|
};
|
|
7
|
+
const defaultBorderStyle = {
|
|
8
|
+
stroke: "#999",
|
|
9
|
+
strokeWidth: 1,
|
|
10
|
+
...defaultStyle
|
|
11
|
+
};
|
|
7
12
|
const defaultLineStyle = {
|
|
8
13
|
stroke: "#000",
|
|
9
14
|
strokeWidth: 1,
|
|
@@ -29,21 +34,17 @@ const defaultTextStyle = {
|
|
|
29
34
|
...defaultStyle
|
|
30
35
|
};
|
|
31
36
|
function drawLine(points, style) {
|
|
32
|
-
if (!Array.isArray(points))
|
|
33
|
-
return null;
|
|
34
|
-
if (points.length < 4)
|
|
35
|
-
return null;
|
|
36
37
|
return new fabric.Line(points, {
|
|
37
38
|
...defaultLineStyle,
|
|
38
39
|
...style
|
|
39
40
|
});
|
|
40
41
|
}
|
|
41
|
-
function drawTextGroup(rectStyle, fontStyle, groupStyle
|
|
42
|
+
function drawTextGroup(rectStyle, fontStyle, groupStyle) {
|
|
42
43
|
const rect = new fabric.Rect({
|
|
43
44
|
...defaultRectStyle,
|
|
44
45
|
...rectStyle
|
|
45
46
|
});
|
|
46
|
-
const texts = new fabric.Text(String(
|
|
47
|
+
const texts = new fabric.Text(String(fontStyle.value), {
|
|
47
48
|
...defaultTextStyle,
|
|
48
49
|
...fontStyle
|
|
49
50
|
});
|
|
@@ -72,4 +73,4 @@ function drawPoint(type, style) {
|
|
|
72
73
|
}
|
|
73
74
|
}
|
|
74
75
|
|
|
75
|
-
export { defaultLineStyle, defaultRectStyle, defaultStyle, defaultTextStyle, drawLine, drawPoint, drawTextGroup };
|
|
76
|
+
export { defaultBorderStyle, defaultLineStyle, defaultRectStyle, defaultStyle, defaultTextStyle, drawLine, drawPoint, drawTextGroup };
|
|
@@ -1,10 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { fabric } from '
|
|
3
|
-
import {
|
|
1
|
+
import { onMounted, nextTick } from 'vue';
|
|
2
|
+
import { fabric } from '../utils/index.js';
|
|
3
|
+
import { drawLine } from './useDraw.js';
|
|
4
4
|
|
|
5
|
-
function useGrid(
|
|
6
|
-
const canvas = inject(InjectionCanvas);
|
|
7
|
-
const propItems = inject(InjectionPropItems);
|
|
5
|
+
function useGrid(canvas, propItems) {
|
|
8
6
|
const { gridYNumber, originY, grid, originX, endX, xCellWidth, yCellHeight, gridXNumber, endY } = propItems;
|
|
9
7
|
const yList = [];
|
|
10
8
|
const xList = [];
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { onMounted, nextTick } from 'vue';
|
|
2
|
+
import { fabric } from '../utils/index.js';
|
|
3
|
+
import { defaultTextStyle, defaultStyle, defaultRectStyle } from './useDraw.js';
|
|
4
|
+
|
|
5
|
+
function useLeft(canvas, propItems) {
|
|
6
|
+
const { originY, endY, originX, yCellHeight, borderStyle, left } = propItems;
|
|
7
|
+
function drawScaleValue() {
|
|
8
|
+
let groupList = [];
|
|
9
|
+
const column = left.yScaleValue.length;
|
|
10
|
+
const colWidth = originX / column;
|
|
11
|
+
const residue = originX % column;
|
|
12
|
+
const firstColWidth = colWidth + residue;
|
|
13
|
+
left.yScaleValue.forEach((item, index) => {
|
|
14
|
+
let list = [];
|
|
15
|
+
const rectWidth = index === 0 ? firstColWidth : colWidth;
|
|
16
|
+
const rectLeft = index === 0 ? 0 : firstColWidth + (index - 1) * colWidth;
|
|
17
|
+
const line = index > 0 ? new fabric.Line([rectLeft, originY, rectLeft, endY], {
|
|
18
|
+
...borderStyle
|
|
19
|
+
}) : null;
|
|
20
|
+
line && list.push(line);
|
|
21
|
+
const leftVal = rectLeft + rectWidth / 2;
|
|
22
|
+
const spaceGridNumber = left.spaceGridNumber || 5;
|
|
23
|
+
item.list.forEach((v, i) => {
|
|
24
|
+
const top = endY - i * yCellHeight * spaceGridNumber;
|
|
25
|
+
const text = new fabric.Text(String(v), {
|
|
26
|
+
...defaultTextStyle,
|
|
27
|
+
left: leftVal,
|
|
28
|
+
top: i === 0 ? top - 5 : top,
|
|
29
|
+
...item.style
|
|
30
|
+
});
|
|
31
|
+
list.push(text);
|
|
32
|
+
});
|
|
33
|
+
let title = item.name || "";
|
|
34
|
+
if (item.unit)
|
|
35
|
+
title += "\n" + item.unit;
|
|
36
|
+
title && list.push(new fabric.Text(String(title), {
|
|
37
|
+
...defaultTextStyle,
|
|
38
|
+
left: leftVal,
|
|
39
|
+
top: originY + yCellHeight * spaceGridNumber / 2,
|
|
40
|
+
textAlign: "center",
|
|
41
|
+
...item.style
|
|
42
|
+
}));
|
|
43
|
+
const group2 = new fabric.Group(list, defaultStyle);
|
|
44
|
+
groupList.push(group2);
|
|
45
|
+
});
|
|
46
|
+
groupList.push(new fabric.Rect({
|
|
47
|
+
...defaultStyle,
|
|
48
|
+
...defaultRectStyle,
|
|
49
|
+
width: originX,
|
|
50
|
+
height: endY - originY,
|
|
51
|
+
left: 0,
|
|
52
|
+
top: originY
|
|
53
|
+
}));
|
|
54
|
+
const group = groupList.length > 0 ? new fabric.Group([...groupList], { ...defaultStyle }) : null;
|
|
55
|
+
group && group.sendToBack();
|
|
56
|
+
group && canvas.value.add(group);
|
|
57
|
+
}
|
|
58
|
+
onMounted(() => {
|
|
59
|
+
nextTick(() => {
|
|
60
|
+
drawScaleValue();
|
|
61
|
+
canvas.value.renderAll();
|
|
62
|
+
});
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
export { useLeft as default };
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
import { onMounted, nextTick } from 'vue';
|
|
2
|
+
import { fabric } from '../utils/index.js';
|
|
3
|
+
import { defaultStyle, drawTextGroup, defaultTextStyle, defaultRectStyle } from './useDraw.js';
|
|
4
|
+
|
|
5
|
+
function useTop(canvas, propItems) {
|
|
6
|
+
const { originY, grid, originX, xCellWidth, gridXNumber, top } = propItems;
|
|
7
|
+
function drawTop() {
|
|
8
|
+
let list = [];
|
|
9
|
+
drawTopDate(list);
|
|
10
|
+
drawTopDay(list);
|
|
11
|
+
drawTopTime(list);
|
|
12
|
+
const group = list.length > 0 ? new fabric.Group([...list], { ...defaultStyle }) : null;
|
|
13
|
+
group && group.sendToBack();
|
|
14
|
+
group && canvas.value.add(group);
|
|
15
|
+
}
|
|
16
|
+
function drawTopTime(list) {
|
|
17
|
+
var _a, _b;
|
|
18
|
+
const dateHeight = ((_a = top.date) == null ? void 0 : _a.height) || 0;
|
|
19
|
+
const dayHeight = top.dayHeight || 0;
|
|
20
|
+
const height = originY - dateHeight - dayHeight;
|
|
21
|
+
const titleHeight = dayHeight + height;
|
|
22
|
+
const title = drawTextGroup({
|
|
23
|
+
width: originX,
|
|
24
|
+
height: titleHeight,
|
|
25
|
+
...defaultRectStyle
|
|
26
|
+
}, {
|
|
27
|
+
value: top.xScalevalue.title,
|
|
28
|
+
...defaultTextStyle,
|
|
29
|
+
...((_b = top.date) == null ? void 0 : _b.style) || {}
|
|
30
|
+
}, {
|
|
31
|
+
left: 0,
|
|
32
|
+
top: dateHeight
|
|
33
|
+
});
|
|
34
|
+
list.push(title);
|
|
35
|
+
let timeList = [];
|
|
36
|
+
for (let j = 0; j < grid.mainXCell; j++) {
|
|
37
|
+
timeList.push(top.xScalevalue.list);
|
|
38
|
+
}
|
|
39
|
+
timeList.flat().forEach((v, i) => {
|
|
40
|
+
var _a2;
|
|
41
|
+
const left = originX + i * xCellWidth;
|
|
42
|
+
const textGroup = drawTextGroup({
|
|
43
|
+
width: xCellWidth,
|
|
44
|
+
height
|
|
45
|
+
}, {
|
|
46
|
+
value: v,
|
|
47
|
+
...defaultTextStyle,
|
|
48
|
+
...((_a2 = top.date) == null ? void 0 : _a2.style) || {}
|
|
49
|
+
}, {
|
|
50
|
+
left,
|
|
51
|
+
top: dateHeight + dayHeight
|
|
52
|
+
});
|
|
53
|
+
list.push(textGroup);
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
function drawTopDay(list) {
|
|
57
|
+
var _a;
|
|
58
|
+
if (!top.dayHeight)
|
|
59
|
+
return false;
|
|
60
|
+
const height = top.dayHeight;
|
|
61
|
+
const width = xCellWidth * grid.subSecondXCell;
|
|
62
|
+
const dayList = gridXNumber / grid.subSecondXCell;
|
|
63
|
+
for (let i = 0; i < dayList; i++) {
|
|
64
|
+
const left = originX + i * width;
|
|
65
|
+
const value = i % 2 === 0 ? "\u4E0A\u5348" : "\u4E0B\u5348";
|
|
66
|
+
const textGroup = drawTextGroup({
|
|
67
|
+
width,
|
|
68
|
+
height
|
|
69
|
+
}, {
|
|
70
|
+
value,
|
|
71
|
+
...defaultTextStyle,
|
|
72
|
+
...((_a = top.date) == null ? void 0 : _a.style) || {}
|
|
73
|
+
}, {
|
|
74
|
+
left,
|
|
75
|
+
top: top.date.height || 0
|
|
76
|
+
});
|
|
77
|
+
list.push(textGroup);
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
function drawTopDate(list) {
|
|
81
|
+
var _a;
|
|
82
|
+
if (!top.date.height)
|
|
83
|
+
return false;
|
|
84
|
+
const height = top.date.height;
|
|
85
|
+
const title = drawTextGroup({
|
|
86
|
+
width: originX,
|
|
87
|
+
height,
|
|
88
|
+
...defaultRectStyle
|
|
89
|
+
}, {
|
|
90
|
+
value: top.date.title,
|
|
91
|
+
...defaultTextStyle,
|
|
92
|
+
...((_a = top.date) == null ? void 0 : _a.style) || {}
|
|
93
|
+
}, {
|
|
94
|
+
left: 0,
|
|
95
|
+
top: 0
|
|
96
|
+
});
|
|
97
|
+
list.push(title);
|
|
98
|
+
const width = xCellWidth * grid.subXCell;
|
|
99
|
+
top.date.list.forEach((v, i) => {
|
|
100
|
+
var _a2;
|
|
101
|
+
const left = originX + i * width;
|
|
102
|
+
const textGroup = drawTextGroup({
|
|
103
|
+
width,
|
|
104
|
+
height
|
|
105
|
+
}, {
|
|
106
|
+
value: v,
|
|
107
|
+
...defaultTextStyle,
|
|
108
|
+
...((_a2 = top.date) == null ? void 0 : _a2.style) || {}
|
|
109
|
+
}, {
|
|
110
|
+
left,
|
|
111
|
+
top: 0
|
|
112
|
+
});
|
|
113
|
+
list.push(textGroup);
|
|
114
|
+
});
|
|
115
|
+
}
|
|
116
|
+
onMounted(() => {
|
|
117
|
+
nextTick(() => {
|
|
118
|
+
drawTop();
|
|
119
|
+
canvas.value.renderAll();
|
|
120
|
+
});
|
|
121
|
+
});
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
export { useTop as default };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { InjectionKey, Ref } from 'vue';
|
|
2
|
-
import { fabric } from '
|
|
2
|
+
import { fabric } from './utils';
|
|
3
3
|
interface IEvent {
|
|
4
4
|
selectable: boolean;
|
|
5
5
|
evented: boolean;
|
|
@@ -15,11 +15,13 @@ interface IGrid {
|
|
|
15
15
|
subSecondLineStyle?: fabric.ILineOptions;
|
|
16
16
|
event?: Partial<IEvent>;
|
|
17
17
|
}
|
|
18
|
-
interface IPropItems {
|
|
18
|
+
export interface IPropItems {
|
|
19
19
|
canvasWidth: number;
|
|
20
20
|
canvasHeight: number;
|
|
21
|
+
borderStyle: fabric.ILineOptions;
|
|
21
22
|
grid: IGrid;
|
|
22
23
|
top: ITop;
|
|
24
|
+
left: ILeft;
|
|
23
25
|
gridXNumber: number;
|
|
24
26
|
gridYNumber: number;
|
|
25
27
|
originX: number;
|
|
@@ -75,6 +77,12 @@ export interface IData {
|
|
|
75
77
|
right?: IRight;
|
|
76
78
|
bottom?: any;
|
|
77
79
|
}
|
|
80
|
+
export interface ILineOptions extends fabric.ILineOptions {
|
|
81
|
+
[key: string]: any;
|
|
82
|
+
}
|
|
83
|
+
export interface ITextOptions extends fabric.ITextOptions {
|
|
84
|
+
[key: string]: any;
|
|
85
|
+
}
|
|
78
86
|
export declare const InjectionCanvas: InjectionKey<Ref<fabric.Canvas>>;
|
|
79
87
|
export declare const InjectionPropItems: InjectionKey<IPropItems>;
|
|
80
88
|
export {};
|