From 0c0b623a14783893b5bd44b5d51bebb00d88690a Mon Sep 17 00:00:00 2001 From: augushong Date: Tue, 11 Apr 2023 15:56:16 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0formFullScreen=E9=85=8D?= =?UTF-8?q?=E7=BD=AE=E9=A1=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/static/admin/js/mall/goods.js | 20 ++------------------ public/static/plugs/easy-admin/easy-admin.js | 10 ++++++++-- 2 files changed, 10 insertions(+), 20 deletions(-) diff --git a/public/static/admin/js/mall/goods.js b/public/static/admin/js/mall/goods.js index dddf040..5bf5deb 100644 --- a/public/static/admin/js/mall/goods.js +++ b/public/static/admin/js/mall/goods.js @@ -11,6 +11,7 @@ define(["jquery", "easy-admin"], function ($, ea) { modify_url: 'mall.goods/modify', stock_url: 'mall.goods/stock', read_url: 'mall.goods/read', + formFullScreen: true, }; var Controller = { @@ -19,17 +20,6 @@ define(["jquery", "easy-admin"], function ($, ea) { ea.table.render({ init: init, totalRow: true, - toolbar: ['refresh', - [{ - text: '添加', - url: init.add_url, - method: 'open', - auth: 'add', - class: 'layui-btn layui-btn-normal layui-btn-sm', - icon: 'fa fa-plus ', - extend: 'data-full="true"', - }], - 'delete', 'export'], cols: [[ { type: "checkbox" }, { field: 'id', width: 80, title: 'ID', totalRowText: '合计:' }, @@ -72,14 +62,8 @@ define(["jquery", "easy-admin"], function ($, ea) { templet: ea.table.tool, fixed: 'right', operat: [ + 'edit', [{ - text: '编辑', - url: init.edit_url, - method: 'open', - auth: 'edit', - class: 'layui-btn layui-btn-xs layui-btn-success', - extend: 'data-full="true"', - }, { text: '入库', url: init.stock_url, method: 'open', diff --git a/public/static/plugs/easy-admin/easy-admin.js b/public/static/plugs/easy-admin/easy-admin.js index 795a2be..3fec874 100644 --- a/public/static/plugs/easy-admin/easy-admin.js +++ b/public/static/plugs/easy-admin/easy-admin.js @@ -387,6 +387,12 @@ define(["jquery", "tableSelect", "ckeditor", 'miniTheme', 'tableData', 'citypick options.height = 'full-85' } + if (options.init.formFullScreen == true) { + options.init.formFullScreen = 'true' + } else { + options.init.formFullScreen = 'false' + } + options.toolbar = admin.table.renderToolbar(options.toolbar, options.elem, options.id, options.init); // 判断是否有操作列表权限 @@ -458,7 +464,7 @@ define(["jquery", "tableSelect", "ckeditor", 'miniTheme', 'tableData', 'citypick toolbarHtml += ' \n'; } else if (v === 'add') { if (admin.checkAuth('add', elem)) { - toolbarHtml += '\n'; + toolbarHtml += '\n'; } } else if (v === 'delete') { if (admin.checkAuth('delete', elem)) { @@ -952,7 +958,7 @@ define(["jquery", "tableSelect", "ckeditor", 'miniTheme', 'tableData', 'citypick title: '编辑信息', auth: 'edit', url: option.init.edit_url, - extend: "" + extend: option.init.formFullScreen == 'true' ? ' data-full="true"' : '' }; operat.url = admin.table.toolSpliceUrl(operat.url, operat.field, data); if (admin.checkAuth(operat.auth, elem)) {