소스 검색

zhao:

tags/录制修改前
耀 4 년 전
부모
커밋
825160e919

+ 70
- 43
XHWK.WKTool/FileDirectoryWindow.xaml 파일 보기

@@ -33,21 +33,35 @@
33 33
             <UniformGrid
34 34
                 Height="36"
35 35
                 Margin="0,0,0,0"
36
-                
37
-                Columns="9"
36
+                Background="{Binding Colour}"
37
+                Columns="6"
38 38
                 Rows="1">
39 39
                 <!--题号-->
40
-                <TextBlock
40
+                <TextBlock 
41 41
                     HorizontalAlignment="Center"
42 42
                     VerticalAlignment="Center"
43 43
                     FontSize="15"
44 44
                     Text="{Binding SerialNumber}" />
45
-                <!--题型-->
46
-                <TextBlock
45
+                <Grid>
46
+                    <StackPanel Orientation="Horizontal"   HorizontalAlignment="Center"
47
+                    VerticalAlignment="Center">
48
+                        <TextBox IsEnabled="{Binding IsEnabled}"
47 49
                     HorizontalAlignment="Center"
48 50
                     VerticalAlignment="Center"
49 51
                     FontSize="15"
50 52
                     Text="{Binding VideoName}" />
53
+                        <Button x:Name="btnModify" Background="Transparent"
54
+                                Cursor="Hand"
55
+                        BorderThickness="0" Click="BtnModify_Click">
56
+                            <Grid>
57
+                                <Image Source="./Images/fileDirectory3.png" Margin="6,6,6,6" Visibility="{Binding vis}"/>
58
+                                <Image Source="./Images/fileDirectory4.png" Margin="6,6,6,6" Visibility="{Binding cos}"/>
59
+                            </Grid>
60
+                        </Button>
61
+                    </StackPanel>
62
+                </Grid>
63
+          
64
+           
51 65
                 <!--分值-->
52 66
                 <TextBlock
53 67
                     HorizontalAlignment="Center"
@@ -67,15 +81,38 @@
67 81
                     VerticalAlignment="Center"
68 82
                     FontSize="15"
69 83
                     Text="{Binding VideoTime}" />
70
-                <Grid>
71 84
 
72
-                    <Button Cursor="Hand" Content="详情" FontSize="15"
73
-                        Background="Transparent"
74
-                            Foreground="#2D8CF0"
75
-                        BorderThickness="0"
76
-                     >
77
-                    </Button>
85
+                <Grid>
86
+                    <StackPanel Orientation="Horizontal"   HorizontalAlignment="Center"
87
+                    VerticalAlignment="Center">
88
+                        <Button x:Name="btnPlay" Background="Transparent" 
89
+                                Cursor="Hand"
90
+                        BorderThickness="0" Click="BtnPlay_Click">
91
+                            <Grid>
92
+                                <Image Source="./Images/fileDirectory1.png" Margin="6,6,6,6" Visibility="{Binding vis}"/>
93
+                                <Image Source="./Images/fileDirectory2.png" Margin="6,6,6,6" Visibility="{Binding cos}"/>
94
+                            </Grid>
95
+                        </Button>
96
+                        <Button x:Name="btnUpload" Background="Transparent"
97
+                                Cursor="Hand"
98
+                        BorderThickness="0" Click="BtnUpload_Click">
99
+                            <Grid>
100
+                                <Image Source="./Images/fileDirectory7.png" Margin="6,6,6,6" Visibility="{Binding vis}"/>
101
+                                <Image Source="./Images/fileDirectory8.png" Margin="6,6,6,6" Visibility="{Binding cos}"/>
102
+                            </Grid>
103
+                        </Button>
104
+                        <Button x:Name="btnDelete" Background="Transparent"
105
+                                Cursor="Hand"
106
+                        BorderThickness="0" Click="BtnDelete_Click">
107
+                            <Grid>
108
+                                <Image Source="./Images/fileDirectory5.png" Margin="6,6,6,6" Visibility="{Binding vis}"/>
109
+                                <Image Source="./Images/fileDirectory6.png" Margin="6,6,6,6" Visibility="{Binding cos}"/>
110
+                            </Grid>
111
+                        </Button>
112
+                    </StackPanel>
78 113
                 </Grid>
114
+                
115
+           
79 116
             </UniformGrid>
80 117
         </DataTemplate>
81 118
     </Window.Resources>
@@ -146,38 +183,28 @@
146 183
                     ItemsSource="{Binding menuList}" />
147 184
             </Grid>
148 185
             <!--第三行 删除 上传 按钮-->
