ソースを参照

chatGTPAI-帮助类完善,高保真完善

liyijie 1 年間 前
コミット
7bd10d7c06

+ 23 - 18
PDF Office/Helper/ChatGTPAIHelper.cs

@@ -174,7 +174,7 @@ namespace PDF_Master.Helper
             App.mainWindowViewModel.MaxValue = 10;
             App.mainWindowViewModel.Value = 0;
             App.mainWindowViewModel.IsProcessVisible = System.Windows.Visibility.Visible;
-            App.mainWindowViewModel.ProcessCloseBtnVisible= System.Windows.Visibility.Collapsed;
+            App.mainWindowViewModel.ProcessCloseBtnVisible = System.Windows.Visibility.Collapsed;
             FileInfo file = new FileInfo(content);
             string fileKey = await fileKeyTranslate(content, file.Name);
             App.mainWindowViewModel.Value = 2;
@@ -236,23 +236,24 @@ namespace PDF_Master.Helper
                     if (jobject["code"].ToObject<string>().ToLower() == "200")
                     {
                         translate = jobject["data"]["ossDownUrl"].ToObject<string>().ToLower();
-                    }
-                    //return jobject["code"].ToObject<string>().ToLower();
-                    using (var client = new WebClient())
-                    {
-                        App.mainWindowViewModel.Value = 6;
-                        string folderPath = file.FullName.Remove(file.FullName.LastIndexOf("."), file.FullName.Length- file.FullName.LastIndexOf(".")) + "_aiTranslation.pdf"; ;
-                        client.DownloadProgressChanged += (sender, e) =>
-                        {
 
-                        };
-                        client.DownloadFile(translate, folderPath);
-                        App.mainWindowViewModel.Value = 9;
-                        App.mainWindowViewModel.IsProcessVisible = System.Windows.Visibility.Collapsed;
-                        App.mainWindowViewModel.ProcessCloseBtnVisible = System.Windows.Visibility.Visible;
-                        return folderPath;
+                        //return jobject["code"].ToObject<string>().ToLower();
+                        using (var client = new WebClient())
+                        {
+                            App.mainWindowViewModel.Value = 6;
+                            string folderPath = file.FullName.Remove(file.FullName.LastIndexOf("."), file.FullName.Length - file.FullName.LastIndexOf(".")) + "_aiTranslation.pdf"; ;
+                            client.DownloadProgressChanged += (sender, e) =>
+                            {
+
+                            };
+                            client.DownloadFile(translate, folderPath);
+                            App.mainWindowViewModel.Value = 9;
+                            App.mainWindowViewModel.IsProcessVisible = System.Windows.Visibility.Collapsed;
+                            App.mainWindowViewModel.ProcessCloseBtnVisible = System.Windows.Visibility.Visible;
+                            return folderPath;
+                        }
                     }
-                    //return "200";
+                    return jobject["code"].ToObject<string>().ToLower();
                 }
             }
             catch
@@ -333,7 +334,7 @@ namespace PDF_Master.Helper
                     }
                     //return jobject["code"].ToObject<string>().ToLower();
 
-                    return "200";
+                    return jobject["code"].ToObject<string>().ToLower();
                 }
             }
             catch
@@ -415,6 +416,8 @@ namespace PDF_Master.Helper
             return list;
         }
 
+        public static string Code = "";
+
         /// <summary>
         /// 从接口获取信息,获取message对应value值
         /// </summary>
@@ -436,6 +439,7 @@ namespace PDF_Master.Helper
                     JObject jobject = (JObject)JsonConvert.DeserializeObject(json);
                     string unicode = "";
                     // 遍历字典对象输出键值对
+                    Code = jobject["code"].ToObject<string>().ToLower();
                     unicode = jobject["data"][key].ToObject<string>().ToLower();
 
                     //将Unicode格式转换成String
@@ -445,6 +449,7 @@ namespace PDF_Master.Helper
             }
             catch (Exception ex)
             {
+                Code = "300";
                 return null;
             }
             return repsonseData;
