移交管理
This commit is contained in:
		
						commit
						6c7bb34357
					
				
										
											Binary file not shown.
										
									
								
							|  | @ -0,0 +1,75 @@ | |||
| { | ||||
|   "Version": 1, | ||||
|   "WorkspaceRootPath": "D:\\\u6570\u636E\\\u8BFA\u5FC5\u8FBE\\\u4E94\u73AF\\CNCEC_SUBQHSE_WUHUAN\\", | ||||
|   "Documents": [], | ||||
|   "DocumentGroupContainers": [ | ||||
|     { | ||||
|       "Orientation": 1, | ||||
|       "VerticalTabListWidth": 256, | ||||
|       "DocumentGroups": [ | ||||
|         { | ||||
|           "DockedHeight": 200, | ||||
|           "SelectedChildIndex": -1, | ||||
|           "Children": [ | ||||
|             { | ||||
|               "$type": "Bookmark", | ||||
|               "Name": "ST:0:0:{e506b91c-c606-466a-90a9-123d1d1e12b3}" | ||||
|             }, | ||||
|             { | ||||
|               "$type": "Bookmark", | ||||
|               "Name": "ST:130:0:{116d2292-e37d-41cd-a077-ebacac4c8cc4}" | ||||
|             }, | ||||
|             { | ||||
|               "$type": "Bookmark", | ||||
|               "Name": "ST:132:0:{116d2292-e37d-41cd-a077-ebacac4c8cc4}" | ||||
|             }, | ||||
|             { | ||||
|               "$type": "Bookmark", | ||||
|               "Name": "ST:133:0:{116d2292-e37d-41cd-a077-ebacac4c8cc4}" | ||||
|             }, | ||||
|             { | ||||
|               "$type": "Bookmark", | ||||
|               "Name": "ST:134:0:{116d2292-e37d-41cd-a077-ebacac4c8cc4}" | ||||
|             }, | ||||
|             { | ||||
|               "$type": "Bookmark", | ||||
|               "Name": "ST:1:0:{f2bd8fb8-fc94-3dae-a733-fd993c73cc87}" | ||||
|             }, | ||||
|             { | ||||
|               "$type": "Bookmark", | ||||
|               "Name": "ST:131:0:{1fc202d4-d401-403c-9834-5b218574bb67}" | ||||
|             }, | ||||
|             { | ||||
|               "$type": "Bookmark", | ||||
|               "Name": "ST:129:0:{13b12e3e-c1b4-4539-9371-4fe9a0d523fc}" | ||||
|             }, | ||||
|             { | ||||
|               "$type": "Bookmark", | ||||
|               "Name": "ST:2:0:{f2bd8fb8-fc94-3dae-a733-fd993c73cc87}" | ||||
|             }, | ||||
|             { | ||||
|               "$type": "Bookmark", | ||||
|               "Name": "ST:3:0:{f2bd8fb8-fc94-3dae-a733-fd993c73cc87}" | ||||
|             }, | ||||
|             { | ||||
|               "$type": "Bookmark", | ||||
|               "Name": "ST:129:0:{116d2292-e37d-41cd-a077-ebacac4c8cc4}" | ||||
|             }, | ||||
|             { | ||||
|               "$type": "Bookmark", | ||||
|               "Name": "ST:0:0:{1a46fd64-28d5-434c-8eb3-17a02d419b53}" | ||||
|             }, | ||||
|             { | ||||
|               "$type": "Bookmark", | ||||
|               "Name": "ST:131:0:{116d2292-e37d-41cd-a077-ebacac4c8cc4}" | ||||
|             }, | ||||
|             { | ||||
|               "$type": "Bookmark", | ||||
|               "Name": "ST:0:0:{aa2115a1-9712-457b-9047-dbb71ca2cdd2}" | ||||
|             } | ||||
|           ] | ||||
|         } | ||||
|       ] | ||||
|     } | ||||
|   ] | ||||
| } | ||||
|  | @ -201,7 +201,7 @@ | |||
|                         fileInfo: { | ||||
|                             name: '', | ||||
|                             ext: '', | ||||
|                             primary: '', | ||||
|                             primary: urlString, | ||||
|                             creator: '', | ||||
|                             createTime: new Date('20210505') | ||||
|                         }, | ||||
|  |  | |||
|  | @ -41,7 +41,7 @@ | |||
|     </style> | ||||
| 
 | ||||
|     <script language="javascript" type="text/javascript" | ||||
|         src="http://47.104.102.122:8000/web/editors/spireapi/SpireCloudEditor.js"></script> | ||||
|         src="https://lygcgs.com.cn:8060/web/editors/spireapi/SpireCloudEditor.js"></script> | ||||
| 
 | ||||