149
-            <StackPanel Grid.Row="3" Orientation="Horizontal" HorizontalAlignment="Center">
150
-                <Button  Cursor="Hand" x:Name="btnDelete" Content="删除" FontSize="18" Foreground="#FFFFFF" Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}" Width="115" Height="45" Margin="0,0,30,0">
151
-                    <Button.Template>
152
-                        <ControlTemplate TargetType="{x:Type Button}">
153
-                            <Border
154
-                                BorderBrush="{TemplateBinding Control.BorderBrush}"
155
-                                BorderThickness="1"
156
-                                CornerRadius="2">
157
-                                <Border.Background>#F0582B</Border.Background>
158
-                                <ContentPresenter
159
-                                    HorizontalAlignment="Center"
160
-                                    VerticalAlignment="Center"
161
-                                    Content="{TemplateBinding ContentControl.Content}" />
162
-                            </Border>
163
-                        </ControlTemplate>
164
-                    </Button.Template>
186
+            <StackPanel Grid.Row="3" Orientation="Horizontal" HorizontalAlignment="Center" Height="32">
187
+                <TextBlock Text="共" FontSize="20" Padding="0,5,0,0"/>
188
+                <TextBlock x:Name="txbSum" Text="0" FontSize="20" Padding="0,5,0,0"/>
189
+                <TextBlock Text="条" FontSize="20" Padding="0,5,0,0"/>
190
+                <Button Background="Transparent"
191
+                                Cursor="Hand"
192
+                        BorderThickness="0">
193
+                    <Image Source="./Images/class_p1.png"/>
165 194
                 </Button>
166
-                <Button  Cursor="Hand" x:Name="btnUpload" Content="上传" FontSize="18" Foreground="#FFFFFF" Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}" Width="115" Height="45" Margin="30,0,0,0">
167
-                    <Button.Template>
168
-                        <ControlTemplate TargetType="{x:Type Button}">
169
-                            <Border
170
-                                BorderBrush="{TemplateBinding Control.BorderBrush}"
171
-                                BorderThickness="1"
172
-                                CornerRadius="2">
173
-                                <Border.Background>#2D8CF0</Border.Background>
174
-                                <ContentPresenter
175
-                                    HorizontalAlignment="Center"
176
-                                    VerticalAlignment="Center"
177
-                                    Content="{TemplateBinding ContentControl.Content}" />
178
-                            </Border>
179
-                        </ControlTemplate>
180
-                    </Button.Template>
195
+                <Button Background="Transparent"
196
+                                Cursor="Hand"
197
+                        BorderThickness="0" Content="1" FontSize="20" Width="30"/>
198
+                <Button Background="Transparent"
199
+                                Cursor="Hand"
200
+                        BorderThickness="0" Content="2" FontSize="20" Width="30"/>
201
+                <Button Background="Transparent"
202
+                                Cursor="Hand"
203
+                        BorderThickness="0" Content="3" FontSize="20" Width="30"/>
204
+                <Button Background="Transparent"
205
+                                Cursor="Hand"
206
+                        BorderThickness="0">
207
+                    <Image Source="./Images/class_p2.png"/>
181 208
                 </Button>
182 209
             </StackPanel>
183 210
             

+ 197
- 5
XHWK.WKTool/FileDirectoryWindow.xaml.cs 파일 보기

@@ -1,8 +1,13 @@
1
-using Org.BouncyCastle.Asn1.Crmf;
1
+using Common.system;
2
+using Org.BouncyCastle.Asn1.Crmf;
3
+using System;
2 4
 using System.Collections.Generic;
3 5
 using System.Collections.ObjectModel;
6
+using System.Diagnostics;
4 7
 using System.Windows;
8
+using System.Windows.Controls;
5 9
 using System.Windows.Input;
10
+using System.Windows.Media;
6 11
 using XHWK.Model;
7 12
 using XHWK.WKTool.DAL;
8 13
 
@@ -34,6 +39,7 @@ namespace XHWK.WKTool
34 39
             //加载视频列表
35 40
             LoadingVideoList();
36 41
             int i = 1;
42
+            bool isColour = true;
37 43
             //显示视频
38 44
             foreach (Model_Video videoinfo in model_VideoList)
