|
@@ -20,10 +20,12 @@ import {
|
|
|
defaultTableStyle as serialTableDefStyle,
|
|
defaultTableStyle as serialTableDefStyle,
|
|
|
joinKey,
|
|
joinKey,
|
|
|
} from "@/core/components/serial";
|
|
} from "@/core/components/serial";
|
|
|
|
|
+import { fixedStrokeOptions as serialFixedStrokeOptions } from "@/core/components/serial";
|
|
|
import { defaultStyle as tableDefStyle } from "@/core/components/table";
|
|
import { defaultStyle as tableDefStyle } from "@/core/components/table";
|
|
|
|
|
+import { fixedStrokeOptions as tableFixedStrokeOptions } from "@/core/components/table";
|
|
|
import { PaperKey } from "@/example/components/slide/actions";
|
|
import { PaperKey } from "@/example/components/slide/actions";
|
|
|
import { mergeFuns } from "@/utils/shared";
|
|
import { mergeFuns } from "@/utils/shared";
|
|
|
-import { getRealPixel } from "./tabulation/gen-tab";
|
|
|
|
|
|
|
+import { getPixelReal, getRealPixel } from "./tabulation/gen-tab";
|
|
|
import { Draw } from "@/example/components/container/use-draw";
|
|
import { Draw } from "@/example/components/container/use-draw";
|
|
|
import { ShapeType } from "@/index";
|
|
import { ShapeType } from "@/index";
|
|
|
import { watch } from "vue";
|
|
import { watch } from "vue";
|
|
@@ -47,32 +49,14 @@ const setDefStyle = <T extends {}>(
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
export const tabCustomStyle = (p: PaperKey, draw: Draw) => {
|
|
export const tabCustomStyle = (p: PaperKey, draw: Draw) => {
|
|
|
- const types = [
|
|
|
|
|
- "icon",
|
|
|
|
|
- "table",
|
|
|
|
|
- "serial",
|
|
|
|
|
- "arrow",
|
|
|
|
|
- "circle",
|
|
|
|
|
- "rectangle",
|
|
|
|
|
- "triangle",
|
|
|
|
|
- "polygon",
|
|
|
|
|
- ] as ShapeType[];
|
|
|
|
|
-
|
|
|
|
|
|
|
+ const realFixedStrokeOptions = [0.13, 0.18, 0.25, 0.35, 0.5, 0.7];
|
|
|
|
|
+ const defFixelStroke = getRealPixel(realFixedStrokeOptions[0], p);
|
|
|
|
|
+
|
|
|
|
|
+ const defF = {
|
|
|
|
|
+ strokeWidth: defFixelStroke,
|
|
|
|
|
+ fixed: false,
|
|
|
|
|
+ };
|
|
|
const backs = [
|
|
const backs = [
|
|
|
- mergeFuns(
|
|
|
|
|
- types.map((type) =>
|
|
|
|
|
- draw.mountFilter.setMenusFilter(type, (data) => {
|
|
|
|
|
- data.strokeWidth.props = {
|
|
|
|
|
- ...data.strokeWidth.props,
|
|
|
|
|
- proportion: true,
|
|
|
|
|
- step: 0.1,
|
|
|
|
|
- min: 0.1,
|
|
|
|
|
- max: 10,
|
|
|
|
|
- };
|
|
|
|
|
- return data;
|
|
|
|
|
- })
|
|
|
|
|
- )
|
|
|
|
|
- ),
|
|
|
|
|
draw.mountFilter.setMenusFilter("serial", (data) => {
|
|
draw.mountFilter.setMenusFilter("serial", (data) => {
|
|
|
data = { ...data };
|
|
data = { ...data };
|
|
|
delete data.fontStyle;
|
|
delete data.fontStyle;
|
|
@@ -83,29 +67,24 @@ export const tabCustomStyle = (p: PaperKey, draw: Draw) => {
|
|
|
{
|
|
{
|
|
|
width: getRealPixel(10, p),
|
|
width: getRealPixel(10, p),
|
|
|
height: getRealPixel(10, p),
|
|
height: getRealPixel(10, p),
|
|
|
- strokeWidth: getRealPixel(0.5, p),
|
|
|
|
|
|
|
+ strokeScaleEnabled: true,
|
|
|
} as any,
|
|
} as any,
|
|
|
"icon"
|
|
"icon"
|
|
|
),
|
|
),
|
|
|
setDefStyle(serialDefStyle, {
|
|
setDefStyle(serialDefStyle, {
|
|
|
- strokeWidth: getRealPixel(0.5, p),
|
|
|
|
|
fill: null,
|
|
fill: null,
|
|
|
|
|
+ fontSize: getRealPixel(8 - getPixelReal(6, p), p),
|
|
|
|
|
+ padding: 6,
|
|
|
} as any),
|
|
} as any),
|
|
|
setDefStyle(serialTableDefStyle, {
|
|
setDefStyle(serialTableDefStyle, {
|
|
|
- nameColWidth: getRealPixel(20, p),
|
|
|
|
|
- valueColWidth: getRealPixel(20, p),
|
|
|
|
|
|
|
+ nameColWidth: getRealPixel(10, p),
|
|
|
|
|
+ valueColWidth: getRealPixel(30, p),
|
|
|
fontSize: getRealPixel(4, p),
|
|
fontSize: getRealPixel(4, p),
|
|
|
padding: getRealPixel(2, p),
|
|
padding: getRealPixel(2, p),
|
|
|
colHeight: getRealPixel(8, p),
|
|
colHeight: getRealPixel(8, p),
|
|
|
tableStrokeWidth: getRealPixel(0.5, p),
|
|
tableStrokeWidth: getRealPixel(0.5, p),
|
|
|
repColCount: 2,
|
|
repColCount: 2,
|
|
|
} as any),
|
|
} as any),
|
|
|
- setDefStyle(polygonDefStyle, { strokeWidth: getRealPixel(0.5, p) }),
|
|
|
|
|
- setDefStyle(tableDefStyle, { strokeWidth: getRealPixel(0.5, p) }),
|
|
|
|
|
- setDefStyle(rectDefStyle, { strokeWidth: getRealPixel(0.5, p) }),
|
|
|
|
|
- setDefStyle(circleDefStyle, { strokeWidth: getRealPixel(0.5, p) }),
|
|
|
|
|
- setDefStyle(triangleDefStyle, { strokeWidth: getRealPixel(0.5, p) }),
|
|
|
|
|
- setDefStyle(arrowDefStyle, { strokeWidth: getRealPixel(0.5, p) }),
|
|
|
|
|
watch(
|
|
watch(
|
|
|
() =>
|
|
() =>
|
|
|
draw.store.getTypeItems("table").filter((item) => item.key === joinKey),
|
|
draw.store.getTypeItems("table").filter((item) => item.key === joinKey),
|
|
@@ -121,6 +100,29 @@ export const tabCustomStyle = (p: PaperKey, draw: Draw) => {
|
|
|
},
|
|
},
|
|
|
{ immediate: true }
|
|
{ immediate: true }
|
|
|
),
|
|
),
|
|
|
|
|
+
|
|
|
|
|
+ setDefStyle(triangleFixedStrokeOptions, realFixedStrokeOptions),
|
|
|
|
|
+ setDefStyle(circleFixedStrokeOptions, realFixedStrokeOptions),
|
|
|
|
|
+ setDefStyle(arrowFixedStrokeOptions, realFixedStrokeOptions),
|
|
|
|
|
+ setDefStyle(rectFixedStrokeOptions, realFixedStrokeOptions),
|
|
|
|
|
+ setDefStyle(polygonFixedStrokeOptions, realFixedStrokeOptions),
|
|
|
|
|
+ setDefStyle(iconFixedStrokeOptions, realFixedStrokeOptions),
|
|
|
|
|
+ setDefStyle(lineIconFixedStrokeOptions, realFixedStrokeOptions),
|
|
|
|
|
+ setDefStyle(lineChunkFixedStrokeOptions, realFixedStrokeOptions),
|
|
|
|
|
+ setDefStyle(serialFixedStrokeOptions, realFixedStrokeOptions),
|
|
|
|
|
+ setDefStyle(tableFixedStrokeOptions, realFixedStrokeOptions),
|
|
|
|
|
+
|
|
|
|
|
+ setDefStyle(lineChunkDefStyle, defF),
|
|
|
|
|
+ setDefStyle(lineIconDefStyle, defF),
|
|
|
|
|
+ setDefStyle(iconDefStyle, defF),
|
|
|
|
|
+ setDefStyle(polygonDefStyle, defF),
|
|
|
|
|
+ setDefStyle(triangleDefStyle, defF),
|
|
|
|
|
+ setDefStyle(circleDefStyle, defF),
|
|
|
|
|
+ setDefStyle(arrowDefStyle, defF),
|
|
|
|
|
+ setDefStyle(rectDefStyle, defF),
|
|
|
|
|
+ setDefStyle(serialDefStyle, defF),
|
|
|
|
|
+ setDefStyle(tableDefStyle, defF),
|
|
|
|
|
+ setDefStyle(serialTableDefStyle, { tableStrokeWidth: defF.strokeWidth }),
|
|
|
];
|
|
];
|
|
|
|
|
|
|
|
return mergeFuns(backs);
|
|
return mergeFuns(backs);
|
|
@@ -142,7 +144,6 @@ export const overviewCustomStyle = (draw: Draw) => {
|
|
|
setDefStyle(iconFixedStrokeOptions, realFixedStrokeOptions),
|
|
setDefStyle(iconFixedStrokeOptions, realFixedStrokeOptions),
|
|
|
setDefStyle(lineIconFixedStrokeOptions, realFixedStrokeOptions),
|
|
setDefStyle(lineIconFixedStrokeOptions, realFixedStrokeOptions),
|
|
|
setDefStyle(lineChunkFixedStrokeOptions, realFixedStrokeOptions),
|
|
setDefStyle(lineChunkFixedStrokeOptions, realFixedStrokeOptions),
|
|
|
-
|
|
|
|
|
|
|
|
|
|
setDefStyle(lineChunkDefStyle, { strokeWidth: defFixelStroke }),
|
|
setDefStyle(lineChunkDefStyle, { strokeWidth: defFixelStroke }),
|
|
|
setDefStyle(lineIconDefStyle, { strokeWidth: defFixelStroke }),
|
|
setDefStyle(lineIconDefStyle, { strokeWidth: defFixelStroke }),
|