|     <script type="text/javascript" language="javascript"> | ||||
|         var docEditor; | ||||
|  | @ -201,7 +201,7 @@ | |||
|                         fileInfo: { | ||||
|                             name: '', | ||||
|                             ext: '', | ||||
|                             primary: '', | ||||
|                             primary: urlString, | ||||
|                             creator: '', | ||||
|                             createTime: new Date('20210505') | ||||
|                         }, | ||||
|  |  | |||
|  | @ -1606,6 +1606,7 @@ | |||
|     <Content Include="ProjectData\ProjectUnitSelect.aspx" /> | ||||
|     <Content Include="ProjectData\ProjectUnitView.aspx" /> | ||||
|     <Content Include="ProjectData\ProjectUser.aspx" /> | ||||
|     <Content Include="ProjectData\ProjectUserContact.aspx" /> | ||||
|     <Content Include="ProjectData\ProjectUserSave.aspx" /> | ||||
|     <Content Include="ProjectData\ProjectUserSelect.aspx" /> | ||||
|     <Content Include="ProjectData\ProjectUserView.aspx" /> | ||||
|  | @ -15365,6 +15366,13 @@ | |||
|     <Compile Include="ProjectData\ProjectUser.aspx.designer.cs"> | ||||
|       <DependentUpon>ProjectUser.aspx</DependentUpon> | ||||
|     </Compile> | ||||
|     <Compile Include="ProjectData\ProjectUserContact.aspx.cs"> | ||||
|       <DependentUpon>ProjectUserContact.aspx</DependentUpon> | ||||
|       <SubType>ASPXCodeBehind</SubType> | ||||
|     </Compile> | ||||
|     <Compile Include="ProjectData\ProjectUserContact.aspx.designer.cs"> | ||||
|       <DependentUpon>ProjectUserContact.aspx</DependentUpon> | ||||
|     </Compile> | ||||
|     <Compile Include="ProjectData\ProjectUserSave.aspx.cs"> | ||||
|       <DependentUpon>ProjectUserSave.aspx</DependentUpon> | ||||
|       <SubType>ASPXCodeBehind</SubType> | ||||
|  |  | |||
|  | @ -0,0 +1,187 @@ | |||
| <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ProjectUserContact.aspx.cs" Inherits="FineUIPro.Web.ProjectData.ProjectUserContact" %> | ||||
| 
 | ||||
| <!DOCTYPE html> | ||||
| <html xmlns="http://www.w3.org/1999/xhtml"> | ||||
| <head runat="server"> | ||||
|     <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> | ||||
|     <title>项目用户</title> | ||||
|     <link href="../res/css/common.css" rel="stylesheet" type="text/css" />   | ||||
|     <style type="text/css"> | ||||
|         .f-grid-row .f-grid-cell-inner { | ||||
|             white-space: normal; | ||||
|             word-break: break-all; | ||||
|         }      | ||||
|          | ||||
|          .f-grid-row.red | ||||
|         { | ||||
|             background-color: #FF7575; | ||||
|             background-image: none; | ||||
|         } | ||||
|          | ||||
|         .fontred | ||||
|         { | ||||
|             color: #FF7575; | ||||
|             background-image: none; | ||||
|         } | ||||
|     </style> | ||||
| </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="false"  Layout="VBox" BoxConfigAlign="Stretch" > | ||||
|         <Items> | ||||
|             <f:Grid ID="Grid1" ShowBorder="true" ShowHeader="false" Title="项目用户"  | ||||
|                 EnableCollapse="true" runat="server" BoxFlex="1"  EnableColumnLines="true" ForceFit="true" | ||||
|                 DataKeyNames="ProjectUserId" AllowCellEditing="true" ClicksToEdit="2" DataIDField="ProjectUserId" | ||||
|                 AllowSorting="true" SortField="UserName" SortDirection="ASC"  OnSort="Grid1_Sort"     | ||||
|                 AllowPaging="true" IsDatabasePaging="true"  PageSize="10" OnPageIndexChange="Grid1_PageIndexChange"  | ||||
|                  EnableTextSelection="True"> | ||||
|                 <Toolbars> | ||||
|                     <f:Toolbar ID="Toolbar2" Position="Top" runat="server" ToolbarAlign="Left"> | ||||
|                         <Items> | ||||
|                             <f:TextBox runat="server" Label="用户名称" ID="txtUserName" EmptyText="输入查询条件"  | ||||
|                                 AutoPostBack="true" OnTextChanged="TextBox_TextChanged" Width="200px" LabelWidth="80px"></f:TextBox>     | ||||
|                              | ||||
|                         </Items> | ||||
|                     </f:Toolbar> | ||||
|                 </Toolbars> | ||||
|                 <Columns> | ||||
|                     <f:TemplateField ColumnID="tfNumber" Width="50px" 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="100px" ColumnID="UserName" DataField="UserName" SortField="UserName" | ||||
|                         FieldType="String" HeaderText="用户名称"  HeaderTextAlign="Center" TextAlign="Left"> | ||||
|                     </f:RenderField> | ||||
|                      <f:RenderField Width="200px" ColumnID="Telephone" DataField="Telephone" SortField="Telephone" | ||||
|                         FieldType="String" HeaderText="联系电话"  HeaderTextAlign="Center" TextAlign="Left"> | ||||
|                     </f:RenderField> | ||||
|                     <f:RenderField Width="200px" ColumnID="RoleName" DataField="RoleName" SortField="RoleName" | ||||
|                         FieldType="String" HeaderText="项目角色"  HeaderTextAlign="Center" TextAlign="Left"> | ||||
|                     </f:RenderField> | ||||
|                     <f:RenderField Width="120px" ColumnID="WorkPostName" DataField="WorkPostName" SortField="WorkPostName" | ||||
|                         FieldType="String" HeaderText="项目岗位"  HeaderTextAlign="Center" TextAlign="Left"> | ||||
|                     </f:RenderField> | ||||
|                     | ||||
|                     <f:TemplateField Width="60px" ColumnID="Actions"> | ||||
|                     <ItemTemplate> | ||||
|                         <a class="action call" href="javascript:;"> | ||||
|                             拨号 | ||||
|                         </a> | ||||
|                            | ||||
|                         <a class="action hangup" href="javascript:;"> | ||||
|                             挂断 | ||||
|                         </a>  | ||||
|                     </ItemTemplate> | ||||
|                 </f:TemplateField> | ||||
|                                            | ||||
|                 </Columns> | ||||
|                 <Listeners> | ||||
|                  </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>  | ||||
|      | ||||
|    <audio id="audio" style="visibility: hidden;" src=""   controls="controls"> | ||||
|         Your browser does not support the audio element. | ||||
|     </audio> | ||||
|     </form> | ||||
|        | ||||
|     <script src="../res/js/jssip-3.7.0.min.js"></script> | ||||
|     <script src="../res/js/mixrtc.min.js"></script>    | ||||
|     <script type="text/javascript"> | ||||
| 
 | ||||
