_ModalBody.cshtml 7.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170
  1. @using System.Linq;
  2. @using Abp.Extensions
  3. @using ShwasherSys.Models.Modal
  4. @model ModalBodyViewModel
  5. <div class="modal-body container-fluid" style="padding-top: 15px;padding-bottom: 0;">
  6. <form class="pr-3 pl-3 form-horizontal " id="@Model.FormId">
  7. @{
  8. //string type = "text";
  9. string oBefore, oAfter, iBefore, iAfter;
  10. if (Model.Specials != null && Model.Specials.Any())
  11. {
  12. foreach (var i in Model.Inputs)
  13. {
  14. oBefore = "";
  15. oAfter = "";
  16. iBefore = "";
  17. iAfter = "";
  18. var special = Model.Specials.FirstOrDefault(a => a.Id == i.Id);
  19. if (!string.IsNullOrEmpty(i.DivOutBefore))
  20. {
  21. oBefore = i.DivOutBefore;
  22. }
  23. if (!string.IsNullOrEmpty(i.DivOutAfter))
  24. {
  25. oAfter = i.DivOutAfter;
  26. }
  27. if (!string.IsNullOrEmpty(i.DivInterBefore))
  28. {
  29. iBefore = i.DivInterBefore;
  30. }
  31. if (!string.IsNullOrEmpty(i.DivInterAfter))
  32. {
  33. iAfter = i.DivInterAfter;
  34. }
  35. @Html.Raw(oBefore)
  36. <div class="form-group-sm @i.DivClass" @i.DivOther>
  37. @Html.Raw(i.Lable)
  38. @if (special != null)
  39. {
  40. @Html.Raw(special.InputStr)
  41. }
  42. else
  43. {
  44. if (i.IsHidden)
  45. {
  46. <input id="@i.Id" name="@i.Name" type="hidden" />
  47. }
  48. else
  49. {
  50. <div class="col-md-10">
  51. @Html.Raw(iBefore)
  52. @if (i.Types == InputTypes.List)
  53. {
  54. var style = i.Styles.IsNullOrEmpty() ? "width:100%" : i.Styles;
  55. <select class="@i.Class @i.Required" id="@i.Id" name="@i.Name" placeholder="@L("SelectPlaceholder")" value="@i.Value" @i.DataOptions @i.Events @i.Disabled @i.ReadOnly style="@style" @i.Other>
  56. @Html.Raw(i.SelectOptions)
  57. </select>
  58. }
  59. else if (i.Types == InputTypes.Textarea)
  60. {
  61. <textarea rows="2" class="@i.Class @i.Required" id="@i.Id" name="@i.Name" value="@i.Value" @i.DataOptions @i.Events @i.Disabled @i.ReadOnly style="@i.Styles" @i.Other></textarea>
  62. }
  63. else
  64. {
  65. if (!string.IsNullOrEmpty(i.SearchModalId))
  66. {
  67. <div class="input-group" style="width: 100%">
  68. <input class="@i.Class @i.Required " id="@i.Id" name="@i.Name" type="@i.TypeStr" @i.DataOptions @i.Events @i.Disabled @i.IsReadOnly style="@i.Styles" @i.Other />
  69. <div class="input-group-addon" onclick="ShowQueryModal('@i.SearchModalId','@i.TargetDom',this);">
  70. <i class="iconfont icon-search"></i>
  71. </div>
  72. </div>
  73. }
  74. else
  75. {
  76. <input class="@i.Class @i.Required " id="@i.Id" name="@i.Name" type="@i.TypeStr" @i.DataOptions @i.Events @i.Disabled @i.IsReadOnly style="@i.Styles" @i.Other />
  77. }
  78. }
  79. @Html.Raw(iAfter)
  80. </div>
  81. }
  82. }
  83. </div>
  84. @Html.Raw(oAfter)
  85. }
  86. }
  87. else
  88. {
  89. foreach (var i in Model.Inputs)
  90. {
  91. oBefore = "";
  92. oAfter = "";
  93. iBefore = "";
  94. iAfter = "";
  95. if (!string.IsNullOrEmpty(i.DivOutBefore))
  96. {
  97. oBefore = i.DivOutBefore;
  98. }
  99. if (!string.IsNullOrEmpty(i.DivOutAfter))
  100. {
  101. oAfter = i.DivOutAfter;
  102. }
  103. if (!string.IsNullOrEmpty(i.DivInterBefore))
  104. {
  105. iBefore = i.DivInterBefore;
  106. }
  107. if (!string.IsNullOrEmpty(i.DivInterAfter))
  108. {
  109. iAfter = i.DivInterAfter;
  110. }
  111. @Html.Raw(oBefore)
  112. <div class="form-group-sm @i.DivClass" @i.DivOther>
  113. @Html.Raw(i.Lable)
  114. @if (i.IsHidden)
  115. {
  116. <input id="@i.Id" name="@i.Name" type="hidden" />
  117. }
  118. else
  119. {
  120. <div class="col-md-10">
  121. @Html.Raw(iBefore)
  122. @if (i.Types == InputTypes.List)
  123. {
  124. var style = i.Styles.IsNullOrEmpty() ? "width:100%" : i.Styles;
  125. <select class="@i.Class @i.Required" id="@i.Id" name="@i.Name" placeholder="@L("SelectPlaceholder")" value="@i.Value" @i.DataOptions @i.Events @i.Disabled @i.ReadOnly style="@style" @i.Other>
  126. @Html.Raw(i.SelectOptions)
  127. </select>
  128. }
  129. else if (i.Types == InputTypes.Textarea)
  130. {
  131. <textarea rows="2" class="@i.Class @i.Required" id="@i.Id" name="@i.Name" value="@i.Value" @i.DataOptions @i.Events @i.Disabled @i.ReadOnly style="@i.Styles" @i.Other></textarea>
  132. }
  133. else
  134. {
  135. if (!string.IsNullOrEmpty(i.SearchModalId))
  136. {
  137. <div class="input-group" style="width: 100%">
  138. <input class="@i.Class @i.Required" id="@i.Id" name="@i.Name" type="@i.TypeStr" placeholder="请输入@(i.DisplayName)..." value="@i.Value" @i.DataOptions @i.Events @i.Disabled @i.ReadOnly style="@i.Styles" @i.Other />
  139. <div class="input-group-addon" onclick="ShowQueryModal('@i.SearchModalId','@i.TargetDom',this);">
  140. <i class="iconfont icon-search"></i>
  141. </div>
  142. </div>
  143. }
  144. else
  145. {
  146. @*@L("InputPlaceholder")*@
  147. <input class="@i.Class @i.Required" id="@i.Id" name="@i.Name" type="@i.TypeStr" placeholder="请输入@(i.DisplayName)..." value="@i.Value" @i.DataOptions @i.Events @i.Disabled @i.ReadOnly style="@i.Styles" @i.Other />
  148. }
  149. }
  150. @Html.Raw(iAfter)
  151. </div>
  152. }
  153. </div>
  154. @Html.Raw(oAfter)
  155. }
  156. }
  157. }
  158. </form>
  159. </div>