OpenAuth.Net/CodeSmith/CSharp/Web/Index.cshtml.cst

95 lines
4.3 KiB
Plaintext
Raw Normal View History

2017-11-29 18:26:36 +08:00
<%--
Name: 列表页面
Author: yubaolee
Description: 列表页面
--%>
<%@ CodeTemplate Language="C#" TargetLanguage="C#" Debug="False" Encoding="utf-8" Description="添加模块" %>
<%@ Property Name="SourceTable" Type="SchemaExplorer.TableSchema" Category="Context"
Description="连接的数据库" %>
<%@ Property Name="ModuleName" Type="String" Category="Context" Description="模块名称" %>
<%@ Map Name="CSharpAlias" Src="System-CSharpAlias" Description="System to C# Type Map" %>
<%@ Assembly Name="SchemaExplorer" %>
<%@ Import Namespace="SchemaExplorer" %>
<%@ Assembly Src="Util.cs" %>
<%@ Import Namespace="Util" %>
@section header
{
<link rel="stylesheet" href="/css/treetable.css" />
}
2018-04-13 07:10:02 +08:00
<blockquote class="layui-elem-quote news_search toolList" id="menus">
2017-11-29 18:26:36 +08:00
</blockquote>
<div class="layui-card">
<table class="layui-table" id="mainList"
lay-data="{height: 'full-80', page:true, id:'mainList'}"
lay-filter="list" lay-size="sm">
</table>
<script type="text/html" id="Disable">
{{# if(d.Disable){ }}
<span class="layui-badge">已禁用</span>
{{# } else{}}
<span class="layui-badge layui-bg-green">正常</span>
{{# } }}
</script>
</div>
2018-04-13 07:10:02 +08:00
<!--添加/编辑窗口-->
2017-11-29 18:26:36 +08:00
<div id="divEdit" style="display: none">
2025-02-25 15:52:30 +08:00
<form class="layui-form" action="" id="formEdit" lay-filter="formEdit">
2017-11-29 18:26:36 +08:00
<% foreach (ColumnSchema column in this.SourceTable.Columns) {
2025-02-25 15:52:30 +08:00
var typename = CSharpAlias[column.SystemType.FullName];
//Response.WriteLine(typename);
2017-11-29 18:26:36 +08:00
if(column.IsPrimaryKeyMember){%>
2025-02-25 15:52:30 +08:00
<input type="hidden" name="<%=column.Name%>" />
2017-11-29 18:26:36 +08:00
<%}else if(CSharpAlias[column.SystemType.FullName] == "bool") {%>
<div class="layui-form-item">
<label class="layui-form-label"><%=Tools.GetDescription(column)%></label>
<div class="layui-input-block">
2025-02-25 15:52:30 +08:00
<input type="checkbox" name="<%=column.Name%>" lay-skin="switch" value="1">
</div>
</div>
<%}else if(CSharpAlias[column.SystemType.FullName] == "System.DateTime") {%>
<div class="layui-form-item">
<label class="layui-form-label"><%=Tools.GetDescription(column)%></label>
<div class="layui-input-block">
<input type="text" name="<%=column.Name%>" id="<%=column.Name%>" lay-verify="date" placeholder="yyyy-MM-dd" autocomplete="off" class="layui-input">
2017-11-29 18:26:36 +08:00
</div>
</div>
<%}else if(CSharpAlias[column.SystemType.FullName] == "int" ) {%>
<div class="layui-form-item">
<label class="layui-form-label"><%=Tools.GetDescription(column)%></label>
<div class="layui-input-block">
2025-02-25 15:52:30 +08:00
<input type="number" name="<%=column.Name%>" placeholder="" autocomplete="off" class="layui-input" min="0" step="1" lay-affix="number">
2017-11-29 18:26:36 +08:00
</div>
</div>
<%} else {%>
<div class="layui-form-item">
<label class="layui-form-label"><%=Tools.GetDescription(column)%></label>
<div class="layui-input-block">
2025-02-25 15:52:30 +08:00
<input type="text" name="<%=column.Name%>" required lay-verify="required"
2017-11-29 18:26:36 +08:00
placeholder="<%=Tools.GetDescription(column)%>" autocomplete="off" class="layui-input">
</div>
</div>
<%} %>
<%} %>
<%if(Tools.NeedCascade(SourceTable)){ %>
<div class="layui-form-item">
<label class="layui-form-label">所属部门</label>
<div class="layui-input-block">
<input id="Organizations" name="Organizations" v-model="Organizations" required lay-verify="required" class="layui-input" />
<input id="OrganizationIds" name="OrganizationIds" v-model="OrganizationIds" required lay-verify="required" type="hidden" />
<div id="menuContent" class="menuContent" style="display: none;">
<ul id="org" class="ztree"></ul>
</div>
</div>
</div>
<%} %>
2017-12-18 22:37:51 +08:00
<div class="layui-form-item">
<div class="layui-input-block">
<button class="layui-btn" lay-submit lay-filter="formSubmit">立即提交</button>
<button type="reset" class="layui-btn layui-btn-primary">重置</button>
</div>
</div>
2017-11-29 18:26:36 +08:00
</form>
</div>
<script type="text/javascript" src="/layui/layui.js"></script>
<script type="text/javascript" src="/userJs/<%=ModuleName.ToLower()%>s.js"></script>