123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267 |
- @using MySystem.BsModels;
- @{RightDic editData = ViewBag.data as RightDic;}
- @{
- string RightInfo = ViewBag.RightInfo as string;
- string right = ViewBag.right as string;
- string PColId = ViewBag.PColId as string;
- }
- <!DOCTYPE html>
- <html>
- <head>
- <meta charset="utf-8">
- <title>导航菜单(修改)</title>
- <meta name="renderer" content="webkit">
- <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
- <meta name="viewport"
- content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
- <link rel="stylesheet" href="/layuiadmin/layui/css/layui.css" media="all">
- <script src="/admin/js/jquery-1.10.1.min.js"></script>
- <script src="/admin/js/LAreaData2.js"></script>
- </head>
- <body>
- <div class="layui-form" lay-filter="layuiadmin-form-useradmin" id="layuiadmin-form-useradmin">
- <input type="hidden" name="Id" value="@editData.Id" />
- <input type="hidden" name="OldPColId" value="@ViewBag.OldPColId" />
- <div class="layui-card">
- <div class="layui-card-body">
- <div class="layui-tab" lay-filter="mytabbar">
- <ul class="layui-tab-title">
- <li class="layui-this" lay-id="1">基本信息</li>
- <li lay-id="2">后台主界面</li>
- </ul>
- <div class="layui-tab-content mt20">
- <div class="layui-tab-item layui-show">
- <div class="layui-form-item">
- <label class="layui-form-label">上级栏目</label>
- <div class="layui-input-inline">
- <select id="PColId" name="PColId" lay-search="">
- <option value="">作为顶级导航</option>
- @{List<MySystem.BsModels.RightDic> ColIds = new MySystem.BsModels.WebCMSEntities().RightDic.OrderBy(m => m.Id).ToList();}
- @foreach (MySystem.BsModels.RightDic subColId in ColIds)
- {
- string checkCol = subColId.Id.Replace("_", "");
- string kg = "";
- for (int i = 1; i < checkCol.Length; i++)
- {
- kg += " ";
- }
- <option value="@subColId.Id" @(subColId.Id == PColId ? "selected=selected" : "")>@(kg+subColId.Name)</option>
- }
- </select>
- </div>
- </div>
- <div class="layui-form-item">
- <label class="layui-form-label">标题</label>
- <div class="layui-input-block">
- <input class="layui-input" type="text" id="Name" name="Name" value="@editData.Name"
- maxlength="50" lay-verify="" autocomplete="off" placeholder="请输入标题">
- </div>
- </div>
- </div>
- <div class="layui-tab-item">
- <div class="layui-form-item">
- <label class="layui-form-label">快捷方式</label>
- <div class="layui-input-block">
- <input type="checkbox" id="MainMenu" name="MainMenu" value="1" @(editData.MainMenu == 1 ? "checked=checked" : "") lay-skin="switch" lay-filter="switchTest" title="开关">
- </div>
- </div>
- <div class="layui-form-item">
- <label class="layui-form-label">统计</label>
- <div class="layui-input-block">
- <input type="checkbox" id="MainStat" name="MainStat" value="1" @(editData.MainStat == 1 ? "checked=checked" : "") lay-skin="switch" lay-filter="switchTest" title="开关">
- </div>
- </div>
- <div class="layui-form-item">
- <label class="layui-form-label">主界面数据列表</label>
- <div class="layui-input-block">
- <input type="checkbox" id="MainDataList" name="MainDataList" value="1" @(editData.MainDataList == 1 ? "checked=checked" : "") lay-skin="switch" lay-filter="switchTest" title="开关">
- </div>
- </div>
- </div>
- </div>
- </div>
- <div class="layui-form-item layui-hide">
- <input type="button" lay-submit lay-filter="LAY-list-front-submit" id="LAY-list-front-submit"
- value="确认">
- </div>
- </div>
- </div>
- </div>
- <script src="/layuiadmin/layui/layui.js"></script>
- <script src="/other/oss/upload-min@(MySystem.OssHelper.Instance.OssStatus ? "-oss" : "").js"></script>
- <script src="/other/mybjq/kindeditor-min.js"></script>
- <script src="/other/mybjq/lang/zh_CN.js"></script>
- <script>
- //编辑器
- KindEditor.ready(function (K) {
- });
- var ids = "";
- function getChildren(obj) {
- $.each(obj, function (index, value) {
- var id = obj[index].id;
- ids += id + ",";
- var children = obj[index].children;
- if (children) {
- getChildren(children);
- }
- });
- }
- function AreasProvinceInit(tagId, areasVal, form) {
- for (var i = 0; i < provs_data.length; i++) {
- var sel = "";
- if (areasVal.indexOf(provs_data[i].text) > -1) {
- sel = " selected=selected";
- }
- $("#" + tagId + "Province").append('<option value="' + provs_data[i].value + '"' + sel + '>' +
- provs_data[i].text + '</option>');
- }
- form.render();
- }
- function AreasProvinceSelected(tagId, areasVal, form, value) {
- $("#" + tagId + "City").html('<option value="">市</option>');
- var list = citys_data[value];
- for (var i = 0; i < list.length; i++) {
- var sel = "";
- if (areasVal.indexOf(list[i].text) > -1) {
- sel = " selected=selected";
- }
- $("#" + tagId + "City").append('<option value="' + list[i].value + '"' + sel + '>' + list[i].text +
- '</option>');
- }
- $("#" + tagId + "Area").html('<option value="">县/区</option>');
- form.render();
- $("#" + tagId + "").val($("#" + tagId + "Province option:selected").text() + "," + $("#" + tagId +
- "City option:selected").text() + "," + $("#" + tagId + "Area option:selected").text());
- }
- function AreasCitySelected(tagId, areasVal, form, value) {
- $("#" + tagId + "Area").html('<option value="">县/区</option>');
- var list = dists_data[value];
- for (var i = 0; i < list.length; i++) {
- var sel = "";
- if (areasVal.indexOf(list[i].text) > -1) {
- sel = " selected=selected";
- }
- $("#" + tagId + "Area").append('<option value="' + list[i].value + '"' + sel + '>' + list[i].text +
- '</option>');
- }
- form.render();
- $("#" + tagId + "").val($("#" + tagId + "Province option:selected").text() + "," + $("#" + tagId +
- "City option:selected").text() + "," + $("#" + tagId + "Area option:selected").text());
- }
- function AreasAreaSelected(tagId, form) {
- form.render();
- $("#" + tagId + "").val($("#" + tagId + "Province option:selected").text() + "," + $("#" + tagId +
- "City option:selected").text() + "," + $("#" + tagId + "Area option:selected").text());
- }
- function movePrev(obj, tagId) {
- $(obj).parent().prev().insertAfter($(obj).parent());
- checkPics(tagId);
- }
- function moveNext(obj, tagId) {
- $(obj).parent().next().insertBefore($(obj).parent());
- checkPics(tagId);
- }
- function deletePic(obj, tagId) {
- $(obj).parent().remove();
- checkPics(tagId);
- }
- function checkPics(tagId) {
- var pics = "";
- var texts = "";
- $("#" + tagId + "Image div img").each(function (i) {
- pics += $(this).attr("src").replace(osshost, '') + "|";
- });
- $("#" + tagId + "Image div input").each(function (i) {
- texts += $(this).val() + "|";
- });
- if (pics == "") {
- $("#" + tagId).val("");
- } else {
- pics = pics.substring(0, pics.length - 1);
- texts = texts.substring(0, pics.length - 1);
- $("#" + tagId).val(pics + "#cut#" + texts);
- }
- }
- function checkBox(tagId) {
- var text = "";
- $("input[type=checkbox][name=" + tagId + "List]:checked").each(function (i) {
- text += $(this).val() + ",";
- });
- $("#" + tagId).val(text);
- }
- function showBigPic(picpath) {
- parent.layer.open({
- type: 1,
- title: false,
- closeBtn: 0,
- shadeClose: true,
- area: ['auto', 'auto'],
- content: '<img src="' + picpath + '" style="max-width:800px; max-height:800px;" />'
- });
- }
- var tree;
- var element;
- layui.config({
- base: '/layuiadmin/' //静态资源所在路径
- }).extend({
- index: 'lib/index' //主入口模块
- }).use(['index', 'form', 'upload', 'layedit', 'laydate', 'element', 'croppers', 'transfer', 'tree', 'util'],
- function () {
- var $ = layui.$,
- form = layui.form,
- layer = layui.layer,
- layedit = layui.layedit,
- laydate = layui.laydate,
- croppers = layui.croppers,
- upload = layui.upload,
- transfer = layui.transfer,
- util = layui.util;
- tree = layui.tree;
- element = layui.element;
- //Hash地址的定位
- var layid = location.hash.replace(/^#test=/, '');
- element.tabChange('test', layid);
- element.on('tab(test)', function (elem) {
- location.hash = 'test=' + $(this).attr('lay-id');
- });
- //日期
- //上传文件
- //穿梭框
- //TreeView,比如权限管理
- //省市区
- })
- </script>
- </body>
- </html>
|