|         F.ready(function () { | ||||
| 
 | ||||
| 
 | ||||
|         var gridClientID = '<%= Grid1.ClientID %>'; | ||||
|         function change(value, CallInPhone = false) { | ||||
|             var classname = { | ||||
|                 CallOut: 'label-warning',    // 呼出振铃状态 | ||||
|                 CallIn: 'label-warning',     // 呼入振铃状态 | ||||
|                 Calling: 'label-info',    // 通话中 | ||||
|                 Ended: 'label-success',      // 挂断 | ||||
|                 Failed: 'label-default',     // 失败 | ||||
|             } | ||||
|             //var status = $('#status') | ||||
|             //status.removeClass() | ||||
|             //status.addClass('label') | ||||
|             //status.addClass(classname[value]) | ||||
|             //status.text(value) | ||||
|             //if (CallInPhone != false) { | ||||
|             //    $('#callin').text(CallInPhone) | ||||
|             //} | ||||
|         } | ||||
| 
 | ||||
|             var audio = $('#audio')[0] | ||||
|               | ||||
|         var Configs = { | ||||
|             audioConfigs: { | ||||
|                 audio: audio,             // audio的对象 | ||||
|                 ringout: '../res/wav/ringout.wav',   // 呼出振铃的音频地址 | ||||
|                 ringin: '../res/wav/ringin.wav',    // 呼入的振铃音频地址 | ||||
|                 hangup: '../res/wav/dududu.wav', | ||||
|             },  // 录音音频配置 | ||||
|             changeStatus: change,   // 通话状态的变动回调 | ||||
|             debug: false,    // sip信令debug排查 | ||||
|         } | ||||
|         var rtc = new WebRTC(Configs); | ||||
|         rtc.WebSocket('wss://demo1.mixcom.cn:8089/ws') | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
|         // 注册分机 | ||||
|         function registered () { | ||||
|             var extension = '2008' | ||||
|             var password = 'r5yMCjxxxaHQtMXZ' | ||||
|             if (!extension || !password) { | ||||
|                 alert("提示: 分机号码和密码不能为空!") | ||||
|             } | ||||
|             rtc.register({ | ||||
|                 extension: extension, | ||||
|                 password: password, | ||||
|                 sipserver: 'pri-local-dev02.mixcom.cn', | ||||
|             }) | ||||
|         } | ||||
| 
 | ||||
|         //// 注销分机 | ||||
|         //$('#unregistered').click(function () { | ||||
|         //    rtc.unregister() | ||||
|         //})      | ||||
|          | ||||
|        | ||||
|          | ||||
|             registered(); | ||||
|             var grid = F(gridClientID); | ||||
|             grid.el.on('click', '.f-grid-cell-Actions .action.call', function (event) { | ||||
|                 var targetEl = $(this); | ||||
|                 var rowEl = targetEl.parents('.f-grid-row'); | ||||
|                 var rowData = grid.getRowData(rowEl);  | ||||
|                 var phone = rowData.values.Telephone + '' ;  | ||||
|                 rtc.call(phone); | ||||
|                  | ||||
|             }); | ||||
|             grid.el.on('click', '.f-grid-cell-Actions .action.hangup', function (event) {  | ||||
|                 rtc.hangup()  | ||||
|             }); | ||||
| 
 | ||||
|         }); | ||||
| 
 | ||||
