From 7caedfd2236161e37956ad28f1a6d80eb0f8c4d3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=82=B9=E6=99=AF=E7=AB=8B?= Date: Wed, 22 Feb 2017 15:32:13 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E8=8F=9C=E5=8D=95=E6=A8=A1?= =?UTF-8?q?=E5=9D=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/admin/view/menu.form.html | 37 ++++++++++++++++++++++++++ application/admin/view/menu.index.html | 14 +++++++--- public/static/admin/listen.js | 4 +-- public/static/admin/plugs.js | 8 +++--- 4 files changed, 53 insertions(+), 10 deletions(-) create mode 100644 application/admin/view/menu.form.html diff --git a/application/admin/view/menu.form.html b/application/admin/view/menu.form.html new file mode 100644 index 000000000..10be1aebe --- /dev/null +++ b/application/admin/view/menu.form.html @@ -0,0 +1,37 @@ +
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+ +
+
+
+ + +
+ +
diff --git a/application/admin/view/menu.index.html b/application/admin/view/menu.index.html index 619dda516..39db8aef5 100644 --- a/application/admin/view/menu.index.html +++ b/application/admin/view/menu.index.html @@ -1,6 +1,12 @@ {extend name='extra@admin/content' /} {block name="content"} + +
+ + +
+
@@ -14,7 +20,7 @@ - + @@ -29,10 +35,10 @@ - + -
菜单名称菜单链接菜单链接 状态 操作
- + {$vo.spl}{$vo.title}{$vo.url}{$vo.url} {if $vo.status eq 0} 已禁用 @@ -40,7 +46,7 @@ 使用中 {/if} + {if auth("$classuri/edit")} | 编辑 diff --git a/public/static/admin/listen.js b/public/static/admin/listen.js index 15317e588..8d74260a0 100644 --- a/public/static/admin/listen.js +++ b/public/static/admin/listen.js @@ -18,7 +18,7 @@ define(['jquery', 'admin.plugs'], function () { /*! 注册 data-modal 事件行为 */ this.$body.on('click', '[data-modal]', function () { - return $.form.modal($(this).attr('data-modal'), 'open_type=modal'); + return $.form.modal($(this).attr('data-modal'), 'open_type=modal', $(this).attr('data-title') || '编辑'); }); /*! 注册 data-open 事件行为 */ @@ -89,7 +89,7 @@ define(['jquery', 'admin.plugs'], function () { /*! 注册 data-icon 事件行为 */ this.$body.on('click', '[data-icon]', function () { - var field = $(this).attr('data-field') || 'icon'; + var field = $(this).attr('data-icon') || $(this).attr('data-field') || 'icon'; var url = window.ROOT_URL + '/index.php/admin/plugs/icon.html?field=' + field; $.form.iframe(url, '图标选择'); }); diff --git a/public/static/admin/plugs.js b/public/static/admin/plugs.js index ed071a60e..40ec6e517 100644 --- a/public/static/admin/plugs.js +++ b/public/static/admin/plugs.js @@ -293,11 +293,12 @@ define(['zeroclipboard', 'jquery'], function (ZeroClipboard) { * 加载HTML到弹出层 * @param url * @param data + * @param title * @param callback * @param loading * @param tips */ - _form.prototype.modal = function (url, data, callback, loading, tips) { + _form.prototype.modal = function (url, data, title, callback, loading, tips) { this.load(url, data, 'GET', function (res) { if (typeof (res) === 'object') { return $.msg.auto(res); @@ -306,14 +307,13 @@ define(['zeroclipboard', 'jquery'], function (ZeroClipboard) { area: "800px", content: res, btn: false, + title: title || '', success: function (dom, index) { var $container = $(dom); /* 处理样式及返回按钮事件 */ - $container.find('.wrapper').css('minWidth', '760px').find('[data-back]').off('click').on('click', function () { + $container.find('[data-close]').off('click').on('click', function () { layer.close(index); }); - /* 处理标题 */ - $container.find('.layui-layer-title').html($container.find('.ibox-title').hide().find('h5').html()); /* 事件重载 */ $.form.reInit($container); }