@@ -575,7 +580,7 @@ namespace PDF_Master.Helper
                 case 25:
                     return "hu";
                 default:
-                    return"";
+                    return "";
             }
         }
         #endregion

+ 9 - 5
PDF Office/ViewModels/Dialog/ChatGPTAIDialogs/DocumentaryTranslationDialogViewModel.cs

@@ -108,10 +108,15 @@ namespace PDF_Master.ViewModels.Dialog.ChatGPTAIDialogs
                     if (viewContentViewModel != null)
                     {
                         viewContentViewModel.OpenFile(new string[] { newfile });
+                        RequestClose.Invoke(new DialogResult(ButtonResult.Cancel));
                     }
                 }
             }
-            RequestClose.Invoke(new DialogResult(ButtonResult.Cancel));
+            else {
+                //newfile code
+            }
+
+
         }
 
         public string Title => "";
@@ -139,15 +144,14 @@ namespace PDF_Master.ViewModels.Dialog.ChatGPTAIDialogs
                 {
                     PDFViewer = new CPDFViewer();
                     PDFViewer.InitDocument(pdfViewer.Document);
-                    //Document = PDFViewer.Document;
-                    //pdfViewer.CustomDrawHandler += CurrentViewer_CustomDrawHandler;
-                    //pdfViewer.UndoManager.PropertyChanged += UndoManager_PropertyChanged;
                     regionManager.AddToRegion(ViewerRegionName, PDFViewer);
                     PDFViewer.SetAnnotInteraction(!PDFViewer.GetAnnotInteraction());
                     PDFViewer.Load();
+                    PDFViewer.ChangeViewMode(ViewMode.SingleContinuous);
                     PDFViewer.ChangeFitMode(FitMode.FitHeight);
-                    PDFViewer.ChangeViewMode(ViewMode.Single);
                     PDFViewer.SetMouseMode(MouseModes.PanTool);
+                    PDFViewer.Document.ReleasePages();
+                    PDFViewer.ReloadDocument();
                     fromlanguage = ChatGTPAIHelper.UpdateLanguagebType(0);
                     tolanguage = ChatGTPAIHelper.UpdateLanguagebType(1);
                     //PageRangeNumber = PDFViewer.Document.PageCount;

+ 32 - 2
PDF Office/ViewModels/Dialog/ChatGPTAIDialogs/SelectedTranslationDialogViewModel.cs

@@ -12,6 +12,7 @@ using static System.Net.Mime.MediaTypeNames;
 using System.Windows.Forms;
 using Microsoft.Office.Core;
 using System.Threading.Tasks;
+using System.Windows;
 
 namespace PDF_Master.ViewModels.Dialog.ChatGPTAIDialogs
 {
@@ -42,6 +43,30 @@ namespace PDF_Master.ViewModels.Dialog.ChatGPTAIDialogs
             }
         }
 
+        private string errorTipText;
+
+        public string ErrorTipText
+        {
+            get { return errorTipText; }
+            set
+            {
+                SetProperty(ref errorTipText, value);
+            }
+        }
+
+        private Visibility errorVisible = Visibility.Collapsed;
+        public Visibility ErrorVisible
+        {
+            get
+            {
+                return errorVisible;
+            }
+            set
+            {
+                SetProperty(ref errorVisible, value);
+            }
+        }
+
         private string fromlanguage = "";
 
         private string tolanguage = "";
