Commit d3fba110 authored by wangjiangze's avatar wangjiangze

更新

parent 15432e9a
...@@ -4,8 +4,8 @@ return array( ...@@ -4,8 +4,8 @@ return array(
'SOOONER_DOMAIN_GSLB_LIVE'=>'gslb.live.soooner.com', //直播gslb域名 'SOOONER_DOMAIN_GSLB_LIVE'=>'gslb.live.soooner.com', //直播gslb域名
'PARAMS_TRANSPORT_KEY' =>'SOOONER.COM', //关键参数传递加密私钥 'PARAMS_TRANSPORT_KEY' =>'SOOONER.COM', //关键参数传递加密私钥
'SYSTEM_INFO'=>array('name'=>'智慧酒店运营服务平台', 'SYSTEM_INFO'=>array('name'=>'智慧酒店运营服务平台',
'logo'=>'logo_unicom.png', 'logo'=>'logo.png',
'favicon'=>'favicon_unicom.ico'), 'favicon'=>'favicon.ico'),
//end //end
'LOG_RECORD' => false, // 开启日志记录 'LOG_RECORD' => false, // 开启日志记录
......
...@@ -5,18 +5,12 @@ class PlaylistAction extends CommonAction{ ...@@ -5,18 +5,12 @@ class PlaylistAction extends CommonAction{
public function index(){ public function index(){
$op = I('op'); $op = I('op');
if($op=="getjson"){ if($op=="getjson"){
$model = D("Region"); $model = D("Hotel");
$userInfo = $_SESSION["_USER_INFO"]; $userInfo = $_SESSION["_USER_INFO"];
$inputs = I(); $inputs = I();
$list = $model->getList("list",$userInfo,$inputs); $list = $model->getList("list",$userInfo,$inputs);
$count = $model->getList("count",$userInfo,$inputs); $count = $model->getList("count",$userInfo,$inputs);
$total = $count[0]["count"]; $total = $count[0]["count"];
foreach ($list as $key=>$value){
if($value['level']!=1)
$list[$key]['_parentId']=$value['pid'];
}
echo "{\"total\":\"".$total."\",\"rows\":".json_encode($list)."}"; echo "{\"total\":\"".$total."\",\"rows\":".json_encode($list)."}";
}else{ }else{
$spModel = D("Sp"); $spModel = D("Sp");
...@@ -31,7 +25,7 @@ class PlaylistAction extends CommonAction{ ...@@ -31,7 +25,7 @@ class PlaylistAction extends CommonAction{
$userInfo = $_SESSION["_USER_INFO"]; $userInfo = $_SESSION["_USER_INFO"];
$id = I('id','',int)?I('id','',int):0; $id = I('id','',int)?I('id','',int):0;
$model = D("Region"); $model = D("Hotel");
$spModel = D("Sp"); $spModel = D("Sp");
$regionModel = D("Region"); $regionModel = D("Region");
...@@ -40,8 +34,8 @@ class PlaylistAction extends CommonAction{ ...@@ -40,8 +34,8 @@ class PlaylistAction extends CommonAction{
$this->info = $info; $this->info = $info;
} }
$sp_lists = $spModel->where("`status`=0")->select(); $sp_lists = $spModel->where("`status`=0")->select();
$region_lists = $regionModel->where("pid = 1 and `status`=0")->select(); $region_lists = $regionModel->where("pid = 1 and level = 2 and `status`=0")->select();
$region_city_lists = $regionModel->where("pid > 1 and `status`=0")->select(); $region_city_lists = $regionModel->where("pid > 1 and level = 3 and `status`=0")->select();
$this->sp_lists = $sp_lists; $this->sp_lists = $sp_lists;
$this->region_lists = $region_lists; $this->region_lists = $region_lists;
$this->region_city_lists = $region_city_lists; $this->region_city_lists = $region_city_lists;
...@@ -49,7 +43,7 @@ class PlaylistAction extends CommonAction{ ...@@ -49,7 +43,7 @@ class PlaylistAction extends CommonAction{
} }
//添加处理 //添加处理
public function addHandle(){ public function addHandle(){
$model = D("Region"); $model = D("Hotel");
$id = I('id','',int); $id = I('id','',int);
$data['sp_id'] = I("sp_id"); $data['sp_id'] = I("sp_id");
...@@ -82,7 +76,7 @@ class PlaylistAction extends CommonAction{ ...@@ -82,7 +76,7 @@ class PlaylistAction extends CommonAction{
//删除处理 //删除处理
public function deleteHandle(){ public function deleteHandle(){
if(D("Region")->where("id=".I("id","",int))->delete()){ if(D("Hotel")->where("id=".I("id","",int))->delete()){
echo 'true'; echo 'true';
}else{ }else{
echo 'false'; echo 'false';
...@@ -91,7 +85,7 @@ class PlaylistAction extends CommonAction{ ...@@ -91,7 +85,7 @@ class PlaylistAction extends CommonAction{
//ajax修改状态 //ajax修改状态
public function updateStatusAjaxHandle(){ public function updateStatusAjaxHandle(){
$model = D("Region"); $model = D("Hotel");
$data = $_POST; $data = $_POST;
$data['updatetime'] = date('Y-m-d H:i:s'); $data['updatetime'] = date('Y-m-d H:i:s');
if($model->save($data)){ if($model->save($data)){
......
<?php
class MediaHotelModel extends RelationModel{
protected $tableName = 'sh_hotel_media_map_1'; //重新定义表名
public function getList($queryType,$userInfo,$inputs){
$p=$inputs["page"]?$inputs["page"]:1;
$n=$inputs["rows"]?$inputs["rows"]:10;
$limit = "limit ".($p-1)*$n.",".$n;
$sort="";
if($inputs["sort"])
$sort = "order by ".$inputs["sort"]." ".$inputs["order"];
//=============
$searchField = $inputs["searchField"]?$inputs["searchField"]:'title';
$searchValue = $inputs["searchValue"]?$inputs["searchValue"]:'';
$searchSp = $inputs["searchSp"]?$inputs["searchSp"]:0;
if($searchValue){
$where = " and (`title` like '%".$searchValue."%' or `code` like '%".$searchValue."%') ";
}
$model = new Model();
//======================
$fields = "count(id) count";
//返回列表(limit分页)
if($queryType=="list"){
$where .= $sort;
$fields = " *,case `_status` when 1 then '<font color=green>上线</font>' when 2 then '<font color=red>下线</font>' when 0 then '<font>未知</font>' end as `status` ";
}
$sql = "select ".$fields." from sh_media_wasu where 1=1 ".$where.";";
return $model->query($sql);
}
}
\ No newline at end of file
...@@ -30,10 +30,7 @@ ...@@ -30,10 +30,7 @@
<option value="{$item.id}">{$item.name}</option> <option value="{$item.id}">{$item.name}</option>
</volist> </volist>
</select> </select>
<select class="select" name="searchRegion"> <input class="input" type="text" placeholder="酒店名称/媒资名称" name="searchValue">
<option value="0">区域</option>
</select>
<input class="input" type="text" placeholder="酒店名称/合作方酒店标识" name="searchValue">
</div> </div>
<input id="submit_search" name="" type="button" value="查询" class="btn_go_s btn_orange" /> <input id="submit_search" name="" type="button" value="查询" class="btn_go_s btn_orange" />
</form> </form>
...@@ -68,11 +65,8 @@ onRowContextMenu : onRowContextMenu ...@@ -68,11 +65,8 @@ onRowContextMenu : onRowContextMenu
"> ">
<thead> <thead>
<tr> <tr>
<th data-options="field:'name',width:30">酒店名称</th> <th data-options="field:'hotel_name',width:30">酒店名称</th>
<th data-options="field:'sp_name',width:20" sortable="true">合作方</th> <th data-options="field:'media_name',width:20" sortable="true">媒资名称</th>
<th data-options="field:'region_name',width:30" sortable="true">区域</th>
<th data-options="field:'code',width:20">合作方酒店标识</th>
<th data-options="field:'remark',width:40">备注</th>
<th data-options="field:'addtime',width:30" sortable="true">创建时间</th> <th data-options="field:'addtime',width:30" sortable="true">创建时间</th>
<th data-options="field:'updatetime',width:30" sortable="true">更新时间</th> <th data-options="field:'updatetime',width:30" sortable="true">更新时间</th>
<th data-options="field:'status'" sortable="true" align="center">状态</th> <th data-options="field:'status'" sortable="true" align="center">状态</th>
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
<html> <html>
<head> <head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>酒店区域添加/修改</title> <title>播单添加/修改</title>
<script type="text/javascript" src="__PUBLIC__/js/bootstrap3.3.7/jquery.min.js"></script> <script type="text/javascript" src="__PUBLIC__/js/bootstrap3.3.7/jquery.min.js"></script>
<script type="text/javascript" src="__PUBLIC__/js/bootstrap3.3.7/bootstrap.min.js"></script> <script type="text/javascript" src="__PUBLIC__/js/bootstrap3.3.7/bootstrap.min.js"></script>
<script type="text/javascript" src="__PUBLIC__/js/jquery-easyui-1.3.4/jquery.easyui.min.js"></script> <script type="text/javascript" src="__PUBLIC__/js/jquery-easyui-1.3.4/jquery.easyui.min.js"></script>
...@@ -41,7 +41,7 @@ body{padding:20px} ...@@ -41,7 +41,7 @@ body{padding:20px}
</div> </div>
<div class="col-sm-3"> <div class="col-sm-3">
<select class="form-control" id="city_select" name="region_id"> <select class="form-control" id="city_select" name="region_id">
<option value="0" pid="0">请选择城市</option> <option value="0">请选择城市</option>
<volist name="region_city_lists" id="item"> <volist name="region_city_lists" id="item">
<option value="{$item.id}" class="hidden" pid="{$item.pid}">{$item.name}</option> <option value="{$item.id}" class="hidden" pid="{$item.pid}">{$item.name}</option>
</volist> </volist>
...@@ -125,8 +125,8 @@ $().ready(function(){ ...@@ -125,8 +125,8 @@ $().ready(function(){
$("select[id='province_select']").bind("change",function(){ $("select[id='province_select']").bind("change",function(){
var province_id = $(this).val(); var province_id = $(this).val();
$("select[name='region_id'] option").addClass("hidden"); $("select[name='region_id'] option").addClass("hidden");
$("select[name='region_id'] option[pid='0']").removeClass("hidden"); $("select[name='region_id'] option[value='0']").removeClass("hidden");
$("select[name='region_id'] option[value='0']").attr("selected",true); $("select[name='region_id'] option:first").prop("selected","selected");
$("select[name='region_id'] option[pid='"+province_id+"']").removeClass("hidden"); $("select[name='region_id'] option[pid='"+province_id+"']").removeClass("hidden");
}); });
......
<!DOCTYPE html> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html> <html>
<head> <head>
<meta charset="UTF-8"> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>监区管理</title> <title>播单管理</title>
<link href="__PUBLIC__/css/style_frame.css" rel="stylesheet" type="text/css" /> <link href="__PUBLIC__/css/style_frame.css" rel="stylesheet" type="text/css" />
<link rel="stylesheet" type="text/css" href="__PUBLIC__/js/jquery-easyui-1.3.4/themes/default/easyui.css"> <link rel="stylesheet" type="text/css" href="__PUBLIC__/js/jquery-easyui-1.3.4/themes/default/easyui.css">
<link rel="stylesheet" type="text/css" href="__PUBLIC__/js/jquery-easyui-1.3.4/themes/icon.css"> <link rel="stylesheet" type="text/css" href="__PUBLIC__/js/jquery-easyui-1.3.4/themes/icon.css">
...@@ -11,204 +11,184 @@ ...@@ -11,204 +11,184 @@
<script type="text/javascript" src="__PUBLIC__/js/jquery-easyui-1.3.4/locale/easyui-lang-{$language}.js"></script> <script type="text/javascript" src="__PUBLIC__/js/jquery-easyui-1.3.4/locale/easyui-lang-{$language}.js"></script>
<script type="text/javascript" src="__PUBLIC__/newVsdn/js/zDialog/zDrag.js"></script> <script type="text/javascript" src="__PUBLIC__/newVsdn/js/zDialog/zDrag.js"></script>
<script type="text/javascript" src="__PUBLIC__/newVsdn/js/zDialog/zDialog.js"></script> <script type="text/javascript" src="__PUBLIC__/newVsdn/js/zDialog/zDialog.js"></script>
<script src="__PUBLIC__/js/common/functions.js" type="text/javascript"></script> <script type="text/javascript" src="__PUBLIC__/js/common/functions.js"></script>
<script type="text/javascript" src="__PUBLIC__/js/common/md5.js"></script>
<link href="__PUBLIC__/newVsdn/css/style_frame.css" rel="stylesheet" type="text/css" /> <link href="__PUBLIC__/newVsdn/css/style_frame.css" rel="stylesheet" type="text/css" />
</head> </head>
<body> <body>
<!--搜索和按钮 开始 --> <!--搜索和按钮 开始 -->
<div class="searchBox clearfix"> <div class="searchMedia clearfix">
<div class=""> <div class="layui-tab-content">
<ul class="operationBox"> <div class="layui-tab-item layui-show">
<li class="add"> <div class="hyperchanne clearfix">
<a href="javascript:;" onclick="add()" class="on"><span></span>新增</a> <form name="searchform" method="post" action="" id ="searchform">
</li> <input type="hidden" name="op" value="getjson">
</ul> <div class="inputBox">
</div> <select class="select" name="searchType">
<option value="0">合作方</option>
<volist name="sp_lists" id="item">
<option value="{$item.id}">{$item.name}</option>
</volist>
</select>
<select class="select" name="searchRegion">
<option value="0">区域</option>
</select>
<input class="input" type="text" placeholder="酒店名称/合作方酒店标识" name="searchValue">
</div>
<input id="submit_search" name="" type="button" value="查询" class="btn_go_s btn_orange" />
</form>
</div><!--hyperchanne end-->
<div class="">
<ul class="operationBox">
<li class="add">
<a href="javascript:;" onclick="add()" class="on"><span></span>新增</a>
</li>
</ul>
</div><!--mainBox end-->
</div>
</div>
</div> </div>
<!--搜索和按钮 结束--> <!--搜索和按钮 结束-->
<table id="tg" <table id="dg" title=""
data-options=" data-options="
fitColumns: true, iconCls: 'icon-edit',
height:'auto', singleSelect: true,
url: '/Media/Playlist/index?op=getjson', url: '/Media/Playlist/index/',
method: 'get', method: 'post',
idField: 'id', pagination: true,
treeField: 'title', pageList:[15,30,45,60],
showFooter: false, rownumbers: true,
onContextMenu: onContextMenu sortName:'id',
"> sortOrder:'asc',
<thead> queryParams: form2Json('searchform'),
<tr> fitColumns: true,
<th data-options="field:'title',width:160,editor:'text'">名称</th> height:'auto',
<th data-options="field:'code',width:160,editor:'text'">代码</th> onRowContextMenu : onRowContextMenu
<th data-options="field:'postcode',width:160,editor:'text'" formatter="PostcodeAction">邮政编码</th> ">
<th data-options="field:'remark',width:240,align:'left',editor:'text'">备注</th> <thead>
<th data-options="field:'updatetime',align:'center'">更新时间</th> <tr>
<th data-options="field:'status',align:'center'">状态</th> <th data-options="field:'name',width:30">酒店名称</th>
<th field="action" align="center" formatter="InputAction">操作</th> <th data-options="field:'sp_name',width:20" sortable="true">合作方</th>
</tr> <th data-options="field:'region_name',width:30" sortable="true">区域</th>
</thead> <th data-options="field:'code',width:20">合作方酒店标识</th>
<th data-options="field:'remark',width:40">备注</th>
<th data-options="field:'addtime',width:30" sortable="true">创建时间</th>
<th data-options="field:'updatetime',width:30" sortable="true">更新时间</th>
<th data-options="field:'status'" sortable="true" align="center">状态</th>
<th field="action" align="center" formatter="InputAction">操作</th>
</tr>
</thead>
</table> </table>
<div id="mm1" class="easyui-menu" style="width:120px;">
<div onclick="edit()" data-options="iconCls:'icon-edit'" {:buttonAuth('Media','Playlist','add')}>修改</div> <div id="mm1" class="easyui-menu" style="width:120px;display: none">
<div onclick="del()" data-options="iconCls:'icon-cancel'" {:buttonAuth('Media','Playlist','deleteHandle')}>删除</div> <div iconCls="icon-edit" id="menuEdit" onclick="edit()" {:buttonAuth('Media','Playlist','add')}>编辑</div>
<div class="menu-sep"></div> <div iconCls="icon-cancel" id="menuDel" onclick="del()" {:buttonAuth('Media','Playlist','deletehandle')}>删除</div>
<div iconCls="icon-stop" id="menuStop" onclick="enable(0)" {:buttonAuth('Media','Playlist','updateStatusAjaxHandle')}>禁用</div>
<div iconCls="icon-start" id="menuStart" onclick="enable(1)" {:buttonAuth('Media','Playlist','updateStatusAjaxHandle')}>启用</div>
<div class="menu-sep"></div> <div class="menu-sep"></div>
<div onclick="collapse()">收起</div> <div iconCls="icon-stop" id="menuStop" onclick="enable(1)" {:buttonAuth('Media','Playlist','updateStatusAjaxHandle')}>禁用</div>
<div onclick="expand()">展开</div> <div iconCls="icon-start" id="menuStart" onclick="enable(0)" {:buttonAuth('Media','Playlist','updateStatusAjaxHandle')}>启用</div>
</div> </div>
<div id="mm2" class="easyui-menu" style="width:120px;"> <div id="mm2" class="easyui-menu" style="width:120px;display: none">
<div onclick="edit()" data-options="iconCls:'icon-edit'" {:buttonAuth('Media','Playlist','add')}>修改</div> <div iconCls="icon-edit" id="menuEdit" onclick="edit()" {:buttonAuth('Media','Playlist','add')}>编辑</div>
<div onclick="del()" data-options="iconCls:'icon-cancel'" {:buttonAuth('Media','Playlist','deleteHandle')}>删除</div> <div iconCls="icon-cancel" id="menuDel" onclick="del()" {:buttonAuth('Media','Playlist','deletehandle')}>删除</div>
<div class="menu-sep"></div>
<div iconCls="icon-stop" id="menuStop" onclick="enable(0)" {:buttonAuth('Media','Playlist','updateStatusAjaxHandle')}>禁用</div>
<div iconCls="icon-start" id="menuStart" onclick="enable(1)" {:buttonAuth('Media','Playlist','updateStatusAjaxHandle')}>启用</div>
<div class="menu-sep"></div> <div class="menu-sep"></div>
<div onclick="collapse()">收起</div> <div iconCls="icon-stop" id="menuStop" onclick="enable(1)" {:buttonAuth('Media','Playlist','updateStatusAjaxHandle')}>禁用</div>
<div onclick="expand()">展开</div> <div iconCls="icon-start" id="menuStart" onclick="enable(0)" {:buttonAuth('Media','Playlist','updateStatusAjaxHandle')}>启用</div>
</div> </div>
<script type="text/javascript"> <script type="text/javascript">
function InputAction(value, rowData) { function onRowContextMenu(e, rowIndex, rowData){
return'<a href="javascript:void(0)" id="mb' + rowData.id + '" class="easyui-menubutton" menu="#mm1" iconCls="icon-list" onmouseover="setSelectRow(' + rowData.id + ')">'+this.title+'</a>'; e.preventDefault();
$('#dg').datagrid('unselectAll');
$('#dg').datagrid('selectRow', rowIndex);
$('#mm2').menu('show', {
left:e.pageX,
top:e.pageY
});
} }
function PostcodeAction(value, rowData){ function InputAction(value, row, index) {
if(value!=0){ return'<a href="javascript:void(0)" id="mb' + index + '" class="easyui-menubutton" menu="#mm1" iconCls="icon-list" onmouseover="setSelectRow(' + index + ')">'+this.title+'</a>';
if(value.length==5){
return "0"+value;
}else{
return value;
}
}
} }
function setSelectRow(rowId) {
editIndex = undefined; function setSelectRow(index) {
$('#tg').treegrid('unselectAll'); $('#dg').datagrid('unselectAll');
$('#tg').treegrid('select', rowId); $('#dg').datagrid('selectRow', index);
} }
//菜单初始化 //初始化菜单按钮
$(function(){ $(function(){
$('#tg').treegrid({ $('#dg').datagrid({
onLoadSuccess: function (row,data) { onLoadSuccess: function (data) {
$.each(data.rows, function (i, val) { for (i = 0; i < $('#dg').datagrid('getRows').length; i++) {
$('#mb' + val.id).menubutton(); $('#mb' + i).menubutton();
}); }
} }
}); })
}); });
function add(){
pop(800,600,true,'tg','treegrid','/Media/Playlist/add');
}
function edit(){
var Media = $('#tg').treegrid('getSelected');
if (Media){
pop(800,320,true,'tg','treegrid','/Media/Playlist/add/id/'+Media.id);
}
}
function del(){
var Media = $('#tg').treegrid('getSelected');
if (Media){
$.messager.confirm('操作确认', '确认[删除]该记录?', function(r){
if (r){
$.post("/Media/Playlist/deleteHandle/", {id:Media.id},
function(data){
$('#tg').treegrid('reload');
});
}
});
}
}
//禁用启用 //禁用启用
function enable(status){ function enable(status){
var Media = $('#tg').treegrid('getSelected'); var row = $('#dg').datagrid('getSelected');
if (Media){ if (row){
var msg='禁用'; var msg='启用';
if(status==1) if(status==1)
msg='启用' msg='禁用'
$.messager.confirm('操作确认', '确认['+msg+']该记录?', function(r){ $.messager.confirm('操作确认', '确认['+msg+']该记录?', function(r){
if (r){ if (r){
$.post("/Media/Playlist/updateStatusAjaxHandle/", {id:Media.id,status:status}, $.post("/Media/Playlist/updateStatusAjaxHandle/", {id:row.id,status:status},
function(data){ function(data){
$('#tg').treegrid('reload'); $('#dg').datagrid('reload');
}); });
} }
}); });
}else{ }else{
$.messager.alert('提示', '请选择要操作的记录!','info'); $.messager.alert('提示', '请选择要操作的记录!','info');
} }
}
function collapse(){
var Media = $('#tg').treegrid('getSelected');
if (Media){
$('#tg').treegrid('collapse', Media.id);
}
} }
function expand(){ function add(){
var Media = $('#tg').treegrid('getSelected'); pop(800,450,true,'dg','datagrid','/Media/Playlist/add/')
if (Media){
$('#tg').treegrid('expand', Media.id);
}
}
var editIndex = undefined;
function endEditing(){
if (editIndex == undefined){return true}
if ($('#tg').treegrid('validateRow', editIndex)){
var json = getEditRowJson('tg',editIndex);
json.id = editIndex;
$.post("/Media/Playlist/updateAjaxHandle/", json,
function(data){
$('#tg').treegrid('endEdit', editIndex);
$('#mb' + editIndex).menubutton();
editIndex = undefined;
return true;
});
} else {
return false;
}
}
function onClickRow(row){
var index = row.id
if (editIndex != index){
if (endEditing()){
$('#tg').treegrid('select', index).treegrid('beginEdit', index);
editIndex = index;
} else {
$('#tg').treegrid('select', editIndex);
}
}
} }
//将表单数据转为json function edit(){
function getEditRowJson(gridId,editingId) { var row = $('#dg').datagrid('getSelected');
var editors = $('#'+gridId).treegrid('getEditors', editingId); if (row){
var jsonStr = ""; pop(800,450,true,'dg','datagrid','/Media/Playlist/add/id/'+row.id);
jsonStr += '{'; }else{
for (var i = 0; i < editors.length; i++) { $.messager.alert('提示', '请选择要操作的记录!','info');
jsonStr += '"' + editors[i].field + '":"' + editors[i].target.val() + '",' }
}
jsonStr = jsonStr.substring(0, (jsonStr.length - 1));
jsonStr += '}'
var json = JSON.parse(jsonStr)
return json
} }
function onContextMenu(e,row){ function del(){
e.preventDefault(); var row = $('#dg').datagrid('getSelected');
setSelectRow(row.id); if (row){
$('#mm2').menu('show',{ $.messager.confirm('操作确认', '确认[删除]该记录?', function(r){
left: e.pageX, if (r){
top: e.pageY $.post("/Media/Playlist/deleteHandle/", {id:row.id},
}); function(data){
$('#dg').datagrid('reload');
});
}
});
}else{
$.messager.alert('提示', '请选择要操作的记录!','info');
}
} }
$("#submit_search").click(function () {
$('#dg').datagrid({ queryParams: form2Json("searchform") }); //点击搜索
});
/**
* JQuery扩展方法,用户对JQuery EasyUI的DataGrid控件进行操作。
*/
$.fn.extend({ $.fn.extend({
/** /**
* 修改DataGrid对象的默认大小,以适应页面宽度。
*
* @param heightMargin * @param heightMargin
* 高度对页内边距的距离。
* @param widthMargin * @param widthMargin
* 宽度对页内边距的距离。
* @param minHeight * @param minHeight
* 最小高度。
* @param minWidth * @param minWidth
* 最小宽度。
*
*/ */
resizeDataGrid : function(heightMargin, widthMargin, minHeight, minWidth) { resizeDataGrid : function(heightMargin, widthMargin, minHeight, minWidth) {
var height = $(document.body).height() - heightMargin; var height = $(document.body).height() - heightMargin;
...@@ -225,10 +205,15 @@ $.fn.extend({ ...@@ -225,10 +205,15 @@ $.fn.extend({
}); });
$(function() { $(function() {
var datagridId = 'tg'; // datagrid数据表格ID
$('#' + datagridId).resizeDataGrid(0, 20, 400, 0); var datagridId = 'dg';
// 第一次加载时自动变化大小
$('#' + datagridId).resizeDataGrid(0, 10, 0, 0);
// 当窗口大小发生变化时,调整DataGrid的大小
$(window).resize(function() { $(window).resize(function() {
$('#' + datagridId).resizeDataGrid(0, 20, 400, 0); $('#' + datagridId).resizeDataGrid(0, 10, 0, 0);
}); });
}); });
</script> </script>
......
SooonerHotel/favicon_unicom.ico

7.08 KB | W: | H:

SooonerHotel/favicon_unicom.ico

4.19 KB | W: | H:

SooonerHotel/favicon_unicom.ico
SooonerHotel/favicon_unicom.ico
SooonerHotel/favicon_unicom.ico
SooonerHotel/favicon_unicom.ico
  • 2-up
  • Swipe
  • Onion skin
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment