Browse Source

更新菜单栏按钮

样式分支
fyf 2 years ago
parent
commit
662d64d287
2 changed files with 46 additions and 92 deletions
  1. +20
    -42
      BPASmartClient/MainWindow.xaml
  2. +26
    -50
      BPASmartClient/MainWindow.xaml.cs

+ 20
- 42
BPASmartClient/MainWindow.xaml View File

@@ -228,50 +228,28 @@
Style="{DynamicResource border左上}" />
<Grid Margin="10">
<Border Width="600" Style="{DynamicResource borderFromTitle}" />
<Button
Grid.Row="0"
HorizontalAlignment="Left"
VerticalAlignment="Top"
Click="Button_Click"
Content="测试"
Cursor="Hand" />
<Button
Grid.Row="0"
Width="100"
Margin="100,0,0,0"
HorizontalAlignment="Left"
VerticalAlignment="Top"
Click="Button_Click_1"
Content="测试消息弹窗"
Cursor="Hand" />

<!--<Button
Name="save"
Grid.Row="0"
Width="100"
Margin="230,0,0,0"
HorizontalAlignment="Left"
VerticalAlignment="Top"
Click="Button_Click_2"
Content="保存订单数据"
Cursor="Hand"
Style="{DynamicResource CommonBtn_返回}" />-->

<Button
Name="init"
<StackPanel Orientation="Horizontal" >
<CheckBox
Content="开机启动" Margin="5,0,5,0"
IsChecked="{Binding AutoStart}" />
<Button
Name="init" Margin="5,0,5,0"
Grid.Row="0"
Width="90"
Margin="230,0,0,0"
HorizontalAlignment="Left"
VerticalAlignment="Top"
Click="init_Click"
Content="初始化设备"
Cursor="Hand" />
<Button
Grid.Row="0" Margin="5,0,5,0"
HorizontalAlignment="Left"
VerticalAlignment="Top"
Click="Button_Click"
Content="测试"
Cursor="Hand" />
</StackPanel>

<CheckBox
Margin="350,0,0,0"
Content="开机启动"
IsChecked="{Binding AutoStart}" />

<TextBlock
x:Name="Title"
@@ -280,22 +258,21 @@
Foreground="#feffff">
日志监控界面
</TextBlock>
<Button
Name="login"
<StackPanel Orientation="Horizontal" HorizontalAlignment="Right">
<Button
Name="login" Margin="5,0,5,0"
Grid.Row="0"
Width="45"
Margin="0,0,60,0"
HorizontalAlignment="Right"
VerticalAlignment="Top"
Click="Button_Login"
Content="登录"
Cursor="Hand"
Style="{DynamicResource CommonBtn_返回}" />
<Button
Name="logout"
<Button
Name="logout" Margin="5,0,5,0"
Grid.Row="0"
Width="45"
Margin="350,0,0,0"
HorizontalAlignment="Right"
VerticalAlignment="Top"
Click="Button_LogOut"
@@ -303,6 +280,7 @@
Content="注销"
Cursor="Hand"
Style="{DynamicResource CommonBtn_返回}" />
</StackPanel>
</Grid>
<!--#region 底部窗体栏-->



+ 26
- 50
BPASmartClient/MainWindow.xaml.cs View File

@@ -87,8 +87,9 @@ namespace BPASmartClient


}
#endregion

/// <summary>
/// 获取设备集合
/// </summary>
private void GetDevices()
{
//List<string> IDevices = new List<string>();
@@ -149,6 +150,7 @@ namespace BPASmartClient
});

}
#endregion

#region Click
/// <summary>
@@ -200,8 +202,12 @@ namespace BPASmartClient
}
#endregion


#region 临时测试代码
/// <summary>
/// 测试按钮
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void Button_Click(object sender, RoutedEventArgs e)
{
//new Demo_MakeCoffeeEvent() { Id = 1 }.Publish();
@@ -212,56 +218,20 @@ namespace BPASmartClient
var temp = BPAPackage.Make(morkOrderPush, 12, BPA.Message.Enum.DeviceClientType.MORKS);
Plugin.GetInstance().GetPlugin<MQTTMgr>().Publish("DOWN/MORKS/ORDER/12", temp.Serialize());
}

private void Button_Click_1(object sender, RoutedEventArgs e)
{
NoticeDemoViewModel.OpenMsg(EnumPromptType.Info, this, "我是标题", "我是消息内容!我是消息内容!我是消息内容!我是消息内容!");
NoticeDemoViewModel.OpenMsg(EnumPromptType.Error, this, "我是标题", "我是消息内容!我是消息内容!我是消息内容!我是消息内容!");
NoticeDemoViewModel.OpenMsg(EnumPromptType.Warn, this, "我是标题", "我是消息内容!我是消息内容!我是消息内容!我是消息内容!");
NoticeDemoViewModel.OpenMsg(EnumPromptType.Success, this, "我是标题", "我是消息内容!我是消息内容!我是消息内容!我是消息内容!");
}

#endregion

private void Button_Click_2(object sender, RoutedEventArgs e)
{
//this.save.IsEnabled = false;
Task.Run(new Action(() =>
{
var res = Json<KeepDataBase>.Data.orderLists.FirstOrDefault(p => p.DeviceId == "2")?.morkOrderPushes;
if (res != null)
{
string info = string.Empty;
int count = 0;
foreach (var item in res)
{
info = $"SuborderId:= {item.OrderPush.SuborderId},SortNum:= {item.OrderPush.SortNum},GoodsName:= {item.OrderPush.GoodsName} \r\n {info}";
count++;
if (count >= 1000)
{
TextHelper.GetInstance.WriteTextInfo(info, $"订单信息-{DateTime.Now.ToString("HH-mm-ss")}-{count}", "Morks");
info = string.Empty;
count = 0;
}
}
if (info != string.Empty)
{
TextHelper.GetInstance.WriteTextInfo(info, $"订单信息-{DateTime.Now.ToString("HH-mm-ss")}-{count}", "Morks");
info = string.Empty;
count = 0;
}
}
//App.Current.Dispatcher.Invoke(new Action(() => { this.save.IsEnabled = true; }));
}));


}

/// <summary>
/// 初始化
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void init_Click(object sender, RoutedEventArgs e)
{
ActionManage.GetInstance.Send("InitDevice");
}

/// <summary>
/// 登录
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void Button_Login(object sender, RoutedEventArgs e)
{
try
@@ -279,10 +249,16 @@ namespace BPASmartClient
}

}

/// <summary>
/// 注销
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void Button_LogOut(object sender, RoutedEventArgs e)
{

}
#endregion

}
}

Loading…
Cancel
Save