@@ -100,17 +125,22 @@ namespace PDF_Master.ViewModels.Dialog.ChatGPTAIDialogs
         public async void translate()
         {
             string translatetext = "";
+            string Code = "";
             await Task.Run( delegate
             {
-                ChatGTPAIHelper.textTranslate(SelectedText, fromlanguage, tolanguage, ref translatetext);
+                Code=ChatGTPAIHelper.textTranslate(SelectedText, fromlanguage, tolanguage, ref translatetext);
             });
+            if (Code != "200") {
+                ErrorVisible = Visibility.Visible;
+            }
+            
             TranslateText = translatetext;
         }
         public void copy()
         {
             try
             {
-                Clipboard.SetText(TranslateText);
+                System.Windows.Forms.Clipboard.SetText(TranslateText);
             }
             catch { }
 

+ 44 - 2
PDF Office/ViewModels/HomePanel/ChatGPTAI/ChatGPTAIErrorCorrectionContentViewModel.cs

@@ -5,6 +5,7 @@ using System;
 using System.Collections.Generic;
 using System.Linq;
 using System.Threading.Tasks;
+using System.Windows;
 using System.Windows.Forms;
 
 namespace PDF_Master.ViewModels.HomePanel.ChatGPTAI
@@ -34,6 +35,43 @@ namespace PDF_Master.ViewModels.HomePanel.ChatGPTAI
             }
         }
 
+        private Visibility showTip = Visibility.Collapsed;
+        public Visibility ShowTip
+        {
+            get
+            {
+                return showTip;
+            }
+            set
+            {
+                SetProperty(ref showTip, value);
+            }
+        }
+
+        private string errorTipText= "Limit 150 characters at a time";
+
+        public string ErrorTipText
+        {
+            get { return errorTipText; }
+            set
+            {
+                SetProperty(ref errorTipText, value);
+            }
+        }
+
+        private Visibility errorVisible = Visibility.Collapsed;
+        public Visibility ErrorVisible
+        {
+            get
+            {
+                return errorVisible;
+            }
+            set
+            {
+                SetProperty(ref errorVisible, value);
+            }
+        }
+
         public DelegateCommand CopyCommand { get; set; }
 
         public DelegateCommand ErrorCorrectionCommand { get; set; }
@@ -47,7 +85,8 @@ namespace PDF_Master.ViewModels.HomePanel.ChatGPTAI
         {
             try
             {
-                Clipboard.SetText(ErrorCorrectionText);
+                System.Windows.Forms.Clipboard.SetText(ErrorCorrectionText);
+                ShowTip=Visibility.Visible;
             }
             catch { }
 
@@ -55,11 +94,14 @@ namespace PDF_Master.ViewModels.HomePanel.ChatGPTAI
 
         public async void errorCorrection()
         {
-
+            
             await Task.Run(async delegate
             {
                 ErrorCorrectionText = await ChatGTPAIHelper.Correction(InputText);
             });
+            if (ChatGTPAIHelper.Code != "200") {
+                ErrorVisible=Visibility.Visible;
+            }
         }
     }
 }

+ 46 - 1
PDF Office/ViewModels/HomePanel/ChatGPTAI/ChatGPTAIRewritingContentViewModel.cs

@@ -5,7 +5,9 @@ using System;
 using System.Collections.Generic;
 using System.Linq;
 using System.Threading.Tasks;
+using System.Windows;
 using System.Windows.Forms;
+using System.Windows.Threading;
 
 namespace PDF_Master.ViewModels.HomePanel.ChatGPTAI
 {
@@ -33,6 +35,44 @@ namespace PDF_Master.ViewModels.HomePanel.ChatGPTAI
                 SetProperty(ref rewriteText, value);
             }
         }
+
+        private Visibility showTip = Visibility.Collapsed;
+        public Visibility ShowTip
+        {
+            get
+            {
+                return showTip;
+            }
+            set
+            {
+                SetProperty(ref showTip, value);
+            }
+        }
+
+        private string errorTipText;
+
+        public string ErrorTipText
+        {
+            get { return errorTipText; }
+            set
+            {
+                SetProperty(ref errorTipText, value);
+            }
+        }
+
+        private Visibility errorVisible = Visibility.Collapsed;
+        public Visibility ErrorVisible
+        {
+            get
+            {
+                return errorVisible;
+            }
+            set
+            {
+                SetProperty(ref errorVisible, value);
+            }
+        }
+
         public DelegateCommand CopyCommand { get; set; }
 
         public DelegateCommand RewriteCommand { get; set; }
