|
@@ -0,0 +1,364 @@
|
|
|
+import CustomColorPicker from "@/components/CustomColorPicker";
|
|
|
+import {
|
|
|
+ BoldOutlined,
|
|
|
+ ColumnHeightOutlined,
|
|
|
+ FontSizeOutlined,
|
|
|
+ ItalicOutlined,
|
|
|
+ StrikethroughOutlined,
|
|
|
+ SwapOutlined,
|
|
|
+ UnderlineOutlined,
|
|
|
+ VerticalAlignBottomOutlined,
|
|
|
+ VerticalAlignMiddleOutlined,
|
|
|
+ VerticalAlignTopOutlined,
|
|
|
+} from "@ant-design/icons";
|
|
|
+import {
|
|
|
+ Button,
|
|
|
+ Col,
|
|
|
+ Divider,
|
|
|
+ Form,
|
|
|
+ InputNumber,
|
|
|
+ Row,
|
|
|
+ Select,
|
|
|
+ Space,
|
|
|
+ Tooltip,
|
|
|
+} from "antd";
|
|
|
+import { arrowOptions } from "@/pages/flow/data";
|
|
|
+
|
|
|
+const alignData = [
|
|
|
+ { id: "left", name: "左对齐", icon: "icon-zuoduiqi2" },
|
|
|
+ { id: "vcenter", name: "居中对齐", icon: "icon-shuipingduiqi2" },
|
|
|
+ { id: "right", name: "右对齐", icon: "icon-youduiqi2" },
|
|
|
+ { id: "top", name: "顶端对齐", icon: "icon-dingbuduiqi2" },
|
|
|
+ { id: "hcenter", name: "垂直居中对齐", icon: "icon-chuizhiduiqi2" },
|
|
|
+ { id: "bottom", name: "底端对齐", icon: "icon-dibuduiqi2" },
|
|
|
+ { id: "v", name: "水平平均分布", icon: "icon-shuipingfenbu2" },
|
|
|
+ { id: "h", name: "垂直平均分布", icon: "icon-chuizhifenbu2" },
|
|
|
+];
|
|
|
+export default function GraphStyle() {
|
|
|
+ return (
|
|
|
+ <div>
|
|
|
+ <section className="px-16px">
|
|
|
+ <div className="bg-white rounded-s flex justify-between items-center mb-8px">
|
|
|
+ {alignData.map((item) => (
|
|
|
+ <Tooltip key={item.id} title={item.name}>
|
|
|
+ <Button
|
|
|
+ type="text"
|
|
|
+ icon={<i className={"iconfont " + item.icon} />}
|
|
|
+ />
|
|
|
+ </Tooltip>
|
|
|
+ ))}
|
|
|
+ </div>
|
|
|
+ <Form.Item
|
|
|
+ label="不透明度"
|
|
|
+ labelCol={{ span: 14 }}
|
|
|
+ wrapperCol={{ span: 10 }}
|
|
|
+ labelAlign="left"
|
|
|
+ className="mb-8px"
|
|
|
+ colon={false}
|
|
|
+ >
|
|
|
+ <InputNumber
|
|
|
+ className="w-full"
|
|
|
+ step={5}
|
|
|
+ min={0}
|
|
|
+ max={100}
|
|
|
+ formatter={(val) => `${val}%`}
|
|
|
+ />
|
|
|
+ </Form.Item>
|
|
|
+ </section>
|
|
|
+ <Divider className="my-8px" />
|
|
|
+ <section className="px-16px">
|
|
|
+ <div className="font-bold mb-8px">布局</div>
|
|
|
+ <Row gutter={8} className="mb-8px">
|
|
|
+ <Col span={12}>
|
|
|
+ <InputNumber
|
|
|
+ className="w-full"
|
|
|
+ step={1}
|
|
|
+ min={20}
|
|
|
+ max={10000}
|
|
|
+ suffix="W"
|
|
|
+ formatter={(val) => `${val}px`}
|
|
|
+ />
|
|
|
+ </Col>
|
|
|
+ <Col span={12}>
|
|
|
+ <InputNumber
|
|
|
+ className="w-full"
|
|
|
+ step={1}
|
|
|
+ min={20}
|
|
|
+ max={10000}
|
|
|
+ suffix="H"
|
|
|
+ formatter={(val) => `${val}px`}
|
|
|
+ />
|
|
|
+ </Col>
|
|
|
+ </Row>
|
|
|
+ <Row gutter={8} className="mb-8px">
|
|
|
+ <Col span={12}>
|
|
|
+ <InputNumber
|
|
|
+ className="w-full"
|
|
|
+ step={1}
|
|
|
+ min={0}
|
|
|
+ max={10000}
|
|
|
+ suffix="X"
|
|
|
+ formatter={(val) => `${val}px`}
|
|
|
+ />
|
|
|
+ </Col>
|
|
|
+ <Col span={12}>
|
|
|
+ <InputNumber
|
|
|
+ className="w-full"
|
|
|
+ step={1}
|
|
|
+ min={0}
|
|
|
+ max={10000}
|
|
|
+ suffix="Y"
|
|
|
+ formatter={(val) => `${val}px`}
|
|
|
+ />
|
|
|
+ </Col>
|
|
|
+ </Row>
|
|
|
+ <div className="flex justify-between items-center gap-12px mb-8px">
|
|
|
+ <InputNumber
|
|
|
+ className="flex-1"
|
|
|
+ step={1}
|
|
|
+ min={0}
|
|
|
+ max={360}
|
|
|
+ formatter={(val) => `${val}°`}
|
|
|
+ suffix={<i className="iconfont icon-a-ziyuan126 text-12px" />}
|
|
|
+ />
|
|
|
+ <Button icon={<i className="iconfont icon-shangxiafanzhuan" />} />
|
|
|
+ <Button icon={<i className="iconfont icon-zuoyoufanzhuan" />} />
|
|
|
+ </div>
|
|
|
+ <Form.Item
|
|
|
+ label="匹配大小"
|
|
|
+ labelCol={{ span: 14 }}
|
|
|
+ wrapperCol={{ span: 10 }}
|
|
|
+ labelAlign="left"
|
|
|
+ className="mb-8px"
|
|
|
+ colon={false}
|
|
|
+ >
|
|
|
+ <div className="bg-white rounded-s flex justify-between items-center mb-8px">
|
|
|
+ <Tooltip title="适配宽度">
|
|
|
+ <Button
|
|
|
+ type="text"
|
|
|
+ icon={<i className="iconfont icon-kuandu" />}
|
|
|
+ />
|
|
|
+ </Tooltip>
|
|
|
+ <Tooltip title="适配高度">
|
|
|
+ <Button
|
|
|
+ type="text"
|
|
|
+ icon={<i className="iconfont icon-gaodu" />}
|
|
|
+ />
|
|
|
+ </Tooltip>
|
|
|
+ <Tooltip title="适配宽高">
|
|
|
+ <Button
|
|
|
+ type="text"
|
|
|
+ icon={<i className="iconfont icon-shiyingkuangao" />}
|
|
|
+ />
|
|
|
+ </Tooltip>
|
|
|
+ </div>
|
|
|
+ </Form.Item>
|
|
|
+ </section>
|
|
|
+ <Divider className="my-8px" />
|
|
|
+ <section className="px-16px">
|
|
|
+ <div className="font-bold mb-8px">文本</div>
|
|
|
+ <div className="flex items-center gap-12px mb-8px">
|
|
|
+ <Select className="flex-1" />
|
|
|
+ <CustomColorPicker />
|
|
|
+ </div>
|
|
|
+ <div className="flex items-center gap-12px mb-8px">
|
|
|
+ <InputNumber
|
|
|
+ className="flex-1"
|
|
|
+ prefix={<FontSizeOutlined />}
|
|
|
+ step={1}
|
|
|
+ min={12}
|
|
|
+ max={10000}
|
|
|
+ formatter={(val) => `${val}px`}
|
|
|
+ />
|
|
|
+ <Select className="flex-1" suffixIcon={<ColumnHeightOutlined />} />
|
|
|
+ </div>
|
|
|
+ <div className="flex items-center gap-12px mb-8px">
|
|
|
+ <div className="bg-white rounded-s flex justify-between items-center mb-8px">
|
|
|
+ <Tooltip title="左对齐">
|
|
|
+ <Button
|
|
|
+ type="text"
|
|
|
+ icon={<i className="iconfont icon-zuoduiqi" />}
|
|
|
+ />
|
|
|
+ </Tooltip>
|
|
|
+ <Tooltip title="居中">
|
|
|
+ <Button
|
|
|
+ type="text"
|
|
|
+ icon={<i className="iconfont icon-juzhong" />}
|
|
|
+ />
|
|
|
+ </Tooltip>
|
|
|
+ <Tooltip title="右对齐">
|
|
|
+ <Button
|
|
|
+ type="text"
|
|
|
+ icon={<i className="iconfont icon-youduiqi" />}
|
|
|
+ />
|
|
|
+ </Tooltip>
|
|
|
+ </div>
|
|
|
+ <div className="bg-white rounded-s flex justify-between items-center mb-8px">
|
|
|
+ <Tooltip title="顶部对齐">
|
|
|
+ <Button type="text" icon={<VerticalAlignTopOutlined />} />
|
|
|
+ </Tooltip>
|
|
|
+ <Tooltip title="垂直居中">
|
|
|
+ <Button type="text" icon={<VerticalAlignMiddleOutlined />} />
|
|
|
+ </Tooltip>
|
|
|
+ <Tooltip title="底部对齐">
|
|
|
+ <Button type="text" icon={<VerticalAlignBottomOutlined />} />
|
|
|
+ </Tooltip>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div className="flex items-center gap-12px mb-8px">
|
|
|
+ <div className="bg-white rounded-s flex justify-between items-center mb-8px">
|
|
|
+ <Tooltip placement="bottom" title="字体加粗">
|
|
|
+ <Button type="text" icon={<BoldOutlined />} />
|
|
|
+ </Tooltip>
|
|
|
+ <Tooltip placement="bottom" title="字体倾斜">
|
|
|
+ <Button type="text" icon={<ItalicOutlined />} />
|
|
|
+ </Tooltip>
|
|
|
+ <Tooltip placement="bottom" title="下划线">
|
|
|
+ <Button type="text" icon={<UnderlineOutlined />} />
|
|
|
+ </Tooltip>
|
|
|
+ <Tooltip placement="bottom" title="中划线">
|
|
|
+ <Button type="text" icon={<StrikethroughOutlined />} />
|
|
|
+ </Tooltip>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </section>
|
|
|
+ <Divider className="my-8px" />
|
|
|
+ <section className="px-16px">
|
|
|
+ <div className="font-bold mb-8px">填充</div>
|
|
|
+ <div className="flex items-center gap-12px mb-8px">
|
|
|
+ <Select
|
|
|
+ className="flex-1"
|
|
|
+ options={[
|
|
|
+ { label: "纯色", value: "color" },
|
|
|
+ { label: "渐变", value: "gradient" },
|
|
|
+ { label: "图片", value: "image" },
|
|
|
+ ]}
|
|
|
+ />
|
|
|
+ {
|
|
|
+ <div className="flex items-center gap-12px">
|
|
|
+ <CustomColorPicker />
|
|
|
+ <Button icon={<SwapOutlined />} />
|
|
|
+ <CustomColorPicker />
|
|
|
+ </div>
|
|
|
+ }
|
|
|
+ </div>
|
|
|
+ <div>
|
|
|
+ <Form.Item
|
|
|
+ label="填充方式"
|
|
|
+ labelCol={{ span: 14 }}
|
|
|
+ wrapperCol={{ span: 10 }}
|
|
|
+ labelAlign="left"
|
|
|
+ className="mb-8px"
|
|
|
+ colon={false}
|
|
|
+ >
|
|
|
+ <Select
|
|
|
+ options={[
|
|
|
+ { value: "1", label: "填充" },
|
|
|
+ { value: "2", label: "自适应" },
|
|
|
+ { value: "3", label: "按图形伸展" },
|
|
|
+ { value: "4", label: "原始尺寸" },
|
|
|
+ { value: "5", label: "平铺" },
|
|
|
+ ]}
|
|
|
+ />
|
|
|
+ </Form.Item>
|
|
|
+ </div>
|
|
|
+ <div className="flex items-center gap-12px">
|
|
|
+ <Select
|
|
|
+ className="flex-1"
|
|
|
+ options={[
|
|
|
+ { value: "1", label: "线性渐变" },
|
|
|
+ { value: "2", label: "径向渐变" },
|
|
|
+ ]}
|
|
|
+ />
|
|
|
+ <InputNumber
|
|
|
+ className="flex-1"
|
|
|
+ step={1}
|
|
|
+ min={0}
|
|
|
+ max={360}
|
|
|
+ formatter={(val) => `${val}°`}
|
|
|
+ suffix={<i className="iconfont icon-a-ziyuan126 text-12px" />}
|
|
|
+ />
|
|
|
+ {/* <InputNumber
|
|
|
+ className="flex-1"
|
|
|
+ step={1}
|
|
|
+ min={0}
|
|
|
+ max={100}
|
|
|
+ formatter={(val) => `${val}%`}
|
|
|
+ suffix={<i className="iconfont icon-a-ziyuan126 text-12px" />}
|
|
|
+ /> */}
|
|
|
+ </div>
|
|
|
+ </section>
|
|
|
+ <Divider className="my-8px" />
|
|
|
+ <section className="px-16px">
|
|
|
+ <div className="font-bold mb-8px">线条</div>
|
|
|
+ <div className="flex gap-12px mb-8px">
|
|
|
+ <Select
|
|
|
+ className="flex-1"
|
|
|
+ options={[
|
|
|
+ { label: "实线", value: "solid" },
|
|
|
+ { label: "虚线", value: "dashed" },
|
|
|
+ { label: "点线", value: "dotted" },
|
|
|
+ { label: "点划线", value: "dashdot" },
|
|
|
+ ]}
|
|
|
+ />
|
|
|
+ <CustomColorPicker />
|
|
|
+ </div>
|
|
|
+ <div className="flex gap-12px mb-8px">
|
|
|
+ <InputNumber
|
|
|
+ className="flex-1"
|
|
|
+ step={1}
|
|
|
+ min={1}
|
|
|
+ max={10}
|
|
|
+ formatter={(val) => `${val}px`}
|
|
|
+ />
|
|
|
+ <div className="bg-white rounded-s flex justify-between items-center">
|
|
|
+ <Button
|
|
|
+ type="text"
|
|
|
+ icon={
|
|
|
+ <i className="iconfont icon-a-icon16lianxianleixinghuizhilianxian" />
|
|
|
+ }
|
|
|
+ />
|
|
|
+ <Button
|
|
|
+ type="text"
|
|
|
+ icon={
|
|
|
+ <i className="iconfont icon-a-icon16lianxianleixingbeisaierquxian" />
|
|
|
+ }
|
|
|
+ />
|
|
|
+ <Button
|
|
|
+ type="text"
|
|
|
+ icon={
|
|
|
+ <i className="iconfont icon-a-icon16lianxianleixinghuizhizhixian" />
|
|
|
+ }
|
|
|
+ />
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <Form.Item
|
|
|
+ label="箭头类型"
|
|
|
+ labelAlign="left"
|
|
|
+ colon={false}
|
|
|
+ labelCol={{ span: 6 }}
|
|
|
+ wrapperCol={{ span: 18 }}
|
|
|
+ >
|
|
|
+ <div className="flex gap-12px items-center">
|
|
|
+ <Select
|
|
|
+ options={arrowOptions.map((item) => {
|
|
|
+ return {
|
|
|
+ value: item.name,
|
|
|
+ label: <img className="w-12px mx-50%" src={item.icon} />,
|
|
|
+ };
|
|
|
+ })}
|
|
|
+ />
|
|
|
+ <Select
|
|
|
+ options={arrowOptions.map((item) => {
|
|
|
+ return {
|
|
|
+ value: item.name,
|
|
|
+ label: <img className="w-12px mx-50%" src={item.icon} />,
|
|
|
+ };
|
|
|
+ })}
|
|
|
+ />
|
|
|
+ </div>
|
|
|
+ </Form.Item>
|
|
|
+ </section>
|
|
|
+ </div>
|
|
|
+ );
|
|
|
+}
|