Browse Source

权限问题更新

huangping 2 weeks ago
parent
commit
69ec79a84a

+ 1 - 1
Furnace/FurnaceUI/Views/Editors/RecipeTempModeViewModel.cs

@@ -318,7 +318,7 @@ namespace FurnaceUI.Views.Editors
 
             }
 
-            if ((bool)(windowManager as WindowManager)?.ShowDialogWithTitle(tempProfileEditViewModel, null, "TempProfileEdit"))
+            if ((bool)(windowManager as WindowManager)?.ShowDialogWithTitle(tempProfileEditViewModel,this, null, "TempProfileEdit"))
             {
                 SelectProfileTable = tempProfileEditViewModel.ResultString;
                 ResultString = $"Profile({tempProfileEditViewModel.ResultString})";

+ 1 - 1
Furnace/FurnaceUI/Views/Operations/Maintenances/ManualSetViewModel.cs

@@ -1971,7 +1971,7 @@ namespace FurnaceUI.Views.Recipes
             var file = defaultAPCPID.Substring(last + 1, defaultAPCPID.Length - last - 1);
             APCPIDEditViewModel aPCPIDEditViewModel = new APCPIDEditViewModel(pix, file);
             aPCPIDEditViewModel.IsEditEnabled = false;
-            var rtn = (windowManager as WindowManager)?.ShowDialogWithTitle(aPCPIDEditViewModel, null, "APC PID Table");
+            var rtn = (windowManager as WindowManager)?.ShowDialogWithTitle(aPCPIDEditViewModel,this, null, "APC PID Table");
             if ((bool)rtn)
             {
                 PressPID = aPCPIDEditViewModel.RetrunString;

+ 3 - 18
Furnace/FurnaceUI/Views/Parameter/APCPIDEditView.xaml

@@ -56,32 +56,17 @@
                     <ListView.ItemContainerStyle>
                         <Style TargetType="ListViewItem">
                             <Setter Property="Height" Value="50" />
+                            <Setter Property="IsSelected" Value="{Binding IsChecked}"/>
                         </Style>
                     </ListView.ItemContainerStyle>
                     <ListView.View>
                         <GridView>
-                            <GridViewColumn Width="100"
-                                            Header="No.">
+                            <GridViewColumn Width="100" Header="No.">
                                 <GridViewColumn.CellTemplate>
                                     <DataTemplate>
                                         <UniformGrid  Columns="2">
-                                            <i:Interaction.Triggers>
-                                                <i:EventTrigger EventName="MouseLeftButtonDown">
-                                                    <cal:ActionMessage MethodName="SelectTableStep">
-                                                        <cal:Parameter Value="{Binding}"/>
-                                                    </cal:ActionMessage>
-                                                </i:EventTrigger>
-                                            </i:Interaction.Triggers>
                                             <Label Width="80"  Content="{Binding StepNo}" />
-                                            <RadioButton IsChecked="{Binding IsChecked}" VerticalAlignment="Center" GroupName="APCPID">
-                                                <i:Interaction.Triggers>
-                                                    <i:EventTrigger EventName="Checked">
-                                                        <cal:ActionMessage MethodName="RdoCmdSelectTableChecked">
-                                                            <cal:Parameter Value="{Binding}"/>
-                                                        </cal:ActionMessage>
-                                                    </i:EventTrigger>
-                                                </i:Interaction.Triggers>
-                                            </RadioButton>
+                                            <RadioButton IsChecked="{Binding IsChecked}" VerticalAlignment="Center" GroupName="APCPID"/>
                                         </UniformGrid>
                                     </DataTemplate>
                                 </GridViewColumn.CellTemplate>

+ 2 - 18
Furnace/FurnaceUI/Views/Parameter/APCPIDEditViewModel.cs

@@ -38,7 +38,7 @@ namespace FurnaceUI.Views.Parameter
 
         public bool IsEditEnabled
         {
-            get => _isEditEnabled;
+            get => _isEditEnabled&&(this.Permission==3);
             set
             {
                 _isEditEnabled = value;
@@ -162,7 +162,7 @@ namespace FurnaceUI.Views.Parameter
 
         public bool DownloadEnable
         {
-            get => _DownloadEnable;
+            get => _DownloadEnable&&(this.Permission==3);
             set
             {
                 _DownloadEnable = value;
@@ -595,22 +595,6 @@ namespace FurnaceUI.Views.Parameter
             }
         }
 
-
-        public void RdoCmdSelectTableChecked(object step)
-        {
-
-        }
-
-        public void SelectTableStep(object step)
-        {
-            var ssss = step;
-            if (step != null && step is ParameterTable)
-            {
-                var tempStep = (ParameterTable)step;
-                tempStep.IsChecked = !tempStep.IsChecked;
-            }
-        }
-
         public void SetValue(object sender, string isFullKeyboard = "")
         {
             string value = ((TextBox)sender).Text;

+ 2 - 2
Furnace/FurnaceUI/Views/Parameter/AlarmConditionEditViewModel.cs

@@ -199,14 +199,14 @@ namespace FurnaceUI.Views.Parameter
                 NotifyOfPropertyChange("EventSetting");
             }
         }
-        public bool IsEnable => CGlobal.ParameterEditViewEnable;//是否是View模式
+        public bool IsEnable =>(this.Permission==3)&&CGlobal.ParameterEditViewEnable;//是否是View模式
 
         private bool _isEnableEdit = true;
 
 
         public bool IsEnableEdit
         {
-            get => _isEnableEdit;
+            get =>(this.Permission == 3)&&_isEnableEdit;
             set
             {
                 _isEnableEdit = value;

+ 1 - 1
Furnace/FurnaceUI/Views/Parameter/EditViewModel.cs

@@ -724,7 +724,7 @@ namespace FurnaceUI.Views.Parameter
             //dialog.FileName = (string)QueryDataClient.Instance.Service.GetConfig($"System.Recipe.DefaultProcessRecipeName");
             WindowManager wm = new WindowManager();
             bool? dialogReturn = wm.ShowDialog(dialog);
-            if (!dialogReturn.HasValue || !dialogReturn.Value)
+            if (!dialogReturn.HasValue || !dialogReturn.Value||string.IsNullOrWhiteSpace(dialog.FileName))
                 return;
 
             string recipeName = dialog.FileName.Trim();

+ 3 - 4
Furnace/FurnaceUI/Views/Parameter/TempProfileEditView.xaml

@@ -32,7 +32,7 @@
             <Button Style="{StaticResource MainArea_Button}" Height="563" Width="270" Canvas.Left="130" Canvas.Top="100"  VerticalContentAlignment="Stretch" HorizontalContentAlignment="Stretch">
                 <ContentControl>
                     <Canvas Margin="-10,20,10,0">
-                        <RadioButton Canvas.Left="32" IsChecked="{Binding ProfileTable1.IsChecked}" Canvas.Top="4" Content="Table 1" GroupName="Table"/>
+                        <RadioButton Canvas.Left="32" Height="50" Width="240" IsChecked="{Binding ProfileTable1.IsChecked}" Canvas.Top="4" Content="Table 1" GroupName="Table"/>
 
                         <Grid  Canvas.Top="4">
                             <Grid.RowDefinitions>
@@ -169,8 +169,7 @@
             <Button Style="{StaticResource MainArea_Button}" Height="563" Width="270" Canvas.Left="500" Canvas.Top="100"  VerticalContentAlignment="Stretch" HorizontalContentAlignment="Stretch">
                 <ContentControl>
                     <Canvas Margin="-10,20,10,0">
-                        <RadioButton Canvas.Left="32" Canvas.Top="4" IsChecked="{Binding ProfileTable2.IsChecked}" Content="Table 2" GroupName="Table"/>
-
+                        <RadioButton Canvas.Left="32" Canvas.Top="4" Width="240" Height="50"  IsChecked="{Binding ProfileTable2.IsChecked}" Content="Table 2" GroupName="Table"/>
                         <Grid  Canvas.Top="4">
                             <Grid.RowDefinitions>
                                 <RowDefinition Height="40"/>
@@ -306,7 +305,7 @@
             <Button Style="{StaticResource MainArea_Button}" Height="563" Width="270" Canvas.Left="870" Canvas.Top="100"  VerticalContentAlignment="Stretch" HorizontalContentAlignment="Stretch">
                 <ContentControl>
                     <Canvas Margin="-10,20,10,0">
-                        <RadioButton Canvas.Left="32" Canvas.Top="4" IsChecked="{Binding ProfileTable3.IsChecked}" Content="Table 3" GroupName="Table"/>
+                        <RadioButton Canvas.Left="32" Canvas.Top="4" Width="240" Height="50"  IsChecked="{Binding ProfileTable3.IsChecked}" Content="Table 3" GroupName="Table"/>
 
                         <Grid  Canvas.Top="4">
                             <Grid.RowDefinitions>

+ 1 - 1
Furnace/FurnaceUI/Views/Parameter/TempProfileEditViewModel.cs

@@ -195,7 +195,7 @@ namespace FurnaceUI.Views.Parameter
                 NotifyOfPropertyChange("EventSetting");
             }
         }
-        public bool IsEnable => CGlobal.ParameterEditViewEnable;//是否是View模式
+        public bool IsEnable =>(this.Permission == 3)&& CGlobal.ParameterEditViewEnable;//是否是View模式
 
         private bool _isEidtEnable = true;
 

+ 3 - 3
Furnace/FurnaceUI/Views/Recipes/RecipeProcessEditViewModel.cs

@@ -1872,7 +1872,7 @@ namespace FurnaceUI.Views.Recipes
                     recipeTempModeViewModel.CurrentRecipe = CurrentRecipe;
                     recipeTempModeViewModel.SelectProfileTable = SelectedRecipeStep.TemperatureControlMode.Value;
                     recipeTempModeViewModel.SelectBtnName = SelectBtnName;
-                    var rtn = (windowManager as WindowManager)?.ShowDialogWithTitle(recipeTempModeViewModel, null, "Temp Mode");
+                    var rtn = (windowManager as WindowManager)?.ShowDialogWithTitle(recipeTempModeViewModel,this,null, "Temp Mode");
                     if ((bool)rtn)
                     {
 
@@ -2075,7 +2075,7 @@ namespace FurnaceUI.Views.Recipes
                     AlarmConditionEditViewModel alarmConditionViewModel = new AlarmConditionEditViewModel($"Parameter\\AlarmCondition", combination.AlarmCondition, SelectedRecipeStep.AlarmConditionTable.Value);
                     alarmConditionViewModel.IsEnableEdit = false;
                     alarmConditionViewModel.RecipeType = CurrentRecipe.RecipeChamberType;
-                    if ((bool)(windowManager as WindowManager)?.ShowDialogWithTitle(alarmConditionViewModel, null, "Alarm Action"))
+                    if ((bool)(windowManager as WindowManager)?.ShowDialogWithTitle(alarmConditionViewModel,this, null, "Alarm Action"))
                     {
                         CurrentRecipe.Steps.Where(x => x.StepNo == SelectedRecipeStep.StepNo).FirstOrDefault().AlarmConditionTable.SetValue(alarmConditionViewModel.ReturnString);
                     }
@@ -2687,7 +2687,7 @@ namespace FurnaceUI.Views.Recipes
             APCPIDEditViewModel aPCPIDEditViewModel = new APCPIDEditViewModel();
             aPCPIDEditViewModel.IsEditEnabled = false;
             aPCPIDEditViewModel.CurrentRecipe = CurrentRecipe;
-            var rtn = (windowManager as WindowManager)?.ShowDialogWithTitle(aPCPIDEditViewModel, null, "APC PID Table");
+            var rtn = (windowManager as WindowManager)?.ShowDialogWithTitle(aPCPIDEditViewModel,this, null, "APC PID Table");
             if ((bool)rtn && SelectedRecipeStep != null)
                 SelectedRecipeStep.PressPID.SetValue(aPCPIDEditViewModel.RetrunString);
         }