虞城12345_前端

InstantMessage.html 7.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="UTF-8">
  5. <script src="../Script/Common/huayi.load.js"></script>
  6. <script src="../Script/Common/huayi.config.js"></script>
  7. <link rel="stylesheet" href="../css/init.css" />
  8. <link rel="stylesheet" href="../css/Table/table1.css" />
  9. <title>即时通讯列表</title>
  10. <style type="text/css">
  11. .m-kuang {
  12. width: 134px;
  13. background-color: #ffffff;
  14. background-image: none !important;
  15. filter: none !important;
  16. border: 1px solid #e5e5e5;
  17. outline: none;
  18. height: 34px !important;
  19. line-height: 30px;
  20. padding: 4px 6px;
  21. }
  22. .tool {
  23. margin: 20px 0;
  24. }
  25. .tool table {
  26. width: 100%;
  27. }
  28. .tool table td {
  29. width: 33%;
  30. }
  31. a.audio {
  32. display: block;
  33. padding: 3px;
  34. width: 65%;
  35. margin: 0 auto;
  36. background: green !important;
  37. color: #fff !important;
  38. }
  39. .time-box{
  40. position: relative;
  41. }
  42. .tub + input {
  43. padding-right: 30px;
  44. }
  45. i.tub {
  46. position: absolute;
  47. right: 8px;
  48. top: 8px;
  49. font-size: 18px;
  50. color: #00a0ca;
  51. }
  52. </style>
  53. </head>
  54. <body class="gray-bg">
  55. <div class="daoHang clearfix">
  56. <div class="dhLeft">
  57. <sapn>
  58. <i class="syIcon"></i>位置:
  59. <a id="ReIndex" href="javaScript:;">首页</a>&gt;
  60. <a href="javaScript:;">信息管理</a>&gt;
  61. <a href=" " class="now_position">聊天记录</a>
  62. </sapn>
  63. </div>
  64. </div>
  65. <div class="wrapper wrapper-content">
  66. <div class="th-top clearfix">
  67. <div class="clearfix form-inline">
  68. <div class="form-group">
  69. <select name="" id="isread" class="form-control compear">
  70. <option value="-1">请选择读取类型</option>
  71. <option value="0">未读</option>
  72. <option value="1">已读</option>
  73. </select>
  74. </div>
  75. <!--<div class="form-group">
  76. <select name="" id="roleid" class="form-control">
  77. <option value="">请选择角色类别</option>
  78. <option value="1">中心话务员</option>
  79. <option value="5">坐席班长</option>
  80. <option value="9">导播话务员</option>
  81. </select>
  82. </div>-->
  83. <div class="form-group">
  84. <select name="" id="userCode" class="form-control">
  85. </select>
  86. </div>
  87. <div class="time-box form-group" style="width: 230px;">
  88. <i class="tub fa fa-calendar"></i>
  89. <input class="form-control" type="text" id="strTime" placeholder="起始时间" style="width: 230px;">
  90. </div>
  91. <div class="form-group pull-right">
  92. <input type="button" class="btns form-control search" value="搜索" />
  93. </div>
  94. </div>
  95. </div>
  96. <div class="detCon">
  97. <table id="table1" data-height="600" data-row-style="rowStyle" data-query-params="queryParams">
  98. <thead>
  99. <tr>
  100. <!--<th data-align="center" data-formatter="setCode1">#</th>-->
  101. <th data-field="F_UserName" data-align="center">发送人</th>
  102. <th data-field="ToUserName" data-align="center" data-formatter="ToUserName">接收人</th>
  103. <th data-field="IsRead" data-align="center" data-formatter="readType">读取类型</th>
  104. <!--<th data-field="callee" data-align="center">主叫号码</th>-->
  105. <th data-field="Content" data-align="center">内容</th>
  106. <th data-field="CreateDate" data-align="center">时间</th>
  107. <!--<th data-align="center" data-formatter="audio" data-events="audioFiel">录音</th>-->
  108. </tr>
  109. </thead>
  110. </table>
  111. </div>
  112. <div class="model audioCon">
  113. <div class="box">
  114. <div class="btop clearfix">
  115. <p class="btl">录音文件播放</p>
  116. <p class="btr adbtr"><i class="fa fa-remove"></i></p>
  117. </div>
  118. <div class="boxCon" style="min-height: 120px;">
  119. <audio controls="controls" class="aud"></audio>
  120. </div>
  121. </div>
  122. </div>
  123. </div>
  124. <script src="../js/jquery-ui.js"></script>
  125. <script src="../js/laydate/laydate.js"></script>
  126. <script>
  127. var token = $.cookie("token");
  128. var table1 = $('#table1');
  129. //开始时间
  130. laydate.render({
  131. elem: '#strTime',
  132. range: '~',
  133. theme: '#00a1cb',
  134. });
  135. $('#roleid').change(function(){
  136. var roleid=$(this).val();
  137. //获取工号
  138. $.getJSON(huayi.config.callcenter_url + "Notice/GetUserListByRoleId", {
  139. "token": token,
  140. roleid:roleid
  141. }, function(result) {
  142. if(result.state.toLowerCase() == "success") {
  143. goodslist = result.data;
  144. bindseat($("#userCode"));
  145. }
  146. });
  147. })
  148. //获取工号
  149. $.getJSON(huayi.config.callcenter_url + "Notice/GetUserListByRoleId", {
  150. "token": token,
  151. roleid:1
  152. }, function(result) {
  153. if(result.state.toLowerCase() == "success") {
  154. goodslist = result.data;
  155. bindseat($("#userCode"));
  156. }
  157. });
  158. //工号下拉框
  159. function bindseat(obj) {
  160. obj.empty();
  161. obj.append('<option value="">请选择坐席</option>');
  162. $(goodslist).each(function(i, n) {
  163. obj.append('<option value="' + n.F_UserId + '">' + n.F_UserName + '</option>');
  164. })
  165. }
  166. initTable1()
  167. $('.search').click(function() {
  168. initTable1();
  169. })
  170. function initTable1() {
  171. //先销毁表格
  172. table1.bootstrapTable('destroy');
  173. //初始化表格,动态从服务器加载数据
  174. table1.bootstrapTable({
  175. method: "get", //使用get请求到服务器获取数据
  176. url: huayi.config.callcenter_url + "Index/GetChatListSearch", //获取数据的Servlet地址
  177. contentType: "application/x-www-form-urlencoded",
  178. striped: true,
  179. striped: true, //表格显示条纹
  180. pagination: true, //启动分页
  181. pageSize: 100, //每页显示的记录数
  182. pageNumber: 1, //当前第几页
  183. pageList: [50, 100, 200], //记录数可选列表
  184. search: false, //是否启用查询
  185. showColumns: false, //显示下拉框勾选要显示的列
  186. showRefresh: false, //显示刷新按钮
  187. sidePagination: "server", //表示服务端请求
  188. //设置为undefined可以获取pageNumber,pageSize,searchText,sortName,sortOrder
  189. //设置为limit可以获取limit, offset, search, sort, order
  190. queryParamsType: "undefined",
  191. queryParams: function queryParams(params) { //设置查询参数
  192. var param = {
  193. page: params.pageNumber,
  194. pagesize: params.pageSize,
  195. token: token,
  196. fromid: $('#userCode').val(), //坐席
  197. isread: $('#isread').val(), //读取类型
  198. strstarttime:$('#strTime').val() && $('#strTime').val().split('~')[0], //开始时间
  199. strendtime:$('#strTime').val() && $('#strTime').val().split('~')[1] //结束时间
  200. };
  201. return param;
  202. },
  203. onLoadSuccess: function() { //加载成功时执行
  204. //layer.msg("加载成功");
  205. },
  206. onLoadError: function() { //加载失败时执行
  207. //layer.msg("加载数据失败", { time: 1500, icon: 2 });
  208. }
  209. });
  210. }
  211. function readType(val, row) {
  212. var str = '未读';
  213. switch (val) {
  214. case -1:
  215. str = '全部';
  216. break;
  217. case 0:
  218. str = '未读';
  219. break;
  220. case 1:
  221. str = '已读';
  222. break;
  223. }
  224. return str
  225. }
  226. function ToUserName(val, row){
  227. return '<div>'+ val +'('+ row.ToUserCode +') </div>'
  228. }
  229. </script>
  230. </body>
  231. </html>