@{
|
ViewBag.Title = "前台管理";
|
Layout = "~/Views/Shared/Master.cshtml";
|
}
|
<script>
|
var viewModel;
|
$(function () {
|
viewModel = new myViewModel_Menus(@Html.Raw(Json.Encode(Model)));
|
ko.applyBindings(viewModel, $(".container")[0]);
|
})
|
function myViewModel_Menus(data)
|
{
|
var self = this;
|
ko.mapping.fromJS(data, mapping, self)
|
}
|
var mapping = {
|
'MenusList': {
|
create: function (options) {
|
return new MenusList(options.data);
|
}
|
}
|
}
|
function MenusList(data) {
|
console.log(data)
|
var self = this;
|
self.Detailed = function () {
|
|
window.location.href = "@Url.Action("ViewDetailed", "Backstage")" + "?MenuId=" + self.Id();
|
}
|
ko.mapping.fromJS(data, {}, self)
|
|
}
|
</script>
|
<div class="container">
|
<div class="row" style="border-bottom:solid #ebe6e6">
|
<p> 质评系统 >> 前台管理 </p>
|
</div>
|
<div class="row">
|
|
<table class="table table-bordered">
|
|
<thead>
|
<tr style="background:#0094ff">
|
<th style="text-align:center">菜单</th>
|
<th style="text-align:center">操作</th>
|
|
</tr>
|
</thead>
|
<tbody data-bind="foreach:MenusList">
|
<tr>
|
<td style="text-align:center" data-bind="text:Name"></td>
|
<td style="text-align:center">
|
<span>
|
<button type="button" class="btn btn-info btn-xs" data-bind="click:Detailed">
|
查看
|
</button>
|
</span>
|
</td>
|
|
</tr>
|
</tbody>
|
</table>
|
</div>
|
</div>
|
|