diff --git a/WordAddIn/.vs/WordAddIn/CopilotIndices/17.14.1577.30250/CodeChunks.db b/WordAddIn/.vs/WordAddIn/CopilotIndices/17.14.1577.30250/CodeChunks.db index b3f5ffa..d9a5fd7 100644 Binary files a/WordAddIn/.vs/WordAddIn/CopilotIndices/17.14.1577.30250/CodeChunks.db and b/WordAddIn/.vs/WordAddIn/CopilotIndices/17.14.1577.30250/CodeChunks.db differ diff --git a/WordAddIn/.vs/WordAddIn/CopilotIndices/17.14.1577.30250/SemanticSymbols.db b/WordAddIn/.vs/WordAddIn/CopilotIndices/17.14.1577.30250/SemanticSymbols.db index 6d7dd6c..e0a158f 100644 Binary files a/WordAddIn/.vs/WordAddIn/CopilotIndices/17.14.1577.30250/SemanticSymbols.db and b/WordAddIn/.vs/WordAddIn/CopilotIndices/17.14.1577.30250/SemanticSymbols.db differ diff --git a/WordAddIn/.vs/WordAddIn/FileContentIndex/2c66d38d-0c2c-4ae7-b23e-a980a4a7e1fb.vsidx b/WordAddIn/.vs/WordAddIn/FileContentIndex/2c66d38d-0c2c-4ae7-b23e-a980a4a7e1fb.vsidx deleted file mode 100644 index 70aef67..0000000 Binary files a/WordAddIn/.vs/WordAddIn/FileContentIndex/2c66d38d-0c2c-4ae7-b23e-a980a4a7e1fb.vsidx and /dev/null differ diff --git a/WordAddIn/.vs/WordAddIn/FileContentIndex/2de1c258-fcc8-40bc-a5e7-7b89e28d1bee.vsidx b/WordAddIn/.vs/WordAddIn/FileContentIndex/2de1c258-fcc8-40bc-a5e7-7b89e28d1bee.vsidx new file mode 100644 index 0000000..37b9cf3 Binary files /dev/null and b/WordAddIn/.vs/WordAddIn/FileContentIndex/2de1c258-fcc8-40bc-a5e7-7b89e28d1bee.vsidx differ diff --git a/WordAddIn/.vs/WordAddIn/FileContentIndex/abbe6c8c-a6a1-4efb-831f-84215a9cba5b.vsidx b/WordAddIn/.vs/WordAddIn/FileContentIndex/abbe6c8c-a6a1-4efb-831f-84215a9cba5b.vsidx deleted file mode 100644 index 3b0a55c..0000000 Binary files a/WordAddIn/.vs/WordAddIn/FileContentIndex/abbe6c8c-a6a1-4efb-831f-84215a9cba5b.vsidx and /dev/null differ diff --git a/WordAddIn/.vs/WordAddIn/FileContentIndex/267372ec-0c92-491b-b3e2-fc07590dfc90.vsidx b/WordAddIn/.vs/WordAddIn/FileContentIndex/d95b7591-1712-4381-b7ef-a387afb40f1b.vsidx similarity index 100% rename from WordAddIn/.vs/WordAddIn/FileContentIndex/267372ec-0c92-491b-b3e2-fc07590dfc90.vsidx rename to WordAddIn/.vs/WordAddIn/FileContentIndex/d95b7591-1712-4381-b7ef-a387afb40f1b.vsidx diff --git a/WordAddIn/.vs/WordAddIn/FileContentIndex/f0de7db9-fb84-460b-9e62-5323d5caa827.vsidx b/WordAddIn/.vs/WordAddIn/FileContentIndex/f0de7db9-fb84-460b-9e62-5323d5caa827.vsidx new file mode 100644 index 0000000..694549d Binary files /dev/null and b/WordAddIn/.vs/WordAddIn/FileContentIndex/f0de7db9-fb84-460b-9e62-5323d5caa827.vsidx differ diff --git a/WordAddIn/.vs/WordAddIn/v17/.suo b/WordAddIn/.vs/WordAddIn/v17/.suo index 5a9feda..270cdd7 100644 Binary files a/WordAddIn/.vs/WordAddIn/v17/.suo and b/WordAddIn/.vs/WordAddIn/v17/.suo differ diff --git a/WordAddIn/.vs/WordAddIn/v17/DocumentLayout.backup.json b/WordAddIn/.vs/WordAddIn/v17/DocumentLayout.backup.json index 196c58c..53c6430 100644 --- a/WordAddIn/.vs/WordAddIn/v17/DocumentLayout.backup.json +++ b/WordAddIn/.vs/WordAddIn/v17/DocumentLayout.backup.json @@ -36,7 +36,7 @@ "RelativeDocumentMoniker": "WordAddIn\\AiRibbon.cs", "ToolTip": "D:\\dsWork\\aiData\\WordAddIn\\WordAddIn\\AiRibbon.cs", "RelativeToolTip": "WordAddIn\\AiRibbon.cs", - "ViewState": "AgIAACMAAAAAAAAAAAAowD8AAAAIAAAAAAAAAA==", + "ViewState": "AgIAAPcAAAAAAAAAAAA1wAsBAABFAAAAAAAAAA==", "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|", "WhenOpened": "2026-01-24T10:05:10.056Z", "EditorCaption": "" diff --git a/WordAddIn/.vs/WordAddIn/v17/DocumentLayout.json b/WordAddIn/.vs/WordAddIn/v17/DocumentLayout.json index 196c58c..53c6430 100644 --- a/WordAddIn/.vs/WordAddIn/v17/DocumentLayout.json +++ b/WordAddIn/.vs/WordAddIn/v17/DocumentLayout.json @@ -36,7 +36,7 @@ "RelativeDocumentMoniker": "WordAddIn\\AiRibbon.cs", "ToolTip": "D:\\dsWork\\aiData\\WordAddIn\\WordAddIn\\AiRibbon.cs", "RelativeToolTip": "WordAddIn\\AiRibbon.cs", - "ViewState": "AgIAACMAAAAAAAAAAAAowD8AAAAIAAAAAAAAAA==", + "ViewState": "AgIAAPcAAAAAAAAAAAA1wAsBAABFAAAAAAAAAA==", "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|", "WhenOpened": "2026-01-24T10:05:10.056Z", "EditorCaption": "" diff --git a/WordAddIn/WordAddIn/AiRibbon.cs b/WordAddIn/WordAddIn/AiRibbon.cs index dab926e..0418d1f 100644 --- a/WordAddIn/WordAddIn/AiRibbon.cs +++ b/WordAddIn/WordAddIn/AiRibbon.cs @@ -215,6 +215,89 @@ namespace WordAddIn } } + /// + /// 【总结大纲】按钮点击事件处理。 + /// 功能描述: + /// 1. 获取选中文本(或剪贴板内容)。 + /// 2. 调用 AI 总结接口,将内容总结为结构化大纲。 + /// 3. 弹出窗口展示大纲,并提供复制功能。 + /// + /// 触发事件的 Ribbon 控件 + public async void OnSummarizeOutlineClick(Office.IRibbonControl control) + { + if (!EnsureLoggedIn()) return; + + LoadingForm loading = null; + try + { + var selection = Globals.ThisAddIn.Application.Selection; + string originalText = null; + + // 1. 优先使用选区文本 + if (selection.Type == Word.WdSelectionType.wdSelectionNormal && !string.IsNullOrWhiteSpace(selection.Text)) + { + originalText = selection.Text.Trim(); + } + // 2. 其次使用剪贴板文本 + else + { + try + { + if (Clipboard.ContainsText()) + { + originalText = Clipboard.GetText().Trim(); + } + } + catch (Exception ex) + { + Console.WriteLine("Clipboard access failed: " + ex.Message); + } + } + + if (string.IsNullOrWhiteSpace(originalText)) + { + MessageBox.Show("请先选择一段文字,或者确保剪贴板中有内容。"); + return; + } + + loading = new LoadingForm("AI 正在总结大纲,请稍候..."); + loading.Show(); + loading.Refresh(); + + // 3. 调用 AI 服务进行总结 + string outlineText = await Task.Run(() => _aiService.SummarizeToOutline(originalText)); + + loading.CloseSafe(); + loading.Dispose(); + loading = null; + + if (!string.IsNullOrEmpty(outlineText)) + { + // 4. 弹出结果展示窗体 + using (var resultForm = new OutlineResultForm(outlineText)) + { + resultForm.ShowDialog(); + } + } + else + { + MessageBox.Show("总结大纲失败,AI 未返回有效内容。"); + } + } + catch (Exception ex) + { + MessageBox.Show("总结大纲失败: " + ex.Message); + } + finally + { + if (loading != null) + { + loading.CloseSafe(); + loading.Dispose(); + } + } + } + /// /// 【润色加工】按钮点击事件处理。 /// 功能描述: @@ -740,47 +823,76 @@ namespace WordAddIn { var selection = Globals.ThisAddIn.Application.Selection; string prompt = selection.Text; + + // 1. 尝试获取选区文本 + if (!string.IsNullOrWhiteSpace(prompt)) + { + prompt = prompt.Trim(); + } + + // 2. 如果选区为空(或只包含空白字符),尝试获取剪贴板文本 if (string.IsNullOrWhiteSpace(prompt)) { - MessageBox.Show("请先选择一段描述图片的文字。"); + try + { + if (Clipboard.ContainsText()) + { + prompt = Clipboard.GetText().Trim(); + } + } + catch (Exception ex) + { + // 忽略剪贴板访问错误(如被其他进程占用) + Console.WriteLine("Clipboard access failed: " + ex.Message); + } + } + + // 3. 如果依然为空,提示用户 + if (string.IsNullOrWhiteSpace(prompt)) + { + MessageBox.Show("未能获取生图描述。\n请选择文档中的文字,或确保剪贴板中有文本内容。"); return; } - // 1. 弹出图片风格设置窗体 - string style = null; - string additionalPrompt = null; - using (var imgOptions = new ImageOptionsForm()) + // 获取全文背景和参考资料上下文,合并到 Prompt 中供用户预览和编辑 + string context = GetCombinedContext(); + if (!string.IsNullOrWhiteSpace(context)) { - if (imgOptions.ShowDialog() != DialogResult.OK) + prompt += $"\n\n{context}"; + } + + // 弹出选项窗体 + using (var form = new ImageOptionsForm()) + { + // 传入源文本 + form.SourceText = prompt; + + if (form.ShowDialog() != DialogResult.OK) { - return; // 用户取消 + return; } - style = imgOptions.SelectedStyle; - additionalPrompt = imgOptions.AdditionalPrompt; - } - // 2. 组合 Prompt:原文 + 补充要求 - if (!string.IsNullOrWhiteSpace(additionalPrompt)) - { - prompt += $"\n补充要求: {additionalPrompt}"; - } + string finalPrompt = form.FinalPrompt; + bool shouldOptimize = form.ShouldOptimize; + string style = form.SelectedStyle; - loading = new LoadingForm("AI 正在绘制图片,请稍候..."); - loading.Show(); - loading.Refresh(); + loading = new LoadingForm("AI 正在生成图片,请稍候..."); + loading.Show(); + loading.Refresh(); - // 3. 调用 AI 服务生成图片 URL - // 注意:生图通常比较慢,需要耐心等待 - string imageUrl = await Task.Run(() => _aiService.GenerateImageUrl(prompt, style)); + // 3. 调用 AI 服务生成图片 URL + // 传入 finalPrompt 和 shouldOptimize + string imageUrl = await Task.Run(() => _aiService.GenerateImageUrl(finalPrompt, style, shouldOptimize)); - if (!string.IsNullOrEmpty(imageUrl)) - { - // 4. 插入图片 - InsertImageFromUrl(imageUrl); - } - else - { - MessageBox.Show("未生成图片 URL。"); + if (!string.IsNullOrEmpty(imageUrl)) + { + // 4. 插入图片 + InsertImageFromUrl(imageUrl); + } + else + { + MessageBox.Show("未生成图片 URL。"); + } } } catch (Exception ex) diff --git a/WordAddIn/WordAddIn/AiRibbon.xml b/WordAddIn/WordAddIn/AiRibbon.xml index f0f7855..669a8d4 100644 --- a/WordAddIn/WordAddIn/AiRibbon.xml +++ b/WordAddIn/WordAddIn/AiRibbon.xml @@ -7,6 +7,7 @@ private async Task OptimizePromptForImage(string originalPrompt, string style = null) { + // 注意:架构图的特殊模板处理已移动到 UI 层 (ImageOptionsForm), + // 这里主要处理需要 AI 翻译和润色的艺术风格。 + string styleInstruction = string.IsNullOrEmpty(style) ? "" : $"6. 图片风格必须严格遵循:{style}。"; var messages = new List diff --git a/WordAddIn/WordAddIn/ImageOptionsForm.cs b/WordAddIn/WordAddIn/ImageOptionsForm.cs index 0f8a645..2d5751e 100644 --- a/WordAddIn/WordAddIn/ImageOptionsForm.cs +++ b/WordAddIn/WordAddIn/ImageOptionsForm.cs @@ -9,172 +9,213 @@ namespace WordAddIn /// /// 生成配图设置窗体。 /// 功能描述: - /// 1. 允许用户选择图片风格(如写实、卡通、3D渲染等)。 - /// 2. 允许用户输入额外的描述(如颜色、背景要求等)。 - /// 3. 支持保存上次选择的风格,提升用户体验。 + /// 1. 允许用户选择图片风格(包括多种架构图)。 + /// 2. 自动根据选择的风格生成提示词模板。 + /// 3. 允许用户直接编辑最终发送给 AI 的提示词。 /// public class ImageOptionsForm : Form { /// - /// 用户选择的图片风格。 + /// 最终生成的提示词(用户编辑后的版本)。 + /// + public string FinalPrompt { get; private set; } + + /// + /// 是否需要 AI 进一步优化提示词(翻译/润色)。 + /// 对于架构图通常为 false(直接使用模板),对于艺术画通常为 true。 + /// + public bool ShouldOptimize { get; private set; } + + /// + /// 源文本(从 Word 选区或剪贴板获取)。 + /// + public string SourceText { get; set; } + + /// + /// 用户选择的风格名称(用于后续可能的引用,虽然后端逻辑已主要依赖 FinalPrompt) /// public string SelectedStyle { get; private set; } - - /// - /// 用户输入的补充描述。 - /// - public string AdditionalPrompt { get; private set; } private ComboBox cmbStyles; - private TextBox txtAdditionalPrompt; + private TextBox txtFinalPrompt; + private CheckBox chkOptimize; private Button btnOk; private Button btnCancel; private Label lblStyle; private Label lblPrompt; - private readonly string[] _styles = new string[] - { - "写实摄影 (Photorealistic)", - "软件架构图 (Architecture Diagram)", - "技术原理图 (Technical Schematic)", - "手绘草图 (Sketch)", - "卡通插画 (Cartoon)", - "3D 渲染 (3D Render)", - "水彩画 (Watercolor)", - "赛博朋克 (Cyberpunk)" - }; + private readonly Dictionary _styleTemplates = new Dictionary(); public ImageOptionsForm() { + InitializeTemplates(); InitializeComponent(); - InitializeStyles(); } - /// - /// 初始化窗体组件。 - /// + private void InitializeTemplates() + { + // 基础模板:用于架构图系列 + // 注意:{0} 是图表类型,{1} 是内容占位符 + string archTemplate = + "帮我绘制{0},必须文字合使用中文,中文一定要清晰可见,不能字体模糊或者创造不存在的汉字!\n" + + "同时要美观,大方。\n\n" + + "内容如下:\n{1}\n\n" + + "根据如下内容创建一个整体上的{0},美观,细节处理仔细,特别需要注意的是文字的准确性,中文不要出现错字或不可识别的乱码!!!" + + "同时,字体除标题使用黑体外,其它一概使用宋体,这样不容易出现字体不完整的情况!!!!"; + + // 注册所有支持的风格及其处理逻辑 + // 架构图类 + _styleTemplates.Add("逻辑架构图 (Logical Architecture)", string.Format(archTemplate, "逻辑架构图", "{0}")); + _styleTemplates.Add("业务架构图 (Business Architecture)", string.Format(archTemplate, "业务架构图", "{0}")); + _styleTemplates.Add("应用架构图 (Application Architecture)", string.Format(archTemplate, "应用架构图", "{0}")); + _styleTemplates.Add("数据架构图 (Data Architecture)", string.Format(archTemplate, "数据架构图", "{0}")); + _styleTemplates.Add("技术架构图 (Technical Architecture)", string.Format(archTemplate, "技术架构图", "{0}")); + _styleTemplates.Add("部署架构图 (Deployment Architecture)", string.Format(archTemplate, "部署架构图", "{0}")); + _styleTemplates.Add("思维导图 (Mind Map)", string.Format(archTemplate, "思维导图", "{0}")); + _styleTemplates.Add("流程图 (Flow Chart)", string.Format(archTemplate, "流程图", "{0}")); + _styleTemplates.Add("时序图 (Sequence Diagram)", string.Format(archTemplate, "时序交互图", "{0}")); + _styleTemplates.Add("实施保障图 (Implementation & Safeguard Diagram)", string.Format(archTemplate, "实施保障图", "{0}")); + _styleTemplates.Add("逐步进化路线图 (Evolutionary Roadmap)", string.Format(archTemplate, "逐步进化路线图", "{0}")); + + // 艺术风格类 (Value 为 null 表示使用默认 AI 优化逻辑) + _styleTemplates.Add("写实摄影 (Photorealistic)", null); + _styleTemplates.Add("卡通插画 (Cartoon)", null); + _styleTemplates.Add("手绘草图 (Sketch)", null); + _styleTemplates.Add("3D 渲染 (3D Render)", null); + _styleTemplates.Add("水彩画 (Watercolor)", null); + _styleTemplates.Add("赛博朋克 (Cyberpunk)", null); + } + private void InitializeComponent() { - this.lblStyle = new System.Windows.Forms.Label(); - this.cmbStyles = new System.Windows.Forms.ComboBox(); - this.lblPrompt = new System.Windows.Forms.Label(); - this.txtAdditionalPrompt = new System.Windows.Forms.TextBox(); - this.btnOk = new System.Windows.Forms.Button(); - this.btnCancel = new System.Windows.Forms.Button(); - this.SuspendLayout(); - // - // lblStyle - // - this.lblStyle.AutoSize = true; - this.lblStyle.Location = new System.Drawing.Point(30, 30); - this.lblStyle.Name = "lblStyle"; - this.lblStyle.Size = new System.Drawing.Size(59, 12); - this.lblStyle.TabIndex = 0; - this.lblStyle.Text = "图片风格:"; - // - // cmbStyles - // - this.cmbStyles.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; - this.cmbStyles.FormattingEnabled = true; - this.cmbStyles.Location = new System.Drawing.Point(30, 55); - this.cmbStyles.Name = "cmbStyles"; - this.cmbStyles.Size = new System.Drawing.Size(370, 20); - this.cmbStyles.TabIndex = 1; - // - // lblPrompt - // - this.lblPrompt.AutoSize = true; - this.lblPrompt.Location = new System.Drawing.Point(30, 100); - this.lblPrompt.Name = "lblPrompt"; - this.lblPrompt.Size = new System.Drawing.Size(191, 12); - this.lblPrompt.TabIndex = 2; - this.lblPrompt.Text = "补充描述 (可选,例如:背景要白色):"; - // - // txtAdditionalPrompt - // - this.txtAdditionalPrompt.Location = new System.Drawing.Point(30, 125); - this.txtAdditionalPrompt.Multiline = true; - this.txtAdditionalPrompt.Name = "txtAdditionalPrompt"; - this.txtAdditionalPrompt.ScrollBars = System.Windows.Forms.ScrollBars.Vertical; - this.txtAdditionalPrompt.Size = new System.Drawing.Size(370, 60); - this.txtAdditionalPrompt.TabIndex = 3; - // - // btnOk - // - this.btnOk.DialogResult = System.Windows.Forms.DialogResult.OK; - this.btnOk.Location = new System.Drawing.Point(210, 210); - this.btnOk.Name = "btnOk"; - this.btnOk.Size = new System.Drawing.Size(90, 35); - this.btnOk.TabIndex = 4; - this.btnOk.Text = "生成图片"; - this.btnOk.UseVisualStyleBackColor = true; - this.btnOk.Click += new System.EventHandler(this.BtnOk_Click); - // - // btnCancel - // - this.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel; - this.btnCancel.Location = new System.Drawing.Point(310, 210); - this.btnCancel.Name = "btnCancel"; - this.btnCancel.Size = new System.Drawing.Size(90, 35); - this.btnCancel.TabIndex = 5; - this.btnCancel.Text = "取消"; - this.btnCancel.UseVisualStyleBackColor = true; - // - // ImageOptionsForm - // - this.AcceptButton = this.btnOk; - this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.CancelButton = this.btnCancel; - this.ClientSize = new System.Drawing.Size(450, 261); - this.Controls.Add(this.btnCancel); - this.Controls.Add(this.btnOk); - this.Controls.Add(this.txtAdditionalPrompt); - this.Controls.Add(this.lblPrompt); - this.Controls.Add(this.cmbStyles); - this.Controls.Add(this.lblStyle); - this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; + this.Text = "生成配图选项 - 支持编辑提示词"; + this.Size = new Size(500, 520); + this.StartPosition = FormStartPosition.CenterParent; + this.FormBorderStyle = FormBorderStyle.FixedDialog; this.MaximizeBox = false; this.MinimizeBox = false; - this.Name = "ImageOptionsForm"; - this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; - this.Text = "生成配图设置"; + + this.lblStyle = new Label(); + this.cmbStyles = new ComboBox(); + this.lblPrompt = new Label(); + this.txtFinalPrompt = new TextBox(); + this.chkOptimize = new CheckBox(); + this.btnOk = new Button(); + this.btnCancel = new Button(); + + this.SuspendLayout(); + + // lblStyle + this.lblStyle.AutoSize = true; + this.lblStyle.Location = new Point(20, 20); + this.lblStyle.Text = "图片风格:"; + + // cmbStyles + this.cmbStyles.DropDownStyle = ComboBoxStyle.DropDownList; + this.cmbStyles.Location = new Point(20, 45); + this.cmbStyles.Size = new Size(440, 25); + foreach (var key in _styleTemplates.Keys) + { + this.cmbStyles.Items.Add(key); + } + this.cmbStyles.SelectedIndexChanged += CmbStyles_SelectedIndexChanged; + + // lblPrompt + this.lblPrompt.AutoSize = true; + this.lblPrompt.Location = new Point(20, 85); + this.lblPrompt.Text = "提示词预览 (您可以直接修改下面的生成指令):"; + + // txtFinalPrompt + this.txtFinalPrompt.Location = new Point(20, 110); + this.txtFinalPrompt.Multiline = true; + this.txtFinalPrompt.ScrollBars = ScrollBars.Vertical; + this.txtFinalPrompt.Size = new Size(440, 280); + + // chkOptimize + this.chkOptimize.AutoSize = true; + this.chkOptimize.Location = new Point(20, 400); + this.chkOptimize.Size = new Size(400, 20); + this.chkOptimize.Text = "使用 AI 优化提示词 (自动翻译成英文并丰富细节)"; + this.chkOptimize.Checked = true; + + // btnOk + this.btnOk.Text = "开始生成"; + this.btnOk.DialogResult = DialogResult.OK; + this.btnOk.Location = new Point(280, 430); + this.btnOk.Size = new Size(90, 30); + this.btnOk.Click += BtnOk_Click; + + // btnCancel + this.btnCancel.Text = "取消"; + this.btnCancel.DialogResult = DialogResult.Cancel; + this.btnCancel.Location = new Point(380, 430); + this.btnCancel.Size = new Size(80, 30); + + this.Controls.Add(this.lblStyle); + this.Controls.Add(this.cmbStyles); + this.Controls.Add(this.lblPrompt); + this.Controls.Add(this.txtFinalPrompt); + this.Controls.Add(this.chkOptimize); + this.Controls.Add(this.btnOk); + this.Controls.Add(this.btnCancel); + this.ResumeLayout(false); this.PerformLayout(); - } - /// - /// 初始化风格列表,并尝试加载上次保存的风格。 - /// - private void InitializeStyles() + protected override void OnLoad(EventArgs e) { - cmbStyles.Items.AddRange(_styles); - - // 尝试恢复上次的选择 - string lastStyle = Settings.Default.LastImageStyle; - if (!string.IsNullOrEmpty(lastStyle) && cmbStyles.Items.Contains(lastStyle)) + base.OnLoad(e); + // 默认选中第一个风格(通常是逻辑架构图,如果 keys 顺序不对可能需要指定) + if (this.cmbStyles.Items.Count > 0) { - cmbStyles.SelectedItem = lastStyle; + // 尝试找到上次选中的或默认逻辑架构图 + int index = this.cmbStyles.FindString("逻辑架构图"); + this.cmbStyles.SelectedIndex = index >= 0 ? index : 0; } else { - cmbStyles.SelectedIndex = 0; // 默认选中第一个 + // Fallback update if no items or default + UpdatePrompt(); + } + } + + private void CmbStyles_SelectedIndexChanged(object sender, EventArgs e) + { + UpdatePrompt(); + } + + private void UpdatePrompt() + { + if (cmbStyles.SelectedItem == null) return; + + string styleKey = cmbStyles.SelectedItem.ToString(); + string template = _styleTemplates.ContainsKey(styleKey) ? _styleTemplates[styleKey] : null; + + // 只有当文本框为空,或者文本框内容是上一个模板生成的内容时,才自动覆盖 + // 但为了简单起见,这里策略是:只要切换风格,就重置提示词。用户如果修改了,切换风格会丢失修改。 + // 这是一个权衡。为了体验更好,可以加个判断,但现在先强制刷新。 + + if (template != null) + { + // 是架构图类:使用模板 + this.txtFinalPrompt.Text = template.Replace("{0}", this.SourceText ?? ""); + // 用户要求默认选中 AI 优化 + this.chkOptimize.Checked = true; + } + else + { + // 是艺术风格类:直接显示原文本,开启 AI 优化 + this.txtFinalPrompt.Text = this.SourceText ?? ""; + this.chkOptimize.Checked = true; } } - /// - /// 确定按钮点击事件。 - /// 获取用户选择,并保存风格到 Settings。 - /// private void BtnOk_Click(object sender, EventArgs e) { - SelectedStyle = cmbStyles.SelectedItem.ToString(); - AdditionalPrompt = txtAdditionalPrompt.Text.Trim(); - - // 保存选择 - Settings.Default.LastImageStyle = SelectedStyle; - Settings.Default.Save(); + this.FinalPrompt = this.txtFinalPrompt.Text; + this.ShouldOptimize = this.chkOptimize.Checked; + this.SelectedStyle = this.cmbStyles.SelectedItem?.ToString(); } } } diff --git a/WordAddIn/WordAddIn/OutlineResultForm.cs b/WordAddIn/WordAddIn/OutlineResultForm.cs new file mode 100644 index 0000000..b642bae --- /dev/null +++ b/WordAddIn/WordAddIn/OutlineResultForm.cs @@ -0,0 +1,107 @@ +using System; +using System.Windows.Forms; + +namespace WordAddIn +{ + /// + /// 大纲总结结果展示窗体。 + /// 功能描述: + /// 1. 展示 AI 生成的大纲总结内容。 + /// 2. 提供一键复制到剪贴板功能,方便后续生成架构图使用。 + /// + public class OutlineResultForm : Form + { + public string ResultText { get; private set; } + + private TextBox txtResult; + private Button btnCopy; + private Button btnClose; + private Label lblHint; + + public OutlineResultForm(string text) + { + ResultText = text; + InitializeComponent(); + txtResult.Text = text; + } + + private void InitializeComponent() + { + this.lblHint = new System.Windows.Forms.Label(); + this.txtResult = new System.Windows.Forms.TextBox(); + this.btnCopy = new System.Windows.Forms.Button(); + this.btnClose = new System.Windows.Forms.Button(); + this.SuspendLayout(); + // + // lblHint + // + this.lblHint.AutoSize = true; + this.lblHint.Location = new System.Drawing.Point(20, 15); + this.lblHint.Name = "lblHint"; + this.lblHint.Size = new System.Drawing.Size(400, 12); + this.lblHint.TabIndex = 0; + this.lblHint.Text = "AI 已将内容总结为以下大纲。请点击“复制”按钮,以便后续生成架构图。"; + // + // txtResult + // + this.txtResult.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.txtResult.Location = new System.Drawing.Point(20, 40); + this.txtResult.Multiline = true; + this.txtResult.Name = "txtResult"; + this.txtResult.ScrollBars = System.Windows.Forms.ScrollBars.Vertical; + this.txtResult.Size = new System.Drawing.Size(540, 350); + this.txtResult.TabIndex = 1; + // + // btnCopy + // + this.btnCopy.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.btnCopy.Location = new System.Drawing.Point(360, 410); + this.btnCopy.Name = "btnCopy"; + this.btnCopy.Size = new System.Drawing.Size(100, 30); + this.btnCopy.TabIndex = 2; + this.btnCopy.Text = "复制到剪贴板"; + this.btnCopy.UseVisualStyleBackColor = true; + this.btnCopy.Click += new System.EventHandler(this.btnCopy_Click); + // + // btnClose + // + this.btnClose.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.btnClose.Location = new System.Drawing.Point(480, 410); + this.btnClose.Name = "btnClose"; + this.btnClose.Size = new System.Drawing.Size(80, 30); + this.btnClose.TabIndex = 3; + this.btnClose.Text = "关闭"; + this.btnClose.UseVisualStyleBackColor = true; + this.btnClose.Click += new System.EventHandler(this.btnClose_Click); + // + // OutlineResultForm + // + this.ClientSize = new System.Drawing.Size(584, 461); + this.Controls.Add(this.btnClose); + this.Controls.Add(this.btnCopy); + this.Controls.Add(this.txtResult); + this.Controls.Add(this.lblHint); + this.Name = "OutlineResultForm"; + this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; + this.Text = "大纲总结结果"; + this.ResumeLayout(false); + this.PerformLayout(); + } + + private void btnCopy_Click(object sender, EventArgs e) + { + if (!string.IsNullOrEmpty(txtResult.Text)) + { + Clipboard.SetText(txtResult.Text); + MessageBox.Show("大纲内容已复制到剪贴板!\n现在您可以去使用“生成配图”功能,选择“逻辑架构图”风格来生成架构图了。", "复制成功"); + } + } + + private void btnClose_Click(object sender, EventArgs e) + { + this.Close(); + } + } +} diff --git a/WordAddIn/WordAddIn/WordAddIn.csproj b/WordAddIn/WordAddIn/WordAddIn.csproj index ac08f0b..b532b87 100644 --- a/WordAddIn/WordAddIn/WordAddIn.csproj +++ b/WordAddIn/WordAddIn/WordAddIn.csproj @@ -266,6 +266,9 @@ Form + + Form + Form diff --git a/WordAddIn/WordAddIn/bin/Debug/WordAddIn.dll b/WordAddIn/WordAddIn/bin/Debug/WordAddIn.dll index bc85c99..58b248c 100644 Binary files a/WordAddIn/WordAddIn/bin/Debug/WordAddIn.dll and b/WordAddIn/WordAddIn/bin/Debug/WordAddIn.dll differ diff --git a/WordAddIn/WordAddIn/bin/Debug/WordAddIn.dll.manifest b/WordAddIn/WordAddIn/bin/Debug/WordAddIn.dll.manifest index 8c51ce4..9230f20 100644 --- a/WordAddIn/WordAddIn/bin/Debug/WordAddIn.dll.manifest +++ b/WordAddIn/WordAddIn/bin/Debug/WordAddIn.dll.manifest @@ -166,14 +166,14 @@ - + - 57KGd7UXAGzFPWql99dRDRDZXoe2StLuM7Uyd52MAcU= + opK7SiQ9dqUcG7Gosdxa7kFJixJFR1aqCz+EqKq90Rw= @@ -200,4 +200,4 @@ -Q59Lub3/7zQPl9a5u6WlazdugvzYLbuMA2ScUeG2Kgc=e+fTQJmSYA2Ba8atHBYYQHQ3yumSSKoHkFWQhSnBCeAJ3fJdgAe1BT50EjnkKWP6bgL7txi2fDWiqXH7PomA+4D+t9Px5E2mRjSn6TocihjON9kFjatapE5bYrXX4rxZmsa7baDmtRolKjErgeei1cgkLG+00xgJkUDvKwgLaZM=23ghUI75yy8GcLhPT5yA+v2ssRfSW+chNqMI+pq5OAr7RXQJOt/+bHdoT9NoS9GQkvblc7ekoUNShIcN601ZZOPgAxkXaQS+La14Wp8GOwnM1qHNJwgla4VAIYjmCj3CUMXLsxspOFVZKRnB6/idYku4Gzhc7NjRBAwe8qWBXaE=AQABCN=DESKTOP-Q6H7B6L\AdministratorBowY9B2/AdRMLaAmKgcs3z/FtyzUeliTzB6MSGgWv2w=m1b3Quuv79UlTgmBro71Cl0hJmhy+RrFxAwWuFPtCzZmP7iI7KNCfbMMwSWufjzNYW/VF9ShKMk5nWLC1Q7iujoTWIYyUuiIDawYYrTyK4gO3QgQjE06b5DoluCNz4gENwYt2WJvNGRewiLCIEnDZhpAm/BaMJkSbYAkD22ASIY=23ghUI75yy8GcLhPT5yA+v2ssRfSW+chNqMI+pq5OAr7R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kqhkiG9w0BAQsFAAOBgQC3GjWMhEFFrn9PGYrQVGNAaibG1sR/eRX3ZWNRjYLhiqbsdeHvm4CX/W0EWd9yZlbaej87XyeUbX+mC3q3yMFVPCRn/W65WYyBPbWTWmSfU9VLKKULAH6WqjS7CqEU3cQSuKcU6nYG4AJu2/FkQJaA82tr3pvcQD28HmOlDeNh0Q== \ No newline at end of file diff --git a/WordAddIn/WordAddIn/bin/Debug/WordAddIn.pdb b/WordAddIn/WordAddIn/bin/Debug/WordAddIn.pdb index bcfbd05..3ee1a89 100644 Binary files a/WordAddIn/WordAddIn/bin/Debug/WordAddIn.pdb and b/WordAddIn/WordAddIn/bin/Debug/WordAddIn.pdb differ diff --git a/WordAddIn/WordAddIn/bin/Debug/WordAddIn.vsto b/WordAddIn/WordAddIn/bin/Debug/WordAddIn.vsto index 751f28c..42b1a68 100644 --- a/WordAddIn/WordAddIn/bin/Debug/WordAddIn.vsto +++ b/WordAddIn/WordAddIn/bin/Debug/WordAddIn.vsto @@ -7,15 +7,15 @@ - + - kQ6lvB1J+RPqWmN3TV1FKCJZwSRY6p4lkcGyY6yVSYM= + I1vKeiF4MhMscqYaDoQyOhwm/n7ejlXLDPofhX5hyfw= -nO4LOJBDcGxL8l8R9b9+yIX5TXJ4Ym9VOMcF/Sry+qw=ZXK46Htr5iGt1kgI+VOKE9t9CPf3Xfkp16PHJxaK38qkTVXu/oylz4UUYGk/Tf1JuEkuQq06zN6CYCma0rwL4Gyoo/5n09Xzg3zmriPEIS2cs8BPbXwH90FbQ0HDaPVM+dJ9A8c+KTH9h6zNm8aj/HQdBRamLUv1D2PBxk7NE1s=23ghUI75yy8GcLhPT5yA+v2ssRfSW+chNqMI+pq5OAr7RXQJOt/+bHdoT9NoS9GQkvblc7ekoUNShIcN601ZZOPgAxkXaQS+La14Wp8GOwnM1qHNJwgla4VAIYjmCj3CUMXLsxspOFVZKRnB6/idYku4Gzhc7NjRBAwe8qWBXaE=AQABCN=DESKTOP-Q6H7B6L\Administ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MAFwAQQBkAG0AaQBuAGkAcwB0AHIAYQB0AG8AcjCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEA23ghUI75yy8GcLhPT5yA+v2ssRfSW+chNqMI+pq5OAr7RXQJOt/+bHdoT9NoS9GQkvblc7ekoUNShIcN601ZZOPgAxkXaQS+La14Wp8GOwnM1qHNJwgla4VAIYjmCj3CUMXLsxspOFVZKRnB6/idYku4Gzhc7NjRBAwe8qWBXaECAwEAATANBgkqhkiG9w0BAQsFAAOBgQC3GjWMhEFFrn9PGYrQVGNAaibG1sR/eRX3ZWNRjYLhiqbsdeHvm4CX/W0EWd9yZlbaej87XyeUbX+mC3q3yMFVPCRn/W65WYyBPbWTWmSfU9VLKKULAH6WqjS7CqEU3cQSuKcU6nYG4AJu2/FkQJaA82tr3pvcQD28HmOlDeNh0Q== \ No newline at end of file diff --git a/WordAddIn/WordAddIn/obj/Debug/WordAddIn.csproj.CoreCompileInputs.cache b/WordAddIn/WordAddIn/obj/Debug/WordAddIn.csproj.CoreCompileInputs.cache index a7b08d5..b032ab2 100644 --- a/WordAddIn/WordAddIn/obj/Debug/WordAddIn.csproj.CoreCompileInputs.cache +++ b/WordAddIn/WordAddIn/obj/Debug/WordAddIn.csproj.CoreCompileInputs.cache @@ -1 +1 @@ -3849c9896302f552ebedc5a2387b042475bb844b34c63a462d94d975303dd317 +8be011f4fbaa7c6c228af0678a568daed0783ec95bd0f02e2c98071ea79ec1db diff --git a/WordAddIn/WordAddIn/obj/Debug/WordAddIn.dll b/WordAddIn/WordAddIn/obj/Debug/WordAddIn.dll index bc85c99..58b248c 100644 Binary files a/WordAddIn/WordAddIn/obj/Debug/WordAddIn.dll and b/WordAddIn/WordAddIn/obj/Debug/WordAddIn.dll differ diff --git a/WordAddIn/WordAddIn/obj/Debug/WordAddIn.pdb b/WordAddIn/WordAddIn/obj/Debug/WordAddIn.pdb index bcfbd05..3ee1a89 100644 Binary files a/WordAddIn/WordAddIn/obj/Debug/WordAddIn.pdb and b/WordAddIn/WordAddIn/obj/Debug/WordAddIn.pdb differ