@@ -46,7 +86,8 @@ namespace PDF_Master.ViewModels.HomePanel.ChatGPTAI
         {
             try
             {
-                Clipboard.SetText(RewriteText);
+                System.Windows.Forms.Clipboard.SetText(RewriteText);
+                ShowTip=Visibility.Visible;
             }
             catch { }
 
@@ -57,6 +98,10 @@ namespace PDF_Master.ViewModels.HomePanel.ChatGPTAI
             {
                 RewriteText = await ChatGTPAIHelper.Rewrite(InputText);
             });
+            if (ChatGTPAIHelper.Code != "200")
+            {
+                ErrorVisible = Visibility.Visible;
+            }
         }
     }
 }

+ 2 - 1
PDF Office/ViewModels/HomePanel/ChatGPTAI/ChatGPTAITranslationContentViewModel.cs

@@ -147,7 +147,8 @@ namespace PDF_Master.ViewModels.HomePanel.ChatGPTAI
                         }
                     }
                 }
-                ErrorTipVisible=Visibility.Visible;
+                //newfile code
+                ErrorTipVisible =Visibility.Visible;
             }
         }
 

+ 20 - 8
PDF Office/Views/Dialog/ChatGPTAIDialogs/SelectedTranslationDialog.xaml

@@ -11,7 +11,8 @@
     Height="342"
     d:DesignHeight="342"
     d:DesignWidth="548"
-    prism:Dialog.WindowStyle="{StaticResource DialogWindowStyle}"
+    prism:Dialog.WindowStyle="{StaticResource DialogWindowStyle}" 
+             Background="White"
     prism:ViewModelLocator.AutoWireViewModel="True"
     mc:Ignorable="d">
     <UserControl.Resources>
@@ -28,16 +29,16 @@
         <Grid Grid.Row="0">
             <StackPanel Orientation="Horizontal">
                 <TextBlock  Margin="16,0,0,0" Text="AI Translation" FontFamily="Segoe UI"
-            FontSize="20"
+            FontSize="16"
             FontWeight="Bold"
             Foreground="{StaticResource color.sys.text.neutral.lv1}" Height="28"></TextBlock>
-                <Grid Width="16" Height="16" Margin="4,0,0,0">
+                <Grid Width="16" Height="16" Margin="4,0,0,4" WindowChrome.IsHitTestVisibleInChrome="True">
                     <Grid.ToolTip>
                         <ToolTip>
-                            <TextBlock FontWeight="Bold" Text="Limit document size to 10M, document&#13; page number to 30, 10w characters per&#13; month" />
+                            <TextBlock FontWeight="Bold" Width="100" Text="Limit document size to 10M, document&#13; page number to 30, 10w characters per&#13; month" />
                         </ToolTip>
                     </Grid.ToolTip>
-                    <Ellipse Width="13" Height="13"  Fill="white" Stroke="#CED0D4">
+                    <Ellipse Width="14" Height="14"  Fill="white" Stroke="#CED0D4">
                     </Ellipse>
                     <Path Data="M7.4701 8.91H8.5001L8.7601 5.49L8.8101 4H7.1601L7.2101 5.49L7.4701 8.91ZM7.9901 11.58C8.4901 11.58 8.8701 11.21 8.8701 10.69C8.8701 10.17 8.4901 9.81 7.9901 9.81C7.4801 9.81 7.1001 10.17 7.1001 10.69C7.1001 11.21 7.4701 11.58 7.9901 11.58Z" Fill="#94989C"/>
                 </Grid>
@@ -77,9 +78,20 @@
                         <Button HorizontalAlignment="Right" Width="97" Height="24" Content="Translate" VerticalAlignment="Bottom" Style="{StaticResource Btn.cta}" Margin="0,8,0,0" Command="{Binding TranslateCommand}" IsEnabled="{Binding ElementName=textBoxEnterCharacters,Path=Text.Length, Converter={StaticResource SizeToBoolConvert}}"></Button>
                     </StackPanel>
                     <StackPanel>
