mirror of
https://github.com/dotnetcore/Util.git
synced 2026-10-29 11:36:32 +08:00
60 lines
2.8 KiB
Plaintext
60 lines
2.8 KiB
Plaintext
<%@ Template Language="C#" TargetLanguage="C#" Debug="True" Encoding="UTF-8" %>
|
|
|
|
<%@ Assembly Src="..\..\..\Common\Model.cs" %>
|
|
<%@ Assembly Src="..\..\..\Common\Extensions.cs" %>
|
|
|
|
<%@ Register Name="TreeIndexView" Template="TreeIndexView.cst" MergeProperties="False" ExcludeProperties="" %>
|
|
|
|
<%@ Import Namespace="System.Collections.Generic" %>
|
|
<%@ Import Namespace="System.Linq" %>
|
|
<%@ Import Namespace="System.Text" %>
|
|
<%@ Import Namespace="System.Text.RegularExpressions" %>
|
|
<%@ Import Namespace="SchemaMapper" %>
|
|
|
|
<%@ Property Name="Entity" Type="SchemaMapper.Entity" %>
|
|
<%@ Property Name="Namespace" Type="System.String" %>
|
|
<%-- Safe类名 --%>
|
|
<% string SafeClassName = Entity.ClassName.ToSafeName(); %>
|
|
<%-- 描述 --%>
|
|
<% string Description = Entity.Description; %>
|
|
<%-- 驼峰形式类名 --%>
|
|
<% string CamelClassName = SafeClassName.ToCamelCase(); %>
|
|
<%-- 如果是树型实体,则调用子模板 --%>
|
|
<%
|
|
if( Entity.IsTreeEntity() ){
|
|
CodeTemplate template =new TreeIndexView();
|
|
template.SetProperty("Namespace",Namespace);
|
|
template.SetProperty("Entity",Entity);
|
|
//template.Render(this.Response);
|
|
//return;
|
|
}
|
|
%>
|
|
@page
|
|
@model <%=SafeClassName%>Dto
|
|
<page-header title="<%=Description%>"></page-header>
|
|
<util-card show-border="false">
|
|
@*查询表单*@
|
|
<partial name="Index.Query"/>
|
|
@*工具按钮*@
|
|
<util-a class="mr-sm" color="Primary" icon="Plus" text="新建" link="create"></util-a>
|
|
<util-button id="btnDelete" color="Danger" icon="Delete" text="删除" on-click="delete(btnDelete)"></util-button>
|
|
@*提示语*@
|
|
<util-alert class="my-md" type="Info" show-icon="true">
|
|
已选择<strong class="text-primary mx-md">{{getCheckedLength()}}</strong>行
|
|
</util-alert>
|
|
@*表格*@
|
|
<util-table id="table<%=SafeClassName%>" query-param="queryParam" base-url="<%=CamelClassName%>" <% if( Entity.Properties.Any( t => t.ColumnName == "CreationTime" ) ) { %>sort="CreationTime desc"<% } %>>
|
|
<util-table-column type="Checkbox"></util-table-column>
|
|
<util-table-column type="LineNumber"></util-table-column>
|
|
<% foreach(Property p in Entity.Properties) { %>
|
|
<% if( p.IsPrimaryKey.SafeValue() ) continue; %>
|
|
<% if( Entity.IsHidden(p) ) continue; %>
|
|
<util-table-column for="<%= p.PropertyName.ToSafeName() %>"></util-table-column>
|
|
<% } %>
|
|
<util-table-column title="操作">
|
|
<util-a class="mr-sm" color="Primary" shape="Circle" icon="Edit" tooltip="编辑" bind-link="['edit',row.id]"></util-a>
|
|
<util-button class="mr-sm" color="Danger" shape="Circle" icon="Delete" tooltip="删除" on-click="delete(null,row.id)"></util-button>
|
|
<util-a shape="Circle" icon="Eye" tooltip="详情" bind-link="['detail',row.id]"></util-a>
|
|
</util-table-column>
|
|
</util-table>
|
|
</util-card> |