Edit.cshtml 10 KB

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