113 lines
3.8 KiB
Plaintext
113 lines
3.8 KiB
Plaintext
@{ViewBag.Title = "参数维护"; }
|
|
|
|
<div class="l-clear"></div>
|
|
<div style="margin:10px">
|
|
<label>参数名称</label>
|
|
<input id="paramName" />
|
|
<label>参数值</label>
|
|
<input id="paramValue" />
|
|
<label>参数说明</label>
|
|
<input id="paramRemark"/>
|
|
<button id="btnSearch">查询</button>
|
|
</div>
|
|
<div id="maingrid"></div>
|
|
<div style="display:none;">
|
|
</div>
|
|
|
|
@section scripts{
|
|
|
|
<script type="text/javascript">
|
|
var openf;
|
|
function edit(item) {
|
|
var id;
|
|
if (item.text === "删除") {
|
|
var r1 = liger.get("maingrid").getSelectedRow();
|
|
if (!r1) {
|
|
$.ligerDialog.alert("请选择要删除的数据!");
|
|
return;
|
|
} else {
|
|
$.ajax({
|
|
url: "@Url.Action("delParamResult")", type: "post", dataType: "json", data: { id: r1.id },
|
|
success: function (d) {
|
|
$.ligerDialog.closeWaitting();
|
|
$.ligerDialog.alert(d.Message, function () {
|
|
if (d.State == 1) {
|
|
liger.get("maingrid").reload();
|
|
return;
|
|
}
|
|
});
|
|
},
|
|
beforeSend: function () {
|
|
$.ligerDialog.waitting("正在保存请稍后……");
|
|
}
|
|
});
|
|
}
|
|
}
|
|
else {
|
|
if (item.text === "增加") {
|
|
id = "";
|
|
}
|
|
else if (item.text === "修改") {
|
|
var r = liger.get("maingrid").getSelectedRow();
|
|
if (!r) {
|
|
$.ligerDialog.alert("请选择要修改的数据!");
|
|
return;
|
|
}
|
|
id = r.id;
|
|
}
|
|
openf= $.ligerDialog.open({
|
|
url: "@Url.Action("EditParm")?id=" + id,
|
|
title: item.text,
|
|
width: 380,
|
|
height: 200
|
|
});
|
|
}
|
|
}
|
|
function init() {
|
|
liger.get("maingrid").reload();
|
|
openf.close();
|
|
}
|
|
$(function() {
|
|
|
|
$("#maingrid").ligerGrid({
|
|
height: '100%',
|
|
columns: [
|
|
{ display: 'ID', name: 'id', align: 'left', width: 100, minWidth: 60 },
|
|
{ display: '参数名称', name: 'parm_name', align: 'left', width: 200, minWidth: 60 },
|
|
{ display: '参数值', name: 'Parm_value', align: 'left', width: 500, minWidth: 60 },
|
|
{ display: '参数说明', name: 'Parm_remarks', width: 200, minWidth: 120 }
|
|
],
|
|
url: "@Url.Action("GetPramList")",
|
|
pageSize: 30,
|
|
rownumbers: true,
|
|
fixedCellHeight: false,
|
|
toolbar: {
|
|
items: [
|
|
{ text: '增加', click: edit, icon: 'add' },
|
|
{ line: true },
|
|
{ text: '修改', click: edit, icon: 'modify' },
|
|
{ line: true },
|
|
{ text: '删除', click: edit, icon: 'delete' }
|
|
]
|
|
}
|
|
});
|
|
});
|
|
|
|
//查询方法
|
|
$("#btnSearch").ligerButton({
|
|
click: function () {
|
|
liger.get("maingrid").set("parms", {
|
|
strParamName: $("#paramName").val(),
|
|
strParamValue: $("#paramValue").val(),
|
|
strParamRemark: $("#paramRemark").val() });
|
|
liger.get("maingrid").changePage("first");
|
|
liger.get("maingrid").reload();
|
|
}
|
|
});
|
|
</script>
|
|
}
|
|
|
|
|
|
|
|
|