Add.cshtml 9.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237
  1. @{
  2. string RightInfo = ViewBag.RightInfo as string;
  3. string right = ViewBag.right as string;
  4. }
  5. <!DOCTYPE html>
  6. <html>
  7. <head>
  8. <meta charset="utf-8">
  9. <title>后台管理员(增加)</title>
  10. <meta name="renderer" content="webkit">
  11. <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  12. <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
  13. <link rel="stylesheet" href="/layuiadmin/layui/css/layui.css" media="all">
  14. <script src="/admin/js/jquery-1.10.1.min.js"></script>
  15. <script src="/admin/js/LAreaData2.js"></script>
  16. </head>
  17. <body>
  18. <div class="layui-form" lay-filter="layuiadmin-form-useradmin" id="layuiadmin-form-useradmin">
  19. <div class="layui-card">
  20. <div class="layui-card-body">
  21. <div class="layui-tab" lay-filter="mytabbar">
  22. <ul class="layui-tab-title">
  23. <li class="layui-this" lay-id="1">基本信息</li>
  24. </ul>
  25. <div class="layui-tab-content mt20">
  26. <div class="layui-tab-item layui-show">
  27. <div class="layui-form-item">
  28. <label class="layui-form-label">用户名</label>
  29. <div class="layui-input-inline">
  30. <input class="layui-input" type="text" id="AdminName" name="AdminName" maxlength="50"
  31. lay-verify="" autocomplete="off" placeholder="请输入用户名">
  32. </div>
  33. </div>
  34. <div class="layui-form-item">
  35. <label class="layui-form-label">密码</label>
  36. <div class="layui-input-inline">
  37. <input class="layui-input" type="password" id="Password" name="Password" lay-verify=""
  38. autocomplete="off" placeholder="请输入密码">
  39. </div>
  40. </div>
  41. <div class="layui-form-item">
  42. <label class="layui-form-label">名称</label>
  43. <div class="layui-input-inline">
  44. <input class="layui-input" type="text" id="RealName" name="RealName" maxlength="50"
  45. lay-verify="" autocomplete="off" placeholder="请输入名称">
  46. </div>
  47. </div>
  48. @{Dictionary<string, string> SysAdminRoleNewDic = new MySystem.DictionaryClass().getSysAdminRoleNewDic();}
  49. <div class="layui-form-item">
  50. <label class="layui-form-label">角色</label>
  51. <div class="layui-input-inline">
  52. <select id="Role" name="Role" lay-search="">
  53. <option value="">请选择</option>
  54. @foreach (string key in SysAdminRoleNewDic.Keys)
  55. {
  56. <option value="@key">@SysAdminRoleNewDic[key]</option>
  57. }
  58. </select>
  59. </div>
  60. </div>
  61. </div>
  62. </div>
  63. </div>
  64. <div class="layui-form-item layui-hide">
  65. <input type="button" lay-submit lay-filter="LAY-list-front-submit" id="LAY-list-front-submit" value="确认">
  66. </div>
  67. </div>
  68. </div>
  69. </div>
  70. <script src="/layuiadmin/layui/layui.js"></script>
  71. <script src="/other/oss/upload-min@(MySystem.OssHelper.Instance.OssStatus ? "-oss" : "").js"></script>
  72. <script src="/other/mybjq/kindeditor-min.js"></script>
  73. <script src="/other/mybjq/lang/zh_CN.js"></script>
  74. <script>
  75. //编辑器
  76. KindEditor.ready(function (K) {
  77. });
  78. var ids = "";
  79. function getChildren(obj) {
  80. $.each(obj, function (index, value) {
  81. var id = obj[index].id;
  82. ids += id + ",";
  83. var children = obj[index].children;
  84. if (children) {
  85. getChildren(children);
  86. }
  87. });
  88. }
  89. function AreasProvinceInit(tagId, areasVal, form) {
  90. for (var i = 0; i < provs_data.length; i++) {
  91. var sel = "";
  92. if (areasVal.indexOf(provs_data[i].text) > -1) {
  93. sel = " selected=selected";
  94. }
  95. $("#" + tagId + "Province").append('<option value="' + provs_data[i].value + '"' + sel + '>' + provs_data[i].text + '</option>');
  96. }
  97. form.render();
  98. }
  99. function AreasProvinceSelected(tagId, areasVal, form, value) {
  100. $("#" + tagId + "City").html('<option value="">市</option>');
  101. var list = citys_data[value];
  102. for (var i = 0; i < list.length; i++) {
  103. var sel = "";
  104. if (areasVal.indexOf(list[i].text) > -1) {
  105. sel = " selected=selected";
  106. }
  107. $("#" + tagId + "City").append('<option value="' + list[i].value + '"' + sel + '>' + list[i].text + '</option>');
  108. }
  109. $("#" + tagId + "Area").html('<option value="">县/区</option>');
  110. form.render();
  111. $("#" + tagId + "").val($("#" + tagId + "Province option:selected").text() + "," + $("#" + tagId + "City option:selected").text() + "," + $("#" + tagId + "Area option:selected").text());
  112. }
  113. function AreasCitySelected(tagId, areasVal, form, value) {
  114. $("#" + tagId + "Area").html('<option value="">县/区</option>');
  115. var list = dists_data[value];
  116. for (var i = 0; i < list.length; i++) {
  117. var sel = "";
  118. if (areasVal.indexOf(list[i].text) > -1) {
  119. sel = " selected=selected";
  120. }
  121. $("#" + tagId + "Area").append('<option value="' + list[i].value + '"' + sel + '>' + list[i].text + '</option>');
  122. }
  123. form.render();
  124. $("#" + tagId + "").val($("#" + tagId + "Province option:selected").text() + "," + $("#" + tagId + "City option:selected").text() + "," + $("#" + tagId + "Area option:selected").text());
  125. }
  126. function AreasAreaSelected(tagId, form) {
  127. form.render();
  128. $("#" + tagId + "").val($("#" + tagId + "Province option:selected").text() + "," + $("#" + tagId + "City option:selected").text() + "," + $("#" + tagId + "Area option:selected").text());
  129. }
  130. function movePrev(obj, tagId) {
  131. $(obj).parent().prev().insertAfter($(obj).parent());
  132. checkPics(tagId);
  133. }
  134. function moveNext(obj, tagId) {
  135. $(obj).parent().next().insertBefore($(obj).parent());
  136. checkPics(tagId);
  137. }
  138. function deletePic(obj, tagId) {
  139. $(obj).parent().remove();
  140. checkPics(tagId);
  141. }
  142. function checkPics(tagId) {
  143. var pics = "";
  144. var texts = "";
  145. $("#" + tagId + "Image div img").each(function (i) {
  146. pics += $(this).attr("src").replace(osshost, '') + "|";
  147. });
  148. $("#" + tagId + "Image div input").each(function (i) {
  149. texts += $(this).val() + "|";
  150. });
  151. if (pics == "") {
  152. $("#" + tagId).val("");
  153. } else {
  154. pics = pics.substring(0, pics.length - 1);
  155. texts = texts.substring(0, pics.length - 1);
  156. $("#" + tagId).val(pics + "#cut#" + texts);
  157. }
  158. }
  159. function checkBox(tagId) {
  160. var text = "";
  161. $("input[type=checkbox][name=" + tagId + "List]:checked").each(function (i) {
  162. text += $(this).val() + ",";
  163. });
  164. $("#" + tagId).val(text);
  165. }
  166. function showBigPic(picpath) {
  167. parent.layer.open({
  168. type: 1,
  169. title: false,
  170. closeBtn: 0,
  171. shadeClose: true,
  172. area: ['auto', 'auto'],
  173. content: '<img src="' + picpath + '" style="max-width:800px; max-height:800px;" />'
  174. });
  175. }
  176. var tree;
  177. var element;
  178. var upload;
  179. layui.config({
  180. base: '/layuiadmin/' //静态资源所在路径
  181. }).extend({
  182. index: 'lib/index' //主入口模块
  183. }).use(['index', 'form', 'upload', 'layedit', 'laydate', 'element', 'croppers', 'transfer', 'tree', 'util'], function () {
  184. var $ = layui.$
  185. , form = layui.form
  186. , layer = layui.layer
  187. , layedit = layui.layedit
  188. , laydate = layui.laydate
  189. , croppers = layui.croppers
  190. , transfer = layui.transfer
  191. , util = layui.util;
  192. tree = layui.tree;
  193. element = layui.element;
  194. upload = layui.upload;
  195. //Hash地址的定位
  196. var layid = location.hash.replace(/^#test=/, '');
  197. element.tabChange('test', layid);
  198. element.on('tab(test)', function (elem) {
  199. location.hash = 'test=' + $(this).attr('lay-id');
  200. });
  201. //日期
  202. //上传文件
  203. //穿梭框
  204. //TreeView,比如权限管理
  205. //省市区
  206. })
  207. </script>
  208. </body>
  209. </html>