39 45
             {
@@ -50,17 +56,41 @@ namespace XHWK.WKTool
50 56
                 //文件存储路径
51 57
                 //videoinfo.VidePath;
52 58
 
59
+                string colour = "#FFFFFF";
60
+                if (isColour==true)
61
+                {
62
+                    colour = "#FFFFFF";
63
+                    isColour = false;
64
+                }
65
+                else
66
+                {
67
+                    colour = "#E6F1FF";
68
+                    isColour = true;
69
+                }
70
+                string vis = "Visible";
71
+                string cos = "Collapsed";
72
+                if(!videoinfo.IsUpload)
73
+                {
74
+                    vis= "Collapsed";
75
+                    cos= "Visible";
76
+                }
77
+
53 78
                 pageData.menuList.Add(new FileDirectoryModel()
54 79
                 {
55 80
                     SerialNumber = i,
56
-                    VideoName = Common.system.FileToolsCommon.GetIOFileName( videoinfo.VideoPath),
81
+                    VideoName = Common.system.FileToolsCommon.GetIOFileName(videoinfo.VideoPath),
57 82
                     VideoDuration = 0,
58 83
                     VideoSize = videoinfo.VideoSize,
59 84
                     VideoTime = videoinfo.RSTime,
60
-
61
-                });
85
+                    IsEnabled = false,
86
+                    Path = videoinfo.VideoPath,
87
+                    Colour = colour,
88
+                    Visi = vis,
89
+                    Coll=cos,
90
+                }) ; ; 
62 91
                 i++;
63 92
             }
93
+            txbSum.Text = pageData.menuList.Count.ToString();
64 94
             DataContext = pageData;
65 95
         }
66 96
         /// <summary>
@@ -97,7 +127,129 @@ namespace XHWK.WKTool
97 127
         {
98 128
             DragMove();
99 129
         }
100
-     
130
+        /// <summary>
131
+        /// 上传
132
+        /// </summary>
133
+        /// <param name="sender"></param>
134
+        /// <param name="e"></param>
135
+        private void BtnUpload_Click(object sender, RoutedEventArgs e) 
136
+        {
137
+            List<Button> buttons = FindChilds<Button>(listView1, "btnUpload");
138
+            for (int i = 0; i < buttons.Count; i++)
139
+            {
140
+                if (buttons[i] == sender)
141
+                {
142
+                 
143
+                }
144
+            }
145
+        }
146
+        /// <summary>
147
+        /// 删除
148
+        /// </summary>
149
+        /// <param name="sender"></param>
150
+        /// <param name="e"></param>
151
+        private void BtnDelete_Click(object sender, RoutedEventArgs e)
152
+        {
153
+            List<Button> buttons = FindChilds<Button>(listView1, "btnDelete");
154
+            for (int i = 0; i < buttons.Count; i++)
155
+            {
156
+                if (buttons[i] == sender)
157
+                {
158
+
159
+                }
160
+            }
161
+        }
162
+        /// <summary>
163
+        /// 播放
164
+        /// </summary>
165
+        /// <param name="sender"></param>
166
+        /// <param name="e"></param>
167
+        private void BtnPlay_Click(object sender, RoutedEventArgs e)
168
+        {
169
+            List<Button> buttons = FindChilds<Button>(listView1, "btnPlay");
170
+            for (int i = 0; i < buttons.Count; i++)
171
+            {
172
+                if (buttons[i] == sender)
173
+                {
174
+                    try
175
+                    {
176
+                        ProcessStartInfo psi = new ProcessStartInfo(pageData.menuList[i].Path);
177
+                        Process pro = new Process
178
+                        {
179
+                            StartInfo = psi
180
+                        };
181
+                        pro.Start();
182
+                    }
183
+                    catch (Exception ex)
184
+                    {
185
+                        LogHelper.WriteErrLog("FileDirectoryWindow【BtnPlay_Click】" + ex.Message, ex);
186
+                        MessageBox.Show(ex.Message);
187
+                        return;
188
+                    }
189
+                }
190
+            }
191
+        }
192
+
193
+
194
+
195
+        public static List<T> FindChilds<T>(DependencyObject parent, string childName)
196
+  where T : DependencyObject
197
+        {
198
+            List<T> list = new List<T>();
199
+            if (parent == null)
200
+            {
201
+                return list;
202
+            }
203
+
204
+            int childrenCount = VisualTreeHelper.GetChildrenCount(parent);
205
+            for (int i = 0; i < childrenCount; i++)
206
+            {
207
+                DependencyObject child = VisualTreeHelper.GetChild(parent, i);
208
+                // 如果子控件不是需查找的控件类型
209
+                T childType = child as T;
210
+                if (childType == null)
211
+                {
212
+                    // 在下一级控件中递归查找
213
+                    List<T> findChildList = FindChilds<T>(child, childName);
214
+                    for (int j = 0; j < findChildList.Count; j++)
215
+                    {
216
+                    }
217
+                    list.AddRange(FindChilds<T>(child, childName));
218
+                }
219
+                else if (!string.IsNullOrEmpty(childName))
220
+                {
221
+                    FrameworkElement frameworkElement = child as FrameworkElement;
222
+                    // 如果控件名称符合参数条件
223
+                    if (frameworkElement != null && frameworkElement.Name == childName)
224
+                    {
225
+                        list.Add((T)child);
226
+                    }
227
+                }
228
+                else
229
+                {
230
+                    // 查找到了控件
231
+                    list.Add((T)child);
232
+                }
233
+            }
234
+
235
+            return list;
236
+        }
237
+        /// <summary>
238
+        /// 修改
239
+        /// </summary>
240
+        /// <param name="sender"></param>
241
+        /// <param name="e"></param>
242
+        private void BtnModify_Click(object sender, RoutedEventArgs e)
243
+        {
244
+            List<Button> buttons = FindChilds<Button>(listView1, "btnModify");
245
+            for (int i = 0; i < buttons.Count; i++)
246
+            {
247
+                if (buttons[i] == sender)
248
+                {
249
+                    pageData.menuList[i].IsEnabled = true;
250
+                }
251
+            }
252
+        }
101 253
     }