| 
 | ||||
|     </script> | ||||
| </body> | ||||
| </html> | ||||
|  | @ -0,0 +1,158 @@ | |||
| using BLL; | ||||
| using System; | ||||
| using System.Collections.Generic; | ||||
| using System.Data; | ||||
| using System.Data.SqlClient; | ||||
| using System.Linq; | ||||
| using System.Text; | ||||
| using AspNet = System.Web.UI.WebControls; | ||||
| 
 | ||||
| namespace FineUIPro.Web.ProjectData | ||||
| { | ||||
|     public partial class ProjectUserContact : PageBase | ||||
|     { | ||||
|         #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); | ||||
|                 if (this.CurrUser != null && this.CurrUser.PageSize.HasValue) | ||||
|                 { | ||||
|                     Grid1.PageSize = this.CurrUser.PageSize.Value; | ||||
|                 } | ||||
|                 this.ddlPageSize.SelectedValue = Grid1.PageSize.ToString(); | ||||
| 
 | ||||
| 
 | ||||
|                 // 绑定表格 | ||||
|                 this.BindGrid(); | ||||
|                 ////权限按钮方法 | ||||
|                 this.GetButtonPower(); | ||||
|             } | ||||
|         } | ||||
|         #endregion | ||||
| 
 | ||||
|         /// <summary> | ||||
|         /// 绑定数据 | ||||
|         /// </summary> | ||||
|         private void BindGrid() | ||||
|         { | ||||
| 
 | ||||
|             string strSql = @" SELECT DISTINCT ProjectUser.ProjectUserId, Users.UserName,Users.Telephone,  WorkPost.WorkPostName 
 | ||||
|                                   ,RoleName= STUFF(( SELECT ',' + RoleName FROM dbo.Sys_Role where PATINDEX('%,' + RTRIM(RoleId) + ',%',',' +ProjectUser.RoleId + ',')>0 FOR XML PATH('')), 1, 1,'') | ||||
|                                   FROM Project_ProjectUser AS ProjectUser   | ||||
|                                   LEFT JOIN Sys_User AS Users ON ProjectUser.UserId = Users.UserId   | ||||
|                                   LEFT JOIN SitePerson_Person AS Person ON ProjectUser.ProjectId =Person.ProjectId AND Users.IdentityCard = Person.IdentityCard  | ||||
|                                   LEFT JOIN Base_WorkPost AS WorkPost ON Person.WorkPostId =WorkPost.WorkPostId  | ||||
|                                 where ProjectUser.ProjectId=@ProjectId ";
 | ||||
|             List<SqlParameter> listStr = new List<SqlParameter>(); | ||||
|             listStr.Add(new SqlParameter("@ProjectId", this.CurrUser.LoginProjectId)); | ||||
| 
 | ||||
|             if (!string.IsNullOrEmpty(txtUserName.Text)) | ||||
|             { | ||||
|                 strSql+= " and Users.UserName like '%"+ txtUserName.Text + "%' "; | ||||
|             } | ||||
| 
 | ||||
|             SqlParameter[] parameter = listStr.ToArray(); | ||||
|             DataTable tb = SQLHelper.GetDataTableRunText(strSql, parameter); | ||||
| 
 | ||||
|             Grid1.RecordCount = tb.Rows.Count; | ||||
|             tb = GetFilteredTable(Grid1.FilteredData, tb); | ||||
|             var table = this.GetPagedDataTable(Grid1, tb); | ||||
|             Grid1.DataSource = table; | ||||
|             Grid1.DataBind(); | ||||
| 
 | ||||
| 
 | ||||
|         } | ||||
| 
 | ||||
|          | ||||
| 
 | ||||
