Former-commit-id: a9fb871d5e80aa1219148a8a3c93c0eae8711d7e
Former-commit-id: 31163043f7fcf5a6c73daf7aa7f916a9ee159637
1.0
wanggang 5 years ago
parent 3edf93ad4c
commit fbe3646757

@ -84,10 +84,7 @@ namespace TeacherExt.Controllers
row.CreateCell(++colIndex).SetStyle(style).SetType(CellType.String).SetCellValue(teacher.UserType);
row.CreateCell(++colIndex).SetStyle(style).SetType(CellType.String).SetCellValue(teacher.RealName);
row.CreateCell(++colIndex).SetStyle(style).SetType(CellType.String).SetCellValue(teacher.Sex);
if(teacher.Birthday.HasValue)
{
row.CreateCell(++colIndex).SetStyle(style).SetType(CellType.String).SetCellValue(teacher.Birthday.Value.ToString("yyyy-MM"));
}
row.CreateCell(++colIndex).SetStyle(style).SetType(CellType.String).SetCellValue(teacher.Birthday.HasValue ? teacher.Birthday.Value.ToString("yyyy-MM") : string.Empty);
}
}

@ -17,7 +17,7 @@
var prefix = new ViewDataDictionary(this.ViewData);
prefix.TemplateInfo.HtmlFieldPrefix = "Query";
}
<form action="@Url.Action(null,null)" method="post" class="form-horizontal query">
<form action="@Url.Action(null,null)" method="get" class="form-horizontal query">
<div class="card">
<div class="card-header">
<div class="row">
@ -25,7 +25,7 @@
</div>
<div class="row">
<div class="col-12">
<button type="submit" class="action query btn btn-primary cancel" data-action="@Url.Action(null,null)">
<button type="submit" id="query" class="btn btn-primary" data-action="@Url.Action(null,null)">
查询
</button>
<a class="btn btn-success" href="@Url.Action("Add")">
@ -46,7 +46,7 @@
<button type="submit" class="action confirm btn btn-danger" data-action="@Url.Action("Delete")">
删除
</button>
<a class="btn btn-primary" href="@Url.Action("Export")" target="_blank">导出</a>
<button type="button" id="export" class="btn btn-primary" data-action="@Url.Action("Export")" >导出</button>
</div>
</div>
</div>
@ -107,4 +107,4 @@
</form>
@section scripts{
@(await Html.PartialAsync("_Script"))
}
}

@ -70,4 +70,15 @@
$("[data-my-group='HasPosition12']").parents('.@cls').show();
}
});
</script>
<script>
$('form.query').validate().currentForm = '';
$('#query').click(function () {
var url = $(this).attr('data-action') + '?' + $(this).parents('form').find('input,select').not('[value=""]').serialize();
window.location.href = url;
});
$('#export').click(function () {
var url = $(this).attr('data-action') + '?' + $(this).parents('form').find('input,select').not('[value=""]').serialize();
window.open(url);
});
</script>
Loading…
Cancel
Save