-                        <cus:TextBoxEx  Width="250" Height="180" Margin="16,0,0,0" Text="{Binding TranslateText}" FontFamily="Segoe UI" ShowClose="False" VerticalContentAlignment="Top" HorizontalContentAlignment="Left" TextWrapping="Wrap" Padding="8" IsReadOnly="True">
-                        </cus:TextBoxEx>
-                        <Button HorizontalAlignment="Right" Width="97" Height="24" Content="Copy" VerticalAlignment="Bottom"  Margin="0,8,0,0" Command="{Binding CopyCommand}"></Button>
+                        <Grid>
+                            <Border Width="250" Height="180" Margin="16,0,0,0"  Panel.ZIndex="1" BorderBrush="{StaticResource color.field.border.error}" Effect="{StaticResource shadow.error.s}"  Visibility="{Binding ErrorVisible}" BorderThickness="1" CornerRadius="4"  >
+                                <StackPanel Orientation="Horizontal" VerticalAlignment="Top" Margin="16">
+                                    <Grid Width="16" Height="16" Margin="4,0,8,0">
+                                        <Ellipse Width="14" Height="14" Fill="#F3465B"></Ellipse>
+                                        <Path  Data="M7.25 4V9H8.75V4H7.25ZM7.25 10.5V12H8.75L8.75 10.5H7.25Z" Fill="white"/>
+                                    </Grid>
+                                    <TextBlock Text="{Binding ErrorTipText}" FontSize="14" FontFamily="SF Pro Text" Foreground="White" VerticalAlignment="Center"></TextBlock>
+                                </StackPanel>
+                            </Border>
+                            <cus:TextBoxEx  Width="250" Height="180" Margin="16,0,0,0" Text="{Binding TranslateText}" FontFamily="Segoe UI" ShowClose="False" VerticalContentAlignment="Top" HorizontalContentAlignment="Left" TextWrapping="Wrap" Padding="8" IsReadOnly="True">
+                            </cus:TextBoxEx>
+                        </Grid>
+                        <Button HorizontalAlignment="Right" Width="97" Height="24" Content="Copy" VerticalAlignment="Bottom"  Margin="0,8,0,0" Command="{Binding CopyCommand}" Style="{StaticResource btn.sec}"></Button>
                     </StackPanel>
                 </StackPanel>
             </StackPanel>

+ 34 - 5
PDF Office/Views/HomePanel/ChatGPTAI/ChatGPTAIErrorCorrectionContent.xaml

@@ -22,7 +22,7 @@
     <Grid Margin="32,0,32,0">
         <Grid.RowDefinitions>
             <RowDefinition Height="*" />
-            <RowDefinition Height="*" />
+            <RowDefinition Height="1.06*" />
         </Grid.RowDefinitions>
         <StackPanel Grid.Row="0">
             <Grid  >
@@ -50,16 +50,45 @@
             </Grid>
         </StackPanel>
         <StackPanel Grid.Row="1">
-            <Grid >
+            <Grid Height="84">
                 <TextBlock Text="Result" FontFamily="Segoe UI"
             FontSize="20"
             FontWeight="Bold"
+                           VerticalAlignment="Bottom" Margin="0,0,0,12"
             Foreground="{StaticResource color.sys.text.neutral.lv1}" Height="28" HorizontalAlignment="Left"></TextBlock>
-                <Button HorizontalAlignment="Right" Width="104" Height="32" Content="Copy" Background="White" Command="{Binding CopyCommand}"></Button>
+                <Grid HorizontalAlignment="Right">
+                    <cus:ToastControl
+                HorizontalAlignment="Center"
+                        VerticalAlignment="Top"
+                Width="72"
+                Height="32"
+                Margin="0,0,0,4"
+                Padding="0,4,0,0"
+                Background="{StaticResource color.sys.layout.dark.bg}"
+                BeginTime="0:0:0:3"
+                CornerRadius="4"
+                FontSize="14"
+                Foreground="White"
+                StringContent="Copied"
+                Visibility="{Binding ShowTip, Mode=TwoWay}"
+                Duration="0:0:0:3" />
+                    <Button HorizontalAlignment="Right" VerticalAlignment="Bottom" Margin="0,0,0,12" Width="104" Height="32" Content="Copy" Background="White" Command="{Binding CopyCommand}" Style="{StaticResource btn.sec}"></Button>
+                </Grid>
             </Grid>