|         #region 排序 分页 | ||||
|         /// <summary> | ||||
|         ///  | ||||
|         /// </summary> | ||||
|         /// <param name="sender"></param> | ||||
|         /// <param name="e"></param> | ||||
|         protected void Grid1_PageIndexChange(object sender, GridPageEventArgs e) | ||||
|         { | ||||
|             Grid1.PageIndex = e.NewPageIndex; | ||||
|             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 Grid1_Sort(object sender, FineUIPro.GridSortEventArgs e) | ||||
|         { | ||||
|             Grid1.SortDirection = e.SortDirection; | ||||
|             Grid1.SortField = e.SortField; | ||||
|             BindGrid(); | ||||
|         } | ||||
|         #endregion | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
|         #region 获取按钮权限 | ||||
|         /// <summary> | ||||
|         /// 获取按钮权限 | ||||
|         /// </summary> | ||||
|         /// <param name="button"></param> | ||||
|         /// <returns></returns> | ||||
|         private void GetButtonPower() | ||||
|         { | ||||
|             if (Request.Params["value"] == "0") | ||||
|             { | ||||
|                 return; | ||||
|             } | ||||
| 
 | ||||
| 
 | ||||
|         } | ||||
|         #endregion | ||||
| 
 | ||||
|         #region 查询 | ||||
|         /// <summary> | ||||
|         /// 查询 | ||||
|         /// </summary> | ||||
|         /// <param name="sender"></param> | ||||
|         /// <param name="e"></param> | ||||
|         protected void TextBox_TextChanged(object sender, EventArgs e) | ||||
|         { | ||||
| 
 | ||||
|             this.BindGrid(); | ||||
|             this.GetButtonPower(); | ||||
|         } | ||||
| 
 | ||||
| 
 | ||||
|         #endregion | ||||
| 
 | ||||
|         protected string ConvertTelephone(object WorkAreaId) | ||||
|         { | ||||
|             if (WorkAreaId != null) | ||||
|                 return WorkAreaId.ToString(); | ||||
|             else | ||||
|                 return ""; | ||||
|         } | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
|     } | ||||
| } | ||||
|  | @ -0,0 +1,107 @@ | |||
| //------------------------------------------------------------------------------ | ||||
| // <自动生成> | ||||
| //     此代码由工具生成。 | ||||
| // | ||||
| //     对此文件的更改可能导致不正确的行为,如果 | ||||
| //     重新生成代码,则所做更改将丢失。 | ||||
| // </自动生成> | ||||
| //------------------------------------------------------------------------------ | ||||
| 
 | ||||
| namespace FineUIPro.Web.ProjectData | ||||
| { | ||||
| 
 | ||||
| 
 | ||||
|     public partial class ProjectUserContact | ||||
|     { | ||||
| 
 | ||||
|         /// <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> | ||||
|         /// txtUserName 控件。 | ||||
|         /// </summary> | ||||
|         /// <remarks> | ||||
|         /// 自动生成的字段。 | ||||
|         /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 | ||||
|         /// </remarks> | ||||
|         protected global::FineUIPro.TextBox txtUserName; | ||||
| 
 | ||||
|         /// <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; | ||||
|     } | ||||
| } | ||||
|  | @ -220,6 +220,10 @@ | |||
|         .f-panel-body .f-field { | ||||
|             margin-bottom: 0px !important; | ||||
|         } | ||||
| 
 | ||||
|         .t-btn1 { | ||||
|             padding: 0 .15rem; | ||||
|         } | ||||
|     </style> | ||||
| </head> | ||||
| <body class="wrap" onresize="myFunction()"> | ||||
|  | @ -261,6 +265,10 @@ | |||
|                             </div> | ||||
|                             <div class="nav-right"> | ||||
|                                 <div class="btns t-btns t-btn-r"> | ||||
|                                      <div class=" t-btn1 iconfont" onclick="CallFunction()" style="cursor: pointer"><span>呼叫<f:Button runat="server" CssClass="bgbtntop" IconFont="Eye" OnClick="btnPhoneClick" ToolTip="呼叫" Hidden="true" | ||||
|                                             EnablePostBack="true" EnableDefaultState="true" EnableDefaultCorner="false" ID="btnCall" OnClientClick="parent.removeActiveTab();"> | ||||
|                                         </f:Button></span></div> | ||||
| 
 | ||||
|                                     <div class=" t-btn1 iconfont icon-yonghu" onclick="PersonalFunction()" style="cursor: pointer"><span>个人<f:Button runat="server" CssClass="bgbtntop" IconFont="User" OnClick="btnPersonal_Click" ToolTip="我的" Hidden="true" | ||||
|                                             EnablePostBack="true" EnableDefaultState="true" EnableDefaultCorner="false" ID="btnPersonal" OnClientClick="parent.removeActiveTab();"> | ||||
|                                         </f:Button></span></div> | ||||
|  | @ -410,6 +418,12 @@ | |||
|             Target="Parent" EnableResize="false" runat="server" IsModal="true" Width="700px" | ||||
|             Height="500px"> | ||||
|         </f:Window> | ||||
| 
 | ||||
