tijian_tieying/web/dccdc/Views/Infection/Repository.cshtml
2025-02-20 12:14:39 +08:00

134 lines
4.8 KiB
Plaintext

@{
ViewBag.Title = "知识库";
}
<div style="width:100%">
<table class="t1" style="width:100%">
<tr>
<td class="ltd" style="width:100px">标题:</td>
<td class="rtd" style="width:160px"><input type="text" id="RepositoryTitle" class="l-text" /></td>
<td class="ltd" style="width:100px">开始时间:</td>
<td class="rtd" style="width:160px"><input type="text" id="RepositoryStart"/></td>
<td class="ltd" style="width:100px">结束时间:</td>
<td class="rtd" style="width:160px"><input type="text" id="RepositoryEnd" /></td>
<td class="rtd"><div id="search">查询</div></td>
</tr>
</table>
</div>
<div id="checkRepositoryList" style="width:100%"></div>
@section scripts{
<script type="text/javascript">
$(function () {
$("#RepositoryStart").ligerDateEditor({ showTime: false });
$("#RepositoryEnd").ligerDateEditor({ showTime: false });
});
$(function () {
$("#search").ligerButton({
click: function () {
liger.get("checkRepositoryList").set("parms", { title: $("#RepositoryTitle").val(), start: $("#RepositoryStart").val(), end: $("#RepositoryEnd").val() });
liger.get("checkRepositoryList").changePage("first");
liger.get("checkRepositoryList").reload();
}
});
var manager = $("#checkRepositoryList").ligerGrid({
url: "@Url.Action("getRepositoryList")",
title: "知识库列表",
parms: { },
columns: [
{ name: "id", id:"id", display: "id", width: 100, align: "center" },
{ name: "title", display: "标题", width: 100, align: "center" },
{ name: "address", display: "图片地址", width: 200, align: "center" },
{ name: "content", display: "内容", width: 200, align: "center" },
{ name: "create_time", display: "创建时间", width: 100, align: "center" }
],width: "98%",
height: "100%",
rownumbers: true,
usePager: true,
toolbar: {
items: [
{ text: '添加', click: add, icon: 'add' },
{ line: true },
{ text: '修改', click: modify, icon: 'edit' },
{ line: true },
{ text: '详情', click: details, icon: 'edit' },
{ line: true },
{ text: '删除', click: del, icon: 'delete' }
]
},
heightDiff: -20
});
manager.toggleCol("id", false);
});
function add()
{
openf = $.ligerDialog.open({
url: "RepositoryAdd",
title: "数据添加",
width:800,
height:600
});
}
function modify() {
var r = liger.get("checkRepositoryList").getSelectedRow();
if (!r) {
$.ligerDialog.warn("请选择数据!");
return;
}
var id = r.id;
openf = $.ligerDialog.open({
url: "RepositoryModify?id="+id,
title: "数据修改",
width:800,
height:600
});
}
function details() {
var r = liger.get("checkRepositoryList").getSelectedRow();
if (!r) {
$.ligerDialog.warn("请选择数据!");
return;
}
var id = r.id;
openf = $.ligerDialog.open({
url: "RepositoryDetails?id="+id,
title: "数据详情",
width: 800,
height: 600
});
}
function del()
{
var r = liger.get("checkRepositoryList").getSelectedRow();
if (!r) {
$.ligerDialog.warn("请选择数据!");
return;
}
var id = r.id;
$.ajax(
{
url: "@Url.Action("deleteRepository")", type: "post", dataType: "json", data: { id: id },
success: function (d) {
$.ligerDialog.alert(d.Message, function () {
if (d.State == 1) {
liger.get("checkRepositoryList").reload();
}
});
}
});
}
function init() {
liger.get("checkRepositoryList").reload();
$("#checkRepositoryList").ligerDateEditor();
openf.close();
}
</script>
}