Selaa lähdekoodia

趋势图重叠、无法重新打开修复

Void_F 13 tuntia sitten
vanhempi
sitoutus
0548c49ce2

+ 1 - 1
Assets/Prefabs/UI/Item/ShuiYaIcon.prefab

@@ -307,7 +307,7 @@ RectTransform:
   m_GameObject: {fileID: 8568331494564277273}
   m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
   m_LocalPosition: {x: 0, y: 0, z: 0}
-  m_LocalScale: {x: 0.6, y: 0.6, z: 0.6}
+  m_LocalScale: {x: 1, y: 1, z: 1}
   m_ConstrainProportionsScale: 0
   m_Children:
   - {fileID: 3852692801851589775}

+ 1 - 1
Assets/Prefabs/UI/Item/WeiYiIcon.prefab

@@ -307,7 +307,7 @@ RectTransform:
   m_GameObject: {fileID: 2366822782920351970}
   m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
   m_LocalPosition: {x: 0, y: 0, z: 0}
-  m_LocalScale: {x: 0.6, y: 0.6, z: 0}
+  m_LocalScale: {x: 1, y: 1, z: 1}
   m_ConstrainProportionsScale: 0
   m_Children:
   - {fileID: 7153954194492147828}

+ 1 - 1
Assets/Prefabs/UI/Item/obsIcon.prefab

@@ -122,7 +122,7 @@ RectTransform:
   m_GameObject: {fileID: 4283438596719758962}
   m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
   m_LocalPosition: {x: 0, y: 0, z: 0}
-  m_LocalScale: {x: 0.6, y: 0.6, z: 0.6}
+  m_LocalScale: {x: 1, y: 1, z: 1}
   m_ConstrainProportionsScale: 0
   m_Children:
   - {fileID: 2027052951324185546}

+ 1 - 1
Assets/Prefabs/UI/Item/shuiwei_Icon.prefab

@@ -270,7 +270,7 @@ RectTransform:
   m_GameObject: {fileID: 1295938256603995126}
   m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
   m_LocalPosition: {x: 0, y: 0, z: 0}
-  m_LocalScale: {x: 0.6, y: 0.6, z: 0.6}
+  m_LocalScale: {x: 1, y: 1, z: 1}
   m_ConstrainProportionsScale: 0
   m_Children:
   - {fileID: 8067516134358027354}

+ 6 - 3
Assets/Scripts/UI/UIView/GCJK/DeviceTrendPanel.cs

@@ -34,6 +34,8 @@ public class DeviceTrendPanel : MonoBehaviour
     public string _sid;
     public string _gid;
 
+    public string dataName;
+    
     private void Awake()
     {
         rect = this.GetComponent<RectTransform>();
@@ -113,11 +115,12 @@ public class DeviceTrendPanel : MonoBehaviour
 
     private GongChengType currentGongChengType;
     
-    public async Task Show(string name, GongChengType type, string gid, string sid)
+    public async Task Show(string _name, GongChengType type, string gid, string sid)
     {
+        dataName = _name;
         _gid = gid;
         _sid = sid;
-        name = name.Replace(" ", "");
+        _name = _name.Replace(" ", "");
         string typeText = "";
         currentGongChengType = type;
         switch (currentGongChengType)
@@ -136,7 +139,7 @@ public class DeviceTrendPanel : MonoBehaviour
         var tempSeries = _LineChart.series;
         tempSeries[0].serieName = typeText;
         tempXaxis.axisName.name = typeText+" "+DateTime.Now.ToString("yyyy");
-        nameText.text = $"{name} {typeText}趋势";
+        nameText.text = $"{_name} {typeText}趋势";
         string endTime = DateTime.Now.ToString("yyyy-MM-dd");
         string startTime = DateTime.Now.AddMonths(-3).ToString("yyyy-MM-dd");
 

+ 5 - 2
Assets/Scripts/UI/UIView/GCJK/GCJKLayer.cs

@@ -659,15 +659,18 @@ public class GCJKLayer : YZTRootLayer
         var tempTrendPanel = Instantiate(_DeviceTrendPanelOri, this.transform).GetComponent<DeviceTrendPanel>();
         tempTrendPanel.currentType = currentDataType;
         tempTrendPanel.InitDatePicker();
+
+        int openCount = openDeviceTrendPanelList.Count;
+        tempTrendPanel.transform.localPosition += new Vector3(40*openCount,-20*openCount,0);
         await tempTrendPanel.Show(_name, _type, _gid, _sid);
         openDeviceTrendPanelList.Add(_name, tempTrendPanel);
     }
 
     public void RemovePanel(DeviceTrendPanel panel)
     {
-        if (openDeviceTrendPanelList.ContainsKey(panel.name))
+        if (openDeviceTrendPanelList.ContainsKey(panel.dataName))
         {
-            openDeviceTrendPanelList.Remove(panel.name);
+            openDeviceTrendPanelList.Remove(panel.dataName);
         }
     }