123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447 |
- <!DOCTYPE HTML>
- <html>
- <head>
- <meta charset="utf-8">
- <meta name="renderer" content="webkit|ie-comp|ie-stand">
- <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
- <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
- <meta http-equiv="Cache-Control" content="no-siteapp" />
- <!--[if lt IE 9]>
- <script type="text/javascript" src="${ctx}/assets/lib/html5.js"></script>
- <script type="text/javascript" src="${ctx}/assets/lib/respond.min.js"></script>
- <script type="text/javascript" src="${ctx}/assets/lib/PIE_IE678.js"></script>
- <![endif]-->
- <link rel="stylesheet" type="text/css" href="${ctx}/assets/static/h-ui/css/H-ui.min.css" />
- <link rel="stylesheet" type="text/css" href="${ctx}/assets/static/h-ui.admin/css/H-ui.admin.css" />
- <link rel="stylesheet" type="text/css" href="${ctx}/assets/lib/Hui-iconfont/1.0.7/iconfont.css" />
- <link rel="stylesheet" type="text/css" href="${ctx}/assets/lib/icheck/icheck.css" />
- <link rel="stylesheet" type="text/css" href="${ctx}/assets/static/h-ui.admin/skin/default/skin.css" id="skin" />
- <link rel="stylesheet" type="text/css" href="${ctx}/assets/static/h-ui.admin/css/style.css" />
- <link rel="stylesheet" type="text/css" href="${ctx}/assets/lib/zTree/v3/css/zTreeStyle/zTreeStyle.css" >
- <script type="text/javascript" src="${ctx}/assets/lib/My97DatePicker/WdatePicker.js"></script>
- <script type="text/ecmascript" src="${ctx}/assets/lib/jquery/1.9.1/jquery.js"></script>
- <script type="text/javascript" src="${ctx}/assets/lib/layer/3.0.3/layer.js"></script>
- <script type="text/javascript" src="${ctx}/assets/static/h-ui/js/H-ui.js"></script>
- <link rel="stylesheet" type="text/css" media="screen" href="${ctx}/assets/lib/jqueryui/jquery-ui.css" />
- <link rel="stylesheet" type="text/css" media="screen" href="${ctx}/assets/lib/jqgrid/css/ui.jqgrid.css" />
- <script type="text/ecmascript" src="${ctx}/assets/lib/jqueryui/jquery-ui.js"></script>
- <script type="text/ecmascript" src="${ctx}/assets/lib/jqgrid/js/i18n/grid.locale-cn.js"></script>
- <script type="text/ecmascript" src="${ctx}/assets/lib/jqgrid/js/jquery.jqGrid.min.js"></script>
- <script type="text/javascript" src="${ctx}/assets/js/base.js"></script>
- <script type="text/javascript" src="${ctx}/assets/lib/zTree/v3/js/jquery.ztree.all-3.5.min.js"></script>
- <!--[if IE 6]>
- <script type="text/javascript" src="${ctx}/assets/lib/DD_belatedPNG_0.0.8a-min.js" ></script>
- <script>DD_belatedPNG.fix('*');</script>
- <![endif]-->
- <script type="text/javascript">
- function showFlowPic(executionId){
- layer.open({
- title:"查看流转",
- type: 1,
- anim: 2,
- area: ['600px', '400px'],
- content: "<div style='margin:5px;'><img style='width:100%' src='${ctx}/myconsole/myflow/show?executionId="+executionId+"'></div>"
- });
- }
- $(function() {
- $(window).resize(function(){
- $("#jqGrid").setGridWidth($(window).width()-41);
- });
- $("#jqGrid").jqGrid({
- url : '${ctx}/myconsole/gov/getByPage',
- editurl:"${ctx}/myconsole/gov/saveOrUpdate",
- mtype : "POST",
- datatype : "json",
- postData : {'columnID':'${column.columnid!}','siteID':'${currentSite.SiteID!}','TState':$('#TState').val()},
- multiselect: true,
- caption1:'政务公开',
- prmNames : { //定义表单的主键 // Default valuesprmNames: {page:“page”,rows:“rows”, sort: “sidx”,order: “sord”, search:“_search”, nd:“nd”, npage:null} 当参数为null时不会被发到服务器端
- id: "keyid",
- oper:"oper",
- addoper:"add",
- editoper:"edit",
- deloper:"del"
-
- },
- colModel : [ {
- label : '数据编号',
- name : 'keyid',
- key : true,
- editable: false,
- hidden:true
- },{
- label : '标题',
- name : 'title',
- width : 200,
- formatter: function (cellvalue, options, rowdata) {
- var html = "<a href='${ctx}/${currentSite.siteid}"+rowdata.htmlurl+"' target='_blank' title='"+cellvalue+"' ><span style='color:"+rowdata.titlecolor+"'>"+cellvalue+"</span></a>";
- return html;
- }
- }, {
- label : '信息序号',
- hidden : true,
- name : 'infoserial',
- width : 50,
- },{
- label : '创建人',
- name : 'username',
- width : 30,
- }, {
- label : '创建时间',
- name : 'recordtime',
- width : 50,
- }, {
- label : '发布时间',
- name : 'releasetime',
- width : 50,
- }, {
- label : '状态',
- name : 'tstate',
- width : 30,
- align:"center",
- formatter:'select',
- edittype:"select",
- editoptions: {
- value:"draft:草稿箱;withdraw:撤稿箱;finished:成品箱;waitrelease:待发箱;flow:流转箱"
- },
- sortable:false
- },{
- label : '操作',
- name:'operMod',
- index:'operMod',
- align:"center",
- width:"50",
- sortable:false,
- formatter: function (cellvalue, options, rowdata) {
- var html ="";
- if(rowdata.tstate=='draft'||rowdata.tstate=='withdraw') {
- html = "<button class='btn btn-success radius size-S' onclick=webinfo_init('修改信息','"+rowdata.keyid+"','update')>修改</button>"+
- "<button class='btn btn-danger radius size-S ml-5' onclick=deleteData('"+rowdata.keyid+"')>删除</button>";
- }else if(rowdata.tstate=='flow'){
- html=html+ "<button class='btn btn-success radius size-S' onclick=showFlowPic('"+rowdata.workflowinstance+"')>查看流转</button>"
- }
- return html;
- }
- }],
- rownumbers : true,//添加左侧行号
- viewrecords : true,//是否在浏览导航栏显示记录总数
- rowNum : 10,//每页显示记录数
- rowList : [10,15,20,30,40,50 ],//用于改变显示行数的下拉列表框的元素数组。
- autowidth : true,
- sortname : 'sortID',
- sortorder : 'asc',
- height : 'auto',
- pager : "#jqGridPager",
- //屏蔽点击任意单元格选中checkbox的问题
- beforeSelectRow: function (rowid, e) {
- var $myGrid = $(this),
- i = $.jgrid.getCellIndex($(e.target).closest('td')[0]),
- cm = $myGrid.jqGrid('getGridParam', 'colModel');
- return (cm[i].name === 'cb');
- }
- });
- //拖动排序
- $('#jqGrid').jqGrid('sortableRows', {
- update:function(ev, ui){
- var item = ui.item[0], ri = item.rowIndex, itemId = item.id;
- var array = $('#jqGrid').jqGrid('getDataIDs');
- var options = 'next';//标识参照ID 是取得当前元素的后一个
- if(ri == array.length){//说明在列表最末尾,拿他当前一行数据作为参照物
- ri -=2;
- options = 'pre';//标识参照ID 是取得当前元素的前一个
- }
-
- $.post("${ctx}/myconsole/gov/sort/", {
- KeyID: itemId,
- ReferKeyID: array[ri],
- OptionType: options
- });
- }
- });
- //切换资源状态时,动态刷新数据;同时判断发布和撤稿按钮是否可用
- $('#TState').change(reload);
-
-
-
- });
- //选择数据状态下拉列表重新取数据
- function reload()
- {
- var strTState = $('#TState').val();
-
- $("#jqGrid").jqGrid('setGridParam', {
- datatype : "json",
- postData : {'columnID' : '${column.columnid!}','TState':$('#TState').val()}
- }).trigger('reloadGrid');
- }
- //新建或者修改信息页面调用函数
- function webinfo_init(title,keyid,strOper){
- var columnID = '${column.columnid!}',
- name = '${column.columnname!}',
- columnName = escape(name).replace(/%/g,"\\").toLowerCase();
- //alert('传递的主键'+id);
- fullOpen("${ctx}/myconsole/gov/initWebInfo?columnID="+columnID+"&keyid="+keyid+"&Oper="+strOper);
- }
-
- //文章撤稿 韩林平 2016-11-29
- function setWithdraw()
- {
- var data = jQuery('#jqGrid').jqGrid('getGridParam','selarrrow');
- if(data.length <=0){
- layer.msg('请选择要操作的数据',{icon: 5,time:1500});
- return false;
- }
- else
- {
- var doFlag=true;
- $(data).each(function (index, id){
- var row = $("#jqGrid").jqGrid('getRowData', id);
- if(row.tstate != 'finished' )
- {
- doFlag=false;
- }
-
- })
-
- if(!doFlag){
- layer.msg('只有成品箱中的数据才能进行撤稿操作!',{icon: 5,time:1500});
- return false;
- }
-
- }
-
- $.getJSON("${ctx}/myconsole/gov/setWithdraw", {
- keyids : data+""
- }, function(json){
- if(json.status == 'y'){
- layer.alert(json.message, {
- skin: 'layui-layer-molv' //样式类名
- ,closeBtn: 0
- }, function(){reload();layer.closeAll('dialog');});
- }else{
- layer.alert(json.message, {
- skin: 'layui-layer-molv' //样式类名
- ,closeBtn: 0
- }, function(){layer.closeAll('dialog');});
- }
- });
- }
- //批量发布文章 韩林平 2016-11-29
- function batchRelease()
- {
- var data = jQuery('#jqGrid').jqGrid('getGridParam','selarrrow');
- if(data.length <=0){
- layer.msg('请选择要操作的数据',{icon: 5,time:1500});
- return false;
- }
- else
- {
- var doFlag=true;
- $(data).each(function (index, id){
- var row = $("#jqGrid").jqGrid('getRowData', id);
- if(row.tstate != 'draft' && row.tstate != 'withdraw' && row.tstate != 'waitrelease' )
- {
- doFlag=false;
- }
-
- })
-
- if(!doFlag){
- layer.msg('只有草稿箱,撤稿箱和待发布箱中的数据才能进行发布操作',{icon: 5,time:1500});
- return false;
- }
-
- }
-
- $.getJSON("${ctx}/myconsole/gov/batchRelease", {
- keyids : data+""
- }, function(json){
- if(json.status == 'y'){
- layer.alert(json.message, {
- skin: 'layui-layer-molv' //样式类名
- ,closeBtn: 0
- }, function(){reload();layer.closeAll('dialog');});
- }else{
- layer.alert(json.message, {
- skin: 'layui-layer-molv' //样式类名
- ,closeBtn: 0
- }, function(){layer.closeAll('dialog');});
- }
- });
- }
- //批量删除文章 韩林平2016-11-30
- function batchDelete(){
- var data = jQuery('#jqGrid').jqGrid('getGridParam','selarrrow');
- if(data.length <=0){
- layer.msg('请选择要操作的数据',{icon: 5,time:1500});
- return false;
- }
- else
- {
- var doFlag=true;
- $(data).each(function (index, id){
- var row = $("#jqGrid").jqGrid('getRowData', id);
- if(row.tstate != 'draft' && row.tstate != 'withdraw' && row.tstate != 'rejection' )
- {
- doFlag=false;
- }
-
- })
-
- if(!doFlag){
- layer.msg('只有草稿箱,撤稿箱和退稿箱中的数据才能进行删除操作',{icon: 5,time:1500});
- return false;
- }
-
- }
-
- $.getJSON("${ctx}/myconsole/gov/batchDelete", {
- keyids : data+""
- }, function(json){
- if(json.status == 'y'){
- layer.alert(json.message, {
- skin: 'layui-layer-molv' //样式类名
- ,closeBtn: 0
- }, function(){reload();layer.closeAll('dialog');});
- }else{
- layer.alert(json.message, {
- skin: 'layui-layer-molv' //样式类名
- ,closeBtn: 0
- }, function(){layer.closeAll('dialog');});
- }
- });
-
-
- }
- //删除单条数据处理 韩林平2016-11-28
- function deleteData(strKeyID){
- $.getJSON("${ctx}/myconsole/gov/deleteData", {
- keyid : strKeyID
- }, function(json){
- if(json.status == 'y'){
- //处理成功返回消息;
- layer.alert(json.message, {
- skin: 'layui-layer-molv' //样式类名
- ,closeBtn: 0
- }, function(){reload();layer.closeAll('dialog');});
-
- }else{
- //处理失败返回消息;
- layer.alert(json.message, {
- skin: 'layui-layer-molv' //样式类名
- ,closeBtn: 0
- }, function(){reload();layer.closeAll('dialog');});
- }
- });
- }
-
-
-
- //查询
- function query()
- {
-
- parent.layer.open({
- type: 1,
- title: '选择查询条件',
- btn: ['查询','取消'],
- yes:function(index, layero){
- var btnName = $('#TState').val();
- $("#jqGrid").jqGrid('setGridParam', {
- datatype : "json",
- postData : {'columnID' : '${column.columnid!}','TState':$('#TState').val(),'KeyWord':$(layero).find("#keyword").val(),'BeginDate':$(layero).find("#begindate").val(),'EndDate':$(layero).find("#enddate").val()}
- }).trigger('reloadGrid');
-
-
- parent.layer.close(index);
- },
- skin: 'layui-layer-rim', //加上边框
- area: ['350px', '480px'], //宽高
- content: '<br><div class="row cl"><label class="form-label col-xs-1 col-sm-5"> 关键字:</label>'+
- '<div class="formControls col-xs-1 col-sm-6"><input type="text" class="input-text" id="keyword" name="keyword"></div></div>'+
- '<br><div class="row cl"><label class="form-label col-xs-1 col-sm-5"> 发布开始时间:</label>'+
- '<div class="formControls col-xs-1 col-sm-6"><input type="text" class="input-text" id="begindate" name="begindate"></div></div>'+
- '<br><div class="row cl"><label class="form-label col-xs-1 col-sm-5"> 发布结束时间:</label>'+
- '<div class="formControls col-xs-1 col-sm-6"><input type="text" class="input-text" id="enddate" name="enddate"></div></div>',
- success:function(layero, index){
- $(layero).find("#begindate").on("click",function(){
- WdatePicker();
- })
- $(layero).find("#enddate").on("click",function(){
- WdatePicker();
- })
-
- var begindateObj = $(layero).find("#begindate");
- begindateObj.attr('readOnly',true);
- begindateObj.css({'background':'#cccccc'});
- var enddateObj = $(layero).find("#enddate");
- enddateObj.attr('readOnly',true);
- enddateObj.css({'background':'#cccccc'});
- }
- });
-
-
- }
-
- </script>
- <title>我的桌面</title>
- </head>
- <body>
- <div>
- <nav class="breadcrumb">
- <span class="l" id=buttoncontent>
-
- <a id=ButtonInsert class="btn btn-primary radius" onclick=webinfo_init("添加信息","","add") href="javascript:;">
- <i class="Hui-iconfont"></i> 新建
- </a>
-
- <a id=ButtonRelease class="btn btn-primary radius finishedc" onclick="batchRelease()" href="javascript:;">
- <i class="Hui-iconfont"></i> 发布</a>
-
- <a id=ButtonWithdraw class="btn btn-primary radius withdrawc" onclick="setWithdraw()" href="javascript:;">
- <i class="Hui-iconfont"></i> 撤稿
- </a>
-
-
- <a id=ButtonDelete class="btn btn-danger radius deletec" href="javascript:;" onclick="batchDelete()">
- <i class="Hui-iconfont"></i> 删除
- </a>
- <a id=ButtonSelect class="btn btn-primary radius query" onclick="query()" href="javascript:;">
- <i class="Hui-iconfont"></i> 检索
- </a>
- <span class="select-box" style="width: 120px" >
- <select id="TState" class="select" >
- <option value=''>所有文章</option>
- <option value='finished'>成品箱</option>
- <option value='draft'>草稿箱</option>
- <option value='waitrelease'>待发箱</option>
- <option value='withdraw'>撤稿箱</option>
- </select>
- </span>
- </span>
- </nav>
- <div class="page-container">
-
- <table id="jqGrid"></table>
- <div id="jqGridPager"></div>
- </div>
- </div>
-
- </body>
- </html>
|