|
@@ -0,0 +1,68 @@
|
|
|
+import { useEditor } from "@/modules/editor";
|
|
|
+import { css } from "@linaria/core";
|
|
|
+import { Button, Divider, InputNumber, Select } from "ant-design-vue";
|
|
|
+import { defineComponent, reactive, effect, watch } from "vue";
|
|
|
+import { any, array, string } from "vue-types";
|
|
|
+
|
|
|
+import ToolbarsUI from "./toolbarUI";
|
|
|
+import Slider from "../../formItems/Slider";
|
|
|
+import { ToolbarItem } from "@/modules/editor/objects/Toolbars/default";
|
|
|
+import _ from "lodash";
|
|
|
+import { DesignComp } from "@/modules/editor/objects/DesignTemp/DesignComp";
|
|
|
+
|
|
|
+
|
|
|
+export default defineComponent({
|
|
|
+ props: {
|
|
|
+ value: array<any>()
|
|
|
+ },
|
|
|
+
|
|
|
+ emits: ["change"],
|
|
|
+ setup(props, { emit }) {
|
|
|
+ return () => {
|
|
|
+ const points = props.value || [];
|
|
|
+ const options = points.map((item: any, index: number) => { return { label: "顶点" + (index + 1), value: index } }) || [];
|
|
|
+ const state = editState;
|
|
|
+
|
|
|
+ return (
|
|
|
+ <div class="flex w-full flex-col">
|
|
|
+ <Divider style={{margin: "10px 0"}}></Divider>
|
|
|
+
|
|
|
+ <div class="flex items-center">
|
|
|
+ <span class="w-70px">
|
|
|
+ 锚点选择
|
|
|
+ </span>
|
|
|
+ <Select value={editState.index} options={options} onChange={v => {
|
|
|
+ editState.index = v as number;
|
|
|
+ }}>
|
|
|
+ </Select>
|
|
|
+ </div>
|
|
|
+ {
|
|
|
+ points.length > 0 && <div class="flex items-center mt-10px">
|
|
|
+ <span class="w-70px">宽度偏移</span>
|
|
|
+ <Slider value={points[state.index][0]} min={0} max={1} step={0.01} onChange={(v) => {
|
|
|
+ const ps = points.slice(0);
|
|
|
+ ps[state.index][0] = v;
|
|
|
+ emit("change", ps);
|
|
|
+ }} />
|
|
|
+ </div>
|
|
|
+ }
|
|
|
+ {
|
|
|
+ points.length > 0 && <div class="flex items-center">
|
|
|
+ <span class="w-70px" >高度偏移</span> <Slider value={points[state.index][1]} min={0} max={1} step={0.01} onChange={(v) => {
|
|
|
+ const ps = points.slice(0);
|
|
|
+ ps[state.index][1] = v;
|
|
|
+ emit("change", ps);
|
|
|
+ }} />
|
|
|
+ </div>
|
|
|
+ }
|
|
|
+ </div>
|
|
|
+ )
|
|
|
+ }
|
|
|
+ },
|
|
|
+})
|
|
|
+
|
|
|
+const editState = reactive({
|
|
|
+ index: 0
|
|
|
+})
|
|
|
+
|
|
|
+export { editState };
|