CodePreview.cshtml
3.38 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
@using Hh.Mes.POJO.ViewModel
@model CodePreviewVM
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
@{
ViewData["Title"] = "代码预览";
Layout = "~/Views/Shared/_Layout.cshtml";
}
@section header {
<link href="~/lib/highlight.js/styles/vs.min.css" rel="stylesheet" />
<style type="text/css">
#areaSelect {
width: 150px;
margin-right: 8px;
}
.form-query {
margin-top: 5px;
}
.container-head {
position: fixed;
height:45px;
z-index: 99999;
width: 100%;
background-color:white;
}
.VPContent {
padding-top: 45px;
}
.layui-tab-title {
position: fixed;
background-color:white;
width: 100%;
}
.layui-tab-content {
padding-top: 35px;
}
</style>
}
<!--from表单-->
<div class="layui-container container-head">
<div class="layui-row form-query">
<form class="layui-form" method="post">
<div id="areaSelect" class="layui-input-inline layui-col-md5 layui-col-xs5">
<input asp-for="AreaName" list="AreaList" class="layui-input" placeholder="请输入Area名称" />
<datalist id="AreaList">
@foreach (var item in Model.AreaItems)
{
<option value="@item" />
}
</datalist>
</div>
<input asp-for="EntityName" style="display: none;" />
<div class="layui-col-md3 layui-col-xs3">
<button type="submit" class="layui-btn layui-btn-primary">选区域后点击预览</button>
</div>
<div asp-validation-summary="All" class="layui-col-md2 layui-col-xs2 div-relative " style="color: #FF5722; top: 7px;">
</div>
</form>
<div>
<a class="layui-btn layui-btn-normal @(Model.SaveBtnDisabled ? "layui-btn-disabled" : "")" asp-action="SaveCodeFile" asp-all-route-data='new Dictionary<string, string> { { "entityName", Model.EntityName },{"areaName", Model.AreaName} }'>保存</a>
</div>
</div>
</div>
<!--代码预览-->
<div class="layui-tab layui-tab-brief VPContent">
<ul class="layui-tab-title">
<li class="layui-this">Controller</li>
<li>Service</li>
<li>Model</li>
<li>Cshtml</li>
<li>JavaScript</li>
</ul>
<div class="layui-tab-content">
<div class="layui-tab-item layui-show">
<pre><code class="language-csharp">@Model.ControllerTemp</code></pre>
</div>
<div class="layui-tab-item">
<pre><code class="language-csharp">@Model.ServiceTemp</code></pre>
</div>
<div class="layui-tab-item">
<pre><code class="language-csharp">@Model.ModelTemp</code></pre>
</div>
<div class="layui-tab-item">
<pre><code class="language-html">@Model.CshtmlTemp</code></pre>
</div>
<div class="layui-tab-item">
<pre><code class="language-javascript">@Model.JavaScriptTemp</code></pre>
</div>
</div>
</div>
@section Scripts {
<script src="~/lib/highlight.js/highlight.min.js"></script>
<script>
layui.use(['element'], function () {
var element = layui.element;
});
hljs.highlightAll();
</script>
}