From f489e359066e1036f13491ef128a355bc730afcb Mon Sep 17 00:00:00 2001
From: lu <99954486@qq.com>
Date: 星期二, 24 六月 2025 13:36:18 +0800
Subject: [PATCH] bug
---
DevApp/Gs.DevApp/UserControl/ShowUp.cs | 89 ++++++++++++++++++++++++++++++++++++++++----
1 files changed, 81 insertions(+), 8 deletions(-)
diff --git a/DevApp/Gs.DevApp/UserControl/ShowUp.cs b/DevApp/Gs.DevApp/UserControl/ShowUp.cs
index af70a96..2821932 100644
--- a/DevApp/Gs.DevApp/UserControl/ShowUp.cs
+++ b/DevApp/Gs.DevApp/UserControl/ShowUp.cs
@@ -1,13 +1,12 @@
-锘縰sing DevExpress.XtraEditors;
+锘縰sing CefSharp;
+using DevExpress.XtraEditors;
using Gs.DevApp.ToolBox;
using System;
using System.Collections.Generic;
-using System.ComponentModel;
+using System.Configuration;
using System.Data;
-using System.Drawing;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
+using System.Net;
+using System.Windows.Documents;
using System.Windows.Forms;
namespace Gs.DevApp.UserControl
@@ -21,12 +20,21 @@
public event EventHandler<UpdateParentEventArgs> UpdateParent;
string parentGuid = "";
- public ShowUp(string _parentGuid)
+
+
+ /// <summary>
+ ///
+ /// </summary>
+ /// <param name="_parentGuid">鐖朵翰guid</param>
+ /// <param name="isXls">濡傛灉鏄痻ls锛屾樉绀虹浉搴旂殑璇存槑</param>
+ public ShowUp(string _parentGuid, bool isXls = false)
{
InitializeComponent();
this.parentGuid = _parentGuid;
this.ucUpFile1.parentGuid = _parentGuid;
ucUpFile1.UpChanged += UcUpFile1_UpChanged;
+
+ getBtn();
}
/// <summary>
@@ -37,8 +45,73 @@
private void UcUpFile1_UpChanged(object sender, EventArgs e)
{
UpdateParent?.Invoke(this,
- new UpdateParentEventArgs { FilterList = null});
+ new UpdateParentEventArgs { FilterList = null });
Close();
}
+
+ private void getBtn()
+ {
+ List<dynamic> lst = new List<dynamic>();
+ lst.Add(new
+ {
+ btnTxt = "妫�楠屽伐鍏穃nXLS妯℃澘",
+ xls = "001妫�楠屽伐鍏�.xls"
+ });
+ lst.Add(new
+ {
+ btnTxt = "妫�楠岄」鐩甛nXLS妯℃澘",
+ xls = "002妫�楠岄」鐩�.xls"//001
+ });
+
+ lst.Add(new
+ {
+ btnTxt = "鐗╂枡妫�楠岄」鐩甛nXLS妯℃澘",
+ xls = "003鐗╂枡妫�楠岄」鐩�.xls"
+ });
+
+ lst.Add(new
+ {
+ btnTxt = "宸ュ崟鍚庣洊鐮乗nXLS妯℃澘",
+ xls = "004宸ュ崟鍚庣洊鐮�.xls"
+ });
+
+ foreach (var obj in lst)
+ {
+ SimpleButton btn = new DevExpress.XtraEditors.SimpleButton();
+ btn.ImageOptions.Image = global::Gs.DevApp.Properties.Resources.printarea_32x32;
+ btn.ImageOptions.ImageToTextAlignment = DevExpress.XtraEditors.ImageAlignToText.TopCenter;
+ btn.Name = Guid.NewGuid().ToString();
+ btn.Size = new System.Drawing.Size(120, 120);
+ btn.TabIndex = 1;
+ btn.Text = obj.btnTxt;
+ btn.Margin = new System.Windows.Forms.Padding(10);
+ btn.Tag = obj.xls;
+ this.flowLayoutPanel1.Controls.Add(btn);
+ btn.Click += Btn_Click;
+ }
+ }
+
+ private void Btn_Click(object sender, EventArgs e)
+ {
+ string _guid = Guid.NewGuid().ToString();
+ SimpleButton btn = (SimpleButton)sender;
+ string urlPath = btn.Tag.ToString();//a697b909-5baa-4e74-8df4-87abb1f96240ico.png
+ using (FolderBrowserDialog folderBrowserDialog = new FolderBrowserDialog())
+ {
+ folderBrowserDialog.Description = "閫夋嫨瀵煎嚭鏂囦欢鐨勪繚瀛樿矾寰�";
+ DialogResult dialogResult = folderBrowserDialog.ShowDialog();
+ if (dialogResult == DialogResult.OK)
+ {
+ string _folder = folderBrowserDialog.SelectedPath;
+ string _folderName = _folder + "\\" + urlPath;
+ string _url = ConfigurationManager.AppSettings["WebApiUrl"].ToString() + "upload/" + urlPath;
+ using (WebClient client = new WebClient())
+ {
+ client.DownloadFile(_url, _folderName);
+ }
+ ToolBox.MsgHelper.ShowInformation("涓嬭浇鎴愬姛锛�");
+ }
+ }
+ }
}
}
\ No newline at end of file
--
Gitblit v1.9.3