myMsgHomePage-see.jsp 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506
  1. <%@ page language="java" import="java.util.*" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
  2. <%@include file="/context/mytags.jsp"%>
  3. <!DOCTYPE html>
  4. <html>
  5. <head>
  6. <title>我的消息--查看</title>
  7. <t:base type="jquery,easyui,tools,DatePicker"></t:base>
  8. <script src="plug-in/layer/layer.js"></script>
  9. <script>
  10. /* function btn_ok(){
  11. $("#btnsub").click();
  12. }
  13. function callback(data){
  14. if(data.success){
  15. layer.alert(data.msg, function(index){
  16. window.location.href="sysMsgController.do?list"
  17. layer.close(index);
  18. });
  19. }
  20. else{
  21. layer.alert(data.msg);
  22. }
  23. } */
  24. </script>
  25. <!-- 添加编辑跳转页面白色背景填充CSS -->
  26. <style type="text/css">
  27. .fixed-h{
  28. float:left;
  29. width:100%;
  30. height:940px;
  31. background:#ffffff;
  32. }
  33. </style>
  34. <script type="text/javascript">
  35. //编写自定义JS代码
  36. </script>
  37. </head>
  38. <body>
  39. <t:formvalid formid="formobj" dialog="false" usePlugin="password" layout="table" action="sysMsgController.do?doUpdate" tiptype="1" callback="callback">
  40. <input id="id" name="id" type="hidden" value="${sysMsgPage.id }"/>
  41. <input id="receivedRange" name="receivedRange" type="hidden" value="${sysMsgPage.receivedRange }"/>
  42. <input id="busid" name="busid" type="hidden" value="${sysMsgPage.busid }"/>
  43. <div class="fixed-h">
  44. <table style="width: 100%;" cellpadding="0" cellspacing="1" class="formtable">
  45. <tr>
  46. <td align="right">
  47. <label class="Validform_label">
  48. <span color="red" class="requiredIcon">*</span>消息标题:
  49. </label>
  50. </td>
  51. <td class="value">
  52. <input disabled="disabled" id="msgTitle" name="msgTitle" placeholder="请输入消息标题,最多20文字" maxlength="20" datatype="*1-20" type="text" style="width: 300px" ignore="ignore" value='${sysMsgPage.msgTitle}'/>
  53. <span class="Validform_checktip"></span>
  54. <label class="Validform_label" style="display: none;">消息标题</label>
  55. </td>
  56. </tr>
  57. <tr>
  58. <td align="right">
  59. <label class="Validform_label">
  60. <span color="red" class="requiredIcon">*</span>消息内容:
  61. </label>
  62. </td>
  63. <td class="value">
  64. <textarea disabled="disabled" id="msgContent" name="msgContent" style="width:600px;height: 200px;" class="inputxt" rows="9" placeholder="请输入消息内容(最多输入文字300)" maxlength="300" ignore="ignore" >${sysMsgPage.msgContent}</textarea>
  65. <span class="Validform_checktip"></span>
  66. <label class="Validform_label" style="display: none;">消息内容</label>
  67. </td>
  68. </tr>
  69. <!-- <tr>
  70. <td align="right">
  71. <label class="Validform_label">
  72. <span color="red" class="requiredIcon">*</span>接收范围:
  73. </label>
  74. </td>
  75. <td>
  76. <table>
  77. <tr>
  78. <td>
  79. <input id="received_range_0" name="radio" class="checkOne" disabled="true" type="radio">公司全员
  80. </td>
  81. </tr>
  82. <tr>
  83. <td>
  84. <input id="received_range_1" name="radio" class="checkOne" disabled="true" type="radio">按单位&nbsp;&nbsp;&nbsp;&nbsp;
  85. <input id="orgIds" name=orgIds type="hidden" value="">
  86. <input type="text" id="departname" name="departname" readonly="readonly" class="inputxt" style="width: 150px" placeholder="请选择接收单位" disabled="true" onclick="openDepartmentSelect()">
  87. <span class="Validform_checktip"></span>
  88. <label class="Validform_label" style="display: none;">单位</label>
  89. <a href="#" class="easyui-linkbutton" plain="true" icon="icon-search" id="departSearch" disabled="true" onclick="openDepartmentSelect()">选择</a>
  90. <a href="#" disabled="disabled" class="easyui-linkbutton" plain="true" icon="icon-undo" id="departRedo" onclick="callbackClean()">清空</a>
  91. </td>
  92. </tr>
  93. <tr>
  94. <td>
  95. <input id="received_range_2" name="radio" class="checkOne" disabled="true" type="radio">按用户&nbsp;&nbsp;&nbsp;&nbsp;
  96. <input id="userid" name="userid" type="hidden" value="">
  97. <input readonly="readonly" type="text" id="realname" name="realname" value="" style="width: 150px" placeholder="请选择接收用户" disabled="true" onclick="openPersonnelSelect()" >
  98. <span class="Validform_checktip"></span>
  99. <label class="Validform_label" style="display: none;">用户</label>
  100. <a href="#" class="easyui-linkbutton" plain="true" icon="icon-search" id="departSearch" disabled="true" onclick="openPersonnelSelect()">选择</a>
  101. <a href="#" disabled="disabled" class="easyui-linkbutton" d plain="true" icon="icon-undo" id="departRedo" onclick="callbackPersonnelSelectClean()">清空</a>
  102. </td>
  103. </tr>
  104. </table>
  105. </td>
  106. </tr> -->
  107. <tr>
  108. <td height="50px" align="center" colspan="2">
  109. <div style="display:none"><input type="submit" id ="btnsub" value=""/></div>
  110. <!-- <a href="#" disabled="disabled" class="easyui-linkbutton l-btn l-btn-plain" iconcls="icon-save" onclick="btn_ok()">确定</a> -->
  111. <a style="margin-left:6px" href="#" class="easyui-linkbutton" plain="true" icon="icon-return" onclick="backHome()">返回</a>
  112. </td>
  113. </tr>
  114. </table>
  115. <div>
  116. </t:formvalid>
  117. </body>
  118. <script src = "webpage/cn/com/lzt/sysmsg/sysMsg.js"></script>
  119. <script src = "webpage/cn/com/lzt/sysmsg/myMsgHomePage-see.js"></script>
  120. <script type="text/javascript">
  121. //返回按钮
  122. function backHome(){
  123. window.location.href="sysMsgController.do?myMsgList";
  124. }
  125. function closeTabT(){
  126. // window.top.$('#maintabs').tabs('close', '');
  127. $('.J_menuTabs').on('click', "i[class='fa fa-times-circle']", closeTab);
  128. // window.top.$('#maintabs').tabs('close', '我的消息');
  129. }
  130. //计算元素集合的总宽度
  131. function calSumWidth(elements) {
  132. var width = 0;
  133. $(elements).each(function () {
  134. width += $(this).outerWidth(true);
  135. });
  136. return width;
  137. }
  138. //滚动到指定选项卡
  139. function scrollToTab(element) {
  140. var marginLeftVal = calSumWidth($(element).prevAll()), marginRightVal = calSumWidth($(element).nextAll());
  141. // 可视区域非tab宽度
  142. var tabOuterWidth = calSumWidth($(".content-tabs").children().not(".J_menuTabs"));
  143. //可视区域tab宽度
  144. var visibleWidth = $(".content-tabs").outerWidth(true) - tabOuterWidth;
  145. //实际滚动宽度
  146. var scrollVal = 0;
  147. if ($(".page-tabs-content").outerWidth() < visibleWidth) {
  148. scrollVal = 0;
  149. } else if (marginRightVal <= (visibleWidth - $(element).outerWidth(true) - $(element).next().outerWidth(true))) {
  150. if ((visibleWidth - $(element).next().outerWidth(true)) > marginRightVal) {
  151. scrollVal = marginLeftVal;
  152. var tabElement = element;
  153. while ((scrollVal - $(tabElement).outerWidth()) > ($(".page-tabs-content").outerWidth() - visibleWidth)) {
  154. scrollVal -= $(tabElement).prev().outerWidth();
  155. tabElement = $(tabElement).prev();
  156. }
  157. }
  158. } else if (marginLeftVal > (visibleWidth - $(element).outerWidth(true) - $(element).prev().outerWidth(true))) {
  159. scrollVal = marginLeftVal - $(element).prev().outerWidth(true);
  160. }
  161. $('.page-tabs-content').animate({
  162. marginLeft: 0 - scrollVal + 'px'
  163. }, "fast");
  164. }
  165. //查看左侧隐藏的选项卡
  166. function scrollTabLeft() {
  167. var marginLeftVal = Math.abs(parseInt($('.page-tabs-content').css('margin-left')));
  168. // 可视区域非tab宽度
  169. var tabOuterWidth = calSumWidth($(".content-tabs").children().not(".J_menuTabs"));
  170. //可视区域tab宽度
  171. var visibleWidth = $(".content-tabs").outerWidth(true) - tabOuterWidth;
  172. //实际滚动宽度
  173. var scrollVal = 0;
  174. if ($(".page-tabs-content").width() < visibleWidth) {
  175. return false;
  176. } else {
  177. var tabElement = $(".J_menuTab:first");
  178. var offsetVal = 0;
  179. while ((offsetVal + $(tabElement).outerWidth(true)) <= marginLeftVal) {//找到离当前tab最近的元素
  180. offsetVal += $(tabElement).outerWidth(true);
  181. tabElement = $(tabElement).next();
  182. }
  183. offsetVal = 0;
  184. if (calSumWidth($(tabElement).prevAll()) > visibleWidth) {
  185. while ((offsetVal + $(tabElement).outerWidth(true)) < (visibleWidth) && tabElement.length > 0) {
  186. offsetVal += $(tabElement).outerWidth(true);
  187. tabElement = $(tabElement).prev();
  188. }
  189. scrollVal = calSumWidth($(tabElement).prevAll());
  190. }
  191. }
  192. $('.page-tabs-content').animate({
  193. marginLeft: 0 - scrollVal + 'px'
  194. }, "fast");
  195. }
  196. //查看右侧隐藏的选项卡
  197. function scrollTabRight() {
  198. var marginLeftVal = Math.abs(parseInt($('.page-tabs-content').css('margin-left')));
  199. // 可视区域非tab宽度
  200. var tabOuterWidth = calSumWidth($(".content-tabs").children().not(".J_menuTabs"));
  201. //可视区域tab宽度
  202. var visibleWidth = $(".content-tabs").outerWidth(true) - tabOuterWidth;
  203. //实际滚动宽度
  204. var scrollVal = 0;
  205. if ($(".page-tabs-content").width() < visibleWidth) {
  206. return false;
  207. } else {
  208. var tabElement = $(".J_menuTab:first");
  209. var offsetVal = 0;
  210. while ((offsetVal + $(tabElement).outerWidth(true)) <= marginLeftVal) {//找到离当前tab最近的元素
  211. offsetVal += $(tabElement).outerWidth(true);
  212. tabElement = $(tabElement).next();
  213. }
  214. offsetVal = 0;
  215. while ((offsetVal + $(tabElement).outerWidth(true)) < (visibleWidth) && tabElement.length > 0) {
  216. offsetVal += $(tabElement).outerWidth(true);
  217. tabElement = $(tabElement).next();
  218. }
  219. scrollVal = calSumWidth($(tabElement).prevAll());
  220. if (scrollVal > 0) {
  221. $('.page-tabs-content').animate({
  222. marginLeft: 0 - scrollVal + 'px'
  223. }, "fast");
  224. }
  225. }
  226. }
  227. //通过遍历给菜单项加上data-index属性
  228. $(".J_menuItem").each(function (index) {
  229. if (!$(this).attr('data-index')) {
  230. $(this).attr('data-index', index);
  231. }
  232. });
  233. //update-begin--Author:zhoujf Date:20170707 for:TASK #2003 【UI改进】列表加载慢的时候会出现白板--------------------
  234. function hiddenloading(){
  235. $("#panelloadingDiv").hide();
  236. }
  237. function showloading(){
  238. $("#panelloadingDiv").show();
  239. }
  240. //update-end--Author:zhoujf Date:20170707 for:TASK #2003 【UI改进】列表加载慢的时候会出现白板--------------------
  241. function menuItem() {
  242. // 获取标识数据
  243. var dataUrl = $(this).attr('href'),
  244. dataIndex = $(this).data('index'),
  245. menuName = $.trim($(this).text()),
  246. flag = true;
  247. if (dataUrl == undefined || $.trim(dataUrl).length == 0)return false;
  248. // 选项卡菜单已存在
  249. $('.J_menuTab').each(function () {
  250. if ($(this).data('id') == dataUrl) {
  251. if (!$(this).hasClass('active')) {
  252. $(this).addClass('active').siblings('.J_menuTab').removeClass('active');
  253. scrollToTab(this);
  254. // 显示tab对应的内容区
  255. $('.J_mainContent .J_iframe').each(function () {
  256. if ($(this).data('id') == dataUrl) {
  257. $(this).show().siblings('.J_iframe').hide();
  258. return false;
  259. }
  260. });
  261. }
  262. flag = false;
  263. return false;
  264. }
  265. });
  266. // 选项卡菜单不存在
  267. if (flag) {
  268. var str = '<a href="javascript:;" class="active J_menuTab" data-id="' + dataUrl + '">' + menuName + ' <i class="fa fa-times-circle"></i><!--&nbsp;<i class="fa fa-refresh"></i>--></a>';
  269. $('.J_menuTab').removeClass('active');
  270. // 添加选项卡对应的iframe
  271. //update-begin--Author:zhoujf Date:20170707 for:TASK #2003 【UI改进】列表加载慢的时候会出现白板--------------------
  272. var str1 = '<iframe class="J_iframe" onreadystatechange="hiddenloading();" onload="hiddenloading();" name="iframe' + dataIndex + '" width="100%" height="100%" src="' + dataUrl + '" frameborder="0" data-id="' + dataUrl + '" seamless></iframe>';
  273. //update-end--Author:zhoujf Date:20170707 for:TASK #2003 【UI改进】列表加载慢的时候会出现白板--------------------
  274. $('.J_mainContent').find('iframe.J_iframe').hide().parents('.J_mainContent').append(str1);
  275. //显示loading提示
  276. // var loading = layer.load();
  277. //
  278. // $('.J_mainContent iframe:visible').load(function () {
  279. // //iframe加载完成后隐藏loading提示
  280. // layer.close(loading);
  281. // });
  282. // 添加选项卡
  283. $('.J_menuTabs .page-tabs-content').append(str);
  284. //update-begin--Author:zhoujf Date:20170707 for:TASK #2003 【UI改进】列表加载慢的时候会出现白板--------------------
  285. showloading();
  286. //update-end--Author:zhoujf Date:20170707 for:TASK #2003 【UI改进】列表加载慢的时候会出现白板--------------------
  287. scrollToTab($('.J_menuTab.active'));
  288. }
  289. //var last = $("a[data-id='"+dataUrl+"']");
  290. var imageMenuData = [
  291. [{
  292. text: "刷新缓存",
  293. func: function() {
  294. var target = $('.J_iframe[data-id="' + dataUrl + '"]');
  295. var url = target.attr('src');
  296. //显示loading提示
  297. var loading = layer.load();
  298. target.attr('src', url).load(function () {
  299. //关闭loading提示
  300. layer.close(loading);
  301. });
  302. }
  303. }]
  304. ];
  305. try{
  306. $("a[data-id='"+dataUrl+"']").smartMenu(imageMenuData, {
  307. name:"name"+uuid()
  308. });
  309. }catch(e){
  310. // console.log(e);
  311. }
  312. return false;
  313. }
  314. $('.J_menuItem').on('click', menuItem);
  315. // 关闭选项卡菜单
  316. function closeTab() {
  317. var closeTabId = $(this).parents('.J_menuTab').data('id');
  318. var currentWidth = $(this).parents('.J_menuTab').width();
  319. //update-begin--Author:zhoujf Date:20170707 for:TASK #2003 【UI改进】列表加载慢的时候会出现白板--------------------
  320. hiddenloading();
  321. //update-end--Author:zhoujf Date:20170707 for:TASK #2003 【UI改进】列表加载慢的时候会出现白板--------------------
  322. // 当前元素处于活动状态
  323. if ($(this).parents('.J_menuTab').hasClass('active')) {
  324. // 当前元素后面有同辈元素,使后面的一个元素处于活动状态
  325. if ($(this).parents('.J_menuTab').next('.J_menuTab').size()) {
  326. var activeId = $(this).parents('.J_menuTab').next('.J_menuTab:eq(0)').data('id');
  327. $(this).parents('.J_menuTab').next('.J_menuTab:eq(0)').addClass('active');
  328. $('.J_mainContent .J_iframe').each(function () {
  329. if ($(this).data('id') == activeId) {
  330. $(this).show().siblings('.J_iframe').hide();
  331. return false;
  332. }
  333. });
  334. var marginLeftVal = parseInt($('.page-tabs-content').css('margin-left'));
  335. if (marginLeftVal < 0) {
  336. $('.page-tabs-content').animate({
  337. marginLeft: (marginLeftVal + currentWidth) + 'px'
  338. }, "fast");
  339. }
  340. // 移除当前选项卡
  341. $(this).parents('.J_menuTab').remove();
  342. // 移除tab对应的内容区
  343. $('.J_mainContent .J_iframe').each(function () {
  344. if ($(this).data('id') == closeTabId) {
  345. $(this).remove();
  346. return false;
  347. }
  348. });
  349. }
  350. // 当前元素后面没有同辈元素,使当前元素的上一个元素处于活动状态
  351. if ($(this).parents('.J_menuTab').prev('.J_menuTab').size()) {
  352. var activeId = $(this).parents('.J_menuTab').prev('.J_menuTab:last').data('id');
  353. $(this).parents('.J_menuTab').prev('.J_menuTab:last').addClass('active');
  354. $('.J_mainContent .J_iframe').each(function () {
  355. if ($(this).data('id') == activeId) {
  356. $(this).show().siblings('.J_iframe').hide();
  357. return false;
  358. }
  359. });
  360. // 移除当前选项卡
  361. $(this).parents('.J_menuTab').remove();
  362. // 移除tab对应的内容区
  363. $('.J_mainContent .J_iframe').each(function () {
  364. if ($(this).data('id') == closeTabId) {
  365. $(this).remove();
  366. return false;
  367. }
  368. });
  369. }
  370. }
  371. // 当前元素不处于活动状态
  372. else {
  373. // 移除当前选项卡
  374. $(this).parents('.J_menuTab').remove();
  375. // 移除相应tab对应的内容区
  376. $('.J_mainContent .J_iframe').each(function () {
  377. if ($(this).data('id') == closeTabId) {
  378. $(this).remove();
  379. return false;
  380. }
  381. });
  382. scrollToTab($('.J_menuTab.active'));
  383. }
  384. return false;
  385. }
  386. $('.J_menuTabs').on('click', "i[class='fa fa-times-circle']", closeTab);
  387. $('.J_menuTabs').on('click', "i[class='fa fa-refresh']", refreshTab);
  388. //关闭其他选项卡
  389. function closeOtherTabs(){
  390. $('.page-tabs-content').children("[data-id]").not(":first").not(".active").each(function () {
  391. $('.J_iframe[data-id="' + $(this).data('id') + '"]').remove();
  392. $(this).remove();
  393. });
  394. $('.page-tabs-content').css("margin-left", "0");
  395. //update-begin--Author:zhoujf Date:20170707 for:TASK #2003 【UI改进】列表加载慢的时候会出现白板--------------------
  396. hiddenloading();
  397. //update-end--Author:zhoujf Date:20170707 for:TASK #2003 【UI改进】列表加载慢的时候会出现白板--------------------
  398. }
  399. $('.J_tabCloseOther').on('click', closeOtherTabs);
  400. //滚动到已激活的选项卡
  401. function showActiveTab(){
  402. scrollToTab($('.J_menuTab.active'));
  403. }
  404. $('.J_tabShowActive').on('click', showActiveTab);
  405. // 点击选项卡菜单
  406. function activeTab() {
  407. if (!$(this).hasClass('active')) {
  408. var currentId = $(this).data('id');
  409. // 显示tab对应的内容区
  410. $('.J_mainContent .J_iframe').each(function () {
  411. if ($(this).data('id') == currentId) {
  412. $(this).show().siblings('.J_iframe').hide();
  413. return false;
  414. }
  415. });
  416. $(this).addClass('active').siblings('.J_menuTab').removeClass('active');
  417. scrollToTab(this);
  418. }
  419. }
  420. $('.J_menuTabs').on('click', '.J_menuTab', activeTab);
  421. //刷新iframe
  422. function refreshTab() {
  423. var target = $('.J_iframe[data-id="' + $(this).data('id') + '"]');
  424. if(target==undefined){
  425. target = $('.J_iframe[data-id="' + $(this).parent().data('id') + '"]');
  426. }
  427. var url = target.attr('src');
  428. //显示loading提示
  429. var loading = layer.load();
  430. target.attr('src', url).load(function () {
  431. //关闭loading提示
  432. layer.close(loading);
  433. });
  434. }
  435. $('.J_menuTabs').on('dblclick', '.J_menuTab', refreshTab);
  436. // 左移按扭
  437. $('.J_tabLeft').on('click', scrollTabLeft);
  438. // 右移按扭
  439. $('.J_tabRight').on('click', scrollTabRight);
  440. // 关闭全部
  441. $('.J_tabCloseAll').on('click', function () {
  442. $('.page-tabs-content').children("[data-id]").not(":first").each(function () {
  443. $('.J_iframe[data-id="' + $(this).data('id') + '"]').remove();
  444. $(this).remove();
  445. });
  446. $('.page-tabs-content').children("[data-id]:first").each(function () {
  447. $('.J_iframe[data-id="' + $(this).data('id') + '"]').show();
  448. $(this).addClass("active");
  449. });
  450. $('.page-tabs-content').css("margin-left", "0");
  451. });
  452. function uuid() {
  453. var s = [];
  454. var hexDigits = "0123456789abcdef";
  455. for (var i = 0; i < 36; i++) {
  456. s[i] = hexDigits.substr(Math.floor(Math.random() * 0x10), 1);
  457. }
  458. s[14] = "4"; // bits 12-15 of the time_hi_and_version field to 0010
  459. s[19] = hexDigits.substr((s[19] & 0x3) | 0x8, 1); // bits 6-7 of the clock_seq_hi_and_reserved to 01
  460. s[8] = s[13] = s[18] = s[23] = "-";
  461. var uuid = s.join("");
  462. return uuid;
  463. }
  464. </script>