123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152 |
- <!DOCTYPE html>
- <html>
- <head>
- <title>TODO supply a title</title>
- {include file="../application/manage/view/commons/headers.html" }
- <script>
- // 编辑窗口
- var $editWin;
- var winHeight = $(window).height();
- var frameHeight = winHeight * 0.9;
- $(function() {
- $editWin = $('#edit-window').window({
- title: '关键词编辑',
- width: 800,
- height: frameHeight,
- top: ($(document).height() - frameHeight) / 2,
- left: ($(document).width() - 820) / 2,
- shadow: true,
- modal: true,
- iconCls: 'icon-edit',
- closed: true,
- minimizable: false,
- maximizable: false,
- collapsible: false
- });
- })
- function commandsFormatter(id, row) {
- var cmdEdit = "<a href='#' onclick=\"javascript:showEditWin('" + row.id + "');\" >编辑</a> ";
- cmdEdit += "<a href='#' onclick=\"javascript:deleteRow('" + row.id + "');\" >删除</a>";
- return cmdEdit;
- }
-
- function ppFormatter(val){
- if(val=="1"){
- return "公有";
- }else if(val=="2"){
- return "私有";
- }else{
- return "--";
- }
- }
- $(function() {
- var height = $(document).height();
- $("#dg").height(height);
- $('#dg').datagrid({
- url: '/manage/template/getDatas',
- idField: 'id', method: 'get', rownumbers: true, showFooter: true,fitColumns : true,singleSelect:true,selectOnCheck:false,
- toolbar: '#tb', pageSize: dgRowSize, pageList: [dgRowSize, dgRowSize*2 , 100],pagination: true,
- frozenColumns:[[
- { field: 'exam_class_id', title: '检查类别', align: 'left' , width: "80" },
- { field: 'title', title: '名称', align: 'left' , width: "180" },
- ]],
- columns: [[
- { field: 'id', title: 'ID', hidden: true },
- { field: 'create_user', title: '创建人ID', align: 'center' , width: "135" },
- { field: 'is_public', title: '类别', align: 'center' , width: "80", formatter: ppFormatter },
- { field: 'impression', title: '影像所见', align: 'left' , },
- { field: 'description', title: '意见建议', align: 'left' , },
- { field: 'grid_commands', title: '操作', align: 'center', width: "100", formatter: commandsFormatter },
- ]],
- onDblClickRow: function(rowIndex, rowData) {
- showEditWin(rowData.id);
- },
- });
- });
-
- function refresh(){
- var examcla = $('#examcla').combobox("getValue");
- var is_public = $('#is_public').combobox("getValue");
- var userid = $('#userid').textbox("getValue");
- var url="/manage/template/getDatas?examcla="+(examcla==null?"":examcla)+"&is_public="+(is_public==null?"":is_public)+"&userid="+(userid==null?"":userid)+"&t="+new Date();
- $('#dg').datagrid("reload",url);
- }
- // 显示编辑窗口
- function showEditWin(id) {
- if ("undefined" == typeof id) {
- $editWin.window('open');
- $('#editFrame').attr('src', '/manage/template/goEdit');
- } else {
- $editWin.window('open');
- $('#editFrame').attr('src', '/manage/template/goEdit?id=' + id);
- }
- }
- function deleteRow(id) {
- $.messager.confirm('Confirm', '确定要删除这条记录吗?', function(r) {
- if (r) {
- $.ajax({
- url: "/manage/template/del",
- data: "id=" + id + "&t=" + new Date(),
- success: function(rs) {
- if (rs == "delete_ok") {
- alert("操作已成功!");
- document.location.reload();
- } else {
- alert("操作失败!");
- }
- }
- });
- }
- });
- }
- // 关闭编辑窗口
- function closeEditWin(isReload) {
- $editWin.window('close');
- if (isReload == "reload") {
- document.location.reload();
- }
- }
- </script>
- </head>
- <body>
- <div id="dg" class="easyui-datagrid" style="width:100%;height:auto;"></div>
- <div id="tb" class="editform" style="display: none; padding-top: 1px;">
- 检查类别:
- <select id="examcla" class="easyui-combobox" style="width: 100px; ">
- <option value="">全部</option>
- {volist name="examcla" id="it"}
- <option value="{$it.name}">{$it.name}</option>
- {/volist}
- </select>
- 类别:
- <select id="is_public" class="easyui-combobox" style="width: 100px; ">
- <option value="">全部</option>
- <option value="1">公有</option>
- <option value="2">私有</option>
- </select>
- 人员:
- <input type="text" name="userid" id="userid" class="easyui-textbox" size="10" style="width:150px;" />
-
- <a id="submit" href="#" class="easyui-linkbutton" data-options="iconCls:'icon-search'" style="width: 80px" onclick="refresh();" >查询</a>
- <a id="add" href="#" class="easyui-linkbutton" data-options="iconCls:'icon-add'" onclick="javascript:showEditWin()" style="width: 80px">添加</a>
- </div>
- <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>
- </body>
- </html>
|