|          <f:Window ID="Window1" Title="呼叫" Hidden="true" EnableIFrame="true" EnableMaximize="true" | ||||
|             Target="Parent" EnableResize="false" runat="server" IsModal="true" Width="1000px" | ||||
|             Height="700px"> | ||||
|         </f:Window> | ||||
| 
 | ||||
|         <asp:XmlDataSource ID="XmlDataSource1" runat="server" EnableCaching="false"></asp:XmlDataSource> | ||||
|         <f:Button runat="server" ID="ProjectZJ" OnClick="ProjectZJ_Click" Hidden="true"></f:Button> | ||||
|         <f:Button runat="server" ID="ProjectTG" OnClick="ProjectTG_Click" Hidden="true"></f:Button> | ||||
|  | @ -1016,6 +1030,13 @@ | |||
|                 } | ||||
|             } | ||||
|         } | ||||
| 
 | ||||
|         //呼叫 | ||||
|         function CallFunction() { | ||||
|             // 弹出一个新窗口,加载指定的URL | ||||
|             //window.open('https://www.baidu.com', '_blank'); | ||||
|             $('[id$="_btnCall"]').click(); | ||||
|         } | ||||
|     </script> | ||||
| </body> | ||||
| </html> | ||||
|  |  | |||
|  | @ -882,5 +882,14 @@ namespace FineUIPro.Web | |||
|             } | ||||
| 
 | ||||
|         } | ||||
| 
 | ||||
|         /// <summary> | ||||
|         /// 呼叫 | ||||
|         /// </summary> | ||||
|         /// <param name="sender"></param> | ||||
|         /// <param name="e"></param> | ||||
|         protected void btnPhoneClick(object sender, EventArgs e) { | ||||
|             PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("~/ProjectData/ProjectUserContact.aspx"))); | ||||
|         } | ||||
|     } | ||||
| } | ||||
|  |  | |||
|  | @ -7,10 +7,12 @@ | |||
| // </自动生成> | ||||
| //------------------------------------------------------------------------------ | ||||
| 
 | ||||
