123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102 |
- @using WeApp
- @using WeApp.Configuration
- @using WeApp.Authorization
- @using WeApp.Views.Shared.Modals
- @using WeApp.Views.Shared.SearchForm
- @using WeApp.Views.Shared.Table
- @{
- ViewBag.Title = "培训营分组维护";
- string activeMenu = PermissionNames.PagesTrainMgGroupMg;
- ViewBag.ActiveMenu = PermissionNames.PagesTrainMgCampMg;
- string campNo = ViewBag.CampNo, state = ViewBag.State;
- var searchForm = new SearchFormViewModel(new List<SearchItem>()
- {
- },"search-form",false);
- var table = new TableViewModel(IwbConsts.ApiAppUrl + "CampGroup/GetAll", activeMenu, searchForm)
- .SetFields(new List<FieldItem>()
- {
- new FieldItem("name", "分组名称"),
- new FieldItem("campName", "培训营"),
- new FieldItem("campGroupState", "培训营分组状态","StateFormatter"),
- new FieldItem("startDate", "开始时间","DateTimeFormatter"),
- new FieldItem("engDate", "结束时间","DateTimeFormatter"),
- new FieldItem("trainingMinute", "演练时长"),
- });
- }
- @section css{
-
- }
- @Html.Partial("Table/_Table", table)
- @section modal{
- <!--Main Modal-->
- @{
- var modal = new ModalViewModel("分组", new ModalBodyViewModel(new List<Input>()
- {
- new InputHide("id"),
- new InputHide("campNo"),
- new Input("name", "分组名称"),
- }));
- }
- @Html.Partial("Modals/_Modal", modal)
- }
- @section scripts
- {
- <script type="text/javascript">
- var $table,campNo='@(campNo)';
- $(function () {
- $table = LoadTable({
- searchList: [{KeyWords: campNo,KeyField: 'campNo',FieldType: '0',ExpType: '0'}]
- });
- var funs = window.iwbfuns || { none: function () { console.log("No type"); } };
- funs["btnCreate"] = function () { BtnCreate({ data: { id: "", campNo: campNo } }); }
- funs["btnUpdate"] = function () { BtnUpdate({ disabled: "" }); };
- });
- </script>
- <!--格式化-->
- <script id="formatter-script" type="text/javascript">
- function TypeFormatter(v) {
- var name = $('#hid-type option[value="' + v + '"]').text();
- switch (v) {
- case 0:
- return '<span class="label label-danger">' + name +'</span>';
- default:
- return '<span class="label label-info">' + name +'</span>';
- }
- }
- function StateFormatter(v) {
- var name = $('#hid-state option[value="' + v + '"]').text();
- switch (v) {
- case @(CampGroupStateDefinition.New):
- return '<span class="label label-info">' + name + '</span>';
- case @(CampGroupStateDefinition.Run):
- return '<span class="label label-iwb">' + name + '</span>';
- case @(CampGroupStateDefinition.Error):
- case @(CampGroupStateDefinition.End):
- return '<span class="label label-danger">' + name + '</span>';
- default:
- return '<span class="label label-warning">其他</span>';
- }
- }
- </script>
- }
- <section style="display: none">
- <select id="hid-type">
- <option value=""></option>
- </select>
- <select id="hid-state">
- @(Html.Raw(state))
- </select>
- @*@Html.DropDownList("hid-type", type)*@
- </section>
|