102 254
     public class FileDirectoryData : NotifyModel
103 255
     {
@@ -189,5 +341,45 @@ namespace XHWK.WKTool
189 341
                 OnPropertyChanged("Colour");
190 342
             }
191 343
         }
344
+        private bool _isEnabled;
345
+        /// <summary>
346
+        /// 是否可编辑
347
+        /// </summary>
348
+        public bool IsEnabled
349
+        {
350
+            get => _isEnabled;
351
+            set
352
+            {
353
+                _isEnabled = value;
354
+                OnPropertyChanged("IsEnabled");
355
+            }
356
+        }
357
+        public string Path { get; set; }
358
+        private string _visi;
359
+        /// <summary>
360
+        /// 显示
361
+        /// </summary>
362
+        public string Visi
363
+        {
364
+            get => _visi;
365
+            set
366
+            {
367
+                _visi = value;
368
+                OnPropertyChanged("Visi");
369
+            }
370
+        }
371
+        private string _coll;
372
+        /// <summary>
373
+        /// 显示
374
+        /// </summary>
375
+        public string Coll
376
+        {
377
+            get => _coll;
378
+            set
379
+            {
380
+                _coll = value;
381
+                OnPropertyChanged("Coll");
382
+            }
383
+        }
192 384
     }
193 385
 }

BIN
XHWK.WKTool/Images/fileDirectory1.png 파일 보기


BIN
XHWK.WKTool/Images/fileDirectory2.png 파일 보기


BIN
XHWK.WKTool/Images/fileDirectory3.png 파일 보기


BIN
XHWK.WKTool/Images/fileDirectory4.png 파일 보기


BIN
XHWK.WKTool/Images/fileDirectory5.png 파일 보기


BIN
XHWK.WKTool/Images/fileDirectory6.png 파일 보기


BIN
XHWK.WKTool/Images/fileDirectory7.png 파일 보기


BIN
XHWK.WKTool/Images/fileDirectory8.png 파일 보기


+ 5
- 1
XHWK.WKTool/PrintWindow.xaml.cs 파일 보기

@@ -70,6 +70,10 @@ namespace XHWK.WKTool
70 70
                 System.Windows.Forms.MessageBox.Show("打印机不能为空!", "", MessageBoxButtons.OK, MessageBoxIcon.Information, MessageBoxDefaultButton.Button1, System.Windows.Forms.MessageBoxOptions.DefaultDesktopOnly);
71 71
                 return;
72 72
             }
73
+            string imgPath = FileToolsCommon.GetFileAbsolutePath("temp");
74
+            FileToolsCommon.CreateFile(imgPath);
75
+            string pdf = imgPath + "\\101.pdf";
76
+            string tpf = imgPath + "\\102.TPF";
73 77
             int pr = 1;
74 78
             string msg = string.Empty;
75 79
             string outPut = string.Empty;
@@ -78,7 +82,7 @@ namespace XHWK.WKTool
78 82
             {
79 83
                 pyte = 1;
80 84
             }
81
-            LatticeFileHelper.GeneratingPDF(@"G:\101.pdf", @"G:\102.TPF", out pr, out msg, out outPut, pyte);
85
+            LatticeFileHelper.GeneratingPDF(pdf, tpf, out pr, out msg, out outPut, pyte);
82 86
             if (pr == 0)