-            <cus:TextBoxEx Height="260" Margin="0,12,0,0" Text="{Binding ErrorCorrectionText}" FontFamily="Segoe UI" ShowClose="False" VerticalContentAlignment="Top" HorizontalContentAlignment="Left" TextWrapping="Wrap" Padding="8" IsReadOnly="True">
+            <Grid>
+                <Border Height="260"  Panel.ZIndex="1" BorderBrush="{StaticResource color.field.border.error}" Effect="{StaticResource shadow.error.s}"  Visibility="{Binding ErrorVisible}" BorderThickness="1" CornerRadius="4"  >
+                    <StackPanel Orientation="Horizontal" VerticalAlignment="Top" Margin="16">
+                        <Grid Width="16" Height="16" Margin="4,0,8,0">
+                            <Ellipse Width="14" Height="14" Fill="#F3465B"></Ellipse>
+                            <Path  Data="M7.25 4V9H8.75V4H7.25ZM7.25 10.5V12H8.75L8.75 10.5H7.25Z" Fill="white"/>
+                        </Grid>
+                        <TextBlock Text="{Binding ErrorTipText}" FontSize="14" FontFamily="SF Pro Text" Foreground="White" VerticalAlignment="Center"></TextBlock>
+                    </StackPanel>
+                </Border>
+                <cus:TextBoxEx Height="260"  Text="{Binding ErrorCorrectionText}" FontFamily="Segoe UI" ShowClose="False" VerticalContentAlignment="Top" HorizontalContentAlignment="Left" TextWrapping="Wrap" Padding="8" IsReadOnly="True">
 
-            </cus:TextBoxEx>
+                </cus:TextBoxEx>
+            </Grid>
         </StackPanel>
     </Grid>
 </UserControl>

+ 36 - 7
PDF Office/Views/HomePanel/ChatGPTAI/ChatGPTAIRewritingContent.xaml

@@ -21,8 +21,8 @@
     </UserControl.Resources>
     <Grid Margin="32,0,32,0">
         <Grid.RowDefinitions>
-            <RowDefinition Height="*" />
-            <RowDefinition Height="*" />
+            <RowDefinition Height="1*" />
+            <RowDefinition Height="1.06*" />
         </Grid.RowDefinitions>
         <StackPanel Grid.Row="0">
             <Grid  >
@@ -43,23 +43,52 @@
                 </StackPanel>
                 <Button HorizontalAlignment="Right" Width="104" Height="32" Content="Rewrite" VerticalAlignment="Bottom" Style="{StaticResource Btn.cta}" Command="{Binding RewriteCommand}" IsEnabled="{Binding ElementName=textBoxEnterCharacters,Path=Text.Length, Converter={StaticResource SizeToBoolConvert}}"></Button>
             </Grid>
-            <Grid  Height="260" Margin="0,12,0,0">
+            <Grid  Height="260" Margin="0,12,0,0" >
                 <cus:TextBoxEx x:Name="textBoxEnterCharacters"  Height="260" Text="{Binding InputText}"  FontFamily="Segoe UI" ShowClose="False" PlaceholderText="Please enter text content here..." VerticalContentAlignment="Top" HorizontalContentAlignment="Left" TextWrapping="Wrap" Padding="8">
                 </cus:TextBoxEx>
                 <TextBlock Text="{Binding ElementName=textBoxEnterCharacters,Path=Text.Length,StringFormat={}{0}/150}" Foreground="{Binding ElementName=textBoxEnterCharacters,Path=Text.Length, Converter={StaticResource SizeBrushConvert}}" Panel.ZIndex="1" Height="22" FontSize="14" HorizontalAlignment="Right"  VerticalAlignment="Bottom" Margin="0,0,12,8"/>
             </Grid>
         </StackPanel>
