Browse Source

优化

master
胡超1 1 year ago
parent
commit
4539bca56b
  1. 2
      AksWebBrowser.sln
  2. 6
      CPF_Cef/AksVideoPlayer.cs
  3. 2
      CPF_Cef/AksWebBrowser.csproj
  4. 3
      CPF_Cef/Common/COMUtils.cs
  5. 9
      CPF_Cef/Common/ChunkedUpload.cs
  6. 2
      CPF_Cef/Common/TcpClients.cs
  7. 3
      CPF_Cef/Common/Utils.cs
  8. 2
      CPF_Cef/CusWebBrowser.cs
  9. 10
      CPF_Cef/FrmMain.cs
  10. 3
      CPF_Cef/MainModel.cs
  11. 4
      CPF_Cef/Parame.cs
  12. 2
      CPF_Cef/Program.cs
  13. 122
      CPF_Cef/StyleSheet.css
  14. BIN
      CPF_Cef/msyh.ttc

2
AksWebBrowser.sln

@ -3,7 +3,7 @@ Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17 # Visual Studio Version 17
VisualStudioVersion = 17.9.34622.214 VisualStudioVersion = 17.9.34622.214
MinimumVisualStudioVersion = 10.0.40219.1 MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AKS.EnterpriseLibrary.WebBrowser", "CPF_Cef\AKS.EnterpriseLibrary.WebBrowser.csproj", "{76142658-6E83-4A1C-8CC9-C2574865CA7D}" Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AksWebBrowser", "CPF_Cef\AksWebBrowser.csproj", "{76142658-6E83-4A1C-8CC9-C2574865CA7D}"
EndProject EndProject
Global Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution GlobalSection(SolutionConfigurationPlatforms) = preSolution

6
CPF_Cef/AksVideoPlayer.cs

