225379a175b3394bab2bc3dfe5a762f4.php 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164
  1. <?php if (!defined('THINK_PATH')) exit(); /*a:2:{s:81:"/data/gitcode/yuanchengpasc/public/../application/manage/view/template/index.html";i:1540802456;s:47:"../application/manage/view/commons/headers.html";i:1540801947;}*/ ?>
  2. <!DOCTYPE html>
  3. <html>
  4. <head>
  5. <title>TODO supply a title</title>
  6. <meta charset="UTF-8"><?php $req_rmd= rand(1,9999999) ?>
  7. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  8. <link href="/static/js/jquery-easyui-1.5.5.6/themes/material/easyui.css?t=<?php echo $req_rmd; ?>" rel="stylesheet" type="text/css" />
  9. <link href="/static/js/jquery-easyui-1.5.5.6/themes/material/panel.css?t=<?php echo $req_rmd; ?>" rel="stylesheet" type="text/css" />
  10. <link href="/static/manage/css/manage.css?t=<?php echo $req_rmd; ?>" rel="stylesheet" type="text/css" />
  11. <link href="/static/js/jquery-easyui-1.5.5.6/themes/icon.css?t=<?php echo $req_rmd; ?>" rel="stylesheet" type="text/css" />
  12. <script src="/static/js/jquery-easyui-1.5.5.6/jquery.min.js?t=<?php echo $req_rmd; ?>" type="text/javascript" ></script>
  13. <script src="/static/js/jquery-easyui-1.5.5.6/jquery.easyui.min.js?t=<?php echo $req_rmd; ?>" type="text/javascript" ></script>
  14. <script src="/static/js/jquery-easyui-1.5.5.6/locale/easyui-lang-zh_CN.js?t=<?php echo $req_rmd; ?>" type="text/javascript" ></script>
  15. <script src="/static/js/commons.js?t=<?php echo $req_rmd; ?>" type="text/javascript" ></script>
  16. <script>
  17. // 编辑窗口
  18. var $editWin;
  19. var winHeight = $(window).height();
  20. var frameHeight = winHeight * 0.9;
  21. $(function() {
  22. $editWin = $('#edit-window').window({
  23. title: '关键词编辑',
  24. width: 800,
  25. height: frameHeight,
  26. top: ($(document).height() - frameHeight) / 2,
  27. left: ($(document).width() - 820) / 2,
  28. shadow: true,
  29. modal: true,
  30. iconCls: 'icon-edit',
  31. closed: true,
  32. minimizable: false,
  33. maximizable: false,
  34. collapsible: false
  35. });
  36. })
  37. function commandsFormatter(id, row) {
  38. var cmdEdit = "<a href='#' onclick=\"javascript:showEditWin('" + row.id + "');\" >编辑</a>&nbsp;";
  39. cmdEdit += "<a href='#' onclick=\"javascript:deleteRow('" + row.id + "');\" >删除</a>";
  40. return cmdEdit;
  41. }
  42. function ppFormatter(val){
  43. if(val=="1"){
  44. return "公有";
  45. }else if(val=="2"){
  46. return "私有";
  47. }else{
  48. return "--";
  49. }
  50. }
  51. $(function() {
  52. var height = $(document).height();
  53. $("#dg").height(height);
  54. $('#dg').datagrid({
  55. url: '/manage/template/getDatas',
  56. idField: 'id', method: 'get', rownumbers: true, showFooter: true,fitColumns : true,singleSelect:true,selectOnCheck:false,
  57. toolbar: '#tb', pageSize: dgRowSize, pageList: [dgRowSize, dgRowSize*2 , 100],pagination: true,
  58. frozenColumns:[[
  59. { field: 'exam_class_id', title: '检查类别', align: 'left' , width: "80" },
  60. { field: 'title', title: '名称', align: 'left' , width: "180" },
  61. ]],
  62. columns: [[
  63. { field: 'id', title: 'ID', hidden: true },
  64. { field: 'create_user', title: '创建人ID', align: 'center' , width: "135" },
  65. { field: 'is_public', title: '类别', align: 'center' , width: "80", formatter: ppFormatter },
  66. { field: 'impression', title: '影像所见', align: 'left' , },
  67. { field: 'description', title: '意见建议', align: 'left' , },
  68. { field: 'grid_commands', title: '操作', align: 'center', width: "100", formatter: commandsFormatter },
  69. ]],
  70. onDblClickRow: function(rowIndex, rowData) {
  71. showEditWin(rowData.id);
  72. },
  73. });
  74. });
  75. function refresh(){
  76. var examcla = $('#examcla').combobox("getValue");
  77. var is_public = $('#is_public').combobox("getValue");
  78. var userid = $('#userid').textbox("getValue");
  79. var url="/manage/template/getDatas?examcla="+(examcla==null?"":examcla)+"&is_public="+(is_public==null?"":is_public)+"&userid="+(userid==null?"":userid)+"&t="+new Date();
  80. $('#dg').datagrid("reload",url);
  81. }
  82. // 显示编辑窗口
  83. function showEditWin(id) {
  84. if ("undefined" == typeof id) {
  85. $editWin.window('open');
  86. $('#editFrame').attr('src', '/manage/template/goEdit');
  87. } else {
  88. $editWin.window('open');
  89. $('#editFrame').attr('src', '/manage/template/goEdit?id=' + id);
  90. }
  91. }
  92. function deleteRow(id) {
  93. $.messager.confirm('Confirm', '确定要删除这条记录吗?', function(r) {
  94. if (r) {
  95. $.ajax({
  96. url: "/manage/template/del",
  97. data: "id=" + id + "&t=" + new Date(),
  98. success: function(rs) {
  99. if (rs == "delete_ok") {
  100. alert("操作已成功!");
  101. document.location.reload();
  102. } else {
  103. alert("操作失败!");
  104. }
  105. }
  106. });
  107. }
  108. });
  109. }
  110. // 关闭编辑窗口
  111. function closeEditWin(isReload) {
  112. $editWin.window('close');
  113. if (isReload == "reload") {
  114. document.location.reload();
  115. }
  116. }
  117. </script>
  118. </head>
  119. <body>
  120. <div id="dg" class="easyui-datagrid" style="width:100%;height:auto;"></div>
  121. <div id="tb" class="editform" style="display: none; padding-top: 1px;">
  122. &nbsp; 检查类别:
  123. <select id="examcla" class="easyui-combobox" style="width: 100px; ">
  124. <option value="">全部</option>
  125. <?php if(is_array($examcla) || $examcla instanceof \think\Collection || $examcla instanceof \think\Paginator): $i = 0; $__LIST__ = $examcla;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$it): $mod = ($i % 2 );++$i;?>
  126. <option value="<?php echo $it['name']; ?>"><?php echo $it['name']; ?></option>
  127. <?php endforeach; endif; else: echo "" ;endif; ?>
  128. </select>
  129. 类别:
  130. <select id="is_public" class="easyui-combobox" style="width: 100px; ">
  131. <option value="">全部</option>
  132. <option value="1">公有</option>
  133. <option value="2">私有</option>
  134. </select>
  135. 人员:
  136. <input type="text" name="userid" id="userid" class="easyui-textbox" size="10" style="width:150px;" />
  137. <a id="submit" href="#" class="easyui-linkbutton" data-options="iconCls:'icon-search'" style="width: 80px" onclick="refresh();" >查询</a>
  138. <a id="add" href="#" class="easyui-linkbutton" data-options="iconCls:'icon-add'" onclick="javascript:showEditWin()" style="width: 80px">添加</a>
  139. </div>
  140. <div id="edit-window" class="easyui-window" style="overflow: hidden"><iframe src="about:blank" id="editFrame" width="100%" height="100%" frameborder="0" scrolling="yes"></iframe></div>
  141. </body>
  142. </html>