83 87
             {
84 88
                 outPut = outPut.Replace("[", "").Replace("]", "").Replace("\"", "").Trim();

+ 24
- 10
XHWK.WKTool/XHMicroLessonSystemWindow.xaml.cs 파일 보기

@@ -178,8 +178,10 @@ namespace XHWK.WKTool
178 178
                         if (I > 10010)
179 179
                         {
180 180
                             long time = Timestamp();
181
+                        string imgPath= FileToolsCommon.GetFileAbsolutePath("temp/imgplayer");
182
+                            FileToolsCommon.CreateFile(imgPath);
181 183
                             //string FilePathName = ImgPath + RsImgName.Count + ".png";
182
-                            string path = CameraHelper.CaptureImage(@"G:\103", time.ToString());
184
+                            string path = CameraHelper.CaptureImage(imgPath, time.ToString());
183 185
                             if (!string.IsNullOrWhiteSpace(path))
184 186
                             {
185 187
                                 RbnOpen.Add(path);
@@ -292,12 +294,21 @@ namespace XHWK.WKTool
292 294
         /// <param name="e"></param>
293 295
         private void BtnUpload_Click(object sender, RoutedEventArgs e)
294 296
         {
295
-            //if (APP.IsLoginType == false)
296
-            //{
297
-            //    Login();
298
-            //    return;
299
-            //}
300
-            APP.fileDirectoryWindow = new FileDirectoryWindow();
297
+            if (APP.IsLoginType == false)
298
+            {
299
+                Login();
300
+                return;
301
+            }
302
+            if(APP.fileDirectoryWindow==null)
303
+            {
304
+                APP.fileDirectoryWindow = new FileDirectoryWindow();
305
+                APP.fileDirectoryWindow.Topmost = true;
306
+                APP.fileDirectoryWindow.Owner = this;
307
+            }
308
+            else
309
+            {
310
+                Initialize();
311
+            }
301 312
             APP.fileDirectoryWindow.Show();
302 313
         }
303 314
         /// <summary>
@@ -1300,7 +1311,8 @@ namespace XHWK.WKTool
1300 1311
             }
1301 1312
             if (APP.pageData.pagenum < 200)
1302 1313
             {
1303
-                if (APP.PageDrawList != null && APP.PageDrawList.Count > 0 && APP.PageDrawList[APP.pageData.currpage - 1].ImageLocation != null)
1314
+                if (APP.PageDrawList != null && APP.PageDrawList.Count > 0 && APP.PageDrawList.Count > APP.pageData.currpage - 1
1315
+                    && APP.PageDrawList[APP.pageData.currpage - 1].ImageLocation != null)
1304 1316
                 {
1305 1317
                     APP.PageDrawList[APP.pageData.currpage - 1].IsImageLocation = true;
1306 1318
                 }
@@ -1347,8 +1359,10 @@ namespace XHWK.WKTool
1347 1359
                 ////设置纸张横向
1348 1360
                 //document.SetPageSize(iTextSharp.text.PageSize.A4.Rotate());
1349 1361
 
1350
-
1351
-                iTextSharp.text.pdf.PdfWriter.GetInstance(document, new FileStream(@"G:\101.pdf", FileMode.Create, FileAccess.ReadWrite));
1362
+                string imgPath = FileToolsCommon.GetFileAbsolutePath("temp");
1363
+                FileToolsCommon.CreateFile(imgPath);
1364
+                imgPath += "\\101.pdf";
1365
+                iTextSharp.text.pdf.PdfWriter.GetInstance(document, new FileStream(imgPath, FileMode.Create, FileAccess.ReadWrite));
1352 1366
                 document.Open();
1353 1367
                 iTextSharp.text.Image image;
1354 1368
                 for (int i = 0; i < APP.PageDrawList.Count; i++)

+ 10
- 0
XHWK.WKTool/XHWK.WKTool.csproj 파일 보기

@@ -1488,5 +1488,15 @@
1488 1488
       <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
1489 1489
     </EmbeddedResource>
1490 1490
   </ItemGroup>
1491
+  <ItemGroup>
1492
+    <Resource Include="Images\fileDirectory1.png" />
1493
+    <Resource Include="Images\fileDirectory2.png" />
1494
+    <Resource Include="Images\fileDirectory3.png" />
1495
+    <Resource Include="Images\fileDirectory4.png" />
1496
+    <Resource Include="Images\fileDirectory5.png" />
1497
+    <Resource Include="Images\fileDirectory6.png" />
1498
+    <Resource Include="Images\fileDirectory7.png" />
1499
+    <Resource Include="Images\fileDirectory8.png" />
1500
+  </ItemGroup>
1491 1501
   <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
1492 1502
 </Project>

Loading…
취소
저장