@ -12,7 +12,7 @@ using CPF.Svg;
using CPF.Input; using CPF.Input;
using static System.Net.Mime.MediaTypeNames; using static System.Net.Mime.MediaTypeNames;
namespace AKS.EnterpriseLibrary.WebBrowser namespace AksWebBrowser
{ {
public class AksVideoPlayer : Control public class AksVideoPlayer : Control
{ {
@ -63,6 +63,8 @@ namespace AKS.EnterpriseLibrary.WebBrowser
{ {
MarginRight = 12f, MarginRight = 12f,
MarginTop = 10f, MarginTop = 10f,
Classes = "imgAndText",
FontFamily = "微软雅黑",//Alibaba PuHuiTi
Text = "关闭", Text = "关闭",
FontSize = 16, FontSize = 16,
Cursor = CPF.Cursors.Hand, Cursor = CPF.Cursors.Hand,
@ -91,8 +93,10 @@ namespace AKS.EnterpriseLibrary.WebBrowser
FontSize = 16f, FontSize = 16f,
MarginLeft = 12.6f, MarginLeft = 12.6f,
MarginTop = 9.6f, MarginTop = 9.6f,
Classes = "imgAndText",
Foreground = Color.White, Foreground = Color.White,
Text = videoTitle, Text = videoTitle,
FontFamily = "微软雅黑",
}); });
Children.Add(vplayer); Children.Add(vplayer);

2
CPF_Cef/AKS.EnterpriseLibrary.WebBrowser.csproj → CPF_Cef/AksWebBrowser.csproj

@ -27,6 +27,7 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<None Remove="msyh.ttc" />
<None Remove="StyleSheet.css" /> <None Remove="StyleSheet.css" />
</ItemGroup> </ItemGroup>
@ -35,6 +36,7 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<EmbeddedResource Include="msyh.ttc" />
<EmbeddedResource Include="StyleSheet.css" /> <EmbeddedResource Include="StyleSheet.css" />
</ItemGroup> </ItemGroup>

3
CPF_Cef/Common/COMUtils.cs

@ -1,5 +1,4 @@
using AKS.EnterpriseLibrary.WebBrowser; using AksWebBrowser;
using AksWebBrowser;
using AKSWebBrowser.Commen; using AKSWebBrowser.Commen;
using Newtonsoft.Json; using Newtonsoft.Json;
using Newtonsoft.Json.Linq; using Newtonsoft.Json.Linq;

9
CPF_Cef/Common/ChunkedUpload.cs

@ -1,4 +1,4 @@
using AKS.EnterpriseLibrary.WebBrowser; using AksWebBrowser;
using AksWebBrowser.Devices; using AksWebBrowser.Devices;
using AKSWebBrowser.Commen; using AKSWebBrowser.Commen;
using Newtonsoft.Json; using Newtonsoft.Json;
@ -528,6 +528,8 @@ namespace AksWebBrowser.Common
{ {
try try
{ {
//关闭身份证
await PublicIdcard(type, typeCode, timeout);
timeout = timeout == 0 ? Parame.timeout : timeout; timeout = timeout == 0 ? Parame.timeout : timeout;
var client = new HttpClient(); var client = new HttpClient();
client.Timeout = TimeSpan.FromSeconds(timeout); client.Timeout = TimeSpan.FromSeconds(timeout);
@ -545,7 +547,6 @@ namespace AksWebBrowser.Common
JObject jo2 = (JObject)JsonConvert.DeserializeObject(ret); JObject jo2 = (JObject)JsonConvert.DeserializeObject(ret);
if (jo2["code"].ToString() == "0") if (jo2["code"].ToString() == "0")
{ {
//读取指纹
if (typeCode == 1) if (typeCode == 1)
{ {
//读取data数据 //读取data数据
@ -589,7 +590,7 @@ namespace AksWebBrowser.Common
return ""; return "";
} }
} }
catch (Exception ex) catch (Exception ex)
{ {
if (ex.Message.Contains("HttpClient.Timeout")) if (ex.Message.Contains("HttpClient.Timeout"))
{ {
@ -603,7 +604,7 @@ namespace AksWebBrowser.Common
} }
/// <summary> /// <summary>
/// 公共读取指纹 /// 公共读取身份证
/// </summary> /// </summary>
/// <param name="type"></param> /// <param name="type"></param>
/// <param name="typeCode"></param> /// <param name="typeCode"></param>

2
CPF_Cef/Common/TcpClients.cs

@ -10,7 +10,7 @@ using System.Net;
using System.Net.Http; using System.Net.Http;
using System.IO.Ports; using System.IO.Ports;
using System.Timers; using System.Timers;
using AKS.EnterpriseLibrary.WebBrowser; using AksWebBrowser;
namespace AksWebBrowser.Common namespace AksWebBrowser.Common
{ {

3
CPF_Cef/Common/Utils.cs

@ -1,5 +1,4 @@
using AKS.EnterpriseLibrary.WebBrowser; using AKSWebBrowser.Commen;
using AKSWebBrowser.Commen;
using CPF.Controls; using CPF.Controls;
using System; using System;
using System.Drawing; using System.Drawing;

2
CPF_Cef/CusWebBrowser.cs

@ -10,7 +10,7 @@ using System.Runtime.ConstrainedExecution;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
namespace AKS.EnterpriseLibrary.WebBrowser namespace AksWebBrowser
{ {
public class CusWebBrowser : CPF.Cef.WebBrowser public class CusWebBrowser : CPF.Cef.WebBrowser

10
CPF_Cef/FrmMain.cs

@ -16,7 +16,7 @@ using System.Threading;
using System.Threading.Tasks; using System.Threading.Tasks;
using System.Timers; using System.Timers;
namespace AKS.EnterpriseLibrary.WebBrowser namespace AksWebBrowser
{ {
public class FrmMain : Window public class FrmMain : Window
{ {
@ -75,6 +75,7 @@ namespace AKS.EnterpriseLibrary.WebBrowser
protected override async void OnInitialized() protected override async void OnInitialized()
{ {
LoadStyleFile("res://AksWebBrowser/StyleSheet.css");
//窗体大小 //窗体大小
this.Width = w; this.Width = w;
this.Height = h; this.Height = h;
@ -113,6 +114,8 @@ namespace AKS.EnterpriseLibrary.WebBrowser
showDev = true; showDev = true;
Parame.webBrowser.ShowDev(); Parame.webBrowser.ShowDev();
} }
//获取授权
GetSQObject();
//获取设备 //获取设备
MainModel.GetSnIndex(); MainModel.GetSnIndex();
//打开高拍仪 //打开高拍仪
@ -135,11 +138,6 @@ namespace AKS.EnterpriseLibrary.WebBrowser
{ {
try try
{ {
if (!Parame.isCloseHttp)
{
//获取授权
GetSQObject();
}
//检测服务是否启动 //检测服务是否启动
MainModel.StartShll(); MainModel.StartShll();
} }

3
CPF_Cef/MainModel.cs

@ -30,7 +30,7 @@ using System.Web;
using System.Xml.Linq; using System.Xml.Linq;
using static System.Net.Mime.MediaTypeNames; using static System.Net.Mime.MediaTypeNames;
namespace AKS.EnterpriseLibrary.WebBrowser namespace AksWebBrowser
{ {
public class MainModel : CPF.CpfObject public class MainModel : CPF.CpfObject
{ {
@ -1203,7 +1203,6 @@ namespace AKS.EnterpriseLibrary.WebBrowser
} }
} }
/// <summary> /// <summary>
/// aks100117 读取问答 (已国产化) /// aks100117 读取问答 (已国产化)
/// </summary> /// </summary>

4
CPF_Cef/Parame.cs

@ -1,4 +1,4 @@
using AKS.EnterpriseLibrary.WebBrowser; using AksWebBrowser;
using CPF.Controls; using CPF.Controls;
using Fleck; using Fleck;
using System; using System;
@ -19,7 +19,7 @@ namespace AksWebBrowser
public static Window frm { get; set; } public static Window frm { get; set; }
public static List<Func> FuncObject { get; set; } public static List<Func> FuncObject { get; set; }
//接口地址 //接口地址
public static string apiUrl = "http://127.0.0.1:8098";//"http://192.168.0.34:92"; public static string apiUrl ="http://127.0.0.1:8098"; // "http://192.168.0.34:92";
//授权key //授权key
public static string key = "1"; public static string key = "1";
//硬件Ip //硬件Ip

2
CPF_Cef/Program.cs

@ -10,7 +10,7 @@ using System.Threading.Tasks;
using System.Threading; using System.Threading;
using System.IO; using System.IO;
namespace AKS.EnterpriseLibrary.WebBrowser namespace AksWebBrowser
{ {
class Program class Program
{ {

122
CPF_Cef/StyleSheet.css

@ -2,6 +2,7 @@
@media windows { @media windows {
* { * {
FontFamily: '微软雅黑'; /*不同系统的字体不同,自己根据情况改或者使用内嵌字体*/ FontFamily: '微软雅黑'; /*不同系统的字体不同,自己根据情况改或者使用内嵌字体*/
src: url('res://AksWebBrowser/msyh.ttc');
} }
} }
@ -13,7 +14,8 @@
@media linux { @media linux {
* { * {
FontFamily: '文泉驿正黑'; FontFamily: '微软雅黑';
src: url('res://AksWebBrowser/msyh.ttc');
} }
} }
/*设置窗体标题栏背景颜色圆角*/ /*设置窗体标题栏背景颜色圆角*/
@ -21,98 +23,37 @@
IsAntiAlias: true; IsAntiAlias: true;
Background: #2c2c2c; Background: #2c2c2c;
CornerRadius:5,5,0,0; CornerRadius:5,5,0,0;
Height:30;
} }
#frame { #frame {
CornerRadius: 5; CornerRadius: 5;
IsAntiAlias: true; IsAntiAlias: true;
}*/ }*/
Button { #caption {
BorderFill: #DCDFE6; IsAntiAlias: true;
IsAntiAlias: True; Background: #2c2c2c;
CornerRadius: 4,4,4,4; CornerRadius: 5,5,0,0;
Background: #FFFFFF; Height: 50;
} }
Button[IsMouseOver=true] { .AMenuPageStyle {
BorderFill: rgb(198,226,255); Background: #2c2c2c01;
Background: rgb(236,245,255); }
Foreground: rgb(64,158,255);
}
Button[IsPressed=true] {
BorderFill: rgb(58,142,230);
}
Button.primary {
BorderFill: rgb(64,158,255);
CornerRadius: 4,4,4,4;
Background: rgb(64,158,255);
Foreground: #FFFFFF;
}
Button.primary[IsMouseOver=true] {
BorderFill: rgb(102,177,255);
Background: rgb(102,177,255);
Foreground: #FFFFFF;
}
Button.primary[IsPressed=true] {
BorderFill: rgb(58,142,230);
Background: rgb(58,142,230);
}
Button.success {
BorderFill: rgb(103,194,58);
CornerRadius: 4,4,4,4;
Background: rgb(103,194,58);
Foreground: #FFFFFF;
}
Button.success[IsMouseOver=true] {
BorderFill: rgb(133,206,97);
Background: rgb(133,206,97);
Foreground: #FFFFFF;
}
Button.success[IsPressed=true] {
BorderFill: rgb(93,175,52);
Background: rgb(93,175,52);
}
Button.danger { .AMenuPageStyle[IsMouseOver=true] {
BorderFill: rgb(245,108,108); Background: #00000015;
Background: rgb(245,108,108);
CornerRadius: 4,4,4,4;
Foreground: #FFFFFF;
} }
Button.danger[IsMouseOver=true] { #frame {
BorderFill: rgb(247,137,137); CornerRadius: 5;
Background: rgb(247,137,137);
Foreground: #FFFFFF;
}
Button.danger[IsPressed=true] {
BorderFill: rgb(221,97,97);
Background: rgb(221,97,97);
}
TextBox, .textBox, DatePicker {
Background: #fff;
IsAntiAlias: true; IsAntiAlias: true;
BorderFill: #DCDFE6;
CornerRadius: 4,4,4,4;
BorderStroke: 1;
} }
.groupPanel TextBox, DatePicker TextBox, .textBox TextBox { #caption {
BorderStroke: 0; Background: rgb(36,48,70);
} Height: 40;
Font-Size: 18px;
.textBox[IsKeyboardFocusWithin=true] { }
BorderFill: #1E9FFF;
}
.singleLine { /*单行文本框*/ .singleLine { /*单行文本框*/
AcceptsReturn: false; AcceptsReturn: false;
@ -250,7 +191,6 @@ ComboBox {
MarginLeft: 5; MarginLeft: 5;
MarginTop: 2; MarginTop: 2;
MarginBottom: 2; MarginBottom: 2;
font-size: 14;
} }
#dropDownBorder { #dropDownBorder {
@ -470,4 +410,22 @@ TabControl[TabStripPlacement=Left] #headerPanel, TabControl[TabStripPlacement=Ri
ListBoxItem { ListBoxItem {
Width: 100%; Width: 100%;
} }
#dialogClose, #dialogClose[IsMouseOver=true] {
Background: null;
BorderFill: null;
}
#dialogClose[IsPressed=true] {
Background: null;
BorderFill: null;
}
#dialogClose Line {
StrokeFill: 218,218,218;
}
#dialogClose[IsMouseOver=true] Line {
StrokeFill: #fff;
}

BIN
CPF_Cef/msyh.ttc

Binary file not shown.
Loading…
Cancel
Save