92 lines
3.1 KiB
Plaintext
92 lines
3.1 KiB
Plaintext
@using WX.CRM.WebHelper
|
||
@{
|
||
ViewBag.Title = "清除缓存";
|
||
Layout = "~/Views/Shared/_Index_Layout2.cshtml";
|
||
}
|
||
|
||
<div class="mvctool">
|
||
@Html.ToolButton("btnQuery", "icon-search", "查询", true)
|
||
@Html.Action("ToolBar", "Control", ViewBag.ToolBar as ToolBar)
|
||
</div>
|
||
<div class="bas_datagrid">
|
||
<div id="tb" style="padding:5px;height:auto" class="grid_toolbar">
|
||
<ul class="toolBar_ul">
|
||
<li>名称或者描述:<input type="text" name="txt_cacheKey" /> </li>
|
||
</ul>
|
||
</div>
|
||
@Html.Raw(ViewBag.gridTable)
|
||
</div>
|
||
<script type="text/javascript">
|
||
$(function () {
|
||
$('#tablist').tablegrid({
|
||
url: '/Base/Sys/GetCaheHtmlList',
|
||
height: $(window).height() - 100,
|
||
loadNow: true,
|
||
isCheckMore: true
|
||
});
|
||
$(window).resize(function () {//自动适应大小
|
||
$('#tablist').tablegrid('resize', {
|
||
height: $(window).height() - 100
|
||
});
|
||
});
|
||
$("#btnQuery").click(function () {//搜索按钮点击事件
|
||
$('#tablist').tablegrid("Search");
|
||
});
|
||
});
|
||
function frameReturnByMes(mes) {
|
||
$.messageBox5s('提示', mes);
|
||
}
|
||
</script>
|
||
|
||
@*ToolBar事件处理*@
|
||
<script type="text/javascript">
|
||
function DeleteCache_Click() {
|
||
var row = $('#tablist').tablegrid('getSelected');
|
||
if (row != null) {
|
||
$.messager.confirm('提示', '@Suggestion.YouWantToDeleteTheSelectedRecords', function (r) {
|
||
if (r) {
|
||
$.r_post("/Base/Sys/DeleteChache?CacheKey=" + GetKey(), function (data) {
|
||
if (data.type != 1) {
|
||
$.messageBox5s('提示', data.message);
|
||
} else {
|
||
$.messageBox5s('提示', "缓存清除成功!");
|
||
$('#tablist').tablegrid("Load");
|
||
}
|
||
}, "json");
|
||
}
|
||
});
|
||
} else { $.messageBox5s('提示', '@Suggestion.PlaseChooseToOperatingRecords'); }
|
||
|
||
|
||
|
||
}
|
||
function Reload_Click() {
|
||
$('#tablist').tablegrid("Load");
|
||
}
|
||
//获取员工ID (获取被选中的员工ID)
|
||
function GetKey() {
|
||
var selects = $("#tablist").tablegrid("getSelections");
|
||
var pkids = "";
|
||
$(selects).each(function (i, n) {
|
||
pkids += "" + n.CacheKey + ",";
|
||
});
|
||
if (pkids.length > 0)
|
||
pkids = pkids.substr(0, pkids.length - 1);
|
||
return pkids;
|
||
}
|
||
document.onkeydown = function (event) {
|
||
var e = event || window.event || arguments.callee.caller.arguments[0];
|
||
if (location.toString().indexOf('CacheIndex') > 0 && e.ctrlKey && e.keyCode == 116) { //这里最好用keycode可以无视大小写,你要是区分大小写最好这样写
|
||
console.log('ctrl+f5');
|
||
e.preventDefault();
|
||
$.r_post("/Cache/DeleteCache", function (data) {
|
||
debugger
|
||
$.messageBox5s('提示', "缓存清除成功!");
|
||
return false;
|
||
}, "json");
|
||
|
||
}
|
||
|
||
}
|
||
</script>
|