|
@@ -7,17 +7,26 @@
|
|
<Flex class="workspace-bottom" justify="space-between" align="center">
|
|
<Flex class="workspace-bottom" justify="space-between" align="center">
|
|
<div class="bottom-left">
|
|
<div class="bottom-left">
|
|
<span style="margin-right: 12px"
|
|
<span style="margin-right: 12px"
|
|
- >画布尺寸:{{ projectStore.projectInfo.width }}*{{ projectStore.projectInfo.height }}px</span
|
|
|
|
|
|
+ >画布尺寸:{{ projectStore.projectInfo.width }} *
|
|
|
|
+ {{ projectStore.projectInfo.height }}px</span
|
|
>
|
|
>
|
|
- <span>画布自适应:<Select size="small" style="width: 120px" /></span>
|
|
|
|
|
|
+ <span
|
|
|
|
+ >画布自适应:<Select
|
|
|
|
+ size="small"
|
|
|
|
+ style="width: 120px"
|
|
|
|
+ :value="projectStore.projectInfo.fillType"
|
|
|
|
+ :options="fillOptions"
|
|
|
|
+ @change="projectStore.setFillType"
|
|
|
|
+ /></span>
|
|
</div>
|
|
</div>
|
|
<div class="bottom-right">
|
|
<div class="bottom-right">
|
|
- <Button
|
|
|
|
|
|
+ <Button
|
|
size="small"
|
|
size="small"
|
|
type="text"
|
|
type="text"
|
|
:disabled="stageStore.scale <= 0.1"
|
|
:disabled="stageStore.scale <= 0.1"
|
|
@click="handleSizeChange(Number(stageStore.scale) - 0.1)"
|
|
@click="handleSizeChange(Number(stageStore.scale) - 0.1)"
|
|
- ><MinusCircleOutlined /></Button>
|
|
|
|
|
|
+ ><MinusCircleOutlined
|
|
|
|
+ /></Button>
|
|
<AutoComplete
|
|
<AutoComplete
|
|
size="small"
|
|
size="small"
|
|
style="width: 120px"
|
|
style="width: 120px"
|
|
@@ -30,7 +39,8 @@
|
|
type="text"
|
|
type="text"
|
|
:disabled="stageStore.scale >= 4"
|
|
:disabled="stageStore.scale >= 4"
|
|
@click="handleSizeChange(Number(stageStore.scale) + 0.1)"
|
|
@click="handleSizeChange(Number(stageStore.scale) + 0.1)"
|
|
- ><PlusCircleOutlined /></Button>
|
|
|
|
|
|
+ ><PlusCircleOutlined
|
|
|
|
+ /></Button>
|
|
</div>
|
|
</div>
|
|
</Flex>
|
|
</Flex>
|
|
</Flex>
|
|
</Flex>
|
|
@@ -43,6 +53,7 @@ import Scaleplate from "./Scaleplate.vue";
|
|
import Stage from "./Stage.vue";
|
|
import Stage from "./Stage.vue";
|
|
import { useProjectStore } from "@/store/modules/project";
|
|
import { useProjectStore } from "@/store/modules/project";
|
|
import { useStageStore } from "@/store/modules/stage";
|
|
import { useStageStore } from "@/store/modules/stage";
|
|
|
|
+import { ScreenFillEnum } from "@/enum/screenFillEnum";
|
|
|
|
|
|
const projectStore = useProjectStore();
|
|
const projectStore = useProjectStore();
|
|
const stageStore = useStageStore();
|
|
const stageStore = useStageStore();
|
|
@@ -58,16 +69,24 @@ const sizeOptions = [
|
|
{ value: 2, label: "200%" },
|
|
{ value: 2, label: "200%" },
|
|
{ value: 3, label: "300%" },
|
|
{ value: 3, label: "300%" },
|
|
{ value: 4, label: "400%" },
|
|
{ value: 4, label: "400%" },
|
|
- { value: 0, label: "适应大小" }
|
|
|
|
|
|
+ { value: 0, label: "适应大小" },
|
|
|
|
+];
|
|
|
|
+
|
|
|
|
+const fillOptions = [
|
|
|
|
+ { value: ScreenFillEnum.AUTO, label: "自动" },
|
|
|
|
+ { value: ScreenFillEnum.FILL_HEIGHT, label: "宽度填充" },
|
|
|
|
+ { value: ScreenFillEnum.FILL_WIDTH, label: "高度填充" },
|
|
|
|
+ { value: ScreenFillEnum.FILL_BOTH, label: "双向铺满" },
|
|
|
|
+ { value: ScreenFillEnum.NONE, label: "无" },
|
|
];
|
|
];
|
|
|
|
|
|
const handleSizeChange = (val: any) => {
|
|
const handleSizeChange = (val: any) => {
|
|
- if(Number.isFinite(val)) {
|
|
|
|
- stageStore.setScale(val as number);
|
|
|
|
- }
|
|
|
|
- if(typeof val === "string") {
|
|
|
|
- const n = +((val + '').replace("%", ""));
|
|
|
|
- if(Number.isNaN(n) && n >= 10 && n <= 400) {
|
|
|
|
|
|
+ if (Number.isFinite(val)) {
|
|
|
|
+ stageStore.setScale((val as number) < 0.1 ? 0.1 : val);
|
|
|
|
+ }
|
|
|
|
+ if (typeof val === "string") {
|
|
|
|
+ const n = +(val + "").replace("%", "");
|
|
|
|
+ if (Number.isNaN(n) && n >= 10 && n <= 400) {
|
|
stageStore.setScale((n / 100).toFixed(2) as unknown as number);
|
|
stageStore.setScale((n / 100).toFixed(2) as unknown as number);
|
|
} else {
|
|
} else {
|
|
stageStore.setScale(0.1);
|
|
stageStore.setScale(0.1);
|