This commit is contained in:
parent
b1560c43f7
commit
54a81a5e2c
File diff suppressed because one or more lines are too long
|
@ -0,0 +1,94 @@
|
||||||
|
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ProjectSitePerson.aspx.cs" Inherits="FineUIPro.Web.DataShow.ProjectSitePerson" %>
|
||||||
|
|
||||||
|
<!DOCTYPE html>
|
||||||
|
|
||||||
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||||
|
<head runat="server">
|
||||||
|
<link href="~/res/css/common.css" rel="stylesheet" type="text/css" />
|
||||||
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||||
|
<title>项目当前现场人员</title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<form id="form1" runat="server">
|
||||||
|
<f:PageManager ID="PageManager1" AutoSizePanelID="Panel1" runat="server" />
|
||||||
|
<f:Panel ID="Panel1" runat="server" Margin="5px" BodyPadding="5px" ShowBorder="false"
|
||||||
|
ShowHeader="true" Layout="VBox" BoxConfigAlign="Stretch">
|
||||||
|
<Items>
|
||||||
|
<f:Grid ID="Grid1" ShowBorder="true" ShowHeader="false" Title="项目当前现场人员" EnableCollapse="true"
|
||||||
|
runat="server" BoxFlex="1" DataKeyNames="PersonId" DataIDField="PersonId" AllowSorting="true" SortField="PersonName" SortDirection="ASC"
|
||||||
|
OnSort="Grid1_Sort" AllowPaging="true" IsDatabasePaging="true" PageSize="20" EnableColumnLines="true" ForceFit="true"
|
||||||
|
OnPageIndexChange="Grid1_PageIndexChange" EnableTextSelection="True">
|
||||||
|
<Toolbars>
|
||||||
|
<f:Toolbar ID="Toolbar2" Position="Top" runat="server" ToolbarAlign="Left">
|
||||||
|
<Items>
|
||||||
|
<f:CheckBox runat="server" ID="chManager" Label="管理人员" LabelAlign="right" LabelWidth="80px"
|
||||||
|
AutoPostBack="true" OnCheckedChanged="TextBox_TextChanged">
|
||||||
|
</f:CheckBox>
|
||||||
|
<f:ToolbarFill runat="server"></f:ToolbarFill>
|
||||||
|
<f:Button ID="btnClose" EnablePostBack="false" ToolTip="关闭" Text="关闭" runat="server" Icon="SystemClose" OnClientClick="closeNow();">
|
||||||
|
</f:Button>
|
||||||
|
</Items>
|
||||||
|
</f:Toolbar>
|
||||||
|
</Toolbars>
|
||||||
|
<Columns>
|
||||||
|
<f:TemplateField ColumnID="tfNumber" Width="55px" HeaderText="序号" HeaderTextAlign="Center"
|
||||||
|
TextAlign="Center">
|
||||||
|
<ItemTemplate>
|
||||||
|
<asp:Label ID="lblNumber" runat="server" Text='<%# Grid1.PageIndex * Grid1.PageSize + Container.DataItemIndex + 1 %>'></asp:Label>
|
||||||
|
</ItemTemplate>
|
||||||
|
</f:TemplateField>
|
||||||
|
<f:RenderField Width="150px" ColumnID="PersonName" DataField="PersonName" FieldType="String" HeaderText="人员名称" TextAlign="Left"
|
||||||
|
HeaderTextAlign="Center">
|
||||||
|
</f:RenderField>
|
||||||
|
<f:RenderField Width="100px" ColumnID="WorkPostName" DataField="WorkPostName" FieldType="String" HeaderText="岗位" TextAlign="Left"
|
||||||
|
HeaderTextAlign="Center">
|
||||||
|
</f:RenderField>
|
||||||
|
</Columns>
|
||||||
|
<%-- <Listeners>
|
||||||
|
<f:Listener Event="beforerowcontextmenu" Handler="onRowContextMenu" />
|
||||||
|
</Listeners>--%>
|
||||||
|
<PageItems>
|
||||||
|
<f:ToolbarSeparator ID="ToolbarSeparator1" runat="server">
|
||||||
|
</f:ToolbarSeparator>
|
||||||
|
<f:ToolbarText ID="ToolbarText1" runat="server" Text="每页记录数:">
|
||||||
|
</f:ToolbarText>
|
||||||
|
<f:DropDownList runat="server" ID="ddlPageSize" Width="80px" AutoPostBack="true"
|
||||||
|
OnSelectedIndexChanged="ddlPageSize_SelectedIndexChanged">
|
||||||
|
</f:DropDownList>
|
||||||
|
</PageItems>
|
||||||
|
</f:Grid>
|
||||||
|
</Items>
|
||||||
|
</f:Panel>
|
||||||
|
<f:Window ID="Window1" Title="详情" Hidden="true" EnableIFrame="true" EnableMaximize="true"
|
||||||
|
Target="Parent" EnableResize="false" runat="server" IsModal="true" OnClose="Window1_Close"
|
||||||
|
Width="1200px" Height="620px" Maximized="true">
|
||||||
|
</f:Window>
|
||||||
|
</form>
|
||||||
|
<script type="text/javascript">
|
||||||
|
<%-- var menuID = '<%= Menu1.ClientID %>';
|
||||||
|
|
||||||
|
// 返回false,来阻止浏览器右键菜单
|
||||||
|
function onRowContextMenu(event, rowId) {
|
||||||
|
F(menuID).show(); //showAt(event.pageX, event.pageY);
|
||||||
|
return false;
|
||||||
|
}--%>
|
||||||
|
|
||||||
|
// 点击标题栏工具图标 - 退出
|
||||||
|
function closeNow(event) {
|
||||||
|
var bConfirmed = confirm('您确定要退出吗?');
|
||||||
|
if (bConfirmed) { closePage(); }
|
||||||
|
}
|
||||||
|
|
||||||
|
function closePage() {
|
||||||
|
if (navigator.userAgent.indexOf('Firefox') !== -1 || navigator.userAgent.indexOf('Chrome') !== -1) {
|
||||||
|
window.location.href = "about:blank";
|
||||||
|
window.close();
|
||||||
|
} else {
|
||||||
|
window.opener = null;
|
||||||
|
window.open("", "_self");
|
||||||
|
window.close();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
</body>
|
||||||
|
</html>
|
|
@ -0,0 +1,163 @@
|
||||||
|
using BLL;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Data;
|
||||||
|
using System.Data.SqlClient;
|
||||||
|
using System.Linq;
|
||||||
|
|
||||||
|
namespace FineUIPro.Web.DataShow
|
||||||
|
{
|
||||||
|
public partial class ProjectSitePerson : PageBase
|
||||||
|
{
|
||||||
|
#region 项目主键
|
||||||
|
/// <summary>
|
||||||
|
/// 项目主键
|
||||||
|
/// </summary>
|
||||||
|
public string ProjectId
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return (string)ViewState["ProjectId"];
|
||||||
|
}
|
||||||
|
set
|
||||||
|
{
|
||||||
|
ViewState["ProjectId"] = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region 加载页面
|
||||||
|
/// <summary>
|
||||||
|
/// 加载页面
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="sender"></param>
|
||||||
|
/// <param name="e"></param>
|
||||||
|
protected void Page_Load(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
if (!IsPostBack)
|
||||||
|
{
|
||||||
|
Funs.DropDownPageSize(this.ddlPageSize);
|
||||||
|
this.ProjectId = this.CurrUser.LoginProjectId;
|
||||||
|
this.Panel1.Title = $"项目当前现场人员({BLL.ProjectService.GetProjectNameByProjectId(this.ProjectId)})";
|
||||||
|
ddlPageSize.SelectedValue = Grid1.PageSize.ToString();
|
||||||
|
//BLL.ProjectService.InitProjectDropDownList(this.drpProject, true);
|
||||||
|
// 绑定表格t
|
||||||
|
BindGrid();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 绑定数据
|
||||||
|
/// </summary>
|
||||||
|
private void BindGrid()
|
||||||
|
{
|
||||||
|
if (!string.IsNullOrWhiteSpace(this.ProjectId))
|
||||||
|
{
|
||||||
|
var db = Funs.DB;
|
||||||
|
var startDate = DateTime.Now.Date;
|
||||||
|
var endDate = startDate.AddDays(1);
|
||||||
|
var query =
|
||||||
|
from x in db.SitePerson_PersonInOutNow
|
||||||
|
where x.ChangeTime >= startDate && x.ChangeTime < endDate && x.ProjectId == this.ProjectId
|
||||||
|
group x by new { x.PersonId, x.ProjectId } into g
|
||||||
|
select new
|
||||||
|
{
|
||||||
|
g.Key.PersonId,
|
||||||
|
g.Key.ProjectId,
|
||||||
|
MaxChangeTime = g.Max(x => x.ChangeTime)
|
||||||
|
};
|
||||||
|
var finalQuery =
|
||||||
|
from record in query
|
||||||
|
join detail in db.SitePerson_PersonInOutNow
|
||||||
|
on new { record.PersonId, record.ProjectId, record.MaxChangeTime }
|
||||||
|
equals new { detail.PersonId, detail.ProjectId, MaxChangeTime = detail.ChangeTime }
|
||||||
|
join y in db.SitePerson_Person on record.PersonId equals y.PersonId
|
||||||
|
join z in db.Base_WorkPost on y.WorkPostId equals z.WorkPostId
|
||||||
|
where detail.IsIn == true
|
||||||
|
select new
|
||||||
|
{
|
||||||
|
PersonId = record.PersonId,
|
||||||
|
PersonName = y.PersonName,
|
||||||
|
WorkPostName = z.WorkPostName,
|
||||||
|
ProjectId = record.ProjectId,
|
||||||
|
ChangeTime = record.MaxChangeTime,
|
||||||
|
PostType = z.PostType,
|
||||||
|
IsIn = true,
|
||||||
|
};
|
||||||
|
|
||||||
|
if (this.chManager.Checked)
|
||||||
|
{
|
||||||
|
finalQuery = finalQuery.Where(x => x.PostType == Const.PostType_1);
|
||||||
|
}
|
||||||
|
var ssss = finalQuery.Count();
|
||||||
|
|
||||||
|
DataTable tb = this.GetPagedDataTable(Grid1, finalQuery);
|
||||||
|
// 2.获取当前分页数据
|
||||||
|
//var table = this.GetPagedDataTable(Grid1, tb1);
|
||||||
|
Grid1.RecordCount = tb.Rows.Count;
|
||||||
|
var table = this.GetPagedDataTable(Grid1, tb);
|
||||||
|
//Grid1.RecordCount = finalQuery.Count();
|
||||||
|
Grid1.DataSource = table;
|
||||||
|
Grid1.DataBind();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region 查询
|
||||||
|
/// <summary>
|
||||||
|
/// 查询
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="sender"></param>
|
||||||
|
/// <param name="e"></param>
|
||||||
|
protected void TextBox_TextChanged(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
this.BindGrid();
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region 表排序、分页、关闭窗口
|
||||||
|
/// <summary>
|
||||||
|
/// 分页
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="sender"></param>
|
||||||
|
/// <param name="e"></param>
|
||||||
|
protected void Grid1_PageIndexChange(object sender, GridPageEventArgs e)
|
||||||
|
{
|
||||||
|
BindGrid();
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 排序
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="sender"></param>
|
||||||
|
/// <param name="e"></param>
|
||||||
|
protected void Grid1_Sort(object sender, GridSortEventArgs e)
|
||||||
|
{
|
||||||
|
BindGrid();
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 分页显示条数下拉框
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="sender"></param>
|
||||||
|
/// <param name="e"></param>
|
||||||
|
protected void ddlPageSize_SelectedIndexChanged(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
Grid1.PageSize = Convert.ToInt32(ddlPageSize.SelectedValue);
|
||||||
|
BindGrid();
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 关闭弹出窗
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="sender"></param>
|
||||||
|
/// <param name="e"></param>
|
||||||
|
protected void Window1_Close(object sender, WindowCloseEventArgs e)
|
||||||
|
{
|
||||||
|
BindGrid();
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,125 @@
|
||||||
|
//------------------------------------------------------------------------------
|
||||||
|
// <自动生成>
|
||||||
|
// 此代码由工具生成。
|
||||||
|
//
|
||||||
|
// 对此文件的更改可能导致不正确的行为,如果
|
||||||
|
// 重新生成代码,则所做更改将丢失。
|
||||||
|
// </自动生成>
|
||||||
|
//------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
namespace FineUIPro.Web.DataShow
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
public partial class ProjectSitePerson
|
||||||
|
{
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// form1 控件。
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// 自动生成的字段。
|
||||||
|
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||||
|
/// </remarks>
|
||||||
|
protected global::System.Web.UI.HtmlControls.HtmlForm form1;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// PageManager1 控件。
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// 自动生成的字段。
|
||||||
|
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||||
|
/// </remarks>
|
||||||
|
protected global::FineUIPro.PageManager PageManager1;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Panel1 控件。
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// 自动生成的字段。
|
||||||
|
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||||
|
/// </remarks>
|
||||||
|
protected global::FineUIPro.Panel Panel1;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Grid1 控件。
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// 自动生成的字段。
|
||||||
|
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||||
|
/// </remarks>
|
||||||
|
protected global::FineUIPro.Grid Grid1;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Toolbar2 控件。
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// 自动生成的字段。
|
||||||
|
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||||
|
/// </remarks>
|
||||||
|
protected global::FineUIPro.Toolbar Toolbar2;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// chManager 控件。
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// 自动生成的字段。
|
||||||
|
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||||
|
/// </remarks>
|
||||||
|
protected global::FineUIPro.CheckBox chManager;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// btnClose 控件。
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// 自动生成的字段。
|
||||||
|
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||||
|
/// </remarks>
|
||||||
|
protected global::FineUIPro.Button btnClose;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// lblNumber 控件。
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// 自动生成的字段。
|
||||||
|
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||||
|
/// </remarks>
|
||||||
|
protected global::System.Web.UI.WebControls.Label lblNumber;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// ToolbarSeparator1 控件。
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// 自动生成的字段。
|
||||||
|
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||||
|
/// </remarks>
|
||||||
|
protected global::FineUIPro.ToolbarSeparator ToolbarSeparator1;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// ToolbarText1 控件。
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// 自动生成的字段。
|
||||||
|
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||||
|
/// </remarks>
|
||||||
|
protected global::FineUIPro.ToolbarText ToolbarText1;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// ddlPageSize 控件。
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// 自动生成的字段。
|
||||||
|
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||||
|
/// </remarks>
|
||||||
|
protected global::FineUIPro.DropDownList ddlPageSize;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Window1 控件。
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// 自动生成的字段。
|
||||||
|
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||||
|
/// </remarks>
|
||||||
|
protected global::FineUIPro.Window Window1;
|
||||||
|
}
|
||||||
|
}
|
|
@ -696,6 +696,7 @@
|
||||||
<Content Include="DataShow\EduTrain.aspx" />
|
<Content Include="DataShow\EduTrain.aspx" />
|
||||||
<Content Include="DataShow\Emergency.aspx" />
|
<Content Include="DataShow\Emergency.aspx" />
|
||||||
<Content Include="DataShow\Environmental.aspx" />
|
<Content Include="DataShow\Environmental.aspx" />
|
||||||
|
<Content Include="DataShow\ProjectSitePerson.aspx" />
|
||||||
<Content Include="DataShow\GJSX.aspx" />
|
<Content Include="DataShow\GJSX.aspx" />
|
||||||
<Content Include="DataShow\GJSXItem.aspx" />
|
<Content Include="DataShow\GJSXItem.aspx" />
|
||||||
<Content Include="DataShow\HiddenRectification.aspx" />
|
<Content Include="DataShow\HiddenRectification.aspx" />
|
||||||
|
@ -9287,6 +9288,13 @@
|
||||||
<Compile Include="DataShow\Environmental.aspx.designer.cs">
|
<Compile Include="DataShow\Environmental.aspx.designer.cs">
|
||||||
<DependentUpon>Environmental.aspx</DependentUpon>
|
<DependentUpon>Environmental.aspx</DependentUpon>
|
||||||
</Compile>
|
</Compile>
|
||||||
|
<Compile Include="DataShow\ProjectSitePerson.aspx.cs">
|
||||||
|
<DependentUpon>ProjectSitePerson.aspx</DependentUpon>
|
||||||
|
<SubType>ASPXCodeBehind</SubType>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="DataShow\ProjectSitePerson.aspx.designer.cs">
|
||||||
|
<DependentUpon>ProjectSitePerson.aspx</DependentUpon>
|
||||||
|
</Compile>
|
||||||
<Compile Include="DataShow\GJSX.aspx.cs">
|
<Compile Include="DataShow\GJSX.aspx.cs">
|
||||||
<DependentUpon>GJSX.aspx</DependentUpon>
|
<DependentUpon>GJSX.aspx</DependentUpon>
|
||||||
<SubType>ASPXCodeBehind</SubType>
|
<SubType>ASPXCodeBehind</SubType>
|
||||||
|
|
|
@ -248,7 +248,7 @@
|
||||||
<div class="item flex1">
|
<div class="item flex1">
|
||||||
<div class="bw-b-bottom">
|
<div class="bw-b-bottom">
|
||||||
<div class="bw-b-bottom-up">
|
<div class="bw-b-bottom-up">
|
||||||
<div class="bw-item-content pd0">
|
<div class="bw-item-content pd0 js-hover" data-type="SitePersonNum">
|
||||||
<div class="base-wrap flex flexV">
|
<div class="base-wrap flex flexV">
|
||||||
<div class="base-tit">当前现场总人数</div>
|
<div class="base-tit">当前现场总人数</div>
|
||||||
<div class="base-txt-wrap flex flex1">
|
<div class="base-txt-wrap flex flex1">
|
||||||
|
@ -364,6 +364,25 @@
|
||||||
<script type="text/javascript" src="../res/index/js/swiper-3.4.2.jquery.min.js"></script>
|
<script type="text/javascript" src="../res/index/js/swiper-3.4.2.jquery.min.js"></script>
|
||||||
<script type="text/javascript" src="../res/index/js/echarts.min.js"></script>
|
<script type="text/javascript" src="../res/index/js/echarts.min.js"></script>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
|
|
||||||
|
$(function () {
|
||||||
|
initClick();
|
||||||
|
})
|
||||||
|
|
||||||
|
function initClick() {
|
||||||
|
$(".js-hover").click(function () {
|
||||||
|
var htmlContent = GetClickHtml(this);
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
function GetClickHtml(obj) {
|
||||||
|
var $this = $(obj), type = $this.attr('data-type');
|
||||||
|
if (type == 'SitePersonNum') {
|
||||||
|
$('iframe').attr('src', '../DataShow/ProjectSitePerson.aspx') //项目当前现场人员
|
||||||
|
window.open("../DataShow/ProjectSitePerson.aspx")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
var basePath = '<%= ResolveUrl("~/") %>';
|
var basePath = '<%= ResolveUrl("~/") %>';
|
||||||
function ope() {
|
function ope() {
|
||||||
parent.addExampleTab({
|
parent.addExampleTab({
|
||||||
|
|
Loading…
Reference in New Issue