| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110 |
- @using VberAdmin.Web.Models.Input
- @using VberAdmin.Web.Models.Modals
- @using VberAdmin.Web.Models.Search
- @using VberAdmin.Web.Models.Table
- @using VberZero
- @using VberZero.Tools.StringModel
- @{
- string activeMenu = PermissionNames.VberSystemMgHelpMg; //The menu item will be active for this page.
- ViewBag.ActiveMenu = activeMenu;
- string helpType = ViewBag.HelpType, menus = ViewBag.FunctionMenu;
- }
- @{
- /**/
- ViewBag.Title = "系统帮助管理";
- var table = new VmTable(VzConsts.ApiAppUrl + "Help/GetAll", activeMenu, new VmSearch(new List<VmSearchItem>()
- {
- new VmSearchItem("helpType", "帮助类别").WithExpType(EType.Equal).WithSelect(helpType)
- })).AddItems(new List<VmTableItem>()
- {
- new VmTableItem("title", "标题"),
- new VmTableItem("keyWords", "关键字信息"),
- new VmTableItem("helpType", "帮助类别", "HelpTypeFormatter"),
- new VmTableItem("functionDisplayName", "功能菜单"),
- new VmTableItem("sequence", "排序"),
- });
- var modalBody = new VmModalBody()
- .AddInputs(new List<VmInputBase>
- {
- new VmInputHidden("id"),
- })
- .AddGroup(new List<VmInputBase>
- {
- new VmInput("title", "标题").WithRequired(),
- new VmInput("keyWords", "关键字").WithRequired(),
- new VmInputNumber("sequence", "序列").WithRequired(),
- })
- .AddGroup(new List<VmInputBase>
- {
- new VmInput("helpType", "帮助类别").WithSelect(helpType).WithRequired(),
- new VmInput("functionNo", "功能菜单").WithSelect(menus,isTree:true).WithRequired(),
- })
- .AddInput(new VmInputWangEditor("content", "帮助内容"));
- /*.AddGroup(new VmInputGroup().WithAverage(2).AddInputs(new List<VmInputBase>
- {
- }));*/
- var modal = new VmModal().WithHeaderAndFooter("帮助", "").WithBody(modalBody);
- }
- @await Html.PartialAsync("_Table", table)
- @await Html.PartialAsync("_Modal", modal)
- @section scripts
- {
- <script type="text/javascript">
- $(function () {
- var $table = $('#table');
- var funs = LoadTable();
- funs["btnCreate"] = function(url) {
- BtnCreate({
- url: url,
- data: { helpType: "@(VzDefinition.HelpType.System.ToStr())"}
- });
- };
-
- funs["btnUpdate"] = function(url) {
- var row = $table.VbTable("getSelection");
- if (row) {
- $.vbAjax4({
- url: abp.appUrl + "Query/QueryHelpDto?id=" + row.id,
- success: function(data) {
-
- BtnUpdate({
- url: url
- },
- data);
- }
- });
- }
- };
- });
- </script>
- <script>
- function HelpTypeFormatter(v) {
- var name = $('#hid-helpType option[value="' + v + '"]').text();
- switch (v) {
- case @(VzDefinition.HelpType.System.ToInt()):
- return '<span class="badge badge-light-danger">' + name + '</span>';
- case @(VzDefinition.HelpType.Business.ToInt()):
- return '<span class="badge badge-light-success">' + name + '</span>';
- case @(VzDefinition.HelpType.Instructions.ToInt()):
- return '<span class="badge badge-light-primary">' + name + '</span>';
- default:
- break;
- }
- return v;
- }
- </script>
- }
- <section style="display: none">
- <select id="hid-helpType">@Html.Raw(helpType)</select>
- </section>
|