| namespace FineUIPro.Web { | ||||
| namespace FineUIPro.Web | ||||
| { | ||||
| 
 | ||||
| 
 | ||||
|     public partial class indexProject { | ||||
|     public partial class indexProject | ||||
|     { | ||||
| 
 | ||||
|         /// <summary> | ||||
|         /// form1 控件。 | ||||
|  | @ -75,6 +77,15 @@ namespace FineUIPro.Web { | |||
|         /// </remarks> | ||||
|         protected global::FineUIPro.Button Button21; | ||||
| 
 | ||||
|         /// <summary> | ||||
|         /// btnCall 控件。 | ||||
|         /// </summary> | ||||
|         /// <remarks> | ||||
|         /// 自动生成的字段。 | ||||
|         /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 | ||||
|         /// </remarks> | ||||
|         protected global::FineUIPro.Button btnCall; | ||||
| 
 | ||||
|         /// <summary> | ||||
|         /// btnPersonal 控件。 | ||||
|         /// </summary> | ||||
|  | @ -318,6 +329,15 @@ namespace FineUIPro.Web { | |||
|         /// </remarks> | ||||
|         protected global::FineUIPro.Window WindowAtt; | ||||
| 
 | ||||
|         /// <summary> | ||||
|         /// Window1 控件。 | ||||
|         /// </summary> | ||||
|         /// <remarks> | ||||
|         /// 自动生成的字段。 | ||||
|         /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 | ||||
|         /// </remarks> | ||||
|         protected global::FineUIPro.Window Window1; | ||||
| 
 | ||||
|         /// <summary> | ||||
|         /// XmlDataSource1 控件。 | ||||
|         /// </summary> | ||||
|  |  | |||
										
											
												File diff suppressed because one or more lines are too long
											
										
									
								
							|  | @ -0,0 +1,25 @@ | |||
| /* | ||||
|  * Mix WebRTC v1.0.0 | ||||
|  * the Javascript SIP library | ||||
|  * Copyright: mixcom.cn | ||||
|  * Homepage: https://www.mixcom.cn
 | ||||
|  * License: MIT | ||||
|  */ | ||||
| 
 | ||||
| !(function (e) { | ||||
|   if ("object" == typeof exports && "undefined" != typeof module) | ||||
|     module.exports = e(); | ||||
|   else if ("function" == typeof define && define.amd) define([], e); | ||||
|   else { | ||||
|     ("undefined" != typeof window | ||||
|       ? window | ||||
|       : "undefined" != typeof global | ||||
|       ? global | ||||
|       : "undefined" != typeof self | ||||
|       ? self | ||||
|       : this | ||||
|     ).WebRTC = e(); | ||||
|   } | ||||
| })(function () { | ||||
| 
 | ||||
| }); | ||||
|  | @ -0,0 +1,223 @@ | |||
| class WebRTC { | ||||
|   constructor(config) { | ||||
|     this.ChangeStatus = ""; | ||||
|     this.options = { | ||||
|       mediaConstraints: { audio: true, video: false }, | ||||
|       pcConfig: { | ||||
|         iceServers: [ | ||||
|           { urls: ["stun:stun.mixcom.cn:3478"] }, | ||||
|           { | ||||
|             urls: "turn:stun.mixcom.cn:3478", | ||||
|             username: "mixcom", | ||||
|             credential: "MikangyunST", | ||||
|           }, | ||||
|         ], | ||||
|       }, | ||||
|     }; | ||||
|     this.audioConf = { | ||||
|       audio: "", | ||||
|       ringout: "", | ||||
|       ringin: "", | ||||
|       hangup: "", | ||||
|     }; | ||||
|     if (config == undefined) { | ||||
|       console.log("[RTC] : RTC is missing configuration information"); | ||||
|       return false; | ||||
|     } | ||||
|     if ( | ||||
|       config.audioConfigs == undefined || | ||||
|       typeof config.audioConfigs.audio != "object" | ||||
|     ) { | ||||
|       console.log("[RTC] : audio is not configured"); | ||||
|     } else { | ||||
|       this.audioConf = { ...this.audioConf, ...config.audioConfigs }; | ||||
|     } | ||||
|     if (config.changeStatus) { | ||||
|       this.ChangeStatus = config.changeStatus; | ||||
|     } | ||||
|     if (config.options !== undefined) { | ||||
|       this.options = config.options; | ||||
|     } | ||||
|     if (config.debug !== undefined && config.debug === true) { | ||||
|       JsSIP.debug.enable("JsSIP:*"); | ||||
|     } | ||||
|   } | ||||
| 
 | ||||
|   // 初始化录音播放
 | ||||
|   audioInit() { | ||||
|     // 默认是循环播放
 | ||||
|     const audio = this.audioConf.audio; | ||||
|     audio.srcObject = null; | ||||
|     audio.currentTime = 0; | ||||
|     audio.loop = false; | ||||
|     audio.src = ""; | ||||
|   } | ||||
| 
 | ||||
|   // 播放录音
 | ||||
|   audioPlay(src) { | ||||
|     const audio = this.audioConf.audio; | ||||
|     this.audioInit(); | ||||
|     if (src == "ringin" || src == "ringout") { | ||||
|       audio.loop = true; | ||||
|     } | ||||
|     audio.src = this.audioConf[src]; | ||||
|     audio.load(); | ||||
|     audio.play(); | ||||
|   } | ||||
| 
 | ||||
|   // 连接WebSocket
 | ||||
|   WebSocket(url) { | ||||
|     this.socket = new JsSIP.WebSocketInterface(url); | ||||
|   } | ||||
| 
 | ||||
|   // 注册分机
 | ||||
|   register(config) { | ||||
|     console.log("注册分机"); | ||||
|     this.configuration = { | ||||
|       sockets: [this.socket], | ||||
|       uri: "sip:" + config.extension + "@" + config.sipserver, | ||||
|       password: config.password, | ||||
|       contact_uri: "sip:" + config.extension + "@" + config.sipserver, | ||||
|     }; | ||||
|     this.ua = new JsSIP.UA(this.configuration); | ||||
|     // Websocket连接成功
 | ||||
|     this.ua.on("connected", function () { | ||||
|       console.log("websocket连接成功"); | ||||
|     }); | ||||
| 
 | ||||
|     // Websocket连接断开
 | ||||
|     this.ua.on("disconnected", function () { | ||||
|       console.log("websocket连接断开"); | ||||
|       // 重连
 | ||||
|       if (this.ua) { | ||||
|           this.ua.start(); | ||||
|       } | ||||
|     }); | ||||
| 
 | ||||
|     var that = this; | ||||
|     // 呼入或者呼出时触发的事件
 | ||||
|     this.ua.on("newRTCSession", function (e) { | ||||
|       const { session, originator } = e; | ||||
| 
 | ||||
|       that.session = session; | ||||
| 
 | ||||
|       switch (originator) { | ||||
|         // out
 | ||||
|         case "local": | ||||
|           // 此处为呼出前的操作
 | ||||
|           that.ChangeStatus("CallOut"); | ||||
|           break; | ||||
|         case "remote": | ||||
|           that.audioPlay("ringin"); | ||||
|           that.ChangeStatus("CallIn", session.remote_identity.display_name); | ||||
|           // 此处为呼入接通前的操作
 | ||||
|           break; | ||||
|         default: | ||||
|       } | ||||
| 
 | ||||
|       // 连接中
 | ||||
|       session.on("connecting", () => { | ||||
|         that.ChangeStatus("Connecting"); | ||||
|       }); | ||||
|       // 连接已接受
 | ||||
|       session.on("accepted", () => { | ||||
|         that.ChangeStatus("Connected"); | ||||
|       }); | ||||
| 
 | ||||
|       // 通话中
 | ||||
|       session.on("confirmed", () => { | ||||
|         that.ChangeStatus("Calling"); | ||||
|         const stream = new MediaStream(); | ||||
|         const receivers = session.connection.getReceivers(); | ||||
|         if (receivers) { | ||||
|           receivers.forEach((receiver) => stream.addTrack(receiver.track)); | ||||
|         } | ||||
|         audio.srcObject = stream; | ||||
|         // 最后都要播放
 | ||||
|         audio.play(); | ||||
|       }); | ||||
| 
 | ||||
|       // 播放回铃音
 | ||||
|       session.on("progress", () => { | ||||
|         // 判断呼出 播放回铃
 | ||||
|         if (originator === "local") { | ||||
|           that.audioInit(); | ||||
|           const stream = new MediaStream(); | ||||
|           const receivers = session.connection.getReceivers(); | ||||
|           if (receivers) { | ||||
|             receivers.forEach((receiver) => stream.addTrack(receiver.track)); | ||||
|           } | ||||
|           audio.srcObject = stream; | ||||
|           audio.play(); | ||||
|         } | ||||
|       }); | ||||
| 
 | ||||
|       // 结束
 | ||||
|       session.on("ended", () => { | ||||
|         console.log("挂断了"); | ||||
|         that.ChangeStatus("Ended", ""); | ||||
|         that.audioPlay("hangup"); | ||||
|       }); | ||||
|       // 失败
 | ||||
|       session.on("failed", (e) => { | ||||
|         console.log("失败了"); | ||||
|         that.ChangeStatus("Failed", ""); | ||||
|         that.audioPlay("hangup"); | ||||
|       }); | ||||
| 
 | ||||
|       // ICE 交互连通建立事件 加快通讯速度
 | ||||
|       session.on('icecandidate', function (event) { | ||||
|         if ( | ||||
|           event.candidate.type === 'srflx' && | ||||
|           event.candidate.relatedAddress !== null && | ||||
|           event.candidate.relatedPort !== null | ||||
|         ) { | ||||
|           event.ready(); | ||||
|         } | ||||
|       }); | ||||
|     }); | ||||
| 
 | ||||
|     this.ua.on("registered", () => { | ||||
|       console.log("[SIP Phone] : Registered (ON LINE)"); | ||||
|     }); | ||||
|     this.ua.on("unregistered", () => { | ||||
|       console.log("[SIP Phone] : Unregistered (OFF LINE)"); | ||||
|     }); | ||||
|     this.ua.on("registrationFailed", (e) => { | ||||
|       console.log("[SIP Phone] : Registration Failed (OFF LINE)"); | ||||
|     }); | ||||
| 
 | ||||
|     this.ua.start(); | ||||
|   } | ||||
| 
 | ||||
|   // 注销
 | ||||
|   unregister() { | ||||
|     this.ua.unregister(this.options); | ||||
|     this.ua.stop(); | ||||
|     this.ua = null; | ||||
|     console.log("[SIP Phone] : unregistered") | ||||
|   } | ||||
| 
 | ||||
|   // 呼出
 | ||||
|   call(phone) { | ||||
|     this.ua.call(phone, this.options); | ||||
|     this.audioPlay("ringout"); | ||||
|   } | ||||
| 
 | ||||
|   // 挂断
 | ||||
|   hangup() { | ||||
|     this.ua.terminateSessions(); | ||||
|   } | ||||
| 
 | ||||
|   // 接通
 | ||||
|   answer() { | ||||
|     console.log(this.session) | ||||
|     this.session.answer(this.options); | ||||
|   } | ||||
| 
 | ||||
|   // 拒接
 | ||||
|   reject() { | ||||
|     this.ua.terminateSessions(); | ||||
|     // this.seesion.terminate(this.options);
 | ||||
|   } | ||||
| } | ||||
										
											Binary file not shown.
										
									
								
							
										
											Binary file not shown.
										
									
								
							
										
											Binary file not shown.
										
									
								
							
		Loading…
	
		Reference in New Issue