-        <StackPanel Grid.Row="1">
-            <Grid >
+        <StackPanel Grid.Row="1" >
+            <Grid Height="84" >
                 <TextBlock Text="Result" FontFamily="Segoe UI"
             FontSize="20"
             FontWeight="Bold"
+                           VerticalAlignment="Bottom" Margin="0,0,0,12"
             Foreground="{StaticResource color.sys.text.neutral.lv1}" Height="28" HorizontalAlignment="Left"></TextBlock>
-                <Button HorizontalAlignment="Right" Width="104" Height="32" Content="Copy" Background="White" Command="{Binding CopyCommand}" ></Button>
+                <Grid HorizontalAlignment="Right">
+                    <cus:ToastControl
+                HorizontalAlignment="Center"
+                        VerticalAlignment="Top"
+                Width="72"
+                Height="32"
+                Margin="0,0,0,4"
+                Padding="0,4,0,0"
+                Background="{StaticResource color.sys.layout.dark.bg}"
+                BeginTime="0:0:0:3"
+                CornerRadius="4"
+                FontSize="14"
+                Foreground="White"
+                StringContent="Copied"
+                Visibility="{Binding ShowTip, Mode=TwoWay}"
+                Duration="0:0:0:3" />
+                    <Button HorizontalAlignment="Right" VerticalAlignment="Bottom" Margin="0,0,0,12" Width="104" Height="32" Content="Copy" Background="White" Command="{Binding CopyCommand}" Style="{StaticResource btn.sec}"></Button>
+                </Grid>
+
             </Grid>
-            <cus:TextBoxEx  Height="260" Margin="0,12,0,0" Text="{Binding RewriteText}" FontFamily="Segoe UI" ShowClose="False" VerticalContentAlignment="Top" HorizontalContentAlignment="Left" TextWrapping="Wrap" Padding="8" IsReadOnly="True">
+            <Border Height="260"  Panel.ZIndex="1" BorderBrush="{StaticResource color.field.border.error}" Effect="{StaticResource shadow.error.s}"  Visibility="{Binding ErrorVisible}" BorderThickness="1" CornerRadius="4"  >
+                <StackPanel Orientation="Horizontal" VerticalAlignment="Top" Margin="16">
+                    <Grid Width="16" Height="16" Margin="4,0,8,0">
+                        <Ellipse Width="14" Height="14" Fill="#F3465B"></Ellipse>
+                        <Path  Data="M7.25 4V9H8.75V4H7.25ZM7.25 10.5V12H8.75L8.75 10.5H7.25Z" Fill="white"/>
+                    </Grid>
+                    <TextBlock Text="{Binding ErrorTipText}" FontSize="14" FontFamily="SF Pro Text" Foreground="White" VerticalAlignment="Center"></TextBlock>
+                </StackPanel>
+            </Border>
+            <cus:TextBoxEx  Height="260"  Text="{Binding RewriteText}" FontFamily="Segoe UI" ShowClose="False" VerticalContentAlignment="Top" HorizontalContentAlignment="Left" TextWrapping="Wrap" Padding="8" IsReadOnly="True">
 
             </cus:TextBoxEx>
+
         </StackPanel>
     </Grid>
 </UserControl>

+ 2 - 1
PDF Office/Views/HomePanel/ChatGPTAI/ChatGPTAITranslationContent.xaml

@@ -39,7 +39,8 @@ Height="{Binding RelativeSource={RelativeSource AncestorType={x:Type Border}}, P
                         </VisualBrush.Visual>
                     </VisualBrush>
                 </Border.BorderBrush>
-                <Grid AllowDrop="True"
+                <Grid AllowDrop="True" 
+                  Background="Transparent"    
                   Drop="Grid_Drop"
                   DragEnter="MainPage_DragEnter"
                   DragOver="MainPage_DragOver"