提交代码

This commit is contained in:
2024-04-01 10:29:19 +08:00
parent 0ae4143492
commit 8df0e06e6b
23 changed files with 27332 additions and 53 deletions
@@ -5,16 +5,36 @@
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>开车月技术总结</title>
<link href="../res/css/common.css" rel="stylesheet" type="text/css" />
<link href="~/res/css/common.css" rel="stylesheet" type="text/css" />
<script src="~/res/js/jquery-3.4.1.min.js"></script>
<style type="text/css">
.f-grid-row.noEdit {
pointer-events: none;
}
.f-grid-colheader-text {
white-space: normal;
word-break: break-all;
}
.imgPreview {
display: none;
top: 0;
left: 0;
width: 100%; /*容器占满整个屏幕*/
height: 100%;
position: fixed;
background: rgba(0, 0, 0, 0.5);
}
.imgPreview img {
z-index: 100;
width: 60%;
position: fixed;
top: 50%;
left: 50%;
transform: translate(-50%,-50%);
}
/*添加鼠标移入图片效果*/
.img {
cursor: url("ico/放大镜.png"), auto;
}
</style>
</head>
<body>
@@ -42,22 +62,40 @@
</Toolbars>
<Columns>
<f:RowNumberField EnablePagingNumber="true" HeaderText="序号" Width="50px" HeaderTextAlign="Center" TextAlign="Center"/>
<f:RenderField Width="200px" ColumnID="ProjectName" DataField="ProjectName"
FieldType="String" HeaderText="项目名称/项目号或本部" HeaderTextAlign="Center" TextAlign="Center">
</f:RenderField>
<f:RenderField Width="130px" ColumnID="ProcessName" DataField="ProcessName"
FieldType="String" HeaderText="工序名称" HeaderTextAlign="Center" TextAlign="Center">
<f:RenderField Width="100px" ColumnID="UserName" DataField="UserName"
FieldType="String" HeaderText="填报人" HeaderTextAlign="Center" TextAlign="Center">
</f:RenderField>
<f:RenderField Width="130px" ColumnID="RaiseDate" DataField="RaiseDate"
FieldType="Date" Renderer="Date" RendererArgument="yyyy-MM-dd" HeaderText="提出时间"
FieldType="Date" Renderer="Date" RendererArgument="yyyy-MM-dd" HeaderText="填报日期"
HeaderTextAlign="Center" TextAlign="Center">
</f:RenderField>
<f:RenderField Width="200px" ColumnID="ProjectName" DataField="ProjectName"
FieldType="String" HeaderText="项目名称" HeaderTextAlign="Center" TextAlign="Center">
</f:RenderField>
<f:RenderField Width="110px" ColumnID="Major" DataField="Major"
FieldType="String" HeaderText="填报专业" HeaderTextAlign="Center" TextAlign="Center">
</f:RenderField>
<f:RenderField Width="130px" ColumnID="ProcessName" DataField="ProcessName"
FieldType="String" HeaderText="装置" HeaderTextAlign="Center" TextAlign="Center">
</f:RenderField>
<f:RenderField Width="400px" ColumnID="ProblemDescription" DataField="ProblemDescription"
FieldType="String" HeaderText="问题描述" HeaderTextAlign="Center" TextAlign="Center">
FieldType="String" HeaderText="案例描述" HeaderTextAlign="Center" TextAlign="Center">
</f:RenderField>
<f:RenderField Width="400px" ColumnID="HandleMethod" DataField="HandleMethod"
FieldType="String" HeaderText="处理方法" HeaderTextAlign="Center" TextAlign="Center">
FieldType="String" HeaderText="案例分析及解决方案" HeaderTextAlign="Center" TextAlign="Center">
</f:RenderField>
<f:TemplateField ColumnID="tfImageUrl1" Width="180px" HeaderText="问题图片" HeaderTextAlign="Center"
TextAlign="Left">
<ItemTemplate>
<asp:Label ID="lbImageUrl1" runat="server" Text='<%# ConvertImageUrlByImage(Eval("TestRunMonthSummaryId")) %>'></asp:Label>
</ItemTemplate>
</f:TemplateField>
<f:TemplateField ColumnID="tfImageUrl2" Width="180px" HeaderText="处理后图片" HeaderTextAlign="Center"
TextAlign="Left">
<ItemTemplate>
<asp:Label ID="lbImageUrl2" runat="server" Text='<%# ConvertImageUrlByImage2(Eval("TestRunMonthSummaryId")) %>'></asp:Label>
</ItemTemplate>
</f:TemplateField>
<f:RenderField Width="400px" ColumnID="ExperienceOrSuggestion" DataField="ExperienceOrSuggestion"
FieldType="String" HeaderText="体会或建议" HeaderTextAlign="Center" TextAlign="Center">
</f:RenderField>
@@ -91,6 +129,9 @@
</f:MenuButton>
</f:Menu>
</form>
<div class="imgPreview">
<img src="#" alt="" id="imgPreview" />
</div>
<script type="text/jscript">
var menuID = '<%= Menu1.ClientID %>';
// 返回false,来阻止浏览器右键菜单
@@ -99,9 +140,30 @@
return false;
}
function reloadGrid() {
__doPostBack(null, 'reloadGrid');
}
var imgID = '<%=Grid1.ClientID %>';
F.ready(function () {
var $wrap = $("#" + imgID)
$wrap.find('img').on('click', function () {
var src = $(this).attr('src');
console.log(src);
$('.imgPreview img').attr('src', src);
$('.imgPreview').show()
});
$('.imgPreview').on('click', function () {
$('.imgPreview').hide()
});
/* $wrap.find('img').hover(function (e) {
console.log($(this).offset())
var top = $(this).offset().top;
var left = $(this).offset().left - 200;
var src = $(this).attr('src')
console.log('src', src, top, left)
$('#imgID1').css("left", left).css("top", top).show().find('img').attr('src', src)
}, function () {
$('#imgID1').hide()
})*/
})
</script>
</body>
</html>
@@ -36,7 +36,7 @@ namespace FineUIPro.Web.Personal
/// </summary>
private void BindGrid()
{
string strSql = @"SELECT summary.TestRunMonthSummaryId,summary.ProjectId,summary.UserId,summary.RaiseDate,summary.ProcessName,summary.ProblemDescription,summary.HandleMethod,summary.ExperienceOrSuggestion,Users.UserName,case when summary.ProjectId='0' then '本部' else Project.ProjectName end as ProjectName "
string strSql = @"SELECT summary.TestRunMonthSummaryId,summary.ProjectId,summary.UserId,summary.RaiseDate,summary.Major,summary.ProcessName,summary.ProblemDescription,summary.HandleMethod,summary.ExperienceOrSuggestion,Users.UserName,case when summary.ProjectId='0' then '本部' else Project.ProjectName end as ProjectName "
+ @" From dbo.Person_TestRunMonthSummary AS summary"
+ @" LEFT JOIN Sys_User AS Users ON Users.UserId=summary.UserId"
+ @" LEFT JOIN Base_Project AS Project ON Project.ProjectId=summary.ProjectId"
@@ -200,5 +200,45 @@ namespace FineUIPro.Web.Personal
{
BindGrid();
}
/// <summary>
/// 获取整改前图片(放于Img中)
/// </summary>
/// <param name="TestRunMonthSummaryId"></param>
/// <returns></returns>
protected string ConvertImageUrlByImage(object TestRunMonthSummaryId)
{
string url = string.Empty;
string httpUrl = string.Empty;
if (TestRunMonthSummaryId != null)
{
var file = BLL.AttachFileService.GetAttachFileByToKeyId(TestRunMonthSummaryId.ToString());
if (file != null)
{
url = BLL.UploadAttachmentService.ShowImage(Funs.SGGLUrl, file.AttachUrl);
}
}
return url;
}
/// <summary>
/// 获取整改前图片(放于Img中)
/// </summary>
/// <param name="TestRunMonthSummaryId"></param>
/// <returns></returns>
protected string ConvertImageUrlByImage2(object TestRunMonthSummaryId)
{
string url = string.Empty;
string httpUrl = string.Empty;
if (TestRunMonthSummaryId != null)
{
var file = BLL.AttachFileService.GetAttachFileByToKeyId(TestRunMonthSummaryId.ToString() + "R");
if (file != null)
{
url = BLL.UploadAttachmentService.ShowImage(Funs.SGGLUrl, file.AttachUrl);
}
}
return url;
}
}
}
@@ -84,6 +84,24 @@ namespace FineUIPro.Web.Personal {
/// </remarks>
protected global::FineUIPro.Button btnNew;
/// <summary>
/// lbImageUrl1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::System.Web.UI.WebControls.Label lbImageUrl1;
/// <summary>
/// lbImageUrl2 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::System.Web.UI.WebControls.Label lbImageUrl2;
/// <summary>
/// ToolbarSeparator1 控件。
/// </summary>
@@ -15,30 +15,27 @@
<Rows>
<f:FormRow>
<Items>
<f:DatePicker runat="server" Label="提出时间" ID="txtRaiseDate" LabelWidth="170px" LabelAlign="Right" DateFormatString="yyyy-MM-dd"></f:DatePicker>
<f:Label ID="lbUserName" runat="server" Label="姓名" LabelWidth="100px" LabelAlign="Right"></f:Label>
<f:DatePicker runat="server" Label="填报日期" ID="txtRaiseDate" LabelWidth="170px" LabelAlign="Right" DateFormatString="yyyy-MM-dd"></f:DatePicker>
<f:TextBox runat="server" ID="txtMajor" Label="填报专业" LabelWidth="100px" LabelAlign="Right"></f:TextBox>
<f:TextBox runat="server" ID="txtProcessName" Label="装置" LabelWidth="100px" LabelAlign="Right"></f:TextBox>
<f:Label ID="lbUserName" runat="server" Label="填报人" LabelWidth="100px" LabelAlign="Right"></f:Label>
</Items>
</f:FormRow>
<f:FormRow>
<Items>
<f:DropDownList ID="drpProject" runat="server" Label="项目名称/项目号或本部" Width="300px" LabelWidth="170px" LabelAlign="Right"
<f:DropDownList ID="drpProject" runat="server" Label="项目名称" Width="300px" LabelWidth="170px" LabelAlign="Right"
EnableEdit="true">
</f:DropDownList>
</Items>
</f:FormRow>
<f:FormRow>
<Items>
<f:TextArea runat="server" ID="txtProcessName" Label="工序名称" LabelWidth="170px" LabelAlign="Right"></f:TextArea>
<f:TextArea runat="server" ID="txtProblemDescription" Label="案例描述" LabelWidth="170px" LabelAlign="Right"></f:TextArea>
</Items>
</f:FormRow>
<f:FormRow>
<Items>
<f:TextArea runat="server" ID="txtProblemDescription" Label="问题描述" LabelWidth="170px" LabelAlign="Right"></f:TextArea>
</Items>
</f:FormRow>
<f:FormRow>
<Items>
<f:TextArea runat="server" ID="txtHandleMethod" Label="处理方法" LabelWidth="170px" LabelAlign="Right"></f:TextArea>
<f:TextArea runat="server" ID="txtHandleMethod" Label="案例分析及解决方案" LabelWidth="170px" LabelAlign="Right"></f:TextArea>
</Items>
</f:FormRow>
<f:FormRow>
@@ -46,10 +43,25 @@
<f:TextArea runat="server" ID="txtExperienceOrSuggestion" Label="体会或建议" LabelWidth="170px" LabelAlign="Right"></f:TextArea>
</Items>
</f:FormRow>
<f:FormRow>
<Items>
<f:Panel ShowHeader="false" ShowBorder="false" Layout="Column" runat="server">
<Items>
<f:Label runat="server" Text="" EncodeText="false" Label="附件" Width="170px" LabelAlign="Right"></f:Label>
<f:Button ID="btnAttach" Text="问题图片" ToolTip="问题图片上传及查看" Icon="TableCell" OnClick="btnAttach_Click" runat="server">
</f:Button>
<f:Button ID="btnAttachR" Text="处理后图片" ToolTip="处理后图片上传及查看" Icon="TableCell" OnClick="btnAttachR_Click" runat="server">
</f:Button>
</Items>
</f:Panel>
</Items>
</f:FormRow>
</Rows>
<Toolbars>
<f:Toolbar ID="Toolbar1" Position="Bottom" ToolbarAlign="Right" runat="server">
<Items>
<f:HiddenField runat="server" ID="hdId"></f:HiddenField>
<f:Button ID="btnSave" Icon="SystemSave" runat="server" ValidateForms="SimpleForm1"
OnClick="btnSave_Click">
</f:Button>
@@ -59,6 +71,10 @@
</f:Toolbar>
</Toolbars>
</f:Form>
<f:Window ID="WindowAtt" Title="弹出窗体" Hidden="true" EnableIFrame="true" EnableMaximize="true"
Target="Parent" EnableResize="false" runat="server" IsModal="true" Width="700px" OnClose="WindowAtt_Close"
Height="500px">
</f:Window>
</form>
</body>
</html>
@@ -1,5 +1,6 @@
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.UI;
@@ -43,6 +44,7 @@ namespace FineUIPro.Web.Personal
var MonthSummary = BLL.Person_TestRunMonthSummaryService.GetPersonTestRunMonthSummaryById(this.TestRunMonthSummaryId);
if (MonthSummary != null)
{
this.hdId.Text = this.TestRunMonthSummaryId;
if (MonthSummary.RaiseDate != null)
{
this.txtRaiseDate.Text = string.Format("{0:yyyy-MM-dd}", MonthSummary.RaiseDate);
@@ -52,6 +54,7 @@ namespace FineUIPro.Web.Personal
{
this.drpProject.SelectedValue = MonthSummary.ProjectId;
}
this.txtMajor.Text = MonthSummary.Major;
this.txtProcessName.Text = MonthSummary.ProcessName;
this.txtProblemDescription.Text = MonthSummary.ProblemDescription;
this.txtHandleMethod.Text = MonthSummary.HandleMethod;
@@ -60,6 +63,7 @@ namespace FineUIPro.Web.Personal
}
else
{
this.txtMajor.Text = "开车";
this.lbUserName.Text = this.CurrUser.UserName;
}
}
@@ -87,6 +91,7 @@ namespace FineUIPro.Web.Personal
RaiseDate = Funs.GetNewDateTimeOrNow(this.txtRaiseDate.Text.Trim()),
UserId = this.CurrUser.UserId,
ProjectId = this.drpProject.SelectedValue,
Major = this.txtMajor.Text.Trim(),
ProcessName = this.txtProcessName.Text.Trim(),
ProblemDescription = this.txtProblemDescription.Text.Trim(),
HandleMethod = this.txtHandleMethod.Text.Trim(),
@@ -100,7 +105,14 @@ namespace FineUIPro.Web.Personal
}
else
{
newMonthSummary.TestRunMonthSummaryId = SQLHelper.GetNewID();
if (!string.IsNullOrEmpty(this.hdId.Text))
{
newMonthSummary.TestRunMonthSummaryId = this.hdId.Text;
}
else
{
newMonthSummary.TestRunMonthSummaryId = SQLHelper.GetNewID();
}
BLL.Person_TestRunMonthSummaryService.AddPersonTestRunMonthSummary(newMonthSummary);
BLL.LogService.AddSys_Log(this.CurrUser, null, newMonthSummary.TestRunMonthSummaryId, BLL.Const.TestRunMonthSummaryMenuId, BLL.Const.BtnModify);
}
@@ -108,5 +120,61 @@ namespace FineUIPro.Web.Personal
ShowNotify("保存成功!", MessageBoxIcon.Success);
PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference());
}
#region
/// <summary>
/// 附件上传
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnAttach_Click(object sender, EventArgs e)
{
if (string.IsNullOrEmpty(this.hdId.Text)) //新增记录
{
this.hdId.Text = SQLHelper.GetNewID();
}
if (!string.IsNullOrEmpty(Request.Params["type"]))
{
PageContext.RegisterStartupScript(WindowAtt.GetShowReference(String.Format("~/AttachFile/webuploader.aspx?type=-1&toKeyId={0}&path=FileUpload/TestRun/TestRunMonthSummary&menuId={1}", this.hdId.Text, BLL.Const.TestRunMonthSummaryMenuId)));
}
else
{
PageContext.RegisterStartupScript(WindowAtt.GetShowReference(String.Format("~/AttachFile/webuploader.aspx?type=0&toKeyId={0}&path=FileUpload/TestRun/TestRunMonthSummary&menuId={1}", this.hdId.Text, BLL.Const.TestRunMonthSummaryMenuId)));
}
}
/// <summary>
/// 附件上传
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnAttachR_Click(object sender, EventArgs e)
{
if (string.IsNullOrEmpty(this.hdId.Text)) //新增记录
{
this.hdId.Text = SQLHelper.GetNewID();
}
if (!string.IsNullOrEmpty(Request.Params["type"]))
{
PageContext.RegisterStartupScript(WindowAtt.GetShowReference(String.Format("~/AttachFile/webuploader.aspx?type=-1&toKeyId={0}&path=FileUpload/TestRun/TestRunMonthSummary&menuId={1}", this.hdId.Text + "R", BLL.Const.TestRunMonthSummaryMenuId)));
}
else
{
PageContext.RegisterStartupScript(WindowAtt.GetShowReference(String.Format("~/AttachFile/webuploader.aspx?type=0&toKeyId={0}&path=FileUpload/TestRun/TestRunMonthSummary&menuId={1}", this.hdId.Text + "R", BLL.Const.TestRunMonthSummaryMenuId)));
}
}
#endregion
#region
/// <summary>
/// 关闭弹出窗口
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void WindowAtt_Close(object sender, WindowCloseEventArgs e)
{
}
#endregion
}
}
@@ -48,6 +48,24 @@ namespace FineUIPro.Web.Personal {
/// </remarks>
protected global::FineUIPro.DatePicker txtRaiseDate;
/// <summary>
/// txtMajor 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.TextBox txtMajor;
/// <summary>
/// txtProcessName 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.TextBox txtProcessName;
/// <summary>
/// lbUserName 控件。
/// </summary>
@@ -66,15 +84,6 @@ namespace FineUIPro.Web.Personal {
/// </remarks>
protected global::FineUIPro.DropDownList drpProject;
/// <summary>
/// txtProcessName 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.TextArea txtProcessName;
/// <summary>
/// txtProblemDescription 控件。
/// </summary>
@@ -102,6 +111,24 @@ namespace FineUIPro.Web.Personal {
/// </remarks>
protected global::FineUIPro.TextArea txtExperienceOrSuggestion;
/// <summary>
/// btnAttach 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Button btnAttach;
/// <summary>
/// btnAttachR 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Button btnAttachR;
/// <summary>
/// Toolbar1 控件。
/// </summary>
@@ -111,6 +138,15 @@ namespace FineUIPro.Web.Personal {
/// </remarks>
protected global::FineUIPro.Toolbar Toolbar1;
/// <summary>
/// hdId 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.HiddenField hdId;
/// <summary>
/// btnSave 控件。
/// </summary>
@@ -128,5 +164,14 @@ namespace FineUIPro.Web.Personal {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Button btnClose;
/// <summary>
/// WindowAtt 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Window WindowAtt;
}
}