From a554a78015cb8bd0b9f1e65a4ac478b42f73f5f9 Mon Sep 17 00:00:00 2001
From: luxiaotao1123 <t1341870251@163.com>
Date: 星期五, 08 三月 2024 16:04:45 +0800
Subject: [PATCH] #

---
 zy-asrs-flow/src/pages/map/components/settings.jsx |   42 +++++++++++++++++++-----------------------
 1 files changed, 19 insertions(+), 23 deletions(-)

diff --git a/zy-asrs-flow/src/pages/map/components/settings.jsx b/zy-asrs-flow/src/pages/map/components/settings.jsx
index 4e0120d..39d30d5 100644
--- a/zy-asrs-flow/src/pages/map/components/settings.jsx
+++ b/zy-asrs-flow/src/pages/map/components/settings.jsx
@@ -1,10 +1,11 @@
 import React, { useState, useRef, useEffect } from 'react';
-import moment from 'moment';
 import { Col, Form, Input, Row, Checkbox, Slider, Select, Drawer, Space, Button, InputNumber, Switch } from 'antd';
 import { FormattedMessage, useIntl, useModel } from '@umijs/max';
-import * as PIXI from 'pixi.js';
 import { createStyles } from 'antd-style';
 import './index.css';
+import * as Utils from '../utils'
+import * as PIXI from 'pixi.js';
+import moment from 'moment';
 import Http from '@/utils/http';
 
 const useStyles = createStyles(({ token, css }) => {
@@ -24,12 +25,13 @@
     useEffect(() => {
         form.resetFields();
         if (curSprite) {
-            console.log(curSprite);
             form.setFieldsValue({
                 x: curSprite.position.x,
                 y: curSprite.position.y,
                 scale: Math.max(curSprite.scale.x, curSprite.scale.y),
-                scaleSlider: Math.max(curSprite.scale.x, curSprite.scale.y)
+                scaleSlider: Math.max(curSprite.scale.x, curSprite.scale.y),
+                rotation: curSprite.rotation * 180 / Math.PI,
+                rotationSlider: curSprite.rotation * 180 / Math.PI,
             })
         }
     }, [form, props])
@@ -43,7 +45,6 @@
     }
 
     const handleFinish = async (values) => {
-        console.log(values); return
         props.onSubmit({ ...values });
     }
 
@@ -52,7 +53,6 @@
             changeList.forEach(change => {
                 const { name: nameList, value } = change;
                 nameList.forEach(name => {
-                    console.log(name, value);
                     switch (name) {
                         case 'x':
                             curSprite.position.x = value;
@@ -76,15 +76,19 @@
                             form.setFieldsValue({
                                 rotation: value
                             })
+                            curSprite.rotation = value * Math.PI / 180;
                             break;
                         case 'rotation':
                             form.setFieldsValue({
                                 rotationSlider: value
                             })
+                            curSprite.rotation = value * Math.PI / 180;
                             break;
                         default:
                             break;
                     }
+                    Utils.removeSelectedEffect();
+                    Utils.showSelectedEffect(curSprite);
                 })
             })
         }
@@ -92,19 +96,6 @@
 
     const onFinishFailed = (errorInfo) => {
     };
-
-    const prefixSelector = (
-        <Form.Item name="prefix" noStyle>
-            <Select
-                style={{
-                    width: 70,
-                }}
-            >
-                <Option value="86">+86</Option>
-                <Option value="87">+87</Option>
-            </Select>
-        </Form.Item>
-    );
 
     return (
         <>
@@ -147,14 +138,19 @@
 
                         {/*  */}
                         <Col span={24}>
-                            <Form.Item label="type" labelCol={{ span: 2 }}>
+                            <Form.Item
+                                label={intl.formatMessage({ id: 'map.settings.type', defaultMessage: '绫诲瀷' })}
+                                labelCol={{ span: 2 }}
+                            >
                                 <span className="ant-form-text">China</span>
                             </Form.Item>
                         </Col>
 
                         {/* position */}
                         <Col span={24}>
-                            <Form.Item label="position">
+                            <Form.Item
+                                label={intl.formatMessage({ id: 'map.settings.position', defaultMessage: '鍧愭爣' })}
+                            >
                                 <Space.Compact>
                                     <Form.Item
                                         name='x'
@@ -197,7 +193,7 @@
                             <Row gutter={24}>
                                 <Col span={18}>
                                     <Form.Item
-                                        label="scale"
+                                        label={intl.formatMessage({ id: 'map.settings.scale', defaultMessage: '缂╂斁' })}
                                         name="scaleSlider"
                                         labelCol={{ span: 4 }}
                                     >
@@ -237,7 +233,7 @@
                             <Row gutter={24}>
                                 <Col span={18}>
                                     <Form.Item
-                                        label="rotation"
+                                        label={intl.formatMessage({ id: 'map.settings.rotation', defaultMessage: '瑙掑害' })}
                                         name="rotationSlider"
                                         labelCol={{ span: 4 }}
                                     >

--
Gitblit v1.9.1